summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@profusion.mobi>2012-08-23 05:50:20 +0000
committerLeandro Pereira <leandro@profusion.mobi>2012-08-23 05:50:20 +0000
commitddae600684bb21c3e5b71a1cdfd7a7affb4ae3d1 (patch)
tree4f325399ba1395e1073387e67e54488d9d2bfd50 /src
parentcf3a453baf4570b9f4892ce784466473ffcf65a9 (diff)
terminology: Use a lookup table for g[0-8] commands
SVN revision: 75589
Diffstat (limited to 'src')
-rw-r--r--src/bin/termcmd.c45
1 files changed, 8 insertions, 37 deletions
diff --git a/src/bin/termcmd.c b/src/bin/termcmd.c
index 45850d2..fbdeef5 100644
--- a/src/bin/termcmd.c
+++ b/src/bin/termcmd.c
@@ -76,44 +76,15 @@ _termcmd_grid_size(Evas_Object *obj, Evas_Object *win __UNUSED__, Evas_Object *b
76 76
77 if (r == 1) 77 if (r == 1)
78 { 78 {
79 switch (w) 79 static const int size_table[][2] = {
80 { 80, 24 }, { 80, 40 }, { 80, 60 }, { 80, 80 }, { 120, 24 },
81 { 120, 40 }, { 120, 60 }, { 120, 80 }, { 120, 120 }
82 };
83
84 if (w >= 0 && w <= 8)
80 { 85 {
81 case 0: 86 h = size_table[w][1];
82 w = 80; 87 w = size_table[w][0];
83 h = 24;
84 break;
85 case 1:
86 w = 80;
87 h = 40;
88 break;
89 case 2:
90 w = 80;
91 h = 60;
92 break;
93 case 3:
94 w = 80;
95 h = 80;
96 break;
97 case 4:
98 w = 120;
99 h = 24;
100 break;
101 case 5:
102 w = 120;
103 h = 40;
104 break;
105 case 6:
106 w = 120;
107 h = 60;
108 break;
109 case 7:
110 w = 120;
111 h = 80;
112 break;
113 case 8:
114 w = 120;
115 h = 120;
116 break;
117 } 88 }
118 } 89 }
119 if ((w > 0) && (h > 0)) 90 if ((w > 0) && (h > 0))