undo example.h change; tiny fixes to UsefulBuf
diff --git a/example.h b/example.h
index 73c7cc0..b5bcf4b 100644
--- a/example.h
+++ b/example.h
@@ -13,19 +13,8 @@
#ifndef qcborExample_h
#define qcborExample_h
-#ifdef __cplusplus
-extern "C" {
-#if 0
-} /* Keep editor indention formatting happy */
-#endif
-#endif
-
#include <stdint.h>
int32_t RunQCborExample(void);
-#ifdef __cplusplus
-}
-#endif
-
#endif /* qcborExample_h */
diff --git a/inc/qcbor/UsefulBuf.h b/inc/qcbor/UsefulBuf.h
index 8d6297b..c271a31 100644
--- a/inc/qcbor/UsefulBuf.h
+++ b/inc/qcbor/UsefulBuf.h
@@ -285,7 +285,7 @@
* In C compound literals are used.
*
* In C++ list initalization is used. This only works
- * in C11 and later.
+ * in C++11 and later.
*
* Note that some popular C++ compilers can handle compound
* literals with on-by-default extensions, however
@@ -293,9 +293,9 @@
* compilers so they are not used.
*/
#ifdef __cplusplus
-#define NULLUsefulBufC {NULL, 0}
+#define NULLUsefulBufC {NULL, 0}
#else
-#define NULLUsefulBufC ((UsefulBufC) {NULL, 0})
+#define NULLUsefulBufC ((UsefulBufC) {NULL, 0})
#endif
/**
@@ -419,8 +419,7 @@
* The terminating \0 (NULL) is NOT included in the length!
*/
#ifdef __cplusplus
-#define UsefulBuf_FROM_SZ_LITERAL(szString) \
- {(szString), sizeof(szString)-1}
+#define UsefulBuf_FROM_SZ_LITERAL(szString) {(szString), sizeof(szString)-1}
#else
#define UsefulBuf_FROM_SZ_LITERAL(szString) \
((UsefulBufC) {(szString), sizeof(szString)-1})
@@ -434,8 +433,7 @@
* will not work on non-literal arrays.
*/
#ifdef __cplusplus
-#define UsefulBuf_FROM_BYTE_ARRAY_LITERAL(pBytes) \
- {(pBytes), sizeof(pBytes)}
+#define UsefulBuf_FROM_BYTE_ARRAY_LITERAL(pBytes) {(pBytes), sizeof(pBytes)}
#else
#define UsefulBuf_FROM_BYTE_ARRAY_LITERAL(pBytes) \
((UsefulBufC) {(pBytes), sizeof(pBytes)})
@@ -456,11 +454,10 @@
* UsefulBuf_MAKE_STACK_UB.
*/
#ifdef __cplusplus
-#define UsefulBuf_FROM_BYTE_ARRAY(pBytes) \
- {(pBytes), sizeof(pBytes)}
+#define UsefulBuf_FROM_BYTE_ARRAY(pBytes) {(pBytes), sizeof(pBytes)}
#else
#define UsefulBuf_FROM_BYTE_ARRAY(pBytes) \
- ((UsefulBuf) {(pBytes), sizeof(pBytes)})
+ ((UsefulBuf) {(pBytes), sizeof(pBytes)})
#endif
@@ -651,8 +648,7 @@
#ifndef USEFULBUF_DISABLE_DEPRECATED
/** Deprecated macro; use @ref UsefulBuf_FROM_SZ_LITERAL instead */
-#define SZLiteralToUsefulBufC(szString) \
- UsefulBuf_FROM_SZ_LITERAL(szString)
+#define SZLiteralToUsefulBufC(szString) UsefulBuf_FROM_SZ_LITERAL(szString)
/** Deprecated macro; use UsefulBuf_MAKE_STACK_UB instead */
#define MakeUsefulBufOnStack(name, size) \
@@ -661,7 +657,7 @@
/** Deprecated macro; use @ref UsefulBuf_FROM_BYTE_ARRAY_LITERAL instead */
#define ByteArrayLiteralToUsefulBufC(pBytes) \
- UsefulBuf_FROM_BYTE_ARRAY_LITERAL(pBytes)
+ UsefulBuf_FROM_BYTE_ARRAY_LITERAL(pBytes)
/** Deprecated function; use UsefulBuf_Unconst() instead */
static inline UsefulBuf UsefulBufC_Unconst(const UsefulBufC UBC)