changeset: 61:7b528bbd72b2
tag: tip
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Mon Mar 05 14:57:47 2007 +0100
summary: fixed warnings in event.c
diff -r d5a6a8ab8857 -r 7b528bbd72b2 event.c
--- a/event.c Mon Mar 05 14:50:53 2007 +0100
+++ b/event.c Mon Mar 05 14:57:47 2007 +0100
@@ -68,7 +68,7 @@ char *eventnames[] = {
"MappingNotify"
};
-void
+static void
selection_paste(Time tm) {
int nbytes;
char *text;
@@ -78,7 +78,7 @@ selection_paste(Time tm) {
cmd_write(text, nbytes);
}
-void
+static void
handle_keypress(XEvent *xev) {
char kbuf[KEYSEQLEN];
KeySym keysym;
@@ -138,7 +138,7 @@ handle_keypress(XEvent *xev) {
}
}
-void
+static void
handle_resize(XEvent *xev) {
int new_cols, new_rows;
@@ -171,7 +171,7 @@ static unsigned char *selection_text = N
#define SELECT_WORD 2
#define SELECT_LINE 3
-void
+static void
selection_reset(void) {
int i, j;
@@ -187,7 +187,7 @@ selection_reset(void) {
}
}
-void
+static void
selection_start(int row, int col, Time tm) {
fprintf(stderr, "Selection started, row=%d, col=%d\n", row, col);
selection_start_col = col, selection_start_row = row;
@@ -195,7 +195,7 @@ selection_start(int row, int col, Time t
selection_mode = SELECT_LETTER;
}
-void
+static void
selection_select_word(int row, int col, Time tm) {
int i, len;
@@ -216,11 +216,11 @@ selection_select_word(int row, int col,
}
fprintf(stderr, "len=%d\n", len);
text_screen[row-1].needs_update = 1;
- XStoreBuffer(dpy, selection_text, len, XA_CUT_BUFFER0);
+ XStoreBuffer(dpy, (char *)selection_text, len, XA_CUT_BUFFER0);
XSetSelectionOwner(dpy, XA_PRIMARY, win, tm);
}
-void
+static void
selection_select_line(int row, int col, Time tm) {
int i;
@@ -235,11 +235,11 @@ selection_select_line(int row, int col,
}
while(selection_text[i] == ' ') i--;
text_screen[row-1].needs_update=1;
- XStoreBuffer(dpy, selection_text, screen_cols, XA_CUT_BUFFER0);
+ XStoreBuffer(dpy, (char *)selection_text, screen_cols, XA_CUT_BUFFER0);
XSetSelectionOwner(dpy, XA_PRIMARY, win, tm);
}
-void
+static void
handle_buttonpress(XEvent *xev) {
static int lastclick_time = 0;
static int times_clicked = 0;
@@ -283,16 +283,18 @@ handle_buttonpress(XEvent *xev) {
}
}
-void
+static void
handle_motionnotify(XEvent *xev) {
int unused;
+ unsigned int mask;
+ Window dummy;
while(XCheckTypedWindowEvent(dpy, win, MotionNotify, xev));
- XQueryPointer(dpy, win, &unused, &unused,
- &unused, &unused, &(xev->xbutton.x), &(xev->xbutton.y), &unused);
-}
-
-void
+ XQueryPointer(dpy, win, &dummy, &dummy,
+ &unused, &unused, &(xev->xbutton.x), &(xev->xbutton.y), &mask);
+}
+
+static void
selection_copy(XEvent *xev) {
XEvent ev;
XSelectionRequestEvent *rq = (XSelectionRequestEvent*)xev;
@@ -335,7 +337,7 @@ selection_copy(XEvent *xev) {
style = (rq->target == xa_compound_text) ? XCompoundTextStyle
: XStdICCTextStyle;
}
- cl[0] = selection_text;
+ cl[0] = (char *)selection_text;
XmbTextListToTextProperty(dpy, cl, 1, style, &ct);
XChangeProperty(dpy, rq->requestor, rq->property,
target, 8, PropModeReplace,
@@ -345,6 +347,7 @@ selection_copy(XEvent *xev) {
XSendEvent(dpy, rq->requestor, False, 0, &ev);
}
+/* extern */
int
handle_x_events(void) {
XEvent xev;
diff -r d5a6a8ab8857 -r 7b528bbd72b2 st.h
--- a/st.h Mon Mar 05 14:50:53 2007 +0100
+++ b/st.h Mon Mar 05 14:57:47 2007 +0100
@@ -78,6 +78,9 @@ extern int wh;
extern int wh;
extern int curr_row, curr_col;
+/* event.c */
+int handle_x_events(void);
+
extern int cmd_write(const char *, int);
extern unsigned char cmdgetc(void);
extern int resize_app(void);
Received on Mon Mar 05 2007 - 14:59:23 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:11 UTC