[Groonga-commit] groonga/groonga at 7c0dfba [master] Put declarations to the beginning of block

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Jun 5 09:03:11 JST 2016


Kouhei Sutou	2016-06-05 09:03:11 +0900 (Sun, 05 Jun 2016)

  New Revision: 7c0dfba34e5a9312164139800b70982298eaec5c
  https://github.com/groonga/groonga/commit/7c0dfba34e5a9312164139800b70982298eaec5c

  Message:
    Put declarations to the beginning of block

  Modified files:
    lib/db.c
    lib/hash.c
    lib/ii.c
    lib/proc/proc_select.c

  Modified: lib/db.c (+4 -2)
===================================================================
--- lib/db.c    2016-06-04 10:20:33 +0900 (cac6d0d)
+++ lib/db.c    2016-06-05 09:03:11 +0900 (352d36c)
@@ -13248,6 +13248,8 @@ bracket_close(grn_ctx *ctx, grn_loader *loader)
      * handled as column names and "_id" or "_key".
      */
     for (i = 0; i < nvalues; i++) {
+      const char *col_name;
+      unsigned int col_name_size;
       if (value->header.domain != GRN_DB_TEXT) {
         grn_obj buffer;
         GRN_TEXT_INIT(&buffer, 0);
@@ -13260,8 +13262,8 @@ bracket_close(grn_ctx *ctx, grn_loader *loader)
         loader->columns_status = GRN_LOADER_COLUMNS_BROKEN;
         goto exit;
       }
-      const char *col_name = GRN_TEXT_VALUE(value);
-      unsigned int col_name_size = GRN_TEXT_LEN(value);
+      col_name = GRN_TEXT_VALUE(value);
+      col_name_size = GRN_TEXT_LEN(value);
       col = grn_obj_column(ctx, loader->table, col_name, col_name_size);
       if (!col) {
         ERR(GRN_INVALID_ARGUMENT, "nonexistent column: <%.*s>",

  Modified: lib/hash.c (+4 -1)
===================================================================
--- lib/hash.c    2016-06-04 10:20:33 +0900 (5ee6dc9)
+++ lib/hash.c    2016-06-05 09:03:11 +0900 (f80c2ea)
@@ -812,10 +812,13 @@ grn_rc
 grn_array_set_value(grn_ctx *ctx, grn_array *array, grn_id id,
                     const void *value, int flags)
 {
+  grn_rc rc;
+
   if (!ctx || !array || !value) {
     return GRN_INVALID_ARGUMENT;
   }
-  grn_rc rc = grn_array_error_if_truncated(ctx, array);
+
+  rc = grn_array_error_if_truncated(ctx, array);
   if (rc != GRN_SUCCESS) {
     return rc;
   }

  Modified: lib/ii.c (+3 -2)
===================================================================
--- lib/ii.c    2016-06-04 10:20:33 +0900 (6e69e21)
+++ lib/ii.c    2016-06-05 09:03:11 +0900 (8d3bae9)
@@ -10503,9 +10503,10 @@ grn_ii_builder_append_value(grn_ctx *ctx, grn_ii_builder *builder,
       while (cursor->status == GRN_TOKEN_CURSOR_DOING) {
         grn_id tid = grn_token_cursor_next(ctx, cursor);
         if (tid != GRN_ID_NIL) {
+          grn_rc rc;
           pos = builder->pos + cursor->pos;
-          grn_rc rc = grn_ii_builder_append_token(ctx, builder, rid, sid,
-                                                  weight, tid, pos);
+          rc = grn_ii_builder_append_token(ctx, builder, rid, sid,
+                                           weight, tid, pos);
           if (rc != GRN_SUCCESS) {
             break;
           }

  Modified: lib/proc/proc_select.c (+2 -2)
===================================================================
--- lib/proc/proc_select.c    2016-06-04 10:20:33 +0900 (bd4d728)
+++ lib/proc/proc_select.c    2016-06-05 09:03:11 +0900 (8c0f9ee)
@@ -947,6 +947,8 @@ grn_select_apply_columns(grn_ctx *ctx,
   while (grn_hash_cursor_next(ctx, columns_cursor) != GRN_ID_NIL) {
     grn_column_data *column_data;
     grn_obj *column;
+    grn_obj *expression;
+    grn_obj *record;
 
     grn_hash_cursor_get_value(ctx, columns_cursor, (void **)&column_data);
 
@@ -968,8 +970,6 @@ grn_select_apply_columns(grn_ctx *ctx,
       break;
     }
 
-    grn_obj *expression;
-    grn_obj *record;
     GRN_EXPR_CREATE_FOR_QUERY(ctx, table, expression, record);
     if (!expression) {
       grn_obj_close(ctx, column);
-------------- next part --------------
HTML����������������������������...
下載 



More information about the Groonga-commit mailing list
Back to archive index