From 4381c23641860635a7426422efca79b4d2d66808 Mon Sep 17 00:00:00 2001 From: Timothy Stack Date: Sun, 13 Jan 2019 19:14:26 -0800 Subject: [PATCH] some build and cleanup --- src/file_vtab.cc | 2 +- src/lnav.cc | 16 ++++++++++++---- src/view_helpers.cc | 6 +++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/file_vtab.cc b/src/file_vtab.cc index edee3b47..19c39f39 100644 --- a/src/file_vtab.cc +++ b/src/file_vtab.cc @@ -82,7 +82,7 @@ CREATE TABLE lnav_file ( switch (col) { case 0: - to_sqlite(ctx, st.st_dev); + to_sqlite(ctx, (int64_t) st.st_dev); break; case 1: to_sqlite(ctx, (int64_t) st.st_ino); diff --git a/src/lnav.cc b/src/lnav.cc index 2f657e11..1ac2e950 100644 --- a/src/lnav.cc +++ b/src/lnav.cc @@ -333,10 +333,18 @@ bool setup_logline_table(exec_context &ec) } for (const auto &pair : sqlite_function_help) { - lnav_data.ld_rl_view->add_possibility( - LNM_SQL, - "*", - pair.first + (pair.second->ht_parameters.empty() ? "()" : ("("))); + switch (pair.second->ht_context) { + case HC_SQL_FUNCTION: + case HC_SQL_TABLE_VALUED_FUNCTION: { + string poss = pair.first + + (pair.second->ht_parameters.empty() ? "()" : ("(")); + + lnav_data.ld_rl_view->add_possibility(LNM_SQL, "*", poss); + break; + } + default: + break; + } } } diff --git a/src/view_helpers.cc b/src/view_helpers.cc index 582bab57..74b186eb 100644 --- a/src/view_helpers.cc +++ b/src/view_helpers.cc @@ -172,7 +172,7 @@ static void build_all_help_text() map sql_funcs; map sql_keywords; - for (auto iter : sqlite_function_help) { + for (const auto &iter : sqlite_function_help) { switch (iter.second->ht_context) { case HC_SQL_FUNCTION: case HC_SQL_TABLE_VALUED_FUNCTION: @@ -186,7 +186,7 @@ static void build_all_help_text() } } - for (auto iter : sql_funcs) { + for (const auto &iter : sql_funcs) { all_help_text.append(2, '\n'); format_help_text_for_term(*iter.second, 79, all_help_text); if (!iter.second->ht_example.empty()) { @@ -195,7 +195,7 @@ static void build_all_help_text() } } - for (auto iter : sql_keywords) { + for (const auto &iter : sql_keywords) { all_help_text.append(2, '\n'); format_help_text_for_term(*iter.second, 79, all_help_text); if (!iter.second->ht_example.empty()) {