From ab2d957b344c41d8b49efc3989b2b8cf2b628aa3 Mon Sep 17 00:00:00 2001 From: Philip Guenthe Date: Sun, 19 Feb 2012 04:54:41 +0000 Subject: Use 'base' as an intermediate char* variable to avoid void* arithmetic --- lib/librthread/rthread_stack.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/librthread/rthread_stack.c') 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 */ @@ -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 -- cgit v1.2.3