]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
uuid: Enable UUID in Solaris 11.
authorAlexander Traud <pabstraud@compuserve.com>
Thu, 21 Jun 2018 16:45:11 +0000 (18:45 +0200)
committerAlexander Traud <pabstraud@compuserve.com>
Sat, 23 Jun 2018 06:26:59 +0000 (00:26 -0600)
ASTERISK-27933
Reported by: bautsche

Change-Id: I9b8362824efbfb2a16981e46e85f7c8322908c49

include/asterisk/uuid.h
main/uuid.c

index 223ad18c9cf3ba287ff535dcd81e25474427b0ef..4b1849b3dcaa4370d7003d3a7c005e9a73d240c6 100644 (file)
@@ -52,7 +52,7 @@ struct ast_uuid *ast_uuid_generate(void);
  * \param size The size of the buffer. Must be at least AST_UUID_STR_LEN.
  * \return The UUID string (a pointer to buf)
  */
-char *ast_uuid_to_str(const struct ast_uuid *uuid, char *buf, size_t size);
+char *ast_uuid_to_str(struct ast_uuid *uuid, char *buf, size_t size);
 
 /*!
  * \brief Generate a UUID string.
@@ -75,7 +75,7 @@ char *ast_uuid_generate_str(char *buf, size_t size);
  * \retval NULL Failed to convert
  * \retval non-NULL The heap-allocated converted UUID
  */
-struct ast_uuid *ast_str_to_uuid(const char *str);
+struct ast_uuid *ast_str_to_uuid(char *str);
 
 /*!
  * \brief Make a copy of a UUID
@@ -87,7 +87,7 @@ struct ast_uuid *ast_str_to_uuid(const char *str);
  * \retval NULL Failed to copy
  * \retval non-NULL The heap-allocated duplicate UUID
  */
-struct ast_uuid *ast_uuid_copy(const struct ast_uuid *src);
+struct ast_uuid *ast_uuid_copy(struct ast_uuid *src);
 
 /*!
  * \brief Compare two UUIDs
@@ -98,7 +98,7 @@ struct ast_uuid *ast_uuid_copy(const struct ast_uuid *src);
  * \retval 0 left and right are the same
  * \retval >0 left is lexicographically greater than right
  */
-int ast_uuid_compare(const struct ast_uuid *left, const struct ast_uuid *right);
+int ast_uuid_compare(struct ast_uuid *left, struct ast_uuid *right);
 
 /*!
  * \brief Clear a UUID by setting it to be a nil UUID (all 0s)
@@ -114,5 +114,5 @@ void ast_uuid_clear(struct ast_uuid *uuid);
  * \retval 0 The UUID is not nil
  * \retval non-zero The UUID is nil
  */
-int ast_uuid_is_nil(const struct ast_uuid *uuid);
+int ast_uuid_is_nil(struct ast_uuid *uuid);
 #endif
index 3c5d7afd40eb7e1cb41d8d6155933eb04d72cbbb..b2c0997a63c30fbb2ac944ccb7fd1d676bf45892 100644 (file)
@@ -133,11 +133,11 @@ struct ast_uuid *ast_uuid_generate(void)
        return uuid;
 }
 
-char *ast_uuid_to_str(const struct ast_uuid *uuid, char *buf, size_t size)
+char *ast_uuid_to_str(struct ast_uuid *uuid, char *buf, size_t size)
 {
        ast_assert(size >= AST_UUID_STR_LEN);
-       uuid_unparse_lower(uuid->uu, buf);
-       return buf;
+       uuid_unparse(uuid->uu, buf);
+       return ast_str_to_lower(buf);
 }
 
 char *ast_uuid_generate_str(char *buf, size_t size)
@@ -148,7 +148,7 @@ char *ast_uuid_generate_str(char *buf, size_t size)
        return ast_uuid_to_str(&uuid, buf, size);
 }
 
-struct ast_uuid *ast_str_to_uuid(const char *str)
+struct ast_uuid *ast_str_to_uuid(char *str)
 {
        struct ast_uuid *uuid = ast_malloc(sizeof(*uuid));
        int res;
@@ -165,7 +165,7 @@ struct ast_uuid *ast_str_to_uuid(const char *str)
        return uuid;
 }
 
-struct ast_uuid *ast_uuid_copy(const struct ast_uuid *src)
+struct ast_uuid *ast_uuid_copy(struct ast_uuid *src)
 {
        struct ast_uuid *dst = ast_malloc(sizeof(*dst));
 
@@ -176,7 +176,7 @@ struct ast_uuid *ast_uuid_copy(const struct ast_uuid *src)
        return dst;
 }
 
-int ast_uuid_compare(const struct ast_uuid *left, const struct ast_uuid *right)
+int ast_uuid_compare(struct ast_uuid *left, struct ast_uuid *right)
 {
        return uuid_compare(left->uu, right->uu);
 }
@@ -186,7 +186,7 @@ void ast_uuid_clear(struct ast_uuid *uuid)
        uuid_clear(uuid->uu);
 }
 
-int ast_uuid_is_nil(const struct ast_uuid *uuid)
+int ast_uuid_is_nil(struct ast_uuid *uuid)
 {
        return uuid_is_null(uuid->uu);
 }