summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2009-08-09 21:11:15 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2009-08-09 21:11:15 +0200
commita6def883e44695f8682edc208ebf1e97fb7c2370 (patch)
tree56f8cdd458496850e7c13bceda949ff6e1d57d4a
parentbcddbaf144b62862054b42e1949de15a815a3665 (diff)
Fixing code for dummy MSVC C89 compiler.
-rw-r--r--mpq-bios.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mpq-bios.c b/mpq-bios.c
index eeba42a..07518c0 100644
--- a/mpq-bios.c
+++ b/mpq-bios.c
@@ -476,13 +476,13 @@ int mpqlib_add_hash_entry_by_hash(struct mpq_archive_t * mpq_a, uint32_t h, uint
}
int mpqlib_add_hash_entry_by_name(struct mpq_archive_t * mpq_a, const char * name, uint16_t language, uint16_t platform, int entry) {
+ uint32_t h, hA, hB;
+
if (!mpq_a->for_write) {
__mpqlib_errno = MPQLIB_ERROR_READONLY;
return -1;
}
- uint32_t h, hA, hB;
-
h = mpqlib_hash_filename(name);
hA = mpqlib_hashA_filename(name);
hB = mpqlib_hashB_filename(name);
@@ -491,13 +491,13 @@ int mpqlib_add_hash_entry_by_name(struct mpq_archive_t * mpq_a, const char * nam
}
int mpqlib_update_hash_entry_by_hash(struct mpq_archive_t * mpq_a, uint32_t h, uint32_t hA, uint32_t hB, uint16_t language, uint16_t platform, int entry) {
+ hash_t * hash = mpqlib_locate_hash_entry(mpq_a, h, hA, hB, language, platform);
+
if (!mpq_a->for_write) {
__mpqlib_errno = MPQLIB_ERROR_READONLY;
return -1;
}
- hash_t * hash = mpqlib_locate_hash_entry(mpq_a, h, hA, hB, language, platform);
-
if (hash) {
hash->file_block_index = entry;
return 0;