Ticket #21611: patch-preproc.c.diff

File patch-preproc.c.diff, 3.4 KB (added by mjhsieh@…, 15 years ago)
  • preproc.c

    old new  
    32053205      goto bin;
    32063206
    32073207   nline++;
    3208    if (sscanf(line,"%5d",&ntun)!=1)
     3208   if (sscanf(line,"%5ld",&ntun)!=1)
    32093209      goto bin;
    32103210
    32113211   if (ntun<1 || ntun>3)  goto bin;
     
    32193219      goto bin;
    32203220
    32213221   nline++;
    3222    if (sscanf(line,"%5d",&nratt)!=1) /* # of atom types */
     3222   if (sscanf(line,"%5ld",&nratt)!=1) /* # of atom types */
    32233223
    32243224      goto bin;
    32253225
     
    32693269   if (fgets(line,120,filep)==NULL)
    32703270      goto err1;
    32713271
    3272    if (sscanf(line,"%5d",&nraa2)!=1) /* Number of residues */
     3272   if (sscanf(line,"%5ld",&nraa2)!=1) /* Number of residues */
    32733273
    32743274      goto err1;
    32753275
     
    32933293
    32943294   if (fgets(line,120,filep)==NULL)
    32953295      goto err1;
    3296    if (sscanf(line,"%5d",&nrp)!=1)
     3296   if (sscanf(line,"%5ld",&nrp)!=1)
    32973297      goto err1;
    32983298
    32993299   if (nrp<1 || nrp>MAXATM)
     
    33473347   /* Skip over the nbty - BUG: Comment what is nbty??? */
    33483348
    33493349
    3350    if (sscanf(line,"%5d",&nbty)!=1)
     3350   if (sscanf(line,"%5ld",&nbty)!=1)
    33513351      goto err1;
    33523352
    33533353   n = (nbty+3)/4;
     
    33653365      goto err1;
    33663366   /* Read about bonds involving hydrogen */
    33673367
    3368    if (sscanf(line,"%5d",&nbonh)!=1)
     3368   if (sscanf(line,"%5ld",&nbonh)!=1)
    33693369      goto err1;
    33703370
    33713371   for (k=0;k<nbonh;k++)
     
    33753375      if (fgets(line,120,filep)==NULL)
    33763376         goto err1;
    33773377
    3378       if (sscanf(line,"%5d%5d",&ibond[k][0],&ibond[k][1])!=2)
     3378      if (sscanf(line,"%5ld%5ld",&ibond[k][0],&ibond[k][1])!=2)
    33793379         goto err1;
    33803380      }
    33813381
     
    33903390
    33913391   /* seem to throw around bonds involving H */
    33923392
    3393    if (sscanf(line,"%5d",&nbond)!=1)
     3393   if (sscanf(line,"%5ld",&nbond)!=1)
    33943394      goto err1;
    33953395
    33963396   {
     
    34053405      if (fgets(line,120,filep)==NULL)
    34063406         goto err1;
    34073407
    3408       if (sscanf(line,"%5d%5d",&ibond[k][0],&ibond[k][1])!=2)
     3408      if (sscanf(line,"%5ld%5ld",&ibond[k][0],&ibond[k][1])!=2)
    34093409         goto err1;
    34103410      }
    34113411
     
    34253425
    34263426
    34273427   filep = fopen_or_exit_if_error("bond.dat","w");
    3428    fprintf(filep,"%5d %5d\n",nbonh,nbond);
     3428   fprintf(filep,"%5ld %5ld\n",nbonh,nbond);
    34293429   for (k=0;k<nbonh+nbond+1;k++)
    34303430      fprintf(filep,"%5d %5d %5d\n",ib[k][0],ib[k][1],ib[k][2]);
    34313431   fclose_or_exit_if_error("bond.dat",filep);
     
    35363536  goto write;
    35373537
    35383538err1:
    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);
    35403540  fclose(filep);
    35413541
    35423542
     
    39143914   bufptr = getuflong(buff,&nattyp,1);
    39153915   if (nattyp>MAXATP)
    39163916      {
    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);
    39183918      exit(EXIT_FAILURE);
    39193919      }
    39203920
     
    39663966   bufptr = getuflong(bufptr,&natmov,1);
    39673967   if (natmov>natom)
    39683968      {
    3969       printf("NATMOV=%d > NATOM=%d??\n\n",natmov,natom);
     3969      printf("NATMOV=%ld > NATOM=%ld??\n\n",natmov,natom);
    39703970      exit(EXIT_FAILURE);
    39713971      }
    39723972
     
    40204020   getuflong(buff,&nbond,1);
    40214021   if (nbond>MAXBND)
    40224022      {
    4023       printf("\nError:  NBOND=%d exceeds MAXBND=%d\n\n",nbond,MAXBND);
     4023      printf("\nError:  NBOND=%ld exceeds MAXBND=%d\n\n",nbond,MAXBND);
    40244024      exit(EXIT_FAILURE);
    40254025      }
    40264026