Revision 74a5d4ae output.c

View differences:

output.c
20 20
static int buff_size;
21 21

  
22 22
struct outbuf {
23
  uint8_t *data;
23
  void *data;
24 24
  int size;
25 25
  int id;
26 26
  uint64_t timestamp;
......
33 33
    int i;
34 34

  
35 35
    buff_size = bufsize;
36
    buff = (struct outbuf *)malloc(sizeof(struct outbuf) * buff_size);
36
    buff = malloc(sizeof(struct outbuf) * buff_size);
37 37
    if (!buff) {
38 38
     fprintf(stderr, "Error: can't allocate output buffer\n");
39 39
     exit(1);
......
148 148
      exit(-1);
149 149
    }
150 150
    /* We previously flushed, so we know that c->id is free */
151
    buff[c->id % buff_size].data = (uint8_t *)malloc(c->size);
151
    buff[c->id % buff_size].data = malloc(c->size);
152 152
    memcpy(buff[c->id % buff_size].data, c->data, c->size);
153 153
    buff[c->id % buff_size].size = c->size;
154 154
    buff[c->id % buff_size].id = c->id;

Also available in: Unified diff