NetBSD Problem Report #7993

Received: (qmail 8252 invoked from network); 14 Jul 1999 21:36:35 -0000
Message-Id: <E114VdI-0007qO-00@decomino.localnet>
Date: Wed, 14 Jul 1999 20:28:00 +0000
From: Joseph Myers <jsm28@cam.ac.uk>
Reply-To: Joseph Myers <jsm28@cam.ac.uk>
To: gnats-bugs@gnats.netbsd.org
Cc: Joseph Myers <jsm28@cam.ac.uk>
Subject: [PATCH] dm: patch to use const
X-Send-Pr-Version: 3.95

>Number:         7993
>Category:       bin
>Synopsis:       [PATCH] dm: patch to use const
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 14 14:50:03 +0000 1999
>Closed-Date:    Wed Jul 14 22:50:23 +0000 1999
>Last-Modified:  Wed Jul 14 22:52:32 +0000 1999
>Originator:     Joseph S. Myers
>Release:        NetBSD-current of 1999-06-28
>Organization:
Trinity College, University of Cambridge, UK
>Environment:
[
System: Linux decomino 2.2.10 #1 Mon Jun 14 07:48:53 UTC 1999 i686 unknown
Architecture: i686
]
>Description:

This patch makes dm use `const' where appropriate.

>How-To-Repeat:

>Fix:

diff -ruN dm/dm.c dm+/dm.c
--- dm/dm.c	Mon Sep 14 11:04:53 1998
+++ dm+/dm.c	Wed Jul 14 20:25:36 1999
@@ -71,9 +71,9 @@
 static char	*game,			/* requested game */
 		*gametty;		/* from tty? */

-void	c_day __P((char *, char *, char *));
-void	c_game __P((char *, char  *, char *, char *));
-void	c_tty __P((char *));
+void	c_day __P((const char *, const char *, const char *));
+void	c_game __P((const char *, const char  *, const char *, const char *));
+void	c_tty __P((const char *));
 const char *hour __P((int));
 double	load __P((void));
 int	main __P((int, char *[]));
@@ -168,9 +168,9 @@
  */
 void
 c_day(s_day, s_start, s_stop)
-	char *s_day, *s_start, *s_stop;
+	const char *s_day, *s_start, *s_stop;
 {
-	static char *days[] = {
+	static const char *const days[] = {
 		"sunday", "monday", "tuesday", "wednesday",
 		"thursday", "friday", "saturday",
 	};
@@ -196,7 +196,7 @@
  */
 void
 c_tty(tty)
-	char *tty;
+	const char *tty;
 {
 	static int first = 1;
 	static char *p_tty;
@@ -216,7 +216,7 @@
  */
 void
 c_game(s_game, s_load, s_users, s_priority)
-	char *s_game, *s_load, *s_users, *s_priority;
+	const char *s_game, *s_load, *s_users, *s_priority;
 {
 	static int found;

@@ -291,7 +291,7 @@
 hour(h)
 	int h;
 {
-	static char *hours[] = {
+	static const char *const hours[] = {
 	    "midnight", "1am", "2am", "3am", "4am", "5am",
 	    "6am", "7am", "8am", "9am", "10am", "11am",
 	    "noon", "1pm", "2pm", "3pm", "4pm", "5pm",

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: hubertf 
State-Changed-When: Wed Jul 14 15:50:23 PDT 1999 
State-Changed-Why:  
Patch applied, thanks! 


- Hubert 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.