Erik Thiele <[EMAIL PROTECTED]> writes:

> ggiResourceMustAcquire is simply a macro that returns true if the
>   resource must be explicitly acquired and released, or false if not.
>   However, it is still safe to call
> ggiResourceAcquire or ggiResourceRelease even in the latter case --
>   it would be a no-op.
> are you sure about this ?
> in my case ->resource ==0
> (using 16bit Xserver with palemu target and GT_8BIT mode)
> i do resource acquire of my dbuf and it segfaults...

That's because you don't _have_ a dbuf. The palemu target doesn't
support DirectBuffers...
You probably forgot to check your return codes somewhere.

> 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.

        Marcus Sundberg        |
 Royal Institute of Technology |       Phone: +46 707 295404
       Stockholm, Sweden       |   E-Mail: [EMAIL PROTECTED]

Reply via email to