diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-06-26 18:42:33 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-06-26 18:42:33 +0300 |
commit | b4c01aca30faa16900084c081faff6fbaf130872 (patch) | |
tree | 51e66b197e1706b22fd6b832c4a223ebdfb1b375 | |
parent | d5a42bce38fd6548728b47a4ec76afdd75668341 (diff) | |
parent | 599e979d90327c1e10031f992cb2be2cda414825 (diff) |
Merge branch 'master' into blender2.8
-rw-r--r-- | intern/cycles/device/device_cpu.cpp | 3 | ||||
-rw-r--r-- | intern/cycles/kernel/osl/osl_closures.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/kernel/osl/osl_shader.cpp | 3 | ||||
-rw-r--r-- | intern/cycles/render/shader.h | 3 | ||||
-rw-r--r-- | intern/cycles/util/util_image.h | 4 | ||||
-rw-r--r-- | intern/cycles/util/util_param.h | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/openexr/openexr_api.cpp | 4 | ||||
-rw-r--r-- | source/blender/makesdna/intern/dna_genfile.c | 41 |
8 files changed, 39 insertions, 27 deletions
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index 3b0d0fb9806..6be60f8bbb6 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -21,10 +21,7 @@ #ifdef WITH_OSL /* So no context pollution happens from indirectly included windows.h */ # include "util/util_windows.h" -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wdeprecated-register" # include <OSL/oslexec.h> -# pragma clang diagnostic pop #endif #include "device/device.h" diff --git a/intern/cycles/kernel/osl/osl_closures.cpp b/intern/cycles/kernel/osl/osl_closures.cpp index e928006e41a..6a1e52d7d16 100644 --- a/intern/cycles/kernel/osl/osl_closures.cpp +++ b/intern/cycles/kernel/osl/osl_closures.cpp @@ -30,12 +30,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-register" -#pragma clang diagnostic ignored "-Wexpansion-to-defined" #include <OSL/genclosure.h> #include <OSL/oslclosure.h> -#pragma clang diagnostic pop #include "kernel/osl/osl_closures.h" #include "kernel/osl/osl_shader.h" diff --git a/intern/cycles/kernel/osl/osl_shader.cpp b/intern/cycles/kernel/osl/osl_shader.cpp index 8757b9a748b..b7d1c629291 100644 --- a/intern/cycles/kernel/osl/osl_shader.cpp +++ b/intern/cycles/kernel/osl/osl_shader.cpp @@ -14,10 +14,7 @@ * limitations under the License. */ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-register" #include <OSL/oslexec.h> -#pragma clang diagnostic pop #include "kernel/kernel_compat_cpu.h" #include "kernel/kernel_montecarlo.h" diff --git a/intern/cycles/render/shader.h b/intern/cycles/render/shader.h index 87bc3ddda28..d787c3b266b 100644 --- a/intern/cycles/render/shader.h +++ b/intern/cycles/render/shader.h @@ -20,10 +20,7 @@ #ifdef WITH_OSL /* So no context pollution happens from indirectly included windows.h */ # include "util/util_windows.h" -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wdeprecated-register" # include <OSL/oslexec.h> -# pragma clang diagnostic pop #endif #include "render/attribute.h" diff --git a/intern/cycles/util/util_image.h b/intern/cycles/util/util_image.h index 38694c87d0e..18876841b5b 100644 --- a/intern/cycles/util/util_image.h +++ b/intern/cycles/util/util_image.h @@ -19,11 +19,7 @@ /* OpenImageIO is used for all image file reading and writing. */ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-register" -#pragma clang diagnostic ignored "-Wexpansion-to-defined" #include <OpenImageIO/imageio.h> -#pragma clang diagnostic pop #include "util/util_vector.h" diff --git a/intern/cycles/util/util_param.h b/intern/cycles/util/util_param.h index 419a8010d5a..69bcbf80a78 100644 --- a/intern/cycles/util/util_param.h +++ b/intern/cycles/util/util_param.h @@ -20,13 +20,9 @@ /* Parameter value lists from OpenImageIO are used to store custom properties * on various data, which can then later be used in shaders. */ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-register" -#pragma clang diagnostic ignored "-Wexpansion-to-defined" #include <OpenImageIO/paramlist.h> #include <OpenImageIO/typedesc.h> #include <OpenImageIO/ustring.h> -#pragma clang diagnostic pop CCL_NAMESPACE_BEGIN diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 13c033523fa..a52ae75e87b 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -40,9 +40,6 @@ #include <algorithm> #include <iostream> - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-register" #include <half.h> #include <Iex.h> #include <ImfVersion.h> @@ -67,7 +64,6 @@ #include <ImfTiledOutputPart.h> #include <ImfPartType.h> #include <ImfPartHelper.h> -#pragma clang diagnostic pop #include "DNA_scene_types.h" /* For OpenEXR compression constants */ diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 257c57e5a9a..cf059c08cd5 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -977,10 +977,47 @@ static int elem_strcmp(const char *name, const char *oname) } /** + * Returns whether the specified field exists according to the struct format + * pointed to by old. + * + * \param sdna Old SDNA + * \param type Current field type name + * \param name Current field name + * \param old Pointer to struct information in sdna + * \return true when existsing, false otherwise. + */ +static bool elem_exists( + const SDNA *sdna, + const char *type, + const char *name, + const short *old) +{ + int a, elemcount; + const char *otype, *oname; + + /* in old is the old struct */ + elemcount = old[1]; + old += 2; + for (a = 0; a < elemcount; a++, old += 2) { + otype = sdna->types[old[0]]; + oname = sdna->names[old[1]]; + + if (elem_strcmp(name, oname) == 0) { /* name equal */ + return strcmp(type, otype) == 0; /* type equal */ + } + } + return false; +} + +/** * Returns the address of the data for the specified field within olddata * according to the struct format pointed to by old, or NULL if no such * field can be found. * + * Passing olddata=NULL doesn't work reliably for existence checks; it will + * return NULL both when the field is found at offset 0 and when it is not + * found at all. For field existence checks, use elem_exists() instead. + * * \param sdna Old SDNA * \param type Current field type name * \param name Current field name @@ -1390,9 +1427,9 @@ bool DNA_struct_elem_find(const SDNA *sdna, const char *stype, const char *varty if (SDNAnr != -1) { const short * const spo = sdna->structs[SDNAnr]; - const char * const cp = find_elem(sdna, vartype, name, spo, NULL, NULL); + const bool found = elem_exists(sdna, vartype, name, spo); - if (cp) { + if (found) { return true; } } |