[gst-devel] Re: [gst-cvs] CVS: gstreamer/gst cothreads.c,1.44,1.45 gstelement.c,1.82,1.83 gstelement.h,1.65,1.66 gstinfo.c,1.29,1.30 gstplugin.c,1.68,1.69

David I. Lehn dlehn at vt.edu
Thu Dec 13 17:32:02 CET 2001


* Wim Taymans <wtay at users.sourceforge.net> [20011213 18:18]:
> Index: cothreads.c
> ===================================================================
> RCS file: /cvsroot/gstreamer/gstreamer/gst/cothreads.c,v
> retrieving revision 1.44
> retrieving revision 1.45
> diff -u -d -r1.44 -r1.45
> --- cothreads.c	2001/10/21 18:00:31	1.44
> +++ cothreads.c	2001/12/13 23:14:37	1.45
> @@ -133,7 +133,7 @@
>      // FIXME this may not be 64bit clean
>      //       could use casts to uintptr_t from inttypes.h
>      //       if only all platforms had inttypes.h
> -    void *stack_end = (void *)((unsigned long)sp & ~(STACK_SIZE - 1));
> +    guchar *stack_end = (guchar *)((unsigned long)sp & ~(STACK_SIZE - 1));
>      s = (cothread_state *)(stack_end + ((ctx->nthreads - 1) *
>                             COTHREAD_STACKSIZE));
>      GST_DEBUG (0,"new stack (case 2) at %p\n",s);
> @@ -148,7 +148,7 @@
>    s->ctx = ctx;
>    s->threadnum = ctx->nthreads;
>    s->flags = 0;
> -  s->sp = ((void *)s + COTHREAD_STACKSIZE);
> +  s->sp = ((guchar *)s + COTHREAD_STACKSIZE);
>    // is this needed anymore?
>    s->top_sp = s->sp;

What's wrong with void *?  Compiler warnings?  Is there a nicer fix?  I
thought void * made more sense.

That 64b clean question still remains.  Anyone tested this stuff on 64b
machine?  The (u)intptr_t types from inttypes.h are really perfect for
portable pointer math.

-dave
-- 
David I. Lehn <dlehn at vt.edu>  | http://www.lehn.org/~dlehn/
Computer Engineering Graduate @ Virginia Tech in sunny Blacksburg, VA




More information about the gstreamer-devel mailing list