CMake: enable comma-subscript GCC warning
This commit is contained in:
parent
110cb5d0d5
commit
b6c014c731
@ -1739,6 +1739,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
|||||||
CXX_WARN_UNUSED_PARAMETER -Wunused-parameter
|
CXX_WARN_UNUSED_PARAMETER -Wunused-parameter
|
||||||
CXX_WARN_WRITE_STRINGS -Wwrite-strings
|
CXX_WARN_WRITE_STRINGS -Wwrite-strings
|
||||||
CXX_WARN_UNDEF -Wundef
|
CXX_WARN_UNDEF -Wundef
|
||||||
|
CXX_WARN_COMMA_SUBSCRIPT -Wcomma-subscript
|
||||||
CXX_WARN_FORMAT_SIGN -Wformat-signedness
|
CXX_WARN_FORMAT_SIGN -Wformat-signedness
|
||||||
CXX_WARN_RESTRICT -Wrestrict
|
CXX_WARN_RESTRICT -Wrestrict
|
||||||
CXX_WARN_NO_SUGGEST_OVERRIDE -Wno-suggest-override
|
CXX_WARN_NO_SUGGEST_OVERRIDE -Wno-suggest-override
|
||||||
|
@ -37,9 +37,9 @@ enum {
|
|||||||
|
|
||||||
#define BLI_buffer_at(buffer_, type_, index_) \
|
#define BLI_buffer_at(buffer_, type_, index_) \
|
||||||
((((type_ *)(buffer_) \
|
((((type_ *)(buffer_) \
|
||||||
->data)[(BLI_assert(sizeof(type_) == (buffer_)->elem_size)), \
|
->data)[((BLI_assert(sizeof(type_) == (buffer_)->elem_size)), \
|
||||||
(BLI_assert((int)(index_) >= 0 && (size_t)(index_) < (buffer_)->count)), \
|
(BLI_assert((int)(index_) >= 0 && (size_t)(index_) < (buffer_)->count)), \
|
||||||
index_]))
|
index_)]))
|
||||||
|
|
||||||
#define BLI_buffer_array(buffer_, type_) (&(BLI_buffer_at(buffer_, type_, 0)))
|
#define BLI_buffer_array(buffer_, type_) (&(BLI_buffer_at(buffer_, type_, 0)))
|
||||||
|
|
||||||
@ -50,8 +50,8 @@ enum {
|
|||||||
((BLI_buffer_reinit(buffer_, new_count_), new_count_ ? BLI_buffer_array(buffer_, type_) : NULL))
|
((BLI_buffer_reinit(buffer_, new_count_), new_count_ ? BLI_buffer_array(buffer_, type_) : NULL))
|
||||||
|
|
||||||
#define BLI_buffer_append(buffer_, type_, val_) \
|
#define BLI_buffer_append(buffer_, type_, val_) \
|
||||||
(BLI_buffer_resize(buffer_, (buffer_)->count + 1), \
|
((BLI_buffer_resize(buffer_, (buffer_)->count + 1), \
|
||||||
(BLI_buffer_at(buffer_, type_, (buffer_)->count - 1) = val_))
|
(BLI_buffer_at(buffer_, type_, (buffer_)->count - 1) = val_)))
|
||||||
|
|
||||||
#define BLI_buffer_clear(buffer_) \
|
#define BLI_buffer_clear(buffer_) \
|
||||||
{ \
|
{ \
|
||||||
|
Loading…
Reference in New Issue
Block a user