Changeset 929
- Timestamp:
- 05/17/08 11:20:24 (6 months ago)
- Files:
-
- trunk/src/cmd4.c (modified) (26 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cmd4.c
r927 r929 322 322 byte attr = curs_attrs[CURS_KNOWN][cursor == oid]; 323 323 324 (void)wid; 325 324 326 /* Print the interesting part */ 325 327 o_funcs->display_member(col, row, cursor, oid); … … 341 343 static const char *recall_prompt(int oid) 342 344 { 345 (void)oid; 343 346 return ", 'r' to recall"; 344 347 } … … 1032 1035 static int m_cmp_race(const void *a, const void *b) 1033 1036 { 1034 monster_race *r_a = &r_info[default_join[*(int*)a].oid];1035 monster_race *r_b = &r_info[default_join[*(int*)b].oid];1036 int gid = default_join[*( int*)a].gid;1037 const monster_race *r_a = &r_info[default_join[*(const int *)a].oid]; 1038 const monster_race *r_b = &r_info[default_join[*(const int *)b].oid]; 1039 int gid = default_join[*(const int *)a].gid; 1037 1040 1038 1041 /* Group by */ 1039 int c = gid - default_join[*( int*)b].gid;1042 int c = gid - default_join[*(const int *)b].gid; 1040 1043 if (c) return c; 1041 1044 … … 1059 1062 static const char *race_name(int gid) { return monster_group[gid].name; } 1060 1063 1061 static void mon_lore(int oid) 1062 { 1064 static void mon_lore(int oid) 1065 { 1063 1066 /* Save the screen */ 1064 1067 screen_save(); … … 1085 1088 1086 1089 /* Access the race */ 1087 1088 1090 for (i = 0; i < n; i++) 1089 1091 { … … 1143 1145 member_funcs m_funcs = {display_monster, mon_lore, m_xchar, m_xattr, recall_prompt, 0, 0}; 1144 1146 1145 1146 1147 int *monsters; 1147 1148 int m_count = 0; 1148 1149 int i; 1149 1150 size_t j; 1151 1152 (void)obj; 1153 (void)name; 1150 1154 1151 1155 for (i = 0; i < z_info->r_max; i++) … … 1264 1268 static int a_cmp_tval(const void *a, const void *b) 1265 1269 { 1266 artifact_type *a_a = &a_info[*(int*)a]; 1267 artifact_type *a_b = &a_info[*(int*)b]; 1270 const artifact_type *a_a = &a_info[*(const int *)a]; 1271 const artifact_type *a_b = &a_info[*(const int *)b]; 1272 1268 1273 /*group by */ 1269 1274 int ta = obj_group_order[a_a->tval]; … … 1360 1365 int a_count = 0; 1361 1366 1367 (void)obj; 1368 (void)name; 1369 1362 1370 artifacts = C_ZNEW(z_info->a_max, int); 1363 1371 … … 1450 1458 static int e_cmp_tval(const void *a, const void *b) 1451 1459 { 1452 ego_item_type *ea = &e_info[default_join[*(int*)a].oid];1453 ego_item_type *eb = &e_info[default_join[*(int*)b].oid];1460 const ego_item_type *ea = &e_info[default_join[*(const int *)a].oid]; 1461 const ego_item_type *eb = &e_info[default_join[*(const int *)b].oid]; 1454 1462 1455 1463 /* Group by */ 1456 int c = default_join[*( int*)a].gid - default_join[*(int*)b].gid;1464 int c = default_join[*(const int *)a].gid - default_join[*(const int *)b].gid; 1457 1465 if (c) return c; 1458 1466 … … 1474 1482 int e_count = 0; 1475 1483 int i, j; 1484 1485 (void)obj; 1486 (void)name; 1476 1487 1477 1488 /* HACK: currently no more than 3 tvals for one ego type */ … … 1537 1548 { 1538 1549 int k_idx = oid; 1539 1550 1540 1551 object_kind *k_ptr = &k_info[k_idx]; 1541 1552 const char *inscrip = get_autoinscription(oid); … … 1632 1643 static int o_cmp_tval(const void *a, const void *b) 1633 1644 { 1634 object_kind *k_a = &k_info[*(int*)a];1635 object_kind *k_b = &k_info[*(int*)b];1645 const object_kind *k_a = &k_info[*(const int *)a]; 1646 const object_kind *k_b = &k_info[*(const int *)b]; 1636 1647 1637 1648 /* Group by */ … … 1770 1781 int i; 1771 1782 1783 (void)obj; 1784 (void)name; 1785 1772 1786 objects = C_ZNEW(z_info->k_max, int); 1773 1787 … … 1820 1834 static int f_cmp_fkind(const void *a, const void *b) 1821 1835 { 1822 feature_type *fa = &f_info[*(int*)a]; 1823 feature_type *fb = &f_info[*(int*)b]; 1836 const feature_type *fa = &f_info[*(const int *)a]; 1837 const feature_type *fb = &f_info[*(const int *)b]; 1838 1824 1839 /* group by */ 1825 int c = feat_order(*( int*)a) - feat_order(*(int*)b);1840 int c = feat_order(*(const int *)a) - feat_order(*(const int *)b); 1826 1841 if (c) return c; 1842 1827 1843 /* order by feature name */ 1828 1844 return strcmp(f_name + fa->name, f_name + fb->name); … … 1832 1848 static byte *f_xattr(int oid) { return &f_info[oid].x_attr; } 1833 1849 static char *f_xchar(int oid) { return &f_info[oid].x_char; } 1834 static void feat_lore(int oid) { /* noop */ }1850 static void feat_lore(int oid) { (void)oid; /* noop */ } 1835 1851 1836 1852 /* … … 1847 1863 int f_count = 0; 1848 1864 int i; 1865 1866 (void)obj; 1867 (void)name; 1849 1868 1850 1869 features = C_ZNEW(z_info->f_max, int); … … 2288 2307 { 2289 2308 byte attr = curs_attrs[CURS_KNOWN][(int)cursor]; 2309 (void)menu; 2310 (void)width; 2290 2311 2291 2312 c_prt(attr, format("%-45s: %s (%s)", option_desc(oid), … … 2299 2320 static bool update_option(char key, void *pgdb, int oid) 2300 2321 { 2322 (void)pgdb; 2323 2301 2324 /* Ignore arrow events */ 2302 2325 if (key == ARROW_LEFT || key == ARROW_RIGHT) … … 3024 3047 * CLEANUP 3025 3048 */ 3026 3027 3049 static menu_action macro_actions[] = 3028 3050 { 3029 { LOAD_PREF, "Load a user pref file", 0},3051 { LOAD_PREF, "Load a user pref file", 0, 0 }, 3030 3052 #ifdef ALLOW_MACROS 3031 { APP_MACRO, "Append macros to a file", 0},3032 { ASK_MACRO, "Query a macro", 0},3033 { NEW_MACRO, "Create a macro", 0},3034 { DEL_MACRO, "Remove a macro", 0},3035 { APP_KEYMAP, "Append keymaps to a file", 0},3036 { ASK_KEYMAP, "Query a keymap", 0},3037 { NEW_KEYMAP, "Create a keymap", 0},3038 { DEL_KEYMAP, "Remove a keymap", 0},3039 { ENTER_ACT, "Enter a new action", 0}3053 { APP_MACRO, "Append macros to a file", 0, 0 }, 3054 { ASK_MACRO, "Query a macro", 0, 0 }, 3055 { NEW_MACRO, "Create a macro", 0, 0 }, 3056 { DEL_MACRO, "Remove a macro", 0, 0 }, 3057 { APP_KEYMAP, "Append keymaps to a file", 0, 0 }, 3058 { ASK_KEYMAP, "Query a keymap", 0, 0 }, 3059 { NEW_KEYMAP, "Create a keymap", 0, 0 }, 3060 { DEL_KEYMAP, "Remove a keymap", 0, 0 }, 3061 { ENTER_ACT, "Enter a new action", 0, 0 }, 3040 3062 #endif /* ALLOW_MACROS */ 3041 3063 }; … … 4029 4051 static void do_dump_options(void *unused, const char *title) 4030 4052 { 4053 (void)unused; 4031 4054 dump_pref_file(option_dump, title, 20); 4032 4055 } … … 4067 4090 static char tag_opt_main(menu_type *menu, int oid) 4068 4091 { 4092 (void)menu; 4069 4093 if (option_actions[oid].id) 4070 4094 return option_actions[oid].id; … … 4075 4099 static int valid_opt_main(menu_type *menu, int oid) 4076 4100 { 4101 (void)menu; 4077 4102 if (option_actions[oid].name) 4078 4103 return 1; … … 4085 4110 byte attr = curs_attrs[CURS_KNOWN][(int)cursor]; 4086 4111 4112 (void)menu; 4113 (void)width; 4087 4114 if (option_actions[oid].name) 4088 4115 c_prt(attr, option_actions[oid].name, row, col); … … 4129 4156 static void do_cmd_self_knowledge(void *obj, const char *name) 4130 4157 { 4158 (void)obj; 4159 (void)name; 4160 4131 4161 /* display self knowledge we already know about. */ 4132 4162 self_knowledge(FALSE); … … 4135 4165 static void do_cmd_knowledge_scores(void *obj, const char *name) 4136 4166 { 4167 (void)obj; 4168 (void)name; 4137 4169 show_scores(); 4138 4170 } … … 4140 4172 static void do_cmd_knowledge_history(void *obj, const char *name) 4141 4173 { 4174 (void)obj; 4175 (void)name; 4142 4176 history_display(); 4143 4177 }
