diff --git a/ncdump/chunkspec.c b/ncdump/chunkspec.c index 909e3ee07..06fb5ffb9 100644 --- a/ncdump/chunkspec.c +++ b/ncdump/chunkspec.c @@ -196,7 +196,7 @@ dimchunkspec_size(int indimid) { /* Return number of dimensions for which chunking was specified in * chunkspec string on command line, 0 if no chunkspec string was * specified. */ -int +size_t dimchunkspec_ndims(void) { return dimchunkspecs.ndims; } diff --git a/ncdump/chunkspec.h b/ncdump/chunkspec.h index 8e2f9f06c..06ab65a86 100644 --- a/ncdump/chunkspec.h +++ b/ncdump/chunkspec.h @@ -6,6 +6,9 @@ #ifndef _CHUNKSPEC_H_ #define _CHUNKSPEC_H_ +#include +#include "utils.h" + /* Parse chunkspec string and convert into internal data structure, * associating dimids from open file or group specified by ncid with * corresponding chunk sizes */ @@ -25,7 +28,7 @@ dimchunkspec_exists(int indimid); /* Return number of dimensions for which chunking was specified in * chunkspec string on command line, 0 if no chunkspec string was * specified. */ -extern int +extern size_t dimchunkspec_ndims(void); /* Return whether chunking should be omitted, due to explicit diff --git a/ncdump/dumplib.c b/ncdump/dumplib.c index 8956fab47..e5842e532 100644 --- a/ncdump/dumplib.c +++ b/ncdump/dumplib.c @@ -1806,7 +1806,7 @@ print_type_name(int locid, int typeid) { static int init_is_unlim(int ncid, int **is_unlim_p) { - int num_grps; /* total number of groups */ + size_t num_grps; /* total number of groups */ int max_dimid = -1; /* maximum dimid across whole dataset */ int *grpids = NULL; /* temporary list of all grpids */ int igrp; @@ -1822,7 +1822,7 @@ init_is_unlim(int ncid, int **is_unlim_p) return NC_EBADGRPID; /* Now ncid is root group. Get total number of groups and their ids */ NC_CHECK( nc_inq_grps_full(ncid, &num_grps, NULL) ); - grpids = emalloc((size_t)(num_grps + 1) * sizeof(int)); + grpids = emalloc((num_grps + 1) * sizeof(int)); NC_CHECK( nc_inq_grps_full(ncid, &num_grps, grpids) ); #define DONT_INCLUDE_PARENTS 0 /* Get all dimensions in groups and info about which ones are unlimited */ diff --git a/ncdump/nccopy.c b/ncdump/nccopy.c index 190696d72..21306269a 100644 --- a/ncdump/nccopy.c +++ b/ncdump/nccopy.c @@ -681,14 +681,14 @@ static int copy_groups(int iroot, int oroot) { int stat = NC_NOERR; - int numgrps; + size_t numgrps; int *grpids; int i; /* get total number of groups and their ids, including all descendants */ NC_CHECK(nc_inq_grps_full(iroot, &numgrps, NULL)); if(numgrps > 1) { /* there's always 1 root group */ - grpids = emalloc((size_t)numgrps * sizeof(int)); + grpids = emalloc(numgrps * sizeof(int)); NC_CHECK(nc_inq_grps_full(iroot, NULL, grpids)); /* create corresponding new groups in ogrp, except for root group */ for(i = 1; i < numgrps; i++) { diff --git a/ncdump/utils.c b/ncdump/utils.c index c32d49b95..ab19af3cb 100644 --- a/ncdump/utils.c +++ b/ncdump/utils.c @@ -520,7 +520,7 @@ nc_inq_grpname_count(int ncid, int igrp, char **lgrps, idnode_t *grpids) { /* Check if any group names specified with "-g grp1,...,grpn" are * missing. Returns total number of matching groups if no missing * groups detected, otherwise exits. */ -int +size_t grp_matches(int ncid, int nlgrps, char** lgrps, idnode_t *grpids) { int ig; size_t total = 0; @@ -883,7 +883,7 @@ nc_free_giter(ncgiter_t *iterp) * for the group ids, then call again to get them. */ int -nc_inq_grps_full(int rootid, int *numgrps, int *grpids) +nc_inq_grps_full(int rootid, size_t *numgrps, int *grpids) { int stat = NC_NOERR; ncgiter_t *giter; /* pointer to group iterator */ diff --git a/ncdump/utils.h b/ncdump/utils.h index cd413e39a..a38dfae00 100644 --- a/ncdump/utils.h +++ b/ncdump/utils.h @@ -128,7 +128,7 @@ extern bool_t idmember ( const idnode_t* idlist, int id ); extern bool_t group_wanted ( int grpid, int nlgrps, const idnode_t* grpids ); /* Check group list for missing groups */ -extern int grp_matches(int ncid, int nlgrps, char** lgrps, idnode_t *grpids); +extern size_t grp_matches(int ncid, int nlgrps, char** lgrps, idnode_t *grpids); /* Returns 1 if string s1 ends with string s2, 0 otherwise. */ extern int strendswith(const char *s1, const char *s2); @@ -162,7 +162,7 @@ extern void freeidlist(idnode_t *idlist); * loses information about subgroup relationships, just flattening all * groups into a serial list. */ -extern int nc_inq_grps_full(int ncid, int *numgrps, int *ncids); +extern int nc_inq_grps_full(int ncid, size_t *numgrps, int *ncids); /* * More complex iterator interface: get group iterator for start group