ooc-lang / rock

:ocean: self-hosted ooc compiler that generates c99
http://ooc-lang.org/
MIT License
403 stars 40 forks source link

Improved limit externs in Numbers.ooc. #927

Closed davidhesselbom closed 8 years ago

davidhesselbom commented 8 years ago

I tried to clean this up a little bit, and I also added limits for Short and UShort. I'm guessing you want to redo this your own way, though (formatting etc).

FLT_MIN and DBL_MIN were defined twice for some reason, so I removed the ones that seemed to be in the wrong place.

fasterthanlime commented 8 years ago

Hmm. There's no tests using all of them afaict, how would if they're broken/non-existant ?

davidhesselbom commented 8 years ago

Good question. I guess I add tests in another commit and update the pull request?

fasterthanlime commented 8 years ago

That'd be great, thanks

davidhesselbom commented 8 years ago

How would you like me to test it, though? Compare the extern values to literals containing the expected values?

fasterthanlime commented 8 years ago

I wouldn't compare them, I would just use them, let rock output C files containing those symbols, let a C compiler compile them.

Just referring to them will make the test fail if they're missing/misspelled

davidhesselbom commented 8 years ago

Okay, so you're only worried that they won't exist, not about their actual values?

fasterthanlime commented 8 years ago

Yup. I'm confident that if they exist, they'll have the right values.

davidhesselbom commented 8 years ago

Updated. Would that test do it?

Btw, INFINITY and NAN are still defined as extern Doubles. Not sure what that will mean for an LDouble, but it was already like that, so...

fasterthanlime commented 8 years ago

@davidhesselbom that works, thanks!