Skip to content

A small step to migrate to C99

eprubio requested to merge eprubio/bzip2:feature/c99-stdtypes into master

The following changes were made with the intention of start porting the code to C99:

  • Replaced the Int* and Uint* types with the int*_t and uint*_t types defined in stdint.h.
  • Replaced Bool and the True and False macros with those defined in stdbool.h.
  • Replaced the UInt64 struct with the actual uint64_t type and rewrote the relevant functions.
  • Replaced the UInt64 formatting with the PRIu64 macro from inttypes.h.
  • Replaced MaybeUInt64 with uint64_t.
  • Replaced NativeInt with int.
  • 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 keyword inline.
  • Replaced the VPrintfX macros with a variadic macro VPrintf.
  • 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

Merge request reports

Loading