mirror of
https://github.com/python/cpython.git
synced 2025-09-18 22:50:26 +00:00
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
1 changed files with 21 additions and 21 deletions
|
@ -378,7 +378,7 @@ py_remove_history(PyObject *self, PyObject *args)
|
||||||
}
|
}
|
||||||
/* free memory allocated for the history entry */
|
/* free memory allocated for the history entry */
|
||||||
if (entry->line)
|
if (entry->line)
|
||||||
free(entry->line);
|
free((void *)entry->line);
|
||||||
if (entry->data)
|
if (entry->data)
|
||||||
free(entry->data);
|
free(entry->data);
|
||||||
free(entry);
|
free(entry);
|
||||||
|
@ -415,7 +415,7 @@ py_replace_history(PyObject *self, PyObject *args)
|
||||||
}
|
}
|
||||||
/* free memory allocated for the old history entry */
|
/* free memory allocated for the old history entry */
|
||||||
if (old_entry->line)
|
if (old_entry->line)
|
||||||
free(old_entry->line);
|
free((void *)old_entry->line);
|
||||||
if (old_entry->data)
|
if (old_entry->data)
|
||||||
free(old_entry->data);
|
free(old_entry->data);
|
||||||
free(old_entry);
|
free(old_entry);
|
||||||
|
@ -1023,7 +1023,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;
|
||||||
HISTORY_STATE *state = history_get_history_state();
|
HISTORY_STATE *state = history_get_history_state();
|
||||||
if (state->length > 0)
|
if (state->length > 0)
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue