Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.

This commit is contained in:
rsc 2006-04-01 19:24:03 +00:00
parent 226d80b821
commit cbeb0b26e4
492 changed files with 3218 additions and 3167 deletions

View file

@ -15,7 +15,7 @@ Client *current;
void
setactive(Client *c, int on)
{
// dbg("setactive client %x %d", c->window, c->on);
/* dbg("setactive client %x %d", c->window, c->on); */
if(c->parent == c->screen->root)
return;
@ -52,7 +52,7 @@ draw_border(Client *c, int active)
pixel = c->screen->inactiveborder;
}
if(debug) fprintf(stderr, "draw_border %p pixel %ld active %d hold %d\n", c, pixel, active, c->hold);
if(debug) fprintf(stderr, "draw_border %p pixel %ld active %d hold %d\n", (void*)c, pixel, active, c->hold);
XSetWindowBackground(dpy, c->parent, pixel);
XClearWindow(dpy, c->parent);
}
@ -132,7 +132,7 @@ top(Client *c)
}
l = &cc->next;
}
fprintf(stderr, "rio: %p not on client list in top()\n", c);
fprintf(stderr, "rio: %p not on client list in top()\n", (void*)c);
}
Client *
@ -229,7 +229,7 @@ dump_revert(void)
i = 0;
for(c = current; c; c = c->revert){
fprintf(stderr, "%s(%x:%d)", c->label ? c->label : "?", (uint)c->window, c->state);
fprintf(stderr, "%s(%x:%d)", c->label ? c->label : "?", (int)c->window, c->state);
if(i++ > 100)
break;
if(c->revert)
@ -246,7 +246,7 @@ dump_clients(void)
Client *c;
for(c = clients; c; c = c->next)
fprintf(stderr, "w 0x%x parent 0x%x @ (%d, %d)\n", (uint)c->window, (uint)c->parent, c->x, c->y);
fprintf(stderr, "w 0x%x parent 0x%x @ (%d, %d)\n", (int)c->window, (int)c->parent, c->x, c->y);
}
#endif
@ -258,8 +258,8 @@ shuffle(int up)
if(clients == 0 || clients->next == 0)
return;
if(up){
//for(c=clients; c->next; c=c->next)
// ;
/*for(c=clients; c->next; c=c->next) */
/* ; */
for(l=&clients; (*l)->next; l=&(*l)->next)
;
c = *l;
@ -278,8 +278,8 @@ shuffle(int up)
c->next = 0;
XLowerWindow(dpy, c->window);
}
// XMapRaised(dpy, clients->parent);
// top(clients);
// active(clients);
/* XMapRaised(dpy, clients->parent); */
/* top(clients); */
/* active(clients); */
}

View file

@ -25,7 +25,7 @@ Cursordata bigarrow = {
0xFE, 0x07, 0xFE, 0x07, 0xFE, 0x0F, 0xFE, 0x1F,
0xFE, 0x3F, 0xFE, 0x7F, 0xFE, 0x3F, 0xCE, 0x1F,
0x86, 0x0F, 0x06, 0x07, 0x02, 0x02, 0x00, 0x00,
},
}
};
Cursordata sweep0data = {
@ -151,7 +151,7 @@ Cursordata blitsweep = {
#define grey_width 4
#define grey_height 2
static char grey_bits[] = {
0x01, 0x04,
0x01, 0x04
};
static XColor bl, wh;
@ -375,7 +375,7 @@ Cursor l = {
Cursor *corners[9] = {
&tl, &t, &tr,
&l, nil, &r,
&bl, &b, &br,
&bl, &b, &br
};
*/

View file

@ -22,7 +22,6 @@
typedef struct Client Client;
typedef struct Menu Menu;
typedef struct ScreenInfo ScreenInfo;
typedef enum BorderOrient BorderOrient;
struct Client {
Window window;
@ -91,8 +90,9 @@ enum BorderOrient {
BorderW,
BorderWNW,
BorderNNW,
NBorder,
NBorder
};
typedef enum BorderOrient BorderOrient;
struct ScreenInfo {
int num;

View file

@ -87,9 +87,9 @@ dotrace(char *s, Client *c, XEvent *e)
{
if(debug == 0)
return;
fprintf(stderr, "rio: %s: c=%p", s, c);
fprintf(stderr, "rio: %s: c=%p", s, (void*)c);
if(c)
fprintf(stderr, " x %d y %d dx %d dy %d w 0x%x parent 0x%x", c->x, c->y, c->dx, c->dy, (uint)c->window, (uint)c->parent);
fprintf(stderr, " x %d y %d dx %d dy %d w 0x%x parent 0x%x", c->x, c->y, c->dx, c->dy, (int)c->window, (int)c->parent);
#ifdef DEBUG_EV
if(e){
fprintf(stderr, "\n\t");

View file

@ -191,7 +191,7 @@ mapreq(XMapRequestEvent *e)
if(c == 0 || c->window != e->window){
/* workaround for stupid NCDware */
fprintf(stderr, "rio: bad mapreq c %p w %x, rescanning\n",
c, (int)e->window);
(void*)c, (int)e->window);
for(i = 0; i < num_screens; i++)
scanwins(&screens[i]);
c = getclient(e->window, 0);

View file

@ -14,13 +14,13 @@
enum
{
GrabAltTab,
GrabAltAny,
GrabAltAny
};
static int tabcode = 0x17;
//static int altcode = 0x40;
//static int pgupcode = 0x63;
//static int pgdowncode = 0x69;
/*static int altcode = 0x40; */
/*static int pgupcode = 0x63; */
/*static int pgdowncode = 0x69; */
static void alttab(int shift);
@ -32,9 +32,9 @@ keysetup(void)
for(i=0; i<num_screens; i++){
XGrabKey(dpy, tabcode, Mod1Mask, screens[i].root, 0, GrabModeSync, GrabModeAsync);
XGrabKey(dpy, tabcode, Mod1Mask|ShiftMask, screens[i].root, 0, GrabModeSync, GrabModeAsync);
// XGrabKey(dpy, pgupcode, Mod1Mask, screens[i].root, 0, GrabModeSync, GrabModeAsync);
// XGrabKey(dpy, pgdowncode, Mod1Mask, screens[i].root, 0, GrabModeSync, GrabModeAsync);
// XGrabKey(dpy, altcode, 0, screens[i].root, 0, GrabModeSync, GrabModeAsync);
/* XGrabKey(dpy, pgupcode, Mod1Mask, screens[i].root, 0, GrabModeSync, GrabModeAsync); */
/* XGrabKey(dpy, pgdowncode, Mod1Mask, screens[i].root, 0, GrabModeSync, GrabModeAsync); */
/* XGrabKey(dpy, altcode, 0, screens[i].root, 0, GrabModeSync, GrabModeAsync); */
}
}
@ -60,6 +60,6 @@ static void
alttab(int shift)
{
shuffle(shift);
// fprintf(stderr, "%sTab\n", shift ? "Back" : "");
/* fprintf(stderr, "%sTab\n", shift ? "Back" : ""); */
}

View file

@ -18,7 +18,7 @@
char *version[] =
{
"rio version 1.0, Copyright (c) 1994-1996 David Hogan, (c) 2004 Russ Cox", 0,
"rio version 1.0, Copyright (c) 1994-1996 David Hogan, (c) 2004 Russ Cox", 0
};
Display *dpy;
@ -62,7 +62,7 @@ char *fontlist[] = {
"9x15bold",
"fixed",
"*",
0,
0
};
void

View file

@ -3,6 +3,7 @@
*/
/* Copyright (c) 1994-1996 David Hogan, see README for licence details */
#define _SVID_SOURCE 1 /* putenv in glibc */
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
@ -24,7 +25,7 @@ int reversehide = 1;
Client * currents[NUMVIRTUALS] =
{
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL
};
char *b2items[NUMVIRTUALS+1] =
@ -41,12 +42,12 @@ char *b2items[NUMVIRTUALS+1] =
"Ten",
"Eleven",
"Twelve",
0,
0
};
Menu b2menu =
{
b2items,
b2items
};
char *b3items[B3FIXED+MAXHIDDEN+1] =
@ -56,7 +57,7 @@ char *b3items[B3FIXED+MAXHIDDEN+1] =
"Move",
"Delete",
"Hide",
0,
0
};
enum
@ -70,12 +71,12 @@ enum
Menu b3menu =
{
b3items,
b3items
};
Menu egg =
{
version,
version
};
void