Change first instance of an integer value from 1 to 0 (#619)

Integer_Values instances start at 1 while other object instances
start at 0. Change this to have the same start for all objects.

Signed-off-by: Antoine Coutant <antoine.coutant@smile.fr>
This commit is contained in:
antocout
2024-04-17 15:53:12 +02:00
committed by GitHub
parent 7b6dcada60
commit 600508c357
+3 -10
View File
@@ -134,11 +134,7 @@ unsigned Integer_Value_Count(void)
*/
uint32_t Integer_Value_Index_To_Instance(unsigned index)
{
uint32_t instance = 1;
instance += index;
return instance;
return index;
}
/**
@@ -154,11 +150,8 @@ unsigned Integer_Value_Instance_To_Index(uint32_t object_instance)
{
unsigned index = MAX_INTEGER_VALUES;
if (object_instance) {
index = object_instance - 1;
if (index > MAX_INTEGER_VALUES) {
index = MAX_INTEGER_VALUES;
}
if (object_instance < MAX_INTEGER_VALUES) {
index = object_instance;
}
return index;