Browse Source

add some prototypes, casts, includes, parenthesis, and whatnot to

silence some warnings.
OPENBSD_5_4
tedu 11 years ago
parent
commit
b30c509647
3 changed files with 10 additions and 7 deletions
  1. +4
    -1
      src/lib/libc/crypt/crypt2.c
  2. +4
    -4
      src/lib/libc/stdlib/strtol.c
  3. +2
    -2
      src/lib/libc/stdlib/strtoul.c

+ 4
- 1
src/lib/libc/crypt/crypt2.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: crypt2.c,v 1.3 2005/08/08 08:05:33 espie Exp $ */
/* $OpenBSD: crypt2.c,v 1.4 2013/04/17 17:40:35 tedu Exp $ */
/*
* FreeSec: libcrypt
@ -59,6 +59,9 @@
extern const u_char _des_bits8[8];
extern const u_int32_t _des_bits32[32];
extern int _des_initialised;
void _des_init(void);
void _des_setup_salt(int32_t salt);
int _des_do_des(u_int32_t , u_int32_t , u_int32_t *, u_int32_t *, int);
int
setkey(const char *key)


+ 4
- 4
src/lib/libc/stdlib/strtol.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strtol.c,v 1.8 2012/11/18 04:13:39 jsing Exp $ */
/* $OpenBSD: strtol.c,v 1.9 2013/04/17 17:40:35 tedu Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@ -54,7 +54,7 @@ strtol(const char *nptr, char **endptr, int base)
*/
if (base != 0 && (base < 2 || base > 36)) {
if (endptr != 0)
*endptr = nptr;
*endptr = (char *)nptr;
errno = EINVAL;
return 0;
}
@ -124,7 +124,7 @@ strtol(const char *nptr, char **endptr, int base)
if (any < 0)
continue;
if (neg) {
if (acc < cutoff || acc == cutoff && c > cutlim) {
if (acc < cutoff || (acc == cutoff && c > cutlim)) {
any = -1;
acc = LONG_MIN;
errno = ERANGE;
@ -134,7 +134,7 @@ strtol(const char *nptr, char **endptr, int base)
acc -= c;
}
} else {
if (acc > cutoff || acc == cutoff && c > cutlim) {
if (acc > cutoff || (acc == cutoff && c > cutlim)) {
any = -1;
acc = LONG_MAX;
errno = ERANGE;


+ 2
- 2
src/lib/libc/stdlib/strtoul.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: strtoul.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: strtoul.c,v 1.8 2013/04/17 17:40:35 tedu Exp $ */
/*
* Copyright (c) 1990 Regents of the University of California.
* All rights reserved.
@ -84,7 +84,7 @@ strtoul(const char *nptr, char **endptr, int base)
break;
if (any < 0)
continue;
if (acc > cutoff || acc == cutoff && c > cutlim) {
if (acc > cutoff || (acc == cutoff && c > cutlim)) {
any = -1;
acc = ULONG_MAX;
errno = ERANGE;


Loading…
Cancel
Save