Cleanup: remove redundant const qualifiers for scalar & enum types

This commit is contained in:
Campbell Barton 2022-06-01 15:06:21 +10:00
parent 44bac4c8cc
commit 0f29f2c3e6
15 changed files with 50 additions and 55 deletions

View File

@ -64,13 +64,13 @@ bool BKE_id_attribute_remove(struct ID *id,
struct CustomDataLayer *BKE_id_attribute_find(const struct ID *id, struct CustomDataLayer *BKE_id_attribute_find(const struct ID *id,
const char *name, const char *name,
const int type, int type,
const eAttrDomain domain); eAttrDomain domain);
struct CustomDataLayer *BKE_id_attribute_search(const struct ID *id, struct CustomDataLayer *BKE_id_attribute_search(const struct ID *id,
const char *name, const char *name,
const eCustomDataMask type, eCustomDataMask type,
const eAttrDomainMask domain_mask); eAttrDomainMask domain_mask);
eAttrDomain BKE_id_attribute_domain(const struct ID *id, const struct CustomDataLayer *layer); eAttrDomain BKE_id_attribute_domain(const struct ID *id, const struct CustomDataLayer *layer);
int BKE_id_attribute_data_length(struct ID *id, struct CustomDataLayer *layer); int BKE_id_attribute_data_length(struct ID *id, struct CustomDataLayer *layer);

View File

@ -376,7 +376,7 @@ class CustomDataAttributes {
* value for the type will be used. * value for the type will be used.
*/ */
blender::GVArray get_for_read(const AttributeIDRef &attribute_id, blender::GVArray get_for_read(const AttributeIDRef &attribute_id,
const eCustomDataType data_type, eCustomDataType data_type,
const void *default_value) const; const void *default_value) const;
template<typename T> template<typename T>
@ -389,10 +389,8 @@ class CustomDataAttributes {
} }
std::optional<blender::GMutableSpan> get_for_write(const AttributeIDRef &attribute_id); std::optional<blender::GMutableSpan> get_for_write(const AttributeIDRef &attribute_id);
bool create(const AttributeIDRef &attribute_id, const eCustomDataType data_type); bool create(const AttributeIDRef &attribute_id, eCustomDataType data_type);
bool create_by_move(const AttributeIDRef &attribute_id, bool create_by_move(const AttributeIDRef &attribute_id, eCustomDataType data_type, void *buffer);
const eCustomDataType data_type,
void *buffer);
bool remove(const AttributeIDRef &attribute_id); bool remove(const AttributeIDRef &attribute_id);
/** /**

View File

@ -749,7 +749,7 @@ void CustomData_debug_info_from_layers(const struct CustomData *data,
# include "BLI_cpp_type.hh" # include "BLI_cpp_type.hh"
namespace blender::bke { namespace blender::bke {
const CPPType *custom_data_type_to_cpp_type(const eCustomDataType type); const CPPType *custom_data_type_to_cpp_type(eCustomDataType type);
eCustomDataType cpp_type_to_custom_data_type(const CPPType &type); eCustomDataType cpp_type_to_custom_data_type(const CPPType &type);
} // namespace blender::bke } // namespace blender::bke
#endif #endif

View File

@ -104,7 +104,7 @@ VArray<float3> curve_normals_varray(const CurveComponent &component, const eAttr
VArray<float3> mesh_normals_varray(const MeshComponent &mesh_component, VArray<float3> mesh_normals_varray(const MeshComponent &mesh_component,
const Mesh &mesh, const Mesh &mesh,
const IndexMask mask, const IndexMask mask,
const eAttrDomain domain); eAttrDomain domain);
class NormalFieldInput : public GeometryFieldInput { class NormalFieldInput : public GeometryFieldInput {
public: public:

View File

@ -157,7 +157,7 @@ class GeometryComponent {
/** Returns true when the attribute has been created. */ /** Returns true when the attribute has been created. */
bool attribute_try_create(const blender::bke::AttributeIDRef &attribute_id, bool attribute_try_create(const blender::bke::AttributeIDRef &attribute_id,
eAttrDomain domain, eAttrDomain domain,
const eCustomDataType data_type, eCustomDataType data_type,
const AttributeInit &initializer); const AttributeInit &initializer);
/** /**
@ -183,7 +183,7 @@ class GeometryComponent {
*/ */
blender::GVArray attribute_try_get_for_read(const blender::bke::AttributeIDRef &attribute_id, blender::GVArray attribute_try_get_for_read(const blender::bke::AttributeIDRef &attribute_id,
eAttrDomain domain, eAttrDomain domain,
const eCustomDataType data_type) const; eCustomDataType data_type) const;
/** /**
* Get a virtual array that refers to the data of an attribute, interpolated to the given domain. * Get a virtual array that refers to the data of an attribute, interpolated to the given domain.
@ -199,7 +199,7 @@ class GeometryComponent {
* cannot be converted. * cannot be converted.
*/ */
blender::bke::ReadAttributeLookup attribute_try_get_for_read( blender::bke::ReadAttributeLookup attribute_try_get_for_read(
const blender::bke::AttributeIDRef &attribute_id, const eCustomDataType data_type) const; const blender::bke::AttributeIDRef &attribute_id, eCustomDataType data_type) const;
/** /**
* Get a virtual array that refers to the data of an attribute, interpolated to the given domain * Get a virtual array that refers to the data of an attribute, interpolated to the given domain
@ -208,7 +208,7 @@ class GeometryComponent {
*/ */
blender::GVArray attribute_get_for_read(const blender::bke::AttributeIDRef &attribute_id, blender::GVArray attribute_get_for_read(const blender::bke::AttributeIDRef &attribute_id,
eAttrDomain domain, eAttrDomain domain,
const eCustomDataType data_type, eCustomDataType data_type,
const void *default_value = nullptr) const; const void *default_value = nullptr) const;
/* Use instead of the method above when the type is known at compile time for type safety. */ /* Use instead of the method above when the type is known at compile time for type safety. */
template<typename T> template<typename T>
@ -235,7 +235,7 @@ class GeometryComponent {
blender::bke::OutputAttribute attribute_try_get_for_output( blender::bke::OutputAttribute attribute_try_get_for_output(
const blender::bke::AttributeIDRef &attribute_id, const blender::bke::AttributeIDRef &attribute_id,
eAttrDomain domain, eAttrDomain domain,
const eCustomDataType data_type, eCustomDataType data_type,
const void *default_value = nullptr); const void *default_value = nullptr);
/* Use instead of the method above when the type is known at compile time for type safety. */ /* Use instead of the method above when the type is known at compile time for type safety. */
template<typename T> template<typename T>
@ -258,7 +258,7 @@ class GeometryComponent {
blender::bke::OutputAttribute attribute_try_get_for_output_only( blender::bke::OutputAttribute attribute_try_get_for_output_only(
const blender::bke::AttributeIDRef &attribute_id, const blender::bke::AttributeIDRef &attribute_id,
eAttrDomain domain, eAttrDomain domain,
const eCustomDataType data_type); eCustomDataType data_type);
/* Use instead of the method above when the type is known at compile time for type safety. */ /* Use instead of the method above when the type is known at compile time for type safety. */
template<typename T> template<typename T>
blender::bke::OutputAttribute_Typed<T> attribute_try_get_for_output_only( blender::bke::OutputAttribute_Typed<T> attribute_try_get_for_output_only(

View File

@ -95,11 +95,11 @@ typedef enum eIDRemapType {
*/ */
void BKE_libblock_remap_multiple_locked(struct Main *bmain, void BKE_libblock_remap_multiple_locked(struct Main *bmain,
struct IDRemapper *mappings, struct IDRemapper *mappings,
const short remap_flags); short remap_flags);
void BKE_libblock_remap_multiple(struct Main *bmain, void BKE_libblock_remap_multiple(struct Main *bmain,
struct IDRemapper *mappings, struct IDRemapper *mappings,
const short remap_flags); short remap_flags);
/** /**
* Replace all references in given Main to \a old_id by \a new_id * Replace all references in given Main to \a old_id by \a new_id
@ -142,9 +142,9 @@ void BKE_libblock_relink_ex(struct Main *bmain,
*/ */
void BKE_libblock_relink_multiple(struct Main *bmain, void BKE_libblock_relink_multiple(struct Main *bmain,
struct LinkNode *ids, struct LinkNode *ids,
const eIDRemapType remap_type, eIDRemapType remap_type,
struct IDRemapper *id_remapper, struct IDRemapper *id_remapper,
const short remap_flags); short remap_flags);
/** /**
* Remaps ID usages of given ID to their `id->newid` pointer if not None, and proceeds recursively * Remaps ID usages of given ID to their `id->newid` pointer if not None, and proceeds recursively

View File

@ -55,17 +55,17 @@ IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin);
* finished. * finished.
*/ */
void immDrawPixelsTexScaledFullSize(const IMMDrawPixelsTexState *state, void immDrawPixelsTexScaledFullSize(const IMMDrawPixelsTexState *state,
const float x, float x,
const float y, float y,
const int img_w, int img_w,
const int img_h, int img_h,
const eGPUTextureFormat gpu_format, eGPUTextureFormat gpu_format,
const bool use_filter, bool use_filter,
const void *rect, const void *rect,
const float scaleX, float scaleX,
const float scaleY, float scaleY,
const float xzoom, float xzoom,
const float yzoom, float yzoom,
const float color[4]); const float color[4]);
/** /**

View File

@ -49,5 +49,5 @@ typedef void (*gpBakeCb)(struct GpencilModifierData *md_,
void generic_bake_deform_stroke(struct Depsgraph *depsgraph, void generic_bake_deform_stroke(struct Depsgraph *depsgraph,
struct GpencilModifierData *md, struct GpencilModifierData *md,
struct Object *ob, struct Object *ob,
const bool retime, bool retime,
gpBakeCb bake_cb); gpBakeCb bake_cb);

View File

@ -519,10 +519,10 @@ enum {
* \{ */ * \{ */
void IMB_colormanagement_blackbody_temperature_to_rgb_table(float *r_table, void IMB_colormanagement_blackbody_temperature_to_rgb_table(float *r_table,
const int width, int width,
const float min, float min,
const float max); float max);
void IMB_colormanagement_wavelength_to_rgb_table(float *r_table, const int width); void IMB_colormanagement_wavelength_to_rgb_table(float *r_table, int width);
/** \} */ /** \} */

View File

@ -42,8 +42,8 @@ typedef struct ImFileType {
* dimensions of the full-size image in r_width & r_height. * dimensions of the full-size image in r_width & r_height.
*/ */
struct ImBuf *(*load_filepath_thumbnail)(const char *filepath, struct ImBuf *(*load_filepath_thumbnail)(const char *filepath,
const int flags, int flags,
const size_t max_thumb_size, size_t max_thumb_size,
char colorspace[IM_MAX_SPACE], char colorspace[IM_MAX_SPACE],
size_t *r_width, size_t *r_width,
size_t *r_height); size_t *r_height);
@ -155,8 +155,8 @@ struct ImBuf *imb_load_jpeg(const unsigned char *buffer,
int flags, int flags,
char colorspace[IM_MAX_SPACE]); char colorspace[IM_MAX_SPACE]);
struct ImBuf *imb_thumbnail_jpeg(const char *filepath, struct ImBuf *imb_thumbnail_jpeg(const char *filepath,
const int flags, int flags,
const size_t max_thumb_size, size_t max_thumb_size,
char colorspace[IM_MAX_SPACE], char colorspace[IM_MAX_SPACE],
size_t *r_width, size_t *r_width,
size_t *r_height); size_t *r_height);

View File

@ -27,8 +27,8 @@ bool imb_save_openexr(struct ImBuf *ibuf, const char *name, int flags);
struct ImBuf *imb_load_openexr(const unsigned char *mem, size_t size, int flags, char *colorspace); struct ImBuf *imb_load_openexr(const unsigned char *mem, size_t size, int flags, char *colorspace);
struct ImBuf *imb_load_filepath_thumbnail_openexr(const char *filepath, struct ImBuf *imb_load_filepath_thumbnail_openexr(const char *filepath,
const int flags, int flags,
const size_t max_thumb_size, size_t max_thumb_size,
char colorspace[], char colorspace[],
size_t *r_width, size_t *r_width,
size_t *r_height); size_t *r_height);

View File

@ -308,7 +308,7 @@ class GeoNodeExecParams {
GVArray get_input_attribute(const StringRef name, GVArray get_input_attribute(const StringRef name,
const GeometryComponent &component, const GeometryComponent &component,
eAttrDomain domain, eAttrDomain domain,
const eCustomDataType type, eCustomDataType type,
const void *default_value) const; const void *default_value) const;
template<typename T> template<typename T>
@ -328,7 +328,7 @@ class GeoNodeExecParams {
*/ */
eCustomDataType get_input_attribute_data_type(const StringRef name, eCustomDataType get_input_attribute_data_type(const StringRef name,
const GeometryComponent &component, const GeometryComponent &component,
const eCustomDataType default_type) const; eCustomDataType default_type) const;
/** /**
* If any of the corresponding input sockets are attributes instead of single values, * If any of the corresponding input sockets are attributes instead of single values,

View File

@ -247,15 +247,15 @@ void RE_render_result_full_channel_name(char *fullname,
const char *passname, const char *passname,
const char *viewname, const char *viewname,
const char *chan_id, const char *chan_id,
const int channel); int channel);
struct ImBuf *RE_render_result_rect_to_ibuf(struct RenderResult *rr, struct ImBuf *RE_render_result_rect_to_ibuf(struct RenderResult *rr,
const struct ImageFormatData *imf, const struct ImageFormatData *imf,
const float dither, const float dither,
const int view_id); int view_id);
void RE_render_result_rect_from_ibuf(struct RenderResult *rr, void RE_render_result_rect_from_ibuf(struct RenderResult *rr,
const struct ImBuf *ibuf, const struct ImBuf *ibuf,
const int view_id); int view_id);
struct RenderLayer *RE_GetRenderLayer(struct RenderResult *rr, const char *name); struct RenderLayer *RE_GetRenderLayer(struct RenderResult *rr, const char *name);
float *RE_RenderLayerGetPass(struct RenderLayer *rl, const char *name, const char *viewname); float *RE_RenderLayerGetPass(struct RenderLayer *rl, const char *name, const char *viewname);

View File

@ -27,16 +27,13 @@ struct Mesh;
*/ */
void RE_generate_texturemargin_adjacentfaces(struct ImBuf *ibuf, void RE_generate_texturemargin_adjacentfaces(struct ImBuf *ibuf,
char *mask, char *mask,
const int margin, int margin,
struct Mesh const *me, struct Mesh const *me,
char const *uv_layer, char const *uv_layer,
const float uv_offset[2]); const float uv_offset[2]);
void RE_generate_texturemargin_adjacentfaces_dm(struct ImBuf *ibuf, void RE_generate_texturemargin_adjacentfaces_dm(
char *mask, struct ImBuf *ibuf, char *mask, int margin, struct DerivedMesh *dm, const float uv_offset[2]);
const int margin,
struct DerivedMesh *dm,
const float uv_offset[2]);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -24,8 +24,8 @@ void SEQ_channels_duplicate(struct ListBase *channels_dst, struct ListBase *chan
void SEQ_channels_free(struct ListBase *channels); void SEQ_channels_free(struct ListBase *channels);
struct SeqTimelineChannel *SEQ_channel_get_by_index(const struct ListBase *channels, struct SeqTimelineChannel *SEQ_channel_get_by_index(const struct ListBase *channels,
const int channel_index); int channel_index);
char *SEQ_channel_name_get(struct ListBase *channels, const int channel_index); char *SEQ_channel_name_get(struct ListBase *channels, int channel_index);
bool SEQ_channel_is_locked(const struct SeqTimelineChannel *channel); bool SEQ_channel_is_locked(const struct SeqTimelineChannel *channel);
bool SEQ_channel_is_muted(const struct SeqTimelineChannel *channel); bool SEQ_channel_is_muted(const struct SeqTimelineChannel *channel);
int SEQ_channel_index_get(const struct SeqTimelineChannel *channel); int SEQ_channel_index_get(const struct SeqTimelineChannel *channel);