Reel.Deel
4th February 2022, 00:08
Hello all,
I'm creating this thread in hopes of asking some newbie questions when compiling existing plugins in x64. There's still some plugins that are x86 only (and not written in assembly). I'm hoping to compile what I can and put it up on the wiki so that they're available to everyone. I've compiled a few plugins already for personal use, and they all work but sometimes I get some warnings and/or errors that I do not know how to fix.
For example ChannelMixer (http://avisynth.nl/index.php/ChannelMixer), it compiles and works but it shows 19 warnings in MSVC 2019.
warning C4244: '=': conversion from 'double' to 'int', possible loss of data (9 WARNINGS)
// Build look-up tables
for(i = 0; i < 256; i++) {
RR[i] = 0.01 * inRR * (float)i;
RG[i] = 0.01 * inRG * (float)i;
RB[i] = 0.01 * inRB * (float)i;
GR[i] = 0.01 * inGR * (float)i;
GG[i] = 0.01 * inGG * (float)i;
GB[i] = 0.01 * inGB * (float)i;
BR[i] = 0.01 * inBR * (float)i;
BG[i] = 0.01 * inBG * (float)i;
BB[i] = 0.01 * inBB * (float)i;
warning C4101: 'tmp': unreferenced local variable (1 WARNING)
int i, tmp;
warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data (9 WARNINGS)
// Calls the constructor with the arguments provied.
return new ChannelMixer(args[0].AsClip(), args[1].AsFloat(), args[2].AsFloat(), args[3].AsFloat(), args[4].AsFloat(), args[5].AsFloat(), args[6].AsFloat(), args[7].AsFloat(), args[8].AsFloat(), args[9].AsFloat(), env);
What is the proper way to get rid of these warnings? Also I read sometime ago that some warnings are harmless, is that the case here since the plugin works as intended?
I'm creating this thread in hopes of asking some newbie questions when compiling existing plugins in x64. There's still some plugins that are x86 only (and not written in assembly). I'm hoping to compile what I can and put it up on the wiki so that they're available to everyone. I've compiled a few plugins already for personal use, and they all work but sometimes I get some warnings and/or errors that I do not know how to fix.
For example ChannelMixer (http://avisynth.nl/index.php/ChannelMixer), it compiles and works but it shows 19 warnings in MSVC 2019.
warning C4244: '=': conversion from 'double' to 'int', possible loss of data (9 WARNINGS)
// Build look-up tables
for(i = 0; i < 256; i++) {
RR[i] = 0.01 * inRR * (float)i;
RG[i] = 0.01 * inRG * (float)i;
RB[i] = 0.01 * inRB * (float)i;
GR[i] = 0.01 * inGR * (float)i;
GG[i] = 0.01 * inGG * (float)i;
GB[i] = 0.01 * inGB * (float)i;
BR[i] = 0.01 * inBR * (float)i;
BG[i] = 0.01 * inBG * (float)i;
BB[i] = 0.01 * inBB * (float)i;
warning C4101: 'tmp': unreferenced local variable (1 WARNING)
int i, tmp;
warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data (9 WARNINGS)
// Calls the constructor with the arguments provied.
return new ChannelMixer(args[0].AsClip(), args[1].AsFloat(), args[2].AsFloat(), args[3].AsFloat(), args[4].AsFloat(), args[5].AsFloat(), args[6].AsFloat(), args[7].AsFloat(), args[8].AsFloat(), args[9].AsFloat(), env);
What is the proper way to get rid of these warnings? Also I read sometime ago that some warnings are harmless, is that the case here since the plugin works as intended?