[Groonga-commit] groonga/groonga [master] suppress unused-variable warnings.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 11月 12日 (土) 14:53:06 JST


Kouhei Sutou	2011-11-12 05:53:06 +0000 (Sat, 12 Nov 2011)

  New Revision: e07b3bcbbee0fb12c5b3dd4c37c54c1eb2046c50

  Log:
    suppress unused-variable warnings.

  Modified files:
    lib/geo.c
    lib/plugin.c
    src/groonga.c
    src/suggest/groonga_suggest_httpd.c

  Modified: lib/geo.c (+1 -4)
===================================================================
--- lib/geo.c    2011-11-12 05:46:59 +0000 (3ad1f7c)
+++ lib/geo.c    2011-11-12 05:53:06 +0000 (bdac70a)
@@ -842,7 +842,7 @@ in_rectangle_data_prepare(grn_ctx *ctx, grn_obj *index,
   }
 
   {
-    int distance, latitude_distance, longitude_distance;
+    int latitude_distance, longitude_distance;
     grn_geo_point *top_left, *bottom_right;
     grn_geo_point *geo_point_input;
     uint8_t geo_key_input[sizeof(grn_geo_point)];
@@ -972,7 +972,6 @@ grn_geo_cursor_each(grn_ctx *ctx, grn_obj *geo_cursor,
   grn_geo_point *current, *base, *top_left, *bottom_right;
   int diff_bit, distance, end_mesh_point;
   grn_geo_mesh_direction direction;
-  int i = 0;
   int mesh_point;
   grn_id index_id;
 
@@ -1137,13 +1136,11 @@ grn_geo_select_in_rectangle(grn_ctx *ctx, grn_obj *index,
                             grn_obj *res, grn_operator op)
 {
   grn_obj *cursor;
-  grn_posting *posting;
 
   cursor = grn_geo_cursor_open_in_rectangle(ctx, index,
                                             top_left_point, bottom_right_point,
                                             0, -1);
   if (cursor) {
-    grn_geo_cursor_in_rectangle *geo_cursor = (grn_geo_cursor_in_rectangle *)cursor;
     grn_geo_select_in_rectangle_data data;
     data.res = (grn_hash *)res;
     data.op = op;

  Modified: lib/plugin.c (+0 -1)
===================================================================
--- lib/plugin.c    2011-11-12 05:46:59 +0000 (f708498)
+++ lib/plugin.c    2011-11-12 05:53:06 +0000 (1ac8fb8)
@@ -377,7 +377,6 @@ grn_plugin_register(grn_ctx *ctx, const char *name)
   const char *plugins_dir;
   char dir_last_char;
   char path[PATH_MAX];
-  char normalized_name[PATH_MAX];
   int name_length, max_name_length;
 
   if (name[0] == '/') {

  Modified: src/groonga.c (+2 -6)
===================================================================
--- src/groonga.c    2011-11-12 05:46:59 +0000 (56dda8a)
+++ src/groonga.c    2011-11-12 05:53:06 +0000 (5a80340)
@@ -179,8 +179,8 @@ inline static grn_rc
 prompt(grn_ctx *ctx, grn_obj *buf)
 {
   static int the_first_read = GRN_TRUE;
-  int len;
   grn_rc rc;
+  GRN_BULK_REWIND(buf);
   if (!batchmode) {
 #ifdef HAVE_LIBEDIT
     const wchar_t *line;
@@ -205,10 +205,8 @@ prompt(grn_ctx *ctx, grn_obj *buf)
         }
       }
       rc = GRN_SUCCESS;
-      len = GRN_TEXT_LEN(buf);
     } else {
       rc = GRN_END_OF_DATA;
-      len = 0;
     }
 #else
     fprintf(stderr, "> ");
@@ -220,7 +218,7 @@ prompt(grn_ctx *ctx, grn_obj *buf)
       number_of_lines++;
     }
   }
-  if (the_first_read && len > 0) {
+  if (the_first_read && GRN_TEXT_LEN(buf) > 0) {
     const char bom[] = {0xef, 0xbb, 0xbf};
     if (GRN_CTX_GET_ENCODING(ctx) == GRN_ENC_UTF8 &&
         GRN_TEXT_LEN(buf) > 3 && !memcmp(GRN_TEXT_VALUE(buf), bom, 3)) {
@@ -689,7 +687,6 @@ do_alone(int argc, char **argv)
       while (prompt(ctx, &text) != GRN_END_OF_DATA) {
         GRN_TEXT_PUT(ctx, &command, GRN_TEXT_VALUE(&text), GRN_TEXT_LEN(&text));
         grn_ctx_send(ctx, GRN_TEXT_VALUE(&text), GRN_TEXT_LEN(&text), 0);
-        GRN_BULK_REWIND(&text);
         if (ctx->stat == GRN_CTX_QUIT) { break; }
       }
       rc = ctx->rc;
@@ -754,7 +751,6 @@ g_client(int argc, char **argv)
       GRN_TEXT_INIT(&text, 0);
       while (prompt(ctx, &text) != GRN_END_OF_DATA) {
         grn_ctx_send(ctx, GRN_TEXT_VALUE(&text), GRN_TEXT_LEN(&text), 0);
-        GRN_BULK_REWIND(&text);
         rc = ctx->rc;
         if (rc) { break; }
         if (c_output(ctx)) { goto exit; }

  Modified: src/suggest/groonga_suggest_httpd.c (+1 -1)
===================================================================
--- src/suggest/groonga_suggest_httpd.c    2011-11-12 05:46:59 +0000 (f3c72ad)
+++ src/suggest/groonga_suggest_httpd.c    2011-11-12 05:53:06 +0000 (efe9cfd)
@@ -697,7 +697,7 @@ usage(FILE *output)
 int
 main(int argc, char **argv)
 {
-  int port_no = DEFAULT_PORT, daemon = 0;
+  int port_no = DEFAULT_PORT;
   const char *max_threads_string = NULL, *port_string = NULL;
   const char *address;
   const char *send_endpoint = NULL, *recv_endpoint = NULL, *log_base_path = NULL;




Groonga-commit メーリングリストの案内
Back to archive index