tblHeader_pt handleTbl;
} GdData;
-static int tclGdCreateCmd(), tclGdDestroyCmd(), tclGdWriteCmd(),
-tclGdColorCmd(), tclGdInterlaceCmd(), tclGdSetCmd(), tclGdLineCmd(),
-tclGdRectCmd(), tclGdArcCmd(), tclGdFillCmd(), tclGdSizeCmd(),
-tclGdTextCmd(), tclGdCopyCmd(), tclGdGetCmd(),
-tclGdBrushCmd(), tclGdStyleCmd(), tclGdTileCmd(), tclGdPolygonCmd(),
-tclGdColorNewCmd(), tclGdColorExactCmd(), tclGdColorClosestCmd(),
-tclGdColorResolveCmd(), tclGdColorFreeCmd(), tclGdColorTranspCmd(),
-tclGdColorGetCmd(), tclGdWriteBufCmd();
+typedef int (CmdFunc)(Tcl_Interp *, GdData *, int, Tcl_Obj *CONST []);
+typedef int (ColCmdFunc)(Tcl_Interp *, gdImagePtr, int, int[]);
+
+static CmdFunc tclGdCreateCmd;
+static CmdFunc tclGdDestroyCmd;
+static CmdFunc tclGdWriteCmd;
+static CmdFunc tclGdColorCmd;
+static CmdFunc tclGdInterlaceCmd;
+static CmdFunc tclGdSetCmd;
+static CmdFunc tclGdLineCmd;
+static CmdFunc tclGdRectCmd;
+static CmdFunc tclGdArcCmd;
+static CmdFunc tclGdFillCmd;
+static CmdFunc tclGdSizeCmd;
+static CmdFunc tclGdTextCmd;
+static CmdFunc tclGdCopyCmd;
+static CmdFunc tclGdGetCmd;
+static CmdFunc tclGdBrushCmd;
+static CmdFunc tclGdStyleCmd;
+static CmdFunc tclGdTileCmd;
+static CmdFunc tclGdPolygonCmd;
+static CmdFunc tclGdWriteBufCmd;
+
+static ColCmdFunc tclGdColorNewCmd;
+static ColCmdFunc tclGdColorExactCmd;
+static ColCmdFunc tclGdColorClosestCmd;
+static ColCmdFunc tclGdColorResolveCmd;
+static ColCmdFunc tclGdColorFreeCmd;
+static ColCmdFunc tclGdColorTranspCmd;
+static ColCmdFunc tclGdColorGetCmd;
typedef struct {
char *cmd;
- int (*f) ();
+ CmdFunc *f;
int minargs, maxargs;
int subcmds;
int ishandle;
char *usage;
} cmdOptions;
+typedef struct {
+ char *cmd;
+ ColCmdFunc *f;
+ int minargs, maxargs;
+ int subcmds;
+ int ishandle;
+ char *usage;
+} colCmdOptions;
+
typedef struct {
char *buf;
int buflen;
"gdhandle"},
};
-static cmdOptions colorCmdVec[] = {
+static colCmdOptions colorCmdVec[] = {
{"new", tclGdColorNewCmd, 5, 5, 1, 1,
"gdhandle red green blue"},
{"exact", tclGdColorExactCmd, 5, 5, 1, 1,
void find_intersection(struct vertex *l, struct vertex *m,
struct intersection ilist[], struct data *input);
+static int gt(struct vertex **i, struct vertex **j);
void find_ints(vertex_list, polygon_list, input, ilist)
struct vertex vertex_list[];
struct data *input;
struct intersection ilist[];
{
- int i, j, k, gt();
+ int i, j, k;
struct active_edge_list all;
struct active_edge *new, *tempa;
struct vertex *pt1, *pt2, *templ, **pvertex;
pvertex[i] = vertex_list + i;
/* sort vertices by x coordinate */
- qsort(pvertex, input->nvertices, sizeof(struct vertex *), gt);
+ qsort(pvertex, input->nvertices, sizeof(struct vertex *),
+ (int (*)(const void *, const void *))gt);
/* walk through the vertices in order of increasing x coordinate */
for (i = 0; i < input->nvertices; i++) {
} /* end i for loop */
}
-int gt(i, j)
-struct vertex **i, **j;
+static int gt(struct vertex **i, struct vertex **j)
{ /* i > j if i.x > j.x or i.x = j.x and i.y > j.y */
double t;
if ((t = (*i)->pos.x - (*j)->pos.x) != 0.)