ClangFormat: format '#if 0' code in intern/

This commit is contained in:
2019-04-17 08:16:53 +02:00
parent 3076d95ba4
commit 108045faa0
20 changed files with 121 additions and 71 deletions

View File

@@ -307,8 +307,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
/* TODO: don't use lights for excluded layers used as mask layer, /* TODO: don't use lights for excluded layers used as mask layer,
* when dynamic overrides are back. */ * when dynamic overrides are back. */
#if 0 #if 0
if(!((layer_flag & view_layer.holdout_layer) && if (!((layer_flag & view_layer.holdout_layer) && (layer_flag & view_layer.exclude_layer)))
(layer_flag & view_layer.exclude_layer)))
#endif #endif
{ {
sync_light(b_parent, sync_light(b_parent,

View File

@@ -657,8 +657,7 @@ static ShaderNode *add_node(Scene *scene,
/* TODO(sergey): Does not work properly when we change builtin type. */ /* TODO(sergey): Does not work properly when we change builtin type. */
#if 0 #if 0
if (b_image.is_updated()) { if (b_image.is_updated()) {
scene->image_manager->tag_reload_image( scene->image_manager->tag_reload_image(image->filename.string(),
image->filename.string(),
image->builtin_data, image->builtin_data,
get_image_interpolation(b_image_node), get_image_interpolation(b_image_node),
get_image_extension(b_image_node), get_image_extension(b_image_node),
@@ -703,8 +702,7 @@ static ShaderNode *add_node(Scene *scene,
/* TODO(sergey): Does not work properly when we change builtin type. */ /* TODO(sergey): Does not work properly when we change builtin type. */
#if 0 #if 0
if (b_image.is_updated()) { if (b_image.is_updated()) {
scene->image_manager->tag_reload_image( scene->image_manager->tag_reload_image(env->filename.string(),
env->filename.string(),
env->builtin_data, env->builtin_data,
get_image_interpolation(b_env_node), get_image_interpolation(b_env_node),
EXTENSION_REPEAT, EXTENSION_REPEAT,

View File

@@ -235,15 +235,42 @@ int clamp(int x, int minval, int maxval)
return max(min(x, maxval), minval); return max(min(x, maxval), minval);
} }
#if 0 #if 0
normal mix (normal x, normal y, normal a) { return x*(1-a) + y*a; } normal mix(normal x, normal y, normal 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; } 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; } normal mix(normal x, normal y, float 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; } 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; } 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 #else
normal mix(normal x, normal y, normal a) BUILTIN; normal mix(normal x, normal y, normal a) BUILTIN;
normal mix(normal x, normal y, float a) BUILTIN; normal mix(normal x, normal y, float a) BUILTIN;

View File

@@ -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)); float3 raster = transform_perspective(&full_cameratoraster, make_float3(dir.x, dir.y, 0.0f));
ray.t = 1.0f; ray.t = 1.0f;
camera_sample_panorama(&kernel_camera, kernel_camera_motion.data(), raster.x, raster.y, 0.0f, 0.0f, &ray); camera_sample_panorama(
&kernel_camera, kernel_camera_motion.data(), raster.x, raster.y, 0.0f, 0.0f, &ray);
if (ray.t == 0.0f) { if (ray.t == 0.0f) {
/* No differentials, just use from directly ahead. */ /* 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 #else
camera_sample_panorama(&kernel_camera, camera_sample_panorama(&kernel_camera,

View File

@@ -360,8 +360,8 @@ void GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
GHOST_TInt32 y_root = sdl_sub_evt.y + y_win; GHOST_TInt32 y_root = sdl_sub_evt.y + y_win;
#if 0 #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 x_new = x_root;
GHOST_TInt32 y_new = y_root; GHOST_TInt32 y_new = y_root;
GHOST_TInt32 x_accum, y_accum; 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); 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 { 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 else

View File

@@ -1166,7 +1166,8 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
HMODULE m_user32 = ::LoadLibrary("User32.dll"); HMODULE m_user32 = ::LoadLibrary("User32.dll");
if (m_user32) { if (m_user32) {
GHOST_WIN32_EnableNonClientDpiScaling fpEnableNonClientDpiScaling = GHOST_WIN32_EnableNonClientDpiScaling fpEnableNonClientDpiScaling =
(GHOST_WIN32_EnableNonClientDpiScaling) ::GetProcAddress(m_user32, "EnableNonClientDpiScaling"); (GHOST_WIN32_EnableNonClientDpiScaling)::GetProcAddress(m_user32,
"EnableNonClientDpiScaling");
if (fpEnableNonClientDpiScaling) { if (fpEnableNonClientDpiScaling) {
fpEnableNonClientDpiScaling(hwnd); fpEnableNonClientDpiScaling(hwnd);

View File

@@ -482,9 +482,11 @@ bool Application::processEvent(GHOST_IEvent *event)
case GHOST_kEventUnknown: case GHOST_kEventUnknown:
break; break;
case GHOST_kEventCursorButton: case GHOST_kEventCursorButton:
std::cout << "GHOST_kEventCursorButton"; break; std::cout << "GHOST_kEventCursorButton";
break;
case GHOST_kEventCursorMove: case GHOST_kEventCursorMove:
std::cout << "GHOST_kEventCursorMove"; break; std::cout << "GHOST_kEventCursorMove";
break;
#endif #endif
case GHOST_kEventWheel: { case GHOST_kEventWheel: {
GHOST_TEventWheelData *wheelData = (GHOST_TEventWheelData *)event->getData(); GHOST_TEventWheelData *wheelData = (GHOST_TEventWheelData *)event->getData();

View File

@@ -907,7 +907,8 @@ short MEM_guarded_testN(void *vmemh)
mem_lock_thread(); mem_lock_thread();
membl = membase->first; membl = membase->first;
if (membl) membl = MEMNEXT(membl); if (membl)
membl = MEMNEXT(membl);
while (membl) { while (membl) {
if (vmemh == membl + 1) { if (vmemh == membl + 1) {
@@ -917,7 +918,8 @@ short MEM_guarded_testN(void *vmemh)
if (membl->next) if (membl->next)
membl = MEMNEXT(membl->next); membl = MEMNEXT(membl->next);
else break; else
break;
} }
mem_unlock_thread(); 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 /* for a generic API error checks here is fine but
* the limited use here they will never be NULL */ * the limited use here they will never be NULL */
#if 0 #if 0
if (link == NULL) return; if (link == NULL)
if (listbase == NULL) return; return;
if (listbase == NULL)
return;
#endif #endif
link->next = NULL; 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 /* for a generic API error checks here is fine but
* the limited use here they will never be NULL */ * the limited use here they will never be NULL */
#if 0 #if 0
if (link == NULL) return; if (link == NULL)
if (listbase == NULL) return; return;
if (listbase == NULL)
return;
#endif #endif
if (link->next) if (link->next)

View File

@@ -379,7 +379,10 @@ float IK_SolverGetPoleAngle(IK_Solver *solver)
} }
#if 0 #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) if (solver == NULL || root == NULL)
return; return;

View File

@@ -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) static int is_ascii(const char *in8)
{ {
for (; *in8; in8++) for (; *in8; in8++)
if (0x80 & *in8) return 0; if (0x80 & *in8)
return 0;
return 1; return 1;
} }
@@ -274,7 +275,8 @@ static void utf_8_cut_end(char *inout8, size_t maxcutpoint)
{ {
char *cur = inout8 + maxcutpoint; char *cur = inout8 + maxcutpoint;
char cc; char cc;
if (!inout8) return; if (!inout8)
return;
cc = *cur; cc = *cur;
} }