mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r1829) -Fix: fixed some compiler warnings (tnx to Tron for the Makefile-flag)
This commit is contained in:
parent
d48261aa23
commit
bedc63d75d
17
oldloader.c
17
oldloader.c
@ -164,6 +164,7 @@ static bool LoadChunk(LoadgameState *ls, void *base, const OldChunks *chunks)
|
|||||||
{
|
{
|
||||||
const OldChunks *chunk = chunks;
|
const OldChunks *chunk = chunks;
|
||||||
byte *ptr;
|
byte *ptr;
|
||||||
|
byte *base_ptr = base;
|
||||||
uint i;
|
uint i;
|
||||||
|
|
||||||
while (chunk->type != OC_END) {
|
while (chunk->type != OC_END) {
|
||||||
@ -238,7 +239,7 @@ static bool LoadChunk(LoadgameState *ls, void *base, const OldChunks *chunks)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Sanity check */
|
/* Sanity check */
|
||||||
assert(base != NULL || chunk->ptr != NULL);
|
assert(base_ptr != NULL || chunk->ptr != NULL);
|
||||||
|
|
||||||
/* Writing to the var: bit 8 till 15 have the VAR */
|
/* Writing to the var: bit 8 till 15 have the VAR */
|
||||||
switch (((chunk->type >> 8) & 0xFF) << 8) {
|
switch (((chunk->type >> 8) & 0xFF) << 8) {
|
||||||
@ -248,7 +249,7 @@ static bool LoadChunk(LoadgameState *ls, void *base, const OldChunks *chunks)
|
|||||||
*(int8 *)ptr = res & 0xFF;
|
*(int8 *)ptr = res & 0xFF;
|
||||||
ptr++;
|
ptr++;
|
||||||
} else
|
} else
|
||||||
*(int8 *)(base + chunk->offset) = res & 0xFF;
|
*(int8 *)(base_ptr + chunk->offset) = res & 0xFF;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OC_VAR_U8:
|
case OC_VAR_U8:
|
||||||
@ -257,7 +258,7 @@ static bool LoadChunk(LoadgameState *ls, void *base, const OldChunks *chunks)
|
|||||||
*(uint8 *)ptr = res & 0xFF;
|
*(uint8 *)ptr = res & 0xFF;
|
||||||
ptr++;
|
ptr++;
|
||||||
} else
|
} else
|
||||||
*(uint8 *)(base + chunk->offset) = res & 0xFF;
|
*(uint8 *)(base_ptr + chunk->offset) = res & 0xFF;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OC_VAR_U16:
|
case OC_VAR_U16:
|
||||||
@ -266,7 +267,7 @@ static bool LoadChunk(LoadgameState *ls, void *base, const OldChunks *chunks)
|
|||||||
*(uint16 *)ptr = res & 0xFFFF;
|
*(uint16 *)ptr = res & 0xFFFF;
|
||||||
ptr += 2;
|
ptr += 2;
|
||||||
} else
|
} else
|
||||||
*(uint16 *)(base + chunk->offset) = res & 0xFFFF;
|
*(uint16 *)(base_ptr + chunk->offset) = res & 0xFFFF;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OC_VAR_I16:
|
case OC_VAR_I16:
|
||||||
@ -275,7 +276,7 @@ static bool LoadChunk(LoadgameState *ls, void *base, const OldChunks *chunks)
|
|||||||
*(int16 *)ptr = res & 0xFFFF;
|
*(int16 *)ptr = res & 0xFFFF;
|
||||||
ptr += 2;
|
ptr += 2;
|
||||||
} else
|
} else
|
||||||
*(int16 *)(base + chunk->offset) = res & 0xFFFF;
|
*(int16 *)(base_ptr + chunk->offset) = res & 0xFFFF;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OC_VAR_U32:
|
case OC_VAR_U32:
|
||||||
@ -284,7 +285,7 @@ static bool LoadChunk(LoadgameState *ls, void *base, const OldChunks *chunks)
|
|||||||
*(uint32 *)ptr = res;
|
*(uint32 *)ptr = res;
|
||||||
ptr += 4;
|
ptr += 4;
|
||||||
} else
|
} else
|
||||||
*(uint32 *)(base + chunk->offset) = res;
|
*(uint32 *)(base_ptr + chunk->offset) = res;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OC_VAR_I32:
|
case OC_VAR_I32:
|
||||||
@ -293,7 +294,7 @@ static bool LoadChunk(LoadgameState *ls, void *base, const OldChunks *chunks)
|
|||||||
*(int32 *)ptr = res;
|
*(int32 *)ptr = res;
|
||||||
ptr += 4;
|
ptr += 4;
|
||||||
} else
|
} else
|
||||||
*(int32 *)(base + chunk->offset) = res;
|
*(int32 *)(base_ptr + chunk->offset) = res;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OC_VAR_I64:
|
case OC_VAR_I64:
|
||||||
@ -302,7 +303,7 @@ static bool LoadChunk(LoadgameState *ls, void *base, const OldChunks *chunks)
|
|||||||
*(int64 *)ptr = res;
|
*(int64 *)ptr = res;
|
||||||
ptr += 8;
|
ptr += 8;
|
||||||
} else
|
} else
|
||||||
*(int64 *)(base + chunk->offset) = res;
|
*(int64 *)(base_ptr + chunk->offset) = res;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user