diff --git a/main/event.c b/main/event.c
index 5796aab19033fe10a9b9d1144fbe4b61da95beb5..94365e26a36fb9f137c234bf0c4cd07dbb060aad 100644
--- a/main/event.c
+++ b/main/event.c
@@ -295,7 +295,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 ca24921bacb562549873fcb6bf52600d188dd791..cb8959017a7ef0670be043986b628ca677b73ea1 100644
--- a/main/security_events.c
+++ b/main/security_events.c
@@ -427,7 +427,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;
 	}
@@ -680,7 +680,7 @@ int ast_security_event_report(const struct ast_security_event_common *sec)
 {
 	int res;
 
-	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;
 	}