]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
treewide: add ul_ to parse_size() function name
authorKarel Zak <kzak@redhat.com>
Tue, 13 May 2025 09:25:39 +0000 (11:25 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 13 May 2025 09:25:39 +0000 (11:25 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/cfdisk.c
disk-utils/fdisk.c
include/strutils.h
lib/strutils.c
libfdisk/src/gpt.c
libfdisk/src/script.c
sys-utils/lscpu-topology.c

index 594dacaacf0b440cb727e475e7055d338fe52877..fdd74fbf949804fc78373936f03993e54586b1bf 100644 (file)
@@ -1955,7 +1955,7 @@ static int ui_get_size(struct cfdisk *cf, /* context */
                                insec = 1;
                                buf[len - 1] = '\0';
                        }
-                       rc = parse_size(buf, (uintmax_t *)&user, &pwr); /* parse */
+                       rc = ul_parse_size(buf, (uintmax_t *)&user, &pwr);      /* parse */
                }
 
                if (rc == 0) {
index 7c459c734a6e1c98ddfd8748e958dd74e30a1334..42a429c1fb4587fd52caeb4e6d5e1b3bf92641a8 100644 (file)
@@ -359,7 +359,7 @@ static int ask_offset(struct fdisk_context *cxt,
                        p++;
                }
 
-               rc = parse_size(p, &num, &pwr);
+               rc = ul_parse_size(p, &num, &pwr);
                if (rc)
                        continue;
                DBG(ASK, ul_debug("parsed size: %ju", num));
index 58cca41c981154b41f4e0c4cfb024af6e2c4e43d..aab45fe4c51c84f55ff26b3a8209d4b9bd7436c3 100644 (file)
@@ -21,7 +21,7 @@
 /* initialize a custom exit code for all *_or_err functions */
 extern void strutils_set_exitcode(int exit_code);
 
-extern int parse_size(const char *str, uintmax_t *res, int *power);
+extern int ul_parse_size(const char *str, uintmax_t *res, int *power);
 extern int strtosize(const char *str, uintmax_t *res);
 extern uintmax_t strtosize_or_err(const char *str, const char *errmesg);
 
index cfa4d262d134209b6a9c5c9a04be4f90d4c6d3e3..a0f0dc2243cd9ea7b31b4f527941a7fff8e64955 100644 (file)
@@ -64,7 +64,7 @@ static int do_scale_by_power (uintmax_t *x, int base, int power)
  * Note that the function does not accept numbers with '-' (negative sign)
  * prefix.
  */
-int parse_size(const char *str, uintmax_t *res, int *power)
+int ul_parse_size(const char *str, uintmax_t *res, int *power)
 {
        const char *p;
        char *end;
@@ -220,7 +220,7 @@ err:
 
 int strtosize(const char *str, uintmax_t *res)
 {
-       return parse_size(str, res, NULL);
+       return ul_parse_size(str, res, NULL);
 }
 
 int isdigit_strend(const char *str, const char **end)
index 2f850fa8a1202e0c5af23c4c53e51a2f3284b952..8a052852a186e31b81f5e47c1380cc577534dd1f 100644 (file)
@@ -735,7 +735,7 @@ static int get_script_u64(struct fdisk_context *cxt, uint64_t *num, const char *
        if (!str)
                return 1;
 
-       rc = parse_size(str, (uintmax_t *) num, &pwr);
+       rc = ul_parse_size(str, (uintmax_t *) num, &pwr);
        if (rc < 0)
                return rc;
        if (pwr)
index 6bb642f0213338dc705ec39b125e15c7b6956033..e782f37c54f909b922a2fc990f6a0eac905bed5e 100644 (file)
@@ -1024,7 +1024,7 @@ static int parse_start_value(struct fdisk_script *dp, struct fdisk_partition *pa
                int pow = 0, sign = skip_optional_sign(&tk);
                uint64_t num;
 
-               rc = parse_size(tk, (uintmax_t *) &num, &pow);
+               rc = ul_parse_size(tk, (uintmax_t *) &num, &pow);
                if (!rc) {
                        if (pow) {      /* specified as <num><suffix> */
                                if (!dp->cxt->sector_size) {
@@ -1080,7 +1080,7 @@ static int parse_size_value(struct fdisk_script *dp, struct fdisk_partition *pa,
                int pow = 0, sign = skip_optional_sign(&tk);
                uint64_t num;
 
-               rc = parse_size(tk, (uintmax_t *) &num, &pow);
+               rc = ul_parse_size(tk, (uintmax_t *) &num, &pow);
                if (!rc) {
                        if (pow) { /* specified as <size><suffix> */
                                if (!dp->cxt->sector_size) {
@@ -1564,7 +1564,7 @@ int fdisk_apply_script_headers(struct fdisk_context *cxt, struct fdisk_script *d
        if (str) {
                uintmax_t sz;
 
-               rc = parse_size(str, &sz, NULL);
+               rc = ul_parse_size(str, &sz, NULL);
                if (rc == 0)
                        rc = fdisk_save_user_grain(cxt, sz);
                if (rc)
@@ -1591,7 +1591,7 @@ int fdisk_apply_script_headers(struct fdisk_context *cxt, struct fdisk_script *d
        if (str) {
                uintmax_t sz;
 
-               rc = parse_size(str, &sz, NULL);
+               rc = ul_parse_size(str, &sz, NULL);
                if (rc == 0)
                        rc = fdisk_gpt_set_npartitions(cxt, sz);
        }
index 36a217bc7712626d13ddac51be7180867fcb17a7..6e0782f640520584e64790d4ffc499f873c3e803 100644 (file)
@@ -509,7 +509,7 @@ static int read_caches(struct lscpu_cxt *cxt, struct lscpu_cpu *cpu)
                        /* cache size */
                        if (ul_path_readf_buffer(sys, buf, sizeof(buf),
                                        "cpu%d/cache/index%zu/size", num, i) > 0)
-                               parse_size(buf, &ca->size, NULL);
+                               ul_parse_size(buf, &ca->size, NULL);
                        else
                                ca->size = 0;
                }