mirror of
https://github.com/neovim/neovim.git
synced 2025-09-09 12:58:16 +00:00
*: Fix gcc warnings
This commit is contained in:
@@ -107,7 +107,7 @@ static inline int json_decoder_pop(ValuesStackItem obj,
|
|||||||
// vval.v_list and vval.v_dict should have the same size and offset
|
// vval.v_list and vval.v_dict should have the same size and offset
|
||||||
&& ((void *) obj.val.vval.v_list
|
&& ((void *) obj.val.vval.v_list
|
||||||
== (void *) last_container.container.vval.v_list)) {
|
== (void *) last_container.container.vval.v_list)) {
|
||||||
kv_pop(*container_stack);
|
(void) kv_pop(*container_stack);
|
||||||
val_location = last_container.s;
|
val_location = last_container.s;
|
||||||
last_container = kv_last(*container_stack);
|
last_container = kv_last(*container_stack);
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,7 @@ static inline int json_decoder_pop(ValuesStackItem obj,
|
|||||||
clear_tv(&obj.val);
|
clear_tv(&obj.val);
|
||||||
|
|
||||||
// Restart
|
// Restart
|
||||||
kv_pop(*container_stack);
|
(void) kv_pop(*container_stack);
|
||||||
ValuesStackItem last_container_val =
|
ValuesStackItem last_container_val =
|
||||||
kv_A(*stack, last_container.stack_index);
|
kv_A(*stack, last_container.stack_index);
|
||||||
while (kv_size(*stack) > last_container.stack_index) {
|
while (kv_size(*stack) > last_container.stack_index) {
|
||||||
@@ -266,7 +266,7 @@ json_decode_string_cycle_start:
|
|||||||
}
|
}
|
||||||
if (kv_size(stack) == 1) {
|
if (kv_size(stack) == 1) {
|
||||||
p++;
|
p++;
|
||||||
kv_pop(container_stack);
|
(void) kv_pop(container_stack);
|
||||||
goto json_decode_string_after_cycle;
|
goto json_decode_string_after_cycle;
|
||||||
} else {
|
} else {
|
||||||
if (json_decoder_pop(kv_pop(stack), &stack, &container_stack, &p,
|
if (json_decoder_pop(kv_pop(stack), &stack, &container_stack, &p,
|
||||||
|
@@ -755,7 +755,7 @@ encode_vim_to_##name##_error_ret: \
|
|||||||
char ebuf[NUMBUFLEN + 7]; \
|
char ebuf[NUMBUFLEN + 7]; \
|
||||||
size_t backref = 0; \
|
size_t backref = 0; \
|
||||||
for (; backref < kv_size(*mpstack); backref++) { \
|
for (; backref < kv_size(*mpstack); backref++) { \
|
||||||
const MPConvStackVal mpval = kv_a(MPConvStackVal, *mpstack, backref); \
|
const MPConvStackVal mpval = kv_A(*mpstack, backref); \
|
||||||
if (mpval.type == conv_type) { \
|
if (mpval.type == conv_type) { \
|
||||||
if (conv_type == kMPConvDict) { \
|
if (conv_type == kMPConvDict) { \
|
||||||
if ((void *) mpval.data.d.dict == (void *) (val)) { \
|
if ((void *) mpval.data.d.dict == (void *) (val)) { \
|
||||||
@@ -783,7 +783,7 @@ DEFINE_VIML_CONV_FUNCTIONS(static, string, garray_T *const, gap)
|
|||||||
char ebuf[NUMBUFLEN + 7]; \
|
char ebuf[NUMBUFLEN + 7]; \
|
||||||
size_t backref = 0; \
|
size_t backref = 0; \
|
||||||
for (; backref < kv_size(*mpstack); backref++) { \
|
for (; backref < kv_size(*mpstack); backref++) { \
|
||||||
const MPConvStackVal mpval = kv_a(MPConvStackVal, *mpstack, backref); \
|
const MPConvStackVal mpval = kv_A(*mpstack, backref); \
|
||||||
if (mpval.type == conv_type) { \
|
if (mpval.type == conv_type) { \
|
||||||
if (conv_type == kMPConvDict) { \
|
if (conv_type == kMPConvDict) { \
|
||||||
if ((void *) mpval.data.d.dict == (void *) val) { \
|
if ((void *) mpval.data.d.dict == (void *) val) { \
|
||||||
@@ -932,7 +932,7 @@ static inline int convert_to_json_string(garray_T *const gap,
|
|||||||
} else if (vim_isprintc(ch)) {
|
} else if (vim_isprintc(ch)) {
|
||||||
str_len += shift;
|
str_len += shift;
|
||||||
} else {
|
} else {
|
||||||
str_len += ((sizeof("\\u1234") - 1) * (1 + (ch > 0xFFFF)));
|
str_len += ((sizeof("\\u1234") - 1) * (size_t) (1 + (ch > 0xFFFF)));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -969,9 +969,9 @@ static inline int convert_to_json_string(garray_T *const gap,
|
|||||||
xdigits[(ch >> (4 * 0)) & 0xF],
|
xdigits[(ch >> (4 * 0)) & 0xF],
|
||||||
}), sizeof("\\u1234") - 1);
|
}), sizeof("\\u1234") - 1);
|
||||||
} else {
|
} else {
|
||||||
uint32_t tmp = (uint32_t) ch - SURROGATE_FIRST_CHAR;
|
const int tmp = ch - SURROGATE_FIRST_CHAR;
|
||||||
uint16_t hi = SURROGATE_HI_START + ((tmp >> 10) & ((1 << 10) - 1));
|
const int hi = SURROGATE_HI_START + ((tmp >> 10) & ((1 << 10) - 1));
|
||||||
uint16_t lo = SURROGATE_LO_END + ((tmp >> 0) & ((1 << 10) - 1));
|
const int lo = SURROGATE_LO_END + ((tmp >> 0) & ((1 << 10) - 1));
|
||||||
ga_concat_len(gap, ((const char[]) {
|
ga_concat_len(gap, ((const char[]) {
|
||||||
'\\', 'u',
|
'\\', 'u',
|
||||||
xdigits[(hi >> (4 * 3)) & 0xF],
|
xdigits[(hi >> (4 * 3)) & 0xF],
|
||||||
|
@@ -204,7 +204,7 @@ void ga_concat_len(garray_T *const gap, const char *restrict s,
|
|||||||
ga_grow(gap, (int) len);
|
ga_grow(gap, (int) len);
|
||||||
char *data = gap->ga_data;
|
char *data = gap->ga_data;
|
||||||
memcpy(data + gap->ga_len, s, len);
|
memcpy(data + gap->ga_len, s, len);
|
||||||
gap->ga_len += len;
|
gap->ga_len += (int) len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user