Skip to content

Commit c64c8a8

Browse files
committed
[tidy] minor cleanups
1 parent 0886500 commit c64c8a8

16 files changed

+45
-39
lines changed

src/base/keycodes.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#ifndef lnav_keycodes_hh
3131
#define lnav_keycodes_hh
3232

33-
inline constexpr int
33+
constexpr int
3434
KEY_CTRL(char k)
3535
{
3636
return k & 0x1f;

src/breadcrumb_curses.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#include "base/itertools.enumerate.hh"
3333
#include "base/itertools.hh"
34+
#include "base/keycodes.hh"
3435
#include "itertools.similar.hh"
3536

3637
using namespace lnav::roles::literals;
@@ -233,8 +234,8 @@ breadcrumb_curses::handle_key(const ncinput& ch)
233234
case 'a':
234235
case 'A':
235236
mapped_id = KEY_CTRL('a');
236-
break;
237-
break;
237+
break;
238+
break;
238239
case 'e':
239240
case 'E':
240241
mapped_id = KEY_CTRL('e');

src/file_collection.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@
3333
#define lnav_file_collection_hh
3434

3535
#include <forward_list>
36+
#include <future>
3637
#include <list>
3738
#include <map>
3839
#include <set>
3940
#include <string>
40-
#include <utility>
41+
#include <vector>
4142

4243
#include <sys/resource.h>
4344

src/hist_source.hh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
#include <cmath>
3636
#include <limits>
37-
#include <map>
3837
#include <string>
3938
#include <unordered_map>
4039
#include <vector>

src/hotkeys.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "base/ansi_scrubber.hh"
3333
#include "base/injector.hh"
3434
#include "base/itertools.hh"
35+
#include "base/keycodes.hh"
3536
#include "base/math_util.hh"
3637
#include "base/opt_util.hh"
3738
#include "bookmarks.hh"

src/listview_curses.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <time.h>
3939

4040
#include "base/func_util.hh"
41+
#include "base/keycodes.hh"
4142
#include "base/lnav_log.hh"
4243
#include "config.h"
4344

src/log_level.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#include "config.h"
3535

36-
const char* level_names[LEVEL__MAX + 1] = {
36+
const char* const level_names[LEVEL__MAX + 1] = {
3737
"unknown",
3838
"trace",
3939
"debug5",

src/log_level.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
#include "base/log_level_enum.hh"
3838

39-
extern const char* level_names[LEVEL__MAX + 1];
39+
extern const char* const level_names[LEVEL__MAX + 1];
4040

4141
constexpr size_t MAX_LEVEL_NAME_LEN = 8;
4242

src/readline_curses.hh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,12 @@
3636
#include <exception>
3737
#include <functional>
3838
#include <map>
39-
#include <stack>
4039
#include <string>
4140
#include <utility>
4241
#include <vector>
4342

4443
#include <errno.h>
4544
#include <poll.h>
46-
#include <readline/history.h>
4745
#include <readline/readline.h>
4846
#include <stdlib.h>
4947
#include <string.h>
@@ -146,11 +144,11 @@ public:
146144

147145
std::string get_alt_value() const { return this->rc_alt_value; }
148146

149-
void update_poll_set(std::vector<struct pollfd>& pollfds) override;
147+
void update_poll_set(std::vector<pollfd>& pollfds) override;
150148

151149
void handle_key(const ncinput& ch);
152150

153-
void check_poll_set(const std::vector<struct pollfd>& pollfds) override;
151+
void check_poll_set(const std::vector<pollfd>& pollfds) override;
154152

155153
void focus(int context,
156154
const std::string& prompt,
@@ -219,7 +217,7 @@ public:
219217

220218
void add_possibility(const int context,
221219
const std::string& type,
222-
const char* values[])
220+
const char* const values[])
223221
{
224222
for (int lpc = 0; values[lpc]; lpc++) {
225223
this->add_possibility(context, type, values[lpc]);
@@ -228,8 +226,8 @@ public:
228226

229227
void add_possibility(const int context,
230228
const std::string& type,
231-
const char** first,
232-
const char** last)
229+
const char* const* first,
230+
const char* const* last)
233231
{
234232
for (; first < last; first++) {
235233
this->add_possibility(context, type, *first);

src/spectro_source.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "spectro_source.hh"
3333

3434
#include "base/ansi_scrubber.hh"
35+
#include "base/keycodes.hh"
3536
#include "base/math_util.hh"
3637
#include "config.h"
3738

0 commit comments

Comments
 (0)