From f1e49038543cf75766f4a220f62cdc6cdbc0e27d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 26 Jun 2021 21:35:18 +1000 Subject: Cleanup: full sentences in comments, improve comment formatting --- intern/cycles/app/cycles_xml.cpp | 14 +++---- intern/cycles/blender/blender_curves.cpp | 2 +- intern/cycles/bvh/bvh_split.cpp | 2 +- intern/cycles/device/opencl/opencl_util.cpp | 2 +- .../kernel/geom/geom_motion_triangle_shader.h | 2 +- intern/cycles/kernel/kernel_shader.h | 2 +- intern/cycles/kernel/kernel_subsurface.h | 2 +- intern/cycles/kernel/osl/osl_shader.cpp | 2 +- .../cycles/kernel/split/kernel_split_data_types.h | 2 +- intern/cycles/kernel/svm/svm_image.h | 2 +- intern/cycles/render/geometry.cpp | 4 +- intern/cycles/render/nodes.cpp | 2 +- intern/ghost/GHOST_ISystemPaths.h | 2 +- intern/ghost/intern/GHOST_System.h | 4 +- intern/ghost/intern/GHOST_SystemCocoa.mm | 43 ++++++++++++---------- intern/ghost/intern/GHOST_SystemWin32.cpp | 4 +- intern/ghost/intern/GHOST_Window.h | 2 +- intern/ghost/intern/GHOST_WindowWin32.cpp | 2 +- intern/ghost/intern/GHOST_WindowX11.cpp | 2 +- intern/guardedalloc/test/simpletest/memtest.c | 2 +- intern/openvdb/openvdb_capi.h | 2 +- 21 files changed, 52 insertions(+), 49 deletions(-) (limited to 'intern') diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp index d2aecf75121..276d850f1b3 100644 --- a/intern/cycles/app/cycles_xml.cpp +++ b/intern/cycles/app/cycles_xml.cpp @@ -51,12 +51,12 @@ CCL_NAMESPACE_BEGIN /* XML reading state */ struct XMLReadState : public XMLReader { - Scene *scene; /* scene pointer */ - Transform tfm; /* current transform state */ - bool smooth; /* smooth normal state */ - Shader *shader; /* current shader */ - string base; /* base path to current file*/ - float dicing_rate; /* current dicing rate */ + Scene *scene; /* Scene pointer. */ + Transform tfm; /* Current transform state. */ + bool smooth; /* Smooth normal state. */ + Shader *shader; /* Current shader. */ + string base; /* Base path to current file. */ + float dicing_rate; /* Current dicing rate. */ XMLReadState() : scene(NULL), smooth(false), shader(NULL), dicing_rate(1.0f) { @@ -385,7 +385,7 @@ static Mesh *xml_add_mesh(Scene *scene, const Transform &tfm) Mesh *mesh = new Mesh(); scene->geometry.push_back(mesh); - /* create object*/ + /* Create object. */ Object *object = new Object(); object->set_geometry(mesh); object->set_tfm(tfm); diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp index 7fe49a6c63b..85d886fd850 100644 --- a/intern/cycles/blender/blender_curves.cpp +++ b/intern/cycles/blender/blender_curves.cpp @@ -533,7 +533,7 @@ void BlenderSync::sync_particle_hair( return; } - /* extract particle hair data - should be combined with connecting to mesh later*/ + /* Extract particle hair data - should be combined with connecting to mesh later. */ ParticleCurveData CData; diff --git a/intern/cycles/bvh/bvh_split.cpp b/intern/cycles/bvh/bvh_split.cpp index 834b07440d8..d4c79253834 100644 --- a/intern/cycles/bvh/bvh_split.cpp +++ b/intern/cycles/bvh/bvh_split.cpp @@ -388,7 +388,7 @@ void BVHSpatialSplit::split_curve_primitive(const Hair *hair, BoundBox &left_bounds, BoundBox &right_bounds) { - /* curve split: NOTE - Currently ignores curve width and needs to be fixed.*/ + /* curve split: NOTE - Currently ignores curve width and needs to be fixed. */ Hair::Curve curve = hair->get_curve(prim_index); const int k0 = curve.first_key + segment_index; const int k1 = k0 + 1; diff --git a/intern/cycles/device/opencl/opencl_util.cpp b/intern/cycles/device/opencl/opencl_util.cpp index be9efcd43ee..3929cf77f15 100644 --- a/intern/cycles/device/opencl/opencl_util.cpp +++ b/intern/cycles/device/opencl/opencl_util.cpp @@ -1186,7 +1186,7 @@ bool OpenCLInfo::get_device_extensions(cl_device_id device_id, { size_t extension_length = 0; cl_int err; - /* Determine the size of the extension string*/ + /* Determine the size of the extension string. */ if ((err = clGetDeviceInfo(device_id, CL_DEVICE_EXTENSIONS, 0, 0, &extension_length)) != CL_SUCCESS) { if (error != NULL) { diff --git a/intern/cycles/kernel/geom/geom_motion_triangle_shader.h b/intern/cycles/kernel/geom/geom_motion_triangle_shader.h index 5333e82b346..7a91f8041f7 100644 --- a/intern/cycles/kernel/geom/geom_motion_triangle_shader.h +++ b/intern/cycles/kernel/geom/geom_motion_triangle_shader.h @@ -66,7 +66,7 @@ ccl_device_noinline void motion_triangle_shader_setup( sd->P = motion_triangle_refine_local(kg, sd, isect, ray, verts); } else -#endif /* __BVH_LOCAL__*/ +#endif /* __BVH_LOCAL__*/ { sd->P = motion_triangle_refine(kg, sd, isect, ray, verts); } diff --git a/intern/cycles/kernel/kernel_shader.h b/intern/cycles/kernel/kernel_shader.h index e6bd99414cc..92b4a9cbf9e 100644 --- a/intern/cycles/kernel/kernel_shader.h +++ b/intern/cycles/kernel/kernel_shader.h @@ -274,7 +274,7 @@ ccl_device_inline void shader_setup_from_sample(KernelGlobals *kg, /* primitive */ sd->object = object; sd->lamp = LAMP_NONE; - /* currently no access to bvh prim index for strand sd->prim*/ + /* Currently no access to bvh prim index for strand sd->prim. */ sd->prim = prim; sd->u = u; sd->v = v; diff --git a/intern/cycles/kernel/kernel_subsurface.h b/intern/cycles/kernel/kernel_subsurface.h index dd922b86722..677504a4045 100644 --- a/intern/cycles/kernel/kernel_subsurface.h +++ b/intern/cycles/kernel/kernel_subsurface.h @@ -409,7 +409,7 @@ ccl_device void subsurface_random_walk_coefficients(const ShaderClosure *sc, ccl_device_forceinline float eval_phase_dwivedi(float v, float phase_log, float cos_theta) { - /* Eq. 9 from [2] using precomputed log((v + 1) / (v - 1))*/ + /* Eq. 9 from [2] using precomputed log((v + 1) / (v - 1)) */ return 1.0f / ((v - cos_theta) * phase_log); } diff --git a/intern/cycles/kernel/osl/osl_shader.cpp b/intern/cycles/kernel/osl/osl_shader.cpp index 8606c459375..389c854c495 100644 --- a/intern/cycles/kernel/osl/osl_shader.cpp +++ b/intern/cycles/kernel/osl/osl_shader.cpp @@ -49,7 +49,7 @@ void OSLShader::thread_init(KernelGlobals *kg, return; } - /* per thread kernel data init*/ + /* Per thread kernel data init. */ kg->osl = osl_globals; OSL::ShadingSystem *ss = kg->osl->ss; diff --git a/intern/cycles/kernel/split/kernel_split_data_types.h b/intern/cycles/kernel/split/kernel_split_data_types.h index ac4a450ca2b..06bdce9947d 100644 --- a/intern/cycles/kernel/split/kernel_split_data_types.h +++ b/intern/cycles/kernel/split/kernel_split_data_types.h @@ -68,7 +68,7 @@ typedef ccl_global struct SplitBranchedState { uint lcg_state; LocalIntersection ss_isect; -# endif /*__SUBSURFACE__ */ +# endif /* __SUBSURFACE__ */ int shared_sample_count; /* number of branched samples shared with other threads */ int original_ray; /* index of original ray when sharing branched samples */ diff --git a/intern/cycles/kernel/svm/svm_image.h b/intern/cycles/kernel/svm/svm_image.h index 742addab611..9348ddabde5 100644 --- a/intern/cycles/kernel/svm/svm_image.h +++ b/intern/cycles/kernel/svm/svm_image.h @@ -182,7 +182,7 @@ ccl_device void svm_node_tex_image_box(KernelGlobals *kg, ShaderData *sd, float } } else { - /* Desperate mode, no valid choice anyway, fallback to one side.*/ + /* Desperate mode, no valid choice anyway, fallback to one side. */ weight.x = 1.0f; } diff --git a/intern/cycles/render/geometry.cpp b/intern/cycles/render/geometry.cpp index ce76658acb6..6d084e82576 100644 --- a/intern/cycles/render/geometry.cpp +++ b/intern/cycles/render/geometry.cpp @@ -676,8 +676,8 @@ void GeometryManager::update_attribute_element_offset(Geometry *geom, Mesh *mesh = static_cast(geom); if (mesh->subdivision_type == Mesh::SUBDIVISION_CATMULL_CLARK && desc.flags & ATTR_SUBDIVIDED) { - /* indices for subdivided attributes are retrieved - * from patch table so no need for correction here*/ + /* Indices for subdivided attributes are retrieved + * from patch table so no need for correction here. */ } else if (element == ATTR_ELEMENT_VERTEX) offset -= mesh->vert_offset; diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index 7ce65a0d1c9..42cba342bf8 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -4374,7 +4374,7 @@ NODE_DEFINE(HairInfoNode) SOCKET_OUT_FLOAT(intercept, "Intercept"); SOCKET_OUT_FLOAT(thickness, "Thickness"); SOCKET_OUT_NORMAL(tangent_normal, "Tangent Normal"); -#if 0 /*output for minimum hair width transparency - deactivated */ +#if 0 /* Output for minimum hair width transparency - deactivated. */ SOCKET_OUT_FLOAT(fade, "Fade"); #endif SOCKET_OUT_FLOAT(index, "Random"); diff --git a/intern/ghost/GHOST_ISystemPaths.h b/intern/ghost/GHOST_ISystemPaths.h index e7ac752d322..74285b7e0ce 100644 --- a/intern/ghost/GHOST_ISystemPaths.h +++ b/intern/ghost/GHOST_ISystemPaths.h @@ -95,7 +95,7 @@ class GHOST_ISystemPaths { virtual void addToSystemRecentFiles(const char *filename) const = 0; private: - /** The one and only system paths*/ + /** The one and only system paths. */ static GHOST_ISystemPaths *m_systemPaths; #ifdef WITH_CXX_GUARDEDALLOC diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h index 279f90b9641..87ba0ae9c8c 100644 --- a/intern/ghost/intern/GHOST_System.h +++ b/intern/ghost/intern/GHOST_System.h @@ -328,8 +328,8 @@ class GHOST_System : public GHOST_ISystem { */ virtual GHOST_TSuccess showMessageBox(const char * /*title*/, const char * /*message*/, - const char * /*help_label */, - const char * /*continue_label */, + const char * /*help_label*/, + const char * /*continue_label*/, const char * /*link*/, GHOST_DialogOptions /*dialog_options*/) const { diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index e0e4438a8b2..97c5652f112 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -86,7 +86,8 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction) { // printf("\nrecvchar %c 0x%x",recvChar,recvChar); switch (rawCode) { - /*Physical keycodes not used due to map changes in int'l keyboards + /* Physical key-codes: (not used due to map changes in int'l keyboards). */ +#if 0 case kVK_ANSI_A: return GHOST_kKeyA; case kVK_ANSI_B: return GHOST_kKeyB; case kVK_ANSI_C: return GHOST_kKeyC; @@ -112,9 +113,9 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction) case kVK_ANSI_W: return GHOST_kKeyW; case kVK_ANSI_X: return GHOST_kKeyX; case kVK_ANSI_Y: return GHOST_kKeyY; - case kVK_ANSI_Z: return GHOST_kKeyZ;*/ - - /* Numbers keys mapped to handle some int'l keyboard (e.g. French)*/ + case kVK_ANSI_Z: return GHOST_kKeyZ; +#endif + /* Numbers keys: mapped to handle some int'l keyboard (e.g. French). */ case kVK_ISO_Section: return GHOST_kKeyUnknown; case kVK_ANSI_1: @@ -244,8 +245,8 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction) return GHOST_kKeyUpPage; case kVK_PageDown: return GHOST_kKeyDownPage; - - /*case kVK_ANSI_Minus: return GHOST_kKeyMinus; +#if 0 /* TODO: why are these commented? */ + case kVK_ANSI_Minus: return GHOST_kKeyMinus; case kVK_ANSI_Equal: return GHOST_kKeyEqual; case kVK_ANSI_Comma: return GHOST_kKeyComma; case kVK_ANSI_Period: return GHOST_kKeyPeriod; @@ -255,15 +256,15 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction) case kVK_ANSI_Backslash: return GHOST_kKeyBackslash; case kVK_ANSI_LeftBracket: return GHOST_kKeyLeftBracket; case kVK_ANSI_RightBracket: return GHOST_kKeyRightBracket; - case kVK_ANSI_Grave: return GHOST_kKeyAccentGrave;*/ - + case kVK_ANSI_Grave: return GHOST_kKeyAccentGrave; +#endif case kVK_VolumeUp: case kVK_VolumeDown: case kVK_Mute: return GHOST_kKeyUnknown; default: { - /* alphanumerical or punctuation key that is remappable in int'l keyboards */ + /* Alphanumerical or punctuation key that is remappable in int'l keyboards. */ if ((recvChar >= 'A') && (recvChar <= 'Z')) { return (GHOST_TKey)(recvChar - 'A' + GHOST_kKeyA); } @@ -271,8 +272,8 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction) return (GHOST_TKey)(recvChar - 'a' + GHOST_kKeyA); } else { - /* Leopard and Snow Leopard 64bit compatible API*/ - CFDataRef uchrHandle; /*the keyboard layout*/ + /* Leopard and Snow Leopard 64bit compatible API. */ + CFDataRef uchrHandle; /* The keyboard layout. */ TISInputSourceRef kbdTISHandle; kbdTISHandle = TISCopyCurrentKeyboardLayoutInputSource(); @@ -280,9 +281,9 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar, UInt16 keyAction) kTISPropertyUnicodeKeyLayoutData); CFRelease(kbdTISHandle); - /*get actual character value of the "remappable" keys in int'l keyboards, - if keyboard layout is not correctly reported (e.g. some non Apple keyboards in Tiger), - then fallback on using the received charactersIgnoringModifiers */ + /* Get actual character value of the "remappable" keys in int'l keyboards, + * if keyboard layout is not correctly reported (e.g. some non Apple keyboards in Tiger), + * then fallback on using the received #charactersIgnoringModifiers. */ if (uchrHandle) { UInt32 deadKeyState = 0; UniCharCount actualStrLength = 0; @@ -433,8 +434,10 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG]) // So WM_exit needs to be called directly, as the event loop will never run before termination - (void)applicationWillTerminate:(NSNotification *)aNotification { - /*G.is_break = FALSE; //Let Cocoa perform the termination at the end - WM_exit(C);*/ +#if 0 + G.is_break = false; /* Let Cocoa perform the termination at the end. */ + WM_exit(C); +#endif } - (void)applicationWillBecomeActive:(NSNotification *)aNotification @@ -1215,7 +1218,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType return GHOST_kFailure; } - /*Get the bitmap of the image*/ + /* Get the bitmap of the image. */ enumerator = [[droppedImg representations] objectEnumerator]; while ((representation = [enumerator nextObject])) { if ([representation isKindOfClass:[NSBitmapImageRep class]]) { @@ -1228,7 +1231,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType if (([bitmapImage bitsPerPixel] == 32) && (([bitmapImage bitmapFormat] & 0x5) == 0) && ![bitmapImage isPlanar]) { - /* Try a fast copy if the image is a meshed RGBA 32bit bitmap*/ + /* Try a fast copy if the image is a meshed RGBA 32bit bitmap. */ toIBuf = (GHOST_TUns8 *)ibuf->rect; rasterRGB = (GHOST_TUns8 *)[bitmapImage bitmapData]; for (y = 0; y < imgSize.height; y++) { @@ -1258,7 +1261,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType colorSpaceName:NSDeviceRGBColorSpace bitmapFormat:(NSBitmapFormat)0 bytesPerRow:4 * imgSize.width - bitsPerPixel:32 /*RGB format padded to 32bits*/]; + bitsPerPixel:32 /* RGB format padded to 32bits. */]; [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext @@ -1305,7 +1308,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType return GHOST_kFailure; } - /*Copy the image to ibuf, flipping it vertically*/ + /* Copy the image to ibuf, flipping it vertically. */ toIBuf = (GHOST_TUns8 *)ibuf->rect; for (y = 0; y < imgSize.height; y++) { for (x = 0; x < imgSize.width; x++) { diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index e9fd771e866..cdfb950a72c 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -1503,7 +1503,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, case WM_SYSKEYDOWN: case WM_KEYUP: case WM_SYSKEYUP: - /* These functions were replaced by WM_INPUT*/ + /* These functions were replaced by #WM_INPUT. */ case WM_CHAR: /* The WM_CHAR message is posted to the window with the keyboard focus when * a WM_KEYDOWN message is translated by the TranslateMessage function. WM_CHAR @@ -1851,7 +1851,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, * to perform any move or size change processing during the WM_WINDOWPOSCHANGED * message without calling DefWindowProc. */ - /* see WM_SIZE comment*/ + /* See #WM_SIZE comment. */ if (window->m_inLiveResize) { system->pushEvent(processWindowEvent(GHOST_kEventWindowMove, window)); system->dispatchEvents(); diff --git a/intern/ghost/intern/GHOST_Window.h b/intern/ghost/intern/GHOST_Window.h index 1f2fed5b823..3542c6f2bcf 100644 --- a/intern/ghost/intern/GHOST_Window.h +++ b/intern/ghost/intern/GHOST_Window.h @@ -365,7 +365,7 @@ class GHOST_Window : public GHOST_IWindow { /** The current grabbed state of the cursor */ GHOST_TGrabCursorMode m_cursorGrab; - /** Grab cursor axis.*/ + /** Grab cursor axis. */ GHOST_TAxisFlag m_cursorGrabAxis; /** Initial grab location. */ diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 0a647c446e7..82b86863125 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -287,7 +287,7 @@ void GHOST_WindowWin32::setTitle(const char *title) std::string GHOST_WindowWin32::getTitle() const { - char buf[s_maxTitleLength]; /*CHANGE + never used yet*/ + char buf[s_maxTitleLength]; /* CHANGE + never used yet. */ ::GetWindowText(m_hWnd, buf, s_maxTitleLength); return std::string(buf); } diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp index 10ef57c3a0a..ea798441adb 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cpp +++ b/intern/ghost/intern/GHOST_WindowX11.cpp @@ -1241,7 +1241,7 @@ GHOST_WindowX11::~GHOST_WindowX11() if (m_valid_setup) { static Atom Primary_atom, Clipboard_atom; Window p_owner, c_owner; - /*Change the owner of the Atoms to None if we are the owner*/ + /* Change the owner of the Atoms to None if we are the owner. */ Primary_atom = XInternAtom(m_display, "PRIMARY", False); Clipboard_atom = XInternAtom(m_display, "CLIPBOARD", False); diff --git a/intern/guardedalloc/test/simpletest/memtest.c b/intern/guardedalloc/test/simpletest/memtest.c index f19ca4c4368..498857de8ea 100644 --- a/intern/guardedalloc/test/simpletest/memtest.c +++ b/intern/guardedalloc/test/simpletest/memtest.c @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) p[i] = MEM_callocN(blocksize, strdup(tagstring)); } - /* now corrupt a few blocks...*/ + /* Now corrupt a few blocks. */ ip = (int *)p[5] - 50; for (i = 0; i < 1000; i++, ip++) *ip = i + 1; diff --git a/intern/openvdb/openvdb_capi.h b/intern/openvdb/openvdb_capi.h index ea963a269fc..98d89c340bf 100644 --- a/intern/openvdb/openvdb_capi.h +++ b/intern/openvdb/openvdb_capi.h @@ -85,7 +85,7 @@ struct OpenVDBRemeshData { int out_tottris; int filter_type; enum OpenVDBLevelSet_FilterType filter_bias; - enum OpenVDBLevelSet_FilterBias filter_width; /* Parameter for gaussian, median, mean*/ + enum OpenVDBLevelSet_FilterBias filter_width; /* Parameter for gaussian, median, mean. */ float voxel_size; float isovalue; -- cgit v1.2.3