diff --git a/buildheader/db-4.6.19.h b/buildheader/db-4.6.19.h
index 50dea55f6bab21c5916ef4ce3c399088ff8c5139..f220e06390cd4fc7fa4a3518b493d8c6d5daadb2 100644
--- a/buildheader/db-4.6.19.h
+++ b/buildheader/db-4.6.19.h
@@ -115,14 +115,14 @@ typedef int64_t db_seq_t;
 typedef pthread_t db_threadid_t;
 
 /* Basic types that are exported or quasi-exported. */
-typedef	u_int32_t	db_pgno_t;	/* Page number type. */
-typedef	u_int16_t	db_indx_t;	/* Page offset type. */
+typedef	uint32_t	db_pgno_t;	/* Page number type. */
+typedef	uint16_t	db_indx_t;	/* Page offset type. */
 #define	DB_MAX_PAGES	0xffffffff	/* >= # of pages in a file */
 
-typedef	u_int32_t	db_recno_t;	/* Record number type. */
+typedef	uint32_t	db_recno_t;	/* Record number type. */
 #define	DB_MAX_RECORDS	0xffffffff	/* >= # of records in a tree */
 
-typedef u_int32_t	db_timeout_t;	/* Type of a timeout. */
+typedef uint32_t	db_timeout_t;	/* Type of a timeout. */
 
 /*
  * Region offsets are the difference between a pointer in a region and the
@@ -187,11 +187,11 @@ struct __mpoolfile;	typedef struct __mpoolfile MPOOLFILE;
 /* Key/data structure -- a Data-Base Thang. */
 struct __db_dbt {
 	void	 *data;			/* Key/data */
-	u_int32_t size;			/* key/data length */
+	uint32_t size;			/* key/data length */
 
-	u_int32_t ulen;			/* RO: length of user buffer. */
-	u_int32_t dlen;			/* RO: get/put record length. */
-	u_int32_t doff;			/* RO: get/put record offset. */
+	uint32_t ulen;			/* RO: length of user buffer. */
+	uint32_t dlen;			/* RO: get/put record length. */
+	uint32_t doff;			/* RO: get/put record offset. */
 
 	void *app_data;
 
@@ -204,7 +204,7 @@ struct __db_dbt {
 #define	DB_DBT_REALLOC		0x040	/* Return in realloc'd memory. */
 #define	DB_DBT_USERCOPY		0x080	/* Use the user-supplied callback. */
 #define	DB_DBT_USERMEM		0x100	/* Return in user's memory. */
-	u_int32_t flags;
+	uint32_t flags;
 };
 
 /*
@@ -432,7 +432,7 @@ struct __db_dbt {
 /*******************************************************
  * Mutexes.
  *******************************************************/
-typedef u_int32_t	db_mutex_t;
+typedef uint32_t	db_mutex_t;
 
 /*
  * Flag arguments for DbEnv.mutex_alloc, DbEnv.is_alive and for the
@@ -446,17 +446,17 @@ typedef u_int32_t	db_mutex_t;
 
 struct __db_mutex_stat {
 	/* The following fields are maintained in the region's copy. */
-	u_int32_t st_mutex_align;	/* Mutex alignment */
-	u_int32_t st_mutex_tas_spins;	/* Mutex test-and-set spins */
-	u_int32_t st_mutex_cnt;		/* Mutex count */
-	u_int32_t st_mutex_free;	/* Available mutexes */
-	u_int32_t st_mutex_inuse;	/* Mutexes in use */
-	u_int32_t st_mutex_inuse_max;	/* Maximum mutexes ever in use */
+	uint32_t st_mutex_align;	/* Mutex alignment */
+	uint32_t st_mutex_tas_spins;	/* Mutex test-and-set spins */
+	uint32_t st_mutex_cnt;		/* Mutex count */
+	uint32_t st_mutex_free;	/* Available mutexes */
+	uint32_t st_mutex_inuse;	/* Mutexes in use */
+	uint32_t st_mutex_inuse_max;	/* Maximum mutexes ever in use */
 
 	/* The following fields are filled-in from other places. */
 #ifndef __TEST_DB_NO_STATISTICS
-	u_int32_t st_region_wait;	/* Region lock granted after wait. */
-	u_int32_t st_region_nowait;	/* Region lock granted without wait. */
+	uint32_t st_region_wait;	/* Region lock granted after wait. */
+	uint32_t st_region_nowait;	/* Region lock granted without wait. */
 	roff_t	  st_regsize;		/* Region size. */
 #endif
 };
@@ -552,53 +552,53 @@ typedef enum  {
 
 /* Lock statistics structure. */
 struct __db_lock_stat {
-	u_int32_t st_id;		/* Last allocated locker ID. */
-	u_int32_t st_cur_maxid;		/* Current maximum unused ID. */
-	u_int32_t st_maxlocks;		/* Maximum number of locks in table. */
-	u_int32_t st_maxlockers;	/* Maximum num of lockers in table. */
-	u_int32_t st_maxobjects;	/* Maximum num of objects in table. */
+	uint32_t st_id;		/* Last allocated locker ID. */
+	uint32_t st_cur_maxid;		/* Current maximum unused ID. */
+	uint32_t st_maxlocks;		/* Maximum number of locks in table. */
+	uint32_t st_maxlockers;	/* Maximum num of lockers in table. */
+	uint32_t st_maxobjects;	/* Maximum num of objects in table. */
 	int	  st_nmodes;		/* Number of lock modes. */
-	u_int32_t st_nlockers;		/* Current number of lockers. */
+	uint32_t st_nlockers;		/* Current number of lockers. */
 #ifndef __TEST_DB_NO_STATISTICS
-	u_int32_t st_nlocks;		/* Current number of locks. */
-	u_int32_t st_maxnlocks;		/* Maximum number of locks so far. */
-	u_int32_t st_maxnlockers;	/* Maximum number of lockers so far. */
-	u_int32_t st_nobjects;		/* Current number of objects. */
-	u_int32_t st_maxnobjects;	/* Maximum number of objects so far. */
-	u_int32_t st_nrequests;		/* Number of lock gets. */
-	u_int32_t st_nreleases;		/* Number of lock puts. */
-	u_int32_t st_nupgrade;		/* Number of lock upgrades. */
-	u_int32_t st_ndowngrade;	/* Number of lock downgrades. */
-	u_int32_t st_lock_wait;		/* Lock conflicts w/ subsequent wait */
-	u_int32_t st_lock_nowait;	/* Lock conflicts w/o subsequent wait */
-	u_int32_t st_ndeadlocks;	/* Number of lock deadlocks. */
+	uint32_t st_nlocks;		/* Current number of locks. */
+	uint32_t st_maxnlocks;		/* Maximum number of locks so far. */
+	uint32_t st_maxnlockers;	/* Maximum number of lockers so far. */
+	uint32_t st_nobjects;		/* Current number of objects. */
+	uint32_t st_maxnobjects;	/* Maximum number of objects so far. */
+	uint32_t st_nrequests;		/* Number of lock gets. */
+	uint32_t st_nreleases;		/* Number of lock puts. */
+	uint32_t st_nupgrade;		/* Number of lock upgrades. */
+	uint32_t st_ndowngrade;	/* Number of lock downgrades. */
+	uint32_t st_lock_wait;		/* Lock conflicts w/ subsequent wait */
+	uint32_t st_lock_nowait;	/* Lock conflicts w/o subsequent wait */
+	uint32_t st_ndeadlocks;	/* Number of lock deadlocks. */
 	db_timeout_t st_locktimeout;	/* Lock timeout. */
-	u_int32_t st_nlocktimeouts;	/* Number of lock timeouts. */
+	uint32_t st_nlocktimeouts;	/* Number of lock timeouts. */
 	db_timeout_t st_txntimeout;	/* Transaction timeout. */
-	u_int32_t st_ntxntimeouts;	/* Number of transaction timeouts. */
-	u_int32_t st_objs_wait;		/* Object lock granted after wait. */
-	u_int32_t st_objs_nowait;	/* Object lock granted without wait. */
-	u_int32_t st_lockers_wait;	/* Locker lock granted after wait. */
-	u_int32_t st_lockers_nowait;	/* Locker lock granted without wait. */
-	u_int32_t st_locks_wait;	/* Lock lock granted after wait. */
-	u_int32_t st_locks_nowait;	/* Lock lock granted without wait. */
-	u_int32_t st_region_wait;	/* Region lock granted after wait. */
-	u_int32_t st_region_nowait;	/* Region lock granted without wait. */
-	u_int32_t st_hash_len;		/* Max length of bucket. */
+	uint32_t st_ntxntimeouts;	/* Number of transaction timeouts. */
+	uint32_t st_objs_wait;		/* Object lock granted after wait. */
+	uint32_t st_objs_nowait;	/* Object lock granted without wait. */
+	uint32_t st_lockers_wait;	/* Locker lock granted after wait. */
+	uint32_t st_lockers_nowait;	/* Locker lock granted without wait. */
+	uint32_t st_locks_wait;	/* Lock lock granted after wait. */
+	uint32_t st_locks_nowait;	/* Lock lock granted without wait. */
+	uint32_t st_region_wait;	/* Region lock granted after wait. */
+	uint32_t st_region_nowait;	/* Region lock granted without wait. */
+	uint32_t st_hash_len;		/* Max length of bucket. */
 	roff_t	  st_regsize;		/* Region size. */
 #endif
 };
 
 struct __db_lock_hstat {
-	u_int32_t st_nrequests;		/* Number of lock gets. */
-	u_int32_t st_nreleases;		/* Number of lock puts. */
-	u_int32_t st_nupgrade;		/* Number of lock upgrades. */
-	u_int32_t st_ndowngrade;	/* Number of lock downgrades. */
-	u_int32_t st_lock_wait;		/* Lock conflicts w/ subsequent wait */
-	u_int32_t st_lock_nowait;	/* Lock conflicts w/o subsequent wait */
-	u_int32_t st_nlocktimeouts;	/* Number of lock timeouts. */
-	u_int32_t st_ntxntimeouts;	/* Number of transaction timeouts. */
-	u_int32_t st_hash_len;		/* Max length of bucket. */
+	uint32_t st_nrequests;		/* Number of lock gets. */
+	uint32_t st_nreleases;		/* Number of lock puts. */
+	uint32_t st_nupgrade;		/* Number of lock upgrades. */
+	uint32_t st_ndowngrade;	/* Number of lock downgrades. */
+	uint32_t st_lock_wait;		/* Lock conflicts w/ subsequent wait */
+	uint32_t st_lock_nowait;	/* Lock conflicts w/o subsequent wait */
+	uint32_t st_nlocktimeouts;	/* Number of lock timeouts. */
+	uint32_t st_ntxntimeouts;	/* Number of transaction timeouts. */
+	uint32_t st_hash_len;		/* Max length of bucket. */
 };
 
 /*
@@ -607,11 +607,11 @@ struct __db_lock_hstat {
  */
 struct __db_ilock {
 	db_pgno_t pgno;			/* Page being locked. */
-	u_int8_t fileid[DB_FILE_ID_LEN];/* File id. */
+	uint8_t fileid[DB_FILE_ID_LEN];/* File id. */
 #define	DB_HANDLE_LOCK	1
 #define	DB_RECORD_LOCK	2
 #define	DB_PAGE_LOCK	3
-	u_int32_t type;			/* Type of lock. */
+	uint32_t type;			/* Type of lock. */
 };
 
 /*
@@ -621,9 +621,9 @@ struct __db_ilock {
  */
 struct __db_lock_u {
 	roff_t		off;		/* Offset of the lock in the region */
-	u_int32_t	ndx;		/* Index of the object referenced by
+	uint32_t	ndx;		/* Index of the object referenced by
 					 * this lock; used for locking. */
-	u_int32_t	gen;		/* Generation number of this lock. */
+	uint32_t	gen;		/* Generation number of this lock. */
 	db_lockmode_t	mode;		/* mode of this lock. */
 };
 
@@ -667,15 +667,15 @@ struct __db_lockreq {
  * offset is reached.
  */
 struct __db_lsn {
-	u_int32_t	file;		/* File ID. */
-	u_int32_t	offset;		/* File offset. */
+	uint32_t	file;		/* File ID. */
+	uint32_t	offset;		/* File offset. */
 };
 
 /*
  * Application-specified log record types start at DB_user_BEGIN, and must not
  * equal or exceed DB_debug_FLAG.
  *
- * DB_debug_FLAG is the high-bit of the u_int32_t that specifies a log record
+ * DB_debug_FLAG is the high-bit of the uint32_t that specifies a log record
  * type.  If the flag is set, it's a log record that was logged for debugging
  * purposes only, even if it reflects a database change -- the change was part
  * of a non-durable transaction.
@@ -692,57 +692,57 @@ struct __db_log_cursor {
 
 	DB_FH	 *fhp;			/* File handle. */
 	DB_LSN	  lsn;			/* Cursor: LSN */
-	u_int32_t len;			/* Cursor: record length */
-	u_int32_t prev;			/* Cursor: previous record's offset */
+	uint32_t len;			/* Cursor: record length */
+	uint32_t prev;			/* Cursor: previous record's offset */
 
 	DBT	  dbt;			/* Return DBT. */
 	DB_LSN    p_lsn;		/* Persist LSN. */
-	u_int32_t p_version;		/* Persist version. */
+	uint32_t p_version;		/* Persist version. */
 
-	u_int8_t *bp;			/* Allocated read buffer. */
-	u_int32_t bp_size;		/* Read buffer length in bytes. */
-	u_int32_t bp_rlen;		/* Read buffer valid data length. */
+	uint8_t *bp;			/* Allocated read buffer. */
+	uint32_t bp_size;		/* Read buffer length in bytes. */
+	uint32_t bp_rlen;		/* Read buffer valid data length. */
 	DB_LSN	  bp_lsn;		/* Read buffer first byte LSN. */
 
-	u_int32_t bp_maxrec;		/* Max record length in the log file. */
+	uint32_t bp_maxrec;		/* Max record length in the log file. */
 
 	/* DB_LOGC PUBLIC HANDLE LIST BEGIN */
-	int (*close) __P((DB_LOGC *, u_int32_t));
-	int (*get) __P((DB_LOGC *, DB_LSN *, DBT *, u_int32_t));
-	int (*version) __P((DB_LOGC *, u_int32_t *, u_int32_t));
+	int (*close) __P((DB_LOGC *, uint32_t));
+	int (*get) __P((DB_LOGC *, DB_LSN *, DBT *, uint32_t));
+	int (*version) __P((DB_LOGC *, uint32_t *, uint32_t));
 	/* DB_LOGC PUBLIC HANDLE LIST END */
 
 #define	DB_LOG_DISK		0x01	/* Log record came from disk. */
 #define	DB_LOG_LOCKED		0x02	/* Log region already locked */
 #define	DB_LOG_SILENT_ERR	0x04	/* Turn-off error messages. */
-	u_int32_t flags;
+	uint32_t flags;
 };
 
 /* Log statistics structure. */
 struct __db_log_stat {
-	u_int32_t st_magic;		/* Log file magic number. */
-	u_int32_t st_version;		/* Log file version number. */
+	uint32_t st_magic;		/* Log file magic number. */
+	uint32_t st_version;		/* Log file version number. */
 	int	  st_mode;		/* Log file permissions mode. */
-	u_int32_t st_lg_bsize;		/* Log buffer size. */
-	u_int32_t st_lg_size;		/* Log file size. */
-	u_int32_t st_wc_bytes;		/* Bytes to log since checkpoint. */
-	u_int32_t st_wc_mbytes;		/* Megabytes to log since checkpoint. */
+	uint32_t st_lg_bsize;		/* Log buffer size. */
+	uint32_t st_lg_size;		/* Log file size. */
+	uint32_t st_wc_bytes;		/* Bytes to log since checkpoint. */
+	uint32_t st_wc_mbytes;		/* Megabytes to log since checkpoint. */
 #ifndef __TEST_DB_NO_STATISTICS
-	u_int32_t st_record;		/* Records entered into the log. */
-	u_int32_t st_w_bytes;		/* Bytes to log. */
-	u_int32_t st_w_mbytes;		/* Megabytes to log. */
-	u_int32_t st_wcount;		/* Total I/O writes to the log. */
-	u_int32_t st_wcount_fill;	/* Overflow writes to the log. */
-	u_int32_t st_rcount;		/* Total I/O reads from the log. */
-	u_int32_t st_scount;		/* Total syncs to the log. */
-	u_int32_t st_region_wait;	/* Region lock granted after wait. */
-	u_int32_t st_region_nowait;	/* Region lock granted without wait. */
-	u_int32_t st_cur_file;		/* Current log file number. */
-	u_int32_t st_cur_offset;	/* Current log file offset. */
-	u_int32_t st_disk_file;		/* Known on disk log file number. */
-	u_int32_t st_disk_offset;	/* Known on disk log file offset. */
-	u_int32_t st_maxcommitperflush;	/* Max number of commits in a flush. */
-	u_int32_t st_mincommitperflush;	/* Min number of commits in a flush. */
+	uint32_t st_record;		/* Records entered into the log. */
+	uint32_t st_w_bytes;		/* Bytes to log. */
+	uint32_t st_w_mbytes;		/* Megabytes to log. */
+	uint32_t st_wcount;		/* Total I/O writes to the log. */
+	uint32_t st_wcount_fill;	/* Overflow writes to the log. */
+	uint32_t st_rcount;		/* Total I/O reads from the log. */
+	uint32_t st_scount;		/* Total syncs to the log. */
+	uint32_t st_region_wait;	/* Region lock granted after wait. */
+	uint32_t st_region_nowait;	/* Region lock granted without wait. */
+	uint32_t st_cur_file;		/* Current log file number. */
+	uint32_t st_cur_offset;	/* Current log file offset. */
+	uint32_t st_disk_file;		/* Known on disk log file number. */
+	uint32_t st_disk_offset;	/* Known on disk log file offset. */
+	uint32_t st_maxcommitperflush;	/* Max number of commits in a flush. */
+	uint32_t st_mincommitperflush;	/* Min number of commits in a flush. */
 	roff_t	  st_regsize;		/* Region size. */
 #endif
 };
@@ -793,9 +793,9 @@ struct __db_mpoolfile {
 	 * !!!
 	 * The ref, pinref and q fields are protected by the region lock.
 	 */
-	u_int32_t  ref;			/* Reference count. */
+	uint32_t  ref;			/* Reference count. */
 
-	u_int32_t pinref;		/* Pinned block reference count. */
+	uint32_t pinref;		/* Pinned block reference count. */
 
 	/*
 	 * !!!
@@ -820,41 +820,41 @@ struct __db_mpoolfile {
 	DB_ENV	       *dbenv;		/* Overlying DB_ENV. */
 	MPOOLFILE      *mfp;		/* Underlying MPOOLFILE. */
 
-	u_int32_t	clear_len;	/* Cleared length on created pages. */
-	u_int8_t			/* Unique file ID. */
+	uint32_t	clear_len;	/* Cleared length on created pages. */
+	uint8_t			/* Unique file ID. */
 			fileid[DB_FILE_ID_LEN];
 	int		ftype;		/* File type. */
 	int32_t		lsn_offset;	/* LSN offset in page. */
-	u_int32_t	gbytes, bytes;	/* Maximum file size. */
+	uint32_t	gbytes, bytes;	/* Maximum file size. */
 	DBT	       *pgcookie;	/* Byte-string passed to pgin/pgout. */
 	int32_t		priority;	/* Cache priority. */
 
 	void	       *addr;		/* Address of mmap'd region. */
 	size_t		len;		/* Length of mmap'd region. */
 
-	u_int32_t	config_flags;	/* Flags to DB_MPOOLFILE->set_flags. */
+	uint32_t	config_flags;	/* Flags to DB_MPOOLFILE->set_flags. */
 
 	/* DB_MPOOLFILE PUBLIC HANDLE LIST BEGIN */
-	int (*close) __P((DB_MPOOLFILE *, u_int32_t));
+	int (*close) __P((DB_MPOOLFILE *, uint32_t));
 	int (*get)
-	    __P((DB_MPOOLFILE *, db_pgno_t *, DB_TXN *, u_int32_t, void *));
-	int (*get_clear_len) __P((DB_MPOOLFILE *, u_int32_t *));
-	int (*get_fileid) __P((DB_MPOOLFILE *, u_int8_t *));
-	int (*get_flags) __P((DB_MPOOLFILE *, u_int32_t *));
+	    __P((DB_MPOOLFILE *, db_pgno_t *, DB_TXN *, uint32_t, void *));
+	int (*get_clear_len) __P((DB_MPOOLFILE *, uint32_t *));
+	int (*get_fileid) __P((DB_MPOOLFILE *, uint8_t *));
+	int (*get_flags) __P((DB_MPOOLFILE *, uint32_t *));
 	int (*get_ftype) __P((DB_MPOOLFILE *, int *));
 	int (*get_last_pgno) __P((DB_MPOOLFILE *, db_pgno_t *));
 	int (*get_lsn_offset) __P((DB_MPOOLFILE *, int32_t *));
-	int (*get_maxsize) __P((DB_MPOOLFILE *, u_int32_t *, u_int32_t *));
+	int (*get_maxsize) __P((DB_MPOOLFILE *, uint32_t *, uint32_t *));
 	int (*get_pgcookie) __P((DB_MPOOLFILE *, DBT *));
 	int (*get_priority) __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY *));
-	int (*open) __P((DB_MPOOLFILE *, const char *, u_int32_t, int, size_t));
-	int (*put) __P((DB_MPOOLFILE *, void *, DB_CACHE_PRIORITY, u_int32_t));
-	int (*set_clear_len) __P((DB_MPOOLFILE *, u_int32_t));
-	int (*set_fileid) __P((DB_MPOOLFILE *, u_int8_t *));
-	int (*set_flags) __P((DB_MPOOLFILE *, u_int32_t, int));
+	int (*open) __P((DB_MPOOLFILE *, const char *, uint32_t, int, size_t));
+	int (*put) __P((DB_MPOOLFILE *, void *, DB_CACHE_PRIORITY, uint32_t));
+	int (*set_clear_len) __P((DB_MPOOLFILE *, uint32_t));
+	int (*set_fileid) __P((DB_MPOOLFILE *, uint8_t *));
+	int (*set_flags) __P((DB_MPOOLFILE *, uint32_t, int));
 	int (*set_ftype) __P((DB_MPOOLFILE *, int));
 	int (*set_lsn_offset) __P((DB_MPOOLFILE *, int32_t));
-	int (*set_maxsize) __P((DB_MPOOLFILE *, u_int32_t, u_int32_t));
+	int (*set_maxsize) __P((DB_MPOOLFILE *, uint32_t, uint32_t));
 	int (*set_pgcookie) __P((DB_MPOOLFILE *, DBT *));
 	int (*set_priority) __P((DB_MPOOLFILE *, DB_CACHE_PRIORITY));
 	int (*sync) __P((DB_MPOOLFILE *));
@@ -873,51 +873,51 @@ struct __db_mpoolfile {
 #define	MP_MULTIVERSION	0x004		/* Opened for multiversion access. */
 #define	MP_OPEN_CALLED	0x008		/* File opened. */
 #define	MP_READONLY	0x010		/* File is readonly. */
-	u_int32_t  flags;
+	uint32_t  flags;
 };
 
 /* Mpool statistics structure. */
 struct __db_mpool_stat {
-	u_int32_t st_gbytes;		/* Total cache size: GB. */
-	u_int32_t st_bytes;		/* Total cache size: B. */
-	u_int32_t st_ncache;		/* Number of cache regions. */
-	u_int32_t st_max_ncache;	/* Maximum number of regions. */
+	uint32_t st_gbytes;		/* Total cache size: GB. */
+	uint32_t st_bytes;		/* Total cache size: B. */
+	uint32_t st_ncache;		/* Number of cache regions. */
+	uint32_t st_max_ncache;	/* Maximum number of regions. */
 	size_t	  st_mmapsize;		/* Maximum file size for mmap. */
 	int	  st_maxopenfd;		/* Maximum number of open fd's. */
 	int	  st_maxwrite;		/* Maximum buffers to write. */
 	db_timeout_t st_maxwrite_sleep;	/* Sleep after writing max buffers. */
-	u_int32_t st_pages;		/* Total number of pages. */
+	uint32_t st_pages;		/* Total number of pages. */
 #ifndef __TEST_DB_NO_STATISTICS
-	u_int32_t st_map;		/* Pages from mapped files. */
-	u_int32_t st_cache_hit;		/* Pages found in the cache. */
-	u_int32_t st_cache_miss;	/* Pages not found in the cache. */
-	u_int32_t st_page_create;	/* Pages created in the cache. */
-	u_int32_t st_page_in;		/* Pages read in. */
-	u_int32_t st_page_out;		/* Pages written out. */
-	u_int32_t st_ro_evict;		/* Clean pages forced from the cache. */
-	u_int32_t st_rw_evict;		/* Dirty pages forced from the cache. */
-	u_int32_t st_page_trickle;	/* Pages written by memp_trickle. */
-	u_int32_t st_page_clean;	/* Clean pages. */
-	u_int32_t st_page_dirty;	/* Dirty pages. */
-	u_int32_t st_hash_buckets;	/* Number of hash buckets. */
-	u_int32_t st_hash_searches;	/* Total hash chain searches. */
-	u_int32_t st_hash_longest;	/* Longest hash chain searched. */
-	u_int32_t st_hash_examined;	/* Total hash entries searched. */
-	u_int32_t st_hash_nowait;	/* Hash lock granted with nowait. */
-	u_int32_t st_hash_wait;		/* Hash lock granted after wait. */
-	u_int32_t st_hash_max_nowait;	/* Max hash lock granted with nowait. */
-	u_int32_t st_hash_max_wait;	/* Max hash lock granted after wait. */
-	u_int32_t st_region_nowait;	/* Region lock granted with nowait. */
-	u_int32_t st_region_wait;	/* Region lock granted after wait. */
-	u_int32_t st_mvcc_frozen;		/* Buffers frozen. */
-	u_int32_t st_mvcc_thawed;		/* Buffers thawed. */
-	u_int32_t st_mvcc_freed;		/* Frozen buffers freed. */
-	u_int32_t st_alloc;		/* Number of page allocations. */
-	u_int32_t st_alloc_buckets;	/* Buckets checked during allocation. */
-	u_int32_t st_alloc_max_buckets;	/* Max checked during allocation. */
-	u_int32_t st_alloc_pages;	/* Pages checked during allocation. */
-	u_int32_t st_alloc_max_pages;	/* Max checked during allocation. */
-	u_int32_t st_io_wait;		/* Thread waited on buffer I/O. */
+	uint32_t st_map;		/* Pages from mapped files. */
+	uint32_t st_cache_hit;		/* Pages found in the cache. */
+	uint32_t st_cache_miss;	/* Pages not found in the cache. */
+	uint32_t st_page_create;	/* Pages created in the cache. */
+	uint32_t st_page_in;		/* Pages read in. */
+	uint32_t st_page_out;		/* Pages written out. */
+	uint32_t st_ro_evict;		/* Clean pages forced from the cache. */
+	uint32_t st_rw_evict;		/* Dirty pages forced from the cache. */
+	uint32_t st_page_trickle;	/* Pages written by memp_trickle. */
+	uint32_t st_page_clean;	/* Clean pages. */
+	uint32_t st_page_dirty;	/* Dirty pages. */
+	uint32_t st_hash_buckets;	/* Number of hash buckets. */
+	uint32_t st_hash_searches;	/* Total hash chain searches. */
+	uint32_t st_hash_longest;	/* Longest hash chain searched. */
+	uint32_t st_hash_examined;	/* Total hash entries searched. */
+	uint32_t st_hash_nowait;	/* Hash lock granted with nowait. */
+	uint32_t st_hash_wait;		/* Hash lock granted after wait. */
+	uint32_t st_hash_max_nowait;	/* Max hash lock granted with nowait. */
+	uint32_t st_hash_max_wait;	/* Max hash lock granted after wait. */
+	uint32_t st_region_nowait;	/* Region lock granted with nowait. */
+	uint32_t st_region_wait;	/* Region lock granted after wait. */
+	uint32_t st_mvcc_frozen;		/* Buffers frozen. */
+	uint32_t st_mvcc_thawed;		/* Buffers thawed. */
+	uint32_t st_mvcc_freed;		/* Frozen buffers freed. */
+	uint32_t st_alloc;		/* Number of page allocations. */
+	uint32_t st_alloc_buckets;	/* Buckets checked during allocation. */
+	uint32_t st_alloc_max_buckets;	/* Max checked during allocation. */
+	uint32_t st_alloc_pages;	/* Pages checked during allocation. */
+	uint32_t st_alloc_max_pages;	/* Max checked during allocation. */
+	uint32_t st_io_wait;		/* Thread waited on buffer I/O. */
 	roff_t	  st_regsize;		/* Region size. */
 #endif
 };
@@ -925,14 +925,14 @@ struct __db_mpool_stat {
 /* Mpool file statistics structure. */
 struct __db_mpool_fstat {
 	char *file_name;		/* File name. */
-	u_int32_t st_pagesize;		/* Page size. */
+	uint32_t st_pagesize;		/* Page size. */
 #ifndef __TEST_DB_NO_STATISTICS
-	u_int32_t st_map;		/* Pages from mapped files. */
-	u_int32_t st_cache_hit;		/* Pages found in the cache. */
-	u_int32_t st_cache_miss;	/* Pages not found in the cache. */
-	u_int32_t st_page_create;	/* Pages created in the cache. */
-	u_int32_t st_page_in;		/* Pages read in. */
-	u_int32_t st_page_out;		/* Pages written out. */
+	uint32_t st_map;		/* Pages from mapped files. */
+	uint32_t st_cache_hit;		/* Pages found in the cache. */
+	uint32_t st_cache_miss;	/* Pages not found in the cache. */
+	uint32_t st_page_create;	/* Pages created in the cache. */
+	uint32_t st_page_in;		/* Pages read in. */
+	uint32_t st_page_out;		/* Pages written out. */
 #endif
 };
 
@@ -966,7 +966,7 @@ struct __db_txn {
 	DB_TXNMGR	*mgrp;		/* Pointer to transaction manager. */
 	DB_TXN		*parent;	/* Pointer to transaction's parent. */
 
-	u_int32_t	txnid;		/* Unique transaction id. */
+	uint32_t	txnid;		/* Unique transaction id. */
 	char		*name;		/* Transaction name. */
 	DB_LOCKER	*locker;	/* Locker for this txn. */
 
@@ -1034,17 +1034,17 @@ struct __db_txn {
 	void	*api_internal;		/* C++ API private. */
 	void	*xml_internal;		/* XML API private. */
 
-	u_int32_t	cursors;	/* Number of cursors open for txn */
+	uint32_t	cursors;	/* Number of cursors open for txn */
 
 	/* DB_TXN PUBLIC HANDLE LIST BEGIN */
 	int	  (*abort) __P((DB_TXN *));
-	int	  (*commit) __P((DB_TXN *, u_int32_t));
-	int	  (*discard) __P((DB_TXN *, u_int32_t));
+	int	  (*commit) __P((DB_TXN *, uint32_t));
+	int	  (*discard) __P((DB_TXN *, uint32_t));
 	int	  (*get_name) __P((DB_TXN *, const char **));
-	u_int32_t (*id) __P((DB_TXN *));
-	int	  (*prepare) __P((DB_TXN *, u_int8_t *));
+	uint32_t (*id) __P((DB_TXN *));
+	int	  (*prepare) __P((DB_TXN *, uint8_t *));
 	int	  (*set_name) __P((DB_TXN *, const char *));
-	int	  (*set_timeout) __P((DB_TXN *, db_timeout_t, u_int32_t));
+	int	  (*set_timeout) __P((DB_TXN *, db_timeout_t, uint32_t));
 	/* DB_TXN PUBLIC HANDLE LIST END */
 
 	/* DB_TXN PRIVATE HANDLE LIST BEGIN */
@@ -1066,7 +1066,7 @@ struct __db_txn {
 #define	TXN_SNAPSHOT		0x1000	/* Snapshot Isolation. */
 #define	TXN_SYNC		0x2000	/* Write and sync on prepare/commit. */
 #define	TXN_WRITE_NOSYNC	0x4000	/* Write only on prepare/commit. */
-	u_int32_t	flags;
+	uint32_t	flags;
 };
 
 #define	TXN_SYNC_FLAGS (TXN_SYNC | TXN_NOSYNC | TXN_WRITE_NOSYNC)
@@ -1082,26 +1082,26 @@ struct __db_txn {
 #define	DB_XIDDATASIZE	128
 struct __db_preplist {
 	DB_TXN	*txn;
-	u_int8_t gid[DB_XIDDATASIZE];
+	uint8_t gid[DB_XIDDATASIZE];
 };
 
 /* Transaction statistics structure. */
 struct __db_txn_active {
-	u_int32_t txnid;		/* Transaction ID */
-	u_int32_t parentid;		/* Transaction ID of parent */
+	uint32_t txnid;		/* Transaction ID */
+	uint32_t parentid;		/* Transaction ID of parent */
 	pid_t     pid;			/* Process owning txn ID */
 	db_threadid_t tid;		/* Thread owning txn ID */
 
 	DB_LSN	  lsn;			/* LSN when transaction began */
 
 	DB_LSN	  read_lsn;		/* Read LSN for MVCC */
-	u_int32_t mvcc_ref;		/* MVCC reference count */
+	uint32_t mvcc_ref;		/* MVCC reference count */
 
 #define	TXN_ABORTED		1
 #define	TXN_COMMITTED		2
 #define	TXN_PREPARED		3
 #define	TXN_RUNNING		4
-	u_int32_t status;		/* Status of the transaction */
+	uint32_t status;		/* Status of the transaction */
 
 #define	TXN_XA_ABORTED		1
 #define	TXN_XA_DEADLOCKED	2
@@ -1109,30 +1109,30 @@ struct __db_txn_active {
 #define	TXN_XA_PREPARED		4
 #define	TXN_XA_STARTED		5
 #define	TXN_XA_SUSPENDED	6
-	u_int32_t xa_status;		/* XA status */
+	uint32_t xa_status;		/* XA status */
 
-	u_int8_t  xid[DB_XIDDATASIZE];	/* Global transaction ID */
+	uint8_t  xid[DB_XIDDATASIZE];	/* Global transaction ID */
 	char	  name[51];		/* 50 bytes of name, nul termination */
 };
 
 struct __db_txn_stat {
-	u_int32_t st_nrestores;		/* number of restored transactions
+	uint32_t st_nrestores;		/* number of restored transactions
 					   after recovery. */
 #ifndef __TEST_DB_NO_STATISTICS
 	DB_LSN	  st_last_ckp;		/* lsn of the last checkpoint */
 	time_t	  st_time_ckp;		/* time of last checkpoint */
-	u_int32_t st_last_txnid;	/* last transaction id given out */
-	u_int32_t st_maxtxns;		/* maximum txns possible */
-	u_int32_t st_naborts;		/* number of aborted transactions */
-	u_int32_t st_nbegins;		/* number of begun transactions */
-	u_int32_t st_ncommits;		/* number of committed transactions */
-	u_int32_t st_nactive;		/* number of active transactions */
-	u_int32_t st_nsnapshot;		/* number of snapshot transactions */
-	u_int32_t st_maxnactive;	/* maximum active transactions */
-	u_int32_t st_maxnsnapshot;	/* maximum snapshot transactions */
+	uint32_t st_last_txnid;	/* last transaction id given out */
+	uint32_t st_maxtxns;		/* maximum txns possible */
+	uint32_t st_naborts;		/* number of aborted transactions */
+	uint32_t st_nbegins;		/* number of begun transactions */
+	uint32_t st_ncommits;		/* number of committed transactions */
+	uint32_t st_nactive;		/* number of active transactions */
+	uint32_t st_nsnapshot;		/* number of snapshot transactions */
+	uint32_t st_maxnactive;	/* maximum active transactions */
+	uint32_t st_maxnsnapshot;	/* maximum snapshot transactions */
 	DB_TXN_ACTIVE *st_txnarray;	/* array of active transactions */
-	u_int32_t st_region_wait;	/* Region lock granted after wait. */
-	u_int32_t st_region_nowait;	/* Region lock granted without wait. */
+	uint32_t st_region_wait;	/* Region lock granted after wait. */
+	uint32_t st_region_nowait;	/* Region lock granted without wait. */
 	roff_t	  st_regsize;		/* Region size. */
 #endif
 };
@@ -1204,7 +1204,7 @@ struct __db_repmgr_site {
 
 #define	DB_REPMGR_CONNECTED	0x01
 #define	DB_REPMGR_DISCONNECTED	0x02
-	u_int32_t status;
+	uint32_t status;
 };
 
 /* Replication statistics. */
@@ -1218,82 +1218,82 @@ struct __db_rep_stat {
 	 * off somewhat (or, on unreasonable architectures under unlucky
 	 * circumstances, garbaged).
 	 */
-	u_int32_t st_log_queued;	/* Log records currently queued.+ */
-	u_int32_t st_startup_complete;	/* Site completed client sync-up. */
+	uint32_t st_log_queued;	/* Log records currently queued.+ */
+	uint32_t st_startup_complete;	/* Site completed client sync-up. */
 #ifndef __TEST_DB_NO_STATISTICS
-	u_int32_t st_status;		/* Current replication status. */
+	uint32_t st_status;		/* Current replication status. */
 	DB_LSN st_next_lsn;		/* Next LSN to use or expect. */
 	DB_LSN st_waiting_lsn;		/* LSN we're awaiting, if any. */
 	db_pgno_t st_next_pg;		/* Next pg we expect. */
 	db_pgno_t st_waiting_pg;	/* pg we're awaiting, if any. */
 
-	u_int32_t st_dupmasters;	/* # of times a duplicate master
+	uint32_t st_dupmasters;	/* # of times a duplicate master
 					   condition was detected.+ */
 	int st_env_id;			/* Current environment ID. */
 	int st_env_priority;		/* Current environment priority. */
-	u_int32_t st_bulk_fills;	/* Bulk buffer fills. */
-	u_int32_t st_bulk_overflows;	/* Bulk buffer overflows. */
-	u_int32_t st_bulk_records;	/* Bulk records stored. */
-	u_int32_t st_bulk_transfers;	/* Transfers of bulk buffers. */
-	u_int32_t st_client_rerequests;	/* Number of forced rerequests. */
-	u_int32_t st_client_svc_req;	/* Number of client service requests
+	uint32_t st_bulk_fills;	/* Bulk buffer fills. */
+	uint32_t st_bulk_overflows;	/* Bulk buffer overflows. */
+	uint32_t st_bulk_records;	/* Bulk records stored. */
+	uint32_t st_bulk_transfers;	/* Transfers of bulk buffers. */
+	uint32_t st_client_rerequests;	/* Number of forced rerequests. */
+	uint32_t st_client_svc_req;	/* Number of client service requests
 					   received by this client. */
-	u_int32_t st_client_svc_miss;	/* Number of client service requests
+	uint32_t st_client_svc_miss;	/* Number of client service requests
 					   missing on this client. */
-	u_int32_t st_gen;		/* Current generation number. */
-	u_int32_t st_egen;		/* Current election gen number. */
-	u_int32_t st_log_duplicated;	/* Log records received multiply.+ */
-	u_int32_t st_log_queued_max;	/* Max. log records queued at once.+ */
-	u_int32_t st_log_queued_total;	/* Total # of log recs. ever queued.+ */
-	u_int32_t st_log_records;	/* Log records received and put.+ */
-	u_int32_t st_log_requested;	/* Log recs. missed and requested.+ */
+	uint32_t st_gen;		/* Current generation number. */
+	uint32_t st_egen;		/* Current election gen number. */
+	uint32_t st_log_duplicated;	/* Log records received multiply.+ */
+	uint32_t st_log_queued_max;	/* Max. log records queued at once.+ */
+	uint32_t st_log_queued_total;	/* Total # of log recs. ever queued.+ */
+	uint32_t st_log_records;	/* Log records received and put.+ */
+	uint32_t st_log_requested;	/* Log recs. missed and requested.+ */
 	int st_master;			/* Env. ID of the current master. */
-	u_int32_t st_master_changes;	/* # of times we've switched masters. */
-	u_int32_t st_msgs_badgen;	/* Messages with a bad generation #.+ */
-	u_int32_t st_msgs_processed;	/* Messages received and processed.+ */
-	u_int32_t st_msgs_recover;	/* Messages ignored because this site
+	uint32_t st_master_changes;	/* # of times we've switched masters. */
+	uint32_t st_msgs_badgen;	/* Messages with a bad generation #.+ */
+	uint32_t st_msgs_processed;	/* Messages received and processed.+ */
+	uint32_t st_msgs_recover;	/* Messages ignored because this site
 					   was a client in recovery.+ */
-	u_int32_t st_msgs_send_failures;/* # of failed message sends.+ */
-	u_int32_t st_msgs_sent;		/* # of successful message sends.+ */
-	u_int32_t st_newsites;		/* # of NEWSITE msgs. received.+ */
+	uint32_t st_msgs_send_failures;/* # of failed message sends.+ */
+	uint32_t st_msgs_sent;		/* # of successful message sends.+ */
+	uint32_t st_newsites;		/* # of NEWSITE msgs. received.+ */
 	int st_nsites;			/* Current number of sites we will
 					   assume during elections. */
-	u_int32_t st_nthrottles;	/* # of times we were throttled. */
-	u_int32_t st_outdated;		/* # of times we detected and returned
+	uint32_t st_nthrottles;	/* # of times we were throttled. */
+	uint32_t st_outdated;		/* # of times we detected and returned
 					   an OUTDATED condition.+ */
-	u_int32_t st_pg_duplicated;	/* Pages received multiply.+ */
-	u_int32_t st_pg_records;	/* Pages received and stored.+ */
-	u_int32_t st_pg_requested;	/* Pages missed and requested.+ */
-	u_int32_t st_txns_applied;	/* # of transactions applied.+ */
-	u_int32_t st_startsync_delayed;	/* # of STARTSYNC msgs delayed.+ */
+	uint32_t st_pg_duplicated;	/* Pages received multiply.+ */
+	uint32_t st_pg_records;	/* Pages received and stored.+ */
+	uint32_t st_pg_requested;	/* Pages missed and requested.+ */
+	uint32_t st_txns_applied;	/* # of transactions applied.+ */
+	uint32_t st_startsync_delayed;	/* # of STARTSYNC msgs delayed.+ */
 
 	/* Elections generally. */
-	u_int32_t st_elections;		/* # of elections held.+ */
-	u_int32_t st_elections_won;	/* # of elections won by this site.+ */
+	uint32_t st_elections;		/* # of elections held.+ */
+	uint32_t st_elections_won;	/* # of elections won by this site.+ */
 
 	/* Statistics about an in-progress election. */
 	int st_election_cur_winner;	/* Current front-runner. */
-	u_int32_t st_election_gen;	/* Election generation number. */
+	uint32_t st_election_gen;	/* Election generation number. */
 	DB_LSN st_election_lsn;		/* Max. LSN of current winner. */
 	int st_election_nsites;		/* # of "registered voters". */
 	int st_election_nvotes;		/* # of "registered voters" needed. */
 	int st_election_priority;	/* Current election priority. */
 	int st_election_status;		/* Current election status. */
-	u_int32_t st_election_tiebreaker;/* Election tiebreaker value. */
+	uint32_t st_election_tiebreaker;/* Election tiebreaker value. */
 	int st_election_votes;		/* Votes received in this round. */
-	u_int32_t st_election_sec;	/* Last election time seconds. */
-	u_int32_t st_election_usec;	/* Last election time useconds. */
+	uint32_t st_election_sec;	/* Last election time seconds. */
+	uint32_t st_election_usec;	/* Last election time useconds. */
 #endif
 };
 
 /* Replication Manager statistics. */
 struct __db_repmgr_stat {
-	u_int32_t st_perm_failed;	/* # of insufficiently ack'ed msgs. */
-	u_int32_t st_msgs_queued;	/* # msgs queued for network delay. */
-	u_int32_t st_msgs_dropped;	/* # msgs discarded due to excessive
+	uint32_t st_perm_failed;	/* # of insufficiently ack'ed msgs. */
+	uint32_t st_msgs_queued;	/* # msgs queued for network delay. */
+	uint32_t st_msgs_dropped;	/* # msgs discarded due to excessive
 					   queue length. */
-	u_int32_t st_connection_drop;	/* Existing connections dropped. */
-	u_int32_t st_connect_fail;	/* Failed new connection attempts. */
+	uint32_t st_connection_drop;	/* Existing connections dropped. */
+	uint32_t st_connect_fail;	/* Failed new connection attempts. */
 };
 
 /*******************************************************
@@ -1303,13 +1303,13 @@ struct __db_repmgr_stat {
  * The storage record for a sequence.
  */
 struct __db_seq_record {
-	u_int32_t	seq_version;	/* Version size/number. */
+	uint32_t	seq_version;	/* Version size/number. */
 #define	DB_SEQ_DEC		0x00000001	/* Decrement sequence. */
 #define	DB_SEQ_INC		0x00000002	/* Increment sequence. */
 #define	DB_SEQ_RANGE_SET	0x00000004	/* Range set (internal). */
 #define	DB_SEQ_WRAP		0x00000008	/* Wrap sequence at min/max. */
 #define	DB_SEQ_WRAPPED		0x00000010	/* Just wrapped (internal). */
-	u_int32_t	flags;		/* Flags. */
+	uint32_t	flags;		/* Flags. */
 	db_seq_t	seq_value;	/* Current value. */
 	db_seq_t	seq_max;	/* Max permitted. */
 	db_seq_t	seq_min;	/* Min permitted. */
@@ -1332,38 +1332,38 @@ struct __db_sequence {
 	void		*api_internal;
 
 	/* DB_SEQUENCE PUBLIC HANDLE LIST BEGIN */
-	int		(*close) __P((DB_SEQUENCE *, u_int32_t));
+	int		(*close) __P((DB_SEQUENCE *, uint32_t));
 	int		(*get) __P((DB_SEQUENCE *,
-			      DB_TXN *, int32_t, db_seq_t *, u_int32_t));
+			      DB_TXN *, int32_t, db_seq_t *, uint32_t));
 	int		(*get_cachesize) __P((DB_SEQUENCE *, int32_t *));
 	int		(*get_db) __P((DB_SEQUENCE *, DB **));
-	int		(*get_flags) __P((DB_SEQUENCE *, u_int32_t *));
+	int		(*get_flags) __P((DB_SEQUENCE *, uint32_t *));
 	int		(*get_key) __P((DB_SEQUENCE *, DBT *));
 	int		(*get_range) __P((DB_SEQUENCE *,
 			     db_seq_t *, db_seq_t *));
 	int		(*initial_value) __P((DB_SEQUENCE *, db_seq_t));
 	int		(*open) __P((DB_SEQUENCE *,
-			    DB_TXN *, DBT *, u_int32_t));
-	int		(*remove) __P((DB_SEQUENCE *, DB_TXN *, u_int32_t));
+			    DB_TXN *, DBT *, uint32_t));
+	int		(*remove) __P((DB_SEQUENCE *, DB_TXN *, uint32_t));
 	int		(*set_cachesize) __P((DB_SEQUENCE *, int32_t));
-	int		(*set_flags) __P((DB_SEQUENCE *, u_int32_t));
+	int		(*set_flags) __P((DB_SEQUENCE *, uint32_t));
 	int		(*set_range) __P((DB_SEQUENCE *, db_seq_t, db_seq_t));
 	int		(*stat) __P((DB_SEQUENCE *,
-			    DB_SEQUENCE_STAT **, u_int32_t));
-	int		(*stat_print) __P((DB_SEQUENCE *, u_int32_t));
+			    DB_SEQUENCE_STAT **, uint32_t));
+	int		(*stat_print) __P((DB_SEQUENCE *, uint32_t));
 	/* DB_SEQUENCE PUBLIC HANDLE LIST END */
 };
 
 struct __db_seq_stat {
-	u_int32_t st_wait;		/* Sequence lock granted w/o wait. */
-	u_int32_t st_nowait;		/* Sequence lock granted after wait. */
+	uint32_t st_wait;		/* Sequence lock granted w/o wait. */
+	uint32_t st_nowait;		/* Sequence lock granted after wait. */
 	db_seq_t  st_current;		/* Current value in db. */
 	db_seq_t  st_value;		/* Current cached value. */
 	db_seq_t  st_last_value;	/* Last cached value. */
 	db_seq_t  st_min;		/* Minimum value. */
 	db_seq_t  st_max;		/* Maximum value. */
 	int32_t   st_cache_size;	/* Cache size. */
-	u_int32_t st_flags;		/* Flag value. */
+	uint32_t st_flags;		/* Flag value. */
 };
 
 /*******************************************************
@@ -1505,7 +1505,7 @@ struct __db {
 	/*******************************************************
 	 * Public: owned by the application.
 	 *******************************************************/
-	u_int32_t pgsize;		/* Database logical page size. */
+	uint32_t pgsize;		/* Database logical page size. */
 	DB_CACHE_PRIORITY priority;	/* Database priority in cache. */
 
 					/* Callbacks. */
@@ -1527,11 +1527,11 @@ struct __db {
 	db_mutex_t mutex;		/* Synchronization for free threading */
 
 	char *fname, *dname;		/* File/database passed to DB->open. */
-	u_int32_t open_flags;		/* Flags passed to DB->open. */
+	uint32_t open_flags;		/* Flags passed to DB->open. */
 
-	u_int8_t fileid[DB_FILE_ID_LEN];/* File's unique ID for locking. */
+	uint8_t fileid[DB_FILE_ID_LEN];/* File's unique ID for locking. */
 
-	u_int32_t adj_fileid;		/* File's unique ID for curs. adj. */
+	uint32_t adj_fileid;		/* File's unique ID for curs. adj. */
 
 #define	DB_LOGFILEID_INVALID	-1
 	FNAME *log_filename;		/* File's naming info for logging. */
@@ -1546,7 +1546,7 @@ struct __db {
 	u_int	 cl_id;			/* RPC: remote client id. */
 
 	time_t	 timestamp;		/* Handle timestamp for replication. */
-	u_int32_t fid_gen;		/* Rep generation number for fids. */
+	uint32_t fid_gen;		/* Rep generation number for fids. */
 
 	/*
 	 * Returned data memory for DB->get() and friends.
@@ -1634,7 +1634,7 @@ struct __db {
 		struct __db *le_next;
 		struct __db **le_prev;
 	} s_links;
-	u_int32_t s_refcnt;
+	uint32_t s_refcnt;
 
 	/* Secondary callback and free functions -- set in the secondary. */
 	int	(*s_callback) __P((DB *, const DBT *, const DBT *, DBT *));
@@ -1645,7 +1645,7 @@ struct __db {
 #define	DB_ASSOC_IMMUTABLE_KEY    0x00000001 /* Secondary key is immutable. */
 
 	/* Flags passed to associate -- set in the secondary. */
-	u_int32_t s_assoc_flags;
+	uint32_t s_assoc_flags;
 
 	/* API-private structure: used by DB 1.85, C++, Java, Perl and Tcl */
 	void	*api_internal;
@@ -1658,94 +1658,94 @@ struct __db {
 
 	/* DB PUBLIC HANDLE LIST BEGIN */
 	int  (*associate) __P((DB *, DB_TXN *, DB *,
-		int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
-	int  (*close) __P((DB *, u_int32_t));
+		int (*)(DB *, const DBT *, const DBT *, DBT *), uint32_t));
+	int  (*close) __P((DB *, uint32_t));
 	int  (*compact) __P((DB *,
-		DB_TXN *, DBT *, DBT *, DB_COMPACT *, u_int32_t, DBT *));
-	int  (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t));
-	int  (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t));
+		DB_TXN *, DBT *, DBT *, DB_COMPACT *, uint32_t, DBT *));
+	int  (*cursor) __P((DB *, DB_TXN *, DBC **, uint32_t));
+	int  (*del) __P((DB *, DB_TXN *, DBT *, uint32_t));
 	void (*err) __P((DB *, int, const char *, ...));
 	void (*errx) __P((DB *, const char *, ...));
-	int  (*exists) __P((DB *, DB_TXN *, DBT *, u_int32_t));
+	int  (*exists) __P((DB *, DB_TXN *, DBT *, uint32_t));
 	int  (*fd) __P((DB *, int *));
-	int  (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-	int  (*get_bt_minkey) __P((DB *, u_int32_t *));
+	int  (*get) __P((DB *, DB_TXN *, DBT *, DBT *, uint32_t));
+	int  (*get_bt_minkey) __P((DB *, uint32_t *));
 	int  (*get_byteswapped) __P((DB *, int *));
-	int  (*get_cachesize) __P((DB *, u_int32_t *, u_int32_t *, int *));
+	int  (*get_cachesize) __P((DB *, uint32_t *, uint32_t *, int *));
 	int  (*get_dbname) __P((DB *, const char **, const char **));
-	int  (*get_encrypt_flags) __P((DB *, u_int32_t *));
+	int  (*get_encrypt_flags) __P((DB *, uint32_t *));
 	DB_ENV *(*get_env) __P((DB *));
 	void (*get_errfile) __P((DB *, FILE **));
 	void (*get_errpfx) __P((DB *, const char **));
-	int  (*get_flags) __P((DB *, u_int32_t *));
-	int  (*get_h_ffactor) __P((DB *, u_int32_t *));
-	int  (*get_h_nelem) __P((DB *, u_int32_t *));
+	int  (*get_flags) __P((DB *, uint32_t *));
+	int  (*get_h_ffactor) __P((DB *, uint32_t *));
+	int  (*get_h_nelem) __P((DB *, uint32_t *));
 	int  (*get_lorder) __P((DB *, int *));
 	DB_MPOOLFILE *(*get_mpf) __P((DB *));
 	void (*get_msgfile) __P((DB *, FILE **));
 	int  (*get_multiple) __P((DB *));
-	int  (*get_open_flags) __P((DB *, u_int32_t *));
-	int  (*get_pagesize) __P((DB *, u_int32_t *));
+	int  (*get_open_flags) __P((DB *, uint32_t *));
+	int  (*get_pagesize) __P((DB *, uint32_t *));
 	int  (*get_priority) __P((DB *, DB_CACHE_PRIORITY *));
-	int  (*get_q_extentsize) __P((DB *, u_int32_t *));
+	int  (*get_q_extentsize) __P((DB *, uint32_t *));
 	int  (*get_re_delim) __P((DB *, int *));
-	int  (*get_re_len) __P((DB *, u_int32_t *));
+	int  (*get_re_len) __P((DB *, uint32_t *));
 	int  (*get_re_pad) __P((DB *, int *));
 	int  (*get_re_source) __P((DB *, const char **));
 	int  (*get_transactional) __P((DB *));
 	int  (*get_type) __P((DB *, DBTYPE *));
-	int  (*join) __P((DB *, DBC **, DBC **, u_int32_t));
+	int  (*join) __P((DB *, DBC **, DBC **, uint32_t));
 	int  (*key_range)
-		__P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t));
+		__P((DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, uint32_t));
 	int  (*open) __P((DB *,
-		DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int));
-	int  (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
-	int  (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-	int  (*remove) __P((DB *, const char *, const char *, u_int32_t));
+		DB_TXN *, const char *, const char *, DBTYPE, uint32_t, int));
+	int  (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, uint32_t));
+	int  (*put) __P((DB *, DB_TXN *, DBT *, DBT *, uint32_t));
+	int  (*remove) __P((DB *, const char *, const char *, uint32_t));
 	int  (*rename) __P((DB *,
-		const char *, const char *, const char *, u_int32_t));
+		const char *, const char *, const char *, uint32_t));
 	int  (*set_alloc) __P((DB *, void *(*)(size_t),
 		void *(*)(void *, size_t), void (*)(void *)));
 	int  (*set_append_recno) __P((DB *, int (*)(DB *, DBT *, db_recno_t)));
 	int  (*set_bt_compare)
 		__P((DB *, int (*)(DB *, const DBT *, const DBT *)));
-	int  (*set_bt_minkey) __P((DB *, u_int32_t));
+	int  (*set_bt_minkey) __P((DB *, uint32_t));
 	int  (*set_bt_prefix)
 		__P((DB *, size_t (*)(DB *, const DBT *, const DBT *)));
-	int  (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int));
+	int  (*set_cachesize) __P((DB *, uint32_t, uint32_t, int));
 	int  (*set_dup_compare)
 		__P((DB *, int (*)(DB *, const DBT *, const DBT *)));
-	int  (*set_encrypt) __P((DB *, const char *, u_int32_t));
+	int  (*set_encrypt) __P((DB *, const char *, uint32_t));
 	void (*set_errcall) __P((DB *,
 		void (*)(const DB_ENV *, const char *, const char *)));
 	void (*set_errfile) __P((DB *, FILE *));
 	void (*set_errpfx) __P((DB *, const char *));
 	int  (*set_feedback) __P((DB *, void (*)(DB *, int, int)));
-	int  (*set_flags) __P((DB *, u_int32_t));
+	int  (*set_flags) __P((DB *, uint32_t));
 	int  (*set_h_compare)
 		__P((DB *, int (*)(DB *, const DBT *, const DBT *)));
-	int  (*set_h_ffactor) __P((DB *, u_int32_t));
+	int  (*set_h_ffactor) __P((DB *, uint32_t));
 	int  (*set_h_hash)
-		__P((DB *, u_int32_t (*)(DB *, const void *, u_int32_t)));
-	int  (*set_h_nelem) __P((DB *, u_int32_t));
+		__P((DB *, uint32_t (*)(DB *, const void *, uint32_t)));
+	int  (*set_h_nelem) __P((DB *, uint32_t));
 	int  (*set_lorder) __P((DB *, int));
 	void (*set_msgcall) __P((DB *, void (*)(const DB_ENV *, const char *)));
 	void (*set_msgfile) __P((DB *, FILE *));
-	int  (*set_pagesize) __P((DB *, u_int32_t));
+	int  (*set_pagesize) __P((DB *, uint32_t));
 	int  (*set_paniccall) __P((DB *, void (*)(DB_ENV *, int)));
 	int  (*set_priority) __P((DB *, DB_CACHE_PRIORITY));
-	int  (*set_q_extentsize) __P((DB *, u_int32_t));
+	int  (*set_q_extentsize) __P((DB *, uint32_t));
 	int  (*set_re_delim) __P((DB *, int));
-	int  (*set_re_len) __P((DB *, u_int32_t));
+	int  (*set_re_len) __P((DB *, uint32_t));
 	int  (*set_re_pad) __P((DB *, int));
 	int  (*set_re_source) __P((DB *, const char *));
-	int  (*stat) __P((DB *, DB_TXN *, void *, u_int32_t));
-	int  (*stat_print) __P((DB *, u_int32_t));
-	int  (*sync) __P((DB *, u_int32_t));
-	int  (*truncate) __P((DB *, DB_TXN *, u_int32_t *, u_int32_t));
-	int  (*upgrade) __P((DB *, const char *, u_int32_t));
+	int  (*stat) __P((DB *, DB_TXN *, void *, uint32_t));
+	int  (*stat_print) __P((DB *, uint32_t));
+	int  (*sync) __P((DB *, uint32_t));
+	int  (*truncate) __P((DB *, DB_TXN *, uint32_t *, uint32_t));
+	int  (*upgrade) __P((DB *, const char *, uint32_t));
 	int  (*verify)
-		__P((DB *, const char *, const char *, FILE *, u_int32_t));
+		__P((DB *, const char *, const char *, FILE *, uint32_t));
 	/* DB PUBLIC HANDLE LIST END */
 
 	/* DB PRIVATE HANDLE LIST BEGIN */
@@ -1760,14 +1760,14 @@ struct __db {
 	 * Never called; these are a place to save function pointers
 	 * so that we can undo an associate.
 	 */
-	int  (*stored_get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
-	int  (*stored_close) __P((DB *, u_int32_t));
+	int  (*stored_get) __P((DB *, DB_TXN *, DBT *, DBT *, uint32_t));
+	int  (*stored_close) __P((DB *, uint32_t));
 
 #define	DB_OK_BTREE	0x01
 #define	DB_OK_HASH	0x02
 #define	DB_OK_QUEUE	0x04
 #define	DB_OK_RECNO	0x08
-	u_int32_t	am_ok;		/* Legal AM choices. */
+	uint32_t	am_ok;		/* Legal AM choices. */
 
 	/*
 	 * This field really ought to be an AM_FLAG, but we have
@@ -1806,8 +1806,8 @@ struct __db {
 #define	DB_AM_SWAP		0x08000000 /* Pages need to be byte-swapped */
 #define	DB_AM_TXN		0x10000000 /* Opened in a transaction */
 #define	DB_AM_VERIFYING		0x20000000 /* DB handle is in the verifier */
-	u_int32_t orig_flags;		   /* Flags at  open, for refresh */
-	u_int32_t flags;
+	uint32_t orig_flags;		   /* Flags at  open, for refresh */
+	uint32_t flags;
 };
 
 /*
@@ -1815,59 +1815,59 @@ struct __db {
  * For C++, use DbMultiple*Iterator.
  */
 #define	DB_MULTIPLE_INIT(pointer, dbt)					\
-	(pointer = (u_int8_t *)(dbt)->data +				\
-	    (dbt)->ulen - sizeof(u_int32_t))
+	(pointer = (uint8_t *)(dbt)->data +				\
+	    (dbt)->ulen - sizeof(uint32_t))
 #define	DB_MULTIPLE_NEXT(pointer, dbt, retdata, retdlen)		\
 	do {								\
-		if (*((u_int32_t *)(pointer)) == (u_int32_t)-1) {	\
+		if (*((uint32_t *)(pointer)) == (uint32_t)-1) {	\
 			retdata = NULL;					\
 			pointer = NULL;					\
 			break;						\
 		}							\
-		retdata = (u_int8_t *)					\
-		    (dbt)->data + *(u_int32_t *)(pointer);		\
-		(pointer) = (u_int32_t *)(pointer) - 1;			\
-		retdlen = *(u_int32_t *)(pointer);			\
-		(pointer) = (u_int32_t *)(pointer) - 1;			\
+		retdata = (uint8_t *)					\
+		    (dbt)->data + *(uint32_t *)(pointer);		\
+		(pointer) = (uint32_t *)(pointer) - 1;			\
+		retdlen = *(uint32_t *)(pointer);			\
+		(pointer) = (uint32_t *)(pointer) - 1;			\
 		if (retdlen == 0 &&					\
-		    retdata == (u_int8_t *)(dbt)->data)			\
+		    retdata == (uint8_t *)(dbt)->data)			\
 			retdata = NULL;					\
 	} while (0)
 #define	DB_MULTIPLE_KEY_NEXT(pointer, dbt, retkey, retklen, retdata, retdlen) \
 	do {								\
-		if (*((u_int32_t *)(pointer)) == (u_int32_t)-1) {	\
+		if (*((uint32_t *)(pointer)) == (uint32_t)-1) {	\
 			retdata = NULL;					\
 			retkey = NULL;					\
 			pointer = NULL;					\
 			break;						\
 		}							\
-		retkey = (u_int8_t *)					\
-		    (dbt)->data + *(u_int32_t *)(pointer);		\
-		(pointer) = (u_int32_t *)(pointer) - 1;			\
-		retklen = *(u_int32_t *)(pointer);			\
-		(pointer) = (u_int32_t *)(pointer) - 1;			\
-		retdata = (u_int8_t *)					\
-		    (dbt)->data + *(u_int32_t *)(pointer);		\
-		(pointer) = (u_int32_t *)(pointer) - 1;			\
-		retdlen = *(u_int32_t *)(pointer);			\
-		(pointer) = (u_int32_t *)(pointer) - 1;			\
+		retkey = (uint8_t *)					\
+		    (dbt)->data + *(uint32_t *)(pointer);		\
+		(pointer) = (uint32_t *)(pointer) - 1;			\
+		retklen = *(uint32_t *)(pointer);			\
+		(pointer) = (uint32_t *)(pointer) - 1;			\
+		retdata = (uint8_t *)					\
+		    (dbt)->data + *(uint32_t *)(pointer);		\
+		(pointer) = (uint32_t *)(pointer) - 1;			\
+		retdlen = *(uint32_t *)(pointer);			\
+		(pointer) = (uint32_t *)(pointer) - 1;			\
 	} while (0)
 
 #define	DB_MULTIPLE_RECNO_NEXT(pointer, dbt, recno, retdata, retdlen)   \
 	do {								\
-		if (*((u_int32_t *)(pointer)) == (u_int32_t)0) {	\
+		if (*((uint32_t *)(pointer)) == (uint32_t)0) {	\
 			recno = 0;					\
 			retdata = NULL;					\
 			pointer = NULL;					\
 			break;						\
 		}							\
-		recno = *(u_int32_t *)(pointer);			\
-		(pointer) = (u_int32_t *)(pointer) - 1;			\
-		retdata = (u_int8_t *)					\
-		    (dbt)->data + *(u_int32_t *)(pointer);		\
-		(pointer) = (u_int32_t *)(pointer) - 1;			\
-		retdlen = *(u_int32_t *)(pointer);			\
-		(pointer) = (u_int32_t *)(pointer) - 1;			\
+		recno = *(uint32_t *)(pointer);			\
+		(pointer) = (uint32_t *)(pointer) - 1;			\
+		retdata = (uint8_t *)					\
+		    (dbt)->data + *(uint32_t *)(pointer);		\
+		(pointer) = (uint32_t *)(pointer) - 1;			\
+		retdlen = *(uint32_t *)(pointer);			\
+		(pointer) = (uint32_t *)(pointer) - 1;			\
 	} while (0)
 
 /*******************************************************
@@ -1923,32 +1923,32 @@ struct __dbc {
 
 	/* DBC PUBLIC HANDLE LIST BEGIN */
 	int (*close) __P((DBC *));
-	int (*count) __P((DBC *, db_recno_t *, u_int32_t));
-	int (*del) __P((DBC *, u_int32_t));
-	int (*dup) __P((DBC *, DBC **, u_int32_t));
-	int (*get) __P((DBC *, DBT *, DBT *, u_int32_t));
+	int (*count) __P((DBC *, db_recno_t *, uint32_t));
+	int (*del) __P((DBC *, uint32_t));
+	int (*dup) __P((DBC *, DBC **, uint32_t));
+	int (*get) __P((DBC *, DBT *, DBT *, uint32_t));
 	int (*get_priority) __P((DBC *, DB_CACHE_PRIORITY *));
-	int (*pget) __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
-	int (*put) __P((DBC *, DBT *, DBT *, u_int32_t));
+	int (*pget) __P((DBC *, DBT *, DBT *, DBT *, uint32_t));
+	int (*put) __P((DBC *, DBT *, DBT *, uint32_t));
 	int (*set_priority) __P((DBC *, DB_CACHE_PRIORITY));
 	/* DBC PUBLIC HANDLE LIST END */
 
 	/* The following are the method names deprecated in the 4.6 release. */
 	int (*c_close) __P((DBC *));
-	int (*c_count) __P((DBC *, db_recno_t *, u_int32_t));
-	int (*c_del) __P((DBC *, u_int32_t));
-	int (*c_dup) __P((DBC *, DBC **, u_int32_t));
-	int (*c_get) __P((DBC *, DBT *, DBT *, u_int32_t));
-	int (*c_pget) __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
-	int (*c_put) __P((DBC *, DBT *, DBT *, u_int32_t));
+	int (*c_count) __P((DBC *, db_recno_t *, uint32_t));
+	int (*c_del) __P((DBC *, uint32_t));
+	int (*c_dup) __P((DBC *, DBC **, uint32_t));
+	int (*c_get) __P((DBC *, DBT *, DBT *, uint32_t));
+	int (*c_pget) __P((DBC *, DBT *, DBT *, DBT *, uint32_t));
+	int (*c_put) __P((DBC *, DBT *, DBT *, uint32_t));
 
 	/* DBC PRIVATE HANDLE LIST BEGIN */
-	int (*am_bulk) __P((DBC *, DBT *, u_int32_t));
+	int (*am_bulk) __P((DBC *, DBT *, uint32_t));
 	int (*am_close) __P((DBC *, db_pgno_t, int *));
 	int (*am_del) __P((DBC *));
 	int (*am_destroy) __P((DBC *));
-	int (*am_get) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
-	int (*am_put) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
+	int (*am_get) __P((DBC *, DBT *, DBT *, uint32_t, db_pgno_t *));
+	int (*am_put) __P((DBC *, DBT *, DBT *, uint32_t, db_pgno_t *));
 	int (*am_writelock) __P((DBC *));
 	/* DBC PRIVATE HANDLE LIST END */
 
@@ -1973,7 +1973,7 @@ struct __dbc {
 #define	DBC_TRANSIENT		0x0400	/* Cursor is transient. */
 #define	DBC_WRITECURSOR		0x0800	/* Cursor may be used to write (CDB). */
 #define	DBC_WRITER		0x1000	/* Cursor immediately writing (CDB). */
-	u_int32_t flags;
+	uint32_t flags;
 };
 
 /* Key range statistics structure */
@@ -1985,39 +1985,39 @@ struct __key_range {
 
 /* Btree/Recno statistics structure. */
 struct __db_bt_stat {
-	u_int32_t bt_magic;		/* Magic number. */
-	u_int32_t bt_version;		/* Version number. */
-	u_int32_t bt_metaflags;		/* Metadata flags. */
-	u_int32_t bt_nkeys;		/* Number of unique keys. */
-	u_int32_t bt_ndata;		/* Number of data items. */
-	u_int32_t bt_pagecnt;		/* Page count. */
-	u_int32_t bt_pagesize;		/* Page size. */
-	u_int32_t bt_minkey;		/* Minkey value. */
-	u_int32_t bt_re_len;		/* Fixed-length record length. */
-	u_int32_t bt_re_pad;		/* Fixed-length record pad. */
-	u_int32_t bt_levels;		/* Tree levels. */
-	u_int32_t bt_int_pg;		/* Internal pages. */
-	u_int32_t bt_leaf_pg;		/* Leaf pages. */
-	u_int32_t bt_dup_pg;		/* Duplicate pages. */
-	u_int32_t bt_over_pg;		/* Overflow pages. */
-	u_int32_t bt_empty_pg;		/* Empty pages. */
-	u_int32_t bt_free;		/* Pages on the free list. */
-	u_int32_t bt_int_pgfree;	/* Bytes free in internal pages. */
-	u_int32_t bt_leaf_pgfree;	/* Bytes free in leaf pages. */
-	u_int32_t bt_dup_pgfree;	/* Bytes free in duplicate pages. */
-	u_int32_t bt_over_pgfree;	/* Bytes free in overflow pages. */
+	uint32_t bt_magic;		/* Magic number. */
+	uint32_t bt_version;		/* Version number. */
+	uint32_t bt_metaflags;		/* Metadata flags. */
+	uint32_t bt_nkeys;		/* Number of unique keys. */
+	uint32_t bt_ndata;		/* Number of data items. */
+	uint32_t bt_pagecnt;		/* Page count. */
+	uint32_t bt_pagesize;		/* Page size. */
+	uint32_t bt_minkey;		/* Minkey value. */
+	uint32_t bt_re_len;		/* Fixed-length record length. */
+	uint32_t bt_re_pad;		/* Fixed-length record pad. */
+	uint32_t bt_levels;		/* Tree levels. */
+	uint32_t bt_int_pg;		/* Internal pages. */
+	uint32_t bt_leaf_pg;		/* Leaf pages. */
+	uint32_t bt_dup_pg;		/* Duplicate pages. */
+	uint32_t bt_over_pg;		/* Overflow pages. */
+	uint32_t bt_empty_pg;		/* Empty pages. */
+	uint32_t bt_free;		/* Pages on the free list. */
+	uint32_t bt_int_pgfree;	/* Bytes free in internal pages. */
+	uint32_t bt_leaf_pgfree;	/* Bytes free in leaf pages. */
+	uint32_t bt_dup_pgfree;	/* Bytes free in duplicate pages. */
+	uint32_t bt_over_pgfree;	/* Bytes free in overflow pages. */
 };
 
 struct __db_compact {
 	/* Input Parameters. */
-	u_int32_t	compact_fillpercent;	/* Desired fillfactor: 1-100 */
+	uint32_t	compact_fillpercent;	/* Desired fillfactor: 1-100 */
 	db_timeout_t	compact_timeout;	/* Lock timeout. */
-	u_int32_t	compact_pages;		/* Max pages to process. */
+	uint32_t	compact_pages;		/* Max pages to process. */
 	/* Output Stats. */
-	u_int32_t	compact_pages_free;	/* Number of pages freed. */
-	u_int32_t	compact_pages_examine;	/* Number of pages examine. */
-	u_int32_t	compact_levels;		/* Number of levels removed. */
-	u_int32_t	compact_deadlock;	/* Number of deadlocks. */
+	uint32_t	compact_pages_free;	/* Number of pages freed. */
+	uint32_t	compact_pages_examine;	/* Number of pages examine. */
+	uint32_t	compact_levels;		/* Number of levels removed. */
+	uint32_t	compact_deadlock;	/* Number of deadlocks. */
 	db_pgno_t	compact_pages_truncated; /* Pages truncated to OS. */
 	/* Internal. */
 	db_pgno_t	compact_truncate;	/* Page number for truncation */
@@ -2025,40 +2025,40 @@ struct __db_compact {
 
 /* Hash statistics structure. */
 struct __db_h_stat {
-	u_int32_t hash_magic;		/* Magic number. */
-	u_int32_t hash_version;		/* Version number. */
-	u_int32_t hash_metaflags;	/* Metadata flags. */
-	u_int32_t hash_nkeys;		/* Number of unique keys. */
-	u_int32_t hash_ndata;		/* Number of data items. */
-	u_int32_t hash_pagecnt;		/* Page count. */
-	u_int32_t hash_pagesize;	/* Page size. */
-	u_int32_t hash_ffactor;		/* Fill factor specified at create. */
-	u_int32_t hash_buckets;		/* Number of hash buckets. */
-	u_int32_t hash_free;		/* Pages on the free list. */
-	u_int32_t hash_bfree;		/* Bytes free on bucket pages. */
-	u_int32_t hash_bigpages;	/* Number of big key/data pages. */
-	u_int32_t hash_big_bfree;	/* Bytes free on big item pages. */
-	u_int32_t hash_overflows;	/* Number of overflow pages. */
-	u_int32_t hash_ovfl_free;	/* Bytes free on ovfl pages. */
-	u_int32_t hash_dup;		/* Number of dup pages. */
-	u_int32_t hash_dup_free;	/* Bytes free on duplicate pages. */
+	uint32_t hash_magic;		/* Magic number. */
+	uint32_t hash_version;		/* Version number. */
+	uint32_t hash_metaflags;	/* Metadata flags. */
+	uint32_t hash_nkeys;		/* Number of unique keys. */
+	uint32_t hash_ndata;		/* Number of data items. */
+	uint32_t hash_pagecnt;		/* Page count. */
+	uint32_t hash_pagesize;	/* Page size. */
+	uint32_t hash_ffactor;		/* Fill factor specified at create. */
+	uint32_t hash_buckets;		/* Number of hash buckets. */
+	uint32_t hash_free;		/* Pages on the free list. */
+	uint32_t hash_bfree;		/* Bytes free on bucket pages. */
+	uint32_t hash_bigpages;	/* Number of big key/data pages. */
+	uint32_t hash_big_bfree;	/* Bytes free on big item pages. */
+	uint32_t hash_overflows;	/* Number of overflow pages. */
+	uint32_t hash_ovfl_free;	/* Bytes free on ovfl pages. */
+	uint32_t hash_dup;		/* Number of dup pages. */
+	uint32_t hash_dup_free;	/* Bytes free on duplicate pages. */
 };
 
 /* Queue statistics structure. */
 struct __db_qam_stat {
-	u_int32_t qs_magic;		/* Magic number. */
-	u_int32_t qs_version;		/* Version number. */
-	u_int32_t qs_metaflags;		/* Metadata flags. */
-	u_int32_t qs_nkeys;		/* Number of unique keys. */
-	u_int32_t qs_ndata;		/* Number of data items. */
-	u_int32_t qs_pagesize;		/* Page size. */
-	u_int32_t qs_extentsize;	/* Pages per extent. */
-	u_int32_t qs_pages;		/* Data pages. */
-	u_int32_t qs_re_len;		/* Fixed-length record length. */
-	u_int32_t qs_re_pad;		/* Fixed-length record pad. */
-	u_int32_t qs_pgfree;		/* Bytes free in data pages. */
-	u_int32_t qs_first_recno;	/* First not deleted record. */
-	u_int32_t qs_cur_recno;		/* Next available record number. */
+	uint32_t qs_magic;		/* Magic number. */
+	uint32_t qs_version;		/* Version number. */
+	uint32_t qs_metaflags;		/* Metadata flags. */
+	uint32_t qs_nkeys;		/* Number of unique keys. */
+	uint32_t qs_ndata;		/* Number of data items. */
+	uint32_t qs_pagesize;		/* Page size. */
+	uint32_t qs_extentsize;	/* Pages per extent. */
+	uint32_t qs_pages;		/* Data pages. */
+	uint32_t qs_re_len;		/* Fixed-length record length. */
+	uint32_t qs_re_pad;		/* Fixed-length record pad. */
+	uint32_t qs_pgfree;		/* Bytes free in data pages. */
+	uint32_t qs_first_recno;	/* First not deleted record. */
+	uint32_t qs_cur_recno;		/* Next available record number. */
 };
 
 /*******************************************************
@@ -2083,7 +2083,7 @@ struct __db_env {
 					/* Other Callbacks. */
 	void (*db_feedback) __P((DB_ENV *, int, int));
 	void (*db_paniccall) __P((DB_ENV *, int));
-	void (*db_event_func) __P((DB_ENV *, u_int32_t, void *));
+	void (*db_event_func) __P((DB_ENV *, uint32_t, void *));
 
 					/* App-specified alloc functions. */
 	void *(*db_malloc) __P((size_t));
@@ -2094,7 +2094,7 @@ struct __db_env {
 #define	DB_USERCOPY_GETDATA	0x0001
 #define	DB_USERCOPY_SETDATA	0x0002
 	int (*dbt_usercopy)
-	    __P((DBT *, u_int32_t, void *, u_int32_t, u_int32_t));
+	    __P((DBT *, uint32_t, void *, uint32_t, uint32_t));
 
 	/*
 	 * Currently, the verbose list is a bit field with room for 32
@@ -2108,7 +2108,7 @@ struct __db_env {
 #define	DB_VERB_REGISTER	0x0010	/* Dump waits-for table. */
 #define	DB_VERB_REPLICATION	0x0020	/* Replication information. */
 #define	DB_VERB_WAITSFOR	0x0040	/* Dump waits-for table. */
-	u_int32_t	 verbose;	/* Verbose output. */
+	uint32_t	 verbose;	/* Verbose output. */
 
 	void		*app_private;	/* Application-private handle. */
 
@@ -2116,52 +2116,52 @@ struct __db_env {
 	    __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
 
 	/* Mutexes. */
-	u_int32_t	mutex_align;	/* Mutex alignment */
-	u_int32_t	mutex_cnt;	/* Number of mutexes to configure */
-	u_int32_t	mutex_inc;	/* Number of mutexes to add */
-	u_int32_t	mutex_tas_spins;/* Test-and-set spin count */
+	uint32_t	mutex_align;	/* Mutex alignment */
+	uint32_t	mutex_cnt;	/* Number of mutexes to configure */
+	uint32_t	mutex_inc;	/* Number of mutexes to add */
+	uint32_t	mutex_tas_spins;/* Test-and-set spin count */
 
 	struct {
 		int	  alloc_id;	/* Allocation ID argument */
-		u_int32_t flags;	/* Flags argument */
+		uint32_t flags;	/* Flags argument */
 	} *mutex_iq;			/* Initial mutexes queue */
 	u_int		mutex_iq_next;	/* Count of initial mutexes */
 	u_int		mutex_iq_max;	/* Maximum initial mutexes */
 
 	/* Locking. */
-	u_int8_t	*lk_conflicts;	/* Two dimensional conflict matrix. */
+	uint8_t	*lk_conflicts;	/* Two dimensional conflict matrix. */
 	int		 lk_modes;	/* Number of lock modes in table. */
-	u_int32_t	 lk_max;	/* Maximum number of locks. */
-	u_int32_t	 lk_max_lockers;/* Maximum number of lockers. */
-	u_int32_t	 lk_max_objects;/* Maximum number of locked objects. */
-	u_int32_t	 lk_detect;	/* Deadlock detect on all conflicts. */
+	uint32_t	 lk_max;	/* Maximum number of locks. */
+	uint32_t	 lk_max_lockers;/* Maximum number of lockers. */
+	uint32_t	 lk_max_objects;/* Maximum number of locked objects. */
+	uint32_t	 lk_detect;	/* Deadlock detect on all conflicts. */
 	db_timeout_t	 lk_timeout;	/* Lock timeout period. */
 
 	/* Logging. */
-	u_int32_t	 lg_bsize;	/* Buffer size. */
-	u_int32_t	 lg_size;	/* Log file size. */
-	u_int32_t	 lg_regionmax;	/* Region size. */
+	uint32_t	 lg_bsize;	/* Buffer size. */
+	uint32_t	 lg_size;	/* Log file size. */
+	uint32_t	 lg_regionmax;	/* Region size. */
 	int		 lg_filemode;	/* Log file permission mode. */
 
 	/* Memory pool. */
 	u_int		 mp_ncache;	/* Initial number of cache regions. */
-	u_int32_t	 mp_gbytes;	/* Cache size: GB. */
-	u_int32_t	 mp_bytes;	/* Cache size: bytes. */
-	u_int32_t	 mp_max_gbytes;	/* Maximum cache size: GB. */
-	u_int32_t	 mp_max_bytes;	/* Maximum cache size: bytes. */
+	uint32_t	 mp_gbytes;	/* Cache size: GB. */
+	uint32_t	 mp_bytes;	/* Cache size: bytes. */
+	uint32_t	 mp_max_gbytes;	/* Maximum cache size: GB. */
+	uint32_t	 mp_max_bytes;	/* Maximum cache size: bytes. */
 	size_t		 mp_mmapsize;	/* Maximum file size for mmap. */
 	int		 mp_maxopenfd;	/* Maximum open file descriptors. */
 	int		 mp_maxwrite;	/* Maximum buffers to write. */
 	db_timeout_t mp_maxwrite_sleep;	/* Sleep after writing max buffers. */
 
 	/* Transactions. */
-	u_int32_t	 tx_max;	/* Maximum number of transactions. */
+	uint32_t	 tx_max;	/* Maximum number of transactions. */
 	time_t		 tx_timestamp;	/* Recover to specific timestamp. */
 	db_timeout_t	 tx_timeout;	/* Timeout for transactions. */
 
 	/* Thread tracking. */
-	u_int32_t	thr_nbucket;	/* Number of hash buckets. */
-	u_int32_t	thr_max;	/* Max before garbage collection. */
+	uint32_t	thr_nbucket;	/* Number of hash buckets. */
+	uint32_t	thr_max;	/* Max before garbage collection. */
 	void		*thr_hashtab;	/* Hash table of DB_THREAD_INFO. */
 
 	/*******************************************************
@@ -2183,13 +2183,13 @@ struct __db_env {
 	int		 db_mode;	/* Default open permissions. */
 	int		 dir_mode;	/* Intermediate directory perms. */
 	void		*env_lref;	/* Locker in non-threaded handles. */
-	u_int32_t	 open_flags;	/* Flags passed to DB_ENV->open. */
+	uint32_t	 open_flags;	/* Flags passed to DB_ENV->open. */
 
 	void		*reginfo;	/* REGINFO structure reference. */
 	DB_FH		*lockfhp;	/* fcntl(2) locking file handle. */
 
 	DB_FH		*registry;	/* DB_REGISTER file handle. */
-	u_int32_t	registry_off;	/*
+	uint32_t	registry_off;	/*
 					 * Offset of our slot.  We can't use
 					 * off_t because its size depends on
 					 * build settings.
@@ -2199,7 +2199,7 @@ struct __db_env {
 	void	       (*thread_id) __P((DB_ENV *, pid_t *, db_threadid_t *));
 					/* Return if IDs alive. */
 	int	       (*is_alive)
-			__P((DB_ENV *, pid_t, db_threadid_t, u_int32_t));
+			__P((DB_ENV *, pid_t, db_threadid_t, uint32_t));
 					/* Format IDs into a string. */
 	char	       *(*thread_id_string)
 			__P((DB_ENV *, pid_t, db_threadid_t, char *));
@@ -2281,151 +2281,151 @@ struct __db_env {
 
 	/* DB_ENV PUBLIC HANDLE LIST BEGIN */
 	int  (*cdsgroup_begin) __P((DB_ENV *, DB_TXN **));
-	int  (*close) __P((DB_ENV *, u_int32_t));
+	int  (*close) __P((DB_ENV *, uint32_t));
 	int  (*dbremove) __P((DB_ENV *,
-		DB_TXN *, const char *, const char *, u_int32_t));
+		DB_TXN *, const char *, const char *, uint32_t));
 	int  (*dbrename) __P((DB_ENV *,
-		DB_TXN *, const char *, const char *, const char *, u_int32_t));
+		DB_TXN *, const char *, const char *, const char *, uint32_t));
 	void (*err) __P((const DB_ENV *, int, const char *, ...));
 	void (*errx) __P((const DB_ENV *, const char *, ...));
-	int  (*failchk) __P((DB_ENV *, u_int32_t));
-	int  (*fileid_reset) __P((DB_ENV *, const char *, u_int32_t));
-	int  (*get_cachesize) __P((DB_ENV *, u_int32_t *, u_int32_t *, int *));
-	int  (*get_cache_max) __P((DB_ENV *, u_int32_t *, u_int32_t *));
+	int  (*failchk) __P((DB_ENV *, uint32_t));
+	int  (*fileid_reset) __P((DB_ENV *, const char *, uint32_t));
+	int  (*get_cachesize) __P((DB_ENV *, uint32_t *, uint32_t *, int *));
+	int  (*get_cache_max) __P((DB_ENV *, uint32_t *, uint32_t *));
 	int  (*get_data_dirs) __P((DB_ENV *, const char ***));
-	int  (*get_encrypt_flags) __P((DB_ENV *, u_int32_t *));
+	int  (*get_encrypt_flags) __P((DB_ENV *, uint32_t *));
 	void (*get_errfile) __P((DB_ENV *, FILE **));
 	void (*get_errpfx) __P((DB_ENV *, const char **));
-	int  (*get_flags) __P((DB_ENV *, u_int32_t *));
+	int  (*get_flags) __P((DB_ENV *, uint32_t *));
 	int  (*get_home) __P((DB_ENV *, const char **));
-	int  (*get_lg_bsize) __P((DB_ENV *, u_int32_t *));
+	int  (*get_lg_bsize) __P((DB_ENV *, uint32_t *));
 	int  (*get_lg_dir) __P((DB_ENV *, const char **));
 	int  (*get_lg_filemode) __P((DB_ENV *, int *));
-	int  (*get_lg_max) __P((DB_ENV *, u_int32_t *));
-	int  (*get_lg_regionmax) __P((DB_ENV *, u_int32_t *));
-	int  (*get_lk_conflicts) __P((DB_ENV *, const u_int8_t **, int *));
-	int  (*get_lk_detect) __P((DB_ENV *, u_int32_t *));
-	int  (*get_lk_max_lockers) __P((DB_ENV *, u_int32_t *));
-	int  (*get_lk_max_locks) __P((DB_ENV *, u_int32_t *));
-	int  (*get_lk_max_objects) __P((DB_ENV *, u_int32_t *));
+	int  (*get_lg_max) __P((DB_ENV *, uint32_t *));
+	int  (*get_lg_regionmax) __P((DB_ENV *, uint32_t *));
+	int  (*get_lk_conflicts) __P((DB_ENV *, const uint8_t **, int *));
+	int  (*get_lk_detect) __P((DB_ENV *, uint32_t *));
+	int  (*get_lk_max_lockers) __P((DB_ENV *, uint32_t *));
+	int  (*get_lk_max_locks) __P((DB_ENV *, uint32_t *));
+	int  (*get_lk_max_objects) __P((DB_ENV *, uint32_t *));
 	int  (*get_mp_max_openfd) __P((DB_ENV *, int *));
 	int  (*get_mp_max_write) __P((DB_ENV *, int *, db_timeout_t *));
 	int  (*get_mp_mmapsize) __P((DB_ENV *, size_t *));
 	void (*get_msgfile) __P((DB_ENV *, FILE **));
-	int  (*get_open_flags) __P((DB_ENV *, u_int32_t *));
+	int  (*get_open_flags) __P((DB_ENV *, uint32_t *));
 	int  (*get_shm_key) __P((DB_ENV *, long *));
-	int  (*get_thread_count) __P((DB_ENV *, u_int32_t *));
-	int  (*get_timeout) __P((DB_ENV *, db_timeout_t *, u_int32_t));
+	int  (*get_thread_count) __P((DB_ENV *, uint32_t *));
+	int  (*get_timeout) __P((DB_ENV *, db_timeout_t *, uint32_t));
 	int  (*get_tmp_dir) __P((DB_ENV *, const char **));
-	int  (*get_tx_max) __P((DB_ENV *, u_int32_t *));
+	int  (*get_tx_max) __P((DB_ENV *, uint32_t *));
 	int  (*get_tx_timestamp) __P((DB_ENV *, time_t *));
-	int  (*get_verbose) __P((DB_ENV *, u_int32_t, int *));
+	int  (*get_verbose) __P((DB_ENV *, uint32_t, int *));
 	int  (*is_bigendian) __P((void));
-	int  (*lock_detect) __P((DB_ENV *, u_int32_t, u_int32_t, int *));
+	int  (*lock_detect) __P((DB_ENV *, uint32_t, uint32_t, int *));
 	int  (*lock_get) __P((DB_ENV *,
-		u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *));
-	int  (*lock_id) __P((DB_ENV *, u_int32_t *));
-	int  (*lock_id_free) __P((DB_ENV *, u_int32_t));
+		uint32_t, uint32_t, const DBT *, db_lockmode_t, DB_LOCK *));
+	int  (*lock_id) __P((DB_ENV *, uint32_t *));
+	int  (*lock_id_free) __P((DB_ENV *, uint32_t));
 	int  (*lock_put) __P((DB_ENV *, DB_LOCK *));
-	int  (*lock_stat) __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
-	int  (*lock_stat_print) __P((DB_ENV *, u_int32_t));
+	int  (*lock_stat) __P((DB_ENV *, DB_LOCK_STAT **, uint32_t));
+	int  (*lock_stat_print) __P((DB_ENV *, uint32_t));
 	int  (*lock_vec) __P((DB_ENV *,
-		u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **));
-	int  (*log_archive) __P((DB_ENV *, char **[], u_int32_t));
-	int  (*log_cursor) __P((DB_ENV *, DB_LOGC **, u_int32_t));
+		uint32_t, uint32_t, DB_LOCKREQ *, int, DB_LOCKREQ **));
+	int  (*log_archive) __P((DB_ENV *, char **[], uint32_t));
+	int  (*log_cursor) __P((DB_ENV *, DB_LOGC **, uint32_t));
 	int  (*log_file) __P((DB_ENV *, const DB_LSN *, char *, size_t));
 	int  (*log_flush) __P((DB_ENV *, const DB_LSN *));
 	int  (*log_printf) __P((DB_ENV *, DB_TXN *, const char *, ...));
-	int  (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
-	int  (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
-	int  (*log_stat_print) __P((DB_ENV *, u_int32_t));
-	int  (*lsn_reset) __P((DB_ENV *, const char *, u_int32_t));
-	int  (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
+	int  (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, uint32_t));
+	int  (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, uint32_t));
+	int  (*log_stat_print) __P((DB_ENV *, uint32_t));
+	int  (*lsn_reset) __P((DB_ENV *, const char *, uint32_t));
+	int  (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, uint32_t));
 	int  (*memp_register) __P((DB_ENV *, int, int (*)(DB_ENV *,
 		db_pgno_t, void *, DBT *), int (*)(DB_ENV *,
 		db_pgno_t, void *, DBT *)));
 	int  (*memp_stat) __P((DB_ENV *,
-		DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t));
-	int  (*memp_stat_print) __P((DB_ENV *, u_int32_t));
+		DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, uint32_t));
+	int  (*memp_stat_print) __P((DB_ENV *, uint32_t));
 	int  (*memp_sync) __P((DB_ENV *, DB_LSN *));
 	int  (*memp_trickle) __P((DB_ENV *, int, int *));
-	int  (*mutex_alloc) __P((DB_ENV *, u_int32_t, db_mutex_t *));
+	int  (*mutex_alloc) __P((DB_ENV *, uint32_t, db_mutex_t *));
 	int  (*mutex_free) __P((DB_ENV *, db_mutex_t));
-	int  (*mutex_get_align) __P((DB_ENV *, u_int32_t *));
-	int  (*mutex_get_increment) __P((DB_ENV *, u_int32_t *));
-	int  (*mutex_get_max) __P((DB_ENV *, u_int32_t *));
-	int  (*mutex_get_tas_spins) __P((DB_ENV *, u_int32_t *));
+	int  (*mutex_get_align) __P((DB_ENV *, uint32_t *));
+	int  (*mutex_get_increment) __P((DB_ENV *, uint32_t *));
+	int  (*mutex_get_max) __P((DB_ENV *, uint32_t *));
+	int  (*mutex_get_tas_spins) __P((DB_ENV *, uint32_t *));
 	int  (*mutex_lock) __P((DB_ENV *, db_mutex_t));
-	int  (*mutex_set_align) __P((DB_ENV *, u_int32_t));
-	int  (*mutex_set_increment) __P((DB_ENV *, u_int32_t));
-	int  (*mutex_set_max) __P((DB_ENV *, u_int32_t));
-	int  (*mutex_set_tas_spins) __P((DB_ENV *, u_int32_t));
-	int  (*mutex_stat) __P((DB_ENV *, DB_MUTEX_STAT **, u_int32_t));
-	int  (*mutex_stat_print) __P((DB_ENV *, u_int32_t));
+	int  (*mutex_set_align) __P((DB_ENV *, uint32_t));
+	int  (*mutex_set_increment) __P((DB_ENV *, uint32_t));
+	int  (*mutex_set_max) __P((DB_ENV *, uint32_t));
+	int  (*mutex_set_tas_spins) __P((DB_ENV *, uint32_t));
+	int  (*mutex_stat) __P((DB_ENV *, DB_MUTEX_STAT **, uint32_t));
+	int  (*mutex_stat_print) __P((DB_ENV *, uint32_t));
 	int  (*mutex_unlock) __P((DB_ENV *, db_mutex_t));
-	int  (*open) __P((DB_ENV *, const char *, u_int32_t, int));
-	int  (*remove) __P((DB_ENV *, const char *, u_int32_t));
-	int  (*rep_elect) __P((DB_ENV *, int, int, u_int32_t));
+	int  (*open) __P((DB_ENV *, const char *, uint32_t, int));
+	int  (*remove) __P((DB_ENV *, const char *, uint32_t));
+	int  (*rep_elect) __P((DB_ENV *, int, int, uint32_t));
 	int  (*rep_flush) __P((DB_ENV *));
-	int  (*rep_get_config) __P((DB_ENV *, u_int32_t, int *));
-	int  (*rep_get_limit) __P((DB_ENV *, u_int32_t *, u_int32_t *));
+	int  (*rep_get_config) __P((DB_ENV *, uint32_t, int *));
+	int  (*rep_get_limit) __P((DB_ENV *, uint32_t *, uint32_t *));
 	int  (*rep_get_nsites) __P((DB_ENV *, int *));
 	int  (*rep_get_priority) __P((DB_ENV *, int *));
-	int  (*rep_get_timeout) __P((DB_ENV *, int, u_int32_t *));
+	int  (*rep_get_timeout) __P((DB_ENV *, int, uint32_t *));
 	int  (*rep_process_message)
 		__P((DB_ENV *, DBT *, DBT *, int, DB_LSN *));
-	int  (*rep_set_config) __P((DB_ENV *, u_int32_t, int));
-	int  (*rep_set_lease) __P((DB_ENV *, u_int32_t, u_int32_t));
-	int  (*rep_set_limit) __P((DB_ENV *, u_int32_t, u_int32_t));
+	int  (*rep_set_config) __P((DB_ENV *, uint32_t, int));
+	int  (*rep_set_lease) __P((DB_ENV *, uint32_t, uint32_t));
+	int  (*rep_set_limit) __P((DB_ENV *, uint32_t, uint32_t));
 	int  (*rep_set_nsites) __P((DB_ENV *, int));
 	int  (*rep_set_priority) __P((DB_ENV *, int));
 	int  (*rep_set_timeout) __P((DB_ENV *, int, db_timeout_t));
 	int  (*rep_set_transport) __P((DB_ENV *, int, int (*)(DB_ENV *,
-		const DBT *, const DBT *, const DB_LSN *, int, u_int32_t)));
-	int  (*rep_start) __P((DB_ENV *, DBT *, u_int32_t));
-	int  (*rep_stat) __P((DB_ENV *, DB_REP_STAT **, u_int32_t));
-	int  (*rep_stat_print) __P((DB_ENV *, u_int32_t));
-	int  (*rep_sync) __P((DB_ENV *, u_int32_t));
+		const DBT *, const DBT *, const DB_LSN *, int, uint32_t)));
+	int  (*rep_start) __P((DB_ENV *, DBT *, uint32_t));
+	int  (*rep_stat) __P((DB_ENV *, DB_REP_STAT **, uint32_t));
+	int  (*rep_stat_print) __P((DB_ENV *, uint32_t));
+	int  (*rep_sync) __P((DB_ENV *, uint32_t));
 	int  (*repmgr_add_remote_site) __P((DB_ENV *, const char *, u_int,
-		int *, u_int32_t));
+		int *, uint32_t));
 	int  (*repmgr_get_ack_policy) __P((DB_ENV *, int *));
 	int  (*repmgr_set_ack_policy) __P((DB_ENV *, int));
 	int  (*repmgr_set_local_site) __P((DB_ENV *, const char *, u_int,
-		u_int32_t));
+		uint32_t));
 	int  (*repmgr_site_list) __P((DB_ENV *, u_int *,
 		DB_REPMGR_SITE **));
-	int  (*repmgr_start) __P((DB_ENV *, int, u_int32_t));
-	int  (*repmgr_stat) __P((DB_ENV *, DB_REPMGR_STAT **, u_int32_t));
-	int  (*repmgr_stat_print) __P((DB_ENV *, u_int32_t));
+	int  (*repmgr_start) __P((DB_ENV *, int, uint32_t));
+	int  (*repmgr_stat) __P((DB_ENV *, DB_REPMGR_STAT **, uint32_t));
+	int  (*repmgr_stat_print) __P((DB_ENV *, uint32_t));
 	int  (*set_alloc) __P((DB_ENV *, void *(*)(size_t),
 		void *(*)(void *, size_t), void (*)(void *)));
 	int  (*set_app_dispatch)
 		__P((DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)));
-	int  (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int));
-	int  (*set_cache_max) __P((DB_ENV *, u_int32_t, u_int32_t));
+	int  (*set_cachesize) __P((DB_ENV *, uint32_t, uint32_t, int));
+	int  (*set_cache_max) __P((DB_ENV *, uint32_t, uint32_t));
 	int  (*set_data_dir) __P((DB_ENV *, const char *));
-	int  (*set_encrypt) __P((DB_ENV *, const char *, u_int32_t));
+	int  (*set_encrypt) __P((DB_ENV *, const char *, uint32_t));
 	void (*set_errcall) __P((DB_ENV *,
 		void (*)(const DB_ENV *, const char *, const char *)));
 	void (*set_errfile) __P((DB_ENV *, FILE *));
 	void (*set_errpfx) __P((DB_ENV *, const char *));
 	int  (*set_event_notify)
-		__P((DB_ENV *, void (*)(DB_ENV *, u_int32_t, void *)));
+		__P((DB_ENV *, void (*)(DB_ENV *, uint32_t, void *)));
 	int  (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int)));
-	int  (*set_flags) __P((DB_ENV *, u_int32_t, int));
-	int  (*set_intermediate_dir) __P((DB_ENV *, int, u_int32_t));
+	int  (*set_flags) __P((DB_ENV *, uint32_t, int));
+	int  (*set_intermediate_dir) __P((DB_ENV *, int, uint32_t));
 	int  (*set_isalive) __P((DB_ENV *,
-		int (*)(DB_ENV *, pid_t, db_threadid_t, u_int32_t)));
-	int  (*set_lg_bsize) __P((DB_ENV *, u_int32_t));
+		int (*)(DB_ENV *, pid_t, db_threadid_t, uint32_t)));
+	int  (*set_lg_bsize) __P((DB_ENV *, uint32_t));
 	int  (*set_lg_dir) __P((DB_ENV *, const char *));
 	int  (*set_lg_filemode) __P((DB_ENV *, int));
-	int  (*set_lg_max) __P((DB_ENV *, u_int32_t));
-	int  (*set_lg_regionmax) __P((DB_ENV *, u_int32_t));
-	int  (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int));
-	int  (*set_lk_detect) __P((DB_ENV *, u_int32_t));
-	int  (*set_lk_max_lockers) __P((DB_ENV *, u_int32_t));
-	int  (*set_lk_max_locks) __P((DB_ENV *, u_int32_t));
-	int  (*set_lk_max_objects) __P((DB_ENV *, u_int32_t));
+	int  (*set_lg_max) __P((DB_ENV *, uint32_t));
+	int  (*set_lg_regionmax) __P((DB_ENV *, uint32_t));
+	int  (*set_lk_conflicts) __P((DB_ENV *, uint8_t *, int));
+	int  (*set_lk_detect) __P((DB_ENV *, uint32_t));
+	int  (*set_lk_max_lockers) __P((DB_ENV *, uint32_t));
+	int  (*set_lk_max_locks) __P((DB_ENV *, uint32_t));
+	int  (*set_lk_max_objects) __P((DB_ENV *, uint32_t));
 	int  (*set_mp_max_openfd) __P((DB_ENV *, int));
 	int  (*set_mp_max_write) __P((DB_ENV *, int, db_timeout_t));
 	int  (*set_mp_mmapsize) __P((DB_ENV *, size_t));
@@ -2433,27 +2433,27 @@ struct __db_env {
 		__P((DB_ENV *, void (*)(const DB_ENV *, const char *)));
 	void (*set_msgfile) __P((DB_ENV *, FILE *));
 	int  (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int)));
-	int  (*set_rep_request) __P((DB_ENV *, u_int32_t, u_int32_t));
+	int  (*set_rep_request) __P((DB_ENV *, uint32_t, uint32_t));
 	int  (*set_rpc_server)
-		__P((DB_ENV *, void *, const char *, long, long, u_int32_t));
+		__P((DB_ENV *, void *, const char *, long, long, uint32_t));
 	int  (*set_shm_key) __P((DB_ENV *, long));
-	int  (*set_thread_count) __P((DB_ENV *, u_int32_t));
+	int  (*set_thread_count) __P((DB_ENV *, uint32_t));
 	int  (*set_thread_id) __P((DB_ENV *,
 		void (*)(DB_ENV *, pid_t *, db_threadid_t *)));
 	int  (*set_thread_id_string) __P((DB_ENV *,
 		char *(*)(DB_ENV *, pid_t, db_threadid_t, char *)));
-	int  (*set_timeout) __P((DB_ENV *, db_timeout_t, u_int32_t));
+	int  (*set_timeout) __P((DB_ENV *, db_timeout_t, uint32_t));
 	int  (*set_tmp_dir) __P((DB_ENV *, const char *));
-	int  (*set_tx_max) __P((DB_ENV *, u_int32_t));
+	int  (*set_tx_max) __P((DB_ENV *, uint32_t));
 	int  (*set_tx_timestamp) __P((DB_ENV *, time_t *));
-	int  (*set_verbose) __P((DB_ENV *, u_int32_t, int));
-	int  (*stat_print) __P((DB_ENV *, u_int32_t));
-	int  (*txn_begin) __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
-	int  (*txn_checkpoint) __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_t));
+	int  (*set_verbose) __P((DB_ENV *, uint32_t, int));
+	int  (*stat_print) __P((DB_ENV *, uint32_t));
+	int  (*txn_begin) __P((DB_ENV *, DB_TXN *, DB_TXN **, uint32_t));
+	int  (*txn_checkpoint) __P((DB_ENV *, uint32_t, uint32_t, uint32_t));
 	int  (*txn_recover)
-		__P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t));
-	int  (*txn_stat) __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
-	int  (*txn_stat_print) __P((DB_ENV *, u_int32_t));
+		__P((DB_ENV *, DB_PREPLIST *, long, long *, uint32_t));
+	int  (*txn_stat) __P((DB_ENV *, DB_TXN_STAT **, uint32_t));
+	int  (*txn_stat_print) __P((DB_ENV *, uint32_t));
 	/* DB_ENV PUBLIC HANDLE LIST END */
 
 	/* DB_ENV PRIVATE HANDLE LIST BEGIN */
@@ -2508,7 +2508,7 @@ struct __db_env {
 #define	DB_ENV_TXN_SNAPSHOT	0x20000000 /* DB_TXN_SNAPSHOT set. */
 #define	DB_ENV_TXN_WRITE_NOSYNC	0x40000000 /* DB_TXN_WRITE_NOSYNC set. */
 #define	DB_ENV_YIELDCPU		0x80000000 /* DB_YIELDCPU set. */
-	u_int32_t flags;
+	uint32_t flags;
 };
 
 #ifndef DB_DBM_HSEARCH
@@ -2609,9 +2609,9 @@ typedef struct entry {
 extern "C" {
 #endif
 
-int db_create __P((DB **, DB_ENV *, u_int32_t));
+int db_create __P((DB **, DB_ENV *, uint32_t));
 char *db_strerror __P((int));
-int db_env_create __P((DB_ENV **, u_int32_t));
+int db_env_create __P((DB_ENV **, uint32_t));
 char *db_version __P((int *, int *, int *));
 int log_compare __P((const DB_LSN *, const DB_LSN *));
 int db_env_set_func_close __P((int (*)(int)));
@@ -2621,7 +2621,7 @@ int db_env_set_func_exists __P((int (*)(const char *, int *)));
 int db_env_set_func_free __P((void (*)(void *)));
 int db_env_set_func_fsync __P((int (*)(int)));
 int db_env_set_func_ftruncate __P((int (*)(int, off_t)));
-int db_env_set_func_ioinfo __P((int (*)(const char *, int, u_int32_t *, u_int32_t *, u_int32_t *)));
+int db_env_set_func_ioinfo __P((int (*)(const char *, int, uint32_t *, uint32_t *, uint32_t *)));
 int db_env_set_func_malloc __P((void *(*)(size_t)));
 int db_env_set_func_map __P((int (*)(char *, size_t, int, int, void **)));
 int db_env_set_func_pread __P((ssize_t (*)(int, void *, size_t, off_t)));
@@ -2636,7 +2636,7 @@ int db_env_set_func_unlink __P((int (*)(const char *)));
 int db_env_set_func_unmap __P((int (*)(void *, size_t)));
 int db_env_set_func_write __P((ssize_t (*)(int, const void *, size_t)));
 int db_env_set_func_yield __P((int (*)(void)));
-int db_sequence_create __P((DB_SEQUENCE **, DB *, u_int32_t));
+int db_sequence_create __P((DB_SEQUENCE **, DB *, uint32_t));
 #if DB_DBM_HSEARCH != 0
 int	 __db_ndbm_clearerr __P((DBM *));
 void	 __db_ndbm_close __P((DBM *));
diff --git a/buildheader/make_tdb.cc b/buildheader/make_tdb.cc
index 6b3496200255950f75a5d414967d3105a24b1ac8..c7dfe5fc699233b79c3367ba017abf8bd345fc38 100644
--- a/buildheader/make_tdb.cc
+++ b/buildheader/make_tdb.cc
@@ -12,7 +12,6 @@
 // Don't include toku_assert.h.   Just use assert.h
 #include <assert.h>
 #include <string.h>
-#include <stdbool.h>
 
 #define VISIBLE "__attribute__((__visibility__(\"default\")))"
 
@@ -281,18 +280,18 @@ static void print_db_env_struct (void) {
     field_counter=0;
     STRUCT_SETUP(DB_ENV, api1_internal,   "void *%s"); /* Used for C++ hacking. */
     STRUCT_SETUP(DB_ENV, app_private, "void *%s");
-    STRUCT_SETUP(DB_ENV, close, "int  (*%s) (DB_ENV *, u_int32_t)");
+    STRUCT_SETUP(DB_ENV, close, "int  (*%s) (DB_ENV *, uint32_t)");
     STRUCT_SETUP(DB_ENV, err, "void (*%s) (const DB_ENV *, int, const char *, ...) __attribute__ (( format (printf, 3, 4) ))");
 #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3
-    STRUCT_SETUP(DB_ENV, get_cachesize, "int  (*%s) (DB_ENV *, u_int32_t *, u_int32_t *, int *)");
-    STRUCT_SETUP(DB_ENV, get_flags, "int  (*%s) (DB_ENV *, u_int32_t *)");
-    STRUCT_SETUP(DB_ENV, get_lk_max_locks, "int  (*%s) (DB_ENV *, u_int32_t *)");    
-    STRUCT_SETUP(DB_ENV, get_lg_max, "int  (*%s) (DB_ENV *, u_int32_t*)");
+    STRUCT_SETUP(DB_ENV, get_cachesize, "int  (*%s) (DB_ENV *, uint32_t *, uint32_t *, int *)");
+    STRUCT_SETUP(DB_ENV, get_flags, "int  (*%s) (DB_ENV *, uint32_t *)");
+    STRUCT_SETUP(DB_ENV, get_lk_max_locks, "int  (*%s) (DB_ENV *, uint32_t *)");    
+    STRUCT_SETUP(DB_ENV, get_lg_max, "int  (*%s) (DB_ENV *, uint32_t*)");
 #endif
-    STRUCT_SETUP(DB_ENV, log_archive, "int  (*%s) (DB_ENV *, char **[], u_int32_t)");
+    STRUCT_SETUP(DB_ENV, log_archive, "int  (*%s) (DB_ENV *, char **[], uint32_t)");
     STRUCT_SETUP(DB_ENV, log_flush, "int  (*%s) (DB_ENV *, const DB_LSN *)");
-    STRUCT_SETUP(DB_ENV, open, "int  (*%s) (DB_ENV *, const char *, u_int32_t, int)");
-    STRUCT_SETUP(DB_ENV, set_cachesize, "int  (*%s) (DB_ENV *, u_int32_t, u_int32_t, int)");
+    STRUCT_SETUP(DB_ENV, open, "int  (*%s) (DB_ENV *, const char *, uint32_t, int)");
+    STRUCT_SETUP(DB_ENV, set_cachesize, "int  (*%s) (DB_ENV *, uint32_t, uint32_t, int)");
     STRUCT_SETUP(DB_ENV, set_data_dir, "int  (*%s) (DB_ENV *, const char *)");
 #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 1
     STRUCT_SETUP(DB_ENV, set_errcall, "void (*%s) (DB_ENV *, void (*)(const char *, char *))");
@@ -302,32 +301,32 @@ static void print_db_env_struct (void) {
 #endif
     STRUCT_SETUP(DB_ENV, set_errfile, "void (*%s) (DB_ENV *, FILE*)");
     STRUCT_SETUP(DB_ENV, set_errpfx, "void (*%s) (DB_ENV *, const char *)");
-    STRUCT_SETUP(DB_ENV, set_flags, "int  (*%s) (DB_ENV *, u_int32_t, int)");
-    STRUCT_SETUP(DB_ENV, set_lg_bsize, "int  (*%s) (DB_ENV *, u_int32_t)");
+    STRUCT_SETUP(DB_ENV, set_flags, "int  (*%s) (DB_ENV *, uint32_t, int)");
+    STRUCT_SETUP(DB_ENV, set_lg_bsize, "int  (*%s) (DB_ENV *, uint32_t)");
     STRUCT_SETUP(DB_ENV, set_lg_dir, "int  (*%s) (DB_ENV *, const char *)");
-    STRUCT_SETUP(DB_ENV, set_lg_max, "int  (*%s) (DB_ENV *, u_int32_t)");
-    STRUCT_SETUP(DB_ENV, set_lk_detect, "int  (*%s) (DB_ENV *, u_int32_t)");
+    STRUCT_SETUP(DB_ENV, set_lg_max, "int  (*%s) (DB_ENV *, uint32_t)");
+    STRUCT_SETUP(DB_ENV, set_lk_detect, "int  (*%s) (DB_ENV *, uint32_t)");
 #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR <= 4
-    STRUCT_SETUP(DB_ENV, set_lk_max, "int  (*%s) (DB_ENV *, u_int32_t)");
+    STRUCT_SETUP(DB_ENV, set_lk_max, "int  (*%s) (DB_ENV *, uint32_t)");
 #endif
-    STRUCT_SETUP(DB_ENV, set_lk_max_locks, "int  (*%s) (DB_ENV *, u_int32_t)");
+    STRUCT_SETUP(DB_ENV, set_lk_max_locks, "int  (*%s) (DB_ENV *, uint32_t)");
     //STRUCT_SETUP(DB_ENV, set_noticecall, "void (*%s) (DB_ENV *, void (*)(DB_ENV *, db_notices))");
     STRUCT_SETUP(DB_ENV, set_tmp_dir, "int  (*%s) (DB_ENV *, const char *)");
-    STRUCT_SETUP(DB_ENV, set_verbose, "int  (*%s) (DB_ENV *, u_int32_t, int)");
-    STRUCT_SETUP(DB_ENV, txn_checkpoint, "int  (*%s) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t)");
-    STRUCT_SETUP(DB_ENV, txn_stat,    "int  (*%s) (DB_ENV *, DB_TXN_STAT **, u_int32_t)");
-    STRUCT_SETUP(DB_ENV, txn_begin,   "int  (*%s) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)");
-    STRUCT_SETUP(DB_ENV, txn_recover, "int  (*%s) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags)");
-    STRUCT_SETUP(DB_ENV, dbremove,    "int  (*%s) (DB_ENV *, DB_TXN *, const char *, const char *, u_int32_t)");
-    STRUCT_SETUP(DB_ENV, dbrename,    "int  (*%s) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, u_int32_t)");
+    STRUCT_SETUP(DB_ENV, set_verbose, "int  (*%s) (DB_ENV *, uint32_t, int)");
+    STRUCT_SETUP(DB_ENV, txn_checkpoint, "int  (*%s) (DB_ENV *, uint32_t, uint32_t, uint32_t)");
+    STRUCT_SETUP(DB_ENV, txn_stat,    "int  (*%s) (DB_ENV *, DB_TXN_STAT **, uint32_t)");
+    STRUCT_SETUP(DB_ENV, txn_begin,   "int  (*%s) (DB_ENV *, DB_TXN *, DB_TXN **, uint32_t)");
+    STRUCT_SETUP(DB_ENV, txn_recover, "int  (*%s) (DB_ENV *, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, uint32_t flags)");
+    STRUCT_SETUP(DB_ENV, dbremove,    "int  (*%s) (DB_ENV *, DB_TXN *, const char *, const char *, uint32_t)");
+    STRUCT_SETUP(DB_ENV, dbrename,    "int  (*%s) (DB_ENV *, DB_TXN *, const char *, const char *, const char *, uint32_t)");
 
         const char *extra[]={
-                             "int (*checkpointing_set_period)             (DB_ENV*, u_int32_t) /* Change the delay between automatic checkpoints.  0 means disabled. */",
-                             "int (*checkpointing_get_period)             (DB_ENV*, u_int32_t*) /* Retrieve the delay between automatic checkpoints.  0 means disabled. */",
-                             "int (*cleaner_set_period)                   (DB_ENV*, u_int32_t) /* Change the delay between automatic cleaner attempts.  0 means disabled. */",
-                             "int (*cleaner_get_period)                   (DB_ENV*, u_int32_t*) /* Retrieve the delay between automatic cleaner attempts.  0 means disabled. */",
-                             "int (*cleaner_set_iterations)               (DB_ENV*, u_int32_t) /* Change the number of attempts on each cleaner invokation.  0 means disabled. */",
-                             "int (*cleaner_get_iterations)               (DB_ENV*, u_int32_t*) /* Retrieve the number of attempts on each cleaner invokation.  0 means disabled. */",
+                             "int (*checkpointing_set_period)             (DB_ENV*, uint32_t) /* Change the delay between automatic checkpoints.  0 means disabled. */",
+                             "int (*checkpointing_get_period)             (DB_ENV*, uint32_t*) /* Retrieve the delay between automatic checkpoints.  0 means disabled. */",
+                             "int (*cleaner_set_period)                   (DB_ENV*, uint32_t) /* Change the delay between automatic cleaner attempts.  0 means disabled. */",
+                             "int (*cleaner_get_period)                   (DB_ENV*, uint32_t*) /* Retrieve the delay between automatic cleaner attempts.  0 means disabled. */",
+                             "int (*cleaner_set_iterations)               (DB_ENV*, uint32_t) /* Change the number of attempts on each cleaner invokation.  0 means disabled. */",
+                             "int (*cleaner_get_iterations)               (DB_ENV*, uint32_t*) /* Retrieve the number of attempts on each cleaner invokation.  0 means disabled. */",
                              "int (*checkpointing_postpone)               (DB_ENV*) /* Use for 'rename table' or any other operation that must be disjoint from a checkpoint */",
                              "int (*checkpointing_resume)                 (DB_ENV*) /* Alert tokudb 'postpone' is no longer necessary */",
                              "int (*checkpointing_begin_atomic_operation) (DB_ENV*) /* Begin a set of operations (that must be atomic as far as checkpoints are concerned). i.e. inserting into every index in one table */",
@@ -361,7 +360,7 @@ static void print_db_env_struct (void) {
                              "void (*set_update)                          (DB_ENV *env, int (*update_function)(DB *, const DBT *key, const DBT *old_val, const DBT *extra, void (*set_val)(const DBT *new_val, void *set_extra), void *set_extra))",
                              "int (*set_lock_timeout)                     (DB_ENV *env, uint64_t lock_wait_time_msec)",
                              "int (*get_lock_timeout)                     (DB_ENV *env, uint64_t *lock_wait_time_msec)",
-			     "int (*txn_xa_recover)                       (DB_ENV*, TOKU_XA_XID list[/*count*/], long count, /*out*/ long *retp, u_int32_t flags)",
+			     "int (*txn_xa_recover)                       (DB_ENV*, TOKU_XA_XID list[/*count*/], long count, /*out*/ long *retp, uint32_t flags)",
 			     "int (*get_txn_from_xid)                 (DB_ENV*, /*in*/ TOKU_XA_XID *, /*out*/ DB_TXN **)",
 			     "int (*get_cursor_for_directory)            (DB_ENV*, /*in*/ DB_TXN *, /*out*/ DBC **)",
                              NULL};
@@ -388,9 +387,9 @@ static void print_dbt_struct (void) {
     STRUCT_SETUP(DBT, app_private, "void*%s");
 #endif
     STRUCT_SETUP(DBT, data,        "void*%s");
-    STRUCT_SETUP(DBT, flags,       "u_int32_t %s");
-    STRUCT_SETUP(DBT, size,        "u_int32_t %s");
-    STRUCT_SETUP(DBT, ulen,        "u_int32_t %s");
+    STRUCT_SETUP(DBT, flags,       "uint32_t %s");
+    STRUCT_SETUP(DBT, size,        "uint32_t %s");
+    STRUCT_SETUP(DBT, ulen,        "uint32_t %s");
     sort_and_dump_fields("dbt", false, NULL);
 }
 
@@ -399,50 +398,50 @@ static void print_db_struct (void) {
     field_counter=0;
     STRUCT_SETUP(DB, api_internal,   "void *%s"); /* Used for C++ hacking. */
     STRUCT_SETUP(DB, app_private,    "void *%s");
-    STRUCT_SETUP(DB, close,          "int (*%s) (DB*, u_int32_t)");
-    STRUCT_SETUP(DB, cursor,         "int (*%s) (DB *, DB_TXN *, DBC **, u_int32_t)");
+    STRUCT_SETUP(DB, close,          "int (*%s) (DB*, uint32_t)");
+    STRUCT_SETUP(DB, cursor,         "int (*%s) (DB *, DB_TXN *, DBC **, uint32_t)");
     STRUCT_SETUP(DB, dbenv,          "DB_ENV *%s");
-    STRUCT_SETUP(DB, del,            "int (*%s) (DB *, DB_TXN *, DBT *, u_int32_t)");
+    STRUCT_SETUP(DB, del,            "int (*%s) (DB *, DB_TXN *, DBT *, uint32_t)");
     STRUCT_SETUP(DB, fd,             "int (*%s) (DB *, int *)");
-    STRUCT_SETUP(DB, get,            "int (*%s) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)");
+    STRUCT_SETUP(DB, get,            "int (*%s) (DB *, DB_TXN *, DBT *, DBT *, uint32_t)");
 #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3
-    STRUCT_SETUP(DB, get_flags,      "int (*%s) (DB *, u_int32_t *)");
-    STRUCT_SETUP(DB, get_pagesize,   "int (*%s) (DB *, u_int32_t *)");
+    STRUCT_SETUP(DB, get_flags,      "int (*%s) (DB *, uint32_t *)");
+    STRUCT_SETUP(DB, get_pagesize,   "int (*%s) (DB *, uint32_t *)");
 #endif
-    STRUCT_SETUP(DB, key_range,      "int (*%s) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t)");
-    STRUCT_SETUP(DB, open,           "int (*%s) (DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int)");
-    STRUCT_SETUP(DB, put,            "int (*%s) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t)");
+    STRUCT_SETUP(DB, key_range,      "int (*%s) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, uint32_t)");
+    STRUCT_SETUP(DB, open,           "int (*%s) (DB *, DB_TXN *, const char *, const char *, DBTYPE, uint32_t, int)");
+    STRUCT_SETUP(DB, put,            "int (*%s) (DB *, DB_TXN *, DBT *, DBT *, uint32_t)");
     STRUCT_SETUP(DB, set_errfile,    "void (*%s) (DB *, FILE*)");
-    STRUCT_SETUP(DB, set_flags,      "int (*%s) (DB *, u_int32_t)");
-    STRUCT_SETUP(DB, set_pagesize,   "int (*%s) (DB *, u_int32_t)");
-    STRUCT_SETUP(DB, stat,           "int (*%s) (DB *, void *, u_int32_t)");
-    STRUCT_SETUP(DB, verify,         "int (*%s) (DB *, const char *, const char *, FILE *, u_int32_t)");
-    const char *extra[]={"int (*key_range64)(DB*, DB_TXN *, DBT *, u_int64_t *less, u_int64_t *equal, u_int64_t *greater, int *is_exact)",
+    STRUCT_SETUP(DB, set_flags,      "int (*%s) (DB *, uint32_t)");
+    STRUCT_SETUP(DB, set_pagesize,   "int (*%s) (DB *, uint32_t)");
+    STRUCT_SETUP(DB, stat,           "int (*%s) (DB *, void *, uint32_t)");
+    STRUCT_SETUP(DB, verify,         "int (*%s) (DB *, const char *, const char *, FILE *, uint32_t)");
+    const char *extra[]={"int (*key_range64)(DB*, DB_TXN *, DBT *, uint64_t *less, uint64_t *equal, uint64_t *greater, int *is_exact)",
 			 "int (*stat64)(DB *, DB_TXN *, DB_BTREE_STAT64 *)",
 			 "int (*pre_acquire_table_lock)(DB*, DB_TXN*)",
 			 "int (*pre_acquire_fileops_lock)(DB*, DB_TXN*)",
 			 "const DBT* (*dbt_pos_infty)(void) /* Return the special DBT that refers to positive infinity in the lock table.*/",
 			 "const DBT* (*dbt_neg_infty)(void)/* Return the special DBT that refers to negative infinity in the lock table.*/",
-			 "void (*get_max_row_size) (DB*, u_int32_t *max_key_size, u_int32_t *max_row_size)",
+			 "void (*get_max_row_size) (DB*, uint32_t *max_key_size, uint32_t *max_row_size)",
 			 "DESCRIPTOR descriptor /* saved row/dictionary descriptor for aiding in comparisons */",
 			 "DESCRIPTOR cmp_descriptor /* saved row/dictionary descriptor for aiding in comparisons */",
-			 "int (*change_descriptor) (DB*, DB_TXN*, const DBT* descriptor, u_int32_t) /* change row/dictionary descriptor for a db.  Available only while db is open */",
-			 "int (*getf_set)(DB*, DB_TXN*, u_int32_t, DBT*, YDB_CALLBACK_FUNCTION, void*) /* same as DBC->c_getf_set without a persistent cursor) */",
+			 "int (*change_descriptor) (DB*, DB_TXN*, const DBT* descriptor, uint32_t) /* change row/dictionary descriptor for a db.  Available only while db is open */",
+			 "int (*getf_set)(DB*, DB_TXN*, uint32_t, DBT*, YDB_CALLBACK_FUNCTION, void*) /* same as DBC->c_getf_set without a persistent cursor) */",
 			 "int (*optimize)(DB*) /* Run garbage collecion and promote all transactions older than oldest. Amortized (happens during flattening) */",
 			 "int (*hot_optimize)(DB*, int (*progress_callback)(void *progress_extra, float progress), void *progress_extra)",
 			 "int (*get_fragmentation)(DB*,TOKU_DB_FRAGMENTATION)",
-			 "int (*change_pagesize)(DB*,u_int32_t)",
-			 "int (*change_readpagesize)(DB*,u_int32_t)",
-			 "int (*get_readpagesize)(DB*,u_int32_t*)",
-			 "int (*set_readpagesize)(DB*,u_int32_t)",
+			 "int (*change_pagesize)(DB*,uint32_t)",
+			 "int (*change_readpagesize)(DB*,uint32_t)",
+			 "int (*get_readpagesize)(DB*,uint32_t*)",
+			 "int (*set_readpagesize)(DB*,uint32_t)",
 			 "int (*change_compression_method)(DB*,TOKU_COMPRESSION_METHOD)",
 			 "int (*get_compression_method)(DB*,TOKU_COMPRESSION_METHOD*)",
 			 "int (*set_compression_method)(DB*,TOKU_COMPRESSION_METHOD)",
 			 "int (*set_indexer)(DB*, DB_INDEXER*)",
 			 "void (*get_indexer)(DB*, DB_INDEXER**)",
 			 "int (*verify_with_progress)(DB *, int (*progress_callback)(void *progress_extra, float progress), void *progress_extra, int verbose, int keep_going)",
-			 "int (*update)(DB *, DB_TXN*, const DBT *key, const DBT *extra, u_int32_t flags)",
-			 "int (*update_broadcast)(DB *, DB_TXN*, const DBT *extra, u_int32_t flags)",
+			 "int (*update)(DB *, DB_TXN*, const DBT *key, const DBT *extra, uint32_t flags)",
+			 "int (*update_broadcast)(DB *, DB_TXN*, const DBT *extra, uint32_t flags)",
 			 NULL};
     sort_and_dump_fields("db", true, extra);
 }
@@ -450,7 +449,7 @@ static void print_db_struct (void) {
 static void print_db_txn_active_struct (void) {
     field_counter=0;
     STRUCT_SETUP(DB_TXN_ACTIVE, lsn, "DB_LSN %s");
-    STRUCT_SETUP(DB_TXN_ACTIVE, txnid, "u_int32_t %s");
+    STRUCT_SETUP(DB_TXN_ACTIVE, txnid, "uint32_t %s");
     sort_and_dump_fields("db_txn_active", false, NULL);
 }
 
@@ -458,9 +457,9 @@ static void print_db_txn_struct (void) {
     field_counter=0;
     STRUCT_SETUP(DB_TXN, abort,       "int (*%s) (DB_TXN *)");
     STRUCT_SETUP(DB_TXN, api_internal,"void *%s");
-    STRUCT_SETUP(DB_TXN, commit,      "int (*%s) (DB_TXN*, u_int32_t)");
-    STRUCT_SETUP(DB_TXN, prepare,     "int (*%s) (DB_TXN*, u_int8_t gid[DB_GID_SIZE])");
-    STRUCT_SETUP(DB_TXN, id,          "u_int32_t (*%s) (DB_TXN *)");
+    STRUCT_SETUP(DB_TXN, commit,      "int (*%s) (DB_TXN*, uint32_t)");
+    STRUCT_SETUP(DB_TXN, prepare,     "int (*%s) (DB_TXN*, uint8_t gid[DB_GID_SIZE])");
+    STRUCT_SETUP(DB_TXN, id,          "uint32_t (*%s) (DB_TXN *)");
     STRUCT_SETUP(DB_TXN, mgrp,        "DB_ENV *%s /*In TokuDB, mgrp is a DB_ENV not a DB_TXNMGR*/");
     STRUCT_SETUP(DB_TXN, parent,      "DB_TXN *%s");
     const char *extra[] = {
@@ -469,14 +468,14 @@ static void print_db_txn_struct (void) {
 	"int (*commit_with_progress)(DB_TXN*, uint32_t, TXN_PROGRESS_POLL_FUNCTION, void*)",
 	"int (*abort_with_progress)(DB_TXN*, TXN_PROGRESS_POLL_FUNCTION, void*)",
 	"int (*xa_prepare) (DB_TXN*, TOKU_XA_XID *)",
-    "u_int64_t (*id64) (DB_TXN*)",
+    "uint64_t (*id64) (DB_TXN*)",
 	NULL};
     sort_and_dump_fields("db_txn", false, extra);
 }
 
 static void print_db_txn_stat_struct (void) {
     field_counter=0;
-    STRUCT_SETUP(DB_TXN_STAT, st_nactive, "u_int32_t %s");
+    STRUCT_SETUP(DB_TXN_STAT, st_nactive, "uint32_t %s");
     STRUCT_SETUP(DB_TXN_STAT, st_txnarray, "DB_TXN_ACTIVE *%s");
     sort_and_dump_fields("db_txn_stat", false, NULL);
 }
@@ -484,21 +483,21 @@ static void print_db_txn_stat_struct (void) {
 static void print_dbc_struct (void) {
     field_counter=0;
     STRUCT_SETUP(DBC, c_close, "int (*%s) (DBC *)");
-    STRUCT_SETUP(DBC, c_count, "int (*%s) (DBC *, db_recno_t *, u_int32_t)");
-    //STRUCT_SETUP(DBC, c_del,   "int (*%s) (DBC *, u_int32_t)");  // c_del was removed.  See #4576.
-    STRUCT_SETUP(DBC, c_get,   "int (*%s) (DBC *, DBT *, DBT *, u_int32_t)");
+    STRUCT_SETUP(DBC, c_count, "int (*%s) (DBC *, db_recno_t *, uint32_t)");
+    //STRUCT_SETUP(DBC, c_del,   "int (*%s) (DBC *, uint32_t)");  // c_del was removed.  See #4576.
+    STRUCT_SETUP(DBC, c_get,   "int (*%s) (DBC *, DBT *, DBT *, uint32_t)");
     STRUCT_SETUP(DBC, dbp,     "DB *%s");
     const char *extra[]={
-	"int (*c_getf_first)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
-	"int (*c_getf_last)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
-	"int (*c_getf_next)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
-	"int (*c_getf_prev)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
-	"int (*c_getf_current)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
-	"int (*c_getf_current_binding)(DBC *, u_int32_t, YDB_CALLBACK_FUNCTION, void *)",
-
-	"int (*c_getf_set)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *)",
-	"int (*c_getf_set_range)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *)",
-	"int (*c_getf_set_range_reverse)(DBC *, u_int32_t, DBT *, YDB_CALLBACK_FUNCTION, void *)",
+	"int (*c_getf_first)(DBC *, uint32_t, YDB_CALLBACK_FUNCTION, void *)",
+	"int (*c_getf_last)(DBC *, uint32_t, YDB_CALLBACK_FUNCTION, void *)",
+	"int (*c_getf_next)(DBC *, uint32_t, YDB_CALLBACK_FUNCTION, void *)",
+	"int (*c_getf_prev)(DBC *, uint32_t, YDB_CALLBACK_FUNCTION, void *)",
+	"int (*c_getf_current)(DBC *, uint32_t, YDB_CALLBACK_FUNCTION, void *)",
+	"int (*c_getf_current_binding)(DBC *, uint32_t, YDB_CALLBACK_FUNCTION, void *)",
+
+	"int (*c_getf_set)(DBC *, uint32_t, DBT *, YDB_CALLBACK_FUNCTION, void *)",
+	"int (*c_getf_set_range)(DBC *, uint32_t, DBT *, YDB_CALLBACK_FUNCTION, void *)",
+	"int (*c_getf_set_range_reverse)(DBC *, uint32_t, DBT *, YDB_CALLBACK_FUNCTION, void *)",
 	"int (*c_pre_acquire_range_lock)(DBC*, const DBT*, const DBT*)",
 	NULL};
     sort_and_dump_fields("dbc", false, extra);
@@ -555,21 +554,21 @@ int main (int argc, char *const argv[] __attribute__((__unused__))) {
     printf("typedef struct __toku_dbc DBC;\n");
     printf("typedef struct __toku_dbt DBT;\n");
     printf("typedef struct __toku_db_preplist { DB_TXN *txn; uint8_t gid[DB_GID_SIZE]; } DB_PREPLIST;\n");
-    printf("typedef u_int32_t db_recno_t;\n");
+    printf("typedef uint32_t db_recno_t;\n");
     printf("typedef int(*YDB_CALLBACK_FUNCTION)(DBT const*, DBT const*, void*);\n");
 
     printf("#include <tdb-internal.h>\n");
     
     //stat64
     printf("typedef struct __toku_db_btree_stat64 {\n");
-    printf("  u_int64_t bt_nkeys; /* how many unique keys (guaranteed only to be an estimate, even when flattened)          */\n");
-    printf("  u_int64_t bt_ndata; /* how many key-value pairs (an estimate, but exact when flattened)                       */\n");
-    printf("  u_int64_t bt_dsize; /* how big are the keys+values (not counting the lengths) (an estimate, unless flattened) */\n");
-    printf("  u_int64_t bt_fsize; /* how big is the underlying file                                                         */\n");
+    printf("  uint64_t bt_nkeys; /* how many unique keys (guaranteed only to be an estimate, even when flattened)          */\n");
+    printf("  uint64_t bt_ndata; /* how many key-value pairs (an estimate, but exact when flattened)                       */\n");
+    printf("  uint64_t bt_dsize; /* how big are the keys+values (not counting the lengths) (an estimate, unless flattened) */\n");
+    printf("  uint64_t bt_fsize; /* how big is the underlying file                                                         */\n");
     // 4018
-    printf("  u_int64_t bt_create_time_sec; /* Creation time, in seconds */\n");
-    printf("  u_int64_t bt_modify_time_sec; /* Time of last serialization, in seconds */\n");
-    printf("  u_int64_t bt_verify_time_sec; /* Time of last verification, in seconds */\n");
+    printf("  uint64_t bt_create_time_sec; /* Creation time, in seconds */\n");
+    printf("  uint64_t bt_modify_time_sec; /* Time of last serialization, in seconds */\n");
+    printf("  uint64_t bt_verify_time_sec; /* Time of last verification, in seconds */\n");
     printf("} DB_BTREE_STAT64;\n");
 
     // compression methods
@@ -676,14 +675,14 @@ int main (int argc, char *const argv[] __attribute__((__unused__))) {
     printf("  uint8_t  stalled_on_checkpoint;\n");
     printf("} *TOKU_TXN_PROGRESS, TOKU_TXN_PROGRESS_S;\n");
     printf("typedef void(*TXN_PROGRESS_POLL_FUNCTION)(TOKU_TXN_PROGRESS, void*);\n");
-    printf("struct txn_stat {\n  u_int64_t rollback_raw_count;\n};\n");
+    printf("struct txn_stat {\n  uint64_t rollback_raw_count;\n};\n");
 
     print_db_txn_struct();
     print_db_txn_stat_struct();
     print_dbc_struct();
 
-    printf("int db_env_create(DB_ENV **, u_int32_t) %s;\n", VISIBLE);
-    printf("int db_create(DB **, DB_ENV *, u_int32_t) %s;\n", VISIBLE);
+    printf("int db_env_create(DB_ENV **, uint32_t) %s;\n", VISIBLE);
+    printf("int db_create(DB **, DB_ENV *, uint32_t) %s;\n", VISIBLE);
     printf("const char *db_strerror(int) %s;\n", VISIBLE);
     printf("const char *db_version(int*,int *,int *) %s;\n", VISIBLE);
     printf("int log_compare (const DB_LSN*, const DB_LSN *) %s;\n", VISIBLE);
@@ -708,8 +707,8 @@ int main (int argc, char *const argv[] __attribute__((__unused__))) {
     printf("void db_env_set_recover_callback (void (*)(void*), void*) %s;\n", VISIBLE);
     printf("void db_env_set_recover_callback2 (void (*)(void*), void*) %s;\n", VISIBLE);
     printf("void db_env_set_loader_size_factor (uint32_t) %s;\n", VISIBLE);
-    printf("void db_env_set_mvcc_garbage_collection_verification(u_int32_t) %s;\n", VISIBLE);
-    printf("void db_env_enable_engine_status(u_int32_t) %s;\n", VISIBLE);
+    printf("void db_env_set_mvcc_garbage_collection_verification(uint32_t) %s;\n", VISIBLE);
+    printf("void db_env_enable_engine_status(uint32_t) %s;\n", VISIBLE);
     printf("void db_env_set_flusher_thread_callback (void (*)(int, void*), void*) %s;\n", VISIBLE);
 
     printf("#if defined(__cplusplus) || defined(__cilkplusplus)\n}\n#endif\n");
diff --git a/db-benchmark-test/db-benchmark-test.cc b/db-benchmark-test/db-benchmark-test.cc
index 6b4271170394768e12a0a5184248c88d68c96315..737db5b431125e2f986e08065a8e7cc4eb3cbc78 100644
--- a/db-benchmark-test/db-benchmark-test.cc
+++ b/db-benchmark-test/db-benchmark-test.cc
@@ -68,11 +68,11 @@ int if_transactions_do_logging = DB_INIT_LOG; // set this to zero if we want no
 int do_abort = 0;
 int n_insertions_since_txn_began=0;
 int env_open_flags = DB_CREATE|DB_PRIVATE|DB_INIT_MPOOL;
-u_int32_t put_flags = 0;
+uint32_t put_flags = 0;
 double compressibility = -1; // -1 means make it very compressible.  1 means use random bits everywhere.  2 means half the bits are random.
 int do_append = 0;
 int do_checkpoint_period = 0;
-u_int32_t checkpoint_period = 0;
+uint32_t checkpoint_period = 0;
 static const char *log_dir = NULL;
 static int commitflags = 0;
 static int redzone = 0;
@@ -221,7 +221,7 @@ static void benchmark_setup (void) {
     if (do_checkpoint_period) {
         r = dbenv->checkpointing_set_period(dbenv, checkpoint_period);
         assert(r == 0);
-        u_int32_t period;
+        uint32_t period;
         r = dbenv->checkpointing_get_period(dbenv, &period);
         assert(r == 0 && period == checkpoint_period);
     }
@@ -231,16 +231,16 @@ static void benchmark_setup (void) {
     if (cleaner_period) {
         r = dbenv->cleaner_set_period(dbenv, cleaner_period);
         assert(r == 0);
-        u_int32_t period;
+        uint32_t period;
         r = dbenv->cleaner_get_period(dbenv, &period);
-        assert(r == 0 && period == (u_int32_t)cleaner_period);
+        assert(r == 0 && period == (uint32_t)cleaner_period);
     }
     if (cleaner_iterations) {
         r = dbenv->cleaner_set_iterations(dbenv, cleaner_iterations);
         assert(r == 0);
-        u_int32_t iterations;
+        uint32_t iterations;
         r = dbenv->cleaner_get_iterations(dbenv, &iterations);
-        assert(r == 0 && iterations == (u_int32_t)cleaner_iterations);
+        assert(r == 0 && iterations == (uint32_t)cleaner_iterations);
     }
 #endif
 
@@ -695,7 +695,7 @@ static int test_main (int argc, char *const argv[]) {
         } else if (strcmp(arg, "--checkpoint-period") == 0) {
             if (i+1 >= argc) return print_usage(argv[9]);
             do_checkpoint_period = 1;
-            checkpoint_period = (u_int32_t) atoi(argv[++i]);
+            checkpoint_period = (uint32_t) atoi(argv[++i]);
         } else if (strcmp(arg, "--nosync") == 0) {
             commitflags += DB_TXN_NOSYNC;
         } else if (strcmp(arg, "--userandom") == 0) {
diff --git a/db-benchmark-test/db-verify.cc b/db-benchmark-test/db-verify.cc
index 2112b38abe227ae41d3efdabcc24648cf35b5395..2ec3a29438ed7ad0594fdee75534014ecb1885e1 100644
--- a/db-benchmark-test/db-verify.cc
+++ b/db-benchmark-test/db-verify.cc
@@ -5,7 +5,6 @@
 #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
 #include <stdio.h>
 #include <string.h>
-#include <stdbool.h>
 #include <db.h>
 #include "tokudb_common_funcs.h"
 #include <assert.h>
diff --git a/db-benchmark-test/ptquery.cc b/db-benchmark-test/ptquery.cc
index 548ce381278882cd978522ab83e32ddc4417a8ea..eb3e834b6b7c28a7526273afcf96a9f90f17ede9 100644
--- a/db-benchmark-test/ptquery.cc
+++ b/db-benchmark-test/ptquery.cc
@@ -23,7 +23,7 @@ static const char *dbdir = "./bench."  STRINGIFY(DIRSUF); /* DIRSUF is passed in
 static int env_open_flags_yesx = DB_CREATE|DB_PRIVATE|DB_INIT_MPOOL|DB_INIT_TXN|DB_INIT_LOG|DB_INIT_LOCK|DB_RECOVER|DB_THREAD;
 // static int env_open_flags_nox = DB_CREATE|DB_PRIVATE|DB_INIT_MPOOL;
 static const char *dbfilename = "bench.db";
-static u_int64_t cachesize = 127*1024*1024;
+static uint64_t cachesize = 127*1024*1024;
 static int nqueries = 1000000;
 static int nthreads = 1;
 static const char *log_dir = NULL;
diff --git a/db-benchmark-test/scanrace.cc b/db-benchmark-test/scanrace.cc
index 4666e2e1a0346c4b62ef33c97bb30f37267ce873..4260be367e24d754e7cbe6fc93796fda8ed9dcfb 100644
--- a/db-benchmark-test/scanrace.cc
+++ b/db-benchmark-test/scanrace.cc
@@ -21,7 +21,7 @@
 
 static const char *pname;
 static long limitcount=-1;
-static u_int32_t cachesize = 16*1024*1024;
+static uint32_t cachesize = 16*1024*1024;
 
 #define STRINGIFY2(s) #s
 #define STRINGIFY(s) STRINGIFY2(s)
@@ -41,7 +41,7 @@ static void parse_args (int argc, char *const argv[]) {
         } else if (strcmp(*argv, "--cachesize")==0 && argc>0) {
             char *end;
             argv++; argc--;
-            cachesize=(u_int32_t)strtol(*argv, &end, 10);
+            cachesize=(uint32_t)strtol(*argv, &end, 10);
 	} else if (strcmp(*argv, "--env") == 0) {
 	    argv++; argc--;
 	    if (argc <= 0) goto print_usage;
diff --git a/db-benchmark-test/scanscan.cc b/db-benchmark-test/scanscan.cc
index 133ea653556c4adebde637bd3c9fcee148d73758..e10f39e21d9091ff5018dacd28e39ea3e73bb9a9 100644
--- a/db-benchmark-test/scanscan.cc
+++ b/db-benchmark-test/scanscan.cc
@@ -24,11 +24,11 @@ static const char *pname;
 static enum run_mode { RUN_HWC, RUN_LWC, RUN_VERIFY, RUN_RANGE} run_mode = RUN_HWC;
 static int do_txns=1, prelock=0, prelockflag=0;
 static int cleaner_period=0, cleaner_iterations=0;
-static u_int32_t lock_flag = 0;
+static uint32_t lock_flag = 0;
 static long limitcount=-1;
-static u_int32_t cachesize = 127*1024*1024;
+static uint32_t cachesize = 127*1024*1024;
 static int do_mysql = 0;
-static u_int64_t start_range = 0, end_range = 0;
+static uint64_t start_range = 0, end_range = 0;
 static int n_experiments = 2;
 static int bulk_fetch = 1;
 
@@ -110,15 +110,15 @@ static void parse_args (int argc, char *const argv[]) {
         } else if (strcmp(*argv, "--cachesize")==0 && argc>0) {
             char *end;
             argc--; argv++; 
-            cachesize=(u_int32_t)strtol(*argv, &end, 10);
+            cachesize=(uint32_t)strtol(*argv, &end, 10);
         } else if (strcmp(*argv, "--cleaner-period")==0 && argc>0) {
             char *end;
             argc--; argv++; 
-            cleaner_period=(u_int32_t)strtol(*argv, &end, 10);
+            cleaner_period=(uint32_t)strtol(*argv, &end, 10);
         } else if (strcmp(*argv, "--cleaner-iterations")==0 && argc>0) {
             char *end;
             argc--; argv++; 
-            cleaner_iterations=(u_int32_t)strtol(*argv, &end, 10);
+            cleaner_iterations=(uint32_t)strtol(*argv, &end, 10);
 	} else if (strcmp(*argv, "--env") == 0) {
             argc--; argv++;
 	    if (argc==0) exit(print_usage(pname));
@@ -264,7 +264,7 @@ static void scanscan_hwc (void) {
 	r = db->cursor(db, tid, &dbc, 0);                           assert(r==0);
 	memset(&k, 0, sizeof(k));
 	memset(&v, 0, sizeof(v));
-        u_int32_t c_get_flags = DB_NEXT;
+        uint32_t c_get_flags = DB_NEXT;
         if (prelockflag && (counter || prelock)) {
             c_get_flags |= lock_flag;
         }
@@ -313,7 +313,7 @@ static void scanscan_lwc (void) {
 	if(prelock) {
             r = dbc->c_pre_acquire_range_lock(dbc, db->dbt_neg_infty(), db->dbt_pos_infty()); assert(r==0);
 	}
-        u_int32_t f_flags = 0;
+        uint32_t f_flags = 0;
         if (prelockflag && (counter || prelock)) {
             f_flags |= lock_flag;
         }
@@ -336,7 +336,7 @@ static void scanscan_range (void) {
     int r;
 
     double texperiments[n_experiments];
-    u_int64_t k = 0;
+    uint64_t k = 0;
     char kv[8];
     DBT key, val;
   
@@ -432,8 +432,8 @@ static void scanscan_verify (void) {
 	r = db->cursor(db, tid, &dbc2, 0);                           assert(r==0);
 	memset(&v.k, 0, sizeof(v.k));
 	memset(&v.v, 0, sizeof(v.v));
-        u_int32_t f_flags = 0;
-        u_int32_t c_get_flags = DB_NEXT;
+        uint32_t f_flags = 0;
+        uint32_t c_get_flags = DB_NEXT;
         if (prelockflag && (counter || prelock)) {
             f_flags     |= lock_flag;
             c_get_flags |= lock_flag;
diff --git a/db-benchmark-test/txncommit.cc b/db-benchmark-test/txncommit.cc
index 28b0da606dd0a9d14759932aac3d1ad9503a7909..680151cec1bb7da9f888325de7ef8cff60bae612 100644
--- a/db-benchmark-test/txncommit.cc
+++ b/db-benchmark-test/txncommit.cc
@@ -8,7 +8,6 @@
 #include "toku_portability.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdbool.h>
 #include <unistd.h>
 #include <string.h>
 #include <sys/time.h>
diff --git a/ft/background_job_manager.cc b/ft/background_job_manager.cc
index 71d76b354e6a9e35df6aa55c1c29a3b920ad2d8f..8099cc665f2e5e48811cb2c996a3a656409d761a 100644
--- a/ft/background_job_manager.cc
+++ b/ft/background_job_manager.cc
@@ -5,7 +5,6 @@
 #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
 
 #include <config.h>
-#include <stdbool.h>
 #include <toku_pthread.h>
 #include "kibbutz.h"
 #include "background_job_manager.h"
@@ -13,7 +12,7 @@
 
 struct background_job_manager_struct {
     bool accepting_jobs;
-    u_int32_t num_jobs;
+    uint32_t num_jobs;
     toku_cond_t jobs_wait;
     toku_mutex_t jobs_lock;
 };
diff --git a/ft/block_allocator.cc b/ft/block_allocator.cc
index 01a1215174d707b8e799b1919a8490f198e95cd7..02ede5134e5b99390df27694c1a6ea7de8b4a35f 100644
--- a/ft/block_allocator.cc
+++ b/ft/block_allocator.cc
@@ -11,18 +11,18 @@
 // Previous implementation used next_fit, but now use first_fit since we are moving blocks around to reduce file size.
 
 struct block_allocator {
-    u_int64_t reserve_at_beginning; // How much to reserve at the beginning
-    u_int64_t alignment;            // Block alignment
-    u_int64_t n_blocks; // How many blocks
-    u_int64_t blocks_array_size; // How big is the blocks_array.  Must be >= n_blocks.
+    uint64_t reserve_at_beginning; // How much to reserve at the beginning
+    uint64_t alignment;            // Block alignment
+    uint64_t n_blocks; // How many blocks
+    uint64_t blocks_array_size; // How big is the blocks_array.  Must be >= n_blocks.
     struct block_allocator_blockpair *blocks_array; // These blocks are sorted by address.
-    u_int64_t n_bytes_in_use; // including the reserve_at_beginning
+    uint64_t n_bytes_in_use; // including the reserve_at_beginning
 };
 
 void
 block_allocator_validate (BLOCK_ALLOCATOR ba) {
-    u_int64_t i;
-    u_int64_t n_bytes_in_use = ba->reserve_at_beginning;
+    uint64_t i;
+    uint64_t n_bytes_in_use = ba->reserve_at_beginning;
     for (i=0; i<ba->n_blocks; i++) {
 	n_bytes_in_use += ba->blocks_array[i].size;
 	if (i>0) {
@@ -42,7 +42,7 @@ block_allocator_validate (BLOCK_ALLOCATOR ba) {
 #if 0
 void
 block_allocator_print (BLOCK_ALLOCATOR ba) {
-    u_int64_t i;
+    uint64_t i;
     for (i=0; i<ba->n_blocks; i++) {
 	printf("%" PRId64 ":%" PRId64 " ", ba->blocks_array[i].offset, ba->blocks_array[i].size);
     }
@@ -52,7 +52,7 @@ block_allocator_print (BLOCK_ALLOCATOR ba) {
 #endif
 
 void
-create_block_allocator (BLOCK_ALLOCATOR *ba, u_int64_t reserve_at_beginning, u_int64_t alignment) {
+create_block_allocator (BLOCK_ALLOCATOR *ba, uint64_t reserve_at_beginning, uint64_t alignment) {
     BLOCK_ALLOCATOR XMALLOC(result);
     result->reserve_at_beginning = reserve_at_beginning;
     result->alignment = alignment;
@@ -73,10 +73,10 @@ destroy_block_allocator (BLOCK_ALLOCATOR *bap) {
 }
 
 static void
-grow_blocks_array_by (BLOCK_ALLOCATOR ba, u_int64_t n_to_add) {
+grow_blocks_array_by (BLOCK_ALLOCATOR ba, uint64_t n_to_add) {
     if (ba->n_blocks + n_to_add > ba->blocks_array_size) {
-	u_int64_t new_size = ba->n_blocks + n_to_add;
-	u_int64_t at_least = ba->blocks_array_size * 2;
+	uint64_t new_size = ba->n_blocks + n_to_add;
+	uint64_t at_least = ba->blocks_array_size * 2;
 	if (at_least > new_size) {
 	    new_size = at_least;
 	}
@@ -92,10 +92,10 @@ grow_blocks_array (BLOCK_ALLOCATOR ba) {
 }
 
 void
-block_allocator_merge_blockpairs_into (u_int64_t d,       struct block_allocator_blockpair dst[/*d*/],
-				       u_int64_t s, const struct block_allocator_blockpair src[/*s*/])
+block_allocator_merge_blockpairs_into (uint64_t d,       struct block_allocator_blockpair dst[/*d*/],
+				       uint64_t s, const struct block_allocator_blockpair src[/*s*/])
 {
-    u_int64_t tail = d+s;
+    uint64_t tail = d+s;
     while (d>0 && s>0) {
 	struct block_allocator_blockpair       *dp = &dst[d-1];
 	struct block_allocator_blockpair const *sp = &src[s-1];
@@ -137,12 +137,12 @@ compare_blockpairs (const void *av, const void *bv) {
 }
 
 void
-block_allocator_alloc_blocks_at (BLOCK_ALLOCATOR ba, u_int64_t n_blocks, struct block_allocator_blockpair pairs[/*n_blocks*/])
+block_allocator_alloc_blocks_at (BLOCK_ALLOCATOR ba, uint64_t n_blocks, struct block_allocator_blockpair pairs[/*n_blocks*/])
 // See the documentation in block_allocator.h
 {
     VALIDATE(ba);
     qsort(pairs, n_blocks, sizeof(*pairs), compare_blockpairs);
-    for (u_int64_t i=0; i<n_blocks; i++) {
+    for (uint64_t i=0; i<n_blocks; i++) {
 	assert(pairs[i].offset >= ba->reserve_at_beginning);
 	assert(pairs[i].offset%ba->alignment == 0);
 	ba->n_bytes_in_use += pairs[i].size;
@@ -155,7 +155,7 @@ block_allocator_alloc_blocks_at (BLOCK_ALLOCATOR ba, u_int64_t n_blocks, struct
 }
 
 void
-block_allocator_alloc_block_at (BLOCK_ALLOCATOR ba, u_int64_t size, u_int64_t offset) {
+block_allocator_alloc_block_at (BLOCK_ALLOCATOR ba, uint64_t size, uint64_t offset) {
     struct block_allocator_blockpair p = {.offset = offset, .size=size};
     // Just do a linear search for the block.
     // This data structure is a sorted array (no gaps or anything), so the search isn't really making this any slower than the insertion.
@@ -163,15 +163,15 @@ block_allocator_alloc_block_at (BLOCK_ALLOCATOR ba, u_int64_t size, u_int64_t of
     block_allocator_alloc_blocks_at(ba, 1, &p);
 }
 
-static inline u_int64_t
-align (u_int64_t value, BLOCK_ALLOCATOR ba)
+static inline uint64_t
+align (uint64_t value, BLOCK_ALLOCATOR ba)
 // Effect: align a value by rounding up.
 {
     return ((value+ba->alignment-1)/ba->alignment)*ba->alignment;
 }
 
 void
-block_allocator_alloc_block (BLOCK_ALLOCATOR ba, u_int64_t size, u_int64_t *offset) {
+block_allocator_alloc_block (BLOCK_ALLOCATOR ba, uint64_t size, uint64_t *offset) {
     grow_blocks_array(ba);
     ba->n_bytes_in_use += size;
     if (ba->n_blocks==0) {
@@ -184,7 +184,7 @@ block_allocator_alloc_block (BLOCK_ALLOCATOR ba, u_int64_t size, u_int64_t *offs
     }
     // Implement first fit.    
     {
-	u_int64_t end_of_reserve = align(ba->reserve_at_beginning, ba);
+	uint64_t end_of_reserve = align(ba->reserve_at_beginning, ba);
 	if (end_of_reserve + size <= ba->blocks_array[0].offset ) {
 	    // Check to see if the space immediately after the reserve is big enough to hold the new block.
 	    struct block_allocator_blockpair *bp = &ba->blocks_array[0];
@@ -197,12 +197,12 @@ block_allocator_alloc_block (BLOCK_ALLOCATOR ba, u_int64_t size, u_int64_t *offs
 	    return;
 	}
     }
-    for (u_int64_t blocknum = 0; blocknum +1 < ba->n_blocks; blocknum ++) {
+    for (uint64_t blocknum = 0; blocknum +1 < ba->n_blocks; blocknum ++) {
 	// Consider the space after blocknum
 	struct block_allocator_blockpair *bp = &ba->blocks_array[blocknum];
-	u_int64_t this_offset = bp[0].offset;
-	u_int64_t this_size   = bp[0].size;
-	u_int64_t answer_offset = align(this_offset + this_size, ba);
+	uint64_t this_offset = bp[0].offset;
+	uint64_t this_size   = bp[0].size;
+	uint64_t answer_offset = align(this_offset + this_size, ba);
 	if (answer_offset + size > bp[1].offset) continue; // The block we want doesn't fit after this block.
 	// It fits, so allocate it here.
 	memmove(bp+2, bp+1, (ba->n_blocks - blocknum -1)*sizeof(*bp));
@@ -216,7 +216,7 @@ block_allocator_alloc_block (BLOCK_ALLOCATOR ba, u_int64_t size, u_int64_t *offs
     // It didn't fit anywhere, so fit it on the end.
     assert(ba->n_blocks < ba->blocks_array_size);
     struct block_allocator_blockpair *bp = &ba->blocks_array[ba->n_blocks];
-    u_int64_t answer_offset = align(bp[-1].offset+bp[-1].size, ba);
+    uint64_t answer_offset = align(bp[-1].offset+bp[-1].size, ba);
     bp->offset = answer_offset;
     bp->size   = size;
     ba->n_blocks++;
@@ -225,7 +225,7 @@ block_allocator_alloc_block (BLOCK_ALLOCATOR ba, u_int64_t size, u_int64_t *offs
 }
 
 static int64_t
-find_block (BLOCK_ALLOCATOR ba, u_int64_t offset)
+find_block (BLOCK_ALLOCATOR ba, uint64_t offset)
 // Find the index in the blocks array that has a particular offset.  Requires that the block exist.
 // Use binary search so it runs fast.
 {
@@ -234,12 +234,12 @@ find_block (BLOCK_ALLOCATOR ba, u_int64_t offset)
 	assert(ba->blocks_array[0].offset == offset);
 	return 0;
     }
-    u_int64_t lo = 0;
-    u_int64_t hi = ba->n_blocks;
+    uint64_t lo = 0;
+    uint64_t hi = ba->n_blocks;
     while (1) {
 	assert(lo<hi); // otherwise no such block exists.
-	u_int64_t mid = (lo+hi)/2;
-	u_int64_t thisoff = ba->blocks_array[mid].offset;
+	uint64_t mid = (lo+hi)/2;
+	uint64_t thisoff = ba->blocks_array[mid].offset;
 	//printf("lo=%" PRId64 " hi=%" PRId64 " mid=%" PRId64 "  thisoff=%" PRId64 " offset=%" PRId64 "\n", lo, hi, mid, thisoff, offset);
 	if (thisoff < offset) {
 	    lo = mid+1;
@@ -252,7 +252,7 @@ find_block (BLOCK_ALLOCATOR ba, u_int64_t offset)
 }
 
 void
-block_allocator_free_block (BLOCK_ALLOCATOR ba, u_int64_t offset) {
+block_allocator_free_block (BLOCK_ALLOCATOR ba, uint64_t offset) {
     VALIDATE(ba);
     int64_t bn = find_block(ba, offset);
     assert(bn>=0); // we require that there is a block with that offset.  Might as well abort if no such block exists.
@@ -262,14 +262,14 @@ block_allocator_free_block (BLOCK_ALLOCATOR ba, u_int64_t offset) {
     VALIDATE(ba);
 }
 
-u_int64_t
-block_allocator_block_size (BLOCK_ALLOCATOR ba, u_int64_t offset) {
+uint64_t
+block_allocator_block_size (BLOCK_ALLOCATOR ba, uint64_t offset) {
     int64_t bn = find_block(ba, offset);
     assert(bn>=0); // we require that there is a block with that offset.  Might as well abort if no such block exists.
     return ba->blocks_array[bn].size;
 }
 
-u_int64_t
+uint64_t
 block_allocator_allocated_limit (BLOCK_ALLOCATOR ba) {
     if (ba->n_blocks==0) return ba->reserve_at_beginning;
     else {
@@ -279,7 +279,7 @@ block_allocator_allocated_limit (BLOCK_ALLOCATOR ba) {
 }
 
 int
-block_allocator_get_nth_block_in_layout_order (BLOCK_ALLOCATOR ba, u_int64_t b, u_int64_t *offset, u_int64_t *size)
+block_allocator_get_nth_block_in_layout_order (BLOCK_ALLOCATOR ba, uint64_t b, uint64_t *offset, uint64_t *size)
 // Effect: Consider the blocks in sorted order.  The reserved block at the beginning is number 0.  The next one is number 1 and so forth.
 // Return the offset and size of the block with that number.
 // Return 0 if there is a block that big, return nonzero if b is too big.
@@ -324,7 +324,7 @@ block_allocator_get_unused_statistics(BLOCK_ALLOCATOR ba, TOKU_DB_FRAGMENTATION
         }
 
         //Deal with space between blocks:
-        for (u_int64_t blocknum = 0; blocknum +1 < ba->n_blocks; blocknum ++) {
+        for (uint64_t blocknum = 0; blocknum +1 < ba->n_blocks; blocknum ++) {
             // Consider the space after blocknum
             struct block_allocator_blockpair *bp = &ba->blocks_array[blocknum];
             uint64_t this_offset = bp[0].offset;
diff --git a/ft/block_allocator.h b/ft/block_allocator.h
index a6de762b99d0e313594ef7fb21491d0e0d2a6e72..3f6500d4559337c229d512c110cd5dd67a552194 100644
--- a/ft/block_allocator.h
+++ b/ft/block_allocator.h
@@ -39,7 +39,7 @@
 
 typedef struct block_allocator *BLOCK_ALLOCATOR;
 
-void create_block_allocator (BLOCK_ALLOCATOR * ba, u_int64_t reserve_at_beginning, u_int64_t alignment);
+void create_block_allocator (BLOCK_ALLOCATOR * ba, uint64_t reserve_at_beginning, uint64_t alignment);
 // Effect: Create a block allocator, in which the first RESERVE_AT_BEGINNING bytes are not put into a block.
 //  All blocks be start on a multiple of ALIGNMENT.
 //  Aborts if we run out of memory.
@@ -56,7 +56,7 @@ void destroy_block_allocator (BLOCK_ALLOCATOR *ba);
 //  ba (IN/OUT):
 
 
-void block_allocator_alloc_block_at (BLOCK_ALLOCATOR ba, u_int64_t size, u_int64_t offset);
+void block_allocator_alloc_block_at (BLOCK_ALLOCATOR ba, uint64_t size, uint64_t offset);
 // Effect: Allocate a block of the specified size at a particular offset.
 //  Aborts if anything goes wrong.
 //  The performance of this function may be as bad as Theta(N), where N is the number of blocks currently in use.
@@ -70,15 +70,15 @@ void block_allocator_alloc_block_at (BLOCK_ALLOCATOR ba, u_int64_t size, u_int64
 
 
 struct block_allocator_blockpair {
-    u_int64_t offset;
-    u_int64_t size;
+    uint64_t offset;
+    uint64_t size;
 };
-void block_allocator_alloc_blocks_at (BLOCK_ALLOCATOR ba, u_int64_t n_blocks, struct block_allocator_blockpair *pairs);
+void block_allocator_alloc_blocks_at (BLOCK_ALLOCATOR ba, uint64_t n_blocks, struct block_allocator_blockpair *pairs);
 // Effect: Take pairs in any order, and add them all, as if we did block_allocator_alloc_block() on each pair.
 //  This should run in time O(N + M log M) where N is the number of blocks in ba, and M is the number of new blocks.
 // Modifies: pairs (sorts them).
 
-void block_allocator_alloc_block (BLOCK_ALLOCATOR ba, u_int64_t size, u_int64_t *offset);
+void block_allocator_alloc_block (BLOCK_ALLOCATOR ba, uint64_t size, uint64_t *offset);
 // Effect: Allocate a block of the specified size at an address chosen by the allocator.
 //  Aborts if anything goes wrong.
 //  The block address will be a multiple of the alignment.
@@ -87,7 +87,7 @@ void block_allocator_alloc_block (BLOCK_ALLOCATOR ba, u_int64_t size, u_int64_t
 //  size (IN):    The size of the block.  (The size does not have to be aligned.)
 //  offset (OUT): The location of the block.
 
-void block_allocator_free_block (BLOCK_ALLOCATOR ba, u_int64_t offset);
+void block_allocator_free_block (BLOCK_ALLOCATOR ba, uint64_t offset);
 // Effect: Free the block at offset.
 // Requires: There must be a block currently allocated at that offset.
 // Parameters:
@@ -95,7 +95,7 @@ void block_allocator_free_block (BLOCK_ALLOCATOR ba, u_int64_t offset);
 //  offset (IN): The offset of the block.
 
 
-u_int64_t block_allocator_block_size (BLOCK_ALLOCATOR ba, u_int64_t offset);
+uint64_t block_allocator_block_size (BLOCK_ALLOCATOR ba, uint64_t offset);
 // Effect: Return the size of the block that starts at offset.
 // Requires: There must be a block currently allocated at that offset.
 // Parameters:
@@ -110,14 +110,14 @@ void block_allocator_print (BLOCK_ALLOCATOR ba);
 // Effect: Print information about the block allocator.
 // Rationale: This is probably useful only for debugging.
 
-u_int64_t block_allocator_allocated_limit (BLOCK_ALLOCATOR ba);
+uint64_t block_allocator_allocated_limit (BLOCK_ALLOCATOR ba);
 // Effect: Return the unallocated block address of "infinite" size.
 //  That is, return the smallest address that is above all the allocated blocks.
 // Rationale: When writing the root FIFO we don't know how big the block is.
 //  So we start at the "infinite" block, write the fifo, and then
 //  allocate_block_at of the correct size and offset to account for the root FIFO.
 
-int block_allocator_get_nth_block_in_layout_order (BLOCK_ALLOCATOR ba, u_int64_t b, u_int64_t *offset, u_int64_t *size);
+int block_allocator_get_nth_block_in_layout_order (BLOCK_ALLOCATOR ba, uint64_t b, uint64_t *offset, uint64_t *size);
 // Effect: Consider the blocks in sorted order.  The reserved block at the beginning is number 0.  The next one is number 1 and so forth.
 //  Return the offset and size of the block with that number.
 //  Return 0 if there is a block that big, return nonzero if b is too big.
@@ -130,8 +130,8 @@ void block_allocator_get_unused_statistics(BLOCK_ALLOCATOR ba, TOKU_DB_FRAGMENTA
 //  report->data_bytes is filled in
 //  report->checkpoint_bytes_additional is filled in
 
-void block_allocator_merge_blockpairs_into (u_int64_t d,       struct block_allocator_blockpair dst[/*d*/],
-				       u_int64_t s, const struct block_allocator_blockpair src[/*s*/]);
+void block_allocator_merge_blockpairs_into (uint64_t d,       struct block_allocator_blockpair dst[/*d*/],
+				       uint64_t s, const struct block_allocator_blockpair src[/*s*/]);
 // Effect: Merge dst[d] and src[s] into dst[d+s], merging in place.
 //   Initially dst and src hold sorted arrays (sorted by increasing offset).
 //   Finally dst contains all d+s elements sorted in order.
diff --git a/ft/block_table.cc b/ft/block_table.cc
index f380fc6afa66c7bcf995f4961bdbc2dceb821ecb..c1449bea790d9be98590c0bb3fe4193b08447a94 100644
--- a/ft/block_table.cc
+++ b/ft/block_table.cc
@@ -80,14 +80,14 @@ struct block_table {
 
 //forward decls
 static int64_t calculate_size_on_disk (struct translation *t);
-static inline BOOL translation_prevents_freeing (struct translation *t, BLOCKNUM b, struct block_translation_pair *old_pair);
+static inline bool translation_prevents_freeing (struct translation *t, BLOCKNUM b, struct block_translation_pair *old_pair);
 static inline void lock_for_blocktable (BLOCK_TABLE bt);
 static inline void unlock_for_blocktable (BLOCK_TABLE bt);
 
 
 
 static void 
-ft_set_dirty(FT ft, BOOL for_checkpoint){
+ft_set_dirty(FT ft, bool for_checkpoint){
     toku_mutex_assert_locked(&ft->blocktable->mutex);
     assert(ft->h->type == FT_CURRENT);
     if (for_checkpoint) {
@@ -100,9 +100,9 @@ ft_set_dirty(FT ft, BOOL for_checkpoint){
 }
 
 static void
-maybe_truncate_file(BLOCK_TABLE bt, int fd, u_int64_t size_needed_before) {
+maybe_truncate_file(BLOCK_TABLE bt, int fd, uint64_t size_needed_before) {
     toku_mutex_assert_locked(&bt->mutex);
-    u_int64_t new_size_needed = block_allocator_allocated_limit(bt->block_allocator);
+    uint64_t new_size_needed = block_allocator_allocated_limit(bt->block_allocator);
     //Save a call to toku_os_get_file_size (kernel call) if unlikely to be useful.
     if (new_size_needed < size_needed_before && new_size_needed < bt->safe_file_size) {
         nb_mutex_lock(&bt->safe_file_size_lock, &bt->mutex);
@@ -190,7 +190,7 @@ maybe_optimize_translation(struct translation *t) {
         t->smallest_never_used_blocknum.b = b.b;
         if (t->length_of_array/4 > t->smallest_never_used_blocknum.b) {
             //We're using more memory than necessary to represent this now.  Reduce.
-            u_int64_t new_length = t->smallest_never_used_blocknum.b * 2;
+            uint64_t new_length = t->smallest_never_used_blocknum.b * 2;
             XREALLOC_N(new_length, t->block_translation);
             t->length_of_array = new_length;
             //No need to zero anything out. 
@@ -218,8 +218,8 @@ toku_block_translation_note_start_checkpoint_unlocked (BLOCK_TABLE bt) {
     maybe_optimize_translation(&bt->current);
     copy_translation(&bt->inprogress, &bt->current, TRANSLATION_INPROGRESS);
 
-    bt->checkpoint_skipped = FALSE;
-    bt->checkpoint_failed  = FALSE;
+    bt->checkpoint_skipped = false;
+    bt->checkpoint_failed  = false;
 }
 
 //#define PRNTF(str, b, siz, ad, bt) printf("%s[%d] %s %" PRId64 " %" PRId64 " %" PRId64 "\n", __FUNCTION__, __LINE__, str, b, siz, ad); fflush(stdout); if (bt) block_allocator_validate(((BLOCK_TABLE)(bt))->block_allocator);
@@ -230,7 +230,7 @@ void
 toku_block_translation_note_failed_checkpoint (BLOCK_TABLE bt) {
     lock_for_blocktable(bt);
     assert(bt->inprogress.block_translation);
-    bt->checkpoint_failed = TRUE;
+    bt->checkpoint_failed = true;
     unlock_for_blocktable(bt);
 }
 
@@ -240,7 +240,7 @@ toku_block_translation_note_skipped_checkpoint (BLOCK_TABLE bt) {
     //Purpose, alert block translation that the checkpoint was skipped, e.x. for a non-dirty header
     lock_for_blocktable(bt);
     assert(bt->inprogress.block_translation);
-    bt->checkpoint_skipped = TRUE;
+    bt->checkpoint_skipped = true;
     unlock_for_blocktable(bt);
 }
 
@@ -276,7 +276,7 @@ void
 toku_block_translation_note_end_checkpoint (BLOCK_TABLE bt, int fd) {
     // Free unused blocks
     lock_for_blocktable(bt);
-    u_int64_t allocated_limit_at_start = block_allocator_allocated_limit(bt->block_allocator);
+    uint64_t allocated_limit_at_start = block_allocator_allocated_limit(bt->block_allocator);
     assert(bt->inprogress.block_translation);
     if (bt->checkpoint_skipped || bt->checkpoint_failed) {
         cleanup_failed_checkpoint(bt);
@@ -367,7 +367,7 @@ toku_ft_unlock (FT ft) {
 
 // This is a special debugging function used only in the brt-serialize-test.
 void
-toku_block_alloc(BLOCK_TABLE bt, u_int64_t size, u_int64_t *offset) {
+toku_block_alloc(BLOCK_TABLE bt, uint64_t size, uint64_t *offset) {
     lock_for_blocktable(bt);
 PRNTF("allocSomethingUnknown", 0L, (int64_t)size, 0L, bt);
     block_allocator_alloc_block(bt->block_allocator, size, offset);
@@ -377,7 +377,7 @@ PRNTF("allocSomethingUnknownd", 0L, (int64_t)size, (int64_t)*offset, bt);
 
 // Also used only in brt-serialize-test.
 void
-toku_block_free(BLOCK_TABLE bt, u_int64_t offset) {
+toku_block_free(BLOCK_TABLE bt, uint64_t offset) {
     lock_for_blocktable(bt);
 PRNTF("freeSOMETHINGunknown", 0L, 0L, offset, bt);
     block_allocator_free_block(bt->block_allocator, offset);
@@ -394,9 +394,9 @@ calculate_size_on_disk (struct translation *t) {
 }
 
 // We cannot free the disk space allocated to this blocknum if it is still in use by the given translation table.
-static inline BOOL
+static inline bool
 translation_prevents_freeing(struct translation *t, BLOCKNUM b, struct block_translation_pair *old_pair) {
-    BOOL r = (BOOL)
+    bool r = (bool)
         (t->block_translation &&
          b.b < t->smallest_never_used_blocknum.b &&
          old_pair->u.diskoff == t->block_translation[b.b].u.diskoff);
@@ -404,7 +404,7 @@ translation_prevents_freeing(struct translation *t, BLOCKNUM b, struct block_tra
 }
 
 static void
-blocknum_realloc_on_disk_internal (BLOCK_TABLE bt, BLOCKNUM b, DISKOFF size, DISKOFF *offset, FT ft, BOOL for_checkpoint) {
+blocknum_realloc_on_disk_internal (BLOCK_TABLE bt, BLOCKNUM b, DISKOFF size, DISKOFF *offset, FT ft, bool for_checkpoint) {
     toku_mutex_assert_locked(&bt->mutex);
     ft_set_dirty(ft, for_checkpoint);
 
@@ -412,7 +412,7 @@ blocknum_realloc_on_disk_internal (BLOCK_TABLE bt, BLOCKNUM b, DISKOFF size, DIS
     struct block_translation_pair old_pair = t->block_translation[b.b];
 PRNTF("old", b.b, old_pair.size, old_pair.u.diskoff, bt);
     //Free the old block if it is not still in use by the checkpoint in progress or the previous checkpoint
-    BOOL cannot_free = (BOOL)
+    bool cannot_free = (bool)
         ((!for_checkpoint && translation_prevents_freeing(&bt->inprogress,   b, &old_pair)) ||
          translation_prevents_freeing(&bt->checkpointed, b, &old_pair));
     if (!cannot_free && old_pair.u.diskoff!=diskoff_unused) {
@@ -420,7 +420,7 @@ PRNTF("Freed", b.b, old_pair.size, old_pair.u.diskoff, bt);
         block_allocator_free_block(bt->block_allocator, old_pair.u.diskoff);
     }
 
-    u_int64_t allocator_offset;
+    uint64_t allocator_offset;
     //Allocate a new block
     block_allocator_alloc_block(bt->block_allocator, size, &allocator_offset);
     t->block_translation[b.b].u.diskoff = allocator_offset;
@@ -456,7 +456,7 @@ ensure_safe_write_unlocked(BLOCK_TABLE bt, int fd, DISKOFF block_size, DISKOFF b
 }
 
 void
-toku_blocknum_realloc_on_disk (BLOCK_TABLE bt, BLOCKNUM b, DISKOFF size, DISKOFF *offset, FT ft, int fd, BOOL for_checkpoint) {
+toku_blocknum_realloc_on_disk (BLOCK_TABLE bt, BLOCKNUM b, DISKOFF size, DISKOFF *offset, FT ft, int fd, bool for_checkpoint) {
     lock_for_blocktable(bt);
     struct translation *t = &bt->current;
     verify_valid_freeable_blocknum(t, b);
@@ -480,7 +480,7 @@ blocknum_alloc_translation_on_disk_unlocked (BLOCK_TABLE bt) {
 
     //Allocate a new block
     int64_t size = calculate_size_on_disk(t);
-    u_int64_t offset;
+    uint64_t offset;
     block_allocator_alloc_block(bt->block_allocator, size, &offset);
 PRNTF("blokAllokator", 1L, size, offset, bt);
     t->block_translation[b.b].u.diskoff = offset;
@@ -499,7 +499,7 @@ toku_serialize_translation_to_wbuf(BLOCK_TABLE bt, int fd, struct wbuf *w,
     blocknum_alloc_translation_on_disk_unlocked(bt);
     {
         //Init wbuf
-        u_int64_t size_translation = calculate_size_on_disk(t);
+        uint64_t size_translation = calculate_size_on_disk(t);
         assert((int64_t)size_translation==t->block_translation[b.b].size);
         if (0)
             printf("%s:%d writing translation table of size_translation %" PRIu64 " at %" PRId64 "\n", __FILE__, __LINE__, size_translation, t->block_translation[b.b].u.diskoff);
@@ -515,7 +515,7 @@ toku_serialize_translation_to_wbuf(BLOCK_TABLE bt, int fd, struct wbuf *w,
         wbuf_DISKOFF(w, t->block_translation[i].u.diskoff);
         wbuf_DISKOFF(w, t->block_translation[i].size);
     }
-    u_int32_t checksum = x1764_finish(&w->checksum);
+    uint32_t checksum = x1764_finish(&w->checksum);
     wbuf_int(w, checksum);
     *address = t->block_translation[b.b].u.diskoff;
     *size    = t->block_translation[b.b].size;
@@ -549,9 +549,9 @@ maybe_expand_translation (struct translation *t) {
 // given that one more never-used blocknum will soon be used.
     if (t->length_of_array <= t->smallest_never_used_blocknum.b) {
         //expansion is necessary
-        u_int64_t new_length = t->smallest_never_used_blocknum.b * 2;
+        uint64_t new_length = t->smallest_never_used_blocknum.b * 2;
         XREALLOC_N(new_length, t->block_translation);
-        u_int64_t i;
+        uint64_t i;
         for (i = t->length_of_array; i < new_length; i++) {
             t->block_translation[i].u.next_free_blocknum = freelist_null;
             t->block_translation[i].size                 = size_is_free;
@@ -583,7 +583,7 @@ toku_allocate_blocknum_unlocked(BLOCK_TABLE bt, BLOCKNUM *res, FT ft) {
     t->block_translation[result.b].size    = 0;
     verify_valid_freeable_blocknum(t, result);
     *res = result;
-    ft_set_dirty(ft, FALSE);
+    ft_set_dirty(ft, false);
 }
 
 void
@@ -607,7 +607,7 @@ free_blocknum_in_translation(struct translation *t, BLOCKNUM b)
 }
 
 static void
-free_blocknum_unlocked(BLOCK_TABLE bt, BLOCKNUM *bp, FT ft, BOOL for_checkpoint) {
+free_blocknum_unlocked(BLOCK_TABLE bt, BLOCKNUM *bp, FT ft, bool for_checkpoint) {
 // Effect: Free a blocknum.
 // If the blocknum holds the only reference to a block on disk, free that block
     toku_mutex_assert_locked(&bt->mutex);
@@ -625,7 +625,7 @@ free_blocknum_unlocked(BLOCK_TABLE bt, BLOCKNUM *bp, FT ft, BOOL for_checkpoint)
     //If the size is 0, no disk block has ever been assigned to this blocknum.
     if (old_pair.size > 0) {
         //Free the old block if it is not still in use by the checkpoint in progress or the previous checkpoint
-        BOOL cannot_free = (BOOL)
+        bool cannot_free = (bool)
             (translation_prevents_freeing(&bt->inprogress,   b, &old_pair) ||
              translation_prevents_freeing(&bt->checkpointed, b, &old_pair));
         if (!cannot_free) {
@@ -638,7 +638,7 @@ PRNTF("free_blocknum_free", b.b, old_pair.size, old_pair.u.diskoff, bt);
 }
 
 void
-toku_free_blocknum(BLOCK_TABLE bt, BLOCKNUM *bp, FT ft, BOOL for_checkpoint) {
+toku_free_blocknum(BLOCK_TABLE bt, BLOCKNUM *bp, FT ft, bool for_checkpoint) {
     lock_for_blocktable(bt);
     free_blocknum_unlocked(bt, bp, ft, for_checkpoint);
     unlock_for_blocktable(bt);
@@ -746,12 +746,12 @@ blocktable_create_internal (void) {
     nb_mutex_init(&bt->safe_file_size_lock);
 
     //There are two headers, so we reserve space for two.
-    u_int64_t reserve_per_header = BLOCK_ALLOCATOR_HEADER_RESERVE;
+    uint64_t reserve_per_header = BLOCK_ALLOCATOR_HEADER_RESERVE;
 
     //Must reserve in multiples of BLOCK_ALLOCATOR_ALIGNMENT
     //Round up the per-header usage if necessary.
     //We want each header aligned.
-    u_int64_t remainder = BLOCK_ALLOCATOR_HEADER_RESERVE % BLOCK_ALLOCATOR_ALIGNMENT;
+    uint64_t remainder = BLOCK_ALLOCATOR_HEADER_RESERVE % BLOCK_ALLOCATOR_ALIGNMENT;
     if (remainder!=0) {
         reserve_per_header += BLOCK_ALLOCATOR_ALIGNMENT;
         reserve_per_header -= remainder;
@@ -783,17 +783,17 @@ translation_default(struct translation *t) {  // destination into which to creat
 static int
 translation_deserialize_from_buffer(struct translation *t,    // destination into which to deserialize
                                     DISKOFF location_on_disk, //Location of translation_buffer
-                                    u_int64_t size_on_disk,
+                                    uint64_t size_on_disk,
                                     unsigned char * translation_buffer) {   // buffer with serialized translation
     int r = 0;
     assert(location_on_disk!=0);
     t->type = TRANSLATION_CHECKPOINTED;
     {
         // check the checksum
-        u_int32_t x1764 = x1764_memory(translation_buffer, size_on_disk - 4);
-        u_int64_t offset = size_on_disk - 4;
+        uint32_t x1764 = x1764_memory(translation_buffer, size_on_disk - 4);
+        uint64_t offset = size_on_disk - 4;
         //printf("%s:%d read from %ld (x1764 offset=%ld) size=%ld\n", __FILE__, __LINE__, block_translation_address_on_disk, offset, block_translation_size_on_disk);
-        u_int32_t stored_x1764 = toku_dtoh32(*(int*)(translation_buffer + offset));
+        uint32_t stored_x1764 = toku_dtoh32(*(int*)(translation_buffer + offset));
         if (x1764 != stored_x1764) {
             fprintf(stderr, "Translation table checksum failure: calc=0x%08x read=0x%08x\n", x1764, stored_x1764);
             r = TOKUDB_BAD_CHECKSUM;
@@ -831,7 +831,7 @@ blocktable_note_translation (BLOCK_ALLOCATOR allocator, struct translation *t) {
 
     // Previously this added blocks one at a time.  Now we make an array and pass it in so it can be sorted and merged.  See #3218.
     struct block_allocator_blockpair *MALLOC_N(t->smallest_never_used_blocknum.b, pairs);
-    u_int64_t n_pairs = 0;
+    uint64_t n_pairs = 0;
     for (int64_t i=0; i<t->smallest_never_used_blocknum.b; i++) {
         struct block_translation_pair pair = t->block_translation[i];
         if (pair.size > 0) {
@@ -889,7 +889,7 @@ toku_blocktable_create_new(BLOCK_TABLE *btp) {
 }    
 
 int
-toku_blocktable_iterate (BLOCK_TABLE bt, enum translation_type type, BLOCKTABLE_CALLBACK f, void *extra, BOOL data_only, BOOL used_only) {
+toku_blocktable_iterate (BLOCK_TABLE bt, enum translation_type type, BLOCKTABLE_CALLBACK f, void *extra, bool data_only, bool used_only) {
     struct translation *src;
     
     int r = 0;
@@ -938,7 +938,7 @@ frag_helper(BLOCKNUM UU(b), int64_t size, int64_t address, void *extra) {
 void
 toku_blocktable_internal_fragmentation (BLOCK_TABLE bt, int64_t *total_sizep, int64_t *used_sizep) {
     frag_extra info = {0,0};
-    int r = toku_blocktable_iterate(bt, TRANSLATION_CHECKPOINTED, frag_helper, &info, FALSE, TRUE);
+    int r = toku_blocktable_iterate(bt, TRANSLATION_CHECKPOINTED, frag_helper, &info, false, true);
     assert(r==0);
 
     if (total_sizep) *total_sizep = info.total_space;
@@ -949,7 +949,7 @@ void
 toku_realloc_descriptor_on_disk_unlocked(BLOCK_TABLE bt, DISKOFF size, DISKOFF *offset, FT ft) {
     toku_mutex_assert_locked(&bt->mutex);
     BLOCKNUM b = make_blocknum(RESERVED_BLOCKNUM_DESCRIPTOR);
-    blocknum_realloc_on_disk_internal(bt, b, size, offset, ft, FALSE);
+    blocknum_realloc_on_disk_internal(bt, b, size, offset, ft, false);
 }
 
 void
diff --git a/ft/block_table.h b/ft/block_table.h
index b8ff95a20eceb101f51937734fd08c0561f74d64..c7faa087ff80877ba8dc3c0fca8f38d13ca59d1e 100644
--- a/ft/block_table.h
+++ b/ft/block_table.h
@@ -36,7 +36,7 @@ void toku_maybe_truncate_file_on_open(BLOCK_TABLE bt, int fd);
 //Blocknums
 void toku_allocate_blocknum(BLOCK_TABLE bt, BLOCKNUM *res, FT h);
 void toku_allocate_blocknum_unlocked(BLOCK_TABLE bt, BLOCKNUM *res, FT h);
-void toku_free_blocknum(BLOCK_TABLE bt, BLOCKNUM *b, FT h, BOOL for_checkpoint);
+void toku_free_blocknum(BLOCK_TABLE bt, BLOCKNUM *b, FT h, bool for_checkpoint);
 void toku_verify_blocknum_allocated(BLOCK_TABLE bt, BLOCKNUM b);
 void toku_block_verify_no_data_blocks_except_root_unlocked(BLOCK_TABLE bt, BLOCKNUM root);
 void toku_block_verify_no_free_blocknums(BLOCK_TABLE bt);
@@ -45,7 +45,7 @@ void toku_realloc_descriptor_on_disk_unlocked(BLOCK_TABLE bt, DISKOFF size, DISK
 void toku_get_descriptor_offset_size(BLOCK_TABLE bt, DISKOFF *offset, DISKOFF *size);
 
 //Blocks and Blocknums
-void toku_blocknum_realloc_on_disk(BLOCK_TABLE bt, BLOCKNUM b, DISKOFF size, DISKOFF *offset, FT ft, int fd, BOOL for_checkpoint);
+void toku_blocknum_realloc_on_disk(BLOCK_TABLE bt, BLOCKNUM b, DISKOFF size, DISKOFF *offset, FT ft, int fd, bool for_checkpoint);
 void toku_translate_blocknum_to_offset_size(BLOCK_TABLE bt, BLOCKNUM b, DISKOFF *offset, DISKOFF *size);
 
 //Serialization
@@ -57,8 +57,8 @@ void toku_block_table_swap_for_redirect(BLOCK_TABLE old_bt, BLOCK_TABLE new_bt);
 //DEBUG ONLY (ftdump included), tests included
 void toku_blocknum_dump_translation(BLOCK_TABLE bt, BLOCKNUM b);
 void toku_dump_translation_table(FILE *f, BLOCK_TABLE bt);
-void toku_block_alloc(BLOCK_TABLE bt, u_int64_t size, u_int64_t *offset);
-void toku_block_free(BLOCK_TABLE bt, u_int64_t offset);
+void toku_block_alloc(BLOCK_TABLE bt, uint64_t size, uint64_t *offset);
+void toku_block_free(BLOCK_TABLE bt, uint64_t offset);
 typedef int(*BLOCKTABLE_CALLBACK)(BLOCKNUM b, int64_t size, int64_t address, void *extra);
 enum translation_type {TRANSLATION_NONE=0,
                        TRANSLATION_CURRENT,
@@ -66,7 +66,7 @@ enum translation_type {TRANSLATION_NONE=0,
                        TRANSLATION_CHECKPOINTED,
                        TRANSLATION_DEBUG};
 
-int toku_blocktable_iterate(BLOCK_TABLE bt, enum translation_type type, BLOCKTABLE_CALLBACK f, void *extra, BOOL data_only, BOOL used_only); 
+int toku_blocktable_iterate(BLOCK_TABLE bt, enum translation_type type, BLOCKTABLE_CALLBACK f, void *extra, bool data_only, bool used_only); 
 void toku_blocktable_internal_fragmentation(BLOCK_TABLE bt, int64_t *total_sizep, int64_t *used_sizep);
 
 void toku_block_table_get_fragmentation_unlocked(BLOCK_TABLE bt, TOKU_DB_FRAGMENTATION report);
diff --git a/ft/cachetable.cc b/ft/cachetable.cc
index 1a370f2bc4d7361e7a6c6fc06271df79b1faa34d..e6049d499ed92b8c1e54238547a1ff46defac9fa 100644
--- a/ft/cachetable.cc
+++ b/ft/cachetable.cc
@@ -30,12 +30,12 @@
 // These should be in the cachetable object, but we make them file-wide so that gdb can get them easily.
 // They were left here after engine status cleanup (#2949, rather than moved into the status struct)
 // so they are still easily available to the debugger and to save lots of typing.
-static u_int64_t cachetable_miss;
-static u_int64_t cachetable_misstime;     // time spent waiting for disk read
-static u_int64_t cachetable_puts;          // how many times has a newly created node been put into the cachetable?
-static u_int64_t cachetable_prefetches;    // how many times has a block been prefetched into the cachetable?
-static u_int64_t cachetable_evictions;
-static u_int64_t cleaner_executions; // number of times the cleaner thread's loop has executed
+static uint64_t cachetable_miss;
+static uint64_t cachetable_misstime;     // time spent waiting for disk read
+static uint64_t cachetable_puts;          // how many times has a newly created node been put into the cachetable?
+static uint64_t cachetable_prefetches;    // how many times has a block been prefetched into the cachetable?
+static uint64_t cachetable_evictions;
+static uint64_t cleaner_executions; // number of times the cleaner thread's loop has executed
 
 static CACHETABLE_STATUS_S ct_status;
 
@@ -85,7 +85,7 @@ struct ctpair {
 
     enum cachetable_dirty dirty;
 
-    u_int32_t fullhash;
+    uint32_t fullhash;
 
     CACHETABLE_FLUSH_CALLBACK flush_callback;
     CACHETABLE_PARTIAL_EVICTION_EST_CALLBACK pe_est_callback;
@@ -97,9 +97,9 @@ struct ctpair {
 
     PAIR     clock_next,clock_prev; // In clock.
     PAIR     hash_chain;
-    u_int32_t count;        // clock count
+    uint32_t count;        // clock count
 
-    BOOL     checkpoint_pending; // If this is on, then we have got to write the pair out to disk before modifying it.
+    bool     checkpoint_pending; // If this is on, then we have got to write the pair out to disk before modifying it.
     PAIR     pending_next;
     PAIR     pending_prev;
 
@@ -115,7 +115,7 @@ static PAIR_ATTR const zero_attr = {
     .leaf_size = 0, 
     .rollback_size = 0, 
     .cache_pressure_size = 0,
-    .is_valid = TRUE
+    .is_valid = true
 };
 
 static void maybe_flush_some (CACHETABLE ct, long size);
@@ -129,8 +129,8 @@ static inline void ctpair_destroy(PAIR p) {
 // The cachetable is as close to an ENV as we get.
 //      cachetable_mutex
 struct cachetable {
-    u_int32_t n_in_table;         // number of pairs in the hash table
-    u_int32_t table_size;         // number of buckets in the hash table
+    uint32_t n_in_table;         // number of pairs in the hash table
+    uint32_t table_size;         // number of buckets in the hash table
     PAIR *table;                  // hash table
     PAIR  clock_head;              // of clock . head is the next thing to be up for decrement. 
     PAIR  cleaner_head;              // for cleaner thread. head is the next thing to look at for possible cleaning. 
@@ -148,15 +148,15 @@ struct cachetable {
     KIBBUTZ checkpointing_kibbutz; // small pool for checkpointing cloned pairs
 
     LSN lsn_of_checkpoint_in_progress;
-    u_int32_t checkpoint_num_files;  // how many cachefiles are in the checkpoint
-    u_int32_t checkpoint_num_txns;   // how many transactions are in the checkpoint
+    uint32_t checkpoint_num_files;  // how many cachefiles are in the checkpoint
+    uint32_t checkpoint_num_txns;   // how many transactions are in the checkpoint
     PAIR pending_head;           // list of pairs marked with checkpoint_pending
     struct rwlock pending_lock;  // multiple writer threads, single checkpoint thread,
                                  // see comments in toku_cachetable_begin_checkpoint to understand
                                  // purpose of the pending_lock
     struct minicron checkpointer; // the periodic checkpointing thread
     struct minicron cleaner; // the periodic cleaner thread
-    u_int32_t cleaner_iterations; // how many times to run the cleaner per
+    uint32_t cleaner_iterations; // how many times to run the cleaner per
                                   // cleaner period (minicron has a
                                   // minimum period of 1s so if you want
                                   // more frequent cleaner runs you must
@@ -232,7 +232,7 @@ struct cachefile {
     CACHEFILE next;
     CACHEFILE next_in_checkpoint;
     struct toku_list pairs_for_cachefile; // list of pairs for this cachefile
-    BOOL for_checkpoint; //True if part of the in-progress checkpoint
+    bool for_checkpoint; //True if part of the in-progress checkpoint
 
     // If set and the cachefile closes, the file will be removed.
     // Clients must not operate on the cachefile after setting this,
@@ -248,7 +248,7 @@ struct cachefile {
     void *userdata;
     int (*log_fassociate_during_checkpoint)(CACHEFILE cf, void *userdata); // When starting a checkpoint we must log all open files.
     int (*log_suppress_rollback_during_checkpoint)(CACHEFILE cf, void *userdata); // When starting a checkpoint we must log which files need rollbacks suppressed
-    int (*close_userdata)(CACHEFILE cf, int fd, void *userdata, char **error_string, BOOL lsnvalid, LSN); // when closing the last reference to a cachefile, first call this function. 
+    int (*close_userdata)(CACHEFILE cf, int fd, void *userdata, char **error_string, bool lsnvalid, LSN); // when closing the last reference to a cachefile, first call this function. 
     int (*begin_checkpoint_userdata)(LSN lsn_of_checkpoint, void *userdata); // before checkpointing cachefiles call this function.
     int (*checkpoint_userdata)(CACHEFILE cf, int fd, void *userdata); // when checkpointing a cachefile, call this function.
     int (*end_checkpoint_userdata)(CACHEFILE cf, int fd, void *userdata); // after checkpointing cachefiles call this function.
@@ -291,45 +291,45 @@ checkpoint_thread (void *cachetable_v)
     return r;
 }
 
-int toku_set_checkpoint_period (CACHETABLE ct, u_int32_t new_period) {
+int toku_set_checkpoint_period (CACHETABLE ct, uint32_t new_period) {
     return toku_minicron_change_period(&ct->checkpointer, new_period);
 }
 
-u_int32_t toku_get_checkpoint_period (CACHETABLE ct) {
+uint32_t toku_get_checkpoint_period (CACHETABLE ct) {
     return toku_minicron_get_period(&ct->checkpointer);
 }
 
-u_int32_t toku_get_checkpoint_period_unlocked (CACHETABLE ct) {
+uint32_t toku_get_checkpoint_period_unlocked (CACHETABLE ct) {
     return toku_minicron_get_period_unlocked(&ct->checkpointer);
 }
 
-int toku_set_cleaner_period (CACHETABLE ct, u_int32_t new_period) {
+int toku_set_cleaner_period (CACHETABLE ct, uint32_t new_period) {
     return toku_minicron_change_period(&ct->cleaner, new_period);
 }
 
-u_int32_t toku_get_cleaner_period (CACHETABLE ct) {
+uint32_t toku_get_cleaner_period (CACHETABLE ct) {
     return toku_minicron_get_period(&ct->cleaner);
 }
 
-u_int32_t toku_get_cleaner_period_unlocked (CACHETABLE ct) {
+uint32_t toku_get_cleaner_period_unlocked (CACHETABLE ct) {
     return toku_minicron_get_period_unlocked(&ct->cleaner);
 }
 
-int toku_set_cleaner_iterations (CACHETABLE ct, u_int32_t new_iterations) {
+int toku_set_cleaner_iterations (CACHETABLE ct, uint32_t new_iterations) {
     cachetable_lock(ct);
     ct->cleaner_iterations = new_iterations;
     cachetable_unlock(ct);
     return 0;
 }
 
-u_int32_t toku_get_cleaner_iterations (CACHETABLE ct) {
+uint32_t toku_get_cleaner_iterations (CACHETABLE ct) {
     cachetable_lock(ct);
-    u_int32_t retval =  toku_get_cleaner_iterations_unlocked(ct);
+    uint32_t retval =  toku_get_cleaner_iterations_unlocked(ct);
     cachetable_unlock(ct);
     return retval;
 }
 
-u_int32_t toku_get_cleaner_iterations_unlocked (CACHETABLE ct) {
+uint32_t toku_get_cleaner_iterations_unlocked (CACHETABLE ct) {
     return ct->cleaner_iterations;
 }
 
@@ -373,7 +373,7 @@ int toku_create_cachetable(CACHETABLE *result, long size_limit, LSN UU(initial_l
     return 0;
 }
 
-u_int64_t toku_cachetable_reserve_memory(CACHETABLE ct, double fraction) {
+uint64_t toku_cachetable_reserve_memory(CACHETABLE ct, double fraction) {
     cachetable_lock(ct);
     cachetable_wait_write(ct);
     uint64_t reserved_memory = fraction*(ct->size_limit-ct->size_reserved);
@@ -552,7 +552,7 @@ int toku_cachefile_set_fd (CACHEFILE cf, int fd, const char *fname_in_env) {
     if (r != 0) { 
         r=get_error_errno(); close(fd); goto cleanup; // no change for t:2444
     }
-    if (cf->close_userdata && (r = cf->close_userdata(cf, cf->fd, cf->userdata, 0, FALSE, ZERO_LSN))) {
+    if (cf->close_userdata && (r = cf->close_userdata(cf, cf->fd, cf->userdata, 0, false, ZERO_LSN))) {
         goto cleanup;
     }
     cf->close_userdata = NULL;
@@ -601,7 +601,7 @@ static void remove_cf_from_cachefiles_list (CACHEFILE cf) {
 }
 
 int 
-toku_cachefile_close(CACHEFILE *cfp, char **error_string, BOOL oplsn_valid, LSN oplsn) {
+toku_cachefile_close(CACHEFILE *cfp, char **error_string, bool oplsn_valid, LSN oplsn) {
     int r, close_error = 0;
     CACHEFILE cf = *cfp;
     CACHETABLE ct = cf->cachetable;
@@ -677,10 +677,10 @@ int toku_cachefile_flush (CACHEFILE cf) {
 // The idea here is to mix the bits thoroughly so that we don't have to do modulo by a prime number.
 // Instead we can use a bitmask on a table of size power of two.
 // This hash function does yield improved performance on ./db-benchmark-test-tokudb and ./scanscan
-static inline u_int32_t rot(u_int32_t x, u_int32_t k) {
+static inline uint32_t rot(uint32_t x, uint32_t k) {
     return (x<<k) | (x>>(32-k));
 }
-static inline u_int32_t final (u_int32_t a, u_int32_t b, u_int32_t c) {
+static inline uint32_t final (uint32_t a, uint32_t b, uint32_t c) {
     c ^= b; c -= rot(b,14);
     a ^= c; a -= rot(c,11);
     b ^= a; b -= rot(a,25);
@@ -691,24 +691,24 @@ static inline u_int32_t final (u_int32_t a, u_int32_t b, u_int32_t c) {
     return c;
 }
 
-u_int32_t toku_cachetable_hash (CACHEFILE cachefile, BLOCKNUM key)
+uint32_t toku_cachetable_hash (CACHEFILE cachefile, BLOCKNUM key)
 // Effect: Return a 32-bit hash key.  The hash key shall be suitable for using with bitmasking for a table of size power-of-two.
 {
-    return final(cachefile->filenum.fileid, (u_int32_t)(key.b>>32), (u_int32_t)key.b);
+    return final(cachefile->filenum.fileid, (uint32_t)(key.b>>32), (uint32_t)key.b);
 }
 
 // has ct locked on entry
 // This function MUST NOT release and reacquire the cachetable lock
 // Its callers (toku_cachetable_put_with_dep_pairs) depend on this behavior.
-static void cachetable_rehash (CACHETABLE ct, u_int32_t newtable_size) {
+static void cachetable_rehash (CACHETABLE ct, uint32_t newtable_size) {
     // printf("rehash %p %d %d %d\n", t, primeindexdelta, ct->n_in_table, ct->table_size);
 
     assert(newtable_size>=4 && ((newtable_size & (newtable_size-1))==0));
     PAIR *XCALLOC_N(newtable_size, newtable);
-    u_int32_t i;
+    uint32_t i;
     //printf("%s:%d newtable_size=%d\n", __FILE__, __LINE__, newtable_size);
     assert(newtable!=0);
-    u_int32_t oldtable_size = ct->table_size;
+    uint32_t oldtable_size = ct->table_size;
     ct->table_size=newtable_size;
     for (i=0; i<newtable_size; i++) newtable[i]=0;
     for (i=0; i<oldtable_size; i++) {
@@ -860,13 +860,13 @@ static void cachetable_free_pair(CACHETABLE ct, PAIR p) {
     cachetable_evictions++;
     cachetable_unlock(ct);
     PAIR_ATTR new_attr = p->attr;
-    // Note that flush_callback is called with write_me FALSE, so the only purpose of this 
-    // call is to tell the brt layer to evict the node (keep_me is FALSE).
+    // Note that flush_callback is called with write_me false, so the only purpose of this 
+    // call is to tell the brt layer to evict the node (keep_me is false).
     // Also, because we have already removed the PAIR from the cachetable in 
     // cachetable_remove_pair, we cannot pass in p->cachefile and p->cachefile->fd
     // for the first two parameters, as these may be invalid (#5171), so, we
     // pass in NULL and -1, dummy values
-    flush_callback(NULL, -1, key, value, &disk_data, write_extraargs, old_attr, &new_attr, FALSE, FALSE, TRUE, FALSE);
+    flush_callback(NULL, -1, key, value, &disk_data, write_extraargs, old_attr, &new_attr, false, false, true, false);
     
     cachetable_lock(ct);
     
@@ -899,9 +899,9 @@ static void cachetable_maybe_remove_and_free_pair (CACHETABLE ct, PAIR p) {
 static void cachetable_only_write_locked_data(
     CACHETABLE ct, 
     PAIR p, 
-    BOOL for_checkpoint,
+    bool for_checkpoint,
     PAIR_ATTR* new_attr,
-    BOOL is_clone
+    bool is_clone
     ) 
 {    
     CACHETABLE_FLUSH_CALLBACK flush_callback = p->flush_callback;
@@ -911,7 +911,7 @@ static void cachetable_only_write_locked_data(
     void *disk_data = p->disk_data;
     void *write_extraargs = p->write_extraargs;
     PAIR_ATTR old_attr = p->attr;
-    BOOL dowrite = TRUE;
+    bool dowrite = true;
     
     cachetable_unlock(ct);
     
@@ -926,7 +926,7 @@ static void cachetable_only_write_locked_data(
         old_attr, 
         new_attr, 
         dowrite, 
-        is_clone ? FALSE : TRUE, // keep_me (only keep if this is not cloned pointer)
+        is_clone ? false : true, // keep_me (only keep if this is not cloned pointer)
         for_checkpoint, 
         is_clone //is_clone
         );
@@ -950,8 +950,8 @@ static void cachetable_write_locked_pair(CACHETABLE ct, PAIR p) {
     PAIR_ATTR old_attr = p->attr;
     PAIR_ATTR new_attr = p->attr;
     rwlock_read_lock(&ct->pending_lock, &ct->mutex);
-    BOOL for_checkpoint = p->checkpoint_pending;
-    p->checkpoint_pending = FALSE;
+    bool for_checkpoint = p->checkpoint_pending;
+    p->checkpoint_pending = false;
     // grabbing the disk_nb_mutex here ensures that
     // after this point, no one is writing out a cloned value
     // if we grab the disk_nb_mutex inside the if clause,
@@ -963,7 +963,7 @@ static void cachetable_write_locked_pair(CACHETABLE ct, PAIR p) {
     // there should be no cloned value data
     assert(p->cloned_value_data == NULL);
     if (p->dirty) {
-        cachetable_only_write_locked_data(ct, p, for_checkpoint, &new_attr, FALSE);
+        cachetable_only_write_locked_data(ct, p, for_checkpoint, &new_attr, false);
         //
         // now let's update variables
         //
@@ -1127,7 +1127,7 @@ static bool run_eviction_on_pair(PAIR curr_in_clock, CACHETABLE ct) {
             }
         }
         else {
-            assert(FALSE);
+            assert(false);
         }        
     }
     else {
@@ -1149,7 +1149,7 @@ static void maybe_flush_some (CACHETABLE ct, long size) {
     curr_cachekey.b = INT64_MAX; // create initial value so compiler does not complain
     FILENUM curr_filenum;
     curr_filenum.fileid = UINT32_MAX; // create initial value so compiler does not complain
-    BOOL set_val = FALSE;
+    bool set_val = false;
     
     while ((ct->clock_head) && (size + ct->size_current > ct->size_limit + ct->size_evicting)) {
         PAIR curr_in_clock = ct->clock_head;
@@ -1164,7 +1164,7 @@ static void maybe_flush_some (CACHETABLE ct, long size) {
         }
         if (nb_mutex_users(&curr_in_clock->value_nb_mutex) || nb_mutex_users(&curr_in_clock->disk_nb_mutex)) {
             if (!set_val) {
-                set_val = TRUE;
+                set_val = true;
                 curr_cachekey = ct->clock_head->key;
                 curr_filenum = ct->clock_head->cachefile->filenum;
             }
@@ -1172,10 +1172,10 @@ static void maybe_flush_some (CACHETABLE ct, long size) {
         else {
             bool eviction_run = run_eviction_on_pair(curr_in_clock, ct);
             if (eviction_run) {
-                set_val = FALSE;
+                set_val = false;
             }
             else if (!set_val) {
-                set_val = TRUE;
+                set_val = true;
                 curr_cachekey = ct->clock_head->key;
                 curr_filenum = ct->clock_head->cachefile->filenum;
             }
@@ -1207,7 +1207,7 @@ void toku_cachetable_maybe_flush_some(CACHETABLE ct) {
 // Its callers (toku_cachetable_put_with_dep_pairs) depend on this behavior.
 static PAIR cachetable_insert_at(CACHETABLE ct, 
                                  CACHEFILE cachefile, CACHEKEY key, void *value, 
-                                 u_int32_t fullhash, 
+                                 uint32_t fullhash, 
                                  PAIR_ATTR attr,
                                  CACHETABLE_WRITE_CALLBACK write_callback,
                                  enum cachetable_dirty dirty) {
@@ -1235,7 +1235,7 @@ static PAIR cachetable_insert_at(CACHETABLE ct,
     nb_mutex_init(&p->disk_nb_mutex);
     pair_add_to_clock(ct, p);
     toku_list_push(&cachefile->pairs_for_cachefile, &p->next_for_cachefile);
-    u_int32_t h = fullhash & (ct->table_size-1);
+    uint32_t h = fullhash & (ct->table_size-1);
     p->hash_chain = ct->table[h];
     ct->table[h] = p;
     ct->n_in_table++;
@@ -1252,7 +1252,7 @@ static PAIR cachetable_insert_at(CACHETABLE ct,
 static int cachetable_put_internal(
     CACHEFILE cachefile, 
     CACHEKEY key, 
-    u_int32_t fullhash, 
+    uint32_t fullhash, 
     void*value, 
     PAIR_ATTR attr,
     CACHETABLE_WRITE_CALLBACK write_callback
@@ -1263,10 +1263,10 @@ static int cachetable_put_internal(
         PAIR p;
         for (p=ct->table[fullhash&(cachefile->cachetable->table_size-1)]; p; p=p->hash_chain) {
             if (p->key.b==key.b && p->cachefile==cachefile) {
-                // Ideally, we would like to just assert(FALSE) here
+                // Ideally, we would like to just assert(false) here
                 // and not return an error, but as of Dr. Noga,
                 // cachetable-test2 depends on this behavior.
-                // To replace the following with an assert(FALSE)
+                // To replace the following with an assert(false)
                 // we need to change the behavior of cachetable-test2
                 //
                 // Semantically, these two asserts are not strictly right.  After all, when are two functions eq?
@@ -1298,7 +1298,7 @@ static int cachetable_put_internal(
 
 // ct is locked on entry
 // gets pair if exists, and that is all.
-static int cachetable_get_pair (CACHEFILE cachefile, CACHEKEY key, u_int32_t fullhash, PAIR* pv) {
+static int cachetable_get_pair (CACHEFILE cachefile, CACHEKEY key, uint32_t fullhash, PAIR* pv) {
     CACHETABLE ct = cachefile->cachetable;
     PAIR p;
     int r = -1;
@@ -1327,7 +1327,7 @@ clone_pair(CACHETABLE ct, PAIR p) {
         p->value_data,
         &p->cloned_value_data,
         &new_attr,
-        TRUE,
+        true,
         p->write_extraargs
         );
     cachetable_lock(ct);
@@ -1339,7 +1339,7 @@ clone_pair(CACHETABLE ct, PAIR p) {
     // it doesn't matter whether we clear 
     // the pending bit before the clone
     // or after the clone
-    p->checkpoint_pending = FALSE;
+    p->checkpoint_pending = false;
     p->dirty = CACHETABLE_CLEAN;
     if (new_attr.is_valid) {
         p->attr = new_attr;
@@ -1360,9 +1360,9 @@ static void checkpoint_cloned_pair(void* extra) {
     cachetable_only_write_locked_data(
         ct,
         p,
-        TRUE, //for_checkpoint
+        true, //for_checkpoint
         &new_attr,
-        TRUE //is_clone
+        true //is_clone
         );
     nb_mutex_unlock(&p->disk_nb_mutex);
     bjm_remove_background_job(ct->checkpoint_clones_bjm);
@@ -1419,7 +1419,7 @@ write_locked_pair_for_checkpoint(CACHETABLE ct, PAIR p)
         // is that to clear the bit, we must have both the PAIR lock
         // and the pending lock
         //
-        p->checkpoint_pending = FALSE;
+        p->checkpoint_pending = false;
     }
 }
 
@@ -1457,9 +1457,9 @@ write_pair_for_checkpoint_thread (CACHETABLE ct, PAIR p)
             cachetable_only_write_locked_data(
                 ct,
                 p,
-                TRUE, //for_checkpoint
+                true, //for_checkpoint
                 &attr,
-                TRUE //is_clone
+                true //is_clone
                 );
             nb_mutex_unlock(&p->disk_nb_mutex);
         }
@@ -1472,7 +1472,7 @@ write_pair_for_checkpoint_thread (CACHETABLE ct, PAIR p)
         // is that to clear the bit, we must have both the PAIR lock
         // and the pending lock
         //
-        p->checkpoint_pending = FALSE;
+        p->checkpoint_pending = false;
         nb_mutex_unlock(&p->value_nb_mutex);
     }
 }
@@ -1486,14 +1486,14 @@ write_pair_for_checkpoint_thread (CACHETABLE ct, PAIR p)
 //
 static void checkpoint_dependent_pairs(
     CACHETABLE ct,
-    u_int32_t num_dependent_pairs, // number of dependent pairs that we may need to checkpoint
+    uint32_t num_dependent_pairs, // number of dependent pairs that we may need to checkpoint
     CACHEFILE* dependent_cfs, // array of cachefiles of dependent pairs
     CACHEKEY* dependent_keys, // array of cachekeys of dependent pairs
-    u_int32_t* dependent_fullhash, //array of fullhashes of dependent pairs
+    uint32_t* dependent_fullhash, //array of fullhashes of dependent pairs
     enum cachetable_dirty* dependent_dirty // array stating dirty/cleanness of dependent pairs
     )
 {
-     for (u_int32_t i =0; i < num_dependent_pairs; i++) {
+     for (uint32_t i =0; i < num_dependent_pairs; i++) {
          PAIR curr_dep_pair = NULL;
          int r = cachetable_get_pair(
              dependent_cfs[i],
@@ -1525,13 +1525,13 @@ int toku_cachetable_put_with_dep_pairs(
     PAIR_ATTR attr,
     CACHETABLE_WRITE_CALLBACK write_callback,
     void *get_key_and_fullhash_extra,
-    u_int32_t num_dependent_pairs, // number of dependent pairs that we may need to checkpoint
+    uint32_t num_dependent_pairs, // number of dependent pairs that we may need to checkpoint
     CACHEFILE* dependent_cfs, // array of cachefiles of dependent pairs
     CACHEKEY* dependent_keys, // array of cachekeys of dependent pairs
-    u_int32_t* dependent_fullhash, //array of fullhashes of dependent pairs
+    uint32_t* dependent_fullhash, //array of fullhashes of dependent pairs
     enum cachetable_dirty* dependent_dirty, // array stating dirty/cleanness of dependent pairs
     CACHEKEY* key,
-    u_int32_t* fullhash
+    uint32_t* fullhash
     )
 {
     //
@@ -1594,7 +1594,7 @@ int toku_cachetable_put_with_dep_pairs(
 }
 
 
-int toku_cachetable_put(CACHEFILE cachefile, CACHEKEY key, u_int32_t fullhash, void*value, PAIR_ATTR attr,
+int toku_cachetable_put(CACHEFILE cachefile, CACHEKEY key, uint32_t fullhash, void*value, PAIR_ATTR attr,
                         CACHETABLE_WRITE_CALLBACK write_callback
                         ) {
     CACHETABLE ct = cachefile->cachetable;
@@ -1631,7 +1631,7 @@ do_partial_fetch(
     PAIR p, 
     CACHETABLE_PARTIAL_FETCH_CALLBACK pf_callback, 
     void *read_extraargs,
-    BOOL keep_pair_locked
+    bool keep_pair_locked
     )
 {
     PAIR_ATTR old_attr = p->attr;
@@ -1659,7 +1659,7 @@ void toku_cachetable_pf_pinned_pair(
     void* read_extraargs,
     CACHEFILE cf,
     CACHEKEY key,
-    u_int32_t fullhash
+    uint32_t fullhash
     ) 
 {
     PAIR_ATTR attr;
@@ -1683,14 +1683,14 @@ void toku_cachetable_pf_pinned_pair(
 int toku_cachetable_get_and_pin (
     CACHEFILE cachefile, 
     CACHEKEY key, 
-    u_int32_t fullhash, 
+    uint32_t fullhash, 
     void**value, 
     long *sizep,
     CACHETABLE_WRITE_CALLBACK write_callback,
     CACHETABLE_FETCH_CALLBACK fetch_callback, 
     CACHETABLE_PARTIAL_FETCH_REQUIRED_CALLBACK pf_req_callback,
     CACHETABLE_PARTIAL_FETCH_CALLBACK pf_callback,
-    BOOL may_modify_value,
+    bool may_modify_value,
     void* read_extraargs // parameter for fetch_callback, pf_req_callback, and pf_callback
     ) 
 {
@@ -1727,12 +1727,12 @@ static void cachetable_fetch_pair(
     PAIR p, 
     CACHETABLE_FETCH_CALLBACK fetch_callback, 
     void* read_extraargs,
-    BOOL keep_pair_locked
+    bool keep_pair_locked
     ) 
 {
     // helgrind
     CACHEKEY key = p->key;
-    u_int32_t fullhash = p->fullhash;
+    uint32_t fullhash = p->fullhash;
 
     void *toku_value = NULL;
     void *disk_data = NULL;
@@ -1766,16 +1766,16 @@ static void cachetable_fetch_pair(
     if (0) printf("%s:%d %" PRId64 " complete\n", __FUNCTION__, __LINE__, key.b);
 }
 
-static BOOL resolve_checkpointing_fast(PAIR p) {
+static bool resolve_checkpointing_fast(PAIR p) {
     return !(p->checkpoint_pending && (p->dirty == CACHETABLE_DIRTY) && !p->clone_callback);
 }
 static void checkpoint_pair_and_dependent_pairs(
     CACHETABLE ct,
     PAIR p,
-    u_int32_t num_dependent_pairs, // number of dependent pairs that we may need to checkpoint
+    uint32_t num_dependent_pairs, // number of dependent pairs that we may need to checkpoint
     CACHEFILE* dependent_cfs, // array of cachefiles of dependent pairs
     CACHEKEY* dependent_keys, // array of cachekeys of dependent pairs
-    u_int32_t* dependent_fullhash, //array of fullhashes of dependent pairs
+    uint32_t* dependent_fullhash, //array of fullhashes of dependent pairs
     enum cachetable_dirty* dependent_dirty // array stating dirty/cleanness of dependent pairs
     )
 {
@@ -1819,19 +1819,19 @@ static void checkpoint_pair_and_dependent_pairs(
 int toku_cachetable_get_and_pin_with_dep_pairs (
     CACHEFILE cachefile, 
     CACHEKEY key, 
-    u_int32_t fullhash, 
+    uint32_t fullhash, 
     void**value, 
     long *sizep,
     CACHETABLE_WRITE_CALLBACK write_callback,
     CACHETABLE_FETCH_CALLBACK fetch_callback, 
     CACHETABLE_PARTIAL_FETCH_REQUIRED_CALLBACK pf_req_callback,
     CACHETABLE_PARTIAL_FETCH_CALLBACK pf_callback,
-    BOOL may_modify_value,
+    bool may_modify_value,
     void* read_extraargs, // parameter for fetch_callback, pf_req_callback, and pf_callback
-    u_int32_t num_dependent_pairs, // number of dependent pairs that we may need to checkpoint
+    uint32_t num_dependent_pairs, // number of dependent pairs that we may need to checkpoint
     CACHEFILE* dependent_cfs, // array of cachefiles of dependent pairs
     CACHEKEY* dependent_keys, // array of cachekeys of dependent pairs
-    u_int32_t* dependent_fullhash, //array of fullhashes of dependent pairs
+    uint32_t* dependent_fullhash, //array of fullhashes of dependent pairs
     enum cachetable_dirty* dependent_dirty // array stating dirty/cleanness of dependent pairs
     ) 
 {
@@ -1858,7 +1858,7 @@ int toku_cachetable_get_and_pin_with_dep_pairs (
             }
             cachetable_unlock(ct);
             
-            BOOL partial_fetch_required = pf_req_callback(p->value_data,read_extraargs);
+            bool partial_fetch_required = pf_req_callback(p->value_data,read_extraargs);
             // shortcutting a path to getting the user the data
             // helps scalability for in-memory workloads
             if (!partial_fetch_required) {
@@ -1878,7 +1878,7 @@ int toku_cachetable_get_and_pin_with_dep_pairs (
                 // so we do a sanity check here.
                 assert(!p->dirty);
 
-                do_partial_fetch(ct, cachefile, p, pf_callback, read_extraargs, TRUE);
+                do_partial_fetch(ct, cachefile, p, pf_callback, read_extraargs, true);
             }
             goto got_value;
         }
@@ -1915,7 +1915,7 @@ int toku_cachetable_get_and_pin_with_dep_pairs (
         // Retrieve the value of the PAIR from disk.
         // The pair being fetched will be marked as pending if a checkpoint happens during the
         // fetch because begin_checkpoint will mark as pending any pair that is locked even if it is clean.        
-        cachetable_fetch_pair(ct, cachefile, p, fetch_callback, read_extraargs, TRUE);
+        cachetable_fetch_pair(ct, cachefile, p, fetch_callback, read_extraargs, true);
         cachetable_miss++;
         cachetable_misstime += get_tnow() - t0;
         goto got_value;
@@ -1938,7 +1938,7 @@ int toku_cachetable_get_and_pin_with_dep_pairs (
 //  For example, imagine that we can modify a bit in a dirty parent, or modify a bit in a clean child, then we should modify
 //  the dirty parent (which will have to do I/O eventually anyway) rather than incur a full block write to modify one bit.
 //  Similarly, if the checkpoint is actually pending, we don't want to block on it.
-int toku_cachetable_maybe_get_and_pin (CACHEFILE cachefile, CACHEKEY key, u_int32_t fullhash, void**value) {
+int toku_cachetable_maybe_get_and_pin (CACHEFILE cachefile, CACHEKEY key, uint32_t fullhash, void**value) {
     CACHETABLE ct = cachefile->cachetable;
     PAIR p;
     int r = -1;
@@ -1965,7 +1965,7 @@ int toku_cachetable_maybe_get_and_pin (CACHEFILE cachefile, CACHEKEY key, u_int3
 //Used by flusher threads to possibly pin child on client thread if pinning is cheap
 //Same as toku_cachetable_maybe_get_and_pin except that we don't care if the node is clean or dirty (return the node regardless).
 //All other conditions remain the same.
-int toku_cachetable_maybe_get_and_pin_clean (CACHEFILE cachefile, CACHEKEY key, u_int32_t fullhash, void**value) {
+int toku_cachetable_maybe_get_and_pin_clean (CACHEFILE cachefile, CACHEKEY key, uint32_t fullhash, void**value) {
     CACHETABLE ct = cachefile->cachetable;
     PAIR p;
     int r = -1;
@@ -1988,7 +1988,7 @@ int toku_cachetable_maybe_get_and_pin_clean (CACHEFILE cachefile, CACHEKEY key,
 }
 
 static int
-cachetable_unpin_internal(CACHEFILE cachefile, CACHEKEY key, u_int32_t fullhash, enum cachetable_dirty dirty, PAIR_ATTR attr, BOOL have_ct_lock, BOOL flush)
+cachetable_unpin_internal(CACHEFILE cachefile, CACHEKEY key, uint32_t fullhash, enum cachetable_dirty dirty, PAIR_ATTR attr, bool have_ct_lock, bool flush)
 // size==0 means that the size didn't change.
 {
     CACHETABLE ct = cachefile->cachetable;
@@ -2018,20 +2018,20 @@ cachetable_unpin_internal(CACHEFILE cachefile, CACHEKEY key, u_int32_t fullhash,
     return r;
 }
 
-int toku_cachetable_unpin(CACHEFILE cachefile, CACHEKEY key, u_int32_t fullhash, enum cachetable_dirty dirty, PAIR_ATTR attr) {
+int toku_cachetable_unpin(CACHEFILE cachefile, CACHEKEY key, uint32_t fullhash, enum cachetable_dirty dirty, PAIR_ATTR attr) {
     // By default we don't have the lock
-    return cachetable_unpin_internal(cachefile, key, fullhash, dirty, attr, FALSE, TRUE);
+    return cachetable_unpin_internal(cachefile, key, fullhash, dirty, attr, false, true);
 }
-int toku_cachetable_unpin_ct_prelocked_no_flush(CACHEFILE cachefile, CACHEKEY key, u_int32_t fullhash, enum cachetable_dirty dirty, PAIR_ATTR attr) {
+int toku_cachetable_unpin_ct_prelocked_no_flush(CACHEFILE cachefile, CACHEKEY key, uint32_t fullhash, enum cachetable_dirty dirty, PAIR_ATTR attr) {
     // We hold the cachetable mutex.
-    return cachetable_unpin_internal(cachefile, key, fullhash, dirty, attr, TRUE, FALSE);
+    return cachetable_unpin_internal(cachefile, key, fullhash, dirty, attr, true, false);
 }
 
 static void
 run_unlockers (UNLOCKERS unlockers) {
     while (unlockers) {
         assert(unlockers->locked);
-        unlockers->locked = FALSE;
+        unlockers->locked = false;
         unlockers->f(unlockers->extra);
         unlockers=unlockers->next;
     }
@@ -2040,14 +2040,14 @@ run_unlockers (UNLOCKERS unlockers) {
 int toku_cachetable_get_and_pin_nonblocking (
     CACHEFILE cf, 
     CACHEKEY key, 
-    u_int32_t fullhash, 
+    uint32_t fullhash, 
     void**value, 
     long* UU(sizep),
     CACHETABLE_WRITE_CALLBACK write_callback,
     CACHETABLE_FETCH_CALLBACK fetch_callback, 
     CACHETABLE_PARTIAL_FETCH_REQUIRED_CALLBACK pf_req_callback,
     CACHETABLE_PARTIAL_FETCH_CALLBACK pf_callback,
-    BOOL may_modify_value,
+    bool may_modify_value,
     void *read_extraargs,
     UNLOCKERS unlockers
     )
@@ -2091,7 +2091,7 @@ int toku_cachetable_get_and_pin_nonblocking (
                 // when calling pf_req_callback, and if possible, returns the PAIR to the user without
                 // reacquiring the cachetable lock
                 cachetable_unlock(ct);
-                BOOL partial_fetch_required = pf_req_callback(p->value_data,read_extraargs);
+                bool partial_fetch_required = pf_req_callback(p->value_data,read_extraargs);
                 //
                 // Just because the PAIR exists does necessarily mean the all the data the caller requires
                 // is in memory. A partial fetch may be required, which is evaluated above
@@ -2102,7 +2102,7 @@ int toku_cachetable_get_and_pin_nonblocking (
                     cachetable_lock(ct);
                     run_unlockers(unlockers); // The contract says the unlockers are run with the ct lock being held.
                     // Now wait for the I/O to occur.    
-                    do_partial_fetch(ct, cf, p, pf_callback, read_extraargs, FALSE);
+                    do_partial_fetch(ct, cf, p, pf_callback, read_extraargs, false);
                     cachetable_unlock(ct);
                     return TOKUDB_TRY_AGAIN;
                 }
@@ -2140,8 +2140,8 @@ int toku_cachetable_get_and_pin_nonblocking (
     assert(p);
     nb_mutex_lock(&p->value_nb_mutex, &ct->mutex);
     run_unlockers(unlockers); // we hold the ct mutex.
-    u_int64_t t0 = get_tnow();
-    cachetable_fetch_pair(ct, cf, p, fetch_callback, read_extraargs, FALSE);
+    uint64_t t0 = get_tnow();
+    cachetable_fetch_pair(ct, cf, p, fetch_callback, read_extraargs, false);
     cachetable_miss++;
     cachetable_misstime += get_tnow() - t0;
     cachetable_unlock(ct);
@@ -2172,7 +2172,7 @@ static void cachetable_reader(void* extra) {
         cpargs->p,
         cpargs->fetch_callback,
         cpargs->read_extraargs,
-        FALSE
+        false
         );
     cachetable_unlock(ct);
     bjm_remove_background_job(cf->bjm);
@@ -2184,24 +2184,24 @@ static void cachetable_partial_reader(void* extra) {
     CACHEFILE cf = cpargs->p->cachefile;
     CACHETABLE ct = cf->cachetable;
     cachetable_lock(ct);
-    do_partial_fetch(ct, cpargs->p->cachefile, cpargs->p, cpargs->pf_callback, cpargs->read_extraargs, FALSE);
+    do_partial_fetch(ct, cpargs->p->cachefile, cpargs->p, cpargs->pf_callback, cpargs->read_extraargs, false);
     cachetable_unlock(ct);
     bjm_remove_background_job(cf->bjm);
     toku_free(cpargs);
 }
 
-int toku_cachefile_prefetch(CACHEFILE cf, CACHEKEY key, u_int32_t fullhash,
+int toku_cachefile_prefetch(CACHEFILE cf, CACHEKEY key, uint32_t fullhash,
                             CACHETABLE_WRITE_CALLBACK write_callback,
                             CACHETABLE_FETCH_CALLBACK fetch_callback,
                             CACHETABLE_PARTIAL_FETCH_REQUIRED_CALLBACK pf_req_callback,
                             CACHETABLE_PARTIAL_FETCH_CALLBACK pf_callback,
                             void *read_extraargs,
-                            BOOL *doing_prefetch)
+                            bool *doing_prefetch)
 // Effect: See the documentation for this function in cachetable.h
 {
     int r = 0;
     if (doing_prefetch) {
-        *doing_prefetch = FALSE;
+        *doing_prefetch = false;
     }
     CACHETABLE ct = cf->cachetable;
     cachetable_lock(ct);
@@ -2237,13 +2237,13 @@ int toku_cachefile_prefetch(CACHEFILE cf, CACHEKEY key, u_int32_t fullhash,
         cpargs->read_extraargs = read_extraargs;
         toku_kibbutz_enq(ct->ct_kibbutz, cachetable_reader, cpargs);
         if (doing_prefetch) {
-            *doing_prefetch = TRUE;
+            *doing_prefetch = true;
         }
     }
     else if (nb_mutex_users(&p->value_nb_mutex)==0) {        
         // nobody else is using the node, so we should go ahead and prefetch
         nb_mutex_lock(&p->value_nb_mutex, &ct->mutex);
-        BOOL partial_fetch_required = pf_req_callback(p->value_data, read_extraargs);
+        bool partial_fetch_required = pf_req_callback(p->value_data, read_extraargs);
 
         if (partial_fetch_required) {
             r = bjm_add_background_job(cf->bjm);
@@ -2254,7 +2254,7 @@ int toku_cachefile_prefetch(CACHEFILE cf, CACHEKEY key, u_int32_t fullhash,
             cpargs->read_extraargs = read_extraargs;
             toku_kibbutz_enq(ct->ct_kibbutz, cachetable_partial_reader, cpargs);
             if (doing_prefetch) {
-                *doing_prefetch = TRUE;
+                *doing_prefetch = true;
             }
         }
         else {
@@ -2270,7 +2270,7 @@ int toku_cachefile_prefetch(CACHEFILE cf, CACHEKEY key, u_int32_t fullhash,
 int toku_cachetable_rename (CACHEFILE cachefile, CACHEKEY oldkey, CACHEKEY newkey) {
     CACHETABLE ct = cachefile->cachetable;
     PAIR *ptr_to_p,p;
-    u_int32_t fullhash = toku_cachetable_hash(cachefile, oldkey);
+    uint32_t fullhash = toku_cachetable_hash(cachefile, oldkey);
     cachetable_lock(ct);
     for (ptr_to_p = &ct->table[fullhash&(ct->table_size-1)],  p = *ptr_to_p;
          p;
@@ -2278,8 +2278,8 @@ int toku_cachetable_rename (CACHEFILE cachefile, CACHEKEY oldkey, CACHEKEY newke
         if (p->key.b==oldkey.b && p->cachefile==cachefile) {
             *ptr_to_p = p->hash_chain;
             p->key = newkey;
-            u_int32_t new_fullhash = toku_cachetable_hash(cachefile, newkey);
-            u_int32_t nh = new_fullhash&(ct->table_size-1);
+            uint32_t new_fullhash = toku_cachetable_hash(cachefile, newkey);
+            uint32_t nh = new_fullhash&(ct->table_size-1);
             p->fullhash = new_fullhash;
             p->hash_chain = ct->table[nh];
             ct->table[nh] = p;
@@ -2297,11 +2297,11 @@ void toku_cachefile_verify (CACHEFILE cf) {
 
 void toku_cachetable_verify (CACHETABLE ct) {
     cachetable_lock(ct);
-    u_int32_t num_found = 0;
+    uint32_t num_found = 0;
 
     // First clear all the verify flags by going through the hash chains
     {
-        u_int32_t i;
+        uint32_t i;
         for (i=0; i<ct->table_size; i++) {
             PAIR p;
             for (p=ct->table[i]; p; p=p->hash_chain) {
@@ -2314,11 +2314,11 @@ void toku_cachetable_verify (CACHETABLE ct) {
     // Now go through the clock chain, make sure everything in the LRU chain is hashed.
     {
         PAIR p;
-        BOOL is_first = TRUE;
+        bool is_first = true;
         for (p=ct->clock_head; ct->clock_head!=NULL && (p!=ct->clock_head || is_first); p=p->clock_next) {
-            is_first=FALSE;
+            is_first=false;
             PAIR p2;
-            u_int32_t fullhash = p->fullhash;
+            uint32_t fullhash = p->fullhash;
             //assert(fullhash==toku_cachetable_hash(p->cachefile, p->key));
             for (p2=ct->table[fullhash&(ct->table_size-1)]; p2; p2=p2->hash_chain) {
                 if (p2==p) {
@@ -2351,9 +2351,9 @@ static void cachetable_flush_pair_for_close(void* extra) {
     cachetable_only_write_locked_data(
         ct,
         p,
-        FALSE, // not for a checkpoint, as we assert above
+        false, // not for a checkpoint, as we assert above
         &attr,
-        FALSE // not a clone
+        false // not a clone
         );            
     p->dirty = CACHETABLE_CLEAN;
     cachetable_unlock(ct);
@@ -2486,7 +2486,7 @@ toku_cachetable_close (CACHETABLE *ctp) {
     }
     cachetable_lock(ct);
     cachetable_flush_cachefile(ct, NULL);
-    u_int32_t i;
+    uint32_t i;
     for (i=0; i<ct->table_size; i++) {
         if (ct->table[i]) return -1;
     }
@@ -2518,7 +2518,7 @@ int toku_cachetable_unpin_and_remove (
     CACHETABLE ct = cachefile->cachetable;
     PAIR p;
     cachetable_lock(ct);
-    u_int32_t fullhash = toku_cachetable_hash(cachefile, key);
+    uint32_t fullhash = toku_cachetable_hash(cachefile, key);
     for (p=ct->table[fullhash&(ct->table_size-1)]; p; p=p->hash_chain) {
         if (p->key.b==key.b && p->cachefile==cachefile) {
             p->dirty = CACHETABLE_CLEAN; // clear the dirty bit.  We're just supposed to remove it.
@@ -2531,10 +2531,10 @@ int toku_cachetable_unpin_and_remove (
             //
             // take care of key removal
             //
-            BOOL for_checkpoint = p->checkpoint_pending;
+            bool for_checkpoint = p->checkpoint_pending;
             // now let's wipe out the pending bit, because we are
             // removing the PAIR
-            p->checkpoint_pending = FALSE;
+            p->checkpoint_pending = false;
             //
             // Here is a tricky thing.
             // Later on in this function, we may release the
@@ -2635,7 +2635,7 @@ int toku_cachetable_unpin_and_remove (
 }
 
 static int
-set_filenum_in_array(OMTVALUE hv, u_int32_t index, void*arrayv) {
+set_filenum_in_array(OMTVALUE hv, uint32_t index, void*arrayv) {
     FILENUM *array = (FILENUM *) arrayv;
     FT h = (FT) hv;
     array[index] = toku_cachefile_filenum(h->cf);
@@ -2739,7 +2739,7 @@ toku_cachetable_begin_checkpoint (CACHETABLE ct, TOKULOGGER logger) {
                 }
                 cf->next_in_checkpoint       = ct->cachefiles_in_checkpoint;
                 ct->cachefiles_in_checkpoint = cf;
-                cf->for_checkpoint           = TRUE;
+                cf->for_checkpoint           = true;
             }
         }
 
@@ -2816,7 +2816,7 @@ toku_cachetable_begin_checkpoint (CACHETABLE ct, TOKULOGGER logger) {
         // belongs in the checkpoint.
         // Now let's go back to the writer thread:
         //  - because the checkpoint pending bit was not set for the PAIR, the for_checkpoint parameter
-        //     passed into the flush callback is FALSE.
+        //     passed into the flush callback is false.
         //  - as a result, the PAIR is written to disk, the current translation table is updated, but the
         //     inprogress translation table is NOT updated.
         //  - the PAIR is marked as clean because it was just written to disk
@@ -2846,7 +2846,7 @@ toku_cachetable_begin_checkpoint (CACHETABLE ct, TOKULOGGER logger) {
                 //     we may end up clearing the pending bit before the
                 //     current lock is ever released.
                 if (p->dirty || nb_mutex_writers(&p->value_nb_mutex)) {
-                    p->checkpoint_pending = TRUE;
+                    p->checkpoint_pending = true;
                     if (ct->pending_head) {
                         ct->pending_head->pending_prev = p;
                     }
@@ -2968,7 +2968,7 @@ toku_cachetable_end_checkpoint(CACHETABLE ct, TOKULOGGER logger,
         while ((cf = ct->cachefiles_in_checkpoint)) {
             ct->cachefiles_in_checkpoint = cf->next_in_checkpoint; 
             cf->next_in_checkpoint       = NULL;
-            cf->for_checkpoint           = FALSE;
+            cf->for_checkpoint           = false;
             // checking for function existing so that this function
             // can be called from cachetable tests
             if (cf->note_unpin_by_checkpoint) {
@@ -2996,7 +2996,7 @@ FILENUM toku_cachefile_filenum (CACHEFILE cf) {
 // debug functions
 
 int toku_cachetable_assert_all_unpinned (CACHETABLE ct) {
-    u_int32_t i;
+    uint32_t i;
     int some_pinned=0;
     cachetable_lock(ct);
     for (i=0; i<ct->table_size; i++) {
@@ -3031,7 +3031,7 @@ int toku_cachefile_count_pinned (CACHEFILE cf, int print_them) {
 }
 
 void toku_cachetable_print_state (CACHETABLE ct) {
-    u_int32_t i;
+    uint32_t i;
     cachetable_lock(ct);
     for (i=0; i<ct->table_size; i++) {
         PAIR p = ct->table[i];
@@ -3063,7 +3063,7 @@ int toku_cachetable_get_key_state (CACHETABLE ct, CACHEKEY key, CACHEFILE cf, vo
                                    int *dirty_ptr, long long *pin_ptr, long *size_ptr) {
     PAIR p;
     int r = -1;
-    u_int32_t fullhash = toku_cachetable_hash(cf, key);
+    uint32_t fullhash = toku_cachetable_hash(cf, key);
     cachetable_lock(ct);
     for (p = ct->table[fullhash&(ct->table_size-1)]; p; p = p->hash_chain) {
         if (p->key.b == key.b && p->cachefile == cf) {
@@ -3088,7 +3088,7 @@ toku_cachefile_set_userdata (CACHEFILE cf,
                              void *userdata,
                              int (*log_fassociate_during_checkpoint)(CACHEFILE, void*),
                              int (*log_suppress_rollback_during_checkpoint)(CACHEFILE, void*),
-                             int (*close_userdata)(CACHEFILE, int, void*, char**, BOOL, LSN),
+                             int (*close_userdata)(CACHEFILE, int, void*, char**, bool, LSN),
                              int (*checkpoint_userdata)(CACHEFILE, int, void*),
                              int (*begin_checkpoint_userdata)(LSN, void*),
                              int (*end_checkpoint_userdata)(CACHEFILE, int, void*),
@@ -3136,7 +3136,7 @@ toku_cachefile_is_unlink_on_close(CACHEFILE cf) {
     return cf->unlink_on_close;
 }
 
-u_int64_t toku_cachefile_size(CACHEFILE cf) {
+uint64_t toku_cachefile_size(CACHEFILE cf) {
     int64_t file_size;
     int fd = toku_cachefile_get_fd(cf);
     int r = toku_os_get_file_size(fd, &file_size);
@@ -3205,8 +3205,8 @@ toku_cleaner_thread (void *cachetable_v)
     int r;
     CACHETABLE ct = (CACHETABLE) cachetable_v;
     assert(ct);
-    u_int32_t num_iterations = toku_get_cleaner_iterations(ct);
-    for (u_int32_t i = 0; i < num_iterations; ++i) {
+    uint32_t num_iterations = toku_get_cleaner_iterations(ct);
+    for (uint32_t i = 0; i < num_iterations; ++i) {
         cleaner_executions++;
         cachetable_lock(ct);
         PAIR best_pair = NULL;
@@ -3265,7 +3265,7 @@ toku_cleaner_thread (void *cachetable_v)
                 write_locked_pair_for_checkpoint(ct, best_pair);
             }
 
-            BOOL cleaner_callback_called = FALSE;
+            bool cleaner_callback_called = false;
             
             // it's theoretically possible that after writing a PAIR for checkpoint, the
             // PAIR's heuristic tells us nothing needs to be done. It is not possible
@@ -3278,7 +3278,7 @@ toku_cleaner_thread (void *cachetable_v)
                                                     best_pair->fullhash,
                                                     best_pair->write_extraargs);
                 assert_zero(r);
-                cleaner_callback_called = TRUE;
+                cleaner_callback_called = true;
                 cachetable_lock(ct);
             }
 
diff --git a/ft/cachetable.h b/ft/cachetable.h
index 67b1da371c90b1ce8ca7ce1f24ac59a7178708c5..663c5d5501c12597a68f421d050f306429516cdb 100644
--- a/ft/cachetable.h
+++ b/ft/cachetable.h
@@ -28,12 +28,12 @@
 typedef BLOCKNUM CACHEKEY;
 
 
-int toku_set_cleaner_period (CACHETABLE ct, u_int32_t new_period);
-u_int32_t toku_get_cleaner_period (CACHETABLE ct);
-u_int32_t toku_get_cleaner_period_unlocked (CACHETABLE ct);
-int toku_set_cleaner_iterations (CACHETABLE ct, u_int32_t new_iterations);
-u_int32_t toku_get_cleaner_iterations (CACHETABLE ct);
-u_int32_t toku_get_cleaner_iterations_unlocked (CACHETABLE ct);
+int toku_set_cleaner_period (CACHETABLE ct, uint32_t new_period);
+uint32_t toku_get_cleaner_period (CACHETABLE ct);
+uint32_t toku_get_cleaner_period_unlocked (CACHETABLE ct);
+int toku_set_cleaner_iterations (CACHETABLE ct, uint32_t new_iterations);
+uint32_t toku_get_cleaner_iterations (CACHETABLE ct);
+uint32_t toku_get_cleaner_iterations_unlocked (CACHETABLE ct);
 
 // cachetable operations
 
@@ -121,14 +121,14 @@ enum cachetable_dirty {
 // When for_checkpoint is true, this was a 'pending' write
 // Returns: 0 if success, otherwise an error number.
 // Can access fd (fd is protected by a readlock during call)
-typedef void (*CACHETABLE_FLUSH_CALLBACK)(CACHEFILE, int fd, CACHEKEY key, void *value, void **disk_data, void *write_extraargs, PAIR_ATTR size, PAIR_ATTR* new_size, BOOL write_me, BOOL keep_me, BOOL for_checkpoint, BOOL is_clone);
+typedef void (*CACHETABLE_FLUSH_CALLBACK)(CACHEFILE, int fd, CACHEKEY key, void *value, void **disk_data, void *write_extraargs, PAIR_ATTR size, PAIR_ATTR* new_size, bool write_me, bool keep_me, bool for_checkpoint, bool is_clone);
 
 // The fetch callback is called when a thread is attempting to get and pin a memory
 // object and it is not in the cachetable.
 // Returns: 0 if success, otherwise an error number.  The address and size of the object
 // associated with the key are returned.
 // Can access fd (fd is protected by a readlock during call)
-typedef int (*CACHETABLE_FETCH_CALLBACK)(CACHEFILE, int fd, CACHEKEY key, u_int32_t fullhash, void **value_data, void **disk_data, PAIR_ATTR *sizep, int *dirtyp, void *read_extraargs);
+typedef int (*CACHETABLE_FETCH_CALLBACK)(CACHEFILE, int fd, CACHEKEY key, uint32_t fullhash, void **value_data, void **disk_data, PAIR_ATTR *sizep, int *dirtyp, void *read_extraargs);
 
 // The cachetable calls the partial eviction estimate callback to determine if 
 // partial eviction is a cheap operation that may be called by on the client thread
@@ -148,15 +148,15 @@ typedef void (*CACHETABLE_PARTIAL_EVICTION_EST_CALLBACK)(void *ftnode_pv, void*
 // Requires a write lock to be held on the PAIR in the cachetable while this function is called
 typedef int (*CACHETABLE_PARTIAL_EVICTION_CALLBACK)(void *ftnode_pv, PAIR_ATTR old_attr, PAIR_ATTR* new_attr, void *write_extraargs);
 
-// The cachetable calls this function to determine if get_and_pin call requires a partial fetch. If this function returns TRUE, 
+// The cachetable calls this function to determine if get_and_pin call requires a partial fetch. If this function returns true, 
 // then the cachetable will subsequently call CACHETABLE_PARTIAL_FETCH_CALLBACK to perform
-// a partial fetch. If this function returns FALSE, then the PAIR's value is returned to the caller as is.
+// a partial fetch. If this function returns false, then the PAIR's value is returned to the caller as is.
 //
 // An alternative to having this callback is to always call CACHETABLE_PARTIAL_FETCH_CALLBACK, and let
 // CACHETABLE_PARTIAL_FETCH_CALLBACK decide whether to do any partial fetching or not.
 // There is no particular reason why this alternative was not chosen.
 // Requires: a read lock to be held on the PAIR
-typedef BOOL (*CACHETABLE_PARTIAL_FETCH_REQUIRED_CALLBACK)(void *ftnode_pv, void *read_extraargs);
+typedef bool (*CACHETABLE_PARTIAL_FETCH_REQUIRED_CALLBACK)(void *ftnode_pv, void *read_extraargs);
 
 // The cachetable calls the partial fetch callback when a thread needs to read or decompress a subset of a PAIR into memory.
 // An example is needing to read a basement node into memory. Another example is decompressing an internal node's
@@ -167,9 +167,9 @@ typedef BOOL (*CACHETABLE_PARTIAL_FETCH_REQUIRED_CALLBACK)(void *ftnode_pv, void
 typedef int (*CACHETABLE_PARTIAL_FETCH_CALLBACK)(void *value_data, void* disk_data, void *read_extraargs, int fd, PAIR_ATTR *sizep);
 
 // TODO(leif) XXX TODO XXX
-typedef int (*CACHETABLE_CLEANER_CALLBACK)(void *ftnode_pv, BLOCKNUM blocknum, u_int32_t fullhash, void *write_extraargs);
+typedef int (*CACHETABLE_CLEANER_CALLBACK)(void *ftnode_pv, BLOCKNUM blocknum, uint32_t fullhash, void *write_extraargs);
 
-typedef void (*CACHETABLE_CLONE_CALLBACK)(void* value_data, void** cloned_value_data, PAIR_ATTR* new_attr, BOOL for_checkpoint, void* write_extraargs);
+typedef void (*CACHETABLE_CLONE_CALLBACK)(void* value_data, void** cloned_value_data, PAIR_ATTR* new_attr, bool for_checkpoint, void* write_extraargs);
 
 typedef struct {
     CACHETABLE_FLUSH_CALLBACK flush_callback;
@@ -180,14 +180,14 @@ typedef struct {
     void* write_extraargs; // parameter for flush_callback, pe_est_callback, pe_callback, and cleaner_callback
 } CACHETABLE_WRITE_CALLBACK;
 
-typedef void (*CACHETABLE_GET_KEY_AND_FULLHASH)(CACHEKEY* cachekey, u_int32_t* fullhash, void* extra);
+typedef void (*CACHETABLE_GET_KEY_AND_FULLHASH)(CACHEKEY* cachekey, uint32_t* fullhash, void* extra);
 
-typedef void (*CACHETABLE_REMOVE_KEY)(CACHEKEY* cachekey, BOOL for_checkpoint, void* extra);
+typedef void (*CACHETABLE_REMOVE_KEY)(CACHEKEY* cachekey, bool for_checkpoint, void* extra);
 
 void toku_cachefile_set_userdata(CACHEFILE cf, void *userdata,
     int (*log_fassociate_during_checkpoint)(CACHEFILE, void*),
     int (*log_suppress_rollback_during_checkpoint)(CACHEFILE, void*),
-    int (*close_userdata)(CACHEFILE, int, void*, char **/*error_string*/, BOOL, LSN),
+    int (*close_userdata)(CACHEFILE, int, void*, char **/*error_string*/, bool, LSN),
     int (*checkpoint_userdata)(CACHEFILE, int, void*),
     int (*begin_checkpoint_userdata)(LSN, void*),
     int (*end_checkpoint_userdata)(CACHEFILE, int, void*),
@@ -214,13 +214,13 @@ int toku_cachetable_put_with_dep_pairs(
     PAIR_ATTR attr,
     CACHETABLE_WRITE_CALLBACK write_callback,
     void *get_key_and_fullhash_extra,
-    u_int32_t num_dependent_pairs, // number of dependent pairs that we may need to checkpoint
+    uint32_t num_dependent_pairs, // number of dependent pairs that we may need to checkpoint
     CACHEFILE* dependent_cfs, // array of cachefiles of dependent pairs
     CACHEKEY* dependent_keys, // array of cachekeys of dependent pairs
-    u_int32_t* dependent_fullhash, //array of fullhashes of dependent pairs
+    uint32_t* dependent_fullhash, //array of fullhashes of dependent pairs
     enum cachetable_dirty* dependent_dirty, // array stating dirty/cleanness of dependent pairs
     CACHEKEY* key,
-    u_int32_t* fullhash
+    uint32_t* fullhash
     );
 
 
@@ -230,7 +230,7 @@ int toku_cachetable_put_with_dep_pairs(
 // value pairs may be evicted from the cachetable when the cachetable gets too big.
 // Returns: 0 if the memory object is placed into the cachetable, otherwise an
 // error number.
-int toku_cachetable_put(CACHEFILE cf, CACHEKEY key, u_int32_t fullhash,
+int toku_cachetable_put(CACHEFILE cf, CACHEKEY key, uint32_t fullhash,
 			void *value, PAIR_ATTR size,
 			CACHETABLE_WRITE_CALLBACK write_callback
                         );
@@ -249,19 +249,19 @@ int toku_cachetable_put(CACHEFILE cf, CACHEKEY key, u_int32_t fullhash,
 int toku_cachetable_get_and_pin_with_dep_pairs (
     CACHEFILE cachefile, 
     CACHEKEY key, 
-    u_int32_t fullhash, 
+    uint32_t fullhash, 
     void**value, 
     long *sizep,
     CACHETABLE_WRITE_CALLBACK write_callback,
     CACHETABLE_FETCH_CALLBACK fetch_callback, 
     CACHETABLE_PARTIAL_FETCH_REQUIRED_CALLBACK pf_req_callback,
     CACHETABLE_PARTIAL_FETCH_CALLBACK pf_callback,
-    BOOL may_modify_value,
+    bool may_modify_value,
     void* read_extraargs, // parameter for fetch_callback, pf_req_callback, and pf_callback
-    u_int32_t num_dependent_pairs, // number of dependent pairs that we may need to checkpoint
+    uint32_t num_dependent_pairs, // number of dependent pairs that we may need to checkpoint
     CACHEFILE* dependent_cfs, // array of cachefiles of dependent pairs
     CACHEKEY* dependent_keys, // array of cachekeys of dependent pairs
-    u_int32_t* dependent_fullhash, //array of fullhashes of dependent pairs
+    uint32_t* dependent_fullhash, //array of fullhashes of dependent pairs
     enum cachetable_dirty* dependent_dirty // array stating dirty/cleanness of dependent pairs
     );
 
@@ -274,14 +274,14 @@ int toku_cachetable_get_and_pin_with_dep_pairs (
 int toku_cachetable_get_and_pin (
     CACHEFILE cachefile, 
     CACHEKEY key, 
-    u_int32_t fullhash, 
+    uint32_t fullhash, 
     void**value, 
     long *sizep,
     CACHETABLE_WRITE_CALLBACK write_callback,
     CACHETABLE_FETCH_CALLBACK fetch_callback, 
     CACHETABLE_PARTIAL_FETCH_REQUIRED_CALLBACK pf_req_callback,
     CACHETABLE_PARTIAL_FETCH_CALLBACK pf_callback,
-    BOOL may_modify_value,
+    bool may_modify_value,
     void* read_extraargs // parameter for fetch_callback, pf_req_callback, and pf_callback
     );
 
@@ -292,11 +292,11 @@ void toku_cachetable_pf_pinned_pair(
     void* read_extraargs,
     CACHEFILE cf,
     CACHEKEY key,
-    u_int32_t fullhash
+    uint32_t fullhash
     ); 
 
 struct unlockers {
-    BOOL       locked;
+    bool       locked;
     void (*f)(void*extra);
     void      *extra;
     UNLOCKERS  next;
@@ -308,38 +308,38 @@ struct unlockers {
 int toku_cachetable_get_and_pin_nonblocking (
     CACHEFILE cf, 
     CACHEKEY key, 
-    u_int32_t fullhash, 
+    uint32_t fullhash, 
     void**value, 
     long *sizep,
     CACHETABLE_WRITE_CALLBACK write_callback,
     CACHETABLE_FETCH_CALLBACK fetch_callback, 
     CACHETABLE_PARTIAL_FETCH_REQUIRED_CALLBACK pf_req_callback  __attribute__((unused)),
     CACHETABLE_PARTIAL_FETCH_CALLBACK pf_callback  __attribute__((unused)),
-    BOOL may_modify_value,
+    bool may_modify_value,
     void *read_extraargs, // parameter for fetch_callback, pf_req_callback, and pf_callback
     UNLOCKERS unlockers
     );
 
 #define CAN_RELEASE_LOCK_DURING_IO
 
-int toku_cachetable_maybe_get_and_pin (CACHEFILE, CACHEKEY, u_int32_t /*fullhash*/, void**);
+int toku_cachetable_maybe_get_and_pin (CACHEFILE, CACHEKEY, uint32_t /*fullhash*/, void**);
 // Effect: Maybe get and pin a memory object.
 //  This function is similar to the get_and_pin function except that it
 //  will not attempt to fetch a memory object that is not in the cachetable or requires any kind of blocking to get it.  
 // Returns: If the the item is already in memory, then return 0 and store it in the
 // void**.  If the item is not in memory, then return a nonzero error number.
 
-int toku_cachetable_maybe_get_and_pin_clean (CACHEFILE, CACHEKEY, u_int32_t /*fullhash*/, void**);
+int toku_cachetable_maybe_get_and_pin_clean (CACHEFILE, CACHEKEY, uint32_t /*fullhash*/, void**);
 // Effect: Like maybe get and pin, but may pin a clean pair.
 
-int toku_cachetable_unpin(CACHEFILE, CACHEKEY, u_int32_t fullhash, enum cachetable_dirty dirty, PAIR_ATTR size);
+int toku_cachetable_unpin(CACHEFILE, CACHEKEY, uint32_t fullhash, enum cachetable_dirty dirty, PAIR_ATTR size);
 // Effect: Unpin a memory object
 // Modifies: If the memory object is in the cachetable, then OR the dirty flag,
 // update the size, and release the read lock on the memory object.
 // Returns: 0 if success, otherwise returns an error number.
 // Requires: The ct is locked.
 
-int toku_cachetable_unpin_ct_prelocked_no_flush(CACHEFILE, CACHEKEY, u_int32_t fullhash, enum cachetable_dirty dirty, PAIR_ATTR size);
+int toku_cachetable_unpin_ct_prelocked_no_flush(CACHEFILE, CACHEKEY, uint32_t fullhash, enum cachetable_dirty dirty, PAIR_ATTR size);
 // Effect: The same as tokud_cachetable_unpin, except that the ct must not be locked.
 // Requires: The ct is NOT locked.
 
@@ -347,13 +347,13 @@ int toku_cachetable_unpin_and_remove (CACHEFILE, CACHEKEY, CACHETABLE_REMOVE_KEY
 // Effect: Remove an object from the cachetable.  Don't write it back.
 // Requires: The object must be pinned exactly once.
 
-int toku_cachefile_prefetch(CACHEFILE cf, CACHEKEY key, u_int32_t fullhash,
+int toku_cachefile_prefetch(CACHEFILE cf, CACHEKEY key, uint32_t fullhash,
                             CACHETABLE_WRITE_CALLBACK write_callback,
                             CACHETABLE_FETCH_CALLBACK fetch_callback,
                             CACHETABLE_PARTIAL_FETCH_REQUIRED_CALLBACK pf_req_callback,
                             CACHETABLE_PARTIAL_FETCH_CALLBACK pf_callback,
                             void *read_extraargs, // parameter for fetch_callback, pf_req_callback, and pf_callback 
-                            BOOL *doing_prefetch);
+                            bool *doing_prefetch);
 // Effect: Prefetch a memory object for a given key into the cachetable
 // Precondition: The cachetable mutex is NOT held.
 // Postcondition: The cachetable mutex is NOT held.
@@ -387,9 +387,9 @@ int toku_cachetable_rename (CACHEFILE cachefile, CACHEKEY oldkey, CACHEKEY newke
 // the cachetable.  The flush callback is called for each of these objects.  The
 // close function does not return until all of the objects are evicted.  The cachefile
 // object is freed.
-// If oplsn_valid is TRUE then use oplsn as the LSN of the close instead of asking the logger.  oplsn_valid being TRUE is only allowed during recovery, and requires that you are removing the last reference (otherwise the lsn wouldn't make it in.)
+// If oplsn_valid is true then use oplsn as the LSN of the close instead of asking the logger.  oplsn_valid being true is only allowed during recovery, and requires that you are removing the last reference (otherwise the lsn wouldn't make it in.)
 // Returns: 0 if success, otherwise returns an error number.
-int toku_cachefile_close (CACHEFILE*, char **error_string, BOOL oplsn_valid, LSN oplsn);
+int toku_cachefile_close (CACHEFILE*, char **error_string, bool oplsn_valid, LSN oplsn);
 
 // Flush the cachefile.
 // Effect: Flush everything owned by the cachefile from the cachetable. All dirty
@@ -429,9 +429,9 @@ TOKULOGGER toku_cachefile_logger (CACHEFILE);
 FILENUM toku_cachefile_filenum (CACHEFILE);
 
 // Effect: Return a 32-bit hash key.  The hash key shall be suitable for using with bitmasking for a table of size power-of-two.
-u_int32_t toku_cachetable_hash (CACHEFILE cachefile, CACHEKEY key);
+uint32_t toku_cachetable_hash (CACHEFILE cachefile, CACHEKEY key);
 
-u_int32_t toku_cachefile_fullhash_of_header (CACHEFILE cachefile);
+uint32_t toku_cachefile_fullhash_of_header (CACHEFILE cachefile);
 
 // debug functions
 
@@ -462,7 +462,7 @@ void toku_cachetable_print_hash_histogram (void) __attribute__((__visibility__("
 void toku_cachetable_maybe_flush_some(CACHETABLE ct);
 
 // for stat64
-u_int64_t toku_cachefile_size(CACHEFILE cf);
+uint64_t toku_cachefile_size(CACHEFILE cf);
 
 typedef enum {
     CT_MISS = 0,
@@ -484,7 +484,7 @@ typedef enum {
 } ct_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[CT_STATUS_NUM_ROWS];
 } CACHETABLE_STATUS_S, *CACHETABLE_STATUS;
 
diff --git a/ft/checkpoint.cc b/ft/checkpoint.cc
index f68a4ffad20206ba1d7d709fc9d17e5b781295ed..a92d57202a8bb29b65a8b112fc25c918939b41bc 100644
--- a/ft/checkpoint.cc
+++ b/ft/checkpoint.cc
@@ -110,9 +110,9 @@ static LSN last_completed_checkpoint_lsn;
 static toku_pthread_rwlock_t checkpoint_safe_lock;
 static toku_pthread_rwlock_t multi_operation_lock;
 
-static BOOL initialized = FALSE;     // sanity check
-static volatile BOOL locked_mo = FALSE;       // true when the multi_operation write lock is held (by checkpoint)
-static volatile BOOL locked_cs = FALSE;       // true when the checkpoint_safe write lock is held (by checkpoint)
+static bool initialized = false;     // sanity check
+static volatile bool locked_mo = false;       // true when the multi_operation write lock is held (by checkpoint)
+static volatile bool locked_cs = false;       // true when the checkpoint_safe write lock is held (by checkpoint)
 
 
 // Note following static functions are called from checkpoint internal logic only,
@@ -131,7 +131,7 @@ multi_operation_lock_init(void) {
 #endif
     toku_pthread_rwlock_init(&multi_operation_lock, &attr); 
     pthread_rwlockattr_destroy(&attr);
-    locked_mo = FALSE;
+    locked_mo = false;
 }
 
 static void
@@ -142,19 +142,19 @@ multi_operation_lock_destroy(void) {
 static void 
 multi_operation_checkpoint_lock(void) {
     toku_pthread_rwlock_wrlock(&multi_operation_lock);   
-    locked_mo = TRUE;
+    locked_mo = true;
 }
 
 static void 
 multi_operation_checkpoint_unlock(void) {
-    locked_mo = FALSE;
+    locked_mo = false;
     toku_pthread_rwlock_wrunlock(&multi_operation_lock); 
 }
 
 static void
 checkpoint_safe_lock_init(void) {
     toku_pthread_rwlock_init(&checkpoint_safe_lock, NULL); 
-    locked_cs = FALSE;
+    locked_cs = false;
 }
 
 static void
@@ -165,12 +165,12 @@ checkpoint_safe_lock_destroy(void) {
 static void 
 checkpoint_safe_checkpoint_lock(void) {
     toku_pthread_rwlock_wrlock(&checkpoint_safe_lock);   
-    locked_cs = TRUE;
+    locked_cs = true;
 }
 
 static void 
 checkpoint_safe_checkpoint_unlock(void) {
-    locked_cs = FALSE;
+    locked_cs = false;
     toku_pthread_rwlock_wrunlock(&checkpoint_safe_lock); 
 }
 
@@ -211,14 +211,14 @@ void
 toku_checkpoint_init(void) {
     multi_operation_lock_init();
     checkpoint_safe_lock_init();
-    initialized = TRUE;
+    initialized = true;
 }
 
 void
 toku_checkpoint_destroy(void) {
     multi_operation_lock_destroy();
     checkpoint_safe_lock_destroy();
-    initialized = FALSE;
+    initialized = false;
 }
 
 #define SET_CHECKPOINT_FOOTPRINT(x) STATUS_VALUE(CP_FOOTPRINT) = footprint_offset + x
diff --git a/ft/checkpoint.h b/ft/checkpoint.h
index eb083bbf8cce72cc98cfc05c4235fb7573f7519f..0b4766949451a27558745fecb70b651eb443ce02 100644
--- a/ft/checkpoint.h
+++ b/ft/checkpoint.h
@@ -8,12 +8,12 @@
 #ident "$Id$"
 
 
-int toku_set_checkpoint_period(CACHETABLE ct, u_int32_t new_period);
+int toku_set_checkpoint_period(CACHETABLE ct, uint32_t new_period);
 //Effect: Change [end checkpoint (n) - begin checkpoint (n+1)] delay to
 //        new_period seconds.  0 means disable.
 
-u_int32_t toku_get_checkpoint_period(CACHETABLE ct);
-u_int32_t toku_get_checkpoint_period_unlocked(CACHETABLE ct);
+uint32_t toku_get_checkpoint_period(CACHETABLE ct);
+uint32_t toku_get_checkpoint_period_unlocked(CACHETABLE ct);
 
 
 /******
@@ -109,7 +109,7 @@ typedef enum {
 } cp_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[CP_STATUS_NUM_ROWS];
 } CHECKPOINT_STATUS_S, *CHECKPOINT_STATUS;
 
diff --git a/ft/compression-ratio/cratio.cc b/ft/compression-ratio/cratio.cc
index 8dcc5c63eec65e1de3acfaa4c1418cb875b5804d..df3e84be023131d0548b6491b8a02be2d1f82c31 100644
--- a/ft/compression-ratio/cratio.cc
+++ b/ft/compression-ratio/cratio.cc
@@ -38,7 +38,7 @@ measure_header (int fd, toku_off_t off, // read header from this offset
     r=pread(fd, fbuf, 12, off);
     assert(r==12);
     assert(memcmp(fbuf,"tokudata",8)==0);
-    int bsize = toku_dtoh32(*(u_int32_t*)(fbuf+8));
+    int bsize = toku_dtoh32(*(uint32_t*)(fbuf+8));
     //printf("Bsize=%d\n", bsize);
     (*usize)+=bsize;
     assert(bsize<=NSIZE);
@@ -64,8 +64,8 @@ measure_node (int fd, toku_off_t off, // read header from this offset
     assert(r==24);
     //printf("fbuf[0..7]=%c%c%c%c%c%c%c%c\n", fbuf[0], fbuf[1], fbuf[2], fbuf[3], fbuf[4], fbuf[5], fbuf[6], fbuf[7]);
     assert(memcmp(fbuf,"tokuleaf",8)==0 || memcmp(fbuf, "tokunode", 8)==0);
-    assert(8==toku_dtoh32(*(u_int32_t*)(fbuf+8))); // check file version
-    int bsize = toku_dtoh32(*(u_int32_t*)(fbuf+20));
+    assert(8==toku_dtoh32(*(uint32_t*)(fbuf+8))); // check file version
+    int bsize = toku_dtoh32(*(uint32_t*)(fbuf+20));
     //printf("Bsize=%d\n", bsize);
     (*usize)+=bsize;
 
diff --git a/ft/dbufio.cc b/ft/dbufio.cc
index d7f5410de8f88a3aede4feed3d7b223738511cf5..eac99d7ddf05b975a02fac9e30729aa161abda68 100644
--- a/ft/dbufio.cc
+++ b/ft/dbufio.cc
@@ -22,14 +22,14 @@ struct dbufio_file {
 
     // need the mutex to modify these
     struct dbufio_file *next;
-    BOOL   second_buf_ready; // if true, the i/o thread is not touching anything.
+    bool   second_buf_ready; // if true, the i/o thread is not touching anything.
 
     // consumers own [0], i/o thread owns [1], they are swapped by the consumer only when the condition mutex is held and second_buf_ready is true.
     char *buf[2];
     size_t n_in_buf[2];
     int    error_code[2]; // includes errno or eof. [0] is the error code associated with buf[0], [1] is the code for buf[1]
 
-    BOOL io_done;
+    bool io_done;
 };
 
 
@@ -48,7 +48,7 @@ struct dbufio_fileset {
     struct dbufio_file *head, *tail; // must have the mutex to fiddle with these.
     size_t bufsize; // the bufsize is the constant (the same for all buffers).
 
-    BOOL panic;
+    bool panic;
     int  panic_errno;
     toku_pthread_t iothread;
 };
@@ -68,11 +68,11 @@ static void panic (DBUFIO_FILESET bfs, int r) {
     if (bfs->panic) return;
     // may need a cilk fake mutex here to convince the race detector that it's OK.
     bfs->panic_errno = r; // Don't really care about a race on this variable...  Writes to it are atomic, so at least one good panic reason will be stored.
-    bfs->panic = TRUE;
+    bfs->panic = true;
     return;
 }
 
-static BOOL paniced (DBUFIO_FILESET bfs) {
+static bool paniced (DBUFIO_FILESET bfs) {
     // may need a cilk fake mutex here to convince the race detector that it's OK.
     return bfs->panic;
 }
@@ -110,7 +110,7 @@ static void* io_thread (void *v)
 	} else {
 	    // Some I/O needs to be done.
 	    //printf("%s:%d Need I/O\n", __FILE__, __LINE__);
-	    assert(dbf->second_buf_ready == FALSE);
+	    assert(dbf->second_buf_ready == false);
 	    assert(!dbf->io_done);
 	    bfs->head = dbf->next;
 	    if (bfs->head==NULL) bfs->tail=NULL;
@@ -132,7 +132,7 @@ static void* io_thread (void *v)
 		    // End of file.  Save it.
 		    dbf->error_code[1] = EOF;
 		    dbf->n_in_buf[1] = 0;
-		    dbf->io_done = TRUE;
+		    dbf->io_done = true;
 		    
 		} else {
 		    dbf->error_code[1] = 0;
@@ -152,7 +152,7 @@ static void* io_thread (void *v)
 		    bfs->n_not_done--;
 		}
 		//printf("%s:%d n_not_done=%d\n", __FILE__, __LINE__, bfs->n_not_done);
-		dbf->second_buf_ready = TRUE;
+		dbf->second_buf_ready = true;
                 toku_cond_broadcast(&bfs->cond);
 		//printf("%s:%d did broadcast=%d\n", __FILE__, __LINE__, bfs->n_not_done);
 		// Still have the lock so go around the loop
@@ -166,7 +166,7 @@ int create_dbufio_fileset (DBUFIO_FILESET *bfsp, int N, int fds[/*N*/], size_t b
     int result = 0;
     DBUFIO_FILESET MALLOC(bfs);
     if (bfs==0) { result = get_error_errno(); }
-    BOOL mutex_inited = FALSE, cond_inited = FALSE;
+    bool mutex_inited = false, cond_inited = false;
     if (result==0) {
 	MALLOC_N(N, bfs->files);
 	if (bfs->files==NULL) { result = get_error_errno(); }
@@ -179,11 +179,11 @@ int create_dbufio_fileset (DBUFIO_FILESET *bfsp, int N, int fds[/*N*/], size_t b
     //printf("%s:%d here\n", __FILE__, __LINE__);
     if (result==0) {
 	toku_mutex_init(&bfs->mutex, NULL);
-	mutex_inited = TRUE;
+	mutex_inited = true;
     }
     if (result==0) {
 	toku_cond_init(&bfs->cond, NULL);
-	cond_inited = TRUE;
+	cond_inited = true;
     }
     if (result==0) {
 	bfs->N = N;
@@ -194,7 +194,7 @@ int create_dbufio_fileset (DBUFIO_FILESET *bfsp, int N, int fds[/*N*/], size_t b
 	    bfs->files[i].offset_in_buf = 0;
 	    bfs->files[i].offset_in_file = 0;
 	    bfs->files[i].next = NULL;
-	    bfs->files[i].second_buf_ready = FALSE;
+	    bfs->files[i].second_buf_ready = false;
 	    for (int j=0; j<2; j++) {
 		if (result==0) {
 		    MALLOC_N(bufsize, bfs->files[i].buf[j]);
@@ -203,7 +203,7 @@ int create_dbufio_fileset (DBUFIO_FILESET *bfsp, int N, int fds[/*N*/], size_t b
 		bfs->files[i].n_in_buf[j] = 0;
 		bfs->files[i].error_code[j] = 0;
 	    }
-	    bfs->files[i].io_done = FALSE;
+	    bfs->files[i].io_done = false;
 	    {
 		ssize_t r = toku_os_read(bfs->files[i].fd, bfs->files[i].buf[0], bufsize);
 		if (r<0) {
@@ -211,7 +211,7 @@ int create_dbufio_fileset (DBUFIO_FILESET *bfsp, int N, int fds[/*N*/], size_t b
 		    break;
 		} else if (r==0) {
 		    // it's EOF
-		    bfs->files[i].io_done = TRUE;
+		    bfs->files[i].io_done = true;
 		    bfs->n_not_done--;
 		    bfs->files[i].error_code[0] = EOF;
 		} else {
@@ -222,7 +222,7 @@ int create_dbufio_fileset (DBUFIO_FILESET *bfsp, int N, int fds[/*N*/], size_t b
 	    }
 	}
 	bfs->bufsize = bufsize;
-	bfs->panic = FALSE;
+	bfs->panic = false;
 	bfs->panic_errno = 0;
     }
     //printf("Creating IO thread\n");
@@ -331,7 +331,7 @@ int dbufio_fileset_read (DBUFIO_FILESET bfs, int filenum, void *buf_v, size_t co
 		    dbf->buf[1]      = tmp;
 		}
 		dbf->error_code[0] = dbf->error_code[1];
-		dbf->second_buf_ready = FALSE;
+		dbf->second_buf_ready = false;
 		dbf->offset_in_buf = 0;
 		if (!dbf->io_done) {
 		    // Don't enqueue it if the I/O is all done.
diff --git a/ft/fifo.cc b/ft/fifo.cc
index ee2c4a03043622dff345ff0e394ba0bf84f83644..dcf0a44567bc09b462f201e6d5391ddad1bdd025 100644
--- a/ft/fifo.cc
+++ b/ft/fifo.cc
@@ -153,7 +153,7 @@ void toku_fifo_clone(FIFO orig_fifo, FIFO* cloned_fifo) {
     *cloned_fifo = new_fifo;
 }
 
-BOOL toku_are_fifos_same(FIFO fifo1, FIFO fifo2) {
+bool toku_are_fifos_same(FIFO fifo1, FIFO fifo2) {
     return (
         fifo1->memory_used == fifo2->memory_used &&
         memcmp(fifo1->memory, fifo2->memory, fifo1->memory_used) == 0
diff --git a/ft/fifo.h b/ft/fifo.h
index 17a8230079fe58f0636016fb3428c798321d7233..633630247d64008426905ea88d4cab1133d95fdf 100644
--- a/ft/fifo.h
+++ b/ft/fifo.h
@@ -63,7 +63,7 @@ unsigned long toku_fifo_memory_size_in_use(FIFO fifo);  // return how much memor
 unsigned long toku_fifo_memory_footprint(FIFO fifo);  // return how much memory the fifo occupies
 
 //These two are problematic, since I don't want to malloc() the bytevecs, but dequeueing the fifo frees the memory.
-//int toku_fifo_peek_deq (FIFO, bytevec *key, ITEMLEN *keylen, bytevec *data, ITEMLEN *datalen, u_int32_t *type, TXNID *xid);
+//int toku_fifo_peek_deq (FIFO, bytevec *key, ITEMLEN *keylen, bytevec *data, ITEMLEN *datalen, uint32_t *type, TXNID *xid);
 //int toku_fifo_peek_deq_cmdstruct (FIFO, FT_MSG, DBT*, DBT*); // fill in the FT_MSG, using the two DBTs for the DBT part.
 void toku_fifo_iterate(FIFO, void(*f)(bytevec key,ITEMLEN keylen,bytevec data,ITEMLEN datalen, enum ft_msg_type type, MSN msn, XIDS xids, bool is_fresh, void*), void*);
 
@@ -78,7 +78,7 @@ void toku_fifo_iterate(FIFO, void(*f)(bytevec key,ITEMLEN keylen,bytevec data,IT
       MSN     msnvar  = e->msn;                                                       \
       XIDS    xidsvar = &e->xids_s;                                                   \
       bytevec keyvar  = xids_get_end_of_array(xidsvar);                               \
-      bytevec datavar = (const u_int8_t*)keyvar + e->keylen;                          \
+      bytevec datavar = (const uint8_t*)keyvar + e->keylen;                          \
       bool is_freshvar = e->is_fresh;                                                 \
       body;	\
   } })
@@ -94,7 +94,7 @@ const struct fifo_entry *toku_fifo_get_entry(FIFO fifo, long off);
 
 void toku_fifo_clone(FIFO orig_fifo, FIFO* cloned_fifo);
 
-BOOL toku_are_fifos_same(FIFO fifo1, FIFO fifo2);
+bool toku_are_fifos_same(FIFO fifo1, FIFO fifo2);
 
 
 
diff --git a/ft/ft-cachetable-wrappers.cc b/ft/ft-cachetable-wrappers.cc
index c59faf899085e5ad66bd3cd95497fc1e7d05a4e3..0ed926c8c92b43d2cdebd58410a030d130b8623f 100644
--- a/ft/ft-cachetable-wrappers.cc
+++ b/ft/ft-cachetable-wrappers.cc
@@ -13,7 +13,7 @@
 static void
 ftnode_get_key_and_fullhash(
     BLOCKNUM* cachekey,
-    u_int32_t* fullhash,
+    uint32_t* fullhash,
     void* extra)
 {
     FT h = (FT) extra;
@@ -26,18 +26,18 @@ ftnode_get_key_and_fullhash(
 void
 cachetable_put_empty_node_with_dep_nodes(
     FT h,
-    u_int32_t num_dependent_nodes,
+    uint32_t num_dependent_nodes,
     FTNODE* dependent_nodes,
     BLOCKNUM* name, //output
-    u_int32_t* fullhash, //output
+    uint32_t* fullhash, //output
     FTNODE* result)
 {
     FTNODE XMALLOC(new_node);
     CACHEFILE dependent_cf[num_dependent_nodes];
     BLOCKNUM dependent_keys[num_dependent_nodes];
-    u_int32_t dependent_fullhash[num_dependent_nodes];
+    uint32_t dependent_fullhash[num_dependent_nodes];
     enum cachetable_dirty dependent_dirty_bits[num_dependent_nodes];
-    for (u_int32_t i = 0; i < num_dependent_nodes; i++) {
+    for (uint32_t i = 0; i < num_dependent_nodes; i++) {
         dependent_cf[i] = h->cf;
         dependent_keys[i] = dependent_nodes[i]->thisnodename;
         dependent_fullhash[i] = toku_cachetable_hash(h->cf, dependent_nodes[i]->thisnodename);
@@ -69,10 +69,10 @@ create_new_ftnode_with_dep_nodes(
     FTNODE *result,
     int height,
     int n_children,
-    u_int32_t num_dependent_nodes,
+    uint32_t num_dependent_nodes,
     FTNODE* dependent_nodes)
 {
-    u_int32_t fullhash = 0;
+    uint32_t fullhash = 0;
     BLOCKNUM name;
 
     cachetable_put_empty_node_with_dep_nodes(
@@ -122,18 +122,18 @@ int
 toku_pin_ftnode(
     FT_HANDLE brt,
     BLOCKNUM blocknum,
-    u_int32_t fullhash,
+    uint32_t fullhash,
     UNLOCKERS unlockers,
     ANCESTORS ancestors,
     const PIVOT_BOUNDS bounds,
     FTNODE_FETCH_EXTRA bfe,
-    BOOL may_modify_node,
-    BOOL apply_ancestor_messages, // this BOOL is probably temporary, for #3972, once we know how range query estimates work, will revisit this
+    bool may_modify_node,
+    bool apply_ancestor_messages, // this bool is probably temporary, for #3972, once we know how range query estimates work, will revisit this
     FTNODE *node_p,
-    BOOL* msgs_applied)
+    bool* msgs_applied)
 {
     void *node_v;
-    *msgs_applied = FALSE;
+    *msgs_applied = false;
     int r = toku_cachetable_get_and_pin_nonblocking(
             brt->ft->cf,
             blocknum,
@@ -165,19 +165,19 @@ void
 toku_pin_ftnode_off_client_thread(
     FT h,
     BLOCKNUM blocknum,
-    u_int32_t fullhash,
+    uint32_t fullhash,
     FTNODE_FETCH_EXTRA bfe,
-    BOOL may_modify_node,
-    u_int32_t num_dependent_nodes,
+    bool may_modify_node,
+    uint32_t num_dependent_nodes,
     FTNODE* dependent_nodes,
     FTNODE *node_p)
 {
     void *node_v;
     CACHEFILE dependent_cf[num_dependent_nodes];
     BLOCKNUM dependent_keys[num_dependent_nodes];
-    u_int32_t dependent_fullhash[num_dependent_nodes];
+    uint32_t dependent_fullhash[num_dependent_nodes];
     enum cachetable_dirty dependent_dirty_bits[num_dependent_nodes];
-    for (u_int32_t i = 0; i < num_dependent_nodes; i++) {
+    for (uint32_t i = 0; i < num_dependent_nodes; i++) {
         dependent_cf[i] = h->cf;
         dependent_keys[i] = dependent_nodes[i]->thisnodename;
         dependent_fullhash[i] = toku_cachetable_hash(h->cf, dependent_nodes[i]->thisnodename);
diff --git a/ft/ft-cachetable-wrappers.h b/ft/ft-cachetable-wrappers.h
index 0edda765b3772efe0503fff2b32159352f010126..16761820bbd53e803a3159df30ca134ce9f23758 100644
--- a/ft/ft-cachetable-wrappers.h
+++ b/ft/ft-cachetable-wrappers.h
@@ -18,10 +18,10 @@
 void
 cachetable_put_empty_node_with_dep_nodes(
     FT h,
-    u_int32_t num_dependent_nodes,
+    uint32_t num_dependent_nodes,
     FTNODE* dependent_nodes,
     BLOCKNUM* name, //output
-    u_int32_t* fullhash, //output
+    uint32_t* fullhash, //output
     FTNODE* result
     );
 
@@ -36,7 +36,7 @@ create_new_ftnode_with_dep_nodes(
     FTNODE *result,
     int height,
     int n_children,
-    u_int32_t num_dependent_nodes,
+    uint32_t num_dependent_nodes,
     FTNODE* dependent_nodes
     );
 
@@ -64,15 +64,15 @@ int
 toku_pin_ftnode(
     FT_HANDLE brt,
     BLOCKNUM blocknum,
-    u_int32_t fullhash,
+    uint32_t fullhash,
     UNLOCKERS unlockers,
     ANCESTORS ancestors,
     const PIVOT_BOUNDS pbounds,
     FTNODE_FETCH_EXTRA bfe,
-    BOOL may_modify_node,
-    BOOL apply_ancestor_messages, // this BOOL is probably temporary, for #3972, once we know how range query estimates work, will revisit this
+    bool may_modify_node,
+    bool apply_ancestor_messages, // this bool is probably temporary, for #3972, once we know how range query estimates work, will revisit this
     FTNODE *node_p,
-    BOOL* msgs_applied
+    bool* msgs_applied
     );
 
 /**
@@ -86,10 +86,10 @@ void
 toku_pin_ftnode_off_client_thread(
     FT h,
     BLOCKNUM blocknum,
-    u_int32_t fullhash,
+    uint32_t fullhash,
     FTNODE_FETCH_EXTRA bfe,
-    BOOL may_modify_node,
-    u_int32_t num_dependent_nodes,
+    bool may_modify_node,
+    uint32_t num_dependent_nodes,
     FTNODE* dependent_nodes,
     FTNODE *node_p
     );
diff --git a/ft/ft-flusher.cc b/ft/ft-flusher.cc
index 3fb9fe546629d615e1e2a17fcf189913598ebc17..1b6b14034d97a10864c0627dfdc85c7df1a8e26a 100644
--- a/ft/ft-flusher.cc
+++ b/ft/ft-flusher.cc
@@ -171,7 +171,7 @@ ft_merge_child(
     FT h,
     FTNODE node,
     int childnum_to_merge,
-    BOOL *did_react,
+    bool *did_react,
     struct flusher_advice *fa);
 
 static int
@@ -237,7 +237,7 @@ default_merge_child(struct flusher_advice *fa,
     //
     // it is responsibility of ft_merge_child to unlock parent
     //
-    BOOL did_react;
+    bool did_react;
     ft_merge_child(h, parent, childnum, &did_react, fa);
 }
 
@@ -296,7 +296,7 @@ flt_flusher_advice_init(struct flusher_advice *fa, struct flush_status_update_ex
 }
 
 struct ctm_extra {
-    BOOL is_last_child;
+    bool is_last_child;
     DBT target_key;
 };
 
@@ -368,11 +368,11 @@ ct_maybe_merge_child(struct flusher_advice *fa,
         // to be merged
         //
         if (childnum == (parent->n_children - 1)) {
-            ctme.is_last_child = TRUE;
+            ctme.is_last_child = true;
             pivot_to_save = childnum - 1;
         }
         else {
-            ctme.is_last_child = FALSE;
+            ctme.is_last_child = false;
             pivot_to_save = childnum;
         }
         const DBT *pivot = &parent->childkeys[pivot_to_save];
@@ -397,12 +397,12 @@ ct_maybe_merge_child(struct flusher_advice *fa,
         {
             toku_ft_grab_treelock(h);
 
-            u_int32_t fullhash;
+            uint32_t fullhash;
             CACHEKEY root;
             toku_calculate_root_offset_pointer(h, &root, &fullhash);
             struct ftnode_fetch_extra bfe;
             fill_bfe_for_full_read(&bfe, h);
-            toku_pin_ftnode_off_client_thread(h, root, fullhash, &bfe, TRUE, 0, NULL, &root_node);
+            toku_pin_ftnode_off_client_thread(h, root, fullhash, &bfe, true, 0, NULL, &root_node);
             toku_assert_entire_node_in_memory(root_node);
 
             toku_ft_release_treelock(h);
@@ -568,7 +568,7 @@ verify_all_in_mempool(FTNODE node)
     }
 }
 
-static u_int64_t
+static uint64_t
 ftleaf_disk_size(FTNODE node)
 // Effect: get the disk size of a leafentry
 {
@@ -592,7 +592,7 @@ ftleaf_disk_size(FTNODE node)
 static void
 ftleaf_get_split_loc(
     FTNODE node,
-    u_int64_t sumlesizes,
+    uint64_t sumlesizes,
     int* bn_index,   // which basement within leaf
     int* le_index    // which key within basement
     )
@@ -601,7 +601,7 @@ ftleaf_get_split_loc(
 // le_index is index into OMT of the last key that should be on the left side of the split.
 {
     assert(node->height == 0);
-    u_int32_t size_so_far = 0;
+    uint32_t size_so_far = 0;
     for (int i = 0; i < node->n_children; i++) {
         OMT curr_buffer = BLB_BUFFER(node, i);
         uint32_t n_leafentries = toku_omt_size(curr_buffer);
@@ -685,8 +685,8 @@ ftleaf_split(
     FTNODE *nodea,
     FTNODE *nodeb,
     DBT *splitk,
-    BOOL create_new_node,
-    u_int32_t num_dependent_nodes,
+    bool create_new_node,
+    uint32_t num_dependent_nodes,
     FTNODE* dependent_nodes)
 // Effect: Split a leaf node.
 // Argument "node" is node to be split.
@@ -712,7 +712,7 @@ ftleaf_split(
 
 
     FTNODE B;
-    u_int32_t fullhash;
+    uint32_t fullhash;
     BLOCKNUM name;
 
     if (create_new_node) {
@@ -755,7 +755,7 @@ ftleaf_split(
     {
         {
             // TODO: (Zardosht) see if we can/should make this faster, we iterate over the rows twice
-            u_int64_t sumlesizes=0;
+            uint64_t sumlesizes=0;
             sumlesizes = ftleaf_disk_size(node);
             // TODO: (Zardosht) #3537, figure out serial insertion optimization again later
             // split in half
@@ -815,7 +815,7 @@ ftleaf_split(
         // handle the move of a subset of data in last_bn_on_left from node to B
         if (!split_on_boundary) {
             BP_STATE(B,curr_dest_bn_index) = PT_AVAIL;
-            u_int32_t diff_size = 0;
+            uint32_t diff_size = 0;
             destroy_basement_node (BLB(B, curr_dest_bn_index)); // Destroy B's empty OMT, so I can rebuild it from an array
             set_BNULL(B, curr_dest_bn_index);
             set_BLB(B, curr_dest_bn_index, toku_create_empty_bn_no_buffer());
@@ -896,7 +896,7 @@ ft_nonleaf_split(
     FTNODE *nodea,
     FTNODE *nodeb,
     DBT *splitk,
-    u_int32_t num_dependent_nodes,
+    uint32_t num_dependent_nodes,
     FTNODE* dependent_nodes)
 {
     //VERIFY_NODE(t,node);
@@ -993,7 +993,7 @@ ft_split_child(
     dep_nodes[0] = node;
     dep_nodes[1] = child;
     if (child->height==0) {
-        ftleaf_split(h, child, &nodea, &nodeb, &splitk, TRUE, 2, dep_nodes);
+        ftleaf_split(h, child, &nodea, &nodeb, &splitk, true, 2, dep_nodes);
     } else {
         ft_nonleaf_split(h, child, &nodea, &nodeb, &splitk, 2, dep_nodes);
     }
@@ -1080,7 +1080,7 @@ merge_leaf_nodes(FTNODE a, FTNODE b)
     b->dirty = 1;
 
     OMT a_last_buffer = BLB_BUFFER(a, a->n_children-1);
-    // this BOOL states if the last basement node in a has any items or not
+    // this bool states if the last basement node in a has any items or not
     // If it does, then it stays in the merge. If it does not, the last basement node
     // of a gets eliminated because we do not have a pivot to store for it (because it has no elements)
     const bool a_has_tail = toku_omt_size(a_last_buffer) > 0;
@@ -1119,7 +1119,7 @@ merge_leaf_nodes(FTNODE a, FTNODE b)
         a->totalchildkeylens += keylen;
     }
 
-    u_int32_t offset = a_has_tail ? a->n_children : a->n_children - 1;
+    uint32_t offset = a_has_tail ? a->n_children : a->n_children - 1;
     for (int i = 0; i < b->n_children; i++) {
         a->bp[i+offset] = b->bp[i];
         memset(&b->bp[i],0,sizeof(b->bp[0]));
@@ -1151,7 +1151,7 @@ balance_leaf_nodes(
     merge_leaf_nodes(a,b);
     // now split them
     // because we are not creating a new node, we can pass in no dependent nodes
-    ftleaf_split(NULL, a, &a, &b, splitk, FALSE, 0, NULL);
+    ftleaf_split(NULL, a, &a, &b, splitk, false, 0, NULL);
 
     return 0;
 }
@@ -1161,34 +1161,34 @@ maybe_merge_pinned_leaf_nodes(
     FTNODE a,
     FTNODE b,
     DBT *parent_splitk,
-    BOOL *did_merge,
-    BOOL *did_rebalance,
+    bool *did_merge,
+    bool *did_rebalance,
     DBT *splitk)
-// Effect: Either merge a and b into one one node (merge them into a) and set *did_merge = TRUE.
+// Effect: Either merge a and b into one one node (merge them into a) and set *did_merge = true.
 //	   (We do this if the resulting node is not fissible)
-//	   or distribute the leafentries evenly between a and b, and set *did_rebalance = TRUE.
+//	   or distribute the leafentries evenly between a and b, and set *did_rebalance = true.
 //	   (If a and be are already evenly distributed, we may do nothing.)
 {
     unsigned int sizea = toku_serialize_ftnode_size(a);
     unsigned int sizeb = toku_serialize_ftnode_size(b);
     if ((sizea + sizeb)*4 > (a->nodesize*3)) {
         // the combined size is more than 3/4 of a node, so don't merge them.
-        *did_merge = FALSE;
+        *did_merge = false;
         if (sizea*4 > a->nodesize && sizeb*4 > a->nodesize) {
             // no need to do anything if both are more than 1/4 of a node.
-            *did_rebalance = FALSE;
+            *did_rebalance = false;
             toku_clone_dbt(splitk, *parent_splitk);
             return;
         }
         // one is less than 1/4 of a node, and together they are more than 3/4 of a node.
         toku_free(parent_splitk->data); // We don't need the parent_splitk any more. If we need a splitk (if we don't merge) we'll malloc a new one.
-        *did_rebalance = TRUE;
+        *did_rebalance = true;
         int r = balance_leaf_nodes(a, b, splitk);
         assert(r==0);
     } else {
         // we are merging them.
-        *did_merge = TRUE;
-        *did_rebalance = FALSE;
+        *did_merge = true;
+        *did_rebalance = false;
         toku_init_dbt(splitk);
         toku_free(parent_splitk->data); // if we are merging, the splitk gets freed.
         merge_leaf_nodes(a, b);
@@ -1200,8 +1200,8 @@ maybe_merge_pinned_nonleaf_nodes(
     const DBT *parent_splitk,
     FTNODE a,
     FTNODE b,
-    BOOL *did_merge,
-    BOOL *did_rebalance,
+    bool *did_merge,
+    bool *did_rebalance,
     DBT *splitk)
 {
     toku_assert_entire_node_in_memory(a);
@@ -1229,8 +1229,8 @@ maybe_merge_pinned_nonleaf_nodes(
     a->dirty = 1;
     b->dirty = 1;
 
-    *did_merge = TRUE;
-    *did_rebalance = FALSE;
+    *did_merge = true;
+    *did_rebalance = false;
     toku_init_dbt(splitk);
 
     STATUS_VALUE(FT_FLUSHER_MERGE_NONLEAF)++;
@@ -1242,12 +1242,12 @@ maybe_merge_pinned_nodes(
     DBT *parent_splitk,
     FTNODE a,
     FTNODE b,
-    BOOL *did_merge,
-    BOOL *did_rebalance,
+    bool *did_merge,
+    bool *did_rebalance,
     DBT *splitk)
-// Effect: either merge a and b into one node (merge them into a) and set *did_merge = TRUE.
+// Effect: either merge a and b into one node (merge them into a) and set *did_merge = true.
 //	   (We do this if the resulting node is not fissible)
-//	   or distribute a and b evenly and set *did_merge = FALSE and *did_rebalance = TRUE
+//	   or distribute a and b evenly and set *did_merge = false and *did_rebalance = true
 //	   (If a and be are already evenly distributed, we may do nothing.)
 //  If we distribute:
 //    For leaf nodes, we distribute the leafentries evenly.
@@ -1293,7 +1293,7 @@ maybe_merge_pinned_nodes(
 
 static void merge_remove_key_callback(
     BLOCKNUM *bp,
-    BOOL for_checkpoint,
+    bool for_checkpoint,
     void *extra)
 {
     FT h = (FT) extra;
@@ -1309,7 +1309,7 @@ ft_merge_child(
     FT h,
     FTNODE node,
     int childnum_to_merge,
-    BOOL *did_react,
+    bool *did_react,
     struct flusher_advice *fa)
 {
     // this function should not be called
@@ -1337,10 +1337,10 @@ ft_merge_child(
 
     FTNODE childa, childb;
     {
-        u_int32_t childfullhash = compute_child_fullhash(h->cf, node, childnuma);
+        uint32_t childfullhash = compute_child_fullhash(h->cf, node, childnuma);
         struct ftnode_fetch_extra bfe;
         fill_bfe_for_full_read(&bfe, h);
-        toku_pin_ftnode_off_client_thread(h, BP_BLOCKNUM(node, childnuma), childfullhash, &bfe, TRUE, 1, &node, &childa);
+        toku_pin_ftnode_off_client_thread(h, BP_BLOCKNUM(node, childnuma), childfullhash, &bfe, true, 1, &node, &childa);
     }
     // for test
     call_flusher_thread_callback(flt_flush_before_pin_second_node_for_merge);
@@ -1348,10 +1348,10 @@ ft_merge_child(
         FTNODE dep_nodes[2];
         dep_nodes[0] = node;
         dep_nodes[1] = childa;
-        u_int32_t childfullhash = compute_child_fullhash(h->cf, node, childnumb);
+        uint32_t childfullhash = compute_child_fullhash(h->cf, node, childnumb);
         struct ftnode_fetch_extra bfe;
         fill_bfe_for_full_read(&bfe, h);
-        toku_pin_ftnode_off_client_thread(h, BP_BLOCKNUM(node, childnumb), childfullhash, &bfe, TRUE, 2, dep_nodes, &childb);
+        toku_pin_ftnode_off_client_thread(h, BP_BLOCKNUM(node, childnumb), childfullhash, &bfe, true, 2, dep_nodes, &childb);
     }
 
     if (toku_bnc_n_entries(BNC(node,childnuma))>0) {
@@ -1364,7 +1364,7 @@ ft_merge_child(
     // now we have both children pinned in main memory, and cachetable locked,
     // so no checkpoints will occur.
 
-    BOOL did_merge, did_rebalance;
+    bool did_merge, did_rebalance;
     {
         DBT splitk;
         toku_init_dbt(&splitk);
@@ -1378,7 +1378,7 @@ ft_merge_child(
         }
         //toku_verify_estimates(t,childa);
         // the tree did react if a merge (did_merge) or rebalance (new spkit key) occurred
-        *did_react = (BOOL)(did_merge || did_rebalance);
+        *did_react = (bool)(did_merge || did_rebalance);
         if (did_merge) {
             assert(!splitk.data);
         } else {
@@ -1479,13 +1479,13 @@ flush_some_child(
     int r;
     BLOCKNUM targetchild = BP_BLOCKNUM(parent, childnum);
     toku_verify_blocknum_allocated(h->blocktable, targetchild);
-    u_int32_t childfullhash = compute_child_fullhash(h->cf, parent, childnum);
+    uint32_t childfullhash = compute_child_fullhash(h->cf, parent, childnum);
     FTNODE child;
     struct ftnode_fetch_extra bfe;
     // Note that we don't read the entire node into memory yet.
     // The idea is let's try to do the minimum work before releasing the parent lock
     fill_bfe_for_min_read(&bfe, h);
-    toku_pin_ftnode_off_client_thread(h, targetchild, childfullhash, &bfe, TRUE, 1, &parent, &child);
+    toku_pin_ftnode_off_client_thread(h, targetchild, childfullhash, &bfe, true, 1, &parent, &child);
 
     // for test
     call_flusher_thread_callback(ft_flush_aflter_child_pin);
@@ -1609,7 +1609,7 @@ flush_some_child(
         fa->maybe_merge_child(fa, h, parent, childnum, child, fa->extra);
     }
     else {
-        assert(FALSE);
+        assert(false);
     }
 }
 
@@ -1652,7 +1652,7 @@ int
 toku_ftnode_cleaner_callback(
     void *ftnode_pv,
     BLOCKNUM blocknum,
-    u_int32_t fullhash,
+    uint32_t fullhash,
     void *extraargs)
 {
     FTNODE node = (FTNODE) ftnode_pv;
@@ -1784,7 +1784,7 @@ flush_node_on_background_thread(FT h, FTNODE parent)
     //
     void *node_v;
     FTNODE child;
-    u_int32_t childfullhash = compute_child_fullhash(h->cf, parent, childnum);
+    uint32_t childfullhash = compute_child_fullhash(h->cf, parent, childnum);
     int r = toku_cachetable_maybe_get_and_pin_clean (
         h->cf,
         BP_BLOCKNUM(parent,childnum),
diff --git a/ft/ft-flusher.h b/ft/ft-flusher.h
index 8015821982c4a2dd99e1786a5020f580baf554c8..36370d65a64dce6c089b26288512fe3693284659 100644
--- a/ft/ft-flusher.h
+++ b/ft/ft-flusher.h
@@ -88,8 +88,8 @@ ftleaf_split(
     FTNODE *nodea,
     FTNODE *nodeb,
     DBT *splitk,
-    BOOL create_new_node,
-    u_int32_t num_dependent_nodes,
+    bool create_new_node,
+    uint32_t num_dependent_nodes,
     FTNODE* dependent_nodes
     );
 
@@ -109,7 +109,7 @@ ft_nonleaf_split(
     FTNODE *nodea,
     FTNODE *nodeb,
     DBT *splitk,
-    u_int32_t num_dependent_nodes,
+    uint32_t num_dependent_nodes,
     FTNODE* dependent_nodes
     );
 
diff --git a/ft/ft-hot-flusher.cc b/ft/ft-hot-flusher.cc
index 31817ac821218724d5a24a0ba57ae90018b33be4..701d7a135e48a5e93f5bafe0cd74b1099c95b963 100644
--- a/ft/ft-hot-flusher.cc
+++ b/ft/ft-hot-flusher.cc
@@ -75,7 +75,7 @@ hot_set_highest_key(struct hot_flusher_extra *flusher)
         // Otherwise, let's copy all the contents from one key to the other.
         void *source = flusher->max_current_key.data;
         void *destination = flusher->highest_pivot_key.data;
-        u_int32_t size = flusher->max_current_key.size;
+        uint32_t size = flusher->max_current_key.size;
 
         destination = toku_xrealloc(destination, size);
         memcpy(destination, source, size);
@@ -95,7 +95,7 @@ hot_set_key(DBT *key, FTNODE parent, int childnum)
     DBT *pivot = &parent->childkeys[childnum];
 
     void *data = key->data;
-    u_int32_t size = pivot->size;
+    uint32_t size = pivot->size;
 
     data = toku_xrealloc(data, size);
     memcpy(data, pivot->data, size);
@@ -263,7 +263,7 @@ toku_ft_hot_optimize(FT_HANDLE brt,
     do {
         FTNODE root;
         CACHEKEY root_key;
-        u_int32_t fullhash;
+        uint32_t fullhash;
 
         {
             toku_ft_grab_treelock(brt->ft);
@@ -277,7 +277,7 @@ toku_ft_hot_optimize(FT_HANDLE brt,
                                                (BLOCKNUM) root_key,
                                                fullhash,
                                                &bfe,
-                                               TRUE, 
+                                               true, 
                                                0,
                                                NULL,
                                                &root);
@@ -349,7 +349,7 @@ toku_ft_hot_optimize(FT_HANDLE brt,
 
     // More diagnostics.
     {
-        BOOL success = false;
+        bool success = false;
         if (r == 0) { success = true; }
 
         {
diff --git a/ft/ft-internal.h b/ft/ft-internal.h
index 2cd7b4c35e705c7c0d0380233bb365a809a01aab..e50a7cf91391e62c55b1ede4b8c04450c0c17ccc 100644
--- a/ft/ft-internal.h
+++ b/ft/ft-internal.h
@@ -79,7 +79,7 @@ struct ftnode_fetch_extra {
     // parameters needed to find out which child needs to be decompressed (so it can be read)
     ft_search_t* search;
     DBT *range_lock_left_key, *range_lock_right_key;
-    BOOL left_is_neg_infty, right_is_pos_infty;
+    bool left_is_neg_infty, right_is_pos_infty;
     // states if we should try to aggressively fetch basement nodes 
     // that are not specifically needed for current query, 
     // but may be needed for other cursor operations user is doing
@@ -87,7 +87,7 @@ struct ftnode_fetch_extra {
     // and the user is doing a dictionary wide scan, then
     // even though a query may only want one basement node,
     // we fetch all basement nodes in a leaf node.
-    BOOL disable_prefetching; 
+    bool disable_prefetching; 
     // this value will be set during the fetch_callback call by toku_ftnode_fetch_callback or toku_ftnode_pf_req_callback
     // thi callbacks need to evaluate this anyway, so we cache it here so the search code does not reevaluate it
     int child_to_read;
@@ -189,8 +189,8 @@ struct ftnode_disk_data {
     //  The SIZE is the size of the compressed partition.
     // Rationale:  We cannot store the size from the beginning of the node since we don't know how big the header will be.
     //  However, later when we are doing aligned writes, we won't be able to store the size from the end since we want things to align.
-    u_int32_t start;
-    u_int32_t size;
+    uint32_t start;
+    uint32_t size;
 };
 #define BP_START(node_dd,i) ((node_dd)[i].start)
 #define BP_SIZE(node_dd,i) ((node_dd)[i].size)
@@ -223,7 +223,7 @@ struct   __attribute__((__packed__)) ftnode_partition {
 
     // clock count used to for pe_callback to determine if a node should be evicted or not
     // for now, saturating the count at 1
-    u_int8_t clock_count;
+    uint8_t clock_count;
 
     // How many bytes worth of work was performed by messages in each buffer.
     uint64_t     workdone;
@@ -240,7 +240,7 @@ struct ftnode {
     uint32_t build_id;       // build_id (svn rev number) of software that wrote this node to disk
     int    height; /* height is always >= 0.  0 for leaf, >0 for nonleaf. */
     int    dirty;
-    u_int32_t fullhash;
+    uint32_t fullhash;
     int n_children; //for internal nodes, if n_children==TREE_FANOUT+1 then the tree needs to be rebalanced.
                     // for leaf nodes, represents number of basement nodes
     unsigned int    totalchildkeylens;
@@ -333,7 +333,7 @@ enum {
     FT_PIVOT_FRONT_COMPRESS = 8,
 };
 
-u_int32_t compute_child_fullhash (CACHEFILE cf, FTNODE node, int childnum);
+uint32_t compute_child_fullhash (CACHEFILE cf, FTNODE node, int childnum);
 
 // The brt_header is not managed by the cachetable.  Instead, it hangs off the cachefile as userdata.
 
@@ -492,7 +492,7 @@ struct ft_handle {
     on_redirect_callback redirect_callback;
     void *redirect_callback_extra;
     struct toku_list live_ft_handle_link;
-    BOOL did_set_flags;
+    bool did_set_flags;
 
     struct ft_options options;
 };
@@ -515,22 +515,22 @@ int toku_serialize_ftnode_to_memory (FTNODE node,
                                       FTNODE_DISK_DATA* ndd,
                                       unsigned int basementnodesize,
                                       enum toku_compression_method compression_method,
-                                      BOOL do_rebalancing,
-                                      BOOL in_parallel,
+                                      bool do_rebalancing,
+                                      bool in_parallel,
                               /*out*/ size_t *n_bytes_to_write,
                               /*out*/ char  **bytes_to_write);
-int toku_serialize_ftnode_to(int fd, BLOCKNUM, FTNODE node, FTNODE_DISK_DATA* ndd, BOOL do_rebalancing, FT h, BOOL for_checkpoint);
+int toku_serialize_ftnode_to(int fd, BLOCKNUM, FTNODE node, FTNODE_DISK_DATA* ndd, bool do_rebalancing, FT h, bool for_checkpoint);
 int toku_serialize_rollback_log_to (int fd, BLOCKNUM blocknum, ROLLBACK_LOG_NODE log,
                                     FT h,
-                                    BOOL for_checkpoint);
-int toku_deserialize_rollback_log_from (int fd, BLOCKNUM blocknum, u_int32_t fullhash, ROLLBACK_LOG_NODE *logp, FT h);
+                                    bool for_checkpoint);
+int toku_deserialize_rollback_log_from (int fd, BLOCKNUM blocknum, uint32_t fullhash, ROLLBACK_LOG_NODE *logp, FT h);
 int toku_deserialize_bp_from_disk(FTNODE node, FTNODE_DISK_DATA ndd, int childnum, int fd, struct ftnode_fetch_extra* bfe);
 int toku_deserialize_bp_from_compressed(FTNODE node, int childnum, DESCRIPTOR desc, ft_compare_func cmp);
-int toku_deserialize_ftnode_from (int fd, BLOCKNUM off, u_int32_t /*fullhash*/, FTNODE *ftnode, FTNODE_DISK_DATA* ndd, struct ftnode_fetch_extra* bfe);
+int toku_deserialize_ftnode_from (int fd, BLOCKNUM off, uint32_t /*fullhash*/, FTNODE *ftnode, FTNODE_DISK_DATA* ndd, struct ftnode_fetch_extra* bfe);
 
 // <CER> For verifying old, non-upgraded nodes (versions 13 and 14).
 int
-decompress_from_raw_block_into_rbuf(u_int8_t *raw_block, size_t raw_block_size, struct rbuf *rb, BLOCKNUM blocknum);
+decompress_from_raw_block_into_rbuf(uint8_t *raw_block, size_t raw_block_size, struct rbuf *rb, BLOCKNUM blocknum);
 // 
     
 //////////////// <CER> TODO: Move these function declarations
@@ -538,9 +538,9 @@ int
 deserialize_ft_from_fd_into_rbuf(int fd,
                                  toku_off_t offset_of_header,
                                  struct rbuf *rb,
-                                 u_int64_t *checkpoint_count,
+                                 uint64_t *checkpoint_count,
                                  LSN *checkpoint_lsn,
-                                 u_int32_t * version_p);
+                                 uint32_t * version_p);
 
 int
 deserialize_ft_versioned(int fd, struct rbuf *rb, FT *ft, uint32_t version);
@@ -635,14 +635,14 @@ STAT64INFO_S toku_get_and_clear_basement_stats(FTNODE leafnode);
 
 void toku_evict_bn_from_memory(FTNODE node, int childnum, FT h);
 void toku_ft_status_update_pivot_fetch_reason(struct ftnode_fetch_extra *bfe);
-extern void toku_ftnode_clone_callback(void* value_data, void** cloned_value_data, PAIR_ATTR* new_attr, BOOL for_checkpoint, void* write_extraargs);
-extern void toku_ftnode_flush_callback (CACHEFILE cachefile, int fd, BLOCKNUM nodename, void *ftnode_v, void** UU(disk_data), void *extraargs, PAIR_ATTR size, PAIR_ATTR* new_size, BOOL write_me, BOOL keep_me, BOOL for_checkpoint, BOOL is_clone);
-extern int toku_ftnode_fetch_callback (CACHEFILE cachefile, int fd, BLOCKNUM nodename, u_int32_t fullhash, void **ftnode_pv, void** UU(disk_data), PAIR_ATTR *sizep, int*dirty, void*extraargs);
+extern void toku_ftnode_clone_callback(void* value_data, void** cloned_value_data, PAIR_ATTR* new_attr, bool for_checkpoint, void* write_extraargs);
+extern void toku_ftnode_flush_callback (CACHEFILE cachefile, int fd, BLOCKNUM nodename, void *ftnode_v, void** UU(disk_data), void *extraargs, PAIR_ATTR size, PAIR_ATTR* new_size, bool write_me, bool keep_me, bool for_checkpoint, bool is_clone);
+extern int toku_ftnode_fetch_callback (CACHEFILE cachefile, int fd, BLOCKNUM nodename, uint32_t fullhash, void **ftnode_pv, void** UU(disk_data), PAIR_ATTR *sizep, int*dirty, void*extraargs);
 extern void toku_ftnode_pe_est_callback(void* ftnode_pv, void* disk_data, long* bytes_freed_estimate, enum partial_eviction_cost *cost, void* write_extraargs);
 extern int toku_ftnode_pe_callback (void *ftnode_pv, PAIR_ATTR old_attr, PAIR_ATTR* new_attr, void *extraargs);
-extern BOOL toku_ftnode_pf_req_callback(void* ftnode_pv, void* read_extraargs);
+extern bool toku_ftnode_pf_req_callback(void* ftnode_pv, void* read_extraargs);
 int toku_ftnode_pf_callback(void* ftnode_pv, void* UU(disk_data), void* read_extraargs, int fd, PAIR_ATTR* sizep);
-extern int toku_ftnode_cleaner_callback( void *ftnode_pv, BLOCKNUM blocknum, u_int32_t fullhash, void *extraargs);
+extern int toku_ftnode_cleaner_callback( void *ftnode_pv, BLOCKNUM blocknum, uint32_t fullhash, void *extraargs);
 
 static inline CACHETABLE_WRITE_CALLBACK get_write_callbacks_for_node(FT h) {
     CACHETABLE_WRITE_CALLBACK wc;
@@ -659,7 +659,7 @@ static const FTNODE null_ftnode=0;
 
 // Values to be used to update ftcursor if a search is successful.
 struct ft_cursor_leaf_info_to_be {
-    u_int32_t index;
+    uint32_t index;
     OMT       omt;
 };
 
@@ -672,14 +672,14 @@ struct ft_cursor_leaf_info {
 struct ft_cursor {
     struct toku_list cursors_link;
     FT_HANDLE ft_handle;
-    BOOL prefetching;
+    bool prefetching;
     DBT key, val;             // The key-value pair that the cursor currently points to
     DBT range_lock_left_key, range_lock_right_key;
-    BOOL left_is_neg_infty, right_is_pos_infty;
-    BOOL is_snapshot_read; // true if query is read_committed, false otherwise
-    BOOL is_leaf_mode;
-    BOOL disable_prefetching;
-    BOOL is_temporary;
+    bool left_is_neg_infty, right_is_pos_infty;
+    bool is_snapshot_read; // true if query is read_committed, false otherwise
+    bool is_leaf_mode;
+    bool disable_prefetching;
+    bool is_temporary;
     TOKUTXN ttxn;
     struct ft_cursor_leaf_info  leaf_info;
 };
@@ -696,10 +696,10 @@ static inline void fill_bfe_for_full_read(struct ftnode_fetch_extra *bfe, FT h)
     bfe->search = NULL;
     bfe->range_lock_left_key = NULL;
     bfe->range_lock_right_key = NULL;
-    bfe->left_is_neg_infty = FALSE;
-    bfe->right_is_pos_infty = FALSE;
+    bfe->left_is_neg_infty = false;
+    bfe->right_is_pos_infty = false;
     bfe->child_to_read = -1;
-    bfe->disable_prefetching = FALSE;
+    bfe->disable_prefetching = false;
 }
 
 //
@@ -714,9 +714,9 @@ static inline void fill_bfe_for_subset_read(
     ft_search_t* search,
     DBT *left,
     DBT *right,
-    BOOL left_is_neg_infty,
-    BOOL right_is_pos_infty,
-    BOOL disable_prefetching
+    bool left_is_neg_infty,
+    bool right_is_pos_infty,
+    bool disable_prefetching
     )
 {
     invariant(h->h->type == FT_CURRENT);
@@ -744,10 +744,10 @@ static inline void fill_bfe_for_min_read(struct ftnode_fetch_extra *bfe, FT h) {
     bfe->search = NULL;
     bfe->range_lock_left_key = NULL;
     bfe->range_lock_right_key = NULL;
-    bfe->left_is_neg_infty = FALSE;
-    bfe->right_is_pos_infty = FALSE;
+    bfe->left_is_neg_infty = false;
+    bfe->right_is_pos_infty = false;
     bfe->child_to_read = -1;
-    bfe->disable_prefetching = FALSE;
+    bfe->disable_prefetching = false;
 }
 
 static inline void destroy_bfe_for_prefetch(struct ftnode_fetch_extra *bfe) {
@@ -807,7 +807,7 @@ struct pivot_bounds {
 };
 
 // FIXME needs toku prefix
-void maybe_apply_ancestors_messages_to_node (FT_HANDLE t, FTNODE node, ANCESTORS ancestors, struct pivot_bounds const * const bounds, BOOL* msgs_applied);
+void maybe_apply_ancestors_messages_to_node (FT_HANDLE t, FTNODE node, ANCESTORS ancestors, struct pivot_bounds const * const bounds, bool* msgs_applied);
 
 int
 toku_ft_search_which_child(
@@ -907,7 +907,7 @@ typedef enum {
 } ft_upgrade_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[FT_UPGRADE_STATUS_NUM_ROWS];
 } FT_UPGRADE_STATUS_S, *FT_UPGRADE_STATUS;
 
@@ -922,7 +922,7 @@ typedef enum {
 } le_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[LE_STATUS_NUM_ROWS];
 } LE_STATUS_S, *LE_STATUS;
 
@@ -987,7 +987,7 @@ void
 toku_ft_bn_apply_cmd_once (
     BASEMENTNODE bn,
     const FT_MSG cmd,
-    u_int32_t idx,
+    uint32_t idx,
     LEAFENTRY le,
     uint64_t *workdonep,
     STAT64INFO stats_to_update
diff --git a/ft/ft-node-deserialize.cc b/ft/ft-node-deserialize.cc
index 321dea9889dba542cd9b7edae2f7fa805ca9caac..05127e3c7be78dd4d0aa41d072d1c770a9d4a9ef 100644
--- a/ft/ft-node-deserialize.cc
+++ b/ft/ft-node-deserialize.cc
@@ -108,8 +108,8 @@ check_node_info_checksum(struct rbuf *rb)
 {
     int r = 0;
     // Verify checksum of header stored.
-    u_int32_t checksum = x1764_memory(rb->buf, rb->ndone);
-    u_int32_t stored_checksum = rbuf_int(rb);
+    uint32_t checksum = x1764_memory(rb->buf, rb->ndone);
+    uint32_t stored_checksum = rbuf_int(rb);
 
     if (stored_checksum != checksum) {
         // TODO: dump_bad_block(rb->buf, rb->size);
@@ -143,8 +143,8 @@ int
 check_legacy_end_checksum(struct rbuf *rb)
 {
     int r = 0;
-    u_int32_t expected_xsum = rbuf_int(rb);
-    u_int32_t actual_xsum = x1764_memory(rb->buf, rb->size - 4);
+    uint32_t expected_xsum = rbuf_int(rb);
+    uint32_t actual_xsum = x1764_memory(rb->buf, rb->size - 4);
     if (expected_xsum != actual_xsum) {
         r = TOKUDB_BAD_CHECKSUM;
     }
diff --git a/ft/ft-ops.cc b/ft/ft-ops.cc
index 6a524ff225d5ab5cc4797f5bf9bf7ee582d991ca..d9f39fa12ea88a975993e6e57d39589f8634b9ec 100644
--- a/ft/ft-ops.cc
+++ b/ft/ft-ops.cc
@@ -231,9 +231,9 @@ toku_assert_entire_node_in_memory(FTNODE node) {
     assert(is_entire_node_in_memory(node));
 }
 
-static u_int32_t
+static uint32_t
 get_leaf_num_entries(FTNODE node) {
-    u_int32_t result = 0;
+    uint32_t result = 0;
     int i;
     toku_assert_entire_node_in_memory(node);
     for ( i = 0; i < node->n_children; i++) {
@@ -281,12 +281,12 @@ toku_bnc_nbytesinbuf(NONLEAF_CHILDINFO bnc)
     return toku_fifo_buffer_size_in_use(bnc->buffer);
 }
 
-// return TRUE if the size of the buffers plus the amount of work done is large enough.   (But return false if there is nothing to be flushed (the buffers empty)).
+// return true if the size of the buffers plus the amount of work done is large enough.   (But return false if there is nothing to be flushed (the buffers empty)).
 bool
 toku_ft_nonleaf_is_gorged (FTNODE node) {
-    u_int64_t size = toku_serialize_ftnode_size(node);
+    uint64_t size = toku_serialize_ftnode_size(node);
 
-    bool buffers_are_empty = TRUE;
+    bool buffers_are_empty = true;
     toku_assert_entire_node_in_memory(node);
     //
     // the nonleaf node is gorged if the following holds true:
@@ -301,7 +301,7 @@ toku_ft_nonleaf_is_gorged (FTNODE node) {
     }
     for (int child = 0; child < node->n_children; ++child) {
         if (toku_bnc_nbytesinbuf(BNC(node, child)) > 0) {
-            buffers_are_empty = FALSE;
+            buffers_are_empty = false;
             break;
         }
     }
@@ -316,7 +316,7 @@ static void ft_verify_flags(FT ft, FTNODE node) {
 
 int toku_ft_debug_mode = 0;
 
-u_int32_t compute_child_fullhash (CACHEFILE cf, FTNODE node, int childnum) {
+uint32_t compute_child_fullhash (CACHEFILE cf, FTNODE node, int childnum) {
     assert(node->height>0 && childnum<node->n_children);
     return toku_cachetable_hash(cf, BP_BLOCKNUM(node, childnum));
 }
@@ -326,7 +326,7 @@ static void __attribute__((__unused__))
 ft_leaf_check_leaf_stats (FTNODE node)
 {
     assert(node);
-    assert(FALSE);
+    assert(false);
     // static int count=0; count++;
     // if (node->height>0) return;
     // struct subtree_estimates e = calc_leaf_stats(node);
@@ -418,7 +418,7 @@ ftnode_cachepressure_size(FTNODE node)
                 retval += BP_WORKDONE(node, i);
             }
             else {
-                assert(FALSE);
+                assert(false);
             }
         }
     }
@@ -468,7 +468,7 @@ ftnode_memory_size (FTNODE node)
             }
         }
         else {
-            assert(FALSE);
+            assert(false);
         }
     }
     return retval;
@@ -483,7 +483,7 @@ PAIR_ATTR make_ftnode_pair_attr(FTNODE node) {
         .leaf_size = (node->height > 0) ? 0 : size,
         .rollback_size = 0,
         .cache_pressure_size = cachepressure_size,
-        .is_valid = TRUE
+        .is_valid = true
     };
     return result;
 }
@@ -495,7 +495,7 @@ PAIR_ATTR make_invalid_pair_attr(void) {
         .leaf_size = 0,
         .rollback_size = 0,
         .cache_pressure_size = 0,
-        .is_valid = FALSE
+        .is_valid = false
     };
     return result;
 }
@@ -581,7 +581,7 @@ toku_get_and_clear_basement_stats(FTNODE leafnode) {
     return deltas;
 }
 
-static void ft_status_update_flush_reason(FTNODE node, BOOL for_checkpoint) {
+static void ft_status_update_flush_reason(FTNODE node, bool for_checkpoint) {
     if (node->height == 0) {
         if (for_checkpoint) {
             __sync_fetch_and_add(&STATUS_VALUE(FT_DISK_FLUSH_LEAF_FOR_CHECKPOINT), 1);
@@ -603,7 +603,7 @@ static void ft_status_update_flush_reason(FTNODE node, BOOL for_checkpoint) {
 static void ftnode_update_disk_stats(
     FTNODE ftnode,
     FT ft,
-    BOOL for_checkpoint
+    bool for_checkpoint
     )
 {
     STAT64INFO_S deltas = ZEROSTATS;
@@ -643,7 +643,7 @@ void toku_ftnode_clone_callback(
     void* value_data,
     void** cloned_value_data,
     PAIR_ATTR* new_attr,
-    BOOL for_checkpoint,
+    bool for_checkpoint,
     void* write_extraargs
     )
 {
@@ -692,7 +692,7 @@ void toku_ftnode_clone_callback(
         *new_attr = make_ftnode_pair_attr(node);
     }
     else {
-        new_attr->is_valid = FALSE;
+        new_attr->is_valid = false;
     }
     *cloned_value_data = cloned_node;
 }
@@ -707,10 +707,10 @@ void toku_ftnode_flush_callback (
     void *extraargs,
     PAIR_ATTR size __attribute__((unused)),
     PAIR_ATTR* new_size,
-    BOOL write_me,
-    BOOL keep_me,
-    BOOL for_checkpoint,
-    BOOL is_clone
+    bool write_me,
+    bool keep_me,
+    bool for_checkpoint,
+    bool is_clone
     )
 {
     FT h = (FT) extraargs;
@@ -763,7 +763,7 @@ toku_ft_status_update_pivot_fetch_reason(struct ftnode_fetch_extra *bfe)
     }
 }
 
-int toku_ftnode_fetch_callback (CACHEFILE UU(cachefile), int fd, BLOCKNUM nodename, u_int32_t fullhash,
+int toku_ftnode_fetch_callback (CACHEFILE UU(cachefile), int fd, BLOCKNUM nodename, uint32_t fullhash,
                                  void **ftnode_pv,  void** disk_data, PAIR_ATTR *sizep, int *dirtyp, void *extraargs) {
     assert(extraargs);
     assert(*ftnode_pv == NULL);
@@ -828,11 +828,11 @@ void toku_ftnode_pe_est_callback(
             // after compression, it is simply the size of compressed
             // data on disk plus the size of the struct that holds it
             FTNODE_DISK_DATA ndd = (FTNODE_DISK_DATA) disk_data;
-            u_int32_t compressed_data_size = BP_SIZE(ndd, i);
+            uint32_t compressed_data_size = BP_SIZE(ndd, i);
             compressed_data_size += sizeof(struct sub_block);
 
             // now get the space taken now
-            u_int32_t decompressed_data_size = get_avail_internal_node_partition_size(node,i);
+            uint32_t decompressed_data_size = get_avail_internal_node_partition_size(node,i);
             bytes_to_free += (decompressed_data_size - compressed_data_size);
         }
     }
@@ -933,7 +933,7 @@ int toku_ftnode_pe_callback (void *ftnode_pv, PAIR_ATTR UU(old_attr), PAIR_ATTR*
                 continue;
             }
             else {
-                assert(FALSE);
+                assert(false);
             }
         }
     }
@@ -953,9 +953,9 @@ int toku_ftnode_pe_callback (void *ftnode_pv, PAIR_ATTR UU(old_attr), PAIR_ATTR*
 //   - touch the necessary partition's clock. The reason we do it here is so that there is one central place it is done, and not done
 //      by all the various callers
 //
-BOOL toku_ftnode_pf_req_callback(void* ftnode_pv, void* read_extraargs) {
+bool toku_ftnode_pf_req_callback(void* ftnode_pv, void* read_extraargs) {
     // placeholder for now
-    BOOL retval = FALSE;
+    bool retval = false;
     FTNODE node = (FTNODE) ftnode_pv;
     struct ftnode_fetch_extra *bfe = (struct ftnode_fetch_extra *) read_extraargs;
     //
@@ -964,20 +964,20 @@ BOOL toku_ftnode_pf_req_callback(void* ftnode_pv, void* read_extraargs) {
     //  - ftnode_fetch_subset: some subset is necessary (example use: toku_ft_search)
     //  - ftnode_fetch_all: entire node is necessary (example use: flush, split, merge)
     // The code below checks if the necessary partitions are already in memory,
-    // and if they are, return FALSE, and if not, return TRUE
+    // and if they are, return false, and if not, return true
     //
     if (bfe->type == ftnode_fetch_none) {
-        retval = FALSE;
+        retval = false;
     }
     else if (bfe->type == ftnode_fetch_all) {
-        retval = FALSE;
+        retval = false;
         for (int i = 0; i < node->n_children; i++) {
             BP_TOUCH_CLOCK(node,i);
             // if we find a partition that is not available,
             // then a partial fetch is required because
             // the entire node must be made available
             if (BP_STATE(node,i) != PT_AVAIL) {
-                retval = TRUE;
+                retval = true;
             }
         }
     }
@@ -996,7 +996,7 @@ BOOL toku_ftnode_pf_req_callback(void* ftnode_pv, void* read_extraargs) {
             bfe->search
             );
         BP_TOUCH_CLOCK(node,bfe->child_to_read);
-        // child we want to read is not available, must set retval to TRUE
+        // child we want to read is not available, must set retval to true
         retval = (BP_STATE(node, bfe->child_to_read) != PT_AVAIL);
     }
     else if (bfe->type == ftnode_fetch_prefetch) {
@@ -1007,13 +1007,13 @@ BOOL toku_ftnode_pf_req_callback(void* ftnode_pv, void* read_extraargs) {
         int rc = toku_bfe_rightmost_child_wanted(bfe, node);
         for (int i = lc; i <= rc; ++i) {
             if (BP_STATE(node, i) != PT_AVAIL) {
-                retval = TRUE;
+                retval = true;
             }
         }
     }
     else {
         // we have a bug. The type should be known
-        assert(FALSE);
+        assert(false);
     }
     return retval;
 }
@@ -1023,7 +1023,7 @@ ft_status_update_partial_fetch_reason(
     struct ftnode_fetch_extra* UU(bfe),
     int UU(i),
     int UU(state),
-    BOOL UU(is_leaf)
+    bool UU(is_leaf)
     )
 {
     invariant(state == PT_COMPRESSED || state == PT_ON_DISK);
@@ -1120,7 +1120,7 @@ int toku_ftnode_pf_callback(void* ftnode_pv, void* disk_data, void* read_extraar
                 r = toku_deserialize_bp_from_disk(node, ndd, i, fd, bfe);
             }
             else {
-                assert(FALSE);
+                assert(false);
             }
         }
 
@@ -1144,7 +1144,7 @@ int toku_ftnode_pf_callback(void* ftnode_pv, void* disk_data, void* read_extraar
 }
 
 static int
-leafval_heaviside_le (u_int32_t klen, void *kval,
+leafval_heaviside_le (uint32_t klen, void *kval,
                       struct cmd_leafval_heaviside_extra *be) {
     DBT dbt;
     DBT const * const key = be->key;
@@ -1159,7 +1159,7 @@ int
 toku_cmd_leafval_heaviside (OMTVALUE lev, void *extra) {
     LEAFENTRY CAST_FROM_VOIDP(le, lev);
     struct cmd_leafval_heaviside_extra *CAST_FROM_VOIDP(be, extra);
-    u_int32_t keylen;
+    uint32_t keylen;
     void*     key = le_key_and_len(le, &keylen);
     return leafval_heaviside_le(keylen, key,
                                 be);
@@ -1306,7 +1306,7 @@ ft_init_new_root(FT ft, FTNODE nodea, FTNODE nodeb, DBT splitk, CACHEKEY *rootp,
     BP_STATE(newroot,1) = PT_AVAIL;
     newroot->dirty = 1;
     //printf("%s:%d put %lld\n", __FILE__, __LINE__, newroot_diskoff);
-    u_int32_t fullhash = toku_cachetable_hash(ft->cf, newroot_diskoff);
+    uint32_t fullhash = toku_cachetable_hash(ft->cf, newroot_diskoff);
     newroot->fullhash = fullhash;
     toku_cachetable_put(ft->cf, newroot_diskoff, fullhash, newroot, make_ftnode_pair_attr(newroot), get_write_callbacks_for_node(ft));
 
@@ -1353,7 +1353,7 @@ toku_ft_nonleaf_append_child(FTNODE node, FTNODE child, const DBT *pivotkey) {
 static void
 ft_leaf_delete_leafentry (
     BASEMENTNODE bn,
-    u_int32_t idx,
+    uint32_t idx,
     LEAFENTRY le
     )
 // Effect: Delete leafentry
@@ -1376,7 +1376,7 @@ void
 toku_ft_bn_apply_cmd_once (
     BASEMENTNODE bn,
     const FT_MSG cmd,
-    u_int32_t idx,
+    uint32_t idx,
     LEAFENTRY le,
     uint64_t *workdone,
     STAT64INFO stats_to_update
@@ -1462,15 +1462,15 @@ toku_ft_bn_apply_cmd_once (
 
 static const uint32_t setval_tag = 0xee0ccb99; // this was gotten by doing "cat /dev/random|head -c4|od -x" to get a random number.  We want to make sure that the user actually passes us the setval_extra_s that we passed in.
 struct setval_extra_s {
-    u_int32_t  tag;
-    BOOL did_set_val;
+    uint32_t  tag;
+    bool did_set_val;
     int         setval_r;    // any error code that setval_fun wants to return goes here.
     // need arguments for toku_ft_bn_apply_cmd_once
     BASEMENTNODE bn;
     MSN msn;              // captured from original message, not currently used
     XIDS xids;
     const DBT *key;
-    u_int32_t idx;
+    uint32_t idx;
     LEAFENTRY le;
     uint64_t * workdone;  // set by toku_ft_bn_apply_cmd_once()
     STAT64INFO stats_to_update;
@@ -1486,7 +1486,7 @@ static void setval_fun (const DBT *new_val, void *svextra_v) {
     struct setval_extra_s *CAST_FROM_VOIDP(svextra, svextra_v);
     assert(svextra->tag==setval_tag);
     assert(!svextra->did_set_val);
-    svextra->did_set_val = TRUE;
+    svextra->did_set_val = true;
 
     {
         // can't leave scope until toku_ft_bn_apply_cmd_once if
@@ -1542,12 +1542,12 @@ static int do_update(ft_update_func update_fun, DESCRIPTOR desc, BASEMENTNODE bn
         keyp = toku_fill_dbt(&key, le_key(le), le_keylen(le));
         update_function_extra = cmd->u.id.val;
     } else {
-        assert(FALSE);
+        assert(false);
     }
 
     if (le && !le_latest_is_del(le)) {
         // if the latest val exists, use it, and we'll use the leafentry later
-        u_int32_t vallen;
+        uint32_t vallen;
         void *valp = le_latest_val_and_len(le, &vallen);
         vdbtp = toku_fill_dbt(&vdbt, valp, vallen);
         le_for_update = le;
@@ -1557,7 +1557,7 @@ static int do_update(ft_update_func update_fun, DESCRIPTOR desc, BASEMENTNODE bn
         le_for_update = NULL;
     }
 
-    struct setval_extra_s setval_extra = {setval_tag, FALSE, 0, bn, cmd->msn, cmd->xids,
+    struct setval_extra_s setval_extra = {setval_tag, false, 0, bn, cmd->msn, cmd->xids,
                                           keyp, idx, le_for_update, workdone, stats_to_update};
     // call handlerton's brt->update_fun(), which passes setval_extra to setval_fun()
     FAKE_DB(db, desc);
@@ -1592,7 +1592,7 @@ toku_ft_bn_apply_cmd (
     LEAFENTRY storeddata;
     OMTVALUE storeddatav=NULL;
 
-    u_int32_t omt_size;
+    uint32_t omt_size;
     int r;
     struct cmd_leafval_heaviside_extra be = {compare_fun, desc, cmd->u.id.key};
 
@@ -1602,7 +1602,7 @@ toku_ft_bn_apply_cmd (
     switch (cmd->type) {
     case FT_INSERT_NO_OVERWRITE:
     case FT_INSERT: {
-        u_int32_t idx;
+        uint32_t idx;
         if (doing_seqinsert) {
             idx = toku_omt_size(bn->buffer);
             r = toku_omt_fetch(bn->buffer, idx-1, &storeddatav);
@@ -1628,8 +1628,8 @@ toku_ft_bn_apply_cmd (
         // the leaf then it is sequential
         // window = min(32, number of leaf entries/16)
         {
-            u_int32_t s = toku_omt_size(bn->buffer);
-            u_int32_t w = s / 16;
+            uint32_t s = toku_omt_size(bn->buffer);
+            uint32_t w = s / 16;
             if (w == 0) w = 1;
             if (w > 32) w = 32;
 
@@ -1642,7 +1642,7 @@ toku_ft_bn_apply_cmd (
     case FT_DELETE_ANY:
     case FT_ABORT_ANY:
     case FT_COMMIT_ANY: {
-        u_int32_t idx;
+        uint32_t idx;
         // Apply to all the matches
 
         r = toku_omt_find_zero(bn->buffer, toku_cmd_leafval_heaviside, &be,
@@ -1652,13 +1652,13 @@ toku_ft_bn_apply_cmd (
         CAST_FROM_VOIDP(storeddata, storeddatav);
 
         while (1) {
-            u_int32_t num_leafentries_before = toku_omt_size(bn->buffer);
+            uint32_t num_leafentries_before = toku_omt_size(bn->buffer);
 
             toku_ft_bn_apply_cmd_once(bn, cmd, idx, storeddata, workdone, stats_to_update);
 
             {
                 // Now we must find the next leafentry.
-                u_int32_t num_leafentries_after = toku_omt_size(bn->buffer);
+                uint32_t num_leafentries_after = toku_omt_size(bn->buffer);
                 //idx is the index of the leafentry we just modified.
                 //If the leafentry was deleted, we will have one less leafentry in
                 //the omt than we started with and the next leafentry will be at the
@@ -1676,7 +1676,7 @@ toku_ft_bn_apply_cmd (
             CAST_FROM_VOIDP(storeddata, storeddatav);
             {        // Continue only if the next record that we found has the same key.
                 DBT adbt;
-                u_int32_t keylen;
+                uint32_t keylen;
                 void *keyp = le_key_and_len(storeddata, &keylen);
                 FAKE_DB(db, desc);
                 if (compare_fun(&db,
@@ -1694,14 +1694,14 @@ toku_ft_bn_apply_cmd (
     case FT_OPTIMIZE:
         // Apply to all leafentries
         omt_size = toku_omt_size(bn->buffer);
-        for (u_int32_t idx = 0; idx < omt_size; ) {
+        for (uint32_t idx = 0; idx < omt_size; ) {
             r = toku_omt_fetch(bn->buffer, idx, &storeddatav);
             assert_zero(r);
             CAST_FROM_VOIDP(storeddata, storeddatav);
             int deleted = 0;
             if (!le_is_clean(storeddata)) { //If already clean, nothing to do.
                 toku_ft_bn_apply_cmd_once(bn, cmd, idx, storeddata, workdone, stats_to_update);
-                u_int32_t new_omt_size = toku_omt_size(bn->buffer);
+                uint32_t new_omt_size = toku_omt_size(bn->buffer);
                 if (new_omt_size != omt_size) {
                     assert(new_omt_size+1 == omt_size);
                     //Item was deleted.
@@ -1720,14 +1720,14 @@ toku_ft_bn_apply_cmd (
     case FT_ABORT_BROADCAST_TXN:
         // Apply to all leafentries if txn is represented
         omt_size = toku_omt_size(bn->buffer);
-        for (u_int32_t idx = 0; idx < omt_size; ) {
+        for (uint32_t idx = 0; idx < omt_size; ) {
             r = toku_omt_fetch(bn->buffer, idx, &storeddatav);
             assert_zero(r);
             CAST_FROM_VOIDP(storeddata, storeddatav);
             int deleted = 0;
             if (le_has_xids(storeddata, cmd->xids)) {
                 toku_ft_bn_apply_cmd_once(bn, cmd, idx, storeddata, workdone, stats_to_update);
-                u_int32_t new_omt_size = toku_omt_size(bn->buffer);
+                uint32_t new_omt_size = toku_omt_size(bn->buffer);
                 if (new_omt_size != omt_size) {
                     assert(new_omt_size+1 == omt_size);
                     //Item was deleted.
@@ -1743,7 +1743,7 @@ toku_ft_bn_apply_cmd (
 
         break;
     case FT_UPDATE: {
-        u_int32_t idx;
+        uint32_t idx;
         r = toku_omt_find_zero(bn->buffer, toku_cmd_leafval_heaviside, &be,
                                &storeddatav, &idx);
         if (r==DB_NOTFOUND) {
@@ -1756,8 +1756,8 @@ toku_ft_bn_apply_cmd (
     }
     case FT_UPDATE_BROADCAST_ALL: {
         // apply to all leafentries.
-        u_int32_t idx = 0;
-        u_int32_t num_leafentries_before;
+        uint32_t idx = 0;
+        uint32_t num_leafentries_before;
         while (idx < (num_leafentries_before = toku_omt_size(bn->buffer))) {
             r = toku_omt_fetch(bn->buffer, idx, &storeddatav);
             assert(r==0);
@@ -1991,19 +1991,19 @@ ft_nonleaf_cmd_all (ft_compare_func compare_fun, DESCRIPTOR desc, FTNODE node, F
     }
 }
 
-static BOOL
+static bool
 ft_msg_applies_once(FT_MSG cmd)
 {
     return ft_msg_type_applies_once(cmd->type);
 }
 
-static BOOL
+static bool
 ft_msg_applies_all(FT_MSG cmd)
 {
     return ft_msg_type_applies_all(cmd->type);
 }
 
-static BOOL
+static bool
 ft_msg_does_nothing(FT_MSG cmd)
 {
     return ft_msg_type_does_nothing(cmd->type);
@@ -2052,15 +2052,15 @@ ft_nonleaf_put_cmd (ft_compare_func compare_fun, DESCRIPTOR desc, FTNODE node, F
 }
 
 
-// return TRUE if root changed, FALSE otherwise
-static BOOL
+// return true if root changed, false otherwise
+static bool
 ft_process_maybe_reactive_root (FT ft, CACHEKEY *rootp, FTNODE *nodep) {
     FTNODE node = *nodep;
     toku_assert_entire_node_in_memory(node);
     enum reactivity re = get_node_reactivity(node);
     switch (re) {
     case RE_STABLE:
-        return FALSE;
+        return false;
     case RE_FISSIBLE:
     {
         // The root node should split, so make a new root.
@@ -2073,15 +2073,15 @@ ft_process_maybe_reactive_root (FT ft, CACHEKEY *rootp, FTNODE *nodep) {
         // in just node. That would be correct.
         //
         if (node->height==0) {
-            ftleaf_split(ft, node, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
+            ftleaf_split(ft, node, &nodea, &nodeb, &splitk, true, 0, NULL);
         } else {
             ft_nonleaf_split(ft, node, &nodea, &nodeb, &splitk, 0, NULL);
         }
         ft_init_new_root(ft, nodea, nodeb, splitk, rootp, nodep);
-        return TRUE;
+        return true;
     }
     case RE_FUSIBLE:
-        return FALSE; // Cannot merge anything at the root, so return happy.
+        return false; // Cannot merge anything at the root, so return happy.
     }
     abort(); // cannot happen
 }
@@ -2090,7 +2090,7 @@ ft_process_maybe_reactive_root (FT ft, CACHEKEY *rootp, FTNODE *nodep) {
 // Garbage collect one leaf entry.
 static void
 ft_basement_node_gc_once(BASEMENTNODE bn,
-                          u_int32_t index,
+                          uint32_t index,
                           LEAFENTRY leaf_entry,
                           const xid_omt_t &snapshot_xids,
                           const rx_omt_t &referenced_xids,
@@ -2176,8 +2176,8 @@ basement_node_gc_all_les(BASEMENTNODE bn,
                          STAT64INFO_S * delta)
 {
     int r = 0;
-    u_int32_t index = 0;
-    u_int32_t num_leafentries_before;
+    uint32_t index = 0;
+    uint32_t num_leafentries_before;
     while (index < (num_leafentries_before = toku_omt_size(bn->buffer))) {
         OMTVALUE storedatav = NULL;
         LEAFENTRY leaf_entry;
@@ -2403,7 +2403,7 @@ void toku_ft_leaf_apply_cmd(
         }
     }
     else if (!ft_msg_does_nothing(cmd)) {
-        assert(FALSE);
+        assert(false);
     }
     VERIFY_NODE(t, node);
 }
@@ -2493,7 +2493,7 @@ toku_ft_root_put_cmd (FT h, FT_MSG_S * cmd)
     {
         toku_ft_grab_treelock(h);
 
-        u_int32_t fullhash;
+        uint32_t fullhash;
         toku_calculate_root_offset_pointer(h, &root_key, &fullhash);
 
         // get the root node
@@ -2504,7 +2504,7 @@ toku_ft_root_put_cmd (FT h, FT_MSG_S * cmd)
             root_key,
             fullhash,
             &bfe,
-            TRUE, // may_modify_node
+            true, // may_modify_node
             0,
             NULL,
             &node
@@ -2523,7 +2523,7 @@ toku_ft_root_put_cmd (FT h, FT_MSG_S * cmd)
 
         // first handle a reactive root, then put in the message
         CACHEKEY new_root_key;
-        BOOL root_changed = ft_process_maybe_reactive_root(h, &new_root_key, &node);
+        bool root_changed = ft_process_maybe_reactive_root(h, &new_root_key, &node);
         if (root_changed) {
             toku_ft_set_new_root_blocknum(h, new_root_key);
         }
@@ -2548,7 +2548,7 @@ toku_ft_root_put_cmd (FT h, FT_MSG_S * cmd)
 
 // Effect: Insert the key-val pair into brt.
 int toku_ft_insert (FT_HANDLE brt, DBT *key, DBT *val, TOKUTXN txn) {
-    return toku_ft_maybe_insert(brt, key, val, txn, FALSE, ZERO_LSN, TRUE, FT_INSERT);
+    return toku_ft_maybe_insert(brt, key, val, txn, false, ZERO_LSN, true, FT_INSERT);
 }
 
 int
@@ -2683,7 +2683,7 @@ toku_ft_log_put_multiple (TOKUTXN txn, FT_HANDLE src_ft, FT_HANDLE *brts, int nu
 }
 
 int
-toku_ft_maybe_insert (FT_HANDLE ft_h, DBT *key, DBT *val, TOKUTXN txn, BOOL oplsn_valid, LSN oplsn, BOOL do_logging, enum ft_msg_type type) {
+toku_ft_maybe_insert (FT_HANDLE ft_h, DBT *key, DBT *val, TOKUTXN txn, bool oplsn_valid, LSN oplsn, bool do_logging, enum ft_msg_type type) {
     assert(type==FT_INSERT || type==FT_INSERT_NO_OVERWRITE);
     int r = 0;
     XIDS message_xids = xids_get_root_xids(); //By default use committed messages
@@ -2736,8 +2736,8 @@ ft_send_update_msg(FT_HANDLE brt, FT_MSG_S *msg, TOKUTXN txn) {
 
 int
 toku_ft_maybe_update(FT_HANDLE ft_h, const DBT *key, const DBT *update_function_extra,
-                      TOKUTXN txn, BOOL oplsn_valid, LSN oplsn,
-                      BOOL do_logging) {
+                      TOKUTXN txn, bool oplsn_valid, LSN oplsn,
+                      bool do_logging) {
     int r = 0;
 
     TXNID xid = toku_txn_get_txnid(txn);
@@ -2778,12 +2778,12 @@ toku_ft_maybe_update(FT_HANDLE ft_h, const DBT *key, const DBT *update_function_
 
 int
 toku_ft_maybe_update_broadcast(FT_HANDLE ft_h, const DBT *update_function_extra,
-                                TOKUTXN txn, BOOL oplsn_valid, LSN oplsn,
-                                BOOL do_logging, BOOL is_resetting_op) {
+                                TOKUTXN txn, bool oplsn_valid, LSN oplsn,
+                                bool do_logging, bool is_resetting_op) {
     int r = 0;
 
     TXNID xid = toku_txn_get_txnid(txn);
-    u_int8_t  resetting = is_resetting_op ? 1 : 0;
+    uint8_t  resetting = is_resetting_op ? 1 : 0;
     if (txn) {
         r = toku_logger_save_rollback_cmdupdatebroadcast(txn, toku_cachefile_filenum(ft_h->ft->cf), resetting);
         if (r != 0) { goto cleanup; }
@@ -2835,7 +2835,7 @@ toku_ft_send_commit_any(FT_HANDLE brt, DBT *key, XIDS xids) {
 }
 
 int toku_ft_delete(FT_HANDLE brt, DBT *key, TOKUTXN txn) {
-    return toku_ft_maybe_delete(brt, key, txn, FALSE, ZERO_LSN, TRUE);
+    return toku_ft_maybe_delete(brt, key, txn, false, ZERO_LSN, true);
 }
 
 int
@@ -2879,7 +2879,7 @@ toku_ft_log_del_multiple (TOKUTXN txn, FT_HANDLE src_ft, FT_HANDLE *brts, int nu
 }
 
 int
-toku_ft_maybe_delete(FT_HANDLE ft_h, DBT *key, TOKUTXN txn, BOOL oplsn_valid, LSN oplsn, BOOL do_logging) {
+toku_ft_maybe_delete(FT_HANDLE ft_h, DBT *key, TOKUTXN txn, bool oplsn_valid, LSN oplsn, bool do_logging) {
     int r;
     XIDS message_xids = xids_get_root_xids(); //By default use committed messages
     TXNID xid = toku_txn_get_txnid(txn);
@@ -2929,10 +2929,10 @@ struct omt_compressor_state {
     OMT omt;
 };
 
-static int move_it (OMTVALUE lev, u_int32_t idx, void *v) {
+static int move_it (OMTVALUE lev, uint32_t idx, void *v) {
     LEAFENTRY CAST_FROM_VOIDP(le, lev);
     struct omt_compressor_state *CAST_FROM_VOIDP(oc, v);
-    u_int32_t size = leafentry_memsize(le);
+    uint32_t size = leafentry_memsize(le);
     LEAFENTRY CAST_FROM_VOIDP(newdata, toku_mempool_malloc(oc->new_kvspace, size, 1));
     lazy_assert(newdata); // we do this on a fresh mempool, so nothing bad should happen
     memcpy(newdata, le, size);
@@ -2943,7 +2943,7 @@ static int move_it (OMTVALUE lev, u_int32_t idx, void *v) {
 // Compress things, and grow the mempool if needed.
 // TODO 4092 should copy data to new memory, then call toku_mempool_destory() followed by toku_mempool_init()
 static int omt_compress_kvspace (OMT omt, struct mempool *memp, size_t added_size, void **maybe_free) {
-    u_int32_t total_size_needed = memp->free_offset-memp->frag_size + added_size;
+    uint32_t total_size_needed = memp->free_offset-memp->frag_size + added_size;
     if (total_size_needed+total_size_needed/4 >= memp->size) {
         memp->size = total_size_needed+total_size_needed/4;
     }
@@ -3063,7 +3063,7 @@ toku_ft_handle_get_compression_method(FT_HANDLE t, enum toku_compression_method
 }
 
 static int
-verify_builtin_comparisons_consistent(FT_HANDLE t, u_int32_t flags) {
+verify_builtin_comparisons_consistent(FT_HANDLE t, uint32_t flags) {
     if ((flags & TOKU_DB_KEYCMP_BUILTIN) && (t->options.compare_fun != toku_builtin_compare_fun))
         return EINVAL;
     return 0;
@@ -3078,9 +3078,9 @@ toku_ft_change_descriptor(
     FT_HANDLE ft_h,
     const DBT* old_descriptor,
     const DBT* new_descriptor,
-    BOOL do_log,
+    bool do_log,
     TOKUTXN txn,
-    BOOL update_cmp_descriptor
+    bool update_cmp_descriptor
     )
 {
     int r = 0;
@@ -3142,7 +3142,7 @@ toku_ft_handle_inherit_options(FT_HANDLE t, FT ft) {
         .update_fun = ft->update_fun
     };
     t->options = options;
-    t->did_set_flags = TRUE;
+    t->did_set_flags = true;
 }
 
 // This is the actual open, used for various purposes, such as normal use, recovery, and redirect.
@@ -3152,11 +3152,11 @@ toku_ft_handle_inherit_options(FT_HANDLE t, FT ft) {
 static int
 ft_handle_open(FT_HANDLE ft_h, const char *fname_in_env, int is_create, int only_create, CACHETABLE cachetable, TOKUTXN txn, FILENUM use_filenum, DICTIONARY_ID use_dictionary_id, LSN max_acceptable_lsn) {
     int r;
-    BOOL txn_created = FALSE;
+    bool txn_created = false;
     char *fname_in_cwd = NULL;
     CACHEFILE cf = NULL;
     FT ft = NULL;
-    BOOL did_create = FALSE;
+    bool did_create = false;
     toku_ft_open_close_lock();
 
     if (ft_h->did_set_flags) {
@@ -3179,14 +3179,14 @@ ft_handle_open(FT_HANDLE ft_h, const char *fname_in_env, int is_create, int only
             reserved_filenum = toku_cachetable_reserve_filenum(cachetable);
         }
         if (r==ENOENT && is_create) {
-            did_create = TRUE;
+            did_create = true;
             mode_t mode = S_IRWXU|S_IRWXG|S_IRWXO;
             if (txn) {
                 BYTESTRING bs = { .len=(uint32_t) strlen(fname_in_env), .data = (char*)fname_in_env };
                 r = toku_logger_save_rollback_fcreate(txn, reserved_filenum, &bs); // bs is a copy of the fname relative to the environment
                 assert_zero(r);
             }
-            txn_created = (BOOL)(txn!=NULL);
+            txn_created = (bool)(txn!=NULL);
             r = toku_logger_log_fcreate(txn, fname_in_env, reserved_filenum, mode, ft_h->options.flags, ft_h->options.nodesize, ft_h->options.basementnodesize, ft_h->options.compression_method);
             assert_zero(r); // only possible failure is panic, which we check above
             r = ft_create_file(ft_h, fname_in_cwd, &fd);
@@ -3197,7 +3197,7 @@ ft_handle_open(FT_HANDLE ft_h, const char *fname_in_env, int is_create, int only
         if (r) { goto exit; }
     }
     assert(ft_h->options.nodesize>0);
-    BOOL was_already_open;
+    bool was_already_open;
     if (is_create) {
         r = toku_read_ft_and_store_in_cachefile(ft_h, cf, max_acceptable_lsn, &ft, &was_already_open);
         if (r==TOKUDB_DICTIONARY_NO_HEADER) {
@@ -3288,7 +3288,7 @@ ft_handle_open(FT_HANDLE ft_h, const char *fname_in_env, int is_create, int only
             // we can simply try to remove the header.
             // We don't need to unlink this brt from the header
             toku_ft_grab_reflock(ft);
-            BOOL needed = toku_ft_needed_unlocked(ft);
+            bool needed = toku_ft_needed_unlocked(ft);
             toku_ft_release_reflock(ft);
             if (!needed) {
                 //Close immediately.
@@ -3298,7 +3298,7 @@ ft_handle_open(FT_HANDLE ft_h, const char *fname_in_env, int is_create, int only
             }
         }
         else {
-            toku_cachefile_close(&cf, 0, FALSE, ZERO_LSN);
+            toku_cachefile_close(&cf, 0, false, ZERO_LSN);
         }
     }
     toku_ft_open_close_unlock();
@@ -3390,7 +3390,7 @@ toku_ft_get_dictionary_id(FT_HANDLE brt) {
 
 int toku_ft_set_flags(FT_HANDLE brt, unsigned int flags) {
     assert(flags==(flags&TOKU_DB_KEYCMP_BUILTIN)); // make sure there are no extraneous flags
-    brt->did_set_flags = TRUE;
+    brt->did_set_flags = true;
     brt->options.flags = flags;
     return 0;
 }
@@ -3510,7 +3510,7 @@ int toku_ft_handle_create(FT_HANDLE *ft_handle_ptr) {
     memset(brt, 0, sizeof *brt);
     toku_list_init(&brt->live_ft_handle_link);
     brt->options.flags = 0;
-    brt->did_set_flags = FALSE;
+    brt->did_set_flags = false;
     brt->options.nodesize = FT_DEFAULT_NODE_SIZE;
     brt->options.basementnodesize = FT_DEFAULT_BASEMENT_NODE_SIZE;
     brt->options.compression_method = TOKU_DEFAULT_COMPRESSION_METHOD;
@@ -3560,9 +3560,9 @@ does_txn_read_entry(TXNID id, TOKUTXN context) {
 static inline void
 ft_cursor_extract_key_and_val(LEAFENTRY le,
                                FT_CURSOR cursor,
-                               u_int32_t *keylen,
+                               uint32_t *keylen,
                                void            **key,
-                               u_int32_t *vallen,
+                               uint32_t *vallen,
                                void            **val) {
     if (toku_ft_cursor_is_leaf_mode(cursor)) {
         *key = le_key_and_len(le, keylen);
@@ -3587,8 +3587,8 @@ int toku_ft_cursor (
     FT_HANDLE brt,
     FT_CURSOR *cursorptr,
     TOKUTXN ttxn,
-    BOOL is_snapshot_read,
-    BOOL disable_prefetching
+    bool is_snapshot_read,
+    bool disable_prefetching
     )
 {
     if (is_snapshot_read) {
@@ -3605,28 +3605,28 @@ int toku_ft_cursor (
         return ENOMEM;
     memset(cursor, 0, sizeof(*cursor));
     cursor->ft_handle = brt;
-    cursor->prefetching = FALSE;
+    cursor->prefetching = false;
     toku_init_dbt(&cursor->range_lock_left_key);
     toku_init_dbt(&cursor->range_lock_right_key);
-    cursor->left_is_neg_infty = FALSE;
-    cursor->right_is_pos_infty = FALSE;
+    cursor->left_is_neg_infty = false;
+    cursor->right_is_pos_infty = false;
     cursor->is_snapshot_read = is_snapshot_read;
-    cursor->is_leaf_mode = FALSE;
+    cursor->is_leaf_mode = false;
     cursor->ttxn = ttxn;
     cursor->disable_prefetching = disable_prefetching;
-    cursor->is_temporary = FALSE;
+    cursor->is_temporary = false;
     *cursorptr = cursor;
     return 0;
 }
 
 void
 toku_ft_cursor_set_temporary(FT_CURSOR ftcursor) {
-    ftcursor->is_temporary = TRUE;
+    ftcursor->is_temporary = true;
 }
 
 void
 toku_ft_cursor_set_leaf_mode(FT_CURSOR ftcursor) {
-    ftcursor->is_leaf_mode = TRUE;
+    ftcursor->is_leaf_mode = true;
 }
 
 int
@@ -3636,7 +3636,7 @@ toku_ft_cursor_is_leaf_mode(FT_CURSOR ftcursor) {
 
 void
 toku_ft_cursor_set_range_lock(FT_CURSOR cursor, const DBT *left, const DBT *right,
-                               BOOL left_is_neg_infty, BOOL right_is_pos_infty)
+                               bool left_is_neg_infty, bool right_is_pos_infty)
 {
     if (cursor->range_lock_left_key.data) {
         toku_free(cursor->range_lock_left_key.data);
@@ -3648,13 +3648,13 @@ toku_ft_cursor_set_range_lock(FT_CURSOR cursor, const DBT *left, const DBT *righ
     }
 
     if (left_is_neg_infty) {
-        cursor->left_is_neg_infty = TRUE;
+        cursor->left_is_neg_infty = true;
     } else {
         toku_fill_dbt(&cursor->range_lock_left_key,
                       toku_xmemdup(left->data, left->size), left->size);
     }
     if (right_is_pos_infty) {
-        cursor->right_is_pos_infty = TRUE;
+        cursor->right_is_pos_infty = true;
     } else {
         toku_fill_dbt(&cursor->range_lock_right_key,
                       toku_xmemdup(right->data, right->size), right->size);
@@ -3676,22 +3676,22 @@ int toku_ft_cursor_close(FT_CURSOR cursor) {
 }
 
 static inline void ft_cursor_set_prefetching(FT_CURSOR cursor) {
-    cursor->prefetching = TRUE;
+    cursor->prefetching = true;
 }
 
-static inline BOOL ft_cursor_prefetching(FT_CURSOR cursor) {
+static inline bool ft_cursor_prefetching(FT_CURSOR cursor) {
     return cursor->prefetching;
 }
 
-//Return TRUE if cursor is uninitialized.  FALSE otherwise.
-static BOOL
+//Return true if cursor is uninitialized.  false otherwise.
+static bool
 ft_cursor_not_set(FT_CURSOR cursor) {
     assert((cursor->key.data==NULL) == (cursor->val.data==NULL));
-    return (BOOL)(cursor->key.data == NULL);
+    return (bool)(cursor->key.data == NULL);
 }
 
 static int
-pair_leafval_heaviside_le (u_int32_t klen, void *kval,
+pair_leafval_heaviside_le (uint32_t klen, void *kval,
                            ft_search_t *search) {
     DBT x;
     int cmp = search->compare(search,
@@ -3709,7 +3709,7 @@ static int
 heaviside_from_search_t (OMTVALUE lev, void *extra) {
     LEAFENTRY CAST_FROM_VOIDP(le, lev);
     ft_search_t *CAST_FROM_VOIDP(search, extra);
-    u_int32_t keylen;
+    uint32_t keylen;
     void* key = le_key_and_len(le, &keylen);
 
     return pair_leafval_heaviside_le (keylen, key,
@@ -3724,7 +3724,7 @@ static inline int
 is_le_val_del(LEAFENTRY le, FT_CURSOR ftcursor) {
     int rval;
     if (ftcursor->is_snapshot_read) {
-        BOOL is_del;
+        bool is_del;
         le_iterate_is_del(
             le,
             does_txn_read_entry,
@@ -3749,16 +3749,16 @@ static void search_save_bound (ft_search_t *search, DBT *pivot) {
     search->pivot_bound.data = toku_malloc(pivot->size);
     search->pivot_bound.size = pivot->size;
     memcpy(search->pivot_bound.data, pivot->data, pivot->size);
-    search->have_pivot_bound = TRUE;
+    search->have_pivot_bound = true;
 }
 
-static BOOL search_pivot_is_bounded (ft_search_t *search, DESCRIPTOR desc, ft_compare_func cmp, DBT *pivot) __attribute__((unused));
-static BOOL search_pivot_is_bounded (ft_search_t *search, DESCRIPTOR desc, ft_compare_func cmp, DBT *pivot)
-// Effect:  Return TRUE iff the pivot has already been searched (for fixing #3522.)
+static bool search_pivot_is_bounded (ft_search_t *search, DESCRIPTOR desc, ft_compare_func cmp, DBT *pivot) __attribute__((unused));
+static bool search_pivot_is_bounded (ft_search_t *search, DESCRIPTOR desc, ft_compare_func cmp, DBT *pivot)
+// Effect:  Return true iff the pivot has already been searched (for fixing #3522.)
 //  If searching from left to right, if we have already searched all the values less than pivot, we don't want to search again.
 //  If searching from right to left, if we have already searched all the vlaues greater than pivot, we don't want to search again.
 {
-    if (!search->have_pivot_bound) return TRUE; // isn't bounded.
+    if (!search->have_pivot_bound) return true; // isn't bounded.
     FAKE_DB(db, desc);
     int comp = cmp(&db, pivot, &search->pivot_bound);
     if (search->direction == FT_SEARCH_LEFT) {
@@ -3844,7 +3844,7 @@ do_bn_apply_cmd(FT_HANDLE t, BASEMENTNODE bn, FTNODE ancestor, int childnum, con
         MSN msn = entry->msn;
         const XIDS xids = (XIDS) &entry->xids_s;
         bytevec key = xids_get_end_of_array(xids);
-        bytevec val = (u_int8_t*)key + entry->keylen;
+        bytevec val = (uint8_t*)key + entry->keylen;
 
         DBT hk;
         toku_fill_dbt(&hk, key, keylen);
@@ -3996,7 +3996,7 @@ bnc_apply_messages_to_basement_node(
     FTNODE ancestor,  // the ancestor node where we can find messages to apply
     int childnum,      // which child buffer of ancestor contains messages we want
     struct pivot_bounds const * const bounds,  // contains pivot key bounds of this basement node
-    BOOL* msgs_applied
+    bool* msgs_applied
     )
 {
     int r;
@@ -4012,7 +4012,7 @@ bnc_apply_messages_to_basement_node(
         stale_lbi = 0;
         stale_ube = 0;
     }
-    u_int32_t fresh_lbi, fresh_ube;
+    uint32_t fresh_lbi, fresh_ube;
     find_bounds_within_message_tree(&t->ft->cmp_descriptor, t->ft->compare_fun, bnc->fresh_message_tree, bnc->buffer, bounds, &fresh_lbi, &fresh_ube);
 
     // We now know where all the messages we must apply are, so one of the
@@ -4050,7 +4050,7 @@ bnc_apply_messages_to_basement_node(
 
         // Apply the messages in MSN order.
         for (int i = 0; i < buffer_size; ++i) {
-            *msgs_applied = TRUE;
+            *msgs_applied = true;
             const struct fifo_entry *entry = toku_fifo_get_entry(bnc->buffer, offsets[i]);
             do_bn_apply_cmd(t, bn, ancestor, childnum, entry, &stats_delta);
         }
@@ -4059,13 +4059,13 @@ bnc_apply_messages_to_basement_node(
     } else if (stale_lbi == stale_ube) {
         // No stale messages to apply, we just apply fresh messages.
         struct iterate_do_bn_apply_cmd_extra iter_extra = { .t = t, .bn = bn, .ancestor = ancestor, .childnum = childnum, .stats_to_update = &stats_delta};
-        if (fresh_ube - fresh_lbi > 0) *msgs_applied = TRUE;
+        if (fresh_ube - fresh_lbi > 0) *msgs_applied = true;
         r = bnc->fresh_message_tree.iterate_on_range<struct iterate_do_bn_apply_cmd_extra, iterate_do_bn_apply_cmd>(fresh_lbi, fresh_ube, &iter_extra);
         assert_zero(r);
     } else if (fresh_lbi == fresh_ube) {
         // No fresh messages to apply, we just apply stale messages.
 
-        if (stale_ube - stale_lbi > 0) *msgs_applied = TRUE;
+        if (stale_ube - stale_lbi > 0) *msgs_applied = true;
         struct iterate_do_bn_apply_cmd_extra iter_extra = { .t = t, .bn = bn, .ancestor = ancestor, .childnum = childnum , .stats_to_update = &stats_delta};
 
         r = bnc->stale_message_tree.iterate_on_range<struct iterate_do_bn_apply_cmd_extra, iterate_do_bn_apply_cmd>(stale_lbi, stale_ube, &iter_extra);
@@ -4089,7 +4089,7 @@ bnc_apply_messages_to_basement_node(
         // Iterate over both lists, applying the smaller (in (key, msn)
         // order) message at each step
         while (stale_i < stale_ube && fresh_i < fresh_ube) {
-            *msgs_applied = TRUE;
+            *msgs_applied = true;
             int c = toku_fifo_entry_key_msn_cmp(extra, stale_offset, fresh_offset);
             if (c < 0) {
                 // The stale message we're pointing to either has a
@@ -4169,7 +4169,7 @@ bnc_apply_messages_to_basement_node(
 }
 
 void
-maybe_apply_ancestors_messages_to_node (FT_HANDLE t, FTNODE node, ANCESTORS ancestors, struct pivot_bounds const * const bounds, BOOL* msgs_applied)
+maybe_apply_ancestors_messages_to_node (FT_HANDLE t, FTNODE node, ANCESTORS ancestors, struct pivot_bounds const * const bounds, bool* msgs_applied)
 // Effect:
 //   Bring a leaf node up-to-date according to all the messages in the ancestors.
 //   If the leaf node is already up-to-date then do nothing.
@@ -4224,9 +4224,9 @@ ft_cursor_shortcut (
     int direction,
     FT_GET_CALLBACK_FUNCTION getf,
     void *getf_v,
-    u_int32_t *keylen,
+    uint32_t *keylen,
     void **key,
-    u_int32_t *vallen,
+    uint32_t *vallen,
     void **val
     );
 
@@ -4237,9 +4237,9 @@ ft_search_basement_node(
     ft_search_t *search,
     FT_GET_CALLBACK_FUNCTION getf,
     void *getf_v,
-    BOOL *doprefetch,
+    bool *doprefetch,
     FT_CURSOR ftcursor,
-    BOOL can_bulk_fetch
+    bool can_bulk_fetch
     )
 {
     // Now we have to convert from ft_search_t to the heaviside function with a direction.  What a pain...
@@ -4252,7 +4252,7 @@ ft_search_basement_node(
     return EINVAL;  // This return and the goto are a hack to get both compile-time and run-time checking on enum
 ok: ;
     OMTVALUE datav;
-    u_int32_t idx = 0;
+    uint32_t idx = 0;
     int r = toku_omt_find(bn->buffer,
                           heaviside_from_search_t,
                           search,
@@ -4279,7 +4279,7 @@ ok: ;
                 idx--;
                 break;
             default:
-                assert(FALSE);
+                assert(false);
             }
             r = toku_omt_fetch(bn->buffer, idx, &datav);
             assert_zero(r); // we just validated the index
@@ -4289,9 +4289,9 @@ ok: ;
     }
 got_a_good_value:
     {
-        u_int32_t keylen;
+        uint32_t keylen;
         void *key;
-        u_int32_t vallen;
+        uint32_t vallen;
         void *val;
 
         ft_cursor_extract_key_and_val(le,
@@ -4328,7 +4328,7 @@ ok: ;
                 ftcursor->val.size = vallen;
             }
             //The search was successful.  Prefetching can continue.
-            *doprefetch = TRUE;
+            *doprefetch = true;
         }
     }
     if (r == TOKUDB_CURSOR_CONTINUE) r = 0;
@@ -4343,12 +4343,12 @@ ft_search_node (
     int child_to_search,
     FT_GET_CALLBACK_FUNCTION getf,
     void *getf_v,
-    BOOL *doprefetch,
+    bool *doprefetch,
     FT_CURSOR ftcursor,
     UNLOCKERS unlockers,
     ANCESTORS,
     struct pivot_bounds const * const bounds,
-    BOOL can_bulk_fetch
+    bool can_bulk_fetch
     );
 
 // the number of nodes to prefetch
@@ -4356,7 +4356,7 @@ ft_search_node (
 #if TOKU_DO_PREFETCH
 
 static int
-ftnode_fetch_callback_and_free_bfe(CACHEFILE cf, int fd, BLOCKNUM nodename, u_int32_t fullhash, void **ftnode_pv, void** UU(disk_data), PAIR_ATTR *sizep, int *dirtyp, void *extraargs)
+ftnode_fetch_callback_and_free_bfe(CACHEFILE cf, int fd, BLOCKNUM nodename, uint32_t fullhash, void **ftnode_pv, void** UU(disk_data), PAIR_ATTR *sizep, int *dirtyp, void *extraargs)
 {
     int r = toku_ftnode_fetch_callback(cf, fd, nodename, fullhash, ftnode_pv, disk_data, sizep, dirtyp, extraargs);
     struct ftnode_fetch_extra *CAST_FROM_VOIDP(ffe, extraargs);
@@ -4376,7 +4376,7 @@ ftnode_pf_callback_and_free_bfe(void *ftnode_pv, void* disk_data, void *read_ext
 }
 
 static void
-ft_node_maybe_prefetch(FT_HANDLE brt, FTNODE node, int childnum, FT_CURSOR ftcursor, BOOL *doprefetch) {
+ft_node_maybe_prefetch(FT_HANDLE brt, FTNODE node, int childnum, FT_CURSOR ftcursor, bool *doprefetch) {
 
     // if we want to prefetch in the tree
     // then prefetch the next children if there are any
@@ -4384,10 +4384,10 @@ ft_node_maybe_prefetch(FT_HANDLE brt, FTNODE node, int childnum, FT_CURSOR ftcur
         int rc = ft_cursor_rightmost_child_wanted(ftcursor, brt, node);
         for (int i = childnum + 1; (i <= childnum + TOKU_DO_PREFETCH) && (i <= rc); i++) {
             BLOCKNUM nextchildblocknum = BP_BLOCKNUM(node, i);
-            u_int32_t nextfullhash = compute_child_fullhash(brt->ft->cf, node, i);
+            uint32_t nextfullhash = compute_child_fullhash(brt->ft->cf, node, i);
             struct ftnode_fetch_extra *MALLOC(bfe);
             fill_bfe_for_prefetch(bfe, brt->ft, ftcursor);
-            BOOL doing_prefetch = FALSE;
+            bool doing_prefetch = false;
             toku_cachefile_prefetch(
                 brt->ft->cf,
                 nextchildblocknum,
@@ -4403,7 +4403,7 @@ ft_node_maybe_prefetch(FT_HANDLE brt, FTNODE node, int childnum, FT_CURSOR ftcur
                 destroy_bfe_for_prefetch(bfe);
                 toku_free(bfe);
             }
-            *doprefetch = FALSE;
+            *doprefetch = false;
         }
     }
 }
@@ -4413,7 +4413,7 @@ ft_node_maybe_prefetch(FT_HANDLE brt, FTNODE node, int childnum, FT_CURSOR ftcur
 struct unlock_ftnode_extra {
     FT_HANDLE ft_handle;
     FTNODE node;
-    BOOL msgs_applied;
+    bool msgs_applied;
 };
 // When this is called, the cachetable lock is held
 static void
@@ -4434,14 +4434,14 @@ unlock_ftnode_fun (void *v) {
 
 /* search in a node's child */
 static int
-ft_search_child(FT_HANDLE brt, FTNODE node, int childnum, ft_search_t *search, FT_GET_CALLBACK_FUNCTION getf, void *getf_v, BOOL *doprefetch, FT_CURSOR ftcursor, UNLOCKERS unlockers,
-                 ANCESTORS ancestors, struct pivot_bounds const * const bounds, BOOL can_bulk_fetch)
+ft_search_child(FT_HANDLE brt, FTNODE node, int childnum, ft_search_t *search, FT_GET_CALLBACK_FUNCTION getf, void *getf_v, bool *doprefetch, FT_CURSOR ftcursor, UNLOCKERS unlockers,
+                 ANCESTORS ancestors, struct pivot_bounds const * const bounds, bool can_bulk_fetch)
 // Effect: Search in a node's child.  Searches are read-only now (at least as far as the hardcopy is concerned).
 {
     struct ancestors next_ancestors = {node, childnum, ancestors};
 
     BLOCKNUM childblocknum = BP_BLOCKNUM(node,childnum);
-    u_int32_t fullhash = compute_child_fullhash(brt->ft->cf, node, childnum);
+    uint32_t fullhash = compute_child_fullhash(brt->ft->cf, node, childnum);
     FTNODE childnode;
 
     struct ftnode_fetch_extra bfe;
@@ -4455,14 +4455,14 @@ ft_search_child(FT_HANDLE brt, FTNODE node, int childnum, ft_search_t *search, F
         ftcursor->right_is_pos_infty,
         ftcursor->disable_prefetching
         );
-    BOOL msgs_applied = FALSE;
+    bool msgs_applied = false;
     {
         int rr = toku_pin_ftnode(brt, childblocknum, fullhash,
                                   unlockers,
                                   &next_ancestors, bounds,
                                   &bfe,
-                                  (node->height == 1), // may_modify_node TRUE iff child is leaf
-                                  TRUE,
+                                  (node->height == 1), // may_modify_node true iff child is leaf
+                                  true,
                                   &childnode,
                                   &msgs_applied);
         if (rr==TOKUDB_TRY_AGAIN) return rr;
@@ -4470,7 +4470,7 @@ ft_search_child(FT_HANDLE brt, FTNODE node, int childnum, ft_search_t *search, F
     }
 
     struct unlock_ftnode_extra unlock_extra   = {brt,childnode,msgs_applied};
-    struct unlockers next_unlockers = {TRUE, unlock_ftnode_fun, (void*)&unlock_extra, unlockers};
+    struct unlockers next_unlockers = {true, unlock_ftnode_fun, (void*)&unlock_extra, unlockers};
 
     int r = ft_search_node(brt, childnode, search, bfe.child_to_read, getf, getf_v, doprefetch, ftcursor, &next_unlockers, &next_ancestors, bounds, can_bulk_fetch);
     if (r!=TOKUDB_TRY_AGAIN) {
@@ -4627,12 +4627,12 @@ ft_search_node(
     int child_to_search,
     FT_GET_CALLBACK_FUNCTION getf,
     void *getf_v,
-    BOOL *doprefetch,
+    bool *doprefetch,
     FT_CURSOR ftcursor,
     UNLOCKERS unlockers,
     ANCESTORS ancestors,
     struct pivot_bounds const * const bounds,
-    BOOL can_bulk_fetch
+    bool can_bulk_fetch
     )
 {   int r = 0;
     // assert that we got a valid child_to_search
@@ -4726,7 +4726,7 @@ ft_search_node(
 }
 
 static int
-toku_ft_search (FT_HANDLE brt, ft_search_t *search, FT_GET_CALLBACK_FUNCTION getf, void *getf_v, FT_CURSOR ftcursor, BOOL can_bulk_fetch)
+toku_ft_search (FT_HANDLE brt, ft_search_t *search, FT_GET_CALLBACK_FUNCTION getf, void *getf_v, FT_CURSOR ftcursor, bool can_bulk_fetch)
 // Effect: Perform a search.  Associate cursor with a leaf if possible.
 // All searches are performed through this function.
 {
@@ -4778,7 +4778,7 @@ toku_ft_search (FT_HANDLE brt, ft_search_t *search, FT_GET_CALLBACK_FUNCTION get
     FTNODE node = NULL;
     {
         toku_ft_grab_treelock(brt->ft);
-        u_int32_t fullhash;
+        uint32_t fullhash;
         CACHEKEY root_key;
         toku_calculate_root_offset_pointer(brt->ft, &root_key, &fullhash);
         toku_pin_ftnode_off_client_thread(
@@ -4786,7 +4786,7 @@ toku_ft_search (FT_HANDLE brt, ft_search_t *search, FT_GET_CALLBACK_FUNCTION get
             root_key,
             fullhash,
             &bfe,
-            FALSE, // may_modify_node set to FALSE, because root cannot change during search
+            false, // may_modify_node set to false, because root cannot change during search
             0,
             NULL,
             &node
@@ -4797,11 +4797,11 @@ toku_ft_search (FT_HANDLE brt, ft_search_t *search, FT_GET_CALLBACK_FUNCTION get
     uint tree_height = node->height + 1;  // How high is the tree?  This is the height of the root node plus one (leaf is at height 0).
 
 
-    struct unlock_ftnode_extra unlock_extra   = {brt,node,FALSE};
-    struct unlockers                unlockers      = {TRUE, unlock_ftnode_fun, (void*)&unlock_extra, (UNLOCKERS)NULL};
+    struct unlock_ftnode_extra unlock_extra   = {brt,node,false};
+    struct unlockers                unlockers      = {true, unlock_ftnode_fun, (void*)&unlock_extra, (UNLOCKERS)NULL};
 
     {
-        BOOL doprefetch = FALSE;
+        bool doprefetch = false;
         //static int counter = 0;         counter++;
         r = ft_search_node(brt, node, search, bfe.child_to_read, getf, getf_v, &doprefetch, ftcursor, &unlockers, (ANCESTORS)NULL, &infinite_bounds, can_bulk_fetch);
         if (r==TOKUDB_TRY_AGAIN) {
@@ -4867,7 +4867,7 @@ struct ft_cursor_search_struct {
 
 /* search for the first kv pair that matches the search object */
 static int
-ft_cursor_search(FT_CURSOR cursor, ft_search_t *search, FT_GET_CALLBACK_FUNCTION getf, void *getf_v, BOOL can_bulk_fetch)
+ft_cursor_search(FT_CURSOR cursor, ft_search_t *search, FT_GET_CALLBACK_FUNCTION getf, void *getf_v, bool can_bulk_fetch)
 {
     int r = toku_ft_search(cursor->ft_handle, search, getf, getf_v, cursor, can_bulk_fetch);
     return r;
@@ -4919,7 +4919,7 @@ toku_ft_cursor_current(FT_CURSOR cursor, int op, FT_GET_CALLBACK_FUNCTION getf,
     if (op == DB_CURRENT) {
         struct ft_cursor_search_struct bcss = {getf, getf_v, cursor, 0};
         ft_search_t search; ft_search_init(&search, ft_cursor_compare_set, FT_SEARCH_LEFT, &cursor->key, cursor->ft_handle);
-        int r = toku_ft_search(cursor->ft_handle, &search, ft_cursor_current_getf, &bcss, cursor, FALSE);
+        int r = toku_ft_search(cursor->ft_handle, &search, ft_cursor_current_getf, &bcss, cursor, false);
         ft_search_finish(&search);
         return r;
     }
@@ -4930,7 +4930,7 @@ int
 toku_ft_cursor_first(FT_CURSOR cursor, FT_GET_CALLBACK_FUNCTION getf, void *getf_v)
 {
     ft_search_t search; ft_search_init(&search, ft_cursor_compare_one, FT_SEARCH_LEFT, 0, cursor->ft_handle);
-    int r = ft_cursor_search(cursor, &search, getf, getf_v, FALSE);
+    int r = ft_cursor_search(cursor, &search, getf, getf_v, false);
     ft_search_finish(&search);
     return r;
 }
@@ -4939,7 +4939,7 @@ int
 toku_ft_cursor_last(FT_CURSOR cursor, FT_GET_CALLBACK_FUNCTION getf, void *getf_v)
 {
     ft_search_t search; ft_search_init(&search, ft_cursor_compare_one, FT_SEARCH_RIGHT, 0, cursor->ft_handle);
-    int r = ft_cursor_search(cursor, &search, getf, getf_v, FALSE);
+    int r = ft_cursor_search(cursor, &search, getf, getf_v, false);
     ft_search_finish(&search);
     return r;
 }
@@ -4956,18 +4956,18 @@ ft_cursor_shortcut (
     int direction,
     FT_GET_CALLBACK_FUNCTION getf,
     void *getf_v,
-    u_int32_t *keylen,
+    uint32_t *keylen,
     void **key,
-    u_int32_t *vallen,
+    uint32_t *vallen,
     void **val
     )
 {
     int r = 0;
-    u_int32_t index = cursor->leaf_info.to_be.index;
+    uint32_t index = cursor->leaf_info.to_be.index;
     OMT omt = cursor->leaf_info.to_be.omt;
     // if we are searching towards the end, limit is last element
     // if we are searching towards the beginning, limit is the first element
-    u_int32_t limit = (direction > 0) ? (toku_omt_size(omt) - 1) : 0;
+    uint32_t limit = (direction > 0) ? (toku_omt_size(omt) - 1) : 0;
 
     //Starting with the prev, find the first real (non-provdel) leafentry.
     OMTVALUE lev = NULL;
@@ -5009,7 +5009,7 @@ int
 toku_ft_cursor_next(FT_CURSOR cursor, FT_GET_CALLBACK_FUNCTION getf, void *getf_v)
 {
     ft_search_t search; ft_search_init(&search, ft_cursor_compare_next, FT_SEARCH_LEFT, &cursor->key, cursor->ft_handle);
-    int r = ft_cursor_search(cursor, &search, getf, getf_v, TRUE);
+    int r = ft_cursor_search(cursor, &search, getf, getf_v, true);
     ft_search_finish(&search);
     if (r == 0) ft_cursor_set_prefetching(cursor);
     return r;
@@ -5042,7 +5042,7 @@ static int
 ft_cursor_search_eq_k_x(FT_CURSOR cursor, ft_search_t *search, FT_GET_CALLBACK_FUNCTION getf, void *getf_v)
 {
     struct ft_cursor_search_struct bcss = {getf, getf_v, cursor, search};
-    int r = toku_ft_search(cursor->ft_handle, search, ft_cursor_search_eq_k_x_getf, &bcss, cursor, FALSE);
+    int r = toku_ft_search(cursor->ft_handle, search, ft_cursor_search_eq_k_x_getf, &bcss, cursor, false);
     return r;
 }
 
@@ -5055,7 +5055,7 @@ int
 toku_ft_cursor_prev(FT_CURSOR cursor, FT_GET_CALLBACK_FUNCTION getf, void *getf_v)
 {
     ft_search_t search; ft_search_init(&search, ft_cursor_compare_prev, FT_SEARCH_RIGHT, &cursor->key, cursor->ft_handle);
-    int r = ft_cursor_search(cursor, &search, getf, getf_v, TRUE);
+    int r = ft_cursor_search(cursor, &search, getf, getf_v, true);
     ft_search_finish(&search);
     return r;
 }
@@ -5078,7 +5078,7 @@ int
 toku_ft_cursor_set_range(FT_CURSOR cursor, DBT *key, FT_GET_CALLBACK_FUNCTION getf, void *getf_v)
 {
     ft_search_t search; ft_search_init(&search, ft_cursor_compare_set_range, FT_SEARCH_LEFT, key, cursor->ft_handle);
-    int r = ft_cursor_search(cursor, &search, getf, getf_v, FALSE);
+    int r = ft_cursor_search(cursor, &search, getf, getf_v, false);
     ft_search_finish(&search);
     return r;
 }
@@ -5092,7 +5092,7 @@ int
 toku_ft_cursor_set_range_reverse(FT_CURSOR cursor, DBT *key, FT_GET_CALLBACK_FUNCTION getf, void *getf_v)
 {
     ft_search_t search; ft_search_init(&search, ft_cursor_compare_set_range_reverse, FT_SEARCH_RIGHT, key, cursor->ft_handle);
-    int r = ft_cursor_search(cursor, &search, getf, getf_v, FALSE);
+    int r = ft_cursor_search(cursor, &search, getf, getf_v, false);
     ft_search_finish(&search);
     return r;
 }
@@ -5155,7 +5155,7 @@ toku_ft_cursor_peek(FT_CURSOR cursor, const DBT **pkey, const DBT **pval)
 static const DBT __toku_dbt_fake = {};
 static const DBT* const toku_dbt_fake = &__toku_dbt_fake;
 
-BOOL toku_ft_cursor_uninitialized(FT_CURSOR c) {
+bool toku_ft_cursor_uninitialized(FT_CURSOR c) {
     return ft_cursor_not_set(c);
 }
 
@@ -5168,7 +5168,7 @@ toku_ft_lookup (FT_HANDLE brt, DBT *k, FT_GET_CALLBACK_FUNCTION getf, void *getf
     int r, rr;
     FT_CURSOR cursor;
 
-    rr = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);
+    rr = toku_ft_cursor(brt, &cursor, NULL, false, false);
     if (rr != 0) return rr;
 
     int op = DB_SET;
@@ -5190,7 +5190,7 @@ toku_ft_cursor_delete(FT_CURSOR cursor, int flags, TOKUTXN txn) {
     int r;
 
     int unchecked_flags = flags;
-    BOOL error_if_missing = (BOOL) !(flags&DB_DELETE_ANY);
+    bool error_if_missing = (bool) !(flags&DB_DELETE_ANY);
     unchecked_flags &= ~DB_DELETE_ANY;
     if (unchecked_flags!=0) r = EINVAL;
     else if (ft_cursor_not_set(cursor)) r = EINVAL;
@@ -5217,7 +5217,7 @@ struct keyrange_compare_s {
 static int
 keyrange_compare (OMTVALUE lev, void *extra) {
     LEAFENTRY CAST_FROM_VOIDP(le, lev);
-    u_int32_t keylen;
+    uint32_t keylen;
     void* key = le_key_and_len(le, &keylen);
     DBT   omt_dbt;
     toku_fill_dbt(&omt_dbt, key, keylen);
@@ -5228,8 +5228,8 @@ keyrange_compare (OMTVALUE lev, void *extra) {
 }
 
 static void
-keyrange_in_leaf_partition (FT_HANDLE brt, FTNODE node, DBT *key, int child_number, u_int64_t estimated_num_rows,
-                            u_int64_t *less, u_int64_t *equal, u_int64_t *greater)
+keyrange_in_leaf_partition (FT_HANDLE brt, FTNODE node, DBT *key, int child_number, uint64_t estimated_num_rows,
+                            uint64_t *less, uint64_t *equal, uint64_t *greater)
 // If the partition is in main memory then estimate the number
 // If KEY==NULL then use an arbitrary key (leftmost or zero)
 {
@@ -5239,7 +5239,7 @@ keyrange_in_leaf_partition (FT_HANDLE brt, FTNODE node, DBT *key, int child_numb
         struct keyrange_compare_s s = {brt,key};
         BASEMENTNODE bn = BLB(node, child_number);
         OMTVALUE datav;
-        u_int32_t idx = 0;
+        uint32_t idx = 0;
         // if key is NULL then set r==-1 and idx==0.
         int r = key ? toku_omt_find_zero(bn->buffer, keyrange_compare, &s, &datav, &idx) : -1;
         if (r==0) {
@@ -5261,8 +5261,8 @@ keyrange_in_leaf_partition (FT_HANDLE brt, FTNODE node, DBT *key, int child_numb
 
 static int
 toku_ft_keyrange_internal (FT_HANDLE brt, FTNODE node,
-                            DBT *key, u_int64_t *less, u_int64_t *equal, u_int64_t *greater,
-                            u_int64_t estimated_num_rows,
+                            DBT *key, uint64_t *less, uint64_t *equal, uint64_t *greater,
+                            uint64_t estimated_num_rows,
                             struct ftnode_fetch_extra *bfe, // set up to read a minimal read.
                             struct unlockers *unlockers, ANCESTORS ancestors, struct pivot_bounds const * const bounds)
 // Implementation note: Assign values to less, equal, and greater, and then on the way out (returning up the stack) we add more values in.
@@ -5282,9 +5282,9 @@ toku_ft_keyrange_internal (FT_HANDLE brt, FTNODE node,
         // do the child.
         struct ancestors next_ancestors = {node, child_number, ancestors};
         BLOCKNUM childblocknum = BP_BLOCKNUM(node, child_number);
-        u_int32_t fullhash = compute_child_fullhash(brt->ft->cf, node, child_number);
+        uint32_t fullhash = compute_child_fullhash(brt->ft->cf, node, child_number);
         FTNODE childnode;
-        BOOL msgs_applied = FALSE;
+        bool msgs_applied = false;
         r = toku_pin_ftnode(
             brt,
             childblocknum,
@@ -5293,8 +5293,8 @@ toku_ft_keyrange_internal (FT_HANDLE brt, FTNODE node,
             &next_ancestors,
             bounds,
             bfe,
-            FALSE, // may_modify_node is FALSE, because node guaranteed to not change
-            FALSE,
+            false, // may_modify_node is false, because node guaranteed to not change
+            false,
             &childnode,
             &msgs_applied
             );
@@ -5302,8 +5302,8 @@ toku_ft_keyrange_internal (FT_HANDLE brt, FTNODE node,
         if (r != TOKUDB_TRY_AGAIN) {
             assert(r == 0);
 
-            struct unlock_ftnode_extra unlock_extra   = {brt,childnode,FALSE};
-            struct unlockers next_unlockers = {TRUE, unlock_ftnode_fun, (void*)&unlock_extra, unlockers};
+            struct unlock_ftnode_extra unlock_extra   = {brt,childnode,false};
+            struct unlockers next_unlockers = {true, unlock_ftnode_fun, (void*)&unlock_extra, unlockers};
             const struct pivot_bounds next_bounds = next_pivot_keys(node, child_number, bounds);
 
             r = toku_ft_keyrange_internal(brt, childnode, key, less, equal, greater, rows_per_child,
@@ -5323,7 +5323,7 @@ toku_ft_keyrange_internal (FT_HANDLE brt, FTNODE node,
 }
 
 int
-toku_ft_keyrange (FT_HANDLE brt, DBT *key, u_int64_t *less_p, u_int64_t *equal_p, u_int64_t *greater_p)
+toku_ft_keyrange (FT_HANDLE brt, DBT *key, uint64_t *less_p, uint64_t *equal_p, uint64_t *greater_p)
 // Effect: Return an estimate  of the number of keys to the left, the number equal, and the number to the right of the key.
 //   The values are an estimate.
 //   If you perform a keyrange on two keys that are in the same in-memory and uncompressed basement,
@@ -5337,12 +5337,12 @@ toku_ft_keyrange (FT_HANDLE brt, DBT *key, u_int64_t *less_p, u_int64_t *equal_p
     fill_bfe_for_min_read(&bfe, brt->ft);  // read pivot keys but not message buffers
 try_again:
     {
-        u_int64_t less = 0, equal = 0, greater = 0;
+        uint64_t less = 0, equal = 0, greater = 0;
         FTNODE node = NULL;
         {
             toku_ft_grab_treelock(brt->ft);
 
-            u_int32_t fullhash;
+            uint32_t fullhash;
             CACHEKEY root_key;
             toku_calculate_root_offset_pointer(brt->ft, &root_key, &fullhash);
             toku_pin_ftnode_off_client_thread(
@@ -5350,7 +5350,7 @@ toku_ft_keyrange (FT_HANDLE brt, DBT *key, u_int64_t *less_p, u_int64_t *equal_p
                 root_key,
                 fullhash,
                 &bfe,
-                FALSE, // may_modify_node, cannot change root during keyrange
+                false, // may_modify_node, cannot change root during keyrange
                 0,
                 NULL,
                 &node
@@ -5358,8 +5358,8 @@ toku_ft_keyrange (FT_HANDLE brt, DBT *key, u_int64_t *less_p, u_int64_t *equal_p
             toku_ft_release_treelock(brt->ft);
         }
 
-        struct unlock_ftnode_extra unlock_extra = {brt,node,FALSE};
-        struct unlockers unlockers = {TRUE, unlock_ftnode_fun, (void*)&unlock_extra, (UNLOCKERS)NULL};
+        struct unlock_ftnode_extra unlock_extra = {brt,node,false};
+        struct unlockers unlockers = {true, unlock_ftnode_fun, (void*)&unlock_extra, (UNLOCKERS)NULL};
 
         {
             int64_t numrows = brt->ft->in_memory_stats.numrows;
@@ -5399,7 +5399,7 @@ toku_dump_ftnode (FILE *file, FT_HANDLE brt, BLOCKNUM blocknum, int depth, const
     void* node_v;
     toku_get_node_for_verify(blocknum, brt, &node);
     result=toku_verify_ftnode(brt, ZERO_MSN, ZERO_MSN, node, -1, lorange, hirange, NULL, NULL, 0, 1, 0);
-    u_int32_t fullhash = toku_cachetable_hash(brt->ft->cf, blocknum);
+    uint32_t fullhash = toku_cachetable_hash(brt->ft->cf, blocknum);
     struct ftnode_fetch_extra bfe;
     fill_bfe_for_full_read(&bfe, brt->ft);
     int r = toku_cachetable_get_and_pin(
@@ -5412,7 +5412,7 @@ toku_dump_ftnode (FILE *file, FT_HANDLE brt, BLOCKNUM blocknum, int depth, const
         toku_ftnode_fetch_callback,
         toku_ftnode_pf_req_callback,
         toku_ftnode_pf_callback,
-        TRUE, // may_modify_value, just safe to set to TRUE, I think it could theoretically be FALSE
+        true, // may_modify_value, just safe to set to true, I think it could theoretically be false
         &bfe
         );
     assert_zero(r);
@@ -5482,7 +5482,7 @@ int toku_dump_ft (FILE *f, FT_HANDLE brt) {
     {
         toku_ft_grab_treelock(brt->ft);
 
-        u_int32_t fullhash = 0;
+        uint32_t fullhash = 0;
         CACHEKEY root_key;
         toku_calculate_root_offset_pointer(brt->ft, &root_key, &fullhash);
         r = toku_dump_ftnode(f, brt, root_key, 0, 0, 0);
@@ -5532,7 +5532,7 @@ toku_ft_suppress_recovery_logs (FT_HANDLE brt, TOKUTXN txn) {
     assert(brt->ft->txnid_that_created_or_locked_when_empty == toku_txn_get_txnid(txn));
     assert(brt->ft->txnid_that_suppressed_recovery_logs           == TXNID_NONE);
     brt->ft->txnid_that_suppressed_recovery_logs                   = toku_txn_get_txnid(txn);
-    txn->checkpoint_needed_before_commit = TRUE;
+    txn->checkpoint_needed_before_commit = true;
 }
 
 int toku_ft_handle_set_panic(FT_HANDLE brt, int panic, const char *panic_string) {
@@ -5607,7 +5607,7 @@ toku_ft_get_fragmentation(FT_HANDLE brt, TOKU_DB_FRAGMENTATION report) {
     return r;
 }
 
-static BOOL is_empty_fast_iter (FT_HANDLE brt, FTNODE node) {
+static bool is_empty_fast_iter (FT_HANDLE brt, FTNODE node) {
     if (node->height > 0) {
         for (int childnum=0; childnum<node->n_children; childnum++) {
             if (toku_bnc_nbytesinbuf(BNC(node, childnum)) != 0) {
@@ -5616,7 +5616,7 @@ static BOOL is_empty_fast_iter (FT_HANDLE brt, FTNODE node) {
             FTNODE childnode;
             {
                 BLOCKNUM childblocknum = BP_BLOCKNUM(node,childnum);
-                u_int32_t fullhash =  compute_child_fullhash(brt->ft->cf, node, childnum);
+                uint32_t fullhash =  compute_child_fullhash(brt->ft->cf, node, childnum);
                 struct ftnode_fetch_extra bfe;
                 fill_bfe_for_full_read(&bfe, brt->ft);
                 // don't need to pass in dependent nodes as we are not
@@ -5626,7 +5626,7 @@ static BOOL is_empty_fast_iter (FT_HANDLE brt, FTNODE node) {
                     childblocknum,
                     fullhash,
                     &bfe,
-                    FALSE, // may_modify_node set to FALSE, as nodes not modified
+                    false, // may_modify_node set to false, as nodes not modified
                     0,
                     NULL,
                     &childnode
@@ -5641,18 +5641,18 @@ static BOOL is_empty_fast_iter (FT_HANDLE brt, FTNODE node) {
         // leaf:  If the omt is empty, we are happy.
         for (int i = 0; i < node->n_children; i++) {
             if (toku_omt_size(BLB_BUFFER(node, i))) {
-                return FALSE;
+                return false;
             }
         }
-        return TRUE;
+        return true;
     }
 }
 
-BOOL toku_ft_is_empty_fast (FT_HANDLE brt)
+bool toku_ft_is_empty_fast (FT_HANDLE brt)
 // A fast check to see if the tree is empty.  If there are any messages or leafentries, we consider the tree to be nonempty.  It's possible that those
 // messages and leafentries would all optimize away and that the tree is empty, but we'll say it is nonempty.
 {
-    u_int32_t fullhash;
+    uint32_t fullhash;
     FTNODE node;
     //assert(fullhash == toku_cachetable_hash(brt->ft->cf, *rootp));
     {
@@ -5667,7 +5667,7 @@ BOOL toku_ft_is_empty_fast (FT_HANDLE brt)
             root_key,
             fullhash,
             &bfe,
-            FALSE, // may_modify_node set to FALSE, node does not change
+            false, // may_modify_node set to false, node does not change
             0,
             NULL,
             &node
@@ -5675,7 +5675,7 @@ BOOL toku_ft_is_empty_fast (FT_HANDLE brt)
 
         toku_ft_release_treelock(brt->ft);
     }
-    BOOL r = is_empty_fast_iter(brt, node);
+    bool r = is_empty_fast_iter(brt, node);
     toku_unpin_ftnode(brt->ft, node);
     return r;
 }
diff --git a/ft/ft-ops.h b/ft/ft-ops.h
index dbeaf6ff56e8ba42bc690240a5d809a933851d77..f3952f2511ccc083dfb27a7083badb36e591bc19 100644
--- a/ft/ft-ops.h
+++ b/ft/ft-ops.h
@@ -37,8 +37,8 @@ int toku_open_ft_handle (const char *fname, int is_create, FT_HANDLE *, int node
 // - can only update cmp descriptor immidiately after opening the FIRST ft handle for this ft and before 
 //   ANY operations. to update the cmp descriptor after any operations have already happened, all handles 
 //   and transactions must close and reopen before the change, then you can update the cmp descriptor
-int toku_ft_change_descriptor(FT_HANDLE t, const DBT* old_descriptor, const DBT* new_descriptor, BOOL do_log, TOKUTXN txn, BOOL update_cmp_descriptor);
-u_int32_t toku_serialize_descriptor_size(const DESCRIPTOR desc);
+int toku_ft_change_descriptor(FT_HANDLE t, const DBT* old_descriptor, const DBT* new_descriptor, bool do_log, TOKUTXN txn, bool update_cmp_descriptor);
+uint32_t toku_serialize_descriptor_size(const DESCRIPTOR desc);
 
 int toku_ft_handle_create(FT_HANDLE *)  __attribute__ ((warn_unused_result));
 int toku_ft_set_flags(FT_HANDLE, unsigned int flags)  __attribute__ ((warn_unused_result));
@@ -129,17 +129,17 @@ int toku_ft_optimize (FT_HANDLE brt)  __attribute__ ((warn_unused_result));
 
 // Effect: Insert a key and data pair into a brt if the oplsn is newer than the brt lsn.  This function is called during recovery.
 // Returns 0 if successful
-int toku_ft_maybe_insert (FT_HANDLE brt, DBT *k, DBT *v, TOKUTXN txn, BOOL oplsn_valid, LSN oplsn, BOOL do_logging, enum ft_msg_type type)  __attribute__ ((warn_unused_result));
+int toku_ft_maybe_insert (FT_HANDLE brt, DBT *k, DBT *v, TOKUTXN txn, bool oplsn_valid, LSN oplsn, bool do_logging, enum ft_msg_type type)  __attribute__ ((warn_unused_result));
 
 // Effect: Send an update message into a brt.  This function is called
 // during recovery.
 // Returns 0 if successful
-int toku_ft_maybe_update(FT_HANDLE brt, const DBT *key, const DBT *update_function_extra, TOKUTXN txn, BOOL oplsn_valid, LSN oplsn, BOOL do_logging) __attribute__ ((warn_unused_result));
+int toku_ft_maybe_update(FT_HANDLE brt, const DBT *key, const DBT *update_function_extra, TOKUTXN txn, bool oplsn_valid, LSN oplsn, bool do_logging) __attribute__ ((warn_unused_result));
 
 // Effect: Send a broadcasting update message into a brt.  This function
 // is called during recovery.
 // Returns 0 if successful
-int toku_ft_maybe_update_broadcast(FT_HANDLE brt, const DBT *update_function_extra, TOKUTXN txn, BOOL oplsn_valid, LSN oplsn, BOOL do_logging, BOOL is_resetting_op) __attribute__ ((warn_unused_result));
+int toku_ft_maybe_update_broadcast(FT_HANDLE brt, const DBT *update_function_extra, TOKUTXN txn, bool oplsn_valid, LSN oplsn, bool do_logging, bool is_resetting_op) __attribute__ ((warn_unused_result));
 
 int toku_ft_load_recovery(TOKUTXN txn, FILENUM old_filenum, char const * new_iname, int do_fsync, int do_log, LSN *load_lsn)  __attribute__ ((warn_unused_result));
 int toku_ft_load(FT_HANDLE brt, TOKUTXN txn, char const * new_iname, int do_fsync, LSN *get_lsn)  __attribute__ ((warn_unused_result));
@@ -158,7 +158,7 @@ int toku_ft_delete (FT_HANDLE brt, DBT *k, TOKUTXN txn)  __attribute__ ((warn_un
 
 // Effect: Delete a key from a brt if the oplsn is newer than the brt lsn.  This function is called during recovery.
 // Returns 0 if successful
-int toku_ft_maybe_delete (FT_HANDLE brt, DBT *k, TOKUTXN txn, BOOL oplsn_valid, LSN oplsn, BOOL do_logging)  __attribute__ ((warn_unused_result));
+int toku_ft_maybe_delete (FT_HANDLE brt, DBT *k, TOKUTXN txn, bool oplsn_valid, LSN oplsn, bool do_logging)  __attribute__ ((warn_unused_result));
 
 int toku_ft_send_insert(FT_HANDLE brt, DBT *key, DBT *val, XIDS xids, enum ft_msg_type type) __attribute__ ((warn_unused_result));
 int toku_ft_send_delete(FT_HANDLE brt, DBT *key, XIDS xids) __attribute__ ((warn_unused_result));
@@ -175,13 +175,13 @@ int toku_verify_ft (FT_HANDLE brt)  __attribute__ ((warn_unused_result));
 int toku_verify_ft_with_progress (FT_HANDLE brt, int (*progress_callback)(void *extra, float progress), void *extra, int verbose, int keep_going)  __attribute__ ((warn_unused_result));
 
 typedef struct ft_cursor *FT_CURSOR;
-int toku_ft_cursor (FT_HANDLE, FT_CURSOR*, TOKUTXN, BOOL, BOOL)  __attribute__ ((warn_unused_result));
+int toku_ft_cursor (FT_HANDLE, FT_CURSOR*, TOKUTXN, bool, bool)  __attribute__ ((warn_unused_result));
 void toku_ft_cursor_set_leaf_mode(FT_CURSOR);
 // Sets a boolean on the brt cursor that prevents uncessary copying of
 // the cursor duing a one query.
 void toku_ft_cursor_set_temporary(FT_CURSOR);
 int toku_ft_cursor_is_leaf_mode(FT_CURSOR);
-void toku_ft_cursor_set_range_lock(FT_CURSOR, const DBT *, const DBT *, BOOL, BOOL);
+void toku_ft_cursor_set_range_lock(FT_CURSOR, const DBT *, const DBT *, bool, bool);
 
 // get is deprecated in favor of the individual functions below
 int toku_ft_cursor_get (FT_CURSOR cursor, DBT *key, FT_GET_CALLBACK_FUNCTION getf, void *getf_v, int get_flags)  __attribute__ ((warn_unused_result));
@@ -201,7 +201,7 @@ int toku_ft_cursor_get_both_range_reverse(FT_CURSOR cursor, DBT *key, DBT *val,
 
 int toku_ft_cursor_delete(FT_CURSOR cursor, int flags, TOKUTXN)  __attribute__ ((warn_unused_result));
 int toku_ft_cursor_close (FT_CURSOR curs)  __attribute__ ((warn_unused_result));
-BOOL toku_ft_cursor_uninitialized(FT_CURSOR c)  __attribute__ ((warn_unused_result));
+bool toku_ft_cursor_uninitialized(FT_CURSOR c)  __attribute__ ((warn_unused_result));
 
 void toku_ft_cursor_peek(FT_CURSOR cursor, const DBT **pkey, const DBT **pval);
 
@@ -215,17 +215,17 @@ enum ft_flags {
 };
 
 int 
-toku_ft_keyrange (FT_HANDLE brt, DBT *key, u_int64_t *less,  u_int64_t *equal,  u_int64_t *greater) __attribute__ ((warn_unused_result));
+toku_ft_keyrange (FT_HANDLE brt, DBT *key, uint64_t *less,  uint64_t *equal,  uint64_t *greater) __attribute__ ((warn_unused_result));
 
 struct ftstat64_s {
-    u_int64_t nkeys; /* estimate how many unique keys (even when flattened this may be an estimate)     */
-    u_int64_t ndata; /* estimate the number of pairs (exact when flattened and committed)               */
-    u_int64_t dsize; /* estimate the sum of the sizes of the pairs (exact when flattened and committed) */
-    u_int64_t fsize;  /* the size of the underlying file                                                */
-    u_int64_t ffree; /* Number of free bytes in the underlying file                                    */
-    u_int64_t create_time_sec; /* creation time in seconds. */
-    u_int64_t modify_time_sec; /* time of last serialization, in seconds. */ 
-    u_int64_t verify_time_sec; /* time of last verification, in seconds */
+    uint64_t nkeys; /* estimate how many unique keys (even when flattened this may be an estimate)     */
+    uint64_t ndata; /* estimate the number of pairs (exact when flattened and committed)               */
+    uint64_t dsize; /* estimate the sum of the sizes of the pairs (exact when flattened and committed) */
+    uint64_t fsize;  /* the size of the underlying file                                                */
+    uint64_t ffree; /* Number of free bytes in the underlying file                                    */
+    uint64_t create_time_sec; /* creation time in seconds. */
+    uint64_t modify_time_sec; /* time of last serialization, in seconds. */ 
+    uint64_t verify_time_sec; /* time of last verification, in seconds */
 };
 
 int 
@@ -253,8 +253,8 @@ void toku_ft_suppress_recovery_logs (FT_HANDLE brt, TOKUTXN txn);
 
 int toku_ft_get_fragmentation(FT_HANDLE brt, TOKU_DB_FRAGMENTATION report) __attribute__ ((warn_unused_result));
 
-BOOL toku_ft_is_empty_fast (FT_HANDLE brt) __attribute__ ((warn_unused_result));
-// Effect: Return TRUE if there are no messages or leaf entries in the tree.  If so, it's empty.  If there are messages  or leaf entries, we say it's not empty
+bool toku_ft_is_empty_fast (FT_HANDLE brt) __attribute__ ((warn_unused_result));
+// Effect: Return true if there are no messages or leaf entries in the tree.  If so, it's empty.  If there are messages  or leaf entries, we say it's not empty
 // even though if we were to optimize the tree it might turn out that they are empty.
 
 int toku_ft_strerror_r(int error, char *buf, size_t buflen);
@@ -262,6 +262,6 @@ int toku_ft_strerror_r(int error, char *buf, size_t buflen);
 // If error>=0 then the result is to do strerror_r(error, buf, buflen), that is fill buf with a descriptive error message.
 // If error<0 then return a TokuDB-specific error code.  For unknown cases, we return -1 and set errno=EINVAL, even for cases that *should* be known.  (Not all DB errors are known by this function which is a bug.)
 
-extern BOOL garbage_collection_debug;
+extern bool garbage_collection_debug;
 
 #endif
diff --git a/ft/ft-search.h b/ft/ft-search.h
index bcccb70011f3d36142011e0957deaf293ed43914..f7d44c561e0b7827a4ca7f41694c23646dfb4233 100644
--- a/ft/ft-search.h
+++ b/ft/ft-search.h
@@ -50,7 +50,7 @@ typedef struct ft_search {
     // There also remains a potential thrashing problem.  When we get a TOKUDB_TRY_AGAIN, we unpin everything.  There's
     //   no guarantee that we will get everything pinned again.  We ought to keep nodes pinned when we retry, except that on the
     //   way out with a DB_NOTFOUND we ought to unpin those nodes.  See #3528.
-    BOOL have_pivot_bound;
+    bool have_pivot_bound;
     DBT  pivot_bound;
 } ft_search_t;
 
@@ -60,7 +60,7 @@ static inline ft_search_t *ft_search_init(ft_search_t *so, ft_search_compare_fun
     so->direction = direction;
     so->k = k;
     so->context = context;
-    so->have_pivot_bound = FALSE;
+    so->have_pivot_bound = false;
     return so;
 }
 
diff --git a/ft/ft-serialize.cc b/ft/ft-serialize.cc
index eeba99f79fe3d2de88e1b5f65ccde620db79d194..96b0d87b65eb645c599c0c99e6c87e4478369d7e 100644
--- a/ft/ft-serialize.cc
+++ b/ft/ft-serialize.cc
@@ -20,18 +20,18 @@
 #endif
 
 // not version-sensitive because we only serialize a descriptor using the current layout_version
-u_int32_t
+uint32_t
 toku_serialize_descriptor_size(const DESCRIPTOR desc) {
     //Checksum NOT included in this.  Checksum only exists in header's version.
-    u_int32_t size = 4; // four bytes for size of descriptor
+    uint32_t size = 4; // four bytes for size of descriptor
     size += desc->dbt.size;
     return size;
 }
 
-static u_int32_t
+static uint32_t
 deserialize_descriptor_size(const DESCRIPTOR desc, int layout_version) {
     //Checksum NOT included in this.  Checksum only exists in header's version.
-    u_int32_t size = 4; // four bytes for size of descriptor
+    uint32_t size = 4; // four bytes for size of descriptor
     if (layout_version == FT_LAYOUT_VERSION_13)
         size += 4;   // for version 13, include four bytes of "version"
     size += desc->dbt.size;
@@ -55,7 +55,7 @@ toku_serialize_descriptor_contents_to_fd(int fd, const DESCRIPTOR desc, DISKOFF
     toku_serialize_descriptor_contents_to_wbuf(&w, desc);
     {
         //Add checksum
-        u_int32_t checksum = x1764_finish(&w.checksum);
+        uint32_t checksum = x1764_finish(&w.checksum);
         wbuf_int(&w, checksum);
     }
     lazy_assert(w.ndone==w.size);
@@ -74,7 +74,7 @@ deserialize_descriptor_from_rbuf(struct rbuf *rb, DESCRIPTOR desc, int layout_ve
         (void) rbuf_int(rb);
     }
 
-    u_int32_t size;
+    uint32_t size;
     bytevec data;
     rbuf_bytes(rb, &data, &size);
     bytevec data_copy = data;
@@ -106,9 +106,9 @@ deserialize_descriptor_from(int fd, BLOCK_TABLE bt, DESCRIPTOR desc, int layout_
             }
             {
                 // check the checksum
-                u_int32_t x1764 = x1764_memory(dbuf, size-4);
+                uint32_t x1764 = x1764_memory(dbuf, size-4);
                 //printf("%s:%d read from %ld (x1764 offset=%ld) size=%ld\n", __FILE__, __LINE__, block_translation_address_on_disk, offset, block_translation_size_on_disk);
-                u_int32_t stored_x1764 = toku_dtoh32(*(int*)(dbuf + size-4));
+                uint32_t stored_x1764 = toku_dtoh32(*(int*)(dbuf + size-4));
                 if (x1764 != stored_x1764) {
                     fprintf(stderr, "Descriptor checksum failure: calc=0x%08x read=0x%08x\n", x1764, stored_x1764);
                     r = TOKUDB_BAD_CHECKSUM;
@@ -163,7 +163,7 @@ deserialize_ft_versioned(int fd, struct rbuf *rb, FT *ftp, uint32_t version)
     build_id = rbuf_network_int(rb);
 
     //Size MUST be in network order regardless of disk order.
-    u_int32_t size;
+    uint32_t size;
     size = rbuf_network_int(rb);
     lazy_assert(size == rb->size);
 
@@ -365,9 +365,9 @@ deserialize_ft_versioned(int fd, struct rbuf *rb, FT *ftp, uint32_t version)
     return r;
 }
 
-static u_int32_t
-serialize_ft_min_size (u_int32_t version) {
-    u_int32_t size = 0;
+static uint32_t
+serialize_ft_min_size (uint32_t version) {
+    uint32_t size = 0;
 
 
     switch(version) {
@@ -417,7 +417,7 @@ serialize_ft_min_size (u_int32_t version) {
             );
         break;
     default:
-        lazy_assert(FALSE);
+        lazy_assert(false);
     }
     lazy_assert(size <= BLOCK_ALLOCATOR_HEADER_RESERVE);
     return size;
@@ -432,9 +432,9 @@ int
 deserialize_ft_from_fd_into_rbuf(int fd,
                                  toku_off_t offset_of_header,
                                  struct rbuf *rb,
-                                 u_int64_t *checkpoint_count,
+                                 uint64_t *checkpoint_count,
                                  LSN *checkpoint_lsn,
-                                 u_int32_t * version_p)
+                                 uint32_t * version_p)
 {
     int r = 0;
     const int64_t prefix_size = 8 + // magic ("tokudata")
@@ -461,7 +461,7 @@ deserialize_ft_from_fd_into_rbuf(int fd,
     bytevec magic;
     rbuf_literal_bytes(rb, &magic, 8);
     if (memcmp(magic,"tokudata",8)!=0) {
-        if ((*(u_int64_t*)magic) == 0) {
+        if ((*(uint64_t*)magic) == 0) {
             r = TOKUDB_DICTIONARY_NO_HEADER;
         } else {
             r = EINVAL; //Not a tokudb file! Do not use.
@@ -470,7 +470,7 @@ deserialize_ft_from_fd_into_rbuf(int fd,
     }
 
     //Version MUST be in network order regardless of disk order.
-    u_int32_t version;
+    uint32_t version;
     version = rbuf_network_int(rb);
     *version_p = version;
     if (version < FT_LAYOUT_MIN_SUPPORTED_VERSION) {
@@ -482,13 +482,13 @@ deserialize_ft_from_fd_into_rbuf(int fd,
     }
 
     //build_id MUST be in network order regardless of disk order.
-    u_int32_t build_id __attribute__((__unused__));
+    uint32_t build_id __attribute__((__unused__));
     build_id = rbuf_network_int(rb);
     int64_t min_header_size;
     min_header_size = serialize_ft_min_size(version);
 
     //Size MUST be in network order regardless of disk order.
-    u_int32_t size;
+    uint32_t size;
     size = rbuf_network_int(rb);
     //If too big, it is corrupt.  We would probably notice during checksum
     //but may have to do a multi-gigabyte malloc+read to find out.
@@ -516,9 +516,9 @@ deserialize_ft_from_fd_into_rbuf(int fd,
     //Size is within acceptable bounds.
 
     //Verify checksum (FT_LAYOUT_VERSION_13 or later, when checksum function changed)
-    u_int32_t calculated_x1764;
+    uint32_t calculated_x1764;
     calculated_x1764 = x1764_memory(rb->buf, rb->size-4);
-    u_int32_t stored_x1764;
+    uint32_t stored_x1764;
     stored_x1764 = toku_dtoh32(*(int*)(rb->buf+rb->size-4));
     if (calculated_x1764 != stored_x1764) {
         r = TOKUDB_BAD_CHECKSUM; //Header useless
@@ -563,26 +563,26 @@ toku_deserialize_ft_from(int fd,
 {
     struct rbuf rb_0;
     struct rbuf rb_1;
-    u_int64_t checkpoint_count_0;
-    u_int64_t checkpoint_count_1;
+    uint64_t checkpoint_count_0;
+    uint64_t checkpoint_count_1;
     LSN checkpoint_lsn_0;
     LSN checkpoint_lsn_1;
-    u_int32_t version_0, version_1, version = 0;
-    BOOL h0_acceptable = FALSE;
-    BOOL h1_acceptable = FALSE;
+    uint32_t version_0, version_1, version = 0;
+    bool h0_acceptable = false;
+    bool h1_acceptable = false;
     struct rbuf *rb = NULL;
     int r0, r1, r;
 
     toku_off_t header_0_off = 0;
     r0 = deserialize_ft_from_fd_into_rbuf(fd, header_0_off, &rb_0, &checkpoint_count_0, &checkpoint_lsn_0, &version_0);
     if (r0 == 0 && checkpoint_lsn_0.lsn <= max_acceptable_lsn.lsn) {
-        h0_acceptable = TRUE;
+        h0_acceptable = true;
     }
 
     toku_off_t header_1_off = BLOCK_ALLOCATOR_HEADER_RESERVE;
     r1 = deserialize_ft_from_fd_into_rbuf(fd, header_1_off, &rb_1, &checkpoint_count_1, &checkpoint_lsn_1, &version_1);
     if (r1 == 0 && checkpoint_lsn_1.lsn <= max_acceptable_lsn.lsn) {
-        h1_acceptable = TRUE;
+        h1_acceptable = true;
     }
 
     // if either header is too new, the dictionary is unreadable
@@ -656,7 +656,7 @@ toku_deserialize_ft_from(int fd,
 
 
 int toku_serialize_ft_size (FT_HEADER h) {
-    u_int32_t size = serialize_ft_min_size(h->layout_version);
+    uint32_t size = serialize_ft_min_size(h->layout_version);
     //There is no dynamic data.
     lazy_assert(size <= BLOCK_ALLOCATOR_HEADER_RESERVE);
     return size;
@@ -698,7 +698,7 @@ int toku_serialize_ft_to_wbuf (
     wbuf_MSN(wbuf, h->msn_at_start_of_last_completed_optimize);
     wbuf_char(wbuf, (unsigned char) h->compression_method);
     wbuf_MSN(wbuf, h->highest_unused_msn_for_upgrade);
-    u_int32_t checksum = x1764_finish(&wbuf->checksum);
+    uint32_t checksum = x1764_finish(&wbuf->checksum);
     wbuf_int(wbuf, checksum);
     lazy_assert(wbuf->ndone == wbuf->size);
     return 0;
diff --git a/ft/ft-test-helpers.cc b/ft/ft-test-helpers.cc
index bbbf1595e65ad0078b4249bb7030c98bc72eabef..3e2e85ef51e513b2e9ff324c16eadfc2acbfaa18 100644
--- a/ft/ft-test-helpers.cc
+++ b/ft/ft-test-helpers.cc
@@ -32,7 +32,7 @@ next_dummymsn(void) {
 }
 
 
-BOOL ignore_if_was_already_open;
+bool ignore_if_was_already_open;
 int toku_testsetup_leaf(FT_HANDLE brt, BLOCKNUM *blocknum, int n_children, char **keys, int *keylens) {
     FTNODE node;
     assert(testsetup_initialized);
@@ -93,7 +93,7 @@ int toku_testsetup_get_sersize(FT_HANDLE brt, BLOCKNUM diskoff) // Return the si
         toku_ftnode_fetch_callback,
         toku_ftnode_pf_req_callback,
         toku_ftnode_pf_callback,
-        TRUE,
+        true,
         &bfe
         );
     assert(r==0);
@@ -121,7 +121,7 @@ int toku_testsetup_insert_to_leaf (FT_HANDLE brt, BLOCKNUM blocknum, const char
 	toku_ftnode_fetch_callback,
         toku_ftnode_pf_req_callback,
         toku_ftnode_pf_callback,
-        TRUE,
+        true,
 	&bfe
 	);
     if (r!=0) return r;
@@ -169,7 +169,7 @@ toku_pin_node_with_min_bfe(FTNODE* node, BLOCKNUM b, FT_HANDLE t)
         b,
         toku_cachetable_hash(t->ft->cf, b),
         &bfe,
-        TRUE,
+        true,
         0,
         NULL,
         node
@@ -194,7 +194,7 @@ int toku_testsetup_insert_to_nonleaf (FT_HANDLE brt, BLOCKNUM blocknum, enum ft_
 	toku_ftnode_fetch_callback,
         toku_ftnode_pf_req_callback,
         toku_ftnode_pf_callback,
-        TRUE,
+        true,
 	&bfe
         );
     if (r!=0) return r;
diff --git a/ft/ft-verify.cc b/ft/ft-verify.cc
index 6519694a92c66aa88902b36b85e6fef1a0dc525d..ec1a9dbe81c2b1cfc71f59096d1403d65055a5cf 100644
--- a/ft/ft-verify.cc
+++ b/ft/ft-verify.cc
@@ -159,7 +159,7 @@ static int
 verify_sorted_by_key_msn(FT_HANDLE brt, FIFO fifo, const off_omt_t &mt) {
     int result = 0;
     size_t last_offset = 0;
-    for (u_int32_t i = 0; i < mt.size(); i++) {
+    for (uint32_t i = 0; i < mt.size(); i++) {
         long offset;
         int r = mt.fetch(i, &offset);
         assert_zero(r);
@@ -198,7 +198,7 @@ toku_get_node_for_verify(
     FTNODE* nodep
     )
 {
-    u_int32_t fullhash = toku_cachetable_hash(brt->ft->cf, blocknum);
+    uint32_t fullhash = toku_cachetable_hash(brt->ft->cf, blocknum);
     struct ftnode_fetch_extra bfe;
     fill_bfe_for_full_read(&bfe, brt->ft);
     toku_pin_ftnode_off_client_thread(
@@ -206,7 +206,7 @@ toku_get_node_for_verify(
         blocknum,
         fullhash,
         &bfe,
-        TRUE, // may_modify_node, safe to set to TRUE
+        true, // may_modify_node, safe to set to true
         0,
         NULL,
         nodep
@@ -313,7 +313,7 @@ toku_verify_ftnode (FT_HANDLE brt,
         }
         else {
             BASEMENTNODE bn = BLB(node, i);
-            for (u_int32_t j = 0; j < toku_omt_size(bn->buffer); j++) {
+            for (uint32_t j = 0; j < toku_omt_size(bn->buffer); j++) {
                 VERIFY_ASSERTION((rootmsn.msn >= this_msn.msn), 0, "leaf may have latest msn, but cannot be greater than root msn");
                 LEAFENTRY le = get_ith_leafentry(bn, j);
                 if (curr_less_pivot) {
@@ -375,7 +375,7 @@ toku_verify_ft_with_progress (FT_HANDLE brt, int (*progress_callback)(void *extr
     {
         toku_ft_grab_treelock(brt->ft);
 
-        u_int32_t root_hash;
+        uint32_t root_hash;
         CACHEKEY root_key;
         toku_calculate_root_offset_pointer(brt->ft, &root_key, &root_hash);
         toku_get_node_for_verify(root_key, brt, &root_node);
diff --git a/ft/ft.cc b/ft/ft.cc
index 7e92378883c99c61fefd51abc4d7b9d44ac68c1a..0a743473886408bd4f16a7fc01d0d00b48b99e7d 100644
--- a/ft/ft.cc
+++ b/ft/ft.cc
@@ -265,7 +265,7 @@ ft_end_checkpoint (CACHEFILE UU(cachefile), int fd, void *header_v) {
 // maps to cf->close_userdata
 // Has access to fd (it is protected).
 static int
-ft_close (CACHEFILE cachefile, int fd, void *header_v, char **malloced_error_string, BOOL oplsn_valid, LSN oplsn) {
+ft_close (CACHEFILE cachefile, int fd, void *header_v, char **malloced_error_string, bool oplsn_valid, LSN oplsn) {
     FT ft = (FT) header_v;
     assert(ft->h->type == FT_CURRENT);
     // We already have exclusive access to this field already, so skip the locking.
@@ -369,7 +369,7 @@ static int setup_initial_ft_root_node (FT ft, BLOCKNUM blocknum) {
     toku_initialize_empty_ftnode(node, blocknum, 0, 1, ft->h->layout_version, ft->h->nodesize, ft->h->flags);
     BP_STATE(node,0) = PT_AVAIL;
 
-    u_int32_t fullhash = toku_cachetable_hash(ft->cf, blocknum);
+    uint32_t fullhash = toku_cachetable_hash(ft->cf, blocknum);
     node->fullhash = fullhash;
     int r = toku_cachetable_put(ft->cf, blocknum, fullhash,
                                 node, make_ftnode_pair_attr(node),
@@ -493,7 +493,7 @@ toku_create_new_ft(FT *ftp, FT_OPTIONS options, CACHEFILE cf, TOKUTXN txn) {
 }
 
 // TODO: (Zardosht) get rid of brt parameter
-int toku_read_ft_and_store_in_cachefile (FT_HANDLE brt, CACHEFILE cf, LSN max_acceptable_lsn, FT *header, BOOL* was_open)
+int toku_read_ft_and_store_in_cachefile (FT_HANDLE brt, CACHEFILE cf, LSN max_acceptable_lsn, FT *header, bool* was_open)
 // If the cachefile already has the header, then just get it.
 // If the cachefile has not been initialized, then don't modify anything.
 // max_acceptable_lsn is the latest acceptable checkpointed version of the file.
@@ -502,13 +502,13 @@ int toku_read_ft_and_store_in_cachefile (FT_HANDLE brt, CACHEFILE cf, LSN max_ac
         FT h;
         if ((h = (FT) toku_cachefile_get_userdata(cf))!=0) {
             *header = h;
-            *was_open = TRUE;
+            *was_open = true;
             assert(brt->options.update_fun == h->update_fun);
             assert(brt->options.compare_fun == h->compare_fun);
             return 0;
         }
     }
-    *was_open = FALSE;
+    *was_open = false;
     FT h;
     int r;
     {
@@ -550,7 +550,7 @@ toku_ft_note_ft_handle_open(FT ft, FT_HANDLE live) {
 // pinned by a checkpoint.
 static int
 ft_get_reference_count(FT ft) {
-    u_int32_t pinned_by_checkpoint = ft->pinned_by_checkpoint ? 1 : 0;
+    uint32_t pinned_by_checkpoint = ft->pinned_by_checkpoint ? 1 : 0;
     int num_handles = toku_list_num_elements_est(&ft->live_ft_handles);
     return pinned_by_checkpoint + ft->num_txns + num_handles;
 }
@@ -569,7 +569,7 @@ toku_ft_has_one_reference_unlocked(FT ft) {
 
 // evict a ft from memory by closing its cachefile. any future work
 // will have to read in the ft in a new cachefile and new FT object.
-int toku_ft_evict_from_memory(FT ft, char **error_string, BOOL oplsn_valid, LSN oplsn) {
+int toku_ft_evict_from_memory(FT ft, char **error_string, bool oplsn_valid, LSN oplsn) {
     int r = 0;
     assert(ft->cf);
     if (error_string) {
@@ -614,7 +614,7 @@ toku_ft_note_hot_begin(FT_HANDLE brt) {
 // Purpose: set fields in brt_header to capture accountability info for end of HOT optimize.
 // Note: See note for toku_ft_note_hot_begin().
 void
-toku_ft_note_hot_complete(FT_HANDLE brt, BOOL success, MSN msn_at_start_of_hot) {
+toku_ft_note_hot_complete(FT_HANDLE brt, bool success, MSN msn_at_start_of_hot) {
     FT ft = brt->ft;
     time_t now = time(NULL);
 
@@ -863,7 +863,7 @@ toku_ft_remove_txn_ref(FT ft) {
 void toku_calculate_root_offset_pointer (
     FT ft, 
     CACHEKEY* root_key, 
-    u_int32_t *roothash
+    uint32_t *roothash
     ) 
 {
     *roothash = toku_cachetable_hash(ft->cf, ft->h->root_blocknum);
diff --git a/ft/ft.h b/ft/ft.h
index 2c831fe0550cc0605039e11ab726fcba6a6ff4a9..e123c4c90a4eafede183a4f48888b5af2ac58a10 100644
--- a/ft/ft.h
+++ b/ft/ft.h
@@ -36,7 +36,7 @@ void toku_ft_release_reflock(FT ft);
 int toku_create_new_ft(FT *ftp, FT_OPTIONS options, CACHEFILE cf, TOKUTXN txn);
 void toku_ft_free (FT h);
 
-int toku_read_ft_and_store_in_cachefile (FT_HANDLE brt, CACHEFILE cf, LSN max_acceptable_lsn, FT *header, BOOL* was_open);
+int toku_read_ft_and_store_in_cachefile (FT_HANDLE brt, CACHEFILE cf, LSN max_acceptable_lsn, FT *header, bool* was_open);
 void toku_ft_note_ft_handle_open(FT ft, FT_HANDLE live);
 
 bool toku_ft_needed_unlocked(FT ft);
@@ -44,12 +44,12 @@ bool toku_ft_has_one_reference_unlocked(FT ft);
 
 // evict a ft from memory by closing its cachefile. any future work
 // will have to read in the ft in a new cachefile and new FT object.
-int toku_ft_evict_from_memory(FT ft, char **error_string, BOOL oplsn_valid, LSN oplsn)  __attribute__ ((warn_unused_result));
+int toku_ft_evict_from_memory(FT ft, char **error_string, bool oplsn_valid, LSN oplsn)  __attribute__ ((warn_unused_result));
 
 FT_HANDLE toku_ft_get_only_existing_ft_handle(FT h);
 
 void toku_ft_note_hot_begin(FT_HANDLE brt);
-void toku_ft_note_hot_complete(FT_HANDLE brt, BOOL success, MSN msn_at_start_of_hot);
+void toku_ft_note_hot_complete(FT_HANDLE brt, bool success, MSN msn_at_start_of_hot);
 
 void
 toku_ft_init(
@@ -71,7 +71,7 @@ void toku_reset_root_xid_that_created(FT h, TXNID new_root_xid_that_created);
 void toku_ft_add_txn_ref(FT h);
 void toku_ft_remove_txn_ref(FT h);
 
-void toku_calculate_root_offset_pointer ( FT h, CACHEKEY* root_key, u_int32_t *roothash);
+void toku_calculate_root_offset_pointer ( FT h, CACHEKEY* root_key, uint32_t *roothash);
 void toku_ft_set_new_root_blocknum(FT h, CACHEKEY new_root_key); 
 LSN toku_ft_checkpoint_lsn(FT h)  __attribute__ ((warn_unused_result));
 int toku_ft_set_panic(FT h, int panic, const char *panic_string) __attribute__ ((warn_unused_result));
diff --git a/ft/ft_msg.cc b/ft/ft_msg.cc
index 976a08d4a8bca9bfd5c40a43509d254d4f6fc213..8589bc38e71b969b06ea9d1ee792f610c55f5a29 100644
--- a/ft/ft_msg.cc
+++ b/ft/ft_msg.cc
@@ -10,15 +10,15 @@
 #include "ft_msg.h"
 
 
-u_int32_t 
+uint32_t 
 ft_msg_get_keylen(FT_MSG ft_msg) {
-    u_int32_t rval = ft_msg->u.id.key->size;
+    uint32_t rval = ft_msg->u.id.key->size;
     return rval;
 }
 
-u_int32_t 
+uint32_t 
 ft_msg_get_vallen(FT_MSG ft_msg) {
-    u_int32_t rval = ft_msg->u.id.val->size;
+    uint32_t rval = ft_msg->u.id.val->size;
     return rval;
 }
 
diff --git a/ft/ft_msg.h b/ft/ft_msg.h
index 39f4e924245d8660552008a57e0d26e8cd73573b..dfa937688bc97841bcd1bf179510c0e5e61c43d0 100644
--- a/ft/ft_msg.h
+++ b/ft/ft_msg.h
@@ -13,9 +13,9 @@
 #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
 
 
-u_int32_t ft_msg_get_keylen(FT_MSG ft_msg);
+uint32_t ft_msg_get_keylen(FT_MSG ft_msg);
 
-u_int32_t ft_msg_get_vallen(FT_MSG ft_msg);
+uint32_t ft_msg_get_vallen(FT_MSG ft_msg);
 
 XIDS ft_msg_get_xids(FT_MSG ft_msg);
 
diff --git a/ft/ft_node-serialize.cc b/ft/ft_node-serialize.cc
index a3729efc79351c1933a016ae7eedd836faa9d8ba..e7096e2ae9b07d10a7112196d065fc5be9934eef 100644
--- a/ft/ft_node-serialize.cc
+++ b/ft/ft_node-serialize.cc
@@ -178,9 +178,9 @@ enum {
     uncompressed_version_offset = 8,
 };
 
-static u_int32_t
+static uint32_t
 serialize_node_header_size(FTNODE node) {
-    u_int32_t retval = 0;
+    uint32_t retval = 0;
     retval += 8; // magic
     retval += sizeof(node->layout_version);
     retval += sizeof(node->layout_version_original);
@@ -208,7 +208,7 @@ serialize_node_header(FTNODE node, FTNODE_DISK_DATA ndd, struct wbuf *wbuf) {
         wbuf_nocrc_int(wbuf, BP_SIZE (ndd, i));         // and the size
     }
     // checksum the header
-    u_int32_t end_to_end_checksum = x1764_memory(wbuf->buf, wbuf_get_woffset(wbuf));
+    uint32_t end_to_end_checksum = x1764_memory(wbuf->buf, wbuf_get_woffset(wbuf));
     wbuf_nocrc_int(wbuf, end_to_end_checksum);
     invariant(wbuf->ndone == wbuf->size);
 }
@@ -221,10 +221,10 @@ wbufwriteleafentry(OMTVALUE lev, const uint32_t UU(idx), void *wbv) {
     return 0;
 }
 
-static u_int32_t 
+static uint32_t 
 serialize_ftnode_partition_size (FTNODE node, int i)
 {
-    u_int32_t result = 0;
+    uint32_t result = 0;
     assert(node->bp[i].state == PT_AVAIL);
     result++; // Byte that states what the partition is
     if (node->height > 0) {
@@ -293,7 +293,7 @@ serialize_ftnode_partition(FTNODE node, int i, struct sub_block *sb) {
         //
         toku_omt_iterate(buffer, wbufwriteleafentry, &wb);
     }
-    u_int32_t end_to_end_checksum = x1764_memory(sb->uncompressed_ptr, wbuf_get_woffset(&wb));
+    uint32_t end_to_end_checksum = x1764_memory(sb->uncompressed_ptr, wbuf_get_woffset(&wb));
     wbuf_nocrc_int(&wb, end_to_end_checksum);
     invariant(wb.ndone == wb.size);
     invariant(sb->uncompressed_size==wb.ndone);
@@ -331,7 +331,7 @@ compress_ftnode_sub_block(struct sub_block *sb, enum toku_compression_method met
         method
         );
 
-    u_int32_t* extra = (u_int32_t *)(sb->compressed_ptr);
+    uint32_t* extra = (uint32_t *)(sb->compressed_ptr);
     // store the compressed and uncompressed size at the beginning
     extra[0] = toku_htod32(sb->compressed_size);
     extra[1] = toku_htod32(sb->uncompressed_size);
@@ -357,10 +357,10 @@ compress_ftnode_sub_block(struct sub_block *sb, enum toku_compression_method met
 // such as the magic, layout_version, and build_id
 // Includes only node specific info such as pivot information, n_children, and so on
 //
-static u_int32_t
+static uint32_t
 serialize_ftnode_info_size(FTNODE node)
 {
-    u_int32_t retval = 0;
+    uint32_t retval = 0;
     retval += 8; // max_msn_applied_to_node_on_disk
     retval += 4; // nodesize
     retval += 4; // flags
@@ -400,7 +400,7 @@ static void serialize_ftnode_info(FTNODE node,
         }
     }
 
-    u_int32_t end_to_end_checksum = x1764_memory(sb->uncompressed_ptr, wbuf_get_woffset(&wb));
+    uint32_t end_to_end_checksum = x1764_memory(sb->uncompressed_ptr, wbuf_get_woffset(&wb));
     wbuf_nocrc_int(&wb, end_to_end_checksum);
     invariant(wb.ndone == wb.size);
     invariant(sb->uncompressed_size==wb.ndone);
@@ -425,7 +425,7 @@ toku_serialize_ftnode_size (FTNODE node) {
 }
 
 struct array_info {
-    u_int32_t offset;
+    uint32_t offset;
     OMTVALUE* array;
 };
 
@@ -442,7 +442,7 @@ struct sum_info {
 };
 
 static int
-sum_item (OMTVALUE lev, u_int32_t UU(idx), void *vsi) {
+sum_item (OMTVALUE lev, uint32_t UU(idx), void *vsi) {
     LEAFENTRY le = (LEAFENTRY) lev;
     struct sum_info *si = (struct sum_info *) vsi;
     si->count++;
@@ -463,7 +463,7 @@ rebalance_ftnode_leaf(FTNODE node, unsigned int basementnodesize)
 
     uint32_t num_orig_basements = node->n_children;
     // Count number of leaf entries in this leaf (num_le).
-    u_int32_t num_le = 0;  
+    uint32_t num_le = 0;  
     for (uint32_t i = 0; i < num_orig_basements; i++) {
         num_le += toku_omt_size(BLB_BUFFER(node, i));
     }
@@ -478,7 +478,7 @@ rebalance_ftnode_leaf(FTNODE node, unsigned int basementnodesize)
     // Capture pointers to old mempools' buffers (so they can be destroyed)
     void **XMALLOC_N(num_orig_basements, old_mempool_bases);
 
-    u_int32_t curr_le = 0;
+    uint32_t curr_le = 0;
     for (uint32_t i = 0; i < num_orig_basements; i++) {
         OMT curr_omt = BLB_BUFFER(node, i);
         struct array_info ai;
@@ -493,7 +493,7 @@ rebalance_ftnode_leaf(FTNODE node, unsigned int basementnodesize)
     // Create an array that will store indexes of new pivots.
     // Each element in new_pivots is the index of a pivot key.
     // (Allocating num_le of them is overkill, but num_le is an upper bound.)
-    u_int32_t *XMALLOC_N(num_alloc, new_pivots);
+    uint32_t *XMALLOC_N(num_alloc, new_pivots);
     new_pivots[0] = 0;
 
     // Each element in le_sizes is the size of the leafentry pointed to by leafpointers.
@@ -514,11 +514,11 @@ rebalance_ftnode_leaf(FTNODE node, unsigned int basementnodesize)
     // Figure out the new pivots.  
     // We need the index of each pivot, and for each basement we need
     // the number of leaves and the sum of the sizes of the leaves (memory requirement for basement).
-    u_int32_t curr_pivot = 0;
-    u_int32_t num_le_in_curr_bn = 0;
-    u_int32_t bn_size_so_far = 0;
-    for (u_int32_t i = 0; i < num_le; i++) {
-        u_int32_t curr_le_size = leafentry_disksize((LEAFENTRY) leafpointers[i]);
+    uint32_t curr_pivot = 0;
+    uint32_t num_le_in_curr_bn = 0;
+    uint32_t bn_size_so_far = 0;
+    for (uint32_t i = 0; i < num_le; i++) {
+        uint32_t curr_le_size = leafentry_disksize((LEAFENTRY) leafpointers[i]);
         le_sizes[i] = curr_le_size;
         if ((bn_size_so_far + curr_le_size > basementnodesize) && (num_le_in_curr_bn != 0)) {
             // cap off the current basement node to end with the element before i
@@ -542,7 +542,7 @@ rebalance_ftnode_leaf(FTNODE node, unsigned int basementnodesize)
     // Need to figure out how to properly deal with seqinsert.
     // I am not happy with how this is being
     // handled with basement nodes
-    u_int32_t tmp_seqinsert = BLB_SEQINSERT(node, num_orig_basements - 1);
+    uint32_t tmp_seqinsert = BLB_SEQINSERT(node, num_orig_basements - 1);
 
     // choose the max msn applied to any basement as the max msn applied to all new basements
     MSN max_msn = ZERO_MSN;
@@ -586,9 +586,9 @@ rebalance_ftnode_leaf(FTNODE node, unsigned int basementnodesize)
         BLB_SEQINSERT(node, i) = tmp_seqinsert;
 
         // create start (inclusive) and end (exclusive) boundaries for data of basement node
-        u_int32_t curr_start = (i==0) ? 0 : new_pivots[i-1]+1;               // index of first leaf in basement
-        u_int32_t curr_end = (i==num_pivots) ? num_le : new_pivots[i]+1;     // index of first leaf in next basement
-        u_int32_t num_in_bn = curr_end - curr_start;                         // number of leaves in this basement
+        uint32_t curr_start = (i==0) ? 0 : new_pivots[i-1]+1;               // index of first leaf in basement
+        uint32_t curr_end = (i==num_pivots) ? num_le : new_pivots[i]+1;     // index of first leaf in next basement
+        uint32_t num_in_bn = curr_end - curr_start;                         // number of leaves in this basement
 
         // create indexes for new basement
         invariant(baseindex_this_bn == curr_start);
@@ -669,7 +669,7 @@ toku_create_compressed_partition_from_available(
     // to just the amount of the actual compressed data. So, we create a new buffer and copy
     // just the compressed data.
     //
-    u_int32_t compressed_size = toku_dtoh32(*(u_int32_t *)sb->compressed_ptr);
+    uint32_t compressed_size = toku_dtoh32(*(uint32_t *)sb->compressed_ptr);
     void* compressed_data = toku_xmalloc(compressed_size);
     memcpy(compressed_data, (char *)sb->compressed_ptr + 8, compressed_size);
     toku_free(sb->compressed_ptr);
@@ -760,8 +760,8 @@ toku_serialize_ftnode_to_memory (FTNODE node,
                                   FTNODE_DISK_DATA* ndd,
                                   unsigned int basementnodesize,
                                   enum toku_compression_method compression_method,
-                                  BOOL do_rebalancing,
-                                  BOOL in_parallel, // for loader is TRUE, for toku_ftnode_flush_callback, is false
+                                  bool do_rebalancing,
+                                  bool in_parallel, // for loader is true, for toku_ftnode_flush_callback, is false
                           /*out*/ size_t *n_bytes_to_write,
                           /*out*/ char  **bytes_to_write)
 {
@@ -805,12 +805,12 @@ toku_serialize_ftnode_to_memory (FTNODE node,
 
     // The total size of the node is:
     // size of header + disk size of the n+1 sub_block's created above
-    u_int32_t total_node_size = (serialize_node_header_size(node) // uncomrpessed header
+    uint32_t total_node_size = (serialize_node_header_size(node) // uncomrpessed header
                                  + sb_node_info.compressed_size   // compressed nodeinfo (without its checksum)
                                  + 4);                            // nodinefo's checksum
     // store the BP_SIZESs
     for (int i = 0; i < node->n_children; i++) {
-        u_int32_t len         = sb[i].compressed_size + 4; // data and checksum
+        uint32_t len         = sb[i].compressed_size + 4; // data and checksum
         BP_SIZE (*ndd,i) = len;
         BP_START(*ndd,i) = total_node_size;
         total_node_size += sb[i].compressed_size + 4;
@@ -831,14 +831,14 @@ toku_serialize_ftnode_to_memory (FTNODE node,
     memcpy(curr_ptr, sb_node_info.compressed_ptr, sb_node_info.compressed_size);
     curr_ptr += sb_node_info.compressed_size;
     // write the checksum
-    *(u_int32_t *)curr_ptr = toku_htod32(sb_node_info.xsum);
+    *(uint32_t *)curr_ptr = toku_htod32(sb_node_info.xsum);
     curr_ptr += sizeof(sb_node_info.xsum);
 
     for (int i = 0; i < npartitions; i++) {
         memcpy(curr_ptr, sb[i].compressed_ptr, sb[i].compressed_size);
         curr_ptr += sb[i].compressed_size;
         // write the checksum
-        *(u_int32_t *)curr_ptr = toku_htod32(sb[i].xsum);
+        *(uint32_t *)curr_ptr = toku_htod32(sb[i].xsum);
         curr_ptr += sizeof(sb[i].xsum);
     }
     assert(curr_ptr - data == total_node_size);
@@ -861,13 +861,13 @@ toku_serialize_ftnode_to_memory (FTNODE node,
 }
 
 int
-toku_serialize_ftnode_to (int fd, BLOCKNUM blocknum, FTNODE node, FTNODE_DISK_DATA* ndd, BOOL do_rebalancing, FT h, BOOL for_checkpoint) {
+toku_serialize_ftnode_to (int fd, BLOCKNUM blocknum, FTNODE node, FTNODE_DISK_DATA* ndd, bool do_rebalancing, FT h, bool for_checkpoint) {
 
     size_t n_to_write;
     char *compressed_buf = NULL;
     {
         // because toku_serialize_ftnode_to is only called for 
-        // in toku_ftnode_flush_callback, we pass FALSE
+        // in toku_ftnode_flush_callback, we pass false
         // for in_parallel. The reasoning is that when we write
         // nodes to disk via toku_ftnode_flush_callback, we 
         // assume that it is being done on a non-critical
@@ -875,7 +875,7 @@ toku_serialize_ftnode_to (int fd, BLOCKNUM blocknum, FTNODE node, FTNODE_DISK_DA
         // should not hog CPU,
         //
         // Should the above facts change, we may want to revisit
-        // passing FALSE for in_parallel here
+        // passing false for in_parallel here
         //
         // alternatively, we could have made in_parallel a parameter
         // for toku_serialize_ftnode_to, but instead we did this.
@@ -885,7 +885,7 @@ toku_serialize_ftnode_to (int fd, BLOCKNUM blocknum, FTNODE node, FTNODE_DISK_DA
             h->h->basementnodesize,
             h->h->compression_method,
             do_rebalancing,
-            FALSE, // in_parallel
+            false, // in_parallel
             &n_to_write,
             &compressed_buf
             );
@@ -954,7 +954,7 @@ deserialize_child_buffer(NONLEAF_CHILDINFO bnc, struct rbuf *rbuf,
                 dest = &broadcast_offsets[nbroadcast_offsets];
                 nbroadcast_offsets++;
             } else {
-                assert(FALSE);
+                assert(false);
             }
         } else {
             dest = NULL;
@@ -984,12 +984,12 @@ deserialize_child_buffer(NONLEAF_CHILDINFO bnc, struct rbuf *rbuf,
 // dump a buffer to stderr
 // no locking around this for now
 static void
-dump_bad_block(unsigned char *vp, u_int64_t size) {
-    const u_int64_t linesize = 64;
-    u_int64_t n = size / linesize;
-    for (u_int64_t i = 0; i < n; i++) {
+dump_bad_block(unsigned char *vp, uint64_t size) {
+    const uint64_t linesize = 64;
+    uint64_t n = size / linesize;
+    for (uint64_t i = 0; i < n; i++) {
         fprintf(stderr, "%p: ", vp);
-        for (u_int64_t j = 0; j < linesize; j++) {
+        for (uint64_t j = 0; j < linesize; j++) {
             unsigned char c = vp[j];
             fprintf(stderr, "%2.2X", c);
         }
@@ -997,7 +997,7 @@ dump_bad_block(unsigned char *vp, u_int64_t size) {
         vp += linesize;
     }
     size = size % linesize;
-    for (u_int64_t i=0; i<size; i++) {
+    for (uint64_t i=0; i<size; i++) {
         if ((i % linesize) == 0)
             fprintf(stderr, "%p: ", vp+i);
         fprintf(stderr, "%2.2X", vp[i]);
@@ -1030,7 +1030,7 @@ struct mp_pair {
     OMT omt;
 };
 
-static int fix_mp_offset(OMTVALUE v, u_int32_t i, void* extra) {
+static int fix_mp_offset(OMTVALUE v, uint32_t i, void* extra) {
     struct mp_pair *CAST_FROM_VOIDP(p, extra);
     char* old_value = (char *) v;
     char *new_value = old_value - (char *)p->orig_base + (char *)p->new_base;
@@ -1125,7 +1125,7 @@ read_block_from_fd_into_rbuf(
     // get the file offset and block size for the block
     DISKOFF offset, size;
     toku_translate_blocknum_to_offset_size(h->blocktable, blocknum, &offset, &size);
-    u_int8_t *XMALLOC_N(size, raw_block);
+    uint8_t *XMALLOC_N(size, raw_block);
     rbuf_init(rb, raw_block, size);
     {
         // read the block
@@ -1147,7 +1147,7 @@ static void read_ftnode_header_from_fd_into_rbuf_if_small_enough (int fd, BLOCKN
     DISKOFF offset, size;
     toku_translate_blocknum_to_offset_size(h->blocktable, blocknum, &offset, &size);
     DISKOFF read_size = MIN(read_header_heuristic_max, size);
-    u_int8_t *XMALLOC_N(size, raw_block);
+    uint8_t *XMALLOC_N(size, raw_block);
     rbuf_init(rb, raw_block, read_size);
     {
         // read the block
@@ -1172,7 +1172,7 @@ read_compressed_sub_block(struct rbuf *rb, struct sub_block *sb)
     rbuf_literal_bytes(rb, cp, sb->compressed_size);
     sb->xsum = rbuf_int(rb);
     // let's check the checksum
-    u_int32_t actual_xsum = x1764_memory((char *)sb->compressed_ptr-8, 8+sb->compressed_size);
+    uint32_t actual_xsum = x1764_memory((char *)sb->compressed_ptr-8, 8+sb->compressed_size);
     if (sb->xsum != actual_xsum) {
         r = TOKUDB_BAD_CHECKSUM;
     }
@@ -1224,9 +1224,9 @@ verify_ftnode_sub_block (struct sub_block *sb)
 {
     int r = 0;
     // first verify the checksum
-    u_int32_t data_size = sb->uncompressed_size - 4; // checksum is 4 bytes at end
-    u_int32_t stored_xsum = toku_dtoh32(*((u_int32_t *)((char *)sb->uncompressed_ptr + data_size)));
-    u_int32_t actual_xsum = x1764_memory(sb->uncompressed_ptr, data_size);
+    uint32_t data_size = sb->uncompressed_size - 4; // checksum is 4 bytes at end
+    uint32_t stored_xsum = toku_dtoh32(*((uint32_t *)((char *)sb->uncompressed_ptr + data_size)));
+    uint32_t actual_xsum = x1764_memory(sb->uncompressed_ptr, data_size);
     if (stored_xsum != actual_xsum) {
         dump_bad_block((Bytef *) sb->uncompressed_ptr, sb->uncompressed_size);
         r = TOKUDB_BAD_CHECKSUM;
@@ -1251,7 +1251,7 @@ deserialize_ftnode_info(
         goto exit;
     }
 
-    u_int32_t data_size;
+    uint32_t data_size;
     data_size = sb->uncompressed_size - 4; // checksum is 4 bytes at end
 
     // now with the data verified, we can read the information into the node
@@ -1305,7 +1305,7 @@ deserialize_ftnode_info(
     // make sure that all the data was read
     if (data_size != rb.ndone) {
         dump_bad_block(rb.buf, rb.size);
-        assert(FALSE);
+        assert(false);
     }
 exit:
     return r;
@@ -1390,7 +1390,7 @@ setup_partitions_using_bfe(FTNODE node,
         case PT_INVALID:
             break;
         }
-        assert(FALSE);
+        assert(false);
     }
 }
 
@@ -1428,7 +1428,7 @@ deserialize_ftnode_partition(
     if (r != 0) {
         goto exit;
     }
-    u_int32_t data_size;
+    uint32_t data_size;
     data_size = sb->uncompressed_size - 4; // checksum is 4 bytes at end
 
     // now with the data verified, we can read the information into the node
@@ -1457,14 +1457,14 @@ deserialize_ftnode_partition(
 	BASEMENTNODE bn = BLB(node, childnum);
 	toku_mempool_copy_construct(&bn->buffer_mempool, &rb.buf[rb.ndone], data_size);
 	uint8_t *CAST_FROM_VOIDP(le_base, toku_mempool_get_base(&bn->buffer_mempool));   // point to first le in mempool
-        for (u_int32_t i = 0; i < num_entries; i++) {                     // now set up the pointers in the omt
+        for (uint32_t i = 0; i < num_entries; i++) {                     // now set up the pointers in the omt
             LEAFENTRY le = reinterpret_cast<LEAFENTRY>(&le_base[rb.ndone - start_of_data]); // point to durable mempool, not to transient rbuf
             uint32_t disksize = leafentry_disksize(le);
             rb.ndone += disksize;
             invariant(rb.ndone<=rb.size);
             array[i] = le;
         }
-        u_int32_t end_of_data = rb.ndone;
+        uint32_t end_of_data = rb.ndone;
 
         BLB_NBYTESINBUF(node, childnum) += end_of_data-start_of_data;
 
@@ -1516,7 +1516,7 @@ static int
 deserialize_ftnode_header_from_rbuf_if_small_enough (FTNODE *ftnode,
                                                       FTNODE_DISK_DATA* ndd, 
                                                       BLOCKNUM blocknum,
-                                                      u_int32_t fullhash,
+                                                      uint32_t fullhash,
                                                       struct ftnode_fetch_extra *bfe,
                                                       struct rbuf *rb,
                                                       int fd)
@@ -1587,9 +1587,9 @@ deserialize_ftnode_header_from_rbuf_if_small_enough (FTNODE *ftnode,
         BP_SIZE (*ndd,i) = rbuf_int(rb);
     }
 
-    u_int32_t checksum;
+    uint32_t checksum;
     checksum = x1764_memory(rb->buf, rb->ndone);
-    u_int32_t stored_checksum;
+    uint32_t stored_checksum;
     stored_checksum = rbuf_int(rb);
     if (stored_checksum != checksum) {
         dump_bad_block(rb->buf, rb->size);
@@ -1615,7 +1615,7 @@ deserialize_ftnode_header_from_rbuf_if_small_enough (FTNODE *ftnode,
     rbuf_literal_bytes(rb, cp, sb_node_info.compressed_size);
     sb_node_info.xsum = rbuf_int(rb);
     // let's check the checksum
-    u_int32_t actual_xsum;
+    uint32_t actual_xsum;
     actual_xsum = x1764_memory((char *)sb_node_info.compressed_ptr-8, 8+sb_node_info.compressed_size);
     if (sb_node_info.xsum != actual_xsum) {
         r = TOKUDB_BAD_CHECKSUM;
@@ -1804,7 +1804,7 @@ deserialize_and_upgrade_internal_node(FTNODE node,
         // Atomically decrement the header's MSN count by the number
         // of messages in the buffer.
         MSN lowest;
-        u_int64_t amount = n_in_this_buffer;
+        uint64_t amount = n_in_this_buffer;
         lowest.msn = __sync_sub_and_fetch(&bfe->h->h->highest_unused_msn_for_upgrade.msn, amount);
         if (highest_msn.msn == 0) {
             highest_msn.msn = lowest.msn + n_in_this_buffer;
@@ -1876,8 +1876,8 @@ deserialize_and_upgrade_internal_node(FTNODE node,
     // Must compute the checksum now (rather than at the end, while we
     // still have the pointer to the buffer).
     if (version >= FT_FIRST_LAYOUT_VERSION_WITH_END_TO_END_CHECKSUM) {
-        u_int32_t expected_xsum = toku_dtoh32(*(u_int32_t*)(rb->buf+rb->size-4));
-        u_int32_t actual_xsum   = x1764_memory(rb->buf, rb->size-4);
+        uint32_t expected_xsum = toku_dtoh32(*(uint32_t*)(rb->buf+rb->size-4));
+        uint32_t actual_xsum   = x1764_memory(rb->buf, rb->size-4);
         if (expected_xsum != actual_xsum) {
             fprintf(stderr, "%s:%d: Bad checksum: expected = %" PRIx32 ", actual= %" PRIx32 "\n",
                     __FUNCTION__,
@@ -2046,8 +2046,8 @@ deserialize_and_upgrade_leaf_node(FTNODE node,
 
     // 14. Checksum (end to end) is only on version 14
     if (version >= FT_FIRST_LAYOUT_VERSION_WITH_END_TO_END_CHECKSUM) {
-        u_int32_t expected_xsum = rbuf_int(rb);
-        u_int32_t actual_xsum = x1764_memory(rb->buf, rb->size - 4);
+        uint32_t expected_xsum = rbuf_int(rb);
+        uint32_t actual_xsum = x1764_memory(rb->buf, rb->size - 4);
         if (expected_xsum != actual_xsum) {
             fprintf(stderr, "%s:%d: Bad checksum: expected = %" PRIx32 ", actual= %" PRIx32 "\n",
                     __FUNCTION__,
@@ -2167,7 +2167,7 @@ deserialize_ftnode_from_rbuf(
     FTNODE *ftnode,
     FTNODE_DISK_DATA* ndd,
     BLOCKNUM blocknum,
-    u_int32_t fullhash,
+    uint32_t fullhash,
     struct ftnode_fetch_extra* bfe,
     STAT64INFO info,
     struct rbuf *rb,
@@ -2233,9 +2233,9 @@ deserialize_ftnode_from_rbuf(
         BP_SIZE (*ndd,i) = rbuf_int(rb);
     }
     // verify checksum of header stored
-    u_int32_t checksum;
+    uint32_t checksum;
     checksum = x1764_memory(rb->buf, rb->ndone);
-    u_int32_t stored_checksum;
+    uint32_t stored_checksum;
     stored_checksum = rbuf_int(rb);
     if (stored_checksum != checksum) {
         dump_bad_block(rb->buf, rb->size);
@@ -2268,8 +2268,8 @@ deserialize_ftnode_from_rbuf(
     // Previously, this code was a for loop with spawns inside and a sync at the end.
     // But now the loop is parallelizeable since we don't have a dependency on the work done so far.
     cilk_for (int i = 0; i < node->n_children; i++) {
-        u_int32_t curr_offset = BP_START(*ndd,i);
-        u_int32_t curr_size   = BP_SIZE(*ndd,i);
+        uint32_t curr_offset = BP_START(*ndd,i);
+        uint32_t curr_size   = BP_SIZE(*ndd,i);
         // the compressed, serialized partitions start at where rb is currently pointing,
         // which would be rb->buf + rb->ndone
         // we need to intialize curr_rbuf to point to this place
@@ -2358,11 +2358,11 @@ toku_deserialize_bp_from_disk(FTNODE node, FTNODE_DISK_DATA ndd, int childnum, i
         &total_node_disk_size
         );
 
-    u_int32_t curr_offset = BP_START(ndd, childnum);
-    u_int32_t curr_size   = BP_SIZE (ndd, childnum);
+    uint32_t curr_offset = BP_START(ndd, childnum);
+    uint32_t curr_size   = BP_SIZE (ndd, childnum);
     struct rbuf rb = {.buf = NULL, .size = 0, .ndone = 0};
 
-    u_int8_t *XMALLOC_N(curr_size, raw_block);
+    uint8_t *XMALLOC_N(curr_size, raw_block);
     rbuf_init(&rb, raw_block, curr_size);
     {
         // read the block
@@ -2416,7 +2416,7 @@ toku_deserialize_bp_from_compressed(FTNODE node, int childnum,
 static int
 deserialize_ftnode_from_fd(int fd,
                             BLOCKNUM blocknum,
-                            u_int32_t fullhash,
+                            uint32_t fullhash,
                             FTNODE *ftnode,
                             FTNODE_DISK_DATA *ndd,
                             struct ftnode_fetch_extra *bfe,
@@ -2442,7 +2442,7 @@ deserialize_ftnode_from_fd(int fd,
 int
 toku_deserialize_ftnode_from (int fd,
                                BLOCKNUM blocknum,
-                               u_int32_t fullhash,
+                               uint32_t fullhash,
                                FTNODE *ftnode,
                                FTNODE_DISK_DATA* ndd,
                                struct ftnode_fetch_extra* bfe
@@ -2620,7 +2620,7 @@ toku_serialize_rollback_log_to_memory (ROLLBACK_LOG_NODE log,
 int
 toku_serialize_rollback_log_to (int fd, BLOCKNUM blocknum, ROLLBACK_LOG_NODE log,
                                 FT h, 
-                                BOOL for_checkpoint) {
+                                bool for_checkpoint) {
     size_t n_to_write;
     char *compressed_buf;
     {
@@ -2641,7 +2641,7 @@ toku_serialize_rollback_log_to (int fd, BLOCKNUM blocknum, ROLLBACK_LOG_NODE log
 }
 
 static int
-deserialize_rollback_log_from_rbuf (BLOCKNUM blocknum, u_int32_t fullhash, ROLLBACK_LOG_NODE *log_p,
+deserialize_rollback_log_from_rbuf (BLOCKNUM blocknum, uint32_t fullhash, ROLLBACK_LOG_NODE *log_p,
                                     FT h, struct rbuf *rb) {
     ROLLBACK_LOG_NODE MALLOC(result);
     int r;
@@ -2661,7 +2661,7 @@ deserialize_rollback_log_from_rbuf (BLOCKNUM blocknum, u_int32_t fullhash, ROLLB
     result->layout_version_original = rbuf_int(rb);
     result->layout_version_read_from_disk = result->layout_version;
     result->build_id = rbuf_int(rb);
-    result->dirty = FALSE;
+    result->dirty = false;
     //TODO: Maybe add descriptor (or just descriptor version) here eventually?
     //TODO: This is hard.. everything is shared in a single dictionary.
     rbuf_TXNID(rb, &result->txnid);
@@ -2718,7 +2718,7 @@ deserialize_rollback_log_from_rbuf (BLOCKNUM blocknum, u_int32_t fullhash, ROLLB
 }
 
 static int
-deserialize_rollback_log_from_rbuf_versioned (u_int32_t version, BLOCKNUM blocknum, u_int32_t fullhash,
+deserialize_rollback_log_from_rbuf_versioned (uint32_t version, BLOCKNUM blocknum, uint32_t fullhash,
                                               ROLLBACK_LOG_NODE *log,
                                               FT h, struct rbuf *rb) {
     int r = 0;
@@ -2732,21 +2732,21 @@ deserialize_rollback_log_from_rbuf_versioned (u_int32_t version, BLOCKNUM blockn
 }
 
 int
-decompress_from_raw_block_into_rbuf(u_int8_t *raw_block, size_t raw_block_size, struct rbuf *rb, BLOCKNUM blocknum) {
+decompress_from_raw_block_into_rbuf(uint8_t *raw_block, size_t raw_block_size, struct rbuf *rb, BLOCKNUM blocknum) {
     toku_trace("decompress");
     int r = 0;
     // get the number of compressed sub blocks
     int n_sub_blocks;
-    n_sub_blocks = toku_dtoh32(*(u_int32_t*)(&raw_block[node_header_overhead]));
+    n_sub_blocks = toku_dtoh32(*(uint32_t*)(&raw_block[node_header_overhead]));
 
     // verify the number of sub blocks
     invariant(0 <= n_sub_blocks && n_sub_blocks <= max_sub_blocks);
 
     { // verify the header checksum
-        u_int32_t header_length = node_header_overhead + sub_block_header_size(n_sub_blocks);
+        uint32_t header_length = node_header_overhead + sub_block_header_size(n_sub_blocks);
         invariant(header_length <= raw_block_size);
-        u_int32_t xsum = x1764_memory(raw_block, header_length);
-        u_int32_t stored_xsum = toku_dtoh32(*(u_int32_t *)(raw_block + header_length));
+        uint32_t xsum = x1764_memory(raw_block, header_length);
+        uint32_t stored_xsum = toku_dtoh32(*(uint32_t *)(raw_block + header_length));
         if (xsum != stored_xsum) {
             r = TOKUDB_BAD_CHECKSUM;
         }
@@ -2754,7 +2754,7 @@ decompress_from_raw_block_into_rbuf(u_int8_t *raw_block, size_t raw_block_size,
 
     // deserialize the sub block header
     struct sub_block sub_block[n_sub_blocks];
-    u_int32_t *sub_block_header = (u_int32_t *) &raw_block[node_header_overhead+4];
+    uint32_t *sub_block_header = (uint32_t *) &raw_block[node_header_overhead+4];
     for (int i = 0; i < n_sub_blocks; i++) {
         sub_block_init(&sub_block[i]);
         sub_block[i].compressed_size = toku_dtoh32(sub_block_header[0]);
@@ -2771,13 +2771,13 @@ decompress_from_raw_block_into_rbuf(u_int8_t *raw_block, size_t raw_block_size,
 
     // verify sub block sizes
     for (int i = 0; i < n_sub_blocks; i++) {
-        u_int32_t compressed_size = sub_block[i].compressed_size;
+        uint32_t compressed_size = sub_block[i].compressed_size;
         if (compressed_size<=0   || compressed_size>(1<<30)) { 
             r = toku_db_badformat(); 
             goto exit;
         }
 
-        u_int32_t uncompressed_size = sub_block[i].uncompressed_size;
+        uint32_t uncompressed_size = sub_block[i].uncompressed_size;
         if (0) printf("Block %" PRId64 " Compressed size = %u, uncompressed size=%u\n", blocknum.b, compressed_size, uncompressed_size);
         if (uncompressed_size<=0 || uncompressed_size>(1<<30)) { 
             r = toku_db_badformat();
@@ -2802,7 +2802,7 @@ decompress_from_raw_block_into_rbuf(u_int8_t *raw_block, size_t raw_block_size,
 
     // point at the start of the compressed data (past the node header, the sub block header, and the header checksum)
     unsigned char *compressed_data;
-    compressed_data = raw_block + node_header_overhead + sub_block_header_size(n_sub_blocks) + sizeof (u_int32_t);
+    compressed_data = raw_block + node_header_overhead + sub_block_header_size(n_sub_blocks) + sizeof (uint32_t);
 
     // point at the start of the uncompressed data
     unsigned char *uncompressed_data;
@@ -2825,7 +2825,7 @@ decompress_from_raw_block_into_rbuf(u_int8_t *raw_block, size_t raw_block_size,
 }
 
 static int
-decompress_from_raw_block_into_rbuf_versioned(u_int32_t version, u_int8_t *raw_block, size_t raw_block_size, struct rbuf *rb, BLOCKNUM blocknum) {
+decompress_from_raw_block_into_rbuf_versioned(uint32_t version, uint8_t *raw_block, size_t raw_block_size, struct rbuf *rb, BLOCKNUM blocknum) {
     // This function exists solely to accomodate future changes in compression.
     int r = 0;
     switch (version) {
@@ -2835,7 +2835,7 @@ decompress_from_raw_block_into_rbuf_versioned(u_int32_t version, u_int8_t *raw_b
             r = decompress_from_raw_block_into_rbuf(raw_block, raw_block_size, rb, blocknum);
             break;
         default:
-            lazy_assert(FALSE);
+            lazy_assert(false);
     }
     return r;
 }
@@ -2854,7 +2854,7 @@ read_and_decompress_block_from_fd_into_rbuf(int fd, BLOCKNUM blocknum,
     // get the file offset and block size for the block
     DISKOFF offset, size;
     toku_translate_blocknum_to_offset_size(h->blocktable, blocknum, &offset, &size);
-    u_int8_t *XMALLOC_N(size, raw_block);
+    uint8_t *XMALLOC_N(size, raw_block);
     {
         // read the (partially compressed) block
         ssize_t rlen = toku_os_pread(fd, raw_block, size, offset);
@@ -2863,14 +2863,14 @@ read_and_decompress_block_from_fd_into_rbuf(int fd, BLOCKNUM blocknum,
     // get the layout_version
     int layout_version;
     {
-        u_int8_t *magic = raw_block + uncompressed_magic_offset;
+        uint8_t *magic = raw_block + uncompressed_magic_offset;
         if (memcmp(magic, "tokuleaf", 8)!=0 &&
             memcmp(magic, "tokunode", 8)!=0 &&
             memcmp(magic, "tokuroll", 8)!=0) {
             r = toku_db_badformat();
             goto cleanup;
         }
-        u_int8_t *version = raw_block + uncompressed_version_offset;
+        uint8_t *version = raw_block + uncompressed_version_offset;
         layout_version = toku_dtoh32(*(uint32_t*)version);
         if (layout_version < FT_LAYOUT_MIN_SUPPORTED_VERSION || layout_version > FT_LAYOUT_VERSION) {
             r = toku_db_badformat();
@@ -2907,7 +2907,7 @@ read_and_decompress_block_from_fd_into_rbuf(int fd, BLOCKNUM blocknum,
 
 // Read rollback log node from file into struct.  Perform version upgrade if necessary.
 int
-toku_deserialize_rollback_log_from (int fd, BLOCKNUM blocknum, u_int32_t fullhash,
+toku_deserialize_rollback_log_from (int fd, BLOCKNUM blocknum, uint32_t fullhash,
                                     ROLLBACK_LOG_NODE *logp, FT h) {
     toku_trace("deserial start");
 
@@ -2919,7 +2919,7 @@ toku_deserialize_rollback_log_from (int fd, BLOCKNUM blocknum, u_int32_t fullhas
     if (r!=0) goto cleanup;
 
     {
-        u_int8_t *magic = rb.buf + uncompressed_magic_offset;
+        uint8_t *magic = rb.buf + uncompressed_magic_offset;
         if (memcmp(magic, "tokuroll", 8)!=0) {
             r = toku_db_badformat();
             goto cleanup;
diff --git a/ft/ftdump.cc b/ft/ftdump.cc
index 681a089ad0fe347d20b48800923fef1f82d6ba75..46ed014c3557e4d975952cce4e820433c6d6cd39 100644
--- a/ft/ftdump.cc
+++ b/ft/ftdump.cc
@@ -37,25 +37,25 @@ print_item (bytevec val, ITEMLEN len) {
 }
 
 static void
-simple_hex_dump(unsigned char *vp, u_int64_t size) {
-    for (u_int64_t i = 0; i < size; i++) {
+simple_hex_dump(unsigned char *vp, uint64_t size) {
+    for (uint64_t i = 0; i < size; i++) {
         unsigned char c = vp[i];
         printf("%2.2X", c);
     }
 }
 
 static void
-hex_dump(unsigned char *vp, u_int64_t offset, u_int64_t size) {
-    u_int64_t n = size / 32;
-    for (u_int64_t i = 0; i < n; i++) {
+hex_dump(unsigned char *vp, uint64_t offset, uint64_t size) {
+    uint64_t n = size / 32;
+    for (uint64_t i = 0; i < n; i++) {
 	printf("%" PRIu64 ": ", offset);
-	for (u_int64_t j = 0; j < 32; j++) {
+	for (uint64_t j = 0; j < 32; j++) {
 	    unsigned char c = vp[j];
 	    printf("%2.2X", c);
 	    if (((j+1) % 4) == 0)
 		printf(" ");
 	}
-	for (u_int64_t j = 0; j < 32; j++) {
+	for (uint64_t j = 0; j < 32; j++) {
 	    unsigned char c = vp[j];
 	    printf("%c", isprint(c) ? c : ' ');
 	}
@@ -64,7 +64,7 @@ hex_dump(unsigned char *vp, u_int64_t offset, u_int64_t size) {
 	offset += 32;
     }
     size = size % 32;
-    for (u_int64_t i=0; i<size; i++) {
+    for (uint64_t i=0; i<size; i++) {
 	if ((i % 32) == 0)
 	    printf("%" PRIu64 ": ", offset+i);
 	printf("%2.2X", vp[i]);
@@ -116,7 +116,7 @@ dump_header (int f, FT *header, CACHEFILE cf) {
 }
 
 static int
-print_le (OMTVALUE lev, u_int32_t UU(idx), void *UU(v)) {
+print_le (OMTVALUE lev, uint32_t UU(idx), void *UU(v)) {
     LEAFENTRY CAST_FROM_VOIDP(le, lev);
     print_leafentry(stdout, le);
     printf("\n");
@@ -215,16 +215,16 @@ dump_node (int f, BLOCKNUM blocknum, FT h) {
 }
 
 static void 
-dump_block_translation(FT h, u_int64_t offset) {
+dump_block_translation(FT h, uint64_t offset) {
     toku_blocknum_dump_translation(h->blocktable, make_blocknum(offset));
 }
 
 typedef struct {
     int f;
     FT h;
-    u_int64_t blocksizes;
-    u_int64_t leafsizes;
-    u_int64_t leafblocks;
+    uint64_t blocksizes;
+    uint64_t leafsizes;
+    uint64_t leafblocks;
 } frag_help_extra;
 
 static int
@@ -254,7 +254,7 @@ dump_fragmentation(int f, FT h) {
     info.f = f;
     info.h = h;
     toku_blocktable_iterate(h->blocktable, TRANSLATION_CHECKPOINTED,
-                            fragmentation_helper, &info, TRUE, TRUE);
+                            fragmentation_helper, &info, true, true);
     int64_t used_space;
     int64_t total_space;
     toku_blocktable_internal_fragmentation(h->blocktable, &total_space, &used_space);
@@ -277,7 +277,7 @@ typedef struct {
 } garbage_help_extra;
 
 static int
-garbage_leafentry_helper(OMTVALUE v, u_int32_t UU(idx), void *extra) {
+garbage_leafentry_helper(OMTVALUE v, uint32_t UU(idx), void *extra) {
     garbage_help_extra *CAST_FROM_VOIDP(info, extra);
     LEAFENTRY CAST_FROM_VOIDP(le, v);
     info->total_space += leafentry_disksize(le);
@@ -320,21 +320,21 @@ dump_garbage_stats(int f, FT h) {
     info.f = f;
     info.h = h;
     toku_blocktable_iterate(h->blocktable, TRANSLATION_CHECKPOINTED,
-                            garbage_helper, &info, TRUE, TRUE);
+                            garbage_helper, &info, true, true);
 
     printf("total_size: %zu\n", info.total_space);
     printf("used_size:  %zu\n", info.used_space);
 }
 
-static u_int32_t 
+static uint32_t 
 get_unaligned_uint32(unsigned char *p) {
-    return *(u_int32_t *)p;
+    return *(uint32_t *)p;
 }
 
 struct dump_sub_block {
-  u_int32_t compressed_size;
-  u_int32_t uncompressed_size;
-  u_int32_t xsum;
+  uint32_t compressed_size;
+  uint32_t uncompressed_size;
+  uint32_t xsum;
 };
 
 static void
@@ -345,22 +345,22 @@ sub_block_deserialize(struct dump_sub_block *sb, unsigned char *sub_block_header
 }
 
 static void
-verify_block(unsigned char *cp, u_int64_t file_offset, u_int64_t size) {
+verify_block(unsigned char *cp, uint64_t file_offset, uint64_t size) {
     // verify the header checksum
-    const size_t node_header = 8 + sizeof (u_int32_t) + sizeof (u_int32_t) + sizeof (u_int32_t);
+    const size_t node_header = 8 + sizeof (uint32_t) + sizeof (uint32_t) + sizeof (uint32_t);
     
     printf("%.8s layout_version=%u %u build=%d\n", cp, get_unaligned_uint32(cp+8), get_unaligned_uint32(cp+12), get_unaligned_uint32(cp+16));
 
     unsigned char *sub_block_header = &cp[node_header];
-    u_int32_t n_sub_blocks = toku_dtoh32(get_unaligned_uint32(&sub_block_header[0]));
-    u_int32_t header_length = node_header + n_sub_blocks * sizeof (struct dump_sub_block);
-    header_length += sizeof (u_int32_t); // CRC
+    uint32_t n_sub_blocks = toku_dtoh32(get_unaligned_uint32(&sub_block_header[0]));
+    uint32_t header_length = node_header + n_sub_blocks * sizeof (struct dump_sub_block);
+    header_length += sizeof (uint32_t); // CRC
     if (header_length > size) {
         printf("header length too big: %u\n", header_length);
         return;
     }
-    u_int32_t header_xsum = x1764_memory(cp, header_length);
-    u_int32_t expected_xsum = toku_dtoh32(get_unaligned_uint32(&cp[header_length]));
+    uint32_t header_xsum = x1764_memory(cp, header_length);
+    uint32_t expected_xsum = toku_dtoh32(get_unaligned_uint32(&cp[header_length]));
     if (header_xsum != expected_xsum) {
         printf("header checksum failed: %u %u\n", header_xsum, expected_xsum);
         return;
@@ -368,16 +368,16 @@ verify_block(unsigned char *cp, u_int64_t file_offset, u_int64_t size) {
 
     // deserialize the sub block header
     struct dump_sub_block sub_block[n_sub_blocks];
-    sub_block_header += sizeof (u_int32_t);
-    for (u_int32_t i = 0 ; i < n_sub_blocks; i++) {
+    sub_block_header += sizeof (uint32_t);
+    for (uint32_t i = 0 ; i < n_sub_blocks; i++) {
         sub_block_deserialize(&sub_block[i], sub_block_header);
         sub_block_header += sizeof (struct dump_sub_block);
     }
 
     // verify the sub block header
-    u_int32_t offset = header_length + 4;
-    for (u_int32_t i = 0 ; i < n_sub_blocks; i++) {
-        u_int32_t xsum = x1764_memory(cp + offset, sub_block[i].compressed_size);
+    uint32_t offset = header_length + 4;
+    for (uint32_t i = 0 ; i < n_sub_blocks; i++) {
+        uint32_t xsum = x1764_memory(cp + offset, sub_block[i].compressed_size);
         printf("%u: %u %u %u", i, sub_block[i].compressed_size, sub_block[i].uncompressed_size, sub_block[i].xsum);
         if (xsum != sub_block[i].xsum)
             printf(" fail %u offset %" PRIu64, xsum, file_offset + offset);
@@ -395,17 +395,17 @@ dump_block(int f, BLOCKNUM blocknum, FT h) {
     printf("%" PRId64 " at %" PRId64 " size %" PRId64 "\n", blocknum.b, offset, size);
 
     unsigned char *CAST_FROM_VOIDP(vp, toku_malloc(size));
-    u_int64_t r = pread(f, vp, size, offset);
-    if (r == (u_int64_t)size) {
+    uint64_t r = pread(f, vp, size, offset);
+    if (r == (uint64_t)size) {
         verify_block(vp, offset, size);
     }
     toku_free(vp);
 }
 
 static void
-dump_file(int f, u_int64_t offset, u_int64_t size, FILE *outfp) {
+dump_file(int f, uint64_t offset, uint64_t size, FILE *outfp) {
     unsigned char *XMALLOC_N(size, vp);
-    u_int64_t r = pread(f, vp, size, offset);
+    uint64_t r = pread(f, vp, size, offset);
     if (r == size) {
         if (outfp == stdout)
             hex_dump(vp, offset, size);
@@ -416,7 +416,7 @@ dump_file(int f, u_int64_t offset, u_int64_t size, FILE *outfp) {
 }
 
 static void
-set_file(int f, u_int64_t offset, unsigned char newc) {
+set_file(int f, uint64_t offset, unsigned char newc) {
     toku_os_pwrite(f, &newc, sizeof newc, offset);
 }
 
@@ -546,7 +546,7 @@ main (int argc, const char *const argv[]) {
 	    } else if (strcmp(fields[0], "dumpdata") == 0 && nfields == 2) {
 		dump_data = strtol(fields[1], NULL, 10);
 	    } else if (strcmp(fields[0], "block_translation") == 0 || strcmp(fields[0], "bx") == 0) {
-		u_int64_t offset = 0;
+		uint64_t offset = 0;
 		if (nfields == 2)
 		    offset = getuint64(fields[1]);
 		dump_block_translation(ft, offset);
@@ -555,14 +555,14 @@ main (int argc, const char *const argv[]) {
             } else if (strcmp(fields[0], "garbage") == 0) {
                 dump_garbage_stats(f, ft);
 	    } else if (strcmp(fields[0], "file") == 0 && nfields >= 3) {
-		u_int64_t offset = getuint64(fields[1]);
-		u_int64_t size = getuint64(fields[2]);
+		uint64_t offset = getuint64(fields[1]);
+		uint64_t size = getuint64(fields[2]);
 		FILE *outfp = stdout;
 		if (nfields >= 4)
 		    outfp = fopen(fields[3], "w");
 		dump_file(f, offset, size, outfp);
 	    } else if (strcmp(fields[0], "setfile") == 0 && nfields == 3) {
-		u_int64_t offset = getuint64(fields[1]);
+		uint64_t offset = getuint64(fields[1]);
 		unsigned char newc = getuint64(fields[2]);
 		set_file(f, offset, newc);
 	    } else if (strcmp(fields[0], "quit") == 0 || strcmp(fields[0], "q") == 0) {
@@ -580,7 +580,7 @@ main (int argc, const char *const argv[]) {
 	info.f = f;
 	info.h = ft;
 	toku_blocktable_iterate(ft->blocktable, TRANSLATION_CHECKPOINTED,
-				dump_node_wrapper, &info, TRUE, TRUE);
+				dump_node_wrapper, &info, true, true);
     }
     toku_ft_free(ft);
     return 0;
diff --git a/ft/ftloader-callback.cc b/ft/ftloader-callback.cc
index be97eb62c3405abd38484cfcfb0c7cd47921a5a4..0391bbbfd6b99df0e78ff0f73bcc03b8fc740c11 100644
--- a/ft/ftloader-callback.cc
+++ b/ft/ftloader-callback.cc
@@ -74,7 +74,7 @@ int ft_loader_call_error_function(ft_loader_error_callback loader_error) {
     error_callback_lock(loader_error);
     r = loader_error->error;
     if (r && loader_error->error_callback && !loader_error->did_callback) {
-        loader_error->did_callback = TRUE;
+        loader_error->did_callback = true;
         loader_error->error_callback(loader_error->db, 
                                      loader_error->which_db,
                                      loader_error->error,
diff --git a/ft/ftloader-internal.h b/ft/ftloader-internal.h
index 082cc31e6654581ed5b9cd78710704d5bd5ed653..44a285099f4e06f504f7dbac6cf79435888c9ccb 100644
--- a/ft/ftloader-internal.h
+++ b/ft/ftloader-internal.h
@@ -16,11 +16,11 @@
 
 /* These structures maintain a collection of all the open temporary files used by the loader. */
 struct file_info {
-    BOOL is_open;
-    BOOL is_extant; // if true, the file must be unlinked.
+    bool is_open;
+    bool is_extant; // if true, the file must be unlinked.
     char *fname;
     FILE *file;
-    u_int64_t n_rows; // how many rows were written into that file
+    uint64_t n_rows; // how many rows were written into that file
     size_t buffer_size;
     void *buffer;
 };
@@ -56,11 +56,11 @@ int init_rowset (struct rowset *rows, uint64_t memory_budget);
 void destroy_rowset (struct rowset *rows);
 int add_row (struct rowset *rows, DBT *key, DBT *val);
 
-int loader_write_row(DBT *key, DBT *val, FIDX data, FILE*, u_int64_t *dataoff, FTLOADER bl);
+int loader_write_row(DBT *key, DBT *val, FIDX data, FILE*, uint64_t *dataoff, FTLOADER bl);
 int loader_read_row (FILE *f, DBT *key, DBT *val);
 
 struct merge_fileset {
-    BOOL have_sorted_output;  // Is there an previous key?
+    bool have_sorted_output;  // Is there an previous key?
     FIDX sorted_output;       // this points to one of the data_fidxs.  If output_is_sorted then this is the file containing sorted data.  It's still open
     DBT  prev_key;            // What is it?  If it's here, its the last output in the merge fileset
 
@@ -93,7 +93,7 @@ struct error_callback_s {
     int which_db;
     DBT key;
     DBT val;
-    BOOL did_callback;
+    bool did_callback;
     toku_mutex_t mutex;
 };
 typedef struct error_callback_s *ft_loader_error_callback;
@@ -134,18 +134,18 @@ struct ft_loader_s {
 
     QUEUE primary_rowset_queue; // main thread enqueues rowsets in this queue (in maybe 64MB chunks).  The extractor thread removes them, sorts them, adn writes to file.
     toku_pthread_t     extractor_thread;     // the thread that takes primary rowset and does extraction and the first level sort and write to file.
-    BOOL extractor_live;
+    bool extractor_live;
 
     DBT  *last_key;         // for each rowset, remember the most recently output key.  The system may choose not to keep this up-to-date when a rowset is unsorted.  These keys are malloced and ulen maintains the size of the malloced block.
     
     struct rowset *rows; // secondary rows that have been put, but haven't been sorted and written to a file.
-    u_int64_t n_rows; // how many rows have been put?
+    uint64_t n_rows; // how many rows have been put?
     struct merge_fileset *fs;
 
     const char *temp_file_template;
 
     CACHETABLE cachetable;
-    BOOL did_reserve_memory;
+    bool did_reserve_memory;
     uint64_t   reserved_memory; // how much memory are we allowed to use?
 
     /* To make it easier to recover from errors, we don't use FILE*, instead we use an index into the file_infos. */
@@ -162,19 +162,19 @@ struct ft_loader_s {
 
     QUEUE *fractal_queues; // an array of work queues, one for each secondary index.
     toku_pthread_t *fractal_threads;
-    BOOL *fractal_threads_live; // an array of bools indicating that fractal_threads[i] is a live thread.  (There is no NULL for a pthread_t, so we have to maintain this separately).
+    bool *fractal_threads_live; // an array of bools indicating that fractal_threads[i] is a live thread.  (There is no NULL for a pthread_t, so we have to maintain this separately).
 
     unsigned fractal_workers; // number of fractal tree writer threads
 
     toku_mutex_t mutex;
-    BOOL mutex_init;
+    bool mutex_init;
 };
 
 // Set the number of rows in the loader.  Used for test.
-void toku_ft_loader_set_n_rows(FTLOADER bl, u_int64_t n_rows);
+void toku_ft_loader_set_n_rows(FTLOADER bl, uint64_t n_rows);
 
 // Get the number of rows in the loader.  Used for test.
-u_int64_t toku_ft_loader_get_n_rows(FTLOADER bl);
+uint64_t toku_ft_loader_get_n_rows(FTLOADER bl);
 
 // The data passed into a fractal_thread via pthread_create.
 struct fractal_thread_args {
@@ -191,8 +191,8 @@ struct fractal_thread_args {
     enum toku_compression_method target_compression_method;
 };
 
-void toku_ft_loader_set_n_rows(FTLOADER bl, u_int64_t n_rows);
-u_int64_t toku_ft_loader_get_n_rows(FTLOADER bl);
+void toku_ft_loader_set_n_rows(FTLOADER bl, uint64_t n_rows);
+uint64_t toku_ft_loader_get_n_rows(FTLOADER bl);
 
 int merge_row_arrays_base (struct row dest[/*an+bn*/], struct row a[/*an*/], int an, struct row b[/*bn*/], int bn,
                            int which_db, DB *dest_db, ft_compare_func,
@@ -206,7 +206,7 @@ int sort_and_write_rows (struct rowset rows, struct merge_fileset *fs, FTLOADER
 int mergesort_row_array (struct row rows[/*n*/], int n, int which_db, DB *dest_db, ft_compare_func, FTLOADER, struct rowset *);
 
 //int write_file_to_dbfile (int outfile, FIDX infile, FTLOADER bl, const DESCRIPTOR descriptor, int progress_allocation);
-int toku_merge_some_files_using_dbufio (const BOOL to_q, FIDX dest_data, QUEUE q, int n_sources, DBUFIO_FILESET bfs, FIDX srcs_fidxs[/*n_sources*/], FTLOADER bl, int which_db, DB *dest_db, ft_compare_func compare, int progress_allocation);
+int toku_merge_some_files_using_dbufio (const bool to_q, FIDX dest_data, QUEUE q, int n_sources, DBUFIO_FILESET bfs, FIDX srcs_fidxs[/*n_sources*/], FTLOADER bl, int which_db, DB *dest_db, ft_compare_func compare, int progress_allocation);
 
 int ft_loader_sort_and_write_rows (struct rowset *rows, struct merge_fileset *fs, FTLOADER bl, int which_db, DB *dest_db, ft_compare_func);
 
@@ -227,8 +227,8 @@ int ft_loader_mergesort_row_array (struct row rows[/*n*/], int n, int which_db,
 int ft_loader_write_file_to_dbfile (int outfile, FIDX infile, FTLOADER bl, const DESCRIPTOR descriptor, int progress_allocation);
 
 int ft_loader_init_file_infos (struct file_infos *fi);
-void ft_loader_fi_destroy (struct file_infos *fi, BOOL is_error);
-int ft_loader_fi_close (struct file_infos *fi, FIDX idx, BOOL require_open);
+void ft_loader_fi_destroy (struct file_infos *fi, bool is_error);
+int ft_loader_fi_close (struct file_infos *fi, FIDX idx, bool require_open);
 int ft_loader_fi_close_all (struct file_infos *fi);
 int ft_loader_fi_reopen (struct file_infos *fi, FIDX idx, const char *mode);
 int ft_loader_fi_unlink (struct file_infos *fi, FIDX idx);
@@ -243,9 +243,9 @@ int toku_ft_loader_internal_init (/* out */ FTLOADER *blp,
 				   const char *temp_file_template,
 				   LSN load_lsn,
                                    TOKUTXN txn,
-                                   BOOL reserve_memory);
+                                   bool reserve_memory);
 
-void toku_ft_loader_internal_destroy (FTLOADER bl, BOOL is_error);
+void toku_ft_loader_internal_destroy (FTLOADER bl, bool is_error);
 
 // For test purposes only.  (In production, the rowset size is determined by negotation with the cachetable for some memory.  See #2613.)
 uint64_t toku_ft_loader_get_rowset_budget_for_testing (void);
diff --git a/ft/ftloader.cc b/ft/ftloader.cc
index 9c1506b23df5e92cdd9ebae9cd1889a8ceabc9c0..475b05f1fb48dd63ecdd0e2f276ee995622b7a9a 100644
--- a/ft/ftloader.cc
+++ b/ft/ftloader.cc
@@ -90,13 +90,13 @@ toku_ft_loader_get_rowset_budget_for_testing (void)
 void ft_loader_lock_init(FTLOADER bl) {
     invariant(!bl->mutex_init);
     toku_mutex_init(&bl->mutex, NULL); 
-    bl->mutex_init = TRUE;
+    bl->mutex_init = true;
 }
 
 void ft_loader_lock_destroy(FTLOADER bl) {
     if (bl->mutex_init) {
         toku_mutex_destroy(&bl->mutex);
-        bl->mutex_init = FALSE;
+        bl->mutex_init = false;
     }
 }
 
@@ -112,13 +112,13 @@ static void ft_loader_unlock(FTLOADER bl) {
 
 static int add_big_buffer(struct file_info *file) {
     int result = 0;
-    BOOL newbuffer = FALSE;
+    bool newbuffer = false;
     if (file->buffer == NULL) {
         file->buffer = toku_malloc(file->buffer_size);
         if (file->buffer == NULL)
             result = get_error_errno();
         else
-            newbuffer = TRUE;
+            newbuffer = true;
     }
     if (result == 0) {
         int r = setvbuf(file->file, (char *) file->buffer, _IOFBF, file->buffer_size);
@@ -153,7 +153,7 @@ int ft_loader_init_file_infos (struct file_infos *fi) {
     return result;
 }
 
-void ft_loader_fi_destroy (struct file_infos *fi, BOOL is_error)
+void ft_loader_fi_destroy (struct file_infos *fi, bool is_error)
 // Effect: Free the resources in the fi.
 // If is_error then we close and unlink all the temp files.
 // If !is_error then requires that all the temp files have been closed and destroyed
@@ -198,8 +198,8 @@ static int open_file_add (struct file_infos *fi,
         XREALLOC_N(fi->n_files_limit, fi->file_infos);
     }
     invariant(fi->n_files < fi->n_files_limit);
-    fi->file_infos[fi->n_files].is_open   = TRUE;
-    fi->file_infos[fi->n_files].is_extant = TRUE;
+    fi->file_infos[fi->n_files].is_open   = true;
+    fi->file_infos[fi->n_files].is_extant = true;
     fi->file_infos[fi->n_files].fname     = fname;
     fi->file_infos[fi->n_files].file      = file;
     fi->file_infos[fi->n_files].n_rows    = 0;
@@ -227,7 +227,7 @@ int ft_loader_fi_reopen (struct file_infos *fi, FIDX idx, const char *mode) {
     if (fi->file_infos[i].file == NULL) { 
         result = get_error_errno();
     } else {
-        fi->file_infos[i].is_open = TRUE;
+        fi->file_infos[i].is_open = true;
         // No longer need the big buffer for reopened files.  Don't allocate the space, we need it elsewhere.
         //add_big_buffer(&fi->file_infos[i]);
         fi->n_files_open++;
@@ -236,7 +236,7 @@ int ft_loader_fi_reopen (struct file_infos *fi, FIDX idx, const char *mode) {
     return result;
 }
 
-int ft_loader_fi_close (struct file_infos *fi, FIDX idx, BOOL require_open)
+int ft_loader_fi_close (struct file_infos *fi, FIDX idx, bool require_open)
 {
     int result = 0;
     toku_mutex_lock(&fi->lock); 
@@ -244,7 +244,7 @@ int ft_loader_fi_close (struct file_infos *fi, FIDX idx, BOOL require_open)
     if (fi->file_infos[idx.idx].is_open) {
         invariant(fi->n_files_open>0);   // loader-cleanup-test failure
         fi->n_files_open--;
-        fi->file_infos[idx.idx].is_open = FALSE;
+        fi->file_infos[idx.idx].is_open = false;
         int r = toku_os_fclose(fi->file_infos[idx.idx].file);
         if (r)
             result = get_error_errno();
@@ -264,7 +264,7 @@ int ft_loader_fi_unlink (struct file_infos *fi, FIDX idx) {
         invariant(fi->n_files_extant>0);
         fi->n_files_extant--;
         invariant(!fi->file_infos[id].is_open); // must be closed before we unlink
-        fi->file_infos[id].is_extant = FALSE;
+        fi->file_infos[id].is_extant = false;
         int r = unlink(fi->file_infos[id].fname);  
         if (r != 0) 
             result = get_error_errno();
@@ -282,7 +282,7 @@ ft_loader_fi_close_all(struct file_infos *fi) {
     for (int i = 0; i < fi->n_files; i++) {
         int r;
         FIDX idx = { i };
-        r = ft_loader_fi_close(fi, idx, FALSE);  // ignore files that are already closed
+        r = ft_loader_fi_close(fi, idx, false);  // ignore files that are already closed
         if (rval == 0 && r)
             rval = r;  // capture first error
     }
@@ -327,7 +327,7 @@ int ft_loader_open_temp_file (FTLOADER bl, FIDX *file_idx)
     return result;
 }
 
-void toku_ft_loader_internal_destroy (FTLOADER bl, BOOL is_error) {
+void toku_ft_loader_internal_destroy (FTLOADER bl, bool is_error) {
     ft_loader_lock_destroy(bl);
 
     // These frees rely on the fact that if you free a NULL pointer then nothing bad happens.
@@ -444,7 +444,7 @@ static void ft_loader_set_fractal_workers_count(FTLOADER bl) {
 //
 // DBUFIO_DEPTH*F*MERGE_BUF_SIZE + FRACTAL_WRITER_ROWSETS*MERGE_BUF_SIZE + WORKERS*NODESIZE*2 <= RESERVED_MEMORY
 
-static int64_t memory_avail_during_merge(FTLOADER bl, BOOL is_fractal_node) {
+static int64_t memory_avail_during_merge(FTLOADER bl, bool is_fractal_node) {
     // avail memory = reserved memory - WORKERS*NODESIZE*2 for the last merge stage only
     int64_t avail_memory = bl->reserved_memory;
     if (is_fractal_node) {
@@ -454,7 +454,7 @@ static int64_t memory_avail_during_merge(FTLOADER bl, BOOL is_fractal_node) {
     return avail_memory;
 }
 
-static int merge_fanin (FTLOADER bl, BOOL is_fractal_node) {
+static int merge_fanin (FTLOADER bl, bool is_fractal_node) {
     // return number of temp files to read in this pass
     int64_t memory_avail = memory_avail_during_merge(bl, is_fractal_node);
     int64_t nbuffers = memory_avail / (int64_t)TARGET_MERGE_BUF_SIZE;
@@ -463,7 +463,7 @@ static int merge_fanin (FTLOADER bl, BOOL is_fractal_node) {
     return MAX(nbuffers / (int64_t)DBUFIO_DEPTH, (int)MIN_MERGE_FANIN);
 }
 
-static uint64_t memory_per_rowset_during_merge (FTLOADER bl, int merge_factor, BOOL is_fractal_node // if it is being sent to a q
+static uint64_t memory_per_rowset_during_merge (FTLOADER bl, int merge_factor, bool is_fractal_node // if it is being sent to a q
                                                 ) {
     int64_t memory_avail = memory_avail_during_merge(bl, is_fractal_node);
     int64_t nbuffers = DBUFIO_DEPTH * merge_factor;
@@ -482,7 +482,7 @@ int toku_ft_loader_internal_init (/* out */ FTLOADER *blp,
                                    const char *temp_file_template,
                                    LSN load_lsn,
                                    TOKUTXN txn,
-                                   BOOL reserve_memory)
+                                   bool reserve_memory)
 // Effect: Allocate and initialize a FTLOADER, but do not create the extractor thread.
 {
     FTLOADER CALLOC(bl); // initialized to all zeros (hence CALLOC)
@@ -491,11 +491,11 @@ int toku_ft_loader_internal_init (/* out */ FTLOADER *blp,
     bl->generate_row_for_put = g;
     bl->cachetable = cachetable;
     if (reserve_memory && bl->cachetable) {
-        bl->did_reserve_memory = TRUE;
+        bl->did_reserve_memory = true;
         bl->reserved_memory = toku_cachetable_reserve_memory(bl->cachetable, 2.0/3.0); // allocate 2/3 of the unreserved part (which is 3/4 of the memory to start with).
     }
     else {
-        bl->did_reserve_memory = FALSE;
+        bl->did_reserve_memory = false;
         bl->reserved_memory = 512*1024*1024; // if no cache table use 512MB.
     }
     //printf("Reserved memory=%ld\n", bl->reserved_memory);
@@ -513,8 +513,8 @@ int toku_ft_loader_internal_init (/* out */ FTLOADER *blp,
     ft_loader_init_error_callback(&bl->error_callback);
     ft_loader_init_poll_callback(&bl->poll_callback);
 
-#define MY_CALLOC_N(n,v) CALLOC_N(n,v); if (!v) { int r = get_error_errno(); toku_ft_loader_internal_destroy(bl, TRUE); return r; }
-#define SET_TO_MY_STRDUP(lval, s) do { char *v = toku_strdup(s); if (!v) { int r = get_error_errno(); toku_ft_loader_internal_destroy(bl, TRUE); return r; } lval = v; } while (0)
+#define MY_CALLOC_N(n,v) CALLOC_N(n,v); if (!v) { int r = get_error_errno(); toku_ft_loader_internal_destroy(bl, true); return r; }
+#define SET_TO_MY_STRDUP(lval, s) do { char *v = toku_strdup(s); if (!v) { int r = get_error_errno(); toku_ft_loader_internal_destroy(bl, true); return r; } lval = v; } while (0)
 
     MY_CALLOC_N(N, bl->root_xids_that_created);
     for (int i=0; i<N; i++) if (brts[i]) bl->root_xids_that_created[i]=brts[i]->ft->h->root_xid_that_created;
@@ -532,11 +532,11 @@ int toku_ft_loader_internal_init (/* out */ FTLOADER *blp,
     for (int i=0; i<N; i++) bl->fractal_queues[i]=NULL;
     MY_CALLOC_N(N, bl->fractal_threads);
     MY_CALLOC_N(N, bl->fractal_threads_live);
-    for (int i=0; i<N; i++) bl->fractal_threads_live[i] = FALSE;
+    for (int i=0; i<N; i++) bl->fractal_threads_live[i] = false;
 
     {
         int r = ft_loader_init_file_infos(&bl->file_infos); 
-        if (r!=0) { toku_ft_loader_internal_destroy(bl, TRUE); return r; }
+        if (r!=0) { toku_ft_loader_internal_destroy(bl, true); return r; }
     }
 
     SET_TO_MY_STRDUP(bl->temp_file_template, temp_file_template);
@@ -551,7 +551,7 @@ int toku_ft_loader_internal_init (/* out */ FTLOADER *blp,
     for(int i=0;i<N;i++) {
         { 
             int r = init_rowset(&bl->rows[i], memory_per_rowset_during_extract(bl)); 
-            if (r!=0) { toku_ft_loader_internal_destroy(bl, TRUE); return r; } 
+            if (r!=0) { toku_ft_loader_internal_destroy(bl, true); return r; } 
         }
         init_merge_fileset(&bl->fs[i]);
         bl->last_key[i].flags = DB_DBT_REALLOC; // don't really need this, but it's nice to maintain it.  We use ulen to keep track of the realloced space.
@@ -559,10 +559,10 @@ int toku_ft_loader_internal_init (/* out */ FTLOADER *blp,
 
     { 
         int r = init_rowset(&bl->primary_rowset, memory_per_rowset_during_extract(bl)); 
-        if (r!=0) { toku_ft_loader_internal_destroy(bl, TRUE); return r; }
+        if (r!=0) { toku_ft_loader_internal_destroy(bl, true); return r; }
     }
     {   int r = queue_create(&bl->primary_rowset_queue, EXTRACTOR_QUEUE_DEPTH); 
-        if (r!=0) { toku_ft_loader_internal_destroy(bl, TRUE); return r; }
+        if (r!=0) { toku_ft_loader_internal_destroy(bl, true); return r; }
     }
     //printf("%s:%d toku_pthread_create\n", __FILE__, __LINE__);
     {
@@ -584,7 +584,7 @@ int toku_ft_loader_open (/* out */ FTLOADER *blp,
                           const char *temp_file_template,
                           LSN load_lsn,
                           TOKUTXN txn,
-                          BOOL reserve_memory)
+                          bool reserve_memory)
 /* Effect: called by DB_ENV->create_loader to create a brt loader.
  * Arguments:
  *   blp                  Return the brt loader here.
@@ -613,16 +613,16 @@ int toku_ft_loader_open (/* out */ FTLOADER *blp,
         FTLOADER bl = *blp;
         int r = toku_pthread_create(&bl->extractor_thread, NULL, extractor_thread, (void*)bl); 
         if (r==0) {
-            bl->extractor_live = TRUE;
+            bl->extractor_live = true;
         } else  { 
             result = r;
-            (void) toku_ft_loader_internal_destroy(bl, TRUE);
+            (void) toku_ft_loader_internal_destroy(bl, true);
         }
     }
     return result;
 }
 
-static void ft_loader_set_panic(FTLOADER bl, int error, BOOL callback) {
+static void ft_loader_set_panic(FTLOADER bl, int error, bool callback) {
     int r = ft_loader_set_error(&bl->error_callback, error, NULL, 0, NULL, NULL);
     if (r == 0 && callback)
         ft_loader_call_error_function(&bl->error_callback);
@@ -719,7 +719,7 @@ static int bl_read_dbt (/*in*/DBT *dbt, FILE *stream)
 static int bl_read_dbt_from_dbufio (/*in*/DBT *dbt, DBUFIO_FILESET bfs, int filenum)
 {
     int result = 0;
-    u_int32_t len;
+    uint32_t len;
     {
         size_t n_read;
         int r = dbufio_fileset_read(bfs, filenum, &len, sizeof(len), &n_read);
@@ -755,7 +755,7 @@ static int bl_read_dbt_from_dbufio (/*in*/DBT *dbt, DBUFIO_FILESET bfs, int file
 }
 
 
-int loader_write_row(DBT *key, DBT *val, FIDX data, FILE *dataf, u_int64_t *dataoff, FTLOADER bl)
+int loader_write_row(DBT *key, DBT *val, FIDX data, FILE *dataf, uint64_t *dataoff, FTLOADER bl)
 /* Effect: Given a key and a val (both DBTs), write them to a file.  Increment *dataoff so that it's up to date.
  * Arguments:
  *   key, val   write these.
@@ -967,7 +967,7 @@ static void* extractor_thread (void *blv) {
         {
             r = process_primary_rows(bl, primary_rowset);
             if (r)
-                ft_loader_set_panic(bl, r, FALSE);
+                ft_loader_set_panic(bl, r, false);
         }
     }
 
@@ -975,7 +975,7 @@ static void* extractor_thread (void *blv) {
     if (r == 0) {
         r = finish_primary_rows(bl); 
         if (r) 
-            ft_loader_set_panic(bl, r, FALSE);
+            ft_loader_set_panic(bl, r, false);
         
     }
     return NULL;
@@ -1032,7 +1032,7 @@ finish_extractor (FTLOADER bl) {
         int r = toku_pthread_join(bl->extractor_thread, &toku_pthread_retval);
         resource_assert_zero(r); 
         invariant(toku_pthread_retval == NULL);
-        bl->extractor_live = FALSE;
+        bl->extractor_live = false;
     }
     {
         int r = queue_destroy(bl->primary_rowset_queue);
@@ -1047,7 +1047,7 @@ finish_extractor (FTLOADER bl) {
 
 static const DBT zero_dbt = {0,0,0,0};
 
-static DBT make_dbt (void *data, u_int32_t size) {
+static DBT make_dbt (void *data, uint32_t size) {
     DBT result = zero_dbt;
     result.data = data;
     result.size = size;
@@ -1206,11 +1206,11 @@ int toku_ft_loader_put (FTLOADER bl, DBT *key, DBT *val)
     return loader_do_put(bl, key, val);
 }
 
-void toku_ft_loader_set_n_rows(FTLOADER bl, u_int64_t n_rows) {
+void toku_ft_loader_set_n_rows(FTLOADER bl, uint64_t n_rows) {
     bl->n_rows = n_rows;
 }
 
-u_int64_t toku_ft_loader_get_n_rows(FTLOADER bl) {
+uint64_t toku_ft_loader_get_n_rows(FTLOADER bl) {
     return bl->n_rows;
 }
 
@@ -1410,7 +1410,7 @@ static int sort_rows (struct rowset *rows, int which_db, DB *dest_db, ft_compare
 void init_merge_fileset (struct merge_fileset *fs)
 /* Effect: Initialize a fileset */ 
 {
-    fs->have_sorted_output = FALSE;
+    fs->have_sorted_output = false;
     fs->sorted_output      = FIDX_NULL;
     fs->prev_key           = zero_dbt;
     fs->prev_key.flags     = DB_DBT_REALLOC;
@@ -1491,7 +1491,7 @@ static int write_rowset_to_file (FTLOADER bl, FIDX sfile, const struct rowset ro
         DBT skey = make_dbt(rows.data + rows.rows[i].off,                     rows.rows[i].klen);
         DBT sval = make_dbt(rows.data + rows.rows[i].off + rows.rows[i].klen, rows.rows[i].vlen);
         
-        u_int64_t soffset=0; // don't really need this.
+        uint64_t soffset=0; // don't really need this.
         int r = loader_write_row(&skey, &sval, sfile, sstream, &soffset, bl);
         if (r != 0) return r;
     }
@@ -1512,7 +1512,7 @@ int sort_and_write_rows (struct rowset rows, struct merge_fileset *fs, FTLOADER
  * Returns 0 on success, otherwise an error number.
  * Destroy the rowset after finishing it.
  * Note: There is no sense in trying to calculate progress by this function since it's done concurrently with the loader->put operation.
- * Note first time called: invariant: fs->have_sorted_output == FALSE
+ * Note first time called: invariant: fs->have_sorted_output == false
  */
 {
     //printf(" sort_and_write use %d progress=%d fin at %d\n", progress_allocation, bl->progress, bl->progress+progress_allocation);
@@ -1541,8 +1541,8 @@ int sort_and_write_rows (struct rowset rows, struct merge_fileset *fs, FTLOADER
             } else {
                 // write the sorted rowset into a new temp file
                 if (fs->have_sorted_output) {
-                    fs->have_sorted_output = FALSE;
-                    result = ft_loader_fi_close(&bl->file_infos, fs->sorted_output, TRUE);
+                    fs->have_sorted_output = false;
+                    result = ft_loader_fi_close(&bl->file_infos, fs->sorted_output, true);
                 }
                 if (result == 0) {
                     FIDX sfile = FIDX_NULL;
@@ -1550,13 +1550,13 @@ int sort_and_write_rows (struct rowset rows, struct merge_fileset *fs, FTLOADER
                     if (result == 0) {
                         result = write_rowset_to_file(bl, sfile, rows);
                         if (result == 0) {
-                            fs->have_sorted_output = TRUE; fs->sorted_output = sfile;
+                            fs->have_sorted_output = true; fs->sorted_output = sfile;
                             // set the max key in the temp file to the max key in the sorted rowset
                             result = toku_dbt_set(rows.rows[rows.n_rows-1].klen, rows.data + rows.rows[rows.n_rows-1].off, &fs->prev_key, NULL);
                         }
                     }
                 }
-                // Note: if result == 0 then invariant fs->have_sorted_output == TRUE
+                // Note: if result == 0 then invariant fs->have_sorted_output == true
             }
         }
     }
@@ -1573,7 +1573,7 @@ int ft_loader_sort_and_write_rows (struct rowset *rows, struct merge_fileset *fs
     return sort_and_write_rows (*rows, fs, bl, which_db, dest_db, compare);
 }
 
-int toku_merge_some_files_using_dbufio (const BOOL to_q, FIDX dest_data, QUEUE q, int n_sources, DBUFIO_FILESET bfs, FIDX srcs_fidxs[/*n_sources*/], FTLOADER bl, int which_db, DB *dest_db, ft_compare_func compare, int progress_allocation)
+int toku_merge_some_files_using_dbufio (const bool to_q, FIDX dest_data, QUEUE q, int n_sources, DBUFIO_FILESET bfs, FIDX srcs_fidxs[/*n_sources*/], FTLOADER bl, int which_db, DB *dest_db, ft_compare_func compare, int progress_allocation)
 /* Effect: Given an array of FILE*'s each containing sorted, merge the data and write it to an output.  All the files remain open after the merge.
  *   This merge is performed in one pass, so don't pass too many files in.  If you need a tree of merges do it elsewhere.
  *   If TO_Q is true then we write rowsets into queue Q.  Otherwise we write into dest_data.
@@ -1598,7 +1598,7 @@ int toku_merge_some_files_using_dbufio (const BOOL to_q, FIDX dest_data, QUEUE q
     //printf(" merge_some_files progress=%d fin at %d\n", bl->progress, bl->progress+progress_allocation);
     DBT keys[n_sources];
     DBT vals[n_sources];
-    u_int64_t dataoff[n_sources];
+    uint64_t dataoff[n_sources];
     DBT zero = zero_dbt;  zero.flags=DB_DBT_REALLOC;
 
     for (int i=0; i<n_sources; i++) {
@@ -1614,7 +1614,7 @@ int toku_merge_some_files_using_dbufio (const BOOL to_q, FIDX dest_data, QUEUE q
         if (r!=0) result = r; 
     }
 
-    u_int64_t n_rows = 0;
+    uint64_t n_rows = 0;
     if (result==0) {
         // load pqueue with first value from each source
         for (int i=0; i<n_sources; i++) {
@@ -1642,7 +1642,7 @@ int toku_merge_some_files_using_dbufio (const BOOL to_q, FIDX dest_data, QUEUE q
             toku_mutex_unlock(&bl->file_infos.lock);
         }
     }
-    u_int64_t n_rows_done = 0;
+    uint64_t n_rows_done = 0;
 
     struct rowset *output_rowset = NULL;
     if (result==0 && to_q) {
@@ -1727,7 +1727,7 @@ int toku_merge_some_files_using_dbufio (const BOOL to_q, FIDX dest_data, QUEUE q
         }
  
         n_rows_done++;
-        const u_int64_t rows_per_report = size_factor*1024;
+        const uint64_t rows_per_report = size_factor*1024;
         if (n_rows_done%rows_per_report==0) {
             // need to update the progress.
             double fraction_of_remaining_we_just_did = (double)rows_per_report / (double)(n_rows - n_rows_done + rows_per_report);
@@ -1766,7 +1766,7 @@ int toku_merge_some_files_using_dbufio (const BOOL to_q, FIDX dest_data, QUEUE q
     return result;
 }
 
-static int merge_some_files (const BOOL to_q, FIDX dest_data, QUEUE q, int n_sources, FIDX srcs_fidxs[/*n_sources*/], FTLOADER bl, int which_db, DB *dest_db, ft_compare_func compare, int progress_allocation)
+static int merge_some_files (const bool to_q, FIDX dest_data, QUEUE q, int n_sources, FIDX srcs_fidxs[/*n_sources*/], FTLOADER bl, int which_db, DB *dest_db, ft_compare_func compare, int progress_allocation)
 {
     int result = 0;
     DBUFIO_FILESET bfs = NULL;
@@ -1838,8 +1838,8 @@ int merge_files (struct merge_fileset *fs,
 {
     //printf(" merge_files %d files\n", fs->n_temp_files);
     //printf(" merge_files use %d progress=%d fin at %d\n", progress_allocation, bl->progress, bl->progress+progress_allocation);
-    const int final_mergelimit   = (size_factor == 1) ? 4 : merge_fanin(bl, TRUE); // try for a merge to the leaf level
-    const int earlier_mergelimit = (size_factor == 1) ? 4 : merge_fanin(bl, FALSE); // try for a merge at nonleaf.
+    const int final_mergelimit   = (size_factor == 1) ? 4 : merge_fanin(bl, true); // try for a merge to the leaf level
+    const int earlier_mergelimit = (size_factor == 1) ? 4 : merge_fanin(bl, false); // try for a merge at nonleaf.
     int n_passes_left  = (fs->n_temp_files<=final_mergelimit)
         ? 1
         : 1+n_passes((fs->n_temp_files+final_mergelimit-1)/final_mergelimit, earlier_mergelimit);
@@ -1852,7 +1852,7 @@ int merge_files (struct merge_fileset *fs,
 
         invariant(fs->n_temp_files>0);
         struct merge_fileset next_file_set;
-        BOOL to_queue = (BOOL)(fs->n_temp_files <= final_mergelimit);
+        bool to_queue = (bool)(fs->n_temp_files <= final_mergelimit);
         init_merge_fileset(&next_file_set);
         while (fs->n_temp_files>0) {
             // grab some files and merge them.
@@ -1893,7 +1893,7 @@ int merge_files (struct merge_fileset *fs,
             for (int i=0; i<n_to_merge; i++) {
                 if (!fidx_is_null(data_fidxs[i])) {
                     {
-                        int r = ft_loader_fi_close(&bl->file_infos, data_fidxs[i], TRUE);
+                        int r = ft_loader_fi_close(&bl->file_infos, data_fidxs[i], true);
                         if (r!=0 && result==0) result = r;
                     }
                     {
@@ -1906,7 +1906,7 @@ int merge_files (struct merge_fileset *fs,
 
             fs->n_temp_files -= n_to_merge;
             if (!to_queue && !fidx_is_null(merged_data)) {
-                int r = ft_loader_fi_close(&bl->file_infos, merged_data, TRUE);
+                int r = ft_loader_fi_close(&bl->file_infos, merged_data, true);
                 if (r!=0 && result==0) result = r;
             }
             toku_free(data_fidxs);
@@ -1924,7 +1924,7 @@ int merge_files (struct merge_fileset *fs,
 
         if (result!=0) break;
     }
-    if (result) ft_loader_set_panic(bl, result, TRUE);
+    if (result) ft_loader_set_panic(bl, result, true);
 
     {
         int r = queue_eof(output_q);
@@ -2263,8 +2263,8 @@ static int toku_loader_write_ft_from_q (FTLOADER bl,
 
     TXNID le_xid = leafentry_xid(bl, which_db);
     struct leaf_buf *lbuf = start_leaf(&out, descriptor, lblock, le_xid, target_nodesize);
-    u_int64_t n_rows_remaining = bl->n_rows;
-    u_int64_t old_n_rows_remaining = bl->n_rows;
+    uint64_t n_rows_remaining = bl->n_rows;
+    uint64_t old_n_rows_remaining = bl->n_rows;
 
     uint64_t  used_estimate = 0;  // how much diskspace have we used up?
 
@@ -2277,7 +2277,7 @@ static int toku_loader_write_ft_from_q (FTLOADER bl,
             int rr = queue_deq(q, &item, NULL, NULL);
             if (rr == EOF) break;
             if (rr != 0) {
-                ft_loader_set_panic(bl, rr, TRUE); // error after cilk sync
+                ft_loader_set_panic(bl, rr, true); // error after cilk sync
                 break;
             }
         }
@@ -2312,7 +2312,7 @@ static int toku_loader_write_ft_from_q (FTLOADER bl,
 
                 invariant(maxkey.data != NULL);
                 if ((r = bl_write_dbt(&maxkey, pivots_stream, NULL, bl))) {
-                    ft_loader_set_panic(bl, r, TRUE); // error after cilk sync
+                    ft_loader_set_panic(bl, r, true); // error after cilk sync
                     if (result == 0) result = r;
                     break;
                 }
@@ -2322,7 +2322,7 @@ static int toku_loader_write_ft_from_q (FTLOADER bl,
 
                 r = allocate_block(&out, &lblock);
                 if (r != 0) {
-                    ft_loader_set_panic(bl, r, TRUE);
+                    ft_loader_set_panic(bl, r, true);
                     if (result == 0) result = r;
                     break;
                 }
@@ -2404,7 +2404,7 @@ static int toku_loader_write_ft_from_q (FTLOADER bl,
             char *XMALLOC_N(desc_size, buf);
             wbuf_init(&wbuf, buf, desc_size);
             toku_serialize_descriptor_contents_to_wbuf(&wbuf, descriptor);
-            u_int32_t checksum = x1764_finish(&wbuf.checksum);
+            uint32_t checksum = x1764_finish(&wbuf.checksum);
             wbuf_int(&wbuf, checksum);
             invariant(wbuf.ndone==desc_size);
             r = toku_os_write(out.fd, wbuf.buf, wbuf.ndone);
@@ -2540,8 +2540,8 @@ static int loader_do_i (FTLOADER bl,
             // ignore r2, since we already have an error
             goto error;
         }
-        invariant(bl->fractal_threads_live[which_db]==FALSE);
-        bl->fractal_threads_live[which_db] = TRUE;
+        invariant(bl->fractal_threads_live[which_db]==false);
+        bl->fractal_threads_live[which_db] = true;
 
         r = merge_files(fs, bl, which_db, dest_db, compare, allocation_for_merge, bl->fractal_queues[which_db]);
 
@@ -2552,7 +2552,7 @@ static int loader_do_i (FTLOADER bl,
             resource_assert_zero(r2);
             invariant(toku_pthread_retval==NULL);
             invariant(bl->fractal_threads_live[which_db]);
-            bl->fractal_threads_live[which_db] = FALSE;
+            bl->fractal_threads_live[which_db] = false;
             if (r == 0) r = fta.errno_result;
         }
     }
@@ -2606,7 +2606,7 @@ static int toku_ft_loader_close_internal (FTLOADER bl)
     invariant(bl->file_infos.n_files_extant == 0);
     invariant(bl->progress == PROGRESS_MAX);
  error:
-    toku_ft_loader_internal_destroy(bl, (BOOL)(result!=0));
+    toku_ft_loader_internal_destroy(bl, (bool)(result!=0));
     return result;
 }
 
@@ -2644,7 +2644,7 @@ int toku_ft_loader_close (FTLOADER bl,
         if (r && result == 0)
             result = r;
     } else
-        toku_ft_loader_internal_destroy(bl, TRUE);
+        toku_ft_loader_internal_destroy(bl, true);
 
     return result;
 }
@@ -2661,7 +2661,7 @@ int toku_ft_loader_finish_extractor(FTLOADER bl) {
     return result;
 }
 
-int toku_ft_loader_abort(FTLOADER bl, BOOL is_error) 
+int toku_ft_loader_abort(FTLOADER bl, bool is_error) 
 /* Effect : Abort the bulk loader, free ft_loader resources */
 {
     int result = 0;
@@ -2722,7 +2722,7 @@ static void finish_leafnode (struct dbout *out, struct leaf_buf *lbuf, int progr
     size_t serialized_leaf_size = 0;
     char *serialized_leaf = NULL;
     FTNODE_DISK_DATA ndd = NULL;
-    result = toku_serialize_ftnode_to_memory(lbuf->node, &ndd, target_basementnodesize, target_compression_method, TRUE, TRUE, &serialized_leaf_size, &serialized_leaf);
+    result = toku_serialize_ftnode_to_memory(lbuf->node, &ndd, target_basementnodesize, target_compression_method, true, true, &serialized_leaf_size, &serialized_leaf);
 
     // write it out
     if (result == 0) {
@@ -2751,7 +2751,7 @@ static void finish_leafnode (struct dbout *out, struct leaf_buf *lbuf, int progr
         result = update_progress(progress_allocation, bl, "wrote node");
 
     if (result)
-        ft_loader_set_panic(bl, result, TRUE);
+        ft_loader_set_panic(bl, result, true);
 }
 
 static int write_translation_table (struct dbout *out, long long *off_of_translation_p) {
@@ -2926,7 +2926,7 @@ static void write_nonleaf_node (FTLOADER bl, struct dbout *out, int64_t blocknum
         size_t n_bytes;
         char *bytes;
         int r;
-        r = toku_serialize_ftnode_to_memory(node, &ndd, target_basementnodesize, target_compression_method, TRUE, TRUE, &n_bytes, &bytes);
+        r = toku_serialize_ftnode_to_memory(node, &ndd, target_basementnodesize, target_compression_method, true, true, &n_bytes, &bytes);
         if (r) {
             result = r;
         } else {
@@ -2960,7 +2960,7 @@ static void write_nonleaf_node (FTLOADER bl, struct dbout *out, int64_t blocknum
     toku_free(subtree_info);
 
     if (result != 0)
-        ft_loader_set_panic(bl, result, TRUE);
+        ft_loader_set_panic(bl, result, true);
 }
 
 static int write_nonleaves (FTLOADER bl, FIDX pivots_fidx, struct dbout *out, struct subtrees_info *sts, const DESCRIPTOR descriptor, uint32_t target_nodesize, uint32_t target_basementnodesize, enum toku_compression_method target_compression_method) {
@@ -3066,7 +3066,7 @@ static int write_nonleaves (FTLOADER bl, FIDX pivots_fidx, struct dbout *out, st
             result = ft_loader_get_error(&bl->error_callback);
 
         // Now set things up for the next iteration.
-        int r = ft_loader_fi_close(&bl->file_infos, pivots_fidx, TRUE); if (r != 0 && result == 0) result = r;
+        int r = ft_loader_fi_close(&bl->file_infos, pivots_fidx, true); if (r != 0 && result == 0) result = r;
         r = ft_loader_fi_unlink(&bl->file_infos, pivots_fidx);    if (r != 0 && result == 0) result = r;
         pivots_fidx = next_pivots_file;
         toku_free(sts->subtrees); sts->subtrees = NULL;
@@ -3076,7 +3076,7 @@ static int write_nonleaves (FTLOADER bl, FIDX pivots_fidx, struct dbout *out, st
         if (result)
             break;
     }
-    { int r = ft_loader_fi_close (&bl->file_infos, pivots_fidx, TRUE); if (r != 0 && result == 0) result = r; }
+    { int r = ft_loader_fi_close (&bl->file_infos, pivots_fidx, true); if (r != 0 && result == 0) result = r; }
     { int r = ft_loader_fi_unlink(&bl->file_infos, pivots_fidx); if (r != 0 && result == 0) result = r; }
     return result;
 }
diff --git a/ft/ftloader.h b/ft/ftloader.h
index 68e5d25c3aba9a06cfc35049c11a8fe7174dbb1d..c7c9d2fea3247879c73505634abb2f123bb071d6 100644
--- a/ft/ftloader.h
+++ b/ft/ftloader.h
@@ -26,7 +26,7 @@ int toku_ft_loader_open (FTLOADER *bl,
 			  const char *temp_file_template,
                           LSN load_lsn,
                           TOKUTXN txn,
-                          BOOL reserve_memory);
+                          bool reserve_memory);
 
 int toku_ft_loader_put (FTLOADER bl, DBT *key, DBT *val);
 
@@ -35,7 +35,7 @@ int toku_ft_loader_close (FTLOADER bl,
 			   ft_loader_poll_func  poll_callback,  void *poll_callback_extra);
 
 int toku_ft_loader_abort(FTLOADER bl, 
-                          BOOL is_error);
+                          bool is_error);
 
 // For test purposes only
 void toku_ft_loader_set_size_factor (uint32_t factor);
diff --git a/ft/fttypes.h b/ft/fttypes.h
index 1c777e574b891daeba64f4246d0f8a2101a85bd2..ba297d47197c65a9b34edf5f246bf5980a1040f6 100644
--- a/ft/fttypes.h
+++ b/ft/fttypes.h
@@ -18,15 +18,7 @@
 #include <inttypes.h>
 
 
-#include <stdbool.h>
-#ifndef TRUE
-// In the future, use the stdbool bool and constants (true false), rather than BOOL, TRUE, and FALSE.
-#define TRUE true
-#define FALSE false
-typedef bool BOOL;
-#endif
-
-
+// Use the C++ bool and constants (true false), rather than BOOL, TRUE, and FALSE.
 
 typedef struct ft_handle *FT_HANDLE;
 typedef struct ftnode *FTNODE;
@@ -82,30 +74,30 @@ static inline PAIR_ATTR make_pair_attr(long size) {
         .leaf_size = 0, 
         .rollback_size = 0, 
         .cache_pressure_size = 0,
-        .is_valid = TRUE
+        .is_valid = true
     }; 
 #else
-    PAIR_ATTR result = {size, 0, 0, 0, 0, TRUE};
+    PAIR_ATTR result = {size, 0, 0, 0, 0, true};
 #endif
     return result; 
 }
 
 typedef struct {
-    u_int32_t len;
+    uint32_t len;
     char *data;
 } BYTESTRING;
 
 /* Log Sequence Number (LSN)
  * Make the LSN be a struct instead of an integer so that we get better type checking. */
-typedef struct __toku_lsn { u_int64_t lsn; } LSN;
+typedef struct __toku_lsn { uint64_t lsn; } LSN;
 #define ZERO_LSN ((LSN){0})
 #define MAX_LSN  ((LSN){UINT64_MAX})
 
 /* Message Sequence Number (MSN)
  * Make the MSN be a struct instead of an integer so that we get better type checking. */
-typedef struct __toku_msn { u_int64_t msn; } MSN;
+typedef struct __toku_msn { uint64_t msn; } MSN;
 #define ZERO_MSN ((MSN){0})                 // dummy used for message construction, to be filled in when msg is applied to tree
-#define MIN_MSN  ((MSN){(u_int64_t)1 << 62})  // first 2^62 values reserved for messages created before Dr. No (for upgrade)
+#define MIN_MSN  ((MSN){(uint64_t)1 << 62})  // first 2^62 values reserved for messages created before Dr. No (for upgrade)
 #define MAX_MSN  ((MSN){UINT64_MAX})
 
 typedef struct {
@@ -120,14 +112,14 @@ static const STAT64INFO_S ZEROSTATS = {0,0};
  * With the introduction of the loader (ticket 2216), it is possible for the file that holds
  * an open dictionary to change, so these are now separate and independent unique identifiers.
  */
-typedef struct {u_int32_t fileid;} FILENUM;
+typedef struct {uint32_t fileid;} FILENUM;
 #define FILENUM_NONE ((FILENUM){UINT32_MAX})
 
-typedef struct {u_int64_t dictid;} DICTIONARY_ID;
+typedef struct {uint64_t dictid;} DICTIONARY_ID;
 #define DICTIONARY_ID_NONE ((DICTIONARY_ID){0})
 
 typedef struct {
-    u_int32_t num;
+    uint32_t num;
     FILENUM  *filenums;
 } FILENUMS;
 
@@ -166,10 +158,10 @@ enum ft_msg_type {
     FT_UPDATE_BROADCAST_ALL = 15
 };
 
-static inline BOOL
+static inline bool
 ft_msg_type_applies_once(enum ft_msg_type type)
 {
-    BOOL ret_val;
+    bool ret_val;
     switch (type) {
     case FT_INSERT_NO_OVERWRITE:
     case FT_INSERT:
@@ -177,7 +169,7 @@ ft_msg_type_applies_once(enum ft_msg_type type)
     case FT_ABORT_ANY:
     case FT_COMMIT_ANY:
     case FT_UPDATE:
-        ret_val = TRUE;
+        ret_val = true;
         break;
     case FT_COMMIT_BROADCAST_ALL:
     case FT_COMMIT_BROADCAST_TXN:
@@ -186,18 +178,18 @@ ft_msg_type_applies_once(enum ft_msg_type type)
     case FT_OPTIMIZE_FOR_UPGRADE:
     case FT_UPDATE_BROADCAST_ALL:
     case FT_NONE:
-        ret_val = FALSE;
+        ret_val = false;
         break;
     default:
-        assert(FALSE);
+        assert(false);
     }
     return ret_val;
 }
 
-static inline BOOL
+static inline bool
 ft_msg_type_applies_all(enum ft_msg_type type)
 {
-    BOOL ret_val;
+    bool ret_val;
     switch (type) {
     case FT_NONE:
     case FT_INSERT_NO_OVERWRITE:
@@ -206,7 +198,7 @@ ft_msg_type_applies_all(enum ft_msg_type type)
     case FT_ABORT_ANY:
     case FT_COMMIT_ANY:
     case FT_UPDATE:
-        ret_val = FALSE;
+        ret_val = false;
         break;
     case FT_COMMIT_BROADCAST_ALL:
     case FT_COMMIT_BROADCAST_TXN:
@@ -214,15 +206,15 @@ ft_msg_type_applies_all(enum ft_msg_type type)
     case FT_OPTIMIZE:
     case FT_OPTIMIZE_FOR_UPGRADE:
     case FT_UPDATE_BROADCAST_ALL:
-        ret_val = TRUE;
+        ret_val = true;
         break;
     default:
-        assert(FALSE);
+        assert(false);
     }
     return ret_val;
 }
 
-static inline BOOL
+static inline bool
 ft_msg_type_does_nothing(enum ft_msg_type type)
 {
     return (type == FT_NONE);
diff --git a/ft/ftverify.cc b/ft/ftverify.cc
index 4ac4f49387ed5a3e01a93ce5ea439c051dcdf062..ed01a18ca03b154a9481da8c4f670b168f053ab5 100644
--- a/ft/ftverify.cc
+++ b/ft/ftverify.cc
@@ -14,7 +14,6 @@
 
 #include <fcntl.h>
 #include <math.h>
-#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/stat.h>
@@ -40,9 +39,9 @@ static double pct = 0.5;
 struct verify_block_extra {
     BLOCKNUM b;
     int n_sub_blocks;
-    u_int32_t header_length;
-    u_int32_t calc_xsum;
-    u_int32_t stored_xsum;
+    uint32_t header_length;
+    uint32_t calc_xsum;
+    uint32_t stored_xsum;
     bool header_valid;
     bool sub_blocks_valid;
     struct sub_block_info *sub_block_results;
@@ -90,13 +89,13 @@ deserialize_headers(int fd, struct ft **h1p, struct ft **h2p)
 {
     struct rbuf rb_0;
     struct rbuf rb_1;
-    u_int64_t checkpoint_count_0;
-    u_int64_t checkpoint_count_1;
+    uint64_t checkpoint_count_0;
+    uint64_t checkpoint_count_1;
     LSN checkpoint_lsn_0;
     LSN checkpoint_lsn_1;
-    u_int32_t version_0, version_1;
-    BOOL h0_acceptable = FALSE;
-    BOOL h1_acceptable = FALSE;
+    uint32_t version_0, version_1;
+    bool h0_acceptable = false;
+    bool h1_acceptable = false;
     int r0, r1;
     int r;
 
@@ -111,7 +110,7 @@ deserialize_headers(int fd, struct ft **h1p, struct ft **h2p)
             &version_0
             );
         if ((r0==0) && (checkpoint_lsn_0.lsn <= MAX_LSN.lsn)) {
-            h0_acceptable = TRUE;
+            h0_acceptable = true;
         }
     }
     {
@@ -125,7 +124,7 @@ deserialize_headers(int fd, struct ft **h1p, struct ft **h2p)
             &version_1
             );
         if ((r1==0) && (checkpoint_lsn_1.lsn <= MAX_LSN.lsn)) {
-            h1_acceptable = TRUE;
+            h1_acceptable = true;
         }
     }
 
@@ -284,8 +283,8 @@ check_block(BLOCKNUM blocknum, int64_t UU(blocksize), int64_t UU(address), void
     // Using the node info, decompress all the keys and pivots to
     // detect any corruptions.
     for (int i = 0; i < node->n_children; ++i) {
-        u_int32_t curr_offset = BP_START(ndd,i);
-        u_int32_t curr_size   = BP_SIZE(ndd,i);
+        uint32_t curr_offset = BP_START(ndd,i);
+        uint32_t curr_size   = BP_SIZE(ndd,i);
         struct rbuf curr_rbuf = {.buf = NULL, .size = 0, .ndone = 0};
         rbuf_init(&curr_rbuf, rb.buf + curr_offset, curr_size);
         struct sub_block curr_sb;
diff --git a/ft/hash-benchmarks/hash-benchmark-manually-open.cc b/ft/hash-benchmarks/hash-benchmark-manually-open.cc
index 6ec7206efb542913a5fbef27b980287b9fa8886b..db7fade7cf625aa717860a38e9922956dafa6503 100644
--- a/ft/hash-benchmarks/hash-benchmark-manually-open.cc
+++ b/ft/hash-benchmarks/hash-benchmark-manually-open.cc
@@ -39,13 +39,13 @@ int sum32 (int start, void *buf, int bytecount)  {
     return start;
 }
 
-static const u_int32_t m = 0x5bd1e995;
+static const uint32_t m = 0x5bd1e995;
 static const int r = 24;
-static const u_int32_t seed = 0x3dd3b51a;
+static const uint32_t seed = 0x3dd3b51a;
 
 #define USE_ZERO_CHECKSUM 0
 
-static u_int32_t MurmurHash2 ( const void * key, int len)
+static uint32_t MurmurHash2 ( const void * key, int len)
 {
     if (USE_ZERO_CHECKSUM) return 0;
 
@@ -55,7 +55,7 @@ static u_int32_t MurmurHash2 ( const void * key, int len)
 
     // Initialize the hash to a 'random' value
 
-    u_int32_t h = seed;
+    uint32_t h = seed;
 
     // Mix 4 bytes at a time into the hash
 
@@ -63,7 +63,7 @@ static u_int32_t MurmurHash2 ( const void * key, int len)
 
     while(len >= 4)
 	{
-	    u_int32_t k = *(u_int32_t *)data;
+	    uint32_t k = *(uint32_t *)data;
 
 	    k *= m; 
 	    k ^= k >> r; 
@@ -98,8 +98,8 @@ static u_int32_t MurmurHash2 ( const void * key, int len)
 
 struct murmur {
     int n_bytes_in_k;  // How many bytes in k
-    u_int32_t k;       // These are the extra bytes.   Bytes are shifted into the low-order bits.
-    u_int32_t h;       // The hash so far (up to the most recent 4-byte boundary)
+    uint32_t k;       // These are the extra bytes.   Bytes are shifted into the low-order bits.
+    uint32_t h;       // The hash so far (up to the most recent 4-byte boundary)
 };
 
 void murmur_init (struct murmur *mm) {
@@ -123,9 +123,9 @@ void murmur_add (struct murmur *mm, const void * key, unsigned int len) {
     if (USE_ZERO_CHECKSUM) return;
     if (len==0) return;
     const int n_bytes_in_k =  mm->n_bytes_in_k;
-    u_int32_t k = mm->k;
+    uint32_t k = mm->k;
     const unsigned char *data = key;
-    u_int32_t h = mm->h;
+    uint32_t h = mm->h;
     switch (n_bytes_in_k) {
     case 0:
 	switch (len) {
@@ -162,7 +162,7 @@ void murmur_add (struct murmur *mm, const void * key, unsigned int len) {
     // We've used up the partial bytes at the beginning of k.
     assert(mm->n_bytes_in_k==0);
     while (len >= 4) {
-	u_int32_t k = toku_dtoh32(*(u_int32_t *)data);
+	uint32_t k = toku_dtoh32(*(uint32_t *)data);
 	//printf(" oldh=%08x k=%08x", h, k);
 
 	k *= m; 
@@ -179,7 +179,7 @@ void murmur_add (struct murmur *mm, const void * key, unsigned int len) {
     mm->h=h;
     //printf("%s:%d h=%08x\n", __FILE__, __LINE__, h);
     {
-	u_int32_t k=0;
+	uint32_t k=0;
 	switch (len) {
 	case 3: k =  *data << 16;  data++;
 	case 2: k |= *data << 8;   data++;
@@ -192,9 +192,9 @@ void murmur_add (struct murmur *mm, const void * key, unsigned int len) {
     }
 }
 
-u_int32_t murmur_finish (struct murmur *mm) {
+uint32_t murmur_finish (struct murmur *mm) {
     if (USE_ZERO_CHECKSUM) return 0;
-    u_int32_t h = mm->h;
+    uint32_t h = mm->h;
     if (mm->n_bytes_in_k>0) {
 	h ^= mm->k;
 	h *= m;
@@ -209,7 +209,7 @@ u_int32_t murmur_finish (struct murmur *mm) {
 }
 
 struct sum84 {
-    u_int32_t sum;
+    uint32_t sum;
     int i;
 };
 void sum84_init (struct sum84 *s) { s->sum=0; s->i=0; };
@@ -233,7 +233,7 @@ int sum84_finish (struct sum84 *s) {
     return s->sum;
 }
 
-u_int32_t xor8_add  (u_int32_t x, char *buf, int count) {
+uint32_t xor8_add  (uint32_t x, char *buf, int count) {
     while (count>4) {
 	x ^= *(int*)buf;
 	buf+=4; count-=4;
@@ -245,13 +245,13 @@ u_int32_t xor8_add  (u_int32_t x, char *buf, int count) {
     }
     return x;
 }
-u_int32_t xor8_finish (u_int32_t x) {
+uint32_t xor8_finish (uint32_t x) {
     return (x ^ (x>>8) ^ (x>>16) ^ (x>>24))&0xff;
 }
 
-u_int64_t xor8_64_add  (u_int64_t x, char *buf, int count) {
+uint64_t xor8_64_add  (uint64_t x, char *buf, int count) {
     while (count>8) {
-	x ^= *(u_int64_t*)buf;
+	x ^= *(uint64_t*)buf;
 	buf+=8; count-=8;
     }
     while (count>0) {
@@ -261,7 +261,7 @@ u_int64_t xor8_64_add  (u_int64_t x, char *buf, int count) {
     }
     return x;
 }
-u_int32_t xor8_64_finish (u_int64_t x) {
+uint32_t xor8_64_finish (uint64_t x) {
     return (x ^ (x>>8) ^ (x>>16) ^ (x>>24) ^ (x>>32) ^ (x>>40) ^ (x>>48) ^ (x>>56))&0xff;
 }
 
@@ -281,7 +281,7 @@ static void measure_bandwidths (void) {
     measure_bandwidth("murmurby2", ({ struct murmur mm; murmur_init(&mm); int j; for(j=0; j<N; j+=2) murmur_add(&mm, buf+j, 2); c=murmur_finish(&mm); }));
     measure_bandwidth("sum84by1 ", ({ struct sum84 s; sum84_init(&s); int j; for(j=0; j<N; j++) sum84_add(&s, buf+j, 1); c=sum84_finish(&s); }));
     measure_bandwidth("xor8by1  ", ({ int j; c=0; for(j=0; j<N; j++) c=xor8_add(c, buf+j, 1); c=xor8_finish(c); }));
-    measure_bandwidth("xor864by1", ({ int j; u_int64_t x=0; for(j=0; j<N; j++) x=xor8_64_add(x, buf+j, 1); c=xor8_64_finish(x); }));
+    measure_bandwidth("xor864by1", ({ int j; uint64_t x=0; for(j=0; j<N; j++) x=xor8_64_add(x, buf+j, 1); c=xor8_64_finish(x); }));
 }
 
 int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) {
diff --git a/ft/hash-benchmarks/hash-benchmark.cc b/ft/hash-benchmarks/hash-benchmark.cc
index 9a8ba65d8007d5e1dfb4527a7e6fe7eb9893b123..5b329cbd72145dd49dcab2064cb2ae60151b0604 100644
--- a/ft/hash-benchmarks/hash-benchmark.cc
+++ b/ft/hash-benchmarks/hash-benchmark.cc
@@ -44,9 +44,9 @@ int sum32 (void *buf, int bytecount)  {
     return start;
 }
 
-u_int64_t sum64 (void *buf, int bytecount)  {
-    u_int64_t *ibuf = buf;
-    u_int64_t start = 0;
+uint64_t sum64 (void *buf, int bytecount)  {
+    uint64_t *ibuf = buf;
+    uint64_t start = 0;
     assert(bytecount%8==0);
     while (bytecount>0) {
 	start+=*ibuf;
@@ -56,13 +56,13 @@ u_int64_t sum64 (void *buf, int bytecount)  {
     return start;
 }
 
-static const u_int32_t m = 0x5bd1e995;
+static const uint32_t m = 0x5bd1e995;
 static const int r = 24;
-static const u_int32_t seed = 0x3dd3b51a;
+static const uint32_t seed = 0x3dd3b51a;
 
 #define USE_ZERO_CHECKSUM 0
 
-static u_int32_t MurmurHash2 ( const void * key, int len)
+static uint32_t MurmurHash2 ( const void * key, int len)
 {
     if (USE_ZERO_CHECKSUM) return 0;
 
@@ -72,7 +72,7 @@ static u_int32_t MurmurHash2 ( const void * key, int len)
 
     // Initialize the hash to a 'random' value
 
-    u_int32_t h = seed;
+    uint32_t h = seed;
 
     // Mix 4 bytes at a time into the hash
 
@@ -80,7 +80,7 @@ static u_int32_t MurmurHash2 ( const void * key, int len)
 
     while(len >= 4)
 	{
-	    u_int32_t k = *(u_int32_t *)data;
+	    uint32_t k = *(uint32_t *)data;
 
 	    k *= m; 
 	    k ^= k >> r; 
@@ -115,8 +115,8 @@ static u_int32_t MurmurHash2 ( const void * key, int len)
 
 struct murmur {
     int n_bytes_in_k;  // How many bytes in k
-    u_int32_t k;       // These are the extra bytes.   Bytes are shifted into the low-order bits.
-    u_int32_t h;       // The hash so far (up to the most recent 4-byte boundary)
+    uint32_t k;       // These are the extra bytes.   Bytes are shifted into the low-order bits.
+    uint32_t h;       // The hash so far (up to the most recent 4-byte boundary)
 };
 
 void murmur_init (struct murmur *mm) {
@@ -129,11 +129,11 @@ inline void murmur_add (struct murmur *mm, const void * key, unsigned int len) {
     if (USE_ZERO_CHECKSUM) return;
     assert(mm->n_bytes_in_k<4);
     const unsigned char *data = key;
-    u_int32_t h = mm->h;
+    uint32_t h = mm->h;
     {
 	int n_bytes_in_k =  mm->n_bytes_in_k;
 	if (n_bytes_in_k>0) {
-	    u_int32_t k = mm->k;
+	    uint32_t k = mm->k;
 	    while (n_bytes_in_k<4 && len>0) {
 		k = (k << 8) | *data;
 		n_bytes_in_k++;
@@ -162,7 +162,7 @@ inline void murmur_add (struct murmur *mm, const void * key, unsigned int len) {
     // We've used up the partial bytes at the beginning of k.
     assert(mm->n_bytes_in_k==0);
     while (len >= 4) {
-	u_int32_t k = toku_dtoh32(*(u_int32_t *)data);
+	uint32_t k = toku_dtoh32(*(uint32_t *)data);
 	//printf(" oldh=%08x k=%08x", h, k);
 
 	k *= m; 
@@ -179,7 +179,7 @@ inline void murmur_add (struct murmur *mm, const void * key, unsigned int len) {
     mm->h=h;
     //printf("%s:%d h=%08x\n", __FILE__, __LINE__, h);
     {
-	u_int32_t k=0;
+	uint32_t k=0;
 	switch (len) {
 	case 3: k =  *data << 16;  data++;
 	case 2: k |= *data << 8;   data++;
@@ -192,9 +192,9 @@ inline void murmur_add (struct murmur *mm, const void * key, unsigned int len) {
     }
 }
 
-u_int32_t murmur_finish (struct murmur *mm) {
+uint32_t murmur_finish (struct murmur *mm) {
     if (USE_ZERO_CHECKSUM) return 0;
-    u_int32_t h = mm->h;
+    uint32_t h = mm->h;
     if (mm->n_bytes_in_k>0) {
 	h ^= mm->k;
 	h *= m;
@@ -209,7 +209,7 @@ u_int32_t murmur_finish (struct murmur *mm) {
 }
 
 struct sum84 {
-    u_int32_t sum;
+    uint32_t sum;
     int i;
 };
 void sum84_init (struct sum84 *s) { s->sum=0; s->i=0; };
@@ -233,7 +233,7 @@ int sum84_finish (struct sum84 *s) {
     return s->sum;
 }
 
-u_int32_t xor8_add  (u_int32_t x, unsigned char *buf, int count) {
+uint32_t xor8_add  (uint32_t x, unsigned char *buf, int count) {
     while (count>4) {
 	x ^= *(int*)buf;
 	buf+=4; count-=4;
@@ -245,13 +245,13 @@ u_int32_t xor8_add  (u_int32_t x, unsigned char *buf, int count) {
     }
     return x;
 }
-u_int32_t xor8_finish (u_int32_t x) {
+uint32_t xor8_finish (uint32_t x) {
     return (x ^ (x>>8) ^ (x>>16) ^ (x>>24))&0xff;
 }
 
-u_int64_t xor8_64_add  (u_int64_t x, unsigned char *buf, int count) {
+uint64_t xor8_64_add  (uint64_t x, unsigned char *buf, int count) {
     while (count>8) {
-	x ^= *(u_int64_t*)buf;
+	x ^= *(uint64_t*)buf;
 	buf+=8; count-=8;
     }
     while (count>0) {
@@ -261,7 +261,7 @@ u_int64_t xor8_64_add  (u_int64_t x, unsigned char *buf, int count) {
     }
     return x;
 }
-u_int32_t xor8_64_finish (u_int64_t x) {
+uint32_t xor8_64_finish (uint64_t x) {
     return (x ^ (x>>8) ^ (x>>16) ^ (x>>24) ^ (x>>32) ^ (x>>40) ^ (x>>48) ^ (x>>56))&0xff;
 }
 
@@ -837,7 +837,7 @@ inline local unsigned long crc32_big(crc, buf, len)
 #endif /* BYFOUR */
 
 // Character-by-character implementation of x17.
-static u_int32_t x17c (u_int32_t c, void *buf, int len) {
+static uint32_t x17c (uint32_t c, void *buf, int len) {
     int i;
     unsigned char *cbuf=buf;
     for (i=0; i<len; i++) {
@@ -847,14 +847,14 @@ static u_int32_t x17c (u_int32_t c, void *buf, int len) {
 }
 
 // x17 using shorts
-static u_int32_t x17s (u_int32_t c, void *buf, int len) {
+static uint32_t x17s (uint32_t c, void *buf, int len) {
     unsigned char *cbuf=buf;
     while ((((long)cbuf)&1 ) && len) {
 	c = c*17 + *cbuf;
 	len--; cbuf++;
     }
     while (len>2) {
-	u_int16_t s = *(u_int16_t*)cbuf;
+	uint16_t s = *(uint16_t*)cbuf;
 	c = c*17*17 + (s&0xff)*17 + (s>>8);
 	len-=2; cbuf+=2;
     }
@@ -865,14 +865,14 @@ static u_int32_t x17s (u_int32_t c, void *buf, int len) {
     return c;
 }
 
-static u_int32_t x17i (u_int32_t c, void *buf, int len) {
+static uint32_t x17i (uint32_t c, void *buf, int len) {
     unsigned char *cbuf=buf;
     while ((((long)cbuf)&3 ) && len) {
 	c = c*17 + *cbuf;
 	len--; cbuf++;
     }
     while (len>4) {
-	u_int32_t l = *(u_int32_t*)cbuf;
+	uint32_t l = *(uint32_t*)cbuf;
 	c = c*17*17*17*17 + (l&0xff)*17*17*17 + ((l>>8)&0xff)*17*17 + ((l>>16)&0xff)*17 + ((l>>24)&0xff);
 	len-=4; cbuf+=4;
     }
@@ -883,10 +883,10 @@ static u_int32_t x17i (u_int32_t c, void *buf, int len) {
     return c;
 }
 
-u_int32_t l17_fast64 (const void *buf, int len) {
+uint32_t l17_fast64 (const void *buf, int len) {
     assert(len%8==0);
-    const u_int64_t *lbuf=buf;
-    u_int64_t c=0;
+    const uint64_t *lbuf=buf;
+    uint64_t c=0;
     while (len>0) {
 	c = c*17 + *lbuf;
 	if (PRINT) printf("%d: c=%016lx sum=%016lx\n", __LINE__, *lbuf, c);
@@ -896,8 +896,8 @@ u_int32_t l17_fast64 (const void *buf, int len) {
     return c&0xFFFFFFFF;
 }
 struct l1764 {
-    u_int64_t sum;
-    u_int64_t input;
+    uint64_t sum;
+    uint64_t input;
     int n_input_bytes;
 };
 void l1764_init(struct l1764 *l) {
@@ -911,7 +911,7 @@ inline void l1764_add (struct l1764 *l, const void *vbuf, int len) {
     const unsigned char *cbuf = vbuf;
     // Special case short inputs
     if (len==1) {
-	u_int64_t input = l->input | ((u_int64_t)(*cbuf))<<(8*n_input_bytes);
+	uint64_t input = l->input | ((uint64_t)(*cbuf))<<(8*n_input_bytes);
 	n_input_bytes++;
 	if (n_input_bytes==8) {
 	    l->sum = l->sum*17 + input;
@@ -923,8 +923,8 @@ inline void l1764_add (struct l1764 *l, const void *vbuf, int len) {
 	}
 	return;
     } else if (len==2) {
-	u_int64_t input = l->input;
-	u_int64_t thisv = ((u_int64_t)(*(u_int16_t*)cbuf));
+	uint64_t input = l->input;
+	uint64_t thisv = ((uint64_t)(*(uint16_t*)cbuf));
 	if (n_input_bytes==7) {
 	    l->sum = l->sum*17 + (input | (thisv<<(8*7)));
 	    l->input = thisv>>8;
@@ -940,14 +940,14 @@ inline void l1764_add (struct l1764 *l, const void *vbuf, int len) {
 	return;
     }
 
-    u_int64_t sum;
+    uint64_t sum;
     //assert(len>=0);
     if (n_input_bytes) {
-	u_int64_t input = l->input;
+	uint64_t input = l->input;
 	if (len>=8) {
 	    sum = l->sum;
 	    while (len>=8) {
-		u_int64_t thisv = *(u_int64_t*)cbuf;
+		uint64_t thisv = *(uint64_t*)cbuf;
 		input |= thisv<<(8*n_input_bytes);
 		sum = sum*17 + input;
 		if (PRINT) printf("%d: input=%016lx sum=%016lx\n", __LINE__, input, sum);
@@ -961,7 +961,7 @@ inline void l1764_add (struct l1764 *l, const void *vbuf, int len) {
 	    l->sum = sum;
 	}
 	if (len>=4) {
-	    u_int64_t thisv = *(u_int32_t*)cbuf;
+	    uint64_t thisv = *(uint32_t*)cbuf;
 	    if (n_input_bytes<4) {
 		input |= thisv<<(8*n_input_bytes);
 		if (PRINT) printf("%d: input=%016lx\n", __LINE__, input);
@@ -980,7 +980,7 @@ inline void l1764_add (struct l1764 *l, const void *vbuf, int len) {
 	}
 	//assert(n_input_bytes<=8);
 	while (n_input_bytes<8 && len) {
-	    input |= ((u_int64_t)(*cbuf))<<(8*n_input_bytes);
+	    input |= ((uint64_t)(*cbuf))<<(8*n_input_bytes);
 	    n_input_bytes++;
 	    cbuf++;
 	    len--;
@@ -1000,53 +1000,53 @@ inline void l1764_add (struct l1764 *l, const void *vbuf, int len) {
     }
     //assert(len>=0);
     while (len>=8) {
-	sum = sum*17 + *(u_int64_t*)cbuf;
+	sum = sum*17 + *(uint64_t*)cbuf;
 	cbuf+=8;
 	len -=8;
     }
     l->sum = sum;
     n_input_bytes = 0;
-    u_int64_t input;
+    uint64_t input;
     l->n_input_bytes = len;
     // Surprisingly, the loop is the fastest on bradley's laptop. 
     if (1) {
 	int i;
 	input=0;
 	for (i=0; i<len; i++) {
-	    input |= ((u_int64_t)(cbuf[i]))<<(8*i);
+	    input |= ((uint64_t)(cbuf[i]))<<(8*i);
 	}
     } else if (0) {
 	switch (len) {
-	case 7: input = ((u_int64_t)(*(u_int32_t*)(cbuf))) | (((u_int64_t)(*(u_int16_t*)(cbuf+4)))<<32) | (((u_int64_t)(*(cbuf+4)))<<48); break;
-	case 6: input = ((u_int64_t)(*(u_int32_t*)(cbuf))) | (((u_int64_t)(*(u_int16_t*)(cbuf+4)))<<32); break;
-	case 5: input = ((u_int64_t)(*(u_int32_t*)(cbuf))) | (((u_int64_t)(*(cbuf+4)))<<32); break;
-	case 4: input = ((u_int64_t)(*(u_int32_t*)(cbuf))); break;
-	case 3: input = ((u_int64_t)(*(u_int16_t*)(cbuf))) | (((u_int64_t)(*(cbuf+2)))<<16); break;
-	case 2: input = ((u_int64_t)(*(u_int16_t*)(cbuf))); break;
-	case 1: input = ((u_int64_t)(*cbuf)); break;
+	case 7: input = ((uint64_t)(*(uint32_t*)(cbuf))) | (((uint64_t)(*(uint16_t*)(cbuf+4)))<<32) | (((uint64_t)(*(cbuf+4)))<<48); break;
+	case 6: input = ((uint64_t)(*(uint32_t*)(cbuf))) | (((uint64_t)(*(uint16_t*)(cbuf+4)))<<32); break;
+	case 5: input = ((uint64_t)(*(uint32_t*)(cbuf))) | (((uint64_t)(*(cbuf+4)))<<32); break;
+	case 4: input = ((uint64_t)(*(uint32_t*)(cbuf))); break;
+	case 3: input = ((uint64_t)(*(uint16_t*)(cbuf))) | (((uint64_t)(*(cbuf+2)))<<16); break;
+	case 2: input = ((uint64_t)(*(uint16_t*)(cbuf))); break;
+	case 1: input = ((uint64_t)(*cbuf)); break;
 	case 0: input = 0;                      break;
 	default: abort();
 	}
     } else {
 	input=0;
 	int i=0;
-	if (len>=4) { input  = ((u_int64_t)(*(u_int32_t*)(cbuf)));        cbuf+=4; len-=4; i=4;}
-	if (len>=2) { input |= ((u_int64_t)(*(u_int16_t*)(cbuf)))<<(i*8); cbuf+=2; len-=2; i+=2; }
-	if (len>=1) { input |= ((u_int64_t)(*(u_int8_t *)(cbuf)))<<(i*8); /*cbuf+=1; len-=1; i++;*/ }
+	if (len>=4) { input  = ((uint64_t)(*(uint32_t*)(cbuf)));        cbuf+=4; len-=4; i=4;}
+	if (len>=2) { input |= ((uint64_t)(*(uint16_t*)(cbuf)))<<(i*8); cbuf+=2; len-=2; i+=2; }
+	if (len>=1) { input |= ((uint64_t)(*(uint8_t *)(cbuf)))<<(i*8); /*cbuf+=1; len-=1; i++;*/ }
     }
     l->input = input;
     if (PRINT) printf("%d: n_input_bytes=%d\n", __LINE__, l->n_input_bytes);
 }
-u_int32_t l1764_finish (struct l1764 *l) {
+uint32_t l1764_finish (struct l1764 *l) {
     if (PRINT) printf("%d: n_input_bytes=%d\n", __LINE__, l->n_input_bytes);
     assert(l->n_input_bytes==0);
     return (l->sum)&0xffffffff;
 }
 
-u_int32_t l17_fast (const void *buf, int len) {
+uint32_t l17_fast (const void *buf, int len) {
     assert(len%4==0);
-    const u_int32_t *lbuf=buf;
-    u_int32_t c=0;
+    const uint32_t *lbuf=buf;
+    uint32_t c=0;
     while (len>0) {
 	c = c*17 + *lbuf;
 	lbuf++;
@@ -1056,8 +1056,8 @@ u_int32_t l17_fast (const void *buf, int len) {
 }
 
 struct l17 {
-    u_int32_t sum;
-    u_int32_t input;
+    uint32_t sum;
+    uint32_t input;
     int       input_len;
 };
 void l17_init (struct l17 *l17) {
@@ -1108,7 +1108,7 @@ static void measure_bandwidths (void) {
     measure_bandwidth("murmurby2", ({ struct murmur mm; murmur_init(&mm); int j; for(j=0; j<N; j+=2) murmur_add(&mm, buf+j, 2); c=murmur_finish(&mm); }));
     measure_bandwidth("sum84by1 ", ({ struct sum84 s; sum84_init(&s); int j; for(j=0; j<N; j++) sum84_add(&s, buf+j, 1); c=sum84_finish(&s); }));
     measure_bandwidth("xor8by1  ", ({ int j; c=0; for(j=0; j<N; j++) c=xor8_add(c, buf+j, 1); c=xor8_finish(c); }));
-    measure_bandwidth("xor864by1", ({ int j; u_int64_t x=0; for(j=0; j<N; j++) x=xor8_64_add(x, buf+j, 1); c=xor8_64_finish(x); }));
+    measure_bandwidth("xor864by1", ({ int j; uint64_t x=0; for(j=0; j<N; j++) x=xor8_64_add(x, buf+j, 1); c=xor8_64_finish(x); }));
 }
 
 int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) {
diff --git a/ft/hashfun.h b/ft/hashfun.h
index 87ec4ddcbb701a25f0233bbfe6e672b632c53ec1..e7102e871e79a2a2aecad1833e3ea386d9caf196 100644
--- a/ft/hashfun.h
+++ b/ft/hashfun.h
@@ -10,11 +10,11 @@
 
 // FNV Hash: From an idea sent by Glenn Fowler and Phong Vo to the IEEE POSIX 1003.2 committee.  Landon Curt Noll improved it.
 // See: http://isthe.com/chongo/tech/comp/fnv/
-static inline u_int32_t hash_key_extend(u_int32_t initial_hash,
+static inline uint32_t hash_key_extend(uint32_t initial_hash,
                                         const unsigned char *key,
                                         size_t keylen) {
     size_t i;
-    u_int32_t hash = initial_hash;
+    uint32_t hash = initial_hash;
     for (i=0; i<keylen; i++, key++) {
         hash *= 16777619;
         // GCC 4.1.2 -O2 and -O3 translates the following shifts back into the multiply shown on the line above here.
@@ -25,7 +25,7 @@ static inline u_int32_t hash_key_extend(u_int32_t initial_hash,
     return hash;
 }
 
-static inline u_int32_t hash_key(const unsigned char *key, size_t keylen) {
+static inline uint32_t hash_key(const unsigned char *key, size_t keylen) {
     return hash_key_extend(0, key, keylen);
 }
 
diff --git a/ft/kibbutz.cc b/ft/kibbutz.cc
index 66266c05a3a4ba233f61d3ba009342ec7c48984d..60cce5f9e8ce0378beb47ae8bc2aec6504097b4a 100644
--- a/ft/kibbutz.cc
+++ b/ft/kibbutz.cc
@@ -5,7 +5,6 @@
 #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
 
 #include <config.h>
-#include <stdbool.h>
 #include <toku_pthread.h>
 #include "kibbutz.h"
 #include "includes.h"
diff --git a/ft/le-cursor.h b/ft/le-cursor.h
index 3d8bf3c9fff7cabe6bb6f5beb41959b6bac4b316..6df96eee824bbb75de0f98e09514a43f5fb87567 100644
--- a/ft/le-cursor.h
+++ b/ft/le-cursor.h
@@ -34,11 +34,11 @@ int toku_le_cursor_close(LE_CURSOR le_cursor);
 // Failure: returns a non-zero error number
 int toku_le_cursor_next(LE_CURSOR le_cursor, FT_GET_CALLBACK_FUNCTION getf, void *getf_v);
 
-// Return TRUE if the key is to the right of the LE_CURSOR position. that is, current cursor key < given key
-// Otherwise returns FALSE when the key is at or to the left of the LE_CURSOR position. that is, current cursor key >= given key
-// The LE_CURSOR position is intialized to -infinity. Any key comparision with -infinity returns TRUE.
+// Return true if the key is to the right of the LE_CURSOR position. that is, current cursor key < given key
+// Otherwise returns false when the key is at or to the left of the LE_CURSOR position. that is, current cursor key >= given key
+// The LE_CURSOR position is intialized to -infinity. Any key comparision with -infinity returns true.
 // When the cursor runs off the right edge of the tree, the LE_CURSOR position is set to +infinity.  Any key comparision with +infinity
-// returns FALSE.
+// returns false.
 bool toku_le_cursor_is_key_greater(LE_CURSOR le_cursor, const DBT *key);
 
 #endif
diff --git a/ft/leafentry.h b/ft/leafentry.h
index 98e6b08ec9a5dc9e2b82a45fbaf2dcfc8d9b366d..9fd36ae61631e3f8a884daf78de724c7e3e28546 100644
--- a/ft/leafentry.h
+++ b/ft/leafentry.h
@@ -61,7 +61,7 @@ struct __attribute__ ((__packed__)) leafentry {
     struct __attribute__ ((__packed__)) leafentry_mvcc {
         uint32_t num_cxrs; // number of committed transaction records
         uint8_t  num_pxrs; // number of provisional transaction records
-        u_int8_t key_xrs[0]; //Actual key,
+        uint8_t key_xrs[0]; //Actual key,
                              //then TXNIDs of XRs relevant for reads:
                              //  if provisional XRs exist, store OUTERMOST TXNID
                              //  store committed TXNIDs, from most recently committed to least recently committed (newest first)
@@ -133,19 +133,19 @@ void wbuf_nocrc_LEAFENTRY(struct wbuf *w, LEAFENTRY le);
 int print_leafentry (FILE *outf, LEAFENTRY v); // Print a leafentry out in human-readable form.
 
 int le_latest_is_del(LEAFENTRY le); // Return true if it is a provisional delete.
-BOOL le_is_clean(LEAFENTRY le); //Return how many xids exist (0 does not count)
-BOOL le_has_xids(LEAFENTRY le, XIDS xids); // Return true transaction represented by xids is still provisional in this leafentry (le's xid stack is a superset or equal to xids)
-u_int32_t le_latest_keylen (LEAFENTRY le); // Return the latest keylen.
+bool le_is_clean(LEAFENTRY le); //Return how many xids exist (0 does not count)
+bool le_has_xids(LEAFENTRY le, XIDS xids); // Return true transaction represented by xids is still provisional in this leafentry (le's xid stack is a superset or equal to xids)
+uint32_t le_latest_keylen (LEAFENTRY le); // Return the latest keylen.
 void*     le_latest_val (LEAFENTRY le); // Return the latest val (return NULL for provisional deletes)
-u_int32_t le_latest_vallen (LEAFENTRY le); // Return the latest vallen.  Returns 0 for provisional deletes.
-void* le_latest_val_and_len (LEAFENTRY le, u_int32_t *len);
+uint32_t le_latest_vallen (LEAFENTRY le); // Return the latest vallen.  Returns 0 for provisional deletes.
+void* le_latest_val_and_len (LEAFENTRY le, uint32_t *len);
 
  // Return any key or value (even if it's only provisional).
 void* le_key (LEAFENTRY le);
-u_int32_t le_keylen (LEAFENTRY le);
-void* le_key_and_len (LEAFENTRY le, u_int32_t *len);
+uint32_t le_keylen (LEAFENTRY le);
+void* le_key_and_len (LEAFENTRY le, uint32_t *len);
 
-u_int64_t le_outermost_uncommitted_xid (LEAFENTRY le);
+uint64_t le_outermost_uncommitted_xid (LEAFENTRY le);
 
 void
 le_committed_mvcc(uint8_t *key, uint32_t keylen,
@@ -168,9 +168,9 @@ le_clean(uint8_t *key, uint32_t keylen,
 //      r|r!=0&&r!=TOKUDB_ACCEPT:  Quit early, return r, because something unexpected went wrong (error case)
 typedef int(*LE_ITERATE_CALLBACK)(TXNID id, TOKUTXN context);
 
-int le_iterate_is_del(LEAFENTRY le, LE_ITERATE_CALLBACK f, BOOL *is_empty, TOKUTXN context);
+int le_iterate_is_del(LEAFENTRY le, LE_ITERATE_CALLBACK f, bool *is_empty, TOKUTXN context);
 
-int le_iterate_val(LEAFENTRY le, LE_ITERATE_CALLBACK f, void** valpp, u_int32_t *vallenp, TOKUTXN context);
+int le_iterate_val(LEAFENTRY le, LE_ITERATE_CALLBACK f, void** valpp, uint32_t *vallenp, TOKUTXN context);
 
 
 size_t
diff --git a/ft/log-internal.h b/ft/log-internal.h
index 6104a8bc9aa6211f29d6d943a6da0331619ebae2..37c205b0a131981ca5615939cbb28c5826d764a2 100644
--- a/ft/log-internal.h
+++ b/ft/log-internal.h
@@ -58,12 +58,12 @@ struct tokulogger {
 
     toku_mutex_t output_condition_lock; // if you need both this lock and input_lock, acquire the output_lock first, then input_lock. More typical is to get the output_is_available condition to be false, and then acquire the input_lock.
     toku_cond_t  output_condition;      //
-    BOOL output_is_available;           // this is part of the predicate for the output condition.  It's true if no thread is modifying the output (either doing an fsync or otherwise fiddling with the output).
+    bool output_is_available;           // this is part of the predicate for the output condition.  It's true if no thread is modifying the output (either doing an fsync or otherwise fiddling with the output).
 
-    BOOL is_open;
-    BOOL is_panicked;
-    BOOL write_log_files;
-    BOOL trim_log_files; // for test purposes
+    bool is_open;
+    bool is_panicked;
+    bool write_log_files;
+    bool trim_log_files; // for test purposes
     int panic_errno;
     char *directory;  // file system directory
     DIR *dir; // descriptor for directory
@@ -86,11 +86,11 @@ struct tokulogger {
     // To access the logfilemgr you must have the output condition lock.
     TOKULOGFILEMGR logfilemgr;
 
-    u_int32_t write_block_size;       // How big should the blocks be written to various logs?
+    uint32_t write_block_size;       // How big should the blocks be written to various logs?
 
-    u_int64_t input_lock_ctr;             // how many times has input_lock been taken and released
-    u_int64_t output_condition_lock_ctr;  // how many times has output_condition_lock been taken and released
-    u_int64_t swap_ctr;                   // how many times have input/output log buffers been swapped
+    uint64_t input_lock_ctr;             // how many times has input_lock been taken and released
+    uint64_t output_condition_lock_ctr;  // how many times has output_condition_lock been taken and released
+    uint64_t swap_ctr;                   // how many times have input/output log buffers been swapped
     void (*remove_finalize_callback) (DICTIONARY_ID, void*);  // ydb-level callback to be called when a transaction that ...
     void * remove_finalize_callback_extra;                    // ... deletes a file is committed or when one that creates a file is aborted.
     CACHEFILE rollback_cachefile;
@@ -135,11 +135,11 @@ struct txn_roll_info {
 struct tokutxn {
     // These don't change after create:
     const time_t starttime; // timestamp in seconds of transaction start
-    const u_int64_t txnid64; // this happens to be the first lsn
-    const u_int64_t ancestor_txnid64; // this is the lsn of root transaction
-    const u_int64_t snapshot_txnid64; // this is the lsn of the snapshot
+    const uint64_t txnid64; // this happens to be the first lsn
+    const uint64_t ancestor_txnid64; // this is the lsn of root transaction
+    const uint64_t snapshot_txnid64; // this is the lsn of the snapshot
     const TXN_SNAPSHOT_TYPE snapshot_type;
-    const BOOL recovered_from_checkpoint;
+    const bool recovered_from_checkpoint;
     const TOKULOGGER logger;
     const TOKUTXN parent;
     // These don't either but they're created in a way that's hard to make
@@ -151,9 +151,9 @@ struct tokutxn {
     bool begin_was_logged;
     // These are not read until a commit, prepare, or abort starts, and
     // they're "monotonic" (only go false->true) during operation:
-    BOOL checkpoint_needed_before_commit;
-    BOOL do_fsync;
-    BOOL force_fsync_on_commit;  //This transaction NEEDS an fsync once (if) it commits.  (commit means root txn)
+    bool checkpoint_needed_before_commit;
+    bool do_fsync;
+    bool force_fsync_on_commit;  //This transaction NEEDS an fsync once (if) it commits.  (commit means root txn)
 
     // Not used until commit, prepare, or abort starts:
     LSN do_fsync_lsn;
@@ -187,7 +187,7 @@ struct txninfo {
     uint64_t   rollentry_raw_count;  // the total count of every byte in the transaction and all its children.
     uint32_t   num_fts;
     FT *open_fts;
-    BOOL       force_fsync_on_commit;  //This transaction NEEDS an fsync once (if) it commits.  (commit means root txn)
+    bool       force_fsync_on_commit;  //This transaction NEEDS an fsync once (if) it commits.  (commit means root txn)
     uint64_t   num_rollback_nodes;
     uint64_t   num_rollentries;
     BLOCKNUM   spilled_rollback_head;
@@ -195,19 +195,19 @@ struct txninfo {
     BLOCKNUM   current_rollback;
 };
 
-static inline int toku_logsizeof_u_int8_t (u_int32_t v __attribute__((__unused__))) {
+static inline int toku_logsizeof_uint8_t (uint32_t v __attribute__((__unused__))) {
     return 1;
 }
 
-static inline int toku_logsizeof_u_int32_t (u_int32_t v __attribute__((__unused__))) {
+static inline int toku_logsizeof_uint32_t (uint32_t v __attribute__((__unused__))) {
     return 4;
 }
 
-static inline int toku_logsizeof_u_int64_t (u_int32_t v __attribute__((__unused__))) {
+static inline int toku_logsizeof_uint64_t (uint32_t v __attribute__((__unused__))) {
     return 8;
 }
 
-static inline int toku_logsizeof_BOOL (u_int32_t v __attribute__((__unused__))) {
+static inline int toku_logsizeof_bool (uint32_t v __attribute__((__unused__))) {
     return 1;
 }
 
diff --git a/ft/log.h b/ft/log.h
index 17e5f0eb6a9e9e7b060c8c1aa49203bc48c7edb3..e177c14ed92a1e24edb83c61d6ad154bf2410072 100644
--- a/ft/log.h
+++ b/ft/log.h
@@ -32,17 +32,17 @@ static inline int toku_copy_BYTESTRING(BYTESTRING *target, BYTESTRING val) {
 }
 static inline void toku_free_TXNID(TXNID txnid __attribute__((__unused__))) {}
 static inline void toku_free_LSN(LSN lsn __attribute__((__unused__))) {}
-static inline void toku_free_u_int64_t(u_int64_t u __attribute__((__unused__))) {}
-static inline void toku_free_u_int32_t(u_int32_t u __attribute__((__unused__))) {}
-static inline void toku_free_u_int8_t(u_int8_t u __attribute__((__unused__))) {}
+static inline void toku_free_uint64_t(uint64_t u __attribute__((__unused__))) {}
+static inline void toku_free_uint32_t(uint32_t u __attribute__((__unused__))) {}
+static inline void toku_free_uint8_t(uint8_t u __attribute__((__unused__))) {}
 static inline void toku_free_FILENUM(FILENUM u __attribute__((__unused__))) {}
 static inline void toku_free_BLOCKNUM(BLOCKNUM u __attribute__((__unused__))) {}
-static inline void toku_free_BOOL(BOOL u __attribute__((__unused__))) {}
+static inline void toku_free_bool(bool u __attribute__((__unused__))) {}
 static inline void toku_free_XIDP(XIDP xidp) { toku_free(xidp); }
 static inline void toku_free_BYTESTRING(BYTESTRING val) { toku_free(val.data); }
 static inline void toku_free_FILENUMS(FILENUMS val) { toku_free(val.filenums); }
 
-int toku_maybe_upgrade_log (const char *env_dir, const char *log_dir, LSN * lsn_of_clean_shutdown, BOOL * upgrade_in_progress);
+int toku_maybe_upgrade_log (const char *env_dir, const char *log_dir, LSN * lsn_of_clean_shutdown, bool * upgrade_in_progress);
 uint64_t toku_log_upgrade_get_footprint(void);
 
 
diff --git a/ft/log_upgrade.cc b/ft/log_upgrade.cc
index dfbe119a46b5acdca84d0f88ac3d0fb93c66d06e..0c0ed93d3919a28bdee9bd3ff9a9af8c3a76fd3d 100644
--- a/ft/log_upgrade.cc
+++ b/ft/log_upgrade.cc
@@ -201,13 +201,13 @@ upgrade_log(const char *env_dir, const char *log_dir, LSN last_lsn, TXNID last_x
 // If log on disk is old (environment is old) and clean shutdown, then create log of current version,
 // which will make the environment of the current version (and delete the old logs).
 int
-toku_maybe_upgrade_log(const char *env_dir, const char *log_dir, LSN * lsn_of_clean_shutdown, BOOL * upgrade_in_progress) {
+toku_maybe_upgrade_log(const char *env_dir, const char *log_dir, LSN * lsn_of_clean_shutdown, bool * upgrade_in_progress) {
     int r;
     int lockfd = -1;
     FOOTPRINTSETUP(100000);
 
     footprint = 0;
-    *upgrade_in_progress = FALSE;  // set TRUE only if all criteria are met and we're actually doing an upgrade
+    *upgrade_in_progress = false;  // set true only if all criteria are met and we're actually doing an upgrade
 
     FOOTPRINT(1);
     r = toku_recover_lock(log_dir, &lockfd);
@@ -219,7 +219,7 @@ toku_maybe_upgrade_log(const char *env_dir, const char *log_dir, LSN * lsn_of_cl
     assert(env_dir);
 
     uint32_t version_of_logs_on_disk;
-    BOOL found_any_logs;
+    bool found_any_logs;
     r = toku_get_version_of_logs_on_disk(log_dir, &found_any_logs, &version_of_logs_on_disk);
     if (r != 0) {
         goto cleanup;
@@ -243,7 +243,7 @@ toku_maybe_upgrade_log(const char *env_dir, const char *log_dir, LSN * lsn_of_cl
         }
         FOOTPRINT(5);
         *lsn_of_clean_shutdown = last_lsn;
-        *upgrade_in_progress = TRUE;
+        *upgrade_in_progress = true;
         r = upgrade_log(env_dir, log_dir, last_lsn, last_xid);
     }
 cleanup:
diff --git a/ft/logcursor.cc b/ft/logcursor.cc
index 2d5a8bf84cb747962bb11f522f501ab7ac729a73..4f4a023ed039957054b0ae27c3c80a872e825d5d 100644
--- a/ft/logcursor.cc
+++ b/ft/logcursor.cc
@@ -16,9 +16,9 @@ struct toku_logcursor {
     FILE *cur_fp;
     size_t buffer_size;
     void *buffer;
-    BOOL is_open;
+    bool is_open;
     struct log_entry entry;
-    BOOL entry_valid;
+    bool entry_valid;
     LSN cur_lsn;
     enum lc_direction last_direction;
 };
@@ -44,7 +44,7 @@ static int lc_close_cur_logfile(TOKULOGCURSOR lc) {
     if ( lc->is_open ) {
         r = fclose(lc->cur_fp);
         assert(0==r);
-        lc->is_open = FALSE;
+        lc->is_open = false;
     }
     return 0;
 }
@@ -94,7 +94,7 @@ static int lc_open_logfile(TOKULOGCURSOR lc, int index) {
             return DB_BADFORMAT;
     }
     // mark as open
-    lc->is_open = TRUE;
+    lc->is_open = true;
     return r;
 }
 
@@ -122,9 +122,9 @@ static int lc_create(TOKULOGCURSOR *lc, const char *log_dir) {
     // malloc a cursor
     TOKULOGCURSOR cursor = (TOKULOGCURSOR) toku_xmalloc(sizeof(struct toku_logcursor));
     // find logfiles in logdir
-    cursor->is_open = FALSE;
+    cursor->is_open = false;
     cursor->cur_logfiles_index = 0;
-    cursor->entry_valid = FALSE;
+    cursor->entry_valid = false;
     cursor->buffer_size = 1<<20;                       // use a 1MB stream buffer (setvbuf)
     cursor->buffer = toku_malloc(cursor->buffer_size); // it does not matter if it failes
     // cursor->logdir must be an absolute path
@@ -189,7 +189,7 @@ int toku_logcursor_destroy(TOKULOGCURSOR *lc) {
     if ( *lc ) {
         if ( (*lc)->entry_valid ) {
             toku_log_free_log_entry_resources(&((*lc)->entry));
-            (*lc)->entry_valid = FALSE;
+            (*lc)->entry_valid = false;
         }
         r = lc_close_cur_logfile(*lc);
         int lf;
@@ -267,7 +267,7 @@ int toku_logcursor_next(TOKULOGCURSOR lc, struct log_entry **le) {
     int r=0;
     if ( lc->entry_valid ) {
         toku_log_free_log_entry_resources(&(lc->entry));
-        lc->entry_valid = FALSE;
+        lc->entry_valid = false;
         if (lc->last_direction == LC_BACKWARD) {
             struct log_entry junk;
             r = toku_log_fread(lc->cur_fp, &junk);
@@ -284,7 +284,7 @@ int toku_logcursor_next(TOKULOGCURSOR lc, struct log_entry **le) {
     r = lc_check_lsn(lc, LC_FORWARD);  
     if (r!=0) return r;
     lc->last_direction = LC_FORWARD;
-    lc->entry_valid = TRUE;
+    lc->entry_valid = true;
     *le = &(lc->entry);
     return r;
 }
@@ -293,7 +293,7 @@ int toku_logcursor_prev(TOKULOGCURSOR lc, struct log_entry **le) {
     int r=0;
     if ( lc->entry_valid ) {
         toku_log_free_log_entry_resources(&(lc->entry));
-        lc->entry_valid = FALSE;
+        lc->entry_valid = false;
         if (lc->last_direction == LC_FORWARD) {
             struct log_entry junk;
             r = toku_log_fread_backward(lc->cur_fp, &junk);
@@ -310,7 +310,7 @@ int toku_logcursor_prev(TOKULOGCURSOR lc, struct log_entry **le) {
     r = lc_check_lsn(lc, LC_BACKWARD);
     if (r!=0) return r;
     lc->last_direction = LC_BACKWARD;
-    lc->entry_valid = TRUE;
+    lc->entry_valid = true;
     *le = &(lc->entry);
     return r;
 }
@@ -319,7 +319,7 @@ int toku_logcursor_first(TOKULOGCURSOR lc, struct log_entry **le) {
     int r=0;
     if ( lc->entry_valid ) {
         toku_log_free_log_entry_resources(&(lc->entry));
-        lc->entry_valid = FALSE;
+        lc->entry_valid = false;
     }
     // close any but the first log file
     if ( lc->cur_logfiles_index != 0 ) {
@@ -339,7 +339,7 @@ int toku_logcursor_first(TOKULOGCURSOR lc, struct log_entry **le) {
     r = lc_check_lsn(lc, LC_FIRST);
     if (r!=0) return r;
     lc->last_direction = LC_FIRST;
-    lc->entry_valid = TRUE;
+    lc->entry_valid = true;
     *le = &(lc->entry);
     return r;
 }
@@ -349,7 +349,7 @@ int toku_logcursor_last(TOKULOGCURSOR lc, struct log_entry **le) {
     int r=0;
     if ( lc->entry_valid ) {
         toku_log_free_log_entry_resources(&(lc->entry));
-        lc->entry_valid = FALSE;
+        lc->entry_valid = false;
     }
     // close any but last log file
     if ( lc->cur_logfiles_index != lc->n_logfiles-1 ) {
@@ -401,7 +401,7 @@ int toku_logcursor_last(TOKULOGCURSOR lc, struct log_entry **le) {
     if (r!=0)
         return r;
     lc->last_direction = LC_LAST;
-    lc->entry_valid = TRUE;
+    lc->entry_valid = true;
     *le = &(lc->entry);
     return r;
 }
diff --git a/ft/logformat.cc b/ft/logformat.cc
index f8e6b12885e3d30d5979cadba66b9efa313aad21..9b5e92491882a13e232181c8fdf3e885005f0789 100644
--- a/ft/logformat.cc
+++ b/ft/logformat.cc
@@ -17,7 +17,6 @@
 #include <ctype.h>
 #include <errno.h>
 #include <stdarg.h>
-#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -69,11 +68,11 @@ const struct logtype rollbacks[] = {
                           {"BYTESTRING", "key", 0},
                           NULLFIELD}, LOG_BEGIN_ACTION_NA},
     {"rollinclude", 'r', FA{{"TXNID",     "xid", 0},
-                            {"u_int64_t", "num_nodes", 0},
+                            {"uint64_t", "num_nodes", 0},
                             {"BLOCKNUM",  "spilled_head", 0},
-                            {"u_int32_t", "spilled_head_hash", 0},
+                            {"uint32_t", "spilled_head_hash", 0},
                             {"BLOCKNUM",  "spilled_tail", 0},
-                            {"u_int32_t", "spilled_tail_hash", 0},
+                            {"uint32_t", "spilled_tail_hash", 0},
                             NULLFIELD}, LOG_BEGIN_ACTION_NA},
     {"load", 'l', FA{{"FILENUM",    "old_filenum", 0},
                      {"BYTESTRING", "new_iname", 0},
@@ -88,7 +87,7 @@ const struct logtype rollbacks[] = {
                           {"BYTESTRING", "key", 0},
                           NULLFIELD}, LOG_BEGIN_ACTION_NA},
     {"cmdupdatebroadcast", 'B', FA{{"FILENUM", "filenum", 0},
-                                   {"BOOL",    "is_resetting_op", 0},
+                                   {"bool",    "is_resetting_op", 0},
                                    NULLFIELD}, LOG_BEGIN_ACTION_NA},
     {"change_fdescriptor", 'D', FA{{"FILENUM",    "filenum", 0},
                             {"BYTESTRING", "old_descriptor", 0},
@@ -101,27 +100,27 @@ const struct logtype logtypes[] = {
 #if 0 // no longer used, but reserve the type
     {"local_txn_checkpoint", 'c', FA{{"TXNID",      "xid", 0}, NULLFIELD}},
 #endif
-    {"begin_checkpoint", 'x', FA{{"u_int64_t", "timestamp", 0}, {"TXNID", "last_xid", 0}, NULLFIELD}, IGNORE_LOG_BEGIN},
+    {"begin_checkpoint", 'x', FA{{"uint64_t", "timestamp", 0}, {"TXNID", "last_xid", 0}, NULLFIELD}, IGNORE_LOG_BEGIN},
     {"end_checkpoint",   'X', FA{{"LSN", "lsn_begin_checkpoint", 0},
-                                 {"u_int64_t", "timestamp", 0},
-                                 {"u_int32_t", "num_fassociate_entries", 0}, // how many files were checkpointed
-                                 {"u_int32_t", "num_xstillopen_entries", 0},  // how many txns  were checkpointed
+                                 {"uint64_t", "timestamp", 0},
+                                 {"uint32_t", "num_fassociate_entries", 0}, // how many files were checkpointed
+                                 {"uint32_t", "num_xstillopen_entries", 0},  // how many txns  were checkpointed
                                  NULLFIELD}, IGNORE_LOG_BEGIN},
     //TODO: #2037 Add dname
     {"fassociate",  'f', FA{{"FILENUM", "filenum", 0},
-                            {"u_int32_t",  "treeflags", 0},
+                            {"uint32_t",  "treeflags", 0},
                             {"BYTESTRING", "iname", 0},   // pathname of file
-                            {"u_int8_t", "unlink_on_close", 0},
+                            {"uint8_t", "unlink_on_close", 0},
                             NULLFIELD}, IGNORE_LOG_BEGIN},
     //We do not use a TXNINFO struct since recovery log has
     //FILENUMS and TOKUTXN has FTs (for open_fts)
     {"xstillopen", 's', FA{{"TXNID", "xid", 0}, 
                            {"TXNID", "parentxid", 0}, 
-                           {"u_int64_t", "rollentry_raw_count", 0}, 
+                           {"uint64_t", "rollentry_raw_count", 0}, 
                            {"FILENUMS",  "open_filenums", 0},
-                           {"u_int8_t",  "force_fsync_on_commit", 0}, 
-                           {"u_int64_t", "num_rollback_nodes", 0}, 
-                           {"u_int64_t", "num_rollentries", 0}, 
+                           {"uint8_t",  "force_fsync_on_commit", 0}, 
+                           {"uint64_t", "num_rollback_nodes", 0}, 
+                           {"uint64_t", "num_rollentries", 0}, 
                            {"BLOCKNUM",  "spilled_rollback_head", 0}, 
                            {"BLOCKNUM",  "spilled_rollback_tail", 0}, 
                            {"BLOCKNUM",  "current_rollback", 0}, 
@@ -129,11 +128,11 @@ const struct logtype logtypes[] = {
     // prepared txns need a gid
     {"xstillopenprepared", 'p', FA{{"TXNID", "xid", 0},
                                    {"XIDP",  "xa_xid", 0}, // prepared transactions need a gid, and have no parentxid.
-                                   {"u_int64_t", "rollentry_raw_count", 0}, 
+                                   {"uint64_t", "rollentry_raw_count", 0}, 
                                    {"FILENUMS",  "open_filenums", 0},
-                                   {"u_int8_t",  "force_fsync_on_commit", 0}, 
-                                   {"u_int64_t", "num_rollback_nodes", 0}, 
-                                   {"u_int64_t", "num_rollentries", 0}, 
+                                   {"uint8_t",  "force_fsync_on_commit", 0}, 
+                                   {"uint64_t", "num_rollback_nodes", 0}, 
+                                   {"uint64_t", "num_rollentries", 0}, 
                                    {"BLOCKNUM",  "spilled_rollback_head", 0}, 
                                    {"BLOCKNUM",  "spilled_rollback_tail", 0}, 
                                    {"BLOCKNUM",  "current_rollback", 0}, 
@@ -150,16 +149,16 @@ const struct logtype logtypes[] = {
     {"fcreate", 'F', FA{{"TXNID",      "xid", 0},
                         {"FILENUM",    "filenum", 0},
                         {"BYTESTRING", "iname", 0},
-                        {"u_int32_t",  "mode",  "0%o"},
-                        {"u_int32_t",  "treeflags", 0},
-                        {"u_int32_t", "nodesize", 0},
-                        {"u_int32_t", "basementnodesize", 0},
-                        {"u_int32_t", "compression_method", 0},
+                        {"uint32_t",  "mode",  "0%o"},
+                        {"uint32_t",  "treeflags", 0},
+                        {"uint32_t", "nodesize", 0},
+                        {"uint32_t", "basementnodesize", 0},
+                        {"uint32_t", "compression_method", 0},
                         NULLFIELD}, SHOULD_LOG_BEGIN},
     //TODO: #2037 Add dname
     {"fopen",   'O', FA{{"BYTESTRING", "iname", 0},
                         {"FILENUM",    "filenum", 0},
-                        {"u_int32_t",  "treeflags", 0},
+                        {"uint32_t",  "treeflags", 0},
                         NULLFIELD}, IGNORE_LOG_BEGIN},
     //TODO: #2037 Add dname
     {"fclose",   'e', FA{{"BYTESTRING", "iname", 0},
@@ -195,14 +194,14 @@ const struct logtype logtypes[] = {
                                     {"BYTESTRING", "src_key", 0},
                                     {"BYTESTRING", "src_val", 0},
                                     NULLFIELD}, SHOULD_LOG_BEGIN},
-    {"comment", 'T', FA{{"u_int64_t", "timestamp", 0},
+    {"comment", 'T', FA{{"uint64_t", "timestamp", 0},
                         {"BYTESTRING", "comment", 0},
                         NULLFIELD}, IGNORE_LOG_BEGIN},
     // Note: shutdown_up_to_19 log entry is NOT ALLOWED TO BE CHANGED.
     // Do not change the letter ('Q'), do not add fields,
     // do not remove fields.
     // TODO: Kill this logentry entirely once we no longer support version 19.
-    {"shutdown_up_to_19", 'Q', FA{{"u_int64_t", "timestamp", 0},
+    {"shutdown_up_to_19", 'Q', FA{{"uint64_t", "timestamp", 0},
                          NULLFIELD}, IGNORE_LOG_BEGIN},
     // Note: Shutdown log entry is NOT ALLOWED TO BE CHANGED.
     // Do not change the letter ('0'), do not add fields,
@@ -212,7 +211,7 @@ const struct logtype logtypes[] = {
     // This is how we detect clean shutdowns from OLDER VERSIONS.
     // This log entry must always be readable for future versions.
     // If you DO change it, you need to write a separate log upgrade mechanism.
-    {"shutdown", '0', FA{{"u_int64_t", "timestamp", 0},
+    {"shutdown", '0', FA{{"uint64_t", "timestamp", 0},
                          {"TXNID", "last_xid", 0},
                          NULLFIELD}, IGNORE_LOG_BEGIN},
     {"load", 'l', FA{{"TXNID",      "xid", 0},
@@ -231,13 +230,13 @@ const struct logtype logtypes[] = {
     {"enq_updatebroadcast", 'B', FA{{"FILENUM",    "filenum", 0},
                                     {"TXNID",      "xid", 0},
                                     {"BYTESTRING", "extra", 0},
-                                    {"BOOL",       "is_resetting_op", 0},
+                                    {"bool",       "is_resetting_op", 0},
                                     NULLFIELD}, SHOULD_LOG_BEGIN},
     {"change_fdescriptor", 'D', FA{{"FILENUM",    "filenum", 0},
                             {"TXNID",      "xid", 0},
                             {"BYTESTRING", "old_descriptor", 0},
                             {"BYTESTRING", "new_descriptor", 0},
-                            {"BOOL",       "update_cmp_descriptor", 0},
+                            {"bool",       "update_cmp_descriptor", 0},
                             NULLFIELD}, SHOULD_LOG_BEGIN},
     {0,0,FA{NULLFIELD}, (enum log_begin_action) 0}
 };
@@ -308,8 +307,8 @@ generate_log_struct (void) {
                     fprintf(hf, "  %-16s lsn;\n", "LSN");
                     DO_FIELDS(field_type, lt,
                               fprintf(hf, "  %-16s %s;\n", field_type->type, field_type->name));
-                    fprintf(hf, "  %-16s crc;\n", "u_int32_t");
-                    fprintf(hf, "  %-16s len;\n", "u_int32_t");
+                    fprintf(hf, "  %-16s crc;\n", "uint32_t");
+                    fprintf(hf, "  %-16s len;\n", "uint32_t");
                     fprintf(hf, "};\n");
                     //fprintf(hf, "void toku_recover_%s (LSN lsn", lt->name);
                     //DO_FIELDS(field_type, lt, fprintf(hf, ", %s %s", field_type->type, field_type->name));
@@ -380,7 +379,7 @@ generate_dispatch (void) {
 
 static void
 generate_get_timestamp(void) {
-    fprintf(cf, "static u_int64_t toku_get_timestamp(void) {\n");
+    fprintf(cf, "static uint64_t toku_get_timestamp(void) {\n");
     fprintf(cf, "  struct timeval tv; int r = gettimeofday(&tv, NULL);\n");
     fprintf(cf, "  assert(r==0);\n");
     fprintf(cf, "  return tv.tv_sec * 1000000ULL + tv.tv_usec;\n");
@@ -473,16 +472,16 @@ generate_log_writer (void) {
 static void
 generate_log_reader (void) {
     DO_LOGTYPES(lt, {
-                        fprintf(cf, "static int toku_log_fread_%s (FILE *infile, u_int32_t len1, struct logtype_%s *data, struct x1764 *checksum)", lt->name, lt->name);
+                        fprintf(cf, "static int toku_log_fread_%s (FILE *infile, uint32_t len1, struct logtype_%s *data, struct x1764 *checksum)", lt->name, lt->name);
                         fprintf(cf, " {\n");
                         fprintf(cf, "  int r=0;\n");
-                        fprintf(cf, "  u_int32_t actual_len=5; // 1 for the command, 4 for the first len.\n");
+                        fprintf(cf, "  uint32_t actual_len=5; // 1 for the command, 4 for the first len.\n");
                         fprintf(cf, "  r=toku_fread_%-16s(infile, &data->%-16s, checksum, &actual_len); if (r!=0) return r;\n", "LSN", "lsn");
                         DO_FIELDS(field_type, lt,
                                   fprintf(cf, "  r=toku_fread_%-16s(infile, &data->%-16s, checksum, &actual_len); if (r!=0) return r;\n", field_type->type, field_type->name));
-                        fprintf(cf, "  u_int32_t checksum_in_file, len_in_file;\n");
-                        fprintf(cf, "  r=toku_fread_u_int32_t_nocrclen(infile, &checksum_in_file); actual_len+=4;   if (r!=0) return r;\n");
-                        fprintf(cf, "  r=toku_fread_u_int32_t_nocrclen(infile, &len_in_file);    actual_len+=4;   if (r!=0) return r;\n");
+                        fprintf(cf, "  uint32_t checksum_in_file, len_in_file;\n");
+                        fprintf(cf, "  r=toku_fread_uint32_t_nocrclen(infile, &checksum_in_file); actual_len+=4;   if (r!=0) return r;\n");
+                        fprintf(cf, "  r=toku_fread_uint32_t_nocrclen(infile, &len_in_file);    actual_len+=4;   if (r!=0) return r;\n");
                         fprintf(cf, "  if (checksum_in_file!=x1764_finish(checksum) || len_in_file!=actual_len || len1 != len_in_file) return DB_BADFORMAT;\n");
                         fprintf(cf, "  return 0;\n");
                         fprintf(cf, "}\n\n");
@@ -490,11 +489,11 @@ generate_log_reader (void) {
     fprintf2(cf, hf, "int toku_log_fread (FILE *infile, struct log_entry *le)");
     fprintf(hf, ";\n");
     fprintf(cf, " {\n");
-    fprintf(cf, "  u_int32_t len1; int r;\n");
-    fprintf(cf, "  u_int32_t ignorelen=0;\n");
+    fprintf(cf, "  uint32_t len1; int r;\n");
+    fprintf(cf, "  uint32_t ignorelen=0;\n");
     fprintf(cf, "  struct x1764 checksum;\n");
     fprintf(cf, "  x1764_init(&checksum);\n");
-    fprintf(cf, "  r = toku_fread_u_int32_t(infile, &len1, &checksum, &ignorelen); if (r!=0) return r;\n");
+    fprintf(cf, "  r = toku_fread_uint32_t(infile, &len1, &checksum, &ignorelen); if (r!=0) return r;\n");
     fprintf(cf, "  int cmd=fgetc(infile);\n");
     fprintf(cf, "  if (cmd==EOF) return EOF;\n");
     fprintf(cf, "  char cmdchar = (char)cmd;\n");
@@ -517,8 +516,8 @@ generate_log_reader (void) {
     fprintf(cf, "  {\n    long pos = ftell(infile);\n    if (pos<=12) return -1;\n  }\n");
     fprintf(cf, "  int r = fseek(infile, -4, SEEK_CUR); \n");//              assert(r==0);\n");
     fprintf(cf, "  if (r!=0) return get_error_errno();\n");
-    fprintf(cf, "  u_int32_t len;\n");
-    fprintf(cf, "  r = toku_fread_u_int32_t_nocrclen(infile, &len); \n");//  assert(r==0);\n");
+    fprintf(cf, "  uint32_t len;\n");
+    fprintf(cf, "  r = toku_fread_uint32_t_nocrclen(infile, &len); \n");//  assert(r==0);\n");
     fprintf(cf, "  if (r!=0) return 1;\n");
     fprintf(cf, "  r = fseek(infile, -(int)len, SEEK_CUR) ;  \n");//         assert(r==0);\n");
     fprintf(cf, "  if (r!=0) return get_error_errno();\n");
@@ -558,15 +557,15 @@ generate_logprint (void) {
     fprintf(hf, ";\n");
     fprintf(pf, " {\n");
     fprintf(pf, "    int cmd, r;\n");
-    fprintf(pf, "    u_int32_t len1, crc_in_file;\n");
-    fprintf(pf, "    u_int32_t ignorelen=0;\n");
+    fprintf(pf, "    uint32_t len1, crc_in_file;\n");
+    fprintf(pf, "    uint32_t ignorelen=0;\n");
     fprintf(pf, "    struct x1764 checksum;\n");
     fprintf(pf, "    x1764_init(&checksum);\n");
-    fprintf(pf, "    r=toku_fread_u_int32_t(f, &len1, &checksum, &ignorelen);\n");
+    fprintf(pf, "    r=toku_fread_uint32_t(f, &len1, &checksum, &ignorelen);\n");
     fprintf(pf, "    if (r==EOF) return EOF;\n");
     fprintf(pf, "    cmd=fgetc(f);\n");
     fprintf(pf, "    if (cmd==EOF) return DB_BADFORMAT;\n");
-    fprintf(pf, "    u_int32_t len_in_file, len=1+4; // cmd + len1\n");
+    fprintf(pf, "    uint32_t len_in_file, len=1+4; // cmd + len1\n");
     fprintf(pf, "    char charcmd = (char)cmd;\n");
     fprintf(pf, "    x1764_add(&checksum, &charcmd, 1);\n");
     fprintf(pf, "    switch ((enum lt_cmd)cmd) {\n");
@@ -586,11 +585,11 @@ generate_logprint (void) {
                             fprintf(pf, "); if (r!=0) return r;\n");
                         });
                 fprintf(pf, "        {\n");
-                fprintf(pf, "          u_int32_t actual_murmur = x1764_finish(&checksum);\n");
-                fprintf(pf, "          r = toku_fread_u_int32_t_nocrclen (f, &crc_in_file); len+=4; if (r!=0) return r;\n");
+                fprintf(pf, "          uint32_t actual_murmur = x1764_finish(&checksum);\n");
+                fprintf(pf, "          r = toku_fread_uint32_t_nocrclen (f, &crc_in_file); len+=4; if (r!=0) return r;\n");
                 fprintf(pf, "          fprintf(outf, \" crc=%%08x\", crc_in_file);\n");
                 fprintf(pf, "          if (crc_in_file!=actual_murmur) fprintf(outf, \" checksum=%%08x\", actual_murmur);\n");
-                fprintf(pf, "          r = toku_fread_u_int32_t_nocrclen (f, &len_in_file); len+=4; if (r!=0) return r;\n");
+                fprintf(pf, "          r = toku_fread_uint32_t_nocrclen (f, &len_in_file); len+=4; if (r!=0) return r;\n");
                 fprintf(pf, "          fprintf(outf, \" len=%%u\", len_in_file);\n");
                 fprintf(pf, "          if (len_in_file!=len) fprintf(outf, \" actual_len=%%u\", len);\n");
                 fprintf(pf, "          if (len_in_file!=len || crc_in_file!=actual_murmur) return DB_BADFORMAT;\n");
@@ -644,7 +643,7 @@ generate_rollbacks (void) {
                     });
                     {
                         int count=0;
-                        fprintf(cf, "  u_int32_t rollback_fsize = toku_logger_rollback_fsize_%s(", lt->name);
+                        fprintf(cf, "  uint32_t rollback_fsize = toku_logger_rollback_fsize_%s(", lt->name);
                         DO_FIELDS(field_type, lt, fprintf(cf, "%s%s", (count++>0)?", ":"", field_type->name));
                         fprintf(cf, ");\n");
                     }
@@ -660,7 +659,7 @@ generate_rollbacks (void) {
                     fprintf(cf, "  log->rollentry_resident_bytecount += rollback_fsize;\n");
                     fprintf(cf, "  txn->roll_info.rollentry_raw_count          += rollback_fsize;\n");
                     fprintf(cf, "  txn->roll_info.num_rollentries++;\n");
-                    fprintf(cf, "  log->dirty = TRUE;\n");
+                    fprintf(cf, "  log->dirty = true;\n");
                     fprintf(cf, "  // spill and unpin assert success internally\n");
                     fprintf(cf, "  toku_maybe_spill_rollbacks(txn, log);\n");
                     fprintf(cf, "  toku_rollback_log_unpin(txn, log);\n");
@@ -677,7 +676,7 @@ generate_rollbacks (void) {
 
                 {
                     int count=0;
-                    fprintf(cf, "  u_int32_t rollback_fsize = toku_logger_rollback_fsize_%s(", lt->name);
+                    fprintf(cf, "  uint32_t rollback_fsize = toku_logger_rollback_fsize_%s(", lt->name);
                     DO_FIELDS(field_type, lt, fprintf(cf, "%s%s", (count++>0)?", ":"", field_type->name));
                     fprintf(cf, ");\n");
                     fprintf(cf, "  wbuf_nocrc_int(wbuf, rollback_fsize);\n");
@@ -697,7 +696,7 @@ generate_rollbacks (void) {
     fprintf(cf, "  }\n  assert(0);\n");
     fprintf(cf, "}\n");
     DO_ROLLBACKS(lt, {
-                fprintf2(cf, hf, "u_int32_t toku_logger_rollback_fsize_%s (", lt->name);
+                fprintf2(cf, hf, "uint32_t toku_logger_rollback_fsize_%s (", lt->name);
                 int count=0;
                 DO_FIELDS(field_type, lt, fprintf2(cf, hf, "%s%s %s", (count++>0)?", ":"", field_type->type, field_type->name));
                 fprintf(hf, ");\n");
@@ -708,7 +707,7 @@ generate_rollbacks (void) {
                           fprintf(cf, "\n         + toku_logsizeof_%s(%s)", field_type->type, field_type->name));
                 fprintf(cf, ";\n}\n");
             });
-    fprintf2(cf, hf, "u_int32_t toku_logger_rollback_fsize(struct roll_entry *item)");
+    fprintf2(cf, hf, "uint32_t toku_logger_rollback_fsize(struct roll_entry *item)");
     fprintf(hf, ";\n");
     fprintf(cf, "{\n  switch(item->cmd) {\n");
     DO_ROLLBACKS(lt, {
@@ -720,7 +719,7 @@ generate_rollbacks (void) {
     fprintf(cf, "  }\n  assert(0);\n  return 0;\n");
     fprintf(cf, "}\n");
 
-    fprintf2(cf, hf, "int toku_parse_rollback(unsigned char *buf, u_int32_t n_bytes, struct roll_entry **itemp, MEMARENA ma)");
+    fprintf2(cf, hf, "int toku_parse_rollback(unsigned char *buf, uint32_t n_bytes, struct roll_entry **itemp, MEMARENA ma)");
     fprintf(hf, ";\n");
     fprintf(cf, " {\n  assert(n_bytes>0);\n  struct roll_entry *item;\n  enum rt_cmd cmd = (enum rt_cmd)(buf[0]);\n  size_t mem_needed;\n");
     fprintf(cf, "  struct rbuf rc = {buf, n_bytes, 1};\n");
diff --git a/ft/logger.cc b/ft/logger.cc
index f7ce4fd9ff0be882e44dd7305b966e55a8dc5a3b..d3f9fdd5c8e20ecfebcdfc193db1992da963565a 100644
--- a/ft/logger.cc
+++ b/ft/logger.cc
@@ -15,9 +15,9 @@ static int delete_logfile(TOKULOGGER logger, long long index, uint32_t version);
 static void grab_output(TOKULOGGER logger, LSN *fsynced_lsn);
 static void release_output(TOKULOGGER logger, LSN fsynced_lsn);
 
-static void toku_print_bytes (FILE *outf, u_int32_t len, char *data) {
+static void toku_print_bytes (FILE *outf, uint32_t len, char *data) {
     fprintf(outf, "\"");
-    u_int32_t i;
+    uint32_t i;
     for (i=0; i<len; i++) {
         switch (data[i]) {
         case '"':  fprintf(outf, "\\\""); break;
@@ -31,8 +31,8 @@ static void toku_print_bytes (FILE *outf, u_int32_t len, char *data) {
     fprintf(outf, "\"");
 }
 
-static BOOL is_a_logfile_any_version (const char *name, uint64_t *number_result, uint32_t *version_of_log) {
-    BOOL rval = TRUE;
+static bool is_a_logfile_any_version (const char *name, uint64_t *number_result, uint32_t *version_of_log) {
+    bool rval = true;
     uint64_t result;
     int n;
     int r;
@@ -43,7 +43,7 @@ static BOOL is_a_logfile_any_version (const char *name, uint64_t *number_result,
         version = TOKU_LOG_VERSION_1;
         r = sscanf(name, "log%" SCNu64 ".tokulog%n", &result, &n);
         if (r!=1 || name[n]!='\0') {
-            rval = FALSE;
+            rval = false;
         }
     }
     if (rval) {
@@ -55,13 +55,13 @@ static BOOL is_a_logfile_any_version (const char *name, uint64_t *number_result,
 }
 
 // added for #2424, improved for #2521
-static BOOL is_a_logfile (const char *name, long long *number_result) {
-    BOOL rval;
+static bool is_a_logfile (const char *name, long long *number_result) {
+    bool rval;
     uint64_t result;
     uint32_t version;
     rval = is_a_logfile_any_version(name, &result, &version);
     if (rval && version != TOKU_LOG_VERSION)
-        rval = FALSE;
+        rval = false;
     if (rval)
         *number_result = result;
     return rval;
@@ -71,11 +71,11 @@ static BOOL is_a_logfile (const char *name, long long *number_result) {
 int toku_logger_create (TOKULOGGER *resultp) {
     TOKULOGGER MALLOC(result);
     if (result==0) return get_error_errno();
-    result->is_open=FALSE;
-    result->is_panicked=FALSE;
+    result->is_open=false;
+    result->is_panicked=false;
     result->panic_errno = 0;
-    result->write_log_files = TRUE;
-    result->trim_log_files = TRUE;
+    result->write_log_files = true;
+    result->trim_log_files = true;
     result->directory=0;
     result->remove_finalize_callback = NULL;
     // fd is uninitialized on purpose
@@ -99,7 +99,7 @@ int toku_logger_create (TOKULOGGER *resultp) {
     result->output_condition_lock_ctr = 0;
     result->swap_ctr = 0;
     result->rollback_cachefile = NULL;
-    result->output_is_available = TRUE;
+    result->output_is_available = true;
     toku_txn_manager_init(&result->txn_manager);
     return 0;
 }
@@ -166,7 +166,7 @@ toku_logger_open_with_last_xid(const char *directory, TOKULOGGER logger, TXNID l
     }
     toku_txn_manager_set_last_xid_from_logger(logger->txn_manager, last_xid);
 
-    logger->is_open = TRUE;
+    logger->is_open = true;
     return 0;
 }
 
@@ -179,7 +179,7 @@ bool toku_logger_rollback_is_open (TOKULOGGER logger) {
 }
 
 int
-toku_logger_open_rollback(TOKULOGGER logger, CACHETABLE cachetable, BOOL create) {
+toku_logger_open_rollback(TOKULOGGER logger, CACHETABLE cachetable, bool create) {
     assert(logger->is_open);
     assert(!logger->is_panicked);
     assert(!logger->rollback_cachefile);
@@ -196,7 +196,7 @@ toku_logger_open_rollback(TOKULOGGER logger, CACHETABLE cachetable, BOOL create)
     assert(!t->ft->panic);
     //Must have no data blocks (rollback logs or otherwise).
     toku_block_verify_no_data_blocks_except_root_unlocked(t->ft->blocktable, t->ft->h->root_blocknum);
-    BOOL is_empty;
+    bool is_empty;
     is_empty = toku_ft_is_empty_fast(t);
     assert(is_empty);
     return r;
@@ -208,7 +208,7 @@ toku_logger_open_rollback(TOKULOGGER logger, CACHETABLE cachetable, BOOL create)
 //            Rollback log can only be closed when there are no open transactions,
 //            so it will always be empty (no data blocks) when about to be closed.
 int
-toku_logger_close_rollback(TOKULOGGER logger, BOOL recovery_failed) {
+toku_logger_close_rollback(TOKULOGGER logger, bool recovery_failed) {
     int r = 0;
     CACHEFILE cf = logger->rollback_cachefile;  // stored in logger at rollback cachefile open
     if (!logger->is_panicked && cf) {
@@ -228,7 +228,7 @@ toku_logger_close_rollback(TOKULOGGER logger, BOOL recovery_failed) {
             assert(!ft->h->dirty);
             ft_to_close = toku_ft_get_only_existing_ft_handle(ft);
             {
-                BOOL is_empty;
+                bool is_empty;
                 is_empty = toku_ft_is_empty_fast(ft_to_close);
                 assert(is_empty);
             }
@@ -272,7 +272,7 @@ int toku_logger_close(TOKULOGGER *loggerp) {
     ml_destroy(&logger->input_lock);
     toku_mutex_destroy(&logger->output_condition_lock);
     toku_cond_destroy(&logger->output_condition);
-    logger->is_panicked=TRUE; // Just in case this might help.
+    logger->is_panicked=true; // Just in case this might help.
     toku_txn_manager_destroy(logger->txn_manager);
     if (logger->directory) toku_free(logger->directory);
     toku_logfilemgr_destroy(&logger->logfilemgr);
@@ -290,7 +290,7 @@ int toku_logger_shutdown(TOKULOGGER logger) {
         TXN_MANAGER mgr = logger->txn_manager;
         if (toku_txn_manager_num_live_txns(mgr) == 0) {
             TXNID last_xid = toku_txn_manager_get_last_xid(mgr);
-            r = toku_log_shutdown(logger, NULL, TRUE, 0, last_xid);
+            r = toku_log_shutdown(logger, NULL, true, 0, last_xid);
         }
     }
     return r;
@@ -344,7 +344,7 @@ grab_output(TOKULOGGER logger, LSN *fsynced_lsn)
     toku_mutex_lock(&logger->output_condition_lock);
     logger->output_condition_lock_ctr++;
     wait_till_output_available(logger);
-    logger->output_is_available = FALSE;
+    logger->output_is_available = false;
     if (fsynced_lsn) {
         *fsynced_lsn = logger->fsynced_lsn;
     }
@@ -352,7 +352,7 @@ grab_output(TOKULOGGER logger, LSN *fsynced_lsn)
     toku_mutex_unlock(&logger->output_condition_lock);
 }
 
-static BOOL
+static bool
 wait_till_output_already_written_or_output_buffer_available (TOKULOGGER logger, LSN lsn, LSN *fsynced_lsn)
 // Effect: Wait until either the output is available or the lsn has been written.
 //  Return true iff the lsn has been written.
@@ -361,17 +361,17 @@ wait_till_output_already_written_or_output_buffer_available (TOKULOGGER logger,
 // Entry: Hold no locks.
 // Exit: Hold the output permission if returns false.
 {
-    BOOL result;
+    bool result;
     toku_mutex_lock(&logger->output_condition_lock);
     logger->output_condition_lock_ctr++;
     while (1) {
         if (logger->fsynced_lsn.lsn >= lsn.lsn) { // we can look at the fsynced lsn since we have the lock.
-            result = TRUE;
+            result = true;
             break;
         }
         if (logger->output_is_available) {
-            logger->output_is_available = FALSE;
-            result = FALSE;
+            logger->output_is_available = false;
+            result = false;
             break;
         }
         // otherwise wait for a good time to look again.
@@ -391,7 +391,7 @@ release_output (TOKULOGGER logger, LSN fsynced_lsn)
 {
     toku_mutex_lock(&logger->output_condition_lock);
     logger->output_condition_lock_ctr++;
-    logger->output_is_available = TRUE;
+    logger->output_is_available = true;
     if (logger->fsynced_lsn.lsn < fsynced_lsn.lsn) {
         logger->fsynced_lsn = fsynced_lsn;
     }
@@ -488,7 +488,7 @@ int toku_logger_fsync (TOKULOGGER logger)
     if (logger->is_panicked) return EINVAL;
     ml_lock(&logger->input_lock);
     logger->input_lock_ctr++;
-    r = toku_logger_maybe_fsync(logger, logger->inbuf.max_lsn_in_buf, TRUE);
+    r = toku_logger_maybe_fsync(logger, logger->inbuf.max_lsn_in_buf, true);
     if (r!=0) {
         toku_logger_panic(logger, r);
     }
@@ -502,7 +502,7 @@ toku_logger_fsync_if_lsn_not_fsynced (TOKULOGGER logger, LSN lsn) {
     else if (logger->write_log_files) {
         ml_lock(&logger->input_lock);
         logger->input_lock_ctr++;
-        r = toku_logger_maybe_fsync(logger, lsn, TRUE);
+        r = toku_logger_maybe_fsync(logger, lsn, true);
         if (r!=0) {
             toku_logger_panic(logger, r);
         }
@@ -512,7 +512,7 @@ toku_logger_fsync_if_lsn_not_fsynced (TOKULOGGER logger, LSN lsn) {
 
 void toku_logger_panic (TOKULOGGER logger, int err) {
     logger->panic_errno=err;
-    logger->is_panicked=TRUE;
+    logger->is_panicked=true;
 }
 int toku_logger_panicked(TOKULOGGER logger) {
     if (logger==0) return 0;
@@ -527,7 +527,7 @@ void toku_logger_set_cachetable (TOKULOGGER logger, CACHETABLE ct) {
     logger->ct = ct;
 }
 
-int toku_logger_set_lg_max(TOKULOGGER logger, u_int32_t lg_max) {
+int toku_logger_set_lg_max(TOKULOGGER logger, uint32_t lg_max) {
     if (logger==0) return EINVAL; // no logger
     if (logger->is_panicked) return EINVAL;
     if (logger->is_open) return EINVAL;
@@ -535,14 +535,14 @@ int toku_logger_set_lg_max(TOKULOGGER logger, u_int32_t lg_max) {
     logger->lg_max = lg_max;
     return 0;
 }
-int toku_logger_get_lg_max(TOKULOGGER logger, u_int32_t *lg_maxp) {
+int toku_logger_get_lg_max(TOKULOGGER logger, uint32_t *lg_maxp) {
     if (logger==0) return EINVAL; // no logger
     if (logger->is_panicked) return EINVAL;
     *lg_maxp = logger->lg_max;
     return 0;
 }
 
-int toku_logger_set_lg_bsize(TOKULOGGER logger, u_int32_t bsize) {
+int toku_logger_set_lg_bsize(TOKULOGGER logger, uint32_t bsize) {
     if (logger==0) return EINVAL; // no logger
     if (logger->is_panicked) return EINVAL;
     if (logger->is_open) return EINVAL;
@@ -589,7 +589,7 @@ static int logfilenamecompare (const void *ap, const void *bp) {
     char *b=*(char**)bp;
     char * b_leafname = fileleafname(b);
     int rval;
-    BOOL valid;
+    bool valid;
     uint64_t num_a = 0;  // placate compiler
     uint64_t num_b = 0;
     uint32_t ver_a = 0;
@@ -727,13 +727,13 @@ int toku_logger_maybe_trim_log(TOKULOGGER logger, LSN trim_lsn)
     return r;
 }
 
-void toku_logger_write_log_files (TOKULOGGER logger, BOOL write_log_files)
+void toku_logger_write_log_files (TOKULOGGER logger, bool write_log_files)
 // Called only during initialization (or just after recovery), so no locks are needed.
 {
     logger->write_log_files = write_log_files;
 }
 
-void toku_logger_trim_log_files (TOKULOGGER logger, BOOL trim_log_files)
+void toku_logger_trim_log_files (TOKULOGGER logger, bool trim_log_files)
 // Called only during initialization, so no locks are needed.
 {
     logger->trim_log_files = trim_log_files;
@@ -751,7 +751,7 @@ int toku_logger_maybe_fsync (TOKULOGGER logger, LSN lsn, int do_fsync)
         logger->input_lock_ctr++;
         ml_unlock(&logger->input_lock);
         LSN  fsynced_lsn;
-        BOOL already_done = wait_till_output_already_written_or_output_buffer_available(logger, lsn, &fsynced_lsn);
+        bool already_done = wait_till_output_already_written_or_output_buffer_available(logger, lsn, &fsynced_lsn);
         if (already_done) return 0;
 
         // otherwise we now own the output permission, and our lsn isn't outputed.
@@ -833,8 +833,8 @@ int toku_logger_restart(TOKULOGGER logger, LSN lastlsn)
 
     // reset the LSN's to the lastlsn when the logger was opened
     logger->lsn = logger->written_lsn = logger->fsynced_lsn = lastlsn;
-    logger->write_log_files = TRUE;
-    logger->trim_log_files = TRUE;
+    logger->write_log_files = true;
+    logger->trim_log_files = true;
 
     // open a new log file
     r = open_logfile(logger);
@@ -843,7 +843,7 @@ int toku_logger_restart(TOKULOGGER logger, LSN lastlsn)
 }
 
 // fname is the iname
-int toku_logger_log_fcreate (TOKUTXN txn, const char *fname, FILENUM filenum, u_int32_t mode, u_int32_t treeflags, u_int32_t nodesize, u_int32_t basementnodesize, enum toku_compression_method compression_method) {
+int toku_logger_log_fcreate (TOKUTXN txn, const char *fname, FILENUM filenum, uint32_t mode, uint32_t treeflags, uint32_t nodesize, uint32_t basementnodesize, enum toku_compression_method compression_method) {
     if (txn==0) return 0;
     if (txn->logger->is_panicked) return EINVAL;
     BYTESTRING bs_fname = { .len = (uint32_t) strlen(fname), .data = (char *) fname };
@@ -874,106 +874,106 @@ int toku_logger_log_fopen (TOKUTXN txn, const char * fname, FILENUM filenum, uin
     return toku_log_fopen (txn->logger, (LSN*)0, 0, bs, filenum, treeflags);
 }
 
-static int toku_fread_u_int8_t_nocrclen (FILE *f, u_int8_t *v) {
+static int toku_fread_uint8_t_nocrclen (FILE *f, uint8_t *v) {
     int vi=fgetc(f);
     if (vi==EOF) return -1;
-    u_int8_t vc=(u_int8_t)vi;
+    uint8_t vc=(uint8_t)vi;
     *v = vc;
     return 0;
 }
 
-int toku_fread_u_int8_t (FILE *f, u_int8_t *v, struct x1764 *mm, u_int32_t *len) {
+int toku_fread_uint8_t (FILE *f, uint8_t *v, struct x1764 *mm, uint32_t *len) {
     int vi=fgetc(f);
     if (vi==EOF) return -1;
-    u_int8_t vc=(u_int8_t)vi;
+    uint8_t vc=(uint8_t)vi;
     x1764_add(mm, &vc, 1);
     (*len)++;
     *v = vc;
     return 0;
 }
 
-int toku_fread_u_int32_t_nocrclen (FILE *f, u_int32_t *v) {
-    u_int32_t result;
-    u_int8_t *cp = (u_int8_t*)&result;
+int toku_fread_uint32_t_nocrclen (FILE *f, uint32_t *v) {
+    uint32_t result;
+    uint8_t *cp = (uint8_t*)&result;
     int r;
-    r = toku_fread_u_int8_t_nocrclen (f, cp+0); if (r!=0) return r;
-    r = toku_fread_u_int8_t_nocrclen (f, cp+1); if (r!=0) return r;
-    r = toku_fread_u_int8_t_nocrclen (f, cp+2); if (r!=0) return r;
-    r = toku_fread_u_int8_t_nocrclen (f, cp+3); if (r!=0) return r;
+    r = toku_fread_uint8_t_nocrclen (f, cp+0); if (r!=0) return r;
+    r = toku_fread_uint8_t_nocrclen (f, cp+1); if (r!=0) return r;
+    r = toku_fread_uint8_t_nocrclen (f, cp+2); if (r!=0) return r;
+    r = toku_fread_uint8_t_nocrclen (f, cp+3); if (r!=0) return r;
     *v = toku_dtoh32(result);
 
     return 0;
 }
-int toku_fread_u_int32_t (FILE *f, u_int32_t *v, struct x1764 *checksum, u_int32_t *len) {
-    u_int32_t result;
-    u_int8_t *cp = (u_int8_t*)&result;
+int toku_fread_uint32_t (FILE *f, uint32_t *v, struct x1764 *checksum, uint32_t *len) {
+    uint32_t result;
+    uint8_t *cp = (uint8_t*)&result;
     int r;
-    r = toku_fread_u_int8_t (f, cp+0, checksum, len); if(r!=0) return r;
-    r = toku_fread_u_int8_t (f, cp+1, checksum, len); if(r!=0) return r;
-    r = toku_fread_u_int8_t (f, cp+2, checksum, len); if(r!=0) return r;
-    r = toku_fread_u_int8_t (f, cp+3, checksum, len); if(r!=0) return r;
+    r = toku_fread_uint8_t (f, cp+0, checksum, len); if(r!=0) return r;
+    r = toku_fread_uint8_t (f, cp+1, checksum, len); if(r!=0) return r;
+    r = toku_fread_uint8_t (f, cp+2, checksum, len); if(r!=0) return r;
+    r = toku_fread_uint8_t (f, cp+3, checksum, len); if(r!=0) return r;
     *v = toku_dtoh32(result);
     return 0;
 }
 
-int toku_fread_u_int64_t (FILE *f, u_int64_t *v, struct x1764 *checksum, u_int32_t *len) {
-    u_int32_t v1,v2;
+int toku_fread_uint64_t (FILE *f, uint64_t *v, struct x1764 *checksum, uint32_t *len) {
+    uint32_t v1,v2;
     int r;
-    r=toku_fread_u_int32_t(f, &v1, checksum, len);    if (r!=0) return r;
-    r=toku_fread_u_int32_t(f, &v2, checksum, len);    if (r!=0) return r;
-    *v = (((u_int64_t)v1)<<32 ) | ((u_int64_t)v2);
+    r=toku_fread_uint32_t(f, &v1, checksum, len);    if (r!=0) return r;
+    r=toku_fread_uint32_t(f, &v2, checksum, len);    if (r!=0) return r;
+    *v = (((uint64_t)v1)<<32 ) | ((uint64_t)v2);
     return 0;
 }
 
-int toku_fread_BOOL (FILE *f, BOOL *v, struct x1764 *mm, u_int32_t *len) {
-    u_int8_t iv;
-    int r = toku_fread_u_int8_t(f, &iv, mm, len);
+int toku_fread_bool (FILE *f, bool *v, struct x1764 *mm, uint32_t *len) {
+    uint8_t iv;
+    int r = toku_fread_uint8_t(f, &iv, mm, len);
     if (r == 0) {
         *v = (iv!=0);
     }
     return r;
 }
 
-int toku_fread_LSN     (FILE *f, LSN *lsn, struct x1764 *checksum, u_int32_t *len) {
-    return toku_fread_u_int64_t (f, &lsn->lsn, checksum, len);
+int toku_fread_LSN     (FILE *f, LSN *lsn, struct x1764 *checksum, uint32_t *len) {
+    return toku_fread_uint64_t (f, &lsn->lsn, checksum, len);
 }
 
-int toku_fread_BLOCKNUM (FILE *f, BLOCKNUM *b, struct x1764 *checksum, u_int32_t *len) {
-    return toku_fread_u_int64_t (f, (u_int64_t*)&b->b, checksum, len);
+int toku_fread_BLOCKNUM (FILE *f, BLOCKNUM *b, struct x1764 *checksum, uint32_t *len) {
+    return toku_fread_uint64_t (f, (uint64_t*)&b->b, checksum, len);
 }
 
-int toku_fread_FILENUM (FILE *f, FILENUM *filenum, struct x1764 *checksum, u_int32_t *len) {
-    return toku_fread_u_int32_t (f, &filenum->fileid, checksum, len);
+int toku_fread_FILENUM (FILE *f, FILENUM *filenum, struct x1764 *checksum, uint32_t *len) {
+    return toku_fread_uint32_t (f, &filenum->fileid, checksum, len);
 }
 
-int toku_fread_TXNID   (FILE *f, TXNID *txnid, struct x1764 *checksum, u_int32_t *len) {
-    return toku_fread_u_int64_t (f, txnid, checksum, len);
+int toku_fread_TXNID   (FILE *f, TXNID *txnid, struct x1764 *checksum, uint32_t *len) {
+    return toku_fread_uint64_t (f, txnid, checksum, len);
 }
 
-int toku_fread_XIDP    (FILE *f, XIDP *xidp, struct x1764 *checksum, u_int32_t *len) {
+int toku_fread_XIDP    (FILE *f, XIDP *xidp, struct x1764 *checksum, uint32_t *len) {
     // These reads are verbose because XA defined the fields as "long", but we use 4 bytes, 1 byte and 1 byte respectively.
     TOKU_XA_XID *XMALLOC(xid);
     {
-        u_int32_t formatID;
-        int r = toku_fread_u_int32_t(f, &formatID,     checksum, len);
+        uint32_t formatID;
+        int r = toku_fread_uint32_t(f, &formatID,     checksum, len);
         if (r!=0) return r;
         xid->formatID = formatID;
     }
     {
-        u_int8_t gtrid_length;
-        int r = toku_fread_u_int8_t (f, &gtrid_length, checksum, len);
+        uint8_t gtrid_length;
+        int r = toku_fread_uint8_t (f, &gtrid_length, checksum, len);
         if (r!=0) return r;
         xid->gtrid_length = gtrid_length;
     }
     {
-        u_int8_t bqual_length;
-        int r = toku_fread_u_int8_t (f, &bqual_length, checksum, len);
+        uint8_t bqual_length;
+        int r = toku_fread_uint8_t (f, &bqual_length, checksum, len);
         if (r!=0) return r;
         xid->bqual_length = bqual_length;
     }
     for (int i=0; i< xid->gtrid_length + xid->bqual_length; i++) {
-        u_int8_t byte;
-        int r = toku_fread_u_int8_t(f, &byte, checksum, len);
+        uint8_t byte;
+        int r = toku_fread_uint8_t(f, &byte, checksum, len);
         if (r!=0) return r;
         xid->data[i] = byte;
     }
@@ -982,13 +982,13 @@ int toku_fread_XIDP    (FILE *f, XIDP *xidp, struct x1764 *checksum, u_int32_t *
 }
 
 // fills in the bs with malloced data.
-int toku_fread_BYTESTRING (FILE *f, BYTESTRING *bs, struct x1764 *checksum, u_int32_t *len) {
-    int r=toku_fread_u_int32_t(f, (u_int32_t*)&bs->len, checksum, len);
+int toku_fread_BYTESTRING (FILE *f, BYTESTRING *bs, struct x1764 *checksum, uint32_t *len) {
+    int r=toku_fread_uint32_t(f, (uint32_t*)&bs->len, checksum, len);
     if (r!=0) return r;
     XMALLOC_N(bs->len, bs->data);
-    u_int32_t i;
+    uint32_t i;
     for (i=0; i<bs->len; i++) {
-        r=toku_fread_u_int8_t(f, (u_int8_t*)&bs->data[i], checksum, len);
+        r=toku_fread_uint8_t(f, (uint8_t*)&bs->data[i], checksum, len);
         if (r!=0) {
             toku_free(bs->data);
             bs->data=0;
@@ -999,11 +999,11 @@ int toku_fread_BYTESTRING (FILE *f, BYTESTRING *bs, struct x1764 *checksum, u_in
 }
 
 // fills in the fs with malloced data.
-int toku_fread_FILENUMS (FILE *f, FILENUMS *fs, struct x1764 *checksum, u_int32_t *len) {
-    int r=toku_fread_u_int32_t(f, (u_int32_t*)&fs->num, checksum, len);
+int toku_fread_FILENUMS (FILE *f, FILENUMS *fs, struct x1764 *checksum, uint32_t *len) {
+    int r=toku_fread_uint32_t(f, (uint32_t*)&fs->num, checksum, len);
     if (r!=0) return r;
     XMALLOC_N(fs->num, fs->filenums);
-    u_int32_t i;
+    uint32_t i;
     for (i=0; i<fs->num; i++) {
         r=toku_fread_FILENUM (f, &fs->filenums[i], checksum, len);
         if (r!=0) {
@@ -1015,7 +1015,7 @@ int toku_fread_FILENUMS (FILE *f, FILENUMS *fs, struct x1764 *checksum, u_int32_
     return 0;
 }
 
-int toku_logprint_LSN (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format __attribute__((__unused__))) {
+int toku_logprint_LSN (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format __attribute__((__unused__))) {
     LSN v;
     int r = toku_fread_LSN(inf, &v, checksum, len);
     if (r!=0) return r;
@@ -1023,7 +1023,7 @@ int toku_logprint_LSN (FILE *outf, FILE *inf, const char *fieldname, struct x176
     return 0;
 }
 
-int toku_logprint_TXNID (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format __attribute__((__unused__))) {
+int toku_logprint_TXNID (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format __attribute__((__unused__))) {
     TXNID v;
     int r = toku_fread_TXNID(inf, &v, checksum, len);
     if (r!=0) return r;
@@ -1031,7 +1031,7 @@ int toku_logprint_TXNID (FILE *outf, FILE *inf, const char *fieldname, struct x1
     return 0;
 }
 
-int toku_logprint_XIDP (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format __attribute__((__unused__))) {
+int toku_logprint_XIDP (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format __attribute__((__unused__))) {
     XIDP vp;
     int r = toku_fread_XIDP(inf, &vp, checksum, len);
     if (r!=0) return r;
@@ -1042,9 +1042,9 @@ int toku_logprint_XIDP (FILE *outf, FILE *inf, const char *fieldname, struct x17
     return 0;
 }
 
-int toku_logprint_u_int8_t (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format) {
-    u_int8_t v;
-    int r = toku_fread_u_int8_t(inf, &v, checksum, len);
+int toku_logprint_uint8_t (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format) {
+    uint8_t v;
+    int r = toku_fread_uint8_t(inf, &v, checksum, len);
     if (r!=0) return r;
     fprintf(outf, " %s=%d", fieldname, v);
     if (format) fprintf(outf, format, v);
@@ -1054,41 +1054,41 @@ int toku_logprint_u_int8_t (FILE *outf, FILE *inf, const char *fieldname, struct
     return 0;
 }
 
-int toku_logprint_u_int32_t (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format) {
-    u_int32_t v;
-    int r = toku_fread_u_int32_t(inf, &v, checksum, len);
+int toku_logprint_uint32_t (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format) {
+    uint32_t v;
+    int r = toku_fread_uint32_t(inf, &v, checksum, len);
     if (r!=0) return r;
     fprintf(outf, " %s=", fieldname);
     fprintf(outf, format ? format : "%d", v);
     return 0;
 }
 
-int toku_logprint_u_int64_t (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format) {
-    u_int64_t v;
-    int r = toku_fread_u_int64_t(inf, &v, checksum, len);
+int toku_logprint_uint64_t (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format) {
+    uint64_t v;
+    int r = toku_fread_uint64_t(inf, &v, checksum, len);
     if (r!=0) return r;
     fprintf(outf, " %s=", fieldname);
     fprintf(outf, format ? format : "%" PRId64, v);
     return 0;
 }
 
-int toku_logprint_BOOL (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format __attribute__((__unused__))) {
-    BOOL v;
-    int r = toku_fread_BOOL(inf, &v, checksum, len);
+int toku_logprint_bool (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format __attribute__((__unused__))) {
+    bool v;
+    int r = toku_fread_bool(inf, &v, checksum, len);
     if (r!=0) return r;
-    fprintf(outf, " %s=%s", fieldname, v ? "TRUE" : "FALSE");
+    fprintf(outf, " %s=%s", fieldname, v ? "true" : "false");
     return 0;
 
 }
 
-void toku_print_BYTESTRING (FILE *outf, u_int32_t len, char *data) {
+void toku_print_BYTESTRING (FILE *outf, uint32_t len, char *data) {
     fprintf(outf, "{len=%u data=", len);
     toku_print_bytes(outf, len, data);
     fprintf(outf, "}");
 
 }
 
-int toku_logprint_BYTESTRING (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format __attribute__((__unused__))) {
+int toku_logprint_BYTESTRING (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format __attribute__((__unused__))) {
     BYTESTRING bs;
     int r = toku_fread_BYTESTRING(inf, &bs, checksum, len);
     if (r!=0) return r;
@@ -1098,20 +1098,20 @@ int toku_logprint_BYTESTRING (FILE *outf, FILE *inf, const char *fieldname, stru
     return 0;
 }
 
-int toku_logprint_BLOCKNUM (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format) {
-    return toku_logprint_u_int64_t(outf, inf, fieldname, checksum, len, format);
+int toku_logprint_BLOCKNUM (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format) {
+    return toku_logprint_uint64_t(outf, inf, fieldname, checksum, len, format);
 
 }
 
-int toku_logprint_FILENUM (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format) {
-    return toku_logprint_u_int32_t(outf, inf, fieldname, checksum, len, format);
+int toku_logprint_FILENUM (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format) {
+    return toku_logprint_uint32_t(outf, inf, fieldname, checksum, len, format);
 
 }
 
 static void
-toku_print_FILENUMS (FILE *outf, u_int32_t num, FILENUM *filenums) {
+toku_print_FILENUMS (FILE *outf, uint32_t num, FILENUM *filenums) {
     fprintf(outf, "{num=%u filenums=\"", num);
-    u_int32_t i;
+    uint32_t i;
     for (i=0; i<num; i++) {
         if (i>0)
             fprintf(outf, ",");
@@ -1121,7 +1121,7 @@ toku_print_FILENUMS (FILE *outf, u_int32_t num, FILENUM *filenums) {
 
 }
 
-int toku_logprint_FILENUMS (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format __attribute__((__unused__))) {
+int toku_logprint_FILENUMS (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format __attribute__((__unused__))) {
     FILENUMS bs;
     int r = toku_fread_FILENUMS(inf, &bs, checksum, len);
     if (r!=0) return r;
@@ -1131,7 +1131,7 @@ int toku_logprint_FILENUMS (FILE *outf, FILE *inf, const char *fieldname, struct
     return 0;
 }
 
-int toku_read_and_print_logmagic (FILE *f, u_int32_t *versionp) {
+int toku_read_and_print_logmagic (FILE *f, uint32_t *versionp) {
     {
         char magic[8];
         int r=fread(magic, 1, 8, f);
@@ -1155,7 +1155,7 @@ int toku_read_and_print_logmagic (FILE *f, u_int32_t *versionp) {
     return 0;
 }
 
-int toku_read_logmagic (FILE *f, u_int32_t *versionp) {
+int toku_read_logmagic (FILE *f, uint32_t *versionp) {
     {
         char magic[8];
         int r=fread(magic, 1, 8, f);
@@ -1218,7 +1218,7 @@ static int peek_at_log (TOKULOGGER logger, char* filename, LSN *first_lsn) {
     int r = read(fd, header, SKIP+8);
     if (r!=SKIP+8) return 0; // cannot determine that it's archivable, so we'll assume no.  If a later-log is archivable is then this one will be too.
 
-    u_int64_t lsn;
+    uint64_t lsn;
     {
         struct rbuf rb;
         rb.buf   = header+SKIP;
@@ -1386,10 +1386,10 @@ toku_logger_get_status(TOKULOGGER logger, LOGGER_STATUS statp) {
 //////////////////////////////////////////////////////////////////////////////////////////////////////
 // Used for upgrade: 
 // if any valid log files exist in log_dir, then
-//   set *found_any_logs to TRUE and set *version_found to version number of latest log
+//   set *found_any_logs to true and set *version_found to version number of latest log
 int
-toku_get_version_of_logs_on_disk(const char *log_dir, BOOL *found_any_logs, uint32_t *version_found) {
-    BOOL found = FALSE;
+toku_get_version_of_logs_on_disk(const char *log_dir, bool *found_any_logs, uint32_t *version_found) {
+    bool found = false;
     uint32_t highest_version = 0;
     int r = 0;
 
@@ -1403,10 +1403,10 @@ toku_get_version_of_logs_on_disk(const char *log_dir, BOOL *found_any_logs, uint
         while ((de=readdir(d))) {
             uint32_t this_log_version;
             uint64_t this_log_number;
-            BOOL is_log = is_a_logfile_any_version(de->d_name, &this_log_number, &this_log_version);
+            bool is_log = is_a_logfile_any_version(de->d_name, &this_log_number, &this_log_version);
             if (is_log) {
                 if (!found) {  // first log file found
-                    found = TRUE;
+                    found = true;
                     highest_version = this_log_version;
                 }
                 else
diff --git a/ft/logger.h b/ft/logger.h
index bc5bd817805d18a61dac4dd0be386137e7ecf582..ed190af05205bcc5aae989884f80de972a81e047 100644
--- a/ft/logger.h
+++ b/ft/logger.h
@@ -25,8 +25,8 @@ int toku_logger_open (const char *directory, TOKULOGGER logger);
 int toku_logger_open_with_last_xid(const char *directory, TOKULOGGER logger, TXNID last_xid);
 int toku_logger_shutdown(TOKULOGGER logger);
 int toku_logger_close(TOKULOGGER *loggerp);
-int toku_logger_open_rollback(TOKULOGGER logger, CACHETABLE cachetable, BOOL create);
-int toku_logger_close_rollback(TOKULOGGER logger, BOOL recovery_failed);
+int toku_logger_open_rollback(TOKULOGGER logger, CACHETABLE cachetable, bool create);
+int toku_logger_close_rollback(TOKULOGGER logger, bool recovery_failed);
 bool toku_logger_rollback_is_open (TOKULOGGER); // return true iff the rollback is open.
 
 int toku_logger_fsync (TOKULOGGER logger);
@@ -35,15 +35,15 @@ void toku_logger_panic (TOKULOGGER logger, int err);
 int toku_logger_panicked(TOKULOGGER logger);
 int toku_logger_is_open(TOKULOGGER logger);
 void toku_logger_set_cachetable (TOKULOGGER logger, CACHETABLE ct);
-int toku_logger_set_lg_max(TOKULOGGER logger, u_int32_t lg_max);
-int toku_logger_get_lg_max(TOKULOGGER logger, u_int32_t *lg_maxp);
-int toku_logger_set_lg_bsize(TOKULOGGER logger, u_int32_t bsize);
+int toku_logger_set_lg_max(TOKULOGGER logger, uint32_t lg_max);
+int toku_logger_get_lg_max(TOKULOGGER logger, uint32_t *lg_maxp);
+int toku_logger_set_lg_bsize(TOKULOGGER logger, uint32_t bsize);
 
 int toku_logger_lock_init(void);
 int toku_logger_lock_destroy(void);
 
-void toku_logger_write_log_files (TOKULOGGER logger, BOOL write_log_files);
-void toku_logger_trim_log_files(TOKULOGGER logger, BOOL trim_log_files);
+void toku_logger_write_log_files (TOKULOGGER logger, bool write_log_files);
+void toku_logger_trim_log_files(TOKULOGGER logger, bool trim_log_files);
 
 // Restart the logger.  This function is used by recovery to really start
 // logging.
@@ -58,37 +58,37 @@ int toku_logger_restart(TOKULOGGER logger, LSN lastlsn);
 // Returns: 0 if success
 int toku_logger_maybe_trim_log(TOKULOGGER logger, LSN oldest_open_lsn);
 
-int toku_logger_log_fcreate (TOKUTXN txn, const char *fname, FILENUM filenum, u_int32_t mode, u_int32_t flags, u_int32_t nodesize, u_int32_t basementnodesize, enum toku_compression_method compression_method);
+int toku_logger_log_fcreate (TOKUTXN txn, const char *fname, FILENUM filenum, uint32_t mode, uint32_t flags, uint32_t nodesize, uint32_t basementnodesize, enum toku_compression_method compression_method);
 int toku_logger_log_fdelete (TOKUTXN txn, FILENUM filenum);
 int toku_logger_log_fopen (TOKUTXN txn, const char * fname, FILENUM filenum, uint32_t treeflags);
 
-int toku_fread_u_int8_t (FILE *f, u_int8_t *v, struct x1764 *mm, u_int32_t *len);
-int toku_fread_u_int32_t_nocrclen (FILE *f, u_int32_t *v);
-int toku_fread_u_int32_t (FILE *f, u_int32_t *v, struct x1764 *checksum, u_int32_t *len);
-int toku_fread_u_int64_t (FILE *f, u_int64_t *v, struct x1764 *checksum, u_int32_t *len);
-int toku_fread_BOOL (FILE *f, BOOL *v, struct x1764 *checksum, u_int32_t *len);
-int toku_fread_LSN     (FILE *f, LSN *lsn, struct x1764 *checksum, u_int32_t *len);
-int toku_fread_BLOCKNUM (FILE *f, BLOCKNUM *lsn, struct x1764 *checksum, u_int32_t *len);
-int toku_fread_FILENUM (FILE *f, FILENUM *filenum, struct x1764 *checksum, u_int32_t *len);
-int toku_fread_TXNID   (FILE *f, TXNID *txnid, struct x1764 *checksum, u_int32_t *len);
-int toku_fread_XIDP    (FILE *f, XIDP  *xidp,  struct x1764 *checksum, u_int32_t *len);
-int toku_fread_BYTESTRING (FILE *f, BYTESTRING *bs, struct x1764 *checksum, u_int32_t *len);
-int toku_fread_FILENUMS (FILE *f, FILENUMS *fs, struct x1764 *checksum, u_int32_t *len);
-
-int toku_logprint_LSN (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format __attribute__((__unused__)));
-int toku_logprint_TXNID (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format __attribute__((__unused__)));
-int toku_logprint_XIDP (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format __attribute__((__unused__)));
-int toku_logprint_u_int8_t (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format);
-int toku_logprint_u_int32_t (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format);
-int toku_logprint_BLOCKNUM (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format);
-int toku_logprint_u_int64_t (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format);
-int toku_logprint_BOOL (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format __attribute__((__unused__)));
-void toku_print_BYTESTRING (FILE *outf, u_int32_t len, char *data);
-int toku_logprint_BYTESTRING (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format __attribute__((__unused__)));
-int toku_logprint_FILENUM (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format);
-int toku_logprint_FILENUMS (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, u_int32_t *len, const char *format);
-int toku_read_and_print_logmagic (FILE *f, u_int32_t *versionp);
-int toku_read_logmagic (FILE *f, u_int32_t *versionp);
+int toku_fread_uint8_t (FILE *f, uint8_t *v, struct x1764 *mm, uint32_t *len);
+int toku_fread_uint32_t_nocrclen (FILE *f, uint32_t *v);
+int toku_fread_uint32_t (FILE *f, uint32_t *v, struct x1764 *checksum, uint32_t *len);
+int toku_fread_uint64_t (FILE *f, uint64_t *v, struct x1764 *checksum, uint32_t *len);
+int toku_fread_bool (FILE *f, bool *v, struct x1764 *checksum, uint32_t *len);
+int toku_fread_LSN     (FILE *f, LSN *lsn, struct x1764 *checksum, uint32_t *len);
+int toku_fread_BLOCKNUM (FILE *f, BLOCKNUM *lsn, struct x1764 *checksum, uint32_t *len);
+int toku_fread_FILENUM (FILE *f, FILENUM *filenum, struct x1764 *checksum, uint32_t *len);
+int toku_fread_TXNID   (FILE *f, TXNID *txnid, struct x1764 *checksum, uint32_t *len);
+int toku_fread_XIDP    (FILE *f, XIDP  *xidp,  struct x1764 *checksum, uint32_t *len);
+int toku_fread_BYTESTRING (FILE *f, BYTESTRING *bs, struct x1764 *checksum, uint32_t *len);
+int toku_fread_FILENUMS (FILE *f, FILENUMS *fs, struct x1764 *checksum, uint32_t *len);
+
+int toku_logprint_LSN (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format __attribute__((__unused__)));
+int toku_logprint_TXNID (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format __attribute__((__unused__)));
+int toku_logprint_XIDP (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format __attribute__((__unused__)));
+int toku_logprint_uint8_t (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format);
+int toku_logprint_uint32_t (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format);
+int toku_logprint_BLOCKNUM (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format);
+int toku_logprint_uint64_t (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format);
+int toku_logprint_bool (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format __attribute__((__unused__)));
+void toku_print_BYTESTRING (FILE *outf, uint32_t len, char *data);
+int toku_logprint_BYTESTRING (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format __attribute__((__unused__)));
+int toku_logprint_FILENUM (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format);
+int toku_logprint_FILENUMS (FILE *outf, FILE *inf, const char *fieldname, struct x1764 *checksum, uint32_t *len, const char *format);
+int toku_read_and_print_logmagic (FILE *f, uint32_t *versionp);
+int toku_read_logmagic (FILE *f, uint32_t *versionp);
 
 TXNID toku_txn_get_txnid (TOKUTXN txn);
 TXNID toku_txn_get_root_txnid (TOKUTXN txn);
@@ -177,14 +177,14 @@ typedef enum {
 } logger_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[LOGGER_STATUS_NUM_ROWS];
 } LOGGER_STATUS_S, *LOGGER_STATUS;
 
 
 void toku_logger_get_status(TOKULOGGER logger, LOGGER_STATUS s);
 
-int toku_get_version_of_logs_on_disk(const char *log_dir, BOOL *found_any_logs, uint32_t *version_found);
+int toku_get_version_of_logs_on_disk(const char *log_dir, bool *found_any_logs, uint32_t *version_found);
 int toku_delete_all_logs_of_version(const char *log_dir, uint32_t version_to_delete);
 
 TXN_MANAGER toku_logger_get_txn_manager(TOKULOGGER logger);
diff --git a/ft/minicron.cc b/ft/minicron.cc
index e2cd84a6e9460c4732a98fb5b61e98d9bf8d0cb2..1f06fafac95325bb73231f01c75d1ab5f5a3268d 100644
--- a/ft/minicron.cc
+++ b/ft/minicron.cc
@@ -84,14 +84,14 @@ minicron_do (void *pv)
 }
 
 int
-toku_minicron_setup(struct minicron *p, u_int32_t period_in_seconds, int(*f)(void *), void *arg)
+toku_minicron_setup(struct minicron *p, uint32_t period_in_seconds, int(*f)(void *), void *arg)
 {
     p->f = f;
     p->arg = arg;
     toku_gettime(&p->time_of_last_call_to_f);
     //printf("now=%.6f", p->time_of_last_call_to_f.tv_sec + p->time_of_last_call_to_f.tv_nsec*1e-9);
     p->period_in_seconds = period_in_seconds; 
-    p->do_shutdown = FALSE;
+    p->do_shutdown = false;
     toku_mutex_init(&p->mutex, 0);
     toku_cond_init (&p->condvar, 0);
     //printf("%s:%d setup period=%d\n", __FILE__, __LINE__, period_in_seconds);
@@ -99,7 +99,7 @@ toku_minicron_setup(struct minicron *p, u_int32_t period_in_seconds, int(*f)(voi
 }
     
 int
-toku_minicron_change_period(struct minicron *p, u_int32_t new_period)
+toku_minicron_change_period(struct minicron *p, uint32_t new_period)
 {
     toku_mutex_lock(&p->mutex);
     p->period_in_seconds = new_period;
@@ -108,20 +108,20 @@ toku_minicron_change_period(struct minicron *p, u_int32_t new_period)
     return 0;
 }
 
-u_int32_t
+uint32_t
 toku_minicron_get_period(struct minicron *p)
 {
     toku_mutex_lock(&p->mutex);
-    u_int32_t retval = toku_minicron_get_period_unlocked(p);
+    uint32_t retval = toku_minicron_get_period_unlocked(p);
     toku_mutex_unlock(&p->mutex);
     return retval;
 }
 
 /* unlocked function for use by engine status which takes no locks */
-u_int32_t
+uint32_t
 toku_minicron_get_period_unlocked(struct minicron *p)
 {
-    u_int32_t retval = p->period_in_seconds;
+    uint32_t retval = p->period_in_seconds;
     return retval;
 }
 
@@ -129,7 +129,7 @@ int
 toku_minicron_shutdown(struct minicron *p) {
     toku_mutex_lock(&p->mutex);
     assert(!p->do_shutdown);
-    p->do_shutdown = TRUE;
+    p->do_shutdown = true;
     //printf("%s:%d signalling\n", __FILE__, __LINE__);
     toku_cond_signal(&p->condvar);
     toku_mutex_unlock(&p->mutex);
@@ -144,7 +144,7 @@ toku_minicron_shutdown(struct minicron *p) {
     return 0;
 }
 
-BOOL
+bool
 toku_minicron_has_been_shutdown(struct minicron *p) {
     return p->do_shutdown;
 }
diff --git a/ft/minicron.h b/ft/minicron.h
index c93a3e49297f8c85622b9c9ba068a4ac26cc7bc8..815d8ec76c5fcbc2b266da0e8141a05efc24051e 100644
--- a/ft/minicron.h
+++ b/ft/minicron.h
@@ -32,16 +32,16 @@ struct minicron {
     toku_cond_t  condvar;
     int (*f)(void*);
     void *arg;
-    u_int32_t period_in_seconds;
-    BOOL      do_shutdown;
+    uint32_t period_in_seconds;
+    bool      do_shutdown;
 };
 
-int toku_minicron_setup (struct minicron *s, u_int32_t period_in_seconds, int(*f)(void *), void *arg);
-int toku_minicron_change_period(struct minicron *p, u_int32_t new_period);
-u_int32_t toku_minicron_get_period(struct minicron *p);
-u_int32_t toku_minicron_get_period_unlocked(struct minicron *p);
+int toku_minicron_setup (struct minicron *s, uint32_t period_in_seconds, int(*f)(void *), void *arg);
+int toku_minicron_change_period(struct minicron *p, uint32_t new_period);
+uint32_t toku_minicron_get_period(struct minicron *p);
+uint32_t toku_minicron_get_period_unlocked(struct minicron *p);
 int toku_minicron_shutdown(struct minicron *p);
-BOOL toku_minicron_has_been_shutdown(struct minicron *p);
+bool toku_minicron_has_been_shutdown(struct minicron *p);
 
 
 #endif
diff --git a/ft/omt-tmpl.cc b/ft/omt-tmpl.cc
index 9e614dffd2e6c3b28d3fcbe4b25577f08026e435..13d535604d04843c6a9b01a1f99a374d066cb331 100644
--- a/ft/omt-tmpl.cc
+++ b/ft/omt-tmpl.cc
@@ -9,7 +9,6 @@
 #include <toku_assert.h>
 #include <memory.h>
 #include <stdint.h>
-#include <stdbool.h>
 #include <string.h>
 #include <errno.h>
 #include <db.h>
diff --git a/ft/omt-tmpl.h b/ft/omt-tmpl.h
index f25f1f066c03b0552df3782d7191470ef606ff26..012f43df744b92453b9723e959fbdf792684795b 100644
--- a/ft/omt-tmpl.h
+++ b/ft/omt-tmpl.h
@@ -9,7 +9,6 @@
 
 #include <toku_portability.h>
 #include <stdint.h>
-#include <stdbool.h>
 
 namespace toku {
 
diff --git a/ft/omt.cc b/ft/omt.cc
index 9495be9438bb5d887d1da791cc2ca1c5c10284b8..7a50393f7ac4b603b6694cf47f2b873fa19db8c4 100644
--- a/ft/omt.cc
+++ b/ft/omt.cc
@@ -21,12 +21,12 @@
 #include "omt.h"
 #include "fttypes.h"
 
-typedef u_int32_t node_idx;
+typedef uint32_t node_idx;
 static const node_idx NODE_NULL = UINT32_MAX;
 
 typedef struct omt_node *OMT_NODE;
 struct omt_node {
-    u_int32_t weight; /* Size of subtree rooted at this node (including this one). */
+    uint32_t weight; /* Size of subtree rooted at this node (including this one). */
     node_idx  left;   /* Index of left  subtree. */
     node_idx  right;  /* Index of right subtree. */
     OMTVALUE  value;  /* The value stored in the node. */
@@ -34,8 +34,8 @@ struct omt_node {
 
 
 struct omt_array {
-    u_int32_t  start_idx;
-    u_int32_t  num_values;
+    uint32_t  start_idx;
+    uint32_t  num_values;
     OMTVALUE  *values;
 };
 
@@ -47,8 +47,8 @@ struct omt_tree {
 };
 
 struct omt {
-    BOOL       is_array;
-    u_int32_t  capacity;
+    bool       is_array;
+    uint32_t  capacity;
     union {
         struct omt_array a;
         struct omt_tree t;
@@ -59,14 +59,14 @@ static inline int
 omt_create_no_array(OMT *omtp) {
     OMT XMALLOC(result);
     if (result==NULL) return ENOMEM;
-    result->is_array       = TRUE;
+    result->is_array       = true;
     result->i.a.num_values = 0;
     result->i.a.start_idx  = 0;
     *omtp = result;
     return 0;
 }
 
-static int omt_create_internal(OMT *omtp, u_int32_t num_starting_nodes) {
+static int omt_create_internal(OMT *omtp, uint32_t num_starting_nodes) {
     OMT result;
     int r = omt_create_no_array(&result);
     if (r) return r;
@@ -78,7 +78,7 @@ static int omt_create_internal(OMT *omtp, u_int32_t num_starting_nodes) {
 }
 
 int
-toku_omt_create_steal_sorted_array(OMT *omtp, OMTVALUE **valuesp, u_int32_t numvalues, u_int32_t capacity) {
+toku_omt_create_steal_sorted_array(OMT *omtp, OMTVALUE **valuesp, uint32_t numvalues, uint32_t capacity) {
     if (numvalues>capacity || !*valuesp) return EINVAL;
     int r = omt_create_no_array(omtp);
     if (r) return r;
@@ -90,12 +90,12 @@ toku_omt_create_steal_sorted_array(OMT *omtp, OMTVALUE **valuesp, u_int32_t numv
     return 0;
 }
 
-static inline u_int32_t nweight(OMT omt, node_idx idx) {
+static inline uint32_t nweight(OMT omt, node_idx idx) {
     if (idx==NODE_NULL) return 0;
     else return (omt->i.t.nodes+idx)->weight;
 }
 
-static inline u_int32_t omt_size(OMT omt) {
+static inline uint32_t omt_size(OMT omt) {
     return omt->is_array ? omt->i.a.num_values : nweight(omt, omt->i.t.root);
 }
 
@@ -125,11 +125,11 @@ static inline void fill_array_with_subtree_values(OMT omt, OMTVALUE *array, node
 //           numvalues=1,  halfway=0,  left side is values of size 0
 //                                     right side is values of size 0.
 static inline void rebuild_from_sorted_array(OMT omt, node_idx *n_idxp,
-                                             OMTVALUE *values, u_int32_t numvalues) {
+                                             OMTVALUE *values, uint32_t numvalues) {
     if (numvalues==0) {
         *n_idxp = NODE_NULL;
     } else {
-        u_int32_t halfway = numvalues/2;
+        uint32_t halfway = numvalues/2;
         node_idx newidx   = omt_node_malloc(omt);
         OMT_NODE newnode  = omt->i.t.nodes+newidx;
         newnode->weight   = numvalues;
@@ -140,9 +140,9 @@ static inline void rebuild_from_sorted_array(OMT omt, node_idx *n_idxp,
     }
 }
 
-static inline int maybe_resize_array(OMT omt, u_int32_t n) {
-    u_int32_t new_size = n<=2 ? 4 : 2*n;
-    u_int32_t room = omt->capacity - omt->i.a.start_idx;
+static inline int maybe_resize_array(OMT omt, uint32_t n) {
+    uint32_t new_size = n<=2 ? 4 : 2*n;
+    uint32_t room = omt->capacity - omt->i.a.start_idx;
 
     if (room<n || omt->capacity/2>=new_size) {
         OMTVALUE *XMALLOC_N(new_size, tmp_values);
@@ -159,15 +159,15 @@ static inline int maybe_resize_array(OMT omt, u_int32_t n) {
 
 static int omt_convert_to_tree(OMT omt) {
     if (!omt->is_array) return 0;
-    u_int32_t num_nodes = omt_size(omt);
-    u_int32_t new_size  = num_nodes*2;
+    uint32_t num_nodes = omt_size(omt);
+    uint32_t new_size  = num_nodes*2;
     new_size = new_size < 4 ? 4 : new_size;
 
     OMT_NODE XMALLOC_N(new_size, new_nodes);
     if (new_nodes==NULL) return get_error_errno();
     OMTVALUE *values     = omt->i.a.values;
     OMTVALUE *tmp_values = values + omt->i.a.start_idx;
-    omt->is_array          = FALSE;
+    omt->is_array          = false;
     omt->i.t.nodes         = new_nodes;
     omt->capacity          = new_size;
     omt->i.t.free_idx      = 0;
@@ -179,15 +179,15 @@ static int omt_convert_to_tree(OMT omt) {
 
 static int omt_convert_to_array(OMT omt) {
     if (omt->is_array) return 0;
-    u_int32_t num_values = omt_size(omt);
-    u_int32_t new_size  = 2*num_values;
+    uint32_t num_values = omt_size(omt);
+    uint32_t new_size  = 2*num_values;
     new_size = new_size < 4 ? 4 : new_size;
 
     OMTVALUE *XMALLOC_N(new_size, tmp_values);
     if (tmp_values==NULL) return get_error_errno();
     fill_array_with_subtree_values(omt, tmp_values, omt->i.t.root);
     toku_free(omt->i.t.nodes);
-    omt->is_array       = TRUE;
+    omt->is_array       = true;
     omt->capacity       = new_size;
     omt->i.a.num_values = num_values;
     omt->i.a.values     = tmp_values;
@@ -195,10 +195,10 @@ static int omt_convert_to_array(OMT omt) {
     return 0;
 }
 
-static inline int maybe_resize_or_convert(OMT omt, u_int32_t n) {
+static inline int maybe_resize_or_convert(OMT omt, uint32_t n) {
     if (omt->is_array) return maybe_resize_array(omt, n);
 
-    u_int32_t new_size = n<=2 ? 4 : 2*n;
+    uint32_t new_size = n<=2 ? 4 : 2*n;
 
     /* Rebuild/realloc the nodes array iff any of the following:
      *  The array is smaller than the number of elements we want.
@@ -206,7 +206,7 @@ static inline int maybe_resize_or_convert(OMT omt, u_int32_t n) {
      *  The array is too large. */
     //Rebuilding means we first turn it to an array.
     //Lets pause at the array form.
-    u_int32_t num_nodes = nweight(omt, omt->i.t.root);
+    uint32_t num_nodes = nweight(omt, omt->i.t.root);
     if ((omt->capacity/2 >= new_size) ||
         (omt->i.t.free_idx>=omt->capacity && num_nodes<n) ||
         (omt->capacity<n)) {
@@ -225,11 +225,11 @@ static inline void fill_array_with_subtree_idxs(OMT omt, node_idx *array, node_i
 
 /* Reuses existing OMT_NODE structures (used for rebalancing). */
 static inline void rebuild_subtree_from_idxs(OMT omt, node_idx *n_idxp, node_idx *idxs,
-                                             u_int32_t numvalues) {
+                                             uint32_t numvalues) {
     if (numvalues==0) {
         *n_idxp=NODE_NULL;
     } else {
-        u_int32_t halfway = numvalues/2;
+        uint32_t halfway = numvalues/2;
         node_idx newidx   = idxs[halfway];
         OMT_NODE newnode  = omt->i.t.nodes+newidx;
         newnode->weight   = numvalues;
@@ -254,15 +254,15 @@ static inline void rebalance(OMT omt, node_idx *n_idxp) {
     node_idx *tmp_array;
     size_t mem_needed = n->weight*sizeof(*tmp_array);
     size_t mem_free   = (omt->capacity-omt->i.t.free_idx)*sizeof(*omt->i.t.nodes);
-    BOOL malloced;
+    bool malloced;
     if (mem_needed<=mem_free) {
         //There is sufficient free space at the end of the nodes array
         //to hold enough node indexes to rebalance.
-        malloced  = FALSE;
+        malloced  = false;
         tmp_array = (node_idx*)(omt->i.t.nodes+omt->i.t.free_idx);
     }
     else {
-        malloced  = TRUE;
+        malloced  = true;
         XMALLOC_N(n->weight, tmp_array);
         if (tmp_array==NULL) return;    //Don't rebalance.  Still a working tree.
     }
@@ -271,19 +271,19 @@ static inline void rebalance(OMT omt, node_idx *n_idxp) {
     if (malloced) toku_free(tmp_array);
 }
 
-static inline BOOL will_need_rebalance(OMT omt, node_idx n_idx, int leftmod, int rightmod) {
-    if (n_idx==NODE_NULL) return FALSE;
+static inline bool will_need_rebalance(OMT omt, node_idx n_idx, int leftmod, int rightmod) {
+    if (n_idx==NODE_NULL) return false;
     OMT_NODE n = omt->i.t.nodes+n_idx;
     // one of the 1's is for the root.
     // the other is to take ceil(n/2)
-    u_int32_t weight_left  = nweight(omt, n->left)  + leftmod;
-    u_int32_t weight_right = nweight(omt, n->right) + rightmod;
-    return (BOOL)((1+weight_left < (1+1+weight_right)/2)
+    uint32_t weight_left  = nweight(omt, n->left)  + leftmod;
+    uint32_t weight_right = nweight(omt, n->right) + rightmod;
+    return (bool)((1+weight_left < (1+1+weight_right)/2)
 		  ||
 		  (1+weight_right < (1+1+weight_left)/2));
 }
 
-static inline void insert_internal(OMT omt, node_idx *n_idxp, OMTVALUE value, u_int32_t index, node_idx **rebalance_idx) {
+static inline void insert_internal(OMT omt, node_idx *n_idxp, OMTVALUE value, uint32_t index, node_idx **rebalance_idx) {
     if (*n_idxp==NODE_NULL) {
         assert(index==0);
         node_idx newidx  = omt_node_malloc(omt);
@@ -306,17 +306,17 @@ static inline void insert_internal(OMT omt, node_idx *n_idxp, OMTVALUE value, u_
             if (*rebalance_idx==NULL && will_need_rebalance(omt, idx, 0, 1)) {
                 *rebalance_idx = n_idxp;
             }
-            u_int32_t sub_index = index-nweight(omt, n->left)-1;
+            uint32_t sub_index = index-nweight(omt, n->left)-1;
             insert_internal(omt, &n->right, value, sub_index, rebalance_idx);
         }
     }
 }
 
-static inline void set_at_internal_array(OMT omt, OMTVALUE v, u_int32_t index) {
+static inline void set_at_internal_array(OMT omt, OMTVALUE v, uint32_t index) {
     omt->i.a.values[omt->i.a.start_idx+index] = v;
 }
 
-static inline void set_at_internal(OMT omt, node_idx n_idx, OMTVALUE v, u_int32_t index) {
+static inline void set_at_internal(OMT omt, node_idx n_idx, OMTVALUE v, uint32_t index) {
     assert(n_idx!=NODE_NULL);
     OMT_NODE n = omt->i.t.nodes+n_idx;
     if (index<nweight(omt, n->left))
@@ -328,7 +328,7 @@ static inline void set_at_internal(OMT omt, node_idx n_idx, OMTVALUE v, u_int32_
     }
 }
 
-static inline void delete_internal(OMT omt, node_idx *n_idxp, u_int32_t index, OMTVALUE *vp, node_idx **rebalance_idx) {
+static inline void delete_internal(OMT omt, node_idx *n_idxp, uint32_t index, OMTVALUE *vp, node_idx **rebalance_idx) {
     assert(*n_idxp!=NODE_NULL);
     OMT_NODE n = omt->i.t.nodes+*n_idxp;
     if (index < nweight(omt, n->left)) {
@@ -339,12 +339,12 @@ static inline void delete_internal(OMT omt, node_idx *n_idxp, u_int32_t index, O
         delete_internal(omt, &n->left, index, vp, rebalance_idx);
     } else if (index == nweight(omt, n->left)) {
         if (n->left==NODE_NULL) {
-            u_int32_t idx = *n_idxp;
+            uint32_t idx = *n_idxp;
             *n_idxp = n->right;
             *vp     = n->value;
             omt_node_free(omt, idx);
         } else if (n->right==NODE_NULL) {
-            u_int32_t idx = *n_idxp;
+            uint32_t idx = *n_idxp;
             *n_idxp = n->left;
             *vp     = n->value;
             omt_node_free(omt, idx);
@@ -367,11 +367,11 @@ static inline void delete_internal(OMT omt, node_idx *n_idxp, u_int32_t index, O
     }
 }
 
-static inline void fetch_internal_array(OMT V, u_int32_t i, OMTVALUE *v) {
+static inline void fetch_internal_array(OMT V, uint32_t i, OMTVALUE *v) {
     *v = V->i.a.values[V->i.a.start_idx+i];
 }
 
-static inline void fetch_internal(OMT V, node_idx idx, u_int32_t i, OMTVALUE *v) {
+static inline void fetch_internal(OMT V, node_idx idx, uint32_t i, OMTVALUE *v) {
     OMT_NODE n = V->i.t.nodes+idx;
     if (i < nweight(V, n->left)) {
         fetch_internal(V, n->left,  i, v);
@@ -383,10 +383,10 @@ static inline void fetch_internal(OMT V, node_idx idx, u_int32_t i, OMTVALUE *v)
 }
 
 static inline int iterate_internal_array(OMT omt,
-                                  u_int32_t left, u_int32_t right,
-                                  int (*f)(OMTVALUE, u_int32_t, void*), void*v) {
+                                  uint32_t left, uint32_t right,
+                                  int (*f)(OMTVALUE, uint32_t, void*), void*v) {
     int r;
-    u_int32_t i;
+    uint32_t i;
 
     for (i = left; i < right; i++) {
         r = f(omt->i.a.values[i+omt->i.a.start_idx], i, v);
@@ -395,27 +395,27 @@ static inline int iterate_internal_array(OMT omt,
     return 0;
 }
 
-static inline int iterate_internal(OMT omt, u_int32_t left, u_int32_t right,
-                                   node_idx n_idx, u_int32_t idx,
-                                   int (*f)(OMTVALUE, u_int32_t, void*), void*v) {
+static inline int iterate_internal(OMT omt, uint32_t left, uint32_t right,
+                                   node_idx n_idx, uint32_t idx,
+                                   int (*f)(OMTVALUE, uint32_t, void*), void*v) {
     int r;
     if (n_idx==NODE_NULL) return 0;
     OMT_NODE n = omt->i.t.nodes+n_idx;
-    u_int32_t idx_root = idx+nweight(omt,n->left);
+    uint32_t idx_root = idx+nweight(omt,n->left);
     if (left< idx_root && (r=iterate_internal(omt, left, right, n->left, idx, f, v))) return r;
     if (left<=idx_root && idx_root<right && (r=f(n->value, idx_root, v))) return r;
     if (idx_root+1<right) return iterate_internal(omt, left, right, n->right, idx_root+1, f, v);
     return 0;
 }
 
-static inline int find_internal_zero_array(OMT omt, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, u_int32_t *index) {
-    u_int32_t min   = omt->i.a.start_idx;
-    u_int32_t limit = omt->i.a.start_idx + omt->i.a.num_values;
-    u_int32_t best_pos  = NODE_NULL;
-    u_int32_t best_zero = NODE_NULL;
+static inline int find_internal_zero_array(OMT omt, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, uint32_t *index) {
+    uint32_t min   = omt->i.a.start_idx;
+    uint32_t limit = omt->i.a.start_idx + omt->i.a.num_values;
+    uint32_t best_pos  = NODE_NULL;
+    uint32_t best_zero = NODE_NULL;
 
     while (min!=limit) {
-        u_int32_t mid = (min + limit) / 2;
+        uint32_t mid = (min + limit) / 2;
         int hv = h(omt->i.a.values[mid], extra);
         if (hv<0) {
             min = mid+1;
@@ -440,7 +440,7 @@ static inline int find_internal_zero_array(OMT omt, int (*h)(OMTVALUE, void*extr
     return DB_NOTFOUND;
 }
 
-static inline int find_internal_zero(OMT omt, node_idx n_idx, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, u_int32_t *index)
+static inline int find_internal_zero(OMT omt, node_idx n_idx, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, uint32_t *index)
 // requires: index!=NULL
 {
     if (n_idx==NODE_NULL) {
@@ -467,13 +467,13 @@ static inline int find_internal_zero(OMT omt, node_idx n_idx, int (*h)(OMTVALUE,
 }
 
 
-static inline int find_internal_plus_array(OMT omt, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, u_int32_t *index) {
-    u_int32_t min   = omt->i.a.start_idx;
-    u_int32_t limit = omt->i.a.start_idx + omt->i.a.num_values;
-    u_int32_t best  = NODE_NULL;
+static inline int find_internal_plus_array(OMT omt, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, uint32_t *index) {
+    uint32_t min   = omt->i.a.start_idx;
+    uint32_t limit = omt->i.a.start_idx + omt->i.a.num_values;
+    uint32_t best  = NODE_NULL;
 
     while (min!=limit) {
-        u_int32_t mid = (min + limit) / 2;
+        uint32_t mid = (min + limit) / 2;
         int hv = h(omt->i.a.values[mid], extra);
         if (hv>0) {
             best  = mid;
@@ -489,13 +489,13 @@ static inline int find_internal_plus_array(OMT omt, int (*h)(OMTVALUE, void*extr
     return 0;
 }
 
-static inline int find_internal_minus_array(OMT omt, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, u_int32_t *index) {
-    u_int32_t min   = omt->i.a.start_idx;
-    u_int32_t limit = omt->i.a.start_idx + omt->i.a.num_values;
-    u_int32_t best  = NODE_NULL;
+static inline int find_internal_minus_array(OMT omt, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, uint32_t *index) {
+    uint32_t min   = omt->i.a.start_idx;
+    uint32_t limit = omt->i.a.start_idx + omt->i.a.num_values;
+    uint32_t best  = NODE_NULL;
 
     while (min!=limit) {
-        u_int32_t mid = (min + limit) / 2;
+        uint32_t mid = (min + limit) / 2;
         int hv = h(omt->i.a.values[mid], extra);
         if (hv<0) {
             best = mid;
@@ -512,7 +512,7 @@ static inline int find_internal_minus_array(OMT omt, int (*h)(OMTVALUE, void*ext
 }
 
 //  If direction <0 then find the largest  i such that h(V_i,extra)<0.
-static inline int find_internal_minus(OMT omt, node_idx n_idx, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, u_int32_t *index)
+static inline int find_internal_minus(OMT omt, node_idx n_idx, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, uint32_t *index)
 // requires: index!=NULL
 {
     if (n_idx==NODE_NULL) return DB_NOTFOUND;
@@ -533,7 +533,7 @@ static inline int find_internal_minus(OMT omt, node_idx n_idx, int (*h)(OMTVALUE
 }
 
 //  If direction >0 then find the smallest i such that h(V_i,extra)>0.
-static inline int find_internal_plus(OMT omt, node_idx n_idx, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, u_int32_t *index)
+static inline int find_internal_plus(OMT omt, node_idx n_idx, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, uint32_t *index)
 // requires: index!=NULL
 {
     if (n_idx==NODE_NULL) return DB_NOTFOUND;
@@ -567,11 +567,11 @@ void toku_omt_destroy(OMT *omtp) {
     *omtp=NULL;
 }
 
-u_int32_t toku_omt_size(OMT V) {
+uint32_t toku_omt_size(OMT V) {
     return omt_size(V);
 }
 
-int toku_omt_create_from_sorted_array(OMT *omtp, OMTVALUE *values, u_int32_t numvalues) {
+int toku_omt_create_from_sorted_array(OMT *omtp, OMTVALUE *values, uint32_t numvalues) {
     OMT omt = NULL;
     int r;
     if ((r = omt_create_internal(&omt, numvalues))) return r;
@@ -581,7 +581,7 @@ int toku_omt_create_from_sorted_array(OMT *omtp, OMTVALUE *values, u_int32_t num
     return 0;
 }
 
-int toku_omt_insert_at(OMT omt, OMTVALUE value, u_int32_t index) {
+int toku_omt_insert_at(OMT omt, OMTVALUE value, uint32_t index) {
     int r;
     if (index>omt_size(omt)) return EINVAL;
     if ((r=maybe_resize_or_convert(omt, 1+omt_size(omt)))) return r;
@@ -606,7 +606,7 @@ int toku_omt_insert_at(OMT omt, OMTVALUE value, u_int32_t index) {
     return 0;
 }
 
-int toku_omt_set_at (OMT omt, OMTVALUE value, u_int32_t index) {
+int toku_omt_set_at (OMT omt, OMTVALUE value, uint32_t index) {
     if (index>=omt_size(omt)) return EINVAL;
     if (omt->is_array) {
         set_at_internal_array(omt, value, index);
@@ -617,7 +617,7 @@ int toku_omt_set_at (OMT omt, OMTVALUE value, u_int32_t index) {
     return 0;
 }
 
-int toku_omt_delete_at(OMT omt, u_int32_t index) {
+int toku_omt_delete_at(OMT omt, uint32_t index) {
     OMTVALUE v;
     int r;
     if (index>=omt_size(omt)) return EINVAL;
@@ -639,7 +639,7 @@ int toku_omt_delete_at(OMT omt, u_int32_t index) {
     return 0;
 }
 
-int toku_omt_fetch(OMT V, u_int32_t i, OMTVALUE *v) {
+int toku_omt_fetch(OMT V, uint32_t i, OMTVALUE *v) {
     if (i>=omt_size(V)) return EINVAL;
     if (V->is_array) {
         fetch_internal_array(V, i, v);
@@ -651,7 +651,7 @@ int toku_omt_fetch(OMT V, u_int32_t i, OMTVALUE *v) {
 }
 
 static int
-free_item (OMTVALUE lev, u_int32_t UU(idx), void *vsi) {
+free_item (OMTVALUE lev, uint32_t UU(idx), void *vsi) {
     assert(vsi == NULL);
     toku_free(lev);
     return 0;
@@ -663,14 +663,14 @@ void toku_omt_free_items(OMT omt) {
     lazy_assert_zero(r);
 }
 
-int toku_omt_iterate(OMT omt, int (*f)(OMTVALUE, u_int32_t, void*), void*v) {
+int toku_omt_iterate(OMT omt, int (*f)(OMTVALUE, uint32_t, void*), void*v) {
     if (omt->is_array) {
         return iterate_internal_array(omt, 0, omt_size(omt), f, v);
     }
     return iterate_internal(omt, 0, nweight(omt, omt->i.t.root), omt->i.t.root, 0, f, v);
 }
 
-int toku_omt_iterate_on_range(OMT omt, u_int32_t left, u_int32_t right, int (*f)(OMTVALUE, u_int32_t, void*), void*v) {
+int toku_omt_iterate_on_range(OMT omt, uint32_t left, uint32_t right, int (*f)(OMTVALUE, uint32_t, void*), void*v) {
     if (right>omt_size(omt)) return EINVAL;
     if (omt->is_array) {
         return iterate_internal_array(omt, left, right, f, v);
@@ -678,9 +678,9 @@ int toku_omt_iterate_on_range(OMT omt, u_int32_t left, u_int32_t right, int (*f)
     return iterate_internal(omt, left, right, omt->i.t.root, 0, f, v);
 }
 
-int toku_omt_insert(OMT omt, OMTVALUE value, int(*h)(OMTVALUE, void*v), void *v, u_int32_t *index) {
+int toku_omt_insert(OMT omt, OMTVALUE value, int(*h)(OMTVALUE, void*v), void *v, uint32_t *index) {
     int r;
-    u_int32_t idx;
+    uint32_t idx;
 
     r = toku_omt_find_zero(omt, h, v, NULL, &idx);
     if (r==0) {
@@ -695,8 +695,8 @@ int toku_omt_insert(OMT omt, OMTVALUE value, int(*h)(OMTVALUE, void*v), void *v,
     return 0;
 }
 
-int toku_omt_find_zero(OMT V, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, u_int32_t *index) {
-    u_int32_t tmp_index;
+int toku_omt_find_zero(OMT V, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, uint32_t *index) {
+    uint32_t tmp_index;
     if (index==NULL) index=&tmp_index;
     int r;
     if (V->is_array) {
@@ -708,8 +708,8 @@ int toku_omt_find_zero(OMT V, int (*h)(OMTVALUE, void*extra), void*extra, OMTVAL
     return r;
 }
 
-int toku_omt_find(OMT V, int (*h)(OMTVALUE, void*extra), void*extra, int direction, OMTVALUE *value, u_int32_t *index) {
-    u_int32_t tmp_index;
+int toku_omt_find(OMT V, int (*h)(OMTVALUE, void*extra), void*extra, int direction, OMTVALUE *value, uint32_t *index) {
+    uint32_t tmp_index;
     int r;
     if (index==NULL) index=&tmp_index;
     if (direction==0) {
@@ -732,13 +732,13 @@ int toku_omt_find(OMT V, int (*h)(OMTVALUE, void*extra), void*extra, int directi
     return r;
 }
 
-int toku_omt_split_at(OMT omt, OMT *newomtp, u_int32_t index) {
+int toku_omt_split_at(OMT omt, OMT *newomtp, uint32_t index) {
     int r;
     OMT newomt;
     if (index>omt_size(omt)) return EINVAL;
 
     if ((r=omt_convert_to_array(omt))) return r;
-    u_int32_t newsize = omt_size(omt)-index;
+    uint32_t newsize = omt_size(omt)-index;
     if ((r=toku_omt_create_from_sorted_array(&newomt,
                                    omt->i.a.values+omt->i.a.start_idx+index,
                                    newsize))) return r;
@@ -756,7 +756,7 @@ int toku_omt_split_at(OMT omt, OMT *newomtp, u_int32_t index) {
 int toku_omt_merge(OMT leftomt, OMT rightomt, OMT *newomtp) {
     int r;
     OMT newomt = 0;
-    u_int32_t newsize = omt_size(leftomt)+omt_size(rightomt);
+    uint32_t newsize = omt_size(leftomt)+omt_size(rightomt);
     if ((r = omt_create_internal(&newomt, newsize))) return r;
 
     if (leftomt->is_array) {
@@ -784,16 +784,16 @@ int toku_omt_merge(OMT leftomt, OMT rightomt, OMT *newomtp) {
 
 struct copy_data_extra {
     OMTVALUE *a;
-    u_int32_t eltsize;
+    uint32_t eltsize;
 };
 
-static int copy_data_iter(OMTVALUE v, u_int32_t idx, void *ve) {
+static int copy_data_iter(OMTVALUE v, uint32_t idx, void *ve) {
     struct copy_data_extra *CAST_FROM_VOIDP(e, ve);
     memcpy(e->a[idx], v, e->eltsize);
     return 0;
 }
 
-static int omt_copy_data(OMTVALUE *a, OMT omt, u_int32_t eltsize) {
+static int omt_copy_data(OMTVALUE *a, OMT omt, uint32_t eltsize) {
     struct copy_data_extra extra = { .a = a, .eltsize = eltsize };
     if (omt->is_array) {
         return iterate_internal_array(omt, 0, omt_size(omt), copy_data_iter, &extra);
@@ -801,14 +801,14 @@ static int omt_copy_data(OMTVALUE *a, OMT omt, u_int32_t eltsize) {
     return iterate_internal(omt, 0, nweight(omt, omt->i.t.root), omt->i.t.root, 0, copy_data_iter, &extra);
 }
 
-int toku_omt_clone(OMT *dest, OMT src, u_int32_t eltsize) {
-    u_int32_t size = omt_size(src);
+int toku_omt_clone(OMT *dest, OMT src, uint32_t eltsize) {
+    uint32_t size = omt_size(src);
     if (size == 0) {
         toku_omt_create(dest);
         return 0;
     }
     OMTVALUE *XMALLOC_N(size, a);
-    for (u_int32_t i = 0; i < size; ++i) {
+    for (uint32_t i = 0; i < size; ++i) {
         CAST_FROM_VOIDP(a[i], toku_xmalloc(eltsize));
     }
     int r = omt_copy_data(a, src, eltsize);
@@ -821,15 +821,15 @@ int toku_omt_clone(OMT *dest, OMT src, u_int32_t eltsize) {
     return r;
 }
 
-int toku_omt_clone_pool(OMT *dest, OMT src, u_int32_t eltsize) {
-    u_int32_t size = omt_size(src);
+int toku_omt_clone_pool(OMT *dest, OMT src, uint32_t eltsize) {
+    uint32_t size = omt_size(src);
     if (size == 0) {
         toku_omt_create(dest);
         return 0;
     }
     OMTVALUE *XMALLOC_N(size, a);
     unsigned char *XMALLOC_N(eltsize * size, data);
-    for (u_int32_t i = 0; i < size; ++i) {
+    for (uint32_t i = 0; i < size; ++i) {
         a[i] = &data[eltsize * i];
     }
     int r = omt_copy_data(a, src, eltsize);
@@ -855,7 +855,7 @@ void toku_omt_free_items_pool(OMT omt) {
 }
 
 int toku_omt_clone_noptr(OMT *dest, OMT src) {
-    u_int32_t size = omt_size(src);
+    uint32_t size = omt_size(src);
     if (size == 0) {
         toku_omt_create(dest);
         return 0;
diff --git a/ft/omt.h b/ft/omt.h
index 531a7fe468bdb8e21328dfd75d3de2586dfe7900..15332f42209deb56baabfd01cdeebe7c984ab6d9 100644
--- a/ft/omt.h
+++ b/ft/omt.h
@@ -69,7 +69,7 @@ int toku_omt_create (OMT *omtp);
 //   ENOMEM   out of memory (and doesn't modify *omtp)
 // Performance: constant time.
 
-int toku_omt_create_from_sorted_array(OMT *omtp, OMTVALUE *values, u_int32_t numvalues);
+int toku_omt_create_from_sorted_array(OMT *omtp, OMTVALUE *values, uint32_t numvalues);
 // Effect: Create a OMT containing values.  The number of values is in numvalues.
 //  Stores the new OMT in *omtp.
 // Requires: omtp != NULL
@@ -83,7 +83,7 @@ int toku_omt_create_from_sorted_array(OMT *omtp, OMTVALUE *values, u_int32_t num
 //               If the N values are known in advance, are sorted, and
 //               the structure is empty, we can batch insert them much faster.
 
-int toku_omt_create_steal_sorted_array(OMT *omtp, OMTVALUE **valuesp, u_int32_t numvalues, u_int32_t steal_capacity);
+int toku_omt_create_steal_sorted_array(OMT *omtp, OMTVALUE **valuesp, uint32_t numvalues, uint32_t steal_capacity);
 // Effect: Create an OMT containing values.  The number of values is in numvalues.
 //         On success the OMT takes ownership of *valuesp array, and sets valuesp=NULL.
 // Requires: omtp != NULL
@@ -115,12 +115,12 @@ void toku_omt_destroy(OMT *omtp);
 // Rationale: Does not free the OMTVALUEs to reduce complexity.
 // Performance:  time=O(toku_omt_size(*omtp))
 
-u_int32_t toku_omt_size(OMT V);
+uint32_t toku_omt_size(OMT V);
 // Effect: return |V|.
 // Requires: V != NULL
 // Performance:  time=O(1)
 
-int toku_omt_iterate_on_range(OMT omt, u_int32_t left, u_int32_t right, int (*f)(OMTVALUE, u_int32_t, void*), void*v);
+int toku_omt_iterate_on_range(OMT omt, uint32_t left, uint32_t right, int (*f)(OMTVALUE, uint32_t, void*), void*v);
 // Effect:  Iterate over the values of the omt, from left to right, calling f on each value.
 //  The second argument passed to f is the index of the value.
 //  The third argument passed to f is v.
@@ -144,7 +144,7 @@ void toku_omt_free_items(OMT omt);
 //   destroy the OMT. However, destroying the OMT requires invalidating cursors. This cannot be done if the values of the OMT
 //   have been already freed. So, this function is written to invalidate cursors and free items.
 
-int toku_omt_iterate(OMT omt, int (*f)(OMTVALUE, u_int32_t, void*), void*v);
+int toku_omt_iterate(OMT omt, int (*f)(OMTVALUE, uint32_t, void*), void*v);
 // Effect:  Iterate over the values of the omt, from left to right, calling f on each value.
 //  The second argument passed to f is the index of the value.
 //  The third argument passed to f is v.
@@ -158,7 +158,7 @@ int toku_omt_iterate(OMT omt, int (*f)(OMTVALUE, u_int32_t, void*), void*v);
 // Performance: time=O(i+\log N) where i is the number of times f is called, and N is the number of elements in omt.
 // Rational: Although the functional iterator requires defining another function (as opposed to C++ style iterator), it is much easier to read.
 
-int toku_omt_insert_at(OMT omt, OMTVALUE value, u_int32_t idx);
+int toku_omt_insert_at(OMT omt, OMTVALUE value, uint32_t idx);
 // Effect: Increases indexes of all items at slot >= index by 1.
 //         Insert value into the position at index.
 //
@@ -170,7 +170,7 @@ int toku_omt_insert_at(OMT omt, OMTVALUE value, u_int32_t idx);
 // Performance: time=O(\log N) amortized time.
 // Rationale: Some future implementation may be O(\log N) worst-case time, but O(\log N) amortized is good enough for now.
 
-int toku_omt_set_at (OMT omt, OMTVALUE value, u_int32_t idx);
+int toku_omt_set_at (OMT omt, OMTVALUE value, uint32_t idx);
 // Effect:  Replaces the item at index with value.
 // Returns:
 //   0       success
@@ -179,7 +179,7 @@ int toku_omt_set_at (OMT omt, OMTVALUE value, u_int32_t idx);
 // Performance: time=O(\log N)
 // Rationale: The BRT needs to be able to replace a value with another copy of the same value (allocated in a different location)
 
-int toku_omt_insert(OMT omt, OMTVALUE value, int(*h)(OMTVALUE, void*v), void *v, u_int32_t *idx);
+int toku_omt_insert(OMT omt, OMTVALUE value, int(*h)(OMTVALUE, void*v), void *v, uint32_t *idx);
 // Effect:  Insert value into the OMT.
 //   If there is some i such that $h(V_i, v)=0$ then returns DB_KEYEXIST.
 //   Otherwise, let i be the minimum value such that $h(V_i, v)>0$.
@@ -197,7 +197,7 @@ int toku_omt_insert(OMT omt, OMTVALUE value, int(*h)(OMTVALUE, void*v), void *v,
 // Performance: time=O(\log N) amortized.
 // Rationale: Some future implementation may be O(\log N) worst-case time, but O(\log N) amortized is good enough for now.
 
-int toku_omt_delete_at(OMT omt, u_int32_t idx);
+int toku_omt_delete_at(OMT omt, uint32_t idx);
 // Effect: Delete the item in slot index.
 //         Decreases indexes of all items at slot >= index by 1.
 // Returns
@@ -207,7 +207,7 @@ int toku_omt_delete_at(OMT omt, u_int32_t idx);
 // Rationale: To delete an item, first find its index using toku_omt_find, then delete it.
 // Performance: time=O(\log N) amortized.
 
-int toku_omt_fetch (OMT V, u_int32_t i, OMTVALUE *v);
+int toku_omt_fetch (OMT V, uint32_t i, OMTVALUE *v);
 // Effect: Set *v=V_i
 //   If c!=NULL then set c's abstract offset to i.
 // Requires: v   != NULL
@@ -222,14 +222,14 @@ int toku_omt_fetch (OMT V, u_int32_t i, OMTVALUE *v);
 //   function, the function must remove c's association with the old
 //   OMT, and associate it with the new OMT.
 
-int toku_omt_find_zero(OMT V, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, u_int32_t *idx);
+int toku_omt_find_zero(OMT V, int (*h)(OMTVALUE, void*extra), void*extra, OMTVALUE *value, uint32_t *idx);
 // Effect:  Find the smallest i such that h(V_i, extra)>=0
 //  If there is such an i and h(V_i,extra)==0 then set *index=i and return 0.
 //  If there is such an i and h(V_i,extra)>0  then set *index=i and return DB_NOTFOUND.
 //  If there is no such i then set *index=toku_omt_size(V) and return DB_NOTFOUND.
 // Requires: index!=NULL
 
-int toku_omt_find(OMT V, int (*h)(OMTVALUE, void*extra), void*extra, int direction, OMTVALUE *value, u_int32_t *idx);
+int toku_omt_find(OMT V, int (*h)(OMTVALUE, void*extra), void*extra, int direction, OMTVALUE *value, uint32_t *idx);
 //   Effect:
 //    If direction >0 then find the smallest i such that h(V_i,extra)>0.
 //    If direction <0 then find the largest  i such that h(V_i,extra)<0.
@@ -290,7 +290,7 @@ int toku_omt_find(OMT V, int (*h)(OMTVALUE, void*extra), void*extra, int directi
 //    -...-0...0+...+
 //        AC    B
 
-int toku_omt_split_at(OMT omt, OMT *newomt, u_int32_t idx);
+int toku_omt_split_at(OMT omt, OMT *newomt, uint32_t idx);
 // Effect: Create a new OMT, storing it in *newomt.
 //  The values to the right of index (starting at index) are moved to *newomt.
 // Requires: omt != NULL
@@ -313,7 +313,7 @@ int toku_omt_merge(OMT leftomt, OMT rightomt, OMT *newomt);
 // On error, nothing is modified.
 // Performance: time=O(n) is acceptable, but one can imagine implementations that are O(\log n) worst-case.
 
-int toku_omt_clone(OMT *dest, OMT src, u_int32_t eltsize);
+int toku_omt_clone(OMT *dest, OMT src, uint32_t eltsize);
 // Effect: Creates a copy of an omt.
 //  Sets *dest to the clone
 //  Each element is allocated separately with toku_xmalloc and is assumed to be eltsize big.
@@ -323,7 +323,7 @@ int toku_omt_clone(OMT *dest, OMT src, u_int32_t eltsize);
 // Performance: time between O(n) and O(n log n), depending how long it
 //  takes to traverse src.
 
-int toku_omt_clone_pool(OMT *dest, OMT src, u_int32_t eltsize);
+int toku_omt_clone_pool(OMT *dest, OMT src, uint32_t eltsize);
 // Effect: Creates a copy of an omt.
 //  Sets *dest to the clone
 //  Each element is copied to a contiguous buffer allocated with toku_xmalloc and each element is assumed to be eltsize big.
diff --git a/ft/queue.cc b/ft/queue.cc
index 2209da25c7e94f2aa8209cec6a47968be70ec984..1e78151232e770e5d1f9ed5e9cf43b7d85daebaf 100644
--- a/ft/queue.cc
+++ b/ft/queue.cc
@@ -17,15 +17,15 @@ struct qitem;
 struct qitem {
     void *item;
     struct qitem *next;
-    u_int64_t weight;
+    uint64_t weight;
 };
 
 struct queue {
-    u_int64_t contents_weight; // how much stuff is in there?
-    u_int64_t weight_limit;    // Block enqueueing when the contents gets to be bigger than the weight.
+    uint64_t contents_weight; // how much stuff is in there?
+    uint64_t weight_limit;    // Block enqueueing when the contents gets to be bigger than the weight.
     struct qitem *head, *tail;
 
-    BOOL eof;
+    bool eof;
 
     toku_mutex_t mutex;
     toku_cond_t  cond;
@@ -43,7 +43,7 @@ struct queue {
 //   q->mutex and q->cond are used as condition variables.
 
 
-int queue_create (QUEUE *q, u_int64_t weight_limit)
+int queue_create (QUEUE *q, uint64_t weight_limit)
 {
     QUEUE MALLOC(result);
     if (result==NULL) return get_error_errno();
@@ -51,7 +51,7 @@ int queue_create (QUEUE *q, u_int64_t weight_limit)
     result->weight_limit    = weight_limit;
     result->head            = NULL;
     result->tail            = NULL;
-    result->eof             = FALSE;
+    result->eof             = false;
     toku_mutex_init(&result->mutex, NULL);
     toku_cond_init(&result->cond, NULL);
     *q = result;
@@ -68,7 +68,7 @@ int queue_destroy (QUEUE q)
     return 0;
 }
 
-int queue_enq (QUEUE q, void *item, u_int64_t weight, u_int64_t *total_weight_after_enq)
+int queue_enq (QUEUE q, void *item, uint64_t weight, uint64_t *total_weight_after_enq)
 {
     toku_mutex_lock(&q->mutex);
     assert(!q->eof);
@@ -108,13 +108,13 @@ int queue_eof (QUEUE q)
 {
     toku_mutex_lock(&q->mutex);
     assert(!q->eof);
-    q->eof = TRUE;
+    q->eof = true;
     toku_cond_signal(&q->cond);
     toku_mutex_unlock(&q->mutex);
     return 0;
 }
 
-int queue_deq (QUEUE q, void **item, u_int64_t *weight, u_int64_t *total_weight_after_deq)
+int queue_deq (QUEUE q, void **item, uint64_t *weight, uint64_t *total_weight_after_deq)
 {
     toku_mutex_lock(&q->mutex);
     int result;
diff --git a/ft/queue.h b/ft/queue.h
index 3b9d408edbcac9673b77b9d03695c9f9671a9c06..5644d6d47a98a057e0078274cd6550c9144765b9 100644
--- a/ft/queue.h
+++ b/ft/queue.h
@@ -25,10 +25,10 @@
 
 typedef struct queue *QUEUE;
 
-int queue_create (QUEUE *q, u_int64_t weight_limit);
+int queue_create (QUEUE *q, uint64_t weight_limit);
 // Effect: Create a queue with a given weight limit.  The queue is initially empty.
 
-int queue_enq (QUEUE q, void *item, u_int64_t weight, u_int64_t *total_weight_after_enq);
+int queue_enq (QUEUE q, void *item, uint64_t weight, uint64_t *total_weight_after_enq);
 // Effect: Insert ITEM of weight WEIGHT into queue.  If the resulting contents weight too much then block (don't return) until the total weight is low enough.
 // If total_weight_after_enq!=NULL then return the current weight of the items in the queue (after finishing blocking on overweight, and after enqueueing the item).
 // If successful return 0.
@@ -39,7 +39,7 @@ int queue_eof (QUEUE q);
 // Effect: Inform the queue that no more values will be inserted.  After all the values that have been inserted are dequeued, further dequeue operations will return EOF.
 // Returns 0 on success.   On failure, things are pretty bad (likely to be some sort of mutex failure).
 
-int queue_deq (QUEUE q, void **item, u_int64_t *weight, u_int64_t *total_weight_after_deq);
+int queue_deq (QUEUE q, void **item, uint64_t *weight, uint64_t *total_weight_after_deq);
 // Effect: Wait until the queue becomes nonempty.  Then dequeue and return the oldest item.  The item and its weight are returned in *ITEM.
 // If weight!=NULL then return the item's weight in *weight.
 // If total_weight_after_deq!=NULL then return the current weight of the items in the queue (after dequeuing the item).
diff --git a/ft/rbuf.h b/ft/rbuf.h
index 630bc5d2ad59a43b087fb50a585c80b7dcb52495..baf9cefcfb64e011ddff476096beb449edacd301 100644
--- a/ft/rbuf.h
+++ b/ft/rbuf.h
@@ -37,12 +37,12 @@ static inline unsigned char rbuf_char (struct rbuf *r) {
     return r->buf[r->ndone++];
 }
 
-static inline void rbuf_ma_u_int8_t (struct rbuf *r, MEMARENA ma __attribute__((__unused__)), u_int8_t *num) {
+static inline void rbuf_ma_uint8_t (struct rbuf *r, MEMARENA ma __attribute__((__unused__)), uint8_t *num) {
     *num = rbuf_char(r);
 }
 
-static inline void rbuf_ma_BOOL (struct rbuf *r, MEMARENA ma __attribute__((__unused__)), BOOL *b) {
-    u_int8_t n = rbuf_char(r);
+static inline void rbuf_ma_bool (struct rbuf *r, MEMARENA ma __attribute__((__unused__)), bool *b) {
+    uint8_t n = rbuf_char(r);
     *b = (n!=0);
 }
 
@@ -50,7 +50,7 @@ static inline void rbuf_ma_BOOL (struct rbuf *r, MEMARENA ma __attribute__((__un
 static unsigned int rbuf_network_int (struct rbuf *r) __attribute__((__unused__));
 static unsigned int rbuf_network_int (struct rbuf *r) {
     assert(r->ndone+4 <= r->size);
-    u_int32_t result = toku_ntohl(*(u_int32_t*)(r->buf+r->ndone)); // This only works on machines where unaligned loads are OK.
+    uint32_t result = toku_ntohl(*(uint32_t*)(r->buf+r->ndone)); // This only works on machines where unaligned loads are OK.
     r->ndone+=4;
     return result;
 }
@@ -58,7 +58,7 @@ static unsigned int rbuf_network_int (struct rbuf *r) {
 static unsigned int rbuf_int (struct rbuf *r) {
 #if 1
     assert(r->ndone+4 <= r->size);
-    u_int32_t result = toku_dtoh32(*(u_int32_t*)(r->buf+r->ndone)); // This only works on machines where unaligned loads are OK.
+    uint32_t result = toku_dtoh32(*(uint32_t*)(r->buf+r->ndone)); // This only works on machines where unaligned loads are OK.
     r->ndone+=4;
     return result;
 #else
@@ -118,11 +118,11 @@ static inline void rbuf_ma_BLOCKNUM (struct rbuf *r, MEMARENA ma __attribute__((
     *blocknum = rbuf_blocknum(r);
 }
 
-static inline void rbuf_ma_u_int32_t (struct rbuf *r, MEMARENA ma __attribute__((__unused__)), u_int32_t *num) {
+static inline void rbuf_ma_uint32_t (struct rbuf *r, MEMARENA ma __attribute__((__unused__)), uint32_t *num) {
     *num = rbuf_int(r);
 }
 
-static inline void rbuf_ma_u_int64_t (struct rbuf *r, MEMARENA ma __attribute__((__unused__)), u_int64_t *num) {
+static inline void rbuf_ma_uint64_t (struct rbuf *r, MEMARENA ma __attribute__((__unused__)), uint64_t *num) {
     *num = rbuf_ulonglong(r);
 }
 
@@ -147,17 +147,17 @@ static inline void rbuf_FILENUMS(struct rbuf *r, FILENUMS *filenums) {
     filenums->num = rbuf_int(r);
     filenums->filenums = (FILENUM *) toku_malloc( filenums->num * sizeof(FILENUM) );
     assert(filenums->filenums != NULL);
-    for (u_int32_t i=0; i < filenums->num; i++) {
+    for (uint32_t i=0; i < filenums->num; i++) {
         rbuf_FILENUM(r, &(filenums->filenums[i]));
     }
 }
 
 // 2954
 static inline void rbuf_ma_FILENUMS (struct rbuf *r, MEMARENA ma __attribute__((__unused__)), FILENUMS *filenums) {
-    rbuf_ma_u_int32_t(r, ma, &(filenums->num));
+    rbuf_ma_uint32_t(r, ma, &(filenums->num));
     filenums->filenums = (FILENUM *) malloc_in_memarena(ma, filenums->num * sizeof(FILENUM) );
     assert(filenums->filenums != NULL);
-    for (u_int32_t i=0; i < filenums->num; i++) {
+    for (uint32_t i=0; i < filenums->num; i++) {
         rbuf_ma_FILENUM(r, ma, &(filenums->filenums[i]));
     }
 }
@@ -165,7 +165,7 @@ static inline void rbuf_ma_FILENUMS (struct rbuf *r, MEMARENA ma __attribute__((
 // Don't try to use the same space, malloc it
 static inline void rbuf_BYTESTRING (struct rbuf *r, BYTESTRING *bs) {
     bs->len  = rbuf_int(r);
-    u_int32_t newndone = r->ndone + bs->len;
+    uint32_t newndone = r->ndone + bs->len;
     assert(newndone <= r->size);
     bs->data = (char *) toku_memdup(&r->buf[r->ndone], (size_t)bs->len);
     assert(bs->data);
@@ -174,7 +174,7 @@ static inline void rbuf_BYTESTRING (struct rbuf *r, BYTESTRING *bs) {
 
 static inline void rbuf_ma_BYTESTRING  (struct rbuf *r, MEMARENA ma, BYTESTRING *bs) {
     bs->len  = rbuf_int(r);
-    u_int32_t newndone = r->ndone + bs->len;
+    uint32_t newndone = r->ndone + bs->len;
     assert(newndone <= r->size);
     bs->data = (char *) memarena_memdup(ma, &r->buf[r->ndone], (size_t)bs->len);
     assert(bs->data);
diff --git a/ft/recover.cc b/ft/recover.cc
index 49c8db09acbf94667c48dfff36f0ba41df5f82f0..afb11ed4c604323c4f3b7d48637a8ab3e65ad926 100644
--- a/ft/recover.cc
+++ b/ft/recover.cc
@@ -15,7 +15,7 @@ int tokudb_recovery_trace = 0;                    // turn on recovery tracing, d
 
 //#define DO_VERIFY_COUNTS
 #ifdef DO_VERIFY_COUNTS
-#define VERIFY_COUNTS(n) toku_verify_or_set_counts(n, FALSE)
+#define VERIFY_COUNTS(n) toku_verify_or_set_counts(n, false)
 #else
 #define VERIFY_COUNTS(n) ((void)0)
 #endif
@@ -102,7 +102,7 @@ struct recover_env {
     generate_row_for_del_func generate_row_for_del;
     struct scan_state ss;
     struct file_map fmap;
-    BOOL goforward;
+    bool goforward;
     bool destroy_logger_at_end; // If true then destroy the logger when we are done.  If false then set the logger into write-files mode when we are done with recovery.*/
 };
 typedef struct recover_env *RECOVER_ENV;
@@ -121,11 +121,11 @@ static uint32_t file_map_get_num_dictionaries(struct file_map *fmap) {
     return toku_omt_size(fmap->filenums);
 }
 
-static void file_map_close_dictionaries(struct file_map *fmap, BOOL recovery_succeeded, LSN oplsn) {
+static void file_map_close_dictionaries(struct file_map *fmap, bool recovery_succeeded, LSN oplsn) {
     int r;
 
     while (1) {
-        u_int32_t n = toku_omt_size(fmap->filenums);
+        uint32_t n = toku_omt_size(fmap->filenums);
         if (n == 0)
             break;
         OMTVALUE v;
@@ -167,7 +167,7 @@ static int file_map_insert (struct file_map *fmap, FILENUM fnum, FT_HANDLE brt,
 }
 
 static void file_map_remove(struct file_map *fmap, FILENUM fnum) {
-    OMTVALUE v; u_int32_t idx;
+    OMTVALUE v; uint32_t idx;
     int r = toku_omt_find_zero(fmap->filenums, file_map_h, &fnum, &v, &idx);
     if (r == 0) {
         struct file_map_tuple *CAST_FROM_VOIDP(tuple, v);
@@ -179,7 +179,7 @@ static void file_map_remove(struct file_map *fmap, FILENUM fnum) {
 
 // Look up file info: given FILENUM, return file_map_tuple (or DB_NOTFOUND)
 static int file_map_find(struct file_map *fmap, FILENUM fnum, struct file_map_tuple **file_map_tuple) {
-    OMTVALUE v; u_int32_t idx;
+    OMTVALUE v; uint32_t idx;
     int r = toku_omt_find_zero(fmap->filenums, file_map_h, &fnum, &v, &idx);
     if (r == 0) {
         struct file_map_tuple *CAST_FROM_VOIDP(tuple, v);
@@ -211,7 +211,7 @@ static int recover_env_init (RECOVER_ENV renv,
         r = toku_logger_create(&renv->logger);
         assert(r == 0);
     }
-    toku_logger_write_log_files(renv->logger, FALSE);
+    toku_logger_write_log_files(renv->logger, false);
     r = toku_create_cachetable(&renv->ct, cachetable_size ? cachetable_size : 1<<25, (LSN){0}, renv->logger);
     assert(r == 0);
     toku_cachetable_set_env_dir(renv->ct, env_dir);
@@ -225,7 +225,7 @@ static int recover_env_init (RECOVER_ENV renv,
     renv->generate_row_for_put     = generate_row_for_put;
     renv->generate_row_for_del     = generate_row_for_del;
     file_map_init(&renv->fmap);
-    renv->goforward = FALSE;
+    renv->goforward = false;
 
     if (tokudb_recovery_trace)
         fprintf(stderr, "%s:%d\n", __FUNCTION__, __LINE__);
@@ -264,7 +264,7 @@ static const char *recover_state(RECOVER_ENV renv) {
 }
 
 // Open the file if it is not already open.  If it is already open, then do nothing.
-static int internal_recover_fopen_or_fcreate (RECOVER_ENV renv, BOOL must_create, int UU(mode), BYTESTRING *bs_iname, FILENUM filenum, u_int32_t treeflags,
+static int internal_recover_fopen_or_fcreate (RECOVER_ENV renv, bool must_create, int UU(mode), BYTESTRING *bs_iname, FILENUM filenum, uint32_t treeflags,
                                               TOKUTXN txn, uint32_t nodesize, uint32_t basementnodesize, enum toku_compression_method compression_method, LSN max_acceptable_lsn) {
     int r;
     FT_HANDLE brt = NULL;
@@ -359,7 +359,7 @@ static int toku_recover_backward_begin_checkpoint (struct logtype_begin_checkpoi
         assert(l->lsn.lsn == renv->ss.checkpoint_begin_lsn.lsn);
         renv->ss.ss = FORWARD_BETWEEN_CHECKPOINT_BEGIN_END;
         renv->ss.checkpoint_begin_timestamp = l->timestamp;
-        renv->goforward = TRUE;
+        renv->goforward = true;
         tnow = time(NULL);
         fprintf(stderr, "%.24s Tokudb recovery turning around at begin checkpoint %" PRIu64 " time %" PRIu64 "\n", 
                 ctime(&tnow), l->lsn.lsn, 
@@ -427,7 +427,7 @@ static int toku_recover_fassociate (struct logtype_fassociate *l, RECOVER_ENV re
         // If rollback file, specify which checkpointed version of file we need (not just the latest)
         // because we cannot use a rollback log that is later than the last complete checkpoint.  See #3113.
         {
-            BOOL rollback_file = (0==strcmp(fname, ROLLBACK_CACHEFILE_NAME));
+            bool rollback_file = (0==strcmp(fname, ROLLBACK_CACHEFILE_NAME));
             LSN max_acceptable_lsn = MAX_LSN;
             if (rollback_file) {
                 max_acceptable_lsn = renv->ss.checkpoint_begin_lsn;
@@ -437,7 +437,7 @@ static int toku_recover_fassociate (struct logtype_fassociate *l, RECOVER_ENV re
                 r = toku_ft_handle_open_recovery(t, ROLLBACK_CACHEFILE_NAME, false, false, renv->ct, (TOKUTXN)NULL, l->filenum, max_acceptable_lsn);
                 renv->logger->rollback_cachefile = t->ft->cf;
             } else {
-                r = internal_recover_fopen_or_fcreate(renv, FALSE, 0, &l->iname, l->filenum, l->treeflags, NULL, 0, 0, TOKU_DEFAULT_COMPRESSION_METHOD, max_acceptable_lsn);
+                r = internal_recover_fopen_or_fcreate(renv, false, 0, &l->iname, l->filenum, l->treeflags, NULL, 0, 0, TOKU_DEFAULT_COMPRESSION_METHOD, max_acceptable_lsn);
                 assert(r==0);
             }
         }
@@ -503,16 +503,16 @@ static int recover_xstillopen_internal (TOKUTXN         *txnp,
                                         LSN           UU(lsn),
                                         TXNID            xid,
                                         TXNID            parentxid,
-                                        u_int64_t        rollentry_raw_count,
+                                        uint64_t        rollentry_raw_count,
                                         FILENUMS         open_filenums,
                                         bool             force_fsync_on_commit,
-                                        u_int64_t        num_rollback_nodes,
-                                        u_int64_t        num_rollentries,
+                                        uint64_t        num_rollback_nodes,
+                                        uint64_t        num_rollentries,
                                         BLOCKNUM         spilled_rollback_head,
                                         BLOCKNUM         spilled_rollback_tail,
                                         BLOCKNUM         current_rollback,
-                                        u_int32_t     UU(crc),
-                                        u_int32_t     UU(len),
+                                        uint32_t     UU(crc),
+                                        uint32_t     UU(len),
                                         RECOVER_ENV      renv) {
     int r;
     *txnp = NULL;
@@ -685,7 +685,7 @@ static int toku_recover_xcommit (struct logtype_xcommit *l, RECOVER_ENV renv) {
     assert(txn!=NULL);
 
     // commit the transaction
-    r = toku_txn_commit_with_lsn(txn, TRUE, l->lsn,
+    r = toku_txn_commit_with_lsn(txn, true, l->lsn,
                                  NULL, NULL);
     assert(r == 0);
 
@@ -778,7 +778,7 @@ static int toku_recover_fcreate (struct logtype_fcreate *l, RECOVER_ENV renv) {
     toku_free(iname_in_cwd);
     toku_free(iname);
 
-    BOOL must_create = TRUE;
+    bool must_create = true;
     r = internal_recover_fopen_or_fcreate(renv, must_create, l->mode, &l->iname, l->filenum, l->treeflags, txn, l->nodesize, l->basementnodesize, (enum toku_compression_method) l->compression_method, MAX_LSN);
     return r;
 }
@@ -798,7 +798,7 @@ static int toku_recover_fopen (struct logtype_fopen *l, RECOVER_ENV renv) {
     r = file_map_find(&renv->fmap, l->filenum, &tuple);
     assert(r==DB_NOTFOUND);
 
-    BOOL must_create = FALSE;
+    bool must_create = false;
     TOKUTXN txn = NULL;
     char *fname = fixup_fname(&l->iname);
 
@@ -838,7 +838,7 @@ static int toku_recover_change_fdescriptor (struct logtype_change_fdescriptor *l
             tuple->ft_handle, 
             &old_descriptor, 
             &new_descriptor, 
-            FALSE, 
+            false, 
             txn,
             l->update_cmp_descriptor
             );
@@ -912,7 +912,7 @@ static int toku_recover_enq_insert (struct logtype_enq_insert *l, RECOVER_ENV re
         DBT keydbt, valdbt;
         toku_fill_dbt(&keydbt, l->key.data, l->key.len);
         toku_fill_dbt(&valdbt, l->value.data, l->value.len);
-        r = toku_ft_maybe_insert(tuple->ft_handle, &keydbt, &valdbt, txn, TRUE, l->lsn, FALSE, FT_INSERT);
+        r = toku_ft_maybe_insert(tuple->ft_handle, &keydbt, &valdbt, txn, true, l->lsn, false, FT_INSERT);
         assert(r == 0);
         toku_txn_maybe_note_ft(txn, tuple->ft_handle->ft);
     }
@@ -937,7 +937,7 @@ static int toku_recover_enq_insert_no_overwrite (struct logtype_enq_insert_no_ov
         DBT keydbt, valdbt;
         toku_fill_dbt(&keydbt, l->key.data, l->key.len);
         toku_fill_dbt(&valdbt, l->value.data, l->value.len);
-        r = toku_ft_maybe_insert(tuple->ft_handle, &keydbt, &valdbt, txn, TRUE, l->lsn, FALSE, FT_INSERT_NO_OVERWRITE);
+        r = toku_ft_maybe_insert(tuple->ft_handle, &keydbt, &valdbt, txn, true, l->lsn, false, FT_INSERT_NO_OVERWRITE);
         assert(r == 0);
     }    
     return 0;
@@ -960,7 +960,7 @@ static int toku_recover_enq_delete_any (struct logtype_enq_delete_any *l, RECOVE
         //Maybe do the deletion if we found the cachefile.
         DBT keydbt;
         toku_fill_dbt(&keydbt, l->key.data, l->key.len);
-        r = toku_ft_maybe_delete(tuple->ft_handle, &keydbt, txn, TRUE, l->lsn, FALSE);
+        r = toku_ft_maybe_delete(tuple->ft_handle, &keydbt, txn, true, l->lsn, false);
         assert(r == 0);
     }    
     return 0;
@@ -978,7 +978,7 @@ static int toku_recover_enq_insert_multiple (struct logtype_enq_insert_multiple
     assert(r == 0);
     assert(txn!=NULL);
     DB *src_db = NULL;
-    BOOL do_inserts = TRUE;
+    bool do_inserts = true;
     {
         struct file_map_tuple *tuple = NULL;
         r = file_map_find(&renv->fmap, l->src_filenum, &tuple);
@@ -988,7 +988,7 @@ static int toku_recover_enq_insert_multiple (struct logtype_enq_insert_multiple
             if (r == 0)
                 src_db = &tuple->fake_db;
             else
-                do_inserts = FALSE; // src file was probably deleted, #3129
+                do_inserts = false; // src file was probably deleted, #3129
         }
     }
     
@@ -1007,7 +1007,7 @@ static int toku_recover_enq_insert_multiple (struct logtype_enq_insert_multiple
                 DB *db = &tuple->fake_db;
                 r = renv->generate_row_for_put(db, src_db, &dest_key, &dest_val, &src_key, &src_val);
                 assert(r==0);
-                r = toku_ft_maybe_insert(tuple->ft_handle, &dest_key, &dest_val, txn, TRUE, l->lsn, FALSE, FT_INSERT);
+                r = toku_ft_maybe_insert(tuple->ft_handle, &dest_key, &dest_val, txn, true, l->lsn, false, FT_INSERT);
                 assert(r == 0);
 
                 //flags==0 means generate_row_for_put callback changed it
@@ -1040,7 +1040,7 @@ static int toku_recover_enq_delete_multiple (struct logtype_enq_delete_multiple
     assert(r == 0);
     assert(txn!=NULL);
     DB *src_db = NULL;
-    BOOL do_deletes = TRUE;
+    bool do_deletes = true;
     {
         struct file_map_tuple *tuple = NULL;
         r = file_map_find(&renv->fmap, l->src_filenum, &tuple);
@@ -1050,7 +1050,7 @@ static int toku_recover_enq_delete_multiple (struct logtype_enq_delete_multiple
             if (r == 0)
                 src_db = &tuple->fake_db;
             else
-                do_deletes = FALSE; // src file was probably deleted, #3129
+                do_deletes = false; // src file was probably deleted, #3129
         }
     }
 
@@ -1068,7 +1068,7 @@ static int toku_recover_enq_delete_multiple (struct logtype_enq_delete_multiple
                 DB *db = &tuple->fake_db;
                 r = renv->generate_row_for_del(db, src_db, &dest_key, &src_key, &src_val);
                 assert(r==0);
-                r = toku_ft_maybe_delete(tuple->ft_handle, &dest_key, txn, TRUE, l->lsn, FALSE);
+                r = toku_ft_maybe_delete(tuple->ft_handle, &dest_key, txn, true, l->lsn, false);
                 assert(r == 0);
 
                 //flags==0 indicates the return values are stored in temporary memory that does
@@ -1102,8 +1102,8 @@ static int toku_recover_enq_update(struct logtype_enq_update *l, RECOVER_ENV ren
         DBT key, extra;
         toku_fill_dbt(&key, l->key.data, l->key.len);
         toku_fill_dbt(&extra, l->extra.data, l->extra.len);
-        r = toku_ft_maybe_update(tuple->ft_handle, &key, &extra, txn, TRUE, l->lsn,
-                                  FALSE);
+        r = toku_ft_maybe_update(tuple->ft_handle, &key, &extra, txn, true, l->lsn,
+                                  false);
         assert(r == 0);
     }
     return 0;
@@ -1121,8 +1121,8 @@ static int toku_recover_enq_updatebroadcast(struct logtype_enq_updatebroadcast *
         // Maybe do the update broadcast if we found the cachefile.
         DBT extra;
         toku_fill_dbt(&extra, l->extra.data, l->extra.len);
-        r = toku_ft_maybe_update_broadcast(tuple->ft_handle, &extra, txn, TRUE,
-                                            l->lsn, FALSE, l->is_resetting_op);
+        r = toku_ft_maybe_update_broadcast(tuple->ft_handle, &extra, txn, true,
+                                            l->lsn, false, l->is_resetting_op);
         assert(r == 0);
     }
     return 0;
@@ -1210,15 +1210,15 @@ static int toku_recover_backward_hot_index(struct logtype_hot_index *UU(l), RECO
 
 // Effects: If there are no log files, or if there is a clean "shutdown" at
 // the end of the log, then we don't need recovery to run.
-// Returns: TRUE if we need recovery, otherwise FALSE.
-int tokudb_needs_recovery(const char *log_dir, BOOL ignore_log_empty) {
+// Returns: true if we need recovery, otherwise false.
+int tokudb_needs_recovery(const char *log_dir, bool ignore_log_empty) {
     int needs_recovery;
     int r;
     TOKULOGCURSOR logcursor = NULL;
 
     r = toku_logcursor_create(&logcursor, log_dir);
     if (r != 0) {
-        needs_recovery = TRUE; goto exit;
+        needs_recovery = true; goto exit;
     }
     
     struct log_entry *le;
@@ -1499,12 +1499,12 @@ static int do_recovery(RECOVER_ENV renv, const char *env_dir, const char *log_di
         tnow = time(NULL);
         fprintf(stderr, "%.24s Tokudb recovery closing %" PRIu32 " dictionar%s\n", ctime(&tnow), n, n > 1 ? "ies" : "y");
     }
-    file_map_close_dictionaries(&renv->fmap, TRUE, lastlsn);
+    file_map_close_dictionaries(&renv->fmap, true, lastlsn);
 
     {
         // write a recovery log entry
         BYTESTRING recover_comment = { strlen("recover"), (char *) "recover" };
-        r = toku_log_comment(renv->logger, NULL, TRUE, 0, recover_comment);
+        r = toku_log_comment(renv->logger, NULL, true, 0, recover_comment);
         assert(r == 0);
     }
 
@@ -1577,7 +1577,7 @@ int tokudb_recover(DB_ENV *env,
         return r;
 
     int rr = 0;
-    if (tokudb_needs_recovery(log_dir, FALSE)) {
+    if (tokudb_needs_recovery(log_dir, false)) {
         struct recover_env renv;
         r = recover_env_init(&renv,
                              env_dir,
@@ -1594,7 +1594,7 @@ int tokudb_recover(DB_ENV *env,
 
         rr = do_recovery(&renv, env_dir, log_dir);
 
-        recover_env_cleanup(&renv, (BOOL)(rr == 0));
+        recover_env_cleanup(&renv, (bool)(rr == 0));
     }
 
     r = toku_recover_unlock(lockfd);
diff --git a/ft/recover.h b/ft/recover.h
index c800aa1155c7935752844c7df73d50f3260bf712..d65cec734861bbafe40036e2a22a3b460859ca6c 100644
--- a/ft/recover.h
+++ b/ft/recover.h
@@ -35,8 +35,8 @@ int tokudb_recover (DB_ENV *env,
 // Effect: Check the tokudb logs to determine whether or not we need to run recovery.
 // If the log is empty or if there is a clean shutdown at the end of the log, then we
 // dont need to run recovery.
-// Returns: TRUE if we need recovery, otherwise FALSE.
-int tokudb_needs_recovery(const char *logdir, BOOL ignore_empty_log);
+// Returns: true if we need recovery, otherwise false.
+int tokudb_needs_recovery(const char *logdir, bool ignore_empty_log);
 
 // Return 0 if recovery log exists, ENOENT if log is missing
 int tokudb_recover_log_exists(const char * log_dir);
diff --git a/ft/roll.cc b/ft/roll.cc
index e851dd7ad7455d509d61395c127ace2dcc426e8d..4df42e8c4581bdb7f2bacef7c68bfd11ee807403 100644
--- a/ft/roll.cc
+++ b/ft/roll.cc
@@ -157,12 +157,12 @@ static int find_ft_from_filenum (OMTVALUE v, void *filenumvp) {
     return 0;
 }
 
-// Input arg reset_root_xid_that_created TRUE means that this operation has changed the definition of this dictionary.
+// Input arg reset_root_xid_that_created true means that this operation has changed the definition of this dictionary.
 // (Example use is for schema change committed with txn that inserted cmdupdatebroadcast message.)
 // The oplsn argument is ZERO_LSN for normal operation.  When this function is called for recovery, it has the LSN of
 // the operation (insert, delete, update, etc).
 static int do_insertion (enum ft_msg_type type, FILENUM filenum, BYTESTRING key, BYTESTRING *data, TOKUTXN txn, LSN oplsn,
-                         BOOL reset_root_xid_that_created) {
+                         bool reset_root_xid_that_created) {
     CACHEFILE cf;
     // 2954 - ignore messages for aborted hot-index
     int r = 0;
@@ -220,7 +220,7 @@ static int do_nothing_with_filenum(TOKUTXN UU(txn), FILENUM UU(filenum)) {
 
 int toku_commit_cmdinsert (FILENUM filenum, BYTESTRING UU(key), TOKUTXN txn, LSN UU(oplsn)) {
 #if TOKU_DO_COMMIT_CMD_INSERT
-    return do_insertion (FT_COMMIT_ANY, filenum, key, 0, txn, oplsn, FALSE);
+    return do_insertion (FT_COMMIT_ANY, filenum, key, 0, txn, oplsn, false);
 #else
     return do_nothing_with_filenum(txn, filenum);
 #endif
@@ -232,7 +232,7 @@ toku_rollback_cmdinsert (FILENUM    filenum,
                          TOKUTXN    txn,
                          LSN        oplsn)
 {
-    return do_insertion (FT_ABORT_ANY, filenum, key, 0, txn, oplsn, FALSE);
+    return do_insertion (FT_ABORT_ANY, filenum, key, 0, txn, oplsn, false);
 }
 
 int
@@ -241,7 +241,7 @@ toku_commit_cmdupdate(FILENUM    filenum,
                       TOKUTXN    txn,
                       LSN        oplsn)
 {
-    return do_insertion(FT_COMMIT_ANY, filenum, key, 0, txn, oplsn, FALSE);
+    return do_insertion(FT_COMMIT_ANY, filenum, key, 0, txn, oplsn, false);
 }
 
 int
@@ -250,18 +250,18 @@ toku_rollback_cmdupdate(FILENUM    filenum,
                         TOKUTXN    txn,
                         LSN        oplsn)
 {
-    return do_insertion(FT_ABORT_ANY, filenum, key, 0, txn, oplsn, FALSE);
+    return do_insertion(FT_ABORT_ANY, filenum, key, 0, txn, oplsn, false);
 }
 
 int
 toku_commit_cmdupdatebroadcast(FILENUM    filenum,
-                               BOOL       is_resetting_op,
+                               bool       is_resetting_op,
                                TOKUTXN    txn,
                                LSN        oplsn)
 {
     // if is_resetting_op, reset root_xid_that_created in
     // relevant ft.
-    BOOL reset_root_xid_that_created = (is_resetting_op ? TRUE : FALSE);
+    bool reset_root_xid_that_created = (is_resetting_op ? true : false);
     const enum ft_msg_type msg_type = (is_resetting_op
                                         ? FT_COMMIT_BROADCAST_ALL
                                         : FT_COMMIT_BROADCAST_TXN);
@@ -271,12 +271,12 @@ toku_commit_cmdupdatebroadcast(FILENUM    filenum,
 
 int
 toku_rollback_cmdupdatebroadcast(FILENUM    filenum,
-                                 BOOL       UU(is_resetting_op),
+                                 bool       UU(is_resetting_op),
                                  TOKUTXN    txn,
                                  LSN        oplsn)
 {
     BYTESTRING nullkey = { 0, NULL };
-    return do_insertion(FT_ABORT_BROADCAST_TXN, filenum, nullkey, 0, txn, oplsn, FALSE);
+    return do_insertion(FT_ABORT_BROADCAST_TXN, filenum, nullkey, 0, txn, oplsn, false);
 }
 
 int
@@ -286,7 +286,7 @@ toku_commit_cmddelete (FILENUM    filenum,
                        LSN        oplsn)
 {
 #if TOKU_DO_COMMIT_CMD_DELETE
-    return do_insertion (FT_COMMIT_ANY, filenum, key, 0, txn, oplsn, FALSE);
+    return do_insertion (FT_COMMIT_ANY, filenum, key, 0, txn, oplsn, false);
 #else
     key = key; oplsn = oplsn;
     return do_nothing_with_filenum(txn, filenum);
@@ -299,7 +299,7 @@ toku_rollback_cmddelete (FILENUM    filenum,
                          TOKUTXN    txn,
                          LSN        oplsn)
 {
-    return do_insertion (FT_ABORT_ANY, filenum, key, 0, txn, oplsn, FALSE);
+    return do_insertion (FT_ABORT_ANY, filenum, key, 0, txn, oplsn, false);
 }
 
 static int
@@ -319,7 +319,7 @@ toku_apply_rollinclude (TXNID      xid,
     uint32_t next_log_hash = spilled_tail_hash;
     uint64_t last_sequence = num_nodes;
 
-    BOOL found_head = FALSE;
+    bool found_head = false;
     assert(next_log.b != ROLLBACK_NONE.b);
     while (next_log.b != ROLLBACK_NONE.b) {
         //pin log
@@ -337,7 +337,7 @@ toku_apply_rollinclude (TXNID      xid,
         }
         if (next_log.b == spilled_head.b) {
             assert(!found_head);
-            found_head = TRUE;
+            found_head = true;
             assert(log->sequence == 0);
         }
         next_log      = log->previous;
diff --git a/ft/rollback-apply.cc b/ft/rollback-apply.cc
index 00924f8bb923cc901897ccbcd393542b1aa189ec..fa03c21d888ab688a109cdf7e5d41b9c85e7df88 100644
--- a/ft/rollback-apply.cc
+++ b/ft/rollback-apply.cc
@@ -25,7 +25,7 @@ int toku_commit_rollback_item (TOKUTXN txn, struct roll_entry *item, LSN lsn) {
     rolltype_dispatch_assign(item, toku_commit_, r, txn, lsn);
     txn->roll_info.num_rollentries_processed++;
     if (txn->roll_info.num_rollentries_processed % 1024 == 0) {
-        poll_txn_progress_function(txn, TRUE, FALSE);
+        poll_txn_progress_function(txn, true, false);
     }
     return r;
 }
@@ -35,13 +35,13 @@ int toku_abort_rollback_item (TOKUTXN txn, struct roll_entry *item, LSN lsn) {
     rolltype_dispatch_assign(item, toku_rollback_, r, txn, lsn);
     txn->roll_info.num_rollentries_processed++;
     if (txn->roll_info.num_rollentries_processed % 1024 == 0) {
-        poll_txn_progress_function(txn, FALSE, FALSE);
+        poll_txn_progress_function(txn, false, false);
     }
     return r;
 }
 
 static int
-note_ft_used_in_txns_parent(OMTVALUE ftv, u_int32_t UU(index), void *txnv) {
+note_ft_used_in_txns_parent(OMTVALUE ftv, uint32_t UU(index), void *txnv) {
     TOKUTXN CAST_FROM_VOIDP(child, txnv);
     TOKUTXN parent = child->parent;
     FT CAST_FROM_VOIDP(ft, ftv);
@@ -68,11 +68,11 @@ apply_txn(TOKUTXN txn, LSN lsn, apply_rollback_item func) {
     BLOCKNUM next_log      = ROLLBACK_NONE;
     uint32_t next_log_hash = 0;
 
-    BOOL is_current = FALSE;
+    bool is_current = false;
     if (txn_has_current_rollback_log(txn)) {
         next_log      = txn->roll_info.current_rollback;
         next_log_hash = txn->roll_info.current_rollback_hash;
-        is_current = TRUE;
+        is_current = true;
     }
     else if (txn_has_spilled_rollback_logs(txn)) {
         next_log      = txn->roll_info.spilled_rollback_tail;
@@ -80,7 +80,7 @@ apply_txn(TOKUTXN txn, LSN lsn, apply_rollback_item func) {
     }
 
     uint64_t last_sequence = txn->roll_info.num_rollback_nodes;
-    BOOL found_head = FALSE;
+    bool found_head = false;
     while (next_log.b != ROLLBACK_NONE.b) {
         ROLLBACK_LOG_NODE log;
         //pin log
@@ -99,7 +99,7 @@ apply_txn(TOKUTXN txn, LSN lsn, apply_rollback_item func) {
         }
         if (next_log.b == txn->roll_info.spilled_rollback_head.b) {
             assert(!found_head);
-            found_head = TRUE;
+            found_head = true;
             assert(log->sequence == 0);
         }
         next_log      = log->previous;
@@ -110,7 +110,7 @@ apply_txn(TOKUTXN txn, LSN lsn, apply_rollback_item func) {
             if (is_current) {
                 txn->roll_info.current_rollback      = ROLLBACK_NONE;
                 txn->roll_info.current_rollback_hash = 0;
-                is_current = FALSE;
+                is_current = false;
             }
             else {
                 txn->roll_info.spilled_rollback_tail      = next_log;
@@ -199,7 +199,7 @@ int toku_rollback_commit(TOKUTXN txn, LSN lsn) {
 
         // Merge the list of headers that must be checkpointed before commit
         if (txn->checkpoint_needed_before_commit) {
-            txn->parent->checkpoint_needed_before_commit = TRUE;
+            txn->parent->checkpoint_needed_before_commit = true;
         }
 
         //If this transaction needs an fsync (if it commits)
diff --git a/ft/rollback-ct-callbacks.cc b/ft/rollback-ct-callbacks.cc
index dbb588ef1cd4c5fba1f8930854e0b2c1108452ae..4e0444de74bd07eb77cc27a7ad50382b8e68f62a 100644
--- a/ft/rollback-ct-callbacks.cc
+++ b/ft/rollback-ct-callbacks.cc
@@ -26,7 +26,7 @@ rollback_log_destroy(ROLLBACK_LOG_NODE log) {
 // On success return nbytes.
 void toku_rollback_flush_callback (CACHEFILE cachefile, int fd, BLOCKNUM logname,
                                           void *rollback_v,  void** UU(disk_data), void *extraargs, PAIR_ATTR size, PAIR_ATTR* new_size,
-                                          BOOL write_me, BOOL keep_me, BOOL for_checkpoint, BOOL UU(is_clone)) {
+                                          bool write_me, bool keep_me, bool for_checkpoint, bool UU(is_clone)) {
     int r;
     ROLLBACK_LOG_NODE  CAST_FROM_VOIDP(log, rollback_v);
     FT CAST_FROM_VOIDP(h, extraargs);
@@ -53,7 +53,7 @@ void toku_rollback_flush_callback (CACHEFILE cachefile, int fd, BLOCKNUM logname
     }
 }
 
-int toku_rollback_fetch_callback (CACHEFILE cachefile, int fd, BLOCKNUM logname, u_int32_t fullhash,
+int toku_rollback_fetch_callback (CACHEFILE cachefile, int fd, BLOCKNUM logname, uint32_t fullhash,
                                  void **rollback_pv,  void** UU(disk_data), PAIR_ATTR *sizep, int * UU(dirtyp), void *extraargs) {
     int r;
     FT CAST_FROM_VOIDP(h, extraargs);
@@ -94,15 +94,15 @@ int toku_rollback_pe_callback (
 }
 
 // partial fetch is never required for a rollback log node
-BOOL toku_rollback_pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
-    return FALSE;
+bool toku_rollback_pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
+    return false;
 }
 
 // a rollback node should never be partial fetched, 
 // because we always say it is not required.
 // (pf req callback always returns false)
 int toku_rollback_pf_callback(void* UU(ftnode_pv),  void* UU(disk_data), void* UU(read_extraargs), int UU(fd), PAIR_ATTR* UU(sizep)) {
-    assert(FALSE);
+    assert(false);
     return 0;
 }
 
@@ -110,11 +110,11 @@ int toku_rollback_pf_callback(void* UU(ftnode_pv),  void* UU(disk_data), void* U
 int toku_rollback_cleaner_callback (
     void* UU(ftnode_pv),
     BLOCKNUM UU(blocknum),
-    u_int32_t UU(fullhash),
+    uint32_t UU(fullhash),
     void* UU(extraargs)
     )
 {
-    assert(FALSE);
+    assert(false);
     return 0;
 }
 
diff --git a/ft/rollback-ct-callbacks.h b/ft/rollback-ct-callbacks.h
index 6b6b16f935c2bfb310fa60ae11015acf626f3f86..a1224be8f4813c5f0a942e1c4839130c703076c1 100644
--- a/ft/rollback-ct-callbacks.h
+++ b/ft/rollback-ct-callbacks.h
@@ -11,8 +11,8 @@
 #include "cachetable.h"
 #include "fttypes.h"
 
-void toku_rollback_flush_callback(CACHEFILE cachefile, int fd, BLOCKNUM logname, void *rollback_v, void** UU(disk_data), void *extraargs, PAIR_ATTR size, PAIR_ATTR* new_size, BOOL write_me, BOOL keep_me, BOOL for_checkpoint, BOOL UU(is_clone));
-int toku_rollback_fetch_callback(CACHEFILE cachefile, int fd, BLOCKNUM logname, u_int32_t fullhash, void **rollback_pv,  void** UU(disk_data), PAIR_ATTR *sizep, int * UU(dirtyp), void *extraargs);
+void toku_rollback_flush_callback(CACHEFILE cachefile, int fd, BLOCKNUM logname, void *rollback_v, void** UU(disk_data), void *extraargs, PAIR_ATTR size, PAIR_ATTR* new_size, bool write_me, bool keep_me, bool for_checkpoint, bool UU(is_clone));
+int toku_rollback_fetch_callback(CACHEFILE cachefile, int fd, BLOCKNUM logname, uint32_t fullhash, void **rollback_pv,  void** UU(disk_data), PAIR_ATTR *sizep, int * UU(dirtyp), void *extraargs);
 void toku_rollback_pe_est_callback(
     void* rollback_v, 
     void* UU(disk_data),
@@ -26,12 +26,12 @@ int toku_rollback_pe_callback (
     PAIR_ATTR* new_attr, 
     void* UU(extraargs)
     ) ;
-BOOL toku_rollback_pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) ;
+bool toku_rollback_pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) ;
 int toku_rollback_pf_callback(void* UU(ftnode_pv),  void* UU(disk_data), void* UU(read_extraargs), int UU(fd), PAIR_ATTR* UU(sizep));
 int toku_rollback_cleaner_callback (
     void* UU(ftnode_pv),
     BLOCKNUM UU(blocknum),
-    u_int32_t UU(fullhash),
+    uint32_t UU(fullhash),
     void* UU(extraargs)
     );
 
diff --git a/ft/rollback.cc b/ft/rollback.cc
index 5165f1fef1deeb2aae82614e7e52eb3e7a0c74bc..eebbefb209c21648d214d1f6b91a8fb353cd8867 100644
--- a/ft/rollback.cc
+++ b/ft/rollback.cc
@@ -7,7 +7,7 @@
 #include "includes.h"
 #include "rollback-ct-callbacks.h"
 
-static void rollback_unpin_remove_callback(CACHEKEY* cachekey, BOOL for_checkpoint, void* extra) {
+static void rollback_unpin_remove_callback(CACHEKEY* cachekey, bool for_checkpoint, void* extra) {
     FT CAST_FROM_VOIDP(h, extra);
     toku_free_blocknum(
         h->blocktable, 
@@ -50,7 +50,7 @@ static inline PAIR_ATTR make_rollback_pair_attr(long size) {
      .leaf_size = 0, 
      .rollback_size = size, 
      .cache_pressure_size = 0,
-     .is_valid = TRUE
+     .is_valid = true
     }; 
     return result; 
 }
@@ -76,7 +76,7 @@ static void rollback_log_create (TOKUTXN txn, BLOCKNUM previous, uint32_t previo
     log->layout_version                = FT_LAYOUT_VERSION;
     log->layout_version_original       = FT_LAYOUT_VERSION;
     log->layout_version_read_from_disk = FT_LAYOUT_VERSION;
-    log->dirty = TRUE;
+    log->dirty = true;
     log->txnid = txn->txnid64;
     log->sequence = txn->roll_info.num_rollback_nodes++;
     toku_allocate_blocknum(h->blocktable, &log->blocknum, h);
@@ -158,7 +158,7 @@ void toku_txn_maybe_note_ft (TOKUTXN txn, FT ft) {
 }
 
 // Return the number of bytes that went into the rollback data structure (the uncompressed count if there is compression)
-int toku_logger_txn_rollback_raw_count(TOKUTXN txn, u_int64_t *raw_count)
+int toku_logger_txn_rollback_raw_count(TOKUTXN txn, uint64_t *raw_count)
 {
     toku_txn_lock(txn);
     *raw_count = txn->roll_info.rollentry_raw_count;
@@ -175,7 +175,7 @@ void toku_maybe_prefetch_previous_rollback_log(TOKUTXN txn, ROLLBACK_LOG_NODE lo
         uint32_t hash = log->previous_hash;
         CACHEFILE cf = txn->logger->rollback_cachefile;
         FT CAST_FROM_VOIDP(h, toku_cachefile_get_userdata(cf));
-        BOOL doing_prefetch = FALSE;
+        bool doing_prefetch = false;
         r = toku_cachefile_prefetch(cf, name, hash,
                                     get_write_callbacks_for_rollback_log(h),
                                     toku_rollback_fetch_callback,
@@ -204,7 +204,7 @@ void toku_get_and_pin_rollback_log(TOKUTXN txn, BLOCKNUM blocknum, uint32_t hash
                                         toku_rollback_fetch_callback,
                                         toku_rollback_pf_req_callback,
                                         toku_rollback_pf_callback,
-                                        TRUE, // may_modify_value
+                                        true, // may_modify_value
                                         h
                                         );
     assert(r == 0);
diff --git a/ft/rollback.h b/ft/rollback.h
index 7c22d92326839cc98358347856cab3371d7fe463..fce795f4c8e9c795a0b90d5a6a6d759d06791ffa 100644
--- a/ft/rollback.h
+++ b/ft/rollback.h
@@ -47,7 +47,7 @@ void *toku_memdup_in_rollback(ROLLBACK_LOG_NODE log, const void *v, size_t len);
 void toku_maybe_spill_rollbacks(TOKUTXN txn, ROLLBACK_LOG_NODE log);
 
 void toku_txn_maybe_note_ft (TOKUTXN txn, FT h);
-int toku_logger_txn_rollback_raw_count(TOKUTXN txn, u_int64_t *raw_count);
+int toku_logger_txn_rollback_raw_count(TOKUTXN txn, uint64_t *raw_count);
 
 int toku_find_xid_by_xid (const TXNID &xid, const TXNID &xidfind);
 
diff --git a/ft/rwlock.cc b/ft/rwlock.cc
index 7b9ad937370a0e248384724f2e511177034e5004..fe2241418f49a12cb7f3363fbd43d39c87b32211 100644
--- a/ft/rwlock.cc
+++ b/ft/rwlock.cc
@@ -74,7 +74,7 @@
  *        c) release mutex
  *        d) wait on the semaphore
  *        e) return success when the semaphore releases
- *     3) Otherwise set writer=TRUE, release mutex and return success.
+ *     3) Otherwise set writer=true, release mutex and return success.
  *
  * To unlock a read rwlock:
  *     1) Acquire mutex
@@ -90,7 +90,7 @@
  *            ii) return success
  *        b) Else if the first element is a writer
  *            i) pop the list
- *            ii) set writer to TRUE
+ *            ii) set writer to true
  *            iii) increment the semaphore
  *            iv) return success
  */
diff --git a/ft/sub_block.cc b/ft/sub_block.cc
index ab5662e64d04ffe607e6f3308f9eaf668bfd9564..5668764030ae041c21d09ec9a8be7d06b570b0cb 100644
--- a/ft/sub_block.cc
+++ b/ft/sub_block.cc
@@ -36,7 +36,7 @@ void sub_block_init(SUB_BLOCK sub_block) {
 // get the size of the compression header
 size_t 
 sub_block_header_size(int n_sub_blocks) {
-    return sizeof (u_int32_t) + n_sub_blocks * sizeof (struct stored_sub_block);
+    return sizeof (uint32_t) + n_sub_blocks * sizeof (struct stored_sub_block);
 }
 
 void
@@ -152,11 +152,11 @@ compress_work_init(struct compress_work *w, enum toku_compression_method method,
 // cs_bound is the compressed size bound
 // Returns the size of the compressed data
 //
-u_int32_t
+uint32_t
 compress_nocrc_sub_block(
     struct sub_block *sub_block,
     void* sb_compressed_ptr,
-    u_int32_t cs_bound,
+    uint32_t cs_bound,
     enum toku_compression_method method
     )
 {
@@ -257,9 +257,9 @@ compress_all_sub_blocks(int n_sub_blocks, struct sub_block sub_block[], char *un
 // initialize the decompression work
 void 
 decompress_work_init(struct decompress_work *dw,
-                     void *compress_ptr, u_int32_t compress_size,
-                     void *uncompress_ptr, u_int32_t uncompress_size,
-                     u_int32_t xsum) {
+                     void *compress_ptr, uint32_t compress_size,
+                     void *uncompress_ptr, uint32_t uncompress_size,
+                     uint32_t xsum) {
     dw->compress_ptr = compress_ptr; 
     dw->compress_size = compress_size;
     dw->uncompress_ptr = uncompress_ptr; 
@@ -272,11 +272,11 @@ int verbose_decompress_sub_block = 1;
 
 // decompress one block
 int
-decompress_sub_block(void *compress_ptr, u_int32_t compress_size, void *uncompress_ptr, u_int32_t uncompress_size, u_int32_t expected_xsum) {
+decompress_sub_block(void *compress_ptr, uint32_t compress_size, void *uncompress_ptr, uint32_t uncompress_size, uint32_t expected_xsum) {
     int result = 0;
 
     // verify checksum
-    u_int32_t xsum = x1764_memory(compress_ptr, compress_size);
+    uint32_t xsum = x1764_memory(compress_ptr, compress_size);
     if (xsum != expected_xsum) {
         if (verbose_decompress_sub_block) fprintf(stderr, "%s:%d xsum %u expected %u\n", __FUNCTION__, __LINE__, xsum, expected_xsum);
         result = EINVAL;
diff --git a/ft/sub_block.h b/ft/sub_block.h
index 83e48fd152166a6b02790cea1a2deca4b42d5c4e..6051d5d617acc52ed8db8b9de63850d833e0221b 100644
--- a/ft/sub_block.h
+++ b/ft/sub_block.h
@@ -19,19 +19,19 @@ static const int max_basement_node_compressed_size = 64*1024;
 
 struct sub_block {
     void *uncompressed_ptr;
-    u_int32_t uncompressed_size;
+    uint32_t uncompressed_size;
 
     void *compressed_ptr;
-    u_int32_t compressed_size;         // real compressed size
-    u_int32_t compressed_size_bound;   // estimated compressed size
+    uint32_t compressed_size;         // real compressed size
+    uint32_t compressed_size_bound;   // estimated compressed size
 
-    u_int32_t xsum;                    // sub block checksum
+    uint32_t xsum;                    // sub block checksum
 };
 
 struct stored_sub_block {
-    u_int32_t uncompressed_size;
-    u_int32_t compressed_size;
-    u_int32_t xsum;
+    uint32_t uncompressed_size;
+    uint32_t compressed_size;
+    uint32_t xsum;
 };
 
 void sub_block_init(SUB_BLOCK);
@@ -79,11 +79,11 @@ struct compress_work {
 void
 compress_work_init(struct compress_work *w, enum toku_compression_method method, struct sub_block *sub_block);
 
-u_int32_t
+uint32_t
 compress_nocrc_sub_block(
     struct sub_block *sub_block,
     void* sb_compressed_ptr,
-    u_int32_t cs_bound,
+    uint32_t cs_bound,
     enum toku_compression_method method
     );
 
@@ -100,22 +100,22 @@ struct decompress_work {
     struct work base;
     void *compress_ptr;
     void *uncompress_ptr;
-    u_int32_t compress_size;
-    u_int32_t uncompress_size;
-    u_int32_t xsum;
+    uint32_t compress_size;
+    uint32_t uncompress_size;
+    uint32_t xsum;
     int error;
 };
 
 // initialize the decompression work
 void 
 decompress_work_init(struct decompress_work *dw,
-                     void *compress_ptr, u_int32_t compress_size,
-                     void *uncompress_ptr, u_int32_t uncompress_size,
-                     u_int32_t xsum);
+                     void *compress_ptr, uint32_t compress_size,
+                     void *uncompress_ptr, uint32_t uncompress_size,
+                     uint32_t xsum);
 
 // decompress one block
 int
-decompress_sub_block(void *compress_ptr, u_int32_t compress_size, void *uncompress_ptr, u_int32_t uncompress_size, u_int32_t expected_xsum);
+decompress_sub_block(void *compress_ptr, uint32_t compress_size, void *uncompress_ptr, uint32_t uncompress_size, uint32_t expected_xsum);
 
 // decompress blocks until there is no more work to do
 void *
diff --git a/ft/sub_block_map.h b/ft/sub_block_map.h
index dd2fd451d57a7cffb5ca2be172b1e5925caf418d..70a006595909c6806bfe1d452b750adc8dc490d8 100644
--- a/ft/sub_block_map.h
+++ b/ft/sub_block_map.h
@@ -9,9 +9,9 @@
 
 // Map objects to a sequence of sub block
 struct sub_block_map {
-    u_int32_t idx;
-    u_int32_t offset;
-    u_int32_t size;
+    uint32_t idx;
+    uint32_t offset;
+    uint32_t size;
 };
 
 enum {
@@ -19,7 +19,7 @@ enum {
 };
 
 static inline void
-sub_block_map_init(struct sub_block_map *sbmap, u_int32_t idx, u_int32_t offset, u_int32_t size) {
+sub_block_map_init(struct sub_block_map *sbmap, uint32_t idx, uint32_t offset, uint32_t size) {
     sbmap->idx = idx;
     sbmap->offset = offset;
     sbmap->size = size;
diff --git a/ft/tdb_logprint.cc b/ft/tdb_logprint.cc
index c1f2f5a210fc4de570b8b6998610c8f92ad58122..5edac51eaf152c233b3a928d52f3f0af6958e08f 100644
--- a/ft/tdb_logprint.cc
+++ b/ft/tdb_logprint.cc
@@ -9,8 +9,8 @@
 #include "includes.h"
 
 #if 0
-static u_int32_t crc=0;
-static u_int32_t actual_len=0;
+static uint32_t crc=0;
+static uint32_t actual_len=0;
 
 static int get_char(void) {
     int v = getchar();
@@ -21,17 +21,17 @@ static int get_char(void) {
     return v;
 }
 
-static u_int32_t get_uint32 (void) {
-    u_int32_t a = get_char();
-    u_int32_t b = get_char();
-    u_int32_t c = get_char();
-    u_int32_t d = get_char();
+static uint32_t get_uint32 (void) {
+    uint32_t a = get_char();
+    uint32_t b = get_char();
+    uint32_t c = get_char();
+    uint32_t d = get_char();
     return (a<<24)|(b<<16)|(c<<8)|d;
 }
 
-static u_int64_t get_uint64 (void) {
-    u_int32_t hi = get_uint32();
-    u_int32_t lo = get_uint32();
+static uint64_t get_uint64 (void) {
+    uint32_t hi = get_uint32();
+    uint32_t lo = get_uint32();
     return ((((long long)hi) << 32)
 	    |
 	    lo);
@@ -48,7 +48,7 @@ static void transcribe_txnid (void) {
 }
 
 static void transcribe_fileid (void) {
-    u_int32_t value = get_uint32();
+    uint32_t value = get_uint32();
     printf(" fileid=%d", value);
 }
 
@@ -59,30 +59,30 @@ static void transcribe_diskoff (void) {
 }
 
 static void transcribe_crc32 (void) {
-    u_int32_t oldcrc=crc;
-    u_int32_t l = get_uint32();
+    uint32_t oldcrc=crc;
+    uint32_t l = get_uint32();
     printf(" crc=%08x", l);
     assert(l==oldcrc);
 }
 
 static void transcribe_mode (void) {
-    u_int32_t value = get_uint32();
+    uint32_t value = get_uint32();
     printf(" mode=0%o", value);
 }
 
 static void transcribe_filenum(void) {
-    u_int32_t value = get_uint32();
+    uint32_t value = get_uint32();
     printf(" filenum=%d", value);
 }
 
-static u_int32_t len1;
+static uint32_t len1;
 static void transcribe_len1 (void) {
     len1 = get_uint32();
     //printf(" len=%d", len1);
 }
 
 static void transcribe_len (void) {
-    u_int32_t l = get_uint32();
+    uint32_t l = get_uint32();
     printf(" len=%d", l);
     if (l!=actual_len) printf(" actual_len=%d", actual_len);
     assert(l==actual_len);
@@ -90,11 +90,11 @@ static void transcribe_len (void) {
 }
 
 static void transcribe_key_or_data (char *what) {
-    u_int32_t l = get_uint32();
+    uint32_t l = get_uint32();
     unsigned int i;
     printf(" %s(%d):\"", what, l);
     for (i=0; i<l; i++) {
-	u_int32_t c = get_char();
+	uint32_t c = get_char();
 	if (c=='\\') printf("\\\\");
 	else if (c=='\n') printf("\\n");
 	else if (c==' ') printf("\\ ");
@@ -124,7 +124,7 @@ static void transcribe_header (void) {
 
 static void newmain (int count) {
     int i;
-    u_int32_t version;
+    uint32_t version;
     int r = toku_read_and_print_logmagic(stdin, &version);
     for (i=0; i!=count; i++) {
 	r = toku_logprint_one_record(stdout, stdin);
diff --git a/ft/tests/block_allocator_test.cc b/ft/tests/block_allocator_test.cc
index 404dda4d1cfdf3683988c13dff3ab393bf50589f..4a3b81d4ea5768c69eb1656e7cf9e75c23ef6e51 100644
--- a/ft/tests/block_allocator_test.cc
+++ b/ft/tests/block_allocator_test.cc
@@ -7,28 +7,28 @@
 #include "test.h"
 #include "includes.h"
 
-static void ba_alloc_at (BLOCK_ALLOCATOR ba, u_int64_t size, u_int64_t offset) {
+static void ba_alloc_at (BLOCK_ALLOCATOR ba, uint64_t size, uint64_t offset) {
     block_allocator_validate(ba);
     block_allocator_alloc_block_at(ba, size, offset);
     block_allocator_validate(ba);
 }
 
-static void ba_alloc (BLOCK_ALLOCATOR ba, u_int64_t size, u_int64_t *answer) {
+static void ba_alloc (BLOCK_ALLOCATOR ba, uint64_t size, uint64_t *answer) {
     block_allocator_validate(ba);
     block_allocator_alloc_block(ba, size, answer);
     block_allocator_validate(ba);
 }
 
-static void ba_free (BLOCK_ALLOCATOR ba, u_int64_t offset) {
+static void ba_free (BLOCK_ALLOCATOR ba, uint64_t offset) {
     block_allocator_validate(ba);
     block_allocator_free_block(ba, offset);
     block_allocator_validate(ba);
 }
 
 static void
-ba_check_l (BLOCK_ALLOCATOR ba, u_int64_t blocknum_in_layout_order, u_int64_t expected_offset, u_int64_t expected_size)
+ba_check_l (BLOCK_ALLOCATOR ba, uint64_t blocknum_in_layout_order, uint64_t expected_offset, uint64_t expected_size)
 {
-    u_int64_t actual_offset, actual_size;
+    uint64_t actual_offset, actual_size;
     int r = block_allocator_get_nth_block_in_layout_order(ba, blocknum_in_layout_order, &actual_offset, &actual_size);
     assert(r==0);
     assert(expected_offset == actual_offset);
@@ -36,9 +36,9 @@ ba_check_l (BLOCK_ALLOCATOR ba, u_int64_t blocknum_in_layout_order, u_int64_t ex
 }
 
 static void
-ba_check_none (BLOCK_ALLOCATOR ba, u_int64_t blocknum_in_layout_order)
+ba_check_none (BLOCK_ALLOCATOR ba, uint64_t blocknum_in_layout_order)
 {
-    u_int64_t actual_offset, actual_size;
+    uint64_t actual_offset, actual_size;
     int r = block_allocator_get_nth_block_in_layout_order(ba, blocknum_in_layout_order, &actual_offset, &actual_size);
     assert(r==-1);
 }
@@ -48,7 +48,7 @@ ba_check_none (BLOCK_ALLOCATOR ba, u_int64_t blocknum_in_layout_order)
 static void
 test_ba0 (void) {
     BLOCK_ALLOCATOR ba;
-    u_int64_t b0, b1;
+    uint64_t b0, b1;
     create_block_allocator(&ba, 100, 1);
     assert(block_allocator_allocated_limit(ba)==100);
     ba_alloc_at(ba, 50, 100);
@@ -71,7 +71,7 @@ test_ba0 (void) {
     assert(10==block_allocator_block_size(ba, b0));
     assert(50==block_allocator_block_size(ba, 100));
 
-    u_int64_t b2, b3, b4, b5, b6, b7;
+    uint64_t b2, b3, b4, b5, b6, b7;
     ba_alloc(ba, 100, &b2);     
     ba_alloc(ba, 100, &b3);     
     ba_alloc(ba, 100, &b4);     
@@ -82,7 +82,7 @@ test_ba0 (void) {
     ba_alloc(ba, 100, &b2);  
     ba_free(ba, b4);         
     ba_free(ba, b6);         
-    u_int64_t b8, b9;
+    uint64_t b8, b9;
     ba_alloc(ba, 100, &b4);    
     ba_free(ba, b2);           
     ba_alloc(ba, 100, &b6);    
@@ -107,7 +107,7 @@ test_ba1 (int n_initial) {
     create_block_allocator(&ba, 0, 1);
     int i;
     int n_blocks=0;
-    u_int64_t blocks[1000];
+    uint64_t blocks[1000];
     for (i=0; i<1000; i++) {
 	if (i<n_initial || random()%2 == 0) {
 	    if (n_blocks<1000) {
@@ -135,7 +135,7 @@ static void
 test_ba2 (void)
 {
     BLOCK_ALLOCATOR ba;
-    u_int64_t b[6];
+    uint64_t b[6];
     enum { BSIZE = 1024 };
     create_block_allocator(&ba, 100, BSIZE);
     assert(block_allocator_allocated_limit(ba)==100);
@@ -181,7 +181,7 @@ test_ba2 (void)
     ba_check_l    (ba, 5, 7*BSIZE,       100);
     ba_check_none (ba, 6);
 
-    u_int64_t b2;
+    uint64_t b2;
     ba_alloc(ba, 100, &b2);
     assert(b2==4*BSIZE);
     ba_check_l    (ba, 0, 0, 100);
@@ -203,13 +203,13 @@ test_ba2 (void)
     ba_check_none (ba, 5);
 
     // This alloc will allocate the first block after the reserve space in the case of first fit.
-    u_int64_t b3;
+    uint64_t b3;
     ba_alloc(ba, 100, &b3);
     assert(b3==  BSIZE);      // First fit.
     // if (b3==5*BSIZE) then it is next fit.
 
     // Now 5*BSIZE is free
-    u_int64_t b5;
+    uint64_t b5;
     ba_alloc(ba, 100, &b5);
     assert(b5==5*BSIZE);
     ba_check_l    (ba, 0, 0, 100);
@@ -222,7 +222,7 @@ test_ba2 (void)
     ba_check_none (ba, 7);
 
     // Now all blocks are busy
-    u_int64_t b6, b7, b8;
+    uint64_t b6, b7, b8;
     ba_alloc(ba, 100, &b6);
     ba_alloc(ba, 100, &b7);
     ba_alloc(ba, 100, &b8);
@@ -243,13 +243,13 @@ test_ba2 (void)
     
     ba_free(ba, 9*BSIZE);
     ba_free(ba, 7*BSIZE);
-    u_int64_t b9;
+    uint64_t b9;
     ba_alloc(ba, 100, &b9);
     assert(b9==7*BSIZE);
 
     ba_free(ba, 5*BSIZE);
     ba_free(ba, 2*BSIZE);
-    u_int64_t b10, b11;
+    uint64_t b10, b11;
     ba_alloc(ba, 100, &b10);
     assert(b10==2*BSIZE);
     ba_alloc(ba, 100, &b11);
diff --git a/ft/tests/cachetable-3969.cc b/ft/tests/cachetable-3969.cc
index a48935122047c8965af7a785737a7e7ef759b9ab..5bbc927914a56e3447c77a2a0ed483e091366bc4 100644
--- a/ft/tests/cachetable-3969.cc
+++ b/ft/tests/cachetable-3969.cc
@@ -33,11 +33,11 @@ run_test (void) {
     long s1;
     long s2;
     
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8)); assert(r==0);
 
     for (int i = 0; i < 20; i++) {
-        r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+        r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
         r = toku_cachetable_unpin(f1, make_blocknum(2), 2, CACHETABLE_CLEAN, make_pair_attr(8)); assert(r==0);
     }
 
@@ -49,16 +49,16 @@ run_test (void) {
 
 
     // pin 1 and 2
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v2, &s2, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v2, &s2, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     r = toku_cachetable_begin_checkpoint(ct, NULL);
     // mark nodes as pending a checkpoint, so that get_and_pin_nonblocking on block 1 will return TOKUDB_TRY_AGAIN
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8)); assert(r==0);
 
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     // now we try to pin 1, and it should get evicted out from under us
     struct unlockers foo;
     foo.extra = NULL;
-    foo.locked = TRUE;
+    foo.locked = true;
     foo.f = unlock_test_fun;
     foo.next = NULL;
     r = toku_cachetable_get_and_pin_nonblocking(
@@ -71,7 +71,7 @@ run_test (void) {
         def_fetch,
         def_pf_req_callback,
         def_pf_callback,
-        TRUE,
+        true,
         NULL,
         &foo
         );
@@ -86,7 +86,7 @@ run_test (void) {
     assert(r==0);
     
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
     
     
diff --git a/ft/tests/cachetable-4302.cc b/ft/tests/cachetable-4302.cc
index be0f5eea9d1df102188ac58d4f3785977db7b05c..4bb62c24ce8535d9d2cf18014b372dfaa6248a8b 100644
--- a/ft/tests/cachetable-4302.cc
+++ b/ft/tests/cachetable-4302.cc
@@ -17,10 +17,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
   /* Do nothing */
   if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
@@ -30,7 +30,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value,
        void** UU(dd),
        PAIR_ATTR *sizep,
@@ -90,7 +90,7 @@ pe_callback (
 static void
 test_get_key_and_fullhash(
     CACHEKEY* cachekey,
-    u_int32_t* fullhash,
+    uint32_t* fullhash,
     void* UU(extra))
 {
     CACHEKEY name;
@@ -111,8 +111,8 @@ cachetable_test (void) {
 
   void* v1;
   long s1;
-  u_int64_t val1 = 0;
-  u_int64_t val2 = 0;
+  uint64_t val1 = 0;
+  uint64_t val2 = 0;
   CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
   wc.flush_callback = flush;
   wc.pe_est_callback = pe_est_callback;
@@ -126,12 +126,12 @@ cachetable_test (void) {
       wc, 
       fetch, 
       def_pf_req_callback, def_pf_callback, 
-      TRUE, 
+      true, 
       &val1
       );
   r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
   CACHEKEY key;
-  u_int32_t fullhash;
+  uint32_t fullhash;
   checkpoint_began = false;
   r = toku_cachetable_put_with_dep_pairs(
         f1,
@@ -160,7 +160,7 @@ cachetable_test (void) {
       );
 
   toku_cachetable_verify(ct);
-  r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+  r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
   r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
diff --git a/ft/tests/cachetable-4357.cc b/ft/tests/cachetable-4357.cc
index 0a47c5ae7e62349b41ead07fa58df6fd1b64cae6..2240d4a4dc11aa40a569be896c47bc1ab4918999 100644
--- a/ft/tests/cachetable-4357.cc
+++ b/ft/tests/cachetable-4357.cc
@@ -17,7 +17,7 @@ static void *pin_nonblocking(void *arg) {
         &v1, 
         &s1, 
         def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, 
-        TRUE,
+        true,
         NULL, 
         NULL
         );
@@ -45,7 +45,7 @@ cachetable_test (void) {
       &v1, 
       &s1, 
       def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, 
-      TRUE, 
+      true, 
       NULL
       );
   toku_pthread_t pin_nonblocking_tid;
@@ -61,7 +61,7 @@ cachetable_test (void) {
   assert_zero(r);
   
   toku_cachetable_verify(ct);
-  r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+  r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
   r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
diff --git a/ft/tests/cachetable-4365.cc b/ft/tests/cachetable-4365.cc
index 9fc854650e2c8055cb2a3c404f28c7d75e933e37..311c090b37f1a79f607e8081841039923bc5d6d3 100644
--- a/ft/tests/cachetable-4365.cc
+++ b/ft/tests/cachetable-4365.cc
@@ -17,7 +17,7 @@ static void *pin_nonblocking(void *arg) {
         &v1, 
         &s1, 
         def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, 
-        TRUE,
+        true,
         NULL, 
         NULL
         );
@@ -41,7 +41,7 @@ static void *put_same_key(void *arg) {
 
 toku_pthread_t put_tid;
 
-static void test_remove_key(CACHEKEY* UU(cachekey), BOOL UU(for_checkpoint), void* UU(extra)) {
+static void test_remove_key(CACHEKEY* UU(cachekey), bool UU(for_checkpoint), void* UU(extra)) {
     int r = toku_pthread_create(&put_tid, NULL, put_same_key, NULL); 
     assert_zero(r);    
 }
@@ -66,7 +66,7 @@ cachetable_test (void) {
       &v1, 
       &s1, 
       def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, 
-      TRUE, 
+      true, 
       NULL
       );
   toku_pthread_t pin_nonblocking_tid;
@@ -86,7 +86,7 @@ cachetable_test (void) {
   r = toku_cachetable_unpin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), CACHETABLE_CLEAN, make_pair_attr(2));
   
   toku_cachetable_verify(ct);
-  r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+  r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
   r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
diff --git a/ft/tests/cachetable-4545.cc b/ft/tests/cachetable-4545.cc
index 6e73a8906dff2cb10d69b69cfb3f1a91c0a6d5f0..075d4b895b2f200de059251a8b2633a7f0f638e8 100644
--- a/ft/tests/cachetable-4545.cc
+++ b/ft/tests/cachetable-4545.cc
@@ -5,9 +5,9 @@
 #include "includes.h"
 #include "test.h"
 
-BOOL flush_called;
-BOOL pf_req_called;
-BOOL pf_called;
+bool flush_called;
+bool pf_req_called;
+bool pf_called;
 
 static UU() void
 flush (CACHEFILE f __attribute__((__unused__)),
@@ -18,25 +18,25 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-       BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+       bool UU(is_clone)
        ) {
-    flush_called = TRUE;
+    flush_called = true;
     *new_size = make_pair_attr(8);
 }
 
-static BOOL pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
-  pf_req_called = TRUE;
+static bool pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
+  pf_req_called = true;
   assert(flush_called);
-  return TRUE;
+  return true;
 }
 
 static int pf_callback(void* UU(ftnode_pv), void* UU(disk_data), void* UU(read_extraargs), int UU(fd), PAIR_ATTR* sizep) {
    assert(pf_req_called);
    assert(flush_called);
-   pf_called = TRUE;
+   pf_called = true;
   *sizep = make_pair_attr(8);
   return 0;
 }
@@ -56,15 +56,15 @@ cachetable_test (void) {
   long s1;
   CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
   wc.flush_callback = flush;
-  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, pf_req_callback, pf_callback, TRUE, NULL);
+  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, pf_req_callback, pf_callback, true, NULL);
   r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8));
 
-  flush_called = FALSE;
-  pf_req_called = FALSE;
-  pf_called = FALSE;
+  flush_called = false;
+  pf_req_called = false;
+  pf_called = false;
   r = toku_cachetable_begin_checkpoint(ct, NULL);
   assert_zero(r);
-  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, pf_req_callback, pf_callback, TRUE, NULL);
+  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, pf_req_callback, pf_callback, true, NULL);
   assert_zero(r);
   r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8));
   assert_zero(r);
@@ -80,7 +80,7 @@ cachetable_test (void) {
   assert(flush_called);
   assert(pf_called);
   toku_cachetable_verify(ct);
-  r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+  r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
   r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 }
diff --git a/ft/tests/cachetable-5097.cc b/ft/tests/cachetable-5097.cc
index dbf98bf27a54d37cc305b92d1c7abe25ac3a6623..411b0f427d26a4227620c9d786546e9918a90fa6 100644
--- a/ft/tests/cachetable-5097.cc
+++ b/ft/tests/cachetable-5097.cc
@@ -8,10 +8,10 @@
 CACHEFILE f1;
 CACHEFILE f2;
 
-BOOL check_flush;
-BOOL dirty_flush_called;
-BOOL check_pe_callback;
-BOOL pe_callback_called;
+bool check_flush;
+bool dirty_flush_called;
+bool check_pe_callback;
+bool pe_callback_called;
 
 static int 
 pe_callback (
@@ -23,7 +23,7 @@ pe_callback (
 {
     *bytes_freed = make_pair_attr(1);
     if (check_pe_callback) {
-        pe_callback_called = TRUE;
+        pe_callback_called = true;
     }
     usleep(4*1024*1024);
     return 0;
@@ -38,13 +38,13 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-       BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+       bool UU(is_clone)
        ) {
     if (check_flush && w) {
-        dirty_flush_called = TRUE;
+        dirty_flush_called = true;
     }
 }
 
@@ -60,13 +60,13 @@ static void *f2_pin(void *arg) {
     // and we expect that to be enough so that the unpin does not invoke a partial eviction
     // This is just to ensure that the bug is being exercised
     //
-    check_pe_callback = TRUE;
-    r = toku_cachetable_get_and_pin(f2, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    check_pe_callback = true;
+    r = toku_cachetable_get_and_pin(f2, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     assert(r == 0);
     assert(pe_callback_called);
-    pe_callback_called = FALSE;
+    pe_callback_called = false;
     r = toku_cachetable_unpin(f2, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
-    check_pe_callback = FALSE;
+    check_pe_callback = false;
     assert(!pe_callback_called);
     assert(r == 0);
     
@@ -77,8 +77,8 @@ static void
 cachetable_test (void) {
     const int test_limit = 12;
     int r;
-    check_flush = FALSE;
-    dirty_flush_called = FALSE;
+    check_flush = false;
+    dirty_flush_called = false;
     
     CACHETABLE ct;
     r = toku_create_cachetable(&ct, test_limit, ZERO_LSN, NULL_LOGGER); assert(r == 0);
@@ -99,7 +99,7 @@ cachetable_test (void) {
     wc.flush_callback = flush;
     // pin and unpin a node 20 times, just to get clock count up
     for (int i = 0; i < 20; i++) {
-        r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+        r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
         assert(r == 0);
         r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8));
         assert(r == 0);
@@ -112,11 +112,11 @@ cachetable_test (void) {
     assert_zero(r);
 
     usleep(2*1024*1024);
-    check_flush = TRUE;
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); 
+    check_flush = true;
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); 
     assert(r == 0);
     assert(dirty_flush_called);
-    check_flush = FALSE;
+    check_flush = false;
 
     void *ret;
     r = toku_pthread_join(tid, &ret); 
@@ -124,7 +124,7 @@ cachetable_test (void) {
 
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f2, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f2, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 }
 
diff --git a/ft/tests/cachetable-all-write.cc b/ft/tests/cachetable-all-write.cc
index 6dbb341dc07c914ced604ee043ac7100c60e6dba..2d6776945ce79f18fbb2bdaf055872a85841f355 100644
--- a/ft/tests/cachetable-all-write.cc
+++ b/ft/tests/cachetable-all-write.cc
@@ -14,10 +14,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
         PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
     /* Do nothing */
     if (verbose) { printf("FLUSH: %d write_me %d\n", (int)k.b, w); }
@@ -43,16 +43,16 @@ cachetable_test (void) {
     long s1, s2;
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = flush;
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8));
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
 
 
     r = toku_cachetable_unpin(f1, make_blocknum(2), 2, CACHETABLE_CLEAN, make_pair_attr(8));
     //r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, 8);
 
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-checkpoint-pending.cc b/ft/tests/cachetable-checkpoint-pending.cc
index fa011573e641d15a0676612087a24fe5a7c950db..63db470c2bb67b049dcd1db565d8ed6d7ffb9feb 100644
--- a/ft/tests/cachetable-checkpoint-pending.cc
+++ b/ft/tests/cachetable-checkpoint-pending.cc
@@ -42,10 +42,10 @@ flush (
     void *UU(extraargs), 
     PAIR_ATTR size, 
     PAIR_ATTR* UU(new_size), 
-    BOOL write_me, 
-    BOOL keep_me, 
-    BOOL UU(for_checkpoint),
-        BOOL UU(is_clone)
+    bool write_me, 
+    bool keep_me, 
+    bool UU(for_checkpoint),
+        bool UU(is_clone)
     )
 {
     // printf("f");
@@ -64,7 +64,7 @@ fetch (
     CACHEFILE UU(thiscf), 
     int UU(fd), 
     CACHEKEY UU(key), 
-    u_int32_t UU(fullhash), 
+    uint32_t UU(fullhash), 
     void **UU(value),
     void **UU(dd), 
     PAIR_ATTR *UU(sizep), 
@@ -84,12 +84,12 @@ do_update (void *UU(ignore))
     int i;
     for (i=0; i<N; i++) {
 	CACHEKEY key = make_blocknum(i);
-        u_int32_t hi = toku_cachetable_hash(cf, key);
+        uint32_t hi = toku_cachetable_hash(cf, key);
         void *vv;
 	long size;
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
         wc.flush_callback = flush;
-        int r = toku_cachetable_get_and_pin(cf, key, hi, &vv, &size, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, 0);
+        int r = toku_cachetable_get_and_pin(cf, key, hi, &vv, &size, wc, fetch, def_pf_req_callback, def_pf_callback, true, 0);
 	//printf("g");
 	assert(r==0);
 	assert(size==sizeof(int));
@@ -136,7 +136,7 @@ static void checkpoint_pending(void) {
     int i;
     for (i=0; i<N; i++) {
         CACHEKEY key = make_blocknum(i);
-        u_int32_t hi = toku_cachetable_hash(cf, key);
+        uint32_t hi = toku_cachetable_hash(cf, key);
 	values[i] = 42;
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
         wc.flush_callback = flush;
@@ -174,7 +174,7 @@ static void checkpoint_pending(void) {
     assert(r == 0);
     assert(n_flush == 0 && n_write_me == 0 && n_keep_me == 0);
 
-    r = toku_cachefile_close(&cf, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&cf, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-checkpoint-pinned-nodes.cc b/ft/tests/cachetable-checkpoint-pinned-nodes.cc
index 0b5ce66818ee268fc1201e387e2e5d127f591fae..21cc4b5a28dec8238184f7bc2e44982aeea54a48 100644
--- a/ft/tests/cachetable-checkpoint-pinned-nodes.cc
+++ b/ft/tests/cachetable-checkpoint-pinned-nodes.cc
@@ -5,11 +5,11 @@
 #include "includes.h"
 #include "test.h"
 
-u_int64_t clean_val = 0;
-u_int64_t dirty_val = 0;
+uint64_t clean_val = 0;
+uint64_t dirty_val = 0;
 
-BOOL check_me;
-BOOL flush_called;
+bool check_me;
+bool flush_called;
 
 static void
 flush (CACHEFILE f __attribute__((__unused__)),
@@ -20,17 +20,17 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-       BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+       bool UU(is_clone)
        ) {
   /* Do nothing */
   if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
   //usleep (5*1024*1024);
   // if the checkpoint is pending, assert that it is of what we made dirty
   if (check_me) {
-    flush_called = TRUE;
+    flush_called = true;
     assert(c);
     assert(e == &dirty_val);
     assert(v == &dirty_val);
@@ -43,7 +43,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -78,9 +78,9 @@ cachetable_test (void) {
   long s2;
   CACHETABLE_WRITE_CALLBACK wc = def_write_callback(&dirty_val);
   wc.flush_callback = flush;
-  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, &dirty_val);
+  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, def_pf_req_callback, def_pf_callback, true, &dirty_val);
   wc.write_extraargs = NULL;
-  r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+  r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
 
   //
   // Here is the test, we have two pairs, v1 is dirty, v2 is clean, but both are currently pinned
@@ -94,8 +94,8 @@ cachetable_test (void) {
   r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8));
   r = toku_cachetable_unpin(f1, make_blocknum(2), 2, CACHETABLE_CLEAN, make_pair_attr(8));
 
-  check_me = TRUE;
-  flush_called = FALSE;
+  check_me = true;
+  flush_called = false;
   r = toku_cachetable_end_checkpoint(
       ct, 
       NULL, 
@@ -104,10 +104,10 @@ cachetable_test (void) {
       );
   assert(r==0);
   assert(flush_called);
-  check_me = FALSE;
+  check_me = false;
 
   toku_cachetable_verify(ct);
-  r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+  r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
   r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
diff --git a/ft/tests/cachetable-checkpoint-prefetched-nodes.cc b/ft/tests/cachetable-checkpoint-prefetched-nodes.cc
index 70d040b9f905754d049c1d81a480106bb33ad332..becb025476c5210da90015b8d73cce00efe86a77 100644
--- a/ft/tests/cachetable-checkpoint-prefetched-nodes.cc
+++ b/ft/tests/cachetable-checkpoint-prefetched-nodes.cc
@@ -5,11 +5,11 @@
 #include "includes.h"
 #include "test.h"
 
-u_int64_t clean_val = 0;
-u_int64_t dirty_val = 0;
+uint64_t clean_val = 0;
+uint64_t dirty_val = 0;
 
-BOOL check_me;
-BOOL flush_called;
+bool check_me;
+bool flush_called;
 
 static void
 flush (CACHEFILE f __attribute__((__unused__)),
@@ -20,17 +20,17 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
         PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
   /* Do nothing */
   if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
   //usleep (5*1024*1024);
   // if the checkpoint is pending, assert that it is of what we made dirty
   if (check_me) {
-    flush_called = TRUE;
+    flush_called = true;
     assert(c);
     assert(e == &dirty_val);
     assert(v == &dirty_val);
@@ -43,7 +43,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -53,11 +53,11 @@ fetch (CACHEFILE f        __attribute__((__unused__)),
   *dirtyp = 0;
   if (extraargs) {
       *value = &dirty_val;
-      *dirtyp = TRUE;
+      *dirtyp = true;
   }
   else {
       *value = &clean_val;
-      *dirtyp = FALSE;
+      *dirtyp = false;
   }
   *sizep = make_pair_attr(8);
   return 0;
@@ -74,12 +74,12 @@ cachetable_test (void) {
   CACHEFILE f1;
   r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
 
-  BOOL doing_prefetch = FALSE;
+  bool doing_prefetch = false;
   CACHETABLE_WRITE_CALLBACK wc = def_write_callback(&dirty_val);
   wc.flush_callback = flush;
   r = toku_cachefile_prefetch(f1, make_blocknum(1), 1, wc, fetch, def_pf_req_callback, def_pf_callback, &dirty_val, &doing_prefetch);
   assert(doing_prefetch);
-  doing_prefetch = FALSE;
+  doing_prefetch = false;
   wc.write_extraargs = NULL;
   r = toku_cachefile_prefetch(f1, make_blocknum(2), 2, wc, fetch, def_pf_req_callback, def_pf_callback, NULL, &doing_prefetch);
   assert(doing_prefetch);
@@ -93,8 +93,8 @@ cachetable_test (void) {
   r = toku_cachetable_begin_checkpoint(ct, NULL); assert(r == 0);
 
 
-  check_me = TRUE;
-  flush_called = FALSE;
+  check_me = true;
+  flush_called = false;
   r = toku_cachetable_end_checkpoint(
       ct, 
       NULL, 
@@ -103,12 +103,12 @@ cachetable_test (void) {
       );
   assert(r==0);
   assert(flush_called);
-  check_me = FALSE;
+  check_me = false;
   
 
 
   toku_cachetable_verify(ct);
-  r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+  r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
   r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
diff --git a/ft/tests/cachetable-checkpoint-test.cc b/ft/tests/cachetable-checkpoint-test.cc
index 6ecb28ca952fe0ddba6c9f764de61ae984be4879..7b08befa631863d586f32fa4263235b61efb9593 100644
--- a/ft/tests/cachetable-checkpoint-test.cc
+++ b/ft/tests/cachetable-checkpoint-test.cc
@@ -22,10 +22,10 @@ static void flush(
     void *extraargs, 
     PAIR_ATTR size, 
     PAIR_ATTR* UU(new_size), 
-    BOOL write_me, 
-    BOOL keep_me, 
-    BOOL UU(for_checkpoint),
-        BOOL UU(is_clone)
+    bool write_me, 
+    bool keep_me, 
+    bool UU(for_checkpoint),
+        bool UU(is_clone)
     ) 
 {
     cf = cf; key = key; value = value; extraargs = extraargs; 
@@ -75,7 +75,7 @@ static void cachetable_checkpoint_test(int n, enum cachetable_dirty dirty) {
     int i;
     for (i=0; i<n; i++) {
         CACHEKEY key = make_blocknum(i);
-        u_int32_t hi = toku_cachetable_hash(f1, key);
+        uint32_t hi = toku_cachetable_hash(f1, key);
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
         wc.flush_callback = flush;
         r = toku_cachetable_put(f1, key, hi, (void *)(long)i, make_pair_attr(1), wc);
@@ -109,7 +109,7 @@ static void cachetable_checkpoint_test(int n, enum cachetable_dirty dirty) {
     // after the checkpoint, all of the items should be clean
     for (i=0; i<n; i++) {
         CACHEKEY key = make_blocknum(i);
-        u_int32_t hi = toku_cachetable_hash(f1, key);
+        uint32_t hi = toku_cachetable_hash(f1, key);
         void *v;
         r = toku_cachetable_maybe_get_and_pin(f1, key, hi, &v);
         if (r != 0) 
@@ -136,7 +136,7 @@ static void cachetable_checkpoint_test(int n, enum cachetable_dirty dirty) {
     assert(r == 0);
     assert(n_flush == 0 && n_write_me == 0 && n_keep_me == 0);
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 );
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0 );
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-cleaner-checkpoint.cc b/ft/tests/cachetable-cleaner-checkpoint.cc
index 1c4e4c2b3c46206f9713a8239ed5fca838c1d91c..1d6fc2dc87d559b7ed0aae8e33c8c845618bcb07 100644
--- a/ft/tests/cachetable-cleaner-checkpoint.cc
+++ b/ft/tests/cachetable-cleaner-checkpoint.cc
@@ -7,7 +7,7 @@
 
 CACHEFILE f1;
 
-BOOL flush_called;
+bool flush_called;
 
 static void
 flush (CACHEFILE f __attribute__((__unused__)),
@@ -18,10 +18,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
   /* Do nothing */
   if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
@@ -32,17 +32,17 @@ flush (CACHEFILE f __attribute__((__unused__)),
   if (w) {
       assert(!flush_called);
       assert(c);
-      flush_called = TRUE;
+      flush_called = true;
   }
 }
 
-BOOL cleaner_called;
+bool cleaner_called;
 
 static int
 cleaner_callback(
     void* UU(ftnode_pv),
     BLOCKNUM blocknum,
-    u_int32_t fullhash,
+    uint32_t fullhash,
     void* UU(extraargs)
     )
 {
@@ -50,7 +50,7 @@ cleaner_callback(
     assert(fullhash == 1);
     assert(!cleaner_called);
     assert(flush_called);
-    cleaner_called = TRUE;
+    cleaner_called = true;
     int r = toku_cachetable_unpin(f1, blocknum, fullhash, CACHETABLE_CLEAN, make_pair_attr(8));
     assert_zero(r);
     return 0;
@@ -74,12 +74,12 @@ cachetable_test (void) {
   CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
   wc.flush_callback = flush;
   wc.cleaner_callback = cleaner_callback;
-  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
   PAIR_ATTR attr = make_pair_attr(8);
   attr.cache_pressure_size = 8;
   r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, attr);
 
-  cleaner_called = FALSE;
+  cleaner_called = false;
   r = toku_cachetable_begin_checkpoint(ct, NULL);
   assert_zero(r);
   toku_cleaner_thread(ct);
@@ -93,7 +93,7 @@ cachetable_test (void) {
   assert(r==0);
 
   toku_cachetable_verify(ct);
-  r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+  r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
   r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
diff --git a/ft/tests/cachetable-cleaner-checkpoint2.cc b/ft/tests/cachetable-cleaner-checkpoint2.cc
index 8c340753946f565d81def625b4e77c1069b46e24..1a525d781d2d4522203b0d10a1592f0c72211e65 100644
--- a/ft/tests/cachetable-cleaner-checkpoint2.cc
+++ b/ft/tests/cachetable-cleaner-checkpoint2.cc
@@ -7,7 +7,7 @@
 
 CACHEFILE f1;
 
-BOOL flush_called;
+bool flush_called;
 
 static void
 flush (CACHEFILE f __attribute__((__unused__)),
@@ -18,10 +18,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
   /* Do nothing */
   if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
@@ -32,17 +32,17 @@ flush (CACHEFILE f __attribute__((__unused__)),
   if (w) {
       assert(!flush_called);
       assert(c);
-      flush_called = TRUE;
+      flush_called = true;
   }
 }
 
-BOOL cleaner_called;
+bool cleaner_called;
 
 static int
 cleaner_callback(
     void* UU(ftnode_pv),
     BLOCKNUM blocknum,
-    u_int32_t fullhash,
+    uint32_t fullhash,
     void* UU(extraargs)
     )
 {
@@ -50,7 +50,7 @@ cleaner_callback(
     assert(fullhash == 1);
     assert(!cleaner_called);
     assert(flush_called);
-    cleaner_called = TRUE;
+    cleaner_called = true;
     int r = toku_cachetable_unpin(f1, blocknum, fullhash, CACHETABLE_CLEAN, make_pair_attr(8));
     assert_zero(r);
     return 0;
@@ -74,12 +74,12 @@ cachetable_test (void) {
   CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
   wc.flush_callback = flush;
   wc.cleaner_callback = cleaner_callback;
-  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
   PAIR_ATTR attr = make_pair_attr(8);
   attr.cache_pressure_size = 8;
   r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, attr);
 
-  cleaner_called = FALSE;
+  cleaner_called = false;
   r = toku_cachetable_begin_checkpoint(ct, NULL);
   assert_zero(r);
   toku_cleaner_thread(ct);
@@ -93,7 +93,7 @@ cachetable_test (void) {
   assert(r==0);
 
   toku_cachetable_verify(ct);
-  r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+  r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
   r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
diff --git a/ft/tests/cachetable-cleaner-thread-attrs-accumulate.cc b/ft/tests/cachetable-cleaner-thread-attrs-accumulate.cc
index 3c88e16ed2ef78a86857035f114a63d79645095b..bba9eebccdf063ce401f9f73512d02e52fd66fcc 100644
--- a/ft/tests/cachetable-cleaner-thread-attrs-accumulate.cc
+++ b/ft/tests/cachetable-cleaner-thread-attrs-accumulate.cc
@@ -16,14 +16,14 @@ toku_mutex_t attr_mutex;
 #define STATUS_VALUE(x) ct_status.status[x].value.num
 
 const PAIR_ATTR attrs[] = {
-    { .size = 20, .nonleaf_size = 13, .leaf_size = 900, .rollback_size = 123, .cache_pressure_size = 403, .is_valid = TRUE },
-    { .size = 21, .nonleaf_size = 16, .leaf_size = 910, .rollback_size = 113, .cache_pressure_size = 401, .is_valid = TRUE },
-    { .size = 22, .nonleaf_size = 17, .leaf_size = 940, .rollback_size = 133, .cache_pressure_size = 402, .is_valid = TRUE },
-    { .size = 23, .nonleaf_size = 18, .leaf_size = 931, .rollback_size = 153, .cache_pressure_size = 404, .is_valid = TRUE },
-    { .size = 25, .nonleaf_size = 19, .leaf_size = 903, .rollback_size = 173, .cache_pressure_size = 413, .is_valid = TRUE },
-    { .size = 26, .nonleaf_size = 10, .leaf_size = 903, .rollback_size = 193, .cache_pressure_size = 423, .is_valid = TRUE },
-    { .size = 20, .nonleaf_size = 11, .leaf_size = 902, .rollback_size = 103, .cache_pressure_size = 433, .is_valid = TRUE },
-    { .size = 29, .nonleaf_size = 12, .leaf_size = 909, .rollback_size = 113, .cache_pressure_size = 443, .is_valid = TRUE }
+    { .size = 20, .nonleaf_size = 13, .leaf_size = 900, .rollback_size = 123, .cache_pressure_size = 403, .is_valid = true },
+    { .size = 21, .nonleaf_size = 16, .leaf_size = 910, .rollback_size = 113, .cache_pressure_size = 401, .is_valid = true },
+    { .size = 22, .nonleaf_size = 17, .leaf_size = 940, .rollback_size = 133, .cache_pressure_size = 402, .is_valid = true },
+    { .size = 23, .nonleaf_size = 18, .leaf_size = 931, .rollback_size = 153, .cache_pressure_size = 404, .is_valid = true },
+    { .size = 25, .nonleaf_size = 19, .leaf_size = 903, .rollback_size = 173, .cache_pressure_size = 413, .is_valid = true },
+    { .size = 26, .nonleaf_size = 10, .leaf_size = 903, .rollback_size = 193, .cache_pressure_size = 423, .is_valid = true },
+    { .size = 20, .nonleaf_size = 11, .leaf_size = 902, .rollback_size = 103, .cache_pressure_size = 433, .is_valid = true },
+    { .size = 29, .nonleaf_size = 12, .leaf_size = 909, .rollback_size = 113, .cache_pressure_size = 443, .is_valid = true }
 };
 const int n_pairs = (sizeof attrs) / (sizeof attrs[0]);
 
@@ -36,10 +36,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
     PAIR_ATTR *CAST_FROM_VOIDP(expect, e);
     if (!keep) {
@@ -87,7 +87,7 @@ run_test (void) {
                                         def_fetch,
                                         def_pf_req_callback,
                                         def_pf_callback,
-                                        TRUE, 
+                                        true, 
                                         &expect);
         assert_zero(r);
         r = toku_cachetable_unpin(f1, make_blocknum(i+1), i+1, CACHETABLE_DIRTY, attrs[i]);
@@ -112,7 +112,7 @@ run_test (void) {
                                     def_fetch,
                                     def_pf_req_callback,
                                     def_pf_callback,
-                                    TRUE, 
+                                    true, 
                                     &expect);
     toku_cachetable_unpin(f1, make_blocknum(n_pairs + 1), n_pairs + 1, CACHETABLE_CLEAN,
                           make_pair_attr(test_limit - expect.size + 20));
@@ -126,7 +126,7 @@ run_test (void) {
     assert(STATUS_VALUE(CT_SIZE_CACHEPRESSURE) == (uint64_t) expect.cache_pressure_size);
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 }
 
diff --git a/ft/tests/cachetable-cleaner-thread-empty-cachetable.cc b/ft/tests/cachetable-cleaner-thread-empty-cachetable.cc
index 159be01c2530f00e1f1ba7b52871c0dcf3839d10..5baaa4fa749df2a5149f54e4279635647f810f3e 100644
--- a/ft/tests/cachetable-cleaner-thread-empty-cachetable.cc
+++ b/ft/tests/cachetable-cleaner-thread-empty-cachetable.cc
@@ -34,7 +34,7 @@ cachetable_test (void) {
     assert(r==0);
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 }
 
diff --git a/ft/tests/cachetable-cleaner-thread-everything-pinned.cc b/ft/tests/cachetable-cleaner-thread-everything-pinned.cc
index 846ea591fba71c6745ce7b0942b85fdf3cc9c222..ad992cff73453ca4101f0c2e46078f3cd3571add 100644
--- a/ft/tests/cachetable-cleaner-thread-everything-pinned.cc
+++ b/ft/tests/cachetable-cleaner-thread-everything-pinned.cc
@@ -14,11 +14,11 @@ static int
 everything_pinned_cleaner_callback(
     void* UU(ftnode_pv),
     BLOCKNUM UU(blocknum),
-    u_int32_t UU(fullhash),
+    uint32_t UU(fullhash),
     void* UU(extraargs)
     )
 {
-    assert(FALSE);  // everything is pinned so this should never be called
+    assert(false);  // everything is pinned so this should never be called
     return 0;
 }
 
@@ -49,7 +49,7 @@ run_test (void) {
                                         def_fetch,
                                         def_pf_req_callback,
                                         def_pf_callback,
-                                        TRUE, 
+                                        true, 
                                         NULL);
         assert_zero(r);
     }
@@ -62,7 +62,7 @@ run_test (void) {
     }
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 }
 
diff --git a/ft/tests/cachetable-cleaner-thread-nothing-needs-flushing.cc b/ft/tests/cachetable-cleaner-thread-nothing-needs-flushing.cc
index 6d4579c0bcd06d9752ccf968da52308cb99f3cfa..ee4e7ed9c84ba98dd1346b53b1ced5adb4427b43 100644
--- a/ft/tests/cachetable-cleaner-thread-nothing-needs-flushing.cc
+++ b/ft/tests/cachetable-cleaner-thread-nothing-needs-flushing.cc
@@ -14,11 +14,11 @@ static UU() int
 everything_pinned_cleaner_callback(
     void* UU(ftnode_pv),
     BLOCKNUM UU(blocknum),
-    u_int32_t UU(fullhash),
+    uint32_t UU(fullhash),
     void* UU(extraargs)
     )
 {
-    assert(FALSE);  // everything is pinned so this should never be called
+    assert(false);  // everything is pinned so this should never be called
     return 0;
 }
 
@@ -47,7 +47,7 @@ run_test (void) {
                                         def_fetch,
                                         def_pf_req_callback,
                                         def_pf_callback,
-                                        TRUE, 
+                                        true, 
                                         NULL);
         assert_zero(r);
         // set cachepressure_size to 0
@@ -60,7 +60,7 @@ run_test (void) {
     usleep(4000000);
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 }
 
diff --git a/ft/tests/cachetable-cleaner-thread-simple.cc b/ft/tests/cachetable-cleaner-thread-simple.cc
index 77ebe1fde0a77c341ca774b9946bf32aa0e11301..e19fcef5b85329457080df5c0e1cf3eec7efaa7c 100644
--- a/ft/tests/cachetable-cleaner-thread-simple.cc
+++ b/ft/tests/cachetable-cleaner-thread-simple.cc
@@ -17,7 +17,7 @@ static int
 my_cleaner_callback(
     void* UU(ftnode_pv),
     BLOCKNUM UU(blocknum),
-    u_int32_t UU(fullhash),
+    uint32_t UU(fullhash),
     void* UU(extraargs)
     )
 {
@@ -37,7 +37,7 @@ run_test (void) {
     CACHETABLE ct;
     r = toku_create_cachetable(&ct, test_limit, ZERO_LSN, NULL_LOGGER); assert(r == 0);
     r = toku_set_cleaner_period(ct, 1); assert(r == 0);
-    my_cleaner_callback_called = FALSE;
+    my_cleaner_callback_called = false;
 
     char fname1[] = __SRCFILE__ "test1.dat";
     unlink(fname1);
@@ -54,7 +54,7 @@ run_test (void) {
                                     def_fetch,
                                     def_pf_req_callback,
                                     def_pf_callback,
-                                    TRUE, 
+                                    true, 
                                     NULL);
     PAIR_ATTR attr = make_pair_attr(8);
     attr.cache_pressure_size = 100;
@@ -66,7 +66,7 @@ run_test (void) {
                                         def_fetch,
                                         def_pf_req_callback,
                                         def_pf_callback,
-                                        TRUE, 
+                                        true, 
                                         NULL);
         assert_zero(r);
         // set cachepressure_size to 0
@@ -80,7 +80,7 @@ run_test (void) {
     assert(my_cleaner_callback_called);
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 );
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0 );
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 }
 
diff --git a/ft/tests/cachetable-clock-all-pinned.cc b/ft/tests/cachetable-clock-all-pinned.cc
index 3a7175d4af1fc11834b764c92362462fd8d29870..4a4edb7a3a71cf882248f4db8405b8f8e7497076 100644
--- a/ft/tests/cachetable-clock-all-pinned.cc
+++ b/ft/tests/cachetable-clock-all-pinned.cc
@@ -35,7 +35,7 @@ cachetable_test (void) {
     }
 
     
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 );
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0 );
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-clock-eviction.cc b/ft/tests/cachetable-clock-eviction.cc
index 23077dbd2277155cf7b670e0b394a14e84fafc69..5a43343be66837ab3eddb5104fc5ef2746a576e2 100644
--- a/ft/tests/cachetable-clock-eviction.cc
+++ b/ft/tests/cachetable-clock-eviction.cc
@@ -6,9 +6,9 @@
 #include "test.h"
 
 int num_entries;
-BOOL flush_may_occur;
+bool flush_may_occur;
 int expected_flushed_key;
-BOOL check_flush;
+bool check_flush;
 
 static void
 flush (CACHEFILE f __attribute__((__unused__)),
@@ -19,10 +19,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
     /* Do nothing */
     if (check_flush && !keep) {
@@ -38,7 +38,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -66,35 +66,35 @@ cachetable_test (void) {
     void* v1;
     void* v2;
     long s1, s2;
-    flush_may_occur = FALSE;
-    check_flush = TRUE;
+    flush_may_occur = false;
+    check_flush = true;
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = flush;
     for (int i = 0; i < 100000; i++) {
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
         r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(1));
     }
     for (int i = 0; i < 8; i++) {
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
         r = toku_cachetable_unpin(f1, make_blocknum(2), 2, CACHETABLE_CLEAN, make_pair_attr(1));
     }
     for (int i = 0; i < 4; i++) {
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(3), 3, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(3), 3, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
         r = toku_cachetable_unpin(f1, make_blocknum(3), 3, CACHETABLE_CLEAN, make_pair_attr(1));
     }
     for (int i = 0; i < 2; i++) {
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(4), 4, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(4), 4, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
         r = toku_cachetable_unpin(f1, make_blocknum(4), 4, CACHETABLE_CLEAN, make_pair_attr(1));
     }
-    flush_may_occur = TRUE;
+    flush_may_occur = true;
     expected_flushed_key = 4;
     r = toku_cachetable_put(f1, make_blocknum(5), 5, NULL, make_pair_attr(4), wc);
-    flush_may_occur = TRUE;
+    flush_may_occur = true;
     expected_flushed_key = 5;
     r = toku_cachetable_unpin(f1, make_blocknum(5), 5, CACHETABLE_CLEAN, make_pair_attr(4));
 
-    check_flush = FALSE;
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 );
+    check_flush = false;
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0 );
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-clock-eviction2.cc b/ft/tests/cachetable-clock-eviction2.cc
index 21bfe9da1798386e3a2702f98cd69c79d87afb7b..d062aef22126fd23669cd3e60199aee301507149 100644
--- a/ft/tests/cachetable-clock-eviction2.cc
+++ b/ft/tests/cachetable-clock-eviction2.cc
@@ -6,7 +6,7 @@
 #include "includes.h"
 #include "test.h"
 
-BOOL flush_may_occur;
+bool flush_may_occur;
 long expected_bytes_to_free;
 
 static void
@@ -18,10 +18,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep,
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep,
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
     assert(flush_may_occur);
     if (!keep) {
@@ -35,7 +35,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -59,10 +59,10 @@ other_flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
 }
 
@@ -107,47 +107,47 @@ cachetable_test (void) {
     void* v1;
     void* v2;
     long s1, s2;
-    flush_may_occur = FALSE;
+    flush_may_occur = false;
     for (int i = 0; i < 100000; i++) {
       CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
       wc.flush_callback = flush;
       wc.pe_callback = pe_callback;
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
       r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(4));
     }
     for (int i = 0; i < 8; i++) {
       CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
       wc.flush_callback = flush;
       wc.pe_callback = pe_callback;
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
       r = toku_cachetable_unpin(f1, make_blocknum(2), 2, CACHETABLE_CLEAN, make_pair_attr(4));
     }
     for (int i = 0; i < 4; i++) {
       CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
       wc.flush_callback = flush;
       wc.pe_callback = pe_callback;
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(3), 3, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(3), 3, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
       r = toku_cachetable_unpin(f1, make_blocknum(3), 3, CACHETABLE_CLEAN, make_pair_attr(4));
     }
     for (int i = 0; i < 2; i++) {
       CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
       wc.flush_callback = flush;
       wc.pe_callback = pe_callback;
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(4), 4, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(4), 4, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
       r = toku_cachetable_unpin(f1, make_blocknum(4), 4, CACHETABLE_CLEAN, make_pair_attr(4));
     }
-    flush_may_occur = FALSE;
+    flush_may_occur = false;
     expected_bytes_to_free = 4;
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = other_flush;
     wc.pe_callback = other_pe_callback;
     r = toku_cachetable_put(f1, make_blocknum(5), 5, NULL, make_pair_attr(4), wc);
-    flush_may_occur = TRUE;
+    flush_may_occur = true;
     r = toku_cachetable_unpin(f1, make_blocknum(5), 5, CACHETABLE_CLEAN, make_pair_attr(4));
     assert(expected_bytes_to_free == 0);
 
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-clock-eviction3.cc b/ft/tests/cachetable-clock-eviction3.cc
index ac734791f9d5ad76f02ae3cfdeee6e8cf82a2984..5814a3aa5c91e7ce82ebbf3053835ff6bad58898 100644
--- a/ft/tests/cachetable-clock-eviction3.cc
+++ b/ft/tests/cachetable-clock-eviction3.cc
@@ -6,7 +6,7 @@
 #include "includes.h"
 #include "test.h"
 
-BOOL flush_may_occur;
+bool flush_may_occur;
 long expected_bytes_to_free;
 
 static void
@@ -18,10 +18,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep,
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep,
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
     assert(flush_may_occur);
     if (!keep) {
@@ -35,7 +35,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -59,10 +59,10 @@ other_flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
 }
 
@@ -122,13 +122,13 @@ cachetable_test (void) {
     void* v1;
     void* v2;
     long s1, s2;
-    flush_may_occur = FALSE;
+    flush_may_occur = false;
     for (int i = 0; i < 100000; i++) {
       CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
       wc.flush_callback = flush;
       wc.pe_est_callback = pe_est_callback;
       wc.pe_callback = pe_callback;
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
       r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(4));
     }
     for (int i = 0; i < 8; i++) {
@@ -136,7 +136,7 @@ cachetable_test (void) {
       wc.flush_callback = flush;
       wc.pe_est_callback = pe_est_callback;
       wc.pe_callback = pe_callback;
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
       r = toku_cachetable_unpin(f1, make_blocknum(2), 2, CACHETABLE_CLEAN, make_pair_attr(4));
     }
     for (int i = 0; i < 4; i++) {
@@ -144,7 +144,7 @@ cachetable_test (void) {
       wc.flush_callback = flush;
       wc.pe_est_callback = pe_est_callback;
       wc.pe_callback = pe_callback;
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(3), 3, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(3), 3, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
       r = toku_cachetable_unpin(f1, make_blocknum(3), 3, CACHETABLE_CLEAN, make_pair_attr(4));
     }
     for (int i = 0; i < 2; i++) {
@@ -152,17 +152,17 @@ cachetable_test (void) {
       wc.flush_callback = flush;
       wc.pe_est_callback = pe_est_callback;
       wc.pe_callback = pe_callback;
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(4), 4, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(4), 4, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
       r = toku_cachetable_unpin(f1, make_blocknum(4), 4, CACHETABLE_CLEAN, make_pair_attr(4));
     }
-    flush_may_occur = FALSE;
+    flush_may_occur = false;
     expected_bytes_to_free = 4;
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = other_flush;
     wc.pe_est_callback = pe_est_callback;
     wc.pe_callback = other_pe_callback;
     r = toku_cachetable_put(f1, make_blocknum(5), 5, NULL, make_pair_attr(4), wc);
-    flush_may_occur = TRUE;
+    flush_may_occur = true;
     r = toku_cachetable_unpin(f1, make_blocknum(5), 5, CACHETABLE_CLEAN, make_pair_attr(8));
 
     // we are testing that having a wildly different estimate than
@@ -175,7 +175,7 @@ cachetable_test (void) {
     assert(expected_bytes_to_free == 3);
 
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-clock-eviction4.cc b/ft/tests/cachetable-clock-eviction4.cc
index 8e4b2b5e9f3630b3899e45a01284877c5e7b4d36..00643945670139db524bb1ba411288ad52147580 100644
--- a/ft/tests/cachetable-clock-eviction4.cc
+++ b/ft/tests/cachetable-clock-eviction4.cc
@@ -6,16 +6,16 @@
 #include "test.h"
 
 int num_entries;
-BOOL flush_may_occur;
+bool flush_may_occur;
 int expected_flushed_key;
-BOOL check_flush;
+bool check_flush;
 
 
 //
 // This test verifies that if partial eviction is expensive and
 // does not estimate number of freed bytes to be greater than 0,
 // then partial eviction is not called, and normal eviction
-// is used. The verification is done ia an assert(FALSE) in 
+// is used. The verification is done ia an assert(false) in 
 // pe_callback.
 //
 
@@ -29,10 +29,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
     /* Do nothing */
     if (check_flush && !keep) {
@@ -48,7 +48,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -82,7 +82,7 @@ pe_callback (
     void* extraargs __attribute__((__unused__))
     ) 
 {
-    assert(FALSE);
+    assert(false);
     *bytes_freed = bytes_to_free;
     return 0;
 }
@@ -103,37 +103,37 @@ cachetable_test (void) {
     void* v1;
     void* v2;
     long s1, s2;
-    flush_may_occur = FALSE;
-    check_flush = TRUE;
+    flush_may_occur = false;
+    check_flush = true;
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = flush;
     wc.pe_est_callback = pe_est_callback;
     wc.pe_callback = pe_callback;
     for (int i = 0; i < 100000; i++) {
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
         r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(1));
     }
     for (int i = 0; i < 8; i++) {
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
         r = toku_cachetable_unpin(f1, make_blocknum(2), 2, CACHETABLE_CLEAN, make_pair_attr(1));
     }
     for (int i = 0; i < 4; i++) {
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(3), 3, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(3), 3, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
         r = toku_cachetable_unpin(f1, make_blocknum(3), 3, CACHETABLE_CLEAN, make_pair_attr(1));
     }
     for (int i = 0; i < 2; i++) {
-      r = toku_cachetable_get_and_pin(f1, make_blocknum(4), 4, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+      r = toku_cachetable_get_and_pin(f1, make_blocknum(4), 4, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, NULL);
         r = toku_cachetable_unpin(f1, make_blocknum(4), 4, CACHETABLE_CLEAN, make_pair_attr(1));
     }
-    flush_may_occur = TRUE;
+    flush_may_occur = true;
     expected_flushed_key = 4;
     r = toku_cachetable_put(f1, make_blocknum(5), 5, NULL, make_pair_attr(4), wc);
-    flush_may_occur = TRUE;
+    flush_may_occur = true;
     expected_flushed_key = 5;
     r = toku_cachetable_unpin(f1, make_blocknum(5), 5, CACHETABLE_CLEAN, make_pair_attr(4));
 
-    check_flush = FALSE;
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 );
+    check_flush = false;
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0 );
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-clone-checkpoint.cc b/ft/tests/cachetable-clone-checkpoint.cc
index e8058b134f837f81a3537b7fb992c78a775e7494..ff2a69a2a9a4c154ead275109464967c6a43b6b4 100644
--- a/ft/tests/cachetable-clone-checkpoint.cc
+++ b/ft/tests/cachetable-clone-checkpoint.cc
@@ -7,14 +7,14 @@
 
 
 static void 
-clone_callback(void* UU(value_data), void** cloned_value_data, PAIR_ATTR* new_attr, BOOL UU(for_checkpoint), void* UU(write_extraargs))
+clone_callback(void* UU(value_data), void** cloned_value_data, PAIR_ATTR* new_attr, bool UU(for_checkpoint), void* UU(write_extraargs))
 {
     *cloned_value_data = (void *)1;
-    new_attr->is_valid = FALSE;
+    new_attr->is_valid = false;
 }
 
-BOOL clone_flush_started;
-BOOL clone_flush_completed;
+bool clone_flush_started;
+bool clone_flush_completed;
 CACHETABLE ct;
 
 static void
@@ -27,16 +27,16 @@ flush (
     void *e     __attribute__((__unused__)),
     PAIR_ATTR s      __attribute__((__unused__)),
     PAIR_ATTR* new_size      __attribute__((__unused__)),
-    BOOL w      __attribute__((__unused__)),
-    BOOL keep   __attribute__((__unused__)),
-    BOOL c      __attribute__((__unused__)),
-    BOOL is_clone
+    bool w      __attribute__((__unused__)),
+    bool keep   __attribute__((__unused__)),
+    bool c      __attribute__((__unused__)),
+    bool is_clone
     ) 
 {  
     if (is_clone) {
-        clone_flush_started = TRUE;
+        clone_flush_started = true;
         usleep(4*1024*1024);
-        clone_flush_completed = TRUE;
+        clone_flush_completed = true;
     }
 }
 
@@ -70,22 +70,22 @@ cachetable_test (void) {
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = flush;
     wc.clone_callback = clone_callback;
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     assert_zero(r);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8));
     assert_zero(r);
     r = toku_cachetable_begin_checkpoint(ct, NULL);
 
 
-    clone_flush_started = FALSE;
-    clone_flush_completed = FALSE;
+    clone_flush_started = false;
+    clone_flush_completed = false;
     toku_pthread_t checkpoint_tid;
     r = toku_pthread_create(&checkpoint_tid, NULL, run_end_checkpoint, NULL); 
     assert_zero(r);    
 
     usleep(1*1024*1024);
 
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     assert_zero(r);
     assert(clone_flush_started && !clone_flush_completed);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
@@ -97,7 +97,7 @@ cachetable_test (void) {
     assert(clone_flush_started && clone_flush_completed);
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 }
 
diff --git a/ft/tests/cachetable-clone-partial-fetch-pinned-node.cc b/ft/tests/cachetable-clone-partial-fetch-pinned-node.cc
index 41183da6916004ef0585e3c6197b78441e0ffd7d..dc64626782604be73c948b1031bf5e0c9a6f54c7 100644
--- a/ft/tests/cachetable-clone-partial-fetch-pinned-node.cc
+++ b/ft/tests/cachetable-clone-partial-fetch-pinned-node.cc
@@ -6,14 +6,14 @@
 #include "test.h"
 
 
-BOOL flush_completed;
-BOOL pf_called;
+bool flush_completed;
+bool pf_called;
 
 static void 
-clone_callback(void* UU(value_data), void** cloned_value_data, PAIR_ATTR* new_attr, BOOL UU(for_checkpoint), void* UU(write_extraargs))
+clone_callback(void* UU(value_data), void** cloned_value_data, PAIR_ATTR* new_attr, bool UU(for_checkpoint), void* UU(write_extraargs))
 {
     *cloned_value_data = (void *)1;
-    new_attr->is_valid = FALSE;
+    new_attr->is_valid = false;
 }
 
 static void
@@ -26,21 +26,21 @@ flush (
     void *e     __attribute__((__unused__)),
     PAIR_ATTR s      __attribute__((__unused__)),
     PAIR_ATTR* new_size      __attribute__((__unused__)),
-    BOOL w      __attribute__((__unused__)),
-    BOOL keep   __attribute__((__unused__)),
-    BOOL c      __attribute__((__unused__)),
-    BOOL UU(is_clone)
+    bool w      __attribute__((__unused__)),
+    bool keep   __attribute__((__unused__)),
+    bool c      __attribute__((__unused__)),
+    bool UU(is_clone)
     ) 
 {  
     if (is_clone) {
         usleep(2*1024*1024);
-        flush_completed = TRUE;
+        flush_completed = true;
     }
 }
 
 static int true_pf_callback(void* UU(ftnode_pv), void* UU(dd), void* UU(read_extraargs), int UU(fd), PAIR_ATTR* sizep) {
     assert(flush_completed);
-    pf_called = TRUE;
+    pf_called = true;
     *sizep = make_pair_attr(9);
     return 0;
 }
@@ -65,21 +65,21 @@ cachetable_test (void) {
     wc.clone_callback = clone_callback;
     wc.flush_callback = flush;
     
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     assert_zero(r);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8));
     assert_zero(r);
 
-    flush_completed = FALSE;
+    flush_completed = false;
     r = toku_cachetable_begin_checkpoint(ct, NULL); assert_zero(r);
     assert_zero(r);
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     assert_zero(r);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
     assert_zero(r);
 
-    pf_called = FALSE;
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    pf_called = false;
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     assert_zero(r);
     assert(!pf_called);
     toku_cachetable_pf_pinned_pair(v1, true_pf_callback, NULL, f1, make_blocknum(1), 1);
@@ -99,7 +99,7 @@ cachetable_test (void) {
 
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
diff --git a/ft/tests/cachetable-clone-partial-fetch.cc b/ft/tests/cachetable-clone-partial-fetch.cc
index 8885ea144a46af619b066580dc890db23d5b199e..21a8463b0cad5143084986447bcdbba7f5db4b23 100644
--- a/ft/tests/cachetable-clone-partial-fetch.cc
+++ b/ft/tests/cachetable-clone-partial-fetch.cc
@@ -6,14 +6,14 @@
 #include "test.h"
 
 
-BOOL flush_completed;
-BOOL pf_called;
+bool flush_completed;
+bool pf_called;
 
 static void 
-clone_callback(void* UU(value_data), void** cloned_value_data, PAIR_ATTR* new_attr, BOOL UU(for_checkpoint), void* UU(write_extraargs))
+clone_callback(void* UU(value_data), void** cloned_value_data, PAIR_ATTR* new_attr, bool UU(for_checkpoint), void* UU(write_extraargs))
 {
     *cloned_value_data = (void *)1;
-    new_attr->is_valid = FALSE;
+    new_attr->is_valid = false;
 }
 
 static void
@@ -26,25 +26,25 @@ flush (
     void *e     __attribute__((__unused__)),
     PAIR_ATTR s      __attribute__((__unused__)),
     PAIR_ATTR* new_size      __attribute__((__unused__)),
-    BOOL w      __attribute__((__unused__)),
-    BOOL keep   __attribute__((__unused__)),
-    BOOL c      __attribute__((__unused__)),
-    BOOL UU(is_clone)
+    bool w      __attribute__((__unused__)),
+    bool keep   __attribute__((__unused__)),
+    bool c      __attribute__((__unused__)),
+    bool UU(is_clone)
     ) 
 {  
     if (is_clone) {
         usleep(2*1024*1024);
-        flush_completed = TRUE;
+        flush_completed = true;
     }
 }
 
-static BOOL true_pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
-  return TRUE;
+static bool true_pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
+  return true;
 }
 
 static int true_pf_callback(void* UU(ftnode_pv), void* UU(dd), void* UU(read_extraargs), int UU(fd), PAIR_ATTR* sizep) {
     assert(flush_completed);
-    pf_called = TRUE;
+    pf_called = true;
     *sizep = make_pair_attr(9);
     return 0;
 }
@@ -69,21 +69,21 @@ cachetable_test (void) {
     wc.clone_callback = clone_callback;
     wc.flush_callback = flush;
     
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     assert_zero(r);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8));
     assert_zero(r);
 
-    flush_completed = FALSE;
+    flush_completed = false;
     r = toku_cachetable_begin_checkpoint(ct, NULL); assert_zero(r);
     assert_zero(r);
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     assert_zero(r);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
     assert_zero(r);
 
-    pf_called = FALSE;
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, true_pf_req_callback, true_pf_callback, TRUE, NULL);
+    pf_called = false;
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, true_pf_req_callback, true_pf_callback, true, NULL);
     assert_zero(r);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
     assert_zero(r);
@@ -99,7 +99,7 @@ cachetable_test (void) {
 
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
diff --git a/ft/tests/cachetable-clone-pin-nonblocking.cc b/ft/tests/cachetable-clone-pin-nonblocking.cc
index e5dc30d33e609b883e69f327dc0fc47ed2548cd7..7f54c2051146b4344fd5d84b731f0e4c1ed9f646 100644
--- a/ft/tests/cachetable-clone-pin-nonblocking.cc
+++ b/ft/tests/cachetable-clone-pin-nonblocking.cc
@@ -6,10 +6,10 @@
 #include "test.h"
 
 static void 
-clone_callback(void* UU(value_data), void** cloned_value_data, PAIR_ATTR* new_attr, BOOL UU(for_checkpoint), void* UU(write_extraargs))
+clone_callback(void* UU(value_data), void** cloned_value_data, PAIR_ATTR* new_attr, bool UU(for_checkpoint), void* UU(write_extraargs))
 {
     *cloned_value_data = (void *)1;
-    new_attr->is_valid = FALSE;
+    new_attr->is_valid = false;
 }
 
 static void
@@ -22,10 +22,10 @@ flush (
     void *e     __attribute__((__unused__)),
     PAIR_ATTR s      __attribute__((__unused__)),
     PAIR_ATTR* new_size      __attribute__((__unused__)),
-    BOOL w      __attribute__((__unused__)),
-    BOOL keep   __attribute__((__unused__)),
-    BOOL c      __attribute__((__unused__)),
-    BOOL UU(is_clone)
+    bool w      __attribute__((__unused__)),
+    bool keep   __attribute__((__unused__)),
+    bool c      __attribute__((__unused__)),
+    bool UU(is_clone)
     ) 
 {  
 }
@@ -34,7 +34,7 @@ flush (
 // this test verifies that a partial fetch will wait for a cloned pair to complete
 // writing to disk
 static void
-cachetable_test (enum cachetable_dirty dirty, BOOL cloneable) {
+cachetable_test (enum cachetable_dirty dirty, bool cloneable) {
     const int test_limit = 12;
     int r;
     CACHETABLE ct;
@@ -50,17 +50,17 @@ cachetable_test (enum cachetable_dirty dirty, BOOL cloneable) {
     wc.clone_callback = cloneable ? clone_callback : NULL;
     wc.flush_callback = flush;
     
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, dirty, make_pair_attr(8));
 
-    // test that having a pin that passes FALSE for may_modify_value does not stall behind checkpoint
+    // test that having a pin that passes false for may_modify_value does not stall behind checkpoint
     r = toku_cachetable_begin_checkpoint(ct, NULL); assert_zero(r);
-    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, FALSE, NULL, NULL);
+    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, false, NULL, NULL);
     assert(r == 0);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
     assert(r == 0);
 
-    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL, NULL);
+    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL, NULL);
     if (dirty == CACHETABLE_DIRTY && !cloneable) {
         assert(r == TOKUDB_TRY_AGAIN);
     }
@@ -79,7 +79,7 @@ cachetable_test (enum cachetable_dirty dirty, BOOL cloneable) {
 
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
@@ -88,9 +88,9 @@ cachetable_test (enum cachetable_dirty dirty, BOOL cloneable) {
 int
 test_main(int argc, const char *argv[]) {
   default_parse_args(argc, argv);
-  cachetable_test(CACHETABLE_DIRTY, TRUE);
-  cachetable_test(CACHETABLE_DIRTY, FALSE);
-  cachetable_test(CACHETABLE_CLEAN, TRUE);
-  cachetable_test(CACHETABLE_CLEAN, FALSE);
+  cachetable_test(CACHETABLE_DIRTY, true);
+  cachetable_test(CACHETABLE_DIRTY, false);
+  cachetable_test(CACHETABLE_CLEAN, true);
+  cachetable_test(CACHETABLE_CLEAN, false);
   return 0;
 }
diff --git a/ft/tests/cachetable-clone-unpin-remove.cc b/ft/tests/cachetable-clone-unpin-remove.cc
index 557b643df4369d15cd5d8a0886ddee76cb34185f..4218f54fa83206e9c412fcc189492896e06b7ddf 100644
--- a/ft/tests/cachetable-clone-unpin-remove.cc
+++ b/ft/tests/cachetable-clone-unpin-remove.cc
@@ -6,14 +6,14 @@
 #include "test.h"
 
 
-BOOL flush_completed;
-BOOL evict_called;
+bool flush_completed;
+bool evict_called;
 
 static void 
-clone_callback(void* UU(value_data), void** cloned_value_data, PAIR_ATTR* new_attr, BOOL UU(for_checkpoint), void* UU(write_extraargs))
+clone_callback(void* UU(value_data), void** cloned_value_data, PAIR_ATTR* new_attr, bool UU(for_checkpoint), void* UU(write_extraargs))
 {
     *cloned_value_data = (void *)1;
-    new_attr->is_valid = FALSE;
+    new_attr->is_valid = false;
 }
 
 static void
@@ -26,19 +26,19 @@ flush (
     void *e     __attribute__((__unused__)),
     PAIR_ATTR s      __attribute__((__unused__)),
     PAIR_ATTR* new_size      __attribute__((__unused__)),
-    BOOL w      __attribute__((__unused__)),
-    BOOL keep   __attribute__((__unused__)),
-    BOOL c      __attribute__((__unused__)),
-    BOOL UU(is_clone)
+    bool w      __attribute__((__unused__)),
+    bool keep   __attribute__((__unused__)),
+    bool c      __attribute__((__unused__)),
+    bool UU(is_clone)
     ) 
 {  
     if (is_clone) {
         usleep(2*1024*1024);
-        flush_completed = TRUE;
+        flush_completed = true;
     }
     else if (!keep && !is_clone) {
         assert(flush_completed);
-        evict_called = TRUE;
+        evict_called = true;
     }
 }
 
@@ -63,16 +63,16 @@ cachetable_test (void) {
     wc.clone_callback = clone_callback;
     wc.flush_callback = flush;
     
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     assert_zero(r);
     r = toku_cachetable_unpin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), CACHETABLE_DIRTY, make_pair_attr(8));
     assert_zero(r);
 
-    flush_completed = FALSE;
-    evict_called = FALSE;
+    flush_completed = false;
+    evict_called = false;
     r = toku_cachetable_begin_checkpoint(ct, NULL); assert_zero(r);
     assert_zero(r);
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     assert_zero(r);
     r = toku_cachetable_unpin_and_remove(f1, make_blocknum(1), NULL, NULL);
     assert_zero(r);
@@ -88,7 +88,7 @@ cachetable_test (void) {
 
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
diff --git a/ft/tests/cachetable-count-pinned-test.cc b/ft/tests/cachetable-count-pinned-test.cc
index 96f7175aae63857068dd82389fbbc09a403a2846..97315a762c8bba98ba998e5ea26ef9d04f1f3a11 100644
--- a/ft/tests/cachetable-count-pinned-test.cc
+++ b/ft/tests/cachetable-count-pinned-test.cc
@@ -20,7 +20,7 @@ cachetable_count_pinned_test (int n) {
 
     int i;
     for (i=1; i<=n; i++) {
-        u_int32_t hi;
+        uint32_t hi;
         hi = toku_cachetable_hash(f1, make_blocknum(i));
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
         r = toku_cachetable_put(f1, make_blocknum(i), hi, (void *)(long)i, make_pair_attr(1), wc);
@@ -37,7 +37,7 @@ cachetable_count_pinned_test (int n) {
         assert(toku_cachefile_count_pinned(f1, 0) == i);
     }
     for (i=n; i>0; i--) {
-        u_int32_t hi;
+        uint32_t hi;
         hi = toku_cachetable_hash(f1, make_blocknum(i));
         r = toku_cachetable_unpin(f1, make_blocknum(i), hi, CACHETABLE_CLEAN, make_pair_attr(1));
         assert(r == 0);
@@ -48,7 +48,7 @@ cachetable_count_pinned_test (int n) {
     assert(toku_cachefile_count_pinned(f1, 1) == 0);
     toku_cachetable_verify(ct);
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-debug-test.cc b/ft/tests/cachetable-debug-test.cc
index 7a55d6fa5f66f2a4501d7a71ed735840b4eb9074..894be442d9d17a1f77a5c2deeb35c044c04dda75 100644
--- a/ft/tests/cachetable-debug-test.cc
+++ b/ft/tests/cachetable-debug-test.cc
@@ -27,7 +27,7 @@ cachetable_debug_test (int n) {
     int i;
     for (i=1; i<=n; i++) {
         const int item_size = 1;
-        u_int32_t hi;
+        uint32_t hi;
         hi = toku_cachetable_hash(f1, make_blocknum(i));
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
         r = toku_cachetable_put(f1, make_blocknum(i), hi, (void *)(long)i, make_pair_attr(item_size), wc);
@@ -53,7 +53,7 @@ cachetable_debug_test (int n) {
     }
     toku_cachetable_verify(ct);
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-eviction-close-test.cc b/ft/tests/cachetable-eviction-close-test.cc
index 8fbd896f943ef9ec87545698386fdcd8cbc71141..b76076b39f3f0dec7ddec2133ee965e2c5ac8e74 100644
--- a/ft/tests/cachetable-eviction-close-test.cc
+++ b/ft/tests/cachetable-eviction-close-test.cc
@@ -7,9 +7,9 @@
 #include "includes.h"
 #include "test.h"
 
-BOOL check_flush;
-BOOL expect_full_flush;
-BOOL expect_pe;
+bool check_flush;
+bool expect_full_flush;
+bool expect_pe;
 
 static void
 flush (CACHEFILE f __attribute__((__unused__)),
@@ -20,10 +20,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
     assert(expect_full_flush);
     sleep(2);
@@ -35,7 +35,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -76,7 +76,7 @@ static void cachetable_eviction_full_test (void) {
     r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
 
     CACHEKEY key = make_blocknum(0);
-    u_int32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
+    uint32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
 
     void* value1;
     long size1;
@@ -100,14 +100,14 @@ static void cachetable_eviction_full_test (void) {
             fetch,
             def_pf_req_callback,
             def_pf_callback,
-            TRUE, 
+            true, 
             0
             );
         assert(r==0);
         r = toku_cachetable_unpin(f1, key, fullhash, CACHETABLE_DIRTY, make_pair_attr(1));
         assert(r == 0);
     }
-    expect_full_flush = TRUE;
+    expect_full_flush = true;
     // now pin a different, causing an eviction
     wc.flush_callback = def_flush;
     wc.pe_est_callback = pe_est_callback;
@@ -121,7 +121,7 @@ static void cachetable_eviction_full_test (void) {
         fetch,
         def_pf_req_callback,
         def_pf_callback,
-        TRUE, 
+        true, 
         0
         );
     assert(r==0);
@@ -131,7 +131,7 @@ static void cachetable_eviction_full_test (void) {
 
     // close with the eviction in progress. the close should block until
     // all of the reads and writes are complete.
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-eviction-close-test2.cc b/ft/tests/cachetable-eviction-close-test2.cc
index 0e14a5f75ea242dfad91201cbc5bff6ab83b0dcd..c1350f54faa5a5702239b97e87e29d837cd2a4d0 100644
--- a/ft/tests/cachetable-eviction-close-test2.cc
+++ b/ft/tests/cachetable-eviction-close-test2.cc
@@ -7,9 +7,9 @@
 #include "includes.h"
 #include "test.h"
 
-BOOL check_flush;
-BOOL expect_full_flush;
-BOOL expect_pe;
+bool check_flush;
+bool expect_full_flush;
+bool expect_pe;
 
 static void
 flush (CACHEFILE f __attribute__((__unused__)),
@@ -20,10 +20,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
     assert(expect_full_flush);
 }
@@ -34,7 +34,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -88,7 +88,7 @@ static void cachetable_eviction_full_test (void) {
     r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
 
     CACHEKEY key = make_blocknum(0);
-    u_int32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
+    uint32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
 
     void* value1;
     long size1;
@@ -113,14 +113,14 @@ static void cachetable_eviction_full_test (void) {
             fetch,
             def_pf_req_callback,
             def_pf_callback,
-            TRUE, 
+            true, 
             0
             );
         assert(r==0);
         r = toku_cachetable_unpin(f1, key, fullhash, CACHETABLE_DIRTY, make_pair_attr(8));
         assert(r == 0);
     }
-    expect_full_flush = TRUE;
+    expect_full_flush = true;
     // now pin a different, causing an eviction
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.pe_est_callback = pe_est_callback;
@@ -135,7 +135,7 @@ static void cachetable_eviction_full_test (void) {
         fetch,
         def_pf_req_callback,
         def_pf_callback,
-        TRUE, 
+        true, 
         0
         );
     assert(r==0);
@@ -145,7 +145,7 @@ static void cachetable_eviction_full_test (void) {
 
     // close with the eviction in progress. the close should block until
     // all of the reads and writes are complete.
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-eviction-getandpin-test.cc b/ft/tests/cachetable-eviction-getandpin-test.cc
index 16384d70407eb5bc2f47179875b054d4c6992d26..bb2de643a71696d7e85be09b0f1562a5e1a80672 100644
--- a/ft/tests/cachetable-eviction-getandpin-test.cc
+++ b/ft/tests/cachetable-eviction-getandpin-test.cc
@@ -7,7 +7,7 @@
 #include "includes.h"
 #include "test.h"
 
-BOOL do_sleep;
+bool do_sleep;
 
 static void
 flush (CACHEFILE f __attribute__((__unused__)),
@@ -18,10 +18,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
     if (do_sleep) {
         sleep(2);
@@ -44,7 +44,7 @@ static void cachetable_predef_fetch_maybegetandpin_test (void) {
     CACHEFILE f1;
     r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
     CACHEKEY key = make_blocknum(0);
-    u_int32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
+    uint32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
 
     // let's get and pin this node a bunch of times to drive up the clock count
     for (int i = 0; i < 20; i++) {
@@ -62,7 +62,7 @@ static void cachetable_predef_fetch_maybegetandpin_test (void) {
             def_fetch,
             def_pf_req_callback,
             def_pf_callback,
-            TRUE, 
+            true, 
             0
             );
         assert(r==0);
@@ -73,7 +73,7 @@ static void cachetable_predef_fetch_maybegetandpin_test (void) {
     gettimeofday(&tstart, NULL);
 
     // def_fetch another block, causing an eviction of the first block we made above
-    do_sleep = TRUE;
+    do_sleep = true;
     void* value2;
     long size2;
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
@@ -87,7 +87,7 @@ static void cachetable_predef_fetch_maybegetandpin_test (void) {
         def_fetch,
         def_pf_req_callback,
         def_pf_callback,
-        TRUE, 
+        true, 
         0
         );
     assert(r==0);
@@ -100,11 +100,11 @@ static void cachetable_predef_fetch_maybegetandpin_test (void) {
     // now verify that the block we are trying to evict may be pinned
     wc = def_write_callback(NULL);
     wc.flush_callback = flush;
-    r = toku_cachetable_get_and_pin_nonblocking(f1, key, fullhash, &v, &size, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL, NULL);
+    r = toku_cachetable_get_and_pin_nonblocking(f1, key, fullhash, &v, &size, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL, NULL);
     assert(r == TOKUDB_TRY_AGAIN);
-    r = toku_cachetable_get_and_pin(f1, key, fullhash, &v, &size, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, key, fullhash, &v, &size, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     assert(r == 0 && v == 0 && size == 8);
-    do_sleep = FALSE;
+    do_sleep = false;
 
     struct timeval tend; 
     gettimeofday(&tend, NULL);
@@ -117,7 +117,7 @@ static void cachetable_predef_fetch_maybegetandpin_test (void) {
     assert(r == 0);
     toku_cachetable_verify(ct);
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-eviction-getandpin-test2.cc b/ft/tests/cachetable-eviction-getandpin-test2.cc
index bf8b689acdbbf4df7f68c614ff760a8c70ef71c4..66f3ee3662b2361111b8abdef90bc4682b81ce01 100644
--- a/ft/tests/cachetable-eviction-getandpin-test2.cc
+++ b/ft/tests/cachetable-eviction-getandpin-test2.cc
@@ -50,7 +50,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
     CACHEFILE f1;
     r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
     CACHEKEY key = make_blocknum(0);
-    u_int32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
+    uint32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
 
     // let's get and pin this node a bunch of times to drive up the clock count
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
@@ -69,7 +69,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
             def_fetch,
             def_pf_req_callback,
             def_pf_callback,
-            TRUE, 
+            true, 
             0
             );
         assert(r==0);
@@ -92,7 +92,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
         def_fetch,
         def_pf_req_callback,
         def_pf_callback,
-        TRUE, 
+        true, 
         0
         );
     assert(r==0);
@@ -113,7 +113,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
         def_fetch, 
         def_pf_req_callback, 
         def_pf_callback, 
-        TRUE,
+        true,
         NULL, 
         NULL
         );
@@ -128,7 +128,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
         def_fetch, 
         def_pf_req_callback, 
         def_pf_callback, 
-        TRUE, 
+        true, 
         NULL
         );
     assert(r == 0 && v == 0 && size == 1);
@@ -144,7 +144,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
     assert(r == 0);
     toku_cachetable_verify(ct);
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-fd-test.cc b/ft/tests/cachetable-fd-test.cc
index 6912ecfbf77342ae2d8719e674c8a0dc926b0423..e4a6bbcac37c9a75fd33e9efa69bc08b53814a98 100644
--- a/ft/tests/cachetable-fd-test.cc
+++ b/ft/tests/cachetable-fd-test.cc
@@ -44,7 +44,7 @@ cachetable_fd_test (void) {
     r = toku_cachefile_of_filenum(ct, fn, &newcf);
     assert(r == ENOENT);
 
-    r = toku_cachefile_close(&cf, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&cf, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-flush-during-cleaner.cc b/ft/tests/cachetable-flush-during-cleaner.cc
index 95932a768aad4066c4563b2928994c14c9a5d5e5..83482e8a68479a46202f3cb53c15c8b962c298ab 100644
--- a/ft/tests/cachetable-flush-during-cleaner.cc
+++ b/ft/tests/cachetable-flush-during-cleaner.cc
@@ -11,7 +11,7 @@ static int
 cleaner_callback(
     void* UU(ftnode_pv),
     BLOCKNUM blocknum,
-    u_int32_t fullhash,
+    uint32_t fullhash,
     void* UU(extraargs)
     )
 {
@@ -40,14 +40,14 @@ cachetable_test (void) {
       for (int i = 0; i < 10; i++) {
           CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
           wc.cleaner_callback = cleaner_callback;
-          r = toku_cachetable_get_and_pin(f1, make_blocknum(i), i, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+          r = toku_cachetable_get_and_pin(f1, make_blocknum(i), i, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
           r = toku_cachetable_unpin(f1, make_blocknum(i), i, CACHETABLE_DIRTY, make_pair_attr(8));
       }
       r = toku_cachefile_flush(f1);
       assert(r == 0);
   }
   toku_cachetable_verify(ct);
-  r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+  r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
   r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
diff --git a/ft/tests/cachetable-flush-test.cc b/ft/tests/cachetable-flush-test.cc
index ad2bf2346c7a4c0177b10af075706610f9709a09..1861a01933bead812d19b80b5a484235e0e0140f 100644
--- a/ft/tests/cachetable-flush-test.cc
+++ b/ft/tests/cachetable-flush-test.cc
@@ -26,7 +26,7 @@ test_cachetable_def_flush (int n) {
     // insert keys 0..n-1 
     int i;
     for (i=0; i<n; i++) {
-        u_int32_t hi;
+        uint32_t hi;
         hi = toku_cachetable_hash(f1, make_blocknum(i));
         r = toku_cachetable_put(f1, make_blocknum(i), hi, (void *)(long)i, make_pair_attr(1), wc);
         assert(r == 0);
@@ -42,7 +42,7 @@ test_cachetable_def_flush (int n) {
 
     // verify keys exists
     for (i=0; i<n; i++) {
-        u_int32_t hi;
+        uint32_t hi;
         void *v;
         hi = toku_cachetable_hash(f1, make_blocknum(i));
         r = toku_cachetable_maybe_get_and_pin(f1, make_blocknum(i), hi, &v);
@@ -62,7 +62,7 @@ test_cachetable_def_flush (int n) {
 
     // verify keys do not exist in f1 but do exist in f2
     for (i=0; i<n; i++) {
-        u_int32_t hi;
+        uint32_t hi;
         void *v;
         hi = toku_cachetable_hash(f1, make_blocknum(i));
         r = toku_cachetable_maybe_get_and_pin(f1, make_blocknum(i), hi, &v);
@@ -74,8 +74,8 @@ test_cachetable_def_flush (int n) {
         assert(r == 0);
     }
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
-    r = toku_cachefile_close(&f2, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f2, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-getandpin-test.cc b/ft/tests/cachetable-getandpin-test.cc
index 8cf765d419bc3fde07be6a68769504837dd80001..aff16fa9136263c899fd4ad258781cdb6ea738c4 100644
--- a/ft/tests/cachetable-getandpin-test.cc
+++ b/ft/tests/cachetable-getandpin-test.cc
@@ -15,10 +15,10 @@ flush (CACHEFILE cf     __attribute__((__unused__)),
        void *extraargs  __attribute__((__unused__)),
        PAIR_ATTR size        __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL write_me    __attribute__((__unused__)),
-       BOOL keep_me     __attribute__((__unused__)),
-       BOOL for_checkpoint    __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool write_me    __attribute__((__unused__)),
+       bool keep_me     __attribute__((__unused__)),
+       bool for_checkpoint    __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
     assert((long) key.b == size.size);
     if (!keep_me) toku_free(v);
@@ -29,7 +29,7 @@ fetch (
     CACHEFILE cf, 
     int UU(fd), 
     CACHEKEY key, 
-    u_int32_t hash, 
+    uint32_t hash, 
     void **vptr, 
     void** UU(dd),
     PAIR_ATTR *sizep, 
@@ -59,12 +59,12 @@ cachetable_getandpin_test (int n) {
 
     // test get_and_pin size
     for (i=1; i<=n; i++) {
-        u_int32_t hi;
+        uint32_t hi;
         hi = toku_cachetable_hash(f1, make_blocknum(i));
         void *v; long size;
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
         wc.flush_callback = flush;
-        r = toku_cachetable_get_and_pin(f1, make_blocknum(i), hi, &v, &size, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, 0);
+        r = toku_cachetable_get_and_pin(f1, make_blocknum(i), hi, &v, &size, wc, fetch, def_pf_req_callback, def_pf_callback, true, 0);
         assert(r == 0);
         assert(size == i);
 
@@ -73,7 +73,7 @@ cachetable_getandpin_test (int n) {
     }
     toku_cachetable_verify(ct);
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-kibbutz_and_flush_cachefile.cc b/ft/tests/cachetable-kibbutz_and_flush_cachefile.cc
index d8891a66be8d6f4556601ebf523940056024870f..e6d003d3a88943754bfb66fb31fb43c063190e18 100644
--- a/ft/tests/cachetable-kibbutz_and_flush_cachefile.cc
+++ b/ft/tests/cachetable-kibbutz_and_flush_cachefile.cc
@@ -5,7 +5,7 @@
 #include "includes.h"
 #include "test.h"
 
-BOOL foo;
+bool foo;
 
 //
 // This test verifies that flushing a cachefile will wait on kibbutzes to finish
@@ -14,7 +14,7 @@ static void kibbutz_work(void *fe_v)
 {
     CACHEFILE CAST_FROM_VOIDP(f1, fe_v);
     sleep(2);
-    foo = TRUE;
+    foo = true;
     // note that we make the size 16 to induce an eviction
     // once evictions are moved to their own thread, we need
     // to modify this test
@@ -40,17 +40,17 @@ run_test (void) {
     long s1;
     //long s2;
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
-    foo = FALSE;
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
+    foo = false;
     cachefile_kibbutz_enq(f1, kibbutz_work, f1);
     r = toku_cachefile_flush(f1); assert(r == 0);
     assert(foo);
     assert(f1);
     
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
-    foo = FALSE;
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
+    foo = false;
     cachefile_kibbutz_enq(f1, kibbutz_work, f1);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     assert(foo);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
     
diff --git a/ft/tests/cachetable-partial-fetch.cc b/ft/tests/cachetable-partial-fetch.cc
index b096c6fba5db6afc33c1c5170eacba5293dc1b27..a36e7775bf767ce00c9210ff2a5b09764149929d 100644
--- a/ft/tests/cachetable-partial-fetch.cc
+++ b/ft/tests/cachetable-partial-fetch.cc
@@ -10,14 +10,14 @@
 // it works correctly
 //
 
-u_int32_t fetch_val = 0;
-BOOL pf_req_called;
+uint32_t fetch_val = 0;
+bool pf_req_called;
 
 static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -34,38 +34,38 @@ static int
 err_fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
 	   void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
        int  *dirtyp,
        void *extraargs    __attribute__((__unused__))
        ) {
-  assert(FALSE);
+  assert(false);
   *dirtyp = 0;
   return 0;
 }
 
-static BOOL pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
-  return FALSE;
+static bool pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
+  return false;
 }
 
-static BOOL true_pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
-  return TRUE;
+static bool true_pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
+  return true;
 }
 
 static int err_pf_callback(void* UU(ftnode_pv), void* UU(dd), void* UU(read_extraargs), int UU(fd), PAIR_ATTR* UU(sizep)) {
-  assert(FALSE);
+  assert(false);
   return 0; // gcov
 }
 
 static int pf_callback(void* UU(ftnode_pv), void* UU(dd), void* UU(read_extraargs), int UU(fd), PAIR_ATTR* UU(sizep)) {
-  assert(FALSE);
+  assert(false);
   return 0; // gcov
 }
 
 static int true_pf_callback(void* UU(ftnode_pv), void* UU(dd), void* read_extraargs, int UU(fd), PAIR_ATTR* sizep) {
-    pf_req_called = TRUE;
+    pf_req_called = true;
     *sizep = make_pair_attr(sizeof(fetch_val)+1);
     assert(read_extraargs == &fetch_val);
     return 0;
@@ -77,7 +77,7 @@ cachetable_test (void) {
     const int test_limit = 12;
     int r;
     CACHETABLE ct;
-    BOOL doing_prefetch = FALSE;
+    bool doing_prefetch = false;
     r = toku_create_cachetable(&ct, test_limit, ZERO_LSN, NULL_LOGGER); assert(r == 0);
     char fname1[] = __SRCFILE__ "test1.dat";
     unlink(fname1);
@@ -89,7 +89,7 @@ cachetable_test (void) {
     long s1;
     //long s2;
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, pf_req_callback, pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, pf_req_callback, pf_callback, true, NULL);
     assert(&fetch_val == v1);
     //
     // verify that a prefetch of this node will fail
@@ -112,20 +112,20 @@ cachetable_test (void) {
     //
     // now get and pin node again, and make sure that partial fetch and fetch are not called
     //
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, err_fetch, pf_req_callback, err_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, err_fetch, pf_req_callback, err_pf_callback, true, NULL);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
     //
     // now make sure that if we say a partial fetch is required, that we get a partial fetch
     // and that read_extraargs properly passed down
     //
-    pf_req_called = FALSE;
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, err_fetch, true_pf_req_callback, true_pf_callback, TRUE, &fetch_val);
+    pf_req_called = false;
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, err_fetch, true_pf_req_callback, true_pf_callback, true, &fetch_val);
     assert(pf_req_called);
     assert(s1 == sizeof(fetch_val)+1);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
 
     // close and reopen cachefile so we can do some simple prefetch tests
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
     //
     // verify that a prefetch of the node will succeed
@@ -147,7 +147,7 @@ cachetable_test (void) {
     //
     // now verify we can pin it, and NO fetch callback should get called
     //
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, err_fetch, pf_req_callback, err_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, err_fetch, pf_req_callback, err_pf_callback, true, NULL);
     assert(&fetch_val == v1);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
 
@@ -166,13 +166,13 @@ cachetable_test (void) {
         &doing_prefetch
         );
     assert(doing_prefetch);
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, err_fetch, pf_req_callback, err_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, err_fetch, pf_req_callback, err_pf_callback, true, NULL);
     assert(&fetch_val == v1);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
     
     
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
     
     
diff --git a/ft/tests/cachetable-pin-checkpoint.cc b/ft/tests/cachetable-pin-checkpoint.cc
index 9fce57826276998e2269f1b90409c23d58cff556..046a82cdc371a0eb7f25418933069f452ed100b0 100644
--- a/ft/tests/cachetable-pin-checkpoint.cc
+++ b/ft/tests/cachetable-pin-checkpoint.cc
@@ -21,19 +21,19 @@
 int64_t data[NUM_ELEMENTS];
 int64_t checkpointed_data[NUM_ELEMENTS];
 
-u_int32_t time_of_test;
-BOOL run_test;
+uint32_t time_of_test;
+bool run_test;
 
 static void 
 clone_callback(
     void* value_data, 
     void** cloned_value_data, 
     PAIR_ATTR* new_attr, 
-    BOOL UU(for_checkpoint), 
+    bool UU(for_checkpoint), 
     void* UU(write_extraargs)
     )
 {
-    new_attr->is_valid = FALSE;
+    new_attr->is_valid = false;
     int64_t* XMALLOC(data_val);
     *data_val = *(int64_t *)value_data;
     *cloned_value_data = data_val;   
@@ -49,10 +49,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL write_me,
-       BOOL keep_me,
-       BOOL checkpoint_me,
-        BOOL UU(is_clone)
+       bool write_me,
+       bool keep_me,
+       bool checkpoint_me,
+        bool UU(is_clone)
        ) {
     /* Do nothing */
     int64_t val_to_write = *(int64_t *)v;
@@ -72,7 +72,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k,
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value,
        void** UU(dd),
        PAIR_ATTR *sizep,
@@ -98,7 +98,7 @@ static void *test_time(void *arg) {
     if (time_of_test != 0) {
         usleep(time_of_test*1000*1000);
         if (verbose) printf("should now end test\n");
-        run_test = FALSE;
+        run_test = false;
     }
     if (verbose) printf("should be ending test now\n");
     return arg;
@@ -136,7 +136,7 @@ static void *move_numbers(void *arg) {
         long s1;
         CACHEKEY less_key;
         less_key.b = less;
-        u_int32_t less_fullhash = less;
+        uint32_t less_fullhash = less;
         enum cachetable_dirty less_dirty = CACHETABLE_DIRTY;
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
         wc.flush_callback = flush;
@@ -148,7 +148,7 @@ static void *move_numbers(void *arg) {
             &v1,
             &s1,
             wc, fetch, def_pf_req_callback, def_pf_callback,
-            TRUE,
+            true,
             NULL,
             0, //num_dependent_pairs
             NULL,
@@ -161,7 +161,7 @@ static void *move_numbers(void *arg) {
     
         CACHEKEY greater_key;
         greater_key.b = greater;
-        u_int32_t greater_fullhash = greater;
+        uint32_t greater_fullhash = greater;
         enum cachetable_dirty greater_dirty = CACHETABLE_DIRTY;
         r = toku_cachetable_get_and_pin_with_dep_pairs(
             f1,
@@ -170,7 +170,7 @@ static void *move_numbers(void *arg) {
             &v1,
             &s1,
             wc, fetch, def_pf_req_callback, def_pf_callback, 
-            TRUE,
+            true,
             NULL,
             1, //num_dependent_pairs
             &f1,
@@ -195,7 +195,7 @@ static void *move_numbers(void *arg) {
             third = (random() % (num_possible_values)) + greater + 1;
             CACHEKEY third_key;
             third_key.b = third;
-            u_int32_t third_fullhash = third;
+            uint32_t third_fullhash = third;
             enum cachetable_dirty third_dirty = CACHETABLE_DIRTY;
             r = toku_cachetable_get_and_pin_with_dep_pairs(
                 f1,
@@ -204,7 +204,7 @@ static void *move_numbers(void *arg) {
                 &v1,
                 &s1,
                 wc, fetch, def_pf_req_callback, def_pf_callback,
-                TRUE,
+                true,
                 NULL,
                 1, //num_dependent_pairs
                 &f1,
@@ -242,7 +242,7 @@ static void *read_random_numbers(void *arg) {
             &v1,
             &s1,
             wc, fetch, def_pf_req_callback, def_pf_callback, 
-            FALSE,
+            false,
             NULL,
             NULL
             );
@@ -357,7 +357,7 @@ cachetable_test (void) {
     toku_pthread_t checkpoint_tid;
     toku_pthread_t move_tid[NUM_MOVER_THREADS];
     toku_pthread_t read_random_tid[NUM_MOVER_THREADS];
-    run_test = TRUE;
+    run_test = true;
 
     for (int i = 0; i < NUM_MOVER_THREADS; i++) {
         r = toku_pthread_create(&read_random_tid[i], NULL, read_random_numbers, NULL); 
@@ -388,7 +388,7 @@ cachetable_test (void) {
     }
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
     
     sum_vals();
diff --git a/ft/tests/cachetable-pin-nonblocking-checkpoint-clean.cc b/ft/tests/cachetable-pin-nonblocking-checkpoint-clean.cc
index 2f7ceb7c81761725fe8da5a9e64a8bc67748c4df..6e53c110515dc28858dd181acdb5e0bcbabb0554 100644
--- a/ft/tests/cachetable-pin-nonblocking-checkpoint-clean.cc
+++ b/ft/tests/cachetable-pin-nonblocking-checkpoint-clean.cc
@@ -26,15 +26,15 @@ run_test (void) {
     long s1;
     long s2;
     
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8)); assert(r==0);
 
     for (int i = 0; i < 20; i++) {
-        r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+        r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
         r = toku_cachetable_unpin(f1, make_blocknum(2), 2, CACHETABLE_CLEAN, make_pair_attr(8)); assert(r==0);
     }
 
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v2, &s2, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v2, &s2, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     r = toku_cachetable_begin_checkpoint(ct, NULL);
     // mark nodes as pending a checkpoint, so that get_and_pin_nonblocking on block 1 will return TOKUDB_TRY_AGAIN
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8)); assert(r==0);
@@ -49,7 +49,7 @@ run_test (void) {
         def_fetch,
         def_pf_req_callback,
         def_pf_callback,
-        TRUE,
+        true,
         NULL,
         NULL
         );
@@ -65,7 +65,7 @@ run_test (void) {
     assert(r==0);
     
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
     
     
diff --git a/ft/tests/cachetable-prefetch-checkpoint-test.cc b/ft/tests/cachetable-prefetch-checkpoint-test.cc
index 2ae5ac03099c0f533893465ef00e6866f044a912..ddd3ce990aa6975df56ce7795c21e87dbc1acabd 100644
--- a/ft/tests/cachetable-prefetch-checkpoint-test.cc
+++ b/ft/tests/cachetable-prefetch-checkpoint-test.cc
@@ -25,10 +25,10 @@ static void flush(
     void *extraargs, 
     PAIR_ATTR size, 
     PAIR_ATTR* UU(new_size), 
-    BOOL write_me, 
-    BOOL keep_me, 
-    BOOL UU(for_checkpoint),
-        BOOL UU(is_clone)
+    bool write_me, 
+    bool keep_me, 
+    bool UU(for_checkpoint),
+        bool UU(is_clone)
     ) 
 {
     cf = cf; key = key; value = value; extraargs = extraargs; 
@@ -43,7 +43,7 @@ static int fetch(
     CACHEFILE cf, 
     int UU(fd), 
     CACHEKEY key, 
-    u_int32_t fullhash, 
+    uint32_t fullhash, 
     void **value, 
     void** UU(dd),
     PAIR_ATTR *sizep, 
@@ -83,7 +83,7 @@ static void cachetable_prefetch_checkpoint_test(int n, enum cachetable_dirty dir
     // prefetch block n+1. this will take 10 seconds.
     {
         CACHEKEY key = make_blocknum(n+1);
-        u_int32_t fullhash = toku_cachetable_hash(f1, key);
+        uint32_t fullhash = toku_cachetable_hash(f1, key);
         r = toku_cachefile_prefetch(f1, key, fullhash, wc, fetch, def_pf_req_callback, def_pf_callback, 0, NULL);
         toku_cachetable_verify(ct);
     }
@@ -92,7 +92,7 @@ static void cachetable_prefetch_checkpoint_test(int n, enum cachetable_dirty dir
     int i;
     for (i=0; i<n; i++) {
         CACHEKEY key = make_blocknum(i);
-        u_int32_t hi = toku_cachetable_hash(f1, key);
+        uint32_t hi = toku_cachetable_hash(f1, key);
         r = toku_cachetable_put(f1, key, hi, (void *)(long)i, make_pair_attr(1), wc);
         assert(r == 0);
 
@@ -122,7 +122,7 @@ static void cachetable_prefetch_checkpoint_test(int n, enum cachetable_dirty dir
     // after the checkpoint, all of the items should be clean
     for (i=0; i<n; i++) {
         CACHEKEY key = make_blocknum(i);
-        u_int32_t hi = toku_cachetable_hash(f1, key);
+        uint32_t hi = toku_cachetable_hash(f1, key);
         void *v;
         r = toku_cachetable_maybe_get_and_pin(f1, key, hi, &v);
         if (r != 0) 
@@ -148,7 +148,7 @@ static void cachetable_prefetch_checkpoint_test(int n, enum cachetable_dirty dir
     assert(r == 0);
     assert(n_flush == 0 && n_write_me == 0 && n_keep_me == 0);
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-prefetch-close-leak-test.cc b/ft/tests/cachetable-prefetch-close-leak-test.cc
index ee8580fd212739f32d1454d4ed132422c41af2b2..2ba355ef54888ef129a91af4867432f18a123c76 100644
--- a/ft/tests/cachetable-prefetch-close-leak-test.cc
+++ b/ft/tests/cachetable-prefetch-close-leak-test.cc
@@ -16,12 +16,12 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
-    assert(w == FALSE && v != NULL);
+    assert(w == false && v != NULL);
     toku_free(v);
 }
 
@@ -31,7 +31,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -61,7 +61,7 @@ static void cachetable_prefetch_close_leak_test (void) {
 
     // prefetch block 0. this will take 10 seconds.
     CACHEKEY key = make_blocknum(0);
-    u_int32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
+    uint32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = flush;
     r = toku_cachefile_prefetch(f1, key, fullhash, wc, fetch, def_pf_req_callback, def_pf_callback, 0, NULL);
@@ -69,7 +69,7 @@ static void cachetable_prefetch_close_leak_test (void) {
 
     // close with the prefetch in progress. the close should block until
     // all of the reads and writes are complete.
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-prefetch-close-test.cc b/ft/tests/cachetable-prefetch-close-test.cc
index 945fbad4247697dd85a43c6ccdbf4e88691e870b..c974fdff4127968a5bf8a98953c15b57425a2cba 100644
--- a/ft/tests/cachetable-prefetch-close-test.cc
+++ b/ft/tests/cachetable-prefetch-close-test.cc
@@ -7,7 +7,7 @@
 #include "includes.h"
 #include "test.h"
 
-BOOL expect_pf;
+bool expect_pf;
 
 static void
 flush (CACHEFILE f __attribute__((__unused__)),
@@ -18,12 +18,12 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
-    assert(w == FALSE);
+    assert(w == false);
 }
 
 static int fetch_calls = 0;
@@ -32,7 +32,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -50,9 +50,9 @@ fetch (CACHEFILE f        __attribute__((__unused__)),
     return 0;
 }
 
-static void cachetable_prefetch_full_test (BOOL partial_fetch) {
+static void cachetable_prefetch_full_test (bool partial_fetch) {
     const int test_limit = 2;
-    expect_pf = FALSE;
+    expect_pf = false;
     int r;
     CACHETABLE ct;
     r = toku_create_cachetable(&ct, test_limit, ZERO_LSN, NULL_LOGGER); assert(r == 0);
@@ -63,7 +63,7 @@ static void cachetable_prefetch_full_test (BOOL partial_fetch) {
 
     // prefetch block 0. this will take 2 seconds.
     CACHEKEY key = make_blocknum(0);
-    u_int32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
+    uint32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
 
     // if we want to do a test of partial fetch,
     // we first put the key into the cachefile so that
@@ -71,7 +71,7 @@ static void cachetable_prefetch_full_test (BOOL partial_fetch) {
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = flush;
     if (partial_fetch) {
-        expect_pf = TRUE;
+        expect_pf = true;
         void* value;
         long size;
         r = toku_cachetable_get_and_pin(
@@ -84,7 +84,7 @@ static void cachetable_prefetch_full_test (BOOL partial_fetch) {
             fetch,
             def_pf_req_callback,
             def_pf_callback,
-            TRUE, 
+            true, 
             0
             );
         assert(r==0);
@@ -96,14 +96,14 @@ static void cachetable_prefetch_full_test (BOOL partial_fetch) {
 
     // close with the prefetch in progress. the close should block until
     // all of the reads and writes are complete.
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
 int
 test_main(int argc, const char *argv[]) {
     default_parse_args(argc, argv);
-    cachetable_prefetch_full_test(TRUE);
-    cachetable_prefetch_full_test(FALSE);
+    cachetable_prefetch_full_test(true);
+    cachetable_prefetch_full_test(false);
     return 0;
 }
diff --git a/ft/tests/cachetable-prefetch-flowcontrol-test.cc b/ft/tests/cachetable-prefetch-flowcontrol-test.cc
index bf376cdddffbf21efdff88b0348586cf589bc871..5bd00d707ab92a73df8fbaf0db8a56ae4615cdc9 100644
--- a/ft/tests/cachetable-prefetch-flowcontrol-test.cc
+++ b/ft/tests/cachetable-prefetch-flowcontrol-test.cc
@@ -22,14 +22,14 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w,
-       BOOL keep,
-       BOOL f_ckpt __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w,
+       bool keep,
+       bool f_ckpt __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
-    assert(w == FALSE);
+    assert(w == false);
     flush_calls++;
-    if (keep == FALSE) {
+    if (keep == false) {
         flush_evict_calls++;
 	if (verbose) printf("%s:%d flush %" PRId64 "\n", __FUNCTION__, __LINE__, k.b);
         evicted_keys |= 1 << k.b;
@@ -42,7 +42,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k,
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value,
        void** UU(dd),
        PAIR_ATTR *sizep,
@@ -77,7 +77,7 @@ static void cachetable_prefetch_flowcontrol_test (int cachetable_size_limit) {
     // prefetch keys 0 .. N-1.  they should all fit in the cachetable
     for (i=0; i<cachetable_size_limit; i++) {
         CACHEKEY key = make_blocknum(i);
-        u_int32_t fullhash = toku_cachetable_hash(f1, key);
+        uint32_t fullhash = toku_cachetable_hash(f1, key);
         r = toku_cachefile_prefetch(f1, key, fullhash, wc, fetch, def_pf_req_callback, def_pf_callback, 0, NULL);
         toku_cachetable_verify(ct);
     }
@@ -88,7 +88,7 @@ static void cachetable_prefetch_flowcontrol_test (int cachetable_size_limit) {
     // prefetch keys N .. 2*N-1.  0 .. N-1 should be evicted.
     for (i=i; i<2*cachetable_size_limit; i++) {
         CACHEKEY key = make_blocknum(i);
-        u_int32_t fullhash = toku_cachetable_hash(f1, key);
+        uint32_t fullhash = toku_cachetable_hash(f1, key);
         r = toku_cachefile_prefetch(f1, key, fullhash, wc, fetch, def_pf_req_callback, def_pf_callback, 0, NULL);
         toku_cachetable_verify(ct);
 	// sleep(1);
@@ -105,7 +105,7 @@ static void cachetable_prefetch_flowcontrol_test (int cachetable_size_limit) {
 #endif
 
     char *error_string;
-    r = toku_cachefile_close(&f1, &error_string, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, &error_string, false, ZERO_LSN); assert(r == 0);
     if (verbose) printf("%s:%d 0x%x 0x%x\n", __FUNCTION__, __LINE__,
 	evicted_keys, (1 << (2*cachetable_size_limit))-1);
     assert(evicted_keys == (1 << (2*cachetable_size_limit))-1);
diff --git a/ft/tests/cachetable-prefetch-getandpin-test.cc b/ft/tests/cachetable-prefetch-getandpin-test.cc
index 3861fd787d7671a5c209428818164be60faf6b40..f86bf4c26afdbfac6f0309c997be498b35140ccf 100644
--- a/ft/tests/cachetable-prefetch-getandpin-test.cc
+++ b/ft/tests/cachetable-prefetch-getandpin-test.cc
@@ -7,8 +7,8 @@
 #include "includes.h"
 #include "test.h"
 
-BOOL do_pf;
-BOOL expect_pf;
+bool do_pf;
+bool expect_pf;
 
 static void
 flush (CACHEFILE f __attribute__((__unused__)),
@@ -19,19 +19,19 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
-    assert(w == FALSE);
+    assert(w == false);
 }
 
 static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -49,13 +49,13 @@ fetch (CACHEFILE f        __attribute__((__unused__)),
     return 0;
 }
 
-static BOOL pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
+static bool pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
     if (do_pf) {
         assert(expect_pf);
-        return TRUE;
+        return true;
     }
     else {
-        return FALSE;
+        return false;
     }
 }
 
@@ -72,7 +72,7 @@ static uint64_t tdelta_usec(struct timeval *tend, struct timeval *tstart) {
     return t;
 }
 
-static void cachetable_prefetch_maybegetandpin_test (BOOL do_partial_fetch) {
+static void cachetable_prefetch_maybegetandpin_test (bool do_partial_fetch) {
     const int test_limit = 2;
     int r;
     CACHETABLE ct;
@@ -81,14 +81,14 @@ static void cachetable_prefetch_maybegetandpin_test (BOOL do_partial_fetch) {
     unlink(fname1);
     CACHEFILE f1;
     r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
-    expect_pf = FALSE;
-    do_pf = FALSE;
+    expect_pf = false;
+    do_pf = false;
     CACHEKEY key = make_blocknum(0);
-    u_int32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
+    uint32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = flush;
     if (do_partial_fetch) {
-        expect_pf = TRUE;
+        expect_pf = true;
         void* value;
         long size;
         r = toku_cachetable_get_and_pin(
@@ -101,7 +101,7 @@ static void cachetable_prefetch_maybegetandpin_test (BOOL do_partial_fetch) {
             fetch,
             pf_req_callback,
             pf_callback,
-            TRUE, 
+            true, 
             0
             );
         assert(r==0);
@@ -112,17 +112,17 @@ static void cachetable_prefetch_maybegetandpin_test (BOOL do_partial_fetch) {
     gettimeofday(&tstart, NULL);
 
     // prefetch block 0. this will take 2 seconds.
-    do_pf = TRUE;
+    do_pf = true;
     r = toku_cachefile_prefetch(f1, key, fullhash, wc, fetch, pf_req_callback, pf_callback, 0, NULL);
     toku_cachetable_verify(ct);
 
     // verify that get_and_pin waits while the prefetch is in progress
     void *v = 0;
     long size = 0;
-    do_pf = FALSE;
-    r = toku_cachetable_get_and_pin_nonblocking(f1, key, fullhash, &v, &size, wc, fetch, pf_req_callback, pf_callback, TRUE, NULL, NULL);
+    do_pf = false;
+    r = toku_cachetable_get_and_pin_nonblocking(f1, key, fullhash, &v, &size, wc, fetch, pf_req_callback, pf_callback, true, NULL, NULL);
     assert(r==TOKUDB_TRY_AGAIN);
-    r = toku_cachetable_get_and_pin(f1, key, fullhash, &v, &size, wc, fetch, pf_req_callback, pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, key, fullhash, &v, &size, wc, fetch, pf_req_callback, pf_callback, true, NULL);
     assert(r == 0 && v == 0 && size == 2);
 
     struct timeval tend; 
@@ -136,14 +136,14 @@ static void cachetable_prefetch_maybegetandpin_test (BOOL do_partial_fetch) {
     assert(r == 0);
     toku_cachetable_verify(ct);
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
 int
 test_main(int argc, const char *argv[]) {
     default_parse_args(argc, argv);
-    cachetable_prefetch_maybegetandpin_test(TRUE);
-    cachetable_prefetch_maybegetandpin_test(FALSE);
+    cachetable_prefetch_maybegetandpin_test(true);
+    cachetable_prefetch_maybegetandpin_test(false);
     return 0;
 }
diff --git a/ft/tests/cachetable-prefetch-maybegetandpin-test.cc b/ft/tests/cachetable-prefetch-maybegetandpin-test.cc
index e83b7111e5b482c40bd00557f8ffefe123c1c0f2..884167d815f31261c06b973a2bfd5d781085b729 100644
--- a/ft/tests/cachetable-prefetch-maybegetandpin-test.cc
+++ b/ft/tests/cachetable-prefetch-maybegetandpin-test.cc
@@ -11,7 +11,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -41,7 +41,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
 
     // prefetch block 0. this will take 10 seconds.
     CACHEKEY key = make_blocknum(0);
-    u_int32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
+    uint32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     r = toku_cachefile_prefetch(f1, key, fullhash, wc, fetch, def_pf_req_callback, def_pf_callback, 0, NULL);
     toku_cachetable_verify(ct);
@@ -62,7 +62,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
     assert(r == 0);
     toku_cachetable_verify(ct);
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-prefetch2-test.cc b/ft/tests/cachetable-prefetch2-test.cc
index 7a7d62e67056e089c69685cf1cec927744e73dce..0f6b17c10590775b05b7888ad6ae37a090c4e613 100644
--- a/ft/tests/cachetable-prefetch2-test.cc
+++ b/ft/tests/cachetable-prefetch2-test.cc
@@ -14,7 +14,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -44,7 +44,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
 
     // prefetch block 0. this will take 10 seconds.
     CACHEKEY key = make_blocknum(0);
-    u_int32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
+    uint32_t fullhash = toku_cachetable_hash(f1, make_blocknum(0));
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     r = toku_cachefile_prefetch(f1, key, fullhash, wc, fetch, def_pf_req_callback, def_pf_callback, 0, NULL);
     toku_cachetable_verify(ct);
@@ -72,7 +72,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
     assert(r == 0);
     toku_cachetable_verify(ct);
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-put-checkpoint.cc b/ft/tests/cachetable-put-checkpoint.cc
index d5a87bde30ca165b53bbfa86d227fe95b7ac877b..0fee69f7b35c4ac9062f70fe6fde187b25c0f2c0 100644
--- a/ft/tests/cachetable-put-checkpoint.cc
+++ b/ft/tests/cachetable-put-checkpoint.cc
@@ -24,19 +24,19 @@
 int64_t data[NUM_ELEMENTS];
 int64_t checkpointed_data[NUM_ELEMENTS];
 
-u_int32_t time_of_test;
-BOOL run_test;
+uint32_t time_of_test;
+bool run_test;
 
 static void 
 clone_callback(
     void* value_data, 
     void** cloned_value_data, 
     PAIR_ATTR* new_attr, 
-    BOOL UU(for_checkpoint), 
+    bool UU(for_checkpoint), 
     void* UU(write_extraargs)
     )
 {
-    new_attr->is_valid = FALSE;
+    new_attr->is_valid = false;
     int64_t* XMALLOC(data_val);
     *data_val = *(int64_t *)value_data;
     *cloned_value_data = data_val;
@@ -52,10 +52,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size,
-       BOOL write_me,
-       BOOL keep_me,
-       BOOL checkpoint_me,
-        BOOL UU(is_clone)
+       bool write_me,
+       bool keep_me,
+       bool checkpoint_me,
+        bool UU(is_clone)
        ) {
     int64_t val_to_write = *(int64_t *)v;
     size_t data_index = (size_t)k.b;
@@ -74,7 +74,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k,
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value,
        void** UU(dd),
        PAIR_ATTR *sizep,
@@ -103,7 +103,7 @@ static void *test_time(void *arg) {
     if (time_of_test != 0) {
         usleep(time_of_test*1000*1000);
         if (verbose) printf("should now end test\n");
-        run_test = FALSE;
+        run_test = false;
     }
     if (verbose) printf("should be ending test now\n");
     return arg;
@@ -126,12 +126,12 @@ static void move_number_to_child(
     long s1;
     CACHEKEY parent_key;
     parent_key.b = parent;
-    u_int32_t parent_fullhash = toku_cachetable_hash(f1, parent_key);
+    uint32_t parent_fullhash = toku_cachetable_hash(f1, parent_key);
 
     
     CACHEKEY child_key;
     child_key.b = child;
-    u_int32_t child_fullhash = toku_cachetable_hash(f1, child_key);
+    uint32_t child_fullhash = toku_cachetable_hash(f1, child_key);
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = flush;
     wc.clone_callback = clone_callback;
@@ -142,7 +142,7 @@ static void move_number_to_child(
         &v1,
         &s1,
         wc, fetch, def_pf_req_callback, def_pf_callback,
-        TRUE,
+        true,
         NULL,
         1, //num_dependent_pairs
         &f1,
@@ -178,7 +178,7 @@ static void *move_numbers(void *arg) {
         long s1;
         CACHEKEY parent_key;
         parent_key.b = parent;
-        u_int32_t parent_fullhash = toku_cachetable_hash(f1, parent_key);
+        uint32_t parent_fullhash = toku_cachetable_hash(f1, parent_key);
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
         wc.flush_callback = flush;
         wc.clone_callback = clone_callback;
@@ -189,7 +189,7 @@ static void *move_numbers(void *arg) {
             &v1,
             &s1,
             wc, fetch, def_pf_req_callback, def_pf_callback,
-            TRUE,
+            true,
             NULL,
             0, //num_dependent_pairs
             NULL,
@@ -204,7 +204,7 @@ static void *move_numbers(void *arg) {
     return arg;
 }
 
-static void remove_data(CACHEKEY* cachekey, BOOL for_checkpoint, void* UU(extra)) {
+static void remove_data(CACHEKEY* cachekey, bool for_checkpoint, void* UU(extra)) {
     assert(cachekey->b < NUM_ELEMENTS);
     data[cachekey->b] = INT64_MAX;
     if (for_checkpoint) {
@@ -213,7 +213,7 @@ static void remove_data(CACHEKEY* cachekey, BOOL for_checkpoint, void* UU(extra)
 }
 
 
-static void get_data(CACHEKEY* cachekey, u_int32_t* fullhash, void* extra) {
+static void get_data(CACHEKEY* cachekey, uint32_t* fullhash, void* extra) {
     int* CAST_FROM_VOIDP(key, extra);
     cachekey->b = *key;
     *fullhash = toku_cachetable_hash(f1, *cachekey);
@@ -229,7 +229,7 @@ static void merge_and_split_child(
     int child = 0;
     int other_child = 0;
     int r;
-    BOOL even = (random() % 2) == 0;
+    bool even = (random() % 2) == 0;
     child = (even) ? (2*parent + 1) : (2*parent + 2); 
     other_child = (!even) ? (2*parent + 1) : (2*parent + 2);
     assert(child != other_child);
@@ -239,11 +239,11 @@ static void merge_and_split_child(
 
     CACHEKEY parent_key;
     parent_key.b = parent;
-    u_int32_t parent_fullhash = toku_cachetable_hash(f1, parent_key);
+    uint32_t parent_fullhash = toku_cachetable_hash(f1, parent_key);
 
     CACHEKEY child_key;
     child_key.b = child;
-    u_int32_t child_fullhash = toku_cachetable_hash(f1, child_key);
+    uint32_t child_fullhash = toku_cachetable_hash(f1, child_key);
     enum cachetable_dirty child_dirty = CACHETABLE_CLEAN;
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = flush;
@@ -255,7 +255,7 @@ static void merge_and_split_child(
         &v1,
         &s1,
         wc, fetch, def_pf_req_callback, def_pf_callback,
-        TRUE,
+        true,
         NULL,
         1, //num_dependent_pairs
         &f1,
@@ -268,14 +268,14 @@ static void merge_and_split_child(
     
     CACHEKEY other_child_key;
     other_child_key.b = other_child;
-    u_int32_t other_child_fullhash = toku_cachetable_hash(f1, other_child_key);
+    uint32_t other_child_fullhash = toku_cachetable_hash(f1, other_child_key);
     CACHEFILE cfs[2];
     cfs[0] = f1;
     cfs[1] = f1;
     CACHEKEY keys[2];
     keys[0] = parent_key;
     keys[1] = child_key;
-    u_int32_t hashes[2];
+    uint32_t hashes[2];
     hashes[0] = parent_fullhash;
     hashes[1] = child_fullhash;
     enum cachetable_dirty dirties[2];
@@ -289,7 +289,7 @@ static void merge_and_split_child(
         &v1,
         &s1,
         wc, fetch, def_pf_req_callback, def_pf_callback,
-        TRUE,
+        true,
         NULL,
         2, //num_dependent_pairs
         cfs,
@@ -312,7 +312,7 @@ static void merge_and_split_child(
     
     // now do a split
     CACHEKEY new_key;
-    u_int32_t new_fullhash;
+    uint32_t new_fullhash;
     int64_t* XMALLOC(data_val);
     r = toku_cachetable_put_with_dep_pairs(
           f1,
@@ -355,7 +355,7 @@ static void *merge_and_split(void *arg) {
         long s1;
         CACHEKEY parent_key;
         parent_key.b = parent;
-        u_int32_t parent_fullhash = toku_cachetable_hash(f1, parent_key);
+        uint32_t parent_fullhash = toku_cachetable_hash(f1, parent_key);
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
         wc.flush_callback = flush;
         wc.clone_callback = clone_callback;
@@ -366,7 +366,7 @@ static void *merge_and_split(void *arg) {
             &v1,
             &s1,
             wc, fetch, def_pf_req_callback, def_pf_callback,
-            TRUE,
+            true,
             NULL,
             0, //num_dependent_pairs
             NULL,
@@ -490,7 +490,7 @@ cachetable_test (void) {
     toku_pthread_t checkpoint_tid;
     toku_pthread_t move_tid[NUM_MOVER_THREADS];
     toku_pthread_t merge_and_split_tid[NUM_MOVER_THREADS];
-    run_test = TRUE;
+    run_test = true;
 
     for (int i = 0; i < NUM_MOVER_THREADS; i++) {
         r = toku_pthread_create(&move_tid[i], NULL, move_numbers, NULL); 
@@ -521,7 +521,7 @@ cachetable_test (void) {
     }
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
     
     sum_vals();
diff --git a/ft/tests/cachetable-put-test.cc b/ft/tests/cachetable-put-test.cc
index 6c61448c9e28f8f73bafc13c7e9cacd1a3e57824..dbab9d0cb13c1a3488746807af4f8190dd1ebeab 100644
--- a/ft/tests/cachetable-put-test.cc
+++ b/ft/tests/cachetable-put-test.cc
@@ -19,7 +19,7 @@ cachetable_put_test (int n) {
 
     int i;
     for (i=1; i<=n; i++) {
-        u_int32_t hi;
+        uint32_t hi;
         hi = toku_cachetable_hash(f1, make_blocknum(i));
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
         r = toku_cachetable_put(f1, make_blocknum(i), hi, (void *)(long)i, make_pair_attr(1), wc);
@@ -36,7 +36,7 @@ cachetable_put_test (int n) {
         assert(toku_cachefile_count_pinned(f1, 0) == i);
     }
     for (i=n; i>0; i--) {
-        u_int32_t hi;
+        uint32_t hi;
         hi = toku_cachetable_hash(f1, make_blocknum(i));
         r = toku_cachetable_unpin(f1, make_blocknum(i), hi, CACHETABLE_CLEAN, make_pair_attr(1));
         assert(r == 0);
@@ -49,7 +49,7 @@ cachetable_put_test (int n) {
     r = toku_cachetable_unpin(f1, k, toku_cachetable_hash(f1, k), CACHETABLE_CLEAN, make_pair_attr(1));
     assert(r != 0);
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-rename-test.cc b/ft/tests/cachetable-rename-test.cc
index 24697214c7f5cb49c9bdd2b9cfa616262b1e9f2c..69a7a58a23112d8a607da691d9809a404133ec4a 100644
--- a/ft/tests/cachetable-rename-test.cc
+++ b/ft/tests/cachetable-rename-test.cc
@@ -45,10 +45,10 @@ static void r_flush (CACHEFILE f      __attribute__((__unused__)),
 		     void *extra      __attribute__((__unused__)),
 		     PAIR_ATTR size        __attribute__((__unused__)),
         PAIR_ATTR* new_size      __attribute__((__unused__)),
-		     BOOL write_me    __attribute__((__unused__)),
-		     BOOL keep_me,
-		     BOOL for_checkpoint    __attribute__((__unused__)),
-        BOOL UU(is_clone)
+		     bool write_me    __attribute__((__unused__)),
+		     bool keep_me,
+		     bool for_checkpoint    __attribute__((__unused__)),
+        bool UU(is_clone)
 		     ) {
     int i;
     //printf("Flush\n");
@@ -76,7 +76,7 @@ static void r_flush (CACHEFILE f      __attribute__((__unused__)),
 static int r_fetch (CACHEFILE f        __attribute__((__unused__)),
                     int UU(fd),
 		    CACHEKEY key       __attribute__((__unused__)),
-		    u_int32_t fullhash __attribute__((__unused__)),
+		    uint32_t fullhash __attribute__((__unused__)),
 		    void**value        __attribute__((__unused__)),
 		    void** UU(dd),
 		    PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -104,7 +104,7 @@ static void test_rename (void) {
 	    CACHEKEY nkey = make_blocknum(random());
 	    long     nval = random();
 	    if (verbose) printf("n_keys=%d Insert %08" PRIx64 "\n", n_keys, nkey.b);
-	    u_int32_t hnkey = toku_cachetable_hash(f, nkey);
+	    uint32_t hnkey = toku_cachetable_hash(f, nkey);
             CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
             wc.flush_callback = r_flush;
 	    r = toku_cachetable_put(f, nkey, hnkey,
@@ -136,7 +136,7 @@ static void test_rename (void) {
 	    if (verbose) printf("Rename %" PRIx64 " to %" PRIx64 "\n", okey.b, nkey.b);
             CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
             wc.flush_callback = r_flush;
-	    r = toku_cachetable_get_and_pin(f, okey, toku_cachetable_hash(f, okey), &current_value, &current_size, wc, r_fetch, def_pf_req_callback, def_pf_callback, TRUE, 0);
+	    r = toku_cachetable_get_and_pin(f, okey, toku_cachetable_hash(f, okey), &current_value, &current_size, wc, r_fetch, def_pf_req_callback, def_pf_callback, true, 0);
 	    if (r == -42) continue;
             assert(r==0);
 	    r = toku_cachetable_rename(f, okey, nkey);
@@ -170,7 +170,7 @@ static void test_rename (void) {
     r = toku_cachetable_rename(f, okey, nkey);
     assert(r != 0);
 
-    r = toku_cachefile_close(&f, 0, FALSE, ZERO_LSN);
+    r = toku_cachefile_close(&f, 0, false, ZERO_LSN);
     assert(r == 0);
     r = toku_cachetable_close(&t);
     assert(r == 0);
diff --git a/ft/tests/cachetable-scan.cc b/ft/tests/cachetable-scan.cc
index 9ceb71d70867bd6fa6d276842b259d16f64d12b2..6fed5e34be10b13deaafe6fd668178aaca81acef 100644
--- a/ft/tests/cachetable-scan.cc
+++ b/ft/tests/cachetable-scan.cc
@@ -19,10 +19,10 @@ static void f_flush (CACHEFILE f,
 		     void *extra       __attribute__((__unused__)),
 		     PAIR_ATTR size,
         PAIR_ATTR* new_size      __attribute__((__unused__)),
-		     BOOL write_me,
-		     BOOL keep_me,
-		     BOOL for_checkpoint     __attribute__((__unused__)),
-        BOOL UU(is_clone)
+		     bool write_me,
+		     bool keep_me,
+		     bool for_checkpoint     __attribute__((__unused__)),
+        bool UU(is_clone)
 		     ) {
     assert(size.size==BLOCKSIZE);
     if (write_me) {
@@ -36,7 +36,7 @@ static void f_flush (CACHEFILE f,
 static int f_fetch (CACHEFILE f,
                     int UU(fd),
 		    CACHEKEY key,
-		    u_int32_t fullhash __attribute__((__unused__)),
+		    uint32_t fullhash __attribute__((__unused__)),
 		    void**value,
 		    void** UU(dd),
 		    PAIR_ATTR *sizep,
@@ -69,7 +69,7 @@ static void writeit (void) {
     for (i=0; i<N; i++) {
 	void *buf = toku_malloc(BLOCKSIZE);
 	CACHEKEY key = make_blocknum(i*BLOCKSIZE);
-	u_int32_t fullhash = toku_cachetable_hash(f, key);
+	uint32_t fullhash = toku_cachetable_hash(f, key);
 	int j;
 	for (j=0; j<BLOCKSIZE; j++) ((char*)buf)[j]=(char)((i+j)%256);
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
@@ -94,13 +94,13 @@ static void readit (void) {
     long  current_size;
     for (i=0; i<N; i++) {
 	CACHEKEY key = make_blocknum(i*BLOCKSIZE);
-	u_int32_t fullhash = toku_cachetable_hash(f, key);
+	uint32_t fullhash = toku_cachetable_hash(f, key);
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
         wc.flush_callback = f_flush;
-	r=toku_cachetable_get_and_pin(f, key, fullhash, &block, &current_size, wc, f_fetch, def_pf_req_callback, def_pf_callback, TRUE, 0); assert(r==0);
+	r=toku_cachetable_get_and_pin(f, key, fullhash, &block, &current_size, wc, f_fetch, def_pf_req_callback, def_pf_callback, true, 0); assert(r==0);
 	r=toku_cachetable_unpin(f, key, fullhash, CACHETABLE_CLEAN, make_pair_attr(BLOCKSIZE));                                      assert(r==0);
     }
-    r = toku_cachefile_close(&f, 0, FALSE, ZERO_LSN);    assert(r == 0);
+    r = toku_cachefile_close(&f, 0, false, ZERO_LSN);    assert(r == 0);
     r = toku_cachetable_close(&t);      assert(r == 0);
     gettimeofday(&end, 0);
     toku_os_get_process_times(&end_usertime, &end_systime);
diff --git a/ft/tests/cachetable-simple-clone.cc b/ft/tests/cachetable-simple-clone.cc
index 99a821140e9f2ddef2b88351e3fd081c8ee49238..dafcd194ac71050a05a136681ad83d0df9f89f77 100644
--- a/ft/tests/cachetable-simple-clone.cc
+++ b/ft/tests/cachetable-simple-clone.cc
@@ -5,17 +5,17 @@
 #include "includes.h"
 #include "test.h"
 
-BOOL clone_called;
-BOOL check_flush;
-BOOL flush_expected;
-BOOL flush_called;
+bool clone_called;
+bool check_flush;
+bool flush_expected;
+bool flush_called;
 
 static void 
-clone_callback(void* UU(value_data), void** cloned_value_data, PAIR_ATTR* new_attr, BOOL UU(for_checkpoint), void* UU(write_extraargs))
+clone_callback(void* UU(value_data), void** cloned_value_data, PAIR_ATTR* new_attr, bool UU(for_checkpoint), void* UU(write_extraargs))
 {
     *cloned_value_data = (void *)1;
-    new_attr->is_valid = FALSE;
-    clone_called = TRUE;
+    new_attr->is_valid = false;
+    clone_called = true;
 }
 
 static void
@@ -28,10 +28,10 @@ flush (
     void *e     __attribute__((__unused__)),
     PAIR_ATTR s      __attribute__((__unused__)),
     PAIR_ATTR* new_size      __attribute__((__unused__)),
-    BOOL w      __attribute__((__unused__)),
-    BOOL keep   __attribute__((__unused__)),
-    BOOL c      __attribute__((__unused__)),
-    BOOL UU(is_clone)
+    bool w      __attribute__((__unused__)),
+    bool keep   __attribute__((__unused__)),
+    bool c      __attribute__((__unused__)),
+    bool UU(is_clone)
     ) 
 {  
     if (w) usleep(5*1024*1024);
@@ -39,7 +39,7 @@ flush (
         assert(flush_expected);
         if (clone_called) assert(is_clone);
     }
-    flush_called = TRUE;
+    flush_called = true;
     if (is_clone) assert(!keep);
 }
 
@@ -59,7 +59,7 @@ static uint64_t tdelta_usec(struct timeval *tend, struct timeval *tstart) {
 //     blocks until the pair is written out
 //
 static void
-test_clean (enum cachetable_dirty dirty, BOOL cloneable) {
+test_clean (enum cachetable_dirty dirty, bool cloneable) {
     const int test_limit = 12;
     int r;
     CACHETABLE ct;
@@ -74,13 +74,13 @@ test_clean (enum cachetable_dirty dirty, BOOL cloneable) {
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.clone_callback = cloneable ? clone_callback : NULL;
     wc.flush_callback = flush;
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, dirty, make_pair_attr(8));
     
-    check_flush = TRUE;
-    clone_called = FALSE;
-    flush_expected = (dirty == CACHETABLE_DIRTY) ? TRUE : FALSE;
-    flush_called = FALSE;
+    check_flush = true;
+    clone_called = false;
+    flush_expected = (dirty == CACHETABLE_DIRTY) ? true : false;
+    flush_called = false;
     // begin checkpoint, since pair is clean, we should not 
     // have the clone called
     r = toku_cachetable_begin_checkpoint(ct, NULL);
@@ -89,14 +89,14 @@ test_clean (enum cachetable_dirty dirty, BOOL cloneable) {
     struct timeval tend; 
     gettimeofday(&tstart, NULL);
 
-    // test that having a pin that passes FALSE for may_modify_value does not stall behind checkpoint
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, FALSE, NULL);
+    // test that having a pin that passes false for may_modify_value does not stall behind checkpoint
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, false, NULL);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
     gettimeofday(&tend, NULL);
     assert(tdelta_usec(&tend, &tstart) <= 2000000); 
     assert(!clone_called);
     
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     gettimeofday(&tend, NULL);
     
     // we take 5 seconds for a write
@@ -135,19 +135,19 @@ test_clean (enum cachetable_dirty dirty, BOOL cloneable) {
         );
     assert_zero(r);
     
-    check_flush = FALSE;
+    check_flush = false;
     
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 }
 
 int
 test_main(int argc, const char *argv[]) {
   default_parse_args(argc, argv);
-  test_clean(CACHETABLE_CLEAN, TRUE);
-  test_clean(CACHETABLE_DIRTY, TRUE);
-  test_clean(CACHETABLE_CLEAN, FALSE);
-  test_clean(CACHETABLE_DIRTY, FALSE);
+  test_clean(CACHETABLE_CLEAN, true);
+  test_clean(CACHETABLE_DIRTY, true);
+  test_clean(CACHETABLE_CLEAN, false);
+  test_clean(CACHETABLE_DIRTY, false);
   return 0;
 }
diff --git a/ft/tests/cachetable-simple-clone2.cc b/ft/tests/cachetable-simple-clone2.cc
index 754b8bc084c7bfb1416cc9dcfc6fc50903705028..bba1e66c1a71db8d774b39e07641645232224d03 100644
--- a/ft/tests/cachetable-simple-clone2.cc
+++ b/ft/tests/cachetable-simple-clone2.cc
@@ -5,17 +5,17 @@
 #include "includes.h"
 #include "test.h"
 
-BOOL clone_called;
-BOOL check_flush;
-BOOL flush_expected;
-BOOL flush_called;
+bool clone_called;
+bool check_flush;
+bool flush_expected;
+bool flush_called;
 
 static void 
-clone_callback(void* UU(value_data), void** cloned_value_data, PAIR_ATTR* new_attr, BOOL UU(for_checkpoint), void* UU(write_extraargs))
+clone_callback(void* UU(value_data), void** cloned_value_data, PAIR_ATTR* new_attr, bool UU(for_checkpoint), void* UU(write_extraargs))
 {
     *cloned_value_data = (void *)1;
-    new_attr->is_valid = FALSE;
-    clone_called = TRUE;
+    new_attr->is_valid = false;
+    clone_called = true;
 }
 
 static void
@@ -28,15 +28,15 @@ flush (
     void *e     __attribute__((__unused__)),
     PAIR_ATTR s      __attribute__((__unused__)),
     PAIR_ATTR* new_size      __attribute__((__unused__)),
-    BOOL w      __attribute__((__unused__)),
-    BOOL keep   __attribute__((__unused__)),
-    BOOL c      __attribute__((__unused__)),
-    BOOL UU(is_clone)
+    bool w      __attribute__((__unused__)),
+    bool keep   __attribute__((__unused__)),
+    bool c      __attribute__((__unused__)),
+    bool UU(is_clone)
     ) 
 {  
     if (w && check_flush) {
         assert(flush_expected);
-        flush_called = TRUE;
+        flush_called = true;
     }
 }
 
@@ -46,7 +46,7 @@ flush (
 //     dirty or clean based on the second unpin
 //
 static void
-test_clean (enum cachetable_dirty dirty, BOOL cloneable) {
+test_clean (enum cachetable_dirty dirty, bool cloneable) {
     const int test_limit = 200;
     int r;
     CACHETABLE ct;
@@ -55,21 +55,21 @@ test_clean (enum cachetable_dirty dirty, BOOL cloneable) {
     unlink(fname1);
     CACHEFILE f1;
     r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
-    check_flush = FALSE;
+    check_flush = false;
     
     void* v1;
     long s1;
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.clone_callback = cloneable ? clone_callback : NULL;
     wc.flush_callback = flush;
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8));
     
     // begin checkpoint, since pair is clean, we should not 
     // have the clone called
     r = toku_cachetable_begin_checkpoint(ct, NULL);
     assert_zero(r);
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     
     // at this point, there should be no more dirty writes
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, dirty, make_pair_attr(8));
@@ -82,12 +82,12 @@ test_clean (enum cachetable_dirty dirty, BOOL cloneable) {
     );
     assert_zero(r);
     
-    check_flush = TRUE;
-    flush_expected = (dirty == CACHETABLE_DIRTY) ? TRUE : FALSE;
-    flush_called = FALSE;
+    check_flush = true;
+    flush_expected = (dirty == CACHETABLE_DIRTY) ? true : false;
+    flush_called = false;
     
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 );
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0 );
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
     if (flush_expected) assert(flush_called);
 }
@@ -95,9 +95,9 @@ test_clean (enum cachetable_dirty dirty, BOOL cloneable) {
 int
 test_main(int argc, const char *argv[]) {
   default_parse_args(argc, argv);
-  test_clean(CACHETABLE_CLEAN, TRUE);
-  test_clean(CACHETABLE_DIRTY, TRUE);
-  test_clean(CACHETABLE_CLEAN, FALSE);
-  test_clean(CACHETABLE_DIRTY, FALSE);
+  test_clean(CACHETABLE_CLEAN, true);
+  test_clean(CACHETABLE_DIRTY, true);
+  test_clean(CACHETABLE_CLEAN, false);
+  test_clean(CACHETABLE_DIRTY, false);
   return 0;
 }
diff --git a/ft/tests/cachetable-simple-maybe-get-pin.cc b/ft/tests/cachetable-simple-maybe-get-pin.cc
index 4820f71184fddea1dcd8a4d77bf0310bf7265984..81110cbf4256720b0af26ce5667fe4f102f4ecbd 100644
--- a/ft/tests/cachetable-simple-maybe-get-pin.cc
+++ b/ft/tests/cachetable-simple-maybe-get-pin.cc
@@ -26,7 +26,7 @@ cachetable_test (void) {
     // nothing in cachetable, so this should fail
     r = toku_cachetable_maybe_get_and_pin(f1, make_blocknum(1), 1, &v1);
     assert(r==-1);
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
 
     // maybe_get_and_pin_clean should succeed, maybe_get_and_pin should fail
@@ -66,7 +66,7 @@ cachetable_test (void) {
 
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
         
 }
diff --git a/ft/tests/cachetable-simple-pin-dep-nodes.cc b/ft/tests/cachetable-simple-pin-dep-nodes.cc
index f444d4b337d61254b899a6b5b05214369087398e..0d452c00833b9e89e99501ae03a9024529ec52c3 100644
--- a/ft/tests/cachetable-simple-pin-dep-nodes.cc
+++ b/ft/tests/cachetable-simple-pin-dep-nodes.cc
@@ -7,12 +7,12 @@
 
 
 
-BOOL v1_written;
-u_int64_t val1;
-BOOL v2_written;
-u_int64_t val2;
-u_int64_t val3;
-BOOL check_me;
+bool v1_written;
+uint64_t val1;
+bool v2_written;
+uint64_t val2;
+uint64_t val3;
+bool check_me;
 
 
 static void
@@ -24,10 +24,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
     /* Do nothing */
     if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
@@ -37,13 +37,13 @@ flush (CACHEFILE f __attribute__((__unused__)),
         assert(keep);
         assert(w);
         if (v == &val1) {
-            v1_written = TRUE;
+            v1_written = true;
         }
         else if (v == &val2) {
-            v2_written = TRUE;
+            v2_written = true;
         }
         else {
-            assert(FALSE);
+            assert(false);
         }
     }
 }
@@ -52,7 +52,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -66,7 +66,7 @@ fetch (CACHEFILE f        __attribute__((__unused__)),
 }
 
 static void
-cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
+cachetable_test (bool write_first, bool write_second, bool start_checkpoint) {
     const int test_limit = 12;
     int r;
     CACHETABLE ct;
@@ -85,9 +85,9 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(&val1);
     wc.flush_callback = flush;
     wc.write_extraargs = &val1;
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, &val1);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, def_pf_req_callback, def_pf_callback, true, &val1);
     wc.write_extraargs = &val2;
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, &val2);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, &val2);
 
     CACHEFILE dependent_cfs[2];
     dependent_cfs[0] = f1;
@@ -95,7 +95,7 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
     CACHEKEY dependent_keys[2];
     dependent_keys[0] = make_blocknum(1);
     dependent_keys[1] = make_blocknum(2);
-    u_int32_t dependent_fullhash[2];
+    uint32_t dependent_fullhash[2];
     dependent_fullhash[0] = 1;
     dependent_fullhash[1] = 2;
     // now we set the dirty state of these two.
@@ -111,9 +111,9 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
     //
     // This call should cause a flush for both
     //
-    check_me = TRUE;
-    v1_written = FALSE;
-    v2_written = FALSE;
+    check_me = true;
+    v1_written = false;
+    v2_written = false;
     wc.write_extraargs = &val3;
     r = toku_cachetable_get_and_pin_with_dep_pairs(
         f1,
@@ -122,7 +122,7 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
         &v3,
         &s3,
         wc, fetch, def_pf_req_callback, def_pf_callback,
-        TRUE,
+        true,
         &val3,
         2, //num_dependent_pairs
         dependent_cfs,
@@ -138,7 +138,7 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
         assert(!v1_written);
         assert(!v2_written);
     }
-    check_me = FALSE;
+    check_me = false;
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
     r = toku_cachetable_unpin(f1, make_blocknum(2), 2, CACHETABLE_CLEAN, make_pair_attr(8));
     r = toku_cachetable_unpin(f1, make_blocknum(3), 3, CACHETABLE_CLEAN, make_pair_attr(8));
@@ -154,7 +154,7 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
     }
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
@@ -163,13 +163,13 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
 int
 test_main(int argc, const char *argv[]) {
   default_parse_args(argc, argv);
-  cachetable_test(FALSE,FALSE,TRUE);
-  cachetable_test(FALSE,TRUE,TRUE);
-  cachetable_test(TRUE,FALSE,TRUE);
-  cachetable_test(TRUE,TRUE,TRUE);
-  cachetable_test(FALSE,FALSE,FALSE);
-  cachetable_test(FALSE,TRUE,FALSE);
-  cachetable_test(TRUE,FALSE,FALSE);
-  cachetable_test(TRUE,TRUE,FALSE);
+  cachetable_test(false,false,true);
+  cachetable_test(false,true,true);
+  cachetable_test(true,false,true);
+  cachetable_test(true,true,true);
+  cachetable_test(false,false,false);
+  cachetable_test(false,true,false);
+  cachetable_test(true,false,false);
+  cachetable_test(true,true,false);
   return 0;
 }
diff --git a/ft/tests/cachetable-simple-pin-nonblocking.cc b/ft/tests/cachetable-simple-pin-nonblocking.cc
index a9f50a353ea5122ef076482513c0d1d1b2c25382..b4310db4099f1a24114e632044a4e689776bf09c 100644
--- a/ft/tests/cachetable-simple-pin-nonblocking.cc
+++ b/ft/tests/cachetable-simple-pin-nonblocking.cc
@@ -5,7 +5,7 @@
 #include "includes.h"
 #include "test.h"
 
-BOOL foo;
+bool foo;
 
 //
 // This test verifies that get_and_pin_nonblocking works and returns DB_TRYAGAIN when the PAIR is being used.
@@ -20,10 +20,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
   /* Do nothing */
   if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
@@ -36,8 +36,8 @@ flush (CACHEFILE f __attribute__((__unused__)),
   //usleep (5*1024*1024);
 }
 
-static BOOL true_def_pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
-  return TRUE;
+static bool true_def_pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
+  return true;
 }
 static int true_def_pf_callback(void* UU(ftnode_pv), void* UU(dd), void* UU(read_extraargs), int UU(fd), PAIR_ATTR* sizep) {
     *sizep = make_pair_attr(8);
@@ -49,7 +49,7 @@ static void kibbutz_work(void *fe_v)
 {
     CACHEFILE CAST_FROM_VOIDP(f1, fe_v);
     sleep(2);
-    foo = TRUE;
+    foo = true;
     int r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
     assert(r==0);
     remove_background_job_from_cf(f1);    
@@ -76,39 +76,39 @@ run_test (void) {
     // test that if we are getting a PAIR for the first time that TOKUDB_TRY_AGAIN is returned
     // because the PAIR was not in the cachetable.
     //
-    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL, NULL);
+    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL, NULL);
     assert(r==TOKUDB_TRY_AGAIN);
     // now it should succeed
-    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL, NULL);
+    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL, NULL);
     assert(r==0);
-    foo = FALSE;
+    foo = false;
     cachefile_kibbutz_enq(f1, kibbutz_work, f1);
     // because node is in use, should return TOKUDB_TRY_AGAIN
-    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL, NULL);
+    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL, NULL);
     assert(r==TOKUDB_TRY_AGAIN);
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     assert(foo);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8)); assert(r==0);
 
     // now make sure we get TOKUDB_TRY_AGAIN when a partial fetch is involved
     // first make sure value is there
-    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL, NULL);
+    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL, NULL);
     assert(r==0);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8)); assert(r==0);
     // now make sure that we get TOKUDB_TRY_AGAIN for the partial fetch
-    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, true_def_pf_req_callback, true_def_pf_callback, TRUE, NULL, NULL);
+    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, true_def_pf_req_callback, true_def_pf_callback, true, NULL, NULL);
     assert(r==TOKUDB_TRY_AGAIN);
 
     //
     // now test that if there is a checkpoint pending, 
     // first pin and unpin with dirty
     //
-    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL, NULL);
+    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL, NULL);
     assert(r==0);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8)); assert(r==0);
     // this should mark the PAIR as pending
     r = toku_cachetable_begin_checkpoint(ct, NULL); assert(r == 0);
-    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL, NULL);
+    r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL, NULL);
     assert(r==TOKUDB_TRY_AGAIN);
     r = toku_cachetable_end_checkpoint(
         ct, 
@@ -121,7 +121,7 @@ run_test (void) {
     
     
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); 
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); 
     assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
     
diff --git a/ft/tests/cachetable-simple-pin.cc b/ft/tests/cachetable-simple-pin.cc
index 45f51a352a1e7f0a1ad0d09e05559a6726f33c79..ee52f50433928ef18e17b4729affb5da2ef95855 100644
--- a/ft/tests/cachetable-simple-pin.cc
+++ b/ft/tests/cachetable-simple-pin.cc
@@ -5,9 +5,9 @@
 #include "includes.h"
 #include "test.h"
 
-BOOL foo;
-BOOL check_me;
-BOOL flush_called;
+bool foo;
+bool check_me;
+bool flush_called;
 
 //
 // This test verifies that get_and_pin takes a write lock on a PAIR.
@@ -22,16 +22,16 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
   /* Do nothing */
   if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
   //usleep (5*1024*1024);
   if (check_me) {
-    flush_called = TRUE;
+    flush_called = true;
     assert(c);
     assert(keep);
     assert(w);
@@ -42,7 +42,7 @@ static void kibbutz_work(void *fe_v)
 {
     CACHEFILE CAST_FROM_VOIDP(f1, fe_v);
     sleep(2);
-    foo = TRUE;
+    foo = true;
     int r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
     assert(r==0);
     remove_background_job_from_cf(f1);    
@@ -65,16 +65,16 @@ run_test (void) {
     //long s2;
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = flush;
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
-    foo = FALSE;
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
+    foo = false;
     cachefile_kibbutz_enq(f1, kibbutz_work, f1);
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     assert(foo);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
 
     //now let's do a simple checkpoint test
     // first dirty the PAIR
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8));
 
     // now this should mark the pair for checkpoint
@@ -83,14 +83,14 @@ run_test (void) {
     //
     // now we pin the pair again, and verify in flush callback that the pair is being checkpointed
     //
-    check_me = TRUE;
-    flush_called = FALSE;
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    check_me = true;
+    flush_called = false;
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     assert(flush_called);
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
 
     
-    check_me = FALSE;
+    check_me = false;
     r = toku_cachetable_end_checkpoint(
         ct, 
         NULL, 
@@ -101,7 +101,7 @@ run_test (void) {
     
     
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
     
     
diff --git a/ft/tests/cachetable-simple-put-dep-nodes.cc b/ft/tests/cachetable-simple-put-dep-nodes.cc
index 45c538f00ca0257ebc7d1472789eeeb396e0a03c..92d945e2d62a755b4d72947e0e4cc6633eeaf015 100644
--- a/ft/tests/cachetable-simple-put-dep-nodes.cc
+++ b/ft/tests/cachetable-simple-put-dep-nodes.cc
@@ -7,12 +7,12 @@
 
 
 
-BOOL v1_written;
-u_int64_t val1;
-BOOL v2_written;
-u_int64_t val2;
-u_int64_t val3;
-BOOL check_me;
+bool v1_written;
+uint64_t val1;
+bool v2_written;
+uint64_t val2;
+uint64_t val3;
+bool check_me;
 
 
 static void
@@ -24,10 +24,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
     /* Do nothing */
     if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
@@ -37,13 +37,13 @@ flush (CACHEFILE f __attribute__((__unused__)),
         assert(keep);
         assert(w);
         if (v == &val1) {
-            v1_written = TRUE;
+            v1_written = true;
         }
         else if (v == &val2) {
-            v2_written = TRUE;
+            v2_written = true;
         }
         else {
-            assert(FALSE);
+            assert(false);
         }
     }
 }
@@ -52,7 +52,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -65,7 +65,7 @@ fetch (CACHEFILE f        __attribute__((__unused__)),
   return 0;
 }
 
-static void get_key_and_fullhash(CACHEKEY* cachekey, u_int32_t* fullhash, void* extra) {
+static void get_key_and_fullhash(CACHEKEY* cachekey, uint32_t* fullhash, void* extra) {
     assert(extra == NULL);
     cachekey->b = 3;
     *fullhash = 3;
@@ -73,7 +73,7 @@ static void get_key_and_fullhash(CACHEKEY* cachekey, u_int32_t* fullhash, void*
 
 
 static void
-cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
+cachetable_test (bool write_first, bool write_second, bool start_checkpoint) {
     const int test_limit = 12;
     int r;
     CACHETABLE ct;
@@ -89,9 +89,9 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
     long s2;
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = flush;
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, &val1);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, fetch, def_pf_req_callback, def_pf_callback, true, &val1);
     assert(r==0);
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, &val2);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(2), 2, &v2, &s2, wc, fetch, def_pf_req_callback, def_pf_callback, true, &val2);
     assert(r==0);
     
     CACHEFILE dependent_cfs[2];
@@ -100,7 +100,7 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
     CACHEKEY dependent_keys[2];
     dependent_keys[0] = make_blocknum(1);
     dependent_keys[1] = make_blocknum(2);
-    u_int32_t dependent_fullhash[2];
+    uint32_t dependent_fullhash[2];
     dependent_fullhash[0] = 1;
     dependent_fullhash[1] = 2;
     // now we set the dirty state of these two.
@@ -116,12 +116,12 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
     //
     // This call should cause a flush for both
     //
-    check_me = TRUE;
-    v1_written = FALSE;
-    v2_written = FALSE;
+    check_me = true;
+    v1_written = false;
+    v2_written = false;
 
     CACHEKEY put_key;
-    u_int32_t put_fullhash;
+    uint32_t put_fullhash;
     r = toku_cachetable_put_with_dep_pairs(
         f1,
         get_key_and_fullhash,
@@ -146,7 +146,7 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
         assert(v2_written == write_second);
     }
     
-    check_me = FALSE;
+    check_me = false;
     r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
     r = toku_cachetable_unpin(f1, make_blocknum(2), 2, CACHETABLE_CLEAN, make_pair_attr(8));
     r = toku_cachetable_unpin(f1, make_blocknum(3), 3, CACHETABLE_CLEAN, make_pair_attr(8));
@@ -162,7 +162,7 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
     }
 
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
@@ -171,13 +171,13 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
 int
 test_main(int argc, const char *argv[]) {
   default_parse_args(argc, argv);
-  cachetable_test(FALSE,FALSE,TRUE);
-  cachetable_test(FALSE,TRUE,TRUE);
-  cachetable_test(TRUE,FALSE,TRUE);
-  cachetable_test(TRUE,TRUE,TRUE);
-  cachetable_test(FALSE,FALSE,FALSE);
-  cachetable_test(FALSE,TRUE,FALSE);
-  cachetable_test(TRUE,FALSE,FALSE);
-  cachetable_test(TRUE,TRUE,FALSE);
+  cachetable_test(false,false,true);
+  cachetable_test(false,true,true);
+  cachetable_test(true,false,true);
+  cachetable_test(true,true,true);
+  cachetable_test(false,false,false);
+  cachetable_test(false,true,false);
+  cachetable_test(true,false,false);
+  cachetable_test(true,true,false);
   return 0;
 }
diff --git a/ft/tests/cachetable-simple-unpin-remove-checkpoint.cc b/ft/tests/cachetable-simple-unpin-remove-checkpoint.cc
index 15a626116afed70c52dea92664454f17b1718fc6..676398619f9fd0aa020f9acddeda37133f9e1fab 100644
--- a/ft/tests/cachetable-simple-unpin-remove-checkpoint.cc
+++ b/ft/tests/cachetable-simple-unpin-remove-checkpoint.cc
@@ -7,7 +7,7 @@
 
 static void remove_key_expect_checkpoint(
     CACHEKEY* UU(cachekey), 
-    BOOL for_checkpoint, 
+    bool for_checkpoint, 
     void* UU(extra)
     ) 
 {
@@ -16,7 +16,7 @@ static void remove_key_expect_checkpoint(
 
 static void remove_key_expect_no_checkpoint(
     CACHEKEY* UU(cachekey), 
-    BOOL for_checkpoint, 
+    bool for_checkpoint, 
     void* UU(extra)
     ) 
 {
@@ -39,7 +39,7 @@ cachetable_test (void) {
   long s1;
   //long s2;
   CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
-  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
   r = toku_cachetable_begin_checkpoint(ct, NULL); assert(r == 0);
   r = toku_cachetable_unpin_and_remove(f1, make_blocknum(1), remove_key_expect_checkpoint, NULL);  
   r = toku_cachetable_end_checkpoint(
@@ -50,12 +50,12 @@ cachetable_test (void) {
       );
   assert(r==0);
 
-  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
   r = toku_cachetable_unpin_and_remove(f1, make_blocknum(1), remove_key_expect_no_checkpoint, NULL);  
 
   
   toku_cachetable_verify(ct);
-  r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+  r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
   r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
diff --git a/ft/tests/cachetable-simple-verify.cc b/ft/tests/cachetable-simple-verify.cc
index 3fd470e8c120b07b3f7b65817fe2de2deebe9404..87a258c6917b0fcb3db8f26fc7623660b995cf50 100644
--- a/ft/tests/cachetable-simple-verify.cc
+++ b/ft/tests/cachetable-simple-verify.cc
@@ -21,10 +21,10 @@ cachetable_test (void) {
   long s1;
   //long s2;
   CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
-  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+  r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
   r = toku_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8));
   toku_cachetable_verify(ct);
-  r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+  r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
   r = toku_cachetable_close(&ct); lazy_assert_zero(r);
 
 
diff --git a/ft/tests/cachetable-test.cc b/ft/tests/cachetable-test.cc
index c2e2ea2458ab3b64d3ca675080195348d1a21dfa..016061b797596211daf35ca054d48cb4f2caf0d1 100644
--- a/ft/tests/cachetable-test.cc
+++ b/ft/tests/cachetable-test.cc
@@ -96,10 +96,10 @@ static void flush (CACHEFILE f,
 		   void *extra __attribute__((__unused__)),
 		   PAIR_ATTR size __attribute__((__unused__)),
         PAIR_ATTR* new_size      __attribute__((__unused__)),
-		   BOOL write_me __attribute__((__unused__)),
-		   BOOL keep_me __attribute__((__unused__)),
-		   BOOL for_checkpoint __attribute__((__unused__)),
-        BOOL UU(is_clone)
+		   bool write_me __attribute__((__unused__)),
+		   bool keep_me __attribute__((__unused__)),
+		   bool for_checkpoint __attribute__((__unused__)),
+        bool UU(is_clone)
 		   ) {
     struct item *CAST_FROM_VOIDP(it, value);
     int i;
@@ -128,7 +128,7 @@ static void flush (CACHEFILE f,
     toku_free(value);
 }
 
-static struct item *make_item (u_int64_t key) {
+static struct item *make_item (uint64_t key) {
     struct item *MALLOC(it);
     it->key.b=key;
     it->something="something";
@@ -136,7 +136,7 @@ static struct item *make_item (u_int64_t key) {
 }
 
 static CACHEKEY did_fetch={-1};
-static int fetch (CACHEFILE f, int UU(fd), CACHEKEY key, u_int32_t fullhash __attribute__((__unused__)), void**value, void** UU(dd), PAIR_ATTR *sizep __attribute__((__unused__)), int  *dirtyp, void*extraargs) {
+static int fetch (CACHEFILE f, int UU(fd), CACHEKEY key, uint32_t fullhash __attribute__((__unused__)), void**value, void** UU(dd), PAIR_ATTR *sizep __attribute__((__unused__)), int  *dirtyp, void*extraargs) {
     if (verbose) printf("Fetch %" PRId64 "\n", key.b);
     assert (expect_f==f);
     assert((long)extraargs==23);
@@ -173,13 +173,13 @@ static void test0 (void) {
     expect_f = f;
 
     expect_n_flushes=0;
-    u_int32_t h1 = toku_cachetable_hash(f, make_blocknum(1));
-    u_int32_t h2 = toku_cachetable_hash(f, make_blocknum(2));
-    u_int32_t h3 = toku_cachetable_hash(f, make_blocknum(3));
-    u_int32_t h4 = toku_cachetable_hash(f, make_blocknum(4));
-    u_int32_t h5 = toku_cachetable_hash(f, make_blocknum(5));
-    u_int32_t h6 = toku_cachetable_hash(f, make_blocknum(6));
-    u_int32_t h7 = toku_cachetable_hash(f, make_blocknum(7));
+    uint32_t h1 = toku_cachetable_hash(f, make_blocknum(1));
+    uint32_t h2 = toku_cachetable_hash(f, make_blocknum(2));
+    uint32_t h3 = toku_cachetable_hash(f, make_blocknum(3));
+    uint32_t h4 = toku_cachetable_hash(f, make_blocknum(4));
+    uint32_t h5 = toku_cachetable_hash(f, make_blocknum(5));
+    uint32_t h6 = toku_cachetable_hash(f, make_blocknum(6));
+    uint32_t h7 = toku_cachetable_hash(f, make_blocknum(7));
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(t3);
     wc.flush_callback = flush;
     r=toku_cachetable_put(f, make_blocknum(1), h1, make_item(1), make_pair_attr(test_object_size), wc);   /* 1P */        /* this is the lru list.  1 is pinned. */
@@ -236,7 +236,7 @@ static void test0 (void) {
     {
 	void *item_v=0;
 	expect_init(); 
-	r=toku_cachetable_get_and_pin(f, make_blocknum(5), toku_cachetable_hash(f, make_blocknum(5)), &item_v, NULL, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, t3);  /* 5P 7U 6P 4P 1P */
+	r=toku_cachetable_get_and_pin(f, make_blocknum(5), toku_cachetable_hash(f, make_blocknum(5)), &item_v, NULL, wc, fetch, def_pf_req_callback, def_pf_callback, true, t3);  /* 5P 7U 6P 4P 1P */
 	assert(r==0);
 	assert(((struct item *)item_v)->key.b==5);
 	assert(strcmp(((struct item *)item_v)->something,"something")==0);
@@ -253,7 +253,7 @@ static void test0 (void) {
 	did_fetch=make_blocknum(-1);
         CACHETABLE_WRITE_CALLBACK wc2 = def_write_callback(t3);
         wc2.flush_callback = flush;
-	r=toku_cachetable_get_and_pin(f, make_blocknum(2), toku_cachetable_hash(f, make_blocknum(2)), &item_v, NULL, wc2, fetch, def_pf_req_callback, def_pf_callback, TRUE, t3);  /* 2p 5P 7U 6P 1P */
+	r=toku_cachetable_get_and_pin(f, make_blocknum(2), toku_cachetable_hash(f, make_blocknum(2)), &item_v, NULL, wc2, fetch, def_pf_req_callback, def_pf_callback, true, t3);  /* 2p 5P 7U 6P 1P */
 	assert(r==0);
 	assert(did_fetch.b==2); /* Expect that 2 is fetched in. */
 	assert(((struct item *)item_v)->key.b==2);
@@ -283,7 +283,7 @@ static void test0 (void) {
     expectN(7);
     expectN(6);
     expectN(1);
-    r=toku_cachefile_close(&f, 0, FALSE, ZERO_LSN);
+    r=toku_cachefile_close(&f, 0, false, ZERO_LSN);
     assert(r==0);
     r=toku_cachetable_close(&t);
     assert(r==0);
@@ -298,15 +298,15 @@ static void flush_n (CACHEFILE f __attribute__((__unused__)), int UU(fd), CACHEK
 		     void *extra  __attribute__((__unused__)),
                      PAIR_ATTR size __attribute__((__unused__)),
         PAIR_ATTR* new_size      __attribute__((__unused__)),
-		     BOOL write_me __attribute__((__unused__)),    BOOL keep_me __attribute__((__unused__)),
-		     BOOL for_checkpoint __attribute__ ((__unused__)),
-        BOOL UU(is_clone)
+		     bool write_me __attribute__((__unused__)),    bool keep_me __attribute__((__unused__)),
+		     bool for_checkpoint __attribute__ ((__unused__)),
+        bool UU(is_clone)
 		     ) {
     int *CAST_FROM_VOIDP(v, value);
     assert(*v==0);
 }
 static int fetch_n (CACHEFILE f __attribute__((__unused__)), int UU(fd), CACHEKEY key __attribute__((__unused__)),
-		    u_int32_t fullhash  __attribute__((__unused__)),
+		    uint32_t fullhash  __attribute__((__unused__)),
                     void**value, 
 		    void** UU(dd),
 PAIR_ATTR *sizep __attribute__((__unused__)), 
@@ -336,13 +336,13 @@ static void test_nested_pin (void) {
     expect_f = f;
 
     i0=0; i1=0;
-    u_int32_t f1hash = toku_cachetable_hash(f, make_blocknum(1));
+    uint32_t f1hash = toku_cachetable_hash(f, make_blocknum(1));
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(f2);
     wc.flush_callback = flush_n;
     r = toku_cachetable_put(f, make_blocknum(1), f1hash, &i0, make_pair_attr(1), wc);
     assert(r==0);
     r = toku_cachetable_unpin(f, make_blocknum(1), f1hash, CACHETABLE_CLEAN, make_pair_attr(test_object_size));
-    r = toku_cachetable_get_and_pin(f, make_blocknum(1), f1hash, &vv, NULL, wc, fetch_n, def_pf_req_callback, def_pf_callback, TRUE, f2);
+    r = toku_cachetable_get_and_pin(f, make_blocknum(1), f1hash, &vv, NULL, wc, fetch_n, def_pf_req_callback, def_pf_callback, true, f2);
     assert(r==0);
     assert(vv==&i0);
     assert(i0==0);
@@ -353,13 +353,13 @@ static void test_nested_pin (void) {
     assert(vv2==vv);
     r = toku_cachetable_unpin(f, make_blocknum(1), f1hash, CACHETABLE_CLEAN, make_pair_attr(test_object_size));
     assert(r==0);
-    u_int32_t f2hash = toku_cachetable_hash(f, make_blocknum(2));
+    uint32_t f2hash = toku_cachetable_hash(f, make_blocknum(2));
     r = toku_cachetable_put(f, make_blocknum(2), f2hash, &i1, make_pair_attr(test_object_size), wc);
     assert(r==0); // The other one is pinned, but now the cachetable fails gracefully:  It allows the pin to happen
     r = toku_cachetable_unpin(f, make_blocknum(2), f2hash, CACHETABLE_CLEAN, make_pair_attr(test_object_size));
     assert(r==0);
     //    toku_os_usleep(1*1000000);
-    r = toku_cachefile_close(&f, 0, FALSE, ZERO_LSN); assert(r==0);
+    r = toku_cachefile_close(&f, 0, false, ZERO_LSN); assert(r==0);
     r = toku_cachetable_close(&t); assert(r==0);
 }
 
@@ -372,14 +372,14 @@ static void null_flush (CACHEFILE cf     __attribute__((__unused__)),
                         void *extra      __attribute__((__unused__)),
                         PAIR_ATTR size        __attribute__((__unused__)),
         PAIR_ATTR* new_size      __attribute__((__unused__)),
-                        BOOL write_me    __attribute__((__unused__)),
-                        BOOL keep_me     __attribute__((__unused__)),
-                        BOOL for_checkpoint __attribute__((__unused__)),
-        BOOL UU(is_clone)
+                        bool write_me    __attribute__((__unused__)),
+                        bool keep_me     __attribute__((__unused__)),
+                        bool for_checkpoint __attribute__((__unused__)),
+        bool UU(is_clone)
                         ) {
 }
 
-static int add123_fetch (CACHEFILE cf, int UU(fd), CACHEKEY key, u_int32_t fullhash, void **value, 
+static int add123_fetch (CACHEFILE cf, int UU(fd), CACHEKEY key, uint32_t fullhash, void **value, 
 			 void** UU(dd),
 PAIR_ATTR *sizep __attribute__((__unused__)), int * dirtyp, void*extraargs) {
     assert(fullhash==toku_cachetable_hash(cf,key));
@@ -390,7 +390,7 @@ PAIR_ATTR *sizep __attribute__((__unused__)), int * dirtyp, void*extraargs) {
     return 0;
 }
 
-static int add222_fetch (CACHEFILE cf, int UU(fd), CACHEKEY key, u_int32_t fullhash, void **value, 
+static int add222_fetch (CACHEFILE cf, int UU(fd), CACHEKEY key, uint32_t fullhash, void **value, 
 			 void** UU(dd),
 PAIR_ATTR *sizep __attribute__((__unused__)), int * dirtyp, void*extraargs) {
     assert(fullhash==toku_cachetable_hash(cf,key));
@@ -427,21 +427,21 @@ static void test_multi_filehandles (void) {
     wc.flush_callback = null_flush;
     r = toku_cachetable_put(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), (void*)124, make_pair_attr(test_object_size), wc); assert(r==0);
     r = toku_cachetable_unpin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), CACHETABLE_DIRTY, make_pair_attr(0)); assert(r==0);
-    r = toku_cachetable_get_and_pin(f2, make_blocknum(1), toku_cachetable_hash(f2, make_blocknum(1)), &v, NULL, wc, add123_fetch, def_pf_req_callback, def_pf_callback, TRUE, (void*)123); assert(r==0);
+    r = toku_cachetable_get_and_pin(f2, make_blocknum(1), toku_cachetable_hash(f2, make_blocknum(1)), &v, NULL, wc, add123_fetch, def_pf_req_callback, def_pf_callback, true, (void*)123); assert(r==0);
     assert((unsigned long)v==124);
-    r = toku_cachetable_get_and_pin(f2, make_blocknum(2), toku_cachetable_hash(f2, make_blocknum(2)), &v, NULL, wc, add123_fetch, def_pf_req_callback, def_pf_callback, TRUE, (void*)123); assert(r==0);
+    r = toku_cachetable_get_and_pin(f2, make_blocknum(2), toku_cachetable_hash(f2, make_blocknum(2)), &v, NULL, wc, add123_fetch, def_pf_req_callback, def_pf_callback, true, (void*)123); assert(r==0);
     assert((unsigned long)v==125);
     wc.write_extraargs = (void*)222;
-    r = toku_cachetable_get_and_pin(f3, make_blocknum(2), toku_cachetable_hash(f3, make_blocknum(2)), &v, NULL, wc, add222_fetch, def_pf_req_callback, def_pf_callback, TRUE, (void*)222); assert(r==0);
+    r = toku_cachetable_get_and_pin(f3, make_blocknum(2), toku_cachetable_hash(f3, make_blocknum(2)), &v, NULL, wc, add222_fetch, def_pf_req_callback, def_pf_callback, true, (void*)222); assert(r==0);
     assert((unsigned long)v==224);
 
     // we support only one close for a file handle
     r = toku_cachetable_unpin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), CACHETABLE_CLEAN, make_pair_attr(0)); assert(r==0);
     r = toku_cachetable_unpin(f2, make_blocknum(2), toku_cachetable_hash(f2, make_blocknum(2)), CACHETABLE_CLEAN, make_pair_attr(0)); assert(r==0);
-    r = toku_cachefile_close(&f2, 0, FALSE, ZERO_LSN); assert(r==0);
+    r = toku_cachefile_close(&f2, 0, false, ZERO_LSN); assert(r==0);
 
     r = toku_cachetable_unpin(f3, make_blocknum(2), toku_cachetable_hash(f3, make_blocknum(2)), CACHETABLE_CLEAN, make_pair_attr(0)); assert(r==0);
-    r = toku_cachefile_close(&f3, 0, FALSE, ZERO_LSN); assert(r==0);
+    r = toku_cachefile_close(&f3, 0, false, ZERO_LSN); assert(r==0);
 
     r = toku_cachetable_close(&t); assert(r==0);
 }
@@ -456,15 +456,15 @@ static void test_dirty_flush(CACHEFILE f,
 			     void *extra __attribute__((__unused__)),
 			     PAIR_ATTR size,
         PAIR_ATTR* new_size      __attribute__((__unused__)),
-			     BOOL do_write,
-			     BOOL keep,
-			     BOOL for_checkpoint __attribute__((__unused__)),
-        BOOL UU(is_clone)
+			     bool do_write,
+			     bool keep,
+			     bool for_checkpoint __attribute__((__unused__)),
+        bool UU(is_clone)
 			     ) {
     if (verbose) printf("test_dirty_flush %p %" PRId64 " %p %ld %u %u\n", f, key.b, value, size.size, (unsigned)do_write, (unsigned)keep);
 }
 
-static int test_dirty_fetch(CACHEFILE f, int UU(fd), CACHEKEY key, u_int32_t fullhash, void **value_ptr, 
+static int test_dirty_fetch(CACHEFILE f, int UU(fd), CACHEKEY key, uint32_t fullhash, void **value_ptr, 
 			    void** UU(dd),
 PAIR_ATTR *size_ptr, int * dirtyp, void *arg) {
     *value_ptr = arg;
@@ -493,7 +493,7 @@ static void test_dirty(void) {
     assert(r == 0);
 
     key = make_blocknum(1); value = (void*)1;
-    u_int32_t hkey = toku_cachetable_hash(f, key);
+    uint32_t hkey = toku_cachetable_hash(f, key);
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = test_dirty_flush;
     r = toku_cachetable_put(f, key, hkey, value, make_pair_attr(test_object_size), wc);
@@ -513,7 +513,7 @@ static void test_dirty(void) {
     assert(pinned == 0);
 
     r = toku_cachetable_get_and_pin(f, key, hkey, &value, NULL, wc,
-				    test_dirty_fetch, def_pf_req_callback, def_pf_callback, TRUE, 0);
+				    test_dirty_fetch, def_pf_req_callback, def_pf_callback, true, 0);
     assert(r == 0);
 
     // cachetable_print_state(t);
@@ -535,7 +535,7 @@ static void test_dirty(void) {
     hkey = toku_cachetable_hash(f, key);
     r = toku_cachetable_get_and_pin(f, key, hkey,
 				    &value, NULL, wc,
-				    test_dirty_fetch, def_pf_req_callback, def_pf_callback, TRUE, 0);
+				    test_dirty_fetch, def_pf_req_callback, def_pf_callback, true, 0);
     assert(r == 0);
 
     // cachetable_print_state(t);
@@ -555,7 +555,7 @@ static void test_dirty(void) {
 
     r = toku_cachetable_get_and_pin(f, key, hkey,
 				    &value, NULL, wc,
-				    test_dirty_fetch, def_pf_req_callback, def_pf_callback, TRUE, 0);
+				    test_dirty_fetch, def_pf_req_callback, def_pf_callback, true, 0);
     assert(r == 0);
 
     // cachetable_print_state(t);
@@ -573,7 +573,7 @@ static void test_dirty(void) {
     assert(dirty == 1);
     assert(pinned == 0);
      
-    r = toku_cachefile_close(&f, 0, FALSE, ZERO_LSN);
+    r = toku_cachefile_close(&f, 0, false, ZERO_LSN);
     assert(r == 0);
     r = toku_cachetable_close(&t);
     assert(r == 0);
@@ -590,10 +590,10 @@ static void test_size_flush_callback(CACHEFILE f,
 				     void *extra __attribute__((__unused__)),
 				     PAIR_ATTR size,
         PAIR_ATTR* new_size      __attribute__((__unused__)),
-				     BOOL do_write,
-				     BOOL keep,
-				     BOOL for_checkpoint __attribute__((__unused__)),
-        BOOL UU(is_clone)
+				     bool do_write,
+				     bool keep,
+				     bool for_checkpoint __attribute__((__unused__)),
+        bool UU(is_clone)
 				     ) {
     if (test_size_debug && verbose) printf("test_size_flush %p %" PRId64 " %p %ld %u %u\n", f, key.b, value, size.size, (unsigned)do_write, (unsigned)keep);
     if (keep) {
@@ -628,7 +628,7 @@ static void test_size_resize(void) {
     CACHEKEY key = make_blocknum(42);
     void *value = (void *) -42;
 
-    u_int32_t hkey = toku_cachetable_hash(f, key);
+    uint32_t hkey = toku_cachetable_hash(f, key);
 
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
     wc.flush_callback = test_size_flush_callback;
@@ -649,7 +649,7 @@ static void test_size_resize(void) {
 
     void *current_value;
     long current_size;
-    r = toku_cachetable_get_and_pin(f, key, hkey, &current_value, &current_size, wc, 0, def_pf_req_callback, def_pf_callback, TRUE, 0);
+    r = toku_cachetable_get_and_pin(f, key, hkey, &current_value, &current_size, wc, 0, def_pf_req_callback, def_pf_callback, true, 0);
     assert(r == 0);
     assert(current_value == value);
     assert(current_size == new_size);
@@ -657,7 +657,7 @@ static void test_size_resize(void) {
     r = toku_cachetable_unpin(f, key, hkey, CACHETABLE_CLEAN, make_pair_attr(new_size));
     assert(r == 0);
 
-    r = toku_cachefile_close(&f, 0, FALSE, ZERO_LSN);
+    r = toku_cachefile_close(&f, 0, false, ZERO_LSN);
     assert(r == 0);
     r = toku_cachetable_close(&t);
     assert(r == 0);
@@ -694,7 +694,7 @@ static void test_size_flush(void) {
         CACHEKEY key = make_blocknum(i);
         void *value = (void *)(long)-i;
         //        printf("test_size put %lld %p %lld\n", key, value, size);
-	u_int32_t hkey = toku_cachetable_hash(f, key);
+	uint32_t hkey = toku_cachetable_hash(f, key);
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
         wc.flush_callback = test_size_flush_callback;
         r = toku_cachetable_put(f, key, hkey, value, make_pair_attr(size), wc);
@@ -728,7 +728,7 @@ static void test_size_flush(void) {
         assert(r == 0);
     }
     
-    r = toku_cachefile_close(&f, 0, FALSE, ZERO_LSN);
+    r = toku_cachefile_close(&f, 0, false, ZERO_LSN);
     assert(r == 0);
     r = toku_cachetable_close(&t);
     assert(r == 0);
diff --git a/ft/tests/cachetable-test2.cc b/ft/tests/cachetable-test2.cc
index d8a6ce86622e816c81701e2316e1a5f68d4ce05d..e92a1aa3ee48b886d6842a79d0ec4a551c3f922c 100644
--- a/ft/tests/cachetable-test2.cc
+++ b/ft/tests/cachetable-test2.cc
@@ -103,10 +103,10 @@ static void flush_forchain (CACHEFILE f            __attribute__((__unused__)),
                             void     *extra        __attribute__((__unused__)),
                             PAIR_ATTR      size         __attribute__((__unused__)),
                             PAIR_ATTR* new_size      __attribute__((__unused__)),
-                            BOOL      write_me     __attribute__((__unused__)),
-                            BOOL      keep_me      __attribute__((__unused__)),
-                            BOOL      for_checkpoint     __attribute__((__unused__)),
-        BOOL UU(is_clone)
+                            bool      write_me     __attribute__((__unused__)),
+                            bool      keep_me      __attribute__((__unused__)),
+                            bool      for_checkpoint     __attribute__((__unused__)),
+        bool UU(is_clone)
                             ) {
     if (keep_me) return;
     int *CAST_FROM_VOIDP(v, value);
@@ -117,7 +117,7 @@ static void flush_forchain (CACHEFILE f            __attribute__((__unused__)),
     //print_ints();
 }
 
-static int fetch_forchain (CACHEFILE f, int UU(fd), CACHEKEY key, u_int32_t fullhash, void**value, 
+static int fetch_forchain (CACHEFILE f, int UU(fd), CACHEKEY key, uint32_t fullhash, void**value, 
                            void** UU(dd),
 PAIR_ATTR *sizep __attribute__((__unused__)), int * dirtyp, void*extraargs) {
     assert(toku_cachetable_hash(f, key)==fullhash);
@@ -140,7 +140,7 @@ static void verify_cachetable_against_present (void) {
 
     for (i=0; i<my_n_present; i++) {
         void *v;
-        u_int32_t fullhash = toku_cachetable_hash(my_present_items[i].cf, my_present_items[i].key);
+        uint32_t fullhash = toku_cachetable_hash(my_present_items[i].cf, my_present_items[i].key);
         int r=toku_cachetable_maybe_get_and_pin_clean(my_present_items[i].cf,
                                                 my_present_items[i].key,
                                                 toku_cachetable_hash(my_present_items[i].cf, my_present_items[i].key),
@@ -169,7 +169,7 @@ static void test_chaining (void) {
     for (i=0; i<N_PRESENT_LIMIT; i++) {
         int fnum = i%N_FILES;
         //printf("%s:%d Add %d\n", __SRCFILE__, __LINE__, i);
-        u_int32_t fhash = toku_cachetable_hash(f[fnum], make_blocknum(i));
+        uint32_t fhash = toku_cachetable_hash(f[fnum], make_blocknum(i));
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback((void *)i);
         wc.flush_callback = flush_forchain;
         r = toku_cachetable_put(f[fnum], make_blocknum(i), fhash, (void*)i, make_pair_attr(test_object_size), wc);
@@ -192,7 +192,7 @@ static void test_chaining (void) {
             test_mutex_unlock();
             void *value;
             //printf("Touching %d (%lld, %p)\n", whichone, whichkey, whichcf);
-            u_int32_t fhash = toku_cachetable_hash(whichcf, whichkey);
+            uint32_t fhash = toku_cachetable_hash(whichcf, whichkey);
             CACHETABLE_WRITE_CALLBACK wc = def_write_callback((void*)(long)whichkey.b);
             wc.flush_callback = flush_forchain;
             r = toku_cachetable_get_and_pin(whichcf,
@@ -204,7 +204,7 @@ static void test_chaining (void) {
                                             fetch_forchain,
                                             def_pf_req_callback,
                                             def_pf_callback,
-                                            TRUE, 
+                                            true, 
                                             (void*)(long)whichkey.b
                                             );
             assert(r==0);
@@ -220,7 +220,7 @@ static void test_chaining (void) {
         // i is always incrementing, so we need not worry about inserting a duplicate
         // if i is a duplicate, cachetable_put will return -1
         // printf("%s:%d Add {%ld,%p}\n", __SRCFILE__, __LINE__, i, f[fnum]);
-        u_int32_t fhash = toku_cachetable_hash(f[fnum], make_blocknum(i));
+        uint32_t fhash = toku_cachetable_hash(f[fnum], make_blocknum(i));
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback((void *)i);
         wc.flush_callback = flush_forchain;
         r = toku_cachetable_put(f[fnum], make_blocknum(i), fhash, (void*)i, make_pair_attr(test_object_size), wc);
@@ -247,13 +247,13 @@ static void test_chaining (void) {
             //printf("Close %d (%p), now n_present=%d\n", i, f[i], n_present);
             //print_ints();
             CACHEFILE oldcf=f[i];
-            r = toku_cachefile_close(&f[i], 0, FALSE, ZERO_LSN);                           assert(r==0);
+            r = toku_cachefile_close(&f[i], 0, false, ZERO_LSN);                           assert(r==0);
             file_is_not_present(oldcf);
             r = toku_cachetable_openf(&f[i], ct, fname[i], O_RDWR, S_IRWXU|S_IRWXG|S_IRWXO); assert(r==0);
         }
     }
     for (i=0; i<N_FILES; i++) {
-        r = toku_cachefile_close(&f[i], 0, FALSE, ZERO_LSN); assert(r==0);
+        r = toku_cachefile_close(&f[i], 0, false, ZERO_LSN); assert(r==0);
     }
     r = toku_cachetable_close(&ct); assert(r==0);
 }
diff --git a/ft/tests/cachetable-unpin-and-remove-test.cc b/ft/tests/cachetable-unpin-and-remove-test.cc
index 6841d7a911b464d03a01b62170d4e954344d024e..e2f41a98ec53a4ab3b8f2f7f53d44372f93253e6 100644
--- a/ft/tests/cachetable-unpin-and-remove-test.cc
+++ b/ft/tests/cachetable-unpin-and-remove-test.cc
@@ -9,7 +9,7 @@ static int
 fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void** UU(dd),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -45,7 +45,7 @@ cachetable_unpin_and_remove_test (int n) {
 
     // put the keys into the cachetable
     for (i=0; i<n; i++) {
-        u_int32_t hi = toku_cachetable_hash(f1, make_blocknum(keys[i].b));
+        uint32_t hi = toku_cachetable_hash(f1, make_blocknum(keys[i].b));
         r = toku_cachetable_put(f1, make_blocknum(keys[i].b), hi, (void *)(long) keys[i].b, make_pair_attr(1),wc);
         assert(r == 0);
     }
@@ -55,7 +55,7 @@ cachetable_unpin_and_remove_test (int n) {
     for (i=0; i<n; i++) testkeys[i] = keys[i];
     while (nkeys > 0) {
         i = random() % nkeys;
-        u_int32_t hi = toku_cachetable_hash(f1, make_blocknum(testkeys[i].b));
+        uint32_t hi = toku_cachetable_hash(f1, make_blocknum(testkeys[i].b));
         r = toku_cachetable_unpin_and_remove(f1, testkeys[i], NULL, NULL);
         assert(r == 0);
 
@@ -82,7 +82,7 @@ cachetable_unpin_and_remove_test (int n) {
     assert(nentries == 0);
 
     char *error_string;
-    r = toku_cachefile_close(&f1, &error_string, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, &error_string, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
@@ -102,7 +102,7 @@ cachetable_put_evict_remove_test (int n) {
     r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, 0777); assert(r == 0);
     CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
 
-    u_int32_t hi[n];
+    uint32_t hi[n];
     for (i=0; i<n; i++)
         hi[i] = toku_cachetable_hash(f1, make_blocknum(i));
 
@@ -116,7 +116,7 @@ cachetable_put_evict_remove_test (int n) {
 
     // get 0
     void *v; long s;
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(0), hi[0], &v, &s, wc, fetch, def_pf_req_callback, def_pf_callback, TRUE, 0);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(0), hi[0], &v, &s, wc, fetch, def_pf_req_callback, def_pf_callback, true, 0);
     assert(r == 0);
         
     // remove 0
@@ -124,7 +124,7 @@ cachetable_put_evict_remove_test (int n) {
     assert(r == 0);
 
     char *error_string;
-    r = toku_cachefile_close(&f1, &error_string, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, &error_string, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-unpin-remove-and-checkpoint.cc b/ft/tests/cachetable-unpin-remove-and-checkpoint.cc
index 948e0a07c79e73c265388eb4155dee6aaf874c6d..31f0a9f03a65032ae4beefbfd7aa78e98be70099 100644
--- a/ft/tests/cachetable-unpin-remove-and-checkpoint.cc
+++ b/ft/tests/cachetable-unpin-remove-and-checkpoint.cc
@@ -39,7 +39,7 @@ run_test (void) {
     //void* v2;
     long s1;
     //long s2;
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
     toku_cachetable_unpin(
         f1, 
         make_blocknum(1), 
@@ -50,7 +50,7 @@ run_test (void) {
 
     // now this should mark the pair for checkpoint
     r = toku_cachetable_begin_checkpoint(ct, NULL);
-    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, TRUE, NULL);
+    r = toku_cachetable_get_and_pin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
 
     toku_pthread_t mytid;
     r = toku_pthread_create(&mytid, NULL, run_end_chkpt, NULL);
@@ -66,7 +66,7 @@ run_test (void) {
     assert(r==0);
     
     toku_cachetable_verify(ct);
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); lazy_assert_zero(r);
     
     
diff --git a/ft/tests/cachetable-unpin-test.cc b/ft/tests/cachetable-unpin-test.cc
index 53f5632769f6cf42a3c0d45036dd705618e96e2c..6ffc397efd6be82b29c1461964b191e61f042c5e 100644
--- a/ft/tests/cachetable-unpin-test.cc
+++ b/ft/tests/cachetable-unpin-test.cc
@@ -20,7 +20,7 @@ cachetable_unpin_test (int n) {
 
     int i;
     for (i=1; i<=n; i++) {
-        u_int32_t hi;
+        uint32_t hi;
         CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
         hi = toku_cachetable_hash(f1, make_blocknum(i));
         r = toku_cachetable_put(f1, make_blocknum(i), hi, (void *)(long)i, make_pair_attr(1), wc);
@@ -37,7 +37,7 @@ cachetable_unpin_test (int n) {
         assert(toku_cachefile_count_pinned(f1, 0) == i);
     }
     for (i=n; i>0; i--) {
-        u_int32_t hi;
+        uint32_t hi;
         hi = toku_cachetable_hash(f1, make_blocknum(i));
         r = toku_cachetable_unpin(f1, make_blocknum(i), hi, CACHETABLE_CLEAN, make_pair_attr(1));
         assert(r == 0);
@@ -50,7 +50,7 @@ cachetable_unpin_test (int n) {
     r = toku_cachetable_unpin(f1, k, toku_cachetable_hash(f1, k), CACHETABLE_CLEAN, make_pair_attr(1));
     assert(r != 0);
 
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/cachetable-writer-thread-limit.cc b/ft/tests/cachetable-writer-thread-limit.cc
index 8a92f34c7f469a2e94de9526680d708127bb0c11..8da68ba80ac2055a1bdf6ae92a34442f9cc6b34a 100644
--- a/ft/tests/cachetable-writer-thread-limit.cc
+++ b/ft/tests/cachetable-writer-thread-limit.cc
@@ -19,10 +19,10 @@ flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-        BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+        bool UU(is_clone)
        ) {
     if (w) {
         int curr_size = __sync_fetch_and_sub(&total_size, 1);
@@ -54,7 +54,7 @@ cachetable_test (void) {
         r = toku_cachetable_unpin(f1, make_blocknum(i), i, CACHETABLE_DIRTY, make_pair_attr(4));
     }
     
-    r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0);
+    r = toku_cachefile_close(&f1, 0, false, ZERO_LSN); assert(r == 0);
     r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
 }
 
diff --git a/ft/tests/ft-bfe-query.cc b/ft/tests/ft-bfe-query.cc
index 2665190c867ee72ebe503eefe48a04ba7dde22bb..5bdba73419fa48564c7e13f6fe6fda9e6deee6f4 100644
--- a/ft/tests/ft-bfe-query.cc
+++ b/ft/tests/ft-bfe-query.cc
@@ -27,15 +27,15 @@ test_prefetch_read(int fd, FT_HANDLE UU(brt), FT brt_h) {
     // first test that prefetching everything should work
     memset(&cursor->range_lock_left_key, 0 , sizeof(DBT));
     memset(&cursor->range_lock_right_key, 0 , sizeof(DBT));
-    cursor->left_is_neg_infty = TRUE;
-    cursor->right_is_pos_infty = TRUE;
-    cursor->disable_prefetching = FALSE;
+    cursor->left_is_neg_infty = true;
+    cursor->right_is_pos_infty = true;
+    cursor->disable_prefetching = false;
     
     struct ftnode_fetch_extra bfe;
 
     // quick test to see that we have the right behavior when we set
-    // disable_prefetching to TRUE
-    cursor->disable_prefetching = TRUE;
+    // disable_prefetching to true
+    cursor->disable_prefetching = true;
     fill_bfe_for_prefetch(&bfe, brt_h, cursor);
     FTNODE_DISK_DATA ndd = NULL;
     r = toku_deserialize_ftnode_from(fd, make_blocknum(20), 0/*pass zero for hash*/, &dn, &ndd, &bfe);
@@ -53,7 +53,7 @@ test_prefetch_read(int fd, FT_HANDLE UU(brt), FT brt_h) {
     toku_free(ndd);
 
     // now enable prefetching again
-    cursor->disable_prefetching = FALSE;
+    cursor->disable_prefetching = false;
     
     fill_bfe_for_prefetch(&bfe, brt_h, cursor);
     r = toku_deserialize_ftnode_from(fd, make_blocknum(20), 0/*pass zero for hash*/, &dn, &ndd, &bfe);
@@ -74,9 +74,9 @@ test_prefetch_read(int fd, FT_HANDLE UU(brt), FT brt_h) {
     toku_ftnode_free(&dn);
     toku_free(ndd);
 
-    u_int64_t left_key = 150;
-    toku_fill_dbt(&cursor->range_lock_left_key, &left_key, sizeof(u_int64_t));
-    cursor->left_is_neg_infty = FALSE;
+    uint64_t left_key = 150;
+    toku_fill_dbt(&cursor->range_lock_left_key, &left_key, sizeof(uint64_t));
+    cursor->left_is_neg_infty = false;
     fill_bfe_for_prefetch(&bfe, brt_h, cursor);
     r = toku_deserialize_ftnode_from(fd, make_blocknum(20), 0/*pass zero for hash*/, &dn, &ndd, &bfe);
     assert(r==0);
@@ -96,9 +96,9 @@ test_prefetch_read(int fd, FT_HANDLE UU(brt), FT brt_h) {
     toku_ftnode_free(&dn);
     toku_free(ndd);
 
-    u_int64_t right_key = 151;
-    toku_fill_dbt(&cursor->range_lock_right_key, &right_key, sizeof(u_int64_t));
-    cursor->right_is_pos_infty = FALSE;
+    uint64_t right_key = 151;
+    toku_fill_dbt(&cursor->range_lock_right_key, &right_key, sizeof(uint64_t));
+    cursor->right_is_pos_infty = false;
     fill_bfe_for_prefetch(&bfe, brt_h, cursor);
     r = toku_deserialize_ftnode_from(fd, make_blocknum(20), 0/*pass zero for hash*/, &dn, &ndd, &bfe);
     assert(r==0);
@@ -175,13 +175,13 @@ test_subset_read(int fd, FT_HANDLE UU(brt), FT brt_h) {
     // first test that prefetching everything should work
     memset(&cursor->range_lock_left_key, 0 , sizeof(DBT));
     memset(&cursor->range_lock_right_key, 0 , sizeof(DBT));
-    cursor->left_is_neg_infty = TRUE;
-    cursor->right_is_pos_infty = TRUE;
+    cursor->left_is_neg_infty = true;
+    cursor->right_is_pos_infty = true;
     
     struct ftnode_fetch_extra bfe;
 
-    u_int64_t left_key = 150;
-    u_int64_t right_key = 151;
+    uint64_t left_key = 150;
+    uint64_t right_key = 151;
     DBT left, right;
     toku_fill_dbt(&left, &left_key, sizeof(left_key));
     toku_fill_dbt(&right, &right_key, sizeof(right_key));
@@ -191,15 +191,15 @@ test_subset_read(int fd, FT_HANDLE UU(brt), FT brt_h) {
         NULL, 
         &left,
         &right,
-        FALSE,
-        FALSE,
-        FALSE
+        false,
+        false,
+        false
         );
     
     // fake the childnum to read
     // set disable_prefetching ON
     bfe.child_to_read = 2;
-    bfe.disable_prefetching = TRUE;
+    bfe.disable_prefetching = true;
     r = toku_deserialize_ftnode_from(fd, make_blocknum(20), 0/*pass zero for hash*/, &dn, &ndd, &bfe);
     assert(r==0);
     assert(dn->n_children == 3);
@@ -224,7 +224,7 @@ test_subset_read(int fd, FT_HANDLE UU(brt), FT brt_h) {
 
     // fake the childnum to read
     bfe.child_to_read = 2;
-    bfe.disable_prefetching = FALSE;
+    bfe.disable_prefetching = false;
     r = toku_deserialize_ftnode_from(fd, make_blocknum(20), 0/*pass zero for hash*/, &dn, &ndd, &bfe);
     assert(r==0);
     assert(dn->n_children == 3);
@@ -296,8 +296,8 @@ test_prefetching(void) {
     sn.n_children = 3;
     sn.dirty = 1;
 
-    u_int64_t key1 = 100;
-    u_int64_t key2 = 200;
+    uint64_t key1 = 100;
+    uint64_t key2 = 200;
     
     MALLOC_N(sn.n_children, sn.bp);
     MALLOC_N(sn.n_children-1, sn.childkeys);
@@ -352,7 +352,7 @@ test_prefetching(void) {
     {
         DISKOFF offset;
         DISKOFF size;
-        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, FALSE);
+        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, false);
         assert(offset==BLOCK_ALLOCATOR_TOTAL_HEADER_RESERVE);
 
         toku_translate_blocknum_to_offset_size(brt_h->blocktable, b, &offset, &size);
@@ -360,7 +360,7 @@ test_prefetching(void) {
         assert(size   == 100);
     }
     FTNODE_DISK_DATA ndd = NULL;
-    r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, FALSE);
+    r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, true, brt->ft, false);
     assert(r==0);
 
     test_prefetch_read(fd, brt, brt_h);    
diff --git a/ft/tests/ft-clock-test.cc b/ft/tests/ft-clock-test.cc
index 8b071b97c2aa3effbc4dd2e6e05b45e894a46135..90dc4532c0c967befc7bbdccced79541cb54313d 100644
--- a/ft/tests/ft-clock-test.cc
+++ b/ft/tests/ft-clock-test.cc
@@ -28,7 +28,7 @@ static int omt_cmp(OMTVALUE p, void *q)
     LEAFENTRY CAST_FROM_VOIDP(a, p);
     LEAFENTRY CAST_FROM_VOIDP(b, q);
     void *ak, *bk;
-    u_int32_t al, bl;
+    uint32_t al, bl;
     ak = le_key_and_len(a, &al);
     bk = le_key_and_len(b, &bl);
     int l = MIN(al, bl);
@@ -72,7 +72,7 @@ test1(int fd, FT brt_h, FTNODE *dn) {
     fill_bfe_for_full_read(&bfe_all, brt_h);
     FTNODE_DISK_DATA ndd = NULL;
     r = toku_deserialize_ftnode_from(fd, make_blocknum(20), 0/*pass zero for hash*/, dn, &ndd, &bfe_all);
-    BOOL is_leaf = ((*dn)->height == 0);
+    bool is_leaf = ((*dn)->height == 0);
     assert(r==0);
     for (int i = 0; i < (*dn)->n_children; i++) {
         assert(BP_STATE(*dn,i) == PT_AVAIL);
@@ -95,7 +95,7 @@ test1(int fd, FT brt_h, FTNODE *dn) {
         }
     }
     PAIR_ATTR size;
-    BOOL req = toku_ftnode_pf_req_callback(*dn, &bfe_all);
+    bool req = toku_ftnode_pf_req_callback(*dn, &bfe_all);
     assert(req);
     toku_ftnode_pf_callback(*dn, ndd, &bfe_all, fd, &size);
     toku_ftnode_pe_callback(*dn, attr, &attr, brt_h);
@@ -160,14 +160,14 @@ test2(int fd, FT brt_h, FTNODE *dn) {
             ),
         &left,
         &right,
-        TRUE,
-        TRUE,
-        FALSE
+        true,
+        true,
+        false
         );
     FTNODE_DISK_DATA ndd = NULL;
     int r = toku_deserialize_ftnode_from(fd, make_blocknum(20), 0/*pass zero for hash*/, dn, &ndd, &bfe_subset);
     assert(r==0);
-    BOOL is_leaf = ((*dn)->height == 0);
+    bool is_leaf = ((*dn)->height == 0);
     // at this point, although both partitions are available, only the 
     // second basement node should have had its clock
     // touched
@@ -184,7 +184,7 @@ test2(int fd, FT brt_h, FTNODE *dn) {
     toku_ftnode_pe_callback(*dn, attr, &attr, brt_h);
     assert(BP_STATE(*dn, 1) == (is_leaf) ? PT_ON_DISK : PT_COMPRESSED);
 
-    BOOL req = toku_ftnode_pf_req_callback(*dn, &bfe_subset);
+    bool req = toku_ftnode_pf_req_callback(*dn, &bfe_subset);
     assert(req);
     toku_ftnode_pf_callback(*dn, ndd, &bfe_subset, fd, &attr);
     assert(BP_STATE(*dn, 0) == PT_AVAIL);
@@ -297,7 +297,7 @@ test_serialize_nonleaf(void) {
     {
         DISKOFF offset;
         DISKOFF size;
-        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, FALSE);
+        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, false);
         assert(offset==BLOCK_ALLOCATOR_TOTAL_HEADER_RESERVE);
 
         toku_translate_blocknum_to_offset_size(brt_h->blocktable, b, &offset, &size);
@@ -305,7 +305,7 @@ test_serialize_nonleaf(void) {
         assert(size   == 100);
     }
     FTNODE_DISK_DATA ndd = NULL;
-    r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, FALSE);
+    r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, true, brt->ft, false);
     assert(r==0);
 
     test1(fd, brt_h, &dn);
@@ -389,7 +389,7 @@ test_serialize_leaf(void) {
     {
         DISKOFF offset;
         DISKOFF size;
-        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, FALSE);
+        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, false);
         assert(offset==BLOCK_ALLOCATOR_TOTAL_HEADER_RESERVE);
 
         toku_translate_blocknum_to_offset_size(brt_h->blocktable, b, &offset, &size);
@@ -397,7 +397,7 @@ test_serialize_leaf(void) {
         assert(size   == 100);
     }
     FTNODE_DISK_DATA ndd = NULL;
-    r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, FALSE);
+    r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, true, brt->ft, false);
     assert(r==0);
 
     test1(fd, brt_h, &dn);
diff --git a/ft/tests/ft-serialize-benchmark.cc b/ft/tests/ft-serialize-benchmark.cc
index ea82c80b0d2a11b274b26c51eb7cada6de416afd..761698c17a9392572f61a394a50ca6119ad2bca6 100644
--- a/ft/tests/ft-serialize-benchmark.cc
+++ b/ft/tests/ft-serialize-benchmark.cc
@@ -18,7 +18,7 @@ static int omt_cmp(OMTVALUE p, void *q)
     LEAFENTRY CAST_FROM_VOIDP(a, p);
     LEAFENTRY CAST_FROM_VOIDP(b, q);
     void *ak, *bk;
-    u_int32_t al, bl;
+    uint32_t al, bl;
     ak = le_key_and_len(a, &al);
     bk = le_key_and_len(b, &bl);
     int l = MIN(al, bl);
@@ -131,7 +131,7 @@ test_serialize_leaf(int valsize, int nelts, double entropy) {
     {
         DISKOFF offset;
         DISKOFF size;
-        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, FALSE);
+        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, false);
         assert(offset==BLOCK_ALLOCATOR_TOTAL_HEADER_RESERVE);
 
         toku_translate_blocknum_to_offset_size(brt_h->blocktable, b, &offset, &size);
@@ -142,7 +142,7 @@ test_serialize_leaf(int valsize, int nelts, double entropy) {
     struct timeval t[2];
     gettimeofday(&t[0], NULL);
     FTNODE_DISK_DATA ndd = NULL;
-    r = toku_serialize_ftnode_to(fd, make_blocknum(20), sn, &ndd, TRUE, brt->ft, FALSE);
+    r = toku_serialize_ftnode_to(fd, make_blocknum(20), sn, &ndd, true, brt->ft, false);
     assert(r==0);
     gettimeofday(&t[1], NULL);
     double dt;
@@ -265,7 +265,7 @@ test_serialize_nonleaf(int valsize, int nelts, double entropy) {
     {
         DISKOFF offset;
         DISKOFF size;
-        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, FALSE);
+        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, false);
         assert(offset==BLOCK_ALLOCATOR_TOTAL_HEADER_RESERVE);
 
         toku_translate_blocknum_to_offset_size(brt_h->blocktable, b, &offset, &size);
@@ -276,7 +276,7 @@ test_serialize_nonleaf(int valsize, int nelts, double entropy) {
     struct timeval t[2];
     gettimeofday(&t[0], NULL);
     FTNODE_DISK_DATA ndd = NULL;
-    r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, FALSE);
+    r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, true, brt->ft, false);
     assert(r==0);
     gettimeofday(&t[1], NULL);
     double dt;
diff --git a/ft/tests/ft-serialize-sub-block-test.cc b/ft/tests/ft-serialize-sub-block-test.cc
index 09a69a486057926fce8cce367219baa0f41f3759..c840ce9a72a086a83dfb6de3ad195b42e3525266 100644
--- a/ft/tests/ft-serialize-sub-block-test.cc
+++ b/ft/tests/ft-serialize-sub-block-test.cc
@@ -30,7 +30,7 @@ static void test_sub_block(int n) {
     error = toku_create_cachetable(&ct, 0, ZERO_LSN, NULL_LOGGER);
     assert(error == 0);
 
-    error = toku_open_ft_handle(fname, TRUE, &brt, nodesize, basementnodesize, compression_method, ct, null_txn, toku_builtin_compare_fun);
+    error = toku_open_ft_handle(fname, true, &brt, nodesize, basementnodesize, compression_method, ct, null_txn, toku_builtin_compare_fun);
     assert(error == 0);
 
     // insert keys 0, 1, 2, .. (n-1)
@@ -49,11 +49,11 @@ static void test_sub_block(int n) {
     assert(error == 0);
 
     // verify the brt by walking a cursor through the rows
-    error = toku_open_ft_handle(fname, FALSE, &brt, nodesize, basementnodesize, compression_method, ct, null_txn, toku_builtin_compare_fun);
+    error = toku_open_ft_handle(fname, false, &brt, nodesize, basementnodesize, compression_method, ct, null_txn, toku_builtin_compare_fun);
     assert(error == 0);
 
     FT_CURSOR cursor;
-    error = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);
+    error = toku_ft_cursor(brt, &cursor, NULL, false, false);
     assert(error == 0);
 
     for (i=0; ; i++) {
diff --git a/ft/tests/ft-serialize-test.cc b/ft/tests/ft-serialize-test.cc
index 7d3d8b6c27fd146ff6faf9fcd72e9b6d6c98105d..8ab4a1341b925826294538fa7d734befc7a05200 100644
--- a/ft/tests/ft-serialize-test.cc
+++ b/ft/tests/ft-serialize-test.cc
@@ -14,7 +14,7 @@ static int omt_int_cmp(OMTVALUE p, void *q)
     LEAFENTRY CAST_FROM_VOIDP(a, p);
     LEAFENTRY CAST_FROM_VOIDP(b, q);
     void *ak, *bk;
-    u_int32_t al, bl;
+    uint32_t al, bl;
     ak = le_key_and_len(a, &al);
     bk = le_key_and_len(b, &bl);
     assert(al == 4 && bl == 4);
@@ -32,7 +32,7 @@ static int omt_cmp(OMTVALUE p, void *q)
     LEAFENTRY CAST_FROM_VOIDP(a, p);
     LEAFENTRY CAST_FROM_VOIDP(b, q);
     void *ak, *bk;
-    u_int32_t al, bl;
+    uint32_t al, bl;
     ak = le_key_and_len(a, &al);
     bk = le_key_and_len(b, &bl);
     int l = MIN(al, bl);
@@ -83,7 +83,7 @@ struct check_leafentries_struct {
     int (*cmp)(OMTVALUE, void *);
 };
 
-static int check_leafentries(OMTVALUE v, u_int32_t UU(i), void *extra) {
+static int check_leafentries(OMTVALUE v, uint32_t UU(i), void *extra) {
     struct check_leafentries_struct *CAST_FROM_VOIDP(e, extra);
     assert(e->i < e->nelts);
     assert(e->cmp(v, e->elts[e->i]) == 0);
@@ -180,29 +180,29 @@ setup_dn(enum ftnode_verify_type bft, int fd, FT brt_h, FTNODE *dn, FTNODE_DISK_
     }
     else {
         // if we get here, this is a test bug, NOT a bug in development code
-        assert(FALSE);
+        assert(false);
     }
 }
 
-static void write_sn_to_disk(int fd, FT_HANDLE brt, FTNODE sn, FTNODE_DISK_DATA* src_ndd, BOOL do_clone) {
+static void write_sn_to_disk(int fd, FT_HANDLE brt, FTNODE sn, FTNODE_DISK_DATA* src_ndd, bool do_clone) {
     int r;
     if (do_clone) {
         void* cloned_node_v = NULL;
         PAIR_ATTR attr;
-        toku_ftnode_clone_callback(sn, &cloned_node_v, &attr, FALSE, brt->ft);
+        toku_ftnode_clone_callback(sn, &cloned_node_v, &attr, false, brt->ft);
         FTNODE CAST_FROM_VOIDP(cloned_node, cloned_node_v);
-        r = toku_serialize_ftnode_to(fd, make_blocknum(20), cloned_node, src_ndd, FALSE, brt->ft, FALSE);
+        r = toku_serialize_ftnode_to(fd, make_blocknum(20), cloned_node, src_ndd, false, brt->ft, false);
         assert(r==0);        
         toku_ftnode_free(&cloned_node);
     }
     else {
-        r = toku_serialize_ftnode_to(fd, make_blocknum(20), sn, src_ndd, TRUE, brt->ft, FALSE);
+        r = toku_serialize_ftnode_to(fd, make_blocknum(20), sn, src_ndd, true, brt->ft, false);
         assert(r==0);
     }
 }
 
 static void
-test_serialize_leaf_check_msn(enum ftnode_verify_type bft, BOOL do_clone) {
+test_serialize_leaf_check_msn(enum ftnode_verify_type bft, bool do_clone) {
     //    struct ft_handle source_ft;
     const int nodesize = 1024;
     struct ftnode sn, *dn;
@@ -276,7 +276,7 @@ test_serialize_leaf_check_msn(enum ftnode_verify_type bft, BOOL do_clone) {
     {
         DISKOFF offset;
         DISKOFF size;
-        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, FALSE);
+        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, false);
         assert(offset==BLOCK_ALLOCATOR_TOTAL_HEADER_RESERVE);
 
         toku_translate_blocknum_to_offset_size(brt_h->blocktable, b, &offset, &size);
@@ -306,11 +306,11 @@ test_serialize_leaf_check_msn(enum ftnode_verify_type bft, BOOL do_clone) {
 	elts[0] = le_malloc(&dummy_mp, "a", "aval");
 	elts[1] = le_malloc(&dummy_mp, "b", "bval");
 	elts[2] = le_malloc(&dummy_mp, "x", "xval");
-        const u_int32_t npartitions = dn->n_children;
+        const uint32_t npartitions = dn->n_children;
         assert(dn->totalchildkeylens==(2*(npartitions-1)));
         struct check_leafentries_struct extra = { .nelts = 3, .elts = elts, .i = 0, .cmp = omt_cmp };
-        u_int32_t last_i = 0;
-        for (u_int32_t i = 0; i < npartitions; ++i) {
+        uint32_t last_i = 0;
+        for (uint32_t i = 0; i < npartitions; ++i) {
             assert(BLB_MAX_MSN_APPLIED(dn, i).msn == POSTSERIALIZE_MSN_ON_DISK.msn);
             assert(dest_ndd[i].start > 0);
             assert(dest_ndd[i].size  > 0);
@@ -318,7 +318,7 @@ test_serialize_leaf_check_msn(enum ftnode_verify_type bft, BOOL do_clone) {
                 assert(dest_ndd[i].start >= dest_ndd[i-1].start + dest_ndd[i-1].size);
             }
             toku_omt_iterate(BLB_BUFFER(dn, i), check_leafentries, &extra);
-            u_int32_t keylen;
+            uint32_t keylen;
             if (i < npartitions-1) {
                 assert(strcmp((char*)dn->childkeys[i].data, (char*)le_key_and_len(elts[extra.i-1], &keylen))==0);
             }
@@ -356,7 +356,7 @@ test_serialize_leaf_check_msn(enum ftnode_verify_type bft, BOOL do_clone) {
 }
 
 static void
-test_serialize_leaf_with_large_pivots(enum ftnode_verify_type bft, BOOL do_clone) {
+test_serialize_leaf_with_large_pivots(enum ftnode_verify_type bft, bool do_clone) {
     int r;
     struct ftnode sn, *dn;
     const int keylens = 256*1024, vallens = 0, nrows = 8;
@@ -394,7 +394,7 @@ test_serialize_leaf_with_large_pivots(enum ftnode_verify_type bft, BOOL do_clone
         r = toku_omt_insert(BLB_BUFFER(&sn, i), le, omt_cmp, le, NULL); assert(r==0);
         BLB_NBYTESINBUF(&sn, i) = leafentry_disksize(le);
         if (i < nrows-1) {
-            u_int32_t keylen;
+            uint32_t keylen;
             char *CAST_FROM_VOIDP(keyp, le_key_and_len(le, &keylen));
             toku_fill_dbt(&sn.childkeys[i], toku_xmemdup(keyp, keylen), keylen);
         }
@@ -424,7 +424,7 @@ test_serialize_leaf_with_large_pivots(enum ftnode_verify_type bft, BOOL do_clone
     {
         DISKOFF offset;
         DISKOFF size;
-        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, FALSE);
+        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, false);
         assert(offset==BLOCK_ALLOCATOR_TOTAL_HEADER_RESERVE);
 
         toku_translate_blocknum_to_offset_size(brt_h->blocktable, b, &offset, &size);
@@ -459,11 +459,11 @@ test_serialize_leaf_with_large_pivots(enum ftnode_verify_type bft, BOOL do_clone
 		les[i] = le_fastmalloc(&dummy_mp, (char *) &key, sizeof(key), (char *) &val, sizeof(val));
 	    }
 	}
-        const u_int32_t npartitions = dn->n_children;
+        const uint32_t npartitions = dn->n_children;
         assert(dn->totalchildkeylens==(keylens*(npartitions-1)));
         struct check_leafentries_struct extra = { .nelts = nrows, .elts = les, .i = 0, .cmp = omt_cmp };
-        u_int32_t last_i = 0;
-        for (u_int32_t i = 0; i < npartitions; ++i) {
+        uint32_t last_i = 0;
+        for (uint32_t i = 0; i < npartitions; ++i) {
             assert(dest_ndd[i].start > 0);
             assert(dest_ndd[i].size  > 0);
             if (i > 0) {
@@ -505,7 +505,7 @@ test_serialize_leaf_with_large_pivots(enum ftnode_verify_type bft, BOOL do_clone
 }
 
 static void
-test_serialize_leaf_with_many_rows(enum ftnode_verify_type bft, BOOL do_clone) {
+test_serialize_leaf_with_many_rows(enum ftnode_verify_type bft, bool do_clone) {
     int r;
     struct ftnode sn, *dn;
     const int keylens = sizeof(int), vallens = sizeof(int), nrows = 196*1024;
@@ -569,7 +569,7 @@ test_serialize_leaf_with_many_rows(enum ftnode_verify_type bft, BOOL do_clone) {
     {
         DISKOFF offset;
         DISKOFF size;
-        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, FALSE);
+        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, false);
         assert(offset==BLOCK_ALLOCATOR_TOTAL_HEADER_RESERVE);
 
         toku_translate_blocknum_to_offset_size(brt_h->blocktable, b, &offset, &size);
@@ -601,11 +601,11 @@ test_serialize_leaf_with_many_rows(enum ftnode_verify_type bft, BOOL do_clone) {
 		les[i] = le_fastmalloc(&dummy_mp, (char *) &key, sizeof(key), (char *) &val, sizeof(val));
 	    }
 	}
-        const u_int32_t npartitions = dn->n_children;
+        const uint32_t npartitions = dn->n_children;
         assert(dn->totalchildkeylens==(sizeof(int)*(npartitions-1)));
         struct check_leafentries_struct extra = { .nelts = nrows, .elts = les, .i = 0, .cmp = omt_int_cmp };
-        u_int32_t last_i = 0;
-        for (u_int32_t i = 0; i < npartitions; ++i) {
+        uint32_t last_i = 0;
+        for (uint32_t i = 0; i < npartitions; ++i) {
             assert(dest_ndd[i].start > 0);
             assert(dest_ndd[i].size  > 0);
             if (i > 0) {
@@ -649,7 +649,7 @@ test_serialize_leaf_with_many_rows(enum ftnode_verify_type bft, BOOL do_clone) {
 
 
 static void
-test_serialize_leaf_with_large_rows(enum ftnode_verify_type bft, BOOL do_clone) {
+test_serialize_leaf_with_large_rows(enum ftnode_verify_type bft, bool do_clone) {
     int r;
     struct ftnode sn, *dn;
     const uint32_t nrows = 7;
@@ -719,7 +719,7 @@ test_serialize_leaf_with_large_rows(enum ftnode_verify_type bft, BOOL do_clone)
     {
         DISKOFF offset;
         DISKOFF size;
-        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, FALSE);
+        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, false);
         assert(offset==BLOCK_ALLOCATOR_TOTAL_HEADER_RESERVE);
 
         toku_translate_blocknum_to_offset_size(brt_h->blocktable, b, &offset, &size);
@@ -756,12 +756,12 @@ test_serialize_leaf_with_large_rows(enum ftnode_verify_type bft, BOOL do_clone)
 		les[i] = le_fastmalloc(&dummy_mp, key, key_size, val, val_size);
 	    }
 	}
-        const u_int32_t npartitions = dn->n_children;
+        const uint32_t npartitions = dn->n_children;
         assert(npartitions == nrows);
         assert(dn->totalchildkeylens==(key_size*(npartitions-1)));
         struct check_leafentries_struct extra = { .nelts = nrows, .elts = les, .i = 0, .cmp = omt_cmp };
-        u_int32_t last_i = 0;
-        for (u_int32_t i = 0; i < npartitions; ++i) {
+        uint32_t last_i = 0;
+        for (uint32_t i = 0; i < npartitions; ++i) {
             assert(dest_ndd[i].start > 0);
             assert(dest_ndd[i].size  > 0);
             if (i > 0) {
@@ -804,7 +804,7 @@ test_serialize_leaf_with_large_rows(enum ftnode_verify_type bft, BOOL do_clone)
 
 
 static void
-test_serialize_leaf_with_empty_basement_nodes(enum ftnode_verify_type bft, BOOL do_clone) {
+test_serialize_leaf_with_empty_basement_nodes(enum ftnode_verify_type bft, bool do_clone) {
     const int nodesize = 1024;
     struct ftnode sn, *dn;
 
@@ -885,7 +885,7 @@ test_serialize_leaf_with_empty_basement_nodes(enum ftnode_verify_type bft, BOOL
     {
         DISKOFF offset;
         DISKOFF size;
-        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, FALSE);
+        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, false);
         assert(offset==BLOCK_ALLOCATOR_TOTAL_HEADER_RESERVE);
 
         toku_translate_blocknum_to_offset_size(brt_h->blocktable, b, &offset, &size);
@@ -913,11 +913,11 @@ test_serialize_leaf_with_empty_basement_nodes(enum ftnode_verify_type bft, BOOL
 	elts[0] = le_malloc(&dummy_mp, "a", "aval");
 	elts[1] = le_malloc(&dummy_mp, "b", "bval");
 	elts[2] = le_malloc(&dummy_mp, "x", "xval");
-        const u_int32_t npartitions = dn->n_children;
+        const uint32_t npartitions = dn->n_children;
         assert(dn->totalchildkeylens==(2*(npartitions-1)));
         struct check_leafentries_struct extra = { .nelts = 3, .elts = elts, .i = 0, .cmp = omt_cmp };
-        u_int32_t last_i = 0;
-        for (u_int32_t i = 0; i < npartitions; ++i) {
+        uint32_t last_i = 0;
+        for (uint32_t i = 0; i < npartitions; ++i) {
             assert(dest_ndd[i].start > 0);
             assert(dest_ndd[i].size  > 0);
             if (i > 0) {
@@ -959,7 +959,7 @@ test_serialize_leaf_with_empty_basement_nodes(enum ftnode_verify_type bft, BOOL
 }
 
 static void
-test_serialize_leaf_with_multiple_empty_basement_nodes(enum ftnode_verify_type bft, BOOL do_clone) {
+test_serialize_leaf_with_multiple_empty_basement_nodes(enum ftnode_verify_type bft, bool do_clone) {
     const int nodesize = 1024;
     struct ftnode sn, *dn;
 
@@ -1015,7 +1015,7 @@ test_serialize_leaf_with_multiple_empty_basement_nodes(enum ftnode_verify_type b
     {
         DISKOFF offset;
         DISKOFF size;
-        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, FALSE);
+        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, false);
         assert(offset==BLOCK_ALLOCATOR_TOTAL_HEADER_RESERVE);
 
         toku_translate_blocknum_to_offset_size(brt_h->blocktable, b, &offset, &size);
@@ -1037,11 +1037,11 @@ test_serialize_leaf_with_multiple_empty_basement_nodes(enum ftnode_verify_type b
     assert(dn->height == 0);
     assert(dn->n_children == 1);
     {
-        const u_int32_t npartitions = dn->n_children;
+        const uint32_t npartitions = dn->n_children;
         assert(dn->totalchildkeylens==(2*(npartitions-1)));
         struct check_leafentries_struct extra = { .nelts = 0, .elts = NULL, .i = 0, .cmp = omt_cmp };
-        u_int32_t last_i = 0;
-        for (u_int32_t i = 0; i < npartitions; ++i) {
+        uint32_t last_i = 0;
+        for (uint32_t i = 0; i < npartitions; ++i) {
             assert(dest_ndd[i].start > 0);
             assert(dest_ndd[i].size  > 0);
             if (i > 0) {
@@ -1080,7 +1080,7 @@ test_serialize_leaf_with_multiple_empty_basement_nodes(enum ftnode_verify_type b
 
 
 static void
-test_serialize_leaf(enum ftnode_verify_type bft, BOOL do_clone) {
+test_serialize_leaf(enum ftnode_verify_type bft, bool do_clone) {
     //    struct ft_handle source_ft;
     const int nodesize = 1024;
     struct ftnode sn, *dn;
@@ -1150,7 +1150,7 @@ test_serialize_leaf(enum ftnode_verify_type bft, BOOL do_clone) {
     {
         DISKOFF offset;
         DISKOFF size;
-        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, FALSE);
+        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, false);
         assert(offset==BLOCK_ALLOCATOR_TOTAL_HEADER_RESERVE);
 
         toku_translate_blocknum_to_offset_size(brt_h->blocktable, b, &offset, &size);
@@ -1177,18 +1177,18 @@ test_serialize_leaf(enum ftnode_verify_type bft, BOOL do_clone) {
 	elts[0] = le_malloc(&dummy_mp, "a", "aval");
 	elts[1] = le_malloc(&dummy_mp, "b", "bval");
 	elts[2] = le_malloc(&dummy_mp, "x", "xval");
-        const u_int32_t npartitions = dn->n_children;
+        const uint32_t npartitions = dn->n_children;
         assert(dn->totalchildkeylens==(2*(npartitions-1)));
         struct check_leafentries_struct extra = { .nelts = 3, .elts = elts, .i = 0, .cmp = omt_cmp };
-        u_int32_t last_i = 0;
-        for (u_int32_t i = 0; i < npartitions; ++i) {
+        uint32_t last_i = 0;
+        for (uint32_t i = 0; i < npartitions; ++i) {
             assert(dest_ndd[i].start > 0);
             assert(dest_ndd[i].size  > 0);
             if (i > 0) {
                 assert(dest_ndd[i].start >= dest_ndd[i-1].start + dest_ndd[i-1].size);
             }
             toku_omt_iterate(BLB_BUFFER(dn, i), check_leafentries, &extra);
-            u_int32_t keylen;
+            uint32_t keylen;
             if (i < npartitions-1) {
                 assert(strcmp((char*)dn->childkeys[i].data, (char*)le_key_and_len(elts[extra.i-1], &keylen))==0);
             }
@@ -1226,7 +1226,7 @@ test_serialize_leaf(enum ftnode_verify_type bft, BOOL do_clone) {
 }
 
 static void
-test_serialize_nonleaf(enum ftnode_verify_type bft, BOOL do_clone) {
+test_serialize_nonleaf(enum ftnode_verify_type bft, bool do_clone) {
     //    struct ft_handle source_ft;
     const int nodesize = 1024;
     struct ftnode sn, *dn;
@@ -1298,7 +1298,7 @@ test_serialize_nonleaf(enum ftnode_verify_type bft, BOOL do_clone) {
     {
         DISKOFF offset;
         DISKOFF size;
-        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, FALSE);
+        toku_blocknum_realloc_on_disk(brt_h->blocktable, b, 100, &offset, brt_h, fd, false);
         assert(offset==BLOCK_ALLOCATOR_TOTAL_HEADER_RESERVE);
 
         toku_translate_blocknum_to_offset_size(brt_h->blocktable, b, &offset, &size);
@@ -1356,61 +1356,61 @@ int
 test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute__((__unused__))) {
     initialize_dummymsn();
 
-    test_serialize_leaf(read_none, FALSE);
-    test_serialize_leaf(read_all, FALSE);
-    test_serialize_leaf(read_compressed, FALSE);
-    test_serialize_leaf(read_none, TRUE);
-    test_serialize_leaf(read_all, TRUE);
-    test_serialize_leaf(read_compressed, TRUE);
-
-    test_serialize_leaf_with_empty_basement_nodes(read_none, FALSE);
-    test_serialize_leaf_with_empty_basement_nodes(read_all, FALSE);
-    test_serialize_leaf_with_empty_basement_nodes(read_compressed, FALSE);
-    test_serialize_leaf_with_empty_basement_nodes(read_none, TRUE);
-    test_serialize_leaf_with_empty_basement_nodes(read_all, TRUE);
-    test_serialize_leaf_with_empty_basement_nodes(read_compressed, TRUE);
-
-    test_serialize_leaf_with_multiple_empty_basement_nodes(read_none, FALSE);
-    test_serialize_leaf_with_multiple_empty_basement_nodes(read_all, FALSE);
-    test_serialize_leaf_with_multiple_empty_basement_nodes(read_compressed, FALSE);
-    test_serialize_leaf_with_multiple_empty_basement_nodes(read_none, TRUE);
-    test_serialize_leaf_with_multiple_empty_basement_nodes(read_all, TRUE);
-    test_serialize_leaf_with_multiple_empty_basement_nodes(read_compressed, TRUE);
-
-    test_serialize_leaf_with_large_rows(read_none, FALSE);
-    test_serialize_leaf_with_large_rows(read_all, FALSE);
-    test_serialize_leaf_with_large_rows(read_compressed, FALSE);
-    test_serialize_leaf_with_large_rows(read_none, TRUE);
-    test_serialize_leaf_with_large_rows(read_all, TRUE);
-    test_serialize_leaf_with_large_rows(read_compressed, TRUE);
-
-    test_serialize_leaf_with_many_rows(read_none, FALSE);
-    test_serialize_leaf_with_many_rows(read_all, FALSE);
-    test_serialize_leaf_with_many_rows(read_compressed, FALSE);
-    test_serialize_leaf_with_many_rows(read_none, TRUE);
-    test_serialize_leaf_with_many_rows(read_all, TRUE);
-    test_serialize_leaf_with_many_rows(read_compressed, TRUE);
-
-    test_serialize_leaf_with_large_pivots(read_none, FALSE);
-    test_serialize_leaf_with_large_pivots(read_all, FALSE);
-    test_serialize_leaf_with_large_pivots(read_compressed, FALSE);
-    test_serialize_leaf_with_large_pivots(read_none, TRUE);
-    test_serialize_leaf_with_large_pivots(read_all, TRUE);
-    test_serialize_leaf_with_large_pivots(read_compressed, TRUE);
-
-    test_serialize_leaf_check_msn(read_none, FALSE);
-    test_serialize_leaf_check_msn(read_all, FALSE);
-    test_serialize_leaf_check_msn(read_compressed, FALSE);
-    test_serialize_leaf_check_msn(read_none, TRUE);
-    test_serialize_leaf_check_msn(read_all, TRUE);
-    test_serialize_leaf_check_msn(read_compressed, TRUE);
-
-    test_serialize_nonleaf(read_none, FALSE);
-    test_serialize_nonleaf(read_all, FALSE);
-    test_serialize_nonleaf(read_compressed, FALSE);
-    test_serialize_nonleaf(read_none, TRUE);
-    test_serialize_nonleaf(read_all, TRUE);
-    test_serialize_nonleaf(read_compressed, TRUE);
+    test_serialize_leaf(read_none, false);
+    test_serialize_leaf(read_all, false);
+    test_serialize_leaf(read_compressed, false);
+    test_serialize_leaf(read_none, true);
+    test_serialize_leaf(read_all, true);
+    test_serialize_leaf(read_compressed, true);
+
+    test_serialize_leaf_with_empty_basement_nodes(read_none, false);
+    test_serialize_leaf_with_empty_basement_nodes(read_all, false);
+    test_serialize_leaf_with_empty_basement_nodes(read_compressed, false);
+    test_serialize_leaf_with_empty_basement_nodes(read_none, true);
+    test_serialize_leaf_with_empty_basement_nodes(read_all, true);
+    test_serialize_leaf_with_empty_basement_nodes(read_compressed, true);
+
+    test_serialize_leaf_with_multiple_empty_basement_nodes(read_none, false);
+    test_serialize_leaf_with_multiple_empty_basement_nodes(read_all, false);
+    test_serialize_leaf_with_multiple_empty_basement_nodes(read_compressed, false);
+    test_serialize_leaf_with_multiple_empty_basement_nodes(read_none, true);
+    test_serialize_leaf_with_multiple_empty_basement_nodes(read_all, true);
+    test_serialize_leaf_with_multiple_empty_basement_nodes(read_compressed, true);
+
+    test_serialize_leaf_with_large_rows(read_none, false);
+    test_serialize_leaf_with_large_rows(read_all, false);
+    test_serialize_leaf_with_large_rows(read_compressed, false);
+    test_serialize_leaf_with_large_rows(read_none, true);
+    test_serialize_leaf_with_large_rows(read_all, true);
+    test_serialize_leaf_with_large_rows(read_compressed, true);
+
+    test_serialize_leaf_with_many_rows(read_none, false);
+    test_serialize_leaf_with_many_rows(read_all, false);
+    test_serialize_leaf_with_many_rows(read_compressed, false);
+    test_serialize_leaf_with_many_rows(read_none, true);
+    test_serialize_leaf_with_many_rows(read_all, true);
+    test_serialize_leaf_with_many_rows(read_compressed, true);
+
+    test_serialize_leaf_with_large_pivots(read_none, false);
+    test_serialize_leaf_with_large_pivots(read_all, false);
+    test_serialize_leaf_with_large_pivots(read_compressed, false);
+    test_serialize_leaf_with_large_pivots(read_none, true);
+    test_serialize_leaf_with_large_pivots(read_all, true);
+    test_serialize_leaf_with_large_pivots(read_compressed, true);
+
+    test_serialize_leaf_check_msn(read_none, false);
+    test_serialize_leaf_check_msn(read_all, false);
+    test_serialize_leaf_check_msn(read_compressed, false);
+    test_serialize_leaf_check_msn(read_none, true);
+    test_serialize_leaf_check_msn(read_all, true);
+    test_serialize_leaf_check_msn(read_compressed, true);
+
+    test_serialize_nonleaf(read_none, false);
+    test_serialize_nonleaf(read_all, false);
+    test_serialize_nonleaf(read_compressed, false);
+    test_serialize_nonleaf(read_none, true);
+    test_serialize_nonleaf(read_all, true);
+    test_serialize_nonleaf(read_compressed, true);
 
     return 0;
 }
diff --git a/ft/tests/ft-test-cursor-2.cc b/ft/tests/ft-test-cursor-2.cc
index 277836065fcdb10631db5c04fd77bfcb62c3e709..086b1630a61cb77a28a488d619cf971be5f5c038 100644
--- a/ft/tests/ft-test-cursor-2.cc
+++ b/ft/tests/ft-test-cursor-2.cc
@@ -53,7 +53,7 @@ static void test_multiple_ft_cursor_dbts(int n) {
     }
 
     for (i=0; i<n; i++) {
-        r = toku_ft_cursor(brt, &cursors[i], NULL, FALSE, FALSE);
+        r = toku_ft_cursor(brt, &cursors[i], NULL, false, false);
         assert(r == 0);
     }
 
diff --git a/ft/tests/ft-test-cursor.cc b/ft/tests/ft-test-cursor.cc
index 760448df57f43f2c9c2419f018ec58ba07b5b166..5b0221883e898dbb99b1399ca0fef6d3efc207ed 100644
--- a/ft/tests/ft-test-cursor.cc
+++ b/ft/tests/ft-test-cursor.cc
@@ -21,7 +21,7 @@ static void assert_cursor_notfound(FT_HANDLE brt, int position) {
     FT_CURSOR cursor=0;
     int r;
 
-    r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);
+    r = toku_ft_cursor(brt, &cursor, NULL, false, false);
     assert(r==0);
 
     struct check_pair pair = {0,0,0,0,0};
@@ -37,7 +37,7 @@ static void assert_cursor_value(FT_HANDLE brt, int position, long long value) {
     FT_CURSOR cursor=0;
     int r;
 
-    r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);
+    r = toku_ft_cursor(brt, &cursor, NULL, false, false);
     assert(r==0);
 
     if (test_cursor_debug && verbose) printf("key: ");
@@ -54,7 +54,7 @@ static void assert_cursor_first_last(FT_HANDLE brt, long long firstv, long long
     FT_CURSOR cursor=0;
     int r;
 
-    r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);
+    r = toku_ft_cursor(brt, &cursor, NULL, false, false);
     assert(r==0);
 
     if (test_cursor_debug && verbose) printf("first key: ");
@@ -252,7 +252,7 @@ static void assert_cursor_walk(FT_HANDLE brt, int n) {
     int i;
     int r;
 
-    r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);
+    r = toku_ft_cursor(brt, &cursor, NULL, false, false);
     assert(r==0);
 
     if (test_cursor_debug && verbose) printf("key: ");
@@ -318,7 +318,7 @@ static void assert_cursor_rwalk(FT_HANDLE brt, int n) {
     int i;
     int r;
 
-    r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);
+    r = toku_ft_cursor(brt, &cursor, NULL, false, false);
     assert(r==0);
 
     if (test_cursor_debug && verbose) printf("key: ");
@@ -405,7 +405,7 @@ static void assert_cursor_walk_inorder(FT_HANDLE brt, int n) {
     int r;
     char *prevkey = 0;
 
-    r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);
+    r = toku_ft_cursor(brt, &cursor, NULL, false, false);
     assert(r==0);
 
     if (test_cursor_debug && verbose) printf("key: ");
@@ -507,7 +507,7 @@ static void test_ft_cursor_split(int n) {
         assert(r==0);
     }
 
-    r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);
+    r = toku_ft_cursor(brt, &cursor, NULL, false, false);
     assert(r==0);
 
     if (test_cursor_debug && verbose) printf("key: ");
@@ -572,7 +572,7 @@ static void test_multiple_ft_cursors(int n) {
 
     int i;
     for (i=0; i<n; i++) {
-        r = toku_ft_cursor(brt, &cursors[i], NULL, FALSE, FALSE);
+        r = toku_ft_cursor(brt, &cursors[i], NULL, false, false);
         assert(r == 0);
     }
 
@@ -622,7 +622,7 @@ static void test_multiple_ft_cursor_walk(int n) {
     int c;
     /* create the cursors */
     for (c=0; c<ncursors; c++) {
-        r = toku_ft_cursor(brt, &cursors[c], NULL, FALSE, FALSE);
+        r = toku_ft_cursor(brt, &cursors[c], NULL, false, false);
         assert(r == 0);
     }
 
@@ -709,7 +709,7 @@ static void test_ft_cursor_set(int n, int cursor_op) {
         assert(r == 0);
     }
 
-    r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);
+    r = toku_ft_cursor(brt, &cursor, NULL, false, false);
     assert(r==0);
 
     /* set cursor to random keys in set { 0, 10, 20, .. 10*(n-1) } */
@@ -782,7 +782,7 @@ static void test_ft_cursor_set_range(int n) {
         assert(r == 0);
     }
 
-    r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);
+    r = toku_ft_cursor(brt, &cursor, NULL, false, false);
     assert(r==0);
 
     /* pick random keys v in 0 <= v < 10*n, the cursor should point
@@ -832,7 +832,7 @@ static void test_ft_cursor_delete(int n) {
     error = toku_open_ft_handle(fname, 1, &brt, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
     assert(error == 0);
 
-    error = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);
+    error = toku_ft_cursor(brt, &cursor, NULL, false, false);
     assert(error == 0);
 
     DBT key, val;
diff --git a/ft/tests/ft-test.cc b/ft/tests/ft-test.cc
index c703bde152a7c6c4ea60e347ea3f6bb1838e9b8d..03e77914613695667981f79559814bb24739d24f 100644
--- a/ft/tests/ft-test.cc
+++ b/ft/tests/ft-test.cc
@@ -261,7 +261,7 @@ static void test_cursor_last_empty(void) {
     //printf("%s:%d %d alloced\n", __SRCFILE__, __LINE__, toku_get_n_items_malloced()); toku_print_malloced_items();
     r = toku_open_ft_handle(fname, 1, &brt, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);  assert(r==0);
     //printf("%s:%d %d alloced\n", __SRCFILE__, __LINE__, toku_get_n_items_malloced()); toku_print_malloced_items();
-    r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);            assert(r==0);
+    r = toku_ft_cursor(brt, &cursor, NULL, false, false);            assert(r==0);
     {
 	struct check_pair pair = {0,0,0,0,0};
 	r = toku_ft_cursor_get(cursor, NULL, lookup_checkf, &pair, DB_LAST);
@@ -299,7 +299,7 @@ static void test_cursor_next (void) {
     r = toku_ft_insert(brt, toku_fill_dbt(&kbt, "hello", 6), toku_fill_dbt(&vbt, "there", 6), null_txn);
     r = toku_ft_insert(brt, toku_fill_dbt(&kbt, "byebye", 7), toku_fill_dbt(&vbt, "byenow", 7), null_txn);
     if (verbose) printf("%s:%d calling toku_ft_cursor(...)\n", __SRCFILE__, __LINE__);
-    r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);            assert(r==0);
+    r = toku_ft_cursor(brt, &cursor, NULL, false, false);            assert(r==0);
     toku_init_dbt(&kbt);
     //printf("%s:%d %d alloced\n", __SRCFILE__, __LINE__, toku_get_n_items_malloced()); toku_print_malloced_items();
     toku_init_dbt(&vbt);
@@ -393,7 +393,7 @@ static void test_wrongendian_compare (int wrong_p, unsigned int N) {
     }
     {
 	FT_CURSOR cursor=0;
-	r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);            assert(r==0);
+	r = toku_ft_cursor(brt, &cursor, NULL, false, false);            assert(r==0);
 
 	for (i=0; i<2; i++) {
 	    unsigned char a[4],b[4];
@@ -435,7 +435,7 @@ static void test_wrongendian_compare (int wrong_p, unsigned int N) {
 	    toku_cachetable_verify(ct);
 	}
 	FT_CURSOR cursor=0;
-	r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);            assert(r==0);
+	r = toku_ft_cursor(brt, &cursor, NULL, false, false);            assert(r==0);
 	
 	for (i=0; i<N; i++) {
 	    unsigned char a[4],b[4];
@@ -584,7 +584,7 @@ static void test_ft_delete_present(int n) {
     /* cursor should not find anything */
     FT_CURSOR cursor=0;
 
-    r = toku_ft_cursor(t, &cursor, NULL, FALSE, FALSE);
+    r = toku_ft_cursor(t, &cursor, NULL, false, false);
     assert(r == 0);
 
     {
@@ -721,7 +721,7 @@ static void test_ft_delete_cursor_first(int n) {
     /* cursor should find the last key: n-1 */
     FT_CURSOR cursor=0;
 
-    r = toku_ft_cursor(t, &cursor, NULL, FALSE, FALSE);
+    r = toku_ft_cursor(t, &cursor, NULL, false, false);
     assert(r == 0);
 
     {
@@ -826,7 +826,7 @@ static void test_new_ft_cursor_create_close (void) {
 
     int i;
     for (i=0; i<n; i++) {
-        r = toku_ft_cursor(brt, &cursors[i], NULL, FALSE, FALSE); assert(r == 0);
+        r = toku_ft_cursor(brt, &cursors[i], NULL, false, false); assert(r == 0);
     }
 
     for (i=0; i<n; i++) {
@@ -860,7 +860,7 @@ static void test_new_ft_cursor_first(int n) {
 
     FT_CURSOR cursor=0;
 
-    r = toku_ft_cursor(t, &cursor, NULL, FALSE, FALSE); assert(r == 0);
+    r = toku_ft_cursor(t, &cursor, NULL, false, false); assert(r == 0);
 
     toku_init_dbt(&key); key.flags = DB_DBT_REALLOC;
     toku_init_dbt(&val); val.flags = DB_DBT_REALLOC;
@@ -912,7 +912,7 @@ static void test_new_ft_cursor_last(int n) {
 
     FT_CURSOR cursor=0;
 
-    r = toku_ft_cursor(t, &cursor, NULL, FALSE, FALSE); assert(r == 0);
+    r = toku_ft_cursor(t, &cursor, NULL, false, false); assert(r == 0);
 
     toku_init_dbt(&key); key.flags = DB_DBT_REALLOC;
     toku_init_dbt(&val); val.flags = DB_DBT_REALLOC;
@@ -964,7 +964,7 @@ static void test_new_ft_cursor_next(int n) {
 
     FT_CURSOR cursor=0;
 
-    r = toku_ft_cursor(t, &cursor, NULL, FALSE, FALSE); assert(r == 0);
+    r = toku_ft_cursor(t, &cursor, NULL, false, false); assert(r == 0);
 
     for (i=0; ; i++) {
 	int kk = toku_htonl(i);
@@ -1007,7 +1007,7 @@ static void test_new_ft_cursor_prev(int n) {
 
     FT_CURSOR cursor=0;
 
-    r = toku_ft_cursor(t, &cursor, NULL, FALSE, FALSE); assert(r == 0);
+    r = toku_ft_cursor(t, &cursor, NULL, false, false); assert(r == 0);
 
     for (i=n-1; ; i--) {
 	int kk = toku_htonl(i);
@@ -1050,7 +1050,7 @@ static void test_new_ft_cursor_current(int n) {
 
     FT_CURSOR cursor=0;
 
-    r = toku_ft_cursor(t, &cursor, NULL, FALSE, FALSE); assert(r == 0);
+    r = toku_ft_cursor(t, &cursor, NULL, false, false); assert(r == 0);
 
     for (i=0; ; i++) {
 	{
@@ -1134,7 +1134,7 @@ static void test_new_ft_cursor_set_range(int n) {
         r = toku_ft_insert(brt, toku_fill_dbt(&key, &k, sizeof k), toku_fill_dbt(&val, &v, sizeof v), 0); assert(r == 0);
     }
 
-    r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE); assert(r==0);
+    r = toku_ft_cursor(brt, &cursor, NULL, false, false); assert(r==0);
 
     /* pick random keys v in 0 <= v < 10*n, the cursor should point
        to the smallest key in the tree that is >= v */
@@ -1192,7 +1192,7 @@ static void test_new_ft_cursor_set(int n, int cursor_op, DB *db) {
         r = toku_ft_insert(brt, toku_fill_dbt(&key, &k, sizeof k), toku_fill_dbt(&val, &v, sizeof v), 0); assert(r == 0);
     }
 
-    r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE); assert(r==0);
+    r = toku_ft_cursor(brt, &cursor, NULL, false, false); assert(r==0);
 
     /* set cursor to random keys in set { 0, 10, 20, .. 10*(n-1) } */
     for (i=0; i<n; i++) {
diff --git a/ft/tests/ftloader-test-bad-generate.cc b/ft/tests/ftloader-test-bad-generate.cc
index 35b29063971d2e4f9248126361922d371a464f5b..0d3720207e5ac86e4b05b2acdcac23f406e63ac3 100644
--- a/ft/tests/ftloader-test-bad-generate.cc
+++ b/ft/tests/ftloader-test-bad-generate.cc
@@ -68,7 +68,7 @@ static void populate_rowset(struct rowset *rowset, int seq, int nrows) {
     }
 }
 
-static void test_extractor(int nrows, int nrowsets, BOOL expect_fail) {
+static void test_extractor(int nrows, int nrowsets, bool expect_fail) {
     if (verbose) printf("%s %d %d\n", __FUNCTION__, nrows, nrowsets);
 
     int r;
@@ -87,7 +87,7 @@ static void test_extractor(int nrows, int nrowsets, BOOL expect_fail) {
     }
 
     FTLOADER loader;
-    r = toku_ft_loader_open(&loader, NULL, generate, NULL, N, brts, dbs, fnames, compares, "tempXXXXXX", ZERO_LSN, TXNID_NONE, TRUE);
+    r = toku_ft_loader_open(&loader, NULL, generate, NULL, N, brts, dbs, fnames, compares, "tempXXXXXX", ZERO_LSN, TXNID_NONE, true);
     assert(r == 0);
 
     struct rowset *rowset[nrowsets];
@@ -114,7 +114,7 @@ static void test_extractor(int nrows, int nrowsets, BOOL expect_fail) {
     assert(expect_fail ? loader_error != 0 : loader_error == 0);
 
     // abort the ft_loader.  this ends the test
-    r = toku_ft_loader_abort(loader, TRUE);
+    r = toku_ft_loader_abort(loader, true);
     assert(r == 0);
 }
 
@@ -155,7 +155,7 @@ int test_main (int argc, const char *argv[]) {
     }
 
     // callibrate
-    test_extractor(nrows, nrowsets, FALSE);
+    test_extractor(nrows, nrowsets, false);
 
     // run tests
     int event_limit = event_count;
@@ -164,7 +164,7 @@ int test_main (int argc, const char *argv[]) {
     for (int i = 1; i <= event_limit; i++) {
         reset_event_counts();
         event_count_trigger = i;
-        test_extractor(nrows, nrowsets, TRUE);
+        test_extractor(nrows, nrowsets, true);
     }
 
     return 0;
diff --git a/ft/tests/ftloader-test-extractor-errors.cc b/ft/tests/ftloader-test-extractor-errors.cc
index 3a5b59638bc3bbdbfa5bee5fa6f1cb5a3403bb07..8e8309ddd7e20d3a51489c972ff65b7be0965aeb 100644
--- a/ft/tests/ftloader-test-extractor-errors.cc
+++ b/ft/tests/ftloader-test-extractor-errors.cc
@@ -70,7 +70,7 @@ static int ascending_keys = 0;
 static int descending_keys = 0;
 static int random_keys = 0;
 
-static void test_extractor(int nrows, int nrowsets, BOOL expect_fail, const char *testdir) {
+static void test_extractor(int nrows, int nrowsets, bool expect_fail, const char *testdir) {
     if (verbose) printf("%s %d %d %s\n", __FUNCTION__, nrows, nrowsets, testdir);
 
     int r;
@@ -99,7 +99,7 @@ static void test_extractor(int nrows, int nrowsets, BOOL expect_fail, const char
     sprintf(temp, "%s/%s", testdir, "tempXXXXXX");
 
     FTLOADER loader;
-    r = toku_ft_loader_open(&loader, NULL, generate, NULL, N, brts, dbs, fnames, compares, "tempXXXXXX", ZERO_LSN, TXNID_NONE, TRUE);
+    r = toku_ft_loader_open(&loader, NULL, generate, NULL, N, brts, dbs, fnames, compares, "tempXXXXXX", ZERO_LSN, TXNID_NONE, true);
     assert(r == 0);
 
     struct rowset *rowset[nrowsets];
@@ -141,7 +141,7 @@ static void test_extractor(int nrows, int nrowsets, BOOL expect_fail, const char
     // verify the temp files
 
     // abort the ft_loader.  this ends the test
-    r = toku_ft_loader_abort(loader, TRUE);
+    r = toku_ft_loader_abort(loader, true);
     assert(r == 0);
 
     toku_free(keys);
@@ -217,7 +217,7 @@ int test_main (int argc, const char *argv[]) {
         ascending_keys = 1;
 
     // callibrate
-    test_extractor(nrows, nrowsets, FALSE, testdir);
+    test_extractor(nrows, nrowsets, false, testdir);
 
     // run tests
     int error_limit = event_count;
@@ -229,7 +229,7 @@ int test_main (int argc, const char *argv[]) {
         reset_event_counts();
         reset_my_malloc_counts();
         event_count_trigger = i;
-        test_extractor(nrows, nrowsets, TRUE, testdir);
+        test_extractor(nrows, nrowsets, true, testdir);
     }
 
     return 0;
diff --git a/ft/tests/ftloader-test-extractor.cc b/ft/tests/ftloader-test-extractor.cc
index af855b1c4d766dfbb5efe100512694a087c6c561..38ea83fd152f5a554d8988f93081794cafd8e2a4 100644
--- a/ft/tests/ftloader-test-extractor.cc
+++ b/ft/tests/ftloader-test-extractor.cc
@@ -134,7 +134,7 @@ static void verify_sorted(int a[], int n) {
 struct merge_file {
     FILE *f;
     DBT key, val;
-    BOOL row_valid;
+    bool row_valid;
 };
 
 static DBT zero_dbt;
@@ -143,7 +143,7 @@ static void merge_file_init(struct merge_file *mf) {
     mf->f = NULL;
     mf->key = zero_dbt; mf->key.flags = DB_DBT_REALLOC;
     mf->val = zero_dbt; mf->val.flags = DB_DBT_REALLOC;
-    mf->row_valid = FALSE;
+    mf->row_valid = false;
 }
 
 static void merge_file_destroy(struct merge_file *mf) {
@@ -174,7 +174,7 @@ static char *merge(char **tempfiles, int ntempfiles, const char *testdir) {
 	}
 	assert(f[i].f != NULL);
         if (read_row(f[i].f, &f[i].key, &f[i].val) == 0)
-            f[i].row_valid = TRUE;
+            f[i].row_valid = true;
     }
 
     while (1) {
@@ -200,7 +200,7 @@ static char *merge(char **tempfiles, int ntempfiles, const char *testdir) {
 
         // refresh mini
         if (read_row(f[mini].f, &f[mini].key, &f[mini].val) != 0)
-            f[mini].row_valid = FALSE;
+            f[mini].row_valid = false;
     }
 
     for (int i = 0; i < ntempfiles; i++) {
@@ -319,7 +319,7 @@ static void test_extractor(int nrows, int nrowsets, const char *testdir) {
     sprintf(temp, "%s/%s", testdir, "tempXXXXXX");
 
     FTLOADER loader;
-    r = toku_ft_loader_open(&loader, NULL, generate, NULL, N, brts, dbs, fnames, compares, temp, ZERO_LSN, TXNID_NONE, TRUE);
+    r = toku_ft_loader_open(&loader, NULL, generate, NULL, N, brts, dbs, fnames, compares, temp, ZERO_LSN, TXNID_NONE, true);
     assert(r == 0);
 
     struct rowset *rowset[nrowsets];
@@ -350,7 +350,7 @@ static void test_extractor(int nrows, int nrowsets, const char *testdir) {
     verify(keys, nkeys, testdir);
 
     // abort the ft_loader.  this ends the test
-    r = toku_ft_loader_abort(loader, TRUE);
+    r = toku_ft_loader_abort(loader, true);
     assert(r == 0);
 
     toku_free(keys);
diff --git a/ft/tests/ftloader-test-merge-files-dbufio.cc b/ft/tests/ftloader-test-merge-files-dbufio.cc
index bf7dbae579b5dd0c391562f01922429f48ccdcca..2acf692bec23e30cc6f0cf5b5e77bb430e1d2c65 100644
--- a/ft/tests/ftloader-test-merge-files-dbufio.cc
+++ b/ft/tests/ftloader-test-merge-files-dbufio.cc
@@ -271,7 +271,7 @@ static void *consumer_thread (void *ctv) {
 }
 
 
-static void test (const char *directory, BOOL is_error) {
+static void test (const char *directory, bool is_error) {
 
     int *XMALLOC_N(N_SOURCES, fds);
 
@@ -327,7 +327,7 @@ static void test (const char *directory, BOOL is_error) {
 					       bt_compare_functions,
 					       "tempxxxxxx",
 					       *lsnp,
-                                               TXNID_NONE, TRUE);
+                                               TXNID_NONE, true);
 	assert(r==0);
     }
 
@@ -353,8 +353,8 @@ static void test (const char *directory, BOOL is_error) {
 	// all we really need is the number of records in the file.  The rest of the file_info is unused by the dbufio code.n
 	bl->file_infos.file_infos[i].n_rows = n_records_in_fd[i];
 	// However we need these for the destroy method to work right.
-	bl->file_infos.file_infos[i].is_extant = FALSE;
-	bl->file_infos.file_infos[i].is_open   = FALSE;
+	bl->file_infos.file_infos[i].is_extant = false;
+	bl->file_infos.file_infos[i].is_open   = false;
 	bl->file_infos.file_infos[i].buffer    = NULL;
 	src_fidxs[i].idx = i;
     }
@@ -378,7 +378,7 @@ static void test (const char *directory, BOOL is_error) {
 
     int result = 0;
     {
-	int r = toku_merge_some_files_using_dbufio(TRUE, FIDX_NULL, q, N_SOURCES, bfs, src_fidxs, bl, 0, (DB*)NULL, compare_ints, 10000);
+	int r = toku_merge_some_files_using_dbufio(true, FIDX_NULL, q, N_SOURCES, bfs, src_fidxs, bl, 0, (DB*)NULL, compare_ints, 10000);
 	if (is_error && r!=0) {
 	    result = r;
 	} else {
@@ -424,7 +424,7 @@ static void test (const char *directory, BOOL is_error) {
 	int r = queue_destroy(q);
 	assert(r==0);
     }
-    toku_ft_loader_internal_destroy(bl, FALSE);
+    toku_ft_loader_internal_destroy(bl, false);
     {
 	int r = toku_cachetable_close(&ct);
 	assert(r==0);
@@ -514,7 +514,7 @@ int test_main (int argc, const char *argv[]) {
     int r;
     r = system(unlink_all); CKERR(r);
     r = toku_os_mkdir(directory, 0755); CKERR(r);
-    test(directory, FALSE);
+    test(directory, false);
 
     if (verbose) printf("my_malloc_count=%d big_count=%d\n", my_malloc_count, my_big_malloc_count);
 
@@ -530,7 +530,7 @@ int test_main (int argc, const char *argv[]) {
 	    r = system(unlink_all); CKERR(r);
 	    r = toku_os_mkdir(directory, 0755); CKERR(r);
 	    if (verbose) printf("event=%d\n", i);
-	    test(directory, TRUE);
+	    test(directory, true);
 	}
 	r = system(unlink_all); CKERR(r);
     }
diff --git a/ft/tests/ftloader-test-open.cc b/ft/tests/ftloader-test-open.cc
index 064f24ec9404d472556d970a2e742727210d4618..9d439500ce2896e23429a23a9cf3f1133066dbff 100644
--- a/ft/tests/ftloader-test-open.cc
+++ b/ft/tests/ftloader-test-open.cc
@@ -57,14 +57,14 @@ static void test_loader_open(int ndbs) {
     for (i = 0; ; i++) {
         set_my_malloc_trigger(i+1);
 
-        r = toku_ft_loader_open(&loader, NULL, NULL, NULL, ndbs, brts, dbs, fnames, compares, "", ZERO_LSN, TXNID_NONE, TRUE);
+        r = toku_ft_loader_open(&loader, NULL, NULL, NULL, ndbs, brts, dbs, fnames, compares, "", ZERO_LSN, TXNID_NONE, true);
         if (r == 0)
             break;
     }
 
     if (verbose) printf("i=%d\n", i);
     
-    r = toku_ft_loader_abort(loader, TRUE);
+    r = toku_ft_loader_abort(loader, true);
     assert(r == 0);
 }
 
diff --git a/ft/tests/ftloader-test-writer-errors.cc b/ft/tests/ftloader-test-writer-errors.cc
index f5c3a953eb79285f62c2268c076df53fd554a4ed..8a7f2bac023a9e5cccaabaf8976b3b02190146a4 100644
--- a/ft/tests/ftloader-test-writer-errors.cc
+++ b/ft/tests/ftloader-test-writer-errors.cc
@@ -34,7 +34,7 @@ static void err_cb(DB *db UU(), int dbn UU(), int err UU(), DBT *key UU(), DBT *
     abort();
 }
 
-static int write_dbfile (char *tf_template, int n, char *output_name, BOOL expect_error, int testno) {
+static int write_dbfile (char *tf_template, int n, char *output_name, bool expect_error, int testno) {
     if (verbose) printf("test start %d %d testno=%d\n", n, expect_error, testno);
 
     int result = 0;
@@ -216,7 +216,7 @@ int test_main (int argc, const char *argv[]) {
     int r;
     r = system(unlink_all); CKERR(r);
     r = toku_os_mkdir(directory, 0755); CKERR(r);
-    r = write_dbfile(tf_template, n, output_name, FALSE, 0); CKERR(r);
+    r = write_dbfile(tf_template, n, output_name, false, 0); CKERR(r);
 
     if (verbose) printf("my_malloc_count=%d big_count=%d\n", my_malloc_count, my_big_malloc_count);
     if (verbose) printf("my_realloc_count=%d big_count=%d\n", my_realloc_count, my_big_realloc_count);
@@ -233,7 +233,7 @@ int test_main (int argc, const char *argv[]) {
         event_count_trigger = i;
         r = system(unlink_all); CKERR(r);
         r = toku_os_mkdir(directory, 0755); CKERR(r);
-        r = write_dbfile(tf_template, n, output_name, TRUE, i);
+        r = write_dbfile(tf_template, n, output_name, true, i);
         if (verbose) printf("event_count=%d\n", event_count);
         if (r == 0)
             break;
diff --git a/ft/tests/ftloader-test-writer.cc b/ft/tests/ftloader-test-writer.cc
index d4b73d828d15e446f19b7229c4040fceb0f7a6df..bd4b024a46f2727daf448846c14b9adb7146c449 100644
--- a/ft/tests/ftloader-test-writer.cc
+++ b/ft/tests/ftloader-test-writer.cc
@@ -57,7 +57,7 @@ static void verify_dbfile(int n, const char *name) {
     if (verbose) traceit("Verified brt internals");
 
     FT_CURSOR cursor = NULL;
-    r = toku_ft_cursor(t, &cursor, NULL, FALSE, FALSE); assert(r == 0);
+    r = toku_ft_cursor(t, &cursor, NULL, false, false); assert(r == 0);
 
     size_t userdata = 0;
     int i;
@@ -80,7 +80,7 @@ static void verify_dbfile(int n, const char *name) {
 
     struct ftstat64_s s;
     r = toku_ft_handle_stat64(t, NULL, &s); assert(r == 0);
-    assert(s.nkeys == (u_int64_t)n && s.ndata == (u_int64_t)n && s.dsize == userdata);
+    assert(s.nkeys == (uint64_t)n && s.ndata == (uint64_t)n && s.dsize == userdata);
 
     r = toku_close_ft_handle_nolsn(t, 0); assert(r==0);
     r = toku_cachetable_close(&ct);assert(r==0);
@@ -184,7 +184,7 @@ static void test_write_dbfile (char *tf_template, int n, char *output_name, TXNI
     assert_zero(r);
    
     destroy_merge_fileset(&fs);
-    ft_loader_fi_destroy(&bl.file_infos, FALSE);
+    ft_loader_fi_destroy(&bl.file_infos, false);
 
     // walk a cursor through the dbfile and verify the rows
     verify_dbfile(n, output_name);
diff --git a/ft/tests/ftloader-test.cc b/ft/tests/ftloader-test.cc
index 12365b57bf14ee13b22d860c2c9d803d041ea6cb..8b959c3f9ea21ce7323db460533f03e086c1edbb 100644
--- a/ft/tests/ftloader-test.cc
+++ b/ft/tests/ftloader-test.cc
@@ -33,12 +33,12 @@ static void err_cb(DB *db UU(), int dbn UU(), int err UU(), DBT *key UU(), DBT *
     abort();
 }
 
-BOOL founddup;
+bool founddup;
 static void expect_dups_cb(DB *db UU(), int dbn UU(), int err UU(), DBT *key UU(), DBT *val UU(), void *extra UU()) {
-    founddup=TRUE;
+    founddup=true;
 }
 
-static void test_merge_internal (int a[], int na, int b[], int nb, BOOL dups) {
+static void test_merge_internal (int a[], int na, int b[], int nb, bool dups) {
     int *MALLOC_N(na+nb, ab); // the combined array a and b
     for (int i=0; i<na; i++) {
 	ab[i]=a[i];
@@ -101,20 +101,20 @@ static void test_merge (void) {
     {
 	int avals[]={1,2,3,4,5};
 	int *bvals = NULL; //icc won't let us use a zero-sized array explicitly or by [] = {} construction.
-	test_merge_internal(avals, 5, bvals, 0, FALSE);
-	test_merge_internal(bvals, 0, avals, 5, FALSE);
+	test_merge_internal(avals, 5, bvals, 0, false);
+	test_merge_internal(bvals, 0, avals, 5, false);
     }
     {
 	int avals[]={1,3,5,7};
 	int bvals[]={2,4};
-	test_merge_internal(avals, 4, bvals, 2, FALSE);
-	test_merge_internal(bvals, 2, avals, 4, FALSE);
+	test_merge_internal(avals, 4, bvals, 2, false);
+	test_merge_internal(bvals, 2, avals, 4, false);
     }
     {
 	int avals[]={1,2,3,5,6,7};
 	int bvals[]={2,4,5,6,8};
-	test_merge_internal(avals, 6, bvals, 5, TRUE);
-	test_merge_internal(bvals, 5, avals, 6, TRUE);
+	test_merge_internal(avals, 6, bvals, 5, true);
+	test_merge_internal(bvals, 5, avals, 6, true);
     }
 }
 
@@ -151,8 +151,8 @@ static void test_mergesort_row_array (void) {
     const int MAX_LEN = 100;
     enum { MAX_VAL = 1000 };
     for (int i=0; i<MAX_LEN; i++) {
-	BOOL used[MAX_VAL];
-	for (int j=0; j<MAX_VAL; j++) used[j]=FALSE; 
+	bool used[MAX_VAL];
+	for (int j=0; j<MAX_VAL; j++) used[j]=false; 
 	int len=1+random()%MAX_LEN;
 	int avals[len];
 	for (int j=0; j<len; j++) {
@@ -161,7 +161,7 @@ static void test_mergesort_row_array (void) {
 		v = random()%MAX_VAL;
 	    } while (used[v]); 
 	    avals[j] = v;
-	    used[v] = TRUE;
+	    used[v] = true;
 	}
 	test_internal_mergesort_row_array(avals, len);
     }
@@ -176,11 +176,11 @@ static void test_read_write_rows (char *tf_template) {
     r = ft_loader_open_temp_file(&bl, &file);
     CKERR(r);
 
-    u_int64_t dataoff=0;
+    uint64_t dataoff=0;
 
     const char *keystrings[] = {"abc", "b", "cefgh"};
     const char *valstrings[] = {"defg", "", "xyz"};
-    u_int64_t actual_size=0;
+    uint64_t actual_size=0;
     for (int i=0; i<3; i++) {
 	DBT key;
         toku_fill_dbt(&key, keystrings[i], strlen(keystrings[i]));
@@ -193,7 +193,7 @@ static void test_read_write_rows (char *tf_template) {
     if (actual_size != dataoff) fprintf(stderr, "actual_size=%" PRIu64 ", dataoff=%" PRIu64 "\n", actual_size, dataoff);
     assert(actual_size == dataoff);
 
-    r = ft_loader_fi_close(&bl.file_infos, file, TRUE);
+    r = ft_loader_fi_close(&bl.file_infos, file, true);
     CKERR(r);
 
     r = ft_loader_fi_reopen(&bl.file_infos, file, "r");
@@ -217,7 +217,7 @@ static void test_read_write_rows (char *tf_template) {
 	toku_free(key.data);
 	toku_free(val.data);
     }
-    r = ft_loader_fi_close(&bl.file_infos, file, TRUE);
+    r = ft_loader_fi_close(&bl.file_infos, file, true);
     CKERR(r);
 
     r = ft_loader_fi_unlink(&bl.file_infos, file);
@@ -226,7 +226,7 @@ static void test_read_write_rows (char *tf_template) {
     assert(bl.file_infos.n_files_open==0);
     assert(bl.file_infos.n_files_extant==0);
 
-    ft_loader_fi_destroy(&bl.file_infos, FALSE);
+    ft_loader_fi_destroy(&bl.file_infos, false);
 }
 
 static void fill_rowset (struct rowset *rows,
@@ -258,7 +258,7 @@ static void verify_dbfile(int n, int sorted_keys[], const char *sorted_vals[], c
     r = toku_ft_handle_open(t, name, 0, 0, ct, null_txn); assert(r==0);
 
     FT_CURSOR cursor = NULL;
-    r = toku_ft_cursor(t, &cursor, NULL, FALSE, FALSE); assert(r == 0);
+    r = toku_ft_cursor(t, &cursor, NULL, false, false); assert(r == 0);
 
     size_t userdata = 0;
     int i;
@@ -281,7 +281,7 @@ static void verify_dbfile(int n, int sorted_keys[], const char *sorted_vals[], c
 
     struct ftstat64_s s;
     r = toku_ft_handle_stat64(t, NULL, &s); assert(r == 0);
-    assert(s.nkeys == (u_int64_t) n && s.ndata == (u_int64_t) n && s.dsize == userdata);
+    assert(s.nkeys == (uint64_t) n && s.ndata == (uint64_t) n && s.dsize == userdata);
     
     r = toku_close_ft_handle_nolsn(t, 0); assert(r==0);
     r = toku_cachetable_close(&ct);assert(r==0);
@@ -342,7 +342,7 @@ static void test_merge_files (const char *tf_template, const char *output_name)
     assert(r==0);
 
     destroy_merge_fileset(&fs);
-    ft_loader_fi_destroy(&bl.file_infos, FALSE);
+    ft_loader_fi_destroy(&bl.file_infos, false);
     ft_loader_destroy_error_callback(&bl.error_callback);
     ft_loader_lock_destroy(&bl);
 
diff --git a/ft/tests/is_empty.cc b/ft/tests/is_empty.cc
index f9b7f12d8c160350a797c6985d8b2b6d76f722a5..cac7ff6151cf85a3e2b76f84af3916001e2718e3 100644
--- a/ft/tests/is_empty.cc
+++ b/ft/tests/is_empty.cc
@@ -31,14 +31,14 @@ static void test_it (int N) {
 
     toku_logger_set_cachetable(logger, ct);
 
-    r = toku_logger_open_rollback(logger, ct, TRUE);                                                        CKERR(r);
+    r = toku_logger_open_rollback(logger, ct, true);                                                        CKERR(r);
 
     TOKUTXN txn;
     r = toku_txn_begin_txn((DB_TXN*)NULL, (TOKUTXN)0, &txn, logger, TXN_SNAPSHOT_ROOT);                     CKERR(r);
 
     r = toku_open_ft_handle(FILENAME, 1, &brt, 1024, 256, TOKU_DEFAULT_COMPRESSION_METHOD, ct, txn, toku_builtin_compare_fun);                    CKERR(r);
 
-    r = toku_txn_commit_txn(txn, FALSE, NULL, NULL);                                 CKERR(r);
+    r = toku_txn_commit_txn(txn, false, NULL, NULL);                                 CKERR(r);
     toku_txn_close_txn(txn);
 
     r = toku_checkpoint(ct, logger, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT);                             CKERR(r);
@@ -48,7 +48,7 @@ static void test_it (int N) {
     for (int i=0; i<N; i++) {
 	r = toku_txn_begin_txn((DB_TXN*)NULL, (TOKUTXN)0, &txn, logger, TXN_SNAPSHOT_ROOT);                 CKERR(r);
 	r = toku_open_ft_handle(FILENAME, 0, &brt, 1024, 256, TOKU_DEFAULT_COMPRESSION_METHOD, ct, txn, toku_builtin_compare_fun);                CKERR(r);
-	r = toku_txn_commit_txn(txn, FALSE, NULL, NULL);                             CKERR(r);
+	r = toku_txn_commit_txn(txn, false, NULL, NULL);                             CKERR(r);
 	toku_txn_close_txn(txn);
 
 	r = toku_txn_begin_txn((DB_TXN*)NULL, (TOKUTXN)0, &txn, logger, TXN_SNAPSHOT_ROOT);                 CKERR(r);
@@ -59,7 +59,7 @@ static void test_it (int N) {
 	memset(val, 'v', sizeof(val));
 	val[sizeof(val)-1]=0;
 	r = toku_ft_insert(brt, toku_fill_dbt(&k, key, 1+strlen(key)), toku_fill_dbt(&v, val, 1+strlen(val)), txn);
-	r = toku_txn_commit_txn(txn, FALSE, NULL, NULL);                                 CKERR(r);
+	r = toku_txn_commit_txn(txn, false, NULL, NULL);                                 CKERR(r);
 	toku_txn_close_txn(txn);
 
 
@@ -71,7 +71,7 @@ static void test_it (int N) {
     for (int i=0; i<N; i++) {
 	r = toku_txn_begin_txn((DB_TXN*)NULL, (TOKUTXN)0, &txn, logger, TXN_SNAPSHOT_ROOT);                     CKERR(r);
 	r = toku_open_ft_handle(FILENAME, 0, &brt, 1024, 256, TOKU_DEFAULT_COMPRESSION_METHOD, ct, txn, toku_builtin_compare_fun);                CKERR(r);
-	r = toku_txn_commit_txn(txn, FALSE, NULL, NULL);                                 CKERR(r);
+	r = toku_txn_commit_txn(txn, false, NULL, NULL);                                 CKERR(r);
 	toku_txn_close_txn(txn);
 
 	r = toku_txn_begin_txn((DB_TXN*)NULL, (TOKUTXN)0, &txn, logger, TXN_SNAPSHOT_ROOT);                     CKERR(r);
@@ -81,12 +81,12 @@ static void test_it (int N) {
 	r = toku_ft_delete(brt, toku_fill_dbt(&k, key, 1+strlen(key)), txn);
 
 	if (0) {
-	BOOL is_empty;
+	bool is_empty;
         is_empty = toku_ft_is_empty_fast(brt);
 	assert(!is_empty);
 	}
 	
-	r = toku_txn_commit_txn(txn, FALSE, NULL, NULL);                                 CKERR(r);
+	r = toku_txn_commit_txn(txn, false, NULL, NULL);                                 CKERR(r);
 	toku_txn_close_txn(txn);
 
 
@@ -97,11 +97,11 @@ static void test_it (int N) {
     }
     r = toku_txn_begin_txn((DB_TXN*)NULL, (TOKUTXN)0, &txn, logger, TXN_SNAPSHOT_ROOT);                        CKERR(r);
     r = toku_open_ft_handle(FILENAME, 0, &brt, 1024, 256, TOKU_DEFAULT_COMPRESSION_METHOD, ct, txn, toku_builtin_compare_fun);                       CKERR(r);
-    r = toku_txn_commit_txn(txn, FALSE, NULL, NULL);                                     CKERR(r);
+    r = toku_txn_commit_txn(txn, false, NULL, NULL);                                     CKERR(r);
     toku_txn_close_txn(txn);
 
     if (0) {
-    BOOL is_empty;
+    bool is_empty;
     is_empty = toku_ft_is_empty_fast(brt);
     assert(is_empty);
     }
@@ -110,7 +110,7 @@ static void test_it (int N) {
     r = toku_close_ft_handle_nolsn(brt, NULL);                                                                             CKERR(r);
 
     r = toku_checkpoint(ct, logger, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT);                                CKERR(r);
-    r = toku_logger_close_rollback(logger, FALSE);                                                             CKERR(r);
+    r = toku_logger_close_rollback(logger, false);                                                             CKERR(r);
     r = toku_checkpoint(ct, logger, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT);                                CKERR(r);
     r = toku_cachetable_close(&ct);                                                                            CKERR(r);
     r = toku_logger_close(&logger);                                                        assert(r==0);
diff --git a/ft/tests/keyrange.cc b/ft/tests/keyrange.cc
index 54df9861d3be7e43e5cad97a78db61aa6bddd6df..46b0a406f7bd1a8987fed674c53aa32a340846db 100644
--- a/ft/tests/keyrange.cc
+++ b/ft/tests/keyrange.cc
@@ -35,9 +35,9 @@ static void close_and_reopen (void) {
     open_ft_and_ct(false);
 }
 
-static void reload (u_int64_t limit) {
+static void reload (uint64_t limit) {
     // insert keys 1, 3, 5, ...
-    for (u_int64_t i=0; i<limit; i++) {
+    for (uint64_t i=0; i<limit; i++) {
 	char key[100],val[100];
 	snprintf(key, 100, "%08llu", (unsigned long long)2*i+1);
 	snprintf(val, 100, "%08llu", (unsigned long long)2*i+1);
@@ -51,7 +51,7 @@ enum memory_state {
     CLOSE_AND_REOPEN_LEAVE_ON_DISK   // close the brts, reopen them, but leave the state on disk.
 };
 
-static void maybe_reopen (enum memory_state ms, u_int64_t limit) {
+static void maybe_reopen (enum memory_state ms, uint64_t limit) {
     switch (ms) {
     case CLOSE_AND_RELOAD:
 	close_and_reopen();
@@ -66,11 +66,11 @@ static void maybe_reopen (enum memory_state ms, u_int64_t limit) {
     assert(0);
 }
 
-static void test_keyrange (enum memory_state ms, u_int64_t limit) {
+static void test_keyrange (enum memory_state ms, uint64_t limit) {
     open_ft_and_ct(true);
 
     // insert keys 1, 3, 5, ...
-    for (u_int64_t i=0; i<limit; i++) {
+    for (uint64_t i=0; i<limit; i++) {
 	char key[100],val[100];
 	snprintf(key, 100, "%08llu", (unsigned long long)2*i+1);
 	snprintf(val, 100, "%08llu", (unsigned long long)2*i+1);
@@ -90,16 +90,16 @@ static void test_keyrange (enum memory_state ms, u_int64_t limit) {
     maybe_reopen(ms, limit);
 
     {
-	u_int64_t prev_less = 0, prev_greater = 1LL << 60; 
-	u_int64_t count_less_adjacent = 0, count_greater_adjacent = 0; // count the number of times that the next value is 1 more (less) than the previous.
-	u_int64_t equal_count = 0;
+	uint64_t prev_less = 0, prev_greater = 1LL << 60; 
+	uint64_t count_less_adjacent = 0, count_greater_adjacent = 0; // count the number of times that the next value is 1 more (less) than the previous.
+	uint64_t equal_count = 0;
 
         // lookup keys 1, 3, 5, ...
-	for (u_int64_t i=0; i<limit; i++) {
+	for (uint64_t i=0; i<limit; i++) {
 	    char key[100];
 	    snprintf(key, 100, "%08llu", (unsigned long long)2*i+1);
 	    DBT k;
-	    u_int64_t less,equal,greater;
+	    uint64_t less,equal,greater;
 	    int r = toku_ft_keyrange(t, toku_fill_dbt(&k, key, 1+strlen(key)), &less, &equal, &greater);
 	    assert(r == 0);
 	    if (verbose > 1) 
@@ -158,11 +158,11 @@ static void test_keyrange (enum memory_state ms, u_int64_t limit) {
     maybe_reopen(ms, limit);
 
     // lookup keys 0, 2, 4, ... not in the tree
-    for (u_int64_t i=0; i<1+limit; i++) {
+    for (uint64_t i=0; i<1+limit; i++) {
 	char key[100];
 	snprintf(key, 100, "%08llu", (unsigned long long)2*i);
 	DBT k;
-	u_int64_t less,equal,greater;
+	uint64_t less,equal,greater;
 	int r = toku_ft_keyrange(t, toku_fill_dbt(&k, key, 1+strlen(key)), &less, &equal, &greater);
 	assert(r == 0);
         if (verbose > 1)
@@ -197,7 +197,7 @@ static void test_keyrange (enum memory_state ms, u_int64_t limit) {
 
 int
 test_main (int argc , const char *argv[]) {
-    u_int64_t limit = 30000;
+    uint64_t limit = 30000;
 
     for (int i = 1; i < argc; i++) {
         if (strcmp(argv[i], "-v") == 0) {
diff --git a/ft/tests/le-cursor-provdel.cc b/ft/tests/le-cursor-provdel.cc
index 28dbb3d2aa110f7ae0e2c16f939b07e3dffa362c..757bbb0cfbd361d9eb7e6a4858c229abcd748769 100644
--- a/ft/tests/le-cursor-provdel.cc
+++ b/ft/tests/le-cursor-provdel.cc
@@ -47,7 +47,7 @@ create_populate_tree(const char *logdir, const char *fname, int n) {
     error = toku_create_cachetable(&ct, 0, ZERO_LSN, logger);
     assert(error == 0);
     toku_logger_set_cachetable(logger, ct);
-    error = toku_logger_open_rollback(logger, ct, TRUE);
+    error = toku_logger_open_rollback(logger, ct, true);
     assert(error == 0);
 
     TOKUTXN txn = NULL;
@@ -58,7 +58,7 @@ create_populate_tree(const char *logdir, const char *fname, int n) {
     error = toku_open_ft_handle(fname, 1, &brt, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, txn, test_ft_cursor_keycompare);
     assert(error == 0);
 
-    error = toku_txn_commit_txn(txn, TRUE, NULL, NULL);
+    error = toku_txn_commit_txn(txn, true, NULL, NULL);
     assert(error == 0);
     toku_txn_close_txn(txn);
 
@@ -78,7 +78,7 @@ create_populate_tree(const char *logdir, const char *fname, int n) {
         assert(error == 0);
     }
 
-    error = toku_txn_commit_txn(txn, TRUE, NULL, NULL);
+    error = toku_txn_commit_txn(txn, true, NULL, NULL);
     assert(error == 0);
     toku_txn_close_txn(txn);
 
@@ -88,7 +88,7 @@ create_populate_tree(const char *logdir, const char *fname, int n) {
     error = toku_checkpoint(ct, logger, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT);
     assert(error == 0);
 
-    error = toku_logger_close_rollback(logger, FALSE);
+    error = toku_logger_close_rollback(logger, false);
     assert(error == 0);
 
     error = toku_checkpoint(ct, logger, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT);
@@ -120,7 +120,7 @@ test_provdel(const char *logdir, const char *fname, int n) {
     error = toku_create_cachetable(&ct, 0, ZERO_LSN, logger);
     assert(error == 0);
     toku_logger_set_cachetable(logger, ct);
-    error = toku_logger_open_rollback(logger, ct, FALSE);
+    error = toku_logger_open_rollback(logger, ct, false);
     assert(error == 0);
 
     TOKUTXN txn = NULL;
@@ -131,7 +131,7 @@ test_provdel(const char *logdir, const char *fname, int n) {
     error = toku_open_ft_handle(fname, 1, &brt, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, txn, test_ft_cursor_keycompare);
     assert(error == 0);
 
-    error = toku_txn_commit_txn(txn, TRUE, NULL, NULL);
+    error = toku_txn_commit_txn(txn, true, NULL, NULL);
     assert(error == 0);
     toku_txn_close_txn(txn);
 
@@ -182,11 +182,11 @@ test_provdel(const char *logdir, const char *fname, int n) {
     error = toku_le_cursor_close(cursor);
     assert(error == 0);
 
-    error = toku_txn_commit_txn(cursortxn, TRUE, NULL, NULL);
+    error = toku_txn_commit_txn(cursortxn, true, NULL, NULL);
     assert(error == 0);
     toku_txn_close_txn(cursortxn);
 
-    error = toku_txn_commit_txn(txn, TRUE, NULL, NULL);
+    error = toku_txn_commit_txn(txn, true, NULL, NULL);
     assert(error == 0);
     toku_txn_close_txn(txn);
 
@@ -196,7 +196,7 @@ test_provdel(const char *logdir, const char *fname, int n) {
     error = toku_checkpoint(ct, logger, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT);
     assert(error == 0);
 
-    error = toku_logger_close_rollback(logger, FALSE);
+    error = toku_logger_close_rollback(logger, false);
     assert(error == 0);
     error = toku_logger_close(&logger);
     assert(error == 0);
diff --git a/ft/tests/le-cursor-right.cc b/ft/tests/le-cursor-right.cc
index 33441e511ffeb0e67422824518e37e05422d1a60..fb3ba348d2a7b373abe42e9cd23b4fb74460e8e0 100644
--- a/ft/tests/le-cursor-right.cc
+++ b/ft/tests/le-cursor-right.cc
@@ -51,7 +51,7 @@ create_populate_tree(const char *logdir, const char *fname, int n) {
     error = toku_create_cachetable(&ct, 0, ZERO_LSN, logger);
     assert(error == 0);
     toku_logger_set_cachetable(logger, ct);
-    error = toku_logger_open_rollback(logger, ct, TRUE);
+    error = toku_logger_open_rollback(logger, ct, true);
     assert(error == 0);
 
     TOKUTXN txn = NULL;
@@ -62,7 +62,7 @@ create_populate_tree(const char *logdir, const char *fname, int n) {
     error = toku_open_ft_handle(fname, 1, &brt, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, txn, test_keycompare);
     assert(error == 0);
 
-    error = toku_txn_commit_txn(txn, TRUE, NULL, NULL);
+    error = toku_txn_commit_txn(txn, true, NULL, NULL);
     assert(error == 0);
     toku_txn_close_txn(txn);
 
@@ -82,7 +82,7 @@ create_populate_tree(const char *logdir, const char *fname, int n) {
         assert(error == 0);
     }
 
-    error = toku_txn_commit_txn(txn, TRUE, NULL, NULL);
+    error = toku_txn_commit_txn(txn, true, NULL, NULL);
     assert(error == 0);
     toku_txn_close_txn(txn);
 
@@ -91,7 +91,7 @@ create_populate_tree(const char *logdir, const char *fname, int n) {
 
     error = toku_checkpoint(ct, logger, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT);
     assert(error == 0);
-    error = toku_logger_close_rollback(logger, FALSE);
+    error = toku_logger_close_rollback(logger, false);
     assert(error == 0);
 
     error = toku_checkpoint(ct, logger, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT);
@@ -131,7 +131,7 @@ test_neg_infinity(const char *fname, int n) {
         DBT key;
         toku_fill_dbt(&key, &k, sizeof k);
         int right = toku_le_cursor_is_key_greater(cursor, &key);
-        assert(right == TRUE);
+        assert(right == true);
     }
         
     error = toku_le_cursor_close(cursor);
@@ -192,7 +192,7 @@ test_pos_infinity(const char *fname, int n) {
         DBT key2;
         toku_fill_dbt(&key2, &k, sizeof k);
         int right = toku_le_cursor_is_key_greater(cursor, &key2);
-        assert(right == FALSE);
+        assert(right == false);
     }
 
     error = toku_le_cursor_close(cursor);
@@ -249,7 +249,7 @@ test_between(const char *fname, int n) {
             DBT key2;
             toku_fill_dbt(&key2, &k, sizeof k);
             int right = toku_le_cursor_is_key_greater(cursor, &key2);
-            assert(right == FALSE);
+            assert(right == false);
         }
 
         // test that i+1 .. n is left of the cursor
@@ -258,7 +258,7 @@ test_between(const char *fname, int n) {
             DBT key2;
             toku_fill_dbt(&key2, &k, sizeof k);
             int right = toku_le_cursor_is_key_greater(cursor, &key2);
-            assert(right == TRUE);
+            assert(right == true);
         }
 
     }
diff --git a/ft/tests/le-cursor-walk.cc b/ft/tests/le-cursor-walk.cc
index a682427f783830d38bc896d064544347969a6697..4fb21936e4cfd75304f3b7debfc388c8b5aea186 100644
--- a/ft/tests/le-cursor-walk.cc
+++ b/ft/tests/le-cursor-walk.cc
@@ -47,7 +47,7 @@ create_populate_tree(const char *logdir, const char *fname, int n) {
     error = toku_create_cachetable(&ct, 0, ZERO_LSN, logger);
     assert(error == 0);
     toku_logger_set_cachetable(logger, ct);
-    error = toku_logger_open_rollback(logger, ct, TRUE);
+    error = toku_logger_open_rollback(logger, ct, true);
     assert(error == 0);
 
     TOKUTXN txn = NULL;
@@ -58,7 +58,7 @@ create_populate_tree(const char *logdir, const char *fname, int n) {
     error = toku_open_ft_handle(fname, 1, &brt, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, txn, test_ft_cursor_keycompare);
     assert(error == 0);
 
-    error = toku_txn_commit_txn(txn, TRUE, NULL, NULL);
+    error = toku_txn_commit_txn(txn, true, NULL, NULL);
     assert(error == 0);
     toku_txn_close_txn(txn);
 
@@ -78,7 +78,7 @@ create_populate_tree(const char *logdir, const char *fname, int n) {
         assert(error == 0);
     }
 
-    error = toku_txn_commit_txn(txn, TRUE, NULL, NULL);
+    error = toku_txn_commit_txn(txn, true, NULL, NULL);
     assert(error == 0);
     toku_txn_close_txn(txn);
 
@@ -87,7 +87,7 @@ create_populate_tree(const char *logdir, const char *fname, int n) {
 
     error = toku_checkpoint(ct, logger, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT);
     assert(error == 0);
-    error = toku_logger_close_rollback(logger, FALSE);
+    error = toku_logger_close_rollback(logger, false);
     assert(error == 0);
     error = toku_checkpoint(ct, logger, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT);
     assert(error == 0);
diff --git a/ft/tests/log-test-maybe-trim.cc b/ft/tests/log-test-maybe-trim.cc
index be7d32fad06800d798d7fd3df13b2ab6bd24fd61..eaa9e1868b8cf7939a3014899663f78d9941633a 100644
--- a/ft/tests/log-test-maybe-trim.cc
+++ b/ft/tests/log-test-maybe-trim.cc
@@ -27,11 +27,11 @@ test_main (int argc __attribute__((__unused__)),
     r = toku_logger_open(dname, logger); assert(r == 0);
     BYTESTRING hello = (BYTESTRING) { 5, (char *) "hello"};
     LSN comment_lsn;
-    r = toku_log_comment(logger, &comment_lsn, TRUE, 0, hello);
+    r = toku_log_comment(logger, &comment_lsn, true, 0, hello);
     LSN begin_lsn;
-    r = toku_log_begin_checkpoint(logger, &begin_lsn, TRUE, 0, 0); assert(r == 0);
+    r = toku_log_begin_checkpoint(logger, &begin_lsn, true, 0, 0); assert(r == 0);
     LSN end_lsn;
-    r = toku_log_end_checkpoint(logger, &end_lsn, TRUE, begin_lsn, 0, 0, 0); assert(r == 0);
+    r = toku_log_end_checkpoint(logger, &end_lsn, true, begin_lsn, 0, 0, 0); assert(r == 0);
     r = toku_logger_maybe_trim_log(logger, begin_lsn); assert(r == 0);
     r = toku_logger_close(&logger); assert(r == 0);
 
diff --git a/ft/tests/log-test5.cc b/ft/tests/log-test5.cc
index ab0459355c74366fcefb433a2fec7b27aa3b3394..26fa609d24657576aa405b3acb5e1dedbb5d792b 100644
--- a/ft/tests/log-test5.cc
+++ b/ft/tests/log-test5.cc
@@ -28,7 +28,7 @@ test_main (int argc __attribute__((__unused__)),
     assert(r == 0);
     r = toku_logger_set_lg_max(logger, LSIZE);
     {
-	u_int32_t n;
+	uint32_t n;
 	r = toku_logger_get_lg_max(logger, &n);
 	assert(n==LSIZE);
     }
diff --git a/ft/tests/log-test6.cc b/ft/tests/log-test6.cc
index f9b80f55215b8ff51b1acc6b58cdd94993d810e3..6ee0d99f0f5c54b423c5a5ea79644a1b07a32ab2 100644
--- a/ft/tests/log-test6.cc
+++ b/ft/tests/log-test6.cc
@@ -34,7 +34,7 @@ test_main (int argc __attribute__((__unused__)),
     assert(r == 0);
     r = toku_logger_set_lg_max(logger, LSIZE);
     {
-	u_int32_t n;
+	uint32_t n;
 	r = toku_logger_get_lg_max(logger, &n);
 	assert(n==LSIZE);
     }
diff --git a/ft/tests/log-test7.cc b/ft/tests/log-test7.cc
index b90c3180d7e4c7c7e1ac2764ad957edc767adda3..8e717abe3bdb88805a2da612b4b4e50540ebe876 100644
--- a/ft/tests/log-test7.cc
+++ b/ft/tests/log-test7.cc
@@ -32,7 +32,7 @@ static void setup_logger(int which) {
     assert(r == 0);
     r = toku_logger_set_lg_max(logger[which], LSIZE);
     {
-	u_int32_t n;
+	uint32_t n;
 	r = toku_logger_get_lg_max(logger[which], &n);
 	assert(n==LSIZE);
     }
diff --git a/ft/tests/logcursor-timestamp.cc b/ft/tests/logcursor-timestamp.cc
index 97a80372eef82354742b35dc03d68604fa1e8309..58d70cd416f7ee2177322f8ab258f51cf03e99a8 100644
--- a/ft/tests/logcursor-timestamp.cc
+++ b/ft/tests/logcursor-timestamp.cc
@@ -7,7 +7,7 @@
 
 #include "includes.h"
 
-static u_int64_t now(void) {
+static uint64_t now(void) {
     struct timeval tv;
     int r = gettimeofday(&tv, NULL);
     assert(r == 0);
@@ -62,7 +62,7 @@ test_main (int argc, const char *argv[]) {
     r = toku_logcursor_next(lc, &le);
     assert(r == 0 && le->cmd == LT_comment);
     assert(le->u.comment.comment.len == 5 && memcmp(le->u.comment.comment.data, "hello", 5) == 0);
-    u_int64_t t = le->u.comment.timestamp;
+    uint64_t t = le->u.comment.timestamp;
     
     r = toku_logcursor_next(lc, &le);
     assert(r == 0 && le->cmd == LT_comment);
diff --git a/ft/tests/msnfilter.cc b/ft/tests/msnfilter.cc
index 465ae867c0bf3154a3558e535c679d9bc02207d4..46c5f4ea7a07aa76d0ff43a8aaef507a078cd420 100644
--- a/ft/tests/msnfilter.cc
+++ b/ft/tests/msnfilter.cc
@@ -47,7 +47,7 @@ append_leaf(FT_HANDLE brt, FTNODE leafnode, void *key, uint32_t keylen, void *va
     MSN msn = next_dummymsn();
     FT_MSG_S cmd = { FT_INSERT, msn, xids_get_root_xids(), .u={.id = { &thekey, &theval }} };
 
-    u_int64_t workdone=0;
+    uint64_t workdone=0;
     toku_ft_leaf_apply_cmd(brt->ft->compare_fun, brt->ft->update_fun, &brt->ft->cmp_descriptor, leafnode, &cmd, &workdone, NULL);
     {
 	int r = toku_ft_lookup(brt, &thekey, lookup_checkf, &pair);
diff --git a/ft/tests/omt-test.cc b/ft/tests/omt-test.cc
index ecfc49dae13bf507dbf8cf0b57c46e8af4aa24fd..e6f5a0b7c008e03f1b511bd61fdce6573c67560e 100644
--- a/ft/tests/omt-test.cc
+++ b/ft/tests/omt-test.cc
@@ -43,7 +43,7 @@ parse_args (int argc, const char *argv[]) {
 /* End ".h like" stuff. */
 
 struct value {
-    u_int32_t number;
+    uint32_t number;
 };
 #define V(x) ((struct value *)(x))
 
@@ -67,7 +67,7 @@ enum create_type {
 OMT omt;
 TESTVALUE*       values = NULL;
 struct value*   nums   = NULL;
-u_int32_t       length;
+uint32_t       length;
 
 static void
 cleanup_globals (void) {
@@ -82,7 +82,7 @@ cleanup_globals (void) {
 const unsigned int random_seed = 0xFEADACBA;
 
 static void
-init_init_values (unsigned int seed, u_int32_t num_elements) {
+init_init_values (unsigned int seed, uint32_t num_elements) {
     srandom(seed);
 
     cleanup_globals();
@@ -95,8 +95,8 @@ init_init_values (unsigned int seed, u_int32_t num_elements) {
 }
 
 static void
-init_identity_values (unsigned int seed, u_int32_t num_elements) {
-    u_int32_t   i;
+init_identity_values (unsigned int seed, uint32_t num_elements) {
+    uint32_t   i;
 
     init_init_values(seed, num_elements);
 
@@ -107,27 +107,27 @@ init_identity_values (unsigned int seed, u_int32_t num_elements) {
 }
 
 static void
-init_distinct_sorted_values (unsigned int seed, u_int32_t num_elements) {
-    u_int32_t   i;
+init_distinct_sorted_values (unsigned int seed, uint32_t num_elements) {
+    uint32_t   i;
 
     init_init_values(seed, num_elements);
 
-    u_int32_t number = 0;
+    uint32_t number = 0;
 
     for (i = 0; i < length; i++) {
-        number          += (u_int32_t)(random() % 32) + 1;
+        number          += (uint32_t)(random() % 32) + 1;
         nums[i].number   = number;
         values[i]        = (TESTVALUE)&nums[i];
     }
 }
 
 static void
-init_distinct_random_values (unsigned int seed, u_int32_t num_elements) {
+init_distinct_random_values (unsigned int seed, uint32_t num_elements) {
     init_distinct_sorted_values(seed, num_elements);
 
-    u_int32_t   i;
-    u_int32_t   choice;
-    u_int32_t   choices;
+    uint32_t   i;
+    uint32_t   choice;
+    uint32_t   choices;
     struct value temp;
     for (i = 0; i < length - 1; i++) {
         choices = length - i;
@@ -177,9 +177,9 @@ test_create_size (enum close_when_done do_close) {
 
 static void
 test_create_insert_at_almost_random (enum close_when_done do_close) {
-    u_int32_t i;
+    uint32_t i;
     int r;
-    u_int32_t size = 0;
+    uint32_t size = 0;
 
     test_create(KEEP_WHEN_DONE);
     r = toku_omt_insert_at(omt, values[0], toku_omt_size(omt)+1);
@@ -205,9 +205,9 @@ test_create_insert_at_almost_random (enum close_when_done do_close) {
 
 static void
 test_create_insert_at_sequential (enum close_when_done do_close) {
-    u_int32_t i;
+    uint32_t i;
     int r;
-    u_int32_t size = 0;
+    uint32_t size = 0;
 
     test_create(KEEP_WHEN_DONE);
     r = toku_omt_insert_at(omt, values[0], toku_omt_size(omt)+1);
@@ -250,7 +250,7 @@ test_create_from_sorted_array (enum create_type create_choice, enum close_when_d
     else if (create_choice == INSERT_AT_ALMOST_RANDOM) {
         test_create_insert_at_almost_random(KEEP_WHEN_DONE);
     }
-    else assert(FALSE);
+    else assert(false);
 
     assert(omt!=NULL);
     test_close(do_close);
@@ -264,8 +264,8 @@ test_create_from_sorted_array_size (enum create_type create_choice, enum close_w
 }    
 
 static void
-test_fetch_verify (OMT omtree, TESTVALUE* val, u_int32_t len ) {
-    u_int32_t i;
+test_fetch_verify (OMT omtree, TESTVALUE* val, uint32_t len ) {
+    uint32_t i;
     int r;
     TESTVALUE v = (TESTVALUE)&i;
     TESTVALUE oldv = v;
@@ -302,7 +302,7 @@ test_create_fetch_verify (enum create_type create_choice, enum close_when_done d
 static int iterate_helper_error_return = 1;
 
 static int
-iterate_helper (TESTVALUE v, u_int32_t idx, void* extra) {
+iterate_helper (TESTVALUE v, uint32_t idx, void* extra) {
     if (extra == NULL) return iterate_helper_error_return;
     TESTVALUE* vals = (TESTVALUE *)extra;
     assert(v != NULL);
@@ -312,7 +312,7 @@ iterate_helper (TESTVALUE v, u_int32_t idx, void* extra) {
 }
 
 static void
-test_iterate_verify (OMT omtree, TESTVALUE* vals, u_int32_t len) {
+test_iterate_verify (OMT omtree, TESTVALUE* vals, uint32_t len) {
     int r;
     iterate_helper_error_return = 0;
     r = toku_omt_iterate(omtree, iterate_helper, (void*)vals);
@@ -336,19 +336,19 @@ test_create_iterate_verify (enum create_type create_choice, enum close_when_done
 
 
 static void
-permute_array (u_int32_t* arr, u_int32_t len) {
+permute_array (uint32_t* arr, uint32_t len) {
     //
     // create a permutation of 0...size-1
     //
-    u_int32_t i = 0;
+    uint32_t i = 0;
     for (i = 0; i < len; i++) {
         arr[i] = i;
     }
     for (i = 0; i < len - 1; i++) {
-        u_int32_t choices = len - i;
-        u_int32_t choice  = random() % choices;
+        uint32_t choices = len - i;
+        uint32_t choice  = random() % choices;
         if (choice != i) {
-            u_int32_t temp = arr[i];
+            uint32_t temp = arr[i];
             arr[i]      = arr[choice];
             arr[choice] = temp;
         }
@@ -357,13 +357,13 @@ permute_array (u_int32_t* arr, u_int32_t len) {
 
 static void
 test_create_set_at (enum create_type create_choice, enum close_when_done do_close) {
-    u_int32_t i = 0;
+    uint32_t i = 0;
 
     struct value*   old_nums   = NULL;
     MALLOC_N(length, old_nums);
     assert(nums);
 
-    u_int32_t* perm = NULL;
+    uint32_t* perm = NULL;
     MALLOC_N(length, perm);
     assert(perm);
 
@@ -388,9 +388,9 @@ test_create_set_at (enum create_type create_choice, enum close_when_done do_clos
     r = toku_omt_set_at (omt, values[0], length+1);
     CKERR2(r,EINVAL);    
     for (i = 0; i < length; i++) {
-        u_int32_t choice = perm[i];
+        uint32_t choice = perm[i];
         values[choice] = &nums[choice];
-        nums[choice].number = (u_int32_t)random();
+        nums[choice].number = (uint32_t)random();
         r = toku_omt_set_at (omt, values[choice], choice);
         CKERR(r);
         test_iterate_verify(omt, values, length);
@@ -420,9 +420,9 @@ insert_helper (TESTVALUE value, void* extra_insert) {
 
 static void
 test_create_insert (enum close_when_done do_close) {
-    u_int32_t i = 0;
+    uint32_t i = 0;
 
-    u_int32_t* perm = NULL;
+    uint32_t* perm = NULL;
     MALLOC_N(length, perm);
     assert(perm);
 
@@ -430,12 +430,12 @@ test_create_insert (enum close_when_done do_close) {
 
     test_create(KEEP_WHEN_DONE);
     int r;
-    u_int32_t size = length;
+    uint32_t size = length;
     length = 0;
     while (length < size) {
-        u_int32_t choice = perm[length];
+        uint32_t choice = perm[length];
         TESTVALUE to_insert = &nums[choice];
-        u_int32_t idx = UINT32_MAX;
+        uint32_t idx = UINT32_MAX;
 
         assert(length==toku_omt_size(omt));
         r = toku_omt_insert(omt, to_insert, insert_helper, to_insert, &idx);
@@ -475,7 +475,7 @@ test_create_insert (enum close_when_done do_close) {
 
 static void
 test_create_delete_at (enum create_type create_choice, enum close_when_done do_close) {
-    u_int32_t i = 0;
+    uint32_t i = 0;
     int r = ENOSYS;
     test_create_from_sorted_array(create_choice, KEEP_WHEN_DONE);
 
@@ -487,7 +487,7 @@ test_create_delete_at (enum create_type create_choice, enum close_when_done do_c
     CKERR2(r,EINVAL);
     while (length > 0) {
         assert(length == toku_omt_size(omt));
-        u_int32_t index_to_delete = random()%length;
+        uint32_t index_to_delete = random()%length;
         r = toku_omt_delete_at(omt, index_to_delete);
         CKERR(r);
         for (i = index_to_delete+1; i < length; i++) {
@@ -510,7 +510,7 @@ test_create_delete_at (enum create_type create_choice, enum close_when_done do_c
 static void
 test_split_merge (enum create_type create_choice, enum close_when_done do_close) {
     int r = ENOSYS;
-    u_int32_t i = 0;
+    uint32_t i = 0;
     OMT left_split = NULL;
     OMT right_split = NULL;
     test_create_from_sorted_array(create_choice, KEEP_WHEN_DONE);
@@ -571,7 +571,7 @@ test_split_merge (enum create_type create_choice, enum close_when_done do_close)
 
 static void
 init_values (enum rand_type rand_choice) {
-    const u_int32_t test_size = 100;
+    const uint32_t test_size = 100;
     if (rand_choice == TEST_RANDOM) {
         init_distinct_random_values(random_seed, test_size);
     }
@@ -581,7 +581,7 @@ init_values (enum rand_type rand_choice) {
     else if (rand_choice == TEST_IDENTITY) {
         init_identity_values(       random_seed, test_size);
     }
-    else assert(FALSE);
+    else assert(false);
 }
 
 static void
@@ -611,8 +611,8 @@ test_create_array (enum create_type create_choice, enum rand_type rand_choice) {
 }
 
 typedef struct {
-    u_int32_t first_zero;
-    u_int32_t first_pos;
+    uint32_t first_zero;
+    uint32_t first_pos;
 } h_extra;
 
 
@@ -623,24 +623,24 @@ test_heaviside (OMTVALUE v_omt, void* x) {
     assert(v && x);
     assert(extra->first_zero <= extra->first_pos);
 
-    u_int32_t value = V(v)->number;
+    uint32_t value = V(v)->number;
     if (value < extra->first_zero) return -1;
     if (value < extra->first_pos) return 0;
     return 1;
 }
 
 static void
-heavy_extra (h_extra* extra, u_int32_t first_zero, u_int32_t first_pos) {
+heavy_extra (h_extra* extra, uint32_t first_zero, uint32_t first_pos) {
     extra->first_zero = first_zero;
     extra->first_pos  = first_pos;
 }
 
 static void
 test_find_dir (int dir, void* extra, int (*h)(OMTVALUE, void*),
-	       int r_expect, BOOL idx_will_change, u_int32_t idx_expect,
-	       u_int32_t number_expect, BOOL UU(cursor_valid)) {
-    u_int32_t idx     = UINT32_MAX;
-    u_int32_t old_idx = idx;
+	       int r_expect, bool idx_will_change, uint32_t idx_expect,
+	       uint32_t number_expect, bool UU(cursor_valid)) {
+    uint32_t idx     = UINT32_MAX;
+    uint32_t old_idx = idx;
     TESTVALUE omt_val;
     int r;
 
@@ -707,9 +707,9 @@ test_find (enum create_type create_choice, enum close_when_done do_close) {
         A
 */
     heavy_extra(&extra, length, length);
-    test_find_dir(-1, &extra, test_heaviside, 0,           TRUE,  length-1, length-1, TRUE);
-    test_find_dir(+1, &extra, test_heaviside, DB_NOTFOUND, FALSE, 0,        0,        FALSE);
-    test_find_dir(0,  &extra, test_heaviside, DB_NOTFOUND, TRUE,  length,   length,   FALSE);
+    test_find_dir(-1, &extra, test_heaviside, 0,           true,  length-1, length-1, true);
+    test_find_dir(+1, &extra, test_heaviside, DB_NOTFOUND, false, 0,        0,        false);
+    test_find_dir(0,  &extra, test_heaviside, DB_NOTFOUND, true,  length,   length,   false);
 
 
 /*
@@ -717,54 +717,54 @@ test_find (enum create_type create_choice, enum close_when_done do_close) {
     B
 */
     heavy_extra(&extra, 0, 0);
-    test_find_dir(-1, &extra, test_heaviside, DB_NOTFOUND, FALSE, 0, 0, FALSE);
-    test_find_dir(+1, &extra, test_heaviside, 0,           TRUE,  0, 0, TRUE);
-    test_find_dir(0,  &extra, test_heaviside, DB_NOTFOUND, TRUE,  0, 0, FALSE);
+    test_find_dir(-1, &extra, test_heaviside, DB_NOTFOUND, false, 0, 0, false);
+    test_find_dir(+1, &extra, test_heaviside, 0,           true,  0, 0, true);
+    test_find_dir(0,  &extra, test_heaviside, DB_NOTFOUND, true,  0, 0, false);
 
 /*
     0...0
     C
 */
     heavy_extra(&extra, 0, length);
-    test_find_dir(-1, &extra, test_heaviside, DB_NOTFOUND, FALSE, 0, 0, FALSE);
-    test_find_dir(+1, &extra, test_heaviside, DB_NOTFOUND, FALSE, 0, 0, FALSE);
-    test_find_dir(0,  &extra, test_heaviside, 0,           TRUE,  0, 0, TRUE);
+    test_find_dir(-1, &extra, test_heaviside, DB_NOTFOUND, false, 0, 0, false);
+    test_find_dir(+1, &extra, test_heaviside, DB_NOTFOUND, false, 0, 0, false);
+    test_find_dir(0,  &extra, test_heaviside, 0,           true,  0, 0, true);
 
 /*
     -...-0...0
         AC
 */
     heavy_extra(&extra, length/2, length);
-    test_find_dir(-1, &extra, test_heaviside, 0,           TRUE,  length/2-1, length/2-1, TRUE);
-    test_find_dir(+1, &extra, test_heaviside, DB_NOTFOUND, FALSE, 0,          0,          FALSE);
-    test_find_dir(0,  &extra, test_heaviside, 0,           TRUE,  length/2,   length/2,   TRUE);
+    test_find_dir(-1, &extra, test_heaviside, 0,           true,  length/2-1, length/2-1, true);
+    test_find_dir(+1, &extra, test_heaviside, DB_NOTFOUND, false, 0,          0,          false);
+    test_find_dir(0,  &extra, test_heaviside, 0,           true,  length/2,   length/2,   true);
 
 /*
     0...0+...+
     C    B
 */
     heavy_extra(&extra, 0, length/2);
-    test_find_dir(-1, &extra, test_heaviside, DB_NOTFOUND, FALSE, 0,        0,        FALSE);
-    test_find_dir(+1, &extra, test_heaviside, 0,           TRUE,  length/2, length/2, TRUE);
-    test_find_dir(0,  &extra, test_heaviside, 0,           TRUE,  0,        0,        TRUE);
+    test_find_dir(-1, &extra, test_heaviside, DB_NOTFOUND, false, 0,        0,        false);
+    test_find_dir(+1, &extra, test_heaviside, 0,           true,  length/2, length/2, true);
+    test_find_dir(0,  &extra, test_heaviside, 0,           true,  0,        0,        true);
 
 /*
     -...-+...+
         AB
 */
     heavy_extra(&extra, length/2, length/2);
-    test_find_dir(-1, &extra, test_heaviside, 0,           TRUE, length/2-1, length/2-1, TRUE);
-    test_find_dir(+1, &extra, test_heaviside, 0,           TRUE, length/2,   length/2,   TRUE);
-    test_find_dir(0,  &extra, test_heaviside, DB_NOTFOUND, TRUE, length/2,   length/2,   FALSE);
+    test_find_dir(-1, &extra, test_heaviside, 0,           true, length/2-1, length/2-1, true);
+    test_find_dir(+1, &extra, test_heaviside, 0,           true, length/2,   length/2,   true);
+    test_find_dir(0,  &extra, test_heaviside, DB_NOTFOUND, true, length/2,   length/2,   false);
 
 /*
     -...-0...0+...+
         AC    B
 */    
     heavy_extra(&extra, length/3, 2*length/3);
-    test_find_dir(-1, &extra, test_heaviside, 0, TRUE,   length/3-1,   length/3-1, TRUE);
-    test_find_dir(+1, &extra, test_heaviside, 0, TRUE, 2*length/3,   2*length/3,   TRUE);
-    test_find_dir(0,  &extra, test_heaviside, 0, TRUE,   length/3,     length/3,   TRUE);
+    test_find_dir(-1, &extra, test_heaviside, 0, true,   length/3-1,   length/3-1, true);
+    test_find_dir(+1, &extra, test_heaviside, 0, true, 2*length/3,   2*length/3,   true);
+    test_find_dir(0,  &extra, test_heaviside, 0, true,   length/3,     length/3,   true);
 
     /* Cleanup */
     test_close(do_close);
@@ -779,7 +779,7 @@ runtests_create_choice (enum create_type create_choice) {
 }
 
 static void
-test_clone(u_int32_t nelts)
+test_clone(uint32_t nelts)
 // Test that each clone operation gives the right data back.  If nelts is
 // zero, also tests that you still get a valid OMT back and that the way
 // to deallocate it still works.
diff --git a/ft/tests/orthopush-flush.cc b/ft/tests/orthopush-flush.cc
index 96a45bb32eb2a92c1c0353e6e759578891af93cd..e05c6a52d996bfaf05c4403a9e4e5b8231e09e50 100644
--- a/ft/tests/orthopush-flush.cc
+++ b/ft/tests/orthopush-flush.cc
@@ -545,7 +545,7 @@ flush_to_leaf(FT_HANDLE t, bool make_leaf_up_to_date, bool use_flush) {
         insert_random_message_to_bn(t, child_blbs[i%8], &child_messages[i], xids_123, i%8);
         total_size += child_blbs[i%8]->n_bytes_in_buffer;
         if (i % 8 < 7) {
-            u_int32_t keylen;
+            uint32_t keylen;
             char *CAST_FROM_VOIDP(key, le_key_and_len(child_messages[i], &keylen));
             DBT keydbt;
             if (childkeys[i%8].size == 0 || dummy_cmp(NULL, toku_fill_dbt(&keydbt, key, keylen), &childkeys[i%8]) > 0) {
@@ -556,7 +556,7 @@ flush_to_leaf(FT_HANDLE t, bool make_leaf_up_to_date, bool use_flush) {
     int num_child_messages = i;
 
     for (i = 0; i < num_child_messages; ++i) {
-        u_int32_t keylen;
+        uint32_t keylen;
         char *CAST_FROM_VOIDP(key, le_key_and_len(child_messages[i], &keylen));
         DBT keydbt;
         if (i % 8 < 7) {
@@ -615,7 +615,7 @@ flush_to_leaf(FT_HANDLE t, bool make_leaf_up_to_date, bool use_flush) {
         parentnode->max_msn_applied_to_node_on_disk = max_parent_msn;
         struct ancestors ancestors = { .node = parentnode, .childnum = 0, .next = NULL };
         const struct pivot_bounds infinite_bounds = { .lower_bound_exclusive = NULL, .upper_bound_inclusive = NULL };
-        BOOL msgs_applied;
+        bool msgs_applied;
         maybe_apply_ancestors_messages_to_node(t, child, &ancestors, &infinite_bounds, &msgs_applied);
 
         FIFO_ITERATE(parent_bnc->buffer, key, keylen, val, vallen, type, msn, xids, is_fresh,
@@ -645,8 +645,8 @@ flush_to_leaf(FT_HANDLE t, bool make_leaf_up_to_date, bool use_flush) {
     memset(child_messages_present, 0, sizeof child_messages_present);
     for (int j = 0; j < 8; ++j) {
         OMT omt = BLB_BUFFER(child, j);
-        u_int32_t len = toku_omt_size(omt);
-        for (u_int32_t idx = 0; idx < len; ++idx) {
+        uint32_t len = toku_omt_size(omt);
+        for (uint32_t idx = 0; idx < len; ++idx) {
             LEAFENTRY le;
             DBT keydbt, valdbt;
             {
@@ -654,7 +654,7 @@ flush_to_leaf(FT_HANDLE t, bool make_leaf_up_to_date, bool use_flush) {
                 r = toku_omt_fetch(omt, idx, &v);
                 assert_zero(r);
                 CAST_FROM_VOIDP(le, v);
-                u_int32_t keylen, vallen;
+                uint32_t keylen, vallen;
                 void *keyp = le_key_and_len(le, &keylen);
                 void *valp = le_latest_val_and_len(le, &vallen);
                 toku_fill_dbt(&keydbt, keyp, keylen);
@@ -676,7 +676,7 @@ flush_to_leaf(FT_HANDLE t, bool make_leaf_up_to_date, bool use_flush) {
                 if (i >= num_child_messages) { continue; }
                 DBT childkeydbt, childvaldbt;
                 {
-                    u_int32_t keylen, vallen;
+                    uint32_t keylen, vallen;
                     void *keyp = le_key_and_len(child_messages[i], &keylen);
                     void *valp = le_latest_val_and_len(child_messages[i], &vallen);
                     toku_fill_dbt(&childkeydbt, keyp, keylen);
@@ -770,7 +770,7 @@ flush_to_leaf_with_keyrange(FT_HANDLE t, bool make_leaf_up_to_date) {
         total_size -= child_blbs[i%8]->n_bytes_in_buffer;
         insert_random_message_to_bn(t, child_blbs[i%8], &child_messages[i], xids_123, i%8);
         total_size += child_blbs[i%8]->n_bytes_in_buffer;
-        u_int32_t keylen;
+        uint32_t keylen;
         char *CAST_FROM_VOIDP(key, le_key_and_len(child_messages[i], &keylen));
         DBT keydbt;
         if (childkeys[i%8].size == 0 || dummy_cmp(NULL, toku_fill_dbt(&keydbt, key, keylen), &childkeys[i%8]) > 0) {
@@ -780,7 +780,7 @@ flush_to_leaf_with_keyrange(FT_HANDLE t, bool make_leaf_up_to_date) {
     int num_child_messages = i;
 
     for (i = 0; i < num_child_messages; ++i) {
-        u_int32_t keylen;
+        uint32_t keylen;
         char *CAST_FROM_VOIDP(key, le_key_and_len(child_messages[i], &keylen));
         DBT keydbt;
         assert(dummy_cmp(NULL, toku_fill_dbt(&keydbt, key, keylen), &childkeys[i%8]) <= 0);
@@ -840,7 +840,7 @@ flush_to_leaf_with_keyrange(FT_HANDLE t, bool make_leaf_up_to_date) {
         .lower_bound_exclusive = toku_init_dbt(&lbe),
         .upper_bound_inclusive = toku_clone_dbt(&ubi, childkeys[7])
     };
-    BOOL msgs_applied;
+    bool msgs_applied;
     maybe_apply_ancestors_messages_to_node(t, child, &ancestors, &bounds, &msgs_applied);
 
     FIFO_ITERATE(parent_bnc->buffer, key, keylen, val, vallen, type, msn, xids, is_fresh,
@@ -957,7 +957,7 @@ compare_apply_and_flush(FT_HANDLE t, bool make_leaf_up_to_date) {
         insert_same_message_to_bns(t, child1_blbs[i%8], child2_blbs[i%8], &child_messages[i], xids_123, i%8);
         total_size += child1_blbs[i%8]->n_bytes_in_buffer;
         if (i % 8 < 7) {
-            u_int32_t keylen;
+            uint32_t keylen;
             char *CAST_FROM_VOIDP(key, le_key_and_len(child_messages[i], &keylen));
             DBT keydbt;
             if (child1keys[i%8].size == 0 || dummy_cmp(NULL, toku_fill_dbt(&keydbt, key, keylen), &child1keys[i%8]) > 0) {
@@ -969,7 +969,7 @@ compare_apply_and_flush(FT_HANDLE t, bool make_leaf_up_to_date) {
     int num_child_messages = i;
 
     for (i = 0; i < num_child_messages; ++i) {
-        u_int32_t keylen;
+        uint32_t keylen;
         char *CAST_FROM_VOIDP(key, le_key_and_len(child_messages[i], &keylen));
         DBT keydbt;
         if (i % 8 < 7) {
@@ -1023,7 +1023,7 @@ compare_apply_and_flush(FT_HANDLE t, bool make_leaf_up_to_date) {
     parentnode->max_msn_applied_to_node_on_disk = max_parent_msn;
     struct ancestors ancestors = { .node = parentnode, .childnum = 0, .next = NULL };
     const struct pivot_bounds infinite_bounds = { .lower_bound_exclusive = NULL, .upper_bound_inclusive = NULL };
-    BOOL msgs_applied;
+    bool msgs_applied;
     maybe_apply_ancestors_messages_to_node(t, child2, &ancestors, &infinite_bounds, &msgs_applied);
 
     FIFO_ITERATE(parent_bnc->buffer, key, keylen, val, vallen, type, msn, xids, is_fresh,
@@ -1039,9 +1039,9 @@ compare_apply_and_flush(FT_HANDLE t, bool make_leaf_up_to_date) {
     for (int j = 0; j < 8; ++j) {
         OMT omt1 = BLB_BUFFER(child1, j);
         OMT omt2 = BLB_BUFFER(child2, j);
-        u_int32_t len = toku_omt_size(omt1);
+        uint32_t len = toku_omt_size(omt1);
         assert(len == toku_omt_size(omt2));
-        for (u_int32_t idx = 0; idx < len; ++idx) {
+        for (uint32_t idx = 0; idx < len; ++idx) {
             LEAFENTRY le1, le2;
             DBT key1dbt, val1dbt, key2dbt, val2dbt;
             {
@@ -1049,7 +1049,7 @@ compare_apply_and_flush(FT_HANDLE t, bool make_leaf_up_to_date) {
                 r = toku_omt_fetch(omt1, idx, &v);
                 assert_zero(r);
                 CAST_FROM_VOIDP(le1, v);
-                u_int32_t keylen, vallen;
+                uint32_t keylen, vallen;
                 void *keyp = le_key_and_len(le1, &keylen);
                 void *valp = le_latest_val_and_len(le1, &vallen);
                 toku_fill_dbt(&key1dbt, keyp, keylen);
@@ -1060,7 +1060,7 @@ compare_apply_and_flush(FT_HANDLE t, bool make_leaf_up_to_date) {
                 r = toku_omt_fetch(omt2, idx, &v);
                 assert_zero(r);
                 CAST_FROM_VOIDP(le2, v);
-                u_int32_t keylen, vallen;
+                uint32_t keylen, vallen;
                 void *keyp = le_key_and_len(le2, &keylen);
                 void *valp = le_latest_val_and_len(le2, &vallen);
                 toku_fill_dbt(&key2dbt, keyp, keylen);
diff --git a/ft/tests/pqueue-test.cc b/ft/tests/pqueue-test.cc
index 68e608452c5bdbaae0177dc9532e87e1bbfa1395..a424e85cec703573c22f9fc93d6289b6773af769 100644
--- a/ft/tests/pqueue-test.cc
+++ b/ft/tests/pqueue-test.cc
@@ -21,7 +21,7 @@ static int test_compare(DB * UU(db), const DBT *dbta, const DBT *dbtb)
     return 0;
 }
 
-static inline DBT *dbt_init(DBT *dbt, void *data, u_int32_t size) {
+static inline DBT *dbt_init(DBT *dbt, void *data, uint32_t size) {
     memset(dbt, 0, sizeof *dbt);
     dbt->data = data;
     dbt->size = size;
diff --git a/ft/tests/queue-test.cc b/ft/tests/queue-test.cc
index d9d58f66d15730e4ac1d5587e41010fb397d13ea..29bfa75305b2c58586533a6872ded8a43394b77e 100644
--- a/ft/tests/queue-test.cc
+++ b/ft/tests/queue-test.cc
@@ -14,15 +14,15 @@
 static int verbose=1;
 
 static int count_0 = 0;
-static u_int64_t e_max_weight=0, d_max_weight = 0; // max weight seen by enqueue thread and dequeue thread respectively.
+static uint64_t e_max_weight=0, d_max_weight = 0; // max weight seen by enqueue thread and dequeue thread respectively.
 
 static void *start_0 (void *arg) {
     QUEUE q = (QUEUE)arg;
     void *item;
-    u_int64_t weight;
+    uint64_t weight;
     long count = 0;
     while (1) {
-	u_int64_t this_max_weight;
+	uint64_t this_max_weight;
 	int r=queue_deq(q, &item, &weight, &this_max_weight);
 	if (r==EOF) break;
 	assert(r==0);
@@ -36,15 +36,15 @@ static void *start_0 (void *arg) {
     return NULL;
 }
 
-static void enq (QUEUE q, long v, u_int64_t weight) {
-    u_int64_t this_max_weight;
+static void enq (QUEUE q, long v, uint64_t weight) {
+    uint64_t this_max_weight;
     int r = queue_enq(q, (void*)v, (weight==0)?0:1, &this_max_weight);
     assert(r==0);
     if (this_max_weight>e_max_weight) e_max_weight=this_max_weight;
     //printf("E(%ld)=%ld %ld\n", v, this_max_weight, e_max_weight);
 }
 
-static void queue_test_0 (u_int64_t weight)
+static void queue_test_0 (uint64_t weight)
 // Test a queue that can hold WEIGHT items.
 {
     //printf("\n");
diff --git a/ft/tests/recovery-bad-last-entry.cc b/ft/tests/recovery-bad-last-entry.cc
index b9bdf615e254c7823dad15adc456100de88279cc..7b90c1282763926e8eeeb6cb91490979426b8c33 100644
--- a/ft/tests/recovery-bad-last-entry.cc
+++ b/ft/tests/recovery-bad-last-entry.cc
@@ -37,14 +37,14 @@ run_test(void) {
         r = toku_logger_open(TESTDIR, logger); assert(r == 0);
         LSN beginlsn;
         // all logs must contain a valid checkpoint
-        r = toku_log_begin_checkpoint(logger, &beginlsn, TRUE, 0, 0); assert(r == 0);
-        r = toku_log_end_checkpoint(logger, NULL, TRUE, beginlsn, 0, 0, 0); assert(r == 0);
-        r = toku_log_comment(logger, NULL, TRUE, 0, hello); assert(r == 0);
-        r = toku_log_comment(logger, NULL, TRUE, 0, world); assert(r == 0);
-        r = toku_log_begin_checkpoint(logger, &beginlsn, TRUE, 0, 0); assert(r == 0);
-        r = toku_log_end_checkpoint(logger, NULL, TRUE, beginlsn, 0, 0, 0); assert(r == 0);
-        r = toku_log_comment(logger, NULL, TRUE, 0, hello); assert(r == 0);
-        r = toku_log_comment(logger, NULL, TRUE, 0, there); assert(r == 0);
+        r = toku_log_begin_checkpoint(logger, &beginlsn, true, 0, 0); assert(r == 0);
+        r = toku_log_end_checkpoint(logger, NULL, true, beginlsn, 0, 0, 0); assert(r == 0);
+        r = toku_log_comment(logger, NULL, true, 0, hello); assert(r == 0);
+        r = toku_log_comment(logger, NULL, true, 0, world); assert(r == 0);
+        r = toku_log_begin_checkpoint(logger, &beginlsn, true, 0, 0); assert(r == 0);
+        r = toku_log_end_checkpoint(logger, NULL, true, beginlsn, 0, 0, 0); assert(r == 0);
+        r = toku_log_comment(logger, NULL, true, 0, hello); assert(r == 0);
+        r = toku_log_comment(logger, NULL, true, 0, there); assert(r == 0);
         r = toku_logger_close(&logger); assert(r == 0);
 
         // redirect stderr
diff --git a/ft/tests/recovery-cbegin-cend-hello.cc b/ft/tests/recovery-cbegin-cend-hello.cc
index 9ea65985c5de4c353b48328b819f6e99ebeb0e95..069335afe79e02bc059978d0fe9e175a829b1a0d 100644
--- a/ft/tests/recovery-cbegin-cend-hello.cc
+++ b/ft/tests/recovery-cbegin-cend-hello.cc
@@ -26,8 +26,8 @@ run_test(void) {
     
     // add begin checkpoint, end checkpoint
     LSN beginlsn;
-    r = toku_log_begin_checkpoint(logger, &beginlsn, FALSE, 0, 0); assert(r == 0);
-    r = toku_log_end_checkpoint(logger, NULL, TRUE, beginlsn, 0, 0, 0); assert(r == 0);
+    r = toku_log_begin_checkpoint(logger, &beginlsn, false, 0, 0); assert(r == 0);
+    r = toku_log_end_checkpoint(logger, NULL, true, beginlsn, 0, 0, 0); assert(r == 0);
     r = toku_logger_close(&logger); assert(r == 0);
 
     // add hello
@@ -35,7 +35,7 @@ run_test(void) {
         r = toku_logger_create(&logger); assert(r == 0);
         r = toku_logger_open(TESTDIR, logger); assert(r == 0);
         BYTESTRING hello  = { (uint32_t) strlen("hello"), (char *) "hello" };
-        r = toku_log_comment(logger, NULL, TRUE, 0, hello);
+        r = toku_log_comment(logger, NULL, true, 0, hello);
         r = toku_logger_close(&logger); assert(r == 0);
     }
 
diff --git a/ft/tests/recovery-cbegin-cend.cc b/ft/tests/recovery-cbegin-cend.cc
index 464012d4ae7cea67131ff17b115006d624e0da83..0aaa47d115d32ac958ed2d6138cbf90a43f9e78b 100644
--- a/ft/tests/recovery-cbegin-cend.cc
+++ b/ft/tests/recovery-cbegin-cend.cc
@@ -22,12 +22,12 @@ run_test(void) {
     r = toku_logger_create(&logger); assert(r == 0);
     r = toku_logger_open(TESTDIR, logger); assert(r == 0);
     LSN beginlsn;
-    r = toku_log_begin_checkpoint(logger, &beginlsn, FALSE, 0, 0); assert(r == 0);
+    r = toku_log_begin_checkpoint(logger, &beginlsn, false, 0, 0); assert(r == 0);
     r = toku_logger_close(&logger); assert(r == 0);
 
     r = toku_logger_create(&logger); assert(r == 0);
     r = toku_logger_open(TESTDIR, logger); assert(r == 0);
-    r = toku_log_end_checkpoint(logger, NULL, TRUE, beginlsn, 0, 0, 0); assert(r == 0);
+    r = toku_log_end_checkpoint(logger, NULL, true, beginlsn, 0, 0, 0); assert(r == 0);
     r = toku_logger_close(&logger); assert(r == 0);
 
     // run recovery
diff --git a/ft/tests/recovery-cbegin.cc b/ft/tests/recovery-cbegin.cc
index 45e688907ffc251200e9aa9438a025c6e1da6dac..dc6a9c0a4881f704a5f90efb395d98ad42502b7b 100644
--- a/ft/tests/recovery-cbegin.cc
+++ b/ft/tests/recovery-cbegin.cc
@@ -22,9 +22,9 @@ run_test(void) {
     r = toku_logger_create(&logger); assert(r == 0);
     r = toku_logger_open(TESTDIR, logger); assert(r == 0);
     LSN beginlsn;
-    r = toku_log_begin_checkpoint(logger, &beginlsn, TRUE, 0, 0); assert(r == 0);
-    r = toku_log_end_checkpoint(logger, NULL, TRUE, beginlsn, 0, 0, 0); assert(r == 0);
-    r = toku_log_begin_checkpoint(logger, &beginlsn, TRUE, 0, 0); assert(r == 0);
+    r = toku_log_begin_checkpoint(logger, &beginlsn, true, 0, 0); assert(r == 0);
+    r = toku_log_end_checkpoint(logger, NULL, true, beginlsn, 0, 0, 0); assert(r == 0);
+    r = toku_log_begin_checkpoint(logger, &beginlsn, true, 0, 0); assert(r == 0);
     r = toku_logger_close(&logger); assert(r == 0);
 
     // run recovery
diff --git a/ft/tests/recovery-cend-cbegin.cc b/ft/tests/recovery-cend-cbegin.cc
index 93105b4b216c9ecd147a1bd45d19b3edcc3f3737..a80ef7b9586c058cf4733cc81ab8d26d626d625f 100644
--- a/ft/tests/recovery-cend-cbegin.cc
+++ b/ft/tests/recovery-cend-cbegin.cc
@@ -24,10 +24,10 @@ run_test(void) {
     r = toku_logger_create(&logger); assert(r == 0);
     r = toku_logger_open(TESTDIR, logger); assert(r == 0);
     LSN firstbegin = ZERO_LSN;
-    r = toku_log_begin_checkpoint(logger, &firstbegin, TRUE, 0, 0); assert(r == 0);
+    r = toku_log_begin_checkpoint(logger, &firstbegin, true, 0, 0); assert(r == 0);
     assert(firstbegin.lsn != ZERO_LSN.lsn);
-    r = toku_log_end_checkpoint(logger, NULL, FALSE, firstbegin, 0, 0, 0); assert(r == 0);
-    r = toku_log_begin_checkpoint(logger, NULL, TRUE, 0, 0); assert(r == 0);
+    r = toku_log_end_checkpoint(logger, NULL, false, firstbegin, 0, 0, 0); assert(r == 0);
+    r = toku_log_begin_checkpoint(logger, NULL, true, 0, 0); assert(r == 0);
     r = toku_logger_close(&logger); assert(r == 0);
 
     if (!verbose) {
diff --git a/ft/tests/recovery-datadir-is-file.cc b/ft/tests/recovery-datadir-is-file.cc
index c800589e5f77c9c6eca2ece0785e42e2b3485b0f..1d47b21258a44e5477829577d33c0f8e15754c40 100644
--- a/ft/tests/recovery-datadir-is-file.cc
+++ b/ft/tests/recovery-datadir-is-file.cc
@@ -25,7 +25,7 @@ run_test(void) {
     r = toku_logger_create(&logger); assert(r == 0);
     r = toku_logger_open(TESTDIR, logger); assert(r == 0);
     BYTESTRING hello  = { (uint32_t) strlen("hello"), (char *) "hello" };
-    r = toku_log_comment(logger, NULL, TRUE, 0, hello);
+    r = toku_log_comment(logger, NULL, true, 0, hello);
     r = toku_logger_close(&logger); assert(r == 0);
 
     // redirect stderr
diff --git a/ft/tests/recovery-fopen-missing-file.cc b/ft/tests/recovery-fopen-missing-file.cc
index 79e7749bf9ad3972dbef601066d136b9cf14cedf..077a9a0795734349e19091a5397a3c76a7b1a189 100644
--- a/ft/tests/recovery-fopen-missing-file.cc
+++ b/ft/tests/recovery-fopen-missing-file.cc
@@ -24,13 +24,13 @@ run_test(void) {
     r = toku_logger_create(&logger); assert(r == 0);
     r = toku_logger_open(TESTDIR, logger); assert(r == 0);
     LSN beginlsn;
-    r = toku_log_begin_checkpoint(logger, &beginlsn, TRUE, 0, 0); assert(r == 0);
-    r = toku_log_end_checkpoint(logger, NULL, TRUE, beginlsn, 0, 0, 0); assert(r == 0);
+    r = toku_log_begin_checkpoint(logger, &beginlsn, true, 0, 0); assert(r == 0);
+    r = toku_log_end_checkpoint(logger, NULL, true, beginlsn, 0, 0, 0); assert(r == 0);
 
     BYTESTRING iname  = { (uint32_t) strlen("missing_tokudb_file"), (char *) "missing_tokudb_file" };
     FILENUM filenum = {42};
     uint32_t treeflags = 0;
-    r = toku_log_fopen(logger, NULL, TRUE, iname, filenum, treeflags);
+    r = toku_log_fopen(logger, NULL, true, iname, filenum, treeflags);
     r = toku_logger_close(&logger); assert(r == 0);
 
     // redirect stderr
diff --git a/ft/tests/recovery-hello.cc b/ft/tests/recovery-hello.cc
index e2380c4e45f58a6d70609343f16b471b2c2980b1..749a586d7d7dbf2ddb1580be5194bb689738d2a8 100644
--- a/ft/tests/recovery-hello.cc
+++ b/ft/tests/recovery-hello.cc
@@ -24,13 +24,13 @@ run_test(void) {
     r = toku_logger_create(&logger); assert(r == 0);
     r = toku_logger_open(TESTDIR, logger); assert(r == 0);
     BYTESTRING hello  = { (uint32_t) strlen("hello"), (char *) "hello" };
-    r = toku_log_comment(logger, NULL, TRUE, 0, hello); assert(r == 0);
+    r = toku_log_comment(logger, NULL, true, 0, hello); assert(r == 0);
     LSN beginlsn;
-    r = toku_log_begin_checkpoint(logger, &beginlsn, TRUE, 0, 0); assert(r == 0);
-    r = toku_log_end_checkpoint(logger, NULL, TRUE, beginlsn, 0, 0, 0); assert(r == 0);
-    r = toku_log_comment(logger, NULL, TRUE, 0, hello); assert(r == 0);
+    r = toku_log_begin_checkpoint(logger, &beginlsn, true, 0, 0); assert(r == 0);
+    r = toku_log_end_checkpoint(logger, NULL, true, beginlsn, 0, 0, 0); assert(r == 0);
+    r = toku_log_comment(logger, NULL, true, 0, hello); assert(r == 0);
     BYTESTRING there  = { (uint32_t) strlen("there"), (char *) "there" };
-    r = toku_log_comment(logger, NULL, TRUE, 0, there); assert(r == 0);
+    r = toku_log_comment(logger, NULL, true, 0, there); assert(r == 0);
     r = toku_logger_close(&logger); assert(r == 0);
 
     // redirect stderr
diff --git a/ft/tests/recovery-lsn-error-during-forward-scan.cc b/ft/tests/recovery-lsn-error-during-forward-scan.cc
index a254823786f16b4922620a4903d138cdfb72bc8b..a73b086e967e6aec52702e5c6e670199edcfaf40 100644
--- a/ft/tests/recovery-lsn-error-during-forward-scan.cc
+++ b/ft/tests/recovery-lsn-error-during-forward-scan.cc
@@ -43,8 +43,8 @@ run_test(void) {
     r = toku_logger_open(TESTDIR, logger); assert(r == 0);
 
     LSN beginlsn;
-    r = toku_log_begin_checkpoint(logger, &beginlsn, TRUE, 0, 0); assert(r == 0);
-    r = toku_log_end_checkpoint(logger, NULL, TRUE, beginlsn, 0, 0, 0); assert(r == 0);
+    r = toku_log_begin_checkpoint(logger, &beginlsn, true, 0, 0); assert(r == 0);
+    r = toku_log_end_checkpoint(logger, NULL, true, beginlsn, 0, 0, 0); assert(r == 0);
 
     r = toku_logger_close(&logger); assert(r == 0);
 
@@ -53,7 +53,7 @@ run_test(void) {
     r = toku_logger_open(TESTDIR, logger); assert(r == 0);
 
     BYTESTRING hello  = { (uint32_t) strlen("hello"), (char *) "hello" };
-    r = toku_log_comment(logger, NULL, TRUE, 0, hello); assert(r == 0);
+    r = toku_log_comment(logger, NULL, true, 0, hello); assert(r == 0);
 
     r = toku_logger_close(&logger); assert(r == 0);
 
@@ -62,7 +62,7 @@ run_test(void) {
     r = toku_logger_open(TESTDIR, logger); assert(r == 0);
 
     BYTESTRING there  = { (uint32_t) strlen("there"), (char *) "there" };
-    r = toku_log_comment(logger, NULL, TRUE, 0, there); assert(r == 0);
+    r = toku_log_comment(logger, NULL, true, 0, there); assert(r == 0);
 
     r = toku_logger_close(&logger); assert(r == 0);
 
diff --git a/ft/tests/recovery-no-datadir.cc b/ft/tests/recovery-no-datadir.cc
index a69b9c01d6dd93d6daa9a514c3d84243ad18428a..0e57a7873377c603ef3ffdfa7d04e72d1afef663 100644
--- a/ft/tests/recovery-no-datadir.cc
+++ b/ft/tests/recovery-no-datadir.cc
@@ -24,7 +24,7 @@ run_test(void) {
     r = toku_logger_create(&logger); assert(r == 0);
     r = toku_logger_open(TESTDIR, logger); assert(r == 0);
     BYTESTRING hello  = { (uint32_t) strlen("hello"), (char *) "hello" };
-    r = toku_log_comment(logger, NULL, TRUE, 0, hello);
+    r = toku_log_comment(logger, NULL, true, 0, hello);
     r = toku_logger_close(&logger); assert(r == 0);
 
     // redirect stderr
diff --git a/ft/tests/shortcut.cc b/ft/tests/shortcut.cc
index bca7266bdb8fb7c880618bcefdcd7460354919c1..6f39aecb3c96139cfaefa2906376fe92abbca5e0 100644
--- a/ft/tests/shortcut.cc
+++ b/ft/tests/shortcut.cc
@@ -25,7 +25,7 @@ test_main (int argc __attribute__((__unused__)), const char *argv[]  __attribute
 
     r = toku_create_cachetable(&ct, 0, ZERO_LSN, NULL_LOGGER);                               assert(r==0);
     r = toku_open_ft_handle(fname, 1, &brt, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);   assert(r==0);
-    r = toku_ft_cursor(brt, &cursor, NULL, FALSE, FALSE);               assert(r==0);
+    r = toku_ft_cursor(brt, &cursor, NULL, false, false);               assert(r==0);
 
     int i;
     for (i=0; i<1000; i++) {
diff --git a/ft/tests/test-assert.cc b/ft/tests/test-assert.cc
index ece234b012d9d0482e76f63aa0a510f896e844e3..55ddf9cfc79513e3435fdbb945adf4efd215bdb5 100644
--- a/ft/tests/test-assert.cc
+++ b/ft/tests/test-assert.cc
@@ -12,8 +12,8 @@ static __attribute__((__noreturn__)) void catch_abort (int sig __attribute__((__
     exit(1);
 }
 
-static BOOL foo (void) {
-    return TRUE;
+static bool foo (void) {
+    return true;
 }
     
 
diff --git a/ft/tests/test-checkpoint-during-flush.cc b/ft/tests/test-checkpoint-during-flush.cc
index d0d5afa85e31cb649ab09c14e263d03c4a64581a..f274db95e29dd4554195d4d1a68011ea8f126ad4 100644
--- a/ft/tests/test-checkpoint-during-flush.cc
+++ b/ft/tests/test-checkpoint-during-flush.cc
@@ -21,8 +21,8 @@ enum { NODESIZE = 1024, KSIZE=NODESIZE-100, TOKU_PSIZE=20 };
 CACHETABLE ct;
 FT_HANDLE t;
 
-BOOL checkpoint_called;
-BOOL checkpoint_callback_called;
+bool checkpoint_called;
+bool checkpoint_callback_called;
 toku_pthread_t checkpoint_tid;
 
 
@@ -39,11 +39,11 @@ static void merge_should_not_happen(struct flusher_advice* UU(fa),
                               FTNODE UU(child),
                               void* UU(extra))
 {
-    assert(FALSE);
+    assert(false);
 }
 
 static bool recursively_flush_should_not_happen(FTNODE UU(child), void* UU(extra)) {
-    assert(FALSE);
+    assert(false);
 }
 
 static int child_to_flush(FT UU(h), FTNODE parent, void* UU(extra)) {
@@ -58,7 +58,7 @@ static void dummy_update_status(FTNODE UU(child), int UU(dirtied), void* UU(extr
 
 static void checkpoint_callback(void* UU(extra)) {
     usleep(1*1024*1024);
-    checkpoint_callback_called = TRUE;
+    checkpoint_callback_called = true;
 }
 
 
@@ -73,13 +73,13 @@ static void *do_checkpoint(void *arg) {
 
 
 static void flusher_callback(int state, void* extra) {
-    BOOL after_child_pin = *(BOOL *)extra;
+    bool after_child_pin = *(bool *)extra;
     if (verbose) {
         printf("state %d\n", state);
     }
     if ((state == flt_flush_before_child_pin && !after_child_pin) ||
         (state == ft_flush_aflter_child_pin && after_child_pin)) {
-        checkpoint_called = TRUE;
+        checkpoint_called = true;
         int r = toku_pthread_create(&checkpoint_tid, NULL, do_checkpoint, NULL); 
         assert_zero(r);
         while (!checkpoint_callback_called) {
@@ -89,12 +89,12 @@ static void flusher_callback(int state, void* extra) {
 }
 
 static void
-doit (BOOL after_child_pin) {
+doit (bool after_child_pin) {
     BLOCKNUM node_leaf, node_root;
 
     int r;
-    checkpoint_called = FALSE;
-    checkpoint_callback_called = FALSE;
+    checkpoint_called = false;
+    checkpoint_callback_called = false;
 
     toku_flusher_thread_set_callback(flusher_callback, &after_child_pin);
     
@@ -149,7 +149,7 @@ doit (BOOL after_child_pin) {
         node_root,
         toku_cachetable_hash(t->ft->cf, node_root),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -168,7 +168,7 @@ doit (BOOL after_child_pin) {
         node_root,
         toku_cachetable_hash(t->ft->cf, node_root),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -205,7 +205,7 @@ doit (BOOL after_child_pin) {
         node_root,
         toku_cachetable_hash(c_ft->ft->cf, node_root),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -226,7 +226,7 @@ doit (BOOL after_child_pin) {
         node_leaf,
         toku_cachetable_hash(c_ft->ft->cf, node_root),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -256,7 +256,7 @@ doit (BOOL after_child_pin) {
 int
 test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute__((__unused__))) {
     default_parse_args(argc, argv);
-    doit(FALSE);
-    doit(TRUE);
+    doit(false);
+    doit(true);
     return 0;
 }
diff --git a/ft/tests/test-checkpoint-during-merge.cc b/ft/tests/test-checkpoint-during-merge.cc
index 284241dbaf01b4f21b85cf64c92a461dbc1e1345..31936dad73618cf6a1b002ffd815e3f1c9ef69b4 100644
--- a/ft/tests/test-checkpoint-during-merge.cc
+++ b/ft/tests/test-checkpoint-during-merge.cc
@@ -21,8 +21,8 @@ enum { NODESIZE = 1024, KSIZE=NODESIZE-100, TOKU_PSIZE=20 };
 CACHETABLE ct;
 FT_HANDLE t;
 
-BOOL checkpoint_called;
-BOOL checkpoint_callback_called;
+bool checkpoint_called;
+bool checkpoint_callback_called;
 toku_pthread_t checkpoint_tid;
 
 
@@ -34,7 +34,7 @@ dont_destroy_bn(void* UU(extra))
 }
 
 static bool recursively_flush_should_not_happen(FTNODE UU(child), void* UU(extra)) {
-    assert(FALSE);
+    assert(false);
 }
 
 static int child_to_flush(FT UU(h), FTNODE parent, void* UU(extra)) {
@@ -49,7 +49,7 @@ static void dummy_update_status(FTNODE UU(child), int UU(dirtied), void* UU(extr
 
 static void checkpoint_callback(void* UU(extra)) {
     usleep(1*1024*1024);
-    checkpoint_callback_called = TRUE;
+    checkpoint_callback_called = true;
 }
 
 
@@ -69,7 +69,7 @@ static void flusher_callback(int state, void* extra) {
         printf("state %d\n", state);
     }
     if (state == desired_state) {
-        checkpoint_called = TRUE;
+        checkpoint_called = true;
         int r = toku_pthread_create(&checkpoint_tid, NULL, do_checkpoint, NULL); 
         assert_zero(r);
         while (!checkpoint_callback_called) {
@@ -84,8 +84,8 @@ doit (int state) {
     BLOCKNUM node_leaves[2];
 
     int r;
-    checkpoint_called = FALSE;
-    checkpoint_callback_called = FALSE;
+    checkpoint_called = false;
+    checkpoint_callback_called = false;
 
     toku_flusher_thread_set_callback(flusher_callback, &state);
     
@@ -153,10 +153,10 @@ doit (int state) {
     // hack to get merge going
     FTNODE node = NULL;
     toku_pin_node_with_min_bfe(&node, node_leaves[0], t);
-    BLB_SEQINSERT(node, node->n_children-1) = FALSE;
+    BLB_SEQINSERT(node, node->n_children-1) = false;
     toku_unpin_ftnode(t->ft, node);
     toku_pin_node_with_min_bfe(&node, node_leaves[1], t);
-    BLB_SEQINSERT(node, node->n_children-1) = FALSE;
+    BLB_SEQINSERT(node, node->n_children-1) = false;
     toku_unpin_ftnode(t->ft, node);
 
     
@@ -167,7 +167,7 @@ doit (int state) {
         node_root,
         toku_cachetable_hash(t->ft->cf, node_root),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -185,7 +185,7 @@ doit (int state) {
         node_root,
         toku_cachetable_hash(t->ft->cf, node_root),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -224,7 +224,7 @@ doit (int state) {
         node_root,
         toku_cachetable_hash(c_ft->ft->cf, node_root),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -254,7 +254,7 @@ doit (int state) {
             left_child,
             toku_cachetable_hash(c_ft->ft->cf, left_child),
             &bfe,
-            TRUE, 
+            true, 
             0,
             NULL,
             &node
@@ -270,7 +270,7 @@ doit (int state) {
             right_child,
             toku_cachetable_hash(c_ft->ft->cf, right_child),
             &bfe,
-            TRUE, 
+            true, 
             0,
             NULL,
             &node
@@ -287,7 +287,7 @@ doit (int state) {
             left_child,
             toku_cachetable_hash(c_ft->ft->cf, left_child),
             &bfe,
-            TRUE, 
+            true, 
             0,
             NULL,
             &node
@@ -299,7 +299,7 @@ doit (int state) {
         toku_unpin_ftnode_off_client_thread(c_ft->ft, node);
     }
     else {
-        assert(FALSE);
+        assert(false);
     }
 
 
diff --git a/ft/tests/test-checkpoint-during-rebalance.cc b/ft/tests/test-checkpoint-during-rebalance.cc
index 730d7722494db0848ba6c9d831c3e0f82b2f4a46..82f148745d2d23c3ddfbdab9f2250d18f81d2afd 100644
--- a/ft/tests/test-checkpoint-during-rebalance.cc
+++ b/ft/tests/test-checkpoint-during-rebalance.cc
@@ -21,8 +21,8 @@ enum { NODESIZE = 1024, KSIZE=NODESIZE-100, TOKU_PSIZE=20 };
 CACHETABLE ct;
 FT_HANDLE t;
 
-BOOL checkpoint_called;
-BOOL checkpoint_callback_called;
+bool checkpoint_called;
+bool checkpoint_callback_called;
 toku_pthread_t checkpoint_tid;
 
 
@@ -34,7 +34,7 @@ dont_destroy_bn(void* UU(extra))
 }
 
 static bool recursively_flush_should_not_happen(FTNODE UU(child), void* UU(extra)) {
-    assert(FALSE);
+    assert(false);
 }
 
 static int child_to_flush(FT UU(h), FTNODE parent, void* UU(extra)) {
@@ -49,7 +49,7 @@ static void dummy_update_status(FTNODE UU(child), int UU(dirtied), void* UU(extr
 
 static void checkpoint_callback(void* UU(extra)) {
     usleep(1*1024*1024);
-    checkpoint_callback_called = TRUE;
+    checkpoint_callback_called = true;
 }
 
 
@@ -69,7 +69,7 @@ static void flusher_callback(int state, void* extra) {
         printf("state %d\n", state);
     }
     if (state == desired_state) {
-        checkpoint_called = TRUE;
+        checkpoint_called = true;
         int r = toku_pthread_create(&checkpoint_tid, NULL, do_checkpoint, NULL); 
         assert_zero(r);
         while (!checkpoint_callback_called) {
@@ -84,8 +84,8 @@ doit (int state) {
     BLOCKNUM node_leaves[2];
 
     int r;
-    checkpoint_called = FALSE;
-    checkpoint_callback_called = FALSE;
+    checkpoint_called = false;
+    checkpoint_callback_called = false;
 
     toku_flusher_thread_set_callback(flusher_callback, &state);
     
@@ -173,10 +173,10 @@ doit (int state) {
     // hack to get merge going
     FTNODE node = NULL;
     toku_pin_node_with_min_bfe(&node, node_leaves[0], t);
-    BLB_SEQINSERT(node, node->n_children-1) = FALSE;
+    BLB_SEQINSERT(node, node->n_children-1) = false;
     toku_unpin_ftnode(t->ft, node);
     toku_pin_node_with_min_bfe(&node, node_leaves[1], t);
-    BLB_SEQINSERT(node, node->n_children-1) = FALSE;
+    BLB_SEQINSERT(node, node->n_children-1) = false;
     toku_unpin_ftnode(t->ft, node);
 
     
@@ -187,7 +187,7 @@ doit (int state) {
         node_root,
         toku_cachetable_hash(t->ft->cf, node_root),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -205,7 +205,7 @@ doit (int state) {
         node_root,
         toku_cachetable_hash(t->ft->cf, node_root),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -244,7 +244,7 @@ doit (int state) {
         node_root,
         toku_cachetable_hash(c_ft->ft->cf, node_root),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -265,7 +265,7 @@ doit (int state) {
         left_child,
         toku_cachetable_hash(c_ft->ft->cf, left_child),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -281,7 +281,7 @@ doit (int state) {
         right_child,
         toku_cachetable_hash(c_ft->ft->cf, right_child),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
diff --git a/ft/tests/test-checkpoint-during-split.cc b/ft/tests/test-checkpoint-during-split.cc
index b6e2a82bef93c1fb5d6a366fced2121503c3c4c1..acdf39995a1671d61fe6c26da907f7a18aa8f7e8 100644
--- a/ft/tests/test-checkpoint-during-split.cc
+++ b/ft/tests/test-checkpoint-during-split.cc
@@ -21,8 +21,8 @@ enum { NODESIZE = 1024, KSIZE=NODESIZE-100, TOKU_PSIZE=20 };
 CACHETABLE ct;
 FT_HANDLE t;
 
-BOOL checkpoint_called;
-BOOL checkpoint_callback_called;
+bool checkpoint_called;
+bool checkpoint_callback_called;
 toku_pthread_t checkpoint_tid;
 
 
@@ -39,11 +39,11 @@ static void merge_should_not_happen(struct flusher_advice* UU(fa),
                               FTNODE UU(child),
                               void* UU(extra))
 {
-    assert(FALSE);
+    assert(false);
 }
 
 static bool recursively_flush_should_not_happen(FTNODE UU(child), void* UU(extra)) {
-    assert(FALSE);
+    assert(false);
 }
 
 static int child_to_flush(FT UU(h), FTNODE parent, void* UU(extra)) {
@@ -58,7 +58,7 @@ static void dummy_update_status(FTNODE UU(child), int UU(dirtied), void* UU(extr
 
 static void checkpoint_callback(void* UU(extra)) {
     usleep(1*1024*1024);
-    checkpoint_callback_called = TRUE;
+    checkpoint_callback_called = true;
 }
 
 
@@ -73,13 +73,13 @@ static void *do_checkpoint(void *arg) {
 
 
 static void flusher_callback(int state, void* extra) {
-    BOOL after_split = *(BOOL *)extra;
+    bool after_split = *(bool *)extra;
     if (verbose) {
         printf("state %d\n", state);
     }
     if ((state == flt_flush_before_split && !after_split) ||
         (state == flt_flush_during_split && after_split)) {
-        checkpoint_called = TRUE;
+        checkpoint_called = true;
         int r = toku_pthread_create(&checkpoint_tid, NULL, do_checkpoint, NULL); 
         assert_zero(r);
         while (!checkpoint_callback_called) {
@@ -89,12 +89,12 @@ static void flusher_callback(int state, void* extra) {
 }
 
 static void
-doit (BOOL after_split) {
+doit (bool after_split) {
     BLOCKNUM node_leaf, node_root;
 
     int r;
-    checkpoint_called = FALSE;
-    checkpoint_callback_called = FALSE;
+    checkpoint_called = false;
+    checkpoint_callback_called = false;
 
     toku_flusher_thread_set_callback(flusher_callback, &after_split);
     
@@ -163,7 +163,7 @@ doit (BOOL after_split) {
         node_root,
         toku_cachetable_hash(t->ft->cf, node_root),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -181,7 +181,7 @@ doit (BOOL after_split) {
         node_root,
         toku_cachetable_hash(t->ft->cf, node_root),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -220,7 +220,7 @@ doit (BOOL after_split) {
         node_root,
         toku_cachetable_hash(c_ft->ft->cf, node_root),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -248,7 +248,7 @@ doit (BOOL after_split) {
             left_child,
             toku_cachetable_hash(c_ft->ft->cf, left_child),
             &bfe,
-            TRUE, 
+            true, 
             0,
             NULL,
             &node
@@ -264,7 +264,7 @@ doit (BOOL after_split) {
             right_child,
             toku_cachetable_hash(c_ft->ft->cf, right_child),
             &bfe,
-            TRUE, 
+            true, 
             0,
             NULL,
             &node
@@ -281,7 +281,7 @@ doit (BOOL after_split) {
             left_child,
             toku_cachetable_hash(c_ft->ft->cf, left_child),
             &bfe,
-            TRUE, 
+            true, 
             0,
             NULL,
             &node
@@ -311,7 +311,7 @@ doit (BOOL after_split) {
 int
 test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute__((__unused__))) {
     default_parse_args(argc, argv);
-    doit(FALSE);
-    doit(TRUE);
+    doit(false);
+    doit(true);
     return 0;
 }
diff --git a/ft/tests/test-dirty-flushes-on-cleaner.cc b/ft/tests/test-dirty-flushes-on-cleaner.cc
index 9f4011db01df0f4388e296e13d2c869b1d035e10..c3dc7952c362388c9472415b8f7e7855e25f7598 100644
--- a/ft/tests/test-dirty-flushes-on-cleaner.cc
+++ b/ft/tests/test-dirty-flushes-on-cleaner.cc
@@ -166,7 +166,7 @@ doit (void) {
         node_leaf,
         toku_cachetable_hash(brt->ft->cf, node_leaf),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -195,7 +195,7 @@ doit (void) {
         node_leaf,
         toku_cachetable_hash(brt->ft->cf, node_leaf),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -215,7 +215,7 @@ doit (void) {
         node_internal,
         toku_cachetable_hash(brt->ft->cf, node_internal),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -239,7 +239,7 @@ doit (void) {
         node_internal,
         toku_cachetable_hash(brt->ft->cf, node_internal),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
diff --git a/ft/tests/test-flushes-on-cleaner.cc b/ft/tests/test-flushes-on-cleaner.cc
index 62effeb43a0f1e697ef09bac43bd9100fe44f39e..6fcd86485c329adcc370ff07987d305723d8d273 100644
--- a/ft/tests/test-flushes-on-cleaner.cc
+++ b/ft/tests/test-flushes-on-cleaner.cc
@@ -42,7 +42,7 @@ static int update_func(
 
 
 static void
-doit (BOOL keep_other_bn_in_memory) {
+doit (bool keep_other_bn_in_memory) {
     BLOCKNUM node_leaf;
     BLOCKNUM node_internal, node_root;
 
@@ -171,7 +171,7 @@ doit (BOOL keep_other_bn_in_memory) {
         node_leaf,
         toku_cachetable_hash(brt->ft->cf, node_leaf),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -219,7 +219,7 @@ doit (BOOL keep_other_bn_in_memory) {
         node_leaf,
         toku_cachetable_hash(brt->ft->cf, node_leaf),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -244,7 +244,7 @@ doit (BOOL keep_other_bn_in_memory) {
         node_internal,
         toku_cachetable_hash(brt->ft->cf, node_internal),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -268,7 +268,7 @@ doit (BOOL keep_other_bn_in_memory) {
         node_internal,
         toku_cachetable_hash(brt->ft->cf, node_internal),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -302,7 +302,7 @@ doit (BOOL keep_other_bn_in_memory) {
 int
 test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute__((__unused__))) {
     default_parse_args(argc, argv);
-    doit(FALSE);
-    doit(TRUE);
+    doit(false);
+    doit(true);
     return 0;
 }
diff --git a/ft/tests/test-ft-overflow.cc b/ft/tests/test-ft-overflow.cc
index 809864fa053903095ec00fddb87a53a63633f417..a92f978660a383ee8dc4558037ea723b21a1e47b 100644
--- a/ft/tests/test-ft-overflow.cc
+++ b/ft/tests/test-ft-overflow.cc
@@ -18,14 +18,14 @@ static void
 test_overflow (void) {
     FT_HANDLE t;
     CACHETABLE ct;
-    u_int32_t nodesize = 1<<20; 
+    uint32_t nodesize = 1<<20; 
     int r;
     unlink(fname);
     r = toku_create_cachetable(&ct, 0, ZERO_LSN, NULL_LOGGER);         assert(r==0);
     r = toku_open_ft_handle(fname, 1, &t, nodesize, nodesize / 8, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); assert(r==0);
 
     DBT k,v;
-    u_int32_t vsize = nodesize/8;
+    uint32_t vsize = nodesize/8;
     char buf[vsize];
     memset(buf, 'a', vsize);
     int i;
diff --git a/ft/tests/test-ft-txns.h b/ft/tests/test-ft-txns.h
index 36e7eccca0afc7be8f0c46d225203a4ac5e71d6f..dc382ff3045ea386a9309a5eefd389e0c34294c6 100644
--- a/ft/tests/test-ft-txns.h
+++ b/ft/tests/test-ft-txns.h
@@ -35,7 +35,7 @@ test_setup(TOKULOGGER *loggerp, CACHETABLE *ctp) {
 
     toku_logger_set_cachetable(logger, ct);
 
-    r = toku_logger_open_rollback(logger, ct, TRUE);
+    r = toku_logger_open_rollback(logger, ct, true);
     CKERR(r);
 
     r = toku_checkpoint(ct, logger, NULL, NULL, NULL, NULL, STARTUP_CHECKPOINT);
diff --git a/ft/tests/test-leafentry-nested.cc b/ft/tests/test-leafentry-nested.cc
index 72e6ebbb4a8c5ddfcdf4e9a13585ecea9eebffa0..bbdb90c32c353d3728f127f04f79b48ff2816274 100644
--- a/ft/tests/test-leafentry-nested.cc
+++ b/ft/tests/test-leafentry-nested.cc
@@ -22,7 +22,7 @@ verify_ule_equal(ULE a, ULE b) {
     assert(memcmp(a->keyp, b->keyp, a->keylen) == 0);
     assert(a->num_cuxrs == b->num_cuxrs);
     assert(a->num_puxrs == b->num_puxrs);
-    u_int32_t i;
+    uint32_t i;
     for (i = 0; i < (a->num_cuxrs + a->num_puxrs); i++) {
         assert(a->uxrs[i].type == b->uxrs[i].type);
         assert(a->uxrs[i].xid  == b->uxrs[i].xid);
@@ -56,9 +56,9 @@ verify_le_equal(LEAFENTRY a, LEAFENTRY b) {
 }
 
 static void
-fillrandom(u_int8_t buf[MAX_SIZE], u_int32_t length) {
+fillrandom(uint8_t buf[MAX_SIZE], uint32_t length) {
     assert(length < MAX_SIZE);
-    u_int32_t i;
+    uint32_t i;
     for (i = 0; i < length; i++) {
         buf[i] = random() & 0xFF;
     } 
@@ -186,9 +186,9 @@ le_verify_accessors(LEAFENTRY le, ULE ule, size_t pre_calculated_memsize) {
     size_t num_uxrs = ule->num_cuxrs + ule->num_puxrs;
 
     void *key               = ule->keyp;
-    u_int32_t keylen        = ule->keylen;
+    uint32_t keylen        = ule->keylen;
     void *latest_val        = ule->uxrs[num_uxrs -1].type == XR_DELETE ? NULL : ule->uxrs[num_uxrs -1].valp;
-    u_int32_t latest_vallen = ule->uxrs[num_uxrs -1].type == XR_DELETE ? 0    : ule->uxrs[num_uxrs -1].vallen;
+    uint32_t latest_vallen = ule->uxrs[num_uxrs -1].type == XR_DELETE ? 0    : ule->uxrs[num_uxrs -1].vallen;
     {
         int i;
         for (i = num_uxrs - 1; i >= 0; i--) {
@@ -196,7 +196,7 @@ le_verify_accessors(LEAFENTRY le, ULE ule, size_t pre_calculated_memsize) {
                 goto found_insert;
             }
         }
-        assert(FALSE);
+        assert(false);
     }
 found_insert:;
     TXNID outermost_uncommitted_xid = ule->num_puxrs == 0 ? TXNID_NONE : ule->uxrs[ule->num_cuxrs].xid;
@@ -207,7 +207,7 @@ found_insert:;
     assert(memsize  == pre_calculated_memsize);
     assert(memsize  == leafentry_memsize(le));
     {
-        u_int32_t test_keylen;
+        uint32_t test_keylen;
         void*     test_keyp = le_key_and_len(le, &test_keylen);
         if (key != NULL) assert(test_keyp != key);
         assert(test_keylen == keylen);
@@ -216,7 +216,7 @@ found_insert:;
         assert(le_keylen(le) == test_keylen);
     }
     {
-        u_int32_t test_vallen;
+        uint32_t test_vallen;
         void*     test_valp = le_latest_val_and_len(le, &test_vallen);
         if (latest_val != NULL) assert(test_valp != latest_val);
         assert(test_vallen == latest_vallen);
@@ -239,10 +239,10 @@ test_le_pack_committed (void) {
     ULE_S ule;
     ule.uxrs = ule.uxrs_static;
 
-    u_int8_t key[MAX_SIZE];
-    u_int8_t val[MAX_SIZE];
-    u_int32_t keysize;
-    u_int32_t valsize;
+    uint8_t key[MAX_SIZE];
+    uint8_t val[MAX_SIZE];
+    uint32_t keysize;
+    uint32_t valsize;
     for (keysize = 0; keysize < MAX_SIZE; keysize += (random() % MAX_SIZE) + 1) {
         for (valsize = 0; valsize < MAX_SIZE; valsize += (random() % MAX_SIZE) + 1) {
             fillrandom(key, keysize);
@@ -281,17 +281,17 @@ test_le_pack_committed (void) {
 }
 
 static void
-test_le_pack_uncommitted (u_int8_t committed_type, u_int8_t prov_type, int num_placeholders) {
+test_le_pack_uncommitted (uint8_t committed_type, uint8_t prov_type, int num_placeholders) {
     ULE_S ule;
     ule.uxrs = ule.uxrs_static;
     assert(num_placeholders >= 0);
 
-    u_int8_t key[MAX_SIZE];
-    u_int8_t cval[MAX_SIZE];
-    u_int8_t pval[MAX_SIZE];
-    u_int32_t keysize;
-    u_int32_t cvalsize;
-    u_int32_t pvalsize;
+    uint8_t key[MAX_SIZE];
+    uint8_t cval[MAX_SIZE];
+    uint8_t pval[MAX_SIZE];
+    uint32_t keysize;
+    uint32_t cvalsize;
+    uint32_t pvalsize;
     for (keysize = 0; keysize < MAX_SIZE; keysize += (random() % MAX_SIZE) + 1) {
         for (cvalsize = 0; cvalsize < MAX_SIZE; cvalsize += (random() % MAX_SIZE) + 1) {
             pvalsize = (cvalsize + random()) % MAX_SIZE;
@@ -479,7 +479,7 @@ generate_provpair_for(ULE ule, FT_MSG msg) {
 
     ule->num_cuxrs = 1;
     ule->num_puxrs = xids_get_num_xids(xids);
-    u_int32_t num_uxrs = ule->num_cuxrs + ule->num_puxrs;
+    uint32_t num_uxrs = ule->num_cuxrs + ule->num_puxrs;
     ule->keylen   = msg->u.id.key->size;
     ule->keyp     = msg->u.id.key->data;
     ule->uxrs[0].type   = XR_DELETE;
@@ -507,10 +507,10 @@ test_le_empty_apply(void) {
 
     DBT key;
     DBT val;
-    u_int8_t keybuf[MAX_SIZE];
-    u_int8_t valbuf[MAX_SIZE];
-    u_int32_t keysize;
-    u_int32_t valsize;
+    uint8_t keybuf[MAX_SIZE];
+    uint8_t valbuf[MAX_SIZE];
+    uint32_t keysize;
+    uint32_t valsize;
     uint32_t  nesting_level;
     for (keysize = 0; keysize < MAX_SIZE; keysize += (random() % MAX_SIZE) + 1) {
         for (valsize = 0; valsize < MAX_SIZE; valsize += (random() % MAX_SIZE) + 1) {
@@ -569,7 +569,7 @@ generate_provdel_for(ULE ule, FT_MSG msg) {
 
     ule->num_cuxrs = 1;
     ule->num_puxrs = xids_get_num_xids(xids);
-    u_int32_t num_uxrs = ule->num_cuxrs + ule->num_puxrs;
+    uint32_t num_uxrs = ule->num_cuxrs + ule->num_puxrs;
     ule->keylen   = msg->u.id.key->size;
     ule->keyp     = msg->u.id.key->data;
     ule->uxrs[0].type   = XR_INSERT;
@@ -595,7 +595,7 @@ generate_both_for(ULE ule, DBT *oldval, FT_MSG msg) {
 
     ule->num_cuxrs = 1;
     ule->num_puxrs = xids_get_num_xids(xids);
-    u_int32_t num_uxrs = ule->num_cuxrs + ule->num_puxrs;
+    uint32_t num_uxrs = ule->num_cuxrs + ule->num_puxrs;
     ule->keylen   = msg->u.id.key->size;
     ule->keyp     = msg->u.id.key->data;
     ule->uxrs[0].type   = XR_INSERT;
@@ -624,10 +624,10 @@ test_le_committed_apply(void) {
 
     DBT key;
     DBT val;
-    u_int8_t keybuf[MAX_SIZE];
-    u_int8_t valbuf[MAX_SIZE];
-    u_int32_t keysize;
-    u_int32_t valsize;
+    uint8_t keybuf[MAX_SIZE];
+    uint8_t valbuf[MAX_SIZE];
+    uint32_t keysize;
+    uint32_t valsize;
     uint32_t  nesting_level;
     for (keysize = 0; keysize < MAX_SIZE; keysize += (random() % MAX_SIZE) + 1) {
         for (valsize = 0; valsize < MAX_SIZE; valsize += (random() % MAX_SIZE) + 1) {
@@ -668,8 +668,8 @@ test_le_committed_apply(void) {
                 }
 
                 {
-                    u_int8_t valbuf2[MAX_SIZE];
-                    u_int32_t valsize2 = random() % MAX_SIZE;
+                    uint8_t valbuf2[MAX_SIZE];
+                    uint32_t valsize2 = random() % MAX_SIZE;
                     fillrandom(valbuf2, valsize2);
                     DBT val2;
                     toku_fill_dbt(&val2, valbuf2, valsize2);
@@ -682,8 +682,8 @@ test_le_committed_apply(void) {
                 {
                     //INSERT_NO_OVERWRITE will not change a committed insert
                     ULE_S ule_expected = ule_initial;
-                    u_int8_t valbuf2[MAX_SIZE];
-                    u_int32_t valsize2 = random() % MAX_SIZE;
+                    uint8_t valbuf2[MAX_SIZE];
+                    uint32_t valsize2 = random() % MAX_SIZE;
                     fillrandom(valbuf2, valsize2);
                     DBT val2;
                     toku_fill_dbt(&val2, valbuf2, valsize2);
@@ -708,10 +708,10 @@ static void test_le_optimize(void) {
     DBT val;
     ULE_S ule_initial;
     ULE_S ule_expected;
-    u_int8_t keybuf[MAX_SIZE];
-    u_int32_t keysize=8;
-    u_int8_t valbuf[MAX_SIZE];
-    u_int32_t valsize=8;
+    uint8_t keybuf[MAX_SIZE];
+    uint32_t keysize=8;
+    uint8_t valbuf[MAX_SIZE];
+    uint32_t valsize=8;
     ule_initial.uxrs = ule_initial.uxrs_static;
     ule_expected.uxrs = ule_expected.uxrs_static;
     TXNID optimize_txnid = 1000;
diff --git a/ft/tests/test-merges-on-cleaner.cc b/ft/tests/test-merges-on-cleaner.cc
index 9ef48680944ca591b4e070a7039917ee011a52a2..263db4b38e0a1528636d6a6032308a01badf46a4 100644
--- a/ft/tests/test-merges-on-cleaner.cc
+++ b/ft/tests/test-merges-on-cleaner.cc
@@ -142,7 +142,7 @@ doit (void) {
     FTNODE node;
     toku_pin_node_with_min_bfe(&node, node_leaf[1], brt);
     // hack to get merge going
-    BLB_SEQINSERT(node, node->n_children-1) = FALSE;
+    BLB_SEQINSERT(node, node->n_children-1) = false;
     toku_unpin_ftnode(brt->ft, node);
 
     // now do a lookup on one of the keys, this should bring a leaf node up to date 
@@ -158,7 +158,7 @@ doit (void) {
         node_internal,
         toku_cachetable_hash(brt->ft->cf, node_internal),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
@@ -181,7 +181,7 @@ doit (void) {
         node_internal,
         toku_cachetable_hash(brt->ft->cf, node_internal),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
diff --git a/ft/tests/test-pick-child-to-flush.cc b/ft/tests/test-pick-child-to-flush.cc
index 7839e8d99230527731ce74b4b6d6f2808df679d9..6f443d0300e23a41fa0c953a97c987c75a6452b1 100644
--- a/ft/tests/test-pick-child-to-flush.cc
+++ b/ft/tests/test-pick-child-to-flush.cc
@@ -39,7 +39,7 @@ static int child_to_flush(FT UU(h), FTNODE parent, void* UU(extra)) {
         return 0;
     }
     else {
-        assert(FALSE);
+        assert(false);
     }
     return curr_child_to_flush;
 }
@@ -63,11 +63,11 @@ static void merge_should_not_happen(struct flusher_advice* UU(fa),
                               FTNODE UU(child),
                               void* UU(extra))
 {
-    assert(FALSE);
+    assert(false);
 }
 
 static bool recursively_flush_should_not_happen(FTNODE UU(child), void* UU(extra)) {
-    assert(FALSE);
+    assert(false);
 }
 
 static bool always_flush(FTNODE UU(child), void* UU(extra)) {
diff --git a/ft/tests/test.h b/ft/tests/test.h
index 83e3e8e9c00f4d1a4d40ea0bd5293aa6f6e5aa45..c54f09d24cfb12b31c8c661acdf2828feab18eeb 100644
--- a/ft/tests/test.h
+++ b/ft/tests/test.h
@@ -124,10 +124,10 @@ def_flush (CACHEFILE f __attribute__((__unused__)),
        void *e     __attribute__((__unused__)),
        PAIR_ATTR s      __attribute__((__unused__)),
        PAIR_ATTR* new_size      __attribute__((__unused__)),
-       BOOL w      __attribute__((__unused__)),
-       BOOL keep   __attribute__((__unused__)),
-       BOOL c      __attribute__((__unused__)),
-       BOOL UU(is_clone)
+       bool w      __attribute__((__unused__)),
+       bool keep   __attribute__((__unused__)),
+       bool c      __attribute__((__unused__)),
+       bool UU(is_clone)
        ) {
 }
 
@@ -156,12 +156,12 @@ def_pe_callback (
     return 0;
 }
 
-static UU() BOOL def_pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
-  return FALSE;
+static UU() bool def_pf_req_callback(void* UU(ftnode_pv), void* UU(read_extraargs)) {
+  return false;
 }
 
   static UU() int def_pf_callback(void* UU(ftnode_pv), void* UU(dd), void* UU(read_extraargs), int UU(fd), PAIR_ATTR* UU(sizep)) {
-  assert(FALSE);
+  assert(false);
   return 0;
 }
 
@@ -169,7 +169,7 @@ static UU() int
 def_fetch (CACHEFILE f        __attribute__((__unused__)),
        int UU(fd),
        CACHEKEY k         __attribute__((__unused__)),
-       u_int32_t fullhash __attribute__((__unused__)),
+       uint32_t fullhash __attribute__((__unused__)),
        void **value       __attribute__((__unused__)),
        void **dd     __attribute__((__unused__)),
        PAIR_ATTR *sizep        __attribute__((__unused__)),
@@ -187,11 +187,11 @@ static UU() int
 def_cleaner_callback(
     void* UU(ftnode_pv),
     BLOCKNUM UU(blocknum),
-    u_int32_t UU(fullhash),
+    uint32_t UU(fullhash),
     void* UU(extraargs)
     )
 {
-    assert(FALSE);
+    assert(false);
     return 0;
 }
 
diff --git a/ft/tests/test1308a.cc b/ft/tests/test1308a.cc
index ecc1d1f337a56191b30f674e738bb597809bcfe4..c99332171c3f823775287ae58b43149d4f3a7be3 100644
--- a/ft/tests/test1308a.cc
+++ b/ft/tests/test1308a.cc
@@ -23,12 +23,12 @@ test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute_
     int fd;
     {
 
-	static u_int64_t buf [BUFSIZE]; // make this static because it's too big to fit on the stack.
+	static uint64_t buf [BUFSIZE]; // make this static because it's too big to fit on the stack.
 
 	fd = open(FNAME, O_CREAT+O_RDWR+O_BINARY, 0777);
 	assert(fd>=0);
 	memset(buf, 0, sizeof(buf));
-	u_int64_t i;
+	uint64_t i;
 	for (i=0; i<(1LL<<32); i+=BUFSIZE) {
 	    toku_os_full_write(fd, buf, BUFSIZE);
 	}
diff --git a/ft/tests/test3856.cc b/ft/tests/test3856.cc
index 859782c115022c2b1767131fb1d525f0cc6fd68a..e81ada7ea290c9c3573afb8dafd286874f6ce55d 100644
--- a/ft/tests/test3856.cc
+++ b/ft/tests/test3856.cc
@@ -61,12 +61,12 @@ test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute_
         FT_CURSOR c;
         char lkey[100],rkey[100];
         DBT lk, rk;
-        r = toku_ft_cursor(t, &c, null_txn, FALSE, FALSE); assert(r == 0);
+        r = toku_ft_cursor(t, &c, null_txn, false, false); assert(r == 0);
         snprintf(lkey, 100, "hello%d", i);
         snprintf(rkey, 100, "hello%d", i + 100);
         toku_ft_cursor_set_range_lock(c, toku_fill_dbt(&lk, lkey, 1+strlen(lkey)),
                                        toku_fill_dbt(&rk, rkey, 1+strlen(rkey)),
-                                       FALSE, FALSE);
+                                       false, false);
         r = toku_ft_cursor_set(c, &lk, found, NULL); assert(r == 0);
         for (int j = 0; j < 100; ++j) {
             r = toku_ft_cursor_next(c, found, NULL); assert(r == 0);
diff --git a/ft/tests/test3884.cc b/ft/tests/test3884.cc
index e20ee281f94f2ec48583032e0c10decb1ba587b5..d672d9e0847f02cfcfd730019d0b9cb269b50dfe 100644
--- a/ft/tests/test3884.cc
+++ b/ft/tests/test3884.cc
@@ -23,7 +23,7 @@ static const int keylen = sizeof(long);
 static const int vallen = 64 - sizeof(long) - (sizeof(((LEAFENTRY)NULL)->type)  // overhead from LE_CLEAN_MEMSIZE
                                                +sizeof(((LEAFENTRY)NULL)->keylen)
                                                +sizeof(((LEAFENTRY)NULL)->u.clean.vallen));
-#define dummy_msn_3884 ((MSN) { (u_int64_t) 3884 * MIN_MSN.msn })
+#define dummy_msn_3884 ((MSN) { (uint64_t) 3884 * MIN_MSN.msn })
 
 static TOKUTXN const null_txn = 0;
 static DB * const null_db = 0;
@@ -34,7 +34,7 @@ static int omt_long_cmp(OMTVALUE p, void *q)
     LEAFENTRY CAST_FROM_VOIDP(a, p);
     LEAFENTRY CAST_FROM_VOIDP(b, q);
     void *ak, *bk;
-    u_int32_t al, bl;
+    uint32_t al, bl;
     ak = le_key_and_len(a, &al);
     bk = le_key_and_len(b, &bl);
     assert(al == sizeof(long) && bl == sizeof(long));
@@ -172,7 +172,7 @@ test_split_on_boundary(void)
     FTNODE nodea, nodeb;
     DBT splitk;
     // if we haven't done it right, we should hit the assert in the top of move_leafentries
-    ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
+    ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, true, 0, NULL);
 
     verify_basement_node_msns(nodea, dummy_msn_3884);
     verify_basement_node_msns(nodeb, dummy_msn_3884);
@@ -245,7 +245,7 @@ test_split_with_everything_on_the_left(void)
     FTNODE nodea, nodeb;
     DBT splitk;
     // if we haven't done it right, we should hit the assert in the top of move_leafentries
-    ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
+    ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, true, 0, NULL);
 
     toku_unpin_ftnode(brt->ft, nodeb);
     r = toku_close_ft_handle_nolsn(brt, NULL); assert(r == 0);
@@ -320,7 +320,7 @@ test_split_on_boundary_of_last_node(void)
     FTNODE nodea, nodeb;
     DBT splitk;
     // if we haven't done it right, we should hit the assert in the top of move_leafentries
-    ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
+    ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, true, 0, NULL);
 
     toku_unpin_ftnode(brt->ft, nodeb);
     r = toku_close_ft_handle_nolsn(brt, NULL); assert(r == 0);
@@ -388,7 +388,7 @@ test_split_at_begin(void)
     FTNODE nodea, nodeb;
     DBT splitk;
     // if we haven't done it right, we should hit the assert in the top of move_leafentries
-    ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
+    ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, true, 0, NULL);
 
     toku_unpin_ftnode(brt->ft, nodeb);
     r = toku_close_ft_handle_nolsn(brt, NULL); assert(r == 0);
@@ -452,7 +452,7 @@ test_split_at_end(void)
     FTNODE nodea, nodeb;
     DBT splitk;
     // if we haven't done it right, we should hit the assert in the top of move_leafentries
-    ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
+    ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, true, 0, NULL);
 
     toku_unpin_ftnode(brt->ft, nodeb);
     r = toku_close_ft_handle_nolsn(brt, NULL); assert(r == 0);
@@ -506,7 +506,7 @@ test_split_odd_nodes(void)
     FTNODE nodea, nodeb;
     DBT splitk;
     // if we haven't done it right, we should hit the assert in the top of move_leafentries
-    ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
+    ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, true, 0, NULL);
 
     verify_basement_node_msns(nodea, dummy_msn_3884);
     verify_basement_node_msns(nodeb, dummy_msn_3884);
diff --git a/ft/tests/test4115.cc b/ft/tests/test4115.cc
index baef08a6f8a61cfc6991aea1c1d7e4ae5a92bfe7..0f694a2df99772cc76cbc6e6e966a3670a326c4a 100644
--- a/ft/tests/test4115.cc
+++ b/ft/tests/test4115.cc
@@ -38,9 +38,9 @@ static void open_ft_and_ct (bool unlink_old) {
 }
 
 static void test_4115 (void) {
-    u_int64_t limit=30000;
+    uint64_t limit=30000;
     open_ft_and_ct(true);
-    for (u_int64_t i=0; i<limit; i++) {
+    for (uint64_t i=0; i<limit; i++) {
 	char key[100],val[100];
 	snprintf(key, 100, "%08llu", (unsigned long long)2*i+1);
 	snprintf(val, 100, "%08llu", (unsigned long long)2*i+1);
diff --git a/ft/tests/test4244.cc b/ft/tests/test4244.cc
index 10c2d67b21e837739b953abfa6bc9ad117aaf717..808869be13c8ad880e857ca6ec68d7ddb52eb8fb 100644
--- a/ft/tests/test4244.cc
+++ b/ft/tests/test4244.cc
@@ -51,7 +51,7 @@ doit (void) {
     assert(r==0);
 
     // make a 1MB val
-    u_int32_t big_val_size = 1000000;
+    uint32_t big_val_size = 1000000;
     char* XCALLOC_N(big_val_size, big_val);
     DBT k,v;
     memset(&k, 0, sizeof(k));
@@ -77,7 +77,7 @@ doit (void) {
         node_internal,
         toku_cachetable_hash(t->ft->cf, node_internal),
         &bfe,
-        TRUE, 
+        true, 
         0,
         NULL,
         &node
diff --git a/ft/tests/test_block_allocator_merge.cc b/ft/tests/test_block_allocator_merge.cc
index 45fbf950ff2b68be2736a0c4704c8f4aa77a90de..41f02bd8c6fc3050ea0e131ea4ebd88a014e5f4c 100644
--- a/ft/tests/test_block_allocator_merge.cc
+++ b/ft/tests/test_block_allocator_merge.cc
@@ -10,9 +10,9 @@
 int verbose = 0;
 
 static void
-print_array (u_int64_t n, const struct block_allocator_blockpair a[/*n*/]) {
+print_array (uint64_t n, const struct block_allocator_blockpair a[/*n*/]) {
     printf("{");
-    for (u_int64_t i=0; i<n; i++) printf(" %016lx", (long)a[i].offset);
+    for (uint64_t i=0; i<n; i++) printf(" %016lx", (long)a[i].offset);
     printf("}\n");
 }
 
@@ -26,8 +26,8 @@ compare_blockpairs (const void *av, const void *bv) {
 }
 
 static void
-test_merge (u_int64_t an, const struct block_allocator_blockpair a[/*an*/],
-	    u_int64_t bn, const struct block_allocator_blockpair b[/*bn*/]) {
+test_merge (uint64_t an, const struct block_allocator_blockpair a[/*an*/],
+	    uint64_t bn, const struct block_allocator_blockpair b[/*bn*/]) {
     if (verbose>1) { printf("a:"); print_array(an, a); }
     if (verbose>1) { printf("b:"); print_array(bn, b); }
     struct block_allocator_blockpair *MALLOC_N(an+bn, q);
@@ -36,10 +36,10 @@ test_merge (u_int64_t an, const struct block_allocator_blockpair a[/*an*/],
 	fprintf(stderr, "malloc failed, continuing\n");
 	goto malloc_failed;
     }
-    for (u_int64_t i=0; i<an; i++) {
+    for (uint64_t i=0; i<an; i++) {
 	q[i] = m[i] = a[i];
     }
-    for (u_int64_t i=0; i<bn; i++) {
+    for (uint64_t i=0; i<bn; i++) {
 	q[an+i] = b[i];
     }
     if (verbose) printf("qsort\n");
@@ -49,7 +49,7 @@ test_merge (u_int64_t an, const struct block_allocator_blockpair a[/*an*/],
     block_allocator_merge_blockpairs_into(an, m, bn, b);
     if (verbose) printf("compare\n");
     if (verbose>1) { printf("m:"); print_array(an+bn, m); }
-    for (u_int64_t i=0; i<an+bn; i++) {
+    for (uint64_t i=0; i<an+bn; i++) {
 	assert(q[i].offset == m[i].offset);
     }
  malloc_failed:
@@ -57,17 +57,17 @@ test_merge (u_int64_t an, const struct block_allocator_blockpair a[/*an*/],
     toku_free(m);
 }
 
-static u_int64_t
-compute_a (u_int64_t i, int mode) {
-    if (mode==0) return (((u_int64_t)random()) << 32) + i;
+static uint64_t
+compute_a (uint64_t i, int mode) {
+    if (mode==0) return (((uint64_t)random()) << 32) + i;
     if (mode==1) return 2*i;
     if (mode==2) return i;
     if (mode==3) return (1LL<<50) + i;
     abort();
 }
-static u_int64_t
-compute_b (u_int64_t i, int mode) {
-    if (mode==0) return (((u_int64_t)random()) << 32) + i;
+static uint64_t
+compute_b (uint64_t i, int mode) {
+    if (mode==0) return (((uint64_t)random()) << 32) + i;
     if (mode==1) return 2*i+1;
     if (mode==2) return (1LL<<50) + i;
     if (mode==3) return i;
@@ -76,7 +76,7 @@ compute_b (u_int64_t i, int mode) {
     
 
 static void
-test_merge_n_m (u_int64_t n, u_int64_t m, int mode)
+test_merge_n_m (uint64_t n, uint64_t m, int mode)
 {
     struct block_allocator_blockpair *MALLOC_N(n, na);
     struct block_allocator_blockpair *MALLOC_N(m, ma);
@@ -85,11 +85,11 @@ test_merge_n_m (u_int64_t n, u_int64_t m, int mode)
 	goto malloc_failed;
     }
     if (verbose) printf("Filling a[%" PRIu64 "]\n", n);
-    for (u_int64_t i=0; i<n; i++) {
+    for (uint64_t i=0; i<n; i++) {
 	na[i].offset = compute_a(i, mode);
     }
     if (verbose) printf("Filling b[%" PRIu64 "]\n", m);
-    for (u_int64_t i=0; i<m; i++) {
+    for (uint64_t i=0; i<m; i++) {
 	if (verbose && i % (1+m/10) == 0) { printf("."); fflush(stdout); }
 	ma[i].offset = compute_b(i, mode);
     }
@@ -104,22 +104,22 @@ test_merge_n_m (u_int64_t n, u_int64_t m, int mode)
 
 static void
 test_big_merge (void) {
-    u_int64_t G = 1024LL * 1024LL * 1024LL;
+    uint64_t G = 1024LL * 1024LL * 1024LL;
     if (toku_os_get_phys_memory_size() < 40 * G) {
 	fprintf(stderr, "Skipping big merge because there is only %4.1fGiB physical memory\n", toku_os_get_phys_memory_size()/(1024.0*1024.0*1024.0));
     } else {
-	u_int64_t twoG = 2*G;
+	uint64_t twoG = 2*G;
 
-	u_int64_t an = twoG;
-	u_int64_t bn = 1;
+	uint64_t an = twoG;
+	uint64_t bn = 1;
 	struct block_allocator_blockpair *MALLOC_N(an+bn, a); 
         assert(a);
 	struct block_allocator_blockpair *MALLOC_N(bn,    b);
         assert(b);
-	for (u_int64_t i=0; i<an; i++) a[i].offset=i+1;
+	for (uint64_t i=0; i<an; i++) a[i].offset=i+1;
 	b[0].offset = 0;
 	block_allocator_merge_blockpairs_into(an, a, bn, b);
-	for (u_int64_t i=0; i<an+bn; i++) assert(a[i].offset == i);
+	for (uint64_t i=0; i<an+bn; i++) assert(a[i].offset == i);
 	toku_free(a);
 	toku_free(b);
     }
@@ -133,7 +133,7 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un
     test_merge_n_m(1000000, 1000000, 0);
     // Cannot run this on my laptop, or even on pointy
 #if 0
-    u_int64_t too_big = 1024LL * 1024LL * 1024LL * 2;
+    uint64_t too_big = 1024LL * 1024LL * 1024LL * 2;
     test_merge_n_m(too_big, too_big);
     test_merge_n_m(1, too_big, 0);
 #endif
diff --git a/ft/tests/test_logcursor.cc b/ft/tests/test_logcursor.cc
index f23fb59cd86ac9a26665780d51fb807aeb22f4ca..218b8e7ee730f04aa2f7222f14c21e5898307e2a 100644
--- a/ft/tests/test_logcursor.cc
+++ b/ft/tests/test_logcursor.cc
@@ -168,8 +168,8 @@ int create_logfiles() {
     TXNID txnid = 0;
     TXNID cp_txnid = 0;
 
-    u_int32_t num_fassociate = 0;
-    u_int32_t num_xstillopen = 0;
+    uint32_t num_fassociate = 0;
+    uint32_t num_xstillopen = 0;
     
     bs_aname.len = 4; bs_aname.data=(char *)"a.db";
     bs_bname.len = 4; bs_bname.data=(char *)"b.db";
diff --git a/ft/tests/test_partitioned_counter.cc b/ft/tests/test_partitioned_counter.cc
index 630ecb52e3cb9dfd8119c910d832a928f2426484..0f387dad3fff62ca9a0e7cfb51af9511a736ad3e 100644
--- a/ft/tests/test_partitioned_counter.cc
+++ b/ft/tests/test_partitioned_counter.cc
@@ -33,7 +33,6 @@
  */
 
 #include <pthread.h>
-#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/ft/tests/x1764-test.cc b/ft/tests/x1764-test.cc
index 2497593debedb27dd3687fe3428d7b729dbf67b5..812ea269effab8e71571b5728a8482fda8bc2046 100644
--- a/ft/tests/x1764-test.cc
+++ b/ft/tests/x1764-test.cc
@@ -8,7 +8,7 @@
 #include "test.h"
 static void
 test0 (void) {
-    u_int32_t c = x1764_memory("", 0);
+    uint32_t c = x1764_memory("", 0);
     assert(c==~(0U));
     struct x1764 cs;
     x1764_init(&cs);
@@ -19,12 +19,12 @@ test0 (void) {
 
 static void
 test1 (void) {
-    u_int64_t v=0x123456789abcdef0ULL;
-    u_int32_t c;
+    uint64_t v=0x123456789abcdef0ULL;
+    uint32_t c;
     int i;
     for (i=0; i<=8; i++) {
-	u_int64_t expect64 = (i==8) ? v : v&((1LL<<(8*i))-1);
-	u_int32_t expect = expect64 ^ (expect64>>32);
+	uint64_t expect64 = (i==8) ? v : v&((1LL<<(8*i))-1);
+	uint32_t expect = expect64 ^ (expect64>>32);
 	c = x1764_memory(&v, i);
 	//printf("i=%d c=%08x expect=%08x\n", i, c, expect);
 	assert(c==~expect);
@@ -42,7 +42,7 @@ test2 (void) {
 	int j;
 	for (j=i; j<=N; j++) {
 	    // checksum from i (inclusive to j (exclusive)
-	    u_int32_t c = x1764_memory(&v[i], j-i);
+	    uint32_t c = x1764_memory(&v[i], j-i);
 	    // Now compute the checksum incrementally with various strides.
 	    int stride;
 	    for (stride=1; stride<=j-i; stride++) {
@@ -53,7 +53,7 @@ test2 (void) {
 		    x1764_add(&s, &v[k], stride);
 		}
 		x1764_add(&s, &v[k], j-k);
-		u_int32_t c2 = x1764_finish(&s);
+		uint32_t c2 = x1764_finish(&s);
 		assert(c2==c);
 	    }
 	    // Now use some random strides.
@@ -68,7 +68,7 @@ test2 (void) {
 		    k+=stride;
 		}
 		x1764_add(&s, &v[k], j-k);
-		u_int32_t c2 = x1764_finish(&s);
+		uint32_t c2 = x1764_finish(&s);
 		assert(c2==c);
 	    }
 	}
@@ -85,8 +85,8 @@ test3 (void)
     for (int off=0; off<32; off++) {
 	if (verbose) {printf("."); fflush(stdout);}
 	for (int len=0; len+off<datalen; len++) {
-	    u_int32_t reference_sum = x1764_memory_simple(data+off, len);
-	    u_int32_t fast_sum      = x1764_memory       (data+off, len);
+	    uint32_t reference_sum = x1764_memory_simple(data+off, len);
+	    uint32_t fast_sum      = x1764_memory       (data+off, len);
 	    assert(reference_sum==fast_sum);
 	}
     }
diff --git a/ft/tests/xid_lsn_independent.cc b/ft/tests/xid_lsn_independent.cc
index c9d995b96163ba7bb7a889f66a75daa1363750ff..0ffdc53c5c9ec148d8f485841273338ce3de3946 100644
--- a/ft/tests/xid_lsn_independent.cc
+++ b/ft/tests/xid_lsn_independent.cc
@@ -24,7 +24,7 @@ static void do_txn(TOKULOGGER logger, bool readonly) {
     if (!readonly) {
         toku_maybe_log_begin_txn_for_write_operation(txn);
     }
-    r = toku_txn_commit_txn(txn, FALSE, NULL, NULL);
+    r = toku_txn_commit_txn(txn, false, NULL, NULL);
     CKERR(r);
 
     toku_txn_close_txn(txn);
@@ -46,7 +46,7 @@ static void test_xid_lsn_independent(int N) {
     r = toku_open_ft_handle(FILENAME, 1, &brt, 1024, 256, TOKU_DEFAULT_COMPRESSION_METHOD, ct, txn, toku_builtin_compare_fun);
     CKERR(r);
 
-    r = toku_txn_commit_txn(txn, FALSE, NULL, NULL);
+    r = toku_txn_commit_txn(txn, false, NULL, NULL);
     CKERR(r);
     toku_txn_close_txn(txn);
 
@@ -70,11 +70,11 @@ static void test_xid_lsn_independent(int N) {
     CKERR(r);
         // Verify the txnid has gone up only by one (even though many log entries were done)
         invariant(txn2->txnid64 == xid_first + 1);
-        r = toku_txn_commit_txn(txn2, FALSE, NULL, NULL);
+        r = toku_txn_commit_txn(txn2, false, NULL, NULL);
     CKERR(r);
         toku_txn_close_txn(txn2);
     }
-    r = toku_txn_commit_txn(txn, FALSE, NULL, NULL);
+    r = toku_txn_commit_txn(txn, false, NULL, NULL);
     CKERR(r);
     toku_txn_close_txn(txn);
     {
@@ -84,7 +84,7 @@ static void test_xid_lsn_independent(int N) {
         r = toku_txn_begin_txn((DB_TXN*)NULL, (TOKUTXN)0, &txn3, logger, TXN_SNAPSHOT_ROOT);
     CKERR(r);
         invariant(txn3->txnid64 == xid_first + 2);
-        r = toku_txn_commit_txn(txn3, FALSE, NULL, NULL);
+        r = toku_txn_commit_txn(txn3, false, NULL, NULL);
     CKERR(r);
         toku_txn_close_txn(txn3);
     }
@@ -204,7 +204,7 @@ static void test_xid_lsn_independent_parents(int N) {
             invariant(txns[i]->begin_was_logged);
         }
         for (int i = N-1; i >= 0; i--) {
-            r = toku_txn_commit_txn(txns[i], FALSE, NULL, NULL);
+            r = toku_txn_commit_txn(txns[i], false, NULL, NULL);
             CKERR(r);
 
             toku_txn_close_txn(txns[i]);
diff --git a/ft/txn.cc b/ft/txn.cc
index 5f72d70a1fd3615ac7bb13aa8f77d674eb62c899..a7687b7bc8484a05d986b67fe13ab135eef989d3 100644
--- a/ft/txn.cc
+++ b/ft/txn.cc
@@ -63,7 +63,7 @@ toku_txn_unlock(TOKUTXN txn)
     toku_mutex_unlock(&txn->txn_lock);
 }
 
-u_int64_t
+uint64_t
 toku_txn_get_id(TOKUTXN txn)
 {
     return txn->txnid64;
@@ -159,9 +159,9 @@ toku_txn_create_txn (
         .live_root_txn_list = nullptr,
         .xids = xids,
         .begin_was_logged = false,
-        .checkpoint_needed_before_commit = FALSE,
-        .do_fsync = FALSE,
-        .force_fsync_on_commit = FALSE,
+        .checkpoint_needed_before_commit = false,
+        .do_fsync = false,
+        .force_fsync_on_commit = false,
         .do_fsync_lsn = ZERO_LSN,
         .xa_xid = {0},
         .progress_poll_fun = NULL,
@@ -258,7 +258,7 @@ int toku_txn_commit_txn(TOKUTXN txn, int nosync,
 
 void
 toku_txn_require_checkpoint_on_commit(TOKUTXN txn) {
-    txn->checkpoint_needed_before_commit = TRUE;
+    txn->checkpoint_needed_before_commit = true;
 }
 
 struct xcommit_info {
@@ -266,7 +266,7 @@ struct xcommit_info {
     TOKUTXN txn;
 };
 
-BOOL toku_txn_requires_checkpoint(TOKUTXN txn) {
+bool toku_txn_requires_checkpoint(TOKUTXN txn) {
     return (!txn->parent && txn->checkpoint_needed_before_commit);
 }
 
@@ -324,7 +324,7 @@ int toku_txn_abort_with_lsn(TOKUTXN txn, LSN oplsn,
     txn->progress_poll_fun = poll;
     txn->progress_poll_fun_extra = poll_extra;
     int r;
-    txn->do_fsync = FALSE;
+    txn->do_fsync = false;
 
     if (!toku_txn_is_read_only(txn)) {
         r = toku_log_xabort(txn->logger, &txn->do_fsync_lsn, 0, txn, txn->txnid64);
@@ -373,7 +373,7 @@ void toku_txn_get_prepared_xa_xid (TOKUTXN txn, TOKU_XA_XID *xid) {
     copy_xid(xid, &txn->xa_xid);
 }
 
-int toku_logger_recover_txn (TOKULOGGER logger, struct tokulogger_preplist preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags) {
+int toku_logger_recover_txn (TOKULOGGER logger, struct tokulogger_preplist preplist[/*count*/], long count, /*out*/ long *retp, uint32_t flags) {
     return toku_txn_manager_recover_txn(
         logger->txn_manager,
         preplist,
@@ -383,7 +383,7 @@ int toku_logger_recover_txn (TOKULOGGER logger, struct tokulogger_preplist prepl
         );
 }
 
-int toku_txn_maybe_fsync_log(TOKULOGGER logger, LSN do_fsync_lsn, BOOL do_fsync) {
+int toku_txn_maybe_fsync_log(TOKULOGGER logger, LSN do_fsync_lsn, bool do_fsync) {
     int r = 0;
     if (logger && do_fsync) {
         r = toku_logger_fsync_if_lsn_not_fsynced(logger, do_fsync_lsn);
@@ -391,7 +391,7 @@ int toku_txn_maybe_fsync_log(TOKULOGGER logger, LSN do_fsync_lsn, BOOL do_fsync)
     return r;
 }
 
-void toku_txn_get_fsync_info(TOKUTXN ttxn, BOOL* do_fsync, LSN* do_fsync_lsn) {
+void toku_txn_get_fsync_info(TOKUTXN ttxn, bool* do_fsync, LSN* do_fsync_lsn) {
     *do_fsync = ttxn->do_fsync;
     *do_fsync_lsn = ttxn->do_fsync_lsn;
 }
@@ -401,7 +401,7 @@ void toku_txn_close_txn(TOKUTXN txn) {
     toku_txn_destroy_txn(txn);
 }
 
-static int remove_txn (OMTVALUE hv, u_int32_t UU(idx), void *txnv)
+static int remove_txn (OMTVALUE hv, uint32_t UU(idx), void *txnv)
 // Effect:  This function is called on every open FT that a transaction used.
 //  This function removes the transaction from that FT.
 {
@@ -454,7 +454,7 @@ XIDS toku_txn_get_xids (TOKUTXN txn) {
 }
 
 void toku_txn_force_fsync_on_commit(TOKUTXN txn) {
-    txn->force_fsync_on_commit = TRUE;
+    txn->force_fsync_on_commit = true;
 }
 
 TXNID toku_get_oldest_in_live_root_txn_list(TOKUTXN txn) {
@@ -471,7 +471,7 @@ bool toku_is_txn_in_live_root_txn_list(const xid_omt_t &live_root_txn_list, TXNI
     int r = live_root_txn_list.find_zero<TXNID, toku_find_xid_by_xid>(xid, &txnid, nullptr);
     if (r==0) {
         invariant(txnid == xid);
-        retval = TRUE;
+        retval = true;
     }
     else {
         invariant(r==DB_NOTFOUND);
diff --git a/ft/txn.h b/ft/txn.h
index a7b9d3f42b940f2db7f99fc014af8b9e712a9aad..07a391a4d862f0563ea731e97c15843e6f8277a6 100644
--- a/ft/txn.h
+++ b/ft/txn.h
@@ -12,7 +12,7 @@
 void toku_txn_lock(TOKUTXN txn);
 void toku_txn_unlock(TOKUTXN txn);
 
-u_int64_t toku_txn_get_id(TOKUTXN txn);
+uint64_t toku_txn_get_id(TOKUTXN txn);
 
 int toku_txn_begin_txn (
     DB_TXN  *container_db_txn,
@@ -44,7 +44,7 @@ int toku_txn_load_txninfo (TOKUTXN txn, TXNINFO info);
 
 int toku_txn_commit_txn (TOKUTXN txn, int nosync,
                          TXN_PROGRESS_POLL_FUNCTION poll, void *poll_extra);
-BOOL toku_txn_requires_checkpoint(TOKUTXN txn);
+bool toku_txn_requires_checkpoint(TOKUTXN txn);
 int toku_txn_commit_with_lsn(TOKUTXN txn, int nosync, LSN oplsn,
                              TXN_PROGRESS_POLL_FUNCTION poll, void *poll_extra);
 
@@ -59,9 +59,9 @@ int toku_txn_prepare_txn (TOKUTXN txn, TOKU_XA_XID *xid) __attribute__((warn_unu
 void toku_txn_get_prepared_xa_xid (TOKUTXN, TOKU_XA_XID *);
 // Effect: Fill in the XID information for a transaction.  The caller allocates the XID and the function fills in values.
 
-int toku_txn_maybe_fsync_log(TOKULOGGER logger, LSN do_fsync_lsn, BOOL do_fsync);
+int toku_txn_maybe_fsync_log(TOKULOGGER logger, LSN do_fsync_lsn, bool do_fsync);
 
-void toku_txn_get_fsync_info(TOKUTXN ttxn, BOOL* do_fsync, LSN* do_fsync_lsn);
+void toku_txn_get_fsync_info(TOKUTXN ttxn, bool* do_fsync, LSN* do_fsync_lsn);
 
 // Complete and destroy a txn
 void toku_txn_close_txn(TOKUTXN txn);
@@ -91,7 +91,7 @@ typedef enum {
 } txn_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[TXN_STATUS_NUM_ROWS];
 } TXN_STATUS_S, *TXN_STATUS;
 
@@ -109,7 +109,7 @@ struct tokulogger_preplist {
     TOKU_XA_XID xid;
     DB_TXN *txn;
 };
-int toku_logger_recover_txn (TOKULOGGER logger, struct tokulogger_preplist preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags);
+int toku_logger_recover_txn (TOKULOGGER logger, struct tokulogger_preplist preplist[/*count*/], long count, /*out*/ long *retp, uint32_t flags);
 
 void toku_maybe_log_begin_txn_for_write_operation(TOKUTXN txn);
 
diff --git a/ft/txn_manager.cc b/ft/txn_manager.cc
index 1feb262c7a4b86493e5990a05b83cfe2116d4eca..37fddcb91a38b4c3681585db585f45b6b45ba257 100644
--- a/ft/txn_manager.cc
+++ b/ft/txn_manager.cc
@@ -14,10 +14,10 @@
 #include "omt-tmpl.h"
 #include "rollback.h"
 
-BOOL garbage_collection_debug = FALSE;
+bool garbage_collection_debug = false;
 
 
-static BOOL is_txnid_live(TXN_MANAGER txn_manager, TXNID txnid) {
+static bool is_txnid_live(TXN_MANAGER txn_manager, TXNID txnid) {
     TOKUTXN result = NULL;
     toku_txn_manager_id2txn_unlocked(txn_manager, txnid, &result);
     return (result != NULL);
@@ -156,7 +156,7 @@ verify_snapshot_system(TXN_MANAGER txn_manager UU()) {
         for (i = 0; i < num_live_txns; i++) {
             TOKUTXN txn = live_txns[i];
 
-            BOOL expect = txn->snapshot_txnid64 == txn->txnid64;
+            bool expect = txn->snapshot_txnid64 == txn->txnid64;
             {
                 //verify pair->xid2 is in snapshot_xids
                 r = txn_manager->snapshot_txnids.find_zero<TXNID, toku_find_xid_by_xid>(txn->txnid64, nullptr, nullptr);
@@ -369,7 +369,7 @@ int toku_txn_manager_start_txn(
                 txn->live_root_txn_list = parent->live_root_txn_list;
             }
             else {
-                assert(FALSE);
+                assert(false);
             }
         }
     }
@@ -469,7 +469,7 @@ void toku_txn_manager_finish_txn(TXN_MANAGER txn_manager, TOKUTXN txn) {
     {
         //Remove txn from list (omt) of live transactions
         TOKUTXN txnagain;
-        u_int32_t idx;
+        uint32_t idx;
         r = txn_manager->live_txns.find_zero<TOKUTXN, find_xid>(txn, &txnagain, &idx);
         invariant_zero(r);
         invariant(txn==txnagain);
@@ -497,7 +497,7 @@ void toku_txn_manager_finish_txn(TXN_MANAGER txn_manager, TOKUTXN txn) {
 
     if (txn->parent==NULL) {
         TXNID xid;
-        u_int32_t idx;
+        uint32_t idx;
         //Remove txn from list of live root txns
         r = txn_manager->live_root_txns.find_zero<TXNID, toku_find_xid_by_xid>(txn->txnid64, &xid, &idx);
         invariant_zero(r);
@@ -598,7 +598,7 @@ int toku_txn_manager_get_txn_from_xid (TXN_MANAGER txn_manager, TOKU_XA_XID *xid
     return ret_val;
 }
 
-u_int32_t toku_txn_manager_num_live_txns(TXN_MANAGER txn_manager) {
+uint32_t toku_txn_manager_num_live_txns(TXN_MANAGER txn_manager) {
     int ret_val = 0;
     toku_mutex_lock(&txn_manager->txn_manager_lock);
     ret_val = txn_manager->live_txns.size();
@@ -692,7 +692,7 @@ int toku_txn_manager_recover_txn (
     struct tokulogger_preplist preplist[/*count*/], 
     long count, 
     long *retp, /*out*/ 
-    u_int32_t flags
+    uint32_t flags
     )
 {
     int ret_val = 0;
diff --git a/ft/txn_manager.h b/ft/txn_manager.h
index 28f3a23fcd8a247b3fa73f9cb7f28755f36cb1b2..f09dcdb96d6f396d6baed01a906a26ca7ea761ee 100644
--- a/ft/txn_manager.h
+++ b/ft/txn_manager.h
@@ -95,7 +95,7 @@ int toku_txn_manager_recover_txn(
     struct tokulogger_preplist preplist[/*count*/],
     long count,
     long *retp, /*out*/
-    u_int32_t flags
+    uint32_t flags
     );
 
 void toku_txn_manager_pin_live_txn_unlocked(TXN_MANAGER txn_manager, TOKUTXN txn);
diff --git a/ft/ule.cc b/ft/ule.cc
index 1b6a7ef4e587d9719a16c512fb88c9d156fa0736..3914bc190b1b86abd57cb4d3966e0530cde9f611 100644
--- a/ft/ule.cc
+++ b/ft/ule.cc
@@ -120,18 +120,18 @@ const UXR_S committed_delete = {
 
 static void msg_init_empty_ule(ULE ule, FT_MSG msg);
 static void msg_modify_ule(ULE ule, FT_MSG msg);
-static void ule_init_empty_ule(ULE ule, u_int32_t keylen, void * keyp);
+static void ule_init_empty_ule(ULE ule, uint32_t keylen, void * keyp);
 static void ule_do_implicit_promotions(ULE ule, XIDS xids);
 static void ule_promote_provisional_innermost_to_index(ULE ule, uint32_t index);
 static void ule_promote_provisional_innermost_to_committed(ULE ule);
-static void ule_apply_insert(ULE ule, XIDS xids, u_int32_t vallen, void * valp);
+static void ule_apply_insert(ULE ule, XIDS xids, uint32_t vallen, void * valp);
 static void ule_apply_delete(ULE ule, XIDS xids);
 static void ule_prepare_for_new_uxr(ULE ule, XIDS xids);
 static void ule_apply_abort(ULE ule, XIDS xids);
 static void ule_apply_broadcast_commit_all (ULE ule);
 static void ule_apply_commit(ULE ule, XIDS xids);
-static void ule_push_insert_uxr(ULE ule, BOOL is_committed, TXNID xid, u_int32_t vallen, void * valp);
-static void ule_push_delete_uxr(ULE ule, BOOL is_committed, TXNID xid);
+static void ule_push_insert_uxr(ULE ule, bool is_committed, TXNID xid, uint32_t vallen, void * valp);
+static void ule_push_delete_uxr(ULE ule, bool is_committed, TXNID xid);
 static void ule_push_placeholder_uxr(ULE ule, TXNID xid);
 static UXR ule_get_innermost_uxr(ULE ule);
 static UXR ule_get_first_empty_uxr(ULE ule);
@@ -141,9 +141,9 @@ static TXNID ule_get_xid(ULE ule, uint32_t index);
 static void ule_remove_innermost_placeholders(ULE ule);
 static void ule_add_placeholders(ULE ule, XIDS xids);
 static void ule_optimize(ULE ule, XIDS xids);
-static inline BOOL uxr_type_is_insert(u_int8_t type);
-static inline BOOL uxr_type_is_delete(u_int8_t type);
-static inline BOOL uxr_type_is_placeholder(u_int8_t type);
+static inline bool uxr_type_is_insert(uint8_t type);
+static inline bool uxr_type_is_delete(uint8_t type);
+static inline bool uxr_type_is_placeholder(uint8_t type);
 static inline size_t uxr_pack_txnid(UXR uxr, uint8_t *p);
 static inline size_t uxr_pack_type_and_length(UXR uxr, uint8_t *p);
 static inline size_t uxr_pack_length_and_bit(UXR uxr, uint8_t *p);
@@ -187,16 +187,16 @@ get_next_older_txnid(TXNID xc, const xid_omt_t &omt) {
 }
 
 //
-// This function returns TRUE if live transaction TL1 is allowed to read a value committed by
+// This function returns true if live transaction TL1 is allowed to read a value committed by
 // transaction xc, false otherwise.
 //
-static BOOL
+static bool
 xid_reads_committed_xid(TXNID tl1, TXNID xc, const xid_omt_t &snapshot_txnids, const rx_omt_t &referenced_xids) {
-    BOOL rval;
-    if (tl1 < xc) rval = FALSE; //cannot read a newer txn
+    bool rval;
+    if (tl1 < xc) rval = false; //cannot read a newer txn
     else {
         TXNID x = toku_get_youngest_live_list_txnid_for(xc, snapshot_txnids, referenced_xids);
-        if (x == TXNID_NONE) rval = TRUE; //Not in ANY live list, tl1 can read it.
+        if (x == TXNID_NONE) rval = true; //Not in ANY live list, tl1 can read it.
         else rval = tl1 > x;              //Newer than the 'newest one that has it in live list'
         // we know tl1 > xc
         // we know x > xc
@@ -211,8 +211,8 @@ static void
 garbage_collection(ULE ule, const xid_omt_t &snapshot_xids, const rx_omt_t &referenced_xids, const xid_omt_t &live_root_txns) {
     if (ule->num_cuxrs == 1) goto done;
     // will fail if too many num_cuxrs
-    BOOL necessary_static[MAX_TRANSACTION_RECORDS];
-    BOOL *necessary;
+    bool necessary_static[MAX_TRANSACTION_RECORDS];
+    bool *necessary;
     necessary = necessary_static;
     if (ule->num_cuxrs >= MAX_TRANSACTION_RECORDS) {
         XMALLOC_N(ule->num_cuxrs, necessary);
@@ -221,9 +221,9 @@ garbage_collection(ULE ule, const xid_omt_t &snapshot_xids, const rx_omt_t &refe
 
     uint32_t curr_committed_entry;
     curr_committed_entry = ule->num_cuxrs - 1;
-    while (TRUE) {
+    while (true) {
         // mark the curr_committed_entry as necessary
-        necessary[curr_committed_entry] = TRUE;
+        necessary[curr_committed_entry] = true;
         if (curr_committed_entry == 0) break; //nothing left
 
         // find the youngest live transaction that reads something 
@@ -240,7 +240,7 @@ garbage_collection(ULE ule, const xid_omt_t &snapshot_xids, const rx_omt_t &refe
         // As a result, we must mark what is just below xc as necessary and move on.
         // This issue was found while testing flusher threads, and was fixed for #3979
         //
-        BOOL is_xc_live = toku_is_txn_in_live_root_txn_list(live_root_txns, xc);
+        bool is_xc_live = toku_is_txn_in_live_root_txn_list(live_root_txns, xc);
         if (is_xc_live) {
             curr_committed_entry--;
             continue;            
@@ -404,7 +404,7 @@ garbage_collect_leafentry(LEAFENTRY old_leaf_entry,
 // 
 static void 
 msg_init_empty_ule(ULE ule, FT_MSG msg) {   
-    u_int32_t keylen = ft_msg_get_keylen(msg);
+    uint32_t keylen = ft_msg_get_keylen(msg);
     void     *keyp   = ft_msg_get_key(msg);
     ule_init_empty_ule(ule, keylen, keyp);
 }
@@ -439,7 +439,7 @@ msg_modify_ule(ULE ule, FT_MSG msg) {
         // show why this is necessary. We need to update the key with the exact
         // bytes of the message
         update_ule_key(ule, msg);
-        u_int32_t vallen = ft_msg_get_vallen(msg);
+        uint32_t vallen = ft_msg_get_vallen(msg);
         invariant(IS_VALID_LEN(vallen));
         void * valp      = ft_msg_get_val(msg);
         ule_apply_insert(ule, xids, vallen, valp);
@@ -465,10 +465,10 @@ msg_modify_ule(ULE ule, FT_MSG msg) {
         break;
     case FT_UPDATE:
     case FT_UPDATE_BROADCAST_ALL:
-        assert(FALSE); // These messages don't get this far.  Instead they get translated (in setval_fun in do_update) into FT_INSERT messages.
+        assert(false); // These messages don't get this far.  Instead they get translated (in setval_fun in do_update) into FT_INSERT messages.
         break;
     default:
-        assert(FALSE /* illegal FT_MSG.type */);
+        assert(false /* illegal FT_MSG.type */);
         break;
     }
 }
@@ -602,12 +602,12 @@ le_unpack(ULE ule, LEAFENTRY le) {
             }
             break;
         default:
-            invariant(FALSE);
+            invariant(false);
     }
     
 #if ULE_DEBUG
     size_t memsize = le_memsize_from_ule(ule);
-    assert(p == ((u_int8_t*)le) + memsize);
+    assert(p == ((uint8_t*)le) + memsize);
 #endif
 }
 
@@ -746,7 +746,7 @@ found_insert:;
     new_leafentry->keylen  = toku_htod32(ule->keylen);
 
     //p always points to first unused byte after leafentry we are packing
-    u_int8_t *p;
+    uint8_t *p;
     invariant(ule->num_cuxrs>0);
     //Type specific data
     if (ule->num_cuxrs == 1 && ule->num_puxrs == 0) {
@@ -776,7 +776,7 @@ found_insert:;
         // check should be "< MAX_TRANSACTION_RECORDS" or
         // "< MAX_TRANSACTION_RECORDS - 1"
         invariant(ule->num_puxrs < MAX_TRANSACTION_RECORDS);
-        new_leafentry->u.mvcc.num_pxrs = (u_int8_t)ule->num_puxrs;
+        new_leafentry->u.mvcc.num_pxrs = (uint8_t)ule->num_puxrs;
 
         //Store actual key.
         memcpy(new_leafentry->u.mvcc.key_xrs, ule->keyp, ule->keylen);
@@ -995,7 +995,7 @@ leafentry_memsize (LEAFENTRY le) {
             break;
         }
         default:
-            invariant(FALSE);
+            invariant(false);
     }
 #if ULE_DEBUG
     ULE_S ule;
@@ -1017,19 +1017,19 @@ leafentry_disksize (LEAFENTRY le) {
     return leafentry_memsize(le);
 }
 
-BOOL
+bool
 le_is_clean(LEAFENTRY le) {
     uint8_t  type = le->type;
     uint32_t rval;
     switch (type) {
         case LE_CLEAN:
-            rval = TRUE;
+            rval = true;
             break;
         case LE_MVCC:;
-            rval = FALSE;
+            rval = false;
             break;
         default:
-            invariant(FALSE);
+            invariant(false);
     }
     return rval;
 }
@@ -1064,7 +1064,7 @@ int le_latest_is_del(LEAFENTRY le) {
             break;
         }
         default:
-            invariant(FALSE);
+            invariant(false);
     }
 #if ULE_DEBUG
     ULE_S ule;
@@ -1084,7 +1084,7 @@ int le_latest_is_del(LEAFENTRY le) {
 // It is used to determine if a broadcast commit/abort message (look in ft-ops.c)  should be applied to this leafentry
 // If the outermost transactions match, then the broadcast commit/abort should be applied
 //
-BOOL
+bool
 le_has_xids(LEAFENTRY le, XIDS xids) {
     //Read num_uxrs
     uint32_t num_xids = xids_get_num_xids(xids);
@@ -1092,19 +1092,19 @@ le_has_xids(LEAFENTRY le, XIDS xids) {
     TXNID xid = xids_get_xid(xids, 0);
     invariant(xid!=TXNID_NONE);
 
-    BOOL rval = (le_outermost_uncommitted_xid(le) == xid);
+    bool rval = (le_outermost_uncommitted_xid(le) == xid);
     return rval;
 }
 
-u_int32_t
+uint32_t
 le_latest_keylen (LEAFENTRY le) {
-    u_int32_t rval;
+    uint32_t rval;
     rval = le_latest_is_del(le) ? 0 : le_keylen(le);
 #if ULE_DEBUG
     ULE_S ule;
     le_unpack(&ule, le);
     UXR uxr = ule_get_innermost_uxr(&ule);
-    u_int32_t slow_rval;
+    uint32_t slow_rval;
     if (uxr_is_insert(uxr)) {
         slow_rval = ule.keylen;
     }
@@ -1118,7 +1118,7 @@ le_latest_keylen (LEAFENTRY le) {
 }
 
 void*
-le_latest_val_and_len (LEAFENTRY le, u_int32_t *len) {
+le_latest_val_and_len (LEAFENTRY le, uint32_t *len) {
     uint32_t keylen = toku_dtoh32(le->keylen);
     uint8_t  type = le->type;
     void *valp;
@@ -1157,14 +1157,14 @@ le_latest_val_and_len (LEAFENTRY le, u_int32_t *len) {
             }
             break;
         default:
-            invariant(FALSE);
+            invariant(false);
     }
 #if ULE_DEBUG
     ULE_S ule;
     le_unpack(&ule, le);
     UXR uxr = ule_get_innermost_uxr(&ule);
     void     *slow_valp;
-    u_int32_t slow_len;
+    uint32_t slow_len;
     if (uxr_is_insert(uxr)) {
         slow_valp = uxr->valp;
         slow_len  = uxr->vallen; 
@@ -1198,9 +1198,9 @@ le_latest_val (LEAFENTRY le) {
 }
 
 //needed to be fast for statistics.
-u_int32_t
+uint32_t
 le_latest_vallen (LEAFENTRY le) {
-    u_int32_t rval;
+    uint32_t rval;
     uint32_t keylen = toku_dtoh32(le->keylen);
     uint8_t  type = le->type;
     uint8_t *p;
@@ -1234,13 +1234,13 @@ le_latest_vallen (LEAFENTRY le) {
             }
             break;
         default:
-            invariant(FALSE);
+            invariant(false);
     }
 #if ULE_DEBUG
     ULE_S ule;
     le_unpack(&ule, le);
     UXR uxr = ule_get_innermost_uxr(&ule);
-    u_int32_t slow_rval;
+    uint32_t slow_rval;
     if (uxr_is_insert(uxr))
         slow_rval = uxr->vallen;
     else
@@ -1253,7 +1253,7 @@ le_latest_vallen (LEAFENTRY le) {
 
 //Return key and keylen unconditionally
 void*
-le_key_and_len (LEAFENTRY le, u_int32_t *len) {
+le_key_and_len (LEAFENTRY le, uint32_t *len) {
     *len = toku_dtoh32(le->keylen);
     uint8_t  type = le->type;
 
@@ -1266,13 +1266,13 @@ le_key_and_len (LEAFENTRY le, u_int32_t *len) {
             keyp = le->u.mvcc.key_xrs;
             break;
         default:
-            invariant(FALSE);
+            invariant(false);
     }
 #if ULE_DEBUG
     ULE_S ule;
     le_unpack(&ule, le);
     void     *slow_keyp;
-    u_int32_t slow_len;
+    uint32_t slow_len;
     slow_keyp = ule.keyp;
     slow_len  = ule.keylen; 
     assert(slow_keyp == le_key(le));
@@ -1299,7 +1299,7 @@ le_key (LEAFENTRY le) {
             rval = le->u.mvcc.key_xrs;
             break;
         default:
-            invariant(FALSE);
+            invariant(false);
     }
 #if ULE_DEBUG
     ULE_S ule;
@@ -1311,13 +1311,13 @@ le_key (LEAFENTRY le) {
     return rval;
 }
 
-u_int32_t
+uint32_t
 le_keylen (LEAFENTRY le) {
-    u_int32_t rval = toku_dtoh32(le->keylen);
+    uint32_t rval = toku_dtoh32(le->keylen);
 #if ULE_DEBUG
     ULE_S ule;
     le_unpack(&ule, le);
-    u_int32_t slow_rval = ule.keylen;
+    uint32_t slow_rval = ule.keylen;
     assert(rval==slow_rval);
     ule_cleanup(&ule);
 #endif
@@ -1325,7 +1325,7 @@ le_keylen (LEAFENTRY le) {
 }
 
 
-u_int64_t 
+uint64_t 
 le_outermost_uncommitted_xid (LEAFENTRY le) {
     uint64_t rval = TXNID_NONE;
 
@@ -1400,7 +1400,7 @@ print_leafentry (FILE *outf, LEAFENTRY le) {
 // ule constructor
 // Note that transaction 0 is explicit in the ule
 static void 
-ule_init_empty_ule(ULE ule, u_int32_t keylen, void * keyp) {
+ule_init_empty_ule(ULE ule, uint32_t keylen, void * keyp) {
     ule->num_cuxrs = 1;
     ule->num_puxrs = 0;
     ule->keylen    = keylen;
@@ -1481,10 +1481,10 @@ ule_promote_provisional_innermost_to_committed(ULE ule) {
 
     ule->num_puxrs = 0; //Discard all provisional uxrs.
     if (uxr_is_delete(old_innermost_uxr)) {
-        ule_push_delete_uxr(ule, TRUE, old_outermost_uncommitted_uxr->xid);
+        ule_push_delete_uxr(ule, true, old_outermost_uncommitted_uxr->xid);
     }
     else {
-        ule_push_insert_uxr(ule, TRUE,
+        ule_push_insert_uxr(ule, true,
                             old_outermost_uncommitted_uxr->xid,
                             old_innermost_uxr->vallen,
                             old_innermost_uxr->valp);
@@ -1505,10 +1505,10 @@ ule_promote_provisional_innermost_to_index(ULE ule, uint32_t index) {
     TXNID new_innermost_xid = ule->uxrs[index].xid;
     ule->num_puxrs = index - ule->num_cuxrs; //Discard old uxr at index (and everything inner)
     if (uxr_is_delete(old_innermost_uxr)) {
-        ule_push_delete_uxr(ule, FALSE, new_innermost_xid);
+        ule_push_delete_uxr(ule, false, new_innermost_xid);
     }
     else {
-        ule_push_insert_uxr(ule, FALSE,
+        ule_push_insert_uxr(ule, false,
                             new_innermost_xid,
                             old_innermost_uxr->vallen,
                             old_innermost_uxr->valp);
@@ -1523,7 +1523,7 @@ ule_promote_provisional_innermost_to_index(ULE ule, uint32_t index) {
 
 // Purpose is to apply an insert message to this leafentry:
 static void 
-ule_apply_insert(ULE ule, XIDS xids, u_int32_t vallen, void * valp) {
+ule_apply_insert(ULE ule, XIDS xids, uint32_t vallen, void * valp) {
     ule_prepare_for_new_uxr(ule, xids);
     TXNID this_xid = xids_get_innermost_xid(xids);  // xid of transaction doing this insert
     ule_push_insert_uxr(ule, this_xid == TXNID_NONE, this_xid, vallen, valp);
@@ -1612,7 +1612,7 @@ void ule_apply_commit(ULE ule, XIDS xids) {
 
 // Purpose is to record an insert for this transaction (and set type correctly).
 static void 
-ule_push_insert_uxr(ULE ule, BOOL is_committed, TXNID xid, u_int32_t vallen, void * valp) {
+ule_push_insert_uxr(ULE ule, bool is_committed, TXNID xid, uint32_t vallen, void * valp) {
     UXR uxr     = ule_get_first_empty_uxr(ule);
     if (is_committed) {
         invariant(ule->num_puxrs==0);
@@ -1631,7 +1631,7 @@ ule_push_insert_uxr(ULE ule, BOOL is_committed, TXNID xid, u_int32_t vallen, voi
 // is the root transaction, then truly delete the leafentry by marking the 
 // ule as empty.
 static void 
-ule_push_delete_uxr(ULE ule, BOOL is_committed, TXNID xid) {
+ule_push_delete_uxr(ULE ule, bool is_committed, TXNID xid) {
     UXR uxr     = ule_get_first_empty_uxr(ule);
     if (is_committed) {
         invariant(ule->num_puxrs==0);
@@ -1739,7 +1739,7 @@ ule_add_placeholders(ULE ule, XIDS xids) {
     TXNID this_xid = xids_get_innermost_xid(xids); // xid of this transaction
     invariant(this_xid!=TXNID_NONE);
     if (ica_xid != this_xid) {		// if this transaction is the ICA, don't push any placeholders
-        u_int8_t index = outermost_xid_not_in_ule(ule, xids);
+        uint8_t index = outermost_xid_not_in_ule(ule, xids);
 	TXNID    current_msg_xid = xids_get_xid(xids, index);
 	while (current_msg_xid != this_xid) { // Placeholder for each transaction before this transaction
 	    ule_push_placeholder_uxr(ule, current_msg_xid);
@@ -1812,35 +1812,35 @@ ule_get_innermost_numbytes(ULE ule) {
 //  This layer of abstraction (uxr_xxx) understands uxr and nothing else.
 //
 
-static inline BOOL
-uxr_type_is_insert(u_int8_t type) {
-    BOOL rval = (BOOL)(type == XR_INSERT);
+static inline bool
+uxr_type_is_insert(uint8_t type) {
+    bool rval = (bool)(type == XR_INSERT);
     return rval;
 }
 
-BOOL
+bool
 uxr_is_insert(UXR uxr) {
     return uxr_type_is_insert(uxr->type);
 }
 
-static inline BOOL
-uxr_type_is_delete(u_int8_t type) {
-    BOOL rval = (BOOL)(type == XR_DELETE);
+static inline bool
+uxr_type_is_delete(uint8_t type) {
+    bool rval = (bool)(type == XR_DELETE);
     return rval;
 }
 
-BOOL
+bool
 uxr_is_delete(UXR uxr) {
     return uxr_type_is_delete(uxr->type);
 }
 
-static inline BOOL
-uxr_type_is_placeholder(u_int8_t type) {
-    BOOL rval = (BOOL)(type == XR_PLACEHOLDER);
+static inline bool
+uxr_type_is_placeholder(uint8_t type) {
+    bool rval = (bool)(type == XR_PLACEHOLDER);
     return rval;
 }
 
-BOOL
+bool
 uxr_is_placeholder(UXR uxr) {
     return uxr_type_is_placeholder(uxr->type);
 }
@@ -1896,7 +1896,7 @@ ule_verify_xids(ULE ule, uint32_t interesting, TXNID *xids) {
 
 //
 // Iterates over "possible" TXNIDs in a leafentry's stack, until one is accepted by 'f'. If the value 
-// associated with the accepted TXNID is not an insert, then set *is_emptyp to TRUE, otherwise FALSE
+// associated with the accepted TXNID is not an insert, then set *is_emptyp to true, otherwise false
 // The "possible" TXNIDs are:
 //   if provisionals exist, then the first possible TXNID is the outermost provisional.
 //   The next possible TXNIDs are the committed TXNIDs, from most recently committed to T_0.
@@ -1909,7 +1909,7 @@ ule_verify_xids(ULE ule, uint32_t interesting, TXNID *xids) {
 //    context - parameter for f
 //
 int
-le_iterate_is_del(LEAFENTRY le, LE_ITERATE_CALLBACK f, BOOL *is_delp, TOKUTXN context) {
+le_iterate_is_del(LEAFENTRY le, LE_ITERATE_CALLBACK f, bool *is_delp, TOKUTXN context) {
 #if ULE_DEBUG
     ULE_S ule;
     le_unpack(&ule, le);
@@ -1918,7 +1918,7 @@ le_iterate_is_del(LEAFENTRY le, LE_ITERATE_CALLBACK f, BOOL *is_delp, TOKUTXN co
     //Read the keylen
     uint8_t type = le->type;
     int r;
-    BOOL is_del = FALSE;
+    bool is_del = false;
     switch (type) {
         case LE_CLEAN: {
             r = 0;
@@ -1969,7 +1969,7 @@ le_iterate_is_del(LEAFENTRY le, LE_ITERATE_CALLBACK f, BOOL *is_delp, TOKUTXN co
 #endif
             break;
         default:
-            invariant(FALSE);
+            invariant(false);
     }
 cleanup:
 #if ULE_DEBUG
@@ -1995,7 +1995,7 @@ le_iterate_is_del(LEAFENTRY le, LE_ITERATE_CALLBACK f, BOOL *is_delp, TOKUTXN co
 //    context - parameter for f
 //
 int
-le_iterate_val(LEAFENTRY le, LE_ITERATE_CALLBACK f, void** valpp, u_int32_t *vallenp, TOKUTXN context) {
+le_iterate_val(LEAFENTRY le, LE_ITERATE_CALLBACK f, void** valpp, uint32_t *vallenp, TOKUTXN context) {
 #if ULE_DEBUG
     ULE_S ule;
     le_unpack(&ule, le);
@@ -2088,7 +2088,7 @@ verify_is_empty:;
             }
             break;
         default:
-            invariant(FALSE);
+            invariant(false);
     }
 cleanup:
 #if ULE_DEBUG
@@ -2155,23 +2155,23 @@ le_committed_mvcc(uint8_t *key, uint32_t keylen,
 // This is an on-disk format.  static_asserts verify everything is packed and aligned correctly.
 struct __attribute__ ((__packed__)) leafentry_13 {
     struct leafentry_committed_13 {
-        u_int8_t key_val[0];     //Actual key, then actual val
+        uint8_t key_val[0];     //Actual key, then actual val
     };
     static_assert(0 == sizeof(leafentry_committed_13), "wrong size");
     static_assert(0 == __builtin_offsetof(leafentry_committed_13, key_val), "wrong offset");
     struct __attribute__ ((__packed__)) leafentry_provisional_13 {
-        u_int8_t innermost_type;
+        uint8_t innermost_type;
         TXNID    xid_outermost_uncommitted;
-        u_int8_t key_val_xrs[0];  //Actual key,
+        uint8_t key_val_xrs[0];  //Actual key,
         //then actual innermost inserted val,
         //then transaction records.
     };
     static_assert(9 == sizeof(leafentry_provisional_13), "wrong size");
     static_assert(9 == __builtin_offsetof(leafentry_provisional_13, key_val_xrs), "wrong offset");
 
-    u_int8_t  num_xrs;
-    u_int32_t keylen;
-    u_int32_t innermost_inserted_vallen;
+    uint8_t  num_xrs;
+    uint32_t keylen;
+    uint32_t innermost_inserted_vallen;
     union __attribute__ ((__packed__)) {
         struct leafentry_committed_13 comm;
         struct leafentry_provisional_13 prov;
@@ -2204,7 +2204,7 @@ le_memsize_from_ule_13 (ULE ule) {
               +ule->keylen          //actual key
               +1*num_uxrs      //types
               +8*(num_uxrs-1); //txnids
-        u_int8_t i;
+        uint8_t i;
         for (i = 0; i < num_uxrs; i++) {
             UXR uxr = &ule->uxrs[i];
             if (uxr_is_insert(uxr)) {
@@ -2237,9 +2237,9 @@ le_unpack_13(ULE ule, LEAFENTRY_13 le) {
     ule->keylen = toku_dtoh32(le->keylen);
 
     //Read the vallen of innermost insert
-    u_int32_t vallen_of_innermost_insert = toku_dtoh32(le->innermost_inserted_vallen);
+    uint32_t vallen_of_innermost_insert = toku_dtoh32(le->innermost_inserted_vallen);
 
-    u_int8_t *p;
+    uint8_t *p;
     if (num_xrs == 1) {
         //Unpack a 'committed leafentry' (No uncommitted transactions exist)
         ule->keyp           = le->u.comm.key_val;
@@ -2255,7 +2255,7 @@ le_unpack_13(ULE ule, LEAFENTRY_13 le) {
         //Unpack a 'provisional leafentry' (Uncommitted transactions exist)
 
         //Read in type.
-        u_int8_t innermost_type = le->u.prov.innermost_type;
+        uint8_t innermost_type = le->u.prov.innermost_type;
         assert(!uxr_type_is_placeholder(innermost_type));
 
         //Read in xid
@@ -2265,12 +2265,12 @@ le_unpack_13(ULE ule, LEAFENTRY_13 le) {
         ule->keyp = le->u.prov.key_val_xrs;
 
         //Read pointer to innermost inserted val (immediately after key)
-        u_int8_t *valp_of_innermost_insert = &le->u.prov.key_val_xrs[ule->keylen];
+        uint8_t *valp_of_innermost_insert = &le->u.prov.key_val_xrs[ule->keylen];
 
         //Point p to immediately after 'header'
         p = &le->u.prov.key_val_xrs[ule->keylen + vallen_of_innermost_insert];
 
-        BOOL found_innermost_insert = FALSE;
+        bool found_innermost_insert = false;
         int i; //Index in ULE.uxrs[]
         //Loop inner to outer
         for (i = num_xrs - 1; i >= 0; i--) {
@@ -2306,7 +2306,7 @@ le_unpack_13(ULE ule, LEAFENTRY_13 le) {
             if (uxr_is_insert(uxr)) {
                 if (found_innermost_insert) {
                     //Not the innermost insert.  Load vallen/valp
-                    uxr->vallen = toku_dtoh32(*(u_int32_t*)p);
+                    uxr->vallen = toku_dtoh32(*(uint32_t*)p);
                     p += 4;
 
                     uxr->valp = p;
@@ -2316,7 +2316,7 @@ le_unpack_13(ULE ule, LEAFENTRY_13 le) {
                     //Innermost insert, load the vallen/valp previously read from header
                     uxr->vallen = vallen_of_innermost_insert;
                     uxr->valp   = valp_of_innermost_insert;
-                    found_innermost_insert = TRUE;
+                    found_innermost_insert = true;
                 }
             }
         }
@@ -2324,7 +2324,7 @@ le_unpack_13(ULE ule, LEAFENTRY_13 le) {
     }
 #if ULE_DEBUG
     size_t memsize = le_memsize_from_ule_13(ule);
-    assert(p == ((u_int8_t*)le) + memsize);
+    assert(p == ((uint8_t*)le) + memsize);
 #endif
 }
 
diff --git a/ft/ule.h b/ft/ule.h
index e4f91f872a94224cb84837cc59647a1873cec3f6..f1b8053c04064a55142e058b607b99cbf158e5fb 100644
--- a/ft/ule.h
+++ b/ft/ule.h
@@ -34,9 +34,9 @@ int ule_is_provisional(ULEHANDLE ule, uint64_t ith);
 void *ule_get_key(ULEHANDLE ule);
 uint32_t ule_get_keylen(ULEHANDLE ule);
 
-BOOL uxr_is_insert(UXRHANDLE uxr);
-BOOL uxr_is_delete(UXRHANDLE uxr);
-BOOL uxr_is_placeholder(UXRHANDLE uxr);
+bool uxr_is_insert(UXRHANDLE uxr);
+bool uxr_is_delete(UXRHANDLE uxr);
+bool uxr_is_placeholder(UXRHANDLE uxr);
 void *uxr_get_val(UXRHANDLE uxr);
 uint32_t uxr_get_vallen(UXRHANDLE uxr);
 TXNID uxr_get_txnid(UXRHANDLE uxr);
diff --git a/ft/wbuf.h b/ft/wbuf.h
index 777218d09af87fb2e6c932ebbceabcbd5400c525..a5d4756afb7c6cce205552945d6595f2b1b9a40c 100644
--- a/ft/wbuf.h
+++ b/ft/wbuf.h
@@ -50,7 +50,7 @@ static inline void wbuf_nocrc_char (struct wbuf *w, unsigned char ch) {
 }
 
 /* Write a character. */
-static inline void wbuf_nocrc_u_int8_t (struct wbuf *w, u_int8_t ch) {
+static inline void wbuf_nocrc_uint8_t (struct wbuf *w, uint8_t ch) {
     assert(w->ndone<w->size);
     w->buf[w->ndone++]=ch;
 }
@@ -64,7 +64,7 @@ static inline void wbuf_char (struct wbuf *w, unsigned char ch) {
 static void wbuf_network_int (struct wbuf *w, int32_t i) __attribute__((__unused__));
 static void wbuf_network_int (struct wbuf *w, int32_t i) {
     assert(w->ndone + 4 <= w->size);
-    *(u_int32_t*)(&w->buf[w->ndone]) = toku_htonl(i);
+    *(uint32_t*)(&w->buf[w->ndone]) = toku_htonl(i);
     x1764_add(&w->checksum, &w->buf[w->ndone], 4);
     w->ndone += 4;
 }
@@ -83,7 +83,7 @@ static inline void wbuf_nocrc_int (struct wbuf *w, int32_t i) {
     w->buf[w->ndone+2] = i>>8;
     w->buf[w->ndone+3] = i>>0;
  #else
-    *(u_int32_t*)(&w->buf[w->ndone]) = toku_htod32(i);
+    *(uint32_t*)(&w->buf[w->ndone]) = toku_htod32(i);
  #endif
     w->ndone += 4;
 #endif
@@ -94,15 +94,15 @@ static inline void wbuf_int (struct wbuf *w, int32_t i) {
     x1764_add(&w->checksum, &w->buf[w->ndone-4], 4);
 }
 
-static inline void wbuf_nocrc_uint (struct wbuf *w, u_int32_t i) {
+static inline void wbuf_nocrc_uint (struct wbuf *w, uint32_t i) {
     wbuf_nocrc_int(w, (int32_t)i);
 }
 
-static inline void wbuf_uint (struct wbuf *w, u_int32_t i) {
+static inline void wbuf_uint (struct wbuf *w, uint32_t i) {
     wbuf_int(w, (int32_t)i);
 }
 
-static inline void wbuf_nocrc_literal_bytes(struct wbuf *w, bytevec bytes_bv, u_int32_t nbytes) {
+static inline void wbuf_nocrc_literal_bytes(struct wbuf *w, bytevec bytes_bv, uint32_t nbytes) {
     const unsigned char *bytes = (const unsigned char *) bytes_bv;
 #if 0
     { int i; for (i=0; i<nbytes; i++) wbuf_nocrc_char(w, bytes[i]); }
@@ -113,42 +113,42 @@ static inline void wbuf_nocrc_literal_bytes(struct wbuf *w, bytevec bytes_bv, u_
 #endif
 }
 
-static inline void wbuf_literal_bytes(struct wbuf *w, bytevec bytes_bv, u_int32_t nbytes) {
+static inline void wbuf_literal_bytes(struct wbuf *w, bytevec bytes_bv, uint32_t nbytes) {
     wbuf_nocrc_literal_bytes(w, bytes_bv, nbytes);
     x1764_add(&w->checksum, &w->buf[w->ndone-nbytes], nbytes);
 }
 
-static void wbuf_nocrc_bytes (struct wbuf *w, bytevec bytes_bv, u_int32_t nbytes) {
+static void wbuf_nocrc_bytes (struct wbuf *w, bytevec bytes_bv, uint32_t nbytes) {
     wbuf_nocrc_uint(w, nbytes);
     wbuf_nocrc_literal_bytes(w, bytes_bv, nbytes);
 }
 
-static void wbuf_bytes (struct wbuf *w, bytevec bytes_bv, u_int32_t nbytes) {
+static void wbuf_bytes (struct wbuf *w, bytevec bytes_bv, uint32_t nbytes) {
     wbuf_uint(w, nbytes);
     wbuf_literal_bytes(w, bytes_bv, nbytes);
 }
 
-static void wbuf_nocrc_ulonglong (struct wbuf *w, u_int64_t ull) {
-    wbuf_nocrc_uint(w, (u_int32_t)(ull>>32));
-    wbuf_nocrc_uint(w, (u_int32_t)(ull&0xFFFFFFFF));
+static void wbuf_nocrc_ulonglong (struct wbuf *w, uint64_t ull) {
+    wbuf_nocrc_uint(w, (uint32_t)(ull>>32));
+    wbuf_nocrc_uint(w, (uint32_t)(ull&0xFFFFFFFF));
 }
 
-static void wbuf_ulonglong (struct wbuf *w, u_int64_t ull) {
-    wbuf_uint(w, (u_int32_t)(ull>>32));
-    wbuf_uint(w, (u_int32_t)(ull&0xFFFFFFFF));
+static void wbuf_ulonglong (struct wbuf *w, uint64_t ull) {
+    wbuf_uint(w, (uint32_t)(ull>>32));
+    wbuf_uint(w, (uint32_t)(ull&0xFFFFFFFF));
 }
 
-static inline void wbuf_nocrc_u_int64_t(struct wbuf *w, u_int64_t ull) {
+static inline void wbuf_nocrc_uint64_t(struct wbuf *w, uint64_t ull) {
     wbuf_nocrc_ulonglong(w, ull);
 }
 
 
-static inline void wbuf_u_int64_t(struct wbuf *w, u_int64_t ull) {
+static inline void wbuf_uint64_t(struct wbuf *w, uint64_t ull) {
     wbuf_ulonglong(w, ull);
 }
 
-static inline void wbuf_nocrc_BOOL (struct wbuf *w, BOOL b) {
-    wbuf_nocrc_u_int8_t(w, (u_int8_t)(b ? 1 : 0));
+static inline void wbuf_nocrc_bool (struct wbuf *w, bool b) {
+    wbuf_nocrc_uint8_t(w, (uint8_t)(b ? 1 : 0));
 }
 
 static inline void wbuf_nocrc_BYTESTRING (struct wbuf *w, BYTESTRING v) {
@@ -159,20 +159,20 @@ static inline void wbuf_BYTESTRING (struct wbuf *w, BYTESTRING v) {
     wbuf_bytes(w, v.data, v.len);
 }
 
-static inline void wbuf_u_int8_t (struct wbuf *w, u_int8_t v) {
+static inline void wbuf_uint8_t (struct wbuf *w, uint8_t v) {
     wbuf_char(w, v);
 }
 
-static inline void wbuf_nocrc_u_int32_t (struct wbuf *w, u_int32_t v) {
+static inline void wbuf_nocrc_uint32_t (struct wbuf *w, uint32_t v) {
     wbuf_nocrc_uint(w, v);
 }
 
-static inline void wbuf_u_int32_t (struct wbuf *w, u_int32_t v) {
+static inline void wbuf_uint32_t (struct wbuf *w, uint32_t v) {
     wbuf_uint(w, v);
 }
 
 static inline void wbuf_DISKOFF (struct wbuf *w, DISKOFF off) {
-    wbuf_ulonglong(w, (u_int64_t)off);
+    wbuf_ulonglong(w, (uint64_t)off);
 }
 
 static inline void wbuf_BLOCKNUM (struct wbuf *w, BLOCKNUM b) {
@@ -191,9 +191,9 @@ static inline void wbuf_TXNID (struct wbuf *w, TXNID tid) {
 }
 
 static inline void wbuf_nocrc_XIDP (struct wbuf *w, XIDP xid) {
-    wbuf_nocrc_u_int32_t(w, xid->formatID);
-    wbuf_nocrc_u_int8_t(w, xid->gtrid_length);
-    wbuf_nocrc_u_int8_t(w, xid->bqual_length);
+    wbuf_nocrc_uint32_t(w, xid->formatID);
+    wbuf_nocrc_uint8_t(w, xid->gtrid_length);
+    wbuf_nocrc_uint8_t(w, xid->bqual_length);
     wbuf_nocrc_literal_bytes(w, xid->data, xid->gtrid_length+xid->bqual_length);
 }
 
diff --git a/ft/x1764-speedup/x1764-speedup-test.cc b/ft/x1764-speedup/x1764-speedup-test.cc
index f6330a6cbb8ff9440fa9e6e63b5d4d46a0b941df..8b7157a339fff090ac54fb5b646e1fcf32718702 100644
--- a/ft/x1764-speedup/x1764-speedup-test.cc
+++ b/ft/x1764-speedup/x1764-speedup-test.cc
@@ -9,19 +9,19 @@
 #include <sys/time.h>
 #include <sys/types.h>
 
-u_int64_t x1764_simple (const u_int64_t *buf, size_t len)
+uint64_t x1764_simple (const uint64_t *buf, size_t len)
 {
-    u_int64_t sum=0;
+    uint64_t sum=0;
     for (size_t i=0; i<len ;i++) {
 	sum = sum*17 + buf[i];
     }
     return sum;
 }
 
-u_int64_t x1764_2x (const u_int64_t *buf, size_t len)
+uint64_t x1764_2x (const uint64_t *buf, size_t len)
 {
     assert(len%2==0);
-    u_int64_t suma=0, sumb=0;
+    uint64_t suma=0, sumb=0;
     for (size_t i=0; i<len ;i+=2) {
 	suma = suma*(17L*17L) + buf[i];
 	sumb = sumb*(17L*17L) + buf[i+1];
@@ -29,23 +29,23 @@ u_int64_t x1764_2x (const u_int64_t *buf, size_t len)
     return suma*17+sumb;
 }
 
-u_int64_t x1764_3x (const u_int64_t *buf, size_t len)
+uint64_t x1764_3x (const uint64_t *buf, size_t len)
 {
     assert(len%3==0);
-    u_int64_t suma=0, sumb=0, sumc=0;
+    uint64_t suma=0, sumb=0, sumc=0;
     for (size_t i=0; i<len ;i+=3) {
 	suma = suma*(17LL*17LL*17LL) + buf[i];
 	sumb = sumb*(17LL*17LL*17LL) + buf[i+1];
 	sumc = sumc*(17LL*17LL*17LL) + buf[i+2];
     }
-    u_int64_t r = suma*17L*17L + sumb*17L + sumc;
+    uint64_t r = suma*17L*17L + sumb*17L + sumc;
     return r;
 }
 
-u_int64_t x1764_4x (const u_int64_t *buf, size_t len)
+uint64_t x1764_4x (const uint64_t *buf, size_t len)
 {
     assert(len%4==0);
-    u_int64_t suma=0, sumb=0, sumc=0, sumd=0;
+    uint64_t suma=0, sumb=0, sumc=0, sumd=0;
     for (size_t i=0; i<len ;i+=4) {
 	suma = suma*(17LL*17LL*17LL*17LL) + buf[i];
 	sumb = sumb*(17LL*17LL*17LL*17LL) + buf[i+1];
@@ -67,13 +67,13 @@ int main (int argc, char *argv[]) {
 	struct timeval start,end,end2,end3,end4;
 	for (int i=0; i<size; i++) data[i]=i*i+j;
 	gettimeofday(&start, 0);
-	u_int64_t s = x1764_simple((u_int64_t*)data, size/sizeof(u_int64_t));
+	uint64_t s = x1764_simple((uint64_t*)data, size/sizeof(uint64_t));
 	gettimeofday(&end,   0);
-	u_int64_t s2 = x1764_2x((u_int64_t*)data, size/sizeof(u_int64_t));
+	uint64_t s2 = x1764_2x((uint64_t*)data, size/sizeof(uint64_t));
 	gettimeofday(&end2,   0);
-	u_int64_t s3 = x1764_3x((u_int64_t*)data, size/sizeof(u_int64_t));
+	uint64_t s3 = x1764_3x((uint64_t*)data, size/sizeof(uint64_t));
 	gettimeofday(&end3,   0);
-	u_int64_t s4 = x1764_4x((u_int64_t*)data, size/sizeof(u_int64_t));
+	uint64_t s4 = x1764_4x((uint64_t*)data, size/sizeof(uint64_t));
 	gettimeofday(&end4,   0);
 	assert(s==s2);
 	assert(s==s3);
diff --git a/ft/x1764.cc b/ft/x1764.cc
index 6181633ea08bcb94563b772b702c183b80d834a3..4790288e3d94847122f0bf61793f07af453f8e49 100644
--- a/ft/x1764.cc
+++ b/ft/x1764.cc
@@ -9,10 +9,10 @@
 #define PRINT 0
 
 
-u_int32_t x1764_memory_simple (const void *buf, int len)
+uint32_t x1764_memory_simple (const void *buf, int len)
 {
-    const u_int64_t *CAST_FROM_VOIDP(lbuf, buf);
-    u_int64_t c=0;
+    const uint64_t *CAST_FROM_VOIDP(lbuf, buf);
+    uint64_t c=0;
     while (len>=8) {
 	c = c*17 + *lbuf;
 	if (PRINT) printf("%d: c=%016" PRIx64 " sum=%016" PRIx64 "\n", __LINE__, *lbuf, c);
@@ -20,41 +20,41 @@ u_int32_t x1764_memory_simple (const void *buf, int len)
 	len-=8;
     }
     if (len>0) {
-	const u_int8_t *cbuf=(u_int8_t*)lbuf;
+	const uint8_t *cbuf=(uint8_t*)lbuf;
 	int i;
-	u_int64_t input=0;
+	uint64_t input=0;
 	for (i=0; i<len; i++) {
-	    input |= ((u_int64_t)(cbuf[i]))<<(8*i);
+	    input |= ((uint64_t)(cbuf[i]))<<(8*i);
 	}
 	c = c*17 + input;
     }
     return ~((c&0xFFFFFFFF) ^ (c>>32));
 }
 
-u_int32_t x1764_memory (const void *vbuf, int len)
+uint32_t x1764_memory (const void *vbuf, int len)
 {
-    const u_int8_t *CAST_FROM_VOIDP(buf, vbuf);
-    int len_4_words = 4*sizeof(u_int64_t);
-    u_int64_t suma=0, sumb=0, sumc=0, sumd=0;
+    const uint8_t *CAST_FROM_VOIDP(buf, vbuf);
+    int len_4_words = 4*sizeof(uint64_t);
+    uint64_t suma=0, sumb=0, sumc=0, sumd=0;
     while (len >= len_4_words) {
-	suma = suma*(17LL*17LL*17LL*17LL) + *(u_int64_t*)(buf +0*sizeof(u_int64_t));
-	sumb = sumb*(17LL*17LL*17LL*17LL) + *(u_int64_t*)(buf +1*sizeof(u_int64_t));
-	sumc = sumc*(17LL*17LL*17LL*17LL) + *(u_int64_t*)(buf +2*sizeof(u_int64_t));
-	sumd = sumd*(17LL*17LL*17LL*17LL) + *(u_int64_t*)(buf +3*sizeof(u_int64_t));
+	suma = suma*(17LL*17LL*17LL*17LL) + *(uint64_t*)(buf +0*sizeof(uint64_t));
+	sumb = sumb*(17LL*17LL*17LL*17LL) + *(uint64_t*)(buf +1*sizeof(uint64_t));
+	sumc = sumc*(17LL*17LL*17LL*17LL) + *(uint64_t*)(buf +2*sizeof(uint64_t));
+	sumd = sumd*(17LL*17LL*17LL*17LL) + *(uint64_t*)(buf +3*sizeof(uint64_t));
 	buf += len_4_words;
 	len -= len_4_words;
     }
-    u_int64_t sum = suma*17L*17L*17L + sumb*17L*17L + sumc*17L + sumd;
+    uint64_t sum = suma*17L*17L*17L + sumb*17L*17L + sumc*17L + sumd;
     assert(len>=0);
-    while ((u_int64_t)len>=sizeof(u_int64_t)) {
-	sum = sum*17 + *(u_int64_t*)buf;
-	buf+=sizeof(u_int64_t);
-	len-=sizeof(u_int64_t);
+    while ((uint64_t)len>=sizeof(uint64_t)) {
+	sum = sum*17 + *(uint64_t*)buf;
+	buf+=sizeof(uint64_t);
+	len-=sizeof(uint64_t);
     }
     if (len>0) {
-	u_int64_t tailsum = 0;
+	uint64_t tailsum = 0;
 	for (int i=0; i<len; i++) {
-	    tailsum |= ((u_int64_t)(buf[i]))<<(8*i);
+	    tailsum |= ((uint64_t)(buf[i]))<<(8*i);
 	}
 	sum = sum*17 + tailsum;
     }
@@ -74,7 +74,7 @@ void x1764_add (struct x1764 *l, const void *vbuf, int len) {
     const unsigned char *CAST_FROM_VOIDP(cbuf, vbuf);
     // Special case short inputs
     if (len==1) {
-	u_int64_t input = l->input | ((u_int64_t)(*cbuf))<<(8*n_input_bytes);
+	uint64_t input = l->input | ((uint64_t)(*cbuf))<<(8*n_input_bytes);
 	n_input_bytes++;
 	if (n_input_bytes==8) {
 	    l->sum = l->sum*17 + input;
@@ -86,8 +86,8 @@ void x1764_add (struct x1764 *l, const void *vbuf, int len) {
 	}
 	return;
     } else if (len==2) {
-	u_int64_t input = l->input;
-	u_int64_t thisv = ((u_int64_t)(*(u_int16_t*)cbuf));
+	uint64_t input = l->input;
+	uint64_t thisv = ((uint64_t)(*(uint16_t*)cbuf));
 	if (n_input_bytes==7) {
 	    l->sum = l->sum*17 + (input | (thisv<<(8*7)));
 	    l->input = thisv>>8;
@@ -103,14 +103,14 @@ void x1764_add (struct x1764 *l, const void *vbuf, int len) {
 	return;
     }
 
-    u_int64_t sum;
+    uint64_t sum;
     //assert(len>=0);
     if (n_input_bytes) {
-	u_int64_t input = l->input;
+	uint64_t input = l->input;
 	if (len>=8) {
 	    sum = l->sum;
 	    while (len>=8) {
-		u_int64_t thisv = *(u_int64_t*)cbuf;
+		uint64_t thisv = *(uint64_t*)cbuf;
 		input |= thisv<<(8*n_input_bytes);
 		sum = sum*17 + input;
 		if (PRINT) printf("%d: input=%016" PRIx64 " sum=%016" PRIx64 "\n", __LINE__, input, sum);
@@ -124,7 +124,7 @@ void x1764_add (struct x1764 *l, const void *vbuf, int len) {
 	    l->sum = sum;
 	}
 	if (len>=4) {
-	    u_int64_t thisv = *(u_int32_t*)cbuf;
+	    uint64_t thisv = *(uint32_t*)cbuf;
 	    if (n_input_bytes<4) {
 		input |= thisv<<(8*n_input_bytes);
 		if (PRINT) printf("%d: input=%016" PRIx64 "\n", __LINE__, input);
@@ -143,7 +143,7 @@ void x1764_add (struct x1764 *l, const void *vbuf, int len) {
 	}
 	//assert(n_input_bytes<=8);
 	while (n_input_bytes<8 && len) {
-	    input |= ((u_int64_t)(*cbuf))<<(8*n_input_bytes);
+	    input |= ((uint64_t)(*cbuf))<<(8*n_input_bytes);
 	    n_input_bytes++;
 	    cbuf++;
 	    len--;
@@ -163,44 +163,44 @@ void x1764_add (struct x1764 *l, const void *vbuf, int len) {
     }
     //assert(len>=0);
     while (len>=8) {
-	sum = sum*17 + *(u_int64_t*)cbuf;
+	sum = sum*17 + *(uint64_t*)cbuf;
 	cbuf+=8;
 	len -=8;
     }
     l->sum = sum;
     n_input_bytes = 0;
-    u_int64_t input;
+    uint64_t input;
     l->n_input_bytes = len;
     // Surprisingly, the loop is the fastest on bradley's laptop.
     if (1) {
 	int i;
 	input=0;
 	for (i=0; i<len; i++) {
-	    input |= ((u_int64_t)(cbuf[i]))<<(8*i);
+	    input |= ((uint64_t)(cbuf[i]))<<(8*i);
 	}
     } else if (0) {
 	switch (len) {
-	case 7: input = ((u_int64_t)(*(u_int32_t*)(cbuf))) | (((u_int64_t)(*(u_int16_t*)(cbuf+4)))<<32) | (((u_int64_t)(*(cbuf+4)))<<48); break;
-	case 6: input = ((u_int64_t)(*(u_int32_t*)(cbuf))) | (((u_int64_t)(*(u_int16_t*)(cbuf+4)))<<32); break;
-	case 5: input = ((u_int64_t)(*(u_int32_t*)(cbuf))) | (((u_int64_t)(*(cbuf+4)))<<32); break;
-	case 4: input = ((u_int64_t)(*(u_int32_t*)(cbuf))); break;
-	case 3: input = ((u_int64_t)(*(u_int16_t*)(cbuf))) | (((u_int64_t)(*(cbuf+2)))<<16); break;
-	case 2: input = ((u_int64_t)(*(u_int16_t*)(cbuf))); break;
-	case 1: input = ((u_int64_t)(*cbuf)); break;
+	case 7: input = ((uint64_t)(*(uint32_t*)(cbuf))) | (((uint64_t)(*(uint16_t*)(cbuf+4)))<<32) | (((uint64_t)(*(cbuf+4)))<<48); break;
+	case 6: input = ((uint64_t)(*(uint32_t*)(cbuf))) | (((uint64_t)(*(uint16_t*)(cbuf+4)))<<32); break;
+	case 5: input = ((uint64_t)(*(uint32_t*)(cbuf))) | (((uint64_t)(*(cbuf+4)))<<32); break;
+	case 4: input = ((uint64_t)(*(uint32_t*)(cbuf))); break;
+	case 3: input = ((uint64_t)(*(uint16_t*)(cbuf))) | (((uint64_t)(*(cbuf+2)))<<16); break;
+	case 2: input = ((uint64_t)(*(uint16_t*)(cbuf))); break;
+	case 1: input = ((uint64_t)(*cbuf)); break;
 	case 0: input = 0;                      break;
 	default: abort();
 	}
     } else {
 	input=0;
 	int i=0;
-	if (len>=4) { input  = ((u_int64_t)(*(u_int32_t*)(cbuf)));        cbuf+=4; len-=4; i=4;}
-	if (len>=2) { input |= ((u_int64_t)(*(u_int16_t*)(cbuf)))<<(i*8); cbuf+=2; len-=2; i+=2; }
-	if (len>=1) { input |= ((u_int64_t)(*(u_int8_t *)(cbuf)))<<(i*8); /*cbuf+=1; len-=1; i++;*/ }
+	if (len>=4) { input  = ((uint64_t)(*(uint32_t*)(cbuf)));        cbuf+=4; len-=4; i=4;}
+	if (len>=2) { input |= ((uint64_t)(*(uint16_t*)(cbuf)))<<(i*8); cbuf+=2; len-=2; i+=2; }
+	if (len>=1) { input |= ((uint64_t)(*(uint8_t *)(cbuf)))<<(i*8); /*cbuf+=1; len-=1; i++;*/ }
     }
     l->input = input;
     if (PRINT) printf("%d: n_input_bytes=%d\n", __LINE__, l->n_input_bytes);
 }
-u_int32_t x1764_finish (struct x1764 *l) {
+uint32_t x1764_finish (struct x1764 *l) {
     if (PRINT) printf("%d: n_input_bytes=%d\n", __LINE__, l->n_input_bytes);
     int len = l->n_input_bytes;
     if (len>0) {
diff --git a/ft/x1764.h b/ft/x1764.h
index 67752ebec6ebc3921d753c6838ee7b7a0687721f..f72c06c3e5a7e9f1f57172186f5e7f9652022096 100644
--- a/ft/x1764.h
+++ b/ft/x1764.h
@@ -15,17 +15,17 @@
 // If any odd bytes numbers are left at the end, they are filled in at the low end.
 
 
-u_int32_t x1764_memory (const void *buf, int len);
+uint32_t x1764_memory (const void *buf, int len);
 // Effect: Compute x1764 on the bytes of buf.  Return the 32 bit answer.
 
-u_int32_t x1764_memory_simple (const void *buf, int len);
+uint32_t x1764_memory_simple (const void *buf, int len);
 // Effect: Same as x1764_memory, but not highly optimized (more likely to be correct).  Useful for testing the optimized version.
 
 
 // For incrementally computing an x1764, use the following interfaces.
 struct x1764 {
-    u_int64_t sum;
-    u_int64_t input;
+    uint64_t sum;
+    uint64_t input;
     int n_input_bytes;
 };
 
@@ -35,7 +35,7 @@ void x1764_init(struct x1764 *l);
 void x1764_add (struct x1764 *l, const void *vbuf, int len);
 // Effect: Add more bytes to *l.
 
-u_int32_t x1764_finish (struct x1764 *l);
+uint32_t x1764_finish (struct x1764 *l);
 // Effect: Return the final 32-bit result.
 
 
diff --git a/ft/xids-internal.h b/ft/xids-internal.h
index afc1331fba4e4637fb63ebb733a800c707d55fee..f3d37fd08f054c35d5845227940ad8002be6e366 100644
--- a/ft/xids-internal.h
+++ b/ft/xids-internal.h
@@ -20,7 +20,7 @@
 #endif
 
 typedef struct __attribute__((__packed__)) xids_t {
-    u_int8_t  num_xids;    // maximum value of MAX_TRANSACTION_RECORDS - 1 ...
+    uint8_t  num_xids;    // maximum value of MAX_TRANSACTION_RECORDS - 1 ...
                            // ... because transaction 0 is implicit
     TXNID     ids[];
 } XIDS_S;
diff --git a/ft/xids.cc b/ft/xids.cc
index 86803c1ca30585ee585a628d60cd63e683986af2..b25cfabfed7f5c35b47bbf9938a251b25626802a 100644
--- a/ft/xids.cc
+++ b/ft/xids.cc
@@ -69,7 +69,7 @@ xids_create_unknown_child(XIDS parent_xids, XIDS *xids_p) {
     //  xids_p points to an xids that is an exact copy of parent_xids, but with room for one more xid.
     int rval;
     invariant(parent_xids);
-    u_int32_t num_child_xids = parent_xids->num_xids + 1;
+    uint32_t num_child_xids = parent_xids->num_xids + 1;
     invariant(num_child_xids > 0);
     invariant(num_child_xids <= MAX_TRANSACTION_RECORDS);
     if (num_child_xids == MAX_TRANSACTION_RECORDS) rval = EINVAL;
@@ -91,7 +91,7 @@ xids_finalize_with_child(XIDS xids, TXNID this_xid) {
     //  - All error checking (except that this_xid is higher than its parent) is already complete
     invariant(this_xid > xids_get_innermost_xid(xids));
     TXNID this_xid_disk = toku_htod64(this_xid);
-    u_int32_t num_child_xids = ++xids->num_xids;
+    uint32_t num_child_xids = ++xids->num_xids;
     xids->ids[num_child_xids - 1] = this_xid_disk;
 }
 
@@ -111,11 +111,11 @@ xids_create_child(XIDS   parent_xids,		// xids list for parent transaction
 void
 xids_create_from_buffer(struct rbuf *rb,		// xids list for parent transaction
 		        XIDS * xids_p) {		// xids list created
-    u_int8_t num_xids = rbuf_char(rb);
+    uint8_t num_xids = rbuf_char(rb);
     invariant(num_xids < MAX_TRANSACTION_RECORDS);
     XIDS CAST_FROM_VOIDP(xids, toku_xmalloc(sizeof(*xids) + num_xids*sizeof(xids->ids[0])));
     xids->num_xids = num_xids;
-    u_int8_t index;
+    uint8_t index;
     for (index = 0; index < xids->num_xids; index++) {
         rbuf_TXNID(rb, &xids->ids[index]);
         if (index > 0)
@@ -136,7 +136,7 @@ xids_destroy(XIDS *xids_p) {
 // If requesting an xid out of range (which will be the case if xids array is empty)
 // then return 0, the xid of the root transaction.
 TXNID 
-xids_get_xid(XIDS xids, u_int8_t index) {
+xids_get_xid(XIDS xids, uint8_t index) {
     invariant(index < xids_get_num_xids(xids));
     TXNID rval = xids->ids[index];
     rval = toku_dtoh64(rval);
@@ -145,9 +145,9 @@ xids_get_xid(XIDS xids, u_int8_t index) {
 
 // This function assumes that target_xid IS in the list
 // of xids.
-u_int8_t 
+uint8_t 
 xids_find_index_of_xid(XIDS xids, TXNID target_xid) {
-    u_int8_t index = 0;  // search outer to inner
+    uint8_t index = 0;  // search outer to inner
     TXNID current_xid = xids_get_xid(xids, index);
     while (current_xid != target_xid) {
         invariant(current_xid < target_xid);
@@ -157,9 +157,9 @@ xids_find_index_of_xid(XIDS xids, TXNID target_xid) {
     return index;
 }
 
-u_int8_t 
+uint8_t 
 xids_get_num_xids(XIDS xids) {
-    u_int8_t rval = xids->num_xids;
+    uint8_t rval = xids->num_xids;
     return rval;
 }
 
@@ -170,7 +170,7 @@ xids_get_innermost_xid(XIDS xids) {
     TXNID rval = TXNID_NONE;
     if (xids_get_num_xids(xids)) {
         // if clause above makes this cast ok
-        u_int8_t innermost_xid = (u_int8_t)(xids_get_num_xids(xids)-1);
+        uint8_t innermost_xid = (uint8_t)(xids_get_num_xids(xids)-1);
         rval = xids_get_xid(xids, innermost_xid);
     }
     return rval;
@@ -191,18 +191,18 @@ xids_cpy(XIDS target, XIDS source) {
 }
 
 // return size in bytes
-u_int32_t 
+uint32_t 
 xids_get_size(XIDS xids){
-    u_int32_t rval;
-    u_int8_t num_xids = xids->num_xids;
+    uint32_t rval;
+    uint8_t num_xids = xids->num_xids;
     rval = sizeof(*xids) + num_xids * sizeof(xids->ids[0]);
     return rval;
 }
 
-u_int32_t 
+uint32_t 
 xids_get_serialize_size(XIDS xids){
-    u_int32_t rval;
-    u_int8_t num_xids = xids->num_xids;
+    uint32_t rval;
+    uint8_t num_xids = xids->num_xids;
     rval = 1 + //num xids
            8 * num_xids;
     return rval;
@@ -216,8 +216,8 @@ toku_calc_more_murmur_xids (struct x1764 *mm, XIDS xids) {
     x1764_add(mm, &xids->num_xids, 1);
     TXNID zero = 0;
     x1764_add(mm, &zero, 8);
-    u_int8_t index;
-    u_int8_t num_xids = xids_get_num_xids(xids);
+    uint8_t index;
+    uint8_t num_xids = xids_get_num_xids(xids);
     for (index = 0; index < num_xids; index++) {
         TXNID current_xid = xids_get_xid(xids, index);
         x1764_add(mm, &current_xid, 8);
@@ -232,7 +232,7 @@ xids_get_end_of_array(XIDS xids) {
 
 void wbuf_xids(struct wbuf *wb, XIDS xids) {
     wbuf_char(wb, (unsigned char)xids->num_xids);
-    u_int8_t index;
+    uint8_t index;
     for (index = 0; index < xids->num_xids; index++) {
         wbuf_TXNID(wb, xids->ids[index]);
     }
@@ -240,7 +240,7 @@ void wbuf_xids(struct wbuf *wb, XIDS xids) {
 
 void wbuf_nocrc_xids(struct wbuf *wb, XIDS xids) {
     wbuf_nocrc_char(wb, (unsigned char)xids->num_xids);
-    u_int8_t index;
+    uint8_t index;
     for (index = 0; index < xids->num_xids; index++) {
         wbuf_nocrc_TXNID(wb, xids->ids[index]);
     }
@@ -248,7 +248,7 @@ void wbuf_nocrc_xids(struct wbuf *wb, XIDS xids) {
 
 void
 xids_fprintf(FILE* fp, XIDS xids) {
-    u_int8_t index;
+    uint8_t index;
     unsigned num_xids = xids_get_num_xids(xids);
     fprintf(fp, "[|%u| ", num_xids);
     for (index = 0; index < xids_get_num_xids(xids); index++) {
diff --git a/ft/xids.h b/ft/xids.h
index b30121520e011549f1b6e188caf947539d8a2122..8e211bd08ad07488bef08e71c0ba24578e0e2f2a 100644
--- a/ft/xids.h
+++ b/ft/xids.h
@@ -43,19 +43,19 @@ void xids_create_from_buffer(struct rbuf *rb, XIDS * xids_p);
 
 void xids_destroy(XIDS *xids_p);
 
-TXNID xids_get_xid(XIDS xids, u_int8_t index);
+TXNID xids_get_xid(XIDS xids, uint8_t index);
 
-u_int8_t xids_find_index_of_xid(XIDS xids, TXNID target_xid);
+uint8_t xids_find_index_of_xid(XIDS xids, TXNID target_xid);
 
-u_int8_t xids_get_num_xids(XIDS xids);
+uint8_t xids_get_num_xids(XIDS xids);
 
 TXNID xids_get_innermost_xid(XIDS xids);
 TXNID xids_get_outermost_xid(XIDS xids);
 
 // return size in bytes
-u_int32_t xids_get_size(XIDS xids);
+uint32_t xids_get_size(XIDS xids);
 
-u_int32_t xids_get_serialize_size(XIDS xids);
+uint32_t xids_get_serialize_size(XIDS xids);
 
 void toku_calc_more_murmur_xids (struct x1764 *mm, XIDS xids);
 
diff --git a/ft/ybt.h b/ft/ybt.h
index 7c3683cd4da5daf68f48ca73f6bfe57e9fb53eb5..fbf58d6071e687249f1f48bc68d864fba273e404 100644
--- a/ft/ybt.h
+++ b/ft/ybt.h
@@ -19,7 +19,7 @@ DBT *toku_fill_dbt(DBT *dbt, bytevec k, ITEMLEN len);
 DBT *toku_copyref_dbt(DBT *dst, const DBT src);
 DBT *toku_clone_dbt(DBT *dst, const DBT src);
 int toku_dbt_set(ITEMLEN len, bytevec val, DBT *d, struct simple_dbt *sdbt);
-int toku_dbt_set_value(DBT *, bytevec *val, ITEMLEN vallen, void **staticptrp, BOOL ybt1_disposable);
+int toku_dbt_set_value(DBT *, bytevec *val, ITEMLEN vallen, void **staticptrp, bool ybt1_disposable);
 void toku_sdbt_cleanup(struct simple_dbt *sdbt);
 
 
diff --git a/include/db_cxx.h b/include/db_cxx.h
index a88923374f53918641de60cfbd049e2045785777..ff41f4b0f08d663d47c41c891a823323ff9ea3c4 100644
--- a/include/db_cxx.h
+++ b/include/db_cxx.h
@@ -56,14 +56,14 @@ class Dbt : private DBT {
     void *    get_data(void) const     { return data; }
     void      set_data(void *p)        { data = p; }
     
-    u_int32_t get_size(void) const     { return size; }
-    void      set_size(u_int32_t p)    { size =  p; }
+    uint32_t get_size(void) const     { return size; }
+    void      set_size(uint32_t p)    { size =  p; }
 		       
-    u_int32_t get_flags() const        { return flags; }
-    void      set_flags(u_int32_t f)   { flags = f; }
+    uint32_t get_flags() const        { return flags; }
+    void      set_flags(uint32_t f)   { flags = f; }
 
-    u_int32_t get_ulen() const         { return ulen; }
-    void      set_ulen(u_int32_t p)    { ulen = p; }
+    uint32_t get_ulen() const         { return ulen; }
+    void      set_ulen(uint32_t p)    { ulen = p; }
 
     DBT *get_DBT(void)                              { return (DBT*)this; }
     const DBT *get_const_DBT(void) const            { return (const DBT*)this; }
@@ -71,7 +71,7 @@ class Dbt : private DBT {
     static Dbt* get_Dbt(DBT *dbt)                   { return (Dbt *)dbt; }
     static const Dbt* get_const_Dbt(const DBT *dbt) { return (const Dbt *)dbt; }
 
-    Dbt(void */*data*/, u_int32_t /*size*/);
+    Dbt(void */*data*/, uint32_t /*size*/);
     Dbt(void);
     ~Dbt();
 
@@ -87,7 +87,7 @@ extern "C" {
 class Db {
  public:
     /* Functions to make C++ work, defined in the BDB C++ API documents */
-    Db(DbEnv *dbenv, u_int32_t flags);
+    Db(DbEnv *dbenv, uint32_t flags);
     ~Db();
 
     DB *get_DB(void) {
@@ -104,23 +104,23 @@ class Db {
     }
 
     /* C++ analogues of the C functions. */
-    int open(DbTxn */*txn*/, const char */*name*/, const char */*subname*/, DBTYPE, u_int32_t/*flags*/, int/*mode*/);
-    int close(u_int32_t /*flags*/);
+    int open(DbTxn */*txn*/, const char */*name*/, const char */*subname*/, DBTYPE, uint32_t/*flags*/, int/*mode*/);
+    int close(uint32_t /*flags*/);
 
-    int cursor(DbTxn */*txn*/, Dbc **/*cursorp*/, u_int32_t /*flags*/);
+    int cursor(DbTxn */*txn*/, Dbc **/*cursorp*/, uint32_t /*flags*/);
 
-    int del(DbTxn */*txn*/, Dbt */*key*/, u_int32_t /*flags*/);
+    int del(DbTxn */*txn*/, Dbt */*key*/, uint32_t /*flags*/);
 
-    int get(DbTxn */*txn*/, Dbt */*key*/, Dbt */*data*/, u_int32_t /*flags*/);
+    int get(DbTxn */*txn*/, Dbt */*key*/, Dbt */*data*/, uint32_t /*flags*/);
 
-    int put(DbTxn *, Dbt *, Dbt *, u_int32_t);
+    int put(DbTxn *, Dbt *, Dbt *, uint32_t);
 
-    int get_flags(u_int32_t *);
-    int set_flags(u_int32_t);
+    int get_flags(uint32_t *);
+    int set_flags(uint32_t);
 
-    int set_pagesize(u_int32_t);
+    int set_pagesize(uint32_t);
 
-    int remove(const char *file, const char *database, u_int32_t flags);
+    int remove(const char *file, const char *database, uint32_t flags);
 
 #if 0
     int set_bt_compare(bt_compare_fcn_type bt_compare_fcn);
@@ -130,7 +130,7 @@ class Db {
     int set_dup_compare(dup_compare_fcn_type dup_compare_fcn);
     int set_dup_compare(int (*)(Db *, const Dbt *, const Dbt *));
 
-    int associate(DbTxn *, Db *, int (*)(Db *, const Dbt *, const Dbt *, Dbt *), u_int32_t);
+    int associate(DbTxn *, Db *, int (*)(Db *, const Dbt *, const Dbt *, Dbt *), uint32_t);
 
     int fd(int *);
 
@@ -155,7 +155,7 @@ class DbEnv {
     friend class Dbc;
     friend class DbTxn;
  public:
-    DbEnv(u_int32_t flags);
+    DbEnv(uint32_t flags);
     ~DbEnv(void);
 
     DB_ENV *get_DB_ENV(void) {
@@ -164,12 +164,12 @@ class DbEnv {
     }
 
     /* C++ analogues of the C functions. */
-    int close(u_int32_t);
-    int open(const char *, u_int32_t, int);
-    int set_cachesize(u_int32_t, u_int32_t, int);
-    int set_redzone(u_int32_t);
-    int set_flags(u_int32_t, int);
-    int txn_begin(DbTxn *, DbTxn **, u_int32_t);
+    int close(uint32_t);
+    int open(const char *, uint32_t, int);
+    int set_cachesize(uint32_t, uint32_t, int);
+    int set_redzone(uint32_t);
+    int set_flags(uint32_t, int);
+    int txn_begin(DbTxn *, DbTxn **, uint32_t);
     int set_data_dir(const char *dir);
     void set_errpfx(const char *errpfx);
     void err(int error, const char *fmt, ...)
@@ -177,7 +177,7 @@ class DbEnv {
     void set_errfile(FILE *errfile);
     void set_errcall(void (*)(const DbEnv *, const char *, const char *));
     void set_error_stream(std::ostream *);
-    int get_flags(u_int32_t *flagsp);
+    int get_flags(uint32_t *flagsp);
 
     int set_default_bt_compare(bt_compare_fcn_type bt_compare_fcn);
     // Don't support this one for now.  It's a little tricky.
@@ -186,10 +186,10 @@ class DbEnv {
     // locking
 #if DB_VERSION_MAJOR<4 || (DB_VERSION_MAJOR==4 && DB_VERSION_MINOR<=4)
     // set_lk_max is only defined for versions up to 4.4
-    int set_lk_max(u_int32_t);
+    int set_lk_max(uint32_t);
 #endif
-    int set_lk_max_locks(u_int32_t);
-    int get_lk_max_locks(u_int32_t *);
+    int set_lk_max_locks(uint32_t);
+    int get_lk_max_locks(uint32_t *);
 
 // somewhat_private:
     int do_no_exceptions; // This should be private!!!
@@ -201,7 +201,7 @@ class DbEnv {
  private:
     DB_ENV *the_env;
     
-    DbEnv(DB_ENV *, u_int32_t /*flags*/);
+    DbEnv(DB_ENV *, uint32_t /*flags*/);
     int maybe_throw_error(int /*err*/) throw (DbException);
     static int maybe_throw_error(int, DbEnv*, int /*no_exceptions*/) throw (DbException);
 };
@@ -209,7 +209,7 @@ class DbEnv {
 	
 class DbTxn {
  public:
-    int commit (u_int32_t /*flags*/);
+    int commit (uint32_t /*flags*/);
     int abort ();
 
     virtual ~DbTxn();
@@ -229,8 +229,8 @@ class DbTxn {
 class Dbc : protected DBC {
  public:
     int close(void);
-    int get(Dbt *, Dbt *, u_int32_t);
-    int count(db_recno_t *, u_int32_t);
+    int get(Dbt *, Dbt *, uint32_t);
+    int count(db_recno_t *, uint32_t);
  private:
     Dbc();  // User may not call it.
     ~Dbc(); // User may not delete it.
diff --git a/include/tdb-internal.h b/include/tdb-internal.h
index 039dc092d614bf78f34ea51450bab36dc2b7aea3..0a3aaa72ebc0a240576f41cac36bba9447cc65b1 100644
--- a/include/tdb-internal.h
+++ b/include/tdb-internal.h
@@ -17,7 +17,7 @@
 //};
 
 struct simple_dbt {
-    u_int32_t len;
+    uint32_t len;
     void     *data;
 };
 
diff --git a/portability/memory.cc b/portability/memory.cc
index 9464df4ddb6067bc2f2c142f596bf90116db8e5b..0897aac2af7babbe8f735d73dd602a833ce8a35f 100644
--- a/portability/memory.cc
+++ b/portability/memory.cc
@@ -9,7 +9,6 @@
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdbool.h>
 #if defined(HAVE_MALLOC_H)
 # include <malloc.h>
 #elif defined(HAVE_SYS_MALLOC_H)
diff --git a/portability/tests/rwlock_condvar.h b/portability/tests/rwlock_condvar.h
index 21147c45941c1d53a683b84a1d518ba48319dbf9..ff9afb3014306cc602322898998b221c3184e1ca 100644
--- a/portability/tests/rwlock_condvar.h
+++ b/portability/tests/rwlock_condvar.h
@@ -1,4 +1,3 @@
-/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
 // vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
 /* Fair readers writer lock implemented using condition variables.
  * This is maintained so that we can measure the performance of a relatively simple implementation (this one) 
@@ -8,8 +7,6 @@
 #ident "$Id$"
 #ident "Copyright (c) 2010 Tokutek Inc.  All rights reserved."
 
-#include <stdbool.h>
-
 // Fair readers/writer locks.  These are fair (meaning first-come first-served.  No reader starvation, and no writer starvation).  And they are
 // probably faster than the linux readers/writer locks (pthread_rwlock_t).
 struct toku_cv_fair_rwlock_waiter_state; // this structure is used internally.
diff --git a/portability/toku_assert.cc b/portability/toku_assert.cc
index 3b27a40dd04ad3996899f0daff07302afba52277..501f481d2008bb4fc35cc474ccbe6f6097844e42 100644
--- a/portability/toku_assert.cc
+++ b/portability/toku_assert.cc
@@ -87,7 +87,7 @@ toku_do_backtrace_abort(void) {
     //They could be unacceptable for other reasons as well (popups,
     //flush buffers before quitting, etc)
     //  abort()
-    //  assert(FALSE) (assert.h assert)
+    //  assert(false) (assert.h assert)
     //  raise(SIGABRT)
     //  divide by 0
     //  null dereference
diff --git a/portability/toku_fair_rwlock.cc b/portability/toku_fair_rwlock.cc
index ef178f6e07351224e824b23b7678bbf9df32d1df..2c1ed49c8cd8171b35a6c7ad33ee4b6abc80760e 100644
--- a/portability/toku_fair_rwlock.cc
+++ b/portability/toku_fair_rwlock.cc
@@ -12,7 +12,6 @@
 #include "toku_fair_rwlock.h"
 
 #include <stdio.h>
-#include <stdbool.h>
 #include <memory.h>
 
 struct toku_fair_rwlock_waiter_state {
diff --git a/portability/toku_pthread.h b/portability/toku_pthread.h
index 775267ece7fe73717d110e02e7d73e07ea8ee2b5..db657bc932ac255353a71e2336f04cca0b9dc708 100644
--- a/portability/toku_pthread.h
+++ b/portability/toku_pthread.h
@@ -10,7 +10,6 @@
 #include <pthread.h>
 #include <time.h>
 #include <stdint.h>
-#include <stdbool.h>
 #include "toku_assert.h"
 
 
diff --git a/portability/toku_time.h b/portability/toku_time.h
index 9094f1832a1841560fec6e209f87e71c2f72a9dc..f9da3e3c65da70cd5c1bf0cd9e63666e89672b6d 100644
--- a/portability/toku_time.h
+++ b/portability/toku_time.h
@@ -63,7 +63,7 @@ toku_clock_gettime(clockid_t clk_id, struct timespec *ts)
 // We get property 2 with RDTSC (as long as there's not any skew).
 // We don't even try to get propety 1, since we don't need it.
 // The decision here is that these times are really accurate only on modern machines with modern OSs.
-typedef u_int64_t tokutime_t;             // Time type used in by tokutek timers.
+typedef uint64_t tokutime_t;             // Time type used in by tokutek timers.
 
 // The value of tokutime_t is not specified here. 
 // It might be microseconds since 1/1/1970 (if gettimeofday() is
@@ -84,7 +84,7 @@ double tokutime_to_seconds(tokutime_t)  __attribute__((__visibility__("default")
 
 // Get tokutime.  We want this to be fast, so we expose the implementation as RDTSC.
 static inline tokutime_t get_tokutime (void) {
-    u_int32_t lo, hi;
+    uint32_t lo, hi;
     __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi));
     return (uint64_t)hi << 32 | lo;
 }
diff --git a/src/errors.cc b/src/errors.cc
index 9d33c1830d8e4fd2a213f63ac3485a3a630eaa0e..08fce3f960a90d24a97b22505f5b48bd4135deba 100644
--- a/src/errors.cc
+++ b/src/errors.cc
@@ -26,7 +26,7 @@ int toku_env_is_panicked(DB_ENV *dbenv /**< The environment to check */) {
 
 /* Prints an error message to a file specified by env (or stderr),
    preceded by the environment's error prefix. */
-static void toku__ydb_error_file(const DB_ENV *env, BOOL use_stderr, 
+static void toku__ydb_error_file(const DB_ENV *env, bool use_stderr, 
                                   char errmsg[]) {
     /* Determine the error file to use */
     FILE *CAST_FROM_VOIDP(efile, env->i->errfile);
@@ -66,8 +66,8 @@ static void toku__ydb_error_file(const DB_ENV *env, BOOL use_stderr,
 */
 void toku_ydb_error_all_cases(const DB_ENV * env, 
                               int error, 
-                              BOOL include_stderrstring, 
-                              BOOL use_stderr_if_nothing_else, 
+                              bool include_stderrstring, 
+                              bool use_stderr_if_nothing_else, 
                               const char *fmt, va_list ap) {
     /* Construct the error message */
     char buf [4000];
@@ -94,7 +94,7 @@ int toku_ydb_do_error (const DB_ENV *dbenv, int error, const char *fmt, ...) {
     if (toku_logger_panicked(dbenv->i->logger)) dbenv->i->is_panicked=1;
     va_list ap;
     va_start(ap, fmt);
-    toku_ydb_error_all_cases(dbenv, error, FALSE, FALSE, fmt, ap);
+    toku_ydb_error_all_cases(dbenv, error, false, false, fmt, ap);
     va_end(ap);
     return error;
 }
@@ -107,7 +107,7 @@ int toku_ydb_do_error (const DB_ENV *dbenv, int error, const char *fmt, ...) {
 void toku_env_err(const DB_ENV * env, int error, const char *fmt, ...) {
     va_list ap;
     va_start(ap, fmt);
-    toku_ydb_error_all_cases(env, error, FALSE, TRUE, fmt, ap);
+    toku_ydb_error_all_cases(env, error, false, true, fmt, ap);
     va_end(ap);
 }
 
diff --git a/src/indexer-undo-do.cc b/src/indexer-undo-do.cc
index 21382d772c2cac40ddbb6d39a22374fb42a3a4ac..0177e746e99b285afa5f8d224b0ffe2b1427bd1e 100644
--- a/src/indexer-undo-do.cc
+++ b/src/indexer-undo-do.cc
@@ -75,7 +75,7 @@ indexer_commit_keys_set_empty(struct indexer_commit_keys *keys) {
 static int indexer_set_xid(DB_INDEXER *indexer, TXNID xid, XIDS *xids_result);
 static int indexer_append_xid(DB_INDEXER *indexer, TXNID xid, XIDS *xids_result);
 
-static BOOL indexer_find_prev_xr(DB_INDEXER *indexer, ULEHANDLE ule, uint64_t xrindex, uint64_t *prev_xrindex);
+static bool indexer_find_prev_xr(DB_INDEXER *indexer, ULEHANDLE ule, uint64_t xrindex, uint64_t *prev_xrindex);
 
 static int indexer_generate_hot_key_val(DB_INDEXER *indexer, DB *hotdb, ULEHANDLE ule, UXRHANDLE uxr, DBT *hotkey, DBT *hotval);
 static int indexer_ft_delete_provisional(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, XIDS xids, TOKUTXN txn);
@@ -186,20 +186,20 @@ static void release_txns(
     uint32_t num_provisional = ule_get_num_provisional(ule);
     DB_ENV *env = indexer->i->env;
     TXN_MANAGER txn_manager = toku_logger_get_txn_manager(env->i->logger);
-    BOOL some_txn_pinned = FALSE;
+    bool some_txn_pinned = false;
     if (indexer->i->test_xid_state) {
         goto exit;
     }
     // see if any txn pinned before bothering to grab txn_manager lock
-    for (u_int32_t i = 0; i < num_provisional; i++) {
+    for (uint32_t i = 0; i < num_provisional; i++) {
         if (prov_states[i] == TOKUTXN_LIVE || prov_states[i] == TOKUTXN_PREPARING) {
             assert(prov_txns[i]);
-            some_txn_pinned = TRUE;
+            some_txn_pinned = true;
         }
     }
     if (some_txn_pinned) {
         toku_txn_manager_suspend(txn_manager);
-        for (u_int32_t i = 0; i < num_provisional; i++) {
+        for (uint32_t i = 0; i < num_provisional; i++) {
             if (prov_states[i] == TOKUTXN_LIVE || prov_states[i] == TOKUTXN_PREPARING) {
                 toku_txn_manager_unpin_live_txn_unlocked(txn_manager, prov_txns[i]);
             }
@@ -280,7 +280,7 @@ indexer_undo_do_provisional(DB_INDEXER *indexer, DB *hotdb, ULEHANDLE ule, struc
         }
         // undo
         uint64_t prev_xrindex;
-        BOOL prev_xrindex_found = indexer_find_prev_xr(indexer, ule, xrindex, &prev_xrindex);
+        bool prev_xrindex_found = indexer_find_prev_xr(indexer, ule, xrindex, &prev_xrindex);
         if (prev_xrindex_found) {
             UXRHANDLE prevuxr = ule_get_uxr(ule, prev_xrindex);
             if (uxr_is_delete(prevuxr)) {
@@ -453,18 +453,18 @@ indexer_lock_key(DB_INDEXER *indexer, DB *hotdb, DBT *key, TXNID outermost_live_
 }
 
 // find the index of a non-placeholder transaction record that is previous to the transaction record
-// found at xrindex.  return TRUE if one is found and return its index in prev_xrindex.  otherwise,
-// return FALSE.
-static BOOL
+// found at xrindex.  return true if one is found and return its index in prev_xrindex.  otherwise,
+// return false.
+static bool
 indexer_find_prev_xr(DB_INDEXER *UU(indexer), ULEHANDLE ule, uint64_t xrindex, uint64_t *prev_xrindex) {
     assert(xrindex < ule_num_uxrs(ule));
-    BOOL  prev_found = FALSE;
+    bool  prev_found = false;
     while (xrindex > 0) {
         xrindex -= 1;
         UXRHANDLE uxr = ule_get_uxr(ule, xrindex);
         if (!uxr_is_placeholder(uxr)) {
             *prev_xrindex = xrindex;
-            prev_found = TRUE;
+            prev_found = true;
             break; 
         }
     }
@@ -490,7 +490,7 @@ indexer_ft_delete_provisional(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, XIDS
             // this question apples to delete_committed, insert_provisional
             // and insert_committed
             toku_multi_operation_client_lock();
-            result = toku_ft_maybe_delete (hotdb->i->ft_handle, hotkey, txn, FALSE, ZERO_LSN, TRUE);
+            result = toku_ft_maybe_delete (hotdb->i->ft_handle, hotkey, txn, false, ZERO_LSN, true);
             toku_multi_operation_client_unlock();
         }
     }
@@ -532,7 +532,7 @@ indexer_ft_insert_provisional(DB_INDEXER *indexer, DB *hotdb, DBT *hotkey, DBT *
             assert(txn != NULL);
             // comment/question in indexer_ft_delete_provisional applies
             toku_multi_operation_client_lock();
-            result = toku_ft_maybe_insert (hotdb->i->ft_handle, hotkey, hotval, txn, FALSE, ZERO_LSN, TRUE, FT_INSERT);
+            result = toku_ft_maybe_insert (hotdb->i->ft_handle, hotkey, hotval, txn, false, ZERO_LSN, true, FT_INSERT);
             toku_multi_operation_client_unlock();
         }
     }
diff --git a/src/loader.cc b/src/loader.cc
index 3dfbd7e4da407f07cbf43b952dad9483f42f7a07..1908d2516e681796be7d4b01b77eee35f9228e44 100644
--- a/src/loader.cc
+++ b/src/loader.cc
@@ -189,12 +189,12 @@ int toku_loader_create_loader(DB_ENV *env,
                               uint32_t loader_flags)
 {
     int rval;
-    BOOL use_ft_loader = (loader_flags == 0); 
+    bool use_ft_loader = (loader_flags == 0); 
 
     *blp = NULL;           // set later when created
 
     DB_LOADER *loader = NULL;
-    BOOL use_puts = loader_flags&LOADER_USE_PUTS;
+    bool use_puts = loader_flags&LOADER_USE_PUTS;
     XCALLOC(loader);       // init to all zeroes (thus initializing the error_callback and poll_func)
     XCALLOC(loader->i);    // init to all zeroes (thus initializing all pointers to NULL)
 
@@ -405,7 +405,7 @@ int toku_loader_close(DB_LOADER *loader)
             loader->i->error_callback(loader->i->dbs[loader->i->err_i], loader->i->err_i, loader->i->err_errno, &loader->i->err_key, &loader->i->err_val, loader->i->error_extra);
         }
         if (!(loader->i->loader_flags & LOADER_USE_PUTS ) ) {
-            r = toku_ft_loader_abort(loader->i->ft_loader, TRUE);
+            r = toku_ft_loader_abort(loader->i->ft_loader, true);
         }
         else {
             r = loader->i->err_errno;
@@ -436,7 +436,7 @@ int toku_loader_abort(DB_LOADER *loader)
     }
 
     if (!(loader->i->loader_flags & LOADER_USE_PUTS) ) {
-        r = toku_ft_loader_abort(loader->i->ft_loader, TRUE);
+        r = toku_ft_loader_abort(loader->i->ft_loader, true);
     }
     free_loader(loader);
     return r;
diff --git a/src/loader.h b/src/loader.h
index b756904c87a9593f3089d4c60468677029511def..176f6245c99ad8735583509dcbbd8acb5205bcb8 100644
--- a/src/loader.h
+++ b/src/loader.h
@@ -123,7 +123,7 @@ typedef enum {
 } loader_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[LOADER_STATUS_NUM_ROWS];
 } LOADER_STATUS_S, *LOADER_STATUS;
 
diff --git a/src/lock_tree/idlth.cc b/src/lock_tree/idlth.cc
index 227fff0ce741da4bb48e2d96a9194a9b72476b7a..6d856cd05899530714b7fb0b3600a43ae2e03088 100644
--- a/src/lock_tree/idlth.cc
+++ b/src/lock_tree/idlth.cc
@@ -28,7 +28,7 @@ static inline uint32_t toku__idlth_hash(toku_idlth* idlth, DICTIONARY_ID dict_id
 }
 
 static inline void toku__invalidate_scan(toku_idlth* idlth) {
-    idlth->iter_is_valid = FALSE;
+    idlth->iter_is_valid = false;
 }
 
 int toku_idlth_create(toku_idlth** pidlth) {
@@ -65,7 +65,7 @@ toku_lt_map* toku_idlth_find(toku_idlth* idlth, DICTIONARY_ID dict_id) {
 void toku_idlth_start_scan(toku_idlth* idlth) {
     assert(idlth);
     idlth->iter_curr = &idlth->iter_head;
-    idlth->iter_is_valid = TRUE;
+    idlth->iter_is_valid = true;
 }
 
 static inline toku_idlth_elt* toku__idlth_next(toku_idlth* idlth) {
@@ -161,13 +161,13 @@ static inline void toku__idlth_clear(toku_idlth* idlth, bool clean) {
 }
 
 void toku_idlth_clear(toku_idlth* idlth) {
-    toku__idlth_clear(idlth, TRUE);
+    toku__idlth_clear(idlth, true);
 }
 
 void toku_idlth_close(toku_idlth* idlth) {
     assert(idlth);
 
-    toku__idlth_clear(idlth, FALSE);
+    toku__idlth_clear(idlth, false);
     toku_free(idlth->buckets);
     toku_free(idlth);
 }
diff --git a/src/lock_tree/locktree.cc b/src/lock_tree/locktree.cc
index 89171a8e9285c69e98b179506a600e0b988a313d..d25142b116f5f934ac3cc09cd43128ef708e0a77 100644
--- a/src/lock_tree/locktree.cc
+++ b/src/lock_tree/locktree.cc
@@ -163,9 +163,9 @@ lt_is_infinite(const DBT* p) {
     if (p == toku_lt_infinity || p == toku_lt_neg_infinity) {
         DBT* dbt = (DBT*)p;
         assert(!dbt->data && !dbt->size);
-        r = TRUE;
+        r = true;
     } else
-        r = FALSE;
+        r = false;
     return r;
 }
 
@@ -477,7 +477,7 @@ lt_selfread(toku_lock_tree* tree, TXNID txn, toku_range_tree** pselfread) {
     }
     assert(forest);
     if (!forest->self_read) {
-        r = toku_rt_create(&forest->self_read, toku_lt_point_cmp, lt_txn_cmp, FALSE,
+        r = toku_rt_create(&forest->self_read, toku_lt_point_cmp, lt_txn_cmp, false,
                            ltm_incr_lock_memory_callback, ltm_decr_lock_memory_callback, tree->mgr);
         if (r != 0)
             goto cleanup;
@@ -506,7 +506,7 @@ lt_selfwrite(toku_lock_tree* tree, TXNID txn, toku_range_tree** pselfwrite) {
     }
     assert(forest);
     if (!forest->self_write) {
-        r = toku_rt_create(&forest->self_write, toku_lt_point_cmp, lt_txn_cmp, FALSE,
+        r = toku_rt_create(&forest->self_write, toku_lt_point_cmp, lt_txn_cmp, false,
                            ltm_incr_lock_memory_callback, ltm_decr_lock_memory_callback, tree->mgr);
         if (r != 0) 
             goto cleanup;
@@ -534,7 +534,7 @@ static inline int
 lt_rt_dominates(toku_lock_tree* tree, toku_interval* query, toku_range_tree* rt, bool* dominated) {
     assert(tree && query && dominated);
     if (!rt) {
-        *dominated = FALSE;
+        *dominated = false;
         return 0;
     }
     
@@ -556,7 +556,7 @@ lt_rt_dominates(toku_lock_tree* tree, toku_interval* query, toku_range_tree* rt,
     if (r != 0) 
         return r;
     if (numfound == 0) {
-        *dominated = FALSE;
+        *dominated = false;
         return 0;
     }
     assert(numfound == 1);
@@ -670,7 +670,7 @@ lt_meets(toku_lock_tree* tree, toku_interval* query, toku_range_tree* rt, bool*
 static inline int 
 lt_write_range_conflicts_reads(toku_lock_tree* tree, TXNID txn, toku_interval* query) {
     int r    = 0;
-    bool met = FALSE;
+    bool met = false;
     toku_rth_start_scan(tree->rth);
     rt_forest* forest;
     
@@ -694,7 +694,7 @@ lt_write_range_conflicts_reads(toku_lock_tree* tree, TXNID txn, toku_interval* q
 static inline int 
 lt_write_range_conflicts_writes(toku_lock_tree* tree, TXNID txn, toku_interval* query) {
     int r    = 0;
-    bool met = FALSE;
+    bool met = false;
     toku_rth_start_scan(tree->rth);
     rt_forest* forest;
     
@@ -811,7 +811,7 @@ lt_p_independent(toku_point* point, toku_interval* range) {
 static inline int 
 lt_determine_extreme(toku_lock_tree* tree,
                      toku_range* to_insert,
-                     bool* alloc_left, BOOL* alloc_right,
+                     bool* alloc_left, bool* alloc_right,
                      uint32_t numfound,
                      uint32_t start_at) {
     assert(to_insert && tree && alloc_left && alloc_right);
@@ -825,7 +825,7 @@ lt_determine_extreme(toku_lock_tree* tree,
             if ((!*alloc_left && c == 0) ||
                 !lt_p_independent(tree->buf[i].ends.left, &to_insert->ends)) {
                 return lt_panic(tree, TOKU_LT_INCONSISTENT); }
-            *alloc_left      = FALSE;
+            *alloc_left      = false;
             to_insert->ends.left  = tree->buf[i].ends.left;
         }
         /* Find the extreme right end-point */
@@ -836,7 +836,7 @@ lt_determine_extreme(toku_lock_tree* tree,
                  tree->buf[i].ends.left  != to_insert->ends.left) ||
                  tree->buf[i].ends.right == to_insert->ends.right) {
                 return lt_panic(tree, TOKU_LT_INCONSISTENT); }
-            *alloc_right     = FALSE;
+            *alloc_right     = false;
             to_insert->ends.right = tree->buf[i].ends.right;
         }
     }
@@ -845,7 +845,7 @@ lt_determine_extreme(toku_lock_tree* tree,
 
 /* Find extreme given a starting point. */
 static inline int 
-lt_extend_extreme(toku_lock_tree* tree,toku_range* to_insert, bool* alloc_left, BOOL* alloc_right, uint32_t numfound) {
+lt_extend_extreme(toku_lock_tree* tree,toku_range* to_insert, bool* alloc_left, bool* alloc_right, uint32_t numfound) {
     return lt_determine_extreme(tree, to_insert, alloc_left, alloc_right, numfound, 0);
 }
 
@@ -854,23 +854,23 @@ static inline int
 lt_find_extreme(toku_lock_tree* tree, toku_range* to_insert, uint32_t numfound) {
     assert(numfound > 0);
     *to_insert = tree->buf[0];
-    bool ignore_left = TRUE;
-    bool ignore_right = TRUE;
+    bool ignore_left = true;
+    bool ignore_right = true;
     return lt_determine_extreme(tree, to_insert, &ignore_left, &ignore_right, numfound, 1);
 }
 
 static inline void 
-lt_alloc_extreme(toku_lock_tree* tree, toku_range* to_insert, bool alloc_left, BOOL* alloc_right) {
+lt_alloc_extreme(toku_lock_tree* tree, toku_range* to_insert, bool alloc_left, bool* alloc_right) {
     assert(to_insert && alloc_right);
-    bool copy_left = FALSE;
+    bool copy_left = false;
     
     /* The pointer comparison may speed up the evaluation in some cases, 
        but it is not strictly needed */
     if (alloc_left && alloc_right &&
         (to_insert->ends.left == to_insert->ends.right ||
          toku_lt_point_cmp(to_insert->ends.left, to_insert->ends.right) == 0)) {
-        *alloc_right = FALSE;
-        copy_left    = TRUE;
+        *alloc_right = false;
+        copy_left    = true;
     }
 
     if (alloc_left) {
@@ -923,7 +923,7 @@ lt_free_points(toku_lock_tree* tree, toku_interval* to_insert, uint32_t numfound
 static inline int lt_borderwrite_insert(toku_lock_tree* tree, toku_interval* query, toku_range* to_insert);
 
 /* Consolidate the new range and all the overlapping ranges
-   If found_only is TRUE, we're only consolidating existing ranges in the interval
+   If found_only is true, we're only consolidating existing ranges in the interval
    specified inside of to_insert.
 */
 static inline int 
@@ -931,8 +931,8 @@ consolidate_range_tree(toku_lock_tree* tree, bool found_only, toku_range* to_ins
     assert(tree && to_insert);
 
     int r;
-    bool             alloc_left    = TRUE;
-    bool             alloc_right   = TRUE;
+    bool             alloc_left    = true;
+    bool             alloc_right   = true;
     toku_interval* query = &to_insert->ends;
 
     /* Find all overlapping ranges in the range tree */
@@ -949,8 +949,8 @@ consolidate_range_tree(toku_lock_tree* tree, bool found_only, toku_range* to_ins
         r = lt_find_extreme(tree, to_insert, numfound);
         if (r != 0) 
             return r;
-        alloc_left = FALSE;
-        alloc_right = FALSE;
+        alloc_left = false;
+        alloc_right = false;
     } else {
         /* Find the extreme left and right point of the consolidated interval */
         r = lt_extend_extreme(tree, to_insert, &alloc_left, &alloc_right, numfound);
@@ -1004,7 +1004,7 @@ consolidate_reads(toku_lock_tree* tree, bool found_only, toku_range* to_insert,
     if (r != 0) 
         return r;
     assert(selfread);
-    return consolidate_range_tree(tree, found_only, to_insert, selfread, FALSE);
+    return consolidate_range_tree(tree, found_only, to_insert, selfread, false);
 }
 
 static inline int 
@@ -1015,7 +1015,7 @@ consolidate_writes(toku_lock_tree* tree, toku_range* to_insert, TXNID txn) {
     if (r != 0) 
         return r;
     assert(selfwrite);
-    return consolidate_range_tree(tree, FALSE, to_insert, selfwrite, TRUE);
+    return consolidate_range_tree(tree, false, to_insert, selfwrite, true);
 }
 
 static inline void 
@@ -1116,7 +1116,7 @@ lt_preprocess(toku_lock_tree* tree,
 static inline int 
 lt_get_border_in_selfwrite(toku_lock_tree* tree,
                            toku_range* pred, toku_range* succ,
-                           bool* found_p,    BOOL* found_s,
+                           bool* found_p,    bool* found_s,
                            toku_range* to_insert) {
     assert(tree && pred && succ && found_p && found_s);                                    
     int r;
@@ -1135,7 +1135,7 @@ lt_get_border_in_selfwrite(toku_lock_tree* tree,
 static inline int 
 lt_get_border_in_borderwrite(toku_lock_tree* tree,
                              toku_range* pred, toku_range* succ,
-                             bool* found_p,    BOOL* found_s,
+                             bool* found_p,    bool* found_s,
                              toku_range* to_insert) {
     assert(tree && pred && succ && found_p && found_s);                                    
     int r;
@@ -1153,7 +1153,7 @@ lt_get_border_in_borderwrite(toku_lock_tree* tree,
 static inline int 
 lt_expand_border(toku_lock_tree* tree, toku_range* to_insert,
                  toku_range* pred, toku_range* succ,
-                 bool  found_p,    BOOL  found_s) {
+                 bool  found_p,    bool  found_s) {
     assert(tree && to_insert && pred && succ);
     int r;
     if (found_p && !lt_txn_cmp(pred->data, to_insert->data)) {
@@ -1174,7 +1174,7 @@ lt_expand_border(toku_lock_tree* tree, toku_range* to_insert,
 static inline int 
 lt_split_border(toku_lock_tree* tree, toku_range* to_insert,
                 toku_range* pred, toku_range* succ,
-                bool  found_p,    BOOL  found_s) {
+                bool  found_p,    bool  found_s) {
     assert(tree && to_insert && pred && succ);
     int r;
     assert(lt_txn_cmp(tree->bw_buf[0].data, to_insert->data));
@@ -1221,8 +1221,8 @@ lt_borderwrite_insert(toku_lock_tree* tree, toku_interval* query, toku_range* to
         // Find the adjacent ranges in the borderwrite tree and expand them if they are owned by me
 
         // Find the predecessor and successor of the range to be inserted
-        toku_range pred; bool found_p = FALSE;
-        toku_range succ; bool found_s = FALSE;
+        toku_range pred; bool found_p = false;
+        toku_range succ; bool found_s = false;
         r = lt_get_border_in_borderwrite(tree, &pred, &succ, &found_p, &found_s, to_insert);
         if (r != 0) 
             return lt_panic(tree, r);
@@ -1257,8 +1257,8 @@ lt_borderwrite_insert(toku_lock_tree* tree, toku_interval* query, toku_range* to
             // Split the borderwrite range to remove the overlap with the range being inserted.
 
             // Find predecessor and successor of the range to be inserted
-            toku_range pred; bool found_p = FALSE;
-            toku_range succ; bool found_s = FALSE;
+            toku_range pred; bool found_p = false;
+            toku_range succ; bool found_s = false;
             r = lt_get_border_in_selfwrite(tree, &pred, &succ, &found_p, &found_s, to_insert);
             if (r != 0) 
                 return lt_panic(tree, r);
@@ -1289,8 +1289,8 @@ toku_lt_create(toku_lock_tree** ptree,
     XCALLOC(tmp_tree);
     tmp_tree->mgr              = mgr;
     tmp_tree->compare_fun = compare_fun;
-    tmp_tree->lock_escalation_allowed = TRUE;
-    r = toku_rt_create(&tmp_tree->borderwrite, toku_lt_point_cmp, lt_txn_cmp, FALSE,
+    tmp_tree->lock_escalation_allowed = true;
+    r = toku_rt_create(&tmp_tree->borderwrite, toku_lt_point_cmp, lt_txn_cmp, false,
                        ltm_incr_lock_memory_callback, ltm_decr_lock_memory_callback, mgr);
     assert(r == 0);
     r = toku_rth_create(&tmp_tree->rth);
@@ -1352,8 +1352,8 @@ toku_ltm_get_lt(toku_ltm* mgr, toku_lock_tree** ptree, DICTIONARY_ID dict_id, DE
     int r = ENOSYS;
     toku_lt_map* map     = NULL;
     toku_lock_tree* tree = NULL;
-    bool added_to_ltm    = FALSE;
-    bool added_to_idlth  = FALSE;
+    bool added_to_ltm    = false;
+    bool added_to_idlth  = false;
 
     // verify that the on_create and on_close callbacks are either 
     // mutually null or mutually non-null.
@@ -1395,7 +1395,7 @@ toku_ltm_get_lt(toku_ltm* mgr, toku_lock_tree** ptree, DICTIONARY_ID dict_id, DE
     if (r != 0) {
         goto cleanup;
     }
-    added_to_ltm = TRUE;
+    added_to_ltm = true;
 
     toku_lt_update_descriptor(tree, desc);
     tree->fake_db.cmp_descriptor = &tree->desc_s;
@@ -1405,7 +1405,7 @@ toku_ltm_get_lt(toku_ltm* mgr, toku_lock_tree** ptree, DICTIONARY_ID dict_id, DE
     if (r != 0) {
         goto cleanup;
     }
-    added_to_idlth = TRUE;
+    added_to_idlth = true;
 
     map = toku_idlth_find(mgr->idlth, dict_id);
     assert(map);
@@ -1545,7 +1545,7 @@ lt_try_acquire_range_read_lock(toku_lock_tree* tree, TXNID txn, const DBT* key_l
     toku_range  to_insert;
     init_insert(&to_insert, &left, &right, txn);
     // Consolidate the new range and all the overlapping ranges
-    r = consolidate_reads(tree, FALSE, &to_insert, txn);
+    r = consolidate_reads(tree, false, &to_insert, txn);
     if (r != 0) 
         goto cleanup;
     
@@ -1567,11 +1567,11 @@ border_escalation_trivial(toku_lock_tree* tree, toku_range* border_range, bool*
 
     r = lt_write_range_conflicts_reads(tree, border_range->data, &query);
     if (r == DB_LOCK_NOTGRANTED || r == DB_LOCK_DEADLOCK) { 
-        *trivial = FALSE; 
+        *trivial = false; 
     } else if (r != 0) { 
         goto cleanup; 
     } else { 
-        *trivial = TRUE; 
+        *trivial = true; 
     }
     r = 0;
 cleanup:
@@ -1644,7 +1644,7 @@ lt_escalate_read_locks_in_interval(toku_lock_tree* tree, toku_interval* query, T
     toku_range to_insert;
 
     init_insert(&to_insert, query->left, query->right, txn);
-    r = consolidate_reads(tree, TRUE, &to_insert, txn);
+    r = consolidate_reads(tree, true, &to_insert, txn);
     return r;
 }
 
@@ -1883,19 +1883,19 @@ lt_try_acquire_range_write_lock(toku_lock_tree* tree, TXNID txn, const DBT* key_
         toku_range to_insert;
         init_insert(&to_insert, &left, &right, txn);
 
-        bool dummy = TRUE;
-        lt_alloc_extreme(tree, &to_insert, TRUE, &dummy);
-        bool free_left = FALSE;
+        bool dummy = true;
+        lt_alloc_extreme(tree, &to_insert, true, &dummy);
+        bool free_left = false;
         toku_range_tree* selfwrite;
         r = lt_selfwrite(tree, txn, &selfwrite);
         if (r != 0) { 
-            free_left = TRUE; 
+            free_left = true; 
             goto cleanup_left;
         }
         assert(selfwrite);
         r = toku_rt_insert(selfwrite, &to_insert);
         if (r != 0) { 
-            free_left = TRUE; 
+            free_left = true; 
             goto cleanup_left; 
         }
         // Update borderwrite
@@ -2014,8 +2014,8 @@ sweep_border(toku_lock_tree* tree, toku_range* range) {
     /* Find pred(s.ends.left), and succ(s.ends.right) */
     toku_range pred;
     toku_range succ;
-    bool found_p = FALSE;
-    bool found_s = FALSE;
+    bool found_p = false;
+    bool found_s = false;
 
     r = lt_get_border_in_borderwrite(tree, &pred, &succ, &found_p, &found_s, &buf[0]);
     if (r != 0) 
@@ -2379,7 +2379,7 @@ lock_request_tree_insert(toku_lock_tree *tree, toku_lock_request *lock_request)
     lock_request->tree = tree;
     int r;
     OMTVALUE v;
-    u_int32_t idx;
+    uint32_t idx;
     r = toku_omt_find_zero(tree->lock_requests, compare_lock_request, &lock_request->txnid, &v, &idx); assert(r == DB_NOTFOUND);
     r = toku_omt_insert_at(tree->lock_requests, lock_request, idx); assert_zero(r);
 }
@@ -2389,7 +2389,7 @@ static void
 lock_request_tree_delete(toku_lock_tree *tree, toku_lock_request *lock_request) {
     int r;
     OMTVALUE v;
-    u_int32_t idx;
+    uint32_t idx;
     r = toku_omt_find_zero(tree->lock_requests, compare_lock_request, &lock_request->txnid, &v, &idx);
     if (r == 0) {
         r = toku_omt_delete_at(tree->lock_requests, idx); assert_zero(r);
@@ -2401,7 +2401,7 @@ static toku_lock_request *
 lock_request_tree_find(toku_lock_tree *tree, TXNID id) {
     int r;
     OMTVALUE v;
-    u_int32_t idx;
+    uint32_t idx;
     r = toku_omt_find_zero(tree->lock_requests, compare_lock_request, &id, &v, &idx);
     toku_lock_request *lock_request = NULL;
     if (r == 0) 
@@ -2541,7 +2541,6 @@ lt_retry_lock_requests(toku_lock_tree *tree) {
     }
 }
 
-#include <stdbool.h>
 #include "wfg.h"
 
 // build the WFG for a given lock request
diff --git a/src/lock_tree/locktree.h b/src/lock_tree/locktree.h
index 2cc68b7e6de1ce41b005984d468b386ba35bd35f..8430d9f670e93b3f91dbfa0d21fa7e28c408dcaa 100644
--- a/src/lock_tree/locktree.h
+++ b/src/lock_tree/locktree.h
@@ -8,7 +8,6 @@
 #if !defined(TOKU_LOCKTREE_H)
 #define TOKU_LOCKTREE_H
 
-#include <stdbool.h>
 #include <db.h>
 #include <ft/fttypes.h>
 
@@ -427,7 +426,7 @@ typedef enum {
 } ltm_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[LTM_STATUS_NUM_ROWS];
 } LTM_STATUS_S, *LTM_STATUS;
 
diff --git a/src/lock_tree/lth.cc b/src/lock_tree/lth.cc
index bb41b006a1b0aa551c9b9848e6ca88c21d947665..13335b9ce631a9bb5e2403cc51ebf75570a4e3e4 100644
--- a/src/lock_tree/lth.cc
+++ b/src/lock_tree/lth.cc
@@ -27,7 +27,7 @@ static inline uint32_t toku__lth_hash(toku_lth* lth, toku_lock_tree* key) {
 }
 
 static inline void toku__invalidate_scan(toku_lth* lth) {
-    lth->iter_is_valid = FALSE;
+    lth->iter_is_valid = false;
 }
 
 int toku_lth_create(toku_lth** plth) {
@@ -75,7 +75,7 @@ toku_lock_tree* toku_lth_find(toku_lth* lth, toku_lock_tree* key) {
 void toku_lth_start_scan(toku_lth* lth) {
     assert(lth);
     lth->iter_curr = &lth->iter_head;
-    lth->iter_is_valid = TRUE;
+    lth->iter_is_valid = true;
 }
 
 static inline toku_lth_elt* toku__lth_next(toku_lth* lth) {
diff --git a/src/lock_tree/rth.cc b/src/lock_tree/rth.cc
index fa9fb06e478726f46e73db859e21447efcc992f1..f82c0be21dbefdfde1c1e2bfcaf0c5c4460b1eb5 100644
--- a/src/lock_tree/rth.cc
+++ b/src/lock_tree/rth.cc
@@ -27,7 +27,7 @@ static inline uint32_t toku__rth_hash(toku_rth* rth, TXNID key) {
 }
 
 static inline void toku__invalidate_scan(toku_rth* rth) {
-    rth->iter_is_valid = FALSE;
+    rth->iter_is_valid = false;
 }
 
 int toku_rth_create(toku_rth** prth) {
@@ -64,7 +64,7 @@ rt_forest* toku_rth_find(toku_rth* rth, TXNID key) {
 void toku_rth_start_scan(toku_rth* rth) {
     assert(rth);
     rth->iter_curr = &rth->iter_head;
-    rth->iter_is_valid = TRUE;
+    rth->iter_is_valid = true;
 }
 
 static inline toku_rth_elt* toku__rth_next(toku_rth* rth) {
@@ -159,13 +159,13 @@ static inline void toku__rth_clear(toku_rth* rth, bool clean) {
 }
 
 void toku_rth_clear(toku_rth* rth) {
-    toku__rth_clear(rth, TRUE);
+    toku__rth_clear(rth, true);
 }
 
 void toku_rth_close(toku_rth* rth) {
     assert(rth);
 
-    toku__rth_clear(rth, FALSE);
+    toku__rth_clear(rth, false);
     toku_free(rth->buckets);
     toku_free(rth);
 }
diff --git a/src/lock_tree/tests/test.h b/src/lock_tree/tests/test.h
index 462b6aa12de41a71366ef82ce0965387de23eb3e..83a0defbed4045d7dbd6c179e7a646bbc2df8eb4 100644
--- a/src/lock_tree/tests/test.h
+++ b/src/lock_tree/tests/test.h
@@ -11,7 +11,6 @@
 #include <ft/fttypes.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <stdbool.h>
 #include <stdio.h>
 #include <toku_assert.h>
 #include <errno.h>
diff --git a/src/lock_tree/tests/test_00060_lock_escalation.cc b/src/lock_tree/tests/test_00060_lock_escalation.cc
index 368f9f82d90efc833c8da7ed658aaeaa73579bd0..82f314f155d9caac89aebd1f5e6b8b18e1b74682 100644
--- a/src/lock_tree/tests/test_00060_lock_escalation.cc
+++ b/src/lock_tree/tests/test_00060_lock_escalation.cc
@@ -147,7 +147,7 @@ static void run_escalation_test(void) {
     close_tree();
 /* ******************** */
 /*
-   test that escalation allowed flag goes from false->true->FALSE
+   test that escalation allowed flag goes from false->true->false
    TXN A grabs 1 3 5 7 9 
    TXN B grabs 2 4 6 8 10
    try to grab another lock, fail, lock escalation should be disabled
diff --git a/src/lock_tree/tests/test_lt_update_desc.cc b/src/lock_tree/tests/test_lt_update_desc.cc
index 20114548f0b6b42a21cdc100b09237de4366e91c..4c8d19340f9014202cce5e7287ac7533fa2c995b 100644
--- a/src/lock_tree/tests/test_lt_update_desc.cc
+++ b/src/lock_tree/tests/test_lt_update_desc.cc
@@ -4,7 +4,6 @@
 #ident "Copyright (c) 2007-2012 Tokutek Inc.  All rights reserved."
 #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
 #include <string.h>
-#include <stdbool.h>
 #include "test.h"
 
 // verify that updating a lock tree's descriptor works properly.
diff --git a/src/lock_tree/txnid_set.cc b/src/lock_tree/txnid_set.cc
index 8cfff60d0b8ed5190cbd26c658bfcc6c2e361425..847de2ab3d4067d69b9567d2eca08ec186126771 100644
--- a/src/lock_tree/txnid_set.cc
+++ b/src/lock_tree/txnid_set.cc
@@ -3,7 +3,6 @@
 #ident "$Id$"
 #ident "Copyright (c) 2007-2012 Tokutek Inc.  All rights reserved."
 #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
-#include <stdbool.h>
 #include <stdio.h>
 #include <ft/fttypes.h>
 #include "memory.h"
diff --git a/src/lock_tree/wfg.cc b/src/lock_tree/wfg.cc
index b2fd0c6a5f4cc13dabbbacf65726b5dc785ee932..c69318715a012546629c3a9d7b290a1b1135e888 100644
--- a/src/lock_tree/wfg.cc
+++ b/src/lock_tree/wfg.cc
@@ -6,7 +6,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdbool.h>
 #include "toku_assert.h"
 #include <ft/fttypes.h>
 #include "memory.h"
@@ -93,7 +92,7 @@ static struct wfg_node *
 wfg_find_node(struct wfg *wfg, TXNID id) {
     int r;
     OMTVALUE v;
-    u_int32_t idx;
+    uint32_t idx;
     r = toku_omt_find_zero(wfg->nodes, wfg_compare_nodes, &id, &v, &idx);
     struct wfg_node *node;
     if (r == DB_NOTFOUND)
@@ -114,7 +113,7 @@ static struct wfg_node *
 wfg_find_create_node(struct wfg *wfg, TXNID id) {
     int r;
     OMTVALUE v;
-    u_int32_t idx;
+    uint32_t idx;
     r = toku_omt_find_zero(wfg->nodes, wfg_compare_nodes, &id, &v, &idx);
     struct wfg_node *node;
     if (r == DB_NOTFOUND) {
diff --git a/src/range_tree/linear.cc b/src/range_tree/linear.cc
index 8c49c14d26dbc57792b72d439247704d91f13210..ceae64cfc46c2bf650719ac717ff76be0f3a4395 100644
--- a/src/range_tree/linear.cc
+++ b/src/range_tree/linear.cc
@@ -23,22 +23,22 @@
 struct __toku_range_tree_local {
     //Linear version only fields:
     toku_range* ranges;
-    u_int32_t   ranges_len;
+    uint32_t   ranges_len;
 
     // The number of ranges in the range tree 
-    u_int32_t   numelements;
+    uint32_t   numelements;
 };
 #include <rangetree-internal.h>
 
-static u_int32_t minlen = 1;
+static uint32_t minlen = 1;
 
 static inline int 
-toku__rt_decrease_capacity(toku_range_tree* tree, u_int32_t _num) {
+toku__rt_decrease_capacity(toku_range_tree* tree, uint32_t _num) {
     //TODO: SOME ATTRIBUTE TO REMOVE NEVER EXECUTABLE ERROR: assert(tree);
-    u_int32_t num = _num < minlen ? minlen : _num;
+    uint32_t num = _num < minlen ? minlen : _num;
     
     if (tree->i.ranges_len >= num * 2) {
-        u_int32_t temp_len = tree->i.ranges_len;
+        uint32_t temp_len = tree->i.ranges_len;
         while (temp_len >= num * 2) 
             temp_len /= 2;
         assert(temp_len >= _num);   //Sanity check.
@@ -53,10 +53,10 @@ toku__rt_decrease_capacity(toku_range_tree* tree, u_int32_t _num) {
 }
 
 static inline int 
-toku__rt_increase_capacity(toku_range_tree* tree, u_int32_t num) {
+toku__rt_increase_capacity(toku_range_tree* tree, uint32_t num) {
     //TODO: SOME ATTRIBUTE TO REMOVE NEVER EXECUTABLE ERROR: assert(tree);
     if (tree->i.ranges_len < num) {
-        u_int32_t temp_len = tree->i.ranges_len;
+        uint32_t temp_len = tree->i.ranges_len;
         if (temp_len == 0)
             temp_len = 1;
         while (temp_len < num) 
@@ -161,15 +161,15 @@ toku_rt_close(toku_range_tree* tree) {
 }
 
 int 
-toku_rt_find(toku_range_tree* tree, toku_interval* query, u_int32_t k,
-             toku_range** buf, u_int32_t* buflen, u_int32_t* numfound) {
+toku_rt_find(toku_range_tree* tree, toku_interval* query, uint32_t k,
+             toku_range** buf, uint32_t* buflen, uint32_t* numfound) {
     int r;
 
     if (!tree || !query || !buf || !buflen || !numfound) 
         return EINVAL;
     
-    u_int32_t temp_numfound = 0;
-    for (u_int32_t i = 0; i < tree->i.numelements; i++) {
+    uint32_t temp_numfound = 0;
+    for (uint32_t i = 0; i < tree->i.numelements; i++) {
         if (toku__rt_overlap(tree, query, &tree->i.ranges[i].ends)) {
             r = toku__rt_increase_buffer(tree, buf, buflen, temp_numfound + 1);
             assert_zero(r);
@@ -191,7 +191,7 @@ toku_rt_insert(toku_range_tree* tree, toku_range* range) {
         return EINVAL;
 
     //EDOM cases
-    u_int32_t i;
+    uint32_t i;
     if (tree->allow_overlaps) {
         for (i = 0; i < tree->i.numelements; i++) {
             if (toku__rt_exact  (tree, range, &tree->i.ranges[i])) 
@@ -213,7 +213,7 @@ toku_rt_insert(toku_range_tree* tree, toku_range* range) {
 
     tree->i.numelements++;
     /* Shift to make room. */
-    for (u_int32_t move = tree->i.numelements - 1; move > i; move--) {
+    for (uint32_t move = tree->i.numelements - 1; move > i; move--) {
         tree->i.ranges[move] = tree->i.ranges[move - 1];
     }
     tree->i.ranges[i] = *range;
@@ -224,7 +224,7 @@ int
 toku_rt_delete(toku_range_tree* tree, toku_range* range) {
     if (!tree || !range)                                 
         return EINVAL;
-    u_int32_t i;
+    uint32_t i;
     for (i = 0; i < tree->i.numelements && 
              !toku__rt_exact(tree, range, &(tree->i.ranges[i])); i++) {
     }
@@ -232,7 +232,7 @@ toku_rt_delete(toku_range_tree* tree, toku_range* range) {
     if (i == tree->i.numelements) 
         return EDOM;
     /* Shift left. */
-    for (u_int32_t move = i; move < tree->i.numelements - 1; move++) {
+    for (uint32_t move = i; move < tree->i.numelements - 1; move++) {
         tree->i.ranges[move] = tree->i.ranges[move + 1];        
     }
     toku__rt_decrease_capacity(tree, --tree->i.numelements);
@@ -246,7 +246,7 @@ toku_rt_predecessor (toku_range_tree* tree, toku_point* point, toku_range* pred,
     if (tree->allow_overlaps)                            
         return EINVAL;
     toku_range* best = NULL;
-    for (u_int32_t i = 0; i < tree->i.numelements; i++) {
+    for (uint32_t i = 0; i < tree->i.numelements; i++) {
         if (toku__rt_p_cmp(tree, point, &tree->i.ranges[i].ends) > 0 &&
             (!best || tree->end_cmp(best->ends.left, tree->i.ranges[i].ends.left) < 0)) {
             best = &tree->i.ranges[i];
@@ -265,7 +265,7 @@ toku_rt_successor (toku_range_tree* tree, toku_point* point, toku_range* succ, b
     if (tree->allow_overlaps)                            
         return EINVAL;
     toku_range* best = NULL;
-    for (u_int32_t i = 0; i < tree->i.numelements; i++) {
+    for (uint32_t i = 0; i < tree->i.numelements; i++) {
         if (toku__rt_p_cmp(tree, point, &tree->i.ranges[i].ends) < 0 &&
             (!best || tree->end_cmp(best->ends.left, tree->i.ranges[i].ends.left) > 0)) {
             best = &tree->i.ranges[i];
@@ -292,7 +292,7 @@ toku_rt_get_size(toku_range_tree* tree) {
 
 int 
 toku_rt_iterate(toku_range_tree* tree, int (*f)(toku_range*,void*), void* extra) {
-    u_int32_t index;
+    uint32_t index;
 
     int r = ENOSYS;
     for (index = 0; index < tree->i.numelements; index++) {
@@ -307,7 +307,7 @@ toku_rt_iterate(toku_range_tree* tree, int (*f)(toku_range*,void*), void* extra)
 void 
 toku_rt_verify(toku_range_tree *tree) {
     if (!tree->allow_overlaps) {
-        for (u_int32_t i = 0; i < tree->i.numelements; i++) {
+        for (uint32_t i = 0; i < tree->i.numelements; i++) {
             // assert left <= right
             assert(tree->end_cmp(tree->i.ranges[i].ends.left, tree->i.ranges[i].ends.right) <= 0);
             // assert ranges are sorted
@@ -315,7 +315,7 @@ toku_rt_verify(toku_range_tree *tree) {
                 assert(tree->end_cmp(tree->i.ranges[i].ends.right, tree->i.ranges[i+1].ends.left) < 0);
         }
         // verify no overlaps
-        for (u_int32_t i = 1; i < tree->i.numelements; i++) {
+        for (uint32_t i = 1; i < tree->i.numelements; i++) {
             assert(!toku__rt_overlap(tree, &tree->i.ranges[i-1].ends, &tree->i.ranges[i].ends));
         }
     }
diff --git a/src/range_tree/log_nooverlap.cc b/src/range_tree/log_nooverlap.cc
index 6e15660047e7097cfac1e7df6b38f8e3f186addb..72772d9893448b610fa8fc1cdee5e4030cadd368 100644
--- a/src/range_tree/log_nooverlap.cc
+++ b/src/range_tree/log_nooverlap.cc
@@ -66,7 +66,7 @@ toku_rt_create(toku_range_tree** ptree,
 }
 
 static int 
-rt_clear_helper(OMTVALUE value, u_int32_t UU(index), void* extra) {
+rt_clear_helper(OMTVALUE value, uint32_t UU(index), void* extra) {
     toku_range_tree *tree = (toku_range_tree *) extra;
     size_t s = toku_malloc_usable_size(value);
     tree->decr_memory_size(tree->extra_memory_size, s);
@@ -118,15 +118,15 @@ rt_heaviside(OMTVALUE candidate, void* extra) {
 typedef struct {
     int            (*end_cmp)(const toku_point*,const toku_point*);  
     toku_interval    query;
-    u_int32_t        k;
-    u_int32_t        numfound;
+    uint32_t        k;
+    uint32_t        numfound;
     toku_range_tree* rt;
     toku_range**     buf;
-    u_int32_t*       buflen;
+    uint32_t*       buflen;
 } rt_find_info;
 
 static int 
-rt_find_helper(OMTVALUE value, u_int32_t UU(index), void* extra) {
+rt_find_helper(OMTVALUE value, uint32_t UU(index), void* extra) {
     rt_find_info* info  = (rt_find_info *) extra;
     toku_range*   range = (toku_range *) value;
     int r = ENOSYS;
@@ -149,8 +149,8 @@ rt_find_helper(OMTVALUE value, u_int32_t UU(index), void* extra) {
 } 
 
 int 
-toku_rt_find(toku_range_tree* tree, toku_interval* query, u_int32_t k,
-             toku_range** buf, u_int32_t* buflen, u_int32_t* numfound) {
+toku_rt_find(toku_range_tree* tree, toku_interval* query, uint32_t k,
+             toku_range** buf, uint32_t* buflen, uint32_t* numfound) {
     int r = ENOSYS;
 
     if (!tree || !query || !buf || !buflen || !numfound) {
@@ -162,8 +162,8 @@ toku_rt_find(toku_range_tree* tree, toku_interval* query, u_int32_t k,
     if (k == 0) 
         k = UINT32_MAX;
 
-    u_int32_t leftmost;
-    u_int32_t rightmost;
+    uint32_t leftmost;
+    uint32_t rightmost;
     rightmost = toku_omt_size(tree->i.omt);
     rt_heavi_extra extra;
     extra.end_cmp = tree->end_cmp;
@@ -204,7 +204,7 @@ toku_rt_insert(toku_range_tree* tree, toku_range* range) {
     }
     assert(!tree->allow_overlaps);
 
-    u_int32_t       index;
+    uint32_t       index;
     rt_heavi_extra  extra;
     extra.end_cmp = tree->end_cmp;
     extra.query   = range->ends;
@@ -244,7 +244,7 @@ toku_rt_delete(toku_range_tree* tree, toku_range* range) {
     assert(!tree->allow_overlaps);
 
     OMTVALUE value;
-    u_int32_t   index;
+    uint32_t   index;
     rt_heavi_extra extra;
     extra.end_cmp = tree->end_cmp;
     extra.query   = range->ends;
@@ -286,7 +286,7 @@ rt_neightbor(toku_range_tree* tree, toku_point* point,
     if (!tree || !point || !neighbor || !wasfound || tree->allow_overlaps) {
         r = EINVAL; goto cleanup;
     }
-    u_int32_t   index;
+    uint32_t   index;
     OMTVALUE value;
     rt_heavi_extra extra;
     extra.end_cmp     = tree->end_cmp;
@@ -341,7 +341,7 @@ typedef struct {
 } rt_iter_info;
 
 static int 
-rt_iterate_helper(OMTVALUE value, u_int32_t UU(index), void* extra) {
+rt_iterate_helper(OMTVALUE value, uint32_t UU(index), void* extra) {
     rt_iter_info* info = (rt_iter_info *) extra;
     return info->f((toku_range *) value, info->extra);
 }
@@ -368,8 +368,8 @@ void
 toku_rt_verify(toku_range_tree *tree) {
     int r;
     if (!tree->allow_overlaps) {
-        u_int32_t numelements = toku_omt_size(tree->i.omt);
-        for (u_int32_t i = 0; i < numelements; i++) {
+        uint32_t numelements = toku_omt_size(tree->i.omt);
+        for (uint32_t i = 0; i < numelements; i++) {
             // assert left <= right
 	    OMTVALUE omtv;
             r = toku_omt_fetch(tree->i.omt, i, &omtv);
@@ -386,7 +386,7 @@ toku_rt_verify(toku_range_tree *tree) {
             }
         }
         // verify no overlaps
-        for (u_int32_t i = 1; i < numelements; i++) {
+        for (uint32_t i = 1; i < numelements; i++) {
 	    OMTVALUE omtvprev;
             r = toku_omt_fetch(tree->i.omt, i-1, &omtvprev);
             assert_zero(r);
diff --git a/src/range_tree/rangetree-internal.h b/src/range_tree/rangetree-internal.h
index 76e60d5f27fdde0681ce10c8082e0a9e2fe882d4..598255df059701e236e40313b62a4341c47c2f0f 100644
--- a/src/range_tree/rangetree-internal.h
+++ b/src/range_tree/rangetree-internal.h
@@ -51,11 +51,11 @@ static inline int toku__rt_p_cmp(toku_range_tree* tree,
 }
     
 static inline int toku__rt_increase_buffer(toku_range_tree* tree UU(), toku_range** buf,
-                                     u_int32_t* buflen, u_int32_t num) {
+                                     uint32_t* buflen, uint32_t num) {
     assert(buf);
     //TODO: SOME ATTRIBUTE TO REMOVE NEVER EXECUTABLE ERROR: assert(buflen);
     if (*buflen < num) {
-        u_int32_t temp_len = *buflen; 
+        uint32_t temp_len = *buflen; 
         if (temp_len == 0)
             temp_len = 1;
         while (temp_len < num) 
diff --git a/src/range_tree/rangetree.h b/src/range_tree/rangetree.h
index df352a07fb21d993dbfff96676b355a80e381585..54a617f65f3938cdb491794af607d32917878de7 100644
--- a/src/range_tree/rangetree.h
+++ b/src/range_tree/rangetree.h
@@ -146,8 +146,8 @@ void toku_rt_clear(toku_range_tree* tree);
     parameter to specify whether more elements exist in the tree that overlap 
     (in excess of the requested limit of k).
  */
-int toku_rt_find(toku_range_tree* tree,toku_interval* query, u_int32_t k,
-                 toku_range** buf, u_int32_t* buflen, u_int32_t* numfound);
+int toku_rt_find(toku_range_tree* tree,toku_interval* query, uint32_t k,
+                 toku_range** buf, uint32_t* buflen, uint32_t* numfound);
  
 
 /**
diff --git a/src/range_tree/tests/run.h b/src/range_tree/tests/run.h
index 8554b44e6b1643227bd555f814103405f225122d..8efc35f2c6cf9fd087faf268cb5c87007224e3d1 100644
--- a/src/range_tree/tests/run.h
+++ b/src/range_tree/tests/run.h
@@ -25,7 +25,7 @@ init_range (toku_range* range, int left, int right, int data) {
 }
 
 static void
-setup_tree (bool allow_overlaps, BOOL insert, int left, int right, int data) {
+setup_tree (bool allow_overlaps, bool insert, int left, int right, int data) {
     int r;
     toku_range range;
     r = toku_rt_create(&tree, int_cmp, char_cmp, allow_overlaps, test_incr_memory_size, test_decr_memory_size, NULL);
diff --git a/src/range_tree/tests/test.h b/src/range_tree/tests/test.h
index 65b407e56c91c829096ee5fe724ae0d480fbf2ba..91305628cba630a1d19198ae3246c21d2b94096b 100644
--- a/src/range_tree/tests/test.h
+++ b/src/range_tree/tests/test.h
@@ -40,12 +40,12 @@ parse_args (int argc, const char *argv[]) {
 }
 
 // Simle LCG random number generator.  Not high quality, but good enough.
-static u_int32_t rstate=1;
+static uint32_t rstate=1;
 static inline void mysrandom (int s) {
     rstate=s;
 }
-static inline u_int32_t myrandom (void) {
-    rstate = (279470275ull*(u_int64_t)rstate)%4294967291ull;
+static inline uint32_t myrandom (void) {
+    rstate = (279470275ull*(uint64_t)rstate)%4294967291ull;
     return rstate;
 }
 
diff --git a/src/range_tree/tests/test_00040_find.cc b/src/range_tree/tests/test_00040_find.cc
index 9e03628df1680a03a13c2610ee7658d98480d956..0bd0df56fbf292e2b0351be8e4be27a63a49a33e 100644
--- a/src/range_tree/tests/test_00040_find.cc
+++ b/src/range_tree/tests/test_00040_find.cc
@@ -223,9 +223,9 @@ int main(int argc, const char *argv[]) {
     assert(bufsize >= 2);
     verify_all_overlap(&find_range, buf, found);
 
-    u_int32_t inserted = 2;
-    const u_int32_t start_loop    = 100;
-    const u_int32_t end_loop      = 200;
+    uint32_t inserted = 2;
+    const uint32_t start_loop    = 100;
+    const uint32_t end_loop      = 200;
     for (i = start_loop; i < end_loop; i += 4) {
         range.ends.left  = (toku_point*)&nums[i];
         range.ends.right = (toku_point*)&nums[i+2];
diff --git a/src/range_tree/tests/test_rt_clear.cc b/src/range_tree/tests/test_rt_clear.cc
index 577b50a1d21342db6de8277b6adbfc7bf6a9d582..03c355e1810ac2e0b1ebff757f7a5dde1230e185 100644
--- a/src/range_tree/tests/test_rt_clear.cc
+++ b/src/range_tree/tests/test_rt_clear.cc
@@ -39,8 +39,8 @@ int main(int argc, const char *argv[]) {
     int nums[nranges];
     for (int i = 0; i < nranges; i++) {
         assert(count_ranges(tree) == i);
-        u_int32_t treesize = toku_rt_get_size(tree);
-        assert(treesize == (u_int32_t) i);
+        uint32_t treesize = toku_rt_get_size(tree);
+        assert(treesize == (uint32_t) i);
         nums[i] = i;
         toku_range range; my_init_range(&range, &nums[i], &nums[i], 'a');
         r = toku_rt_insert(tree, &range); CKERR(r);
diff --git a/src/range_tree/tests/test_rt_memory_size.cc b/src/range_tree/tests/test_rt_memory_size.cc
index 50ba894a0f6f2d9a27748eed0359c6228c04f09f..7281377deec7784f03e47c405aa683ee37b295d5 100644
--- a/src/range_tree/tests/test_rt_memory_size.cc
+++ b/src/range_tree/tests/test_rt_memory_size.cc
@@ -24,13 +24,13 @@ int main(int argc, const char *argv[]) {
 
     size_t last_memory_size = toku_rt_memory_size(tree); 
     
-    u_int32_t last_size;
+    uint32_t last_size;
 
     const int nranges = 10;
     int nums[nranges];
     for (int i = 0; i < nranges; i++) {
         last_size = toku_rt_get_size(tree);
-        assert(last_size == (u_int32_t) i);
+        assert(last_size == (uint32_t) i);
 
         nums[i] = i;
         toku_range range; my_init_range(&range, &nums[i], &nums[i], 'a');
diff --git a/src/tests/bdb-simple-deadlock-detect.cc b/src/tests/bdb-simple-deadlock-detect.cc
index d60c52476601796c1026ec4e3d05fb63871632e7..ec3e226c47d6afb44990498619464a7040cc20f6 100644
--- a/src/tests/bdb-simple-deadlock-detect.cc
+++ b/src/tests/bdb-simple-deadlock-detect.cc
@@ -60,7 +60,7 @@ static void *run_locker_a(void *arg) {
     struct test_seq *test_seq = locker_args->test_seq;
     int r;
 
-    u_int32_t locker_a;
+    uint32_t locker_a;
     r = db_env->lock_id(db_env, &locker_a); assert(r == 0);
 
     DBT object_l = { .data = (char *) "L", .size = 1 };
@@ -99,7 +99,7 @@ static void *run_locker_b(void *arg) {
     struct test_seq *test_seq = locker_args->test_seq;
     int r;
 
-    u_int32_t locker_b;
+    uint32_t locker_b;
     r = db_env->lock_id(db_env, &locker_b); assert(r == 0);
 
     DBT object_l = { .data = (char *) "L", .size = 1 };
@@ -197,7 +197,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     if (!do_txn)
diff --git a/src/tests/bdb-simple-deadlock-nowait.cc b/src/tests/bdb-simple-deadlock-nowait.cc
index de9459147d1907476b6225ed89d9788e479bb8d5..7045b2c58ef84bbce3292b9058155033709f9202 100644
--- a/src/tests/bdb-simple-deadlock-nowait.cc
+++ b/src/tests/bdb-simple-deadlock-nowait.cc
@@ -14,9 +14,9 @@
 static void simple_deadlock(DB_ENV *db_env) {
     int r;
 
-    u_int32_t locker_a;
+    uint32_t locker_a;
     r = db_env->lock_id(db_env, &locker_a); assert(r == 0);
-    u_int32_t locker_b;
+    uint32_t locker_b;
     r = db_env->lock_id(db_env, &locker_b); assert(r == 0);
 
     DBT object_l = { .data = (char *) "L", .size = 1 };
@@ -72,7 +72,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     if (!do_txn)
diff --git a/src/tests/bdb-simple-deadlock-on-the-fly.cc b/src/tests/bdb-simple-deadlock-on-the-fly.cc
index fbab7cf801fd2c5870959f1fbfd2b439528a70c2..f77bd3383facc5e96b1def8bc4343fcad3c8dcd1 100644
--- a/src/tests/bdb-simple-deadlock-on-the-fly.cc
+++ b/src/tests/bdb-simple-deadlock-on-the-fly.cc
@@ -60,7 +60,7 @@ static void *run_locker_a(void *arg) {
     struct test_seq *test_seq = locker_args->test_seq;
     int r;
 
-    u_int32_t locker_a;
+    uint32_t locker_a;
     r = db_env->lock_id(db_env, &locker_a); assert(r == 0);
 
     DBT object_l = { .data = (char *) "L", .size = 1 };
@@ -99,7 +99,7 @@ static void *run_locker_b(void *arg) {
     struct test_seq *test_seq = locker_args->test_seq;
     int r;
 
-    u_int32_t locker_b;
+    uint32_t locker_b;
     r = db_env->lock_id(db_env, &locker_b); assert(r == 0);
 
     DBT object_l = { .data = (char *) "L", .size = 1 };
@@ -186,7 +186,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     if (!do_txn)
diff --git a/src/tests/blocking-first-empty.cc b/src/tests/blocking-first-empty.cc
index 85d8106d6dafacbfc7e769cd2533f0aa074025af..786209cc79fe70bdf35cc6d827056cb173a3bbb9 100644
--- a/src/tests/blocking-first-empty.cc
+++ b/src/tests/blocking-first-empty.cc
@@ -137,7 +137,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
diff --git a/src/tests/blocking-first.cc b/src/tests/blocking-first.cc
index 58a032bced57f758344bd23cc79f9fc097bc9750..a82be73a19edc5aeada101e898258e16e22b5ef2 100644
--- a/src/tests/blocking-first.cc
+++ b/src/tests/blocking-first.cc
@@ -154,7 +154,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
diff --git a/src/tests/blocking-last.cc b/src/tests/blocking-last.cc
index 1e6652b9d5bf3ac11f1a8167d7e333087bc2dfaa..2b3edc4909cb37819f0c59b4defa34220c0bea58 100644
--- a/src/tests/blocking-last.cc
+++ b/src/tests/blocking-last.cc
@@ -154,7 +154,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
diff --git a/src/tests/blocking-next-prev-deadlock.cc b/src/tests/blocking-next-prev-deadlock.cc
index 4a355a5a29976d0f40390b999aeadb5e7a8545e3..cda26dd808637d2ef92fe01f4690a6736e6e4441 100644
--- a/src/tests/blocking-next-prev-deadlock.cc
+++ b/src/tests/blocking-next-prev-deadlock.cc
@@ -223,7 +223,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
diff --git a/src/tests/blocking-next-prev.cc b/src/tests/blocking-next-prev.cc
index c5fa26dcec50b7fb1946dcb1b1afefc651ea737c..4507352fd3011ece921097b4809e8eb5ac15d44a 100644
--- a/src/tests/blocking-next-prev.cc
+++ b/src/tests/blocking-next-prev.cc
@@ -222,7 +222,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
diff --git a/src/tests/blocking-prelock-range.cc b/src/tests/blocking-prelock-range.cc
index 23537e63a3528720653961fefeb42d922b40ad89..81e9c7a731652fdd489251836aaa7de884a23fcc 100644
--- a/src/tests/blocking-prelock-range.cc
+++ b/src/tests/blocking-prelock-range.cc
@@ -92,7 +92,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
diff --git a/src/tests/blocking-put-timeout.cc b/src/tests/blocking-put-timeout.cc
index d7647deee503dc23b992cb438844c8343b966c14..fd307494b99b12e9e5a9c61ddf28af480b1387a8 100644
--- a/src/tests/blocking-put-timeout.cc
+++ b/src/tests/blocking-put-timeout.cc
@@ -123,7 +123,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
diff --git a/src/tests/blocking-put-wakeup.cc b/src/tests/blocking-put-wakeup.cc
index edd1bffeea4429e1aca9bff10e2f5e415d181248..396780c5eadaac7be51aaaed9043b307fd93a745 100644
--- a/src/tests/blocking-put-wakeup.cc
+++ b/src/tests/blocking-put-wakeup.cc
@@ -119,7 +119,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
diff --git a/src/tests/blocking-put.cc b/src/tests/blocking-put.cc
index e6a99753108de3a850428224e1941f640c5ed93b..06987ce62518ebfc6149e667dec0fd9de19a9380 100644
--- a/src/tests/blocking-put.cc
+++ b/src/tests/blocking-put.cc
@@ -91,7 +91,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
diff --git a/src/tests/blocking-set-range-0.cc b/src/tests/blocking-set-range-0.cc
index 93bfd65a8a30d2f169db35b078b910dbafa1f137..2b73a0b9c93e5505316d7f93f0151647652368c5 100644
--- a/src/tests/blocking-set-range-0.cc
+++ b/src/tests/blocking-set-range-0.cc
@@ -164,7 +164,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
diff --git a/src/tests/blocking-set-range-n.cc b/src/tests/blocking-set-range-n.cc
index 49c6c475119ae8033e0050f2c438507479c67b3c..81b84f65760101272ce6e1c398899e1e4eb50ccf 100644
--- a/src/tests/blocking-set-range-n.cc
+++ b/src/tests/blocking-set-range-n.cc
@@ -159,7 +159,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
diff --git a/src/tests/blocking-set-range-reverse-0.cc b/src/tests/blocking-set-range-reverse-0.cc
index a04e09bca62de7dc5dbe585a06520a92f02a354f..1d76d9496f9414328bbb47eda4d339e255b8ea65 100644
--- a/src/tests/blocking-set-range-reverse-0.cc
+++ b/src/tests/blocking-set-range-reverse-0.cc
@@ -162,7 +162,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
diff --git a/src/tests/blocking-set.cc b/src/tests/blocking-set.cc
index bc9af29207c94427df336f68e6e0c59922a77fc1..a6f9e04adf8613a900b5a09928d7364796c67b8e 100644
--- a/src/tests/blocking-set.cc
+++ b/src/tests/blocking-set.cc
@@ -137,7 +137,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
diff --git a/src/tests/blocking-table-lock.cc b/src/tests/blocking-table-lock.cc
index 2ee75b4a09e69fa39edbdc4242ae870a22c5bcab..959a5e485b75fcdf3dda8b197cadcd1ba1b67cff 100644
--- a/src/tests/blocking-table-lock.cc
+++ b/src/tests/blocking-table-lock.cc
@@ -85,7 +85,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     r = db_env->open(db_env, db_env_dir, db_env_open_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); assert(r == 0);
diff --git a/src/tests/bug1381.cc b/src/tests/bug1381.cc
index fe744704a34a8e7564140f2c39e4c7766a9c889f..b772b9b37a58fb98d5c4202e873528e785f19565 100644
--- a/src/tests/bug1381.cc
+++ b/src/tests/bug1381.cc
@@ -28,7 +28,7 @@ static int generate_row_for_put(
 }
 
 
-static void do_1381_maybe_lock (int do_loader, u_int64_t *raw_count) {
+static void do_1381_maybe_lock (int do_loader, uint64_t *raw_count) {
     int r;
     DB_TXN * const null_txn = 0;
 
@@ -71,8 +71,8 @@ static void do_1381_maybe_lock (int do_loader, u_int64_t *raw_count) {
 
 	DB_TXN *txn;
 	r = env->txn_begin(env, 0, &txn, 0);                              CKERR(r);
-        u_int32_t mult_put_flags = 0;
-        u_int32_t mult_dbt_flags = 0;
+        uint32_t mult_put_flags = 0;
+        uint32_t mult_dbt_flags = 0;
         DB_LOADER* loader = NULL;
 	if (do_loader) {
 	    r = env->create_loader(
@@ -133,7 +133,7 @@ static void do_1381_maybe_lock (int do_loader, u_int64_t *raw_count) {
 static void
 do_1381 (void) {
     int do_table_lock;
-    u_int64_t raw_counts[2];
+    uint64_t raw_counts[2];
     for (do_table_lock = 0; do_table_lock < 2 ; do_table_lock++) {
 	do_1381_maybe_lock(do_table_lock, &raw_counts[do_table_lock]);
     }
diff --git a/src/tests/checkpoint_1.cc b/src/tests/checkpoint_1.cc
index 6eb1868890dfdd9ac1267a03b73081e656d0af3b..d5bbe63e5128110f162c9f231f5d03157d455e2c 100644
--- a/src/tests/checkpoint_1.cc
+++ b/src/tests/checkpoint_1.cc
@@ -16,7 +16,7 @@ static int iter = 0;  // horrible technique, but quicker than putting in extra (
 
 
 static void
-checkpoint_test_1(u_int32_t flags, u_int32_t n, int snap_all) {
+checkpoint_test_1(uint32_t flags, uint32_t n, int snap_all) {
     if (verbose) { 
         printf("%s(%s):%d, n=0x%03x, checkpoint=%01x, flags=0x%05x\n", 
                __FILE__, __FUNCTION__, __LINE__, 
@@ -37,7 +37,7 @@ checkpoint_test_1(u_int32_t flags, u_int32_t n, int snap_all) {
     db_startup(&db_control, NULL);
     const int num_runs = 4;
     for (run = 0; run < num_runs; run++) {
-        u_int32_t i;
+        uint32_t i;
         for (i=0; i < n/2/num_runs; i++)
             insert_random(db_test.db, db_control.db, NULL);
         snapshot(&db_test, snap_all);
@@ -53,7 +53,7 @@ checkpoint_test_1(u_int32_t flags, u_int32_t n, int snap_all) {
 }
 
 static void
-checkpoint_test_2(u_int32_t flags, u_int32_t n) {
+checkpoint_test_2(uint32_t flags, uint32_t n) {
     if (verbose) { 
         printf("%s(%s):%d, n=0x%03x, checkpoint=%01x, flags=0x%05x\n", 
                __FILE__, __FUNCTION__, __LINE__, 
@@ -76,12 +76,12 @@ checkpoint_test_2(u_int32_t flags, u_int32_t n) {
     const int num_runs = 4;
     for (run = 0; run < num_runs; run++) {
 	iter = run;
-        u_int32_t i;
+        uint32_t i;
         for (i=0; i < n/2/num_runs; i++)
             insert_random(db_test.db, db_control.db, NULL);
 	r = compare_dbs(db_test.db, db_control.db);
 	assert(r==0);
-        snapshot(&db_test, TRUE);  // take checkpoint, insert into test db during checkpoint callback
+        snapshot(&db_test, true);  // take checkpoint, insert into test db during checkpoint callback
 	r = compare_dbs(db_test.db, db_control.db);
 	// test and control should be different 
 	assert(r!=0);
@@ -92,7 +92,7 @@ checkpoint_test_2(u_int32_t flags, u_int32_t n) {
     }
     // now close db_test via checkpoint callback (i.e. during checkpoint)
     iter = -1;  
-    snapshot(&db_test, TRUE);
+    snapshot(&db_test, true);
     db_shutdown(&db_control);
     env_shutdown();
 }
@@ -157,7 +157,7 @@ static void checkpoint_callback_2(void * extra) {
 int
 test_main (int argc, char * const argv[]) {
     parse_args(argc, argv);
-    u_int32_t n;
+    uint32_t n;
     int snap;
 
     n = 0;
diff --git a/src/tests/checkpoint_callback.cc b/src/tests/checkpoint_callback.cc
index 14549a32424d145094611b9dd1cb24becb605ce7..3d1057fdd5d12d684871452a104e360498845b29 100644
--- a/src/tests/checkpoint_callback.cc
+++ b/src/tests/checkpoint_callback.cc
@@ -30,7 +30,7 @@ static void checkpoint_callback_2(void * extra) {
 }
 
 static void
-checkpoint_test_1(u_int32_t flags, u_int32_t n, int snap_all) {
+checkpoint_test_1(uint32_t flags, uint32_t n, int snap_all) {
     if (verbose>1) { 
         printf("%s(%s):%d, n=0x%03x, checkpoint=%01x, flags=0x%05x\n", 
                __FILE__, __FUNCTION__, __LINE__, 
@@ -38,7 +38,7 @@ checkpoint_test_1(u_int32_t flags, u_int32_t n, int snap_all) {
         fflush(stdout); 
     }
     dir_create();
-    env_startup(0, FALSE);
+    env_startup(0, false);
     int run;
     int r;
     DICTIONARY_S db_control;
@@ -50,7 +50,7 @@ checkpoint_test_1(u_int32_t flags, u_int32_t n, int snap_all) {
     db_startup(&db_control, NULL);
     const int num_runs = 4;
     for (run = 0; run < num_runs; run++) {
-        u_int32_t i;
+        uint32_t i;
         for (i=0; i < n/2/num_runs; i++)
             insert_random(db_test.db, db_control.db, NULL);
         snapshot(&db_test, snap_all);
diff --git a/src/tests/checkpoint_stress.cc b/src/tests/checkpoint_stress.cc
index 6140e1f70cb368e4bab4d30312b471dd6665b44f..a66ba5a33ad8ad807b1949846b0a0c274285d00b 100644
--- a/src/tests/checkpoint_stress.cc
+++ b/src/tests/checkpoint_stress.cc
@@ -194,12 +194,12 @@ random_acts(void * d) {
 #endif
 }
 
-u_int64_t max_windows_cachesize = 256 << 20;
+uint64_t max_windows_cachesize = 256 << 20;
 
 static void
 run_test (int iter, int die) {
 
-    u_int32_t flags = 0;
+    uint32_t flags = 0;
 
     int i;
 
@@ -210,7 +210,7 @@ run_test (int iter, int die) {
     // to force lots of disk I/O
     // (each iteration inserts about 4K rows/dictionary, 16 bytes/row, 4 dictionaries = 256K bytes inserted per iteration)
     const int32_t K256 = 256 * 1024;
-    u_int64_t cachebytes = 0;
+    uint64_t cachebytes = 0;
     cachebytes = K256 * (iter + 1) - (128 * 1024);
     if (cachebytes > max_windows_cachesize)
         cachebytes = 0;
@@ -254,7 +254,7 @@ run_test (int iter, int die) {
 	    scribble(db, iter);
 	else
 	    thin_out(db, iter);
-	u_int32_t delay = myrandom();
+	uint32_t delay = myrandom();
 	delay &= 0xFFF;       // select lower 12 bits, shifted up 8 for random number ...
 	delay = delay << 8;   // ... uniformly distributed between 0 and 1M ...
 	usleep(delay);        // ... to sleep up to one second (1M usec)
@@ -322,7 +322,7 @@ test_main (int argc, char * const argv[]) {
             usage(argv[0]);
             return 1;
 	default:
-            assert(FALSE);
+            assert(false);
             return 1;
 	}
     }
diff --git a/src/tests/checkpoint_test.h b/src/tests/checkpoint_test.h
index e65317a19b8da86045f1f7fbaf15e49c0f4453c4..f83eafbc72062b2022a1a40aa810de418c517220 100644
--- a/src/tests/checkpoint_test.h
+++ b/src/tests/checkpoint_test.h
@@ -16,7 +16,7 @@ enum {NUM_FIXED_ROWS=1025};   // 4K + 1
 
 typedef struct {
     DB*       db;
-    u_int32_t flags;
+    uint32_t flags;
     char      filename[MAX_NAME]; //Relative to ENVDIR/
     int       num;
 } DICTIONARY_S, *DICTIONARY;
@@ -185,7 +185,7 @@ null_dictionary(DICTIONARY d) {
 }
 
 static void UU()
-init_dictionary(DICTIONARY d, u_int32_t flags, const char *name) {
+init_dictionary(DICTIONARY d, uint32_t flags, const char *name) {
     null_dictionary(d);
     d->flags = flags;
     strcpy(d->filename, name);
@@ -298,7 +298,7 @@ insert_random(DB *db1, DB *db2, DB_TXN *txn) {
 }
 
 static void UU()
-delete_both_random(DB *db1, DB *db2, DB_TXN *txn, u_int32_t flags) {
+delete_both_random(DB *db1, DB *db2, DB_TXN *txn, uint32_t flags) {
     int64_t k = random64();
     int r;
     DBT key;
@@ -317,7 +317,7 @@ delete_both_random(DB *db1, DB *db2, DB_TXN *txn, u_int32_t flags) {
 
 
 static void UU()
-delete_fixed(DB *db1, DB *db2, DB_TXN *txn, int64_t k, u_int32_t flags) {
+delete_fixed(DB *db1, DB *db2, DB_TXN *txn, int64_t k, uint32_t flags) {
     int r;
     DBT key;
 
@@ -334,7 +334,7 @@ delete_fixed(DB *db1, DB *db2, DB_TXN *txn, int64_t k, u_int32_t flags) {
 }
 
 static void UU()
-delete_n(DB *db1, DB *db2, DB_TXN *txn, int firstkey, int n, u_int32_t flags) {
+delete_n(DB *db1, DB *db2, DB_TXN *txn, int firstkey, int n, uint32_t flags) {
     int i;
     for (i=0;i<n;i++) {
         delete_fixed(db1, db2, txn, firstkey+i, flags);
diff --git a/src/tests/cursor-more-than-a-leaf-provdel.cc b/src/tests/cursor-more-than-a-leaf-provdel.cc
index 5d2c2b70cd996fa5bd0f925629396da4c5a23ad4..e5bc7c73a5af32e14aaefeb4117c7d1c8df507a9 100644
--- a/src/tests/cursor-more-than-a-leaf-provdel.cc
+++ b/src/tests/cursor-more-than-a-leaf-provdel.cc
@@ -48,7 +48,7 @@ test_shutdown (void) {
 }
 
 static void
-doit (BOOL committed_provdels) {
+doit (bool committed_provdels) {
     DBT key,data;
     DBC *dbc;
     int r;
@@ -109,10 +109,10 @@ test_main (int argc, char * const argv[]) {
     parse_args(argc, argv);
 
     setup();
-    doit(TRUE);
+    doit(true);
     test_shutdown();
     setup();
-    doit(FALSE);
+    doit(false);
     test_shutdown();
 
     return 0;
diff --git a/src/tests/db-put-simple-deadlock-threads.cc b/src/tests/db-put-simple-deadlock-threads.cc
index c94c41b2ed687191374489a50ea16216824d304c..a3b0a4a2e6edef14a1387119fd24d3cef716f1db 100644
--- a/src/tests/db-put-simple-deadlock-threads.cc
+++ b/src/tests/db-put-simple-deadlock-threads.cc
@@ -178,7 +178,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     if (!do_txn)
diff --git a/src/tests/db-put-simple-deadlock.cc b/src/tests/db-put-simple-deadlock.cc
index db1ab8cb9009cb13aed9851c3ef89f2d1b3d3796..a6aac9ee09136886af53975ec26df722ccf0b876 100644
--- a/src/tests/db-put-simple-deadlock.cc
+++ b/src/tests/db-put-simple-deadlock.cc
@@ -97,7 +97,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     if (!do_txn)
diff --git a/src/tests/db-put-simple-lockwait.cc b/src/tests/db-put-simple-lockwait.cc
index a8c1a9dfeae7b32ab488ddd2ee2cdc438b831b64..8fad5a9b8d8441015d865736e2c08e84e20ea4f4 100644
--- a/src/tests/db-put-simple-lockwait.cc
+++ b/src/tests/db-put-simple-lockwait.cc
@@ -122,7 +122,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     if (!do_txn)
diff --git a/src/tests/db-put-update-deadlock.cc b/src/tests/db-put-update-deadlock.cc
index 7a621bae4bf400ab92bbbd8cb91b622018302d63..d882031298afa7f3657e68d2643799db54e95df9 100644
--- a/src/tests/db-put-update-deadlock.cc
+++ b/src/tests/db-put-update-deadlock.cc
@@ -162,7 +162,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert(r == 0);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert(r == 0);
     }
     if (!do_txn)
diff --git a/src/tests/directory_lock.cc b/src/tests/directory_lock.cc
index f05ef416da155ca73fe9f5414274d4dc67fba4f9..1f0d9cf9ae1c1722dfc92e78d75818569ac99ae4 100644
--- a/src/tests/directory_lock.cc
+++ b/src/tests/directory_lock.cc
@@ -33,7 +33,7 @@ static int update_fun(DB *UU(db),
 static void verify_shared_ops_fail(DB_ENV* env, DB* db) {
     int r;
     DB_TXN* txn = NULL;
-    u_int32_t flags = 0;
+    uint32_t flags = 0;
     DBT key,val;
     DBT in_key,in_val;
     uint32_t in_key_data, in_val_data = 0;
@@ -278,7 +278,7 @@ int test_main (int argc, char * const argv[]) {
     verify_excl_ops_fail(env,"foo.db");
     r = txna->abort(txna); CKERR(r);
 
-    u_int32_t flags = 0;
+    uint32_t flags = 0;
 
     r = env->txn_begin(env, NULL, &txna, 0); CKERR(r);
     r = env->txn_begin(env, NULL, &txnb, 0); CKERR(r);
diff --git a/src/tests/diskfull.cc b/src/tests/diskfull.cc
index 9582a099ea9ccec5fc1c1f675d2ddc4736a51bef..f24cc1cd0dca5c30f8f2d7c13ccb1598e2d1674a 100644
--- a/src/tests/diskfull.cc
+++ b/src/tests/diskfull.cc
@@ -169,7 +169,7 @@ write_counting_and_failing (int fd, const void *buf, size_t size)
 static void
 do_writes_that_fail (void) {
     if (verbose) { printf("About to fail at %d:\n", fail_at); fflush(stdout); }
-    toku_set_assert_on_write_enospc(TRUE);
+    toku_set_assert_on_write_enospc(true);
     db_env_set_func_pwrite(pwrite_counting_and_failing);
     db_env_set_func_full_pwrite(pwrite_counting_and_failing);
     db_env_set_func_write (write_counting_and_failing);
diff --git a/src/tests/env_startup.cc b/src/tests/env_startup.cc
index 4928e8e3929d76e5fba2308e051ccb871136009e..d596ba06797cc484c3b4f766969103d4f7a22c94 100644
--- a/src/tests/env_startup.cc
+++ b/src/tests/env_startup.cc
@@ -32,7 +32,7 @@ static int mode = S_IRWXU+S_IRWXG+S_IRWXO;
 static void test_shutdown(void);
 
 static void
-setup (u_int32_t flags) {
+setup (uint32_t flags) {
     int r;
     if (env)
         test_shutdown();
@@ -58,7 +58,7 @@ test_shutdown(void) {
 
 
 static void
-reopen_env(u_int32_t flags, int expected_r) {
+reopen_env(uint32_t flags, int expected_r) {
     int r;
     if (env)
         test_shutdown();
@@ -96,7 +96,7 @@ delete_log(void) {
 
 
 static void
-create_env(u_int32_t flags) {
+create_env(uint32_t flags) {
     setup(flags);                     // create new environment
     test_shutdown();
     reopen_env(flags, 0);             // reopen existing environment, should have log now
@@ -106,7 +106,7 @@ create_env(u_int32_t flags) {
 
 static void
 test_env_startup(int logging) {
-    u_int32_t flags;
+    uint32_t flags;
     
     if (logging)
 	flags = FLAGS_LOG;
diff --git a/src/tests/filesize.cc b/src/tests/filesize.cc
index 056ae051fb24a6d5cfd3d30d1a351b432c33656d..78162358466e480abab4e49326cf8a9c068d9052 100644
--- a/src/tests/filesize.cc
+++ b/src/tests/filesize.cc
@@ -84,10 +84,10 @@ fill_rand(int n, uint64_t * d) {
 #define INSERT_BIG 1500
 #define INSERT_SMALL 0
 static void
-insert_n (u_int32_t ah, int datasize) {
+insert_n (uint32_t ah, int datasize) {
     uint64_t vdata[datasize];
     fill_rand(datasize, vdata);
-    u_int32_t an = htonl(ah);
+    uint32_t an = htonl(ah);
     //    if (verbose) printf("insert an = %0X (ah = %0X)\n", an, ah);
     DBT key;
     dbt_init(&key, &an, 4);
@@ -99,9 +99,9 @@ insert_n (u_int32_t ah, int datasize) {
 }
 
 static void
-delete_n (u_int32_t ah)
+delete_n (uint32_t ah)
 {
-    u_int32_t an = htonl(ah);
+    uint32_t an = htonl(ah);
     //    if (verbose) printf("delete an = %0X (ah = %0X)\n", an, ah);
     DBT key;
     dbt_init(&key, &an, 4);
diff --git a/src/tests/hotindexer-undo-do-test.cc b/src/tests/hotindexer-undo-do-test.cc
index b2c4359bb4fde1651fe4bc32c949ec8e8dadfc2c..eab560d67c9836750c16fd3624eae9093dd16351 100644
--- a/src/tests/hotindexer-undo-do-test.cc
+++ b/src/tests/hotindexer-undo-do-test.cc
@@ -14,7 +14,6 @@
 // and print out the actions taken by the undo do function while processing the leafentry
 
 #include "test.h"
-#include <stdbool.h>
 
 #include <ft/tokuconst.h>
 #include <ft/fttypes.h>
diff --git a/src/tests/inflate.cc b/src/tests/inflate.cc
index 4e7a46ceea6708f3d2952a3f60eb1fb93ac3911d..24775c91348868471515b26ef4fc4ac62b0910bb 100644
--- a/src/tests/inflate.cc
+++ b/src/tests/inflate.cc
@@ -64,8 +64,8 @@ setup(void)
 char  vdata[150];
 
 static void
-insert_n (u_int32_t ah) {
-    u_int32_t an = htonl(ah);
+insert_n (uint32_t ah) {
+    uint32_t an = htonl(ah);
     DBT key;
     dbt_init(&key, &an, 4);
     DBT val;
@@ -75,9 +75,9 @@ insert_n (u_int32_t ah) {
 }
 
 static void
-delete_n (u_int32_t ah)
+delete_n (uint32_t ah)
 {
-    u_int32_t an = htonl(ah);
+    uint32_t an = htonl(ah);
     DBT key;
     dbt_init(&key, &an, 4);
     int r = db->del(db, NULL, &key, DB_DELETE_ANY);
@@ -89,9 +89,9 @@ delete_n (u_int32_t ah)
 }
 
 static void
-get_n (u_int32_t ah, int expect_r)
+get_n (uint32_t ah, int expect_r)
 {
-    u_int32_t an = htonl(ah);
+    uint32_t an = htonl(ah);
     DBT key;
     dbt_init(&key, &an, 4);
     DBT val;
@@ -104,15 +104,15 @@ get_n (u_int32_t ah, int expect_r)
 static void
 doit (void)
 {
-    u_int32_t N=100;
-    for (u_int32_t i=0; i<N; i++) {
+    uint32_t N=100;
+    for (uint32_t i=0; i<N; i++) {
 	insert_n(i<<16);
     }
     reopen_em();
-    for (u_int32_t j=0; j<46; j++) {
+    for (uint32_t j=0; j<46; j++) {
 	insert_n(('.'<<16) + 1 +j);
     }
-    for (u_int32_t i=N-1; i<N; i++) {
+    for (uint32_t i=N-1; i<N; i++) {
 	delete_n(i<<16);
 	get_n(i<<16, DB_NOTFOUND);
     }
@@ -120,16 +120,16 @@ doit (void)
     insert_n(N<<16);
     get_n(N<<16, 0);
     reopen_em();
-    for (u_int32_t i='J'; i<N+1; i++) {
+    for (uint32_t i='J'; i<N+1; i++) {
 	delete_n(i<<16);
 	get_n(i<<16, DB_NOTFOUND);
     }
     reopen_em();
     reopen_em();
-    for (u_int32_t j=0; j<46; j++) {
+    for (uint32_t j=0; j<46; j++) {
 	insert_n(('.'<<16) + 1 +j +46);
     }
-    for (u_int32_t i=0; i<13; i++) {
+    for (uint32_t i=0; i<13; i++) {
 	delete_n((73 - i)<< 16);
 	get_n((73-i) << 16, DB_NOTFOUND); 
     }
diff --git a/src/tests/inflate2.cc b/src/tests/inflate2.cc
index 1e5d95793072d3581e54be5b0533e2dcf2cb0ee9..454469a9f9274bb595c2a5307cd24614129f52d7 100644
--- a/src/tests/inflate2.cc
+++ b/src/tests/inflate2.cc
@@ -64,8 +64,8 @@ setup(void)
 char  vdata[150];
 
 static void
-insert_n (u_int32_t ah) {
-    u_int32_t an = htonl(ah);
+insert_n (uint32_t ah) {
+    uint32_t an = htonl(ah);
     DBT key;
     dbt_init(&key, &an, 4);
     DBT val;
@@ -75,9 +75,9 @@ insert_n (u_int32_t ah) {
 }
 
 static void
-get_n (u_int32_t ah, int expect_r)
+get_n (uint32_t ah, int expect_r)
 {
-    u_int32_t an = htonl(ah);
+    uint32_t an = htonl(ah);
     DBT key;
     dbt_init(&key, &an, 4);
     DBT val;
@@ -89,9 +89,9 @@ get_n (u_int32_t ah, int expect_r)
 
 
 static void
-delete_n_now (u_int32_t ah)
+delete_n_now (uint32_t ah)
 {
-    u_int32_t an = htonl(ah);
+    uint32_t an = htonl(ah);
     DBT key;
     dbt_init(&key, &an, 4);
     int r = db->del(db, NULL, &key, DB_DELETE_ANY);
@@ -106,20 +106,20 @@ delete_n_now (u_int32_t ah)
 static void
 doit (void)
 {
-    u_int32_t N=46;
-    u_int32_t BIG=1<<16;
-    for (u_int32_t i=0; i<2*N; i++) {
+    uint32_t N=46;
+    uint32_t BIG=1<<16;
+    for (uint32_t i=0; i<2*N; i++) {
 	insert_n(i<<8);
     }
     insert_n(BIG);
     insert_n(BIG+1);
     reopen_em();
-    for (u_int32_t i=0; i<N; i++) {
+    for (uint32_t i=0; i<N; i++) {
 	insert_n((2*N+i)<<8);
     }
     delete_n_now(BIG+1);
     reopen_em();
-    for (u_int32_t i=0; i<N; i++) {
+    for (uint32_t i=0; i<N; i++) {
 	insert_n((48<<8) + i);
     }
     insert_n((48<<8) + N);
diff --git a/src/tests/keyrange-merge.cc b/src/tests/keyrange-merge.cc
index bff3a04f8deaf624c8613f9fc76775f51a41e7e4..3311102a37c4b08620bf200803c28fea0fc74e9a 100644
--- a/src/tests/keyrange-merge.cc
+++ b/src/tests/keyrange-merge.cc
@@ -18,13 +18,13 @@
 static DB_ENV *env = NULL;
 static DB_TXN *txn = NULL;
 static DB *db = NULL;
-static u_int32_t db_page_size = 4096;
-static u_int32_t db_basement_size = 4096;
+static uint32_t db_page_size = 4096;
+static uint32_t db_basement_size = 4096;
 static const char *envdir = ENVDIR;
-static u_int64_t nrows = 0;
+static uint64_t nrows = 0;
 
-static u_int64_t 
-max64(u_int64_t a, u_int64_t b) {
+static uint64_t 
+max64(uint64_t a, uint64_t b) {
     return a < b ? b : a;
 }
 
@@ -55,7 +55,7 @@ run_test(void) {
 
     // insert keys 1, 3, 5, ... 2*(nrows-1) + 1
     r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
-    for (u_int64_t i=0; i<nrows; i++) {
+    for (uint64_t i=0; i<nrows; i++) {
         char key[100];
         snprintf(key, sizeof key, "%08llu", (unsigned long long)2*i+1);
         char val[val_size];
@@ -87,7 +87,7 @@ run_test(void) {
     for (t = 0; t<100; t++) {
         r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
         // replace in reverse order to disable the sequential insertion code
-        for (u_int64_t i=nrows; i>0; i--) {
+        for (uint64_t i=nrows; i>0; i--) {
             char key[100];
             snprintf(key, sizeof key, "%08llu", (unsigned long long)2*(i-1)+1);
             assert(1+strlen(key) == key_size);
@@ -109,11 +109,11 @@ run_test(void) {
 
     // verify key_range for keys that exist in the tree
     r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
-    for (u_int64_t i=0; i<nrows; i++) {
+    for (uint64_t i=0; i<nrows; i++) {
 	char key[100];
 	snprintf(key, 100, "%08llu", (unsigned long long)2*i+1);
 	DBT k;
-	u_int64_t less,equal,greater;
+	uint64_t less,equal,greater;
 	int is_exact;
 	r = db->key_range64(db, txn, dbt_init(&k, key, 1+strlen(key)), &less, &equal, &greater, &is_exact); CKERR(r);
 	if (verbose)
@@ -123,7 +123,7 @@ run_test(void) {
         assert(0 < less + equal + greater);
         assert(less + equal + greater < 2*nrows);
         assert(equal == 1);
-        u_int64_t est_i = max64(i, i + rows_per_basement/2);
+        uint64_t est_i = max64(i, i + rows_per_basement/2);
         assert(less <= est_i + est_i / 1);
         assert(greater <= nrows - i + rows_per_basement/2);
     }
@@ -131,11 +131,11 @@ run_test(void) {
 
     // verify key range for keys that do not exist in the tree
     r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
-    for (u_int64_t i=0; i<1+nrows; i++) {
+    for (uint64_t i=0; i<1+nrows; i++) {
 	char key[100];
 	snprintf(key, 100, "%08llu", (unsigned long long)2*i);
 	DBT k;
-	u_int64_t less,equal,greater;
+	uint64_t less,equal,greater;
 	int is_exact;
 	r = db->key_range64(db, txn, dbt_init(&k, key, 1+strlen(key)), &less, &equal, &greater, &is_exact); CKERR(r);
 	if (verbose) 
@@ -145,7 +145,7 @@ run_test(void) {
         assert(0 < less + equal + greater);
         assert(less + equal + greater < 2*nrows);
         assert(equal == 0);
-        u_int64_t est_i = max64(i, i + rows_per_basement/2);
+        uint64_t est_i = max64(i, i + rows_per_basement/2);
         assert(less <= est_i + est_i / 1);
         assert(greater <= nrows - i + rows_per_basement/2);
     }
diff --git a/src/tests/keyrange.cc b/src/tests/keyrange.cc
index 8c3e9f011be3148a3e35be6cdca88daae5b56c40..4b9ddceb37a2f7e5c1655240161f4956417641a0 100644
--- a/src/tests/keyrange.cc
+++ b/src/tests/keyrange.cc
@@ -17,10 +17,10 @@
 static DB_ENV *env = NULL;
 static DB_TXN *txn = NULL;
 static DB *db = NULL;
-static u_int32_t db_page_size = 4096;
-static u_int32_t db_basement_size = 4096;
+static uint32_t db_page_size = 4096;
+static uint32_t db_basement_size = 4096;
 static const char *envdir = ENVDIR;
-static u_int64_t nrows = 30000;
+static uint64_t nrows = 30000;
 static bool get_all = true;
 static bool use_loader = false;
 static bool random_keys = false;
@@ -45,12 +45,12 @@ my_generate_row(DB *dest_db UU(), DB *src_db UU(), DBT *dest_key UU(), DBT *dest
 }
 
 static void
-swap(u_int64_t keys[], u_int64_t i, u_int64_t j) {
-    u_int64_t t = keys[i]; keys[i] = keys[j]; keys[j] = t;
+swap(uint64_t keys[], uint64_t i, uint64_t j) {
+    uint64_t t = keys[i]; keys[i] = keys[j]; keys[j] = t;
 }
 
-static u_int64_t 
-max64(u_int64_t a, u_int64_t b) {
+static uint64_t 
+max64(uint64_t a, uint64_t b) {
     return a < b ? b : a;
 }
 
@@ -78,11 +78,11 @@ run_test(void) {
     r = txn->commit(txn, 0);    CKERR(r);
 
     uint64_t *XMALLOC_N(nrows, keys);
-    for (u_int64_t i = 0; i < nrows; i++)
+    for (uint64_t i = 0; i < nrows; i++)
         keys[i] = 2*i + 1;
 
     if (random_keys)
-        for (u_int64_t i = 0; i < nrows; i++)
+        for (uint64_t i = 0; i < nrows; i++)
             swap(keys, random() % nrows, random() % nrows);
 
     // insert keys 1, 3, 5, ... 2*(nrows-1) + 1
@@ -90,7 +90,7 @@ run_test(void) {
     if (use_loader) {
         DB_LOADER *loader = NULL;
         r = env->create_loader(env, txn, &loader, db, 1, &db, NULL, NULL, 0); CKERR(r);
-        for (u_int64_t i=0; i<nrows; i++) {
+        for (uint64_t i=0; i<nrows; i++) {
             char key[100],val[100];
             snprintf(key, sizeof key, "%08llu", (unsigned long long)keys[i]);
             snprintf(val, sizeof val, "%08llu", (unsigned long long)keys[i]);
@@ -100,7 +100,7 @@ run_test(void) {
         }
         r = loader->close(loader); CKERR(r);
     } else {
-        for (u_int64_t i=0; i<nrows; i++) {
+        for (uint64_t i=0; i<nrows; i++) {
             char key[100],val[100];
             snprintf(key, sizeof key, "%08llu", (unsigned long long)keys[i]);
             snprintf(val, sizeof val, "%08llu", (unsigned long long)keys[i]);
@@ -122,7 +122,7 @@ run_test(void) {
 
     if (get_all) {
         // read the basements into memory
-        for (u_int64_t i=0; i<nrows; i++) {
+        for (uint64_t i=0; i<nrows; i++) {
             char key[100];
             snprintf(key, 100, "%08llu", (unsigned long long)2*i+1);
             DBT k,v;
@@ -146,11 +146,11 @@ run_test(void) {
     if (0) goto skipit; // debug: just write the tree
 
     // verify key_range for keys that exist in the tree
-    for (u_int64_t i=0; i<nrows; i++) {
+    for (uint64_t i=0; i<nrows; i++) {
 	char key[100];
 	snprintf(key, 100, "%08llu", (unsigned long long)2*i+1);
 	DBT k;
-	u_int64_t less,equal,greater;
+	uint64_t less,equal,greater;
 	int is_exact;
 	r = db->key_range64(db, txn, dbt_init(&k, key, 1+strlen(key)), &less, &equal, &greater, &is_exact); CKERR(r);
 	if (verbose)
@@ -166,18 +166,18 @@ run_test(void) {
         } else {
             assert(less + equal + greater <= nrows + nrows / 8);
             assert(get_all ? equal == 1 : equal == 0);
-            u_int64_t est_i = max64(i, i + rows_per_basement/2);
+            uint64_t est_i = max64(i, i + rows_per_basement/2);
             assert(less <= est_i + est_i / 1);
             assert(greater <= nrows - i + rows_per_basement/2);
 	}
     }
 
     // verify key range for keys that do not exist in the tree
-    for (u_int64_t i=0; i<1+nrows; i++) {
+    for (uint64_t i=0; i<1+nrows; i++) {
 	char key[100];
 	snprintf(key, 100, "%08llu", (unsigned long long)2*i);
 	DBT k;
-	u_int64_t less,equal,greater;
+	uint64_t less,equal,greater;
 	int is_exact;
 	r = db->key_range64(db, txn, dbt_init(&k, key, 1+strlen(key)), &less, &equal, &greater, &is_exact); CKERR(r);
 	if (verbose) 
@@ -193,7 +193,7 @@ run_test(void) {
         } else {
             assert(less + equal + greater <= nrows + nrows / 8);
             assert(equal == 0);
-            u_int64_t est_i = max64(i, i + rows_per_basement/2);
+            uint64_t est_i = max64(i, i + rows_per_basement/2);
             assert(less <= est_i + est_i / 1);
             assert(greater <= nrows - i + rows_per_basement/2);
         }
diff --git a/src/tests/loader-dup-test.cc b/src/tests/loader-dup-test.cc
index 6487b202ed76b7a87b5431b35682951b0c02ce2b..d765919ad648e9ba22473d9e4e3fd27103b0333f 100644
--- a/src/tests/loader-dup-test.cc
+++ b/src/tests/loader-dup-test.cc
@@ -17,7 +17,7 @@ int CHECK_RESULTS=0;
 int USE_PUTS=0;
 enum {MAGIC=311};
 
-BOOL dup_row_at_end = FALSE; // FALSE: duplicate at the begining.  TRUE: duplicate at the end.   The duplicated row is row 0.
+bool dup_row_at_end = false; // false: duplicate at the begining.  true: duplicate at the end.   The duplicated row is row 0.
 int  dup_row_id     = 0;     // 0 means to use row 1 if inserting at the end, row NUM_ROWS if inserting at the beginning.  Otherwise insert the row specified here.
 
 //
@@ -342,7 +342,7 @@ static void run_test(void)
 // ------------ infrastructure ----------
 static void do_args(int argc, char * const argv[]);
 
-int num_rows_set = FALSE;
+int num_rows_set = false;
 
 int test_main(int argc, char * const *argv) {
     do_args(argc, argv);
@@ -401,7 +401,7 @@ static void do_args(int argc, char * const argv[]) {
         } else if (strcmp(argv[0], "-r")==0) {
             argc--; argv++;
             NUM_ROWS = atoi(argv[0]);
-	    num_rows_set = TRUE;
+	    num_rows_set = true;
         } else if (strcmp(argv[0], "-c")==0) {
             CHECK_RESULTS = 1;
         } else if (strcmp(argv[0], "-p")==0) {
@@ -409,7 +409,7 @@ static void do_args(int argc, char * const argv[]) {
         } else if (strcmp(argv[0], "-s")==0) {
 	    db_env_set_loader_size_factor(1);            
 	} else if (strcmp(argv[0], "-E")==0) {
-	    dup_row_at_end = TRUE;
+	    dup_row_at_end = true;
 	} else if (strcmp(argv[0], "-D")==0) {
             argc--; argv++;
 	    dup_row_id = atoi(argv[0]);
diff --git a/src/tests/loader-stress-del.cc b/src/tests/loader-stress-del.cc
index b1c092121a8f876f3d1a52045bd174b7f71dec65..5204d7c180fbdda7cb5097231a1768dc42f89e87 100644
--- a/src/tests/loader-stress-del.cc
+++ b/src/tests/loader-stress-del.cc
@@ -28,9 +28,9 @@ int CACHESIZE=old_default_cachesize;
 int ALLOW_DUPS=0;
 enum {MAGIC=311};
 char *datadir = NULL;
-BOOL check_est = TRUE; // do check the estimates by default
-BOOL footprint_print = FALSE; // print memory footprint info 
-BOOL upgrade_test = FALSE;   
+bool check_est = true; // do check the estimates by default
+bool footprint_print = false; // print memory footprint info 
+bool upgrade_test = false;   
 
 // Code for showing memory footprint information.
 pthread_mutex_t my_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -352,7 +352,7 @@ static int progress_infos_count=0;
 static int progress_infos_limit=0;
 
 // timing
-static BOOL did_start=FALSE;
+static bool did_start=false;
 static struct timeval start;
 
 static int poll_function (void *extra, float progress) {
@@ -433,7 +433,7 @@ static void test_loader(DB **dbs)
     int n = count_temp(env->i->real_data_dir);
     if (verbose) printf("Num temp files = %d\n", n);
 
-    did_start = TRUE;
+    did_start = true;
     gettimeofday(&start, 0);
 
     // close the loader
@@ -643,7 +643,7 @@ static void do_args(int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "-f")==0) {
-	    footprint_print = TRUE;
+	    footprint_print = true;
         } else if (strcmp(argv[0], "-r")==0) {
             argc--; argv++;
             NUM_ROWS = atoi(argv[0]);
@@ -672,9 +672,9 @@ static void do_args(int argc, char * const argv[]) {
             argc--; argv++;
             datadir = argv[0];
 	} else if (strcmp(argv[0], "--dont_check_est") == 0) {
-	    check_est = FALSE;
+	    check_est = false;
         } else if (strcmp(argv[0], "-u")==0) {
-            upgrade_test = TRUE;
+            upgrade_test = true;
 	} else {
 	    fprintf(stderr, "Unknown arg: %s\n", argv[0]);
 	    resultcode=1;
diff --git a/src/tests/loader-stress-test.cc b/src/tests/loader-stress-test.cc
index 769c9ebb6113a199b4d08376449d14582328c427..6447f49081274524d1c1d4ec532a18783ed2b730 100644
--- a/src/tests/loader-stress-test.cc
+++ b/src/tests/loader-stress-test.cc
@@ -37,9 +37,9 @@ int CACHESIZE=old_default_cachesize;
 int ALLOW_DUPS=0;
 enum {MAGIC=311};
 char *datadir = NULL;
-BOOL check_est = TRUE; // do check the estimates by default
-BOOL footprint_print = FALSE; // print memory footprint info 
-BOOL upgrade_test = FALSE;   
+bool check_est = true; // do check the estimates by default
+bool footprint_print = false; // print memory footprint info 
+bool upgrade_test = false;   
 
 // Code for showing memory footprint information.
 pthread_mutex_t my_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -317,7 +317,7 @@ static int progress_infos_count=0;
 static int progress_infos_limit=0;
 
 // timing
-static BOOL did_start=FALSE;
+static bool did_start=false;
 static struct timeval start;
 
 static int poll_function (void *extra, float progress) {
@@ -398,7 +398,7 @@ static void test_loader(DB **dbs)
     int n = count_temp(env->i->real_data_dir);
     if (verbose) printf("Num temp files = %d\n", n);
 
-    did_start = TRUE;
+    did_start = true;
     gettimeofday(&start, 0);
 
     // close the loader
@@ -433,9 +433,9 @@ static void test_loader(DB **dbs)
                 if (verbose)
                     printf("NUM_ROWS=%d n_keys=%" PRIu64 " n_data=%" PRIu64 " dsize=%" PRIu64 " fsize=%" PRIu64 "\n",
                            NUM_ROWS, stats.bt_nkeys, stats.bt_ndata, stats.bt_dsize, stats.bt_fsize);
-		assert(stats.bt_nkeys <= (u_int64_t)NUM_ROWS);  // Fix as part of #4129.  Was ==
-		assert(stats.bt_ndata <= (u_int64_t)NUM_ROWS);
-		assert(stats.bt_dsize == ((u_int64_t)NUM_ROWS) * 2 * sizeof(unsigned int));
+		assert(stats.bt_nkeys <= (uint64_t)NUM_ROWS);  // Fix as part of #4129.  Was ==
+		assert(stats.bt_ndata <= (uint64_t)NUM_ROWS);
+		assert(stats.bt_dsize == ((uint64_t)NUM_ROWS) * 2 * sizeof(unsigned int));
 		r = txn->commit(txn, 0);
 		CKERR(r);
 	    }
@@ -627,7 +627,7 @@ static void do_args(int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "-f")==0) {
-	    footprint_print = TRUE;
+	    footprint_print = true;
         } else if (strcmp(argv[0], "-r")==0) {
             argc--; argv++;
             NUM_ROWS = atoi(argv[0]);
@@ -656,9 +656,9 @@ static void do_args(int argc, char * const argv[]) {
             argc--; argv++;
             datadir = argv[0];
 	} else if (strcmp(argv[0], "--dont_check_est") == 0) {
-	    check_est = FALSE;
+	    check_est = false;
         } else if (strcmp(argv[0], "-u")==0) {
-            upgrade_test = TRUE;
+            upgrade_test = true;
 	} else {
 	    fprintf(stderr, "Unknown arg: %s\n", argv[0]);
 	    resultcode=1;
diff --git a/src/tests/maxsize-for-loader.cc b/src/tests/maxsize-for-loader.cc
index 24eb989d77269be529fcbe18cef2dde0685eaf49..bb542ea14663aaec4308cb83a431eebfcbae4e67 100644
--- a/src/tests/maxsize-for-loader.cc
+++ b/src/tests/maxsize-for-loader.cc
@@ -193,7 +193,7 @@ static void run_test(uint32_t nr, uint32_t wdb, uint32_t wrow, enum how_to_fail
 // ------------ infrastructure ----------
 static void do_args(int argc, char * const argv[]);
 
-int num_rows_set = FALSE;
+int num_rows_set = false;
 
 int test_main(int argc, char * const *argv) {
     do_args(argc, argv);
diff --git a/src/tests/mvcc-many-committed.cc b/src/tests/mvcc-many-committed.cc
index 2c9e3971feea983bd75c2570400c2015c53c3f8f..9db7e1125843d450f174fe51a5da35fd8b3b1450 100644
--- a/src/tests/mvcc-many-committed.cc
+++ b/src/tests/mvcc-many-committed.cc
@@ -17,8 +17,8 @@ int test_main (int argc, char * const argv[]) {
     CKERR(r);
     toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
     DB_ENV *env;
-    u_int32_t i = 0;
-    u_int32_t num_read_txns = 1000;
+    uint32_t i = 0;
+    uint32_t num_read_txns = 1000;
     r = db_env_create(&env, 0);                                                         CKERR(r);
     env->set_errfile(env, stderr);
     r = env->set_lk_max_locks(env, 0xffffffff);
@@ -42,7 +42,7 @@ int test_main (int argc, char * const argv[]) {
 
     for (i = 0; i < num_read_txns; i++) {
         DB_TXN* put_txn = NULL;
-        u_int32_t data = i;
+        uint32_t data = i;
         r = env->txn_begin(env, NULL, &put_txn, DB_TXN_SNAPSHOT);
         CKERR(r);
         r = db->put(
@@ -69,7 +69,7 @@ int test_main (int argc, char * const argv[]) {
         r = db->cursor(db, read_txns[i], &snapshot_cursor, 0); CKERR(r);        
         r = snapshot_cursor->c_get(snapshot_cursor, &curr_key, &curr_val, DB_NEXT); CKERR(r);
         assert(((char *)(curr_key.data))[0] == 'a');
-        assert((*(u_int32_t *)(curr_val.data)) == i);
+        assert((*(uint32_t *)(curr_val.data)) == i);
         assert(curr_key.size == 4);
         assert(curr_val.size == 4);
         snapshot_cursor->c_close(snapshot_cursor);
@@ -90,7 +90,7 @@ int test_main (int argc, char * const argv[]) {
             ); 
         CKERR(r);
         assert(((char *)(curr_key.data))[0] == 'a');
-        assert((*(u_int32_t *)(curr_val.data)) == (num_read_txns - 1));
+        assert((*(uint32_t *)(curr_val.data)) == (num_read_txns - 1));
         assert(curr_key.size == 4);
         assert(curr_val.size == 4);
         read_uncommitted_cursor->c_close(read_uncommitted_cursor);
diff --git a/src/tests/perf_checkpoint_var.cc b/src/tests/perf_checkpoint_var.cc
index 5f04b64d551a8e02e7f6a3ddb439c79be704a3c3..f977a6facf0b117d3e5b83e6d2a9d159ec40bb50 100644
--- a/src/tests/perf_checkpoint_var.cc
+++ b/src/tests/perf_checkpoint_var.cc
@@ -15,19 +15,19 @@
 
 #include "threaded_stress_test_helpers.h"
 
-u_int64_t num_basements_decompressed;
-u_int64_t num_buffers_decompressed;
-u_int64_t num_basements_fetched;
-u_int64_t num_buffers_fetched;
-u_int64_t num_pivots_fetched;
+uint64_t num_basements_decompressed;
+uint64_t num_buffers_decompressed;
+uint64_t num_basements_fetched;
+uint64_t num_buffers_fetched;
+uint64_t num_pivots_fetched;
 
 static void checkpoint_callback_1(void * extra) {
     DB_ENV* CAST_FROM_VOIDP(env, extra);
-    u_int64_t old_num_basements_decompressed = num_basements_decompressed;
-    u_int64_t old_num_buffers_decompressed = num_buffers_decompressed;
-    u_int64_t old_num_basements_fetched = num_basements_fetched;
-    u_int64_t old_num_buffers_fetched = num_buffers_fetched;
-    u_int64_t old_num_pivots_fetched = num_pivots_fetched;
+    uint64_t old_num_basements_decompressed = num_basements_decompressed;
+    uint64_t old_num_buffers_decompressed = num_buffers_decompressed;
+    uint64_t old_num_basements_fetched = num_basements_fetched;
+    uint64_t old_num_buffers_fetched = num_buffers_fetched;
+    uint64_t old_num_pivots_fetched = num_pivots_fetched;
 
     num_basements_decompressed = 
         get_engine_status_val(env, "FT_NUM_BASEMENTS_DECOMPRESSED_NORMAL") +
@@ -133,7 +133,7 @@ static int checkpoint_var(DB_TXN *txn, ARG arg, void* operation_extra, void *sta
     int i;
     for (i = 0; i < 10; i++) {
         // do point queries
-        ptquery_and_maybe_check_op(db, txn, arg, FALSE);
+        ptquery_and_maybe_check_op(db, txn, arg, false);
     }
     increment_counter(stats_extra, PTQUERIES, i);
     for (i = 0; i < 20; i++) {
diff --git a/src/tests/perf_ptquery2.cc b/src/tests/perf_ptquery2.cc
index 6bb14554f60e130745bb1a73da225914b6372519..c314ddca53fd11c7e7b7988899b4d09697d4e2ca 100644
--- a/src/tests/perf_ptquery2.cc
+++ b/src/tests/perf_ptquery2.cc
@@ -19,7 +19,7 @@
 static int ptquery_op2(DB_TXN *txn, ARG arg, void* operation_extra, void *stats_extra) {
     int db_index = *(int *)operation_extra;
     DB* db = arg->dbp[db_index];
-    int r = ptquery_and_maybe_check_op(db, txn, arg, TRUE);
+    int r = ptquery_and_maybe_check_op(db, txn, arg, true);
     increment_counter(stats_extra, PTQUERIES, 1);
     return r;
 }
diff --git a/src/tests/print_engine_status.cc b/src/tests/print_engine_status.cc
index fc4cbd1e7d90b6babda28c0b75db8311493f92ea..910b7827d8ef992a58354e62967f0cf9c24c993e 100644
--- a/src/tests/print_engine_status.cc
+++ b/src/tests/print_engine_status.cc
@@ -30,7 +30,7 @@ test_shutdown(void) {
 }
 
 static void
-setup (u_int32_t flags) {
+setup (uint32_t flags) {
     int r;
     if (env)
         test_shutdown();
diff --git a/src/tests/progress.cc b/src/tests/progress.cc
index 00dfb648515e63488896d099d33bd2a583147fea..93e979cd79365b0935e7e69b5a10239a8456768a 100644
--- a/src/tests/progress.cc
+++ b/src/tests/progress.cc
@@ -130,7 +130,7 @@ start_txn_prevent_dname_lock(void) {
 }
 
 static void nopoll(TOKU_TXN_PROGRESS UU(progress), void *UU(extra)) {
-    assert(FALSE);
+    assert(false);
 }
 
 static void
@@ -180,14 +180,14 @@ static void
 abort_txn(int expect_number_polls) {
     assert(env!=NULL);
     DB_TXN *txn;
-    BOOL child;
+    bool child;
     if (txn_child) {
         txn = txn_child;
-        child = TRUE;
+        child = true;
     }
     else {
         txn = txn_parent;
-        child = FALSE;
+        child = false;
     }
     assert(txn);
     
@@ -213,14 +213,14 @@ static void
 commit_txn(int expect_number_polls) {
     assert(env!=NULL);
     DB_TXN *txn;
-    BOOL child;
+    bool child;
     if (txn_child) {
         txn = txn_child;
-        child = TRUE;
+        child = true;
     }
     else {
         txn = txn_parent;
-        child = FALSE;
+        child = false;
     }
     assert(txn);
     if (child)
diff --git a/src/tests/queries_with_deletes.cc b/src/tests/queries_with_deletes.cc
index bc5515c6892224fc1d31a507515bd66fe185e7aa..2c868a2dfe750119593c97a7bd6743807dbc63f1 100644
--- a/src/tests/queries_with_deletes.cc
+++ b/src/tests/queries_with_deletes.cc
@@ -22,7 +22,7 @@ int test_main (int argc, char * const argv[]) {
   r = db_env_create(&env, 0);                                                         CKERR(r);
   env->set_errfile(env, stderr);
   // set a cachetable size of 10K
-  u_int32_t cachesize = 10*1024;
+  uint32_t cachesize = 10*1024;
   // as part of #4503, arbitrarily increasing sizze of cachetable
   // the idea is to make it small enough such that all data 
   // cannot fit in the cachetable, but big enough such that 
@@ -53,10 +53,10 @@ int test_main (int argc, char * const argv[]) {
   DB_TXN* txn;
   r = env->txn_begin(env, NULL, &txn, 0);
   CKERR(r);
-  for (u_int32_t i = 0; i < cachesize; i++) {
+  for (uint32_t i = 0; i < cachesize; i++) {
       DBT key,val;
-      u_int64_t key_data = 2*i;
-      u_int64_t val_data = 4*i;
+      uint64_t key_data = 2*i;
+      uint64_t val_data = 4*i;
       r = db->put(
           db,
           txn,
@@ -77,13 +77,13 @@ int test_main (int argc, char * const argv[]) {
   if (verbose) printf("starting insertion of odd elements and deletion of even elements\n");
   r = env->txn_begin(env, NULL, &txn, 0);
   CKERR(r);
-  for (u_int32_t i = 0; i < cachesize; i++) {
+  for (uint32_t i = 0; i < cachesize; i++) {
       //
       // insert odd values, and delete even values
       //
       DBT key,val;
-      u_int64_t key_data = 2*i+1;
-      u_int64_t val_data = 4*i+2;
+      uint64_t key_data = 2*i+1;
+      uint64_t val_data = 4*i+2;
       dbt_init(&key, &key_data, sizeof(key_data));
       dbt_init(&val, &val_data, sizeof(val_data));
       r = db->put(
@@ -119,7 +119,7 @@ int test_main (int argc, char * const argv[]) {
   memset(&val, 0, sizeof(val));
   if (verbose) printf("starting cursor first query\n");
   // now let's do the cursor reads and verify that all the data is read properly
-  for (u_int32_t i = 0; i < cachesize; i++) {
+  for (uint32_t i = 0; i < cachesize; i++) {
       r = cursor_first->c_get(cursor_first, &key, &val, DB_NEXT);
       CKERR(r);
       assert(key.size == 8);
@@ -132,7 +132,7 @@ int test_main (int argc, char * const argv[]) {
   
   if (verbose) printf("starting cursor second query\n");
   // now let's do the cursor reads and verify that all the data is read properly
-  for (u_int32_t i = 0; i < cachesize; i++) {
+  for (uint32_t i = 0; i < cachesize; i++) {
       r = cursor_second->c_get(cursor_second, &key, &val, DB_NEXT);
       CKERR(r);
       assert(key.size == 8);
diff --git a/src/tests/recover-2483.cc b/src/tests/recover-2483.cc
index b9f124fccec916af37e3f9ff21ae4fde5c51e870..aadc832462e623d2c02bdcfcd60927ae180bdf43 100644
--- a/src/tests/recover-2483.cc
+++ b/src/tests/recover-2483.cc
@@ -76,7 +76,7 @@ do_x1_shutdown (void) {
 }
 
 static void
-do_x1_recover (BOOL UU(did_commit)) {
+do_x1_recover (bool UU(did_commit)) {
     int r;
     r=db_env_create(&env, 0);                                                  assert(r==0);
     env->set_errfile(env, stderr);
@@ -100,7 +100,7 @@ do_x1_recover (BOOL UU(did_commit)) {
     r=env->close(env, 0);                                                      CKERR(r);
 }
 
-BOOL do_commit=FALSE, do_recover_committed=FALSE;
+bool do_commit=false, do_recover_committed=false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -114,9 +114,9 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -156,7 +156,7 @@ test_main (int argc, char * const argv[])
     if (do_commit) {
 	do_x1_shutdown();
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } 
     for (i=0; i<N; i++) {
         toku_free(keys[i]);
diff --git a/src/tests/recover-3113.cc b/src/tests/recover-3113.cc
index 93805abb10d44c409413ab02eff9e666b104a5e6..c1fd3a3dab7a254711da2b47dbe483af32d1afe8 100644
--- a/src/tests/recover-3113.cc
+++ b/src/tests/recover-3113.cc
@@ -32,7 +32,7 @@ static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_I
 static const char *namea="a.db";
 static void checkpoint_callback_2(void * UU(extra));
 static DB_ENV *env;
-static BOOL do_test=FALSE, do_recover=FALSE;
+static bool do_test=false, do_recover=false;
 
 static void
 run_test(void) {
@@ -111,9 +111,9 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-5146.cc b/src/tests/recover-5146.cc
index e8cd4c8f134a7832a78113479b8397a630c39e0a..1fe1ead394009424a88fa92305d0362a44e76d5b 100644
--- a/src/tests/recover-5146.cc
+++ b/src/tests/recover-5146.cc
@@ -31,7 +31,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const char *namea="a.db";
 static DB_ENV *env;
-static BOOL do_test=FALSE, do_recover=FALSE;
+static bool do_test=false, do_recover=false;
 
 static void checkpoint_callback_2(void * UU(extra)) {
     toku_hard_crash_on_purpose();
@@ -60,7 +60,7 @@ run_test(void) {
         dbt_init(&k, "a", 2);
         dbt_init(&v, "a", 2);
         r = db->put(db, txn, &k, &v, 0);                                  CKERR(r);
-        u_int8_t gid[DB_GID_SIZE];
+        uint8_t gid[DB_GID_SIZE];
         memset(gid, 0, DB_GID_SIZE);
         gid[0]=42;
         r = txn->prepare(txn, gid);                                                            CKERR(r);
@@ -113,9 +113,9 @@ static void test_parse_args (int argc, char * const argv[]) {
             verbose--;
             if (verbose<0) verbose=0;
         } else if (strcmp(argv[0], "--test")==0) {
-            do_test=TRUE;
+            do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "-h")==0) {
             resultcode=0;
         do_usage:
diff --git a/src/tests/recover-checkpoint-fcreate-fdelete-fcreate.cc b/src/tests/recover-checkpoint-fcreate-fdelete-fcreate.cc
index 65f3e0e89ec23686c60461656f189da6c07e9e1c..37f711f4f6bb8e6563ea7fe3a73e229fdd4a08e5 100644
--- a/src/tests/recover-checkpoint-fcreate-fdelete-fcreate.cc
+++ b/src/tests/recover-checkpoint-fcreate-fdelete-fcreate.cc
@@ -50,7 +50,7 @@ static void run_recover (void) {
     r = db_env_create(&env, 0);                                                             CKERR(r);
     r = env->open(env, ENVDIR, envflags + DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO);             CKERR(r);
     
-    u_int32_t dbflags;
+    uint32_t dbflags;
     DB *db;
     r = db_create(&db, env, 0);                                                             CKERR(r);
     r = db->open(db, NULL, namea, NULL, DB_UNKNOWN, DB_AUTO_COMMIT, 0666);                  CKERR(r);
@@ -83,7 +83,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -96,13 +96,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-checkpoint-fopen-abort.cc b/src/tests/recover-checkpoint-fopen-abort.cc
index e9f1eb986e933fade567da711977a81a6c6ba9d0..c9d7b85d982771bde9d88ea819a5f8c95c6d0d2f 100644
--- a/src/tests/recover-checkpoint-fopen-abort.cc
+++ b/src/tests/recover-checkpoint-fopen-abort.cc
@@ -13,7 +13,7 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
 const char *namea="a.db";
 const char *nameb="b.db";
 
-static void run_test (BOOL do_commit, BOOL do_abort) {
+static void run_test (bool do_commit, bool do_abort) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -54,7 +54,7 @@ static void run_test (BOOL do_commit, BOOL do_abort) {
     toku_hard_crash_on_purpose();
 }
 
-static void run_recover (BOOL did_commit) {
+static void run_recover (bool did_commit) {
     DB_ENV *env;
     DB *dba, *dbb;
     int r;
@@ -63,7 +63,7 @@ static void run_recover (BOOL did_commit) {
     r = db_create(&dba, env, 0);                                                            CKERR(r);
     r = dba->open(dba, NULL, namea, NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666);        CKERR(r);
 
-    u_int32_t dbflags;
+    uint32_t dbflags;
     dbflags = 0;
     r = dba->get_flags(dba, &dbflags);                                                        CKERR(r);
     assert(dbflags == 0);
@@ -142,7 +142,7 @@ static void run_no_recover (void) {
 const char *cmd;
 
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -155,19 +155,19 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -201,13 +201,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 int test_main (int argc, char * const argv[]) {
     test_parse_args(argc, argv);
     if (do_commit) {
-	run_test(TRUE, FALSE);
+	run_test(true, false);
     } else if (do_abort) {
-        run_test(FALSE, TRUE);
+        run_test(false, true);
     } else if (do_recover_committed) {
-        run_recover(TRUE);
+        run_recover(true);
     } else if (do_recover_aborted) {
-        run_recover(FALSE);
+        run_recover(false);
     } else if (do_recover_only) {
         run_recover_only();
     } else if (do_no_recover) {
diff --git a/src/tests/recover-checkpoint-fopen-commit.cc b/src/tests/recover-checkpoint-fopen-commit.cc
index cfe38ef9a5e1c2d0966cda395ada088c904eb054..144eec8f6a1dc034038275a08721156c14eae792 100644
--- a/src/tests/recover-checkpoint-fopen-commit.cc
+++ b/src/tests/recover-checkpoint-fopen-commit.cc
@@ -13,7 +13,7 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
 const char *namea="a.db";
 const char *nameb="b.db";
 
-static void run_test (BOOL do_commit, BOOL do_abort) {
+static void run_test (bool do_commit, bool do_abort) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -54,7 +54,7 @@ static void run_test (BOOL do_commit, BOOL do_abort) {
     toku_hard_crash_on_purpose();
 }
 
-static void run_recover (BOOL did_commit) {
+static void run_recover (bool did_commit) {
     DB_ENV *env;
     DB *dba, *dbb;
     int r;
@@ -63,7 +63,7 @@ static void run_recover (BOOL did_commit) {
     r = db_create(&dba, env, 0);                                                            CKERR(r);
     r = dba->open(dba, NULL, namea, NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666);        CKERR(r);
 
-    u_int32_t dbflags;
+    uint32_t dbflags;
     dbflags = 0;
     r = dba->get_flags(dba, &dbflags);                                                        CKERR(r);
     assert(dbflags == 0);
@@ -142,7 +142,7 @@ static void run_no_recover (void) {
 const char *cmd;
 
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -155,19 +155,19 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -201,13 +201,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 int test_main (int argc, char * const argv[]) {
     test_parse_args(argc, argv);
     if (do_commit) {
-	run_test(TRUE, FALSE);
+	run_test(true, false);
     } else if (do_abort) {
-        run_test(FALSE, TRUE);
+        run_test(false, true);
     } else if (do_recover_committed) {
-        run_recover(TRUE);
+        run_recover(true);
     } else if (do_recover_aborted) {
-        run_recover(FALSE);
+        run_recover(false);
     } else if (do_recover_only) {
         run_recover_only();
     } else if (do_no_recover) {
diff --git a/src/tests/recover-checkpoint-fopen-dupsort-abort.cc b/src/tests/recover-checkpoint-fopen-dupsort-abort.cc
index 084afb618808ac87e00db484af29a672c58a7a95..0f5945f83f407b99fe6b66e555dc1abed7046f45 100644
--- a/src/tests/recover-checkpoint-fopen-dupsort-abort.cc
+++ b/src/tests/recover-checkpoint-fopen-dupsort-abort.cc
@@ -13,7 +13,7 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
 const char *namea="a.db";
 const char *nameb="b.db";
 
-static void run_test (BOOL do_commit, BOOL do_abort) {
+static void run_test (bool do_commit, bool do_abort) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -55,7 +55,7 @@ static void run_test (BOOL do_commit, BOOL do_abort) {
     toku_hard_crash_on_purpose();
 }
 
-static void run_recover (BOOL did_commit) {
+static void run_recover (bool did_commit) {
     DB_ENV *env;
     DB *dba, *dbb;
     int r;
@@ -64,7 +64,7 @@ static void run_recover (BOOL did_commit) {
     r = db_create(&dba, env, 0);                                                            CKERR(r);
     r = dba->open(dba, NULL, namea, NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666);        CKERR(r);
 
-    u_int32_t dbflags;
+    uint32_t dbflags;
     dbflags = 0;
     r = dba->get_flags(dba, &dbflags);                                                        CKERR(r);
     assert(dbflags == 0);
@@ -143,7 +143,7 @@ static void run_no_recover (void) {
 const char *cmd;
 
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -156,19 +156,19 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -202,13 +202,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 int test_main (int argc, char * const argv[]) {
     test_parse_args(argc, argv);
     if (do_commit) {
-	run_test(TRUE, FALSE);
+	run_test(true, false);
     } else if (do_abort) {
-        run_test(FALSE, TRUE);
+        run_test(false, true);
     } else if (do_recover_committed) {
-        run_recover(TRUE);
+        run_recover(true);
     } else if (do_recover_aborted) {
-        run_recover(FALSE);
+        run_recover(false);
     } else if (do_recover_only) {
         run_recover_only();
     } else if (do_no_recover) {
diff --git a/src/tests/recover-checkpoint-fopen-dupsort-commit.cc b/src/tests/recover-checkpoint-fopen-dupsort-commit.cc
index d6b8a915a0628bfce3cb150cda9b800749da6f56..d501be4aebd4d0ab1448ac513cd58f84071a9f08 100644
--- a/src/tests/recover-checkpoint-fopen-dupsort-commit.cc
+++ b/src/tests/recover-checkpoint-fopen-dupsort-commit.cc
@@ -13,7 +13,7 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
 const char *namea="a.db";
 const char *nameb="b.db";
 
-static void run_test (BOOL do_commit, BOOL do_abort) {
+static void run_test (bool do_commit, bool do_abort) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -55,7 +55,7 @@ static void run_test (BOOL do_commit, BOOL do_abort) {
     toku_hard_crash_on_purpose();
 }
 
-static void run_recover (BOOL did_commit) {
+static void run_recover (bool did_commit) {
     DB_ENV *env;
     DB *dba, *dbb;
     int r;
@@ -64,7 +64,7 @@ static void run_recover (BOOL did_commit) {
     r = db_create(&dba, env, 0);                                                            CKERR(r);
     r = dba->open(dba, NULL, namea, NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666);        CKERR(r);
 
-    u_int32_t dbflags;
+    uint32_t dbflags;
     dbflags = 0;
     r = dba->get_flags(dba, &dbflags);                                                        CKERR(r);
     assert(dbflags == 0);
@@ -143,7 +143,7 @@ static void run_no_recover (void) {
 const char *cmd;
 
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -156,19 +156,19 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -202,13 +202,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 int test_main (int argc, char * const argv[]) {
     test_parse_args(argc, argv);
     if (do_commit) {
-	run_test(TRUE, FALSE);
+	run_test(true, false);
     } else if (do_abort) {
-        run_test(FALSE, TRUE);
+        run_test(false, true);
     } else if (do_recover_committed) {
-        run_recover(TRUE);
+        run_recover(true);
     } else if (do_recover_aborted) {
-        run_recover(FALSE);
+        run_recover(false);
     } else if (do_recover_only) {
         run_recover_only();
     } else if (do_no_recover) {
diff --git a/src/tests/recover-compare-db-descriptor.cc b/src/tests/recover-compare-db-descriptor.cc
index 068f13b6879ccf2670248b3444ec3eeb72d13527..d204dc1f7ffb95a2214806150196d3508afdd22a 100644
--- a/src/tests/recover-compare-db-descriptor.cc
+++ b/src/tests/recover-compare-db-descriptor.cc
@@ -41,7 +41,7 @@ change_descriptor(DB_ENV* env, DB* db) {
 }
 
 static void
-do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
+do_x1_shutdown (bool do_commit, bool do_abort) {
     int r;
     r = system("rm -rf " ENVDIR); CKERR(r);
     r = toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
@@ -85,7 +85,7 @@ do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
 }
 
 static void
-do_x1_recover (BOOL did_commit) {
+do_x1_recover (bool did_commit) {
     DB_ENV *env;
     DB *dba, *dbb;
     int r;
@@ -177,7 +177,7 @@ const char *cmd;
 #if 0
 
 static void
-do_test_internal (BOOL commit)
+do_test_internal (bool commit)
 {
     pid_t pid;
     if (0 == (pid=fork())) {
@@ -212,14 +212,14 @@ do_test_internal (BOOL commit)
 
 static void
 do_test (void) {
-    do_test_internal(TRUE);
-    do_test_internal(FALSE);
+    do_test_internal(true);
+    do_test_internal(false);
 }
 
 #endif
 
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false, do_no_recover = false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -233,19 +233,19 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -281,15 +281,15 @@ test_main (int argc, char * const argv[])
 {
     x1_parse_args(argc, argv);
     if (do_commit) {
-	do_x1_shutdown (TRUE, FALSE);
+	do_x1_shutdown (true, false);
     } else if (do_abort) {
-	do_x1_shutdown (FALSE, FALSE);
+	do_x1_shutdown (false, false);
     } else if (do_explicit_abort) {
-        do_x1_shutdown(FALSE, TRUE);
+        do_x1_shutdown(false, true);
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } else if (do_recover_aborted) {
-	do_x1_recover(FALSE);
+	do_x1_recover(false);
     } else if (do_recover_only) {
         do_x1_recover_only();
     } else if (do_no_recover) {
diff --git a/src/tests/recover-compare-db.cc b/src/tests/recover-compare-db.cc
index f0adf348038b60cdaa7ce5593f9a01814a3add85..94fb19b1600591895629107d491d94c7501a7279 100644
--- a/src/tests/recover-compare-db.cc
+++ b/src/tests/recover-compare-db.cc
@@ -24,7 +24,7 @@ static int my_compare(DB *UU(db), const DBT *a, const DBT *b) {
 #endif
 
 static void
-do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
+do_x1_shutdown (bool do_commit, bool do_abort) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -66,7 +66,7 @@ do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
 }
 
 static void
-do_x1_recover (BOOL did_commit) {
+do_x1_recover (bool did_commit) {
     DB_ENV *env;
     DB *dba, *dbb;
     int r;
@@ -155,7 +155,7 @@ const char *cmd;
 #if 0
 
 static void
-do_test_internal (BOOL commit)
+do_test_internal (bool commit)
 {
     pid_t pid;
     if (0 == (pid=fork())) {
@@ -190,14 +190,14 @@ do_test_internal (BOOL commit)
 
 static void
 do_test (void) {
-    do_test_internal(TRUE);
-    do_test_internal(FALSE);
+    do_test_internal(true);
+    do_test_internal(false);
 }
 
 #endif
 
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false, do_no_recover = false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -211,19 +211,19 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -259,15 +259,15 @@ test_main (int argc, char * const argv[])
 {
     x1_parse_args(argc, argv);
     if (do_commit) {
-	do_x1_shutdown (TRUE, FALSE);
+	do_x1_shutdown (true, false);
     } else if (do_abort) {
-	do_x1_shutdown (FALSE, FALSE);
+	do_x1_shutdown (false, false);
     } else if (do_explicit_abort) {
-        do_x1_shutdown(FALSE, TRUE);
+        do_x1_shutdown(false, true);
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } else if (do_recover_aborted) {
-	do_x1_recover(FALSE);
+	do_x1_recover(false);
     } else if (do_recover_only) {
         do_x1_recover_only();
     } else if (do_no_recover) {
diff --git a/src/tests/recover-dbopen-eclose.cc b/src/tests/recover-dbopen-eclose.cc
index e107c9a8b7d7da0228faf8aef563d255cb66d5ae..02c4b725d2f4e509cf87060ccdfc0e2a35bae66e 100644
--- a/src/tests/recover-dbopen-eclose.cc
+++ b/src/tests/recover-dbopen-eclose.cc
@@ -61,7 +61,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -74,13 +74,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-del-multiple-abort.cc b/src/tests/recover-del-multiple-abort.cc
index 47385aa13c0ab59bad88904a3b6f9601ec8e59eb..9a5fcf4fc64c3645de2d0a5be69d409c3f970b24 100644
--- a/src/tests/recover-del-multiple-abort.cc
+++ b/src/tests/recover-del-multiple-abort.cc
@@ -201,8 +201,8 @@ usage(void) {
 
 int
 test_main (int argc, char * const argv[]) {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
     int ndbs = 2;
     int nrows = 1;
 
@@ -219,11 +219,11 @@ test_main (int argc, char * const argv[]) {
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--ndbs") == 0 && i+1 < argc) {
diff --git a/src/tests/recover-del-multiple-srcdb-fdelete-all.cc b/src/tests/recover-del-multiple-srcdb-fdelete-all.cc
index 85f47fa35a07a335fd0715d7a6c10d2a49e1cdb2..abe240c081b2240badafefb9cd2d2435f7036489 100644
--- a/src/tests/recover-del-multiple-srcdb-fdelete-all.cc
+++ b/src/tests/recover-del-multiple-srcdb-fdelete-all.cc
@@ -197,8 +197,8 @@ usage(void) {
 
 int
 test_main (int argc, char * const argv[]) {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
     int ndbs = 2;
     int nrows = 1;
 
@@ -215,11 +215,11 @@ test_main (int argc, char * const argv[]) {
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--ndbs") == 0 && i+1 < argc) {
diff --git a/src/tests/recover-del-multiple.cc b/src/tests/recover-del-multiple.cc
index 296aff7966b8c3942c21a486870dd357e27549cf..50cdbe30c9f8bc7aa174c45285fc8c3fab5dcb92 100644
--- a/src/tests/recover-del-multiple.cc
+++ b/src/tests/recover-del-multiple.cc
@@ -190,8 +190,8 @@ usage(void) {
 
 int
 test_main (int argc, char * const argv[]) {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
     int ndbs = 2;
     int nrows = 1;
 
@@ -208,11 +208,11 @@ test_main (int argc, char * const argv[]) {
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--ndbs") == 0 && i+1 < argc) {
diff --git a/src/tests/recover-delboth-after-checkpoint.cc b/src/tests/recover-delboth-after-checkpoint.cc
index 5053b5a07bfa31e9bd38a058349b3b368d0c8b21..a9eb3f28349cefd8aa1bf69123aa2d632342ca97 100644
--- a/src/tests/recover-delboth-after-checkpoint.cc
+++ b/src/tests/recover-delboth-after-checkpoint.cc
@@ -12,7 +12,7 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
 const char *namea="a.db";
 
 static void
-run_test (BOOL do_commit, BOOL do_abort) {
+run_test (bool do_commit, bool do_abort) {
     int r;
 
     r = system("rm -rf " ENVDIR);
@@ -62,7 +62,7 @@ run_test (BOOL do_commit, BOOL do_abort) {
 }
 
 static void
-run_recover (BOOL UU(did_commit)) {
+run_recover (bool UU(did_commit)) {
     DB_ENV *env;
     int r;
     r = db_env_create(&env, 0);                                                             CKERR(r);
@@ -130,7 +130,7 @@ run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false, do_no_recover = false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -144,19 +144,19 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -192,15 +192,15 @@ test_main (int argc, char * const argv[])
 {
     x1_parse_args(argc, argv);
     if (do_commit) {
-	run_test (TRUE, FALSE);
+	run_test (true, false);
     } else if (do_abort) {
-	run_test (FALSE, FALSE);
+	run_test (false, false);
     } else if (do_explicit_abort) {
-        run_test(FALSE, TRUE);
+        run_test(false, true);
     } else if (do_recover_committed) {
-	run_recover(TRUE);
+	run_recover(true);
     } else if (do_recover_aborted) {
-	run_recover(FALSE);
+	run_recover(false);
     } else if (do_recover_only) {
         run_recover_only();
     } else if (do_no_recover) {
diff --git a/src/tests/recover-delboth-checkpoint.cc b/src/tests/recover-delboth-checkpoint.cc
index 2238e8c0b0809afea8bdfa05207dd1973e72fb50..725b9e48caffeddbb0939493948b02dd97e4bc07 100644
--- a/src/tests/recover-delboth-checkpoint.cc
+++ b/src/tests/recover-delboth-checkpoint.cc
@@ -12,7 +12,7 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
 const char *namea="a.db";
 
 static void
-run_test (BOOL do_commit, BOOL do_abort) {
+run_test (bool do_commit, bool do_abort) {
     int r;
 
     r = system("rm -rf " ENVDIR);
@@ -62,7 +62,7 @@ run_test (BOOL do_commit, BOOL do_abort) {
 }
 
 static void
-run_recover (BOOL UU(did_commit)) {
+run_recover (bool UU(did_commit)) {
     DB_ENV *env;
     int r;
     r = db_env_create(&env, 0);                                                             CKERR(r);
@@ -130,7 +130,7 @@ run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false, do_no_recover = false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -144,19 +144,19 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -192,15 +192,15 @@ test_main (int argc, char * const argv[])
 {
     x1_parse_args(argc, argv);
     if (do_commit) {
-	run_test (TRUE, FALSE);
+	run_test (true, false);
     } else if (do_abort) {
-	run_test (FALSE, FALSE);
+	run_test (false, false);
     } else if (do_explicit_abort) {
-        run_test(FALSE, TRUE);
+        run_test(false, true);
     } else if (do_recover_committed) {
-	run_recover(TRUE);
+	run_recover(true);
     } else if (do_recover_aborted) {
-	run_recover(FALSE);
+	run_recover(false);
     } else if (do_recover_only) {
         run_recover_only();
     } else if (do_no_recover) {
diff --git a/src/tests/recover-descriptor.cc b/src/tests/recover-descriptor.cc
index b1b1d249d86d1b4f6b9f4a18f922eaa520a01517..bab775cce57ecf31854264b1c9d6560eec86b666 100644
--- a/src/tests/recover-descriptor.cc
+++ b/src/tests/recover-descriptor.cc
@@ -8,16 +8,16 @@
 // verify recovery of an update log entry which changes values at keys
 
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
 static void run_test(void)
@@ -113,8 +113,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -129,11 +129,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-descriptor10.cc b/src/tests/recover-descriptor10.cc
index 88a9a5e31c0e118dbc83670af97da9c0f262c427..51919b8a36e8cd6aaafc14aa38644a34f13a0312 100644
--- a/src/tests/recover-descriptor10.cc
+++ b/src/tests/recover-descriptor10.cc
@@ -8,19 +8,19 @@
 // verify recovery of an update log entry which changes values at keys
 
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
-BOOL do_crash;
+bool do_crash;
 
 static void checkpoint_callback_1(void * extra) {
     assert(extra == NULL);
@@ -40,7 +40,7 @@ static void run_test(void)
     DB_TXN* txn3;
     DBT desc;
 
-    do_crash = FALSE;
+    do_crash = false;
     
     memset(&desc, 0, sizeof(desc));
     desc.size = sizeof(four_byte_desc);
@@ -88,7 +88,7 @@ static void run_test(void)
     { int chk_r = txn2->abort(txn2); CKERR(chk_r); }
     { int chk_r = txn->commit(txn,0); CKERR(chk_r); }
 
-    do_crash = TRUE;
+    do_crash = true;
     env->txn_checkpoint(env,0,0,0);
 }
 
@@ -129,8 +129,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -145,11 +145,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-descriptor11.cc b/src/tests/recover-descriptor11.cc
index 77f8dbc9d451aff759a5229650772f8ef48c5fda..716d8116fbd9213556fba909f050fba1c3038a2e 100644
--- a/src/tests/recover-descriptor11.cc
+++ b/src/tests/recover-descriptor11.cc
@@ -8,16 +8,16 @@
 // verify recovery of an update log entry which changes values at keys
 
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
 DB_ENV *env;
@@ -119,8 +119,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -135,11 +135,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-descriptor12.cc b/src/tests/recover-descriptor12.cc
index 83048c175d058d963b28c9204b12dec6f46db903..7ac0ce6bff8f1edaa2ad5e6c72f3772010c562da 100644
--- a/src/tests/recover-descriptor12.cc
+++ b/src/tests/recover-descriptor12.cc
@@ -8,16 +8,16 @@
 // verify recovery of an update log entry which changes values at keys
 
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
 DB_ENV *env;
@@ -119,8 +119,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -135,11 +135,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-descriptor2.cc b/src/tests/recover-descriptor2.cc
index 9d3d94f009a09663692e0434c53228fd50c249ac..f60128723b76f24a4e10fbf2874e38efe92e6970 100644
--- a/src/tests/recover-descriptor2.cc
+++ b/src/tests/recover-descriptor2.cc
@@ -8,16 +8,16 @@
 // verify recovery of an update log entry which changes values at keys
 
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
 static void run_test(void)
@@ -116,8 +116,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -132,11 +132,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-descriptor3.cc b/src/tests/recover-descriptor3.cc
index d4740ebb6e135c4db0dab213db35eabf5b0e02a2..dfaff5077c502825d02751e6766837cccdc64e63 100644
--- a/src/tests/recover-descriptor3.cc
+++ b/src/tests/recover-descriptor3.cc
@@ -8,16 +8,16 @@
 // verify recovery of an update log entry which changes values at keys
 
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
 static void run_test(void)
@@ -116,8 +116,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -132,11 +132,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-descriptor4.cc b/src/tests/recover-descriptor4.cc
index 2da93322345ed351a40d4b529dd48f3fc75d1240..f837afbb7d305457d8c19baf28ed8c5371076627 100644
--- a/src/tests/recover-descriptor4.cc
+++ b/src/tests/recover-descriptor4.cc
@@ -8,16 +8,16 @@
 // verify recovery of an update log entry which changes values at keys
 
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
 static void run_test(void)
@@ -115,8 +115,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -131,11 +131,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-descriptor5.cc b/src/tests/recover-descriptor5.cc
index b838ac9bfe881c4d52af4a31260e43e6e6e19bf1..f3270893d1c9d0c984bb476d0fcb2f767d53d19e 100644
--- a/src/tests/recover-descriptor5.cc
+++ b/src/tests/recover-descriptor5.cc
@@ -8,16 +8,16 @@
 // verify recovery of an update log entry which changes values at keys
 
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
 static void run_test(void)
@@ -115,8 +115,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -131,11 +131,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-descriptor6.cc b/src/tests/recover-descriptor6.cc
index edb098ee3d844aa8437109c79c85f30a166e74a9..b93e4d6f93dab32415576030b4483f48904a5cca 100644
--- a/src/tests/recover-descriptor6.cc
+++ b/src/tests/recover-descriptor6.cc
@@ -8,16 +8,16 @@
 // verify recovery of an update log entry which changes values at keys
 
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
 static void run_test(void)
@@ -115,8 +115,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -131,11 +131,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-descriptor7.cc b/src/tests/recover-descriptor7.cc
index 79f18614ec62128d81cfebcc6ecb614e148de59e..a0f086fa050dfa92589d95d6af83786a1e761d7e 100644
--- a/src/tests/recover-descriptor7.cc
+++ b/src/tests/recover-descriptor7.cc
@@ -8,19 +8,19 @@
 // verify recovery of an update log entry which changes values at keys
 
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
-BOOL do_crash;
+bool do_crash;
 
 static void checkpoint_callback_1(void * extra) {
     assert(extra == NULL);
@@ -40,7 +40,7 @@ static void run_test(void)
     DB_TXN* txn3;
     DBT desc;
 
-    do_crash = FALSE;
+    do_crash = false;
     
     memset(&desc, 0, sizeof(desc));
     desc.size = sizeof(four_byte_desc);
@@ -86,7 +86,7 @@ static void run_test(void)
     { int chk_r = env->txn_begin(env, NULL, &txn3, 0); CKERR(chk_r); }
     { int chk_r = db3->change_descriptor(db3, txn3, &desc, 0); CKERR(chk_r); }
 
-    do_crash = TRUE;
+    do_crash = true;
     env->txn_checkpoint(env,0,0,0);
 }
 
@@ -127,8 +127,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -143,11 +143,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-descriptor8.cc b/src/tests/recover-descriptor8.cc
index 57b5e4b4d8b58eec25bf289acdc3ce4c048eb987..47815c3d458f3078987f42024c9a15e00fd5229c 100644
--- a/src/tests/recover-descriptor8.cc
+++ b/src/tests/recover-descriptor8.cc
@@ -8,19 +8,19 @@
 // verify recovery of an update log entry which changes values at keys
 
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
-BOOL do_crash;
+bool do_crash;
 
 static void checkpoint_callback_1(void * extra) {
     assert(extra == NULL);
@@ -40,7 +40,7 @@ static void run_test(void)
     DB_TXN* txn3;
     DBT desc;
 
-    do_crash = FALSE;
+    do_crash = false;
     
     memset(&desc, 0, sizeof(desc));
     desc.size = sizeof(four_byte_desc);
@@ -88,7 +88,7 @@ static void run_test(void)
     { int chk_r = txn2->abort(txn2); CKERR(chk_r); }
     { int chk_r = txn->commit(txn,0); CKERR(chk_r); }
 
-    do_crash = TRUE;
+    do_crash = true;
     env->txn_checkpoint(env,0,0,0);
 }
 
@@ -129,8 +129,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -145,11 +145,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-descriptor9.cc b/src/tests/recover-descriptor9.cc
index 30f8b832ce4bb0e4b9feca5b45c87e81f3d04e26..27f6ea7199aa8b01d90912c82b6f2429a7d4e72b 100644
--- a/src/tests/recover-descriptor9.cc
+++ b/src/tests/recover-descriptor9.cc
@@ -8,19 +8,19 @@
 // verify recovery of an update log entry which changes values at keys
 
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
-BOOL do_crash;
+bool do_crash;
 
 static void checkpoint_callback_1(void * extra) {
     assert(extra == NULL);
@@ -40,7 +40,7 @@ static void run_test(void)
     DB_TXN* txn3;
     DBT desc;
 
-    do_crash = FALSE;
+    do_crash = false;
     
     memset(&desc, 0, sizeof(desc));
     desc.size = sizeof(four_byte_desc);
@@ -86,7 +86,7 @@ static void run_test(void)
     { int chk_r = env->txn_begin(env, NULL, &txn3, 0); CKERR(chk_r); }
     { int chk_r = db3->change_descriptor(db3, txn3, &desc, 0); CKERR(chk_r); }
 
-    do_crash = TRUE;
+    do_crash = true;
     env->txn_checkpoint(env,0,0,0);
 }
 
@@ -127,8 +127,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -143,11 +143,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-fassociate-dupsort.cc b/src/tests/recover-fassociate-dupsort.cc
index 3d1635a239376828013ed18b782a450403f238a8..05c9f5ef9b69ff09971e5462bcd5681e6648bd83 100644
--- a/src/tests/recover-fassociate-dupsort.cc
+++ b/src/tests/recover-fassociate-dupsort.cc
@@ -53,7 +53,7 @@ static void run_recover (void) {
     r = db_env_create(&env, 0);                                                             CKERR(r);
     r = env->open(env, ENVDIR, envflags + DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO);             CKERR(r);
     
-    u_int32_t dbflags;
+    uint32_t dbflags;
     DB *dba;
     r = db_create(&dba, env, 0);                                                            CKERR(r);
     r = dba->open(dba, NULL, namea, NULL, DB_UNKNOWN, DB_AUTO_COMMIT, 0666);                CKERR(r);
@@ -82,7 +82,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -95,13 +95,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-fassociate-nodup.cc b/src/tests/recover-fassociate-nodup.cc
index 7c3f025dc4261a6536b5d2302f8b1444eefde4e8..edd5aa291f42b05425d33b4770bafc63d381a47f 100644
--- a/src/tests/recover-fassociate-nodup.cc
+++ b/src/tests/recover-fassociate-nodup.cc
@@ -53,7 +53,7 @@ static void run_recover (void) {
     r = db_env_create(&env, 0);                                                             CKERR(r);
     r = env->open(env, ENVDIR, envflags + DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO);             CKERR(r);
     
-    u_int32_t dbflags;
+    uint32_t dbflags;
     DB *dba;
     r = db_create(&dba, env, 0);                                                            CKERR(r);
     r = dba->open(dba, NULL, namea, NULL, DB_UNKNOWN, DB_AUTO_COMMIT, 0666);                CKERR(r);
@@ -83,7 +83,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -96,13 +96,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-fclose-in-checkpoint.cc b/src/tests/recover-fclose-in-checkpoint.cc
index 96d801f6d169fb6ebf3f9298d9fcb9cf1984f176..3c3f4efa219c1a4547ec11ac28c40428d965ca62 100644
--- a/src/tests/recover-fclose-in-checkpoint.cc
+++ b/src/tests/recover-fclose-in-checkpoint.cc
@@ -75,7 +75,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -88,13 +88,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-fcreate-basementnodesize.cc b/src/tests/recover-fcreate-basementnodesize.cc
index f57695d3209f84799ef10cba7f5f08d14624813b..5de43ceff2ef8f4b7d3ebfec9ec335aaa847be28 100644
--- a/src/tests/recover-fcreate-basementnodesize.cc
+++ b/src/tests/recover-fcreate-basementnodesize.cc
@@ -117,7 +117,7 @@ static void run_no_recover (void) {
 
 static const char *cmd;
 
-static BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+static bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -130,13 +130,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-fcreate-fclose.cc b/src/tests/recover-fcreate-fclose.cc
index dc13d24c11be74be7dedea418e0cdb107d6bda1b..d73c988e3d14acf46bd69c95c7984fe476e1993b 100644
--- a/src/tests/recover-fcreate-fclose.cc
+++ b/src/tests/recover-fcreate-fclose.cc
@@ -65,7 +65,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -78,13 +78,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-fcreate-fdelete.cc b/src/tests/recover-fcreate-fdelete.cc
index 2cc3648968ccbb76215e1a1f72e96fab66ec7844..bbc04cd8977a0d933c7abc392e5c43097d799ae9 100644
--- a/src/tests/recover-fcreate-fdelete.cc
+++ b/src/tests/recover-fcreate-fdelete.cc
@@ -51,7 +51,7 @@ static void run_recover (void) {
     r = db_env_create(&env, 0);                                                             CKERR(r);
     r = env->open(env, ENVDIR, envflags + DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO);             CKERR(r);
     
-    u_int32_t dbflags;
+    uint32_t dbflags;
     DB *db;
     r = db_create(&db, env, 0);                                                             CKERR(r);
     r = db->open(db, NULL, namea, NULL, DB_UNKNOWN, DB_AUTO_COMMIT, 0666);                  CKERR(r);
@@ -74,7 +74,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -87,13 +87,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-fcreate-nodesize.cc b/src/tests/recover-fcreate-nodesize.cc
index 9dfd898ccd39266d556e85b74d60f18ab0934c34..311427ea4de20ef3e29adb328d820ec541234585 100644
--- a/src/tests/recover-fcreate-nodesize.cc
+++ b/src/tests/recover-fcreate-nodesize.cc
@@ -118,7 +118,7 @@ static void run_no_recover (void) {
 
 static const char *cmd;
 
-static BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+static bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -131,13 +131,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-fcreate-xabort.cc b/src/tests/recover-fcreate-xabort.cc
index d6807d36339b0dacd4aeae76c893f0274a1a5fc2..e7c5daf4d5ba6a5bece1b642cb37eefc6975e66f 100644
--- a/src/tests/recover-fcreate-xabort.cc
+++ b/src/tests/recover-fcreate-xabort.cc
@@ -61,7 +61,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -74,13 +74,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-fopen-checkpoint-fclose.cc b/src/tests/recover-fopen-checkpoint-fclose.cc
index 58cf05ad474fa8b681782ed7e3fbdd2ef304a6e0..04ce64d7b41bd849cb8600c2d50cf65b8d3e917b 100644
--- a/src/tests/recover-fopen-checkpoint-fclose.cc
+++ b/src/tests/recover-fopen-checkpoint-fclose.cc
@@ -71,7 +71,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -84,13 +84,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-fopen-fclose-checkpoint.cc b/src/tests/recover-fopen-fclose-checkpoint.cc
index 856acea333dbdde5d03d4c4901569665006751fb..a9b940d821bb7a925eeb40fa134a334207e60566 100644
--- a/src/tests/recover-fopen-fclose-checkpoint.cc
+++ b/src/tests/recover-fopen-fclose-checkpoint.cc
@@ -71,7 +71,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -84,13 +84,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-fopen-fdelete-checkpoint-fcreate.cc b/src/tests/recover-fopen-fdelete-checkpoint-fcreate.cc
index 310e6f4b66e36de7deaeeea11ebdfe4ed4e2a91b..efa1204034718ed5cdf3c55e3cd426daafd74bef 100644
--- a/src/tests/recover-fopen-fdelete-checkpoint-fcreate.cc
+++ b/src/tests/recover-fopen-fdelete-checkpoint-fcreate.cc
@@ -82,7 +82,7 @@ static void run_recover (void) {
     r = db_env_create(&env, 0);                                                             CKERR(r);
     r = env->open(env, ENVDIR, envflags + DB_RECOVER, S_IRWXU+S_IRWXG+S_IRWXO);             CKERR(r);
     
-    u_int32_t dbflags;
+    uint32_t dbflags;
     DB *db;
     r = db_create(&db, env, 0);                                                             CKERR(r);
     r = db->open(db, NULL, namea, NULL, DB_UNKNOWN, DB_AUTO_COMMIT, 0666);                  CKERR(r);
@@ -105,7 +105,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -118,13 +118,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-hotindexer-simple-abort-put.cc b/src/tests/recover-hotindexer-simple-abort-put.cc
index c4c3aac4fc4d0912d137108d5e9cdf316069703b..6883f5c27aeb7dfcfbfa36a9cb4b21d17029f5a5 100644
--- a/src/tests/recover-hotindexer-simple-abort-put.cc
+++ b/src/tests/recover-hotindexer-simple-abort-put.cc
@@ -75,17 +75,17 @@ run_recover(void) {
 
 int
 test_main(int argc, char * const argv[]) {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
     }
diff --git a/src/tests/recover-loader-test.cc b/src/tests/recover-loader-test.cc
index 60f31851f65a342e09db07a7300363888de5ce31..04f817a9bd394d9cfc0f816bfd6111d2582150c8 100644
--- a/src/tests/recover-loader-test.cc
+++ b/src/tests/recover-loader-test.cc
@@ -49,7 +49,7 @@ static const int envflags = DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT
 
 #define NUM_DBS 5
 
-static BOOL do_test=FALSE, do_recover=FALSE;
+static bool do_test=false, do_recover=false;
 
 static DB_ENV *env;
 static int NUM_ROWS=50000000;
@@ -465,9 +465,9 @@ static void do_args(int argc, char * const argv[]) {
             USE_PUTS = LOADER_USE_PUTS;
 	    printf("Using puts\n");
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
 
 	} else {
 	    fprintf(stderr, "Unknown arg: %s\n", argv[0]);
diff --git a/src/tests/recover-lsn-filter-multiple.cc b/src/tests/recover-lsn-filter-multiple.cc
index 096ecfa0b15f3d776d1be36187e85854311be568..f7996a28b0dcdb23c2a364fdff3888a79297b9bb 100644
--- a/src/tests/recover-lsn-filter-multiple.cc
+++ b/src/tests/recover-lsn-filter-multiple.cc
@@ -17,7 +17,7 @@ enum {num_dbs = 2};
 static DBT dest_keys[num_dbs];
 static DBT dest_vals[num_dbs];
 
-BOOL do_test=FALSE, do_recover=FALSE;
+bool do_test=false, do_recover=false;
 
 static int
 put_multiple_generate(DB *dest_db, DB *src_db, DBT *dest_key, DBT *dest_val, const DBT *src_key, const DBT *src_val) {
@@ -183,9 +183,9 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-lsn-filter.cc b/src/tests/recover-lsn-filter.cc
index c40b6e51d02844d5da0bc6c260edde4eaf3a3f53..286003c30a72b582fe96e4e5f4a57859c46a47b5 100644
--- a/src/tests/recover-lsn-filter.cc
+++ b/src/tests/recover-lsn-filter.cc
@@ -108,7 +108,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -121,13 +121,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-missing-dbfile-2.cc b/src/tests/recover-missing-dbfile-2.cc
index 634b570b64d8d3c9ca71bbc0c3665a3c6287fe92..d5d0c76ee658b3390bfc08a878183be5f77e4c1f 100644
--- a/src/tests/recover-missing-dbfile-2.cc
+++ b/src/tests/recover-missing-dbfile-2.cc
@@ -103,7 +103,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -116,13 +116,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-missing-dbfile.cc b/src/tests/recover-missing-dbfile.cc
index 47865342f19912b0ee446b9c2d7468a1f9e13e0a..dbdbc6973df372343bf9aebaa99b0b84ee7a72cb 100644
--- a/src/tests/recover-missing-dbfile.cc
+++ b/src/tests/recover-missing-dbfile.cc
@@ -94,7 +94,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -107,13 +107,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-missing-logfile.cc b/src/tests/recover-missing-logfile.cc
index 503c5e2d8e7cc0393bed5203a8bb5956163bda4d..e8f63486c8d6419d08fb6f2a84d33405faf56e49 100644
--- a/src/tests/recover-missing-logfile.cc
+++ b/src/tests/recover-missing-logfile.cc
@@ -93,7 +93,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -106,13 +106,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-put-multiple-abort.cc b/src/tests/recover-put-multiple-abort.cc
index 9f4295e42e427e097d73c868e34aa4e16fff3b60..07ebc882207eefda733a8253d15cad3edb0bb712 100644
--- a/src/tests/recover-put-multiple-abort.cc
+++ b/src/tests/recover-put-multiple-abort.cc
@@ -173,8 +173,8 @@ usage(void) {
 
 int
 test_main (int argc, char * const argv[]) {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
     int ndbs = 2;
     int nrows = 1;
 
@@ -191,11 +191,11 @@ test_main (int argc, char * const argv[]) {
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--ndbs") == 0 && i+1 < argc) {
diff --git a/src/tests/recover-put-multiple-fdelete-all.cc b/src/tests/recover-put-multiple-fdelete-all.cc
index 0988f678e1536fc0ba8e2dce95205af80ed4561d..dc33d97f215e900d747b953090de1c9e9abfd6b1 100644
--- a/src/tests/recover-put-multiple-fdelete-all.cc
+++ b/src/tests/recover-put-multiple-fdelete-all.cc
@@ -17,7 +17,7 @@ enum {num_dbs = 2};
 static DBT dest_keys[num_dbs];
 static DBT dest_vals[num_dbs];
 
-BOOL do_test=FALSE, do_recover=FALSE;
+bool do_test=false, do_recover=false;
 
 static int
 put_multiple_generate(DB *dest_db, DB *src_db, DBT *dest_key, DBT *dest_val, const DBT *src_key, const DBT *src_val) {
@@ -166,9 +166,9 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-put-multiple-fdelete-some.cc b/src/tests/recover-put-multiple-fdelete-some.cc
index 54cbed6f9e66dfc8ebe89bb3383a94e0990d8731..ed3504a88c57acfcabd051580e0ffba53ed566c1 100644
--- a/src/tests/recover-put-multiple-fdelete-some.cc
+++ b/src/tests/recover-put-multiple-fdelete-some.cc
@@ -17,7 +17,7 @@ enum {num_dbs = 2};
 static DBT dest_keys[num_dbs];
 static DBT dest_vals[num_dbs];
 
-BOOL do_test=FALSE, do_recover=FALSE;
+bool do_test=false, do_recover=false;
 
 static int
 put_multiple_generate(DB *dest_db, DB *src_db, DBT *dest_key, DBT *dest_val, const DBT *src_key, const DBT *src_val) {
@@ -186,9 +186,9 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-put-multiple-srcdb-fdelete-all.cc b/src/tests/recover-put-multiple-srcdb-fdelete-all.cc
index 2e2d51ef9f9481d7c46130e18534af575c16c959..6192d6845e6bc0ccad72e4bb6e16d2cf3531651c 100644
--- a/src/tests/recover-put-multiple-srcdb-fdelete-all.cc
+++ b/src/tests/recover-put-multiple-srcdb-fdelete-all.cc
@@ -17,7 +17,7 @@ enum {num_dbs = 2};
 static DBT dest_keys[num_dbs];
 static DBT dest_vals[num_dbs];
 
-BOOL do_test=FALSE, do_recover=FALSE;
+bool do_test=false, do_recover=false;
 
 static int
 put_multiple_generate(DB *dest_db, DB *src_db, DBT *dest_key, DBT *dest_val, const DBT *src_key, const DBT *src_val) {
@@ -168,9 +168,9 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-put-multiple.cc b/src/tests/recover-put-multiple.cc
index 82f3e3d65ed61b3de73ee56358b00eeaaa795d14..e25774d0a7746a37ee8234236fe06fe24d362793 100644
--- a/src/tests/recover-put-multiple.cc
+++ b/src/tests/recover-put-multiple.cc
@@ -193,8 +193,8 @@ usage(void) {
 
 int
 test_main (int argc, char * const argv[]) {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
     int ndbs = 2;
     int nrows = 1;
 
@@ -211,11 +211,11 @@ test_main (int argc, char * const argv[]) {
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--ndbs") == 0 && i+1 < argc) {
diff --git a/src/tests/recover-split-checkpoint.cc b/src/tests/recover-split-checkpoint.cc
index 2555556de095f567e2732102b64b702a1ea894ad..bbeddfb9c8af2fd16e4e81bf37b7c6daa99dbeb8 100644
--- a/src/tests/recover-split-checkpoint.cc
+++ b/src/tests/recover-split-checkpoint.cc
@@ -29,7 +29,7 @@ static void test_checkpoint_callback2(void *extra) {
     extra = extra;
 }
 
-static void run_test (BOOL do_commit, BOOL do_abort) {
+static void run_test (bool do_commit, bool do_abort) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -62,7 +62,7 @@ static void run_test (BOOL do_commit, BOOL do_abort) {
     toku_hard_crash_on_purpose();
 }
 
-static void run_recover (BOOL did_commit) {
+static void run_recover (bool did_commit) {
     did_commit = did_commit;
     int r;
     DB_ENV *env = NULL;
@@ -91,7 +91,7 @@ static void run_no_recover (void) {
 const char *cmd;
 
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -104,19 +104,19 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -150,13 +150,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 int test_main (int argc, char * const argv[]) {
     test_parse_args(argc, argv);
     if (do_commit) {
-	run_test(TRUE, FALSE);
+	run_test(true, false);
     } else if (do_abort) {
-        run_test(FALSE, TRUE);
+        run_test(false, true);
     } else if (do_recover_committed) {
-        run_recover(TRUE);
+        run_recover(true);
     } else if (do_recover_aborted) {
-        run_recover(FALSE);
+        run_recover(false);
     } else if (do_recover_only) {
         run_recover_only();
     } else if (do_no_recover) {
diff --git a/src/tests/recover-straddle-txn-nested.cc b/src/tests/recover-straddle-txn-nested.cc
index 25308f6187439b73ed1d4af8b2c67da0b2f2cd00..65e1a368acb697ab646a7319261c9f5f6a4221aa 100644
--- a/src/tests/recover-straddle-txn-nested.cc
+++ b/src/tests/recover-straddle-txn-nested.cc
@@ -90,7 +90,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -103,13 +103,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-straddle-txn.cc b/src/tests/recover-straddle-txn.cc
index 920057026c6408b1d2a2b9df1a0b9441408eebd3..ee1b6bd72e3710c7246fe3a1148c2d9286403628 100644
--- a/src/tests/recover-straddle-txn.cc
+++ b/src/tests/recover-straddle-txn.cc
@@ -94,7 +94,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char * const argv[]) {
     int resultcode;
@@ -107,13 +107,13 @@ static void test_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/recover-tablelock.cc b/src/tests/recover-tablelock.cc
index 02aa2dcd114f6699b16037c7a5d2511f6692225b..54a5f8c3019f578acd5704e33143a7cd2431d4c3 100644
--- a/src/tests/recover-tablelock.cc
+++ b/src/tests/recover-tablelock.cc
@@ -13,7 +13,7 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
 const char *namea="a.db";
 
 static void
-do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
+do_x1_shutdown (bool do_commit, bool do_abort) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -53,7 +53,7 @@ do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
 }
 
 static void
-do_x1_recover (BOOL UU(did_commit)) {
+do_x1_recover (bool UU(did_commit)) {
     int r;
 
     DB_ENV *env;
@@ -122,7 +122,7 @@ do_x1_no_recover (void) {
     exit(0);
 }
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false, do_no_recover = false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -136,19 +136,19 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -184,15 +184,15 @@ test_main (int argc, char * const argv[])
 {
     x1_parse_args(argc, argv);
     if (do_commit) {
-	do_x1_shutdown (TRUE, FALSE);
+	do_x1_shutdown (true, false);
     } else if (do_abort) {
-	do_x1_shutdown (FALSE, FALSE);
+	do_x1_shutdown (false, false);
     } else if (do_explicit_abort) {
-        do_x1_shutdown(FALSE, TRUE);
+        do_x1_shutdown(false, true);
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } else if (do_recover_aborted) {
-	do_x1_recover(FALSE);
+	do_x1_recover(false);
     } else if (do_recover_only) {
         do_x1_recover_only();
     } else if (do_no_recover) {
diff --git a/src/tests/recover-test-logsuppress-put.cc b/src/tests/recover-test-logsuppress-put.cc
index 058ec4336ef7318065b3e192071d52ca970f84f1..75b8b0512f7f901d2143cce6e642a61eb3b1ce70 100644
--- a/src/tests/recover-test-logsuppress-put.cc
+++ b/src/tests/recover-test-logsuppress-put.cc
@@ -176,7 +176,7 @@ do_x1_shutdown (void) {
 }
 
 static void
-do_x1_recover (BOOL UU(did_commit)) {
+do_x1_recover (bool UU(did_commit)) {
     int r;
 
     r = db_env_create(&env, 0);                                                             CKERR(r);
@@ -194,7 +194,7 @@ do_x1_recover (BOOL UU(did_commit)) {
     r=env->close(env, 0);                                                      CKERR(r);
 }
 
-BOOL do_commit=FALSE, do_recover_committed=FALSE;
+bool do_commit=false, do_recover_committed=false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -208,9 +208,9 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -243,7 +243,7 @@ test_main (int argc, char * const argv[])
     if (do_commit) {
 	do_x1_shutdown();
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } 
 #if 0
     else {
diff --git a/src/tests/recover-test-logsuppress.cc b/src/tests/recover-test-logsuppress.cc
index 77fe395f280bedd97a7bc7e062dec05d471b6181..ca9614e821acdfa22738e1378d5681985a5323a2 100644
--- a/src/tests/recover-test-logsuppress.cc
+++ b/src/tests/recover-test-logsuppress.cc
@@ -185,7 +185,7 @@ do_x1_shutdown (void) {
 }
 
 static void
-do_x1_recover (BOOL UU(did_commit)) {
+do_x1_recover (bool UU(did_commit)) {
     int r;
 
     r = db_env_create(&env, 0);                                                             CKERR(r);
@@ -203,7 +203,7 @@ do_x1_recover (BOOL UU(did_commit)) {
     r=env->close(env, 0);                                                      CKERR(r);
 }
 
-BOOL do_commit=FALSE, do_recover_committed=FALSE;
+bool do_commit=false, do_recover_committed=false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -217,9 +217,9 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -252,7 +252,7 @@ test_main (int argc, char * const argv[])
     if (do_commit) {
 	do_x1_shutdown();
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } 
 #if 0
     else {
diff --git a/src/tests/recover-test1.cc b/src/tests/recover-test1.cc
index e62ef02c9b465bd53b67f3448c6b111dfbd093b6..a33e5f706d0343d545222e69c05e8081df0ed6c7 100644
--- a/src/tests/recover-test1.cc
+++ b/src/tests/recover-test1.cc
@@ -50,7 +50,7 @@ do_x1_shutdown (void) {
 }
 
 static void
-do_x1_recover (BOOL UU(did_commit)) {
+do_x1_recover (bool UU(did_commit)) {
     int r;
     r=system("rm " ENVDIR "/*.tokudb"); CKERR(r);
 
@@ -67,7 +67,7 @@ do_x1_recover (BOOL UU(did_commit)) {
     r=env->close(env, 0);                                                      CKERR(r);
 }
 
-BOOL do_commit=FALSE, do_recover_committed=FALSE;
+bool do_commit=false, do_recover_committed=false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -81,9 +81,9 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -116,7 +116,7 @@ test_main (int argc, char * const argv[])
     if (do_commit) {
 	do_x1_shutdown();
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } 
 #if 0
     else {
diff --git a/src/tests/recover-test2.cc b/src/tests/recover-test2.cc
index 3a70dffb24677cced1a18c257b29b562dd8b564c..a6a1acf71b0352e83e4986ff6e43938cfa650b5d 100644
--- a/src/tests/recover-test2.cc
+++ b/src/tests/recover-test2.cc
@@ -55,7 +55,7 @@ do_x1_shutdown (void) {
 }
 
 static void
-do_x1_recover (BOOL UU(did_commit)) {
+do_x1_recover (bool UU(did_commit)) {
     int r;
     r=system("rm " ENVDIR "/*.tokudb"); CKERR(r);
 
@@ -77,7 +77,7 @@ do_x1_recover (BOOL UU(did_commit)) {
     r=env->close(env, 0);                                                      CKERR(r);
 }
 
-BOOL do_commit=FALSE, do_recover_committed=FALSE;
+bool do_commit=false, do_recover_committed=false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -91,9 +91,9 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -133,7 +133,7 @@ test_main (int argc, char * const argv[])
     if (do_commit) {
 	do_x1_shutdown();
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } 
     for (i=0; i<N; i++) {
         toku_free(keys[i]);
diff --git a/src/tests/recover-test3.cc b/src/tests/recover-test3.cc
index 24d35613c62257801407f366bdac943f41c7d6e1..4f8b3fc1d20c17dbd3f0bbd444cae8286d9e45ed 100644
--- a/src/tests/recover-test3.cc
+++ b/src/tests/recover-test3.cc
@@ -59,7 +59,7 @@ do_x1_shutdown (void) {
 }
 
 static void
-do_x1_recover (BOOL UU(did_commit)) {
+do_x1_recover (bool UU(did_commit)) {
     int r;
     r=system("rm " ENVDIR "/*.tokudb"); CKERR(r);
 
@@ -85,7 +85,7 @@ do_x1_recover (BOOL UU(did_commit)) {
     r=env->close(env, 0);                                                      CKERR(r);
 }
 
-BOOL do_commit=FALSE, do_recover_committed=FALSE;
+bool do_commit=false, do_recover_committed=false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -99,9 +99,9 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -141,7 +141,7 @@ test_main (int argc, char * const argv[])
     if (do_commit) {
 	do_x1_shutdown();
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } 
     for (i=0; i<N; i++) {
         toku_free(keys[i]);
diff --git a/src/tests/recover-test_crash_in_flusher_thread.h b/src/tests/recover-test_crash_in_flusher_thread.h
index fcb82827f4358c291f8efbf8da82436e119a7aba..5a6356715abaf4028a9a20ef5646a680e8c68bb0 100644
--- a/src/tests/recover-test_crash_in_flusher_thread.h
+++ b/src/tests/recover-test_crash_in_flusher_thread.h
@@ -17,7 +17,7 @@
 
 toku_pthread_t checkpoint_tid;
 static int cnt = 0;
-static BOOL starting_a_chkpt = FALSE;
+static bool starting_a_chkpt = false;
 
 int state_to_crash = 0;
 
@@ -35,7 +35,7 @@ static void flt_callback(int flt_state, void* extra) {
     cnt++;
         if (verbose) printf("flt_state!! %d\n", flt_state);
     if (cnt > 0 && !starting_a_chkpt && flt_state == state_to_crash) {
-        starting_a_chkpt = TRUE;
+        starting_a_chkpt = true;
         if (verbose) printf("flt_state %d\n", flt_state);
         int r = toku_pthread_create(&checkpoint_tid, NULL, do_checkpoint_and_crash, extra); 
         assert(r==0);
diff --git a/src/tests/recover-test_stress1.cc b/src/tests/recover-test_stress1.cc
index 4e4bae9a2c67404a8defbb60939d926ea0c48b47..3eb2a9349bd5719067d368412d506c28f6543df4 100644
--- a/src/tests/recover-test_stress1.cc
+++ b/src/tests/recover-test_stress1.cc
@@ -57,30 +57,30 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
     struct scan_op_extra soe[4];
 
     // make the forward fast scanner
-    soe[0].fast = TRUE;
-    soe[0].fwd = TRUE;
-    soe[0].prefetch = FALSE;
+    soe[0].fast = true;
+    soe[0].fwd = true;
+    soe[0].prefetch = false;
     myargs[0].operation_extra = &soe[0];
     myargs[0].operation = scan_op;
 
     // make the forward slow scanner
-    soe[1].fast = FALSE;
-    soe[1].fwd = TRUE;
-    soe[1].prefetch = FALSE;
+    soe[1].fast = false;
+    soe[1].fwd = true;
+    soe[1].prefetch = false;
     myargs[1].operation_extra = &soe[1];
     myargs[1].operation = scan_op;
 
     // make the backward fast scanner
-    soe[2].fast = TRUE;
-    soe[2].fwd = FALSE;
-    soe[2].prefetch = FALSE;
+    soe[2].fast = true;
+    soe[2].fwd = false;
+    soe[2].prefetch = false;
     myargs[2].operation_extra = &soe[2];
     myargs[2].operation = scan_op;
 
     // make the backward slow scanner
-    soe[3].fast = FALSE;
-    soe[3].fwd = FALSE;
-    soe[3].prefetch = FALSE;
+    soe[3].fast = false;
+    soe[3].fwd = false;
+    soe[3].prefetch = false;
     myargs[3].operation_extra = &soe[3];
     myargs[3].operation = scan_op;
 
diff --git a/src/tests/recover-test_stress3.cc b/src/tests/recover-test_stress3.cc
index e306982f952812414b105a6505dd7b0c5178b0f1..bd19a47b5c4da6880370200f558af5657e676d36 100644
--- a/src/tests/recover-test_stress3.cc
+++ b/src/tests/recover-test_stress3.cc
@@ -38,8 +38,8 @@
 //  - number of elements
 //
 
-u_int64_t time_til_crash;
-u_int64_t start_time;
+uint64_t time_til_crash;
+uint64_t start_time;
 
 static uint64_t get_tnow(void) {
     struct timeval tv;
@@ -48,8 +48,8 @@ static uint64_t get_tnow(void) {
 }
 
 static void checkpoint_callback2(void* UU(extra)) {
-    u_int64_t curr_time = get_tnow();
-    u_int64_t time_diff = curr_time - start_time;
+    uint64_t curr_time = get_tnow();
+    uint64_t time_diff = curr_time - start_time;
     if ((time_diff/1000000ULL) > time_til_crash) {
         toku_hard_crash_on_purpose();
     }
@@ -81,30 +81,30 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
     struct scan_op_extra soe[4];
 
     // make the forward fast scanner
-    soe[0].fast = TRUE;
-    soe[0].fwd = TRUE;
-    soe[0].prefetch = FALSE;
+    soe[0].fast = true;
+    soe[0].fwd = true;
+    soe[0].prefetch = false;
     myargs[0].operation_extra = &soe[0];
     myargs[0].operation = scan_op;
 
     // make the forward slow scanner
-    soe[1].fast = FALSE;
-    soe[1].fwd = TRUE;
-    soe[1].prefetch = FALSE;
+    soe[1].fast = false;
+    soe[1].fwd = true;
+    soe[1].prefetch = false;
     myargs[1].operation_extra = &soe[1];
     myargs[1].operation = scan_op;
 
     // make the backward fast scanner
-    soe[2].fast = TRUE;
-    soe[2].fwd = FALSE;
-    soe[2].prefetch = FALSE;
+    soe[2].fast = true;
+    soe[2].fwd = false;
+    soe[2].prefetch = false;
     myargs[2].operation_extra = &soe[2];
     myargs[2].operation = scan_op;
 
     // make the backward slow scanner
-    soe[3].fast = FALSE;
-    soe[3].fwd = FALSE;
-    soe[3].prefetch = FALSE;
+    soe[3].fast = false;
+    soe[3].fwd = false;
+    soe[3].prefetch = false;
     myargs[3].operation_extra = &soe[3];
     myargs[3].operation = scan_op;
 
diff --git a/src/tests/recover-update-multiple-abort.cc b/src/tests/recover-update-multiple-abort.cc
index fe6fe807d54770867ceab34e1744a7b90485bb40..c922e3c2f1cab9bcb54c0befc2284590e727ae8c 100644
--- a/src/tests/recover-update-multiple-abort.cc
+++ b/src/tests/recover-update-multiple-abort.cc
@@ -272,8 +272,8 @@ usage(void) {
 
 int
 test_main (int argc, char * const argv[]) {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
     int ndbs = 2;
     int nrows = 2;
 
@@ -290,11 +290,11 @@ test_main (int argc, char * const argv[]) {
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--ndbs") == 0 && i+1 < argc) {
diff --git a/src/tests/recover-update-multiple.cc b/src/tests/recover-update-multiple.cc
index e0ddf21985445d9b4787fea4ff1ec74638f5b543..b39c244eb75667ddeffca13b2af58969fd8876a0 100644
--- a/src/tests/recover-update-multiple.cc
+++ b/src/tests/recover-update-multiple.cc
@@ -279,8 +279,8 @@ usage(void) {
 
 int
 test_main (int argc, char * const argv[]) {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
     int ndbs = 2;
     int nrows = 2;
 
@@ -297,11 +297,11 @@ test_main (int argc, char * const argv[]) {
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--ndbs") == 0 && i+1 < argc) {
diff --git a/src/tests/recover-update_aborts.cc b/src/tests/recover-update_aborts.cc
index 7d9fb7eb3ed67d41830bc00c34572ca32005d472..1ce9340695101b55c96d84c9af13f98b0a9ebec8 100644
--- a/src/tests/recover-update_aborts.cc
+++ b/src/tests/recover-update_aborts.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -143,8 +143,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -159,11 +159,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_aborts_before_checkpoint.cc b/src/tests/recover-update_aborts_before_checkpoint.cc
index 48fae0f2c837e297c2c77039f83cc8be9c707ecf..6ec56a2d3082250c2a136915641104d1eb899e32 100644
--- a/src/tests/recover-update_aborts_before_checkpoint.cc
+++ b/src/tests/recover-update_aborts_before_checkpoint.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -143,8 +143,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -159,11 +159,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_aborts_before_close.cc b/src/tests/recover-update_aborts_before_close.cc
index 8d922bf322a2ab140cd466b4a7fdf6f8d7f472cc..ff7d1d98e42eaf309c773c41e29d6f66128ff1f1 100644
--- a/src/tests/recover-update_aborts_before_close.cc
+++ b/src/tests/recover-update_aborts_before_close.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -143,8 +143,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -159,11 +159,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_broadcast_aborts.cc b/src/tests/recover-update_broadcast_aborts.cc
index c4651c7eb24f7e677c96d243dd0b045f73f806fd..3a0e4748c0e5e7e28d98ae79dd820a9ee420e270 100644
--- a/src/tests/recover-update_broadcast_aborts.cc
+++ b/src/tests/recover-update_broadcast_aborts.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -134,8 +134,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -150,11 +150,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_broadcast_aborts2.cc b/src/tests/recover-update_broadcast_aborts2.cc
index 20029991a24b1653f6a667a1f34b3c008fbc9b5c..c4bc9548802cc8318fc1b999ec0f336d172251b7 100644
--- a/src/tests/recover-update_broadcast_aborts2.cc
+++ b/src/tests/recover-update_broadcast_aborts2.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -136,8 +136,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -152,11 +152,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_broadcast_aborts3.cc b/src/tests/recover-update_broadcast_aborts3.cc
index 55ea549e367648ab4f157e2b1cdbf1886a39dc20..cbfc4fbeba38a9c324d4457fdec1a88891e65947 100644
--- a/src/tests/recover-update_broadcast_aborts3.cc
+++ b/src/tests/recover-update_broadcast_aborts3.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -136,8 +136,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -152,11 +152,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_broadcast_aborts_before_checkpoint.cc b/src/tests/recover-update_broadcast_aborts_before_checkpoint.cc
index 66fe5cae070ea66fa236d5ec32b6bcfcceffb67b..aa05e70bb83830529e8b390c848b6e6bd6d0a464 100644
--- a/src/tests/recover-update_broadcast_aborts_before_checkpoint.cc
+++ b/src/tests/recover-update_broadcast_aborts_before_checkpoint.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -134,8 +134,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -150,11 +150,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_broadcast_aborts_before_close.cc b/src/tests/recover-update_broadcast_aborts_before_close.cc
index 38832356b0cd850a2f86f4359ead7f3dd912d1b6..18276769759baa24a3d5bc5dae35de40ebdddd13 100644
--- a/src/tests/recover-update_broadcast_aborts_before_close.cc
+++ b/src/tests/recover-update_broadcast_aborts_before_close.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -134,8 +134,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -150,11 +150,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_broadcast_changes_values.cc b/src/tests/recover-update_broadcast_changes_values.cc
index de2581a07aa524335161099f611698ca82e35979..12d9836931b1658eab1d1f6c64d76cb9d57bb2ab 100644
--- a/src/tests/recover-update_broadcast_changes_values.cc
+++ b/src/tests/recover-update_broadcast_changes_values.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -138,8 +138,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -154,11 +154,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_broadcast_changes_values2.cc b/src/tests/recover-update_broadcast_changes_values2.cc
index 5f72e322924a0fc65f8da802c22050ad1ec2638a..69caf18f5eafa7a131a26a85e0f762df79af3014 100644
--- a/src/tests/recover-update_broadcast_changes_values2.cc
+++ b/src/tests/recover-update_broadcast_changes_values2.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -141,8 +141,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -157,11 +157,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_broadcast_changes_values3.cc b/src/tests/recover-update_broadcast_changes_values3.cc
index 38f9aa2c2c305a1b9e044f3b3926773460e9247c..2ee05c16b70033f64c7c7d003f1301e59a3769a8 100644
--- a/src/tests/recover-update_broadcast_changes_values3.cc
+++ b/src/tests/recover-update_broadcast_changes_values3.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -139,8 +139,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -155,11 +155,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_broadcast_changes_values_before_checkpoint.cc b/src/tests/recover-update_broadcast_changes_values_before_checkpoint.cc
index b395c3f2efe16e662d0a89377249a9ac179fe29a..f851a5f7007125f6256b0f3cdaa0c5276f1fe970 100644
--- a/src/tests/recover-update_broadcast_changes_values_before_checkpoint.cc
+++ b/src/tests/recover-update_broadcast_changes_values_before_checkpoint.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -135,8 +135,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -151,11 +151,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_broadcast_changes_values_before_close.cc b/src/tests/recover-update_broadcast_changes_values_before_close.cc
index 6f2c7ee09c8334176d67478faa01c958cae6fbaa..1b02b87cc5417689b02ca547105967ec80cad429 100644
--- a/src/tests/recover-update_broadcast_changes_values_before_close.cc
+++ b/src/tests/recover-update_broadcast_changes_values_before_close.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -135,8 +135,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -151,11 +151,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_changes_values.cc b/src/tests/recover-update_changes_values.cc
index d7a0ab91412911a41b906ae8aac3cb6282f78e45..2243354d8edef347cd4701b80ef0688e178fa7cb 100644
--- a/src/tests/recover-update_changes_values.cc
+++ b/src/tests/recover-update_changes_values.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -144,8 +144,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -160,11 +160,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_changes_values_before_checkpoint.cc b/src/tests/recover-update_changes_values_before_checkpoint.cc
index 8b05559f60e4596726816d03eba93578b3efd0e4..b4e74a4562a46d36df0f4b23fc2b3b492184f39e 100644
--- a/src/tests/recover-update_changes_values_before_checkpoint.cc
+++ b/src/tests/recover-update_changes_values_before_checkpoint.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -144,8 +144,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -160,11 +160,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-update_changes_values_before_close.cc b/src/tests/recover-update_changes_values_before_close.cc
index 98c526447b5b6dd90c2363858bfe29436d51dd51..6a574632f0eaa7a2787727e6a81c63aaba1e67c3 100644
--- a/src/tests/recover-update_changes_values_before_close.cc
+++ b/src/tests/recover-update_changes_values_before_close.cc
@@ -10,7 +10,7 @@
 static const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_TXN|DB_PRIVATE;
 static const unsigned int NUM_KEYS = 100;
 
-static inline BOOL should_update(const unsigned int k) { return k % 3 == 0; }
+static inline bool should_update(const unsigned int k) { return k % 3 == 0; }
 
 static inline unsigned int _v(const unsigned int k) { return 10 - k; }
 static inline unsigned int _e(const unsigned int k) { return k + 4; }
@@ -144,8 +144,8 @@ static int usage(void)
 
 int test_main(int argc, char * const argv[])
 {
-    BOOL do_test = FALSE;
-    BOOL do_recover = FALSE;
+    bool do_test = false;
+    bool do_recover = false;
 
     for (int i = 1; i < argc; i++) {
         char * const arg = argv[i];
@@ -160,11 +160,11 @@ int test_main(int argc, char * const argv[])
             continue;
         }
         if (strcmp(arg, "--test") == 0) {
-            do_test = TRUE;
+            do_test = true;
             continue;
         }
         if (strcmp(arg, "--recover") == 0) {
-            do_recover = TRUE;
+            do_recover = true;
             continue;
         }
         if (strcmp(arg, "--help") == 0) {
diff --git a/src/tests/recover-upgrade-db-descriptor-multihandle.cc b/src/tests/recover-upgrade-db-descriptor-multihandle.cc
index 3e95b90e0c6b8e2b54b7666d9c297d08e124bac5..28f43ffa6b2e203cefc10a55684ab02aa37897ba 100644
--- a/src/tests/recover-upgrade-db-descriptor-multihandle.cc
+++ b/src/tests/recover-upgrade-db-descriptor-multihandle.cc
@@ -51,7 +51,7 @@ change_descriptor(DB* db, int which, DB_ENV* env) {
 }
 
 static void
-do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
+do_x1_shutdown (bool do_commit, bool do_abort) {
     int r;
     r = system("rm -rf " ENVDIR); CKERR(r);
     r = toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
@@ -98,7 +98,7 @@ do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
 }
 
 static void
-do_x1_recover (BOOL did_commit) {
+do_x1_recover (bool did_commit) {
     DB_ENV *env;
     DB *dba;
     int r;
@@ -174,7 +174,7 @@ const char *cmd;
 #if 0
 
 static void
-do_test_internal (BOOL commit)
+do_test_internal (bool commit)
 {
     pid_t pid;
     if (0 == (pid=fork())) {
@@ -209,14 +209,14 @@ do_test_internal (BOOL commit)
 
 static void
 do_test (void) {
-    do_test_internal(TRUE);
-    do_test_internal(FALSE);
+    do_test_internal(true);
+    do_test_internal(false);
 }
 
 #endif
 
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false, do_no_recover = false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -230,19 +230,19 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -278,15 +278,15 @@ test_main (int argc, char * const argv[])
 {
     x1_parse_args(argc, argv);
     if (do_commit) {
-	do_x1_shutdown (TRUE, FALSE);
+	do_x1_shutdown (true, false);
     } else if (do_abort) {
-	do_x1_shutdown (FALSE, FALSE);
+	do_x1_shutdown (false, false);
     } else if (do_explicit_abort) {
-        do_x1_shutdown(FALSE, TRUE);
+        do_x1_shutdown(false, true);
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } else if (do_recover_aborted) {
-	do_x1_recover(FALSE);
+	do_x1_recover(false);
     } else if (do_recover_only) {
         do_x1_recover_only();
     } else if (do_no_recover) {
diff --git a/src/tests/recover-upgrade-db-descriptor.cc b/src/tests/recover-upgrade-db-descriptor.cc
index 7aca64ba717143776d3cac56df6638eb5a96ed04..7ade27ef69cddf059281a1d34bd4615754e77799 100644
--- a/src/tests/recover-upgrade-db-descriptor.cc
+++ b/src/tests/recover-upgrade-db-descriptor.cc
@@ -51,7 +51,7 @@ change_descriptor(DB* db, int which, DB_ENV* env) {
 }
 
 static void
-do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
+do_x1_shutdown (bool do_commit, bool do_abort) {
     int r;
     r = system("rm -rf " ENVDIR); CKERR(r);
     r = toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
@@ -101,7 +101,7 @@ do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
 }
 
 static void
-do_x1_recover (BOOL did_commit) {
+do_x1_recover (bool did_commit) {
     DB_ENV *env;
     DB *dba;
     int r;
@@ -177,7 +177,7 @@ const char *cmd;
 #if 0
 
 static void
-do_test_internal (BOOL commit)
+do_test_internal (bool commit)
 {
     pid_t pid;
     if (0 == (pid=fork())) {
@@ -212,14 +212,14 @@ do_test_internal (BOOL commit)
 
 static void
 do_test (void) {
-    do_test_internal(TRUE);
-    do_test_internal(FALSE);
+    do_test_internal(true);
+    do_test_internal(false);
 }
 
 #endif
 
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false, do_no_recover = false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -233,19 +233,19 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -281,15 +281,15 @@ test_main (int argc, char * const argv[])
 {
     x1_parse_args(argc, argv);
     if (do_commit) {
-	do_x1_shutdown (TRUE, FALSE);
+	do_x1_shutdown (true, false);
     } else if (do_abort) {
-	do_x1_shutdown (FALSE, FALSE);
+	do_x1_shutdown (false, false);
     } else if (do_explicit_abort) {
-        do_x1_shutdown(FALSE, TRUE);
+        do_x1_shutdown(false, true);
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } else if (do_recover_aborted) {
-	do_x1_recover(FALSE);
+	do_x1_recover(false);
     } else if (do_recover_only) {
         do_x1_recover_only();
     } else if (do_no_recover) {
diff --git a/src/tests/recover-x1-abort.cc b/src/tests/recover-x1-abort.cc
index 4c6e531982dc6fdbdc8e7f44245998e256428af4..9d6efba77db14a699c0c2e666d5e1600f98d5128 100644
--- a/src/tests/recover-x1-abort.cc
+++ b/src/tests/recover-x1-abort.cc
@@ -26,7 +26,7 @@ const char *nameb="b.db";
 
 
 static void
-do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
+do_x1_shutdown (bool do_commit, bool do_abort) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -64,7 +64,7 @@ do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
 }
 
 static void
-do_x1_recover (BOOL did_commit) {
+do_x1_recover (bool did_commit) {
     DB_ENV *env;
     DB *dba, *dbb;
     int r;
@@ -147,7 +147,7 @@ const char *cmd;
 
 #if 0
 static void
-do_test_internal (BOOL commit)
+do_test_internal (bool commit)
 {
     pid_t pid;
     if (0 == (pid=fork())) {
@@ -182,12 +182,12 @@ do_test_internal (BOOL commit)
 
 static void
 do_test (void) {
-    do_test_internal(TRUE);
-    do_test_internal(FALSE);
+    do_test_internal(true);
+    do_test_internal(false);
 }
 #endif
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false, do_no_recover = false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -201,19 +201,19 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -249,15 +249,15 @@ test_main (int argc, char *const argv[])
 {
     x1_parse_args(argc, argv);
     if (do_commit) {
-	do_x1_shutdown (TRUE, FALSE);
+	do_x1_shutdown (true, false);
     } else if (do_abort) {
-	do_x1_shutdown (FALSE, FALSE);
+	do_x1_shutdown (false, false);
     } else if (do_explicit_abort) {
-        do_x1_shutdown(FALSE, TRUE);
+        do_x1_shutdown(false, true);
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } else if (do_recover_aborted) {
-	do_x1_recover(FALSE);
+	do_x1_recover(false);
     } else if (do_recover_only) {
         do_x1_recover_only();
     } else if (do_no_recover) {
diff --git a/src/tests/recover-x1-commit.cc b/src/tests/recover-x1-commit.cc
index 78a8c6365ec78b0c20b86fe44744e5b9f147a1a4..176fcb1b812c477e5c3e8952037153020823a0c6 100644
--- a/src/tests/recover-x1-commit.cc
+++ b/src/tests/recover-x1-commit.cc
@@ -26,7 +26,7 @@ const char *nameb="b.db";
 
 
 static void
-do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
+do_x1_shutdown (bool do_commit, bool do_abort) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -64,7 +64,7 @@ do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
 }
 
 static void
-do_x1_recover (BOOL did_commit) {
+do_x1_recover (bool did_commit) {
     DB_ENV *env;
     DB *dba, *dbb;
     int r;
@@ -148,7 +148,7 @@ const char *cmd;
 #if 0
 
 static void
-do_test_internal (BOOL commit)
+do_test_internal (bool commit)
 {
     pid_t pid;
     if (0 == (pid=fork())) {
@@ -183,14 +183,14 @@ do_test_internal (BOOL commit)
 
 static void
 do_test (void) {
-    do_test_internal(TRUE);
-    do_test_internal(FALSE);
+    do_test_internal(true);
+    do_test_internal(false);
 }
 
 #endif
 
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false, do_no_recover = false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -204,19 +204,19 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -252,15 +252,15 @@ test_main (int argc, char * const argv[])
 {
     x1_parse_args(argc, argv);
     if (do_commit) {
-	do_x1_shutdown (TRUE, FALSE);
+	do_x1_shutdown (true, false);
     } else if (do_abort) {
-	do_x1_shutdown (FALSE, FALSE);
+	do_x1_shutdown (false, false);
     } else if (do_explicit_abort) {
-        do_x1_shutdown(FALSE, TRUE);
+        do_x1_shutdown(false, true);
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } else if (do_recover_aborted) {
-	do_x1_recover(FALSE);
+	do_x1_recover(false);
     } else if (do_recover_only) {
         do_x1_recover_only();
     } else if (do_no_recover) {
diff --git a/src/tests/recover-x1-nested-abort.cc b/src/tests/recover-x1-nested-abort.cc
index 81f81127e7286584d1f2ad234b1c6000a19ee2fe..af0ff0d544afb32ba935688e39df174b80b04583 100644
--- a/src/tests/recover-x1-nested-abort.cc
+++ b/src/tests/recover-x1-nested-abort.cc
@@ -26,7 +26,7 @@ const char *nameb="b.db";
 
 
 static void
-do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
+do_x1_shutdown (bool do_commit, bool do_abort) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -67,7 +67,7 @@ do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
 }
 
 static void
-do_x1_recover (BOOL did_commit) {
+do_x1_recover (bool did_commit) {
     DB_ENV *env;
     DB *dba, *dbb;
     int r;
@@ -139,7 +139,7 @@ const char *cmd;
 #if 0
 
 static void
-do_test_internal (BOOL commit) {
+do_test_internal (bool commit) {
     pid_t pid;
     if (0 == (pid=fork())) {
 	int r=execl(cmd, verbose ? "-v" : "-q", commit ? "--commit" : "--abort", NULL);
@@ -173,13 +173,13 @@ do_test_internal (BOOL commit) {
 
 static void
 do_test (void) {
-    do_test_internal(TRUE);
-    do_test_internal(FALSE);
+    do_test_internal(true);
+    do_test_internal(false);
 }
 
 #endif
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -193,17 +193,17 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -237,15 +237,15 @@ int
 test_main (int argc, char * const argv[]) {
     x1_parse_args(argc, argv);
     if (do_commit) {
-	do_x1_shutdown (TRUE, FALSE);
+	do_x1_shutdown (true, false);
     } else if (do_abort) {
-	do_x1_shutdown (FALSE, FALSE);
+	do_x1_shutdown (false, false);
     } else if (do_explicit_abort) {
-        do_x1_shutdown(FALSE, TRUE);
+        do_x1_shutdown(false, true);
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } else if (do_recover_aborted) {
-	do_x1_recover(FALSE);
+	do_x1_recover(false);
     } else if (do_recover_only) {
         do_x1_recover_only();
     } 
diff --git a/src/tests/recover-x1-nested-commit.cc b/src/tests/recover-x1-nested-commit.cc
index 394aebe54acb56bb925b45ea206278cf5c64b254..b852fa4ca65ad0995246159a98c3018e13527f93 100644
--- a/src/tests/recover-x1-nested-commit.cc
+++ b/src/tests/recover-x1-nested-commit.cc
@@ -26,7 +26,7 @@ const char *nameb="b.db";
 
 
 static void
-do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
+do_x1_shutdown (bool do_commit, bool do_abort) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -68,7 +68,7 @@ do_x1_shutdown (BOOL do_commit, BOOL do_abort) {
 }
 
 static void
-do_x1_recover (BOOL did_commit) {
+do_x1_recover (bool did_commit) {
     DB_ENV *env;
     DB *dba, *dbb;
     int r;
@@ -140,7 +140,7 @@ const char *cmd;
 #if 0
 
 static void
-do_test_internal (BOOL commit) {
+do_test_internal (bool commit) {
     pid_t pid;
     if (0 == (pid=fork())) {
 	int r=execl(cmd, verbose ? "-v" : "-q", commit ? "--commit" : "--abort", NULL);
@@ -174,13 +174,13 @@ do_test_internal (BOOL commit) {
 
 static void
 do_test (void) {
-    do_test_internal(TRUE);
-    do_test_internal(FALSE);
+    do_test_internal(true);
+    do_test_internal(false);
 }
 
 #endif
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_explicit_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE, do_recover_only=FALSE;
+bool do_commit=false, do_abort=false, do_explicit_abort=false, do_recover_committed=false,  do_recover_aborted=false, do_recover_only=false;
 
 static void
 x1_parse_args (int argc, char * const argv[]) {
@@ -194,17 +194,17 @@ x1_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--commit")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0], "--abort")==0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0], "--explicit-abort")==0) {
-	    do_explicit_abort=TRUE;
+	    do_explicit_abort=true;
 	} else if (strcmp(argv[0], "--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0], "--recover-aborted")==0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -238,15 +238,15 @@ int
 test_main (int argc, char * const argv[]) {
     x1_parse_args(argc, argv);
     if (do_commit) {
-	do_x1_shutdown (TRUE, FALSE);
+	do_x1_shutdown (true, false);
     } else if (do_abort) {
-	do_x1_shutdown (FALSE, FALSE);
+	do_x1_shutdown (false, false);
     } else if (do_explicit_abort) {
-        do_x1_shutdown(FALSE, TRUE);
+        do_x1_shutdown(false, true);
     } else if (do_recover_committed) {
-	do_x1_recover(TRUE);
+	do_x1_recover(true);
     } else if (do_recover_aborted) {
-	do_x1_recover(FALSE);
+	do_x1_recover(false);
     } else if (do_recover_only) {
         do_x1_recover_only();
     } 
diff --git a/src/tests/recover-x2-abort.cc b/src/tests/recover-x2-abort.cc
index 05093d2694f3b6b7513cc75ebf22ce84e8f9c5fc..034c54188ebc15be5606dd4822d2b34e2a3d2dd4 100644
--- a/src/tests/recover-x2-abort.cc
+++ b/src/tests/recover-x2-abort.cc
@@ -38,7 +38,7 @@ put (DB_TXN *txn, DB *db, const char *key, const char *data) {
 }
    
 static void
-do_x2_shutdown (BOOL do_commit) {
+do_x2_shutdown (bool do_commit) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -67,7 +67,7 @@ do_x2_shutdown (BOOL do_commit) {
 }
 
 static void
-checkcurs (DBC *curs, int cursflags, const char *key, const char *val, BOOL expect_it) {
+checkcurs (DBC *curs, int cursflags, const char *key, const char *val, bool expect_it) {
     DBT k,v;
     dbt_init(&k, NULL, 0);
     dbt_init(&v, NULL, 0);
@@ -84,7 +84,7 @@ checkcurs (DBC *curs, int cursflags, const char *key, const char *val, BOOL expe
 }
 
 static void
-do_x2_recover (BOOL did_commit) {
+do_x2_recover (bool did_commit) {
     DB_ENV *env;
     int r;
     r = db_env_create(&env, 0);                                                             CKERR(r);
@@ -97,9 +97,9 @@ do_x2_recover (BOOL did_commit) {
 	r = dba->open(dba, NULL, namea, NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666);    CKERR(r);
 	DBC *c;
 	r = dba->cursor(dba, txn, &c, 0);                                                   CKERR(r);
-	checkcurs(c, DB_FIRST, "u.a", "u.a.data", TRUE);
-	checkcurs(c, DB_NEXT,  "u.c", "u.c.data", TRUE);
-	checkcurs(c, DB_NEXT,  NULL,  NULL,       FALSE);
+	checkcurs(c, DB_FIRST, "u.a", "u.a.data", true);
+	checkcurs(c, DB_NEXT,  "u.c", "u.c.data", true);
+	checkcurs(c, DB_NEXT,  NULL,  NULL,       false);
 	r = c->c_close(c);                                                                  CKERR(r);	
 	r = dba->close(dba, 0);                                                             CKERR(r);
     }
@@ -111,7 +111,7 @@ do_x2_recover (BOOL did_commit) {
 	r = dbb->cursor(dbb, txn, &c, 0);                                                   CKERR(r);
 	checkcurs(c, DB_FIRST, "v.b", "v.b.data", did_commit);
 	checkcurs(c, DB_NEXT,  "v.d", "v.d.data", did_commit);
-	checkcurs(c, DB_NEXT,  NULL,  NULL,       FALSE);
+	checkcurs(c, DB_NEXT,  NULL,  NULL,       false);
 	r = c->c_close(c);                                                                  CKERR(r);	
 	r = dbb->close(dbb, 0);                                                             CKERR(r);
     }
@@ -126,7 +126,7 @@ const char *cmd;
 #if 0
 
 static void
-do_test_internal (BOOL commit) {
+do_test_internal (bool commit) {
     pid_t pid;
     if (0 == (pid=fork())) {
 	int r=execl(cmd, verbose ? "-v" : "-q", commit ? "--commit" : "--abort", NULL);
@@ -160,13 +160,13 @@ do_test_internal (BOOL commit) {
 
 static void
 do_test (void) {
-    do_test_internal(TRUE);
-    do_test_internal(FALSE);
+    do_test_internal(true);
+    do_test_internal(false);
 }
 
 #endif
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE;
+bool do_commit=false, do_abort=false, do_recover_committed=false,  do_recover_aborted=false;
 
 static void
 x2_parse_args (int argc, char *const argv[]) {
@@ -180,13 +180,13 @@ x2_parse_args (int argc, char *const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0],"--abort")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0],"--commit")==0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0],"--recover-committed")==0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0],"--recover-aborted")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -218,13 +218,13 @@ int
 test_main (int argc, char * const argv[]) {
     x2_parse_args(argc, argv);
     if (do_commit) {
-	do_x2_shutdown (TRUE);
+	do_x2_shutdown (true);
     } else if (do_abort) {
-	do_x2_shutdown (FALSE);
+	do_x2_shutdown (false);
     } else if (do_recover_committed) {
-	do_x2_recover(TRUE);
+	do_x2_recover(true);
     } else if (do_recover_aborted) {
-	do_x2_recover(FALSE);
+	do_x2_recover(false);
     } 
 #if 0
     else {
diff --git a/src/tests/recover-x2-commit.cc b/src/tests/recover-x2-commit.cc
index cd2ba6a53899e03b728d35db8694f4b9d54fad2a..c275c6fa408fae9df036dfb4a991f2b3c57175e5 100644
--- a/src/tests/recover-x2-commit.cc
+++ b/src/tests/recover-x2-commit.cc
@@ -38,7 +38,7 @@ put (DB_TXN *txn, DB *db, const char *key, const char *data) {
 }
    
 static void
-do_x2_shutdown (BOOL do_commit) {
+do_x2_shutdown (bool do_commit) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -67,7 +67,7 @@ do_x2_shutdown (BOOL do_commit) {
 }
 
 static void
-checkcurs (DBC *curs, int cursflags, const char *key, const char *val, BOOL expect_it) {
+checkcurs (DBC *curs, int cursflags, const char *key, const char *val, bool expect_it) {
     DBT k,v;
     dbt_init(&k, NULL, 0);
     dbt_init(&v, NULL, 0);
@@ -84,7 +84,7 @@ checkcurs (DBC *curs, int cursflags, const char *key, const char *val, BOOL expe
 }
 
 static void
-do_x2_recover (BOOL did_commit) {
+do_x2_recover (bool did_commit) {
     DB_ENV *env;
     int r;
     r = db_env_create(&env, 0);                                                             CKERR(r);
@@ -97,9 +97,9 @@ do_x2_recover (BOOL did_commit) {
 	r = dba->open(dba, NULL, namea, NULL, DB_BTREE, DB_AUTO_COMMIT|DB_CREATE, 0666);    CKERR(r);
 	DBC *c;
 	r = dba->cursor(dba, txn, &c, 0);                                                   CKERR(r);
-	checkcurs(c, DB_FIRST, "u.a", "u.a.data", TRUE);
-	checkcurs(c, DB_NEXT,  "u.c", "u.c.data", TRUE);
-	checkcurs(c, DB_NEXT,  NULL,  NULL,       FALSE);
+	checkcurs(c, DB_FIRST, "u.a", "u.a.data", true);
+	checkcurs(c, DB_NEXT,  "u.c", "u.c.data", true);
+	checkcurs(c, DB_NEXT,  NULL,  NULL,       false);
 	r = c->c_close(c);                                                                  CKERR(r);	
 	r = dba->close(dba, 0);                                                             CKERR(r);
     }
@@ -111,7 +111,7 @@ do_x2_recover (BOOL did_commit) {
 	r = dbb->cursor(dbb, txn, &c, 0);                                                   CKERR(r);
 	checkcurs(c, DB_FIRST, "v.b", "v.b.data", did_commit);
 	checkcurs(c, DB_NEXT,  "v.d", "v.d.data", did_commit);
-	checkcurs(c, DB_NEXT,  NULL,  NULL,       FALSE);
+	checkcurs(c, DB_NEXT,  NULL,  NULL,       false);
 	r = c->c_close(c);                                                                  CKERR(r);	
 	r = dbb->close(dbb, 0);                                                             CKERR(r);
     }
@@ -126,7 +126,7 @@ const char *cmd;
 #if 0
 
 static void
-do_test_internal (BOOL commit) {
+do_test_internal (bool commit) {
     pid_t pid;
     if (0 == (pid=fork())) {
 	int r=execl(cmd, verbose ? "-v" : "-q", commit ? "--commit" : "--abort", NULL);
@@ -160,13 +160,13 @@ do_test_internal (BOOL commit) {
 
 static void
 do_test (void) {
-    do_test_internal(TRUE);
-    do_test_internal(FALSE);
+    do_test_internal(true);
+    do_test_internal(false);
 }
 
 #endif
 
-BOOL do_commit=FALSE, do_abort=FALSE, do_recover_committed=FALSE,  do_recover_aborted=FALSE;
+bool do_commit=false, do_abort=false, do_recover_committed=false,  do_recover_aborted=false;
 
 static void
 x2_parse_args (int argc, char * const argv[]) {
@@ -180,13 +180,13 @@ x2_parse_args (int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0],"--abort")==0) {
-	    do_abort=TRUE;
+	    do_abort=true;
 	} else if (strcmp(argv[0],"--commit")==0 || strcmp(argv[0], "--test") == 0) {
-	    do_commit=TRUE;
+	    do_commit=true;
 	} else if (strcmp(argv[0],"--recover-committed")==0 || strcmp(argv[0], "--recover") == 0) {
-	    do_recover_committed=TRUE;
+	    do_recover_committed=true;
 	} else if (strcmp(argv[0],"--recover-aborted")==0) {
-	    do_recover_aborted=TRUE;
+	    do_recover_aborted=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
@@ -218,13 +218,13 @@ int
 test_main (int argc, char * const argv[]) {
     x2_parse_args(argc, argv);
     if (do_commit) {
-	do_x2_shutdown (TRUE);
+	do_x2_shutdown (true);
     } else if (do_abort) {
-	do_x2_shutdown (FALSE);
+	do_x2_shutdown (false);
     } else if (do_recover_committed) {
-	do_x2_recover(TRUE);
+	do_x2_recover(true);
     } else if (do_recover_aborted) {
-	do_x2_recover(FALSE);
+	do_x2_recover(false);
     } 
 #if 0
     else {
diff --git a/src/tests/recovery_fileops_stress.cc b/src/tests/recovery_fileops_stress.cc
index 4731bf0aa2130ffec681eda811d10a6cf52d4625..2416e3190083095f4df4064189325d1ddd37eb59 100644
--- a/src/tests/recovery_fileops_stress.cc
+++ b/src/tests/recovery_fileops_stress.cc
@@ -241,7 +241,7 @@ static void do_random_fileops(void)
 
 
 static void run_test(int iter){
-    u_int32_t recovery_flags = DB_INIT_LOG | DB_INIT_TXN;
+    uint32_t recovery_flags = DB_INIT_LOG | DB_INIT_TXN;
     int r, i;
 
     XMALLOC_N(NUM_DICTIONARIES, db_array);
diff --git a/src/tests/recovery_fileops_unit.cc b/src/tests/recovery_fileops_unit.cc
index 5f2fe3c046d9e6171d5a73caa2d344c5a35e0da3..b029245c94b3e1280783f15266e94a33be04182b 100644
--- a/src/tests/recovery_fileops_unit.cc
+++ b/src/tests/recovery_fileops_unit.cc
@@ -410,7 +410,7 @@ create_and_maybe_checkpoint_and_or_close_after_create(void) {
             make_txn();
             break;
         default:
-            assert(FALSE);
+            assert(false);
             break;
     }
 }
@@ -509,7 +509,7 @@ did_create_commit_early(void) {
             r = 1;
             break;
         default:
-            assert(FALSE);
+            assert(false);
     }
     return r;
 }
diff --git a/src/tests/recovery_stress.cc b/src/tests/recovery_stress.cc
index 51605a2f476dff7f34c5eb9c695ac8878118224d..1c78ff721e98d27f34a75d806f51434fa8ec96ba 100644
--- a/src/tests/recovery_stress.cc
+++ b/src/tests/recovery_stress.cc
@@ -10,7 +10,7 @@
 #include "checkpoint_test.h"
 
 
-static const u_int64_t max_windows_cachesize = 256 << 20;
+static const uint64_t max_windows_cachesize = 256 << 20;
 static const int NUM_DICTIONARIES = 1;
 
 static const int OPER_STEPS = 6;
@@ -398,7 +398,7 @@ static void post_checkpoint_acts(ITER_SPEC spec) {
 
 static void run_test (int iter) {
 
-    u_int32_t flags = 0;
+    uint32_t flags = 0;
     int i, r;
 
     if (iter == 0)
@@ -407,7 +407,7 @@ static void run_test (int iter) {
     // Run with cachesize of 256 bytes per iteration
     // to force lots of disk I/O
     // (each iteration inserts about 4K rows/dictionary, 16 bytes/row, 4 dictionaries = 256K bytes inserted per iteration)
-    u_int64_t cachebytes = 0; // 0 => use default size
+    uint64_t cachebytes = 0; // 0 => use default size
     const int32_t K256 = 256 * 1024;
     cachebytes = K256 * (iter + 1) - (128 * 1024);
     if (cachebytes > max_windows_cachesize)
@@ -495,7 +495,7 @@ static void run_test (int iter) {
 	else
 	    thin_out(db, iter);
 #endif
-	u_int32_t delay = myrandom();
+	uint32_t delay = myrandom();
 	delay &= 0xFFF;       // select lower 12 bits, shifted up 8 for random number ...
 	delay = delay << 8;   // ... uniformly distributed between 0 and 1M ...
 	usleep(delay);        // ... to sleep up to one second (1M usec)
diff --git a/src/tests/root_fifo_41.cc b/src/tests/root_fifo_41.cc
index acdeba23c567a245f4d282773eaf5f8df7e997aa..0ce4d1747a55575b52930734db44430297f44b59 100644
--- a/src/tests/root_fifo_41.cc
+++ b/src/tests/root_fifo_41.cc
@@ -82,7 +82,7 @@ static void root_fifo_verify(DB_ENV *env, int n, int expectn) {
     r = db->close(db, 0); assert(r == 0); db = null_db;
 }
 
-static void root_fifo_41(int n, int ntxn, BOOL do_populate, char const* dirname) {
+static void root_fifo_41(int n, int ntxn, bool do_populate, char const* dirname) {
     if (verbose) printf("%s:%d %d\n", __FUNCTION__, __LINE__, n);
     int r;
 
@@ -169,7 +169,7 @@ int test_main(int argc, char *const argv[]) {
     int i;
     int n = -1;
     int ntxn = -1;
-    BOOL do_populate = FALSE;
+    bool do_populate = false;
 
     // parse_args(argc, argv);
     for (i = 1; i < argc; i++) {
@@ -182,7 +182,7 @@ int test_main(int argc, char *const argv[]) {
 	    assert(i+1 < argc);
 	    ntxn = parseint(argv[++i]);
         } else if (strcmp(argv[i], "-populate") == 0) {
-            do_populate = TRUE;
+            do_populate = true;
         } else if (strcmp(argv[i], "-h")==0) {
 	    assert(i+1<argc);
 	    dirname = argv[++i];
@@ -197,8 +197,8 @@ int test_main(int argc, char *const argv[]) {
     else {
         for (i=0; i<100; i++) {
             for (ntxn=1; ntxn<=4; ntxn++) {
-                root_fifo_41(i, ntxn, FALSE, dirname);
-                root_fifo_41(i, ntxn, TRUE, dirname);
+                root_fifo_41(i, ntxn, false, dirname);
+                root_fifo_41(i, ntxn, true, dirname);
             }
         }
     }
diff --git a/src/tests/shutdown-3344.cc b/src/tests/shutdown-3344.cc
index a3bd8b42858c48c88c4015953c5d83687622e40c..aba6b32d4d993e16f63c8cce0f1ae226bc71c4a2 100644
--- a/src/tests/shutdown-3344.cc
+++ b/src/tests/shutdown-3344.cc
@@ -134,9 +134,9 @@ test_main(int argc, char * const argv[]) {
     const char *env_dir = "dir.shutdown.ca";
     int ndbs = 500;
     int do_txn = 1;
-    u_int32_t pagesize = 1024;
-    u_int64_t cachesize = 1000000000;
-    u_int64_t nrows = 50000;
+    uint32_t pagesize = 1024;
+    uint64_t cachesize = 1000000000;
+    uint64_t nrows = 50000;
 
     for (int i = 1; i < argc ; i++) {
         char * const arg = argv[i];
@@ -182,7 +182,7 @@ test_main(int argc, char * const argv[]) {
     DB_ENV *env = NULL;
     r = db_env_create(&env, 0); assert_zero(r);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = env->set_cachesize(env, cachesize / gig, cachesize % gig, 1); assert_zero(r);
     }
     int env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG;
diff --git a/src/tests/simple.cc b/src/tests/simple.cc
index 1810dd247d8dcb4aba37782f63939db364fb8929..524bd54feb67a923d57b8dba1ac1c8e4feabf042 100644
--- a/src/tests/simple.cc
+++ b/src/tests/simple.cc
@@ -31,7 +31,7 @@ test_shutdown(void) {
 }
 
 static void
-setup (u_int32_t flags) {
+setup (uint32_t flags) {
     int r;
     if (env)
         test_shutdown();
diff --git a/src/tests/stat64-null-txn.cc b/src/tests/stat64-null-txn.cc
index bd777db0b740d885e2283806ae886daba299c6ec..0454951ddc2b20d7bb6f5450aa6473b55d52083c 100644
--- a/src/tests/stat64-null-txn.cc
+++ b/src/tests/stat64-null-txn.cc
@@ -46,7 +46,7 @@ test_stat64 (unsigned int N) {
     // insert sequential keys into the databases
 
     unsigned int i;
-    u_int64_t dsize=0;
+    uint64_t dsize=0;
     for (i=0; i<N; i++) {
         if (verbose>1 && i % (1<<14) == 0) {
             printf("%s(total=%u) inserted %u so far\n", __FILE__, N, i);
diff --git a/src/tests/stat64.cc b/src/tests/stat64.cc
index a4ef1d5e691b6e8bda2968a5edaefb2d51cf8cc8..e8a299ac6aaf44013077fdecd904da2677743a14 100644
--- a/src/tests/stat64.cc
+++ b/src/tests/stat64.cc
@@ -39,7 +39,7 @@ test_stat64 (unsigned int N) {
 
     // insert sequential keys into the databases
     unsigned int i;
-    u_int64_t dsize=0;
+    uint64_t dsize=0;
     for (i=0; i<N; i++) {
         if (verbose>1 && i % (1<<14) == 0) {
             printf("%s(total=%u) inserted %u so far\n", __FILE__, N, i);
diff --git a/src/tests/stress_openclose.h b/src/tests/stress_openclose.h
index 5b368698696e85d7346dec298de268bb319cfda5..e93bafffc7f5493dcad839435aadfe998f9970e4 100644
--- a/src/tests/stress_openclose.h
+++ b/src/tests/stress_openclose.h
@@ -184,9 +184,9 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
     struct scan_op_extra soe[4];
 
     // make the forward fast scanner
-    soe[0].fast = TRUE;
-    soe[0].fwd = TRUE;
-    soe[0].prefetch = FALSE;
+    soe[0].fast = true;
+    soe[0].fwd = true;
+    soe[0].prefetch = false;
     myargs[0].operation_extra = &soe[0];
     myargs[0].operation = scan_some_dbs;
 
diff --git a/src/tests/test-nested-xopen-eclose.cc b/src/tests/test-nested-xopen-eclose.cc
index 01e12a036d06f99beb8a2edf39c8d1878f28a88e..d80e1dffd870d0206ea195b9e2c7abcfdc62ce22 100644
--- a/src/tests/test-nested-xopen-eclose.cc
+++ b/src/tests/test-nested-xopen-eclose.cc
@@ -60,7 +60,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char *const argv[]) {
     int resultcode;
@@ -73,13 +73,13 @@ static void test_parse_args (int argc, char *const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/test-prepare.cc b/src/tests/test-prepare.cc
index 67b437f5c3e4f23a333c06c094502ea123114634..dd586746f719dc876f479684f0f153bed6f6d797 100644
--- a/src/tests/test-prepare.cc
+++ b/src/tests/test-prepare.cc
@@ -38,7 +38,7 @@ static void setup_env_and_prepare (DB_ENV **envp, const char *envdir, bool commi
     dbt_init(&key, "foo", 4);
     CKERR(db->put(db, txn, &key, &key, 0));
     { int chk_r = db->close(db, 0); CKERR(chk_r); }
-    u_int8_t gid[DB_GID_SIZE];
+    uint8_t gid[DB_GID_SIZE];
     memset(gid, 0, DB_GID_SIZE);
     gid[0]=42;
     CKERR(txn->prepare(txn, gid));
diff --git a/src/tests/test-prepare2.cc b/src/tests/test-prepare2.cc
index 29d7a1d0e5be49056c4bbca3218d008496d210bf..67f746d869fd924fd073347adf585e258f23ed3d 100644
--- a/src/tests/test-prepare2.cc
+++ b/src/tests/test-prepare2.cc
@@ -38,7 +38,7 @@ static void setup_env_and_prepare (DB_ENV **envp, const char *envdir, bool commi
     dbt_init(&key, "foo", 4);
     CKERR(db->put(db, txn, &key, &key, 0));
     { int chk_r = db->close(db, 0); CKERR(chk_r); }
-    u_int8_t gid[DB_GID_SIZE];
+    uint8_t gid[DB_GID_SIZE];
     memset(gid, 0, DB_GID_SIZE);
     gid[0]=42;
     CKERR(txn->prepare(txn, gid));
diff --git a/src/tests/test-prepare3.cc b/src/tests/test-prepare3.cc
index 2120884cfc42959e418fb5afafdb4f9933d00a0c..dc6c5c95e185b52f045ec252cc8bc9d039d82a6c 100644
--- a/src/tests/test-prepare3.cc
+++ b/src/tests/test-prepare3.cc
@@ -61,7 +61,7 @@ static void setup_env_and_prepare (DB_ENV **envp, const char *envdir) {
 	DBT key;
         dbt_init(&key, data, 3);
 	CKERR(db->put(db, txn, &key, &key, 0));
-	u_int8_t gid[DB_GID_SIZE];
+	uint8_t gid[DB_GID_SIZE];
 	memset(gid, 0, DB_GID_SIZE);
 	gid[0]='a'+tnum;
 	CKERR(txn->prepare(txn, gid));
diff --git a/src/tests/test-xopen-eclose.cc b/src/tests/test-xopen-eclose.cc
index c040f43b67b9d8bbd96aa57dc2311c08fbc05e74..b96a1e9d5c4b8ce241cf383292940aea34959c54 100644
--- a/src/tests/test-xopen-eclose.cc
+++ b/src/tests/test-xopen-eclose.cc
@@ -57,7 +57,7 @@ static void run_no_recover (void) {
 
 const char *cmd;
 
-BOOL do_test=FALSE, do_recover=FALSE, do_recover_only=FALSE, do_no_recover = FALSE;
+bool do_test=false, do_recover=false, do_recover_only=false, do_no_recover = false;
 
 static void test_parse_args (int argc, char *const argv[]) {
     int resultcode;
@@ -70,13 +70,13 @@ static void test_parse_args (int argc, char *const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "--test")==0) {
-	    do_test=TRUE;
+	    do_test=true;
         } else if (strcmp(argv[0], "--recover") == 0) {
-            do_recover=TRUE;
+            do_recover=true;
         } else if (strcmp(argv[0], "--recover-only") == 0) {
-            do_recover_only=TRUE;
+            do_recover_only=true;
         } else if (strcmp(argv[0], "--no-recover") == 0) {
-            do_no_recover=TRUE;
+            do_no_recover=true;
 	} else if (strcmp(argv[0], "-h")==0) {
 	    resultcode=0;
 	do_usage:
diff --git a/src/tests/test.h b/src/tests/test.h
index 1ab75d171bd08e6eac3155355c7c6d57e8984ea6..98a3c4527a24cd2390ce2eca401e94a6cc22c986 100644
--- a/src/tests/test.h
+++ b/src/tests/test.h
@@ -124,7 +124,7 @@ get_engine_status_val(DB_ENV * UU(env), const char * keyname) {
 #endif
 
 static __attribute__((__unused__)) DBT *
-dbt_init(DBT *dbt, const void *data, u_int32_t size) {
+dbt_init(DBT *dbt, const void *data, uint32_t size) {
     memset(dbt, 0, sizeof *dbt);
     dbt->data = (void*)data;
     dbt->size = size;
@@ -146,12 +146,12 @@ dbt_init_realloc (DBT *dbt) {
 }
 
 // Simple LCG random number generator.  Not high quality, but good enough.
-static u_int32_t rstate=1;
+static uint32_t rstate=1;
 static inline void mysrandom (int s) {
     rstate=s;
 }
-static inline u_int32_t myrandom (void) {
-    rstate = (279470275ull*(u_int64_t)rstate)%4294967291ull;
+static inline uint32_t myrandom (void) {
+    rstate = (279470275ull*(uint64_t)rstate)%4294967291ull;
     return rstate;
 }
 
@@ -201,14 +201,6 @@ uint_dbt_cmp (DB *db, const DBT *a, const DBT *b) {
     return 0;
 }
 
-#include <stdbool.h>
-#ifndef TRUE
-// typedef enum __toku_bool { FALSE=0, TRUE=1} BOOL;
-#define TRUE true
-#define FALSE false
-typedef bool BOOL;
-#endif
-
 #ifdef USE_TDB
 #define SET_TRACE_FILE(x) toku_set_trace_file(x)
 #define CLOSE_TRACE_FILE(x) toku_close_trace_file()
@@ -221,7 +213,7 @@ typedef bool BOOL;
 
 unsigned int seed = 0xFEEDFACE;
 
-static u_int64_t __attribute__((__unused__))
+static uint64_t __attribute__((__unused__))
 random64(void) {
     static int seeded = 0;
     if (!seeded) {
@@ -229,10 +221,10 @@ random64(void) {
         srandom(seed);
     }
     //random() generates 31 bits of randomness (low order)
-    u_int64_t low     = random();
-    u_int64_t high    = random();
-    u_int64_t twobits = random();
-    u_int64_t ret     = low | (high<<31) | (twobits<<62); 
+    uint64_t low     = random();
+    uint64_t high    = random();
+    uint64_t twobits = random();
+    uint64_t ret     = low | (high<<31) | (twobits<<62); 
     return ret;
 }
 
@@ -283,14 +275,14 @@ void print_time_now(void) {
 //  divide by 0
 //  null dereference
 //  abort()
-//  assert(FALSE) (from <assert.h>)
-//  assert(FALSE) (from <toku_assert.h>)
+//  assert(false) (from <assert.h>)
+//  assert(false) (from <toku_assert.h>)
 //
 //Linux:
-//  abort() and both assert(FALSE) cause FILE buffers to be flushed and written to disk: Unacceptable
+//  abort() and both assert(false) cause FILE buffers to be flushed and written to disk: Unacceptable
 //Windows:
 //  None of them cause file buffers to be flushed/written to disk, however
-//  abort(), assert(FALSE) <assert.h>, null dereference, and divide by 0 cause popups requiring user intervention during tests: Unacceptable
+//  abort(), assert(false) <assert.h>, null dereference, and divide by 0 cause popups requiring user intervention during tests: Unacceptable
 //
 //kill -SIGKILL $pid is annoying (and so far untested)
 //
diff --git a/src/tests/test1426.cc b/src/tests/test1426.cc
index 677b0b5013eaa1b070871c6a58e7d492ab86723b..43b98547188094e016559ed34e41259fcb033f58 100644
--- a/src/tests/test1426.cc
+++ b/src/tests/test1426.cc
@@ -51,18 +51,18 @@ do_insert_delete_fifo (void)
     r = db->set_pagesize(db, 4096);                                       CKERR(r);
     r = db->open(db, null_txn, "main", 0,     DB_BTREE, DB_CREATE, 0666); CKERR(r);
     {
-	u_int64_t i;
-	u_int64_t n_deleted = 0;
-	u_int64_t N=20000; // total number to insert
-	u_int64_t M= 5000; // size of rolling fifo
-	u_int64_t D=  200; // number to delete at once
+	uint64_t i;
+	uint64_t n_deleted = 0;
+	uint64_t N=20000; // total number to insert
+	uint64_t M= 5000; // size of rolling fifo
+	uint64_t D=  200; // number to delete at once
 	for (i=0; i<N; i++) {
 	    {
 		char k[100],v[100];
 		int keylen = snprintf(k, sizeof k, "%016" PRIu64 "key", i);
-                u_int32_t rand1 = myrandom();
-                u_int32_t rand2 = myrandom();
-                u_int32_t rand3 = myrandom();
+                uint32_t rand1 = myrandom();
+                uint32_t rand2 = myrandom();
+                uint32_t rand3 = myrandom();
 		int vallen = snprintf(v, sizeof v, "%016" PRIu64 "val%08x%08x%08x", i, rand1, rand2, rand3);
 		DBT kt, vt;
 		r = db->put(db, null_txn, dbt_init(&kt, k, keylen) , dbt_init(&vt, v, vallen), 0);    CKERR(r);
@@ -71,7 +71,7 @@ do_insert_delete_fifo (void)
 		// Once every D steps, delete everything until there are only M things left.
 		// Flush the data down the tree for all the values we will do
 		{
-		    u_int64_t peek_here = n_deleted;
+		    uint64_t peek_here = n_deleted;
 		    while (peek_here + M < i) {
 			char k[100];
 			int keylen = snprintf(k, sizeof k, "%016" PRIu64 "key", peek_here);
diff --git a/src/tests/test1842.cc b/src/tests/test1842.cc
index 5950b6fdc52f6e8056d9f392d8ed12d6c014a568..f79ed454ea2540f620b22e532236e99822159171 100644
--- a/src/tests/test1842.cc
+++ b/src/tests/test1842.cc
@@ -21,14 +21,14 @@ length_int_dbt_cmp (DB *db_compare, const DBT *a, const DBT *b) {
     assert(b->size > sizeof(int));
 
     int i;
-    int extra_len_a = *(u_int8_t*)((u_int8_t*)a->data    +4);
+    int extra_len_a = *(uint8_t*)((uint8_t*)a->data    +4);
     assert(a->size == sizeof(int)+extra_len_a);
 
     for (i = 1; i < extra_len_a; i++) {
         assert(((char*)a->data+4)[i] == ' ');
     }
 
-    int extra_len_b = *(u_int8_t*)((u_int8_t*)b->data+4);
+    int extra_len_b = *(uint8_t*)((uint8_t*)b->data+4);
     assert(b->size == sizeof(int)+extra_len_b);
     for (i = 1; i < extra_len_b; i++) {
         assert(((char*)b->data+4)[i] == ' ');
@@ -46,7 +46,7 @@ length_int_dbt_cmp (DB *db_compare, const DBT *a, const DBT *b) {
 }
 
 static void
-setup_db (u_int32_t dup_mode) {
+setup_db (uint32_t dup_mode) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -74,7 +74,7 @@ setup_db (u_int32_t dup_mode) {
 }
 
 static inline DBT *
-dbt_init_length(DBT *dbt, int val, u_int8_t extra_len, u_int8_t* buf) {
+dbt_init_length(DBT *dbt, int val, uint8_t extra_len, uint8_t* buf) {
     *(int*)buf = val;
     buf[sizeof(int)] = extra_len;
     int i;
@@ -85,7 +85,7 @@ dbt_init_length(DBT *dbt, int val, u_int8_t extra_len, u_int8_t* buf) {
 }
 
 static void
-test_txn_abort (u_int32_t dup_mode) {
+test_txn_abort (uint32_t dup_mode) {
     setup_db(dup_mode);
     DBT key, val;
     int r;
@@ -93,14 +93,14 @@ test_txn_abort (u_int32_t dup_mode) {
 
     DB_TXN *txn = NULL;
     r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
-    u_int8_t value1[256];
-    u_int8_t value2[256];
+    uint8_t value1[256];
+    uint8_t value2[256];
 
     int k = 1;
     int v1 = 1;
     int v2 = 1;
-    u_int8_t extra_1 = 1;
-    u_int8_t extra_2 = 2;
+    uint8_t extra_1 = 1;
+    uint8_t extra_2 = 2;
     r = db->put(db, txn, dbt_init(&key, &k, sizeof k), dbt_init_length(&val, v1, extra_1, value1), 0); 
         CKERR(r);
     r = txn->commit(txn, DB_TXN_NOSYNC); 
diff --git a/src/tests/test3039.cc b/src/tests/test3039.cc
index 52ec4ac675585d84cc0316572e6e51d76e3b6a73..603881d410ca788fc8bdaf96b83c74738bcdb986 100644
--- a/src/tests/test3039.cc
+++ b/src/tests/test3039.cc
@@ -32,7 +32,7 @@ static DB *db;
 #define N_PER_XACTION 1000
 #endif
 
-static void create_db (u_int64_t N) {
+static void create_db (uint64_t N) {
     n_rows = N;
     { int r = system("rm -rf " ENVDIR);                                        CKERR(r); }
     toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO);
@@ -51,7 +51,7 @@ static void create_db (u_int64_t N) {
     { int r = txn->commit(txn, DB_TXN_NOSYNC);                                 CKERR(r); }
 
     { int r = env->txn_begin(env, NULL, &txn, 0);                              CKERR(r); }
-    u_int64_t n_since_commit = 0;
+    uint64_t n_since_commit = 0;
     for (unsigned long long i=0; i<N; i++) {
 	if (n_since_commit++ > N_PER_XACTION) {
 	    { int r = txn->commit(txn, DB_TXN_NOSYNC);                         CKERR(r); }
@@ -116,7 +116,7 @@ void* reader_thread (void *arg)
 	}
     }
     
-    u_int64_t n_since_commit = 0;
+    uint64_t n_since_commit = 0;
     long long n_read_so_far = 0;
     while ((!rs->finish) && ((rs->n_to_read < 0) || (n_read_so_far < rs->n_to_read))) {
 
diff --git a/src/tests/test3219.cc b/src/tests/test3219.cc
index ffe6a3b3667f74202cc2c6ee79ec31743388ecb2..19e9ce93142d76a4d2155bda97cf5af36a6ea86f 100644
--- a/src/tests/test3219.cc
+++ b/src/tests/test3219.cc
@@ -97,7 +97,7 @@ finish (void) {
 }
 
 
-volatile int finished = FALSE;
+volatile int finished = false;
 
 // Thread A performs checkpoints
 static void*
@@ -127,7 +127,7 @@ start_b (void *arg __attribute__((__unused__))) {
 	}
 	r = txn->commit(txn, DB_TXN_NOSYNC);                                              CKERR(r);
     }
-    finished = TRUE;
+    finished = true;
     return NULL;
 }
 
@@ -153,7 +153,7 @@ run_test (void)
     setup();
     pthread_t t[3];
     pthread_fun funs[3] = {start_a, start_b, start_c};
-    finished = FALSE;
+    finished = false;
     for (int i=0; i<3; i++) {
 	int r = pthread_create(&t[i], NULL, funs[i], NULL);
 	assert(r==0);
diff --git a/src/tests/test5092.cc b/src/tests/test5092.cc
index 957046b5c0f459815f7487c3ce567aa03a48a720..e74d8ccaf61788f29c18a7c9dec4186cb9f92870 100644
--- a/src/tests/test5092.cc
+++ b/src/tests/test5092.cc
@@ -34,7 +34,7 @@ static void setup_env_and_prepare (DB_ENV **envp, const char *envdir, bool commi
     CKERR(db_create(&db, *envp, 0));
     CKERR(db->open(db, NULL, "foo.db", 0, DB_BTREE, DB_CREATE | DB_AUTO_COMMIT, S_IRWXU+S_IRWXG+S_IRWXO));
     CKERR((*envp)->txn_begin(*envp, 0, &txn, 0));
-    u_int8_t gid[DB_GID_SIZE];
+    uint8_t gid[DB_GID_SIZE];
     memset(gid, 0, DB_GID_SIZE);
     gid[0]=42;
     CKERR(txn->prepare(txn, gid));
diff --git a/src/tests/test_3529_insert_2.cc b/src/tests/test_3529_insert_2.cc
index 3dcf5d06638be9abe3812b026811e3f7356d7b43..049008c2b54f800f1461b9b7d94570f6de2ce238 100644
--- a/src/tests/test_3529_insert_2.cc
+++ b/src/tests/test_3529_insert_2.cc
@@ -22,8 +22,8 @@ static DB_ENV *env = NULL;
 static DB_TXN *txn_a = NULL;
 static DB_TXN *txn_b = NULL;
 static DB *db = NULL;
-static u_int32_t db_page_size = 4096;
-// static u_int32_t db_basement_size = 4096;
+static uint32_t db_page_size = 4096;
+// static uint32_t db_basement_size = 4096;
 static const char *envdir = ENVDIR;
 
 static int 
@@ -53,7 +53,7 @@ next_do_nothing(DBT const *UU(a), DBT  const *UU(b), void *UU(c)) {
 static void *
 do_insert_2(void *arg) {
     int r;
-    u_int64_t key = 2;
+    uint64_t key = 2;
     char val[800]; memset(val, 0, sizeof val);
     DBT k,v;
     r = db->put(db, txn_b, dbt_init(&k, &key, sizeof key), dbt_init(&v, val, sizeof val), 0);
@@ -94,8 +94,8 @@ run_test(void) {
     r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
     DB_LOADER *loader = NULL;
     r = env->create_loader(env, txn, &loader, db, 1, &db, NULL, NULL, 0); CKERR(r);
-    for (u_int64_t i = 0; i < 5; i++) {
-        u_int64_t key = i;
+    for (uint64_t i = 0; i < 5; i++) {
+        uint64_t key = i;
         char val[800]; memset(val, 0, sizeof val);
         DBT k,v;
         r = loader->put(loader, dbt_init(&k, &key, sizeof key), dbt_init(&v, val, sizeof val)); CKERR(r);
@@ -105,8 +105,8 @@ run_test(void) {
 
     // delete key 2
     r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
-    for (u_int64_t i = 2; i < 3; i++) {
-        u_int64_t key = i;
+    for (uint64_t i = 2; i < 3; i++) {
+        uint64_t key = i;
         DBT k;
         r = db->del(db, txn, dbt_init(&k, &key, sizeof key), 0); CKERR(r);
     }
diff --git a/src/tests/test_3529_table_lock.cc b/src/tests/test_3529_table_lock.cc
index 3d271f968037949e6ad9852fafeda104ed4ac6c1..a2eb3082aabdfab7d35b510dc91ac65a319626d8 100644
--- a/src/tests/test_3529_table_lock.cc
+++ b/src/tests/test_3529_table_lock.cc
@@ -22,8 +22,8 @@ static DB_ENV *env = NULL;
 static DB_TXN *txn_a = NULL;
 static DB_TXN *txn_b = NULL;
 static DB *db = NULL;
-static u_int32_t db_page_size = 4096;
-// static u_int32_t db_basement_size = 4096;
+static uint32_t db_page_size = 4096;
+// static uint32_t db_basement_size = 4096;
 static const char *envdir = ENVDIR;
 
 static int 
@@ -82,8 +82,8 @@ run_test(void) {
     r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
     DB_LOADER *loader = NULL;
     r = env->create_loader(env, txn, &loader, db, 1, &db, NULL, NULL, 0); CKERR(r);
-    for (u_int64_t i = 0; i < 5; i++) {
-        u_int64_t key = i;
+    for (uint64_t i = 0; i < 5; i++) {
+        uint64_t key = i;
         char val[800]; memset(val, 0, sizeof val);
         DBT k,v;
         r = loader->put(loader, dbt_init(&k, &key, sizeof key), dbt_init(&v, val, sizeof val)); CKERR(r);
@@ -97,8 +97,8 @@ run_test(void) {
 
     // delete the keys in the first leaf node
     r = env->txn_begin(env, 0, &txn, 0); CKERR(r);
-    for (u_int64_t i = 0; i < 3; i++) {
-        u_int64_t key = i;
+    for (uint64_t i = 0; i < 3; i++) {
+        uint64_t key = i;
         DBT k;
         r = db->del(db, txn, dbt_init(&k, &key, sizeof key), 0); CKERR(r);
     }
diff --git a/src/tests/test_3645.cc b/src/tests/test_3645.cc
index 057a21fd1694cc9456a4c67ed7a05e36f70c9be3..f2526ad94df5af8ac0c51826460bbd76ce68d1ce 100644
--- a/src/tests/test_3645.cc
+++ b/src/tests/test_3645.cc
@@ -27,7 +27,7 @@
 // If the test runs to completion without crashing, we consider it a success.
 //
 
-BOOL run_test;
+bool run_test;
 int time_of_test;
 int num_elements;
 
@@ -35,8 +35,8 @@ struct arg {
     int n;
     DB *db;
     DB_ENV* env;
-    BOOL fast;
-    BOOL fwd;
+    bool fast;
+    bool fwd;
 };
 
 static int
@@ -108,7 +108,7 @@ static void *update_db(void *arg) {
     DB_TXN* txn = NULL;
     while (run_test) {
         int r = env->txn_begin(env, 0, &txn, DB_TXN_SNAPSHOT); CKERR(r);
-        for (u_int32_t i = 0; i < 1000; i++) {
+        for (uint32_t i = 0; i < 1000; i++) {
             int rand_key = random() % n;
             int rand_val = random();
             DBT key, val;
@@ -130,7 +130,7 @@ static void *test_time(void *arg) {
     assert(arg == NULL);
     usleep(time_of_test*1000*1000);
     if (verbose) printf("should now end test\n");
-    run_test = FALSE;
+    run_test = false;
     return arg;
 }
 
@@ -191,36 +191,36 @@ test_evictions (void) {
     //   - one thread doing table scan without bulk fetch
     //   - one thread doing random point queries
     //
-    run_test = TRUE;
+    run_test = true;
     if (verbose) printf("starting creation of pthreads\n");
     toku_pthread_t mytids[7];
     struct arg myargs[7];
-    for (u_int32_t i = 0; i < sizeof(myargs)/sizeof(myargs[0]); i++) {
+    for (uint32_t i = 0; i < sizeof(myargs)/sizeof(myargs[0]); i++) {
         myargs[i].n = n;
         myargs[i].db = db;
         myargs[i].env = env;
-        myargs[i].fast = TRUE;
-        myargs[i].fwd = TRUE;
+        myargs[i].fast = true;
+        myargs[i].fwd = true;
     }
 
     // make the forward fast scanner
-    myargs[0].fast = TRUE;
-    myargs[0].fwd = TRUE;
+    myargs[0].fast = true;
+    myargs[0].fwd = true;
     { int chk_r = toku_pthread_create(&mytids[0], NULL, scan_db, &myargs[0]); CKERR(chk_r); }
 
     // make the forward slow scanner
-    myargs[1].fast = FALSE;
-    myargs[1].fwd = TRUE;
+    myargs[1].fast = false;
+    myargs[1].fwd = true;
     { int chk_r = toku_pthread_create(&mytids[1], NULL, scan_db, &myargs[1]); CKERR(chk_r); }
 
     // make the backward fast scanner
-    myargs[2].fast = TRUE;
-    myargs[2].fwd = FALSE;
+    myargs[2].fast = true;
+    myargs[2].fwd = false;
     { int chk_r = toku_pthread_create(&mytids[2], NULL, scan_db, &myargs[2]); CKERR(chk_r); }
 
     // make the backward slow scanner
-    myargs[3].fast = FALSE;
-    myargs[3].fwd = FALSE;
+    myargs[3].fast = false;
+    myargs[3].fwd = false;
     { int chk_r = toku_pthread_create(&mytids[3], NULL, scan_db, &myargs[3]); CKERR(chk_r); }
 
     // make the guy that updates the db
@@ -232,7 +232,7 @@ test_evictions (void) {
     // make the guy that sleeps
     { int chk_r = toku_pthread_create(&mytids[6], NULL, test_time, NULL); CKERR(chk_r); }
     
-    for (u_int32_t i = 0; i < sizeof(myargs)/sizeof(myargs[0]); i++) {
+    for (uint32_t i = 0; i < sizeof(myargs)/sizeof(myargs[0]); i++) {
         void *ret;
         r = toku_pthread_join(mytids[i], &ret); assert_zero(r);
     }
diff --git a/src/tests/test_4657.cc b/src/tests/test_4657.cc
index 667dcf74b9abd07a6603ae2650e11b392baa9fee..b3b0595999e6ea53116975d3dc4b868207e871b4 100644
--- a/src/tests/test_4657.cc
+++ b/src/tests/test_4657.cc
@@ -50,10 +50,10 @@ int test_main (int argc, char * const argv[]) {
   DB_TXN* txn;
   r = env->txn_begin(env, NULL, &txn, 0);
   CKERR(r);
-  for (u_int32_t i = 0; i < 1000; i++) {
+  for (uint32_t i = 0; i < 1000; i++) {
       DBT key,val;
-      u_int64_t key_data = i;
-      u_int64_t val_data = i;
+      uint64_t key_data = i;
+      uint64_t val_data = i;
       r = db->put(
           db,
           txn,
diff --git a/src/tests/test_5015.cc b/src/tests/test_5015.cc
index 563535b852fe6bfe888764e4ecda99b1ee240eaa..74218f48cd5485c87ee45cbdc961c65c3cda8902 100644
--- a/src/tests/test_5015.cc
+++ b/src/tests/test_5015.cc
@@ -46,7 +46,7 @@ test_main(int argc, char *const argv[]) {
     DBT key,val;
     r = db->put(db, child_txn, dbt_init(&key, "a", 2), dbt_init(&val, "a", 2), 0);       
     CKERR(r);
-    u_int8_t gid[DB_GID_SIZE];
+    uint8_t gid[DB_GID_SIZE];
     memset(gid, 0, DB_GID_SIZE);
     gid[0]='a';
     r = child_txn->prepare(child_txn, gid);
diff --git a/src/tests/test_abort2.cc b/src/tests/test_abort2.cc
index 9294e1d7f798bcf12c72f6f4e32f0c21e78c5135..3172e8d4d64a0982e17582cbe1c2abc0e8780412 100644
--- a/src/tests/test_abort2.cc
+++ b/src/tests/test_abort2.cc
@@ -67,7 +67,7 @@ do_test_abort2 (void) {
     r=db->open(db, txn, "foo.db", 0, DB_BTREE, 0, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
 #ifndef TOKUDB
     {
-	u_int32_t ps;
+	uint32_t ps;
 	r=db->get_pagesize(db, &ps); CKERR(r);
 	assert(ps==4096);
     }
diff --git a/src/tests/test_abort4.cc b/src/tests/test_abort4.cc
index 22c0830d2d8f1bb51d8b357c0e9f3719848b117f..2d4a46171cb4c72e6506947c1cfdcd1c90d3dc97 100644
--- a/src/tests/test_abort4.cc
+++ b/src/tests/test_abort4.cc
@@ -20,7 +20,7 @@ DB_ENV *env;
 DB *db;
 DB_TXN *null_txn = NULL;
 DB_TXN *txn;
-u_int32_t find_num;
+uint32_t find_num;
 
 long closemode = -1; // must be set to 0 or 1 on command line
 long logsize   = -2; // must be set to a number from -1 to 20 inclusive, on command line.
@@ -64,7 +64,7 @@ abort_txn(void) {
 }
 
 static void
-put(u_int32_t k, u_int32_t v) {
+put(uint32_t k, uint32_t v) {
     int r;
     DBT key,val;
 
@@ -74,13 +74,13 @@ put(u_int32_t k, u_int32_t v) {
 }
 
 static void
-test_insert_and_abort(u_int32_t num_to_insert) {
+test_insert_and_abort(uint32_t num_to_insert) {
     find_num = 0;
     
-    u_int32_t k;
-    u_int32_t v;
+    uint32_t k;
+    uint32_t v;
 
-    u_int32_t i;
+    uint32_t i;
     for (i=0; i < num_to_insert; i++) {
         k = htonl(i);
         v = htonl(i+num_to_insert);
@@ -90,11 +90,11 @@ test_insert_and_abort(u_int32_t num_to_insert) {
 }
 
 static void
-test_insert_and_abort_and_insert(u_int32_t num_to_insert) {
+test_insert_and_abort_and_insert(uint32_t num_to_insert) {
     test_insert_and_abort(num_to_insert); 
     find_num = num_to_insert / 2;
-    u_int32_t k, v;
-    u_int32_t i;
+    uint32_t k, v;
+    uint32_t i;
     int r;
     r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
     r=db->pre_acquire_table_lock(db, txn); CKERR(r);
@@ -154,7 +154,7 @@ verify_and_tear_down(int close_first) {
     DBC *cursor;
     r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
     r = db->cursor(db, txn, &cursor, 0); CKERR(r);
-    u_int32_t found = 0;
+    uint32_t found = 0;
     do {
         r = cursor->c_getf_next(cursor, 0, do_nothing, NULL);
         if (r==0) found++;
@@ -174,7 +174,7 @@ runtests(void) {
         abort_txn();
         verify_and_tear_down(close_first);
     } else {
-	u_int32_t n = 1<<logsize;
+	uint32_t n = 1<<logsize;
 	{
             if (verbose) {
                 printf("\t%s:%d-%s() close_first=%d n=%06x\n",
diff --git a/src/tests/test_abort5.cc b/src/tests/test_abort5.cc
index 8b7d12204eaf63ddd30764358ee95719b02c9d6e..377550d3625874080a0507a250e7e8f53b2a5c2c 100644
--- a/src/tests/test_abort5.cc
+++ b/src/tests/test_abort5.cc
@@ -23,7 +23,7 @@ DB *db;
 DB_TXN *null_txn = NULL;
 DB_TXN *txn;
 DB_TXN *childtxn;
-u_int32_t find_num;
+uint32_t find_num;
 
 static void
 init(void) {
@@ -82,7 +82,7 @@ abort_txn(int type) {
          if (type==0) abort_parent();
     else if (type==1) abort_childtxn();
     else if (type==2) abort_both();
-    else assert(FALSE);
+    else assert(false);
 
     find_num = 0;
     childtxn = NULL;
@@ -90,11 +90,11 @@ abort_txn(int type) {
 }
 
 static void
-put(u_int32_t k, u_int32_t v) {
+put(uint32_t k, uint32_t v) {
     int r;
     DBT key,val;
-    static u_int32_t kvec[128];
-    static u_int32_t vvec[128];
+    static uint32_t kvec[128];
+    static uint32_t vvec[128];
 
     kvec[0] = k;
     vvec[0] = v;
@@ -104,14 +104,14 @@ put(u_int32_t k, u_int32_t v) {
 }
 
 static void
-test_insert_and_abort(u_int32_t num_to_insert, int abort_type) {
+test_insert_and_abort(uint32_t num_to_insert, int abort_type) {
     if (verbose>1) printf("\t" __FILE__ ": insert+abort(%u,%d)\n", num_to_insert, abort_type);
     find_num = 0;
     
-    u_int32_t k;
-    u_int32_t v;
+    uint32_t k;
+    uint32_t v;
 
-    u_int32_t i;
+    uint32_t i;
     for (i=0; i < num_to_insert; i++) {
         k = htonl(i);
         v = htonl(i+num_to_insert);
@@ -121,12 +121,12 @@ test_insert_and_abort(u_int32_t num_to_insert, int abort_type) {
 }
 
 static void
-test_insert_and_abort_and_insert(u_int32_t num_to_insert, int abort_type) {
+test_insert_and_abort_and_insert(uint32_t num_to_insert, int abort_type) {
     if (verbose>1) printf("\t" __FILE__ ": insert+abort+insert(%u,%d)\n", num_to_insert, abort_type);
     test_insert_and_abort(num_to_insert, abort_type); 
     find_num = num_to_insert / 2;
-    u_int32_t k, v;
-    u_int32_t i;
+    uint32_t k, v;
+    uint32_t i;
     for (i=0; i < find_num; i++) {
         k = htonl(i);
         v = htonl(i+5);
@@ -178,7 +178,7 @@ verify_and_tear_down(int close_first) {
     DBC *cursor;
     r=env->txn_begin(env, 0, &txn, 0); CKERR(r);
     r = db->cursor(db, txn, &cursor, 0); CKERR(r);
-    u_int32_t found = 0;
+    uint32_t found = 0;
     do {
         r = cursor->c_getf_next(cursor, 0, do_nothing, NULL);
         if (r==0) found++;
@@ -198,7 +198,7 @@ runtests(int abort_type) {
         init();
         abort_txn(abort_type);
         verify_and_tear_down(close_first);
-        u_int32_t n;
+        uint32_t n;
         for (n = 1; n < 1<<10; n*=2) {
             init();
             test_insert_and_abort(n, abort_type);
diff --git a/src/tests/test_blobs_leaf_split.cc b/src/tests/test_blobs_leaf_split.cc
index 053c0ca2623fad11bc7244c68743e6b77bdfa955..08595fa41c972d0344a4bd5abcbd99e8795b04ed 100644
--- a/src/tests/test_blobs_leaf_split.cc
+++ b/src/tests/test_blobs_leaf_split.cc
@@ -35,8 +35,8 @@ int test_main(int argc, char * const argv[]) {
     int db_env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG;
     const char *db_filename = "blobs.db";
     int do_txn = 1;
-    u_int64_t cachesize = 0;
-    u_int32_t pagesize = 0;
+    uint64_t cachesize = 0;
+    uint32_t pagesize = 0;
 
     int i;
     for (i = 1; i < argc; i++) {
@@ -76,7 +76,7 @@ int test_main(int argc, char * const argv[]) {
     DB_ENV *db_env = NULL;
     r = db_env_create(&db_env, 0); assert_zero(r);
     if (cachesize) {
-        const u_int64_t gig = 1 << 30;
+        const uint64_t gig = 1 << 30;
         r = db_env->set_cachesize(db_env, cachesize / gig, cachesize % gig, 1); assert_zero(r);
     }
     if (!do_txn)
diff --git a/src/tests/test_bulk_fetch.cc b/src/tests/test_bulk_fetch.cc
index ef62acfecd7b36a0739ad485204dddffec602e33..fe25a8681673d5fb9dd323b0f79b6b2e5946fceb 100644
--- a/src/tests/test_bulk_fetch.cc
+++ b/src/tests/test_bulk_fetch.cc
@@ -15,17 +15,17 @@
 
 static void 
 verify_val(DBT const *a, DBT  const *b, void *c) {
-    assert(a->size == sizeof(u_int64_t));
-    assert(b->size == sizeof(u_int64_t));
-    u_int64_t* expected = (u_int64_t *)c;
-    assert(*expected == *(u_int64_t *)a->data);
-    assert(*expected == *(u_int64_t *)b->data);
+    assert(a->size == sizeof(uint64_t));
+    assert(b->size == sizeof(uint64_t));
+    uint64_t* expected = (uint64_t *)c;
+    assert(*expected == *(uint64_t *)a->data);
+    assert(*expected == *(uint64_t *)b->data);
 }
 
 static int
 verify_fwd_fast(DBT const *a, DBT  const *b, void *c) {
     verify_val(a,b,c);
-    u_int64_t* expected = (u_int64_t *)c;
+    uint64_t* expected = (uint64_t *)c;
     *expected = *expected + 1;
     return TOKUDB_CURSOR_CONTINUE;
 }
@@ -33,7 +33,7 @@ verify_fwd_fast(DBT const *a, DBT  const *b, void *c) {
 static int
 verify_fwd_slow(DBT const *a, DBT  const *b, void *c) {
     verify_val(a,b,c);
-    u_int64_t* expected = (u_int64_t *)c;
+    uint64_t* expected = (uint64_t *)c;
     *expected = *expected + 1;
     return 0;
 }
@@ -41,7 +41,7 @@ verify_fwd_slow(DBT const *a, DBT  const *b, void *c) {
 static int
 verify_bwd_fast(DBT const *a, DBT  const *b, void *c) {
     verify_val(a,b,c);
-    u_int64_t* expected = (u_int64_t *)c;
+    uint64_t* expected = (uint64_t *)c;
     *expected = *expected - 1;
     return TOKUDB_CURSOR_CONTINUE;
 }
@@ -49,16 +49,16 @@ verify_bwd_fast(DBT const *a, DBT  const *b, void *c) {
 static int
 verify_bwd_slow(DBT const *a, DBT  const *b, void *c) {
     verify_val(a,b,c);
-    u_int64_t* expected = (u_int64_t *)c;
+    uint64_t* expected = (uint64_t *)c;
     *expected = *expected - 1;
     return 0;
 }
 
-u_int64_t num_pivots_fetched_prefetch;
-u_int64_t num_basements_decompressed_aggressive;
-u_int64_t num_basements_decompressed_prefetch;
-u_int64_t num_basements_fetched_aggressive;
-u_int64_t num_basements_fetched_prefetch;
+uint64_t num_pivots_fetched_prefetch;
+uint64_t num_basements_decompressed_aggressive;
+uint64_t num_basements_decompressed_prefetch;
+uint64_t num_basements_fetched_aggressive;
+uint64_t num_basements_fetched_prefetch;
 
 static void
 init_eng_stat_vars(DB_ENV* env) {
@@ -88,7 +88,7 @@ print_relevant_eng_stat_vars(DB_ENV* env) {
 }
 
 static void
-test_bulk_fetch (u_int64_t n, BOOL prelock, BOOL disable_prefetching) {
+test_bulk_fetch (uint64_t n, bool prelock, bool disable_prefetching) {
     if (verbose) printf("test_rand_insert:%" PRId64 " \n", n);
 
     DB_TXN * const null_txn = 0;
@@ -107,7 +107,7 @@ test_bulk_fetch (u_int64_t n, BOOL prelock, BOOL disable_prefetching) {
     // arbitrarily have cachetable size be 4*n
     // goal is to make it small enough such that all of data 
     // does not fit in cachetable, but not so small that we get thrashing
-    r = env->set_cachesize(env, 0, (u_int32_t)4*n, 1); assert(r == 0);
+    r = env->set_cachesize(env, 0, (uint32_t)4*n, 1); assert(r == 0);
     r = env->open(env, ENVDIR, DB_CREATE+DB_PRIVATE+DB_INIT_MPOOL, 0); assert(r == 0);
 
     DB *db;
@@ -122,8 +122,8 @@ test_bulk_fetch (u_int64_t n, BOOL prelock, BOOL disable_prefetching) {
     r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE, 0666);
     assert(r == 0);
 
-    u_int64_t keys[n];
-    u_int64_t i;
+    uint64_t keys[n];
+    uint64_t i;
     for (i=0; i<n; i++) {
         keys[i] = i;
     }
@@ -140,7 +140,7 @@ test_bulk_fetch (u_int64_t n, BOOL prelock, BOOL disable_prefetching) {
     DBC* cursor;
 
     // verify fast
-    u_int32_t flags = disable_prefetching ? DBC_DISABLE_PREFETCHING : 0;
+    uint32_t flags = disable_prefetching ? DBC_DISABLE_PREFETCHING : 0;
     if (disable_prefetching) {
         init_eng_stat_vars(env);
     }
@@ -154,7 +154,7 @@ test_bulk_fetch (u_int64_t n, BOOL prelock, BOOL disable_prefetching) {
             );
         CKERR(r);
     }
-    u_int64_t expected = 0;
+    uint64_t expected = 0;
     while (r != DB_NOTFOUND) {
         r = cursor->c_getf_next(cursor, 0, verify_fwd_fast, &expected);
         assert(r==0 || r==DB_NOTFOUND);
@@ -256,9 +256,9 @@ test_bulk_fetch (u_int64_t n, BOOL prelock, BOOL disable_prefetching) {
 int
 test_main(int argc, char *const argv[]) {
     parse_args(argc, argv);
-    test_bulk_fetch(10000, FALSE, TRUE);
-    test_bulk_fetch(10000, TRUE, TRUE);
-    test_bulk_fetch(10000, FALSE, FALSE);
-    test_bulk_fetch(10000, TRUE, FALSE);
+    test_bulk_fetch(10000, false, true);
+    test_bulk_fetch(10000, true, true);
+    test_bulk_fetch(10000, false, false);
+    test_bulk_fetch(10000, true, false);
     return 0;
 }
diff --git a/src/tests/test_cachesize.cc b/src/tests/test_cachesize.cc
index 4993d0a41f032929306aff6850faaaca27e0983a..cce8e052b10e2ad9288dccd70bdd70de32ef3a22 100644
--- a/src/tests/test_cachesize.cc
+++ b/src/tests/test_cachesize.cc
@@ -14,24 +14,24 @@
 #include <db.h>
 
 
-static u_int64_t
-size_from (u_int32_t gbytes, u_int32_t bytes) {
+static uint64_t
+size_from (uint32_t gbytes, uint32_t bytes) {
 #ifdef USE_BDB
     if (sizeof (intptr_t) == 4 && gbytes == 4 && bytes == 0)
         return 0xffffffff;
 #endif
-    return ((u_int64_t)gbytes << 30) + bytes;
+    return ((uint64_t)gbytes << 30) + bytes;
 }
 
 static inline void
-size_to (u_int64_t s, u_int32_t *gbytes, u_int32_t *bytes) {
+size_to (uint64_t s, uint32_t *gbytes, uint32_t *bytes) {
     *gbytes = s >> 30;
     *bytes = s & ((1<<30) - 1);
 }
 
 static inline void
-expect_le (u_int64_t a, u_int32_t gbytes, u_int32_t bytes) {
-    u_int64_t b = size_from(gbytes, bytes);
+expect_le (uint64_t a, uint32_t gbytes, uint32_t bytes) {
+    uint64_t b = size_from(gbytes, bytes);
     if (a != b && verbose)
         printf("WARNING: expect %" PRIu64 " got %" PRIu64 "\n", a, b);
 #ifdef USE_BDB
@@ -48,7 +48,7 @@ test_cachesize (void) {
 #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3
     int r;
     DB_ENV *env;
-    u_int32_t gbytes, bytes; int ncache;
+    uint32_t gbytes, bytes; int ncache;
 
     r = db_env_create(&env, 0); assert(r == 0);
     r = env->get_cachesize(env, &gbytes, &bytes, &ncache); assert(r == 0);
@@ -57,9 +57,9 @@ test_cachesize (void) {
     r = env->set_cachesize(env, 0, 0, 1); assert(r == 0);
     r = env->get_cachesize(env, &gbytes, &bytes, &ncache); assert(r == 0);
     if (verbose) printf("minimum %u %u %d\n", gbytes, bytes, ncache);
-    u_int64_t minsize = size_from(gbytes, bytes);
+    uint64_t minsize = size_from(gbytes, bytes);
 
-    u_int64_t s = 1; size_to(s, &gbytes, &bytes);
+    uint64_t s = 1; size_to(s, &gbytes, &bytes);
     while (gbytes <= 32) {
         r = env->set_cachesize(env, gbytes, bytes, ncache); 
         if (r != 0) {
diff --git a/src/tests/test_cmp_descriptor.cc b/src/tests/test_cmp_descriptor.cc
index a39001645f7c1176aed2e05fe4f2ac853847c7d1..ca9d2f43352e8846407d6e804839925ae8ffbb54 100644
--- a/src/tests/test_cmp_descriptor.cc
+++ b/src/tests/test_cmp_descriptor.cc
@@ -11,9 +11,9 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
 
 DB_ENV *env;
 
-BOOL cmp_desc_is_four;
-u_int32_t four_byte_desc = 0xffffffff;
-u_int64_t eight_byte_desc = 0x12345678ffffffff;
+bool cmp_desc_is_four;
+uint32_t four_byte_desc = 0xffffffff;
+uint64_t eight_byte_desc = 0x12345678ffffffff;
 
 
 static int generate_row_for_put(
@@ -49,11 +49,11 @@ static void assert_cmp_desc_valid (DB* db) {
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int64_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint64_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
 static int
@@ -95,8 +95,8 @@ static void do_inserts_and_queries(DB* db) {
     r = env->txn_begin(env, NULL, &write_txn, 0);
     CKERR(r);
     for (int i = 0; i < 2000; i++) {
-        u_int64_t key_data = random();
-        u_int64_t val_data = random();
+        uint64_t key_data = random();
+        uint64_t val_data = random();
         DBT key, val;
         dbt_init(&key, &key_data, sizeof(key_data));
         dbt_init(&val, &val_data, sizeof(val_data));
@@ -136,7 +136,7 @@ static void do_inserts_and_queries(DB* db) {
 static void run_test(void) {
     DB* db = NULL;
     int r;
-    cmp_desc_is_four = TRUE;
+    cmp_desc_is_four = true;
 
     DBT orig_desc;
     memset(&orig_desc, 0, sizeof(orig_desc));
@@ -150,8 +150,8 @@ static void run_test(void) {
 
     DB_LOADER *loader = NULL;    
     DBT key, val;
-    u_int64_t k = 0;
-    u_int64_t v = 0;
+    uint64_t k = 0;
+    uint64_t v = 0;
     IN_TXN_COMMIT(env, NULL, txn_create, 0, {
             { int chk_r = db_create(&db, env, 0); CKERR(chk_r); }
             assert(db->descriptor == NULL);
@@ -200,7 +200,7 @@ static void run_test(void) {
 
     // verify that after close and reopen, cmp_descriptor is now
     // latest descriptor
-    cmp_desc_is_four = FALSE;
+    cmp_desc_is_four = false;
     { int chk_r = db_create(&db, env, 0); CKERR(chk_r); }
     { int chk_r = db->open(db, NULL, "foo.db", NULL, DB_BTREE, DB_AUTO_COMMIT, 0666); CKERR(chk_r); }
     assert_desc_eight(db);
@@ -208,7 +208,7 @@ static void run_test(void) {
     do_inserts_and_queries(db);
     { int chk_r = db->close(db, 0); CKERR(chk_r); }
 
-    cmp_desc_is_four = TRUE;
+    cmp_desc_is_four = true;
     { int chk_r = db_create(&db, env, 0); CKERR(chk_r); }
     { int chk_r = db->open(db, NULL, "foo.db", NULL, DB_BTREE, DB_AUTO_COMMIT, 0666); CKERR(chk_r); }
     IN_TXN_COMMIT(env, NULL, txn_1, 0, {
diff --git a/src/tests/test_cursor_3.cc b/src/tests/test_cursor_3.cc
index c486dc2f361b9b27e044032d1d4f30e94ad3bc5c..da73b5632047b1af6458024fba83ff0e5b12e03f 100644
--- a/src/tests/test_cursor_3.cc
+++ b/src/tests/test_cursor_3.cc
@@ -34,7 +34,7 @@ enum { ncursors = 2 };
 DBC *cursor[ncursors];
 
 static void
-testit (u_int32_t cop)  {
+testit (uint32_t cop)  {
     void *kptrs[ncursors];
     void *vptrs[ncursors];
     int i;
diff --git a/src/tests/test_cursor_DB_NEXT_no_dup.cc b/src/tests/test_cursor_DB_NEXT_no_dup.cc
index c0aa6551da767180aed182db35dbd4c43282d182..0d50f950eb27a45ce787166ecff176a7f28da920 100644
--- a/src/tests/test_cursor_DB_NEXT_no_dup.cc
+++ b/src/tests/test_cursor_DB_NEXT_no_dup.cc
@@ -80,7 +80,7 @@ static void insert(char k, char d) {
         CKERR(r);
 }
 
-static void c_get(u_int32_t flag, char key_expect, char data_expect) {
+static void c_get(uint32_t flag, char key_expect, char data_expect) {
     DBT key;
     DBT data;
 
@@ -100,7 +100,7 @@ static void c_get(u_int32_t flag, char key_expect, char data_expect) {
     assert(got_data == data_expect);
 }
 
-static void test_skip_key(u_int32_t flag, BOOL is_next) {
+static void test_skip_key(uint32_t flag, bool is_next) {
     setup_env();
     setup_db();
     setup_cursor();
@@ -126,16 +126,16 @@ static void test_skip_key(u_int32_t flag, BOOL is_next) {
 static void run_test(void) {
     /* ********************************************************************** */
     /* Test DB_NEXT works properly. */
-    test_skip_key(DB_NEXT, TRUE);
+    test_skip_key(DB_NEXT, true);
     /* ********************************************************************** */
     /* Test DB_PREV works properly. */
-    test_skip_key(DB_PREV, FALSE);
+    test_skip_key(DB_PREV, false);
     /* ********************************************************************** */
     /* Test DB_PREV_NODUP works properly. */
-    test_skip_key(DB_PREV_NODUP, FALSE);
+    test_skip_key(DB_PREV_NODUP, false);
     /* ********************************************************************** */
     /* Test DB_NEXT_NODUP works properly. */
-    test_skip_key(DB_NEXT_NODUP, TRUE);
+    test_skip_key(DB_NEXT_NODUP, true);
     /* ********************************************************************** */
 }
 
diff --git a/src/tests/test_cursor_null.cc b/src/tests/test_cursor_null.cc
index 64342dcb0a0cbdac0ece13d6a76f1d0634146670..3f99ee6445d2b0ba87ec4bf26e80867ec5b3fe1b 100644
--- a/src/tests/test_cursor_null.cc
+++ b/src/tests/test_cursor_null.cc
@@ -39,7 +39,7 @@ put (int _key, int _data) {
 }
 
 static void
-cget (u_int32_t flag, BOOL find, char txn, int _key, int _data) {
+cget (uint32_t flag, bool find, char txn, int _key, int _data) {
     assert(cursors[(int)txn]);
 
     int r;
@@ -63,7 +63,7 @@ cget (u_int32_t flag, BOOL find, char txn, int _key, int _data) {
         dbt_init(&data, &_data, sizeof(int));
         _data--;
     }
-    else assert(FALSE);
+    else assert(false);
     r = cursors[(int)txn]->c_get(cursors[(int)txn], &key, &data, flag);
     if (find) {
         CKERR(r);
@@ -119,8 +119,8 @@ setup_dbs (void) {
     /* Open/create primary */
     r = db_env_create(&dbenv, 0);
         CKERR(r);
-    u_int32_t env_txn_flags  = 0;
-    u_int32_t env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL;
+    uint32_t env_txn_flags  = 0;
+    uint32_t env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL;
 	r = dbenv->open(dbenv, ENVDIR, env_open_flags | env_txn_flags, 0600);
         CKERR(r);
     
@@ -162,8 +162,8 @@ test (void) {
         else         data = 1;
         setup_dbs();
         put(key, data);
-        cget(DB_SET,     TRUE, 'a', key, data);
-        cget(DB_CURRENT, TRUE, 'a', key, data);
+        cget(DB_SET,     true, 'a', key, data);
+        cget(DB_CURRENT, true, 'a', key, data);
         close_dbs();
     }
     /* ********************************************************************** */
diff --git a/src/tests/test_db_change_xxx.cc b/src/tests/test_db_change_xxx.cc
index a39385b789bdd043dc5f64a4f6766941299a720a..9b7046567ee0e782bd79088aa29942824d7d8a8a 100644
--- a/src/tests/test_db_change_xxx.cc
+++ b/src/tests/test_db_change_xxx.cc
@@ -23,7 +23,7 @@ test_main (int UU(argc), char UU(*const argv[])) {
     r=db_env_create(&env, 0); assert(r==0);
     r=env->open(env, ENVDIR, DB_PRIVATE|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
 
-    u_int32_t ret_val = 0;
+    uint32_t ret_val = 0;
     r = db_create(&db, env, 0);
     CKERR(r);
     r = db->set_pagesize(db, 112024);
diff --git a/src/tests/test_db_dbt_mem_behavior.cc b/src/tests/test_db_dbt_mem_behavior.cc
index 9a860b5ef9de358c6e8450a3e867179a27ac2e5b..01151cf5841b197d3dbea89449ca18d48aa3bd46 100644
--- a/src/tests/test_db_dbt_mem_behavior.cc
+++ b/src/tests/test_db_dbt_mem_behavior.cc
@@ -21,7 +21,7 @@ typedef struct {
 DB* db;
 DB_TXN *const null_txn = 0;
 DB_ENV *dbenv;
-u_int32_t set_ulen;
+uint32_t set_ulen;
 int32_t key_1 = 1;
 
 static void
@@ -68,7 +68,7 @@ test_main(int argc, char *const argv[]) {
     
     parse_args(argc, argv);
 //Simple flags that require minimal setup.
-    u_int32_t flags[] = {
+    uint32_t flags[] = {
         0,
         DB_DBT_USERMEM,
         DB_DBT_MALLOC,
@@ -138,16 +138,16 @@ test_main(int argc, char *const argv[]) {
                 
             assert(!was_truncated);
 
-            BOOL ulen_should_change = FALSE;
+            bool ulen_should_change = false;
 #if defined(USE_TDB)
             if (flags[j] == DB_DBT_REALLOC) {
-                ulen_should_change = (BOOL)(old_ulen < sizeof(DATA));
+                ulen_should_change = (bool)(old_ulen < sizeof(DATA));
             }
             else if (flags[j] == DB_DBT_MALLOC) {
-                ulen_should_change = (BOOL)(old_ulen != sizeof(DATA)*2);
+                ulen_should_change = (bool)(old_ulen != sizeof(DATA)*2);
             }
 #endif
-            assert(ulen_should_change == (BOOL)ulen_changed);
+            assert(ulen_should_change == (bool)ulen_changed);
             assert(size_full);
             assert(doclone == !small_buffer);
         }
diff --git a/src/tests/test_db_descriptor.cc b/src/tests/test_db_descriptor.cc
index cb73b5e3c9bd9a099f415faa6d436048060e399c..a8cc20784fb3d1dcb92be87f95ed2445c9a537f5 100644
--- a/src/tests/test_db_descriptor.cc
+++ b/src/tests/test_db_descriptor.cc
@@ -21,8 +21,8 @@ const char *name = NULL;
 #define MAX_LENGTH  (1<<16)
 
 int order[NUM+1];
-u_int32_t length[NUM];
-u_int8_t data[NUM][MAX_LENGTH];
+uint32_t length[NUM];
+uint8_t data[NUM][MAX_LENGTH];
 DBT descriptors[NUM];
 DB_ENV *env;
 
@@ -34,7 +34,7 @@ int last_open_descriptor = -1;
 
 int abort_type;
 int get_table_lock;
-u_int64_t num_called = 0;
+uint64_t num_called = 0;
 
 
 static void
@@ -162,9 +162,9 @@ setup_data(void) {
     int i;
     for (i=0; i < NUM; i++) {
         length[i] = i * MAX_LENGTH / (NUM-1);
-        u_int32_t j;
+        uint32_t j;
         for (j = 0; j < length[i]; j++) {
-            data[i][j] = (u_int8_t)(random() & 0xFF);
+            data[i][j] = (uint8_t)(random() & 0xFF);
         }
         memset(&descriptors[i], 0, sizeof(descriptors[i]));
         descriptors[i].size = length[i];
@@ -205,7 +205,7 @@ test_insert (int n, int which) {
     for (i=0; i<n; i++) {
         int k = last++;
         DBT key, val;
-        u_int64_t called = num_called;
+        uint64_t called = num_called;
         int r = db->put(db, txn, dbt_init(&key, &k, sizeof k), dbt_init(&val, &i, sizeof i), 0);
         if (i>0) assert(num_called > called);
         CKERR(r);
diff --git a/src/tests/test_db_get_put_flags.cc b/src/tests/test_db_get_put_flags.cc
index 9ba58bd62ffb5fd9dd8dca0de719efdf146c948c..271d098e5a7e6224d30623f8f0ae723aea0e5e20 100644
--- a/src/tests/test_db_get_put_flags.cc
+++ b/src/tests/test_db_get_put_flags.cc
@@ -14,8 +14,8 @@
 // ENVDIR is defined in the Makefile
 
 typedef struct {
-    u_int32_t db_flags;
-    u_int32_t flags;
+    uint32_t db_flags;
+    uint32_t flags;
     int       r_expect;
     int       key;
     int       data;
@@ -23,7 +23,7 @@ typedef struct {
 
 typedef struct {
     PUT_TEST  put;
-    u_int32_t flags;
+    uint32_t flags;
     int       r_expect;
     int       key;
     int       data;
@@ -33,7 +33,7 @@ enum testtype {NONE=0, TGET=1, TPUT=2, SGET=3, SPUT=4, SPGET=5};
 
 typedef struct {
     enum testtype kind;
-    u_int32_t     flags;
+    uint32_t     flags;
     int           r_expect;
     int           key;
     int           data;
@@ -44,7 +44,7 @@ static DB_TXN *const null_txn = 0;
 static DB_ENV *dbenv;
 
 static void
-setup (u_int32_t flags) {
+setup (uint32_t flags) {
     int r;
 
     r = system("rm -rf " ENVDIR);
@@ -72,7 +72,7 @@ close_dbs (void) {
 }
 
 static void
-insert_bad_flags (DB* db, u_int32_t flags, int r_expect, int keyint, int dataint) {
+insert_bad_flags (DB* db, uint32_t flags, int r_expect, int keyint, int dataint) {
     DBT key;
     DBT data;
     int r;
@@ -84,7 +84,7 @@ insert_bad_flags (DB* db, u_int32_t flags, int r_expect, int keyint, int dataint
 }
 
 static void
-get_bad_flags (DB* db, u_int32_t flags, int r_expect, int keyint, int dataint) {
+get_bad_flags (DB* db, uint32_t flags, int r_expect, int keyint, int dataint) {
     DBT key;
     DBT data;
     int r;
diff --git a/src/tests/test_db_subdb_different_flags.cc b/src/tests/test_db_subdb_different_flags.cc
index 53508556e3d7a35247dbd0aac0ce9ed3c4a0acb3..37067e9da185cccd55f24207b6c0105708fbcbc7 100644
--- a/src/tests/test_db_subdb_different_flags.cc
+++ b/src/tests/test_db_subdb_different_flags.cc
@@ -44,7 +44,7 @@ test_main(int argc, char *const argv[]) {
     r = db->open(db, null_txn, fname, "subdb2", DB_BTREE, DB_CREATE, 0666);  CKERR(r);
     r = db->close(db, 0);                                                    CKERR(r);
 
-    u_int32_t flags;
+    uint32_t flags;
 
     r = db_create(&db, env, 0);                                              CKERR(r);
     r = db->open(db, null_txn, fname, "main", DB_BTREE, 0, 0666);            CKERR(r);
diff --git a/src/tests/test_db_txn_locks_nonheaviside.cc b/src/tests/test_db_txn_locks_nonheaviside.cc
index 7482efde0fb40bb90aed68ea496f2c9f7a53d142..8dd7256656c2955b03a922cfa1a817e650583a7f 100644
--- a/src/tests/test_db_txn_locks_nonheaviside.cc
+++ b/src/tests/test_db_txn_locks_nonheaviside.cc
@@ -21,7 +21,7 @@ static DB_ENV* dbenv;
 static DBC*    cursors[(int)256];
 
 static void
-put(BOOL success, char txn, int _key, int _data) {
+put(bool success, char txn, int _key, int _data) {
     assert(txns[(int)txn]);
 
     int r;
@@ -38,8 +38,8 @@ put(BOOL success, char txn, int _key, int _data) {
 }
 
 static void
-cget(BOOL success, BOOL find, char txn, int _key, int _data, 
-     int _key_expect, int _data_expect, u_int32_t flags) {
+cget(bool success, bool find, char txn, int _key, int _data, 
+     int _key_expect, int _data_expect, uint32_t flags) {
     assert(txns[(int)txn] && cursors[(int)txn]);
 
     int r;
@@ -62,7 +62,7 @@ cget(BOOL success, BOOL find, char txn, int _key, int _data,
 }
 
 static void
-dbdel (BOOL success, BOOL find, char txn, int _key) {
+dbdel (bool success, bool find, char txn, int _key) {
     int r;
     DBT key;
 
@@ -156,8 +156,8 @@ setup_dbs (void) {
     r = dbenv->set_default_bt_compare(dbenv, int_dbt_cmp);
         CKERR(r);
 #endif
-    u_int32_t env_txn_flags  = DB_INIT_TXN | DB_INIT_LOCK;
-    u_int32_t env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL;
+    uint32_t env_txn_flags  = DB_INIT_TXN | DB_INIT_LOCK;
+    uint32_t env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL;
 	r = dbenv->open(dbenv, ENVDIR, env_open_flags | env_txn_flags, 0600);
         CKERR(r);
     
@@ -200,64 +200,64 @@ void
 test_abort (void) {
     /* ********************************************************************** */
     setup_dbs();
-    put(TRUE, 'a', 1, 1);
+    put(true, 'a', 1, 1);
     early_abort('a');
-    cget(TRUE, FALSE, 'b', 1, 1, 0, 0, DB_SET);
+    cget(true, false, 'b', 1, 1, 0, 0, DB_SET);
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', 1, 1, 0, 0, DB_SET);
-    cget(TRUE, FALSE, 'b', 1, 1, 0, 0, DB_SET);
-    put(FALSE, 'a', 1, 1);
+    cget(true, false, 'a', 1, 1, 0, 0, DB_SET);
+    cget(true, false, 'b', 1, 1, 0, 0, DB_SET);
+    put(false, 'a', 1, 1);
     early_commit('b');
-    put(TRUE, 'a', 1, 1);
-    cget(TRUE, TRUE, 'a', 1, 1, 1, 1, DB_SET);
-    cget(TRUE, FALSE, 'a', 2, 1, 1, 1, DB_SET);
-    cget(FALSE, TRUE, 'c', 1, 1, 0, 0, DB_SET);
+    put(true, 'a', 1, 1);
+    cget(true, true, 'a', 1, 1, 1, 1, DB_SET);
+    cget(true, false, 'a', 2, 1, 1, 1, DB_SET);
+    cget(false, true, 'c', 1, 1, 0, 0, DB_SET);
     early_abort('a');
-    cget(TRUE, FALSE, 'c', 1, 1, 0, 0, DB_SET);
+    cget(true, false, 'c', 1, 1, 0, 0, DB_SET);
     close_dbs();
     /* ********************************************************************** */
 }
 
 static void
-test_both (u_int32_t db_flags) {
+test_both (uint32_t db_flags) {
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', 1, 1, 0, 0, db_flags);
+    cget(true, false, 'a', 1, 1, 0, 0, db_flags);
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', 1, 1, 0, 0, db_flags);
-    cget(TRUE, FALSE, 'a', 2, 1, 0, 0, db_flags);
+    cget(true, false, 'a', 1, 1, 0, 0, db_flags);
+    cget(true, false, 'a', 2, 1, 0, 0, db_flags);
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', 1, 1, 0, 0, db_flags);
-    cget(TRUE, FALSE, 'a', 1, 1, 0, 0, db_flags);
+    cget(true, false, 'a', 1, 1, 0, 0, db_flags);
+    cget(true, false, 'a', 1, 1, 0, 0, db_flags);
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', 1, 1, 0, 0, db_flags);
-    cget(TRUE, FALSE, 'b', 2, 1, 0, 0, db_flags);
+    cget(true, false, 'a', 1, 1, 0, 0, db_flags);
+    cget(true, false, 'b', 2, 1, 0, 0, db_flags);
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', 1, 1, 0, 0, db_flags);
-    cget(TRUE, FALSE, 'b', 1, 1, 0, 0, db_flags);
+    cget(true, false, 'a', 1, 1, 0, 0, db_flags);
+    cget(true, false, 'b', 1, 1, 0, 0, db_flags);
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', 1, 1, 0, 0, db_flags);
-    cget(TRUE, FALSE, 'b', 1, 1, 0, 0, db_flags);
-    put(FALSE, 'a', 1, 1);
+    cget(true, false, 'a', 1, 1, 0, 0, db_flags);
+    cget(true, false, 'b', 1, 1, 0, 0, db_flags);
+    put(false, 'a', 1, 1);
     early_commit('b');
-    put(TRUE, 'a', 1, 1);
-    cget(TRUE, TRUE, 'a', 1, 1, 1, 1, db_flags);
-    cget(TRUE, FALSE, 'a', 2, 1, 0, 0, db_flags);
-    cget(FALSE, TRUE, 'c', 1, 1, 0, 0, db_flags);
+    put(true, 'a', 1, 1);
+    cget(true, true, 'a', 1, 1, 1, 1, db_flags);
+    cget(true, false, 'a', 2, 1, 0, 0, db_flags);
+    cget(false, true, 'c', 1, 1, 0, 0, db_flags);
     early_commit('a');
-    cget(TRUE, TRUE, 'c', 1, 1, 1, 1, db_flags);
+    cget(true, true, 'c', 1, 1, 1, 1, db_flags);
     close_dbs();
 }
 
@@ -266,37 +266,37 @@ static void
 test_last (void) {
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', 0, 0, 0, 0, DB_LAST);
-    put(FALSE, 'b', 2, 1);
-    put(TRUE, 'a', 2, 1);
-    cget(TRUE, TRUE, 'a', 0, 0, 2, 1, DB_LAST);
+    cget(true, false, 'a', 0, 0, 0, 0, DB_LAST);
+    put(false, 'b', 2, 1);
+    put(true, 'a', 2, 1);
+    cget(true, true, 'a', 0, 0, 2, 1, DB_LAST);
     early_commit('a');
-    put(TRUE, 'b', 2, 1);
+    put(true, 'b', 2, 1);
     close_dbs();
     /* ****************************************** */
     setup_dbs();
-    put(TRUE, 'a', 1, 1);
-    cget(TRUE, TRUE, 'a', 0, 0, 1, 1, DB_LAST);
-    put(FALSE, 'b', 2, 1);
-    put(TRUE, 'b', -1, 1);
-    cget(TRUE, TRUE, 'a', 0, 0, 1, 1, DB_LAST);
+    put(true, 'a', 1, 1);
+    cget(true, true, 'a', 0, 0, 1, 1, DB_LAST);
+    put(false, 'b', 2, 1);
+    put(true, 'b', -1, 1);
+    cget(true, true, 'a', 0, 0, 1, 1, DB_LAST);
     close_dbs();
     /* ****************************************** */
     setup_dbs();
-    put(TRUE, 'a', 1, 1);
-    put(TRUE, 'a', 3, 1);
-    put(TRUE, 'a', 6, 1);
-    cget(TRUE, TRUE, 'a', 0, 0, 6, 1, DB_LAST);
-    put(TRUE, 'b', 2, 1);
-    put(TRUE, 'b', 4, 1);
-    put(FALSE, 'b', 7, 1);
-    put(TRUE, 'b', -1, 1);
+    put(true, 'a', 1, 1);
+    put(true, 'a', 3, 1);
+    put(true, 'a', 6, 1);
+    cget(true, true, 'a', 0, 0, 6, 1, DB_LAST);
+    put(true, 'b', 2, 1);
+    put(true, 'b', 4, 1);
+    put(false, 'b', 7, 1);
+    put(true, 'b', -1, 1);
     close_dbs();
     /* ****************************************** */
     setup_dbs();
-    put(TRUE, 'a', 1, 1);
-    cget(TRUE, TRUE, 'a', 0, 0, 1, 1, DB_LAST);
-    put(FALSE, 'b', 1, 0);
+    put(true, 'a', 1, 1);
+    cget(true, true, 'a', 0, 0, 1, 1, DB_LAST);
+    put(false, 'b', 1, 0);
     close_dbs();
 }
 
@@ -304,146 +304,146 @@ static void
 test_first (void) {
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', 0, 0, 0, 0, DB_FIRST);
-    put(FALSE, 'b', 2, 1);
-    put(TRUE, 'a', 2, 1);
-    cget(TRUE, TRUE, 'a', 0, 0, 2, 1, DB_FIRST);
+    cget(true, false, 'a', 0, 0, 0, 0, DB_FIRST);
+    put(false, 'b', 2, 1);
+    put(true, 'a', 2, 1);
+    cget(true, true, 'a', 0, 0, 2, 1, DB_FIRST);
     early_commit('a');
-    put(TRUE, 'b', 2, 1);
+    put(true, 'b', 2, 1);
     close_dbs();
     /* ****************************************** */
     setup_dbs();
-    put(TRUE, 'a', 1, 1);
-    cget(TRUE, TRUE, 'a', 0, 0, 1, 1, DB_FIRST);
-    put(TRUE, 'b', 2, 1);
-    put(FALSE, 'b', -1, 1);
-    cget(TRUE, TRUE, 'a', 0, 0, 1, 1, DB_FIRST);
+    put(true, 'a', 1, 1);
+    cget(true, true, 'a', 0, 0, 1, 1, DB_FIRST);
+    put(true, 'b', 2, 1);
+    put(false, 'b', -1, 1);
+    cget(true, true, 'a', 0, 0, 1, 1, DB_FIRST);
     close_dbs();
     /* ****************************************** */
     setup_dbs();
-    put(TRUE, 'a', 1, 1);
-    put(TRUE, 'a', 3, 1);
-    put(TRUE, 'a', 6, 1);
-    cget(TRUE, TRUE, 'a', 0, 0, 1, 1, DB_FIRST);
-    put(TRUE, 'b', 2, 1);
-    put(TRUE, 'b', 4, 1);
-    put(TRUE, 'b', 7, 1);
-    put(FALSE, 'b', -1, 1);
+    put(true, 'a', 1, 1);
+    put(true, 'a', 3, 1);
+    put(true, 'a', 6, 1);
+    cget(true, true, 'a', 0, 0, 1, 1, DB_FIRST);
+    put(true, 'b', 2, 1);
+    put(true, 'b', 4, 1);
+    put(true, 'b', 7, 1);
+    put(false, 'b', -1, 1);
     close_dbs();
     /* ****************************************** */
     setup_dbs();
-    put(TRUE, 'a', 1, 1);
-    cget(TRUE, TRUE, 'a', 0, 0, 1, 1, DB_FIRST);
-    put(FALSE, 'b', 1, 2);
+    put(true, 'a', 1, 1);
+    cget(true, true, 'a', 0, 0, 1, 1, DB_FIRST);
+    put(false, 'b', 1, 2);
     close_dbs();
 }
 
 static void
-test_set_range (u_int32_t flag, int i) {
+test_set_range (uint32_t flag, int i) {
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', i*1, i*1, 0, 0, flag);
+    cget(true, false, 'a', i*1, i*1, 0, 0, flag);
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', i*1, i*1, 0, 0, flag);
-    cget(TRUE, FALSE, 'a', i*2, i*1, 0, 0, flag);
+    cget(true, false, 'a', i*1, i*1, 0, 0, flag);
+    cget(true, false, 'a', i*2, i*1, 0, 0, flag);
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', i*1, i*1, 0, 0, flag);
-    cget(TRUE, FALSE, 'a', i*1, i*1, 0, 0, flag);
+    cget(true, false, 'a', i*1, i*1, 0, 0, flag);
+    cget(true, false, 'a', i*1, i*1, 0, 0, flag);
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', i*1, i*1, 0, 0, flag);
-    cget(TRUE, FALSE, 'b', i*2, i*1, 0, 0, flag);
+    cget(true, false, 'a', i*1, i*1, 0, 0, flag);
+    cget(true, false, 'b', i*2, i*1, 0, 0, flag);
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', i*1, i*1, 0, 0, flag);
-    cget(TRUE, FALSE, 'b', i*1, i*1, 0, 0, flag);
+    cget(true, false, 'a', i*1, i*1, 0, 0, flag);
+    cget(true, false, 'b', i*1, i*1, 0, 0, flag);
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    cget(TRUE, FALSE, 'a', i*1, i*1, 0, 0, flag);
-    cget(TRUE, FALSE, 'b', i*5, i*5, 0, 0, flag);
-    put(FALSE, 'a', i*7, i*6);
-    put(FALSE, 'a', i*5, i*5);
-    put(TRUE,  'a', i*4, i*4);
-    put(TRUE,  'b', -i*1, i*4);
-    put(FALSE,  'b', i*2, i*4);
-    put(FALSE, 'a', i*5, i*4);
+    cget(true, false, 'a', i*1, i*1, 0, 0, flag);
+    cget(true, false, 'b', i*5, i*5, 0, 0, flag);
+    put(false, 'a', i*7, i*6);
+    put(false, 'a', i*5, i*5);
+    put(true,  'a', i*4, i*4);
+    put(true,  'b', -i*1, i*4);
+    put(false,  'b', i*2, i*4);
+    put(false, 'a', i*5, i*4);
     early_commit('b');
-    put(TRUE, 'a', i*7, i*6);
-    put(TRUE, 'a', i*5, i*5);
-    put(TRUE,  'a', i*4, i*4);
-    put(TRUE, 'a', i*5, i*4);
-    cget(TRUE, TRUE, 'a', i*1, i*1, i*4, i*4, flag);
-    cget(TRUE, TRUE, 'a', i*2, i*1, i*4, i*4, flag);
-    cget(FALSE, TRUE, 'c', i*6, i*6, i*7, i*6, flag);
+    put(true, 'a', i*7, i*6);
+    put(true, 'a', i*5, i*5);
+    put(true,  'a', i*4, i*4);
+    put(true, 'a', i*5, i*4);
+    cget(true, true, 'a', i*1, i*1, i*4, i*4, flag);
+    cget(true, true, 'a', i*2, i*1, i*4, i*4, flag);
+    cget(false, true, 'c', i*6, i*6, i*7, i*6, flag);
     early_commit('a');
-    cget(TRUE, TRUE, 'c', i*6, i*6, i*7, i*6, flag);
+    cget(true, true, 'c', i*6, i*6, i*7, i*6, flag);
     close_dbs();
 }
 
 static void
-test_next (u_int32_t next_type) {
+test_next (uint32_t next_type) {
     /* ********************************************************************** */
     setup_dbs();
-    put(TRUE,  'a', 2, 1);
-    put(TRUE,  'a', 5, 1);
-    cget(TRUE, TRUE, 'a', 0, 0, 2, 1, next_type);
-    put(FALSE, 'b', 2, 1);
-    put(TRUE,  'b', 4, 1);
-    put(FALSE, 'b', -1, 1);
-    cget(FALSE, TRUE, 'a', 0, 0, 4, 1, next_type);
+    put(true,  'a', 2, 1);
+    put(true,  'a', 5, 1);
+    cget(true, true, 'a', 0, 0, 2, 1, next_type);
+    put(false, 'b', 2, 1);
+    put(true,  'b', 4, 1);
+    put(false, 'b', -1, 1);
+    cget(false, true, 'a', 0, 0, 4, 1, next_type);
     early_commit('b');
-    cget(TRUE,  TRUE, 'a', 2, 1, 2, 1, DB_SET);
-    cget(TRUE,  TRUE, 'a', 0, 0, 4, 1, next_type);
-    cget(TRUE,  TRUE, 'a', 0, 0, 5, 1, next_type);
+    cget(true,  true, 'a', 2, 1, 2, 1, DB_SET);
+    cget(true,  true, 'a', 0, 0, 4, 1, next_type);
+    cget(true,  true, 'a', 0, 0, 5, 1, next_type);
     close_dbs();
     /* ****************************************** */
     setup_dbs();
-    put(TRUE, 'a', 1, 1);
-    put(TRUE, 'a', 3, 1);
-    put(TRUE, 'a', 6, 1);
-    cget(TRUE, TRUE, 'a', 0, 0, 1, 1, next_type);
-    cget(TRUE, TRUE, 'a', 0, 0, 3, 1, next_type);
-    put(FALSE, 'b', 2, 1);
-    put(TRUE,  'b', 4, 1);
-    put(TRUE,  'b', 7, 1);
-    put(FALSE, 'b', -1, 1);
+    put(true, 'a', 1, 1);
+    put(true, 'a', 3, 1);
+    put(true, 'a', 6, 1);
+    cget(true, true, 'a', 0, 0, 1, 1, next_type);
+    cget(true, true, 'a', 0, 0, 3, 1, next_type);
+    put(false, 'b', 2, 1);
+    put(true,  'b', 4, 1);
+    put(true,  'b', 7, 1);
+    put(false, 'b', -1, 1);
     close_dbs();
 }
 
 static void
-test_prev (u_int32_t next_type) {
+test_prev (uint32_t next_type) {
     /* ********************************************************************** */
     setup_dbs();
-    put(TRUE,  'a', -2, -1);
-    put(TRUE,  'a', -5, -1);
-    cget(TRUE, TRUE, 'a', 0, 0, -2, -1, next_type);
-    put(FALSE, 'b', -2, -1);
-    put(TRUE,  'b', -4, -1);
-    put(FALSE, 'b', 1, -1);
-    cget(FALSE, TRUE, 'a', 0, 0, -4, -1, next_type);
+    put(true,  'a', -2, -1);
+    put(true,  'a', -5, -1);
+    cget(true, true, 'a', 0, 0, -2, -1, next_type);
+    put(false, 'b', -2, -1);
+    put(true,  'b', -4, -1);
+    put(false, 'b', 1, -1);
+    cget(false, true, 'a', 0, 0, -4, -1, next_type);
     early_commit('b');
-    cget(TRUE,  TRUE, 'a', -2, -1, -2, -1, DB_SET);
-    cget(TRUE,  TRUE, 'a', 0, 0, -4, -1, next_type);
-    cget(TRUE,  TRUE, 'a', 0, 0, -5, -1, next_type);
+    cget(true,  true, 'a', -2, -1, -2, -1, DB_SET);
+    cget(true,  true, 'a', 0, 0, -4, -1, next_type);
+    cget(true,  true, 'a', 0, 0, -5, -1, next_type);
     close_dbs();
     /* ****************************************** */
     setup_dbs();
-    put(TRUE, 'a', -1, -1);
-    put(TRUE, 'a', -3, -1);
-    put(TRUE, 'a', -6, -1);
-    cget(TRUE, TRUE, 'a', 0, 0, -1, -1, next_type);
-    cget(TRUE, TRUE, 'a', 0, 0, -3, -1, next_type);
-    put(FALSE, 'b', -2, -1);
-    put(TRUE,  'b', -4, -1);
-    put(TRUE,  'b', -7, -1);
-    put(FALSE, 'b', 1, -1);
+    put(true, 'a', -1, -1);
+    put(true, 'a', -3, -1);
+    put(true, 'a', -6, -1);
+    cget(true, true, 'a', 0, 0, -1, -1, next_type);
+    cget(true, true, 'a', 0, 0, -3, -1, next_type);
+    put(false, 'b', -2, -1);
+    put(true,  'b', -4, -1);
+    put(true,  'b', -7, -1);
+    put(false, 'b', 1, -1);
     close_dbs();
 }
 
@@ -453,32 +453,32 @@ test_dbdel (void) {
        has to be fixed in test_dbdel*/
     /* ********************************************************************** */
     setup_dbs();
-    put(TRUE, 'c', 1, 1);
+    put(true, 'c', 1, 1);
     early_commit('c');
-    dbdel(TRUE, TRUE, 'a', 1);
-    cget(FALSE, TRUE, 'b', 1, 1, 1, 1, DB_SET);
-    cget(FALSE, TRUE, 'b', 1, 4, 1, 4, DB_SET);
-    cget(FALSE, TRUE, 'b', 1, 0, 1, 4, DB_SET);
-    cget(TRUE, FALSE, 'b', 0, 0, 0, 0, DB_SET);
-    cget(TRUE, FALSE, 'b', 2, 10, 2, 10, DB_SET);
+    dbdel(true, true, 'a', 1);
+    cget(false, true, 'b', 1, 1, 1, 1, DB_SET);
+    cget(false, true, 'b', 1, 4, 1, 4, DB_SET);
+    cget(false, true, 'b', 1, 0, 1, 4, DB_SET);
+    cget(true, false, 'b', 0, 0, 0, 0, DB_SET);
+    cget(true, false, 'b', 2, 10, 2, 10, DB_SET);
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    dbdel(TRUE, TRUE, 'a', 1);
-    cget(FALSE, TRUE, 'b', 1, 1, 1, 1, DB_SET);
-    cget(FALSE, TRUE, 'b', 1, 4, 1, 4, DB_SET);
-    cget(FALSE, TRUE, 'b', 1, 0, 1, 4, DB_SET);
-    cget(TRUE, FALSE, 'b', 0, 0, 0, 0, DB_SET);
-    cget(TRUE, FALSE, 'b', 2, 10, 2, 10, DB_SET);
+    dbdel(true, true, 'a', 1);
+    cget(false, true, 'b', 1, 1, 1, 1, DB_SET);
+    cget(false, true, 'b', 1, 4, 1, 4, DB_SET);
+    cget(false, true, 'b', 1, 0, 1, 4, DB_SET);
+    cget(true, false, 'b', 0, 0, 0, 0, DB_SET);
+    cget(true, false, 'b', 2, 10, 2, 10, DB_SET);
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    put(TRUE, 'c', 1, 1);
+    put(true, 'c', 1, 1);
     early_commit('c');
-    cget(TRUE,  TRUE, 'b', 1, 1, 1, 1, DB_SET);
-    dbdel(FALSE, TRUE, 'a', 1);
-    dbdel(TRUE, TRUE, 'a', 2);
-    dbdel(TRUE, TRUE, 'a', 0);
+    cget(true,  true, 'b', 1, 1, 1, 1, DB_SET);
+    dbdel(false, true, 'a', 1);
+    dbdel(true, true, 'a', 2);
+    dbdel(true, true, 'a', 0);
     close_dbs();
 }
 
@@ -486,10 +486,10 @@ static void
 test_current (void) {
     /* ********************************************************************** */
     setup_dbs();
-    put(TRUE, 'a', 1, 1);
+    put(true, 'a', 1, 1);
     early_commit('a');
-    cget(TRUE,  TRUE, 'b', 1, 1, 1, 1, DB_SET);
-    cget(TRUE,  TRUE, 'b', 1, 1, 1, 1, DB_CURRENT);
+    cget(true,  true, 'b', 1, 1, 1, 1, DB_SET);
+    cget(true,  true, 'b', 1, 1, 1, 1, DB_CURRENT);
     close_dbs();
 }
 
@@ -526,7 +526,7 @@ test (void) {
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    put(TRUE, 'a', 1, 1);
+    put(true, 'a', 1, 1);
     close_dbs();
     /* ********************************************************************** */
     test_both( DB_SET);
diff --git a/src/tests/test_db_txn_locks_read_uncommitted.cc b/src/tests/test_db_txn_locks_read_uncommitted.cc
index fb268d3e9278ce3d23454cf05c22a7ce5325b7ef..018c1976e36e61151db9af985f72a99c45528a67 100644
--- a/src/tests/test_db_txn_locks_read_uncommitted.cc
+++ b/src/tests/test_db_txn_locks_read_uncommitted.cc
@@ -19,7 +19,7 @@ static DB_ENV* dbenv;
 static DBC*    cursors[(int)256];
 
 static void
-put(BOOL success, char txn, int _key, int _data) {
+put(bool success, char txn, int _key, int _data) {
     assert(txns[(int)txn]);
 
     int r;
@@ -36,7 +36,7 @@ put(BOOL success, char txn, int _key, int _data) {
 }
 
 static void
-init_txn (char name, u_int32_t flags) {
+init_txn (char name, uint32_t flags) {
     int r;
     assert(!txns[(int)name]);
     r = dbenv->txn_begin(dbenv, NULL, &txns[(int)name], DB_TXN_NOWAIT | flags);
@@ -98,8 +98,8 @@ setup_dbs (void) {
     r = dbenv->set_default_bt_compare(dbenv, int_dbt_cmp);
         CKERR(r);
 #endif
-    u_int32_t env_txn_flags  = DB_INIT_TXN | DB_INIT_LOCK;
-    u_int32_t env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL;
+    uint32_t env_txn_flags  = DB_INIT_TXN | DB_INIT_LOCK;
+    uint32_t env_open_flags = DB_CREATE | DB_PRIVATE | DB_INIT_MPOOL;
 	r = dbenv->open(dbenv, ENVDIR, env_open_flags | env_txn_flags, 0600);
         CKERR(r);
     
@@ -144,7 +144,7 @@ close_dbs(void) {
 
 
 static void
-table_scan(char txn, BOOL success) {
+table_scan(char txn, bool success) {
     int r;
     DBT key;
     DBT data;
@@ -165,7 +165,7 @@ table_scan(char txn, BOOL success) {
 }
 
 static void
-table_prelock(char txn, BOOL success) {
+table_prelock(char txn, bool success) {
     int r;
 #if defined USE_TDB && USE_TDB
     r = db->pre_acquire_table_lock(db,  txns[(int)txn]);
@@ -199,21 +199,21 @@ test (void) {
     close_dbs();
     /* ********************************************************************** */
     setup_dbs();
-    table_scan('0', TRUE);
-    table_prelock('a', TRUE);
-    put(TRUE, 'a', 0, 0);
+    table_scan('0', true);
+    table_prelock('a', true);
+    put(true, 'a', 0, 0);
     for (txn = 'b'; txn<'z'; txn++) {
-        table_scan(txn, FALSE);
+        table_scan(txn, false);
     }
     for (txn = '0'; txn<'9'; txn++) {
-        table_scan(txn, TRUE);
+        table_scan(txn, true);
     }
     early_commit('a');
     for (txn = 'b'; txn<'z'; txn++) {
-        table_scan(txn, TRUE);
+        table_scan(txn, true);
     }
     for (txn = '0'; txn<'9'; txn++) {
-        table_scan(txn, TRUE);
+        table_scan(txn, true);
     }
     close_dbs();
     /* ********************************************************************** */
diff --git a/src/tests/test_dup_flags.cc b/src/tests/test_dup_flags.cc
index a30936cdb5303df9d840b9b83c9b3a5d997a4d86..5bd9ee18cd2f676ab1d623ae91421ed310c19920 100644
--- a/src/tests/test_dup_flags.cc
+++ b/src/tests/test_dup_flags.cc
@@ -15,7 +15,7 @@
 
 /* verify that the dup flags are written and read from the database file correctly */ 
 static void
-test_dup_flags (u_int32_t dup_flags) {
+test_dup_flags (uint32_t dup_flags) {
     if (verbose) printf("test_dup_flags:%u\n", dup_flags);
 
     DB_TXN * const null_txn = 0;
@@ -35,7 +35,7 @@ test_dup_flags (u_int32_t dup_flags) {
     if (IS_TDB) assert(dup_flags==0);
     r = db->set_flags(db, dup_flags);
     assert(r == 0);
-    u_int32_t flags; r = db->get_flags(db, &flags); assert(r == 0); assert(flags == dup_flags);
+    uint32_t flags; r = db->get_flags(db, &flags); assert(r == 0); assert(flags == dup_flags);
     if (IS_TDB) assert(dup_flags==0);
     r = db->open(db, null_txn, fname, "main", DB_BTREE, DB_CREATE, 0666); 
     assert(r == 0);
diff --git a/src/tests/test_error.cc b/src/tests/test_error.cc
index 9302a42fe31abbe0fb14dccadb8fad550acf67e4..7865142b14a29ff9dc43571e9e387426ff4a1cd1 100644
--- a/src/tests/test_error.cc
+++ b/src/tests/test_error.cc
@@ -34,7 +34,7 @@ test_main (int argc, char *const argv[]) {
 	DB_ENV *env;
 	r = db_env_create(&env, 0); assert(r==0);
 	env->set_errfile(env,0); // Turn off those annoying errors
-	r = env->open(env, ENVDIR, (u_int32_t) -1, 0644);
+	r = env->open(env, ENVDIR, (uint32_t) -1, 0644);
 	CKERR2(r, EINVAL);
 	assert(n_handle_error==0);
 	r = env->close(env, 0); assert(r==0);
@@ -63,7 +63,7 @@ test_main (int argc, char *const argv[]) {
 			env->set_errfile(env, write_here);
 		    if (do_errcall) 
 			env->set_errcall(env, handle_error);
-		    r = env->open(env, ENVDIR, (u_int32_t) -1, 0644);
+		    r = env->open(env, ENVDIR, (uint32_t) -1, 0644);
 		    assert(r==EINVAL);
 		    r = env->close(env, 0); assert(r==0);
 		    fclose(write_here);
diff --git a/src/tests/test_kv_limits.cc b/src/tests/test_kv_limits.cc
index ae6af8bfb865a25a5a8d58c51e61b23938f00ab0..5c48da8c5c71cbe76348dedf7d8cc3c1ed68f9b1 100644
--- a/src/tests/test_kv_limits.cc
+++ b/src/tests/test_kv_limits.cc
@@ -13,9 +13,9 @@
 #include <db.h>
 
 
-static u_int64_t lorange = 0;
-static u_int64_t hirange = 1<<24;
-static u_int32_t pagesize = 0;
+static uint64_t lorange = 0;
+static uint64_t hirange = 1<<24;
+static uint32_t pagesize = 0;
 
 static void test_key_size_limit (void) {
     if (verbose > 1) printf("%s\n", __FUNCTION__);
@@ -43,17 +43,17 @@ static void test_key_size_limit (void) {
 
     void *k = 0;
     void *v = 0;
-    u_int32_t lo = lorange, mi = 0, hi = hirange;
-    u_int32_t bigest = 0;
+    uint32_t lo = lorange, mi = 0, hi = hirange;
+    uint32_t bigest = 0;
     while (lo <= hi) {
         mi = lo + (hi - lo) / 2;
         assert(lo <= mi && mi <= hi);
-        u_int32_t ks = mi;
+        uint32_t ks = mi;
         if (verbose > 1) printf("trying %u %u %u ks=%u\n", lo, mi, hi, ks);
         k = toku_realloc(k, ks); assert(k);
         memset(k, 0, ks);
         memcpy(k, &ks, sizeof ks);
-        u_int32_t vs = sizeof (u_int32_t);
+        uint32_t vs = sizeof (uint32_t);
         v = toku_realloc(v, vs); assert(v);
         memset(v, 0, vs);
         memcpy(v, &vs, sizeof vs);
@@ -102,17 +102,17 @@ static void test_data_size_limit (void) {
 
     void *k = 0;
     void *v = 0;
-    u_int32_t lo = lorange, mi = 0, hi = hirange;
-    u_int32_t bigest = 0;
+    uint32_t lo = lorange, mi = 0, hi = hirange;
+    uint32_t bigest = 0;
     while (lo <= hi) {
         mi = lo + (hi - lo) / 2;
         assert(lo <= mi && mi <= hi);
-        u_int32_t ks = sizeof (u_int32_t);
+        uint32_t ks = sizeof (uint32_t);
         if (verbose > 1) printf("trying %u %u %u ks=%u\n", lo, mi, hi, ks);
         k = toku_realloc(k, ks); assert(k);
         memset(k, 0, ks);
         memcpy(k, &ks, sizeof ks);
-        u_int32_t vs = mi;
+        uint32_t vs = mi;
         v = toku_realloc(v, vs); assert(v);
         memset(v, 0, vs);
         memcpy(v, &vs, sizeof vs);
diff --git a/src/tests/test_large_update_broadcast_small_cachetable.cc b/src/tests/test_large_update_broadcast_small_cachetable.cc
index 0a73d63f97c6959bc6f316b1f1cf472224e8a4ce..445a662414d155783a6d4c507eda64e7b8215fcd 100644
--- a/src/tests/test_large_update_broadcast_small_cachetable.cc
+++ b/src/tests/test_large_update_broadcast_small_cachetable.cc
@@ -102,7 +102,7 @@ static int do_verify_results(DB_TXN *txn, DB *db) {
     return r;
 }
 
-static int run_test(BOOL shutdown_before_update, BOOL shutdown_before_verify) {
+static int run_test(bool shutdown_before_update, bool shutdown_before_verify) {
     setup();
 
     DB *db;
@@ -149,10 +149,10 @@ static int run_test(BOOL shutdown_before_update, BOOL shutdown_before_verify) {
 int test_main(int argc, char * const argv[]) {
     parse_args(argc, argv);
 
-    run_test(FALSE, FALSE);
-    run_test(FALSE, TRUE);
-    run_test(TRUE, FALSE);
-    run_test(TRUE, TRUE);
+    run_test(false, false);
+    run_test(false, true);
+    run_test(true, false);
+    run_test(true, true);
 
     return 0;
 }
diff --git a/src/tests/test_log1.cc b/src/tests/test_log1.cc
index 466535af43b15fac8137ea9482f0783a1e07017c..7a233d26cd33327e039fe899e922ff5a7bd28384 100644
--- a/src/tests/test_log1.cc
+++ b/src/tests/test_log1.cc
@@ -21,7 +21,7 @@ DB_ENV *env;
 DB *db;
 DB_TXN *tid;
 
-static void make_db (BOOL close_env) {
+static void make_db (bool close_env) {
     int r;
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -73,10 +73,10 @@ static void make_db (BOOL close_env) {
 
 int
 test_main (int argc, char *const argv[]) {
-    BOOL close_env = TRUE;
+    bool close_env = true;
     for (int i=1; i<argc; i++) {
         if (strcmp(argv[i], "--no-shutdown") == 0)
-            close_env = FALSE;
+            close_env = false;
     }
     make_db(close_env);
     return 0;
diff --git a/src/tests/test_log10.cc b/src/tests/test_log10.cc
index 94f49259a673c4b3c3ded6e371ad3e0f86f3df88..f13e83d0c9a2080a8d801532691b17ca663b3b51 100644
--- a/src/tests/test_log10.cc
+++ b/src/tests/test_log10.cc
@@ -28,8 +28,8 @@ struct in_db {
 
 int maxcount = 10000;
 
-static void insert_some (int outeri, BOOL close_env) {
-    u_int32_t create_flag = outeri%2 ? DB_CREATE : 0; // Sometimes use DB_CREATE, sometimes don't.
+static void insert_some (int outeri, bool close_env) {
+    uint32_t create_flag = outeri%2 ? DB_CREATE : 0; // Sometimes use DB_CREATE, sometimes don't.
     int r;
     DB_ENV *env;
     DB *db;
@@ -78,7 +78,7 @@ static void insert_some (int outeri, BOOL close_env) {
     }
 }    
 
-static void make_db (BOOL close_env) {
+static void make_db (bool close_env) {
     DB_ENV *env;
     DB *db;
     DB_TXN *tid;
@@ -115,10 +115,10 @@ static void make_db (BOOL close_env) {
 
 int
 test_main (int argc, char *const argv[]) {
-    BOOL close_env = TRUE;
+    bool close_env = true;
     for (int i=1; i<argc; i++) {
         if (strcmp(argv[i], "--no-shutdown") == 0)
-            close_env = FALSE;
+            close_env = false;
     }
     make_db(close_env);
     return 0;
diff --git a/src/tests/test_log2.cc b/src/tests/test_log2.cc
index 686136833119485fb486b9ac0de6ffd6ba395000..da219c5079343a23a4c5e5dd49000a313ead2162 100644
--- a/src/tests/test_log2.cc
+++ b/src/tests/test_log2.cc
@@ -16,7 +16,7 @@
 
 // ENVDIR is defined in the Makefile
 
-static void make_db (BOOL close_env) {
+static void make_db (bool close_env) {
     DB_ENV *env;
     DB *db;
     DB_TXN *tid;
@@ -40,10 +40,10 @@ static void make_db (BOOL close_env) {
 
 int
 test_main (int argc, char *const argv[]) {
-    BOOL close_env = TRUE;
+    bool close_env = true;
     for (int i=1; i<argc; i++) {
         if (strcmp(argv[i], "--no-shutdown") == 0)
-            close_env = FALSE;
+            close_env = false;
     }
     make_db(close_env);
     return 0;
diff --git a/src/tests/test_log3.cc b/src/tests/test_log3.cc
index 70469853b15173e6d570576d0ff1c0f417f23298..7d082295bf6f4b7b38f79bba529fe192e74817ae 100644
--- a/src/tests/test_log3.cc
+++ b/src/tests/test_log3.cc
@@ -17,7 +17,7 @@
 
 // ENVDIR is defined in the Makefile
 
-static void make_db (BOOL close_env) {
+static void make_db (bool close_env) {
     DB_ENV *env;
     DB *db;
     DB_TXN *tid;
@@ -48,10 +48,10 @@ static void make_db (BOOL close_env) {
 
 int
 test_main (int argc, char *const argv[]) {
-    BOOL close_env = TRUE;
+    bool close_env = true;
     for (int i=1; i<argc; i++) {
         if (strcmp(argv[i], "--no-shutdown") == 0)
-            close_env = FALSE;
+            close_env = false;
     }
     make_db(close_env);
     return 0;
diff --git a/src/tests/test_log4.cc b/src/tests/test_log4.cc
index 32627ab4408d4ba6b3ed93439a650532ec756f28..0783922914b3a95d53bc84fd758287c58872bd94 100644
--- a/src/tests/test_log4.cc
+++ b/src/tests/test_log4.cc
@@ -17,7 +17,7 @@
 
 // ENVDIR is defined in the Makefile
 
-static void make_db (BOOL close_env) {
+static void make_db (bool close_env) {
     DB_ENV *env;
     DB *db;
     DB_TXN *tid;
@@ -56,10 +56,10 @@ static void make_db (BOOL close_env) {
 
 int
 test_main (int argc, char *const argv[]) {
-    BOOL close_env = TRUE;
+    bool close_env = true;
     for (int i=1; i<argc; i++) {
         if (strcmp(argv[i], "--no-shutdown") == 0)
-            close_env = FALSE;
+            close_env = false;
     }
     make_db(close_env);
     return 0;
diff --git a/src/tests/test_log5.cc b/src/tests/test_log5.cc
index 0d93ac81c32084bb3e2586a3ff38def6ffe902b1..a5ddb32e09e33741374e34bfc6dff795ecd10a17 100644
--- a/src/tests/test_log5.cc
+++ b/src/tests/test_log5.cc
@@ -24,7 +24,7 @@ struct in_db {
     struct in_db *next;
 } *items=0;
 
-static void make_db (BOOL close_env) {
+static void make_db (bool close_env) {
     DB_ENV *env;
     DB *db;
     DB_TXN *tid;
@@ -75,10 +75,10 @@ static void make_db (BOOL close_env) {
 
 int
 test_main (int argc, char *const argv[]) {
-    BOOL close_env = TRUE;
+    bool close_env = true;
     for (int i=1; i<argc; i++) {
         if (strcmp(argv[i], "--no-shutdown") == 0)
-            close_env = FALSE;
+            close_env = false;
     }
     make_db(close_env);
     return 0;
diff --git a/src/tests/test_log6.cc b/src/tests/test_log6.cc
index 93f13b7455a45512289ab305c2466b703733899c..2c6af115c528553f0656ad7c51081d43dbc6eda6 100644
--- a/src/tests/test_log6.cc
+++ b/src/tests/test_log6.cc
@@ -71,7 +71,7 @@ static void del_n (DB *db, DB_TXN *tid, int i) {
     }
 }
 
-static void make_db (BOOL close_env) {
+static void make_db (bool close_env) {
     DB_ENV *env;
     DB *db;
     DB_TXN *tid;
@@ -115,10 +115,10 @@ static void make_db (BOOL close_env) {
 
 int
 test_main (int argc, char *const argv[]) {
-    BOOL close_env = TRUE;
+    bool close_env = true;
     for (int i=1; i<argc; i++) {
         if (strcmp(argv[i], "--no-shutdown") == 0)
-            close_env = FALSE;
+            close_env = false;
     }
     make_db(close_env);
     return 0;
diff --git a/src/tests/test_log7.cc b/src/tests/test_log7.cc
index 60d93be854541b0467bee910ca1c21f27fbf49ba..a854de403b60911cffe80da9966583acfbebf58a 100644
--- a/src/tests/test_log7.cc
+++ b/src/tests/test_log7.cc
@@ -25,7 +25,7 @@ struct in_db {
     struct in_db *next;
 } *items=0;
 
-static void make_db (BOOL close_env) {
+static void make_db (bool close_env) {
     DB_ENV *env;
     DB *db;
     DB_TXN *tid;
@@ -85,10 +85,10 @@ static void make_db (BOOL close_env) {
 
 int
 test_main (int argc, char *const argv[]) {
-    BOOL close_env = TRUE;
+    bool close_env = true;
     for (int i=1; i<argc; i++) {
         if (strcmp(argv[i], "--no-shutdown") == 0)
-            close_env = FALSE;
+            close_env = false;
     }
     make_db(close_env);
     return 0;
diff --git a/src/tests/test_log8.cc b/src/tests/test_log8.cc
index 8128dfe6103d331bac5f5cdfabb62b8e7651be27..34d04e4b6c70b1443f4549bb0421c8d321ae1fd1 100644
--- a/src/tests/test_log8.cc
+++ b/src/tests/test_log8.cc
@@ -27,8 +27,8 @@ struct in_db {
 
 int maxcount = 10;
 
-static void insert_some (int outeri, BOOL close_env) {
-    u_int32_t create_flag = outeri%2 ? DB_CREATE : 0; // Sometimes use DB_CREATE, sometimes don't.
+static void insert_some (int outeri, bool close_env) {
+    uint32_t create_flag = outeri%2 ? DB_CREATE : 0; // Sometimes use DB_CREATE, sometimes don't.
     int r;
     DB_ENV *env;
     DB *db;
@@ -71,7 +71,7 @@ static void insert_some (int outeri, BOOL close_env) {
     }
 }    
 
-static void make_db (BOOL close_env) {
+static void make_db (bool close_env) {
     DB_ENV *env;
     DB *db;
     DB_TXN *tid;
@@ -108,10 +108,10 @@ static void make_db (BOOL close_env) {
 
 int
 test_main (int argc, char *const argv[]) {
-    BOOL close_env = TRUE;
+    bool close_env = true;
     for (int i=1; i<argc; i++) {
         if (strcmp(argv[i], "--no-shutdown") == 0)
-            close_env = FALSE;
+            close_env = false;
     }
     make_db(close_env);
     return 0;
diff --git a/src/tests/test_log9.cc b/src/tests/test_log9.cc
index c70f7b1527f507c3b5dc78915aaa81390dc6c7ad..9e620101ef195181502b52b8582fad88ee48c3ac 100644
--- a/src/tests/test_log9.cc
+++ b/src/tests/test_log9.cc
@@ -27,8 +27,8 @@ struct in_db {
 
 int maxcount = 10;
 
-static void insert_some (int outeri, BOOL close_env) {
-    u_int32_t create_flag = outeri%2 ? DB_CREATE : 0; // Sometimes use DB_CREATE, sometimes don't.
+static void insert_some (int outeri, bool close_env) {
+    uint32_t create_flag = outeri%2 ? DB_CREATE : 0; // Sometimes use DB_CREATE, sometimes don't.
     int r;
     DB_ENV *env;
     DB *db;
@@ -70,7 +70,7 @@ static void insert_some (int outeri, BOOL close_env) {
     }
 }    
 
-static void make_db (BOOL close_env) {
+static void make_db (bool close_env) {
     DB_ENV *env;
     DB *db;
     DB_TXN *tid;
@@ -107,10 +107,10 @@ static void make_db (BOOL close_env) {
 
 int
 test_main (int argc, char *const argv[]) {
-    BOOL close_env = TRUE;
+    bool close_env = true;
     for (int i=1; i<argc; i++) {
         if (strcmp(argv[i], "--no-shutdown") == 0)
-            close_env = FALSE;
+            close_env = false;
     }
     make_db(close_env);
     return 0;
diff --git a/src/tests/test_logmax.cc b/src/tests/test_logmax.cc
index a1731fc5280dc5329ea5881c01b604780c1411ea..fc7df4b49080b151c09495abf898a66d939da1c8 100644
--- a/src/tests/test_logmax.cc
+++ b/src/tests/test_logmax.cc
@@ -50,11 +50,11 @@ test_logmax (int logmax) {
     }
     r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
     {
-	u_int32_t lmax;
+	uint32_t lmax;
 	r=env->get_lg_max(env, &lmax);
 	assert(r==0);
 	if (logmax>0) {
-	    assert(lmax==(u_int32_t)logmax);
+	    assert(lmax==(uint32_t)logmax);
 	} else {
 	    assert(lmax>0);
 	    
diff --git a/src/tests/test_multiple_checkpoints_block_commit.cc b/src/tests/test_multiple_checkpoints_block_commit.cc
index a7155f40bc9ef9dbdc22b77dd024eaca99a8b22c..541d616c92687202a12633f37fc384d3e412f982 100644
--- a/src/tests/test_multiple_checkpoints_block_commit.cc
+++ b/src/tests/test_multiple_checkpoints_block_commit.cc
@@ -82,7 +82,7 @@ static void run_test(void) {
     
     struct timeval tend; 
     gettimeofday(&tend, NULL);
-    u_int64_t diff = tdelta_usec(&tend, &tstart);
+    uint64_t diff = tdelta_usec(&tend, &tstart);
     assert(diff < 5*1024*1024); 
 
 
diff --git a/src/tests/test_redirect_func.cc b/src/tests/test_redirect_func.cc
index 52b1fc0c2724de33d95e4a80eea81fbbbe8af5c8..adeae54d782a32d170238f602b3dc62d6570b8a4 100644
--- a/src/tests/test_redirect_func.cc
+++ b/src/tests/test_redirect_func.cc
@@ -32,7 +32,7 @@ static int generate_row_for_del(
     )
 {
     dest_key->size=0;
-    assert(FALSE);
+    assert(false);
     return 0;
 }
 
@@ -73,10 +73,10 @@ static void run_test(void) {
     DB* db = NULL;
     DB_LOADER* loader = NULL;
     DBT key, val;
-    u_int32_t mult_db_flags = 0;
-    u_int32_t mult_dbt_flags = DB_DBT_REALLOC;
-    u_int8_t key_data = 0;
-    u_int8_t val_data = 0;
+    uint32_t mult_db_flags = 0;
+    uint32_t mult_dbt_flags = DB_DBT_REALLOC;
+    uint8_t key_data = 0;
+    uint8_t val_data = 0;
     
 
     IN_TXN_COMMIT(env, NULL, txn_create, 0, {
@@ -85,8 +85,8 @@ static void run_test(void) {
         });
 
 
-    dbt_init(&key,&key_data,sizeof(u_int8_t));
-    dbt_init(&val,&val_data,sizeof(u_int8_t));
+    dbt_init(&key,&key_data,sizeof(uint8_t));
+    dbt_init(&val,&val_data,sizeof(uint8_t));
 
     val_data = 100;
 
@@ -126,15 +126,15 @@ static void run_test(void) {
     IN_TXN_COMMIT(env, NULL, txn_3, 0, {
             { int chk_r = db->cursor(db, txn_3, &cursor, 0); CKERR(chk_r); }
             { int chk_r = cursor->c_get(cursor, &key, &val, DB_NEXT); CKERR(chk_r); }
-        assert(key.size == sizeof(u_int8_t));
-        assert(val.size == sizeof(u_int8_t));
-        assert(*(u_int8_t *)(key.data) == 0);
-        assert(*(u_int8_t *)(val.data) == 101);
+        assert(key.size == sizeof(uint8_t));
+        assert(val.size == sizeof(uint8_t));
+        assert(*(uint8_t *)(key.data) == 0);
+        assert(*(uint8_t *)(val.data) == 101);
         { int chk_r = cursor->c_get(cursor, &key, &val, DB_NEXT); CKERR(chk_r); }
-        assert(key.size == sizeof(u_int8_t));
-        assert(val.size == sizeof(u_int8_t));
-        assert(*(u_int8_t *)(key.data) == 11);
-        assert(*(u_int8_t *)(val.data) == 11);
+        assert(key.size == sizeof(uint8_t));
+        assert(val.size == sizeof(uint8_t));
+        assert(*(uint8_t *)(key.data) == 11);
+        assert(*(uint8_t *)(val.data) == 11);
         { int chk_r = cursor->c_close(cursor); CKERR(chk_r); }
     });
     
diff --git a/src/tests/test_set_lk_max_locks.cc b/src/tests/test_set_lk_max_locks.cc
index d562502aed10de55c047ba5bac6f0b20a045d952..5bada2d728daf2e2153d49b3728274954c60765e 100644
--- a/src/tests/test_set_lk_max_locks.cc
+++ b/src/tests/test_set_lk_max_locks.cc
@@ -25,7 +25,7 @@ static void make_db (int n_locks) {
     DB_TXN *tid, *tid2;
     int r;
     int i;
-    u_int32_t actual_n_locks;
+    uint32_t actual_n_locks;
 
     r = system("rm -rf " ENVDIR);
     CKERR(r);
@@ -49,7 +49,7 @@ static void make_db (int n_locks) {
         assert(r == EINVAL);
 #endif
         r = env->get_lk_max_locks(env, &actual_n_locks);
-        assert(r == 0 && actual_n_locks == (u_int32_t)n_locks+EXTRA_LOCK_NEEDED);
+        assert(r == 0 && actual_n_locks == (uint32_t)n_locks+EXTRA_LOCK_NEEDED);
     }
     else {
 	r = env->get_lk_max_locks(env, &actual_n_locks);	
@@ -62,11 +62,11 @@ static void make_db (int n_locks) {
     r = tid->commit(tid, 0);    assert(r == 0);
     
 #if !TOKUDB
-    u_int32_t pagesize;
+    uint32_t pagesize;
     r = db->get_pagesize(db, &pagesize); CKERR(r);
-    u_int32_t datasize = pagesize/6;
+    uint32_t datasize = pagesize/6;
 #else
-    u_int32_t datasize = 1;
+    uint32_t datasize = 1;
 #endif
     int effective_n_locks = (n_locks<0) ? (int)actual_n_locks-EXTRA_LOCK_NEEDED : n_locks;
     // create even numbered keys 0 2 4 ...  (effective_n_locks*32-2)
diff --git a/src/tests/test_stress1.cc b/src/tests/test_stress1.cc
index f1d09f995c7d8b7bfb0c1128df3057976067c58f..12ca71bff2f8238fa380ed5f17bba075d1406c1e 100644
--- a/src/tests/test_stress1.cc
+++ b/src/tests/test_stress1.cc
@@ -57,30 +57,30 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
     struct scan_op_extra soe[4];
 
     // make the forward fast scanner
-    soe[0].fast = TRUE;
-    soe[0].fwd = TRUE;
-    soe[0].prefetch = FALSE;
+    soe[0].fast = true;
+    soe[0].fwd = true;
+    soe[0].prefetch = false;
     myargs[0].operation_extra = &soe[0];
     myargs[0].operation = scan_op;
 
     // make the forward slow scanner
-    soe[1].fast = FALSE;
-    soe[1].fwd = TRUE;
-    soe[1].prefetch = FALSE;
+    soe[1].fast = false;
+    soe[1].fwd = true;
+    soe[1].prefetch = false;
     myargs[1].operation_extra = &soe[1];
     myargs[1].operation = scan_op;
 
     // make the backward fast scanner
-    soe[2].fast = TRUE;
-    soe[2].fwd = FALSE;
-    soe[2].prefetch = FALSE;
+    soe[2].fast = true;
+    soe[2].fwd = false;
+    soe[2].prefetch = false;
     myargs[2].operation_extra = &soe[2];
     myargs[2].operation = scan_op;
 
     // make the backward slow scanner
-    soe[3].fast = FALSE;
-    soe[3].fwd = FALSE;
-    soe[3].prefetch = FALSE;
+    soe[3].fast = false;
+    soe[3].fwd = false;
+    soe[3].prefetch = false;
     myargs[3].operation_extra = &soe[3];
     myargs[3].operation = scan_op;
 
diff --git a/src/tests/test_stress2.cc b/src/tests/test_stress2.cc
index 28b83fed9557c24b41af261beb1aaf53775c55e4..3391351565d7a525c043fa3ae966c60012d9565c 100644
--- a/src/tests/test_stress2.cc
+++ b/src/tests/test_stress2.cc
@@ -51,30 +51,30 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
     struct scan_op_extra soe[4];
 
     // make the forward fast scanner
-    soe[0].fast = TRUE;
-    soe[0].fwd = TRUE;
-    soe[0].prefetch = FALSE;
+    soe[0].fast = true;
+    soe[0].fwd = true;
+    soe[0].prefetch = false;
     myargs[0].operation_extra = &soe[0];
     myargs[0].operation = scan_op;
 
     // make the forward slow scanner
-    soe[1].fast = FALSE;
-    soe[1].fwd = TRUE;
-    soe[1].prefetch = FALSE;
+    soe[1].fast = false;
+    soe[1].fwd = true;
+    soe[1].prefetch = false;
     myargs[1].operation_extra = &soe[1];
     myargs[1].operation = scan_op;
 
     // make the backward fast scanner
-    soe[2].fast = TRUE;
-    soe[2].fwd = FALSE;
-    soe[2].prefetch = FALSE;
+    soe[2].fast = true;
+    soe[2].fwd = false;
+    soe[2].prefetch = false;
     myargs[2].operation_extra = &soe[2];
     myargs[2].operation = scan_op;
 
     // make the backward slow scanner
-    soe[3].fast = FALSE;
-    soe[3].fwd = FALSE;
-    soe[3].prefetch = FALSE;
+    soe[3].fast = false;
+    soe[3].fwd = false;
+    soe[3].prefetch = false;
     myargs[3].operation_extra = &soe[3];
     myargs[3].operation = scan_op;
 
diff --git a/src/tests/test_stress3.cc b/src/tests/test_stress3.cc
index d6cb1a4c6aae2c31e7e4550184c437592a5912bd..baf746dcdfd0b65527ad0af8b2d31e9fafc15bd6 100644
--- a/src/tests/test_stress3.cc
+++ b/src/tests/test_stress3.cc
@@ -50,30 +50,30 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
     struct scan_op_extra soe[4];
 
     // make the forward fast scanner
-    soe[0].fast = TRUE;
-    soe[0].fwd = TRUE;
-    soe[0].prefetch = FALSE;
+    soe[0].fast = true;
+    soe[0].fwd = true;
+    soe[0].prefetch = false;
     myargs[0].operation_extra = &soe[0];
     myargs[0].operation = scan_op;
 
     // make the forward slow scanner
-    soe[1].fast = FALSE;
-    soe[1].fwd = TRUE;
-    soe[1].prefetch = FALSE;
+    soe[1].fast = false;
+    soe[1].fwd = true;
+    soe[1].prefetch = false;
     myargs[1].operation_extra = &soe[1];
     myargs[1].operation = scan_op;
 
     // make the backward fast scanner
-    soe[2].fast = TRUE;
-    soe[2].fwd = FALSE;
-    soe[2].prefetch = FALSE;
+    soe[2].fast = true;
+    soe[2].fwd = false;
+    soe[2].prefetch = false;
     myargs[2].operation_extra = &soe[2];
     myargs[2].operation = scan_op;
 
     // make the backward slow scanner
-    soe[3].fast = FALSE;
-    soe[3].fwd = FALSE;
-    soe[3].prefetch = FALSE;
+    soe[3].fast = false;
+    soe[3].fwd = false;
+    soe[3].prefetch = false;
     myargs[3].operation_extra = &soe[3];
     myargs[3].operation = scan_op;
 
diff --git a/src/tests/test_stress4.cc b/src/tests/test_stress4.cc
index a2c5f596eb34cf64b538a5edd84f56b21b5f8adf..382765609b2e3bdf479e21e002086882d34e29b8 100644
--- a/src/tests/test_stress4.cc
+++ b/src/tests/test_stress4.cc
@@ -51,30 +51,30 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
     struct scan_op_extra soe[4];
 
     // make the forward fast scanner
-    soe[0].fast = TRUE;
-    soe[0].fwd = TRUE;
-    soe[0].prefetch = FALSE;
+    soe[0].fast = true;
+    soe[0].fwd = true;
+    soe[0].prefetch = false;
     myargs[0].operation_extra = &soe[0];
     myargs[0].operation = scan_op_no_check;
 
     // make the forward slow scanner
-    soe[1].fast = FALSE;
-    soe[1].fwd = TRUE;
-    soe[1].prefetch = FALSE;
+    soe[1].fast = false;
+    soe[1].fwd = true;
+    soe[1].prefetch = false;
     myargs[1].operation_extra = &soe[1];
     myargs[1].operation = scan_op_no_check;
 
     // make the backward fast scanner
-    soe[2].fast = TRUE;
-    soe[2].fwd = FALSE;
-    soe[2].prefetch = FALSE;
+    soe[2].fast = true;
+    soe[2].fwd = false;
+    soe[2].prefetch = false;
     myargs[2].operation_extra = &soe[2];
     myargs[2].operation = scan_op_no_check;
 
     // make the backward slow scanner
-    soe[3].fast = FALSE;
-    soe[3].fwd = FALSE;
-    soe[3].prefetch = FALSE;
+    soe[3].fast = false;
+    soe[3].fwd = false;
+    soe[3].prefetch = false;
     myargs[3].operation_extra = &soe[3];
     myargs[3].operation = scan_op_no_check;
 
diff --git a/src/tests/test_stress5.cc b/src/tests/test_stress5.cc
index 8733f0b4c8f6bc2fac92426f26e98f4a34d1d3ca..074eb59e59d43ab79c4ef3cb9a5d2c01569bef73 100644
--- a/src/tests/test_stress5.cc
+++ b/src/tests/test_stress5.cc
@@ -31,16 +31,16 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
     struct scan_op_extra soe[2];
 
     // make the forward fast scanner
-    soe[0].fast = TRUE;
-    soe[0].fwd = TRUE;
-    soe[0].prefetch = FALSE;
+    soe[0].fast = true;
+    soe[0].fwd = true;
+    soe[0].prefetch = false;
     myargs[0].operation_extra = &soe[0];
     myargs[0].operation = scan_op;
 
     // make the forward slow scanner
-    soe[1].fast = FALSE;
-    soe[1].fwd = TRUE;
-    soe[1].prefetch = FALSE;
+    soe[1].fast = false;
+    soe[1].fwd = true;
+    soe[1].prefetch = false;
     myargs[1].operation_extra = &soe[1];
     myargs[1].operation = scan_op;
 
diff --git a/src/tests/test_stress6.cc b/src/tests/test_stress6.cc
index 792ba6c06a4173cf71a23ad75f930bbfb006f0a7..46cce3bf61bb6e7fa339f13e229f1c6e3c7b08f1 100644
--- a/src/tests/test_stress6.cc
+++ b/src/tests/test_stress6.cc
@@ -52,33 +52,33 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
     struct scan_op_extra soe[4];
 
     // make the forward fast scanner
-    soe[0].fast = TRUE;
-    soe[0].fwd = TRUE;
-    soe[0].prefetch = FALSE;
+    soe[0].fast = true;
+    soe[0].fwd = true;
+    soe[0].prefetch = false;
     myargs[0].lock_type = STRESS_LOCK_SHARED;
     myargs[0].operation_extra = &soe[0];
     myargs[0].operation = scan_op;
 
     // make the forward slow scanner
-    soe[1].fast = FALSE;
-    soe[1].fwd = TRUE;
-    soe[1].prefetch = FALSE;
+    soe[1].fast = false;
+    soe[1].fwd = true;
+    soe[1].prefetch = false;
     myargs[1].lock_type = STRESS_LOCK_SHARED;
     myargs[1].operation_extra = &soe[1];
     myargs[1].operation = scan_op;
 
     // make the backward fast scanner
-    soe[2].fast = TRUE;
-    soe[2].fwd = FALSE;
-    soe[2].prefetch = FALSE;
+    soe[2].fast = true;
+    soe[2].fwd = false;
+    soe[2].prefetch = false;
     myargs[2].lock_type = STRESS_LOCK_SHARED;
     myargs[2].operation_extra = &soe[2];
     myargs[2].operation = scan_op;
 
     // make the backward slow scanner
-    soe[3].fast = FALSE;
-    soe[3].fwd = FALSE;
-    soe[3].prefetch = FALSE;
+    soe[3].fast = false;
+    soe[3].fwd = false;
+    soe[3].prefetch = false;
     myargs[3].lock_type = STRESS_LOCK_SHARED;
     myargs[3].operation_extra = &soe[3];
     myargs[3].operation = scan_op;
diff --git a/src/tests/test_stress7.cc b/src/tests/test_stress7.cc
index 5db1f652bd47972b8f2a0fa29b1c35df78d116b5..836c91d2c365220478f79968321fca9005ac8da0 100644
--- a/src/tests/test_stress7.cc
+++ b/src/tests/test_stress7.cc
@@ -31,16 +31,16 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
     struct scan_op_extra soe[2];
 
     // make the forward fast scanner
-    soe[0].fast = TRUE;
-    soe[0].fwd = TRUE;
-    soe[0].prefetch = FALSE;
+    soe[0].fast = true;
+    soe[0].fwd = true;
+    soe[0].prefetch = false;
     myargs[0].operation_extra = &soe[0];
     myargs[0].operation = scan_op;
 
     // make the forward slow scanner
-    soe[1].fast = FALSE;
-    soe[1].fwd = TRUE;
-    soe[1].prefetch = FALSE;
+    soe[1].fast = false;
+    soe[1].fwd = true;
+    soe[1].prefetch = false;
     myargs[1].operation_extra = &soe[1];
     myargs[1].operation = scan_op;
 
diff --git a/src/tests/test_stress_hot_indexing.cc b/src/tests/test_stress_hot_indexing.cc
index 6b1676cde7455461515ee53f91198b8adc037aa5..a9781d1799cee69fdc472cc06cda691eb47d4d55 100644
--- a/src/tests/test_stress_hot_indexing.cc
+++ b/src/tests/test_stress_hot_indexing.cc
@@ -18,8 +18,8 @@
 DB* hot_db;
 toku_mutex_t fops_lock;
 toku_mutex_t hi_lock;
-u_int32_t gid_count;
-u_int8_t hi_gid[DB_GID_SIZE];
+uint32_t gid_count;
+uint8_t hi_gid[DB_GID_SIZE];
 
 
 static int
@@ -62,7 +62,7 @@ static int hi_inserts(DB_TXN* UU(txn), ARG arg, void* UU(operation_extra), void
     toku_mutex_lock(&fops_lock);
     DB_ENV* env = arg->env;
     DB* db = arg->dbp[0];
-    u_int32_t flags[2];
+    uint32_t flags[2];
     flags[0] = 0;
     flags[1] = 0;
     DBT dest_keys[2];
@@ -116,7 +116,7 @@ static int hi_inserts(DB_TXN* UU(txn), ARG arg, void* UU(operation_extra), void
     }
     increment_counter(stats_extra, PUTS, i);
     gid_count++;
-    u_int32_t *hi_gid_count_p = cast_to_typeof(hi_gid_count_p) hi_gid;  // make gcc --happy about -Wstrict-aliasing
+    uint32_t *hi_gid_count_p = cast_to_typeof(hi_gid_count_p) hi_gid;  // make gcc --happy about -Wstrict-aliasing
     *hi_gid_count_p = gid_count;
     int rr = hi_txn->prepare(hi_txn, hi_gid);
     CKERR(rr);
@@ -152,8 +152,8 @@ static int hi_create_index(DB_TXN* UU(txn), ARG arg, void* UU(operation_extra),
     CKERR(r);
     r = hot_db->open(hot_db, NULL, "hotindex_db", NULL, DB_BTREE, DB_CREATE | DB_IS_HOT_INDEX, 0666);
     CKERR(r);
-    u_int32_t db_flags = 0;
-    u_int32_t indexer_flags = 0;
+    uint32_t db_flags = 0;
+    uint32_t indexer_flags = 0;
     
     r = env->create_indexer(
         env,
@@ -270,7 +270,7 @@ test_main(int argc, char *const argv[]) {
     args.num_ptquery_threads = 0;
     parse_stress_test_args(argc, argv, &args);
     args.num_DBs = 1;
-    args.crash_on_operation_failure = FALSE;
+    args.crash_on_operation_failure = false;
     args.env_args.generate_del_callback = hi_del_callback;
     args.env_args.generate_put_callback = hi_put_callback;
     stress_test_main(&args);
diff --git a/src/tests/test_stress_with_verify.cc b/src/tests/test_stress_with_verify.cc
index 63a01026abab371e4c1f4d81e0436efb5cd8adec..d391a9feba0c3603385fe8ac70241bbd6d4d2d31 100644
--- a/src/tests/test_stress_with_verify.cc
+++ b/src/tests/test_stress_with_verify.cc
@@ -36,9 +36,9 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
     }
     // make the forward fast scanner
     struct scan_op_extra soe;
-    soe.fast = TRUE;
-    soe.fwd = TRUE;
-    soe.prefetch = FALSE;
+    soe.fast = true;
+    soe.fwd = true;
+    soe.prefetch = false;
     myargs[0].operation_extra = &soe;
     myargs[0].lock_type = STRESS_LOCK_SHARED;
     myargs[0].operation = scan_op;
diff --git a/src/tests/test_trans_desc_during_chkpt.cc b/src/tests/test_trans_desc_during_chkpt.cc
index 3f58a7e7bebead4006b4af605bc51a4daae0fcfb..22ebd5803d82e27b9c14b89b1a4ee905fa4dd40c 100644
--- a/src/tests/test_trans_desc_during_chkpt.cc
+++ b/src/tests/test_trans_desc_during_chkpt.cc
@@ -11,17 +11,17 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
 
 DB_ENV *env;
 
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
 static void checkpoint_callback_1(void * extra) {
diff --git a/src/tests/test_trans_desc_during_chkpt2.cc b/src/tests/test_trans_desc_during_chkpt2.cc
index 3d62966390254196dbaed631ca145316cf522e8a..3e82c58b1db2382275570798d58825450c541e8f 100644
--- a/src/tests/test_trans_desc_during_chkpt2.cc
+++ b/src/tests/test_trans_desc_during_chkpt2.cc
@@ -11,17 +11,17 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
 
 DB_ENV *env;
 
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
 static void checkpoint_callback_1(void * extra) {
diff --git a/src/tests/test_trans_desc_during_chkpt3.cc b/src/tests/test_trans_desc_during_chkpt3.cc
index 5793b1995ade2749e977679eb9c1be659a9a46be..6f5c4d7c3864592a664986bb66d19becd57017c1 100644
--- a/src/tests/test_trans_desc_during_chkpt3.cc
+++ b/src/tests/test_trans_desc_during_chkpt3.cc
@@ -11,17 +11,17 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
 
 DB_ENV *env;
 
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
 static void checkpoint_callback_1(void * extra) {
diff --git a/src/tests/test_trans_desc_during_chkpt4.cc b/src/tests/test_trans_desc_during_chkpt4.cc
index 3d62966390254196dbaed631ca145316cf522e8a..3e82c58b1db2382275570798d58825450c541e8f 100644
--- a/src/tests/test_trans_desc_during_chkpt4.cc
+++ b/src/tests/test_trans_desc_during_chkpt4.cc
@@ -11,17 +11,17 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
 
 DB_ENV *env;
 
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
 static void checkpoint_callback_1(void * extra) {
diff --git a/src/tests/test_transactional_descriptor.cc b/src/tests/test_transactional_descriptor.cc
index 89b25a08b1d5c69b1e6374b3e80b6aa22d5e8346..ace8194bd58aed3641ed05dd16700a31823581ea 100644
--- a/src/tests/test_transactional_descriptor.cc
+++ b/src/tests/test_transactional_descriptor.cc
@@ -24,17 +24,17 @@ static void cleanup (void) {
     { int chk_r = env->close(env, 0); CKERR(chk_r); }
 }
 
-u_int32_t four_byte_desc = 101;
-u_int64_t eight_byte_desc = 10101;
+uint32_t four_byte_desc = 101;
+uint64_t eight_byte_desc = 10101;
 
 
 static void assert_desc_four (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(four_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == four_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == four_byte_desc);
 }
 static void assert_desc_eight (DB* db) {
     assert(db->descriptor->dbt.size == sizeof(eight_byte_desc));
-    assert(*(u_int32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
+    assert(*(uint32_t *)(db->descriptor->dbt.data) == eight_byte_desc);
 }
 
 static void run_test(void) {
diff --git a/src/tests/test_txn_close_before_prepare_commit.cc b/src/tests/test_txn_close_before_prepare_commit.cc
index 1b5e1f285d8371da28161fa33314273f62d19673..7c3383ada37d724d5264439056f7d5c9c4aaae53 100644
--- a/src/tests/test_txn_close_before_prepare_commit.cc
+++ b/src/tests/test_txn_close_before_prepare_commit.cc
@@ -43,7 +43,7 @@ test_txn_close_before_prepare_commit (void) {
     // Close before commit
     r = db->close(db, 0); assert(r == 0);
 
-    u_int8_t gid[DB_GID_SIZE];
+    uint8_t gid[DB_GID_SIZE];
     memset(gid, 1, DB_GID_SIZE);
     r = txn->prepare(txn, gid);   assert(r == 0);
     r = txn->commit(txn, 0); assert(r == 0);
diff --git a/src/tests/test_txn_nested2.cc b/src/tests/test_txn_nested2.cc
index 18fc891e2618c438844a19328a6b7e692d1f3388..74bc21dcd8e72168a414545e448b8de2cec6deef 100644
--- a/src/tests/test_txn_nested2.cc
+++ b/src/tests/test_txn_nested2.cc
@@ -14,18 +14,18 @@
 #define MAX_NEST MAX_TRANSACTION_RECORDS
 #define MAX_SIZE MAX_TRANSACTION_RECORDS
 
-u_int8_t valbufs[MAX_NEST][MAX_SIZE];
+uint8_t valbufs[MAX_NEST][MAX_SIZE];
 DBT vals        [MAX_NEST];
-u_int8_t keybuf [MAX_SIZE];
+uint8_t keybuf [MAX_SIZE];
 DBT key;
 DB_TXN   *txns   [MAX_NEST];
 DB_TXN   *txn_query;
 int which_expected;
 
 static void
-fillrandom(u_int8_t buf[MAX_SIZE], u_int32_t length) {
+fillrandom(uint8_t buf[MAX_SIZE], uint32_t length) {
     assert(length < MAX_SIZE);
-    u_int32_t i;
+    uint32_t i;
     for (i = 0; i < length; i++) {
         buf[i] = random() & 0xFF;
     } 
@@ -38,7 +38,7 @@ initialize_values (void) {
         fillrandom(valbufs[nest_level], nest_level);
         dbt_init(&vals[nest_level], &valbufs[nest_level][0], nest_level);
     }
-    u_int32_t len = random() % MAX_SIZE;
+    uint32_t len = random() % MAX_SIZE;
     fillrandom(keybuf, len);
     dbt_init(&key, &keybuf[0], len);
 }
diff --git a/src/tests/test_txn_nested3.cc b/src/tests/test_txn_nested3.cc
index 22a1ceb8129a8bd0f030444cb917fc20b1e781db..f4554b1a8d6b636f48599f6c6082238f4c5dc875 100644
--- a/src/tests/test_txn_nested3.cc
+++ b/src/tests/test_txn_nested3.cc
@@ -35,19 +35,19 @@ delete db
 
 enum { TYPE_DELETE = 1, TYPE_INSERT, TYPE_PLACEHOLDER };
 
-u_int8_t valbufs[MAX_NEST][MAX_SIZE];
+uint8_t valbufs[MAX_NEST][MAX_SIZE];
 DBT vals        [MAX_NEST];
-u_int8_t keybuf [MAX_SIZE];
+uint8_t keybuf [MAX_SIZE];
 DBT key;
-u_int8_t types  [MAX_NEST];
+uint8_t types  [MAX_NEST];
 DB_TXN   *txns   [MAX_NEST];
 DB_TXN   *txn_query;
 int which_expected;
 
 static void
-fillrandom(u_int8_t buf[MAX_SIZE], u_int32_t length) {
+fillrandom(uint8_t buf[MAX_SIZE], uint32_t length) {
     assert(length < MAX_SIZE);
-    u_int32_t i;
+    uint32_t i;
     for (i = 0; i < length; i++) {
         buf[i] = random() & 0xFF;
     } 
@@ -60,7 +60,7 @@ initialize_values (void) {
         fillrandom(valbufs[nest_level], nest_level);
         dbt_init(&vals[nest_level], &valbufs[nest_level][0], nest_level);
     }
-    u_int32_t len = random() % MAX_SIZE;
+    uint32_t len = random() % MAX_SIZE;
     fillrandom(keybuf, len);
     dbt_init(&key, &keybuf[0], len);
 }
@@ -103,7 +103,7 @@ close_db (void) {
 }
 
 static void
-verify_val(u_int8_t nest_level) {
+verify_val(uint8_t nest_level) {
     assert(nest_level < MAX_NEST);
     if (types[nest_level] == TYPE_PLACEHOLDER) {
         assert(nest_level > 0);
@@ -124,7 +124,7 @@ verify_val(u_int8_t nest_level) {
     }
 }
 
-static u_int8_t
+static uint8_t
 randomize_no_placeholder_type(void) {
     int r;
     r = random() % 2;
@@ -134,12 +134,12 @@ randomize_no_placeholder_type(void) {
         case 1:
             return TYPE_DELETE;
         default:
-            assert(FALSE);
+            assert(false);
 	    return 0;
     }
 }
 
-static u_int8_t
+static uint8_t
 randomize_type(void) {
     int r;
     do {
@@ -153,13 +153,13 @@ randomize_type(void) {
         case 2:
             return TYPE_PLACEHOLDER;
         default:
-            assert(FALSE);
+            assert(false);
 	    return 0;
     }
 }
 
 static void
-start_txn_and_maybe_insert_or_delete(u_int8_t nest) {
+start_txn_and_maybe_insert_or_delete(uint8_t nest) {
     int r;
     if (nest == 0) {
         types[nest] = randomize_no_placeholder_type();
@@ -185,7 +185,7 @@ start_txn_and_maybe_insert_or_delete(u_int8_t nest) {
             //Do Nothing.
             break;
         default:
-            assert(FALSE);
+            assert(false);
     }
     verify_val(nest);
 }
diff --git a/src/tests/test_txn_nested4.cc b/src/tests/test_txn_nested4.cc
index 963357aa231ab523fddc8841616035834c42d1bf..5c447f032355bb7fe379c58ab6e8f08b7faccc54 100644
--- a/src/tests/test_txn_nested4.cc
+++ b/src/tests/test_txn_nested4.cc
@@ -40,21 +40,21 @@ delete db
 
 enum { TYPE_DELETE = 1, TYPE_INSERT, TYPE_PLACEHOLDER };
 
-u_int8_t valbufs[MAX_NEST][MAX_SIZE];
+uint8_t valbufs[MAX_NEST][MAX_SIZE];
 DBT vals        [MAX_NEST];
-u_int8_t keybuf [MAX_SIZE];
+uint8_t keybuf [MAX_SIZE];
 DBT key;
-u_int8_t types  [MAX_NEST];
-u_int8_t currval[MAX_NEST];
+uint8_t types  [MAX_NEST];
+uint8_t currval[MAX_NEST];
 DB_TXN   *txns   [MAX_NEST];
 DB_TXN   *txn_query;
 DB_TXN   *patient_txn;
 int which_expected;
 
 static void
-fillrandom(u_int8_t buf[MAX_SIZE], u_int32_t length) {
+fillrandom(uint8_t buf[MAX_SIZE], uint32_t length) {
     assert(length < MAX_SIZE);
-    u_int32_t i;
+    uint32_t i;
     for (i = 0; i < length; i++) {
         buf[i] = random() & 0xFF;
     } 
@@ -67,7 +67,7 @@ initialize_values (void) {
         fillrandom(valbufs[nest_level], nest_level);
         dbt_init(&vals[nest_level], &valbufs[nest_level][0], nest_level);
     }
-    u_int32_t len = random() % MAX_SIZE;
+    uint32_t len = random() % MAX_SIZE;
     fillrandom(keybuf, len);
     dbt_init(&key, &keybuf[0], len);
 }
@@ -110,7 +110,7 @@ close_db (void) {
 }
 
 static void
-verify_val(u_int8_t nest_level) {
+verify_val(uint8_t nest_level) {
     assert(nest_level < MAX_NEST);
     if (nest_level>0) assert(txns[nest_level]);
     assert(types[nest_level] != TYPE_PLACEHOLDER);
@@ -130,7 +130,7 @@ verify_val(u_int8_t nest_level) {
     }
 }
 
-static u_int8_t
+static uint8_t
 randomize_no_placeholder_type(void) {
     int r;
     r = random() % 2;
@@ -140,12 +140,12 @@ randomize_no_placeholder_type(void) {
         case 1:
             return TYPE_DELETE;
         default:
-            assert(FALSE);
+            assert(false);
 	    return 0;
     }
 }
 
-static u_int8_t
+static uint8_t
 randomize_type(void) {
     int r;
     r = random() % 4;
@@ -158,13 +158,13 @@ randomize_type(void) {
         case 3:
             return TYPE_PLACEHOLDER;
         default:
-            assert(FALSE);
+            assert(false);
 	    return 0;
     }
 }
 
 static void
-maybe_insert_or_delete(u_int8_t nest, int type) {
+maybe_insert_or_delete(uint8_t nest, int type) {
     int r;
     if (nest>0) assert(txns[nest]);
     types[nest] = type;
@@ -183,17 +183,17 @@ maybe_insert_or_delete(u_int8_t nest, int type) {
             currval[nest] = currval[nest-1];
             break;
         default:
-            assert(FALSE);
+            assert(false);
     }
     verify_val(nest);
 }
 
 static void
-start_txn_and_maybe_insert_or_delete(u_int8_t nest) {
+start_txn_and_maybe_insert_or_delete(uint8_t nest) {
     int iteration;
     int r;
     for (iteration = 0; iteration < 4; iteration++) {
-        BOOL skip = FALSE;
+        bool skip = false;
         if (nest == 0) {
             types[nest] = randomize_no_placeholder_type();
             assert(types[nest] != TYPE_PLACEHOLDER);
@@ -205,7 +205,7 @@ start_txn_and_maybe_insert_or_delete(u_int8_t nest) {
                 types[nest] = randomize_type();
                 r = env->txn_begin(env, txns[nest-1], &txns[nest], 0);
                     CKERR(r);
-                if (types[nest] == TYPE_PLACEHOLDER) skip = TRUE;
+                if (types[nest] == TYPE_PLACEHOLDER) skip = true;
             }
             else {
                 types[nest] = randomize_no_placeholder_type();
@@ -287,7 +287,7 @@ test_txn_nested_jumble (int iteration) {
                 }
                 continue; //transaction is still alive
             default:
-                assert(FALSE);
+                assert(false);
         }
     }
     //All transactions that have touched this key are finished.
diff --git a/src/tests/test_txn_nested5.cc b/src/tests/test_txn_nested5.cc
index fbe7e4ee1e98e8d2c288b20973ea1e998ce324fc..882c3585b31d80ffa300a7325c6a02140002c9bc 100644
--- a/src/tests/test_txn_nested5.cc
+++ b/src/tests/test_txn_nested5.cc
@@ -41,24 +41,24 @@ delete db
 
 enum { TYPE_DELETE = 1, TYPE_INSERT, TYPE_PLACEHOLDER };
 
-BOOL top_is_delete;
-u_int8_t junkvalbuf[MAX_SIZE];
+bool top_is_delete;
+uint8_t junkvalbuf[MAX_SIZE];
 DBT junkval;
-u_int8_t valbufs[MAX_NEST][MAX_SIZE];
+uint8_t valbufs[MAX_NEST][MAX_SIZE];
 DBT vals        [MAX_NEST];
-u_int8_t keybuf [MAX_SIZE];
+uint8_t keybuf [MAX_SIZE];
 DBT key;
-u_int8_t types  [MAX_NEST];
-u_int8_t currval[MAX_NEST];
+uint8_t types  [MAX_NEST];
+uint8_t currval[MAX_NEST];
 DB_TXN   *txns   [MAX_NEST];
 DB_TXN   *txn_query;
 DB_TXN   *patient_txn;
 int which_expected;
 
 static void
-fillrandom(u_int8_t buf[MAX_SIZE], u_int32_t length) {
+fillrandom(uint8_t buf[MAX_SIZE], uint32_t length) {
     assert(length < MAX_SIZE);
-    u_int32_t i;
+    uint32_t i;
     for (i = 0; i < length; i++) {
         buf[i] = random() & 0xFF;
     } 
@@ -71,7 +71,7 @@ initialize_values (void) {
         fillrandom(valbufs[nest_level], nest_level);
         dbt_init(&vals[nest_level], &valbufs[nest_level][0], nest_level);
     }
-    u_int32_t len = random() % MAX_SIZE;
+    uint32_t len = random() % MAX_SIZE;
     fillrandom(keybuf, len);
     dbt_init(&key, &keybuf[0], len);
 
@@ -117,7 +117,7 @@ close_db (void) {
 }
 
 static void
-verify_val(u_int8_t nest_level) {
+verify_val(uint8_t nest_level) {
     assert(nest_level < MAX_NEST);
     if (nest_level>0) assert(txns[nest_level]);
     assert(types[nest_level] != TYPE_PLACEHOLDER);
@@ -130,16 +130,16 @@ verify_val(u_int8_t nest_level) {
         int idx = currval[nest_level];
         assert(observed_val.size == vals[idx].size);
         assert(memcmp(observed_val.data, vals[idx].data, vals[idx].size) == 0);
-        top_is_delete = FALSE;
+        top_is_delete = false;
     }
     else {
         assert(types[nest_level] == TYPE_DELETE);
         CKERR2(r, DB_NOTFOUND);
-        top_is_delete = TRUE;
+        top_is_delete = true;
     }
 }
 
-static u_int8_t
+static uint8_t
 randomize_no_placeholder_type(void) {
     int r;
     r = random() % 2;
@@ -149,12 +149,12 @@ randomize_no_placeholder_type(void) {
         case 1:
             return TYPE_DELETE;
         default:
-            assert(FALSE);
+            assert(false);
 	    return 0;
     }
 }
 
-static u_int8_t
+static uint8_t
 randomize_type(void) {
     int r;
     r = random() % 4;
@@ -167,7 +167,7 @@ randomize_type(void) {
         case 3:
             return TYPE_PLACEHOLDER;
         default:
-            assert(FALSE);
+            assert(false);
 	    return 0;
     }
 }
@@ -190,29 +190,29 @@ maybe_insert_or_delete(uint8_t nest, int type) {
             }
             r = db->put(db, txns[nest], &key, &junkval, DB_NOOVERWRITE_NO_ERROR);
                 CKERR(r);
-            top_is_delete = FALSE;
+            top_is_delete = false;
             break;
         case TYPE_DELETE:
             r = db->del(db, txns[nest], &key, DB_DELETE_ANY);
                 CKERR(r);
-            top_is_delete = TRUE;
+            top_is_delete = true;
             break;
         case TYPE_PLACEHOLDER:
             types[nest] = types[nest - 1];
             currval[nest] = currval[nest-1];
             break;
         default:
-            assert(FALSE);
+            assert(false);
     }
     verify_val(nest);
 }
 
 static void
-start_txn_and_maybe_insert_or_delete(u_int8_t nest) {
+start_txn_and_maybe_insert_or_delete(uint8_t nest) {
     int iteration;
     int r;
     for (iteration = 0; iteration < 4; iteration++) {
-        BOOL skip = FALSE;
+        bool skip = false;
         if (nest == 0) {
             types[nest] = randomize_no_placeholder_type();
             assert(types[nest] != TYPE_PLACEHOLDER);
@@ -224,7 +224,7 @@ start_txn_and_maybe_insert_or_delete(u_int8_t nest) {
                 types[nest] = randomize_type();
                 r = env->txn_begin(env, txns[nest-1], &txns[nest], 0);
                     CKERR(r);
-                if (types[nest] == TYPE_PLACEHOLDER) skip = TRUE;
+                if (types[nest] == TYPE_PLACEHOLDER) skip = true;
             }
             else {
                 types[nest] = randomize_no_placeholder_type();
@@ -306,7 +306,7 @@ test_txn_nested_jumble (int iteration) {
                 }
                 continue; //transaction is still alive
             default:
-                assert(FALSE);
+                assert(false);
         }
     }
     //All transactions that have touched this key are finished.
diff --git a/src/tests/test_update_abort_works.cc b/src/tests/test_update_abort_works.cc
index 8f71382658ed88122a2c488f1a7eb5799882989e..5d8508ed01f5e354a5543885678fd37127f8953f 100644
--- a/src/tests/test_update_abort_works.cc
+++ b/src/tests/test_update_abort_works.cc
@@ -109,7 +109,7 @@ static int do_verify_results(DB_TXN *txn, DB *db, void (*check_val)(const unsign
 }
 
 
-static void run_test(BOOL do_close) {
+static void run_test(bool do_close) {
     setup();
 
     DB *db;
@@ -151,8 +151,8 @@ static void run_test(BOOL do_close) {
 
 int test_main(int argc, char * const argv[]) {
     parse_args(argc, argv);
-    run_test(FALSE);
-    run_test(TRUE);
+    run_test(false);
+    run_test(true);
 
     return 0;
 }
diff --git a/src/tests/test_update_broadcast_abort_works.cc b/src/tests/test_update_broadcast_abort_works.cc
index 4153fe1de9316af5ca29fe09f71df88f8e3536ad..d8275098e689f674b72d00b612aa3fa486d39677 100644
--- a/src/tests/test_update_broadcast_abort_works.cc
+++ b/src/tests/test_update_broadcast_abort_works.cc
@@ -66,7 +66,7 @@ static int do_inserts(DB_TXN *txn, DB *db) {
     return r;
 }
 
-static int do_updates(DB_TXN *txn, DB *db, u_int32_t flags) {
+static int do_updates(DB_TXN *txn, DB *db, uint32_t flags) {
     DBT extra;
     DBT *extrap = dbt_init(&extra, NULL, 0);
     int r = db->update_broadcast(db, txn, extrap, flags); CKERR(r);
@@ -96,9 +96,9 @@ static int do_verify_results(DB_TXN *txn, DB *db, void (*check_val)(const unsign
     return r;
 }
 
-static void run_test(BOOL is_resetting) {
+static void run_test(bool is_resetting) {
     DB *db;
-    u_int32_t update_flags = is_resetting ? DB_IS_RESETTING_OP : 0;
+    uint32_t update_flags = is_resetting ? DB_IS_RESETTING_OP : 0;
 
     IN_TXN_COMMIT(env, NULL, txn_1, 0, {
             { int chk_r = db_create(&db, env, 0); CKERR(chk_r); }
@@ -141,8 +141,8 @@ static void run_test(BOOL is_resetting) {
 int test_main(int argc, char * const argv[]) {
     parse_args(argc, argv);
     setup();
-    run_test(TRUE);
-    run_test(FALSE);
+    run_test(true);
+    run_test(false);
     cleanup();
 
     return 0;
diff --git a/src/tests/test_update_broadcast_calls_back.cc b/src/tests/test_update_broadcast_calls_back.cc
index 890a25a6a8484a1a7c163da1f1461bd69482f725..6139b2924582021cae184a2cdbc6fda10a968fe8 100644
--- a/src/tests/test_update_broadcast_calls_back.cc
+++ b/src/tests/test_update_broadcast_calls_back.cc
@@ -43,9 +43,9 @@ static void cleanup (void) {
     { int chk_r = env->close(env, 0); CKERR(chk_r); }
 }
 
-static void run_test(BOOL is_resetting) {
+static void run_test(bool is_resetting) {
     DB *db;
-    u_int32_t update_flags = is_resetting ? DB_IS_RESETTING_OP : 0;
+    uint32_t update_flags = is_resetting ? DB_IS_RESETTING_OP : 0;
     for (unsigned int i = 0;
          i < (sizeof(updates_called) / sizeof(updates_called[0])); ++i) {
         updates_called[i] = 0;
@@ -96,8 +96,8 @@ static void run_test(BOOL is_resetting) {
 int test_main (int argc, char * const argv[]) {
     parse_args(argc, argv);
     setup();
-    run_test(TRUE);
-    run_test(FALSE);
+    run_test(true);
+    run_test(false);
     cleanup();
     return 0;
 }
diff --git a/src/tests/test_update_broadcast_can_delete_elements.cc b/src/tests/test_update_broadcast_can_delete_elements.cc
index bffcd2716b2daf9f8e0b94936f4eb7058b851e15..84a0f13cf12bcb54e7cde6934abbbf1b22398490 100644
--- a/src/tests/test_update_broadcast_can_delete_elements.cc
+++ b/src/tests/test_update_broadcast_can_delete_elements.cc
@@ -59,7 +59,7 @@ static int do_inserts(DB_TXN *txn, DB *db) {
     return r;
 }
 
-static int do_updates(DB_TXN *txn, DB *db, u_int32_t flags) {
+static int do_updates(DB_TXN *txn, DB *db, uint32_t flags) {
     DBT extra;
     DBT *extrap = dbt_init(&extra, NULL, 0);
     int r = db->update_broadcast(db, txn, extrap, flags); CKERR(r);
@@ -70,7 +70,7 @@ static void chk_original(const unsigned int k, const unsigned int v) {
     assert(v == _v(k));
 }
 
-static int do_verify_results(DB_TXN *txn, DB *db, void (*check_val)(const unsigned int k, const unsigned int v), BOOL already_deleted) {
+static int do_verify_results(DB_TXN *txn, DB *db, void (*check_val)(const unsigned int k, const unsigned int v), bool already_deleted) {
     int r = 0;
     DBT key, val;
     unsigned int i, *vp;
@@ -91,9 +91,9 @@ static int do_verify_results(DB_TXN *txn, DB *db, void (*check_val)(const unsign
     return r;
 }
 
-static void run_test(BOOL is_resetting) {
+static void run_test(bool is_resetting) {
     DB *db;
-    u_int32_t update_flags = is_resetting ? DB_IS_RESETTING_OP : 0;
+    uint32_t update_flags = is_resetting ? DB_IS_RESETTING_OP : 0;
 
     IN_TXN_COMMIT(env, NULL, txn_1, 0, {
             { int chk_r = db_create(&db, env, 0); CKERR(chk_r); }
@@ -102,7 +102,7 @@ static void run_test(BOOL is_resetting) {
             { int chk_r = do_inserts(txn_1, db); CKERR(chk_r); }
 
             IN_TXN_COMMIT(env, txn_1, txn_11, 0, {
-                    { int chk_r = do_verify_results(txn_11, db, chk_original, FALSE); CKERR(chk_r); }
+                    { int chk_r = do_verify_results(txn_11, db, chk_original, false); CKERR(chk_r); }
                 });
         });
 
@@ -110,12 +110,12 @@ static void run_test(BOOL is_resetting) {
             { int chk_r = do_updates(txn_2, db, update_flags); CKERR(chk_r); }
 
             IN_TXN_COMMIT(env, txn_2, txn_21, 0, {
-                    { int chk_r = do_verify_results(txn_21, db, chk_original, TRUE); CKERR(chk_r); }
+                    { int chk_r = do_verify_results(txn_21, db, chk_original, true); CKERR(chk_r); }
                 });
         });
 
     IN_TXN_COMMIT(env, NULL, txn_3, 0, {
-            { int chk_r = do_verify_results(txn_3, db, chk_original, FALSE); CKERR(chk_r); }
+            { int chk_r = do_verify_results(txn_3, db, chk_original, false); CKERR(chk_r); }
         });
 
     { int chk_r = db->close(db, 0); CKERR(chk_r); }
@@ -125,8 +125,8 @@ static void run_test(BOOL is_resetting) {
 int test_main(int argc, char * const argv[]) {
     parse_args(argc, argv);
     setup();
-    run_test(TRUE);
-    run_test(FALSE);
+    run_test(true);
+    run_test(false);
     cleanup();
 
     return 0;
diff --git a/src/tests/test_update_broadcast_changes_values.cc b/src/tests/test_update_broadcast_changes_values.cc
index 1fbcfc7c47f45e5207c0ecf2e7dfd37107634511..18350d72b51000f8171e136745ed315f4844b84c 100644
--- a/src/tests/test_update_broadcast_changes_values.cc
+++ b/src/tests/test_update_broadcast_changes_values.cc
@@ -66,7 +66,7 @@ static int do_inserts(DB_TXN *txn, DB *db) {
     return r;
 }
 
-static int do_updates(DB_TXN *txn, DB *db, u_int32_t flags) {
+static int do_updates(DB_TXN *txn, DB *db, uint32_t flags) {
     DBT extra;
     DBT *extrap = dbt_init(&extra, NULL, 0);
     int r = db->update_broadcast(db, txn, extrap, flags); CKERR(r);
@@ -88,9 +88,9 @@ static int do_verify_results(DB_TXN *txn, DB *db) {
     return r;
 }
 
-static void run_test(BOOL is_resetting) {
+static void run_test(bool is_resetting) {
     DB *db;
-    u_int32_t update_flags = is_resetting ? DB_IS_RESETTING_OP : 0;
+    uint32_t update_flags = is_resetting ? DB_IS_RESETTING_OP : 0;
 
     IN_TXN_COMMIT(env, NULL, txn_1, 0, {
             { int chk_r = db_create(&db, env, 0); CKERR(chk_r); }
@@ -113,8 +113,8 @@ static void run_test(BOOL is_resetting) {
 int test_main (int argc, char * const argv[]) {
     parse_args(argc, argv);
     setup();
-    run_test(TRUE);
-    run_test(FALSE);
+    run_test(true);
+    run_test(false);
     cleanup();
 
     return 0;
diff --git a/src/tests/test_update_broadcast_indexer.cc b/src/tests/test_update_broadcast_indexer.cc
index 843c04fbf28d7353fc745f39bc24a53001e28757..7578e3bd283c35a53426601eaee78ec3fa167337 100644
--- a/src/tests/test_update_broadcast_indexer.cc
+++ b/src/tests/test_update_broadcast_indexer.cc
@@ -44,9 +44,9 @@ static int generate_row_for_put(
     const DBT *UU(src_val)
     ) 
 {
-    u_int8_t src_val_data;
+    uint8_t src_val_data;
     assert(src_val->size == 1);
-    src_val_data = *(u_int8_t *)src_val->data;
+    src_val_data = *(uint8_t *)src_val->data;
     assert(src_val_data == 100);
     dest_key->size=0;
     dest_val->size=0;
@@ -73,9 +73,9 @@ static void run_test(void) {
     DB* hot_index_db = NULL;
     DB_INDEXER* indexer = NULL;
     DBT key, val;
-    u_int32_t mult_db_flags = 0;
-    u_int8_t key_data = 0;
-    u_int8_t val_data = 0;
+    uint32_t mult_db_flags = 0;
+    uint8_t key_data = 0;
+    uint8_t val_data = 0;
     DB_TXN* txn_read1 = NULL;
     DB_TXN* txn_read2 = NULL;
     DB_TXN* txn_read3 = NULL;
@@ -87,8 +87,8 @@ static void run_test(void) {
         });
 
 
-    dbt_init(&key,&key_data,sizeof(u_int8_t));
-    dbt_init(&val,&val_data,sizeof(u_int8_t));
+    dbt_init(&key,&key_data,sizeof(uint8_t));
+    dbt_init(&val,&val_data,sizeof(uint8_t));
 
     val_data = 1;
     IN_TXN_COMMIT(env, NULL, txn_put1, 0, {
diff --git a/src/tests/test_update_broadcast_loader.cc b/src/tests/test_update_broadcast_loader.cc
index f5ef922b92146973c1d196f449392450d5225bc3..47eebbab076695e93d887797475d49e0eb9e6870 100644
--- a/src/tests/test_update_broadcast_loader.cc
+++ b/src/tests/test_update_broadcast_loader.cc
@@ -44,9 +44,9 @@ static int generate_row_for_put(
     const DBT *UU(src_val)
     ) 
 {
-    u_int8_t src_val_data;
+    uint8_t src_val_data;
     assert(src_val->size == 1);
-    src_val_data = *(u_int8_t *)src_val->data;
+    src_val_data = *(uint8_t *)src_val->data;
     assert(src_val_data == 100);
     dest_key->size=0;
     dest_val->size=0;
@@ -72,10 +72,10 @@ static void run_test(void) {
     DB* db = NULL;
     DB_LOADER* loader = NULL;
     DBT key, val;
-    u_int32_t mult_db_flags = 0;
-    u_int32_t mult_dbt_flags = DB_DBT_REALLOC;
-    u_int8_t key_data = 0;
-    u_int8_t val_data = 0;
+    uint32_t mult_db_flags = 0;
+    uint32_t mult_dbt_flags = DB_DBT_REALLOC;
+    uint8_t key_data = 0;
+    uint8_t val_data = 0;
     
 
     IN_TXN_COMMIT(env, NULL, txn_create, 0, {
@@ -84,8 +84,8 @@ static void run_test(void) {
         });
 
 
-    dbt_init(&key,&key_data,sizeof(u_int8_t));
-    dbt_init(&val,&val_data,sizeof(u_int8_t));
+    dbt_init(&key,&key_data,sizeof(uint8_t));
+    dbt_init(&val,&val_data,sizeof(uint8_t));
 
     val_data = 1;
 
diff --git a/src/tests/test_update_broadcast_nested_updates.cc b/src/tests/test_update_broadcast_nested_updates.cc
index 2497d4320d690b6fa09b32aad1225aaad65a0ce2..a85082a77558790c5b6892702097ff7eb4008f7c 100644
--- a/src/tests/test_update_broadcast_nested_updates.cc
+++ b/src/tests/test_update_broadcast_nested_updates.cc
@@ -66,14 +66,14 @@ static int do_inserts(DB_TXN *txn, DB *db) {
     return r;
 }
 
-static int do_updates(DB_TXN *txn, DB *db, u_int32_t flags) {
+static int do_updates(DB_TXN *txn, DB *db, uint32_t flags) {
     DBT extra;
     DBT *extrap = dbt_init(&extra, NULL, 0);
     int r = db->update_broadcast(db, txn, extrap, flags);
     return r;
 }
 
-static int do_verify_results(DB_TXN *txn, DB *db, BOOL updated_twice) {
+static int do_verify_results(DB_TXN *txn, DB *db, bool updated_twice) {
     int r = 0;
     DBT key, val;
     unsigned int i, *vp;
@@ -107,21 +107,21 @@ int test_main (int argc, char * const argv[]) {
 
     IN_TXN_COMMIT(env, NULL, txn_2, 0, {
             { int chk_r = do_updates(txn_2, db, 0); CKERR(chk_r); }
-            { int chk_r = do_verify_results(txn_2, db, FALSE); CKERR(chk_r); }
+            { int chk_r = do_verify_results(txn_2, db, false); CKERR(chk_r); }
 
             IN_TXN_COMMIT(env, txn_2, txn_21, 0, {
                     { int chk_r = do_updates(txn_21, db, 0); CKERR(chk_r); }
-                    { int chk_r = do_verify_results(txn_21, db, TRUE); CKERR(chk_r); }
+                    { int chk_r = do_verify_results(txn_21, db, true); CKERR(chk_r); }
                 });
             IN_TXN_COMMIT(env, txn_2, txn_22, 0, {
                     { int chk_r = do_updates(txn_22, db, DB_IS_RESETTING_OP); CKERR2(chk_r, EINVAL); }
                 });
 
-            { int chk_r = do_verify_results(txn_2, db, TRUE); CKERR(chk_r); }
+            { int chk_r = do_verify_results(txn_2, db, true); CKERR(chk_r); }
         });
 
     IN_TXN_COMMIT(env, NULL, txn_3, 0, {
-            { int chk_r = do_verify_results(txn_3, db, TRUE); CKERR(chk_r); }
+            { int chk_r = do_verify_results(txn_3, db, true); CKERR(chk_r); }
         });
 
     { int chk_r = db->close(db, 0); CKERR(chk_r); }
diff --git a/src/tests/test_update_broadcast_previously_deleted.cc b/src/tests/test_update_broadcast_previously_deleted.cc
index 493fbbfb10632d6efc61ec2c49947c06a27f140c..f206a12050b5179d0b22765e9d1f38ebde8dd8e1 100644
--- a/src/tests/test_update_broadcast_previously_deleted.cc
+++ b/src/tests/test_update_broadcast_previously_deleted.cc
@@ -84,7 +84,7 @@ static int do_deletes(DB_TXN *txn, DB *db) {
     return r;
 }
 
-static int do_updates(DB_TXN *txn, DB *db, u_int32_t flags) {
+static int do_updates(DB_TXN *txn, DB *db, uint32_t flags) {
     DBT extra;
     DBT *extrap = dbt_init(&extra, NULL, 0);
     int r = db->update_broadcast(db, txn, extrap, flags); CKERR(r);
@@ -124,9 +124,9 @@ static int do_verify_results(DB_TXN *txn, DB *db, void (*check_val)(const unsign
     return r;
 }
 
-static void run_test(BOOL is_resetting) {
+static void run_test(bool is_resetting) {
     DB *db;
-    u_int32_t update_flags = is_resetting ? DB_IS_RESETTING_OP : 0;
+    uint32_t update_flags = is_resetting ? DB_IS_RESETTING_OP : 0;
 
     IN_TXN_COMMIT(env, NULL, txn_1, 0, {
             { int chk_r = db_create(&db, env, 0); CKERR(chk_r); }
@@ -155,8 +155,8 @@ static void run_test(BOOL is_resetting) {
 int test_main(int argc, char * const argv[]) {
     parse_args(argc, argv);
     setup();
-    run_test(TRUE);
-    run_test(FALSE);
+    run_test(true);
+    run_test(false);
     cleanup();
 
     return 0;
diff --git a/src/tests/test_update_broadcast_update_fun_has_choices.cc b/src/tests/test_update_broadcast_update_fun_has_choices.cc
index 9f61ad058866490f78f5500f88431af1adb0307d..5bb409605607547b382f009830d190cb5a6fd5df 100644
--- a/src/tests/test_update_broadcast_update_fun_has_choices.cc
+++ b/src/tests/test_update_broadcast_update_fun_has_choices.cc
@@ -14,9 +14,9 @@ DB_ENV *env;
 
 const unsigned int NUM_KEYS = 1000;
 
-static inline BOOL should_insert(const unsigned int i) { return i % 2 == 0; }
-static inline BOOL should_update(const unsigned int i) { return i % 3 == 0; }
-static inline BOOL should_delete(const unsigned int i) { return (i % 5 == 0) && (i % 3 != 0); }
+static inline bool should_insert(const unsigned int i) { return i % 2 == 0; }
+static inline bool should_update(const unsigned int i) { return i % 3 == 0; }
+static inline bool should_delete(const unsigned int i) { return (i % 5 == 0) && (i % 3 != 0); }
 
 static inline unsigned int _v(const unsigned int i) { return 10 - i; }
 static inline unsigned int _e(const unsigned int i) { return i + 4; }
@@ -78,7 +78,7 @@ static int do_inserts(DB_TXN *txn, DB *db) {
     return r;
 }
 
-static int do_updates(DB_TXN *txn, DB *db, u_int32_t flags) {
+static int do_updates(DB_TXN *txn, DB *db, uint32_t flags) {
     DBT extra;
     DBT *extrap = dbt_init(&extra, NULL, 0);
     int r = db->update_broadcast(db, txn, extrap, flags); CKERR(r);
@@ -110,9 +110,9 @@ static int do_verify_results(DB_TXN *txn, DB *db) {
     return r;
 }
 
-static void run_test(BOOL is_resetting) {
+static void run_test(bool is_resetting) {
     DB *db;
-    u_int32_t update_flags = is_resetting ? DB_IS_RESETTING_OP : 0;
+    uint32_t update_flags = is_resetting ? DB_IS_RESETTING_OP : 0;
 
     IN_TXN_COMMIT(env, NULL, txn_1, 0, {
             { int chk_r = db_create(&db, env, 0); CKERR(chk_r); }
@@ -135,8 +135,8 @@ static void run_test(BOOL is_resetting) {
 int test_main (int argc, char * const argv[]) {
     parse_args(argc, argv);
     setup();
-    run_test(TRUE);
-    run_test(FALSE);
+    run_test(true);
+    run_test(false);
     cleanup();
 
     return 0;
diff --git a/src/tests/test_update_broadcast_with_empty_table.cc b/src/tests/test_update_broadcast_with_empty_table.cc
index 541faaeb11b78ebc94ca3faeddd7e07c69e8d43a..372685ff45eaa74b8364e92949016a30099ba841 100644
--- a/src/tests/test_update_broadcast_with_empty_table.cc
+++ b/src/tests/test_update_broadcast_with_empty_table.cc
@@ -33,16 +33,16 @@ static void cleanup (void) {
     { int chk_r = env->close(env, 0); CKERR(chk_r); }
 }
 
-static int do_updates(DB_TXN *txn, DB *db, u_int32_t flags) {
+static int do_updates(DB_TXN *txn, DB *db, uint32_t flags) {
     DBT extra;
     DBT *extrap = dbt_init(&extra, NULL, 0);
     int r = db->update_broadcast(db, txn, extrap, flags); CKERR(r);
     return r;
 }
 
-static void run_test(BOOL is_resetting, BOOL prelock) {
+static void run_test(bool is_resetting, bool prelock) {
     DB *db;
-    u_int32_t update_flags = is_resetting ? DB_IS_RESETTING_OP : 0;
+    uint32_t update_flags = is_resetting ? DB_IS_RESETTING_OP : 0;
 
     IN_TXN_COMMIT(env, NULL, txn_1, 0, {
             { int chk_r = db_create(&db, env, 0); CKERR(chk_r); }
@@ -64,10 +64,10 @@ static void run_test(BOOL is_resetting, BOOL prelock) {
 int test_main(int argc, char * const argv[]) {
     parse_args(argc, argv);
     setup();
-    run_test(TRUE,TRUE);
-    run_test(FALSE,TRUE);
-    run_test(TRUE,FALSE);
-    run_test(FALSE,FALSE);
+    run_test(true,true);
+    run_test(false,true);
+    run_test(true,false);
+    run_test(false,false);
     cleanup();
 
     return 0;
diff --git a/src/tests/test_update_can_delete_elements.cc b/src/tests/test_update_can_delete_elements.cc
index 3d5d29e0617cbfc2354fe5059908f4a976afdfa6..51489926bdb461444374ea4d86e11f38acf67abf 100644
--- a/src/tests/test_update_can_delete_elements.cc
+++ b/src/tests/test_update_can_delete_elements.cc
@@ -77,7 +77,7 @@ static void chk_original(const unsigned int k, const unsigned int v) {
     assert(v == _v(k));
 }
 
-static int do_verify_results(DB_TXN *txn, DB *db, void (*check_val)(const unsigned int k, const unsigned int v), BOOL already_deleted) {
+static int do_verify_results(DB_TXN *txn, DB *db, void (*check_val)(const unsigned int k, const unsigned int v), bool already_deleted) {
     int r = 0;
     DBT key, val;
     unsigned int i, *vp;
@@ -111,7 +111,7 @@ int test_main(int argc, char * const argv[]) {
             { int chk_r = do_inserts(txn_1, db); CKERR(chk_r); }
 
             IN_TXN_COMMIT(env, txn_1, txn_11, 0, {
-                    { int chk_r = do_verify_results(txn_11, db, chk_original, FALSE); CKERR(chk_r); }
+                    { int chk_r = do_verify_results(txn_11, db, chk_original, false); CKERR(chk_r); }
                 });
         });
 
@@ -119,12 +119,12 @@ int test_main(int argc, char * const argv[]) {
             { int chk_r = do_updates(txn_2, db); CKERR(chk_r); }
 
             IN_TXN_COMMIT(env, txn_2, txn_21, 0, {
-                    { int chk_r = do_verify_results(txn_21, db, chk_original, TRUE); CKERR(chk_r); }
+                    { int chk_r = do_verify_results(txn_21, db, chk_original, true); CKERR(chk_r); }
                 });
         });
 
     IN_TXN_COMMIT(env, NULL, txn_3, 0, {
-            { int chk_r = do_verify_results(txn_3, db, chk_original, FALSE); CKERR(chk_r); }
+            { int chk_r = do_verify_results(txn_3, db, chk_original, false); CKERR(chk_r); }
         });
 
     { int chk_r = db->close(db, 0); CKERR(chk_r); }
diff --git a/src/tests/test_update_nested_updates.cc b/src/tests/test_update_nested_updates.cc
index 12015bcb096db662fa9fc279e23ce66aae132743..b45c8dd9de5b3f2c2e6b13a17c8f6697235c88ca 100644
--- a/src/tests/test_update_nested_updates.cc
+++ b/src/tests/test_update_nested_updates.cc
@@ -81,7 +81,7 @@ static int do_updates(DB_TXN *txn, DB *db) {
     return r;
 }
 
-static int do_verify_results(DB_TXN *txn, DB *db, BOOL updated_twice) {
+static int do_verify_results(DB_TXN *txn, DB *db, bool updated_twice) {
     int r = 0;
     DBT key, val;
     unsigned int i, *vp;
@@ -119,18 +119,18 @@ int test_main (int argc, char * const argv[]) {
 
     IN_TXN_COMMIT(env, NULL, txn_2, 0, {
             { int chk_r = do_updates(txn_2, db); CKERR(chk_r); }
-            { int chk_r = do_verify_results(txn_2, db, FALSE); CKERR(chk_r); }
+            { int chk_r = do_verify_results(txn_2, db, false); CKERR(chk_r); }
 
             IN_TXN_COMMIT(env, txn_2, txn_21, 0, {
                     { int chk_r = do_updates(txn_21, db); CKERR(chk_r); }
-                    { int chk_r = do_verify_results(txn_21, db, TRUE); CKERR(chk_r); }
+                    { int chk_r = do_verify_results(txn_21, db, true); CKERR(chk_r); }
                 });
 
-            { int chk_r = do_verify_results(txn_2, db, TRUE); CKERR(chk_r); }
+            { int chk_r = do_verify_results(txn_2, db, true); CKERR(chk_r); }
         });
 
     IN_TXN_COMMIT(env, NULL, txn_3, 0, {
-            { int chk_r = do_verify_results(txn_3, db, TRUE); CKERR(chk_r); }
+            { int chk_r = do_verify_results(txn_3, db, true); CKERR(chk_r); }
         });
 
     { int chk_r = db->close(db, 0); CKERR(chk_r); }
diff --git a/src/tests/test_update_nonexistent_keys.cc b/src/tests/test_update_nonexistent_keys.cc
index 192fcac7dbd97ec9ed6dfd6e63983402d3eb04b2..8bd07b1d9acb9aa334d98239b952d2ec604b68e9 100644
--- a/src/tests/test_update_nonexistent_keys.cc
+++ b/src/tests/test_update_nonexistent_keys.cc
@@ -16,8 +16,8 @@ DB_ENV *env;
 const int to_insert[] = { 0, 0, 1, 1, 1, 0, 0, 1, 1, 1 };
 const int to_update[] = { 0, 1, 1, 1, 0, 0, 1, 0, 1, 0 };
 
-static inline BOOL should_insert(const unsigned int i) { return to_insert[i]; }
-static inline BOOL should_update(const unsigned int i) { return to_update[i]; }
+static inline bool should_insert(const unsigned int i) { return to_insert[i]; }
+static inline bool should_update(const unsigned int i) { return to_update[i]; }
 static inline unsigned int _v(const unsigned int i) { return 10 - i; }
 static inline unsigned int _e(const unsigned int i) { return i + 4; }
 static inline unsigned int _u(const unsigned int v, const unsigned int e) { return v * v * e; }
@@ -105,7 +105,7 @@ static void chk_original(const unsigned int k, const unsigned int v) {
     assert(v == _v(k));
 }
 
-static int do_verify_results(DB_TXN *txn, DB *db, void (*check_val)(const unsigned int k, const unsigned int v), BOOL after_update) {
+static int do_verify_results(DB_TXN *txn, DB *db, void (*check_val)(const unsigned int k, const unsigned int v), bool after_update) {
     int r = 0;
     DBT key, val;
     unsigned int i, v;
@@ -140,7 +140,7 @@ int test_main (int argc, char * const argv[]) {
             { int chk_r = do_inserts(txn_1, db); CKERR(chk_r); }
 
             IN_TXN_ABORT(env, txn_1, txn_11, 0, {
-                    { int chk_r = do_verify_results(txn_11, db, chk_original, FALSE); CKERR(chk_r); }
+                    { int chk_r = do_verify_results(txn_11, db, chk_original, false); CKERR(chk_r); }
                 });
         });
 
@@ -149,7 +149,7 @@ int test_main (int argc, char * const argv[]) {
         });
 
     IN_TXN_COMMIT(env, NULL, txn_3, 0, {
-            { int chk_r = do_verify_results(txn_3, db, chk_updated, TRUE); CKERR(chk_r); }
+            { int chk_r = do_verify_results(txn_3, db, chk_updated, true); CKERR(chk_r); }
         });
 
     { int chk_r = db->close(db, 0); CKERR(chk_r); }
diff --git a/src/tests/test_update_previously_deleted.cc b/src/tests/test_update_previously_deleted.cc
index 2c1ab7e8ef7f2657bf3d77eb915895ae25d2f94b..94eec9b0ce9b9f55c4542bdb1628c90b13c1213a 100644
--- a/src/tests/test_update_previously_deleted.cc
+++ b/src/tests/test_update_previously_deleted.cc
@@ -113,7 +113,7 @@ static void chk_original(const unsigned int k, const unsigned int v) {
     assert(v == _v(k));
 }
 
-static int do_verify_results(DB_TXN *txn, DB *db, void (*check_val)(const unsigned int k, const unsigned int v), BOOL already_updated) {
+static int do_verify_results(DB_TXN *txn, DB *db, void (*check_val)(const unsigned int k, const unsigned int v), bool already_updated) {
     int r = 0;
     DBT key, val;
     unsigned int i, *vp;
@@ -149,7 +149,7 @@ int test_main(int argc, char * const argv[]) {
             { int chk_r = do_deletes(txn_1, db); CKERR(chk_r); }
 
             IN_TXN_COMMIT(env, txn_1, txn_11, 0, {
-                    { int chk_r = do_verify_results(txn_11, db, chk_original, FALSE); CKERR(chk_r); }
+                    { int chk_r = do_verify_results(txn_11, db, chk_original, false); CKERR(chk_r); }
                 });
         });
 
@@ -158,7 +158,7 @@ int test_main(int argc, char * const argv[]) {
         });
 
     IN_TXN_COMMIT(env, NULL, txn_3, 0, {
-            { int chk_r = do_verify_results(txn_3, db, chk_updated, TRUE); CKERR(chk_r); }
+            { int chk_r = do_verify_results(txn_3, db, chk_updated, true); CKERR(chk_r); }
         });
 
     { int chk_r = db->close(db, 0); CKERR(chk_r); }
diff --git a/src/tests/test_update_stress.cc b/src/tests/test_update_stress.cc
index 8295cfffc4cde3bf14eaad06447a48623e25f38b..c17d94d54c7d6dbb55dc35a14f5748b194eedc3d 100644
--- a/src/tests/test_update_stress.cc
+++ b/src/tests/test_update_stress.cc
@@ -14,7 +14,7 @@ DB_ENV *env;
 
 const unsigned int NUM_KEYS = 10000000;
 
-static inline BOOL should_update(const unsigned int i) { return i % 3 == 0; }
+static inline bool should_update(const unsigned int i) { return i % 3 == 0; }
 static inline unsigned int _v(const unsigned int i) { return 10 - i; }
 static inline unsigned int _e(const unsigned int i) { return i + 4; }
 static inline unsigned int _u(const unsigned int v, const unsigned int e) { return v + 2 * e; }
diff --git a/src/tests/test_update_txn_snapshot_works_correctly_with_deletes.cc b/src/tests/test_update_txn_snapshot_works_correctly_with_deletes.cc
index 9eea56745408baff5aa2f63da4052c3b397b4ef2..2f768eb30a612b74ff9575595afb7383d26e0335 100644
--- a/src/tests/test_update_txn_snapshot_works_correctly_with_deletes.cc
+++ b/src/tests/test_update_txn_snapshot_works_correctly_with_deletes.cc
@@ -73,7 +73,7 @@ static void chk_original(const unsigned int k, const unsigned int v) {
     assert(v == _v(k));
 }
 
-static int do_verify_results(DB_TXN *txn, DB *db, void (*check_val)(const unsigned int k, const unsigned int v), BOOL already_deleted) {
+static int do_verify_results(DB_TXN *txn, DB *db, void (*check_val)(const unsigned int k, const unsigned int v), bool already_deleted) {
     int r = 0;
     DBT key, val;
     unsigned int i, *vp;
@@ -107,24 +107,24 @@ int test_main(int argc, char * const argv[]) {
             { int chk_r = do_inserts(txn_1, db); CKERR(chk_r); }
 
             IN_TXN_COMMIT(env, txn_1, txn_11, 0, {
-                    { int chk_r = do_verify_results(txn_11, db, chk_original, FALSE); CKERR(chk_r); }
+                    { int chk_r = do_verify_results(txn_11, db, chk_original, false); CKERR(chk_r); }
                 });
         });
 
     {
         DB_TXN *txn_2, *txn_3;
         { int chk_r = env->txn_begin(env, NULL, &txn_2, DB_TXN_SNAPSHOT); CKERR(chk_r); }
-        { int chk_r = do_verify_results(txn_2, db, chk_original, FALSE); CKERR(chk_r); }
+        { int chk_r = do_verify_results(txn_2, db, chk_original, false); CKERR(chk_r); }
         { int chk_r = env->txn_begin(env, NULL, &txn_3, 0); CKERR(chk_r); }
         { int chk_r = do_updates(txn_3, db); CKERR(chk_r); }
-        { int chk_r = do_verify_results(txn_2, db, chk_original, FALSE); CKERR(chk_r); }
-        { int chk_r = do_verify_results(txn_3, db, chk_original, TRUE); CKERR(chk_r); }
+        { int chk_r = do_verify_results(txn_2, db, chk_original, false); CKERR(chk_r); }
+        { int chk_r = do_verify_results(txn_3, db, chk_original, true); CKERR(chk_r); }
         { int chk_r = txn_2->abort(txn_2); CKERR(chk_r); }
         { int chk_r = txn_3->abort(txn_3); CKERR(chk_r); }
     }
 
     IN_TXN_COMMIT(env, NULL, txn_4, 0, {
-            { int chk_r = do_verify_results(txn_4, db, chk_original, FALSE); CKERR(chk_r); }
+            { int chk_r = do_verify_results(txn_4, db, chk_original, false); CKERR(chk_r); }
         });
 
     { int chk_r = db->close(db, 0); CKERR(chk_r); }
diff --git a/src/tests/test_update_with_empty_table.cc b/src/tests/test_update_with_empty_table.cc
index 20506a388891f43fa65f5e97d3604b6bb3d45d46..aa40076793886a773ca433bb1ea217ac302906c3 100644
--- a/src/tests/test_update_with_empty_table.cc
+++ b/src/tests/test_update_with_empty_table.cc
@@ -34,10 +34,10 @@ static void cleanup (void) {
     { int chk_r = env->close(env, 0); CKERR(chk_r); }
 }
 
-static int do_updates(DB_TXN *txn, DB *db, u_int32_t flags) {
+static int do_updates(DB_TXN *txn, DB *db, uint32_t flags) {
   DBT key, val;
-  u_int32_t k = 101;
-  u_int32_t v = 10101;
+  uint32_t k = 101;
+  uint32_t v = 10101;
   dbt_init(&key, &k, sizeof(k));
   dbt_init(&val, &v, sizeof(v));
 
@@ -45,9 +45,9 @@ static int do_updates(DB_TXN *txn, DB *db, u_int32_t flags) {
     return r;
 }
 
-static void run_test(BOOL prelock, BOOL commit) {
+static void run_test(bool prelock, bool commit) {
     DB *db;
-    u_int32_t update_flags = 0;
+    uint32_t update_flags = 0;
     setup();
 
     IN_TXN_COMMIT(env, NULL, txn_1, 0, {
@@ -72,10 +72,10 @@ static void run_test(BOOL prelock, BOOL commit) {
         IN_TXN_COMMIT(env, NULL, txn_3, 0, {
                 { int chk_r = db->cursor(db, txn_3, &cursor, 0); CKERR(chk_r); }
                 { int chk_r = cursor->c_get(cursor, &key, &val, DB_NEXT); CKERR(chk_r); }
-            assert(key.size == sizeof(u_int32_t));
-            assert(val.size == sizeof(u_int32_t));
-            assert(*(u_int32_t *)(key.data) == 101);
-            assert(*(u_int32_t *)(val.data) == 10101);
+            assert(key.size == sizeof(uint32_t));
+            assert(val.size == sizeof(uint32_t));
+            assert(*(uint32_t *)(key.data) == 101);
+            assert(*(uint32_t *)(val.data) == 10101);
             { int chk_r = cursor->c_close(cursor); CKERR(chk_r); }
         });
     }
@@ -100,10 +100,10 @@ static void run_test(BOOL prelock, BOOL commit) {
 
 int test_main(int argc, char * const argv[]) {
     parse_args(argc, argv);
-    run_test(TRUE,TRUE);
-    run_test(FALSE,TRUE);
-    run_test(TRUE,FALSE);
-    run_test(FALSE,FALSE);
+    run_test(true,true);
+    run_test(false,true);
+    run_test(true,false);
+    run_test(false,false);
 
     return 0;
 }
diff --git a/src/tests/test_weakxaction.cc b/src/tests/test_weakxaction.cc
index cdeba1837108ffb3c2775cc044d9196e56a73243..79d16082bfe076bc57c94606e8cff126a9e9e1f7 100644
--- a/src/tests/test_weakxaction.cc
+++ b/src/tests/test_weakxaction.cc
@@ -15,7 +15,7 @@
 #include <sys/stat.h>
 
 static void
-test_autotxn (u_int32_t env_flags, u_int32_t db_flags) {
+test_autotxn (uint32_t env_flags, uint32_t db_flags) {
     DB_ENV *env;
     DB *db;
     int r;
diff --git a/src/tests/threaded_stress_test_helpers.h b/src/tests/threaded_stress_test_helpers.h
index 09b29ca2d5493056f7bd5c484b9c391f14c8e609..84e6daf57a0d6773893034f938d11027271609d5 100644
--- a/src/tests/threaded_stress_test_helpers.h
+++ b/src/tests/threaded_stress_test_helpers.h
@@ -109,7 +109,7 @@ struct env_args {
     int checkpointing_period;
     int cleaner_period;
     int cleaner_iterations;
-    u_int64_t cachetable_size;
+    uint64_t cachetable_size;
     const char *envdir;
     test_update_callback_f update_function; // update callback function
     test_generate_row_for_put_callback generate_put_callback;
@@ -147,9 +147,9 @@ struct cli_args {
     bool print_iteration_performance;
     enum perf_output_format perf_output_format;
     int performance_period;
-    u_int32_t txn_size; // specifies number of updates/puts/whatevers per txn
-    u_int32_t key_size; // number of bytes in vals. Must be at least 4
-    u_int32_t val_size; // number of bytes in vals. Must be at least 4
+    uint32_t txn_size; // specifies number of updates/puts/whatevers per txn
+    uint32_t key_size; // number of bytes in vals. Must be at least 4
+    uint32_t val_size; // number of bytes in vals. Must be at least 4
     double compressibility; // how much of each key/val (as a fraction in [0,1]) can be compressed away
                             // First 4-8 bytes of key may be ignored
     struct env_args env_args; // specifies environment variables
@@ -165,7 +165,7 @@ struct arg {
                                 // DB are in [0, num_elements)
                                 // false otherwise
     int sleep_ms; // number of milliseconds to sleep between operations
-    u_int32_t txn_type; // isolation level for txn running operation
+    uint32_t txn_type; // isolation level for txn running operation
     operation_t operation; // function that is the operation to be run
     void* operation_extra; // extra parameter passed to operation
     enum stress_lock_type lock_type; // states if operation must be exclusive, shared, or does not require locking
@@ -547,10 +547,10 @@ static void *worker(void *arg_v) {
         }
         r = arg->operation(txn, arg, arg->operation_extra, we->counters);
         if (r==0 && !arg->cli->single_txn && arg->do_prepare) {
-            u_int8_t gid[DB_GID_SIZE];
+            uint8_t gid[DB_GID_SIZE];
             memset(gid, 0, DB_GID_SIZE);
-            u_int64_t gid_val = txn->id64(txn);
-            u_int64_t *gid_count_p = cast_to_typeof(gid_count_p) gid;  // make gcc --happy about -Wstrict-aliasing
+            uint64_t gid_val = txn->id64(txn);
+            uint64_t *gid_count_p = cast_to_typeof(gid_count_p) gid;  // make gcc --happy about -Wstrict-aliasing
             *gid_count_p = gid_val;
             int rr = txn->prepare(txn, gid);
             assert_zero(rr);
@@ -884,7 +884,7 @@ static int UU() loader_op(DB_TXN* txn, ARG UU(arg), void* UU(operation_extra), v
         r = db_load->open(db_load, txn, "loader-db", NULL, DB_BTREE, DB_CREATE, 0666);
         assert(r == 0);
         DB_LOADER *loader;
-        u_int32_t loader_flags = (num == 0) ? 0 : LOADER_USE_PUTS;
+        uint32_t loader_flags = (num == 0) ? 0 : LOADER_USE_PUTS;
         r = env->create_loader(env, txn, &loader, db_load, 1, &db_load, &db_flags, &dbt_flags, loader_flags);
         CKERR(r);
 
@@ -917,7 +917,7 @@ static int UU() keyrange_op(DB_TXN *txn, ARG arg, void* UU(operation_extra), voi
     }
     DBT key;
     dbt_init(&key, &rand_key, sizeof rand_key);
-    u_int64_t less,equal,greater;
+    uint64_t less,equal,greater;
     int is_exact;
     r = db->key_range64(db, txn, &key, &less, &equal, &greater, &is_exact);
     assert(r == 0);
@@ -952,7 +952,7 @@ static int UU() scan_op_no_check(DB_TXN *txn, ARG arg, void* operation_extra, vo
     return 0;
 }
 
-static int UU() ptquery_and_maybe_check_op(DB* db, DB_TXN *txn, ARG arg, BOOL check) {
+static int UU() ptquery_and_maybe_check_op(DB* db, DB_TXN *txn, ARG arg, bool check) {
     int r;
     int rand_key = myrandom_r(arg->random_data);
     if (arg->bounded_element_range) {
@@ -970,7 +970,7 @@ static int UU() ptquery_and_maybe_check_op(DB* db, DB_TXN *txn, ARG arg, BOOL ch
 static int UU() ptquery_op(DB_TXN *txn, ARG arg, void* UU(operation_extra), void *stats_extra) {
     int db_index = myrandom_r(arg->random_data)%arg->cli->num_DBs;
     DB* db = arg->dbp[db_index];
-    int r = ptquery_and_maybe_check_op(db, txn, arg, TRUE);
+    int r = ptquery_and_maybe_check_op(db, txn, arg, true);
     if (!r) {
         increment_counter(stats_extra, PTQUERIES, 1);
     }
@@ -980,7 +980,7 @@ static int UU() ptquery_op(DB_TXN *txn, ARG arg, void* UU(operation_extra), void
 static int UU() ptquery_op_no_check(DB_TXN *txn, ARG arg, void* UU(operation_extra), void *stats_extra) {
     int db_index = myrandom_r(arg->random_data)%arg->cli->num_DBs;
     DB* db = arg->dbp[db_index];
-    int r = ptquery_and_maybe_check_op(db, txn, arg, FALSE);
+    int r = ptquery_and_maybe_check_op(db, txn, arg, false);
     if (!r) {
         increment_counter(stats_extra, PTQUERIES, 1);
     }
@@ -1030,7 +1030,7 @@ static struct update_op_args UU() get_update_op_args(struct cli_args* cli_args,
     return uoe;
 }
 
-static u_int64_t update_count = 0;
+static uint64_t update_count = 0;
 
 static int update_op_callback(DB *UU(db), const DBT *UU(key),
                               const DBT *old_val,
@@ -1059,11 +1059,11 @@ static int update_op_callback(DB *UU(db), const DBT *UU(key),
         new_int_val = e->u.h.new_val;
         break;
     default:
-        assert(FALSE);
+        assert(false);
     }
 
     DBT new_val;
-    u_int32_t data_size = sizeof(int) + e->pad_bytes;
+    uint32_t data_size = sizeof(int) + e->pad_bytes;
     char* data [data_size];
     ZERO_ARRAY(data);
     memcpy(data, &new_int_val, sizeof(new_int_val));
@@ -1084,7 +1084,7 @@ static int UU()update_op2(DB_TXN* txn, ARG arg, void* UU(operation_extra), void
     ZERO_STRUCT(extra);
     extra.type = UPDATE_ADD_DIFF;
     extra.pad_bytes = 0;
-    for (u_int32_t i = 0; i < arg->cli->txn_size; i++) {
+    for (uint32_t i = 0; i < arg->cli->txn_size; i++) {
         rand_key = myrandom_r(arg->random_data);
         if (arg->bounded_element_range) {
             rand_key = rand_key % (arg->cli->num_elements/2);
@@ -1136,7 +1136,7 @@ UU() update_op_db(DB *db, DB_TXN *txn, ARG arg, void* operation_extra, void *UU(
             extra.pad_bytes = 100;
         }
     }
-    for (u_int32_t i = 0; i < arg->cli->txn_size; i++) {
+    for (uint32_t i = 0; i < arg->cli->txn_size; i++) {
         rand_key = myrandom_r(arg->random_data);
         if (arg->bounded_element_range) {
             rand_key = rand_key % arg->cli->num_elements;
@@ -1208,7 +1208,7 @@ static int UU() update_with_history_op(DB_TXN *txn, ARG arg, void* operation_ext
             extra.pad_bytes = 500;
         }
     }
-    for (u_int32_t i = 0; i < arg->cli->txn_size; i++) {
+    for (uint32_t i = 0; i < arg->cli->txn_size; i++) {
         rand_key = myrandom_r(arg->random_data) % arg->cli->num_elements;
         extra.u.h.new_val = myrandom_r(arg->random_data) % MAX_RANDOM_VAL;
         // just make every other value random
@@ -1369,7 +1369,7 @@ static void *test_time(void *arg) {
 static int run_workers(
     struct arg *thread_args, 
     int num_threads, 
-    u_int32_t num_seconds, 
+    uint32_t num_seconds, 
     bool crash_at_end,
     struct cli_args* cli_args
     ) 
@@ -1535,7 +1535,7 @@ static void zero_element_callback(int idx, void *UU(extra), void *keyv, int *key
     *valsz = sizeof(int);
 }
 
-static int fill_tables_with_zeroes(DB **dbs, int num_DBs, int num_elements, u_int32_t key_size, u_int32_t val_size) {
+static int fill_tables_with_zeroes(DB **dbs, int num_DBs, int num_elements, uint32_t key_size, uint32_t val_size) {
     for (int i = 0; i < num_DBs; i++) {
         assert(key_size >= sizeof(int));
         assert(val_size >= sizeof(int));
@@ -2252,9 +2252,9 @@ UU() stress_recover(struct cli_args *args) {
     int r = env->txn_begin(env, 0, &txn, recover_args.txn_type);
     CKERR(r);
     struct scan_op_extra soe;
-    soe.fast = TRUE;
-    soe.fwd = TRUE;
-    soe.prefetch = FALSE;
+    soe.fast = true;
+    soe.fwd = true;
+    soe.prefetch = false;
     // make sure the scan doesn't terminate early
     run_test = true;
     r = scan_op(txn, &recover_args, &soe, NULL);
diff --git a/src/tests/upgrade-test-3.cc b/src/tests/upgrade-test-3.cc
index 4b9057d42c42d964fe9d64c78528b42b9531ccba..98164d86efec2e1afcc352c4afcded2bc6497287 100644
--- a/src/tests/upgrade-test-3.cc
+++ b/src/tests/upgrade-test-3.cc
@@ -61,7 +61,7 @@ static void upgrade_test_3(DB **dbs) {
 	CKERR(r);
 
 	// truncate the tree
-	u_int32_t row_count = 0;
+	uint32_t row_count = 0;
 	r = dbs[i]->truncate(dbs[i], 0, &row_count, 0); assert(r == 0);
 
 	// walk the tree - expect 0 rows
diff --git a/src/tests/upgrade-test-6.cc b/src/tests/upgrade-test-6.cc
index f892e968004a3eb96e5bbcff836e7f0d39d0347e..cf21b6e1026db862256255a7ca3d520f578d8bdd 100644
--- a/src/tests/upgrade-test-6.cc
+++ b/src/tests/upgrade-test-6.cc
@@ -31,8 +31,8 @@ int CACHESIZE=old_default_cachesize;
 int ALLOW_DUPS=0;
 enum {MAGIC=311};
 char *datadir = NULL;
-BOOL check_est = TRUE; // do check the estimates by default
-BOOL footprint_print = FALSE; // print memory footprint info 
+bool check_est = true; // do check the estimates by default
+bool footprint_print = false; // print memory footprint info 
 
 
 // Code for showing memory footprint information.
@@ -192,9 +192,9 @@ static void test_loader(DB **dbs)
 	if (verbose)
 	    printf("n_keys=%" PRIu64 " n_data=%" PRIu64 " dsize=%" PRIu64 " fsize=%" PRIu64 "\n",
 		   stats.bt_nkeys, stats.bt_ndata, stats.bt_dsize, stats.bt_fsize);
-	assert(stats.bt_nkeys == (u_int64_t)NUM_ROWS);
-	assert(stats.bt_ndata == (u_int64_t)NUM_ROWS);
-	assert(stats.bt_dsize == ((u_int64_t)NUM_ROWS) * 2 * sizeof(unsigned int));
+	assert(stats.bt_nkeys == (uint64_t)NUM_ROWS);
+	assert(stats.bt_ndata == (uint64_t)NUM_ROWS);
+	assert(stats.bt_dsize == ((uint64_t)NUM_ROWS) * 2 * sizeof(unsigned int));
 	r = txn->commit(txn, 0);
 	CKERR(r);
     }
@@ -364,7 +364,7 @@ static void do_args(int argc, char * const argv[]) {
 	    verbose--;
 	    if (verbose<0) verbose=0;
 	} else if (strcmp(argv[0], "-f")==0) {
-	    footprint_print = TRUE;
+	    footprint_print = true;
         } else if (strcmp(argv[0], "-r")==0) {
             argc--; argv++;
             NUM_ROWS = atoi(argv[0]);
diff --git a/src/tests/upgrade_simple.cc b/src/tests/upgrade_simple.cc
index fe26d4722b723360c3855371adc0d97f7eda23d0..9f992f8a678ee8a2129d8fb9a8491df94ed5aa50 100644
--- a/src/tests/upgrade_simple.cc
+++ b/src/tests/upgrade_simple.cc
@@ -40,7 +40,7 @@ static char * dir_v42_dirty_multilogfile = OLDDATADIR "env_preload.4.2.0.multilo
 
 
 static void
-setup (u_int32_t flags, BOOL clean, BOOL too_old, char * src_db_dir) {
+setup (uint32_t flags, bool clean, bool too_old, char * src_db_dir) {
     int r;
     int len = 256;
     char syscmd[len];
@@ -84,33 +84,33 @@ test_shutdown(void) {
 
 static void
 test_env_startup(void) {
-    u_int32_t flags;
+    uint32_t flags;
     
     flags = FLAGS_LOG;
 
-    setup(flags, TRUE, FALSE, dir_v42_clean);
+    setup(flags, true, false, dir_v42_clean);
     print_engine_status(env);
     test_shutdown();
 
-    setup(flags, FALSE, TRUE, dir_v41_clean);
+    setup(flags, false, true, dir_v41_clean);
     print_engine_status(env);
     test_shutdown();
 
-    setup(flags, FALSE, FALSE, dir_v42_dirty);
+    setup(flags, false, false, dir_v42_dirty);
     if (verbose) {
 	printf("\n\nEngine status after aborted env->open() will have some garbage values:\n");
     }
     print_engine_status(env);
     test_shutdown();
 
-    setup(flags, FALSE, TRUE, dir_v41_dirty_multilogfile);
+    setup(flags, false, true, dir_v41_dirty_multilogfile);
     if (verbose) {
 	printf("\n\nEngine status after aborted env->open() will have some garbage values:\n");
     }
     print_engine_status(env);
     test_shutdown();
 
-    setup(flags, FALSE, FALSE, dir_v42_dirty_multilogfile);
+    setup(flags, false, false, dir_v42_dirty_multilogfile);
     if (verbose) {
 	printf("\n\nEngine status after aborted env->open() will have some garbage values:\n");
     }
diff --git a/src/ydb-internal.h b/src/ydb-internal.h
index e21f6ae2c1870a538b564ef28187abeae2643491..90798566a413dcc9259f63cae40a61d61f100128 100644
--- a/src/ydb-internal.h
+++ b/src/ydb-internal.h
@@ -20,13 +20,13 @@ struct __toku_lock_tree;
 
 struct __toku_db_internal {
     int opened;
-    u_int32_t open_flags;
+    uint32_t open_flags;
     int open_mode;
     FT_HANDLE ft_handle;
     DICTIONARY_ID dict_id;        // unique identifier used by locktree logic
     struct __toku_lock_tree* lt;
     struct simple_dbt skey, sval; // static key and value
-    BOOL key_compare_was_set;     // true if a comparison function was provided before call to db->open()  (if false, use environment's comparison function).  
+    bool key_compare_was_set;     // true if a comparison function was provided before call to db->open()  (if false, use environment's comparison function).  
     char *dname;                  // dname is constant for this handle (handle must be closed before file is renamed)
     DB_INDEXER *indexer;
 };
@@ -45,7 +45,7 @@ typedef void (*toku_env_errcall_t)(const DB_ENV *, const char *, const char *);
 struct __toku_db_env_internal {
     int is_panicked; // if nonzero, then its an error number
     char *panic_string;
-    u_int32_t open_flags;
+    uint32_t open_flags;
     int open_mode;
     toku_env_errcall_t errcall;
     void *errfile;
@@ -83,7 +83,7 @@ struct __toku_db_env_internal {
     int enospc_redzone_ctr;                             // number of operations rejected by enospc prevention  (red zone)
     int fs_poll_time;                                   // Time in seconds between statfs calls
     struct minicron fs_poller;                          // Poll the file systems
-    BOOL fs_poller_is_init;
+    bool fs_poller_is_init;
     int envdir_lockfd;
     int datadir_lockfd;
     int logdir_lockfd;
@@ -140,8 +140,8 @@ int toku_ydb_check_avail_fs_space(DB_ENV *env);
 /* */
 void toku_ydb_error_all_cases(const DB_ENV * env, 
                               int error, 
-                              BOOL include_stderrstring, 
-                              BOOL use_stderr_if_nothing_else, 
+                              bool include_stderrstring, 
+                              bool use_stderr_if_nothing_else, 
                               const char *fmt, va_list ap)
     __attribute__((format (printf, 5, 0)))
     __attribute__((__visibility__("default"))); // this is needed by the C++ interface. 
@@ -169,7 +169,7 @@ struct __toku_db_txn_internal {
     //TXNID txnid64; /* A sixty-four bit txn id. */
     struct tokutxn *tokutxn;
     struct __toku_lth *lth;  //Hash table holding list of dictionaries this txn has touched, only initialized if txn touches a dictionary
-    u_int32_t flags;
+    uint32_t flags;
     TOKU_ISOLATION iso;
     DB_TXN *child;
     toku_mutex_t txn_mutex;
@@ -189,7 +189,7 @@ struct __toku_dbc_internal {
 
     // if the rmw flag is asserted, cursor operations (like set) grab write locks instead of read locks
     // the rmw flag is set when the cursor is created with the DB_RMW flag set
-    BOOL rmw;
+    bool rmw;
 };
 
 struct __toku_dbc_external {
@@ -210,8 +210,8 @@ env_opened(DB_ENV *env) {
 void env_panic(DB_ENV * env, int cause, const char * msg);
 void env_note_db_opened(DB_ENV *env, DB *db);
 void env_note_db_closed(DB_ENV *env, DB *db);
-int toku_env_dbremove(DB_ENV * env, DB_TXN *txn, const char *fname, const char *dbname, u_int32_t flags);
-int toku_env_dbrename(DB_ENV *env, DB_TXN *txn, const char *fname, const char *dbname, const char *newname, u_int32_t flags);
+int toku_env_dbremove(DB_ENV * env, DB_TXN *txn, const char *fname, const char *dbname, uint32_t flags);
+int toku_env_dbrename(DB_ENV *env, DB_TXN *txn, const char *fname, const char *dbname, const char *newname, uint32_t flags);
 
 
 #endif
diff --git a/src/ydb.cc b/src/ydb.cc
index 9f06b9cd3e50098f6fb9203a6a08f4ceddfbf80e..8f91f02654507f9372f0d470c2cc62370f7feddc 100644
--- a/src/ydb.cc
+++ b/src/ydb.cc
@@ -99,7 +99,7 @@ typedef enum {
 } ydb_layer_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[YDB_LAYER_STATUS_NUM_ROWS];
 } YDB_LAYER_STATUS_S, *YDB_LAYER_STATUS;
 
@@ -184,7 +184,7 @@ single_process_unlock(int *lockfd) {
 }
 
 /** The default maximum number of persistent locks in a lock tree  */
-static const u_int32_t __toku_env_default_locks_limit = 0x7FFFFFFF;
+static const uint32_t __toku_env_default_locks_limit = 0x7FFFFFFF;
 static const uint64_t __toku_env_default_lock_memory_limit = 1000*1024;
 
 static inline DBT*
@@ -324,7 +324,7 @@ env_fs_init(DB_ENV *env) {
     env->i->fs_state = FS_GREEN;
     env->i->fs_poll_time = 5;  // seconds
     env->i->redzone = 5;       // percent of total space
-    env->i->fs_poller_is_init = FALSE;
+    env->i->fs_poller_is_init = false;
 }
 
 // Initialize the minicron that polls file system space
@@ -332,7 +332,7 @@ static int
 env_fs_init_minicron(DB_ENV *env) {
     int r = toku_minicron_setup(&env->i->fs_poller, env->i->fs_poll_time, env_fs_poller, env); 
     assert(r == 0);
-    env->i->fs_poller_is_init = TRUE;
+    env->i->fs_poller_is_init = true;
     return r;
 }
 
@@ -342,7 +342,7 @@ env_fs_destroy(DB_ENV *env) {
     if (env->i->fs_poller_is_init) {
         int r = toku_minicron_shutdown(&env->i->fs_poller);
         assert(r == 0);
-        env->i->fs_poller_is_init = FALSE;
+        env->i->fs_poller_is_init = false;
     }
 }
 
@@ -395,11 +395,11 @@ ydb_do_recovery (DB_ENV *env) {
 static int 
 needs_recovery (DB_ENV *env) {
     assert(env->i->real_log_dir);
-    int recovery_needed = tokudb_needs_recovery(env->i->real_log_dir, TRUE);
+    int recovery_needed = tokudb_needs_recovery(env->i->real_log_dir, true);
     return recovery_needed ? DB_RUNRECOVERY : 0;
 }
 
-static int toku_env_txn_checkpoint(DB_ENV * env, u_int32_t kbyte, u_int32_t min, u_int32_t flags);
+static int toku_env_txn_checkpoint(DB_ENV * env, uint32_t kbyte, uint32_t min, uint32_t flags);
 
 static void finalize_file_removal(DICTIONARY_ID dict_id, void * extra);
 
@@ -414,14 +414,14 @@ db_use_builtin_key_cmp(DB *db) {
     else if (db->i->key_compare_was_set)
         r = toku_ydb_do_error(db->dbenv, EINVAL, "Key comparison function already set.\n");
     else {
-        u_int32_t tflags;
+        uint32_t tflags;
         r = toku_ft_get_flags(db->i->ft_handle, &tflags);
         if (r!=0) return r;
 
         tflags |= TOKU_DB_KEYCMP_BUILTIN;
         r = toku_ft_set_flags(db->i->ft_handle, tflags);
         if (!r)
-            db->i->key_compare_was_set = TRUE;
+            db->i->key_compare_was_set = true;
     }
     return r;
 }
@@ -452,7 +452,7 @@ typedef enum {
 } persistent_upgrade_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[PERSISTENT_UPGRADE_STATUS_NUM_ROWS];
 } PERSISTENT_UPGRADE_STATUS_S, *PERSISTENT_UPGRADE_STATUS;
 
@@ -510,7 +510,7 @@ maybe_upgrade_persistent_environment_dictionary(DB_ENV * env, DB_TXN * txn, LSN
         const uint32_t curr_env_ver_d = toku_htod32(FT_LAYOUT_VERSION);
         toku_fill_dbt(&key, curr_env_ver_key, strlen(curr_env_ver_key));
         toku_fill_dbt(&val, &curr_env_ver_d, sizeof(curr_env_ver_d));
-        r = toku_db_put(persistent_environment, txn, &key, &val, 0, FALSE);
+        r = toku_db_put(persistent_environment, txn, &key, &val, 0, false);
         assert_zero(r);
 
         // although the variable name is last_lsn_of_v13, this key really represents
@@ -519,19 +519,19 @@ maybe_upgrade_persistent_environment_dictionary(DB_ENV * env, DB_TXN * txn, LSN
         uint64_t last_lsn_of_v13_d = toku_htod64(last_lsn_of_clean_shutdown_read_from_log.lsn);
         toku_fill_dbt(&key, last_lsn_of_v13_key, strlen(last_lsn_of_v13_key));
         toku_fill_dbt(&val, &last_lsn_of_v13_d, sizeof(last_lsn_of_v13_d));
-        r = toku_db_put(persistent_environment, txn, &key, &val, 0, FALSE);
+        r = toku_db_put(persistent_environment, txn, &key, &val, 0, false);
         assert_zero(r);
         
         time_t upgrade_v19_time_d = toku_htod64(time(NULL));
         toku_fill_dbt(&key, upgrade_v19_time_key, strlen(upgrade_v19_time_key));
         toku_fill_dbt(&val, &upgrade_v19_time_d, sizeof(upgrade_v19_time_d));
-        r = toku_db_put(persistent_environment, txn, &key, &val, DB_NOOVERWRITE, FALSE);
+        r = toku_db_put(persistent_environment, txn, &key, &val, DB_NOOVERWRITE, false);
         assert_zero(r);
 
         uint64_t upgrade_v19_footprint_d = toku_htod64(toku_log_upgrade_get_footprint());
         toku_fill_dbt(&key, upgrade_v19_footprint_key, strlen(upgrade_v19_footprint_key));
         toku_fill_dbt(&val, &upgrade_v19_footprint_d, sizeof(upgrade_v19_footprint_d));
-        r = toku_db_put(persistent_environment, txn, &key, &val, DB_NOOVERWRITE, FALSE);
+        r = toku_db_put(persistent_environment, txn, &key, &val, DB_NOOVERWRITE, false);
         assert_zero(r);
     }
     return r;
@@ -610,9 +610,9 @@ ydb_recover_log_exists(DB_ENV *env) {
 // Set *valid_newenv if creating a new environment (all files missing).
 // (Note, if special dictionaries exist, then they were created transactionally and log should exist.)
 static int 
-validate_env(DB_ENV * env, BOOL * valid_newenv, BOOL need_rollback_cachefile) {
+validate_env(DB_ENV * env, bool * valid_newenv, bool need_rollback_cachefile) {
     int r;
-    BOOL expect_newenv = FALSE;        // set true if we expect to create a new env
+    bool expect_newenv = false;        // set true if we expect to create a new env
     toku_struct_stat buf;
     char* path = NULL;
 
@@ -621,12 +621,12 @@ validate_env(DB_ENV * env, BOOL * valid_newenv, BOOL need_rollback_cachefile) {
     assert(path);
     r = toku_stat(path, &buf);
     if (r == 0) {
-        expect_newenv = FALSE;  // persistent info exists
+        expect_newenv = false;  // persistent info exists
     }
     else {
         int stat_errno = get_error_errno();
         if (stat_errno == ENOENT) {
-            expect_newenv = TRUE;
+            expect_newenv = true;
             r = 0;
         }
         else {
@@ -701,7 +701,7 @@ validate_env(DB_ENV * env, BOOL * valid_newenv, BOOL need_rollback_cachefile) {
     if (r == 0)
         *valid_newenv = expect_newenv;
     else 
-        *valid_newenv = FALSE;
+        *valid_newenv = false;
     return r;
 }
 
@@ -712,7 +712,7 @@ validate_env(DB_ENV * env, BOOL * valid_newenv, BOOL need_rollback_cachefile) {
 // of the current version is how the upgrade is done.  
 // Note, the upgrade procedure takes a checkpoint, so we must release the ydb lock.
 static int
-ydb_maybe_upgrade_env (DB_ENV *env, LSN * last_lsn_of_clean_shutdown_read_from_log, BOOL * upgrade_in_progress) {
+ydb_maybe_upgrade_env (DB_ENV *env, LSN * last_lsn_of_clean_shutdown_read_from_log, bool * upgrade_in_progress) {
     int r = 0;
     if (env->i->open_flags & DB_INIT_TXN && env->i->open_flags & DB_INIT_LOG) {
         r = toku_maybe_upgrade_log(env->i->dir, env->i->real_log_dir, last_lsn_of_clean_shutdown_read_from_log, upgrade_in_progress);
@@ -740,11 +740,11 @@ static int toku_db_lt_panic(DB* db, int r);
 // Return 0 on success, ENOENT if any of the expected necessary files are missing.
 // (The set of necessary files is defined in the function validate_env() above.)
 static int 
-env_open(DB_ENV * env, const char *home, u_int32_t flags, int mode) {
+env_open(DB_ENV * env, const char *home, uint32_t flags, int mode) {
     HANDLE_PANICKED_ENV(env);
     int r;
-    BOOL newenv;  // true iff creating a new environment
-    u_int32_t unused_flags=flags;
+    bool newenv;  // true iff creating a new environment
+    uint32_t unused_flags=flags;
 
     if (env_opened(env)) {
         r = toku_ydb_do_error(env, EINVAL, "The environment is already open\n");
@@ -780,7 +780,7 @@ env_open(DB_ENV * env, const char *home, u_int32_t flags, int mode) {
 
     // Verify that the home exists.
     {
-        BOOL made_new_home = FALSE;
+        bool made_new_home = false;
         char* new_home = NULL;
         toku_struct_stat buf;
         if (strlen(home) > 1 && home[strlen(home)-1] == '\\') {
@@ -789,7 +789,7 @@ env_open(DB_ENV * env, const char *home, u_int32_t flags, int mode) {
             XMALLOC_N(strlen(home), new_home);
             memcpy(new_home, home, strlen(home));
             new_home[strlen(home) - 1] = 0;
-            made_new_home = TRUE;
+            made_new_home = true;
         }
         r = toku_stat(made_new_home? new_home : home, &buf);
         int er;
@@ -837,18 +837,18 @@ env_open(DB_ENV * env, const char *home, u_int32_t flags, int mode) {
     if (r!=0) goto cleanup;
 
 
-    BOOL need_rollback_cachefile;
-    need_rollback_cachefile = FALSE;
+    bool need_rollback_cachefile;
+    need_rollback_cachefile = false;
     if (flags & (DB_INIT_TXN | DB_INIT_LOG)) {
-        need_rollback_cachefile = TRUE;
+        need_rollback_cachefile = true;
     }
 
     ydb_layer_status_init();  // do this before possibly upgrading, so upgrade work is counted in status counters
 
     LSN last_lsn_of_clean_shutdown_read_from_log;
     last_lsn_of_clean_shutdown_read_from_log = ZERO_LSN;
-    BOOL upgrade_in_progress;
-    upgrade_in_progress = FALSE;
+    bool upgrade_in_progress;
+    upgrade_in_progress = false;
     r = ydb_maybe_upgrade_env(env, &last_lsn_of_clean_shutdown_read_from_log, &upgrade_in_progress);
     if (r!=0) goto cleanup;
 
@@ -862,7 +862,7 @@ env_open(DB_ENV * env, const char *home, u_int32_t flags, int mode) {
             assert(get_error_errno() == ENOENT);
         }
         toku_free(rollback_filename);
-        need_rollback_cachefile = FALSE;  // we're not expecting it to exist now
+        need_rollback_cachefile = false;  // we're not expecting it to exist now
     }
     
     r = validate_env(env, &newenv, need_rollback_cachefile);  // make sure that environment is either new or complete
@@ -890,7 +890,7 @@ env_open(DB_ENV * env, const char *home, u_int32_t flags, int mode) {
 
     if (flags & (DB_INIT_TXN | DB_INIT_LOG)) {
         assert(env->i->logger);
-        toku_logger_write_log_files(env->i->logger, (BOOL)((flags & DB_INIT_LOG) != 0));
+        toku_logger_write_log_files(env->i->logger, (bool)((flags & DB_INIT_LOG) != 0));
         if (!toku_logger_is_open(env->i->logger)) {
             r = toku_logger_open(env->i->real_log_dir, env->i->logger);
             if (r!=0) {
@@ -941,7 +941,7 @@ env_open(DB_ENV * env, const char *home, u_int32_t flags, int mode) {
         toku_logger_set_cachetable(env->i->logger, env->i->cachetable);
         toku_logger_set_remove_finalize_callback(env->i->logger, finalize_file_removal, env->i->ltm);
         if (!toku_logger_rollback_is_open(env->i->logger)) {
-            BOOL create_new_rollback_file = newenv | upgrade_in_progress;
+            bool create_new_rollback_file = newenv | upgrade_in_progress;
             r = toku_logger_open_rollback(env->i->logger, env->i->cachetable, create_new_rollback_file);
             assert(r==0);
         }
@@ -969,18 +969,18 @@ env_open(DB_ENV * env, const char *home, u_int32_t flags, int mode) {
 
             toku_fill_dbt(&key, orig_env_ver_key, strlen(orig_env_ver_key));
             toku_fill_dbt(&val, &environment_version, sizeof(environment_version));
-            r = toku_db_put(env->i->persistent_environment, txn, &key, &val, 0, FALSE);
+            r = toku_db_put(env->i->persistent_environment, txn, &key, &val, 0, false);
             assert_zero(r);
 
             toku_fill_dbt(&key, curr_env_ver_key, strlen(curr_env_ver_key));
             toku_fill_dbt(&val, &environment_version, sizeof(environment_version));
-            r = toku_db_put(env->i->persistent_environment, txn, &key, &val, 0, FALSE);
+            r = toku_db_put(env->i->persistent_environment, txn, &key, &val, 0, false);
             assert_zero(r);
 
             time_t creation_time_d = toku_htod64(time(NULL));
             toku_fill_dbt(&key, creation_time_key, strlen(creation_time_key));
             toku_fill_dbt(&val, &creation_time_d, sizeof(creation_time_d));
-            r = toku_db_put(env->i->persistent_environment, txn, &key, &val, 0, FALSE);
+            r = toku_db_put(env->i->persistent_environment, txn, &key, &val, 0, false);
             assert_zero(r);
         }
         else {
@@ -1023,7 +1023,7 @@ env_open(DB_ENV * env, const char *home, u_int32_t flags, int mode) {
 
 
 static int 
-env_close(DB_ENV * env, u_int32_t flags) {
+env_close(DB_ENV * env, uint32_t flags) {
     int r = 0;
     const char * err_msg = NULL;
 
@@ -1071,7 +1071,7 @@ env_close(DB_ENV * env, u_int32_t flags) {
                 toku_ydb_do_error(env, r, "%s", err_msg);
                 goto panic_and_quit_early;
             }
-            r = toku_logger_close_rollback(env->i->logger, FALSE);
+            r = toku_logger_close_rollback(env->i->logger, false);
             if (r) {
                 err_msg = "Cannot close environment (error during closing rollback cachefile)\n";
                 toku_ydb_do_error(env, r, "%s", err_msg);
@@ -1161,7 +1161,7 @@ env_close(DB_ENV * env, u_int32_t flags) {
 }
 
 static int 
-env_log_archive(DB_ENV * env, char **list[], u_int32_t flags) {
+env_log_archive(DB_ENV * env, char **list[], uint32_t flags) {
     return toku_logger_log_archive(env->i->logger, list, flags);
 }
 
@@ -1173,11 +1173,11 @@ env_log_flush(DB_ENV * env, const DB_LSN * lsn __attribute__((__unused__))) {
 }
 
 static int 
-env_set_cachesize(DB_ENV * env, u_int32_t gbytes, u_int32_t bytes, int ncache) {
+env_set_cachesize(DB_ENV * env, uint32_t gbytes, uint32_t bytes, int ncache) {
     HANDLE_PANICKED_ENV(env);
     if (ncache != 1)
         return EINVAL;
-    u_int64_t cs64 = ((u_int64_t) gbytes << 30) + bytes;
+    uint64_t cs64 = ((uint64_t) gbytes << 30) + bytes;
     unsigned long cs = cs64;
     if (cs64 > cs)
         return EINVAL;
@@ -1186,7 +1186,7 @@ env_set_cachesize(DB_ENV * env, u_int32_t gbytes, u_int32_t bytes, int ncache) {
 }
 
 static int
-locked_env_dbremove(DB_ENV * env, DB_TXN *txn, const char *fname, const char *dbname, u_int32_t flags) {
+locked_env_dbremove(DB_ENV * env, DB_TXN *txn, const char *fname, const char *dbname, uint32_t flags) {
     int ret, r;
     HANDLE_ILLEGAL_WORKING_PARENT_TXN(env, txn);
 
@@ -1215,7 +1215,7 @@ locked_env_dbremove(DB_ENV * env, DB_TXN *txn, const char *fname, const char *db
 }
 
 static int
-locked_env_dbrename(DB_ENV *env, DB_TXN *txn, const char *fname, const char *dbname, const char *newname, u_int32_t flags) {
+locked_env_dbrename(DB_ENV *env, DB_TXN *txn, const char *fname, const char *dbname, const char *newname, uint32_t flags) {
     int ret, r;
     HANDLE_ILLEGAL_WORKING_PARENT_TXN(env, txn);
 
@@ -1247,7 +1247,7 @@ locked_env_dbrename(DB_ENV *env, DB_TXN *txn, const char *fname, const char *dbn
 #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3
 
 static int 
-env_get_cachesize(DB_ENV * env, u_int32_t *gbytes, u_int32_t *bytes, int *ncache) {
+env_get_cachesize(DB_ENV * env, uint32_t *gbytes, uint32_t *bytes, int *ncache) {
     HANDLE_PANICKED_ENV(env);
     *gbytes = env->i->cachetable_size >> 30;
     *bytes = env->i->cachetable_size & ((1<<30)-1);
@@ -1294,10 +1294,10 @@ env_set_errpfx(DB_ENV * env, const char *errpfx) {
 }
 
 static int 
-env_set_flags(DB_ENV * env, u_int32_t flags, int onoff) {
+env_set_flags(DB_ENV * env, uint32_t flags, int onoff) {
     HANDLE_PANICKED_ENV(env);
 
-    u_int32_t change = 0;
+    uint32_t change = 0;
     if (flags & DB_AUTO_COMMIT) {
         change |=  DB_AUTO_COMMIT;
         flags  &= ~DB_AUTO_COMMIT;
@@ -1311,7 +1311,7 @@ env_set_flags(DB_ENV * env, u_int32_t flags, int onoff) {
 }
 
 static int 
-env_set_lg_bsize(DB_ENV * env, u_int32_t bsize) {
+env_set_lg_bsize(DB_ENV * env, uint32_t bsize) {
     HANDLE_PANICKED_ENV(env);
     return toku_logger_set_lg_bsize(env->i->logger, bsize);
 }
@@ -1335,25 +1335,25 @@ env_set_lg_dir(DB_ENV * env, const char *dir) {
 }
 
 static int 
-env_set_lg_max(DB_ENV * env, u_int32_t lg_max) {
+env_set_lg_max(DB_ENV * env, uint32_t lg_max) {
     HANDLE_PANICKED_ENV(env);
     return toku_logger_set_lg_max(env->i->logger, lg_max);
 }
 
 static int 
-env_get_lg_max(DB_ENV * env, u_int32_t *lg_maxp) {
+env_get_lg_max(DB_ENV * env, uint32_t *lg_maxp) {
     HANDLE_PANICKED_ENV(env);
     return toku_logger_get_lg_max(env->i->logger, lg_maxp);
 }
 
 static int 
-env_set_lk_detect(DB_ENV * env, u_int32_t UU(detect)) {
+env_set_lk_detect(DB_ENV * env, uint32_t UU(detect)) {
     HANDLE_PANICKED_ENV(env);
     return toku_ydb_do_error(env, EINVAL, "TokuDB does not (yet) support set_lk_detect\n");
 }
 
 static int 
-env_set_lk_max_locks(DB_ENV *env, u_int32_t locks_limit) {
+env_set_lk_max_locks(DB_ENV *env, uint32_t locks_limit) {
     HANDLE_PANICKED_ENV(env);
     int r;
     if (env_opened(env)) {
@@ -1366,14 +1366,14 @@ env_set_lk_max_locks(DB_ENV *env, u_int32_t locks_limit) {
 
 #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR <= 4
 static int 
-env_set_lk_max(DB_ENV * env, u_int32_t lk_max) {
+env_set_lk_max(DB_ENV * env, uint32_t lk_max) {
     return env_set_lk_max_locks(env, lk_max);
 }
 
 #endif
 
 static int 
-env_get_lk_max_locks(DB_ENV *env, u_int32_t *lk_maxp) {
+env_get_lk_max_locks(DB_ENV *env, uint32_t *lk_maxp) {
     HANDLE_PANICKED_ENV(env);
     int r;
     if (lk_maxp == NULL) 
@@ -1425,13 +1425,13 @@ env_set_tmp_dir(DB_ENV * env, const char *tmp_dir) {
 }
 
 static int 
-env_set_verbose(DB_ENV * env, u_int32_t UU(which), int UU(onoff)) {
+env_set_verbose(DB_ENV * env, uint32_t UU(which), int UU(onoff)) {
     HANDLE_PANICKED_ENV(env);
     return 1;
 }
 
 static int 
-toku_env_txn_checkpoint(DB_ENV * env, u_int32_t kbyte __attribute__((__unused__)), u_int32_t min __attribute__((__unused__)), u_int32_t flags __attribute__((__unused__))) {
+toku_env_txn_checkpoint(DB_ENV * env, uint32_t kbyte __attribute__((__unused__)), uint32_t min __attribute__((__unused__)), uint32_t flags __attribute__((__unused__))) {
     int r = toku_checkpoint(env->i->cachetable, env->i->logger,
                             checkpoint_callback_f,  checkpoint_callback_extra,
                             checkpoint_callback2_f, checkpoint_callback2_extra,
@@ -1445,13 +1445,13 @@ toku_env_txn_checkpoint(DB_ENV * env, u_int32_t kbyte __attribute__((__unused__)
 }
 
 static int 
-env_txn_stat(DB_ENV * env, DB_TXN_STAT ** UU(statp), u_int32_t UU(flags)) {
+env_txn_stat(DB_ENV * env, DB_TXN_STAT ** UU(statp), uint32_t UU(flags)) {
     HANDLE_PANICKED_ENV(env);
     return 1;
 }
 
 static int
-env_txn_xa_recover (DB_ENV *env, TOKU_XA_XID xids[/*count*/], long count, /*out*/ long *retp, u_int32_t flags) {
+env_txn_xa_recover (DB_ENV *env, TOKU_XA_XID xids[/*count*/], long count, /*out*/ long *retp, uint32_t flags) {
     struct tokulogger_preplist *MALLOC_N(count,preps);
     int r = toku_logger_recover_txn(env->i->logger, preps, count, retp, flags);
     if (r==0) {
@@ -1465,7 +1465,7 @@ env_txn_xa_recover (DB_ENV *env, TOKU_XA_XID xids[/*count*/], long count, /*out*
 }
 
 static int
-env_txn_recover (DB_ENV *env, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, u_int32_t flags) {
+env_txn_recover (DB_ENV *env, DB_PREPLIST preplist[/*count*/], long count, /*out*/ long *retp, uint32_t flags) {
     struct tokulogger_preplist *MALLOC_N(count,preps);
     int r = toku_logger_recover_txn(env->i->logger, preps, count, retp, flags);
     if (r==0) {
@@ -1486,7 +1486,7 @@ env_get_txn_from_xid (DB_ENV *env, /*in*/ TOKU_XA_XID *xid, /*out*/ DB_TXN **txn
 }
 
 static int
-env_checkpointing_set_period(DB_ENV * env, u_int32_t seconds) {
+env_checkpointing_set_period(DB_ENV * env, uint32_t seconds) {
     HANDLE_PANICKED_ENV(env);
     int r;
     if (!env_opened(env)) r = EINVAL;
@@ -1496,7 +1496,7 @@ env_checkpointing_set_period(DB_ENV * env, u_int32_t seconds) {
 }
 
 static int
-env_cleaner_set_period(DB_ENV * env, u_int32_t seconds) {
+env_cleaner_set_period(DB_ENV * env, uint32_t seconds) {
     HANDLE_PANICKED_ENV(env);
     int r;
     if (!env_opened(env)) r = EINVAL;
@@ -1506,7 +1506,7 @@ env_cleaner_set_period(DB_ENV * env, u_int32_t seconds) {
 }
 
 static int
-env_cleaner_set_iterations(DB_ENV * env, u_int32_t iterations) {
+env_cleaner_set_iterations(DB_ENV * env, uint32_t iterations) {
     HANDLE_PANICKED_ENV(env);
     int r;
     if (!env_opened(env)) r = EINVAL;
@@ -1530,7 +1530,7 @@ env_create_loader(DB_ENV *env,
 }
 
 static int
-env_checkpointing_get_period(DB_ENV * env, u_int32_t *seconds) {
+env_checkpointing_get_period(DB_ENV * env, uint32_t *seconds) {
     HANDLE_PANICKED_ENV(env);
     int r = 0;
     if (!env_opened(env)) r = EINVAL;
@@ -1540,7 +1540,7 @@ env_checkpointing_get_period(DB_ENV * env, u_int32_t *seconds) {
 }
 
 static int
-env_cleaner_get_period(DB_ENV * env, u_int32_t *seconds) {
+env_cleaner_get_period(DB_ENV * env, uint32_t *seconds) {
     HANDLE_PANICKED_ENV(env);
     int r = 0;
     if (!env_opened(env)) r = EINVAL;
@@ -1550,7 +1550,7 @@ env_cleaner_get_period(DB_ENV * env, u_int32_t *seconds) {
 }
 
 static int
-env_cleaner_get_iterations(DB_ENV * env, u_int32_t *iterations) {
+env_cleaner_get_iterations(DB_ENV * env, uint32_t *iterations) {
     HANDLE_PANICKED_ENV(env);
     int r = 0;
     if (!env_opened(env)) r = EINVAL;
@@ -1692,7 +1692,7 @@ typedef enum {
 } fs_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[FS_STATUS_NUM_ROWS];
 } FS_STATUS_S, *FS_STATUS;
 
@@ -1737,7 +1737,7 @@ fs_get_status(DB_ENV * env, fs_redzone_state * redzone_state) {
     FS_STATUS_VALUE(FS_ENOSPC_MOST_RECENT) = enospc_most_recent_timestamp;
     FS_STATUS_VALUE(FS_ENOSPC_COUNT) = enospc_total;
     
-    u_int64_t fsync_count, fsync_time;
+    uint64_t fsync_count, fsync_time;
     toku_get_fsync_times(&fsync_count, &fsync_time);
     FS_STATUS_VALUE(FS_FSYNC_COUNT) = fsync_count;
     FS_STATUS_VALUE(FS_FSYNC_TIME) = fsync_time;
@@ -1761,7 +1761,7 @@ typedef enum {
 } memory_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[MEMORY_STATUS_NUM_ROWS];
 } MEMORY_STATUS_S, *MEMORY_STATUS;
 
@@ -2149,7 +2149,7 @@ env_get_cursor_for_directory(DB_ENV* env, DB_TXN* txn, DBC** c) {
 }
 
 static int 
-toku_env_create(DB_ENV ** envp, u_int32_t flags) {
+toku_env_create(DB_ENV ** envp, uint32_t flags) {
     int r = ENOSYS;
     DB_ENV* result = NULL;
 
@@ -2276,7 +2276,7 @@ toku_env_create(DB_ENV ** envp, u_int32_t flags) {
 }
 
 int 
-DB_ENV_CREATE_FUN (DB_ENV ** envp, u_int32_t flags) {
+DB_ENV_CREATE_FUN (DB_ENV ** envp, uint32_t flags) {
     int r = toku_env_create(envp, flags); 
     return r;
 }
@@ -2354,10 +2354,10 @@ find_open_db_by_dname (OMTVALUE v, void *dnamev) {
 }
 
 // return true if there is any db open with the given dname
-static BOOL
+static bool
 env_is_db_with_dname_open(DB_ENV *env, const char *dname) {
     int r;
-    BOOL rval;
+    bool rval;
     OMTVALUE dbv;
     uint32_t idx;
     toku_mutex_lock(&env->i->open_dbs_lock);
@@ -2365,11 +2365,11 @@ env_is_db_with_dname_open(DB_ENV *env, const char *dname) {
     if (r==0) {
         DB *db = (DB *) dbv;
         assert(strcmp(dname, db->i->dname) == 0);
-        rval = TRUE;
+        rval = true;
     }
     else {
         assert(r==DB_NOTFOUND);
-        rval = FALSE;
+        rval = false;
     }
     toku_mutex_unlock(&env->i->open_dbs_lock);
     return rval;
@@ -2430,7 +2430,7 @@ can_acquire_table_lock(DB_ENV *env, DB_TXN *txn, const char *iname_in_env) {
 }
 
 int
-toku_env_dbremove(DB_ENV * env, DB_TXN *txn, const char *fname, const char *dbname, u_int32_t flags) {
+toku_env_dbremove(DB_ENV * env, DB_TXN *txn, const char *fname, const char *dbname, uint32_t flags) {
     int r;
     HANDLE_PANICKED_ENV(env);
     if (!env_opened(env) || flags != 0) {
@@ -2466,7 +2466,7 @@ toku_env_dbremove(DB_ENV * env, DB_TXN *txn, const char *fname, const char *dbna
         goto exit;
     }
     // remove (dname,iname) from directory
-    r = toku_db_del(env->i->directory, txn, &dname_dbt, DB_DELETE_ANY, TRUE);
+    r = toku_db_del(env->i->directory, txn, &dname_dbt, DB_DELETE_ANY, true);
     if (r != 0) {
         goto exit;
     }
@@ -2516,7 +2516,7 @@ toku_env_dbremove(DB_ENV * env, DB_TXN *txn, const char *fname, const char *dbna
 }
 
 static int
-env_dbrename_subdb(DB_ENV *env, DB_TXN *txn, const char *fname, const char *dbname, const char *newname, u_int32_t flags) {
+env_dbrename_subdb(DB_ENV *env, DB_TXN *txn, const char *fname, const char *dbname, const char *newname, uint32_t flags) {
     int r;
     if (!fname || !dbname || !newname) r = EINVAL;
     else {
@@ -2538,7 +2538,7 @@ env_dbrename_subdb(DB_ENV *env, DB_TXN *txn, const char *fname, const char *dbna
 
 
 int
-toku_env_dbrename(DB_ENV *env, DB_TXN *txn, const char *fname, const char *dbname, const char *newname, u_int32_t flags) {
+toku_env_dbrename(DB_ENV *env, DB_TXN *txn, const char *fname, const char *dbname, const char *newname, uint32_t flags) {
     int r;
     HANDLE_PANICKED_ENV(env);
     if (!env_opened(env) || flags != 0) {
@@ -2581,9 +2581,9 @@ toku_env_dbrename(DB_ENV *env, DB_TXN *txn, const char *fname, const char *dbnam
         }
         else if (r == DB_NOTFOUND) {
             // remove old (dname,iname) and insert (newname,iname) in directory
-            r = toku_db_del(env->i->directory, txn, &old_dname_dbt, DB_DELETE_ANY, TRUE);
+            r = toku_db_del(env->i->directory, txn, &old_dname_dbt, DB_DELETE_ANY, true);
             if (r != 0) { goto exit; }
-            r = toku_db_put(env->i->directory, txn, &new_dname_dbt, &iname_dbt, 0, TRUE);
+            r = toku_db_put(env->i->directory, txn, &new_dname_dbt, &iname_dbt, 0, true);
             if (r != 0) { goto exit; }
 
             //Now that we have writelocks on both dnames, verify that there are still no handles open. (to prevent race conditions)
@@ -2622,7 +2622,7 @@ toku_env_dbrename(DB_ENV *env, DB_TXN *txn, const char *fname, const char *dbnam
 }
 
 int 
-DB_CREATE_FUN (DB ** db, DB_ENV * env, u_int32_t flags) {
+DB_CREATE_FUN (DB ** db, DB_ENV * env, uint32_t flags) {
     int r = toku_db_create(db, env, flags); 
     return r;
 }
diff --git a/src/ydb.h b/src/ydb.h
index 0a56a08eb2d0b91de4b8efa3044767d17100ae22..e2046b975aa714c7b5b3cedfe7e15fad8cc92e5e 100644
--- a/src/ydb.h
+++ b/src/ydb.h
@@ -17,10 +17,10 @@ int toku_ydb_init(void);
 void toku_ydb_destroy(void);
 
 // db_env_create for the trace library
-int db_env_create_toku10(DB_ENV **, u_int32_t) __attribute__((__visibility__("default")));
+int db_env_create_toku10(DB_ENV **, uint32_t) __attribute__((__visibility__("default")));
 
 // db_create for the trace library
-int db_create_toku10(DB **, DB_ENV *, u_int32_t) __attribute__((__visibility__("default")));
+int db_create_toku10(DB **, DB_ENV *, uint32_t) __attribute__((__visibility__("default")));
 
 // test only function
 extern "C" int toku_test_db_redirect_dictionary(DB * db, const char * dname_of_new_file, DB_TXN *dbtxn) __attribute__((__visibility__("default")));
diff --git a/src/ydb_cursor.cc b/src/ydb_cursor.cc
index 841de6fcc85a851b37c50626f0a97e5aa81c1960..b9b535346f5ad006de73bf8fc5a2b0f12fc2ec24 100644
--- a/src/ydb_cursor.cc
+++ b/src/ydb_cursor.cc
@@ -42,20 +42,20 @@ ydb_c_layer_get_status(YDB_C_LAYER_STATUS statp) {
 
 
 /* lightweight cursor methods. */
-static int toku_c_getf_current_binding(DBC *c, u_int32_t flag, YDB_CALLBACK_FUNCTION f, void *extra);
+static int toku_c_getf_current_binding(DBC *c, uint32_t flag, YDB_CALLBACK_FUNCTION f, void *extra);
 
 //Get the main portion of a cursor flag (excluding the bitwise or'd components).
 static int 
-get_main_cursor_flag(u_int32_t flags) {
+get_main_cursor_flag(uint32_t flags) {
     return flags & DB_OPFLAGS_MASK;
 }
 
 static int 
-get_nonmain_cursor_flags(u_int32_t flags) {
+get_nonmain_cursor_flags(uint32_t flags) {
     return flags & ~(DB_OPFLAGS_MASK);
 }
 
-static inline BOOL 
+static inline bool 
 toku_c_uninitialized(DBC* c) {
     return toku_ft_cursor_uninitialized(dbc_struct_i(c)->c);
 }            
@@ -85,7 +85,7 @@ c_get_wrapper_callback(DBT const *key, DBT const *val, void *extra) {
 }
 
 static int 
-toku_c_get_current_unconditional(DBC* c, u_int32_t flags, DBT* key, DBT* val) {
+toku_c_get_current_unconditional(DBC* c, uint32_t flags, DBT* key, DBT* val) {
     int r;
     QUERY_CONTEXT_WRAPPED_S context; 
     query_context_wrapped_init(&context, c, key, val);
@@ -93,9 +93,9 @@ toku_c_get_current_unconditional(DBC* c, u_int32_t flags, DBT* key, DBT* val) {
     return r;
 }
 
-static inline u_int32_t 
-get_cursor_prelocked_flags(u_int32_t flags, DBC* dbc) {
-    u_int32_t lock_flags = flags & (DB_PRELOCKED | DB_PRELOCKED_WRITE);
+static inline uint32_t 
+get_cursor_prelocked_flags(uint32_t flags, DBC* dbc) {
+    uint32_t lock_flags = flags & (DB_PRELOCKED | DB_PRELOCKED_WRITE);
 
     //DB_READ_UNCOMMITTED and DB_READ_COMMITTED transactions 'own' all read locks for user-data dictionaries.
     if (dbc_struct_i(dbc)->iso != TOKU_ISO_SERIALIZABLE) {
@@ -114,8 +114,8 @@ typedef struct query_context_base_t {
     YDB_CALLBACK_FUNCTION f;
     void       *f_extra;
     int         r_user_callback;
-    BOOL        do_locking;
-    BOOL        is_write_op;
+    bool        do_locking;
+    bool        is_write_op;
     toku_lock_request lock_request;
 } *QUERY_CONTEXT_BASE, QUERY_CONTEXT_BASE_S;
 
@@ -130,17 +130,17 @@ typedef struct query_context_with_input_t {
 } *QUERY_CONTEXT_WITH_INPUT, QUERY_CONTEXT_WITH_INPUT_S;
 
 static void
-query_context_base_init(QUERY_CONTEXT_BASE context, DBC *c, u_int32_t flag, BOOL is_write_op, YDB_CALLBACK_FUNCTION f, void *extra) {
+query_context_base_init(QUERY_CONTEXT_BASE context, DBC *c, uint32_t flag, bool is_write_op, YDB_CALLBACK_FUNCTION f, void *extra) {
     context->c       = dbc_struct_i(c)->c;
     context->txn     = dbc_struct_i(c)->txn;
     context->db      = c->dbp;
     context->f       = f;
     context->f_extra = extra;
     context->is_write_op = is_write_op;
-    u_int32_t lock_flags = get_cursor_prelocked_flags(flag, c);
+    uint32_t lock_flags = get_cursor_prelocked_flags(flag, c);
     if (context->is_write_op) 
         lock_flags &= DB_PRELOCKED_WRITE; // Only care about whether already locked for write
-    context->do_locking = (BOOL)(context->db->i->lt!=NULL && !(lock_flags & (DB_PRELOCKED|DB_PRELOCKED_WRITE)));
+    context->do_locking = (bool)(context->db->i->lt!=NULL && !(lock_flags & (DB_PRELOCKED|DB_PRELOCKED_WRITE)));
     context->r_user_callback = 0;
     toku_lock_request_default_init(&context->lock_request);
 }
@@ -151,21 +151,21 @@ query_context_base_destroy(QUERY_CONTEXT_BASE context) {
 }
 
 static void
-query_context_init_read(QUERY_CONTEXT context, DBC *c, u_int32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
-    BOOL is_write = FALSE;
+query_context_init_read(QUERY_CONTEXT context, DBC *c, uint32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
+    bool is_write = false;
     query_context_base_init(&context->base, c, flag, is_write, f, extra);
 }
 
 static void
-query_context_init_write(QUERY_CONTEXT context, DBC *c, u_int32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
-    BOOL is_write = TRUE;
+query_context_init_write(QUERY_CONTEXT context, DBC *c, uint32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
+    bool is_write = true;
     query_context_base_init(&context->base, c, flag, is_write, f, extra);
 }
 
 static void
-query_context_with_input_init(QUERY_CONTEXT_WITH_INPUT context, DBC *c, u_int32_t flag, DBT *key, DBT *val, YDB_CALLBACK_FUNCTION f, void *extra) {
+query_context_with_input_init(QUERY_CONTEXT_WITH_INPUT context, DBC *c, uint32_t flag, DBT *key, DBT *val, YDB_CALLBACK_FUNCTION f, void *extra) {
     // grab write locks if the DB_RMW flag is set or the cursor was created with the DB_RMW flag
-    BOOL is_write = ((flag & DB_RMW) != 0) || dbc_struct_i(c)->rmw;
+    bool is_write = ((flag & DB_RMW) != 0) || dbc_struct_i(c)->rmw;
     query_context_base_init(&context->base, c, flag, is_write, f, extra);
     context->input_key = key;
     context->input_val = val;
@@ -174,11 +174,11 @@ query_context_with_input_init(QUERY_CONTEXT_WITH_INPUT context, DBC *c, u_int32_
 static int c_getf_first_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val, void *extra, bool);
 
 static void 
-c_query_context_init(QUERY_CONTEXT context, DBC *c, u_int32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
-    BOOL is_write_op = FALSE;
+c_query_context_init(QUERY_CONTEXT context, DBC *c, uint32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
+    bool is_write_op = false;
     // grab write locks if the DB_RMW flag is set or the cursor was created with the DB_RMW flag
     if ((flag & DB_RMW) || dbc_struct_i(c)->rmw)
-        is_write_op = TRUE;
+        is_write_op = true;
     if (is_write_op)
         query_context_init_write(context, c, flag, f, extra);
     else
@@ -191,7 +191,7 @@ c_query_context_destroy(QUERY_CONTEXT context) {
 }
 
 static int
-toku_c_getf_first(DBC *c, u_int32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
+toku_c_getf_first(DBC *c, uint32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
     HANDLE_PANICKED_DB(c->dbp);
     HANDLE_CURSOR_ILLEGAL_WORKING_PARENT_TXN(c);
     int r = 0;
@@ -243,7 +243,7 @@ c_getf_first_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val,
 static int c_getf_last_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val, void *extra, bool);
 
 static int
-toku_c_getf_last(DBC *c, u_int32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
+toku_c_getf_last(DBC *c, uint32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
     HANDLE_PANICKED_DB(c->dbp);
     HANDLE_CURSOR_ILLEGAL_WORKING_PARENT_TXN(c);
     int r = 0;
@@ -295,7 +295,7 @@ c_getf_last_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val, v
 static int c_getf_next_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val, void *extra, bool);
 
 static int
-toku_c_getf_next(DBC *c, u_int32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
+toku_c_getf_next(DBC *c, uint32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
     int r;
     HANDLE_PANICKED_DB(c->dbp);
     HANDLE_CURSOR_ILLEGAL_WORKING_PARENT_TXN(c);
@@ -355,7 +355,7 @@ c_getf_next_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val, v
 static int c_getf_prev_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val, void *extra, bool);
 
 static int
-toku_c_getf_prev(DBC *c, u_int32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
+toku_c_getf_prev(DBC *c, uint32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
     int r;
     HANDLE_PANICKED_DB(c->dbp);
     HANDLE_CURSOR_ILLEGAL_WORKING_PARENT_TXN(c);
@@ -414,7 +414,7 @@ c_getf_prev_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val, v
 static int c_getf_current_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val, void *extra, bool);
 
 static int
-toku_c_getf_current(DBC *c, u_int32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
+toku_c_getf_current(DBC *c, uint32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
     HANDLE_PANICKED_DB(c->dbp);
     HANDLE_CURSOR_ILLEGAL_WORKING_PARENT_TXN(c);
 
@@ -449,7 +449,7 @@ c_getf_current_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val
 }
 
 static int
-toku_c_getf_current_binding(DBC *c, u_int32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
+toku_c_getf_current_binding(DBC *c, uint32_t flag, YDB_CALLBACK_FUNCTION f, void *extra) {
     HANDLE_PANICKED_DB(c->dbp);
     HANDLE_CURSOR_ILLEGAL_WORKING_PARENT_TXN(c);
 
@@ -465,7 +465,7 @@ toku_c_getf_current_binding(DBC *c, u_int32_t flag, YDB_CALLBACK_FUNCTION f, voi
 static int c_getf_set_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val, void *extra, bool);
 
 int
-toku_c_getf_set(DBC *c, u_int32_t flag, DBT *key, YDB_CALLBACK_FUNCTION f, void *extra) {
+toku_c_getf_set(DBC *c, uint32_t flag, DBT *key, YDB_CALLBACK_FUNCTION f, void *extra) {
     HANDLE_PANICKED_DB(c->dbp);
     HANDLE_CURSOR_ILLEGAL_WORKING_PARENT_TXN(c);
 
@@ -519,7 +519,7 @@ c_getf_set_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val, vo
 static int c_getf_set_range_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val, void *extra, bool);
 
 static int
-toku_c_getf_set_range(DBC *c, u_int32_t flag, DBT *key, YDB_CALLBACK_FUNCTION f, void *extra) {
+toku_c_getf_set_range(DBC *c, uint32_t flag, DBT *key, YDB_CALLBACK_FUNCTION f, void *extra) {
     HANDLE_PANICKED_DB(c->dbp);
     HANDLE_CURSOR_ILLEGAL_WORKING_PARENT_TXN(c);
 
@@ -576,7 +576,7 @@ c_getf_set_range_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec v
 static int c_getf_set_range_reverse_callback(ITEMLEN keylen, bytevec key, ITEMLEN vallen, bytevec val, void *extra, bool);
 
 static int
-toku_c_getf_set_range_reverse(DBC *c, u_int32_t flag, DBT *key, YDB_CALLBACK_FUNCTION f, void *extra) {
+toku_c_getf_set_range_reverse(DBC *c, uint32_t flag, DBT *key, YDB_CALLBACK_FUNCTION f, void *extra) {
     HANDLE_PANICKED_DB(c->dbp);
     HANDLE_CURSOR_ILLEGAL_WORKING_PARENT_TXN(c);
 
@@ -664,7 +664,7 @@ init_dbt_realloc(DBT *dbt) {
 // Return the number of entries whose key matches the key currently 
 // pointed to by the brt cursor.  
 static int 
-toku_c_count(DBC *cursor, db_recno_t *count, u_int32_t flags) {
+toku_c_count(DBC *cursor, db_recno_t *count, uint32_t flags) {
     HANDLE_PANICKED_DB(cursor->dbp);
     HANDLE_CURSOR_ILLEGAL_WORKING_PARENT_TXN(cursor);
     int r;
@@ -672,7 +672,7 @@ toku_c_count(DBC *cursor, db_recno_t *count, u_int32_t flags) {
     DBT currentkey;
 
     init_dbt_realloc(&currentkey);
-    u_int32_t lock_flags = get_cursor_prelocked_flags(flags, cursor);
+    uint32_t lock_flags = get_cursor_prelocked_flags(flags, cursor);
     flags &= ~lock_flags;
     if (flags != 0) {
         r = EINVAL; goto finish;
@@ -725,13 +725,13 @@ toku_c_pre_acquire_range_lock(DBC *dbc, const DBT *key_left, const DBT *key_righ
 }
 
 int
-toku_c_get(DBC* c, DBT* key, DBT* val, u_int32_t flag) {
+toku_c_get(DBC* c, DBT* key, DBT* val, uint32_t flag) {
     //This function exists for legacy (test compatibility) purposes/parity with bdb.
     HANDLE_PANICKED_DB(c->dbp);
     HANDLE_CURSOR_ILLEGAL_WORKING_PARENT_TXN(c);
 
-    u_int32_t main_flag       = get_main_cursor_flag(flag);
-    u_int32_t remaining_flags = get_nonmain_cursor_flags(flag);
+    uint32_t main_flag       = get_main_cursor_flag(flag);
+    uint32_t remaining_flags = get_nonmain_cursor_flags(flag);
     int r;
     QUERY_CONTEXT_WRAPPED_S context;
     //Passing in NULL for a key or val means that it is NOT an output.
@@ -795,7 +795,7 @@ toku_c_get(DBC* c, DBT* key, DBT* val, u_int32_t flag) {
 }
 
 int 
-toku_db_cursor_internal(DB * db, DB_TXN * txn, DBC ** c, u_int32_t flags, int is_temporary_cursor) {
+toku_db_cursor_internal(DB * db, DB_TXN * txn, DBC ** c, uint32_t flags, int is_temporary_cursor) {
     HANDLE_PANICKED_DB(db);
     HANDLE_DB_ILLEGAL_WORKING_PARENT_TXN(db, txn);
     DB_ENV* env = db->dbenv;
@@ -853,7 +853,7 @@ toku_db_cursor_internal(DB * db, DB_TXN * txn, DBC ** c, u_int32_t flags, int is
         dbc_struct_i(result)->iso = txn ? db_txn_struct_i(txn)->iso : TOKU_ISO_SERIALIZABLE;
     }
     dbc_struct_i(result)->rmw = (flags & DB_RMW) != 0;
-    BOOL is_snapshot_read = FALSE;
+    bool is_snapshot_read = false;
     if (txn) {
         is_snapshot_read = (dbc_struct_i(result)->iso == TOKU_ISO_READ_COMMITTED || 
                             dbc_struct_i(result)->iso == TOKU_ISO_SNAPSHOT);
@@ -886,7 +886,7 @@ toku_db_cursor_internal(DB * db, DB_TXN * txn, DBC ** c, u_int32_t flags, int is
 }
 
 static inline int 
-autotxn_db_cursor(DB *db, DB_TXN *txn, DBC **c, u_int32_t flags) {
+autotxn_db_cursor(DB *db, DB_TXN *txn, DBC **c, uint32_t flags) {
     if (!txn && (db->dbenv->i->open_flags & DB_INIT_TXN)) {
         return toku_ydb_do_error(db->dbenv, EINVAL,
               "Cursors in a transaction environment must have transactions.\n");
@@ -897,7 +897,7 @@ autotxn_db_cursor(DB *db, DB_TXN *txn, DBC **c, u_int32_t flags) {
 // Create a cursor on a db.
 // Called without holding the ydb lock.
 int 
-toku_db_cursor(DB *db, DB_TXN *txn, DBC **c, u_int32_t flags) {
+toku_db_cursor(DB *db, DB_TXN *txn, DBC **c, uint32_t flags) {
     int r = autotxn_db_cursor(db, txn, c, flags);
     return r;
 }
diff --git a/src/ydb_cursor.h b/src/ydb_cursor.h
index cdf9b046c7e388196ad01bf46b17640df3d30d68..68efbb89432be01df6405aa843088255beff787e 100644
--- a/src/ydb_cursor.h
+++ b/src/ydb_cursor.h
@@ -14,17 +14,17 @@ typedef enum {
 } ydb_c_lock_layer_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[YDB_C_LAYER_STATUS_NUM_ROWS];
 } YDB_C_LAYER_STATUS_S, *YDB_C_LAYER_STATUS;
 
 void ydb_c_layer_get_status(YDB_C_LAYER_STATUS statp);
 
-int toku_c_get(DBC * c, DBT * key, DBT * data, u_int32_t flag);
-int toku_c_getf_set(DBC *c, u_int32_t flag, DBT *key, YDB_CALLBACK_FUNCTION f, void *extra);
+int toku_c_get(DBC * c, DBT * key, DBT * data, uint32_t flag);
+int toku_c_getf_set(DBC *c, uint32_t flag, DBT *key, YDB_CALLBACK_FUNCTION f, void *extra);
 int toku_c_close(DBC * c);
-int toku_db_cursor_internal(DB *db, DB_TXN * txn, DBC **c, u_int32_t flags, int is_temporary_cursor);
-int toku_db_cursor(DB *db, DB_TXN *txn, DBC **c, u_int32_t flags);
+int toku_db_cursor_internal(DB *db, DB_TXN * txn, DBC **c, uint32_t flags, int is_temporary_cursor);
+int toku_db_cursor(DB *db, DB_TXN *txn, DBC **c, uint32_t flags);
 
 
 
diff --git a/src/ydb_db.cc b/src/ydb_db.cc
index cbd0afeb3675788745c52beb5ce797c458760209..e9aac2e0680d34cc80faec954329d9740c92d00d 100644
--- a/src/ydb_db.cc
+++ b/src/ydb_db.cc
@@ -63,18 +63,18 @@ create_iname_hint(const char *dname, char *hint) {
     //Requires: size of hint array must be > strlen(dname)
     //Copy alphanumeric characters only.
     //Replace strings of non-alphanumeric characters with a single underscore.
-    BOOL underscored = FALSE;
+    bool underscored = false;
     while (*dname) {
         if (isalnum(*dname)) {
             char c = *dname++;
             *hint++ = c;
-            underscored = FALSE;
+            underscored = false;
         }
         else {
             if (!underscored)
                 *hint++ = '_';
             dname++;
-            underscored = TRUE;
+            underscored = true;
         }
     }
     *hint = '\0';
@@ -85,7 +85,7 @@ create_iname_hint(const char *dname, char *hint) {
 // n >= 0 means to include mark ("_B_" or "_P_") with hex value of n in iname
 // (intended for use by loader, which will create many inames using one txnid).
 static char *
-create_iname(DB_ENV *env, u_int64_t id, char *hint, const char *mark, int n) {
+create_iname(DB_ENV *env, uint64_t id, char *hint, const char *mark, int n) {
     int bytes;
     char inamebase[strlen(hint) +
                    8 +  // hex file format version
@@ -113,7 +113,7 @@ create_iname(DB_ENV *env, u_int64_t id, char *hint, const char *mark, int n) {
     return rval;
 }
 
-static int toku_db_open(DB * db, DB_TXN * txn, const char *fname, const char *dbname, DBTYPE dbtype, u_int32_t flags, int mode);
+static int toku_db_open(DB * db, DB_TXN * txn, const char *fname, const char *dbname, DBTYPE dbtype, uint32_t flags, int mode);
 
 // Effect: Do the work required of DB->close().
 // requires: the multi_operation client lock is held.
@@ -143,7 +143,7 @@ toku_db_close(DB * db) {
 //db_getf_XXX is equivalent to c_getf_XXX, without a persistent cursor
 
 int
-db_getf_set(DB *db, DB_TXN *txn, u_int32_t flags, DBT *key, YDB_CALLBACK_FUNCTION f, void *extra) {
+db_getf_set(DB *db, DB_TXN *txn, uint32_t flags, DBT *key, YDB_CALLBACK_FUNCTION f, void *extra) {
     HANDLE_PANICKED_DB(db);
     HANDLE_DB_ILLEGAL_WORKING_PARENT_TXN(db, txn);
     DBC *c;
@@ -164,16 +164,16 @@ db_thread_need_flags(DBT *dbt) {
 }
 
 int 
-toku_db_get (DB * db, DB_TXN * txn, DBT * key, DBT * data, u_int32_t flags) {
+toku_db_get (DB * db, DB_TXN * txn, DBT * key, DBT * data, uint32_t flags) {
     HANDLE_PANICKED_DB(db);
     HANDLE_DB_ILLEGAL_WORKING_PARENT_TXN(db, txn);
     int r;
-    u_int32_t iso_flags = flags & DB_ISOLATION_FLAGS;
+    uint32_t iso_flags = flags & DB_ISOLATION_FLAGS;
 
     if ((db->i->open_flags & DB_THREAD) && db_thread_need_flags(data))
         return EINVAL;
 
-    u_int32_t lock_flags = flags & (DB_PRELOCKED | DB_PRELOCKED_WRITE);
+    uint32_t lock_flags = flags & (DB_PRELOCKED | DB_PRELOCKED_WRITE);
     flags &= ~lock_flags;
     flags &= ~DB_ISOLATION_FLAGS;
     // And DB_GET_BOTH is no longer supported. #2862.
@@ -183,14 +183,14 @@ toku_db_get (DB * db, DB_TXN * txn, DBT * key, DBT * data, u_int32_t flags) {
     DBC *dbc;
     r = toku_db_cursor_internal(db, txn, &dbc, iso_flags | DBC_DISABLE_PREFETCHING, 1);
     if (r!=0) return r;
-    u_int32_t c_get_flags = DB_SET;
+    uint32_t c_get_flags = DB_SET;
     r = toku_c_get(dbc, key, data, c_get_flags | lock_flags);
     int r2 = toku_c_close(dbc);
     return r ? r : r2;
 }
 
 static int
-db_open_subdb(DB * db, DB_TXN * txn, const char *fname, const char *dbname, DBTYPE dbtype, u_int32_t flags, int mode) {
+db_open_subdb(DB * db, DB_TXN * txn, const char *fname, const char *dbname, DBTYPE dbtype, uint32_t flags, int mode) {
     int r;
     if (!fname || !dbname) r = EINVAL;
     else {
@@ -212,7 +212,7 @@ db_open_subdb(DB * db, DB_TXN * txn, const char *fname, const char *dbname, DBTY
 //  if created a new iname, take full range lock
 // Requires: no checkpoint may take place during this function, which is enforced by holding the multi_operation_client_lock.
 static int 
-toku_db_open(DB * db, DB_TXN * txn, const char *fname, const char *dbname, DBTYPE dbtype, u_int32_t flags, int mode) {
+toku_db_open(DB * db, DB_TXN * txn, const char *fname, const char *dbname, DBTYPE dbtype, uint32_t flags, int mode) {
     HANDLE_PANICKED_DB(db);
     if (dbname != NULL) {
         return db_open_subdb(db, txn, fname, dbname, dbtype, flags, mode);
@@ -224,7 +224,7 @@ toku_db_open(DB * db, DB_TXN * txn, const char *fname, const char *dbname, DBTYP
     const char * dname = fname;  // db_open_subdb() converts (fname, dbname) to dname
 
     ////////////////////////////// do some level of parameter checking.
-    u_int32_t unused_flags = flags;
+    uint32_t unused_flags = flags;
     int r;
     if (dbtype!=DB_BTREE && dbtype!=DB_UNKNOWN) return EINVAL;
     int is_db_excl    = flags & DB_EXCL;    unused_flags&=~DB_EXCL;
@@ -268,7 +268,7 @@ toku_db_open(DB * db, DB_TXN * txn, const char *fname, const char *dbname, DBTYP
         char hint[strlen(dname) + 1];
 
         // create iname and make entry in directory
-        u_int64_t id = 0;
+        uint64_t id = 0;
 
         if (txn) {
             id = toku_txn_get_txnid(db_txn_struct_i(txn)->tokutxn);
@@ -281,8 +281,8 @@ toku_db_open(DB * db, DB_TXN * txn, const char *fname, const char *dbname, DBTYP
         // if we are creating a hot index, per #3166, we do not want the write lock  in directory grabbed.
         // directory read lock is grabbed in toku_db_get above
         //
-        u_int32_t put_flags = 0 | ((is_db_hot_index) ? DB_PRELOCKED_WRITE : 0); 
-        r = toku_db_put(db->dbenv->i->directory, txn, &dname_dbt, &iname_dbt, put_flags, TRUE);  
+        uint32_t put_flags = 0 | ((is_db_hot_index) ? DB_PRELOCKED_WRITE : 0); 
+        r = toku_db_put(db->dbenv->i->directory, txn, &dname_dbt, &iname_dbt, put_flags, true);  
     }
 
     // we now have an iname
@@ -351,14 +351,14 @@ lt_on_close_callback(toku_lock_tree *lt) {
 }
 
 int 
-db_open_iname(DB * db, DB_TXN * txn, const char *iname_in_env, u_int32_t flags, int mode) {
+db_open_iname(DB * db, DB_TXN * txn, const char *iname_in_env, uint32_t flags, int mode) {
     int r;
 
     //Set comparison functions if not yet set.
     if (!db->i->key_compare_was_set && db->dbenv->i->bt_compare) {
         r = toku_ft_set_bt_compare(db->i->ft_handle, db->dbenv->i->bt_compare);
         assert(r==0);
-        db->i->key_compare_was_set = TRUE;
+        db->i->key_compare_was_set = true;
     }
     if (db->dbenv->i->update_function) {
         r = toku_ft_set_update(db->i->ft_handle,db->dbenv->i->update_function);
@@ -369,7 +369,7 @@ db_open_iname(DB * db, DB_TXN * txn, const char *iname_in_env, u_int32_t flags,
         db_on_redirect_callback,
         db
         );
-    BOOL need_locktree = (BOOL)((db->dbenv->i->open_flags & DB_INIT_LOCK) &&
+    bool need_locktree = (bool)((db->dbenv->i->open_flags & DB_INIT_LOCK) &&
                                 (db->dbenv->i->open_flags & DB_INIT_TXN));
 
     int is_db_excl    = flags & DB_EXCL;    flags&=~DB_EXCL;
@@ -473,14 +473,14 @@ int toku_db_pre_acquire_fileops_lock(DB *db, DB_TXN *txn) {
 //     ONLY immediately after creating the dictionary and before doing any actual work on the dictionary.
 //
 static int 
-toku_db_change_descriptor(DB *db, DB_TXN* txn, const DBT* descriptor, u_int32_t flags) {
+toku_db_change_descriptor(DB *db, DB_TXN* txn, const DBT* descriptor, uint32_t flags) {
     HANDLE_PANICKED_DB(db);
     HANDLE_DB_ILLEGAL_WORKING_PARENT_TXN(db, txn);
     int r;
     TOKUTXN ttxn = txn ? db_txn_struct_i(txn)->tokutxn : NULL;
     DBT old_descriptor;
-    BOOL is_db_hot_index  = ((flags & DB_IS_HOT_INDEX) != 0);
-    BOOL update_cmp_descriptor = ((flags & DB_UPDATE_CMP_DESCRIPTOR) != 0);
+    bool is_db_hot_index  = ((flags & DB_IS_HOT_INDEX) != 0);
+    bool update_cmp_descriptor = ((flags & DB_UPDATE_CMP_DESCRIPTOR) != 0);
 
     toku_init_dbt(&old_descriptor);
     if (!db_opened(db) || !descriptor || (descriptor->size>0 && !descriptor->data)){
@@ -505,7 +505,7 @@ toku_db_change_descriptor(DB *db, DB_TXN* txn, const DBT* descriptor, u_int32_t
         db->i->ft_handle, 
         &old_descriptor, 
         descriptor, 
-        TRUE, 
+        true, 
         ttxn, 
         update_cmp_descriptor
         );
@@ -523,7 +523,7 @@ toku_db_change_descriptor(DB *db, DB_TXN* txn, const DBT* descriptor, u_int32_t
 }
 
 static int 
-toku_db_set_flags(DB *db, u_int32_t flags) {
+toku_db_set_flags(DB *db, uint32_t flags) {
     HANDLE_PANICKED_DB(db);
 
     /* the following matches BDB */
@@ -533,7 +533,7 @@ toku_db_set_flags(DB *db, u_int32_t flags) {
 }
 
 static int 
-toku_db_get_flags(DB *db, u_int32_t *pflags) {
+toku_db_get_flags(DB *db, uint32_t *pflags) {
     HANDLE_PANICKED_DB(db);
     if (!pflags) return EINVAL;
     *pflags = 0;
@@ -541,7 +541,7 @@ toku_db_get_flags(DB *db, u_int32_t *pflags) {
 }
 
 static int 
-toku_db_change_pagesize(DB *db, u_int32_t pagesize) {
+toku_db_change_pagesize(DB *db, uint32_t pagesize) {
     HANDLE_PANICKED_DB(db);
     if (!db_opened(db)) return EINVAL;
     toku_ft_handle_set_nodesize(db->i->ft_handle, pagesize);
@@ -549,7 +549,7 @@ toku_db_change_pagesize(DB *db, u_int32_t pagesize) {
 }
 
 static int 
-toku_db_set_pagesize(DB *db, u_int32_t pagesize) {
+toku_db_set_pagesize(DB *db, uint32_t pagesize) {
     HANDLE_PANICKED_DB(db);
     if (db_opened(db)) return EINVAL;
     toku_ft_handle_set_nodesize(db->i->ft_handle, pagesize);
@@ -557,14 +557,14 @@ toku_db_set_pagesize(DB *db, u_int32_t pagesize) {
 }
 
 static int 
-toku_db_get_pagesize(DB *db, u_int32_t *pagesize_ptr) {
+toku_db_get_pagesize(DB *db, uint32_t *pagesize_ptr) {
     HANDLE_PANICKED_DB(db);
     toku_ft_handle_get_nodesize(db->i->ft_handle, pagesize_ptr);
     return 0;
 }
 
 static int 
-toku_db_change_readpagesize(DB *db, u_int32_t readpagesize) {
+toku_db_change_readpagesize(DB *db, uint32_t readpagesize) {
     HANDLE_PANICKED_DB(db);
     if (!db_opened(db)) return EINVAL;
     toku_ft_handle_set_basementnodesize(db->i->ft_handle, readpagesize);
@@ -572,7 +572,7 @@ toku_db_change_readpagesize(DB *db, u_int32_t readpagesize) {
 }
 
 static int 
-toku_db_set_readpagesize(DB *db, u_int32_t readpagesize) {
+toku_db_set_readpagesize(DB *db, uint32_t readpagesize) {
     HANDLE_PANICKED_DB(db);
     if (db_opened(db)) return EINVAL;
     toku_ft_handle_set_basementnodesize(db->i->ft_handle, readpagesize);
@@ -580,7 +580,7 @@ toku_db_set_readpagesize(DB *db, u_int32_t readpagesize) {
 }
 
 static int 
-toku_db_get_readpagesize(DB *db, u_int32_t *readpagesize_ptr) {
+toku_db_get_readpagesize(DB *db, uint32_t *readpagesize_ptr) {
     HANDLE_PANICKED_DB(db);
     toku_ft_handle_get_basementnodesize(db->i->ft_handle, readpagesize_ptr);
     return 0;
@@ -632,7 +632,7 @@ toku_db_stat64(DB * db, DB_TXN *txn, DB_BTREE_STAT64 *s) {
 }
 
 static int 
-toku_db_key_range64(DB* db, DB_TXN* txn __attribute__((__unused__)), DBT* key, u_int64_t* less, u_int64_t* equal, u_int64_t* greater, int* is_exact) {
+toku_db_key_range64(DB* db, DB_TXN* txn __attribute__((__unused__)), DBT* key, uint64_t* less, uint64_t* equal, uint64_t* greater, int* is_exact) {
     HANDLE_PANICKED_DB(db);
     HANDLE_DB_ILLEGAL_WORKING_PARENT_TXN(db, txn);
 
@@ -659,7 +659,7 @@ toku_db_pre_acquire_table_lock(DB *db, DB_TXN *txn) {
 }
 
 static int 
-locked_db_close(DB * db, u_int32_t UU(flags)) {
+locked_db_close(DB * db, uint32_t UU(flags)) {
     // cannot begin a checkpoint
     toku_multi_operation_client_lock();
     int r = toku_db_close(db);
@@ -668,25 +668,25 @@ locked_db_close(DB * db, u_int32_t UU(flags)) {
 }
 
 int 
-autotxn_db_get(DB* db, DB_TXN* txn, DBT* key, DBT* data, u_int32_t flags) {
-    BOOL changed; int r;
-    r = toku_db_construct_autotxn(db, &txn, &changed, FALSE);
+autotxn_db_get(DB* db, DB_TXN* txn, DBT* key, DBT* data, uint32_t flags) {
+    bool changed; int r;
+    r = toku_db_construct_autotxn(db, &txn, &changed, false);
     if (r!=0) return r;
     r = toku_db_get(db, txn, key, data, flags);
     return toku_db_destruct_autotxn(txn, r, changed);
 }
 
 static inline int 
-autotxn_db_getf_set (DB *db, DB_TXN *txn, u_int32_t flags, DBT *key, YDB_CALLBACK_FUNCTION f, void *extra) {
-    BOOL changed; int r;
-    r = toku_db_construct_autotxn(db, &txn, &changed, FALSE);
+autotxn_db_getf_set (DB *db, DB_TXN *txn, uint32_t flags, DBT *key, YDB_CALLBACK_FUNCTION f, void *extra) {
+    bool changed; int r;
+    r = toku_db_construct_autotxn(db, &txn, &changed, false);
     if (r!=0) return r;
     r = db_getf_set(db, txn, flags, key, f, extra);
     return toku_db_destruct_autotxn(txn, r, changed);
 }
 
 static int 
-locked_db_open(DB *db, DB_TXN *txn, const char *fname, const char *dbname, DBTYPE dbtype, u_int32_t flags, int mode) {
+locked_db_open(DB *db, DB_TXN *txn, const char *fname, const char *dbname, DBTYPE dbtype, uint32_t flags, int mode) {
     int ret, r;
     HANDLE_DB_ILLEGAL_WORKING_PARENT_TXN(db, txn);
 
@@ -722,7 +722,7 @@ locked_db_open(DB *db, DB_TXN *txn, const char *fname, const char *dbname, DBTYP
 }
 
 static int 
-locked_db_change_descriptor(DB *db, DB_TXN* txn, const DBT* descriptor, u_int32_t flags) {
+locked_db_change_descriptor(DB *db, DB_TXN* txn, const DBT* descriptor, uint32_t flags) {
     toku_multi_operation_client_lock(); //Cannot begin checkpoint
     int r = toku_db_change_descriptor(db, txn, descriptor, flags);
     toku_multi_operation_client_unlock(); //Can now begin checkpoint
@@ -839,7 +839,7 @@ toku_db_verify_with_progress(DB *db, int (*progress_callback)(void *extra, float
     return r;
 }
 
-int toku_setup_db_internal (DB **dbp, DB_ENV *env, u_int32_t flags, FT_HANDLE brt, bool is_open) {
+int toku_setup_db_internal (DB **dbp, DB_ENV *env, uint32_t flags, FT_HANDLE brt, bool is_open) {
     if (flags || env == NULL) 
         return EINVAL;
 
@@ -865,7 +865,7 @@ int toku_setup_db_internal (DB **dbp, DB_ENV *env, u_int32_t flags, FT_HANDLE br
 }
 
 int 
-toku_db_create(DB ** db, DB_ENV * env, u_int32_t flags) {
+toku_db_create(DB ** db, DB_ENV * env, uint32_t flags) {
     if (flags || env == NULL) 
         return EINVAL;
 
@@ -950,7 +950,7 @@ toku_db_create(DB ** db, DB_ENV * env, u_int32_t flags) {
 // to indicate that the file is created by the brt loader.
 // Return 0 on success (could fail if write lock not available).
 static int
-load_inames(DB_ENV * env, DB_TXN * txn, int N, DB * dbs[/*N*/], const char * new_inames_in_env[/*N*/], LSN *load_lsn, BOOL mark_as_loader) {
+load_inames(DB_ENV * env, DB_TXN * txn, int N, DB * dbs[/*N*/], const char * new_inames_in_env[/*N*/], LSN *load_lsn, bool mark_as_loader) {
     int rval = 0;
     int i;
     
@@ -982,7 +982,7 @@ load_inames(DB_ENV * env, DB_TXN * txn, int N, DB * dbs[/*N*/], const char * new
         const char *new_iname = create_iname(env, xid, hint, mark, i);               // allocates memory for iname_in_env
         new_inames_in_env[i] = new_iname;
         toku_fill_dbt(&iname_dbt, new_iname, strlen(new_iname) + 1);      // iname_in_env goes in directory
-        rval = toku_db_put(env->i->directory, txn, &dname_dbt, &iname_dbt, 0, TRUE);
+        rval = toku_db_put(env->i->directory, txn, &dname_dbt, &iname_dbt, 0, true);
         if (rval) break;
     }
 
@@ -1006,7 +1006,7 @@ load_inames(DB_ENV * env, DB_TXN * txn, int N, DB * dbs[/*N*/], const char * new
 }
 
 int
-locked_load_inames(DB_ENV * env, DB_TXN * txn, int N, DB * dbs[/*N*/], char * new_inames_in_env[/*N*/], LSN *load_lsn, BOOL mark_as_loader) {
+locked_load_inames(DB_ENV * env, DB_TXN * txn, int N, DB * dbs[/*N*/], char * new_inames_in_env[/*N*/], LSN *load_lsn, bool mark_as_loader) {
     int ret, r;
 
     DB_TXN *child_txn = NULL;
diff --git a/src/ydb_db.h b/src/ydb_db.h
index 439556051673333f8734992976011a626599cef9..e939e2896ea227f621de47f08033ed32866f9adc 100644
--- a/src/ydb_db.h
+++ b/src/ydb_db.h
@@ -20,7 +20,7 @@ typedef enum {
 } ydb_db_lock_layer_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[YDB_DB_LAYER_STATUS_NUM_ROWS];
 } YDB_DB_LAYER_STATUS_S, *YDB_DB_LAYER_STATUS;
 
@@ -38,36 +38,36 @@ toku_db_get_compare_fun(DB* db) {
 }
 
 int toku_db_pre_acquire_fileops_lock(DB *db, DB_TXN *txn);
-int db_open_iname(DB * db, DB_TXN * txn, const char *iname, u_int32_t flags, int mode);
+int db_open_iname(DB * db, DB_TXN * txn, const char *iname, uint32_t flags, int mode);
 int toku_db_pre_acquire_table_lock(DB *db, DB_TXN *txn);
-int toku_db_get (DB * db, DB_TXN * txn, DBT * key, DBT * data, u_int32_t flags);
-int toku_db_create(DB ** db, DB_ENV * env, u_int32_t flags);
+int toku_db_get (DB * db, DB_TXN * txn, DBT * key, DBT * data, uint32_t flags);
+int toku_db_create(DB ** db, DB_ENV * env, uint32_t flags);
 int toku_db_close(DB * db);
-int toku_setup_db_internal (DB **dbp, DB_ENV *env, u_int32_t flags, FT_HANDLE brt, bool is_open);
-int db_getf_set(DB *db, DB_TXN *txn, u_int32_t flags, DBT *key, YDB_CALLBACK_FUNCTION f, void *extra);
-int autotxn_db_get(DB* db, DB_TXN* txn, DBT* key, DBT* data, u_int32_t flags);
+int toku_setup_db_internal (DB **dbp, DB_ENV *env, uint32_t flags, FT_HANDLE brt, bool is_open);
+int db_getf_set(DB *db, DB_TXN *txn, uint32_t flags, DBT *key, YDB_CALLBACK_FUNCTION f, void *extra);
+int autotxn_db_get(DB* db, DB_TXN* txn, DBT* key, DBT* data, uint32_t flags);
 
 //TODO: DB_AUTO_COMMIT.
 //TODO: Nowait only conditionally?
 //TODO: NOSYNC change to SYNC if DB_ENV has something in set_flags
 static inline int 
-toku_db_construct_autotxn(DB* db, DB_TXN **txn, BOOL* changed, BOOL force_auto_commit) {
+toku_db_construct_autotxn(DB* db, DB_TXN **txn, bool* changed, bool force_auto_commit) {
     assert(db && txn && changed);
     DB_ENV* env = db->dbenv;
     if (*txn || !(env->i->open_flags & DB_INIT_TXN)) {
-        *changed = FALSE;
+        *changed = false;
         return 0;
     }
-    BOOL nosync = (BOOL)(!force_auto_commit && !(env->i->open_flags & DB_AUTO_COMMIT));
-    u_int32_t txn_flags = DB_TXN_NOWAIT | (nosync ? DB_TXN_NOSYNC : 0);
+    bool nosync = (bool)(!force_auto_commit && !(env->i->open_flags & DB_AUTO_COMMIT));
+    uint32_t txn_flags = DB_TXN_NOWAIT | (nosync ? DB_TXN_NOSYNC : 0);
     int r = toku_txn_begin(env, NULL, txn, txn_flags);
     if (r!=0) return r;
-    *changed = TRUE;
+    *changed = true;
     return 0;
 }
 
 static inline int 
-toku_db_destruct_autotxn(DB_TXN *txn, int r, BOOL changed) {
+toku_db_destruct_autotxn(DB_TXN *txn, int r, bool changed) {
     if (!changed) return r;
     if (r==0) {
         r = locked_txn_commit(txn, 0);
diff --git a/src/ydb_env_func.cc b/src/ydb_env_func.cc
index 34479571dbcf8369862ba4a99aca1e1a47756f74..3e66825896a864e98c497367f27d3ff6c28727fb 100644
--- a/src/ydb_env_func.cc
+++ b/src/ydb_env_func.cc
@@ -136,7 +136,7 @@ db_env_set_loader_size_factor (uint32_t factor) {
 }
 
 void 
-db_env_set_mvcc_garbage_collection_verification(u_int32_t verification_mode) {
+db_env_set_mvcc_garbage_collection_verification(uint32_t verification_mode) {
     garbage_collection_debug = (verification_mode != 0);
 }
 
diff --git a/src/ydb_lib.cc b/src/ydb_lib.cc
index ddb3cfb52a594f96c5157db0ff0db2ee1d2b4e93..3e6c0ab7767fb2867588bf224fa74a66ceb5a51d 100644
--- a/src/ydb_lib.cc
+++ b/src/ydb_lib.cc
@@ -30,7 +30,7 @@ static void __attribute__((destructor)) libtokudb_destroy(void) {
 #include <windows.h>
 #define UNUSED(x) x=x
 
-BOOL WINAPI DllMain(HINSTANCE h, DWORD reason, LPVOID reserved) {
+bool WINAPI DllMain(HINSTANCE h, DWORD reason, LPVOID reserved) {
     UNUSED(h); UNUSED(reserved);
     // printf("%s:%lu\n", __FUNCTION__, reason);
     int r = 0;
@@ -53,7 +53,7 @@ BOOL WINAPI DllMain(HINSTANCE h, DWORD reason, LPVOID reserved) {
         break;
     }
     assert(r==0);
-    return TRUE;
+    return true;
 }
 
 #endif
diff --git a/src/ydb_load.h b/src/ydb_load.h
index 582c70b541bb3a8aeced0723b6c8da2b4ef1796a..ad770507d39dc83752e8ae27cce84a8f57b3d4bb 100644
--- a/src/ydb_load.h
+++ b/src/ydb_load.h
@@ -27,6 +27,6 @@ int locked_load_inames(DB_ENV * env,
                        DB * dbs[/*N*/],
                        char * new_inames_in_env[/*N*/], /* out */
                        LSN *load_lsn,
-                       BOOL mark_as_loader);
+                       bool mark_as_loader);
 
 #endif
diff --git a/src/ydb_txn.cc b/src/ydb_txn.cc
index c09434af5d92773096c0dbb6b6868c71764351f5..30db09acf7d755df8596cf6e656afdf6af9b30b5 100644
--- a/src/ydb_txn.cc
+++ b/src/ydb_txn.cc
@@ -53,7 +53,7 @@ toku_txn_destroy(DB_TXN *txn) {
 }
 
 static int
-toku_txn_commit(DB_TXN * txn, u_int32_t flags,
+toku_txn_commit(DB_TXN * txn, uint32_t flags,
                 TXN_PROGRESS_POLL_FUNCTION poll, void *poll_extra,
                 bool release_mo_lock) {
     HANDLE_PANICKED_ENV(txn->mgrp);
@@ -101,7 +101,7 @@ toku_txn_commit(DB_TXN * txn, u_int32_t flags,
     TOKUTXN ttxn = db_txn_struct_i(txn)->tokutxn;
     TOKULOGGER logger = txn->mgrp->i->logger;
     LSN do_fsync_lsn;
-    BOOL do_fsync;
+    bool do_fsync;
     toku_txn_get_fsync_info(ttxn, &do_fsync, &do_fsync_lsn);
     // remove the txn from the list of live transactions, and then
     // release the lock tree locks. MVCC requires that toku_txn_complete_txn
@@ -125,15 +125,15 @@ toku_txn_commit(DB_TXN * txn, u_int32_t flags,
     return r;
 }
 
-static u_int32_t 
+static uint32_t 
 toku_txn_id(DB_TXN * txn) {
     HANDLE_PANICKED_ENV(txn->mgrp);
     toku_ydb_barf();
     abort();
-    return (u_int32_t) -1;
+    return (uint32_t) -1;
 }
 
-static u_int64_t 
+static uint64_t 
 toku_txn_id64(DB_TXN * txn) {
     HANDLE_PANICKED_ENV(txn->mgrp);
     return toku_txn_get_id(db_txn_struct_i(txn)->tokutxn);
@@ -226,7 +226,7 @@ toku_txn_xa_prepare (DB_TXN *txn, TOKU_XA_XID *xid) {
 // requires: must hold the multi operation lock. it is
 //           released in toku_txn_xa_prepare before the fsync.
 static int
-toku_txn_prepare (DB_TXN *txn, u_int8_t gid[DB_GID_SIZE]) {
+toku_txn_prepare (DB_TXN *txn, uint8_t gid[DB_GID_SIZE]) {
     TOKU_XA_XID xid;
     HELGRIND_ANNOTATE_NEW_MEMORY(&xid, sizeof(xid));
     xid.formatID=0x756b6f54; // "Toku"
@@ -236,9 +236,9 @@ toku_txn_prepare (DB_TXN *txn, u_int8_t gid[DB_GID_SIZE]) {
     return toku_txn_xa_prepare(txn, &xid);
 }
 
-static u_int32_t 
+static uint32_t 
 locked_txn_id(DB_TXN *txn) {
-    u_int32_t r = toku_txn_id(txn); 
+    uint32_t r = toku_txn_id(txn); 
     return r;
 }
 
@@ -255,7 +255,7 @@ locked_txn_txn_stat (DB_TXN *txn, struct txn_stat **txn_stat) {
 }
 
 static int
-locked_txn_commit_with_progress(DB_TXN *txn, u_int32_t flags,
+locked_txn_commit_with_progress(DB_TXN *txn, uint32_t flags,
                                 TXN_PROGRESS_POLL_FUNCTION poll, void* poll_extra) {
     TOKUTXN ttxn = db_txn_struct_i(txn)->tokutxn;
     if (toku_txn_requires_checkpoint(ttxn)) {
@@ -299,7 +299,7 @@ locked_txn_abort_with_progress(DB_TXN *txn,
 }
 
 int 
-locked_txn_commit(DB_TXN *txn, u_int32_t flags) {
+locked_txn_commit(DB_TXN *txn, uint32_t flags) {
     int r = locked_txn_commit_with_progress(txn, flags, NULL, NULL);
     return r;
 }
@@ -341,7 +341,7 @@ txn_func_init(DB_TXN *txn) {
 //     committed
 //
 int 
-toku_txn_begin(DB_ENV *env, DB_TXN * stxn, DB_TXN ** txn, u_int32_t flags) {
+toku_txn_begin(DB_ENV *env, DB_TXN * stxn, DB_TXN ** txn, uint32_t flags) {
     HANDLE_PANICKED_ENV(env);
     HANDLE_ILLEGAL_WORKING_PARENT_TXN(env, stxn); //Cannot create child while child already exists.
     if (!toku_logger_is_open(env->i->logger)) 
@@ -349,10 +349,10 @@ toku_txn_begin(DB_ENV *env, DB_TXN * stxn, DB_TXN ** txn, u_int32_t flags) {
     if (!(env->i->open_flags & DB_INIT_TXN))  
         return toku_ydb_do_error(env, EINVAL, "Environment does not have transactions enabled\n");
 
-    u_int32_t txn_flags = 0;
+    uint32_t txn_flags = 0;
     txn_flags |= DB_TXN_NOWAIT; //We do not support blocking locks. RFP remove this?
     TOKU_ISOLATION child_isolation = TOKU_ISO_SERIALIZABLE;
-    u_int32_t iso_flags = flags & DB_ISOLATION_FLAGS;
+    uint32_t iso_flags = flags & DB_ISOLATION_FLAGS;
     if (!(iso_flags == 0 || 
           iso_flags == DB_TXN_SNAPSHOT || 
           iso_flags == DB_READ_COMMITTED || 
@@ -398,7 +398,7 @@ toku_txn_begin(DB_ENV *env, DB_TXN * stxn, DB_TXN ** txn, u_int32_t flags) {
             child_isolation = stxn ? db_txn_struct_i(stxn)->iso : TOKU_ISO_SERIALIZABLE;
             break;
         default:
-            assert(FALSE); // error path is above, so this should not happen
+            assert(false); // error path is above, so this should not happen
             break;
     }
     if (stxn && child_isolation != db_txn_struct_i(stxn)->iso) {
diff --git a/src/ydb_txn.h b/src/ydb_txn.h
index 29bc052843a4f2e0b00b38bcc2a4cb0493f86d95..b9004ab6aeed2ad69e3b456d177f481a710dec98 100644
--- a/src/ydb_txn.h
+++ b/src/ydb_txn.h
@@ -13,9 +13,9 @@
 // internally to synchronize with begin checkpoint. callers
 // should not hold the multi operation lock.
 
-int toku_txn_begin(DB_ENV *env, DB_TXN * stxn, DB_TXN ** txn, u_int32_t flags);
+int toku_txn_begin(DB_ENV *env, DB_TXN * stxn, DB_TXN ** txn, uint32_t flags);
 
-int locked_txn_commit(DB_TXN *txn, u_int32_t flags);
+int locked_txn_commit(DB_TXN *txn, uint32_t flags);
 
 int locked_txn_abort(DB_TXN *txn);
 
diff --git a/src/ydb_write.cc b/src/ydb_write.cc
index d299738c06cf8ef172e5bbec6dcafb00a85548e2..07e3433ab47b02557c4c654508e3cda08b7e31cd 100644
--- a/src/ydb_write.cc
+++ b/src/ydb_write.cc
@@ -55,9 +55,9 @@ ydb_write_layer_get_status(YDB_WRITE_LAYER_STATUS statp) {
 }
 
 
-static inline u_int32_t 
-get_prelocked_flags(u_int32_t flags) {
-    u_int32_t lock_flags = flags & (DB_PRELOCKED | DB_PRELOCKED_WRITE);
+static inline uint32_t 
+get_prelocked_flags(uint32_t flags) {
+    uint32_t lock_flags = flags & (DB_PRELOCKED | DB_PRELOCKED_WRITE);
     return lock_flags;
 }
 
@@ -102,7 +102,7 @@ db_put_check_size_constraints(DB *db, const DBT *key, const DBT *val) {
 //Return 0 if insert is legal
 static int
 db_put_check_overwrite_constraint(DB *db, DB_TXN *txn, DBT *key,
-                                  u_int32_t lock_flags, u_int32_t overwrite_flag) {
+                                  uint32_t lock_flags, uint32_t overwrite_flag) {
     int r;
 
     if (overwrite_flag == 0) { // 0 (yesoverwrite) does not impose constraints.
@@ -128,17 +128,17 @@ db_put_check_overwrite_constraint(DB *db, DB_TXN *txn, DBT *key,
 
 
 int
-toku_db_del(DB *db, DB_TXN *txn, DBT *key, u_int32_t flags, BOOL holds_mo_lock) {
+toku_db_del(DB *db, DB_TXN *txn, DBT *key, uint32_t flags, bool holds_mo_lock) {
     HANDLE_PANICKED_DB(db);
     HANDLE_DB_ILLEGAL_WORKING_PARENT_TXN(db, txn);
 
-    u_int32_t unchecked_flags = flags;
+    uint32_t unchecked_flags = flags;
     //DB_DELETE_ANY means delete regardless of whether it exists in the db.
-    BOOL error_if_missing = (BOOL)(!(flags&DB_DELETE_ANY));
+    bool error_if_missing = (bool)(!(flags&DB_DELETE_ANY));
     unchecked_flags &= ~DB_DELETE_ANY;
-    u_int32_t lock_flags = get_prelocked_flags(flags);
+    uint32_t lock_flags = get_prelocked_flags(flags);
     unchecked_flags &= ~lock_flags;
-    BOOL do_locking = (BOOL)(db->i->lt && !(lock_flags&DB_PRELOCKED_WRITE));
+    bool do_locking = (bool)(db->i->lt && !(lock_flags&DB_PRELOCKED_WRITE));
 
     int r = 0;
     if (unchecked_flags!=0) {
@@ -171,12 +171,12 @@ toku_db_del(DB *db, DB_TXN *txn, DBT *key, u_int32_t flags, BOOL holds_mo_lock)
 
 
 int
-toku_db_put(DB *db, DB_TXN *txn, DBT *key, DBT *val, u_int32_t flags, BOOL holds_mo_lock) {
+toku_db_put(DB *db, DB_TXN *txn, DBT *key, DBT *val, uint32_t flags, bool holds_mo_lock) {
     HANDLE_PANICKED_DB(db);
     HANDLE_DB_ILLEGAL_WORKING_PARENT_TXN(db, txn);
     int r = 0;
 
-    u_int32_t lock_flags = get_prelocked_flags(flags);
+    uint32_t lock_flags = get_prelocked_flags(flags);
     flags &= ~lock_flags;
 
     r = db_put_check_size_constraints(db, key, val);
@@ -184,7 +184,7 @@ toku_db_put(DB *db, DB_TXN *txn, DBT *key, DBT *val, u_int32_t flags, BOOL holds
         //Do any checking required by the flags.
         r = db_put_check_overwrite_constraint(db, txn, key, lock_flags, flags);
     }
-    BOOL do_locking = (BOOL)(db->i->lt && !(lock_flags&DB_PRELOCKED_WRITE));
+    bool do_locking = (bool)(db->i->lt && !(lock_flags&DB_PRELOCKED_WRITE));
     if (r == 0 && do_locking) {
         //Do locking if necessary.
         r = get_point_write_lock(db, txn, key);
@@ -197,7 +197,7 @@ toku_db_put(DB *db, DB_TXN *txn, DBT *key, DBT *val, u_int32_t flags, BOOL holds
             type = FT_INSERT_NO_OVERWRITE;
         }
         if (!holds_mo_lock) toku_multi_operation_client_lock();
-        r = toku_ft_maybe_insert(db->i->ft_handle, key, val, ttxn, FALSE, ZERO_LSN, TRUE, type);
+        r = toku_ft_maybe_insert(db->i->ft_handle, key, val, ttxn, false, ZERO_LSN, true, type);
         if (!holds_mo_lock) toku_multi_operation_client_unlock();
     }
 
@@ -217,18 +217,18 @@ static int
 toku_db_update(DB *db, DB_TXN *txn,
                const DBT *key,
                const DBT *update_function_extra,
-               u_int32_t flags) {
+               uint32_t flags) {
     HANDLE_PANICKED_DB(db);
     HANDLE_DB_ILLEGAL_WORKING_PARENT_TXN(db, txn);
     int r = 0;
 
-    u_int32_t lock_flags = get_prelocked_flags(flags);
+    uint32_t lock_flags = get_prelocked_flags(flags);
     flags &= ~lock_flags;
 
     r = db_put_check_size_constraints(db, key, update_function_extra);
     if (r != 0) { goto cleanup; }
 
-    BOOL do_locking;
+    bool do_locking;
     do_locking = (db->i->lt && !(lock_flags & DB_PRELOCKED_WRITE));
     if (do_locking) {
         r = get_point_write_lock(db, txn, key);
@@ -239,7 +239,7 @@ toku_db_update(DB *db, DB_TXN *txn,
     ttxn = txn ? db_txn_struct_i(txn)->tokutxn : NULL;
     toku_multi_operation_client_lock();
     r = toku_ft_maybe_update(db->i->ft_handle, key, update_function_extra, ttxn,
-                              FALSE, ZERO_LSN, TRUE);
+                              false, ZERO_LSN, true);
     toku_multi_operation_client_unlock();
 
 cleanup:
@@ -258,16 +258,16 @@ toku_db_update(DB *db, DB_TXN *txn,
 static int
 toku_db_update_broadcast(DB *db, DB_TXN *txn,
                          const DBT *update_function_extra,
-                         u_int32_t flags) {
+                         uint32_t flags) {
     HANDLE_PANICKED_DB(db);
     HANDLE_DB_ILLEGAL_WORKING_PARENT_TXN(db, txn);
     int r = 0;
 
-    u_int32_t lock_flags = get_prelocked_flags(flags);
+    uint32_t lock_flags = get_prelocked_flags(flags);
     flags &= ~lock_flags;
-    u_int32_t is_resetting_op_flag = flags & DB_IS_RESETTING_OP;
+    uint32_t is_resetting_op_flag = flags & DB_IS_RESETTING_OP;
     flags &= is_resetting_op_flag;
-    BOOL is_resetting_op = (is_resetting_op_flag != 0);
+    bool is_resetting_op = (is_resetting_op_flag != 0);
     
 
     if (is_resetting_op) {
@@ -285,7 +285,7 @@ toku_db_update_broadcast(DB *db, DB_TXN *txn,
         if (r != 0) { goto cleanup; }
     }
 
-    BOOL do_locking;
+    bool do_locking;
     do_locking = (db->i->lt && !(lock_flags & DB_PRELOCKED_WRITE));
     if (do_locking) {
         r = toku_db_pre_acquire_table_lock(db, txn);
@@ -296,7 +296,7 @@ toku_db_update_broadcast(DB *db, DB_TXN *txn,
     ttxn = txn ? db_txn_struct_i(txn)->tokutxn : NULL;
     toku_multi_operation_client_lock();
     r = toku_ft_maybe_update_broadcast(db->i->ft_handle, update_function_extra, ttxn,
-                                        FALSE, ZERO_LSN, TRUE, is_resetting_op);
+                                        false, ZERO_LSN, true, is_resetting_op);
     toku_multi_operation_client_unlock();
 
 cleanup:
@@ -358,7 +358,7 @@ do_del_multiple(DB_TXN *txn, uint32_t num_dbs, DB *db_array[], DBT keys[], DB *s
 
         // if db is being indexed by an indexer, then insert a delete message into the db if the src key is to the left or equal to the 
         // indexers cursor.  we have to get the src_db from the indexer and find it in the db_array.
-        int do_delete = TRUE;
+        int do_delete = true;
         DB_INDEXER *indexer = toku_db_get_indexer(db);
         if (indexer) { // if this db is the index under construction
             DB *indexer_src_db = toku_indexer_get_src_db(indexer);
@@ -374,7 +374,7 @@ do_del_multiple(DB_TXN *txn, uint32_t num_dbs, DB *db_array[], DBT keys[], DB *s
             do_delete = !toku_indexer_is_key_right_of_le_cursor(indexer, indexer_src_key);
         }
         if (r == 0 && do_delete) {
-            r = toku_ft_maybe_delete(db->i->ft_handle, &keys[which_db], ttxn, FALSE, ZERO_LSN, FALSE);
+            r = toku_ft_maybe_delete(db->i->ft_handle, &keys[which_db], ttxn, false, ZERO_LSN, false);
         }
     }
     return r;
@@ -467,7 +467,7 @@ env_del_multiple(
             r = EINVAL;
             goto cleanup;
         }
-        BOOL error_if_missing = (BOOL)(!(remaining_flags[which_db]&DB_DELETE_ANY));
+        bool error_if_missing = (bool)(!(remaining_flags[which_db]&DB_DELETE_ANY));
         if (error_if_missing) {
             //Check if the key exists in the db.
             r = db_getf_set(db, txn, lock_flags[which_db]|DB_SERIALIZABLE|DB_RMW, &del_keys[which_db], ydb_getf_do_nothing, NULL);
@@ -536,7 +536,7 @@ do_put_multiple(DB_TXN *txn, uint32_t num_dbs, DB *db_array[], DBT keys[], DBT v
 
         // if db is being indexed by an indexer, then put into that db if the src key is to the left or equal to the 
         // indexers cursor.  we have to get the src_db from the indexer and find it in the db_array.
-        int do_put = TRUE;
+        int do_put = true;
         DB_INDEXER *indexer = toku_db_get_indexer(db);
         if (indexer) { // if this db is the index under construction
             DB *indexer_src_db = toku_indexer_get_src_db(indexer);
@@ -552,7 +552,7 @@ do_put_multiple(DB_TXN *txn, uint32_t num_dbs, DB *db_array[], DBT keys[], DBT v
             do_put = !toku_indexer_is_key_right_of_le_cursor(indexer, indexer_src_key);
         }
         if (r == 0 && do_put) {
-            r = toku_ft_maybe_insert(db->i->ft_handle, &keys[which_db], &vals[which_db], ttxn, FALSE, ZERO_LSN, FALSE, FT_INSERT);
+            r = toku_ft_maybe_insert(db->i->ft_handle, &keys[which_db], &vals[which_db], ttxn, false, ZERO_LSN, false, FT_INSERT);
         }
     }
     return r;
@@ -745,8 +745,8 @@ env_update_multiple(DB_ENV *env, DB *src_db, DB_TXN *txn,
                 curr_new_val = vals[which_db];
             }
             toku_dbt_cmp cmpfun = toku_db_get_compare_fun(db);
-            BOOL key_eq = cmpfun(db, &curr_old_key, &curr_new_key) == 0;
-            BOOL key_bytes_eq = (curr_old_key.size == curr_new_key.size && 
+            bool key_eq = cmpfun(db, &curr_old_key, &curr_new_key) == 0;
+            bool key_bytes_eq = (curr_old_key.size == curr_new_key.size && 
                                  (memcmp(curr_old_key.data, curr_new_key.data, curr_old_key.size) == 0)
                                  );
             if (!key_eq) {
@@ -830,25 +830,25 @@ env_update_multiple(DB_ENV *env, DB *src_db, DB_TXN *txn,
 }
 
 int 
-autotxn_db_del(DB* db, DB_TXN* txn, DBT* key, u_int32_t flags) {
-    BOOL changed; int r;
-    r = toku_db_construct_autotxn(db, &txn, &changed, FALSE);
+autotxn_db_del(DB* db, DB_TXN* txn, DBT* key, uint32_t flags) {
+    bool changed; int r;
+    r = toku_db_construct_autotxn(db, &txn, &changed, false);
     if (r!=0) return r;
-    r = toku_db_del(db, txn, key, flags, FALSE);
+    r = toku_db_del(db, txn, key, flags, false);
     return toku_db_destruct_autotxn(txn, r, changed);
 }
 
 int 
-autotxn_db_put(DB* db, DB_TXN* txn, DBT* key, DBT* data, u_int32_t flags) {
+autotxn_db_put(DB* db, DB_TXN* txn, DBT* key, DBT* data, uint32_t flags) {
     //{ unsigned i; printf("put %p keylen=%d key={", db, key->size); for(i=0; i<key->size; i++) printf("%d,", ((char*)key->data)[i]); printf("} datalen=%d data={", data->size); for(i=0; i<data->size; i++) printf("%d,", ((char*)data->data)[i]); printf("}\n"); }
-    BOOL changed; int r;
+    bool changed; int r;
     r = env_check_avail_fs_space(db->dbenv);
     if (r != 0) { goto cleanup; }
-    r = toku_db_construct_autotxn(db, &txn, &changed, FALSE);
+    r = toku_db_construct_autotxn(db, &txn, &changed, false);
     if (r!=0) {
         goto cleanup;
     }
-    r = toku_db_put(db, txn, key, data, flags, FALSE);
+    r = toku_db_put(db, txn, key, data, flags, false);
     r = toku_db_destruct_autotxn(txn, r, changed);
 cleanup:
     return r;
@@ -858,11 +858,11 @@ int
 autotxn_db_update(DB *db, DB_TXN *txn,
                   const DBT *key,
                   const DBT *update_function_extra,
-                  u_int32_t flags) {
-    BOOL changed; int r;
+                  uint32_t flags) {
+    bool changed; int r;
     r = env_check_avail_fs_space(db->dbenv);
     if (r != 0) { goto cleanup; }
-    r = toku_db_construct_autotxn(db, &txn, &changed, FALSE);
+    r = toku_db_construct_autotxn(db, &txn, &changed, false);
     if (r != 0) { return r; }
     r = toku_db_update(db, txn, key, update_function_extra, flags);
     r = toku_db_destruct_autotxn(txn, r, changed);
@@ -873,11 +873,11 @@ autotxn_db_update(DB *db, DB_TXN *txn,
 int
 autotxn_db_update_broadcast(DB *db, DB_TXN *txn,
                             const DBT *update_function_extra,
-                            u_int32_t flags) {
-    BOOL changed; int r;
+                            uint32_t flags) {
+    bool changed; int r;
     r = env_check_avail_fs_space(db->dbenv);
     if (r != 0) { goto cleanup; }
-    r = toku_db_construct_autotxn(db, &txn, &changed, FALSE);
+    r = toku_db_construct_autotxn(db, &txn, &changed, false);
     if (r != 0) { return r; }
     r = toku_db_update_broadcast(db, txn, update_function_extra, flags);
     r = toku_db_destruct_autotxn(txn, r, changed);
diff --git a/src/ydb_write.h b/src/ydb_write.h
index 4a06b679cbcd84bd6b86583d6b6814f9ee207ef8..53bd032d5b132e153eeb3923fa4a04eaa12cad18 100644
--- a/src/ydb_write.h
+++ b/src/ydb_write.h
@@ -28,19 +28,19 @@ typedef enum {
 } ydb_write_lock_layer_status_entry;
 
 typedef struct {
-    BOOL initialized;
+    bool initialized;
     TOKU_ENGINE_STATUS_ROW_S status[YDB_WRITE_LAYER_STATUS_NUM_ROWS];
 } YDB_WRITE_LAYER_STATUS_S, *YDB_WRITE_LAYER_STATUS;
 
 void ydb_write_layer_get_status(YDB_WRITE_LAYER_STATUS statp);
 
 
-int toku_db_del(DB *db, DB_TXN *txn, DBT *key, u_int32_t flags, BOOL holds_mo_lock);
-int toku_db_put(DB *db, DB_TXN *txn, DBT *key, DBT *val, u_int32_t flags, BOOL holds_mo_lock);
-int autotxn_db_del(DB* db, DB_TXN* txn, DBT* key, u_int32_t flags);
-int autotxn_db_put(DB* db, DB_TXN* txn, DBT* key, DBT* data, u_int32_t flags);
-int autotxn_db_update(DB *db, DB_TXN *txn, const DBT *key, const DBT *update_function_extra, u_int32_t flags);
-int autotxn_db_update_broadcast(DB *db, DB_TXN *txn, const DBT *update_function_extra, u_int32_t flags);
+int toku_db_del(DB *db, DB_TXN *txn, DBT *key, uint32_t flags, bool holds_mo_lock);
+int toku_db_put(DB *db, DB_TXN *txn, DBT *key, DBT *val, uint32_t flags, bool holds_mo_lock);
+int autotxn_db_del(DB* db, DB_TXN* txn, DBT* key, uint32_t flags);
+int autotxn_db_put(DB* db, DB_TXN* txn, DBT* key, DBT* data, uint32_t flags);
+int autotxn_db_update(DB *db, DB_TXN *txn, const DBT *key, const DBT *update_function_extra, uint32_t flags);
+int autotxn_db_update_broadcast(DB *db, DB_TXN *txn, const DBT *update_function_extra, uint32_t flags);
 int env_put_multiple(
     DB_ENV *env, 
     DB *src_db, 
diff --git a/toku_include/old-db.h b/toku_include/old-db.h
index cbee1a6485a6ebdb46e775ea5b4f8a2ef916ac6d..f1c7942924198927387a6584373c6a66dbd0d0d9 100644
--- a/toku_include/old-db.h
+++ b/toku_include/old-db.h
@@ -44,20 +44,20 @@ typedef struct yobi_dbt DBT;
 
 struct yobi_db {
   void *app_private;
-  int  (*close) (DB *, u_int32_t);
-  int  (*cursor) (DB *, DB_TXN *, DBC **, u_int32_t);
-  int  (*del) (DB *, DB_TXN *, DBT *, u_int32_t);
-  int  (*get) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t);
-  int  (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, u_int32_t);
+  int  (*close) (DB *, uint32_t);
+  int  (*cursor) (DB *, DB_TXN *, DBC **, uint32_t);
+  int  (*del) (DB *, DB_TXN *, DBT *, uint32_t);
+  int  (*get) (DB *, DB_TXN *, DBT *, DBT *, uint32_t);
+  int  (*key_range) (DB *, DB_TXN *, DBT *, DB_KEY_RANGE *, uint32_t);
   int  (*open) (DB *, DB_TXN *,
-		const char *, const char *, DBTYPE, u_int32_t, int);
-  int  (*put) (DB *, DB_TXN *, DBT *, DBT *, u_int32_t);
-  int  (*remove) (DB *, const char *, const char *, u_int32_t);
-  int  (*rename) (DB *, const char *, const char *, const char *, u_int32_t);
+		const char *, const char *, DBTYPE, uint32_t, int);
+  int  (*put) (DB *, DB_TXN *, DBT *, DBT *, uint32_t);
+  int  (*remove) (DB *, const char *, const char *, uint32_t);
+  int  (*rename) (DB *, const char *, const char *, const char *, uint32_t);
   int  (*set_bt_compare) (DB *,
 			  int (*)(DB *, const DBT *, const DBT *));
-  int  (*set_flags)    (DB *, u_int32_t);
-  int  (*stat) (DB *, void *, u_int32_t);
+  int  (*set_flags)    (DB *, uint32_t);
+  int  (*stat) (DB *, void *, uint32_t);
 
   struct ydb_db_internal *i;
 };
@@ -70,48 +70,48 @@ enum {
 struct yobi_dbt {
   void	   *app_private;
   void     *data;
-  u_int32_t flags;
-  u_int32_t size;
-  u_int32_t ulen;
+  uint32_t flags;
+  uint32_t size;
+  uint32_t ulen;
 };
 struct yobi_db_txn {
-  int (*commit) (DB_TXN*, u_int32_t);
-  u_int32_t (*id) (DB_TXN *);
+  int (*commit) (DB_TXN*, uint32_t);
+  uint32_t (*id) (DB_TXN *);
   // internal stuff
   struct yobi_db_txn_internal *i;
 };
 struct yobi_dbc {
-  int (*c_get) (DBC *, DBT *, DBT *, u_int32_t);
+  int (*c_get) (DBC *, DBT *, DBT *, uint32_t);
   int (*c_close) (DBC *);
-  int (*c_del) (DBC *, u_int32_t);
+  int (*c_del) (DBC *, uint32_t);
   struct yobi_dbc_internal *i;
 };
 struct yobi_db_env {
   // Methods used by MYSQL
   void (*err) (const DB_ENV *, int, const char *, ...);
-  int  (*open) (DB_ENV *, const char *, u_int32_t, int);
-  int  (*close) (DB_ENV *, u_int32_t);
-  int  (*txn_checkpoint) (DB_ENV *, u_int32_t, u_int32_t, u_int32_t);
+  int  (*open) (DB_ENV *, const char *, uint32_t, int);
+  int  (*close) (DB_ENV *, uint32_t);
+  int  (*txn_checkpoint) (DB_ENV *, uint32_t, uint32_t, uint32_t);
   int  (*log_flush) (DB_ENV *, const DB_LSN *);
   void (*set_errcall) (DB_ENV *, void (*)(const char *, char *));
   void (*set_errpfx) (DB_ENV *, const char *);
   void (*set_noticecall) (DB_ENV *, void (*)(DB_ENV *, db_notices));
-  int  (*set_flags) (DB_ENV *, u_int32_t, int);
+  int  (*set_flags) (DB_ENV *, uint32_t, int);
   int  (*set_data_dir) (DB_ENV *, const char *);
   int  (*set_tmp_dir) (DB_ENV *, const char *);
-  int  (*set_verbose) (DB_ENV *, u_int32_t, int);
-  int  (*set_lg_bsize) (DB_ENV *, u_int32_t);
+  int  (*set_verbose) (DB_ENV *, uint32_t, int);
+  int  (*set_lg_bsize) (DB_ENV *, uint32_t);
   int  (*set_lg_dir) (DB_ENV *, const char *);
-  int  (*set_lg_max) (DB_ENV *, u_int32_t);
-  int  (*set_cachesize) (DB_ENV *, u_int32_t, u_int32_t, int);
-  int  (*set_lk_detect) (DB_ENV *, u_int32_t);
-  int  (*set_lk_max) (DB_ENV *, u_int32_t);
-  int  (*log_archive) (DB_ENV *, char **[], u_int32_t);
-  int  (*txn_stat) (DB_ENV *, DB_TXN_STAT **, u_int32_t);
+  int  (*set_lg_max) (DB_ENV *, uint32_t);
+  int  (*set_cachesize) (DB_ENV *, uint32_t, uint32_t, int);
+  int  (*set_lk_detect) (DB_ENV *, uint32_t);
+  int  (*set_lk_max) (DB_ENV *, uint32_t);
+  int  (*log_archive) (DB_ENV *, char **[], uint32_t);
+  int  (*txn_stat) (DB_ENV *, DB_TXN_STAT **, uint32_t);
 #ifdef _YDB_WRAP_H
 #undef txn_begin
 #endif
-  int  (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t);
+  int  (*txn_begin) (DB_ENV *, DB_TXN *, DB_TXN **, uint32_t);
 #ifdef _YDB_WRAP_H
 #define txn_begin txn_begin_ydb
 #endif
@@ -122,11 +122,11 @@ struct yobi_db_key_range {
   double less,equal,greater;
 };
 struct yobi_db_btree_stat {
-  u_int32_t bt_ndata;
-  u_int32_t bt_nkeys;
+  uint32_t bt_ndata;
+  uint32_t bt_nkeys;
 };
 struct yobi_db_txn_stat {
-  u_int32_t st_nactive;
+  uint32_t st_nactive;
   DB_TXN_ACTIVE *st_txnarray;
 };
 struct yobi_db_lsn {
@@ -134,7 +134,7 @@ struct yobi_db_lsn {
 };
 struct yobi_db_txn_active {
   DB_LSN	lsn;
-  u_int32_t	txnid;
+  uint32_t	txnid;
 };
 
 #ifndef _YDB_WRAP_H
@@ -179,11 +179,11 @@ enum {
   DB_INIT_TXN   = 0x008000
 };
 
-int db_create (DB **, DB_ENV *, u_int32_t);
-int db_env_create (DB_ENV **, u_int32_t);
+int db_create (DB **, DB_ENV *, uint32_t);
+int db_env_create (DB_ENV **, uint32_t);
 
-int txn_begin (DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t);
-int txn_commit (DB_TXN *, u_int32_t);
+int txn_begin (DB_ENV *, DB_TXN *, DB_TXN **, uint32_t);
+int txn_commit (DB_TXN *, uint32_t);
 int txn_abort (DB_TXN *);
 
 int log_compare (const DB_LSN *, const DB_LSN *);
diff --git a/toku_include/toku_portability.h b/toku_include/toku_portability.h
index 816a38f6a63e720a8748047c385447f8dad4ae60..88fdc6b87df4c926f5c5fd4a1a371806fe9b4848 100644
--- a/toku_include/toku_portability.h
+++ b/toku_include/toku_portability.h
@@ -189,6 +189,13 @@ extern void *realloc(void*, size_t)            __THROW __attribute__((__deprecat
 #    ifndef DONT_DEPRECATE_ERRNO
 //extern int errno __attribute__((__deprecated__));
 #    endif
+#pragma GCC poison u_int8_t
+#pragma GCC poison u_int16_t
+#pragma GCC poison u_int32_t
+#pragma GCC poison u_int64_t
+#pragma GCC poison BOOL
+#pragma GCC poison FALSE
+#pragma GCC poison TRUE
 #   endif
 #endif
 
diff --git a/utils/tokudb_common.h b/utils/tokudb_common.h
index 244340c35e742beb3c1d4fecea8b49114dfbd81e..ada6aeed3418cb2983826844b021e7cd08929e63 100644
--- a/utils/tokudb_common.h
+++ b/utils/tokudb_common.h
@@ -13,7 +13,6 @@
 #include <inttypes.h>
 #include <signal.h>
 #include <memory.h>
-#include <stdbool.h>
 
 #define SET_BITS(bitvector, bits)      ((bitvector) |= (bits))
 #define REMOVE_BITS(bitvector, bits)   ((bitvector) &= ~(bits))
diff --git a/utils/tokudb_common_funcs.h b/utils/tokudb_common_funcs.h
index 044c865f833cfa580db75fce962b94d4b18a57c0..fbf6e3af6d2e8c42e808d9d7b4671f90e1ffb7d8 100644
--- a/utils/tokudb_common_funcs.h
+++ b/utils/tokudb_common_funcs.h
@@ -35,9 +35,9 @@ else {                                                            \
 } while (0)
 
 int   strtoint32  (char* str,  int32_t* num,  int32_t min,  int32_t max, int base);
-int   strtouint32 (char* str, u_int32_t* num, u_int32_t min, u_int32_t max, int base);
+int   strtouint32 (char* str, uint32_t* num, uint32_t min, uint32_t max, int base);
 int   strtoint64  (char* str,  int64_t* num,  int64_t min,  int64_t max, int base);
-int   strtouint64 (char* str, u_int64_t* num, u_int64_t min, u_int64_t max, int base);
+int   strtouint64 (char* str, uint64_t* num, uint64_t min, uint64_t max, int base);
 
 /*
  * Convert a string to an integer of type "type".
@@ -89,12 +89,12 @@ error:                                                         \
 }
 
 DEF_STR_TO(strtoint32,  int32_t,  int64_t,  strtoll,  PRId32)
-DEF_STR_TO(strtouint32, u_int32_t, u_int64_t, strtoull, PRIu32)
+DEF_STR_TO(strtouint32, uint32_t, uint64_t, strtoull, PRIu32)
 DEF_STR_TO(strtoint64,  int64_t,  int64_t,  strtoll,  PRId64)
-DEF_STR_TO(strtouint64, u_int64_t, u_int64_t, strtoull, PRIu64)
+DEF_STR_TO(strtouint64, uint64_t, uint64_t, strtoull, PRIu64)
 
 static inline void
-outputbyte(u_int8_t ch)
+outputbyte(uint8_t ch)
 {
    if (g.plaintext) {
       if (ch == '\\')         printf("\\\\");
@@ -110,7 +110,7 @@ outputstring(char* str)
    char* p;
 
    for (p = str; *p != '\0'; p++) {
-      outputbyte((u_int8_t)*p);
+      outputbyte((uint8_t)*p);
    }
 }
 
diff --git a/utils/tokudb_dump.cc b/utils/tokudb_dump.cc
index 76874fdcf28c5dad12307596e2269bc8de863f96..ba523b78b0fbdec2349ab56553ef85d91fe6402e 100644
--- a/utils/tokudb_dump.cc
+++ b/utils/tokudb_dump.cc
@@ -312,7 +312,7 @@ int create_init_env()
 
 int dump_header()
 {
-   u_int32_t flags;
+   uint32_t flags;
    int retval;
    DB* db = g.db;
    
@@ -393,7 +393,7 @@ int open_database()
 static int dump_dbt(DBT* dbt)
 {
    char* str;
-   u_int32_t idx;
+   uint32_t idx;
    
    assert(dbt);
    str = (char*)dbt->data;
diff --git a/utils/tokudb_gen.cc b/utils/tokudb_gen.cc
index 58511045f9c0e5b7290cd49e61c50fca2b3d2fa6..b534a9c63fc99fec4d7f19aa02ef2efad25c0992 100644
--- a/utils/tokudb_gen.cc
+++ b/utils/tokudb_gen.cc
@@ -36,18 +36,18 @@ static int   get_delimiter(char* str);
 
 char           dbt_delimiter  = '\n';
 char           sort_delimiter[3];
-u_int32_t       lengthmin      = 0;
+uint32_t       lengthmin      = 0;
 bool           set_lengthmin  = false;
-u_int32_t       lengthlimit    = 0;
+uint32_t       lengthlimit    = 0;
 bool           set_lengthlimit= false;
-u_int64_t       numkeys        = 0;
+uint64_t       numkeys        = 0;
 bool           set_numkeys    = false;
 bool           header         = true;
 bool           footer         = true;
 bool           justheader     = false;
 bool           justfooter     = false;
 bool           outputkeys     = true;
-u_int32_t       seed           = 1;
+uint32_t       seed           = 1;
 bool           set_seed       = false;
 bool           printableonly  = false;
 bool           leadingspace   = true;
@@ -283,14 +283,14 @@ static int usage()
    return EXIT_FAILURE;
 }
 
-static u_int8_t randbyte(void)
+static uint8_t randbyte(void)
 {
-   static u_int32_t   numsavedbits   = 0;
-   static u_int64_t   savedbits      = 0;
-   u_int8_t           retval;
+   static uint32_t   numsavedbits   = 0;
+   static uint64_t   savedbits      = 0;
+   uint8_t           retval;
 
    if (numsavedbits < 8) {
-      savedbits |= ((u_int64_t)random()) << numsavedbits;
+      savedbits |= ((uint64_t)random()) << numsavedbits;
       numsavedbits += 31;  /* Random generates 31 random bits. */
    }
    retval         = savedbits & 0xff;
@@ -309,12 +309,12 @@ static int32_t random_below(int32_t limit)
 static void generate_keys()
 {
    bool     usedemptykey   = false;
-   u_int64_t  numgenerated   = 0;
-   u_int64_t  totalsize      = 0;
+   uint64_t  numgenerated   = 0;
+   uint64_t  totalsize      = 0;
    char     identifier[24]; /* 8 bytes * 2 = 16; 16+1=17; 17+null terminator = 18. Extra padding. */
    int      length;
    int      i;
-   u_int8_t  ch;
+   uint8_t  ch;
 
    srandom(seed);
    while (numgenerated < numkeys) {
diff --git a/utils/tokudb_load.cc b/utils/tokudb_load.cc
index 4a4b6756a80df9947ee77729c97808181ee30985..d1733824900fb9206f3836faad3a5b1826be2422 100644
--- a/utils/tokudb_load.cc
+++ b/utils/tokudb_load.cc
@@ -30,7 +30,7 @@ typedef struct {
    char**   config_options;
    int32_t  version;
    int      exitcode;
-   u_int64_t linenumber;
+   uint64_t linenumber;
    DBTYPE   dbtype;
    DB*      db;
    DB_ENV*  dbenv;
@@ -53,7 +53,7 @@ static int   open_database  (void);
 static int   read_keys      (void);
 static int   apply_commandline_options(void);
 static int   close_database (void);
-static int   doublechararray(char** pmem, u_int64_t* size);
+static int   doublechararray(char** pmem, uint64_t* size);
 
 int test_main(int argc, char *const argv[]) {
    int ch;
@@ -382,8 +382,8 @@ if (!strcmp(field, match)) {                             \
 
 int read_header()
 {
-   static u_int64_t datasize = 1 << 10;
-   u_int64_t idx = 0;
+   static uint64_t datasize = 1 << 10;
+   uint64_t idx = 0;
    char* field;
    char* value;
    int ch;
@@ -622,7 +622,7 @@ int open_database()
    return EXIT_FAILURE;
 }
 
-int doublechararray(char** pmem, u_int64_t* size)
+int doublechararray(char** pmem, uint64_t* size)
 {
    assert(pmem);
    assert(size);
@@ -630,7 +630,7 @@ int doublechararray(char** pmem, u_int64_t* size)
 
    *size <<= 1;
    if (*size == 0) {
-      /* Overflowed u_int64_t. */
+      /* Overflowed uint64_t. */
       PRINT_ERRORX("Line %" PRIu64 ": Line too long.\n", g.linenumber);
       goto error;
    }
@@ -647,10 +647,10 @@ int doublechararray(char** pmem, u_int64_t* size)
 static int get_dbt(DBT* pdbt)
 {
    /* Need to store a key and value. */
-   static u_int64_t datasize[2] = {1 << 10, 1 << 10};
+   static uint64_t datasize[2] = {1 << 10, 1 << 10};
    static int which = 0;
    char* datum;
-   u_int64_t idx = 0;
+   uint64_t idx = 0;
    int highch;
    int lowch;