Kouhei Sutou
null+****@clear*****
Wed Nov 1 10:55:22 JST 2017
Kouhei Sutou 2017-11-01 10:55:22 +0900 (Wed, 01 Nov 2017) New Revision: 16082c4772cc3b74227a6d70fa6e1d6c878d64b5 https://github.com/groonga/groonga/commit/16082c4772cc3b74227a6d70fa6e1d6c878d64b5 Message: Use "grn_" prefix to valid macro name conflict with other libraries such as msgpack Modified files: lib/alloc.c lib/ctx.c lib/db.c lib/expr.c lib/geo.c lib/grn.h lib/hash.c lib/ii.c lib/index_column.c lib/io.c lib/load.c lib/nfkc.rb lib/nfkc50.c lib/normalizer.c lib/output.c lib/pat.c lib/proc.c lib/proc/proc_fuzzy_search.c lib/snip.c lib/store.c lib/str.c lib/ts/ts_expr_node.c lib/ts/ts_sorter.c lib/window_function.c plugins/suggest/suggest.c plugins/tokenizers/mecab.c src/groonga.c Modified: lib/alloc.c (+4 -4) =================================================================== --- lib/alloc.c 2017-11-01 10:40:22 +0900 (5d77c19e7) +++ lib/alloc.c 2017-11-01 10:55:22 +0900 (0c02f2ee2) @@ -107,7 +107,7 @@ grn_alloc_info_fin(void) CRITICAL_SECTION_FIN(grn_alloc_info_lock); } -inline static void +grn_inline static void grn_alloc_info_set_backtrace(char *buffer, size_t size) { # ifdef HAVE_BACKTRACE @@ -146,7 +146,7 @@ grn_alloc_info_set_backtrace(char *buffer, size_t size) # endif /* HAVE_BACKTRACE */ } -inline static void +grn_inline static void grn_alloc_info_add(void *address, size_t size, const char *file, int line, const char *func) { @@ -181,7 +181,7 @@ grn_alloc_info_add(void *address, size_t size, CRITICAL_SECTION_LEAVE(grn_alloc_info_lock); } -inline static void +grn_inline static void grn_alloc_info_change(void *old_address, void *new_address, size_t size) { grn_ctx *ctx; @@ -231,7 +231,7 @@ grn_alloc_info_dump(grn_ctx *ctx) } } -inline static void +grn_inline static void grn_alloc_info_check(grn_ctx *ctx, void *address) { grn_alloc_info *alloc_info; Modified: lib/ctx.c (+1 -1) =================================================================== --- lib/ctx.c 2017-11-01 10:40:22 +0900 (5b1bbe4bd) +++ lib/ctx.c 2017-11-01 10:55:22 +0900 (a7385a162) @@ -1041,7 +1041,7 @@ get_command_version(grn_ctx *ctx, const char *p, const char *pe) #define HTTP_QUERY_PAIR_DELIMITER "=" #define HTTP_QUERY_PAIRS_DELIMITERS "&;" -static inline int +static grn_inline int command_proc_p(grn_obj *expr) { return (expr->header.type == GRN_PROC && Modified: lib/db.c (+36 -36) =================================================================== --- lib/db.c 2017-11-01 10:40:22 +0900 (34e339224) +++ lib/db.c 2017-11-01 10:55:22 +0900 (6f82641dd) @@ -73,21 +73,21 @@ typedef struct { }\ } while (0) -inline static grn_id +grn_inline static grn_id grn_table_add_v_inline(grn_ctx *ctx, grn_obj *table, const void *key, int key_size, void **value, int *added); -inline static void +grn_inline static void grn_table_add_subrec_inline(grn_obj *table, grn_rset_recinfo *ri, double score, grn_rset_posinfo *pi, int dir); -inline static grn_id +grn_inline static grn_id grn_table_cursor_next_inline(grn_ctx *ctx, grn_table_cursor *tc); -inline static int +grn_inline static int grn_table_cursor_get_value_inline(grn_ctx *ctx, grn_table_cursor *tc, void **value); static void grn_obj_ensure_bulk(grn_ctx *ctx, grn_obj *obj); static void grn_obj_ensure_vector(grn_ctx *ctx, grn_obj *obj); -inline static void +grn_inline static void grn_obj_get_range_info(grn_ctx *ctx, grn_obj *obj, grn_id *range_id, grn_obj_flags *range_flags); @@ -101,7 +101,7 @@ grn_db_init_from_env(void) GRN_ENV_BUFFER_SIZE); } -inline static void +grn_inline static void gen_pathname(const char *path, char *buffer, int fno) { size_t len = strlen(path); @@ -752,7 +752,7 @@ grn_obj_is_corrupt(grn_ctx *ctx, grn_obj *obj) #define IS_TEMP(obj) (DB_OBJ(obj)->id & GRN_OBJ_TMP_OBJECT) -static inline void +static grn_inline void grn_obj_touch_db(grn_ctx *ctx, grn_obj *obj, grn_timeval *tv) { grn_obj_get_io(ctx, obj)->header->last_modified = tv->tv_sec; @@ -1656,7 +1656,7 @@ grn_table_at(grn_ctx *ctx, grn_obj *table, grn_id id) GRN_API_RETURN(id); } -inline static grn_id +grn_inline static grn_id grn_table_add_v_inline(grn_ctx *ctx, grn_obj *table, const void *key, int key_size, void **value, int *added) { @@ -2362,7 +2362,7 @@ grn_table_size(grn_ctx *ctx, grn_obj *table) GRN_API_RETURN(n); } -inline static void +grn_inline static void subrecs_push(byte *subrecs, int size, int n_subrecs, double score, void *body, int dir) { byte *v; @@ -2380,7 +2380,7 @@ subrecs_push(byte *subrecs, int size, int n_subrecs, double score, void *body, i grn_memcpy(v + GRN_RSET_SCORE_SIZE, body, size); } -inline static void +grn_inline static void subrecs_replace_min(byte *subrecs, int size, int n_subrecs, double score, void *body, int dir) { byte *v; @@ -2415,7 +2415,7 @@ subrecs_replace_min(byte *subrecs, int size, int n_subrecs, double score, void * grn_memcpy(v + GRN_RSET_SCORE_SIZE, body, size); } -inline static void +grn_inline static void grn_table_add_subrec_inline(grn_obj *table, grn_rset_recinfo *ri, double score, grn_rset_posinfo *pi, int dir) { @@ -2622,7 +2622,7 @@ grn_table_cursor_close(grn_ctx *ctx, grn_table_cursor *tc) GRN_API_RETURN(rc); } -inline static grn_id +grn_inline static grn_id grn_table_cursor_next_inline(grn_ctx *ctx, grn_table_cursor *tc) { const char *tag = "[table][cursor][next]"; @@ -2693,7 +2693,7 @@ grn_table_cursor_get_key(grn_ctx *ctx, grn_table_cursor *tc, void **key) GRN_API_RETURN(len); } -inline static int +grn_inline static int grn_table_cursor_get_value_inline(grn_ctx *ctx, grn_table_cursor *tc, void **value) { const char *tag = "[table][cursor][get-value]"; @@ -3467,13 +3467,13 @@ grn_accessor_resolve(grn_ctx *ctx, grn_obj *accessor, int deep, return rc; } -static inline void +static grn_inline void grn_obj_search_index_report(grn_ctx *ctx, const char *tag, grn_obj *index) { grn_report_index(ctx, "[object][search]", tag, index); } -static inline grn_rc +static grn_inline grn_rc grn_obj_search_accessor(grn_ctx *ctx, grn_obj *obj, grn_obj *query, grn_obj *res, grn_operator op, grn_search_optarg *optarg) { @@ -3743,7 +3743,7 @@ grn_obj_search(grn_ctx *ctx, grn_obj *obj, grn_obj *query, #define GRN_TABLE_GROUP_FILTER_PREFIX 0 #define GRN_TABLE_GROUP_FILTER_SUFFIX (1L<<2) -inline static void +grn_inline static void grn_table_group_add_subrec(grn_ctx *ctx, grn_obj *table, grn_rset_recinfo *ri, double score, @@ -4119,7 +4119,7 @@ grn_table_group_with_range_gap(grn_ctx *ctx, grn_obj *table, return 0; } -static inline void +static grn_inline void grn_table_group_multi_keys_add_record(grn_ctx *ctx, grn_table_sort_key *keys, int n_keys, @@ -4221,7 +4221,7 @@ grn_table_group_multi_keys_scalar_records(grn_ctx *ctx, grn_table_cursor_close(ctx, tc); } -static inline void +static grn_inline void grn_table_group_multi_keys_vector_record(grn_ctx *ctx, grn_table_sort_key *keys, grn_obj *key_buffers, @@ -5555,7 +5555,7 @@ accessor_new(grn_ctx *ctx) return res; } -inline static grn_bool +grn_inline static grn_bool grn_obj_get_accessor_rset_value(grn_ctx *ctx, grn_obj *obj, grn_accessor **res, uint8_t action) { @@ -5966,7 +5966,7 @@ grn_obj_get_accessor(grn_ctx *ctx, grn_obj *obj, const char *name, unsigned int GRN_API_RETURN((grn_obj *)res); } -inline static grn_bool +grn_inline static grn_bool grn_column_is_vector(grn_ctx *ctx, grn_obj *column) { grn_obj_flags type; @@ -5979,7 +5979,7 @@ grn_column_is_vector(grn_ctx *ctx, grn_obj *column) return type == GRN_OBJ_COLUMN_VECTOR; } -inline static grn_bool +grn_inline static grn_bool grn_column_is_index(grn_ctx *ctx, grn_obj *column) { grn_obj_flags type; @@ -6006,7 +6006,7 @@ grn_column_is_index(grn_ctx *ctx, grn_obj *column) return type == GRN_OBJ_COLUMN_INDEX; } -inline static void +grn_inline static void grn_obj_get_range_info(grn_ctx *ctx, grn_obj *obj, grn_id *range_id, grn_obj_flags *range_flags) { @@ -6151,7 +6151,7 @@ grn_obj_is_persistent(grn_ctx *ctx, grn_obj *obj) }\ } while (0) -inline static grn_rc +grn_inline static grn_rc grn_obj_cast_bool(grn_ctx *ctx, grn_obj *src, grn_obj *dest, grn_bool add_record_if_not_exist) { @@ -7115,7 +7115,7 @@ grn_obj_size(grn_ctx *ctx, grn_obj *obj) } } -inline static int +grn_inline static int call_hook(grn_ctx *ctx, grn_obj *obj, grn_id id, grn_obj *value, int flags) { grn_hook *hooks = DB_OBJ(obj)->hooks[GRN_HOOK_SET]; @@ -8539,7 +8539,7 @@ grn_obj_spec_save(grn_ctx *ctx, grn_db_obj *obj) grn_obj_close(ctx, &v); } -inline static void +grn_inline static void grn_obj_set_info_source_invalid_lexicon_error(grn_ctx *ctx, const char *message, grn_obj *actual_type, @@ -8589,7 +8589,7 @@ grn_obj_set_info_source_invalid_lexicon_error(grn_ctx *ctx, source_name_size, source_name); } -inline static grn_rc +grn_inline static grn_rc grn_obj_set_info_source_validate(grn_ctx *ctx, grn_obj *obj, grn_obj *value) { grn_id lexicon_id; @@ -8691,7 +8691,7 @@ exit: return ctx->rc; } -inline static void +grn_inline static void grn_obj_set_info_source_log(grn_ctx *ctx, grn_obj *obj, grn_obj *value) { grn_obj buf; @@ -8718,7 +8718,7 @@ grn_obj_set_info_source_log(grn_ctx *ctx, grn_obj *obj, grn_obj *value) GRN_OBJ_FIN(ctx, &buf); } -inline static grn_rc +grn_inline static grn_rc grn_obj_set_info_source_update(grn_ctx *ctx, grn_obj *obj, grn_obj *value) { void *v = GRN_BULK_HEAD(value); @@ -8745,7 +8745,7 @@ grn_obj_set_info_source_update(grn_ctx *ctx, grn_obj *obj, grn_obj *value) return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_obj_set_info_source(grn_ctx *ctx, grn_obj *obj, grn_obj *value) { grn_rc rc; @@ -9468,7 +9468,7 @@ is_removable_table(grn_ctx *ctx, grn_obj *table, grn_obj *db) return GRN_FALSE; } -static inline grn_rc +static grn_inline grn_rc _grn_obj_remove_spec(grn_ctx *ctx, grn_obj *db, grn_id id, uint8_t type) { const char *name; @@ -11690,7 +11690,7 @@ enum { }\ } while (0) -inline static int +grn_inline static int compare_reference(grn_ctx *ctx, sort_reference_entry *a, sort_reference_entry *b, grn_table_sort_key *keys, int n_keys) @@ -11788,7 +11788,7 @@ compare_reference(grn_ctx *ctx, return 0; } -inline static void +grn_inline static void swap_reference(sort_reference_entry *a, sort_reference_entry *b) { sort_reference_entry c_ = *a; @@ -11796,7 +11796,7 @@ swap_reference(sort_reference_entry *a, sort_reference_entry *b) *b = c_; } -inline static sort_reference_entry * +grn_inline static sort_reference_entry * part_reference(grn_ctx *ctx, sort_reference_entry *b, sort_reference_entry *e, grn_table_sort_key *keys, int n_keys) @@ -11918,7 +11918,7 @@ typedef struct { grn_obj value; } sort_value_entry; -inline static int +grn_inline static int compare_value(grn_ctx *ctx, sort_value_entry *a, sort_value_entry *b, grn_table_sort_key *keys, int n_keys, @@ -12024,7 +12024,7 @@ compare_value(grn_ctx *ctx, return 0; } -inline static void +grn_inline static void swap_value(sort_value_entry *a, sort_value_entry *b) { sort_value_entry c_ = *a; @@ -12032,7 +12032,7 @@ swap_value(sort_value_entry *a, sort_value_entry *b) *b = c_; } -inline static sort_value_entry * +grn_inline static sort_value_entry * part_value(grn_ctx *ctx, sort_value_entry *b, sort_value_entry *e, grn_table_sort_key *keys, int n_keys, Modified: lib/expr.c (+18 -18) =================================================================== --- lib/expr.c 2017-11-01 10:40:22 +0900 (677ba6256) +++ lib/expr.c 2017-11-01 10:55:22 +0900 (8300f4567) @@ -2465,7 +2465,7 @@ grn_proc_call(grn_ctx *ctx, grn_obj *proc, int nargs, grn_obj *caller) } \ } while (0) -inline static void +grn_inline static void grn_expr_exec_get_member_vector(grn_ctx *ctx, grn_obj *expr, grn_obj *column_and_record_id, @@ -2565,7 +2565,7 @@ grn_expr_exec_get_member_vector(grn_ctx *ctx, GRN_OBJ_FIN(ctx, &values); } -inline static void +grn_inline static void grn_expr_exec_get_member_table(grn_ctx *ctx, grn_obj *expr, grn_obj *table, @@ -2593,7 +2593,7 @@ grn_expr_exec_get_member_table(grn_ctx *ctx, GRN_RECORD_SET(ctx, result, id); } -static inline grn_bool +static grn_inline grn_bool grn_expr_exec_is_simple_expr(grn_ctx *ctx, grn_obj *expr) { grn_expr *e = (grn_expr *)expr; @@ -2614,7 +2614,7 @@ grn_expr_exec_is_simple_expr(grn_ctx *ctx, grn_obj *expr) } } -static inline grn_obj * +static grn_inline grn_obj * grn_expr_exec_simple(grn_ctx *ctx, grn_obj *expr) { grn_expr *e = (grn_expr *)expr; @@ -5643,7 +5643,7 @@ grn_p_scan_info_list(grn_ctx *ctx, scan_info **sis, int n) GRN_OBJ_FIN(ctx, &inspected); } -inline static int32_t +grn_inline static int32_t exec_result_to_score(grn_ctx *ctx, grn_obj *result, grn_obj *score_buffer) { if (!result) { @@ -5773,13 +5773,13 @@ grn_table_select_sequential(grn_ctx *ctx, grn_obj *table, grn_obj *expr, grn_expr_executor_close(ctx, executor); } -static inline void +static grn_inline void grn_table_select_index_report(grn_ctx *ctx, const char *tag, grn_obj *index) { grn_report_index(ctx, "[table][select]", tag, index); } -static inline void +static grn_inline void grn_table_select_index_not_used_report(grn_ctx *ctx, const char *tag, grn_obj *index, @@ -5788,7 +5788,7 @@ grn_table_select_index_not_used_report(grn_ctx *ctx, grn_report_index_not_used(ctx, "[table][select]", tag, index, reason); } -static inline grn_bool +static grn_inline grn_bool grn_table_select_index_use_sequential_search(grn_ctx *ctx, grn_obj *table, grn_obj *res, @@ -5839,7 +5839,7 @@ grn_table_select_index_use_sequential_search(grn_ctx *ctx, return GRN_TRUE; } -static inline grn_bool +static grn_inline grn_bool grn_table_select_index_equal(grn_ctx *ctx, grn_obj *table, grn_obj *index, @@ -5983,7 +5983,7 @@ grn_table_select_index_equal(grn_ctx *ctx, return processed; } -static inline grn_bool +static grn_inline grn_bool grn_table_select_index_not_equal(grn_ctx *ctx, grn_obj *table, grn_obj *index, @@ -6204,7 +6204,7 @@ grn_table_select_index_suffix(grn_ctx *ctx, return grn_table_select_index_prefix(ctx, table, index, si, res); } -static inline grn_bool +static grn_inline grn_bool grn_table_select_index_match(grn_ctx *ctx, grn_obj *table, grn_obj *index, @@ -6305,7 +6305,7 @@ grn_table_select_index_match(grn_ctx *ctx, return GRN_TRUE; } -static inline grn_bool +static grn_inline grn_bool grn_table_select_index_call_selector(grn_ctx *ctx, grn_obj *table, grn_obj *index, @@ -6424,7 +6424,7 @@ grn_table_select_index_call_selector(grn_ctx *ctx, return processed; } -static inline grn_bool +static grn_inline grn_bool grn_table_select_index_range_key(grn_ctx *ctx, grn_obj *table, scan_info *si, @@ -6508,7 +6508,7 @@ grn_table_select_index_range_key(grn_ctx *ctx, return processed; } -static inline grn_bool +static grn_inline grn_bool grn_table_select_index_range_column(grn_ctx *ctx, grn_obj *table, grn_obj *index, scan_info *si, grn_operator logical_op, @@ -6626,7 +6626,7 @@ grn_table_select_index_range_column(grn_ctx *ctx, grn_obj *table, return processed; } -static inline grn_bool +static grn_inline grn_bool grn_table_select_index_range_accessor(grn_ctx *ctx, grn_obj *table, grn_obj *accessor, @@ -6707,7 +6707,7 @@ grn_table_select_index_range_accessor(grn_ctx *ctx, return rc == GRN_SUCCESS; } -static inline grn_bool +static grn_inline grn_bool grn_table_select_index_range(grn_ctx *ctx, grn_obj *table, grn_obj *index, scan_info *si, grn_obj *res) { @@ -6730,7 +6730,7 @@ grn_table_select_index_range(grn_ctx *ctx, grn_obj *table, grn_obj *index, } } -static inline grn_bool +static grn_inline grn_bool grn_table_select_index(grn_ctx *ctx, grn_obj *table, scan_info *si, grn_obj *res, grn_id *min_id) { @@ -7026,7 +7026,7 @@ typedef struct { int weight; } efs_op; -inline static void +grn_inline static void skip_space(grn_ctx *ctx, efs_info *q) { unsigned int len; Modified: lib/geo.c (+8 -8) =================================================================== --- lib/geo.c 2017-11-01 10:40:22 +0900 (5456b32e7) +++ lib/geo.c 2017-11-01 10:55:22 +0900 (a94144a35) @@ -584,7 +584,7 @@ grn_geo_table_sort_collect_points(grn_ctx *ctx, grn_obj *table, grn_obj *index, return n_entries; } -static inline grn_obj * +static grn_inline grn_obj * find_geo_sort_index(grn_ctx *ctx, grn_obj *key) { grn_obj *index = NULL; @@ -611,7 +611,7 @@ find_geo_sort_index(grn_ctx *ctx, grn_obj *key) return index; } -static inline int +static grn_inline int grn_geo_table_sort_by_distance(grn_ctx *ctx, grn_obj *table, grn_obj *index, @@ -1609,7 +1609,7 @@ exit : GRN_API_RETURN((grn_obj *)cursor); } -static inline grn_bool +static grn_inline grn_bool grn_geo_cursor_entry_next_push(grn_ctx *ctx, grn_geo_cursor_in_rectangle *cursor, grn_geo_cursor_entry *entry) @@ -1641,7 +1641,7 @@ grn_geo_cursor_entry_next_push(grn_ctx *ctx, return pushed; } -static inline grn_bool +static grn_inline grn_bool grn_geo_cursor_entry_next(grn_ctx *ctx, grn_geo_cursor_in_rectangle *cursor, grn_geo_cursor_entry *entry) @@ -2338,7 +2338,7 @@ geo_longitude_distance_type(int start_longitude, int end_longitude) } } -static inline quadrant_type +static grn_inline quadrant_type geo_quadrant_type(grn_geo_point *point1, grn_geo_point *point2) { #define QUADRANT_1ST_WITH_AXIS(point) \ @@ -2406,7 +2406,7 @@ geo_quadrant_type(grn_geo_point *point1, grn_geo_point *point2) #undef QUADRANT_4TH_WITH_AXIS } -static inline double +static grn_inline double geo_distance_rectangle_square_root(double start_longitude, double start_latitude, double end_longitude, double end_latitude) { @@ -2419,7 +2419,7 @@ geo_distance_rectangle_square_root(double start_longitude, double start_latitude return sqrt((x * x) + (y * y)); } -static inline double +static grn_inline double geo_distance_rectangle_short_dist_type(quadrant_type quad_type, double lng1, double lat1, double lng2, double lat2) @@ -2488,7 +2488,7 @@ geo_distance_rectangle_short_dist_type(quadrant_type quad_type, return distance; } -static inline double +static grn_inline double geo_distance_rectangle_long_dist_type(quadrant_type quad_type, double lng1, double lat1, double lng2, double lat2) Modified: lib/grn.h (+11 -4) =================================================================== --- lib/grn.h 2017-11-01 10:40:22 +0900 (0d0768eba) +++ lib/grn.h 2017-11-01 10:55:22 +0900 (42e320752) @@ -91,6 +91,16 @@ #endif #ifdef WIN32 +# if defined(__cplusplus) || defined(__GNUC__) +# define grn_inline inline +# else /* defined(__cplusplus) || defined(__GNUC__) */ +# define grn_inline _inline +# endif /* defined(__cplusplus) || defined(__GNUC__) */ +#else /* WIN32 */ +# define grn_inline inline +#endif /* WIN32 */ + +#ifdef WIN32 # include <basetsd.h> # include <process.h> # include <winsock2.h> @@ -104,9 +114,6 @@ # ifndef __GNUC__ # define PATH_MAX (MAX_PATH - 1) -# ifndef __cplusplus -# define inline _inline -# endif # endif # ifndef __GNUC__ @@ -589,7 +596,7 @@ typedef uint8_t byte; #define GRN_ID_WIDTH 30 #ifdef __GNUC__ -inline static int +grn_inline static int grn_str_greater(const uint8_t *ap, uint32_t as, const uint8_t *bp, uint32_t bs) { for (;; ap++, bp++, as--, bs--) { Modified: lib/hash.c (+57 -57) =================================================================== --- lib/hash.c 2017-11-01 10:40:22 +0900 (905d27c0a) +++ lib/hash.c 2017-11-01 10:55:22 +0900 (efe3fb4de) @@ -26,7 +26,7 @@ /* grn_tiny_array */ /* Requirements: id != GRN_ID_NIL. */ -inline static int +grn_inline static int grn_tiny_array_get_block_id(grn_id id) { int most_significant_one_bit_offset; @@ -35,7 +35,7 @@ grn_tiny_array_get_block_id(grn_id id) } /* Requirements: id != GRN_ID_NIL. */ -inline static void * +grn_inline static void * grn_tiny_array_get(grn_tiny_array *array, grn_id id) { const int block_id = grn_tiny_array_get_block_id(id); uint8_t * const block = (uint8_t *)array->blocks[block_id]; @@ -47,7 +47,7 @@ grn_tiny_array_get(grn_tiny_array *array, grn_id id) { } /* Requirements: id != GRN_ID_NIL. */ -inline static void * +grn_inline static void * grn_tiny_array_put(grn_tiny_array *array, grn_id id) { const int block_id = grn_tiny_array_get_block_id(id); void ** const block = &array->blocks[block_id]; @@ -83,13 +83,13 @@ grn_tiny_array_put(grn_tiny_array *array, grn_id id) { return (uint8_t *)*block + (id - offset) * array->element_size; } -inline static void * +grn_inline static void * grn_tiny_array_at_inline(grn_tiny_array *array, grn_id id) { return id ? grn_tiny_array_put(array, id) : NULL; } -inline static void * +grn_inline static void * grn_tiny_array_next(grn_tiny_array *array) { return grn_tiny_array_put(array, array->max + 1); @@ -173,7 +173,7 @@ grn_tiny_bitmap_fin(grn_tiny_bitmap *bitmap) } /* Requirements: bit_id != GRN_ID_NIL. */ -inline static uint8_t * +grn_inline static uint8_t * grn_tiny_bitmap_get_byte(grn_tiny_bitmap *bitmap, grn_id bit_id) { const uint32_t byte_id = (bit_id >> 3) + 1; const int block_id = grn_tiny_array_get_block_id(byte_id); @@ -186,7 +186,7 @@ grn_tiny_bitmap_get_byte(grn_tiny_bitmap *bitmap, grn_id bit_id) { } /* Requirements: bit_id != GRN_ID_NIL. */ -inline static uint8_t * +grn_inline static uint8_t * grn_tiny_bitmap_put_byte(grn_tiny_bitmap *bitmap, grn_id bit_id) { const uint32_t byte_id = (bit_id >> 3) + 1; const int block_id = grn_tiny_array_get_block_id(byte_id); @@ -204,7 +204,7 @@ grn_tiny_bitmap_put_byte(grn_tiny_bitmap *bitmap, grn_id bit_id) { /* Requirements: bit_id != GRN_ID_NIL. */ /* Return value: 1/0 on success, -1 on failure. */ -inline static int +grn_inline static int grn_tiny_bitmap_get(grn_tiny_bitmap *bitmap, grn_id bit_id) { uint8_t * const ptr = grn_tiny_bitmap_get_byte(bitmap, bit_id); @@ -214,7 +214,7 @@ grn_tiny_bitmap_get(grn_tiny_bitmap *bitmap, grn_id bit_id) /* Requirements: bit_id != GRN_ID_NIL. */ /* Return value: 1/0 on success, -1 on failure. */ /* Note: A bitmap is extended if needed. */ -inline static int +grn_inline static int grn_tiny_bitmap_put(grn_tiny_bitmap *bitmap, grn_id bit_id) { uint8_t * const ptr = grn_tiny_bitmap_put_byte(bitmap, bit_id); @@ -222,7 +222,7 @@ grn_tiny_bitmap_put(grn_tiny_bitmap *bitmap, grn_id bit_id) } /* Requirements: bit_id != GRN_ID_NIL. */ -inline static uint8_t * +grn_inline static uint8_t * grn_tiny_bitmap_get_and_set(grn_tiny_bitmap *bitmap, grn_id bit_id, grn_bool bit) { @@ -240,7 +240,7 @@ grn_tiny_bitmap_get_and_set(grn_tiny_bitmap *bitmap, grn_id bit_id, /* Requirements: bit_id != GRN_ID_NIL. */ /* Note: A bitmap is extended if needed. */ -inline static uint8_t * +grn_inline static uint8_t * grn_tiny_bitmap_put_and_set(grn_tiny_bitmap *bitmap, grn_id bit_id, grn_bool bit) { @@ -260,7 +260,7 @@ grn_tiny_bitmap_put_and_set(grn_tiny_bitmap *bitmap, grn_id bit_id, #define GRN_ARRAY_MAX (GRN_ID_MAX - 8) -inline static void * +grn_inline static void * grn_io_array_at_inline(grn_ctx *ctx, grn_io *io, uint32_t segment_id, uint64_t offset, int flags) { @@ -272,7 +272,7 @@ grn_io_array_at_inline(grn_ctx *ctx, grn_io *io, uint32_t segment_id, /* * grn_io_array_bit_at() returns 1/0 on success, -1 on failure. */ -inline static int +grn_inline static int grn_io_array_bit_at(grn_ctx *ctx, grn_io *io, uint32_t segment_id, uint32_t offset) { @@ -285,7 +285,7 @@ grn_io_array_bit_at(grn_ctx *ctx, grn_io *io, * The following functions, grn_io_array_bit_*(), return a non-NULL pointer on * success, a NULL pointer on failure. */ -inline static void * +grn_inline static void * grn_io_array_bit_on(grn_ctx *ctx, grn_io *io, uint32_t segment_id, uint32_t offset) { @@ -297,7 +297,7 @@ grn_io_array_bit_on(grn_ctx *ctx, grn_io *io, return ptr; } -inline static void * +grn_inline static void * grn_io_array_bit_off(grn_ctx *ctx, grn_io *io, uint32_t segment_id, uint32_t offset) { @@ -309,7 +309,7 @@ grn_io_array_bit_off(grn_ctx *ctx, grn_io *io, return ptr; } -inline static void * +grn_inline static void * grn_io_array_bit_flip(grn_ctx *ctx, grn_io *io, uint32_t segment_id, uint32_t offset) { @@ -412,19 +412,19 @@ enum { GRN_ARRAY_BITMAP_SEGMENT = 1 }; -inline static grn_bool +grn_inline static grn_bool grn_array_is_io_array(grn_array *array) { return array->io != NULL; } -inline static void * +grn_inline static void * grn_array_io_entry_at(grn_ctx *ctx, grn_array *array, grn_id id, int flags) { return grn_io_array_at_inline(ctx, array->io, GRN_ARRAY_VALUE_SEGMENT, id, flags); } -inline static void * +grn_inline static void * grn_array_entry_at(grn_ctx *ctx, grn_array *array, grn_id id, int flags) { if (grn_array_is_io_array(array)) { @@ -435,7 +435,7 @@ grn_array_entry_at(grn_ctx *ctx, grn_array *array, grn_id id, int flags) } /* grn_array_bitmap_at() returns 1/0 on success, -1 on failure. */ -inline static int +grn_inline static int grn_array_bitmap_at(grn_ctx *ctx, grn_array *array, grn_id id) { if (grn_array_is_io_array(array)) { @@ -716,13 +716,13 @@ grn_array_truncate(grn_ctx *ctx, grn_array *array) return rc; } -inline static grn_id +grn_inline static grn_id grn_array_get_max_id(grn_array *array) { return grn_array_is_io_array(array) ? array->header->curr_rec : array->array.max; } -inline static void * +grn_inline static void * grn_array_get_value_inline(grn_ctx *ctx, grn_array *array, grn_id id) { if (!ctx || !array) { @@ -764,7 +764,7 @@ _grn_array_get_value(grn_ctx *ctx, grn_array *array, grn_id id) return grn_array_get_value_inline(ctx, array, id); } -inline static grn_rc +grn_inline static grn_rc grn_array_set_value_inline(grn_ctx *ctx, grn_array *array, grn_id id, const void *value, int flags) { @@ -1070,7 +1070,7 @@ grn_array_cursor_delete(grn_ctx *ctx, grn_array_cursor *cursor, return grn_array_delete_by_id(ctx, cursor->array, cursor->curr_rec, optarg); } -inline static grn_id +grn_inline static grn_id grn_array_add_to_tiny_array(grn_ctx *ctx, grn_array *array, void **value) { grn_id id = array->garbages; @@ -1108,7 +1108,7 @@ grn_array_add_to_tiny_array(grn_ctx *ctx, grn_array *array, void **value) return id; } -inline static grn_id +grn_inline static grn_id grn_array_add_to_io_array(grn_ctx *ctx, grn_array *array, void **value) { grn_id id; @@ -1355,7 +1355,7 @@ enum { GRN_HASH_BITMAP_SEGMENT = 3 }; -inline static int +grn_inline static int grn_hash_name(grn_ctx *ctx, grn_hash *hash, char *buffer, int buffer_size) { int name_size; @@ -1370,20 +1370,20 @@ grn_hash_name(grn_ctx *ctx, grn_hash *hash, char *buffer, int buffer_size) return name_size; } -inline static grn_bool +grn_inline static grn_bool grn_hash_is_io_hash(grn_hash *hash) { return hash->io != NULL; } -inline static void * +grn_inline static void * grn_io_hash_entry_at(grn_ctx *ctx, grn_hash *hash, grn_id id, int flags) { return grn_io_array_at_inline(ctx, hash->io, GRN_HASH_ENTRY_SEGMENT, id, flags); } /* todo : error handling */ -inline static void * +grn_inline static void * grn_hash_entry_at(grn_ctx *ctx, grn_hash *hash, grn_id id, int flags) { if (grn_hash_is_io_hash(hash)) { @@ -1393,7 +1393,7 @@ grn_hash_entry_at(grn_ctx *ctx, grn_hash *hash, grn_id id, int flags) } } -inline static grn_bool +grn_inline static grn_bool grn_hash_bitmap_at(grn_ctx *ctx, grn_hash *hash, grn_id id) { if (grn_hash_is_io_hash(hash)) { @@ -1403,14 +1403,14 @@ grn_hash_bitmap_at(grn_ctx *ctx, grn_hash *hash, grn_id id) } } -inline static grn_id * +grn_inline static grn_id * grn_io_hash_idx_at(grn_ctx *ctx, grn_hash *hash, grn_id id) { return grn_io_array_at_inline(ctx, hash->io, GRN_HASH_INDEX_SEGMENT, id, GRN_TABLE_ADD); } -inline static grn_id * +grn_inline static grn_id * grn_hash_idx_at(grn_ctx *ctx, grn_hash *hash, grn_id id) { if (grn_hash_is_io_hash(hash)) { @@ -1421,7 +1421,7 @@ grn_hash_idx_at(grn_ctx *ctx, grn_hash *hash, grn_id id) } } -inline static void * +grn_inline static void * grn_io_hash_key_at(grn_ctx *ctx, grn_hash *hash, uint64_t pos) { return grn_io_array_at_inline(ctx, hash->io, GRN_HASH_KEY_SEGMENT, @@ -1432,7 +1432,7 @@ grn_io_hash_key_at(grn_ctx *ctx, grn_hash *hash, uint64_t pos) #define MAX_INDEX_SIZE ((GRN_HASH_MAX_SEGMENT * (IDX_MASK_IN_A_SEGMENT + 1)) >> 1) -inline static uint16_t +grn_inline static uint16_t grn_hash_entry_get_key_size(grn_hash *hash, grn_hash_entry *entry) { if (hash->obj.header.flags & GRN_OBJ_KEY_VAR_SIZE) { @@ -1442,7 +1442,7 @@ grn_hash_entry_get_key_size(grn_hash *hash, grn_hash_entry *entry) } } -inline static char * +grn_inline static char * grn_hash_entry_get_key(grn_ctx *ctx, grn_hash *hash, grn_hash_entry *entry) { if (hash->obj.header.flags & GRN_OBJ_KEY_VAR_SIZE) { @@ -1478,7 +1478,7 @@ grn_hash_entry_get_key(grn_ctx *ctx, grn_hash *hash, grn_hash_entry *entry) } } -inline static void * +grn_inline static void * grn_hash_entry_get_value(grn_ctx *ctx, grn_hash *hash, grn_hash_entry *entry) { if (hash->obj.header.flags & GRN_OBJ_KEY_VAR_SIZE) { @@ -1500,7 +1500,7 @@ grn_hash_entry_get_value(grn_ctx *ctx, grn_hash *hash, grn_hash_entry *entry) } } -inline static grn_rc +grn_inline static grn_rc grn_io_hash_entry_put_key(grn_ctx *ctx, grn_hash *hash, grn_hash_entry *entry, const void *key, unsigned int key_size) @@ -1606,7 +1606,7 @@ grn_io_hash_entry_put_key(grn_ctx *ctx, grn_hash *hash, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_hash_entry_put_key(grn_ctx *ctx, grn_hash *hash, grn_hash_entry *entry, uint32_t hash_value, const void *key, unsigned int key_size) @@ -1679,7 +1679,7 @@ grn_hash_entry_put_key(grn_ctx *ctx, grn_hash *hash, * grn_hash_entry_compare_key() returns GRN_TRUE if the entry key equals the * specified key, or GRN_FALSE otherwise. */ -inline static grn_bool +grn_inline static grn_bool grn_hash_entry_compare_key(grn_ctx *ctx, grn_hash *hash, grn_hash_entry *entry, uint32_t hash_value, const void *key, unsigned int key_size) @@ -1726,26 +1726,26 @@ grn_hash_entry_compare_key(grn_ctx *ctx, grn_hash *hash, } } -inline static char * +grn_inline static char * get_key(grn_ctx *ctx, grn_hash *hash, entry_str *n) { return grn_hash_entry_get_key(ctx, hash, (grn_hash_entry *)n); } -inline static void * +grn_inline static void * get_value(grn_ctx *ctx, grn_hash *hash, entry_str *n) { return grn_hash_entry_get_value(ctx, hash, (grn_hash_entry *)n); } -inline static grn_rc +grn_inline static grn_rc put_key(grn_ctx *ctx, grn_hash *hash, entry_str *n, uint32_t h, const char *key, unsigned int len) { return grn_hash_entry_put_key(ctx, hash, (grn_hash_entry *)n, h, key, len); } -inline static int +grn_inline static int match_key(grn_ctx *ctx, grn_hash *hash, entry_str *ee, uint32_t h, const char *key, unsigned int len) { @@ -1755,7 +1755,7 @@ match_key(grn_ctx *ctx, grn_hash *hash, entry_str *ee, uint32_t h, #define GARBAGE (0xffffffff) -inline static uint32_t +grn_inline static uint32_t grn_io_hash_calculate_entry_size(uint32_t key_size, uint32_t value_size, uint32_t flags) { @@ -2167,7 +2167,7 @@ grn_hash_truncate(grn_ctx *ctx, grn_hash *hash) return rc; } -inline static uint32_t +grn_inline static uint32_t grn_hash_calculate_hash_value(const void *ptr, uint32_t size) { uint32_t i; @@ -2178,7 +2178,7 @@ grn_hash_calculate_hash_value(const void *ptr, uint32_t size) return hash_value; } -inline static uint32_t +grn_inline static uint32_t grn_hash_calculate_step(uint32_t hash_value) { return (hash_value >> 2) | 0x1010101; @@ -2336,7 +2336,7 @@ grn_hash_size(grn_ctx *ctx, grn_hash *hash) return *hash->n_entries; } -inline static grn_id +grn_inline static grn_id grn_io_hash_add(grn_ctx *ctx, grn_hash *hash, uint32_t hash_value, const void *key, unsigned int key_size, void **value) { @@ -2392,7 +2392,7 @@ grn_io_hash_add(grn_ctx *ctx, grn_hash *hash, uint32_t hash_value, return entry_id; } -inline static grn_id +grn_inline static grn_id grn_tiny_hash_add(grn_ctx *ctx, grn_hash *hash, uint32_t hash_value, const void *key, unsigned int key_size, void **value) { @@ -2577,7 +2577,7 @@ grn_hash_get(grn_ctx *ctx, grn_hash *hash, const void *key, } } -inline static grn_hash_entry * +grn_inline static grn_hash_entry * grn_hash_get_entry(grn_ctx *ctx, grn_hash *hash, grn_id id) { if (!grn_hash_bitmap_at(ctx, hash, id)) { @@ -3105,7 +3105,7 @@ grn_hash_cursor_delete(grn_ctx *ctx, grn_hash_cursor *c, #define COMPARE_VAL(ap,as,bp,bs)\ ((dir) ? COMPARE_VAL_((bp),(bs),(ap),(as)) : COMPARE_VAL_((ap),(as),(bp),(bs))) -inline static entry ** +grn_inline static entry ** pack(grn_ctx *ctx, grn_hash *hash, entry **res, grn_table_sort_optarg *arg, int dir) { uint32_t n; @@ -3139,7 +3139,7 @@ pack(grn_ctx *ctx, grn_hash *hash, entry **res, grn_table_sort_optarg *arg, int return *hash->n_entries > 2 ? head : NULL; } -inline static void +grn_inline static void swap(entry **a, entry **b) { entry *c_ = *a; @@ -3155,7 +3155,7 @@ swap(entry **a, entry **b) swap(a,b);\ } while (0) -inline static entry ** +grn_inline static entry ** part(grn_ctx *ctx, entry **b, entry **e, grn_table_sort_optarg *arg, grn_hash *hash, int dir) { entry **c; @@ -3253,7 +3253,7 @@ typedef struct { #define COMPARE_VAL32(ap,bp)\ ((dir) ? COMPARE_VAL32_((bp),(ap)) : COMPARE_VAL32_((ap),(bp))) -inline static val32 * +grn_inline static val32 * pack_val32(grn_ctx *ctx, grn_hash *hash, val32 *res, grn_table_sort_optarg *arg, int dir) { uint32_t n; @@ -3292,7 +3292,7 @@ pack_val32(grn_ctx *ctx, grn_hash *hash, val32 *res, grn_table_sort_optarg *arg, *bp = cr_;\ } while (0) -inline static val32 * +grn_inline static val32 * part_val32(grn_ctx *ctx, val32 *b, val32 *e, grn_table_sort_optarg *arg, grn_hash *hash, int dir) { @@ -3346,7 +3346,7 @@ sort_val32(grn_ctx *ctx, } } -inline static grn_id +grn_inline static grn_id entry2id(grn_ctx *ctx, grn_hash *hash, entry *e) { entry *e2; @@ -3523,7 +3523,7 @@ grn_rhash_fin(grn_ctx *ctx, grn_hash *hash) return rc; } -inline static void +grn_inline static void subrecs_push(byte *subrecs, int size, int n_subrecs, int score, void *body, int dir) { byte *v; @@ -3541,7 +3541,7 @@ subrecs_push(byte *subrecs, int size, int n_subrecs, int score, void *body, int grn_memcpy(v + GRN_RSET_SCORE_SIZE, body, size); } -inline static void +grn_inline static void subrecs_replace_min(byte *subrecs, int size, int n_subrecs, int score, void *body, int dir) { byte *v; Modified: lib/ii.c (+64 -64) =================================================================== --- lib/ii.c 2017-11-01 10:40:22 +0900 (04f8ec0d4) +++ lib/ii.c 2017-11-01 10:55:22 +0900 (cd76d6777) @@ -216,7 +216,7 @@ grn_ii_cursor_set_min_enable_get(void) /* segment */ -inline static uint32_t +grn_inline static uint32_t segment_get(grn_ctx *ctx, grn_ii *ii) { uint32_t pseg; @@ -255,7 +255,7 @@ segment_get(grn_ctx *ctx, grn_ii *ii) return pseg; } -inline static grn_rc +grn_inline static grn_rc segment_get_clear(grn_ctx *ctx, grn_ii *ii, uint32_t *pseg) { uint32_t seg = segment_get(ctx, ii); @@ -272,7 +272,7 @@ segment_get_clear(grn_ctx *ctx, grn_ii *ii, uint32_t *pseg) } } -inline static grn_rc +grn_inline static grn_rc buffer_segment_new(grn_ctx *ctx, grn_ii *ii, uint32_t *segno) { uint32_t lseg, pseg; @@ -392,7 +392,7 @@ buffer_segment_reserve(grn_ctx *ctx, grn_ii *ii, }\ } while (0) -inline static void +grn_inline static void buffer_segment_update(grn_ii *ii, uint32_t lseg, uint32_t pseg) { BGQENQUE(lseg); @@ -401,7 +401,7 @@ buffer_segment_update(grn_ii *ii, uint32_t lseg, uint32_t pseg) if (lseg >= ii->header->bmax) { ii->header->bmax = lseg + 1; } } -inline static void +grn_inline static void buffer_segment_clear(grn_ii *ii, uint32_t lseg) { BGQENQUE(lseg); @@ -2168,7 +2168,7 @@ struct grn_ii_buffer { typedef struct grn_ii_buffer buffer; -inline static uint32_t +grn_inline static uint32_t buffer_open(grn_ctx *ctx, grn_ii *ii, uint32_t pos, buffer_term **bt, buffer **b) { byte *p = NULL; @@ -2183,7 +2183,7 @@ buffer_open(grn_ctx *ctx, grn_ii *ii, uint32_t pos, buffer_term **bt, buffer **b return pseg; } -inline static grn_rc +grn_inline static grn_rc buffer_close(grn_ctx *ctx, grn_ii *ii, uint32_t pseg) { if (pseg >= ii->seg->header->max_segment) { @@ -2194,7 +2194,7 @@ buffer_close(grn_ctx *ctx, grn_ii *ii, uint32_t pseg) return GRN_SUCCESS; } -inline static uint32_t +grn_inline static uint32_t buffer_open_if_capable(grn_ctx *ctx, grn_ii *ii, int32_t seg, int size, buffer **b) { uint32_t pseg, pos = SEG2POS(seg, 0); @@ -2222,7 +2222,7 @@ typedef struct { #define BUFFER_REC_AT(b,pos) ((buffer_rec *)(b) + (pos)) #define BUFFER_REC_POS(b,rec) ((uint16_t)((rec) - (buffer_rec *)(b))) -inline static void +grn_inline static void buffer_term_dump(grn_ctx *ctx, grn_ii *ii, buffer *b, buffer_term *bt) { int pos, rid, sid; @@ -2253,7 +2253,7 @@ buffer_term_dump(grn_ctx *ctx, grn_ii *ii, buffer *b, buffer_term *bt) } } -inline static grn_rc +grn_inline static grn_rc check_jump(grn_ctx *ctx, grn_ii *ii, buffer *b, buffer_rec *r, int j) { uint16_t i = BUFFER_REC_POS(b, r); @@ -2295,7 +2295,7 @@ check_jump(grn_ctx *ctx, grn_ii *ii, buffer *b, buffer_rec *r, int j) return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc set_jump_r(grn_ctx *ctx, grn_ii *ii, buffer *b, buffer_rec *from, int to) { int i, j, max_jump = 100; @@ -2326,7 +2326,7 @@ set_jump_r(grn_ctx *ctx, grn_ii *ii, buffer *b, buffer_rec *from, int to) n = (n & 0x0000FFFF) + ((n >>16) & 0x0000FFFF);\ } while (0) -inline static grn_rc +grn_inline static grn_rc buffer_put(grn_ctx *ctx, grn_ii *ii, buffer *b, buffer_term *bt, buffer_rec *rnew, uint8_t *bs, grn_ii_updspec *u, int size) { @@ -2468,7 +2468,7 @@ buffer_put(grn_ctx *ctx, grn_ii *ii, buffer *b, buffer_term *bt, /* array */ -inline static uint32_t * +grn_inline static uint32_t * array_at(grn_ctx *ctx, grn_ii *ii, uint32_t id) { byte *p = NULL; @@ -2483,7 +2483,7 @@ array_at(grn_ctx *ctx, grn_ii *ii, uint32_t id) return (uint32_t *)(p + (id & ARRAY_MASK_IN_A_SEGMENT) * S_ARRAY_ELEMENT); } -inline static uint32_t * +grn_inline static uint32_t * array_get(grn_ctx *ctx, grn_ii *ii, uint32_t id) { byte *p = NULL; @@ -2501,7 +2501,7 @@ array_get(grn_ctx *ctx, grn_ii *ii, uint32_t id) return (uint32_t *)(p + (id & ARRAY_MASK_IN_A_SEGMENT) * S_ARRAY_ELEMENT); } -inline static void +grn_inline static void array_unref(grn_ii *ii, uint32_t id) { GRN_IO_SEG_UNREF(ii->seg, ii->header->ainfo[id >> W_ARRAY]); @@ -2578,7 +2578,7 @@ grn_ii_updspec_close(grn_ctx *ctx, grn_ii_updspec *u) return GRN_SUCCESS; } -inline static uint8_t * +grn_inline static uint8_t * encode_rec(grn_ctx *ctx, grn_ii *ii, grn_ii_updspec *u, unsigned int *size, int deletep) { uint8_t *br, *p; @@ -2644,7 +2644,7 @@ lexicon_deletable(grn_ctx *ctx, grn_obj *lexicon, grn_id tid, void *arg) } #endif /* CASCADE_DELETE_LEXICON */ -inline static void +grn_inline static void lexicon_delete(grn_ctx *ctx, grn_ii *ii, uint32_t tid, grn_hash *h) { #ifdef CASCADE_DELETE_LEXICON @@ -3996,7 +3996,7 @@ buffer_split(grn_ctx *ctx, grn_ii *ii, uint32_t seg, grn_hash *h) ((buffer)->header.nterms > 1 &&\ (buffer)->header.chunk_size * 100 > (ii)->header->total_chunk_size)) -inline static void +grn_inline static void buffer_new_find_segment(grn_ctx *ctx, grn_ii *ii, int size, @@ -4046,7 +4046,7 @@ buffer_new_find_segment(grn_ctx *ctx, array_unref(ii, tid); } -inline static void +grn_inline static void buffer_new_lexicon_pat(grn_ctx *ctx, grn_ii *ii, int size, @@ -4153,7 +4153,7 @@ buffer_new_lexicon_pat(grn_ctx *ctx, } } -inline static void +grn_inline static void buffer_new_lexicon_other(grn_ctx *ctx, grn_ii *ii, int size, @@ -4172,7 +4172,7 @@ buffer_new_lexicon_other(grn_ctx *ctx, } -inline static uint32_t +grn_inline static uint32_t buffer_new(grn_ctx *ctx, grn_ii *ii, int size, uint32_t *pos, buffer_term **bt, buffer_rec **br, buffer **bp, grn_id id, grn_hash *h) { @@ -5117,7 +5117,7 @@ exit : return c; } -static inline void +static grn_inline void grn_ii_cursor_set_min(grn_ctx *ctx, grn_ii_cursor *c, grn_id min) { if (c->min >= min) { @@ -5176,7 +5176,7 @@ typedef struct { grn_bool include_garbage; } grn_ii_cursor_next_options; -static inline grn_posting * +static grn_inline grn_posting * grn_ii_cursor_next_internal(grn_ctx *ctx, grn_ii_cursor *c, grn_ii_cursor_next_options *options) { @@ -5661,7 +5661,7 @@ typedef struct { grn_ii_cursor **bins; } cursor_heap; -static inline cursor_heap * +static grn_inline cursor_heap * cursor_heap_open(grn_ctx *ctx, int max) { cursor_heap *h = GRN_MALLOC(sizeof(cursor_heap)); @@ -5676,7 +5676,7 @@ cursor_heap_open(grn_ctx *ctx, int max) return h; } -static inline grn_rc +static grn_inline grn_rc cursor_heap_push(grn_ctx *ctx, cursor_heap *h, grn_ii *ii, grn_id tid, uint32_t offset2, int weight, grn_id min) { @@ -5733,20 +5733,20 @@ cursor_heap_push(grn_ctx *ctx, cursor_heap *h, grn_ii *ii, grn_id tid, uint32_t return GRN_SUCCESS; } -static inline grn_rc +static grn_inline grn_rc cursor_heap_push2(cursor_heap *h) { grn_rc rc = GRN_SUCCESS; return rc; } -static inline grn_ii_cursor * +static grn_inline grn_ii_cursor * cursor_heap_min(cursor_heap *h) { return h->n_entries ? h->bins[0] : NULL; } -static inline void +static grn_inline void cursor_heap_recalc_min(cursor_heap *h) { int n = 0, n1, n2, m; @@ -5778,7 +5778,7 @@ cursor_heap_recalc_min(cursor_heap *h) } } -static inline void +static grn_inline void cursor_heap_pop(grn_ctx *ctx, cursor_heap *h, grn_id min) { if (h->n_entries) { @@ -5808,7 +5808,7 @@ cursor_heap_pop(grn_ctx *ctx, cursor_heap *h, grn_id min) } } -static inline void +static grn_inline void cursor_heap_pop_pos(grn_ctx *ctx, cursor_heap *h) { if (h->n_entries) { @@ -5839,7 +5839,7 @@ cursor_heap_pop_pos(grn_ctx *ctx, cursor_heap *h) } } -static inline void +static grn_inline void cursor_heap_close(grn_ctx *ctx, cursor_heap *h) { int i; @@ -5852,7 +5852,7 @@ cursor_heap_close(grn_ctx *ctx, cursor_heap *h) /* update */ #ifdef USE_VGRAM -inline static grn_rc +grn_inline static grn_rc index_add(grn_ctx *ctx, grn_id rid, grn_obj *lexicon, grn_ii *ii, grn_vgram *vgram, const char *value, size_t value_len) { @@ -5915,7 +5915,7 @@ exit: return GRN_NO_MEMORY_AVAILABLE; } -inline static grn_rc +grn_inline static grn_rc index_del(grn_ctx *ctx, grn_id rid, grn_obj *lexicon, grn_ii *ii, grn_vgram *vgram, const char *value, size_t value_len) { @@ -6648,7 +6648,7 @@ typedef struct { #define EX_BOTH 3 #define EX_FUZZY 4 -inline static void +grn_inline static void token_info_expand_both(grn_ctx *ctx, grn_obj *lexicon, grn_ii *ii, const char *key, unsigned int key_size, token_info *ti) { @@ -6702,7 +6702,7 @@ token_info_expand_both(grn_ctx *ctx, grn_obj *lexicon, grn_ii *ii, } } -inline static grn_rc +grn_inline static grn_rc token_info_close(grn_ctx *ctx, token_info *ti) { cursor_heap_close(ctx, ti->cursors); @@ -6710,7 +6710,7 @@ token_info_close(grn_ctx *ctx, token_info *ti) return GRN_SUCCESS; } -inline static token_info * +grn_inline static token_info * token_info_open(grn_ctx *ctx, grn_obj *lexicon, grn_ii *ii, const char *key, unsigned int key_size, uint32_t offset, int mode, grn_fuzzy_search_optarg *args, grn_id min) @@ -6816,7 +6816,7 @@ token_info_open(grn_ctx *ctx, grn_obj *lexicon, grn_ii *ii, return ti; } -static inline grn_rc +static grn_inline grn_rc token_info_skip(grn_ctx *ctx, token_info *ti, uint32_t rid, uint32_t sid) { grn_ii_cursor *c; @@ -6832,7 +6832,7 @@ token_info_skip(grn_ctx *ctx, token_info *ti, uint32_t rid, uint32_t sid) return GRN_SUCCESS; } -static inline grn_rc +static grn_inline grn_rc token_info_skip_pos(grn_ctx *ctx, token_info *ti, uint32_t rid, uint32_t sid, uint32_t pos) { grn_ii_cursor *c; @@ -6849,7 +6849,7 @@ token_info_skip_pos(grn_ctx *ctx, token_info *ti, uint32_t rid, uint32_t sid, ui return GRN_SUCCESS; } -inline static int +grn_inline static int token_compare(const void *a, const void *b) { const token_info *t1 = *((token_info **)a), *t2 = *((token_info **)b); @@ -6880,7 +6880,7 @@ typedef struct { int size; } token_candidate_queue; -inline static void +grn_inline static void token_candidate_adjacent_set(grn_ctx *ctx, grn_token_cursor *token_cursor, token_candidate_node *top, token_candidate_node *curr) { @@ -6904,7 +6904,7 @@ token_candidate_adjacent_set(grn_ctx *ctx, grn_token_cursor *token_cursor, } } -inline static grn_rc +grn_inline static grn_rc token_candidate_init(grn_ctx *ctx, grn_ii *ii, grn_token_cursor *token_cursor, grn_id tid, int ef, token_candidate_node **nodes, int *n_nodes, uint32_t *max_estimated_size) @@ -6963,7 +6963,7 @@ token_candidate_init(grn_ctx *ctx, grn_ii *ii, grn_token_cursor *token_cursor, #undef TOKEN_CANDIDATE_NODE_SET } -inline static grn_rc +grn_inline static grn_rc token_candidate_queue_init(grn_ctx *ctx, token_candidate_queue *q) { q->top = 0; @@ -6978,7 +6978,7 @@ token_candidate_queue_init(grn_ctx *ctx, token_candidate_queue *q) return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc token_candidate_enqueue(grn_ctx *ctx, token_candidate_queue *q, uint32_t candidate) { if (q->rear >= q->size) { @@ -6995,7 +6995,7 @@ token_candidate_enqueue(grn_ctx *ctx, token_candidate_queue *q, uint32_t candida return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc token_candidate_dequeue(grn_ctx *ctx, token_candidate_queue *q, uint32_t *candidate) { if (q->top == q->rear) { @@ -7006,13 +7006,13 @@ token_candidate_dequeue(grn_ctx *ctx, token_candidate_queue *q, uint32_t *candid return GRN_SUCCESS; } -inline static void +grn_inline static void token_candidate_queue_fin(grn_ctx *ctx, token_candidate_queue *q) { GRN_FREE(q->candidates); } -inline static token_candidate_node* +grn_inline static token_candidate_node* token_candidate_last_node(grn_ctx *ctx, token_candidate_node *nodes, uint32_t candidate, int offset) { int i; @@ -7020,7 +7020,7 @@ token_candidate_last_node(grn_ctx *ctx, token_candidate_node *nodes, uint32_t ca return nodes + i + offset; } -inline static uint64_t +grn_inline static uint64_t token_candidate_score(grn_ctx *ctx, token_candidate_node *nodes, uint32_t candidate, int offset, uint32_t max_estimated_size) { @@ -7038,7 +7038,7 @@ token_candidate_score(grn_ctx *ctx, token_candidate_node *nodes, uint32_t candid return score; } -inline static grn_rc +grn_inline static grn_rc token_candidate_select(grn_ctx *ctx, token_candidate_node *nodes, int offset, int limit, int end, uint32_t *selected_candidate, uint32_t max_estimated_size) @@ -7100,7 +7100,7 @@ exit : return rc; } -inline static grn_rc +grn_inline static grn_rc token_candidate_build(grn_ctx *ctx, grn_obj *lexicon, grn_ii *ii, token_info **tis, uint32_t *n, token_candidate_node *nodes, uint32_t selected_candidate, @@ -7147,7 +7147,7 @@ exit : return rc; } -inline static grn_rc +grn_inline static grn_rc token_info_build_skipping_overlap(grn_ctx *ctx, grn_obj *lexicon, grn_ii *ii, token_info **tis, uint32_t *n, grn_token_cursor *token_cursor, @@ -7183,7 +7183,7 @@ exit : return rc; } -inline static grn_rc +grn_inline static grn_rc token_info_build(grn_ctx *ctx, grn_obj *lexicon, grn_ii *ii, const char *string, unsigned int string_len, token_info **tis, uint32_t *n, grn_bool *only_skip_token, grn_id min, grn_operator mode) @@ -7294,7 +7294,7 @@ exit : return rc; } -inline static grn_rc +grn_inline static grn_rc token_info_build_fuzzy(grn_ctx *ctx, grn_obj *lexicon, grn_ii *ii, const char *string, unsigned int string_len, token_info **tis, uint32_t *n, grn_bool *only_skip_token, @@ -7362,7 +7362,7 @@ token_info_clear_offset(token_info **tis, uint32_t n) /* select */ -inline static void +grn_inline static void res_add(grn_ctx *ctx, grn_hash *s, grn_rset_posinfo *pi, double score, grn_operator op) { @@ -7432,7 +7432,7 @@ typedef struct { btr_node *nodes; } btr; -inline static void +grn_inline static void bt_zap(btr *bt) { bt->n = 0; @@ -7441,7 +7441,7 @@ bt_zap(btr *bt) bt->root = NULL; } -inline static btr * +grn_inline static btr * bt_open(grn_ctx *ctx, int size) { btr *bt = GRN_MALLOC(sizeof(btr)); @@ -7455,7 +7455,7 @@ bt_open(grn_ctx *ctx, int size) return bt; } -inline static void +grn_inline static void bt_close(grn_ctx *ctx, btr *bt) { if (!bt) { return; } @@ -7463,7 +7463,7 @@ bt_close(grn_ctx *ctx, btr *bt) GRN_FREE(bt); } -inline static void +grn_inline static void bt_push(btr *bt, token_info *ti) { int pos = ti->pos, minp = 1, maxp = 1; @@ -7486,7 +7486,7 @@ bt_push(btr *bt, token_info *ti) if (maxp) { bt->max = ti; } } -inline static void +grn_inline static void bt_pop(btr *bt) { btr_node *node, *min, *newmin, **last; @@ -7522,7 +7522,7 @@ typedef enum { grn_wv_constant } grn_wv_mode; -inline static double +grn_inline static double get_weight(grn_ctx *ctx, grn_hash *s, grn_id rid, int sid, grn_wv_mode wvm, grn_select_optarg *optarg) { @@ -10685,14 +10685,14 @@ typedef struct { } grn_ii_builder_term; /* grn_ii_builder_term_is_inplace returns whether a term buffer is inplace. */ -inline static grn_bool +grn_inline static grn_bool grn_ii_builder_term_is_inplace(grn_ii_builder_term *term) { return term->size == GRN_II_BUILDER_TERM_INPLACE_SIZE; } /* grn_ii_builder_term_get_buf returns a term buffer. */ -inline static uint8_t * +grn_inline static uint8_t * grn_ii_builder_term_get_buf(grn_ii_builder_term *term) { if (grn_ii_builder_term_is_inplace(term)) { @@ -10761,7 +10761,7 @@ grn_ii_builder_term_extend(grn_ctx *ctx, grn_ii_builder_term *term) } /* grn_ii_builder_term_append appends an integer to a term buffer. */ -inline static grn_rc +grn_inline static grn_rc grn_ii_builder_term_append(grn_ctx *ctx, grn_ii_builder_term *term, uint64_t value) { @@ -10859,7 +10859,7 @@ grn_ii_builder_block_fin(grn_ctx *ctx, grn_ii_builder_block *block) * grn_ii_builder_block_next reads the next integer. Note that this function * returns GRN_END_OF_DATA if it reaches the end of a block. */ -inline static grn_rc +grn_inline static grn_rc grn_ii_builder_block_next(grn_ctx *ctx, grn_ii_builder_block *block, uint64_t *value) { @@ -11637,7 +11637,7 @@ grn_ii_builder_extend_terms(grn_ctx *ctx, grn_ii_builder *builder, } /* grn_ii_builder_get_term gets a term associated with tid. */ -inline static grn_rc +grn_inline static grn_rc grn_ii_builder_get_term(grn_ctx *ctx, grn_ii_builder *builder, grn_id tid, grn_ii_builder_term **term) { Modified: lib/index_column.c (+1 -1) =================================================================== --- lib/index_column.c 2017-11-01 10:40:22 +0900 (9838eb525) +++ lib/index_column.c 2017-11-01 10:55:22 +0900 (2f53a30d0) @@ -56,7 +56,7 @@ grn_index_column_init_from_env(void) } } -inline static void +grn_inline static void grn_index_column_build_call_hook(grn_ctx *ctx, grn_obj *obj, grn_id id, grn_obj *value, int flags) { Modified: lib/io.c (+63 -61) =================================================================== --- lib/io.c 2017-11-01 10:40:22 +0900 (a20fef614) +++ lib/io.c 2017-11-01 10:55:22 +0900 (4c34d677f) @@ -66,20 +66,20 @@ typedef struct _grn_io_fileinfo { static uint32_t grn_io_version_default = GRN_IO_VERSION_DEFAULT; static grn_bool grn_io_use_sparse = GRN_FALSE; -inline static grn_rc grn_fileinfo_open(grn_ctx *ctx, fileinfo *fi, +grn_inline static grn_rc grn_fileinfo_open(grn_ctx *ctx, fileinfo *fi, const char *path, int flags); -inline static void grn_fileinfo_init(fileinfo *fis, int nfis); -inline static int grn_fileinfo_opened(fileinfo *fi); -inline static grn_rc grn_fileinfo_close(grn_ctx *ctx, fileinfo *fi); +grn_inline static void grn_fileinfo_init(fileinfo *fis, int nfis); +grn_inline static int grn_fileinfo_opened(fileinfo *fi); +grn_inline static grn_rc grn_fileinfo_close(grn_ctx *ctx, fileinfo *fi); #ifdef WIN32 -inline static void * grn_mmap(grn_ctx *ctx, grn_ctx *owner_ctx, - grn_io *io, HANDLE *fmo, fileinfo *fi, - off_t offset, size_t length); -inline static int grn_munmap(grn_ctx *ctx, grn_ctx *owner_ctx, - grn_io *io, HANDLE *fmo, fileinfo *fi, - void *start, size_t length); -inline static int grn_msync(grn_ctx *ctx, HANDLE fh, - void *start, size_t length); +grn_inline static void * grn_mmap(grn_ctx *ctx, grn_ctx *owner_ctx, + grn_io *io, HANDLE *fmo, fileinfo *fi, + off_t offset, size_t length); +grn_inline static int grn_munmap(grn_ctx *ctx, grn_ctx *owner_ctx, + grn_io *io, HANDLE *fmo, fileinfo *fi, + void *start, size_t length); +grn_inline static int grn_msync(grn_ctx *ctx, HANDLE fh, + void *start, size_t length); # define GRN_MMAP(ctx,owner_ctx,io,fmo,fi,offset,length)\ (grn_mmap((ctx), (owner_ctx), (io), (fmo), (fi), (offset), (length))) # define GRN_MUNMAP(ctx,owner_ctx,io,fmo,fi,start,length)\ @@ -87,22 +87,24 @@ inline static int grn_msync(grn_ctx *ctx, HANDLE fh, # define GRN_MSYNC(ctx,fh,start,length) \ (grn_msync((ctx), (fh), (start), (length))) #else /* WIN32 */ -inline static void * grn_mmap(grn_ctx *ctx, grn_ctx *owner_ctx, - grn_io *io, fileinfo *fi, - off_t offset, size_t length); -inline static int grn_munmap(grn_ctx *ctx, grn_ctx *owner_ctx, - grn_io *io, fileinfo *fi, - void *start, size_t length); -inline static int grn_msync(grn_ctx *ctx, void *start, size_t length); +grn_inline static void * grn_mmap(grn_ctx *ctx, grn_ctx *owner_ctx, + grn_io *io, fileinfo *fi, + off_t offset, size_t length); +grn_inline static int grn_munmap(grn_ctx *ctx, grn_ctx *owner_ctx, + grn_io *io, fileinfo *fi, + void *start, size_t length); +grn_inline static int grn_msync(grn_ctx *ctx, void *start, size_t length); # define GRN_MUNMAP(ctx,owner_ctx,io,fmo,fi,start,length) \ (grn_munmap((ctx), (owner_ctx), (io), (fi), (start), (length))) # define GRN_MSYNC(ctx,fh,start,length) \ (grn_msync((ctx), (start), (length))) # ifdef USE_FAIL_MALLOC -inline static void * grn_fail_mmap(grn_ctx *ctx, grn_ctx *owner_ctx, - grn_io *io, fileinfo *fi, - off_t offset, size_t length, - const char* file, int line, const char *func); +grn_inline static void * grn_fail_mmap(grn_ctx *ctx, grn_ctx *owner_ctx, + grn_io *io, fileinfo *fi, + off_t offset, size_t length, + const char* file, + int line, + const char *func); # define GRN_MMAP(ctx,owner_ctx,io,fmo,fi,offset,length)\ (grn_fail_mmap((ctx), (owner_ctx), (io), (fi), (offset), (length),\ __FILE__, __LINE__, __FUNCTION__)) @@ -111,10 +113,10 @@ inline static void * grn_fail_mmap(grn_ctx *ctx, grn_ctx *owner_ctx, (grn_mmap((ctx), (owner_ctx), (io), (fi), (offset), (length))) # endif /* USE_FAIL_MALLOC */ #endif /* WIN32 */ -inline static grn_rc grn_pread(grn_ctx *ctx, fileinfo *fi, void *buf, - size_t count, off_t offset); -inline static grn_rc grn_pwrite(grn_ctx *ctx, fileinfo *fi, void *buf, - size_t count, off_t offset); +grn_inline static grn_rc grn_pread(grn_ctx *ctx, fileinfo *fi, void *buf, + size_t count, off_t offset); +grn_inline static grn_rc grn_pwrite(grn_ctx *ctx, fileinfo *fi, void *buf, + size_t count, off_t offset); void grn_io_init_from_env(void) @@ -142,7 +144,7 @@ grn_io_init_from_env(void) } } -static inline uint32_t +static grn_inline uint32_t grn_io_compute_base(uint32_t header_size) { uint32_t total_header_size; @@ -150,7 +152,7 @@ grn_io_compute_base(uint32_t header_size) return (total_header_size + grn_pagesize - 1) & ~(grn_pagesize - 1); } -static inline uint32_t +static grn_inline uint32_t grn_io_compute_base_segment(uint32_t base, uint32_t segment_size) { return (base + segment_size - 1) / segment_size; @@ -165,7 +167,7 @@ grn_io_compute_max_n_files(uint32_t segment_size, uint32_t max_segment, return (uint32_t)((last_segment_end + file_size - 1) / file_size); } -static inline unsigned long +static grn_inline unsigned long grn_io_compute_file_size(uint32_t version) { if (version == 0) { @@ -175,7 +177,7 @@ grn_io_compute_file_size(uint32_t version) } } -static inline uint32_t +static grn_inline uint32_t grn_io_max_segment(grn_io *io) { if (io->header->segment_tail) { @@ -197,7 +199,7 @@ grn_io_max_n_files(grn_io *io) file_size); } -static inline uint32_t +static grn_inline uint32_t grn_io_compute_nth_file_info(grn_io *io, uint32_t nth_segment) { uint32_t segment_size; @@ -455,7 +457,7 @@ grn_io_create_with_array(grn_ctx *ctx, const char *path, return NULL; } -inline static uint32_t +grn_inline static uint32_t segment_alloc(grn_ctx *ctx, grn_io *io) { uint32_t n, s; @@ -772,7 +774,7 @@ grn_io_get_type(grn_io *io) return io->header->type; } -inline static void +grn_inline static void gen_pathname(const char *path, char *buffer, int fno) { size_t len = strlen(path); @@ -1567,14 +1569,14 @@ static size_t mmap_size = 0; #ifdef WIN32 -inline static grn_rc +grn_inline static grn_rc grn_fileinfo_open_v1(grn_ctx *ctx, fileinfo *fi, const char *path, int flags) { CRITICAL_SECTION_INIT(fi->cs); return GRN_SUCCESS; } -inline static void * +grn_inline static void * grn_mmap_v1(grn_ctx *ctx, grn_ctx *owner_ctx, HANDLE *fmo, fileinfo *fi, off_t offset, size_t length) { @@ -1610,7 +1612,7 @@ grn_mmap_v1(grn_ctx *ctx, grn_ctx *owner_ctx, HANDLE *fmo, fileinfo *fi, return res; } -inline static int +grn_inline static int grn_munmap_v1(grn_ctx *ctx, grn_ctx *owner_ctx, HANDLE *fmo, fileinfo *fi, void *start, size_t length) { @@ -1646,7 +1648,7 @@ grn_munmap_v1(grn_ctx *ctx, grn_ctx *owner_ctx, HANDLE *fmo, fileinfo *fi, return r; } -inline static grn_rc +grn_inline static grn_rc grn_fileinfo_open_v0(grn_ctx *ctx, fileinfo *fi, const char *path, int flags) { /* signature may be wrong.. */ @@ -1682,7 +1684,7 @@ grn_fileinfo_open_v0(grn_ctx *ctx, fileinfo *fi, const char *path, int flags) return ctx->rc; } -inline static void * +grn_inline static void * grn_mmap_v0(grn_ctx *ctx, grn_ctx *owner_ctx, fileinfo *fi, off_t offset, size_t length) { @@ -1714,7 +1716,7 @@ grn_mmap_v0(grn_ctx *ctx, grn_ctx *owner_ctx, fileinfo *fi, off_t offset, return res; } -inline static int +grn_inline static int grn_munmap_v0(grn_ctx *ctx, grn_ctx *owner_ctx, fileinfo *fi, void *start, size_t length) { @@ -1733,7 +1735,7 @@ grn_munmap_v0(grn_ctx *ctx, grn_ctx *owner_ctx, fileinfo *fi, void *start, } } -inline static grn_rc +grn_inline static grn_rc grn_fileinfo_open_common(grn_ctx *ctx, fileinfo *fi, const char *path, int flags) { /* may be wrong if flags is just only O_RDWR */ @@ -1832,7 +1834,7 @@ exit : return ctx->rc; } -inline static grn_rc +grn_inline static grn_rc grn_fileinfo_open(grn_ctx *ctx, fileinfo *fi, const char *path, int flags) { grn_rc rc; @@ -1867,7 +1869,7 @@ grn_fileinfo_open(grn_ctx *ctx, fileinfo *fi, const char *path, int flags) } } -inline static int +grn_inline static int grn_guess_io_version(grn_ctx *ctx, grn_io *io, fileinfo *fi) { if (io) { @@ -1885,7 +1887,7 @@ grn_guess_io_version(grn_ctx *ctx, grn_io *io, fileinfo *fi) return grn_io_version_default; } -inline static void * +grn_inline static void * grn_mmap(grn_ctx *ctx, grn_ctx *owner_ctx, grn_io *io, HANDLE *fmo, fileinfo *fi, off_t offset, size_t length) { @@ -1900,7 +1902,7 @@ grn_mmap(grn_ctx *ctx, grn_ctx *owner_ctx, grn_io *io, HANDLE *fmo, } } -inline static int +grn_inline static int grn_munmap(grn_ctx *ctx, grn_ctx *owner_ctx, grn_io *io, HANDLE *fmo, fileinfo *fi, void *start, size_t length) { @@ -1915,7 +1917,7 @@ grn_munmap(grn_ctx *ctx, grn_ctx *owner_ctx, grn_io *io, } } -inline static grn_rc +grn_inline static grn_rc grn_fileinfo_close(grn_ctx *ctx, fileinfo *fi) { if (fi->fmo != NULL) { @@ -1930,7 +1932,7 @@ grn_fileinfo_close(grn_ctx *ctx, fileinfo *fi) return GRN_SUCCESS; } -inline static void +grn_inline static void grn_fileinfo_init(fileinfo *fis, int nfis) { for (; nfis--; fis++) { @@ -1939,13 +1941,13 @@ grn_fileinfo_init(fileinfo *fis, int nfis) } } -inline static int +grn_inline static int grn_fileinfo_opened(fileinfo *fi) { return fi->fh != INVALID_HANDLE_VALUE; } -inline static int +grn_inline static int grn_msync(grn_ctx *ctx, HANDLE handle, void *start, size_t length) { BOOL succeeded; @@ -1987,7 +1989,7 @@ grn_msync(grn_ctx *ctx, HANDLE handle, void *start, size_t length) return 0; } -inline static grn_rc +grn_inline static grn_rc grn_pread(grn_ctx *ctx, fileinfo *fi, void *buf, size_t count, off_t offset) { DWORD r, len; @@ -2009,7 +2011,7 @@ grn_pread(grn_ctx *ctx, fileinfo *fi, void *buf, size_t count, off_t offset) return ctx->rc; } -inline static grn_rc +grn_inline static grn_rc grn_pwrite(grn_ctx *ctx, fileinfo *fi, void *buf, size_t count, off_t offset) { DWORD r, len; @@ -2033,7 +2035,7 @@ grn_pwrite(grn_ctx *ctx, fileinfo *fi, void *buf, size_t count, off_t offset) #else /* WIN32 */ -inline static grn_rc +grn_inline static grn_rc grn_fileinfo_open(grn_ctx *ctx, fileinfo *fi, const char *path, int flags) { struct stat st; @@ -2053,19 +2055,19 @@ grn_fileinfo_open(grn_ctx *ctx, fileinfo *fi, const char *path, int flags) return GRN_SUCCESS; } -inline static void +grn_inline static void grn_fileinfo_init(fileinfo *fis, int nfis) { for (; nfis--; fis++) { fis->fd = -1; } } -inline static int +grn_inline static int grn_fileinfo_opened(fileinfo *fi) { return fi->fd != -1; } -inline static grn_rc +grn_inline static grn_rc grn_fileinfo_close(grn_ctx *ctx, fileinfo *fi) { if (fi->fd != -1) { @@ -2084,7 +2086,7 @@ grn_fileinfo_close(grn_ctx *ctx, fileinfo *fi) #include <sys/mman.h> -inline static void * +grn_inline static void * grn_mmap(grn_ctx *ctx, grn_ctx *owner_ctx, grn_io *io, fileinfo *fi, off_t offset, size_t length) { @@ -2115,7 +2117,7 @@ grn_mmap(grn_ctx *ctx, grn_ctx *owner_ctx, grn_io *io, fileinfo *fi, } #ifdef USE_FAIL_MALLOC -inline static void * +grn_inline static void * grn_fail_mmap(grn_ctx *ctx, grn_ctx *owner_ctx, grn_io *io, fileinfo *fi, off_t offset, size_t length, const char* file, int line, const char *func) @@ -2137,7 +2139,7 @@ grn_fail_mmap(grn_ctx *ctx, grn_ctx *owner_ctx, grn_io *io, fileinfo *fi, } #endif /* USE_FAIL_MALLOC */ -inline static int +grn_inline static int grn_msync(grn_ctx *ctx, void *start, size_t length) { int r = msync(start, length, MS_SYNC); @@ -2145,7 +2147,7 @@ grn_msync(grn_ctx *ctx, void *start, size_t length) return r; } -inline static int +grn_inline static int grn_munmap(grn_ctx *ctx, grn_ctx *owner_ctx, grn_io *io, fileinfo *fi, void *start, size_t length) { @@ -2162,7 +2164,7 @@ grn_munmap(grn_ctx *ctx, grn_ctx *owner_ctx, grn_io *io, fileinfo *fi, return res; } -inline static grn_rc +grn_inline static grn_rc grn_pread(grn_ctx *ctx, fileinfo *fi, void *buf, size_t count, off_t offset) { ssize_t r = pread(fi->fd, buf, count, offset); @@ -2180,7 +2182,7 @@ grn_pread(grn_ctx *ctx, fileinfo *fi, void *buf, size_t count, off_t offset) return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_pwrite(grn_ctx *ctx, fileinfo *fi, void *buf, size_t count, off_t offset) { ssize_t r = pwrite(fi->fd, buf, count, offset); Modified: lib/load.c (+1 -1) =================================================================== --- lib/load.c 2017-11-01 10:40:22 +0900 (ee0a1e2a0) +++ lib/load.c 2017-11-01 10:55:22 +0900 (aef15ffaf) @@ -240,7 +240,7 @@ set_weight_vector(grn_ctx *ctx, grn_obj *column, grn_id id, grn_obj *value) } } -static inline int +static grn_inline int name_equal(const char *p, unsigned int size, const char *name) { if (strlen(name) != size) { return 0; } Modified: lib/nfkc.rb (+1 -1) =================================================================== --- lib/nfkc.rb 2017-11-01 10:40:22 +0900 (9ad25bba9) +++ lib/nfkc.rb 2017-11-01 10:55:22 +0900 (96e34e7df) @@ -328,7 +328,7 @@ static #{return_type}#{space}#{table_name(type, common_bytes)}[] = { return_type, byte_size_groups, options={}) - modifier = options[:internal] ? "static inline " : "" + modifier = options[:internal] ? "static grn_inline " : "" @output.puts(<<-HEADER) #{modifier}#{return_type} Modified: lib/nfkc50.c (+102 -102) =================================================================== --- lib/nfkc50.c 2017-11-01 10:40:22 +0900 (06e802962) +++ lib/nfkc50.c 2017-11-01 10:55:22 +0900 (4fdf0e562) @@ -7000,7 +7000,7 @@ static const char *grn_nfkc50_compose_prefix_cc80_table_e1bd[] = { "\xe1\xbd\xaa", "\xe1\xbd\xab" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc80(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7155,7 +7155,7 @@ static const char *grn_nfkc50_compose_prefix_cc81_table_e1bd[] = { "\xe1\xbd\xac", "\xe1\xbd\xad" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc81(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7249,7 +7249,7 @@ static const char *grn_nfkc50_compose_prefix_cc82_table_e1ba[] = { "\xe1\xbb\x87" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc82(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7304,7 +7304,7 @@ static const char *grn_nfkc50_compose_prefix_cc83_table_c6[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, "\xe1\xbb\xaf" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc83(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7379,7 +7379,7 @@ static const char *grn_nfkc50_compose_prefix_cc88_table_d3[] = { "\xd3\xaa", "\xd3\xab" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc88(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7445,7 +7445,7 @@ static const char *grn_nfkc50_compose_prefix_cc8a_table_[] = { "\xe1\xba\x99" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc8a(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7467,7 +7467,7 @@ static const char *grn_nfkc50_compose_prefix_cca7_table_[] = { "\xc5\x9f", "\xc5\xa3" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cca7(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7522,7 +7522,7 @@ static const char *grn_nfkc50_compose_prefix_cc84_table_d0[] = { "\xd3\xa3" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc84(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7621,7 +7621,7 @@ static const char *grn_nfkc50_compose_prefix_cc86_table_d0[] = { "\xd0\xb9" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc86(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7685,7 +7685,7 @@ static const char *grn_nfkc50_compose_prefix_cca8_table_[] = { NULL, NULL, NULL, NULL, "\xc5\xb3" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cca8(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7712,7 +7712,7 @@ static const char *grn_nfkc50_compose_prefix_cc87_table_c5[] = { "\xe1\xb9\xa5", NULL, NULL, NULL, NULL, NULL, "\xe1\xb9\xa7" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc87(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7756,7 +7756,7 @@ static const char *grn_nfkc50_compose_prefix_cc8c_table_[] = { NULL, "\xc5\xbe" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc8c(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7795,7 +7795,7 @@ static const char *grn_nfkc50_compose_prefix_cc8b_table_[] = { "\xc5\x91", NULL, NULL, NULL, NULL, NULL, "\xc5\xb1" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc8b(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7829,7 +7829,7 @@ static const char *grn_nfkc50_compose_prefix_cc9b_table_[] = { "\xc6\xa1", NULL, NULL, NULL, NULL, NULL, "\xc6\xb0" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc9b(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7855,7 +7855,7 @@ static const char *grn_nfkc50_compose_prefix_cc8f_table_d1[] = { "\xd1\xb6", "\xd1\xb7" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc8f(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7887,7 +7887,7 @@ static const char *grn_nfkc50_compose_prefix_cc91_table_[] = { NULL, "\xc8\x93", NULL, NULL, "\xc8\x97" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc91(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7907,7 +7907,7 @@ static const char *grn_nfkc50_compose_prefix_cca6_table_[] = { "\xc8\x99", "\xc8\x9b" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cca6(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -7923,7 +7923,7 @@ grn_nfkc50_compose_prefix_cca6(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_d993(const unsigned char *utf8) { { @@ -7951,7 +7951,7 @@ static const char *grn_nfkc50_compose_prefix_d994_table_db[] = { NULL, "\xdb\x93", NULL, NULL, "\xdb\x80" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_d994(const unsigned char *utf8) { { @@ -7981,7 +7981,7 @@ grn_nfkc50_compose_prefix_d994(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_d995(const unsigned char *utf8) { { @@ -8004,7 +8004,7 @@ static const char *grn_nfkc50_compose_prefix_e0a4bc_table_e0a4[] = { "\xe0\xa4\xb1", NULL, NULL, "\xe0\xa4\xb4" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0a4bc(const unsigned char *utf8) { { @@ -8029,7 +8029,7 @@ grn_nfkc50_compose_prefix_e0a4bc(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0a6be(const unsigned char *utf8) { { @@ -8053,7 +8053,7 @@ grn_nfkc50_compose_prefix_e0a6be(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0a797(const unsigned char *utf8) { { @@ -8077,7 +8077,7 @@ grn_nfkc50_compose_prefix_e0a797(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0ad96(const unsigned char *utf8) { { @@ -8101,7 +8101,7 @@ grn_nfkc50_compose_prefix_e0ad96(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0acbe(const unsigned char *utf8) { { @@ -8125,7 +8125,7 @@ grn_nfkc50_compose_prefix_e0acbe(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0ad97(const unsigned char *utf8) { { @@ -8149,7 +8149,7 @@ grn_nfkc50_compose_prefix_e0ad97(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0af97(const unsigned char *utf8) { { @@ -8182,7 +8182,7 @@ static const char *grn_nfkc50_compose_prefix_e0aebe_table_e0af[] = { "\xe0\xaf\x8a", "\xe0\xaf\x8b" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0aebe(const unsigned char *utf8) { { @@ -8207,7 +8207,7 @@ grn_nfkc50_compose_prefix_e0aebe(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0b196(const unsigned char *utf8) { { @@ -8235,7 +8235,7 @@ static const char *grn_nfkc50_compose_prefix_e0b395_table_e0b3[] = { "\xe0\xb3\x87", NULL, NULL, NULL, "\xe0\xb3\x8b" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0b395(const unsigned char *utf8) { { @@ -8265,7 +8265,7 @@ grn_nfkc50_compose_prefix_e0b395(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0b396(const unsigned char *utf8) { { @@ -8289,7 +8289,7 @@ grn_nfkc50_compose_prefix_e0b396(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0b382(const unsigned char *utf8) { { @@ -8317,7 +8317,7 @@ static const char *grn_nfkc50_compose_prefix_e0b4be_table_e0b5[] = { "\xe0\xb5\x8a", "\xe0\xb5\x8b" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0b4be(const unsigned char *utf8) { { @@ -8342,7 +8342,7 @@ grn_nfkc50_compose_prefix_e0b4be(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0b597(const unsigned char *utf8) { { @@ -8370,7 +8370,7 @@ static const char *grn_nfkc50_compose_prefix_e0b78a_table_e0b7[] = { "\xe0\xb7\x9a", NULL, NULL, "\xe0\xb7\x9d" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0b78a(const unsigned char *utf8) { { @@ -8395,7 +8395,7 @@ grn_nfkc50_compose_prefix_e0b78a(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0b78f(const unsigned char *utf8) { { @@ -8419,7 +8419,7 @@ grn_nfkc50_compose_prefix_e0b78f(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e0b79f(const unsigned char *utf8) { { @@ -8443,7 +8443,7 @@ grn_nfkc50_compose_prefix_e0b79f(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e180ae(const unsigned char *utf8) { { @@ -8478,7 +8478,7 @@ static const char *grn_nfkc50_compose_prefix_e1acb5_table_e1ac[] = { NULL, "\xe1\xad\x80", "\xe1\xad\x81" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e1acb5(const unsigned char *utf8) { { @@ -8508,7 +8508,7 @@ grn_nfkc50_compose_prefix_e1acb5(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cca5(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -8535,7 +8535,7 @@ static const char *grn_nfkc50_compose_prefix_cca3_table_c6[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, "\xe1\xbb\xb1" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cca3(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -8568,7 +8568,7 @@ static const char *grn_nfkc50_compose_prefix_ccb1_table_[] = { "\xe1\xba\x95" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_ccb1(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -8590,7 +8590,7 @@ static const char *grn_nfkc50_compose_prefix_ccad_table_[] = { "\xe1\xb9\xb1", "\xe1\xb9\xb7" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_ccad(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -8612,7 +8612,7 @@ static const char *grn_nfkc50_compose_prefix_ccb0_table_[] = { "\xe1\xb9\xb5" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_ccb0(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -8628,7 +8628,7 @@ grn_nfkc50_compose_prefix_ccb0(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_ccae(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -8643,7 +8643,7 @@ grn_nfkc50_compose_prefix_ccae(const unsigned char *utf8) return NULL; } -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cca4(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -8676,7 +8676,7 @@ static const char *grn_nfkc50_compose_prefix_cc89_table_c6[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, "\xe1\xbb\xad" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc89(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -8727,7 +8727,7 @@ static const char *grn_nfkc50_compose_prefix_cc93_table_cf[] = { "\xe1\xbd\xa0" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc93(const unsigned char *utf8) { { @@ -8766,7 +8766,7 @@ static const char *grn_nfkc50_compose_prefix_cc94_table_cf[] = { "\xe1\xbd\xa1" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cc94(const unsigned char *utf8) { { @@ -8818,7 +8818,7 @@ static const char *grn_nfkc50_compose_prefix_cd82_table_e1bd[] = { "\xe1\xbd\xae", "\xe1\xbd\xaf" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cd82(const unsigned char *utf8) { { @@ -8899,7 +8899,7 @@ static const char *grn_nfkc50_compose_prefix_cd85_table_e1bf[] = { "\xe1\xbf\xb7" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_cd85(const unsigned char *utf8) { { @@ -8997,7 +8997,7 @@ static const char *grn_nfkc50_compose_prefix_ccb8_table_e28a[] = { "\xe2\x8b\xaa", "\xe2\x8b\xab", "\xe2\x8b\xac", "\xe2\x8b\xad" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_ccb8(const unsigned char *utf8) { if (utf8[0] < 0x80) { @@ -9082,7 +9082,7 @@ static const char *grn_nfkc50_compose_prefix_e38299_table_e383[] = { NULL, NULL, NULL, NULL, "\xe3\x83\xbe" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e38299(const unsigned char *utf8) { { @@ -9129,7 +9129,7 @@ static const char *grn_nfkc50_compose_prefix_e3829a_table_e383[] = { NULL, "\xe3\x83\x9a", NULL, NULL, "\xe3\x83\x9d" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e3829a(const unsigned char *utf8) { { @@ -9166,7 +9166,7 @@ static const char *grn_nfkc50_compose_prefix_e185a1_table_e184[] = { "\xed\x83\x80", "\xed\x8c\x8c", "\xed\x95\x98" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185a1(const unsigned char *utf8) { { @@ -10609,7 +10609,7 @@ static const char *grn_nfkc50_compose_prefix_e186a8_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xad" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186a8(const unsigned char *utf8) { { @@ -13113,7 +13113,7 @@ static const char *grn_nfkc50_compose_prefix_e186a9_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xae" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186a9(const unsigned char *utf8) { { @@ -15617,7 +15617,7 @@ static const char *grn_nfkc50_compose_prefix_e186aa_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xaf" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186aa(const unsigned char *utf8) { { @@ -18121,7 +18121,7 @@ static const char *grn_nfkc50_compose_prefix_e186ab_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xb0" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186ab(const unsigned char *utf8) { { @@ -20625,7 +20625,7 @@ static const char *grn_nfkc50_compose_prefix_e186ac_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xb1" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186ac(const unsigned char *utf8) { { @@ -23129,7 +23129,7 @@ static const char *grn_nfkc50_compose_prefix_e186ad_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xb2" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186ad(const unsigned char *utf8) { { @@ -25633,7 +25633,7 @@ static const char *grn_nfkc50_compose_prefix_e186ae_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xb3" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186ae(const unsigned char *utf8) { { @@ -28137,7 +28137,7 @@ static const char *grn_nfkc50_compose_prefix_e186af_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xb4" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186af(const unsigned char *utf8) { { @@ -30641,7 +30641,7 @@ static const char *grn_nfkc50_compose_prefix_e186b0_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xb5" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186b0(const unsigned char *utf8) { { @@ -33145,7 +33145,7 @@ static const char *grn_nfkc50_compose_prefix_e186b1_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xb6" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186b1(const unsigned char *utf8) { { @@ -35649,7 +35649,7 @@ static const char *grn_nfkc50_compose_prefix_e186b2_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xb7" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186b2(const unsigned char *utf8) { { @@ -38153,7 +38153,7 @@ static const char *grn_nfkc50_compose_prefix_e186b3_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xb8" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186b3(const unsigned char *utf8) { { @@ -40657,7 +40657,7 @@ static const char *grn_nfkc50_compose_prefix_e186b4_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xb9" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186b4(const unsigned char *utf8) { { @@ -43161,7 +43161,7 @@ static const char *grn_nfkc50_compose_prefix_e186b5_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xba" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186b5(const unsigned char *utf8) { { @@ -45665,7 +45665,7 @@ static const char *grn_nfkc50_compose_prefix_e186b6_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xbb" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186b6(const unsigned char *utf8) { { @@ -48169,7 +48169,7 @@ static const char *grn_nfkc50_compose_prefix_e186b7_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xbc" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186b7(const unsigned char *utf8) { { @@ -50673,7 +50673,7 @@ static const char *grn_nfkc50_compose_prefix_e186b8_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xbd" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186b8(const unsigned char *utf8) { { @@ -53177,7 +53177,7 @@ static const char *grn_nfkc50_compose_prefix_e186b9_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xbe" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186b9(const unsigned char *utf8) { { @@ -55681,7 +55681,7 @@ static const char *grn_nfkc50_compose_prefix_e186ba_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9d\xbf" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186ba(const unsigned char *utf8) { { @@ -58185,7 +58185,7 @@ static const char *grn_nfkc50_compose_prefix_e186bb_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9e\x80" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186bb(const unsigned char *utf8) { { @@ -60689,7 +60689,7 @@ static const char *grn_nfkc50_compose_prefix_e186bc_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9e\x81" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186bc(const unsigned char *utf8) { { @@ -63193,7 +63193,7 @@ static const char *grn_nfkc50_compose_prefix_e186bd_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9e\x82" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186bd(const unsigned char *utf8) { { @@ -65697,7 +65697,7 @@ static const char *grn_nfkc50_compose_prefix_e186be_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9e\x83" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186be(const unsigned char *utf8) { { @@ -68201,7 +68201,7 @@ static const char *grn_nfkc50_compose_prefix_e186bf_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9e\x84" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e186bf(const unsigned char *utf8) { { @@ -70705,7 +70705,7 @@ static const char *grn_nfkc50_compose_prefix_e18780_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9e\x85" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e18780(const unsigned char *utf8) { { @@ -73209,7 +73209,7 @@ static const char *grn_nfkc50_compose_prefix_e18781_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9e\x86" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e18781(const unsigned char *utf8) { { @@ -75713,7 +75713,7 @@ static const char *grn_nfkc50_compose_prefix_e18782_table_ed9d[] = { NULL, NULL, NULL, NULL, "\xed\x9e\x87" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e18782(const unsigned char *utf8) { { @@ -76805,7 +76805,7 @@ static const char *grn_nfkc50_compose_prefix_e185a2_table_e184[] = { "\xed\x83\x9c", "\xed\x8c\xa8", "\xed\x95\xb4" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185a2(const unsigned char *utf8) { { @@ -76836,7 +76836,7 @@ static const char *grn_nfkc50_compose_prefix_e185a3_table_e184[] = { "\xed\x83\xb8", "\xed\x8d\x84", "\xed\x96\x90" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185a3(const unsigned char *utf8) { { @@ -76867,7 +76867,7 @@ static const char *grn_nfkc50_compose_prefix_e185a4_table_e184[] = { "\xed\x84\x94", "\xed\x8d\xa0", "\xed\x96\xac" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185a4(const unsigned char *utf8) { { @@ -76898,7 +76898,7 @@ static const char *grn_nfkc50_compose_prefix_e185a5_table_e184[] = { "\xed\x84\xb0", "\xed\x8d\xbc", "\xed\x97\x88" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185a5(const unsigned char *utf8) { { @@ -76929,7 +76929,7 @@ static const char *grn_nfkc50_compose_prefix_e185a6_table_e184[] = { "\xed\x85\x8c", "\xed\x8e\x98", "\xed\x97\xa4" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185a6(const unsigned char *utf8) { { @@ -76960,7 +76960,7 @@ static const char *grn_nfkc50_compose_prefix_e185a7_table_e184[] = { "\xed\x85\xa8", "\xed\x8e\xb4", "\xed\x98\x80" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185a7(const unsigned char *utf8) { { @@ -76991,7 +76991,7 @@ static const char *grn_nfkc50_compose_prefix_e185a8_table_e184[] = { "\xed\x86\x84", "\xed\x8f\x90", "\xed\x98\x9c" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185a8(const unsigned char *utf8) { { @@ -77022,7 +77022,7 @@ static const char *grn_nfkc50_compose_prefix_e185a9_table_e184[] = { "\xed\x86\xa0", "\xed\x8f\xac", "\xed\x98\xb8" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185a9(const unsigned char *utf8) { { @@ -77053,7 +77053,7 @@ static const char *grn_nfkc50_compose_prefix_e185aa_table_e184[] = { "\xed\x86\xbc", "\xed\x90\x88", "\xed\x99\x94" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185aa(const unsigned char *utf8) { { @@ -77084,7 +77084,7 @@ static const char *grn_nfkc50_compose_prefix_e185ab_table_e184[] = { "\xed\x87\x98", "\xed\x90\xa4", "\xed\x99\xb0" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185ab(const unsigned char *utf8) { { @@ -77115,7 +77115,7 @@ static const char *grn_nfkc50_compose_prefix_e185ac_table_e184[] = { "\xed\x87\xb4", "\xed\x91\x80", "\xed\x9a\x8c" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185ac(const unsigned char *utf8) { { @@ -77146,7 +77146,7 @@ static const char *grn_nfkc50_compose_prefix_e185ad_table_e184[] = { "\xed\x88\x90", "\xed\x91\x9c", "\xed\x9a\xa8" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185ad(const unsigned char *utf8) { { @@ -77177,7 +77177,7 @@ static const char *grn_nfkc50_compose_prefix_e185ae_table_e184[] = { "\xed\x88\xac", "\xed\x91\xb8", "\xed\x9b\x84" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185ae(const unsigned char *utf8) { { @@ -77208,7 +77208,7 @@ static const char *grn_nfkc50_compose_prefix_e185af_table_e184[] = { "\xed\x89\x88", "\xed\x92\x94", "\xed\x9b\xa0" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185af(const unsigned char *utf8) { { @@ -77239,7 +77239,7 @@ static const char *grn_nfkc50_compose_prefix_e185b0_table_e184[] = { "\xed\x89\xa4", "\xed\x92\xb0", "\xed\x9b\xbc" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185b0(const unsigned char *utf8) { { @@ -77270,7 +77270,7 @@ static const char *grn_nfkc50_compose_prefix_e185b1_table_e184[] = { "\xed\x8a\x80", "\xed\x93\x8c", "\xed\x9c\x98" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185b1(const unsigned char *utf8) { { @@ -77301,7 +77301,7 @@ static const char *grn_nfkc50_compose_prefix_e185b2_table_e184[] = { "\xed\x8a\x9c", "\xed\x93\xa8", "\xed\x9c\xb4" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185b2(const unsigned char *utf8) { { @@ -77332,7 +77332,7 @@ static const char *grn_nfkc50_compose_prefix_e185b3_table_e184[] = { "\xed\x8a\xb8", "\xed\x94\x84", "\xed\x9d\x90" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185b3(const unsigned char *utf8) { { @@ -77363,7 +77363,7 @@ static const char *grn_nfkc50_compose_prefix_e185b4_table_e184[] = { "\xed\x8b\x94", "\xed\x94\xa0", "\xed\x9d\xac" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185b4(const unsigned char *utf8) { { @@ -77394,7 +77394,7 @@ static const char *grn_nfkc50_compose_prefix_e185b5_table_e184[] = { "\xed\x8b\xb0", "\xed\x94\xbc", "\xed\x9e\x88" }; -static inline const char * +static grn_inline const char * grn_nfkc50_compose_prefix_e185b5(const unsigned char *utf8) { { Modified: lib/normalizer.c (+7 -7) =================================================================== --- lib/normalizer.c 2017-11-01 10:40:22 +0900 (6004372f0) +++ lib/normalizer.c 2017-11-01 10:55:22 +0900 (23d94505f) @@ -78,7 +78,7 @@ static unsigned char symbol[] = { '$', 0, 0, '%', '#', '&', '*', '@', 0, 0, 0, 0, 0, 0, 0, 0 }; -inline static grn_obj * +grn_inline static grn_obj * eucjp_normalize(grn_ctx *ctx, grn_string *nstr) { static uint16_t hankana[] = { @@ -323,7 +323,7 @@ eucjp_normalize(grn_ctx *ctx, grn_string *nstr) return NULL; } -inline static grn_obj * +grn_inline static grn_obj * sjis_normalize(grn_ctx *ctx, grn_string *nstr) { static uint16_t hankana[] = { @@ -560,7 +560,7 @@ sjis_normalize(grn_ctx *ctx, grn_string *nstr) } #ifdef GRN_WITH_NFKC -static inline int +static grn_inline int grn_str_charlen_utf8(grn_ctx *ctx, const unsigned char *str, const unsigned char *end) { /* MEMO: This function allows non-null-terminated string as str. */ @@ -610,7 +610,7 @@ grn_str_charlen_utf8(grn_ctx *ctx, const unsigned char *str, const unsigned char return 0; } -inline static grn_obj * +grn_inline static grn_obj * utf8_normalize(grn_ctx *ctx, grn_string *nstr) { int16_t *ch; @@ -753,7 +753,7 @@ utf8_normalize(grn_ctx *ctx, grn_string *nstr) } #endif /* GRN_WITH_NFKC */ -inline static grn_obj * +grn_inline static grn_obj * ascii_normalize(grn_ctx *ctx, grn_string *nstr) { int16_t *ch; @@ -855,7 +855,7 @@ ascii_normalize(grn_ctx *ctx, grn_string *nstr) } /* use cp1252 as latin1 */ -inline static grn_obj * +grn_inline static grn_obj * latin1_normalize(grn_ctx *ctx, grn_string *nstr) { int16_t *ch; @@ -990,7 +990,7 @@ latin1_normalize(grn_ctx *ctx, grn_string *nstr) return NULL; } -inline static grn_obj * +grn_inline static grn_obj * koi8r_normalize(grn_ctx *ctx, grn_string *nstr) { int16_t *ch; Modified: lib/output.c (+27 -27) =================================================================== --- lib/output.c 2017-11-01 10:40:22 +0900 (d894280ab) +++ lib/output.c 2017-11-01 10:55:22 +0900 (88fbb829c) @@ -544,7 +544,7 @@ grn_output_null(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type) INCR_LENGTH; } -static inline void +static grn_inline void grn_output_bulk_void(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, const char *value, size_t value_len) { @@ -823,14 +823,14 @@ exit : grn_obj_close(ctx, &buf); } -static inline void +static grn_inline void grn_output_void(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, grn_obj *bulk, grn_obj_format *format) { grn_output_null(ctx, outbuf, output_type); } -static inline void +static grn_inline void grn_output_bulk(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, grn_obj *bulk, grn_obj_format *format) { @@ -1045,7 +1045,7 @@ grn_output_uvector_result_set(grn_ctx *ctx, GRN_OBJ_FIN(ctx, &buf); } -static inline void +static grn_inline void grn_output_uvector(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, grn_obj *uvector, grn_obj_format *format) { @@ -1136,7 +1136,7 @@ grn_output_uvector(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, grn_obj_unlink(ctx, range); } -static inline void +static grn_inline void grn_output_vector(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, grn_obj *vector, grn_obj_format *format) { @@ -1204,7 +1204,7 @@ grn_output_vector(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, } } -static inline void +static grn_inline void grn_output_pvector(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, grn_obj *pvector, grn_obj_format *format) { @@ -1225,7 +1225,7 @@ grn_output_pvector(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, } } -static inline void +static grn_inline void grn_output_result_set_n_hits_v1(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, @@ -1240,7 +1240,7 @@ grn_output_result_set_n_hits_v1(grn_ctx *ctx, grn_output_array_close(ctx, outbuf, output_type); } -static inline void +static grn_inline void grn_output_result_set_n_hits_v3(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, @@ -1250,7 +1250,7 @@ grn_output_result_set_n_hits_v3(grn_ctx *ctx, grn_output_int32(ctx, outbuf, output_type, format->nhits); } -static inline void +static grn_inline void grn_output_result_set_n_hits(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, @@ -1267,7 +1267,7 @@ grn_output_result_set_n_hits(grn_ctx *ctx, } } -static inline void +static grn_inline void grn_output_table_column_info(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, @@ -1305,7 +1305,7 @@ grn_output_table_column_info(grn_ctx *ctx, } } -static inline int +static grn_inline int count_n_elements_in_expression(grn_ctx *ctx, grn_obj *expression) { int n_elements = 0; @@ -1341,7 +1341,7 @@ is_score_accessor(grn_ctx *ctx, grn_obj *obj) return a->action == GRN_ACCESSOR_GET_SCORE; } -static inline void +static grn_inline void grn_output_table_column(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, grn_obj *column, grn_obj *buf) @@ -1394,7 +1394,7 @@ grn_output_table_column(grn_ctx *ctx, grn_obj *outbuf, } } -static inline void +static grn_inline void grn_output_table_column_by_expression(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, grn_expr_code *code, @@ -1435,7 +1435,7 @@ grn_output_table_column_by_expression(grn_ctx *ctx, grn_obj *outbuf, } } -static inline void +static grn_inline void grn_output_table_columns_open(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, @@ -1449,7 +1449,7 @@ grn_output_table_columns_open(grn_ctx *ctx, } } -static inline void +static grn_inline void grn_output_table_columns_close(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type) @@ -1461,7 +1461,7 @@ grn_output_table_columns_close(grn_ctx *ctx, } } -static inline void +static grn_inline void grn_output_table_columns_by_expression(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, grn_obj *table, grn_obj_format *format, @@ -1521,7 +1521,7 @@ grn_output_table_columns_by_expression(grn_ctx *ctx, grn_obj *outbuf, grn_output_table_columns_close(ctx, outbuf, output_type); } -static inline void +static grn_inline void grn_output_table_columns_by_columns(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, grn_obj *table, grn_obj_format *format, @@ -1556,7 +1556,7 @@ grn_output_table_columns(grn_ctx *ctx, grn_obj *outbuf, GRN_OBJ_FIN(ctx, &buf); } -static inline void +static grn_inline void grn_output_table_record_open(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, @@ -1569,7 +1569,7 @@ grn_output_table_record_open(grn_ctx *ctx, } } -static inline void +static grn_inline void grn_output_table_record_close(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type) @@ -1581,7 +1581,7 @@ grn_output_table_record_close(grn_ctx *ctx, } } -static inline void +static grn_inline void grn_output_table_record_by_column(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, @@ -1591,7 +1591,7 @@ grn_output_table_record_by_column(grn_ctx *ctx, grn_text_atoj(ctx, outbuf, output_type, column, id); } -static inline void +static grn_inline void grn_output_table_record_by_expression(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, @@ -1618,7 +1618,7 @@ grn_output_table_record_by_expression(grn_ctx *ctx, } } -static inline void +static grn_inline void grn_output_table_records_by_expression(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, grn_table_cursor *tc, @@ -1689,7 +1689,7 @@ grn_output_table_records_by_expression(grn_ctx *ctx, grn_obj *outbuf, } } -static inline void +static grn_inline void grn_output_table_records_by_columns(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, grn_table_cursor *tc, @@ -1712,7 +1712,7 @@ grn_output_table_records_by_columns(grn_ctx *ctx, grn_obj *outbuf, } } -static inline void +static grn_inline void grn_output_table_records_open(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, @@ -1724,7 +1724,7 @@ grn_output_table_records_open(grn_ctx *ctx, } } -static inline void +static grn_inline void grn_output_table_records_close(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type) @@ -2244,7 +2244,7 @@ typedef struct { grn_obj *buffer; } msgpack_writer_ctx; -static inline int +static grn_inline int msgpack_buffer_writer(void* data, const char* buf, msgpack_size_t len) { msgpack_writer_ctx *writer_ctx = (msgpack_writer_ctx *)data; @@ -2802,7 +2802,7 @@ grn_output_envelope(grn_ctx *ctx, } } -static inline grn_bool +static grn_inline grn_bool is_output_columns_format_v1(grn_ctx *ctx, const char *output_columns, unsigned int output_columns_len) Modified: lib/pat.c (+30 -30) =================================================================== --- lib/pat.c 2017-11-01 10:40:22 +0900 (8e20fde40) +++ lib/pat.c 2017-11-01 10:55:22 +0900 (0613eaba9) @@ -104,7 +104,7 @@ enum { void grn_p_pat_node(grn_ctx *ctx, grn_pat *pat, pat_node *node); /* error utilities */ -inline static int +grn_inline static int grn_pat_name(grn_ctx *ctx, grn_pat *pat, char *buffer, int buffer_size) { int name_size; @@ -132,7 +132,7 @@ grn_pat_name(grn_ctx *ctx, grn_pat *pat, char *buffer, int buffer_size) GRN_IO_ARRAY_AT(pat->io, segment_pat, id, &flags, n);\ } while (0) -inline static pat_node * +grn_inline static pat_node * pat_get(grn_ctx *ctx, grn_pat *pat, grn_id id) { pat_node *res; @@ -142,7 +142,7 @@ pat_get(grn_ctx *ctx, grn_pat *pat, grn_id id) return res; } -inline static pat_node * +grn_inline static pat_node * pat_node_new(grn_ctx *ctx, grn_pat *pat, grn_id *id) { uint32_t n = pat->header->curr_rec + 1; @@ -158,7 +158,7 @@ pat_node_new(grn_ctx *ctx, grn_pat *pat, grn_id *id) /* sis operation */ -inline static sis_node * +grn_inline static sis_node * sis_at(grn_ctx *ctx, grn_pat *pat, grn_id id) { sis_node *res; @@ -168,7 +168,7 @@ sis_at(grn_ctx *ctx, grn_pat *pat, grn_id id) return res; } -inline static sis_node * +grn_inline static sis_node * sis_get(grn_ctx *ctx, grn_pat *pat, grn_id id) { sis_node *res; @@ -207,7 +207,7 @@ sis_collect(grn_ctx *ctx, grn_pat *pat, grn_hash *h, grn_id id, uint32_t level) GRN_IO_ARRAY_AT(pat->io, segment_key, pos, &flags, ptr);\ } while (0) -inline static uint32_t +grn_inline static uint32_t key_put(grn_ctx *ctx, grn_pat *pat, const uint8_t *key, uint32_t len) { uint32_t res, ts; @@ -253,7 +253,7 @@ key_put(grn_ctx *ctx, grn_pat *pat, const uint8_t *key, uint32_t len) return res; } -inline static uint8_t * +grn_inline static uint8_t * pat_node_get_key(grn_ctx *ctx, grn_pat *pat, pat_node *n) { if (PAT_IMD(n)) { @@ -265,7 +265,7 @@ pat_node_get_key(grn_ctx *ctx, grn_pat *pat, pat_node *n) } } -inline static grn_rc +grn_inline static grn_rc pat_node_set_key(grn_ctx *ctx, grn_pat *pat, pat_node *n, const uint8_t *key, uint32_t len) { grn_rc rc; @@ -300,7 +300,7 @@ enum { DL_PHASE2 }; -inline static grn_pat_delinfo * +grn_inline static grn_pat_delinfo * delinfo_search(grn_pat *pat, grn_id id) { int i; @@ -316,7 +316,7 @@ delinfo_search(grn_pat *pat, grn_id id) return NULL; } -inline static grn_rc +grn_inline static grn_rc delinfo_turn_2(grn_ctx *ctx, grn_pat *pat, grn_pat_delinfo *di) { grn_id d, *p = NULL; @@ -406,7 +406,7 @@ delinfo_turn_2(grn_ctx *ctx, grn_pat *pat, grn_pat_delinfo *di) return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc delinfo_turn_3(grn_ctx *ctx, grn_pat *pat, grn_pat_delinfo *di) { pat_node *dn; @@ -431,7 +431,7 @@ delinfo_turn_3(grn_ctx *ctx, grn_pat *pat, grn_pat_delinfo *di) return GRN_SUCCESS; } -inline static grn_pat_delinfo * +grn_inline static grn_pat_delinfo * delinfo_new(grn_ctx *ctx, grn_pat *pat) { grn_pat_delinfo *res = &pat->header->delinfos[pat->header->curr_del]; @@ -456,7 +456,7 @@ delinfo_new(grn_ctx *ctx, grn_pat *pat) /* pat operation */ -inline static grn_pat * +grn_inline static grn_pat * _grn_pat_create(grn_ctx *ctx, grn_pat *pat, const char *path, uint32_t key_size, uint32_t value_size, uint32_t flags) { @@ -724,7 +724,7 @@ exit: return rc; } -inline static grn_id +grn_inline static grn_id _grn_pat_add(grn_ctx *ctx, grn_pat *pat, const uint8_t *key, uint32_t size, uint32_t *new, uint32_t *lkey) { grn_id r, r0, *p0, *p1 = NULL; @@ -877,7 +877,7 @@ _grn_pat_add(grn_ctx *ctx, grn_pat *pat, const uint8_t *key, uint32_t size, uint return r; } -inline static grn_bool +grn_inline static grn_bool chop(grn_ctx *ctx, grn_pat *pat, const char **key, const char *end, uint32_t *lkey) { size_t len = grn_charlen(ctx, *key, end); @@ -1009,7 +1009,7 @@ grn_pat_add(grn_ctx *ctx, grn_pat *pat, const void *key, uint32_t key_size, return r0; } -inline static grn_id +grn_inline static grn_id _grn_pat_get(grn_ctx *ctx, grn_pat *pat, const void *key, uint32_t key_size, void **value) { grn_id r; @@ -1284,7 +1284,7 @@ typedef struct { fuzzy_heap_node *nodes; } fuzzy_heap; -static inline fuzzy_heap * +static grn_inline fuzzy_heap * fuzzy_heap_open(grn_ctx *ctx, int max) { fuzzy_heap *h = GRN_MALLOC(sizeof(fuzzy_heap)); @@ -1299,7 +1299,7 @@ fuzzy_heap_open(grn_ctx *ctx, int max) return h; } -static inline grn_bool +static grn_inline grn_bool fuzzy_heap_push(grn_ctx *ctx, fuzzy_heap *h, grn_id id, uint16_t distance) { int n, n2; @@ -1327,7 +1327,7 @@ fuzzy_heap_push(grn_ctx *ctx, fuzzy_heap *h, grn_id id, uint16_t distance) return GRN_TRUE; } -static inline void +static grn_inline void fuzzy_heap_close(grn_ctx *ctx, fuzzy_heap *h) { GRN_FREE(h->nodes); @@ -1336,7 +1336,7 @@ fuzzy_heap_close(grn_ctx *ctx, fuzzy_heap *h) #define DIST(ox,oy) (dists[((lx + 1) * (oy)) + (ox)]) -inline static uint16_t +grn_inline static uint16_t calc_edit_distance_by_offset(grn_ctx *ctx, const char *sx, const char *ex, const char *sy, const char *ey, @@ -1402,7 +1402,7 @@ typedef struct { grn_bool can_transition; } fuzzy_node; -inline static void +grn_inline static void _grn_pat_fuzzy_search(grn_ctx *ctx, grn_pat *pat, grn_id id, const char *key, uint32_t key_size, uint16_t *dists, uint32_t lx, @@ -1577,7 +1577,7 @@ grn_pat_fuzzy_search(grn_ctx *ctx, grn_pat *pat, } } -inline static grn_rc +grn_inline static grn_rc _grn_pat_del(grn_ctx *ctx, grn_pat *pat, const char *key, uint32_t key_size, int shared, grn_table_delete_optarg *optarg) { @@ -2264,7 +2264,7 @@ grn_pat_scan(grn_ctx *ctx, grn_pat *pat, const char *str, unsigned int str_len, #define INITIAL_SIZE 512 -inline static void +grn_inline static void push(grn_pat_cursor *c, grn_id id, uint16_t check) { grn_ctx *ctx = c->ctx; @@ -2288,7 +2288,7 @@ push(grn_pat_cursor *c, grn_id id, uint16_t check) se->check = check; } -inline static grn_pat_cursor_entry * +grn_inline static grn_pat_cursor_entry * pop(grn_pat_cursor *c) { return c->sp ? &c->ss[--c->sp] : NULL; @@ -2386,7 +2386,7 @@ grn_pat_cursor_close(grn_ctx *ctx, grn_pat_cursor *c) GRN_FREE(c); } -inline static int +grn_inline static int bitcmp(const void *s1, const void *s2, int offset, int length) { int r, rest = length + (offset & 7) - 8, bl = offset >> 3, mask = 0xff >> (offset & 7); @@ -2405,7 +2405,7 @@ bitcmp(const void *s1, const void *s2, int offset, int length) return (*a & mask) - (*b & mask); } -inline static grn_rc +grn_inline static grn_rc set_cursor_prefix(grn_ctx *ctx, grn_pat *pat, grn_pat_cursor *c, const void *key, uint32_t key_size, int flags) { @@ -2466,7 +2466,7 @@ set_cursor_prefix(grn_ctx *ctx, grn_pat *pat, grn_pat_cursor *c, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc set_cursor_near(grn_ctx *ctx, grn_pat *pat, grn_pat_cursor *c, uint32_t min_size, const void *key, int flags) { @@ -2508,7 +2508,7 @@ set_cursor_near(grn_ctx *ctx, grn_pat *pat, grn_pat_cursor *c, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc set_cursor_common_prefix(grn_ctx *ctx, grn_pat *pat, grn_pat_cursor *c, uint32_t min_size, const void *key, uint32_t key_size, int flags) { @@ -2557,7 +2557,7 @@ set_cursor_common_prefix(grn_ctx *ctx, grn_pat *pat, grn_pat_cursor *c, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc set_cursor_ascend(grn_ctx *ctx, grn_pat *pat, grn_pat_cursor *c, const void *key, uint32_t key_size, int flags) { @@ -2627,7 +2627,7 @@ set_cursor_ascend(grn_ctx *ctx, grn_pat *pat, grn_pat_cursor *c, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc set_cursor_descend(grn_ctx *ctx, grn_pat *pat, grn_pat_cursor *c, const void *key, uint32_t key_size, int flags) { Modified: lib/proc.c (+8 -8) =================================================================== --- lib/proc.c 2017-11-01 10:40:22 +0900 (e21769f3f) +++ lib/proc.c 2017-11-01 10:55:22 +0900 (9a442d57b) @@ -1291,13 +1291,13 @@ func_now(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data) return obj; } -static inline grn_bool +static grn_inline grn_bool is_comparable_number_type(grn_id type) { return GRN_DB_INT8 <= type && type <= GRN_DB_TIME; } -static inline grn_id +static grn_inline grn_id larger_number_type(grn_id type1, grn_id type2) { if (type1 == type2) { @@ -1322,7 +1322,7 @@ larger_number_type(grn_id type1, grn_id type2) } } -static inline grn_id +static grn_inline grn_id smaller_number_type(grn_id type1, grn_id type2) { if (type1 == type2) { @@ -1362,7 +1362,7 @@ smaller_number_type(grn_id type1, grn_id type2) } } -static inline grn_bool +static grn_inline grn_bool is_negative_value(grn_obj *number) { switch (number->header.domain) { @@ -1383,7 +1383,7 @@ is_negative_value(grn_obj *number) } } -static inline grn_bool +static grn_inline grn_bool number_safe_cast(grn_ctx *ctx, grn_obj *src, grn_obj *dest, grn_id type) { grn_obj_reinit(ctx, dest, type, 0); @@ -1421,7 +1421,7 @@ number_safe_cast(grn_ctx *ctx, grn_obj *src, grn_obj *dest, grn_id type) return grn_obj_cast(ctx, src, dest, GRN_FALSE) == GRN_SUCCESS; } -static inline int +static grn_inline int compare_number(grn_ctx *ctx, grn_obj *number1, grn_obj *number2, grn_id type) { #define COMPARE_AND_RETURN(type, value1, value2)\ @@ -1485,7 +1485,7 @@ compare_number(grn_ctx *ctx, grn_obj *number1, grn_obj *number2, grn_id type) #undef COMPARE_AND_RETURN } -inline static void +grn_inline static void get_number_in_grn_uvector(grn_ctx *ctx, grn_obj *uvector, unsigned int offset, grn_obj *buf) { @@ -1535,7 +1535,7 @@ get_number_in_grn_uvector(grn_ctx *ctx, grn_obj *uvector, unsigned int offset, #undef GET_UVECTOR_ELEMENT_AS } -inline static void +grn_inline static void apply_max(grn_ctx *ctx, grn_obj *number, grn_obj *max, grn_obj *casted_number, grn_obj *casted_max, grn_id cast_type) { Modified: lib/proc/proc_fuzzy_search.c (+3 -3) =================================================================== --- lib/proc/proc_fuzzy_search.c 2017-11-01 10:40:22 +0900 (bb1b6a65f) +++ lib/proc/proc_fuzzy_search.c 2017-11-01 10:55:22 +0900 (56ebb858e) @@ -108,7 +108,7 @@ typedef struct { score_heap_node *nodes; } score_heap; -static inline score_heap * +static grn_inline score_heap * score_heap_open(grn_ctx *ctx, int max) { score_heap *h = GRN_PLUGIN_MALLOC(ctx, sizeof(score_heap)); @@ -123,7 +123,7 @@ score_heap_open(grn_ctx *ctx, int max) return h; } -static inline grn_bool +static grn_inline grn_bool score_heap_push(grn_ctx *ctx, score_heap *h, grn_id id, uint32_t score) { int n, n2; @@ -152,7 +152,7 @@ score_heap_push(grn_ctx *ctx, score_heap *h, grn_id id, uint32_t score) return GRN_TRUE; } -static inline void +static grn_inline void score_heap_close(grn_ctx *ctx, score_heap *h) { GRN_PLUGIN_FREE(ctx, h->nodes); Modified: lib/snip.c (+3 -3) =================================================================== --- lib/snip.c 2017-11-01 10:40:22 +0900 (da5ba704c) +++ lib/snip.c 2017-11-01 10:55:22 +0900 (919007d07) @@ -297,7 +297,7 @@ grn_snip_cond_reinit(snip_cond *cond) cond->stopflag = SNIPCOND_NONSTOP; } -inline static char * +grn_inline static char * grn_snip_strndup(grn_ctx *ctx, const char *string, unsigned int string_len) { char *copied_string; @@ -311,7 +311,7 @@ grn_snip_strndup(grn_ctx *ctx, const char *string, unsigned int string_len) return copied_string; } -inline static grn_rc +grn_inline static grn_rc grn_snip_cond_set_tag(grn_ctx *ctx, const char **dest_tag, size_t *dest_tag_len, const char *tag, unsigned int tag_len, @@ -443,7 +443,7 @@ grn_snip_find_firstbyte(const char *string, grn_encoding encoding, size_t offset return offset; } -inline static grn_rc +grn_inline static grn_rc grn_snip_set_default_tag(grn_ctx *ctx, const char **dest_tag, size_t *dest_tag_len, const char *tag, unsigned int tag_len, Modified: lib/store.c (+3 -3) =================================================================== --- lib/store.c 2017-11-01 10:40:22 +0900 (e814a85c3) +++ lib/store.c 2017-11-01 10:55:22 +0900 (887c99ca7) @@ -1591,7 +1591,7 @@ exit : } #ifdef GRN_WITH_ZLIB -inline static grn_rc +grn_inline static grn_rc grn_ja_put_zlib(grn_ctx *ctx, grn_ja *ja, grn_id id, void *value, uint32_t value_len, int flags, uint64_t *cas) { @@ -1671,7 +1671,7 @@ grn_ja_put_zlib(grn_ctx *ctx, grn_ja *ja, grn_id id, #endif /* GRN_WITH_ZLIB */ #ifdef GRN_WITH_LZ4 -inline static grn_rc +grn_inline static grn_rc grn_ja_put_lz4(grn_ctx *ctx, grn_ja *ja, grn_id id, void *value, uint32_t value_len, int flags, uint64_t *cas) { @@ -1762,7 +1762,7 @@ grn_ja_put_lz4(grn_ctx *ctx, grn_ja *ja, grn_id id, #endif /* GRN_WITH_LZ4 */ #ifdef GRN_WITH_ZSTD -inline static grn_rc +grn_inline static grn_rc grn_ja_put_zstd(grn_ctx *ctx, grn_ja *ja, grn_id id, Modified: lib/str.c (+9 -9) =================================================================== --- lib/str.c 2017-11-01 10:40:22 +0900 (d5b4e716b) +++ lib/str.c 2017-11-01 10:55:22 +0900 (b894901e7) @@ -35,7 +35,7 @@ # endif /* _WIN64 */ #endif /* defined(HAVE__GMTIME64_S) && defined(__GNUC__) */ -inline static int +grn_inline static int grn_str_charlen_utf8(grn_ctx *ctx, const unsigned char *str, const unsigned char *end) { /* MEMO: This function allows non-null-terminated string as str. */ @@ -188,7 +188,7 @@ static unsigned char symbol[] = { '$', 0, 0, '%', '#', '&', '*', '@', 0, 0, 0, 0, 0, 0, 0, 0 }; -inline static grn_rc +grn_inline static grn_rc normalize_euc(grn_ctx *ctx, grn_str *nstr) { static uint16_t hankana[] = { @@ -428,7 +428,7 @@ normalize_euc(grn_ctx *ctx, grn_str *nstr) } #ifdef GRN_WITH_NFKC -inline static grn_rc +grn_inline static grn_rc normalize_utf8(grn_ctx *ctx, grn_str *nstr) { int16_t *ch; @@ -549,7 +549,7 @@ normalize_utf8(grn_ctx *ctx, grn_str *nstr) } #endif /* GRN_WITH_NFKC */ -inline static grn_rc +grn_inline static grn_rc normalize_sjis(grn_ctx *ctx, grn_str *nstr) { static uint16_t hankana[] = { @@ -779,7 +779,7 @@ normalize_sjis(grn_ctx *ctx, grn_str *nstr) return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc normalize_none(grn_ctx *ctx, grn_str *nstr) { int16_t *ch; @@ -875,7 +875,7 @@ normalize_none(grn_ctx *ctx, grn_str *nstr) } /* use cp1252 as latin1 */ -inline static grn_rc +grn_inline static grn_rc normalize_latin1(grn_ctx *ctx, grn_str *nstr) { int16_t *ch; @@ -1004,7 +1004,7 @@ normalize_latin1(grn_ctx *ctx, grn_str *nstr) return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc normalize_koi8r(grn_ctx *ctx, grn_str *nstr) { int16_t *ch; @@ -1821,7 +1821,7 @@ grn_str_tok(const char *str, size_t str_len, char delim, const char **tokbuf, in return tok - tokbuf; } -inline static int +grn_inline static int op_getopt_flag(int *flags, const grn_str_getopt_opt *o, int argc, char * const argv[], int i, const char *optvalue) { @@ -2092,7 +2092,7 @@ grn_text_ulltoa(grn_ctx *ctx, grn_obj *buf, unsigned long long int i) return rc; } -inline static void +grn_inline static void ftoa_(grn_ctx *ctx, grn_obj *buf, double d) { char *start; Modified: lib/ts/ts_expr_node.c (+118 -118) =================================================================== --- lib/ts/ts_expr_node.c 2017-11-01 10:40:22 +0900 (44378cfae) +++ lib/ts/ts_expr_node.c 2017-11-01 10:55:22 +0900 (a6d9626cd) @@ -38,42 +38,42 @@ */ /* grn_ts_bool_is_valid() returns whether a value is valid or not. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_bool_is_valid(grn_ts_bool value) { return GRN_TRUE; } /* grn_ts_int_is_valid() returns whether a value is valid or not. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_int_is_valid(grn_ts_int value) { return GRN_TRUE; } /* grn_ts_float_is_valid() returns whether a value is valid or not. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_float_is_valid(grn_ts_float value) { return isfinite(value); } /* grn_ts_time_is_valid() returns whether a value is valid or not. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_time_is_valid(grn_ts_time value) { return GRN_TRUE; } /* grn_ts_text_is_valid() returns whether a value is valid or not. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_text_is_valid(grn_ts_text value) { return value.ptr || !value.size; } /* grn_ts_geo_is_valid() returns whether a value is valid or not. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_geo_is_valid(grn_ts_geo value) { return ((value.latitude >= GRN_GEO_MIN_LATITUDE) && @@ -96,42 +96,42 @@ grn_ts_geo_is_valid(grn_ts_geo value) }\ return GRN_TRUE; /* grn_ts_bool_vector_is_valid() returns whether a value is valid or not. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_bool_vector_is_valid(grn_ts_bool_vector value) { GRN_TS_VECTOR_IS_VALID(bool) } /* grn_ts_int_vector_is_valid() returns whether a value is valid or not. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_int_vector_is_valid(grn_ts_int_vector value) { GRN_TS_VECTOR_IS_VALID(int) } /* grn_ts_float_vector_is_valid() returns whether a value is valid or not. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_float_vector_is_valid(grn_ts_float_vector value) { GRN_TS_VECTOR_IS_VALID(float) } /* grn_ts_time_vector_is_valid() returns whether a value is valid or not. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_time_vector_is_valid(grn_ts_time_vector value) { GRN_TS_VECTOR_IS_VALID(time) } /* grn_ts_text_vector_is_valid() returns whether a value is valid or not. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_text_vector_is_valid(grn_ts_text_vector value) { GRN_TS_VECTOR_IS_VALID(text) } /* grn_ts_geo_vector_is_valid() returns whether a value is valid or not. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_geo_vector_is_valid(grn_ts_geo_vector value) { GRN_TS_VECTOR_IS_VALID(geo) @@ -139,98 +139,98 @@ grn_ts_geo_vector_is_valid(grn_ts_geo_vector value) #undef GRN_TS_VECTOR_IS_VALID /* grn_ts_bool_zero() returns a zero. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_bool_zero(void) { return GRN_FALSE; } /* grn_ts_int_zero() returns a zero. */ -inline static grn_ts_int +grn_inline static grn_ts_int grn_ts_int_zero(void) { return 0; } /* grn_ts_float_zero() returns a zero. */ -inline static grn_ts_float +grn_inline static grn_ts_float grn_ts_float_zero(void) { return 0.0; } /* grn_ts_time_zero() returns a zero. */ -inline static grn_ts_time +grn_inline static grn_ts_time grn_ts_time_zero(void) { return 0; } /* grn_ts_text_zero() returns a zero. */ -inline static grn_ts_text +grn_inline static grn_ts_text grn_ts_text_zero(void) { return (grn_ts_text){ NULL, 0 }; } /* grn_ts_geo_zero() returns a zero. */ -inline static grn_ts_geo +grn_inline static grn_ts_geo grn_ts_geo_zero(void) { return (grn_ts_geo){ 0, 0 }; } /* grn_ts_ref_zero() returns a zero. */ -inline static grn_ts_ref +grn_inline static grn_ts_ref grn_ts_ref_zero(void) { return (grn_ts_ref){ 0, 0.0 }; } /* grn_ts_bool_vector_zero() returns a zero. */ -inline static grn_ts_bool_vector +grn_inline static grn_ts_bool_vector grn_ts_bool_vector_zero(void) { return (grn_ts_bool_vector){ NULL, 0 }; } /* grn_ts_int_vector_zero() returns a zero. */ -inline static grn_ts_int_vector +grn_inline static grn_ts_int_vector grn_ts_int_vector_zero(void) { return (grn_ts_int_vector){ NULL, 0 }; } /* grn_ts_float_vector_zero() returns a zero. */ -inline static grn_ts_float_vector +grn_inline static grn_ts_float_vector grn_ts_float_vector_zero(void) { return (grn_ts_float_vector){ NULL, 0 }; } /* grn_ts_time_vector_zero() returns a zero. */ -inline static grn_ts_time_vector +grn_inline static grn_ts_time_vector grn_ts_time_vector_zero(void) { return (grn_ts_time_vector){ NULL, 0 }; } /* grn_ts_text_vector_zero() returns a zero. */ -inline static grn_ts_text_vector +grn_inline static grn_ts_text_vector grn_ts_text_vector_zero(void) { return (grn_ts_text_vector){ NULL, 0 }; } /* grn_ts_geo_vector_zero() returns a zero. */ -inline static grn_ts_geo_vector +grn_inline static grn_ts_geo_vector grn_ts_geo_vector_zero(void) { return (grn_ts_geo_vector){ NULL, 0 }; } /* grn_ts_ref_vector_zero() returns a zero. */ -inline static grn_ts_ref_vector +grn_inline static grn_ts_ref_vector grn_ts_ref_vector_zero(void) { return (grn_ts_ref_vector){ NULL, 0 }; @@ -320,49 +320,49 @@ grn_ts_data_kind_to_type(grn_ts_data_kind kind) */ /* grn_ts_op_logical_not_bool() returns !arg. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_logical_not_bool(grn_ts_bool arg) { return !arg; } /* grn_ts_op_bitwise_not_bool() returns ~arg. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_bitwise_not_bool(grn_ts_bool arg) { return !arg; } /* grn_ts_op_bitwise_not_int() returns ~arg. */ -inline static grn_ts_int +grn_inline static grn_ts_int grn_ts_op_bitwise_not_int(grn_ts_int arg) { return ~arg; } /* grn_ts_op_positive_int() returns +arg. */ -inline static grn_ts_int +grn_inline static grn_ts_int grn_ts_op_positive_int(grn_ts_int arg) { return arg; } /* grn_ts_op_positive_float() returns +arg. */ -inline static grn_ts_float +grn_inline static grn_ts_float grn_ts_op_positive_float(grn_ts_float arg) { return arg; } /* grn_ts_op_negative_int() returns -arg. */ -inline static grn_ts_int +grn_inline static grn_ts_int grn_ts_op_negative_int(grn_ts_int arg) { return -arg; } /* grn_ts_op_negative_float() returns -arg. */ -inline static grn_ts_float +grn_inline static grn_ts_float grn_ts_op_negative_float(grn_ts_float arg) { return -arg; @@ -390,63 +390,63 @@ grn_ts_op_time(grn_ctx *ctx, grn_ts_text arg, grn_ts_time *out) } /* grn_ts_op_bitwise_and_bool() returns lhs & rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_bitwise_and_bool(grn_ts_bool lhs, grn_ts_bool rhs) { return lhs & rhs; } /* grn_ts_op_bitwise_and_int() returns lhs & rhs. */ -inline static grn_ts_int +grn_inline static grn_ts_int grn_ts_op_bitwise_and_int(grn_ts_int lhs, grn_ts_int rhs) { return lhs & rhs; } /* grn_ts_op_bitwise_or_bool() returns lhs | rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_bitwise_or_bool(grn_ts_bool lhs, grn_ts_bool rhs) { return lhs | rhs; } /* grn_ts_op_bitwise_or_int() returns lhs | rhs. */ -inline static grn_ts_int +grn_inline static grn_ts_int grn_ts_op_bitwise_or_int(grn_ts_int lhs, grn_ts_int rhs) { return lhs | rhs; } /* grn_ts_op_bitwise_xor_bool() returns lhs ^ rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_bitwise_xor_bool(grn_ts_bool lhs, grn_ts_bool rhs) { return lhs ^ rhs; } /* grn_ts_op_bitwise_xor_int() returns lhs ^ rhs. */ -inline static grn_ts_int +grn_inline static grn_ts_int grn_ts_op_bitwise_xor_int(grn_ts_int lhs, grn_ts_int rhs) { return lhs ^ rhs; } /* grn_ts_op_equal_bool() returns lhs == rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_equal_bool(grn_ts_bool lhs, grn_ts_bool rhs) { return lhs == rhs; } /* grn_ts_op_equal_int() returns lhs == rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_equal_int(grn_ts_int lhs, grn_ts_int rhs) { return lhs == rhs; } /* grn_ts_op_equal_float() returns lhs == rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_equal_float(grn_ts_float lhs, grn_ts_float rhs) { /* To suppress warnings, "lhs == rhs" is not used. */ @@ -454,28 +454,28 @@ grn_ts_op_equal_float(grn_ts_float lhs, grn_ts_float rhs) } /* grn_ts_op_equal_time() returns lhs == rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_equal_time(grn_ts_time lhs, grn_ts_time rhs) { return lhs == rhs; } /* grn_ts_op_equal_text() returns lhs == rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_equal_text(grn_ts_text lhs, grn_ts_text rhs) { return (lhs.size == rhs.size) && !memcmp(lhs.ptr, rhs.ptr, lhs.size); } /* grn_ts_op_equal_geo() returns lhs == rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_equal_geo(grn_ts_geo lhs, grn_ts_geo rhs) { return (lhs.latitude == rhs.latitude) && (lhs.longitude == rhs.longitude); } /* grn_ts_op_equal_ref() returns lhs == rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_equal_ref(grn_ts_ref lhs, grn_ts_ref rhs) { /* Ignore scores. */ @@ -494,49 +494,49 @@ grn_ts_op_equal_ref(grn_ts_ref lhs, grn_ts_ref rhs) }\ return GRN_TRUE; /* grn_ts_op_equal_bool_vector() returns lhs == rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_equal_bool_vector(grn_ts_bool_vector lhs, grn_ts_bool_vector rhs) { GRN_TS_OP_EQUAL_VECTOR(bool) } /* grn_ts_op_equal_int_vector() returns lhs == rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_equal_int_vector(grn_ts_int_vector lhs, grn_ts_int_vector rhs) { GRN_TS_OP_EQUAL_VECTOR(int) } /* grn_ts_op_equal_float_vector() returns lhs == rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_equal_float_vector(grn_ts_float_vector lhs, grn_ts_float_vector rhs) { GRN_TS_OP_EQUAL_VECTOR(float) } /* grn_ts_op_equal_time_vector() returns lhs == rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_equal_time_vector(grn_ts_time_vector lhs, grn_ts_time_vector rhs) { GRN_TS_OP_EQUAL_VECTOR(time) } /* grn_ts_op_equal_text_vector() returns lhs == rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_equal_text_vector(grn_ts_text_vector lhs, grn_ts_text_vector rhs) { GRN_TS_OP_EQUAL_VECTOR(text) } /* grn_ts_op_equal_geo_vector() returns lhs == rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_equal_geo_vector(grn_ts_geo_vector lhs, grn_ts_geo_vector rhs) { GRN_TS_OP_EQUAL_VECTOR(geo) } /* grn_ts_op_equal_ref_vector() returns lhs == rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_equal_ref_vector(grn_ts_ref_vector lhs, grn_ts_ref_vector rhs) { GRN_TS_OP_EQUAL_VECTOR(ref) @@ -544,21 +544,21 @@ grn_ts_op_equal_ref_vector(grn_ts_ref_vector lhs, grn_ts_ref_vector rhs) #undef GRN_TS_OP_EQUAL_VECTOR /* grn_ts_op_not_equal_bool() returns lhs != rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_not_equal_bool(grn_ts_bool lhs, grn_ts_bool rhs) { return lhs != rhs; } /* grn_ts_op_not_equal_int() returns lhs != rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_not_equal_int(grn_ts_int lhs, grn_ts_int rhs) { return lhs != rhs; } /* grn_ts_op_not_equal_float() returns lhs != rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_not_equal_float(grn_ts_float lhs, grn_ts_float rhs) { /* To suppress warnings, "lhs != rhs" is not used. */ @@ -566,28 +566,28 @@ grn_ts_op_not_equal_float(grn_ts_float lhs, grn_ts_float rhs) } /* grn_ts_op_not_equal_time() returns lhs != rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_not_equal_time(grn_ts_time lhs, grn_ts_time rhs) { return lhs != rhs; } /* grn_ts_op_not_equal_text() returns lhs != rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_not_equal_text(grn_ts_text lhs, grn_ts_text rhs) { return (lhs.size != rhs.size) || memcmp(lhs.ptr, rhs.ptr, lhs.size); } /* grn_ts_op_not_equal_geo() returns lhs != rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_not_equal_geo(grn_ts_geo lhs, grn_ts_geo rhs) { return (lhs.latitude != rhs.latitude) || (lhs.longitude != rhs.longitude); } /* grn_ts_op_not_equal_ref() returns lhs != rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_not_equal_ref(grn_ts_ref lhs, grn_ts_ref rhs) { /* Ignore scores. */ @@ -606,21 +606,21 @@ grn_ts_op_not_equal_ref(grn_ts_ref lhs, grn_ts_ref rhs) }\ return GRN_FALSE; /* grn_ts_op_not_equal_bool_vector() returns lhs != rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_not_equal_bool_vector(grn_ts_bool_vector lhs, grn_ts_bool_vector rhs) { GRN_TS_OP_NOT_EQUAL_VECTOR(bool) } /* grn_ts_op_not_equal_int_vector() returns lhs != rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_not_equal_int_vector(grn_ts_int_vector lhs, grn_ts_int_vector rhs) { GRN_TS_OP_NOT_EQUAL_VECTOR(int) } /* grn_ts_op_not_equal_float_vector() returns lhs != rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_not_equal_float_vector(grn_ts_float_vector lhs, grn_ts_float_vector rhs) { @@ -628,28 +628,28 @@ grn_ts_op_not_equal_float_vector(grn_ts_float_vector lhs, } /* grn_ts_op_not_equal_time_vector() returns lhs != rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_not_equal_time_vector(grn_ts_time_vector lhs, grn_ts_time_vector rhs) { GRN_TS_OP_NOT_EQUAL_VECTOR(time) } /* grn_ts_op_not_equal_text_vector() returns lhs != rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_not_equal_text_vector(grn_ts_text_vector lhs, grn_ts_text_vector rhs) { GRN_TS_OP_NOT_EQUAL_VECTOR(text) } /* grn_ts_op_not_equal_geo_vector() returns lhs != rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_not_equal_geo_vector(grn_ts_geo_vector lhs, grn_ts_geo_vector rhs) { GRN_TS_OP_NOT_EQUAL_VECTOR(geo) } /* grn_ts_op_not_equal_ref_vector() returns lhs != rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_not_equal_ref_vector(grn_ts_ref_vector lhs, grn_ts_ref_vector rhs) { GRN_TS_OP_NOT_EQUAL_VECTOR(ref) @@ -657,28 +657,28 @@ grn_ts_op_not_equal_ref_vector(grn_ts_ref_vector lhs, grn_ts_ref_vector rhs) #undef GRN_TS_OP_NOT_EQUAL_VECTOR /* grn_ts_op_less_int() returns lhs < rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_int(grn_ts_int lhs, grn_ts_int rhs) { return lhs < rhs; } /* grn_ts_op_less_float() returns lhs < rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_float(grn_ts_float lhs, grn_ts_float rhs) { return lhs < rhs; } /* grn_ts_op_less_time() returns lhs < rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_time(grn_ts_time lhs, grn_ts_time rhs) { return lhs < rhs; } /* grn_ts_op_less_text() returns lhs < rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_text(grn_ts_text lhs, grn_ts_text rhs) { size_t min_size = (lhs.size < rhs.size) ? lhs.size : rhs.size; @@ -697,28 +697,28 @@ grn_ts_op_less_text(grn_ts_text lhs, grn_ts_text rhs) }\ return lhs.size < rhs.size; /* grn_ts_op_less_int_vector() returns lhs < rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_int_vector(grn_ts_int_vector lhs, grn_ts_int_vector rhs) { GRN_TS_OP_LESS_VECTOR(int) } /* grn_ts_op_less_float_vector() returns lhs < rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_float_vector(grn_ts_float_vector lhs, grn_ts_float_vector rhs) { GRN_TS_OP_LESS_VECTOR(float) } /* grn_ts_op_less_time_vector() returns lhs < rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_time_vector(grn_ts_time_vector lhs, grn_ts_time_vector rhs) { GRN_TS_OP_LESS_VECTOR(time) } /* grn_ts_op_less_text_vector() returns lhs < rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_text_vector(grn_ts_text_vector lhs, grn_ts_text_vector rhs) { GRN_TS_OP_LESS_VECTOR(text) @@ -726,28 +726,28 @@ grn_ts_op_less_text_vector(grn_ts_text_vector lhs, grn_ts_text_vector rhs) #undef GRN_TS_OP_LESS_VECTOR /* grn_ts_op_less_equal_int() returns lhs <= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_equal_int(grn_ts_int lhs, grn_ts_int rhs) { return lhs <= rhs; } /* grn_ts_op_less_equal_float() returns lhs <= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_equal_float(grn_ts_float lhs, grn_ts_float rhs) { return lhs <= rhs; } /* grn_ts_op_less_equal_time() returns lhs <= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_equal_time(grn_ts_time lhs, grn_ts_time rhs) { return lhs <= rhs; } /* grn_ts_op_less_equal_text() returns lhs <= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_equal_text(grn_ts_text lhs, grn_ts_text rhs) { size_t min_size = (lhs.size < rhs.size) ? lhs.size : rhs.size; @@ -766,14 +766,14 @@ grn_ts_op_less_equal_text(grn_ts_text lhs, grn_ts_text rhs) }\ return lhs.size <= rhs.size; /* grn_ts_op_less_equal_int_vector() returns lhs <= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_equal_int_vector(grn_ts_int_vector lhs, grn_ts_int_vector rhs) { GRN_TS_OP_LESS_EQUAL_VECTOR(int) } /* grn_ts_op_less_equal_float_vector() returns lhs <= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_equal_float_vector(grn_ts_float_vector lhs, grn_ts_float_vector rhs) { @@ -781,7 +781,7 @@ grn_ts_op_less_equal_float_vector(grn_ts_float_vector lhs, } /* grn_ts_op_less_equal_time_vector() returns lhs <= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_equal_time_vector(grn_ts_time_vector lhs, grn_ts_time_vector rhs) { @@ -789,7 +789,7 @@ grn_ts_op_less_equal_time_vector(grn_ts_time_vector lhs, } /* grn_ts_op_less_equal_text_vector() returns lhs <= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_less_equal_text_vector(grn_ts_text_vector lhs, grn_ts_text_vector rhs) { @@ -798,28 +798,28 @@ grn_ts_op_less_equal_text_vector(grn_ts_text_vector lhs, #undef GRN_TS_OP_LESS_EQUAL_VECTOR /* grn_ts_op_greater_int() returns lhs > rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_int(grn_ts_int lhs, grn_ts_int rhs) { return lhs > rhs; } /* grn_ts_op_greater_float() returns lhs > rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_float(grn_ts_float lhs, grn_ts_float rhs) { return lhs > rhs; } /* grn_ts_op_greater_time() returns lhs > rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_time(grn_ts_time lhs, grn_ts_time rhs) { return lhs > rhs; } /* grn_ts_op_greater_text() returns lhs > rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_text(grn_ts_text lhs, grn_ts_text rhs) { size_t min_size = (lhs.size < rhs.size) ? lhs.size : rhs.size; @@ -838,14 +838,14 @@ grn_ts_op_greater_text(grn_ts_text lhs, grn_ts_text rhs) }\ return lhs.size > rhs.size; /* grn_ts_op_greater_int_vector() returns lhs > rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_int_vector(grn_ts_int_vector lhs, grn_ts_int_vector rhs) { GRN_TS_OP_GREATER_VECTOR(int) } /* grn_ts_op_greater_float_vector() returns lhs > rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_float_vector(grn_ts_float_vector lhs, grn_ts_float_vector rhs) { @@ -853,14 +853,14 @@ grn_ts_op_greater_float_vector(grn_ts_float_vector lhs, } /* grn_ts_op_greater_time_vector() returns lhs > rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_time_vector(grn_ts_time_vector lhs, grn_ts_time_vector rhs) { GRN_TS_OP_GREATER_VECTOR(time) } /* grn_ts_op_greater_text_vector() returns lhs > rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_text_vector(grn_ts_text_vector lhs, grn_ts_text_vector rhs) { GRN_TS_OP_GREATER_VECTOR(text) @@ -868,28 +868,28 @@ grn_ts_op_greater_text_vector(grn_ts_text_vector lhs, grn_ts_text_vector rhs) #undef GRN_TS_OP_GREATER_VECTOR /* grn_ts_op_greater_equal_int() returns lhs >= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_equal_int(grn_ts_int lhs, grn_ts_int rhs) { return lhs >= rhs; } /* grn_ts_op_greater_equal_float() returns lhs >= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_equal_float(grn_ts_float lhs, grn_ts_float rhs) { return lhs >= rhs; } /* grn_ts_op_greater_equal_time() returns lhs >= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_equal_time(grn_ts_time lhs, grn_ts_time rhs) { return lhs >= rhs; } /* grn_ts_op_greater_equal_text() returns lhs >= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_equal_text(grn_ts_text lhs, grn_ts_text rhs) { size_t min_size = (lhs.size < rhs.size) ? lhs.size : rhs.size; @@ -908,7 +908,7 @@ grn_ts_op_greater_equal_text(grn_ts_text lhs, grn_ts_text rhs) }\ return lhs.size >= rhs.size; /* grn_ts_op_greater_equal_int_vector() returns lhs >= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_equal_int_vector(grn_ts_int_vector lhs, grn_ts_int_vector rhs) { @@ -916,7 +916,7 @@ grn_ts_op_greater_equal_int_vector(grn_ts_int_vector lhs, } /* grn_ts_op_greater_equal_float_vector() returns lhs >= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_equal_float_vector(grn_ts_float_vector lhs, grn_ts_float_vector rhs) { @@ -924,7 +924,7 @@ grn_ts_op_greater_equal_float_vector(grn_ts_float_vector lhs, } /* grn_ts_op_greater_equal_time_vector() returns lhs >= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_equal_time_vector(grn_ts_time_vector lhs, grn_ts_time_vector rhs) { @@ -932,7 +932,7 @@ grn_ts_op_greater_equal_time_vector(grn_ts_time_vector lhs, } /* grn_ts_op_greater_equal_text_vector() returns lhs >= rhs. */ -inline static grn_ts_bool +grn_inline static grn_ts_bool grn_ts_op_greater_equal_text_vector(grn_ts_text_vector lhs, grn_ts_text_vector rhs) { @@ -941,34 +941,34 @@ grn_ts_op_greater_equal_text_vector(grn_ts_text_vector lhs, #undef GRN_TS_OP_GREATER_EQUAL_VECTOR /* grn_ts_op_shift_arithmetic_left() returns lhs << rhs. */ -inline static grn_ts_int +grn_inline static grn_ts_int grn_ts_op_shift_arithmetic_left(grn_ts_int lhs, grn_ts_int rhs) { return lhs << rhs; } /* grn_ts_op_shift_arithmetic_right() returns lhs << rhs. */ -inline static grn_ts_int +grn_inline static grn_ts_int grn_ts_op_shift_arithmetic_right(grn_ts_int lhs, grn_ts_int rhs) { return lhs >> rhs; } /* grn_ts_op_shift_logical_left() returns lhs << rhs. */ -inline static grn_ts_int +grn_inline static grn_ts_int grn_ts_op_shift_logical_left(grn_ts_int lhs, grn_ts_int rhs) { return lhs << rhs; } /* grn_ts_op_shift_logical_right() returns lhs << rhs. */ -inline static grn_ts_int +grn_inline static grn_ts_int grn_ts_op_shift_logical_right(grn_ts_int lhs, grn_ts_int rhs) { return (uint64_t)lhs >> rhs; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_plus_int_int(grn_ctx *ctx, grn_ts_int lhs, grn_ts_int rhs, grn_ts_int *out) { @@ -976,7 +976,7 @@ grn_ts_op_plus_int_int(grn_ctx *ctx, grn_ts_int lhs, grn_ts_int rhs, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_plus_float_float(grn_ctx *ctx, grn_ts_float lhs, grn_ts_float rhs, grn_ts_float *out) { @@ -987,7 +987,7 @@ grn_ts_op_plus_float_float(grn_ctx *ctx, grn_ts_float lhs, grn_ts_float rhs, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_plus_time_int(grn_ctx *ctx, grn_ts_time lhs, grn_ts_int rhs, grn_ts_time *out) { @@ -995,7 +995,7 @@ grn_ts_op_plus_time_int(grn_ctx *ctx, grn_ts_time lhs, grn_ts_int rhs, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_plus_time_float(grn_ctx *ctx, grn_ts_time lhs, grn_ts_float rhs, grn_ts_time *out) { @@ -1003,7 +1003,7 @@ grn_ts_op_plus_time_float(grn_ctx *ctx, grn_ts_time lhs, grn_ts_float rhs, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_minus_int_int(grn_ctx *ctx, grn_ts_int lhs, grn_ts_int rhs, grn_ts_int *out) { @@ -1011,7 +1011,7 @@ grn_ts_op_minus_int_int(grn_ctx *ctx, grn_ts_int lhs, grn_ts_int rhs, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_minus_float_float(grn_ctx *ctx, grn_ts_float lhs, grn_ts_float rhs, grn_ts_float *out) { @@ -1022,7 +1022,7 @@ grn_ts_op_minus_float_float(grn_ctx *ctx, grn_ts_float lhs, grn_ts_float rhs, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_minus_time_time(grn_ctx *ctx, grn_ts_time lhs, grn_ts_time rhs, grn_ts_float *out) { @@ -1030,7 +1030,7 @@ grn_ts_op_minus_time_time(grn_ctx *ctx, grn_ts_time lhs, grn_ts_time rhs, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_minus_time_int(grn_ctx *ctx, grn_ts_time lhs, grn_ts_int rhs, grn_ts_time *out) { @@ -1038,7 +1038,7 @@ grn_ts_op_minus_time_int(grn_ctx *ctx, grn_ts_time lhs, grn_ts_int rhs, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_minus_time_float(grn_ctx *ctx, grn_ts_time lhs, grn_ts_float rhs, grn_ts_time *out) { @@ -1046,7 +1046,7 @@ grn_ts_op_minus_time_float(grn_ctx *ctx, grn_ts_time lhs, grn_ts_float rhs, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_multiplication_int_int(grn_ctx *ctx, grn_ts_int lhs, grn_ts_int rhs, grn_ts_int *out) { @@ -1054,7 +1054,7 @@ grn_ts_op_multiplication_int_int(grn_ctx *ctx, grn_ts_int lhs, grn_ts_int rhs, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_multiplication_float_float(grn_ctx *ctx, grn_ts_float lhs, grn_ts_float rhs, grn_ts_float *out) { @@ -1065,7 +1065,7 @@ grn_ts_op_multiplication_float_float(grn_ctx *ctx, grn_ts_float lhs, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_division_int_int(grn_ctx *ctx, grn_ts_int lhs, grn_ts_int rhs, grn_ts_int *out) { @@ -1079,7 +1079,7 @@ grn_ts_op_division_int_int(grn_ctx *ctx, grn_ts_int lhs, grn_ts_int rhs, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_division_float_float(grn_ctx *ctx, grn_ts_float lhs, grn_ts_float rhs, grn_ts_float *out) { @@ -1090,7 +1090,7 @@ grn_ts_op_division_float_float(grn_ctx *ctx, grn_ts_float lhs, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_modulus_int_int(grn_ctx *ctx, grn_ts_int lhs, grn_ts_int rhs, grn_ts_int *out) { @@ -1104,7 +1104,7 @@ grn_ts_op_modulus_int_int(grn_ctx *ctx, grn_ts_int lhs, grn_ts_int rhs, return GRN_SUCCESS; } -inline static grn_rc +grn_inline static grn_rc grn_ts_op_modulus_float_float(grn_ctx *ctx, grn_ts_float lhs, grn_ts_float rhs, grn_ts_float *out) { Modified: lib/ts/ts_sorter.c (+6 -6) =================================================================== --- lib/ts/ts_sorter.c 2017-11-01 10:40:22 +0900 (6136afbcf) +++ lib/ts/ts_sorter.c 2017-11-01 10:55:22 +0900 (1210fbce7) @@ -114,7 +114,7 @@ grn_ts_sorter_node_sort(grn_ctx *ctx, grn_ts_sorter_node *node, grn_ts_record *recs, size_t n_recs); /* grn_ts_rec_swap() swaps records. */ -inline static void +grn_inline static void grn_ts_rec_swap(grn_ts_record *lhs, grn_ts_record *rhs) { grn_ts_record tmp = *lhs; @@ -123,7 +123,7 @@ grn_ts_rec_swap(grn_ts_record *lhs, grn_ts_record *rhs) } /* grn_ts_int_swap() swaps Int values. */ -inline static void +grn_inline static void grn_ts_int_swap(grn_ts_int *lhs, grn_ts_int *rhs) { grn_ts_int tmp = *lhs; @@ -1028,7 +1028,7 @@ grn_ts_qsort_by_int(grn_ctx *ctx, grn_ts_sorter_node *node, } /* grn_ts_text_cmp() compares Text values. */ -inline static int +grn_inline static int grn_ts_text_cmp(grn_ts_text lhs, grn_ts_text rhs) { size_t min_size = (lhs.size < rhs.size) ? lhs.size : rhs.size; @@ -1043,7 +1043,7 @@ grn_ts_text_cmp(grn_ts_text lhs, grn_ts_text rhs) } /* grn_ts_text_swap() swaps Text values. */ -inline static void +grn_inline static void grn_ts_text_swap(grn_ts_text *lhs, grn_ts_text *rhs) { grn_ts_text tmp = *lhs; @@ -1477,14 +1477,14 @@ grn_ts_qsort_by_text_desc(grn_ctx *ctx, grn_ts_sorter_node *node, } /* grn_ts_text_get_label() returns a label. */ -inline static int +grn_inline static int grn_ts_text_get_label(grn_ts_text val, size_t depth) { return (depth < val.size) ? (uint8_t)val.ptr[depth] : -1; } /* grn_ts_text_cmp2() compares Text values. */ -inline static int +grn_inline static int grn_ts_text_cmp2(grn_ts_text lhs, grn_ts_text rhs, size_t depth) { size_t min_size = (lhs.size < rhs.size) ? lhs.size : rhs.size; Modified: lib/window_function.c (+3 -3) =================================================================== --- lib/window_function.c 2017-11-01 10:40:22 +0900 (5ee182e62) +++ lib/window_function.c 2017-11-01 10:55:22 +0900 (43c5f26f3) @@ -150,14 +150,14 @@ grn_window_set_direction(grn_ctx *ctx, GRN_API_RETURN(GRN_SUCCESS); } -static inline void +static grn_inline void grn_window_reset(grn_ctx *ctx, grn_window *window) { GRN_BULK_REWIND(&(window->ids)); } -static inline void +static grn_inline void grn_window_add_record(grn_ctx *ctx, grn_window *window, grn_id record_id) @@ -165,7 +165,7 @@ grn_window_add_record(grn_ctx *ctx, GRN_RECORD_PUT(ctx, &(window->ids), record_id); } -static inline grn_bool +static grn_inline grn_bool grn_window_is_empty(grn_ctx *ctx, grn_window *window) { Modified: plugins/suggest/suggest.c (+1 -1) =================================================================== --- plugins/suggest/suggest.c 2017-11-01 10:40:22 +0900 (4dd5f6e62) +++ plugins/suggest/suggest.c 2017-11-01 10:55:22 +0900 (66e8cf111) @@ -266,7 +266,7 @@ output(grn_ctx *ctx, grn_obj *table, grn_obj *res, grn_id tid, } } -static inline void +static grn_inline void complete_add_item(grn_ctx *ctx, grn_id id, grn_obj *res, int frequency_threshold, grn_obj *items_freq, grn_obj *items_boost, grn_obj *item_freq, grn_obj *item_boost) Modified: plugins/tokenizers/mecab.c (+1 -1) =================================================================== --- plugins/tokenizers/mecab.c 2017-11-01 10:40:22 +0900 (eeb027acb) +++ plugins/tokenizers/mecab.c 2017-11-01 10:55:22 +0900 (297592ee7) @@ -91,7 +91,7 @@ get_mecab_encoding(mecab_t *mecab) return encoding; } -static inline grn_bool +static grn_inline grn_bool is_delimiter_character(grn_ctx *ctx, const char *character, int character_bytes) { switch (character_bytes) { Modified: src/groonga.c (+2 -2) =================================================================== --- src/groonga.c 2017-11-01 10:40:22 +0900 (974271217) +++ src/groonga.c 2017-11-01 10:55:22 +0900 (c1b5c0d68) @@ -230,7 +230,7 @@ line_editor_fgets(grn_ctx *ctx, grn_obj *buf) } #endif /* GRN_WITH_LIBEDIT */ -inline static grn_rc +grn_inline static grn_rc read_next_line(grn_ctx *ctx, grn_obj *buf) { static int the_first_read = GRN_TRUE; @@ -275,7 +275,7 @@ read_next_line(grn_ctx *ctx, grn_obj *buf) return rc; } -inline static grn_rc +grn_inline static grn_rc prompt(grn_ctx *ctx, grn_obj *buf) { grn_rc rc = GRN_SUCCESS;