Changeset 220
- Timestamp:
- 06/26/07 18:27:33 (1 year ago)
- Files:
-
- trunk/src/cmd0.c (modified) (2 diffs)
- trunk/src/cmd1.c (modified) (1 diff)
- trunk/src/cmds.h (modified) (1 diff)
- trunk/src/files.c (modified) (1 diff)
- trunk/src/main-ros.c (modified) (1 diff)
- trunk/src/main-win.c (modified) (1 diff)
- trunk/src/obj-info.c (modified) (1 diff)
- trunk/src/pathfind.c (modified) (1 diff)
- trunk/src/squelch.c (modified) (5 diffs)
- trunk/src/ui.c (modified) (3 diffs)
- trunk/src/z-file.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cmd0.c
r199 r220 37 37 38 38 /* Forward declare these, because they're really defined later */ 39 static do_cmd_type do_cmd_wizard, do_cmd_try_debug, do_cmd_try_borg,39 static do_cmd_type do_cmd_wizard, do_cmd_try_debug, 40 40 do_cmd_cast_or_pray, do_cmd_quit, do_cmd_mouseclick, do_cmd_port, 41 41 do_cmd_xxx_options, do_cmd_menu, do_cmd_monlist; 42 42 43 #ifdef ALLOW_BORG 44 static do_cmd_type do_cmd_try_borg; 45 #endif 43 46 44 47 /* … … 562 565 unsigned char key = commands[i].key; 563 566 564 assert(key < N_ELEMENTS(converted_list)); 567 /* Note: at present converted_list is UCHAR_MAX + 1 568 large, so 'key' is always a valid index. */ 565 569 converted_list[key] = commands[i].hook; 566 570 } trunk/src/cmd1.c
r156 r220 10 10 11 11 #include "angband.h" 12 12 #include "cmds.h" 13 13 14 14 trunk/src/cmds.h
r136 r220 1 #ifndef __angband_cmds_h__2 #define __angband_cmds_h__1 #ifndef INCLUDED_CMDS_H 2 #define INCLUDED_CMDS_H 3 3 4 4 /* cmd.c */ trunk/src/files.c
r200 r220 10 10 11 11 #include "angband.h" 12 #include "cmds.h" 12 13 13 14 #define MAX_PANEL 12 trunk/src/main-ros.c
r155 r220 57 57 * This is the port version; it appears in the infobox. 58 58 */ 59 #define PORTVERSION "1.3 3 (2007-02-06)"59 #define PORTVERSION "1.34 (2007-06-24)" 60 60 61 61 /* trunk/src/main-win.c
r214 r220 1966 1966 1967 1967 /* Play the sound, catch errors */ 1968 return (PlaySound(buf, 0, SND_FILENAME | SND_ASYNC));1968 PlaySound(buf, 0, SND_FILENAME | SND_ASYNC); 1969 1969 1970 1970 #else /* USE_SOUND */ trunk/src/obj-info.c
r48 r220 10 10 11 11 #include "angband.h" 12 12 #include "cmds.h" 13 13 14 14 /* TRUE if a paragraph break should be output before next p_text_out() */ trunk/src/pathfind.c
r148 r220 73 73 bool findpath(int y, int x) 74 74 { 75 int i, j, dir , wanted_dir;75 int i, j, dir; 76 76 bool try_again; 77 77 int cur_distance; trunk/src/squelch.c
r217 r220 814 814 static char tag_options_item(menu_type *menu, int oid) 815 815 { 816 if (oid < N_ELEMENTS(sval_dependent)) 816 size_t line = (size_t) oid; 817 818 if (line < N_ELEMENTS(sval_dependent)) 817 819 return I2A(oid); 818 820 819 821 /* Separator - blank line. */ 820 if ( oid== N_ELEMENTS(sval_dependent))822 if (line == N_ELEMENTS(sval_dependent)) 821 823 return 0; 822 824 823 oid = oid - N_ELEMENTS(sval_dependent);824 825 if ( oid - 1< N_ELEMENTS(extra_item_options))826 return extra_item_options[ oid - 1].tag;825 line = line - N_ELEMENTS(sval_dependent) - 1; 826 827 if (line < N_ELEMENTS(extra_item_options)) 828 return extra_item_options[line].tag; 827 829 828 830 return 0; … … 831 833 static int valid_options_item(menu_type *menu, int oid) 832 834 { 833 if (oid < N_ELEMENTS(sval_dependent)) 835 size_t line = (size_t) oid; 836 837 if (line < N_ELEMENTS(sval_dependent)) 834 838 return 1; 835 839 836 840 /* Separator - blank line. */ 837 if ( oid== N_ELEMENTS(sval_dependent))841 if (line == N_ELEMENTS(sval_dependent)) 838 842 return 0; 839 843 840 oid = oid - N_ELEMENTS(sval_dependent);841 842 if ( oid - 1< N_ELEMENTS(extra_item_options))844 line = line - N_ELEMENTS(sval_dependent) - 1; 845 846 if (line < N_ELEMENTS(extra_item_options)) 843 847 return 1; 844 848 … … 848 852 static void display_options_item(menu_type *menu, int oid, bool cursor, int row, int col, int width) 849 853 { 850 if (oid < N_ELEMENTS(sval_dependent)) 851 { 852 bool known = seen_tval(sval_dependent[oid].tval); 854 size_t line = (size_t) oid; 855 856 /* First section of menu - the svals */ 857 if (line < N_ELEMENTS(sval_dependent)) 858 { 859 bool known = seen_tval(sval_dependent[line].tval); 853 860 byte attr = curs_attrs[known ? CURS_KNOWN: CURS_UNKNOWN][(int)cursor]; 854 861 855 c_prt(attr, sval_dependent[oid].desc, row, col); 856 } 862 c_prt(attr, sval_dependent[line].desc, row, col); 863 } 864 /* Second section - the "extra options" */ 857 865 else 858 866 { 859 867 byte attr = curs_attrs[CURS_KNOWN][(int)cursor]; 860 868 861 oid = oid - N_ELEMENTS(sval_dependent);869 line = line - N_ELEMENTS(sval_dependent) - 1; 862 870 863 if ( oid - 1< N_ELEMENTS(extra_item_options))864 c_prt(attr, extra_item_options[ oid - 1].name, row, col);871 if (line < N_ELEMENTS(extra_item_options)) 872 c_prt(attr, extra_item_options[line].name, row, col); 865 873 } 866 874 } … … 907 915 if (c.type == EVT_SELECT) 908 916 { 909 if ( cursor < N_ELEMENTS(sval_dependent))917 if ((size_t) cursor < N_ELEMENTS(sval_dependent)) 910 918 { 911 919 sval_menu(sval_dependent[cursor].tval, sval_dependent[cursor].desc); … … 914 922 { 915 923 cursor = cursor - N_ELEMENTS(sval_dependent) - 1; 916 if ( cursor< N_ELEMENTS(extra_item_options))924 if ((size_t) cursor< N_ELEMENTS(extra_item_options)) 917 925 extra_item_options[cursor].action(); 918 926 } trunk/src/ui.c
r210 r220 702 702 case EVT_KBRD: 703 703 { 704 int dir;704 int c, dir; 705 705 706 706 /* could install handle_menu_key as a handler */ … … 714 714 } 715 715 716 intc = get_cursor_key(menu, menu->top, in->key);716 c = get_cursor_key(menu, menu->top, in->key); 717 717 718 718 /* keypress shortcuts are allowed, but the choice */ … … 1128 1128 { 1129 1129 if (menu->object_list) 1130 FREE( menu->object_list);1130 FREE((void *)menu->object_list); 1131 1131 } 1132 1132 trunk/src/z-file.h
r182 r220 1 #ifndef __angband_z_file__2 #define __angband_z_file__1 #ifndef INCLUDED_Z_FILE_H 2 #define INCLUDED_Z_FILE_H 3 3 4 4 /*** Various system-specific fixes ***/
