Просмотр исходного кода

Details

- New macro l_strcoll to ease changing 'strcoll' to something else.
- MAXINDEXRK==1 in 'ltests.h' is enough to run test 'code.lua'.
- Removed unused '#include' in 'lutf8lib.c'.
Roberto I 2 месяцев назад
Родитель
Сommit
f791bb6906
3 измененных файлов с 10 добавлено и 8 удалено
  1. 1 6
      ltests.h
  2. 0 1
      lutf8lib.c
  3. 9 1
      lvm.c

+ 1 - 6
ltests.h

@@ -142,12 +142,7 @@ LUA_API void *debug_realloc (void *ud, void *block,
 #define STRCACHE_N	23
 #define STRCACHE_M	5
 
-
-/*
-** This one is not compatible with tests for opcode optimizations,
-** as it blocks some optimizations
-#define MAXINDEXRK	0
-*/
+#define MAXINDEXRK	1
 
 
 /*

+ 0 - 1
lutf8lib.c

@@ -10,7 +10,6 @@
 #include "lprefix.h"
 
 
-#include <assert.h>
 #include <limits.h>
 #include <stdlib.h>
 #include <string.h>

+ 9 - 1
lvm.c

@@ -372,6 +372,14 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
 }
 
 
+/*
+** Function to be used for 0-terminated string order comparison
+*/
+#if !defined(l_strcoll)
+#define l_strcoll	strcoll
+#endif
+
+
 /*
 ** Compare two strings 'ts1' x 'ts2', returning an integer less-equal-
 ** -greater than zero if 'ts1' is less-equal-greater than 'ts2'.
@@ -386,7 +394,7 @@ static int l_strcmp (const TString *ts1, const TString *ts2) {
   size_t rl2;
   const char *s2 = getlstr(ts2, rl2);
   for (;;) {  /* for each segment */
-    int temp = strcoll(s1, s2);
+    int temp = l_strcoll(s1, s2);
     if (temp != 0)  /* not equal? */
       return temp;  /* done */
     else {  /* strings are equal up to a '\0' */