diff options
author | lhchavez <lhchavez@lhchavez.com> | 2021-03-04 06:14:36 -0800 |
---|---|---|
committer | lhchavez <lhchavez@lhchavez.com> | 2021-08-08 19:08:59 -0700 |
commit | 4bb1568f22b03642cc160aecab1c1e15093ec748 (patch) | |
tree | bb5c333ec3e117939856f9c731f1ce87b14166bd | |
parent | 231ca4fad36ce7b3dd5d79b599be46ab6001fc18 (diff) | |
download | libgit2-4bb1568f22b03642cc160aecab1c1e15093ec748.tar.gz |
Be a little bit less aggressive GIT_WARN_UNUSED_RESULT
Now we're limiting ourselves to only functions that allocate or acquire
locks.
-rw-r--r-- | src/sortedcache.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/sortedcache.h b/src/sortedcache.h index 777b28bda..0e1f63ceb 100644 --- a/src/sortedcache.h +++ b/src/sortedcache.h @@ -88,7 +88,7 @@ void git_sortedcache_free(git_sortedcache *sc); void git_sortedcache_incref(git_sortedcache *sc); /* Get the pathname associated with this cache at creation time */ -GIT_WARN_UNUSED_RESULT const char *git_sortedcache_path(git_sortedcache *sc); +const char *git_sortedcache_path(git_sortedcache *sc); /* * CACHE WRITE FUNCTIONS @@ -145,7 +145,7 @@ GIT_WARN_UNUSED_RESULT int git_sortedcache_upsert( /* Removes entry at pos from cache * You should already be holding the write lock when you call this. */ -GIT_WARN_UNUSED_RESULT int git_sortedcache_remove(git_sortedcache *sc, size_t pos); +int git_sortedcache_remove(git_sortedcache *sc, size_t pos); /* * CACHE READ FUNCTIONS @@ -163,23 +163,20 @@ GIT_WARN_UNUSED_RESULT int git_sortedcache_rlock(git_sortedcache *sc); void git_sortedcache_runlock(git_sortedcache *sc); /* Lookup item by key - returns NULL if not found */ -GIT_WARN_UNUSED_RESULT void *git_sortedcache_lookup( - const git_sortedcache *sc, const char *key); +void *git_sortedcache_lookup(const git_sortedcache *sc, const char *key); /* Get how many items are in the cache * * You can call this function without holding a lock, but be aware * that it may change before you use it. */ -GIT_WARN_UNUSED_RESULT size_t git_sortedcache_entrycount( - const git_sortedcache *sc); +size_t git_sortedcache_entrycount(const git_sortedcache *sc); /* Lookup item by index - returns NULL if out of range */ -GIT_WARN_UNUSED_RESULT void *git_sortedcache_entry( - git_sortedcache *sc, size_t pos); +void *git_sortedcache_entry(git_sortedcache *sc, size_t pos); /* Lookup index of item by key - returns GIT_ENOTFOUND if not found */ -GIT_WARN_UNUSED_RESULT int git_sortedcache_lookup_index( +int git_sortedcache_lookup_index( size_t *out, git_sortedcache *sc, const char *key); #endif |