Ticket #21611: patch-preproc.c.diff
File patch-preproc.c.diff, 3.4 KB (added by mjhsieh@…, 15 years ago) |
---|
-
preproc.c
old new 3205 3205 goto bin; 3206 3206 3207 3207 nline++; 3208 if (sscanf(line,"%5 d",&ntun)!=1)3208 if (sscanf(line,"%5ld",&ntun)!=1) 3209 3209 goto bin; 3210 3210 3211 3211 if (ntun<1 || ntun>3) goto bin; … … 3219 3219 goto bin; 3220 3220 3221 3221 nline++; 3222 if (sscanf(line,"%5 d",&nratt)!=1) /* # of atom types */3222 if (sscanf(line,"%5ld",&nratt)!=1) /* # of atom types */ 3223 3223 3224 3224 goto bin; 3225 3225 … … 3269 3269 if (fgets(line,120,filep)==NULL) 3270 3270 goto err1; 3271 3271 3272 if (sscanf(line,"%5 d",&nraa2)!=1) /* Number of residues */3272 if (sscanf(line,"%5ld",&nraa2)!=1) /* Number of residues */ 3273 3273 3274 3274 goto err1; 3275 3275 … … 3293 3293 3294 3294 if (fgets(line,120,filep)==NULL) 3295 3295 goto err1; 3296 if (sscanf(line,"%5 d",&nrp)!=1)3296 if (sscanf(line,"%5ld",&nrp)!=1) 3297 3297 goto err1; 3298 3298 3299 3299 if (nrp<1 || nrp>MAXATM) … … 3347 3347 /* Skip over the nbty - BUG: Comment what is nbty??? */ 3348 3348 3349 3349 3350 if (sscanf(line,"%5 d",&nbty)!=1)3350 if (sscanf(line,"%5ld",&nbty)!=1) 3351 3351 goto err1; 3352 3352 3353 3353 n = (nbty+3)/4; … … 3365 3365 goto err1; 3366 3366 /* Read about bonds involving hydrogen */ 3367 3367 3368 if (sscanf(line,"%5 d",&nbonh)!=1)3368 if (sscanf(line,"%5ld",&nbonh)!=1) 3369 3369 goto err1; 3370 3370 3371 3371 for (k=0;k<nbonh;k++) … … 3375 3375 if (fgets(line,120,filep)==NULL) 3376 3376 goto err1; 3377 3377 3378 if (sscanf(line,"%5 d%5d",&ibond[k][0],&ibond[k][1])!=2)3378 if (sscanf(line,"%5ld%5ld",&ibond[k][0],&ibond[k][1])!=2) 3379 3379 goto err1; 3380 3380 } 3381 3381 … … 3390 3390 3391 3391 /* seem to throw around bonds involving H */ 3392 3392 3393 if (sscanf(line,"%5 d",&nbond)!=1)3393 if (sscanf(line,"%5ld",&nbond)!=1) 3394 3394 goto err1; 3395 3395 3396 3396 { … … 3405 3405 if (fgets(line,120,filep)==NULL) 3406 3406 goto err1; 3407 3407 3408 if (sscanf(line,"%5 d%5d",&ibond[k][0],&ibond[k][1])!=2)3408 if (sscanf(line,"%5ld%5ld",&ibond[k][0],&ibond[k][1])!=2) 3409 3409 goto err1; 3410 3410 } 3411 3411 … … 3425 3425 3426 3426 3427 3427 filep = fopen_or_exit_if_error("bond.dat","w"); 3428 fprintf(filep,"%5 d %5d\n",nbonh,nbond);3428 fprintf(filep,"%5ld %5ld\n",nbonh,nbond); 3429 3429 for (k=0;k<nbonh+nbond+1;k++) 3430 3430 fprintf(filep,"%5d %5d %5d\n",ib[k][0],ib[k][1],ib[k][2]); 3431 3431 fclose_or_exit_if_error("bond.dat",filep); … … 3536 3536 goto write; 3537 3537 3538 3538 err1: 3539 printf("\n Error reading gromos formatted molecular topology file at line % d\n\n",nline);3539 printf("\n Error reading gromos formatted molecular topology file at line %ld\n\n",nline); 3540 3540 fclose(filep); 3541 3541 3542 3542 … … 3914 3914 bufptr = getuflong(buff,&nattyp,1); 3915 3915 if (nattyp>MAXATP) 3916 3916 { 3917 printf("\nError: (# of atom types) NATTYP=% d exceeds (Max # atom types) MAXATP=%d\n",nattyp,MAXATP);3917 printf("\nError: (# of atom types) NATTYP=%ld exceeds (Max # atom types) MAXATP=%d\n",nattyp,MAXATP); 3918 3918 exit(EXIT_FAILURE); 3919 3919 } 3920 3920 … … 3966 3966 bufptr = getuflong(bufptr,&natmov,1); 3967 3967 if (natmov>natom) 3968 3968 { 3969 printf("NATMOV=% d > NATOM=%d??\n\n",natmov,natom);3969 printf("NATMOV=%ld > NATOM=%ld??\n\n",natmov,natom); 3970 3970 exit(EXIT_FAILURE); 3971 3971 } 3972 3972 … … 4020 4020 getuflong(buff,&nbond,1); 4021 4021 if (nbond>MAXBND) 4022 4022 { 4023 printf("\nError: NBOND=% d exceeds MAXBND=%d\n\n",nbond,MAXBND);4023 printf("\nError: NBOND=%ld exceeds MAXBND=%d\n\n",nbond,MAXBND); 4024 4024 exit(EXIT_FAILURE); 4025 4025 } 4026 4026