[Groonga-commit] groonga/groonga at 87e1319 [master] Use GRN_TRUEP() to handle value as boolean

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Oct 24 00:18:20 JST 2014


Kouhei Sutou	2014-10-24 00:18:20 +0900 (Fri, 24 Oct 2014)

  New Revision: 87e1319d3adcbfdfd251678bf391ca57e437df97
  https://github.com/groonga/groonga/commit/87e1319d3adcbfdfd251678bf391ca57e437df97

  Message:
    Use GRN_TRUEP() to handle value as boolean

  Modified files:
    lib/proc.c

  Modified: lib/proc.c (+7 -2)
===================================================================
--- lib/proc.c    2014-10-23 23:38:54 +0900 (374b64b)
+++ lib/proc.c    2014-10-24 00:18:20 +0900 (66a9204)
@@ -27,6 +27,7 @@
 #include "expr.h"
 
 #include <string.h>
+#include <float.h>
 #include <stdlib.h>
 #include <fcntl.h>
 #include <sys/stat.h>
@@ -4888,8 +4889,12 @@ func_between(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
 
   GRN_RECORD_SET(ctx, between_variable, GRN_RECORD_VALUE(variable));
   result = grn_expr_exec(ctx, between_expr, 0);
-  if (result && GRN_UINT32_VALUE(result) > 0) {
-    GRN_BOOL_SET(ctx, found, GRN_TRUE);
+  if (result) {
+    grn_bool result_boolean;
+    GRN_TRUEP(ctx, result, result_boolean);
+    if (result_boolean) {
+      GRN_BOOL_SET(ctx, found, GRN_TRUE);
+    }
   }
 
   grn_obj_unlink(ctx, between_expr);
-------------- next part --------------
HTML����������������������������...
Télécharger 



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