diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-07-24 22:43:11 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-07-24 22:43:11 +0000 |
commit | 7b14b75626befe976530136bcf3158a16bd95df0 (patch) | |
tree | 9aefff9670d456ac7402074ffddb1a7f2d7b036d /Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc | |
parent | b7f40e4f685e941ac062cac36728a4cad0faab6c (diff) |
luatexdir: Sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@41755 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc b/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc index cc311daebee..9ad50c99aeb 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc +++ b/Build/source/texk/web2c/luatexdir/lua/lpdfscannerlib.cc @@ -105,17 +105,17 @@ static void clear_operand_stack (scannerdata *self, int from); static Token *_parseToken (scannerdata *self, int c); static void push_token (lua_State *L, scannerdata *self); -void *xmalloc (size_t size) +static void *priv_xmalloc (size_t size) { void *new_mem = (void *)malloc(size); if (new_mem == NULL) { - fprintf(stderr, "fatal: memory exhausted (xmalloc of %lu bytes).\n", (unsigned long)size); + fprintf(stderr, "fatal: memory exhausted (priv_xmalloc of %lu bytes).\n", (unsigned long)size); exit(1); } return new_mem; } -void *xrealloc (void *old_ptr, size_t size) +static void *priv_xrealloc (void *old_ptr, size_t size) { void *new_mem = (void *)realloc(old_ptr, size); if (new_mem == NULL) { @@ -125,12 +125,12 @@ void *xrealloc (void *old_ptr, size_t size) return new_mem; } -#define xreallocarray(ptr,type,size) ((type*)xrealloc(ptr,(size+1)*sizeof(type))) +#define xreallocarray(ptr,type,size) ((type*)priv_xrealloc(ptr,(size+1)*sizeof(type))) #define INITBUFSIZE 64 #define define_buffer(a) \ - char *a = (char *)xmalloc (INITBUFSIZE); \ + char *a = (char *)priv_xmalloc (INITBUFSIZE); \ int a##_size = INITBUFSIZE; \ int a##index = 0; \ memset (a,0,INITBUFSIZE) @@ -194,7 +194,7 @@ static void push_operand (scannerdata *self, Token *token) static Token * new_operand (pdf_token_type c) { - Token *token = (Token *)xmalloc(sizeof(Token)); + Token *token = (Token *)priv_xmalloc(sizeof(Token)); memset (token, 0, sizeof(Token)); token->type = c; return token; @@ -586,7 +586,7 @@ static int scanner_scan(lua_State * L) luaL_checktype(L, 3, LUA_TTABLE); self = scanner_push(L); memset(self,0,sizeof(scannerdata)); - self->_operandstack = (Token **)xmalloc (MAXOPERANDS * sizeof (Token)); + self->_operandstack = (Token **)priv_xmalloc (MAXOPERANDS * sizeof (Token)); memset (self->_operandstack,0,(MAXOPERANDS * sizeof (Token))); // 4 = self if (lua_type(L,1)== LUA_TTABLE) { @@ -598,7 +598,7 @@ static int scanner_scan(lua_State * L) uin = (udstruct *) luaL_checkudata(L, -1, M_Object); if (((Object *) uin->d)->isStream()) { ObjectList *rover = self->_streams; - ObjectList *item = (ObjectList *)xmalloc (sizeof(ObjectList)); + ObjectList *item = (ObjectList *)priv_xmalloc (sizeof(ObjectList)); item->stream = ((Object *) uin->d); item->next = NULL; if (!rover) { @@ -637,7 +637,7 @@ static int scanner_scan(lua_State * L) arrayref->get(i, val); if (val->isStream()) { ObjectList *rover = self->_streams; - ObjectList *item = (ObjectList *)xmalloc (sizeof(ObjectList)); + ObjectList *item = (ObjectList *)priv_xmalloc (sizeof(ObjectList)); item->stream = val; item->next = NULL; if (!rover) { |