Giter VIP home page Giter VIP logo

Comments (4)

FerCampos avatar FerCampos commented on July 27, 2024

Hi!
I am not the developer, but I am using utarray in one of my codes. I had one related problem because ssize_t wasn't defined in the includes. As fas as I understand, ssize_t is the signed version of size_t, allowing negative error codes/values.
I would give a try to size_t (in stddef.h), changing the definitions and castings in utarray.h from ssize_t to size_t.
But I am just a user of utarray.h...
Good luck!

from uthash.

FerCampos avatar FerCampos commented on July 27, 2024

I have rechecked the code and the only place where ssize_t is used is in a casting:
Line 217: ... (ssize_t)(a)->icd.sz) ...
and icd.sz is defined as size_t at line 48.
I would comment out the sys/types.h include and would change the ssize_t casting to a size_t one.

from uthash.

xuhdev avatar xuhdev commented on July 27, 2024

@FerCampos
Thanks for your suggestion. This is exactly what I've done. However, from a long-term view, the author may have some ideas why a signed size_t is used instead of a unsigned version. That's why I'm posting here.

from uthash.

troydhanson avatar troydhanson commented on July 27, 2024

I looked at the utarray and utstring code (since ssize_t was also used there) - and it looks like in both cases it really should be size_t. So I changed them to size_t and removed the sys/types.h include in 2eeb5f4. Please reopen if you have any questions. Thanks Hong Xu and Fernando!

from uthash.

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.