summaryrefslogtreecommitdiff
path: root/src/tool/grfio.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-09 02:27:16 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-09 02:27:16 +0000
commit93d279cdfdd0317c31bc21852fd06a066bac7508 (patch)
treec4646b44ce25d0c0de8bd0cd891ab722d52fc4cf /src/tool/grfio.c
parente7beef1499ae660af01f163a16b9040bd60d8845 (diff)
downloadhercules-93d279cdfdd0317c31bc21852fd06a066bac7508.tar.gz
hercules-93d279cdfdd0317c31bc21852fd06a066bac7508.tar.bz2
hercules-93d279cdfdd0317c31bc21852fd06a066bac7508.tar.xz
hercules-93d279cdfdd0317c31bc21852fd06a066bac7508.zip
- Took care of all the warnings in grfio and mapcache.
- Mapcache can run on system with any endianness. The generated file contains data in little endian. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9980 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/tool/grfio.c')
-rw-r--r--src/tool/grfio.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tool/grfio.c b/src/tool/grfio.c
index 2fa48a2a1..19a9daa49 100644
--- a/src/tool/grfio.c
+++ b/src/tool/grfio.c
@@ -31,7 +31,6 @@
#include <sys/stat.h>
#include "grfio.h"
-#include "../common/mmo.h"
#include "../zlib/unzip.h"
#define CHUNK 16384
@@ -54,13 +53,13 @@ static char data_dir[1024] = ""; // "../";
//----------------------------
// file entry table struct
//----------------------------
-typedef struct {
+typedef struct _FILELIST {
int srclen; // compressed size
int srclen_aligned; //
int declen; // original size
int srcpos;
- short next;
- int cycle;
+ int next;
+ int cycle;
char type;
char fn[128-4*5]; // file name
char *fnd;
@@ -219,7 +218,7 @@ static void decode_des_etc(BYTE *buf,int len,int type,int cycle)
BitConvert(buf,BitSwapTable2);
} else {
if(cnt==7 && type==0){
- int a;
+ BYTE a;
BYTE tmp[8];
*(DWORD*)tmp = *(DWORD*)buf;
*(DWORD*)(tmp+4) = *(DWORD*)(buf+4);
@@ -599,7 +598,7 @@ void* grfio_reads(char *fname, int *size)
decode_des_etc(buf, entry->srclen_aligned, entry->cycle == 0, entry->cycle);
len = entry->declen;
decode_zip(buf2, &len, buf, entry->srclen);
- if (len != entry->declen) {
+ if (len != (uLong)entry->declen) {
printf("decode_zip size mismatch err: %d != %d\n", (int)len, entry->declen);
free(buf);
free(buf2);
@@ -679,7 +678,8 @@ static int grfio_entryread(char *gfname,int gentry)
// Get an entry
for (entry = 0,ofs = 0; entry < entrys; entry++) {
- int ofs2, srclen, srccount, type;
+ int ofs2, srclen, srccount;
+ unsigned char type;
char *period_ptr;
FILELIST aentry;
@@ -764,7 +764,7 @@ static int grfio_entryread(char *gfname,int gentry)
exit(1);
}
//ofs2 = ofs+strlen((char*)(grf_filelist+ofs))+1;
- ofs2 = ofs + strlen(fname)+1;
+ ofs2 = ofs + (int)strlen(fname)+1;
type = grf_filelist[ofs2+12];
if (type == 1 || type == 3 || type == 5) {
srclen = getlong(grf_filelist+ofs2);
@@ -896,7 +896,7 @@ static int grfio_add(char *fname)
char *grfio_alloc_ptr(char *fname)
{
- int len;
+ size_t len;
char *buf;
if (gentry_entrys >= GENTRY_LIMIT) {