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,
* 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,

View File

@@ -657,8 +657,7 @@ static ShaderNode *add_node(Scene *scene,
/* 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(),
scene->image_manager->tag_reload_image(image->filename.string(),
image->builtin_data,
get_image_interpolation(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. */
#if 0
if (b_image.is_updated()) {
scene->image_manager->tag_reload_image(
env->filename.string(),
scene->image_manager->tag_reload_image(env->filename.string(),
env->builtin_data,
get_image_interpolation(b_env_node),
EXTENSION_REPEAT,

View File

@@ -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;

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));
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) {
/* 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,

View File

@@ -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

View File

@@ -1166,7 +1166,8 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam,
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);

View File

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

View File

@@ -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)

View File

@@ -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;

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)
{
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;
}