summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-03-24 11:20:42 -0400
committerDave Reisner <dreisner@archlinux.org>2013-04-01 19:52:05 -0400
commitf52244706bd2716406889c0b380011aef40cdb06 (patch)
tree182164ec946907608a7e47617dffaa69977f8b6e
parentbd8e738d361e49d86e50d774f85b385995dce0b8 (diff)
downloadexpac-f52244706bd2716406889c0b380011aef40cdb06.tar.xz
whitespace fixes
-rw-r--r--expac.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/expac.c b/expac.c
index 7d958f1..87cd105 100644
--- a/expac.c
+++ b/expac.c
@@ -71,46 +71,46 @@ typedef const char *(*extractfn)(void*);
static const char *alpm_backup_get_name(void *b)
{
- alpm_backup_t *bkup = b;
- return bkup->name;
+ alpm_backup_t *bkup = b;
+ return bkup->name;
}
static double humanize_size(off_t bytes, const char target_unit, const char **label)
{
- static const char *labels[] = {"B", "KiB", "MiB", "GiB",
- "TiB", "PiB", "EiB", "ZiB", "YiB"};
- static const int unitcount = sizeof(labels) / sizeof(labels[0]);
-
- double val = (double)bytes;
- int index;
-
- for(index = 0; index < unitcount - 1; index++) {
- if(target_unit != '\0' && labels[index][0] == target_unit) {
- break;
- } else if(target_unit == '\0' && val <= 2048.0 && val >= -2048.0) {
- break;
- }
- val /= 1024.0;
- }
-
- if(label) {
- *label = labels[index];
- }
-
- return val;
+ static const char *labels[] = {"B", "KiB", "MiB", "GiB",
+ "TiB", "PiB", "EiB", "ZiB", "YiB"};
+ static const int unitcount = sizeof(labels) / sizeof(labels[0]);
+
+ double val = (double)bytes;
+ int index;
+
+ for(index = 0; index < unitcount - 1; index++) {
+ if(target_unit != '\0' && labels[index][0] == target_unit) {
+ break;
+ } else if(target_unit == '\0' && val <= 2048.0 && val >= -2048.0) {
+ break;
+ }
+ val /= 1024.0;
+ }
+
+ if(label) {
+ *label = labels[index];
+ }
+
+ return val;
}
static char *size_to_string(off_t pkgsize)
{
- static char out[64];
+ static char out[64];
- if(humansize == 'B') {
- snprintf(out, sizeof(out), "%jd", (intmax_t)pkgsize);
- } else {
- snprintf(out, sizeof(out), "%.2f %ciB", humanize_size(pkgsize, humansize, NULL), humansize);
- }
+ if(humansize == 'B') {
+ snprintf(out, sizeof(out), "%jd", (intmax_t)pkgsize);
+ } else {
+ snprintf(out, sizeof(out), "%.2f %ciB", humanize_size(pkgsize, humansize, NULL), humansize);
+ }
- return out;
+ return out;
}
static char *strtrim(char *str) {