Commit a7021591 authored by Tom Lane's avatar Tom Lane

Add casts to suppress warnings about m68k-specific kluge in fmgr.c.

parent 04b54876
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.106 2007/04/06 04:21:43 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.107 2007/07/13 02:25:48 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
* declare the function pointer to return int, so the compiler picks up the * declare the function pointer to return int, so the compiler picks up the
* return value from %d0. (Functions returning pointers put their value * return value from %d0. (Functions returning pointers put their value
* *additionally* into %d0 for compatibility.) The price is that there are * *additionally* into %d0 for compatibility.) The price is that there are
* some warnings about int->pointer conversions... * some warnings about int->pointer conversions ... which we can suppress
* with suitably ugly casts in fmgr_oldstyle().
*/ */
#if (defined(__mc68000__) || (defined(__m68k__))) && defined(__ELF__) #if (defined(__mc68000__) || (defined(__m68k__))) && defined(__ELF__)
typedef int32 (*func_ptr) (); typedef int32 (*func_ptr) ();
...@@ -626,7 +627,7 @@ fmgr_oldstyle(PG_FUNCTION_ARGS) ...@@ -626,7 +627,7 @@ fmgr_oldstyle(PG_FUNCTION_ARGS)
switch (n_arguments) switch (n_arguments)
{ {
case 0: case 0:
returnValue = (*user_fn) (); returnValue = (char *) (*user_fn) ();
break; break;
case 1: case 1:
...@@ -635,108 +636,173 @@ fmgr_oldstyle(PG_FUNCTION_ARGS) ...@@ -635,108 +636,173 @@ fmgr_oldstyle(PG_FUNCTION_ARGS)
* there are other functions still out there that also rely on * there are other functions still out there that also rely on
* this undocumented hack? * this undocumented hack?
*/ */
returnValue = (*user_fn) (fcinfo->arg[0], &fcinfo->isnull); returnValue = (char *) (*user_fn) (fcinfo->arg[0],
&fcinfo->isnull);
break; break;
case 2: case 2:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1]); returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[1]);
break; break;
case 3: case 3:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1], returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[1],
fcinfo->arg[2]); fcinfo->arg[2]);
break; break;
case 4: case 4:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1], returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[2], fcinfo->arg[3]); fcinfo->arg[1],
fcinfo->arg[2],
fcinfo->arg[3]);
break; break;
case 5: case 5:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1], returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[2], fcinfo->arg[3], fcinfo->arg[1],
fcinfo->arg[2],
fcinfo->arg[3],
fcinfo->arg[4]); fcinfo->arg[4]);
break; break;
case 6: case 6:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1], returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[2], fcinfo->arg[3], fcinfo->arg[1],
fcinfo->arg[4], fcinfo->arg[5]); fcinfo->arg[2],
fcinfo->arg[3],
fcinfo->arg[4],
fcinfo->arg[5]);
break; break;
case 7: case 7:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1], returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[2], fcinfo->arg[3], fcinfo->arg[1],
fcinfo->arg[4], fcinfo->arg[5], fcinfo->arg[2],
fcinfo->arg[3],
fcinfo->arg[4],
fcinfo->arg[5],
fcinfo->arg[6]); fcinfo->arg[6]);
break; break;
case 8: case 8:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1], returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[2], fcinfo->arg[3], fcinfo->arg[1],
fcinfo->arg[4], fcinfo->arg[5], fcinfo->arg[2],
fcinfo->arg[6], fcinfo->arg[7]); fcinfo->arg[3],
fcinfo->arg[4],
fcinfo->arg[5],
fcinfo->arg[6],
fcinfo->arg[7]);
break; break;
case 9: case 9:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1], returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[2], fcinfo->arg[3], fcinfo->arg[1],
fcinfo->arg[4], fcinfo->arg[5], fcinfo->arg[2],
fcinfo->arg[6], fcinfo->arg[7], fcinfo->arg[3],
fcinfo->arg[4],
fcinfo->arg[5],
fcinfo->arg[6],
fcinfo->arg[7],
fcinfo->arg[8]); fcinfo->arg[8]);
break; break;
case 10: case 10:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1], returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[2], fcinfo->arg[3], fcinfo->arg[1],
fcinfo->arg[4], fcinfo->arg[5], fcinfo->arg[2],
fcinfo->arg[6], fcinfo->arg[7], fcinfo->arg[3],
fcinfo->arg[8], fcinfo->arg[9]); fcinfo->arg[4],
fcinfo->arg[5],
fcinfo->arg[6],
fcinfo->arg[7],
fcinfo->arg[8],
fcinfo->arg[9]);
break; break;
case 11: case 11:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1], returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[2], fcinfo->arg[3], fcinfo->arg[1],
fcinfo->arg[4], fcinfo->arg[5], fcinfo->arg[2],
fcinfo->arg[6], fcinfo->arg[7], fcinfo->arg[3],
fcinfo->arg[8], fcinfo->arg[9], fcinfo->arg[4],
fcinfo->arg[5],
fcinfo->arg[6],
fcinfo->arg[7],
fcinfo->arg[8],
fcinfo->arg[9],
fcinfo->arg[10]); fcinfo->arg[10]);
break; break;
case 12: case 12:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1], returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[2], fcinfo->arg[3], fcinfo->arg[1],
fcinfo->arg[4], fcinfo->arg[5], fcinfo->arg[2],
fcinfo->arg[6], fcinfo->arg[7], fcinfo->arg[3],
fcinfo->arg[8], fcinfo->arg[9], fcinfo->arg[4],
fcinfo->arg[10], fcinfo->arg[11]); fcinfo->arg[5],
fcinfo->arg[6],
fcinfo->arg[7],
fcinfo->arg[8],
fcinfo->arg[9],
fcinfo->arg[10],
fcinfo->arg[11]);
break; break;
case 13: case 13:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1], returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[2], fcinfo->arg[3], fcinfo->arg[1],
fcinfo->arg[4], fcinfo->arg[5], fcinfo->arg[2],
fcinfo->arg[6], fcinfo->arg[7], fcinfo->arg[3],
fcinfo->arg[8], fcinfo->arg[9], fcinfo->arg[4],
fcinfo->arg[10], fcinfo->arg[11], fcinfo->arg[5],
fcinfo->arg[6],
fcinfo->arg[7],
fcinfo->arg[8],
fcinfo->arg[9],
fcinfo->arg[10],
fcinfo->arg[11],
fcinfo->arg[12]); fcinfo->arg[12]);
break; break;
case 14: case 14:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1], returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[2], fcinfo->arg[3], fcinfo->arg[1],
fcinfo->arg[4], fcinfo->arg[5], fcinfo->arg[2],
fcinfo->arg[6], fcinfo->arg[7], fcinfo->arg[3],
fcinfo->arg[8], fcinfo->arg[9], fcinfo->arg[4],
fcinfo->arg[10], fcinfo->arg[11], fcinfo->arg[5],
fcinfo->arg[12], fcinfo->arg[13]); fcinfo->arg[6],
fcinfo->arg[7],
fcinfo->arg[8],
fcinfo->arg[9],
fcinfo->arg[10],
fcinfo->arg[11],
fcinfo->arg[12],
fcinfo->arg[13]);
break; break;
case 15: case 15:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1], returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[2], fcinfo->arg[3], fcinfo->arg[1],
fcinfo->arg[4], fcinfo->arg[5], fcinfo->arg[2],
fcinfo->arg[6], fcinfo->arg[7], fcinfo->arg[3],
fcinfo->arg[8], fcinfo->arg[9], fcinfo->arg[4],
fcinfo->arg[10], fcinfo->arg[11], fcinfo->arg[5],
fcinfo->arg[12], fcinfo->arg[13], fcinfo->arg[6],
fcinfo->arg[7],
fcinfo->arg[8],
fcinfo->arg[9],
fcinfo->arg[10],
fcinfo->arg[11],
fcinfo->arg[12],
fcinfo->arg[13],
fcinfo->arg[14]); fcinfo->arg[14]);
break; break;
case 16: case 16:
returnValue = (*user_fn) (fcinfo->arg[0], fcinfo->arg[1], returnValue = (char *) (*user_fn) (fcinfo->arg[0],
fcinfo->arg[2], fcinfo->arg[3], fcinfo->arg[1],
fcinfo->arg[4], fcinfo->arg[5], fcinfo->arg[2],
fcinfo->arg[6], fcinfo->arg[7], fcinfo->arg[3],
fcinfo->arg[8], fcinfo->arg[9], fcinfo->arg[4],
fcinfo->arg[10], fcinfo->arg[11], fcinfo->arg[5],
fcinfo->arg[12], fcinfo->arg[13], fcinfo->arg[6],
fcinfo->arg[14], fcinfo->arg[15]); fcinfo->arg[7],
fcinfo->arg[8],
fcinfo->arg[9],
fcinfo->arg[10],
fcinfo->arg[11],
fcinfo->arg[12],
fcinfo->arg[13],
fcinfo->arg[14],
fcinfo->arg[15]);
break; break;
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment