2.5: fix compile error on mac, and a few warnings.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 30 Dec 2008 07:32:14 +0000 (07:32 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 30 Dec 2008 07:32:14 +0000 (07:32 +0000)
source/blender/blenloader/intern/writefile.c
source/blender/editors/interface/interface.c
source/blender/editors/object/object_edit.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_select.c

index 1b8db72..836e2dd 100644 (file)
@@ -2239,10 +2239,11 @@ static int recursive_copy_runtime(char *outname, char *exename, ReportList *repo
 {
        char *runtime = get_runtime_path(exename);
        char command[2 * (FILE_MAXDIR+FILE_MAXFILE) + 32];
-       int progfd = -1;
+       int progfd = -1, error= 0;
 
        if (!runtime) {
                BKE_report(reports, RPT_ERROR, "Unable to find runtime");
+               error= 1;
                goto cleanup;
        }
        //printf("runtimepath %s\n", runtime);
@@ -2250,6 +2251,7 @@ static int recursive_copy_runtime(char *outname, char *exename, ReportList *repo
        progfd= open(runtime, O_BINARY|O_RDONLY, 0);
        if (progfd==-1) {
                BKE_report(reports, RPT_ERROR, "Unable to find runtime");
+               error= 1;
                goto cleanup;
        }
 
@@ -2257,6 +2259,7 @@ static int recursive_copy_runtime(char *outname, char *exename, ReportList *repo
        //printf("command %s\n", command);
        if (system(command) == -1) {
                BKE_report(reports, RPT_ERROR, "Couldn't copy runtime");
+               error= 1;
        }
 
 cleanup:
@@ -2265,7 +2268,7 @@ cleanup:
        if (runtime)
                MEM_freeN(runtime);
 
-       return !BKE_reports_have_error(reports);
+       return !error;
 }
 
 int BLO_write_runtime(Main *mainvar, char *file, char *exename, ReportList *reports) 
index 534f13b..d1aad05 100644 (file)
@@ -2108,6 +2108,8 @@ uiBut *ui_def_but_operator(bContext *C, uiBlock *block, int type, char *opname,
                str= (ot)? ot->name: "";
        }
 
+       butstr= str;
+
        if(type == BUTM) {
                if(WM_key_event_operator_string(C, opname, opcontext, buf, sizeof(buf))) {
                        butstr= MEM_mallocN(strlen(str)+strlen(buf)+2, "ui_def_but_operator");
@@ -2115,8 +2117,6 @@ uiBut *ui_def_but_operator(bContext *C, uiBlock *block, int type, char *opname,
                        strcat(butstr, "|");
                        strcat(butstr, buf);
                }
-               else
-                       butstr= str;
        }
 
        but= ui_def_but(block, type, -1, butstr, x1, y1, x2, y2, NULL, 0, 0, 0, 0, tip);
index f3cd39b..397dc35 100644 (file)
@@ -1120,9 +1120,6 @@ void OBJECT_OT_select_by_layer(wmOperatorType *ot)
 /* ****** invert selection *******/
 static int object_select_invert_exec(bContext *C, wmOperator *op)
 {
-       ScrArea *sa= CTX_wm_area(C);
-       View3D *v3d= sa->spacedata.first;
-               
        CTX_DATA_BEGIN(C, Base*, base, visible_bases) {
                if (base->flag & SELECT)
                        ED_base_object_select(base, BA_DESELECT);
@@ -1153,8 +1150,6 @@ void OBJECT_OT_select_invert(wmOperatorType *ot)
 
 static int object_de_select_all_exec(bContext *C, wmOperator *op)
 {
-       ScrArea *sa= CTX_wm_area(C);
-       View3D *v3d= sa->spacedata.first;
        int a=0, ok=0; 
        
        CTX_DATA_BEGIN(C, Base*, base, visible_bases) {
@@ -1196,8 +1191,6 @@ void OBJECT_OT_de_select_all(wmOperatorType *ot)
 
 static int object_select_random_exec(bContext *C, wmOperator *op)
 {      
-       ScrArea *sa= CTX_wm_area(C);
-       View3D *v3d= sa->spacedata.first;
        int percent;
        
        percent = RNA_int_get(op->ptr, "percent");
index 4f1cb7a..61c53fb 100644 (file)
@@ -178,7 +178,7 @@ static void node_ID_title_cb(bContext *C, void *node_v, void *unused_v)
 
 static void node_but_title_cb(bContext *C, void *node_v, void *but_v)
 {
-       bNode *node= node_v;
+       // bNode *node= node_v;
        // XXX uiBut *bt= but_v;
        // XXX BLI_strncpy(node->name, bt->drawstr, NODE_MAXSTR);
        
@@ -2199,6 +2199,8 @@ static int node_texture_buts_proc(uiBlock *block, bNodeTree *ntree, bNode *node,
                w = butr->xmax - x;
                h = butr->ymax - y;
        }
+       else
+               return 0;
        
        switch( tex->type ) {
                case TEX_BLEND:
index 8960ed7..fbf437e 100644 (file)
@@ -231,7 +231,7 @@ void do_layer_buttons(bContext *C, short event)
 static void do_view3d_view_camerasmenu(bContext *C, void *arg, int event)
 {
        Scene *scene= CTX_data_scene(C);
-       View3D *v3d;
+       View3D *v3d= (View3D*)CTX_wm_space_data(C);
        Base *base;
        int i=1;
        
index 6464ed4..a06fb5a 100644 (file)
@@ -854,7 +854,6 @@ static void mouse_select(bContext *C, short *mval, short modifier)
        unsigned int buffer[4*MAXPICKBUF];
        int temp, a, dist=100;
        short hits;
-       short ctrl=0, shift=0, alt=0;
        
        /* always start list from basact in wire mode */
        startbase=  FIRSTBASE;
@@ -1443,7 +1442,7 @@ static int view3d_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
 
        view3d_operator_needs_opengl(C);
        
-       mouse_select(C, mval, NULL);
+       mouse_select(C, mval, 0);
        
        return OPERATOR_FINISHED;
 }