Krolyxon
Commit f7145db

Branches

Refs →

nsxivf7145db

remove unused function and typedef (#199)

byteorder_t and size_readable is not used anywhere within the code.

byteorder_t seems to be a remain from some time sxiv handled exif data itself instead of relying on a library, introduced in 691c6d7, and probably became irrelevant when libexif was added as dependency again. And size_readable from some time it displayed the file size in the window title, introduced in bad9a70.
Author
N-R-K
Date
2022-01-03 02:13 +0600
Committer
GitHub · 2022-01-02 23:13 +0300
Parent
0f3766e
Commit
f7145db7f8a5d136a522e0045e5ff39b2279e04c

+0 −16

2 files changed

  1. M nsxiv.h +0 −6
  2. M util.c +0 −10
M nsxiv.h View
@@ -55,11 +55,6 @@
5555 (tv)->tv_usec += (t) % 1000 * 1000; \
5656 }
5757
58−typedef enum {
59− BO_BIG_ENDIAN,
60− BO_LITTLE_ENDIAN
61−} byteorder_t;
62−
6358 typedef enum {
6459 MODE_ALL,
6560 MODE_IMAGE,
@@ -352,7 +347,6 @@ void* emalloc(size_t);
352347 void* erealloc(void*, size_t);
353348 char* estrdup(const char*);
354349 void error(int, int, const char*, ...);
355−void size_readable(float*, const char**);
356350 int r_opendir(r_dir_t*, const char*, bool);
357351 int r_closedir(r_dir_t*);
358352 char* r_readdir(r_dir_t*, bool);
M util.c View
@@ -79,16 +79,6 @@ void error(int eval, int err, const char* fmt, ...)
7979 exit(eval);
8080 }
8181
82−void size_readable(float *size, const char **unit)
83−{
84− const char *units[] = { "", "K", "M", "G" };
85− unsigned int i;
86−
87− for (i = 0; i < ARRLEN(units) && *size > 1024.0; i++)
88− *size /= 1024.0;
89− *unit = units[MIN(i, ARRLEN(units) - 1)];
90−}
91−
9282 int r_opendir(r_dir_t *rdir, const char *dirname, bool recursive)
9383 {
9484 if (*dirname == '\0')