Fixed a few warnings of GCC at "-Wall" level.
This commit is contained in:
parent
a1d8935b2b
commit
30d981a6ff
@ -1,6 +1,6 @@
|
||||
include ../../config.mk
|
||||
|
||||
CFLAGS = -std=c99 -D_DEFAULT_SOURCE -Wpedantic -I../../libhashset/include $(XCFLAGS)
|
||||
CFLAGS = -std=c99 -D_DEFAULT_SOURCE -Wall -Wpedantic -I../../libhashset/include $(XCFLAGS)
|
||||
LDFLAGS = -L../../libhashset/lib -lhashset-1 $(XLDFLAGS)
|
||||
|
||||
SRC_PATH := src
|
||||
|
@ -1,6 +1,6 @@
|
||||
include ../../config.mk
|
||||
|
||||
CFLAGS = -std=c99 -D_DEFAULT_SOURCE -Wpedantic -I../../libhashset/include $(XCFLAGS)
|
||||
CFLAGS = -std=c99 -D_DEFAULT_SOURCE -Wall -Wpedantic -I../../libhashset/include $(XCFLAGS)
|
||||
LDFLAGS = -L../../libhashset/lib -lhashset-1 $(XLDFLAGS)
|
||||
|
||||
SRC_PATH := src
|
||||
|
@ -1,6 +1,6 @@
|
||||
include ../config.mk
|
||||
|
||||
CFLAGS = -std=c99 -D_DEFAULT_SOURCE -Wpedantic -Iinclude -fPIC $(XCFLAGS)
|
||||
CFLAGS = -std=c99 -D_DEFAULT_SOURCE -Wall -Wpedantic -Iinclude -fPIC $(XCFLAGS)
|
||||
|
||||
SRC_PATH := src
|
||||
OBJ_PATH := obj
|
||||
|
@ -3,6 +3,10 @@
|
||||
/* This work has been released under the CC0 1.0 Universal license! */
|
||||
/******************************************************************************/
|
||||
|
||||
#ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
@ -21,9 +25,4 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
void __attribute__((constructor)) libhashet_init(void) { /*noop*/ }
|
||||
void __attribute__((destructor)) libhashet_exit(void) { /*noop*/ }
|
||||
|
||||
#endif
|
||||
|
@ -162,7 +162,7 @@ static INLINE size_t compute_limit(const size_t capacity, const double load_fact
|
||||
|
||||
static INLINE errno_t rebuild_map(hash_map_t *const instance, const size_t new_capacity)
|
||||
{
|
||||
size_t k, index;
|
||||
size_t k, index = SIZE_MAX;
|
||||
hash_data_t temp;
|
||||
|
||||
if (new_capacity < instance->valid)
|
||||
@ -234,7 +234,7 @@ void DECLARE(hash_map_destroy)(hash_map_t *instance)
|
||||
|
||||
errno_t DECLARE(hash_map_insert)(hash_map_t *const instance, const value_t key, const value_t value)
|
||||
{
|
||||
size_t index;
|
||||
size_t index = SIZE_MAX;
|
||||
bool_t slot_reused;
|
||||
|
||||
if ((!instance) || (!instance->data.keys))
|
||||
|
@ -151,7 +151,7 @@ static INLINE size_t compute_limit(const size_t capacity, const double load_fact
|
||||
|
||||
static INLINE errno_t rebuild_set(hash_set_t *const instance, const size_t new_capacity)
|
||||
{
|
||||
size_t k, index;
|
||||
size_t k, index = SIZE_MAX;
|
||||
hash_data_t temp;
|
||||
|
||||
if (new_capacity < instance->valid)
|
||||
@ -223,7 +223,7 @@ void DECLARE(hash_set_destroy)(hash_set_t *instance)
|
||||
|
||||
errno_t DECLARE(hash_set_insert)(hash_set_t *const instance, const value_t item)
|
||||
{
|
||||
size_t index;
|
||||
size_t index = SIZE_MAX;
|
||||
bool_t slot_reused;
|
||||
|
||||
if ((!instance) || (!instance->data.items))
|
||||
|
@ -1,6 +1,6 @@
|
||||
include ../../config.mk
|
||||
|
||||
CFLAGS = -std=c99 -D_DEFAULT_SOURCE -Wpedantic -I../../libhashset/include -I../shared/include $(XCFLAGS)
|
||||
CFLAGS = -std=c99 -D_DEFAULT_SOURCE -Wall -Wpedantic -I../../libhashset/include -I../shared/include $(XCFLAGS)
|
||||
LDFLAGS = -L../../libhashset/lib -lhashset-1 $(XLDFLAGS)
|
||||
|
||||
SRC_PATH := src
|
||||
|
@ -1,6 +1,6 @@
|
||||
include ../../config.mk
|
||||
|
||||
CFLAGS = -std=c99 -D_DEFAULT_SOURCE -Wpedantic -I../../libhashset/include -I../shared/include $(XCFLAGS)
|
||||
CFLAGS = -std=c99 -D_DEFAULT_SOURCE -Wall -Wpedantic -I../../libhashset/include -I../shared/include $(XCFLAGS)
|
||||
LDFLAGS = -L../../libhashset/lib -lhashset-1 $(XLDFLAGS)
|
||||
|
||||
SRC_PATH := src
|
||||
|
@ -101,7 +101,7 @@ int test_function_1(hash_set64_t *const hash_set)
|
||||
for (i = 0; i < MAXIMUM; ++i)
|
||||
{
|
||||
const errno_t error = hash_set_contains64(hash_set, i);
|
||||
if (error != ((i != 3167U) && (i != 9887U) && (i != 387083U)) ? 0 : ENOENT)
|
||||
if (error != (((i != 3167U) && (i != 9887U) && (i != 387083U)) ? 0 : ENOENT))
|
||||
{
|
||||
printf("Contains operation has failed! (error: %d)\n", error);
|
||||
return EXIT_FAILURE;
|
||||
|
Loading…
Reference in New Issue
Block a user