Cleanup: match argument names for function & declarations

Match function and declaration names, picking names based on
consistency with related code & clarity.

Also changes for old conventions, missed in previous cleanups:

- name -> filepath
- tname -> newname
- maxlen -> maxncpy
This commit is contained in:
Campbell Barton
2024-07-27 13:20:43 +10:00
parent edb73325c1
commit 111a40239a
88 changed files with 202 additions and 190 deletions

View File

@@ -132,8 +132,8 @@ void CLG_error_fn_set(void (*error_fn)(void *file_handle));
void CLG_fatal_fn_set(void (*fatal_fn)(void *file_handle));
void CLG_backtrace_fn_set(void (*fatal_fn)(void *file_handle));
void CLG_type_filter_include(const char *type_filter, int type_filter_len);
void CLG_type_filter_exclude(const char *type_filter, int type_filter_len);
void CLG_type_filter_include(const char *type_match, int type_match_len);
void CLG_type_filter_exclude(const char *type_match, int type_match_len);
void CLG_level_set(int level);

View File

@@ -82,7 +82,7 @@ class CombinedKeyingResult {
void add(SingleKeyingResult result, int count = 1);
/* Add values of the given result to this result. */
void merge(const CombinedKeyingResult &combined_result);
void merge(const CombinedKeyingResult &other);
int get_count(const SingleKeyingResult result) const;
@@ -179,7 +179,7 @@ bool insert_keyframe_direct(ReportList *reports,
FCurve *fcu,
const AnimationEvalContext *anim_eval_context,
eBezTriple_KeyframeType keytype,
NlaKeyframingContext *nla,
NlaKeyframingContext *nla_context,
eInsertKeyFlags flag);
/**
@@ -189,7 +189,7 @@ bool insert_keyframe_direct(ReportList *reports,
* Will perform checks just in case.
* \return The number of key-frames deleted.
*/
int delete_keyframe(Main *bmain, ReportList *reports, ID *id, const RNAPath &path, float cfra);
int delete_keyframe(Main *bmain, ReportList *reports, ID *id, const RNAPath &rna_path, float cfra);
/**
* Main Keyframing API call:

View File

@@ -642,9 +642,9 @@ static void strip_ptr_destructor(ActionStrip **dna_strip_ptr)
MEM_delete(&strip);
};
bool Layer::strip_remove(Strip &strip_to_remove)
bool Layer::strip_remove(Strip &strip)
{
const int64_t strip_index = this->find_strip_index(strip_to_remove);
const int64_t strip_index = this->find_strip_index(strip);
if (strip_index < 0) {
return false;
}
@@ -1058,10 +1058,10 @@ const ChannelBag *KeyframeStrip::channelbag_for_slot(const slot_handle_t slot_ha
}
return nullptr;
}
int64_t KeyframeStrip::find_channelbag_index(const ChannelBag &channelbag_to_remove) const
int64_t KeyframeStrip::find_channelbag_index(const ChannelBag &channelbag) const
{
for (int64_t index = 0; index < this->channelbag_array_num; index++) {
if (this->channelbag(index) == &channelbag_to_remove) {
if (this->channelbag(index) == &channelbag) {
return index;
}
}

View File

@@ -67,7 +67,7 @@ class AssetCatalogDefinitionFile {
using AssetCatalogParsedFn = FunctionRef<bool(std::unique_ptr<AssetCatalog>)>;
void parse_catalog_file(const CatalogFilePath &catalog_definition_file_path,
AssetCatalogParsedFn callback);
AssetCatalogParsedFn catalog_loaded_callback);
std::unique_ptr<AssetCatalogDefinitionFile> copy_and_remap(
const OwningAssetCatalogMap &catalogs, const OwningAssetCatalogMap &deleted_catalogs) const;

View File

@@ -127,9 +127,9 @@ AssetCatalogPath AssetCatalogPath::cleanup() const
return AssetCatalogPath(clean_components.str());
}
std::string AssetCatalogPath::cleanup_component(StringRef component)
std::string AssetCatalogPath::cleanup_component(StringRef component_name)
{
std::string cleaned = component.trim();
std::string cleaned = component_name.trim();
/* Replace colons with something else, as those are used in the CDF file as delimiter. */
std::replace(cleaned.begin(), cleaned.end(), ':', '-');
return cleaned;

View File

@@ -247,13 +247,13 @@ void AssetLibrary::remap_ids_and_remove_invalid(const bke::id::IDRemapper &mappi
}
namespace {
void asset_library_on_save_post(Main *main,
void asset_library_on_save_post(Main *bmain,
PointerRNA **pointers,
const int num_pointers,
void *arg)
{
AssetLibrary *asset_lib = static_cast<AssetLibrary *>(arg);
asset_lib->on_blend_save_post(main, pointers, num_pointers);
asset_lib->on_blend_save_post(bmain, pointers, num_pointers);
}
} // namespace
@@ -276,12 +276,12 @@ void AssetLibrary::on_blend_save_handler_unregister()
on_save_callback_store_.arg = nullptr;
}
void AssetLibrary::on_blend_save_post(Main *main,
void AssetLibrary::on_blend_save_post(Main *bmain,
PointerRNA ** /*pointers*/,
const int /*num_pointers*/)
{
if (save_catalogs_when_file_is_saved) {
this->catalog_service().write_to_disk(main->filepath);
this->catalog_service().write_to_disk(bmain->filepath);
}
}

View File

@@ -160,10 +160,12 @@ class AssetLibraryService {
/**
* Get the given asset library. Opens it (i.e. creates a new AssetLibrary instance) if necessary.
*
* \param root_path: The top level directory.
*/
AssetLibrary *get_asset_library_on_disk(eAssetLibraryType library_type,
StringRef name,
StringRefNull top_level_directory);
StringRefNull root_path);
/**
* Ensure the AssetLibraryService instance is destroyed before a new blend file is loaded.
* This makes memory management simple, and ensures a fresh start for every blend file. */

View File

@@ -20,21 +20,23 @@
namespace blender::asset_system {
AssetRepresentation::AssetRepresentation(StringRef relative_path,
AssetRepresentation::AssetRepresentation(StringRef relative_asset_path,
StringRef name,
const int id_type,
std::unique_ptr<AssetMetaData> metadata,
const AssetLibrary &owner_asset_library)
: owner_asset_library_(owner_asset_library),
relative_identifier_(relative_path),
relative_identifier_(relative_asset_path),
asset_(AssetRepresentation::ExternalAsset{name, id_type, std::move(metadata)})
{
}
AssetRepresentation::AssetRepresentation(StringRef relative_path,
AssetRepresentation::AssetRepresentation(StringRef relative_asset_path,
ID &id,
const AssetLibrary &owner_asset_library)
: owner_asset_library_(owner_asset_library), relative_identifier_(relative_path), asset_(&id)
: owner_asset_library_(owner_asset_library),
relative_identifier_(relative_asset_path),
asset_(&id)
{
if (!id.asset_data) {
throw std::invalid_argument("Passed ID is not an asset");

View File

@@ -183,7 +183,7 @@ void BKE_animdata_fix_paths_rename_all(struct ID *ref_id,
* Fix the path after removing elements that are not ID (e.g., node).
* Return true if any animation data was affected.
*/
bool BKE_animdata_fix_paths_remove(struct ID *id, const char *path);
bool BKE_animdata_fix_paths_remove(struct ID *id, const char *prefix);
/* -------------------------------------- */

View File

@@ -67,7 +67,7 @@ bool BKE_appdir_folder_documents(char *dir) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RES
* \returns True if the path is valid. It doesn't create or checks format
* if the `blender` folder exists. It does check if the parent of the path exists.
*/
bool BKE_appdir_folder_caches(char *r_path, size_t r_path_maxncpy) ATTR_NONNULL(1);
bool BKE_appdir_folder_caches(char *path, size_t path_maxncpy) ATTR_NONNULL(1);
/**
* Get a folder out of the \a folder_id presets for paths.
*
@@ -131,8 +131,8 @@ bool BKE_appdir_font_folder_default(char *dir, size_t dir_maxncpy);
/**
* Find Python executable.
*/
bool BKE_appdir_program_python_search(char *fullpath,
size_t fullpath_len,
bool BKE_appdir_program_python_search(char *program_filepath,
size_t program_filepath_maxncpy,
int version_major,
int version_minor) ATTR_NONNULL(1);

View File

@@ -502,7 +502,7 @@ void BKE_pchan_bbone_handles_get(bPoseChannel *pchan,
*/
void BKE_pchan_bbone_spline_params_get(bPoseChannel *pchan,
bool rest,
BBoneSplineParameters *r_param);
BBoneSplineParameters *param);
/**
* Fills the array with the desired amount of bone->segments elements.

View File

@@ -57,7 +57,7 @@ std::optional<std::string> asset_edit_id_save_as(Main &global_main,
const ID &id,
StringRefNull name,
const bUserAssetLibrary &user_library,
AssetWeakReference &weak_ref,
AssetWeakReference &r_weak_ref,
ReportList &reports);
bool asset_edit_id_save(Main &global_main, const ID &id, ReportList &reports);

View File

@@ -375,8 +375,8 @@ class PartialWriteContext : NonCopyable, NonMovable {
*
* \return `true` on success.
*/
bool write(const char *filepath, int write_flags, int remap_mode, ReportList &reports);
bool write(const char *filepath, ReportList &reports);
bool write(const char *write_filepath, int write_flags, int remap_mode, ReportList &reports);
bool write(const char *wtite_filepath, ReportList &reports);
/* TODO: To allow editing an existing external blendfile:
* - API to load a context from a blendfile.

View File

@@ -178,7 +178,7 @@ struct CameraBGImage *BKE_camera_background_image_new(struct Camera *cam);
* `BKE_lib_id.hh`.
*/
struct CameraBGImage *BKE_camera_background_image_copy(const struct CameraBGImage *bgpic_src,
int copy_flag);
int flag);
void BKE_camera_background_image_remove(struct Camera *cam, struct CameraBGImage *bgpic);
void BKE_camera_background_image_clear(struct Camera *cam);

View File

@@ -17,7 +17,7 @@ void BKE_colorband_init(ColorBand *coba, bool rangetype);
void BKE_colorband_init_from_table_rgba(ColorBand *coba,
const float (*array)[4],
int array_len,
bool filter_sample);
bool filter_samples);
ColorBand *BKE_colorband_add(bool rangetype);
bool BKE_colorband_evaluate(const ColorBand *coba, float in, float out[4]);
void BKE_colorband_evaluate_table_rgba(const ColorBand *coba, float **array, int *size);

View File

@@ -57,7 +57,7 @@ void BKE_curvemap_remove(CurveMap *cuma, short flag);
/**
* Remove specified point.
*/
bool BKE_curvemap_remove_point(CurveMap *cuma, CurveMapPoint *cmp);
bool BKE_curvemap_remove_point(CurveMap *cuma, CurveMapPoint *point);
CurveMapPoint *BKE_curvemap_insert(CurveMap *cuma, float x, float y);
/**
* \param type: #eBezTriple_Handle
@@ -195,7 +195,7 @@ void BKE_color_managed_display_settings_copy(ColorManagedDisplaySettings *new_se
* is specified.
*/
void BKE_color_managed_view_settings_init_render(
ColorManagedViewSettings *settings,
ColorManagedViewSettings *view_settings,
const ColorManagedDisplaySettings *display_settings,
const char *view_transform);
@@ -204,7 +204,7 @@ void BKE_color_managed_view_settings_init_render(
* For example,s movie clips while tracking.
*/
void BKE_color_managed_view_settings_init_default(
ColorManagedViewSettings *settings, const ColorManagedDisplaySettings *display_settings);
ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings);
void BKE_color_managed_view_settings_copy(ColorManagedViewSettings *new_settings,
const ColorManagedViewSettings *settings);

View File

@@ -190,7 +190,7 @@ void BKE_curve_correct_bezpart(const float v1[2], float v2[2], float v3[2], cons
/* ** Nurbs ** */
bool BKE_nurbList_index_get_co(ListBase *editnurb, int index, float r_co[3]);
bool BKE_nurbList_index_get_co(ListBase *nurb, int index, float r_co[3]);
int BKE_nurbList_verts_count(const ListBase *nurb);
int BKE_nurbList_verts_count_without_handles(const ListBase *nurb);

View File

@@ -661,7 +661,7 @@ void BKE_fmodifiers_blend_read_data(BlendDataReader *reader, ListBase *fmodifier
* If this is used to write an FCurve, be sure to call `BLO_write_struct(writer, FCurve, fcurve);`
* before calling this function.
*/
void BKE_fcurve_blend_write_data(BlendWriter *writer, FCurve *fcurve);
void BKE_fcurve_blend_write_data(BlendWriter *writer, FCurve *fcu);
void BKE_fcurve_blend_write_listbase(BlendWriter *writer, ListBase *fcurves);
void BKE_fcurve_blend_read_data(BlendDataReader *reader, FCurve *fcu);
void BKE_fcurve_blend_read_data_listbase(BlendDataReader *reader, ListBase *fcurves);

View File

@@ -376,9 +376,9 @@ short BKE_idtype_idcode_from_name(const char *idtype_name);
*/
int BKE_idtype_idcode_to_index(short idcode);
/**
* Convert an \a idfilter into an \a idtype_index (e.g. #FILTER_ID_OB -> #INDEX_ID_OB).
* Convert an \a id_filter into an \a idtype_index (e.g. #FILTER_ID_OB -> #INDEX_ID_OB).
*/
int BKE_idtype_idfilter_to_index(uint64_t idfilter);
int BKE_idtype_idfilter_to_index(uint64_t id_filter);
/**
* Convert an \a idtype_index into an \a idcode (e.g. #INDEX_ID_OB -> #ID_OB).

View File

@@ -49,7 +49,7 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts,
struct ImageUser *iuser,
const bool guess_path,
const bool save_as_render);
void BKE_image_save_options_update(struct ImageSaveOptions *opts, const struct Image *ima);
void BKE_image_save_options_update(struct ImageSaveOptions *opts, const struct Image *image);
void BKE_image_save_options_free(struct ImageSaveOptions *opts);
bool BKE_image_save(struct ReportList *reports,

View File

@@ -26,7 +26,7 @@ struct Main;
*
* \note Currently done after all file reading.
*/
void do_versions_ipos_to_animato(struct Main *main);
void do_versions_ipos_to_animato(struct Main *bmain);
/* --------------------- xxx stuff ------------------------ */

View File

@@ -110,7 +110,7 @@ void BKE_view_layer_copy_data(Scene *scene_dst,
const ViewLayer *view_layer_src,
int flag);
void BKE_view_layer_rename(Main *bmain, Scene *scene, ViewLayer *view_layer, const char *name);
void BKE_view_layer_rename(Main *bmain, Scene *scene, ViewLayer *view_layer, const char *newname);
/**
* Get the active collection
@@ -564,13 +564,12 @@ void BKE_view_layer_verify_aov(RenderEngine *engine, Scene *scene, ViewLayer *vi
* Check if the given view layer has at least one valid AOV.
*/
bool BKE_view_layer_has_valid_aov(ViewLayer *view_layer);
ViewLayer *BKE_view_layer_find_with_aov(Scene *scene, ViewLayerAOV *view_layer_aov);
ViewLayer *BKE_view_layer_find_with_aov(Scene *scene, ViewLayerAOV *aov);
ViewLayerLightgroup *BKE_view_layer_add_lightgroup(ViewLayer *view_layer, const char *name);
void BKE_view_layer_remove_lightgroup(ViewLayer *view_layer, ViewLayerLightgroup *lightgroup);
void BKE_view_layer_set_active_lightgroup(ViewLayer *view_layer, ViewLayerLightgroup *lightgroup);
ViewLayer *BKE_view_layer_find_with_lightgroup(Scene *scene,
ViewLayerLightgroup *view_layer_lightgroup);
ViewLayer *BKE_view_layer_find_with_lightgroup(Scene *scene, ViewLayerLightgroup *lightgroup);
void BKE_view_layer_rename_lightgroup(Scene *scene,
ViewLayer *view_layer,
ViewLayerLightgroup *lightgroup,

View File

@@ -612,7 +612,7 @@ void BKE_lib_id_expand_local(Main *bmain, ID *id, int flags);
* Uniqueness is only ensured within the ID's library (nullptr for local ones), libraries act as
* some kind of namespace for IDs.
*
* \param name: The new name of the given ID, if `nullptr` the current given ID name is used
* \param newname: The new name of the given ID, if `nullptr` the current given ID name is used
* instead. If the given ID has no name (or the given name is an empty string), the default
* matching data name is used as fallback.
* \param do_linked_data: if true, also ensure a unique name in case the given ID is linked
@@ -624,7 +624,7 @@ void BKE_lib_id_expand_local(Main *bmain, ID *id, int flags);
bool BKE_id_new_name_validate(Main *bmain,
ListBase *lb,
ID *id,
const char *name,
const char *newname,
bool do_linked_data) ATTR_NONNULL(1, 2, 3);
/**

View File

@@ -301,12 +301,12 @@ void BKE_lib_override_library_make_local(Main *bmain, ID *id);
/**
* Find override property from given RNA path, if it exists.
*/
IDOverrideLibraryProperty *BKE_lib_override_library_property_find(IDOverrideLibrary *override,
IDOverrideLibraryProperty *BKE_lib_override_library_property_find(IDOverrideLibrary *liboverride,
const char *rna_path);
/**
* Find override property from given RNA path, or create it if it does not exist.
*/
IDOverrideLibraryProperty *BKE_lib_override_library_property_get(IDOverrideLibrary *override,
IDOverrideLibraryProperty *BKE_lib_override_library_property_get(IDOverrideLibrary *liboverride,
const char *rna_path,
bool *r_created);
/**

View File

@@ -373,7 +373,7 @@ float *BKE_mask_point_segment_feather_diff(struct MaskSpline *spline,
struct MaskSplinePoint *point,
int width,
int height,
unsigned int *tot_feather_point);
unsigned int *r_tot_feather_point);
void BKE_mask_layer_evaluate_animation(struct MaskLayer *masklay, float ctime);
void BKE_mask_layer_evaluate_deform(struct MaskLayer *masklay, float ctime);

View File

@@ -103,7 +103,7 @@ int BKE_packedfile_unpack_all_libraries(struct Main *bmain, struct ReportList *r
int BKE_packedfile_write_to_file(struct ReportList *reports,
const char *ref_file_name,
const char *filepath,
const char *filepath_rel,
struct PackedFile *pf);
/* Free. */

View File

@@ -275,7 +275,7 @@ void BKE_undosys_step_load_from_index(UndoStack *ustack, bContext *C, int index)
*/
bool BKE_undosys_step_undo_with_data_ex(UndoStack *ustack,
bContext *C,
UndoStep *us,
UndoStep *us_target,
bool use_skip);
/**
* Undo until `us_target` step becomes the active (currently loaded) one.
@@ -301,7 +301,7 @@ bool BKE_undosys_step_undo(UndoStack *ustack, bContext *C);
*/
bool BKE_undosys_step_redo_with_data_ex(UndoStack *ustack,
bContext *C,
UndoStep *us,
UndoStep *us_target,
bool use_skip);
/**
* Redo until `us_target` step becomes the active (currently loaded) one.

View File

@@ -194,9 +194,9 @@ IDProperty *BKE_asset_metadata_idprop_find(const AssetMetaData *asset_data, cons
/* Queries -------------------------------------------- */
PreviewImage *BKE_asset_metadata_preview_get_from_id(const AssetMetaData * /*asset_data*/,
const ID *id)
const ID *owner_id)
{
return BKE_previewimg_id_get(id);
return BKE_previewimg_id_get(owner_id);
}
/* .blend file API -------------------------------------------- */

View File

@@ -308,7 +308,7 @@ std::optional<std::string> asset_edit_id_save_as(Main &global_main,
const ID &id,
const StringRefNull name,
const bUserAssetLibrary &user_library,
AssetWeakReference &new_weak_ref,
AssetWeakReference &r_weak_ref,
ReportList &reports)
{
const std::string filepath = asset_blendfile_path_for_save(
@@ -322,7 +322,7 @@ std::optional<std::string> asset_edit_id_save_as(Main &global_main,
return std::nullopt;
}
new_weak_ref = asset_weak_reference_for_user_library(
r_weak_ref = asset_weak_reference_for_user_library(
user_library, GS(id.name), name.c_str(), filepath.c_str());
BKE_reportf(&reports, RPT_INFO, "Saved \"%s\"", filepath.c_str());

View File

@@ -2145,9 +2145,9 @@ static void blendfile_write_partial_clear_flags(Main *bmain_src)
}
}
void BKE_blendfile_write_partial_begin(Main *bmain)
void BKE_blendfile_write_partial_begin(Main *bmain_src)
{
blendfile_write_partial_clear_flags(bmain);
blendfile_write_partial_clear_flags(bmain_src);
}
void BKE_blendfile_write_partial_tag_ID(ID *id, bool set)

View File

@@ -799,8 +799,8 @@ bool BKE_fcurve_calc_bounds(const FCurve *fcu,
}
bool BKE_fcurve_calc_range(const FCurve *fcu,
float *r_start,
float *r_end,
float *r_min,
float *r_max,
const bool selected_keys_only)
{
float min = 0.0f;
@@ -828,8 +828,8 @@ bool BKE_fcurve_calc_range(const FCurve *fcu,
foundvert = true;
}
*r_start = min;
*r_end = max;
*r_min = min;
*r_max = max;
return foundvert;
}

View File

@@ -22,12 +22,12 @@ Span<std::unique_ptr<FileHandlerType>> file_handlers()
return file_handlers_vector();
}
FileHandlerType *file_handler_find(const StringRef name)
FileHandlerType *file_handler_find(const StringRef idname)
{
auto itr = std::find_if(file_handlers().begin(),
file_handlers().end(),
[name](const std::unique_ptr<FileHandlerType> &file_handler) {
return name == file_handler->idname;
[idname](const std::unique_ptr<FileHandlerType> &file_handler) {
return idname == file_handler->idname;
});
if (itr != file_handlers().end()) {
return itr->get();

View File

@@ -1822,7 +1822,7 @@ void id_sort_by_name(ListBase *lb, ID *id, ID *id_sorting_hint)
}
bool BKE_id_new_name_validate(
Main *bmain, ListBase *lb, ID *id, const char *tname, const bool do_linked_data)
Main *bmain, ListBase *lb, ID *id, const char *newname, const bool do_linked_data)
{
bool result = false;
char name[MAX_ID_NAME - 2];
@@ -1835,11 +1835,11 @@ bool BKE_id_new_name_validate(
}
/* If no name given, use name of current ID. */
if (tname == nullptr) {
tname = id->name + 2;
if (newname == nullptr) {
newname = id->name + 2;
}
/* Make a copy of given name (tname args can be const). */
STRNCPY(name, tname);
/* Make a copy of given name (newname args can be const). */
STRNCPY(name, newname);
if (name[0] == '\0') {
/* Disallow empty names. */

View File

@@ -1587,11 +1587,11 @@ void BKE_movieclip_get_cache_segments(MovieClip *clip,
}
}
void BKE_movieclip_user_set_frame(MovieClipUser *iuser, int framenr)
void BKE_movieclip_user_set_frame(MovieClipUser *user, int framenr)
{
/* TODO: clamp framenr here? */
iuser->framenr = framenr;
user->framenr = framenr;
}
static void free_buffers(MovieClip *clip)

View File

@@ -150,9 +150,9 @@ TseGroup *TreeHash::lookup_group(const TreeStoreElemKey &key) const
return nullptr;
}
TseGroup *TreeHash::lookup_group(const TreeStoreElem &key_elem) const
TseGroup *TreeHash::lookup_group(const TreeStoreElem &elem) const
{
return lookup_group(TreeStoreElemKey(key_elem));
return lookup_group(TreeStoreElemKey(elem));
}
TseGroup *TreeHash::lookup_group(const short type, const short nr, ID *id) const

View File

@@ -264,7 +264,9 @@ void *BLO_read_struct_array_with_size(BlendDataReader *reader,
* Updates all `->prev` and `->next` pointers of the list elements.
* Updates the `list->first` and `list->last` pointers.
*/
void BLO_read_struct_list_with_size(BlendDataReader *reader, size_t elem_size, ListBase *list);
void BLO_read_struct_list_with_size(BlendDataReader *reader,
size_t expected_elem_size,
ListBase *list);
#define BLO_read_struct_list(reader, struct_name, list) \
BLO_read_struct_list_with_size(reader, sizeof(struct_name), list)
@@ -334,13 +336,13 @@ struct Library *BLO_read_data_current_library(BlendDataReader *reader);
* during library linking part of blend-file reading process.
*
* \param self_id: the ID owner of the given `id` pointer. Note that it may be an embedded ID.
* \param do_linked_only: If `true`, only return found pointer if it is a linked ID. Used to
* \param is_linked_only: If `true`, only return found pointer if it is a linked ID. Used to
* prevent linked data to point to local IDs.
* \return the new address of the given ID pointer, or null if not found.
*/
ID *BLO_read_get_new_id_address(BlendLibReader *reader,
ID *self_id,
const bool do_linked_only,
const bool is_linked_only,
ID *id) ATTR_NONNULL(2);
/**

View File

@@ -315,7 +315,7 @@ bool ED_gpencil_anim_copybuf_copy(bAnimContext *ac);
/**
* Pastes keyframes from buffer, and reports success.
*/
bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, short copy_mode);
bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, short offset_mode);
/* ------------ Grease-Pencil Undo System ------------------ */
int ED_gpencil_session_active();

View File

@@ -348,7 +348,7 @@ KeyframeEditFunc ANIM_editkeyframes_snap(short mode);
* \note for markers and 'value', the values to use must be supplied as the first float value.
*/
KeyframeEditFunc ANIM_editkeyframes_mirror(short mode);
KeyframeEditFunc ANIM_editkeyframes_select(short mode);
KeyframeEditFunc ANIM_editkeyframes_select(short selectmode);
/**
* Set all selected Bezier Handles to a single type.
*/
@@ -455,7 +455,7 @@ void ED_ANIM_get_1d_gauss_kernel(const float sigma, int kernel_size, double *r_k
ButterworthCoefficients *ED_anim_allocate_butterworth_coefficients(const int filter_order);
void ED_anim_free_butterworth_coefficients(ButterworthCoefficients *bw_coeff);
void ED_anim_calculate_butterworth_coefficients(float cutoff,
void ED_anim_calculate_butterworth_coefficients(float cutoff_frequency,
float sampling_frequency,
ButterworthCoefficients *bw_coeff);
/**

View File

@@ -140,7 +140,7 @@ void ANIM_relative_keyingset_add_source(blender::Vector<PointerRNA> &sources, ID
*/
blender::animrig::ModifyKeyReturn ANIM_validate_keyingset(bContext *C,
blender::Vector<PointerRNA> *sources,
KeyingSet *ks);
KeyingSet *keyingset);
/**
* Use the specified #KeyingSet and context info (if required)
@@ -154,7 +154,7 @@ blender::animrig::ModifyKeyReturn ANIM_validate_keyingset(bContext *C,
*/
int ANIM_apply_keyingset(bContext *C,
blender::Vector<PointerRNA> *sources,
KeyingSet *ks,
KeyingSet *keyingset,
blender::animrig::ModifyKeyMode mode,
float cfra);
@@ -181,12 +181,12 @@ bool ANIM_keyingset_find_id(KeyingSet *ks, ID *id);
* Add the given KeyingSetInfo to the list of type infos,
* and create an appropriate builtin set too.
*/
void ANIM_keyingset_info_register(KeyingSetInfo *ksi);
void ANIM_keyingset_info_register(KeyingSetInfo *keyingset_info);
/**
* Remove the given #KeyingSetInfo from the list of type infos,
* and also remove the builtin set if appropriate.
*/
void ANIM_keyingset_info_unregister(Main *bmain, KeyingSetInfo *ksi);
void ANIM_keyingset_info_unregister(Main *bmain, KeyingSetInfo *keyingset_info);
/* cleanup on exit */
/* --------------- */
@@ -203,7 +203,7 @@ KeyingSet *ANIM_scene_get_active_keyingset(const Scene *scene);
/**
* Get the index of the Keying Set provided, for the given Scene.
*/
int ANIM_scene_get_keyingset_index(Scene *scene, KeyingSet *ks);
int ANIM_scene_get_keyingset_index(Scene *scene, KeyingSet *keyingset);
/**
* Get Keying Set to use for Auto-Key-Framing some transforms.
@@ -246,7 +246,7 @@ KeyingSet *ANIM_keyingset_get_from_idname(Scene *scene, const char *idname);
/**
* Check if #KeyingSet can be used in the current context.
*/
bool ANIM_keyingset_context_ok_poll(bContext *C, KeyingSet *ks);
bool ANIM_keyingset_context_ok_poll(bContext *C, KeyingSet *keyingset);
/** \} */

View File

@@ -67,14 +67,14 @@ TimeMarker *ED_markers_find_nearest_marker(ListBase *markers, float x);
*/
int ED_markers_find_nearest_marker_time(ListBase *markers, float x);
void ED_markers_get_minmax(ListBase *markers, short sel, float *first, float *last);
void ED_markers_get_minmax(ListBase *markers, short sel, float *r_first, float *r_last);
/**
* This function makes a list of all the markers. The only_sel
* argument is used to specify whether only the selected markers
* are added.
*/
void ED_markers_make_cfra_list(ListBase *markers, ListBase *lb, short sel);
void ED_markers_make_cfra_list(ListBase *markers, ListBase *lb, short only_sel);
void ED_markers_deselect_all(ListBase *markers, int action);

View File

@@ -107,7 +107,7 @@ void ED_preview_restart_queue_work(const bContext *C);
void ED_preview_kill_jobs(wmWindowManager *wm, Main *bmain);
void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slot, rcti *rect);
void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slotp, rcti *rect);
void ED_render_clear_mtex_copybuf();

View File

@@ -62,7 +62,7 @@ void ED_scene_fps_average_accumulate(Scene *scene, short fps_samples, double lti
* Calculate an average (if it's not already calculated).
* \return false on failure otherwise all values in `state` are initialized.
*/
bool ED_scene_fps_average_calc(const Scene *scene, SceneFPS_State *state) ATTR_NONNULL(1, 2);
bool ED_scene_fps_average_calc(const Scene *scene, SceneFPS_State *r_state) ATTR_NONNULL(1, 2);
/**
* Clear run-time data for accumulating animation playback average times.
*/

View File

@@ -219,7 +219,7 @@ void ED_screen_global_areas_sync(wmWindow *win);
void ED_area_do_listen(wmSpaceTypeListenerParams *params);
void ED_area_tag_redraw(ScrArea *area);
void ED_area_tag_redraw_no_rebuild(ScrArea *area);
void ED_area_tag_redraw_regiontype(ScrArea *area, int type);
void ED_area_tag_redraw_regiontype(ScrArea *area, int regiontype);
void ED_area_tag_refresh(ScrArea *area);
/**
* For regions that change the region size in their #ARegionType.layout() callback: Mark the area
@@ -267,7 +267,7 @@ void ED_area_offscreen_free(wmWindowManager *wm, wmWindow *win, ScrArea *area);
* Search all screens, even non-active or overlapping (multiple windows), return the most-likely
* area of interest. xy is relative to active window, like all similar functions.
*/
ScrArea *ED_area_find_under_cursor(const bContext *C, int spacetype, const int xy[2]);
ScrArea *ED_area_find_under_cursor(const bContext *C, int spacetype, const int event_xy[2]);
ScrArea *ED_screen_areas_iter_first(const wmWindow *win, const bScreen *screen);
ScrArea *ED_screen_areas_iter_next(const bScreen *screen, const ScrArea *area);

View File

@@ -98,7 +98,7 @@ void ED_slider_allow_overshoot_set(tSlider *slider, bool lower, bool upper);
*/
void ED_slider_factor_bounds_set(tSlider *slider,
float factor_bound_lower,
float factor_upper_bound);
float factor_bound_upper);
bool ED_slider_allow_increments_get(const tSlider *slider);
void ED_slider_allow_increments_set(tSlider *slider, bool value);
@@ -108,7 +108,7 @@ SliderMode ED_slider_mode_get(const tSlider *slider);
void ED_slider_unit_set(tSlider *slider, const char *unit);
/* Set a name that will show next to the slider to indicate which property is modified currently.
* To clear, set to an empty string. */
void ED_slider_property_label_set(tSlider *slider, const char *prop_name);
void ED_slider_property_label_set(tSlider *slider, const char *property_label);
/* ************** XXX OLD CRUFT WARNING ************* */

View File

@@ -772,7 +772,8 @@ int UI_popover_panel_invoke(bContext *C, const char *idname, bool keep_open, Rep
* \param from_active_button: Use the active button for positioning,
* use when the popover is activated from an operator instead of directly from the button.
*/
uiPopover *UI_popover_begin(bContext *C, int menu_width, bool from_active_button) ATTR_NONNULL(1);
uiPopover *UI_popover_begin(bContext *C, int ui_menu_width, bool from_active_button)
ATTR_NONNULL(1);
/**
* Set the whole structure to work.
*/
@@ -923,7 +924,7 @@ void UI_blocklist_free_inactive(const bContext *C, ARegion *region);
* Is called by notifier.
*/
void UI_screen_free_active_but_highlight(const bContext *C, bScreen *screen);
void UI_region_free_active_but_all(bContext *context, ARegion *region);
void UI_region_free_active_but_all(bContext *C, ARegion *region);
void UI_block_region_set(uiBlock *block, ARegion *region);
@@ -1600,7 +1601,7 @@ uiBut *uiDefSearchBut(uiBlock *block,
void *arg,
int retval,
int icon,
int maxlen,
int maxncpy,
int x,
int y,
short width,
@@ -1616,7 +1617,7 @@ uiBut *uiDefSearchButO_ptr(uiBlock *block,
void *arg,
int retval,
int icon,
int maxlen,
int maxncpy,
int x,
int y,
short width,
@@ -1878,7 +1879,7 @@ bool UI_textbutton_activate_rna(const bContext *C,
ARegion *region,
const void *rna_poin_data,
const char *rna_prop_id);
bool UI_textbutton_activate_but(const bContext *C, uiBut *but);
bool UI_textbutton_activate_but(const bContext *C, uiBut *actbut);
/**
* push a new event onto event queue to activate the given button
@@ -1915,7 +1916,7 @@ struct AutoComplete;
#define AUTOCOMPLETE_FULL_MATCH 1
#define AUTOCOMPLETE_PARTIAL_MATCH 2
AutoComplete *UI_autocomplete_begin(const char *startname, size_t maxlen);
AutoComplete *UI_autocomplete_begin(const char *startname, size_t maxncpy);
void UI_autocomplete_update_name(AutoComplete *autocpl, const char *name);
int UI_autocomplete_end(AutoComplete *autocpl, char *autoname);
@@ -2873,7 +2874,7 @@ void uiItemEnumO_string(uiLayout *layout,
int icon,
const char *opname,
const char *propname,
const char *value);
const char *value_str);
void uiItemsEnumO(uiLayout *layout, const char *opname, const char *propname);
void uiItemBooleanO(uiLayout *layout,
const char *name,
@@ -3370,8 +3371,8 @@ void UI_butstore_clear(uiBlock *block);
* Map freed buttons from the old block and update pointers.
*/
void UI_butstore_update(uiBlock *block);
void UI_butstore_free(uiBlock *block, uiButStore *bs);
bool UI_butstore_is_valid(uiButStore *bs);
void UI_butstore_free(uiBlock *block, uiButStore *bs_handle);
bool UI_butstore_is_valid(uiButStore *bs_handle);
bool UI_butstore_is_registered(uiBlock *block, uiBut *but);
void UI_butstore_register(uiButStore *bs_handle, uiBut **but_p);
/**

View File

@@ -461,7 +461,7 @@ bool UI_GetIconThemeColor4ubv(int colorid, unsigned char col[4]);
/**
* Shade a 3 byte color (same as UI_GetColorPtrBlendShade3ubv with 0.0 factor).
*/
void UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char col[3], int offset);
void UI_GetColorPtrShade3ubv(const unsigned char cp[3], unsigned char col[3], int offset);
/**
* Get a 3 byte color, blended and shaded between two other char color pointers.

View File

@@ -39,7 +39,7 @@ void datadropper_win_area_find(const bContext *C,
*
* \note Exposed by 'eyedropper_intern.hh' for use with color band picking.
*/
void eyedropper_color_sample_fl(bContext *C, const int m_xy[2], float r_col[3]);
void eyedropper_color_sample_fl(bContext *C, const int event_xy[2], float r_col[3]);
/* Used for most eye-dropper operators. */
enum {

View File

@@ -76,7 +76,7 @@ using blender::Vector;
/* prototypes. */
static void ui_def_but_rna__menu(bContext *C, uiLayout *layout, void *but_p);
static void ui_def_but_rna__panel_type(bContext * /*C*/, uiLayout *layout, void *but_p);
static void ui_def_but_rna__panel_type(bContext * /*C*/, uiLayout *layout, void *arg);
static void ui_def_but_rna__menu_type(bContext * /*C*/, uiLayout *layout, void *but_p);
/* avoid unneeded calls to ui_but_value_get */
@@ -5635,15 +5635,15 @@ uiBut *uiDefIconTextButO(uiBlock *block,
void UI_but_operator_set(uiBut *but,
wmOperatorType *optype,
wmOperatorCallContext opcontext,
const PointerRNA *op_props)
const PointerRNA *opptr)
{
but->optype = optype;
but->opcontext = opcontext;
but->flag &= ~UI_BUT_UNDO; /* no need for ui_but_is_rna_undo(), we never need undo here */
MEM_SAFE_FREE(but->opptr);
if (op_props) {
but->opptr = MEM_cnew<PointerRNA>(__func__, *op_props);
if (opptr) {
but->opptr = MEM_cnew<PointerRNA>(__func__, *opptr);
}
}

View File

@@ -182,7 +182,7 @@ static bool ui_mouse_motion_keynav_test(uiKeyNavLock *keynav, const wmEvent *eve
static void with_but_active_as_semi_modal(bContext *C,
ARegion *region,
uiBut *semi_modal_but,
uiBut *but,
blender::FunctionRef<void()> fn);
static int ui_handle_region_semi_modal_buttons(bContext *C, const wmEvent *event, ARegion *region);

View File

@@ -745,9 +745,9 @@ void ui_hsvcircle_vals_from_pos(
* Cursor in HSV circle, in float units -1 to 1, to map on radius.
*/
void ui_hsvcircle_pos_from_vals(
const ColorPicker *cpicker, const rcti *rect, const float *hsv, float *xpos, float *ypos);
const ColorPicker *cpicker, const rcti *rect, const float *hsv, float *r_xpos, float *r_ypos);
void ui_hsvcube_pos_from_vals(
const uiButHSVCube *hsv_but, const rcti *rect, const float *hsv, float *xp, float *yp);
const uiButHSVCube *hsv_but, const rcti *rect, const float *hsv, float *r_xp, float *r_yp);
/**
* \param float_precision: For number buttons the precision
@@ -774,7 +774,7 @@ char *ui_but_string_get_dynamic(uiBut *but, int *r_str_size);
*/
void ui_but_convert_to_unit_alt_name(uiBut *but, char *str, size_t str_maxncpy) ATTR_NONNULL();
bool ui_but_string_set(bContext *C, uiBut *but, const char *str) ATTR_NONNULL();
bool ui_but_string_eval_number(bContext *C, const uiBut *but, const char *str, double *value)
bool ui_but_string_eval_number(bContext *C, const uiBut *but, const char *str, double *r_value)
ATTR_NONNULL();
int ui_but_string_get_maxncpy(uiBut *but);
/**
@@ -1109,15 +1109,15 @@ void ui_draw_but_TAB_outline(const rcti *rect,
void ui_draw_but_HISTOGRAM(ARegion *region,
uiBut *but,
const uiWidgetColors *wcol,
const rcti *rect);
const rcti *recti);
void ui_draw_but_WAVEFORM(ARegion *region,
uiBut *but,
const uiWidgetColors *wcol,
const rcti *rect);
const rcti *recti);
void ui_draw_but_VECTORSCOPE(ARegion *region,
uiBut *but,
const uiWidgetColors *wcol,
const rcti *rect);
const rcti *recti);
void ui_draw_but_COLORBAND(uiBut *but, const uiWidgetColors *wcol, const rcti *rect);
void ui_draw_but_UNITVEC(uiBut *but, const uiWidgetColors *wcol, const rcti *rect, float radius);
void ui_draw_but_CURVE(ARegion *region, uiBut *but, const uiWidgetColors *wcol, const rcti *rect);
@@ -1132,7 +1132,7 @@ void ui_draw_but_IMAGE(ARegion *region, uiBut *but, const uiWidgetColors *wcol,
void ui_draw_but_TRACKPREVIEW(ARegion *region,
uiBut *but,
const uiWidgetColors *wcol,
const rcti *rect);
const rcti *recti);
/* `interface_undo.cc` */
@@ -1142,14 +1142,14 @@ void ui_draw_but_TRACKPREVIEW(ARegion *region,
* \note The current state should be pushed immediately after calling this.
*/
uiUndoStack_Text *ui_textedit_undo_stack_create();
void ui_textedit_undo_stack_destroy(uiUndoStack_Text *undo_stack);
void ui_textedit_undo_stack_destroy(uiUndoStack_Text *stack);
/**
* Push the information in the arguments to a new state in the undo stack.
*
* \note Currently the total length of the undo stack is not limited.
*/
void ui_textedit_undo_push(uiUndoStack_Text *undo_stack, const char *text, int cursor_index);
const char *ui_textedit_undo(uiUndoStack_Text *undo_stack, int direction, int *r_cursor_index);
void ui_textedit_undo_push(uiUndoStack_Text *stack, const char *text, int cursor_index);
const char *ui_textedit_undo(uiUndoStack_Text *stack, int direction, int *r_cursor_index);
/* interface_handlers.cc */

View File

@@ -860,9 +860,9 @@ void UI_butstore_free(uiBlock *block, uiButStore *bs_handle)
MEM_freeN(bs_handle);
}
bool UI_butstore_is_valid(uiButStore *bs)
bool UI_butstore_is_valid(uiButStore *bs_handle)
{
return (bs->block != nullptr);
return (bs_handle->block != nullptr);
}
bool UI_butstore_is_registered(uiBlock *block, uiBut *but)

View File

@@ -629,11 +629,11 @@ std::string AssetCatalogTreeViewAllItem::DropTarget::drop_tooltip(
}
bool AssetCatalogTreeViewAllItem::DropTarget::on_drop(bContext * /*C*/,
const ui::DragInfo &drag) const
const ui::DragInfo &drag_info) const
{
BLI_assert(drag.drag_data.type == WM_DRAG_ASSET_CATALOG);
BLI_assert(drag_info.drag_data.type == WM_DRAG_ASSET_CATALOG);
return AssetCatalogDropTarget::drop_asset_catalog_into_catalog(
drag.drag_data,
drag_info.drag_data,
this->get_view<AssetCatalogTreeView>(),
/* No value to drop into the root level. */
std::nullopt);
@@ -673,11 +673,11 @@ std::string AssetCatalogTreeViewUnassignedItem::DropTarget::drop_tooltip(
}
bool AssetCatalogTreeViewUnassignedItem::DropTarget::on_drop(bContext *C,
const ui::DragInfo &drag) const
const ui::DragInfo &drag_info) const
{
/* Assign to nil catalog ID. */
return AssetCatalogDropTarget::drop_assets_into_catalog(
C, this->get_view<AssetCatalogTreeView>(), drag.drag_data, CatalogID{});
C, this->get_view<AssetCatalogTreeView>(), drag_info.drag_data, CatalogID{});
}
/* ---------------------------------------------------------------------- */

View File

@@ -226,7 +226,7 @@ void file_tile_boundbox(const ARegion *region, FileLayout *layout, int file, rct
/**
* If \a path leads to a .blend, remove the trailing slash (if needed).
*/
void file_path_to_ui_path(const char *path, char *r_pathi, int max_size);
void file_path_to_ui_path(const char *path, char *r_path, int r_path_maxncpy);
/* asset_catalog_tree_view.cc */

View File

@@ -29,10 +29,10 @@ void file_tile_boundbox(const ARegion *region, FileLayout *layout, const int fil
ymax);
}
void file_path_to_ui_path(const char *path, char *r_path, int max_size)
void file_path_to_ui_path(const char *path, char *r_path, int r_path_maxncpy)
{
char tmp_path[FILE_MAX_LIBEXTRA];
STRNCPY(tmp_path, path);
BLI_path_slash_rstrip(tmp_path);
BLI_strncpy(r_path, BKE_blendfile_extension_check(tmp_path) ? tmp_path : path, max_size);
BLI_strncpy(r_path, BKE_blendfile_extension_check(tmp_path) ? tmp_path : path, r_path_maxncpy);
}

View File

@@ -134,7 +134,7 @@ FileDirEntry *filelist_file_ex(FileList *filelist, int index, bool use_request);
* Find a file from a file name, or more precisely, its file-list relative path, inside the
* filtered items. \return The index of the found file or -1.
*/
int filelist_file_find_path(FileList *filelist, const char *file);
int filelist_file_find_path(FileList *filelist, const char *filename);
/**
* Find a file representing \a id.
* \return The index of the found file or -1.

View File

@@ -35,7 +35,7 @@ class ObjectsChildrenBuilder {
ObjectTreeElementsMap object_tree_elements_map_;
public:
ObjectsChildrenBuilder(SpaceOutliner &soutliner);
ObjectsChildrenBuilder(SpaceOutliner &space_outliner);
~ObjectsChildrenBuilder() = default;
void operator()(TreeElement &collection_tree_elem);
@@ -194,7 +194,10 @@ void TreeDisplayViewLayer::add_layer_collection_objects_children(TreeElement &co
*
* \{ */
ObjectsChildrenBuilder::ObjectsChildrenBuilder(SpaceOutliner &outliner) : outliner_(outliner) {}
ObjectsChildrenBuilder::ObjectsChildrenBuilder(SpaceOutliner &space_outliner)
: outliner_(space_outliner)
{
}
void ObjectsChildrenBuilder::operator()(TreeElement &collection_tree_elem)
{

View File

@@ -235,11 +235,11 @@ eSnapMode snap_polygon_mesh(SnapObjectContext *sctx,
const ID *id,
const blender::float4x4 &obmat,
eSnapMode snap_to_flag,
int face);
int face_index);
eSnapMode snap_edge_points_mesh(SnapObjectContext *sctx,
const Object *ob_eval,
const ID *id,
const blender::float4x4 &obmat,
float dist_px_sq_orig,
int edge);
int edge_index);

View File

@@ -419,10 +419,10 @@ eSnapMode snap_edge_points_mesh(SnapObjectContext *sctx,
const ID *id,
const float4x4 &obmat,
float dist_pex_sq_orig,
int edge)
int edge_index)
{
SnapData_Mesh nearest2d(sctx, reinterpret_cast<const Mesh *>(id), obmat);
eSnapMode elem = nearest2d.snap_edge_points_impl(sctx, edge, dist_pex_sq_orig);
eSnapMode elem = nearest2d.snap_edge_points_impl(sctx, edge_index, dist_pex_sq_orig);
if (nearest2d.nearest_point.index != -2) {
nearest2d.register_result(sctx, ob_eval, id);
}

View File

@@ -180,8 +180,8 @@ void IMB_colormanagement_colorspace_to_scene_linear(
float *buffer, int width, int height, int channels, ColorSpace *colorspace, bool predivide);
void IMB_colormanagement_imbuf_to_byte_texture(unsigned char *out_buffer,
int x,
int y,
int offset_x,
int offset_y,
int width,
int height,
const ImBuf *ibuf,
@@ -477,7 +477,7 @@ bool IMB_colormanagement_setup_glsl_draw(const ColorManagedViewSettings *view_se
bool IMB_colormanagement_setup_glsl_draw_from_space(
const ColorManagedViewSettings *view_settings,
const ColorManagedDisplaySettings *display_settings,
ColorSpace *colorspace,
ColorSpace *from_colorspace,
float dither,
bool predivide,
bool do_overlay_merge);
@@ -490,7 +490,7 @@ bool IMB_colormanagement_setup_glsl_draw_ctx(const bContext *C, float dither, bo
* but color management settings are guessing from a given context.
*/
bool IMB_colormanagement_setup_glsl_draw_from_space_ctx(const bContext *C,
ColorSpace *colorspace,
ColorSpace *from_colorspace,
float dither,
bool predivide);
/**

View File

@@ -760,6 +760,6 @@ ImBuf *IMB_stereo3d_ImBuf(const ImageFormatData *im_format, ImBuf *ibuf_left, Im
* Reading a stereo encoded ibuf (*left) and generating two ibufs from it (*left and *right).
*/
void IMB_ImBufFromStereo3d(const Stereo3dFormat *s3d,
ImBuf *ibuf_stereo,
ImBuf *ibuf_stereo3d,
ImBuf **r_ibuf_left,
ImBuf **r_ibuf_right);

View File

@@ -39,7 +39,7 @@ class ABCHierarchyIterator : public AbstractHierarchyIterator {
public:
ABCHierarchyIterator(Main *bmain,
Depsgraph *depsgraph,
ABCArchive *abc_archive_,
ABCArchive *abc_archive,
const AlembicExportParams &params);
virtual void iterate_and_write() override;

View File

@@ -28,7 +28,7 @@ class GpencilImporterSVG : public GpencilImporter {
protected:
private:
void create_stroke(bGPdata *gpd_,
void create_stroke(bGPdata *gpd,
bGPDframe *gpf,
NSVGshape *shape,
NSVGpath *path,

View File

@@ -411,7 +411,7 @@ static void add_image_textures(Main *bmain,
}
bNodeTree *create_mtl_node_tree(Main *bmain,
const MTLMaterial &mtl,
const MTLMaterial &mtl_mat,
Material *mat,
bool relative_paths)
{
@@ -421,8 +421,8 @@ bNodeTree *create_mtl_node_tree(Main *bmain,
bNode *bsdf = add_node(ntree, SH_NODE_BSDF_PRINCIPLED, node_locx_bsdf, node_locy_top);
bNode *output = add_node(ntree, SH_NODE_OUTPUT_MATERIAL, node_locx_output, node_locy_top);
set_bsdf_socket_values(bsdf, mat, mtl);
add_image_textures(bmain, ntree, bsdf, mat, mtl, relative_paths);
set_bsdf_socket_values(bsdf, mat, mtl_mat);
add_image_textures(bmain, ntree, bsdf, mat, mtl_mat, relative_paths);
link_sockets(ntree, bsdf, "BSDF", output, "Surface");
bke::nodeSetActive(ntree, output);

View File

@@ -50,7 +50,7 @@ class LinkSearchOpParams {
}
bNode &add_node(StringRef idname);
bNode &add_node(const bke::bNodeType &type);
bNode &add_node(const bke::bNodeType &node_type);
/**
* Find a socket with the given name (correctly checks for inputs and outputs)
* and connect it to the socket the link drag started from (#socket).

View File

@@ -28,7 +28,7 @@ char *pyrna_enum_repr(const struct EnumPropertyItem *item);
*/
int pyrna_enum_value_from_id(const struct EnumPropertyItem *item,
const char *identifier,
int *value,
int *r_value,
const char *error_prefix);
/**

View File

@@ -52,7 +52,7 @@ void BPy_reports_write_stdout(const ReportList *reports, const char *header)
}
bool BPy_errors_to_report_ex(ReportList *reports,
const char *err_prefix,
const char *error_prefix,
const bool use_full,
const bool use_location)
{
@@ -70,9 +70,9 @@ bool BPy_errors_to_report_ex(ReportList *reports,
err_str_len -= 1;
}
if (err_prefix == nullptr) {
if (error_prefix == nullptr) {
/* Not very helpful, better than nothing. */
err_prefix = "Python";
error_prefix = "Python";
}
const char *location_filepath = nullptr;
@@ -100,14 +100,14 @@ bool BPy_errors_to_report_ex(ReportList *reports,
"%s: %.*s\n"
/* Location (when available). */
"Location: %s:%d",
err_prefix,
error_prefix,
int(err_str_len),
err_str,
location_filepath,
location_line_number);
}
else {
BKE_reportf(reports, RPT_ERROR, "%s: %.*s", err_prefix, int(err_str_len), err_str);
BKE_reportf(reports, RPT_ERROR, "%s: %.*s", error_prefix, int(err_str_len), err_str);
}
if (reports != reports_orig) {

View File

@@ -71,7 +71,7 @@ struct BPy_Library {
bool bmain_is_temp;
};
static PyObject *bpy_lib_load(BPy_PropertyRNA *self, PyObject *args, PyObject *kwds);
static PyObject *bpy_lib_load(BPy_PropertyRNA *self, PyObject *args, PyObject *kw);
static PyObject *bpy_lib_enter(BPy_Library *self);
static PyObject *bpy_lib_exit(BPy_Library *self, PyObject *args);
static PyObject *bpy_lib_dir(BPy_Library *self);

View File

@@ -233,8 +233,8 @@ int pyrna_struct_as_ptr_parse(PyObject *o, void *p);
int pyrna_struct_as_ptr_or_null_parse(PyObject *o, void *p);
void pyrna_struct_type_extend_capi(struct StructRNA *srna,
struct PyMethodDef *py_method,
struct PyGetSetDef *py_getset);
struct PyMethodDef *method,
struct PyGetSetDef *getset);
/* Called before stopping Python. */

View File

@@ -37,7 +37,7 @@ struct BPy_DataContext {
char filepath[1024];
};
static PyObject *bpy_rna_data_temp_data(PyObject *self, PyObject *args, PyObject *kwds);
static PyObject *bpy_rna_data_temp_data(PyObject *self, PyObject *args, PyObject *kw);
static PyObject *bpy_rna_data_context_enter(BPy_DataContext *self);
static PyObject *bpy_rna_data_context_exit(BPy_DataContext *self, PyObject *args);

View File

@@ -191,7 +191,7 @@ int mathutils_array_parse(
}
int mathutils_array_parse_alloc(float **array,
int array_num,
int array_num_min,
PyObject *value,
const char *error_prefix)
{
@@ -207,12 +207,12 @@ int mathutils_array_parse_alloc(float **array,
return -1;
}
if (num < array_num) {
if (num < array_num_min) {
PyErr_Format(PyExc_ValueError,
"%.200s: sequence size is %d, expected >= %d",
error_prefix,
num,
array_num);
array_num_min);
return -1;
}
@@ -235,13 +235,13 @@ int mathutils_array_parse_alloc(float **array,
num = PySequence_Fast_GET_SIZE(value_fast);
if (num < array_num) {
if (num < array_num_min) {
Py_DECREF(value_fast);
PyErr_Format(PyExc_ValueError,
"%.200s: sequence size is %d, expected >= %d",
error_prefix,
num,
array_num);
array_num_min);
return -1;
}

View File

@@ -85,7 +85,7 @@ int BaseMathObject_is_gc(BaseMathObject *self);
PyMODINIT_FUNC PyInit_mathutils(void);
int EXPP_FloatsAreEqual(float A, float B, int maxDiff);
int EXPP_FloatsAreEqual(float af, float bf, int maxDiff);
int EXPP_VectorsAreEqual(const float *vecA, const float *vecB, int size, int floatSteps);
typedef struct Mathutils_Callback Mathutils_Callback;
@@ -201,7 +201,7 @@ int mathutils_any_to_rotmat(float rmat[3][3], PyObject *value, const char *error
*
* \note consistent with the equivalent tuple of floats (CPython's 'tuplehash')
*/
Py_hash_t mathutils_array_hash(const float *float_array, size_t array_len);
Py_hash_t mathutils_array_hash(const float *array, size_t array_len);
/* zero remaining unused elements of the array */
#define MU_ARRAY_ZERO (1u << 30)

View File

@@ -58,7 +58,7 @@ PyObject *Matrix_CreatePyObject_wrap(float *mat,
ushort row_num,
PyTypeObject *base_type) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1);
PyObject *Matrix_CreatePyObject_cb(PyObject *user,
PyObject *Matrix_CreatePyObject_cb(PyObject *cb_user,
unsigned short col_num,
unsigned short row_num,
unsigned char cb_type,

View File

@@ -42,10 +42,10 @@ PyObject *Vector_CreatePyObject_wrap(float *vec,
* Create a vector where the value is defined by registered callbacks,
* see: #Mathutils_RegisterCallback
*/
PyObject *Vector_CreatePyObject_cb(PyObject *user,
PyObject *Vector_CreatePyObject_cb(PyObject *cb_user,
int vec_num,
unsigned char cb_type,
unsigned char subtype) ATTR_WARN_UNUSED_RESULT;
unsigned char cb_subtype) ATTR_WARN_UNUSED_RESULT;
/**
* \param vec: Initialized vector value to use in-place, allocated with #PyMem_Malloc
*/

View File

@@ -33,7 +33,7 @@ void SEQ_proxy_rebuild_finish(SeqIndexBuildContext *context, bool stop);
void SEQ_proxy_set(Sequence *seq, bool value);
bool SEQ_can_use_proxy(const SeqRenderData *context, Sequence *seq, int psize);
int SEQ_rendersize_to_proxysize(int render_size);
double SEQ_rendersize_to_scale_factor(int size);
double SEQ_rendersize_to_scale_factor(int render_size);
struct ProxyJob {
Main *main;

View File

@@ -68,7 +68,8 @@ bool SEQ_retiming_key_is_freeze_frame(const SeqRetimingKey *key);
bool SEQ_retiming_selection_clear(const Editing *ed);
void SEQ_retiming_selection_append(SeqRetimingKey *key);
void SEQ_retiming_selection_remove(SeqRetimingKey *key);
void SEQ_retiming_remove_multiple_keys(Sequence *seq, blender::Vector<SeqRetimingKey *> &keys);
void SEQ_retiming_remove_multiple_keys(Sequence *seq,
blender::Vector<SeqRetimingKey *> &keys_to_remove);
bool SEQ_retiming_selection_contains(const Editing *ed, const SeqRetimingKey *key);
bool SEQ_retiming_selection_has_whole_transition(const Editing *ed, SeqRetimingKey *key);
bool SEQ_retiming_data_is_editable(const Sequence *seq);

View File

@@ -51,7 +51,7 @@ EQCurveMappingData *SEQ_sound_equalizermodifier_add_graph(SoundEqualizerModifier
float min_freq,
float max_freq);
void SEQ_sound_equalizermodifier_remove_graph(SoundEqualizerModifierData *semd,
EQCurveMappingData *gsed);
EQCurveMappingData *eqcmd);
struct SoundModifierWorkerInfo {
int type;

View File

@@ -19,7 +19,7 @@ struct StripElem;
void SEQ_sequence_base_unique_name_recursive(Scene *scene, ListBase *seqbasep, Sequence *seq);
const char *SEQ_sequence_give_name(const Sequence *seq);
ListBase *SEQ_get_seqbase_from_sequence(Sequence *seq, ListBase **channels, int *r_offset);
ListBase *SEQ_get_seqbase_from_sequence(Sequence *seq, ListBase **r_channels, int *r_offset);
const Sequence *SEQ_get_topmost_sequence(const Scene *scene, int frame);
/**
* In cases where we don't know the sequence's listbase.

View File

@@ -23,6 +23,6 @@ void seq_effect_speed_rebuild_map(Scene *scene, Sequence *seq);
* Override timeline_frame when rendering speed effect input.
*/
float seq_speed_effect_target_frame_get(Scene *scene,
Sequence *seq,
Sequence *seq_speed,
float timeline_frame,
int input);

View File

@@ -42,7 +42,7 @@ void seq_cache_thumbnail_put(const SeqRenderData *context,
ImBuf *i,
const rctf *view_area);
bool seq_cache_put_if_possible(
const SeqRenderData *context, Sequence *seq, float timeline_frame, int type, ImBuf *nval);
const SeqRenderData *context, Sequence *seq, float timeline_frame, int type, ImBuf *ibuf);
/**
* Find only "base" keys.
* Sources(other types) for a frame must be freed all at once.

View File

@@ -15,6 +15,6 @@ struct anim;
#define PROXY_MAXFILE (2 * FILE_MAXDIR + FILE_MAXFILE)
ImBuf *seq_proxy_fetch(const SeqRenderData *context, Sequence *seq, int timeline_frame);
bool seq_proxy_get_custom_file_filepath(Sequence *seq, char *name, int view_id);
bool seq_proxy_get_custom_file_filepath(Sequence *seq, char *filepath, int view_id);
void free_proxy_seq(Sequence *seq);
void seq_proxy_index_dir_set(ImBufAnim *anim, const char *base_dir);

View File

@@ -304,7 +304,7 @@ Scene *WM_window_get_active_scene(const wmWindow *win) ATTR_NONNULL() ATTR_WARN_
/**
* \warning Only call outside of area/region loops.
*/
void WM_window_set_active_scene(Main *bmain, bContext *C, wmWindow *win, Scene *scene_new)
void WM_window_set_active_scene(Main *bmain, bContext *C, wmWindow *win, Scene *scene)
ATTR_NONNULL();
WorkSpace *WM_window_get_active_workspace(const wmWindow *win)
ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
@@ -372,7 +372,7 @@ void WM_window_set_dpi(const wmWindow *win);
*/
void WM_window_title(wmWindowManager *wm, wmWindow *win, const char *title = nullptr);
bool WM_stereo3d_enabled(wmWindow *win, bool only_fullscreen_test);
bool WM_stereo3d_enabled(wmWindow *win, bool skip_stereo3d_check);
/* `wm_files.cc`. */
@@ -1865,7 +1865,7 @@ bool WM_event_consecutive_gesture_test_break(const wmWindow *win, const wmEvent
int WM_event_drag_threshold(const wmEvent *event);
bool WM_event_drag_test(const wmEvent *event, const int prev_xy[2]);
bool WM_event_drag_test_with_delta(const wmEvent *event, const int delta[2]);
bool WM_event_drag_test_with_delta(const wmEvent *event, const int drag_delta[2]);
void WM_event_drag_start_mval(const wmEvent *event, const ARegion *region, int r_mval[2]);
void WM_event_drag_start_mval_fl(const wmEvent *event, const ARegion *region, float r_mval[2]);
void WM_event_drag_start_xy(const wmEvent *event, int r_xy[2]);

View File

@@ -87,7 +87,7 @@ wmKeyMap *WM_keymap_find_all_spaceid_or_empty(wmWindowManager *wm,
int spaceid,
int regionid);
wmKeyMap *WM_keymap_active(const wmWindowManager *wm, wmKeyMap *keymap);
void WM_keymap_remove(wmKeyConfig *keyconfig, wmKeyMap *keymap);
void WM_keymap_remove(wmKeyConfig *keyconf, wmKeyMap *keymap);
bool WM_keymap_poll(bContext *C, wmKeyMap *keymap);
wmKeyMapItem *WM_keymap_item_find_id(wmKeyMap *keymap, int id);

View File

@@ -126,7 +126,7 @@ void WM_gizmo_set_line_width(wmGizmo *gz, float line_width);
void WM_gizmo_get_color(const wmGizmo *gz, float color[4]);
void WM_gizmo_set_color(wmGizmo *gz, const float color[4]);
void WM_gizmo_get_color_highlight(const wmGizmo *gz, float color_hi[4]);
void WM_gizmo_set_color_highlight(wmGizmo *gz, const float color[4]);
void WM_gizmo_set_color_highlight(wmGizmo *gz, const float color_hi[4]);
/**
* Leaving values NULL use values from #wmGizmo.
@@ -407,7 +407,7 @@ void WM_gizmomaptype_group_unlink(bContext *C,
/**
* Unlike #WM_gizmomaptype_group_unlink this doesn't maintain correct state, simply free.
*/
void WM_gizmomaptype_group_free(wmGizmoGroupTypeRef *gzgt);
void WM_gizmomaptype_group_free(wmGizmoGroupTypeRef *gzgt_ref);
/* -------------------------------------------------------------------- */
/* #GizmoGroup. */

View File

@@ -540,19 +540,19 @@ bool WM_event_is_xr(const wmEvent *event)
/** \name Event Tablet Input Access
* \{ */
float wm_pressure_curve(float pressure)
float wm_pressure_curve(float raw_pressure)
{
if (U.pressure_threshold_max != 0.0f) {
pressure /= U.pressure_threshold_max;
raw_pressure /= U.pressure_threshold_max;
}
CLAMP(pressure, 0.0f, 1.0f);
CLAMP(raw_pressure, 0.0f, 1.0f);
if (U.pressure_softness != 0.0f) {
pressure = powf(pressure, powf(4.0f, -U.pressure_softness));
raw_pressure = powf(raw_pressure, powf(4.0f, -U.pressure_softness));
}
return pressure;
return raw_pressure;
}
float WM_event_tablet_data(const wmEvent *event, bool *r_pen_flip, float r_tilt[2])

View File

@@ -165,7 +165,7 @@ enum ModSide {
* \{ */
static void wm_window_set_drawable(wmWindowManager *wm, wmWindow *win, bool activate);
static bool wm_window_timers_process(const bContext *C, int *sleep_us);
static bool wm_window_timers_process(const bContext *C, int *sleep_us_p);
static uint8_t wm_ghost_modifier_query(const enum ModSide side);
bool wm_get_screensize(int *r_width, int *r_height)

View File

@@ -101,7 +101,7 @@ void WM_msgbus_destroy(wmMsgBus *mbus);
void WM_msgbus_clear_by_owner(wmMsgBus *mbus, void *owner);
void WM_msg_dump(wmMsgBus *mbus, const char *info);
void WM_msg_dump(wmMsgBus *mbus, const char *info_str);
void WM_msgbus_handle(wmMsgBus *mbus, bContext *C);
void WM_msg_publish_with_key(wmMsgBus *mbus, wmMsgSubscribeKey *msg_key);

View File

@@ -106,7 +106,7 @@ void wm_window_set_swap_interval(wmWindow *win, int interval);
bool wm_window_get_swap_interval(wmWindow *win, int *r_interval);
bool wm_cursor_position_get(wmWindow *win, int *r_x, int *r_y) ATTR_WARN_UNUSED_RESULT;
void wm_cursor_position_from_ghost_screen_coords(wmWindow *win, int *r_x, int *r_y);
void wm_cursor_position_from_ghost_screen_coords(wmWindow *win, int *x, int *y);
void wm_cursor_position_to_ghost_screen_coords(wmWindow *win, int *x, int *y);
void wm_cursor_position_from_ghost_client_coords(wmWindow *win, int *x, int *y);

View File

@@ -18,7 +18,9 @@ using wmXrSessionExitFn = void (*)(const wmXrData *xr_data);
bool wm_xr_init(wmWindowManager *wm);
void wm_xr_exit(wmWindowManager *wm);
void wm_xr_session_toggle(wmWindowManager *wm, wmWindow *win, wmXrSessionExitFn session_exit_fn);
void wm_xr_session_toggle(wmWindowManager *wm,
wmWindow *session_root_win,
wmXrSessionExitFn session_exit_fn);
bool wm_xr_events_handle(wmWindowManager *wm);
/* `wm_xr_operators.cc` */