diff options
-rw-r--r-- | src/libmbim-glib/mbim-cid.c | 12 | ||||
-rw-r--r-- | src/libmbim-glib/mbim-uuid.c | 8 | ||||
-rw-r--r-- | src/libmbim-glib/mbim-uuid.h | 6 |
3 files changed, 12 insertions, 14 deletions
diff --git a/src/libmbim-glib/mbim-cid.c b/src/libmbim-glib/mbim-cid.c index cbfd81e..cadf42f 100644 --- a/src/libmbim-glib/mbim-cid.c +++ b/src/libmbim-glib/mbim-cid.c @@ -22,6 +22,7 @@ */ #include "mbim-cid.h" +#include "mbim-uuid.h" #include "mbim-enum-types.h" /** @@ -38,9 +39,6 @@ typedef struct { gboolean notify; } CidConfig; -/* Note: MBIM_SERVICE_LAST from mbim-uuid.c should probably be visible - * here somehow, since MBIM_SERVICE_QMI must be used in the error checks */ - /* Note: index of the array is CID-1 */ #define MBIM_CID_BASIC_CONNECT_LAST MBIM_CID_BASIC_CONNECT_MULTICARRIER_PROVIDERS static const CidConfig cid_basic_connect_config [MBIM_CID_BASIC_CONNECT_LAST] = { @@ -158,7 +156,7 @@ mbim_cid_can_set (MbimService service, g_return_val_if_fail (cid > 0, FALSE); /* Known service required */ g_return_val_if_fail (service > MBIM_SERVICE_INVALID, FALSE); - g_return_val_if_fail (service <= MBIM_SERVICE_QMI, FALSE); + g_return_val_if_fail (service < MBIM_SERVICE_LAST, FALSE); switch (service) { case MBIM_SERVICE_BASIC_CONNECT: @@ -206,7 +204,7 @@ mbim_cid_can_query (MbimService service, g_return_val_if_fail (cid > 0, FALSE); /* Known service required */ g_return_val_if_fail (service > MBIM_SERVICE_INVALID, FALSE); - g_return_val_if_fail (service <= MBIM_SERVICE_QMI, FALSE); + g_return_val_if_fail (service < MBIM_SERVICE_LAST, FALSE); switch (service) { case MBIM_SERVICE_BASIC_CONNECT: @@ -254,7 +252,7 @@ mbim_cid_can_notify (MbimService service, g_return_val_if_fail (cid > 0, FALSE); /* Known service required */ g_return_val_if_fail (service > MBIM_SERVICE_INVALID, FALSE); - g_return_val_if_fail (service <= MBIM_SERVICE_QMI, FALSE); + g_return_val_if_fail (service < MBIM_SERVICE_LAST, FALSE); switch (service) { case MBIM_SERVICE_BASIC_CONNECT: @@ -303,7 +301,7 @@ mbim_cid_get_printable (MbimService service, g_return_val_if_fail (cid > 0, NULL); /* Known service required */ g_return_val_if_fail (service > MBIM_SERVICE_INVALID, NULL); - g_return_val_if_fail (service <= MBIM_SERVICE_QMI, NULL); + g_return_val_if_fail (service < MBIM_SERVICE_LAST, NULL); switch (service) { case MBIM_SERVICE_BASIC_CONNECT: diff --git a/src/libmbim-glib/mbim-uuid.c b/src/libmbim-glib/mbim-uuid.c index 95324c7..72eed89 100644 --- a/src/libmbim-glib/mbim-uuid.c +++ b/src/libmbim-glib/mbim-uuid.c @@ -38,8 +38,6 @@ * This section defines the data type for unique identifiers. */ -#define MBIM_SERVICE_LAST MBIM_SERVICE_QMI - /*****************************************************************************/ /** @@ -322,7 +320,7 @@ mbim_service_id_is_custom (const guint id) { GList *l; - if (id <= MBIM_SERVICE_LAST) + if (id < MBIM_SERVICE_LAST) return FALSE; for (l = mbim_custom_service_list; l != NULL; l = l->next) { @@ -349,7 +347,7 @@ mbim_service_lookup_name (guint service) { GList *l; - if (service <= MBIM_SERVICE_LAST) + if (service < MBIM_SERVICE_LAST) return mbim_service_get_string (service); for (l = mbim_custom_service_list; l != NULL; l = l->next) { @@ -376,7 +374,7 @@ mbim_uuid_from_service (MbimService service) GList *l; g_return_val_if_fail (service >= MBIM_SERVICE_INVALID && - (service <= MBIM_SERVICE_LAST || + (service < MBIM_SERVICE_LAST || mbim_service_id_is_custom (service)), &uuid_invalid); diff --git a/src/libmbim-glib/mbim-uuid.h b/src/libmbim-glib/mbim-uuid.h index d42a256..eeb9e11 100644 --- a/src/libmbim-glib/mbim-uuid.h +++ b/src/libmbim-glib/mbim-uuid.h @@ -87,8 +87,10 @@ typedef enum { MBIM_SERVICE_MS_FIRMWARE_ID = 8, MBIM_SERVICE_MS_HOST_SHUTDOWN = 9, MBIM_SERVICE_PROXY_CONTROL = 10, - MBIM_SERVICE_QMI = 11 - /* Note: update MBIM_SERVICE_LAST when a new value is added */ + MBIM_SERVICE_QMI = 11, +#if defined LIBMBIM_GLIB_COMPILATION + MBIM_SERVICE_LAST /*< skip >*/ +#endif } MbimService; /** |