aboutsummaryrefslogtreecommitdiffstats
path: root/unpack.c
Commit message (Collapse)AuthorAgeFilesLines
* unpack.c: Cast negative signed offset to signedHEADmasterTomasz Kramkowski2022-11-021-1/+1
| | | | | | | | | | As N1570ยง6.5.16.2p3 states, E1 += E2 is equivalent to E1 = E1 + (E2). This means that E1 + (E2) will be subject to (6.5.6p4) "the usual arithmetic conversions". Since both types have equal integer conversion rank (6.3.1.1p1), E1 which was intmax_t will first be converted to uintmax_t before being added to (E2). This is not the intended result as it relies on integer wrapping behaviour again. Casting E2 to intmax_t first prevents the conversion of E1 and produces the correct result.
* change buf to src or dest depending on contextTomasz Kramkowski2021-11-071-10/+10
|
* use safe_islower to avoid UBTomasz Kramkowski2021-11-071-1/+1
|
* implement unpack_structTomasz Kramkowski2021-08-111-0/+60
|
* add the PACK_TYPE_COUNT pack_typeTomasz Kramkowski2021-08-081-1/+2
|
* factor unpack core into read_fieldsTomasz Kramkowski2021-08-071-69/+77
|
* always va_end even when an error occursTomasz Kramkowski2021-08-071-5/+8
|
* fix up missed pack_type charsTomasz Kramkowski2021-08-061-10/+13
|
* use xmacros to generate type related codeTomasz Kramkowski2021-08-061-45/+38
|
* add pack_type and pack_endian and use themTomasz Kramkowski2021-08-061-18/+18
|
* Fix license information content and formatTomasz Kramkowski2021-08-051-1/+1
|
* Define PRIuSIZE to avoid issues compiling with msvcrtTomasz Kramkowski2021-08-051-4/+4
| | | | | | | | 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.
* unpack.c: don't drop const in void * castTomasz Kramkowski2021-08-051-1/+1
|
* explicitly cast printf %p params to (void *)Tomasz Kramkowski2021-08-051-1/+1
|
* Move ieee754b functions to their own fileTomasz Kramkowski2021-07-231-37/+3
|
* unpack: Fix negative signed integer unpacking calculationTomasz Kramkowski2021-05-311-3/+13
| | | | | | | | | | | | | | Currently the calculation is just wrong since it effectively relies on the widths of the signed and unsigned integer types and on wrapping-on-assignment behavior. I have no idea why I wrote it like this, it seems obviously wrong in retrospect. The new behavior ensure that this succeeds in situations where type widths are not correct. The new code sets vals to the minimum possible two's complement signed value (I just realised this code now assumes two's complement) and then offsets it with the value part of the signed integer.
* unpack: Additional trace information.Tomasz Kramkowski2020-09-121-2/+2
|
* unpack: Actually use the buffer offset...Tomasz Kramkowski2020-09-121-1/+1
|
* Move BITMASK and endian enum to common.hTomasz Kramkowski2020-09-121-5/+0
|
* unpack: Fix default case mistakeTomasz Kramkowski2020-09-121-1/+1
|
* unpack: Make input buffer constTomasz Kramkowski2020-09-121-3/+3
|
* Implement double deserialisation.Tomasz Kramkowski2020-09-111-1/+9
|
* unpack: Replace perfectly readable code with macro abomination.Tomasz Kramkowski2020-09-111-29/+32
|
* unpack: Add BITMASK helper macroTomasz Kramkowski2020-09-111-1/+3
|
* unpack: Implement float unpacking.Tomasz Kramkowski2020-09-101-2/+40
|
* Implement unpacking arraysTomasz Kramkowski2020-09-101-4/+22
|
* Allow for a conversion countTomasz Kramkowski2020-09-101-26/+29
|
* Make functions staticTomasz Kramkowski2020-09-091-1/+1
|
* Fix up bugs and add tracing to unpackTomasz Kramkowski2020-09-091-45/+34
|
* Add license headersTomasz Kramkowski2020-09-091-0/+4
|
* initTomasz Kramkowski2020-08-201-0/+123