Re: Trying to use gdb on OS X

new topic     » goto parent     » topic index » view thread      » older message » newer message

long long is in C99; isn't it reasonable to expect it to be present? We compile on gcc 99% of the time on all platforms so we can almost assume it. I don't mind changing it to int64_t, though, but if so then we may want to follow suit throughout the whole source.

Right now, I have edited some macros and comments in execute.h, and the D*_bits functions in be_runtime.c. Some of the changes to execute.h may be controversial since it's such an old file used in so many places, but I don't think I broke anything. Especially since I didn't #ifdef them.

As far as performance is concerned, I thought about that but I thought that wrapping more decisions around the casts would probably be worse in the long run than just performing the casts only when necessary. Most of them are performed by hardware anyway. It would probably have to be measured for sure. I doubt the cast to long long takes much longer than the cast to unsigned long, however. I didn't really add any new casting. Regardless, compiler optimizations should count for that too.

As for submitting my changes, I would like them reviewed and tested by others before actually committing them into the mainline 4.0 branch. I especially want to make sure they run on other platforms as I expect them to. Should I just commit to 4.0, or should I make a new tag or branch, or what? I'll post diffs to the forum if I need to.

Regardless, I'll make some new eubins for OS X which hopefully someone can test.

Changes made: execute.h

  • I changed the order of the #defines so they could reference each other.
  • I reordered the object representation comment into numeric order and added hex values.
  • I redefined INT_VAL and MAKE_INT to cast to long long, and then to long in order to preserve bits during conversion from double.
  • I redefined MAKE_UINT to work in terms of INT_VAL and MAXINT macros.

be_runtime.c

  • I added INT_VAL macro in place of manual casts in all D*_bits() functions.

Edit: Oh, I think that OpenWatcom 1.2 supports long long. http://www.openwatcom.org/index.php/C99_Compliance

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu