This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 3/3] testsuite: libffi.call/return_uc.c: Fixed casting


Fixed the casting of the return value from the call. Instead
of casting the uchar up, cast the ffi_arg down to uchar. This
avoids any inconsistencies with the value of the ffi_arg.

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
---
 testsuite/libffi.call/return_uc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/testsuite/libffi.call/return_uc.c b/testsuite/libffi.call/return_uc.c
index 07c45de..6fe5546 100644
--- a/testsuite/libffi.call/return_uc.c
+++ b/testsuite/libffi.call/return_uc.c
@@ -32,7 +32,7 @@ int main (void)
        uc < (unsigned char) '\xff'; uc++)
     {
       ffi_call(&cif, FFI_FN(return_uc), &rint, values);
-      CHECK(rint == (signed int) uc);
+      CHECK((unsigned char)rint == uc);
     }
   exit(0);
 }
-- 
1.7.5.4



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]