code cleanup: remove redundant calls to CTX_data_main()

This commit is contained in:
2012-08-05 14:11:51 +00:00
parent 9ddbd8329e
commit 0a35e050f3
4 changed files with 7 additions and 6 deletions

View File

@@ -3918,7 +3918,7 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
AUD_SoundInfo info;
sound = sound_new_file(CTX_data_main(C), seq_load->path); /* handles relative paths */
sound = sound_new_file(bmain, seq_load->path); /* handles relative paths */
if (sound == NULL || sound->playback_handle == NULL) {
//if (op)

View File

@@ -430,7 +430,7 @@ int isect_seg_seg_v2(const float v1[2], const float v2[2], const float v3[2], co
{
#define CCW(A, B, C) ((C[1] - A[1]) * (B[0] - A[0]) > (B[1]-A[1]) * (C[0]-A[0]))
return CCW(v1, v3, v4) != CCW(v2, v3, v4) && CCW(v1, v2, v3) != CCW(v1, v2, v4);
return CCW(v1, v3, v4) != CCW(v2, v3, v4) && CCW(v1, v2, v3) != CCW(v1, v2, v4);
#undef CCW
}

View File

@@ -701,7 +701,7 @@ static int sound_pack_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
sound->packedfile = newPackedFile(op->reports, sound->name, ID_BLEND_PATH(bmain, &sound->id));
sound_load(CTX_data_main(C), sound);
sound_load(bmain, sound);
return OPERATOR_FINISHED;
}
@@ -725,6 +725,7 @@ static void SOUND_OT_pack(wmOperatorType *ot)
static int sound_unpack_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
int method = RNA_enum_get(op->ptr, "method");
bSound *sound = NULL;
@@ -732,7 +733,7 @@ static int sound_unpack_exec(bContext *C, wmOperator *op)
if (RNA_struct_property_is_set(op->ptr, "id")) {
char sndname[MAX_ID_NAME - 2];
RNA_string_get(op->ptr, "id", sndname);
sound = BLI_findstring(&CTX_data_main(C)->sound, sndname, offsetof(ID, name) + 2);
sound = BLI_findstring(&bmain->sound, sndname, offsetof(ID, name) + 2);
}
if (!sound || !sound->packedfile)
@@ -741,7 +742,7 @@ static int sound_unpack_exec(bContext *C, wmOperator *op)
if (G.fileflags & G_AUTOPACK)
BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save");
unpackSound(CTX_data_main(C), op->reports, sound, method);
unpackSound(bmain, op->reports, sound, method);
return OPERATOR_FINISHED;
}

View File

@@ -639,7 +639,7 @@ void BPY_modules_load_user(bContext *C)
bpy_context_set(C, &gilstate);
for (text = CTX_data_main(C)->text.first; text; text = text->id.next) {
for (text = bmain->text.first; text; text = text->id.next) {
if (text->flags & TXT_ISSCRIPT && BLI_testextensie(text->id.name + 2, ".py")) {
if (!(G.f & G_SCRIPT_AUTOEXEC)) {
printf("scripts disabled for \"%s\", skipping '%s'\n", bmain->name, text->id.name + 2);