Giter Site home page Giter Site logo

Comments (6)

andig avatar andig commented on June 27, 2024

Should be a uint8 or simply uint?

from libsml.

devZer0 avatar devZer0 commented on June 27, 2024

i'm not good at c-programming, but isn't that struct simply meant so carry some flag to simply store some tiny bit of information if some workaround needs to be applied again or not?

don't know what correct datatype is correct for this, i would have chosen some "bool" but not some special type which generates some compiler warning.

so i think unsigned int would be ok here and makes the compile warning go away.

should i send a pull request ?

from libsml.

devZer0 avatar devZer0 commented on June 27, 2024

by reading this, i think you are correct and "unsigned int" is correct when using bit-field:

https://www.tutorialspoint.com/cprogramming/c_bit_fields.htm

so

struct workarounds {
        u8 dzg_meter:1;
};

should be


struct workarounds {
        unsigned int dzg_meter : 1;
};

from libsml.

devZer0 avatar devZer0 commented on June 27, 2024

this can be closed after merging the pull request

from libsml.

andig avatar andig commented on June 27, 2024

Bzw.: sollte das nicht lieber ein uint8_t sein (https://stackoverflow.com/questions/22842707/size-of-uint8-uint16-and-uint32#22843368) damit es wirklich 8-bittig bleibt? Oder ist uns das egal?

from libsml.

devZer0 avatar devZer0 commented on June 27, 2024

could you also close this one @andig ? (as i see that my fix proposal has been merged)

sorry, i did not see your question and i cannot answer, as my c-skills are not good enough

from libsml.

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.