From a99022e22dd8876cec76aa3dd5b738efa48af9ec Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 7 Feb 2023 14:17:01 +1100 Subject: [PATCH] Cleanup: spelling in comments --- intern/cycles/device/device.h | 6 +-- intern/cycles/device/metal/util.mm | 2 +- intern/cycles/util/math_fast.h | 45 +++++++++---------- intern/ghost/intern/GHOST_SystemWin32.h | 12 ++--- intern/ghost/intern/GHOST_SystemX11.cpp | 4 +- intern/mikktspace/mikk_util.hh | 6 +-- .../internal/evaluator/eval_output.h | 2 +- source/blender/blenkernel/intern/displist.cc | 2 +- .../blender/blenkernel/intern/pbvh_bmesh.cc | 6 +-- .../sculpt_paint/sculpt_filter_color.c | 2 +- 10 files changed, 43 insertions(+), 44 deletions(-) diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h index 370ec8b0638..a8b5e0842f4 100644 --- a/intern/cycles/device/device.h +++ b/intern/cycles/device/device.h @@ -371,7 +371,7 @@ class GPUDevice : public Device { size_t preferred_working_headroom = 0); virtual void move_textures_to_host(size_t size, bool for_texture); - /* Allocation, deallocation and copy functions, with coresponding + /* Allocation, deallocation and copy functions, with corresponding * support of device/host allocations. */ virtual GPUDevice::Mem *generic_alloc(device_memory &mem, size_t pitch_padding = 0); virtual void generic_free(device_memory &mem); @@ -388,9 +388,9 @@ class GPUDevice : public Device { virtual void free_host(void *shared_pointer) = 0; - /* This function should return device pointer coresponding to shared pointer, which + /* This function should return device pointer corresponding to shared pointer, which * is host buffer, allocated in `alloc_host`. The function should `true`, if such - * address transformation is possible and `false` overwise */ + * address transformation is possible and `false` otherwise. */ virtual bool transform_host_pointer(void *&device_pointer, void *&shared_pointer) = 0; virtual void copy_host_to_device(void *device_pointer, void *host_pointer, size_t size) = 0; diff --git a/intern/cycles/device/metal/util.mm b/intern/cycles/device/metal/util.mm index 03afe67628e..df4e146f759 100644 --- a/intern/cycles/device/metal/util.mm +++ b/intern/cycles/device/metal/util.mm @@ -103,7 +103,7 @@ vector> const &MetalInfo::get_usable_devices() } /* If the system has both an AMD GPU (discrete) and an Intel one (integrated), prefer the AMD - * one. This can be overriden with CYCLES_METAL_FORCE_INTEL. */ + * one. This can be overridden with CYCLES_METAL_FORCE_INTEL. */ bool has_usable_amd_gpu = false; if (@available(macos 12.3, *)) { for (id device in MTLCopyAllDevices()) { diff --git a/intern/cycles/util/math_fast.h b/intern/cycles/util/math_fast.h index f7576668151..c7d44739af9 100644 --- a/intern/cycles/util/math_fast.h +++ b/intern/cycles/util/math_fast.h @@ -74,7 +74,7 @@ ccl_device float fast_sinf(float x) * * Results on: [-2pi,2pi]. * - * Examined 2173837240 values of sin: 0.00662760244 avg ulp diff, 2 max ulp, + * Examined 2173837240 values of sin: 0.00662760244 avg ULP diff, 2 max ULP, * 1.19209e-07 max error */ int q = fast_rint(x * M_1_PI_F); @@ -256,11 +256,11 @@ ccl_device float fast_acosf(float x) /* clamp and crush denormals. */ const float m = (f < 1.0f) ? 1.0f - (1.0f - f) : 1.0f; /* Based on http://www.pouet.net/topic.php?which=9132&page=2 - * 85% accurate (ulp 0) + * 85% accurate (ULP 0) * Examined 2130706434 values of acos: - * 15.2000597 avg ulp diff, 4492 max ulp, 4.51803e-05 max error // without "denormal crush" + * 15.2000597 avg ULP diff, 4492 max ULP, 4.51803e-05 max error // without "denormal crush" * Examined 2130706434 values of acos: - * 15.2007108 avg ulp diff, 4492 max ulp, 4.51803e-05 max error // with "denormal crush" + * 15.2007108 avg ULP diff, 4492 max ULP, 4.51803e-05 max error // with "denormal crush" */ const float a = sqrtf(1.0f - m) * (1.5707963267f + m * (-0.213300989f + m * (0.077980478f + m * -0.02164095f))); @@ -270,9 +270,8 @@ ccl_device float fast_acosf(float x) ccl_device float fast_asinf(float x) { /* Based on acosf approximation above. - * Max error is 4.51133e-05 (ulps are higher because we are consistently off - * by a little amount). - */ + * Max error is 4.51133e-05 (ULPS are higher because we are consistently off + * by a little amount). */ const float f = fabsf(x); /* Clamp and crush denormals. */ const float m = (f < 1.0f) ? 1.0f - (1.0f - f) : 1.0f; @@ -290,9 +289,9 @@ ccl_device float fast_atanf(float x) const float t = s * s; /* http://mathforum.org/library/drmath/view/62672.html * Examined 4278190080 values of atan: - * 2.36864877 avg ulp diff, 302 max ulp, 6.55651e-06 max error // (with denormals) + * 2.36864877 avg ULP diff, 302 max ULP, 6.55651e-06 max error // (with denormals) * Examined 4278190080 values of atan: - * 171160502 avg ulp diff, 855638016 max ulp, 6.55651e-06 max error // (crush denormals) + * 171160502 avg ULP diff, 855638016 max ULP, 6.55651e-06 max error // (crush denormals) */ float r = s * madd(0.43157974f, t, 1.0f) / madd(madd(0.05831938f, t, 0.76443945f), t, 1.0f); if (a > 1.0f) { @@ -343,8 +342,8 @@ ccl_device float fast_log2f(float x) int exponent = (int)(bits >> 23) - 127; float f = __uint_as_float((bits & 0x007FFFFF) | 0x3f800000) - 1.0f; /* Examined 2130706432 values of log2 on [1.17549435e-38,3.40282347e+38]: - * 0.0797524457 avg ulp diff, 3713596 max ulp, 7.62939e-06 max error. - * ulp histogram: + * 0.0797524457 avg ULP diff, 3713596 max ULP, 7.62939e-06 max error. + * ULP histogram: * 0 = 97.46% * 1 = 2.29% * 2 = 0.11% @@ -363,7 +362,7 @@ ccl_device float fast_log2f(float x) ccl_device_inline float fast_logf(float x) { /* Examined 2130706432 values of logf on [1.17549435e-38,3.40282347e+38]: - * 0.313865375 avg ulp diff, 5148137 max ulp, 7.62939e-06 max error. + * 0.313865375 avg ULP diff, 5148137 max ULP, 7.62939e-06 max error. */ return fast_log2f(x) * M_LN2_F; } @@ -371,7 +370,7 @@ ccl_device_inline float fast_logf(float x) ccl_device_inline float fast_log10(float x) { /* Examined 2130706432 values of log10f on [1.17549435e-38,3.40282347e+38]: - * 0.631237033 avg ulp diff, 4471615 max ulp, 3.8147e-06 max error. + * 0.631237033 avg ULP diff, 4471615 max ULP, 3.8147e-06 max error. */ return fast_log2f(x) * M_LN2_F / M_LN10_F; } @@ -392,12 +391,12 @@ ccl_device float fast_exp2f(float x) /* Range reduction. */ int m = (int)x; x -= m; - x = 1.0f - (1.0f - x); /* Crush denormals (does not affect max ulps!). */ + x = 1.0f - (1.0f - x); /* Crush denormals (does not affect max ULPS!). */ /* 5th degree polynomial generated with sollya - * Examined 2247622658 values of exp2 on [-126,126]: 2.75764912 avg ulp diff, - * 232 max ulp. + * Examined 2247622658 values of exp2 on [-126,126]: 2.75764912 avg ULP diff, + * 232 max ULP. * - * ulp histogram: + * ULP histogram: * 0 = 87.81% * 1 = 4.18% */ @@ -415,7 +414,7 @@ ccl_device float fast_exp2f(float x) ccl_device_inline float fast_expf(float x) { /* Examined 2237485550 values of exp on [-87.3300018,87.3300018]: - * 2.6666452 avg ulp diff, 230 max ulp. + * 2.6666452 avg ULP diff, 230 max ULP. */ return fast_exp2f(x / M_LN2_F); } @@ -454,7 +453,7 @@ ccl_device_inline float4 fast_expf4(float4 x) ccl_device_inline float fast_exp10(float x) { /* Examined 2217701018 values of exp10 on [-37.9290009,37.9290009]: - * 2.71732409 avg ulp diff, 232 max ulp. + * 2.71732409 avg ULP diff, 232 max ULP. */ return fast_exp2f(x * M_LN10_F / M_LN2_F); } @@ -475,7 +474,7 @@ ccl_device float fast_sinhf(float x) float a = fabsf(x); if (a > 1.0f) { /* Examined 53389559 values of sinh on [1,87.3300018]: - * 33.6886442 avg ulp diff, 178 max ulp. */ + * 33.6886442 avg ULP diff, 178 max ULP. */ float e = fast_expf(a); return copysignf(0.5f * e - 0.5f / e, x); } @@ -495,7 +494,7 @@ ccl_device float fast_sinhf(float x) ccl_device_inline float fast_coshf(float x) { /* Examined 2237485550 values of cosh on [-87.3300018,87.3300018]: - * 1.78256726 avg ulp diff, 178 max ulp. + * 1.78256726 avg ULP diff, 178 max ULP. */ float e = fast_expf(fabsf(x)); return 0.5f * e + 0.5f / e; @@ -506,7 +505,7 @@ ccl_device_inline float fast_tanhf(float x) /* Examined 4278190080 values of tanh on [-3.40282347e+38,3.40282347e+38]: * 3.12924e-06 max error. */ - /* NOTE: ulp error is high because of sub-optimal handling around the origin. */ + /* NOTE: ULP error is high because of sub-optimal handling around the origin. */ float e = fast_expf(2.0f * fabsf(x)); return copysignf(1.0f - 2.0f / (1.0f + e), x); } @@ -579,7 +578,7 @@ ccl_device_inline float fast_erfcf(float x) { /* Examined 2164260866 values of erfcf on [-4,4]: 1.90735e-06 max error. * - * ulp histogram: + * ULP histogram: * * 0 = 80.30% */ diff --git a/intern/ghost/intern/GHOST_SystemWin32.h b/intern/ghost/intern/GHOST_SystemWin32.h index b9263219e0f..48443d56dc2 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.h +++ b/intern/ghost/intern/GHOST_SystemWin32.h @@ -282,7 +282,7 @@ class GHOST_SystemWin32 : public GHOST_System { GHOST_TSuccess exit(); /** - * Converts raw WIN32 key codes from the wndproc to GHOST keys. + * Converts raw WIN32 key codes from the `wndproc` to GHOST keys. * \param vKey: The virtual key from #hardKey. * \param ScanCode: The ScanCode of pressed key (similar to PS/2 Set 1). * \param extend: Flag if key is not primly (left or right). @@ -291,7 +291,7 @@ class GHOST_SystemWin32 : public GHOST_System { GHOST_TKey convertKey(short vKey, short ScanCode, short extend) const; /** - * Catches raw WIN32 key codes from WM_INPUT in the wndproc. + * Catches raw WIN32 key codes from WM_INPUT in the `wndproc`. * \param raw: RawInput structure with detailed info about the key event. * \param r_key_down: Set true when the key is pressed, otherwise false. * \return The GHOST key (GHOST_kKeyUnknown if no match). @@ -319,8 +319,8 @@ class GHOST_SystemWin32 : public GHOST_System { * Creates tablet events from pointer events. * \param type: The type of pointer event. * \param window: The window receiving the event (the active window). - * \param wParam: The wParam from the wndproc. - * \param lParam: The lParam from the wndproc. + * \param wParam: The wParam from the `wndproc`. + * \param lParam: The lParam from the `wndproc`. * \param eventhandled: True if the method handled the event. */ static void processPointerEvent( @@ -337,8 +337,8 @@ class GHOST_SystemWin32 : public GHOST_System { /** * Handles a mouse wheel event. * \param window: The window receiving the event (the active window). - * \param wParam: The wParam from the wndproc. - * \param lParam: The lParam from the wndproc. + * \param wParam: The wParam from the `wndproc`. + * \param lParam: The lParam from the `wndproc`. */ static void processWheelEvent(GHOST_WindowWin32 *window, WPARAM wParam, LPARAM lParam); diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 3122a7ce562..de3284381a4 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -2015,8 +2015,8 @@ void GHOST_SystemX11::getClipboard_xcout( return; } - /* if it's not incr, and not format == 8, then there's - * nothing in the selection (that xclip understands, anyway) */ + /* If it's not INCR, and not `format == 8`, then there's + * nothing in the selection (that `xclip` understands, anyway). */ if (pty_format != 8) { *context = XCLIB_XCOUT_NONE; diff --git a/intern/mikktspace/mikk_util.hh b/intern/mikktspace/mikk_util.hh index 4064d2af617..c848fcada4f 100644 --- a/intern/mikktspace/mikk_util.hh +++ b/intern/mikktspace/mikk_util.hh @@ -40,11 +40,11 @@ inline float fast_acosf(float x) /* clamp and crush denormals. */ const float m = (f < 1.0f) ? 1.0f - (1.0f - f) : 1.0f; /* Based on http://www.pouet.net/topic.php?which=9132&page=2 - * 85% accurate (ulp 0) + * 85% accurate (ULP 0) * Examined 2130706434 values of acos: - * 15.2000597 avg ulp diff, 4492 max ulp, 4.51803e-05 max error // without "denormal crush" + * 15.2000597 avg ULP diff, 4492 max ULP, 4.51803e-05 max error // without "denormal crush" * Examined 2130706434 values of acos: - * 15.2007108 avg ulp diff, 4492 max ulp, 4.51803e-05 max error // with "denormal crush" + * 15.2007108 avg ULP diff, 4492 max ULP, 4.51803e-05 max error // with "denormal crush" */ const float a = sqrtf(1.0f - m) * (1.5707963267f + m * (-0.213300989f + m * (0.077980478f + m * -0.02164095f))); diff --git a/intern/opensubdiv/internal/evaluator/eval_output.h b/intern/opensubdiv/internal/evaluator/eval_output.h index e8480e8d816..7c1d263a430 100644 --- a/intern/opensubdiv/internal/evaluator/eval_output.h +++ b/intern/opensubdiv/internal/evaluator/eval_output.h @@ -89,7 +89,7 @@ class EvalOutputAPI::EvalOutput { // The following interfaces are dependant on the actual evaluator type (CPU, OpenGL, etc.) which // have slightly different APIs to access patch arrays, as well as different types for their // data structure. They need to be overridden in the specific instances of the EvalOutput derived - // classes if needed, while the interfaces above are overriden through VolatileEvalOutput. + // classes if needed, while the interfaces above are overridden through VolatileEvalOutput. virtual void fillPatchArraysBuffer(OpenSubdiv_Buffer * /*patch_arrays_buffer*/) { diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc index e51a2c3d85c..745db5e7fe5 100644 --- a/source/blender/blenkernel/intern/displist.cc +++ b/source/blender/blenkernel/intern/displist.cc @@ -1204,7 +1204,7 @@ static GeometrySet evaluate_curve_type_object(Depsgraph *depsgraph, } LISTBASE_FOREACH (DispList *, dlb, &dlbev) { - /* for each part of the bevel use a separate displblock */ + /* For each part of the bevel use a separate display-block. */ DispList *dl = MEM_cnew(__func__); dl->verts = data = (float *)MEM_mallocN(sizeof(float[3]) * dlb->nr * steps, __func__); BLI_addtail(r_dispbase, dl); diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.cc b/source/blender/blenkernel/intern/pbvh_bmesh.cc index ec09f254ff4..fcccfc384fa 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.cc +++ b/source/blender/blenkernel/intern/pbvh_bmesh.cc @@ -736,7 +736,7 @@ struct EdgeQueueContext { int cd_face_node_offset; }; -/* only tag'd edges are in the queue */ +/* Only tagged edges are in the queue. */ #ifdef USE_EDGEQUEUE_TAG # define EDGE_QUEUE_TEST(e) (BM_elem_flag_test((CHECK_TYPE_INLINE(e, BMEdge *), e), BM_ELEM_TAG)) # define EDGE_QUEUE_ENABLE(e) \ @@ -1416,8 +1416,8 @@ static void pbvh_bmesh_collapse_edge(PBVH *pbvh, add_v3_v3(v_conn->no, v_del->no); normalize_v3(v_conn->no); - /* update boundboxes attached to the connected vertex - * note that we can often get-away without this but causes T48779 */ + /* Update bounding boxes attached to the connected vertex. + * Note that we can often get-away without this but causes T48779. */ BM_LOOPS_OF_VERT_ITER_BEGIN (l, v_conn) { PBVHNode *f_node = pbvh_bmesh_node_from_face(pbvh, l->f); f_node->flag |= PBVH_UpdateDrawBuffers | PBVH_UpdateNormals | PBVH_UpdateBB; diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_color.c b/source/blender/editors/sculpt_paint/sculpt_filter_color.c index e222e0d917f..0c0194da4e2 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_color.c +++ b/source/blender/editors/sculpt_paint/sculpt_filter_color.c @@ -321,7 +321,7 @@ static int sculpt_color_filter_invoke(bContext *C, wmOperator *op, const wmEvent const bool use_automasking = SCULPT_is_automasking_enabled(sd, ss, NULL); if (use_automasking) { - /* Increment stroke id for automasking system. */ + /* Increment stroke id for auto-masking system. */ SCULPT_stroke_id_next(ob); /* Update the active face set manually as the paint cursor is not enabled when using the Mesh