replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / extlibs / tinycbor / tinycbor / src / cborencoder.c
index ef1bc0b..1f69647 100644 (file)
 
 #define _BSD_SOURCE 1
 #define _DEFAULT_SOURCE 1
+#ifndef __STDC_LIMIT_MACROS
+#  define __STDC_LIMIT_MACROS 1
+#endif
+
 #include "cbor.h"
 #include "cborconstants_p.h"
 #include "compilersupport_p.h"
@@ -286,7 +290,7 @@ static inline CborError encode_number_no_update(CborEncoder *encoder, uint64_t u
     if (ui < Value8Bit) {
         *bufstart += shiftedMajorType;
     } else {
-        unsigned more = 0;
+        uint8_t more = 0;
         if (ui > 0xffU)
             ++more;
         if (ui > 0xffffU)
@@ -462,10 +466,7 @@ static CborError create_container(CborEncoder *encoder, CborEncoder *container,
     } else {
         err = encode_number_no_update(container, length, shiftedMajorType);
     }
-    if (err && !isOomError(err))
-        return err;
-
-    return CborNoError;
+    return err;
 }
 
 /**