Changeset 687

Show
Ignore:
Timestamp:
10/27/09 12:59:41 (4 weeks ago)
Author:
robl
Message:

cleaned up a bunch of warnings

Location:
trunk/src
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/header.c

    r668 r687  
    11201120  NCtype type = NC_UNSPECIFIED; 
    11211121  NC_var **vpp, **end; 
    1122   int i; 
    11231122 
    11241123  assert(gbp != NULL && gbp->pos != NULL); 
  • trunk/src/lib/mpinetcdf.c

    r682 r687  
    6363static int check_recsize_too_big(NC *ncp); 
    6464 
     65static int ncmpi_coll_wait(NCMPI_Request request); 
     66static int ncmpi_coll_waitall(int count, NCMPI_Request array_of_requests[]); 
     67 
    6568/* Begin Of Dataset Functions */ 
    6669 
     
    303306ncmpi_enddef(int ncid) { 
    304307  int status = NC_NOERR; 
    305   int errcheck = 0; 
    306   int errflag = 0; 
    307308  NC *ncp; 
    308309 
     
    310311  if(status != NC_NOERR) 
    311312    return status; 
    312  
    313313 
    314314  if(!NC_indef(ncp)) 
     
    834834static int check_recsize_too_big(NC *ncp)  
    835835{ 
     836    int ret = NC_NOERR; 
    836837    /* assertion: because recsize will be used to set up the file 
    837838     * view, we must ensure there is no overflow when specifying 
     
    843844    if (ncp->recsize != (MPI_Aint)ncp->recsize) { 
    844845            fprintf(stderr, "Type overflow: unable to read/write multiple records in this dataset\non this platform. Please either access records of this record variable\none-at-a-time or run on a 64 bit platform\n"); 
     846            ret = NC_ESMALL; 
    845847    } 
    846848    /* the assert here might harsh, but without it, users will get corrupt 
    847849     * data.  */ 
    848850    assert (ncp->recsize == (MPI_Aint)ncp->recsize); 
     851    return ret; 
    849852} 
    850853 
     
    83038306  } 
    83048307  } else { 
    8305     ncmpi_coll_wait(request);  
     8308    return (ncmpi_coll_wait(*request)); 
    83068309  } 
    83078310} 
     
    83338336    } 
    83348337  } else { 
    8335     ncmpi_coll_waitall(count, array_of_requests);  
     8338    return (ncmpi_coll_waitall(count, array_of_requests)); 
    83368339  } 
    83378340} 
     
    1248012483  return NC_NOERR; 
    1248112484} 
    12482 int 
     12485 
     12486static int 
    1248312487ncmpi_put_mvara_all_nonrecord(int ncid, int nvars, int varid[], 
    1248412488                   MPI_Offset *start[], MPI_Offset *count[], 
     
    1248912493  NC *ncp; 
    1249012494  void **xbuf = NULL, **cbuf = NULL; 
    12491   char *temp_xbuf = NULL; 
    12492   void *t_xbuf = NULL; 
    1249312495  int status = NC_NOERR, warning = NC_NOERR; 
    1249412496  int dim; 
     
    1290912911  return ((warning != NC_NOERR) ? warning : status); 
    1291012912} 
    12911 int 
     12913 
     12914static int 
    1291212915ncmpi_put_mvara_all_record(int ncid, int nvars, int varid[], 
    1291312916                   MPI_Offset *start[], MPI_Offset *count[], 
     
    1291812921  NC *ncp; 
    1291912922  void **xbuf = NULL, **cbuf = NULL; 
    12920   char *temp_xbuf = NULL; 
    12921   void *t_xbuf = NULL; 
    1292212923  int status = NC_NOERR, warning = NC_NOERR; 
    1292312924  int dim; 
     
    1316213163  NC_var *varp; 
    1316313164  NC *ncp; 
    13164   void **xbuf = NULL, **cbuf = NULL; 
    13165   char *temp_xbuf = NULL; 
    13166   void *t_xbuf = NULL; 
    13167   int status = NC_NOERR, warning = NC_NOERR; 
    13168   int dim; 
    13169   int *nelems, *cnelems, *el_size, *nbytes; 
    13170   int total_nbytes; 
    13171   MPI_Status mpistatus; 
    13172   MPI_Comm comm; 
    13173   int mpireturn; 
    13174   MPI_Datatype *ptype; 
    13175   MPI_Datatype buf_type; 
    13176   int isderived, *iscontig_of_ptypes; 
    13177   int i; 
    13178   MPI_Aint *displacement, a0, ai; 
    13179   int size; 
     13165  int status = NC_NOERR; 
    1318013166 
    1318113167  status = ncmpii_NC_check_id(ncid, &ncp); 
     
    1318713173 
    1318813174 if (IS_RECVAR(varp)) 
    13189   ncmpi_put_mvara_all_record(ncid, nvars, varid, start, count, buf, bufcount, datatype); 
     13175  status = ncmpi_put_mvara_all_record(ncid, nvars, varid, start, count, buf, bufcount, datatype); 
    1319013176 else  
    13191   ncmpi_put_mvara_all_nonrecord(ncid, nvars, varid, start, count, buf, bufcount, datatype); 
     13177  status = ncmpi_put_mvara_all_nonrecord(ncid, nvars, varid, start, count, buf, bufcount, datatype); 
     13178 return (status); 
    1319213179} 
    1319313180 
     
    1320213189  int status = NC_NOERR; 
    1320313190  int dim; 
    13204   int nelems; 
    13205   MPI_Status mpistatus; 
    13206   MPI_Comm comm; 
    13207   int mpireturn; 
    13208   MPI_Datatype ptype; 
    13209   int isderived, iscontig_of_ptypes; 
    1321013191  
    1321113192  status = ncmpii_NC_check_id(ncid, &ncp); 
     
    1323913220 
    1324013221 
    13241 int 
     13222static int 
    1324213223ncmpi_coll_wait(NCMPI_Request request) { 
    13243   ncmpi_put_vara_all(request->ncid, request->varid, 
     13224  return (ncmpi_put_vara_all(request->ncid, request->varid, 
    1324413225                   request->start, request->count, 
    1324513226                   request->buf, request->bufcount, 
    13246                    request->vartype); 
     13227                   request->vartype)); 
    1324713228 
    1324813229} 
  • trunk/src/lib/nc.c

    r671 r687  
    144144} 
    145145 
     146 
     147/* 'defined but not used': seems like a useful function though. why did we 
     148 * write it?  should we be using it? */ 
    146149 
    147150static int 
  • trunk/src/lib/nc.h

    r663 r687  
    554554ncmpii_NC_computeshapes(NC *ncp); 
    555555 
     556extern int 
     557ncmpii_hdr_check_NC(bufferinfo *getbuf, NC *ncp); 
    556558/* end defined in header.c */ 
    557559 
     
    569571extern int 
    570572ncmpiio_move(ncio *const nciop, MPI_Offset to, MPI_Offset from, MPI_Offset nbytes); 
     573 
     574extern int 
     575ncmpiio_get_hint(NC *ncp, char *key, char *value, int flag); 
    571576 
    572577extern int 
  • trunk/src/lib/validator.c

    r669 r687  
    447447  NC_string *strp; 
    448448  int status; 
    449   MPI_Offset ndims, tmp_dim; 
     449  MPI_Offset ndims, *tmp_dim; 
    450450  size_t dim; 
    451451  NC_var *varp; 
     
    475475      return status; 
    476476    } 
    477     tmp_dim = (MPI_Offset) varp->dimids + dim; 
     477    tmp_dim = (MPI_Offset*) (varp->dimids + dim); 
    478478    status = ncmpix_getn_long_long((const void **)(&gbp->pos),  
    479                               1, &tmp_dim); 
     479                              1, tmp_dim); 
    480480    if(status != ENOERR) { 
    481481      ncmpii_free_NC_var(varp); 
  • trunk/src/utils/ncdump/ncdump.c

    r673 r687  
    360360    int ncmpi_status;           /* return from netcdf calls */ 
    361361    int NC_mode; 
    362     int NC_version; 
    363362 
    364363    ncmpi_status = ncmpi_open(MPI_COMM_WORLD, path, NC_NOWRITE, MPI_INFO_NULL, &ncid); 
  • trunk/src/utils/ncdump/vardata.c

    r632 r687  
    457457        printbval(sout, fmt, vp, *vals++); 
    458458        if (fsp->full_data_cmnts) { 
    459             Printf(sout); 
     459            Printf("%s", sout); 
    460460            Printf(","); 
    461461            annotate (vp, fsp, cor, iel); 
     
    467467    printbval(sout, fmt, vp, *vals++); 
    468468    if (fsp->full_data_cmnts) { 
    469         Printf(sout); 
     469        Printf("%s", sout); 
    470470        lastdelim (more, lastrow); 
    471471        annotate (vp, fsp, cor, iel); 
     
    505505        printsval(sout, fmt, vp, *vals++); 
    506506        if (fsp->full_data_cmnts) { 
    507             Printf(sout); 
     507            Printf("%s", sout); 
    508508            Printf(","); 
    509509            annotate (vp, fsp, cor, iel); 
     
    515515    printsval(sout, fmt, vp, *vals++); 
    516516    if (fsp->full_data_cmnts) { 
    517         Printf(sout); 
     517        Printf("%s", sout); 
    518518        lastdelim (more, lastrow); 
    519519        annotate (vp, fsp, cor, iel); 
     
    555555        printival(sout, fmt, vp, *vals++); 
    556556        if (fsp->full_data_cmnts) { 
    557             Printf(sout); 
     557            Printf("%s", sout); 
    558558            Printf(","); 
    559559            annotate (vp, fsp, cor, iel); 
     
    565565    printival(sout, fmt, vp, *vals++); 
    566566    if (fsp->full_data_cmnts) { 
    567         Printf(sout); 
     567        Printf("%s", sout); 
    568568        lastdelim (more, lastrow); 
    569569        annotate (vp, fsp, cor, iel); 
     
    603603        printfval(sout, fmt, vp, *vals++); 
    604604        if (fsp->full_data_cmnts) { 
    605             Printf(sout); 
     605            Printf("%s", sout); 
    606606            Printf(","); 
    607607            annotate (vp, fsp, cor, iel); 
     
    613613    printfval(sout, fmt, vp, *vals++); 
    614614    if (fsp->full_data_cmnts) { 
    615         Printf(sout); 
     615        Printf("%s", sout); 
    616616        lastdelim (more, lastrow); 
    617617        annotate (vp, fsp, cor, iel); 
     
    651651        printdval(sout, fmt, vp, *vals++); 
    652652        if (fsp->full_data_cmnts) { 
    653             Printf(sout); 
     653            Printf("%s", sout); 
    654654            Printf(","); 
    655655            annotate (vp, fsp, cor, iel); 
     
    661661    printdval(sout, fmt, vp, *vals++); 
    662662    if (fsp->full_data_cmnts) { 
    663         Printf(sout); 
     663        Printf("%s", sout); 
    664664        lastdelim (more, lastrow); 
    665665        annotate (vp, fsp, cor, iel);