Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable compatibility with Linux (and other) kernel #836

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Feb 14, 2024

  1. replace sprintf with snprintf

    Replace sprintf() usage with the safer snprintf().
    Since snprintf() was introduced only in C99, we have to upgrade the
    minimum C standard.
    
    Signed-off-by: Andrey Gelman <andrey.gelman@gmail.com>
    greenduck committed Feb 14, 2024
    Configuration menu
    Copy the full SHA
    455ba4f View commit details
    Browse the repository at this point in the history
  2. replace strtod() with the more robust sscanf()

    Introduce a rigorous FP value parsing function, that identifies
    precisely the number of bytes that can be skipped in the input.
    After this, we can afford to drop strtod() in favor of a more robust
    sscanf().
    
    Signed-off-by: Andrey Gelman <andrey.gelman@gmail.com>
    greenduck committed Feb 14, 2024
    Configuration menu
    Copy the full SHA
    6f595f2 View commit details
    Browse the repository at this point in the history
  3. enable building without Floating Point support

    Enable building without FP support (cmake -DNO_FLOATING_POINT=TRUE ...)
    This is required as a part of the effort to make cJSON available in the
    kernel mode.
    
    Notice,
    since the tests rely on FP availability, we had to disable tests in
    case of NO_FLOATING_POINT.
    
    TODO:
    Introduce new tests / adapt existing tests
    
    Signed-off-by: Andrey Gelman <andrey.gelman@gmail.com>
    greenduck committed Feb 14, 2024
    Configuration menu
    Copy the full SHA
    571f0cc View commit details
    Browse the repository at this point in the history
  4. adapt to building within a Linux kernel driver

    Adapt cJSON library to serving as a part of a Linux kernel
    driver:
    - copy cJSON.[ch] to the driver source code tree
    - integrate in the build process
    
    Signed-off-by: Andrey Gelman <andrey.gelman@gmail.com>
    greenduck committed Feb 14, 2024
    Configuration menu
    Copy the full SHA
    fa695a3 View commit details
    Browse the repository at this point in the history