Some more coverity fixes.

This one moves some pointer checks up in the code 
(they were after the pointer was used, kind of useless at that point) ;)

Kent
This commit is contained in:
2007-06-07 02:00:11 +00:00
parent 25baab252c
commit 93a3b2b78a

View File

@@ -341,15 +341,15 @@ void draw_oops(Oops *oops)
if(oops->id== (ID *)((G.scene->basact) ? (G.scene->basact->object) : 0)) line= 1; if(oops->id== (ID *)((G.scene->basact) ? (G.scene->basact->object) : 0)) line= 1;
else if(oops->id== (ID *)G.scene) line= 1; else if(oops->id== (ID *)G.scene) line= 1;
if (!oops->id) return;
if(oops->id->us) { if(oops->id->us) {
cpack(body); cpack(body);
glRectf(x1, y1, x2, y2); glRectf(x1, y1, x2, y2);
} }
/* it has never happened that an oops was missing an ID at if(oops->id->lib) {
this point but has occured elseware so lets be safe */
if(oops->id && oops->id->lib) {
if(oops->id->flag & LIB_INDIRECT) cpack(0x1144FF); if(oops->id->flag & LIB_INDIRECT) cpack(0x1144FF);
else cpack(0x11AAFF); else cpack(0x11AAFF);
@@ -431,6 +431,8 @@ void drawoopsspace(ScrArea *sa, void *spacedata)
BIF_GetThemeColor3fv(TH_BACK, col); BIF_GetThemeColor3fv(TH_BACK, col);
if(soops==0) return;
/* darker background for oops */ /* darker background for oops */
if(soops->type!=SO_OUTLINER) { if(soops->type!=SO_OUTLINER) {
col[0] = col[0] * 0.75; col[1] = col[1] * 0.75; col[2] = col[2] * 0.75; col[0] = col[0] * 0.75; col[1] = col[1] * 0.75; col[2] = col[2] * 0.75;
@@ -438,7 +440,6 @@ void drawoopsspace(ScrArea *sa, void *spacedata)
glClearColor(col[0], col[1], col[2], 0.0); glClearColor(col[0], col[1], col[2], 0.0);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
if(soops==0) return;
if(soops->type==SO_OUTLINER) draw_outliner(sa, soops); if(soops->type==SO_OUTLINER) draw_outliner(sa, soops);
else { else {