Commits

Ronald Oussoren  committed 369b6d0

Tweak libff-src until it compiles without warnings

  • Participants
  • Parent commits bcd3800
  • Branches pyobjc-ancient

Comments (0)

Files changed (3)

File libffi-src/include/ffi.h

 } ffi_raw;
 
 void ffi_raw_call (/*@dependent@*/ ffi_cif *cif, 
-		   void (*fn)(), 
+		   void (*fn)(void), 
 		   /*@out@*/ void *rvalue, 
 		   /*@dependent@*/ ffi_raw *avalue);
 
 /* longs and doubles are followed by an empty 64-bit word.		*/
 
 void ffi_java_raw_call (/*@dependent@*/ ffi_cif *cif, 
-		        void (*fn)(), 
+		        void (*fn)(void), 
 		        /*@out@*/ void *rvalue, 
 		        /*@dependent@*/ ffi_raw *avalue);
 
 			/*@dependent@*/ ffi_type **atypes);
 
 void ffi_call(/*@dependent@*/ ffi_cif *cif, 
-	      void (*fn)(), 
+	      void (*fn)(void), 
 	      /*@out@*/ void *rvalue, 
 	      /*@dependent@*/ void **avalue);
 
 /* Useful for eliminating compiler warnings */
-#define FFI_FN(f) ((void (*)())f)
+#define FFI_FN(f) ((void (*)(void))f)
 
 /* ---- Definitions shared with assembly code ---------------------------- */
 

File libffi-src/src/powerpc/ffi_darwin.c

    */
 
 /*@-exportheader@*/
+/* Called from assemblycode, add prototype to avoid warning */
+void ffi_prep_args(extended_cif *ecif, unsigned *const stack);
+
 void ffi_prep_args(extended_cif *ecif, unsigned *const stack)
 /*@=exportheader@*/
 {
-  const unsigned bytes = ecif->cif->bytes;
+/*  const unsigned bytes = ecif->cif->bytes;*/
   const unsigned flags = ecif->cif->flags;
 
   /* 'stacktop' points at the previous backchain pointer.  */
 extern void ffi_call_AIX(/*@out@*/ extended_cif *,
 			 unsigned, unsigned,
 			 /*@out@*/ unsigned *,
-			 void (*fn)(),
-			 void (*fn2)());
+			 void (*fn)(void),
+			 void (*fn2)(void));
 extern void ffi_call_DARWIN(/*@out@*/ extended_cif *,
 			    unsigned, unsigned,
 			    /*@out@*/ unsigned *,
-			    void (*fn)(),
-			    void (*fn2)());
+			    void (*fn)(void),
+			    void (*fn2)(void));
 /*@=declundef@*/
 /*@=exportheader@*/
 
 void ffi_call(/*@dependent@*/ ffi_cif *cif,
-	      void (*fn)(),
+	      void (*fn)(void),
 	      /*@out@*/ void *rvalue,
 	      /*@dependent@*/ void **avalue)
 {
     case FFI_AIX:
       /*@-usedef@*/
       ffi_call_AIX(&ecif, -cif->bytes,
-		   cif->flags, ecif.rvalue, fn, ffi_prep_args);
+		   cif->flags, ecif.rvalue, fn, FFI_FN(ffi_prep_args));
       /*@=usedef@*/
       break;
     case FFI_DARWIN:
       /*@-usedef@*/
       ffi_call_DARWIN(&ecif, -cif->bytes,
-		      cif->flags, ecif.rvalue, fn, ffi_prep_args);
+		      cif->flags, ecif.rvalue, fn, FFI_FN(ffi_prep_args));
       /*@=usedef@*/
       break;
     default:
 	  if (arg_types[i]->elements[0]->type == 3)
 	    size_al = ALIGN(arg_types[i]->size, 8);
 	  if (size_al < 3 && cif->abi == FFI_DARWIN)
-	    avalue[i] = (void*) pgr + 4 - size_al;
+	    avalue[i] = (void*) ((char*)pgr + 4 - size_al);
 	  else
 	    avalue[i] = (void*) pgr;
 	  ng += (size_al + 3) / 4;

File libffi-src/src/x86/ffi_darwin.c

    has been allocated for the function's arguments */
 
 /*@-exportheader@*/
+void ffi_prep_args(char *stack, extended_cif *ecif);
+
 void ffi_prep_args(char *stack, extended_cif *ecif)
 /*@=exportheader@*/
 {
 			  /*@out@*/ extended_cif *, 
 			  unsigned, unsigned, 
 			  /*@out@*/ unsigned *, 
-			  void (*fn)());
+			  void (*fn)(void));
 /*@=declundef@*/
 /*@=exportheader@*/
 
 			  /*@out@*/ extended_cif *,
 			  unsigned, unsigned,
 			  /*@out@*/ unsigned *,
-			  void (*fn)());
+			  void (*fn)(void));
 /*@=declundef@*/
 /*@=exportheader@*/
 #endif /* X86_WIN32 */