time for another make style-all

This commit is contained in:
Kurtis Rader 2017-02-07 21:52:35 -08:00
parent 616d301083
commit 0970cc8736
11 changed files with 71 additions and 88 deletions

View file

@ -113,7 +113,7 @@ function __fish_config_interactive -d "Initializations that should be performed
# Generating completions from man pages needs python (see issue #3588). # Generating completions from man pages needs python (see issue #3588).
# Don't do this if we're being invoked as part of running unit tests. # Don't do this if we're being invoked as part of running unit tests.
if command -qs python if command -qs python
and not set -q FISH_UNIT_TESTS_RUNNING and not set -q FISH_UNIT_TESTS_RUNNING
# We cannot simply do `fish_update_completions &` because it is a function. Hence the # We cannot simply do `fish_update_completions &` because it is a function. Hence the
# need for the convoluted `eval` to run it in a subshell. # need for the convoluted `eval` to run it in a subshell.
eval (string escape "$__fish_bin_dir/fish") "-c 'fish_update_completions >/dev/null ^/dev/null' &" eval (string escape "$__fish_bin_dir/fish") "-c 'fish_update_completions >/dev/null ^/dev/null' &"

View file

@ -48,9 +48,7 @@ file_access_attempt_t access_file(const wcstring &path, int mode) {
autoload_t::autoload_t(const wcstring &env_var_name_var, autoload_t::autoload_t(const wcstring &env_var_name_var,
command_removed_function_t cmd_removed_callback) command_removed_function_t cmd_removed_callback)
: lock(), : lock(), env_var_name(env_var_name_var), command_removed(cmd_removed_callback) {
env_var_name(env_var_name_var),
command_removed(cmd_removed_callback) {
pthread_mutex_init(&lock, NULL); pthread_mutex_init(&lock, NULL);
} }

View file

@ -73,8 +73,7 @@ class autoload_t : public lru_cache_t<autoload_t, autoload_function_t> {
void entry_was_evicted(wcstring key, autoload_function_t node); void entry_was_evicted(wcstring key, autoload_function_t node);
// Create an autoload_t for the given environment variable name. // Create an autoload_t for the given environment variable name.
autoload_t(const wcstring &env_var_name_var, autoload_t(const wcstring &env_var_name_var, command_removed_function_t callback);
command_removed_function_t callback);
~autoload_t(); ~autoload_t();

View file

@ -545,7 +545,7 @@ class scoped_lock {
// No copying. // No copying.
scoped_lock &operator=(const scoped_lock &) = delete; scoped_lock &operator=(const scoped_lock &) = delete;
scoped_lock(const scoped_lock &) = delete; scoped_lock(const scoped_lock &) = delete;
public: public:
scoped_lock(scoped_lock &&rhs) : lock_obj(rhs.lock_obj), locked(rhs.locked) { scoped_lock(scoped_lock &&rhs) : lock_obj(rhs.lock_obj), locked(rhs.locked) {
@ -569,7 +569,7 @@ class rwlock_t {
~rwlock_t() { VOMIT_ON_FAILURE_NO_ERRNO(pthread_rwlock_destroy(&rwlock)); } ~rwlock_t() { VOMIT_ON_FAILURE_NO_ERRNO(pthread_rwlock_destroy(&rwlock)); }
rwlock_t &operator=(const rwlock_t &) = delete; rwlock_t &operator=(const rwlock_t &) = delete;
rwlock_t(const rwlock_t &) = delete; rwlock_t(const rwlock_t &) = delete;
}; };
// Scoped lock class for rwlocks. // Scoped lock class for rwlocks.
@ -604,16 +604,15 @@ class scoped_rwlock {
// Or for simple cases: // Or for simple cases:
// name.acquire().value = "derp" // name.acquire().value = "derp"
// //
template<typename DATA> template <typename DATA>
class acquired_lock { class acquired_lock {
scoped_lock lock; scoped_lock lock;
acquired_lock(mutex_lock_t &lk, DATA *v) : lock(lk), value(*v) acquired_lock(mutex_lock_t &lk, DATA *v) : lock(lk), value(*v) {}
{}
template<typename T> template <typename T>
friend class owning_lock; friend class owning_lock;
public: public:
// No copying, move only // No copying, move only
acquired_lock &operator=(const acquired_lock &) = delete; acquired_lock &operator=(const acquired_lock &) = delete;
acquired_lock(const acquired_lock &) = delete; acquired_lock(const acquired_lock &) = delete;
@ -625,7 +624,7 @@ class acquired_lock {
// A lock that owns a piece of data // A lock that owns a piece of data
// Access to the data is only provided by taking the lock // Access to the data is only provided by taking the lock
template<typename DATA> template <typename DATA>
class owning_lock { class owning_lock {
// No copying // No copying
owning_lock &operator=(const scoped_lock &) = delete; owning_lock &operator=(const scoped_lock &) = delete;
@ -636,13 +635,11 @@ class owning_lock {
mutex_lock_t lock; mutex_lock_t lock;
DATA data; DATA data;
public: public:
owning_lock(DATA d) : data(std::move(d)) {} owning_lock(DATA d) : data(std::move(d)) {}
owning_lock() : data() {} owning_lock() : data() {}
acquired_lock<DATA> acquire() { acquired_lock<DATA> acquire() { return {lock, &data}; }
return {lock, &data};
}
}; };
/// A scoped manager to save the current value of some variable, and optionally set it to a new /// A scoped manager to save the current value of some variable, and optionally set it to a new

View file

@ -1180,9 +1180,7 @@ static void test_lru(void) {
// Stable-sort ints in reverse order // Stable-sort ints in reverse order
// This a/2 check ensures that some different ints compare the same // This a/2 check ensures that some different ints compare the same
// It also gives us a different order than we started with // It also gives us a different order than we started with
auto comparer = [](int a, int b){ auto comparer = [](int a, int b) { return a / 2 > b / 2; };
return a/2 > b/2;
};
std::vector<int> ints = cache.ints(); std::vector<int> ints = cache.ints();
std::stable_sort(ints.begin(), ints.end(), comparer); std::stable_sort(ints.begin(), ints.end(), comparer);
@ -1194,13 +1192,13 @@ static void test_lru(void) {
for (int v : vs) { for (int v : vs) {
append_format(ret, L"%d,", v); append_format(ret, L"%d,", v);
} }
if (! ret.empty()) ret.pop_back(); if (!ret.empty()) ret.pop_back();
return ret; return ret;
}; };
err(L"LRU stable sort failed. Expected %ls, got %ls\n", commajoin(new_ints).c_str(), commajoin(ints).c_str()); err(L"LRU stable sort failed. Expected %ls, got %ls\n", commajoin(new_ints).c_str(),
commajoin(ints).c_str());
} }
cache.evict_all_nodes(); cache.evict_all_nodes();
do_test(cache.evicted.size() == size_t(total_nodes)); do_test(cache.evicted.size() == size_t(total_nodes));
} }
@ -2900,7 +2898,7 @@ void history_tests_t::test_history_races(void) {
// History is enumerated from most recent to least // History is enumerated from most recent to least
// Every item should be the last item in some array // Every item should be the last item in some array
size_t hist_idx; size_t hist_idx;
for (hist_idx = 1; ; hist_idx++) { for (hist_idx = 1;; hist_idx++) {
history_item_t item = hist.item_at_index(hist_idx); history_item_t item = hist.item_at_index(hist_idx);
if (item.empty()) break; if (item.empty()) break;
@ -2921,14 +2919,13 @@ void history_tests_t::test_history_races(void) {
break; break;
} }
} }
if (! found) { if (!found) {
err(L"Line '%ls' found in history, but not found in some array", item.str().c_str()); err(L"Line '%ls' found in history, but not found in some array", item.str().c_str());
for (wcstring_list_t &list : expected_lines) { for (wcstring_list_t &list : expected_lines) {
if (! list.empty()) { if (!list.empty()) {
fprintf(stderr, "\tRemaining: %ls\n", list.back().c_str()); fprintf(stderr, "\tRemaining: %ls\n", list.back().c_str());
} }
} }
} }
} }

View file

@ -88,7 +88,7 @@ class history_output_buffer_t {
buffer.reserve(buffer.size() + additional_length); buffer.reserve(buffer.size() + additional_length);
// Append // Append
for (size_t i=0; i < ptr_count; i++) { for (size_t i = 0; i < ptr_count; i++) {
if (lengths[i] > 0) { if (lengths[i] > 0) {
buffer.insert(buffer.end(), ptrs[i], ptrs[i] + lengths[i]); buffer.insert(buffer.end(), ptrs[i], ptrs[i] + lengths[i]);
} }
@ -189,7 +189,7 @@ class history_lru_cache_t : public lru_cache_t<history_lru_cache_t, history_lru_
class history_collection_t { class history_collection_t {
owning_lock<std::map<wcstring, std::unique_ptr<history_t>>> histories; owning_lock<std::map<wcstring, std::unique_ptr<history_t>>> histories;
public: public:
history_t &get_creating(const wcstring &name); history_t &get_creating(const wcstring &name);
void save(); void save();
}; };
@ -704,7 +704,7 @@ history_t &history_collection_t::get_creating(const wcstring &name) {
// using something like shared_ptr // using something like shared_ptr
auto hs = histories.acquire(); auto hs = histories.acquire();
std::unique_ptr<history_t> &hist = hs.value[name]; std::unique_ptr<history_t> &hist = hs.value[name];
if (! hist) { if (!hist) {
hist = make_unique<history_t>(name); hist = make_unique<history_t>(name);
} }
return *hist; return *hist;
@ -1203,15 +1203,14 @@ bool history_t::rewrite_to_temporary_file(int existing_fd, int dst_fd) const {
infer_file_type(local_mmap_start, local_mmap_size); infer_file_type(local_mmap_start, local_mmap_size);
size_t cursor = 0; size_t cursor = 0;
for (;;) { for (;;) {
size_t offset = offset_of_next_item(local_mmap_start, local_mmap_size, size_t offset =
local_mmap_type, &cursor, 0); offset_of_next_item(local_mmap_start, local_mmap_size, local_mmap_type, &cursor, 0);
// If we get back -1, we're done. // If we get back -1, we're done.
if (offset == (size_t)-1) break; if (offset == (size_t)-1) break;
// Try decoding an old item. // Try decoding an old item.
const history_item_t old_item = decode_item(local_mmap_start + offset, const history_item_t old_item =
local_mmap_size - offset, decode_item(local_mmap_start + offset, local_mmap_size - offset, local_mmap_type);
local_mmap_type);
if (old_item.empty() || deleted_items.count(old_item.str()) > 0) { if (old_item.empty() || deleted_items.count(old_item.str()) > 0) {
// debug(0, L"Item is deleted : %s\n", old_item.str().c_str()); // debug(0, L"Item is deleted : %s\n", old_item.str().c_str());
@ -1225,15 +1224,14 @@ bool history_t::rewrite_to_temporary_file(int existing_fd, int dst_fd) const {
// Insert any unwritten new items // Insert any unwritten new items
for (auto iter = new_items.cbegin() + this->first_unwritten_new_item_index; for (auto iter = new_items.cbegin() + this->first_unwritten_new_item_index;
iter != new_items.cend(); iter != new_items.cend(); ++iter) {
++iter) {
lru.add_item(*iter); lru.add_item(*iter);
} }
// Stable-sort our items by timestamp // Stable-sort our items by timestamp
// This is because we may have read "old" items with a later timestamp than our "new" items // This is because we may have read "old" items with a later timestamp than our "new" items
// This is the essential step that roughly orders items by history // This is the essential step that roughly orders items by history
lru.stable_sort([](const history_lru_item_t &item1, const history_lru_item_t &item2){ lru.stable_sort([](const history_lru_item_t &item1, const history_lru_item_t &item2) {
return item1.timestamp < item2.timestamp; return item1.timestamp < item2.timestamp;
}); });
@ -1245,7 +1243,7 @@ bool history_t::rewrite_to_temporary_file(int existing_fd, int dst_fd) const {
append_yaml_to_buffer(item.text, item.timestamp, item.required_paths, &buffer); append_yaml_to_buffer(item.text, item.timestamp, item.required_paths, &buffer);
if (buffer.output_size() >= HISTORY_OUTPUT_BUFFER_SIZE) { if (buffer.output_size() >= HISTORY_OUTPUT_BUFFER_SIZE) {
ok = buffer.flush_to_fd(dst_fd); ok = buffer.flush_to_fd(dst_fd);
if (! ok) { if (!ok) {
debug(2, L"Error %d when writing to temporary history file", errno); debug(2, L"Error %d when writing to temporary history file", errno);
break; break;
} }
@ -1254,7 +1252,7 @@ bool history_t::rewrite_to_temporary_file(int existing_fd, int dst_fd) const {
if (ok) { if (ok) {
ok = buffer.flush_to_fd(dst_fd); ok = buffer.flush_to_fd(dst_fd);
if (! ok) { if (!ok) {
debug(2, L"Error %d when writing to temporary history file", errno); debug(2, L"Error %d when writing to temporary history file", errno);
} }
} }
@ -1298,15 +1296,15 @@ bool history_t::save_internal_via_rewrite() {
} }
bool done = false; bool done = false;
for (int i=0; i < max_save_tries && ! done; i++) { for (int i = 0; i < max_save_tries && !done; i++) {
// Open any target file, but do not lock it right away // Open any target file, but do not lock it right away
int target_fd_before = wopen_cloexec(target_name, O_RDONLY | O_CREAT, history_file_mode); int target_fd_before = wopen_cloexec(target_name, O_RDONLY | O_CREAT, history_file_mode);
file_id_t orig_file_id = file_id_for_fd(target_fd_before); // possibly invalid file_id_t orig_file_id = file_id_for_fd(target_fd_before); // possibly invalid
bool wrote = this->rewrite_to_temporary_file(target_fd_before, tmp_fd); bool wrote = this->rewrite_to_temporary_file(target_fd_before, tmp_fd);
if (target_fd_before >= 0) { if (target_fd_before >= 0) {
close(target_fd_before); close(target_fd_before);
} }
if (! wrote) { if (!wrote) {
// Failed to write, no good // Failed to write, no good
break; break;
} }
@ -1325,14 +1323,13 @@ bool history_t::save_internal_via_rewrite() {
new_file_id = file_id_for_path(target_name); new_file_id = file_id_for_path(target_name);
} }
bool can_replace_file = (new_file_id == orig_file_id || new_file_id == kInvalidFileID); bool can_replace_file = (new_file_id == orig_file_id || new_file_id == kInvalidFileID);
if (! can_replace_file) { if (!can_replace_file) {
// The file has changed, so we're going to re-read it // The file has changed, so we're going to re-read it
// Truncate our tmp_fd so we can reuse it // Truncate our tmp_fd so we can reuse it
if (ftruncate(tmp_fd, 0) == -1 || lseek(tmp_fd, 0, SEEK_SET) == -1) { if (ftruncate(tmp_fd, 0) == -1 || lseek(tmp_fd, 0, SEEK_SET) == -1) {
debug(2, L"Error %d when truncating temporary history file", errno); debug(2, L"Error %d when truncating temporary history file", errno);
} }
} } else {
else {
// The file is unchanged, or the new file doesn't exist or we can't read it // The file is unchanged, or the new file doesn't exist or we can't read it
// We also attempted to take the lock, so we feel confident in replacing it // We also attempted to take the lock, so we feel confident in replacing it
@ -1404,11 +1401,12 @@ bool history_t::save_internal_via_appending() {
signal_block(); signal_block();
// We are going to open the file, lock it, append to it, and then close it // We are going to open the file, lock it, append to it, and then close it
// After locking it, we need to stat the file at the path; if there is a new file there, it means // After locking it, we need to stat the file at the path; if there is a new file there, it
// means
// the file was replaced and we have to try again // the file was replaced and we have to try again
// Limit our max tries so we don't do this forever // Limit our max tries so we don't do this forever
int history_fd = -1; int history_fd = -1;
for (int i=0; i < max_save_tries; i++) { for (int i = 0; i < max_save_tries; i++) {
int fd = wopen_cloexec(history_path, O_WRONLY | O_APPEND); int fd = wopen_cloexec(history_path, O_WRONLY | O_APPEND);
if (fd < 0) { if (fd < 0) {
// can't open, we're hosed // can't open, we're hosed
@ -1479,8 +1477,10 @@ bool history_t::save_internal_via_appending() {
} }
// Since we just modified the file, update our mmap_file_id to match its current state // Since we just modified the file, update our mmap_file_id to match its current state
// Otherwise we'll think the file has been changed by someone else the next time we go to write // Otherwise we'll think the file has been changed by someone else the next time we go to
// We don't update the mapping since we only appended to the file, and everything we appended // write
// We don't update the mapping since we only appended to the file, and everything we
// appended
// remains in our new_items // remains in our new_items
this->mmap_file_id = file_id_for_fd(history_fd); this->mmap_file_id = file_id_for_fd(history_fd);

View file

@ -196,8 +196,8 @@ class history_t {
// Do a private, read-only map of the entirety of a history file with the given name. Returns // Do a private, read-only map of the entirety of a history file with the given name. Returns
// true if successful. Returns the mapped memory region by reference. // true if successful. Returns the mapped memory region by reference.
bool map_file(const wcstring &name, const char **out_map_start, bool map_file(const wcstring &name, const char **out_map_start, size_t *out_map_len,
size_t *out_map_len, file_id_t *file_id) const; file_id_t *file_id) const;
// Like map_file but takes a file descriptor // Like map_file but takes a file descriptor
bool map_fd(int fd, const char **out_map_start, size_t *out_map_len) const; bool map_fd(int fd, const char **out_map_start, size_t *out_map_len) const;

View file

@ -56,8 +56,8 @@ struct input_mapping_t {
/// New mode that should be switched to after command evaluation. /// New mode that should be switched to after command evaluation.
wcstring sets_mode; wcstring sets_mode;
input_mapping_t(const wcstring &s, const std::vector<wcstring> &c, input_mapping_t(const wcstring &s, const std::vector<wcstring> &c, const wcstring &m,
const wcstring &m, const wcstring &sm) const wcstring &sm)
: seq(s), commands(c), mode(m), sets_mode(sm) { : seq(s), commands(c), mode(m), sets_mode(sm) {
static unsigned int s_last_input_map_spec_order = 0; static unsigned int s_last_input_map_spec_order = 0;
specification_order = ++s_last_input_map_spec_order; specification_order = ++s_last_input_map_spec_order;
@ -221,7 +221,7 @@ wcstring input_get_bind_mode() {
void input_set_bind_mode(const wcstring &bm) { void input_set_bind_mode(const wcstring &bm) {
// Only set this if it differs to not execute variable handlers all the time. // Only set this if it differs to not execute variable handlers all the time.
// modes may not be empty - empty is a sentinel value meaning to not change the mode // modes may not be empty - empty is a sentinel value meaning to not change the mode
assert(! bm.empty()); assert(!bm.empty());
if (input_get_bind_mode() != bm.c_str()) { if (input_get_bind_mode() != bm.c_str()) {
env_set(FISH_BIND_MODE_VAR, bm.c_str(), ENV_GLOBAL); env_set(FISH_BIND_MODE_VAR, bm.c_str(), ENV_GLOBAL);
} }

View file

@ -12,9 +12,7 @@
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "intern.h" #include "intern.h"
bool string_less_than_string(const wchar_t *a, const wchar_t *b) { bool string_less_than_string(const wchar_t *a, const wchar_t *b) { return wcscmp(a, b) < 0; }
return wcscmp(a, b) < 0;
}
/// The table of intern'd strings. /// The table of intern'd strings.
owning_lock<std::vector<const wchar_t *>> string_table; owning_lock<std::vector<const wchar_t *>> string_table;
@ -27,8 +25,8 @@ static const wchar_t *intern_with_dup(const wchar_t *in, bool dup) {
std::vector<const wchar_t *> &string_table = lock_string_table.value; std::vector<const wchar_t *> &string_table = lock_string_table.value;
const wchar_t *result; const wchar_t *result;
auto iter = std::lower_bound(string_table.begin(), string_table.end(), auto iter =
in, string_less_than_string); std::lower_bound(string_table.begin(), string_table.end(), in, string_less_than_string);
if (iter != string_table.end() && wcscmp(*iter, in) == 0) { if (iter != string_table.end() && wcscmp(*iter, in) == 0) {
result = *iter; result = *iter;
} else { } else {

View file

@ -118,19 +118,18 @@ class lru_cache_t {
// and a binary func F implementing less-than, return // and a binary func F implementing less-than, return
// the list in sorted order // the list in sorted order
template <typename F> template <typename F>
static lru_link_t *merge(lru_link_t *left, size_t left_len, static lru_link_t *merge(lru_link_t *left, size_t left_len, lru_link_t *right, size_t right_len,
lru_link_t *right, size_t right_len,
const F &func) { const F &func) {
assert(left_len > 0 && right_len > 0); assert(left_len > 0 && right_len > 0);
auto popleft = [&](){ auto popleft = [&]() {
lru_link_t *ret = left; lru_link_t *ret = left;
left = left->next; left = left->next;
left_len--; left_len--;
return ret; return ret;
}; };
auto popright = [&](){ auto popright = [&]() {
lru_link_t *ret = right; lru_link_t *ret = right;
right = right->next; right = right->next;
right_len--; right_len--;
@ -140,8 +139,8 @@ class lru_cache_t {
lru_link_t *head; lru_link_t *head;
lru_link_t **cursor = &head; lru_link_t **cursor = &head;
while (left_len && right_len) { while (left_len && right_len) {
bool goleft = ! func(static_cast<lru_node_t *>(left)->value, bool goleft = !func(static_cast<lru_node_t *>(left)->value,
static_cast<lru_node_t *>(right)->value); static_cast<lru_node_t *>(right)->value);
*cursor = goleft ? popleft() : popright(); *cursor = goleft ? popleft() : popright();
cursor = &(*cursor)->next; cursor = &(*cursor)->next;
} }
@ -154,7 +153,7 @@ class lru_cache_t {
// mergesort the given list of the given length // mergesort the given list of the given length
// This only sets the next pointers, not the prev ones // This only sets the next pointers, not the prev ones
template<typename F> template <typename F>
static lru_link_t *mergesort(lru_link_t *node, size_t length, const F &func) { static lru_link_t *mergesort(lru_link_t *node, size_t length, const F &func) {
if (length <= 1) { if (length <= 1) {
return node; return node;
@ -165,7 +164,7 @@ class lru_cache_t {
lru_link_t *left = node; lru_link_t *left = node;
lru_link_t *right = node; lru_link_t *right = node;
for (size_t i=0; i < left_len; i++) { for (size_t i = 0; i < left_len; i++) {
right = right->next; right = right->next;
} }
@ -178,9 +177,7 @@ class lru_cache_t {
} }
public: public:
// Constructor. Note our linked list is always circular.
// Constructor
// Note our linked list is always circular!
explicit lru_cache_t(size_t max_size = 1024) : max_node_count(max_size) { explicit lru_cache_t(size_t max_size = 1024) : max_node_count(max_size) {
mouth.next = mouth.prev = &mouth; mouth.next = mouth.prev = &mouth;
} }
@ -242,13 +239,11 @@ class lru_cache_t {
} }
// Number of entries // Number of entries
size_t size() const { size_t size() const { return this->node_map.size(); }
return this->node_map.size();
}
// Sorting support // Given a binary function F implementing less-than on the contents, place the nodes in sorted
// Given a binary function F implementing less-than on the contents, place the nodes in sorted order // order.
template<typename F> template <typename F>
void stable_sort(const F &func) { void stable_sort(const F &func) {
// Perform the sort. This sets forward pointers only // Perform the sort. This sets forward pointers only
size_t length = this->size(); size_t length = this->size();
@ -261,7 +256,7 @@ class lru_cache_t {
// Go through and set back back pointers // Go through and set back back pointers
lru_link_t *cursor = sorted; lru_link_t *cursor = sorted;
lru_link_t *prev = &mouth; lru_link_t *prev = &mouth;
for (size_t i=0; i < length; i++) { for (size_t i = 0; i < length; i++) {
cursor->prev = prev; cursor->prev = prev;
prev = cursor; prev = cursor;
cursor = cursor->next; cursor = cursor->next;

View file

@ -236,15 +236,14 @@ static bool is_color_escape_seq(const wchar_t *code, size_t *resulting_length) {
/// displayed other than the color. /// displayed other than the color.
static bool is_visual_escape_seq(const wchar_t *code, size_t *resulting_length) { static bool is_visual_escape_seq(const wchar_t *code, size_t *resulting_length) {
if (!cur_term) return false; if (!cur_term) return false;
char *const esc2[] = {enter_bold_mode, exit_attribute_mode, enter_underline_mode, char *const esc2[] = {
exit_underline_mode, enter_standout_mode, exit_standout_mode, enter_bold_mode, exit_attribute_mode, enter_underline_mode, exit_underline_mode,
flash_screen, enter_subscript_mode, exit_subscript_mode, enter_standout_mode, exit_standout_mode, flash_screen, enter_subscript_mode,
enter_superscript_mode, exit_superscript_mode, enter_blink_mode, exit_subscript_mode, enter_superscript_mode, exit_superscript_mode, enter_blink_mode,
enter_italics_mode, exit_italics_mode, enter_reverse_mode, enter_italics_mode, exit_italics_mode, enter_reverse_mode, enter_shadow_mode,
enter_shadow_mode, exit_shadow_mode, enter_standout_mode, exit_shadow_mode, enter_standout_mode, exit_standout_mode, enter_secure_mode,
exit_standout_mode, enter_secure_mode, enter_dim_mode, enter_dim_mode, enter_blink_mode, enter_protected_mode, enter_alt_charset_mode,
enter_blink_mode, enter_protected_mode, enter_alt_charset_mode, exit_alt_charset_mode};
exit_alt_charset_mode};
for (size_t p = 0; p < sizeof esc2 / sizeof *esc2; p++) { for (size_t p = 0; p < sizeof esc2 / sizeof *esc2; p++) {
if (!esc2[p]) continue; if (!esc2[p]) continue;