TT#14008 add explicit type to STR*INIT macros

This allows these macros to be used in regular assignments and not just
initialisers.

Change-Id: I66ed96192c16ef777959fd9e40302db2786b6545
rfuchs/1283
Richard Fuchs 5 years ago
parent be30d2cc33
commit 24079deb10

@ -33,9 +33,9 @@ typedef struct _str str;
#define STR_NULL ((str) { NULL, 0 })
#define STR_EMPTY ((str) { "", 0 })
#define STR_CONST_INIT(str) { str, sizeof(str)-1 }
#define STR_CONST_INIT_LEN(str, len) { str, len }
#define STR_CONST_INIT_BUF(buf) { (char *) &buf, sizeof(buf) }
#define STR_CONST_INIT(s) ((str) { s, sizeof(s)-1 })
#define STR_CONST_INIT_LEN(s, len) ((str) { s, len })
#define STR_CONST_INIT_BUF(buf) ((str) { (char *) &buf, sizeof(buf) })

Loading…
Cancel
Save