[postgis-tickets] r17591 - gserialized: Style changes

Raul raul at rmr.ninja
Fri Jul 12 08:57:15 PDT 2019


Author: algunenano
Date: 2019-07-12 08:57:14 -0700 (Fri, 12 Jul 2019)
New Revision: 17591

Modified:
   trunk/liblwgeom/gserialized.h
   trunk/liblwgeom/gserialized1.c
   trunk/liblwgeom/gserialized2.c
Log:
gserialized: Style changes

References #4449


Modified: trunk/liblwgeom/gserialized.h
===================================================================
--- trunk/liblwgeom/gserialized.h	2019-07-10 22:49:56 UTC (rev 17590)
+++ trunk/liblwgeom/gserialized.h	2019-07-12 15:57:14 UTC (rev 17591)
@@ -62,13 +62,13 @@
 * Extract the geometry type from the serialized form (it hides in
 * the anonymous data area, so this is a handy function).
 */
-extern uint32_t gserialized_get_type(const GSERIALIZED *g);
+uint32_t gserialized_get_type(const GSERIALIZED *g);
 
 /**
 * Returns the size in bytes to read from toast to get the basic
 * information from a geometry: GSERIALIZED struct, bbox and type
 */
-extern uint32_t gserialized_max_header_size(void);
+uint32_t gserialized_max_header_size(void);
 
 /**
 * Returns a hash code for the srid/type/geometry information
@@ -75,19 +75,19 @@
 * in the GSERIALIZED. Ignores metadata like flags and optional
 * boxes, etc.
 */
-extern int32_t gserialized_hash(const GSERIALIZED *g);
+int32_t gserialized_hash(const GSERIALIZED *g);
 
 /**
 * Extract the SRID from the serialized form (it is packed into
 * three bytes so this is a handy function).
 */
-extern int32_t gserialized_get_srid(const GSERIALIZED *g);
+int32_t gserialized_get_srid(const GSERIALIZED *g);
 
 /**
 * Write the SRID into the serialized form (it is packed into
 * three bytes so this is a handy function).
 */
-extern void gserialized_set_srid(GSERIALIZED *g, int32_t srid);
+void gserialized_set_srid(GSERIALIZED *g, int32_t srid);
 
 /**
 * Check if a #GSERIALIZED is empty without deserializing first.
@@ -95,32 +95,32 @@
 * is zero, will not catch collections of empty, eg:
 * GEOMETRYCOLLECTION(POINT EMPTY)
 */
-extern int gserialized_is_empty(const GSERIALIZED *g);
+int gserialized_is_empty(const GSERIALIZED *g);
 
 /**
 * Check if a #GSERIALIZED has a bounding box without deserializing first.
 */
-extern int gserialized_has_bbox(const GSERIALIZED *gser);
+int gserialized_has_bbox(const GSERIALIZED *gser);
 
 /**
 * Check if a #GSERIALIZED has a Z ordinate.
 */
-extern int gserialized_has_z(const GSERIALIZED *gser);
+int gserialized_has_z(const GSERIALIZED *gser);
 
 /**
 * Check if a #GSERIALIZED has an M ordinate.
 */
-extern int gserialized_has_m(const GSERIALIZED *gser);
+int gserialized_has_m(const GSERIALIZED *gser);
 
 /**
 * Check if a #GSERIALIZED is a geography.
 */
-extern int gserialized_is_geodetic(const GSERIALIZED *gser);
+int gserialized_is_geodetic(const GSERIALIZED *gser);
 
 /**
 * Return the number of dimensions (2, 3, 4) in a geometry
 */
-extern int gserialized_ndims(const GSERIALIZED *gser);
+int gserialized_ndims(const GSERIALIZED *gser);
 
 /**
 * Return -1 if g1 is "less than" g2, 1 if g1 is "greater than"
@@ -131,7 +131,7 @@
 * are evaluated by calculating a sortable key from the center
 * point of the object bounds.
 */
-extern int gserialized_cmp(const GSERIALIZED *g1, const GSERIALIZED *g2);
+int gserialized_cmp(const GSERIALIZED *g1, const GSERIALIZED *g2);
 
 /**
 * Allocate a new #GSERIALIZED from an #LWGEOM. For all non-point types, a bounding
@@ -140,18 +140,18 @@
 * will contain the size of the final output, which is useful for setting the PgSQL
 * VARSIZE information.
 */
-extern GSERIALIZED* gserialized_from_lwgeom(LWGEOM *geom, size_t *size);
+GSERIALIZED *gserialized_from_lwgeom(LWGEOM *geom, size_t *size);
 
 /**
 * Return the memory size a GSERIALIZED will occupy for a given LWGEOM.
 */
-extern size_t gserialized_from_lwgeom_size(const LWGEOM *geom);
+size_t gserialized_from_lwgeom_size(const LWGEOM *geom);
 
 /**
 * Allocate a new #LWGEOM from a #GSERIALIZED. The resulting #LWGEOM will have coordinates
 * that are double aligned and suitable for direct reading using getPoint2d_p_ro
 */
-extern LWGEOM* lwgeom_from_gserialized(const GSERIALIZED *g);
+LWGEOM *lwgeom_from_gserialized(const GSERIALIZED *g);
 
 /**
 * Pull a #GBOX from the header of a #GSERIALIZED, if one is available. If
@@ -158,11 +158,11 @@
 * it is not, calculate it from the geometry. If that doesn't work (null
 * or empty) return LW_FAILURE.
 */
-extern int gserialized_get_gbox_p(const GSERIALIZED *g, GBOX *box);
+int gserialized_get_gbox_p(const GSERIALIZED *g, GBOX *box);
 
 /**
 * Pull a #GBOX from the header of a #GSERIALIZED, if one is available. If
 * it is not, return LW_FAILURE.
 */
-extern int gserialized_fast_gbox_p(const GSERIALIZED *g, GBOX *box);
+int gserialized_fast_gbox_p(const GSERIALIZED *g, GBOX *box);
 

Modified: trunk/liblwgeom/gserialized1.c
===================================================================
--- trunk/liblwgeom/gserialized1.c	2019-07-10 22:49:56 UTC (rev 17590)
+++ trunk/liblwgeom/gserialized1.c	2019-07-12 15:57:14 UTC (rev 17591)
@@ -312,7 +312,7 @@
 		double *dptr = (double*)(g->data);
 
 		/* Read the empty flag */
-		int *iptr = (int*)(g->data);
+		int32_t *iptr = (int32_t *)(g->data);
 		int isempty = (iptr[1] == 0);
 
 		/* EMPTY point has no box */
@@ -338,7 +338,7 @@
 		int ndims = G1FLAGS_NDIMS(g->gflags);
 		int i = 0; /* Start at <linetype><npoints> */
 		double *dptr = (double*)(g->data);
-		int *iptr = (int*)(g->data);
+		int32_t *iptr = (int32_t *)(g->data);
 		int npoints = iptr[1]; /* Read the npoints */
 
 		/* This only works with 2-point lines */
@@ -379,7 +379,7 @@
 	{
 		int i = 0; /* Start at <multipointtype><ngeoms> */
 		double *dptr = (double*)(g->data);
-		int *iptr = (int*)(g->data);
+		int32_t *iptr = (int32_t *)(g->data);
 		int ngeoms = iptr[1]; /* Read the ngeoms */
 		int npoints;
 
@@ -421,7 +421,7 @@
 		int ndims = G1FLAGS_NDIMS(g->gflags);
 		int i = 0; /* Start at <multilinetype><ngeoms> */
 		double *dptr = (double*)(g->data);
-		int *iptr = (int*)(g->data);
+		int32_t *iptr = (int32_t *)(g->data);
 		int ngeoms = iptr[1]; /* Read the ngeoms */
 		int npoints;
 

Modified: trunk/liblwgeom/gserialized2.c
===================================================================
--- trunk/liblwgeom/gserialized2.c	2019-07-10 22:49:56 UTC (rev 17590)
+++ trunk/liblwgeom/gserialized2.c	2019-07-12 15:57:14 UTC (rev 17591)
@@ -1481,7 +1481,6 @@
 	/* Skip optional flags */
 	if (G2FLAGS_GET_EXTENDED(g->gflags))
 	{
-		/* uint64_t xflags = *((uint64_t*)data_ptr); */
 		data_ptr += sizeof(uint64_t);
 	}
 
@@ -1632,5 +1631,4 @@
 	}
 
 	return g_out;
-}
-
+}
\ No newline at end of file



More information about the postgis-tickets mailing list