diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-14 08:15:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-14 08:20:55 +0300 |
commit | a1d73d03eb91be72b0f10ff4a9c6eb00f04b97c6 (patch) | |
tree | 3e8ebea3ccb39f93dec36145200169de8acf8556 | |
parent | 63ee378fa96d1906adc8da3d318a73333f52b643 (diff) |
Cleanup: move comments above definitions
For clang-format not to wrap definitions.
-rw-r--r-- | source/blender/blenkernel/BKE_constraint.h | 56 | ||||
-rw-r--r-- | source/blender/editors/space_file/fsmenu.c | 8 | ||||
-rw-r--r-- | source/blender/imbuf/IMB_imbuf_types.h | 163 | ||||
-rw-r--r-- | source/blender/imbuf/intern/thumbs.c | 11 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_modifier_types.h | 57 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 11 |
6 files changed, 196 insertions, 110 deletions
diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h index bfcdcb68c4a..9e723b49b63 100644 --- a/source/blender/blenkernel/BKE_constraint.h +++ b/source/blender/blenkernel/BKE_constraint.h @@ -49,16 +49,24 @@ extern "C" { /* special struct for use in constraint evaluation */ typedef struct bConstraintOb { - struct Depsgraph *depsgraph;/* to get evaluated armature. */ - struct Scene *scene; /* for system time, part of deglobalization, code nicer later with local time (ton) */ - struct Object *ob; /* if pchan, then armature that it comes from, otherwise constraint owner */ - struct bPoseChannel *pchan; /* pose channel that owns the constraints being evaluated */ - - float matrix[4][4]; /* matrix where constraints are accumulated + solved */ - float startmat[4][4]; /* original matrix (before constraint solving) */ - - short type; /* type of owner */ - short rotOrder; /* rotation order for constraint owner (as defined in eEulerRotationOrders in BLI_math.h) */ + /** to get evaluated armature. */ + struct Depsgraph *depsgraph; + /** for system time, part of deglobalization, code nicer later with local time (ton) */ + struct Scene *scene; + /** if pchan, then armature that it comes from, otherwise constraint owner */ + struct Object *ob; + /** pose channel that owns the constraints being evaluated */ + struct bPoseChannel *pchan; + + /** matrix where constraints are accumulated + solved */ + float matrix[4][4]; + /** original matrix (before constraint solving) */ + float startmat[4][4]; + + /** type of owner */ + short type; + /** rotation order for constraint owner (as defined in eEulerRotationOrders in BLI_math.h) */ + short rotOrder; } bConstraintOb; /* ---------------------------------------------------------------------------- */ @@ -83,31 +91,35 @@ typedef void (*ConstraintIDFunc)(struct bConstraint *con, struct ID **idpoin, bo */ typedef struct bConstraintTypeInfo { /* admin/ident */ - short type; /* CONSTRAINT_TYPE_### */ - short size; /* size in bytes of the struct */ - char name[32]; /* name of constraint in interface */ - char structName[32]; /* name of struct for SDNA */ + /** CONSTRAINT_TYPE_### */ + short type; + /** size in bytes of the struct */ + short size; + /** name of constraint in interface */ + char name[32]; + /** name of struct for SDNA */ + char structName[32]; /* data management function pointers - special handling */ - /* free any data that is allocated separately (optional) */ + /** free any data that is allocated separately (optional) */ void (*free_data)(struct bConstraint *con); - /* run the provided callback function on all the ID-blocks linked to the constraint */ + /** run the provided callback function on all the ID-blocks linked to the constraint */ void (*id_looper)(struct bConstraint *con, ConstraintIDFunc func, void *userdata); - /* copy any special data that is allocated separately (optional) */ + /** copy any special data that is allocated separately (optional) */ void (*copy_data)(struct bConstraint *con, struct bConstraint *src); - /* set settings for data that will be used for bConstraint.data (memory already allocated using MEM_callocN) */ + /** set settings for data that will be used for bConstraint.data (memory already allocated using MEM_callocN) */ void (*new_data)(void *cdata); /* target handling function pointers */ - /* for multi-target constraints: return that list; otherwise make a temporary list (returns number of targets) */ + /** for multi-target constraints: return that list; otherwise make a temporary list (returns number of targets) */ int (*get_constraint_targets)(struct bConstraint *con, struct ListBase *list); - /* for single-target constraints only: flush data back to source data, and the free memory used */ + /** for single-target constraints only: flush data back to source data, and the free memory used */ void (*flush_constraint_targets)(struct bConstraint *con, struct ListBase *list, bool no_copy); /* evaluation */ - /* set the ct->matrix for the given constraint target (at the given ctime) */ + /** set the ct->matrix for the given constraint target (at the given ctime) */ void (*get_target_matrix)(struct Depsgraph *depsgraph, struct bConstraint *con, struct bConstraintOb *cob, struct bConstraintTarget *ct, float ctime); - /* evaluate the constraint for the given time */ + /** evaluate the constraint for the given time */ void (*evaluate_constraint)(struct bConstraint *con, struct bConstraintOb *cob, struct ListBase *targets); } bConstraintTypeInfo; diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 9b1aae03219..2fa9134165d 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -45,9 +45,11 @@ #include "ED_fileselect.h" #ifdef WIN32 -# include <windows.h> /* need to include windows.h so _WIN32_IE is defined */ -# include <shlobj.h> /* for SHGetSpecialFolderPath, has to be done before BLI_winstuff - * because 'near' is disabled through BLI_windstuff */ + /* Need to include windows.h so _WIN32_IE is defined. */ +# include <windows.h> + /* For SHGetSpecialFolderPath, has to be done before BLI_winstuff + * because 'near' is disabled through BLI_windstuff. */ +# include <shlobj.h> # include "BLI_winstuff.h" #endif diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h index d407845e45d..309c41646ed 100644 --- a/source/blender/imbuf/IMB_imbuf_types.h +++ b/source/blender/imbuf/IMB_imbuf_types.h @@ -51,10 +51,14 @@ #define IMB_FILENAME_SIZE 1024 typedef struct DDSData { - unsigned int fourcc; /* DDS fourcc info */ - unsigned int nummipmaps; /* The number of mipmaps in the dds file */ - unsigned char *data; /* The compressed image data */ - unsigned int size; /* The size of the compressed data */ + /** DDS fourcc info */ + unsigned int fourcc; + /** The number of mipmaps in the dds file */ + unsigned int nummipmaps; + /** The compressed image data */ + unsigned char *data; + /** The size of the compressed data */ + unsigned int size; } DDSData; /** @@ -66,9 +70,13 @@ typedef struct DDSData { * */ -/* ibuf->ftype flag, main image types */ -/* Warning: Keep explicit value assignments here, this file is included in areas where not all format defines - * are set (e.g. intern/dds only get WITH_DDS, even if TIFF, HDR etc are also defined). See T46524. */ + +/* Warning: Keep explicit value assignments here, + * this file is included in areas where not all format defines are set + * (e.g. intern/dds only get WITH_DDS, even if TIFF, HDR etc are also defined). + * See T46524. */ + +/** #ImBuf.ftype flag, main image types. */ enum eImbTypes { IMB_FTYPE_PNG = 1, IMB_FTYPE_TGA = 2, @@ -136,24 +144,30 @@ enum eImbTypes { typedef struct ImbFormatOptions { short flag; - char quality; /* quality serves dual purpose as quality number for jpeg or compression amount for png */ + /** quality serves dual purpose as quality number for jpeg or compression amount for png */ + char quality; } ImbFormatOptions; typedef struct ImBuf { struct ImBuf *next, *prev; /**< allow lists of ImBufs, for caches or flipbooks */ /* dimensions */ - int x, y; /* width and Height of our image buffer. - * Should be 'unsigned int' since most formats use this. - * but this is problematic with texture math in imagetexture.c - * avoid problems and use int. - campbell */ + /** Width and Height of our image buffer. + * Should be 'unsigned int' since most formats use this. + * but this is problematic with texture math in imagetexture.c + * avoid problems and use int. - campbell */ + int x, y; - unsigned char planes; /* Active amount of bits/bitplanes */ - int channels; /* amount of channels in rect_float (0 = 4 channel default) */ + /** Active amount of bits/bitplanes */ + unsigned char planes; + /** Number of channels in `rect_float` (0 = 4 channel default) */ + int channels; /* flags */ - int flags; /* Controls which components should exist. */ - int mall; /* what is malloced internal, and can be freed */ + /** Controls which components should exist. */ + int flags; + /** what is malloced internal, and can be freed */ + int mall; /* pixels */ @@ -179,42 +193,63 @@ typedef struct ImBuf { unsigned int **tiles; /* zbuffer */ - int *zbuf; /* z buffer data, original zbuffer */ - float *zbuf_float; /* z buffer data, camera coordinates */ + /** z buffer data, original zbuffer */ + int *zbuf; + /** z buffer data, camera coordinates */ + float *zbuf_float; /* parameters used by conversion between byte and float */ - float dither; /* random dither value, for conversion from float -> byte rect */ + /** random dither value, for conversion from float -> byte rect */ + float dither; /* mipmapping */ - struct ImBuf *mipmap[IMB_MIPMAP_LEVELS]; /* MipMap levels, a series of halved images */ + /** MipMap levels, a series of halved images */ + struct ImBuf *mipmap[IMB_MIPMAP_LEVELS]; int miptot, miplevel; /* externally used data */ - int index; /* reference index for ImBuf lists */ - int userflags; /* used to set imbuf to dirty and other stuff */ - struct IDProperty *metadata; /* image metadata */ - void *userdata; /* temporary storage */ + /** reference index for ImBuf lists */ + int index; + /** used to set imbuf to dirty and other stuff */ + int userflags; + /** image metadata */ + struct IDProperty *metadata; + /** temporary storage */ + void *userdata; /* file information */ - enum eImbTypes ftype; /* file type we are going to save as */ - ImbFormatOptions foptions; /* file format specific flags */ - char name[IMB_FILENAME_SIZE]; /* filename associated with this image */ - char cachename[IMB_FILENAME_SIZE]; /* full filename used for reading from cache */ + /** file type we are going to save as */ + enum eImbTypes ftype; + /** file format specific flags */ + ImbFormatOptions foptions; + /** filename associated with this image */ + char name[IMB_FILENAME_SIZE]; + /** full filename used for reading from cache */ + char cachename[IMB_FILENAME_SIZE]; /* memory cache limiter */ - struct MEM_CacheLimiterHandle_s *c_handle; /* handle for cache limiter */ - int refcounter; /* reference counter for multiple users */ + /** handle for cache limiter */ + struct MEM_CacheLimiterHandle_s *c_handle; + /** reference counter for multiple users */ + int refcounter; /* some parameters to pass along for packing images */ - unsigned char *encodedbuffer; /* Compressed image only used with png currently */ - unsigned int encodedsize; /* Size of data written to encodedbuffer */ - unsigned int encodedbuffersize; /* Size of encodedbuffer */ + /** Compressed image only used with png currently */ + unsigned char *encodedbuffer; + /** Size of data written to encodedbuffer */ + unsigned int encodedsize; + /** Size of encodedbuffer */ + unsigned int encodedbuffersize; /* color management */ - struct ColorSpace *rect_colorspace; /* color space of byte buffer */ - struct ColorSpace *float_colorspace; /* color space of float buffer, used by sequencer only */ - unsigned int *display_buffer_flags; /* array of per-display display buffers dirty flags */ - struct ColormanageCache *colormanage_cache; /* cache used by color management */ + /** color space of byte buffer */ + struct ColorSpace *rect_colorspace; + /** color space of float buffer, used by sequencer only */ + struct ColorSpace *float_colorspace; + /** array of per-display display buffers dirty flags */ + unsigned int *display_buffer_flags; + /** cache used by color management */ + struct ColormanageCache *colormanage_cache; int colormanage_flag; rcti invalid_rect; @@ -226,11 +261,18 @@ typedef struct ImBuf { * \brief userflags: Flags used internally by blender for imagebuffers */ -#define IB_BITMAPDIRTY (1 << 1) /* image needs to be saved is not the same as filename */ -#define IB_MIPMAP_INVALID (1 << 2) /* image mipmaps are invalid, need recreate */ -#define IB_RECT_INVALID (1 << 3) /* float buffer changed, needs recreation of byte rect */ -#define IB_DISPLAY_BUFFER_INVALID (1 << 4) /* either float or byte buffer changed, need to re-calculate display buffers */ -#define IB_PERSISTENT (1 << 5) /* image buffer is persistent in the memory and should never be removed from the cache */ +enum { + /** image needs to be saved is not the same as filename */ + IB_BITMAPDIRTY = (1 << 1), + /** image mipmaps are invalid, need recreate */ + IB_MIPMAP_INVALID = (1 << 2), + /** float buffer changed, needs recreation of byte rect */ + IB_RECT_INVALID = (1 << 3), + /** either float or byte buffer changed, need to re-calculate display buffers */ + IB_DISPLAY_BUFFER_INVALID = (1 << 4), + /** image buffer is persistent in the memory and should never be removed from the cache */ + IB_PERSISTENT = (1 << 5), +}; /** * \name Imbuf Component flags @@ -238,22 +280,27 @@ typedef struct ImBuf { * * \{ */ -#define IB_rect (1 << 0) -#define IB_test (1 << 1) -#define IB_zbuf (1 << 3) -#define IB_mem (1 << 4) -#define IB_rectfloat (1 << 5) -#define IB_zbuffloat (1 << 6) -#define IB_multilayer (1 << 7) -#define IB_metadata (1 << 8) -#define IB_animdeinterlace (1 << 9) -#define IB_tiles (1 << 10) -#define IB_tilecache (1 << 11) -#define IB_alphamode_premul (1 << 12) /* indicates whether image on disk have premul alpha */ -#define IB_alphamode_detect (1 << 13) /* if this flag is set, alpha mode would be guessed from file */ -#define IB_ignore_alpha (1 << 14) /* ignore alpha on load and substitute it with 1.0f */ -#define IB_thumbnail (1 << 15) -#define IB_multiview (1 << 16) +enum { + IB_rect = 1 << 0, + IB_test = 1 << 1, + IB_zbuf = 1 << 3, + IB_mem = 1 << 4, + IB_rectfloat = 1 << 5, + IB_zbuffloat = 1 << 6, + IB_multilayer = 1 << 7, + IB_metadata = 1 << 8, + IB_animdeinterlace = 1 << 9, + IB_tiles = 1 << 10, + IB_tilecache = 1 << 11, + /** indicates whether image on disk have premul alpha */ + IB_alphamode_premul = 1 << 12, + /** if this flag is set, alpha mode would be guessed from file */ + IB_alphamode_detect = 1 << 13 , + /** ignore alpha on load and substitute it with 1.0f */ + IB_ignore_alpha = 1 << 14 , + IB_thumbnail = 1 << 15, + IB_multiview = 1 << 16, +}; /** \} */ diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c index fbc34264b30..ed7a9763322 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -61,12 +61,15 @@ #include <stdio.h> #ifdef WIN32 -# include <windows.h> /* need to include windows.h so _WIN32_IE is defined */ + /* Need to include windows.h so _WIN32_IE is defined. */ +# include <windows.h> # ifndef _WIN32_IE -# define _WIN32_IE 0x0400 /* minimal requirements for SHGetSpecialFolderPath on MINGW MSVC has this defined already */ + /* Minimal requirements for SHGetSpecialFolderPath on MINGW MSVC has this defined already. */ +# define _WIN32_IE 0x0400 # endif -# include <shlobj.h> /* for SHGetSpecialFolderPath, has to be done before BLI_winstuff - * because 'near' is disabled through BLI_windstuff */ + /* For SHGetSpecialFolderPath, has to be done before BLI_winstuff + * because 'near' is disabled through BLI_windstuff */ +# include <shlobj.h> # include <direct.h> /* chdir */ # include "BLI_winstuff.h" # include "utfconv.h" diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 8384d49033a..c6a7209da5a 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -215,8 +215,10 @@ typedef struct BuildModifierData { /* Build Modifier -> flag */ enum { - MOD_BUILD_FLAG_RANDOMIZE = (1 << 0), /* order of vertices is randomized */ - MOD_BUILD_FLAG_REVERSE = (1 << 1), /* frame range is reversed, resulting in a deconstruction effect */ + /** order of vertices is randomized */ + MOD_BUILD_FLAG_RANDOMIZE = (1 << 0), + /** frame range is reversed, resulting in a deconstruction effect */ + MOD_BUILD_FLAG_REVERSE = (1 << 1), }; /* Mask Modifier */ @@ -542,15 +544,18 @@ typedef struct DecimateModifierData { enum { MOD_DECIM_FLAG_INVERT_VGROUP = (1 << 0), - MOD_DECIM_FLAG_TRIANGULATE = (1 << 1), /* for collapse only. dont convert tri pairs back to quads */ - MOD_DECIM_FLAG_ALL_BOUNDARY_VERTS = (1 << 2), /* for dissolve only. collapse all verts between 2 faces */ + /** for collapse only. dont convert tri pairs back to quads */ + MOD_DECIM_FLAG_TRIANGULATE = (1 << 1), + /** for dissolve only. collapse all verts between 2 faces */ + MOD_DECIM_FLAG_ALL_BOUNDARY_VERTS = (1 << 2), MOD_DECIM_FLAG_SYMMETRY = (1 << 3), }; enum { MOD_DECIM_MODE_COLLAPSE, MOD_DECIM_MODE_UNSUBDIV, - MOD_DECIM_MODE_DISSOLVE, /* called planar in the UI */ + /** called planar in the UI */ + MOD_DECIM_MODE_DISSOLVE, }; typedef struct SmoothModifierData { @@ -1285,8 +1290,10 @@ typedef struct WeightVGEditModifierData { /* WeightVGEdit flags. */ enum { /* (1 << 0), (1 << 1) and (1 << 2) are free for future use! */ - MOD_WVG_EDIT_ADD2VG = (1 << 3), /* Add vertices with higher weight than threshold to vgroup. */ - MOD_WVG_EDIT_REMFVG = (1 << 4), /* Remove vertices with lower weight than threshold from vgroup. */ + /** Add vertices with higher weight than threshold to vgroup. */ + MOD_WVG_EDIT_ADD2VG = (1 << 3), + /** Remove vertices with lower weight than threshold from vgroup. */ + MOD_WVG_EDIT_REMFVG = (1 << 4), }; typedef struct WeightVGMixModifierData { @@ -1331,22 +1338,34 @@ typedef struct WeightVGMixModifierData { /* How second vgroup's weights affect first ones. */ enum { - MOD_WVG_MIX_SET = 1, /* Second weights replace weights. */ - MOD_WVG_MIX_ADD = 2, /* Second weights are added to weights. */ - MOD_WVG_MIX_SUB = 3, /* Second weights are subtracted from weights. */ - MOD_WVG_MIX_MUL = 4, /* Second weights are multiplied with weights. */ - MOD_WVG_MIX_DIV = 5, /* Second weights divide weights. */ - MOD_WVG_MIX_DIF = 6, /* Difference between second weights and weights. */ - MOD_WVG_MIX_AVG = 7, /* Average of both weights. */ + /** Second weights replace weights. */ + MOD_WVG_MIX_SET = 1, + /** Second weights are added to weights. */ + MOD_WVG_MIX_ADD = 2, + /** Second weights are subtracted from weights. */ + MOD_WVG_MIX_SUB = 3, + /** Second weights are multiplied with weights. */ + MOD_WVG_MIX_MUL = 4, + /** Second weights divide weights. */ + MOD_WVG_MIX_DIV = 5, + /** Difference between second weights and weights. */ + MOD_WVG_MIX_DIF = 6, + /** Average of both weights. */ + MOD_WVG_MIX_AVG = 7, }; /* What vertices to affect. */ enum { - MOD_WVG_SET_ALL = 1, /* Affect all vertices. */ - MOD_WVG_SET_A = 2, /* Affect only vertices in first vgroup. */ - MOD_WVG_SET_B = 3, /* Affect only vertices in second vgroup. */ - MOD_WVG_SET_OR = 4, /* Affect only vertices in one vgroup or the other. */ - MOD_WVG_SET_AND = 5, /* Affect only vertices in both vgroups. */ + /** Affect all vertices. */ + MOD_WVG_SET_ALL = 1, + /** Affect only vertices in first vgroup. */ + MOD_WVG_SET_A = 2, + /** Affect only vertices in second vgroup. */ + MOD_WVG_SET_B = 3, + /** Affect only vertices in one vgroup or the other. */ + MOD_WVG_SET_OR = 4, + /** Affect only vertices in both vgroups. */ + MOD_WVG_SET_AND = 5, }; typedef struct WeightVGProximityModifierData { diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 04a73d9b917..beb963a2af3 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -40,12 +40,15 @@ #include "zlib.h" /* wm_read_exotic() */ #ifdef WIN32 -# include <windows.h> /* need to include windows.h so _WIN32_IE is defined */ + /* Need to include windows.h so _WIN32_IE is defined. */ +# include <windows.h> # ifndef _WIN32_IE -# define _WIN32_IE 0x0400 /* minimal requirements for SHGetSpecialFolderPath on MINGW MSVC has this defined already */ + /* Minimal requirements for SHGetSpecialFolderPath on MINGW MSVC has this defined already. */ +# define _WIN32_IE 0x0400 # endif -# include <shlobj.h> /* for SHGetSpecialFolderPath, has to be done before BLI_winstuff - * because 'near' is disabled through BLI_windstuff */ + /* For SHGetSpecialFolderPath, has to be done before BLI_winstuff + * because 'near' is disabled through BLI_windstuff */ +# include <shlobj.h> # include "BLI_winstuff.h" #endif |