fix own mistake [#27451] Flip to Top / Flip to Bottom menuitems on right click on header not working

also get rig of more shadowed vars (-Wshadow).
This commit is contained in:
Campbell Barton 2011-05-23 08:14:29 +00:00
parent af49b5f6c9
commit f5ec4cf4e9
10 changed files with 42 additions and 40 deletions

View File

@ -93,10 +93,10 @@ int txt_add_raw_char (struct Text *text, char add);
int txt_replace_char (struct Text *text, char add); int txt_replace_char (struct Text *text, char add);
void txt_export_to_object(struct Text *text); void txt_export_to_object(struct Text *text);
void txt_export_to_objects(struct Text *text); void txt_export_to_objects(struct Text *text);
void unindent (struct Text *text); void txt_unindent (struct Text *text);
void comment (struct Text *text); void txt_comment (struct Text *text);
void indent (struct Text *text); void txt_indent (struct Text *text);
void uncomment (struct Text *text); void txt_uncomment (struct Text *text);
int setcurr_tab_spaces (struct Text *text, int space); int setcurr_tab_spaces (struct Text *text, int space);
void txt_add_marker (struct Text *text, struct TextLine *line, int start, int end, const unsigned char color[4], int group, int flags); void txt_add_marker (struct Text *text, struct TextLine *line, int start, int end, const unsigned char color[4], int group, int flags);

View File

@ -1894,13 +1894,13 @@ void txt_do_undo(Text *text)
if (op==UNDO_INDENT) { if (op==UNDO_INDENT) {
unindent(text); txt_unindent(text);
} else if (op== UNDO_UNINDENT) { } else if (op== UNDO_UNINDENT) {
indent(text); txt_indent(text);
} else if (op == UNDO_COMMENT) { } else if (op == UNDO_COMMENT) {
uncomment(text); txt_uncomment(text);
} else if (op == UNDO_UNCOMMENT) { } else if (op == UNDO_UNCOMMENT) {
comment(text); txt_comment(text);
} }
text->undo_pos--; text->undo_pos--;
@ -2110,13 +2110,13 @@ void txt_do_redo(Text *text)
} }
if (op==UNDO_INDENT) { if (op==UNDO_INDENT) {
indent(text); txt_indent(text);
} else if (op== UNDO_UNINDENT) { } else if (op== UNDO_UNINDENT) {
unindent(text); txt_unindent(text);
} else if (op == UNDO_COMMENT) { } else if (op == UNDO_COMMENT) {
comment(text); txt_comment(text);
} else if (op == UNDO_UNCOMMENT) { } else if (op == UNDO_UNCOMMENT) {
uncomment(text); txt_uncomment(text);
} }
break; break;
default: default:
@ -2501,7 +2501,7 @@ int txt_replace_char (Text *text, char add)
return 1; return 1;
} }
void indent(Text *text) void txt_indent(Text *text)
{ {
int len, num; int len, num;
char *tmp; char *tmp;
@ -2564,7 +2564,7 @@ void indent(Text *text)
} }
} }
void unindent(Text *text) void txt_unindent(Text *text)
{ {
int num = 0; int num = 0;
const char *remove = "\t"; const char *remove = "\t";
@ -2622,7 +2622,7 @@ void unindent(Text *text)
} }
} }
void comment(Text *text) void txt_comment(Text *text)
{ {
int len, num; int len, num;
char *tmp; char *tmp;
@ -2674,7 +2674,7 @@ void comment(Text *text)
} }
} }
void uncomment(Text *text) void txt_uncomment(Text *text)
{ {
int num = 0; int num = 0;
char remove = '#'; char remove = '#';
@ -2751,19 +2751,19 @@ int setcurr_tab_spaces (Text *text, int space)
* 2) within an identifier * 2) within an identifier
* 3) after the cursor (text->curc), i.e. when creating space before a function def [#25414] * 3) after the cursor (text->curc), i.e. when creating space before a function def [#25414]
*/ */
int a, indent = 0; int a, is_indent = 0;
for(a=0; (a < text->curc) && (text->curl->line[a] != '\0'); a++) for(a=0; (a < text->curc) && (text->curl->line[a] != '\0'); a++)
{ {
char ch= text->curl->line[a]; char ch= text->curl->line[a];
if (ch=='#') { if (ch=='#') {
break; break;
} else if (ch==':') { } else if (ch==':') {
indent = 1; is_indent = 1;
} else if (ch==']' || ch=='}' || ch=='"' || ch=='\'') { } else if (ch==']' || ch=='}' || ch=='"' || ch=='\'') {
indent = 0; is_indent = 0;
} }
} }
if (indent) { if (is_indent) {
i += space; i += space;
} }
} }

View File

@ -96,7 +96,7 @@ void BLI_edgehash_insert(EdgeHash *eh, int v0, int v1, void *val) {
eh->buckets[hash]= e; eh->buckets[hash]= e;
if (++eh->nentries>eh->nbuckets*3) { if (++eh->nentries>eh->nbuckets*3) {
Entry *e, **old= eh->buckets; Entry **old= eh->buckets;
int i, nold= eh->nbuckets; int i, nold= eh->nbuckets;
eh->nbuckets= hashsizes[++eh->cursize]; eh->nbuckets= hashsizes[++eh->cursize];

View File

@ -4138,7 +4138,6 @@ static void direct_link_object(FileData *fd, Object *ob)
bSensor *sens; bSensor *sens;
bController *cont; bController *cont;
bActuator *act; bActuator *act;
int a;
/* weak weak... this was only meant as draw flag, now is used in give_base_to_objects too */ /* weak weak... this was only meant as draw flag, now is used in give_base_to_objects too */
ob->flag &= ~OB_FROMGROUP; ob->flag &= ~OB_FROMGROUP;
@ -4238,6 +4237,7 @@ static void direct_link_object(FileData *fd, Object *ob)
sb->keys= newdataadr(fd, sb->keys); sb->keys= newdataadr(fd, sb->keys);
test_pointer_array(fd, (void **)&sb->keys); test_pointer_array(fd, (void **)&sb->keys);
if(sb->keys) { if(sb->keys) {
int a;
for(a=0; a<sb->totkey; a++) { for(a=0; a<sb->totkey; a++) {
sb->keys[a]= newdataadr(fd, sb->keys[a]); sb->keys[a]= newdataadr(fd, sb->keys[a]);
} }
@ -8378,7 +8378,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ArmatureModifierData *amd = (ArmatureModifierData*) md; ArmatureModifierData *amd = (ArmatureModifierData*) md;
if(amd->object && amd->deformflag==0) { if(amd->object && amd->deformflag==0) {
Object *oba= newlibadr(fd, lib, amd->object); Object *oba= newlibadr(fd, lib, amd->object);
bArmature *arm= newlibadr(fd, lib, oba->data); arm= newlibadr(fd, lib, oba->data);
amd->deformflag= arm->deformflag; amd->deformflag= arm->deformflag;
} }
} }
@ -8525,7 +8525,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
int a; int a;
for(a=0; a<MAX_MTEX; a++) { for(a=0; a<MAX_MTEX; a++) {
if(ma->mtex[a] && ma->mtex[a]->tex) { if(ma->mtex[a] && ma->mtex[a]->tex) {
Tex *tex= newlibadr(fd, lib, ma->mtex[a]->tex); tex= newlibadr(fd, lib, ma->mtex[a]->tex);
if(tex && tex->type==TEX_STUCCI) if(tex && tex->type==TEX_STUCCI)
ma->mtex[a]->mapto &= ~(MAP_COL|MAP_SPEC|MAP_REF); ma->mtex[a]->mapto &= ~(MAP_COL|MAP_SPEC|MAP_REF);
} }
@ -8717,7 +8717,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* now, subversion control! */ /* now, subversion control! */
if(main->subversionfile < 3) { if(main->subversionfile < 3) {
bScreen *sc;
Image *ima; Image *ima;
Tex *tex; Tex *tex;
@ -10133,7 +10132,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
ToolSettings *ts; ToolSettings *ts;
//PTCacheID *pid; //PTCacheID *pid;
//ListBase pidlist; //ListBase pidlist;
int a;
for(ob = main->object.first; ob; ob = ob->id.next) { for(ob = main->object.first; ob; ob = ob->id.next) {
//BKE_ptcache_ids_from_object(&pidlist, ob); //BKE_ptcache_ids_from_object(&pidlist, ob);
@ -10172,6 +10170,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
} }
for(ma = main->mat.first; ma; ma = ma->id.next) { for(ma = main->mat.first; ma; ma = ma->id.next) {
int a;
if(ma->mode & MA_WIRE) { if(ma->mode & MA_WIRE) {
ma->material_type= MA_TYPE_WIRE; ma->material_type= MA_TYPE_WIRE;
ma->mode &= ~MA_WIRE; ma->mode &= ~MA_WIRE;

View File

@ -2130,8 +2130,8 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
writestruct(wd, DATA, "SpaceText", 1, sl); writestruct(wd, DATA, "SpaceText", 1, sl);
} }
else if(sl->spacetype==SPACE_SCRIPT) { else if(sl->spacetype==SPACE_SCRIPT) {
SpaceScript *sc = (SpaceScript*)sl; SpaceScript *scr = (SpaceScript*)sl;
sc->but_refs = NULL; scr->but_refs = NULL;
writestruct(wd, DATA, "SpaceScript", 1, sl); writestruct(wd, DATA, "SpaceScript", 1, sl);
} }
else if(sl->spacetype==SPACE_ACTION) { else if(sl->spacetype==SPACE_ACTION) {

View File

@ -780,7 +780,7 @@ static void calc_shapeKeys(Object *obedit)
/* are there keys? */ /* are there keys? */
if(cu->key) { if(cu->key) {
int a, i, j; int a, i;
EditNurb *editnurb= cu->editnurb; EditNurb *editnurb= cu->editnurb;
KeyBlock *currkey; KeyBlock *currkey;
KeyBlock *actkey= BLI_findlink(&cu->key->block, editnurb->shapenr-1); KeyBlock *actkey= BLI_findlink(&cu->key->block, editnurb->shapenr-1);
@ -804,7 +804,6 @@ static void calc_shapeKeys(Object *obedit)
} }
if(act_is_basis) { /* active key is a base */ if(act_is_basis) { /* active key is a base */
int j;
int totvec= 0; int totvec= 0;
/* Calculate needed memory to store offset */ /* Calculate needed memory to store offset */
@ -831,6 +830,7 @@ static void calc_shapeKeys(Object *obedit)
oldbezt= getKeyIndexOrig_bezt(editnurb, bezt); oldbezt= getKeyIndexOrig_bezt(editnurb, bezt);
if (oldbezt) { if (oldbezt) {
int j;
for (j= 0; j < 3; ++j) { for (j= 0; j < 3; ++j) {
VECSUB(ofs[i], bezt->vec[j], oldbezt->vec[j]); VECSUB(ofs[i], bezt->vec[j], oldbezt->vec[j]);
i++; i++;
@ -878,6 +878,7 @@ static void calc_shapeKeys(Object *obedit)
bezt= nu->bezt; bezt= nu->bezt;
a= nu->pntsu; a= nu->pntsu;
while(a--) { while(a--) {
int j;
oldbezt= getKeyIndexOrig_bezt(editnurb, bezt); oldbezt= getKeyIndexOrig_bezt(editnurb, bezt);
for (j= 0; j < 3; ++j, ++i) { for (j= 0; j < 3; ++j, ++i) {
@ -932,6 +933,7 @@ static void calc_shapeKeys(Object *obedit)
while(a--) { while(a--) {
index= getKeyIndexOrig_keyIndex(editnurb, bezt); index= getKeyIndexOrig_keyIndex(editnurb, bezt);
if (index >= 0) { if (index >= 0) {
int j;
curofp= ofp + index; curofp= ofp + index;
for (j= 0; j < 3; ++j, ++i) { for (j= 0; j < 3; ++j, ++i) {
@ -953,6 +955,7 @@ static void calc_shapeKeys(Object *obedit)
fp+= 3; /* alphas */ fp+= 3; /* alphas */
} else { } else {
int j;
for (j= 0; j < 3; ++j, ++i) { for (j= 0; j < 3; ++j, ++i) {
VECCOPY(fp, bezt->vec[j]); VECCOPY(fp, bezt->vec[j]);
fp+= 3; fp+= 3;

View File

@ -2616,7 +2616,7 @@ static int header_flip_exec(bContext *C, wmOperator *UNUSED(op))
*/ */
if((ar == NULL) || (ar->regiontype != RGN_TYPE_HEADER)) { if((ar == NULL) || (ar->regiontype != RGN_TYPE_HEADER)) {
ScrArea *sa= CTX_wm_area(C); ScrArea *sa= CTX_wm_area(C);
ARegion *ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER); ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER);
/* don't do anything if no region */ /* don't do anything if no region */
if(ar == NULL) if(ar == NULL)

View File

@ -894,7 +894,7 @@ static int indent_exec(bContext *C, wmOperator *UNUSED(op))
if(txt_has_sel(text)) { if(txt_has_sel(text)) {
txt_order_cursors(text); txt_order_cursors(text);
indent(text); txt_indent(text);
} }
else else
txt_add_char(text, '\t'); txt_add_char(text, '\t');
@ -929,7 +929,7 @@ static int unindent_exec(bContext *C, wmOperator *UNUSED(op))
text_drawcache_tag_update(CTX_wm_space_text(C), 0); text_drawcache_tag_update(CTX_wm_space_text(C), 0);
txt_order_cursors(text); txt_order_cursors(text);
unindent(text); txt_unindent(text);
text_update_edited(text); text_update_edited(text);
@ -1011,7 +1011,7 @@ static int comment_exec(bContext *C, wmOperator *UNUSED(op))
text_drawcache_tag_update(CTX_wm_space_text(C), 0); text_drawcache_tag_update(CTX_wm_space_text(C), 0);
txt_order_cursors(text); txt_order_cursors(text);
comment(text); txt_comment(text);
text_update_edited(text); text_update_edited(text);
text_update_cursor_moved(C); text_update_cursor_moved(C);
@ -1044,7 +1044,7 @@ static int uncomment_exec(bContext *C, wmOperator *UNUSED(op))
text_drawcache_tag_update(CTX_wm_space_text(C), 0); text_drawcache_tag_update(CTX_wm_space_text(C), 0);
txt_order_cursors(text); txt_order_cursors(text);
uncomment(text); txt_uncomment(text);
text_update_edited(text); text_update_edited(text);
text_update_cursor_moved(C); text_update_cursor_moved(C);

View File

@ -4937,8 +4937,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
/* when running transform non-interactively (operator exec), /* when running transform non-interactively (operator exec),
* we need to update the pose otherwise no updates get called during * we need to update the pose otherwise no updates get called during
* transform and the auto-ik is not applied. see [#26164] */ * transform and the auto-ik is not applied. see [#26164] */
struct Object *ob=t->poseobj; struct Object *pose_ob=t->poseobj;
where_is_pose(t->scene, ob); where_is_pose(t->scene, pose_ob);
} }
/* if target-less IK grabbing, we calculate the pchan transforms and clear flag */ /* if target-less IK grabbing, we calculate the pchan transforms and clear flag */

View File

@ -1613,9 +1613,9 @@ static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, f
for(dupli_ob = lb->first; dupli_ob; dupli_ob = dupli_ob->next) for(dupli_ob = lb->first; dupli_ob; dupli_ob = dupli_ob->next)
{ {
Object *ob = dupli_ob->ob; Object *dob = dupli_ob->ob;
retval |= snapObject(scene, ar, ob, 0, dupli_ob->mat, ray_start, ray_normal, mval, loc, no, dist, &depth); retval |= snapObject(scene, ar, dob, 0, dupli_ob->mat, ray_start, ray_normal, mval, loc, no, dist, &depth);
} }
free_object_duplilist(lb); free_object_duplilist(lb);