diff options
-rw-r--r-- | bench/tcbench/wttest.c | 16 | ||||
-rw-r--r-- | examples/c/ex_all.c | 52 | ||||
-rw-r--r-- | examples/c/ex_extending.c | 6 | ||||
-rw-r--r-- | src/cursor/cur_index.c | 1 | ||||
-rw-r--r-- | src/include/cursor.i | 2 |
5 files changed, 46 insertions, 31 deletions
diff --git a/bench/tcbench/wttest.c b/bench/tcbench/wttest.c index a501ba07760..9cb0ce8d804 100644 --- a/bench/tcbench/wttest.c +++ b/bench/tcbench/wttest.c @@ -331,7 +331,7 @@ int teardown(void){ int dowrite(char *name, int rnum, int bulk, int rnd){ WT_CURSOR *c; WT_ITEM key, value; - int i, err, len; + int i, err; char buf[RECBUFSIZ]; if(showprgr) printf("<Write Test of Row Store>\n name=%s rnum=%d\n\n", name, rnum); @@ -347,7 +347,7 @@ int dowrite(char *name, int rnum, int bulk, int rnd){ /* loop for each record */ for(i = 1; i <= rnum; i++){ /* store a record */ - len = sprintf(buf, "%08d", rnd ? myrand() % rnum + 1 : i); + sprintf(buf, "%08d", rnd ? myrand() % rnum + 1 : i); c->set_key(c, &key); c->set_value(c, &value); if((err = c->insert(c)) != 0 && err != WT_DUPLICATE_KEY) { @@ -379,7 +379,7 @@ int dowrite(char *name, int rnum, int bulk, int rnd){ int doread(char *name, int rnum, int rnd){ WT_CURSOR *c; WT_ITEM key, value; - int i, err, len; + int i, err; char buf[RECBUFSIZ]; if(showprgr) printf("<Read Test of Row Store>\n name=%s rnum=%d\n\n", name, rnum); @@ -394,7 +394,7 @@ int doread(char *name, int rnum, int rnd){ /* loop for each record */ for(i = 1; i <= rnum; i++){ /* store a record */ - len = sprintf(buf, "%08d", rnd ? myrand() % rnum + 1 : i); + sprintf(buf, "%08d", rnd ? myrand() % rnum + 1 : i); c->set_key(c, &key); if(c->search(c) != 0){ fprintf(stderr, "search failed\n"); @@ -427,7 +427,7 @@ int doread(char *name, int rnum, int rnd){ int dovlcswrite(char *name, int rnum, int bulk, int rnd){ WT_CURSOR *c; WT_ITEM value; - int i, err, len; + int i, err; char buf[RECBUFSIZ]; if(showprgr) printf("<Write Test of var-length Column Store>\n name=%s rnum=%d\n\n", name, rnum); @@ -443,7 +443,7 @@ int dovlcswrite(char *name, int rnum, int bulk, int rnd){ /* loop for each record */ for(i = 1; i <= rnum; i++){ /* store a record */ - len = sprintf(buf, "%08d", i); + sprintf(buf, "%08d", i); c->set_key(c, (uint64_t)(rnd ? myrand() % rnum + 1 : i)); c->set_value(c, &value); if((err = c->insert(c)) != 0 && err != WT_DUPLICATE_KEY) { @@ -519,7 +519,7 @@ int dovlcsread(char *name, int rnum, int rnd){ int doflcswrite(char *name, int rnum, int bulk, int rnd){ WT_CURSOR *c; uint8_t value; - int i, err, len; + int i, err; char buf[RECBUFSIZ]; if(showprgr) printf("<Write Test of var-length Column Store>\n name=%s rnum=%d\n\n", name, rnum); @@ -534,7 +534,7 @@ int doflcswrite(char *name, int rnum, int bulk, int rnd){ /* loop for each record */ for(i = 1; i <= rnum; i++){ /* store a record */ - len = sprintf(buf, "%08d", i); + sprintf(buf, "%08d", i); c->set_key(c, (uint64_t)(rnd ? myrand() % rnum + 1 : i)); c->set_value(c, value); if((err = c->insert(c)) != 0 && err != WT_DUPLICATE_KEY) { diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c index 797800a029c..0b5c0719633 100644 --- a/examples/c/ex_all.c +++ b/examples/c/ex_all.c @@ -19,16 +19,16 @@ #include <wiredtiger.h> -void add_collator(WT_CONNECTION *conn); -void add_compressor(WT_CONNECTION *conn); -void add_cursor_type(WT_CONNECTION *conn); -void add_extractor(WT_CONNECTION *conn); -void connection_ops(WT_CONNECTION *conn); -void cursor_ops(WT_SESSION *session); -void cursor_search_near(WT_CURSOR *cursor); -void session_ops(WT_SESSION *session); - -void +int add_collator(WT_CONNECTION *conn); +int add_compressor(WT_CONNECTION *conn); +int add_cursor_type(WT_CONNECTION *conn); +int add_extractor(WT_CONNECTION *conn); +int connection_ops(WT_CONNECTION *conn); +int cursor_ops(WT_SESSION *session); +int cursor_search_near(WT_CURSOR *cursor); +int session_ops(WT_SESSION *session); + +int cursor_ops(WT_SESSION *session) { WT_CURSOR *cursor; @@ -183,9 +183,11 @@ cursor_ops(WT_SESSION *session) /*! [Close the cursor] */ ret = cursor->close(cursor, NULL); /*! [Close the cursor] */ + + return (ret); } -void +int cursor_search_near(WT_CURSOR *cursor) { int exact, ret; @@ -237,9 +239,11 @@ cursor_search_near(WT_CURSOR *cursor) /* the rest of the scan */ } /*! [Backward scan less than] */ + + return (ret); } -void +int session_ops(WT_SESSION *session) { int ret; @@ -270,6 +274,8 @@ session_ops(WT_SESSION *session) ret = session->checkpoint(session, NULL); ret = session->close(session, NULL); + + return (ret); } /*! [Implement WT_CURSOR_TYPE] */ @@ -300,7 +306,7 @@ my_init_cursor(WT_CURSOR_TYPE *ctype, WT_SESSION *session, } /*! [Implement WT_CURSOR_TYPE] */ -void +int add_cursor_type(WT_CONNECTION *conn) { int ret; @@ -309,6 +315,8 @@ add_cursor_type(WT_CONNECTION *conn) static WT_CURSOR_TYPE my_ctype = { my_cursor_size, my_init_cursor }; ret = conn->add_cursor_type(conn, NULL, &my_ctype, NULL); /*! [Register a new cursor type] */ + + return (ret); } /*! [Implement WT_COLLATOR] */ @@ -332,7 +340,7 @@ my_compare(WT_COLLATOR *collator, WT_SESSION *session, } /*! [Implement WT_COLLATOR] */ -void +int add_collator(WT_CONNECTION *conn) { int ret; @@ -341,6 +349,8 @@ add_collator(WT_CONNECTION *conn) static WT_COLLATOR my_collator = { my_compare }; ret = conn->add_collator(conn, "my_collator", &my_collator, NULL); /*! [Register a new collator] */ + + return (ret); } /*! [Implement WT_COMPRESSOR] */ @@ -379,7 +389,7 @@ my_decompress(WT_COMPRESSOR *compressor, } /*! [Implement WT_COMPRESSOR] */ -void +int add_compressor(WT_CONNECTION *conn) { int ret; @@ -388,6 +398,8 @@ add_compressor(WT_CONNECTION *conn) static WT_COMPRESSOR my_compressor = { my_compress, my_decompress }; ret = conn->add_compressor(conn, "my_compress", &my_compressor, NULL); /*! [Register a new compressor] */ + + return (ret); } /*! [Implement WT_EXTRACTOR] */ @@ -406,7 +418,7 @@ my_extract(WT_EXTRACTOR *extractor, WT_SESSION *session, } /*! [Implement WT_EXTRACTOR] */ -void +int add_extractor(WT_CONNECTION *conn) { int ret; @@ -416,9 +428,11 @@ add_extractor(WT_CONNECTION *conn) my_extractor.extract = my_extract; ret = conn->add_extractor(conn, "my_extractor", &my_extractor, NULL); /*! [Register a new extractor] */ + + return (ret); } -void +int connection_ops(WT_CONNECTION *conn) { int ret; @@ -447,6 +461,8 @@ connection_ops(WT_CONNECTION *conn) session_ops(session); } + + return (ret); } int main(void) @@ -493,5 +509,5 @@ int main(void) /*! [Get the WiredTiger library version] */ } - return (0); + return (ret); } diff --git a/examples/c/ex_extending.c b/examples/c/ex_extending.c index a3e0144e02f..ff05a7092df 100644 --- a/examples/c/ex_extending.c +++ b/examples/c/ex_extending.c @@ -24,8 +24,8 @@ __compare_nocase(WT_COLLATOR *collator, WT_SESSION *session, const char *s1 = (const char *)v1->data; const char *s2 = (const char *)v2->data; - session = NULL; /* unused */ - collator = NULL; /* unused */ + (void)session; /* unused */ + (void)collator; /* unused */ *cmp = strcasecmp(s1, s2); return (0); @@ -50,7 +50,7 @@ __compare_prefixes(WT_COLLATOR *collator, WT_SESSION *session, const char *s1 = (const char *)v1->data; const char *s2 = (const char *)v2->data; - session = NULL; /* unused */ + (void)session; /* unused */ *cmp = strncmp(s1, s2, pcoll->maxlen); return (0); diff --git a/src/cursor/cur_index.c b/src/cursor/cur_index.c index e990274525c..4657eca468a 100644 --- a/src/cursor/cur_index.c +++ b/src/cursor/cur_index.c @@ -54,6 +54,7 @@ __curindex_set_value(WT_CURSOR *cursor, ...) int ret; CURSOR_API_CALL(cursor, session, set_value, NULL); + WT_UNUSED(ret); cursor->saved_err = ENOTSUP; F_CLR(cursor, WT_CURSTD_VALUE_SET); API_END(session); diff --git a/src/include/cursor.i b/src/include/cursor.i index 1865b5c0f6f..a48e6857619 100644 --- a/src/include/cursor.i +++ b/src/include/cursor.i @@ -63,10 +63,8 @@ static inline void __cursor_func_resolve(WT_CURSOR_BTREE *cbt, int ret) { WT_CURSOR *cursor; - WT_SESSION_IMPL *session; cursor = &cbt->iface; - session = (WT_SESSION_IMPL *)cursor->session; /* * On success, we're returning a key/value pair, and can iterate. |