diff options
| author | Roberto I <roberto@inf.puc-rio.br> | 2025-10-31 14:48:55 -0300 |
|---|---|---|
| committer | Roberto I <roberto@inf.puc-rio.br> | 2025-10-31 14:48:55 -0300 |
| commit | f791bb69061c15f73395c5a95958ac18af5ef764 (patch) | |
| tree | cc3ecee14b9db4c6f91eb2e5979ec01fdaf57882 | |
| parent | d342328e5b24c9b3c6c5b33bfcf9f8534210b8e6 (diff) | |
| download | lua-f791bb69061c15f73395c5a95958ac18af5ef764.tar.gz lua-f791bb69061c15f73395c5a95958ac18af5ef764.tar.bz2 lua-f791bb69061c15f73395c5a95958ac18af5ef764.zip | |
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'.
| -rw-r--r-- | ltests.h | 7 | ||||
| -rw-r--r-- | lutf8lib.c | 1 | ||||
| -rw-r--r-- | lvm.c | 10 |
3 files changed, 10 insertions, 8 deletions
| @@ -142,12 +142,7 @@ LUA_API void *debug_realloc (void *ud, void *block, | |||
| 142 | #define STRCACHE_N 23 | 142 | #define STRCACHE_N 23 |
| 143 | #define STRCACHE_M 5 | 143 | #define STRCACHE_M 5 |
| 144 | 144 | ||
| 145 | 145 | #define MAXINDEXRK 1 | |
| 146 | /* | ||
| 147 | ** This one is not compatible with tests for opcode optimizations, | ||
| 148 | ** as it blocks some optimizations | ||
| 149 | #define MAXINDEXRK 0 | ||
| 150 | */ | ||
| 151 | 146 | ||
| 152 | 147 | ||
| 153 | /* | 148 | /* |
| @@ -10,7 +10,6 @@ | |||
| 10 | #include "lprefix.h" | 10 | #include "lprefix.h" |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | #include <assert.h> | ||
| 14 | #include <limits.h> | 13 | #include <limits.h> |
| 15 | #include <stdlib.h> | 14 | #include <stdlib.h> |
| 16 | #include <string.h> | 15 | #include <string.h> |
| @@ -373,6 +373,14 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key, | |||
| 373 | 373 | ||
| 374 | 374 | ||
| 375 | /* | 375 | /* |
| 376 | ** Function to be used for 0-terminated string order comparison | ||
| 377 | */ | ||
| 378 | #if !defined(l_strcoll) | ||
| 379 | #define l_strcoll strcoll | ||
| 380 | #endif | ||
| 381 | |||
| 382 | |||
| 383 | /* | ||
| 376 | ** Compare two strings 'ts1' x 'ts2', returning an integer less-equal- | 384 | ** Compare two strings 'ts1' x 'ts2', returning an integer less-equal- |
| 377 | ** -greater than zero if 'ts1' is less-equal-greater than 'ts2'. | 385 | ** -greater than zero if 'ts1' is less-equal-greater than 'ts2'. |
| 378 | ** The code is a little tricky because it allows '\0' in the strings | 386 | ** The code is a little tricky because it allows '\0' in the strings |
| @@ -386,7 +394,7 @@ static int l_strcmp (const TString *ts1, const TString *ts2) { | |||
| 386 | size_t rl2; | 394 | size_t rl2; |
| 387 | const char *s2 = getlstr(ts2, rl2); | 395 | const char *s2 = getlstr(ts2, rl2); |
| 388 | for (;;) { /* for each segment */ | 396 | for (;;) { /* for each segment */ |
| 389 | int temp = strcoll(s1, s2); | 397 | int temp = l_strcoll(s1, s2); |
| 390 | if (temp != 0) /* not equal? */ | 398 | if (temp != 0) /* not equal? */ |
| 391 | return temp; /* done */ | 399 | return temp; /* done */ |
| 392 | else { /* strings are equal up to a '\0' */ | 400 | else { /* strings are equal up to a '\0' */ |
