summaryrefslogtreecommitdiff
path: root/test/format
diff options
context:
space:
mode:
authorDavid Hows <david.hows@mongodb.com>2016-06-24 17:05:13 +1000
committerDavid Hows <david.hows@mongodb.com>2016-06-24 17:05:13 +1000
commitd8fb874fc40989cb9675e56ca80b3b64e6fa2ee3 (patch)
tree6f03ed5cde97aedc762215c14d23ee5305998a2b /test/format
parentfb1663e6fc800be97c0ddc697b6f939dc610e08e (diff)
parent1f4aaa4490a82cf947afdabbb9214ee5b1850d13 (diff)
Merge branch 'develop' of github.com:wiredtiger/wiredtiger into mongodb-3.4mongodb-3.3.9mongodb-3.3.10mongodb-3.0.1
Diffstat (limited to 'test/format')
-rw-r--r--test/format/bdb.c14
-rw-r--r--test/format/format.h8
-rw-r--r--test/format/ops.c6
-rw-r--r--test/format/t.c3
-rw-r--r--test/format/wts.c4
5 files changed, 15 insertions, 20 deletions
diff --git a/test/format/bdb.c b/test/format/bdb.c
index 48229cfd5e7..e56281f2c3e 100644
--- a/test/format/bdb.c
+++ b/test/format/bdb.c
@@ -106,9 +106,9 @@ bdb_insert(
DBC *dbc;
key.data = (void *)key_data;
- key.size = (uint32_t)key_size;
+ key.size = (u_int32_t)key_size;
value.data = (void *)value_data;
- value.size = (uint32_t)value_size;
+ value.size = (u_int32_t)value_size;
dbc = g.dbc;
@@ -147,7 +147,7 @@ bdb_read(uint64_t keyno, void *valuep, size_t *valuesizep, int *notfoundp)
key_gen(&keyitem, keyno);
key.data = (void *)keyitem.data;
- key.size = keyitem.size;
+ key.size = (u_int32_t)keyitem.size;
*notfoundp = 0;
if ((ret = dbc->get(dbc, &key, &value, DB_SET)) != 0) {
@@ -169,9 +169,9 @@ bdb_update(const void *arg_key, size_t arg_key_size,
int ret;
key.data = (void *)arg_key;
- key.size = (uint32_t)arg_key_size;
+ key.size = (u_int32_t)arg_key_size;
value.data = (void *)arg_value;
- value.size = (uint32_t)arg_value_size;
+ value.size = (u_int32_t)arg_value_size;
if ((ret = dbc->put(dbc, &key, &value, DB_KEYFIRST)) != 0)
testutil_die(ret, "dbc.put: DB_KEYFIRST: {%.*s}{%.*s}",
@@ -188,10 +188,10 @@ bdb_remove(uint64_t keyno, int *notfoundp)
key_gen(&keyitem, keyno);
key.data = (void *)keyitem.data;
- key.size = keyitem.size;
+ key.size = (u_int32_t)keyitem.size;
bdb_read(keyno, &value.data, &size, notfoundp);
- value.size = (uint32_t)size;
+ value.size = (u_int32_t)size;
if (*notfoundp)
return;
diff --git a/test/format/format.h b/test/format/format.h
index 8fd9b113311..ad5f408ac30 100644
--- a/test/format/format.h
+++ b/test/format/format.h
@@ -33,12 +33,6 @@
#include <db.h>
#endif
-#if defined(__GNUC__)
-#define WT_GCC_ATTRIBUTE(x) __attribute__(x)
-#else
-#define WT_GCC_ATTRIBUTE(x)
-#endif
-
#define EXTPATH "../../ext/" /* Extensions path */
#define LZ4_PATH \
@@ -266,7 +260,7 @@ typedef struct {
#define TINFO_COMPLETE 2 /* Finished */
#define TINFO_JOINED 3 /* Resolved */
volatile int state; /* state */
-} TINFO WT_GCC_ATTRIBUTE((aligned(WT_CACHE_LINE_ALIGNMENT)));
+} TINFO WT_COMPILER_TYPE_ALIGN(WT_CACHE_LINE_ALIGNMENT);
#ifdef HAVE_BERKELEY_DB
void bdb_close(void);
diff --git a/test/format/ops.c b/test/format/ops.c
index 7fd5563f486..c97d82809a1 100644
--- a/test/format/ops.c
+++ b/test/format/ops.c
@@ -1465,7 +1465,7 @@ print_item(const char *tag, WT_ITEM *item)
static const char hex[] = "0123456789abcdef";
const uint8_t *data;
size_t size;
- int ch;
+ u_char ch;
data = item->data;
size = item->size;
@@ -1476,8 +1476,8 @@ print_item(const char *tag, WT_ITEM *item)
else
for (; size > 0; --size, ++data) {
ch = data[0];
- if (isprint(ch))
- fprintf(stderr, "%c", ch);
+ if (__wt_isprint(ch))
+ fprintf(stderr, "%c", (int)ch);
else
fprintf(stderr, "%x%x",
hex[(data[0] & 0xf0) >> 4],
diff --git a/test/format/t.c b/test/format/t.c
index 085163befe2..2eb2b078804 100644
--- a/test/format/t.c
+++ b/test/format/t.c
@@ -32,7 +32,8 @@ GLOBAL g;
static void format_die(void);
static void startup(void);
-static void usage(void);
+static void usage(void)
+ WT_GCC_FUNC_DECL_ATTRIBUTE((noreturn));
extern int __wt_optind;
extern char *__wt_optarg;
diff --git a/test/format/wts.c b/test/format/wts.c
index 2ee01aa75b5..69195abc3d4 100644
--- a/test/format/wts.c
+++ b/test/format/wts.c
@@ -87,10 +87,10 @@ handle_message(WT_EVENT_HANDLER *handler,
/* Write and flush the message so we're up-to-date on error. */
if (g.logfp == NULL) {
- out = printf("%p:%s\n", session, message);
+ out = printf("%p:%s\n", (void *)session, message);
(void)fflush(stdout);
} else {
- out = fprintf(g.logfp, "%p:%s\n", session, message);
+ out = fprintf(g.logfp, "%p:%s\n", (void *)session, message);
(void)fflush(g.logfp);
}
return (out < 0 ? EIO : 0);