mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-01-02 12:27:09 +08:00
fix compiler warnings in libmdb/ util/ sql/
This commit is contained in:
@@ -103,7 +103,6 @@ void dump_kkd(gchar *kkd, int len)
|
||||
guint32 record_len, record_type;
|
||||
int pos = 0;
|
||||
GPtrArray *names = NULL;
|
||||
gchar *name;
|
||||
MdbProperties *props;
|
||||
|
||||
#ifdef MDB_DEBUG
|
||||
@@ -139,7 +138,7 @@ void dump_kkd(gchar *kkd, int len)
|
||||
printf("sequence error!\n");
|
||||
break;
|
||||
}
|
||||
props = mdb_read_props(names, &kkd[pos+6], record_len - 6);
|
||||
props = mdb_read_props(mdb, names, &kkd[pos+6], record_len - 6);
|
||||
printf("type 0x01 name %s\n", props->name ? props->name : "(none)");
|
||||
g_hash_table_foreach(props->hash, print_keyvalue, NULL);
|
||||
mdb_free_props(props);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "dmalloc.h"
|
||||
#endif
|
||||
|
||||
static char *santize_name(char *str, int santize);
|
||||
static char *sanitize_name(char *str, int sanitize);
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
@@ -101,7 +101,7 @@ main (int argc, char **argv)
|
||||
fprintf (stdout, "DROP TABLE %s%s;\n", namespace, sanitize_name(entry->object_name,s));
|
||||
|
||||
/* create the table */
|
||||
fprintf (stdout, "CREATE TABLE %s%s\n", sanitize_name(entry->object_name,s));
|
||||
fprintf (stdout, "CREATE TABLE %s%s\n", namespace, sanitize_name(entry->object_name,s));
|
||||
fprintf (stdout, " (\n");
|
||||
|
||||
table = mdb_read_table (entry);
|
||||
|
||||
@@ -101,10 +101,10 @@ void check_row(MdbHandle *mdb, MdbIndex *idx, guint32 pg, int row, unsigned char
|
||||
|
||||
fmt = mdb->fmt;
|
||||
mdb_read_pg(mdb, pg);
|
||||
row_start = mdb_get_int16(mdb, (fmt->row_count_offset + 2) + (row*2));
|
||||
row_start = mdb_pg_get_int16(mdb, (fmt->row_count_offset + 2) + (row*2));
|
||||
row_end = mdb_find_end_of_row(mdb, row);
|
||||
|
||||
num_fields = mdb_crack_row(table, row_start, row_end, &fields);
|
||||
num_fields = mdb_crack_row(table, row_start, row_end, fields);
|
||||
for (i=0;i<idx->num_keys;i++) {
|
||||
col=g_ptr_array_index(table->columns,idx->key_col_num[i]-1);
|
||||
if (col->col_type==MDB_TEXT) {
|
||||
@@ -146,14 +146,14 @@ walk_index(MdbHandle *mdb, MdbIndex *idx)
|
||||
|
||||
memset(&chain, 0, sizeof(MdbIndexChain));
|
||||
printf("name %s\n", idx->name);
|
||||
printf("root page %ld\n", idx->first_pg);
|
||||
printf("root page %lu\n", (long unsigned) idx->first_pg);
|
||||
/* clone the handle to search the index, and use the original to read
|
||||
* the data */
|
||||
mdbidx = mdb_clone_handle(mdb);
|
||||
mdb_read_pg(mdbidx, idx->first_pg);
|
||||
//printf("page type %02x %s\n", mdbidx->pg_buf[0], page_name(mdbidx->pg_buf[0]));
|
||||
while (mdb_index_find_next(mdbidx, idx, &chain, &pg, &row)) {
|
||||
printf("row = %d pg = %lu\n", row, pg);
|
||||
printf("row = %d pg = %lu\n", row, (long unsigned) pg);
|
||||
check_row(mdb, idx, pg, row, &mdbidx->pg_buf[start], len - 4);
|
||||
}
|
||||
mdb_close(mdbidx);
|
||||
|
||||
Reference in New Issue
Block a user