Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update /ext/json/fbuffer/fbuffer.h These definitions is not used by rub... #113

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions ext/json/fbuffer/fbuffer.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#ifndef _FBUFFER_H_
#define _FBUFFER_H_

Expand Down Expand Up @@ -35,10 +34,7 @@ static FBuffer *fbuffer_alloc(unsigned long initial_length);
static void fbuffer_free(FBuffer *fb);
static void fbuffer_clear(FBuffer *fb);
static void fbuffer_append(FBuffer *fb, const char *newstr, unsigned long len);
static void fbuffer_append_long(FBuffer *fb, long number);
static void fbuffer_append_char(FBuffer *fb, char newchr);
static FBuffer *fbuffer_dup(FBuffer *fb);
static VALUE fbuffer_to_s(FBuffer *fb);

static FBuffer *fbuffer_alloc(unsigned long initial_length)
{
Expand Down Expand Up @@ -87,16 +83,6 @@ static void fbuffer_append(FBuffer *fb, const char *newstr, unsigned long len)
}
}

static void fbuffer_append_str(FBuffer *fb, VALUE str)
{
const char *newstr = StringValuePtr(str);
unsigned long len = RSTRING_LEN(str);

RB_GC_GUARD(str);

fbuffer_append(fb, newstr, len);
}

static void fbuffer_append_char(FBuffer *fb, char newchr)
{
fbuffer_inc_capa(fb, 1);
Expand Down Expand Up @@ -126,31 +112,4 @@ static long fltoa(long number, char *buf)
return tmp - buf;
}

static void fbuffer_append_long(FBuffer *fb, long number)
{
char buf[20];
unsigned long len = fltoa(number, buf);
fbuffer_append(fb, buf, len);
}

static FBuffer *fbuffer_dup(FBuffer *fb)
{
unsigned long len = fb->len;
FBuffer *result;

assert(len > 0);
if (len > 0) {
result = fbuffer_alloc(len);
fbuffer_append(result, FBUFFER_PAIR(fb));
}
return result;
}

static VALUE fbuffer_to_s(FBuffer *fb)
{
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
fbuffer_free(fb);
FORCE_UTF8(result);
return result;
}
#endif