Commit b56be64d authored by Hallvard Furuseth's avatar Hallvard Furuseth
Browse files

Drop ULONG in favor of size_t.

parent b1cfff4a
This diff is collapsed.
......@@ -232,10 +232,10 @@ typedef struct MDB_stat {
unsigned int ms_psize; /**< Size of a database page.
This is currently the same for all databases. */
unsigned int ms_depth; /**< Depth (height) of the B-tree */
unsigned long ms_branch_pages; /**< Number of internal (non-leaf) pages */
unsigned long ms_leaf_pages; /**< Number of leaf pages */
unsigned long ms_overflow_pages; /**< Number of overflow pages */
unsigned long ms_entries; /**< Number of data items */
size_t ms_branch_pages; /**< Number of internal (non-leaf) pages */
size_t ms_leaf_pages; /**< Number of leaf pages */
size_t ms_overflow_pages; /**< Number of overflow pages */
size_t ms_entries; /**< Number of data items */
} MDB_stat;
/** Return the mdb library version information.
......@@ -542,7 +542,7 @@ int mdb_txn_renew(MDB_txn *txn);
* <li>#MDB_INTEGERKEY
* Keys are binary integers in native byte order. Setting this option
* requires all keys to be the same size, typically sizeof(int)
* or sizeof(long).
* or sizeof(size_t).
* <li>#MDB_DUPFIXED
* This flag may only be used in combination with #MDB_DUPSORT. This option
* tells the library that the data items for this database are all the same
......@@ -839,7 +839,7 @@ int mdb_cursor_del(MDB_cursor *cursor, unsigned int flags);
* <li>EINVAL - cursor is not initialized, or an invalid parameter was specified.
* </ul>
*/
int mdb_cursor_count(MDB_cursor *cursor, unsigned long *countp);
int mdb_cursor_count(MDB_cursor *cursor, size_t *countp);
/** Compare two data items according to a particular database.
* This returns a comparison as if the two data items were keys in the
......
......@@ -52,10 +52,10 @@ int main(int argc,char * argv[])
rc = mdb_stat(txn, dbi, &mst);
printf("Page size: %u\n", mst.ms_psize);
printf("Tree depth: %u\n", mst.ms_depth);
printf("Branch pages: %lu\n", mst.ms_branch_pages);
printf("Leaf pages: %lu\n", mst.ms_leaf_pages);
printf("Overflow pages: %lu\n", mst.ms_overflow_pages);
printf("Entries: %lu\n", mst.ms_entries);
printf("Branch pages: %zu\n", mst.ms_branch_pages);
printf("Leaf pages: %zu\n", mst.ms_leaf_pages);
printf("Overflow pages: %zu\n", mst.ms_overflow_pages);
printf("Entries: %zu\n", mst.ms_entries);
mdb_close(txn, dbi);
mdb_txn_abort(txn);
mdb_env_close(env);
......
......@@ -26,19 +26,20 @@
#ifndef _MDB_MIDL_H_
#define _MDB_MIDL_H_
#include <stddef.h>
/** @defgroup internal MDB Internals
* @{
*/
/** ULONG should be the largest integer type supported on a machine.
* It should be equal to the size of a pointer.
*/
#define ULONG unsigned long
/** @defgroup idls ID List Management
* @{
*/
/** A generic ID number. These were entryIDs in back-bdb.
* It should be the largest integer type supported on a machine.
* It should be equal to the size of a pointer.
*/
typedef ULONG ID;
typedef size_t ID;
/** An IDL is an ID List, a sorted array of IDs. The first
* element of the array is a counter for how many actual
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment