fix a few more MSVC issues and reduce warnings

This commit is contained in:
Axel Kohlmeyer
2021-10-07 14:37:37 -04:00
parent 2c7b67203a
commit 2b27af1572
4 changed files with 14 additions and 14 deletions

7
.gitignore vendored
View File

@ -37,8 +37,8 @@ vgcore.*
.Trashes .Trashes
ehthumbs.db ehthumbs.db
Thumbs.db Thumbs.db
.clang-format
.lammps_history .lammps_history
.vs
#cmake #cmake
/build* /build*
@ -49,3 +49,8 @@ Thumbs.db
/Testing /Testing
/cmake_install.cmake /cmake_install.cmake
/lmp /lmp
out/Debug
out/RelWithDebInfo
out/Release
out/x86
out/x64

View File

@ -59,7 +59,7 @@ extern "C" {
typedef int bool_t; typedef int bool_t;
#if defined(__MINGW32__) || defined(__APPLE__) || defined(__FreeBSD__) || \ #if defined(_WIN32) || defined(__APPLE__) || defined(__FreeBSD__) || \
defined(__DragonFly__) || defined(__OpenBSD__) || defined(__NetBSD__) defined(__DragonFly__) || defined(__OpenBSD__) || defined(__NetBSD__)
typedef char *caddr_t; typedef char *caddr_t;
typedef unsigned int u_int; typedef unsigned int u_int;

View File

@ -500,8 +500,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename)
nelemtmp = words.next_int(); nelemtmp = words.next_int();
ncoeffall = words.next_int(); ncoeffall = words.next_int();
} catch (TokenizerException &e) { } catch (TokenizerException &e) {
error->all(FLERR,"Incorrect format in SNAP coefficient " error->all(FLERR,"Incorrect format in SNAP coefficient file: {}", e.what());
"file: {}", e.what());
} }
// clean out old arrays and set up element lists // clean out old arrays and set up element lists
@ -538,7 +537,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename)
std::vector<std::string> words; std::vector<std::string> words;
try { try {
words = Tokenizer(utils::trim_comment(line),"\"' \t\n\r\f").as_vector(); words = Tokenizer(utils::trim_comment(line),"\"' \t\n\r\f").as_vector();
} catch (TokenizerException &e) { } catch (TokenizerException &) {
// ignore // ignore
} }
if (words.size() != 3) if (words.size() != 3)
@ -599,8 +598,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename)
coeffelem[jelem][icoeff] = coeff.next_double(); coeffelem[jelem][icoeff] = coeff.next_double();
} catch (TokenizerException &e) { } catch (TokenizerException &e) {
error->all(FLERR,"Incorrect format in SNAP coefficient " error->all(FLERR,"Incorrect format in SNAP coefficient file: {}", e.what());
"file: {}", e.what());
} }
} }
} }
@ -609,8 +607,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename)
for (int jelem = 0; jelem < nelements; jelem++) { for (int jelem = 0; jelem < nelements; jelem++) {
if (elementflags[jelem] == 0) if (elementflags[jelem] == 0)
error->all(FLERR,"Element {} not found in SNAP coefficient " error->all(FLERR,"Element {} not found in SNAP coefficient file", elements[jelem]);
"file", elements[jelem]);
} }
delete[] elementflags; delete[] elementflags;
@ -660,7 +657,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename)
std::vector<std::string> words; std::vector<std::string> words;
try { try {
words = Tokenizer(utils::trim_comment(line),"\"' \t\n\r\f").as_vector(); words = Tokenizer(utils::trim_comment(line),"\"' \t\n\r\f").as_vector();
} catch (TokenizerException &e) { } catch (TokenizerException &) {
// ignore // ignore
} }

View File

@ -27,8 +27,6 @@
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <cstdlib> #include <cstdlib>
#include <cctype>
#include <strings.h> // for strcasecmp()
#if vmdplugin_ABIVERSION < 16 #if vmdplugin_ABIVERSION < 16
#error "unsupported VMD molfile plugin ABI version" #error "unsupported VMD molfile plugin ABI version"
@ -249,7 +247,7 @@ int MolfileInterface::find_plugin(const char *pluginpath)
int MolfileInterface::load_plugin(const char *filename) int MolfileInterface::load_plugin(const char *filename)
{ {
void *dso; void *dso;
int len, retval = E_NONE; int retval = E_NONE;
// access shared object // access shared object
dso = platform::dlopen(filename); dso = platform::dlopen(filename);