Changeset 929

Show
Ignore:
Timestamp:
05/17/08 11:20:24 (3 months ago)
Author:
takkaria
Message:

Got bored of all the warnings in cmd4.c so I cleaned them up.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/cmd4.c

    r927 r929  
    322322        byte attr = curs_attrs[CURS_KNOWN][cursor == oid]; 
    323323 
     324        (void)wid; 
     325 
    324326        /* Print the interesting part */ 
    325327        o_funcs->display_member(col, row, cursor, oid); 
     
    341343static const char *recall_prompt(int oid) 
    342344{ 
     345        (void)oid; 
    343346        return ", 'r' to recall"; 
    344347} 
     
    10321035static int m_cmp_race(const void *a, const void *b) 
    10331036{ 
    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; 
    10371040 
    10381041        /* Group by */ 
    1039         int c = gid - default_join[*(int*)b].gid; 
     1042        int c = gid - default_join[*(const int *)b].gid; 
    10401043        if (c) return c; 
    10411044 
     
    10591062static const char *race_name(int gid) { return monster_group[gid].name; } 
    10601063 
    1061 static void mon_lore(int oid)  
    1062 {  
     1064static void mon_lore(int oid) 
     1065{ 
    10631066        /* Save the screen */ 
    10641067        screen_save(); 
     
    10851088 
    10861089        /* Access the race */ 
    1087          
    10881090        for (i = 0; i < n; i++) 
    10891091        { 
     
    11431145        member_funcs m_funcs = {display_monster, mon_lore, m_xchar, m_xattr, recall_prompt, 0, 0}; 
    11441146 
    1145          
    11461147        int *monsters; 
    11471148        int m_count = 0; 
    11481149        int i; 
    11491150        size_t j; 
     1151 
     1152        (void)obj; 
     1153        (void)name; 
    11501154 
    11511155        for (i = 0; i < z_info->r_max; i++) 
     
    12641268static int a_cmp_tval(const void *a, const void *b) 
    12651269{ 
    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 
    12681273        /*group by */ 
    12691274        int ta = obj_group_order[a_a->tval]; 
     
    13601365        int a_count = 0; 
    13611366 
     1367        (void)obj; 
     1368        (void)name; 
     1369 
    13621370        artifacts = C_ZNEW(z_info->a_max, int); 
    13631371 
     
    14501458static int e_cmp_tval(const void *a, const void *b) 
    14511459{ 
    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]; 
    14541462 
    14551463        /* 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; 
    14571465        if (c) return c; 
    14581466 
     
    14741482        int e_count = 0; 
    14751483        int i, j; 
     1484 
     1485        (void)obj; 
     1486        (void)name; 
    14761487 
    14771488        /* HACK: currently no more than 3 tvals for one ego type */ 
     
    15371548{ 
    15381549        int k_idx = oid; 
    1539          
     1550 
    15401551        object_kind *k_ptr = &k_info[k_idx]; 
    15411552        const char *inscrip = get_autoinscription(oid); 
     
    16321643static int o_cmp_tval(const void *a, const void *b) 
    16331644{ 
    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]; 
    16361647 
    16371648        /* Group by */ 
     
    17701781        int i; 
    17711782 
     1783        (void)obj; 
     1784        (void)name; 
     1785 
    17721786        objects = C_ZNEW(z_info->k_max, int); 
    17731787 
     
    18201834static int f_cmp_fkind(const void *a, const void *b) 
    18211835{ 
    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 
    18241839        /* 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); 
    18261841        if (c) return c; 
     1842 
    18271843        /* order by feature name */ 
    18281844        return strcmp(f_name + fa->name, f_name + fb->name); 
     
    18321848static byte *f_xattr(int oid) { return &f_info[oid].x_attr; } 
    18331849static char *f_xchar(int oid) { return &f_info[oid].x_char; } 
    1834 static void feat_lore(int oid) { /* noop */ } 
     1850static void feat_lore(int oid) { (void)oid; /* noop */ } 
    18351851 
    18361852/* 
     
    18471863        int f_count = 0; 
    18481864        int i; 
     1865 
     1866        (void)obj; 
     1867        (void)name; 
    18491868 
    18501869        features = C_ZNEW(z_info->f_max, int); 
     
    22882307{ 
    22892308        byte attr = curs_attrs[CURS_KNOWN][(int)cursor]; 
     2309        (void)menu; 
     2310        (void)width; 
    22902311 
    22912312        c_prt(attr, format("%-45s: %s  (%s)", option_desc(oid), 
     
    22992320static bool update_option(char key, void *pgdb, int oid) 
    23002321{ 
     2322        (void)pgdb; 
     2323 
    23012324        /* Ignore arrow events */ 
    23022325        if (key == ARROW_LEFT || key == ARROW_RIGHT) 
     
    30243047 * CLEANUP 
    30253048 */ 
    3026  
    30273049static menu_action macro_actions[] = 
    30283050{ 
    3029         {LOAD_PREF, "Load a user pref file", 0}, 
     3051        { LOAD_PREF,  "Load a user pref file",    0, 0 }, 
    30303052#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 }, 
    30403062#endif /* ALLOW_MACROS */ 
    30413063}; 
     
    40294051static void do_dump_options(void *unused, const char *title) 
    40304052{ 
     4053        (void)unused; 
    40314054        dump_pref_file(option_dump, title, 20); 
    40324055} 
     
    40674090static char tag_opt_main(menu_type *menu, int oid) 
    40684091{ 
     4092        (void)menu; 
    40694093        if (option_actions[oid].id) 
    40704094                return option_actions[oid].id; 
     
    40754099static int valid_opt_main(menu_type *menu, int oid) 
    40764100{ 
     4101        (void)menu; 
    40774102        if (option_actions[oid].name) 
    40784103                return 1; 
     
    40854110        byte attr = curs_attrs[CURS_KNOWN][(int)cursor]; 
    40864111 
     4112        (void)menu; 
     4113        (void)width; 
    40874114        if (option_actions[oid].name) 
    40884115                c_prt(attr, option_actions[oid].name, row, col); 
     
    41294156static void do_cmd_self_knowledge(void *obj, const char *name) 
    41304157{ 
     4158        (void)obj; 
     4159        (void)name; 
     4160 
    41314161        /* display self knowledge we already know about. */ 
    41324162        self_knowledge(FALSE); 
     
    41354165static void do_cmd_knowledge_scores(void *obj, const char *name) 
    41364166{ 
     4167        (void)obj; 
     4168        (void)name; 
    41374169        show_scores(); 
    41384170} 
     
    41404172static void do_cmd_knowledge_history(void *obj, const char *name) 
    41414173{ 
     4174        (void)obj; 
     4175        (void)name; 
    41424176        history_display(); 
    41434177}