Giter Club home page Giter Club logo

Comments (6)

ekroon avatar ekroon commented on June 9, 2024

Maybe something went wrong with the compilation, you could try #8

from libcbor.

dgrigsby avatar dgrigsby commented on June 9, 2024

I have also seen the "First" issue described above for input: 100000.0
Expected: 0xFA47C35000 (per RFC 7049)
Observed: 0xFA0050C347

from libcbor.

dgrigsby avatar dgrigsby commented on June 9, 2024

@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.

dgrigsby avatar dgrigsby commented on June 9, 2024

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.

dgrigsby avatar dgrigsby commented on June 9, 2024

Issue is likely all #ifdef IS_BIG_ENDIAN should be changed to #if IS_BIG_ENDIAN.

from libcbor.

PJK avatar PJK commented on June 9, 2024

I believe this has been fixed by @dgrigsby through #10

from libcbor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.