Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/kdump adapt to *syscallnames[] change (it's now cons...



details:   https://anonhg.NetBSD.org/src/rev/b25a16748b15
branches:  trunk
changeset: 499168:b25a16748b15
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Nov 13 21:38:48 2000 +0000

description:
adapt to *syscallnames[] change (it's now const char * const foo[]),
constify

diffstat:

 usr.bin/kdump/setemul.c |  18 +++++++++---------
 usr.bin/kdump/setemul.h |   6 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

diffs (94 lines):

diff -r abb7bc83cd29 -r b25a16748b15 usr.bin/kdump/setemul.c
--- a/usr.bin/kdump/setemul.c   Mon Nov 13 21:36:22 2000 +0000
+++ b/usr.bin/kdump/setemul.c   Mon Nov 13 21:38:48 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: setemul.c,v 1.4 2000/07/20 20:47:02 jdolecek Exp $     */
+/*     $NetBSD: setemul.c,v 1.5 2000/11/13 21:38:48 jdolecek Exp $     */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: setemul.c,v 1.4 2000/07/20 20:47:02 jdolecek Exp $");
+__RCSID("$NetBSD: setemul.c,v 1.5 2000/11/13 21:38:48 jdolecek Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -122,7 +122,7 @@
 
 #define NELEM(a) (sizeof(a) / sizeof(a[0]))
 
-static struct emulation emulations[] = {
+static const struct emulation emulations[] = {
        {   "netbsd",          syscallnames,         SYS_MAXSYSCALL,
                NULL,                   0 },
        {   "netbsd32", netbsd32_syscallnames,       SYS_MAXSYSCALL,
@@ -151,19 +151,19 @@
 
 struct emulation_ctx {
        pid_t   pid;
-       struct emulation *emulation;
+       const struct emulation *emulation;
        struct emulation_ctx *next;
 };
 
-struct emulation *current;
+const struct emulation *current;
 
-static struct emulation *default_emul=NULL;
+static const struct emulation *default_emul=NULL;
 
 struct emulation_ctx *current_ctx;
 struct emulation_ctx *emul_ctx = NULL;
 
 static struct emulation_ctx *ectx_find __P((pid_t));
-static void    ectx_update __P((pid_t, struct emulation *));
+static void    ectx_update __P((pid_t, const struct emulation *));
 
 void
 setemul(name, pid, update_ectx)
@@ -172,7 +172,7 @@
        int update_ectx;
 {
        int i;
-       struct emulation *match = NULL;
+       const struct emulation *match = NULL;
 
        for (i = 0; emulations[i].name != NULL; i++) {
                if (strcmp(emulations[i].name, name) == 0) {
@@ -225,7 +225,7 @@
 static void
 ectx_update(pid, emul)
        pid_t pid;
-       struct emulation *emul;
+       const struct emulation *emul;
 {
        struct emulation_ctx *ctx;
 
diff -r abb7bc83cd29 -r b25a16748b15 usr.bin/kdump/setemul.h
--- a/usr.bin/kdump/setemul.h   Mon Nov 13 21:36:22 2000 +0000
+++ b/usr.bin/kdump/setemul.h   Mon Nov 13 21:38:48 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: setemul.h,v 1.1 2000/04/10 09:13:45 jdolecek Exp $     */
+/*     $NetBSD: setemul.h,v 1.2 2000/11/13 21:38:48 jdolecek Exp $     */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -75,13 +75,13 @@
 
 struct emulation {
        const char *name;       /* Emulation name */
-       char **sysnames;        /* Array of system call names */
+       const char * const *sysnames;   /* Array of system call names */
        int  nsysnames;         /* Number of */
        int  *errno;            /* Array of error number mapping */
        int  nerrno;            /* number of elements in array */
 };
 
-extern struct emulation *current;
+extern const struct emulation *current;
 
 void setemul __P((const char *, pid_t, int));
 void ectx_sanify __P((pid_t));



Home | Main Index | Thread Index | Old Index