Navigation Menu

Skip to content

Commit

Permalink
Remove unused QL related variable: ctx_impl.subbuf
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jun 16, 2014
1 parent 17faabc commit b8b8a43
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 26 deletions.
24 changes: 1 addition & 23 deletions lib/ctx.c
Expand Up @@ -495,11 +495,10 @@ grn_ctx_impl_init(grn_ctx *ctx)

ctx->impl->com = NULL;
ctx->impl->outbuf = grn_obj_open(ctx, GRN_BULK, 0, 0);
ctx->impl->output = NULL /* grn_ctx_concat_func */;
ctx->impl->output = NULL;
ctx->impl->data.ptr = NULL;
ctx->impl->tv.tv_sec = 0;
ctx->impl->tv.tv_nsec = 0;
GRN_TEXT_INIT(&ctx->impl->subbuf, 0);
ctx->impl->edge = NULL;
grn_loader_init(&ctx->impl->loader);
ctx->impl->plugin_path = NULL;
Expand Down Expand Up @@ -653,7 +652,6 @@ grn_ctx_fin(grn_ctx *ctx)
GRN_OBJ_FIN(ctx, &ctx->impl->names);
GRN_OBJ_FIN(ctx, &ctx->impl->levels);
rc = grn_obj_close(ctx, ctx->impl->outbuf);
rc = grn_bulk_fin(ctx, &ctx->impl->subbuf);
{
grn_hash **vp;
grn_obj *value;
Expand Down Expand Up @@ -1898,17 +1896,6 @@ grn_ctx_recv(grn_ctx *ctx, char **str, unsigned int *str_len, int *flags)
} else {
grn_obj *buf = ctx->impl->outbuf;
unsigned int head = 0, tail = GRN_BULK_VSIZE(buf);
/*
unsigned int *offsets = (unsigned int *) GRN_BULK_HEAD(&ctx->impl->subbuf);
int npackets = GRN_BULK_VSIZE(&ctx->impl->subbuf) / sizeof(unsigned int);
if (npackets < ctx->impl->bufcur) {
ERR(GRN_INVALID_ARGUMENT, "invalid argument");
goto exit;
}
head = ctx->impl->bufcur ? offsets[ctx->impl->bufcur - 1] : 0;
tail = ctx->impl->bufcur < npackets ? offsets[ctx->impl->bufcur] : GRN_BULK_VSIZE(buf);
*flags = ctx->impl->bufcur++ < npackets ? GRN_CTX_MORE : 0;
*/
*str = GRN_BULK_HEAD(buf) + head;
*str_len = tail - head;
GRN_BULK_REWIND(ctx->impl->outbuf);
Expand All @@ -1920,15 +1907,6 @@ exit :
GRN_API_RETURN(0);
}

void
grn_ctx_concat_func(grn_ctx *ctx, int flags, void *dummy)
{
if (ctx && ctx->impl && (flags & GRN_CTX_MORE)) {
unsigned int size = GRN_BULK_VSIZE(ctx->impl->outbuf);
grn_bulk_write(ctx, &ctx->impl->subbuf, (char *) &size, sizeof(unsigned int));
}
}

void
grn_ctx_stream_out_func(grn_ctx *ctx, int flags, void *stream)
{
Expand Down
3 changes: 1 addition & 2 deletions lib/ctx.h
@@ -1,6 +1,6 @@
/* -*- c-basic-offset: 2 -*- */
/*
Copyright(C) 2009-2013 Brazil
Copyright(C) 2009-2014 Brazil
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -496,7 +496,6 @@ void grn_cache_get_statistics(grn_ctx *ctx, grn_cache *cache,

/**** receive handler ****/

void grn_ctx_concat_func(grn_ctx *ctx, int flags, void *dummy);
GRN_API void grn_ctx_stream_out_func(grn_ctx *c, int flags, void *stream);

grn_rc grn_db_init_builtin_procs(grn_ctx *ctx);
Expand Down
1 change: 0 additions & 1 deletion lib/ctx_impl.h
Expand Up @@ -159,7 +159,6 @@ struct _grn_ctx_impl {
grn_array *values; /* temporary objects */
grn_hash *ios; /* IOs */
grn_obj *outbuf;
grn_obj subbuf;
unsigned int bufcur;
void (*output)(grn_ctx *, int, void *);
grn_com *com;
Expand Down

0 comments on commit b8b8a43

Please sign in to comment.