nhmall
f9d22e02cd
lev_main's own internal case-insensitive compare
...
TEST SUITE
int case_insensitive_comp(const char *, const char *);
/* define your built-in compiler library variation here */
/* #define BUILTIN(a,b) strcasecmp(a,b) */
/* #define BUILTIN(a,b) stricmp(a,b) */
int main(int argc, char *argv[])
{
const char *t1 = "NetHack";
const char *t2 = "nethack";
const char *t3 = "Fred";
const char *t4 = "Barney lived next door";
/* try the results with built-in strcmpi first */
printf("builtin:\tcompare <%s> to <%s>, result %d.\n",
t1, t2, BUILTIN(t1,t2));
printf("builtin:\tcompare <%s> to <%s>, result %d.\n",
t3, t4, BUILTIN(t3,t4));
/* try the results with case_insensitive_comp 2nd */
printf("ours:\tcompare <%s> to <%s>, result %d.\n",
t1, t2, case_insensitive_comp(t1,t2));
printf("ours:\tcompare <%s> to <%s>, result %d.\n",
t3, t4, case_insensitive_comp(t3,t4));
}
int
case_insensitive_comp(s1, s2)
const char *s1;
const char *s2;
{
unsigned char u1, u2;
for ( ; ; s1++, s2++) {
u1 = tolower((unsigned char) *s1);
u2 = tolower((unsigned char) *s2);
if ((u1 == '\0') || (u1 != u2)) {
break;
}
}
return u1-u2;
}
======================== END TEST SUITE ===========================
2015-03-24 19:25:45 +02:00
nhmall
c49dbcc5b3
include this also
2015-03-24 19:16:29 +02:00
nhmall
4c2df285b4
an easy fix for strcmpi and we move on
...
Here in branch paxed-new_lev_comp-B (branched
from paxed-new_lev_comp) is a simple fix
for the strcmpi issue.
The bottom section of lev_main.c has a bunch
of forced linkages to names from NetHack etc.
#ifdef STRICT_REF_DEF
bunch of stuff
#endif
This change to lev_main should make everything
work for those that don't supply a compiler
library version of strcmpi()
With this patch, those people can just
add a -DSTRICT_REF_DEF to their compile line
for lev_main.c.
This would close the issue in a simple way,
and doesn't require linking in anything new to
the level compiler, or modifying any port's Makefiles etc.
2015-03-24 19:06:01 +02:00
Pasi Kallinen
debdf7ca48
Move some hard-coded string arrays into data files.
...
Random epitaphs, engravings and hallucinatory monsters now
live in text data files.
2015-03-18 22:05:10 +02:00
Pasi Kallinen
56699486a0
Catch up with post-343 lev_comp changes
...
- Iced pools vs. iced moats
- allow making map outer edges nonpasswall & nondiggable,
so eg. xorns cannot be teleported there
2015-03-17 18:57:39 +02:00
Pasi Kallinen
c9d5bb9d68
Fix some level flags, sokoban premapping
2015-03-17 18:52:53 +02:00
Pasi Kallinen
47bb9abace
New level compiler: code changes
2015-03-17 18:52:42 +02:00
keni
c5bc6a5268
Manually fix botched NHDT-Branch expansions.
2015-03-17 18:46:55 +02:00
Pasi Kallinen
d67ffd179a
Remove useless dungeon.def mangling
2015-03-17 18:46:54 +02:00
Pasi Kallinen
56279a9950
Add new parameters to makedefs: --debug and --make
...
"makedefs --debug --make q" is equivalent to "makedefs -q" with
DEBUG defined.
2015-03-17 18:46:52 +02:00
Sean Hunt
07da4a740e
Fix some warnings on the unconditionals branch.
2015-03-17 18:46:48 +02:00
Sean Hunt
fb46fed99d
Make EXP_ON_BOTL unconditional.
2015-03-17 18:46:44 +02:00
Sean Hunt
f27d319e68
Make REDO unconditional.
2015-03-17 18:46:41 +02:00
Sean Hunt
3481ec6589
Make AUTOPICKUP_EXCEPTIONS unconditional.
2015-03-17 18:46:37 +02:00
Sean Hunt
8798197d85
Make BARGETHROUGH unconditional.
2015-03-17 18:46:35 +02:00
Sean Hunt
dcc2f8ba93
Make SEDUCE unconditional.
2015-03-17 18:46:32 +02:00
Sean Hunt
05f7a63728
Make GOLDOBJ unconditional.
2015-03-17 18:46:23 +02:00
Sean Hunt
cc7ab4a2da
Make WIZARD unconditional.
2015-03-17 18:46:17 +02:00
Sean Hunt
eca41ae060
Make DUNGEON_OVERVIEW unconditional.
2015-03-17 18:46:12 +02:00
Sean Hunt
ffd201495c
Make REINCARNATION unconditional.
...
There is a lot of code affected by this, and Pat Rankin correctly
observes that it would be better to store roguelike as a level flag
rather than just using Is_rogue_level. A note for the future.
2015-03-17 18:46:08 +02:00
Sean Hunt
bb647dc33c
Make TOURIST unconditional.
2015-03-17 18:46:01 +02:00
Sean Hunt
44ca9fc16a
Make SINKS unconditional.
2015-03-17 18:45:58 +02:00
Sean Hunt
161070ce56
Make KOPS unconditional.
2015-03-17 18:45:56 +02:00
Sean Hunt
9759f5bf6d
Make STEED unconditional.
2015-03-17 18:45:49 +02:00
Sean Hunt
aba6ecb7b3
Make ELBERETH unconditional.
2015-03-17 18:45:45 +02:00
keni
414aea7517
Update .gitignore files.
2015-03-17 18:45:42 +02:00
keni
25cd007c48
Bulk recovery of file CVS headers and addition of NHDT- headers.
2015-03-17 18:45:12 +02:00
keni
485173626a
Convert mdgrep from cvs to git.
2015-03-17 18:44:54 +02:00
keni
8ac52b247a
Set up mdgrep for git instead of cvs.
2015-03-17 18:44:53 +02:00
keni
6fd30ab1ce
Manually fix botched NHDT-Branch expansions.
2015-03-01 20:32:28 -05:00
Pasi Kallinen
d7c9abe0f8
Remove useless dungeon.def mangling
2015-03-01 14:33:03 +02:00
Derek S. Ray
b1a7bbbbdb
pull in the recent unconditionals merge from master
2015-02-27 21:25:00 -05:00
Pasi Kallinen
b7537e0fbf
Add new parameters to makedefs: --debug and --make
...
"makedefs --debug --make q" is equivalent to "makedefs -q" with
DEBUG defined.
2015-02-27 19:34:34 -05:00
Sean Hunt
17ea9ff9ab
Fix some warnings on the unconditionals branch.
2015-02-27 19:34:31 -05:00
Sean Hunt
7c09285a8c
Make EXP_ON_BOTL unconditional.
2015-02-27 19:34:26 -05:00
Sean Hunt
0001534d04
Make REDO unconditional.
2015-02-27 19:33:52 -05:00
Sean Hunt
74e741bbbc
Make AUTOPICKUP_EXCEPTIONS unconditional.
2015-02-27 19:33:50 -05:00
Sean Hunt
b138d380ea
Make BARGETHROUGH unconditional.
2015-02-27 19:33:48 -05:00
Sean Hunt
6e9fa71b05
Make SEDUCE unconditional.
2015-02-27 19:33:48 -05:00
Sean Hunt
ac108cd365
Make GOLDOBJ unconditional.
2015-02-27 19:33:40 -05:00
Sean Hunt
4f59f5c6fd
Make WIZARD unconditional.
2015-02-27 19:33:22 -05:00
Sean Hunt
ad82ca80f3
Make DUNGEON_OVERVIEW unconditional.
2015-02-27 19:33:20 -05:00
Sean Hunt
1edadd1d48
Make REINCARNATION unconditional.
...
There is a lot of code affected by this, and Pat Rankin correctly
observes that it would be better to store roguelike as a level flag
rather than just using Is_rogue_level. A note for the future.
2015-02-27 19:33:16 -05:00
Sean Hunt
260f7ea860
Make TOURIST unconditional.
2015-02-27 19:33:12 -05:00
Sean Hunt
5ee71d2757
Make SINKS unconditional.
2015-02-27 19:33:06 -05:00
Sean Hunt
b066b7c170
Make KOPS unconditional.
2015-02-27 19:33:04 -05:00
Sean Hunt
9e65758947
Make STEED unconditional.
2015-02-27 19:33:01 -05:00
Sean Hunt
264dc66129
Make ELBERETH unconditional.
2015-02-27 19:32:53 -05:00
keni
b598c83767
Update .gitignore files.
2015-02-26 16:35:55 -05:00
keni
03140969ee
Bulk recovery of file CVS headers and addition of NHDT- headers.
2015-02-26 09:19:03 -05:00