Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - gf_cursor_t cursor shape const declaration: (3 Items)
   
gf_cursor_t cursor shape const declaration  
gf_cursor_t has the following declaration:
const _uint8	*image0;
const _uint8	*image1;

This "const" declares non-constant pointer to constant data.

when I use this construction:

image0=malloc(size);

compiler will be happy, but when I will try to free this memory, compiler will emit warning about "const qualifier 
discarding".
Re: gf_cursor_t cursor shape const declaration  
The API promises that it won't change the contents of these pointers. You allocate these structures, so you can just 
cast (void*) them when you call the free().
-Misha.
Re: gf_cursor_t cursor shape const declaration  
I can understand your position, but anyway I disagree with this const in its place :)