- Notifications
You must be signed in to change notification settings - Fork 5
Description
As pointed out in a closed issue, compiling for electron using:
node-gyp rebuild --target=3.0.6 --arch=x64 --dist-url=https://atom.io/download/electron
causes many C4244 warnings.
These seem benign, as the compiler does implicit type conversions.
I nevertheless suppressed these warnings by using casts in the code for node-stringbuilder.c
eg: buffer[resultListLength++] = (uint32_t)starePointer + 1; // approx line 73
buffer[resultListLength++] = (uint32_t)starePointer + 1; // approx line 133
buffer[resultListLength++] = (uint32_t)sourcePointer + 1; // approx line 250
int64_t log2Floor(int64_t n) {return (int64_t) (floor(log2((double)n))); // approx line 488
int64_t addedLength = (int64_t) pow((double)2, (double)(i - 1)) * contentBufferLength; // 848
int64_t realAddedCount = (int64_t)pow((double)2, (double)log2Count); // approx 851
int64_t addedLength = (int64_t)pow((double)2,(double)( i - 1)) * originalLength; // approx 1188
int64_t realAddedCount = (int64_t)pow((double)2, (double)log2Count); // approx 1191
But these explicit casts are probably not necessary, and whether they'd impact on performance anyway I'm not sure.