David Robillard
d101d92694
Format all code with clang-format
2 years ago
David Robillard
8a93d0b3be
Avoid "else" after "break" and "return"
2 years ago
David Robillard
c3e339a0d2
Clean up includes
2 years ago
David Robillard
d3723c7ef9
Suppress new clang-tidy warnings
2 years ago
David Robillard
2ddd39e588
Only use aligned_alloc in C11
2 years ago
David Robillard
5c1130819c
Deprecate serd_uri_to_path()
2 years ago
David Robillard
2bf875e89f
Refuse to write relative URI references to NTriples
2 years ago
David Robillard
6be4a34047
Simplify abbreviated URI writing code
2 years ago
David Robillard
18949858d9
Fix test coverage
2 years ago
David Robillard
49bee1f121
Remove dead code
2 years ago
David Robillard
65d6229274
Simplify writer statement validity checking
2 years ago
David Robillard
ccdafafb81
Improve IRI reading performance
...
This allows the compiler to construct a jump table, and avoids a branch.
2 years ago
David Robillard
f63257a60c
Improve add and chop prefix functions when given empty strings
2 years ago
David Robillard
353b92d13d
Remove use of C character class functions that may use locale
...
Some of these cause warnings, and should never have been used in the first
place since they depend on locale.
2 years ago
David Robillard
dddc46b13f
Allow setting the base URI of an Env to NULL
2 years ago
David Robillard
febc0828f2
Use aligned allocation via C11 or Windows API where possible
2 years ago
David Robillard
beed84b631
Use C11 if possible
2 years ago
David Robillard
1319a748cb
Add missing const qualifiers
2 years ago
David Robillard
d9a475252b
Factor out output style selection
2 years ago
David Robillard
9eee20ada8
Add nonnull and nullable attributes to API
...
This will warn if NULL is passed to any nonnull-annotated parameter, and is
also supported by sanitizers which can check for violations at runtime.
Unfortunately, it is currently only supported by clang. GCC has a similar
feature in the nonnull attribute, but this has a different syntax (it's a
function attribute) and is more dangerous since it is used by the optimizer to
assume a null pointer is undefined behavior. This one just warns and still
allows code to handle the situation gracefully, which I think is more
appropriate for a library API.
Note that this optimization behavior is not some unlikely edge case: switching
these attributes to the GCC one will break release builds.
2 years ago
David Robillard
48635c1e2c
Fix potential memory error when serialising URIs
2 years ago
David Robillard
bafa091fad
Add const, pure, and malloc function attributes
2 years ago
David Robillard
a6b0d55b4d
Define WIN32_LEAN_AND_MEAN
2 years ago
David Robillard
6bd53f5822
Use separate clang-tidy configurations for implementation and tests
2 years ago
David Robillard
d65769b7b9
Simplify reader byte reading interface
...
This eliminates eat_byte() and the way it conflates the status of advancing the
source with the current character, which can cause problems with custom sinks.
2 years ago
David Robillard
45b809c443
Update stale copyright dates
3 years ago
David Robillard
4f544720cc
Use conventional short variable name for status
3 years ago
David Robillard
bb1a00aac2
Ensure that all free methods tolerate NULL
3 years ago
David Robillard
53dbd6f360
Fix handling of bad syntax that ends a collection
3 years ago
David Robillard
6a9db19eb7
Fix EOF and null byte handling
...
This is a bit questionable, but the null byte support is needed for streaming
over a socket where some delimiter is required. This caused a bug where serdi
would hang forever on corrupt files that contain a null byte.
Fix this by consuming the byte, but otherwise behaving as before.
3 years ago
David Robillard
7221394ae1
Clean up reader error handling
3 years ago
David Robillard
8cfbb485d3
Make read_String() return a status
3 years ago
David Robillard
59b4ee113d
Make read_IRIREF_scheme() return a status
3 years ago
David Robillard
18d181f3e8
Make r_err() return a status
3 years ago
David Robillard
af9f6fbab8
Make read_PrefixedName() return a status
3 years ago
David Robillard
6bd9bdffe2
Make read_PERCENT() return a status
3 years ago
David Robillard
64f8675d5a
Make read_UCHAR() and read_ECHAR() return a status
3 years ago
David Robillard
907891c4f6
Exploit push_byte return status
3 years ago
David Robillard
bdf35e8a26
Move prototype to a more sensible location
3 years ago
David Robillard
fa37911d98
Fix stack check C++ compatibility
3 years ago
David Robillard
92c783d6a5
Harden prefixed name parsing
3 years ago
David Robillard
bc01889ccd
Fix incorrect separator length
3 years ago
David Robillard
31fb42796f
Avoid absurd Windows warnings about "deprecated" POSIX functions
3 years ago
David Robillard
a9a6a4e417
Fix Wswitch-enum warnings
3 years ago
David Robillard
1172f40724
Make serd_stack_push() return a void pointer
...
This avoids some unnecessary type punning.
3 years ago
David Robillard
4b50e6ebda
Avoid copying nodes when equivalent prefixes are set
3 years ago
David Robillard
dee13339e4
Separate base64 implementation
3 years ago
David Robillard
8827c4a889
Use SerdNodeFlags type everywhere
3 years ago
David Robillard
3f5ba59081
Clean up and separate internal headers
3 years ago
David Robillard
9f17e7498c
Fix spurious semicolon warnings
3 years ago