Cleanup: replace typdef with 'using'
Apply modernize-use-using with edits (as it strips out useful info).
This commit is contained in:
parent
b8ea968929
commit
a82836b6c2
|
@ -781,10 +781,10 @@ static bool rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Part
|
|||
return ret;
|
||||
}
|
||||
|
||||
typedef bool (*boid_rule_cb)(BoidRule *rule,
|
||||
BoidBrainData *data,
|
||||
BoidValues *val,
|
||||
ParticleData *pa);
|
||||
using boid_rule_cb = bool (*)(BoidRule *rule,
|
||||
BoidBrainData *data,
|
||||
BoidValues *val,
|
||||
ParticleData *pa);
|
||||
|
||||
static boid_rule_cb boid_rules[] = {
|
||||
rule_none,
|
||||
|
|
|
@ -113,8 +113,8 @@ void BKE_kelvinlet_grab_triscale(float radius_elem_disp[3],
|
|||
mul_v3_v3fl(radius_elem_disp, brush_delta, fade);
|
||||
}
|
||||
|
||||
typedef void (*kelvinlet_fn)(
|
||||
float[3], const float *, const float *, const float *, const KelvinletParams *);
|
||||
using kelvinlet_fn =
|
||||
void (*)(float[3], const float *, const float *, const float *, const KelvinletParams *);
|
||||
|
||||
static void sculpt_kelvinet_integrate(kelvinlet_fn kelvinlet,
|
||||
float r_disp[3],
|
||||
|
|
|
@ -1087,10 +1087,10 @@ static void reshape_subdiv_create(MultiresReshapeSmoothContext *reshape_smooth_c
|
|||
}
|
||||
|
||||
/* Callback to provide coarse position for subdivision surface topology at a reshape level. */
|
||||
typedef void(ReshapeSubdivCoarsePositionCb)(
|
||||
const MultiresReshapeSmoothContext *reshape_smooth_context,
|
||||
const Vertex *vertex,
|
||||
float r_P[3]);
|
||||
using ReshapeSubdivCoarsePositionCb =
|
||||
void(const MultiresReshapeSmoothContext *reshape_smooth_context,
|
||||
const Vertex *vertex,
|
||||
float r_P[3]);
|
||||
|
||||
/* Refine subdivision surface topology at a reshape level for new coarse vertices positions. */
|
||||
static void reshape_subdiv_refine(const MultiresReshapeSmoothContext *reshape_smooth_context,
|
||||
|
|
|
@ -2399,7 +2399,10 @@ static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, f
|
|||
#define COLLISION_MIN_DISTANCE 0.0001f
|
||||
#define COLLISION_ZERO 0.00001f
|
||||
#define COLLISION_INIT_STEP 0.00008f
|
||||
typedef float (*NRDistanceFunc)(float *p, float radius, ParticleCollisionElement *pce, float *nor);
|
||||
using NRDistanceFunc = float (*)(float *p,
|
||||
float radius,
|
||||
ParticleCollisionElement *pce,
|
||||
float *nor);
|
||||
static float nr_signed_distance_to_plane(float *p,
|
||||
float radius,
|
||||
ParticleCollisionElement *pce,
|
||||
|
|
|
@ -1117,7 +1117,7 @@ PTCacheID BKE_ptcache_id_find(Object *ob, Scene *scene, PointCache *cache)
|
|||
*
|
||||
* If the function returns false, then foreach() loop aborts.
|
||||
*/
|
||||
typedef bool (*ForeachPtcacheCb)(PTCacheID *pid, void *userdata);
|
||||
using ForeachPtcacheCb = bool (*)(PTCacheID *pid, void *userdata);
|
||||
|
||||
static bool foreach_object_particle_ptcache(Object *object,
|
||||
ForeachPtcacheCb callback,
|
||||
|
|
|
@ -1285,7 +1285,7 @@ void BKE_tracking_stabilization_data_get(MovieClip *clip,
|
|||
discard_stabilization_working_context(ctx);
|
||||
}
|
||||
|
||||
typedef void (*interpolation_func)(const ImBuf *, ImBuf *, float, float, int, int);
|
||||
using interpolation_func = void (*)(const ImBuf *, ImBuf *, float, float, int, int);
|
||||
|
||||
struct TrackingStabilizeFrameInterpolationData {
|
||||
ImBuf *ibuf;
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace blender::deg {
|
|||
|
||||
/* Use pointer for map value to ensure span returned by get_all_registered_graphs
|
||||
* remains unchanged as other mains are added or removed. */
|
||||
typedef std::unique_ptr<VectorSet<Depsgraph *>> GraphSetPtr;
|
||||
using GraphSetPtr = std::unique_ptr<VectorSet<Depsgraph *>>;
|
||||
struct GraphRegistry {
|
||||
Map<Main *, GraphSetPtr> map;
|
||||
std::mutex mutex;
|
||||
|
|
|
@ -1125,7 +1125,7 @@ static bool rearrange_island_bottom(ListBase *list, tReorderChannelIsland *islan
|
|||
* \param island: Island to be moved
|
||||
* \return Whether operation was a success
|
||||
*/
|
||||
typedef bool (*AnimChanRearrangeFp)(ListBase *list, tReorderChannelIsland *island);
|
||||
using AnimChanRearrangeFp = bool (*)(ListBase *list, tReorderChannelIsland *island);
|
||||
|
||||
/* get rearranging function, given 'rearrange' mode */
|
||||
static AnimChanRearrangeFp rearrange_get_mode_func(eRearrangeAnimChan_Mode mode)
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
#include "DEG_depsgraph.h"
|
||||
|
||||
typedef void (*PanelDrawFn)(const bContext *, Panel *);
|
||||
using PanelDrawFn = void (*)(const bContext *, Panel *);
|
||||
static void fmodifier_panel_header(const bContext *C, Panel *panel);
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
|
|
@ -696,24 +696,24 @@ static bool point_is_selected(PTCacheEditPoint *point)
|
|||
/** \name Iterators
|
||||
* \{ */
|
||||
|
||||
typedef void (*ForPointFunc)(PEData *data, int point_index);
|
||||
typedef void (*ForHitPointFunc)(PEData *data, int point_index, float mouse_distance);
|
||||
using ForPointFunc = void (*)(PEData *data, int point_index);
|
||||
using ForHitPointFunc = void (*)(PEData *data, int point_index, float mouse_distance);
|
||||
|
||||
typedef void (*ForKeyFunc)(PEData *data, int point_index, int key_index, bool is_inside);
|
||||
using ForKeyFunc = void (*)(PEData *data, int point_index, int key_index, bool is_inside);
|
||||
|
||||
typedef void (*ForKeyMatFunc)(PEData *data,
|
||||
const float mat[4][4],
|
||||
const float imat[4][4],
|
||||
int point_index,
|
||||
int key_index,
|
||||
PTCacheEditKey *key);
|
||||
typedef void (*ForHitKeyMatFunc)(PEData *data,
|
||||
float mat[4][4],
|
||||
float imat[4][4],
|
||||
int point_index,
|
||||
int key_index,
|
||||
PTCacheEditKey *key,
|
||||
float mouse_distance);
|
||||
using ForKeyMatFunc = void (*)(PEData *data,
|
||||
const float mat[4][4],
|
||||
const float imat[4][4],
|
||||
int point_index,
|
||||
int key_index,
|
||||
PTCacheEditKey *key);
|
||||
using ForHitKeyMatFunc = void (*)(PEData *data,
|
||||
float mat[4][4],
|
||||
float imat[4][4],
|
||||
int point_index,
|
||||
int key_index,
|
||||
PTCacheEditKey *key,
|
||||
float mouse_distance);
|
||||
|
||||
enum eParticleSelectFlag {
|
||||
PSEL_NEAREST = (1 << 0),
|
||||
|
|
|
@ -1298,7 +1298,7 @@ static eContextResult screen_ctx_ui_list(const bContext *C, bContextDataResult *
|
|||
|
||||
/* Registry of context callback functions. */
|
||||
|
||||
typedef eContextResult (*context_callback)(const bContext *C, bContextDataResult *result);
|
||||
using context_callback = eContextResult (*)(const bContext *C, bContextDataResult *result);
|
||||
static GHash *ed_screen_context_functions = nullptr;
|
||||
|
||||
static void free_context_function_ghash(void * /*user_data*/)
|
||||
|
|
|
@ -66,7 +66,7 @@ struct my_error_mgr {
|
|||
jmp_buf setjmp_buffer; /* for return to caller */
|
||||
};
|
||||
|
||||
typedef my_error_mgr *my_error_ptr;
|
||||
using my_error_ptr = my_error_mgr *;
|
||||
|
||||
static void jpeg_error(j_common_ptr cinfo)
|
||||
{
|
||||
|
@ -101,7 +101,7 @@ struct my_source_mgr {
|
|||
JOCTET terminal[2];
|
||||
};
|
||||
|
||||
typedef my_source_mgr *my_src_ptr;
|
||||
using my_src_ptr = my_source_mgr *;
|
||||
|
||||
static void init_source(j_decompress_ptr cinfo)
|
||||
{
|
||||
|
|
|
@ -486,8 +486,8 @@ void IMB_rectcpy(ImBuf *dbuf,
|
|||
false);
|
||||
}
|
||||
|
||||
typedef void (*IMB_blend_func)(uchar *dst, const uchar *src1, const uchar *src2);
|
||||
typedef void (*IMB_blend_func_float)(float *dst, const float *src1, const float *src2);
|
||||
using IMB_blend_func = void (*)(uchar *dst, const uchar *src1, const uchar *src2);
|
||||
using IMB_blend_func_float = void (*)(float *dst, const float *src1, const float *src2);
|
||||
|
||||
void IMB_rectblend(ImBuf *dbuf,
|
||||
const ImBuf *obuf,
|
||||
|
|
|
@ -154,7 +154,7 @@ static PointerRNA rna_Test_test_get(PointerRNA *ptr)
|
|||
#else
|
||||
|
||||
/* local convenience types */
|
||||
typedef void(CollectionDefFunc)(BlenderRNA *brna, PropertyRNA *cprop);
|
||||
using CollectionDefFunc = void(BlenderRNA *brna, PropertyRNA *cprop);
|
||||
|
||||
struct MainCollectionDef {
|
||||
const char *identifier;
|
||||
|
|
|
@ -23,7 +23,7 @@ static void node_declare(NodeDeclarationBuilder &b)
|
|||
b.add_output<decl::Float>("Total Cost").reference_pass_all();
|
||||
}
|
||||
|
||||
typedef std::pair<float, int> VertPriority;
|
||||
using VertPriority = std::pair<float, int>;
|
||||
|
||||
struct EdgeVertMap {
|
||||
Array<Vector<int>> edges_by_vertex_map;
|
||||
|
|
|
@ -51,7 +51,7 @@ static void do_proc(float *result,
|
|||
}
|
||||
}
|
||||
|
||||
typedef void (*MapFn)(Tex *tex, bNodeStack **in, TexParams *p, const short thread);
|
||||
using MapFn = void (*)(Tex *tex, bNodeStack **in, TexParams *p, const short thread);
|
||||
|
||||
static void texfn(
|
||||
float *result, TexParams *p, bNode *node, bNodeStack **in, MapFn map_inputs, short thread)
|
||||
|
|
|
@ -36,10 +36,10 @@
|
|||
|
||||
struct ItemConvertArgData;
|
||||
|
||||
typedef void (*ItemConvertFunc)(const ItemConvertArgData *arg, PyObject *, char *);
|
||||
typedef int (*ItemTypeCheckFunc)(PyObject *);
|
||||
typedef void (*RNA_SetArrayFunc)(PointerRNA *, PropertyRNA *, const char *);
|
||||
typedef void (*RNA_SetIndexFunc)(PointerRNA *, PropertyRNA *, int index, void *);
|
||||
using ItemConvertFunc = void (*)(const ItemConvertArgData *arg, PyObject *py_data, char *data);
|
||||
using ItemTypeCheckFunc = int (*)(PyObject *py_data);
|
||||
using RNA_SetArrayFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, const char *data);
|
||||
using RNA_SetIndexFunc = void (*)(PointerRNA *ptr, PropertyRNA *prop, int index, void *data_item);
|
||||
|
||||
struct ItemConvertArgData {
|
||||
union {
|
||||
|
|
|
@ -1077,8 +1077,8 @@ static void do_mul_effect(const SeqRenderData *context,
|
|||
/** \name Blend Mode Effect
|
||||
* \{ */
|
||||
|
||||
typedef void (*IMB_blend_func_byte)(uchar *dst, const uchar *src1, const uchar *src2);
|
||||
typedef void (*IMB_blend_func_float)(float *dst, const float *src1, const float *src2);
|
||||
using IMB_blend_func_byte = void (*)(uchar *dst, const uchar *src1, const uchar *src2);
|
||||
using IMB_blend_func_float = void (*)(float *dst, const float *src1, const float *src2);
|
||||
|
||||
BLI_INLINE void apply_blend_function_byte(float fac,
|
||||
int x,
|
||||
|
|
|
@ -43,13 +43,13 @@ static bool modifierTypesInit = false;
|
|||
/** \name Modifier Multi-Threading Utilities
|
||||
* \{ */
|
||||
|
||||
typedef void (*modifier_apply_threaded_cb)(int width,
|
||||
int height,
|
||||
uchar *rect,
|
||||
float *rect_float,
|
||||
uchar *mask_rect,
|
||||
const float *mask_rect_float,
|
||||
void *data_v);
|
||||
using modifier_apply_threaded_cb = void (*)(int width,
|
||||
int height,
|
||||
uchar *rect,
|
||||
float *rect_float,
|
||||
uchar *mask_rect,
|
||||
const float *mask_rect_float,
|
||||
void *data_v);
|
||||
|
||||
struct ModifierInitData {
|
||||
ImBuf *ibuf;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
static wmMsgTypeInfo wm_msg_types[WM_MSG_TYPE_NUM] = {{{nullptr}}};
|
||||
|
||||
typedef void (*wmMsgTypeInitFn)(wmMsgTypeInfo *);
|
||||
using wmMsgTypeInitFn = void (*)(wmMsgTypeInfo *);
|
||||
|
||||
static wmMsgTypeInitFn wm_msg_init_fn[WM_MSG_TYPE_NUM] = {
|
||||
WM_msgtypeinfo_init_rna,
|
||||
|
|
Loading…
Reference in New Issue