r-lyeh / tinybits

Tiny bits and useful snippets that I keep using everywhere (C, C++)
The Unlicense
314 stars 23 forks source link

Error tinybit Feedback #2

Closed RandyGaul closed 5 years ago

RandyGaul commented 5 years ago

https://github.com/r-lyeh/tinybits/blob/master/tinyerror.c

Took me like 10 minutes to figure out how this snippet works. I decided I like it, but it was very confusing! Mostly because there's a macro named error and also a thread local named error. Also the macros err0r and err1r are pretty confusing names as well.

Is it possible to tidy those up a little? Just posting this up since I liked your snippet and will probably refer to it later :)

r-lyeh commented 5 years ago

Hey randy lol sorry for being terse. i've updated the snippet to improve readability imo. let me know what you think. thanks for reviewing!

RandyGaul commented 5 years ago

Looks good! Much easier to read. Thanks r-lyeh :)