Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-03-30 09:26:42 +0300
committerCampbell Barton <campbell@blender.org>2022-03-30 10:01:22 +0300
commita8ec7845e0bdb9e63e9d3dbd7f4cd7caad36b5a2 (patch)
tree4531232281ddc4cda4df3fb1ccc0822018fe5682 /source/blender/blenlib/intern/path_util.c
parentaf3aaf80344e745e6c207102941513cb631194c3 (diff)
Cleanup: use "num" as a suffix in: source/blender/blenlib
Also replace "num" with: - "number" when it's not used to denote the number of items. - "digits" when digits in a string are being manipulated.
Diffstat (limited to 'source/blender/blenlib/intern/path_util.c')
-rw-r--r--source/blender/blenlib/intern/path_util.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 6c576627fa0..5a96221c8d1 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -53,7 +53,7 @@ static bool BLI_path_is_abs(const char *name);
/* implementation */
-int BLI_path_sequence_decode(const char *string, char *head, char *tail, ushort *r_num_len)
+int BLI_path_sequence_decode(const char *string, char *head, char *tail, ushort *r_digits_len)
{
uint nums = 0, nume = 0;
int i;
@@ -98,8 +98,8 @@ int BLI_path_sequence_decode(const char *string, char *head, char *tail, ushort
strcpy(head, string);
head[nums] = 0;
}
- if (r_num_len) {
- *r_num_len = nume - nums + 1;
+ if (r_digits_len) {
+ *r_digits_len = nume - nums + 1;
}
return (int)ret;
}
@@ -114,8 +114,8 @@ int BLI_path_sequence_decode(const char *string, char *head, char *tail, ushort
*/
BLI_strncpy(head, string, name_end + 1);
}
- if (r_num_len) {
- *r_num_len = 0;
+ if (r_digits_len) {
+ *r_digits_len = 0;
}
return 0;
}
@@ -750,14 +750,14 @@ bool BLI_path_frame_range(char *path, int sta, int end, int digits)
return false;
}
-bool BLI_path_frame_get(char *path, int *r_frame, int *r_numdigits)
+bool BLI_path_frame_get(char *path, int *r_frame, int *r_digits_len)
{
if (*path) {
char *file = (char *)BLI_path_slash_rfind(path);
char *c;
- int len, numdigits;
+ int len, digits_len;
- numdigits = *r_numdigits = 0;
+ digits_len = *r_digits_len = 0;
if (file == NULL) {
file = path;
@@ -779,21 +779,21 @@ bool BLI_path_frame_get(char *path, int *r_frame, int *r_numdigits)
/* find start of number */
while (c != (file - 1) && isdigit(*c)) {
c--;
- numdigits++;
+ digits_len++;
}
- if (numdigits) {
+ if (digits_len) {
char prevchar;
c++;
- prevchar = c[numdigits];
- c[numdigits] = 0;
+ prevchar = c[digits_len];
+ c[digits_len] = 0;
/* was the number really an extension? */
*r_frame = atoi(c);
- c[numdigits] = prevchar;
+ c[digits_len] = prevchar;
- *r_numdigits = numdigits;
+ *r_digits_len = digits_len;
return true;
}
@@ -812,7 +812,7 @@ void BLI_path_frame_strip(char *path, char *r_ext)
char *file = (char *)BLI_path_slash_rfind(path);
char *c, *suffix;
int len;
- int numdigits = 0;
+ int digits_len = 0;
if (file == NULL) {
file = path;
@@ -836,7 +836,7 @@ void BLI_path_frame_strip(char *path, char *r_ext)
/* find start of number */
while (c != (file - 1) && isdigit(*c)) {
c--;
- numdigits++;
+ digits_len++;
}
c++;
@@ -845,7 +845,7 @@ void BLI_path_frame_strip(char *path, char *r_ext)
BLI_strncpy(r_ext, suffix, suffix_length + 1);
/* replace the number with the suffix and terminate the string */
- while (numdigits--) {
+ while (digits_len--) {
*c++ = '#';
}
*c = '\0';