Preprocessor hash routines no longer compute name length
commita616f7a824a35679b7070ceaa32a61ca2933e3cc
authorMihail Groza <unlupdestepa@gmail.com>
Tue, 7 Feb 2017 19:49:25 +0000 (7 19:49 +0000)
committerMihail Groza <unlupdestepa@gmail.com>
Tue, 7 Feb 2017 19:49:25 +0000 (7 19:49 +0000)
treebeb4c29203ad7e1a59812f4720dd91fc48bdb12a
parent26e5881e393c817b6275452dbcc4e7fae7e7ca8d
Preprocessor hash routines no longer compute name length

Previously install & lookup hash functions could receive a negative name
length, interpreted as a need to compute the length. While this is a
shorthand, it means each of routines had ad-hoc (and partially correct)
code for identifier length computing, instead of using a generic (and
hopefully correct) routine. Also, in most cases that used this feature,
the identifier was a constant string, meaning the desired length could
be computed at compile time.

Dropped feature and computed when needed. This also removes the problem
of conversion between size and regular integer. Additionally updated
signature of lookup routines to make explicit the fact that they don't
modify the strings looked-up.
src/Headers/cpphash.h
src/Headers/cpplib.h
src/cpphash.c
src/cpplib.c