diff options
author | Aaron Jacobs <jacobsa@google.com> | 2012-10-23 16:43:51 +1100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-10-23 16:55:59 +0200 |
commit | 49f0f618a92bf27caad000545bc1f460574a7504 (patch) | |
tree | 04d3b5f4135add7e494a09eae2880bf74fb78b7a | |
parent | 9fa953d3e7a864cfce4a69f47cca27d21c124672 (diff) | |
download | node-49f0f618a92bf27caad000545bc1f460574a7504.tar.gz |
typed arrays: use `signed char` for signed int8s
The C standard allows plain `char` to be unsigned. The build environment
at Google trips this issue.
-rw-r--r-- | src/v8_typed_array.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/v8_typed_array.cc b/src/v8_typed_array.cc index 4a76f9705..d1437cdcd 100644 --- a/src/v8_typed_array.cc +++ b/src/v8_typed_array.cc @@ -497,7 +497,7 @@ v8::Handle<v8::Value> cTypeToValue(unsigned char val) { } template <> -v8::Handle<v8::Value> cTypeToValue(char val) { +v8::Handle<v8::Value> cTypeToValue(signed char val) { return v8::Integer::New(val); } @@ -543,7 +543,7 @@ unsigned char valueToCType(v8::Handle<v8::Value> value) { } template <> -char valueToCType(v8::Handle<v8::Value> value) { +signed char valueToCType(v8::Handle<v8::Value> value) { return value->Int32Value(); } @@ -758,7 +758,7 @@ class DataView { } static v8::Handle<v8::Value> getInt8(const v8::Arguments& args) { - return getGeneric<char>(args); + return getGeneric<signed char>(args); } static v8::Handle<v8::Value> getUint16(const v8::Arguments& args) { @@ -790,7 +790,7 @@ class DataView { } static v8::Handle<v8::Value> setInt8(const v8::Arguments& args) { - return setGeneric<char>(args); + return setGeneric<signed char>(args); } static v8::Handle<v8::Value> setUint16(const v8::Arguments& args) { |