summaryrefslogtreecommitdiff
path: root/lib/librthread/rthread_stack.c
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2012-02-19 04:54:41 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2012-02-19 04:54:41 +0000
commitab2d957b344c41d8b49efc3989b2b8cf2b628aa3 (patch)
tree1ccdc4e7dc5522579d061c133c5a2b7f8b6eb395 /lib/librthread/rthread_stack.c
parentf855f05d725f5edd2529685d05e992adc202072f (diff)
Use 'base' as an intermediate char* variable to avoid void* arithmetic
Diffstat (limited to 'lib/librthread/rthread_stack.c')
-rw-r--r--lib/librthread/rthread_stack.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/librthread/rthread_stack.c b/lib/librthread/rthread_stack.c
index e3c8ee3b6c0..a81e1ad5514 100644
--- a/lib/librthread/rthread_stack.c
+++ b/lib/librthread/rthread_stack.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread_stack.c,v 1.6 2012/02/18 21:12:09 guenther Exp $ */
+/* $OpenBSD: rthread_stack.c,v 1.7 2012/02/19 04:54:40 guenther Exp $ */
/* $snafu: rthread_stack.c,v 1.12 2005/01/11 02:45:28 marc Exp $ */
/* PUBLIC DOMAIN: No Rights Reserved. Marco S Hyman <marc@snafu.org> */
@@ -51,12 +51,12 @@ _rthread_alloc_stack(pthread_t thread)
/* If a stack address was provided, just fill in the details */
if (thread->attr.stack_addr != NULL) {
- stack->base = thread->attr.stack_addr;
+ stack->base = base = thread->attr.stack_addr;
stack->len = thread->attr.stack_size;
#ifdef MACHINE_STACK_GROWS_UP
- stack->sp = thread->attr.stack_addr;
+ stack->sp = base;
#else
- stack->sp = thread->attr.stack_addr + thread->attr.stack_size;
+ stack->sp = base + thread->attr.stack_size;
#endif
/*
* This impossible guardsize marks this stack as