… | |
… | |
2352 | } |
2352 | } |
2353 | } |
2353 | } |
2354 | |
2354 | |
2355 | // read the next character |
2355 | // read the next character |
2356 | wchar_t ecb_hot |
2356 | wchar_t ecb_hot |
2357 | rxvt_term::next_char () NOTHROW |
2357 | rxvt_term::next_char () noexcept |
2358 | { |
2358 | { |
2359 | while (cmdbuf_ptr < cmdbuf_endp) |
2359 | while (cmdbuf_ptr < cmdbuf_endp) |
2360 | { |
2360 | { |
2361 | // assume 7-bit to be ascii ALWAYS (always true in POSIX) |
2361 | // assume 7-bit to be ascii ALWAYS (always true in POSIX) |
2362 | if (ecb_likely ((unsigned char)*cmdbuf_ptr <= 0x7f)) |
2362 | if (ecb_likely ((unsigned char)*cmdbuf_ptr <= 0x7f)) |
… | |
… | |
2388 | return NOCHAR; |
2388 | return NOCHAR; |
2389 | } |
2389 | } |
2390 | |
2390 | |
2391 | // read the next octet |
2391 | // read the next octet |
2392 | uint32_t ecb_hot |
2392 | uint32_t ecb_hot |
2393 | rxvt_term::next_octet () NOTHROW |
2393 | rxvt_term::next_octet () noexcept |
2394 | { |
2394 | { |
2395 | return cmdbuf_ptr < cmdbuf_endp |
2395 | return cmdbuf_ptr < cmdbuf_endp |
2396 | ? (unsigned char)*cmdbuf_ptr++ |
2396 | ? (unsigned char)*cmdbuf_ptr++ |
2397 | : NOCHAR; |
2397 | : NOCHAR; |
2398 | } |
2398 | } |
2399 | |
2399 | |
2400 | static class out_of_input out_of_input; |
2400 | static class out_of_input out_of_input; |
2401 | |
2401 | |
2402 | wchar_t ecb_hot |
2402 | wchar_t ecb_hot |
2403 | rxvt_term::cmd_getc () THROW ((class out_of_input)) |
2403 | rxvt_term::cmd_getc () |
2404 | { |
2404 | { |
2405 | wchar_t c = next_char (); |
2405 | wchar_t c = next_char (); |
2406 | |
2406 | |
2407 | if (c == NOCHAR) |
2407 | if (c == NOCHAR) |
2408 | throw out_of_input; |
2408 | throw out_of_input; |
2409 | |
2409 | |
2410 | return c; |
2410 | return c; |
2411 | } |
2411 | } |
2412 | |
2412 | |
2413 | uint32_t ecb_hot |
2413 | uint32_t ecb_hot |
2414 | rxvt_term::cmd_get8 () THROW ((class out_of_input)) |
2414 | rxvt_term::cmd_get8 () |
2415 | { |
2415 | { |
2416 | uint32_t c = next_octet (); |
2416 | uint32_t c = next_octet (); |
2417 | |
2417 | |
2418 | if (c == NOCHAR) |
2418 | if (c == NOCHAR) |
2419 | throw out_of_input; |
2419 | throw out_of_input; |