summaryrefslogtreecommitdiff
path: root/src/schema/schema_open.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/schema/schema_open.c')
-rw-r--r--src/schema/schema_open.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/schema/schema_open.c b/src/schema/schema_open.c
index 2b645d5c666..b50ab566d08 100644
--- a/src/schema/schema_open.c
+++ b/src/schema/schema_open.c
@@ -107,12 +107,12 @@ __wt_schema_open_colgroups(WT_SESSION_IMPL *session, WT_TABLE *table)
WT_ERR(__wt_buf_init(session, buf, 0));
WT_ERR(__wt_struct_plan(session,
- table, table->colconf.str, table->colconf.len, 1, buf));
+ table, table->colconf.str, table->colconf.len, true, buf));
WT_ERR(__wt_strndup(
session, buf->data, buf->size, &table->plan));
}
- table->cg_complete = 1;
+ table->cg_complete = true;
err: __wt_scr_free(session, &buf);
if (colgroup != NULL)
@@ -231,7 +231,8 @@ __open_index(WT_SESSION_IMPL *session, WT_TABLE *table, WT_INDEX *idx)
goto err;
WT_ERR(__wt_scr_alloc(session, 0, &plan));
- WT_ERR(__wt_struct_plan(session, table, buf->data, buf->size, 0, plan));
+ WT_ERR(__wt_struct_plan(
+ session, table, buf->data, buf->size, false, plan));
WT_ERR(__wt_strndup(session, plan->data, plan->size, &idx->key_plan));
/* Set up the cursor key format (the visible columns). */
@@ -254,7 +255,7 @@ __open_index(WT_SESSION_IMPL *session, WT_TABLE *table, WT_INDEX *idx)
/* TODO Optimize to use index columns in preference to table lookups. */
WT_ERR(__wt_buf_init(session, plan, 0));
WT_ERR(__wt_struct_plan(session,
- table, table->colconf.str, table->colconf.len, 1, plan));
+ table, table->colconf.str, table->colconf.len, true, plan));
WT_ERR(__wt_strndup(session, plan->data, plan->size, &idx->value_plan));
err: __wt_scr_free(session, &buf);
@@ -275,7 +276,8 @@ __wt_schema_open_index(WT_SESSION_IMPL *session,
WT_DECL_RET;
WT_INDEX *idx;
u_int i;
- int cmp, match;
+ int cmp;
+ bool match;
const char *idxconf, *name, *tablename, *uri;
/* Check if we've already done the work. */
@@ -284,7 +286,7 @@ __wt_schema_open_index(WT_SESSION_IMPL *session,
cursor = NULL;
idx = NULL;
- match = 0;
+ match = false;
/* Build a search key. */
tablename = table->name;
@@ -365,7 +367,7 @@ __wt_schema_open_index(WT_SESSION_IMPL *session,
/* If we did a full pass, we won't need to do it again. */
if (idxname == NULL) {
table->nindices = i;
- table->idx_complete = 1;
+ table->idx_complete = true;
}
err: __wt_scr_free(session, &tmp);
@@ -392,7 +394,7 @@ __wt_schema_open_indices(WT_SESSION_IMPL *session, WT_TABLE *table)
*/
int
__wt_schema_open_table(WT_SESSION_IMPL *session,
- const char *name, size_t namelen, int ok_incomplete, WT_TABLE **tablep)
+ const char *name, size_t namelen, bool ok_incomplete, WT_TABLE **tablep)
{
WT_CONFIG cparser;
WT_CONFIG_ITEM ckey, cval;
@@ -440,9 +442,9 @@ __wt_schema_open_table(WT_SESSION_IMPL *session,
* are not named.
*/
WT_ERR(__wt_config_subinit(session, &cparser, &table->colconf));
- table->is_simple = 1;
+ table->is_simple = true;
while ((ret = __wt_config_next(&cparser, &ckey, &cval)) == 0)
- table->is_simple = 0;
+ table->is_simple = false;
if (ret != WT_NOTFOUND)
goto err;
@@ -498,7 +500,7 @@ err: if (table != NULL)
*/
int
__wt_schema_get_colgroup(WT_SESSION_IMPL *session,
- const char *uri, int quiet, WT_TABLE **tablep, WT_COLGROUP **colgroupp)
+ const char *uri, bool quiet, WT_TABLE **tablep, WT_COLGROUP **colgroupp)
{
WT_COLGROUP *colgroup;
WT_TABLE *table;
@@ -515,7 +517,7 @@ __wt_schema_get_colgroup(WT_SESSION_IMPL *session,
tend = tablename + strlen(tablename);
WT_RET(__wt_schema_get_table(session,
- tablename, WT_PTRDIFF(tend, tablename), 0, &table));
+ tablename, WT_PTRDIFF(tend, tablename), false, &table));
for (i = 0; i < WT_COLGROUPS(table); i++) {
colgroup = table->cgroups[i];
@@ -541,7 +543,7 @@ __wt_schema_get_colgroup(WT_SESSION_IMPL *session,
*/
int
__wt_schema_get_index(WT_SESSION_IMPL *session,
- const char *uri, int quiet, WT_TABLE **tablep, WT_INDEX **indexp)
+ const char *uri, bool quiet, WT_TABLE **tablep, WT_INDEX **indexp)
{
WT_DECL_RET;
WT_INDEX *idx;
@@ -557,7 +559,7 @@ __wt_schema_get_index(WT_SESSION_IMPL *session,
return (__wt_bad_object_type(session, uri));
WT_RET(__wt_schema_get_table(session,
- tablename, WT_PTRDIFF(tend, tablename), 0, &table));
+ tablename, WT_PTRDIFF(tend, tablename), false, &table));
/* Try to find the index in the table. */
for (i = 0; i < table->nindices; i++) {