billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=4b4deb3ad3e39777aa71258d24da27e41e5442c9

commit 4b4deb3ad3e39777aa71258d24da27e41e5442c9
Author: broggi_t <brogg...@epitech.eu>
Date:   Sat Feb 7 00:58:55 2015 +0100

    tyls : make the code prettier and more flexible
---
 src/bin/tyls.c | 7 +++++--
 1 file 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)
 #define WHITE   7
 #define BRIGHT  8
 
+#define COUNT_OF(arr) (sizeof(arr) / sizeof(*arr))
+
 // #3399ff
 // 51 153 355
 // as 6x6x6
@@ -790,13 +792,14 @@ main(int argc, char **argv)
           {
              char *path;
              char *cmp[] = {"-c", "-m", "-l"};
+             int modes[] = {SMALL, MEDIUM, LARGE};
              int j;
 
-             for (j = 0; j < 3; j++)
+             for (j = 0; j < COUNT_OF(cmp) ; j++)
                {
                  if (!strcmp(argv[i], cmp[j]))
                    {
-                     mode = j;
+                     mode = modes[j];
                      if (++i >= argc) break;
                    }
                }

-- 


Reply via email to