summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2012-03-15 17:54:12 +0000
committerKeith Bostic <keith@wiredtiger.com>2012-03-15 17:54:12 +0000
commit647398cbc1e82401c12c1461ac7a2e1329701385 (patch)
tree348d406786f8af5ac638b51669d22ea73aa45db0
parent7ca5081be310a8b550b71b83136c5540c06f0aa3 (diff)
downloadmongo-647398cbc1e82401c12c1461ac7a2e1329701385.tar.gz
lint, minor cleanups.
-rw-r--r--test/format/format.h1
-rw-r--r--test/format/util.c4
-rw-r--r--test/format/wts.c1
-rw-r--r--test/format/wts_ops.c14
4 files changed, 12 insertions, 8 deletions
diff --git a/test/format/format.h b/test/format/format.h
index 4ee5d89b900..92d5055e88a 100644
--- a/test/format/format.h
+++ b/test/format/format.h
@@ -17,7 +17,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <unistd.h>
#ifdef BDB
diff --git a/test/format/util.c b/test/format/util.c
index 648b5d82d9c..347352fd310 100644
--- a/test/format/util.c
+++ b/test/format/util.c
@@ -34,7 +34,7 @@ key_gen_setup(uint8_t **keyp)
if ((key = malloc(g.c_key_max)) == NULL)
die(errno, "malloc");
for (i = 0; i < g.c_key_max; ++i)
- key[i] = "abcdefghijklmnopqrstuvwxyz"[i % 26];
+ key[i] = (uint8_t)("abcdefghijklmnopqrstuvwxyz"[i % 26]);
*keyp = key;
}
@@ -80,7 +80,7 @@ val_gen_setup(uint8_t **valp)
if ((val = malloc(len)) == NULL)
die(errno, "malloc");
for (i = 0; i < len; ++i)
- val[i] = (u_char)"ABCDEFGHIJKLMNOPQRSTUVWXYZ"[i % 26];
+ val[i] = (uint8_t)("ABCDEFGHIJKLMNOPQRSTUVWXYZ"[i % 26]);
*valp = val;
}
diff --git a/test/format/wts.c b/test/format/wts.c
index 11e1f05d2e8..6474bd7447b 100644
--- a/test/format/wts.c
+++ b/test/format/wts.c
@@ -156,6 +156,7 @@ wts_dump(const char *tag, int dump_bdb)
snprintf(cmd, sizeof(cmd),
"sh ./s_dumpcmp%s -c", dump_bdb ? " -b" : "");
break;
+ default:
case ROW:
snprintf(cmd, sizeof(cmd),
"sh ./s_dumpcmp%s", dump_bdb ? " -b" : "");
diff --git a/test/format/wts_ops.c b/test/format/wts_ops.c
index f1bb8f9e7c9..dec8c07be3d 100644
--- a/test/format/wts_ops.c
+++ b/test/format/wts_ops.c
@@ -34,6 +34,7 @@ wts_ops(void)
conn = g.wts_conn;
/* Open a session. */
+ session = NULL;
if (g.logging == LOG_OPS) {
if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
die(ret, "connection.open_session");
@@ -82,11 +83,12 @@ wts_ops(void)
track("read/write ops", 0ULL, &total);
if (!running)
break;
- usleep(100000); /* 1/10th of a second */
+ (void)usleep(100000); /* 1/10th of a second */
}
+ free(tinfo);
}
- if (g.logging == LOG_OPS) {
+ if (session != NULL) {
(void)time(&now);
(void)session->msg_printf(session,
"===============\nthread ops stop: %s===============",
@@ -135,6 +137,7 @@ ops(void *arg)
* testing with new, appended records, we don't want to have to specify
* the record number, which requires an append configuration.
*/
+ cursor = cursor_insert = NULL;
if ((ret = session->open_cursor(session,
WT_TABLENAME, NULL, "overwrite", &cursor)) != 0)
die(ret, "session.open_cursor");
@@ -188,7 +191,8 @@ ops(void *arg)
* Reset the standard cursor so it doesn't keep
* pages pinned.
*/
- cursor->reset(cursor);
+ if ((ret = cursor->reset(cursor)) != 0)
+ die(ret, "cursor.reset");
col_insert(cursor_insert, &key, &value, &keyno);
insert = 1;
break;
@@ -223,8 +227,8 @@ ops(void *arg)
insert ? cursor_insert : cursor, dir, &notfound);
}
- if (insert)
- cursor_insert->reset(cursor_insert);
+ if (insert && (ret = cursor_insert->reset(cursor_insert)) != 0)
+ die(ret, "cursor.reset");
/* Read the value we modified to confirm the operation. */
read_row(cursor, &key, keyno);