fixes for a couple of decode tests; add -Wparentheses to the makefile to catch these errors
diff --git a/Makefile b/Makefile
index 62d7c5c..fc37293 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-CFLAGS=-I inc -I test -Os -Wall -Werror -pedantic-errors -Wextra -Wshadow
+CFLAGS=-I inc -I test -Os -Wall -Werror -pedantic-errors -Wextra -Wshadow -Wparentheses
QCBOR_OBJ=src/UsefulBuf.o src/qcbor_encode.o src/qcbor_decode.o src/ieee754.o
QCBOR_OBJ2=$(QCBOR_OBJ) src/qcbor_decode_malloc.o
diff --git a/test/qcbor_decode_tests.c b/test/qcbor_decode_tests.c
index 558074f..999a9b7 100644
--- a/test/qcbor_decode_tests.c
+++ b/test/qcbor_decode_tests.c
@@ -524,7 +524,7 @@
goto Done;
// First integer
- if(QCBORDecode_GetNext(&DCtx, &Item) != 0 | Item.uDataType != QCBOR_TYPE_INT64)
+ if(QCBORDecode_GetNext(&DCtx, &Item) != 0 || Item.uDataType != QCBOR_TYPE_INT64)
goto Done;
*pInt1 = Item.val.int64;
@@ -2267,14 +2267,14 @@
}
QCBORDecode_GetNext(&DC, &Item);
- if(Item.uDataType != QCBOR_TYPE_INT64 |
+ if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.uNestingLevel != 2 ||
Item.uNextNestLevel != 2) {
return -4;
}
QCBORDecode_GetNext(&DC, &Item);
- if(Item.uDataType != QCBOR_TYPE_INT64 |
+ if(Item.uDataType != QCBOR_TYPE_INT64 ||
Item.uNestingLevel != 2 ||
Item.uNextNestLevel != 0) {
return -5;