Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use standard/built-in types instead of local typedefs where possible #126

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Commits on Sep 13, 2020

  1. Replace u?int(8|16|32|64) with u?int(8|16|32|64)_t from stdint.h

    Since stdint.h was added in C99, pass the required C standard to the
    compiler explicitly, and do the same for C++ standard along the way.
    mikedld committed Sep 13, 2020
    Copy the full SHA
    bef11d1 View commit details
    Browse the repository at this point in the history
  2. Replace I64u with PRIu64 from inttypes.h

    As we're using std int types (since previous commit), use corresponding std
    format macros to avoid potential format specifier mismatches.
    mikedld committed Sep 13, 2020
    Copy the full SHA
    66bf2ee View commit details
    Browse the repository at this point in the history
  3. Define ssize_t as intptr_t to avoid including BaseTsd.h for MSVC

    MSDN states that SSIZE_T is defined as LONG_PTR, and LONG_PTR is defined as
    long (32-bit) when building for x86 and __int64 (64-bit) when building for
    x64, which basically means that it's signed and its size matches that of a
    pointer, which in turn is the definition of intptr_t. The latter is
    provided by stdint.h which we're already including.
    mikedld committed Sep 13, 2020
    Copy the full SHA
    eb69ccf View commit details
    Browse the repository at this point in the history
  4. Replace byte with uint8_t from stdint.h

    This avoids potential clashes as the name is way too common.
    mikedld committed Sep 13, 2020
    Copy the full SHA
    7681d17 View commit details
    Browse the repository at this point in the history
  5. Replace uint with unsigned int

    This avoids potential clashes as the name is way too common.
    mikedld committed Sep 13, 2020
    Copy the full SHA
    35740d0 View commit details
    Browse the repository at this point in the history
  6. Replace str with char*

    This avoids potential clashes as the name is way too common.
    mikedld committed Sep 13, 2020
    Copy the full SHA
    f8c5268 View commit details
    Browse the repository at this point in the history
  7. Replace cstr with const char*

    This avoids potential clashes as the name is way too common.
    mikedld committed Sep 13, 2020
    Copy the full SHA
    88067ca View commit details
    Browse the repository at this point in the history
  8. Use bool provided by stdbool.h

    This header is C99 and we can use it since we're already using stdint.h and
    inttypes.h anyway. It also helps to avoid clashes when other code that uses
    this library includes stdbool.h.
    mikedld committed Sep 13, 2020
    Copy the full SHA
    d3df418 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2020

  1. Use PRI(u|d)(8|16|32|64) macros from inttypes.h where applicable

    Most probably not all the places were covered, some more work (unrelated to
    these changes) needs to be done.
    mikedld committed Sep 14, 2020
    Copy the full SHA
    54851c8 View commit details
    Browse the repository at this point in the history