Commit 5603cdfa authored by Mark Cave-Ayland's avatar Mark Cave-Ayland
Browse files

Since PGXS compiles libraries with -Wall, attempt to remove as many warnings...

Since PGXS compiles libraries with -Wall, attempt to remove as many warnings as possible. Most of these are missing function prototypes at the top of each file.

git-svn-id: http://svn.osgeo.org/postgis/trunk@2781 b70326c6-7e19-0410-871a-916f4a2858ee
parent cfcdf664
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -912,6 +912,7 @@ extern float nextUp_f(double d);
extern double nextDown_d(float d);
extern double nextUp_d(float d);

extern float nextafterf_custom(float x, float y);


#define LW_MAX(a,b)	((a) >	(b) ? (a) : (b))
@@ -1070,6 +1071,7 @@ extern int32 lwgeom_nrings_recursive(uchar *serialized);
extern void ptarray_reverse(POINTARRAY *pa);
extern POINTARRAY *ptarray_substring(POINTARRAY *, double, double);
extern double ptarray_locate_point(POINTARRAY *, POINT2D *);
extern void closest_point_on_segment(POINT2D *p, POINT2D *A, POINT2D *B, POINT2D *ret);

/*
 * Ensure every segment is at most 'dist' long.
@@ -1163,6 +1165,10 @@ typedef struct
 * LWCURVE functions
 ******************************************************************/

/* Casts LWGEOM->LW* (return NULL if cast is illegal) */
extern LWCURVE *lwgeom_as_lwcurve(LWGEOM *lwgeom);


LWCURVE *lwcurve_construct(int SRID, BOX2DFLOAT4 *bbox, POINTARRAY *points);

/*
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
#define ABORT_ON_AUTH_FAILURE 1

Datum check_authorization(PG_FUNCTION_ARGS);
Datum getTransactionID(PG_FUNCTION_ARGS);

/*
 * This trigger will check for authorization before
+762 −750
Original line number Diff line number Diff line
@@ -18,6 +18,18 @@
#include <math.h>
#include "liblwgeom.h"

BOX3D *lwcircle_compute_box3d(POINT4D *p1, POINT4D *p2, POINT4D *p3);
void printLWCURVE(LWCURVE *curve);
void lwcurve_reverse(LWCURVE *curve);
LWCURVE *lwcurve_segmentize2d(LWCURVE *curve, double dist);
char lwcurve_same(const LWCURVE *me, const LWCURVE *you);
LWCURVE *lwcurve_from_lwpointarray(int SRID, unsigned int npoints, LWPOINT **points);
LWCURVE *lwcurve_from_lwmpoint(int SRID, LWMPOINT *mpoint);
LWCURVE *lwcurve_addpoint(LWCURVE *curve, LWPOINT *point, unsigned int where);
LWCURVE *lwcurve_removepoint(LWCURVE *curve, unsigned int index);
void lwcurve_setPoint4d(LWCURVE *curve, unsigned int index, POINT4D *newpoint);


/*#define PGIS_DEBUG_CALLS 1 */
/*#define PGIS_DEBUG 1 */

+3 −0
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@
#include "liblwgeom.h"


void box_to_box2df(BOX *box, BOX2DFLOAT4 *out);



/* convert postgresql BOX to BOX2D */
void
+44 −15
Original line number Diff line number Diff line
@@ -18,10 +18,47 @@
/* Define this to debug CHIP ops */
/*#define DEBUG_CHIP 1*/

typedef unsigned short int UINT16;
typedef float FLOAT32;

typedef struct PIXEL_T {
	int type; /* 1=float32, 5=int24, 6=int16 */
	uchar val[4];
} PIXEL;

typedef struct RGB_T {
	uchar red;
	uchar green;
	uchar blue;
} RGB;


/* Internal funcs */
void swap_char(char *a,char *b);
void flip_endian_double(char *d);
void flip_endian_int32(char *i);
const char* pixelOpName(int op);
const char* pixelHEX(PIXEL* p);
UINT16 pixel_readUINT16(PIXEL *p);
void pixel_writeUINT16(PIXEL *p, UINT16 i);
PIXEL pixel_readval(char *buf);
void pixel_writeval(PIXEL *p, char *buf, size_t maxlen);
void pixel_add_float32(PIXEL *where, PIXEL *what);
void pixel_add_int24(PIXEL *where, PIXEL *what);
void pixel_add_int16(PIXEL *where, PIXEL *what);
void pixel_add(PIXEL *where, PIXEL *what);
size_t chip_xy_off(CHIP *c, size_t x, size_t y);
void chip_setPixel(CHIP *c, int x, int y, PIXEL *p);
PIXEL chip_getPixel(CHIP *c, int x, int y);
void chip_draw_pixel(CHIP *chip, int x, int y, PIXEL *pixel, int op);
void chip_draw_segment(CHIP *chip, int x1, int y1, int x2, int y2, PIXEL *pixel, int op);
void chip_fill(CHIP *chip, PIXEL *pixel, int op);
CHIP * pgchip_construct(BOX3D *bvol, int SRID, int width, int height, int datatype, PIXEL *initvalue);
void chip_draw_ptarray(CHIP *chip, POINTARRAY *pa, PIXEL *pixel, int op);
void chip_draw_lwpoint(CHIP *chip, LWPOINT *lwpoint, PIXEL* pixel, int op);
void chip_draw_lwline(CHIP *chip, LWLINE *lwline, PIXEL* pixel, int op);
void chip_draw_lwgeom(CHIP *chip, LWGEOM *lwgeom, PIXEL *pixel, int op);
char * text_to_cstring(text *t);


/* Prototypes */
@@ -36,6 +73,13 @@ Datum CHIP_getCompression(PG_FUNCTION_ARGS);
Datum CHIP_getHeight(PG_FUNCTION_ARGS);
Datum CHIP_getWidth(PG_FUNCTION_ARGS);
Datum CHIP_setSRID(PG_FUNCTION_ARGS);
Datum CHIP_send(PG_FUNCTION_ARGS);
Datum CHIP_dump(PG_FUNCTION_ARGS);
Datum CHIP_construct(PG_FUNCTION_ARGS);
Datum CHIP_getpixel(PG_FUNCTION_ARGS);
Datum CHIP_setpixel(PG_FUNCTION_ARGS);
Datum CHIP_draw(PG_FUNCTION_ARGS);
Datum CHIP_fill(PG_FUNCTION_ARGS);


/*
@@ -355,21 +399,6 @@ pixelOpName(int op)
	return pixelop_name[op];
}


typedef struct RGB_T {
	uchar red;
	uchar green;
	uchar blue;
} RGB;

typedef unsigned short int UINT16;
typedef float FLOAT32;

typedef struct PIXEL_T {
	int type; /* 1=float32, 5=int24, 6=int16 */
	uchar val[4];
} PIXEL;

const char*
pixelHEX(PIXEL* p)
{
Loading