[BusyBox-cvs] svn commit: trunk/busybox/e2fsprogs/uuid

vapier at busybox.net vapier at busybox.net
Sat Jun 11 00:36:04 UTC 2005


Author: vapier
Date: 2005-06-10 18:36:04 -0600 (Fri, 10 Jun 2005)
New Revision: 10521

Log:
replace simple is_null func with a memcmp define

Removed:
   trunk/busybox/e2fsprogs/uuid/isnull.c

Modified:
   trunk/busybox/e2fsprogs/uuid/uuid.h


Changeset:
Deleted: trunk/busybox/e2fsprogs/uuid/isnull.c
===================================================================
--- trunk/busybox/e2fsprogs/uuid/isnull.c	2005-06-11 00:27:50 UTC (rev 10520)
+++ trunk/busybox/e2fsprogs/uuid/isnull.c	2005-06-11 00:36:04 UTC (rev 10521)
@@ -1,48 +0,0 @@
-/*
- * isnull.c --- Check whether or not the UUID is null
- * 
- * Copyright (C) 1996, 1997 Theodore Ts'o.
- *
- * %Begin-Header%
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, and the entire permission notice in its entirety,
- *    including the disclaimer of warranties.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote
- *    products derived from this software without specific prior
- *    written permission.
- * 
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
- * WHICH ARE HEREBY DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
- * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH
- * DAMAGE.
- * %End-Header%
- */
-
-#include "uuidP.h"
-
-/* Returns 1 if the uuid is the NULL uuid */
-int uuid_is_null(const uuid_t uu)
-{
-	const unsigned char 	*cp;
-	int			i;
-
-	for (i=0, cp = uu; i < 16; i++)
-		if (*cp++)
-			return 0;
-	return 1;
-}
-

Modified: trunk/busybox/e2fsprogs/uuid/uuid.h
===================================================================
--- trunk/busybox/e2fsprogs/uuid/uuid.h	2005-06-11 00:27:50 UTC (rev 10520)
+++ trunk/busybox/e2fsprogs/uuid/uuid.h	2005-06-11 00:36:04 UTC (rev 10521)
@@ -66,14 +66,14 @@
 
 /* clear.c */
 /*void uuid_clear(uuid_t uu);*/
-#define uuid_clear(uu) memset(uu, 0, 16)
+#define uuid_clear(uu) memset(uu, 0, sizeof(uu))
 
 /* compare.c */
 int uuid_compare(const uuid_t uu1, const uuid_t uu2);
 
 /* copy.c */
 /*void uuid_copy(uuid_t dst, const uuid_t src);*/
-#define uuid_copy(dst,src) memcpy(dst,src,16)
+#define uuid_copy(dst,src) memcpy(dst, src, sizeof(dst))
 
 /* gen_uuid.c */
 void uuid_generate(uuid_t out);
@@ -81,7 +81,8 @@
 void uuid_generate_time(uuid_t out);
 
 /* isnull.c */
-int uuid_is_null(const uuid_t uu);
+/*int uuid_is_null(const uuid_t uu);*/
+#define uuid_is_null(uu) (!memcmp(uu, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", sizeof(uu)))
 
 /* parse.c */
 int uuid_parse(const char *in, uuid_t uu);




More information about the busybox-cvs mailing list