[ipxe-devel] [PATCH ipxe v1 2/4] [uuid] minor constness nits

David Decotigny ddecotig at gmail.com
Fri Nov 11 20:23:07 UTC 2016


---
 src/core/uuid.c         | 2 +-
 src/include/ipxe/uuid.h | 2 +-
 src/net/peerdisc.c      | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/uuid.c b/src/core/uuid.c
index b8d21de..c43d421 100644
--- a/src/core/uuid.c
+++ b/src/core/uuid.c
@@ -40,7 +40,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  * @v uuid		UUID
  * @ret string		UUID in canonical form
  */
-char * uuid_ntoa ( const union uuid *uuid ) {
+const char * uuid_ntoa ( const union uuid *uuid ) {
 	static char buf[37]; /* "00000000-0000-0000-0000-000000000000" */
 
 	sprintf ( buf, "%08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x",
diff --git a/src/include/ipxe/uuid.h b/src/include/ipxe/uuid.h
index 6c45eb9..24c46ac 100644
--- a/src/include/ipxe/uuid.h
+++ b/src/include/ipxe/uuid.h
@@ -47,6 +47,6 @@ static inline void uuid_mangle ( union uuid *uuid ) {
 	__bswap_16s ( &uuid->canonical.c );
 }
 
-extern char * uuid_ntoa ( const union uuid *uuid );
+extern const char * uuid_ntoa ( const union uuid *uuid );
 
 #endif /* _IPXE_UUID_H */
diff --git a/src/net/peerdisc.c b/src/net/peerdisc.c
index 5b0e989..4c3cd2e 100644
--- a/src/net/peerdisc.c
+++ b/src/net/peerdisc.c
@@ -408,7 +408,7 @@ static struct peerdisc_segment * peerdisc_create ( const char *id ) {
 	} random_uuid;
 	size_t uuid_len;
 	size_t id_len;
-	char *uuid;
+	const char *uuid;
 	char *uuid_copy;
 	char *id_copy;
 	unsigned int i;
-- 
2.8.0.rc3.226.g39d4020




More information about the ipxe-devel mailing list