[postgis-tickets] r17410 - Always use int32_t for srid

Raul raul at rmr.ninja
Wed Apr 24 03:44:27 PDT 2019


Author: algunenano
Date: 2019-04-24 03:44:27 -0700 (Wed, 24 Apr 2019)
New Revision: 17410

Modified:
   trunk/liblwgeom/cunit/cu_algorithm.c
   trunk/liblwgeom/cunit/cu_libgeom.c
   trunk/liblwgeom/liblwgeom.h.in
   trunk/liblwgeom/liblwgeom_topo.h
   trunk/liblwgeom/liblwgeom_topo_internal.h
   trunk/liblwgeom/lwcircstring.c
   trunk/liblwgeom/lwcollection.c
   trunk/liblwgeom/lwcompound.c
   trunk/liblwgeom/lwcurvepoly.c
   trunk/liblwgeom/lwgeom.c
   trunk/liblwgeom/lwgeom_geos.c
   trunk/liblwgeom/lwgeom_sfcgal.c
   trunk/liblwgeom/lwgeom_sfcgal.h
   trunk/liblwgeom/lwin_wkb.c
   trunk/liblwgeom/lwin_wkt.c
   trunk/liblwgeom/lwin_wkt.h
   trunk/liblwgeom/lwline.c
   trunk/liblwgeom/lwmline.c
   trunk/liblwgeom/lwmpoint.c
   trunk/liblwgeom/lwmpoly.c
   trunk/liblwgeom/lwpoint.c
   trunk/liblwgeom/lwpoly.c
   trunk/liblwgeom/lwstroke.c
   trunk/liblwgeom/lwtriangle.c
   trunk/liblwgeom/lwutil.c
   trunk/liblwgeom/measures.c
   trunk/liblwgeom/measures.h
   trunk/liblwgeom/measures3d.c
   trunk/liblwgeom/measures3d.h
   trunk/libpgcommon/lwgeom_cache.h
   trunk/libpgcommon/lwgeom_transform.c
   trunk/libpgcommon/lwgeom_transform.h
   trunk/loader/shp2pgsql-core.c
   trunk/postgis/geography_centroid.c
   trunk/postgis/geography_inout.c
   trunk/postgis/gserialized_typmod.c
   trunk/postgis/lwgeom_btree.c
   trunk/postgis/lwgeom_export.c
   trunk/postgis/lwgeom_export.h
   trunk/postgis/lwgeom_functions_analytic.c
   trunk/postgis/lwgeom_functions_basic.c
   trunk/postgis/lwgeom_geos.c
   trunk/postgis/lwgeom_in_gml.c
   trunk/postgis/lwgeom_inout.c
   trunk/postgis/lwgeom_ogc.c
   trunk/postgis/lwgeom_sfcgal.c
   trunk/postgis/lwgeom_sfcgal.h
   trunk/postgis/lwgeom_transform.c
   trunk/raster/loader/raster2pgsql.h
   trunk/raster/rt_core/rt_geometry.c
   trunk/raster/rt_pg/rtpg_create.c
   trunk/raster/rt_pg/rtpg_gdal.c
   trunk/raster/rt_pg/rtpg_geometry.c
   trunk/raster/rt_pg/rtpg_internal.c
   trunk/raster/rt_pg/rtpg_internal.h
   trunk/raster/rt_pg/rtpg_mapalgebra.c
   trunk/raster/rt_pg/rtpg_pixel.c
   trunk/topology/postgis_topology.c
Log:
Always use int32_t for srid

The main declaration was already using it, but some
places still had int or mistakenly used uint32_t

Closes #4384



Modified: trunk/liblwgeom/cunit/cu_algorithm.c
===================================================================
--- trunk/liblwgeom/cunit/cu_algorithm.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/cunit/cu_algorithm.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -1549,7 +1549,7 @@
 {
 	LWPOLY* p;
 	const GBOX* g;
-	const int srid = 4326;
+	const int32_t srid = 4326;
 	const uint32_t segments_per_quad = 17;
 	const int x = 10;
 	const int y = 20;

Modified: trunk/liblwgeom/cunit/cu_libgeom.c
===================================================================
--- trunk/liblwgeom/cunit/cu_libgeom.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/cunit/cu_libgeom.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -21,7 +21,7 @@
 static void test_typmod_macros(void)
 {
 	int32_t typmod = 0;
-	int srid = 4326;
+	int32_t srid = 4326;
 	int type = 6;
 	int z = 1;
 	int rv;
@@ -1027,9 +1027,6 @@
 	LWLINE *line;
 	LWMPOINT *mpoint;
 
-//	LWLINE *
-//	lwline_from_lwmpoint(int srid, LWMPOINT *mpoint)
-
 	mpoint = (LWMPOINT*)lwgeom_from_wkt("MULTIPOINT(0 0, 0 1, 1 1, 1 2, 2 2)", LW_PARSER_CHECK_NONE);
 	line = lwline_from_lwmpoint(SRID_DEFAULT, mpoint);
 	CU_ASSERT_EQUAL(line->points->npoints, mpoint->ngeoms);

Modified: trunk/liblwgeom/liblwgeom.h.in
===================================================================
--- trunk/liblwgeom/liblwgeom.h.in	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/liblwgeom.h.in	2019-04-24 10:44:27 UTC (rev 17410)
@@ -218,10 +218,10 @@
 * what went in.
 * Raises an error if SRID value is out of bounds.
 */
-extern int clamp_srid(int srid);
+extern int32_t clamp_srid(int32_t srid);
 
 /* Raise an lwerror if srids do not match */
-void error_if_srid_mismatch(int srid1, int srid2);
+void error_if_srid_mismatch(int32_t srid1, int32_t srid2);
 
 /**
  * Global functions for memory/logging handlers.
@@ -1105,7 +1105,7 @@
 * For collections, only the parent gets an SRID, all
 * the children get SRID_UNKNOWN.
 */
-extern void lwgeom_set_srid(LWGEOM *geom, int srid);
+extern void lwgeom_set_srid(LWGEOM *geom, int32_t srid);
 
 /*------------------------------------------------------
  * other stuff
@@ -1345,47 +1345,47 @@
 * passed to them, they just take references, so do not free them out
 * from underneath the geometries.
 */
-extern LWPOINT* lwpoint_construct(int srid, GBOX *bbox, POINTARRAY *point);
-extern LWMPOINT *lwmpoint_construct(int srid, const POINTARRAY *pa);
-extern LWLINE* lwline_construct(int srid, GBOX *bbox, POINTARRAY *points);
-extern LWCIRCSTRING* lwcircstring_construct(int srid, GBOX *bbox, POINTARRAY *points);
-extern LWPOLY* lwpoly_construct(int srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points);
-extern LWCURVEPOLY* lwcurvepoly_construct(int srid, GBOX *bbox, uint32_t nrings, LWGEOM **geoms);
-extern LWTRIANGLE* lwtriangle_construct(int srid, GBOX *bbox, POINTARRAY *points);
-extern LWCOLLECTION* lwcollection_construct(uint8_t type, int srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms);
+extern LWPOINT* lwpoint_construct(int32_t srid, GBOX *bbox, POINTARRAY *point);
+extern LWMPOINT *lwmpoint_construct(int32_t srid, const POINTARRAY *pa);
+extern LWLINE* lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points);
+extern LWCIRCSTRING* lwcircstring_construct(int32_t srid, GBOX *bbox, POINTARRAY *points);
+extern LWPOLY* lwpoly_construct(int32_t srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points);
+extern LWCURVEPOLY* lwcurvepoly_construct(int32_t srid, GBOX *bbox, uint32_t nrings, LWGEOM **geoms);
+extern LWTRIANGLE* lwtriangle_construct(int32_t srid, GBOX *bbox, POINTARRAY *points);
+extern LWCOLLECTION* lwcollection_construct(uint8_t type, int32_t srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms);
 /*
 * Empty geometry constructors.
 */
-extern LWGEOM* lwgeom_construct_empty(uint8_t type, int srid, char hasz, char hasm);
-extern LWPOINT* lwpoint_construct_empty(int srid, char hasz, char hasm);
-extern LWLINE* lwline_construct_empty(int srid, char hasz, char hasm);
-extern LWPOLY* lwpoly_construct_empty(int srid, char hasz, char hasm);
-extern LWCURVEPOLY* lwcurvepoly_construct_empty(int srid, char hasz, char hasm);
-extern LWCIRCSTRING* lwcircstring_construct_empty(int srid, char hasz, char hasm);
-extern LWCOMPOUND* lwcompound_construct_empty(int srid, char hasz, char hasm);
-extern LWTRIANGLE* lwtriangle_construct_empty(int srid, char hasz, char hasm);
-extern LWMPOINT* lwmpoint_construct_empty(int srid, char hasz, char hasm);
-extern LWMLINE* lwmline_construct_empty(int srid, char hasz, char hasm);
-extern LWMPOLY* lwmpoly_construct_empty(int srid, char hasz, char hasm);
-extern LWCOLLECTION* lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm);
+extern LWGEOM* lwgeom_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm);
+extern LWPOINT* lwpoint_construct_empty(int32_t srid, char hasz, char hasm);
+extern LWLINE* lwline_construct_empty(int32_t srid, char hasz, char hasm);
+extern LWPOLY* lwpoly_construct_empty(int32_t srid, char hasz, char hasm);
+extern LWCURVEPOLY* lwcurvepoly_construct_empty(int32_t srid, char hasz, char hasm);
+extern LWCIRCSTRING* lwcircstring_construct_empty(int32_t srid, char hasz, char hasm);
+extern LWCOMPOUND* lwcompound_construct_empty(int32_t srid, char hasz, char hasm);
+extern LWTRIANGLE* lwtriangle_construct_empty(int32_t srid, char hasz, char hasm);
+extern LWMPOINT* lwmpoint_construct_empty(int32_t srid, char hasz, char hasm);
+extern LWMLINE* lwmline_construct_empty(int32_t srid, char hasz, char hasm);
+extern LWMPOLY* lwmpoly_construct_empty(int32_t srid, char hasz, char hasm);
+extern LWCOLLECTION* lwcollection_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm);
 
 
 /* Other constructors */
-extern LWPOINT *lwpoint_make2d(int srid, double x, double y);
-extern LWPOINT *lwpoint_make3dz(int srid, double x, double y, double z);
-extern LWPOINT *lwpoint_make3dm(int srid, double x, double y, double m);
-extern LWPOINT *lwpoint_make4d(int srid, double x, double y, double z, double m);
-extern LWPOINT *lwpoint_make(int srid, int hasz, int hasm, const POINT4D *p);
-extern LWLINE *lwline_from_lwgeom_array(int srid, uint32_t ngeoms, LWGEOM **geoms);
-extern LWLINE *lwline_from_ptarray(int srid, uint32_t npoints, LWPOINT **points); /* TODO: deprecate */
-extern LWLINE *lwline_from_lwmpoint(int srid, const LWMPOINT *mpoint);
+extern LWPOINT *lwpoint_make2d(int32_t srid, double x, double y);
+extern LWPOINT *lwpoint_make3dz(int32_t srid, double x, double y, double z);
+extern LWPOINT *lwpoint_make3dm(int32_t srid, double x, double y, double m);
+extern LWPOINT *lwpoint_make4d(int32_t srid, double x, double y, double z, double m);
+extern LWPOINT *lwpoint_make(int32_t srid, int hasz, int hasm, const POINT4D *p);
+extern LWLINE *lwline_from_lwgeom_array(int32_t srid, uint32_t ngeoms, LWGEOM **geoms);
+extern LWLINE *lwline_from_ptarray(int32_t srid, uint32_t npoints, LWPOINT **points); /* TODO: deprecate */
+extern LWLINE *lwline_from_lwmpoint(int32_t srid, const LWMPOINT *mpoint);
 extern LWLINE *lwline_addpoint(LWLINE *line, LWPOINT *point, uint32_t where);
 extern LWLINE *lwline_removepoint(LWLINE *line, uint32_t which);
 extern void lwline_setPoint4d(LWLINE *line, uint32_t which, POINT4D *newpoint);
 extern LWPOLY *lwpoly_from_lwlines(const LWLINE *shell, uint32_t nholes, const LWLINE **holes);
 extern LWPOLY *lwpoly_construct_rectangle(char hasz, char hasm, POINT4D *p1, POINT4D *p2, POINT4D *p3, POINT4D *p4);
-extern LWPOLY *lwpoly_construct_envelope(int srid, double x1, double y1, double x2, double y2);
-extern LWPOLY *lwpoly_construct_circle(int srid, double x, double y, double radius, uint32_t segments_per_quarter, char exterior);
+extern LWPOLY *lwpoly_construct_envelope(int32_t srid, double x1, double y1, double x2, double y2);
+extern LWPOLY *lwpoly_construct_circle(int32_t srid, double x, double y, double radius, uint32_t segments_per_quarter, char exterior);
 extern LWTRIANGLE *lwtriangle_from_lwline(const LWLINE *shell);
 extern LWMPOINT *lwmpoint_from_lwgeom(const LWGEOM *g); /* Extract the coordinates of an LWGEOM into an LWMPOINT */
 

Modified: trunk/liblwgeom/liblwgeom_topo.h
===================================================================
--- trunk/liblwgeom/liblwgeom_topo.h	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/liblwgeom_topo.h	2019-04-24 10:44:27 UTC (rev 17410)
@@ -156,10 +156,7 @@
    * @return a topology handler, which embeds the backend data/params
    *         or NULL on error (@see lastErrorMessage)
    */
-  LWT_BE_TOPOLOGY* (*createTopology) (
-    const LWT_BE_DATA* be,
-    const char* name, int srid, double precision, int hasZ
-  );
+  LWT_BE_TOPOLOGY *(*createTopology)(const LWT_BE_DATA *be, const char *name, int32_t srid, double precision, int hasZ);
 
   /**
    * Load a topology from the backend
@@ -906,8 +903,7 @@
  * @return the handler of the topology, or NULL on error
  *         (liblwgeom error handler will be invoked with error message)
  */
-LWT_TOPOLOGY *lwt_CreateTopology(LWT_BE_IFACE *iface, const char *name,
-                        int srid, double prec, int hasz);
+LWT_TOPOLOGY *lwt_CreateTopology(LWT_BE_IFACE *iface, const char *name, int32_t srid, double prec, int hasz);
 
 /**
  * Loads an existing topology by name from the database

Modified: trunk/liblwgeom/liblwgeom_topo_internal.h
===================================================================
--- trunk/liblwgeom/liblwgeom_topo_internal.h	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/liblwgeom_topo_internal.h	2019-04-24 10:44:27 UTC (rev 17410)
@@ -92,7 +92,7 @@
 {
   const LWT_BE_IFACE *be_iface;
   LWT_BE_TOPOLOGY *be_topo;
-  int srid;
+  int32_t srid;
   double precision;
   int hasZ;
 };

Modified: trunk/liblwgeom/lwcircstring.c
===================================================================
--- trunk/liblwgeom/lwcircstring.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwcircstring.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -34,8 +34,8 @@
 void printLWCIRCSTRING(LWCIRCSTRING *curve);
 void lwcircstring_release(LWCIRCSTRING *lwcirc);
 char lwcircstring_same(const LWCIRCSTRING *me, const LWCIRCSTRING *you);
-LWCIRCSTRING *lwcircstring_from_lwpointarray(int srid, uint32_t npoints, LWPOINT **points);
-LWCIRCSTRING *lwcircstring_from_lwmpoint(int srid, LWMPOINT *mpoint);
+LWCIRCSTRING *lwcircstring_from_lwpointarray(int32_t srid, uint32_t npoints, LWPOINT **points);
+LWCIRCSTRING *lwcircstring_from_lwmpoint(int32_t srid, LWMPOINT *mpoint);
 LWCIRCSTRING *lwcircstring_addpoint(LWCIRCSTRING *curve, LWPOINT *point, uint32_t where);
 LWCIRCSTRING *lwcircstring_removepoint(LWCIRCSTRING *curve, uint32_t index);
 void lwcircstring_setPoint4d(LWCIRCSTRING *curve, uint32_t index, POINT4D *newpoint);
@@ -47,7 +47,7 @@
  * use SRID=SRID_UNKNOWN for unknown SRID (will have 8bit type's S = 0)
  */
 LWCIRCSTRING *
-lwcircstring_construct(int srid, GBOX *bbox, POINTARRAY *points)
+lwcircstring_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
 {
 	LWCIRCSTRING *result;
 
@@ -76,7 +76,7 @@
 }
 
 LWCIRCSTRING *
-lwcircstring_construct_empty(int srid, char hasz, char hasm)
+lwcircstring_construct_empty(int32_t srid, char hasz, char hasm)
 {
 	LWCIRCSTRING *result = lwalloc(sizeof(LWCIRCSTRING));
 	result->type = CIRCSTRINGTYPE;
@@ -138,7 +138,7 @@
  * LWCIRCSTRING dimensions are large enough to host all input dimensions.
  */
 LWCIRCSTRING *
-lwcircstring_from_lwpointarray(int srid, uint32_t npoints, LWPOINT **points)
+lwcircstring_from_lwpointarray(int32_t srid, uint32_t npoints, LWPOINT **points)
 {
 	int zmflag=0;
 	uint32_t i;
@@ -189,7 +189,7 @@
  * Construct a LWCIRCSTRING from a LWMPOINT
  */
 LWCIRCSTRING *
-lwcircstring_from_lwmpoint(int srid, LWMPOINT *mpoint)
+lwcircstring_from_lwmpoint(int32_t srid, LWMPOINT *mpoint)
 {
 	uint32_t i;
 	POINTARRAY *pa;

Modified: trunk/liblwgeom/lwcollection.c
===================================================================
--- trunk/liblwgeom/lwcollection.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwcollection.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -38,10 +38,8 @@
 	lwgeom_release(lwcollection_as_lwgeom(lwcollection));
 }
 
-
 LWCOLLECTION *
-lwcollection_construct(uint8_t type, int srid, GBOX *bbox,
-                       uint32_t ngeoms, LWGEOM **geoms)
+lwcollection_construct(uint8_t type, int32_t srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
 {
 	LWCOLLECTION *ret;
 	int hasz, hasm;
@@ -91,7 +89,7 @@
 }
 
 LWCOLLECTION *
-lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
+lwcollection_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
 {
 	LWCOLLECTION *ret;
 	if( ! lwtype_is_collection(type) )

Modified: trunk/liblwgeom/lwcompound.c
===================================================================
--- trunk/liblwgeom/lwcompound.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwcompound.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -120,7 +120,7 @@
 }
 
 LWCOMPOUND *
-lwcompound_construct_empty(int srid, char hasz, char hasm)
+lwcompound_construct_empty(int32_t srid, char hasz, char hasm)
 {
 	LWCOMPOUND *ret = (LWCOMPOUND*)lwcollection_construct_empty(COMPOUNDTYPE, srid, hasz, hasm);
 	return ret;

Modified: trunk/liblwgeom/lwcurvepoly.c
===================================================================
--- trunk/liblwgeom/lwcurvepoly.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwcurvepoly.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -31,9 +31,8 @@
 #include "liblwgeom_internal.h"
 #include "lwgeom_log.h"
 
-
 LWCURVEPOLY *
-lwcurvepoly_construct_empty(int srid, char hasz, char hasm)
+lwcurvepoly_construct_empty(int32_t srid, char hasz, char hasm)
 {
 	LWCURVEPOLY *ret;
 

Modified: trunk/liblwgeom/lwgeom.c
===================================================================
--- trunk/liblwgeom/lwgeom.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwgeom.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -406,7 +406,7 @@
 	/*
 	int hasz = FLAGS_GET_Z(lwgeom->flags);
 	int hasm = FLAGS_GET_M(lwgeom->flags);
-	int srid = lwgeom->srid;
+	int32_t srid = lwgeom->srid;
 	*/
 
 	switch(type)
@@ -2022,8 +2022,8 @@
 	}
 }
 
-LWGEOM*
-lwgeom_construct_empty(uint8_t type, int srid, char hasz, char hasm)
+LWGEOM *
+lwgeom_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
 {
 	switch(type)
 	{

Modified: trunk/liblwgeom/lwgeom_geos.c
===================================================================
--- trunk/liblwgeom/lwgeom_geos.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwgeom_geos.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -1462,7 +1462,7 @@
 	GEOSGeometry* gpt;
 	GEOSCoordSequence* gseq;
 	LWMPOINT* mpt;
-	int srid = lwgeom_get_srid(lwgeom);
+	int32_t srid = lwgeom_get_srid(lwgeom);
 	int done = 0;
 	int* cells;
 	const size_t size = 2 * sizeof(int);
@@ -1832,7 +1832,7 @@
 	uint32_t num_points = lwgeom_count_vertices(g);
 	LWGEOM* lwgeom_result;
 	char is_3d = LW_FALSE;
-	int srid = lwgeom_get_srid(g);
+	int32_t srid = lwgeom_get_srid(g);
 	GEOSCoordSequence* coords;
 	GEOSGeometry* geos_geom;
 	GEOSGeometry* geos_env = NULL;

Modified: trunk/liblwgeom/lwgeom_sfcgal.c
===================================================================
--- trunk/liblwgeom/lwgeom_sfcgal.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwgeom_sfcgal.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -275,7 +275,7 @@
  * Throws an error on unsupported type
  */
 LWGEOM *
-SFCGAL2LWGEOM(const sfcgal_geometry_t *geom, int force3D, int srid)
+SFCGAL2LWGEOM(const sfcgal_geometry_t *geom, int force3D, int32_t srid)
 {
 	uint32_t ngeoms, nshells, nsolids;
 	uint32_t i, j, k;

Modified: trunk/liblwgeom/lwgeom_sfcgal.h
===================================================================
--- trunk/liblwgeom/lwgeom_sfcgal.h	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwgeom_sfcgal.h	2019-04-24 10:44:27 UTC (rev 17410)
@@ -29,7 +29,7 @@
 const char *lwgeom_sfcgal_version(void);
 
 /* Convert SFCGAL structure to lwgeom PostGIS */
-LWGEOM *SFCGAL2LWGEOM(const sfcgal_geometry_t *geom, int force3D, int SRID);
+LWGEOM *SFCGAL2LWGEOM(const sfcgal_geometry_t *geom, int force3D, int32_t SRID);
 
 /* Convert lwgeom PostGIS to SFCGAL structure */
 sfcgal_geometry_t *LWGEOM2SFCGAL(const LWGEOM *geom);

Modified: trunk/liblwgeom/lwin_wkb.c
===================================================================
--- trunk/liblwgeom/lwin_wkb.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwin_wkb.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -40,7 +40,7 @@
 	int swap_bytes; /* Do an endian flip? */
 	int check; /* Simple validity checks on geometries */
 	uint32_t lwtype; /* Current type we are handling */
-	uint32_t srid; /* Current SRID we are handling */
+	int32_t srid;    /* Current SRID we are handling */
 	int has_z; /* Z? */
 	int has_m; /* M? */
 	int has_srid; /* SRID? */

Modified: trunk/liblwgeom/lwin_wkt.c
===================================================================
--- trunk/liblwgeom/lwin_wkt.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwin_wkt.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -62,12 +62,12 @@
 {
 	char *c = str;
 	long i = 0;
-	int srid;
+	int32_t srid;
 
 	if( ! str ) return SRID_UNKNOWN;
 	c += 5; /* Advance past "SRID=" */
 	i = strtol(c, NULL, 10);
-	srid = clamp_srid((int)i);
+	srid = clamp_srid((int32_t)i);
 	/* TODO: warn on explicit UNKNOWN srid ? */
 	return srid;
 }
@@ -856,7 +856,8 @@
 	return geom;
 }
 
-void wkt_parser_geometry_new(LWGEOM *geom, int srid)
+void
+wkt_parser_geometry_new(LWGEOM *geom, int32_t srid)
 {
 	LWDEBUG(4,"entered");
 	LWDEBUGF(4,"geom %p",geom);

Modified: trunk/liblwgeom/lwin_wkt.h
===================================================================
--- trunk/liblwgeom/lwin_wkt.h	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwin_wkt.h	2019-04-24 10:44:27 UTC (rev 17410)
@@ -56,7 +56,7 @@
 /*
 * Functions called from within the bison parser to construct geometries.
 */
-int wkt_lexer_read_srid(char *str);
+int32_t wkt_lexer_read_srid(char *str);
 POINT wkt_parser_coord_2(double c1, double c2);
 POINT wkt_parser_coord_3(double c1, double c2, double c3);
 POINT wkt_parser_coord_4(double c1, double c2, double c3, double c4);
@@ -77,5 +77,4 @@
 LWGEOM* wkt_parser_collection_new(LWGEOM *geom);
 LWGEOM* wkt_parser_collection_add_geom(LWGEOM *col, LWGEOM *geom);
 LWGEOM* wkt_parser_collection_finalize(int lwtype, LWGEOM *col, char *dimensionality);
-void    wkt_parser_geometry_new(LWGEOM *geom, int srid);
-
+void wkt_parser_geometry_new(LWGEOM *geom, int32_t srid);

Modified: trunk/liblwgeom/lwline.c
===================================================================
--- trunk/liblwgeom/lwline.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwline.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -39,7 +39,7 @@
  * use SRID=SRID_UNKNOWN for unknown SRID (will have 8bit type's S = 0)
  */
 LWLINE *
-lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
+lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
 {
 	LWLINE *result;
 	result = (LWLINE*) lwalloc(sizeof(LWLINE));
@@ -61,7 +61,7 @@
 }
 
 LWLINE *
-lwline_construct_empty(int srid, char hasz, char hasm)
+lwline_construct_empty(int32_t srid, char hasz, char hasm)
 {
 	LWLINE *result = lwalloc(sizeof(LWLINE));
 	result->type = LINETYPE;
@@ -157,7 +157,7 @@
  * LWLINE dimensions are large enough to host all input dimensions.
  */
 LWLINE *
-lwline_from_lwgeom_array(int srid, uint32_t ngeoms, LWGEOM **geoms)
+lwline_from_lwgeom_array(int32_t srid, uint32_t ngeoms, LWGEOM **geoms)
 {
 	uint32_t i;
 	int hasz = LW_FALSE;
@@ -234,7 +234,7 @@
  * LWLINE dimensions are large enough to host all input dimensions.
  */
 LWLINE *
-lwline_from_ptarray(int srid, uint32_t npoints, LWPOINT **points)
+lwline_from_ptarray(int32_t srid, uint32_t npoints, LWPOINT **points)
 {
  	uint32_t i;
 	int hasz = LW_FALSE;
@@ -281,7 +281,7 @@
  * Construct a LWLINE from a LWMPOINT
  */
 LWLINE *
-lwline_from_lwmpoint(int srid, const LWMPOINT *mpoint)
+lwline_from_lwmpoint(int32_t srid, const LWMPOINT *mpoint)
 {
 	uint32_t i;
 	POINTARRAY *pa = NULL;

Modified: trunk/liblwgeom/lwmline.c
===================================================================
--- trunk/liblwgeom/lwmline.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwmline.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -35,7 +35,7 @@
 }
 
 LWMLINE *
-lwmline_construct_empty(int srid, char hasz, char hasm)
+lwmline_construct_empty(int32_t srid, char hasz, char hasm)
 {
 	LWMLINE *ret = (LWMLINE*)lwcollection_construct_empty(MULTILINETYPE, srid, hasz, hasm);
 	return ret;

Modified: trunk/liblwgeom/lwmpoint.c
===================================================================
--- trunk/liblwgeom/lwmpoint.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwmpoint.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -36,7 +36,7 @@
 }
 
 LWMPOINT *
-lwmpoint_construct_empty(int srid, char hasz, char hasm)
+lwmpoint_construct_empty(int32_t srid, char hasz, char hasm)
 {
 	LWMPOINT *ret = (LWMPOINT*)lwcollection_construct_empty(MULTIPOINTTYPE, srid, hasz, hasm);
 	return ret;
@@ -49,7 +49,7 @@
 }
 
 LWMPOINT *
-lwmpoint_construct(int srid, const POINTARRAY *pa)
+lwmpoint_construct(int32_t srid, const POINTARRAY *pa)
 {
 	uint32_t i;
 	int hasz = ptarray_has_z(pa);

Modified: trunk/liblwgeom/lwmpoly.c
===================================================================
--- trunk/liblwgeom/lwmpoly.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwmpoly.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -37,7 +37,7 @@
 }
 
 LWMPOLY *
-lwmpoly_construct_empty(int srid, char hasz, char hasm)
+lwmpoly_construct_empty(int32_t srid, char hasz, char hasm)
 {
 	LWMPOLY *ret = (LWMPOLY*)lwcollection_construct_empty(MULTIPOLYGONTYPE, srid, hasz, hasm);
 	return ret;

Modified: trunk/liblwgeom/lwpoint.c
===================================================================
--- trunk/liblwgeom/lwpoint.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwpoint.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -126,7 +126,7 @@
  * use SRID=SRID_UNKNOWN for unknown SRID (will have 8bit type's S = 0)
  */
 LWPOINT *
-lwpoint_construct(int srid, GBOX *bbox, POINTARRAY *point)
+lwpoint_construct(int32_t srid, GBOX *bbox, POINTARRAY *point)
 {
 	LWPOINT *result;
 	uint8_t flags = 0;
@@ -148,7 +148,7 @@
 }
 
 LWPOINT *
-lwpoint_construct_empty(int srid, char hasz, char hasm)
+lwpoint_construct_empty(int32_t srid, char hasz, char hasm)
 {
 	LWPOINT *result = lwalloc(sizeof(LWPOINT));
 	result->type = POINTTYPE;
@@ -160,7 +160,7 @@
 }
 
 LWPOINT *
-lwpoint_make2d(int srid, double x, double y)
+lwpoint_make2d(int32_t srid, double x, double y)
 {
 	POINT4D p = {x, y, 0.0, 0.0};
 	POINTARRAY *pa = ptarray_construct_empty(0, 0, 1);
@@ -170,7 +170,7 @@
 }
 
 LWPOINT *
-lwpoint_make3dz(int srid, double x, double y, double z)
+lwpoint_make3dz(int32_t srid, double x, double y, double z)
 {
 	POINT4D p = {x, y, z, 0.0};
 	POINTARRAY *pa = ptarray_construct_empty(1, 0, 1);
@@ -181,7 +181,7 @@
 }
 
 LWPOINT *
-lwpoint_make3dm(int srid, double x, double y, double m)
+lwpoint_make3dm(int32_t srid, double x, double y, double m)
 {
 	POINT4D p = {x, y, 0.0, m};
 	POINTARRAY *pa = ptarray_construct_empty(0, 1, 1);
@@ -192,7 +192,7 @@
 }
 
 LWPOINT *
-lwpoint_make4d(int srid, double x, double y, double z, double m)
+lwpoint_make4d(int32_t srid, double x, double y, double z, double m)
 {
 	POINT4D p = {x, y, z, m};
 	POINTARRAY *pa = ptarray_construct_empty(1, 1, 1);
@@ -203,7 +203,7 @@
 }
 
 LWPOINT *
-lwpoint_make(int srid, int hasz, int hasm, const POINT4D *p)
+lwpoint_make(int32_t srid, int hasz, int hasm, const POINT4D *p)
 {
 	POINTARRAY *pa = ptarray_construct_empty(hasz, hasm, 1);
 	ptarray_append_point(pa, p, LW_TRUE);

Modified: trunk/liblwgeom/lwpoly.c
===================================================================
--- trunk/liblwgeom/lwpoly.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwpoly.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -39,8 +39,8 @@
 /* construct a new LWPOLY.  arrays (points/points per ring) will NOT be copied
  * use SRID=SRID_UNKNOWN for unknown SRID (will have 8bit type's S = 0)
  */
-LWPOLY*
-lwpoly_construct(int srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
+LWPOLY *
+lwpoly_construct(int32_t srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
 {
 	LWPOLY *result;
 	int hasz, hasm;
@@ -95,7 +95,7 @@
 }
 
 LWPOLY *
-lwpoly_construct_envelope(int srid, double x1, double y1, double x2, double y2)
+lwpoly_construct_envelope(int32_t srid, double x1, double y1, double x2, double y2)
 {
 	POINT4D p1, p2, p3, p4;
 	LWPOLY *poly;
@@ -116,8 +116,8 @@
 	return poly;
 }
 
-LWPOLY*
-lwpoly_construct_circle(int srid, double x, double y, double radius, uint32_t segments_per_quarter, char exterior)
+LWPOLY *
+lwpoly_construct_circle(int32_t srid, double x, double y, double radius, uint32_t segments_per_quarter, char exterior)
 {
 	const uint32_t segments = 4*segments_per_quarter;
 	double theta;
@@ -157,8 +157,8 @@
 	return lwpoly;
 }
 
-LWPOLY*
-lwpoly_construct_empty(int srid, char hasz, char hasm)
+LWPOLY *
+lwpoly_construct_empty(int32_t srid, char hasz, char hasm)
 {
 	LWPOLY *result = lwalloc(sizeof(LWPOLY));
 	result->type = POLYGONTYPE;
@@ -362,7 +362,7 @@
 {
 	uint32_t nrings;
 	POINTARRAY **rings = lwalloc((nholes+1)*sizeof(POINTARRAY *));
-	int srid = shell->srid;
+	int32_t srid = shell->srid;
 	LWPOLY *ret;
 
 	if ( shell->points->npoints < 4 )

Modified: trunk/liblwgeom/lwstroke.c
===================================================================
--- trunk/liblwgeom/lwstroke.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwstroke.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -38,8 +38,7 @@
 
 #include "liblwgeom_internal.h"
 
-
-LWGEOM* pta_unstroke(const POINTARRAY *points, int srid);
+LWGEOM *pta_unstroke(const POINTARRAY *points, int32_t srid);
 LWGEOM* lwline_unstroke(const LWLINE *line);
 LWGEOM* lwpolygon_unstroke(const LWPOLY *poly);
 LWGEOM* lwmline_unstroke(const LWMLINE *mline);
@@ -909,8 +908,8 @@
 	return LW_FALSE;
 }
 
-static LWGEOM*
-linestring_from_pa(const POINTARRAY *pa, int srid, int start, int end)
+static LWGEOM *
+linestring_from_pa(const POINTARRAY *pa, int32_t srid, int start, int end)
 {
 	int i = 0, j = 0;
 	POINT4D p;
@@ -924,8 +923,8 @@
 	return lwline_as_lwgeom(lwline_construct(srid, NULL, pao));
 }
 
-static LWGEOM*
-circstring_from_pa(const POINTARRAY *pa, int srid, int start, int end)
+static LWGEOM *
+circstring_from_pa(const POINTARRAY *pa, int32_t srid, int start, int end)
 {
 
 	POINT4D p0, p1, p2;
@@ -940,8 +939,8 @@
 	return lwcircstring_as_lwgeom(lwcircstring_construct(srid, NULL, pao));
 }
 
-static LWGEOM*
-geom_from_pa(const POINTARRAY *pa, int srid, int is_arc, int start, int end)
+static LWGEOM *
+geom_from_pa(const POINTARRAY *pa, int32_t srid, int is_arc, int start, int end)
 {
 	LWDEBUGF(4, "srid=%d, is_arc=%d, start=%d, end=%d", srid, is_arc, start, end);
 	if ( is_arc )
@@ -950,8 +949,8 @@
 		return linestring_from_pa(pa, srid, start, end);
 }
 
-LWGEOM*
-pta_unstroke(const POINTARRAY *points, int srid)
+LWGEOM *
+pta_unstroke(const POINTARRAY *points, int32_t srid)
 {
 	int i = 0, j, k;
 	POINT4D a1, a2, a3, b;

Modified: trunk/liblwgeom/lwtriangle.c
===================================================================
--- trunk/liblwgeom/lwtriangle.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwtriangle.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -36,8 +36,8 @@
 /* construct a new LWTRIANGLE.
  * use SRID=SRID_UNKNOWN for unknown SRID (will have 8bit type's S = 0)
  */
-LWTRIANGLE*
-lwtriangle_construct(int srid, GBOX *bbox, POINTARRAY *points)
+LWTRIANGLE *
+lwtriangle_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
 {
 	LWTRIANGLE *result;
 
@@ -54,8 +54,8 @@
 	return result;
 }
 
-LWTRIANGLE*
-lwtriangle_construct_empty(int srid, char hasz, char hasm)
+LWTRIANGLE *
+lwtriangle_construct_empty(int32_t srid, char hasz, char hasm)
 {
 	LWTRIANGLE *result = lwalloc(sizeof(LWTRIANGLE));
 	result->type = TRIANGLETYPE;

Modified: trunk/liblwgeom/lwutil.c
===================================================================
--- trunk/liblwgeom/lwutil.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/lwutil.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -340,9 +340,8 @@
 	                                       */
 }
 
-
 void
-error_if_srid_mismatch(int srid1, int srid2)
+error_if_srid_mismatch(int32_t srid1, int32_t srid2)
 {
 	if ( srid1 != srid2 )
 	{
@@ -350,8 +349,8 @@
 	}
 }
 
-int
-clamp_srid(int srid)
+int32_t
+clamp_srid(int32_t srid)
 {
 	int newsrid = srid;
 

Modified: trunk/liblwgeom/measures.c
===================================================================
--- trunk/liblwgeom/measures.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/measures.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -81,7 +81,7 @@
 Function initializing shortestline and longestline calculations.
 */
 LWGEOM *
-lw_dist2d_distanceline(const LWGEOM *lw1, const LWGEOM *lw2, int srid, int mode)
+lw_dist2d_distanceline(const LWGEOM *lw1, const LWGEOM *lw2, int32_t srid, int mode)
 {
 	double x1,x2,y1,y2;
 
@@ -128,7 +128,7 @@
 Function initializing closestpoint calculations.
 */
 LWGEOM *
-lw_dist2d_distancepoint(const LWGEOM *lw1, const LWGEOM *lw2,int srid,int mode)
+lw_dist2d_distancepoint(const LWGEOM *lw1, const LWGEOM *lw2, int32_t srid, int mode)
 {
 	double x,y;
 	DISTPTS thedl;

Modified: trunk/liblwgeom/measures.h
===================================================================
--- trunk/liblwgeom/measures.h	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/measures.h	2019-04-24 10:44:27 UTC (rev 17410)
@@ -124,7 +124,7 @@
 /*
 * Geometry returning functions
 */
-LWGEOM* lw_dist2d_distancepoint(const LWGEOM *lw1, const LWGEOM *lw2, int srid, int mode);
-LWGEOM* lw_dist2d_distanceline(const LWGEOM *lw1, const LWGEOM *lw2, int srid, int mode);
+LWGEOM *lw_dist2d_distancepoint(const LWGEOM *lw1, const LWGEOM *lw2, int32_t srid, int mode);
+LWGEOM *lw_dist2d_distanceline(const LWGEOM *lw1, const LWGEOM *lw2, int32_t srid, int mode);
 
 #endif /* !defined _MEASURES_H  */
\ No newline at end of file

Modified: trunk/liblwgeom/measures3d.c
===================================================================
--- trunk/liblwgeom/measures3d.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/measures3d.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -56,7 +56,7 @@
 and the z-range is from maxz to minz in the geometry that has z values.
 */
 static LWGEOM *
-create_v_line(const LWGEOM *lwgeom, double x, double y, int srid)
+create_v_line(const LWGEOM *lwgeom, double x, double y, int32_t srid)
 {
 
 	LWPOINT *lwpoints[2];
@@ -94,7 +94,7 @@
 Function initializing 3dshortestline and 3dlongestline calculations.
 */
 LWGEOM *
-lw_dist3d_distanceline(const LWGEOM *lw1, const LWGEOM *lw2, int srid, int mode)
+lw_dist3d_distanceline(const LWGEOM *lw1, const LWGEOM *lw2, int32_t srid, int mode)
 {
 	LWDEBUG(2, "lw_dist3d_distanceline is called");
 	double x1, x2, y1, y2, z1, z2, x, y;
@@ -198,7 +198,7 @@
 Function initializing 3dclosestpoint calculations.
 */
 LWGEOM *
-lw_dist3d_distancepoint(const LWGEOM *lw1, const LWGEOM *lw2, int srid, int mode)
+lw_dist3d_distancepoint(const LWGEOM *lw1, const LWGEOM *lw2, int32_t srid, int mode)
 {
 
 	double x, y, z;

Modified: trunk/liblwgeom/measures3d.h
===================================================================
--- trunk/liblwgeom/measures3d.h	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/liblwgeom/measures3d.h	2019-04-24 10:44:27 UTC (rev 17410)
@@ -61,8 +61,8 @@
 /*
 Geometry returning functions
 */
-LWGEOM *lw_dist3d_distancepoint(const LWGEOM *lw1, const LWGEOM *lw2, int srid, int mode);
-LWGEOM *lw_dist3d_distanceline(const LWGEOM *lw1, const LWGEOM *lw2, int srid, int mode);
+LWGEOM *lw_dist3d_distancepoint(const LWGEOM *lw1, const LWGEOM *lw2, int32_t srid, int mode);
+LWGEOM *lw_dist3d_distanceline(const LWGEOM *lw1, const LWGEOM *lw2, int32_t srid, int mode);
 
 /*
 Preprocessing functions

Modified: trunk/libpgcommon/lwgeom_cache.h
===================================================================
--- trunk/libpgcommon/lwgeom_cache.h	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/libpgcommon/lwgeom_cache.h	2019-04-24 10:44:27 UTC (rev 17410)
@@ -65,8 +65,8 @@
 /* An entry in the PROJ SRS cache */
 typedef struct struct_PROJSRSCacheItem
 {
-	int srid_from;
-	int srid_to;
+	int32_t srid_from;
+	int32_t srid_to;
 	PJ* projection;
 	MemoryContext projection_mcxt;
 }

Modified: trunk/libpgcommon/lwgeom_transform.c
===================================================================
--- trunk/libpgcommon/lwgeom_transform.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/libpgcommon/lwgeom_transform.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -92,11 +92,10 @@
 
 /* Internal Cache API */
 /* static PROJPortalCache *GetPROJSRSCache(FunctionCallInfo fcinfo) ; */
-static bool IsInPROJSRSCache(PROJPortalCache *PROJCache, int srid_from, int srid_to);
-static void AddToPROJSRSCache(PROJPortalCache *PROJCache, int srid_from, int srid_to);
-static void DeleteFromPROJSRSCache(PROJPortalCache *PROJCache, int srid_from, int srid_to);
+static bool IsInPROJSRSCache(PROJPortalCache *PROJCache, int32_t srid_from, int32_t srid_to);
+static void AddToPROJSRSCache(PROJPortalCache *PROJCache, int32_t srid_from, int32_t srid_to);
+static void DeleteFromPROJSRSCache(PROJPortalCache *PROJCache, int32_t srid_from, int32_t srid_to);
 
-
 /* Search path for PROJ.4 library */
 static bool IsPROJLibPathSet = false;
 void SetPROJLibPath(void);
@@ -340,7 +339,7 @@
  */
 
 static bool
-IsInPROJSRSCache(PROJPortalCache *cache, int srid_from, int srid_to)
+IsInPROJSRSCache(PROJPortalCache *cache, int32_t srid_from, int32_t srid_to)
 {
 	/*
 	 * Return true/false depending upon whether the item
@@ -357,8 +356,8 @@
 	return false;
 }
 
-static PJ*
-GetProjectionFromPROJCache(PROJPortalCache *cache, int srid_from, int srid_to)
+static PJ *
+GetProjectionFromPROJCache(PROJPortalCache *cache, int32_t srid_from, int32_t srid_to)
 {
 	uint32_t i;
 	for (i = 0; i < PROJ_CACHE_ITEMS; i++)
@@ -384,7 +383,7 @@
 }
 
 static PjStrs
-GetProjStringsSPI(int srid)
+GetProjStringsSPI(int32_t srid)
 {
 	const int maxprojlen = 512;
 	const int spibufferlen = 512;
@@ -474,7 +473,7 @@
  *  return the proj4text for those.
  */
 static PjStrs
-GetProjStrings(int srid)
+GetProjStrings(int32_t srid)
 {
 	const int maxprojlen = 512;
 	PjStrs strs;
@@ -606,7 +605,7 @@
 * needs proj4text access
 */
 char *
-GetProj4String(int srid)
+GetProj4String(int32_t srid)
 {
 	PjStrs strs;
 	char *proj4str;
@@ -623,7 +622,7 @@
  * which is the definition for the other half of the transformation.
  */
 static void
-AddToPROJSRSCache(PROJPortalCache *PROJCache, int srid_from, int srid_to)
+AddToPROJSRSCache(PROJPortalCache *PROJCache, int32_t srid_from, int32_t srid_to)
 {
 	MemoryContext PJMemoryContext;
 
@@ -763,9 +762,8 @@
 	PROJCache->PROJSRSCacheCount++;
 }
 
-
 static void
-DeleteFromPROJSRSCache(PROJPortalCache *PROJCache, int srid_from, int srid_to)
+DeleteFromPROJSRSCache(PROJPortalCache *PROJCache, int32_t srid_from, int32_t srid_to)
 {
 	/*
 	 * Delete the SRID entry from the cache
@@ -837,9 +835,8 @@
 	}
 }
 
-
 int
-GetPJUsingFCInfo(FunctionCallInfo fcinfo, int srid_from, int srid_to, PJ** pj)
+GetPJUsingFCInfo(FunctionCallInfo fcinfo, int32_t srid_from, int32_t srid_to, PJ **pj)
 {
 	PROJPortalCache *proj_cache = NULL;
 
@@ -882,7 +879,7 @@
 }
 
 static int
-srid_is_latlong(FunctionCallInfo fcinfo, int srid)
+srid_is_latlong(FunctionCallInfo fcinfo, int32_t srid)
 {
 	PJ* pj;
 	if ( GetPJUsingFCInfo(fcinfo, srid, srid, &pj) == LW_FAILURE)
@@ -891,7 +888,7 @@
 }
 
 void
-srid_check_latlong(FunctionCallInfo fcinfo, int srid)
+srid_check_latlong(FunctionCallInfo fcinfo, int32_t srid)
 {
 	if (srid == SRID_DEFAULT || srid == SRID_UNKNOWN)
 		return;
@@ -905,7 +902,7 @@
 }
 
 srs_precision
-srid_axis_precision(FunctionCallInfo fcinfo, int srid, int precision)
+srid_axis_precision(FunctionCallInfo fcinfo, int32_t srid, int precision)
 {
 	srs_precision sp;
 	sp.precision_xy = precision;
@@ -925,7 +922,7 @@
 }
 
 int
-spheroid_init_from_srid(FunctionCallInfo fcinfo, int srid, SPHEROID *s)
+spheroid_init_from_srid(FunctionCallInfo fcinfo, int32_t srid, SPHEROID *s)
 {
 	PJ* pj;
 #if POSTGIS_PROJ_VERSION >= 60

Modified: trunk/libpgcommon/lwgeom_transform.h
===================================================================
--- trunk/libpgcommon/lwgeom_transform.h	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/libpgcommon/lwgeom_transform.h	2019-04-24 10:44:27 UTC (rev 17410)
@@ -21,7 +21,7 @@
 	int precision_m;
 } srs_precision;
 
-char * GetProj4String(int srid);
+char *GetProj4String(int32_t srid);
 
 /**
  * Opaque type to use in the projection cache API.
@@ -29,12 +29,12 @@
 typedef void *ProjCache ;
 
 void SetPROJLibPath(void);
-bool IsInPROJCache(ProjCache cache, int srid_from, int srid_to);
-PJ* GetPJFromPROJCache(ProjCache cache, int srid_from, int srid_to);
-int GetPJUsingFCInfo(FunctionCallInfo fcinfo, int srid_from, int srid_to, PJ** pj);
-int spheroid_init_from_srid(FunctionCallInfo fcinfo, int srid, SPHEROID *s);
-void srid_check_latlong(FunctionCallInfo fcinfo, int srid);
-srs_precision srid_axis_precision(FunctionCallInfo fcinfo, int srid, int precision);
+bool IsInPROJCache(ProjCache cache, int32_t srid_from, int32_t srid_to);
+PJ *GetPJFromPROJCache(ProjCache cache, int32_t srid_from, int32_t srid_to);
+int GetPJUsingFCInfo(FunctionCallInfo fcinfo, int32_t srid_from, int32_t srid_to, PJ **pj);
+int spheroid_init_from_srid(FunctionCallInfo fcinfo, int32_t srid, SPHEROID *s);
+void srid_check_latlong(FunctionCallInfo fcinfo, int32_t srid);
+srs_precision srid_axis_precision(FunctionCallInfo fcinfo, int32_t srid, int precision);
 
 /**
  * Builtin SRID values

Modified: trunk/loader/shp2pgsql-core.c
===================================================================
--- trunk/loader/shp2pgsql-core.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/loader/shp2pgsql-core.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -1439,7 +1439,7 @@
 		if (state->config->readshape == 1 && (!state->config->geography))
 		{
 			/* If they didn't specify a target SRID, see if they specified a source SRID. */
-			int srid = state->to_srid;
+			int32_t srid = state->to_srid;
 			if (state->config->schema)
 			{
 				stringbuffer_aprintf(sb, "SELECT AddGeometryColumn('%s','%s','%s','%d',",

Modified: trunk/postgis/geography_centroid.c
===================================================================
--- trunk/postgis/geography_centroid.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/geography_centroid.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -35,10 +35,14 @@
 Datum geography_centroid(PG_FUNCTION_ARGS);
 
 /* internal functions */
-LWPOINT* geography_centroid_from_wpoints(const uint32_t srid, const POINT3DM* points, const uint32_t size);
+LWPOINT *geography_centroid_from_wpoints(const int32_t srid, const POINT3DM *points, const uint32_t size);
 LWPOINT* geography_centroid_from_mline(const LWMLINE* mline, SPHEROID* s);
 LWPOINT* geography_centroid_from_mpoly(const LWMPOLY* mpoly, bool use_spheroid, SPHEROID* s);
-LWPOINT* cart_to_lwpoint(const double_t x_sum, const double_t y_sum, const double_t z_sum, const double_t weight_sum, const uint32_t srid);
+LWPOINT *cart_to_lwpoint(const double_t x_sum,
+			 const double_t y_sum,
+			 const double_t z_sum,
+			 const double_t weight_sum,
+			 const int32_t srid);
 POINT3D* lonlat_to_cart(const double_t raw_lon, const double_t raw_lat);
 
 /**
@@ -53,9 +57,9 @@
     LWPOINT *lwpoint_out = NULL;
 	GSERIALIZED *g = NULL;
 	GSERIALIZED *g_out = NULL;
-    uint32_t srid;
-    bool use_spheroid = true;
-    SPHEROID s;
+	int32_t srid;
+	bool use_spheroid = true;
+	SPHEROID s;
 	uint32_t type;
 
 	/* Get our geometry object loaded into memory. */
@@ -177,7 +181,8 @@
  * Convert lat-lon-points to x-y-z-coordinates, calculate a weighted average
  * point and return lat-lon-coordinated
  */
-LWPOINT* geography_centroid_from_wpoints(const uint32_t srid, const POINT3DM* points, const uint32_t size)
+LWPOINT *
+geography_centroid_from_wpoints(const int32_t srid, const POINT3DM *points, const uint32_t size)
 {
     double_t x_sum = 0;
     double_t y_sum = 0;
@@ -229,7 +234,12 @@
     return point;
 }
 
-LWPOINT* cart_to_lwpoint(const double_t x_sum, const double_t y_sum, const double_t z_sum, const double_t weight_sum, const uint32_t srid)
+LWPOINT *
+cart_to_lwpoint(const double_t x_sum,
+		const double_t y_sum,
+		const double_t z_sum,
+		const double_t weight_sum,
+		const int32_t srid)
 {
     double_t x = x_sum / weight_sum;
     double_t y = y_sum / weight_sum;

Modified: trunk/postgis/geography_inout.c
===================================================================
--- trunk/postgis/geography_inout.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/geography_inout.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -214,7 +214,7 @@
 	text *result;
 	int version;
 	char *srs;
-	int srid = SRID_DEFAULT;
+	int32_t srid = SRID_DEFAULT;
 	int precision = DBL_DIG;
 	int option = 0;
 	int lwopts = LW_GML_IS_DIMS;

Modified: trunk/postgis/gserialized_typmod.c
===================================================================
--- trunk/postgis/gserialized_typmod.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/gserialized_typmod.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -266,8 +266,7 @@
 		}
 		if ( i == 1 ) /* SRID */
 		{
-			int srid = pg_atoi(DatumGetCString(elem_values[i]),
-			                   sizeof(int32), '\0');
+			int32_t srid = pg_atoi(DatumGetCString(elem_values[i]), sizeof(int32), '\0');
 			srid = clamp_srid(srid);
 			POSTGIS_DEBUGF(3, "srid: %d", srid);
 			if ( srid != SRID_UNKNOWN )
@@ -292,7 +291,7 @@
 {
 	ArrayType *arr = (ArrayType *) DatumGetPointer(PG_GETARG_DATUM(0));
 	int32 typmod = gserialized_typmod_in(arr, LW_TRUE);
-	int srid = TYPMOD_GET_SRID(typmod);
+	int32_t srid = TYPMOD_GET_SRID(typmod);
 	/* Check the SRID is legal (geographic coordinates) */
 	srid_check_latlong(fcinfo, srid);
 

Modified: trunk/postgis/lwgeom_btree.c
===================================================================
--- trunk/postgis/lwgeom_btree.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/lwgeom_btree.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -139,7 +139,7 @@
 	size_t sz1 = VARSIZE(g1);
 	size_t bsz1 = sz1 - hsz1;
 	/* Calculate size of srid/type/coordinate buffer */
-	int srid = gserialized_get_srid(g1);
+	int32_t srid = gserialized_get_srid(g1);
 	size_t bsz2 = bsz1 + sizeof(int);
 	uint8_t *b2 = palloc(bsz2);
 	/* Copy srid into front of combined buffer */

Modified: trunk/postgis/lwgeom_export.c
===================================================================
--- trunk/postgis/lwgeom_export.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/lwgeom_export.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -52,7 +52,8 @@
  * Could return SRS as short one (i.e EPSG:4326)
  * or as long one: (i.e urn:ogc:def:crs:EPSG::4326)
  */
-char * getSRSbySRID(int srid, bool short_crs)
+char *
+getSRSbySRID(int32_t srid, bool short_crs)
 {
 	char query[256];
 	char *srs, *srscopy;
@@ -117,7 +118,7 @@
 int getSRIDbySRS(const char* srs)
 {
 	char query[256];
-	int srid, err;
+	int32_t srid, err;
 
 	if (!srs) return 0;
 
@@ -184,7 +185,7 @@
 	text *result;
 	int version;
 	char *srs;
-	int srid;
+	int32_t srid;
 	int option = 0;
 	int lwopts = LW_GML_IS_DIMS;
 	int precision = DBL_DIG;
@@ -377,7 +378,7 @@
 
 		if ( option & 2 || option & 4 )
 		{
-			int srid = gserialized_get_srid(geom);
+			int32_t srid = gserialized_get_srid(geom);
 			if ( srid != SRID_UNKNOWN )
 			{
 				if ( option & 2 )
@@ -466,7 +467,7 @@
 	text *result;
 	int version;
 	char *srs;
-	int srid;
+	int32_t srid;
 	int option = 0;
 	int precision = DBL_DIG;
 	static const char* default_defid = "x3d:"; /* default defid */

Modified: trunk/postgis/lwgeom_export.h
===================================================================
--- trunk/postgis/lwgeom_export.h	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/lwgeom_export.h	2019-04-24 10:44:27 UTC (rev 17410)
@@ -22,6 +22,5 @@
  *
  **********************************************************************/
 
-
-char * getSRSbySRID(int SRID, bool short_crs);
+char *getSRSbySRID(int32_t SRID, bool short_crs);
 int getSRIDbySRS(const char* SRS);

Modified: trunk/postgis/lwgeom_functions_analytic.c
===================================================================
--- trunk/postgis/lwgeom_functions_analytic.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/lwgeom_functions_analytic.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -186,7 +186,7 @@
 	GSERIALIZED *result;
 	double distance_fraction = PG_GETARG_FLOAT8(1);
 	int repeat = PG_NARGS() > 2 && PG_GETARG_BOOL(2);
-	int srid = gserialized_get_srid(gser);
+	int32_t srid = gserialized_get_srid(gser);
 	LWLINE* lwline;
 	LWGEOM* lwresult;
 	POINTARRAY* opa;

Modified: trunk/postgis/lwgeom_functions_basic.c
===================================================================
--- trunk/postgis/lwgeom_functions_basic.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/lwgeom_functions_basic.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -452,7 +452,7 @@
 	GSERIALIZED *result;
 	LWGEOM **lwgeoms;
 	LWGEOM *lwgeom;
-	int srid;
+	int32_t srid;
 	GBOX *bbox;
 
 	POSTGIS_DEBUG(2, "LWGEOM_force_collection called");
@@ -1148,7 +1148,7 @@
 	LWGEOM *lwgeoms[2], *outlwg;
 	uint32 type1, type2;
 	uint8_t outtype;
-	int srid;
+	int32_t srid;
 
 	POSTGIS_DEBUG(2, "LWGEOM_collect called.");
 
@@ -1231,7 +1231,7 @@
 	LWGEOM **lwgeoms, *outlwg;
 	uint32 outtype;
 	int count;
-	int srid = SRID_UNKNOWN;
+	int32_t srid = SRID_UNKNOWN;
 	GBOX *box = NULL;
 
 	ArrayIterator iterator;
@@ -1404,7 +1404,7 @@
 	LWGEOM **geoms;
 	LWGEOM *outlwg;
 	uint32 ngeoms;
-	int srid = SRID_UNKNOWN;
+	int32_t srid = SRID_UNKNOWN;
 
 	ArrayIterator iterator;
 	Datum value;
@@ -1607,7 +1607,7 @@
 {
 	GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
 	LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
-	int srid = lwgeom_get_srid(lwgeom);
+	int32_t srid = lwgeom_get_srid(lwgeom);
 	LWPOLY *poly;
 	GSERIALIZED *result;
 	GBOX gbox;
@@ -1708,7 +1708,7 @@
 {
 	GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
 	LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
-	int srid = lwgeom->srid;
+	int32_t srid = lwgeom->srid;
 	POINT4D pt;
 	GBOX box;
 	POINTARRAY *pa;
@@ -2069,7 +2069,7 @@
 	LWPOLY *poly;
 	GSERIALIZED *result;
 	double x1, y1, x2, y2;
-	int srid = SRID_UNKNOWN;
+	int32_t srid = SRID_UNKNOWN;
 
 	POSTGIS_DEBUG(2, "ST_MakeEnvelope called");
 
@@ -2369,7 +2369,7 @@
 	LWPOINT *lwpoint;
 	POINT2D p1, p2;
 	double result;
-	int srid;
+	int32_t srid;
 
 	/* Extract first point */
 	geom = PG_GETARG_GSERIALIZED_P(0);
@@ -2445,7 +2445,7 @@
 	POINT2D points[4];
 	double az1, az2;
 	double result;
-	int srids[4];
+	int32_t srids[4];
 	int i = 0;
 	int j = 0;
 	int err_code = 0;
@@ -2884,7 +2884,7 @@
 	const GBOX *gbox;
 	int hasz = FLAGS_GET_Z(lwgeom_in->flags);
 	int hasm = FLAGS_GET_M(lwgeom_in->flags);
-	int srid = lwgeom_in->srid;
+	int32_t srid = lwgeom_in->srid;
 	POINT4D pt;
 	POINTARRAY *pa;
 

Modified: trunk/postgis/lwgeom_geos.c
===================================================================
--- trunk/postgis/lwgeom_geos.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/lwgeom_geos.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -358,7 +358,7 @@
 	GEOSGeometry *g_union = NULL;
 	GEOSGeometry **geoms = NULL;
 
-	int srid = SRID_UNKNOWN;
+	int32_t srid = SRID_UNKNOWN;
 
 	int empty_type = 0;
 
@@ -765,7 +765,7 @@
 	GEOSGeometry *g1, *g3;
 	GSERIALIZED *result;
 	LWGEOM *lwgeom;
-	int srid;
+	int32_t srid;
 
 	geom1 = PG_GETARG_GSERIALIZED_P(0);
 
@@ -837,7 +837,7 @@
 	GEOSGeometry *g1, *g3;
 	GSERIALIZED *result;
 	LWGEOM *lwout;
-	int srid;
+	int32_t srid;
 	GBOX bbox;
 
 	geom1 = PG_GETARG_GSERIALIZED_P(0);
@@ -2912,7 +2912,7 @@
 	GSERIALIZED *result;
 	GEOSGeometry *geos_result;
 	const GEOSGeometry **vgeoms;
-	int srid=SRID_UNKNOWN;
+	int32_t srid = SRID_UNKNOWN;
 #if POSTGIS_DEBUG_LEVEL >= 3
 	static int call=1;
 #endif
@@ -2969,7 +2969,7 @@
 	int is3d = 0;
 	uint32 nelems, nclusters, i;
 	GEOSGeometry **geos_inputs, **geos_results;
-	int srid=SRID_UNKNOWN;
+	int32_t srid = SRID_UNKNOWN;
 
 	/* Parameters used to construct a result array */
 	int16 elmlen;
@@ -3037,7 +3037,7 @@
 	LWGEOM** lw_inputs;
 	LWGEOM** lw_results;
 	double tolerance;
-	int srid=SRID_UNKNOWN;
+	int32_t srid = SRID_UNKNOWN;
 
 	/* Parameters used to construct a result array */
 	int16 elmlen;
@@ -3503,7 +3503,7 @@
 	GSERIALIZED* result;
 	GEOSGeometry* input_geos;
 	GEOSGeometry* result_geos;
-	int srid;
+	int32_t srid;
 
 	initGEOS(lwpgnotice, lwgeom_geos_error);
 
@@ -3539,7 +3539,7 @@
 	GSERIALIZED* result;
 	GEOSGeometry* input_geos;
 	GEOSGeometry* result_geos;
-	int srid;
+	int32_t srid;
 
 	initGEOS(lwpgnotice, lwgeom_geos_error);
 

Modified: trunk/postgis/lwgeom_in_gml.c
===================================================================
--- trunk/postgis/lwgeom_in_gml.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/lwgeom_in_gml.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -68,7 +68,7 @@
 
 typedef struct struct_gmlSrs
 {
-	int srid;
+	int32_t srid;
 	bool reverse_axis;
 }
 gmlSrs;
@@ -299,7 +299,8 @@
 
 #if POSTGIS_PROJ_VERSION < 60
 
-static POINTARRAY* gml_reproject_pa(POINTARRAY *pa, int srid_in, int srid_out)
+static POINTARRAY *
+gml_reproject_pa(POINTARRAY *pa, int32_t srid_in, int32_t srid_out)
 {
 	PJ pj;
 	char *text_in, *text_out;
@@ -332,7 +333,8 @@
  * lookups, and use the Proj 6+ EPSG catalogue and built-in SRID
  * lookups directly. Drop this ugly hack.
  */
-static POINTARRAY* gml_reproject_pa(POINTARRAY *pa, int srid_in, int srid_out)
+static POINTARRAY *
+gml_reproject_pa(POINTARRAY *pa, int32_t srid_in, int32_t srid_out)
 {
 	PJ *pj;
 	char text_in[32];
@@ -360,7 +362,8 @@
  * Return 1 if given srid is planar (0 otherwise, i.e geocentric srid)
  * Return -1 if srid is not in spatial_ref_sys
  */
-static int gml_is_srid_planar(int srid)
+static int
+gml_is_srid_planar(int32_t srid)
 {
 	char *result;
 	char query[256];

Modified: trunk/postgis/lwgeom_inout.c
===================================================================
--- trunk/postgis/lwgeom_inout.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/lwgeom_inout.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -89,7 +89,7 @@
 	LWGEOM_PARSER_RESULT lwg_parser_result;
 	LWGEOM *lwgeom;
 	GSERIALIZED *ret;
-	int srid = 0;
+	int32_t srid = 0;
 
 	if ( (PG_NARGS()>2) && (!PG_ARGISNULL(2)) ) {
 		geom_typmod = PG_GETARG_INT32(2);

Modified: trunk/postgis/lwgeom_ogc.c
===================================================================
--- trunk/postgis/lwgeom_ogc.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/lwgeom_ogc.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -96,7 +96,7 @@
 Datum LWGEOM_get_srid(PG_FUNCTION_ARGS)
 {
 	GSERIALIZED *geom=PG_GETARG_GSERIALIZED_P(0);
-	int srid = gserialized_get_srid (geom);
+	int32_t srid = gserialized_get_srid(geom);
 	PG_FREE_IF_COPY(geom,0);
 	PG_RETURN_INT32(srid);
 }
@@ -106,7 +106,7 @@
 Datum LWGEOM_set_srid(PG_FUNCTION_ARGS)
 {
 	GSERIALIZED *g = (GSERIALIZED *)PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(0));
-	int srid = PG_GETARG_INT32(1);
+	int32_t srid = PG_GETARG_INT32(1);
 	gserialized_set_srid(g, srid);
 	PG_RETURN_POINTER(g);
 }

Modified: trunk/postgis/lwgeom_sfcgal.c
===================================================================
--- trunk/postgis/lwgeom_sfcgal.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/lwgeom_sfcgal.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -103,7 +103,7 @@
 
 /* Conversion from SFCGAL::Geometry to GSERIALIZED */
 GSERIALIZED *
-SFCGALGeometry2POSTGIS(const sfcgal_geometry_t *geom, int force3D, int SRID)
+SFCGALGeometry2POSTGIS(const sfcgal_geometry_t *geom, int force3D, int32_t SRID)
 {
 	GSERIALIZED *result;
 	LWGEOM *lwgeom = SFCGAL2LWGEOM(geom, force3D, SRID);

Modified: trunk/postgis/lwgeom_sfcgal.h
===================================================================
--- trunk/postgis/lwgeom_sfcgal.h	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/lwgeom_sfcgal.h	2019-04-24 10:44:27 UTC (rev 17410)
@@ -31,7 +31,7 @@
 sfcgal_prepared_geometry_t *POSTGIS2SFCGALPreparedGeometry(GSERIALIZED *pglwgeom);
 
 /* Conversion from SFCGAL::Geometry to GSERIALIZED */
-GSERIALIZED *SFCGALGeometry2POSTGIS(const sfcgal_geometry_t *geom, int force3D, int SRID);
+GSERIALIZED *SFCGALGeometry2POSTGIS(const sfcgal_geometry_t *geom, int force3D, int32_t SRID);
 
 /* Conversion from SFCGAL::PreparedGeometry to GSERIALIZED */
 GSERIALIZED *SFCGALPreparedGeometry2POSTGIS(const sfcgal_prepared_geometry_t *geom, int force3D);

Modified: trunk/postgis/lwgeom_transform.c
===================================================================
--- trunk/postgis/lwgeom_transform.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/postgis/lwgeom_transform.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -176,8 +176,8 @@
 	const char *default_prefix = ""; /* default prefix */
 	char *prefixbuf;
 	const char *prefix = default_prefix;
-	int srid_from;
-	const int srid_to = 4326;
+	int32_t srid_from;
+	const int32_t srid_to = 4326;
 
 	/* Get the geometry */
 	GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P_COPY(0);

Modified: trunk/raster/loader/raster2pgsql.h
===================================================================
--- trunk/raster/loader/raster2pgsql.h	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/raster/loader/raster2pgsql.h	2019-04-24 10:44:27 UTC (rev 17410)
@@ -97,7 +97,7 @@
 	int quoteident;
 
 	/* SRID of input raster */
-	int srid;
+	int32_t srid;
 
 	/* SRID of output raster (reprojection) */
 	int out_srid;
@@ -163,7 +163,7 @@
 
 typedef struct rasterinfo_t {
 	/* SRID of raster */
-	int srid;
+	int32_t srid;
 
 	/* srs of raster */
 	char *srs;

Modified: trunk/raster/rt_core/rt_geometry.c
===================================================================
--- trunk/raster/rt_core/rt_geometry.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/raster/rt_core/rt_geometry.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -192,7 +192,7 @@
 	uint16_t trim[4] = {0}; /* top, right, bottom, left */
 	int isset[4] = {0};
 	double gt[6] = {0.0};
-	int srid = SRID_UNKNOWN;
+	int32_t srid = SRID_UNKNOWN;
 
 	POINTARRAY *pts = NULL;
 	POINT4D p4d;
@@ -612,7 +612,7 @@
     double scale_x, scale_y;
     double skew_x, skew_y;
     double ul_x, ul_y;
-    int srid;
+    int32_t srid;
     POINTARRAY **points;
     POINT4D p, p0;
     LWPOLY *poly;
@@ -669,7 +669,7 @@
 rt_errorstate
 rt_raster_get_envelope_geom(rt_raster raster, LWGEOM **env) {
 	double gt[6] = {0.0};
-	int srid = SRID_UNKNOWN;
+	int32_t srid = SRID_UNKNOWN;
 
 	POINTARRAY *pts = NULL;
 	POINT4D p4d;
@@ -802,7 +802,7 @@
 rt_errorstate
 rt_raster_get_convex_hull(rt_raster raster, LWGEOM **hull) {
 	double gt[6] = {0.0};
-	int srid = SRID_UNKNOWN;
+	int32_t srid = SRID_UNKNOWN;
 
 	POINTARRAY *pts = NULL;
 	POINT4D p4d;

Modified: trunk/raster/rt_pg/rtpg_create.c
===================================================================
--- trunk/raster/rt_pg/rtpg_create.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/raster/rt_pg/rtpg_create.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -947,7 +947,7 @@
 		struct {
 			rt_raster raster;
 			double gt[6];
-			int srid;
+			int32_t srid;
 			int width;
 			int height;
 		} raster;

Modified: trunk/raster/rt_pg/rtpg_gdal.c
===================================================================
--- trunk/raster/rt_pg/rtpg_gdal.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/raster/rt_pg/rtpg_gdal.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -65,7 +65,7 @@
 	int data_len = 0;
 	VSILFILE *vsifp = NULL;
 	GDALDatasetH hdsSrc;
-	int srid = -1; /* -1 for NULL */
+	int32_t srid = -1; /* -1 for NULL */
 
 	rt_pgraster *pgraster = NULL;
 	rt_raster raster;
@@ -155,7 +155,7 @@
 	char **options = NULL;
 	text *optiontext = NULL;
 	char *option = NULL;
-	int srid = SRID_UNKNOWN;
+	int32_t srid = SRID_UNKNOWN;
 	char *srs = NULL;
 
 	ArrayType *array;

Modified: trunk/raster/rt_pg/rtpg_geometry.c
===================================================================
--- trunk/raster/rt_pg/rtpg_geometry.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/raster/rt_pg/rtpg_geometry.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -782,7 +782,7 @@
 
 	uint32_t num_bands = 0;
 
-	int srid = SRID_UNKNOWN;
+	int32_t srid = SRID_UNKNOWN;
 	char *srs = NULL;
 
 	POSTGIS_RT_DEBUG(3, "RASTER_asRaster: Starting");

Modified: trunk/raster/rt_pg/rtpg_internal.c
===================================================================
--- trunk/raster/rt_pg/rtpg_internal.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/raster/rt_pg/rtpg_internal.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -278,8 +278,9 @@
 	return NULL;
 }
 
-char*
-rtpg_getSR(int srid) {
+char *
+rtpg_getSR(int32_t srid)
+{
 	int i = 0;
 	int len = 0;
 	char *sql = NULL;

Modified: trunk/raster/rt_pg/rtpg_internal.h
===================================================================
--- trunk/raster/rt_pg/rtpg_internal.h	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/raster/rt_pg/rtpg_internal.h	2019-04-24 10:44:27 UTC (rev 17410)
@@ -63,7 +63,6 @@
 char *
 rtpg_strrstr(const char *s1, const char *s2);
 
-char *
-rtpg_getSR(int srid);
+char *rtpg_getSR(int32_t srid);
 
 #endif /* RTPG_INTERNAL_H_INCLUDED */

Modified: trunk/raster/rt_pg/rtpg_mapalgebra.c
===================================================================
--- trunk/raster/rt_pg/rtpg_mapalgebra.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/raster/rt_pg/rtpg_mapalgebra.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -3014,7 +3014,7 @@
 	rt_pgraster *pgraster = NULL;
 	LWGEOM *rastgeom = NULL;
 	double gt[6] = {0};
-	int srid = SRID_UNKNOWN;
+	int32_t srid = SRID_UNKNOWN;
 
 	rt_pgraster *pgrtn = NULL;
 	rt_raster rtn = NULL;

Modified: trunk/raster/rt_pg/rtpg_pixel.c
===================================================================
--- trunk/raster/rt_pg/rtpg_pixel.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/raster/rt_pg/rtpg_pixel.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -1188,7 +1188,7 @@
 	int numbands = 0;
 	int width = 0;
 	int height = 0;
-	int srid = 0;
+	int32_t srid = 0;
 	double gt[6] = {0};
 
 	rt_pixtype pixtype = PT_END;

Modified: trunk/topology/postgis_topology.c
===================================================================
--- trunk/topology/postgis_topology.c	2019-04-24 10:04:42 UTC (rev 17409)
+++ trunk/topology/postgis_topology.c	2019-04-24 10:44:27 UTC (rev 17410)
@@ -83,7 +83,7 @@
   LWT_BE_DATA* be_data;
   char *name;
   int id;
-  int srid;
+  int32_t srid;
   double precision;
   int hasZ;
   Oid geometryOID;
@@ -124,7 +124,7 @@
 
 /* Return an lwalloc'ed geometrical representation of the box */
 static LWGEOM *
-_box2d_to_lwgeom(const GBOX *bbox, int srid)
+_box2d_to_lwgeom(const GBOX *bbox, int32_t srid)
 {
   POINTARRAY *pa = ptarray_construct(0, 0, 2);
   POINT4D p;
@@ -142,7 +142,7 @@
 
 /* Return lwalloc'ed hexwkb representation for a GBOX */
 static char *
-_box2d_to_hexwkb(const GBOX *bbox, int srid)
+_box2d_to_hexwkb(const GBOX *bbox, int32_t srid)
 {
   char *hex;
   size_t sz;
@@ -647,7 +647,7 @@
 
 /* Add face values for an insert, in text form */
 static void
-addFaceValues(StringInfo str, LWT_ISO_FACE *face, int srid)
+addFaceValues(StringInfo str, LWT_ISO_FACE *face, int32_t srid)
 {
   if ( face->face_id != -1 )
     appendStringInfo(str, "(%" LWTFMT_ELEMID, face->face_id);



More information about the postgis-tickets mailing list