]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - para.h
ogg_afh.c: Store the bitrate in KHz rather than in Hz.
[paraslash.git] / para.h
diff --git a/para.h b/para.h
index f41e8b67acfcf90fe07745fa30b4723245e8e8dd..a580b14c9946bf9d10d1062a49b445e295ba72ff 100644 (file)
--- a/para.h
+++ b/para.h
@@ -200,3 +200,11 @@ __printf_2_3 void para_log(int, const char*, ...);
                p = para_realloc(p, size); \
        } \
 }
+
+static inline int para_random(unsigned max)
+{
+       return ((max + 0.0) * (rand() / (RAND_MAX + 1.0)));
+}
+
+/* Round up x to a multiple of y */
+#define ROUND_UP(x, y) (((x) + (y - 1) / (y)) * (y))