Skip to content

Commit 735d8ae

Browse files
committed
use static const instead of C99 compound literals
1 parent bc34ab9 commit 735d8ae

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Objects/memoryobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,8 @@ fix_error_int(const char *fmt)
16771677
}
16781678

16791679
// Return 0 if PTR represents "false", and 1 otherwise.
1680-
#define UNPACK_TO_BOOL(PTR) (memcmp((PTR), &(_Bool){0}, sizeof(_Bool)) != 0)
1680+
static const _Bool bool_false = 0;
1681+
#define UNPACK_TO_BOOL(PTR) (memcmp((PTR), &bool_false, sizeof(_Bool)) != 0)
16811682

16821683
/* Accept integer objects or objects with an __index__() method. */
16831684
static long

Tools/c-analyzer/cpython/globals-to-fix.tsv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ Modules/_testclinic.c - TestClass -
357357
##################################
358358
## global non-objects to fix in builtin modules
359359

360-
# <none>
360+
Objects/memoryobject.c - bool_false -
361361

362362

363363
##################################

0 commit comments

Comments
 (0)