summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2017-08-21 23:46:28 +0200
committerBoris Faure <billiob@gmail.com>2017-08-21 23:46:28 +0200
commit6315ed294985d87722cb58d4f76822472653a8cf (patch)
treef3f607db6369c866c0e50fc1b36a6f160a05c118
parent2343efd6a13606ad05a61f30adcbb284b3c464f5 (diff)
termpty: remove termstate.had_cr since it's unused
-rw-r--r--src/bin/termpty.c1
-rw-r--r--src/bin/termpty.h1
-rw-r--r--src/bin/termptyesc.c25
-rw-r--r--src/bin/termptyops.c1
4 files changed, 1 insertions, 27 deletions
diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index 66bee83..7a355c0 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -1332,7 +1332,6 @@ termpty_resize(Termpty *ty, int new_w, int new_h)
1332 1332
1333 ty->w = new_w; 1333 ty->w = new_w;
1334 ty->h = new_h; 1334 ty->h = new_h;
1335 ty->termstate.had_cr = 0;
1336 ty->termstate.wrapnext = 0; 1335 ty->termstate.wrapnext = 0;
1337 1336
1338 if (altbuf) 1337 if (altbuf)
diff --git a/src/bin/termpty.h b/src/bin/termpty.h
index 30742c0..64ad99a 100644
--- a/src/bin/termpty.h
+++ b/src/bin/termpty.h
@@ -146,7 +146,6 @@ struct _Termpty
146 unsigned int wrap : 1; 146 unsigned int wrap : 1;
147 unsigned int wrapnext : 1; 147 unsigned int wrapnext : 1;
148 unsigned int crlf : 1; 148 unsigned int crlf : 1;
149 unsigned int had_cr : 1;
150 unsigned int send_bs : 1; 149 unsigned int send_bs : 1;
151 unsigned int kbd_lock : 1; 150 unsigned int kbd_lock : 1;
152 unsigned int reverse : 1; 151 unsigned int reverse : 1;
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index a62e823..d2ca4fd 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -156,12 +156,10 @@ _handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
156 switch (*cc) 156 switch (*cc)
157 { 157 {
158 case 0x07: // BEL '\a' (bell) 158 case 0x07: // BEL '\a' (bell)
159 ty->termstate.had_cr = 0;
160 if (ty->cb.bell.func) ty->cb.bell.func(ty->cb.bell.data); 159 if (ty->cb.bell.func) ty->cb.bell.func(ty->cb.bell.data);
161 return; 160 return;
162 case 0x08: // BS '\b' (backspace) 161 case 0x08: // BS '\b' (backspace)
163 DBG("->BS"); 162 DBG("->BS");
164 ty->termstate.had_cr = 0;
165 ty->termstate.wrapnext = 0; 163 ty->termstate.wrapnext = 0;
166 ty->cursor_state.cx--; 164 ty->cursor_state.cx--;
167 TERMPTY_RESTRICT_FIELD(ty->cursor_state.cx, 0, ty->w); 165 TERMPTY_RESTRICT_FIELD(ty->cursor_state.cx, 0, ty->w);
@@ -169,18 +167,11 @@ _handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
169 case 0x09: // HT '\t' (horizontal tab) 167 case 0x09: // HT '\t' (horizontal tab)
170 DBG("->HT"); 168 DBG("->HT");
171 _tab_forward(ty, 1); 169 _tab_forward(ty, 1);
172 ty->termstate.had_cr = 0;
173 return; 170 return;
174 case 0x0a: // LF '\n' (new line) 171 case 0x0a: // LF '\n' (new line)
175 case 0x0b: // VT '\v' (vertical tab) 172 case 0x0b: // VT '\v' (vertical tab)
176 case 0x0c: // FF '\f' (form feed) 173 case 0x0c: // FF '\f' (form feed)
177 DBG("->LF"); 174 DBG("->LF");
178 if (ty->termstate.had_cr)
179 {
180 TERMPTY_SCREEN(ty, ty->termstate.had_cr_x,
181 ty->termstate.had_cr_y).att.newline = 1;
182 }
183 ty->termstate.had_cr = 0;
184 ty->termstate.wrapnext = 0; 175 ty->termstate.wrapnext = 0;
185 if (ty->termstate.crlf) ty->cursor_state.cx = 0; 176 if (ty->termstate.crlf) ty->cursor_state.cx = 0;
186 ty->cursor_state.cy++; 177 ty->cursor_state.cy++;
@@ -195,7 +186,6 @@ _handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
195 ty->termstate.wrapnext = 0; 186 ty->termstate.wrapnext = 0;
196 } 187 }
197 ty->cursor_state.cx = 0; 188 ty->cursor_state.cx = 0;
198// ty->termstate.had_cr = 1;
199 return; 189 return;
200 default: 190 default:
201 return; 191 return;
@@ -2083,7 +2073,6 @@ termpty_handle_seq(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
2083/* 2073/*
2084 case 0x05: // ENQ (enquiry) 2074 case 0x05: // ENQ (enquiry)
2085 _term_txt_write(ty, "ABC\r\n"); 2075 _term_txt_write(ty, "ABC\r\n");
2086 ty->termstate.had_cr = 0;
2087 return 1; 2076 return 1;
2088 */ 2077 */
2089/* 2078/*
@@ -2101,13 +2090,11 @@ termpty_handle_seq(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
2101 return 1; 2090 return 1;
2102 2091
2103 case 0x0e: // SO (shift out) // Maps G1 character set into GL. 2092 case 0x0e: // SO (shift out) // Maps G1 character set into GL.
2104 ty->termstate.had_cr = 0;
2105 ty->termstate.charset = 1; 2093 ty->termstate.charset = 1;
2106 ty->termstate.charsetch = ty->termstate.chset[1]; 2094 ty->termstate.charsetch = ty->termstate.chset[1];
2107 return 1; 2095 return 1;
2108 case 0x0f: // SI (shift in) // Maps G0 character set into GL. 2096 case 0x0f: // SI (shift in) // Maps G0 character set into GL.
2109 ty->termstate.charset = 0; 2097 ty->termstate.charset = 0;
2110 ty->termstate.had_cr = 0;
2111 ty->termstate.charsetch = ty->termstate.chset[0]; 2098 ty->termstate.charsetch = ty->termstate.chset[0];
2112 return 1; 2099 return 1;
2113/* 2100/*
@@ -2135,7 +2122,6 @@ termpty_handle_seq(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
2135 return 1; 2122 return 1;
2136 */ 2123 */
2137 case 0x1b: // ESC (escape) 2124 case 0x1b: // ESC (escape)
2138 ty->termstate.had_cr = 0;
2139 len = _handle_esc(ty, c + 1, ce); 2125 len = _handle_esc(ty, c + 1, ce);
2140 if (len == 0) return 0; 2126 if (len == 0) return 0;
2141 return 1 + len; 2127 return 1 + len;
@@ -2150,20 +2136,17 @@ termpty_handle_seq(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
2150 return 1; 2136 return 1;
2151 */ 2137 */
2152 default: 2138 default:
2153 ty->termstate.had_cr = 0;
2154 //ERR("unhandled char 0x%02x", c[0]); 2139 //ERR("unhandled char 0x%02x", c[0]);
2155 return 1; 2140 return 1;
2156 } 2141 }
2157 } 2142 }
2158 else if (c[0] == 0x7f) // DEL 2143 else if (c[0] == 0x7f) // DEL
2159 { 2144 {
2160 ty->termstate.had_cr = 0;
2161 WRN("Unhandled char 0x%02x [DEL]", (unsigned int) c[0]); 2145 WRN("Unhandled char 0x%02x [DEL]", (unsigned int) c[0]);
2162 return 1; 2146 return 1;
2163 } 2147 }
2164 else if (c[0] == 0x9b) // ANSI ESC!!! 2148 else if (c[0] == 0x9b) // ANSI ESC!!!
2165 { 2149 {
2166 ty->termstate.had_cr = 0;
2167 DBG("ANSI CSI!!!!!"); 2150 DBG("ANSI CSI!!!!!");
2168 len = _handle_esc_csi(ty, c + 1, ce); 2151 len = _handle_esc_csi(ty, c + 1, ce);
2169 if (len == 0) return 0; 2152 if (len == 0) return 0;
@@ -2173,8 +2156,7 @@ termpty_handle_seq(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
2173 { 2156 {
2174 Termexp *ex; 2157 Termexp *ex;
2175 Eina_List *l; 2158 Eina_List *l;
2176 2159
2177 ty->termstate.had_cr = 0;
2178 EINA_LIST_FOREACH(ty->block.expecting, l, ex) 2160 EINA_LIST_FOREACH(ty->block.expecting, l, ex)
2179 { 2161 {
2180 if (c[0] == ex->ch) 2162 if (c[0] == ex->ch)
@@ -2206,10 +2188,6 @@ termpty_handle_seq(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
2206 termpty_text_append(ty, c, 1); 2188 termpty_text_append(ty, c, 1);
2207 return 1; 2189 return 1;
2208 } 2190 }
2209 else
2210 {
2211 ty->termstate.had_cr = 0;
2212 }
2213 cc = (Eina_Unicode *)c; 2191 cc = (Eina_Unicode *)c;
2214 DBG("txt: ["); 2192 DBG("txt: [");
2215 while ((cc < ce) && (*cc >= 0x20) && (*cc != 0x7f)) 2193 while ((cc < ce) && (*cc >= 0x20) && (*cc != 0x7f))
@@ -2220,6 +2198,5 @@ termpty_handle_seq(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
2220 } 2198 }
2221 DBG("]"); 2199 DBG("]");
2222 termpty_text_append(ty, c, len); 2200 termpty_text_append(ty, c, len);
2223 ty->termstate.had_cr = 0;
2224 return len; 2201 return len;
2225} 2202}
diff --git a/src/bin/termptyops.c b/src/bin/termptyops.c
index 4a00588..f4fb345 100644
--- a/src/bin/termptyops.c
+++ b/src/bin/termptyops.c
@@ -439,7 +439,6 @@ termpty_reset_state(Termpty *ty)
439 ty->termstate.wrap = 1; 439 ty->termstate.wrap = 1;
440 ty->termstate.wrapnext = 0; 440 ty->termstate.wrapnext = 0;
441 ty->termstate.crlf = 0; 441 ty->termstate.crlf = 0;
442 ty->termstate.had_cr = 0;
443 ty->termstate.send_bs = 0; 442 ty->termstate.send_bs = 0;
444 ty->termstate.reverse = 0; 443 ty->termstate.reverse = 0;
445 ty->termstate.no_autorepeat = 0; 444 ty->termstate.no_autorepeat = 0;