summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2004-09-29 15:33:13 +0000
committersabetts <sabetts>2004-09-29 15:33:13 +0000
commit442b8d1ae2f4419ca2e2e4d76ad06ae38d18d1c7 (patch)
tree0f8560315ca338841e8d70fbcff55ad995dbbe61 /src
parent6206d6ac617f244700cebb319fd9e53636cfbd83 (diff)
downloadratpoison-442b8d1ae2f4419ca2e2e4d76ad06ae38d18d1c7.zip
* configure.in: Warn when the history header or library is not
found and compile without history support. * src/ratpoison.h: change ifdef to check for HAVE_HISTORY. * src/manage.c (get_state): change data to an unsigned char and cast data to a long* when it's used. * src/main.c (main): change ifdef to check for HAVE_HISTORY. (clean_up): likewise * src/history.c: change ifdef to check for HAVE_HISTORY. * src/events.c (receive_command): make prop_return an unsigned char. * src/editor.c (editor_history_previous): change ifdef to check for HAVE_HISTORY. (editor_history_next): likewise (editor_enter): likewise
Diffstat (limited to 'src')
-rw-r--r--src/editor.c16
-rw-r--r--src/events.c4
-rw-r--r--src/history.c4
-rw-r--r--src/main.c8
-rw-r--r--src/manage.c6
-rw-r--r--src/ratpoison.h4
6 files changed, 21 insertions, 21 deletions
diff --git a/src/editor.c b/src/editor.c
index 4864e80..c5c3560 100644
--- a/src/editor.c
+++ b/src/editor.c
@@ -309,7 +309,7 @@ editor_backward_kill_line (rp_input_line *line)
static edit_status
editor_history_previous (rp_input_line *line)
{
-#ifdef HAVE_READLINE_HISTORY_H
+#ifdef HAVE_HISTORY
char *entry = history_previous ();
if (entry)
@@ -336,17 +336,17 @@ editor_history_previous (rp_input_line *line)
return EDIT_INSERT;
-#else /* HAVE_READLINE_HISTORY_H */
+#else /* HAVE_HISTORY */
return EDIT_NO_OP;
-#endif /* HAVE_READLINE_HISTORY_H */
+#endif /* HAVE_HISTORY */
}
static edit_status
editor_history_next (rp_input_line *line)
{
-#ifdef HAVE_READLINE_HISTORY_H
+#ifdef HAVE_HISTORY
char *entry = history_next ();
if (entry)
@@ -374,9 +374,9 @@ editor_history_next (rp_input_line *line)
return EDIT_INSERT;
-#else /* HAVE_READLINE_HISTORY_H */
+#else /* HAVE_HISTORY */
return EDIT_NO_OP;
-#endif /* HAVE_READLINE_HISTORY_H */
+#endif /* HAVE_HISTORY */
}
static edit_status
@@ -426,7 +426,7 @@ editor_enter (rp_input_line *line)
char *expansion;
line->buffer[line->length] = '\0';
-#ifdef HAVE_READLINE_HISTORY_H
+#ifdef HAVE_HISTORY
result = history_expand_line (line->buffer, &expansion);
PRINT_DEBUG (("History Expansion - result: %d\n", result));
@@ -443,7 +443,7 @@ editor_enter (rp_input_line *line)
history_add (expansion);
line->buffer = expansion;
}
-#endif /* HAVE_READLINE_HISTORY_H */
+#endif /* HAVE_HISTORY */
return EDIT_DONE;
}
diff --git a/src/events.c b/src/events.c
index 1d62e74..001eab6 100644
--- a/src/events.c
+++ b/src/events.c
@@ -490,7 +490,7 @@ receive_command ()
int format_ret;
unsigned long nitems;
unsigned long bytes_after;
- void *prop_return;
+ unsigned char *prop_return;
int offset;
/* Init offset to 0. In the case where there is more than one window
@@ -510,7 +510,7 @@ receive_command ()
offset, length,
True, XA_WINDOW, &type_ret, &format_ret,
&nitems,
- &bytes_after, (unsigned char **)&prop_return);
+ &bytes_after, &prop_return);
/* Update the offset to point to the next window (if there is
another one). */
diff --git a/src/history.c b/src/history.c
index fd3e424..a96c296 100644
--- a/src/history.c
+++ b/src/history.c
@@ -4,7 +4,7 @@
#include "ratpoison.h"
-#ifdef HAVE_READLINE_HISTORY_H
+#ifdef HAVE_HISTORY
#include "readline/history.h"
@@ -129,4 +129,4 @@ int history_expand_line (char *string, char **output)
return history_expand (string, output);
}
-#endif /* HAVE_READLINE_HISTORY_H */
+#endif /* HAVE_HISTORY */
diff --git a/src/main.c b/src/main.c
index 1d58faf..5e87c55 100644
--- a/src/main.c
+++ b/src/main.c
@@ -623,9 +623,9 @@ main (int argc, char *argv[])
init_frame_lists ();
update_modifier_map ();
initialize_default_keybindings ();
-#ifdef HAVE_READLINE_HISTORY_H
+#ifdef HAVE_HISTORY
history_load ();
-#endif /* HAVE_READLINE_HISTORY_H */
+#endif /* HAVE_HISTORY */
/* Scan for windows */
if (screen_arg)
@@ -688,9 +688,9 @@ clean_up ()
{
int i;
-#ifdef HAVE_READLINE_HISTORY_H
+#ifdef HAVE_HISTORY
history_save ();
-#endif /* HAVE_READLINE_HISTORY_H */
+#endif /* HAVE_HISTORY */
free_keymaps ();
free_aliases ();
diff --git a/src/manage.c b/src/manage.c
index c30b242..3a303de 100644
--- a/src/manage.c
+++ b/src/manage.c
@@ -526,7 +526,7 @@ get_state (rp_window *win)
int format;
unsigned long nitems;
unsigned long bytes_left;
- long *data;
+ unsigned char *data;
if (win == NULL)
return state;
@@ -534,9 +534,9 @@ get_state (rp_window *win)
if (XGetWindowProperty (dpy, win->w, wm_state, 0L, 2L,
False, wm_state, &type, &format,
&nitems, &bytes_left,
- (unsigned char **)&data) == Success && nitems > 0)
+ &data) == Success && nitems > 0)
{
- state = *data;
+ state = *(long *)data;
XFree (data);
}
diff --git a/src/ratpoison.h b/src/ratpoison.h
index eb34dcf..26ee77a 100644
--- a/src/ratpoison.h
+++ b/src/ratpoison.h
@@ -79,9 +79,9 @@ extern XGCValues gv;
#include "screen.h"
#include "group.h"
#include "editor.h"
-#ifdef HAVE_READLINE_HISTORY_H
+#ifdef HAVE_HISTORY
#include "history.h"
-#endif /* HAVE_READLINE_HISTORY_H */
+#endif /* HAVE_HISTORY */
#include "completions.h"
#include "hook.h"
#include "xinerama.h"