Commit b93b2eec authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

The PRI macros actually seemed the cleanest way to fix this. Fixed #38.


git-svn-id: file:///svn/tokudb@758 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2f633ea1
...@@ -46,7 +46,7 @@ BINS = $(REGRESSION_TESTS) \ ...@@ -46,7 +46,7 @@ BINS = $(REGRESSION_TESTS) \
# This line intentially kept commented so I can have a \ on the end of the previous line # This line intentially kept commented so I can have a \ on the end of the previous line
tdb_logprint: LDFLAGS+=-lz tdb_logprint: LDFLAGS+=-lz
tdb_logprint: log-internal.h brttypes.h yerror.h log.h kv-pair.h tdb_logprint.o: log-internal.h brttypes.h yerror.h log.h kv-pair.h
tdb_logprint: log_code.o memory.o log.o brt-serialize.o hashtable.o pma.o ybt.o fingerprint.o mempool.o primes.o tdb_logprint: log_code.o memory.o log.o brt-serialize.o hashtable.o pma.o ybt.o fingerprint.o mempool.o primes.o
recover: LDFLAGS+=-lz recover: LDFLAGS+=-lz
......
...@@ -22,16 +22,17 @@ ...@@ -22,16 +22,17 @@
* *
*/ */
#include "brt-internal.h"
#include "key.h"
#include "log_header.h"
#include <stdlib.h>
#include <assert.h> #include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <stdio.h>
#include <errno.h> #include "brt-internal.h"
#include "key.h"
#include "log_header.h"
extern long long n_items_malloced; extern long long n_items_malloced;
...@@ -1456,7 +1457,7 @@ static int setup_brt_root_node (BRT t, DISKOFF offset, TOKUTXN txn) { ...@@ -1456,7 +1457,7 @@ static int setup_brt_root_node (BRT t, DISKOFF offset, TOKUTXN txn) {
toku_log_newbrtnode(txn, toku_txn_get_txnid(txn), toku_cachefile_filenum(t->cf), offset, 0, t->h->nodesize, (t->flags&TOKU_DB_DUPSORT)!=0, node->rand4fingerprint); toku_log_newbrtnode(txn, toku_txn_get_txnid(txn), toku_cachefile_filenum(t->cf), offset, 0, t->h->nodesize, (t->flags&TOKU_DB_DUPSORT)!=0, node->rand4fingerprint);
if (txn) { if (txn) {
node->log_lsn = toku_txn_get_last_lsn(txn); node->log_lsn = toku_txn_get_last_lsn(txn);
fprintf(stderr, "%s:%d last lsn=%llu\n", __FILE__, __LINE__, node->log_lsn.lsn); fprintf(stderr, "%s:%d last lsn=%" PRId64 "\n", __FILE__, __LINE__, node->log_lsn.lsn);
} }
r=toku_cachetable_unpin(t->cf, node->thisnodename, node->dirty, brtnode_size(node)); r=toku_cachetable_unpin(t->cf, node->thisnodename, node->dirty, brtnode_size(node));
if (r!=0) { if (r!=0) {
......
#include <arpa/inet.h> #include <arpa/inet.h>
#include <ctype.h> #include <ctype.h>
#include <unistd.h>
#include <dirent.h> #include <dirent.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/uio.h> #include <sys/uio.h>
#include <unistd.h>
#include "brt-internal.h" #include "brt-internal.h"
#include "log-internal.h" #include "log-internal.h"
...@@ -488,14 +489,14 @@ int toku_logprint_LSN (FILE *outf, FILE *inf, const char *fieldname, u_int32_t * ...@@ -488,14 +489,14 @@ int toku_logprint_LSN (FILE *outf, FILE *inf, const char *fieldname, u_int32_t *
LSN v; LSN v;
int r = toku_fread_LSN(inf, &v, crc, len); int r = toku_fread_LSN(inf, &v, crc, len);
if (r!=0) return r; if (r!=0) return r;
fprintf(outf, " %s=%lld", fieldname, v.lsn); fprintf(outf, " %s=%" PRId64, fieldname, v.lsn);
return 0; return 0;
} }
int toku_logprint_TXNID (FILE *outf, FILE *inf, const char *fieldname, u_int32_t *crc, u_int32_t *len) { int toku_logprint_TXNID (FILE *outf, FILE *inf, const char *fieldname, u_int32_t *crc, u_int32_t *len) {
TXNID v; TXNID v;
int r = toku_fread_TXNID(inf, &v, crc, len); int r = toku_fread_TXNID(inf, &v, crc, len);
if (r!=0) return r; if (r!=0) return r;
fprintf(outf, " %s=%lld", fieldname, v); fprintf(outf, " %s=%" PRId64, fieldname, v);
return 0; return 0;
} }
......
/* Dump the log from stdin to stdout. */ /* Dump the log from stdin to stdout. */
#include <arpa/inet.h> #include <arpa/inet.h>
#include <stdio.h> #include <assert.h>
#include <sys/types.h>
#include <ctype.h> #include <ctype.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h>
#include <zlib.h> #include <zlib.h>
#include <assert.h>
#include "brttypes.h" #include "brttypes.h"
#include "log-internal.h" #include "log-internal.h"
...@@ -113,14 +114,14 @@ void transcribe_header (void) { ...@@ -113,14 +114,14 @@ void transcribe_header (void) {
printf(" {size=%d", get_uint32()); printf(" {size=%d", get_uint32());
printf(" flags=%d", get_uint32()); printf(" flags=%d", get_uint32());
printf(" nodesize=%d", get_uint32()); printf(" nodesize=%d", get_uint32());
printf(" freelist=%lld", get_uint64()); printf(" freelist=%" PRId64, get_uint64());
printf(" unused_memory=%lld",get_uint64()); printf(" unused_memory=%" PRId64,get_uint64());
int n_roots=get_uint32(); int n_roots=get_uint32();
printf(" n_named_roots=%d", n_roots); printf(" n_named_roots=%d", n_roots);
if (n_roots>0) { if (n_roots>0) {
abort(); abort();
} else { } else {
printf(" root=%lld", get_uint64()); printf(" root=%" PRId64, get_uint64());
} }
printf("}"); printf("}");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment