[postgis-users] postgis_inout.c with pgres < 73

strk strk at freek.keybit.net
Sat Aug 16 03:05:52 PDT 2003


PG_NARGS is not defined in fmgr.h < 7.3
It is used with no check in postgis_inout.c  (multiple times)

All checks can be substituted with the macro
PG_ARGISNULL() available also on the older pgres versions.

patch follows

--strk;

--- postgis_inout.c.000 Sat Aug 16 11:51:23 2003
+++ postgis_inout.c     Sat Aug 16 12:01:41 2003
@@ -1433,5 +1433,5 @@
        GEOMETRY        *result;

-       if (PG_NARGS() >1)
+       if ( ! PG_ARGISNULL(1) )
                SRID = PG_GETARG_INT32(1);
        else
@@ -3781,5 +3781,5 @@
                GEOMETRY *result;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else
@@ -3807,5 +3807,5 @@
                GEOMETRY *geom;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else
@@ -3830,5 +3830,5 @@
                GEOMETRY *geom;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else
@@ -3853,5 +3853,5 @@
                GEOMETRY *geom;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else
@@ -3876,5 +3876,5 @@
                GEOMETRY *geom;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else
@@ -3899,5 +3899,5 @@
                GEOMETRY *geom;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else
@@ -3922,5 +3922,5 @@
                GEOMETRY *geom;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else
@@ -3945,5 +3945,5 @@
                GEOMETRY *geom;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else
@@ -4537,5 +4537,5 @@
                GEOMETRY *geom;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else
@@ -4560,5 +4560,5 @@
                GEOMETRY *geom;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else
@@ -4584,5 +4584,5 @@
                GEOMETRY *geom;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else
@@ -4607,5 +4607,5 @@
                GEOMETRY *geom;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else
@@ -4630,5 +4630,5 @@
                GEOMETRY *geom;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else
@@ -4653,5 +4653,5 @@
                GEOMETRY *geom;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else
@@ -4676,5 +4676,5 @@
                GEOMETRY *geom;

-               if (PG_NARGS() >1)
+               if ( ! PG_ARGISNULL(1) )
                        SRID = PG_GETARG_INT32(1);
                else





More information about the postgis-users mailing list