diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-05 18:11:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-05 18:11:51 +0400 |
commit | 0a35e050f3139a55e98f17c88875d76f433e371a (patch) | |
tree | 70e7afa5e6476a7346f38453f3647b1013e1f3b4 /source | |
parent | 9ddbd8329e51582a0a5a1e6e397d2f75e5e9c0d6 (diff) |
code cleanup: remove redundant calls to CTX_data_main()
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sound/sound_ops.c | 7 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 3b077dd22ef..674e848937f 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -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) diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index f3b047130f2..5d3a658b206 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -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 } diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 53ca256be0c..aaa1328f9f6 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -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; } diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 93f49fd72c9..aa9d81389da 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -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); |