mirror of
https://github.com/tstack/lnav
synced 2024-11-01 21:40:34 +00:00
[build] fix some types
This commit is contained in:
parent
b4577c985b
commit
8e3eb41362
@ -14,6 +14,9 @@ env:
|
||||
# via the "travis encrypt" command using the project repo's public key
|
||||
- secure: "P3wQLswiGYWrZwO4bxFmsA4XG5s/pS+renL0RMeotMTQwQQXmy1ZCvwMnAgaYWQmF82fN8WjuhO3OX0gpDbydxRktqI5ZqblsryV6poB0g+OkCqThbDUp3TL6TjPqySTI1CZ8qoOBYFMubAZYVJAEfxl0UxoQE+uTsRarRqr8rI="
|
||||
|
||||
cache:
|
||||
apt: true
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
|
@ -124,20 +124,20 @@ CREATE TABLE lnav_views (
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
int delete_row(sqlite3_vtab *tab, int64_t rowid) {
|
||||
int delete_row(sqlite3_vtab *tab, sqlite3_int64 rowid) {
|
||||
tab->zErrMsg = sqlite3_mprintf(
|
||||
"Rows cannot be deleted from the lnav_views table");
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
|
||||
int insert_row(sqlite3_vtab *tab, int64_t &rowid_out) {
|
||||
int insert_row(sqlite3_vtab *tab, sqlite3_int64 &rowid_out) {
|
||||
tab->zErrMsg = sqlite3_mprintf(
|
||||
"Rows cannot be inserted into the lnav_views table");
|
||||
return SQLITE_ERROR;
|
||||
};
|
||||
|
||||
int update_row(sqlite3_vtab *tab,
|
||||
int64_t &index,
|
||||
sqlite3_int64 &index,
|
||||
const char *name,
|
||||
int64_t top_row,
|
||||
int64_t left,
|
||||
@ -212,7 +212,7 @@ CREATE TABLE lnav_view_stack (
|
||||
return SQLITE_OK;
|
||||
};
|
||||
|
||||
int delete_row(sqlite3_vtab *tab, int64_t rowid) {
|
||||
int delete_row(sqlite3_vtab *tab, sqlite3_int64 rowid) {
|
||||
if (rowid != lnav_data.ld_view_stack.size() - 1) {
|
||||
tab->zErrMsg = sqlite3_mprintf(
|
||||
"Only the top view in the stack can be deleted");
|
||||
@ -232,7 +232,7 @@ CREATE TABLE lnav_view_stack (
|
||||
};
|
||||
|
||||
int insert_row(sqlite3_vtab *tab,
|
||||
int64_t &rowid_out,
|
||||
sqlite3_int64 &rowid_out,
|
||||
const char *name) {
|
||||
if (name == nullptr) {
|
||||
tab->zErrMsg = sqlite3_mprintf("'name' cannot be null");
|
||||
@ -261,7 +261,7 @@ CREATE TABLE lnav_view_stack (
|
||||
return SQLITE_OK;
|
||||
};
|
||||
|
||||
int update_row(sqlite3_vtab *tab, int64_t &index) {
|
||||
int update_row(sqlite3_vtab *tab, sqlite3_int64 &index) {
|
||||
tab->zErrMsg = sqlite3_mprintf(
|
||||
"The lnav_view_stack table cannot be updated");
|
||||
return SQLITE_ERROR;
|
||||
|
@ -78,16 +78,16 @@ struct vtab_module {
|
||||
};
|
||||
|
||||
template<typename ... Args, size_t... Idx>
|
||||
static int apply_impl(T &obj, int (T::*func)(sqlite3_vtab *, int64_t &, Args...), sqlite3_vtab *tab, int64_t &rowid, sqlite3_value **argv, std::index_sequence<Idx...>)
|
||||
static int apply_impl(T &obj, int (T::*func)(sqlite3_vtab *, sqlite3_int64 &, Args...), sqlite3_vtab *tab, sqlite3_int64 &rowid, sqlite3_value **argv, std::index_sequence<Idx...>)
|
||||
{
|
||||
return (obj.*func)(tab, rowid, from_sqlite<Args>(argv[Idx])...);
|
||||
}
|
||||
|
||||
template<typename ... Args>
|
||||
static int apply(T &obj,
|
||||
int (T::*func)(sqlite3_vtab *, int64_t &, Args...),
|
||||
int (T::*func)(sqlite3_vtab *, sqlite3_int64 &, Args...),
|
||||
sqlite3_vtab *tab,
|
||||
int64_t &rowid,
|
||||
sqlite3_int64 &rowid,
|
||||
int argc,
|
||||
sqlite3_value **argv)
|
||||
{
|
||||
@ -175,17 +175,17 @@ struct vtab_module {
|
||||
T handler;
|
||||
|
||||
if (argc <= 1) {
|
||||
int64_t rowid = sqlite3_value_int64(argv[0]);
|
||||
sqlite3_int64 rowid = sqlite3_value_int64(argv[0]);
|
||||
|
||||
return handler.delete_row(tab, rowid);
|
||||
}
|
||||
|
||||
if (sqlite3_value_type(argv[0]) == SQLITE_NULL) {
|
||||
int64_t *rowid2 = rowid;
|
||||
sqlite3_int64 *rowid2 = rowid;
|
||||
return vtab_module<T>::apply(handler, &T::insert_row, tab, *rowid2, argc - 2, argv + 2);
|
||||
}
|
||||
|
||||
int64_t index = sqlite3_value_int64(argv[0]);
|
||||
sqlite3_int64 index = sqlite3_value_int64(argv[0]);
|
||||
|
||||
if (index != sqlite3_value_int64(argv[1])) {
|
||||
tab->zErrMsg = sqlite3_mprintf(
|
||||
@ -264,19 +264,19 @@ struct tvt_iterator_cursor {
|
||||
|
||||
template<typename T>
|
||||
struct tvt_no_update : public T {
|
||||
int delete_row(sqlite3_vtab *vt, int64_t rowid) {
|
||||
int delete_row(sqlite3_vtab *vt, sqlite3_int64 rowid) {
|
||||
vt->zErrMsg = sqlite3_mprintf(
|
||||
"Rows cannot be deleted from this table");
|
||||
return SQLITE_ERROR;
|
||||
};
|
||||
|
||||
int insert_row(sqlite3_vtab *tab, int64_t &rowid_out) {
|
||||
int insert_row(sqlite3_vtab *tab, sqlite3_int64 &rowid_out) {
|
||||
tab->zErrMsg = sqlite3_mprintf(
|
||||
"Rows cannot be inserted into this table");
|
||||
return SQLITE_ERROR;
|
||||
};
|
||||
|
||||
int update_row(sqlite3_vtab *tab, int64_t &rowid_out) {
|
||||
int update_row(sqlite3_vtab *tab, sqlite3_int64 &rowid_out) {
|
||||
tab->zErrMsg = sqlite3_mprintf(
|
||||
"Rows cannot be update in this table");
|
||||
return SQLITE_ERROR;
|
||||
|
Loading…
Reference in New Issue
Block a user