[cppcheck] fix some nits turned up by cppcheck

This commit is contained in:
Timothy Stack 2013-06-20 06:08:53 -07:00
parent 8c1dee55ff
commit f26dc13529
3 changed files with 5 additions and 4 deletions

View File

@ -38,6 +38,7 @@
#include <sqlite3.h>
#include "auto_fd.hh"
#include "lnav_util.hh"
std::string hash_string(const std::string &str)
@ -144,7 +145,7 @@ bool change_to_parent_dir(void)
file_format_t detect_file_format(const std::string &filename)
{
file_format_t retval = FF_UNKNOWN;
int fd;
auto_fd fd;
if ((fd = open(filename.c_str(), O_RDONLY)) != -1) {
char buffer[32];

View File

@ -342,7 +342,7 @@ void load_bookmarks(void)
const string &log_name = iter->ld_file->get_filename();
string mark_file_name;
yajl_handle handle;
int fd;
auto_fd fd;
fprintf(stderr, "load %s\n", log_name.c_str());
@ -455,7 +455,7 @@ void load_session(void)
std::list<session_pair_t>::iterator sess_iter;
yajlpp_parse_context ypc(view_info_handlers);
yajl_handle handle;
int fd;
auto_fd fd;
if (lnav_data.ld_session_file_names.empty()) {
load_bookmarks();

View File

@ -435,7 +435,7 @@ public:
return VC_ANSI_START + ((fg * 8) + bg);
};
int ansi_color_pair(int fg, int bg)
static inline int ansi_color_pair(int fg, int bg)
{
return COLOR_PAIR(ansi_color_pair_index(fg, bg));
};