aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric B Munson <emunson@mgebm.net>2010-11-30 11:15:47 -0700
committerEric B Munson <emunson@mgebm.net>2010-11-30 11:15:47 -0700
commit19672f42352aea7119f6976523faa136ef6aad4d (patch)
treef26be5e735d54439c4918680d37f85076e4fff2f
parentc14a6c872d9806d98a1545ce7a117aaa5719af58 (diff)
downloadlibhugetlbfs-19672f42352aea7119f6976523faa136ef6aad4d.tar.gz
Move boolean entries in hugetlbfs_opts to type bool
This patch transitions all the boolean entries in the hugetlbfs_opts struct to use the bool type and all assignments to these entries to use true and false as appropriate. Signed-off-by: Eric B Munson <emunson@mgebm.net>
-rw-r--r--elflink.c2
-rw-r--r--hugeutils.c14
-rw-r--r--libhugetlbfs_internal.h8
3 files changed, 12 insertions, 12 deletions
diff --git a/elflink.c b/elflink.c
index 7e0444b..c24bedc 100644
--- a/elflink.c
+++ b/elflink.c
@@ -1231,7 +1231,7 @@ static int check_env(void)
"remapping for non-relinked "
"binaries\n");
INFO("Disabling filesz copy optimization\n");
- __hugetlb_opts.min_copy = 0;
+ __hugetlb_opts.min_copy = false;
} else {
if (&__executable_start) {
WARNING("LD_PRELOAD is incompatible with "
diff --git a/hugeutils.c b/hugeutils.c
index af648a5..29e5fcc 100644
--- a/hugeutils.c
+++ b/hugeutils.c
@@ -241,7 +241,7 @@ void hugetlbfs_setup_env()
{
char *env;
- __hugetlb_opts.min_copy = 1;
+ __hugetlb_opts.min_copy = true;
env = getenv("HUGETLB_VERBOSE");
if (env)
@@ -274,7 +274,7 @@ void hugetlbfs_setup_env()
if (__hugetlb_opts.min_copy && env && (strcasecmp(env, "no") == 0)) {
INFO("HUGETLB_MINIMAL_COPY=%s, disabling filesz copy "
"optimization\n", env);
- __hugetlb_opts.min_copy = 0;
+ __hugetlb_opts.min_copy = false;
}
env = getenv("HUGETLB_SHARE");
@@ -298,17 +298,17 @@ void hugetlbfs_setup_env()
*/
env = getenv("HUGETLB_MORECORE_SHRINK");
if (env && strcasecmp(env, "yes") == 0)
- __hugetlb_opts.shrink_ok = 1;
+ __hugetlb_opts.shrink_ok = true;
/* Determine if shmget() calls should be overridden */
env = getenv("HUGETLB_SHM");
if (env && !strcmp(env, "yes"))
- __hugetlb_opts.shm_enabled = 1;
+ __hugetlb_opts.shm_enabled = true;
/* Determine if all reservations should be avoided */
env = getenv("HUGETLB_NO_RESERVE");
if (env && !strcmp(env, "yes"))
- __hugetlb_opts.no_reserve = 1;
+ __hugetlb_opts.no_reserve = true;
}
void hugetlbfs_setup_kernel_page_size()
@@ -351,7 +351,7 @@ void hugetlbfs_check_safe_noreserve()
hugetlbfs_test_feature(HUGETLB_FEATURE_SAFE_NORESERVE) <= 0) {
INFO("Kernel is not safe for MAP_NORESERVE. Forcing "
"use of reservations.\n");
- __hugetlb_opts.no_reserve = 0;
+ __hugetlb_opts.no_reserve = false;
}
}
@@ -371,7 +371,7 @@ void hugetlbfs_check_map_hugetlb()
*/
if (hugetlbfs_test_feature(HUGETLB_FEATURE_MAP_HUGETLB) > 0) {
INFO("Kernel supports MAP_HUGETLB\n");
- __hugetlb_opts.map_hugetlb = 1;
+ __hugetlb_opts.map_hugetlb = true;
}
#endif
}
diff --git a/libhugetlbfs_internal.h b/libhugetlbfs_internal.h
index 5b147f7..1bd2821 100644
--- a/libhugetlbfs_internal.h
+++ b/libhugetlbfs_internal.h
@@ -57,11 +57,11 @@
#endif
struct libhugeopts_t {
- int min_copy;
int sharing;
- int shrink_ok;
- int shm_enabled;
- int no_reserve;
+ bool min_copy;
+ bool shrink_ok;
+ bool shm_enabled;
+ bool no_reserve;
bool map_hugetlb;
unsigned long force_elfmap;
char *ld_preload;