modernize

This commit is contained in:
Axel Kohlmeyer
2021-09-16 01:00:43 -04:00
parent ef8a0e5005
commit 1fd25071b9
3 changed files with 11 additions and 11 deletions

View File

@ -413,8 +413,8 @@ typedef struct {
int sd; /* socket file descriptor */ int sd; /* socket file descriptor */
} imdsocket; } imdsocket;
static int imdsock_init(void); static int imdsock_init();
static void *imdsock_create(void); static void *imdsock_create();
static int imdsock_bind(void *, int); static int imdsock_bind(void *, int);
static int imdsock_listen(void *); static int imdsock_listen(void *);
static void *imdsock_accept(void *); /* return new socket */ static void *imdsock_accept(void *); /* return new socket */
@ -1160,7 +1160,7 @@ void FixIMD::post_force_respa(int vflag, int ilevel, int /*iloop*/)
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
/* local memory usage. approximately. */ /* local memory usage. approximately. */
double FixIMD::memory_usage(void) double FixIMD::memory_usage()
{ {
return static_cast<double>(num_coords+maxbuf+imd_forces)*size_one; return static_cast<double>(num_coords+maxbuf+imd_forces)*size_one;
} }
@ -1178,7 +1178,7 @@ double FixIMD::memory_usage(void)
* Socket interface, abstracts machine dependent APIs/routines. * Socket interface, abstracts machine dependent APIs/routines.
***************************************************************************/ ***************************************************************************/
int imdsock_init(void) { int imdsock_init() {
#if defined(_MSC_VER) || defined(__MINGW32__) #if defined(_MSC_VER) || defined(__MINGW32__)
int rc = 0; int rc = 0;
static int initialized=0; static int initialized=0;
@ -1197,7 +1197,7 @@ int imdsock_init(void) {
} }
void * imdsock_create(void) { void * imdsock_create() {
imdsocket * s; imdsocket * s;
s = (imdsocket *) malloc(sizeof(imdsocket)); s = (imdsocket *) malloc(sizeof(imdsocket));

View File

@ -359,11 +359,11 @@ void PairSRP::settings(int narg, char **arg)
} }
// settings // settings
midpoint = 0; midpoint = false;
min = 0; min = false;
if (strcmp(arg[2],"min") == 0) min = 1; if (strcmp(arg[2],"min") == 0) min = true;
else if (strcmp(arg[2],"mid") == 0) midpoint = 1; else if (strcmp(arg[2],"mid") == 0) midpoint = true;
else else
error->all(FLERR,"Illegal pair_style command"); error->all(FLERR,"Illegal pair_style command");

View File

@ -156,8 +156,8 @@ void MLIAPModelNN::read_coeffs(char *coefffilename)
memory->create(scale,nelements,2,ndescriptors,"mliap_model:scale"); memory->create(scale,nelements,2,ndescriptors,"mliap_model:scale");
for (int ilayer = 0; ilayer < nlayers; ilayer++) { for (int ilayer = 0; ilayer < nlayers; ilayer++) {
tstr = strtok(NULL,"' \t\n\r\f"); tstr = strtok(nullptr,"' \t\n\r\f");
nnodes[ilayer] = atoi(strtok(NULL,"' \t\n\r\f")); nnodes[ilayer] = atoi(strtok(nullptr,"' \t\n\r\f"));
if (strncmp(tstr, "linear", 6) == 0) activation[ilayer] = 0; if (strncmp(tstr, "linear", 6) == 0) activation[ilayer] = 0;
else if (strncmp(tstr, "sigmoid", 7) == 0) activation[ilayer] = 1; else if (strncmp(tstr, "sigmoid", 7) == 0) activation[ilayer] = 1;