Skip to content
This repository has been archived by the owner on Aug 18, 2018. It is now read-only.

Commit

Permalink
Deal with a couple of minor warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewd committed Apr 21, 2008
1 parent da692fa commit dc42336
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions ext/spidermonkey/conversions.c
@@ -1,6 +1,7 @@
#include "conversions.h"
#include "js_land_proxy.h"
#include "ruby_land_proxy.h"
#include "error.h"

static JSBool convert_float_or_bignum_to_js(OurContext* context, VALUE float_or_bignum, jsval* retval)
{
Expand Down
6 changes: 3 additions & 3 deletions ext/spidermonkey/js_land_proxy.c
@@ -1,4 +1,5 @@
#include "js_land_proxy.h"
#include "conversions.h"

static JSBool get(JSContext* js_context, JSObject* obj, jsval id, jsval* retval);
static JSBool set(JSContext* context, JSObject* obj, jsval id, jsval* retval);
Expand Down Expand Up @@ -91,7 +92,8 @@ static JSBool attribute_p(VALUE self, char* name)

static JSBool indexable_p(VALUE self)
{
rb_funcall(self, rb_intern("respond_to?"), 1, ID2SYM(rb_intern("[]")));
VALUE v = rb_funcall(self, rb_intern("respond_to?"), 1, ID2SYM(rb_intern("[]")));
return RTEST(v) ? JS_TRUE : JS_FALSE;
}

static JSBool has_key_p(VALUE self, char* name)
Expand All @@ -110,7 +112,6 @@ static JSBool respond_to_p(JSContext* js_context, JSObject* obj, char* name)
Data_Get_Struct(ruby_context, OurContext, context);

VALUE self;
VALUE symbol = ID2SYM(rb_intern(name));

assert(self = (VALUE)JS_GetInstancePrivate(
context->js, obj, JS_GET_CLASS(context->js, obj), NULL));
Expand Down Expand Up @@ -204,7 +205,6 @@ static JSBool get(JSContext* js_context, JSObject* obj, jsval id, jsval* retval)

else if (attribute_p(self, name))
{
VALUE method = rb_funcall(self, rb_intern("method"), 1, ID2SYM(ruby_id));
return convert_to_js(context, rb_funcall(self, ruby_id, 0), retval);
}

Expand Down
2 changes: 2 additions & 0 deletions ext/spidermonkey/ruby_land_proxy.c
@@ -1,4 +1,6 @@
#include "ruby_land_proxy.h"
#include "conversions.h"
#include "error.h"

static VALUE proxy_class = Qnil;

Expand Down
1 change: 1 addition & 0 deletions ext/spidermonkey/ruby_land_proxy.h
Expand Up @@ -12,5 +12,6 @@ typedef struct {
JSBool ruby_value_is_proxy(VALUE maybe_proxy);
JSBool unwrap_ruby_land_proxy(OurContext* context, VALUE proxy, jsval* retval);
VALUE make_ruby_land_proxy(OurContext* context, jsval value);
void init_Johnson_SpiderMonkey_Proxy(VALUE spidermonkey);

#endif

0 comments on commit dc42336

Please sign in to comment.