summaryrefslogtreecommitdiffstats
path: root/Modules/readline.c
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2010-08-22 20:36:25 (GMT)
committerBrett Cannon <bcannon@gmail.com>2010-08-22 20:36:25 (GMT)
commit2525dc8fb6ce87502b09bbf9965065ab296d9b07 (patch)
tree0d9f2119c159f9fdb1afa7c3feaa3da6582b73e3 /Modules/readline.c
parent6a74da3cdb18c11805d599d51f0507ce7655f8f8 (diff)
downloadcpython-2525dc8fb6ce87502b09bbf9965065ab296d9b07.zip
cpython-2525dc8fb6ce87502b09bbf9965065ab296d9b07.tar.gz
cpython-2525dc8fb6ce87502b09bbf9965065ab296d9b07.tar.bz2
Under OS X, history_get from readline returns a const char *, but the local
variable the return value is assigned to is char *. Since the assigned-to variable is never changed, simply make that a const char * and cast all calls to get_history to const char * to silence the compiler warning (found with LLVM).
Diffstat (limited to 'Modules/readline.c')
-rw-r--r--Modules/readline.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/readline.c b/Modules/readline.c
index 2a12629..18908ef 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -1080,7 +1080,7 @@ call_readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
/* we have a valid line */
n = strlen(p);
if (n > 0) {
- char *line;
+ const char *line;
int length = _py_get_history_length();
if (length > 0)
#ifdef __APPLE__
@@ -1089,10 +1089,10 @@ call_readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
* Libedit's emulation uses 0-based indexes,
* the real readline uses 1-based indexes.
*/
- line = history_get(length - 1)->line;
+ line = (const char *)history_get(length - 1)->line;
} else
#endif /* __APPLE__ */
- line = history_get(length)->line;
+ line = (const char *)history_get(length)->line;
else
line = "";
if (strcmp(p, line))