fix for stricter compilers; latest XCode/LLVM
diff --git a/test/qcbor_decode_tests.c b/test/qcbor_decode_tests.c
index 140283f..e21971f 100644
--- a/test/qcbor_decode_tests.c
+++ b/test/qcbor_decode_tests.c
@@ -90,302 +90,302 @@
static int32_t IntegerValuesParseTestInternal(QCBORDecodeContext *pDCtx)
{
QCBORItem Item;
- int nCBORError;
+ QCBORError nCBORError;
if((nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_ARRAY)
return -1;
if((nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -9223372036854775807LL - 1)
return -1;
if((nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -4294967297)
return -1;
if((nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -4294967296)
return -1;
if((nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -4294967295)
return -1;
if((nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -4294967294)
return -1;
if((nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -2147483648)
return -1;
if((nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -2147483647)
return -1;
if((nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -65538)
return -1;
if((nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -65537)
return -1;
if((nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -65536)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -65535)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -65534)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -257)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -256)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -255)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -254)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -25)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -24)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -23)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != -1)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 0)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 0)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 1)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 22)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 23)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 24)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 25)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 26)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 254)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 255)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 256)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 257)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 65534)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 65535)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 65536)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 65537)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 65538)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 2147483647)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 2147483647)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 2147483648)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 2147483649)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 4294967294)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 4294967295)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 4294967296)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 4294967297)
return -1;
@@ -393,14 +393,14 @@
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.val.int64 != 9223372036854775807LL)
return -1;
if(( nCBORError = QCBORDecode_GetNext(pDCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_UINT64 ||
Item.val.uint64 != 18446744073709551615ULL)
return -1;
@@ -890,21 +890,21 @@
{
QCBORDecodeContext DCtx;
QCBORItem Item;
- int nCBORError;
+ QCBORError nCBORError;
QCBORDecode_Init(&DCtx,
(UsefulBufC){pValidMapEncoded, sizeof(pValidMapEncoded)},
nMode);
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uDataType != QCBOR_TYPE_MAP ||
Item.val.uCount != 3)
return -1;
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
Item.uDataType != QCBOR_TYPE_INT64 ||
@@ -916,7 +916,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
Item.uDataAlloc ||
@@ -927,7 +927,7 @@
return -1;
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uDataType != QCBOR_TYPE_TEXT_STRING ||
Item.uDataAlloc ||
@@ -937,7 +937,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uDataType != QCBOR_TYPE_TEXT_STRING ||
Item.uDataAlloc ||
@@ -947,7 +947,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
Item.uDataAlloc ||
@@ -959,7 +959,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
UsefulBuf_Compare(Item.label.string, UsefulBuf_FromSZ("bytes 1"))||
@@ -971,7 +971,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
UsefulBuf_Compare(Item.label.string, UsefulBuf_FromSZ("bytes 2")) ||
@@ -983,7 +983,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
Item.uDataAlloc ||
@@ -994,7 +994,7 @@
return -1;
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
UsefulBuf_Compare(Item.label.string, UsefulBuf_FromSZ("text 2"))||
@@ -1017,14 +1017,14 @@
{
QCBORDecodeContext DCtx;
QCBORItem Item;
- int nCBORError;
+ QCBORError nCBORError;
QCBORDecode_Init(&DCtx,
UsefulBuf_FROM_BYTE_ARRAY_LITERAL(pValidMapEncoded),
QCBOR_DECODE_MODE_MAP_AS_ARRAY);
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uDataType != QCBOR_TYPE_MAP_AS_ARRAY ||
Item.val.uCount != 6) {
@@ -1032,7 +1032,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uDataType != QCBOR_TYPE_TEXT_STRING ||
Item.uDataAlloc ||
@@ -1043,7 +1043,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_NONE ||
Item.uDataType != QCBOR_TYPE_INT64 ||
@@ -1054,7 +1054,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_NONE ||
Item.uDataAlloc ||
@@ -1065,7 +1065,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_NONE ||
Item.uDataAlloc ||
@@ -1076,7 +1076,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uDataType != QCBOR_TYPE_TEXT_STRING ||
Item.val.string.len != 7 ||
@@ -1087,7 +1087,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uDataType != QCBOR_TYPE_TEXT_STRING ||
Item.uDataAlloc ||
@@ -1098,7 +1098,7 @@
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_NONE ||
Item.uDataAlloc ||
@@ -1108,7 +1108,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_NONE ||
Item.uDataAlloc ||
@@ -1119,7 +1119,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_NONE ||
UsefulBuf_Compare(Item.val.string, UsefulBuf_FromSZ("bytes 1"))||
@@ -1130,7 +1130,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_NONE ||
Item.uDataType != QCBOR_TYPE_BYTE_STRING ||
@@ -1141,7 +1141,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_NONE ||
UsefulBuf_Compare(Item.val.string, UsefulBuf_FromSZ("bytes 2")) ||
@@ -1152,7 +1152,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_NONE ||
Item.uDataType != QCBOR_TYPE_BYTE_STRING ||
@@ -1163,7 +1163,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_NONE ||
Item.uDataAlloc ||
@@ -1174,7 +1174,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_NONE ||
Item.uDataAlloc ||
@@ -1185,7 +1185,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_NONE ||
UsefulBuf_Compare(Item.val.string, UsefulBuf_FromSZ("text 2"))||
@@ -1196,7 +1196,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_NONE ||
Item.uDataType != QCBOR_TYPE_TEXT_STRING ||
@@ -1226,7 +1226,7 @@
{
QCBORDecodeContext DCtx;
QCBORItem Item;
- int nCBORError;
+ QCBORError nCBORError;
QCBORDecode_Init(&DCtx,
(UsefulBufC){pValidMapEncoded, sizeof(pValidMapEncoded)},
@@ -1242,7 +1242,7 @@
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uDataType != QCBOR_TYPE_MAP ||
Item.val.uCount != 3)
@@ -1258,7 +1258,7 @@
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
Item.uDataType != QCBOR_TYPE_INT64 ||
@@ -1276,7 +1276,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
UsefulBuf_Compare(Item.label.string, UsefulBuf_FromSZ("an array of two strings")) ||
@@ -1296,7 +1296,7 @@
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uDataType != QCBOR_TYPE_TEXT_STRING ||
UsefulBuf_Compare(Item.val.string, UsefulBuf_FromSZ("string1"))) {
@@ -1312,7 +1312,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uDataType != QCBOR_TYPE_TEXT_STRING ||
UsefulBuf_Compare(Item.val.string, UsefulBuf_FromSZ("string2"))) {
@@ -1328,7 +1328,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
UsefulBuf_Compare(Item.label.string, UsefulBuf_FromSZ("map in a map")) ||
@@ -1345,7 +1345,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
UsefulBuf_Compare(Item.label.string, UsefulBuf_FromSZ("bytes 1")) ||
@@ -1363,7 +1363,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
UsefulBuf_Compare(Item.label.string, UsefulBuf_FromSZ("bytes 2")) ||
@@ -1381,7 +1381,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
UsefulBuf_Compare(Item.label.string, UsefulBuf_FromSZ("another int")) ||
@@ -1398,7 +1398,7 @@
}
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item))) {
- return nCBORError;
+ return (int32_t)nCBORError;
}
if(Item.uLabelType != QCBOR_TYPE_TEXT_STRING ||
UsefulBuf_Compare(Item.label.string, UsefulBuf_FromSZ("text 2"))||
@@ -1456,7 +1456,7 @@
{
QCBORDecodeContext DCtx;
QCBORItem Item;
- int nCBORError;
+ QCBORError nCBORError;
QCBORDecode_Init(&DCtx,
@@ -1465,28 +1465,28 @@
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_ARRAY ||
Item.val.uCount != 10)
return -1;
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_FALSE)
return -1;
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_TRUE)
return -1;
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_NULL)
return -1;
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_UNDEF)
return -1;
@@ -1495,12 +1495,12 @@
return -1;
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_UKNOWN_SIMPLE || Item.val.uSimple != 0)
return -1;
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_UKNOWN_SIMPLE || Item.val.uSimple != 19)
return -1;
@@ -1514,12 +1514,12 @@
return -1;
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_UKNOWN_SIMPLE || Item.val.uSimple != 32)
return -1;
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_UKNOWN_SIMPLE || Item.val.uSimple != 255)
return -1;
@@ -1924,7 +1924,7 @@
QCBOR_DECODE_MODE_NORMAL);
if((nCBORError = QCBORDecode_GetNext(&DCtx, &Item)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item.uDataType != QCBOR_TYPE_ARRAY ||
Item.val.uCount != 10) {
// This wasn't supposed to happen
@@ -2080,7 +2080,7 @@
{
QCBORDecodeContext DCtx;
QCBORItem Item;
- int nCBORError;
+ QCBORError nCBORError;
QCBORDecode_Init(&DCtx,
UsefulBuf_FROM_BYTE_ARRAY_LITERAL(spDateTestInput),
@@ -2555,7 +2555,7 @@
{
QCBORDecodeContext DCtx;
QCBORItem Item;
- int nCBORError;
+ QCBORError nCBORError;
QCBORDecode_Init(&DCtx,
UsefulBuf_FROM_BYTE_ARRAY_LITERAL(spBigNumInput),
@@ -2639,7 +2639,7 @@
QCBORItem *pItem)
{
QCBORItem Item;
- int nCBORError;
+ QCBORError nCBORError;
if((nCBORError = QCBORDecode_GetNext(pCtx, &Item))) return -1;
if(Item.uDataType != uDataType) return -1;
@@ -2821,7 +2821,7 @@
int j;
for(j = 0; j < nNestLevel; j++) {
QCBORItem Item;
- int nReturn = QCBORDecode_GetNext(&DC, &Item);
+ QCBORError nReturn = QCBORDecode_GetNext(&DC, &Item);
if(j >= QCBOR_MAX_ARRAY_NESTING) {
// Should be in error
if(nReturn != QCBOR_ERR_ARRAY_NESTING_TOO_DEEP) {
@@ -2839,7 +2839,7 @@
return -7;
}
}
- int nReturn = QCBORDecode_Finish(&DC);
+ QCBORError nReturn = QCBORDecode_Finish(&DC);
if(nReturn) {
return -3;
}
@@ -2877,7 +2877,7 @@
int32_t IndefiniteLengthArrayMapTest()
{
- int nResult;
+ QCBORError nResult;
// --- first test -----
UsefulBufC IndefLen = UsefulBuf_FROM_BYTE_ARRAY_LITERAL(spIndefiniteArray);
@@ -3345,18 +3345,18 @@
QCBORItem Item1, Item2, Item3, Item4;
if((nCBORError = QCBORDecode_GetNext(&DC, &Item1)))
- return nCBORError;
+ return (int32_t)nCBORError;
if(Item1.uDataType != QCBOR_TYPE_MAP ||
Item1.val.uCount != 3)
return -3;
if((nCBORError = QCBORDecode_GetNext(&DC, &Item1)))
- return nCBORError;
+ return (int32_t)nCBORError;
if((nCBORError = QCBORDecode_GetNext(&DC, &Item2)))
- return nCBORError;
+ return (int32_t)nCBORError;
if((nCBORError = QCBORDecode_GetNext(&DC, &Item3)))
- return nCBORError;
+ return (int32_t)nCBORError;
if((nCBORError = QCBORDecode_GetNext(&DC, &Item4)))
- return nCBORError;
+ return (int32_t)nCBORError;
UsefulBuf_Set(CopyOfStorage, '_');