Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-10-03 19:31:45 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-10-03 19:31:45 +0400
commitda8f71bffb1a33c695a368c1243b8aa9ac54c21d (patch)
tree988f91e51c03a676fef598ce1e9b03f245244c0a /intern/cycles/render/attribute.h
parent590b7ff102c0ac5ee1f45ef8e43664afd9131251 (diff)
Cycles: some tweaks to silence msvc assertions in debug mode.
Diffstat (limited to 'intern/cycles/render/attribute.h')
-rw-r--r--intern/cycles/render/attribute.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/intern/cycles/render/attribute.h b/intern/cycles/render/attribute.h
index a1c3d2b6ae7..aef215d6c0c 100644
--- a/intern/cycles/render/attribute.h
+++ b/intern/cycles/render/attribute.h
@@ -73,13 +73,13 @@ public:
size_t element_size(int numverts, int numfaces);
size_t buffer_size(int numverts, int numfaces);
- char *data() { return &buffer[0]; };
- float3 *data_float3() { return (float3*)&buffer[0]; }
- float *data_float() { return (float*)&buffer[0]; }
+ char *data() { return (buffer.size())? &buffer[0]: NULL; };
+ float3 *data_float3() { return (float3*)data(); }
+ float *data_float() { return (float*)data(); }
- const char *data() const { return &buffer[0]; }
- const float3 *data_float3() const { return (float3*)&buffer[0]; }
- const float *data_float() const { return (float*)&buffer[0]; }
+ const char *data() const { return (buffer.size())? &buffer[0]: NULL; }
+ const float3 *data_float3() const { return (float3*)data(); }
+ const float *data_float() const { return (float*)data(); }
static bool same_storage(TypeDesc a, TypeDesc b);
static ustring standard_name(Attribute::Standard std);