Commit 4f1e4aa2 authored by Eugene Kosov's avatar Eugene Kosov

fix clang warnings

parent 26c389b7
...@@ -1317,7 +1317,7 @@ char *ha_connect::GetRealString(PCSZ s) ...@@ -1317,7 +1317,7 @@ char *ha_connect::GetRealString(PCSZ s)
{ {
char *sv; char *sv;
if (IsPartitioned() && s && partname && *partname) { if (IsPartitioned() && s && *partname) {
sv= (char*)PlugSubAlloc(xp->g, NULL, 0); sv= (char*)PlugSubAlloc(xp->g, NULL, 0);
sprintf(sv, s, partname); sprintf(sv, s, partname);
PlugSubAlloc(xp->g, NULL, strlen(sv) + 1); PlugSubAlloc(xp->g, NULL, strlen(sv) + 1);
......
This diff is collapsed.
...@@ -89,12 +89,6 @@ grn_tiny_array_at_inline(grn_tiny_array *array, grn_id id) ...@@ -89,12 +89,6 @@ grn_tiny_array_at_inline(grn_tiny_array *array, grn_id id)
return id ? grn_tiny_array_put(array, id) : NULL; return id ? grn_tiny_array_put(array, id) : NULL;
} }
inline static void *
grn_tiny_array_next(grn_tiny_array *array)
{
return grn_tiny_array_put(array, array->max + 1);
}
void void
grn_tiny_array_init(grn_ctx *ctx, grn_tiny_array *array, grn_tiny_array_init(grn_ctx *ctx, grn_tiny_array *array,
uint16_t element_size, uint16_t flags) uint16_t element_size, uint16_t flags)
...@@ -202,15 +196,6 @@ grn_tiny_bitmap_put_byte(grn_tiny_bitmap *bitmap, grn_id bit_id) { ...@@ -202,15 +196,6 @@ grn_tiny_bitmap_put_byte(grn_tiny_bitmap *bitmap, grn_id bit_id) {
return (uint8_t *)*block + byte_id - offset; return (uint8_t *)*block + byte_id - offset;
} }
/* Requirements: bit_id != GRN_ID_NIL. */
/* Return value: 1/0 on success, -1 on failure. */
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);
return ptr ? ((*ptr >> (bit_id & 7)) & 1) : -1;
}
/* Requirements: bit_id != GRN_ID_NIL. */ /* Requirements: bit_id != GRN_ID_NIL. */
/* Return value: 1/0 on success, -1 on failure. */ /* Return value: 1/0 on success, -1 on failure. */
/* Note: A bitmap is extended if needed. */ /* Note: A bitmap is extended if needed. */
...@@ -309,18 +294,6 @@ grn_io_array_bit_off(grn_ctx *ctx, grn_io *io, ...@@ -309,18 +294,6 @@ grn_io_array_bit_off(grn_ctx *ctx, grn_io *io,
return ptr; return ptr;
} }
inline static void *
grn_io_array_bit_flip(grn_ctx *ctx, grn_io *io,
uint32_t segment_id, uint32_t offset)
{
uint8_t * const ptr = (uint8_t *)grn_io_array_at_inline(
ctx, io, segment_id, (offset >> 3) + 1, GRN_TABLE_ADD);
if (ptr) {
*ptr ^= 1 << (offset & 7);
}
return ptr;
}
/* grn_table_queue */ /* grn_table_queue */
static void static void
...@@ -1738,13 +1711,6 @@ get_value(grn_ctx *ctx, grn_hash *hash, entry_str *n) ...@@ -1738,13 +1711,6 @@ get_value(grn_ctx *ctx, grn_hash *hash, entry_str *n)
return grn_hash_entry_get_value(ctx, hash, (grn_hash_entry *)n); return grn_hash_entry_get_value(ctx, hash, (grn_hash_entry *)n);
} }
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 inline static int
match_key(grn_ctx *ctx, grn_hash *hash, entry_str *ee, uint32_t h, match_key(grn_ctx *ctx, grn_hash *hash, entry_str *ee, uint32_t h,
const char *key, unsigned int len) const char *key, unsigned int len)
......
...@@ -2194,23 +2194,6 @@ buffer_close(grn_ctx *ctx, grn_ii *ii, uint32_t pseg) ...@@ -2194,23 +2194,6 @@ buffer_close(grn_ctx *ctx, grn_ii *ii, uint32_t pseg)
return GRN_SUCCESS; return GRN_SUCCESS;
} }
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);
if ((pseg = buffer_open(ctx, ii, pos, NULL, b)) != GRN_II_PSEG_NOT_ASSIGNED) {
uint16_t nterms = (*b)->header.nterms - (*b)->header.nterms_void;
if (!((nterms < 4096 ||
(ii->header->total_chunk_size >> ((nterms >> 8) - 6))
> (*b)->header.chunk_size) &&
((*b)->header.buffer_free >= size + sizeof(buffer_term)))) {
buffer_close(ctx, ii, pseg);
return GRN_II_PSEG_NOT_ASSIGNED;
}
}
return pseg;
}
typedef struct { typedef struct {
uint32_t rid; uint32_t rid;
uint32_t sid; uint32_t sid;
......
...@@ -142,20 +142,6 @@ pat_get(grn_ctx *ctx, grn_pat *pat, grn_id id) ...@@ -142,20 +142,6 @@ pat_get(grn_ctx *ctx, grn_pat *pat, grn_id id)
return res; return res;
} }
inline static pat_node *
pat_node_new(grn_ctx *ctx, grn_pat *pat, grn_id *id)
{
uint32_t n = pat->header->curr_rec + 1;
pat_node *res;
if (n > GRN_ID_MAX) { return NULL; }
if ((res = pat_get(ctx, pat, n))) {
pat->header->curr_rec = n;
pat->header->n_entries++;
}
if (id) { *id = n; }
return res;
}
/* sis operation */ /* sis operation */
inline static sis_node * inline static sis_node *
......
...@@ -187,55 +187,6 @@ grn_ts_ref_zero(void) ...@@ -187,55 +187,6 @@ grn_ts_ref_zero(void)
return (grn_ts_ref){ 0, 0.0 }; return (grn_ts_ref){ 0, 0.0 };
} }
/* grn_ts_bool_vector_zero() returns a zero. */
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_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_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_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_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_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_ts_ref_vector_zero(void)
{
return (grn_ts_ref_vector){ NULL, 0 };
}
/* grn_ts_data_type_to_kind() returns a kind associated with a type. */ /* grn_ts_data_type_to_kind() returns a kind associated with a type. */
static grn_ts_data_kind static grn_ts_data_kind
grn_ts_data_type_to_kind(grn_ts_data_type type) grn_ts_data_type_to_kind(grn_ts_data_type type)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment