Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/ddb Pull up following revision(s) (requested by uwe i...



details:   https://anonhg.NetBSD.org/src/rev/c6182552590d
branches:  netbsd-9
changeset: 744175:c6182552590d
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Jan 26 11:28:11 2020 +0000

description:
Pull up following revision(s) (requested by uwe in ticket #656):

        sys/ddb/db_command.c: revision 1.162
        sys/ddb/db_command.c: revision 1.163
        sys/ddb/db_command.c: revision 1.164

db_command - make sure count is always initialized.
db_command - make setting have_addr more clear.
Don't set it to false that it's already initialized to.
db_command - don't hide local static variable in the middle of other
local variable definitions.  While here, get rid of the alignment of
variable names.

diffstat:

 sys/ddb/db_command.c |  23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diffs (68 lines):

diff -r 2d2caebb90d3 -r c6182552590d sys/ddb/db_command.c
--- a/sys/ddb/db_command.c      Sun Jan 26 11:25:22 2020 +0000
+++ b/sys/ddb/db_command.c      Sun Jan 26 11:28:11 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_command.c,v 1.160 2018/09/17 01:49:54 kre Exp $     */
+/*     $NetBSD: db_command.c,v 1.160.4.1 2020/01/26 11:28:11 martin Exp $      */
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.160 2018/09/17 01:49:54 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.160.4.1 2020/01/26 11:28:11 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -820,16 +820,18 @@
 static void
 db_command(const struct db_command **last_cmdp)
 {
+       static db_expr_t last_count = 0;
+
+       int t;
        const struct db_command *command;
-       static db_expr_t last_count = 0;
-       db_expr_t       addr, count;
-       char            modif[TOK_STRING_SIZE];
-       
-       int                     t;
-       bool            have_addr = false;
+       db_expr_t addr, count;
+       bool have_addr;
+       char modif[TOK_STRING_SIZE];
 
        command = NULL;
-       
+       have_addr = false;
+       count = -1;
+
        t = db_read_token();
        if ((t == tEOL) || (t == tCOMMA)) {
                /*
@@ -850,7 +852,6 @@
                        }
                } else
                        count = last_count;
-               have_addr = false;
                modif[0] = '\0';
                db_skip_to_eol();
 
@@ -897,7 +898,6 @@
                                have_addr = true;
                        } else {
                                addr = (db_expr_t) db_dot;
-                               have_addr = false;
                        }
 
                        t = db_read_token();
@@ -909,7 +909,6 @@
                                }
                        } else {
                                db_unread_token(t);
-                               count = -1;
                        }
                        if ((command->flag & CS_MORE) == 0) {
                                db_skip_to_eol();



Home | Main Index | Thread Index | Old Index