OSSP CVS Repository

ossp - Check-in [5384]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 5384
Date: 2006-Mar-17 08:10:10 (local)
2006-Mar-17 07:10:10 (UTC)
User:rse
Branch:
Comment: Speed up processing in uuid_str.c by reducing va_copy() calls from two to just one per formatting.
Tickets:
Inspections:
Files:
ossp-pkg/uuid/ChangeLog      1.111 -> 1.112     6 inserted, 0 deleted
ossp-pkg/uuid/uuid_str.c      1.7 -> 1.8     6 inserted, 8 deleted

ossp-pkg/uuid/ChangeLog 1.111 -> 1.112

--- ChangeLog    2006/03/13 09:42:47     1.111
+++ ChangeLog    2006/03/17 07:10:10     1.112
@@ -11,6 +11,12 @@
   This is a list of all changes to OSSP uuid.
   For a more brief summary please have a look at the NEWS file.
 
+  Changes between 1.4.2 and 1.4.3 (13-Mar-2006 to XX-Mar-2006)
+
+   o Speed up processing in uuid_str.c by reducing va_copy() calls from
+     two to just one per formatting.
+     [Ralf S. Engelschall]
+
   Changes between 1.4.1 and 1.4.2 (07-Feb-2006 to 13-Mar-2006)
 
    o Fix uuid_export() function by fixing the internal


ossp-pkg/uuid/uuid_str.c 1.7 -> 1.8

--- uuid_str.c   2006/03/13 09:39:11     1.7
+++ uuid_str.c   2006/03/17 07:10:10     1.8
@@ -690,13 +690,12 @@
 {
     char *rv;
     int n;
-    va_list ap_bak;
+    va_list ap_tmp;
 
-    va_copy(ap_bak, ap);
-    n = str_vsnprintf(NULL, 0, fmt, ap);
+    va_copy(ap_tmp, ap);
+    n = str_vsnprintf(NULL, 0, fmt, ap_tmp);
     if ((rv = (char *)malloc(n+1)) == NULL)
         return NULL;
-    va_copy(ap, ap_bak);
     str_vsnprintf(rv, n+1, fmt, ap);
     return rv;
 }
@@ -723,7 +722,7 @@
 {
     int rv;
     size_t n;
-    va_list ap_bak;
+    va_list ap_tmp;
 
     if (str == NULL)
         return -1;
@@ -732,12 +731,11 @@
         rv = strlen(*str);
     }
     else {
-        va_copy(ap_bak, ap);
+        va_copy(ap_tmp, ap);
         n = strlen(*str);
-        rv = str_vsnprintf(NULL, 0, fmt, ap);
+        rv = str_vsnprintf(NULL, 0, fmt, ap_tmp);
         if ((*str = (char *)realloc(*str, n+rv+1)) == NULL)
             return -1;
-        va_copy(ap, ap_bak);
         str_vsnprintf((*str)+n, rv+1, fmt, ap);
     }
     return rv;

CVSTrac 2.0.1