Jelajahi Sumber

Details

A few details in the makefile and in the manual. (In particular,
it updates the dependency lists in the makefile.)
Roberto Ierusalimschy 6 tahun lalu
induk
melakukan
af6d9f3116
3 mengubah file dengan 22 tambahan dan 20 penghapusan
  1. 2 1
      ltests.c
  2. 12 11
      makefile
  3. 8 8
      manual/manual.of

+ 2 - 1
ltests.c

@@ -156,7 +156,8 @@ void *debug_realloc (void *ud, void *b, size_t oldsize, size_t size) {
     size_t realsize = sizeof(Header) + size + MARKSIZE;
     size_t realsize = sizeof(Header) + size + MARKSIZE;
     if (realsize < size) return NULL;  /* arithmetic overflow! */
     if (realsize < size) return NULL;  /* arithmetic overflow! */
     newblock = cast(Header *, malloc(realsize));  /* alloc a new block */
     newblock = cast(Header *, malloc(realsize));  /* alloc a new block */
-    if (newblock == NULL) return NULL;  /* really out of memory? */
+    if (newblock == NULL)
+      return NULL;  /* really out of memory? */
     if (block) {
     if (block) {
       memcpy(newblock + 1, block + 1, commonsize);  /* copy old contents */
       memcpy(newblock + 1, block + 1, commonsize);  /* copy old contents */
       freeblock(mc, block);  /* erase (and check) old copy */
       freeblock(mc, block);  /* erase (and check) old copy */

+ 12 - 11
makefile

@@ -14,10 +14,11 @@ CWARNSCPP= \
 	-Wredundant-decls \
 	-Wredundant-decls \
 	-Wdisabled-optimization \
 	-Wdisabled-optimization \
 	-Wdouble-promotion \
 	-Wdouble-promotion \
- 	-Wstrict-aliasing=3 \
- 	-Wno-aggressive-loop-optimizations \
- 	-Wlogical-op \
-	-Werror \
+	#-Wno-aggressive-loop-optimizations \
+	#-Wlogical-op \
+	#-Wfatal-errors \
+	#-Wstrict-aliasing=3 \
+	# -Werror \
 	# -pedantic   # warns if we use jump tables \
 	# -pedantic   # warns if we use jump tables \
 	# the next warnings generate too much noise, so they are disabled
 	# the next warnings generate too much noise, so they are disabled
 	# -Wconversion  -Wno-sign-conversion \
 	# -Wconversion  -Wno-sign-conversion \
@@ -39,6 +40,7 @@ CWARNS= $(CWARNSCPP) $(CWARNSC)
 
 
 
 
 # -DEXTERNMEMCHECK -DHARDSTACKTESTS -DHARDMEMTESTS -DTRACEMEM='"tempmem"'
 # -DEXTERNMEMCHECK -DHARDSTACKTESTS -DHARDMEMTESTS -DTRACEMEM='"tempmem"'
+# -DMAXINDEXRK=1
 # -g -DLUA_USER_H='"ltests.h"'
 # -g -DLUA_USER_H='"ltests.h"'
 # -pg -malign-double
 # -pg -malign-double
 # -DLUA_USE_CTYPE -DLUA_USE_APICHECK
 # -DLUA_USE_CTYPE -DLUA_USE_APICHECK
@@ -50,7 +52,6 @@ TESTS= -DLUA_USER_H='"ltests.h"' -O0
 # LOCAL = $(TESTS) $(CWARNS) -g
 # LOCAL = $(TESTS) $(CWARNS) -g
 
 
 
 
-
 # enable Linux goodies
 # enable Linux goodies
 MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX -DLUA_USE_READLINE
 MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX -DLUA_USE_READLINE
 MYLDFLAGS= $(LOCAL) -Wl,-E
 MYLDFLAGS= $(LOCAL) -Wl,-E
@@ -58,7 +59,7 @@ MYLIBS= -ldl -lreadline
 
 
 
 
 CC= gcc
 CC= gcc
-CFLAGS= -Wall -O2 $(MYCFLAGS) -Wfatal-errors -fno-stack-protector -fno-common
+CFLAGS= -Wall -O2 $(MYCFLAGS) -fno-stack-protector -fno-common -march=native
 AR= ar rc
 AR= ar rc
 RANLIB= ranlib
 RANLIB= ranlib
 RM= rm -f
 RM= rm -f
@@ -122,7 +123,7 @@ echo:
 	@echo "MYLIBS = $(MYLIBS)"
 	@echo "MYLIBS = $(MYLIBS)"
 	@echo "DL = $(DL)"
 	@echo "DL = $(DL)"
 
 
-$(ALL_O): makefile
+$(ALL_O): makefile ltests.h
 
 
 # DO NOT EDIT
 # DO NOT EDIT
 # automatically made with 'gcc -MM l*.c'
 # automatically made with 'gcc -MM l*.c'
@@ -146,8 +147,8 @@ ldo.o: ldo.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
  lparser.h lstring.h ltable.h lundump.h lvm.h
  lparser.h lstring.h ltable.h lundump.h lvm.h
 ldump.o: ldump.c lprefix.h lua.h luaconf.h lobject.h llimits.h lstate.h \
 ldump.o: ldump.c lprefix.h lua.h luaconf.h lobject.h llimits.h lstate.h \
  ltm.h lzio.h lmem.h lundump.h
  ltm.h lzio.h lmem.h lundump.h
-lfunc.o: lfunc.c lprefix.h lua.h luaconf.h lfunc.h lobject.h llimits.h \
- lgc.h lstate.h ltm.h lzio.h lmem.h
+lfunc.o: lfunc.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
+ llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h
 lgc.o: lgc.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
 lgc.o: lgc.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
  llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h
  llimits.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h
 linit.o: linit.c lprefix.h lua.h luaconf.h lualib.h lauxlib.h
 linit.o: linit.c lprefix.h lua.h luaconf.h lualib.h lauxlib.h
@@ -178,8 +179,8 @@ ltable.o: ltable.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
 ltablib.o: ltablib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
 ltablib.o: ltablib.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
 ltests.o: ltests.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
 ltests.o: ltests.c lprefix.h lua.h luaconf.h lapi.h llimits.h lstate.h \
  lobject.h ltm.h lzio.h lmem.h lauxlib.h lcode.h llex.h lopcodes.h \
  lobject.h ltm.h lzio.h lmem.h lauxlib.h lcode.h llex.h lopcodes.h \
- lparser.h lctype.h ldebug.h ldo.h lfunc.h lstring.h lgc.h ltable.h \
- lualib.h
+ lparser.h lctype.h ldebug.h ldo.h lfunc.h lopnames.h lstring.h lgc.h \
+ ltable.h lualib.h
 ltm.o: ltm.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
 ltm.o: ltm.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
  llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h lstring.h ltable.h lvm.h
  llimits.h ltm.h lzio.h lmem.h ldo.h lgc.h lstring.h ltable.h lvm.h
 lua.o: lua.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h
 lua.o: lua.c lprefix.h lua.h luaconf.h lauxlib.h lualib.h

+ 8 - 8
manual/manual.of

@@ -1027,8 +1027,7 @@ Any kind of end-of-line sequence
 or newline followed by carriage return)
 or newline followed by carriage return)
 is converted to a simple newline.
 is converted to a simple newline.
 
 
-For convenience,
-when the opening long bracket is immediately followed by a newline,
+When the opening long bracket is immediately followed by a newline,
 the newline is not included in the string.
 the newline is not included in the string.
 As an example, in a system using ASCII
 As an example, in a system using ASCII
 (in which @Char{a} is coded @N{as 97},
 (in which @Char{a} is coded @N{as 97},
@@ -1048,7 +1047,7 @@ alo
 Any byte in a literal string not
 Any byte in a literal string not
 explicitly affected by the previous rules represents itself.
 explicitly affected by the previous rules represents itself.
 However, Lua opens files for parsing in text mode,
 However, Lua opens files for parsing in text mode,
-and the system file functions may have problems with
+and the system's file functions may have problems with
 some control characters.
 some control characters.
 So, it is safer to represent
 So, it is safer to represent
 non-text data as a quoted literal with
 non-text data as a quoted literal with
@@ -1782,19 +1781,19 @@ These operators always result in @false or @true.
 Equality (@T{==}) first compares the type of its operands.
 Equality (@T{==}) first compares the type of its operands.
 If the types are different, then the result is @false.
 If the types are different, then the result is @false.
 Otherwise, the values of the operands are compared.
 Otherwise, the values of the operands are compared.
-Strings are compared in the obvious way.
+Strings are equal if they have the same content.
 Numbers are equal if they denote the same mathematical value.
 Numbers are equal if they denote the same mathematical value.
 
 
 Tables, userdata, and threads
 Tables, userdata, and threads
 are compared by reference:
 are compared by reference:
 two objects are considered equal only if they are the same object.
 two objects are considered equal only if they are the same object.
 Every time you create a new object
 Every time you create a new object
-(a table, userdata, or thread),
+(a table, a userdata, or a thread),
 this new object is different from any previously existing object.
 this new object is different from any previously existing object.
-A closure is always equal to itself.
-Closures with any detectable difference
+A function is always equal to itself.
+Functions with any detectable difference
 (different behavior, different definition) are always different.
 (different behavior, different definition) are always different.
-Closures created at different times but with no detectable differences
+Functions created at different times but with no detectable differences
 may be classified as equal or not
 may be classified as equal or not
 (depending on internal cashing details).
 (depending on internal cashing details).
 
 
@@ -4324,6 +4323,7 @@ The unsigned version of @Lid{lua_Integer}.
 
 
 Returns the pseudo-index that represents the @id{i}-th upvalue of
 Returns the pseudo-index that represents the @id{i}-th upvalue of
 the running function @see{c-closure}.
 the running function @see{c-closure}.
+@id{i} must be in the range @M{[1,256]}.
 
 
 }
 }