aboutsummaryrefslogtreecommitdiffstats
path: root/src/comp.c
diff options
context:
space:
mode:
authorAndrea Corallo2019-11-19 21:53:19 +0100
committerAndrea Corallo2020-01-01 11:38:08 +0100
commit37989f9431bc32f7ebac76cfc02f5e1d03486bcf (patch)
treea74c80af6a9b788789363589481cfbf337a7ebb6 /src/comp.c
parente97826ab845597fe09be43b2df888e96c7502bee (diff)
downloademacs-37989f9431bc32f7ebac76cfc02f5e1d03486bcf.tar.gz
emacs-37989f9431bc32f7ebac76cfc02f5e1d03486bcf.zip
remove unsigned in favor of ptrdiff_t
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/comp.c b/src/comp.c
index 31f6c8dbd25..e604c31c5fe 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -362,7 +362,7 @@ declare_imported_func (Lisp_Object subr_sym, gcc_jit_type *ret_type,
362 else if (!types) 362 else if (!types)
363 { 363 {
364 types = alloca (nargs * sizeof (* types)); 364 types = alloca (nargs * sizeof (* types));
365 for (unsigned i = 0; i < nargs; i++) 365 for (ptrdiff_t i = 0; i < nargs; i++)
366 types[i] = comp.lisp_obj_type; 366 types[i] = comp.lisp_obj_type;
367 } 367 }
368 368
@@ -390,7 +390,7 @@ declare_imported_func (Lisp_Object subr_sym, gcc_jit_type *ret_type,
390 390
391/* Emit calls fetching from existing declarations. */ 391/* Emit calls fetching from existing declarations. */
392static gcc_jit_rvalue * 392static gcc_jit_rvalue *
393emit_call (Lisp_Object subr_sym, gcc_jit_type *ret_type, unsigned nargs, 393emit_call (Lisp_Object subr_sym, gcc_jit_type *ret_type, ptrdiff_t nargs,
394 gcc_jit_rvalue **args, bool direct) 394 gcc_jit_rvalue **args, bool direct)
395{ 395{
396 Lisp_Object func = 396 Lisp_Object func =
@@ -426,7 +426,7 @@ emit_call (Lisp_Object subr_sym, gcc_jit_type *ret_type, unsigned nargs,
426} 426}
427 427
428static gcc_jit_rvalue * 428static gcc_jit_rvalue *
429emit_call_ref (Lisp_Object subr_sym, unsigned nargs, 429emit_call_ref (Lisp_Object subr_sym, ptrdiff_t nargs,
430 gcc_jit_lvalue *base_arg, bool direct) 430 gcc_jit_lvalue *base_arg, bool direct)
431{ 431{
432 gcc_jit_rvalue *args[] = 432 gcc_jit_rvalue *args[] =
@@ -468,7 +468,7 @@ emit_cond_jump (gcc_jit_rvalue *test,
468static gcc_jit_rvalue * 468static gcc_jit_rvalue *
469emit_cast (gcc_jit_type *new_type, gcc_jit_rvalue *obj) 469emit_cast (gcc_jit_type *new_type, gcc_jit_rvalue *obj)
470{ 470{
471 static unsigned i; 471 static ptrdiff_t i;
472 472
473 gcc_jit_field *orig_field = 473 gcc_jit_field *orig_field =
474 type_to_cast_field (gcc_jit_rvalue_get_type (obj)); 474 type_to_cast_field (gcc_jit_rvalue_get_type (obj));
@@ -478,7 +478,7 @@ emit_cast (gcc_jit_type *new_type, gcc_jit_rvalue *obj)
478 gcc_jit_function_new_local (comp.func, 478 gcc_jit_function_new_local (comp.func,
479 NULL, 479 NULL,
480 comp.cast_union_type, 480 comp.cast_union_type,
481 format_string ("union_cast_%u", i++)); 481 format_string ("union_cast_%td", i++));
482 gcc_jit_block_add_assignment (comp.block, 482 gcc_jit_block_add_assignment (comp.block,
483 NULL, 483 NULL,
484 gcc_jit_lvalue_access_field (tmp_u, 484 gcc_jit_lvalue_access_field (tmp_u,
@@ -566,7 +566,7 @@ emit_lval_XLP (gcc_jit_lvalue *obj)
566 comp.lisp_obj_as_ptr); 566 comp.lisp_obj_as_ptr);
567} */ 567} */
568static gcc_jit_rvalue * 568static gcc_jit_rvalue *
569emit_XUNTAG (gcc_jit_rvalue *a, gcc_jit_type *type, unsigned lisp_word_tag) 569emit_XUNTAG (gcc_jit_rvalue *a, gcc_jit_type *type, ptrdiff_t lisp_word_tag)
570{ 570{
571 /* #define XUNTAG(a, type, ctype) ((ctype *) 571 /* #define XUNTAG(a, type, ctype) ((ctype *)
572 ((char *) XLP (a) - LISP_WORD_TAG (type))) */ 572 ((char *) XLP (a) - LISP_WORD_TAG (type))) */
@@ -608,7 +608,7 @@ emit_EQ (gcc_jit_rvalue *x, gcc_jit_rvalue *y)
608} 608}
609 609
610static gcc_jit_rvalue * 610static gcc_jit_rvalue *
611emit_TAGGEDP (gcc_jit_rvalue *obj, unsigned tag) 611emit_TAGGEDP (gcc_jit_rvalue *obj, ptrdiff_t tag)
612{ 612{
613 /* (! (((unsigned) (XLI (a) >> (USE_LSB_TAG ? 0 : VALBITS)) \ 613 /* (! (((unsigned) (XLI (a) >> (USE_LSB_TAG ? 0 : VALBITS)) \
614 - (unsigned) (tag)) \ 614 - (unsigned) (tag)) \
@@ -1211,7 +1211,7 @@ emit_limple_insn (Lisp_Object insn)
1211 Lisp_Object arg[6]; 1211 Lisp_Object arg[6];
1212 1212
1213 Lisp_Object p = XCDR (insn); 1213 Lisp_Object p = XCDR (insn);
1214 unsigned i = 0; 1214 ptrdiff_t i = 0;
1215 FOR_EACH_TAIL (p) 1215 FOR_EACH_TAIL (p)
1216 { 1216 {
1217 if (i == sizeof (arg) / sizeof (Lisp_Object)) 1217 if (i == sizeof (arg) / sizeof (Lisp_Object))
@@ -2428,7 +2428,7 @@ define_add1_sub1 (void)
2428 { comp.most_positive_fixnum, comp.most_negative_fixnum }; 2428 { comp.most_positive_fixnum, comp.most_negative_fixnum };
2429 enum gcc_jit_binary_op op[] = 2429 enum gcc_jit_binary_op op[] =
2430 { GCC_JIT_BINARY_OP_PLUS, GCC_JIT_BINARY_OP_MINUS }; 2430 { GCC_JIT_BINARY_OP_PLUS, GCC_JIT_BINARY_OP_MINUS };
2431 for (unsigned i = 0; i < 2; i++) 2431 for (ptrdiff_t i = 0; i < 2; i++)
2432 { 2432 {
2433 gcc_jit_param *param[] = 2433 gcc_jit_param *param[] =
2434 { gcc_jit_context_new_param (comp.ctxt, 2434 { gcc_jit_context_new_param (comp.ctxt,
@@ -2741,7 +2741,7 @@ declare_function (Lisp_Object func)
2741 { 2741 {
2742 EMACS_INT max_args = XFIXNUM (CALL1I (comp-args-max, args)); 2742 EMACS_INT max_args = XFIXNUM (CALL1I (comp-args-max, args));
2743 gcc_jit_type **type = SAFE_ALLOCA (max_args * sizeof (*type)); 2743 gcc_jit_type **type = SAFE_ALLOCA (max_args * sizeof (*type));
2744 for (unsigned i = 0; i < max_args; i++) 2744 for (ptrdiff_t i = 0; i < max_args; i++)
2745 type[i] = comp.lisp_obj_type; 2745 type[i] = comp.lisp_obj_type;
2746 2746
2747 gcc_jit_param **param = SAFE_ALLOCA (max_args *sizeof (*param)); 2747 gcc_jit_param **param = SAFE_ALLOCA (max_args *sizeof (*param));
@@ -2825,12 +2825,12 @@ compile_function (Lisp_Object func)
2825 if (SPEED >= 2) 2825 if (SPEED >= 2)
2826 { 2826 {
2827 comp.f_frame = SAFE_ALLOCA (frame_size * sizeof (*comp.f_frame)); 2827 comp.f_frame = SAFE_ALLOCA (frame_size * sizeof (*comp.f_frame));
2828 for (unsigned i = 0; i < frame_size; ++i) 2828 for (ptrdiff_t i = 0; i < frame_size; ++i)
2829 comp.f_frame[i] = 2829 comp.f_frame[i] =
2830 gcc_jit_function_new_local (comp.func, 2830 gcc_jit_function_new_local (comp.func,
2831 NULL, 2831 NULL,
2832 comp.lisp_obj_type, 2832 comp.lisp_obj_type,
2833 format_string ("local%u", i)); 2833 format_string ("local%td", i));
2834 } 2834 }
2835 2835
2836 comp.scratch = NULL; 2836 comp.scratch = NULL;