Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

1 casting error in v8plus_subr.cc

  • Loading branch information...
commit 66511b59a50d7471d343882c91847649eb4d8f02 1 parent 9219f27
@wesolows wesolows authored
View
4 Makefile.v8plus.defs
@@ -27,8 +27,8 @@ CPPFLAGS = $(STD_DEFS) $(NODE_DEFS) $(LF64_DEFS) $(PIC_DEFS) $(NODE_INCS)
CXXPPFLAGS = $(CPPFLAGS)
SHARED_FLAGS = -shared
-ZTEXT = -ztext
-ZDEFS = -zdefs
+ZTEXT = -Wl,-ztext
+ZDEFS = -Wl,-zdefs
NODE_LIBDIR = -L$(PREFIX_NODE)/lib
LDFLAGS = $(SHARED_FLAGS) $(ZTEXT) $(NODE_LIBDIR)
View
6 README.md
@@ -78,9 +78,11 @@ as their primitive types, not objects. If you need to return something
containing these object types, you cannot use v8+. Other data types
cannot be represented. If you need to return them, you cannot use v8+.
-The nvlist being returned must have one of two members: "res", an nvlist
+The nvlist being returned must have one of two members: "res", an nvpair
containing the result of the call to be returned, or "err", an nvlist
-containing members to be added to an exception.
+containing members to be added to an exception. You may return a value of
+any decodable type, and likewise may decorate an exception with properties
+of any decodable type.
For convenience, you may return v8plus_void() instead of an nvlist,
which indicates successful execution of a function that returns nothing.
View
6 examples/example.c
@@ -22,7 +22,7 @@ example_set_impl(example_t *ep, nvpair_t *pp)
(void) nvpair_value_double(pp, &dv);
if (dv > (1ULL << DBL_MANT_DIG) - 1) {
return (v8plus_error(V8PLUSERR_IMPRECISE,
- "translation of large number will lose precision"));
+ "large number lacks integer precision"));
}
ep->e_val = (uint64_t)dv;
break;
@@ -32,7 +32,7 @@ example_set_impl(example_t *ep, nvpair_t *pp)
v = (uint64_t)strtoull(sv, (char **)&ev, 0);
if (errno == ERANGE) {
return (v8plus_error(V8PLUSERR_RANGE,
- "value is out of range"));
+ "value '%s' is out of range", sv));
}
if (ev != NULL && *ev != '\0') {
return (v8plus_error(V8PLUSERR_MALFORMED,
@@ -148,7 +148,7 @@ example_toString(void *op, const nvlist_t *ap)
nvpair_t *pp;
nvlist_t *rp;
int err;
- char vbuf[16];
+ char vbuf[32];
if ((err = nvlist_alloc(&rp, NV_UNIQUE_NAME, 0)) != 0)
return (v8plus_nverr(err, NULL));
View
3  v8plus_subr.cc
@@ -300,8 +300,7 @@ sexception(const char *type, const nvlist_t *lp, const char *msg)
if (obj_hdl == NULL)
v8plus::panic("%s\n", dlerror());
- excp_ctor =
- reinterpret_cast<v8::Local<v8::Value>(*)(v8::Handle<v8::String>)>(
+ excp_ctor = (v8::Local<v8::Value>(*)(v8::Handle<v8::String>))(
dlsym(obj_hdl, ctor_name));
if (excp_ctor == NULL) {
Please sign in to comment.
Something went wrong with that request. Please try again.