Fix build failures on CentOS 6
The older C++ compiler doesn't support struct initialization with explicit values. In addition to this, fixed a few other warnings that caused errors.
This commit is contained in:
@ -94,7 +94,7 @@ void atomic_store_int32(int *variable, int value)
|
|||||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||||
__atomic_store_n(variable, value, __ATOMIC_SEQ_CST);
|
__atomic_store_n(variable, value, __ATOMIC_SEQ_CST);
|
||||||
#else
|
#else
|
||||||
__sync_lock_test_and_set(variable, value);
|
(void)__sync_lock_test_and_set(variable, value);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ void atomic_store_int64(int64_t *variable, int64_t value)
|
|||||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||||
__atomic_store_n(variable, value, __ATOMIC_SEQ_CST);
|
__atomic_store_n(variable, value, __ATOMIC_SEQ_CST);
|
||||||
#else
|
#else
|
||||||
__sync_lock_test_and_set(variable, value);
|
(void)__sync_lock_test_and_set(variable, value);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ void atomic_store_uint64(uint64_t *variable, uint64_t value)
|
|||||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||||
__atomic_store_n(variable, value, __ATOMIC_SEQ_CST);
|
__atomic_store_n(variable, value, __ATOMIC_SEQ_CST);
|
||||||
#else
|
#else
|
||||||
__sync_lock_test_and_set(variable, value);
|
(void)__sync_lock_test_and_set(variable, value);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,6 +121,6 @@ void atomic_store_ptr(void **variable, void *value)
|
|||||||
#ifdef MXS_USE_ATOMIC_BUILTINS
|
#ifdef MXS_USE_ATOMIC_BUILTINS
|
||||||
__atomic_store_n(variable, value, __ATOMIC_SEQ_CST);
|
__atomic_store_n(variable, value, __ATOMIC_SEQ_CST);
|
||||||
#else
|
#else
|
||||||
__sync_lock_test_and_set(variable, value);
|
(void)__sync_lock_test_and_set(variable, value);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
struct
|
static struct
|
||||||
{
|
{
|
||||||
bool initialized;
|
bool initialized;
|
||||||
int pipe_flags;
|
int pipe_flags;
|
||||||
|
|||||||
@ -43,7 +43,8 @@ int test_validity()
|
|||||||
{MXS_END_MODULE_PARAMS}
|
{MXS_END_MODULE_PARAMS}
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG_CONTEXT ctx = {.object = (char*)""};
|
CONFIG_CONTEXT ctx = {};
|
||||||
|
ctx.object = (char*)"";
|
||||||
|
|
||||||
/** Int parameter */
|
/** Int parameter */
|
||||||
TEST(config_param_is_valid(params, "p1", "1", &ctx));
|
TEST(config_param_is_valid(params, "p1", "1", &ctx));
|
||||||
@ -90,7 +91,8 @@ int test_validity()
|
|||||||
TEST(!config_param_is_valid(params, "p6", "This is not a valid path", &ctx));
|
TEST(!config_param_is_valid(params, "p6", "This is not a valid path", &ctx));
|
||||||
|
|
||||||
/** Service parameter */
|
/** Service parameter */
|
||||||
CONFIG_CONTEXT svc = {.object = (char*)"test-service"};
|
CONFIG_CONTEXT svc = {};
|
||||||
|
svc.object = (char*)"test-service";
|
||||||
ctx.next = &svc;
|
ctx.next = &svc;
|
||||||
config_add_param(&svc, "type", "service");
|
config_add_param(&svc, "type", "service");
|
||||||
TEST(config_param_is_valid(params, "p7", "test-service", &ctx));
|
TEST(config_param_is_valid(params, "p7", "test-service", &ctx));
|
||||||
@ -193,7 +195,8 @@ int test_required_parameters()
|
|||||||
{MXS_END_MODULE_PARAMS}
|
{MXS_END_MODULE_PARAMS}
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG_CONTEXT ctx = {.object = (char*)""};
|
CONFIG_CONTEXT ctx = {};
|
||||||
|
ctx.object = (char*)"";
|
||||||
|
|
||||||
TEST(missing_required_parameters(params, ctx.parameters));
|
TEST(missing_required_parameters(params, ctx.parameters));
|
||||||
config_add_defaults(&ctx, params);
|
config_add_defaults(&ctx, params);
|
||||||
|
|||||||
Reference in New Issue
Block a user