[vlc-devel] [PATCH 1/2] Revert "contrib: use 32-bits LUAC file format on all platforms"

Rafaël Carré funman at videolan.org
Fri Feb 10 12:05:30 CET 2012


This reverts commit 01ec2d6e8c9347a0c8fec3db0937ef786a97910e.

Since luac file format is dependent on the build system's lua over
which we have no control, there is not point in making our luac
parser restricted to a specific file format.

Conflicts:

	contrib/src/lua/luac-32bits.patch
	contrib/src/lua/rules.mak
---
 contrib/src/lua/luac-32bits.patch |   98 -------------------------------------
 contrib/src/lua/rules.mak         |    1 -
 2 files changed, 0 insertions(+), 99 deletions(-)
 delete mode 100644 contrib/src/lua/luac-32bits.patch

diff --git a/contrib/src/lua/luac-32bits.patch b/contrib/src/lua/luac-32bits.patch
deleted file mode 100644
index cfdea55..0000000
--- a/contrib/src/lua/luac-32bits.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-diff -ru lua.orig/src/ldump.c lua/src/ldump.c
---- lua.orig/src/ldump.c	2011-12-14 19:26:18.000000000 +0200
-+++ lua/src/ldump.c	2011-12-14 19:49:20.000000000 +0200
-@@ -44,7 +44,8 @@
- 
- static void DumpInt(int x, DumpState* D)
- {
-- DumpVar(x,D);
-+ int32_t i = x;
-+ DumpVar(i,D);
- }
- 
- static void DumpNumber(lua_Number x, DumpState* D)
-@@ -62,12 +63,12 @@
- {
-  if (s==NULL || getstr(s)==NULL)
-  {
--  size_t size=0;
-+  uint32_t size=0;
-   DumpVar(size,D);
-  }
-  else
-  {
--  size_t size=s->tsv.len+1;		/* include trailing '\0' */
-+  uint32_t size=s->tsv.len+1;		/* include trailing '\0' */
-   DumpVar(size,D);
-   DumpBlock(getstr(s),size,D);
-  }
-diff -ru lua.orig/src/luaconf.h lua/src/luaconf.h
---- lua.orig/src/luaconf.h	2011-12-14 19:26:18.000000000 +0200
-+++ lua/src/luaconf.h	2011-12-14 19:54:25.000000000 +0200
-@@ -10,6 +10,8 @@
- 
- #include <limits.h>
- #include <stddef.h>
-+#include <stdint.h>
-+#include <sys/types.h>
- 
- 
- /*
-@@ -409,20 +411,12 @@
- ** part always works, but may waste space on machines with 64-bit
- ** longs.) Probably you do not need to change this.
- */
--#if LUAI_BITSINT >= 32
--#define LUAI_UINT32	unsigned int
--#define LUAI_INT32	int
--#define LUAI_MAXINT32	INT_MAX
-+
-+#define LUAI_UINT32	uint32_t
-+#define LUAI_INT32	int32_t
-+#define LUAI_MAXINT32	0x7fffffff
- #define LUAI_UMEM	size_t
--#define LUAI_MEM	ptrdiff_t
--#else
--/* 16-bit ints */
--#define LUAI_UINT32	unsigned long
--#define LUAI_INT32	long
--#define LUAI_MAXINT32	LONG_MAX
--#define LUAI_UMEM	unsigned long
--#define LUAI_MEM	long
--#endif
-+#define LUAI_MEM	ssize_t
- 
- 
- /*
-diff -ru lua.orig/src/lundump.c lua/src/lundump.c
---- lua.orig/src/lundump.c	2011-12-14 19:26:18.000000000 +0200
-+++ lua/src/lundump.c	2011-12-14 19:50:41.000000000 +0200
-@@ -60,7 +60,7 @@
- 
- static int LoadInt(LoadState* S)
- {
-- int x;
-+ int32_t x;
-  LoadVar(S,x);
-  IF (x<0, "bad integer");
-  return x;
-@@ -75,7 +75,7 @@
- 
- static TString* LoadString(LoadState* S)
- {
-- size_t size;
-+ uint32_t size;
-  LoadVar(S,size);
-  if (size==0)
-   return NULL;
-@@ -219,8 +219,8 @@
-  *h++=(char)LUAC_VERSION;
-  *h++=(char)LUAC_FORMAT;
-  *h++=(char)*(char*)&x;				/* endianness */
-- *h++=(char)sizeof(int);
-- *h++=(char)sizeof(size_t);
-+ *h++=(char)sizeof(int32_t);
-+ *h++=(char)sizeof(uint32_t);
-  *h++=(char)sizeof(Instruction);
-  *h++=(char)sizeof(lua_Number);
-  *h++=(char)(((lua_Number)0.5)==0);		/* is lua_Number integral? */
diff --git a/contrib/src/lua/rules.mak b/contrib/src/lua/rules.mak
index 765f4e2..9ab1ed6 100644
--- a/contrib/src/lua/rules.mak
+++ b/contrib/src/lua/rules.mak
@@ -32,7 +32,6 @@ $(TARBALLS)/lua-$(LUA_VERSION).tar.gz:
 lua: lua-$(LUA_VERSION).tar.gz .sum-lua
 	$(UNPACK)
 	$(APPLY) $(SRC)/lua/lua-noreadline.patch
-	$(APPLY) $(SRC)/lua/luac-32bits.patch
 	$(APPLY) $(SRC)/lua/no-localeconv.patch
 ifdef HAVE_MACOSX
 	(cd $(UNPACK_DIR) && \
-- 
1.7.9



More information about the vlc-devel mailing list