Code cleanup: casts, dead assignment & arg order.

This commit is contained in:
Campbell Barton 2014-06-26 15:46:42 +10:00
parent e3e56971eb
commit a4d9c8f579
7 changed files with 7 additions and 9 deletions

View File

@ -312,7 +312,7 @@ static bool delete_recursive(const char *dir)
i = nbr = BLI_dir_contents(dir, &filelist);
fl = filelist;
while(i--) {
while (i--) {
char file[8];
BLI_split_file_part(fl->path, file, sizeof(file));
if (STREQ(file, ".") || STREQ(file, "..")) {

View File

@ -1042,7 +1042,7 @@ static void curve_rename_fcurves(Curve *cu, ListBase *orig_curves)
{
int nu_index = 0, a, pt_index;
EditNurb *editnurb = cu->editnurb;
Nurb *nu = editnurb->nurbs.first;
Nurb *nu;
CVKeyIndex *keyIndex;
char rna_path[64], orig_rna_path[64];
AnimData *adt = BKE_animdata_from_id(&cu->id);

View File

@ -1991,7 +1991,7 @@ void ui_get_but_string_ex(uiBut *but, char *str, const size_t maxlen, const int
}
else if (buf && buf != str) {
/* string was too long, we have to truncate */
memcpy(str, buf, MIN2(maxlen, (size_t)buf_len + 1));
memcpy(str, buf, MIN2(maxlen, (size_t)(buf_len + 1)));
MEM_freeN((void *)buf);
}
}

View File

@ -330,7 +330,7 @@ void UI_DrawString(float x, float y, const char *str)
/* reading without uifont will create one */
void uiStyleInit(void)
{
uiFont *font = U.uifonts.first;
uiFont *font;
uiStyle *style = U.uistyles.first;
int monofont_size = datatoc_bmonofont_ttf_size;
unsigned char *monofont_ttf = (unsigned char *)datatoc_bmonofont_ttf;

View File

@ -795,8 +795,6 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve
BM_mesh_edgesplit(em->bm, true, true, true);
}
dist_sq = FLT_MAX;
{
/* --- select which vert --- */
BMVert *v_best = NULL;

View File

@ -776,7 +776,7 @@ static bool select_grouped_gameprops(bContext *C, Object *ob)
return changed;
}
static bool select_grouped_keyingset(bContext *C, ReportList *reports, Object *UNUSED(ob))
static bool select_grouped_keyingset(bContext *C, Object *UNUSED(ob), ReportList *reports)
{
KeyingSet *ks = ANIM_scene_get_active_keyingset(CTX_data_scene(C));
bool changed = false;
@ -867,7 +867,7 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op)
else if (nr == 9) changed |= select_grouped_index_object(C, ob);
else if (nr == 10) changed |= select_grouped_color(C, ob);
else if (nr == 11) changed |= select_grouped_gameprops(C, ob);
else if (nr == 12) changed |= select_grouped_keyingset(C, op->reports, ob);
else if (nr == 12) changed |= select_grouped_keyingset(C, ob, op->reports);
else if (nr == 13) changed |= select_similar_lamps(C, ob);
else if (nr == 14) changed |= select_similar_pass_index(C, ob);

View File

@ -535,7 +535,7 @@ static void blender_crash_handler_backtrace(FILE *fp)
SymInitialize(process, NULL, true);
nframes = CaptureStackBackTrace(0, SIZE, stack, NULL);
symbolinfo = MEM_callocN(sizeof(SYMBOL_INFO) + MAXSYMBOL * sizeof( char ), "crash Symbol table");
symbolinfo = MEM_callocN(sizeof(SYMBOL_INFO) + MAXSYMBOL * sizeof(char), "crash Symbol table");
symbolinfo->MaxNameLen = MAXSYMBOL - 1;
symbolinfo->SizeOfStruct = sizeof(SYMBOL_INFO);