From 109a63c4d0375f12456d32e5bd58bc92748adad0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 6 Oct 2008 14:36:29 +0200 Subject: [PATCH] wreadln: convert public globals to local constants Convert wrln_max_line_size and wrln_max_history_length to local constants. They have no real use outside of wreadln.c. --- src/screen.c | 4 ---- src/wreadln.c | 11 ++++++----- src/wreadln.h | 6 ------ 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/screen.c b/src/screen.c index aed9d9a..648d07a 100644 --- a/src/screen.c +++ b/src/screen.c @@ -28,7 +28,6 @@ #include "options.h" #include "colors.h" #include "strfsong.h" -#include "wreadln.h" #include #include @@ -522,9 +521,6 @@ screen_init(mpdclient_t *c) if (mode_fn->open != NULL) mode_fn->open(c); - - /* initialize wreadln */ - wrln_max_history_length = 16; } void diff --git a/src/wreadln.c b/src/wreadln.c index edf4f70..f6773a7 100644 --- a/src/wreadln.c +++ b/src/wreadln.c @@ -40,11 +40,12 @@ #define KEY_BCKSPC 8 #define TAB 9 -#define WRLN_MAX_LINE_SIZE 1024 -#define WRLN_MAX_HISTORY_LENGTH 32 - -guint wrln_max_line_size = WRLN_MAX_LINE_SIZE; -guint wrln_max_history_length = WRLN_MAX_HISTORY_LENGTH; +/** max size allocated for a line */ +static const size_t wrln_max_line_size = 1024; + +/** max items stored in the history list */ +static const guint wrln_max_history_length = 32; + void *wrln_completion_callback_data = NULL; wrln_gcmp_pre_cb_t wrln_pre_completion_callback = NULL; wrln_gcmp_post_cb_t wrln_post_completion_callback = NULL; diff --git a/src/wreadln.h b/src/wreadln.h index fa52d49..692f4fd 100644 --- a/src/wreadln.h +++ b/src/wreadln.h @@ -4,12 +4,6 @@ #include #include -/* max size allocated for a line */ -extern guint wrln_max_line_size; - -/* max items stored in the history list */ -extern guint wrln_max_history_length; - /* completion callback data */ extern void *wrln_completion_callback_data; -- 2.30.2