! . */
| 6938 | |
| 6939 | /*! . */ |
| 6940 | void gmt_sort_array (struct GMT_CTRL *GMT, void *base, uint64_t n, unsigned int type) { |
| 6941 | /* Front function to call qsort on all <type> array into ascending order */ |
| 6942 | size_t width[GMT_N_TYPES] = { |
| 6943 | sizeof(uint8_t), /* GMT_UCHAR */ |
| 6944 | sizeof(int8_t), /* GMT_CHAR */ |
| 6945 | sizeof(uint16_t), /* GMT_USHORT */ |
| 6946 | sizeof(int16_t), /* GMT_SHORT */ |
| 6947 | sizeof(uint32_t), /* GMT_UINT */ |
| 6948 | sizeof(int32_t), /* GMT_INT */ |
| 6949 | sizeof(uint64_t), /* GMT_ULONG */ |
| 6950 | sizeof(int64_t), /* GMT_LONG */ |
| 6951 | sizeof(float), /* GMT_FLOAT */ |
| 6952 | sizeof(double)}; /* GMT_DOUBLE */ |
| 6953 | int (*compare[GMT_N_TYPES]) (const void *, const void *) = { |
| 6954 | /* Array of function pointers */ |
| 6955 | gmtsupport_comp_uchar_asc, /* GMT_CHAR */ |
| 6956 | gmtsupport_comp_char_asc, /* GMT_UCHAR */ |
| 6957 | gmtsupport_comp_ushort_asc, /* GMT_USHORT */ |
| 6958 | gmtsupport_comp_short_asc, /* GMT_SHORT */ |
| 6959 | gmtsupport_comp_uint_asc, /* GMT_UINT */ |
| 6960 | gmtsupport_comp_int_asc, /* GMT_INT */ |
| 6961 | gmtsupport_comp_ulong_asc, /* GMT_ULONG */ |
| 6962 | gmtsupport_comp_long_asc, /* GMT_LONG */ |
| 6963 | gmtsupport_comp_float_asc, /* GMT_FLOAT */ |
| 6964 | gmtsupport_comp_double_asc}; /* GMT_DOUBLE */ |
| 6965 | gmt_M_unused(GMT); |
| 6966 | |
| 6967 | qsort (base, n, width[type], compare[type]); |
| 6968 | } |
| 6969 | |
| 6970 | /*! . */ |
| 6971 | void gmt_sort_order (struct GMT_CTRL *GMT, struct GMT_ORDER *base, uint64_t n, int dir) { |
no outgoing calls
no test coverage detected