Open jockm opened 4 months ago
@jockm Interesting thought. I don't think it should be too bad to just go through the codebase and replace places where I hardcoded 4 with sizeof/alignof. Thanks for bringing this up.
@jockm Working on this now :) Will have a PR up soon and would appreciate if you could review it to see if it resolves the problem for your use case.
I started to go down the path of defining
tiny_int_t
andtiny_float_t
so someone embedding Tiny could change these if need be -- for example I need to ensure 64 bit ints in the environment I wanted to embed Tiny in. It would be very easy to imagine a case where someone wants double precision floating point in their app.Unfortunately it wasn't quite as simple as replacing all the uses of
int
andfloat
withtiny_int_t
andtiny_float_t
because I saw instances of the code assuming ints were 4 bytes long and just using the constant4
instead ofsizeof(...)
. And decided to stop my effort.I think this is a good idea and should be done.