diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 09:16:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 09:17:13 +0300 |
commit | 108045faa01849115c54190ebed788faf36dcb56 (patch) | |
tree | 64d024b47b0dcb6850108377c55e96917645efe5 | |
parent | 3076d95ba441cd32706a27d18922a30f8fd28b8a (diff) |
ClangFormat: format '#if 0' code in intern/
-rw-r--r-- | intern/cycles/app/cycles_xml.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 5 | ||||
-rw-r--r-- | intern/cycles/blender/blender_shader.cpp | 26 | ||||
-rw-r--r-- | intern/cycles/blender/blender_util.h | 8 | ||||
-rw-r--r-- | intern/cycles/device/device_cuda.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/osl/osl_services.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/shaders/stdosl.h | 47 | ||||
-rw-r--r-- | intern/cycles/render/camera.cpp | 13 | ||||
-rw-r--r-- | intern/cycles/render/nodes.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/util/util_math.h | 4 | ||||
-rw-r--r-- | intern/cycles/util/util_transform.h | 6 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemSDL.cpp | 13 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 5 | ||||
-rw-r--r-- | intern/ghost/test/gears/GHOST_Test.cpp | 14 | ||||
-rw-r--r-- | intern/guardedalloc/MEM_guardedalloc.h | 4 | ||||
-rw-r--r-- | intern/guardedalloc/intern/mallocn_guarded_impl.c | 18 | ||||
-rw-r--r-- | intern/iksolver/intern/IK_Solver.cpp | 5 | ||||
-rw-r--r-- | intern/mikktspace/mikktspace.c | 2 | ||||
-rw-r--r-- | intern/string/intern/STR_String.cpp | 6 | ||||
-rw-r--r-- | intern/utfconv/utfconv.c | 6 |
20 files changed, 121 insertions, 71 deletions
diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp index 9caf7068d3d..1dbe8a30ff2 100644 --- a/intern/cycles/app/cycles_xml.cpp +++ b/intern/cycles/app/cycles_xml.cpp @@ -495,7 +495,7 @@ static void xml_read_mesh(const XMLReadState &state, xml_node node) float3 *fdata = attr->data_float3(); #if 0 - if(subdivide_uvs) { + if (subdivide_uvs) { attr->flags |= ATTR_SUBDIVIDED; } #endif diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 095ecd59985..00f53804e38 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -307,8 +307,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph, /* TODO: don't use lights for excluded layers used as mask layer, * when dynamic overrides are back. */ #if 0 - if(!((layer_flag & view_layer.holdout_layer) && - (layer_flag & view_layer.exclude_layer))) + if (!((layer_flag & view_layer.holdout_layer) && (layer_flag & view_layer.exclude_layer))) #endif { sync_light(b_parent, @@ -345,7 +344,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph, /* TODO: make holdout objects on excluded layer invisible for non-camera rays. */ #if 0 - if(use_holdout && (layer_flag & view_layer.exclude_layer)) { + if (use_holdout && (layer_flag & view_layer.exclude_layer)) { visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA); } #endif diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index 169c4d414a6..5fd60ff7970 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -656,13 +656,12 @@ static ShaderNode *add_node(Scene *scene, /* TODO: restore */ /* TODO(sergey): Does not work properly when we change builtin type. */ #if 0 - if(b_image.is_updated()) { - scene->image_manager->tag_reload_image( - image->filename.string(), - image->builtin_data, - get_image_interpolation(b_image_node), - get_image_extension(b_image_node), - image->use_alpha); + if (b_image.is_updated()) { + scene->image_manager->tag_reload_image(image->filename.string(), + image->builtin_data, + get_image_interpolation(b_image_node), + get_image_extension(b_image_node), + image->use_alpha); } #endif } @@ -702,13 +701,12 @@ static ShaderNode *add_node(Scene *scene, /* TODO: restore */ /* TODO(sergey): Does not work properly when we change builtin type. */ #if 0 - if(b_image.is_updated()) { - scene->image_manager->tag_reload_image( - env->filename.string(), - env->builtin_data, - get_image_interpolation(b_env_node), - EXTENSION_REPEAT, - env->use_alpha); + if (b_image.is_updated()) { + scene->image_manager->tag_reload_image(env->filename.string(), + env->builtin_data, + get_image_interpolation(b_env_node), + EXTENSION_REPEAT, + env->use_alpha); } #endif } diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index e68f92474bf..500634e7526 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -54,8 +54,8 @@ static inline BL::Mesh object_to_mesh(BL::BlendData &data, bool subsurf_mod_show_render = false; bool subsurf_mod_show_viewport = false; - if(subdivision_type != Mesh::SUBDIVISION_NONE) { - BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length()-1]; + if (subdivision_type != Mesh::SUBDIVISION_NONE) { + BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length() - 1]; subsurf_mod_show_render = subsurf_mod.show_render(); subsurf_mod_show_viewport = subsurf_mod.show_viewport(); @@ -83,8 +83,8 @@ static inline BL::Mesh object_to_mesh(BL::BlendData &data, } #if 0 - if(subdivision_type != Mesh::SUBDIVISION_NONE) { - BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length()-1]; + if (subdivision_type != Mesh::SUBDIVISION_NONE) { + BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length() - 1]; subsurf_mod.show_render(subsurf_mod_show_render); subsurf_mod.show_viewport(subsurf_mod_show_viewport); diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 68bc3bd4045..936e1dccfa6 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -653,7 +653,7 @@ class CUDADevice : public Device { /* For testing mapped host memory, fill up device memory. */ const size_t keep_mb = 1024; - while(free_after > keep_mb * 1024 * 1024LL) { + while (free_after > keep_mb * 1024 * 1024LL) { CUdeviceptr tmp; cuda_assert(cuMemAlloc(&tmp, 10 * 1024 * 1024LL)); cuMemGetInfo(&free_after, &total); diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp index eb9f672fd8a..0257e18c3e8 100644 --- a/intern/cycles/kernel/osl/osl_services.cpp +++ b/intern/cycles/kernel/osl/osl_services.cpp @@ -733,7 +733,7 @@ bool OSLRenderServices::get_object_standard_attribute( return set_attribute_float3(f, type, derivatives, val); } #if 0 /* unsupported */ - else if(name == u_particle_rotation) { + else if (name == u_particle_rotation) { int particle_id = object_particle_id(kg, sd->object); float4 f = particle_rotation(kg, particle_id); return set_attribute_float4(f, type, derivatives, val); diff --git a/intern/cycles/kernel/shaders/stdosl.h b/intern/cycles/kernel/shaders/stdosl.h index 9b9720ffff9..2762b414ce4 100644 --- a/intern/cycles/kernel/shaders/stdosl.h +++ b/intern/cycles/kernel/shaders/stdosl.h @@ -235,15 +235,42 @@ int clamp(int x, int minval, int maxval) return max(min(x, maxval), minval); } #if 0 -normal mix (normal x, normal y, normal a) { return x*(1-a) + y*a; } -normal mix (normal x, normal y, float a) { return x*(1-a) + y*a; } -vector mix (vector x, vector y, vector a) { return x*(1-a) + y*a; } -vector mix (vector x, vector y, float a) { return x*(1-a) + y*a; } -point mix (point x, point y, point a) { return x*(1-a) + y*a; } -point mix (point x, point y, float a) { return x*(1-a) + y*a; } -color mix (color x, color y, color a) { return x*(1-a) + y*a; } -color mix (color x, color y, float a) { return x*(1-a) + y*a; } -float mix (float x, float y, float a) { return x*(1-a) + y*a; } +normal mix(normal x, normal y, normal a) +{ + return x * (1 - a) + y * a; +} +normal mix(normal x, normal y, float a) +{ + return x * (1 - a) + y * a; +} +vector mix(vector x, vector y, vector a) +{ + return x * (1 - a) + y * a; +} +vector mix(vector x, vector y, float a) +{ + return x * (1 - a) + y * a; +} +point mix(point x, point y, point a) +{ + return x * (1 - a) + y * a; +} +point mix(point x, point y, float a) +{ + return x * (1 - a) + y * a; +} +color mix(color x, color y, color a) +{ + return x * (1 - a) + y * a; +} +color mix(color x, color y, float a) +{ + return x * (1 - a) + y * a; +} +float mix(float x, float y, float a) +{ + return x * (1 - a) + y * a; +} #else normal mix(normal x, normal y, normal a) BUILTIN; normal mix(normal x, normal y, float a) BUILTIN; @@ -369,7 +396,7 @@ point rotate(point p, float angle, point a, point b) * anisotropic shader where angle is usually constant. */ #if 0 - sincos (angle, sinang, cosang); + sincos(angle, sinang, cosang); #else sinang = sin(angle); cosang = cos(angle); diff --git a/intern/cycles/render/camera.cpp b/intern/cycles/render/camera.cpp index 9c9070c8a90..a950324d4d4 100644 --- a/intern/cycles/render/camera.cpp +++ b/intern/cycles/render/camera.cpp @@ -716,10 +716,17 @@ float Camera::world_to_raster_size(float3 P) float3 raster = transform_perspective(&full_cameratoraster, make_float3(dir.x, dir.y, 0.0f)); ray.t = 1.0f; - camera_sample_panorama(&kernel_camera, kernel_camera_motion.data(), raster.x, raster.y, 0.0f, 0.0f, &ray); - if(ray.t == 0.0f) { + camera_sample_panorama( + &kernel_camera, kernel_camera_motion.data(), raster.x, raster.y, 0.0f, 0.0f, &ray); + if (ray.t == 0.0f) { /* No differentials, just use from directly ahead. */ - camera_sample_panorama(&kernel_camera, kernel_camera_motion.data(), 0.5f*full_width, 0.5f*full_height, 0.0f, 0.0f, &ray); + camera_sample_panorama(&kernel_camera, + kernel_camera_motion.data(), + 0.5f * full_width, + 0.5f * full_height, + 0.0f, + 0.0f, + &ray); } #else camera_sample_panorama(&kernel_camera, diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index f3572ee1585..30968ab0c5e 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -3888,7 +3888,7 @@ void ParticleInfoNode::attributes(Shader *shader, AttributeRequestSet *attribute if (!output("Location")->links.empty()) attributes->add(ATTR_STD_PARTICLE); #if 0 /* not yet supported */ - if(!output("Rotation")->links.empty()) + if (!output("Rotation")->links.empty()) attributes->add(ATTR_STD_PARTICLE); #endif if (!output("Size")->links.empty()) @@ -3933,7 +3933,7 @@ void ParticleInfoNode::compile(SVMCompiler &compiler) /* quaternion data is not yet supported by Cycles */ #if 0 out = output("Rotation"); - if(!out->links.empty()) { + if (!out->links.empty()) { compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_ROTATION, compiler.stack_assign(out)); } #endif diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h index 2c7f826db93..92cab29346a 100644 --- a/intern/cycles/util/util_math.h +++ b/intern/cycles/util/util_math.h @@ -417,12 +417,12 @@ ccl_device_inline float triangle_area(const float3 v1, const float3 v2, const fl ccl_device_inline void make_orthonormals(const float3 N, float3 *a, float3 *b) { #if 0 - if(fabsf(N.y) >= 0.999f) { + if (fabsf(N.y) >= 0.999f) { *a = make_float3(1, 0, 0); *b = make_float3(0, 0, 1); return; } - if(fabsf(N.z) >= 0.999f) { + if (fabsf(N.z) >= 0.999f) { *a = make_float3(1, 0, 0); *b = make_float3(0, 1, 0); return; diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h index 13ca27c2fed..cfe71d696ed 100644 --- a/intern/cycles/util/util_transform.h +++ b/intern/cycles/util/util_transform.h @@ -328,11 +328,11 @@ ccl_device_inline float4 quat_interpolate(float4 q1, float4 q2, float t) /* possible optimization: it might be possible to precompute theta/qperp */ - if(costheta > 0.9995f) { + if (costheta > 0.9995f) { /* linear interpolation in degenerate case */ - return normalize((1.0f - t)*q1 + t*q2); + return normalize((1.0f - t) * q1 + t * q2); } - else { + else { /* slerp */ float theta = acosf(clamp(costheta, -1.0f, 1.0f)); float4 qperp = normalize(q2 - q1 * costheta); diff --git a/intern/ghost/intern/GHOST_SystemSDL.cpp b/intern/ghost/intern/GHOST_SystemSDL.cpp index 044695c115c..81f1a4007cb 100644 --- a/intern/ghost/intern/GHOST_SystemSDL.cpp +++ b/intern/ghost/intern/GHOST_SystemSDL.cpp @@ -360,8 +360,8 @@ void GHOST_SystemSDL::processEvent(SDL_Event *sdl_event) GHOST_TInt32 y_root = sdl_sub_evt.y + y_win; #if 0 - if (window->getCursorGrabMode() != GHOST_kGrabDisable && window->getCursorGrabMode() != GHOST_kGrabNormal) - { + if (window->getCursorGrabMode() != GHOST_kGrabDisable && + window->getCursorGrabMode() != GHOST_kGrabNormal) { GHOST_TInt32 x_new = x_root; GHOST_TInt32 y_new = y_root; GHOST_TInt32 x_accum, y_accum; @@ -390,10 +390,15 @@ void GHOST_SystemSDL::processEvent(SDL_Event *sdl_event) SDL_WarpMouseInWindow(sdl_win, x_new - x_win, y_new - y_win); } - g_event = new GHOST_EventCursor(getMilliSeconds(), GHOST_kEventCursorMove, window, x_new, y_new); + g_event = new GHOST_EventCursor( + getMilliSeconds(), GHOST_kEventCursorMove, window, x_new, y_new); } else { - g_event = new GHOST_EventCursor(getMilliSeconds(), GHOST_kEventCursorMove, window, x_root + x_accum, y_root + y_accum); + g_event = new GHOST_EventCursor(getMilliSeconds(), + GHOST_kEventCursorMove, + window, + x_root + x_accum, + y_root + y_accum); } } else diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 95f969bcb67..ab159e91d85 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -1160,13 +1160,14 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, if (hwnd) { #if 0 // Disabled due to bug in Intel drivers, see T51959 - if(msg == WM_NCCREATE) { + if (msg == WM_NCCREATE) { // Tell Windows to automatically handle scaling of non-client areas // such as the caption bar. EnableNonClientDpiScaling was introduced in Windows 10 HMODULE m_user32 = ::LoadLibrary("User32.dll"); if (m_user32) { GHOST_WIN32_EnableNonClientDpiScaling fpEnableNonClientDpiScaling = - (GHOST_WIN32_EnableNonClientDpiScaling) ::GetProcAddress(m_user32, "EnableNonClientDpiScaling"); + (GHOST_WIN32_EnableNonClientDpiScaling)::GetProcAddress(m_user32, + "EnableNonClientDpiScaling"); if (fpEnableNonClientDpiScaling) { fpEnableNonClientDpiScaling(hwnd); diff --git a/intern/ghost/test/gears/GHOST_Test.cpp b/intern/ghost/test/gears/GHOST_Test.cpp index 76386fb114a..654177d3f66 100644 --- a/intern/ghost/test/gears/GHOST_Test.cpp +++ b/intern/ghost/test/gears/GHOST_Test.cpp @@ -479,12 +479,14 @@ bool Application::processEvent(GHOST_IEvent *event) switch (event->getType()) { #if 0 - case GHOST_kEventUnknown: - break; - case GHOST_kEventCursorButton: - std::cout << "GHOST_kEventCursorButton"; break; - case GHOST_kEventCursorMove: - std::cout << "GHOST_kEventCursorMove"; break; + case GHOST_kEventUnknown: + break; + case GHOST_kEventCursorButton: + std::cout << "GHOST_kEventCursorButton"; + break; + case GHOST_kEventCursorMove: + std::cout << "GHOST_kEventCursorMove"; + break; #endif case GHOST_kEventWheel: { GHOST_TEventWheelData *wheelData = (GHOST_TEventWheelData *)event->getData(); diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h index 4cefc27bc54..b5ac3288a61 100644 --- a/intern/guardedalloc/MEM_guardedalloc.h +++ b/intern/guardedalloc/MEM_guardedalloc.h @@ -70,10 +70,10 @@ extern size_t (*MEM_allocN_len)(const void *vmemh) ATTR_WARN_UNUSED_RESULT; extern void (*MEM_freeN)(void *vmemh); #if 0 /* UNUSED */ - /** +/** * Return zero if memory is not in allocated list */ - extern short (*MEM_testN)(void *vmemh); +extern short (*MEM_testN)(void *vmemh); #endif /** diff --git a/intern/guardedalloc/intern/mallocn_guarded_impl.c b/intern/guardedalloc/intern/mallocn_guarded_impl.c index b24e1c8c984..384cba113ff 100644 --- a/intern/guardedalloc/intern/mallocn_guarded_impl.c +++ b/intern/guardedalloc/intern/mallocn_guarded_impl.c @@ -907,7 +907,8 @@ short MEM_guarded_testN(void *vmemh) mem_lock_thread(); membl = membase->first; - if (membl) membl = MEMNEXT(membl); + if (membl) + membl = MEMNEXT(membl); while (membl) { if (vmemh == membl + 1) { @@ -917,7 +918,8 @@ short MEM_guarded_testN(void *vmemh) if (membl->next) membl = MEMNEXT(membl->next); - else break; + else + break; } mem_unlock_thread(); @@ -1013,8 +1015,10 @@ static void addtail(volatile localListBase *listbase, void *vlink) /* for a generic API error checks here is fine but * the limited use here they will never be NULL */ #if 0 - if (link == NULL) return; - if (listbase == NULL) return; + if (link == NULL) + return; + if (listbase == NULL) + return; #endif link->next = NULL; @@ -1034,8 +1038,10 @@ static void remlink(volatile localListBase *listbase, void *vlink) /* for a generic API error checks here is fine but * the limited use here they will never be NULL */ #if 0 - if (link == NULL) return; - if (listbase == NULL) return; + if (link == NULL) + return; + if (listbase == NULL) + return; #endif if (link->next) diff --git a/intern/iksolver/intern/IK_Solver.cpp b/intern/iksolver/intern/IK_Solver.cpp index 5205fd6e16c..b274e005990 100644 --- a/intern/iksolver/intern/IK_Solver.cpp +++ b/intern/iksolver/intern/IK_Solver.cpp @@ -379,7 +379,10 @@ float IK_SolverGetPoleAngle(IK_Solver *solver) } #if 0 -static void IK_SolverAddCenterOfMass(IK_Solver *solver, IK_Segment *root, float goal[3], float weight) +static void IK_SolverAddCenterOfMass(IK_Solver *solver, + IK_Segment *root, + float goal[3], + float weight) { if (solver == NULL || root == NULL) return; diff --git a/intern/mikktspace/mikktspace.c b/intern/mikktspace/mikktspace.c index 1ea17c273ed..26e12081f80 100644 --- a/intern/mikktspace/mikktspace.c +++ b/intern/mikktspace/mikktspace.c @@ -99,7 +99,7 @@ MIKK_INLINE float Length(const SVec3 v) } #if 0 // UNUSED -MIKK_INLINE SVec3 Normalize( const SVec3 v ) +MIKK_INLINE SVec3 Normalize(const SVec3 v) { return vscale(1.0f / Length(v), v); } diff --git a/intern/string/intern/STR_String.cpp b/intern/string/intern/STR_String.cpp index b2134550ea9..bc95e96180a 100644 --- a/intern/string/intern/STR_String.cpp +++ b/intern/string/intern/STR_String.cpp @@ -615,15 +615,15 @@ std::vector<STR_String> STR_String::Explode(char c) const #if 0 -int STR_String::Serialize(pCStream stream) +int STR_String::Serialize(pCStream stream) { if (stream->GetAccess() == CStream::Access_Read) { int ln; stream->Read(&ln, sizeof(ln)); AllocBuffer(ln, false); stream->Read(this->m_data, ln); - this->m_data[ln] = '\0'; - this->m_len = ln; + this->m_data[ln] = '\0'; + this->m_len = ln; } else { stream->Write(&this->m_len, sizeof(this->m_len)); diff --git a/intern/utfconv/utfconv.c b/intern/utfconv/utfconv.c index 1dd868b8170..4a098f2595c 100644 --- a/intern/utfconv/utfconv.c +++ b/intern/utfconv/utfconv.c @@ -265,7 +265,8 @@ int conv_utf_8_to_16(const char *in8, wchar_t *out16, size_t size16) static int is_ascii(const char *in8) { for (; *in8; in8++) - if (0x80 & *in8) return 0; + if (0x80 & *in8) + return 0; return 1; } @@ -274,7 +275,8 @@ static void utf_8_cut_end(char *inout8, size_t maxcutpoint) { char *cur = inout8 + maxcutpoint; char cc; - if (!inout8) return; + if (!inout8) + return; cc = *cur; } |