more minor warning cleanups and improve error reporting if text fails to save.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 27 Jul 2011 06:55:20 +0000 (06:55 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 27 Jul 2011 06:55:20 +0000 (06:55 +0000)
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/text.c
source/blender/editors/armature/editarmature.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_text/text_ops.c
source/blender/gpu/intern/gpu_material.c

index fbb5a77fa0409bd013de4b6d2c754f8ff6501e3a..8c19b0c15c3f8cb2b0dab7fab245dde31312b406 100644 (file)
@@ -2373,7 +2373,7 @@ static void RVBlurBitmap2_float ( float* map, int width,int height,
        /*      Blancmange (bmange@airdmhor.gen.nz) */
 
        k = -1.0f/(2.0f*(float)M_PI*blur*blur);
-       fval=0;
+
        for (ix = 0;ix< halfWidth;ix++){
                weight = (float)exp(k*(ix*ix));
                filter[halfWidth - ix] = weight;
index 56723476251f6fc264b10e618377544c8fba9c2e..2c507370288a8d339ae7c0baa231eb7cac9299a6 100644 (file)
@@ -1423,6 +1423,8 @@ void txt_insert_buf(Text *text, const char *in_buffer)
        }
 
        undoing= u;
+
+       (void)count;
 }
 
 /******************/
index 2035220612197b9fd1e09819046788775d785fa1..628cdbf21e9d1373662e57444129b988330b10b5 100644 (file)
@@ -1478,10 +1478,8 @@ static int armature_select_linked_invoke(bContext *C, wmOperator *op, wmEvent *e
        bArmature *arm;
        EditBone *bone, *curBone, *next;
        int extend= RNA_boolean_get(op->ptr, "extend");
-       ARegion *ar;
        Object *obedit= CTX_data_edit_object(C);
        arm= obedit->data;
-       ar= CTX_wm_region(C);
 
        view3d_operator_needs_opengl(C);
 
index cd1fa5c16a7a731277791c5f8dd5bcae958eee4a..950b3c72fe74002fe1dc00428964e007bf604d8a 100644 (file)
@@ -781,14 +781,15 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
                                         iconbutw, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
        }
        {       /* always hide/reveal unused sockets */ 
-               int shade;
-
-               iconofs-=iconbutw;
                // XXX re-enable
-               /*if(node_has_hidden_sockets(node))
+               /* int shade;
+               if(node_has_hidden_sockets(node))
                        shade= -40;
-               else*/
-                       shade= -90;
+               else
+                       shade= -90; */
+
+               iconofs-=iconbutw;
+
                uiDefIconBut(node->block, LABEL, B_REDR, ICON_PLUS, iconofs, rct->ymax-NODE_DY,
                                                  iconbutw, UI_UNIT_Y, NULL, 0.0, 0.0, 1.0, 0.5, "");
        }
index f6e3dc3dd0a01d5f23a9d50e34181e10a854edc3..36e334990cb1a4a3e38d2b2a829ee13e586dee63 100644 (file)
@@ -303,7 +303,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
        Scene *scene= CTX_data_scene(C); /* only for sound */
        Editing *ed= seq_give_editing(scene, TRUE);
        SeqLoadInfo seq_load;
-       Sequence *seq;
+       /* Sequence *seq; */ /* UNUSED */
        int tot_files;
 
        seq_load_operator_info(&seq_load, op);
@@ -324,13 +324,13 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
                        RNA_string_get(&itemptr, "name", file_only);
                        BLI_join_dirfile(seq_load.path, sizeof(seq_load.path), dir_only, file_only);
 
-                       seq= seq_load_func(C, ed->seqbasep, &seq_load);
+                       /* seq= */ seq_load_func(C, ed->seqbasep, &seq_load);
                }
                RNA_END;
        }
        else {
                /* single file */
-               seq= seq_load_func(C, ed->seqbasep, &seq_load);
+               /* seq= */ seq_load_func(C, ed->seqbasep, &seq_load);
        }
 
        if (seq_load.tot_success==0) {
index 2bd6bd624df7783fc659ddd81477a1a7c27aa8a0..13eb24ed1f29e40f35315fe8a81ea70f4fef9aea 100644 (file)
@@ -36,6 +36,7 @@
 #include <string.h>
 #include <ctype.h> /* ispunct */
 #include <sys/stat.h>
+#include <errno.h>
 
 #include "MEM_guardedalloc.h"
 
@@ -449,15 +450,14 @@ static void txt_write_file(Text *text, ReportList *reports)
        FILE *fp;
        TextLine *tmp;
        struct stat st;
-       int res;
-       char file[FILE_MAXDIR+FILE_MAXFILE];
+       char filepath[FILE_MAXDIR+FILE_MAXFILE];
        
-       BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE);
-       BLI_path_abs(file, G.main->name);
+       BLI_strncpy(filepath, text->name, FILE_MAXDIR+FILE_MAXFILE);
+       BLI_path_abs(filepath, G.main->name);
        
-       fp= fopen(file, "w");
+       fp= fopen(filepath, "w");
        if(fp==NULL) {
-               BKE_report(reports, RPT_ERROR, "Unable to save file.");
+               BKE_reportf(reports, RPT_ERROR, "Unable to save \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error writing file");
                return;
        }
 
@@ -471,8 +471,13 @@ static void txt_write_file(Text *text, ReportList *reports)
        
        fclose (fp);
 
-       res= stat(file, &st);
-       text->mtime= st.st_mtime;
+       if(stat(filepath, &st) == 0) {
+               text->mtime= st.st_mtime;
+       }
+       else {
+               text->mtime= 0;
+               BKE_reportf(reports, RPT_WARNING, "Unable to stat \"%s\": %s.", filepath, errno ? strerror(errno) : "Unknown error starrng file");
+       }
        
        if(text->flags & TXT_ISDIRTY)
                text->flags ^= TXT_ISDIRTY;
index 3804aad6848c0bf7bcc5568e334c768c7a90f8d8..806c70d841fd5c07c929399a94226a526e86e71a 100644 (file)
@@ -671,7 +671,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
        i = is;
        GPU_link(mat, "shade_visifac", i, visifac, shi->refl, &i);
 
-       vn = shi->vn;
+
        /*if(ma->mode & MA_TANGENT_VN)
                GPU_link(mat, "shade_tangent_v_spec", GPU_attribute(CD_TANGENT, ""), &vn);*/