aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/indent/parse.c
Commit message (Collapse)AuthorAgeFilesLines
* usr.bin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-3/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* usr.bin: Remove ancient SCCS tags.Warner Losh2023-11-271-3/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* indent(1): add fallthrough markersPiotr Pawel Stefaniak2020-05-211-0/+1
| | | | | | | | | | | This silences -Wimplicit-fallthrough warnings. Submitted by: Michael Paquier Obtained from: postgresql.org MFC after: 3 days Notes: svn path=/head/; revision=361337
* indent: fix the -fno-common buildKyle Evans2020-04-061-0/+4
| | | | | | | | | | | | Spread the globals far and wide, hopefully to the files that make the most sense. -fno-common will become the default in GCC10/LLVM11. MFC after: 3 days Notes: svn path=/head/; revision=359678
* indent(1): revert r334640 and r334632Piotr Pawel Stefaniak2018-08-111-3/+1
| | | | | | | | | While STACKSIZE macro is indeed problematic on some systems, the commits were wrong to shrink il[] and cstk[], because they need to be of the same size as p_stack[] as they're accessed with the same index ps.tos. Notes: svn path=/head/; revision=337651
* indent(1): move case_indent from parser state to the options structPiotr Pawel Stefaniak2018-07-151-3/+3
| | | | | | | This was missed in r334927. Notes: svn path=/head/; revision=336318
* indent(1): group global option variables into an options structurePiotr Pawel Stefaniak2018-06-101-7/+7
| | | | | | | | | It's clearer now when a variable represents a toggable command line option. Many options were stored in the parser's state structure, so fix also that. Notes: svn path=/head/; revision=334927
* indent(1): fix buildworld after r334632Piotr Pawel Stefaniak2018-06-041-1/+1
| | | | | | | | | | | Fix error: comparison of integers of different signs: 'int' and 'unsigned long' by casting nitems() to int. Reported by: mjg Notes: svn path=/head/; revision=334640
* indent(1): remove the STACKSIZE macro and all of its usePiotr Pawel Stefaniak2018-06-041-1/+3
| | | | | | | It conflicts with a system-provided macro of the same name on another OS. Notes: svn path=/head/; revision=334632
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-181-0/+2
| | | | | | | | | | | | | | | | | | | | The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* indent(1): Avoid out-of-bound accesses of array ps.p_stack.Pedro F. Giffuni2016-12-021-1/+1
| | | | | | | Submitted by: Piotr Stefaniak Notes: svn path=/head/; revision=309419
* indent(1): Remove an extra newline added in a previous commit.Pedro F. Giffuni2016-12-021-1/+0
| | | | | | | It doesn't math the remaining of the case statement. Notes: svn path=/head/; revision=309417
* indent(1): Optimize parser stack usage.Pedro F. Giffuni2016-12-021-1/+7
| | | | | | | | | | | | | | When special else-if processing is enabled (-ei), we can assume "else if" and "if" to be equivalent for indentation purposes. This reduction saves a lot of stack space in case of a long "if-else-if ... else-if" sequence; with this change, Postgres/src/bin/psql/tab-complete.c as of 9.6beta3 requires minimum of the stack length to be 31 instead of 444. Submitted by: Piotr Sephaniak Notes: svn path=/head/; revision=309415
* indent(1): minor off-by-one error.Pedro F. Giffuni2016-11-271-1/+1
| | | | | | | | | This was introduced in r303571. Obtianed from: Piotr Stefaniak Notes: svn path=/head/; revision=309217
* indent(1): add some comments to quiet down Coverity.Pedro F. Giffuni2016-08-231-1/+2
| | | | | | | | | | | Hopefully adding comments should help explain the code to both static checkers and humans. CID: 976543, 976544, 976545 Obtained from: Piotr Stephaniak Notes: svn path=/head/; revision=304651
* indent(1): Use a dash in the license headers.Pedro F. Giffuni2016-08-011-1/+1
| | | | | | | | Use of the canonical dash avoids indent(1) from reformatting the license headers. Notes: svn path=/head/; revision=303625
* indent(1): Bail out if there's no more space on the parser stack.Pedro F. Giffuni2016-07-311-0/+4
| | | | | | | | | | | | Also increase the stack size still keeping a conservative value of 256. This is based on a similar changes done for PostgreSQL which instead uses a stack size of 1000. Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Submitted by: Piotr Stefaniak (with changes) Notes: svn path=/head/; revision=303571
* err() on allocation failure. WARNS=9 compliantPhilippe Charnier2003-06-151-1/+3
| | | | | | | | use #if 0, #ifndef lint, #endif /* not lint */, #endif ordering when a message is provided, use errx() instead of err(). Notes: svn path=/head/; revision=116390
* SpellingPhilippe Charnier2002-10-161-1/+1
| | | | Notes: svn path=/head/; revision=105244
* Consistently use FBSDIDDavid E. O'Brien2002-06-301-2/+2
| | | | Notes: svn path=/head/; revision=99112
* Remove deprecated register qualifier.Juli Mallett2002-06-241-1/+1
| | | | Notes: svn path=/head/; revision=98771
* Make this compile cleanly when warnings are enabled:Jens Schweikhardt2001-10-281-8/+12
| | | | | | | | | | | | | | | | | - ANSIfy function declarations - braces around initializers structs within structs - add parens in complicated expressions - disambiguate dangling elses - no more implicit int - make functions static where possible - use prototypes - don't use varargs hack for diag() Requested by: joerg MFC after: 2 weeks Notes: svn path=/head/; revision=85632
* Don't abuse the SCCS `@(#)' for RCS.David E. O'Brien2000-12-251-1/+1
| | | | | | | Requested by: bde Notes: svn path=/head/; revision=70342
* Add or fix FreeBSD IDs.David E. O'Brien2000-12-091-0/+2
| | | | Notes: svn path=/head/; revision=69796
* Improve handling of "do ... while" following "else". This changeRobert Nordier1999-05-211-1/+1
| | | | | | | eliminates some incorrect "Unmatched 'else'" errors. Notes: svn path=/head/; revision=47361
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-11/+11
| | | | Notes: svn path=/head/; revision=8874
* BSD 4.4 Lite Usr.bin SourcesRodney W. Grimes1994-05-271-0/+324
Notes: svn path=/cvs2svn/branches/CHRISTOS/; revision=1590