コード例 #1
0
ファイル: v1hpg.c プロジェクト: quinoacomputing/quinoa
/* Read a nc_type from the header */
static int
v1h_get_nc_type(v1hs *gsp, nc_type *typep)
{
	int type = 0;
	int status = check_v1hs(gsp, X_SIZEOF_INT);
	if(status != ENOERR)
		return status;
	status =  ncx_get_int_int(gsp->pos, &type);
	gsp->pos = (void *)((char *)gsp->pos + X_SIZEOF_INT);
	if(status != ENOERR)
		return status;

	assert(type == NC_BYTE
		|| type == NC_CHAR
		|| type == NC_SHORT
		|| type == NC_INT
		|| type == NC_FLOAT
		|| type == NC_DOUBLE
		|| type == NC_UBYTE
		|| type == NC_USHORT
		|| type == NC_UINT
		|| type == NC_INT64
		|| type == NC_UINT64
		|| type == NC_STRING);

	/* else */
	*typep = (nc_type) type;

	return ENOERR;
}
コード例 #2
0
ファイル: v1hpg.c プロジェクト: quinoacomputing/quinoa
/* Read a NCtype from the header */
static int
v1h_get_NCtype(v1hs *gsp, NCtype *typep)
{
	int type = 0;
	int status = check_v1hs(gsp, X_SIZEOF_INT);
	if(status != ENOERR)
		return status;
	status =  ncx_get_int_int(gsp->pos, &type);
	gsp->pos = (void *)((char *)gsp->pos + X_SIZEOF_INT);
	if(status != ENOERR)
		return status;
	/* else */
	*typep = (NCtype) type;
	return ENOERR;
}
コード例 #3
0
ファイル: v1hpg.c プロジェクト: BJangeofan/netcdf-c
/* Read a NCtype from the header */
static int
v1h_get_NCtype(v1hs *gsp, NCtype *typep)
{
	int type = 0;
	int status = check_v1hs(gsp, X_SIZEOF_INT);
    if(status != NC_NOERR)
		return status;
	status =  ncx_get_int_int(gsp->pos, &type);

#ifdef __arm__
	gsp->pos = (void *)((signed char *)gsp->pos + X_SIZEOF_INT);
#else
    gsp->pos = (void *)((char *)gsp->pos + X_SIZEOF_INT);
#endif
    if(status != NC_NOERR)
		return status;
	/* else */
	*typep = (NCtype) type;
    return NC_NOERR;
}