summaryrefslogtreecommitdiff
path: root/src/bin/tyls.c
diff options
context:
space:
mode:
authorbroggi_t <broggi_t@epitech.eu>2015-02-07 00:58:55 +0100
committerBoris Faure <billiob@gmail.com>2015-02-07 12:02:19 +0100
commit4b4deb3ad3e39777aa71258d24da27e41e5442c9 (patch)
treea3890e8303fd61cc2a8c71cecf9c56b81e5e7297 /src/bin/tyls.c
parent2a397f35cdc2e781ce4fe26cc1b6476fbfb8a8d9 (diff)
tyls : make the code prettier and more flexible
Diffstat (limited to 'src/bin/tyls.c')
-rw-r--r--src/bin/tyls.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bin/tyls.c b/src/bin/tyls.c
index 12975ce..963827a 100644
--- a/src/bin/tyls.c
+++ b/src/bin/tyls.c
@@ -101,6 +101,8 @@ size_print(char *buf, int bufsz, char *sz, unsigned long long size)
101#define WHITE 7 101#define WHITE 7
102#define BRIGHT 8 102#define BRIGHT 8
103 103
104#define COUNT_OF(arr) (sizeof(arr) / sizeof(*arr))
105
104// #3399ff 106// #3399ff
105// 51 153 355 107// 51 153 355
106// as 6x6x6 108// as 6x6x6
@@ -790,13 +792,14 @@ main(int argc, char **argv)
790 { 792 {
791 char *path; 793 char *path;
792 char *cmp[] = {"-c", "-m", "-l"}; 794 char *cmp[] = {"-c", "-m", "-l"};
795 int modes[] = {SMALL, MEDIUM, LARGE};
793 int j; 796 int j;
794 797
795 for (j = 0; j < 3; j++) 798 for (j = 0; j < COUNT_OF(cmp) ; j++)
796 { 799 {
797 if (!strcmp(argv[i], cmp[j])) 800 if (!strcmp(argv[i], cmp[j]))
798 { 801 {
799 mode = j; 802 mode = modes[j];
800 if (++i >= argc) break; 803 if (++i >= argc) break;
801 } 804 }
802 } 805 }