mirror of
https://github.com/python/cpython.git
synced 2025-10-08 16:11:51 +00:00
Fix some warnings produced by different compilers. (GH-5593) (GH-5600)
(cherry picked from commit bfe4fd5f2e
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
3a047a781a
commit
7df80492fc
6 changed files with 19 additions and 7 deletions
|
@ -8,7 +8,7 @@
|
|||
|
||||
#define CONTEXT_FREELIST_MAXLEN 255
|
||||
static PyContext *ctx_freelist = NULL;
|
||||
static Py_ssize_t ctx_freelist_len = 0;
|
||||
static int ctx_freelist_len = 0;
|
||||
|
||||
|
||||
#include "clinic/context.c.h"
|
||||
|
@ -1177,7 +1177,7 @@ get_token_missing(void)
|
|||
int
|
||||
PyContext_ClearFreeList(void)
|
||||
{
|
||||
Py_ssize_t size = ctx_freelist_len;
|
||||
int size = ctx_freelist_len;
|
||||
while (ctx_freelist_len) {
|
||||
PyContext *ctx = ctx_freelist;
|
||||
ctx_freelist = (PyContext *)ctx->ctx_weakreflist;
|
||||
|
|
|
@ -729,7 +729,7 @@ hamt_node_bitmap_assoc(PyHamtNode_Bitmap *self,
|
|||
uint32_t key_idx = 2 * idx;
|
||||
uint32_t val_idx = key_idx + 1;
|
||||
|
||||
assert(val_idx < Py_SIZE(self));
|
||||
assert(val_idx < (size_t)Py_SIZE(self));
|
||||
|
||||
PyObject *key_or_null = self->b_array[key_idx];
|
||||
PyObject *val_or_node = self->b_array[val_idx];
|
||||
|
@ -1123,7 +1123,7 @@ hamt_node_bitmap_find(PyHamtNode_Bitmap *self,
|
|||
key_idx = idx * 2;
|
||||
val_idx = key_idx + 1;
|
||||
|
||||
assert(val_idx < Py_SIZE(self));
|
||||
assert(val_idx < (size_t)Py_SIZE(self));
|
||||
|
||||
key_or_null = self->b_array[key_idx];
|
||||
val_or_node = self->b_array[val_idx];
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
_Py_HashSecret_t _Py_HashSecret = {0};
|
||||
_Py_HashSecret_t _Py_HashSecret = {{0}};
|
||||
|
||||
#if Py_HASH_ALGORITHM == Py_HASH_EXTERNAL
|
||||
extern PyHash_FuncDef PyHash_Func;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue