Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package sord for openSUSE:Factory checked in at 2026-05-06 19:17:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sord (Old) and /work/SRC/openSUSE:Factory/.sord.new.30200 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sord" Wed May 6 19:17:30 2026 rev:23 rq:1350927 version:0.16.22 Changes: -------- --- /work/SRC/openSUSE:Factory/sord/sord.changes 2025-12-11 18:35:04.241668020 +0100 +++ /work/SRC/openSUSE:Factory/.sord.new.30200/sord.changes 2026-05-06 19:17:46.628788195 +0200 @@ -1,0 +2,8 @@ +Mon May 4 15:37:17 UTC 2026 - Dirk Müller <[email protected]> + +- update to 0.16.22: + * Add clang nullability annotations + * Address new warnings in clang and clang-tidy 21 + * Make more API functions tolerate NULL + +------------------------------------------------------------------- Old: ---- sord-0.16.20.tar.xz sord-0.16.20.tar.xz.sig New: ---- sord-0.16.22.tar.xz sord-0.16.22.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sord.spec ++++++ --- /var/tmp/diff_new_pack.cdP6rj/_old 2026-05-06 19:17:47.820837318 +0200 +++ /var/tmp/diff_new_pack.cdP6rj/_new 2026-05-06 19:17:47.820837318 +0200 @@ -1,7 +1,7 @@ # # spec file for package sord # -# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2026 SUSE LLC and contributors # Copyright (c) 2025 Andreas Stieger <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -19,7 +19,7 @@ %define sover 0 Name: sord -Version: 0.16.20 +Version: 0.16.22 Release: 0 Summary: Utilities to work with RDF data License: ISC ++++++ sord-0.16.20.tar.xz -> sord-0.16.22.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/.clang-format new/sord-0.16.22/.clang-format --- old/sord-0.16.20/.clang-format 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/.clang-format 2026-02-10 19:44:18.000000000 +0100 @@ -6,6 +6,10 @@ AlignConsecutiveDeclarations: true AlignEscapedNewlines: Left AttributeMacros: + - SERD_ALLOCATED + - SERD_NONNULL + - SERD_NULLABLE + - SERD_UNSPECIFIED - SORD_API - SORD_LOG_FUNC BasedOnStyle: Mozilla diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/.gitignore new/sord-0.16.22/.gitignore --- old/sord-0.16.20/.gitignore 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/.gitignore 2026-02-10 19:44:18.000000000 +0100 @@ -3,8 +3,8 @@ /.meson-subproject-wrap-hash.txt /build/ +/subprojects/.wraplock /subprojects/packagecache/ -/subprojects/sphinxygen-1.0.10/ -/subprojects/sphinxygen/ +/subprojects/sphinxygen-1.0.12/ __pycache__/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/COPYING new/sord-0.16.22/COPYING --- old/sord-0.16.20/COPYING 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/COPYING 2026-02-10 19:44:18.000000000 +0100 @@ -1,4 +1,4 @@ -Copyright 2011-2025 David Robillard <[email protected]> +Copyright 2011-2026 David Robillard <[email protected]> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/NEWS new/sord-0.16.22/NEWS --- old/sord-0.16.20/NEWS 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/NEWS 2026-02-10 19:44:18.000000000 +0100 @@ -1,3 +1,11 @@ +sord (0.16.22) stable; urgency=medium + + * Add clang nullability annotations + * Address new warnings in clang and clang-tidy 21 + * Make more API functions tolerate NULL + + -- David Robillard <[email protected]> Tue, 10 Feb 2026 18:43:50 +0000 + sord (0.16.20) stable; urgency=medium * Add header warnings test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/include/sord/sord.h new/sord-0.16.22/include/sord/sord.h --- old/sord-0.16.20/include/sord/sord.h 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/include/sord/sord.h 2026-02-10 19:44:18.000000000 +0100 @@ -126,14 +126,14 @@ (e.g. nodes) can be shared between worlds, and this should be avoided if possible for performance reasons. */ -SORD_API SordWorld* +SORD_API SordWorld* SERD_ALLOCATED sord_world_new(void); /** Free `world`. */ SORD_API void -sord_world_free(SordWorld* world); +sord_world_free(SordWorld* SERD_NULLABLE world); /** Set a function to be called when errors occur. @@ -142,9 +142,9 @@ no error function is set, errors are printed to stderr. */ SORD_API void -sord_world_set_error_sink(SordWorld* world, - SerdErrorSink error_sink, - void* handle); +sord_world_set_error_sink(SordWorld* SERD_NONNULL world, + SerdErrorSink SERD_NULLABLE error_sink, + void* SERD_UNSPECIFIED handle); /** @} @@ -158,16 +158,16 @@ Note this function measures `str`, which is a common bottleneck. Use sord_node_from_serd_node() instead if `str` is already measured. */ -SORD_API SordNode* -sord_new_uri(SordWorld* world, const uint8_t* uri); +SORD_API SordNode* SERD_ALLOCATED +sord_new_uri(SordWorld* SERD_NONNULL world, const uint8_t* SERD_NONNULL uri); /** Get a URI node from a relative URI string. */ -SORD_API SordNode* -sord_new_relative_uri(SordWorld* world, - const uint8_t* uri, - const uint8_t* base_uri); +SORD_API SordNode* SERD_ALLOCATED +sord_new_relative_uri(SordWorld* SERD_NONNULL world, + const uint8_t* SERD_NONNULL uri, + const uint8_t* SERD_NULLABLE base_uri); /** Get a blank node from a string. @@ -175,8 +175,8 @@ Note this function measures `str`, which is a common bottleneck. Use sord_node_from_serd_node() instead if `str` is already measured. */ -SORD_API SordNode* -sord_new_blank(SordWorld* world, const uint8_t* str); +SORD_API SordNode* SERD_ALLOCATED +sord_new_blank(SordWorld* SERD_NONNULL world, const uint8_t* SERD_NONNULL str); /** Get a literal node from a string. @@ -184,11 +184,11 @@ Note this function measures `str`, which is a common bottleneck. Use sord_node_from_serd_node() instead if `str` is already measured. */ -SORD_API SordNode* -sord_new_literal(SordWorld* world, - SordNode* datatype, - const uint8_t* str, - const char* lang); +SORD_API SordNode* SERD_ALLOCATED +sord_new_literal(SordWorld* SERD_NONNULL world, + SordNode* SERD_NULLABLE datatype, + const uint8_t* SERD_NONNULL str, + const char* SERD_NULLABLE lang); /** Copy a node (obtain a reference). @@ -196,59 +196,60 @@ Node that since nodes are interned and reference counted, this does not actually create a deep copy of `node`. */ -SORD_API SordNode* -sord_node_copy(const SordNode* node); +SORD_API SordNode* SERD_ALLOCATED +sord_node_copy(const SordNode* SERD_NULLABLE node); /** Free a node (drop a reference). */ SORD_API void -sord_node_free(SordWorld* world, SordNode* node); +sord_node_free(SordWorld* SERD_NONNULL world, SordNode* SERD_NULLABLE node); /** Return the type of a node (SORD_URI, SORD_BLANK, or SORD_LITERAL). */ SORD_API SordNodeType -sord_node_get_type(const SordNode* node); +sord_node_get_type(const SordNode* SERD_NONNULL node); /** Return the string value of a node. */ -SORD_API const uint8_t* -sord_node_get_string(const SordNode* node); +SORD_API const uint8_t* SERD_NONNULL +sord_node_get_string(const SordNode* SERD_NONNULL node); /** Return the string value of a node, and set `bytes` to its length in bytes. */ -SORD_API const uint8_t* -sord_node_get_string_counted(const SordNode* node, size_t* bytes); +SORD_API const uint8_t* SERD_NONNULL +sord_node_get_string_counted(const SordNode* SERD_NONNULL node, + size_t* SERD_NONNULL bytes); /** Return the string value of a node, and set `bytes` to its length in bytes, and `count` to its length in characters. */ -SORD_API const uint8_t* -sord_node_get_string_measured(const SordNode* node, - size_t* bytes, - size_t* chars); +SORD_API const uint8_t* SERD_NONNULL +sord_node_get_string_measured(const SordNode* SERD_NONNULL node, + size_t* SERD_NONNULL bytes, + size_t* SERD_NONNULL chars); /** Return the language of a literal node (or NULL). */ -SORD_API const char* -sord_node_get_language(const SordNode* node); +SORD_API const char* SERD_NULLABLE +sord_node_get_language(const SordNode* SERD_NONNULL node); /** Return the datatype URI of a literal node (or NULL). */ -SORD_API SordNode* -sord_node_get_datatype(const SordNode* node); +SORD_API SordNode* SERD_NULLABLE +sord_node_get_datatype(const SordNode* SERD_NONNULL node); /** Return the flags (string attributes) of a node. */ SORD_API SerdNodeFlags -sord_node_get_flags(const SordNode* node); +sord_node_get_flags(const SordNode* SERD_NONNULL node); /** Return true iff node can be serialised as an inline object. @@ -258,7 +259,7 @@ be referred to by name. */ SORD_API bool -sord_node_is_inline_object(const SordNode* node); +sord_node_is_inline_object(const SordNode* SERD_NONNULL node); /** Return true iff `a` is equal to `b`. @@ -266,27 +267,28 @@ Note this is much faster than comparing the node's strings. */ SORD_API bool -sord_node_equals(const SordNode* a, const SordNode* b); +sord_node_equals(const SordNode* SERD_NULLABLE a, + const SordNode* SERD_NULLABLE b); /** Return a SordNode as a SerdNode. The returned node is shared and must not be freed or modified. */ -SORD_API const SerdNode* -sord_node_to_serd_node(const SordNode* node); +SORD_API const SerdNode* SERD_NONNULL +sord_node_to_serd_node(const SordNode* SERD_NULLABLE node); /** Create a new SordNode from a SerdNode. The returned node must be freed using sord_node_free(). */ -SORD_API SordNode* -sord_node_from_serd_node(SordWorld* world, - SerdEnv* env, - const SerdNode* node, - const SerdNode* datatype, - const SerdNode* lang); +SORD_API SordNode* SERD_ALLOCATED +sord_node_from_serd_node(SordWorld* SERD_NONNULL world, + SerdEnv* SERD_NULLABLE env, + const SerdNode* SERD_NULLABLE node, + const SerdNode* SERD_NULLABLE datatype, + const SerdNode* SERD_NULLABLE lang); /** @} @@ -305,20 +307,20 @@ @param graphs If true, store (and index) graph contexts. */ -SORD_API SordModel* -sord_new(SordWorld* world, unsigned indices, bool graphs); +SORD_API SordModel* SERD_ALLOCATED +sord_new(SordWorld* SERD_NONNULL world, unsigned indices, bool graphs); /** Close and free `model`. */ SORD_API void -sord_free(SordModel* model); +sord_free(SordModel* SERD_NULLABLE model); /** Get the world associated with `model`. */ -SORD_API SordWorld* -sord_get_world(SordModel* model); +SORD_API SordWorld* SERD_NONNULL +sord_get_world(SordModel* SERD_NONNULL model); /** Return the number of nodes stored in `world`. @@ -326,37 +328,38 @@ Nodes are included in this count iff they are a part of a quad in `world`. */ SORD_API size_t -sord_num_nodes(const SordWorld* world); +sord_num_nodes(const SordWorld* SERD_NULLABLE world); /** Return the number of quads stored in `model`. */ SORD_API size_t -sord_num_quads(const SordModel* model); +sord_num_quads(const SordModel* SERD_NULLABLE model); /** Return an iterator to the start of `model`. */ -SORD_API SordIter* -sord_begin(const SordModel* model); +SORD_API SordIter* SERD_NULLABLE +sord_begin(const SordModel* SERD_NULLABLE model); /** Search for statements by a quad pattern. @return an iterator to the first match, or NULL if no matches found. */ -SORD_API SordIter* -sord_find(const SordModel* model, const SordQuad pat); +SORD_API SordIter* SERD_NULLABLE +sord_find(const SordModel* SERD_NONNULL model, const SordQuad SERD_NONNULL pat); /** Search for statements by nodes. @return an iterator to the first match, or NULL if no matches found. */ -SORD_API SordIter* -sord_search(const SordModel* model, - const SordNode* s, - const SordNode* p, - const SordNode* o, - const SordNode* g); +SORD_API SordIter* SERD_NULLABLE +sord_search(const SordModel* SERD_NONNULL model, + const SordNode* SERD_NULLABLE s, + const SordNode* SERD_NULLABLE p, + const SordNode* SERD_NULLABLE o, + const SordNode* SERD_NULLABLE g); + /** Search for a single node that matches a pattern. Exactly one of `s`, `p`, `o` must be NULL. @@ -364,32 +367,32 @@ The returned node must be freed using sord_node_free(). @return the first matching node, or NULL if no matches are found. */ -SORD_API SordNode* -sord_get(const SordModel* model, - const SordNode* s, - const SordNode* p, - const SordNode* o, - const SordNode* g); +SORD_API SordNode* SERD_NULLABLE +sord_get(const SordModel* SERD_NONNULL model, + const SordNode* SERD_NULLABLE s, + const SordNode* SERD_NULLABLE p, + const SordNode* SERD_NULLABLE o, + const SordNode* SERD_NULLABLE g); /** Return true iff a statement exists. */ SORD_API bool -sord_ask(const SordModel* model, - const SordNode* s, - const SordNode* p, - const SordNode* o, - const SordNode* g); +sord_ask(const SordModel* SERD_NONNULL model, + const SordNode* SERD_NULLABLE s, + const SordNode* SERD_NULLABLE p, + const SordNode* SERD_NULLABLE o, + const SordNode* SERD_NULLABLE g); /** Return the number of matching statements. */ SORD_API uint64_t -sord_count(const SordModel* model, - const SordNode* s, - const SordNode* p, - const SordNode* o, - const SordNode* g); +sord_count(const SordModel* SERD_NONNULL model, + const SordNode* SERD_NULLABLE s, + const SordNode* SERD_NULLABLE p, + const SordNode* SERD_NULLABLE o, + const SordNode* SERD_NULLABLE g); /** Check if `model` contains a triple pattern. @@ -397,7 +400,8 @@ @return true if `model` contains a match for `pat`, otherwise false. */ SORD_API bool -sord_contains(const SordModel* model, const SordQuad pat); +sord_contains(const SordModel* SERD_NONNULL model, + const SordQuad SERD_NONNULL pat); /** Add a quad to a model. @@ -407,7 +411,7 @@ @return true on success, false, on error. */ SORD_API bool -sord_add(SordModel* model, const SordQuad tup); +sord_add(SordModel* SERD_NONNULL model, const SordQuad SERD_NONNULL tup); /** Remove a quad from a model. @@ -416,7 +420,7 @@ while iterating, use sord_erase() instead. */ SORD_API void -sord_remove(SordModel* model, const SordQuad tup); +sord_remove(SordModel* SERD_NONNULL model, const SordQuad SERD_NONNULL tup); /** Remove a quad from a model via an iterator. @@ -428,7 +432,7 @@ next value on return. */ SORD_API SerdStatus -sord_erase(SordModel* model, SordIter* iter); +sord_erase(SordModel* SERD_NONNULL model, SordIter* SERD_NULLABLE iter); /** @} @@ -439,14 +443,14 @@ /** Create an inserter for writing statements to a model. */ -SORD_API SordInserter* -sord_inserter_new(SordModel* model, SerdEnv* env); +SORD_API SordInserter* SERD_ALLOCATED +sord_inserter_new(SordModel* SERD_NONNULL model, SerdEnv* SERD_NONNULL env); /** Free an inserter. */ SORD_API void -sord_inserter_free(SordInserter* inserter); +sord_inserter_free(SordInserter* SERD_NULLABLE inserter); /** Set the current base URI for writing to the model. @@ -454,7 +458,8 @@ Note this function can be safely casted to SerdBaseSink. */ SORD_API SerdStatus -sord_inserter_set_base_uri(SordInserter* inserter, const SerdNode* uri); +sord_inserter_set_base_uri(SordInserter* SERD_NONNULL inserter, + const SerdNode* SERD_NULLABLE uri); /** Set a namespace prefix for writing to the model. @@ -462,9 +467,9 @@ Note this function can be safely casted to SerdPrefixSink. */ SORD_API SerdStatus -sord_inserter_set_prefix(SordInserter* inserter, - const SerdNode* name, - const SerdNode* uri); +sord_inserter_set_prefix(SordInserter* SERD_NONNULL inserter, + const SerdNode* SERD_NONNULL name, + const SerdNode* SERD_NONNULL uri); /** Write a statement to the model. @@ -472,14 +477,14 @@ Note this function can be safely casted to SerdStatementSink. */ SORD_API SerdStatus -sord_inserter_write_statement(SordInserter* inserter, - SerdStatementFlags flags, - const SerdNode* graph, - const SerdNode* subject, - const SerdNode* predicate, - const SerdNode* object, - const SerdNode* object_datatype, - const SerdNode* object_lang); +sord_inserter_write_statement(SordInserter* SERD_NONNULL inserter, + SerdStatementFlags flags, + const SerdNode* SERD_NULLABLE graph, + const SerdNode* SERD_NONNULL subject, + const SerdNode* SERD_NONNULL predicate, + const SerdNode* SERD_NONNULL object, + const SerdNode* SERD_NULLABLE object_datatype, + const SerdNode* SERD_NULLABLE object_lang); /** @} @@ -491,39 +496,39 @@ Set `quad` to the quad pointed to by `iter`. */ SORD_API void -sord_iter_get(const SordIter* iter, SordQuad tup); +sord_iter_get(const SordIter* SERD_UNSPECIFIED iter, SordQuad SERD_NONNULL tup); /** Return a field of the quad pointed to by `iter`. Returns NULL if `iter` is NULL or is at the end. */ -SORD_API const SordNode* -sord_iter_get_node(const SordIter* iter, SordQuadIndex index); +SORD_API const SordNode* SERD_UNSPECIFIED +sord_iter_get_node(const SordIter* SERD_UNSPECIFIED iter, SordQuadIndex index); /** Return the store pointed to by `iter`. */ -SORD_API const SordModel* -sord_iter_get_model(SordIter* iter); +SORD_API const SordModel* SERD_UNSPECIFIED +sord_iter_get_model(SordIter* SERD_UNSPECIFIED iter); /** Increment `iter` to point to the next statement. */ SORD_API bool -sord_iter_next(SordIter* iter); +sord_iter_next(SordIter* SERD_NULLABLE iter); /** Return true iff `iter` is at the end of its range. */ SORD_API bool -sord_iter_end(const SordIter* iter); +sord_iter_end(const SordIter* SERD_NULLABLE iter); /** Free `iter`. */ SORD_API void -sord_iter_free(SordIter* iter); +sord_iter_free(SordIter* SERD_NULLABLE iter); /** @} @@ -539,7 +544,7 @@ @return true iff `x` and `y` match. */ SORD_API bool -sord_quad_match(const SordQuad x, const SordQuad y); +sord_quad_match(const SordQuad SERD_NONNULL x, const SordQuad SERD_NONNULL y); /** @} @@ -550,17 +555,19 @@ /** Return a reader that will read into `model`. */ -SORD_API SerdReader* -sord_new_reader(SordModel* model, - SerdEnv* env, - SerdSyntax syntax, - const SordNode* graph); +SORD_API SerdReader* SERD_ALLOCATED +sord_new_reader(SordModel* SERD_NONNULL model, + SerdEnv* SERD_NONNULL env, + SerdSyntax syntax, + const SordNode* SERD_NULLABLE graph); /** Write a model to a writer. */ SORD_API bool -sord_write(SordModel* model, SerdWriter* writer, const SordNode* graph); +sord_write(SordModel* SERD_NONNULL model, + SerdWriter* SERD_NONNULL writer, + const SordNode* SERD_NULLABLE graph); /** Write a range to a writer. @@ -568,7 +575,7 @@ This increments `iter` to its end, then frees it. */ SORD_API bool -sord_write_iter(SordIter* iter, SerdWriter* writer); +sord_write_iter(SordIter* SERD_NULLABLE iter, SerdWriter* SERD_NULLABLE writer); /** @} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/include/sord/sordmm.hpp new/sord-0.16.22/include/sord/sordmm.hpp --- old/sord-0.16.20/include/sord/sordmm.hpp 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/include/sord/sordmm.hpp 2026-02-10 19:44:18.000000000 +0100 @@ -9,7 +9,7 @@ #ifndef SORD_SORDMM_HPP #define SORD_SORDMM_HPP -#if defined(__clang__) +#ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" #endif @@ -17,7 +17,7 @@ #include <serd/serd.h> #include <sord/sord.h> -#if defined(__clang__) +#ifdef __clang__ # pragma clang diagnostic pop #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/meson.build new/sord-0.16.22/meson.build --- old/sord-0.16.20/meson.build 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/meson.build 2026-02-10 19:44:18.000000000 +0100 @@ -13,7 +13,7 @@ ], license: 'ISC', meson_version: '>= 0.56.0', - version: '0.16.20', + version: '0.16.22', ) sord_src_root = meson.current_source_dir() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/src/sord.c new/sord-0.16.22/src/sord.c --- old/sord-0.16.20/src/sord.c 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/src/sord.c 2026-02-10 19:44:18.000000000 +0100 @@ -1,4 +1,4 @@ -// Copyright 2011-2016 David Robillard <[email protected]> +// Copyright 2011-2026 David Robillard <[email protected]> // SPDX-License-Identifier: ISC #include "sord_internal.h" @@ -247,6 +247,10 @@ void sord_world_free(SordWorld* world) { + if (!world) { + return; + } + for (ZixHashIter i = zix_hash_begin(world->nodes); i != zix_hash_end(world->nodes); i = zix_hash_next(world->nodes, i)) { @@ -849,7 +853,7 @@ size_t sord_num_nodes(const SordWorld* world) { - return zix_hash_size(world->nodes); + return world ? zix_hash_size(world->nodes) : 0U; } SordIter* @@ -1010,14 +1014,16 @@ const uint8_t* sord_node_get_string(const SordNode* node) { - return node->node.buf; + const uint8_t* const string = node->node.buf; + assert(string); + return string; } const uint8_t* sord_node_get_string_counted(const SordNode* node, size_t* bytes) { *bytes = node->node.n_bytes; - return node->node.buf; + return sord_node_get_string(node); } const uint8_t* @@ -1027,7 +1033,7 @@ { *bytes = node->node.n_bytes; *chars = node->node.n_chars; - return node->node.buf; + return sord_node_get_string(node); } const char* @@ -1176,17 +1182,13 @@ world, datatype, str, n_bytes, n_chars, flags, lang); } -SordNode* -sord_node_from_serd_node(SordWorld* world, - SerdEnv* env, - const SerdNode* node, - const SerdNode* datatype, - const SerdNode* lang) +static SordNode* +sord_node_from_serd_node_internal(SordWorld* world, + SerdEnv* env, + const SerdNode* node, + const SerdNode* datatype, + const SerdNode* lang) { - if (!node) { - return NULL; - } - SordNode* datatype_node = NULL; SordNode* ret = NULL; switch (node->type) { @@ -1249,6 +1251,18 @@ return NULL; } +SordNode* +sord_node_from_serd_node(SordWorld* world, + SerdEnv* env, + const SerdNode* node, + const SerdNode* datatype, + const SerdNode* lang) +{ + return (node && env) + ? sord_node_from_serd_node_internal(world, env, node, datatype, lang) + : NULL; +} + const SerdNode* sord_node_to_serd_node(const SordNode* node) { @@ -1347,6 +1361,10 @@ SerdStatus sord_erase(SordModel* model, SordIter* iter) { + if (!iter) { + return SERD_SUCCESS; + } + if (model->n_iters > 1) { error(model->world, SERD_ERR_BAD_ARG, "erased with many iterators\n"); return SERD_ERR_BAD_ARG; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/src/sord_config.h new/sord-0.16.22/src/sord_config.h --- old/sord-0.16.20/src/sord_config.h 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/src/sord_config.h 2026-02-10 19:44:18.000000000 +0100 @@ -16,9 +16,9 @@ #define SORD_CONFIG_H // Define version unconditionally so a warning will catch a mismatch -#define SORD_VERSION "0.16.20" +#define SORD_VERSION "0.16.22" -#if !defined(SORD_NO_DEFAULT_CONFIG) +#ifndef SORD_NO_DEFAULT_CONFIG // The validator uses PCRE2 for literal pattern matching # ifndef HAVE_PCRE2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/src/sord_validate.c new/sord-0.16.22/src/sord_validate.c --- old/sord-0.16.20/src/sord_validate.c 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/src/sord_validate.c 2026-02-10 19:44:18.000000000 +0100 @@ -9,7 +9,7 @@ #include <zix/filesystem.h> #if USE_PCRE2 -# if defined(__clang__) +# ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wdisabled-macro-expansion" # endif @@ -17,7 +17,7 @@ # define PCRE2_CODE_UNIT_WIDTH 8 # include <pcre2.h> -# if defined(__clang__) +# ifdef __clang__ # pragma clang diagnostic pop # endif #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/src/syntax.c new/sord-0.16.22/src/syntax.c --- old/sord-0.16.20/src/syntax.c 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/src/syntax.c 2026-02-10 19:44:18.000000000 +0100 @@ -171,13 +171,9 @@ return sord_write_iter(iter, writer); } -bool -sord_write_iter(SordIter* iter, SerdWriter* writer) +static bool +sord_write_iter_internal(SordIter* iter, SerdWriter* writer) { - if (!iter) { - return false; - } - SordModel* model = (SordModel*)sord_iter_get_model(iter); SerdStatus st = SERD_SUCCESS; for (; !st && !sord_iter_end(iter); sord_iter_next(iter)) { @@ -189,3 +185,9 @@ return !st; } + +bool +sord_write_iter(SordIter* iter, SerdWriter* writer) +{ + return iter ? sord_write_iter_internal(iter, writer) : false; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/test/cpp/.clang-tidy new/sord-0.16.22/test/cpp/.clang-tidy --- old/sord-0.16.20/test/cpp/.clang-tidy 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/test/cpp/.clang-tidy 2026-02-10 19:44:18.000000000 +0100 @@ -15,6 +15,7 @@ -cppcoreguidelines-pro-type-reinterpret-cast, -cppcoreguidelines-pro-type-vararg, -cppcoreguidelines-special-member-functions, + -cppcoreguidelines-use-enum-class, -fuchsia-default-arguments-calls, -fuchsia-default-arguments-declarations, -fuchsia-overloaded-operator, @@ -37,4 +38,5 @@ CheckOptions: - key: readability-function-cognitive-complexity.Threshold value: '6' +HeaderFilterRegex: '.*\.hpp$' InheritParentConfig: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/test/cpp/meson.build new/sord-0.16.22/test/cpp/meson.build --- old/sord-0.16.20/test/cpp/meson.build 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/test/cpp/meson.build 2026-02-10 19:44:18.000000000 +0100 @@ -23,6 +23,7 @@ '-Wno-cast-function-type-strict', '-Wno-documentation-unknown-command', '-Wno-implicit-float-conversion', + '-Wno-nullability-extension', '-Wno-poison-system-directories', '-Wno-shorten-64-to-32', '-Wno-switch-enum', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/test/headers/test_headers.c new/sord-0.16.22/test/headers/test_headers.c --- old/sord-0.16.20/test/headers/test_headers.c 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/test/headers/test_headers.c 2026-02-10 19:44:18.000000000 +0100 @@ -3,7 +3,7 @@ #include <sord/sord.h> // IWYU pragma: keep -#if defined(__GNUC__) +#ifdef __GNUC__ __attribute__((const)) #endif int diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sord-0.16.20/test/test_sord.c new/sord-0.16.22/test/test_sord.c --- old/sord-0.16.20/test/test_sord.c 2025-11-12 20:07:37.000000000 +0100 +++ new/sord-0.16.22/test/test_sord.c 2026-02-10 19:44:18.000000000 +0100 @@ -1,4 +1,4 @@ -// Copyright 2011-2016 David Robillard <[email protected]> +// Copyright 2011-2026 David Robillard <[email protected]> // SPDX-License-Identifier: ISC #include <serd/serd.h> @@ -393,6 +393,7 @@ { static const unsigned n_quads = 300U; + sord_world_free(NULL); // Shouldn't crash sord_free(NULL); // Shouldn't crash SordWorld* world = sord_world_new();
