summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2003-10-25 18:37:49 +0000
committerchristos <christos@NetBSD.org>2003-10-25 18:37:49 +0000
commit4bec333ae413d3d3f40e93beeae673a2ffbfc7ac (patch)
treeabf0e6f21035640ba5bae1e7ce540e400efb5e1e
parent72315d3199ab1f1e192b5173b6d984739c6da10a (diff)
Fix uninitialized variable warnings
-rw-r--r--sys/compat/darwin/darwin_ioframebuffer.c6
-rw-r--r--sys/compat/darwin/darwin_iohidsystem.c6
-rw-r--r--sys/compat/darwin/darwin_mman.c6
-rw-r--r--sys/compat/darwin/darwin_signal.c6
-rw-r--r--sys/compat/darwin/darwin_sysctl.c8
-rw-r--r--sys/compat/linux/common/linux_socket.c8
-rw-r--r--sys/compat/mach/mach_task.c10
7 files changed, 27 insertions, 23 deletions
diff --git a/sys/compat/darwin/darwin_ioframebuffer.c b/sys/compat/darwin/darwin_ioframebuffer.c
index ae9681bfabd..c16b8742f97 100644
--- a/sys/compat/darwin/darwin_ioframebuffer.c
+++ b/sys/compat/darwin/darwin_ioframebuffer.c
@@ -1,4 +1,4 @@
-/* $NetBSD: darwin_ioframebuffer.c,v 1.20 2003/10/18 13:27:17 manu Exp $ */
+/* $NetBSD: darwin_ioframebuffer.c,v 1.21 2003/10/25 18:38:07 christos Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: darwin_ioframebuffer.c,v 1.20 2003/10/18 13:27:17 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: darwin_ioframebuffer.c,v 1.21 2003/10/25 18:38:07 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -454,7 +454,7 @@ darwin_ioframebuffer_connect_map_memory(args)
mach_io_connect_map_memory_reply_t *rep = args->rmsg;
size_t *msglen = args->rsize;
struct proc *p = args->l->l_proc;
- int error;
+ int error = 0;
size_t memsize;
size_t len;
vaddr_t pvaddr;
diff --git a/sys/compat/darwin/darwin_iohidsystem.c b/sys/compat/darwin/darwin_iohidsystem.c
index 738cf9a5f1b..c06d1e48115 100644
--- a/sys/compat/darwin/darwin_iohidsystem.c
+++ b/sys/compat/darwin/darwin_iohidsystem.c
@@ -1,4 +1,4 @@
-/* $NetBSD: darwin_iohidsystem.c,v 1.17 2003/10/25 10:43:45 manu Exp $ */
+/* $NetBSD: darwin_iohidsystem.c,v 1.18 2003/10/25 18:38:07 christos Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: darwin_iohidsystem.c,v 1.17 2003/10/25 10:43:45 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: darwin_iohidsystem.c,v 1.18 2003/10/25 18:38:07 christos Exp $");
#include "ioconf.h"
#include "wsmux.h"
@@ -379,7 +379,7 @@ darwin_iohidsystem_thread(args)
struct darwin_iohidsystem_thread_args *dita;
struct darwin_iohidsystem_shmem *shmem;
struct darwin_iohidsystem_evglobals *evg;
- darwin_iohidsystem_event_item *diei;
+ darwin_iohidsystem_event_item *diei = NULL; /* XXX: gcc */
darwin_iohidsystem_event *die;
dev_t dev;
const struct cdevsw *wsmux;
diff --git a/sys/compat/darwin/darwin_mman.c b/sys/compat/darwin/darwin_mman.c
index 6c8b03aab43..307d3e03a00 100644
--- a/sys/compat/darwin/darwin_mman.c
+++ b/sys/compat/darwin/darwin_mman.c
@@ -1,6 +1,6 @@
#undef DEBUG_DARWIN
#undef DEBUG_MACH
-/* $NetBSD: darwin_mman.c,v 1.9 2003/06/29 22:29:15 fvdl Exp $ */
+/* $NetBSD: darwin_mman.c,v 1.10 2003/10/25 18:38:07 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: darwin_mman.c,v 1.9 2003/06/29 22:29:15 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: darwin_mman.c,v 1.10 2003/10/25 18:38:07 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -81,7 +81,7 @@ darwin_sys_load_shared_file(l, v, retval)
} */ *uap = v;
struct file *fp;
struct filedesc *fdp;
- struct vnode *vp;
+ struct vnode *vp = NULL;
vaddr_t base;
struct proc *p = l->l_proc;
int flags;
diff --git a/sys/compat/darwin/darwin_signal.c b/sys/compat/darwin/darwin_signal.c
index c328f105a88..01afa6f3312 100644
--- a/sys/compat/darwin/darwin_signal.c
+++ b/sys/compat/darwin/darwin_signal.c
@@ -1,4 +1,4 @@
-/* $NetBSD: darwin_signal.c,v 1.6 2003/01/24 21:37:02 manu Exp $ */
+/* $NetBSD: darwin_signal.c,v 1.7 2003/10/25 18:38:07 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: darwin_signal.c,v 1.6 2003/01/24 21:37:02 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: darwin_signal.c,v 1.7 2003/10/25 18:38:07 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -82,6 +82,8 @@ darwin_sys_sigaction(l, v, retval)
nsa = stackgap_alloc(p, &sg, sizeof(struct sigaction));
if (SCARG(uap, osa) != NULL)
osa = stackgap_alloc(p, &sg, sizeof(struct sigaction));
+ else
+ osa = NULL;
sa.sa_handler = dsa.darwin_sa_handler.__sa_handler;
native_sigset13_to_sigset(&dsa.darwin_sa_mask, &sa.sa_mask);
diff --git a/sys/compat/darwin/darwin_sysctl.c b/sys/compat/darwin/darwin_sysctl.c
index 5ddb2aaea93..7a437ae6c94 100644
--- a/sys/compat/darwin/darwin_sysctl.c
+++ b/sys/compat/darwin/darwin_sysctl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: darwin_sysctl.c,v 1.17 2003/09/14 09:48:43 manu Exp $ */
+/* $NetBSD: darwin_sysctl.c,v 1.18 2003/10/25 18:38:07 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: darwin_sysctl.c,v 1.17 2003/09/14 09:48:43 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: darwin_sysctl.c,v 1.18 2003/10/25 18:38:07 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -181,7 +181,9 @@ darwin_sys___sysctl(struct lwp *l, void *v, register_t *retval)
error = uvm_vslock(p, oldp, oldlen,
VM_PROT_READ|VM_PROT_WRITE);
savelen = oldlen;
- }
+ } else
+ savelen = 0;
+
error = (*fn)(name + 1, namelen - 1, oldp, oldlenp, newp, newlen, p);
diff --git a/sys/compat/linux/common/linux_socket.c b/sys/compat/linux/common/linux_socket.c
index 58fa5afd5fd..d88bc83ce29 100644
--- a/sys/compat/linux/common/linux_socket.c
+++ b/sys/compat/linux/common/linux_socket.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_socket.c,v 1.49 2003/07/27 19:30:03 jdolecek Exp $ */
+/* $NetBSD: linux_socket.c,v 1.50 2003/10/25 18:38:42 christos Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.49 2003/07/27 19:30:03 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.50 2003/10/25 18:38:42 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -665,8 +665,8 @@ linux_sys_recvmsg(l, v, retval)
int error;
struct sys_recvmsg_args bsa;
int lflags;
- u_int8_t *ocontrol;
- socklen_t ocontrollen;
+ u_int8_t *ocontrol = NULL; /* XXX: gcc */
+ socklen_t ocontrollen = 0;
/*
* Data alignment is different on some architectures. If control
diff --git a/sys/compat/mach/mach_task.c b/sys/compat/mach/mach_task.c
index 553f1ec6ec7..ebdb01e27af 100644
--- a/sys/compat/mach/mach_task.c
+++ b/sys/compat/mach/mach_task.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mach_task.c,v 1.25 2003/04/29 22:12:51 manu Exp $ */
+/* $NetBSD: mach_task.c,v 1.26 2003/10/25 18:37:49 christos Exp $ */
/*-
* Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
#include "opt_compat_darwin.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_task.c,v 1.25 2003/04/29 22:12:51 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_task.c,v 1.26 2003/10/25 18:37:49 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -75,7 +75,7 @@ mach_task_get_special_port(args)
struct lwp *l = args->l;
struct mach_emuldata *med;
struct mach_right *mr;
- int error;
+ int error = 0;
med = (struct mach_emuldata *)l->l_proc->p_emuldata;
@@ -207,7 +207,7 @@ mach_task_set_special_port(args)
mn = req->req_special_port.name;
/* Null port ? */
- if (mn == NULL)
+ if (mn == 0)
return mach_msg_error(args, 0);
/* Does the inserted port exists? */
@@ -556,7 +556,7 @@ mach_task_resume(args)
size_t *msglen = args->rsize;
mach_port_t mn;
struct mach_right *mr;
- struct lwp *l;
+ struct lwp *l = curlwp;
struct proc *p;
struct mach_emuldata *med;
int s;