[tidy] move loop variable declaration to loop

This commit is contained in:
akallabeth
2024-01-30 10:25:38 +01:00
committed by akallabeth
parent 62f974a5c2
commit d7ebec5a65
345 changed files with 1568 additions and 2828 deletions

View File

@@ -53,12 +53,9 @@ UINT16 minihash(UINT16 key)
void buildhashtable(void)
{
int i, j;
UINT16 h;
for (i = 0; i < 293; i++)
for (int i = 0; i < 293; i++)
{
h = hash(HuffCodeLEC[i]);
UINT16 h = hash(HuffCodeLEC[i]);
if (HashTable[h] != 0xffff)
{
@@ -85,11 +82,10 @@ UINT16 getvalue(UINT16 huff)
main()
{
int i;
buildhashtable();
printf("static UINT16 HuffIndexLEC[512] = {\n");
for (i = 0; i < 512; i++)
for (int i = 0; i < 512; i++)
{
if (i == 511)
printf("0x%04" PRIx16 " };\n", HashTable[i]);
@@ -97,7 +93,7 @@ main()
printf("0x%04" PRIx16 ", ", HashTable[i]);
}
for (i = 0; i < 293; i++)
for (int i = 0; i < 293; i++)
if (i != getvalue(HuffCodeLEC[i]))
printf("Fail :( at %d : 0x%04" PRIx16 "\n", i, HuffCodeLEC[i]);

View File

@@ -24,12 +24,9 @@ BYTE minihash(UINT16 key)
void buildhashtable(void)
{
int i, j;
UINT16 h;
for (i = 0; i < 32; i++)
for (int i = 0; i < 32; i++)
{
h = hash(HuffCodeLOM[i]);
UINT16 h = hash(HuffCodeLOM[i]);
if (HashTable[h] != 0xffff)
{
@@ -60,11 +57,10 @@ BYTE getvalue(UINT16 huff)
main()
{
int i;
buildhashtable();
printf("static UINT16 HuffIndexLOM[32] = {\n");
for (i = 0; i < 32; i++)
for (int i = 0; i < 32; i++)
{
if (i == 31)
printf("0x%" PRIx16 " };\n", HashTable[i]);
@@ -72,7 +68,7 @@ main()
printf("0x%" PRIx16 ", ", HashTable[i]);
}
for (i = 0; i < 32; i++)
for (int i = 0; i < 32; i++)
if (i != getvalue(HuffCodeLOM[i]))
printf("Fail :( at %d : 0x%04" PRIx16 " got %" PRIu8 "\n", i, HuffCodeLOM[i],
getvalue(HuffCodeLOM[i]));