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

Refactor typecard. #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Refactor typecard. #32

wants to merge 1 commit into from

Conversation

judearich
Copy link

This is a general PR to fix a couple bugs and improve the portability of typecard.

Here is a list of the changes:

  • Use a function to print the size of types for better readability.
  • Add intptr_t to the list of types printed.
  • Use CHAR_BIT for bits-per-byte instead of the literal 8.
  • Calculate CPU bit-width using sizeof(void*) instead of __LP64__ to
    allow for non-32/64-bit values.
  • Add check for PDP Endianness.
  • Use correct preprocessor macros to check for endianness and
    presence of __int128_t.

Variable printing was put into a function for better readability.
CHAR_BIT is used instead of a literal 8 for better portability. The
system bit-width is now detected by checking the size of a pointer. The
proper preprocesor macro is now used for testing for __int128_t. Endian
testing macros were moved out of main, support for PDP endianness has
been added, and the proper GCC endian preprocessor macros are used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant