aboutsummaryrefslogtreecommitdiffstats
path: root/pack.c
Commit message (Collapse)AuthorAgeFilesLines
* change buf to src or dest depending on contextTomasz Kramkowski2021-11-071-6/+6
|
* use safe_islower to avoid UBTomasz Kramkowski2021-11-071-1/+1
|
* pack: Simplify signed integer packing calculationTomasz Kramkowski2021-08-141-7/+1
| | | | | | | | | | | | | Because of the fact that uintmax_t guarantees at least a full 64 bit width and because of C's behavior when a signed type is converted to an unsigned type and the value is out of range, the new code just sign-extends and converts to a uintmax_t wide two's complement signed value. As an aside, the old code was written forgetting the fact that that uintmax_t + intmax_t would be first converted to uintmax_t + uintmax_t before being evaluated. The end result was the same except it ended up being offset by 2^8s.
* always va_end even when an error occursTomasz Kramkowski2021-08-071-4/+6
|
* fix up missed pack_type charsTomasz Kramkowski2021-08-061-1/+1
|
* use xmacros to generate type related codeTomasz Kramkowski2021-08-061-19/+15
|
* add pack_type and pack_endian and use themTomasz Kramkowski2021-08-061-16/+16
|
* Fix license information content and formatTomasz Kramkowski2021-08-051-1/+1
|
* Define PRIuSIZE to avoid issues compiling with msvcrtTomasz Kramkowski2021-08-051-2/+2
| | | | | | | | On windows and when cross compiling with mingw the standard library only supports C89 which means that print format arguments cannot take "%zu". To fix this, a PRIuSIZE macros is needed which expands to PRIu32 on windows 32 bit and PRIu64 on windows 64 bit.
* explicitly cast printf %p params to (void *)Tomasz Kramkowski2021-08-051-1/+1
|
* Implement a basic pack functionTomasz Kramkowski2020-09-121-0/+81