summaryrefslogtreecommitdiff
path: root/rts/RtsFlags.c
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2016-05-02 06:37:14 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2016-05-05 08:29:27 +1000
commitdb9de7eb3e91820024f673bfdb6fb8064cfed20d (patch)
tree5e1c3ef0b6dee7f40fedbc118ba36cfe6ffdd1ee /rts/RtsFlags.c
parentad4392c142696d5092533480a82ed65322e9d413 (diff)
downloadhaskell-db9de7eb3e91820024f673bfdb6fb8064cfed20d.tar.gz
rts: Replace `nat` with `uint32_t`
The `nat` type was an alias for `unsigned int` with a comment saying it was at least 32 bits. We keep the typedef in case client code is using it but mark it as deprecated. Test Plan: Validated on Linux, OS X and Windows Reviewers: simonmar, austin, thomie, hvr, bgamari, hsyl20 Differential Revision: https://phabricator.haskell.org/D2166
Diffstat (limited to 'rts/RtsFlags.c')
-rw-r--r--rts/RtsFlags.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index 084fc210be..b0ce8bee1b 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -91,7 +91,7 @@ static int openStatsFile (
char *filename, const char *FILENAME_FMT, FILE **file_ret);
static StgWord64 decodeSize (
- const char *flag, nat offset, StgWord64 min, StgWord64 max);
+ const char *flag, uint32_t offset, StgWord64 min, StgWord64 max);
static void bad_option (const char *s);
@@ -491,9 +491,9 @@ static void errorRtsOptsDisabled(const char *s)
void setupRtsFlags (int *argc, char *argv[], RtsConfig rts_config)
{
- nat mode;
- nat total_arg;
- nat arg, rts_argc0;
+ uint32_t mode;
+ uint32_t total_arg;
+ uint32_t arg, rts_argc0;
rtsConfig = rts_config;
@@ -869,7 +869,7 @@ error = rtsTrue;
#if defined(PROFILING)
RtsFlags.ParFlags.nNodes = 1;
#else
- RtsFlags.ParFlags.nNodes = (nat)nNodes;
+ RtsFlags.ParFlags.nNodes = (uint32_t)nNodes;
#endif
) break;
} else {
@@ -900,15 +900,16 @@ error = rtsTrue;
if (rts_argv[arg][2] == '\0') {
RtsFlags.GcFlags.heapSizeSuggestionAuto = rtsTrue;
} else {
- RtsFlags.GcFlags.heapSizeSuggestion =
- (nat)(decodeSize(rts_argv[arg], 2, BLOCK_SIZE, HS_WORD_MAX) / BLOCK_SIZE);
+ RtsFlags.GcFlags.heapSizeSuggestion = (uint32_t)
+ (decodeSize(rts_argv[arg], 2, BLOCK_SIZE, HS_WORD_MAX)
+ / BLOCK_SIZE);
}
break;
case 'O':
OPTION_UNSAFE;
RtsFlags.GcFlags.minOldGenSize =
- (nat)(decodeSize(rts_argv[arg], 2, BLOCK_SIZE,
+ (uint32_t)(decodeSize(rts_argv[arg], 2, BLOCK_SIZE,
HS_WORD_MAX)
/ BLOCK_SIZE);
break;
@@ -1089,7 +1090,7 @@ error = rtsTrue;
errorRtsOptsDisabled("Using large values for -N is not allowed by default. %s");
stg_exit(EXIT_FAILURE);
}
- RtsFlags.ParFlags.nNodes = (nat)nNodes;
+ RtsFlags.ParFlags.nNodes = (uint32_t)nNodes;
}
) break;
@@ -1483,7 +1484,7 @@ static void initStatsFile (FILE *f)
-------------------------------------------------------------------------- */
static StgWord64
-decodeSize(const char *flag, nat offset, StgWord64 min, StgWord64 max)
+decodeSize(const char *flag, uint32_t offset, StgWord64 min, StgWord64 max)
{
char c;
const char *s;