diff options
| author | Eli Zaretskii | 2021-03-03 20:15:58 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2021-03-03 20:15:58 +0200 |
| commit | 30810905de7662b36b7ac9275bb9cbb2a563c277 (patch) | |
| tree | 2aca3873e6da4118c7f2a3123fc1160a1162f05f /src | |
| parent | e5a0d4c42583fe38e38ab7782b8928ca54f82fad (diff) | |
| download | emacs-30810905de7662b36b7ac9275bb9cbb2a563c277.tar.gz emacs-30810905de7662b36b7ac9275bb9cbb2a563c277.zip | |
Fix compilation warnings in --with-wide-int build on Windows
* src/comp.c (emit_rvalue_from_emacs_uint)
(emit_rvalue_from_lisp_word_tag): Fix comparison of unsigned
values.
(gcc_jit_context_new_rvalue_from_ptr): Define only if
LISP_WORDS_ARE_POINTERS, to avoid compilation warning.
(init_gccjit_functions): Load gcc_jit_context_new_rvalue_from_ptr
only if LISP_WORDS_ARE_POINTERS.
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/comp.c b/src/comp.c index 21d1c1a23cf..d74f8328fda 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -179,8 +179,10 @@ DEF_DLL_FN (gcc_jit_rvalue *, gcc_jit_context_new_comparison, | |||
| 179 | enum gcc_jit_comparison op, gcc_jit_rvalue *a, gcc_jit_rvalue *b)); | 179 | enum gcc_jit_comparison op, gcc_jit_rvalue *a, gcc_jit_rvalue *b)); |
| 180 | DEF_DLL_FN (gcc_jit_rvalue *, gcc_jit_context_new_rvalue_from_long, | 180 | DEF_DLL_FN (gcc_jit_rvalue *, gcc_jit_context_new_rvalue_from_long, |
| 181 | (gcc_jit_context *ctxt, gcc_jit_type *numeric_type, long value)); | 181 | (gcc_jit_context *ctxt, gcc_jit_type *numeric_type, long value)); |
| 182 | #if LISP_WORDS_ARE_POINTERS | ||
| 182 | DEF_DLL_FN (gcc_jit_rvalue *, gcc_jit_context_new_rvalue_from_ptr, | 183 | DEF_DLL_FN (gcc_jit_rvalue *, gcc_jit_context_new_rvalue_from_ptr, |
| 183 | (gcc_jit_context *ctxt, gcc_jit_type *pointer_type, void *value)); | 184 | (gcc_jit_context *ctxt, gcc_jit_type *pointer_type, void *value)); |
| 185 | #endif | ||
| 184 | DEF_DLL_FN (gcc_jit_rvalue *, gcc_jit_context_new_string_literal, | 186 | DEF_DLL_FN (gcc_jit_rvalue *, gcc_jit_context_new_string_literal, |
| 185 | (gcc_jit_context *ctxt, const char *value)); | 187 | (gcc_jit_context *ctxt, const char *value)); |
| 186 | DEF_DLL_FN (gcc_jit_rvalue *, gcc_jit_context_new_unary_op, | 188 | DEF_DLL_FN (gcc_jit_rvalue *, gcc_jit_context_new_unary_op, |
| @@ -290,7 +292,9 @@ init_gccjit_functions (void) | |||
| 290 | LOAD_DLL_FN (library, gcc_jit_context_new_param); | 292 | LOAD_DLL_FN (library, gcc_jit_context_new_param); |
| 291 | LOAD_DLL_FN (library, gcc_jit_context_new_rvalue_from_int); | 293 | LOAD_DLL_FN (library, gcc_jit_context_new_rvalue_from_int); |
| 292 | LOAD_DLL_FN (library, gcc_jit_context_new_rvalue_from_long); | 294 | LOAD_DLL_FN (library, gcc_jit_context_new_rvalue_from_long); |
| 295 | #if LISP_WORDS_ARE_POINTERS | ||
| 293 | LOAD_DLL_FN (library, gcc_jit_context_new_rvalue_from_ptr); | 296 | LOAD_DLL_FN (library, gcc_jit_context_new_rvalue_from_ptr); |
| 297 | #endif | ||
| 294 | LOAD_DLL_FN (library, gcc_jit_context_new_string_literal); | 298 | LOAD_DLL_FN (library, gcc_jit_context_new_string_literal); |
| 295 | LOAD_DLL_FN (library, gcc_jit_context_new_struct_type); | 299 | LOAD_DLL_FN (library, gcc_jit_context_new_struct_type); |
| 296 | LOAD_DLL_FN (library, gcc_jit_context_new_unary_op); | 300 | LOAD_DLL_FN (library, gcc_jit_context_new_unary_op); |
| @@ -357,7 +361,9 @@ init_gccjit_functions (void) | |||
| 357 | #define gcc_jit_context_new_param fn_gcc_jit_context_new_param | 361 | #define gcc_jit_context_new_param fn_gcc_jit_context_new_param |
| 358 | #define gcc_jit_context_new_rvalue_from_int fn_gcc_jit_context_new_rvalue_from_int | 362 | #define gcc_jit_context_new_rvalue_from_int fn_gcc_jit_context_new_rvalue_from_int |
| 359 | #define gcc_jit_context_new_rvalue_from_long fn_gcc_jit_context_new_rvalue_from_long | 363 | #define gcc_jit_context_new_rvalue_from_long fn_gcc_jit_context_new_rvalue_from_long |
| 360 | #define gcc_jit_context_new_rvalue_from_ptr fn_gcc_jit_context_new_rvalue_from_ptr | 364 | #if LISP_WORDS_ARE_POINTERS |
| 365 | # define gcc_jit_context_new_rvalue_from_ptr fn_gcc_jit_context_new_rvalue_from_ptr | ||
| 366 | #endif | ||
| 361 | #define gcc_jit_context_new_string_literal fn_gcc_jit_context_new_string_literal | 367 | #define gcc_jit_context_new_string_literal fn_gcc_jit_context_new_string_literal |
| 362 | #define gcc_jit_context_new_struct_type fn_gcc_jit_context_new_struct_type | 368 | #define gcc_jit_context_new_struct_type fn_gcc_jit_context_new_struct_type |
| 363 | #define gcc_jit_context_new_unary_op fn_gcc_jit_context_new_unary_op | 369 | #define gcc_jit_context_new_unary_op fn_gcc_jit_context_new_unary_op |
| @@ -1137,7 +1143,7 @@ static gcc_jit_rvalue * | |||
| 1137 | emit_rvalue_from_emacs_uint (EMACS_UINT val) | 1143 | emit_rvalue_from_emacs_uint (EMACS_UINT val) |
| 1138 | { | 1144 | { |
| 1139 | #ifdef WIDE_EMACS_INT | 1145 | #ifdef WIDE_EMACS_INT |
| 1140 | if (val > LONG_MAX || val < LONG_MIN) | 1146 | if (val > ULONG_MAX) |
| 1141 | return emit_rvalue_from_long_long (comp.emacs_uint_type, val); | 1147 | return emit_rvalue_from_long_long (comp.emacs_uint_type, val); |
| 1142 | #endif | 1148 | #endif |
| 1143 | return gcc_jit_context_new_rvalue_from_long (comp.ctxt, | 1149 | return gcc_jit_context_new_rvalue_from_long (comp.ctxt, |
| @@ -1159,7 +1165,7 @@ static gcc_jit_rvalue * | |||
| 1159 | emit_rvalue_from_lisp_word_tag (Lisp_Word_tag val) | 1165 | emit_rvalue_from_lisp_word_tag (Lisp_Word_tag val) |
| 1160 | { | 1166 | { |
| 1161 | #ifdef WIDE_EMACS_INT | 1167 | #ifdef WIDE_EMACS_INT |
| 1162 | if (val > LONG_MAX || val < LONG_MIN) | 1168 | if (val > ULONG_MAX) |
| 1163 | return emit_rvalue_from_long_long (comp.lisp_word_tag_type, val); | 1169 | return emit_rvalue_from_long_long (comp.lisp_word_tag_type, val); |
| 1164 | #endif | 1170 | #endif |
| 1165 | return gcc_jit_context_new_rvalue_from_long (comp.ctxt, | 1171 | return gcc_jit_context_new_rvalue_from_long (comp.ctxt, |