[settings] assert invalid keys in getter

This commit is contained in:
akallabeth 2023-10-17 10:10:02 +02:00 committed by akallabeth
parent 14ca8c736b
commit 093d722447

View File

@ -622,6 +622,7 @@ BOOL freerdp_settings_get_bool(const rdpSettings* settings, FreeRDP_Settings_Key
WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
freerdp_settings_get_name_for_key(id),
freerdp_settings_get_type_name_for_key(id));
WINPR_ASSERT(FALSE);
return FALSE;
}
}
@ -1447,6 +1448,7 @@ UINT16 freerdp_settings_get_uint16(const rdpSettings* settings, FreeRDP_Settings
WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
freerdp_settings_get_name_for_key(id),
freerdp_settings_get_type_name_for_key(id));
WINPR_ASSERT(FALSE);
return 0;
}
}
@ -1520,8 +1522,8 @@ BOOL freerdp_settings_set_uint16(rdpSettings* settings, FreeRDP_Settings_Keys_UI
default:
WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
freerdp_settings_get_name_for_key((size_t)id),
freerdp_settings_get_type_name_for_key((size_t)id));
freerdp_settings_get_name_for_key(id),
freerdp_settings_get_type_name_for_key(id));
return FALSE;
}
return TRUE;
@ -1535,8 +1537,9 @@ INT16 freerdp_settings_get_int16(const rdpSettings* settings, FreeRDP_Settings_K
{
default:
WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
freerdp_settings_get_name_for_key((size_t)id),
freerdp_settings_get_type_name_for_key((size_t)id));
freerdp_settings_get_name_for_key(id),
freerdp_settings_get_type_name_for_key(id));
WINPR_ASSERT(FALSE);
return 0;
}
}
@ -1558,8 +1561,8 @@ BOOL freerdp_settings_set_int16(rdpSettings* settings, FreeRDP_Settings_Keys_Int
{
default:
WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
freerdp_settings_get_name_for_key((size_t)id),
freerdp_settings_get_type_name_for_key((size_t)id));
freerdp_settings_get_name_for_key(id),
freerdp_settings_get_type_name_for_key(id));
return FALSE;
}
return TRUE;
@ -1944,6 +1947,7 @@ UINT32 freerdp_settings_get_uint32(const rdpSettings* settings, FreeRDP_Settings
WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
freerdp_settings_get_name_for_key(id),
freerdp_settings_get_type_name_for_key(id));
WINPR_ASSERT(FALSE);
return 0;
}
}
@ -2480,6 +2484,7 @@ INT32 freerdp_settings_get_int32(const rdpSettings* settings, FreeRDP_Settings_K
WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
freerdp_settings_get_name_for_key(id),
freerdp_settings_get_type_name_for_key(id));
WINPR_ASSERT(FALSE);
return 0;
}
}
@ -2529,6 +2534,7 @@ UINT64 freerdp_settings_get_uint64(const rdpSettings* settings, FreeRDP_Settings
WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
freerdp_settings_get_name_for_key(id),
freerdp_settings_get_type_name_for_key(id));
WINPR_ASSERT(FALSE);
return 0;
}
}
@ -2569,8 +2575,9 @@ INT64 freerdp_settings_get_int64(const rdpSettings* settings, FreeRDP_Settings_K
{
default:
WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
freerdp_settings_get_name_for_key((size_t)id),
freerdp_settings_get_type_name_for_key((size_t)id));
freerdp_settings_get_name_for_key(id),
freerdp_settings_get_type_name_for_key(id));
WINPR_ASSERT(FALSE);
return 0;
}
}
@ -2592,8 +2599,8 @@ BOOL freerdp_settings_set_int64(rdpSettings* settings, FreeRDP_Settings_Keys_Int
{
default:
WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
freerdp_settings_get_name_for_key((size_t)id),
freerdp_settings_get_type_name_for_key((size_t)id));
freerdp_settings_get_name_for_key(id),
freerdp_settings_get_type_name_for_key(id));
return FALSE;
}
return TRUE;
@ -2901,6 +2908,7 @@ const char* freerdp_settings_get_string(const rdpSettings* settings,
WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
freerdp_settings_get_name_for_key(id),
freerdp_settings_get_type_name_for_key(id));
WINPR_ASSERT(FALSE);
return NULL;
}
}
@ -3206,6 +3214,7 @@ char* freerdp_settings_get_string_writable(rdpSettings* settings, FreeRDP_Settin
WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
freerdp_settings_get_name_for_key(id),
freerdp_settings_get_type_name_for_key(id));
WINPR_ASSERT(FALSE);
return NULL;
}
}
@ -3965,6 +3974,7 @@ void* freerdp_settings_get_pointer_writable(rdpSettings* settings, FreeRDP_Setti
WLog_ERR(TAG, "Invalid key index %" PRIuz " [%s|%s]", id,
freerdp_settings_get_name_for_key(id),
freerdp_settings_get_type_name_for_key(id));
WINPR_ASSERT(FALSE);
return NULL;
}
}