projects
/
awesomized
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
7c8b8a5
)
Merge in fix for return.
author
Brian Aker
<brian@tangent.org>
Fri, 29 Jul 2011 19:41:58 +0000
(12:41 -0700)
committer
Brian Aker
<brian@tangent.org>
Fri, 29 Jul 2011 19:41:58 +0000
(12:41 -0700)
libmemcached/return.h
patch
|
blob
|
history
diff --git
a/libmemcached/return.h
b/libmemcached/return.h
index 0d3148429f46be9ad901f28c104c9ff4b6688d10..d45d2e853e570d0ca24a8c6559fec5fba92f558b 100644
(file)
--- a/
libmemcached/return.h
+++ b/
libmemcached/return.h
@@
-91,8
+91,27
@@
enum memcached_return_t {
typedef enum memcached_return_t memcached_return_t;
#endif
typedef enum memcached_return_t memcached_return_t;
#endif
+static inline bool memcached_success(memcached_return_t rc)
+{
+ return (rc == MEMCACHED_BUFFERED ||
+ rc == MEMCACHED_DELETED ||
+ rc == MEMCACHED_END ||
+ rc == MEMCACHED_ITEM ||
+ rc == MEMCACHED_STAT ||
+ rc == MEMCACHED_STORED ||
+ rc == MEMCACHED_SUCCESS ||
+ rc == MEMCACHED_VALUE);
+}
-#define memcached_success(__memcached_return_t) ((__memcached_return_t) == MEMCACHED_SUCCESS or (__memcached_return_t) == MEMCACHED_END)
-#define memcached_failed(__memcached_return_t) ((__memcached_return_t) != MEMCACHED_SUCCESS and (__memcached_return_t) != MEMCACHED_END)
-#define memcached_continue(__memcached_return_t) ((__memcached_return_t) == MEMCACHED_IN_PROGRESS)
+static inline bool memcached_failed(memcached_return_t rc)
+{
+ return (rc != MEMCACHED_SUCCESS &&
+ rc != MEMCACHED_END &&
+ rc != MEMCACHED_STORED &&
+ rc != MEMCACHED_STAT &&
+ rc != MEMCACHED_DELETED &&
+ rc != MEMCACHED_BUFFERED &&
+ rc != MEMCACHED_VALUE);
+}
+#define memcached_continue(__memcached_return_t) ((__memcached_return_t) == MEMCACHED_IN_PROGRESS)