libffcall
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Correctly print shorts in the tests


From: Josh Elsasser
Subject: Correctly print shorts in the tests
Date: Wed, 20 Nov 2019 20:53:05 -0800
User-agent: Mutt/1.5.22 (2013-10-16)

Print shorts in the tests correctly, using %hu rather than %u

On at least OpenBSD/octeon (ie: mips64), using the int formatting code
to print a short causes the tests to fail.

diff --git avcall/tests.c avcall/tests.c
index 427a9e9..4d790ea 100644
--- avcall/tests.c
+++ avcall/tests.c
@@ -519,7 +519,7 @@ void
   fflush(out);
 
   usr = us_cdcd(c1,d2,c3,d4);
-  fprintf(out,"->%u\n",usr);
+  fprintf(out,"->%hu\n",usr);
   fflush(out);
   usr = 0; clear_traces();
   av_start_ushort(a,us_cdcd,&usr);
@@ -528,7 +528,7 @@ void
   av_char(a,c3);
   av_double(a,d4);
   av_call(a);
-  fprintf(out,"->%u\n",usr);
+  fprintf(out,"->%hu\n",usr);
   fflush(out);
 
   /* Long long types.
diff --git callback/tests.c callback/tests.c
index 4972c5b..bd215f0 100644
--- callback/tests.c
+++ callback/tests.c
@@ -1743,12 +1743,12 @@ int main (void)
     fflush(out);
 
     usr = us_cdcd(c1,d2,c3,d4);
-    fprintf(out,"->%u\n",usr);
+    fprintf(out,"->%hu\n",usr);
     fflush(out);
     usr = 0; clear_traces();
     callback = alloc_callback(&us_cdcd_simulator,(void*)&us_cdcd);
     usr = ((ushort (*) (char,double,char,double)) callback) (c1,d2,c3,d4);
-    fprintf(out,"->%u\n",usr);
+    fprintf(out,"->%hu\n",usr);
     fflush(out);
 
     llr = ll_iiilli(i1,i2,i3,ll1,i13);
diff --git vacall/tests.c vacall/tests.c
index 2401a95..03d8068 100644
--- vacall/tests.c
+++ vacall/tests.c
@@ -1639,11 +1639,11 @@ int main (void)
     fflush(out);
 
     usr = us_cdcd(c1,d2,c3,d4);
-    fprintf(out,"->%u\n",usr);
+    fprintf(out,"->%hu\n",usr);
     fflush(out);
     usr = 0; clear_traces();
     current_function = (void*) &us_cdcd; usr = ((ushort (*) 
(char,double,char,double)) vacall) (c1,d2,c3,d4);
-    fprintf(out,"->%u\n",usr);
+    fprintf(out,"->%hu\n",usr);
     fflush(out);
 
     llr = ll_iiilli(i1,i2,i3,ll1,i13);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]