"vscode:/vscode.git/clone" did not exist on "0abd720e69d7c93dd9bcd1eea0bf9da52488270c"
Commit e391509f authored by Michael Sherman's avatar Michael Sherman
Browse files

Fix some MSVC compiler warnings and a bug in the MSVC case for getDefaultPluginsDirectory().

parent bf2a390b
...@@ -199,15 +199,15 @@ vector<string> Platform::loadPluginsFromDirectory(string directory) { ...@@ -199,15 +199,15 @@ vector<string> Platform::loadPluginsFromDirectory(string directory) {
const string& Platform::getDefaultPluginsDirectory() { const string& Platform::getDefaultPluginsDirectory() {
char* dir = getenv("OPENMM_PLUGIN_DIR"); char* dir = getenv("OPENMM_PLUGIN_DIR");
static string directory;
#ifdef _MSC_VER #ifdef _MSC_VER
if (dir != NULL) if (dir != NULL)
return string(dir); return directory = dir;
dir = getenv("PROGRAMFILES"); dir = getenv("PROGRAMFILES");
if (dir == NULL) if (dir == NULL)
return "C:\\\\Program Files\\OpenMM\\lib\\plugins"; return directory = "C:\\\\Program Files\\OpenMM\\lib\\plugins";
return string(dir)+"\\OpenMM\\lib\\plugins"; return directory = (string(dir)+"\\OpenMM\\lib\\plugins");
#else #else
static string directory;
if (dir == NULL) if (dir == NULL)
directory = "/usr/local/openmm/lib/plugins"; directory = "/usr/local/openmm/lib/plugins";
directory = string(dir); directory = string(dir);
......
...@@ -310,16 +310,16 @@ void CudaCalcNonbondedForceKernel::initialize(const System& system, const Nonbon ...@@ -310,16 +310,16 @@ void CudaCalcNonbondedForceKernel::initialize(const System& system, const Nonbon
double my = boxVectors[1][1]/force.getCutoffDistance(); double my = boxVectors[1][1]/force.getCutoffDistance();
double mz = boxVectors[2][2]/force.getCutoffDistance(); double mz = boxVectors[2][2]/force.getCutoffDistance();
double pi = 3.1415926535897932385; double pi = 3.1415926535897932385;
int kmaxx = std::ceil(-(mx/pi)*std::log(ewaldErrorTol)); int kmaxx = (int)std::ceil(-(mx/pi)*std::log(ewaldErrorTol));
int kmaxy = std::ceil(-(my/pi)*std::log(ewaldErrorTol)); int kmaxy = (int)std::ceil(-(my/pi)*std::log(ewaldErrorTol));
int kmaxz = std::ceil(-(mz/pi)*std::log(ewaldErrorTol)); int kmaxz = (int)std::ceil(-(mz/pi)*std::log(ewaldErrorTol));
if (kmaxx%2 == 0) if (kmaxx%2 == 0)
kmaxx++; kmaxx++;
if (kmaxy%2 == 0) if (kmaxy%2 == 0)
kmaxy++; kmaxy++;
if (kmaxz%2 == 0) if (kmaxz%2 == 0)
kmaxz++; kmaxz++;
gpuSetEwaldParameters(gpu, alpha, kmaxx, kmaxy, kmaxz); gpuSetEwaldParameters(gpu, (float)alpha, kmaxx, kmaxy, kmaxz);
method = EWALD; method = EWALD;
} }
data.nonbondedMethod = method; data.nonbondedMethod = method;
...@@ -572,7 +572,7 @@ void CudaIntegrateVariableVerletStepKernel::execute(OpenMMContextImpl& context, ...@@ -572,7 +572,7 @@ void CudaIntegrateVariableVerletStepKernel::execute(OpenMMContextImpl& context,
gpuSetConstants(gpu); gpuSetConstants(gpu);
prevErrorTol = errorTol; prevErrorTol = errorTol;
} }
float maxStepSize = maxTime-data.time; float maxStepSize = (float)(maxTime-data.time);
kSelectVerletStepSize(gpu, maxStepSize); kSelectVerletStepSize(gpu, maxStepSize);
kVerletUpdatePart1(gpu); kVerletUpdatePart1(gpu);
kApplyFirstShake(gpu); kApplyFirstShake(gpu);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment