more minor warning cleanups and improve error reporting if text fails to save.

This commit is contained in:
Campbell Barton 2011-07-27 06:55:20 +00:00
parent 955ba3f7fb
commit 48a64ffa70
7 changed files with 27 additions and 21 deletions

View 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;

View File

@ -1423,6 +1423,8 @@ void txt_insert_buf(Text *text, const char *in_buffer)
}
undoing= u;
(void)count;
}
/******************/

View 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);

View 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;
// XXX re-enable
/* int shade;
if(node_has_hidden_sockets(node))
shade= -40;
else
shade= -90; */
iconofs-=iconbutw;
// XXX re-enable
/*if(node_has_hidden_sockets(node))
shade= -40;
else*/
shade= -90;
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, "");
}

View 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) {

View 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;

View 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);*/