From 02f28da187b744b3dea0d253b3d46d91b201a98d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 22 Apr 2018 08:44:23 +0200 Subject: Cleanup: trailing spaces Applied to newly added files in 2.8 --- source/blender/editors/object/object_facemap_ops.c | 90 +++++++++++----------- source/blender/editors/space_topbar/space_topbar.c | 8 +- .../editors/space_view3d/view3d_draw_legacy.c | 46 +++++------ 3 files changed, 72 insertions(+), 72 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/object/object_facemap_ops.c b/source/blender/editors/object/object_facemap_ops.c index a076521b41d..c5882560083 100644 --- a/source/blender/editors/object/object_facemap_ops.c +++ b/source/blender/editors/object/object_facemap_ops.c @@ -4,7 +4,7 @@ * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -18,7 +18,7 @@ * The Original Code is Copyright (C) 2008 Blender Foundation. * All rights reserved. * - * + * * Contributor(s): Blender Foundation * * ***** END GPL LICENSE BLOCK ***** @@ -63,14 +63,14 @@ void ED_object_facemap_face_add(Object *ob, bFaceMap *fmap, int facenum) int fmap_nr; if (GS(((ID *)ob->data)->name) != ID_ME) return; - + /* get the face map number, exit if it can't be found */ fmap_nr = BLI_findindex(&ob->fmaps, fmap); if (fmap_nr != -1) { int *facemap; Mesh *me = ob->data; - + /* if there's is no facemap layer then create one */ if ((facemap = CustomData_get_layer(&me->pdata, CD_FACEMAP)) == NULL) facemap = CustomData_add_layer(&me->pdata, CD_FACEMAP, CD_DEFAULT, NULL, me->totpoly); @@ -85,18 +85,18 @@ void ED_object_facemap_face_remove(Object *ob, bFaceMap *fmap, int facenum) int fmap_nr; if (GS(((ID *)ob->data)->name) != ID_ME) return; - + /* get the face map number, exit if it can't be found */ fmap_nr = BLI_findindex(&ob->fmaps, fmap); if (fmap_nr != -1) { int *facemap; Mesh *me = ob->data; - + /* if there's is no facemap layer then create one */ if ((facemap = CustomData_get_layer(&me->pdata, CD_FACEMAP)) == NULL) return; - + facemap[facenum] = -1; } } @@ -105,19 +105,19 @@ static void object_fmap_swap_edit_mode(Object *ob, int num1, int num2) { if (ob->type == OB_MESH) { Mesh *me = ob->data; - + if (me->edit_btmesh) { BMEditMesh *em = me->edit_btmesh; const int cd_fmap_offset = CustomData_get_offset(&em->bm->pdata, CD_FACEMAP); - + if (cd_fmap_offset != -1) { BMFace *efa; BMIter iter; int *map; - + BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { map = BM_ELEM_CD_GET_VOID_P(efa, cd_fmap_offset); - + if (map) { if (num1 != -1) { if (*map == num1) @@ -136,11 +136,11 @@ static void object_fmap_swap_object_mode(Object *ob, int num1, int num2) { if (ob->type == OB_MESH) { Mesh *me = ob->data; - + if (CustomData_has_layer(&me->pdata, CD_FACEMAP)) { int *map = CustomData_get_layer(&me->pdata, CD_FACEMAP); int i; - + if (map) { for (i = 0; i < me->totpoly; i++) { if (num1 != -1) { @@ -190,7 +190,7 @@ static int face_map_add_exec(bContext *C, wmOperator *UNUSED(op)) DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); - + return OPERATOR_FINISHED; } @@ -200,7 +200,7 @@ void OBJECT_OT_face_map_add(struct wmOperatorType *ot) ot->name = "Add Face Map"; ot->idname = "OBJECT_OT_face_map_add"; ot->description = "Add a new face map to the active object"; - + /* api callbacks */ ot->poll = face_map_supported_poll; ot->exec = face_map_add_exec; @@ -213,7 +213,7 @@ static int face_map_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob = ED_object_context(C); bFaceMap *fmap = BLI_findlink(&ob->fmaps, ob->actfmap - 1); - + if (fmap) { BKE_object_facemap_remove(ob, fmap); DEG_id_tag_update(&ob->id, OB_RECALC_DATA); @@ -229,7 +229,7 @@ void OBJECT_OT_face_map_remove(struct wmOperatorType *ot) ot->name = "Remove Face Map"; ot->idname = "OBJECT_OT_face_map_remove"; ot->description = "Remove a face map from the active object"; - + /* api callbacks */ ot->poll = face_map_supported_poll; ot->exec = face_map_remove_exec; @@ -242,7 +242,7 @@ static int face_map_assign_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob = ED_object_context(C); bFaceMap *fmap = BLI_findlink(&ob->fmaps, ob->actfmap - 1); - + if (fmap) { Mesh *me = ob->data; BMEditMesh *em = me->edit_btmesh; @@ -250,20 +250,20 @@ static int face_map_assign_exec(bContext *C, wmOperator *UNUSED(op)) BMIter iter; int *map; int cd_fmap_offset; - + if (!CustomData_has_layer(&em->bm->pdata, CD_FACEMAP)) BM_data_layer_add(em->bm, &em->bm->pdata, CD_FACEMAP); - + cd_fmap_offset = CustomData_get_offset(&em->bm->pdata, CD_FACEMAP); - + BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { map = BM_ELEM_CD_GET_VOID_P(efa, cd_fmap_offset); - + if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) { *map = ob->actfmap - 1; } } - + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); @@ -277,7 +277,7 @@ void OBJECT_OT_face_map_assign(struct wmOperatorType *ot) ot->name = "Assign Face Map"; ot->idname = "OBJECT_OT_face_map_assign"; ot->description = "Assign faces to a face map"; - + /* api callbacks */ ot->poll = face_map_supported_edit_mode_poll; ot->exec = face_map_assign_exec; @@ -290,7 +290,7 @@ static int face_map_remove_from_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob = ED_object_context(C); bFaceMap *fmap = BLI_findlink(&ob->fmaps, ob->actfmap - 1); - + if (fmap) { Mesh *me = ob->data; BMEditMesh *em = me->edit_btmesh; @@ -299,20 +299,20 @@ static int face_map_remove_from_exec(bContext *C, wmOperator *UNUSED(op)) int *map; int cd_fmap_offset; int mapindex = ob->actfmap - 1; - + if (!CustomData_has_layer(&em->bm->pdata, CD_FACEMAP)) return OPERATOR_CANCELLED; - + cd_fmap_offset = CustomData_get_offset(&em->bm->pdata, CD_FACEMAP); - + BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { map = BM_ELEM_CD_GET_VOID_P(efa, cd_fmap_offset); - + if (BM_elem_flag_test(efa, BM_ELEM_SELECT) && *map == mapindex) { *map = -1; } } - + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); @@ -326,7 +326,7 @@ void OBJECT_OT_face_map_remove_from(struct wmOperatorType *ot) ot->name = "Remove From Face Map"; ot->idname = "OBJECT_OT_face_map_remove_from"; ot->description = "Remove faces from a face map"; - + /* api callbacks */ ot->poll = face_map_supported_edit_mode_poll; ot->exec = face_map_remove_from_exec; @@ -344,15 +344,15 @@ static void fmap_select(Object *ob, bool select) int *map; int cd_fmap_offset; int mapindex = ob->actfmap - 1; - + if (!CustomData_has_layer(&em->bm->pdata, CD_FACEMAP)) BM_data_layer_add(em->bm, &em->bm->pdata, CD_FACEMAP); - + cd_fmap_offset = CustomData_get_offset(&em->bm->pdata, CD_FACEMAP); - + BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { map = BM_ELEM_CD_GET_VOID_P(efa, cd_fmap_offset); - + if (*map == mapindex) { BM_face_select_set(em->bm, efa, select); } @@ -363,10 +363,10 @@ static int face_map_select_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob = ED_object_context(C); bFaceMap *fmap = BLI_findlink(&ob->fmaps, ob->actfmap - 1); - + if (fmap) { fmap_select(ob, true); - + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); @@ -380,7 +380,7 @@ void OBJECT_OT_face_map_select(struct wmOperatorType *ot) ot->name = "Select Face Map Faces"; ot->idname = "OBJECT_OT_face_map_select"; ot->description = "Select faces belonging to a face map"; - + /* api callbacks */ ot->poll = face_map_supported_edit_mode_poll; ot->exec = face_map_select_exec; @@ -393,7 +393,7 @@ static int face_map_deselect_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob = ED_object_context(C); bFaceMap *fmap = BLI_findlink(&ob->fmaps, ob->actfmap - 1); - + if (fmap) { fmap_select(ob, false); @@ -410,7 +410,7 @@ void OBJECT_OT_face_map_deselect(struct wmOperatorType *ot) ot->name = "Deselect Face Map Faces"; ot->idname = "OBJECT_OT_face_map_deselect"; ot->description = "Deselect faces belonging to a face map"; - + /* api callbacks */ ot->poll = face_map_supported_edit_mode_poll; ot->exec = face_map_deselect_exec; @@ -434,7 +434,7 @@ static int face_map_move_exec(bContext *C, wmOperator *op) count = BLI_listbase_count(&ob->fmaps); pos1 = BLI_findindex(&ob->fmaps, fmap); - + if (dir == 1) { /*up*/ void *prev = fmap->prev; @@ -444,7 +444,7 @@ static int face_map_move_exec(bContext *C, wmOperator *op) else { pos2 = count - 1; } - + BLI_remlink(&ob->fmaps, fmap); BLI_insertlinkbefore(&ob->fmaps, prev, fmap); } @@ -457,16 +457,16 @@ static int face_map_move_exec(bContext *C, wmOperator *op) else { pos2 = 0; } - + BLI_remlink(&ob->fmaps, fmap); BLI_insertlinkafter(&ob->fmaps, next, fmap); } /* iterate through mesh and substitute the indices as necessary */ object_facemap_swap(ob, pos2, pos1); - + ob->actfmap = pos2 + 1; - + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_VERTEX_GROUP, ob); diff --git a/source/blender/editors/space_topbar/space_topbar.c b/source/blender/editors/space_topbar/space_topbar.c index 0a6ec0e7aa0..fa39d89091c 100644 --- a/source/blender/editors/space_topbar/space_topbar.c +++ b/source/blender/editors/space_topbar/space_topbar.c @@ -93,14 +93,14 @@ static SpaceLink *topbar_new(const ScrArea *UNUSED(area), const Scene *UNUSED(sc /* not spacelink itself */ static void topbar_free(SpaceLink *UNUSED(sl)) { - + } /* spacetype; init callback */ static void topbar_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) { - + } static SpaceLink *topbar_duplicate(SpaceLink *sl) @@ -136,12 +136,12 @@ static void topbar_main_region_draw(const bContext *C, ARegion *region) static void topbar_operatortypes(void) { - + } static void topbar_keymap(struct wmKeyConfig *UNUSED(keyconf)) { - + } /* add handlers, stuff you only do once or on area/region changes */ diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c index 1ba46453915..eecd185aedf 100644 --- a/source/blender/editors/space_view3d/view3d_draw_legacy.c +++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c @@ -4,7 +4,7 @@ * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -18,7 +18,7 @@ * The Original Code is Copyright (C) 2008 Blender Foundation. * All rights reserved. * - * + * * Contributor(s): Blender Foundation * * ***** END GPL LICENSE BLOCK ***** @@ -208,7 +208,7 @@ static void backdrawview3d( #endif if (v3d->drawtype > OB_WIRE) v3d->zbuf = true; - + /* dithering and AA break color coding, so disable */ glDisable(GL_DITHER); @@ -254,10 +254,10 @@ static void backdrawview3d( glClear(GL_COLOR_BUFFER_BIT); glDisable(GL_DEPTH_TEST); } - + if (rv3d->rflag & RV3D_CLIPPING) ED_view3d_clipping_set(rv3d); - + G.f |= G_BACKBUFSEL; if (obact && ((obact->base_flag & BASE_VISIBLED) != 0)) { @@ -369,7 +369,7 @@ ImBuf *ED_view3d_backbuf_read( } GPU_select_to_index_array(ibuf_clip->rect, size_clip[0] * size_clip[1]); - + if ((clip.xmin == xmin) && (clip.xmax == xmax) && (clip.ymin == ymin) && @@ -411,17 +411,17 @@ unsigned int ED_view3d_backbuf_sample_rect( unsigned index = 0; int rc = 0; - + dirvec[0][0] = 1; dirvec[0][1] = 0; dirvec[1][0] = 0; dirvec[1][1] = -size; dirvec[2][0] = -1; dirvec[2][1] = 0; dirvec[3][0] = 0; dirvec[3][1] = size; - + const unsigned *bufmin = buf->rect; const unsigned *tbuf = buf->rect; const unsigned *bufmax = buf->rect + size * size; tbuf += amount * size + amount; - + for (int nr = 1; nr <= size; nr++) { for (int a = 0; a < 2; a++) { for (int b = 0; b < nr; b++) { @@ -438,9 +438,9 @@ unsigned int ED_view3d_backbuf_sample_rect( index = (*tbuf - min) + 1; goto exit; } - + tbuf += (dirvec[rc][0] + dirvec[rc][1]); - + if (tbuf < bufmin || tbuf >= bufmax) { goto exit; } @@ -802,7 +802,7 @@ void view3d_update_depths_rect(ARegion *ar, ViewDepths *d, rcti *rect) MEM_freeN(d->depths); d->depths = MEM_mallocN(sizeof(float) * d->w * d->h, "View depths Subset"); - + d->damaged = true; } @@ -818,7 +818,7 @@ void view3d_update_depths_rect(ARegion *ar, ViewDepths *d, rcti *rect) void ED_view3d_depth_update(ARegion *ar) { RegionView3D *rv3d = ar->regiondata; - + /* Create storage for, and, if necessary, copy depth buffer */ if (!rv3d->depths) rv3d->depths = MEM_callocN(sizeof(ViewDepths), "ViewDepths"); if (rv3d->depths) { @@ -834,11 +834,11 @@ void ED_view3d_depth_update(ARegion *ar) d->depths = MEM_mallocN(sizeof(float) * d->w * d->h, "View depths"); d->damaged = true; } - + if (d->damaged) { view3d_opengl_read_pixels(ar, 0, 0, d->w, d->h, GL_DEPTH_COMPONENT, GL_FLOAT, d->depths); glGetDoublev(GL_DEPTH_RANGE, d->depth_range); - + d->damaged = false; } } @@ -913,7 +913,7 @@ CustomDataMask ED_view3d_datamask(const Scene *UNUSED(scene), const View3D *v3d) CustomDataMask ED_view3d_screen_datamask(const Scene *scene, const bScreen *screen) { CustomDataMask mask = CD_MASK_BAREMESH; - + /* check if we need tfaces & mcols due to view mode */ for (const ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { if (sa->spacetype == SPACE_VIEW3D) { @@ -973,18 +973,18 @@ void ED_scene_draw_fps(Scene *scene, const rcti *rect) { ScreenFrameRateInfo *fpsi = scene->fps_info; char printable[16]; - + if (!fpsi || !fpsi->lredrawtime || !fpsi->redrawtime) return; - + printable[0] = '\0'; - + #if 0 /* this is too simple, better do an average */ fps = (float)(1.0 / (fpsi->lredrawtime - fpsi->redrawtime)) #else fpsi->redrawtimes_fps[fpsi->redrawtime_index] = (float)(1.0 / (fpsi->lredrawtime - fpsi->redrawtime)); - + float fps = 0.0f; int tot = 0; for (int i = 0; i < REDRAW_FRAME_AVERAGE; i++) { @@ -995,11 +995,11 @@ void ED_scene_draw_fps(Scene *scene, const rcti *rect) } if (tot) { fpsi->redrawtime_index = (fpsi->redrawtime_index + 1) % REDRAW_FRAME_AVERAGE; - + //fpsi->redrawtime_index++; //if (fpsi->redrawtime >= REDRAW_FRAME_AVERAGE) // fpsi->redrawtime = 0; - + fps = fps / tot; } #endif @@ -1043,7 +1043,7 @@ bool ED_view3d_calc_render_border(const Scene *scene, Depsgraph *depsgraph, View use_border = (scene->r.mode & R_BORDER) != 0; else use_border = (v3d->flag2 & V3D_RENDER_BORDER) != 0; - + if (!use_border) return false; -- cgit v1.2.3