Comments (6)
Maybe something went wrong with the compilation, you could try #8
from libcbor.
I have also seen the "First" issue described above for input: 100000.0
Expected: 0xFA47C35000 (per RFC 7049)
Observed: 0xFA0050C347
from libcbor.
@ekroon it's indeed possible this is related to #8.
I am currently running on the Mac XCode iOS simulator.
Highlighted line seems to be not working as expected:
size_t _cbor_encode_uint32(uint32_t value, unsigned char *buffer, size_t buffer_size, uint8_t offset)
{
if (buffer_size >= 5) {
buffer[0] = 0x1A + offset;
#ifdef HAVE_ENDIAN_H
*(uint32_t *) &buffer[1] = htobe32(value);
#else
#ifdef IS_BIG_ENDIAN
====> *(uint32_t *) &buffer[1] = value;
#else
buffer[1] = value >> 24;
buffer[2] = value >> 16;
buffer[3] = value >> 8;
buffer[4] = value;
#endif
#endif
return 5;
} else
return 0;
}
from libcbor.
Yes, I'm on 0.3.1 and IS_BIG_ENDIAN is incorrectly true for the XCode Simulator.
#8 would take care of this if it were incorporated, and if you use CMake to generate your xcodeproj.
from libcbor.
Issue is likely all #ifdef IS_BIG_ENDIAN should be changed to #if IS_BIG_ENDIAN.
from libcbor.
I believe this has been fixed by @dgrigsby through #10
from libcbor.
Related Issues (20)
- Pedantic build failing 0.8.0 HOT 2
- Design and implement support for registered tags
- Old style declaration warning fix
- libcbor needs libm HOT 2
- Need some details for the serialization methodology HOT 10
- Hi @mghicho, not really, but the current encoders can be used to encode e.g. an array or a map in a streaming manner by calling e.g. `cbor_encode_indef_array_start` and then encoding individual items and terminating, flushing buffers as needed. What would the API you have in mind look like?
- precision with embedded type in cbor_encode_indef_array_start HOT 1
- AArch32 compatiblity issues HOT 5
- Improve Bazel support HOT 2
- BUG: CBOR Key/Value Arrays are interpreted correctly but do not deallocate correctly. HOT 7
- Improve documentation on memory management
- Travis CI broken
- half-precision float NaN loss of information (nitpicky) HOT 1
- Migrate Windows CI to Circle HOT 2
- Make cbor_encode_half respect NaN data bits
- Improve streaming parser documentation, especially for error state handling
- Improve test coverage of cbor_bytestring_add_chunk failure scenarios
- Add [[nodiscard]] attribute
- Broken encoding of empty byte strings in 0.10.0 HOT 1
- FR: Vectorization HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libcbor.