Skip to content

Commit

Permalink
missing operator
Browse files Browse the repository at this point in the history
  • Loading branch information
colesbury committed Aug 22, 2023
1 parent 38837c9 commit 67aaa03
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Include/pyatomic_msc.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,18 @@ _Py_atomic_exchange_int(volatile int *address, int value)
return (int)_InterlockedExchange((volatile long*)address, (long)value);
}

static inline int8_t
_Py_atomic_exchange_int8(volatile int8_t *address, int8_t value)
{
return (int8_t)_InterlockedExchange8((volatile short*)address, (short)value);
}

static inline int16_t
_Py_atomic_exchange_int16(volatile int16_t *address, int16_t value)
{
return (int16_t)_InterlockedExchange16((volatile short*)address, (short)value);
}

static inline int32_t
_Py_atomic_exchange_int32(volatile int32_t *address, int32_t value)
{
Expand Down
5 changes: 4 additions & 1 deletion Modules/_testcapi/pyatomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
#include "pyatomic.h"
#include "parts.h"

#define FOR_UNSIGNED_TYPES(V) \
// We define atomic bitwise operations on these types
#define FOR_BITWISE_TYPES(V) \
V(uint8, uint8_t) \
V(uint16, uint16_t) \
V(uint32, uint32_t) \
V(uint64, uint64_t) \
V(uintptr, uintptr_t)

// We define atomic addition on these types
#define FOR_ARITHMETIC_TYPES(V) \
FOR_UNSIGNED_TYPES(V) \

Check warning on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

return type defaults to ‘int’ [-Wimplicit-int]

Check warning on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

function declaration isn’t a prototype [-Wstrict-prototypes]

Check failure on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

expected declaration specifiers before ‘FOR_UNSIGNED_TYPES’

Check warning on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

type of ‘IMPL_TEST_ADD’ defaults to ‘int’ [-Wimplicit-int]

Check warning on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Ubuntu

return type defaults to ‘int’ [-Wimplicit-int]

Check warning on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Ubuntu

function declaration isn’t a prototype [-Wstrict-prototypes]

Check failure on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Ubuntu

expected declaration specifiers before ‘FOR_UNSIGNED_TYPES’

Check warning on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Ubuntu

type of ‘IMPL_TEST_ADD’ defaults to ‘int’ [-Wimplicit-int]

Check warning on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

return type defaults to ‘int’ [-Wimplicit-int]

Check warning on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

function declaration isn’t a prototype [-Wstrict-prototypes]

Check failure on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

expected declaration specifiers before ‘FOR_UNSIGNED_TYPES’

Check warning on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Address sanitizer

type of ‘IMPL_TEST_ADD’ defaults to ‘int’ [-Wimplicit-int]

Check warning on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.2)

return type defaults to ‘int’ [-Wimplicit-int]

Check warning on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.2)

function declaration isn’t a prototype [-Wstrict-prototypes]

Check failure on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.2)

expected declaration specifiers before ‘FOR_UNSIGNED_TYPES’

Check warning on line 24 in Modules/_testcapi/pyatomic.c

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (3.1.2)

type of ‘IMPL_TEST_ADD’ defaults to ‘int’ [-Wimplicit-int]
V(int, int) \
Expand All @@ -28,6 +30,7 @@
V(intptr, intptr_t) \
V(ssize, Py_ssize_t)

// We define atomic load, store, exchange, and compare_exchange on these types
#define FOR_ALL_TYPES(V) \
FOR_ARITHMETIC_TYPES(V) \
V(ptr, void*)
Expand Down

0 comments on commit 67aaa03

Please sign in to comment.