[Asterisk-code-review] uuid: Enable UUID in Solaris 11. (asterisk[master])

Alexander Traud asteriskteam at digium.com
Thu Jun 21 11:47:22 CDT 2018


Alexander Traud has uploaded this change for review. ( https://gerrit.asterisk.org/9265


Change subject: uuid: Enable UUID in Solaris 11.
......................................................................

uuid: Enable UUID in Solaris 11.

uuid_unparse_lower(.) does not exist in Solaris. Instead use the more generic
uuid_unparse(.). Nothing in Asterisk uses ast_uuid_to_str(.) and its
documentation does not give any guarantee about the case of the characters
within a UUID.

ASTERISK-27933
Reported by: bautsche

Change-Id: I9b8362824efbfb2a16981e46e85f7c8322908c49
---
M include/asterisk/uuid.h
M main/uuid.c
2 files changed, 11 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/65/9265/1

diff --git a/include/asterisk/uuid.h b/include/asterisk/uuid.h
index 223ad18..4b1849b 100644
--- a/include/asterisk/uuid.h
+++ b/include/asterisk/uuid.h
@@ -52,7 +52,7 @@
  * \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 @@
  * \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 @@
  * \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 @@
  * \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 @@
  * \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
diff --git a/main/uuid.c b/main/uuid.c
index 3c5d7af..4ccbe88 100644
--- a/main/uuid.c
+++ b/main/uuid.c
@@ -133,10 +133,10 @@
 	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);
+	uuid_unparse(uuid->uu, buf);
 	return buf;
 }
 
@@ -148,7 +148,7 @@
 	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 @@
 	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 @@
 	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 @@
 	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);
 }

-- 
To view, visit https://gerrit.asterisk.org/9265
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b8362824efbfb2a16981e46e85f7c8322908c49
Gerrit-Change-Number: 9265
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180621/b2bed73b/attachment.html>


More information about the asterisk-code-review mailing list