From 65b9988ba49a958de5811dd666385aa26eb41521 Mon Sep 17 00:00:00 2001 From: drochner Date: Fri, 27 Oct 2006 19:39:11 +0000 Subject: [PATCH] gently add some "const", and avoid some casts compiles with WARNS=4 now (on i386 and alpha) --- lib/libcrypt/Makefile | 4 ++-- lib/libcrypt/bcrypt.c | 8 ++++---- lib/libcrypt/crypt.c | 31 ++++++++++++++++--------------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/lib/libcrypt/Makefile b/lib/libcrypt/Makefile index 97b2ff1f99ed..9f372dca5e6d 100644 --- a/lib/libcrypt/Makefile +++ b/lib/libcrypt/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.18 2006/10/27 18:22:56 drochner Exp $ +# $NetBSD: Makefile,v 1.19 2006/10/27 19:39:11 drochner Exp $ USE_SHLIBDIR= yes @@ -7,7 +7,7 @@ LIB= crypt SRCS= crypt.c md5crypt.c bcrypt.c crypt-sha1.c util.c pw_gensalt.c SRCS+= hmac_sha1.c -CPPFLAGS+= -I${.CURDIR} +WARNS= 4 MAN= crypt.3 MLINKS= crypt.3 encrypt.3 crypt.3 setkey.3 diff --git a/lib/libcrypt/bcrypt.c b/lib/libcrypt/bcrypt.c index 281270ff946e..421d91fc369a 100644 --- a/lib/libcrypt/bcrypt.c +++ b/lib/libcrypt/bcrypt.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcrypt.c,v 1.8 2006/10/24 22:49:19 mlelstv Exp $ */ +/* $NetBSD: bcrypt.c,v 1.9 2006/10/27 19:39:11 drochner Exp $ */ /* $OpenBSD: bcrypt.c,v 1.16 2002/02/19 19:39:36 millert Exp $ */ /* @@ -46,7 +46,7 @@ * */ #include -__RCSID("$NetBSD: bcrypt.c,v 1.8 2006/10/24 22:49:19 mlelstv Exp $"); +__RCSID("$NetBSD: bcrypt.c,v 1.9 2006/10/27 19:39:11 drochner Exp $"); #include #include @@ -79,12 +79,12 @@ char *__bcrypt(const char *, const char *); /* XXX */ static char encrypted[_PASSWORD_LEN]; static char error[] = ":"; -const static u_int8_t Base64Code[] = +static const u_int8_t Base64Code[] = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; char *bcrypt_gensalt(u_int8_t); -const static u_int8_t index_64[128] = +static const u_int8_t index_64[128] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, diff --git a/lib/libcrypt/crypt.c b/lib/libcrypt/crypt.c index cb5bb33a9404..df02d3302a70 100644 --- a/lib/libcrypt/crypt.c +++ b/lib/libcrypt/crypt.c @@ -1,4 +1,4 @@ -/* $NetBSD: crypt.c,v 1.23 2006/04/08 23:24:44 christos Exp $ */ +/* $NetBSD: crypt.c,v 1.24 2006/10/27 19:39:11 drochner Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)crypt.c 8.1.1.1 (Berkeley) 8/18/93"; #else -__RCSID("$NetBSD: crypt.c,v 1.23 2006/04/08 23:24:44 christos Exp $"); +__RCSID("$NetBSD: crypt.c,v 1.24 2006/10/27 19:39:11 drochner Exp $"); #endif #endif /* not lint */ @@ -288,9 +288,10 @@ typedef union { #endif /* LARGEDATA */ STATIC init_des __P((void)); -STATIC init_perm __P((C_block [64/CHUNKBITS][1<