| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -789,7 +789,7 @@ Reader_iternext(ReaderObj *self) | |||
| 789 | 789 | Py_UCS4 c; | |
| 790 | 790 | Py_ssize_t pos, linelen; | |
| 791 | 791 | unsigned int kind; | |
| 792 | - void *data; | ||
| 792 | + const void *data; | ||
| 793 | 793 | PyObject *lineobj; | |
| 794 | 794 | ||
| 795 | 795 | if (parse_reset(self) < 0) | |
@@ -996,7 +996,7 @@ join_reset(WriterObj *self) | |||
| 996 | 996 | * record length. | |
| 997 | 997 | */ | |
| 998 | 998 | static Py_ssize_t | |
| 999 | - join_append_data(WriterObj *self, unsigned int field_kind, void *field_data, | ||
| 999 | + join_append_data(WriterObj *self, unsigned int field_kind, const void *field_data, | ||
| 1000 | 1000 | Py_ssize_t field_len, int *quoted, | |
| 1001 | 1001 | int copy_phase) | |
| 1002 | 1002 | { | |
@@ -1107,7 +1107,7 @@ static int | |||
| 1107 | 1107 | join_append(WriterObj *self, PyObject *field, int quoted) | |
| 1108 | 1108 | { | |
| 1109 | 1109 | unsigned int field_kind = -1; | |
| 1110 | - void *field_data = NULL; | ||
| 1110 | + const void *field_data = NULL; | ||
| 1111 | 1111 | Py_ssize_t field_len = 0; | |
| 1112 | 1112 | Py_ssize_t rec_len; | |
| 1113 | 1113 | ||
@@ -1139,7 +1139,7 @@ join_append_lineterminator(WriterObj *self) | |||
| 1139 | 1139 | { | |
| 1140 | 1140 | Py_ssize_t terminator_len, i; | |
| 1141 | 1141 | unsigned int term_kind; | |
| 1142 | - void *term_data; | ||
| 1142 | + const void *term_data; | ||
| 1143 | 1143 | ||
| 1144 | 1144 | terminator_len = PyUnicode_GET_LENGTH(self->dialect->lineterminator); | |
| 1145 | 1145 | if (terminator_len == -1) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1878,7 +1878,7 @@ dec_dealloc(PyObject *dec) | |||
| 1878 | 1878 | /******************************************************************************/ | |
| 1879 | 1879 | ||
| 1880 | 1880 | Py_LOCAL_INLINE(int) | |
| 1881 | - is_space(enum PyUnicode_Kind kind, void *data, Py_ssize_t pos) | ||
| 1881 | + is_space(enum PyUnicode_Kind kind, const void *data, Py_ssize_t pos) | ||
| 1882 | 1882 | { | |
| 1883 | 1883 | Py_UCS4 ch = PyUnicode_READ(kind, data, pos); | |
| 1884 | 1884 | return Py_UNICODE_ISSPACE(ch); | |
@@ -1896,7 +1896,7 @@ static char * | |||
| 1896 | 1896 | numeric_as_ascii(const PyObject *u, int strip_ws, int ignore_underscores) | |
| 1897 | 1897 | { | |
| 1898 | 1898 | enum PyUnicode_Kind kind; | |
| 1899 | - void *data; | ||
| 1899 | + const void *data; | ||
| 1900 | 1900 | Py_UCS4 ch; | |
| 1901 | 1901 | char *res, *cp; | |
| 1902 | 1902 | Py_ssize_t j, len; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1132,7 +1132,7 @@ checkpath(PyObject* tag) | |||
| 1132 | 1132 | ||
| 1133 | 1133 | if (PyUnicode_Check(tag)) { | |
| 1134 | 1134 | const Py_ssize_t len = PyUnicode_GET_LENGTH(tag); | |
| 1135 | - void *data = PyUnicode_DATA(tag); | ||
| 1135 | + const void *data = PyUnicode_DATA(tag); | ||
| 1136 | 1136 | unsigned int kind = PyUnicode_KIND(tag); | |
| 1137 | 1137 | if (len >= 3 && PyUnicode_READ(kind, data, 0) == '{' && ( | |
| 1138 | 1138 | PyUnicode_READ(kind, data, 1) == '}' || ( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -340,7 +340,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *myself, | |||
| 340 | 340 | goto error; | |
| 341 | 341 | kind = PyUnicode_KIND(modified); | |
| 342 | 342 | out = PyUnicode_DATA(modified); | |
| 343 | - PyUnicode_WRITE(kind, PyUnicode_DATA(modified), 0, '\r'); | ||
| 343 | + PyUnicode_WRITE(kind, out, 0, '\r'); | ||
| 344 | 344 | memcpy(out + kind, PyUnicode_DATA(output), kind * output_len); | |
| 345 | 345 | Py_DECREF(output); | |
| 346 | 346 | output = modified; /* output remains ready */ | |
@@ -367,7 +367,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *myself, | |||
| 367 | 367 | /* Record which newlines are read and do newline translation if desired, | |
| 368 | 368 | all in one pass. */ | |
| 369 | 369 | { | |
| 370 | - void *in_str; | ||
| 370 | + const void *in_str; | ||
| 371 | 371 | Py_ssize_t len; | |
| 372 | 372 | int seennl = self->seennl; | |
| 373 | 373 | int only_lf = 0; | |
@@ -447,7 +447,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *myself, | |||
| 447 | 447 | else { | |
| 448 | 448 | void *translated; | |
| 449 | 449 | int kind = PyUnicode_KIND(output); | |
| 450 | - void *in_str = PyUnicode_DATA(output); | ||
| 450 | + const void *in_str = PyUnicode_DATA(output); | ||
| 451 | 451 | Py_ssize_t in, out; | |
| 452 | 452 | /* XXX: Previous in-place translation here is disabled as | |
| 453 | 453 | resizing is not possible anymore */ | |
@@ -2085,7 +2085,7 @@ _PyIO_find_line_ending( | |||
| 2085 | 2085 | else { | |
| 2086 | 2086 | /* Non-universal mode. */ | |
| 2087 | 2087 | Py_ssize_t readnl_len = PyUnicode_GET_LENGTH(readnl); | |
| 2088 | - Py_UCS1 *nl = PyUnicode_1BYTE_DATA(readnl); | ||
| 2088 | + const Py_UCS1 *nl = PyUnicode_1BYTE_DATA(readnl); | ||
| 2089 | 2089 | /* Assume that readnl is an ASCII character. */ | |
| 2090 | 2090 | assert(PyUnicode_KIND(readnl) == PyUnicode_1BYTE_KIND); | |
| 2091 | 2091 | if (readnl_len == 1) { | |
@@ -2139,7 +2139,7 @@ _textiowrapper_readline(textio *self, Py_ssize_t limit) | |||
| 2139 | 2139 | chunked = 0; | |
| 2140 | 2140 | ||
| 2141 | 2141 | while (1) { | |
| 2142 | - char *ptr; | ||
| 2142 | + const char *ptr; | ||
| 2143 | 2143 | Py_ssize_t line_len; | |
| 2144 | 2144 | int kind; | |
| 2145 | 2145 | Py_ssize_t consumed = 0; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -159,8 +159,8 @@ ascii_escape_unicode(PyObject *pystr) | |||
| 159 | 159 | Py_ssize_t output_size; | |
| 160 | 160 | Py_ssize_t chars; | |
| 161 | 161 | PyObject *rval; | |
| 162 | - void *input; | ||
| 163 | - unsigned char *output; | ||
| 162 | + const void *input; | ||
| 163 | + Py_UCS1 *output; | ||
| 164 | 164 | int kind; | |
| 165 | 165 | ||
| 166 | 166 | if (PyUnicode_READY(pystr) == -1) | |
@@ -225,7 +225,7 @@ escape_unicode(PyObject *pystr) | |||
| 225 | 225 | Py_ssize_t output_size; | |
| 226 | 226 | Py_ssize_t chars; | |
| 227 | 227 | PyObject *rval; | |
| 228 | - void *input; | ||
| 228 | + const void *input; | ||
| 229 | 229 | int kind; | |
| 230 | 230 | Py_UCS4 maxchar; | |
| 231 | 231 | ||
@@ -678,7 +678,7 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss | |||
| 678 | 678 | ||
| 679 | 679 | Returns a new PyObject (usually a dict, but object_hook can change that) | |
| 680 | 680 | */ | |
| 681 | - void *str; | ||
| 681 | + const void *str; | ||
| 682 | 682 | int kind; | |
| 683 | 683 | Py_ssize_t end_idx; | |
| 684 | 684 | PyObject *val = NULL; | |
@@ -808,7 +808,7 @@ _parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssi | |||
| 808 | 808 | ||
| 809 | 809 | Returns a new PyList | |
| 810 | 810 | */ | |
| 811 | - void *str; | ||
| 811 | + const void *str; | ||
| 812 | 812 | int kind; | |
| 813 | 813 | Py_ssize_t end_idx; | |
| 814 | 814 | PyObject *val = NULL; | |
@@ -911,7 +911,7 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_ | |||
| 911 | 911 | PyLong, or PyFloat. | |
| 912 | 912 | May return other types if parse_int or parse_float are set | |
| 913 | 913 | */ | |
| 914 | - void *str; | ||
| 914 | + const void *str; | ||
| 915 | 915 | int kind; | |
| 916 | 916 | Py_ssize_t end_idx; | |
| 917 | 917 | Py_ssize_t idx = start; | |
@@ -1028,7 +1028,7 @@ scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_ | |||
| 1028 | 1028 | Returns a new PyObject representation of the term. | |
| 1029 | 1029 | */ | |
| 1030 | 1030 | PyObject *res; | |
| 1031 | - void *str; | ||
| 1031 | + const void *str; | ||
| 1032 | 1032 | int kind; | |
| 1033 | 1033 | Py_ssize_t length; | |
| 1034 | 1034 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1170,7 +1170,7 @@ attrgetter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) | |||
| 1170 | 1170 | for (idx = 0; idx < nattrs; ++idx) { | |
| 1171 | 1171 | PyObject *item = PyTuple_GET_ITEM(args, idx); | |
| 1172 | 1172 | Py_ssize_t item_len; | |
| 1173 | - void *data; | ||
| 1173 | + const void *data; | ||
| 1174 | 1174 | unsigned int kind; | |
| 1175 | 1175 | int dot_count; | |
| 1176 | 1176 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2581,7 +2581,7 @@ raw_unicode_escape(PyObject *obj) | |||
| 2581 | 2581 | { | |
| 2582 | 2582 | char *p; | |
| 2583 | 2583 | Py_ssize_t i, size; | |
| 2584 | - void *data; | ||
| 2584 | + const void *data; | ||
| 2585 | 2585 | unsigned int kind; | |
| 2586 | 2586 | _PyBytesWriter writer; | |
| 2587 | 2587 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1644,7 +1644,7 @@ pysqlite_connection_create_collation(pysqlite_Connection* self, PyObject* args) | |||
| 1644 | 1644 | const char *uppercase_name_str; | |
| 1645 | 1645 | int rc; | |
| 1646 | 1646 | unsigned int kind; | |
| 1647 | - void *data; | ||
| 1647 | + const void *data; | ||
| 1648 | 1648 | ||
| 1649 | 1649 | if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) { | |
| 1650 | 1650 | goto finally; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -351,7 +351,7 @@ state_reset(SRE_STATE* state) | |||
| 351 | 351 | data_stack_dealloc(state); | |
| 352 | 352 | } | |
| 353 | 353 | ||
| 354 | - static void* | ||
| 354 | + static const void* | ||
| 355 | 355 | getstring(PyObject* string, Py_ssize_t* p_length, | |
| 356 | 356 | int* p_isbytes, int* p_charsize, | |
| 357 | 357 | Py_buffer *view) | |
@@ -398,11 +398,11 @@ state_init(SRE_STATE* state, PatternObject* pattern, PyObject* string, | |||
| 398 | 398 | ||
| 399 | 399 | Py_ssize_t length; | |
| 400 | 400 | int isbytes, charsize; | |
| 401 | - void* ptr; | ||
| 401 | + const void* ptr; | ||
| 402 | 402 | ||
| 403 | 403 | memset(state, 0, sizeof(SRE_STATE)); | |
| 404 | 404 | ||
| 405 | - state->mark = PyMem_New(void *, pattern->groups * 2); | ||
| 405 | + state->mark = PyMem_New(const void *, pattern->groups * 2); | ||
| 406 | 406 | if (!state->mark) { | |
| 407 | 407 | PyErr_NoMemory(); | |
| 408 | 408 | goto err; | |
@@ -891,7 +891,7 @@ _sre_SRE_Pattern_split_impl(PatternObject *self, PyObject *string, | |||
| 891 | 891 | Py_ssize_t status; | |
| 892 | 892 | Py_ssize_t n; | |
| 893 | 893 | Py_ssize_t i; | |
| 894 | - void* last; | ||
| 894 | + const void* last; | ||
| 895 | 895 | ||
| 896 | 896 | assert(self->codesize != 0); | |
| 897 | 897 | ||
@@ -984,7 +984,7 @@ pattern_subx(PatternObject* self, PyObject* ptemplate, PyObject* string, | |||
| 984 | 984 | PyObject* item; | |
| 985 | 985 | PyObject* filter; | |
| 986 | 986 | PyObject* match; | |
| 987 | - void* ptr; | ||
| 987 | + const void* ptr; | ||
| 988 | 988 | Py_ssize_t status; | |
| 989 | 989 | Py_ssize_t n; | |
| 990 | 990 | Py_ssize_t i, b, e; | |
@@ -1895,7 +1895,7 @@ match_getslice_by_index(MatchObject* self, Py_ssize_t index, PyObject* def) | |||
| 1895 | 1895 | int isbytes, charsize; | |
| 1896 | 1896 | Py_buffer view; | |
| 1897 | 1897 | PyObject *result; | |
| 1898 | - void* ptr; | ||
| 1898 | + const void* ptr; | ||
| 1899 | 1899 | Py_ssize_t i, j; | |
| 1900 | 1900 | ||
| 1901 | 1901 | assert(0 <= index && index < self->groups); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,7 +72,7 @@ static const struct dbcs_map *mapping_list; | |||
| 72 | 72 | #define ENCODER(encoding) \ | |
| 73 | 73 | static Py_ssize_t encoding##_encode( \ | |
| 74 | 74 | MultibyteCodec_State *state, const void *config, \ | |
| 75 | - int kind, void *data, \ | ||
| 75 | + int kind, const void *data, \ | ||
| 76 | 76 | Py_ssize_t *inpos, Py_ssize_t inlen, \ | |
| 77 | 77 | unsigned char **outbuf, Py_ssize_t outleft, int flags) | |
| 78 | 78 | #define ENCODER_RESET(encoding) \ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments