pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/98f93a32f395cc75dd30f95428e28b10442b4344

55097560d244c08.css" /> gh-124064: Fix -Wconversion warnings in pycore_{gc,list,stackref}.h (… · python/cpython@98f93a3 · GitHub
Skip to content

Commit 98f93a3

Browse files
authored
gh-124064: Fix -Wconversion warnings in pycore_{gc,list,stackref}.h (#124174)
1 parent 33eeccf commit 98f93a3

File tree

5 files changed

+4
-9
lines changed

5 files changed

+4
-9
lines changed

Include/internal/pycore_gc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static inline void _PyGC_CLEAR_FINALIZED(PyObject *op) {
227227
_PyObject_CLEAR_GC_BITS(op, _PyGC_BITS_FINALIZED);
228228
#else
229229
PyGC_Head *gc = _Py_AS_GC(op);
230-
gc->_gc_prev &= ~_PyGC_PREV_MASK_FINALIZED;
230+
gc->_gc_prev &= ~(uintptr_t)_PyGC_PREV_MASK_FINALIZED;
231231
#endif
232232
}
233233

Include/internal/pycore_list.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ _Py_memory_repeat(char* dest, Py_ssize_t len_dest, Py_ssize_t len_src)
4545
Py_ssize_t copied = len_src;
4646
while (copied < len_dest) {
4747
Py_ssize_t bytes_to_copy = Py_MIN(copied, len_dest - copied);
48-
memcpy(dest + copied, dest, bytes_to_copy);
48+
memcpy(dest + copied, dest, (size_t)bytes_to_copy);
4949
copied += bytes_to_copy;
5050
}
5151
}

Include/internal/pycore_stackref.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ typedef union _PyStackRef {
9898
static inline PyObject *
9999
PyStackRef_AsPyObjectBorrow(_PyStackRef stackref)
100100
{
101-
PyObject *cleared = ((PyObject *)((stackref).bits & (~Py_TAG_BITS)));
101+
PyObject *cleared = ((PyObject *)((stackref).bits & (~(uintptr_t)Py_TAG_BITS)));
102102
return cleared;
103103
}
104104
#else
@@ -133,7 +133,7 @@ _PyStackRef_FromPyObjectSteal(PyObject *obj)
133133
{
134134
// Make sure we don't take an already tagged value.
135135
assert(((uintptr_t)obj & Py_TAG_BITS) == 0);
136-
int tag = (obj == NULL || _Py_IsImmortal(obj)) ? (Py_TAG_DEFERRED) : Py_TAG_PTR;
136+
unsigned int tag = (obj == NULL || _Py_IsImmortal(obj)) ? (Py_TAG_DEFERRED) : Py_TAG_PTR;
137137
return ((_PyStackRef){.bits = ((uintptr_t)(obj)) | tag});
138138
}
139139
# define PyStackRef_FromPyObjectSteal(obj) _PyStackRef_FromPyObjectSteal(_PyObject_CAST(obj))

Tools/build/.warningignore_macos

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
Include/internal/mimalloc/mimalloc/internal.h 4
77
Include/internal/pycore_backoff.h 1
88
Include/internal/pycore_dict.h 2
9-
Include/internal/pycore_gc.h 1
109
Include/internal/pycore_long.h 2
1110
Include/internal/pycore_object.h 4
1211
Modules/_asynciomodule.c 3

Tools/build/.warningignore_ubuntu

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ Include/internal/pycore_asdl.h 1
1919
Include/internal/pycore_backoff.h 3
2020
Include/internal/pycore_blocks_output_buffer.h 1
2121
Include/internal/pycore_dict.h 2
22-
Include/internal/pycore_gc.h 1
23-
Include/internal/pycore_gc.h 1
2422
Include/internal/pycore_interp.h 1
25-
Include/internal/pycore_list.h 1
2623
Include/internal/pycore_long.h 3
2724
Include/internal/pycore_object.h 4
2825
Include/internal/pycore_obmalloc.h 1
@@ -233,7 +230,6 @@ Python/generated_cases.c.h 27
233230
Python/generated_cases.c.h 27
234231
Python/getargs.c 7
235232
Python/hashtable.c 1
236-
Python/import.c 6
237233
Python/import.c 7
238234
Python/initconfig.c 11
239235
Python/instrumentation.c 43

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy