Home
last modified time | relevance | path

Searched full:0 (Results 1 – 25 of 33) sorted by relevance

12

/tinycbor-2.7.6/tests/parser/
Dtst_parser.cpp163 CborError err = cbor_parser_init((const quint8 *)"", 0, 0, &parser, &first); in initParserEmpty()
180 …parser_init(reinterpret_cast<const quint8 *>(data.constData()), data.length(), 0, &parser, &first); in compareOne_real()
185 if (n >= 0) { in compareOne_real()
195 if (n >= 0) { in compareOne_real()
237 QTest::newRow("0") << raw("\x00") << "0"; in addFixedData()
245 QTest::newRow("UINT16_MAX+1") << raw("\x1a\0\1\x00\x00") << "65536"; in addFixedData()
247 QTest::newRow("UINT32_MAX+1") << raw("\x1b\0\0\0\1\0\0\0\0") << "4294967296"; in addFixedData()
259 QTest::newRow("-UINT16_MAX-1") << raw("\x3a\0\1\x00\x00") << "-65537"; in addFixedData()
261 QTest::newRow("-UINT32_MAX-1") << raw("\x3b\0\0\0\1\0\0\0\0") << "-4294967297"; in addFixedData()
266 QTest::newRow("INT64_MIN-1") << raw("\x3b\x80\0\0\0""\0\0\0\0") << "-9223372036854775809"; in addFixedData()
[all …]
/tinycbor-2.7.6/tests/tojson/
Dtst_tojson.cpp93 QTest::newRow("0") << raw("\x00") << "0"; in addFixedData()
95 QTest::newRow("2^53-1") << raw("\x1b\0\x1f\xff\xff""\xff\xff\xff\xff") << "9007199254740991"; in addFixedData()
101 QTest::newRow("-2^53+1") << raw("\x3b\0\x1f\xff\xff""\xff\xff\xff\xfe") << "-9007199254740991"; in addFixedData()
108 QTest::newRow("0.f16") << raw("\xf9\0\0") << "0"; in addFixedData()
109 QTest::newRow("0.f") << raw("\xfa\0\0\0\0") << "0"; in addFixedData()
110 QTest::newRow("0.") << raw("\xfb\0\0\0\0\0\0\0\0") << "0"; in addFixedData()
112 QTest::newRow("-1.f") << raw("\xfa\xbf\x80\0\0") << "-1"; in addFixedData()
113 QTest::newRow("-1.") << raw("\xfb\xbf\xf0\0\0\0\0\0\0") << "-1"; in addFixedData()
115 QTest::newRow("16777215.") << raw("\xfb\x41\x6f\xff\xff\xe0\0\0\0") << "16777215"; in addFixedData()
117 QTest::newRow("-16777215.") << raw("\xfb\xc1\x6f\xff\xff\xe0\0\0\0") << "-16777215"; in addFixedData()
[all …]
/tinycbor-2.7.6/tests/encoder/
Dtst_encoder.cpp28 #if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
75 uint32_t v = 0x7fc00000; in myNaNf()
84 uint32_t v = 0x7f800000; in myInff()
93 uint32_t v = 0xff800000; in myNInff()
102 uint64_t v = UINT64_C(0x7ff8000000000000); in myNaN()
111 uint64_t v = UINT64_C(0x7ff0000000000000); in myInf()
120 uint64_t v = UINT64_C(0xfff0000000000000); in myNInf()
219 #if QT_VERSION < QT_VERSION_CHECK(5, 9, 0) in encodeVariant()
281 cbor_encoder_init(&encoder, bufptr, buffer.length(), 0); in compare()
285 QCOMPARE(cbor_encoder_get_extra_bytes_needed(&encoder), size_t(0)); in compare()
[all …]
/tinycbor-2.7.6/include/tinycbor/
Dutf8_p.h36 if (n == 0) in get_utf8()
37 return ~0U; in get_utf8()
40 if (uc < 0x80) { in get_utf8()
48 if (unlikely(uc <= 0xC1)) in get_utf8()
49 return ~0U; in get_utf8()
50 if (uc < 0xE0) { in get_utf8()
53 min_uc = 0x80; in get_utf8()
54 uc &= 0x1f; in get_utf8()
55 } else if (uc < 0xF0) { in get_utf8()
58 min_uc = 0x800; in get_utf8()
[all …]
Dcbor.h79 CborIntegerType = 0x00,
80 CborByteStringType = 0x40,
81 CborTextStringType = 0x60,
82 CborArrayType = 0x80,
83 CborMapType = 0xa0,
84 CborTagType = 0xc0,
85 CborSimpleType = 0xe0,
86 CborBooleanType = 0xf5,
87 CborNullType = 0xf6,
88 CborUndefinedType = 0xf7,
[all …]
Dmath_support_p.h41 int exp = (half >> 10) & 0x1f; in decode_half()
42 int mant = half & 0x3ff; in decode_half()
44 if (exp == 0) val = ldexp(mant, -24); in decode_half()
46 else val = mant == 0 ? INFINITY : NAN; in decode_half()
47 return half & 0x8000 ? -val : val; in decode_half()
Dcborjson.h39 CborConvertIgnoreTags = 0,
41 CborConvertObeyByteStringTags = 0,
44 CborConvertRequireMapStringKeys = 0,
47 CborConvertDefaultFlags = 0
Dcompilersupport_p.h90 # define __has_builtin(x) 0
148 # define ntohll(x) ((ntohl((uint32_t)(x)) * UINT64_C(0x100000000)) + (ntohl((x) >> 32)))
169 # define unlikely(x) __builtin_expect(!!(x), 0)
175 # define unreachable() __assume(0)
179 # define unreachable() do {} while (0)
202 int exp = (v >> 52) & 0x7ff; in encode_half()
222 return 0; in encode_half()
Dtinycbor-version.h1 #define TINYCBOR_VERSION_MAJOR 0
3 #define TINYCBOR_VERSION_PATCH 0
Dcborconstants_p.h33 UnsignedIntegerType = 0U,
70 MajorTypeMask = ~0U << MajorTypeShift,
/tinycbor-2.7.6/src/
Dcborpretty.c120 if (r < 0) in hexDump()
123 return 0; /* should be n * 2, but we don't have the original n anymore */ in hexDump()
133 if (uc < 0x80) { in utf8EscapedDump()
135 if (uc < 0x7f && uc >= 0x20 && uc != '\\' && uc != '"') { in utf8EscapedDump()
136 if (fprintf(out, "%c", (char)uc) < 0) in utf8EscapedDump()
165 if (fprintf(out, "\\%c", escaped) < 0) in utf8EscapedDump()
173 if (unlikely(uc <= 0xC1)) in utf8EscapedDump()
175 if (uc < 0xE0) { in utf8EscapedDump()
178 min_uc = 0x80; in utf8EscapedDump()
179 uc &= 0x1f; in utf8EscapedDump()
[all …]
Dcbortojson.c157 … TypeWasNotNative = 0x100, /* anything but strings, boolean, null, arrays and maps */
158 TypeWasTagged = 0x200,
159 NumberPrecisionWasLost = 0x400,
160 NumberWasNaN = 0x800,
161 NumberWasInfinite = 0x1000,
162 … NumberWasNegative = 0x2000, /* always used with NumberWasInifite or NumberWasTooBig */
164 FinalTypeMask = 0xff
179 size_t n = 0; in dump_bytestring_base16()
194 for (i = 0; i < n; ++i) { in dump_bytestring_base16()
197 buffer[2*i + 1] = characters[byte & 0xf]; in dump_bytestring_base16()
[all …]
Dcborvalidation.c131 <td>0</td>
245 { 0, (uint8_t)CborTextStringType },
266 { 55799, 0U }
277 if (uc == ~0U) in validate_utf8_string()
300 if ((flags & CborValidateShortestIntegrals) == 0) in validate_number()
311 size_t bytesNeeded = 0; in validate_number()
314 if (value > 0xffU) in validate_number()
316 if (value > 0xffffU) in validate_number()
318 if (value > 0xffffffffU) in validate_number()
328 const size_t knownTagCount = sizeof(knownTagData) / sizeof(knownTagData[0]); in validate_tag()
[all …]
Dcborencoder.c68 * cbor_encoder_init(&encoder, &buf, sizeof(buf), 0);
79 * cbor_encoder_init(&encoder, &buf, sizeof(buf), 0);
118 * cbor_encoder_init(&encoder, &buf, sizeof(buf), 0);
158 * cbor_encoder_init(&encoder, &buf, size, 0);
162 * for (i = 0; i < n; ++i) {
206 encoder->added = 0; in cbor_encoder_init()
268 uint8_t more = 0; in encode_number_no_update()
269 if (ui > 0xffU) in encode_number_no_update()
271 if (ui > 0xffffU) in encode_number_no_update()
273 if (ui > 0xffffffffU) in encode_number_no_update()
[all …]
Dopen_memstream.c88 (*b->ptr)[*b->len] = '\0'; in close_buffer()
90 return 0; in close_buffer()
98 b->alloc = 0; in open_memstream()
102 *lenptr = 0; in open_memstream()
Dcbor_buf_writer.c29 return (remaining < 0); in would_overflow()
52 cb->enc.bytes_written = 0; in cbor_buf_writer_init()
Dcborparser.c69 * cbor_parser_init(buffer, len, 0, &buffer, &value);
78 * returns 0 on parsing failure:
86 * if (cbor_parser_init(buffer, len, 0, &buffer, &value) != CborNoError)
87 * return 0;
90 * return 0;
144 * \li extra: partially decoded integer value (0, 1 or 2 bytes)
156 *len = 0; in extract_length()
184 it->flags = 0; in preparse_value()
199 size_t bytesNeeded = descriptor < Value8Bit ? 0 : (1 << (descriptor - Value8Bit)); in preparse_value()
271 it->remaining = 0; in preparse_next_value()
[all …]
Dparsetags.pl70 if (scalar @types == 0);
101 my $shift = 0;
111 $typemask = "0U" if $typemask eq "";
Dcbor_mbuf_reader.c69 return os_mbuf_cmpf(cb->m, offset + cb->init_off, buf, len) == 0; in cbor_mbuf_reader_cmp()
80 if (rc == 0) { in cbor_mbuf_reader_cpy()
/tinycbor-2.7.6/tools/json2cbor/
Djson2cbor.c66 if (reverse_alphabet[in[0]] < 0 || reverse_alphabet[in[1]] < 0) { in decode_base64_generic()
67 if (in[0] == '\0') in decode_base64_generic()
72 uint32_t val = reverse_alphabet[in[0]] << 18; in decode_base64_generic()
74 if (in[2] == '=' || in[2] == '\0') { in decode_base64_generic()
75 if (in[2] == '=' && (in[3] != '=' || in[4] != '\0')) in decode_base64_generic()
79 } else if (in[3] == '=' || in[3] == '\0') { in decode_base64_generic()
80 if (in[3] == '=' && in[4] != '\0') in decode_base64_generic()
111 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, in decode_base64()
134 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, in decode_base64url()
158 for (i = 0; i < *len; ++i) { in decode_base16()
[all …]
/tinycbor-2.7.6/
Dmaketag.pl4 open PROC, "-|", @_ or die("Cannot run $_[0]: $!");
16 my $v = $v[0];
29 open TEMPLATE, "<", $result[0];
51 @result = ($result[0], $tagfile);
73 print VERSION "#define TINYCBOR_VERSION_MAJOR ", $v[0], "\n";
80 s/^version:.*/version: $v[0].$v[1].$v[2]-build-{build}/;
D.appveyor.yml12 …(call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64) & (set tests=0)
32 if /i "%tests%"=="0" echo Tests skipped.
DMakefile56 INSTALL_TARGETS += $(libdir)/libtinycbor.so.0
125 $(if $(subst 0,,$(BUILD_STATIC)),lib/libtinycbor.a) \
126 $(if $(subst 0,,$(BUILD_SHARED)),lib/libtinycbor.so) \
143 $(CC) -shared -Wl,-soname,libtinycbor.so.0 -o lib/libtinycbor.so.$(VERSION) $(LDFLAGS) $^
144 …ln -sf libtinycbor.so.$(VERSION) libtinycbor.so ; ln -sf libtinycbor.so.$(VERSION) libtinycbor.so.0
/tinycbor-2.7.6/examples/
Dsimplereader.c158 return 0; in main()
170 CborError err = cbor_parser_init(buf, length, 0, &parser, &it); in main()
172 err = dumprecursive(&it, 0); in main()
180 return 0; in main()
/tinycbor-2.7.6/tools/cbordump/
Dcbordump.c54 static size_t bufsize = 0; in dumpFile()
57 size_t buflen = 0; in dumpFile()
64 if (n == 0) { in dumpFile()
74 CborError err = cbor_parser_init(buffer, buflen, 0, &parser, &value); in dumpFile()

12