mirror of https://github.com/python/cpython
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).
This commit is contained in:
parent
6a74da3cdb
commit
2525dc8fb6
|
@ -1080,7 +1080,7 @@ call_readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
|
||||||
/* we have a valid line */
|
/* we have a valid line */
|
||||||
n = strlen(p);
|
n = strlen(p);
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
char *line;
|
const char *line;
|
||||||
int length = _py_get_history_length();
|
int length = _py_get_history_length();
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
@ -1089,10 +1089,10 @@ call_readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
|
||||||
* Libedit's emulation uses 0-based indexes,
|
* Libedit's emulation uses 0-based indexes,
|
||||||
* the real readline uses 1-based indexes.
|
* the real readline uses 1-based indexes.
|
||||||
*/
|
*/
|
||||||
line = history_get(length - 1)->line;
|
line = (const char *)history_get(length - 1)->line;
|
||||||
} else
|
} else
|
||||||
#endif /* __APPLE__ */
|
#endif /* __APPLE__ */
|
||||||
line = history_get(length)->line;
|
line = (const char *)history_get(length)->line;
|
||||||
else
|
else
|
||||||
line = "";
|
line = "";
|
||||||
if (strcmp(p, line))
|
if (strcmp(p, line))
|
||||||
|
|
Loading…
Reference in New Issue