* \brief basically convert setting_t expressed 2^n to n * \param s The setting to convert to * * Converts a setting_t value expressed by 2^n to the value of n. * * \return the index such that 2^n is the setting, otherwise 0 * if the setting was not found. */
| 980 | * if the setting was not found. |
| 981 | */ |
| 982 | int HAMLIB_API rig_setting2idx(setting_t s) |
| 983 | { |
| 984 | int i; |
| 985 | |
| 986 | rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); |
| 987 | |
| 988 | for (i = 0; i < RIG_SETTING_MAX; i++) |
| 989 | { |
| 990 | if (s & rig_idx2setting(i)) |
| 991 | { |
| 992 | rig_debug(RIG_DEBUG_VERBOSE, "%s: idx=%d\n", __func__, i); |
| 993 | return i; |
| 994 | } |
| 995 | } |
| 996 | |
| 997 | return 0; |
| 998 | } |
| 999 | |
| 1000 | |
| 1001 | #if 0 |
no test coverage detected