1. Adding C_ULONGLONG

I've come across several C functions that return uint64_t, so it seems we need to add C_ULONGLONG. We have C_LONGLONG declared for signed int64_t types, but not unsigned.

If these changes look good, I can commit them to the default branch. I don't commit code very often (if ever) so I wanted to double-check before proceeding.

http://openeuphoria.org/pastey/265.wc

-Greg

new topic     » topic index » view message » categorize

2. Re: Adding C_ULONGLONG

ghaberek said...

I've come across several C functions that return uint64_t, so it seems we need to add C_ULONGLONG. We have C_LONGLONG declared for signed int64_t types, but not unsigned.

If these changes look good, I can commit them to the default branch. I don't commit code very often (if ever) so I wanted to double-check before proceeding.

http://openeuphoria.org/pastey/265.wc

It looks reasonable to me. Please add a test for this, preferably in t_callc.e.

Matt

new topic     » goto parent     » topic index » view message » categorize

3. Re: Adding C_ULONGLONG

mattlewis said...

It looks reasonable to me. Please add a test for this, preferably in t_callc.e.

Matt

I had to adjust the checks for valid param and return types in be_machine.c as well.

Tests added and passed correctly. Pushed changes back up. smile

-Greg

new topic     » goto parent     » topic index » view message » categorize

4. Re: Adding C_ULONGLONG

just a quick query.

is line 1518 of be_callc.c correct? I think it might supposed to be

if( uint64_t_result <= (unsigned long long int)MAXINT   uint64_t_result >= (unsigned long long int)0 ){

instead of

if( uint64_t_result <= (unsigned long long int)MAXINT   int64_t_result >= (unsigned long long int)0 ){

new topic     » goto parent     » topic index » view message » categorize

5. Re: Adding C_ULONGLONG

rkdavis said...

just a quick query.

is line 1518 of be_callc.c correct? I think it might supposed to be

if( uint64_t_result <= (unsigned long long int)MAXINT && uint64_t_result >= (unsigned long long int)0 ){

instead of

if( uint64_t_result <= (unsigned long long int)MAXINT && int64_t_result >= (unsigned long long int)0 ){

Good catch. What's interesting is that int64_t_result isn't even be defined within that if block, so the compiler should have caught that and failed to the build. ("A good workman never blames his tools.") I will get it fixed right quick.

-Greg

new topic     » goto parent     » topic index » view message » categorize

6. Re: Adding C_ULONGLONG

It was my compiler (gcc (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2 ) that caught it :)

new topic     » goto parent     » topic index » view message » categorize

7. Re: Adding C_ULONGLONG

rkdavis said...

It was my compiler (gcc (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2) that caught it :)

Interesting. I was dusting off my Raspberry Pi to do some test builds myself.

I just pushed a few more changes...

  • we don't need to check for >= 0 because the value is unsigned
  • I caused a test to fail by not casting to uint64_t before returning a NewDouble.

-Greg

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu