From b0a8a6317fa87d17eacbaab0fd703c34267fe0f3 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Mon, 10 Dec 2012 10:01:32 +0000 Subject: Fix up a few more declarations that weren't fixed-size. --- examples/c/ex_all.c | 13 +++++++------ examples/c/ex_schema.c | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'examples') diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c index e9f7d6dba63..91ea0dab54a 100644 --- a/examples/c/ex_all.c +++ b/examples/c/ex_all.c @@ -132,17 +132,18 @@ cursor_ops(WT_SESSION *session) { /*! [Get the cursor's composite key] */ - /* Get the cursor's composite key. */ - const char *first, *third; - int second; + /* Get the cursor's "SiH" format composite key. */ + const char *first; + int32_t second; + uint16_t third; cursor->get_key(cursor, &first, &second, &third); /*! [Get the cursor's composite key] */ } { /*! [Set the cursor's composite key] */ - /* Set the cursor's composite key. */ - cursor->set_key(cursor, "first", 5, "second"); + /* Set the cursor's "SiH" format composite key. */ + cursor->set_key(cursor, "first", (int32_t)5, (uint16_t)7); /*! [Set the cursor's composite key] */ } @@ -420,7 +421,7 @@ session_ops(WT_SESSION *session) /*! [Create a table with columns] */ /* * Create a table with columns: keys are record numbers, values are - * (string, integer, unsigned short). + * (string, signed 32-bit integer, unsigned 16-bit integer). */ ret = session->create(session, "table:mytable", "key_format=r,value_format=SiH" diff --git a/examples/c/ex_schema.c b/examples/c/ex_schema.c index 23c17dfcdd3..1958f4e47d6 100644 --- a/examples/c/ex_schema.c +++ b/examples/c/ex_schema.c @@ -82,7 +82,7 @@ main(void) /* * Create the population table. * Keys are record numbers, the format for values is (5-byte string, - * unsigned short, unsigned long long). + * uint16_t, uint64_t). * See ::wiredtiger_struct_pack for details of the format strings. */ ret = session->create(session, "table:poptable", @@ -182,7 +182,7 @@ main(void) /* Search in a composite index. */ ret = session->open_cursor(session, "index:poptable:country_plus_year", NULL, NULL, &cursor); - cursor->set_key(cursor, "USA\0\0", (unsigned short)1900); + cursor->set_key(cursor, "USA\0\0", (uint16_t)1900); ret = cursor->search(cursor); ret = cursor->get_value(cursor, &country, &year, &population); printf("US 1900: country %s, year %u, population %" PRIu64 "\n", -- cgit v1.2.1