I was annoyed by the compiler warnings about implicit conversions.
[libfirm] / ir / be / beifg_pointer.c
index 5f0b0e9..9d39d3c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -24,9 +24,7 @@
  * @date        18.11.2005
  * @version     $Id$
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <stdlib.h>
 
@@ -85,7 +83,7 @@ typedef struct _ptr_iter_t {
 
 /* PRIVATE FUNCTIONS */
 
-static void *ptr_irn_data_init(ir_phase *ph, ir_node *irn, void *data)
+static void *ptr_irn_data_init(ir_phase *ph, const ir_node *irn, void *data)
 {
        ptr_head_t *head = phase_alloc(ph, sizeof(*head));
        (void) irn;
@@ -96,14 +94,13 @@ static void *ptr_irn_data_init(ir_phase *ph, ir_node *irn, void *data)
 
 static ptr_element_t *ptr_get_new_element(ifg_pointer_t *ifg)
 {
-       ptr_element_t *new_element = obstack_alloc(&ifg->obst, sizeof(ptr_element_t));
-       memset(new_element, 0, sizeof(*new_element));
+       ptr_element_t *new_element = OALLOCZ(&ifg->obst, ptr_element_t);
        return new_element;
 }
 
 static ptr_head_t *ptr_get_new_head(ifg_pointer_t *ifg)
 {
-       ptr_head_t *new_element = obstack_alloc(&ifg->obst, sizeof(*new_element));
+       ptr_head_t *new_element = OALLOC(&ifg->obst, ptr_head_t);
        INIT_LIST_HEAD(&new_element->list);
        return new_element;
 }
@@ -614,8 +611,6 @@ static void ifg_pointer_neighbours_break(const void *self, void *iter)
        (void) self;
 
        bitset_free(it->visited_neighbours);
-
-       return;
 }
 
 static ir_node *ifg_pointer_nodes_begin(const void *self, void *iter)
@@ -672,7 +667,7 @@ static const be_ifg_impl_t ifg_pointer_impl = {
 
 be_ifg_t *be_ifg_pointer_new(const be_chordal_env_t *env)
 {
-       ifg_pointer_t *ifg      = xmalloc(sizeof(*ifg));
+       ifg_pointer_t *ifg = XMALLOC(ifg_pointer_t);
        ifg->impl               = &ifg_pointer_impl;
        ifg->env                        = env;