Skip to content

Commit 9240dc8

Browse files
committed
graf2d/x11, graf3d/x3d: Remove K&R function definitions
Soon-to-be-released Clang 15 complains: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
1 parent 010d6aa commit 9240dc8

File tree

2 files changed

+28
-92
lines changed

2 files changed

+28
-92
lines changed

graf2d/x11/src/gifencode.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ static void put_short ARGS((int));
6060
* Return: size of GIF *
6161
* *
6262
***********************************************************************/
63-
long GIFencode(Width, Height, Ncol, R, G, B, ScLine, get_scline, pb)
64-
int Width, Height, Ncol;
65-
byte R[], G[], B[], ScLine[];
66-
void (*get_scline) ARGS((int, int, byte *)), (*pb) ARGS((byte));
63+
long GIFencode(int Width, int Height, int Ncol, byte R[], byte G[], byte B[], byte ScLine[],
64+
void(*get_scline) ARGS((int, int, byte *)), void(*pb) ARGS((byte)))
6765
{
6866
long CodeK;
6967
int ncol, i, x, y, disp, Code, K;
@@ -223,8 +221,7 @@ static unsigned long masks[] = { 0x0000,
223221
* Input: code - GIF code *
224222
* *
225223
***************************************************************/
226-
static void output(code)
227-
int code;
224+
static void output(int code)
228225
{
229226
/* O U T P U T C O D E */
230227

@@ -278,8 +275,7 @@ static void char_init()
278275
cur_bits = 0;
279276
}
280277

281-
static void char_out(c)
282-
int c;
278+
static void char_out(int c)
283279
{
284280
accum[a_count++] = c;
285281
if (a_count >= 254)
@@ -298,8 +294,7 @@ static void char_flush()
298294
a_count = 0;
299295
}
300296

301-
static void put_short(word)
302-
int word;
297+
static void put_short(int word)
303298
{
304299
put_byte(word & 0xFF);
305300
put_byte((word>>8) & 0xFF);

graf3d/x3d/src/x3d.c

Lines changed: 23 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ static int gRedDiv, gGreenDiv, gBlueDiv, gRedShift, gGreenShift, gBlueShift;
127127

128128

129129

130-
static void sort(list1, numPolys)
131-
polygon **list1;
132-
int numPolys;
130+
static void sort(polygon **list1, int numPolys)
133131
/*****************************************************************************
134132
Specialized quick sort for painter algorithm.
135133
*****************************************************************************/
@@ -276,9 +274,7 @@ point **Point, **lastPoint;
276274

277275

278276

279-
static void Rotate(points1, cx, cy, cz, sx, sy, sz)
280-
anglePoint *points1;
281-
double cx, cy, cz, sx, sy, sz;
277+
static void Rotate(anglePoint *points1, double cx, double cy, double cz, double sx, double sy, double sz)
282278
/******************************************************************************
283279
Rotate about Z, X, then Y, for two points.
284280
******************************************************************************/
@@ -306,8 +302,7 @@ double x, y, z, t;
306302

307303

308304

309-
static double DotProduct(x1, Y1, x2, y2)
310-
double x1, Y1, x2, y2;
305+
static double DotProduct(double x1, double Y1, double x2, double y2)
311306
/******************************************************************************
312307
Dot product (calculate the cosine of the angle between two vectors).
313308
******************************************************************************/
@@ -335,9 +330,7 @@ double temp;
335330

336331

337332

338-
static void CalculateAngles(X, Y, Z, X1, Y1, Z1)
339-
double *X, *Y, *Z;
340-
double X1, Y1, Z1;
333+
static void CalculateAngles(double *X, double *Y, double *Z, double X1, double Y1, double Z1)
341334
/******************************************************************************
342335
Calculate what the result of the angle changes of X1, Y1, and Z1 are
343336
in my weird coordinate system.
@@ -371,9 +364,7 @@ anglePoint points1[2];
371364

372365

373366

374-
static void DrawLogo(g, x, y)
375-
Ginfo *g;
376-
int x, y;
367+
static void DrawLogo(Ginfo *g, int x, int y)
377368
/******************************************************************************
378369
Display the Logo.
379370
******************************************************************************/
@@ -483,8 +474,7 @@ int hUnit, vUnit;
483474

484475

485476

486-
static void DisplayMenu(g)
487-
Ginfo *g;
477+
static void DisplayMenu(Ginfo *g)
488478
/******************************************************************************
489479
Display the help menu.
490480
******************************************************************************/
@@ -549,9 +539,7 @@ int x = 5, y = 5;
549539

550540

551541

552-
static void ResetPurpleRectangle(XL, YL, XH, YH, g)
553-
int XL, YL, XH, YH;
554-
Ginfo *g;
542+
static void ResetPurpleRectangle(int XL, int YL, int XH, int YH, Ginfo *g)
555543
/******************************************************************************
556544
Reset the vertices of the purple rectangle.
557545
******************************************************************************/
@@ -592,8 +580,7 @@ Ginfo *g;
592580

593581

594582

595-
static void OneBitSetColors(g)
596-
Ginfo *g;
583+
static void OneBitSetColors(Ginfo *g)
597584
/******************************************************************************
598585
Set up color information/stipples for a one bit display.
599586
******************************************************************************/
@@ -623,8 +610,7 @@ int numColors;
623610

624611

625612

626-
static void EightBitSetColors(g)
627-
Ginfo *g;
613+
static void EightBitSetColors(Ginfo *g)
628614
/******************************************************************************
629615
Set up color information/stipples for a eight bit display.
630616
******************************************************************************/
@@ -865,8 +851,7 @@ XColor c;
865851
}
866852

867853

868-
static void TrueColorSetColors(g)
869-
Ginfo *g;
854+
static void TrueColorSetColors(Ginfo *g)
870855
/******************************************************************************
871856
Set up color information/stipples for TrueColor displays.
872857
******************************************************************************/
@@ -930,10 +915,7 @@ int numColors;
930915
char title[80];
931916
Atom wm_protocols[2];
932917

933-
static void InitDisplay(o, g, parent)
934-
Oinfo *o;
935-
Ginfo *g;
936-
Window parent;
918+
static void InitDisplay(Oinfo *o, Ginfo *g, Window parent)
937919
/******************************************************************************
938920
Set up an X window and our colormap. We rely on X's own error handling and
939921
reporting for most bad X calls because X buffers requests.
@@ -1295,12 +1277,7 @@ static int CheckEvent(Display *display, XEvent *event, char *arg)
12951277

12961278

12971279

1298-
static void GetInput(xevent, pointerX, pointerY, command, same, g)
1299-
XEvent *xevent;
1300-
int *pointerX, *pointerY;
1301-
char *command;
1302-
int *same;
1303-
Ginfo *g;
1280+
static void GetInput(XEvent *xevent, int *pointerX, int *pointerY, char *command, int *same, Ginfo *g)
13041281
/******************************************************************************
13051282
Get an interesting event and update the user input information.
13061283
@@ -1465,11 +1442,7 @@ char string[TMPSTRLEN];
14651442

14661443
float deltaMove = 0;
14671444

1468-
static
1469-
int UpdatePosition(event, o, g)
1470-
XEvent *event;
1471-
Oinfo *o;
1472-
Ginfo *g;
1445+
static int UpdatePosition(XEvent *event, Oinfo *o, Ginfo *g)
14731446
/******************************************************************************
14741447
Update the scene position information using user input.
14751448
@@ -1654,10 +1627,7 @@ double X, Y, Z;
16541627

16551628

16561629

1657-
static int clipSegment(pX, pY, qX, qY, Pclip, Qclip, H, V)
1658-
float *pX, *pY, *qX, *qY;
1659-
int Pclip, Qclip;
1660-
float H,V;
1630+
static int clipSegment(float *pX, float *pY, float *qX, float *qY, int Pclip, int Qclip, float H, float V)
16611631
/******************************************************************************
16621632
Calculate the portion of the projected line segment that is visible.
16631633
******************************************************************************/
@@ -1866,9 +1836,7 @@ register float PX, PY, QX, QY, dx, dy;
18661836

18671837

18681838

1869-
static void clip(o, g)
1870-
Oinfo *o;
1871-
Ginfo *g;
1839+
static void clip(Oinfo *o, Ginfo *g)
18721840
/******************************************************************************
18731841
Clip a list of segments.
18741842
******************************************************************************/
@@ -2217,9 +2185,7 @@ long *redCol;
22172185

22182186

22192187

2220-
static void rotate(o, g)
2221-
Oinfo *o;
2222-
Ginfo *g;
2188+
static void rotate(Oinfo *o, Ginfo *g)
22232189
/******************************************************************************
22242190
Rotate, project, and set the clipping flags for a list of points.
22252191
******************************************************************************/
@@ -2413,13 +2379,7 @@ register short RX, BX;
24132379

24142380

24152381

2416-
static void DrawSegments(display, win, gc, segs1, numSegs, g)
2417-
Display *display;
2418-
Window win;
2419-
GC gc;
2420-
XSegment segs1[];
2421-
int numSegs;
2422-
Ginfo *g;
2382+
static void DrawSegments(Display *display, Window win, GC gc, XSegment segs1[], int numSegs, Ginfo *g)
24232383
/******************************************************************************
24242384
Thanks to Mark Cook for the suggestion to pay attention the the
24252385
maximum request size of the X server!
@@ -2444,10 +2404,7 @@ int requestSize, evenAmount, remainder1, index1;
24442404

24452405

24462406

2447-
static void DrawLines(o, g, mode)
2448-
Oinfo *o;
2449-
Ginfo *g;
2450-
int mode;
2407+
static void DrawLines(Oinfo *o, Ginfo *g, int mode)
24512408
/******************************************************************************
24522409
Draw lines for the three display modes.
24532410
******************************************************************************/
@@ -2522,10 +2479,7 @@ int lastChange, index1;
25222479

25232480

25242481

2525-
static void DrawHiddenLines(o, g, mode)
2526-
Oinfo *o;
2527-
Ginfo *g;
2528-
int mode;
2482+
static void DrawHiddenLines(Oinfo *o, Ginfo *g, int mode)
25292483
/******************************************************************************
25302484
Draw polygon outlines using painter algorithm for the three display modes.
25312485
******************************************************************************/
@@ -2674,10 +2628,7 @@ _XPoint points1[512], *XPointPtr;
26742628

26752629

26762630

2677-
static void DrawPolys(o, g, mode)
2678-
Oinfo *o;
2679-
Ginfo *g;
2680-
int mode;
2631+
static void DrawPolys(Oinfo *o, Ginfo *g, int mode)
26812632
/******************************************************************************
26822633
Draw polygons using painter algorithm for the three display modes.
26832634
******************************************************************************/
@@ -2872,9 +2823,7 @@ static void BeginImage(Oinfo *o, Ginfo *g)
28722823

28732824

28742825

2875-
static void DrawObject(o, g)
2876-
Oinfo *o;
2877-
Ginfo *g;
2826+
static void DrawObject(Oinfo *o, Ginfo *g)
28782827
/******************************************************************************
28792828
Draw an x3d objext to the screen. Be sure to draw the objects back to
28802829
front when calling this function.
@@ -2945,9 +2894,7 @@ Ginfo *g;
29452894

29462895

29472896

2948-
static void EndImage(o, g)
2949-
Oinfo *o;
2950-
Ginfo *g;
2897+
static void EndImage(Oinfo *o, Ginfo *g)
29512898
/******************************************************************************
29522899
Finish drawing x3d objects.
29532900
******************************************************************************/
@@ -3104,13 +3051,7 @@ void MakePolygonArray()
31043051
* main procedure *
31053052
* *
31063053
******************************************************************************/
3107-
unsigned long
3108-
x3d_main(longitude, latitude, psi, string, parent)
3109-
float *longitude;
3110-
float *latitude;
3111-
float *psi;
3112-
char *string;
3113-
Window parent;
3054+
unsigned long x3d_main(float *longitude, float *latitude, float *psi, char *string, Window parent)
31143055
{
31153056
Ginfo *g = NULL;
31163057
Oinfo *o = NULL;

0 commit comments

Comments
 (0)