use UNUSED() macro for the console space + minor changes to args.

This commit is contained in:
Campbell Barton
2010-10-13 23:46:42 +00:00
parent be32cf8b32
commit 9971158648
5 changed files with 28 additions and 28 deletions

View File

@@ -133,7 +133,7 @@ typedef struct ConsoleDrawContext {
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 @@ static int console_draw_string(ConsoleDrawContext *cdc, char *str, int str_len,
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 @@ static int console_draw_string(ConsoleDrawContext *cdc, char *str, int str_len,
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 @@ static int console_draw_string(ConsoleDrawContext *cdc, char *str, int str_len,
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));
}

View File

@@ -47,8 +47,8 @@ void console_scrollback_prompt_end(struct SpaceConsole *sc, ConsoleLine *cl_dumm
/* 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);

View File

@@ -194,7 +194,7 @@ static ConsoleLine *console_scrollback_add(const bContext *C, ConsoleLine *from)
}
#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 @@ static ConsoleLine *console_lb_add_str__internal(ListBase *lb, const bContext *C
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 @@ static int history_append_exec(bContext *C, wmOperator *op)
}
}
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 @@ static int scrollback_append_exec(bContext *C, wmOperator *op)
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 @@ void CONSOLE_OT_scrollback_append(wmOperatorType *ot)
}
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 @@ void CONSOLE_OT_copy(wmOperatorType *ot)
/* 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 @@ typedef struct SetConsoleCursor {
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 @@ static void console_modal_select_apply(bContext *C, wmOperator *op, wmEvent *eve
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;

View File

@@ -72,7 +72,7 @@ static int console_report_poll(bContext *C)
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 @@ static int report_replay_exec(bContext *C, wmOperator *op)
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 @@ void CONSOLE_OT_select_pick(wmOperatorType *ot)
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 @@ void CONSOLE_OT_select_border(wmOperatorType *ot)
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 @@ void CONSOLE_OT_report_delete(wmOperatorType *ot)
}
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);

View File

@@ -67,7 +67,7 @@ static void console_update_rect(const bContext *C, ARegion *ar)
/* ******************** 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 @@ static void console_free(SpaceLink *sl)
/* 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 @@ static void console_main_area_init(wmWindowManager *wm, ARegion *ar)
/* ************* 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 @@ static void id_drop_copy(wmDrag *drag, wmDropBox *drop)
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 @@ void console_keymap(struct wmKeyConfig *keyconf)
/****************** 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);
}