summaryrefslogtreecommitdiffstats
path: root/src/ufo-roof-buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ufo-roof-buffer.c')
-rw-r--r--src/ufo-roof-buffer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ufo-roof-buffer.c b/src/ufo-roof-buffer.c
index f071481..eaf9b35 100644
--- a/src/ufo-roof-buffer.c
+++ b/src/ufo-roof-buffer.c
@@ -20,7 +20,7 @@ UfoRoofBuffer *ufo_roof_buffer_new(UfoRoofConfig *cfg, GError **error) {
// printf("Configuration: dataset: %u - %u fragments (%u streams x %u) x %u bytes\n", buffer->dataset_size, buffer->fragments_per_dataset, cfg->n_streams, buffer->fragments_per_stream, buffer->fragment_size);
buffer->ring_buffer = malloc(buffer->ring_size * buffer->dataset_size);
- buffer->n_fragments = (_Atomic int*)calloc(buffer->ring_size, sizeof(_Atomic int));
+ buffer->n_fragments = (_Atomic guint*)calloc(buffer->ring_size, sizeof(_Atomic int));
buffer->stream_fragment = (guint*)calloc(cfg->n_streams, sizeof(guint));
if ((!buffer->ring_buffer)||(!buffer->n_fragments)||(!buffer->stream_fragment)) {
@@ -73,7 +73,7 @@ gboolean ufo_roof_buffer_set_fragment(UfoRoofBuffer *buffer, guint stream_id, gu
// FIXME: Send semi-complete buffers further?
// FIXME: Or shall we drop more if larger buffers are allocated?
- for (int i = buffer->current_id; i <= (dataset_id - buffer->ring_size); i++)
+ for (guint i = buffer->current_id; i <= (dataset_id - buffer->ring_size); i++)
buffer->n_fragments[i%buffer->ring_size] = 0;
buffer->current_id = dataset_id - buffer->ring_size + 1;
@@ -83,8 +83,8 @@ gboolean ufo_roof_buffer_set_fragment(UfoRoofBuffer *buffer, guint stream_id, gu
}
// FIXME: This is builds events as it read from file in roof v.1 code. We can assemble fan projections directly here.
- void *dataset_buffer = buffer->ring_buffer + buffer_id * buffer->dataset_size;
- void *fragment_buffer = dataset_buffer + (stream_id * buffer->fragments_per_stream + fragment_id) * buffer->fragment_size;
+ uint8_t *dataset_buffer = buffer->ring_buffer + buffer_id * buffer->dataset_size;
+ uint8_t *fragment_buffer = dataset_buffer + (stream_id * buffer->fragments_per_stream + fragment_id) * buffer->fragment_size;
/* printf("buffer: %u (%u), packet: %u (%ux%u %u), packet_size: %u [%x]\n",
buffer_id, dataset_id, stream_id * buffer->fragments_per_stream + fragment_id, stream_id, buffer->fragments_per_stream, fragment_id, buffer->fragment_size,