null+****@clear*****
null+****@clear*****
2012年 4月 13日 (金) 13:07:34 JST
Kouhei Sutou 2012-04-13 13:07:34 +0900 (Fri, 13 Apr 2012)
New Revision: 0331db1aedf68529464feaa3302def4e8b31233a
Log:
Remove "no" condition variable name
NO_LZO -> WITH_LZO
Modified files:
configure.ac
lib/db.c
lib/store.c
Modified: configure.ac (+2 -3)
===================================================================
--- configure.ac 2012-04-13 13:00:03 +0900 (97ec3c8)
+++ configure.ac 2012-04-13 13:07:34 +0900 (07e383b)
@@ -773,9 +773,8 @@ AC_ARG_WITH(lzo,
[use lzo for data compression. [default=no]])],
[with_lzo="$withval"],
[with_lzo="no"])
-if test "x$with_lzo" = "xno"; then
- AC_DEFINE(NO_LZO, [1], [without lzo])
-else
+if test "x$with_lzo" = "xyes"; then
+ AC_DEFINE(WITH_LZO, [1], [with lzo])
AC_CHECK_LIB(lzo2, lzo1_compress, [LZO_LIBS="-llzo2"], [AC_MSG_ERROR("No liblzo2 found")])
fi
Modified: lib/db.c (+5 -5)
===================================================================
--- lib/db.c 2012-04-13 13:00:03 +0900 (a41364f)
+++ lib/db.c 2012-04-13 13:07:34 +0900 (affc150)
@@ -3430,11 +3430,11 @@ grn_column_create(grn_ctx *ctx, grn_obj *table,
zlib_p = GRN_TRUE;
}
#endif /* NO_ZLIB */
-#ifndef NO_LZO
+#ifdef WITH_LZO
if (flags & GRN_OBJ_COMPRESS_LZO) {
lzo_p = GRN_TRUE;
}
-#endif /* NO_LZO */
+#endif /* WITH_LZO */
if (zlib_p || lzo_p) {
int table_name_len;
char table_name[GRN_TABLE_MAX_KEY_SIZE];
@@ -5660,11 +5660,11 @@ grn_obj_get_info(grn_ctx *ctx, grn_obj *obj, grn_info_type type, grn_obj *valueb
"failed to open value buffer for GRN_INFO_LZO_SUPPORT");
goto exit;
}
-#ifndef NO_LZO
+#ifdef WITH_LZO
GRN_BOOL_PUT(ctx, valuebuf, GRN_TRUE);
-#else
+#else /* WITH_LZO */
GRN_BOOL_PUT(ctx, valuebuf, GRN_FALSE);
-#endif
+#endif /* WITH_LZO */
break;
default :
if (!obj) {
Modified: lib/store.c (+8 -8)
===================================================================
--- lib/store.c 2012-04-13 13:00:03 +0900 (46e8d13)
+++ lib/store.c 2012-04-13 13:07:34 +0900 (1d5b03b)
@@ -1092,7 +1092,7 @@ grn_ja_ref_zlib(grn_ctx *ctx, grn_ja *ja, grn_id id, grn_io_win *iw, uint32_t *v
}
#endif /* NO_ZLIB */
-#ifndef NO_LZO
+#ifdef WITH_LZO
#include <lzo/lzo1x.h>
static void *
@@ -1128,7 +1128,7 @@ grn_ja_ref_lzo(grn_ctx *ctx, grn_ja *ja, grn_id id, grn_io_win *iw, uint32_t *va
*value_len = lout_len;
return value;
}
-#endif /* NO_LZO */
+#endif /* WITH_LZO */
void *
grn_ja_ref(grn_ctx *ctx, grn_ja *ja, grn_id id, grn_io_win *iw, uint32_t *value_len)
@@ -1138,11 +1138,11 @@ grn_ja_ref(grn_ctx *ctx, grn_ja *ja, grn_id id, grn_io_win *iw, uint32_t *value_
return grn_ja_ref_zlib(ctx, ja, id, iw, value_len);
}
#endif /* NO_ZLIB */
-#ifndef NO_LZO
+#ifdef WITH_LZO
if (ja->header->flags & GRN_OBJ_COMPRESS_LZO) {
return grn_ja_ref_lzo(ctx, ja, id, iw, value_len);
}
-#endif /* NO_LZO */
+#endif /* WITH_LZO */
return grn_ja_ref_raw(ctx, ja, id, iw, value_len);
}
@@ -1224,7 +1224,7 @@ grn_ja_put_zlib(grn_ctx *ctx, grn_ja *ja, grn_id id,
}
#endif /* NO_ZLIB */
-#ifndef NO_LZO
+#ifdef WITH_LZO
inline static grn_rc
grn_ja_put_lzo(grn_ctx *ctx, grn_ja *ja, grn_id id,
void *value, uint32_t value_len, int flags, uint64_t *cas)
@@ -1251,7 +1251,7 @@ grn_ja_put_lzo(grn_ctx *ctx, grn_ja *ja, grn_id id,
GRN_FREE(lvalue);
return rc;
}
-#endif /* NO_LZO */
+#endif /* WITH_LZO */
grn_rc
grn_ja_put(grn_ctx *ctx, grn_ja *ja, grn_id id, void *value, uint32_t value_len,
@@ -1262,11 +1262,11 @@ grn_ja_put(grn_ctx *ctx, grn_ja *ja, grn_id id, void *value, uint32_t value_len,
return grn_ja_put_zlib(ctx, ja, id, value, value_len, flags, cas);
}
#endif /* NO_ZLIB */
-#ifndef NO_LZO
+#ifdef WITH_LZO
if (ja->header->flags & GRN_OBJ_COMPRESS_LZO) {
return grn_ja_put_lzo(ctx, ja, id, value, value_len, flags, cas);
}
-#endif /* NO_LZO */
+#endif /* WITH_LZO */
return grn_ja_put_raw(ctx, ja, id, value, value_len, flags, cas);
}