I guess the overflow was badly handled. Fixing it by using
explicit int intermediate value.
Fixes CID 1356616 and 1356619:
Operands don't affect result
Logically dead code
Eina_Memory_Table *table;
Eina_Memory_Entry *entry = NULL;
Eina_Sp_Id id = 0;
+ unsigned int gen;
// We silently handle NULL
if (!target) return NULL;
entry->ptr = (void*) target;
entry->active = 1;
- entry->generation++;
- if (entry->generation == EINA_MAX_GENERATIONS)
- entry->generation = 1;
+ gen = entry->generation + 1;
+ entry->generation = (gen == EINA_MAX_GENERATIONS) ? 1 : gen;
id = SP_COMPOSE_FINAL_ID(table->partial_id,
(entry - table->entries),