Follow up from #884 (comment)
|
|
|
/* Make sure correct type size: |
|
* This will fire with a negative subscript error if the type sizes |
|
* are set incorrectly by the compiler, and compile out if not */ |
|
NK_STATIC_ASSERT(sizeof(nk_size) >= sizeof(void*)); |
|
NK_STATIC_ASSERT(sizeof(nk_ptr) == sizeof(void*)); |
|
NK_STATIC_ASSERT(sizeof(nk_flags) >= 4); |
|
NK_STATIC_ASSERT(sizeof(nk_rune) >= 4); |
|
NK_STATIC_ASSERT(sizeof(nk_ushort) == 2); |
|
NK_STATIC_ASSERT(sizeof(nk_short) == 2); |
|
NK_STATIC_ASSERT(sizeof(nk_uint) == 4); |
|
NK_STATIC_ASSERT(sizeof(nk_int) == 4); |
|
NK_STATIC_ASSERT(sizeof(nk_byte) == 1); |
|
NK_STATIC_ASSERT(sizeof(nk_bool) <= sizeof(int)); |
|
|
I wonder why do we need these duplicated checks here? The ones from src/nuklear.h do the very same thing, and all src/*.c files are including both of those headers, so I'm not sure what is the benefit?
This thing can only really harm us, just like in case of #185 where the sizeof(nk_bool) checks were different between each file, and went unnoticed for so long.
In theory having some duplication in src/nuklear_internal.h may make sense, but in practice those checks just do nothing. The proper sizes are already ensured at the moment when any of those is hit. This just looks like a dead code to me at this point.
I'm planning to remove this unless someone has a good reason to keep it (?)
Follow up from #884 (comment)
In theory having some duplication in
src/nuklear_internal.hmay make sense, but in practice those checks just do nothing. The proper sizes are already ensured at the moment when any of those is hit. This just looks like a dead code to me at this point.I'm planning to remove this unless someone has a good reason to keep it (?)