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:
@@ -134,11 +134,7 @@ unsigned Integer_Value_Count(void)
|
|||||||
*/
|
*/
|
||||||
uint32_t Integer_Value_Index_To_Instance(unsigned index)
|
uint32_t Integer_Value_Index_To_Instance(unsigned index)
|
||||||
{
|
{
|
||||||
uint32_t instance = 1;
|
return index;
|
||||||
|
|
||||||
instance += index;
|
|
||||||
|
|
||||||
return instance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -154,11 +150,8 @@ unsigned Integer_Value_Instance_To_Index(uint32_t object_instance)
|
|||||||
{
|
{
|
||||||
unsigned index = MAX_INTEGER_VALUES;
|
unsigned index = MAX_INTEGER_VALUES;
|
||||||
|
|
||||||
if (object_instance) {
|
if (object_instance < MAX_INTEGER_VALUES) {
|
||||||
index = object_instance - 1;
|
index = object_instance;
|
||||||
if (index > MAX_INTEGER_VALUES) {
|
|
||||||
index = MAX_INTEGER_VALUES;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
|
|||||||
Reference in New Issue
Block a user