wmc: Get rid of xmalloc casts.
This commit is contained in:
parent
1659f53c3a
commit
1916cb1e19
|
@ -437,7 +437,7 @@ static void do_add_token(tok_e type, token_t *tok, const char *code)
|
||||||
|
|
||||||
static lanmsg_t *new_lanmsg(lan_cp_t *lcp, WCHAR *msg)
|
static lanmsg_t *new_lanmsg(lan_cp_t *lcp, WCHAR *msg)
|
||||||
{
|
{
|
||||||
lanmsg_t *lmp = (lanmsg_t *)xmalloc(sizeof(lanmsg_t));
|
lanmsg_t *lmp = xmalloc(sizeof(lanmsg_t));
|
||||||
lmp->lan = lcp->language;
|
lmp->lan = lcp->language;
|
||||||
lmp->cp = lcp->codepage;
|
lmp->cp = lcp->codepage;
|
||||||
lmp->msg = msg;
|
lmp->msg = msg;
|
||||||
|
|
|
@ -128,7 +128,7 @@ char *dup_basename(const char *name, const char *ext)
|
||||||
namelen = strlen(name);
|
namelen = strlen(name);
|
||||||
|
|
||||||
/* +4 for later extension and +1 for '\0' */
|
/* +4 for later extension and +1 for '\0' */
|
||||||
base = (char *)xmalloc(namelen +4 +1);
|
base = xmalloc(namelen +4 +1);
|
||||||
strcpy(base, name);
|
strcpy(base, name);
|
||||||
if(!strcasecmp(name + namelen-extlen, ext))
|
if(!strcasecmp(name + namelen-extlen, ext))
|
||||||
{
|
{
|
||||||
|
@ -172,7 +172,7 @@ char *xstrdup(const char *str)
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
assert(str != NULL);
|
assert(str != NULL);
|
||||||
s = (char *)xmalloc(strlen(str)+1);
|
s = xmalloc(strlen(str)+1);
|
||||||
return strcpy(s, str);
|
return strcpy(s, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ WCHAR *xunistrdup(const WCHAR * str)
|
||||||
WCHAR *s;
|
WCHAR *s;
|
||||||
|
|
||||||
assert(str != NULL);
|
assert(str != NULL);
|
||||||
s = (WCHAR *)xmalloc((unistrlen(str)+1) * sizeof(WCHAR));
|
s = xmalloc((unistrlen(str)+1) * sizeof(WCHAR));
|
||||||
return unistrcpy(s, str);
|
return unistrcpy(s, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ int main(int argc,char *argv[])
|
||||||
cmdlen = 4; /* for "wmc " */
|
cmdlen = 4; /* for "wmc " */
|
||||||
for(i = 1; i < argc; i++)
|
for(i = 1; i < argc; i++)
|
||||||
cmdlen += strlen(argv[i]) + 1;
|
cmdlen += strlen(argv[i]) + 1;
|
||||||
cmdline = (char *)xmalloc(cmdlen);
|
cmdline = xmalloc(cmdlen);
|
||||||
strcpy(cmdline, "wmc ");
|
strcpy(cmdline, "wmc ");
|
||||||
for(i = 1; i < argc; i++)
|
for(i = 1; i < argc; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue