aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/rio
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-04-01 19:24:03 +0000
committerrsc <devnull@localhost>2006-04-01 19:24:03 +0000
commitcbeb0b26e4c7caa8d1b47de791a7418dc20a4567 (patch)
treee0f7e445de1aa22a42ef873dc4b1118a8105ae93 /src/cmd/rio
parent226d80b8213821af0cbf092d1507c52b504fd368 (diff)
downloadplan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.tar.gz
plan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.tar.bz2
plan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.zip
Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.
Diffstat (limited to 'src/cmd/rio')
-rw-r--r--src/cmd/rio/client.c20
-rw-r--r--src/cmd/rio/cursor.c6
-rw-r--r--src/cmd/rio/dat.h4
-rw-r--r--src/cmd/rio/error.c4
-rw-r--r--src/cmd/rio/event.c2
-rw-r--r--src/cmd/rio/key.c16
-rw-r--r--src/cmd/rio/main.c4
-rw-r--r--src/cmd/rio/menu.c13
8 files changed, 35 insertions, 34 deletions
diff --git a/src/cmd/rio/client.c b/src/cmd/rio/client.c
index df8225fd..58b0697f 100644
--- a/src/cmd/rio/client.c
+++ b/src/cmd/rio/client.c
@@ -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); */
}
diff --git a/src/cmd/rio/cursor.c b/src/cmd/rio/cursor.c
index 9acab519..33f63522 100644
--- a/src/cmd/rio/cursor.c
+++ b/src/cmd/rio/cursor.c
@@ -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
};
*/
diff --git a/src/cmd/rio/dat.h b/src/cmd/rio/dat.h
index aa08fcf9..e56429eb 100644
--- a/src/cmd/rio/dat.h
+++ b/src/cmd/rio/dat.h
@@ -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;
diff --git a/src/cmd/rio/error.c b/src/cmd/rio/error.c
index 5215f32a..358a36a5 100644
--- a/src/cmd/rio/error.c
+++ b/src/cmd/rio/error.c
@@ -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");
diff --git a/src/cmd/rio/event.c b/src/cmd/rio/event.c
index 457153df..1fa00ffc 100644
--- a/src/cmd/rio/event.c
+++ b/src/cmd/rio/event.c
@@ -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);
diff --git a/src/cmd/rio/key.c b/src/cmd/rio/key.c
index bff0d14d..95333ec5 100644
--- a/src/cmd/rio/key.c
+++ b/src/cmd/rio/key.c
@@ -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" : ""); */
}
diff --git a/src/cmd/rio/main.c b/src/cmd/rio/main.c
index d20c3a00..afb2bb8b 100644
--- a/src/cmd/rio/main.c
+++ b/src/cmd/rio/main.c
@@ -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
diff --git a/src/cmd/rio/menu.c b/src/cmd/rio/menu.c
index eb92b744..379291cc 100644
--- a/src/cmd/rio/menu.c
+++ b/src/cmd/rio/menu.c
@@ -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