mirror of
https://github.com/MariaDB/server.git
synced 2026-05-17 20:37:12 +02:00
mroonga: remove -Wunused-but-set-variable warnings
There where unused variable. They were not conditional on defines, so removed them. Added an error handing in proc_object if there was no db as subsequent operations would have failed.
This commit is contained in:
parent
3723fd1573
commit
1f7898f686
4 changed files with 8 additions and 8 deletions
|
|
@ -69,13 +69,15 @@ command_object_remove(grn_ctx *ctx,
|
|||
grn_obj **args,
|
||||
grn_user_data *user_data)
|
||||
{
|
||||
grn_obj *db;
|
||||
grn_obj *name;
|
||||
grn_bool force;
|
||||
grn_obj *target;
|
||||
grn_bool failed_to_open;
|
||||
|
||||
db = grn_ctx_db(ctx);
|
||||
if (!grn_ctx_db(ctx)) {
|
||||
GRN_PLUGIN_ERROR(ctx, GRN_INVALID_ARGUMENT, "invalid db assigned");
|
||||
return NULL;
|
||||
}
|
||||
name = grn_plugin_proc_get_var(ctx, user_data, "name", -1);
|
||||
force = grn_plugin_proc_get_var_bool(ctx, user_data, "force", -1, GRN_FALSE);
|
||||
|
||||
|
|
|
|||
|
|
@ -91,8 +91,7 @@ selector_index_column_df_ratio_between(grn_ctx *ctx,
|
|||
df_ratio = (double)n_match_documents / (double)n_documents;
|
||||
{
|
||||
void *key;
|
||||
int key_size;
|
||||
key_size = grn_table_cursor_get_key(ctx, cursor, &key);
|
||||
grn_table_cursor_get_key(ctx, cursor, &key);
|
||||
}
|
||||
if (min <= df_ratio && df_ratio <= max) {
|
||||
posting.rid = term_id;
|
||||
|
|
|
|||
|
|
@ -196,7 +196,6 @@ load_synonyms(grn_ctx *ctx)
|
|||
const char *path;
|
||||
grn_file_reader *file_reader;
|
||||
int number_of_lines;
|
||||
grn_encoding encoding;
|
||||
grn_obj line, key, value;
|
||||
|
||||
grn_getenv("GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE",
|
||||
|
|
@ -234,7 +233,7 @@ load_synonyms(grn_ctx *ctx)
|
|||
}
|
||||
number_of_lines++;
|
||||
if (number_of_lines == 1) {
|
||||
encoding = guess_encoding(ctx, &line_value, &line_length);
|
||||
guess_encoding(ctx, &line_value, &line_length);
|
||||
}
|
||||
GRN_BULK_REWIND(&key);
|
||||
GRN_BULK_REWIND(&value);
|
||||
|
|
|
|||
|
|
@ -653,7 +653,7 @@ learner_init(grn_ctx *ctx, grn_suggest_learner *learner,
|
|||
static void
|
||||
learner_init_columns(grn_ctx *ctx, grn_suggest_learner *learner)
|
||||
{
|
||||
grn_id events_id, event_types_id;
|
||||
grn_id events_id;
|
||||
grn_obj *seqs, *events, *post_item, *items, *pairs;
|
||||
|
||||
learner->seqs = seqs = grn_ctx_at(ctx, GRN_OBJ_GET_DOMAIN(learner->seq));
|
||||
|
|
@ -665,7 +665,7 @@ learner_init_columns(grn_ctx *ctx, grn_suggest_learner *learner)
|
|||
learner->events_type = grn_obj_column(ctx, events, CONST_STR_LEN("type"));
|
||||
learner->events_time = grn_obj_column(ctx, events, CONST_STR_LEN("time"));
|
||||
|
||||
event_types_id = grn_obj_get_range(ctx, learner->events_type);
|
||||
grn_obj_get_range(ctx, learner->events_type);
|
||||
learner->event_types = grn_obj_column(ctx, events, CONST_STR_LEN("time"));
|
||||
|
||||
post_item = learner->post_item;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue