summaryrefslogtreecommitdiff
path: root/src/scanflags.c
Commit message (Collapse)AuthorAge
* Avoid realloc on every call of sf_push()Tobias Klauser2016-04-28
| | | | | | | | | | | | | | | | | | Currently, every call to sf_push() realloc()'s _sf_stack, even if the maximum size _sf_max wasn't changed. As the indentation beneath the "if" clause already indicates, the realloc() should only be executed if _sf_max was increased. Found by compiling flex with the -Wmisleading-indentation flags of gcc, which leads to the following warning: scanflags.c: In function ‘sf_push’: scanflags.c:42:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (_sf_top_ix + 1 >= _sf_max) ^~ scanflags.c:44:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ _sf_stk = realloc(_sf_stk, sizeof(scanflags_t) * _sf_max); ^~~~~~~
* Removed flex_realloc().Michael McConville2015-12-09
| | | | | As with flex_alloc(), replace calls to flex_realloc(), which was just a wrapper around realloc().
* Removed flex_alloc; cleaned up style.Michael McConville2015-12-09
| | | | | | | | | | | The function flex_alloc() was just a wrapper around malloc(). Since this only added unclarity, and the flex_alloc() function is likely a legacy of olden times, remove it in favor of calls to malloc() directly. Style elements cleaned up: * superfluous spacing around parentheses * non-constant initialization in variable declarations * needless casts * almost all uses of assignments as subexpressions
* NetBSD downstream patches.Christos Zoulas2014-11-11
| | | | | | | | | | | | | | | | const fixes. -Wconversion fixes for the skeleton files. param namespace protection (add _ to inline function parameters). unused variable/code removal. rename warn to lwarn to avoid conflict with <err.h>. ctype.h function argument correction. merged the error functions lerrif and lerrsf -> lerr.
* Allow error reporting routines to accept varying number of arguments in ↵Mariusz Pluciński2014-07-25
| | | | modern style
* move flex program sources into src/ directoryWill Estes2014-02-16
The *.[chly] sources are now in the src directory. This implies a bunch of changes in Makefile.am and friends to account for the new location. The .gitignore files are now more local to places where various object files and generated source files occur.