Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
-$Id: ncurses.c,v 1.312 2008/03/22 23:02:57 tom Exp $
+$Id: ncurses.c,v 1.313 2008/04/12 22:04:42 tom Exp $
***************************************************************************/
if (winstack == 0) {
len_winstack = 20;
- winstack = (WINSTACK *) malloc(len_winstack * sizeof(WINSTACK));
+ winstack = typeMalloc(WINSTACK, len_winstack);
} else if (need >= len_winstack) {
len_winstack = need;
- winstack = (WINSTACK *) realloc(winstack, len_winstack * sizeof(WINSTACK));
+ winstack = typeRealloc(WINSTACK, len_winstack, winstack);
}
winstack[level].text = txt_win;
winstack[level].frame = box_win;
memset(&state, 0, sizeof(state));
if ((need = wcsrtombs(0, &tmp, 0, &state)) > 0) {
unsigned have = need;
- result = (char *) calloc(have + 1, 1);
+ result = typeCalloc(char, have + 1);
tmp = src;
if (wcsrtombs(result, &tmp, have, &state) != have) {
free(result);
transient((FRAME *) 0, (char *) 0);
switch (c) {
case CTRL('C'):
- neww = (FRAME *) calloc(1, sizeof(FRAME));
+ neww = typeCalloc(FRAME, 1);
if ((neww->wind = getwindow()) == (WINDOW *) 0)
goto breakout;
if ((fp = fopen(DUMPFILE, "r")) == (FILE *) 0) {
transient(current, "Can't open screen dump file");
} else {
- neww = (FRAME *) calloc(1, sizeof(FRAME));
+ neww = typeCalloc(FRAME, 1);
neww->next = current->next;
neww->last = current;
size_t need = 12;
for (n = 0; t_tbl[n].name != 0; n++)
need += strlen(t_tbl[n].name) + 2;
- buf = (char *) malloc(need);
+ buf = typeMalloc(char, need);
}
sprintf(buf, "0x%02x = {", tlevel);
if (tlevel == 0) {
if (can_change_color()) {
short cp;
- all_colors = (RGB_DATA *) malloc(max_colors * sizeof(RGB_DATA));
+ all_colors = typeMalloc(RGB_DATA, max_colors);
for (cp = 0; cp < max_colors; ++cp) {
color_content(cp,
&all_colors[cp].red,