aboutsummaryrefslogtreecommitdiff
path: root/map.h
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2025-12-05 21:54:50 -0700
committerRandy Palamar <randy@rnpnr.xyz>2025-12-08 09:58:02 -0700
commit48fbf21a6d6085d561757afb162d9f7b98792bf9 (patch)
tree5749a9ffc34199718b2e11fdea81e184f8c68202 /map.h
parentb389733ab0fa46f2cecd302cc5826fc7dc322c8e (diff)
downloadvis-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.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/map.h b/map.h
index e733bd3..d3457d9 100644
--- a/map.h
+++ b/map.h
@@ -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);
/**