mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-06 16:08:32 +00:00
Fix incorrect conversion specifiers on 32-bit
Branches: main, 11.01 runtime/mercury_wrapper.c: Fix incorrect conversion specifiers on 32-bit machines. MR_LL_PARALLEL_CONJ implies MR_THREAD_SAFE so there is no need to specify both. trace/mercury_event_parser.y: Avoid a C compiler warning on Cygwin.
This commit is contained in:
@@ -1802,8 +1802,8 @@ MR_process_options(int argc, char **argv)
|
||||
break;
|
||||
|
||||
case MR_RUNTIME_GRANULAITY_WSDEQUE_LENGTH_FACTOR:
|
||||
#if defined(MR_THREAD_SAFE) && defined(MR_LL_PARALLEL_CONJ)
|
||||
if (sscanf(MR_optarg, "%lu",
|
||||
#if defined(MR_LL_PARALLEL_CONJ)
|
||||
if (sscanf(MR_optarg, "%"MR_INTEGER_LENGTH_MODIFIER"u",
|
||||
&MR_granularity_wsdeque_length_factor) != 1)
|
||||
{
|
||||
MR_usage();
|
||||
@@ -1816,7 +1816,9 @@ MR_process_options(int argc, char **argv)
|
||||
|
||||
case MR_WORKSTEAL_MAX_ATTEMPTS:
|
||||
#ifdef MR_LL_PARALLEL_CONJ
|
||||
if (sscanf(MR_optarg, "%lu", &MR_worksteal_max_attempts) != 1) {
|
||||
if (sscanf(MR_optarg, "%"MR_INTEGER_LENGTH_MODIFIER"u",
|
||||
&MR_worksteal_max_attempts) != 1)
|
||||
{
|
||||
MR_usage();
|
||||
}
|
||||
#endif
|
||||
@@ -1824,7 +1826,9 @@ MR_process_options(int argc, char **argv)
|
||||
|
||||
case MR_WORKSTEAL_SLEEP_MSECS:
|
||||
#ifdef MR_LL_PARALLEL_CONJ
|
||||
if (sscanf(MR_optarg, "%lu", &MR_worksteal_sleep_msecs) != 1) {
|
||||
if (sscanf(MR_optarg, "%"MR_INTEGER_LENGTH_MODIFIER"u",
|
||||
&MR_worksteal_sleep_msecs) != 1)
|
||||
{
|
||||
MR_usage();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -257,7 +257,7 @@ mercury_event_error(const char *s)
|
||||
mercury_event_linenum--;
|
||||
} else if (mercury_event_text[0] == '\n' || mercury_event_text[0] == '\f') {
|
||||
sprintf(buf, "%s at end of line", s);
|
||||
} else if (isprint(mercury_event_text[0])) {
|
||||
} else if (isprint((int)mercury_event_text[0])) {
|
||||
sprintf(buf, "%s at symbol `%s'", s, mercury_event_text);
|
||||
} else {
|
||||
sprintf(buf, "%s at \\%o", s, mercury_event_text[0]);
|
||||
|
||||
Reference in New Issue
Block a user