Merge branch 'master' into blender2.8

This commit is contained in:
Sybren A. Stüvel 2018-06-26 17:42:33 +02:00
commit b4c01aca30
8 changed files with 39 additions and 27 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -976,11 +976,48 @@ static int elem_strcmp(const char *name, const char *oname)
return 0;
}
/**
* 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;
}
}