diff --git a/main/event.c b/main/event.c index 228807dd8475c4399fb8b42fb1fe909b0c90f0ef..3af03147e2ea4dcd74b17569fc4f716405dc2386 100644 --- a/main/event.c +++ b/main/event.c @@ -199,7 +199,7 @@ const char *ast_event_get_type_name(const struct ast_event *event) type = ast_event_get_type(event); - if (type >= ARRAY_LEN(event_names)) { + if ((unsigned int)type >= ARRAY_LEN(event_names)) { ast_log(LOG_ERROR, "Invalid event type - '%u'\n", type); return ""; } diff --git a/main/security_events.c b/main/security_events.c index 0da62a20a80b2b6123c453ba1bcf632617bf1174..9db932d85c6a178d0cff2a3fcfcf802777fabb96 100644 --- a/main/security_events.c +++ b/main/security_events.c @@ -428,7 +428,7 @@ static struct ast_manager_event_blob *security_event_to_ami_blob(struct ast_json event_type_json = ast_json_object_get(json, "SecurityEvent"); event_type = ast_json_integer_get(event_type_json); - ast_assert(event_type >= 0 && event_type < AST_SECURITY_EVENT_NUM_TYPES); + ast_assert((unsigned int)event_type < AST_SECURITY_EVENT_NUM_TYPES); if (!(str = ast_str_create(SECURITY_EVENT_BUF_INIT_LEN))) { return NULL; @@ -886,7 +886,7 @@ const char *ast_security_event_severity_get_name( static int check_event_type(const enum ast_security_event_type event_type) { - if (event_type >= AST_SECURITY_EVENT_NUM_TYPES) { + if ((unsigned int)event_type >= AST_SECURITY_EVENT_NUM_TYPES) { ast_log(LOG_ERROR, "Invalid security event type %u\n", event_type); return -1; } @@ -1172,7 +1172,7 @@ return_error: int ast_security_event_report(const struct ast_security_event_common *sec) { - if (sec->event_type >= AST_SECURITY_EVENT_NUM_TYPES) { + if ((unsigned int)sec->event_type >= AST_SECURITY_EVENT_NUM_TYPES) { ast_log(LOG_ERROR, "Invalid security event type\n"); return -1; } diff --git a/res/res_stasis_playback.c b/res/res_stasis_playback.c index 2d40ec0e5671de8ea0770c3e751653560e959484..7aac06d6658d4b619572ab9a4e54ca569d921b26 100644 --- a/res/res_stasis_playback.c +++ b/res/res_stasis_playback.c @@ -629,7 +629,7 @@ enum stasis_playback_oper_results stasis_app_playback_operation( playback_opreation_cb cb; SCOPED_AO2LOCK(lock, playback); - ast_assert(playback->state < STASIS_PLAYBACK_STATE_MAX); + ast_assert((unsigned int)playback->state < STASIS_PLAYBACK_STATE_MAX); if (operation >= STASIS_PLAYBACK_MEDIA_OP_MAX) { ast_log(LOG_ERROR, "Invalid playback operation %u\n", operation); diff --git a/res/res_stasis_recording.c b/res/res_stasis_recording.c index 7af9c1060089b55dcd3599ea497a9b2aacfad7b2..3a10d41e055edb6ded5da8d980b3a3147f0a6060 100644 --- a/res/res_stasis_recording.c +++ b/res/res_stasis_recording.c @@ -595,13 +595,13 @@ enum stasis_app_recording_oper_results stasis_app_recording_operation( recording_operation_cb cb; SCOPED_AO2LOCK(lock, recording); - if (recording->state >= STASIS_APP_RECORDING_STATE_MAX) { + if ((unsigned int)recording->state >= STASIS_APP_RECORDING_STATE_MAX) { ast_log(LOG_WARNING, "Invalid recording state %u\n", recording->state); return -1; } - if (operation >= STASIS_APP_RECORDING_OPER_MAX) { + if ((unsigned int)operation >= STASIS_APP_RECORDING_OPER_MAX) { ast_log(LOG_WARNING, "Invalid recording operation %u\n", operation); return -1;