mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
Fix return type on a couple of internal utility functions
This commit is contained in:
parent
b94199874d
commit
409ca579ab
@ -196,7 +196,7 @@ dimchunkspec_size(int indimid) {
|
|||||||
/* Return number of dimensions for which chunking was specified in
|
/* Return number of dimensions for which chunking was specified in
|
||||||
* chunkspec string on command line, 0 if no chunkspec string was
|
* chunkspec string on command line, 0 if no chunkspec string was
|
||||||
* specified. */
|
* specified. */
|
||||||
int
|
size_t
|
||||||
dimchunkspec_ndims(void) {
|
dimchunkspec_ndims(void) {
|
||||||
return dimchunkspecs.ndims;
|
return dimchunkspecs.ndims;
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
#ifndef _CHUNKSPEC_H_
|
#ifndef _CHUNKSPEC_H_
|
||||||
#define _CHUNKSPEC_H_
|
#define _CHUNKSPEC_H_
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
/* Parse chunkspec string and convert into internal data structure,
|
/* Parse chunkspec string and convert into internal data structure,
|
||||||
* associating dimids from open file or group specified by ncid with
|
* associating dimids from open file or group specified by ncid with
|
||||||
* corresponding chunk sizes */
|
* corresponding chunk sizes */
|
||||||
@ -25,7 +28,7 @@ dimchunkspec_exists(int indimid);
|
|||||||
/* Return number of dimensions for which chunking was specified in
|
/* Return number of dimensions for which chunking was specified in
|
||||||
* chunkspec string on command line, 0 if no chunkspec string was
|
* chunkspec string on command line, 0 if no chunkspec string was
|
||||||
* specified. */
|
* specified. */
|
||||||
extern int
|
extern size_t
|
||||||
dimchunkspec_ndims(void);
|
dimchunkspec_ndims(void);
|
||||||
|
|
||||||
/* Return whether chunking should be omitted, due to explicit
|
/* Return whether chunking should be omitted, due to explicit
|
||||||
|
@ -1806,7 +1806,7 @@ print_type_name(int locid, int typeid) {
|
|||||||
static int
|
static int
|
||||||
init_is_unlim(int ncid, int **is_unlim_p)
|
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 max_dimid = -1; /* maximum dimid across whole dataset */
|
||||||
int *grpids = NULL; /* temporary list of all grpids */
|
int *grpids = NULL; /* temporary list of all grpids */
|
||||||
int igrp;
|
int igrp;
|
||||||
@ -1822,7 +1822,7 @@ init_is_unlim(int ncid, int **is_unlim_p)
|
|||||||
return NC_EBADGRPID;
|
return NC_EBADGRPID;
|
||||||
/* Now ncid is root group. Get total number of groups and their ids */
|
/* Now ncid is root group. Get total number of groups and their ids */
|
||||||
NC_CHECK( nc_inq_grps_full(ncid, &num_grps, NULL) );
|
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) );
|
NC_CHECK( nc_inq_grps_full(ncid, &num_grps, grpids) );
|
||||||
#define DONT_INCLUDE_PARENTS 0
|
#define DONT_INCLUDE_PARENTS 0
|
||||||
/* Get all dimensions in groups and info about which ones are unlimited */
|
/* Get all dimensions in groups and info about which ones are unlimited */
|
||||||
|
@ -681,14 +681,14 @@ static int
|
|||||||
copy_groups(int iroot, int oroot)
|
copy_groups(int iroot, int oroot)
|
||||||
{
|
{
|
||||||
int stat = NC_NOERR;
|
int stat = NC_NOERR;
|
||||||
int numgrps;
|
size_t numgrps;
|
||||||
int *grpids;
|
int *grpids;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* get total number of groups and their ids, including all descendants */
|
/* get total number of groups and their ids, including all descendants */
|
||||||
NC_CHECK(nc_inq_grps_full(iroot, &numgrps, NULL));
|
NC_CHECK(nc_inq_grps_full(iroot, &numgrps, NULL));
|
||||||
if(numgrps > 1) { /* there's always 1 root group */
|
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));
|
NC_CHECK(nc_inq_grps_full(iroot, NULL, grpids));
|
||||||
/* create corresponding new groups in ogrp, except for root group */
|
/* create corresponding new groups in ogrp, except for root group */
|
||||||
for(i = 1; i < numgrps; i++) {
|
for(i = 1; i < numgrps; i++) {
|
||||||
|
@ -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
|
/* Check if any group names specified with "-g grp1,...,grpn" are
|
||||||
* missing. Returns total number of matching groups if no missing
|
* missing. Returns total number of matching groups if no missing
|
||||||
* groups detected, otherwise exits. */
|
* groups detected, otherwise exits. */
|
||||||
int
|
size_t
|
||||||
grp_matches(int ncid, int nlgrps, char** lgrps, idnode_t *grpids) {
|
grp_matches(int ncid, int nlgrps, char** lgrps, idnode_t *grpids) {
|
||||||
int ig;
|
int ig;
|
||||||
size_t total = 0;
|
size_t total = 0;
|
||||||
@ -883,7 +883,7 @@ nc_free_giter(ncgiter_t *iterp)
|
|||||||
* for the group ids, then call again to get them.
|
* for the group ids, then call again to get them.
|
||||||
*/
|
*/
|
||||||
int
|
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;
|
int stat = NC_NOERR;
|
||||||
ncgiter_t *giter; /* pointer to group iterator */
|
ncgiter_t *giter; /* pointer to group iterator */
|
||||||
|
@ -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 );
|
extern bool_t group_wanted ( int grpid, int nlgrps, const idnode_t* grpids );
|
||||||
|
|
||||||
/* Check group list for missing groups */
|
/* 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. */
|
/* Returns 1 if string s1 ends with string s2, 0 otherwise. */
|
||||||
extern int strendswith(const char *s1, const char *s2);
|
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
|
* loses information about subgroup relationships, just flattening all
|
||||||
* groups into a serial list.
|
* 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
|
* More complex iterator interface: get group iterator for start group
|
||||||
|
Loading…
Reference in New Issue
Block a user