diff options
| author | Randy Palamar <randy@rnpnr.xyz> | 2025-12-05 21:54:50 -0700 |
|---|---|---|
| committer | Randy Palamar <randy@rnpnr.xyz> | 2025-12-08 09:58:02 -0700 |
| commit | 48fbf21a6d6085d561757afb162d9f7b98792bf9 (patch) | |
| tree | 5749a9ffc34199718b2e11fdea81e184f8c68202 /map.h | |
| parent | b389733ab0fa46f2cecd302cc5826fc7dc322c8e (diff) | |
| download | vis-48fbf21a6d6085d561757afb162d9f7b98792bf9.tar.gz vis-48fbf21a6d6085d561757afb162d9f7b98792bf9.tar.xz | |
map: stop setting errno on error
the return of these functions already give all the necessary
information. this is not c standard library code, we have no need
of such a nonsensical error reporting mechanism
NOTE: since errno needs to be thread local accessing it from
non-libc code ends up being a function call and serves as a
pointless optimization barrier.
Diffstat (limited to 'map.h')
| -rw-r--r-- | map.h | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -31,8 +31,7 @@ void *map_first(const Map *map, const char **key); * @param map The map to search within. * @param prefix The prefix to search for. * @return The corresponding value, if the given prefix is unique. - * Otherwise ``NULL``. If no such prefix exists, then ``errno`` - * is set to ``ENOENT``. + * Otherwise ``NULL``. */ void *map_closest(const Map *map, const char *prefix); /** @@ -47,8 +46,8 @@ bool map_contains(const Map *map, const char *prefix); * @param map The map to store the key-value pair in. * @param key The key to store. * @param value The value associated with the key. - * @return False if we run out of memory (``errno = ENOMEM``), or if the key - * already appears in the map (``errno = EEXIST``). + * @return False if we run out of memory, or if the key + * already appears in the map. */ bool map_put(Map *map, const char *key, const void *value); /** |
