diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2016-09-21 04:38:58 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2016-09-21 04:38:58 +0000 |
commit | 8358f9eb58e7f7d84095aa5aaf19cbcd1a2b7e45 (patch) | |
tree | 0108f3739bcd8e73c3f9cab4c5533af4f6bdc978 /lib/libc/stdlib | |
parent | e2c934e5fade3e10a8f429303bac3a8d9ea99b45 (diff) |
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@
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 14 | ||||
-rw-r--r-- | lib/libc/stdlib/setenv.c | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 0296985e5b5..20807a25b46 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -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 */ diff --git a/lib/libc/stdlib/setenv.c b/lib/libc/stdlib/setenv.c index 60c2cd46a65..15c550ba30b 100644 --- a/lib/libc/stdlib/setenv.c +++ b/lib/libc/stdlib/setenv.c @@ -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) ; |