cleanup: Use round_up2() instead of duplicating it.
[cparser] / adt / bitfiddle.h
index 624a2d6..334d3a5 100644 (file)
@@ -1,14 +1,20 @@
+/*
+ * This file is part of cparser.
+ * Copyright (C) 2012 Matthias Braun <matze@braunis.de>
+ */
+
 /**
  * @file
  * @date    28.9.2004
  * @brief   Functions from hackers delight.
  * @author  Sebastian Hack, Matthias Braun
- * @version $Id$
  */
 #ifndef _FIRM_BITFIDDLE_H_
 #define _FIRM_BITFIDDLE_H_
 
+#include <assert.h>
 #include <limits.h>
+
 #include "util.h"
 
 /* some functions here assume ints are 32 bit wide */
@@ -80,7 +86,7 @@ unsigned nlz(unsigned x) {
                        : "r" (x));
        return 31 - res;
 #else
-       x |= x >> 1;
+       x |= x >> 1;
        x |= x >> 2;
        x |= x >> 4;
        x |= x >> 8;