[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32457] trunk/blender/source/blender/ editors/space_console: use UNUSED() macro for the console space + minor changes to args.

Campbell Barton ideasman42 at gmail.com
Thu Oct 14 01:46:42 CEST 2010


Revision: 32457
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32457
Author:   campbellbarton
Date:     2010-10-14 01:46:42 +0200 (Thu, 14 Oct 2010)

Log Message:
-----------
use UNUSED() macro for the console space + minor changes to args.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_console/console_draw.c
    trunk/blender/source/blender/editors/space_console/console_intern.h
    trunk/blender/source/blender/editors/space_console/console_ops.c
    trunk/blender/source/blender/editors/space_console/console_report.c
    trunk/blender/source/blender/editors/space_console/space_console.c

Modified: trunk/blender/source/blender/editors/space_console/console_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_console/console_draw.c	2010-10-13 23:25:08 UTC (rev 32456)
+++ trunk/blender/source/blender/editors/space_console/console_draw.c	2010-10-13 23:46:42 UTC (rev 32457)
@@ -133,7 +133,7 @@
 	int draw;
 } ConsoleDrawContext;
 
-static void console_draw_sel(int sel[2], int xy[2], int str_len_draw, int cwidth, int console_width, int lheight)
+static void console_draw_sel(int sel[2], int xy[2], int str_len_draw, int cwidth, int lheight)
 {
 	if(sel[0] <= str_len_draw && sel[1] >= 0) {
 		int sta = MAX2(sel[0], 0);
@@ -222,7 +222,7 @@
 		if(cdc->sel[0] != cdc->sel[1]) {
 			STEP_SEL(-initial_offset);
 			// glColor4ub(255, 0, 0, 96); // debug
-			console_draw_sel(cdc->sel, cdc->xy, str_len % cdc->console_width, cdc->cwidth, cdc->console_width, cdc->lheight);
+			console_draw_sel(cdc->sel, cdc->xy, str_len % cdc->console_width, cdc->cwidth, cdc->lheight);
 			STEP_SEL(cdc->console_width);
 			glColor3ubv(fg);
 		}
@@ -240,7 +240,7 @@
 			
 			if(cdc->sel[0] != cdc->sel[1]) {
 				// glColor4ub(0, 255, 0, 96); // debug
-				console_draw_sel(cdc->sel, cdc->xy, cdc->console_width, cdc->cwidth, cdc->console_width, cdc->lheight);
+				console_draw_sel(cdc->sel, cdc->xy, cdc->console_width, cdc->cwidth, cdc->lheight);
 				STEP_SEL(cdc->console_width);
 				glColor3ubv(fg);
 			}
@@ -272,7 +272,7 @@
 		if(cdc->sel[0] != cdc->sel[1]) {
 			int isel[2]= {str_len - cdc->sel[1], str_len - cdc->sel[0]};
 			// glColor4ub(255, 255, 0, 96); // debug
-			console_draw_sel(isel, cdc->xy, str_len, cdc->cwidth, cdc->console_width, cdc->lheight);
+			console_draw_sel(isel, cdc->xy, str_len, cdc->cwidth, cdc->lheight);
 			STEP_SEL(-(str_len + 1));
 		}
 

Modified: trunk/blender/source/blender/editors/space_console/console_intern.h
===================================================================
--- trunk/blender/source/blender/editors/space_console/console_intern.h	2010-10-13 23:25:08 UTC (rev 32456)
+++ trunk/blender/source/blender/editors/space_console/console_intern.h	2010-10-13 23:46:42 UTC (rev 32457)
@@ -47,8 +47,8 @@
 /* console_ops.c */
 void console_history_free(SpaceConsole *sc, ConsoleLine *cl);
 void console_scrollback_free(SpaceConsole *sc, ConsoleLine *cl);
-ConsoleLine *console_history_add_str(const struct bContext *C, char *str, int own);
-ConsoleLine *console_scrollback_add_str(const struct bContext *C, char *str, int own);
+ConsoleLine *console_history_add_str(struct SpaceConsole *sc, char *str, int own);
+ConsoleLine *console_scrollback_add_str(struct SpaceConsole *sc, char *str, int own);
 
 ConsoleLine *console_history_verify(const struct bContext *C);
 

Modified: trunk/blender/source/blender/editors/space_console/console_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_console/console_ops.c	2010-10-13 23:25:08 UTC (rev 32456)
+++ trunk/blender/source/blender/editors/space_console/console_ops.c	2010-10-13 23:46:42 UTC (rev 32457)
@@ -194,7 +194,7 @@
 }
 #endif
 
-static ConsoleLine *console_lb_add_str__internal(ListBase *lb, const bContext *C, char *str, int own)
+static ConsoleLine *console_lb_add_str__internal(ListBase *lb, char *str, int own)
 {
 	ConsoleLine *ci= MEM_callocN(sizeof(ConsoleLine), "ConsoleLine Add");
 	if(own)		ci->line= str;
@@ -205,14 +205,13 @@
 	BLI_addtail(lb, ci);
 	return ci;
 }
-ConsoleLine *console_history_add_str(const bContext *C, char *str, int own)
+ConsoleLine *console_history_add_str(SpaceConsole *sc, char *str, int own)
 {
-	return console_lb_add_str__internal(&CTX_wm_space_console(C)->history, C, str, own);
+	return console_lb_add_str__internal(&sc->history, str, own);
 }
-ConsoleLine *console_scrollback_add_str(const bContext *C, char *str, int own)
+ConsoleLine *console_scrollback_add_str(SpaceConsole *sc, char *str, int own)
 {
-	SpaceConsole *sc= CTX_wm_space_console(C);
-	ConsoleLine *ci= console_lb_add_str__internal(&sc->scrollback, C, str, own);
+	ConsoleLine *ci= console_lb_add_str__internal(&sc->scrollback, str, own);
 	console_select_offset(sc, ci->len + 1);
 	return ci;
 }
@@ -627,7 +626,7 @@
 		}
 	}
 
-	ci= console_history_add_str(C, str, 1); /* own the string */
+	ci= console_history_add_str(sc, str, 1); /* own the string */
 	console_select_offset(sc, ci->len - prev_len);
 	console_line_cursor_set(ci, cursor);
 	
@@ -663,7 +662,7 @@
 	char *str= RNA_string_get_alloc(op->ptr, "text", NULL, 0); /* own this text in the new line, dont free */
 	int type= RNA_enum_get(op->ptr, "type");
 	
-	ci= console_scrollback_add_str(C, str, 1); /* own the string */
+	ci= console_scrollback_add_str(sc, str, 1); /* own the string */
 	ci->type= type;
 	
 	console_scrollback_limit(sc);
@@ -698,7 +697,7 @@
 }
 
 
-static int copy_exec(bContext *C, wmOperator *op)
+static int copy_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	SpaceConsole *sc= CTX_wm_space_console(C);
 	int buf_len;
@@ -779,7 +778,7 @@
 	/* properties */
 }
 
-static int paste_exec(bContext *C, wmOperator *op)
+static int paste_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	SpaceConsole *sc= CTX_wm_space_console(C);
 	ConsoleLine *ci= console_history_verify(C);
@@ -834,7 +833,8 @@
 	int sel_init;
 } SetConsoleCursor;
 
-static void set_cursor_to_pos(SpaceConsole *sc, ARegion *ar, SetConsoleCursor *scu, int mval[2], int sel)
+// TODO, cursor placement without selection
+static void set_cursor_to_pos(SpaceConsole *sc, ARegion *ar, SetConsoleCursor *scu, int mval[2], int UNUSED(sel))
 {
 	int pos;
 	pos= console_char_pick(sc, ar, NULL, mval);
@@ -869,7 +869,7 @@
 	ED_area_tag_redraw(CTX_wm_area(C));
 }
 
-static void set_cursor_exit(bContext *C, wmOperator *op)
+static void set_cursor_exit(bContext *UNUSED(C), wmOperator *op)
 {
 //	SpaceConsole *sc= CTX_wm_space_console(C);
 	SetConsoleCursor *scu= op->customdata;

Modified: trunk/blender/source/blender/editors/space_console/console_report.c
===================================================================
--- trunk/blender/source/blender/editors/space_console/console_report.c	2010-10-13 23:25:08 UTC (rev 32456)
+++ trunk/blender/source/blender/editors/space_console/console_report.c	2010-10-13 23:46:42 UTC (rev 32457)
@@ -72,7 +72,7 @@
 	return 1;
 }
 
-static int report_replay_exec(bContext *C, wmOperator *op)
+static int report_replay_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	SpaceConsole *sc= CTX_wm_space_console(C);
 	ReportList *reports= CTX_wm_reports(C);
@@ -83,7 +83,7 @@
 
 	for(report=reports->list.last; report; report=report->prev) {
 		if((report->type & report_mask) && (report->type & RPT_OPERATOR_ALL) && (report->flag & SELECT)) {
-			console_history_add_str(C, report->message, 0);
+			console_history_add_str(sc, report->message, 0);
 			WM_operator_name_call(C, "CONSOLE_OT_execute", WM_OP_EXEC_DEFAULT, NULL);
 
 			ED_area_tag_redraw(CTX_wm_area(C));
@@ -165,7 +165,7 @@
 
 
 
-static int report_select_all_toggle_exec(bContext *C, wmOperator *op)
+static int report_select_all_toggle_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	SpaceConsole *sc= CTX_wm_space_console(C);
 	ReportList *reports= CTX_wm_reports(C);
@@ -314,7 +314,7 @@
 
 
 
-static int report_delete_exec(bContext *C, wmOperator *op)
+static int report_delete_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	SpaceConsole *sc= CTX_wm_space_console(C);
 	ReportList *reports= CTX_wm_reports(C);
@@ -359,7 +359,7 @@
 }
 
 
-static int report_copy_exec(bContext *C, wmOperator *op)
+static int report_copy_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	SpaceConsole *sc= CTX_wm_space_console(C);
 	ReportList *reports= CTX_wm_reports(C);

Modified: trunk/blender/source/blender/editors/space_console/space_console.c
===================================================================
--- trunk/blender/source/blender/editors/space_console/space_console.c	2010-10-13 23:25:08 UTC (rev 32456)
+++ trunk/blender/source/blender/editors/space_console/space_console.c	2010-10-13 23:46:42 UTC (rev 32457)
@@ -67,7 +67,7 @@
 
 /* ******************** default callbacks for console space ***************** */
 
-static SpaceLink *console_new(const bContext *C)
+static SpaceLink *console_new(const bContext *UNUSED(C))
 {
 	ARegion *ar;
 	SpaceConsole *sconsole;
@@ -121,7 +121,7 @@
 
 
 /* spacetype; init callback */
-static void console_init(struct wmWindowManager *wm, ScrArea *sa)
+static void console_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa))
 {
 
 }
@@ -162,7 +162,7 @@
 
 /* ************* dropboxes ************* */
 
-static int id_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
+static int id_drop_poll(bContext *C, wmDrag *drag, wmEvent *UNUSED(event))
 {
     SpaceConsole *sc= CTX_wm_space_console(C);
     if(sc->type==CONSOLE_TYPE_PYTHON)
@@ -182,7 +182,7 @@
 	RNA_string_set(drop->ptr, "text", text);
 }
 
-static int path_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
+static int path_drop_poll(bContext *C, wmDrag *drag, wmEvent *UNUSED(event))
 {
     SpaceConsole *sc= CTX_wm_space_console(C);
     if(sc->type==CONSOLE_TYPE_PYTHON)
@@ -361,7 +361,7 @@
 /****************** header region ******************/
 
 /* add handlers, stuff you only do once or on area/region changes */
-static void console_header_area_init(wmWindowManager *wm, ARegion *ar)
+static void console_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar)
 {
 	ED_region_header_init(ar);
 }





More information about the Bf-blender-cvs mailing list