OSSP CVS Repository

ossp - Difference in ossp-pkg/uuid/uuid.c versions 1.62 and 1.63
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/uuid/uuid.c 1.62 -> 1.63

--- uuid.c       2006/08/02 13:11:09     1.62
+++ uuid.c       2006/10/06 08:32:40     1.63
@@ -328,20 +328,24 @@
 
 /* INTERNAL: pack UUID object into binary representation
    (allows in-place operation for internal efficiency!) */
-static uuid_rc_t uuid_export_bin(const uuid_t *uuid, void **data_ptr, size_t *data_len)
+static uuid_rc_t uuid_export_bin(const uuid_t *uuid, void *_data_ptr, size_t *data_len)
 {
+    uuid_uint8_t **data_ptr;
     uuid_uint8_t *out;
     uuid_uint32_t tmp32;
     uuid_uint16_t tmp16;
     unsigned int i;
 
+    /* cast generic data pointer to particular pointer to pointer type */
+    data_ptr = (uuid_uint8_t **)_data_ptr;
+
     /* sanity check argument(s) */
     if (uuid == NULL || data_ptr == NULL)
         return UUID_RC_ARG;
 
     /* optionally allocate octet data buffer */
     if (*data_ptr == NULL) {
-        if ((*data_ptr = malloc(sizeof(uuid_t))) == NULL)
+        if ((*data_ptr = (uuid_uint8_t *)malloc(sizeof(uuid_t))) == NULL)
             return UUID_RC_MEM;
         if (data_len != NULL)
             *data_len = UUID_LEN_BIN;
@@ -355,7 +359,7 @@
     }
 
     /* treat output data buffer as octet stream */
-    out = (uuid_uint8_t *)(*data_ptr);
+    out = *data_ptr;
 
     /* pack "time_low" field */
     tmp32 = uuid->obj.time_low;
@@ -492,10 +496,14 @@
 }
 
 /* INTERNAL: export UUID object to string representation */
-static uuid_rc_t uuid_export_str(const uuid_t *uuid, void **data_ptr, size_t *data_len)
+static uuid_rc_t uuid_export_str(const uuid_t *uuid, void *_data_ptr, size_t *data_len)
 {
+    char **data_ptr;
     char *data_buf;
 
+    /* cast generic data pointer to particular pointer to pointer type */
+    data_ptr = (char **)_data_ptr;
+
     /* sanity check argument(s) */
     if (uuid == NULL || data_ptr == NULL)
         return UUID_RC_ARG;
@@ -543,8 +551,9 @@
 }
 
 /* INTERNAL: export UUID object to single integer value representation */
-static uuid_rc_t uuid_export_siv(const uuid_t *uuid, void **data_ptr, size_t *data_len)
+static uuid_rc_t uuid_export_siv(const uuid_t *uuid, void *_data_ptr, size_t *data_len)
 {
+    char **data_ptr;
     char *data_buf;
     void *tmp_ptr;
     size_t tmp_len;
@@ -553,6 +562,9 @@
     uuid_rc_t rc;
     int i;
 
+    /* cast generic data pointer to particular pointer to pointer type */
+    data_ptr = (char **)_data_ptr;
+
     /* sanity check argument(s) */
     if (uuid == NULL || data_ptr == NULL)
         return UUID_RC_ARG;
@@ -621,8 +633,9 @@
 };
 
 /* INTERNAL: dump UUID object as descriptive text */
-static uuid_rc_t uuid_export_txt(const uuid_t *uuid, void **data_ptr, size_t *data_len)
+static uuid_rc_t uuid_export_txt(const uuid_t *uuid, void *_data_ptr, size_t *data_len)
 {
+    char **data_ptr;
     uuid_rc_t rc;
     char **out;
     char *out_ptr;
@@ -648,6 +661,9 @@
     struct tm *tm;
     int i;
 
+    /* cast generic data pointer to particular pointer to pointer type */
+    data_ptr = (char **)_data_ptr;
+
     /* sanity check argument(s) */
     if (uuid == NULL || data_ptr == NULL)
         return UUID_RC_ARG;
@@ -820,7 +836,7 @@
 }
 
 /* UUID exporting */
-uuid_rc_t uuid_export(const uuid_t *uuid, uuid_fmt_t fmt, void **data_ptr, size_t *data_len)
+uuid_rc_t uuid_export(const uuid_t *uuid, uuid_fmt_t fmt, void *data_ptr, size_t *data_len)
 {
     uuid_rc_t rc;
 

CVSTrac 2.0.1