diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-27 05:46:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-27 05:46:47 +0400 |
commit | e903701450fd1ffe4d793a60e3c174ee47fe66dd (patch) | |
tree | b3a0f48966c9ada8bbcfc5a524c9bddaae1a7072 /source | |
parent | bf4be941fc412e0af3825a2aa0c420017af4dc9f (diff) |
style cleanup
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/BLI_string_utf8.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/string_utf8.c | 7 | ||||
-rw-r--r-- | source/blender/editors/animation/keyingsets.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_file/file_panels.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/include/sunsky.h | 3 | ||||
-rw-r--r-- | source/blender/render/intern/source/sunsky.c | 3 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 38 |
9 files changed, 31 insertions, 33 deletions
diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h index efb9ac552df..20b56f85b53 100644 --- a/source/blender/blenlib/BLI_string_utf8.h +++ b/source/blender/blenlib/BLI_string_utf8.h @@ -49,7 +49,6 @@ char *BLI_str_prev_char_utf8(const char *p); /* wchar_t functions, copied from blenders own font.c originally */ size_t BLI_wstrlen_utf8(const wchar_t *src); -size_t BLI_strlen_utf8_char(const char *strc); size_t BLI_strlen_utf8(const char *strc); size_t BLI_strlen_range_utf8(const char *start, const char *end); size_t BLI_strncpy_wchar_as_utf8(char *__restrict dst, const wchar_t *__restrict src, const size_t maxcpy); diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 9c7829dbcb6..7f6057dfdc4 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -231,8 +231,9 @@ size_t BLI_wstrlen_utf8(const wchar_t *src) return len; } +/* this is very close to 'BLI_str_utf8_size' functionality, perhaps we should de-duplicate */ /* size of UTF-8 character in bytes */ -size_t BLI_strlen_utf8_char(const char *strc) +static size_t strlen_utf8_char(const char *strc) { if ((*strc & 0xe0) == 0xc0) { if ((strc[1] & 0x80) && (strc[1] & 0x40) == 0x00) @@ -255,7 +256,7 @@ size_t BLI_strlen_utf8(const char *strc) int len; for (len = 0; *strc; len++) - strc += BLI_strlen_utf8_char(strc); + strc += strlen_utf8_char(strc); return len; } @@ -266,7 +267,7 @@ size_t BLI_strlen_range_utf8(const char *start, const char *end) int len; for (len = 0; strc < end; len++) - strc += BLI_strlen_utf8_char(strc); + strc += strlen_utf8_char(strc); return len; } diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 9c3c8de3ed6..95e7dab1ec6 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -457,7 +457,7 @@ void ANIM_OT_keyingset_button_remove(wmOperatorType *ot) /* callbacks */ ot->exec = remove_keyingset_button_exec; - //op->poll= ??? + //op->poll = ??? /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 7d7cef21281..c903fd4186e 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1337,7 +1337,7 @@ void ui_button_text_password_hide(char password_str[UI_MAX_DRAW_STR], uiBut *but BLI_strncpy(but->drawstr, password_str, UI_MAX_DRAW_STR); /* remap cursor positions */ - if(but->pos >= 0) { + if (but->pos >= 0) { but->pos = ui_text_position_from_hidden(but, but->pos); but->selsta = ui_text_position_from_hidden(but, but->selsta); but->selend = ui_text_position_from_hidden(but, but->selend); @@ -1348,7 +1348,7 @@ void ui_button_text_password_hide(char password_str[UI_MAX_DRAW_STR], uiBut *but int i, len = BLI_strlen_utf8(but->drawstr); /* remap cursor positions */ - if(but->pos >= 0) { + if (but->pos >= 0) { but->pos = ui_text_position_to_hidden(but, but->pos); but->selsta = ui_text_position_to_hidden(but, but->selsta); but->selend = ui_text_position_to_hidden(but, but->selend); diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index fb5210380b3..a159c88221e 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -203,7 +203,7 @@ static void file_panel_operator(const bContext *C, Panel *pa) { SpaceFile *sfile = CTX_wm_space_file(C); wmOperator *op = sfile->op; - // int empty= 1, flag; + // int empty = 1, flag; uiBlockSetFunc(uiLayoutGetBlock(pa->layout), file_draw_check_cb, NULL, NULL); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index f25b52416dc..24479663456 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -420,7 +420,7 @@ static short apply_targetless_ik(Object *ob) float rmat[4][4] /*, tmat[4][4], imat[4][4]*/; /* pose_mat(b) = pose_mat(b-1) * offs_bone * channel * constraint * IK */ - /* we put in channel the entire result of rmat= (channel * constraint * IK) */ + /* we put in channel the entire result of rmat = (channel * constraint * IK) */ /* pose_mat(b) = pose_mat(b-1) * offs_bone * rmat */ /* rmat = pose_mat(b) * inv(pose_mat(b-1) * offs_bone ) */ @@ -4642,7 +4642,7 @@ static void set_trans_object_base_flags(TransInfo *t) /* * if Base selected and has parent selected: - * base->flag= BA_WAS_SEL + * base->flag = BA_WAS_SEL */ Base *base; diff --git a/source/blender/render/intern/include/sunsky.h b/source/blender/render/intern/include/sunsky.h index 04aff810bbb..60fa8aa51ba 100644 --- a/source/blender/render/intern/include/sunsky.h +++ b/source/blender/render/intern/include/sunsky.h @@ -43,8 +43,7 @@ typedef struct SunSky { float perez_Y[5], perez_x[5], perez_y[5]; - /* suggested by glome in - * http://projects.blender.org/tracker/?func=detail&atid=127&aid=8063&group_id=9*/ + /* suggested by glome in patch [#8063] */ float horizon_brightness; float spread; float sun_brightness; diff --git a/source/blender/render/intern/source/sunsky.c b/source/blender/render/intern/source/sunsky.c index 4f57a046d68..e4a42fcd675 100644 --- a/source/blender/render/intern/source/sunsky.c +++ b/source/blender/render/intern/source/sunsky.c @@ -217,8 +217,7 @@ void InitSunSky(struct SunSky *sunsky, float turb, const float toSun[3], float h sunsky->perez_y[3] = -0.04405f * T - 1.65369f; sunsky->perez_y[4] = -0.01092f * T + 0.05291f; - /* suggested by glome in - * http://projects.blender.org/tracker/?func=detail&atid=127&aid=8063&group_id=9*/ + /* suggested by glome in patch [#8063] */ sunsky->perez_Y[0] *= sunsky->horizon_brightness; sunsky->perez_x[0] *= sunsky->horizon_brightness; sunsky->perez_y[0] *= sunsky->horizon_brightness; diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index be26400c10c..391c03b88fa 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1866,7 +1866,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) if (win && win->eventstate->prevtype == event->type) { - if(event->val == KM_RELEASE && win->eventstate->prevval == KM_PRESS) { + if (event->val == KM_RELEASE && win->eventstate->prevval == KM_PRESS) { event->val = KM_CLICK; action |= wm_handlers_do_intern(C, event, handlers); @@ -1875,7 +1875,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) event->val = KM_RELEASE; } } - else if(event->val == KM_DBL_CLICK) { + else if (event->val == KM_DBL_CLICK) { event->val = KM_PRESS; action |= wm_handlers_do_intern(C, event, handlers); @@ -2787,8 +2787,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U event.type = MIDDLEMOUSE; /* copy to event state */ - evt->val= event.val; - evt->type= event.type; + evt->val = event.val; + evt->type = event.type; if (win->active == 0) { int cx, cy; @@ -2803,8 +2803,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U /* double click test */ if (event.type == evt->prevtype && event.val == KM_PRESS) { if ((ABS(event.x - evt->prevclickx)) <= 2 && - (ABS(event.y - evt->prevclicky)) <= 2 && - ((PIL_check_seconds_timer() - evt->prevclicktime) * 1000 < U.dbl_click_time)) + (ABS(event.y - evt->prevclicky)) <= 2 && + ((PIL_check_seconds_timer() - evt->prevclicktime) * 1000 < U.dbl_click_time)) { event.val = KM_DBL_CLICK; } @@ -2846,8 +2846,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U event.val = (type == GHOST_kEventKeyDown) ? KM_PRESS : KM_RELEASE; /* copy to event state */ - evt->val= event.val; - evt->type= event.type; + evt->val = event.val; + evt->type = event.type; /* exclude arrow keys, esc, etc from text input */ if (type == GHOST_kEventKeyUp) { @@ -2877,11 +2877,11 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U /* double click test */ if (event.type == evt->prevtype && event.val == KM_PRESS) { if ((ABS(event.x - evt->prevclickx)) <= 2 && - (ABS(event.y - evt->prevclicky)) <= 2 && - ((PIL_check_seconds_timer() - evt->prevclicktime) * 1000 < U.dbl_click_time)) + (ABS(event.y - evt->prevclicky)) <= 2 && + ((PIL_check_seconds_timer() - evt->prevclicktime) * 1000 < U.dbl_click_time)) { // printf("double click\n"); - evt->val= event.val = KM_DBL_CLICK; + evt->val = event.val = KM_DBL_CLICK; } } @@ -2893,23 +2893,23 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U switch (event.type) { case LEFTSHIFTKEY: case RIGHTSHIFTKEY: event.shift = evt->shift = (event.val == KM_PRESS) ? - ((evt->ctrl || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) : - FALSE; + ((evt->ctrl || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) : + FALSE; break; case LEFTCTRLKEY: case RIGHTCTRLKEY: event.ctrl = evt->ctrl = (event.val == KM_PRESS) ? - ((evt->shift || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) : - FALSE; + ((evt->shift || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) : + FALSE; break; case LEFTALTKEY: case RIGHTALTKEY: event.alt = evt->alt = (event.val == KM_PRESS) ? - ((evt->ctrl || evt->shift || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) : - FALSE; + ((evt->ctrl || evt->shift || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) : + FALSE; break; case OSKEY: event.oskey = evt->oskey = (event.val == KM_PRESS) ? - ((evt->ctrl || evt->alt || evt->shift) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) : - FALSE; + ((evt->ctrl || evt->alt || evt->shift) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) : + FALSE; break; default: if (event.val == KM_PRESS && event.keymodifier == 0) |