mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
Add -Wdouble-promotion compiler flag
This commit is contained in:
parent
40e3781e9b
commit
3f349a4258
@ -41,6 +41,7 @@ if (ENABLE_CUSTOM_COMPILER_FLAGS)
|
|||||||
-Wc++-compat
|
-Wc++-compat
|
||||||
-fstack-protector-strong
|
-fstack-protector-strong
|
||||||
-Wcomma
|
-Wcomma
|
||||||
|
-Wdouble-promotion
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
2
cJSON.c
2
cJSON.c
@ -1914,7 +1914,7 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count)
|
|||||||
|
|
||||||
for(i = 0; a && (i < (size_t)count); i++)
|
for(i = 0; a && (i < (size_t)count); i++)
|
||||||
{
|
{
|
||||||
n = cJSON_CreateNumber(numbers[i]);
|
n = cJSON_CreateNumber((double)numbers[i]);
|
||||||
if(!n)
|
if(!n)
|
||||||
{
|
{
|
||||||
cJSON_Delete(a);
|
cJSON_Delete(a);
|
||||||
|
Loading…
Reference in New Issue
Block a user