summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--device/cons.c2
-rw-r--r--kern/bootstrap.c2
-rw-r--r--kern/printf.c2
-rw-r--r--vm/vm_map.c2
5 files changed, 10 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 05bff6e..4b4eee3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,12 @@
2006-11-11 Samuel Thibault <samuel.thibault@ens-lyon.org>
- Fix a bunch of "unused variable" warnings.
+ Fix ``assignment used as truth value'' warnings.
+ * device/cons.c (cninit): Add parenthesis.
+ * kern/bootstrap.c (copy_bootstrap): Likewise.
+ * kern/printf.c (_doprnt): Likewise.
+ * vm/vm_map.c (vm_map_lookup): Likewise.
+ Fix a bunch of ``unused variable'' warnings.
* device/ds_routines.c (ds_device_open): Remove unused `namebuf'
variable.
* device/kmsg.c (kmsgread): Remove unused `err' variable.
diff --git a/device/cons.c b/device/cons.c
index a3d380d..07a1958 100644
--- a/device/cons.c
+++ b/device/cons.c
@@ -97,7 +97,7 @@ cninit()
/*
* Found a console, initialize it.
*/
- if (cp = cn_tab) {
+ if ((cp = cn_tab)) {
/*
* Initialize as console
*/
diff --git a/kern/bootstrap.c b/kern/bootstrap.c
index 0fa4d2d..ad501d6 100644
--- a/kern/bootstrap.c
+++ b/kern/bootstrap.c
@@ -450,7 +450,7 @@ static void copy_bootstrap(void *e, exec_info_t *boot_exec_info)
register vm_map_t user_map = current_task()->map;
int err;
- if (err = exec_load(boot_read, read_exec, e, boot_exec_info))
+ if ((err = exec_load(boot_read, read_exec, e, boot_exec_info)))
panic("Cannot load user-bootstrap image: error code %d", err);
#if MACH_KDB
diff --git a/kern/printf.c b/kern/printf.c
index 22b0987..74bb6c4 100644
--- a/kern/printf.c
+++ b/kern/printf.c
@@ -292,7 +292,7 @@ void _doprnt(
break;
any = FALSE;
- while (i = *p++) {
+ while ((i = *p++)) {
/* NOTE: The '32' here is because ascii space */
if (*p <= 32) {
/*
diff --git a/vm/vm_map.c b/vm/vm_map.c
index 4f358bd..6f8fb34 100644
--- a/vm/vm_map.c
+++ b/vm/vm_map.c
@@ -4391,7 +4391,7 @@ kern_return_t vm_map_lookup(var_map, vaddr, fault_type, out_version,
* it for all possible accesses.
*/
- if (*wired = (entry->wired_count != 0))
+ if ((*wired = (entry->wired_count != 0)))
prot = fault_type = entry->protection;
/*