Skip to content

Commit 9bbccf3

Browse files
danttikartben
authored andcommitted
include: zephyr: sys: Fix uuid.h usage in C++ code
In uuid.h the function uuid_generate_v5 had a 'namespace' parameter which is a reserved C++ keywork. Renamed to 'ns'. Signed-off-by: Daniel Nicoletti <[email protected]>
1 parent b195061 commit 9bbccf3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/zephyr/sys/uuid.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int uuid_generate_v4(struct uuid *out);
6767
* @details This function computes a deterministic UUID starting from a namespace UUID and binary
6868
* data.
6969
*
70-
* @param namespace A pointer to an UUID to be used as namespace.
70+
* @param ns A pointer to an UUID to be used as namespace.
7171
* @param data A pointer to the data that will be hashed to produce the UUID.
7272
* @param data_size The size of the data buffer.
7373
* @param out The UUID where the result will be written.
@@ -77,7 +77,7 @@ int uuid_generate_v4(struct uuid *out);
7777
* @retval -ENOMEM Memory allocation failed
7878
* @retval -ENOTSUP mbedTLS returned an unrecognized error
7979
*/
80-
int uuid_generate_v5(const struct uuid *namespace, const void *data, size_t data_size,
80+
int uuid_generate_v5(const struct uuid *ns, const void *data, size_t data_size,
8181
struct uuid *out);
8282

8383
/**

lib/uuid/uuid.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ int uuid_generate_v4(struct uuid *out)
7979
#endif
8080

8181
#if defined(CONFIG_UUID_V5)
82-
int uuid_generate_v5(const struct uuid *namespace, const void *data, size_t data_size,
82+
int uuid_generate_v5(const struct uuid *ns, const void *data, size_t data_size,
8383
struct uuid *out)
8484
{
8585
if (out == NULL) {
@@ -114,7 +114,7 @@ int uuid_generate_v5(const struct uuid *namespace, const void *data, size_t data
114114
ret = -EINVAL;
115115
goto exit;
116116
}
117-
mbedtls_err = mbedtls_md_update(&ctx, namespace->val, UUID_SIZE);
117+
mbedtls_err = mbedtls_md_update(&ctx, ns->val, UUID_SIZE);
118118
if (mbedtls_err != 0) {
119119
/* Might return MBEDTLS_ERR_MD_BAD_INPUT_DATA */
120120
ret = -EINVAL;

0 commit comments

Comments
 (0)