Explicit cast of size_t to 32 bit integer

Ensures compilation with nan 1.5.0+
This commit is contained in:
Lovell Fuller 2015-01-15 15:16:01 +00:00
parent 850c2ecdd6
commit 065ce6454b
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sharp",
"version": "0.8.3",
"version": "0.8.4",
"author": "Lovell Fuller <npm@lovell.info>",
"contributors": [
"Pierre Inglebert <pierre.inglebert@gmail.com>",
@ -34,9 +34,9 @@
"vips"
],
"dependencies": {
"bluebird": "^2.3.11",
"bluebird": "^2.6.4",
"color": "^0.7.3",
"nan": "^1.4.1",
"nan": "^1.5.1",
"semver": "^4.1.0"
},
"devDependencies": {

View File

@ -725,13 +725,13 @@ class ResizeWorker : public NanAsyncWorker {
argv[1] = NanNewBufferHandle(static_cast<char*>(baton->bufferOut), baton->bufferOutLength);
g_free(baton->bufferOut);
// Add buffer size to info
info->Set(NanNew<String>("size"), NanNew<Integer>(baton->bufferOutLength));
info->Set(NanNew<String>("size"), NanNew<Uint32>(static_cast<uint32_t>(baton->bufferOutLength)));
argv[2] = info;
} else {
// Add file size to info
struct stat st;
g_stat(baton->output.c_str(), &st);
info->Set(NanNew<String>("size"), NanNew<Integer>(st.st_size));
info->Set(NanNew<String>("size"), NanNew<Uint32>(static_cast<uint32_t>(st.st_size)));
argv[1] = info;
}
}