Ignore:
Timestamp:
11/29/18 10:12:59 (2 years ago)
Author:
Jacob Van Walraven <jcv9@…>
Branches:
develop
Children:
fdf23b8
Parents:
d74ca03
Message:

Apply changes required for pull request #81

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/data-struct/buckets.c

    r88b9798 r2193905  
    2626
    2727#include <stdlib.h>
    28 #include <assert.h>
    2928#include <string.h>
    3029#include "buckets.h"
     
    183182        libtrace_bucket_node_t tmp;
    184183
    185         /*assert(id != 0);*/
    186184        if (id == 0) {
    187185                fprintf(stderr, "bucket ID cannot be 0 in libtrace_release_bucket_id()\n");
     
    191189        pthread_mutex_lock(&b->lock);
    192190        bnode = b->packets[id];
    193         /*assert(bnode != NULL);*/
    194         if (bnode == NULL) {
     191        if (!bnode) {
    195192                fprintf(stderr, "bucket ID %lu is NULL in libtrace_release_bucket_id()\n", id);
    196193                return;
     
    204201                s = id - bnode->startindex;
    205202        }
    206         /*assert(s < bnode->slots);*/
    207203        if (s >= bnode->slots) {
    208204                fprintf(stderr, "Error in libtrace_release_bucket_id()\n");
    209205                return;
    210206        }
    211         /*assert(bnode->released[s] != 0);*/
    212207        if (bnode->released[s] == 0) {
    213208                fprintf(stderr, "Error in libtrace_release_bucket_id()\n");
     
    244239                        break;
    245240
    246                 /*assert(lnode->next != NULL);*/
    247                 if (lnode->next == NULL) {
     241                if (!lnode->next) {
    248242                        fprintf(stderr, "Error in libtrace_release_bucket_id()\n");
    249243                        return;
Note: See TracChangeset for help on using the changeset viewer.