[cairo-commit] cairo-demo/tsetse ChangeLog, 1.4, 1.5 Makefile, 1.2,
1.3 tsetse.c, 1.5, 1.6
Behdad Esfahbod
commit at pdx.freedesktop.org
Fri Jul 29 15:15:57 PDT 2005
Committed by: behdad
Update of /cvs/cairo/cairo-demo/tsetse
In directory gabe:/tmp/cvs-serv20588
Modified Files:
ChangeLog Makefile tsetse.c
Log Message:
2005-07-21 Behdad Esfahbod <behdad at behdad.org>
* tsetse.c: Several minor changes to shut gcc warnings up.
Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo-demo/tsetse/ChangeLog,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ChangeLog 21 Jul 2005 16:49:33 -0000 1.4
+++ ChangeLog 29 Jul 2005 22:15:55 -0000 1.5
@@ -1,3 +1,7 @@
+2005-07-21 Behdad Esfahbod <behdad at behdad.org>
+
+ * tsetse.c: Several minor changes to shut gcc warnings up.
+
2005-07-21 Carl Worth <cworth at cworth.org>
* tsetse.c: (draw_symbol), (draw_card), (win_refresh), (win_init),
Index: Makefile
===================================================================
RCS file: /cvs/cairo/cairo-demo/tsetse/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Makefile 21 Mar 2005 02:28:44 -0000 1.2
+++ Makefile 29 Jul 2005 22:15:55 -0000 1.3
@@ -1,10 +1,12 @@
-MYCFLAGS=-g -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls `pkg-config --cflags cairo`
-MYLDFLAGS=`pkg-config --libs cairo`
+APPS = tsetse
-tsetse: tsetse.c
- $(CC) $(CFLAGS) $(CPPFLAGS) ${MYCFLAGS} ${MYLDFLAGS} $< -o $@
+CFLAGS = -Wall
+LDFLAGS = -lm
-clean:
- rm -f tsetse
+CFLAGS += `pkg-config cairo --cflags`
+LDFLAGS += `pkg-config cairo --libs`
+all: $(APPS)
+clean:
+ $(RM) $(APPS)
Index: tsetse.c
===================================================================
RCS file: /cvs/cairo/cairo-demo/tsetse/tsetse.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- tsetse.c 21 Jul 2005 16:49:33 -0000 1.5
+++ tsetse.c 29 Jul 2005 22:15:55 -0000 1.6
@@ -92,14 +92,14 @@
typedef struct callback_doc {
void *callback;
- char *doc;
+ const char *doc;
} callback_doc_t;
typedef int (*key_callback_t)(win_t *win);
typedef struct key_binding
{
- char *key;
+ const char *key;
int is_alias;
KeyCode keycode;
key_callback_t callback;
@@ -136,14 +136,14 @@
};
int
-main(int argc, char *argv[])
+main(void)
{
win_t win;
- srand (time(0));
-
Display *dpy = XOpenDisplay(0);
+ srand (time(0));
+
if (dpy == NULL) {
fprintf(stderr, "Failed to open display: %s\n", XDisplayName(0));
return 1;
@@ -589,7 +589,7 @@
static void
win_init(win_t *win, Display *dpy)
{
- int i;
+ unsigned int i;
Window root;
XGCValues gcv;
@@ -656,10 +656,10 @@
}
-static char *
+static const char *
get_callback_doc(void *callback)
{
- int i;
+ unsigned int i;
for (i=0; i < ARRAY_SIZE(callback_doc); i++)
if (callback_doc[i].callback == callback)
@@ -671,7 +671,7 @@
static void
win_print_help(win_t *win)
{
- int i;
+ unsigned int i;
printf("Welcome to the game of tsetse\n");
printf("Click on three cards that form a set. Useful keys:\n\n");
@@ -701,7 +701,7 @@
static int
win_handle_key_press(win_t *win, XKeyEvent *kev)
{
- int i;
+ unsigned int i;
for (i=0; i < ARRAY_SIZE(key_binding); i++)
if (key_binding[i].keycode == kev->keycode)
More information about the cairo-commit
mailing list