build work

pull/37/merge
Timothy Stack 15 years ago
parent 4f13115dce
commit 1d40a8edcf

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -181,6 +181,7 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I .
@ -300,7 +301,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS

113
aclocal.m4 vendored

@ -1,4 +1,4 @@
# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@ -13,13 +13,13 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(AC_AUTOCONF_VERSION, [2.61],,
[m4_warning([this file was generated for autoconf 2.61.
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
[m4_warning([this file was generated for autoconf 2.63.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -34,7 +34,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.10'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.10.1], [],
m4_if([$1], [1.10.2], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@ -48,12 +48,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.10.1])dnl
[AM_AUTOMAKE_VERSION([1.10.2])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
@ -303,57 +303,68 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#serial 3
#serial 5
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[for mf in $CONFIG_FILES; do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
[{
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
shift
for mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
done
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
@ -659,13 +670,13 @@ esac
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# serial 4
# _AM_MANGLE_OPTION(NAME)
# -----------------------
@ -682,7 +693,7 @@ AC_DEFUN([_AM_SET_OPTION],
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------

3494
configure vendored

File diff suppressed because it is too large Load Diff

@ -24,10 +24,12 @@ endif
AM_LDFLAGS = \
$(SQLITE3_LDFLAGS) \
-pthread \
-static
-pthread
# -static
AM_CPPFLAGS = \
-Wall \
-Werror \
$(SQLITE3_CFLAGS)
LDADD = \
@ -62,6 +64,7 @@ noinst_HEADERS = \
readline_curses.hh \
statusview_curses.hh \
strong_int.hh \
termios_guard.hh \
textview_curses.hh \
time_T.hh \
top_status_source.hh \

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -195,6 +195,7 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LIBRARIES = libdiag.a
@ -204,10 +205,12 @@ noinst_LIBRARIES = libdiag.a
@HAVE_OBJCOPY_TRUE@HELP_SRC =
AM_LDFLAGS = \
$(SQLITE3_LDFLAGS) \
-pthread \
-static
-pthread
# -static
AM_CPPFLAGS = \
-Wall \
-Werror \
$(SQLITE3_CFLAGS)
LDADD = \
@ -242,6 +245,7 @@ noinst_HEADERS = \
readline_curses.hh \
statusview_curses.hh \
strong_int.hh \
termios_guard.hh \
textview_curses.hh \
time_T.hh \
top_status_source.hh \
@ -277,8 +281,8 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
@ -396,7 +400,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS

@ -45,7 +45,8 @@ public:
char *pat = (char *)alloca(strlen(cpat) + 1); /* XXX */
strcpy(pat, cpat);
mktemp(pat);
if (mktemp(pat) == NULL)
perror("mktemp");
this->atf_name = pat;
}
};

@ -29,11 +29,11 @@ public:
} field_t;
bottom_status_source()
: bss_error(80, view_colors::VCR_ALERT_STATUS),
line_number_wire(*this, &bottom_status_source::update_line_number),
: line_number_wire(*this, &bottom_status_source::update_line_number),
percent_wire(*this, &bottom_status_source::update_percent),
marks_wire(*this, &bottom_status_source::update_marks),
hits_wire(*this, &bottom_status_source::update_hits),
bss_error(80, view_colors::VCR_ALERT_STATUS),
bss_hit_spinner(0),
bss_load_percent(0) {
this->bss_fields[BSF_LINE_NUMBER].set_width(8);
@ -167,7 +167,7 @@ public:
void update_loading(off_t off, size_t total) {
status_field &sf = this->bss_fields[BSF_LOADING];
if (off == total) {
if ((size_t)off == total) {
sf.set_role(view_colors::VCR_STATUS);
sf.clear();
}

@ -15,7 +15,7 @@ public:
void hist_label_for_group(int group, std::string &label_out) {
label_out.clear();
for (int lpc = 0; lpc < this->dls_headers.size(); lpc++) {
for (int lpc = 0; lpc < (int)this->dls_headers.size(); lpc++) {
int before, total_fill =
this->dls_column_sizes[lpc] - this->dls_headers[lpc].length();
@ -36,9 +36,9 @@ public:
*/
label_out.clear();
if (bucket_start_value >= this->dls_rows.size())
if (bucket_start_value >= (int)this->dls_rows.size())
return;
for (int lpc = 0; lpc < this->dls_rows[bucket_start_value].size(); lpc++) {
for (int lpc = 0; lpc < (int)this->dls_rows[bucket_start_value].size(); lpc++) {
label_out.append(this->dls_column_sizes[lpc] - this->dls_rows[bucket_start_value][lpc].length(), ' ');
label_out.append(this->dls_rows[bucket_start_value][lpc]);
}

@ -146,7 +146,7 @@ void grep_proc::start(void)
while (!this->gp_queue.empty()) {
grep_line_t start_line = this->gp_queue.front().first;
grep_line_t stop_line = this->gp_queue.front().second;
bool done = false, got_first_hit = false;
bool done = false;
int line;
this->gp_queue.pop_front();

@ -37,7 +37,6 @@ void hist_source::text_value_for_line(textview_curses &tc,
}
else {
bucket_group_t bg = this->hs_group_keys[grow];
bucket_count_t total(0);
bucket_t::iterator iter;
int bucket_index;
@ -60,7 +59,6 @@ void hist_source::text_attrs_for_line(textview_curses &tc,
if (this->hs_token_bucket != NULL) {
view_colors &vc = view_colors::singleton();
unsigned long width, avail_width;
bucket_count_t total(0);
bucket_t::iterator iter;
vis_line_t height;
struct line_range lr;

@ -285,7 +285,6 @@ throw (error)
{
size_t request_size = DEFAULT_INCREMENT;
char *retval = NULL;
int last_avail = 0;
assert(this->lb_fd != -1);

@ -50,6 +50,7 @@
#include "log_vtab_impl.hh"
#include "db_sub_source.hh"
#include "pcrecpp.h"
#include "termios_guard.hh"
using namespace std;
@ -214,16 +215,15 @@ public:
string &label_out)
{
hist_source::bucket_t::const_iterator iter;
float total = 0.0;
for (iter = bucket.begin(); iter != bucket.end(); iter++) {
char buffer[64];
if (iter->second != 0.0) {
snprintf(buffer, sizeof(buffer), " % 10.2f", iter->second);
snprintf(buffer, sizeof(buffer), " %10.2f", iter->second);
}
else {
snprintf(buffer, sizeof(buffer), " % 10s", "-");
snprintf(buffer, sizeof(buffer), " %10s", "-");
}
label_out += string(buffer);
}
@ -295,7 +295,8 @@ public:
void logfile_indexing(logfile &lf, off_t off, size_t total)
{
if (abs(off - this->lo_last_offset) > (128 * 1024) || off == total) {
if (abs(off - this->lo_last_offset) > (128 * 1024) ||
(size_t)off == total) {
lnav_data.ld_bottom_source.update_loading(off, total);
this->do_update();
this->lo_last_offset = off;
@ -310,7 +311,7 @@ public:
content_line_t cl,
size_t total)
{
if (abs(cl - this->lo_last_line) > 1024 || cl == (total - 1)) {
if (abs(cl - this->lo_last_line) > 1024 || (size_t)cl == (total - 1)) {
lnav_data.ld_bottom_source.update_loading(cl, (total - 1));
this->do_update();
this->lo_last_line = cl;
@ -337,7 +338,6 @@ private:
static void rebuild_hist(size_t old_count, bool force)
{
textview_curses &hist_view = lnav_data.ld_views[LNV_HISTOGRAM];
textview_curses &log_view = lnav_data.ld_views[LNV_LOG];
logfile_sub_source &lss = lnav_data.ld_log_source;
size_t new_count = lss.text_line_count();
hist_source &hs = lnav_data.ld_hist_source;
@ -351,7 +351,7 @@ static void rebuild_hist(size_t old_count, bool force)
if (force) {
hs.clear();
}
for (lpc = old_count; lpc < new_count; lpc++) {
for (lpc = old_count; lpc < (int)new_count; lpc++) {
logline *ll = lss.find_line(lss.at(vis_line_t(lpc)));
if (!(ll->get_level() & logline::LEVEL_CONTINUED)) {
@ -381,7 +381,7 @@ static void rebuild_indexes(bool force)
old_time = lnav_data.ld_top_time;
log_view.get_dimensions(height, width);
old_bottom = log_view.get_top() + height;
scroll_down = old_bottom > lss.text_line_count();
scroll_down = (size_t)old_bottom > lss.text_line_count();
if (force) {
old_count = 0;
}
@ -389,14 +389,13 @@ static void rebuild_indexes(bool force)
old_count = lss.text_line_count();
}
if (lss.rebuild_index(&obs, force)) {
hist_source &hs = lnav_data.ld_hist_source;
size_t new_count = lss.text_line_count();
grep_line_t start_line;
int lpc;
log_view.reload_data();
if (scroll_down && new_count >= height) {
if (scroll_down && new_count >= (size_t)height) {
log_view.set_top(vis_line_t(new_count - height + 1));
}
else if (!scroll_down && force) {
@ -523,7 +522,9 @@ static bool change_to_parent_dir(void)
bool retval = false;
char cwd[3] = "";
getcwd(cwd, sizeof(cwd));
if (getcwd(cwd, sizeof(cwd)) == NULL) {
// perror("getcwd");
}
if (strcmp(cwd, "/") != 0) {
if (chdir("..") == -1) {
perror("chdir('..')");
@ -562,7 +563,7 @@ static bool append_default_files(lnav_flags_t flag)
if (glob(path.c_str(), 0, NULL, &gl) == 0) {
int lpc;
for (lpc = 0; lpc < gl.gl_pathc; lpc++) {
for (lpc = 0; lpc < (int)gl.gl_pathc; lpc++) {
lnav_data.ld_file_names.insert(make_pair(gl.gl_pathv[lpc], -1));
}
globfree(&gl);
@ -814,8 +815,6 @@ static void handle_paging_key(int ch)
flash();
}
else {
hist_source &hs = lnav_data.ld_hist_source;
lnav_data.ld_hist_zoom += 1;
rebuild_hist(0, true);
}
@ -828,8 +827,6 @@ static void handle_paging_key(int ch)
flash();
}
else {
hist_source &hs = lnav_data.ld_hist_source;
lnav_data.ld_hist_zoom -= 1;
rebuild_hist(0, true);
}
@ -1173,7 +1170,7 @@ static string com_save_to(string cmdline, vector<string> &args)
FILE *outfile = NULL;
FILE *pfile = NULL;
char command[1024];
const char *mode;
const char *mode = "";
if (args.size() == 0) {
args.push_back("filename");
@ -1189,7 +1186,8 @@ static string com_save_to(string cmdline, vector<string> &args)
return "error: unable to compute file name";
}
fgets(command, sizeof(command), pfile);
if (fgets(command, sizeof(command), pfile) == 0)
perror("fgets");
fclose(pfile);
pfile = NULL;
@ -1386,7 +1384,6 @@ static string com_enable_filter(string cmdline, vector<string> &args)
}
else if (args.size() > 1) {
logfile_filter *lf;
bool found = false;
args[1] = cmdline.substr(cmdline.find(args[1]));
lf = lnav_data.ld_log_source.get_filter(args[1]);
@ -1419,7 +1416,6 @@ static string com_disable_filter(string cmdline, vector<string> &args)
}
else if (args.size() > 1) {
logfile_filter *lf;
bool found = false;
args[1] = cmdline.substr(cmdline.find(args[1]));
lf = lnav_data.ld_log_source.get_filter(args[1]);
@ -1597,6 +1593,10 @@ static void rl_search(void *dummy, readline_curses *rc)
static void rl_callback(void *dummy, readline_curses *rc)
{
switch (lnav_data.ld_mode) {
case LNM_PAGING:
assert(0);
break;
case LNM_COMMAND:
{
stringstream ss(rc->get_value());
@ -1751,7 +1751,6 @@ static void looper(void)
try {
readline_context command_context(&lnav_commands);
struct timeval last_check = { 0, 0 };
readline_context search_context;
readline_context index_context;
readline_context sql_context;
@ -2263,7 +2262,7 @@ public:
bool in_quote = false;
argnum = column - 3;
for (lpc = 0; lpc < args.length(); lpc++) {
for (lpc = 0; lpc < (int)args.length(); lpc++) {
switch (args[lpc]) {
case '{':
if (!in_quote)
@ -2326,29 +2325,6 @@ private:
pcrecpp::RE slt_regex;
};
class guard_termios {
public:
guard_termios(int fd) : gt_fd(fd) {
if (isatty(this->gt_fd) &&
tcgetattr(this->gt_fd, &this->gt_termios) == -1) {
perror("tcgetattr");
}
};
~guard_termios() {
if (isatty(this->gt_fd) &&
tcsetattr(this->gt_fd, TCSANOW, &this->gt_termios) == -1) {
perror("tcsetattr");
}
};
private:
int gt_fd;
struct termios gt_termios;
};
int main(int argc, char *argv[])
{
int lpc, c, retval = EXIT_SUCCESS;

@ -1,4 +1,9 @@
#include "config.h"
#include <stdarg.h>
#include <string.h>
#include "log_format.hh"
using namespace std;

@ -8,6 +8,7 @@
#include <string>
#include <vector>
#include <memory>
/**
* Metadata for a single line in a log file.

@ -133,10 +133,12 @@ class tcsh_history_format : public log_format {
int len) {
bool retval = false;
time_t log_time;
int log_time_int;
if (sscanf(prefix, "#+%d", &log_time) == 1) {
if (sscanf(prefix, "#+%d", &log_time_int) == 1) {
struct tm log_tm;
log_time = log_time_int;
memset(&log_tm, 0, sizeof(log_tm));
log_tm = *localtime( &log_time);

@ -51,7 +51,6 @@ static int vt_create( sqlite3 *db,
{
log_vtab_manager *vm = (log_vtab_manager *)pAux;
int rc = SQLITE_OK;
log_vtab_impl *vi;
vtab* p_vt;
/* Allocate the sqlite3_vtab/vtab structure itself */
@ -136,7 +135,7 @@ static int vt_eof(sqlite3_vtab_cursor *cur)
vtab_cursor *vc = (vtab_cursor *)cur;
vtab *vt = (vtab *)cur->pVtab;
return vc->curr_line == vt->lss->text_line_count();
return vc->curr_line == (int)vt->lss->text_line_count();
}
static int vt_next(sqlite3_vtab_cursor *cur)
@ -149,7 +148,7 @@ static int vt_next(sqlite3_vtab_cursor *cur)
do {
vc->curr_line = vc->curr_line + vis_line_t(1);
if (vc->curr_line == vt->lss->text_line_count())
if (vc->curr_line == (int)vt->lss->text_line_count())
break;
content_line_t cl(vt->lss->at(vc->curr_line));
@ -291,7 +290,6 @@ log_vtab_manager::log_vtab_manager(sqlite3 *memdb, logfile_sub_source &lss)
void log_vtab_manager::register_vtab(log_vtab_impl *vi) {
if (this->vm_impls.find(vi->get_name()) == this->vm_impls.end()) {
const char *errmsg;
char *sql;
int rc;

@ -5,7 +5,6 @@
#include "config.h"
#include <stdio.h>
#define __USE_GNU
#include <string.h>
#include <stdarg.h>
#include <errno.h>
@ -69,7 +68,6 @@ logfile::~logfile()
void logfile::process_prefix(off_t offset, char *prefix, int len)
{
bool found = false;
int lpc;
if (this->lf_format.get() != NULL) {
/* We've locked onto a format, just use that scanner. */

@ -166,7 +166,7 @@ protected:
std::auto_ptr<log_format> lf_format;
std::vector<logline> lf_index;
time_t lf_index_time;
size_t lf_index_size;
off_t lf_index_size;
line_buffer lf_line_buffer;
};

@ -342,7 +342,7 @@ bool logfile_sub_source::rebuild_index(observer *obs, bool force)
action_priority = -1;
}
for (lpc = 0; lpc < this->lss_filters.size(); lpc++) {
for (lpc = 0; lpc < (int)this->lss_filters.size(); lpc++) {
logfile_filter *filter = this->lss_filters[lpc];
if (filter->is_enabled()) {
@ -374,6 +374,10 @@ bool logfile_sub_source::rebuild_index(observer *obs, bool force)
action_priority = lpc;
}
break;
default:
assert(0);
break;
}
}
}
@ -414,7 +418,7 @@ void logfile_sub_source::text_update_marks(bookmarks &bm)
bm[&BM_FILES].clear();
bm[&textview_curses::BM_USER].clear();
for (; vl < this->lss_index.size(); ++vl) {
for (; vl < (int)this->lss_index.size(); ++vl) {
content_line_t cl = this->lss_index[vl];
logfile *lf;

@ -160,7 +160,7 @@ public:
content_line_t at(vis_line_t vl) { return this->lss_index[vl]; };
private:
static const int MAX_LINES_PER_FILE = 16 * 1024 * 1024;
static const size_t MAX_LINES_PER_FILE = 16 * 1024 * 1024;
enum {
B_NO_SCRUB,

@ -10,6 +10,8 @@
#error "pcre.h not found?"
#endif
#include <string.h>
#include <string>
#include <memory>
#include <exception>
@ -61,14 +63,16 @@ private:
class pcre_input {
public:
pcre_input(const char *str, size_t off = 0, size_t len = -1)
: pi_string(str), pi_offset(off), pi_length(len), pi_next_offset(off) {
if (this->pi_length == -1)
: pi_offset(off), pi_next_offset(off), pi_length(len), pi_string(str) {
if (this->pi_length == (size_t)-1)
this->pi_length = strlen(str);
};
pcre_input(std::string &str, size_t off = 0)
: pi_string(str.c_str()), pi_offset(off), pi_length(str.length()),
pi_next_offset(off) {
: pi_offset(off),
pi_next_offset(off),
pi_length(str.length()),
pi_string(str.c_str()) {
};
const char *get_string() const { return this->pi_string; };

@ -3,8 +3,10 @@
#include <paths.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/param.h>
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include "piper_proc.hh"

@ -125,7 +125,7 @@ char **readline_context::attempted_completion(const char *text,
arg_possibilities = &(loaded_context->rc_possibilities[proto[0]]);
fprintf(stderr, "ag %p %d\n",
arg_possibilities,
arg_possibilities->size());
(int)arg_possibilities->size());
}
}
@ -325,7 +325,12 @@ void readline_curses::start(void)
fprintf(stderr, "got timeout\n");
got_timeout = 0;
snprintf(msg, sizeof(msg), "t:%s", rl_line_buffer);
write(this->rc_command_pipe[RCF_SLAVE], msg, strlen(msg));
if (write(this->rc_command_pipe[RCF_SLAVE],
msg,
strlen(msg)) == -1) {
perror("write failed");
exit(1);
}
}
if (got_line) {
struct itimerval itv;
@ -381,7 +386,10 @@ void readline_curses::line_ready(const char *line)
snprintf(msg, sizeof(msg), "d:%s", expanded.in());
break;
}
write(this->rc_command_pipe[RCF_SLAVE], msg, strlen(msg));
if (write(this->rc_command_pipe[RCF_SLAVE], msg, strlen(msg)) == -1) {
perror("write failed");
exit(1);
}
}
void readline_curses::check_fd_set(fd_set &ready_rfds)
@ -442,7 +450,9 @@ void readline_curses::handle_key(int ch)
int len;
bch = this->map_input(ch, len);
write(this->rc_pty[RCF_MASTER], bch, len);
if (write(this->rc_pty[RCF_MASTER], bch, len) == -1) {
perror("write failed");
}
fprintf(stderr, "to child %d\n", bch[0]);
if (ch == '\t' || ch == '\r') {
this->vc_past_lines.clear();
@ -456,7 +466,11 @@ void readline_curses::focus(int context, const char *prompt)
this->rc_active_context = context;
snprintf(buffer, sizeof(buffer), "f:%d:%s", context, prompt);
write(this->rc_command_pipe[RCF_MASTER], buffer, strlen(buffer) + 1);
if (write(this->rc_command_pipe[RCF_MASTER],
buffer,
strlen(buffer) + 1) == -1) {
perror("write failed");
}
wmove(this->vc_window, this->get_actual_y(), 0);
wclrtoeol(this->vc_window);
}
@ -468,7 +482,11 @@ void readline_curses::add_possibility(int context, string type, string value)
snprintf(buffer, sizeof(buffer),
"ap:%d:%s:%s",
context, type.c_str(), value.c_str());
write(this->rc_command_pipe[RCF_MASTER], buffer, strlen(buffer) + 1);
if (write(this->rc_command_pipe[RCF_MASTER],
buffer,
strlen(buffer) + 1) == -1) {
perror("write failed");
}
}
void readline_curses::rem_possibility(int context, string type, string value)
@ -478,7 +496,11 @@ void readline_curses::rem_possibility(int context, string type, string value)
snprintf(buffer, sizeof(buffer),
"rp:%d:%s:%s",
context, type.c_str(), value.c_str());
write(this->rc_command_pipe[RCF_MASTER], buffer, strlen(buffer) + 1);
if (write(this->rc_command_pipe[RCF_MASTER],
buffer,
strlen(buffer) + 1) == -1) {
perror("write failed");
}
}
void readline_curses::do_update(void)

@ -64,7 +64,7 @@ public:
{
this->rc_possibilities[type].insert(value);
fprintf(stderr, "pos %d %p %s %s\n",
this->rc_possibilities[type].size(),
(int)this->rc_possibilities[type].size(),
&this->rc_possibilities[type],
type.c_str(),
value.c_str());

@ -109,13 +109,13 @@ public:
/** @param width The maximum display width, in characters. */
void set_width(int width) { this->sf_width = width; };
/** @param width The maximum display width, in characters. */
int get_width() { return this->sf_width; };
size_t get_width() { return this->sf_width; };
protected:
int sf_width; /*< The maximum display width, in chars. */
size_t sf_width; /*< The maximum display width, in chars. */
bool sf_right_justify;
bool sf_cylon;
int sf_cylon_pos;
size_t sf_cylon_pos;
attr_line_t sf_value; /*< The value to display for this field. */
view_colors::role_t sf_role; /*< The color role for this field. */
};

@ -45,7 +45,7 @@ public:
switch (str[matches[4]]) {
case 'm':
for (lpc = matches[2]; lpc != string::npos && lpc < matches[3];) {
for (lpc = matches[2]; lpc != (int)string::npos && lpc < matches[3];) {
int ansi_code = 0;
if (sscanf(&(str[lpc]), "%d", &ansi_code) == 1) {
@ -86,7 +86,7 @@ public:
}
}
lpc = str.find(";", lpc);
if (lpc != string::npos) {
if (lpc != (int)string::npos) {
lpc += 1;
}
}
@ -203,7 +203,7 @@ void textview_curses::listview_value_for_row(const listview_curses &lv,
iter++) {
int off, hcount = 0;
for (off = 0; off < str.size(); ) {
for (off = 0; off < (int)str.size(); ) {
int rc, matches[60];
rc = pcre_exec(iter->second.h_code,

@ -65,7 +65,7 @@ public:
}
};
view_colors::role_t get_role(int index)
view_colors::role_t get_role(unsigned int index)
{
view_colors &vc = view_colors::singleton();
view_colors::role_t retval;
@ -166,7 +166,7 @@ public:
{
bool retval = false;
if (line < this->tc_sub_source->text_line_count()) {
if (line < (int)this->tc_sub_source->text_line_count()) {
this->tc_sub_source->text_value_for_line(*this,
line,
value_out,

@ -44,7 +44,7 @@ void view_curses::mvwattrline(WINDOW *window,
if (lr.lr_start < (int)line.size()) {
waddnstr(window, &line.c_str()[lr.lr_start], line_width);
}
if (lr.lr_end > line.size())
if (lr.lr_end > (int)line.size())
whline(window, ' ', lr.lr_end - line.size());
wattroff(window, attrs);

@ -7,6 +7,7 @@
#include <assert.h>
#include <stdint.h>
#include <limits.h>
#include <ncurses.h>

@ -7,6 +7,7 @@
#include <assert.h>
#include <curses.h>
#include <unistd.h>
#include <string.h>
#include <map>

@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@ -255,6 +255,7 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
TESTS_ENVIRONMENT = $(SHELL) $(top_builddir)/TESTS_ENVIRONMENT
@ -364,8 +365,8 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
@ -640,7 +641,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@ -683,7 +684,7 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
list=' $(TESTS) '; \
if test -n "$$list"; then \
@ -694,7 +695,7 @@ check-TESTS: $(TESTS)
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*$$ws$$tst$$ws*) \
*[\ \ ]$$tst[\ \ ]*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
echo "XPASS: $$tst"; \
@ -706,7 +707,7 @@ check-TESTS: $(TESTS)
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*$$ws$$tst$$ws*) \
*[\ \ ]$$tst[\ \ ]*) \
xfail=`expr $$xfail + 1`; \
echo "XFAIL: $$tst"; \
;; \
@ -720,23 +721,36 @@ check-TESTS: $(TESTS)
echo "SKIP: $$tst"; \
fi; \
done; \
if test "$$all" -eq 1; then \
tests="test"; \
All=""; \
else \
tests="tests"; \
All="All "; \
fi; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="All $$all tests passed"; \
banner="$$All$$all $$tests passed"; \
else \
banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all tests failed"; \
banner="$$failed of $$all $$tests failed"; \
else \
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
skipped="($$skip tests were not run)"; \
if test "$$skip" -eq 1; then \
skipped="($$skip test was not run)"; \
else \
skipped="($$skip tests were not run)"; \
fi; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \

@ -7,6 +7,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <algorithm>

@ -4,6 +4,7 @@
#include <assert.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include "view_curses.hh"
#include "vt52_curses.hh"

@ -1 +1 @@
)07[?47hHello World!                         [?47l8 [?1l>
read 1b29301b371b5b3f3437681b5b313b3234721b5b6d1b5b346c1b5b481b5b324a48656c6c6f20202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b6d1b5b376d201b5b323b31481b5b6d576f726c6421202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020201b5b6d1b5b376d201b5b333b383048201b5b343b383048201b5b353b383048201b5b363b383048201b5b373b383048201b5b383b383048201b5b393b383048201b5b31303b383048201b5b31313b383048201b5b31323b383048201b5b31333b383048201b5b31343b383048201b5b31353b383048201b5b31363b383048201b5b31373b383048201b5b31383b383048201b5b31393b383048201b5b32303b383048201b5b32313b383048201b5b32323b383048201b5b32333b383048201b5b32343b3830480820081b5b34681b5b6d201b5b346c0d1b5b32343b31481b5b324a1b5b3f34376c1b380d1b5b3f316c1b3e

@ -1,9 +1,9 @@
#! /bin/sh
run_test ./scripty -- ./drive_listview < /dev/null
run_test ./scripty -n -e ${srcdir}/listview_output.0 -- \
./drive_listview < /dev/null
check_output "Listview doesn't match input?" < \
${srcdir}/listview_output.0
on_error_fail_with "listview output does not match?"
run_test ./scripty -- ./drive_listview -t 1 < /dev/null

Loading…
Cancel
Save