fix for ntreeGPUMaterialNodes(), using uninitialized exec pointer.

also commented some set-but-unused variables.
This commit is contained in:
Campbell Barton
2011-09-12 00:00:21 +00:00
parent 8f9fa6a400
commit 2827ee26e5
5 changed files with 17 additions and 8 deletions

View File

@@ -334,7 +334,7 @@ static void ui_layer_but_cb(bContext *C, void *arg_but, void *arg_index)
}
/* create buttons for an item with an RNA array */
static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int len, int x, int y, int w, int h, int expand, int slider, int toggle, int icon_only)
static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int len, int x, int y, int w, int UNUSED(h), int expand, int slider, int toggle, int icon_only)
{
uiStyle *style= layout->root->style;
uiBut *but;
@@ -407,7 +407,7 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in
if (totdim != 2) return; /* only 2D matrices supported in UI so far */
w /= dim_size[0];
h /= dim_size[1];
/* h /= dim_size[1]; */ /* UNUSED */
for(a=0; a<len; a++) {
col= a % dim_size[0];

View File

@@ -1158,8 +1158,8 @@ void filelist_from_main(struct FileList *filelist)
/* XXXXX TODO: if databrowse F4 or append/link filelist->hide_parent has to be set */
if (!filelist->hide_parent) filelist->numfiles+= 1;
filelist->filelist= (struct direntry *)malloc(filelist->numfiles * sizeof(struct direntry));
filelist->filelist= filelist->numfiles > 0 ? (struct direntry *)malloc(filelist->numfiles * sizeof(struct direntry)) : NULL;
files = filelist->filelist;
if (!filelist->hide_parent) {

View File

@@ -226,7 +226,7 @@ static void borderselect_nla_strips (bAnimContext *ac, rcti rect, short mode, sh
SpaceNla *snla = (SpaceNla *)ac->sl;
View2D *v2d= &ac->ar->v2d;
rctf rectf;
float ymin=(float)(-NLACHANNEL_HEIGHT(snla)), ymax=0;
float ymin /* =(float)(-NLACHANNEL_HEIGHT(snla)) */ /* UNUSED */, ymax=0;
/* convert border-region to view coordinates */
UI_view2d_region_to_view(v2d, rect.xmin, rect.ymin+2, &rectf.xmin, &rectf.ymin);

View File

@@ -5423,9 +5423,13 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d,
{
/* snap key to nearest frame? */
if (autosnap == SACTSNAP_FRAME) {
#if 0 /* 'doTime' disabled for now */
const Scene *scene= t->scene;
const short doTime= 0; //getAnimEdit_DrawTime(t); // NOTE: this works, but may be confusing behaviour given the option's label, hence disabled
const double secf= FPS;
#endif
double val;
/* convert frame to nla-action time (if needed) */
@@ -5434,11 +5438,17 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d,
else
val= *(td->val);
#if 0 /* 'doTime' disabled for now */
/* do the snapping to nearest frame/second */
if (doTime)
if (doTime) {
val= (float)( floor((val/secf) + 0.5f) * secf );
}
else
#endif
{
val= (float)( floor(val+0.5f) );
}
/* convert frame out of nla-action time */
if (adt)

View File

@@ -107,8 +107,7 @@ void ntreeGPUMaterialNodes(bNodeTree *ntree, GPUMaterial *mat)
{
bNodeTreeExec *exec;
if(!ntree->execdata)
exec = ntreeShaderBeginExecTree(ntree, 1);
exec = ntreeShaderBeginExecTree(ntree, 1);
ntreeExecGPUNodes(exec, mat, 1);