Changeset 346
- Timestamp:
- 07/14/07 15:13:28 (1 year ago)
- Files:
-
- trunk/src/cave.c (modified) (2 diffs)
- trunk/src/cmd1.c (modified) (1 diff)
- trunk/src/cmd3.c (modified) (1 diff)
- trunk/src/cmd4.c (modified) (10 diffs)
- trunk/src/externs.h (modified) (4 diffs)
- trunk/src/files.c (modified) (2 diffs)
- trunk/src/init1.c (modified) (1 diff)
- trunk/src/init2.c (modified) (17 diffs)
- trunk/src/maid-x11.c (modified) (2 diffs)
- trunk/src/main-crb.c (modified) (3 diffs)
- trunk/src/main-sdl.c (modified) (8 diffs)
- trunk/src/monster2.c (modified) (1 diff)
- trunk/src/randart.c (modified) (3 diffs)
- trunk/src/snd-sdl.c (modified) (1 diff)
- trunk/src/squelch.c (modified) (1 diff)
- trunk/src/ui.c (modified) (4 diffs)
- trunk/src/ui.h (modified) (1 diff)
- trunk/src/util.c (modified) (7 diffs)
- trunk/src/variable.c (modified) (6 diffs)
- trunk/src/wizard1.c (modified) (2 diffs)
- trunk/src/z-file.c (modified) (4 diffs)
- trunk/src/z-form.c (modified) (3 diffs)
- trunk/src/z-term.c (modified) (14 diffs)
- trunk/src/z-virt.c (modified) (4 diffs)
- trunk/src/z-virt.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cave.c
r310 r346 2492 2492 2493 2493 /* Make hack */ 2494 MAKE(hack,vinfo_hack);2494 hack = ZNEW(vinfo_hack); 2495 2495 2496 2496 … … 2683 2683 2684 2684 /* Kill hack */ 2685 KILL(hack);2685 FREE(hack); 2686 2686 2687 2687 trunk/src/cmd1.c
r305 r346 507 507 int sound_msg; 508 508 509 /* Allocate an d wipe anarray of ordinary gold objects */510 C_MAKE(treasure,SV_GOLD_MAX, byte);511 (void)C_WIPE(treasure, SV_GOLD_MAX, byte); 509 /* Allocate an array of ordinary gold objects */ 510 treasure = C_ZNEW(SV_GOLD_MAX, byte); 511 512 512 513 513 /* Pick up all the ordinary gold objects */ trunk/src/cmd3.c
r333 r346 1412 1412 1413 1413 /* Allocate the "who" array */ 1414 C_MAKE(who,z_info->r_max, u16b);1414 who = C_ZNEW(z_info->r_max, u16b); 1415 1415 1416 1416 /* Collect matching monsters */ trunk/src/cmd4.c
r337 r346 423 423 424 424 /* Sort everything into group order */ 425 C_MAKE(g_list,max_group + 1, int);426 C_MAKE(g_offset,max_group + 1, int);425 g_list = C_ZNEW(max_group + 1, int); 426 g_offset = C_ZNEW(max_group + 1, int); 427 427 428 428 for (i = 0; i < o_count; i++) … … 441 441 442 442 /* The compact set of group names, in display order */ 443 C_MAKE(g_names,grp_cnt, const char **);443 g_names = C_ZNEW(grp_cnt, const char **); 444 444 445 445 for (i = 0; i < grp_cnt; i++) … … 1122 1122 } 1123 1123 1124 C_MAKE(default_join,m_count, join_t);1125 C_MAKE(monsters,m_count, int);1124 default_join = C_ZNEW(m_count, join_t); 1125 monsters = C_ZNEW(m_count, int); 1126 1126 1127 1127 m_count = 0; … … 1148 1148 display_knowledge("monsters", monsters, m_count, r_funcs, m_funcs, 1149 1149 " Sym Kills"); 1150 KILL(default_join);1150 FREE(default_join); 1151 1151 FREE(monsters); 1152 1152 } … … 1287 1287 int a_count = 0; 1288 1288 1289 C_MAKE(artifacts,z_info->a_max, int);1289 artifacts = C_ZNEW(z_info->a_max, int); 1290 1290 1291 1291 /* Collect valid artifacts */ … … 1403 1403 1404 1404 /* HACK: currently no more than 3 tvals for one ego type */ 1405 C_MAKE(egoitems,z_info->e_max * EGO_TVALS_MAX, int);1406 C_MAKE(default_join,z_info->e_max * EGO_TVALS_MAX, join_t);1405 egoitems = C_ZNEW(z_info->e_max * EGO_TVALS_MAX, int); 1406 default_join = C_ZNEW(z_info->e_max * EGO_TVALS_MAX, join_t); 1407 1407 1408 1408 for (i = 0; i < z_info->e_max; i++) … … 1426 1426 display_knowledge("ego items", egoitems, e_count, obj_f, ego_f, ""); 1427 1427 1428 KILL(default_join);1428 FREE(default_join); 1429 1429 FREE(egoitems); 1430 1430 } … … 1652 1652 int i; 1653 1653 1654 C_MAKE(objects,z_info->k_max, int);1654 objects = C_ZNEW(z_info->k_max, int); 1655 1655 1656 1656 for (i = 0; i < z_info->k_max; i++) … … 1729 1729 int f_count = 0; 1730 1730 int i; 1731 C_MAKE(features, z_info->f_max, int); 1731 1732 features = C_ZNEW(z_info->f_max, int); 1732 1733 1733 1734 for (i = 0; i < z_info->f_max; i++) … … 4200 4201 int gid = -1; 4201 4202 4202 C_MAKE(obj_group_order, TV_GOLD+1, int);4203 obj_group_order = C_ZNEW(TV_GOLD + 1, int); 4203 4204 atexit(cleanup_cmds); 4204 4205 trunk/src/externs.h
r336 r346 21 21 22 22 extern int max_macrotrigger; 23 extern c ptrmacro_template;24 extern c ptrmacro_modifier_chr;25 extern c ptrmacro_modifier_name[MAX_MACRO_MOD];26 extern c ptrmacro_trigger_name[MAX_MACRO_TRIGGER];27 extern c ptrmacro_trigger_keycode[2][MAX_MACRO_TRIGGER];23 extern char *macro_template; 24 extern char *macro_modifier_chr; 25 extern char *macro_modifier_name[MAX_MACRO_MOD]; 26 extern char *macro_trigger_name[MAX_MACRO_TRIGGER]; 27 extern char *macro_trigger_keycode[2][MAX_MACRO_TRIGGER]; 28 28 29 29 /* pathfind.c */ … … 140 140 extern char savefile[1024]; 141 141 extern s16b macro__num; 142 extern c ptr*macro__pat;143 extern c ptr*macro__act;142 extern char **macro__pat; 143 extern char **macro__act; 144 144 extern term *angband_term[ANGBAND_TERM_MAX]; 145 145 extern char angband_term_name[ANGBAND_TERM_MAX][16]; … … 176 176 extern byte tval_to_attr[128]; 177 177 extern char macro_buffer[1024]; 178 extern c ptrkeymap_act[KEYMAP_MODES][256];178 extern char *keymap_act[KEYMAP_MODES][256]; 179 179 extern const player_sex *sp_ptr; 180 180 extern const player_race *rp_ptr; … … 222 222 extern char *s_text; 223 223 extern s16b spell_list[MAX_REALMS][BOOKS_PER_REALM][SPELLS_PER_BOOK]; 224 extern c ptrANGBAND_SYS;225 extern c ptrANGBAND_GRAF;226 extern c ptrANGBAND_DIR;227 extern c ptrANGBAND_DIR_APEX;228 extern c ptrANGBAND_DIR_BONE;229 extern c ptrANGBAND_DIR_DATA;230 extern c ptrANGBAND_DIR_EDIT;231 extern c ptrANGBAND_DIR_FILE;232 extern c ptrANGBAND_DIR_HELP;233 extern c ptrANGBAND_DIR_INFO;234 extern c ptrANGBAND_DIR_SAVE;235 extern c ptrANGBAND_DIR_PREF;236 extern c ptrANGBAND_DIR_USER;237 extern c ptrANGBAND_DIR_XTRA;224 extern const char *ANGBAND_SYS; 225 extern const char *ANGBAND_GRAF; 226 extern char *ANGBAND_DIR; 227 extern char *ANGBAND_DIR_APEX; 228 extern char *ANGBAND_DIR_BONE; 229 extern char *ANGBAND_DIR_DATA; 230 extern char *ANGBAND_DIR_EDIT; 231 extern char *ANGBAND_DIR_FILE; 232 extern char *ANGBAND_DIR_HELP; 233 extern char *ANGBAND_DIR_INFO; 234 extern char *ANGBAND_DIR_SAVE; 235 extern char *ANGBAND_DIR_PREF; 236 extern char *ANGBAND_DIR_USER; 237 extern char *ANGBAND_DIR_XTRA; 238 238 extern bool item_tester_full; 239 239 extern byte item_tester_tval; trunk/src/files.c
r337 r346 480 480 } 481 481 } 482 482 483 /* Macro trigger */ 483 484 else if (tok >= 2) … … 494 495 495 496 /* Buffer for the trigger name */ 496 C_MAKE(buf,strlen(zz[0]) + 1, char);497 buf = C_ZNEW(strlen(zz[0]) + 1, char); 497 498 498 499 /* Simulate strcpy() and skip the '\' escape character */ trunk/src/init1.c
r325 r346 3924 3924 3925 3925 /* Allocate space for power */ 3926 C_MAKE(power,z_info->r_max, long);3926 power = C_ZNEW(z_info->r_max, long); 3927 3927 3928 3928 trunk/src/init2.c
r305 r346 301 301 302 302 303 /* Allocate the "*_info" array */ 304 C_MAKE(head->info_ptr, head->info_size, char); 305 306 /* Read the "*_info" array */ 303 /* Allocate and read the "*_info" array */ 304 head->info_ptr = C_RNEW(head->info_size, char); 307 305 fd_read(fd, head->info_ptr, head->info_size); 308 306 309 307 if (head->name_size) 310 308 { 311 /* Allocate the "*_name" array */ 312 C_MAKE(head->name_ptr, head->name_size, char); 313 314 /* Read the "*_name" array */ 309 /* Allocate and read the "*_name" array */ 310 head->name_ptr = C_RNEW(head->name_size, char); 315 311 fd_read(fd, head->name_ptr, head->name_size); 316 312 } … … 318 314 if (head->text_size) 319 315 { 320 /* Allocate the "*_text" array */ 321 C_MAKE(head->text_ptr, head->text_size, char); 322 323 /* Read the "*_text" array */ 316 /* Allocate and read the "*_text" array */ 317 head->text_ptr = C_RNEW(head->text_size, char); 324 318 fd_read(fd, head->text_ptr, head->text_size); 325 319 } … … 438 432 439 433 /* Allocate the "*_info" array */ 440 C_MAKE(head->info_ptr,head->info_size, char);434 head->info_ptr = C_ZNEW(head->info_size, char); 441 435 442 436 /* MegaHack -- make "fake" arrays */ 443 437 if (z_info) 444 438 { 445 C_MAKE(head->name_ptr,z_info->fake_name_size, char);446 C_MAKE(head->text_ptr,z_info->fake_text_size, char);439 head->name_ptr = C_ZNEW(z_info->fake_name_size, char); 440 head->text_ptr = C_ZNEW(z_info->fake_text_size, char); 447 441 } 448 442 … … 590 584 591 585 /* Free the "*_info" array */ 592 KILL(head->info_ptr);586 FREE(head->info_ptr); 593 587 594 588 /* MegaHack -- Free the "fake" arrays */ 595 589 if (z_info) 596 590 { 597 KILL(head->name_ptr);598 KILL(head->text_ptr);591 FREE(head->name_ptr); 592 FREE(head->text_ptr); 599 593 } 594 600 595 601 596 #endif /* ALLOW_TEMPLATES */ … … 1099 1094 inscriptions_count = 0; 1100 1095 1101 C_MAKE(inscriptions,AUTOINSCRIPTIONS_MAX, autoinscription);1096 inscriptions = C_ZNEW(AUTOINSCRIPTIONS_MAX, autoinscription); 1102 1097 } 1103 1098 … … 1128 1123 1129 1124 /* Array of grids */ 1130 C_MAKE(view_g,VIEW_MAX, u16b);1125 view_g = C_ZNEW(VIEW_MAX, u16b); 1131 1126 1132 1127 /* Array of grids */ 1133 C_MAKE(temp_g,TEMP_MAX, u16b);1128 temp_g = C_ZNEW(TEMP_MAX, u16b); 1134 1129 1135 1130 /* Hack -- use some memory twice */ … … 1141 1136 1142 1137 /* Padded into array */ 1143 C_MAKE(cave_info,DUNGEON_HGT, byte_256);1144 C_MAKE(cave_info2,DUNGEON_HGT, byte_256);1138 cave_info = C_ZNEW(DUNGEON_HGT, byte_256); 1139 cave_info2 = C_ZNEW(DUNGEON_HGT, byte_256); 1145 1140 1146 1141 /* Feature array */ 1147 C_MAKE(cave_feat,DUNGEON_HGT, byte_wid);1142 cave_feat = C_ZNEW(DUNGEON_HGT, byte_wid); 1148 1143 1149 1144 /* Entity arrays */ 1150 C_MAKE(cave_o_idx,DUNGEON_HGT, s16b_wid);1151 C_MAKE(cave_m_idx,DUNGEON_HGT, s16b_wid);1145 cave_o_idx = C_ZNEW(DUNGEON_HGT, s16b_wid); 1146 cave_m_idx = C_ZNEW(DUNGEON_HGT, s16b_wid); 1152 1147 1153 1148 #ifdef MONSTER_FLOW 1154 1149 1155 1150 /* Flow arrays */ 1156 C_MAKE(cave_cost,DUNGEON_HGT, byte_wid);1157 C_MAKE(cave_when,DUNGEON_HGT, byte_wid);1151 cave_cost = C_ZNEW(DUNGEON_HGT, byte_wid); 1152 cave_when = C_ZNEW(DUNGEON_HGT, byte_wid); 1158 1153 1159 1154 #endif /* MONSTER_FLOW */ … … 1168 1163 1169 1164 /* Objects */ 1170 C_MAKE(o_list,z_info->o_max, object_type);1165 o_list = C_ZNEW(z_info->o_max, object_type); 1171 1166 1172 1167 /* Monsters */ 1173 C_MAKE(mon_list,z_info->m_max, monster_type);1168 mon_list = C_ZNEW(z_info->m_max, monster_type); 1174 1169 1175 1170 … … 1177 1172 1178 1173 /* Lore */ 1179 C_MAKE(l_list,z_info->r_max, monster_lore);1174 l_list = C_ZNEW(z_info->r_max, monster_lore); 1180 1175 1181 1176 … … 1183 1178 1184 1179 /* Quests */ 1185 C_MAKE(q_list,MAX_Q_IDX, quest);1180 q_list = C_ZNEW(MAX_Q_IDX, quest); 1186 1181 1187 1182 … … 1189 1184 1190 1185 /* Allocate it */ 1191 C_MAKE(inventory,INVEN_TOTAL, object_type);1186 inventory = C_ZNEW(INVEN_TOTAL, object_type); 1192 1187 1193 1188 … … 1195 1190 1196 1191 /* Allocate the stores */ 1197 C_MAKE(store,MAX_STORES, store_type);1192 store = C_ZNEW(MAX_STORES, store_type); 1198 1193 1199 1194 /* Fill in each store */ … … 1209 1204 1210 1205 /* Allocate the stock */ 1211 C_MAKE(st_ptr->stock,st_ptr->stock_size, object_type);1206 st_ptr->stock = C_ZNEW(st_ptr->stock_size, object_type); 1212 1207 1213 1208 /* No table for the black market or home */ … … 1218 1213 1219 1214 /* Allocate the stock */ 1220 C_MAKE(st_ptr->table,st_ptr->table_size, s16b);1215 st_ptr->table = C_ZNEW(st_ptr->table_size, s16b); 1221 1216 1222 1217 /* Scan the choices */ … … 1341 1336 1342 1337 /* Allocate the alloc_kind_table */ 1343 C_MAKE(alloc_kind_table,alloc_kind_size, alloc_entry);1338 alloc_kind_table = C_ZNEW(alloc_kind_size, alloc_entry); 1344 1339 1345 1340 /* Get the table entry */ … … 1427 1422 1428 1423 /* Allocate the alloc_race_table */ 1429 C_MAKE(alloc_race_table,alloc_race_size, alloc_entry);1424 alloc_race_table = C_ZNEW(alloc_race_size, alloc_entry); 1430 1425 1431 1426 /* Get the table entry */ … … 1505 1500 1506 1501 /* Allocate the alloc_ego_table */ 1507 C_MAKE(alloc_ego_table,alloc_ego_size, alloc_entry);1502 alloc_ego_table = C_ZNEW(alloc_ego_size, alloc_entry); 1508 1503 1509 1504 /* Get the table entry */ trunk/src/maid-x11.c
r136 r346 337 337 338 338 /* Allocate image memory */ 339 C_MAKE(Data,total, char);339 Data = C_ZNEW(total, char); 340 340 341 341 Res = XCreateImage(dpy, visual, depth, ZPixmap, 0 /*offset*/, … … 346 346 if (Res == NULL) 347 347 { 348 KILL(Data);348 FREE(Data); 349 349 fclose(f); 350 350 return (NULL); trunk/src/main-crb.c
r185 r346 3714 3714 /*** Some Hooks for various routines ***/ 3715 3715 3716 /*3717 * Mega-Hack -- emergency lifeboat3718 */3719 static void *lifeboat = NULL;3720 3721 3722 /*3723 * Hook to handle "out of memory" errors3724 */3725 static void *hook_rpanic(huge size)3726 {3727 #pragma unused(size)3728 3729 /* Free the lifeboat */3730 if (lifeboat)3731 {3732 /* Free the lifeboat */3733 free(lifeboat);3734 3735 /* Forget the lifeboat */3736 lifeboat = NULL;3737 3738 /* Mega-Hack -- Warning */3739 mac_warning("Running out of Memory!\nTerminate this process now!");3740 3741 (void) pause();3742 }3743 3744 /* Mega-Hack -- Crash */3745 return (NULL);3746 }3747 3716 3748 3717 … … 3836 3805 3837 3806 3838 /* Hook in some "z-virt.c" hooks */3839 rnfree_aux = NULL;3840 ralloc_aux = NULL;3841 rpanic_aux = hook_rpanic;3842 3807 3843 3808 /* Hooks in some "z-util.c" hooks */ … … 3883 3848 SetCursor(GetQDGlobalsArrow(&tempCursor)); 3884 3849 3885 /* Mega-Hack -- Allocate a "lifeboat" */3886 lifeboat = malloc(16384);3887 3850 3888 3851 /* Quicktime -- Load sound effect resources */ trunk/src/main-sdl.c
r232 r346 132 132 * Directory names 133 133 */ 134 static c ptrANGBAND_DIR_XTRA_FONT;135 static c ptrANGBAND_DIR_XTRA_GRAF;134 static char *ANGBAND_DIR_XTRA_FONT; 135 static char *ANGBAND_DIR_XTRA_GRAF; 136 136 137 137 /* XXXXXXXXX */ 138 static c ptrANGBAND_DIR_USER_SDL;138 static char *ANGBAND_DIR_USER_SDL; 139 139 140 140 /* Later... … … 148 148 149 149 #define MAX_FONTS 20 150 c ptrFontList[MAX_FONTS];150 char *FontList[MAX_FONTS]; 151 151 static int num_fonts = 0; 152 152 … … 198 198 199 199 sdl_Font font; /* Font info */ 200 c ptrreq_font; /* Requested font */200 char *req_font; /* Requested font */ 201 201 int rows; /* Dimension in tiles */ 202 202 int cols; … … 508 508 { 509 509 /* The only memory reserved is the data */ 510 if (font->data) FREE(font->data); 511 512 font->data = NULL; 510 FREE(font->data); 513 511 } 514 512 … … 555 553 556 554 /* Make a very large temporary holding bin for pixel offset data XXX */ 557 C_MAKE(temp_array,NUM_GLYPHS * 1000, int);555 temp_array = C_ZNEW(NUM_GLYPHS * 1000, int); 558 556 559 557 /* Render and encode all the characters */ … … 604 602 605 603 /* Make a pixel access array for this font */ 606 C_MAKE(font->data,num_pixels, int);604 font->data = C_ZNEW(num_pixels, int); 607 605 608 606 /* Save the data gathered in our temporary array */ … … 788 786 { 789 787 bank->window = window; 790 791 C_MAKE(bank->buttons, MAX_BUTTONS, sdl_Button); 792 C_MAKE(bank->used, MAX_BUTTONS, bool); 788 bank->buttons = C_ZNEW(MAX_BUTTONS, sdl_Button); 789 bank->used = C_ZNEW(MAX_BUTTONS, bool); 793 790 bank->need_update = TRUE; 794 791 } … … 1118 1115 1119 1116 for (i = 0; i < MAX_FONTS; i++) 1120 { 1121 if (FontList[i]) string_free(FontList[i]); 1122 } 1117 string_free(FontList[i]); 1123 1118 } 1124 1119 trunk/src/monster2.c
r305 r346 582 582 583 583 /* Allocate the array */ 584 C_MAKE(race_count,z_info->r_max, u16b);584 race_count = C_ZNEW(z_info->r_max, u16b); 585 585 586 586 /* Scan the monster list */ trunk/src/randart.c
r189 r346 49 49 50 50 /* Temporary space for names, while reading and randomizing them. */ 51 c ptr*names;51 char **names; 52 52 53 53 /* Allocate the "names" array */ 54 54 /* ToDo: Make sure the memory is freed correctly in case of errors */ 55 C_MAKE(names,z_info->a_max, cptr);55 names = C_ZNEW(z_info->a_max, cptr); 56 56 57 57 for (i = 0; i < z_info->a_max; i++) … … 85 85 } 86 86 87 C_MAKE(a_base,name_size, char);87 a_base = C_ZNEW(name_size, char); 88 88 89 89 a_next = a_base + 1; /* skip first char */ … … 1367 1367 { 1368 1368 /* Allocate the "kinds" array */ 1369 C_MAKE(kinds,z_info->a_max, s16b);1369 kinds = C_ZNEW(z_info->a_max, s16b); 1370 1370 1371 1371 while (1) trunk/src/snd-sdl.c
r262 r346 43 43 int num; /* Number of samples for this event */ 44 44 Mix_Chunk *wavs[MAX_SAMPLES]; /* Sample array */ 45 c onst char *paths[MAX_SAMPLES]; /* Relative pathnames for samples */45 char *paths[MAX_SAMPLES]; /* Relative pathnames for samples */ 46 46 } sample_list; 47 47 trunk/src/squelch.c
r294 r346 708 708 709 709 /* Create the array */ 710 C_MAKE(choice,z_info->k_max, u16b);710 choice = C_ZNEW(z_info->k_max, u16b); 711 711 712 712 /* Iterate over all possible object kinds, finding ones which can be squelched */ trunk/src/ui.c
r270 r346 160 160 listener_list *link; 161 161 162 MAKE(link,listener_list);162 link = ZNEW(listener_list); 163 163 link->listener = observer; 164 164 link->next = target->observers; … … 1036 1036 void menu_set_filter(menu_type *menu, const int object_list[], int n) 1037 1037 { 1038 menu->object_list = object_list;1038 menu->object_list = (int *)object_list; 1039 1039 menu->filter_count = n; 1040 1040 } … … 1045 1045 void menu_release_filter(menu_type *menu) 1046 1046 { 1047 if (menu->object_list) 1048 FREE((void *)menu->object_list); 1049 menu->object_list = 0; 1047 FREE(menu->object_list); 1050 1048 menu->filter_count = menu->count; 1051 1049 } … … 1143 1141 void menu_destroy(menu_type *menu) 1144 1142 { 1145 if (menu->object_list) 1146 FREE((void *)menu->object_list); 1143 FREE(menu->object_list); 1147 1144 } 1148 1145 trunk/src/ui.h
r256 r346 313 313 int flags; 314 314 int filter_count; /* number of rows in current view */ 315 const int *object_list;/* optional filter (view) of menu objects */315 int *object_list; /* optional filter (view) of menu objects */ 316 316 int count; /* number of rows in underlying data set */ 317 317 const void *menu_data; /* the data used to access rows. */ trunk/src/util.c
r312 r346 680 680 { 681 681 /* Macro patterns */ 682 C_MAKE(macro__pat,MACRO_MAX, cptr);682 macro__pat = C_ZNEW(MACRO_MAX, cptr); 683 683 684 684 /* Macro actions */ 685 C_MAKE(macro__act,MACRO_MAX, cptr);685 macro__act = C_ZNEW(MACRO_MAX, cptr); 686 686 687 687 /* Success */ … … 704 704 } 705 705 706 FREE( (void*)macro__pat);707 FREE( (void*)macro__act);706 FREE(macro__pat); 707 FREE(macro__act); 708 708 709 709 /* Free the keymaps */ … … 753 753 /* Free modifier names */ 754 754 for (i = 0; i < num; i++) 755 {756 755 string_free(macro_modifier_name[i]); 757 }758 756 759 757 /* Free modifier chars */ 760 758 string_free(macro_modifier_chr); 761 macro_modifier_chr = NULL;762 759 } 763 760 … … 1408 1405 * The array[QUARK_MAX] of pointers to the quarks 1409 1406 */ 1410 static c ptr*quark__str;1407 static char **quark__str; 1411 1408 1412 1409 … … 1463 1460 { 1464 1461 /* Quark variables */ 1465 C_MAKE(quark__str, QUARK_MAX, cptr);1462 quark__str = C_ZNEW(QUARK_MAX, const char *); 1466 1463 1467 1464 /* Success */ … … 1479 1476 /* Free the "quarks" */ 1480 1477 for (i = 1; i < quark__num; i++) 1481 {1482 1478 string_free(quark__str[i]); 1483 }1484 1479 1485 1480 /* Free the list of "quarks" */ … … 1915 1910 { 1916 1911 /* Message variables */ 1917 C_MAKE(message__ptr,MESSAGE_MAX, u16b);1918 C_MAKE(message__buf,MESSAGE_BUF, char);1919 C_MAKE(message__type,MESSAGE_MAX, u16b);1920 C_MAKE(message__count,MESSAGE_MAX, u16b);1912 message__ptr = C_ZNEW(MESSAGE_MAX, u16b); 1913 message__buf = C_ZNEW(MESSAGE_BUF, char); 1914 message__type = C_ZNEW(MESSAGE_MAX, u16b); 1915 message__count = C_ZNEW(MESSAGE_MAX, u16b); 1921 1916 1922 1917 /* Init the message colors to white */ 1923 (void)C_BSET(message__color, TERM_WHITE, MSG_MAX, byte);1918 memset(message__color, TERM_WHITE, MSG_MAX); 1924 1919 1925 1920 /* Hack -- No messages yet */ trunk/src/variable.c
r305 r346 152 152 * Array of macro patterns [MACRO_MAX] 153 153 */ 154 c ptr*macro__pat;154 char **macro__pat; 155 155 156 156 /* 157 157 * Array of macro actions [MACRO_MAX] 158 158 */ 159 c ptr*macro__act;159 char **macro__act; 160 160 161 161 … … 185 185 186 186 int max_macrotrigger = 0; 187 c ptrmacro_template = NULL;188 c ptrmacro_modifier_chr;189 c ptrmacro_modifier_name[MAX_MACRO_MOD];190 c ptrmacro_trigger_name[MAX_MACRO_TRIGGER];191 c ptrmacro_trigger_keycode[2][MAX_MACRO_TRIGGER];187 char *macro_template = NULL; 188 char *macro_modifier_chr; 189 char *macro_modifier_name[MAX_MACRO_MOD]; 190 char *macro_trigger_name[MAX_MACRO_TRIGGER]; 191 char *macro_trigger_keycode[2][MAX_MACRO_TRIGGER]; 192 192 193 193 … … 538 538 * Keymaps for each "mode" associated with each keypress. 539 539 */ 540 c ptrkeymap_act[KEYMAP_MODES][256];540 char *keymap_act[KEYMAP_MODES][256]; 541 541 542 542 … … 683 683 * This variable is used to choose an appropriate "pref-xxx" file 684 684 */ 685 c ptrANGBAND_SYS = "xxx";685 const char *ANGBAND_SYS = "xxx"; 686 686 687 687 /* … … 689 689 * This variable is used to choose an appropriate "graf-xxx" file 690 690 */ 691 c ptrANGBAND_GRAF = "old";691 const char *ANGBAND_GRAF = "old"; 692 692 693 693 /* … … 695 695 * This variable is not actually used anywhere in the code 696 696 */ 697 cptr ANGBAND_DIR; 698 699 /* 700 * High score files (binary) 701 * These files may be portable between platforms 702 */ 703 cptr ANGBAND_DIR_APEX; 704 705 /* 706 * Bone files for player ghosts (ascii) 707 * These files are portable between platforms 708 */ 709 cptr ANGBAND_DIR_BONE; 710 711 /* 712 * Binary image files for the "*_info" arrays (binary) 713 * These files are not portable between platforms 714 */ 715 cptr ANGBAND_DIR_DATA; 716 717 /* 718 * Textual template files for the "*_info" arrays (ascii) 719 * These files are portable between platforms 720 */ 721 cptr ANGBAND_DIR_EDIT; 722 723 /* 724 * Various extra files (ascii) 725 * These files may be portable between platforms 726 */ 727 cptr ANGBAND_DIR_FILE; 728 729 /* 730 * Help files (normal) for the online help (ascii) 731 * These files are portable between platforms 732 */ 733 cptr ANGBAND_DIR_HELP; 734 735 /* 736 * Help files (spoilers) for the online help (ascii) 737 * These files are portable between platforms 738 */ 739 cptr ANGBAND_DIR_INFO; 740 741 /* 742 * Savefiles for current characters (binary) 743 * These files are portable between platforms 744 */ 745 cptr ANGBAND_DIR_SAVE; 746 747 /* 748 * Default user "preference" files (ascii) 749 * These files are rarely portable between platforms 750 */ 751 cptr ANGBAND_DIR_PREF; 752 753 /* 754 * User defined "preference" files (ascii) 755 * These files are rarely portable between platforms 756 */ 757 cptr ANGBAND_DIR_USER; 758 759 /* 760 * Various extra files (binary) 761 * These files are rarely portable between platforms 762 */ 763 cptr ANGBAND_DIR_XTRA; 697 char *ANGBAND_DIR; 698 699 /* 700 * Various lib/ sub-directories. 701 */ 702 char *ANGBAND_DIR_APEX; 703 char *ANGBAND_DIR_BONE; 704 char *ANGBAND_DIR_DATA; 705 char *ANGBAND_DIR_EDIT; 706 char *ANGBAND_DIR_FILE; 707 char *ANGBAND_DIR_HELP; 708 char *ANGBAND_DIR_INFO; 709 char *ANGBAND_DIR_SAVE; 710 char *ANGBAND_DIR_PREF; 711 char *ANGBAND_DIR_USER; 712 char *ANGBAND_DIR_XTRA; 764 713 765 714 trunk/src/wizard1.c
r189 r346 577 577 578 578 /* Allocate the "who" array */ 579 C_MAKE(who,z_info->r_max, u16b);579 who = C_ZNEW(z_info->r_max, u16b); 580 580 581 581 /* Scan the monsters (except the ghost) */ … … 715 715 716 716 /* Allocate the "who" array */ 717 C_MAKE(who,z_info->r_max, u16b);717 who = C_ZNEW(z_info->r_max, u16b); 718 718 719 719 /* Scan the monsters */ trunk/src/z-file.c
r213 r346 841 841 { 842 842 HANDLE h; 843 c onst char *first_file;843 char *first_file; 844 844 }; 845 845 … … 859 859 860 860 /* Allocate for the handle */ 861 dir = ralloc(sizeofdir);861 dir = ZNEW(ang_dir); 862 862 if (!dir) return NULL; 863 863 … … 933 933 { 934 934 DIR *d; 935 c onst char *dirname;935 char *dirname; 936 936 }; 937 937 … … 947 947 948 948 /* Allocate memory for the handle */ 949 dir = ralloc(sizeofdir);949 dir = ZNEW(ang_dir); 950 950 if (!dir) 951 951 { trunk/src/z-form.c
r232 r346 692 692 { 693 693 format_len = 1024; 694 C_MAKE(format_buf, format_len, char); 694 format_buf = C_RNEW(format_len, char); 695 format_buf[0] = 0; 695 696 } 696 697 … … 710 711 711 712 /* Grow the buffer */ 712 KILL(format_buf);713 713 format_len = format_len * 2; 714 C_MAKE(format_buf, format_len, char);714 format_buf = mem_realloc(format_buf, format_len); 715 715 } 716 716 … … 721 721 void vformat_kill(void) 722 722 { 723 KILL(format_buf);723 FREE(format_buf); 724 724 } 725 725 trunk/src/z-term.c
r120 r346 290 290 { 291 291 /* Free the window access arrays */ 292 KILL(s->a);293 KILL(s->c);292 FREE(s-&
