From ed1b1a82a4c76afebae0bccbd449e0271ddaa4c7 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Wed, 5 Mar 2008 14:26:30 -0300 Subject: [PATCH] Ansify liboldX. Also added missing prototypes to X10.h. --- include/X11/X10.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- src/XCrAssoc.c | 3 +-- src/XDelAssoc.c | 8 ++++---- src/XDestAssoc.c | 3 +-- src/XDraw.c | 34 +++++++++++++++++----------------- src/XLookAssoc.c | 8 ++++---- src/XMakeAssoc.c | 10 +++++----- 7 files changed, 79 insertions(+), 36 deletions(-) diff --git a/include/X11/X10.h b/include/X11/X10.h index afdb80d..863a8f2 100644 --- a/include/X11/X10.h +++ b/include/X11/X10.h @@ -83,7 +83,52 @@ typedef struct { int size; /* Table size (number of buckets). */ } XAssocTable; -XAssocTable *XCreateAssocTable(); -char *XLookUpAssoc(); +_XFUNCPROTOBEGIN + +extern XAssocTable * +XCreateAssocTable( + int /* size */ +); + +extern int XMakeAssoc( + Display * /* dpy */, + XAssocTable * /* table */, + XID /* x_id */, + XPointer /* data */ +); + +extern char *XLookUpAssoc( + Display * /* dpy */, + XAssocTable * /* table */, + XID /* x_id */ +); + +extern int XDeleteAssoc( + Display * /* dpy */, + XAssocTable * /* table */, + XID /* x_id */ +); + +extern int XDestroyAssocTable( + XAssocTable * /* table */ +); + +extern Status XDraw ( + Display * /* dpy */, + Drawable /* d */, + GC /* gc */, + Vertex * /* vlist */, + int /* vcount */ +); + +extern Status XDrawFilled ( + Display * /* dpy */, + Drawable /* d */, + GC /* gc */, + Vertex * /* vlist */, + int /* vcount */ +); + +_XFUNCPROTOEND #endif /* _X10_H_ */ diff --git a/src/XCrAssoc.c b/src/XCrAssoc.c index d36e952..d75be11 100644 --- a/src/XCrAssoc.c +++ b/src/XCrAssoc.c @@ -38,8 +38,7 @@ in this Software without prior written authorization from The Open Group. * buckets is 8. If there is an error creating the XAssocTable, a NULL * pointer is returned. */ -XAssocTable *XCreateAssocTable(size) - register int size; /* Desired size of the table. */ +XAssocTable *XCreateAssocTable(register int size)/* Desired size of the table. */ { register XAssocTable *table; /* XAssocTable to be initialized. */ register XAssoc *buckets; /* Pointer to the first bucket in */ diff --git a/src/XDelAssoc.c b/src/XDelAssoc.c index e7c4b75..104afe5 100644 --- a/src/XDelAssoc.c +++ b/src/XDelAssoc.c @@ -38,10 +38,10 @@ in this Software without prior written authorization from The Open Group. * deletes are meaningless (but cause no problems). */ int -XDeleteAssoc(dpy, table, x_id) - register Display *dpy; - register XAssocTable *table; - register XID x_id; +XDeleteAssoc( + register Display *dpy, + register XAssocTable *table, + register XID x_id) { int hash; register XAssoc *bucket; diff --git a/src/XDestAssoc.c b/src/XDestAssoc.c index 672ac23..2ad7449 100644 --- a/src/XDestAssoc.c +++ b/src/XDestAssoc.c @@ -37,8 +37,7 @@ in this Software without prior written authorization from The Open Group. * an XAssocTable. */ int -XDestroyAssocTable(table) - register XAssocTable *table; +XDestroyAssocTable(register XAssocTable *table) { register int i; register XAssoc *bucket; diff --git a/src/XDraw.c b/src/XDraw.c index 3eeff3e..06c3652 100644 --- a/src/XDraw.c +++ b/src/XDraw.c @@ -202,11 +202,11 @@ static short segtable[] = { 10, 3, 56, /* pl <= 10, 3 segments */ * */ -static int vertices_converter(pathaddr, pathcount, ppathaddr_new, newpathcnt) - Vertex *pathaddr; /* address of original path list */ - int pathcount; /* number of points in original path list */ - Vertex **ppathaddr_new; /* ptr to addr of new path list */ - int *newpathcnt; /* ptr to new number of pts in path list */ +static int vertices_converter( + Vertex *pathaddr, /* address of original path list */ + int pathcount, /* number of points in original path list */ + Vertex **ppathaddr_new,/* ptr to addr of new path list */ + int *newpathcnt) /* ptr to new number of pts in path list */ { int p0x, p0y; /* coordinates of curve's predecessor point */ int p1x, p1y; /* coordinates of curve's starting point */ @@ -554,12 +554,12 @@ static int vertices_converter(pathaddr, pathcount, ppathaddr_new, newpathcnt) static XPoint *XDraw_points = NULL; /* Buffer to hold list of points for */ static int point_count = 0; /* use in calling XDrawLines */ -Status XDraw (dpy, d, gc, vlist, vcount) - register Display *dpy; - Drawable d; - GC gc; - Vertex *vlist; - int vcount; +Status XDraw ( + register Display *dpy, + Drawable d, + GC gc, + Vertex *vlist, + int vcount) { Vertex *newvlist; int newvcount; @@ -631,12 +631,12 @@ Status XDraw (dpy, d, gc, vlist, vcount) return(OK_RETURN); } -Status XDrawFilled (dpy, d, gc, vlist, vcount) - register Display *dpy; - Drawable d; - GC gc; - Vertex *vlist; - int vcount; +Status XDrawFilled ( + register Display *dpy, + Drawable d, + GC gc, + Vertex *vlist, + int vcount) { Vertex *newvlist; int newvcount; diff --git a/src/XLookAssoc.c b/src/XLookAssoc.c index fe150c9..b44f9cc 100644 --- a/src/XLookAssoc.c +++ b/src/XLookAssoc.c @@ -38,10 +38,10 @@ in this Software without prior written authorization from The Open Group. * in the table the routine will return a NULL pointer. All XId's are relative * to the currently active Display. */ -XPointer XLookUpAssoc(dpy, table, x_id) - register Display *dpy; - register XAssocTable *table; /* XAssocTable to search in. */ - register XID x_id; /* XId to search for. */ +XPointer XLookUpAssoc( + register Display *dpy, + register XAssocTable *table, /* XAssocTable to search in. */ + register XID x_id) /* XId to search for. */ { int hash; register XAssoc *bucket; diff --git a/src/XMakeAssoc.c b/src/XMakeAssoc.c index 40b3562..69024c4 100644 --- a/src/XMakeAssoc.c +++ b/src/XMakeAssoc.c @@ -39,11 +39,11 @@ in this Software without prior written authorization from The Open Group. * bucket is sorted (lowest XId to highest XId). */ int -XMakeAssoc(dpy, table, x_id, data) - register Display *dpy; - register XAssocTable *table; - register XID x_id; - register XPointer data; +XMakeAssoc( + register Display *dpy, + register XAssocTable *table, + register XID x_id, + register XPointer data) { int hash; register XAssoc *bucket; -- 1.5.4.3