if (a->name && (strstr (a->name, s) == a->name))
{
if (!a_list) /* init */
- a_cur = a_list = (ALIAS *) safe_malloc (sizeof (ALIAS));
+ a_cur = a_list = safe_malloc (sizeof (ALIAS));
else
{
- a_cur->next = (ALIAS *) safe_malloc (sizeof (ALIAS));
+ a_cur->next = safe_malloc (sizeof (ALIAS));
a_cur = a_cur->next;
}
memcpy (a_cur, a, sizeof (ALIAS));
strfcpy (buf, NONULL(Mask.pattern), sizeof (buf));
if (mutt_get_field (_("File Mask: "), buf, sizeof (buf), 0) == 0)
{
- regex_t *rx = (regex_t *) safe_malloc (sizeof (regex_t));
+ regex_t *rx = safe_malloc (sizeof (regex_t));
char *s = buf;
int not = 0, err;
{
NNTP_SERVER *nserv = CurrentNewsSrv;
NNTP_DATA *nntp_data;
- regex_t *rx = (regex_t *) safe_malloc (sizeof (regex_t));
+ regex_t *rx = safe_malloc (sizeof (regex_t));
char *s = buf;
int rc, j = menu->current;
void ci_start_color (void)
{
memset (ColorDefs, A_NORMAL, sizeof (int) * MT_COLOR_MAX);
- ColorQuote = (int *) safe_malloc (COLOR_QUOTE_INIT * sizeof (int));
+ ColorQuote = safe_malloc (COLOR_QUOTE_INIT * sizeof (int));
memset (ColorQuote, A_NORMAL, sizeof (int) * COLOR_QUOTE_INIT);
ColorQuoteSize = COLOR_QUOTE_INIT;
ColorQuoteUsed = 0;
i++;
}
- p = (COLOR_LIST *) safe_malloc (sizeof (COLOR_LIST));
+ p = safe_malloc (sizeof (COLOR_LIST));
p->next = ColorList;
ColorList = p;
if (option(OPTUNCOLLAPSENEW) && oldcount && check != MUTT_REOPENED
&& ((Sort & SORT_MASK) == SORT_THREADS))
{
- save_new = (HEADER **) safe_malloc (sizeof (HEADER *) * (ctx->msgcount - oldcount));
+ save_new = safe_malloc (sizeof (HEADER *) * (ctx->msgcount - oldcount));
for (j = oldcount; j < ctx->msgcount; j++)
save_new[j-oldcount] = ctx->hdrs[j];
}
struct hash_elem *ptr;
unsigned int h;
- ptr = (struct hash_elem *) safe_malloc (sizeof (struct hash_elem));
+ ptr = safe_malloc (sizeof (struct hash_elem));
h = table->hash_string ((unsigned char *) key, table->nelem);
ptr->key = key;
ptr->data = data;
}
}
- rx = (regex_t *) safe_malloc (sizeof (regex_t));
+ rx = safe_malloc (sizeof (regex_t));
if ((e = REGCOMP (rx, p, flags)) != 0)
{
regerror (e, rx, err->data, err->dsize);
if (siz == 0)
return 0;
- if ((p = (void *) malloc (siz)) == 0) /* __MEM_CHECKED__ */
+ if ((p = malloc (siz)) == 0) /* __MEM_CHECKED__ */
{
mutt_error _("Out of memory!");
sleep (1);
}
if (*p)
- r = (void *) realloc (*p, siz); /* __MEM_CHECKED__ */
+ r = realloc (*p, siz); /* __MEM_CHECKED__ */
else
{
/* realloc(NULL, nbytes) doesn't seem to work under SunOS 4.1.x --- __MEM_CHECKED__ */
- r = (void *) malloc (siz); /* __MEM_CHECKED__ */
+ r = malloc (siz); /* __MEM_CHECKED__ */
}
if (!r)
if (!s || !*s)
return 0;
l = strlen (s) + 1;
- p = (char *)safe_malloc (l);
+ p = safe_malloc (l);
memcpy (p, s, l);
return (p);
}
* for the read/write methods. */
void mutt_sasl_setup_conn (CONNECTION* conn, sasl_conn_t* saslconn)
{
- SASL_DATA* sasldata = (SASL_DATA*) safe_malloc (sizeof (SASL_DATA));
+ SASL_DATA* sasldata = safe_malloc (sizeof (SASL_DATA));
/* work around sasl_getprop aliasing issues */
const void* tmp;
int pin[2], pout[2];
int devnull;
- tunnel = (TUNNEL_DATA*) safe_malloc (sizeof (TUNNEL_DATA));
+ tunnel = safe_malloc (sizeof (TUNNEL_DATA));
conn->sockdata = tunnel;
mutt_message (_("Connecting with \"%s\"..."), Tunnel);
for (; p; p = p->next)
{
- t = (LIST *) safe_malloc (sizeof (LIST));
+ t = safe_malloc (sizeof (LIST));
t->data = safe_strdup (p->data);
t->next = NULL;
if (l)
int i;
char *fingerprint, *pf;
- pf = fingerprint = (char *)safe_malloc ((length * 2) + 1);
+ pf = fingerprint = safe_malloc ((length * 2) + 1);
for (i = 0; i < length; i++)
{
(size1 && string1 <= (ptr) && (ptr) <= string1 + size1)
/* (Re)Allocate N items of type T using malloc, or fail. */
-#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t)))
-#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t)))
+#define TALLOC(n, t) (malloc ((n) * sizeof (t)))
+#define RETALLOC(addr, n, t) ((addr) = realloc (addr, (n) * sizeof (t)))
#define RETALLOC_IF(addr, n, t) \
if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t)
#define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t)))
#ifdef MATCH_MAY_ALLOCATE
#define INIT_FAIL_STACK() \
do { \
- fail_stack.stack = (fail_stack_elt_t *) \
+ fail_stack.stack = \
REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \
\
if (fail_stack.stack == NULL) \
#define DOUBLE_FAIL_STACK(fail_stack) \
((fail_stack).size > (unsigned) (re_max_failures * MAX_FAILURE_ITEMS) \
? 0 \
- : ((fail_stack).stack = (fail_stack_elt_t *) \
+ : ((fail_stack).stack = \
REGEX_REALLOCATE_STACK ((fail_stack).stack, \
(fail_stack).size * sizeof (fail_stack_elt_t), \
((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \
* sizeof (fail_stack_elt_t)));
#else /* not emacs */
if (! fail_stack.stack)
- fail_stack.stack
- = (fail_stack_elt_t *) malloc (fail_stack.size /* __MEM_CHECKED__ */
- * sizeof (fail_stack_elt_t));
+ fail_stack.stack = malloc (fail_stack.size /* __MEM_CHECKED__ */
+ * sizeof (fail_stack_elt_t));
else
- fail_stack.stack
- = (fail_stack_elt_t *) realloc (fail_stack.stack, /* __MEM_CHECKED__ */
- (fail_stack.size
- * sizeof (fail_stack_elt_t)));
+ fail_stack.stack = realloc (fail_stack.stack, /* __MEM_CHECKED__ */
+ (fail_stack.size
+ * sizeof (fail_stack_elt_t)));
#endif /* not emacs */
}
if (!re_comp_buf.buffer)
{
- re_comp_buf.buffer = (unsigned char *) malloc (200); /* __MEM_CHECKED__ */
+ re_comp_buf.buffer = malloc (200); /* __MEM_CHECKED__ */
if (re_comp_buf.buffer == NULL)
return gettext (re_error_msgid[(int) REG_ESPACE]);
re_comp_buf.allocated = 200;
- re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH); /* __MEM_CHECKED__ */
+ re_comp_buf.fastmap = malloc (1 << BYTEWIDTH); /* __MEM_CHECKED__ */
if (re_comp_buf.fastmap == NULL)
return gettext (re_error_msgid[(int) REG_ESPACE]);
}
{
unsigned i;
- preg->translate
- = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE /* __MEM_CHECKED__ */
- * sizeof (*(RE_TRANSLATE_TYPE)0));
+ preg->translate = malloc (CHAR_SET_SIZE /* __MEM_CHECKED__ */
+ * sizeof (*(RE_TRANSLATE_TYPE)0));
if (preg->translate == NULL)
return (int) REG_ESPACE;
if (mutt_strncasecmp ("sha", md, 3) == 0)
{
l = strlen (md) + 2;
- micalg = (char *)safe_malloc (l);
+ micalg = safe_malloc (l);
snprintf (micalg, l, "sha-%s", md +3);
}
else