util/ra: spiff out select_reg_callback
[mesa.git] / src / util / register_allocate.c
index 85453d2529021dba62847e3b7608ea8009acd2c4..56517b5161cd834b817cffe42b1e8310ba984ea5 100644 (file)
@@ -171,8 +171,7 @@ struct ra_graph {
 
    unsigned int alloc; /**< count of nodes allocated. */
 
 
    unsigned int alloc; /**< count of nodes allocated. */
 
-   unsigned int (*select_reg_callback)(struct ra_graph *g, BITSET_WORD *regs,
-                                       void *data);
+   ra_select_reg_callback select_reg_callback;
    void *select_reg_callback_data;
 
    /* Temporary data for the algorithm to scratch around in */
    void *select_reg_callback_data;
 
    /* Temporary data for the algorithm to scratch around in */
@@ -565,9 +564,7 @@ ra_resize_interference_graph(struct ra_graph *g, unsigned int count)
 }
 
 void ra_set_select_reg_callback(struct ra_graph *g,
 }
 
 void ra_set_select_reg_callback(struct ra_graph *g,
-                                unsigned int (*callback)(struct ra_graph *g,
-                                                         BITSET_WORD *regs,
-                                                         void *data),
+                                ra_select_reg_callback callback,
                                 void *data)
 {
    g->select_reg_callback = callback;
                                 void *data)
 {
    g->select_reg_callback = callback;
@@ -868,7 +865,7 @@ ra_select(struct ra_graph *g)
             return false;
          }
 
             return false;
          }
 
-         r = g->select_reg_callback(g, select_regs, g->select_reg_callback_data);
+         r = g->select_reg_callback(n, select_regs, g->select_reg_callback_data);
       } else {
          /* Find the lowest-numbered reg which is not used by a member
           * of the graph adjacent to us.
       } else {
          /* Find the lowest-numbered reg which is not used by a member
           * of the graph adjacent to us.