| 12 | #include "GB.h" |
| 13 | |
| 14 | GB_PUBLIC |
| 15 | size_t GB_code_size // return the size of a type, given its code |
| 16 | ( |
| 17 | const GB_Type_code code, // input code of the type to find the size of |
| 18 | const size_t usize // known size of user-defined type |
| 19 | ) |
| 20 | { |
| 21 | |
| 22 | switch (code) |
| 23 | { |
| 24 | case GB_BOOL_code : return (sizeof (bool)) ; |
| 25 | case GB_INT8_code : return (sizeof (int8_t)) ; |
| 26 | case GB_UINT8_code : return (sizeof (uint8_t)) ; |
| 27 | case GB_INT16_code : return (sizeof (int16_t)) ; |
| 28 | case GB_UINT16_code : return (sizeof (uint16_t)) ; |
| 29 | case GB_INT32_code : return (sizeof (int32_t)) ; |
| 30 | case GB_UINT32_code : return (sizeof (uint32_t)) ; |
| 31 | case GB_INT64_code : return (sizeof (int64_t)) ; |
| 32 | case GB_UINT64_code : return (sizeof (uint64_t)) ; |
| 33 | case GB_FP32_code : return (sizeof (float)) ; |
| 34 | case GB_FP64_code : return (sizeof (double)) ; |
| 35 | case GB_FC32_code : return (sizeof (GxB_FC32_t)) ; |
| 36 | case GB_FC64_code : return (sizeof (GxB_FC64_t)) ; |
| 37 | case GB_UDT_code : return (usize) ; |
| 38 | default : return (0) ; |
| 39 | } |
| 40 | } |
| 41 |
no outgoing calls
no test coverage detected