Browse Source

Delete casts to off_t and size_t that are implied by assignments

or prototypes.  Ditto for some of the char* and void* casts too.
verified no change to instructions on ILP32 (i386) and LP64 (amd64)
ok natano@ abluhm@ deraadt@ millert@
OPENBSD_6_1
guenther 8 years ago
parent
commit
1a1f277cca
3 changed files with 12 additions and 12 deletions
  1. +3
    -3
      src/lib/libc/hash/helper.c
  2. +7
    -7
      src/lib/libc/stdlib/malloc.c
  3. +2
    -2
      src/lib/libc/stdlib/setenv.c

+ 3
- 3
src/lib/libc/hash/helper.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: helper.c,v 1.15 2015/11/01 03:45:29 guenther Exp $ */
/* $OpenBSD: helper.c,v 1.16 2016/09/21 04:38:57 guenther Exp $ */
/*
* Copyright (c) 2000 Poul-Henning Kamp <phk@FreeBSD.org>
@ -82,7 +82,7 @@ HASHFileChunk(const char *filename, char *buf, off_t off, off_t len)
}
while ((nr = read(fd, buffer, MINIMUM(sizeof(buffer), len))) > 0) {
HASHUpdate(&ctx, buffer, (size_t)nr);
HASHUpdate(&ctx, buffer, nr);
if (len > 0 && (len -= nr) == 0)
break;
}
@ -97,7 +97,7 @@ DEF_WEAK(HASHFileChunk);
char *
HASHFile(const char *filename, char *buf)
{
return (HASHFileChunk(filename, buf, (off_t)0, (off_t)0));
return (HASHFileChunk(filename, buf, 0, 0));
}
DEF_WEAK(HASHFile);


+ 7
- 7
src/lib/libc/stdlib/malloc.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: malloc.c,v 1.196 2016/09/18 13:46:28 otto Exp $ */
/* $OpenBSD: malloc.c,v 1.197 2016/09/21 04:38:56 guenther Exp $ */
/*
* Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@ -83,14 +83,14 @@
#define SOME_JUNK 0xd0 /* as in "Duh" :-) */
#define SOME_FREEJUNK 0xdf
#define MMAP(sz) mmap(NULL, (size_t)(sz), PROT_READ | PROT_WRITE, \
MAP_ANON | MAP_PRIVATE, -1, (off_t) 0)
#define MMAP(sz) mmap(NULL, (sz), PROT_READ | PROT_WRITE, \
MAP_ANON | MAP_PRIVATE, -1, 0)
#define MMAPA(a,sz) mmap((a), (size_t)(sz), PROT_READ | PROT_WRITE, \
MAP_ANON | MAP_PRIVATE, -1, (off_t) 0)
#define MMAPA(a,sz) mmap((a), (sz), PROT_READ | PROT_WRITE, \
MAP_ANON | MAP_PRIVATE, -1, 0)
#define MQUERY(a, sz) mquery((a), (size_t)(sz), PROT_READ | PROT_WRITE, \
MAP_ANON | MAP_PRIVATE | MAP_FIXED, -1, (off_t)0)
#define MQUERY(a, sz) mquery((a), (sz), PROT_READ | PROT_WRITE, \
MAP_ANON | MAP_PRIVATE | MAP_FIXED, -1, 0)
struct region_info {
void *p; /* page; low bits used to mark chunks */


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

@ -1,4 +1,4 @@
/* $OpenBSD: setenv.c,v 1.18 2016/04/25 21:36:04 millert Exp $ */
/* $OpenBSD: setenv.c,v 1.19 2016/09/21 04:38:56 guenther Exp $ */
/*
* Copyright (c) 1987 Regents of the University of California.
* All rights reserved.
@ -141,7 +141,7 @@ setenv(const char *name, const char *value, int rewrite)
environ[cnt + 1] = NULL;
}
if (!(environ[offset] = /* name + `=' + value */
malloc((size_t)((int)(np - name) + l_value + 2))))
malloc((int)(np - name) + l_value + 2)))
return (-1);
for (C = environ[offset]; (*C = *name++) && *C != '='; ++C)
;


Loading…
Cancel
Save