beifg: Simplify the quite complicated way to divide a number by 2 in be_ifg_stat().
[libfirm] / ir / lpp / sp_matrix.h
index 20ed293..19df449 100644 (file)
@@ -1,15 +1,15 @@
-/**
- * Author:      Daniel Grund
- * Date:        07.04.2005
- * Copyright:   (c) Universitaet Karlsruhe
- * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
- * CVS-Id:      $Id: sp_matrix.h 16112 2007-10-07 15:50:49Z mallon $
- *
- * Sparse matrix storage with linked lists for rows and cols.
+/*
+ * This file is part of libFirm.
+ * Copyright (C) 2012 University of Karlsruhe.
  */
 
-#ifndef _SP_MATRIX_H
-#define _SP_MATRIX_H
+/**
+ * @file
+ * @brief   Sparse matrix storage with linked lists for rows and cols.
+ * @author  Daniel Grund
+ */
+#ifndef LPP_SP_MATRIX_H
+#define LPP_SP_MATRIX_H
 
 #include <stdio.h>
 
@@ -103,7 +103,7 @@ unsigned matrix_get_elem_size(void);
  * Save against removal of curr
  */
 #define matrix_foreach(m,curr) \
-               for (curr = matrix_first(m); curr; curr = matrix_next(m))
+               for (matrix_elem_t const *curr = matrix_first(m); curr; curr = matrix_next(m))
 
 /**
  * m    The matrix
@@ -112,7 +112,7 @@ unsigned matrix_get_elem_size(void);
  * Save against removal of curr
  */
 #define matrix_foreach_in_row(m,r,curr) \
-               for (curr = matrix_row_first(m, r); curr; curr = matrix_next(m))
+               for (matrix_elem_t const *curr = matrix_row_first(m, r); curr; curr = matrix_next(m))
 
 /**
  * m    The matrix
@@ -121,7 +121,7 @@ unsigned matrix_get_elem_size(void);
  * Save against removal of curr
  */
 #define matrix_foreach_in_col(m,c,curr) \
-               for (curr = matrix_col_first(m, c); curr; curr = matrix_next(m))
+               for (matrix_elem_t const *curr = matrix_col_first(m, c); curr; curr = matrix_next(m))
 
 /**
  * Changes the matrix into an equivalent one with maximal number zero-rows.