From 1b0dd5a2150c2207768ba74c1a25b842f3d4ece1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 7 Sep 2019 21:08:20 +1000 Subject: Cleanup: style, spelling --- source/blender/blendthumb/src/BlenderThumb.cpp | 24 ++++++++++++++-------- source/blender/blenkernel/intern/shrinkwrap.c | 2 +- .../blender/blenloader/intern/versioning_cycles.c | 2 +- .../draw/engines/eevee/eevee_shadows_cube.c | 14 +++++++------ source/blender/draw/engines/eevee/eevee_volumes.c | 2 +- source/blender/editors/sculpt_paint/paint_cursor.c | 9 +++++--- .../transform/transform_convert_sequencer.c | 2 +- source/blender/imbuf/intern/colormanagement.c | 3 +-- source/blender/makesdna/DNA_screen_types.h | 12 ++++++----- source/blender/render/intern/source/pipeline.c | 2 +- .../blender/windowmanager/intern/wm_event_system.c | 2 +- source/blender/windowmanager/intern/wm_files.c | 10 ++++----- source/blender/windowmanager/intern/wm_init_exit.c | 4 ++-- 13 files changed, 51 insertions(+), 37 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blendthumb/src/BlenderThumb.cpp b/source/blender/blendthumb/src/BlenderThumb.cpp index 94dae437260..bfb13d98f45 100644 --- a/source/blender/blendthumb/src/BlenderThumb.cpp +++ b/source/blender/blendthumb/src/BlenderThumb.cpp @@ -174,11 +174,13 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE char version[4]; version[3] = '\0'; _pStream->Read(&version, 3, &BytesRead); - if (BytesRead != 3) + if (BytesRead != 3) { return E_UNEXPECTED; + } int iVersion = atoi(version); - if (iVersion < 250) + if (iVersion < 250) { return S_FALSE; + } // 32 or 64 bit blend? SeekPos.QuadPart = 7; @@ -208,8 +210,9 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE continue; } } - else + else { break; // eof + } // Found the block SeekPos.QuadPart = BlockOffset + HeaderSize; @@ -224,8 +227,9 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE char *pRGBA = new char[BlockSize]; _pStream->Read(pRGBA, BlockSize, &BytesRead); - if (BytesRead != (ULONG)BlockSize) + if (BytesRead != (ULONG)BlockSize) { return E_UNEXPECTED; + } // Convert to BGRA for Windows for (int i = 0; i < BlockSize; i += 4) { @@ -244,16 +248,18 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE if (0 != memcpy_s(&FlippedImage[(height - i - 1) * LineSize], LineSize, &pRGBA[i * LineSize], - LineSize)) + LineSize)) { return E_UNEXPECTED; + } } delete[] pRGBA; pRGBA = FlippedImage; // Create image *phbmp = CreateBitmap(width, height, 1, 32, pRGBA); - if (!*phbmp) + if (!*phbmp) { return E_FAIL; + } *pdwAlpha = WTSAT_ARGB; // it's actually BGRA, not sure why this works // Scale down if required @@ -297,16 +303,18 @@ IFACEMETHODIMP CBlendThumb::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE DeleteObject(*phbmp); *phbmp = ResizedHBmp; } - else + else { DeleteObject(ResizedHBmp); + } pIScaler->Release(); } WICBmp->Release(); pImgFac->Release(); } - else + else { hr = S_OK; + } break; } return hr; diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 9b9fd33f52d..014a2c6d6ac 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -1408,7 +1408,7 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob_target = DEG_get_evaluated_object(ctx->depsgraph, smd->target); calc.target = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob_target, false); - /* TODO there might be several "bugs" on non-uniform scales matrixs + /* TODO there might be several "bugs" with non-uniform scales matrices * because it will no longer be nearest surface, not sphere projection * because space has been deformed */ BLI_SPACE_TRANSFORM_SETUP(&calc.local2target, ob, ob_target); diff --git a/source/blender/blenloader/intern/versioning_cycles.c b/source/blender/blenloader/intern/versioning_cycles.c index 52be5b2ce74..1abf099b4c2 100644 --- a/source/blender/blenloader/intern/versioning_cycles.c +++ b/source/blender/blenloader/intern/versioning_cycles.c @@ -788,7 +788,7 @@ static void update_noise_node_dimensions(bNodeTree *ntree) * Since the RNA paths of the properties changed, we also have to update the * rna_path of the FCurves if they exist. To do that, we loop over FCurves * and check if they control a property of the node, if they do, we update - * the path to be that of the corrsponding socket in the node or the added + * the path to be that of the corresponding socket in the node or the added * minimum/maximum node. * */ diff --git a/source/blender/draw/engines/eevee/eevee_shadows_cube.c b/source/blender/draw/engines/eevee/eevee_shadows_cube.c index b10c206703a..a355e7e0792 100644 --- a/source/blender/draw/engines/eevee/eevee_shadows_cube.c +++ b/source/blender/draw/engines/eevee/eevee_shadows_cube.c @@ -116,12 +116,12 @@ bool EEVEE_shadows_cube_setup(EEVEE_LightsInfo *linfo, const EEVEE_Light *evli, /** * Anti-Aliasing jitter: Add random rotation. * - * The 2.0 factor is because texel angular size is not even across the cubemap, + * The 2.0 factor is because texel angular size is not even across the cube-map, * so we make the rotation range a bit bigger. * This will not blur the shadow even if the spread is too big since we are just - * rotating the shadow cubemap. + * rotating the shadow cube-map. * Note that this may be a rough approximation an may not converge to a perfectly - * smooth shadow (because sample distribution is quite non-uniform) but is enought + * smooth shadow (because sample distribution is quite non-uniform) but is enough * in practice. **/ /* NOTE: this has implication for spotlight rendering optimization @@ -202,11 +202,13 @@ void EEVEE_shadows_draw_cubemap(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, for (int j = 0; j < 6; j++) { /* Optimization: Only render the needed faces. */ /* Skip all but -Z face. */ - if (evli->light_type == LA_SPOT && j != 5 && spot_angle_fit_single_face(evli)) + if (evli->light_type == LA_SPOT && j != 5 && spot_angle_fit_single_face(evli)) { continue; + } /* Skip +Z face. */ - if (evli->light_type != LA_LOCAL && j == 4) + if (evli->light_type != LA_LOCAL && j == 4) { continue; + } /* TODO(fclem) some cube sides can be invisible in the main views. Cull them. */ // if (frustum_intersect(g_data->cube_views[j], main_view)) // continue; @@ -220,4 +222,4 @@ void EEVEE_shadows_draw_cubemap(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, } BLI_BITMAP_SET(&linfo->sh_cube_update[0], cube_index, false); -} \ No newline at end of file +} diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c index 8a2576e174d..1ff14f83231 100644 --- a/source/blender/draw/engines/eevee/eevee_volumes.c +++ b/source/blender/draw/engines/eevee/eevee_volumes.c @@ -605,7 +605,7 @@ void EEVEE_volumes_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) if ((effects->enabled_effects & EFFECT_VOLUMETRIC) != 0) { DRW_stats_group_start("Volumetrics"); - /* We sample the shadowmaps using shadow sampler. We need to enable Comparison mode. + /* We sample the shadow-maps using shadow sampler. We need to enable Comparison mode. * TODO(fclem) avoid this by using sampler objects.*/ GPU_texture_bind(sldata->shadow_cube_pool, 0); GPU_texture_compare_mode(sldata->shadow_cube_pool, true); diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 4a552fb3744..d872356a083 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -1121,15 +1121,18 @@ static void cursor_draw_tiling_preview(const uint gpuattr, start[dim] = (bbMin[dim] - orgLoc[dim] - radius) / step[dim]; end[dim] = (bbMax[dim] - orgLoc[dim] + radius) / step[dim]; } - else + else { start[dim] = end[dim] = 0; + } } copy_v3_v3_int(cur, start); for (cur[0] = start[0]; cur[0] <= end[0]; cur[0]++) { for (cur[1] = start[1]; cur[1] <= end[1]; cur[1]++) { for (cur[2] = start[2]; cur[2] <= end[2]; cur[2]++) { - if (!cur[0] && !cur[1] && !cur[2]) - continue; /* skip tile at orgLoc, this was already handled before all others */ + if (!cur[0] && !cur[1] && !cur[2]) { + /* skip tile at orgLoc, this was already handled before all others */ + continue; + } tile_pass++; for (dim = 0; dim < 3; dim++) { location[dim] = cur[dim] * step[dim] + orgLoc[dim]; diff --git a/source/blender/editors/transform/transform_convert_sequencer.c b/source/blender/editors/transform/transform_convert_sequencer.c index 7b79ee7aeb4..86b6ebe3ffa 100644 --- a/source/blender/editors/transform/transform_convert_sequencer.c +++ b/source/blender/editors/transform/transform_convert_sequencer.c @@ -160,7 +160,7 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count /* Meta's can only directly be moved between channels since they * don't have their start and length set directly (children affect that) * since this Meta is nested we don't need any of its data in fact. - * BKE_sequence_calc() will update its settings when run on the toplevel meta */ + * BKE_sequence_calc() will update its settings when run on the top-level meta. */ *flag = 0; *count = 0; *recursive = true; diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index 36af7ab2571..1b911226c6f 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -3961,8 +3961,7 @@ static void update_glsl_display_processor(const ColorManagedViewSettings *view_s /* We're using curve mapping's address as a cache ID, * so we need to make sure re-allocation gives new address here. - * We do this by allocating new curve mapping before freeing ol one. - */ + * We do this by allocating new curve mapping before freeing old one. */ if (use_curve_mapping) { new_curve_mapping = BKE_curvemapping_copy(view_settings->curve_mapping); } diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index aab71c15e44..bf491e2eaea 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -458,16 +458,18 @@ enum { #ifdef DNA_DEPRECATED_ALLOW AREA_TEMP_INFO = (1 << 3), /* versioned to make slot reusable */ #endif - /* update size of regions within the area */ + /** Update size of regions within the area. */ AREA_FLAG_REGION_SIZE_UPDATE = (1 << 3), AREA_FLAG_ACTIVE_TOOL_UPDATE = (1 << 4), // AREA_FLAG_UNUSED_5 = (1 << 5), - /* used to check if we should switch back to prevspace (of a different type) */ + /** Used to check if we should switch back to prevspace (of a different type). */ AREA_FLAG_TEMP_TYPE = (1 << 6), - /* for temporary fullscreens (file browser, image editor render) - * that are opened above user set fullscreens */ + /** + * For temporary full-screens (file browser, image editor render) + * that are opened above user set full-screens. + */ AREA_FLAG_STACKED_FULLSCREEN = (1 << 7), - /* update action zones (even if the mouse is not intersecting them) */ + /** Update action zones (even if the mouse is not intersecting them). */ AREA_FLAG_ACTIONZONES_UPDATE = (1 << 8), }; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index b4d0c2147f2..04fcaf206d4 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1637,7 +1637,7 @@ static void do_render_seq(Render *re) BKE_stamp_info_from_imbuf(rr, ibuf_arr[view_id]); } - if (recurs_depth == 0) { /* with nested scenes, only free on toplevel... */ + if (recurs_depth == 0) { /* With nested scenes, only free on top-level. */ Editing *ed = re->pipeline_scene_eval->ed; if (ed) { BKE_sequencer_free_imbuf(re->pipeline_scene_eval, &ed->seqbase, true); diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 2e3abfd9944..828c337d64d 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2397,7 +2397,7 @@ static int wm_handler_fileselect_do(bContext *C, CTX_wm_window_set(C, ctx_win); // wm_window_close() NULLs. /* Some operators expect a drawable context (for EVT_FILESELECT_EXEC) */ wm_window_make_drawable(wm, ctx_win); - /* Ensure correct cursor positon, otherwise, popups may close immediately after + /* Ensure correct cursor position, otherwise, popups may close immediately after * opening (UI_BLOCK_MOVEMOUSE_QUIT) */ wm_get_cursor_position(ctx_win, &ctx_win->eventstate->x, &ctx_win->eventstate->y); wm->winactive = ctx_win; /* Reports use this... */ diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 2b89426f083..a2e7f7fe935 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -2408,7 +2408,10 @@ void WM_OT_revert_mainfile(wmOperatorType *ot) ot->name = "Revert"; ot->idname = "WM_OT_revert_mainfile"; ot->description = "Reload the saved file"; + ot->invoke = WM_operator_confirm; + ot->exec = wm_revert_mainfile_exec; + ot->poll = wm_revert_mainfile_poll; RNA_def_boolean(ot->srna, "use_scripts", @@ -2416,9 +2419,6 @@ void WM_OT_revert_mainfile(wmOperatorType *ot) "Trusted Source", "Allow .blend file to execute scripts automatically, default available from " "system preferences"); - - ot->exec = wm_revert_mainfile_exec; - ot->poll = wm_revert_mainfile_poll; } /** \} */ @@ -2463,8 +2463,8 @@ void WM_OT_recover_last_session(wmOperatorType *ot) ot->name = "Recover Last Session"; ot->idname = "WM_OT_recover_last_session"; ot->description = "Open the last closed file (\"" BLENDER_QUIT_FILE "\")"; - ot->invoke = WM_operator_confirm; + ot->invoke = WM_operator_confirm; ot->exec = wm_recover_last_session_exec; } @@ -2506,8 +2506,8 @@ void WM_OT_recover_auto_save(wmOperatorType *ot) ot->idname = "WM_OT_recover_auto_save"; ot->description = "Open an automatically saved file to recover it"; - ot->exec = wm_recover_auto_save_exec; ot->invoke = wm_recover_auto_save_invoke; + ot->exec = wm_recover_auto_save_exec; WM_operator_properties_filesel(ot, FILE_TYPE_BLENDER, diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index bdc89f2bf2b..1e3c8a0aedd 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -288,8 +288,8 @@ void WM_init(bContext *C, int argc, const char **argv) const bool use_data = true; const bool use_userdef = true; - /* Studiolights needs to be init before we read the homefile, otherwise the versioning cannot - * find the default studiolight.*/ + /* Studio-lights needs to be init before we read the home-file, + * otherwise the versioning cannot find the default studio-light. */ BKE_studiolight_init(); wm_homefile_read(C, -- cgit v1.2.3