Outliner.c:
authorJoshua Leung <aligorith@gmail.com>
Sun, 27 Jul 2008 05:20:35 +0000 (05:20 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sun, 27 Jul 2008 05:20:35 +0000 (05:20 +0000)
Fixed some warnings about 'ob' being used uninitialsed. In some places that was definitely the case!

source/blender/src/outliner.c

index a8409c43b902d8d283045a38a0f252ecee8774c8..a8e864998b1ad03d6bd92ecae10507596478de45 100644 (file)
@@ -3654,7 +3654,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, SpaceOops *soops, ListBas
        uiBut *bt;
        TreeElement *te;
        TreeStoreElem *tselem;
-       Object *ob;
+       Object *ob = NULL;
        
        for(te= lb->first; te; te= te->next) {
                tselem= TREESTORE(te);
@@ -3662,7 +3662,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, SpaceOops *soops, ListBas
                        /* objects have toggle-able restriction flags */
                        if(tselem->type==0 && te->idcode==ID_OB) {
                                ob = (Object *)tselem->id;
-
+                               
                                uiBlockSetEmboss(block, UI_EMBOSSN);
                                bt= uiDefIconButBitS(block, ICONTOG, OB_RESTRICT_VIEW, REDRAWALL, ICON_RESTRICT_VIEW_OFF, 
                                                (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, &(ob->restrictflag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");
@@ -3734,6 +3734,8 @@ static void outliner_draw_restrictbuts(uiBlock *block, SpaceOops *soops, ListBas
                                bPoseChannel *pchan= (bPoseChannel *)te->directdata;
                                Bone *bone = pchan->bone;
                                
+                               ob = (Object *)tselem->id;
+                               
                                uiBlockSetEmboss(block, UI_EMBOSSN);
                                bt= uiDefIconButBitI(block, ICONTOG, BONE_HIDDEN_P, REDRAWALL, ICON_RESTRICT_VIEW_OFF, 
                                                (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, &(bone->flag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");
@@ -3743,6 +3745,8 @@ static void outliner_draw_restrictbuts(uiBlock *block, SpaceOops *soops, ListBas
                        else if(tselem->type==TSE_EBONE)  {
                                EditBone *ebone= (EditBone *)te->directdata;
                                
+                               ob = (Object *)tselem->id;
+                               
                                uiBlockSetEmboss(block, UI_EMBOSSN);
                                bt= uiDefIconButBitI(block, ICONTOG, BONE_HIDDEN_A, REDRAWALL, ICON_RESTRICT_VIEW_OFF, 
                                                (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, &(ebone->flag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");