Mercurial > pub > dyncall > dyncall
diff test/sign/sign.c @ 465:e2899b4ff713
- // -> /* */, mainly for consistency (but also for a few obscure compilers)
author | Tassilo Philipp |
---|---|
date | Wed, 02 Feb 2022 12:55:23 +0100 |
parents | 7608e34098b0 |
children |
line wrap: on
line diff
--- a/test/sign/sign.c Wed Feb 02 11:03:06 2022 +0100 +++ b/test/sign/sign.c Wed Feb 02 12:55:23 2022 +0100 @@ -26,20 +26,19 @@ #include "dyncall.h" -// This program demonstrates the need for 'unsigned' integers and the -// ability to implement zero/sign extensions for small integers. -// This test program indicates failure on powerpc 32-bit with -// compiler optimizations enabled (e.g. '-O2' compilation flags). -// -// A fix to be incorporated in the API is also given. -// +/* This program demonstrates the need for 'unsigned' integers and the */ +/* ability to implement zero/sign extensions for small integers. */ +/* This test program indicates failure on powerpc 32-bit with */ +/* compiler optimizations enabled (e.g. '-O2' compilation flags). */ +/* */ +/* A fix to be incorporated in the API is also given. */ int add1s(unsigned short x) { return x + 1; } -// API BUGFIX: +/* API BUGFIX: */ #define dcArgUShort(vm,x) dcArgInt(vm,(int)(unsigned int)(x)) -// OLD TEST: int add1(unsigned char x) { return x + 1; } +/* OLD TEST: int add1(unsigned char x) { return x + 1; } */ int main(int argc, char* argv[]) { @@ -55,9 +54,8 @@ printf("result: sign: %d\n", total); if (!total) { - // - // TEST BUGFIX: use instead.. - // + + /* TEST BUGFIX: use instead.. */ dcReset(vm); dcArgUShort( vm, 0xFFFF ); result = dcCallInt( vm, &add1s ); @@ -65,14 +63,15 @@ printf("result: sign (bugfix): %d\n", total); } - // result = dcCallInt( vm, &add1s ); - // total = (result == 0x10000); + /*result = dcCallInt( vm, &add1s ); + total = (result == 0x10000);*/ - // OLD TEST: updated to using 'short' - // dcArgChar( vm, (char) 255 ); - // result = dcCallInt( vm, &add1 ); - // total = (result == 256); + /*OLD TEST: updated to using 'short' + dcArgChar( vm, (char) 255 ); + result = dcCallInt( vm, &add1 ); + total = (result == 256);*/ - // printf("result: sign: %d\n", total); + /*printf("result: sign: %d\n", total); */ return 0; } +