mirror of https://github.com/python/cpython
Strip out extraneous whitespace, cast a some `const char *` to `void *` when
passed to free() and make a `char *` to a `const char *` as found by Clang's static analyzer.
This commit is contained in:
parent
33e5dd8466
commit
23b581a6f4
|
@ -378,7 +378,7 @@ py_remove_history(PyObject *self, PyObject *args)
|
|||
}
|
||||
/* free memory allocated for the history entry */
|
||||
if (entry->line)
|
||||
free(entry->line);
|
||||
free((void *)entry->line);
|
||||
if (entry->data)
|
||||
free(entry->data);
|
||||
free(entry);
|
||||
|
@ -415,7 +415,7 @@ py_replace_history(PyObject *self, PyObject *args)
|
|||
}
|
||||
/* free memory allocated for the old history entry */
|
||||
if (old_entry->line)
|
||||
free(old_entry->line);
|
||||
free((void *)old_entry->line);
|
||||
if (old_entry->data)
|
||||
free(old_entry->data);
|
||||
free(old_entry);
|
||||
|
@ -1023,7 +1023,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;
|
||||
HISTORY_STATE *state = history_get_history_state();
|
||||
if (state->length > 0)
|
||||
#ifdef __APPLE__
|
||||
|
|
Loading…
Reference in New Issue