Exemple #1
0
static int
ncx_pad_getn_Iuchar(const void **xpp, size_t nelems, uchar *tp, nc_type type)
{
	switch(type) {
	case NC_CHAR:
		return NC_ECHAR;
	case NC_BYTE:
		return ncx_pad_getn_schar_uchar(xpp, nelems, tp);
	case NC_SHORT:
		return ncx_pad_getn_short_uchar(xpp, nelems, tp);
	case NC_INT:
		return ncx_getn_int_uchar(xpp, nelems, tp);
	case NC_FLOAT:
		return ncx_getn_float_uchar(xpp, nelems, tp);
	case NC_DOUBLE:
		return ncx_getn_double_uchar(xpp, nelems, tp);
	case NC_UBYTE:
		return ncx_pad_getn_uchar_uchar(xpp, nelems, tp);
	case NC_USHORT:
		return ncx_getn_ushort_uchar(xpp, nelems, tp);
	case NC_UINT:
		return ncx_getn_uint_uchar(xpp, nelems, tp);
	case NC_INT64:
		return ncx_getn_longlong_uchar(xpp, nelems, tp);
	case NC_UINT64:
		return ncx_getn_ulonglong_uchar(xpp, nelems, tp);
	default:
	        assert("ncx_pad_getn_Iuchar invalid type" == 0);
	}
	return NC_EBADTYPE;
}
static int
ncx_pad_getn_Iuchar(const void **xpp, size_t nelems, uchar *tp, nc_type type)
{
  switch(type) {
  case NC_CHAR:
    return NC_ECHAR;
  case NC_BYTE:
    return ncx_pad_getn_schar_uchar(xpp, nelems, tp);
  case NC_SHORT:
    return ncx_pad_getn_short_uchar(xpp, nelems, tp);
  case NC_INT:
    return ncx_getn_int_uchar(xpp, nelems, tp);
  case NC_FLOAT:
    return ncx_getn_float_uchar(xpp, nelems, tp);
  case NC_DOUBLE:
    return ncx_getn_double_uchar(xpp, nelems, tp);
  case NC_NAT:
    break; /* Some compilers complain if enums are missing from a switch */
  }
  assert("ncx_pad_getn_Iuchar invalid type" == 0);
  return NC_EBADTYPE;
}