svn commit: samba r15201 - in branches/SAMBA_4_0/source: lib/util torture torture/raw

jelmer at samba.org jelmer at samba.org
Mon Apr 24 14:20:45 GMT 2006


Author: jelmer
Date: 2006-04-24 14:20:44 +0000 (Mon, 24 Apr 2006)
New Revision: 15201

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

Log:
Use abs() rather then ABS()

Modified:
   branches/SAMBA_4_0/source/lib/util/util.h
   branches/SAMBA_4_0/source/torture/gentest.c
   branches/SAMBA_4_0/source/torture/raw/open.c
   branches/SAMBA_4_0/source/torture/raw/qfileinfo.c
   branches/SAMBA_4_0/source/torture/raw/qfsinfo.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/util/util.h
===================================================================
--- branches/SAMBA_4_0/source/lib/util/util.h	2006-04-24 14:09:07 UTC (rev 15200)
+++ branches/SAMBA_4_0/source/lib/util/util.h	2006-04-24 14:20:44 UTC (rev 15201)
@@ -76,13 +76,6 @@
 	DEBUG(0,("PANIC: assert failed at %s(%d)\n", __FILE__, __LINE__)); \
 	smb_panic("assert failed"); abort(); }} while (0)
 
-/**
- * determine absolute value
- */
-#ifndef ABS
-#define ABS(a) ((a)>0?(a):(-(a)))
-#endif
-
 #ifndef SAFE_FREE /* Oh no this is also defined in tdb.h */
 /**
  * Free memory if the pointer and zero the pointer.

Modified: branches/SAMBA_4_0/source/torture/gentest.c
===================================================================
--- branches/SAMBA_4_0/source/torture/gentest.c	2006-04-24 14:09:07 UTC (rev 15200)
+++ branches/SAMBA_4_0/source/torture/gentest.c	2006-04-24 14:20:44 UTC (rev 15201)
@@ -206,7 +206,7 @@
 static uint_t time_skew(void)
 {
 	uint_t ret;
-	ret = ABS(servers[0].cli[0]->transport->negotiate.server_time -
+	ret = abs(servers[0].cli[0]->transport->negotiate.server_time -
 		  servers[1].cli[0]->transport->negotiate.server_time);
 	return ret + 300;
 }
@@ -1036,7 +1036,7 @@
 } while(0)
 
 #define CHECK_TIMES_EQUAL(field) do { \
-	if (ABS(parm[0].field - parm[1].field) > time_skew() && \
+	if (abs(parm[0].field - parm[1].field) > time_skew() && \
 	    !ignore_pattern(#field)) { \
 		printf("Mismatch in %s - 0x%x 0x%x\n", #field, \
 		       (int)parm[0].field, (int)parm[1].field); \
@@ -1045,7 +1045,7 @@
 } while(0)
 
 #define CHECK_NTTIMES_EQUAL(field) do { \
-	if (ABS(nt_time_to_unix(parm[0].field) - \
+	if (abs(nt_time_to_unix(parm[0].field) - \
 		nt_time_to_unix(parm[1].field)) > time_skew() && \
 	    !ignore_pattern(#field)) { \
 		printf("Mismatch in %s - 0x%x 0x%x\n", #field, \

Modified: branches/SAMBA_4_0/source/torture/raw/open.c
===================================================================
--- branches/SAMBA_4_0/source/torture/raw/open.c	2006-04-24 14:09:07 UTC (rev 15200)
+++ branches/SAMBA_4_0/source/torture/raw/open.c	2006-04-24 14:20:44 UTC (rev 15201)
@@ -93,7 +93,7 @@
 	CHECK_STATUS(status, NT_STATUS_OK); \
 	t1 = t & ~1; \
 	t2 = nt_time_to_unix(finfo.all_info.out.field) & ~1; \
-	if (ABS(t1-t2) > 2) { \
+	if (abs(t1-t2) > 2) { \
 		printf("(%s) wrong time for field %s  %s - %s\n", \
 		       __location__, #field, \
 		       timestring(mem_ctx, t1), \

Modified: branches/SAMBA_4_0/source/torture/raw/qfileinfo.c
===================================================================
--- branches/SAMBA_4_0/source/torture/raw/qfileinfo.c	2006-04-24 14:09:07 UTC (rev 15200)
+++ branches/SAMBA_4_0/source/torture/raw/qfileinfo.c	2006-04-24 14:20:44 UTC (rev 15201)
@@ -73,7 +73,7 @@
 static int dos_nt_time_cmp(time_t t, NTTIME nt)
 {
 	time_t t2 = nt_time_to_unix(nt);
-	if (ABS(t2 - t) <= 2) return 0;
+	if (abs(t2 - t) <= 2) return 0;
 	return t2 - t;
 }
 

Modified: branches/SAMBA_4_0/source/torture/raw/qfsinfo.c
===================================================================
--- branches/SAMBA_4_0/source/torture/raw/qfsinfo.c	2006-04-24 14:09:07 UTC (rev 15200)
+++ branches/SAMBA_4_0/source/torture/raw/qfsinfo.c	2006-04-24 14:20:44 UTC (rev 15201)
@@ -78,7 +78,7 @@
         ret = False; \
 }} while(0)
 
-#define VAL_APPROX_EQUAL(n1, v1, n2, v2) do {if (ABS((int)(s1->n1.out.v1) - (int)(s2->n2.out.v2)) > 0.1*s1->n1.out.v1) { \
+#define VAL_APPROX_EQUAL(n1, v1, n2, v2) do {if (abs((int)(s1->n1.out.v1) - (int)(s2->n2.out.v2)) > 0.1*s1->n1.out.v1) { \
         printf("%s/%s [%u] != %s/%s [%u] at %s(%d)\n", \
                #n1, #v1, (uint_t)s1->n1.out.v1, \
                #n2, #v2, (uint_t)s2->n2.out.v2, \
@@ -218,7 +218,7 @@
 			s2->allocation.out.sectors_per_unit *
 			s2->allocation.out.total_alloc_units *
 			s2->allocation.out.bytes_per_sector / scale;
-		if (ABS(size1 - size2) > 1) {
+		if (abs(size1 - size2) > 1) {
 			printf("Inconsistent total size in DSKATTR and ALLOCATION - size1=%.0f size2=%.0f\n", 
 			       size1, size2);
 			ret = False;
@@ -240,7 +240,7 @@
 			s2->allocation.out.sectors_per_unit *
 			s2->allocation.out.avail_alloc_units *
 			s2->allocation.out.bytes_per_sector / scale;
-		if (ABS(size1 - size2) > 1) {
+		if (abs(size1 - size2) > 1) {
 			printf("Inconsistent avail size in DSKATTR and ALLOCATION - size1=%.0f size2=%.0f\n", 
 			       size1, size2);
 			ret = False;



More information about the samba-cvs mailing list