* Return the length of the serialized form corresponding
* to this exploded structure.
*/
-extern uint32 lwexploded_findlength(LWGEOM_EXPLODED *exp, int wantbbox);
+extern size_t lwexploded_findlength(LWGEOM_EXPLODED *exp, int wantbbox);
// Serialize an LWGEOM_EXPLODED object.
// SRID and ndims will be taken from exploded structure.
// construct the empty geometry (GEOMETRYCOLLECTION(EMPTY))
extern char *lwgeom_constructempty(int SRID, char hasz, char hasm);
-extern void lwgeom_constructempty_buf(int SRID, char hasz, char hasm, char *buf, int *size);
-int lwgeom_empty_length(int SRID);
+extern void lwgeom_constructempty_buf(int SRID, char hasz, char hasm, char *buf, size_t *size);
+size_t lwgeom_empty_length(int SRID);
// get the SRID from the LWGEOM
// none present => -1
void
lwcollection_serialize_buf(LWCOLLECTION *coll, char *buf, size_t *retsize)
{
- int size=1; // type
- int subsize=0;
+ size_t size=1; // type
+ size_t subsize=0;
char hasSRID;
char *loc;
int i;
return result;
}
-int
+size_t
lwgeom_empty_length(int SRID)
{
int size = 5;
// construct the empty geometry (GEOMETRYCOLLECTION(EMPTY))
// writing it into the provided buffer.
void
-lwgeom_constructempty_buf(int SRID, char hasz, char hasm, char *buf, int *retsize)
+lwgeom_constructempty_buf(int SRID, char hasz, char hasm,
+ char *buf, size_t *retsize)
{
int ngeoms = 0;
char *
lwexploded_serialize(LWGEOM_EXPLODED *exploded, int wantbbox)
{
- int sizecom = 0;
- int size;
+ size_t sizecom = 0;
+ size_t size;
char *result;
size = lwexploded_findlength(exploded, wantbbox);
// Serialize points stripping BBOX and SRID if any
for (i=0; i<exploded->npoints; i++)
{
- int subsize;
+ size_t subsize;
point = lwpoint_deserialize(exploded->points[i]);
point->SRID = -1;
lwpoint_serialize_buf(point, loc, &subsize);
// Serialize lines stripping BBOX and SRID if any
for (i=0; i<exploded->nlines; i++)
{
- int subsize;
+ size_t subsize;
line = lwline_deserialize(exploded->lines[i]);
if ( line == NULL )
// Serialize polys stripping BBOX and SRID if any
for (i=0; i<exploded->npolys; i++)
{
- int subsize;
+ size_t subsize;
poly = lwpoly_deserialize(exploded->polys[i]);
if ( poly == NULL )
}
#endif
-uint32
+size_t
lwexploded_findlength(LWGEOM_EXPLODED *exploded, int wantbbox)
{
- uint32 size=0;
+ size_t size=0;
char ntypes=0;
uint32 i;
Datum LWGEOM_mem_size(PG_FUNCTION_ARGS)
{
PG_LWGEOM *geom = (PG_LWGEOM *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
- int32 size = geom->size;
- int32 computed_size = lwgeom_size(SERIALIZED_FORM(geom));
+ size_t size = geom->size;
+ size_t computed_size = lwgeom_size(SERIALIZED_FORM(geom));
computed_size += 4; // varlena size
if ( size != computed_size )
{
{
LWGEOM_INSPECTED *inspected;
int i;
- int totsize=0;
- int size=0;
+ size_t totsize=0;
+ size_t size=0;
int type;
LWPOINT *point = NULL;
LWLINE *line = NULL;
{
LWGEOM_INSPECTED *inspected;
int i,j,k;
- int totsize=0;
- int size=0;
+ size_t totsize=0;
+ size_t size=0;
int type;
LWPOINT *point = NULL;
LWLINE *line = NULL;
{
LWGEOM_INSPECTED *inspected;
int i,j,k;
- int totsize=0;
- int size=0;
+ size_t totsize=0;
+ size_t size=0;
int type;
unsigned char newtypefl;
LWPOINT *point = NULL;
{
LWGEOM_INSPECTED *inspected;
int i,j,k;
- int totsize=0;
- int size=0;
+ size_t totsize=0;
+ size_t size=0;
int type;
LWPOINT *point = NULL;
LWLINE *line = NULL;
{
PG_LWGEOM *geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
PG_LWGEOM *result;
- int32 size = 0;
+ size_t size = 0;
// already 2d
if ( lwgeom_ndims(geom->type) == 2 ) PG_RETURN_POINTER(geom);
PG_LWGEOM *geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
PG_LWGEOM *result;
int olddims;
- int32 size = 0;
+ size_t size = 0;
olddims = lwgeom_ndims(geom->type);
PG_LWGEOM *geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
PG_LWGEOM *result;
int olddims;
- int32 size = 0;
+ size_t size = 0;
olddims = lwgeom_ndims(geom->type);
PG_LWGEOM *geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
PG_LWGEOM *result;
int oldtype;
- int32 size = 0;
+ size_t size = 0;
char *iptr, *optr;
int32 nsubgeoms = 1;
PG_LWGEOM *geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
PG_LWGEOM *result;
int oldtype, newtype;
- int32 size = 0;
+ size_t size = 0;
char *iptr, *optr;
int32 nsubgeoms = 1;