Commit 9bbccf39 authored by Daniel Nicoletti's avatar Daniel Nicoletti Committed by Benjamin Cabé
Browse files

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: default avatarDaniel Nicoletti <dantti12@gmail.com>
parent b1950615
Loading
Loading
Loading
Loading
+2 −2
Changes for include/zephyr/sys/uuid.h: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ int uuid_generate_v4(struct uuid *out);
 * @details This function computes a deterministic UUID starting from a namespace UUID and binary
 * data.
 *
 * @param namespace A pointer to an UUID to be used as namespace.
 * @param ns A pointer to an UUID to be used as namespace.
 * @param data A pointer to the data that will be hashed to produce the UUID.
 * @param data_size The size of the data buffer.
 * @param out The UUID where the result will be written.
@@ -77,7 +77,7 @@ int uuid_generate_v4(struct uuid *out);
 * @retval -ENOMEM Memory allocation failed
 * @retval -ENOTSUP mbedTLS returned an unrecognized error
 */
int uuid_generate_v5(const struct uuid *namespace, const void *data, size_t data_size,
int uuid_generate_v5(const struct uuid *ns, const void *data, size_t data_size,
		     struct uuid *out);

/**
+2 −2
Changes for lib/uuid/uuid.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ int uuid_generate_v4(struct uuid *out)
#endif

#if defined(CONFIG_UUID_V5)
int uuid_generate_v5(const struct uuid *namespace, const void *data, size_t data_size,
int uuid_generate_v5(const struct uuid *ns, const void *data, size_t data_size,
		     struct uuid *out)
{
	if (out == NULL) {
@@ -114,7 +114,7 @@ int uuid_generate_v5(const struct uuid *namespace, const void *data, size_t data
		ret = -EINVAL;
		goto exit;
	}
	mbedtls_err = mbedtls_md_update(&ctx, namespace->val, UUID_SIZE);
	mbedtls_err = mbedtls_md_update(&ctx, ns->val, UUID_SIZE);
	if (mbedtls_err != 0) {
		/* Might return MBEDTLS_ERR_MD_BAD_INPUT_DATA */
		ret = -EINVAL;