[gjs/wip/xulrunner-1.9.3-rebase4: 7/16] xulrunner 1.9.3: Remove callers of JS_NewDoubleValue
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/xulrunner-1.9.3-rebase4: 7/16] xulrunner 1.9.3: Remove callers of JS_NewDoubleValue
- Date: Mon, 20 Sep 2010 22:26:22 +0000 (UTC)
commit 907214843fcaa8b6ea3131e2ea976e13018ba695
Author: Colin Walters <walters verbum org>
Date: Thu Sep 16 14:54:55 2010 -0400
xulrunner 1.9.3: Remove callers of JS_NewDoubleValue
This function isn't intended for normal numeric conversions: see
https://developer.mozilla.org/en/JS_NewNumberValue
gi/arg.c | 4 ++--
gjs/byteArray.c | 2 +-
modules/dbus-values.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gi/arg.c b/gi/arg.c
index c91199e..c17a2b9 100644
--- a/gi/arg.c
+++ b/gi/arg.c
@@ -1642,10 +1642,10 @@ gjs_value_from_g_argument (JSContext *context,
return JS_NewNumberValue(context, arg->v_int8, value_p);
case GI_TYPE_TAG_FLOAT:
- return JS_NewDoubleValue(context, arg->v_float, value_p);
+ return JS_NewNumberValue(context, arg->v_float, value_p);
case GI_TYPE_TAG_DOUBLE:
- return JS_NewDoubleValue(context, arg->v_double, value_p);
+ return JS_NewNumberValue(context, arg->v_double, value_p);
case GI_TYPE_TAG_FILENAME:
if (arg->v_pointer)
diff --git a/gjs/byteArray.c b/gjs/byteArray.c
index 13ef2f3..d0157e9 100644
--- a/gjs/byteArray.c
+++ b/gjs/byteArray.c
@@ -98,7 +98,7 @@ gjs_value_from_gsize(JSContext *context,
*value_p = INT_TO_JSVAL(v);
return JS_TRUE;
} else {
- return JS_NewDoubleValue(context, v, value_p);
+ return JS_NewNumberValue(context, v, value_p);
}
}
diff --git a/modules/dbus-values.c b/modules/dbus-values.c
index 6d77767..ec8145a 100644
--- a/modules/dbus-values.c
+++ b/modules/dbus-values.c
@@ -257,7 +257,7 @@ gjs_js_one_value_from_dbus(JSContext *context,
{
double v_DOUBLE;
dbus_message_iter_get_basic(iter, &v_DOUBLE);
- if (!JS_NewDoubleValue(context, v_DOUBLE, value_p))
+ if (!JS_NewNumberValue(context, v_DOUBLE, value_p))
return JS_FALSE;
}
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]