Bug 2228

Summary: Uninitialised values causing conditional jump in valgrind
Product: netanim Reporter: Beestre84
Component: animatorAssignee: John Abraham <john.abraham.in>
Status: RESOLVED FIXED    
Severity: minor CC: ns-bugs
Priority: P5    
Version: unspecified   
Hardware: PC   
OS: Linux   
Attachments: full initialiser list

Description Beestre84 2015-11-26 06:15:02 UTC
Created attachment 2192 [details]
full initialiser list

Valgrind complains a lot about conditional jumps. Even if they might not harm, they are easy to fix and shorten the valgrind output drastically, so that other errors can be identified more easily.

In file animproperty_browser.cpp, there are several member pointers not initialised in the constructor initialiser-list. See the attachment for a full list, which is, however, not in the correct order and causes --Wreorder warnings. Sorry about that, it was only a quick fix.


Lots of warnings are produced by a single line:
animatormode.cpp, Line 1636:

--------------
BackgroudImageProperties_t
AnimatorMode::getBackgroundProperties ()
{
  QGraphicsPixmapItem * background =  AnimatorScene::getInstance ()->getBackgroundImage ();
  BackgroudImageProperties_t prop; //<- THIS LINE; POSSIBLE 'FIX': = {"", 0, 0, 0, 0, 0}; 
  
  if (!background)
    return prop;
--------------

If no background is set, an uninitialised BackgroudImageProperties_t struct will be returned. I don't know which default settings make sense, so my 'fix'  is just to quiet valgrind.
Comment 1 John Abraham 2015-11-26 13:26:23 UTC
Thanks 
http://code.nsnam.org/netanim/rev/1dcf2ba6fe7a