[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/8] Quiet GCC warnings about set but unused variables
From: |
Marin Ramesa |
Subject: |
[PATCH 4/8] Quiet GCC warnings about set but unused variables |
Date: |
Wed, 11 Dec 2013 17:30:43 +0100 |
This is the second way to quiet GCC warnings about set but unused
variables during simple locks. The first one is here:
http://lists.gnu.org/archive/html/bug-hurd/2013-12/msg00006.html
Third way would be to declare an set mqueue and obj only if MACH_SLOCKS.
* ipc/ipc_port.c (ipc_port_set_seqno) (mqueue): Assign to itself to quiet GCC
warning.
* vm/vm_pageout.c (vm_pageout_scan) (obj): Likewise.
---
ipc/ipc_port.c | 2 +-
vm/vm_pageout.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ipc/ipc_port.c b/ipc/ipc_port.c
index 99a6ad4..a7d4b0c 100644
--- a/ipc/ipc_port.c
+++ b/ipc/ipc_port.c
@@ -417,7 +417,7 @@ ipc_port_set_seqno(port, seqno)
ipc_port_t port;
mach_port_seqno_t seqno;
{
- ipc_mqueue_t mqueue;
+ ipc_mqueue_t mqueue = mqueue; /* Quiet GCC warning. */
mqueue = ipc_port_lock_mqueue(port);
port->ip_seqno = seqno;
diff --git a/vm/vm_pageout.c b/vm/vm_pageout.c
index 46ba56b..3373904 100644
--- a/vm/vm_pageout.c
+++ b/vm/vm_pageout.c
@@ -574,7 +574,7 @@ void vm_pageout_scan()
while ((vm_page_inactive_count < vm_page_inactive_target) &&
!queue_empty(&vm_page_queue_active)) {
- vm_object_t obj;
+ vm_object_t obj = obj; /* Quiet GCC warning. */
vm_pageout_active++;
m = (vm_page_t) queue_first(&vm_page_queue_active);
--
1.8.1.4
[PATCH 3/8] Cleanup of the copyin() and copyout() calls, Marin Ramesa, 2013/12/11
[PATCH 5/8] include/mach/mach4.defs (memory_object_create_proxy): fix passing from incompatible pointer type, Marin Ramesa, 2013/12/11
[PATCH 6/8] vm/vm_kern.c (kmem_submap): remove unnecessary cast, Marin Ramesa, 2013/12/11
[PATCH 7/8] vm/vm_resident.c (vm_page_print): remove unnecessary casts, Marin Ramesa, 2013/12/11