Cleanup: simplify struct declarations in C++

Replace `typedef struct X {} X;` with `struct X {};`

In some cases the first and last name didn't match although this
is rarely useful, even a typo in some cases, e.g. TrachPathPoint.
This commit is contained in:
Campbell Barton 2023-07-02 19:37:19 +10:00
parent ffab21a3ef
commit 345d1a4b44
49 changed files with 219 additions and 222 deletions

@ -29,7 +29,7 @@ enum TransformType {
#define COLORSPACE_SRGB ((OCIO_ConstColorSpaceRcPtr *)2) #define COLORSPACE_SRGB ((OCIO_ConstColorSpaceRcPtr *)2)
#define COLORSPACE_DATA ((OCIO_ConstColorSpaceRcPtr *)3) #define COLORSPACE_DATA ((OCIO_ConstColorSpaceRcPtr *)3)
typedef struct OCIO_PackedImageDescription { struct OCIO_PackedImageDescription {
float *data; float *data;
long width; long width;
long height; long height;
@ -37,7 +37,7 @@ typedef struct OCIO_PackedImageDescription {
long chanStrideBytes; long chanStrideBytes;
long xStrideBytes; long xStrideBytes;
long yStrideBytes; long yStrideBytes;
} OCIO_PackedImageDescription; };
struct FallbackTransform { struct FallbackTransform {
FallbackTransform() : type(TRANSFORM_UNKNOWN), scale(1.0f), exponent(1.0f) {} FallbackTransform() : type(TRANSFORM_UNKNOWN), scale(1.0f), exponent(1.0f) {}

@ -227,7 +227,7 @@ static void setup_app_userdef(BlendFileData *bfd)
* NOTE: this is only used when actually loading a real `.blend` file, * NOTE: this is only used when actually loading a real `.blend` file,
* loading of memfile undo steps does not need it. * loading of memfile undo steps does not need it.
*/ */
typedef struct ReuseOldBMainData { struct ReuseOldBMainData {
Main *new_bmain; Main *new_bmain;
Main *old_bmain; Main *old_bmain;
@ -245,7 +245,7 @@ typedef struct ReuseOldBMainData {
/** Used to find matching IDs by name/lib in new main, to remap ID usages of data ported over /** Used to find matching IDs by name/lib in new main, to remap ID usages of data ported over
* from old main. */ * from old main. */
IDNameLib_Map *id_map; IDNameLib_Map *id_map;
} ReuseOldBMainData; };
/** Search for all libraries in `old_bmain` that are also in `new_bmain` (i.e. different Library /** Search for all libraries in `old_bmain` that are also in `new_bmain` (i.e. different Library
* IDs having the same absolute filepath), and create a remapping rule for these. * IDs having the same absolute filepath), and create a remapping rule for these.

@ -187,11 +187,11 @@ float (*BKE_mask_spline_differentiate(
/* ** feather points self-intersection collapse routine ** */ /* ** feather points self-intersection collapse routine ** */
typedef struct FeatherEdgesBucket { struct FeatherEdgesBucket {
int tot_segment; int tot_segment;
int (*segments)[2]; int (*segments)[2];
int alloc_segment; int alloc_segment;
} FeatherEdgesBucket; };
static void feather_bucket_add_edge(FeatherEdgesBucket *bucket, int start, int end) static void feather_bucket_add_edge(FeatherEdgesBucket *bucket, int start, int end)
{ {

@ -153,7 +153,7 @@ static ScanFillVert *scanfill_vert_add_v2_with_depth(ScanFillContext *sf_ctx,
* *
* \note internal use only. * \note internal use only.
*/ */
typedef struct MaskRasterLayer { struct MaskRasterLayer {
/* geometry */ /* geometry */
uint face_tot; uint face_tot;
uint (*face_array)[4]; /* access coords tri/quad */ uint (*face_array)[4]; /* access coords tri/quad */
@ -175,10 +175,9 @@ typedef struct MaskRasterLayer {
char blend; char blend;
char blend_flag; char blend_flag;
char falloff; char falloff;
};
} MaskRasterLayer; struct MaskRasterSplineInfo {
typedef struct MaskRasterSplineInfo {
/* body of the spline */ /* body of the spline */
uint vertex_offset; uint vertex_offset;
uint vertex_total; uint vertex_total;
@ -188,7 +187,7 @@ typedef struct MaskRasterSplineInfo {
uint vertex_total_cap_tail; uint vertex_total_cap_tail;
bool is_cyclic; bool is_cyclic;
} MaskRasterSplineInfo; };
/** /**
* opaque local struct for mask pixel lookup, each MaskLayer needs one of these * opaque local struct for mask pixel lookup, each MaskLayer needs one of these
@ -1424,14 +1423,14 @@ float BKE_maskrasterize_handle_sample(MaskRasterHandle *mr_handle, const float x
return value; return value;
} }
typedef struct MaskRasterizeBufferData { struct MaskRasterizeBufferData {
MaskRasterHandle *mr_handle; MaskRasterHandle *mr_handle;
float x_inv, y_inv; float x_inv, y_inv;
float x_px_ofs, y_px_ofs; float x_px_ofs, y_px_ofs;
uint width; uint width;
float *buffer; float *buffer;
} MaskRasterizeBufferData; };
static void maskrasterize_buffer_cb(void *__restrict userdata, static void maskrasterize_buffer_cb(void *__restrict userdata,
const int y, const int y,

@ -48,62 +48,62 @@
/* Data types */ /* Data types */
/** Corner of a cube. */ /** Corner of a cube. */
typedef struct corner { struct CORNER {
int i, j, k; /* (i, j, k) is index within lattice */ int i, j, k; /* (i, j, k) is index within lattice */
float co[3], value; /* location and function value */ float co[3], value; /* location and function value */
corner *next; CORNER *next;
} CORNER; };
/** Partitioning cell (cube). */ /** Partitioning cell (cube). */
typedef struct cube { struct CUBE {
int i, j, k; /* lattice location of cube */ int i, j, k; /* lattice location of cube */
CORNER *corners[8]; /* eight corners */ CORNER *corners[8]; /* eight corners */
} CUBE; };
/** Linked list of cubes acting as stack. */ /** Linked list of cubes acting as stack. */
typedef struct cubes { struct CUBES {
CUBE cube; /* a single cube */ CUBE cube; /* a single cube */
cubes *next; /* remaining elements */ CUBES *next; /* remaining elements */
} CUBES; };
/** List of cube locations. */ /** List of cube locations. */
typedef struct centerlist { struct CENTERLIST {
int i, j, k; /* cube location */ int i, j, k; /* cube location */
centerlist *next; /* remaining elements */ CENTERLIST *next; /* remaining elements */
} CENTERLIST; };
/** List of edges. */ /** List of edges. */
typedef struct edgelist { struct EDGELIST {
int i1, j1, k1, i2, j2, k2; /* edge corner ids */ int i1, j1, k1, i2, j2, k2; /* edge corner ids */
int vid; /* vertex id */ int vid; /* vertex id */
edgelist *next; /* remaining elements */ EDGELIST *next; /* remaining elements */
} EDGELIST; };
/** List of integers. */ /** List of integers. */
typedef struct intlist { struct INTLIST {
int i; /* an integer */ int i; /* an integer */
intlist *next; /* remaining elements */ INTLIST *next; /* remaining elements */
} INTLIST; };
/** List of list of integers. */ /** List of list of integers. */
typedef struct intlists { struct INTLISTS {
INTLIST *list; /* a list of integers */ INTLIST *list; /* a list of integers */
intlists *next; /* remaining elements */ INTLISTS *next; /* remaining elements */
} INTLISTS; };
/** An AABB with pointer to metal-elem. */ /** An AABB with pointer to metal-elem. */
typedef struct Box { struct Box {
float min[3], max[3]; float min[3], max[3];
const MetaElem *ml; const MetaElem *ml;
} Box; };
typedef struct MetaballBVHNode { /* BVH node */ struct MetaballBVHNode { /* node */
Box bb[2]; /* AABB of children */ Box bb[2]; /* AABB of children */
MetaballBVHNode *child[2]; MetaballBVHNode *child[2];
} MetaballBVHNode; };
/** Parameters, storage. */ /** Parameters, storage. */
typedef struct process { struct PROCESS {
float thresh, size; /* mball threshold, single cube size */ float thresh, size; /* mball threshold, single cube size */
float delta; /* small delta for calculating normals */ float delta; /* small delta for calculating normals */
uint converge_res; /* converge procedure resolution (more = slower) */ uint converge_res; /* converge procedure resolution (more = slower) */
@ -131,7 +131,7 @@ typedef struct process {
/* memory allocation from common pool */ /* memory allocation from common pool */
MemArena *pgn_elements; MemArena *pgn_elements;
} PROCESS; };
/* Forward declarations */ /* Forward declarations */
static int vertid(PROCESS *process, const CORNER *c1, const CORNER *c2); static int vertid(PROCESS *process, const CORNER *c1, const CORNER *c2);

@ -1273,7 +1273,7 @@ void psys_interpolate_particle(
} }
} }
typedef struct ParticleInterpolationData { struct ParticleInterpolationData {
HairKey *hkey[2]; HairKey *hkey[2];
Mesh *mesh; Mesh *mesh;
@ -1292,7 +1292,7 @@ typedef struct ParticleInterpolationData {
/** Die on this frame, see #ParticleData.dietime for details. */ /** Die on this frame, see #ParticleData.dietime for details. */
float dietime; float dietime;
int bspline; int bspline;
} ParticleInterpolationData; };
/** /**
* Assumes pointcache->mem_cache exists, so for disk cached particles * Assumes pointcache->mem_cache exists, so for disk cached particles
* call #psys_make_temp_pointcache() before use. * call #psys_make_temp_pointcache() before use.
@ -3569,14 +3569,14 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra, const bool use_re
} }
} }
typedef struct CacheEditrPathsIterData { struct CacheEditrPathsIterData {
Object *object; Object *object;
PTCacheEdit *edit; PTCacheEdit *edit;
ParticleSystemModifierData *psmd; ParticleSystemModifierData *psmd;
ParticleData *pa; ParticleData *pa;
int segments; int segments;
bool use_weight; bool use_weight;
} CacheEditrPathsIterData; };
static void psys_cache_edit_paths_iter(void *__restrict iter_data_v, static void psys_cache_edit_paths_iter(void *__restrict iter_data_v,
const int iter, const int iter,

@ -54,13 +54,13 @@
#include "libmv-capi.h" #include "libmv-capi.h"
#include "tracking_private.h" #include "tracking_private.h"
typedef struct MovieDistortion { struct MovieDistortion {
libmv_CameraIntrinsics *intrinsics; libmv_CameraIntrinsics *intrinsics;
/* Parameters needed for coordinates normalization. */ /* Parameters needed for coordinates normalization. */
float principal_px[2]; float principal_px[2];
float pixel_aspect; float pixel_aspect;
float focal; float focal;
} MovieDistortion; };
static struct { static struct {
ListBase tracks; ListBase tracks;
@ -164,11 +164,11 @@ void BKE_tracking_free(MovieTracking *tracking)
tracking_dopesheet_free(&tracking->dopesheet); tracking_dopesheet_free(&tracking->dopesheet);
} }
typedef struct TrackingCopyContext { struct TrackingCopyContext {
/* Map from point and plane track pointer from the source object to the destination object. */ /* Map from point and plane track pointer from the source object to the destination object. */
GHash *old_to_new_track_map; GHash *old_to_new_track_map;
GHash *old_to_new_plane_track_map; GHash *old_to_new_plane_track_map;
} TrackingCopyContext; };
static TrackingCopyContext tracking_copy_context_new(void) static TrackingCopyContext tracking_copy_context_new(void)
{ {
@ -1077,11 +1077,11 @@ static bGPDlayer *track_mask_gpencil_layer_get(const MovieTrackingTrack *track)
return nullptr; return nullptr;
} }
typedef struct TrackMaskSetPixelData { struct TrackMaskSetPixelData {
float *mask; float *mask;
int mask_width; int mask_width;
int mask_height; int mask_height;
} TrackMaskSetPixelData; };
static void track_mask_set_pixel_cb(int x, int x_end, int y, void *user_data) static void track_mask_set_pixel_cb(int x, int x_end, int y, void *user_data)
{ {

@ -31,16 +31,16 @@
#include "libmv-capi.h" #include "libmv-capi.h"
#include "tracking_private.h" #include "tracking_private.h"
typedef struct AutoTrackClip { struct AutoTrackClip {
MovieClip *clip; MovieClip *clip;
/* Dimensions of movie frame, in pixels. /* Dimensions of movie frame, in pixels.
* *
* NOTE: All frames within a clip are expected to have match3ed dimensions. */ * NOTE: All frames within a clip are expected to have match3ed dimensions. */
int width, height; int width, height;
} AutoTrackClip; };
typedef struct AutoTrackTrack { struct AutoTrackTrack {
/* Index of a clip from `AutoTrackContext::autotrack_clips` this track belongs to. */ /* Index of a clip from `AutoTrackContext::autotrack_clips` this track belongs to. */
int clip_index; int clip_index;
@ -53,11 +53,11 @@ typedef struct AutoTrackTrack {
* Is usually initialized based on track's selection. Non-trackable tracks are still added to the * Is usually initialized based on track's selection. Non-trackable tracks are still added to the
* context to provide AutoTrack all knowledge about what is going on in the scene. */ * context to provide AutoTrack all knowledge about what is going on in the scene. */
bool is_trackable; bool is_trackable;
} AutoTrackTrack; };
typedef struct AutoTrackMarker { struct AutoTrackMarker {
libmv_Marker libmv_marker; libmv_Marker libmv_marker;
} AutoTrackMarker; };
/* Result of tracking step for a single marker. /* Result of tracking step for a single marker.
* *
@ -65,15 +65,15 @@ typedef struct AutoTrackMarker {
* *
* On failure marker's frame number is initialized to frame number where it was attempted to be * On failure marker's frame number is initialized to frame number where it was attempted to be
* tracked to. The position and other fields of tracked marker are the same as the input. */ * tracked to. The position and other fields of tracked marker are the same as the input. */
typedef struct AutoTrackTrackingResult { struct AutoTrackTrackingResult {
AutoTrackTrackingResult *next, *prev; AutoTrackTrackingResult *next, *prev;
bool success; bool success;
libmv_Marker libmv_marker; libmv_Marker libmv_marker;
libmv_TrackRegionResult libmv_result; libmv_TrackRegionResult libmv_result;
} AutoTrackTrackingResult; };
typedef struct AutoTrackContext { struct AutoTrackContext {
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* Invariant part. * Invariant part.
* Stays unchanged during the tracking process. * Stays unchanged during the tracking process.
@ -133,7 +133,7 @@ typedef struct AutoTrackContext {
int synchronized_scene_frame; int synchronized_scene_frame;
SpinLock spin_lock; SpinLock spin_lock;
} AutoTrackContext; };
/* -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- */
/** \name Marker coordinate system conversion. /** \name Marker coordinate system conversion.
@ -624,9 +624,9 @@ void BKE_autotrack_context_start(AutoTrackContext *context)
/* NOTE: This is a TLS in a sense that this struct is never accessed from multiple threads, and /* NOTE: This is a TLS in a sense that this struct is never accessed from multiple threads, and
* that threads are re-using the struct as much as possible. */ * that threads are re-using the struct as much as possible. */
typedef struct AutoTrackTLS { struct AutoTrackTLS {
ListBase results; /* Elements of `AutoTrackTrackingResult`. */ ListBase results; /* Elements of `AutoTrackTrackingResult`. */
} AutoTrackTLS; };
static void autotrack_context_step_cb(void *__restrict userdata, static void autotrack_context_step_cb(void *__restrict userdata,
const int marker_index, const int marker_index,

@ -32,7 +32,7 @@
#include "libmv-capi.h" #include "libmv-capi.h"
#include "tracking_private.h" #include "tracking_private.h"
typedef struct MovieReconstructContext { struct MovieReconstructContext {
libmv_Tracks *tracks; libmv_Tracks *tracks;
bool select_keyframes; bool select_keyframes;
int keyframe1, keyframe2; int keyframe1, keyframe2;
@ -53,15 +53,15 @@ typedef struct MovieReconstructContext {
/* Details about reconstruction error, reported by Libmv. */ /* Details about reconstruction error, reported by Libmv. */
char error_message[1024]; char error_message[1024];
} MovieReconstructContext; };
typedef struct ReconstructProgressData { struct ReconstructProgressData {
bool *stop; bool *stop;
bool *do_update; bool *do_update;
float *progress; float *progress;
char *stats_message; char *stats_message;
int message_size; int message_size;
} ReconstructProgressData; };
/* Create new libmv Tracks structure from blender's tracks list. */ /* Create new libmv Tracks structure from blender's tracks list. */
static libmv_Tracks *libmv_tracks_new(MovieClip *clip, ListBase *tracksbase, int width, int height) static libmv_Tracks *libmv_tracks_new(MovieClip *clip, ListBase *tracksbase, int width, int height)

@ -63,7 +63,7 @@ static float EPSILON_WEIGHT = 0.005f;
* This struct with private working data is associated to the local call context * This struct with private working data is associated to the local call context
* via `StabContext::private_track_data` * via `StabContext::private_track_data`
*/ */
typedef struct TrackStabilizationBase { struct TrackStabilizationBase {
float stabilization_offset_base[2]; float stabilization_offset_base[2];
/* measured relative to translated pivot */ /* measured relative to translated pivot */
@ -74,19 +74,19 @@ typedef struct TrackStabilizationBase {
bool is_init_for_stabilization; bool is_init_for_stabilization;
FCurve *track_weight_curve; FCurve *track_weight_curve;
} TrackStabilizationBase; };
/* Tracks are reordered for initialization, starting as close as possible to /* Tracks are reordered for initialization, starting as close as possible to
* anchor_frame * anchor_frame
*/ */
typedef struct TrackInitOrder { struct TrackInitOrder {
int sort_value; int sort_value;
int reference_frame; int reference_frame;
MovieTrackingTrack *data; MovieTrackingTrack *data;
} TrackInitOrder; };
/* Per frame private working data, for accessing possibly animated values. */ /* Per frame private working data, for accessing possibly animated values. */
typedef struct StabContext { struct StabContext {
MovieClip *clip; MovieClip *clip;
MovieTracking *tracking; MovieTracking *tracking;
MovieTrackingStabilization *stab; MovieTrackingStabilization *stab;
@ -98,7 +98,7 @@ typedef struct StabContext {
FCurve *target_rot; FCurve *target_rot;
FCurve *target_scale; FCurve *target_scale;
bool use_animation; bool use_animation;
} StabContext; };
static TrackStabilizationBase *access_stabilization_baseline_data(StabContext *ctx, static TrackStabilizationBase *access_stabilization_baseline_data(StabContext *ctx,
MovieTrackingTrack *track) MovieTrackingTrack *track)
@ -1287,13 +1287,13 @@ void BKE_tracking_stabilization_data_get(MovieClip *clip,
typedef void (*interpolation_func)(const ImBuf *, ImBuf *, float, float, int, int); typedef void (*interpolation_func)(const ImBuf *, ImBuf *, float, float, int, int);
typedef struct TrackingStabilizeFrameInterpolationData { struct TrackingStabilizeFrameInterpolationData {
ImBuf *ibuf; ImBuf *ibuf;
ImBuf *tmpibuf; ImBuf *tmpibuf;
float (*mat)[4]; float (*mat)[4];
interpolation_func interpolation; interpolation_func interpolation;
} TrackingStabilizeFrameInterpolationData; };
static void tracking_stabilize_frame_interpolation_cb(void *__restrict userdata, static void tracking_stabilize_frame_interpolation_cb(void *__restrict userdata,
const int j, const int j,

@ -1094,11 +1094,11 @@ static void write_thumb(WriteData *wd, const BlendThumbnail *thumb)
#define ID_BUFFER_STATIC_SIZE 8192 #define ID_BUFFER_STATIC_SIZE 8192
typedef struct BLO_Write_IDBuffer { struct BLO_Write_IDBuffer {
const IDTypeInfo *id_type; const IDTypeInfo *id_type;
ID *temp_id; ID *temp_id;
char id_buffer_static[ID_BUFFER_STATIC_SIZE]; char id_buffer_static[ID_BUFFER_STATIC_SIZE];
} BLO_Write_IDBuffer; };
static void id_buffer_init_for_id_type(BLO_Write_IDBuffer *id_buffer, const IDTypeInfo *id_type) static void id_buffer_init_for_id_type(BLO_Write_IDBuffer *id_buffer, const IDTypeInfo *id_type)
{ {

@ -405,7 +405,7 @@ static void bm_loop_flip_disp(const float source_axis_x[3],
disp[1] = (mat[0][0] * b[1] - b[0] * mat[1][0]) / d; disp[1] = (mat[0][0] * b[1] - b[0] * mat[1][0]) / d;
} }
typedef struct BMLoopInterpMultiresData { struct BMLoopInterpMultiresData {
BMLoop *l_dst; BMLoop *l_dst;
BMLoop *l_src_first; BMLoop *l_src_first;
int cd_loop_mdisp_offset; int cd_loop_mdisp_offset;
@ -419,7 +419,7 @@ typedef struct BMLoopInterpMultiresData {
int res; int res;
float d; float d;
} BMLoopInterpMultiresData; };
static void loop_interp_multires_cb(void *__restrict userdata, static void loop_interp_multires_cb(void *__restrict userdata,
const int ix, const int ix,

@ -50,14 +50,14 @@ static void bm_edge_tag_from_smooth(const float (*fnos)[3],
* assuming no other tool using it would run concurrently to clnors editing. */ * assuming no other tool using it would run concurrently to clnors editing. */
#define BM_LNORSPACE_UPDATE _FLAG_MF #define BM_LNORSPACE_UPDATE _FLAG_MF
typedef struct BMVertsCalcNormalsWithCoordsData { struct BMVertsCalcNormalsWithCoordsData {
/* Read-only data. */ /* Read-only data. */
const float (*fnos)[3]; const float (*fnos)[3];
const float (*vcos)[3]; const float (*vcos)[3];
/* Write data. */ /* Write data. */
float (*vnos)[3]; float (*vnos)[3];
} BMVertsCalcNormalsWithCoordsData; };
BLI_INLINE void bm_vert_calc_normals_accum_loop(const BMLoop *l_iter, BLI_INLINE void bm_vert_calc_normals_accum_loop(const BMLoop *l_iter,
const float e1diff[3], const float e1diff[3],
@ -1161,7 +1161,7 @@ static void bm_mesh_loops_calc_normals__single_threaded(BMesh *bm,
} }
} }
typedef struct BMLoopsCalcNormalsWithCoordsData { struct BMLoopsCalcNormalsWithCoordsData {
/* Read-only data. */ /* Read-only data. */
const float (*fnos)[3]; const float (*fnos)[3];
const float (*vcos)[3]; const float (*vcos)[3];
@ -1174,15 +1174,15 @@ typedef struct BMLoopsCalcNormalsWithCoordsData {
/* Output. */ /* Output. */
float (*r_lnos)[3]; float (*r_lnos)[3];
MLoopNorSpaceArray *r_lnors_spacearr; MLoopNorSpaceArray *r_lnors_spacearr;
} BMLoopsCalcNormalsWithCoordsData; };
typedef struct BMLoopsCalcNormalsWithCoords_TLS { struct BMLoopsCalcNormalsWithCoords_TLS {
blender::Vector<blender::float3, 16> *edge_vectors; blender::Vector<blender::float3, 16> *edge_vectors;
/** Copied from #BMLoopsCalcNormalsWithCoordsData.r_lnors_spacearr when it's not nullptr. */ /** Copied from #BMLoopsCalcNormalsWithCoordsData.r_lnors_spacearr when it's not nullptr. */
MLoopNorSpaceArray *lnors_spacearr; MLoopNorSpaceArray *lnors_spacearr;
MLoopNorSpaceArray lnors_spacearr_buf; MLoopNorSpaceArray lnors_spacearr_buf;
} BMLoopsCalcNormalsWithCoords_TLS; };
static void bm_mesh_loops_calc_normals_for_vert_init_fn(const void *__restrict userdata, static void bm_mesh_loops_calc_normals_for_vert_init_fn(const void *__restrict userdata,
void *__restrict chunk) void *__restrict chunk)

@ -171,12 +171,12 @@ void OVERLAY_outline_cache_init(OVERLAY_Data *vedata)
} }
} }
typedef struct iterData { struct iterData {
Object *ob; Object *ob;
DRWShadingGroup *stroke_grp; DRWShadingGroup *stroke_grp;
int cfra; int cfra;
float plane[4]; float plane[4];
} iterData; };
static void gpencil_layer_cache_populate(bGPDlayer *gpl, static void gpencil_layer_cache_populate(bGPDlayer *gpl,
bGPDframe * /*gpf*/, bGPDframe * /*gpf*/,

@ -23,7 +23,7 @@ using namespace blender::draw;
using Instance = overlay::Instance; using Instance = overlay::Instance;
typedef struct SELECT_NextData { struct SELECT_NextData {
void *engine_type; void *engine_type;
DRWViewportEmptyList *fbl; DRWViewportEmptyList *fbl;
DRWViewportEmptyList *txl; DRWViewportEmptyList *txl;
@ -31,7 +31,7 @@ typedef struct SELECT_NextData {
DRWViewportEmptyList *stl; DRWViewportEmptyList *stl;
Instance *instance; Instance *instance;
} SELECT_NextData; };
static void SELECT_next_engine_init(void *vedata) static void SELECT_next_engine_init(void *vedata)
{ {

@ -30,13 +30,13 @@
#define MIM_RANGE_LEN 8 #define MIM_RANGE_LEN 8
#define GPU_TIMER_FALLOFF 0.1 #define GPU_TIMER_FALLOFF 0.1
typedef struct DRWTimer { struct DRWTimer {
uint32_t query[2]; uint32_t query[2];
uint64_t time_average; uint64_t time_average;
char name[MAX_TIMER_NAME]; char name[MAX_TIMER_NAME];
int lvl; /* Hierarchy level for nested timer. */ int lvl; /* Hierarchy level for nested timer. */
bool is_query; /* Does this timer actually perform queries or is it just a group. */ bool is_query; /* Does this timer actually perform queries or is it just a group. */
} DRWTimer; };
static struct DRWTimerPool { static struct DRWTimerPool {
DRWTimer *timers; DRWTimer *timers;

@ -2359,7 +2359,7 @@ static size_t animdata_filter_ds_materials(
/* ............ */ /* ............ */
/* Temporary context for modifier linked-data channel extraction */ /* Temporary context for modifier linked-data channel extraction */
typedef struct tAnimFilterModifiersContext { struct tAnimFilterModifiersContext {
bAnimContext *ac; /* anim editor context */ bAnimContext *ac; /* anim editor context */
bDopeSheet *ads; /* dopesheet filtering settings */ bDopeSheet *ads; /* dopesheet filtering settings */
@ -2367,7 +2367,7 @@ typedef struct tAnimFilterModifiersContext {
size_t items; /* number of channels created */ size_t items; /* number of channels created */
int filter_mode; /* flags for stuff we want to filter */ int filter_mode; /* flags for stuff we want to filter */
} tAnimFilterModifiersContext; };
/* dependency walker callback for modifier dependencies */ /* dependency walker callback for modifier dependencies */
static void animfilter_modifier_idpoin_cb(void *afm_ptr, Object *ob, ID **idpoin, int /*cb_flag*/) static void animfilter_modifier_idpoin_cb(void *afm_ptr, Object *ob, ID **idpoin, int /*cb_flag*/)

@ -42,11 +42,11 @@ static CLG_LogRef LOG = {"ed.undo.armature"};
/** \name Undo Conversion /** \name Undo Conversion
* \{ */ * \{ */
typedef struct UndoArmature { struct UndoArmature {
EditBone *act_edbone; EditBone *act_edbone;
ListBase lb; ListBase lb;
size_t undo_size; size_t undo_size;
} UndoArmature; };
static void undoarm_to_editarm(UndoArmature *uarm, bArmature *arm) static void undoarm_to_editarm(UndoArmature *uarm, bArmature *arm)
{ {
@ -119,17 +119,17 @@ static Object *editarm_object_from_context(bContext *C)
* \note This is similar for all edit-mode types. * \note This is similar for all edit-mode types.
* \{ */ * \{ */
typedef struct ArmatureUndoStep_Elem { struct ArmatureUndoStep_Elem {
ArmatureUndoStep_Elem *next, *prev; ArmatureUndoStep_Elem *next, *prev;
UndoRefID_Object obedit_ref; UndoRefID_Object obedit_ref;
UndoArmature data; UndoArmature data;
} ArmatureUndoStep_Elem; };
typedef struct ArmatureUndoStep { struct ArmatureUndoStep {
UndoStep step; UndoStep step;
ArmatureUndoStep_Elem *elems; ArmatureUndoStep_Elem *elems;
uint elems_len; uint elems_len;
} ArmatureUndoStep; };
static bool armature_undosys_poll(bContext *C) static bool armature_undosys_poll(bContext *C)
{ {

@ -366,11 +366,11 @@ float laplacian_system_get_solution(LaplacianSystem *sys, int v)
#define WEIGHT_LIMIT_END 0.025f #define WEIGHT_LIMIT_END 0.025f
#define DISTANCE_EPSILON 1e-4f #define DISTANCE_EPSILON 1e-4f
typedef struct BVHCallbackUserData { struct BVHCallbackUserData {
float start[3]; float start[3];
float vec[3]; float vec[3];
LaplacianSystem *sys; LaplacianSystem *sys;
} BVHCallbackUserData; };
static void bvh_callback(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) static void bvh_callback(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
{ {
@ -868,7 +868,7 @@ static const int MESHDEFORM_OFFSET[7][3] = {
{0, 0, -1}, {0, 0, -1},
}; };
typedef struct MDefBoundIsect { struct MDefBoundIsect {
/* intersection on the cage 'cagecos' */ /* intersection on the cage 'cagecos' */
float co[3]; float co[3];
/* non-facing intersections are considered interior */ /* non-facing intersections are considered interior */
@ -879,15 +879,15 @@ typedef struct MDefBoundIsect {
float len; float len;
/* weights aligned with the polygons's loop indices */ /* weights aligned with the polygons's loop indices */
float poly_weights[0]; float poly_weights[0];
} MDefBoundIsect; };
typedef struct MDefBindInfluence { struct MDefBindInfluence {
MDefBindInfluence *next; MDefBindInfluence *next;
float weight; float weight;
int vertex; int vertex;
} MDefBindInfluence; };
typedef struct MeshDeformBind { struct MeshDeformBind {
/* grid dimensions */ /* grid dimensions */
float min[3], max[3]; float min[3], max[3];
float width[3], halfwidth[3]; float width[3], halfwidth[3];
@ -926,9 +926,9 @@ typedef struct MeshDeformBind {
blender::Span<int> looptri_polys; blender::Span<int> looptri_polys;
blender::Span<blender::float3> poly_normals; blender::Span<blender::float3> poly_normals;
} cagemesh_cache; } cagemesh_cache;
} MeshDeformBind; };
typedef struct MeshDeformIsect { struct MeshDeformIsect {
float start[3]; float start[3];
float vec[3]; float vec[3];
float vec_length; float vec_length;
@ -936,8 +936,7 @@ typedef struct MeshDeformIsect {
bool isect; bool isect;
float u, v; float u, v;
};
} MeshDeformIsect;
/* ray intersection */ /* ray intersection */

@ -183,16 +183,16 @@ static Object *editcurve_object_from_context(bContext *C)
* \note This is similar for all edit-mode types. * \note This is similar for all edit-mode types.
* \{ */ * \{ */
typedef struct CurveUndoStep_Elem { struct CurveUndoStep_Elem {
UndoRefID_Object obedit_ref; UndoRefID_Object obedit_ref;
UndoCurve data; UndoCurve data;
} CurveUndoStep_Elem; };
typedef struct CurveUndoStep { struct CurveUndoStep {
UndoStep step; UndoStep step;
CurveUndoStep_Elem *elems; CurveUndoStep_Elem *elems;
uint elems_len; uint elems_len;
} CurveUndoStep; };
static bool curve_undosys_poll(bContext *C) static bool curve_undosys_poll(bContext *C)
{ {

@ -32,12 +32,12 @@
#include "gpencil_intern.h" #include "gpencil_intern.h"
typedef struct bGPundonode { struct bGPundonode {
bGPundonode *next, *prev; bGPundonode *next, *prev;
char name[BKE_UNDO_STR_MAX]; char name[BKE_UNDO_STR_MAX];
bGPdata *gpd; bGPdata *gpd;
} bGPundonode; };
static ListBase undo_nodes = {nullptr, nullptr}; static ListBase undo_nodes = {nullptr, nullptr};
static bGPundonode *cur_node = nullptr; static bGPundonode *cur_node = nullptr;

@ -198,7 +198,7 @@ enum {
SLIDE_ACTION_SPLINE = 4, SLIDE_ACTION_SPLINE = 4,
}; };
typedef struct SlidePointData { struct SlidePointData {
/* Generic fields. */ /* Generic fields. */
short event_invoke_type; short event_invoke_type;
int action; int action;
@ -235,7 +235,7 @@ typedef struct SlidePointData {
/* Feather sliding. */ /* Feather sliding. */
float prev_feather_coord[2]; float prev_feather_coord[2];
float weight, weight_scalar; float weight, weight_scalar;
} SlidePointData; };
static void mask_point_undistort_pos(SpaceClip *sc, float r_co[2], const float co[2]) static void mask_point_undistort_pos(SpaceClip *sc, float r_co[2], const float co[2])
{ {
@ -937,7 +937,7 @@ void MASK_OT_slide_point(wmOperatorType *ot)
/******************** slide spline curvature *********************/ /******************** slide spline curvature *********************/
typedef struct SlideSplineCurvatureData { struct SlideSplineCurvatureData {
short event_invoke_type; short event_invoke_type;
Mask *mask; Mask *mask;
@ -954,7 +954,7 @@ typedef struct SlideSplineCurvatureData {
float prev_spline_coord[2]; float prev_spline_coord[2];
float P0[2], P1[2], P2[2], P3[3]; float P0[2], P1[2], P2[2], P3[3];
} SlideSplineCurvatureData; };
static void cancel_slide_spline_curvature(SlideSplineCurvatureData *slide_data) static void cancel_slide_spline_curvature(SlideSplineCurvatureData *slide_data)
{ {

@ -126,20 +126,20 @@
#define NO_ACTIVE_LAYER ATTR_DOMAIN_AUTO #define NO_ACTIVE_LAYER ATTR_DOMAIN_AUTO
typedef struct UndoSculpt { struct UndoSculpt {
ListBase nodes; ListBase nodes;
size_t undo_size; size_t undo_size;
} UndoSculpt; };
typedef struct SculptAttrRef { struct SculptAttrRef {
eAttrDomain domain; eAttrDomain domain;
eCustomDataType type; eCustomDataType type;
char name[MAX_CUSTOMDATA_LAYER_NAME]; char name[MAX_CUSTOMDATA_LAYER_NAME];
bool was_set; bool was_set;
} SculptAttrRef; };
typedef struct SculptUndoStep { struct SculptUndoStep {
UndoStep step; UndoStep step;
/* NOTE: will split out into list for multi-object-sculpt-mode. */ /* NOTE: will split out into list for multi-object-sculpt-mode. */
UndoSculpt data; UndoSculpt data;
@ -155,7 +155,7 @@ typedef struct SculptUndoStep {
#ifdef SCULPT_UNDO_DEBUG #ifdef SCULPT_UNDO_DEBUG
int id; int id;
#endif #endif
} SculptUndoStep; };
static UndoSculpt *sculpt_undo_get_nodes(void); static UndoSculpt *sculpt_undo_get_nodes(void);
static bool sculpt_attribute_ref_equals(SculptAttrRef *a, SculptAttrRef *b); static bool sculpt_attribute_ref_equals(SculptAttrRef *a, SculptAttrRef *b);

@ -393,10 +393,10 @@ enum {
PATH_POINT_FLAG_KEYFRAME = (1 << 0), PATH_POINT_FLAG_KEYFRAME = (1 << 0),
}; };
typedef struct TrachPathPoint { struct TrackPathPoint {
float co[2]; float co[2];
uchar flag; uchar flag;
} TrackPathPoint; };
static void marker_to_path_point(SpaceClip *sc, static void marker_to_path_point(SpaceClip *sc,
const MovieTrackingTrack *track, const MovieTrackingTrack *track,

@ -655,7 +655,7 @@ void ED_space_clip_set_mask(bContext *C, SpaceClip *sc, Mask *mask)
/** \name Pre-Fetching Functions /** \name Pre-Fetching Functions
* \{ */ * \{ */
typedef struct PrefetchJob { struct PrefetchJob {
/** Clip into which cache the frames will be pre-fetched into. */ /** Clip into which cache the frames will be pre-fetched into. */
MovieClip *clip; MovieClip *clip;
@ -668,9 +668,9 @@ typedef struct PrefetchJob {
int start_frame, current_frame, end_frame; int start_frame, current_frame, end_frame;
short render_size, render_flag; short render_size, render_flag;
} PrefetchJob; };
typedef struct PrefetchQueue { struct PrefetchQueue {
int initial_frame, current_frame, start_frame, end_frame; int initial_frame, current_frame, start_frame, end_frame;
short render_size, render_flag; short render_size, render_flag;
@ -684,7 +684,7 @@ typedef struct PrefetchQueue {
bool *stop; bool *stop;
bool *do_update; bool *do_update;
float *progress; float *progress;
} PrefetchQueue; };
/* check whether pre-fetching is allowed */ /* check whether pre-fetching is allowed */
static bool check_prefetch_break(void) static bool check_prefetch_break(void)

@ -32,13 +32,13 @@
#include "clip_intern.h" /* own include */ #include "clip_intern.h" /* own include */
typedef struct TrackMotionCurveUserData { struct TrackMotionCurveUserData {
SpaceClip *sc; SpaceClip *sc;
MovieTrackingTrack *act_track; MovieTrackingTrack *act_track;
bool sel; bool sel;
float xscale, yscale, hsize; float xscale, yscale, hsize;
uint pos; uint pos;
} TrackMotionCurveUserData; };
static void tracking_segment_point_cb(void *userdata, static void tracking_segment_point_cb(void *userdata,
MovieTrackingTrack * /*track*/, MovieTrackingTrack * /*track*/,

@ -347,10 +347,10 @@ void CLIP_OT_graph_select(wmOperatorType *ot)
/********************** box select operator *********************/ /********************** box select operator *********************/
typedef struct BoxSelectuserData { struct BoxSelectuserData {
rctf rect; rctf rect;
bool select, extend, changed; bool select, extend, changed;
} BoxSelectuserData; };
static void box_select_cb(void *userdata, static void box_select_cb(void *userdata,
MovieTrackingTrack * /*track*/, MovieTrackingTrack * /*track*/,

@ -357,13 +357,13 @@ void CLIP_OT_reload(wmOperatorType *ot)
/** \name View Pan Operator /** \name View Pan Operator
* \{ */ * \{ */
typedef struct ViewPanData { struct ViewPanData {
float x, y; float x, y;
float xof, yof, xorig, yorig; float xof, yof, xorig, yorig;
int launch_event; int launch_event;
bool own_cursor; bool own_cursor;
float *vec; float *vec;
} ViewPanData; };
static void view_pan_init(bContext *C, wmOperator *op, const wmEvent *event) static void view_pan_init(bContext *C, wmOperator *op, const wmEvent *event)
{ {
@ -530,7 +530,7 @@ void CLIP_OT_view_pan(wmOperatorType *ot)
/** \name View Zoom Operator /** \name View Zoom Operator
* \{ */ * \{ */
typedef struct ViewZoomData { struct ViewZoomData {
float x, y; float x, y;
float zoom; float zoom;
int launch_event; int launch_event;
@ -538,7 +538,7 @@ typedef struct ViewZoomData {
wmTimer *timer; wmTimer *timer;
double timer_lastdraw; double timer_lastdraw;
bool own_cursor; bool own_cursor;
} ViewZoomData; };
static void view_zoom_init(bContext *C, wmOperator *op, const wmEvent *event) static void view_zoom_init(bContext *C, wmOperator *op, const wmEvent *event)
{ {
@ -1168,14 +1168,14 @@ void CLIP_OT_change_frame(wmOperatorType *ot)
/** \name Rebuild Proxies Operator /** \name Rebuild Proxies Operator
* \{ */ * \{ */
typedef struct ProxyBuildJob { struct ProxyJob {
Scene *scene; Scene *scene;
Main *main; Main *main;
MovieClip *clip; MovieClip *clip;
int clip_flag; int clip_flag;
bool stop; bool stop;
IndexBuildContext *index_context; IndexBuildContext *index_context;
} ProxyJob; };
static void proxy_freejob(void *pjv) static void proxy_freejob(void *pjv)
{ {
@ -1280,7 +1280,7 @@ static void do_movie_proxy(void *pjv,
* thread for maximal speed * thread for maximal speed
*/ */
typedef struct ProxyQueue { struct ProxyQueue {
int cfra; int cfra;
int sfra; int sfra;
int efra; int efra;
@ -1289,14 +1289,14 @@ typedef struct ProxyQueue {
const bool *stop; const bool *stop;
bool *do_update; bool *do_update;
float *progress; float *progress;
} ProxyQueue; };
typedef struct ProxyThread { struct ProxyThread {
MovieClip *clip; MovieClip *clip;
MovieDistortion *distortion; MovieDistortion *distortion;
int *build_sizes, build_count; int *build_sizes, build_count;
int *build_undistort_sizes, build_undistort_count; int *build_undistort_sizes, build_undistort_count;
} ProxyThread; };
static uchar *proxy_thread_next_frame(ProxyQueue *queue, static uchar *proxy_thread_next_frame(ProxyQueue *queue,
MovieClip *clip, MovieClip *clip,

@ -81,7 +81,7 @@ void CLIP_OT_create_plane_track(wmOperatorType *ot)
/********************** Slide plane marker corner operator *********************/ /********************** Slide plane marker corner operator *********************/
typedef struct SlidePlaneMarkerData { struct SlidePlaneMarkerData {
int launch_event; int launch_event;
MovieTrackingPlaneTrack *plane_track; MovieTrackingPlaneTrack *plane_track;
MovieTrackingPlaneMarker *plane_marker; MovieTrackingPlaneMarker *plane_marker;
@ -92,7 +92,7 @@ typedef struct SlidePlaneMarkerData {
float previous_corner[2]; float previous_corner[2];
float old_corner[2]; float old_corner[2];
bool accurate; bool accurate;
} SlidePlaneMarkerData; };
static MovieTrackingPlaneTrack *tracking_plane_marker_check_slide(bContext *C, static MovieTrackingPlaneTrack *tracking_plane_marker_check_slide(bContext *C,
const wmEvent *event, const wmEvent *event,

@ -38,7 +38,7 @@
/********************** Track operator *********************/ /********************** Track operator *********************/
typedef struct TrackMarkersJob { struct TrackMarkersJob {
AutoTrackContext *context; /* Tracking context */ AutoTrackContext *context; /* Tracking context */
int sfra, efra, lastfra; /* Start, end and recently tracked frames */ int sfra, efra, lastfra; /* Start, end and recently tracked frames */
int backwards; /* Backwards tracking flag */ int backwards; /* Backwards tracking flag */
@ -50,7 +50,7 @@ typedef struct TrackMarkersJob {
Main *main; Main *main;
Scene *scene; Scene *scene;
bScreen *screen; bScreen *screen;
} TrackMarkersJob; };
static bool track_markers_testbreak(void) static bool track_markers_testbreak(void)
{ {

@ -17,7 +17,7 @@ enum eTextViewContext_LineFlag {
}; };
ENUM_OPERATORS(eTextViewContext_LineFlag, TVC_LINE_ICON_BG) ENUM_OPERATORS(eTextViewContext_LineFlag, TVC_LINE_ICON_BG)
typedef struct TextViewContext { struct TextViewContext {
/** Font size scaled by the interface size. */ /** Font size scaled by the interface size. */
int lheight; int lheight;
/** Text selection, when a selection range is in use. */ /** Text selection, when a selection range is in use. */
@ -59,8 +59,7 @@ typedef struct TextViewContext {
int iter_char_end; int iter_char_end;
/** Internal iterator use. */ /** Internal iterator use. */
int iter_tmp; int iter_tmp;
};
} TextViewContext;
/** /**
* \param r_mval_pick_item: The resulting item clicked on using \a mval_init. * \param r_mval_pick_item: The resulting item clicked on using \a mval_init.

@ -282,9 +282,9 @@ TreeElement *outliner_add_collection_recursive(SpaceOutliner *space_outliner,
bool outliner_requires_rebuild_on_select_or_active_change( bool outliner_requires_rebuild_on_select_or_active_change(
const struct SpaceOutliner *space_outliner); const struct SpaceOutliner *space_outliner);
typedef struct IDsSelectedData { struct IDsSelectedData {
struct ListBase selected_array; struct ListBase selected_array;
} IDsSelectedData; };
TreeTraversalAction outliner_collect_selected_collections(TreeElement *te, void *customdata); TreeTraversalAction outliner_collect_selected_collections(TreeElement *te, void *customdata);
TreeTraversalAction outliner_collect_selected_objects(TreeElement *te, void *customdata); TreeTraversalAction outliner_collect_selected_objects(TreeElement *te, void *customdata);

@ -33,12 +33,12 @@
/* Own include. */ /* Own include. */
#include "sequencer_intern.h" #include "sequencer_intern.h"
typedef struct GizmoGroup_retime { struct GizmoGroup_retime {
wmGizmo *add_handle_gizmo; wmGizmo *add_handle_gizmo;
wmGizmo *move_handle_gizmo; wmGizmo *move_handle_gizmo;
wmGizmo *remove_handle_gizmo; wmGizmo *remove_handle_gizmo;
wmGizmo *speed_set_gizmo; wmGizmo *speed_set_gizmo;
} GizmoGroup_retime; };
static bool gizmogroup_retime_poll(const bContext *C, wmGizmoGroupType *gzgt) static bool gizmogroup_retime_poll(const bContext *C, wmGizmoGroupType *gzgt)
{ {

@ -166,19 +166,19 @@ static bool mouse_is_inside_box(const rctf *box, const int mval[2])
/** \name Retiming Add Handle Gizmo /** \name Retiming Add Handle Gizmo
* \{ */ * \{ */
typedef struct RetimeButtonGizmo { struct RetimeButtonGizmo {
wmGizmo gizmo; wmGizmo gizmo;
int icon_id; int icon_id;
const Sequence *seq_under_mouse; const Sequence *seq_under_mouse;
bool is_mouse_over_gizmo; bool is_mouse_over_gizmo;
} RetimeButtonGizmo; };
typedef struct ButtonDimensions { struct ButtonDimensions {
float height; float height;
float width; float width;
float x; float x;
float y; float y;
} ButtonDimensions; };
static ButtonDimensions button_dimensions_get(const bContext *C, const RetimeButtonGizmo *gizmo) static ButtonDimensions button_dimensions_get(const bContext *C, const RetimeButtonGizmo *gizmo)
{ {
@ -329,12 +329,12 @@ enum eHandleMoveOperation {
MAKE_FREEZE_FRAME, MAKE_FREEZE_FRAME,
}; };
typedef struct RetimeHandleMoveGizmo { struct RetimeHandleMoveGizmo {
wmGizmo gizmo; wmGizmo gizmo;
const Sequence *mouse_over_seq; const Sequence *mouse_over_seq;
int mouse_over_handle_x; int mouse_over_handle_x;
eHandleMoveOperation operation; eHandleMoveOperation operation;
} RetimeHandleMoveGizmo; };
static void retime_handle_draw(const bContext *C, static void retime_handle_draw(const bContext *C,
const RetimeHandleMoveGizmo *gizmo, const RetimeHandleMoveGizmo *gizmo,

@ -65,7 +65,7 @@ void text_format_fill(const char **str_p, char **fmt_p, char type, int len);
void text_format_fill_ascii(const char **str_p, char **fmt_p, char type, int len); void text_format_fill_ascii(const char **str_p, char **fmt_p, char type, int len);
/* *** Generalize Formatting *** */ /* *** Generalize Formatting *** */
typedef struct TextFormatType { struct TextFormatType {
struct TextFormatType *next, *prev; struct TextFormatType *next, *prev;
char (*format_identifier)(const char *string); char (*format_identifier)(const char *string);
@ -85,7 +85,7 @@ typedef struct TextFormatType {
/** The prefix of a single-line line comment (without trailing space). */ /** The prefix of a single-line line comment (without trailing space). */
const char *comment_line; const char *comment_line;
} TextFormatType; };
enum { enum {
/** White-space */ /** White-space */

@ -51,10 +51,10 @@
/** \name Implements ED Undo System /** \name Implements ED Undo System
* \{ */ * \{ */
typedef struct MemFileUndoStep { struct MemFileUndoStep {
UndoStep step; UndoStep step;
MemFileUndoData *data; MemFileUndoData *data;
} MemFileUndoStep; };
static bool memfile_undosys_poll(bContext *C) static bool memfile_undosys_poll(bContext *C)
{ {

@ -24,7 +24,7 @@
namespace blender::gpu { namespace blender::gpu {
typedef struct ShaderInput { struct ShaderInput {
uint32_t name_offset; uint32_t name_offset;
uint32_t name_hash; uint32_t name_hash;
/** /**
@ -38,7 +38,7 @@ typedef struct ShaderInput {
int32_t location; int32_t location;
/** Defined at interface creation or in shader. Only for Samplers, UBOs and Vertex Attributes. */ /** Defined at interface creation or in shader. Only for Samplers, UBOs and Vertex Attributes. */
int32_t binding; int32_t binding;
} ShaderInput; };
/** /**
* Implementation of Shader interface. * Implementation of Shader interface.

@ -90,11 +90,11 @@ float imbuf_aces_to_scene_linear[3][3] = {{0.0f}};
*/ */
static pthread_mutex_t processor_lock = BLI_MUTEX_INITIALIZER; static pthread_mutex_t processor_lock = BLI_MUTEX_INITIALIZER;
typedef struct ColormanageProcessor { struct ColormanageProcessor {
OCIO_ConstCPUProcessorRcPtr *cpu_processor; OCIO_ConstCPUProcessorRcPtr *cpu_processor;
CurveMapping *curve_mapping; CurveMapping *curve_mapping;
bool is_data_result; bool is_data_result;
} ColormanageProcessor; };
static struct global_gpu_state { static struct global_gpu_state {
/* GPU shader currently bound. */ /* GPU shader currently bound. */
@ -185,7 +185,7 @@ static struct global_color_picking_state {
* requiring to pass all variables which affects on display buffer * requiring to pass all variables which affects on display buffer
* to color management cache system and keeps calls small and nice. * to color management cache system and keeps calls small and nice.
*/ */
typedef struct ColormanageCacheViewSettings { struct ColormanageCacheViewSettings {
int flag; int flag;
int look; int look;
int view; int view;
@ -193,18 +193,18 @@ typedef struct ColormanageCacheViewSettings {
float gamma; float gamma;
float dither; float dither;
CurveMapping *curve_mapping; CurveMapping *curve_mapping;
} ColormanageCacheViewSettings; };
typedef struct ColormanageCacheDisplaySettings { struct ColormanageCacheDisplaySettings {
int display; int display;
} ColormanageCacheDisplaySettings; };
typedef struct ColormanageCacheKey { struct ColormanageCacheKey {
int view; /* view transformation used for display buffer */ int view; /* view transformation used for display buffer */
int display; /* display device name */ int display; /* display device name */
} ColormanageCacheKey; };
typedef struct ColormanageCacheData { struct ColormanageCacheData {
int flag; /* view flags of cached buffer */ int flag; /* view flags of cached buffer */
int look; /* Additional artistic transform. */ int look; /* Additional artistic transform. */
float exposure; /* exposure value cached buffer is calculated with */ float exposure; /* exposure value cached buffer is calculated with */
@ -212,13 +212,13 @@ typedef struct ColormanageCacheData {
float dither; /* dither value cached buffer is calculated with */ float dither; /* dither value cached buffer is calculated with */
CurveMapping *curve_mapping; /* curve mapping used for cached buffer */ CurveMapping *curve_mapping; /* curve mapping used for cached buffer */
int curve_mapping_timestamp; /* time stamp of curve mapping used for cached buffer */ int curve_mapping_timestamp; /* time stamp of curve mapping used for cached buffer */
} ColormanageCacheData; };
typedef struct ColormanageCache { struct ColormanageCache {
MovieCache *moviecache; MovieCache *moviecache;
ColormanageCacheData *data; ColormanageCacheData *data;
} ColormanageCache; };
static MovieCache *colormanage_moviecache_get(const ImBuf *ibuf) static MovieCache *colormanage_moviecache_get(const ImBuf *ibuf)
{ {
@ -1412,7 +1412,7 @@ const float *IMB_colormanagement_get_xyz_to_scene_linear(void)
/** \name Threaded Display Buffer Transform Routines /** \name Threaded Display Buffer Transform Routines
* \{ */ * \{ */
typedef struct DisplayBufferThread { struct DisplayBufferThread {
ColormanageProcessor *cm_processor; ColormanageProcessor *cm_processor;
const float *buffer; const float *buffer;
@ -1432,9 +1432,9 @@ typedef struct DisplayBufferThread {
const char *byte_colorspace; const char *byte_colorspace;
const char *float_colorspace; const char *float_colorspace;
} DisplayBufferThread; };
typedef struct DisplayBufferInitData { struct DisplayBufferInitData {
ImBuf *ibuf; ImBuf *ibuf;
ColormanageProcessor *cm_processor; ColormanageProcessor *cm_processor;
const float *buffer; const float *buffer;
@ -1447,7 +1447,7 @@ typedef struct DisplayBufferInitData {
const char *byte_colorspace; const char *byte_colorspace;
const char *float_colorspace; const char *float_colorspace;
} DisplayBufferInitData; };
static void display_buffer_init_handle(void *handle_v, static void display_buffer_init_handle(void *handle_v,
int start_line, int start_line,
@ -1784,7 +1784,7 @@ static void colormanage_display_buffer_process(ImBuf *ibuf,
/** \name Threaded Processor Transform Routines /** \name Threaded Processor Transform Routines
* \{ */ * \{ */
typedef struct ProcessorTransformThread { struct ProcessorTransformThread {
ColormanageProcessor *cm_processor; ColormanageProcessor *cm_processor;
uchar *byte_buffer; uchar *byte_buffer;
float *float_buffer; float *float_buffer;
@ -1794,9 +1794,9 @@ typedef struct ProcessorTransformThread {
int channels; int channels;
bool predivide; bool predivide;
bool float_from_byte; bool float_from_byte;
} ProcessorTransformThread; };
typedef struct ProcessorTransformInit { struct ProcessorTransformInitData {
ColormanageProcessor *cm_processor; ColormanageProcessor *cm_processor;
uchar *byte_buffer; uchar *byte_buffer;
float *float_buffer; float *float_buffer;
@ -1805,7 +1805,7 @@ typedef struct ProcessorTransformInit {
int channels; int channels;
bool predivide; bool predivide;
bool float_from_byte; bool float_from_byte;
} ProcessorTransformInitData; };
static void processor_transform_init_handle(void *handle_v, static void processor_transform_init_handle(void *handle_v,
int start_line, int start_line,
@ -2223,14 +2223,14 @@ void IMB_colormanagement_imbuf_to_byte_texture(uchar *out_buffer,
} }
} }
typedef struct ImbufByteToFloatData { struct ImbufByteToFloatData {
OCIO_ConstCPUProcessorRcPtr *processor; OCIO_ConstCPUProcessorRcPtr *processor;
int width; int width;
int offset, stride; int offset, stride;
const uchar *in_buffer; const uchar *in_buffer;
float *out_buffer; float *out_buffer;
bool use_premultiply; bool use_premultiply;
} ImbufByteToFloatData; };
static void imbuf_byte_to_float_cb(void *__restrict userdata, static void imbuf_byte_to_float_cb(void *__restrict userdata,
const int y, const int y,
@ -3519,7 +3519,7 @@ static void partial_buffer_update_rect(ImBuf *ibuf,
} }
} }
typedef struct PartialThreadData { struct PartialThreadData {
ImBuf *ibuf; ImBuf *ibuf;
uchar *display_buffer; uchar *display_buffer;
const float *linear_buffer; const float *linear_buffer;
@ -3529,7 +3529,7 @@ typedef struct PartialThreadData {
int linear_offset_x, linear_offset_y; int linear_offset_x, linear_offset_y;
ColormanageProcessor *cm_processor; ColormanageProcessor *cm_processor;
int xmin, ymin, xmax; int xmin, ymin, xmax;
} PartialThreadData; };
static void partial_buffer_update_rect_thread_do(void *data_v, int scanline) static void partial_buffer_update_rect_thread_do(void *data_v, int scanline)
{ {

@ -24,9 +24,9 @@
/** \name Floyd-Steinberg dithering /** \name Floyd-Steinberg dithering
* \{ */ * \{ */
typedef struct DitherContext { struct DitherContext {
float dither; float dither;
} DitherContext; };
static DitherContext *create_dither_context(float dither) static DitherContext *create_dither_context(float dither)
{ {
@ -504,7 +504,7 @@ void IMB_buffer_float_from_float(float *rect_to,
} }
} }
typedef struct FloatToFloatThreadData { struct FloatToFloatThreadData {
float *rect_to; float *rect_to;
const float *rect_from; const float *rect_from;
int channels_from; int channels_from;
@ -514,7 +514,7 @@ typedef struct FloatToFloatThreadData {
int width; int width;
int stride_to; int stride_to;
int stride_from; int stride_from;
} FloatToFloatThreadData; };
static void imb_buffer_float_from_float_thread_do(void *data_v, int scanline) static void imb_buffer_float_from_float_thread_do(void *data_v, int scanline)
{ {

@ -398,10 +398,10 @@ void IMB_processor_apply_threaded(
BLI_task_pool_free(task_pool); BLI_task_pool_free(task_pool);
} }
typedef struct ScanlineGlobalData { struct ScanlineGlobalData {
void *custom_data; void *custom_data;
ScanlineThreadFunc do_thread; ScanlineThreadFunc do_thread;
} ScanlineGlobalData; };
static void processor_apply_parallel(void *__restrict userdata, static void processor_apply_parallel(void *__restrict userdata,
const int scanline, const int scanline,

@ -460,9 +460,9 @@ static void get_tc_filepath(anim *anim, IMB_Timecode_Type tc, char *filepath)
* - common rebuilder structures * - common rebuilder structures
* ---------------------------------------------------------------------- */ * ---------------------------------------------------------------------- */
typedef struct IndexBuildContext { struct IndexBuildContext {
int anim_type; int anim_type;
} IndexBuildContext; };
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
* - ffmpeg rebuilder * - ffmpeg rebuilder
@ -788,7 +788,7 @@ static void free_proxy_output_ffmpeg(proxy_output_ctx *ctx, int rollback)
MEM_freeN(ctx); MEM_freeN(ctx);
} }
typedef struct FFmpegIndexBuilderContext { struct FFmpegIndexBuilderContext {
int anim_type; int anim_type;
AVFormatContext *iFormatCtx; AVFormatContext *iFormatCtx;
@ -820,7 +820,7 @@ typedef struct FFmpegIndexBuilderContext {
bool build_only_on_bad_performance; bool build_only_on_bad_performance;
bool building_cancelled; bool building_cancelled;
} FFmpegIndexBuilderContext; };
static IndexBuildContext *index_ffmpeg_create_context(anim *anim, static IndexBuildContext *index_ffmpeg_create_context(anim *anim,
int tcs_in_use, int tcs_in_use,
@ -1243,13 +1243,13 @@ static bool indexer_need_to_build_proxy(FFmpegIndexBuilderContext *context)
* ---------------------------------------------------------------------- */ * ---------------------------------------------------------------------- */
#ifdef WITH_AVI #ifdef WITH_AVI
typedef struct FallbackIndexBuilderContext { struct FallbackIndexBuilderContext {
int anim_type; int anim_type;
struct anim *anim; struct anim *anim;
AviMovie *proxy_ctx[IMB_PROXY_MAX_SLOT]; AviMovie *proxy_ctx[IMB_PROXY_MAX_SLOT];
int proxy_sizes_in_use; int proxy_sizes_in_use;
} FallbackIndexBuilderContext; };
static AviMovie *alloc_proxy_output_avi( static AviMovie *alloc_proxy_output_avi(
anim *anim, char *filepath, int width, int height, int quality) anim *anim, char *filepath, int width, int height, int quality)

@ -68,10 +68,10 @@ BLI_STATIC_ASSERT(sizeof(IMAGE) == HEADER_SIZE, "Invalid header size");
// #define RLE_NOP 0x00 // #define RLE_NOP 0x00
/* local struct for mem access */ /* local struct for mem access */
typedef struct MFileOffset { struct MFileOffset {
const uchar *_file_data; const uchar *_file_data;
uint _file_offset; uint _file_offset;
} MFileOffset; };
#define MFILE_DATA(inf) ((void)0, ((inf)->_file_data + (inf)->_file_offset)) #define MFILE_DATA(inf) ((void)0, ((inf)->_file_data + (inf)->_file_offset))
#define MFILE_STEP(inf, step) \ #define MFILE_STEP(inf, step) \

@ -28,7 +28,7 @@ static const char J2K_HEAD[] = {0xFF, 0x4F, 0xFF, 0x51, 0x00};
/* We only need this because of how the presets are set */ /* We only need this because of how the presets are set */
/* this typedef is copied from 'openjpeg-1.5.0/applications/codec/image_to_j2k.c' */ /* this typedef is copied from 'openjpeg-1.5.0/applications/codec/image_to_j2k.c' */
typedef struct img_folder { struct img_fol_t {
/** The directory path of the folder containing input images. */ /** The directory path of the folder containing input images. */
char *imgdirpath; char *imgdirpath;
/** Output format. */ /** Output format. */
@ -39,7 +39,7 @@ typedef struct img_folder {
char set_out_format; char set_out_format;
/** User specified rate stored in case of cinema option. */ /** User specified rate stored in case of cinema option. */
float *rates; float *rates;
} img_fol_t; };
static bool check_jp2(const uchar *mem, const size_t size) /* J2K_CFMT */ static bool check_jp2(const uchar *mem, const size_t size) /* J2K_CFMT */
{ {

@ -60,11 +60,11 @@ bool imb_is_a_jpeg(const uchar *mem, const size_t size)
* JPG ERROR HANDLING * JPG ERROR HANDLING
*---------------------------------------------------------- */ *---------------------------------------------------------- */
typedef struct my_error_mgr { struct my_error_mgr {
jpeg_error_mgr pub; /* "public" fields */ jpeg_error_mgr pub; /* "public" fields */
jmp_buf setjmp_buffer; /* for return to caller */ jmp_buf setjmp_buffer; /* for return to caller */
} my_error_mgr; };
typedef my_error_mgr *my_error_ptr; typedef my_error_mgr *my_error_ptr;

@ -956,7 +956,7 @@ void IMB_rectblend(ImBuf *dbuf,
} }
} }
typedef struct RectBlendThreadData { struct RectBlendThreadData {
ImBuf *dbuf; ImBuf *dbuf;
const ImBuf *obuf, *sbuf; const ImBuf *obuf, *sbuf;
ushort *dmask; ushort *dmask;
@ -966,7 +966,7 @@ typedef struct RectBlendThreadData {
int srcx, srcy, width; int srcx, srcy, width;
IMB_BlendMode mode; IMB_BlendMode mode;
bool accumulate; bool accumulate;
} RectBlendThreadData; };
static void rectblend_thread_do(void *data_v, int scanline) static void rectblend_thread_do(void *data_v, int scanline)
{ {

@ -1773,7 +1773,7 @@ bool IMB_scalefastImBuf(ImBuf *ibuf, uint newx, uint newy)
/* ******** threaded scaling ******** */ /* ******** threaded scaling ******** */
typedef struct ScaleTreadInitData { struct ScaleTreadInitData {
ImBuf *ibuf; ImBuf *ibuf;
uint newx; uint newx;
@ -1781,9 +1781,9 @@ typedef struct ScaleTreadInitData {
uchar *byte_buffer; uchar *byte_buffer;
float *float_buffer; float *float_buffer;
} ScaleTreadInitData; };
typedef struct ScaleThreadData { struct ScaleThreadData {
ImBuf *ibuf; ImBuf *ibuf;
uint newx; uint newx;
@ -1794,7 +1794,7 @@ typedef struct ScaleThreadData {
uchar *byte_buffer; uchar *byte_buffer;
float *float_buffer; float *float_buffer;
} ScaleThreadData; };
static void scale_thread_init(void *data_v, int start_line, int tot_line, void *init_data_v) static void scale_thread_init(void *data_v, int start_line, int tot_line, void *init_data_v)
{ {

@ -32,7 +32,7 @@ struct Stereo3DData;
static void imb_stereo3d_write_doit(Stereo3DData *s3d_data, const Stereo3dFormat *s3d); static void imb_stereo3d_write_doit(Stereo3DData *s3d_data, const Stereo3dFormat *s3d);
static void imb_stereo3d_read_doit(Stereo3DData *s3d_data, const Stereo3dFormat *s3d); static void imb_stereo3d_read_doit(Stereo3DData *s3d_data, const Stereo3dFormat *s3d);
typedef struct Stereo3DData { struct Stereo3DData {
struct { struct {
float *left, *right, *stereo; float *left, *right, *stereo;
} rectf; } rectf;
@ -41,7 +41,7 @@ typedef struct Stereo3DData {
} rect; } rect;
size_t x, y, channels; size_t x, y, channels;
bool is_float; bool is_float;
} Stereo3DData; };
/* -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- */
/** \name Local Functions /** \name Local Functions

@ -78,13 +78,13 @@ static void init_dualcon_mesh(DualConInput *input, Mesh *mesh)
/* simple structure to hold the output: a CDDM and two counters to /* simple structure to hold the output: a CDDM and two counters to
* keep track of the current elements */ * keep track of the current elements */
typedef struct { struct DualConOutput {
Mesh *mesh; Mesh *mesh;
blender::float3 *vert_positions; blender::float3 *vert_positions;
int *poly_offsets; int *poly_offsets;
int *corner_verts; int *corner_verts;
int curvert, curface; int curvert, curface;
} DualConOutput; };
/* allocate and initialize a DualConOutput */ /* allocate and initialize a DualConOutput */
static void *dualcon_alloc_output(int totvert, int totquad) static void *dualcon_alloc_output(int totvert, int totquad)

@ -2714,10 +2714,10 @@ static void set_next_operator_state(wmOperator *op, int state)
RNA_int_set(op->ptr, "state", state); RNA_int_set(op->ptr, "state", state);
} }
typedef struct OperatorDispatchTarget { struct OperatorDispatchTarget {
int state; int state;
int (*run)(bContext *C, wmOperator *op); int (*run)(bContext *C, wmOperator *op);
} OperatorDispatchTarget; };
static int operator_state_dispatch(bContext *C, wmOperator *op, OperatorDispatchTarget *targets) static int operator_state_dispatch(bContext *C, wmOperator *op, OperatorDispatchTarget *targets)
{ {