summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--trunk/source/dungeon.cc10
-rw-r--r--trunk/source/files.cc10
-rw-r--r--trunk/source/itemname.cc25
-rw-r--r--trunk/source/itemname.h4
-rw-r--r--trunk/source/liblinux.cc224
-rw-r--r--trunk/source/libutil.cc3
-rw-r--r--trunk/source/makefile7
-rw-r--r--trunk/source/makefile.osx13
-rw-r--r--trunk/source/mon-util.cc4
-rw-r--r--trunk/source/mon-util.h4
-rw-r--r--trunk/source/mutation.cc10
-rw-r--r--trunk/source/mutation.h6
-rw-r--r--trunk/source/ouch.cc5
-rw-r--r--trunk/source/religion.cc26
-rw-r--r--trunk/source/skills2.cc4
-rw-r--r--trunk/source/skills2.h4
-rw-r--r--trunk/source/spells2.cc4
-rw-r--r--trunk/source/spells2.h4
-rw-r--r--trunk/source/spl-cast.cc5
19 files changed, 206 insertions, 166 deletions
diff --git a/trunk/source/dungeon.cc b/trunk/source/dungeon.cc
index c899daa7dc..ce002f21d2 100644
--- a/trunk/source/dungeon.cc
+++ b/trunk/source/dungeon.cc
@@ -3,6 +3,8 @@
* Summary: Functions used when building new levels.
* Written by: Linley Henzell
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
*
@@ -5143,8 +5145,8 @@ static void build_vaults(int level_number, int force_vault)
RANDOM_MONSTER,
RANDOM_MONSTER);
- char roomsss = 10 + random2(90);
- char which_room = 0;
+ int roomsss = 10 + random2(90);
+ int which_room = 0;
bool exclusive = (one_chance_in(10) ? false : true);
@@ -6947,14 +6949,14 @@ static char plan_3(void)
*/
int i;
char cnx, cny;
- char roomsss = 30 + random2(90);
+ int roomsss = 30 + random2(90);
bool exclusive = (one_chance_in(10) ? false : true);
bool exclusive2 = coinflip();
char romx1[30], romy1[30], romx2[30], romy2[30];
- char which_room = 0;
+ int which_room = 0;
for (i = 0; i < roomsss; i++)
{
diff --git a/trunk/source/files.cc b/trunk/source/files.cc
index 65fb795e60..56fc9bfd78 100644
--- a/trunk/source/files.cc
+++ b/trunk/source/files.cc
@@ -3,6 +3,8 @@
* Summary: Functions used to save and load levels/games.
* Written by: Linley Henzell and Alexey Guzeev
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
* <7> 19 June 2000 GDL Change handle to FILE *
@@ -461,8 +463,8 @@ void load( unsigned char stair_taken, int load_mode, bool was_a_labyrinth,
// BEGIN -- must load the old level : pre-load tasks
// LOAD various tags
- char majorVersion;
- char minorVersion;
+ char majorVersion = 0;
+ char minorVersion = 0;
if (!determine_level_version( levelFile, majorVersion, minorVersion ))
{
@@ -1122,8 +1124,8 @@ void restore_game(void)
end(-1);
}
- char majorVersion;
- char minorVersion;
+ char majorVersion = 0;
+ char minorVersion = 0;
if (!determine_version(restoreFile, majorVersion, minorVersion))
{
diff --git a/trunk/source/itemname.cc b/trunk/source/itemname.cc
index 98737c7896..5ca8a4d7f0 100644
--- a/trunk/source/itemname.cc
+++ b/trunk/source/itemname.cc
@@ -3,6 +3,8 @@
* Summary: Misc functions.
* Written by: Linley Henzell
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
* <4> 9/09/99 BWR Added hands_required function
@@ -2082,7 +2084,7 @@ static char item_name_2( const item_def &item, char buff[ITEMNAME_SIZE],
void save_id(char identy[4][50])
{
- char x = 0, jx = 0;
+ int x = 0, jx = 0;
for (x = 0; x < 4; x++)
{
@@ -2096,7 +2098,7 @@ void save_id(char identy[4][50])
void clear_ids(void)
{
- char i = 0, j = 0;
+ int i = 0, j = 0;
for (i = 0; i < 4; i++)
{
@@ -2109,7 +2111,7 @@ void clear_ids(void)
} // end clear_ids()
-void set_ident_type( char cla, char ty, char setting, bool force )
+void set_ident_type( char cla, int ty, char setting, bool force )
{
// Don't allow overwriting of known type with tried unless forced.
if (!force
@@ -2142,7 +2144,7 @@ void set_ident_type( char cla, char ty, char setting, bool force )
}
} // end set_ident_type()
-char get_ident_type(char cla, char ty)
+char get_ident_type(char cla, int ty)
{
switch (cla)
{
@@ -2871,12 +2873,10 @@ void make_name(unsigned char var1, unsigned char var2, unsigned char var3,
{
char name[ ITEMNAME_SIZE ] = "";
FixedVector < unsigned char, 15 > numb;
- char len;
- char i = 0;
- char nexty = 0;
- char j = 0;
- char igo = 0;
-
+ int len;
+ int i = 0;
+ int nexty = 0;
+ int j = 0;
int x = 0;
numb[0] = var1 * var2;
@@ -2953,11 +2953,10 @@ void make_name(unsigned char var1, unsigned char var2, unsigned char var3,
goto two_letter;
else
name[i] = numb[j];
-
- hello:
- igo++;
}
+ hello:
+
if ((nexty == 0 && is_random_name_vowel(name[i]))
|| (nexty == 1 && !is_random_name_vowel(name[i])))
{
diff --git a/trunk/source/itemname.h b/trunk/source/itemname.h
index 63a606440d..91f649e641 100644
--- a/trunk/source/itemname.h
+++ b/trunk/source/itemname.h
@@ -19,7 +19,7 @@ bool is_vowel( const char chr );
/* ***********************************************************************
* called from: describe - effects - item_use - shopping
* *********************************************************************** */
-char get_ident_type(char cla, char ty);
+char get_ident_type(char cla, int ty);
/* ***********************************************************************
@@ -144,7 +144,7 @@ void save_id(char identy[4][50]);
/* ***********************************************************************
* called from: files - item_use - newgame - ouch - shopping - spells1
* *********************************************************************** */
-void set_ident_type( char cla, char ty, char setting, bool force = false );
+void set_ident_type( char cla, int ty, char setting, bool force = false );
/* ***********************************************************************
diff --git a/trunk/source/liblinux.cc b/trunk/source/liblinux.cc
index 01d8db3194..64907bc1fb 100644
--- a/trunk/source/liblinux.cc
+++ b/trunk/source/liblinux.cc
@@ -3,6 +3,8 @@
* Summary: Functions for linux, unix, and curses support
* Written by: ?
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
* <6> 10/11/99 BCR Swapped 'v' and 'V' commands, fixed
@@ -225,137 +227,137 @@ void init_key_to_command()
}
// lower case
- key_to_command_table['a'] = CMD_USE_ABILITY;
- key_to_command_table['b'] = CMD_MOVE_DOWN_LEFT;
- key_to_command_table['c'] = CMD_CLOSE_DOOR;
- key_to_command_table['d'] = CMD_DROP;
- key_to_command_table['e'] = CMD_EAT;
- key_to_command_table['f'] = CMD_FIRE;
- key_to_command_table['g'] = CMD_PICKUP;
- key_to_command_table['h'] = CMD_MOVE_LEFT;
- key_to_command_table['i'] = CMD_DISPLAY_INVENTORY;
- key_to_command_table['j'] = CMD_MOVE_DOWN;
- key_to_command_table['k'] = CMD_MOVE_UP;
- key_to_command_table['l'] = CMD_MOVE_RIGHT;
- key_to_command_table['m'] = CMD_DISPLAY_SKILLS;
- key_to_command_table['n'] = CMD_MOVE_DOWN_RIGHT;
- key_to_command_table['o'] = CMD_OPEN_DOOR;
- key_to_command_table['p'] = CMD_PRAY;
- key_to_command_table['q'] = CMD_QUAFF;
- key_to_command_table['r'] = CMD_READ;
- key_to_command_table['s'] = CMD_SEARCH;
- key_to_command_table['t'] = CMD_THROW;
- key_to_command_table['u'] = CMD_MOVE_UP_RIGHT;
- key_to_command_table['v'] = CMD_EXAMINE_OBJECT;
- key_to_command_table['w'] = CMD_WIELD_WEAPON;
- key_to_command_table['x'] = CMD_LOOK_AROUND;
- key_to_command_table['y'] = CMD_MOVE_UP_LEFT;
- key_to_command_table['z'] = CMD_ZAP_WAND;
+ key_to_command_table[(int) 'a'] = CMD_USE_ABILITY;
+ key_to_command_table[(int) 'b'] = CMD_MOVE_DOWN_LEFT;
+ key_to_command_table[(int) 'c'] = CMD_CLOSE_DOOR;
+ key_to_command_table[(int) 'd'] = CMD_DROP;
+ key_to_command_table[(int) 'e'] = CMD_EAT;
+ key_to_command_table[(int) 'f'] = CMD_FIRE;
+ key_to_command_table[(int) 'g'] = CMD_PICKUP;
+ key_to_command_table[(int) 'h'] = CMD_MOVE_LEFT;
+ key_to_command_table[(int) 'i'] = CMD_DISPLAY_INVENTORY;
+ key_to_command_table[(int) 'j'] = CMD_MOVE_DOWN;
+ key_to_command_table[(int) 'k'] = CMD_MOVE_UP;
+ key_to_command_table[(int) 'l'] = CMD_MOVE_RIGHT;
+ key_to_command_table[(int) 'm'] = CMD_DISPLAY_SKILLS;
+ key_to_command_table[(int) 'n'] = CMD_MOVE_DOWN_RIGHT;
+ key_to_command_table[(int) 'o'] = CMD_OPEN_DOOR;
+ key_to_command_table[(int) 'p'] = CMD_PRAY;
+ key_to_command_table[(int) 'q'] = CMD_QUAFF;
+ key_to_command_table[(int) 'r'] = CMD_READ;
+ key_to_command_table[(int) 's'] = CMD_SEARCH;
+ key_to_command_table[(int) 't'] = CMD_THROW;
+ key_to_command_table[(int) 'u'] = CMD_MOVE_UP_RIGHT;
+ key_to_command_table[(int) 'v'] = CMD_EXAMINE_OBJECT;
+ key_to_command_table[(int) 'w'] = CMD_WIELD_WEAPON;
+ key_to_command_table[(int) 'x'] = CMD_LOOK_AROUND;
+ key_to_command_table[(int) 'y'] = CMD_MOVE_UP_LEFT;
+ key_to_command_table[(int) 'z'] = CMD_ZAP_WAND;
// upper case
- key_to_command_table['A'] = CMD_DISPLAY_MUTATIONS;
- key_to_command_table['B'] = CMD_RUN_DOWN_LEFT;
- key_to_command_table['C'] = CMD_EXPERIENCE_CHECK;
- key_to_command_table['D'] = CMD_BUTCHER;
- key_to_command_table['E'] = CMD_EVOKE;
- key_to_command_table['F'] = CMD_NO_CMD;
- key_to_command_table['G'] = CMD_NO_CMD;
- key_to_command_table['H'] = CMD_RUN_LEFT;
- key_to_command_table['I'] = CMD_OBSOLETE_INVOKE;
- key_to_command_table['J'] = CMD_RUN_DOWN;
- key_to_command_table['K'] = CMD_RUN_UP;
- key_to_command_table['L'] = CMD_RUN_RIGHT;
- key_to_command_table['M'] = CMD_MEMORISE_SPELL;
- key_to_command_table['N'] = CMD_RUN_DOWN_RIGHT;
- key_to_command_table['O'] = CMD_DISPLAY_OVERMAP;
- key_to_command_table['P'] = CMD_WEAR_JEWELLERY;
- key_to_command_table['Q'] = CMD_QUIT;
- key_to_command_table['R'] = CMD_REMOVE_JEWELLERY;
- key_to_command_table['S'] = CMD_SAVE_GAME;
- key_to_command_table['T'] = CMD_REMOVE_ARMOUR;
- key_to_command_table['U'] = CMD_RUN_UP_RIGHT;
- key_to_command_table['V'] = CMD_GET_VERSION;
- key_to_command_table['W'] = CMD_WEAR_ARMOUR;
- key_to_command_table['X'] = CMD_DISPLAY_MAP;
- key_to_command_table['Y'] = CMD_RUN_UP_LEFT;
- key_to_command_table['Z'] = CMD_CAST_SPELL;
+ key_to_command_table[(int) 'A'] = CMD_DISPLAY_MUTATIONS;
+ key_to_command_table[(int) 'B'] = CMD_RUN_DOWN_LEFT;
+ key_to_command_table[(int) 'C'] = CMD_EXPERIENCE_CHECK;
+ key_to_command_table[(int) 'D'] = CMD_BUTCHER;
+ key_to_command_table[(int) 'E'] = CMD_EVOKE;
+ key_to_command_table[(int) 'F'] = CMD_NO_CMD;
+ key_to_command_table[(int) 'G'] = CMD_NO_CMD;
+ key_to_command_table[(int) 'H'] = CMD_RUN_LEFT;
+ key_to_command_table[(int) 'I'] = CMD_OBSOLETE_INVOKE;
+ key_to_command_table[(int) 'J'] = CMD_RUN_DOWN;
+ key_to_command_table[(int) 'K'] = CMD_RUN_UP;
+ key_to_command_table[(int) 'L'] = CMD_RUN_RIGHT;
+ key_to_command_table[(int) 'M'] = CMD_MEMORISE_SPELL;
+ key_to_command_table[(int) 'N'] = CMD_RUN_DOWN_RIGHT;
+ key_to_command_table[(int) 'O'] = CMD_DISPLAY_OVERMAP;
+ key_to_command_table[(int) 'P'] = CMD_WEAR_JEWELLERY;
+ key_to_command_table[(int) 'Q'] = CMD_QUIT;
+ key_to_command_table[(int) 'R'] = CMD_REMOVE_JEWELLERY;
+ key_to_command_table[(int) 'S'] = CMD_SAVE_GAME;
+ key_to_command_table[(int) 'T'] = CMD_REMOVE_ARMOUR;
+ key_to_command_table[(int) 'U'] = CMD_RUN_UP_RIGHT;
+ key_to_command_table[(int) 'V'] = CMD_GET_VERSION;
+ key_to_command_table[(int) 'W'] = CMD_WEAR_ARMOUR;
+ key_to_command_table[(int) 'X'] = CMD_DISPLAY_MAP;
+ key_to_command_table[(int) 'Y'] = CMD_RUN_UP_LEFT;
+ key_to_command_table[(int) 'Z'] = CMD_CAST_SPELL;
// control
- key_to_command_table[ CONTROL('A') ] = CMD_TOGGLE_AUTOPICKUP;
- key_to_command_table[ CONTROL('B') ] = CMD_OPEN_DOOR_DOWN_LEFT;
- key_to_command_table[ CONTROL('C') ] = CMD_NO_CMD;
+ key_to_command_table[ (int) CONTROL('A') ] = CMD_TOGGLE_AUTOPICKUP;
+ key_to_command_table[ (int) CONTROL('B') ] = CMD_OPEN_DOOR_DOWN_LEFT;
+ key_to_command_table[ (int) CONTROL('C') ] = CMD_NO_CMD;
#ifdef ALLOW_DESTROY_ITEM_COMMAND
- key_to_command_table[ CONTROL('D') ] = CMD_DESTROY_ITEM;
+ key_to_command_table[ (int) CONTROL('D') ] = CMD_DESTROY_ITEM;
#else
- key_to_command_table[ CONTROL('D') ] = CMD_NO_CMD;
+ key_to_command_table[ (int) CONTROL('D') ] = CMD_NO_CMD;
#endif
- key_to_command_table[ CONTROL('E') ] = CMD_NO_CMD;
- key_to_command_table[ CONTROL('F') ] = CMD_NO_CMD;
- key_to_command_table[ CONTROL('G') ] = CMD_NO_CMD;
- key_to_command_table[ CONTROL('H') ] = CMD_OPEN_DOOR_LEFT;
- key_to_command_table[ CONTROL('I') ] = CMD_NO_CMD;
- key_to_command_table[ CONTROL('J') ] = CMD_OPEN_DOOR_DOWN;
- key_to_command_table[ CONTROL('K') ] = CMD_OPEN_DOOR_UP;
- key_to_command_table[ CONTROL('L') ] = CMD_OPEN_DOOR_RIGHT;
- key_to_command_table[ CONTROL('M') ] = CMD_NO_CMD;
- key_to_command_table[ CONTROL('N') ] = CMD_OPEN_DOOR_DOWN_RIGHT;
- key_to_command_table[ CONTROL('O') ] = CMD_NO_CMD;
- key_to_command_table[ CONTROL('P') ] = CMD_REPLAY_MESSAGES;
- key_to_command_table[ CONTROL('Q') ] = CMD_NO_CMD;
- key_to_command_table[ CONTROL('R') ] = CMD_REDRAW_SCREEN;
- key_to_command_table[ CONTROL('S') ] = CMD_NO_CMD;
- key_to_command_table[ CONTROL('T') ] = CMD_NO_CMD;
- key_to_command_table[ CONTROL('U') ] = CMD_OPEN_DOOR_UP_LEFT;
- key_to_command_table[ CONTROL('V') ] = CMD_NO_CMD;
- key_to_command_table[ CONTROL('W') ] = CMD_NO_CMD;
- key_to_command_table[ CONTROL('X') ] = CMD_SAVE_GAME_NOW;
- key_to_command_table[ CONTROL('Y') ] = CMD_OPEN_DOOR_UP_RIGHT;
- key_to_command_table[ CONTROL('Z') ] = CMD_SUSPEND_GAME;
+ key_to_command_table[ (int) CONTROL('E') ] = CMD_NO_CMD;
+ key_to_command_table[ (int) CONTROL('F') ] = CMD_NO_CMD;
+ key_to_command_table[ (int) CONTROL('G') ] = CMD_NO_CMD;
+ key_to_command_table[ (int) CONTROL('H') ] = CMD_OPEN_DOOR_LEFT;
+ key_to_command_table[ (int) CONTROL('I') ] = CMD_NO_CMD;
+ key_to_command_table[ (int) CONTROL('J') ] = CMD_OPEN_DOOR_DOWN;
+ key_to_command_table[ (int) CONTROL('K') ] = CMD_OPEN_DOOR_UP;
+ key_to_command_table[ (int) CONTROL('L') ] = CMD_OPEN_DOOR_RIGHT;
+ key_to_command_table[ (int) CONTROL('M') ] = CMD_NO_CMD;
+ key_to_command_table[ (int) CONTROL('N') ] = CMD_OPEN_DOOR_DOWN_RIGHT;
+ key_to_command_table[ (int) CONTROL('O') ] = CMD_NO_CMD;
+ key_to_command_table[ (int) CONTROL('P') ] = CMD_REPLAY_MESSAGES;
+ key_to_command_table[ (int) CONTROL('Q') ] = CMD_NO_CMD;
+ key_to_command_table[ (int) CONTROL('R') ] = CMD_REDRAW_SCREEN;
+ key_to_command_table[ (int) CONTROL('S') ] = CMD_NO_CMD;
+ key_to_command_table[ (int) CONTROL('T') ] = CMD_NO_CMD;
+ key_to_command_table[ (int) CONTROL('U') ] = CMD_OPEN_DOOR_UP_LEFT;
+ key_to_command_table[ (int) CONTROL('V') ] = CMD_NO_CMD;
+ key_to_command_table[ (int) CONTROL('W') ] = CMD_NO_CMD;
+ key_to_command_table[ (int) CONTROL('X') ] = CMD_SAVE_GAME_NOW;
+ key_to_command_table[ (int) CONTROL('Y') ] = CMD_OPEN_DOOR_UP_RIGHT;
+ key_to_command_table[ (int) CONTROL('Z') ] = CMD_SUSPEND_GAME;
// other printables
- key_to_command_table['.'] = CMD_MOVE_NOWHERE;
- key_to_command_table['<'] = CMD_GO_UPSTAIRS;
- key_to_command_table['>'] = CMD_GO_DOWNSTAIRS;
- key_to_command_table['@'] = CMD_DISPLAY_CHARACTER_STATUS;
- key_to_command_table[','] = CMD_PICKUP;
- key_to_command_table[';'] = CMD_INSPECT_FLOOR;
- key_to_command_table['!'] = CMD_SHOUT;
- key_to_command_table['^'] = CMD_DISPLAY_RELIGION;
- key_to_command_table['#'] = CMD_CHARACTER_DUMP;
- key_to_command_table['='] = CMD_ADJUST_INVENTORY;
- key_to_command_table['?'] = CMD_DISPLAY_COMMANDS;
- key_to_command_table['`'] = CMD_MACRO_ADD;
- key_to_command_table['~'] = CMD_MACRO_SAVE;
- key_to_command_table['&'] = CMD_WIZARD;
- key_to_command_table['"'] = CMD_LIST_JEWELLERY;
+ key_to_command_table[(int) '.'] = CMD_MOVE_NOWHERE;
+ key_to_command_table[(int) '<'] = CMD_GO_UPSTAIRS;
+ key_to_command_table[(int) '>'] = CMD_GO_DOWNSTAIRS;
+ key_to_command_table[(int) '@'] = CMD_DISPLAY_CHARACTER_STATUS;
+ key_to_command_table[(int) ','] = CMD_PICKUP;
+ key_to_command_table[(int) ';'] = CMD_INSPECT_FLOOR;
+ key_to_command_table[(int) '!'] = CMD_SHOUT;
+ key_to_command_table[(int) '^'] = CMD_DISPLAY_RELIGION;
+ key_to_command_table[(int) '#'] = CMD_CHARACTER_DUMP;
+ key_to_command_table[(int) '='] = CMD_ADJUST_INVENTORY;
+ key_to_command_table[(int) '?'] = CMD_DISPLAY_COMMANDS;
+ key_to_command_table[(int) '`'] = CMD_MACRO_ADD;
+ key_to_command_table[(int) '~'] = CMD_MACRO_SAVE;
+ key_to_command_table[(int) '&'] = CMD_WIZARD;
+ key_to_command_table[(int) '"'] = CMD_LIST_JEWELLERY;
// I'm making this both, because I'm tried of changing it
// back to '[' (the character that represents armour on the map) -- bwr
- key_to_command_table['['] = CMD_LIST_ARMOUR;
- key_to_command_table[']'] = CMD_LIST_ARMOUR;
+ key_to_command_table[(int) '['] = CMD_LIST_ARMOUR;
+ key_to_command_table[(int) ']'] = CMD_LIST_ARMOUR;
// This one also ended up backwards this time, so it's also going on
// both now -- should be ')'... the same character that's used to
// represent weapons.
- key_to_command_table[')'] = CMD_LIST_WEAPONS;
- key_to_command_table['('] = CMD_LIST_WEAPONS;
+ key_to_command_table[(int) ')'] = CMD_LIST_WEAPONS;
+ key_to_command_table[(int) '('] = CMD_LIST_WEAPONS;
- key_to_command_table['\\'] = CMD_DISPLAY_KNOWN_OBJECTS;
- key_to_command_table['\''] = CMD_WEAPON_SWAP;
+ key_to_command_table[(int) '\\'] = CMD_DISPLAY_KNOWN_OBJECTS;
+ key_to_command_table[(int) '\''] = CMD_WEAPON_SWAP;
// digits
- key_to_command_table['1'] = CMD_MOVE_DOWN_LEFT;
- key_to_command_table['2'] = CMD_MOVE_DOWN;
- key_to_command_table['3'] = CMD_MOVE_DOWN_RIGHT;
- key_to_command_table['4'] = CMD_MOVE_LEFT;
- key_to_command_table['5'] = CMD_REST;
- key_to_command_table['6'] = CMD_MOVE_RIGHT;
- key_to_command_table['7'] = CMD_MOVE_UP_LEFT;
- key_to_command_table['8'] = CMD_MOVE_UP;
- key_to_command_table['9'] = CMD_MOVE_UP_RIGHT;
+ key_to_command_table[(int) '1'] = CMD_MOVE_DOWN_LEFT;
+ key_to_command_table[(int) '2'] = CMD_MOVE_DOWN;
+ key_to_command_table[(int) '3'] = CMD_MOVE_DOWN_RIGHT;
+ key_to_command_table[(int) '4'] = CMD_MOVE_LEFT;
+ key_to_command_table[(int) '5'] = CMD_REST;
+ key_to_command_table[(int) '6'] = CMD_MOVE_RIGHT;
+ key_to_command_table[(int) '7'] = CMD_MOVE_UP_LEFT;
+ key_to_command_table[(int) '8'] = CMD_MOVE_UP;
+ key_to_command_table[(int) '9'] = CMD_MOVE_UP_RIGHT;
// keypad
key_to_command_table[KEY_A1] = CMD_MOVE_UP_LEFT;
@@ -382,8 +384,8 @@ void init_key_to_command()
// these are invalid keys, but to help kludge running
// pass them through unmolested
key_to_command_table[128] = 128;
- key_to_command_table['*'] = '*';
- key_to_command_table['/'] = '/';
+ key_to_command_table[(int) '*'] = '*';
+ key_to_command_table[(int) '/'] = '/';
}
int key_to_command(int keyin)
diff --git a/trunk/source/libutil.cc b/trunk/source/libutil.cc
index 9be12392a7..93b714ff49 100644
--- a/trunk/source/libutil.cc
+++ b/trunk/source/libutil.cc
@@ -2,6 +2,8 @@
* File: libutil.cc
* Summary: Functions that may be missing from some systems
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
* <1> 2001/Nov/01 BWR Created
@@ -11,6 +13,7 @@
#include "AppHdr.h"
#include <stdio.h>
#include <ctype.h>
+#include <string.h>
void get_input_line( char *const buff, int len )
{
diff --git a/trunk/source/makefile b/trunk/source/makefile
index 9e99a03c37..348d21a67b 100644
--- a/trunk/source/makefile
+++ b/trunk/source/makefile
@@ -1,3 +1,7 @@
+#
+# Modified for Crawl Reference by $Author$ on $Date$
+#
+
#Makefile chooser. Choose one:
MAKEFILE = makefile.lnx
@@ -5,10 +9,11 @@ MAKEFILE = makefile.lnx
#MAKEFILE = makefile.dos
#MAKEFILE = makefile.emx
#MAKEFILE = makefile.sol
+#MAKEFILE = makefile.osx
#jmf: number of concurrent jobs -- good value is (#_of_CPUs * 2) + 1
# cuts build time a lot on multi-cpu machines
-OTHER=-j2
+#OTHER=-j2
all:
$(MAKE) $(OTHER) -f $(MAKEFILE) EXTRA_FLAGS='-O2 -fno-strength-reduce'
diff --git a/trunk/source/makefile.osx b/trunk/source/makefile.osx
index 9fa48a3b63..9988073b57 100644
--- a/trunk/source/makefile.osx
+++ b/trunk/source/makefile.osx
@@ -1,5 +1,9 @@
# -*- Makefile -*- for Dungeon Crawl (OS X)
+#
+# Modified for Crawl Reference by $Author$ on $Date$
+#
+
#APPNAME = crawl
GAME = crawl
@@ -15,17 +19,16 @@ COPY = cp
OS_TYPE = BSD
CFLAGS = -D$(OS_TYPE) -DOSX $(EXTRA_FLAGS) -Wall -Werror \
- -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
- -Wmissing-declarations
+ -Wwrite-strings
-LDFLAGS = -L/sw/lib -L/usr/lib
MCHMOD = 711
# INSTALLDIR = /usr/games
INSTALLDIR = /tmp/CRAWLTEST/testdev
LIB = -lncurses -lstdc++
-# Include for Fink's version of curses
-INCLUDES = -I/sw/include
+# Include/library for Fink's version of curses
+# INCLUDES += -I/sw/include
+# LDFLAGS += -L/sw/lib
all: $(GAME)
diff --git a/trunk/source/mon-util.cc b/trunk/source/mon-util.cc
index 491400c8d6..a94133f18e 100644
--- a/trunk/source/mon-util.cc
+++ b/trunk/source/mon-util.cc
@@ -3,6 +3,8 @@
* Summary: Misc monster related functions.
* Written by: Linley Henzell
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
* <2> 11/04/99 cdl added a break to spell selection
@@ -259,7 +261,7 @@ int mons_charclass(int mc)
} // end mons_charclass()
-char mons_shouts(int mc)
+int mons_shouts(int mc)
{
int u = smc->shouts;
diff --git a/trunk/source/mon-util.h b/trunk/source/mon-util.h
index 86291fd1e9..1dfa98ef8d 100644
--- a/trunk/source/mon-util.h
+++ b/trunk/source/mon-util.h
@@ -3,6 +3,8 @@
* Summary: Misc monster related functions.
* Written by: Linley Henzell
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
* <1> -/--/-- LRH Created
@@ -203,7 +205,7 @@ bool mons_player_visible( struct monsters *mon );
/* ***********************************************************************
* called from: view
* *********************************************************************** */
-char mons_shouts(int mclass);
+int mons_shouts(int mclass);
bool mons_is_unique(int mclass);
diff --git a/trunk/source/mutation.cc b/trunk/source/mutation.cc
index 036d624fb9..6bc8f2ecca 100644
--- a/trunk/source/mutation.cc
+++ b/trunk/source/mutation.cc
@@ -3,6 +3,8 @@
* Summary: Functions for handling player mutations.
* Written by: Linley Henzell
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
* <5> 7/29/00 JDJ Made give_cosmetic_mutation static
@@ -1106,7 +1108,7 @@ void display_mutations(void)
bool mutate(int which_mutation, bool failMsg)
{
- char mutat = which_mutation;
+ int mutat = which_mutation;
bool force_mutation = false; // is mutation forced?
int i;
@@ -1598,9 +1600,9 @@ int how_mutated(void)
return (j);
} // end how_mutated()
-bool delete_mutation(char which_mutation)
+bool delete_mutation(int which_mutation)
{
- char mutat = which_mutation;
+ int mutat = which_mutation;
int i;
if (you.mutation[MUT_MUTATION_RESISTANCE] > 1
@@ -1803,7 +1805,7 @@ char body_covered(void)
return covered;
}
-const char *mutation_name( char which_mutat, int level )
+const char *mutation_name(int which_mutat, int level )
{
static char mut_string[INFO_SIZE];
diff --git a/trunk/source/mutation.h b/trunk/source/mutation.h
index b305098d62..76d821f2c4 100644
--- a/trunk/source/mutation.h
+++ b/trunk/source/mutation.h
@@ -3,6 +3,8 @@
* Summary: Functions for handling player mutations.
* Written by: Linley Henzell
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
* <1> -/--/-- LRH Created
@@ -32,7 +34,7 @@ void display_mutations(void);
/* ***********************************************************************
* called from: decks - it_use2 - mutation - spells
* *********************************************************************** */
-bool delete_mutation(char which_mutation);
+bool delete_mutation(int which_mutation);
// last updated 12may2000 {dlb}
@@ -40,7 +42,7 @@ bool delete_mutation(char which_mutation);
* called from: chardump
* *********************************************************************** */
// default of level == -1, means to use the player's current level
-const char *mutation_name( char which_mutat, int level = -1 );
+const char *mutation_name( int which_mutat, int level = -1 );
// last updated 12may2000 {dlb}
diff --git a/trunk/source/ouch.cc b/trunk/source/ouch.cc
index 5fa2cfa136..6a508cb934 100644
--- a/trunk/source/ouch.cc
+++ b/trunk/source/ouch.cc
@@ -3,6 +3,8 @@
* Summary: Functions used when Bad Things happen to the player.
* Written by: Linley Henzell
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
* <8> 7/30/00 JDJ Fixed end_game so that it works with filenames longer than 6 characters.
@@ -23,7 +25,6 @@
*/
#include "AppHdr.h"
-#include "ouch.h"
#include <string.h>
#include <stdio.h>
@@ -54,6 +55,8 @@
#include <sys/stat.h>
#endif
+#include "ouch.h"
+
#include "externs.h"
#include "chardump.h"
diff --git a/trunk/source/religion.cc b/trunk/source/religion.cc
index 090ad1533b..2871b9bd8f 100644
--- a/trunk/source/religion.cc
+++ b/trunk/source/religion.cc
@@ -3,6 +3,8 @@
* Summary: Misc religion related functions.
* Written by: Linley Henzell
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
*
@@ -53,18 +55,18 @@
#include "stuff.h"
const char *sacrifice[] = {
- {" glows silver and disappears."},
- {" glows a brilliant golden colour and disappears."},
- {" rots away in an instant."},
- {" crumbles to dust."},
- {" is eaten by a bug."}, /* Xom - no sacrifices */
- {" explodes into nothingness."},
- {" is consumed in a burst of flame."},
- {" is consumed in a roaring column of flame."},
- {" glows faintly for a moment, then is gone."},
- {" is consumed in a roaring column of flame."},
- {" glows with a rainbow of weird colours and disappears."},
- {" evaporates."}
+ " glows silver and disappears.",
+ " glows a brilliant golden colour and disappears.",
+ " rots away in an instant.",
+ " crumbles to dust.",
+ " is eaten by a bug.", /* Xom - no sacrifices */
+ " explodes into nothingness.",
+ " is consumed in a burst of flame.",
+ " is consumed in a roaring column of flame.",
+ " glows faintly for a moment, then is gone.",
+ " is consumed in a roaring column of flame.",
+ " glows with a rainbow of weird colours and disappears.",
+ " evaporates."
};
void altar_prayer(void);
diff --git a/trunk/source/skills2.cc b/trunk/source/skills2.cc
index 6eb53d6d53..f4012d0462 100644
--- a/trunk/source/skills2.cc
+++ b/trunk/source/skills2.cc
@@ -3,6 +3,8 @@
* Summary: More skill related functions.
* Written by: Linley Henzell
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
* 01aug2000 jmf RESTORED TITLES TO THEIR FORMER GLORY! MUA-HA!
@@ -2258,7 +2260,7 @@ unsigned int skill_exp_needed(int lev)
}
-int species_skills(char skill, char species)
+int species_skills(int skill, int species)
{
// Spellcasting is more expensive, invocations and evocations are cheaper
if (skill == SK_SPELLCASTING)
diff --git a/trunk/source/skills2.h b/trunk/source/skills2.h
index 606a95a17d..05c5d03068 100644
--- a/trunk/source/skills2.h
+++ b/trunk/source/skills2.h
@@ -3,6 +3,8 @@
* Summary: More skill related functions.
* Written by: Linley Henzell
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
* <2> -/--/-- WL Extensive mods from Wladimir van der Laan.
@@ -68,7 +70,7 @@ int calc_hp(void);
/* ***********************************************************************
* called from: newgame - skills - skills2
* *********************************************************************** */
-int species_skills(char skill, char species);
+int species_skills(int skill, int species);
// last_updated 24may2000 {dlb}
diff --git a/trunk/source/spells2.cc b/trunk/source/spells2.cc
index 588ade57c8..102e2b7bc0 100644
--- a/trunk/source/spells2.cc
+++ b/trunk/source/spells2.cc
@@ -3,6 +3,8 @@
* Summary: Implementations of some additional spells.
* Written by: Linley Henzell
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
* <4> 03jan1999 jmf Changed summon_small_mammals so at
@@ -1083,7 +1085,7 @@ char burn_freeze(int pow, char flavour)
// postal on the caster (after taking into account
// chance of that happening to unskilled casters
// anyway)
-int summon_elemental(int pow, unsigned char restricted_type,
+int summon_elemental(int pow, int restricted_type,
unsigned char unfriendly)
{
int type_summoned = MONS_PROGRAM_BUG; // error trapping {dlb}
diff --git a/trunk/source/spells2.h b/trunk/source/spells2.h
index 492fe62022..8c3bef71c5 100644
--- a/trunk/source/spells2.h
+++ b/trunk/source/spells2.h
@@ -3,6 +3,8 @@
* Summary: Implementations of some additional spells.
* Written by: Linley Henzell
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
* <1> -/--/-- LRH Created
@@ -51,7 +53,7 @@ int corpse_rot(int power);
/* ***********************************************************************
* called from: it_use3 - spell
* *********************************************************************** */
-int summon_elemental(int pow, unsigned char restricted_type, unsigned char unfriendly);
+int summon_elemental(int pow, int restricted_type, unsigned char unfriendly);
// last updated 24may2000 {dlb}
diff --git a/trunk/source/spl-cast.cc b/trunk/source/spl-cast.cc
index 135d831af9..0ce8209786 100644
--- a/trunk/source/spl-cast.cc
+++ b/trunk/source/spl-cast.cc
@@ -3,6 +3,8 @@
* Summary: Spell casting and miscast functions.
* Written by: Linley Henzell
*
+ * Modified for Crawl Reference by $Author$ on $Date$
+ *
* Change History (most recent first):
*
* <4> 1/02/00 jmf changed values, marked //jmf:
@@ -12,13 +14,14 @@
*/
#include "AppHdr.h"
-#include "spl-cast.h"
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include "spl-cast.h"
+
#include "externs.h"
#include "beam.h"