Browse Source

typed arrays: fix sunos signed/unsigned char issue

The int8_t and uint8_t typedefs on sunos/smartos depend on a number of
compiler directives. Avoid ambiguity and specify signed and unsigned
char explicitly.

Fixes the following build error:

  ../src/stream_wrap.cc: In static member function 'static void*
  node::WriteWrap::operator new(size_t)':
  ../src/stream_wrap.cc:70:49: warning: no return statement in function
  returning non-void [-Wreturn-type]
  In file included from ../src/v8_typed_array.cc:26:0:
  ../src/v8_typed_array_bswap.h: In function 'T
  v8_typed_array::SwapBytes(T) [with T = signed char]':
  ../src/v8_typed_array_bswap.h:150:23:   instantiated from 'T
  v8_typed_array::LoadAndSwapBytes(void*) [with T = signed char]'
  ../src/v8_typed_array.cc:694:7:   instantiated from 'static
  v8::Handle<v8::Value> {anonymous}::DataView::getGeneric(const
  v8::Arguments&) [with T = signed char]'
  ../src/v8_typed_array.cc:738:40:   instantiated from here
  ../src/v8_typed_array_bswap.h:125:16: error: size of array is
  negative
v0.9.6-release
Ben Noordhuis 12 years ago
parent
commit
b509ae67b7
  1. 4
      src/v8_typed_array_bswap.h

4
src/v8_typed_array_bswap.h

@ -127,9 +127,9 @@ inline T SwapBytes(T x) {
} }
template <> template <>
inline uint8_t SwapBytes(uint8_t x) { return x; } inline signed char SwapBytes(signed char x) { return x; }
template <> template <>
inline int8_t SwapBytes(int8_t x) { return x; } inline unsigned char SwapBytes(unsigned char x) { return x; }
template <> template <>
inline uint16_t SwapBytes(uint16_t x) { return V8_TYPED_ARRAY_BSWAP16(x); } inline uint16_t SwapBytes(uint16_t x) { return V8_TYPED_ARRAY_BSWAP16(x); }
template <> template <>

Loading…
Cancel
Save