Cleanup: use of the term 'len' & 'maxlen'

Only use the term len & maxlen when they represent the length & maximum
length of a string. Instead of the available bytes to use.

Also include the data they're referencing as a suffix, otherwise it's
not always clear what the length is in reference to.
This commit is contained in:
2023-05-07 15:22:58 +10:00
parent 5abb3c96cf
commit df54b627b3
49 changed files with 465 additions and 389 deletions

View File

@@ -62,7 +62,10 @@ wmKeyMapItem *WM_keymap_add_item(struct wmKeyMap *keymap,
wmKeyMapItem *WM_keymap_add_item_copy(struct wmKeyMap *keymap, wmKeyMapItem *kmi_src);
bool WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi);
int WM_keymap_item_to_string(const wmKeyMapItem *kmi, bool compact, char *result, int result_len);
int WM_keymap_item_to_string(const wmKeyMapItem *kmi,
bool compact,
char *result,
int result_maxncpy);
wmKeyMap *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int regionid);
wmKeyMap *WM_keymap_list_find_spaceid_or_empty(ListBase *lb,
@@ -133,13 +136,13 @@ void WM_keymap_fix_linking(void);
/* Modal Keymap */
int WM_modalkeymap_items_to_string(
const struct wmKeyMap *km, int propvalue, bool compact, char *result, int result_len);
const struct wmKeyMap *km, int propvalue, bool compact, char *result, int result_maxncpy);
int WM_modalkeymap_operator_items_to_string(
struct wmOperatorType *ot, int propvalue, bool compact, char *result, int result_len);
struct wmOperatorType *ot, int propvalue, bool compact, char *result, int result_maxncpy);
char *WM_modalkeymap_operator_items_to_string_buf(struct wmOperatorType *ot,
int propvalue,
bool compact,
int max_len,
int result_maxncpy,
int *r_available_len,
char **r_result);
@@ -180,7 +183,7 @@ int WM_keymap_item_raw_to_string(short shift,
short type,
bool compact,
char *result,
int result_len);
int result_maxncpy);
/**
* \param include_mask, exclude_mask:
* Event types to include/exclude when looking up keys (#eEventType_Mask).
@@ -198,7 +201,7 @@ char *WM_key_event_operator_string(const struct bContext *C,
struct IDProperty *properties,
bool is_strict,
char *result,
int result_len);
int result_maxncpy);
wmKeyMapItem *WM_key_event_operator_from_keymap(struct wmKeyMap *keymap,
const char *opname,