Optimization problem when sending image data

Sander Jansen s.jansen at gmail.com
Thu Aug 20 09:33:38 PDT 2009


I'm trying to send a image to the notification daemon, but somehow the
image get messed up (see attachment) whenever I turn on optimization
to -O2 or -O3. The weird thing is that it used to work, so I'm kind of
baffled why this is not working anymore.

Here's part of the code that sends the image data array. (the full
code which is not too big can be found here:
http://code.google.com/p/gogglesmm/source/browse/trunk/src/GMNotifyDaemon.cpp
)

dbus_message_iter_open_container(&value,DBUS_TYPE_ARRAY,DBUS_TYPE_BYTE_AS_STRING,&data);
dbus_message_iter_append_fixed_array(&data,DBUS_TYPE_BYTE,&icdata,isize))
dbus_message_iter_close_container(&value,&data);

where icdata comes from;:

uint32_t * pixels = (some allocated pixel data)
const char * icdata = (const char*) (pixels);

Now just to be sure, I also tried allocating a new byte array and copy
each pixel value byte for byte to the byte array, but that didn't work
either...

This is on a x86_64 with GCC 4.4.1

Any ideas on how I can fix or diagnose this problem?

Thanks,

Sander


-- 
"And any fool knows a dog needs a home
A shelter from pigs on the wing"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus.png
Type: image/png
Size: 12310 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20090820/14ce7a1b/attachment.png 


More information about the dbus mailing list