diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-03-25 12:20:19 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-03-25 12:20:19 +0400 |
commit | 3b711a6ed009b35bb69cd0ca878eeb8d55fa0e77 (patch) | |
tree | b3fdb366cb49bdea5b57dfa6ba4a82635c68d0ee /source/blender/makesdna | |
parent | a2ebfc82dbe954acc432ae017ac62a30a11b6a16 (diff) | |
parent | e99a23fc6b33b5097eab44aac19c2a089ddebce6 (diff) |
Merged changes in the trunk up to revision 45133.
Conflicts resolved:
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/intern/bmesh_mesh_conv.c
source/blender/bmesh/intern/bmesh_mesh_conv.h
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/bmesh_select.c
source/blender/editors/mesh/bmesh_tools.c
source/blender/editors/space_view3d/drawobject.c
source/blender/render/intern/source/shadeoutput.c
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_action_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_anim_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_armature_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_brush_types.h | 107 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_customdata_types.h | 8 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_material_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_mesh_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_meshdata_types.h | 31 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_object_force.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_particle_types.h | 12 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_sequence_types.h | 29 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 10 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_windowmanager_types.h | 6 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_world_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/intern/dna_genfile.c | 252 | ||||
-rw-r--r-- | source/blender/makesdna/intern/makesdna.c | 192 |
18 files changed, 369 insertions, 302 deletions
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 6abda1f711b..f495b1b4336 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -226,7 +226,7 @@ typedef struct bPoseChannel { float pose_head[3]; /* actually pose_mat[3] */ float pose_tail[3]; /* also used for drawing help lines... */ - float limitmin[3], limitmax[3]; /* DOF constraint */ + float limitmin[3], limitmax[3]; /* DOF constraint, note! - these are stored in degrees, not radians */ float stiffness[3]; /* DOF stiffness */ float ikstretch; float ikrotweight; /* weight of joint rotation constraint */ @@ -511,7 +511,7 @@ typedef enum eAction_Flags { /* Storage for Dopesheet/Grease-Pencil Editor data */ typedef struct bDopeSheet { ID *source; /* currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil) */ - ListBase chanbase; /* cache for channels (only initialised when pinned) */ // XXX not used! + ListBase chanbase; /* cache for channels (only initialized when pinned) */ // XXX not used! struct Group *filter_grp; /* object group for ADS_FILTER_ONLYOBGROUP filtering option */ char searchstr[64]; /* string to search for in displayed names of F-Curves for ADS_FILTER_BY_FCU_NAME filtering option */ diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index c68592e525c..fd4b86a4155 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -373,7 +373,7 @@ typedef struct ChannelDriver { * which relates the target 'variables' in some way to yield a single usable value */ char expression[256]; /* expression to compile for evaluation */ - void *expr_comp; /* PyObject - compiled expression, dont save this */ + void *expr_comp; /* PyObject - compiled expression, don't save this */ float curval; /* result of previous evaluation */ float influence; /* influence of driver on result */ // XXX to be implemented... this is like the constraint influence setting @@ -408,7 +408,7 @@ typedef enum eDriver_Flags { //DRIVER_FLAG_LAYERING = (1<<2), /* use when the expression needs to be recompiled */ DRIVER_FLAG_RECOMPILE = (1<<3), - /* the names are cached so they dont need have python unicode versions created each time */ + /* the names are cached so they don't need have python unicode versions created each time */ DRIVER_FLAG_RENAMEVAR = (1<<4), /* intermediate values of driver should be shown in the UI for debugging purposes */ DRIVER_FLAG_SHOWDEBUG = (1<<5) diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h index b8b1f7d8b70..8b254b3b044 100644 --- a/source/blender/makesdna/DNA_armature_types.h +++ b/source/blender/makesdna/DNA_armature_types.h @@ -113,7 +113,7 @@ typedef struct bArmature { } bArmature; /* armature->flag */ -/* dont use bit 7, was saved in files to disable stuff */ +/* don't use bit 7, was saved in files to disable stuff */ typedef enum eArmature_Flag { ARM_RESTPOS = (1<<0), ARM_DRAWXRAY = (1<<1), /* XRAY is here only for backwards converting */ diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 9fb24199571..0d06b55f1d3 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -102,58 +102,65 @@ typedef struct Brush { } Brush; /* Brush.flag */ -#define BRUSH_AIRBRUSH (1<<0) -#define BRUSH_TORUS (1<<1) -#define BRUSH_ALPHA_PRESSURE (1<<2) -#define BRUSH_SIZE_PRESSURE (1<<3) -#define BRUSH_JITTER_PRESSURE (1<<4) /* was BRUSH_RAD_PRESSURE */ -#define BRUSH_SPACING_PRESSURE (1<<5) -#define BRUSH_FIXED_TEX (1<<6) -#define BRUSH_RAKE (1<<7) -#define BRUSH_ANCHORED (1<<8) -#define BRUSH_DIR_IN (1<<9) -#define BRUSH_SPACE (1<<10) -#define BRUSH_SMOOTH_STROKE (1<<11) -#define BRUSH_PERSISTENT (1<<12) -#define BRUSH_ACCUMULATE (1<<13) -#define BRUSH_LOCK_ALPHA (1<<14) -#define BRUSH_ORIGINAL_NORMAL (1<<15) -#define BRUSH_OFFSET_PRESSURE (1<<16) -#define BRUSH_SPACE_ATTEN (1<<18) -#define BRUSH_ADAPTIVE_SPACE (1<<19) -#define BRUSH_LOCK_SIZE (1<<20) -#define BRUSH_TEXTURE_OVERLAY (1<<21) -#define BRUSH_EDGE_TO_EDGE (1<<22) -#define BRUSH_RESTORE_MESH (1<<23) -#define BRUSH_INVERSE_SMOOTH_PRESSURE (1<<24) -#define BRUSH_RANDOM_ROTATION (1<<25) -#define BRUSH_PLANE_TRIM (1<<26) -#define BRUSH_FRONTFACE (1<<27) -#define BRUSH_CUSTOM_ICON (1<<28) - -/* temporary flag which sets up automatically for correct - * brush drawing when inverted modal operator is running */ -#define BRUSH_INVERTED (1<<29) +typedef enum BrushFlags { + BRUSH_AIRBRUSH = (1<<0), + BRUSH_TORUS = (1<<1), + BRUSH_ALPHA_PRESSURE = (1<<2), + BRUSH_SIZE_PRESSURE = (1<<3), + BRUSH_JITTER_PRESSURE = (1<<4), + BRUSH_SPACING_PRESSURE = (1<<5), + BRUSH_FIXED_TEX = (1<<6), + BRUSH_RAKE = (1<<7), + BRUSH_ANCHORED = (1<<8), + BRUSH_DIR_IN = (1<<9), + BRUSH_SPACE = (1<<10), + BRUSH_SMOOTH_STROKE = (1<<11), + BRUSH_PERSISTENT = (1<<12), + BRUSH_ACCUMULATE = (1<<13), + BRUSH_LOCK_ALPHA = (1<<14), + BRUSH_ORIGINAL_NORMAL = (1<<15), + BRUSH_OFFSET_PRESSURE = (1<<16), + BRUSH_SPACE_ATTEN = (1<<18), + BRUSH_ADAPTIVE_SPACE = (1<<19), + BRUSH_LOCK_SIZE = (1<<20), + BRUSH_TEXTURE_OVERLAY = (1<<21), + BRUSH_EDGE_TO_EDGE = (1<<22), + BRUSH_RESTORE_MESH = (1<<23), + BRUSH_INVERSE_SMOOTH_PRESSURE = (1<<24), + BRUSH_RANDOM_ROTATION = (1<<25), + BRUSH_PLANE_TRIM = (1<<26), + BRUSH_FRONTFACE = (1<<27), + BRUSH_CUSTOM_ICON = (1<<28), + + /* temporary flag which sets up automatically for correct brush + * drawing when inverted modal operator is running */ + BRUSH_INVERTED = (1<<29) +} BrushFlags; /* Brush.sculpt_tool */ -#define SCULPT_TOOL_DRAW 1 -#define SCULPT_TOOL_SMOOTH 2 -#define SCULPT_TOOL_PINCH 3 -#define SCULPT_TOOL_INFLATE 4 -#define SCULPT_TOOL_GRAB 5 -#define SCULPT_TOOL_LAYER 6 -#define SCULPT_TOOL_FLATTEN 7 -#define SCULPT_TOOL_CLAY 8 -#define SCULPT_TOOL_FILL 9 -#define SCULPT_TOOL_SCRAPE 10 -#define SCULPT_TOOL_NUDGE 11 -#define SCULPT_TOOL_THUMB 12 -#define SCULPT_TOOL_SNAKE_HOOK 13 -#define SCULPT_TOOL_ROTATE 14 -//#define SCULPT_TOOL_WAX 15 // XXX: reuse this slot later -#define SCULPT_TOOL_CREASE 16 -#define SCULPT_TOOL_BLOB 17 -#define SCULPT_TOOL_CLAY_TUBES 18 +typedef enum BrushSculptTool { + SCULPT_TOOL_DRAW = 1, + SCULPT_TOOL_SMOOTH = 2, + SCULPT_TOOL_PINCH = 3, + SCULPT_TOOL_INFLATE = 4, + SCULPT_TOOL_GRAB = 5, + SCULPT_TOOL_LAYER = 6, + SCULPT_TOOL_FLATTEN = 7, + SCULPT_TOOL_CLAY = 8, + SCULPT_TOOL_FILL = 9, + SCULPT_TOOL_SCRAPE = 10, + SCULPT_TOOL_NUDGE = 11, + SCULPT_TOOL_THUMB = 12, + SCULPT_TOOL_SNAKE_HOOK = 13, + SCULPT_TOOL_ROTATE = 14, + + /* slot 15 is free for use */ + /* SCULPT_TOOL_ = 15, */ + + SCULPT_TOOL_CREASE = 16, + SCULPT_TOOL_BLOB = 17, + SCULPT_TOOL_CLAY_STRIPS = 18 +} BrushSculptTool; /* ImagePaintSettings.tool */ #define PAINT_TOOL_DRAW 0 diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index 2a8c4c3a74e..9898f9715a0 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -94,7 +94,7 @@ typedef struct CustomData { #define CD_MLOOPCOL 17 #define CD_TANGENT 18 #define CD_MDISPS 19 -#define CD_WEIGHT_MCOL 20 /* for displaying weightpaint colors */ +#define CD_PREVIEW_MCOL 20 /* for displaying weightpaint colors */ #define CD_ID_MCOL 21 #define CD_TEXTURE_MCOL 22 #define CD_CLOTH_ORCO 23 @@ -108,7 +108,7 @@ typedef struct CustomData { #define CD_BWEIGHT 29 #define CD_CREASE 30 #define CD_ORIGSPACE_MLOOP 31 -#define CD_WEIGHT_MLOOPCOL 32 +#define CD_PREVIEW_MLOOPCOL 32 #define CD_BM_ELEM_PYPTR 33 /* BMESH ONLY END */ @@ -135,7 +135,7 @@ typedef struct CustomData { #define CD_MASK_MLOOPCOL (1 << CD_MLOOPCOL) #define CD_MASK_TANGENT (1 << CD_TANGENT) #define CD_MASK_MDISPS (1 << CD_MDISPS) -#define CD_MASK_WEIGHT_MCOL (1 << CD_WEIGHT_MCOL) +#define CD_MASK_PREVIEW_MCOL (1 << CD_PREVIEW_MCOL) #define CD_MASK_CLOTH_ORCO (1 << CD_CLOTH_ORCO) #define CD_MASK_RECAST (1 << CD_RECAST) @@ -147,7 +147,7 @@ typedef struct CustomData { #define CD_MASK_BWEIGHT (1 << CD_BWEIGHT) #define CD_MASK_CREASE (1 << CD_CREASE) #define CD_MASK_ORIGSPACE_MLOOP (1 << CD_ORIGSPACE_MLOOP) -#define CD_MASK_WEIGHT_MLOOPCOL (1LL << CD_WEIGHT_MLOOPCOL) +#define CD_MASK_PREVIEW_MLOOPCOL (1LL << CD_PREVIEW_MLOOPCOL) #define CD_MASK_BM_ELEM_PYPTR (1LL << CD_BM_ELEM_PYPTR) /* BMESH ONLY END */ diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index 6f3014c0961..3de5372d848 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -132,7 +132,7 @@ typedef struct bGPdata { int flag; /* settings for this datablock */ /* not-saved stroke buffer data (only used during paint-session) - * - buffer must be initialised before use, but freed after + * - buffer must be initialized before use, but freed after * whole paint operation is over */ short sbuffer_size; /* number of elements currently in cache */ diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index e2c2870d305..6952f1a9da7 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -209,7 +209,7 @@ typedef struct Material { /* maximum number of materials per material array. * (on object, mesh, lamp, etc.). limited by * short mat_nr in verts, faces. - * -1 becayse for active material we store the index + 1 */ + * -1 because for active material we store the index + 1 */ #define MAXMAT (32767-1) /* material_type */ diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index 4c57cd211dd..eac6fc0d5e0 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -86,7 +86,7 @@ typedef struct Mesh { struct MEdge *medge; /* array of edges */ struct MDeformVert *dvert; /* deformgroup vertices */ - /* array of colors for the tesselated faces, must be number of tesselated + /* array of colors for the tessellated faces, must be number of tessellated * faces * 4 in length */ struct MCol *mcol; struct MSticky *msticky; diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index b4c0fa09047..77fd6df610c 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -122,9 +122,30 @@ typedef struct MLoopUV { /* at the moment alpha is abused for vertex painting * and not used for transparency, note that red and blue are swapped */ typedef struct MLoopCol { - char a, r, g, b; + char r, g, b, a; } MLoopCol; +#define MESH_MLOOPCOL_FROM_MCOL(_mloopcol, _mcol) \ +{ \ + MLoopCol *mloopcol__tmp = _mloopcol; \ + const MCol *mcol__tmp = _mcol; \ + mloopcol__tmp->r = mcol__tmp->b; \ + mloopcol__tmp->g = mcol__tmp->g; \ + mloopcol__tmp->b = mcol__tmp->r; \ + mloopcol__tmp->a = mcol__tmp->a; \ +} (void)0 + + +#define MESH_MLOOPCOL_TO_MCOL(_mloopcol, _mcol) \ +{ \ + const MLoopCol *mloopcol__tmp = _mloopcol; \ + MCol *mcol__tmp = _mcol; \ + mcol__tmp->b = mloopcol__tmp->r; \ + mcol__tmp->g = mloopcol__tmp->g; \ + mcol__tmp->r = mloopcol__tmp->b; \ + mcol__tmp->a = mloopcol__tmp->a; \ +} (void)0 + typedef struct MSticky { float co[2]; } MSticky; @@ -164,8 +185,14 @@ typedef struct OrigSpaceLoop { typedef struct MDisps { /* Strange bug in SDNA: if disps pointer comes first, it fails to see totdisp */ int totdisp; - char pad[4]; + int level; float (*disps)[3]; + + /* Used for hiding parts of a multires mesh. Essentially the multires + equivalent of MVert.flag's ME_HIDE bit. + + This is a bitmap, keep in sync with type used in BLI_bitmap.h */ + unsigned int *hidden; } MDisps; /** Multires structs kept for compatibility with old files **/ diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 0e70b5d28e3..6fefd2d672f 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -401,7 +401,7 @@ typedef struct SoftBody { #define PTCACHE_FRAMES_SKIPPED 256 #define PTCACHE_EXTERNAL 512 #define PTCACHE_READ_INFO 1024 -/* dont use the filename of the blendfile the data is linked from (write a local cache) */ +/* don't use the filename of the blendfile the data is linked from (write a local cache) */ #define PTCACHE_IGNORE_LIBPATH 2048 /* high resolution cache is saved for smoke for backwards compatibility, so set this flag to know it's a "fake" cache */ #define PTCACHE_FAKE_SMOKE (1<<12) diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 220ee69b442..63c4806028a 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -321,7 +321,7 @@ typedef struct ParticleSystem #define PART_TRAND 128 #define PART_EDISTR 256 /* particle/face from face areas */ -//#define PART_STICKY 512 /*collided particles can stick to collider*/ +#define PART_ROTATIONS 512 /* calculate particle rotations (and store them in pointcache) */ #define PART_DIE_ON_COL (1<<12) #define PART_SIZE_DEFL (1<<13) /* swept sphere deflections */ #define PART_ROT_DYN (1<<14) /* dynamic rotation */ @@ -463,8 +463,13 @@ typedef struct ParticleSystem #define PART_ROT_OB_Z 8 /* part->avemode */ -#define PART_AVE_SPIN 1 +#define PART_AVE_VELOCITY 1 #define PART_AVE_RAND 2 +#define PART_AVE_HORIZONTAL 3 +#define PART_AVE_VERTICAL 4 +#define PART_AVE_GLOBAL_X 5 +#define PART_AVE_GLOBAL_Y 6 +#define PART_AVE_GLOBAL_Z 7 /* part->reactevent */ #define PART_EVENT_DEATH 0 @@ -498,7 +503,8 @@ typedef struct ParticleSystem #define PSYS_KEYED 1024 #define PSYS_EDITED 2048 //#define PSYS_PROTECT_CACHE 4096 /* deprecated */ -#define PSYS_DISABLED 8192 +#define PSYS_DISABLED 8192 +#define PSYS_OB_ANIM_RESTORE 16384 /* runtime flag */ /* pars->flag */ #define PARS_UNEXIST 1 diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h index cff4e539e6e..ba64f332de5 100644 --- a/source/blender/makesdna/DNA_sequence_types.h +++ b/source/blender/makesdna/DNA_sequence_types.h @@ -40,6 +40,7 @@ struct Ipo; struct Scene; struct bSound; +struct MovieClip; /* strlens; 256= FILE_MAXFILE, 768= FILE_MAXDIR */ @@ -88,9 +89,11 @@ typedef struct StripProxy { typedef struct Strip { struct Strip *next, *prev; - int rt, len, us, done; + int us, done; int startstill, endstill; - StripElem *stripdata; + StripElem *stripdata; /* only used as an array in IMAGE sequences(!), + and as a 1-element array in MOVIE sequences, + NULL for all other strip-types */ char dir[768]; StripProxy *proxy; StripCrop *crop; @@ -137,10 +140,11 @@ typedef struct Sequence { int startdisp, enddisp; /*starting and ending points in the sequence*/ float sat; float mul, handsize; - /* is sfra needed anymore? - it looks like its only used in one place */ - int sfra; /* starting frame according to the timeline of the scene. */ - int anim_preseek; - int streamindex; /* streamindex for movie or sound files with several streams */ + + short anim_preseek; + short streamindex; /* streamindex for movie or sound files with several streams */ + int multicam_source; /* for multicam source selection */ + int clip_flag; /* MOVIECLIP render flags */ Strip *strip; @@ -148,7 +152,9 @@ typedef struct Sequence { struct Scene *scene; struct Object *scene_camera; /* override scene camera */ - struct anim *anim; + struct anim *anim; /* for MOVIE strips */ + struct MovieClip *clip; /* for MOVIECLIP strips */ + float effect_fader; float speed_fader; @@ -164,8 +170,6 @@ typedef struct Sequence { float volume; float pitch, pan; /* pitch (-0.1..10), pan -2..2 */ - int scenenr; /* for scene selection */ - int multicam_source; /* for multicam source selection */ float strobe; void *effectdata; /* Struct pointer for effect settings */ @@ -173,6 +177,7 @@ typedef struct Sequence { int anim_startofs; /* only use part of animation file */ int anim_endofs; /* is subtle different to startofs / endofs */ + int blend_mode; float blend_opacity; @@ -292,7 +297,7 @@ typedef struct SpeedControlVars { /* convenience define for all selection flags */ #define SEQ_ALLSEL (SELECT+SEQ_LEFTSEL+SEQ_RIGHTSEL) -/* deprecated, dont use a flag anymore*/ +/* deprecated, don't use a flag anymore*/ /*#define SEQ_ACTIVE 1048576*/ #define SEQ_COLOR_BALANCE_INVERSE_GAIN 1 @@ -321,6 +326,7 @@ typedef struct SpeedControlVars { #define SEQ_RAM_SOUND 4 #define SEQ_HD_SOUND 5 #define SEQ_SOUND 4 +#define SEQ_MOVIECLIP 6 #define SEQ_EFFECT 8 #define SEQ_CROSS 8 @@ -346,6 +352,9 @@ typedef struct SpeedControlVars { #define STRIPELEM_PREVIEW_DONE 1 +#define SEQ_MOVIECLIP_RENDER_UNDISTORTED (1<<0) +#define SEQ_MOVIECLIP_RENDER_STABILIZED (1<<1) + #define SEQ_BLEND_REPLACE 0 /* all other BLEND_MODEs are simple SEQ_EFFECT ids and therefore identical * to the table above. (Only those effects that handle _exactly_ two inputs, diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 128c1422ed6..cd17d464fd5 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -635,7 +635,7 @@ enum FileSortTypeE { /* filesel types */ #define FILE_UNIX 8 -#define FILE_BLENDER 8 /* dont display relative paths */ +#define FILE_BLENDER 8 /* don't display relative paths */ #define FILE_SPECIAL 9 #define FILE_LOADLIB 1 @@ -693,7 +693,7 @@ enum FileSortTypeE { /* SpaceImage->sticky * Note DISABLE should be 0, however would also need to re-arrange icon order, - * also, sticky loc is the default mode so this means we dont need to 'do_versons' */ + * also, sticky loc is the default mode so this means we don't need to 'do_versons' */ #define SI_STICKY_LOC 0 #define SI_STICKY_DISABLE 1 #define SI_STICKY_VERTEX 2 diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 1db858b2741..636a3ea97e7 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -151,7 +151,7 @@ typedef struct ThemeUI { uiWidgetColors wcol_regular, wcol_tool, wcol_text; uiWidgetColors wcol_radio, wcol_option, wcol_toggle; uiWidgetColors wcol_num, wcol_numslider; - uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item; + uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item, wcol_tooltip; uiWidgetColors wcol_box, wcol_scroll, wcol_progress, wcol_list_item; uiWidgetStateColors wcol_state; @@ -205,7 +205,7 @@ typedef struct ThemeSpace { char grid[4]; char wire[4], select[4]; - char lamp[4], speaker[4], pad2[4]; + char lamp[4], speaker[4], empty[4],camera[4], pad[8]; char active[4], group[4], group_active[4], transform[4]; char vertex[4], vertex_select[4]; char edge[4], edge_select[4]; @@ -237,7 +237,7 @@ typedef struct ThemeSpace { char syntaxl[4], syntaxn[4], syntaxb[4]; // syntax for textwindow and nodes char syntaxv[4], syntaxc[4]; - char movie[4], image[4], scene[4], audio[4]; // for sequence editor + char movie[4], movieclip[4], image[4], scene[4], audio[4]; // for sequence editor char effect[4], plugin[4], transition[4], meta[4]; char editmesh_active[4]; @@ -423,6 +423,9 @@ typedef struct UserDef { int compute_device_type; int compute_device_id; + + float fcu_inactive_alpha; /* opacity of inactive F-Curves in F-Curve Editor */ + float pad; } UserDef; extern UserDef U; /* from blenkernel blender.c */ @@ -511,6 +514,7 @@ extern UserDef U; /* from blenkernel blender.c */ #define USER_SPLASH_DISABLE (1 << 27) #define USER_HIDE_RECENT (1 << 28) #define USER_SHOW_THUMBNAILS (1 << 29) +#define USER_QUIT_PROMPT (1 << 30) /* Auto-Keying mode */ /* AUTOKEY_ON is a bitflag */ diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index cdb6d8d053c..c86d9d17b1f 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -85,7 +85,7 @@ enum ReportListFlags { RPT_PRINT = 1, RPT_STORE = 2, RPT_FREE = 4, - RPT_OP_HOLD = 8 /* dont move them into the operator global list (caller will use) */ + RPT_OP_HOLD = 8 /* don't move them into the operator global list (caller will use) */ }; # # @@ -98,7 +98,7 @@ typedef struct Report { const char *message; } Report; -/* saved in the wm, dont remove */ +/* saved in the wm, don't remove */ typedef struct ReportList { ListBase list; int printlevel; /* ReportType */ @@ -159,7 +159,7 @@ typedef struct wmWindowManager { typedef struct wmWindow { struct wmWindow *next, *prev; - void *ghostwin; /* dont want to include ghost.h stuff */ + void *ghostwin; /* don't want to include ghost.h stuff */ int winid; /* winid also in screens, is for retrieving this window after read */ diff --git a/source/blender/makesdna/DNA_world_types.h b/source/blender/makesdna/DNA_world_types.h index 5482566ac41..b3c10406d4c 100644 --- a/source/blender/makesdna/DNA_world_types.h +++ b/source/blender/makesdna/DNA_world_types.h @@ -66,7 +66,7 @@ typedef struct World { /** * Exposure= mult factor. unused now, but maybe back later. Kept in to be upward compat. * New is exp/range control. linfac & logfac are constants... don't belong in - * file, but allocating 8 bytes for temp mem isnt useful either. + * file, but allocating 8 bytes for temp mem isn't useful either. */ float exposure, exp, range; float linfac, logfac; diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 2148bc96c04..5e4c244dbc2 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -178,11 +178,11 @@ int DNA_elem_array_size(const char *astr, int len) memcpy(str, astr, len+1); - for(a=0; a<len; a++) { - if( str[a]== '[' ) { + for (a=0; a<len; a++) { + if ( str[a]== '[' ) { cp= &(str[a+1]); } - else if( str[a]==']' && cp) { + else if ( str[a]==']' && cp) { str[a]= 0; mul*= atoi(cp); } @@ -226,17 +226,17 @@ static int elementsize(SDNA *sdna, short type, short name) namelen= strlen(cp); /* is it a pointer or function pointer? */ - if(ispointer(cp)) { + if (ispointer(cp)) { /* has the naam an extra length? (array) */ mul= 1; - if( cp[namelen-1]==']') mul= DNA_elem_array_size(cp, namelen); + if ( cp[namelen-1]==']') mul= DNA_elem_array_size(cp, namelen); len= sdna->pointerlen*mul; } - else if( sdna->typelens[type] ) { + else if ( sdna->typelens[type] ) { /* has the naam an extra length? (array) */ mul= 1; - if( cp[namelen-1]==']') mul= DNA_elem_array_size(cp, namelen); + if ( cp[namelen-1]==']') mul= DNA_elem_array_size(cp, namelen); len= mul*sdna->typelens[type]; @@ -258,7 +258,7 @@ static void printstruct(SDNA *sdna, short strnr) nr= sp[1]; sp+= 2; - for(b=0; b< nr; b++, sp+= 2) { + for (b=0; b< nr; b++, sp+= 2) { printf(" %s %s\n", sdna->types[sp[0]], sdna->names[sp[1]]); } } @@ -270,11 +270,11 @@ static short *findstruct_name(SDNA *sdna, const char *str) short *sp= NULL; - for(a=0; a<sdna->nr_structs; a++) { + for (a=0; a<sdna->nr_structs; a++) { sp= sdna->structs[a]; - if(strcmp( sdna->types[ sp[0] ], str )==0) return sp; + if (strcmp( sdna->types[ sp[0] ], str )==0) return sp; } return NULL; @@ -284,9 +284,9 @@ int DNA_struct_find_nr(SDNA *sdna, const char *str) { short *sp= NULL; - if(sdna->lastfind<sdna->nr_structs) { + if (sdna->lastfind<sdna->nr_structs) { sp= sdna->structs[sdna->lastfind]; - if(strcmp( sdna->types[ sp[0] ], str )==0) return sdna->lastfind; + if (strcmp( sdna->types[ sp[0] ], str )==0) return sdna->lastfind; } #ifdef WITH_DNA_GHASH @@ -295,11 +295,11 @@ int DNA_struct_find_nr(SDNA *sdna, const char *str) { int a; - for(a=0; a<sdna->nr_structs; a++) { + for (a=0; a<sdna->nr_structs; a++) { sp= sdna->structs[a]; - if(strcmp( sdna->types[ sp[0] ], str )==0) { + if (strcmp( sdna->types[ sp[0] ], str )==0) { sdna->lastfind= a; return a; } @@ -325,16 +325,16 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap) data= (int *)sdna->data; strcpy(str, "SDNA"); - if( *data == *verg ) { + if ( *data == *verg ) { data++; /* load names array */ strcpy(str, "NAME"); - if( *data == *verg ) { + if ( *data == *verg ) { data++; - if(do_endian_swap) sdna->nr_names= le_int(*data); + if (do_endian_swap) sdna->nr_names= le_int(*data); else sdna->nr_names= *data; data++; @@ -347,20 +347,20 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap) nr= 0; cp= (char *)data; - while(nr<sdna->nr_names) { + while (nr<sdna->nr_names) { sdna->names[nr]= cp; /* "float gravity [3]" was parsed wrong giving both "gravity" and * "[3]" members. we rename "[3]", and later set the type of * "gravity" to "void" so the offsets work out correct */ - if(*cp == '[' && strcmp(cp, "[3]")==0) { - if(nr && strcmp(sdna->names[nr-1], "Cvi") == 0) { + if (*cp == '[' && strcmp(cp, "[3]")==0) { + if (nr && strcmp(sdna->names[nr-1], "Cvi") == 0) { sdna->names[nr]= "gravity[3]"; gravity_fix= nr; } } - while( *cp) cp++; + while ( *cp) cp++; cp++; nr++; } @@ -371,10 +371,10 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap) /* load type names array */ data= (int *)cp; strcpy(str, "TYPE"); - if( *data == *verg ) { + if ( *data == *verg ) { data++; - if(do_endian_swap) sdna->nr_types= le_int(*data); + if (do_endian_swap) sdna->nr_types= le_int(*data); else sdna->nr_types= *data; data++; @@ -387,18 +387,18 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap) nr= 0; cp= (char *)data; - while(nr<sdna->nr_types) { + while (nr<sdna->nr_types) { sdna->types[nr]= cp; /* this is a patch, to change struct names without a conflict with SDNA */ /* be careful to use it, in this case for a system-struct (opengl/X) */ - if( *cp == 'b') { + if ( *cp == 'b') { /* struct Screen was already used by X, 'bScreen' replaces the old IrisGL 'Screen' struct */ - if( strcmp("bScreen", cp)==0 ) sdna->types[nr]= cp+1; + if ( strcmp("bScreen", cp)==0 ) sdna->types[nr]= cp+1; } - while( *cp) cp++; + while ( *cp) cp++; cp++; nr++; } @@ -409,16 +409,16 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap) /* load typelen array */ data= (int *)cp; strcpy(str, "TLEN"); - if( *data == *verg ) { + if ( *data == *verg ) { data++; sp= (short *)data; sdna->typelens= sp; - if(do_endian_swap) { + if (do_endian_swap) { short a, *spo= sp; a= sdna->nr_types; - while(a--) { + while (a--) { spo[0]= le_short(spo[0]); spo++; } @@ -430,15 +430,15 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap) printf("TLEN error in SDNA file\n"); return; } - if(sdna->nr_types & 1) sp++; /* prevent BUS error */ + if (sdna->nr_types & 1) sp++; /* prevent BUS error */ /* load struct array */ data= (int *)sp; strcpy(str, "STRC"); - if( *data == *verg ) { + if ( *data == *verg ) { data++; - if(do_endian_swap) sdna->nr_structs= le_int(*data); + if (do_endian_swap) sdna->nr_structs= le_int(*data); else sdna->nr_structs= *data; data++; @@ -451,10 +451,10 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap) nr= 0; sp= (short *)data; - while(nr<sdna->nr_structs) { + while (nr<sdna->nr_structs) { sdna->structs[nr]= sp; - if(do_endian_swap) { + if (do_endian_swap) { short a; sp[0]= le_short(sp[0]); @@ -462,7 +462,7 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap) a= sp[1]; sp+= 2; - while(a--) { + while (a--) { sp[0]= le_short(sp[0]); sp[1]= le_short(sp[1]); sp+= 2; @@ -481,17 +481,17 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap) sdna->pointerlen= sdna->typelens[ sp[0] ]/2; - if(sp[1]!=2 || (sdna->pointerlen!=4 && sdna->pointerlen!=8)) { + if (sp[1]!=2 || (sdna->pointerlen!=4 && sdna->pointerlen!=8)) { printf("ListBase struct error! Needs it to calculate pointerize.\n"); exit(0); /* well, at least sizeof(ListBase) is error proof! (ton) */ } /* second part of gravity problem, setting "gravity" type to void */ - if(gravity_fix > -1) { - for(nr=0; nr<sdna->nr_structs; nr++) { + if (gravity_fix > -1) { + for (nr=0; nr<sdna->nr_structs; nr++) { sp= sdna->structs[nr]; - if(strcmp(sdna->types[sp[0]], "ClothSimSettings") == 0) + if (strcmp(sdna->types[sp[0]], "ClothSimSettings") == 0) sp[10]= SDNA_TYPE_VOID; } } @@ -500,7 +500,7 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap) /* create a ghash lookup to speed up */ sdna->structs_map= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "init_structDNA gh"); - for(nr = 0; nr < sdna->nr_structs; nr++) { + for (nr = 0; nr < sdna->nr_structs; nr++) { sp= sdna->structs[nr]; BLI_ghash_insert(sdna->structs_map, (void *)sdna->types[sp[0]], (void *)(nr + 1)); } @@ -537,15 +537,15 @@ static void recurs_test_compflags(SDNA *sdna, char *compflags, int structnr) sp= sdna->structs[structnr]; typenr= sp[0]; - for(a=0; a<sdna->nr_structs; a++) { - if(a!=structnr && compflags[a]==1) { + for (a=0; a<sdna->nr_structs; a++) { + if (a!=structnr && compflags[a]==1) { sp= sdna->structs[a]; elems= sp[1]; sp+= 2; - for(b=0; b<elems; b++, sp+=2) { - if(sp[0]==typenr) { + for (b=0; b<elems; b++, sp+=2) { + if (sp[0]==typenr) { cp= sdna->names[ sp[1] ]; - if(!ispointer(cp)) { + if (!ispointer(cp)) { compflags[a]= 2; recurs_test_compflags(sdna, compflags, a); } @@ -578,7 +578,7 @@ char *DNA_struct_get_compareflags(SDNA *sdna, SDNA *newsdna) const char *str1, *str2; char *compflags; - if(sdna->nr_structs==0) { + if (sdna->nr_structs==0) { printf("error: file without SDNA\n"); return NULL; } @@ -589,42 +589,42 @@ char *DNA_struct_get_compareflags(SDNA *sdna, SDNA *newsdna) * the structs in 'newsdna' */ - for(a=0; a<sdna->nr_structs; a++) { + for (a=0; a<sdna->nr_structs; a++) { spold= sdna->structs[a]; /* search for type in cur */ spcur= findstruct_name(newsdna, sdna->types[spold[0]]); - if(spcur) { + if (spcur) { compflags[a]= 2; /* compare length and amount of elems */ - if( spcur[1] == spold[1]) { - if( newsdna->typelens[spcur[0]] == sdna->typelens[spold[0]] ) { + if ( spcur[1] == spold[1]) { + if ( newsdna->typelens[spcur[0]] == sdna->typelens[spold[0]] ) { /* same length, same amount of elems, now per type and name */ b= spold[1]; spold+= 2; spcur+= 2; - while(b > 0) { + while (b > 0) { str1= newsdna->types[spcur[0]]; str2= sdna->types[spold[0]]; - if(strcmp(str1, str2)!=0) break; + if (strcmp(str1, str2)!=0) break; str1= newsdna->names[spcur[1]]; str2= sdna->names[spold[1]]; - if(strcmp(str1, str2)!=0) break; + if (strcmp(str1, str2)!=0) break; /* same type and same name, now pointersize */ - if(ispointer(str1)) { - if(sdna->pointerlen!=newsdna->pointerlen) break; + if (ispointer(str1)) { + if (sdna->pointerlen!=newsdna->pointerlen) break; } b--; spold+= 2; spcur+= 2; } - if(b==0) compflags[a]= 1; + if (b==0) compflags[a]= 1; } } @@ -640,13 +640,13 @@ char *DNA_struct_get_compareflags(SDNA *sdna, SDNA *newsdna) /* Because structs can be inside structs, we recursively * set flags when a struct is altered */ - for(a=0; a<sdna->nr_structs; a++) { - if(compflags[a]==2) recurs_test_compflags(sdna, compflags, a); + for (a=0; a<sdna->nr_structs; a++) { + if (compflags[a]==2) recurs_test_compflags(sdna, compflags, a); } #if 0 - for(a=0; a<sdna->nr_structs; a++) { - if(compflags[a]==2) { + for (a=0; a<sdna->nr_structs; a++) { + if (compflags[a]==2) { spold= sdna->structs[a]; printf("changed: %s\n", sdna->types[ spold[0] ]); } @@ -659,16 +659,16 @@ char *DNA_struct_get_compareflags(SDNA *sdna, SDNA *newsdna) static eSDNA_Type sdna_type_nr(const char *dna_type) { if ((strcmp(dna_type, "char")==0) || (strcmp(dna_type, "const char")==0)) return SDNA_TYPE_CHAR; - else if((strcmp(dna_type, "uchar")==0) || (strcmp(dna_type, "unsigned char")==0)) return SDNA_TYPE_UCHAR; - else if( strcmp(dna_type, "short")==0) return SDNA_TYPE_SHORT; - else if((strcmp(dna_type, "ushort")==0)||(strcmp(dna_type, "unsigned short")==0)) return SDNA_TYPE_USHORT; - else if( strcmp(dna_type, "int")==0) return SDNA_TYPE_INT; - else if( strcmp(dna_type, "long")==0) return SDNA_TYPE_LONG; - else if((strcmp(dna_type, "ulong")==0)||(strcmp(dna_type, "unsigned long")==0)) return SDNA_TYPE_ULONG; - else if( strcmp(dna_type, "float")==0) return SDNA_TYPE_FLOAT; - else if( strcmp(dna_type, "double")==0) return SDNA_TYPE_DOUBLE; - else if( strcmp(dna_type, "int64_t")==0) return SDNA_TYPE_INT64; - else if( strcmp(dna_type, "uint64_t")==0) return SDNA_TYPE_UINT64; + else if ((strcmp(dna_type, "uchar")==0) || (strcmp(dna_type, "unsigned char")==0)) return SDNA_TYPE_UCHAR; + else if ( strcmp(dna_type, "short")==0) return SDNA_TYPE_SHORT; + else if ((strcmp(dna_type, "ushort")==0)||(strcmp(dna_type, "unsigned short")==0)) return SDNA_TYPE_USHORT; + else if ( strcmp(dna_type, "int")==0) return SDNA_TYPE_INT; + else if ( strcmp(dna_type, "long")==0) return SDNA_TYPE_LONG; + else if ((strcmp(dna_type, "ulong")==0)||(strcmp(dna_type, "unsigned long")==0)) return SDNA_TYPE_ULONG; + else if ( strcmp(dna_type, "float")==0) return SDNA_TYPE_FLOAT; + else if ( strcmp(dna_type, "double")==0) return SDNA_TYPE_DOUBLE; + else if ( strcmp(dna_type, "int64_t")==0) return SDNA_TYPE_INT64; + else if ( strcmp(dna_type, "uint64_t")==0) return SDNA_TYPE_UINT64; else return -1; /* invalid! */ } @@ -691,7 +691,7 @@ static void cast_elem(const char *ctype, const char *otype, const char *name, ch oldlen= DNA_elem_type_size(otypenr); curlen= DNA_elem_type_size(ctypenr); - while(arrlen>0) { + while (arrlen>0) { switch(otypenr) { case SDNA_TYPE_CHAR: val= *olddata; break; @@ -733,10 +733,10 @@ static void cast_elem(const char *ctype, const char *otype, const char *name, ch case SDNA_TYPE_ULONG: *( (unsigned int *)curdata)= val; break; case SDNA_TYPE_FLOAT: - if(otypenr<2) val/= 255; + if (otypenr<2) val/= 255; *( (float *)curdata)= val; break; case SDNA_TYPE_DOUBLE: - if(otypenr<2) val/= 255; + if (otypenr<2) val/= 255; *( (double *)curdata)= val; break; case SDNA_TYPE_INT64: *( (int64_t *)curdata)= val; break; @@ -761,12 +761,12 @@ static void cast_pointer(int curlen, int oldlen, const char *name, char *curdata arrlen= DNA_elem_array_size(name, strlen(name)); - while(arrlen>0) { + while (arrlen>0) { - if(curlen==oldlen) { + if (curlen==oldlen) { memcpy(curdata, olddata, curlen); } - else if(curlen==4 && oldlen==8) { + else if (curlen==4 && oldlen==8) { #ifdef WIN32 lval= *( (__int64 *)olddata ); #else @@ -774,7 +774,7 @@ static void cast_pointer(int curlen, int oldlen, const char *name, char *curdata #endif *((int *)curdata) = lval>>3; /* is of course gambling! */ } - else if(curlen==8 && oldlen==4) { + else if (curlen==8 && oldlen==4) { #ifdef WIN32 *( (__int64 *)curdata ) = *((int *)olddata); #else @@ -799,10 +799,10 @@ static int elem_strcmp(const char *name, const char *oname) /* strcmp without array part */ - while(1) { - if(name[a] != oname[a]) return 1; - if(name[a]=='[') break; - if(name[a]==0) break; + while (1) { + if (name[a] != oname[a]) return 1; + if (name[a]=='[') break; + if (name[a]==0) break; a++; } return 0; @@ -818,16 +818,16 @@ static char *find_elem(SDNA *sdna, const char *type, const char *name, short *ol /* in old is the old struct */ elemcount= old[1]; old+= 2; - for(a=0; a<elemcount; a++, old+=2) { + for (a=0; a<elemcount; a++, old+=2) { otype= sdna->types[old[0]]; oname= sdna->names[old[1]]; len= elementsize(sdna, old[0], old[1]); - if( elem_strcmp(name, oname)==0 ) { /* naam equal */ - if( strcmp(type, otype)==0 ) { /* type equal */ - if(sppo) *sppo= old; + if ( elem_strcmp(name, oname)==0 ) { /* naam equal */ + if ( strcmp(type, otype)==0 ) { /* type equal */ + if (sppo) *sppo= old; return olddata; } @@ -858,53 +858,53 @@ static void reconstruct_elem(SDNA *newsdna, SDNA *oldsdna, /* is 'name' an array? */ cp= name; array= 0; - while( *cp && *cp!='[') { + while ( *cp && *cp!='[') { cp++; array++; } - if( *cp!= '[' ) array= 0; + if ( *cp!= '[' ) array= 0; /* in old is the old struct */ elemcount= old[1]; old+= 2; - for(a=0; a<elemcount; a++, old+=2) { + for (a=0; a<elemcount; a++, old+=2) { otype= oldsdna->types[old[0]]; oname= oldsdna->names[old[1]]; len= elementsize(oldsdna, old[0], old[1]); - if( strcmp(name, oname)==0 ) { /* name equal */ + if ( strcmp(name, oname)==0 ) { /* name equal */ - if(ispointer(name)) { /* pointer of functionpointer afhandelen */ + if (ispointer(name)) { /* pointer of functionpointer afhandelen */ cast_pointer(newsdna->pointerlen, oldsdna->pointerlen, name, curdata, olddata); } - else if( strcmp(type, otype)==0 ) { /* type equal */ + else if ( strcmp(type, otype)==0 ) { /* type equal */ memcpy(curdata, olddata, len); } else cast_elem(type, otype, name, curdata, olddata); return; } - else if(array) { /* name is an array */ + else if (array) { /* name is an array */ - if(oname[array]=='[' && strncmp(name, oname, array)==0 ) { /* basis equal */ + if (oname[array]=='[' && strncmp(name, oname, array)==0 ) { /* basis equal */ cursize= DNA_elem_array_size(name, strlen(name)); oldsize= DNA_elem_array_size(oname, strlen(oname)); - if(ispointer(name)) { /* handle pointer or functionpointer */ - if(cursize>oldsize) cast_pointer(newsdna->pointerlen, oldsdna->pointerlen, oname, curdata, olddata); + if (ispointer(name)) { /* handle pointer or functionpointer */ + if (cursize>oldsize) cast_pointer(newsdna->pointerlen, oldsdna->pointerlen, oname, curdata, olddata); else cast_pointer(newsdna->pointerlen, oldsdna->pointerlen, name, curdata, olddata); } - else if(name[0]=='*' || strcmp(type, otype)==0 ) { /* type equal */ + else if (name[0]=='*' || strcmp(type, otype)==0 ) { /* type equal */ mul= len/oldsize; mul*= (cursize < oldsize)? cursize: oldsize; memcpy(curdata, olddata, mul); /* terminate strings */ - if(oldsize > cursize && strcmp(type, "char")==0) + if (oldsize > cursize && strcmp(type, "char")==0) curdata[mul-1]= 0; } else { - if(cursize>oldsize) cast_elem(type, otype, oname, curdata, olddata); + if (cursize>oldsize) cast_elem(type, otype, oname, curdata, olddata); else cast_elem(type, otype, name, curdata, olddata); } return; @@ -926,10 +926,10 @@ static void reconstruct_struct(SDNA *newsdna, SDNA *oldsdna, char *type, *cpo, *cpc; const char *name, *nameo; - if(oldSDNAnr== -1) return; - if(curSDNAnr== -1) return; + if (oldSDNAnr== -1) return; + if (curSDNAnr== -1) return; - if( compflags[oldSDNAnr]==1 ) { /* if recursive: test for equal */ + if ( compflags[oldSDNAnr]==1 ) { /* if recursive: test for equal */ spo= oldsdna->structs[oldSDNAnr]; elen= oldsdna->typelens[ spo[0] ]; @@ -947,19 +947,19 @@ static void reconstruct_struct(SDNA *newsdna, SDNA *oldsdna, spc+= 2; cpc= cur; - for(a=0; a<elemcount; a++, spc+=2) { + for (a=0; a<elemcount; a++, spc+=2) { type= newsdna->types[spc[0]]; name= newsdna->names[spc[1]]; elen= elementsize(newsdna, spc[0], spc[1]); /* test: is type a struct? */ - if(spc[0]>=firststructtypenr && !ispointer(name)) { + if (spc[0]>=firststructtypenr && !ispointer(name)) { /* where does the old struct data start (and is there an old one?) */ cpo= find_elem(oldsdna, type, name, spo, data, &sppo); - if(cpo) { + if (cpo) { oldSDNAnr= DNA_struct_find_nr(oldsdna, type); curSDNAnr= DNA_struct_find_nr(newsdna, type); @@ -973,14 +973,14 @@ static void reconstruct_struct(SDNA *newsdna, SDNA *oldsdna, elen/= mul; eleno/= mulo; - while(mul--) { + while (mul--) { reconstruct_struct(newsdna, oldsdna, compflags, oldSDNAnr, cpo, curSDNAnr, cpc); cpo+= eleno; cpc+= elen; /* new struct array larger than old */ mulo--; - if(mulo<=0) break; + if (mulo<=0) break; } } else cpc+= elen; @@ -1004,7 +1004,7 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data) char *type, *cpo, *cur, cval; const char *name; - if(oldSDNAnr== -1) return; + if (oldSDNAnr== -1) return; firststructtypenr= *(oldsdna->structs[0]); spo= spc= oldsdna->structs[oldSDNAnr]; @@ -1014,7 +1014,7 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data) spc+= 2; cur= data; - for(a=0; a<elemcount; a++, spc+=2) { + for (a=0; a<elemcount; a++, spc+=2) { type= oldsdna->types[spc[0]]; name= oldsdna->names[spc[1]]; @@ -1022,16 +1022,16 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data) elen= elementsize(oldsdna, spc[0], spc[1]); /* test: is type a struct? */ - if(spc[0]>=firststructtypenr && !ispointer(name)) { + if (spc[0]>=firststructtypenr && !ispointer(name)) { /* where does the old data start (is there one?) */ cpo= find_elem(oldsdna, type, name, spo, data, NULL); - if(cpo) { + if (cpo) { oldSDNAnr= DNA_struct_find_nr(oldsdna, type); mul= DNA_elem_array_size(name, strlen(name)); elena= elen/mul; - while(mul--) { + while (mul--) { DNA_struct_switch_endian(oldsdna, oldSDNAnr, cpo); cpo += elena; } @@ -1039,12 +1039,12 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data) } else { - if(ispointer(name)) { - if(oldsdna->pointerlen==8) { + if (ispointer(name)) { + if (oldsdna->pointerlen==8) { mul= DNA_elem_array_size(name, strlen(name)); cpo= cur; - while(mul--) { + while (mul--) { cval= cpo[0]; cpo[0]= cpo[7]; cpo[7]= cval; cval= cpo[1]; cpo[1]= cpo[6]; cpo[6]= cval; cval= cpo[2]; cpo[2]= cpo[5]; cpo[5]= cval; @@ -1063,17 +1063,17 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data) /* exception: variable called blocktype/ipowin: derived from ID_ */ skip= 0; - if(name[0]=='b' && name[1]=='l') { - if(strcmp(name, "blocktype")==0) skip= 1; + if (name[0]=='b' && name[1]=='l') { + if (strcmp(name, "blocktype")==0) skip= 1; } - else if(name[0]=='i' && name[1]=='p') { - if(strcmp(name, "ipowin")==0) skip= 1; + else if (name[0]=='i' && name[1]=='p') { + if (strcmp(name, "ipowin")==0) skip= 1; } - if(skip==0) { + if (skip==0) { mul= DNA_elem_array_size(name, strlen(name)); cpo= cur; - while(mul--) { + while (mul--) { cval= cpo[0]; cpo[0]= cpo[1]; cpo[1]= cval; @@ -1089,7 +1089,7 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data) mul= DNA_elem_array_size(name, strlen(name)); cpo= cur; - while(mul--) { + while (mul--) { cval= cpo[0]; cpo[0]= cpo[3]; cpo[3]= cval; @@ -1104,7 +1104,7 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data) { mul= DNA_elem_array_size(name, strlen(name)); cpo= cur; - while(mul--) { + while (mul--) { cval= cpo[0]; cpo[0]= cpo[7]; cpo[7]= cval; cval= cpo[1]; cpo[1]= cpo[6]; cpo[6]= cval; cval= cpo[2]; cpo[2]= cpo[5]; cpo[5]= cval; @@ -1132,18 +1132,18 @@ void *DNA_struct_reconstruct(SDNA *newsdna, SDNA *oldsdna, char *compflags, int curSDNAnr= DNA_struct_find_nr(newsdna, type); /* init data and alloc */ - if(curSDNAnr >= 0) { + if (curSDNAnr >= 0) { spc= newsdna->structs[curSDNAnr]; curlen= newsdna->typelens[ spc[0] ]; } - if(curlen==0) { + if (curlen==0) { return NULL; } cur= MEM_callocN( blocks*curlen, "reconstruct"); cpc= cur; cpo= data; - for(a=0; a<blocks; a++) { + for (a=0; a<blocks; a++) { reconstruct_struct(newsdna, oldsdna, compflags, oldSDNAnr, cpo, curSDNAnr, cpc); cpc+= curlen; cpo+= oldlen; diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 7dc51446ddc..75591f9737f 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -230,7 +230,7 @@ static int add_type(const char *str, int len) char *cp; /* first do validity check */ - if(str[0]==0) { + if (str[0]==0) { return -1; } else if (strchr(str, '*')) { @@ -240,8 +240,8 @@ static int add_type(const char *str, int len) } /* search through type array */ - for(nr=0; nr<nr_types; nr++) { - if(strcmp(str, types[nr])==0) { + for (nr=0; nr<nr_types; nr++) { + if (strcmp(str, types[nr])==0) { if (len) { typelens[nr]= len; alphalens[nr] = len; @@ -251,7 +251,7 @@ static int add_type(const char *str, int len) } /* append new type */ - if(nr_types==0) cp= typedata; + if (nr_types==0) cp= typedata; else { cp= types[nr_types-1]+strlen(types[nr_types-1])+1; } @@ -260,7 +260,7 @@ static int add_type(const char *str, int len) typelens[nr_types]= len; alphalens[nr_types]= len; - if(nr_types>=maxnr) { + if (nr_types>=maxnr) { printf("too many types\n"); return nr_types-1; } @@ -287,7 +287,7 @@ static int add_name(const char *str) additional_slen_offset = 0; - if(str[0]==0 /* || (str[1]==0) */) return -1; + if (str[0]==0 /* || (str[1]==0) */) return -1; if (str[0] == '(' && str[1] == '*') { /* we handle function pointer and special array cases here, e.g. @@ -323,7 +323,7 @@ static int add_name(const char *str) if (!isfuncptr) { /* multidimensional array pointer case */ - if(str[j] == 0) { + if (str[j] == 0) { if (debugSDNA > 3) printf("offsetting for multidim array pointer\n"); } else @@ -339,10 +339,12 @@ static int add_name(const char *str) } if (debugSDNA > 3) printf("extra offset %d\n", k); additional_slen_offset = k; - } else if (str[j] == ')' ) { + } + else if (str[j] == ')' ) { if (debugSDNA > 3) printf("offsetting for brace\n"); ; /* don't get extra offset */ - } else { + } + else { printf("Error during tokening function pointer argument list\n"); } @@ -370,7 +372,8 @@ static int add_name(const char *str) buf[i+5] = 'd'; buf[i+6] = ')'; buf[i+7] = 0; - } else { + } + else { buf[i] = ')'; buf[i+1] = '('; buf[i+2] = ')'; @@ -379,27 +382,28 @@ static int add_name(const char *str) /* now precede with buf*/ if (debugSDNA > 3) printf("\t\t\t\t\tProposing fp name %s\n", buf); name = buf; - } else { + } + else { /* normal field: old code */ name = str; } /* search name array */ - for(nr=0; nr<nr_names; nr++) { - if(strcmp(name, names[nr])==0) { + for (nr=0; nr<nr_names; nr++) { + if (strcmp(name, names[nr])==0) { return nr; } } /* append new type */ - if(nr_names==0) cp= namedata; + if (nr_names==0) cp= namedata; else { cp= names[nr_names-1]+strlen(names[nr_names-1])+1; } strcpy(cp, name); names[nr_names]= cp; - if(nr_names>=maxnr) { + if (nr_names>=maxnr) { printf("too many names\n"); return nr_names-1; } @@ -413,7 +417,7 @@ static short *add_struct(int namecode) int len; short *sp; - if(nr_structs==0) { + if (nr_structs==0) { structs[0]= structdata; } else { @@ -425,7 +429,7 @@ static short *add_struct(int namecode) sp= structs[nr_structs]; sp[0]= namecode; - if(nr_structs>=maxnr) { + if (nr_structs>=maxnr) { printf("too many structs\n"); return sp; } @@ -451,10 +455,11 @@ static int preprocess_include(char *maindata, int len) cp= temp; a= len; comment = 0; - while(a--) { - if(cp[0]=='/' && cp[1]=='/') { + while (a--) { + if (cp[0]=='/' && cp[1]=='/') { comment = 1; - } else if (*cp<32) { + } + else if (*cp<32) { comment = 0; } if (comment || *cp<32 || *cp>128 ) *cp= 32; @@ -468,21 +473,21 @@ static int preprocess_include(char *maindata, int len) newlen= 0; comment= 0; a= len; - while(a--) { + while (a--) { - if(cp[0]=='/' && cp[1]=='*') { + if (cp[0]=='/' && cp[1]=='*') { comment= 1; cp[0]=cp[1]= 32; } - if(cp[0]=='*' && cp[1]=='/') { + if (cp[0]=='*' && cp[1]=='/') { comment= 0; cp[0]=cp[1]= 32; } /* do not copy when: */ - if(comment); - else if( cp[0]==' ' && cp[1]==' ' ); - else if( cp[-1]=='*' && cp[0]==' ' ); /* pointers with a space */ + if (comment); + else if ( cp[0]==' ' && cp[1]==' ' ); + else if ( cp[-1]=='*' && cp[0]==' ' ); /* pointers with a space */ /* skip special keywords */ else if (strncmp("DNA_DEPRECATED", cp, 14)==0) { @@ -559,26 +564,26 @@ static int convert_include(char *filename) /* we look for '{' and then back to 'struct' */ count= 0; overslaan= 0; - while(count<filelen) { + while (count<filelen) { /* code for skipping a struct: two hashes on 2 lines. (preprocess added a space) */ - if(md[0]=='#' && md[1]==' ' && md[2]=='#') { + if (md[0]=='#' && md[1]==' ' && md[2]=='#') { overslaan= 1; } - if(md[0]=='{') { + if (md[0]=='{') { md[0]= 0; - if(overslaan) { + if (overslaan) { overslaan= 0; } else { - if(md[-1]==' ') md[-1]= 0; + if (md[-1]==' ') md[-1]= 0; md1= md-2; - while( *md1!=32) md1--; /* to beginning of word */ + while ( *md1!=32) md1--; /* to beginning of word */ md1++; /* we've got a struct name when... */ - if( strncmp(md1-7, "struct", 6)==0 ) { + if ( strncmp(md1-7, "struct", 6)==0 ) { strct = add_type(md1, 0); if (strct == -1) { @@ -593,23 +598,23 @@ static int convert_include(char *filename) /* first lets make it all nice strings */ md1= md+1; - while(*md1 != '}') { - if(md1>mainend) break; + while (*md1 != '}') { + if (md1>mainend) break; - if(*md1==',' || *md1==' ') *md1= 0; + if (*md1==',' || *md1==' ') *md1= 0; md1++; } /* read types and names until first character that is not '}' */ md1= md+1; - while( *md1 != '}' ) { - if(md1>mainend) break; + while ( *md1 != '}' ) { + if (md1>mainend) break; /* skip when it says 'struct' or 'unsigned' or 'const' */ - if(*md1) { - if( strncmp(md1, "struct", 6)==0 ) md1+= 7; - if( strncmp(md1, "unsigned", 8)==0 ) md1+= 9; - if( strncmp(md1, "const", 5)==0 ) md1+= 6; + if (*md1) { + if ( strncmp(md1, "struct", 6)==0 ) md1+= 7; + if ( strncmp(md1, "unsigned", 8)==0 ) md1+= 9; + if ( strncmp(md1, "const", 5)==0 ) md1+= 6; /* we've got a type! */ type= add_type(md1, 0); @@ -624,15 +629,15 @@ static int convert_include(char *filename) /* read until ';' */ - while( *md1 != ';' ) { - if(md1>mainend) break; + while ( *md1 != ';' ) { + if (md1>mainend) break; - if(*md1) { + if (*md1) { /* We've got a name. slen needs * correction for function * pointers! */ slen= (int) strlen(md1); - if( md1[slen-1]==';' ) { + if ( md1[slen-1]==';' ) { md1[slen-1]= 0; @@ -690,11 +695,11 @@ static int arraysize(char *astr, int len) memcpy(str, astr, len+1); - for(a=0; a<len; a++) { - if( str[a]== '[' ) { + for (a=0; a<len; a++) { + if ( str[a]== '[' ) { cp= &(str[a+1]); } - else if( str[a]==']' && cp) { + else if ( str[a]==']' && cp) { str[a]= 0; /* if 'cp' is a preprocessor definition, it will evaluate to 0, * the caller needs to check for this case and throw an error */ @@ -712,17 +717,17 @@ static int calculate_structlens(int firststruct) char *cp; int has_pointer, dna_error = 0; - while(unknown) { + while (unknown) { lastunknown= unknown; unknown= 0; /* check all structs... */ - for(a=0; a<nr_structs; a++) { + for (a=0; a<nr_structs; a++) { structpoin= structs[a]; structtype= structpoin[0]; /* when length is not known... */ - if(typelens[structtype]==0) { + if (typelens[structtype]==0) { sp= structpoin+2; len= 0; @@ -730,17 +735,17 @@ static int calculate_structlens(int firststruct) has_pointer = 0; /* check all elements in struct */ - for(b=0; b<structpoin[1]; b++, sp+=2) { + for (b=0; b<structpoin[1]; b++, sp+=2) { type= sp[0]; cp= names[sp[1]]; namelen= (int) strlen(cp); /* is it a pointer or function pointer? */ - if(cp[0]=='*' || cp[1]=='*') { + if (cp[0]=='*' || cp[1]=='*') { has_pointer = 1; /* has the name an extra length? (array) */ mul= 1; - if( cp[namelen-1]==']') mul= arraysize(cp, namelen); + if ( cp[namelen-1]==']') mul= arraysize(cp, namelen); if (mul == 0) { printf("Zero array size found or could not parse %s: '%.*s'\n", types[structtype], namelen + 1, cp); @@ -748,12 +753,13 @@ static int calculate_structlens(int firststruct) } /* 4-8 aligned/ */ - if(sizeof(void *) == 4) { + if (sizeof(void *) == 4) { if (len % 4) { printf("Align pointer error in struct (len4): %s %s\n", types[structtype], cp); dna_error = 1; } - } else { + } + else { if (len % 8) { printf("Align pointer error in struct (len8): %s %s\n", types[structtype], cp); dna_error = 1; @@ -768,14 +774,16 @@ static int calculate_structlens(int firststruct) len += sizeof(void *) * mul; alphalen += 8 * mul; - } else if(cp[0]=='[') { + } + else if (cp[0]=='[') { /* parsing can cause names "var" and "[3]" to be found for "float var [3]" ... */ printf("Parse error in struct, invalid member name: %s %s\n", types[structtype], cp); dna_error = 1; - } else if( typelens[type] ) { + } + else if ( typelens[type] ) { /* has the name an extra length? (array) */ mul= 1; - if( cp[namelen-1]==']') mul= arraysize(cp, namelen); + if ( cp[namelen-1]==']') mul= arraysize(cp, namelen); if (mul == 0) { printf("Zero array size found or could not parse %s: '%.*s'\n", types[structtype], namelen + 1, cp); @@ -783,19 +791,19 @@ static int calculate_structlens(int firststruct) } /* struct alignment */ - if(type >= firststruct) { - if(sizeof(void *)==8 && (len % 8) ) { + if (type >= firststruct) { + if (sizeof(void *)==8 && (len % 8) ) { printf("Align struct error: %s %s\n", types[structtype],cp); dna_error = 1; } } /* 2-4 aligned/ */ - if(typelens[type]>3 && (len % 4) ) { + if (typelens[type]>3 && (len % 4) ) { printf("Align 4 error in struct: %s %s (add %d padding bytes)\n", types[structtype], cp, len%4); dna_error = 1; } - else if(typelens[type]==2 && (len % 2) ) { + else if (typelens[type]==2 && (len % 2) ) { printf("Align 2 error in struct: %s %s (add %d padding bytes)\n", types[structtype], cp, len%2); dna_error = 1; } @@ -803,7 +811,8 @@ static int calculate_structlens(int firststruct) len += mul*typelens[type]; alphalen += mul * alphalens[type]; - } else { + } + else { len= 0; alphalen = 0; break; @@ -812,7 +821,8 @@ static int calculate_structlens(int firststruct) if (len==0) { unknown++; - } else { + } + else { typelens[structtype]= len; alphalens[structtype]= alphalen; // two ways to detect if a struct contains a pointer: @@ -824,7 +834,7 @@ static int calculate_structlens(int firststruct) } } - if(len % 4) { + if (len % 4) { printf("Sizeerror 4 in struct: %s (add %d bytes)\n", types[structtype], len%4); dna_error = 1; } @@ -833,21 +843,21 @@ static int calculate_structlens(int firststruct) } } - if(unknown==lastunknown) break; + if (unknown==lastunknown) break; } - if(unknown) { + if (unknown) { printf("ERROR: still %d structs unknown\n", unknown); if (debugSDNA) { printf("*** Known structs : \n"); - for(a=0; a<nr_structs; a++) { + for (a=0; a<nr_structs; a++) { structpoin= structs[a]; structtype= structpoin[0]; /* length unknown */ - if(typelens[structtype]!=0) { + if (typelens[structtype]!=0) { printf(" %s\n", types[structtype]); } } @@ -856,12 +866,12 @@ static int calculate_structlens(int firststruct) printf("*** Unknown structs : \n"); - for(a=0; a<nr_structs; a++) { + for (a=0; a<nr_structs; a++) { structpoin= structs[a]; structtype= structpoin[0]; /* length unknown yet */ - if(typelens[structtype]==0) { + if (typelens[structtype]==0) { printf(" %s\n", types[structtype]); } } @@ -898,12 +908,12 @@ void printStructLenghts(void) short *structpoin; printf("\n\n*** All detected structs:\n"); - while(unknown) { + while (unknown) { /*lastunknown= unknown;*/ /*UNUSED*/ unknown= 0; /* check all structs... */ - for(a=0; a<nr_structs; a++) { + for (a=0; a<nr_structs; a++) { structpoin= structs[a]; structtype= structpoin[0]; printf("\t%s\t:%d\n", types[structtype], typelens[structtype]); @@ -986,24 +996,24 @@ static int make_structDNA(char *baseDirectory, FILE *file) short num_types; printf("nr_names %d nr_types %d nr_structs %d\n", nr_names, nr_types, nr_structs); - for(a=0; a<nr_names; a++) { + for (a=0; a<nr_names; a++) { printf(" %s \n", names[a]); } printf("\n"); sp= typelens; - for(a=0; a<nr_types; a++, sp++) { + for (a=0; a<nr_types; a++, sp++) { printf(" %s %d\n", types[a], *sp); } printf("\n"); - for(a=0; a<nr_structs; a++) { + for (a=0; a<nr_structs; a++) { sp= structs[a]; printf(" struct %s elems: %d size: %d\n", types[sp[0]], sp[1],typelens[sp[0]]); num_types = sp[1]; sp+= 2; /* ? num_types was elem? */ - for(b=0; b< num_types; b++, sp+= 2) { + for (b=0; b< num_types; b++, sp+= 2) { printf(" %s %s\n", types[sp[0]], names[sp[1]]); } } @@ -1013,7 +1023,7 @@ static int make_structDNA(char *baseDirectory, FILE *file) if (debugSDNA > -1) printf("Writing file ... "); - if(nr_names==0 || nr_structs==0); + if (nr_names==0 || nr_structs==0); else { strcpy(str, "SDNA"); dna_write(file, str, 4); @@ -1050,7 +1060,7 @@ static int make_structDNA(char *baseDirectory, FILE *file) dna_write(file, str, 4); len= 2*nr_types; - if(nr_types & 1) len+= 2; + if (nr_types & 1) len+= 2; dna_write(file, typelens, len); /* WRITE STRUCTS */ @@ -1073,7 +1083,7 @@ static int make_structDNA(char *baseDirectory, FILE *file) int a; fp= fopen("padding.c", "w"); - if(fp==NULL); + if (fp==NULL); else { // add all include files defined in the global array @@ -1081,11 +1091,11 @@ static int make_structDNA(char *baseDirectory, FILE *file) fprintf(fp, "#include \"%s%s\"\n", baseDirectory, includefiles[i]); } - fprintf(fp, "main(){\n"); + fprintf(fp, "main() {\n"); sp = typelens; sp += firststruct; - for(a=firststruct; a<nr_types; a++, sp++) { - if(*sp) { + for (a=firststruct; a<nr_types; a++, sp++) { + if (*sp) { fprintf(fp, "\tif(sizeof(struct %s) - %d) printf(\"ALIGN ERROR:", types[a], *sp); fprintf(fp, "%%d %s %d ", types[a], *sp); fprintf(fp, "\\n\", sizeof(struct %s) - %d);\n", types[a], *sp); @@ -1134,17 +1144,20 @@ int main(int argc, char ** argv) if (argc!=2 && argc!=3) { printf("Usage: %s outfile.c [base directory]\n", argv[0]); return_status = 1; - } else { + } + else { file = fopen(argv[1], "w"); if (!file) { printf ("Unable to open file: %s\n", argv[1]); return_status = 1; - } else { + } + else { char baseDirectory[256]; if (argc==3) { strcpy(baseDirectory, argv[2]); - } else { + } + else { strcpy(baseDirectory, BASE_HEADER); } @@ -1154,7 +1167,8 @@ int main(int argc, char ** argv) fclose(file); make_bad_file(argv[1], __LINE__); return_status = 1; - } else { + } + else { fprintf(file, "};\n"); fprintf(file, "int DNAlen= sizeof(DNAstr);\n"); |