Re: Drawing a point in a pixbuf.



               ->  *p++ = 0xff;

Please don't do that, different compilers will interpret this differently.
I understand this means:

+increment *p (the content of the variable p points to)
+store 0xff in *p

OR

+increment p
+store 0xff in *p

This notation is asking for problems. Use ()s, or better put:
*p =0xff;
p++;

Then someone like me will be able to understand the code without
thinking too much, and it is easier to track with the debugger.

                     *p++ = 0;
                     *p++ = 0xfc;
                     *p      =  has_alpha;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]