svn commit: samba r4607 - in branches/SAMBA_4_0/source/include: .

metze at samba.org metze at samba.org
Sun Jan 9 02:30:01 GMT 2005


Author: metze
Date: 2005-01-09 02:30:01 +0000 (Sun, 09 Jan 2005)
New Revision: 4607

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4607

Log:
add some usefull macros to make the code more readable

metze

Modified:
   branches/SAMBA_4_0/source/include/nt_status.h


Changeset:
Modified: branches/SAMBA_4_0/source/include/nt_status.h
===================================================================
--- branches/SAMBA_4_0/source/include/nt_status.h	2005-01-09 02:03:59 UTC (rev 4606)
+++ branches/SAMBA_4_0/source/include/nt_status.h	2005-01-09 02:30:01 UTC (rev 4607)
@@ -64,6 +64,30 @@
 	}\
 } while (0)
 
+#define NT_STATUS_IS_OK_RETURN(x) do { \
+	if (NT_STATUS_IS_OK(x)) {\
+		return x;\
+	}\
+} while (0)
+
+#define NT_STATUS_NOT_OK_RETURN(x) do { \
+	if (!NT_STATUS_IS_OK(x)) {\
+		return x;\
+	}\
+} while (0)
+
+#define NT_STATUS_IS_ERR_RETURN(x) do { \
+	if (NT_STATUS_IS_ERR(x)) {\
+		return x;\
+	}\
+} while (0)
+
+#define NT_STATUS_NOT_ERR_RETURN(x) do { \
+	if (!NT_STATUS_IS_ERR(x)) {\
+		return x;\
+	}\
+} while (0)
+
 #define W_ERROR_IS_OK(x) (W_ERROR_V(x) == 0)
 #define W_ERROR_EQUAL(x,y) (W_ERROR_V(x) == W_ERROR_V(y))
 
@@ -73,6 +97,18 @@
 	}\
 } while (0)
 
+#define W_ERROR_IS_OK_RETURN(x) do { \
+	if (W_ERROR_IS_OK(x)) {\
+		return x;\
+	}\
+} while (0)
+
+#define W_ERROR_NOT_OK_RETURN(x) do { \
+	if (!W_ERROR_IS_OK(x)) {\
+		return x;\
+	}\
+} while (0)
+
 /* this defines special NTSTATUS codes to represent DOS errors.  I
    have chosen this macro to produce status codes in the invalid
    NTSTATUS range */



More information about the samba-cvs mailing list