From 80692921f7ae8ec1ffad6aede7a36547662fb7e8 Mon Sep 17 00:00:00 2001 From: celest Date: Mon, 4 Apr 2005 15:08:47 +0000 Subject: some aesthetics changes ^^ git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1399 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/common/dll.h | 6 +++--- src/common/grfio.c | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/common/dll.h b/src/common/dll.h index ec6f8cbed..50854da4d 100644 --- a/src/common/dll.h +++ b/src/common/dll.h @@ -6,7 +6,7 @@ #include #define DLL_OPEN(x) LoadLibrary(x) - #define DLL_SYM(x,y,z) (FARPROC)x=GetProcAddress(y,z) + #define DLL_SYM(x,y,z) (FARPROC)(x) = GetProcAddress(y,z) #define DLL_CLOSE(x) FreeLibrary(x) #define DLL HINSTANCE @@ -14,9 +14,9 @@ #include #define DLL_OPEN(x) dlopen(x,RTLD_NOW) - #define DLL_SYM(x,y,z) x=(void *)dlsym(y,z) + #define DLL_SYM(x,y,z) (x) = (void *)dlsym(y,z) #define DLL_CLOSE(x) dlclose(x) - #define DLL void* + #define DLL void * #endif diff --git a/src/common/grfio.c b/src/common/grfio.c index ed01cf82e..1a3829bf7 100644 --- a/src/common/grfio.c +++ b/src/common/grfio.c @@ -25,11 +25,11 @@ #include #include -#include "utils.h" #include "grfio.h" -#include "mmo.h" -#include "showmsg.h" -#include "malloc.h" +#include "../common/utils.h" +#include "../common/mmo.h" +#include "../common/showmsg.h" +#include "../common/malloc.h" #ifdef _WIN32 #ifdef LOCALZLIB @@ -41,9 +41,9 @@ #define zlib_deflate deflate #define zlib_deflateEnd deflateEnd #else - #include #include "../lib/zlib_win32.h" - HINSTANCE zlib_dll; + #include "../common/dll.h" + DLL zlib_dll; #define zlib_inflateInit(strm) zlib_inflateInit_((strm),ZLIB_VERSION, sizeof(z_stream)) #define zlib_deflateInit(strm, level) zlib_deflateInit_((strm),(level),ZLIB_VERSION,sizeof(z_stream)) @@ -984,7 +984,7 @@ void grfio_final(void) #ifdef _WIN32 #ifndef LOCALZLIB - FreeLibrary(zlib_dll); + DLL_CLOSE(zlib_dll); zlib_inflateInit_ = NULL; zlib_inflate = NULL; zlib_inflateEnd = NULL; @@ -1006,13 +1006,13 @@ void grfio_init(char *fname) #ifdef _WIN32 #ifndef LOCALZLIB if(!zlib_dll) { - zlib_dll = LoadLibrary("zlib.dll"); - (FARPROC)zlib_inflateInit_ = GetProcAddress(zlib_dll,"inflateInit_"); - (FARPROC)zlib_inflate = GetProcAddress(zlib_dll,"inflate"); - (FARPROC)zlib_inflateEnd = GetProcAddress(zlib_dll,"inflateEnd"); - (FARPROC)zlib_deflateInit_ = GetProcAddress(zlib_dll,"deflateInit_"); - (FARPROC)zlib_deflate = GetProcAddress(zlib_dll,"deflate"); - (FARPROC)zlib_deflateEnd = GetProcAddress(zlib_dll,"deflateEnd"); + zlib_dll = DLL_OPEN ("zlib.dll"); + DLL_SYM (zlib_inflateInit_, zlib_dll, "inflateInit_"); + DLL_SYM (zlib_inflate, zlib_dll, "inflate"); + DLL_SYM (zlib_inflateEnd, zlib_dll, "inflateEnd"); + DLL_SYM (zlib_deflateInit_, zlib_dll, "deflateInit_"); + DLL_SYM (zlib_deflate, zlib_dll, "deflate"); + DLL_SYM (zlib_deflateEnd, zlib_dll, "deflateEnd"); if(zlib_dll == NULL) { MessageBox(NULL,"Can't load zlib.dll","grfio.c",MB_OK); exit(1); -- cgit v1.2.3-70-g09d2