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

@@ -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;
}
}