]> granicus.if.org Git - nethack/commit
update sys/share/{dgn,lev}_lex.c
authorPatR <rankin@nethack.org>
Tue, 8 Dec 2015 22:52:01 +0000 (14:52 -0800)
committerPatR <rankin@nethack.org>
Tue, 8 Dec 2015 22:52:01 +0000 (14:52 -0800)
commit48f1c6711e8790527f6f6fda546067ccdad30378
tree4f3c10c6b05df68d85652e9e7ae5fe06dc623c13
parent7f2f15c702e0ebc03271d54b82454a7991b1a9c2
update sys/share/{dgn,lev}_lex.c

The HP C compiler for VMS issued a pair of diagnostics for both *_lex.c
files, about an expression of the form (unsigned_var <= 0) maybe not
being what was really intended, and it was right.  Changing that to
'< 1' would have suppressed the diagnostic but left the bug, which was
in code that performed a subtraction and then checked for a negative
result.  It worked in older flex versions when the variables were
signed, but got broken when they were changed to unsigned (no doubt in
respose to gcc complaining about comparing signed and unsigned in some
other spot where one of them was used).

The bug is in flex's original skeleton, so was inherited by our new
custom skeleton.  I've fixed it in the custom skeleton, which means
that sys/share/*_lex.c became out of date even though util/*_comp.l
remain unchanged.
sys/share/dgn_lex.c
sys/share/lev_lex.c