Skip to content
Browse files

generate less warnings on windows compilation

  • Loading branch information...
1 parent 0b4f361 commit 6b4c80c3bb62860533fcee4256120543bd3ab1b1 @rashfael rashfael committed Aug 28, 2012
Showing with 44 additions and 63 deletions.
  1. +0 −45 Makefile
  2. +18 −5 binding.gyp
  3. +18 −5 deps/msgpack/msgpack.gyp
  4. +1 −1 deps/msgpack/msgpack/pack_template.h
  5. +7 −7 src/msgpack.cc
View
45 Makefile
@@ -1,45 +0,0 @@
-OS = $(shell uname)
-CWD = $(shell pwd -P)
-NODE_WAF ?= node-waf
-NODE_SRC_DIR ?= $(HOME)/src/ry-node
-CFLAGS ?= -g -Wall
-CXXFLAGS ?= -g -Wall
-
-# We need to build position-independent code regardless of platform
-ifneq ($(OS),Darwin)
- CFLAGS += -fPIC
- CXXFLAGS += -fPIC
-endif
-
-# These variables are respected by waf if we export them
-export CFLAGS CXXFLAGS
-
-.PHONY: all msgpack tags
-
-all: msgpack
-
-msgpack: deps/msgpack/dist/lib/libmsgpack.a
- cd src && \
- $(NODE_WAF) configure && \
- $(NODE_WAF) build
-
-# Build the msgpack library
-deps/msgpack/dist/lib/libmsgpack.a:
- cd deps/msgpack && \
- mkdir -p dist && \
- ./configure --enable-static --disable-shared \
- --prefix=$(PWD)/deps/msgpack/dist && \
- make && \
- make install
-
-tags:
- rm -f tags
- find . -name '*.cc' -or -name '*.c' -or -name '*.cpp' -or -name '*.h' -or \
- -name '*.hpp' -or -name '*.cpp' | ctags -L - -a
- test -d $(NODE_SRC_DIR) && \
- find $(NODE_SRC_DIR) -name '*.cc' -or -name '*.c' -or -name '*.h' | \
- ctags -L - -a
-
-clean:
- cd deps/msgpack && (make distclean || true)
- rm -fr deps/msgpack/dist build
View
23 binding.gyp
@@ -29,11 +29,24 @@
}],
['OS=="win"', {
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'CompileAs': 2
- }
- }
+ 'configurations': {
+ 'Debug': {
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'CompileAs': '2',
+ 'ExceptionHandling': '1',
+ },
+ },
+ },
+ 'Release': {
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'CompileAs': '2',
+ 'ExceptionHandling': '1',
+ },
+ },
+ },
+ },
}]
]
},
View
23 deps/msgpack/msgpack.gyp
@@ -30,11 +30,24 @@
}],
['OS=="win"', {
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'CompileAs': 2
- }
- }
+ 'configurations': {
+ 'Debug': {
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'CompileAs': '2',
+ 'ExceptionHandling': '1',
+ },
+ },
+ },
+ 'Release': {
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'CompileAs': '2',
+ 'ExceptionHandling': '1',
+ },
+ },
+ },
+ },
}]
]
},
View
2 deps/msgpack/msgpack/pack_template.h
@@ -743,7 +743,7 @@ msgpack_pack_inline_func(_raw)(msgpack_pack_user x, size_t l)
msgpack_pack_inline_func(_raw_body)(msgpack_pack_user x, const void* b, size_t l)
{
- msgpack_pack_append_buffer(x, (const unsigned char*)b, l);
+ msgpack_pack_append_buffer(x, (const unsigned char*)b, static_cast<unsigned int>(l));
}
#undef msgpack_pack_inline_func
View
14 src/msgpack.cc
@@ -147,14 +147,14 @@ v8_to_msgpack(Handle<Value> v8obj, msgpack_object *mo, msgpack_zone *mz,
mo->via.dec = d;
} else if (d > 0) {
mo->type = MSGPACK_OBJECT_POSITIVE_INTEGER;
- mo->via.u64 = d;
+ mo->via.u64 = static_cast<uint64_t>(d);
} else {
mo->type = MSGPACK_OBJECT_NEGATIVE_INTEGER;
- mo->via.i64 = d;
+ mo->via.i64 = static_cast<int64_t>(d);
}
} else if (v8obj->IsString()) {
mo->type = MSGPACK_OBJECT_RAW;
- mo->via.raw.size = DecodeBytes(v8obj, UTF8);
+ mo->via.raw.size = static_cast<uint32_t>(DecodeBytes(v8obj, UTF8));
mo->via.raw.ptr = (char*) msgpack_zone_malloc(mz, mo->via.raw.size);
DecodeWrite((char*) mo->via.raw.ptr, mo->via.raw.size, v8obj, UTF8);
@@ -178,7 +178,7 @@ v8_to_msgpack(Handle<Value> v8obj, msgpack_object *mo, msgpack_zone *mz,
mo->type = MSGPACK_OBJECT_RAW;
- mo->via.raw.size = Buffer::Length(buf);
+ mo->via.raw.size = static_cast<uint32_t>(Buffer::Length(buf));
mo->via.raw.ptr = Buffer::Data(buf);
} else {
Local<Object> o = v8obj->ToObject();
@@ -216,10 +216,10 @@ msgpack_to_v8(msgpack_object *mo) {
False();
case MSGPACK_OBJECT_POSITIVE_INTEGER:
- return Integer::NewFromUnsigned(mo->via.u64);
+ return Integer::NewFromUnsigned(static_cast<uint32_t>(mo->via.u64));
case MSGPACK_OBJECT_NEGATIVE_INTEGER:
- return Integer::New(mo->via.i64);
+ return Integer::New(static_cast<int32_t>(mo->via.i64));
case MSGPACK_OBJECT_DOUBLE:
return Number::New(mo->via.dec);
@@ -324,7 +324,7 @@ unpack(const Arguments &args) {
try {
msgpack_unpack_template->GetFunction()->Set(
msgpack_bytes_remaining_symbol,
- Integer::New(Buffer::Length(buf) - off)
+ Integer::New(static_cast<int32_t>(Buffer::Length(buf) - off))
);
return scope.Close(msgpack_to_v8(&mo));
} catch (MsgpackException e) {

0 comments on commit 6b4c80c

Please sign in to comment.
Something went wrong with that request. Please try again.