コード例 #1
0
ファイル: attr.c プロジェクト: balborian/libmesh
static int
ncx_pad_putn_Ischar(void **xpp, size_t nelems, const schar *tp, nc_type type)
{
	switch(type) {
	case NC_CHAR:
		return NC_ECHAR;
	case NC_BYTE:
		return ncx_pad_putn_schar_schar(xpp, nelems, tp);
	case NC_SHORT:
		return ncx_pad_putn_short_schar(xpp, nelems, tp);
	case NC_INT:
		return ncx_putn_int_schar(xpp, nelems, tp);
	case NC_FLOAT:
		return ncx_putn_float_schar(xpp, nelems, tp);
	case NC_DOUBLE:
		return ncx_putn_double_schar(xpp, nelems, tp);
	case NC_UBYTE:
		return ncx_pad_putn_uchar_schar(xpp, nelems, tp);
	case NC_USHORT:
		return ncx_putn_ushort_schar(xpp, nelems, tp);
	case NC_UINT:
		return ncx_putn_uint_schar(xpp, nelems, tp);
	case NC_INT64:
		return ncx_putn_longlong_schar(xpp, nelems, tp);
	case NC_UINT64:
		return ncx_putn_ulonglong_schar(xpp, nelems, tp);
	default:
                assert("ncx_pad_putn_Ischar invalid type" == 0);
	}
	return NC_EBADTYPE;
}
コード例 #2
0
static int
ncx_pad_putn_Ischar(void **xpp, size_t nelems, const schar *tp, nc_type type)
{
  switch(type) {
  case NC_CHAR:
    return NC_ECHAR;
  case NC_BYTE:
    return ncx_pad_putn_schar_schar(xpp, nelems, tp);
  case NC_SHORT:
    return ncx_pad_putn_short_schar(xpp, nelems, tp);
  case NC_INT:
    return ncx_putn_int_schar(xpp, nelems, tp);
  case NC_FLOAT:
    return ncx_putn_float_schar(xpp, nelems, tp);
  case NC_DOUBLE:
    return ncx_putn_double_schar(xpp, nelems, tp);
  case NC_NAT:
    break; /* Some compilers complain if enums are missing from a switch */
  }
  assert("ncx_pad_putn_Ischar invalid type" == 0);
  return NC_EBADTYPE;
}