Cleanup: quiet compiler warnings

Suppressing "null-pointer-subtraction" was needed for clang
but caused a warning with GCC.
This commit is contained in:
Campbell Barton
2025-08-20 11:18:29 +10:00
parent 3a8a379ea2
commit c45ee0eb98
2 changed files with 10 additions and 10 deletions

View File

@@ -1710,11 +1710,11 @@ void BlenderSync::sync_world(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d,
PointerRNA cvisibility = RNA_pointer_get(&b_world.ptr, "cycles_visibility");
uint visibility = 0;
visibility |= get_boolean(cvisibility, "camera") ? PATH_RAY_CAMERA : 0;
visibility |= get_boolean(cvisibility, "diffuse") ? PATH_RAY_DIFFUSE : 0;
visibility |= get_boolean(cvisibility, "glossy") ? PATH_RAY_GLOSSY : 0;
visibility |= get_boolean(cvisibility, "transmission") ? PATH_RAY_TRANSMIT : 0;
visibility |= get_boolean(cvisibility, "scatter") ? PATH_RAY_VOLUME_SCATTER : 0;
visibility |= get_boolean(cvisibility, "camera") ? PATH_RAY_CAMERA : PathRayFlag(0);
visibility |= get_boolean(cvisibility, "diffuse") ? PATH_RAY_DIFFUSE : PathRayFlag(0);
visibility |= get_boolean(cvisibility, "glossy") ? PATH_RAY_GLOSSY : PathRayFlag(0);
visibility |= get_boolean(cvisibility, "transmission") ? PATH_RAY_TRANSMIT : PathRayFlag(0);
visibility |= get_boolean(cvisibility, "scatter") ? PATH_RAY_VOLUME_SCATTER : PathRayFlag(0);
background->set_visibility(visibility);
}

View File

@@ -103,9 +103,9 @@ void MD5Hash::process(const uint8_t *data /*[64]*/)
static const int w = 1;
if (*((const uint8_t *)&w)) /* dynamic little-endian */ {
#ifdef __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wnull-pointer-subtraction"
#if defined(__GNUC__) && defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wnull-pointer-subtraction"
#endif
/*
* On little-endian machines, we can process properly aligned
@@ -120,8 +120,8 @@ void MD5Hash::process(const uint8_t *data /*[64]*/)
memcpy(xbuf, data, 64);
X = xbuf;
}
#ifdef __GNUC__
# pragma GCC diagnostic pop
#if defined(__GNUC__) && defined(__clang__)
# pragma clang diagnostic pop
#endif
}
else { /* dynamic big-endian */