summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémie Courrèges-Anglas <jca@wxcvbn.org>2014-01-03 22:40:46 +0100
committerJérémie Courrèges-Anglas <jca@wxcvbn.org>2014-01-03 23:06:32 +0100
commite5b64c4f193eb01c81b93ec6e27d6d6bddbfd78b (patch)
treeb26feea94df2d060c7151ff5a2fe865b634c974e
parentb8d5ca85d9a6e6f42b8dbd6d47cab7bbcffeea90 (diff)
downloadratpoison-e5b64c4f193eb01c81b93ec6e27d6d6bddbfd78b.zip
Get rid of useless casts of xmalloc/realloc return value.
-rw-r--r--src/actions.c10
-rw-r--r--src/completions.c2
-rw-r--r--src/editor.c2
-rw-r--r--src/input.c4
-rw-r--r--src/main.c4
-rw-r--r--src/number.c2
-rw-r--r--src/sbuf.c6
-rw-r--r--src/screen.c2
8 files changed, 16 insertions, 16 deletions
diff --git a/src/actions.c b/src/actions.c
index 886b99a..4d24d75 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -575,7 +575,7 @@ add_keybinding (KeySym keysym, int state, char *cmd, rp_keymap *map)
{
/* double the key table size */
map->actions_size *= 2;
- map->actions = (rp_action*) xrealloc (map->actions, sizeof (rp_action) * map->actions_size);
+ map->actions = xrealloc (map->actions, sizeof (rp_action) * map->actions_size);
PRINT_DEBUG (("realloc()ed key_table %d\n", map->actions_size));
}
@@ -591,7 +591,7 @@ static void
replace_keybinding (rp_action *key_action, char *newcmd)
{
if (strlen (key_action->data) < strlen (newcmd))
- key_action->data = (char*) realloc (key_action->data, strlen (newcmd) + 1);
+ key_action->data = realloc (key_action->data, strlen (newcmd) + 1);
strcpy (key_action->data, newcmd);
}
@@ -637,7 +637,7 @@ keymap_new (char *name)
map = xmalloc (sizeof (rp_keymap));
map->name = xstrdup (name);
map->actions_size = 1;
- map->actions = (rp_action*) xmalloc (sizeof (rp_action) * map->actions_size);
+ map->actions = xmalloc (sizeof (rp_action) * map->actions_size);
map->actions_last = 0;
return map;
@@ -1704,7 +1704,7 @@ exec_completions (char *str)
return head;
}
- partial = (char*)xmalloc (n);
+ partial = xmalloc (n);
/* Read data from the file, split it into lines and store it in a
list. */
@@ -2403,7 +2403,7 @@ arg_array (struct list_head *head)
int i = 0;
struct cmdarg **args, *cur;
- args = (struct cmdarg **)xmalloc (sizeof (struct cmdarg *) * (list_size (head) + 1));
+ args = xmalloc (sizeof (struct cmdarg *) * (list_size (head) + 1));
list_for_each_entry (cur, head, node)
{
args[i] = cur;
diff --git a/src/completions.c b/src/completions.c
index a047a50..483a4d3 100644
--- a/src/completions.c
+++ b/src/completions.c
@@ -28,7 +28,7 @@ completions_new (completion_fn list_fn)
{
rp_completions *c;
- c = (rp_completions *) xmalloc (sizeof(rp_completions));
+ c = xmalloc (sizeof(rp_completions));
INIT_LIST_HEAD (&c->completion_list);
c->complete_fn = list_fn;
diff --git a/src/editor.c b/src/editor.c
index 3dabe89..c0d6918 100644
--- a/src/editor.c
+++ b/src/editor.c
@@ -111,7 +111,7 @@ input_line_new (char *prompt, char *preinput, int history_id, completion_fn fn)
/* Allocate some memory to start with */
line->size = strlen (preinput) + 100;
- line->buffer = (char *) xmalloc (line->size);
+ line->buffer = xmalloc (line->size);
/* load in the preinput */
strcpy (line->buffer, preinput);
diff --git a/src/input.c b/src/input.c
index 240cfed..8bc9de0 100644
--- a/src/input.c
+++ b/src/input.c
@@ -90,7 +90,7 @@ rp_mask_to_x11_mask (unsigned int mask)
/* &syms_per_code); */
/* *n_returned = 0; */
-/* codes = (KeyCode *)xmalloc (sizeof(KeyCode) * n_returned); */
+/* codes = xmalloc (sizeof(KeyCode) * n_returned); */
/* for (code = min_code; code < max_code; code++) */
/* for (code_col = 0; code_col < syms_per_code; code_col++) */
/* { */
@@ -99,7 +99,7 @@ rp_mask_to_x11_mask (unsigned int mask)
/* if (sym == s) */
/* { */
/* n_returned++; */
-/* codes = (KeyCode *)xrealloc (sizeof(KeyCode) * n_returned); */
+/* codes = xrealloc (sizeof(KeyCode) * n_returned); */
/* codes[n_returned-1] = code; */
/* } */
/* } */
diff --git a/src/main.c b/src/main.c
index f8d3fed..516abd5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -110,7 +110,7 @@ xvsprintf (char *fmt, va_list ap)
/* A reasonable starting value. */
size = strlen (fmt) + 1;
- buffer = (char *)xmalloc (size);
+ buffer = xmalloc (size);
while (1)
{
@@ -148,7 +148,7 @@ xvsprintf (char *fmt, va_list ap)
}
/* Resize the buffer and try again. */
- buffer = (char *)xrealloc (buffer, size);
+ buffer = xrealloc (buffer, size);
}
return xstrdup("<FAILURE>");
diff --git a/src/number.c b/src/number.c
index 332fb06..c8b508f 100644
--- a/src/number.c
+++ b/src/number.c
@@ -129,7 +129,7 @@ numset_new (void)
{
struct numset *ns;
- ns = (struct numset *)xmalloc (sizeof (struct numset));
+ ns = xmalloc (sizeof (struct numset));
numset_init (ns);
return ns;
}
diff --git a/src/sbuf.c b/src/sbuf.c
index d85ed47..77b8a04 100644
--- a/src/sbuf.c
+++ b/src/sbuf.c
@@ -27,12 +27,12 @@
struct sbuf *
sbuf_new (size_t initsz)
{
- struct sbuf *b = (struct sbuf*) xmalloc (sizeof (struct sbuf));
+ struct sbuf *b = xmalloc (sizeof (struct sbuf));
if (initsz < 1)
initsz = 1;
- b->data = (char*) xmalloc (initsz);
+ b->data = xmalloc (initsz);
b->maxsz = initsz;
b->data[0] = '\0';
@@ -73,7 +73,7 @@ sbuf_nconcat (struct sbuf *b, const char *str, int len)
if (b->maxsz < minsz)
{
- b->data = (char*) xrealloc (b->data, minsz);
+ b->data = xrealloc (b->data, minsz);
b->maxsz = minsz;
}
diff --git a/src/screen.c b/src/screen.c
index d843c04..83f0850 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -211,7 +211,7 @@ init_screens (int screen_arg, int screen_num)
rp_frame_numset = numset_new();
/* Initialize the screens */
- screens = (rp_screen *)xmalloc (sizeof (rp_screen) * num_screens);
+ screens = xmalloc (sizeof (rp_screen) * num_screens);
PRINT_DEBUG (("%d screens.\n", num_screens));
if (screen_arg)