On Wednesday 18 February 2009, Vladimir Nadvornik wrote: > On st 18. Ășnora 2009, Dan Pascu wrote: > > On Tuesday 17 February 2009, Vladimir Nadvornik wrote: > > > + memset(&fallbackColor, 0, sizeof(fallbackColor)); > > > + > > > fallbackColor.red = 0x8000; > > > fallbackColor.green = 0x8000; > > > fallbackColor.blue = 0x8000; > > > > What is the reason to memset the structure to 0 when you immediately > > after that set every structure member individually? > > The structure has more members, which were uninitialized and the > compiler didn't like it. It is just a cosmetic issue.
You are right. XColor has too many members to set them all individually to 0, so a memset is cleaner. I thought it was an RColor or a WMColor which only have an extra alpha attribute in which case it would have been easier to set it explicitly than to use memset. -- Dan -- To unsubscribe, send mail to [email protected].
