summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2002-11-20 09:29:37 +0000
committersabetts <sabetts>2002-11-20 09:29:37 +0000
commitd8b1104be304c1c67db4f16389696ea82a3e6699 (patch)
tree09e160a1339b2cccc700884419265234f2155f4b /src
parent34703b2c03d6f5eb15b9357d9ba6fc707944aa98 (diff)
downloadratpoison-d8b1104be304c1c67db4f16389696ea82a3e6699.zip
* src/ratpoison.h[!HAVE_VARARG_MACROS]: PRINT_ERROR and
PRINT_DEBUG are defined as void macros. * src/events.c (client_msg): Add semicolon to the end of a PRINT_DEBUG line. * src/actions.c (cmd_bind): typecast data as a (char *) before using it in (char *) pointer arithmetic. * configure.in: Add check to see if the preprocessor has variable argument macro capabilities.
Diffstat (limited to 'src')
-rw-r--r--src/actions.c2
-rw-r--r--src/events.c2
-rw-r--r--src/ratpoison.h13
3 files changed, 15 insertions, 2 deletions
diff --git a/src/actions.c b/src/actions.c
index 61c785c..2779101 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -455,7 +455,7 @@ cmd_bind (int interactive, void *data)
keydesc = (char*) xmalloc (strlen (data) + 1);
sscanf (data, "%s", keydesc);
- cmd = data + strlen (keydesc);
+ cmd = ((char *)data) + strlen (keydesc);
/* Gobble remaining whitespace before command starts */
while (*cmd == ' ')
diff --git a/src/events.c b/src/events.c
index e9f0db3..4004c61 100644
--- a/src/events.c
+++ b/src/events.c
@@ -330,7 +330,7 @@ client_msg (XClientMessageEvent *ev)
{
rp_window *win;
- PRINT_DEBUG ("WM_CHANGE_STATE\n")
+ PRINT_DEBUG ("WM_CHANGE_STATE\n");
win = find_window (ev->window);
if (win == NULL) return;
diff --git a/src/ratpoison.h b/src/ratpoison.h
index 293e868..99b6409 100644
--- a/src/ratpoison.h
+++ b/src/ratpoison.h
@@ -33,6 +33,11 @@
/* Some error reporting macros */
#define PRE_PRINT_LOCATION fprintf (stderr, "%s:%s():%d: ", __FILE__, __FUNCTION__, __LINE__);
+
+/* FIXME: Some preprocessors don't have variable args. In that case
+ they don't get error or debugging output. */
+#ifdef HAVE_VARARG_MACROS
+
#define PRINT_ERROR(format, args...) \
{ fprintf (stderr, PACKAGE ":error -- "); PRE_PRINT_LOCATION; fprintf (stderr, format, ## args); }
@@ -44,6 +49,14 @@
# define PRINT_DEBUG(format, args...)
#endif /* DEBUG */
+#else /* !HAVE_VARARG_MACROS */
+
+#define PRINT_ERROR (void)
+#define PRINT_DEBUG (void)
+
+#endif /* HAVE_VARARG_MACROS */
+
+
extern XGCValues gv;
#include "conf.h"