style cleanup
authorCampbell Barton <ideasman42@gmail.com>
Sat, 27 Oct 2012 01:46:47 +0000 (01:46 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 27 Oct 2012 01:46:47 +0000 (01:46 +0000)
intern/ghost/test/multitest/EventToBuf.c
intern/raskter/raskter.c
source/blender/blenlib/BLI_string_utf8.h
source/blender/blenlib/intern/string_utf8.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/space_file/file_panels.c
source/blender/editors/transform/transform_conversions.c
source/blender/render/intern/include/sunsky.h
source/blender/render/intern/source/sunsky.c
source/blender/windowmanager/intern/wm_event_system.c

index aba80784a7258fad5959d804de818358ddc1cd50..49255de5e64d4520d1548628d507b9d80471feaa 100644 (file)
@@ -197,15 +197,15 @@ static char *keytype_to_string(GHOST_TKey key)
 
 void event_to_buf(GHOST_EventHandle evt, char buf[128])
 {
-       GHOST_TEventType type= GHOST_GetEventType(evt);
-       double time= (double) ((GHOST_TInt64) GHOST_GetEventTime(evt))/1000;
-       GHOST_WindowHandle win= GHOST_GetEventWindow(evt);
-       void *data= GHOST_GetEventData(evt);
-       char *pos= buf;
+       GHOST_TEventType type = GHOST_GetEventType(evt);
+       double time = (double) ((GHOST_TInt64) GHOST_GetEventTime(evt))/1000;
+       GHOST_WindowHandle win = GHOST_GetEventWindow(evt);
+       void *data = GHOST_GetEventData(evt);
+       char *pos = buf;
 
        pos += sprintf(pos, "event: %6.2f, %16s", time, eventtype_to_string(type));
        if (win) {
-               char *s= GHOST_GetTitle(win);
+               char *s = GHOST_GetTitle(win);
                pos += sprintf(pos, " - win: %s", s);
                free(s);
        }
@@ -215,14 +215,14 @@ void event_to_buf(GHOST_EventHandle evt, char buf[128])
        switch (type) {
                case GHOST_kEventCursorMove:
                {
-                       GHOST_TEventCursorData *cd= data;
+                       GHOST_TEventCursorData *cd = data;
                        pos += sprintf(pos, " - pos: (%d, %d)", cd->x, cd->y);
                        break;
                }
                case GHOST_kEventButtonDown:
                case GHOST_kEventButtonUp:
                {
-                       GHOST_TEventButtonData *bd= data;
+                       GHOST_TEventButtonData *bd = data;
                        pos += sprintf(pos, " - but: %d", bd->button);
                        break;
                }
@@ -230,7 +230,7 @@ void event_to_buf(GHOST_EventHandle evt, char buf[128])
                case GHOST_kEventKeyDown:
                case GHOST_kEventKeyUp:
                {
-                       GHOST_TEventKeyData *kd= data;
+                       GHOST_TEventKeyData *kd = data;
                        pos += sprintf(pos, " - key: %s (%d)", keytype_to_string(kd->key), kd->key);
                        if (kd->ascii) pos+= sprintf(pos, " ascii: '%c' (%d)", kd->ascii, kd->ascii);
                        break;
index c79bcc4a76de1ce708397e9a33b63aeb3221cf2c..211530823241ab75e2dfab0eae5cb33ccbd23d27 100644 (file)
@@ -113,7 +113,7 @@ static void preprocess_all_edges(struct r_FillContext *ctx,
                        ctx->rb.xmin = xbeg;
                }
                if (ybeg >= ctx->rb.ymax) {
-                       ctx->rb.ymax= ybeg;
+                       ctx->rb.ymax = ybeg;
                }
                else if (ybeg <= ctx->rb.ymin) {
                        ctx->rb.ymin=ybeg;
index efb9ac552dfcd726453e32203c548590311bf098..20b56f85b5330ee6610d648b7d4681433955819d 100644 (file)
@@ -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);
index 9c7829dbcb6a1410b1269312c03c092fc4829de9..7f6057dfdc4e02040e9033fcf37fc5070cdc43ca 100644 (file)
@@ -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;
 }
index 9c3c8de3ed66cc9eab8a7cb9f4aaaf4992faa1b8..95e7dab1ec6cbe14b5606dad0b670f4ac0f8448d 100644 (file)
@@ -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;
index 7d7cef21281cead0cab9005ad25b9976322ce5b8..c903fd4186e8fb2e22a6d4c74e1debe6178ef8cd 100644 (file)
@@ -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);
index fb5210380b3cb1bea5459729ecb6135c98bcc307..a159c88221e50e9167b2d7ad7c37f660b06bb0b0 100644 (file)
@@ -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);
 
index f25b52416dc3e0d4630a5057f39a17d4f8919ede..24479663456e1a65617212b97f2a296635b71309 100644 (file)
@@ -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;
 
index 04aff810bbb67570c0553c545896c8eb455bd50a..60fa8aa51ba72c419d7b9f09b6ce18f40d870ea0 100644 (file)
@@ -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;
index 4f57a046d68965a61842343f07ab3d5ccc257891..e4a42fcd6754d30addf994fe78f508e157ef9633 100644 (file)
@@ -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;
index be26400c10cce42d3fe6dc70a8d34bfc267e987e..391c03b88fa4cc68fc315c79ce7c42c469e784f2 100644 (file)
@@ -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)