unify types

This commit is contained in:
Pawel Kolodziejski
2008-07-20 21:08:22 +00:00
parent a7d3c58fe4
commit f9d1af02fb
43 changed files with 814 additions and 928 deletions
+9 -11
View File
@@ -5,8 +5,6 @@
*/
#include <stdio.h>
#include "lauxlib.h"
#include "lmem.h"
#include "lstate.h"
@@ -20,10 +18,10 @@
#define openspace(size) if (L->Mbuffnext+(size) > L->Mbuffsize) Openspace(size)
static void Openspace (int size)
static void Openspace (int32 size)
{
lua_State *l = L; /* to optimize */
int base = l->Mbuffbase-l->Mbuffer;
int32 base = l->Mbuffbase-l->Mbuffer;
l->Mbuffsize *= 2;
if (l->Mbuffnext+size > l->Mbuffsize) /* still not big enough? */
l->Mbuffsize = l->Mbuffnext+size;
@@ -32,14 +30,14 @@ static void Openspace (int size)
}
char *luaL_openspace (int size)
char *luaL_openspace (int32 size)
{
openspace(size);
return L->Mbuffer+L->Mbuffnext;
}
void luaL_addchar (int c)
void luaL_addchar (int32 c)
{
openspace(BUFF_STEP);
L->Mbuffer[L->Mbuffnext++] = c;
@@ -52,26 +50,26 @@ void luaL_resetbuffer (void)
}
void luaL_addsize (int n)
void luaL_addsize (int32 n)
{
L->Mbuffnext += n;
}
int luaL_getsize (void)
int32 luaL_getsize (void)
{
return L->Mbuffnext-(L->Mbuffbase-L->Mbuffer);
}
int luaL_newbuffer (int size)
int32 luaL_newbuffer (int32 size)
{
int old = L->Mbuffbase-L->Mbuffer;
int32 old = L->Mbuffbase-L->Mbuffer;
openspace(size);
L->Mbuffbase = L->Mbuffer+L->Mbuffnext;
return old;
}
void luaL_oldbuffer (int old)
void luaL_oldbuffer (int32 old)
{
L->Mbuffnext = L->Mbuffbase-L->Mbuffer;
L->Mbuffbase = L->Mbuffer+old;