I have this preprocessor directive:
#define INDEXES_PER_SECTOR BYTES_PER_SECTOR / 4
where BYTES_PER_SECTOR is declared in another header file as:
#define BYTES_PER_SECTOR 64
I have this simple mathematical equation that I wrote where, after execution, I get an assertion error, since the value assigned by iTotalSingleIndexes is incorrect.
int iTotalSingleIndexes = (iDataBlocks - 29) / INDEXES_PER_SECTOR;
Now I believe that this is because of the INDEXES_PER_SECTOR preprocessor directive. When executing my equation, iDataBlocks is 285, which is correct. I confirmed this with gdb. The problem is that the value assigned to iTotalSingleIndexes is 1 when it should be 16. I really don't know why this is happening.
When I do something like:
int iIndexesInASector = INDEXES_PER_SECTOR;
int iTotalSingleIndexes = (iDataBlocks - 29) / iIndexesInASector;
the correct value is assigned to iTotalSingleIndexes.
, , .
.