On Thu, Jan 13, 2000 at 11:09:56PM +0100, Christian Reiniger wrote:
> Marcus Sundberg wrote:
>
> >> const ggi_directbuffer *dbuf;
> >>
> >> /* Acquire DirectBuffer before we use it. */
> >> if (ggiResourceAcquire(dbuf->resource, GGI_ACTYPE_WRITE) != 0) {
> >> fail("Error acquiring DirectBuffer\n");
> >> }
> >>
> >>
> >> this cannot work. if ggi_directbuffer is const, and
> >> ggiResourceAcquire wants a non-const ggi_resource_t my compiler
> >> kicks me.
> >
> >What compiler is that? Sounds like a broken compiler to me.
> >dbuf->resource is a pointer, and the fact that dbuf is a const *
> >shouldn't affect the type of dbuf->resource afaik.
>
> dbuf is a pointer to a const ggi_directbuffer, i.e. it is not allowed to
> modify the contents of the object *it points to*. That means it's illegal
> to change the value of dbuf->resource
ok. it was all my fault. i sum up my results:
i did check if there were directbuffers.
the reason why it segfaulted is instead this:
i didn't do the correct code:
if (ggiResourceMustAcquire(dbs[writeframe]->resource))
if (ggiResourceAcquire(dbs[writeframe]->resource,GGI_ACTYPE_WRITE)!=0)
instead i did:
if (ggiResourceMustAcquire(dbs[writeframe]))
if (ggiResourceAcquire(dbs[writeframe],GGI_ACTYPE_WRITE)!=0)
this was the reason the const thing didn't work.
ggi is const correct in this case. it was my fault.
but i do not like that this compiles WITHOUT warnings about
type mismatchs !
is everything in ggi a void* ?
cu
erik
--
Name: Erik Thiele \\\\
Email: [EMAIL PROTECTED] o `QQ'_
IRC: erikyyy / __8
WWW: http://www.erikyyy.de/ ' `