X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=ringbuffer.c;h=0e706f0f1ad6e906732f3bc95e8b653da53f9a6d;hb=5fd6c1a5acae2a52545e081ac4b38717c7295d80;hp=c45ed3fa21ba14f74c19459009b0e92affb634d2;hpb=002731cd3938f3be6b71651e56c062af1adcdec0;p=paraslash.git diff --git a/ringbuffer.c b/ringbuffer.c index c45ed3fa..0e706f0f 100644 --- a/ringbuffer.c +++ b/ringbuffer.c @@ -1,11 +1,9 @@ -/* - * Copyright (C) 2006-2009 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2006 Andre Noll , see file COPYING. */ /** \file ringbuffer.c Simple ringbuffer implementation */ +#include + #include "para.h" #include "ringbuffer.h" #include "string.h" @@ -43,11 +41,11 @@ struct ringbuffer */ struct ringbuffer *ringbuffer_new(unsigned size) { - struct ringbuffer *rb = para_calloc(sizeof(struct ringbuffer)); - rb->entries = para_calloc(size * sizeof(void *)); + struct ringbuffer *rb = zalloc(sizeof(struct ringbuffer)); + rb->entries = zalloc(size * sizeof(void *)); rb->size = size; return rb; -}; +} /** * Add one entry to a ringbuffer. @@ -94,7 +92,7 @@ void *ringbuffer_get(struct ringbuffer *rb, int num) * * \param rb The ringbuffer identifier * - * This function always succeeds and never returns a number greater than the + * \return This function always succeeds. It returns a number less than the * size of the ring buffer. */ unsigned ringbuffer_filled(struct ringbuffer *rb)