Archived
1
0
Fork 0

src/queue.c: minor stuff. uint16_t -> unsigned int and a NULL check.

This commit is contained in:
Henrik Hautakoski 2010-11-28 10:03:18 +01:00
parent 463d432104
commit ce520fc35b

View file

@ -11,7 +11,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include "xalloc.h"
#include "queue.h"
@ -30,7 +29,7 @@ struct node {
};
struct ref {
uint16_t i;
unsigned int i;
struct node *n;
};
@ -74,6 +73,9 @@ void queue_destroy(queue_t q) {
void queue_enqueue(queue_t q, void *obj) {
if (q == NULL)
return;
if (q->head.n == NULL) {
q->tail.n = q->head.n = xmalloc(sizeof(struct node));
} else if (q->head.i + 1 >= BLOCK_SIZE) {