summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-17 09:07:44 -0700
committerAndrew Tridgell <tridge@samba.org>2009-09-17 15:19:26 -0700
commit7326b8f63ebe55bdf662c6f7798cbeeb026b033a (patch)
treebbf0524cacc0fd41699e3aa1b0bee5aa94e0f59a /libcli
parent6dfd10f476e0b74c36f73bfe17a68ca309c4c5ac (diff)
downloadsamba-7326b8f63ebe55bdf662c6f7798cbeeb026b033a.tar.gz
samba-7326b8f63ebe55bdf662c6f7798cbeeb026b033a.tar.bz2
samba-7326b8f63ebe55bdf662c6f7798cbeeb026b033a.zip
util: use likely/unlikely for NT_STATUS_* macros
Diffstat (limited to 'libcli')
-rw-r--r--libcli/util/ntstatus.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcli/util/ntstatus.h b/libcli/util/ntstatus.h
index 5ef429598e..1025f47210 100644
--- a/libcli/util/ntstatus.h
+++ b/libcli/util/ntstatus.h
@@ -637,8 +637,8 @@ NTSTATUS nt_status_string_to_code(const char *nt_status_str);
/** Used by ntstatus_dos_equal: */
extern bool ntstatus_check_dos_mapping;
-#define NT_STATUS_IS_OK(x) (NT_STATUS_V(x) == 0)
-#define NT_STATUS_IS_ERR(x) ((NT_STATUS_V(x) & 0xc0000000) == 0xc0000000)
+#define NT_STATUS_IS_OK(x) (likely(NT_STATUS_V(x) == 0))
+#define NT_STATUS_IS_ERR(x) (unlikely((NT_STATUS_V(x) & 0xc0000000) == 0xc0000000))
/* checking for DOS error mapping here is ugly, but unfortunately the
alternative is a very intrusive rewrite of the torture code */
#if _SAMBA_BUILD_ == 4
@@ -648,7 +648,7 @@ extern bool ntstatus_check_dos_mapping;
#endif
#define NT_STATUS_HAVE_NO_MEMORY(x) do { \
- if (!(x)) {\
+ if (unlikely(!(x))) { \
return NT_STATUS_NO_MEMORY;\
}\
} while (0)