Commit a8eae3ad authored by Raúl Marín's avatar Raúl Marín

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



git-svn-id: http://svn.osgeo.org/postgis/trunk@17410 b70326c6-7e19-0410-871a-916f4a2858ee
parent 9eabe722
Pipeline #58152600 passed with stage
in 23 minutes and 12 seconds
......@@ -1549,7 +1549,7 @@ static void test_lwpoly_construct_circle(void)
{
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;
......
......@@ -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 @@ static void test_lwline_from_lwmpoint(void)
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);
......
......@@ -218,10 +218,10 @@ typedef enum LWORD_T {
* 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 @@ LWCOLLECTION* lwcollection_extract(LWCOLLECTION *col, int type);
* 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 @@ extern POINTARRAY *ptarray_clone_deep(const POINTARRAY *ptarray);
* 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 */
......
......@@ -156,10 +156,7 @@ typedef struct LWT_BE_CALLBACKS_T {
* @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 @@ typedef struct LWT_TOPOLOGY_T LWT_TOPOLOGY;
* @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
......
......@@ -92,7 +92,7 @@ struct LWT_TOPOLOGY_T
{
const LWT_BE_IFACE *be_iface;
LWT_BE_TOPOLOGY *be_topo;
int srid;
int32_t srid;
double precision;
int hasZ;
};
......
......@@ -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 @@ void lwcircstring_setPoint4d(LWCIRCSTRING *curve, uint32_t index, POINT4D *newpo
* 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_construct(int srid, GBOX *bbox, POINTARRAY *points)
}
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_same(const LWCIRCSTRING *me, const LWCIRCSTRING *you)
* 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 @@ lwcircstring_from_lwpointarray(int srid, uint32_t npoints, LWPOINT **points)
* 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;
......
......@@ -38,10 +38,8 @@ lwcollection_release(LWCOLLECTION *lwcollection)
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_construct(uint8_t type, int srid, GBOX *bbox,
}
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) )
......
......@@ -120,7 +120,7 @@ int lwcompound_add_lwgeom(LWCOMPOUND *comp, LWGEOM *geom)
}
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;
......
......@@ -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;
......
......@@ -406,7 +406,7 @@ lwgeom_as_curve(const LWGEOM *lwgeom)
/*
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_scale(LWGEOM *geom, const POINT4D *factor)
}
}
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)
{
......
......@@ -1462,7 +1462,7 @@ lwpoly_to_points(const LWPOLY* lwpoly, uint32_t npoints, int32_t seed)
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 @@ lwgeom_voronoi_diagram(const LWGEOM* g, const GBOX* env, double tolerance, int o
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;
......
......@@ -275,7 +275,7 @@ ptarray_to_SFCGAL(const POINTARRAY *pa, int type)
* 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;
......
......@@ -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);
......
......@@ -40,7 +40,7 @@ typedef struct
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? */
......
......@@ -62,12 +62,12 @@ int wkt_lexer_read_srid(char *str)
{
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 @@ LWGEOM* wkt_parser_collection_finalize(int lwtype, LWGEOM *geom, char *dimension
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);
......
......@@ -56,7 +56,7 @@ extern int wkt_yylex_destroy(void);
/*
* 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_compound_add_geom(LWGEOM *col, LWGEOM *geom);
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);
......@@ -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_construct(int srid, GBOX *bbox, POINTARRAY *points)
}
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_same(const LWLINE *l1, const LWLINE *l2)
* 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_from_lwgeom_array(int srid, uint32_t ngeoms, LWGEOM **geoms)
* 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 @@ lwline_from_ptarray(int srid, uint32_t npoints, LWPOINT **points)
* 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;
......
......@@ -35,7 +35,7 @@ lwmline_release(LWMLINE *lwmline)
}
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;
......
......@@ -36,7 +36,7 @@ lwmpoint_release(LWMPOINT *lwmpoint)
}
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_add_lwpoint(LWMPOINT *mobj, const LWPOINT *obj)
}
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);
......
......@@ -37,7 +37,7 @@ lwmpoly_release(LWMPOLY *lwmpoly)
}
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;
......
......@@ -126,7 +126,7 @@ lwpoint_get_m(const LWPOINT *point)
* 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_construct(int srid, GBOX *bbox, POINTARRAY *point)
}
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_construct_empty(int srid, char hasz, char hasm)
}
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_make2d(int srid, double x, double y)
}
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_make3dz(int srid, double x, double y, double z)
}
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_make3dm(int srid, double x, double y, double m)
}
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_make4d(int srid, double x, double y, double z, double m)
}
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);
......
......@@ -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_construct_rectangle(char hasz, char hasm, POINT4D *p1, POINT4D *p2,
}
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 @@ lwpoly_construct_envelope(int srid, double x1, double y1, double x2, double y2)
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 @@ lwpoly_construct_circle(int srid, double x, double y, double radius, uint32_t se
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 @@ lwpoly_from_lwlines(const LWLINE *shell,
{
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 )
......
......@@ -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 @@ static int pt_continues_arc(const POINT4D *a1, const POINT4D *a2, const POINT4D
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 @@ linestring_from_pa(const POINTARRAY *pa, int srid, int start, int end)
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 @@ circstring_from_pa(const POINTARRAY *pa, int srid, int start, int end)
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 @@ geom_from_pa(const POINTARRAY *pa, int srid, int is_arc, int start, int end)
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;
......
......@@ -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 @@ lwtriangle_construct(int srid, GBOX *bbox, POINTARRAY *points)
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;
......
......@@ -340,9 +340,8 @@ getMachineEndian(void)
*/
}
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 @@ error_if_srid_mismatch(int srid1, int srid2)
}
}
int
clamp_srid(int srid)
int32_t
clamp_srid(int32_t srid)
{
int newsrid = srid;
......
......@@ -81,7 +81,7 @@ lw_dist2d_distpts_init(DISTPTS *dl, int mode)
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 @@ lw_dist2d_distanceline(const LWGEOM *lw1, const LWGEOM *lw2, int srid, int mode)
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;
......
......@@ -124,7 +124,7 @@ double lw_arc_length(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3);
/*
* 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
......@@ -56,7 +56,7 @@ geometries lacks z-values. The vertical line crosses the 2d point that is closes
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 @@ lwgeom_closest_point_3d(const LWGEOM *lw1, const LWGEOM *lw2)
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 @@ lw_dist3d_distanceline(const LWGEOM *lw1, const LWGEOM *lw2, int srid, int mode)
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;
......
......@@ -61,8 +61,8 @@ typedef struct
/*
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);
/*