Commit: 45db0e74b6977a00d7031152bc062abdb9001fe4
Author: Kévin Dietrich
Date:   Thu Jun 9 15:11:30 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rB45db0e74b6977a00d7031152bc062abdb9001fe4

Cleanup: magic numbers.

===================================================================

M       source/blender/alembic/intern/abc_object.cc
M       source/blender/makesdna/DNA_cachefile_types.h
M       source/blender/makesdna/DNA_modifier_types.h

===================================================================

diff --git a/source/blender/alembic/intern/abc_object.cc 
b/source/blender/alembic/intern/abc_object.cc
index 1c2e0c5..4576491 100644
--- a/source/blender/alembic/intern/abc_object.cc
+++ b/source/blender/alembic/intern/abc_object.cc
@@ -28,6 +28,7 @@ extern "C" {
 #include "DNA_constraint_types.h"
 #include "DNA_modifier_types.h"
 #include "DNA_object_types.h"
+#include "DNA_space_types.h"  /* for FILE_MAX */
 
 #include "BKE_constraint.h"
 #include "BKE_depsgraph.h"
@@ -402,7 +403,7 @@ void AbcObjectReader::readObjectMatrix(const float time)
                bConstraint *con = BKE_constraint_add_for_object(m_object, 
NULL, CONSTRAINT_TYPE_TRANSFORMCACHE);
                bTransformCacheConstraint *data = 
static_cast<bTransformCacheConstraint *>(con->data);
                data->cache_file = m_settings->cache_file;
-               BLI_strncpy(data->abc_object_path, 
m_iobject.getFullName().c_str(), 1024);
+               BLI_strncpy(data->abc_object_path, 
m_iobject.getFullName().c_str(), FILE_MAX);
                data->scale = m_settings->scale;
        }
 }
@@ -415,7 +416,7 @@ void AbcObjectReader::addDefaultModifier(Main *bmain) const
        MeshSeqCacheModifierData *mcmd = 
reinterpret_cast<MeshSeqCacheModifierData *>(md);
 
        mcmd->cache_file = m_settings->cache_file;
-       BLI_strncpy(mcmd->abc_object_path, m_iobject.getFullName().c_str(), 
1024);
+       BLI_strncpy(mcmd->abc_object_path, m_iobject.getFullName().c_str(), 
FILE_MAX);
 
        DAG_id_tag_update(&m_object->id, OB_RECALC_DATA);
        DAG_relations_tag_update(bmain);
diff --git a/source/blender/makesdna/DNA_cachefile_types.h 
b/source/blender/makesdna/DNA_cachefile_types.h
index 95065db..2899cad 100644
--- a/source/blender/makesdna/DNA_cachefile_types.h
+++ b/source/blender/makesdna/DNA_cachefile_types.h
@@ -39,7 +39,7 @@ extern "C" {
 typedef struct CacheFile {
        ID id;
 
-       char filepath[1024];
+       char filepath[1024];  /* 1024 = FILE_MAX */
        char is_sequence;
        char pad[7];
 } CacheFile;
diff --git a/source/blender/makesdna/DNA_modifier_types.h 
b/source/blender/makesdna/DNA_modifier_types.h
index 16861d0..747978f 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -1550,7 +1550,7 @@ typedef struct MeshSeqCacheModifierData {
        ModifierData modifier;
 
        struct CacheFile *cache_file;
-       char abc_object_path[1024];
+       char abc_object_path[1024];  /* 1024 = FILE_MAX */
 } MeshSeqCacheModifierData;
 
 #endif  /* __DNA_MODIFIER_TYPES_H__ */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to