Commit 0b7b4993 authored by Bernhard Link's avatar Bernhard Link

get rid of core K&R, use gnulib's _GL_UNUSED and avoid some signed/unsigned comparisons

This significantly reduces the number of warnings if requesting a
slightly bigger set of warnings.
parent da4c7df1
......@@ -277,14 +277,8 @@ PrintBox (box, level)
* Returns: none.
*/
/*ARGSUSED*/
static Boolean
CvtStringToLayout (dpy, args, num_args, from, to, converter_data)
Display *dpy;
XrmValue *args;
Cardinal *num_args;
XrmValue *from, *to;
XtPointer *converter_data;
CvtStringToLayout (Display *dpy _GL_UNUSED, XrmValue *args _GL_UNUSED, Cardinal *num_args _GL_UNUSED, XrmValue *from, XrmValue *to, XtPointer *converter_data _GL_UNUSED)
{
LayoutConverterStruct layoutConverterStruct;
......@@ -325,10 +319,7 @@ ClassInitialize(void)
ENDMESSAGE(ClassInitialize)
}
/*ARGSUSED*/
static XtGeometryResult GeometryManager(child, request, reply)
Widget child;
XtWidgetGeometry *request, *reply;
static XtGeometryResult GeometryManager(Widget child, XtWidgetGeometry *request, XtWidgetGeometry *reply _GL_UNUSED)
{
AaaWidget w = (AaaWidget) XtParent(child);
SubInfoPtr p = SubInfo(child);
......@@ -387,11 +378,7 @@ static XtGeometryResult GeometryManager(child, request, reply)
}
}
/* ARGSUSED */
static void Initialize(request, new, args, num_args)
Widget request, new;
ArgList args;
Cardinal *num_args;
static void Initialize(Widget request _GL_UNUSED, Widget new, ArgList args _GL_UNUSED, Cardinal *num_args _GL_UNUSED)
{
AaaWidget l= (AaaWidget) new;
Dimension prefwidth,prefheight;
......@@ -410,8 +397,7 @@ Cardinal *num_args;
ENDMESSAGE(Initialize)
}
static void ChangeManaged(gw)
Widget gw;
static void ChangeManaged(Widget gw)
{
AaaWidget w = (AaaWidget) gw;
Widget *children;
......@@ -423,8 +409,7 @@ static void ChangeManaged(gw)
}
static void
GetDesiredSize (child)
Widget child;
GetDesiredSize (Widget child)
{
XtWidgetGeometry desired;
SubInfoPtr p;
......@@ -443,16 +428,14 @@ GetDesiredSize (child)
INFSMESSAGE1(GetDesiredSize for:,XtName(child))
}
static void InsertChild (child)
Widget child;
static void InsertChild (Widget child)
{
(*SuperClass->composite_class.insert_child) (child);
GetDesiredSize (child);
}
static void
Resize(gw)
Widget gw;
Resize(Widget gw)
{
BEGINMESSAGE(Resize)
IIMESSAGE(gw->core.width,gw->core.height)
......@@ -464,11 +447,8 @@ Resize(gw)
}
/* ARGSUSED */
static Boolean
SetValues(gold, greq, gnew, args, num_args)
Widget gold, greq, gnew;
ArgList args;
Cardinal *num_args;
static Boolean
SetValues(Widget gold, Widget greq _GL_UNUSED, Widget gnew, ArgList args _GL_UNUSED, Cardinal *num_args _GL_UNUSED)
{
AaaWidget old = (AaaWidget) gold,
new = (AaaWidget) gnew;
......@@ -483,9 +463,7 @@ SetValues(gold, greq, gnew, args, num_args)
} /* SetValues */
static XtGeometryResult
QueryGeometry (gw, request, preferred_return)
Widget gw;
XtWidgetGeometry *request, *preferred_return;
QueryGeometry (Widget gw, XtWidgetGeometry *request, XtWidgetGeometry *preferred_return)
{
AaaWidget w = (AaaWidget) gw;
XtGeometryResult result;
......@@ -547,9 +525,7 @@ QueryGeometry (gw, request, preferred_return)
*/
static ExprPtr
LookupVariable (child, quark)
BoxPtr child;
XrmQuark quark;
LookupVariable (BoxPtr child, XrmQuark quark)
{
BoxPtr parent, box;
......@@ -565,13 +541,8 @@ LookupVariable (child, quark)
return((ExprPtr)NULL);
}
static double
Evaluate (l, box, expr, natural)
AaaWidget l;
BoxPtr box;
ExprPtr expr;
double natural;
Evaluate (AaaWidget l, BoxPtr box, ExprPtr expr, double natural)
{
double left, right, down;
Widget widget;
......@@ -639,8 +610,7 @@ Evaluate (l, box, expr, natural)
}
static void
DisposeExpr (expr)
ExprPtr expr;
DisposeExpr (ExprPtr expr)
{
MEMBEGINMESSAGE(DisposeExpr)
if (!expr) {
......@@ -694,10 +664,7 @@ DisposeExpr (expr)
/* compute the natural sizes of a box */
static void
ComputeNaturalSizes (l, box, dir)
AaaWidget l;
BoxPtr box;
LayoutDirection dir;
ComputeNaturalSizes (AaaWidget l, BoxPtr box, LayoutDirection dir)
{
BoxPtr child;
Widget w;
......@@ -809,8 +776,7 @@ ComputeNaturalSizes (l, box, dir)
((dist >= 0) ? 0.5 : -0.5))) : 0)
static Bool
ComputeSizes (box)
BoxPtr box;
ComputeSizes (BoxPtr box)
{
LayoutDirection dir;
BoxPtr child;
......@@ -914,9 +880,7 @@ ComputeSizes (box)
}
static void
SetSizes (box, x, y)
BoxPtr box;
Position x, y;
SetSizes (BoxPtr box, Position x, Position y)
{
BoxPtr child;
int width, height;
......@@ -970,8 +934,7 @@ SetSizes (box, x, y)
}
static void
AaaFreeLayout (box)
BoxPtr box;
AaaFreeLayout (BoxPtr box)
{
BoxPtr child, next;
......@@ -1024,9 +987,7 @@ AaaFreeLayout (box)
static void
AaaGetNaturalSize (l, widthp, heightp)
AaaWidget l;
Dimension *widthp, *heightp;
AaaGetNaturalSize (AaaWidget l, Dimension *widthp, Dimension *heightp)
{
BoxPtr box;
......@@ -1054,10 +1015,8 @@ AaaGetNaturalSize (l, widthp, heightp)
}
static void
AaaLayout (l, attemptResize)
AaaWidget l;
Bool attemptResize;
{
AaaLayout(AaaWidget l, Bool attemptResize)
{
BoxPtr box = l->aaa.layout;
Dimension width, height;
Dimension pwidth, pheight;
......
......@@ -136,8 +136,7 @@ layout_scan_error(s,layoutConverterStructP)
static void
maxlen_exceeded(layoutConverterStructP)
void *layoutConverterStructP;
maxlen_exceeded(void *layoutConverterStructP)
{
layout_scan_error("Expression too long.",layoutConverterStructP);
}
......
......@@ -168,11 +168,8 @@ static void ClassInitialize()
/* Initialize */
/*---------------------------------------------------*/
static void
Initialize(request, new, args, num_args)
Widget request, new;
ArgList args; /* unused */
Cardinal *num_args; /* unused */
static void
Initialize(Widget request _GL_UNUSED, Widget new, ArgList args _GL_UNUSED, Cardinal *num_args _GL_UNUSED)
{
ButtonWidget bw = (ButtonWidget) new;
......@@ -314,12 +311,8 @@ Region region;
/* ACTIONS */
/*##################################################-*/
void
ButtonHighlight(w,event,params,num_params)
Widget w;
XEvent *event;
String *params; /* unused */
Cardinal *num_params; /* unused */
void
ButtonHighlight(Widget w, XEvent *event, String *params _GL_UNUSED, Cardinal *num_params _GL_UNUSED)
{
ButtonWidget bw = (ButtonWidget)w;
Boolean set;
......@@ -333,12 +326,8 @@ Cardinal *num_params; /* unused */
ENDMESSAGE(ButtonHighlight)
}
void
ButtonSet(w,event,params,num_params)
Widget w;
XEvent *event;
String *params; /* unused */
Cardinal *num_params; /* unused */
void
ButtonSet(Widget w, XEvent *event, String *params _GL_UNUSED, Cardinal *num_params _GL_UNUSED)
{
ButtonWidget bw = (ButtonWidget)w;
......@@ -351,11 +340,7 @@ Cardinal *num_params; /* unused */
}
void
ButtonUnset(w,event,params,num_params)
Widget w;
XEvent *event;
String *params; /* unused */
Cardinal *num_params;
ButtonUnset(Widget w, XEvent *event, String *params _GL_UNUSED, Cardinal *num_params _GL_UNUSED)
{
ButtonWidget bw = (ButtonWidget)w;
......
......@@ -154,9 +154,7 @@ WidgetClass clipWidgetClass = (WidgetClass) &clipClassRec;
/* SendReport */
/*---------------------------------------------------*/
static void SendReport (cw, changed)
ClipWidget cw;
unsigned int changed;
static void SendReport (ClipWidget cw, unsigned int changed)
{
Widget child = CW_CHILD;
......@@ -206,10 +204,7 @@ static void Realize (gw, valueMask, attributes)
/*---------------------------------------------------*/
static void
Initialize(request, new, args, num_args)
Widget request, new;
ArgList args;
Cardinal *num_args;
Initialize(Widget request _GL_UNUSED, Widget new, ArgList args _GL_UNUSED, Cardinal *num_args _GL_UNUSED)
{
ClipWidget cw = (ClipWidget) new;
......@@ -245,8 +240,7 @@ SetValues(current, request, new)
/* Resize */
/*---------------------------------------------------*/
static void Resize (w)
Widget w;
static void Resize (Widget w)
{
ClipWidget cw = (ClipWidget) w;
Widget child = CW_CHILD;
......@@ -283,8 +277,7 @@ static void Resize (w)
/*---------------------------------------------------*/
static void
GetDesiredSizeOfChild(child)
Widget child;
GetDesiredSizeOfChild(Widget child)
{
ClipWidget cw;
XtWidgetGeometry desired;
......@@ -306,8 +299,7 @@ GetDesiredSizeOfChild(child)
/*---------------------------------------------------*/
static void
InsertChild(child)
Widget child;
InsertChild(Widget child)
{
BEGINMESSAGE(InsertChild)
SMESSAGE(XtName(child))
......@@ -321,10 +313,7 @@ InsertChild(child)
/*---------------------------------------------------*/
static void
GetNaturalSize(cw,wP,hP)
ClipWidget cw;
Dimension *wP;
Dimension *hP;
GetNaturalSize(ClipWidget cw, Dimension *wP, Dimension *hP)
{
BEGINMESSAGE(GetNaturalSize)
*wP = CW_CHILD_NAT_WIDTH;
......@@ -337,9 +326,7 @@ GetNaturalSize(cw,wP,hP)
/*---------------------------------------------------*/
static XtGeometryResult
QueryGeometry(w,request,preferred_return)
Widget w;
XtWidgetGeometry *request, *preferred_return;
QueryGeometry(Widget w, XtWidgetGeometry *request, XtWidgetGeometry *preferred_return)
{
ClipWidget cw = (ClipWidget)w;
Dimension nw,nh;
......@@ -375,9 +362,7 @@ QueryGeometry(w,request,preferred_return)
#define IS_REQUEST(fff) (request->request_mode & fff)
static XtGeometryResult
GeometryManager(child,request,geometry_return)
Widget child;
XtWidgetGeometry *request, *geometry_return;
GeometryManager(Widget child, XtWidgetGeometry *request, XtWidgetGeometry *geometry_return _GL_UNUSED)
{
ClipWidget cw;
XtGeometryResult answer;
......@@ -443,8 +428,7 @@ GeometryManager(child,request,geometry_return)
/* ChangeManaged */
/*---------------------------------------------------*/
static void ChangeManaged(w)
Widget w;
static void ChangeManaged(Widget w)
{
ClipWidget cw = (ClipWidget) w;
Widget child = CW_CHILD;
......@@ -480,8 +464,7 @@ static void ChangeManaged(w)
/*---------------------------------------------------*/
static XtGeometryResult
LayoutClip(cw)
ClipWidget cw;
LayoutClip(ClipWidget cw)
{
XtWidgetGeometry request;
XtGeometryResult answer;
......@@ -540,11 +523,8 @@ LayoutClip(cw)
/* ClipWidgetCheckCoordinates */
/*###################################################*/
void
ClipWidgetCheckCoordinates(w, x, y, xP, yP)
Widget w;
int x, y;
int *xP,*yP;
void
ClipWidgetCheckCoordinates(Widget w, int x, int y, int *xP, int *yP)
{
ClipWidget cw = (ClipWidget)w;
Widget child = CW_CHILD;
......@@ -566,20 +546,18 @@ ClipWidgetCheckCoordinates(w, x, y, xP, yP)
/* ClipWidgetSetCoordinates */
/*###################################################*/
void
ClipWidgetSetCoordinates(w, x, y)
Widget w;
int x, y;
void
ClipWidgetSetCoordinates(Widget w, int x, int y)
{
ClipWidget cw = (ClipWidget)w;
Widget child = CW_CHILD;
int px,py;
BEGINMESSAGE(ClipWidgetSetCoordinates)
ClipWidgetCheckCoordinates(w, x, y, &px,&py);
XtMoveWidget(child, (Position)px, (Position)py);
CW_CHILD_NAT_X = (Position)px;
CW_CHILD_NAT_Y = (Position)py;
SendReport (w, (XawPRSliderX | XawPRSliderY));
SendReport (cw, (XawPRSliderX | XawPRSliderY));
ENDMESSAGE(ClipWidgetSetCoordinates)
}
This diff is collapsed.
......@@ -180,13 +180,7 @@ WidgetClass frameWidgetClass = (WidgetClass) (&frameClassRec);
}
Boolean
FrameConvertStringToFrameType ( display, args, num_args, from, to, converter_data)
Display *display;
XrmValuePtr args;
Cardinal *num_args;
XrmValuePtr from;
XrmValuePtr to;
XtPointer *converter_data;
FrameConvertStringToFrameType(Display *display, XrmValue *args _GL_UNUSED, Cardinal *num_args _GL_UNUSED, XrmValuePtr from, XrmValuePtr to, XtPointer *converter_data _GL_UNUSED)
{
String s = (String) from->addr;
......@@ -219,9 +213,7 @@ ClassInitialize(void)
/*---------------------------------------------------*/
static GC
shadow_getGC (w,pixel)
Widget w;
Pixel pixel;
shadow_getGC (Widget w, Pixel pixel)
{
Screen *scn = XtScreen (w);
XtGCMask valuemask;
......@@ -240,10 +232,7 @@ shadow_getGC (w,pixel)
}
static void
Initialize(request, new, args, num_args)
Widget request, new;
ArgList args;
Cardinal *num_args;
Initialize(Widget request _GL_UNUSED, Widget new, ArgList args _GL_UNUSED, Cardinal *num_args _GL_UNUSED)
{
FrameWidget fw = (FrameWidget) new;
......@@ -268,8 +257,7 @@ Initialize(request, new, args, num_args)
/*---------------------------------------------------*/
static void
Destroy (w)
Widget w;
Destroy (Widget w)
{
FrameWidget fw = (FrameWidget) w;
......@@ -285,9 +273,8 @@ Destroy (w)
#define MIN_CHILD 4
static void
Resize(w)
Widget w;
static void
Resize(Widget w)
{
int x,y,cw,ch,hs,vs,bw,sw;
FrameWidget fw = (FrameWidget) w;
......@@ -344,17 +331,8 @@ Resize(w)
bottom_polygon[i].x = (short) (xx); \
bottom_polygon[i].y = (short) (yy)
void
FrameDrawFrame (gw, x, y, w, h, frame_type, fw, lightgc, darkgc)
Widget gw;
int x;
int y;
int w;
int h;
XawFrameType frame_type;
int fw;
GC lightgc;
GC darkgc;
void
FrameDrawFrame (Widget gw, int x, int y, int w, int h, XawFrameType frame_type, int fw, GC lightgc, GC darkgc)
{
XPoint top_polygon[6];
XPoint bottom_polygon[6];
......@@ -431,10 +409,7 @@ FrameDrawFrame (gw, x, y, w, h, frame_type, fw, lightgc, darkgc)
#undef bottomPolygon
static void
Redisplay(w, event, region)
Widget w;
XEvent *event; /* unused */
Region region; /* unused */
Redisplay(Widget w, XEvent *event _GL_UNUSED, Region region _GL_UNUSED)
{
FrameWidget fw = (FrameWidget) w;
int wh,ww,sw,bw;
......@@ -460,8 +435,7 @@ Redisplay(w, event, region)
/*---------------------------------------------------*/
static void
GetDesiredSizeOfChild(child)
Widget child;
GetDesiredSizeOfChild(Widget child)
{
FrameWidget fw;
......@@ -490,8 +464,7 @@ GetDesiredSizeOfChild(child)
/*---------------------------------------------------*/
static void
InsertChild(child)
Widget child;
InsertChild(Widget child)
{
BEGINMESSAGE(InsertChild)
(*SuperClass->composite_class.insert_child) (child);
......@@ -504,10 +477,7 @@ InsertChild(child)
/*---------------------------------------------------*/
static void
GetNaturalSize(fw,wP,hP)
FrameWidget fw;
Dimension *wP;
Dimension *hP;
GetNaturalSize(FrameWidget fw, Dimension *wP, Dimension *hP)
{
BEGINMESSAGE(GetNaturalSize)
*wP = FW_CHILD_NAT_WIDTH + 2*FW_NAT_SHADOW +2*FW_NAT_HSPACE;
......@@ -520,8 +490,7 @@ GetNaturalSize(fw,wP,hP)
/*---------------------------------------------------*/
static void
ChangeManaged(w)
Widget w;
ChangeManaged(Widget w)
{
FrameWidget fw = (FrameWidget) w;
......@@ -538,9 +507,7 @@ ChangeManaged(w)
#define IS_REQUEST(fff) (request->request_mode & fff)
static XtGeometryResult
GeometryManager(child,request,geometry_return)
Widget child;
XtWidgetGeometry *request, *geometry_return;
GeometryManager(Widget child, XtWidgetGeometry *request, XtWidgetGeometry *geometry_return _GL_UNUSED)
{
FrameWidget fw;
XtGeometryResult answer;
......@@ -596,9 +563,7 @@ GeometryManager(child,request,geometry_return)
/*---------------------------------------------------*/
static XtGeometryResult
QueryGeometry(w,request,preferred_return)
Widget w;
XtWidgetGeometry *request, *preferred_return;
QueryGeometry(Widget w, XtWidgetGeometry *request, XtWidgetGeometry *preferred_return)
{
FrameWidget fw = (FrameWidget)w;
Dimension nw,nh;
......@@ -632,8 +597,7 @@ QueryGeometry(w,request,preferred_return)
/*---------------------------------------------------*/
static XtGeometryResult
LayoutFrame(fw)
FrameWidget fw;
LayoutFrame(FrameWidget fw)
{
XtWidgetGeometry request;
XtGeometryResult answer;
......
This diff is collapsed.
......@@ -138,11 +138,7 @@ static void ClassInitialize(void)
}
void
PopupMenu(w, event, params, num_params)
Widget w;
XEvent * event;
String * params;
Cardinal * num_params;
PopupMenu(Widget w, XEvent *event _GL_UNUSED, String *params _GL_UNUSED, Cardinal *num_params)
{
MButtonWidget mbw = (MButtonWidget) w;
Widget temp;
......
This diff is collapsed.
......@@ -180,11 +180,8 @@ static void ClassInitialize(void)
/* Initialize */
/*---------------------------------------------------*/
static void
Initialize(request, new, args, num_args)
Widget request, new;
ArgList args; /* unused */
Cardinal *num_args; /* unused */
static void
Initialize(Widget request _GL_UNUSED, Widget new, ArgList args _GL_UNUSED, Cardinal *num_args _GL_UNUSED)
{
VlistWidget vw = (VlistWidget) new;
String s="";
......@@ -239,11 +236,8 @@ Cardinal *num_args; /* unused */
/* Redisplay */
/*---------------------------------------------------*/
static void
Redisplay(w, event, region)
Widget w;
XEvent *event;
Region region;
static void
Redisplay(Widget w, XEvent *event, Region region)
{
BEGINMESSAGE(Redisplay)
PaintVlistWidget(w, event, region);
......@@ -254,8 +248,7 @@ Region region;
/* Resize */
/*---------------------------------------------------*/
static void shiftLabel(vw)
VlistWidget vw;
static void shiftLabel(VlistWidget vw)
{
BEGINMESSAGE(shiftLabel)
if (vw->vlist.allow_marks) {
......@@ -266,8 +259,7 @@ static void shiftLabel(vw)
ENDMESSAGE(shiftLabel)
}
static void Resize(w)
Widget w;
static void Resize(Widget w)
{
VlistWidget vw = (VlistWidget) w;
BEGINMESSAGE(Resize)
......@@ -280,11 +272,8 @@ static void Resize(w)
/* SetValues */
/*---------------------------------------------------*/
static Boolean
SetValues (current, request, new, args, num_args)
Widget current, request, new;
ArgList args;
Cardinal *num_args;
static Boolean
SetValues (Widget current, Widget request _GL_UNUSED, Widget new, ArgList args _GL_UNUSED, Cardinal *num_args _GL_UNUSED)
{
VlistWidget cvw = (VlistWidget) current;
VlistWidget nvw = (VlistWidget) new;
......@@ -309,9 +298,8 @@ Cardinal *num_args;
/* Destroy */
/*---------------------------------------------------*/
static void
Destroy(w)
Widget w;
static void
Destroy(Widget w)
{
VlistWidget vw = (VlistWidget)w;
......@@ -329,9 +317,7 @@ Widget w;
/*---------------------------------------------------*/
static void
PaintEntryString(w, entry)
Widget w;
int entry;
PaintEntryString(Widget w, int entry)
{
VlistWidget vw = (VlistWidget)w;
char * s;
......@@ -371,12 +357,7 @@ PaintEntryString(w, entry)
/*---------------------------------------------------*/
static int
PaintMark(w, region, entry, style,erase)
Widget w;
Region region;
int entry;
int style;
Boolean erase;
PaintMark(Widget w, Region region, int entry, int style, Boolean erase)
{
VlistWidget vw = (VlistWidget)w;
int ss,ulx,uly,lrx,lry,ret=0;
......@@ -437,12 +418,7 @@ PaintMark(w, region, entry, style,erase)
}
static void
PaintMarkOfEntry(w, region, entry, style,erase)
Widget w;
Region region;
int entry;
int style;
Boolean erase;
PaintMarkOfEntry(Widget w, Region region, int entry, int style, Boolean erase)
{
VlistWidget vw = (VlistWidget)w;
int pstyle,dstyle,d,p;
......@@ -486,12 +462,8 @@ PaintMarkOfEntry(w, region, entry, style,erase)
/* PaintMarkMarkOfEntry */
/*---------------------------------------------------*/
static void
PaintMarkMarkOfEntry(w, region, entry, erase)
Widget w;
Region region;
int entry;
Boolean erase;
static void
PaintMarkMarkOfEntry(Widget w, Region region, int entry, Boolean erase)
{
VlistWidget vw = (VlistWidget)w;
......@@ -538,11 +510,8 @@ PaintMarkMarkOfEntry(w, region, entry, erase)
/* PaintMarksOfEntries */
/*---------------------------------------------------*/
static void
PaintMarksOfEntries(w, event, region)
Widget w;
XEvent *event;
Region region;
static void
PaintMarksOfEntries(Widget w, XEvent *event _GL_UNUSED, Region region)
{
VlistWidget vw = (VlistWidget)w;
......@@ -565,11 +534,8 @@ Region region;
/* PaintVlistWidget */
/*---------------------------------------------------*/
static void
PaintVlistWidget(w, event, region)
Widget w;
XEvent *event;
Region region;
static void
PaintVlistWidget(Widget w, XEvent *event, Region region)
{
Dimension width;
char *s, *o;
......@@ -649,8 +615,7 @@ Region region;
/*###################################################*/
int
VlistSelected(w)
Widget w;
VlistSelected(Widget w)
{
VlistWidget vw = (VlistWidget)w;
......@@ -664,8 +629,7 @@ VlistSelected(w)
/*###################################################*/
int
VlistHighlighted(w)
Widget w;
VlistHighlighted(Widget w)
{
VlistWidget vw = (VlistWidget)w;
......@@ -679,8 +643,7 @@ VlistHighlighted(w)
/*###################################################*/
int
VlistEntries(w)
Widget w;
VlistEntries(Widget w)