diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-12-12 11:55:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-12 11:55:04 (GMT) |
commit | 4ae06c5337e01bdde28bce57b6b9166ad50947e3 (patch) | |
tree | 5e9e92f616bc452eb4096b56ea373fa8b46d2510 /Python/bootstrap_hash.c | |
parent | 5ce0a2a100909104836f53a2c8823006ec46f8ad (diff) | |
download | cpython-4ae06c5337e01bdde28bce57b6b9166ad50947e3.zip cpython-4ae06c5337e01bdde28bce57b6b9166ad50947e3.tar.gz cpython-4ae06c5337e01bdde28bce57b6b9166ad50947e3.tar.bz2 |
bpo-32241: Add the const qualifire to declarations of umodifiable strings. (#4748)
Diffstat (limited to 'Python/bootstrap_hash.c')
-rw-r--r-- | Python/bootstrap_hash.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/bootstrap_hash.c b/Python/bootstrap_hash.c index 610541d..2762f46 100644 --- a/Python/bootstrap_hash.c +++ b/Python/bootstrap_hash.c @@ -533,16 +533,16 @@ _PyOS_URandomNonblock(void *buffer, Py_ssize_t size) return pyurandom(buffer, size, 0, 1); } -int Py_ReadHashSeed(char *seed_text, +int Py_ReadHashSeed(const char *seed_text, int *use_hash_seed, unsigned long *hash_seed) { Py_BUILD_ASSERT(sizeof(_Py_HashSecret_t) == sizeof(_Py_HashSecret.uc)); /* Convert a text seed to a numeric one */ if (seed_text && *seed_text != '\0' && strcmp(seed_text, "random") != 0) { - char *endptr = seed_text; + const char *endptr = seed_text; unsigned long seed; - seed = strtoul(seed_text, &endptr, 10); + seed = strtoul(seed_text, (char **)&endptr, 10); if (*endptr != '\0' || seed > 4294967295UL || (errno == ERANGE && seed == ULONG_MAX)) @@ -604,7 +604,7 @@ init_hash_secret(int use_hash_seed, _PyInitError _Py_HashRandomization_Init(_PyCoreConfig *core_config) { - char *seed_text; + const char *seed_text; int use_hash_seed = core_config->use_hash_seed; unsigned long hash_seed = core_config->hash_seed; |