A small step to migrate to C99
The following changes were made with the intention of start porting the code to C99:
- Replaced the
Int*
andUint*
types with theint*_t
anduint*_t
types defined instdint.h
. - Replaced
Bool
and theTrue
andFalse
macros with those defined instdbool.h
. - Replaced the
UInt64
struct with the actualuint64_t
type and rewrote the relevant functions. - Replaced the
UInt64
formatting with thePRIu64
macro frominttypes.h
. - Replaced
MaybeUInt64
withuint64_t
. - Replaced
NativeInt
withint
. - Added the
const
qualifier to the randomizing, CRC, and Knuth's increment arrays. - Added the
const
qualifier to a few function parameters. - Replaced the GCC extension
__inline__
with the keywordinline
. - Replaced the
VPrintfX
macros with a variadic macroVPrintf
. - Replaced a few portions of code with calls to standard library functions such as
memcpy()
,memmove()
,memset()
,strncpy()
. - Replaced a few macros with equivalent inline functions.
- Reworked some of the literals to remove type mismatch warnings, used the
UINT*_C
macros for unsigned literals. - Made a few "simplifications" and casts, such as using some K&R idioms.
Thank you for your attention.
Edited by eprubio