diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-10-16 06:46:57 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-10-16 06:46:57 +0000 |
commit | 6669de77431e0bb6548bdcbb13a6cf13f40b247f (patch) | |
tree | 5f374064a47b94ad9a7cbb8b3ce08305b7e58327 /src/map/script.c | |
parent | f87f36b82dbf7f907555fed2fdd8efab8f869ea6 (diff) | |
download | hercules-6669de77431e0bb6548bdcbb13a6cf13f40b247f.tar.gz hercules-6669de77431e0bb6548bdcbb13a6cf13f40b247f.tar.bz2 hercules-6669de77431e0bb6548bdcbb13a6cf13f40b247f.tar.xz hercules-6669de77431e0bb6548bdcbb13a6cf13f40b247f.zip |
* Changed function-like macros into inline functions where it seemed appropriate (topic:264007).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14976 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c index 6a5243f74..92ae852e9 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -171,8 +171,16 @@ enum { LABEL_NEXTLINE=1,LABEL_START }; static unsigned char* script_buf = NULL; static int script_pos = 0, script_size = 0; -#define GETVALUE(buf,i) ((int)MakeDWord(MakeWord((buf)[i],(buf)[i+1]),MakeWord((buf)[i+2],0))) -#define SETVALUE(buf,i,n) ((buf)[i]=GetByte(n,0),(buf)[i+1]=GetByte(n,1),(buf)[i+2]=GetByte(n,2)) +static inline int GETVALUE(const unsigned char* buf, int i) +{ + return (int)MakeDWord(MakeWord(buf[i], buf[i+1]), MakeWord(buf[i+2], 0)); +} +static inline void SETVALUE(unsigned char* buf, int i, int n) +{ + buf[i] = GetByte(n, 0); + buf[i+1] = GetByte(n, 1); + buf[i+2] = GetByte(n, 2); +} // String buffer structures. // str_data stores string information |