Commit c7b72e28 c7b72e28a2825d64581626d32f80185447420040 by Sergey Poznyakoff

(struct mh_machine): Changed type of arg_num to long.

1 parent 442ca3c9
...@@ -35,7 +35,7 @@ struct mh_machine ...@@ -35,7 +35,7 @@ struct mh_machine
35 int reg_num; /* Numeric register */ 35 int reg_num; /* Numeric register */
36 36
37 strobj_t arg_str; /* String argument */ 37 strobj_t arg_str; /* String argument */
38 int arg_num; /* Numeric argument */ 38 long arg_num; /* Numeric argument */
39 39
40 size_t pc; /* Program counter */ 40 size_t pc; /* Program counter */
41 size_t progsize; /* Size of allocated program*/ 41 size_t progsize; /* Size of allocated program*/
...@@ -351,7 +351,7 @@ mh_format (mh_format_t *fmt, message_t msg, size_t msgno, ...@@ -351,7 +351,7 @@ mh_format (mh_format_t *fmt, message_t msg, size_t msgno,
351 351
352 /* Convert arg_num to arg_str */ 352 /* Convert arg_num to arg_str */
353 case mhop_num_to_str: 353 case mhop_num_to_str:
354 snprintf (buf, sizeof buf, "%d", mach.arg_num); 354 snprintf (buf, sizeof buf, "%l", mach.arg_num);
355 strobj_free (&mach.arg_str); 355 strobj_free (&mach.arg_str);
356 strobj_create (&mach.arg_str, buf); 356 strobj_create (&mach.arg_str, buf);
357 break; 357 break;
...@@ -643,7 +643,9 @@ builtin_cur (struct mh_machine *mach) ...@@ -643,7 +643,9 @@ builtin_cur (struct mh_machine *mach)
643 static void 643 static void
644 builtin_size (struct mh_machine *mach) 644 builtin_size (struct mh_machine *mach)
645 { 645 {
646 message_size (mach->message, &mach->arg_num); 646 size_t size;
647 if (message_size (mach->message, &size) == 0)
648 mach->arg_num = size;
647 } 649 }
648 650
649 static void 651 static void
......