Cleanup: comment unused functions

This commit is contained in:
Campbell Barton 2021-09-06 15:51:53 +10:00
parent 58632a7f3c
commit 3e44592cb9
4 changed files with 26 additions and 2 deletions

View File

@ -62,9 +62,11 @@ bool BLI_str_quoted_substr_range(const char *__restrict str,
int *__restrict r_start,
int *__restrict r_end) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 2, 3, 4);
#if 0 /* UNUSED */
char *BLI_str_quoted_substrN(const char *__restrict str,
const char *__restrict prefix) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL() ATTR_MALLOC;
#endif
bool BLI_str_quoted_substr(const char *__restrict str,
const char *__restrict prefix,
char *result,

View File

@ -509,8 +509,12 @@ bool BLI_str_quoted_substr_range(const char *__restrict str,
return true;
}
/* NOTE(@campbellbarton): in principal it should be possible to access a quoted string
* with an arbitrary size, currently all callers for this functionality
* happened to use a fixed size buffer, so only #BLI_str_quoted_substr is needed. */
#if 0
/**
* Makes a copy of the text within the "" that appear after some text `blahblah`.
* Makes a copy of the text within the "" that appear after the contents of \a prefix.
* i.e. for string `pose["apples"]` with prefix `pose[`, it will return `apples`.
*
* \param str: is the entire string to chop.
@ -533,7 +537,21 @@ char *BLI_str_quoted_substrN(const char *__restrict str, const char *__restrict
}
return result;
}
#endif
/**
* Fills \a result with text within "" that appear after some the contents of \a prefix.
* i.e. for string `pose["apples"]` with prefix `pose[`, it will return `apples`.
*
* \param str: is the entire string to chop.
* \param prefix: is the part of the string to step over.
* \param result: The buffer to fill.
* \param result_maxlen: The maximum size of the buffer (including nil terminator).
* \return True if the prefix was found and the entire quoted string was copied into result.
*
* Assume that the strings returned must be freed afterwards,
* and that the inputs will contain data we want.
*/
bool BLI_str_quoted_substr(const char *__restrict str,
const char *__restrict prefix,
char *result,

View File

@ -1118,7 +1118,9 @@ bool RNA_property_assign_default(PointerRNA *ptr, PropertyRNA *prop);
char *RNA_path_append(
const char *path, PointerRNA *ptr, PropertyRNA *prop, int intkey, const char *strkey);
#if 0 /* UNUSED. */
char *RNA_path_back(const char *path);
#endif
/* path_resolve() variants only ensure that a valid pointer (and optionally property) exist */
bool RNA_path_resolve(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop);

View File

@ -5521,7 +5521,9 @@ char *RNA_path_append(
return result;
}
char *RNA_path_back(const char *path)
/* Having both path append & back seems like it could be useful,
* this function isn't used at the moment. */
static char *UNUSED_FUNCTION(RNA_path_back)(const char *path)
{
char fixedbuf[256];
const char *previous, *current;