Cleanup: balance braces in pre-processor checks

While it's correct, unbalanced braces confuses some editing operations.
This commit is contained in:
Campbell Barton
2024-11-26 12:16:45 +11:00
parent 5ef9b93d2a
commit 9e9598877e
6 changed files with 18 additions and 12 deletions

View File

@@ -236,10 +236,11 @@ class GPUShaderCreator : public OCIO::GpuShaderCreator {
const eGPUTextureFormat texture_format = Result::gpu_texture_format(result_type, precision_);
/* A height of 1 indicates a 1D texture according to the OCIO API. */
# if OCIO_VERSION_HEX >= 0x02030000
if (dimensions == OCIO::GpuShaderDesc::TEXTURE_1D) {
if (dimensions == OCIO::GpuShaderDesc::TEXTURE_1D)
# else
if (height == 1) {
if (height == 1)
# endif
{
texture = GPU_texture_create_1d(
texture_name, width, 1, texture_format, GPU_TEXTURE_USAGE_SHADER_READ, values);
shader_create_info_.sampler(textures_.size() + 1, ImageType::FLOAT_1D, resource_name);

View File

@@ -54,10 +54,11 @@ void firstIntersectionGridVisitor::examineOccluder(Polygon3r *occ)
#if 0
Vec3d bboxdiag(_scene3d->bbox().getMax() - _scene3d->bbox().getMin());
if ((t > 1.0e-06 * (min(min(bboxdiag.x(), bboxdiag.y()), bboxdiag.z()))) &&
(t < raylength)) {
(t < raylength))
#else
if (tmp_t < t_) {
if (tmp_t < t_)
#endif
{
occluder_ = occ;
u_ = tmp_u;
v_ = tmp_v;

View File

@@ -249,10 +249,11 @@ void MTLStorageBuf::unbind()
* Otherwise, only perform a full unbind upon destruction
* to ensure no lingering references. */
#ifndef NDEBUG
if (true) {
if (true)
#else
if (G.debug & G_DEBUG_GPU) {
if (G.debug & G_DEBUG_GPU)
#endif
{
if (bound_ctx_ != nullptr && bind_slot_ > -1) {
MTLStorageBufferBinding &ctx_ssbo_bind_slot =
bound_ctx_->pipeline_state.ssbo_bindings[bind_slot_];

View File

@@ -163,10 +163,11 @@ void MTLUniformBuf::unbind()
* Otherwise, only perform a full unbind upon destruction
* to ensure no lingering references. */
#ifndef NDEBUG
if (true) {
if (true)
#else
if (G.debug & G_DEBUG_GPU) {
if (G.debug & G_DEBUG_GPU)
#endif
{
if (bound_ctx_ != nullptr && bind_slot_ > -1) {
MTLUniformBufferBinding &ctx_ubo_bind_slot =
bound_ctx_->pipeline_state.ubo_bindings[bind_slot_];

View File

@@ -705,10 +705,11 @@ static void ffmpeg_decode_store_frame_pts(ImBufAnim *anim)
anim->cur_pts = av_get_pts_from_frame(anim->pFrame);
# ifdef FFMPEG_OLD_KEY_FRAME_QUERY_METHOD
if (anim->pFrame->key_frame) {
if (anim->pFrame->key_frame)
# else
if (anim->pFrame->flags & AV_FRAME_FLAG_KEY) {
if (anim->pFrame->flags & AV_FRAME_FLAG_KEY)
# endif
{
anim->cur_key_frame_pts = anim->cur_pts;
}

View File

@@ -298,10 +298,11 @@ static uiBlock *wm_block_splash_create(bContext *C, ARegion *region, void * /*ar
/* Displays a warning if blender is being emulated via Rosetta (macOS) or XTA (Windows) */
#if defined(__APPLE__) || defined(_M_X64)
# if defined(__APPLE__)
if (is_using_macos_rosetta() > 0) {
if (is_using_macos_rosetta() > 0)
# elif defined(_M_X64)
if (strncmp(BLI_getenv("PROCESSOR_IDENTIFIER"), "ARM", 3) == 0) {
if (strncmp(BLI_getenv("PROCESSOR_IDENTIFIER"), "ARM", 3) == 0)
# endif
{
uiItemS_ex(layout, 2.0f, LayoutSeparatorType::Line);
uiLayout *split = uiLayoutSplit(layout, 0.725, true);