From be9c427d60d66a8ac613ed9d519f75f6fc734975 Mon Sep 17 00:00:00 2001 From: mycroft Date: Sun, 26 Jul 1998 12:29:33 +0000 Subject: [PATCH] const poisoning. --- include/resolv.h | 8 ++++---- lib/libc/net/res_debug.c | 16 ++++++++-------- lib/libc/stdio/vfprintf.c | 8 ++++---- lib/libc/stdio/vfscanf.c | 6 +++--- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/resolv.h b/include/resolv.h index c19be24749ce..c195469c324d 100644 --- a/include/resolv.h +++ b/include/resolv.h @@ -1,4 +1,4 @@ -/* $NetBSD: resolv.h,v 1.13 1998/02/03 04:21:46 perry Exp $ */ +/* $NetBSD: resolv.h,v 1.14 1998/07/26 12:29:33 mycroft Exp $ */ /*- * Copyright (c) 1983, 1987, 1989, 1993 @@ -178,9 +178,9 @@ typedef res_sendhookact (*res_send_rhook)__P((const struct sockaddr_in *ns, int *resplen)); struct res_sym { - int number; /* Identifying number, like T_MX */ - char * name; /* Its symbolic name, like "MX" */ - char * humanname; /* Its fun name, like "mail exchanger" */ + int number; /* Identifying number, like T_MX */ + const char * name; /* Its symbolic name, like "MX" */ + const char * humanname; /* Its fun name, like "mail exchanger" */ }; extern struct __res_state _res; diff --git a/lib/libc/net/res_debug.c b/lib/libc/net/res_debug.c index f74e4fd68aed..d56e984351a6 100644 --- a/lib/libc/net/res_debug.c +++ b/lib/libc/net/res_debug.c @@ -1,4 +1,4 @@ -/* $NetBSD: res_debug.c,v 1.16 1998/07/26 11:32:25 mycroft Exp $ */ +/* $NetBSD: res_debug.c,v 1.17 1998/07/26 12:30:15 mycroft Exp $ */ /*- * Copyright (c) 1985, 1990, 1993 @@ -81,7 +81,7 @@ static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; static char rcsid[] = "Id: res_debug.c,v 8.20 1997/06/01 20:34:37 vixie Exp "; #else -__RCSID("$NetBSD: res_debug.c,v 1.16 1998/07/26 11:32:25 mycroft Exp $"); +__RCSID("$NetBSD: res_debug.c,v 1.17 1998/07/26 12:30:15 mycroft Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -1129,7 +1129,7 @@ __p_time(value) * by 60*60*1000 for that. */ -static unsigned int poweroften[10] = {1, 10, 100, 1000, 10000, 100000, +static const unsigned int poweroften[10] = {1, 10, 100, 1000, 10000, 100000, 1000000,10000000,100000000,1000000000}; /* takes an XeY precision/size value, returns a string representation. */ @@ -1415,7 +1415,7 @@ loc_ntoa(binary, ascii) const u_char *binary; char *ascii; { - static char *error = "?"; + static const char *const error = "?"; register const u_char *cp = binary; int latdeg, latmin, latsec, latsecfrac; @@ -1429,7 +1429,7 @@ loc_ntoa(binary, ascii) u_int32_t templ; u_int8_t sizeval, hpval, vpval, versionval; - char *sizestr, *hpstr, *vpstr; + const char *sizestr, *hpstr, *vpstr; versionval = *cp++; @@ -1503,11 +1503,11 @@ loc_ntoa(binary, ascii) altmeters, altfrac, sizestr, hpstr, vpstr); if (sizestr != error) - free(sizestr); + free((char *)sizestr); if (hpstr != error) - free(hpstr); + free((char *)hpstr); if (vpstr != error) - free(vpstr); + free((char *)vpstr); return (ascii); } diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index 24ee797a9ef6..567b4f1127fd 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfprintf.c,v 1.23 1998/02/03 18:41:23 perry Exp $ */ +/* $NetBSD: vfprintf.c,v 1.24 1998/07/26 12:31:39 mycroft Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -41,7 +41,7 @@ #if 0 static char *sccsid = "@(#)vfprintf.c 5.50 (Berkeley) 12/16/92"; #else -__RCSID("$NetBSD: vfprintf.c,v 1.23 1998/02/03 18:41:23 perry Exp $"); +__RCSID("$NetBSD: vfprintf.c,v 1.24 1998/07/26 12:31:39 mycroft Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -215,9 +215,9 @@ vfprintf(fp, fmt0, ap) * below longer. */ #define PADSIZE 16 /* pad chunk size */ - static char blanks[PADSIZE] = + static const char blanks[PADSIZE] = {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; - static char zeroes[PADSIZE] = + static const char zeroes[PADSIZE] = {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; /* diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c index f589483dfa29..7af16c3fd194 100644 --- a/lib/libc/stdio/vfscanf.c +++ b/lib/libc/stdio/vfscanf.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfscanf.c,v 1.18 1998/02/03 18:41:24 perry Exp $ */ +/* $NetBSD: vfscanf.c,v 1.19 1998/07/26 12:31:39 mycroft Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)vfscanf.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: vfscanf.c,v 1.18 1998/02/03 18:41:24 perry Exp $"); +__RCSID("$NetBSD: vfscanf.c,v 1.19 1998/07/26 12:31:39 mycroft Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -126,7 +126,7 @@ __svfscanf(fp, fmt0, ap) char buf[BUF]; /* buffer for numeric conversions */ /* `basefix' is used to avoid `if' tests in the integer scanner */ - static short basefix[17] = + static const short basefix[17] = { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; nassigned = 0;