Commit Graph

18 Commits

Author SHA1 Message Date
H. Peter Anvin
53f1559c06 Remove unnecessary C99-isms
In order to make it more likely to compile cleanly with "C90 plus long
long" style compilers, remove existing constructs (mostly commas at
the end of enums) that aren't compliant.

Ironically enough this was most likely an unintentional omission in
C90...

From master branch checkin 7214d18b40

Resolved Conflicts:
	output/outelf32.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-02 10:48:53 -08:00
H. Peter Anvin
5a8c424d0c Use a more optimal value for the UNUSED slot
Instead of ~1/4 the range we can use ~1/3 the range for better
distance.  It is possible that using ~1/2 - 1 might be even better,
but this is a trivial tweak.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-01-29 12:05:27 -08:00
Marat Dukhan
1052394ef6 make: Fix nasm build with MSVC
http://bugzilla.nasm.us/show_bug.cgi?id=3392258

Signed-off-by: Marat Dukhan <maratek@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-06-30 01:31:15 +04:00
Victor van den Elzen
bc8522e3a0 Fix Perl deprecation warnings.
Use of defined on aggregates (hashes and arrays) is deprecated.
You should instead use a simple test for size.
2010-11-07 17:20:23 +01:00
H. Peter Anvin
e6ee1a859b Add copyright verbiage to Perl scripts; update LICENSE
This adds copyright verbiage to the Perl scripts.  Scripts that are
known to be clean w.r.t. the 2-clause BSD license are given that
license; unclear ones are given the "LGPL for now".

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-28 16:54:44 -07:00
H. Peter Anvin
18ed99daea pp_directives_len can be uint8_t
Save a few hundred bytes...
2008-06-21 18:18:41 -07:00
H. Peter Anvin
72edbb87ef macros.c: compress by tokenizing macro directives
Compress macros.c by representing macro directives with a single byte.
We can do this because we only use the ASCII character range inside
the standard macro files.

Note: we could save significant additional space by not having a
pointer array, and instead relying on the fact that we sweep
sequentially through the output array.
2008-06-19 16:00:04 -07:00
H. Peter Anvin
7065309739 Formatting: kill off "stealth whitespace"
"Stealth whitespace" makes it harder to read diffs, and just generally
cause unwanted weirdness.  Do a source-wide pass to get rid of it.
2007-10-19 14:42:29 -07:00
H. Peter Anvin
fe501957c0 Portability fixes
Concentrate compiler dependencies to compiler.h; make sure compiler.h
is included first in every .c file (since some prototypes may depend
on the presence of feature request macros.)

Actually use the conditional inclusion of various functions (totally
broken in previous releases.)
2007-10-02 21:53:51 -07:00
H. Peter Anvin
a59795c986 Use the crc64 we already use as the perfect hash function prehash
Use the same crc64 that we already use for the symbol table hash as
the perfect hash function prehash.  We appear to get radically faster
convergence this way, and the crc64 is probably *faster*, since the
table likely to be resident in memory.
2007-10-02 17:40:00 -07:00
H. Peter Anvin
5255fd1f36 Change the token prehash function for better convergence
Combining arithmetric (add) and bitwise (xor) mixing seems to give
better result than either.

With the new prehash function, we find a valid hash much quicker.
2007-09-18 12:38:07 -07:00
H. Peter Anvin
1a6e76d682 pptok.c: don't insist on C99 compiler behaviour
Declarations that are not at the head is C99 behaviour, but it's
rather pointless for this little piece of code.  Fix to work with
older compilers.
2007-09-13 11:06:42 -07:00
H. Peter Anvin
7978feebd2 pptok.c: quick-and-dirty downcasing during prehashing
Speed up pptok.c by just doing |= 0x20 instead of calling tolower() for
every character during prehashing.  This is good enough for our needs,
since we don't have any tokens containing the characters @ [ \ ] _ nor
any high-bit characters (in which case we'd have to worry about multibyte
anyway.)
2007-09-12 17:02:55 +00:00
H. Peter Anvin
3100e6cb63 pptok.c: handle holes in the pp_directives array
We need to fail if we land in a hole in the pp_directives array, since
we have a noncontiguous enum preproc_token now.
2007-09-12 05:18:20 +00:00
H. Peter Anvin
da10e7b85e More automation in the preprocessor conditionals handling
Further automate the production of preprocessor conditionals.  Now the
code automatically folds if/elif and the negatives.
2007-09-12 04:18:37 +00:00
H. Peter Anvin
872460fe27 pptok.c: fix spacing 2007-09-12 02:13:39 +00:00
H. Peter Anvin
9bf0aa7c52 Generate automatically correct tests for %if and %elif
Automatically generate macros to test for %if and %elif variants, which
are guaranteed to be correct across future changes.
2007-09-12 02:12:07 +00:00
H. Peter Anvin
4169a47bd9 Use a perfect hash to look up preprocessor directives
Use a perfect hash to look up preprocessor directives, and generate
the preprocessor directive list automatically.
2007-09-12 01:29:43 +00:00