[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49684] trunk/blender/source/blender/ blenkernel: Code cleanup: mark functions as static, ifdef 0 some unused functions

Sergey Sharybin sergey.vfx at gmail.com
Wed Aug 8 13:15:32 CEST 2012


Revision: 49684
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49684
Author:   nazgul
Date:     2012-08-08 11:15:32 +0000 (Wed, 08 Aug 2012)
Log Message:
-----------
Code cleanup: mark functions as static, ifdef 0 some unused functions

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_sequencer.h
    trunk/blender/source/blender/blenkernel/intern/seqcache.c
    trunk/blender/source/blender/blenkernel/intern/sequencer.c

Modified: trunk/blender/source/blender/blenkernel/BKE_sequencer.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_sequencer.h	2012-08-08 08:41:10 UTC (rev 49683)
+++ trunk/blender/source/blender/blenkernel/BKE_sequencer.h	2012-08-08 11:15:32 UTC (rev 49684)
@@ -64,7 +64,6 @@
 void seq_begin(struct Editing *ed, SeqIterator *iter, int use_pointer);
 void seq_next(SeqIterator *iter);
 void seq_end(SeqIterator *iter);
-void seq_array(struct Editing *ed, struct Sequence ***seqarray, int *tot, int use_pointer);
 
 #define SEQP_BEGIN(ed, _seq)                                                  \
 	{                                                                         \
@@ -97,9 +96,6 @@
     struct Main *bmain, struct Scene *scene,
     int rectx, int recty, int preview_render_size);
 
-int seq_cmp_render_data(const SeqRenderData *a, const SeqRenderData *b);
-unsigned int seq_hash_render_data(const SeqRenderData *a);
-
 /* Wipe effect */
 enum {
 	DO_SINGLE_WIPE,
@@ -191,21 +187,16 @@
 /* maintenance functions, mostly for RNA */
 // extern 
 void seq_free_sequence(struct Scene *scene, struct Sequence *seq);
-void seq_free_sequence_recurse(struct Scene *scene, struct Sequence *seq);
-void seq_free_strip(struct Strip *strip);
 
 void seq_free_clipboard(void);
 const char *give_seqname(struct Sequence *seq);
 void calc_sequence(struct Scene *scene, struct Sequence *seq);
 void calc_sequence_disp(struct Scene *scene, struct Sequence *seq);
 void reload_sequence_new_file(struct Scene *scene, struct Sequence *seq, int lock_range);
-void build_seqar_cb(struct ListBase *seqbase, struct Sequence  ***seqar, int *totseq,
-                    int (*test_func)(struct Sequence *seq));
 int evaluate_seq_frame(struct Scene *scene, int cfra);
 struct StripElem *give_stripelem(struct Sequence *seq, int cfra);
 
 // intern
-void printf_strip(struct Sequence *seq); // debugging function (unused)
 void update_changed_seq_and_deps(struct Scene *scene, struct Sequence *changed_seq, int len_change, int ibuf_change);
 
 int input_have_to_preprocess(
@@ -267,8 +258,6 @@
  */
    
 /* for transform but also could use elsewhere */
-int seq_tx_get_start(struct Sequence *seq);
-int seq_tx_get_end(struct Sequence *seq);
 int seq_tx_get_final_left(struct Sequence *seq, int metaclip);
 int seq_tx_get_final_right(struct Sequence *seq, int metaclip);
 void seq_tx_set_final_left(struct Sequence *seq, int val);
@@ -337,8 +326,6 @@
 
 struct Sequence *alloc_sequence(ListBase *lb, int cfra, int machine);
 
-void seq_load_apply(struct Scene *scene, struct Sequence *seq, struct SeqLoadInfo *seq_load);
-
 struct Sequence *sequencer_add_image_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load);
 struct Sequence *sequencer_add_sound_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load);
 struct Sequence *sequencer_add_movie_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load);

Modified: trunk/blender/source/blender/blenkernel/intern/seqcache.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/seqcache.c	2012-08-08 08:41:10 UTC (rev 49683)
+++ trunk/blender/source/blender/blenkernel/intern/seqcache.c	2012-08-08 11:15:32 UTC (rev 49684)
@@ -47,6 +47,73 @@
 
 static struct MovieCache *moviecache = NULL;
 
+static int seq_cmp_render_data(const SeqRenderData *a, const SeqRenderData *b)
+{
+	if (a->preview_render_size < b->preview_render_size) {
+		return -1;
+	}
+	if (a->preview_render_size > b->preview_render_size) {
+		return 1;
+	}
+
+	if (a->rectx < b->rectx) {
+		return -1;
+	}
+	if (a->rectx > b->rectx) {
+		return 1;
+	}
+
+	if (a->recty < b->recty) {
+		return -1;
+	}
+	if (a->recty > b->recty) {
+		return 1;
+	}
+
+	if (a->bmain < b->bmain) {
+		return -1;
+	}
+	if (a->bmain > b->bmain) {
+		return 1;
+	}
+
+	if (a->scene < b->scene) {
+		return -1;
+	}
+	if (a->scene > b->scene) {
+		return 1;
+	}
+
+	if (a->motion_blur_shutter < b->motion_blur_shutter) {
+		return -1;
+	}
+	if (a->motion_blur_shutter > b->motion_blur_shutter) {
+		return 1;
+	}
+
+	if (a->motion_blur_samples < b->motion_blur_samples) {
+		return -1;
+	}
+	if (a->motion_blur_samples > b->motion_blur_samples) {
+		return 1;
+	}
+
+	return 0;
+}
+
+static unsigned int seq_hash_render_data(const SeqRenderData *a)
+{
+	unsigned int rval = a->rectx + a->recty;
+
+	rval ^= a->preview_render_size;
+	rval ^= ((intptr_t) a->bmain) << 6;
+	rval ^= ((intptr_t) a->scene) << 6;
+	rval ^= (int)(a->motion_blur_shutter * 100.0f) << 10;
+	rval ^= a->motion_blur_samples << 24;
+
+	return rval;
+}
+
 static unsigned int seqcache_hashhash(const void *key_)
 {
 	const SeqCacheKey *key = (SeqCacheKey *) key_;

Modified: trunk/blender/source/blender/blenkernel/intern/sequencer.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sequencer.c	2012-08-08 08:41:10 UTC (rev 49683)
+++ trunk/blender/source/blender/blenkernel/intern/sequencer.c	2012-08-08 11:15:32 UTC (rev 49684)
@@ -95,13 +95,14 @@
 int seqbase_clipboard_frame;
 SequencerDrawView sequencer_view3d_cb = NULL; /* NULL in background mode */
 
-
-void printf_strip(Sequence *seq)
+#if 0  /* unused function */
+static void printf_strip(Sequence *seq)
 {
 	fprintf(stderr, "name: '%s', len:%d, start:%d, (startofs:%d, endofs:%d), (startstill:%d, endstill:%d), machine:%d, (startdisp:%d, enddisp:%d)\n",
 	        seq->name, seq->len, seq->start, seq->startofs, seq->endofs, seq->startstill, seq->endstill, seq->machine, seq->startdisp, seq->enddisp);
 	fprintf(stderr, "\tseq_tx_set_final_left: %d %d\n\n", seq_tx_get_final_left(seq, 0), seq_tx_get_final_right(seq, 0));
 }
+#endif
 
 int seqbase_recursive_apply(ListBase *seqbase, int (*apply_func)(Sequence *seq, void *), void *arg)
 {
@@ -140,7 +141,7 @@
 	}
 }
 
-void seq_free_strip(Strip *strip)
+static void seq_free_strip(Strip *strip)
 {
 	strip->us--;
 	if (strip->us > 0) return;
@@ -205,7 +206,7 @@
 	MEM_freeN(seq);
 }
 
-void seq_free_sequence_recurse(Scene *scene, Sequence *seq)
+static void seq_free_sequence_recurse(Scene *scene, Sequence *seq)
 {
 	Sequence *iseq;
 
@@ -306,73 +307,6 @@
 	return rval;
 }
 
-int seq_cmp_render_data(const SeqRenderData *a, const SeqRenderData *b)
-{
-	if (a->preview_render_size < b->preview_render_size) {
-		return -1;
-	}
-	if (a->preview_render_size > b->preview_render_size) {
-		return 1;
-	}
-	
-	if (a->rectx < b->rectx) {
-		return -1;
-	}
-	if (a->rectx > b->rectx) {
-		return 1;
-	}
-
-	if (a->recty < b->recty) {
-		return -1;
-	}
-	if (a->recty > b->recty) {
-		return 1;
-	}
-
-	if (a->bmain < b->bmain) {
-		return -1;
-	}
-	if (a->bmain > b->bmain) {
-		return 1;
-	}
-
-	if (a->scene < b->scene) {
-		return -1;
-	}
-	if (a->scene > b->scene) {
-		return 1;
-	}
-
-	if (a->motion_blur_shutter < b->motion_blur_shutter) {
-		return -1;
-	}
-	if (a->motion_blur_shutter > b->motion_blur_shutter) {
-		return 1;
-	}
-
-	if (a->motion_blur_samples < b->motion_blur_samples) {
-		return -1;
-	}
-	if (a->motion_blur_samples > b->motion_blur_samples) {
-		return 1;
-	}
-
-	return 0;
-}
-
-unsigned int seq_hash_render_data(const SeqRenderData *a)
-{
-	unsigned int rval = a->rectx + a->recty;
-
-	rval ^= a->preview_render_size;
-	rval ^= ((intptr_t) a->bmain) << 6;
-	rval ^= ((intptr_t) a->scene) << 6;
-	rval ^= (int)(a->motion_blur_shutter * 100.0f) << 10;
-	rval ^= a->motion_blur_samples << 24;
-	
-	return rval;
-}
-
 /* ************************* iterator ************************** */
 /* *************** (replaces old WHILE_SEQ) ********************* */
 /* **************** use now SEQ_BEGIN () SEQ_END ***************** */
@@ -407,7 +341,7 @@
 	}
 }
 
-void seq_array(Editing *ed, Sequence ***seqarray, int *tot, int use_pointer)
+static void seq_array(Editing *ed, Sequence ***seqarray, int *tot, int use_pointer)
 {
 	Sequence **array;
 
@@ -508,8 +442,9 @@
 	}
 }
 
-void build_seqar_cb(ListBase *seqbase, Sequence  ***seqar, int *totseq,
-                    int (*test_func)(Sequence *seq))
+#if 0  /* unused function */
+static void build_seqar_cb(ListBase *seqbase, Sequence  ***seqar, int *totseq,
+                           int (*test_func)(Sequence *seq))
 {
 	Sequence **tseqar;
 
@@ -526,6 +461,7 @@
 	do_build_seqar_cb(seqbase, seqar, 0, test_func);
 	*seqar = tseqar;
 }
+#endif
 
 static int metaseq_start(Sequence *metaseq)
 {
@@ -2459,6 +2395,8 @@
 			{
 				StripElem *s_elem = give_stripelem(seq, cfra);
 
+				printf("Render image strip\n");
+
 				if (s_elem) {
 					BLI_join_dirfile(name, sizeof(name), seq->strip->dir, s_elem->name);
 					BLI_path_abs(name, G.main->name);
@@ -3211,11 +3149,11 @@
  * left and right are the bounds at which the sequence is rendered,
  * start and end are from the start and fixed length of the sequence.
  */
-int seq_tx_get_start(Sequence *seq)
+static int seq_tx_get_start(Sequence *seq)
 {
 	return seq->start;
 }
-int seq_tx_get_end(Sequence *seq)
+static int seq_tx_get_end(Sequence *seq)
 {
 	return seq->start + seq->len;
 }
@@ -3908,7 +3846,7 @@
 
 /* api like funcs for adding */
 
-void seq_load_apply(Scene *scene, Sequence *seq, SeqLoadInfo *seq_load)
+static void seq_load_apply(Scene *scene, Sequence *seq, SeqLoadInfo *seq_load)
 {
 	if (seq) {
 		BLI_strncpy(seq->name + 2, seq_load->name, sizeof(seq->name) - 2);




More information about the Bf-blender-cvs mailing list