[Bf-blender-cvs] [4f5f031] alembic_pointcache: Fix for potential size issue: need 64 bits for CustomDataMask types.
Lukas Tönne
noreply at git.blender.org
Mon Mar 9 10:38:59 CET 2015
Commit: 4f5f03115b109a3ef2df24d148056b2ecf9fe20c
Author: Lukas Tönne
Date: Mon Mar 9 10:38:20 2015 +0100
Branches: alembic_pointcache
https://developer.blender.org/rB4f5f03115b109a3ef2df24d148056b2ecf9fe20c
Fix for potential size issue: need 64 bits for CustomDataMask types.
===================================================================
M source/blender/pointcache/alembic/abc_customdata.cpp
M source/blender/pointcache/alembic/abc_customdata.h
===================================================================
diff --git a/source/blender/pointcache/alembic/abc_customdata.cpp b/source/blender/pointcache/alembic/abc_customdata.cpp
index f7c27ef..f961882 100644
--- a/source/blender/pointcache/alembic/abc_customdata.cpp
+++ b/source/blender/pointcache/alembic/abc_customdata.cpp
@@ -201,7 +201,7 @@ PTCReadSampleResult read_sample_call<CD_NUMTYPES>(CustomDataReader *reader, ICom
/* ========================================================================= */
-CustomDataWriter::CustomDataWriter(const std::string &name, int cdmask) :
+CustomDataWriter::CustomDataWriter(const std::string &name, CustomDataMask cdmask) :
m_name(name),
m_cdmask(cdmask)
{
@@ -261,7 +261,7 @@ void CustomDataWriter::write_sample(CustomData *cdata, int num_data, OCompoundPr
m_props = add_compound_property<OCompoundProperty>(m_name, parent);
for (int type = 0; type < CD_NUMTYPES; ++type) {
- int mask = (1 << type);
+ CustomDataMask mask = (1 << type);
/* only use specified types */
if (!(mask & m_cdmask))
continue;
@@ -284,7 +284,7 @@ void CustomDataWriter::write_sample(CustomData *cdata, int num_data, OCompoundPr
/* ------------------------------------------------------------------------- */
-CustomDataReader::CustomDataReader(const std::string &name, int cdmask) :
+CustomDataReader::CustomDataReader(const std::string &name, CustomDataMask cdmask) :
m_name(name),
m_cdmask(cdmask)
{
@@ -304,7 +304,7 @@ PTCReadSampleResult CustomDataReader::read_sample(const ISampleSelector &ss, Cus
m_props = add_compound_property<ICompoundProperty>(m_name, parent);
for (int type = 0; type < CD_NUMTYPES; ++type) {
- int mask = (1 << type);
+ CustomDataMask mask = (1 << type);
/* only use specified types */
if (!(mask & m_cdmask))
continue;
diff --git a/source/blender/pointcache/alembic/abc_customdata.h b/source/blender/pointcache/alembic/abc_customdata.h
index 82efa70..2ca5b7e 100644
--- a/source/blender/pointcache/alembic/abc_customdata.h
+++ b/source/blender/pointcache/alembic/abc_customdata.h
@@ -30,6 +30,8 @@
#include "abc_writer.h"
extern "C" {
+#include "BKE_customdata.h"
+
#include "DNA_customdata_types.h"
}
@@ -43,7 +45,7 @@ struct CustomDataWriter {
typedef std::map<std::string, Abc::BasePropertyWriterPtr> LayerPropsMap;
typedef std::pair<std::string, Abc::BasePropertyWriterPtr> LayerPropsPair;
- CustomDataWriter(const std::string &name, int cdmask);
+ CustomDataWriter(const std::string &name, CustomDataMask cdmask);
~CustomDataWriter();
void write_sample(CustomData *cdata, int num_data, Abc::OCompoundProperty &parent);
@@ -80,7 +82,7 @@ struct CustomDataWriter {
private:
std::string m_name;
- int m_cdmask;
+ CustomDataMask m_cdmask;
Abc::OCompoundProperty m_props;
LayerPropsMap m_layer_props;
@@ -90,7 +92,7 @@ struct CustomDataReader {
typedef std::map<std::string, Abc::BasePropertyReaderPtr> LayerPropsMap;
typedef std::pair<std::string, Abc::BasePropertyReaderPtr> LayerPropsPair;
- CustomDataReader(const std::string &name, int cdmask);
+ CustomDataReader(const std::string &name, CustomDataMask cdmask);
~CustomDataReader();
PTCReadSampleResult read_sample(const Abc::ISampleSelector &ss, CustomData *cdata, int num_data, Abc::ICompoundProperty &parent);
@@ -128,7 +130,7 @@ struct CustomDataReader {
private:
std::string m_name;
- int m_cdmask;
+ CustomDataMask m_cdmask;
Abc::ICompoundProperty m_props;
LayerPropsMap m_layer_props;
More information about the Bf-blender-cvs
mailing list