[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42386] trunk/blender/source/blender: add define for deprecated DNA struct members: DNA_DEPRECATED,
Campbell Barton
ideasman42 at gmail.com
Sun Dec 4 07:05:49 CET 2011
Revision: 42386
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42386
Author: campbellbarton
Date: 2011-12-04 06:05:48 +0000 (Sun, 04 Dec 2011)
Log Message:
-----------
add define for deprecated DNA struct members: DNA_DEPRECATED,
this means use of deprecated struct members gives a warning.
- makesdna.c preprocessor skips this.
- DNA_DEPRECATED_ALLOW is used so readfile.c can do versioning without warnings.
- this exposes some use of deprecated struct members, will deal with this after.
Modified Paths:
--------------
trunk/blender/source/blender/CMakeLists.txt
trunk/blender/source/blender/blenkernel/intern/ipo.c
trunk/blender/source/blender/blenkernel/intern/multires.c
trunk/blender/source/blender/blenloader/intern/readfile.c
trunk/blender/source/blender/editors/metaball/mball_edit.c
trunk/blender/source/blender/makesdna/DNA_action_types.h
trunk/blender/source/blender/makesdna/DNA_camera_types.h
trunk/blender/source/blender/makesdna/DNA_constraint_types.h
trunk/blender/source/blender/makesdna/DNA_curve_types.h
trunk/blender/source/blender/makesdna/DNA_key_types.h
trunk/blender/source/blender/makesdna/DNA_lamp_types.h
trunk/blender/source/blender/makesdna/DNA_lattice_types.h
trunk/blender/source/blender/makesdna/DNA_material_types.h
trunk/blender/source/blender/makesdna/DNA_mesh_types.h
trunk/blender/source/blender/makesdna/DNA_meta_types.h
trunk/blender/source/blender/makesdna/DNA_modifier_types.h
trunk/blender/source/blender/makesdna/DNA_node_types.h
trunk/blender/source/blender/makesdna/DNA_object_types.h
trunk/blender/source/blender/makesdna/DNA_particle_types.h
trunk/blender/source/blender/makesdna/DNA_scene_types.h
trunk/blender/source/blender/makesdna/DNA_sequence_types.h
trunk/blender/source/blender/makesdna/DNA_space_types.h
trunk/blender/source/blender/makesdna/DNA_texture_types.h
trunk/blender/source/blender/makesdna/DNA_userdef_types.h
trunk/blender/source/blender/makesdna/DNA_view3d_types.h
trunk/blender/source/blender/makesdna/DNA_world_types.h
trunk/blender/source/blender/makesdna/intern/makesdna.c
Added Paths:
-----------
trunk/blender/source/blender/makesdna/DNA_defs.h
Modified: trunk/blender/source/blender/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/CMakeLists.txt 2011-12-04 06:02:09 UTC (rev 42385)
+++ trunk/blender/source/blender/CMakeLists.txt 2011-12-04 06:05:48 UTC (rev 42386)
@@ -38,6 +38,7 @@
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_controller_types.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_curve_types.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_customdata_types.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_defs.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_documentation.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_dynamicpaint_types.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_effect_types.h
Modified: trunk/blender/source/blender/blenkernel/intern/ipo.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/ipo.c 2011-12-04 06:02:09 UTC (rev 42385)
+++ trunk/blender/source/blender/blenkernel/intern/ipo.c 2011-12-04 06:05:48 UTC (rev 42386)
@@ -43,7 +43,8 @@
#include <string.h>
#include <stddef.h>
-#include "MEM_guardedalloc.h"
+/* since we have versioning code here */
+#define DNA_DEPRECATED_ALLOW
#include "DNA_anim_types.h"
#include "DNA_constraint_types.h"
@@ -73,6 +74,7 @@
#include "BKE_nla.h"
#include "BKE_sequencer.h"
+#include "MEM_guardedalloc.h"
/* *************************************************** */
/* Old-Data Freeing Tools */
Modified: trunk/blender/source/blender/blenkernel/intern/multires.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/multires.c 2011-12-04 06:02:09 UTC (rev 42385)
+++ trunk/blender/source/blender/blenkernel/intern/multires.c 2011-12-04 06:05:48 UTC (rev 42386)
@@ -32,6 +32,9 @@
#include "MEM_guardedalloc.h"
+/* for reading old multires */
+#define DNA_DEPRECATED_ALLOW
+
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c 2011-12-04 06:02:09 UTC (rev 42385)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c 2011-12-04 06:05:48 UTC (rev 42386)
@@ -48,6 +48,9 @@
#include "BLI_winstuff.h"
#endif
+/* allow readfile to use deprecated functionality */
+#define DNA_DEPRECATED_ALLOW
+
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_actuator_types.h"
Modified: trunk/blender/source/blender/editors/metaball/mball_edit.c
===================================================================
--- trunk/blender/source/blender/editors/metaball/mball_edit.c 2011-12-04 06:02:09 UTC (rev 42385)
+++ trunk/blender/source/blender/editors/metaball/mball_edit.c 2011-12-04 06:05:48 UTC (rev 42386)
@@ -40,6 +40,7 @@
#include "BLI_rand.h"
#include "BLI_utildefines.h"
+#include "DNA_defs.h"
#include "DNA_meta_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
Modified: trunk/blender/source/blender/makesdna/DNA_action_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_action_types.h 2011-12-04 06:02:09 UTC (rev 42385)
+++ trunk/blender/source/blender/makesdna/DNA_action_types.h 2011-12-04 06:05:48 UTC (rev 42386)
@@ -582,7 +582,7 @@
short blockhandler[8];
- View2D v2d; /* depricated, copied to region */
+ View2D v2d DNA_DEPRECATED; /* copied to region */
bAction *action; /* the currently active action */
bDopeSheet ads; /* the currently active context (when not showing action) */
Modified: trunk/blender/source/blender/makesdna/DNA_camera_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_camera_types.h 2011-12-04 06:02:09 UTC (rev 42385)
+++ trunk/blender/source/blender/makesdna/DNA_camera_types.h 2011-12-04 06:05:48 UTC (rev 42386)
@@ -31,6 +31,8 @@
* \ingroup DNA
*/
+#include "DNA_defs.h"
+
#include "DNA_ID.h"
#ifdef __cplusplus
@@ -59,7 +61,7 @@
The name was not changed so that no other files need to be modified */
float YF_dofdist;
- struct Ipo *ipo; // XXX depreceated... old animation system
+ struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
struct Object *dof_ob;
Modified: trunk/blender/source/blender/makesdna/DNA_constraint_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_constraint_types.h 2011-12-04 06:02:09 UTC (rev 42385)
+++ trunk/blender/source/blender/makesdna/DNA_constraint_types.h 2011-12-04 06:05:48 UTC (rev 42386)
@@ -33,6 +33,7 @@
* \ingroup DNA
*/
+#include "DNA_defs.h"
#include "DNA_ID.h"
#include "DNA_listBase.h"
@@ -66,7 +67,7 @@
float headtail; /* Point along subtarget bone where the actual target is. 0=head (default for all), 1=tail*/
int pad;
- struct Ipo *ipo; /* local influence ipo or driver */ // XXX depreceated for 2.5... old animation system hack
+ struct Ipo *ipo DNA_DEPRECATED; /* local influence ipo or driver */ /* old animation system, deprecated for 2.5 */
/* below are readonly fields that are set at runtime by the solver for use in the GE (only IK atm) */
float lin_error; /* residual error on constraint expressed in blender unit*/
Modified: trunk/blender/source/blender/makesdna/DNA_curve_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_curve_types.h 2011-12-04 06:02:09 UTC (rev 42385)
+++ trunk/blender/source/blender/makesdna/DNA_curve_types.h 2011-12-04 06:05:48 UTC (rev 42386)
@@ -31,6 +31,7 @@
* \ingroup DNA
*/
+#include "DNA_defs.h"
#include "DNA_listBase.h"
#include "DNA_vec_types.h"
#include "DNA_ID.h"
@@ -174,7 +175,7 @@
EditNurb *editnurb; /* edited data, not in file, use pointer so we can check for it */
struct Object *bevobj, *taperobj, *textoncurve;
- struct Ipo *ipo; // XXX depreceated... old animation system
+ struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
Path *path;
struct Key *key;
struct Material **mat;
Added: trunk/blender/source/blender/makesdna/DNA_defs.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_defs.h (rev 0)
+++ trunk/blender/source/blender/makesdna/DNA_defs.h 2011-12-04 06:05:48 UTC (rev 42386)
@@ -0,0 +1,45 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef DNA_DEFS_H
+#define DNA_DEFS_H
+
+/** \file DNA_defs.h
+ * \ingroup DNA
+ */
+
+/* makesdna ignores */
+#ifdef DNA_DEPRECATED_ALLOW
+ /* allow use of deprecated items */
+# define DNA_DEPRECATED
+#else
+# ifndef DNA_DEPRECATED
+# ifdef __GNUC__
+# define DNA_DEPRECATED __attribute__ ((deprecated))
+# else
+ /* TODO, msvc & others */
+# define DNA_DEPRECATED
+# endif
+# endif
+#endif
+
+#endif /* DNA_DEFS_H */
Modified: trunk/blender/source/blender/makesdna/DNA_key_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_key_types.h 2011-12-04 06:02:09 UTC (rev 42385)
+++ trunk/blender/source/blender/makesdna/DNA_key_types.h 2011-12-04 06:05:48 UTC (rev 42386)
@@ -31,6 +31,7 @@
* \ingroup DNA
*/
+#include "DNA_defs.h"
#include "DNA_listBase.h"
#include "DNA_ID.h"
@@ -62,10 +63,10 @@
KeyBlock *refkey;
char elemstr[32];
int elemsize;
- float curval;
+ float curval DNA_DEPRECATED;
ListBase block;
- struct Ipo *ipo; // XXX depreceated... old animation system
+ struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
ID *from;
@@ -93,4 +94,3 @@
#define KEYBLOCK_LOCKED (1<<2)
#endif
-
Modified: trunk/blender/source/blender/makesdna/DNA_lamp_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_lamp_types.h 2011-12-04 06:02:09 UTC (rev 42385)
+++ trunk/blender/source/blender/makesdna/DNA_lamp_types.h 2011-12-04 06:05:48 UTC (rev 42386)
@@ -31,6 +31,7 @@
* \ingroup DNA
*/
+#include "DNA_defs.h"
#include "DNA_ID.h"
#ifndef MAX_MTEX
@@ -97,7 +98,7 @@
short sky_colorspace;
char pad4[6];
- struct Ipo *ipo; // XXX depreceated... old animation system
+ struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
struct MTex *mtex[18]; /* MAX_MTEX */
short pr_texture, use_nodes;
char pad6[4];
Modified: trunk/blender/source/blender/makesdna/DNA_lattice_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_lattice_types.h 2011-12-04 06:02:09 UTC (rev 42385)
+++ trunk/blender/source/blender/makesdna/DNA_lattice_types.h 2011-12-04 06:05:48 UTC (rev 42386)
@@ -31,6 +31,7 @@
* \ingroup DNA
*/
+#include "DNA_defs.h"
#include "DNA_ID.h"
struct AnimData;
@@ -60,7 +61,7 @@
struct BPoint *def;
- struct Ipo *ipo; /* XXX: depreceated... old animation system */
+ struct Ipo *ipo DNA_DEPRECATED; /* old animation system, deprecated for 2.5 */
struct Key *key;
struct MDeformVert *dvert;
Modified: trunk/blender/source/blender/makesdna/DNA_material_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_material_types.h 2011-12-04 06:02:09 UTC (rev 42385)
+++ trunk/blender/source/blender/makesdna/DNA_material_types.h 2011-12-04 06:05:48 UTC (rev 42386)
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list