Skip to content

Commit

Permalink
Fixed build errors on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
mliberty1 committed Aug 10, 2023
1 parent 27812ee commit 7bcc01b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
16 changes: 9 additions & 7 deletions example/jls/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,15 @@ int on_info(struct app_s * self, int argc, char * argv[]) {
printf(" signal_type: %s\n", signals[i].signal_type ? "VSR" : "FSR");
printf(" data_type: 0x08%" PRIx32 "\n", signals[i].data_type);
printf(" sample_rate: %" PRIu32 "\n", signals[i].sample_rate);
printf(" samples_per_data: %" PRIu32 "\n", signals[i].samples_per_data);
printf(" sample_decimate_factor: %" PRIu32 "\n", signals[i].sample_decimate_factor);
printf(" entries_per_summary: %" PRIu32 "\n", signals[i].entries_per_summary);
printf(" summary_decimate_factor: %" PRIu32 "\n", signals[i].summary_decimate_factor);
printf(" annotation_decimate_factor: %" PRIu32 "\n", signals[i].annotation_decimate_factor);
printf(" utc_decimate_factor: %" PRIu32 "\n", signals[i].utc_decimate_factor);
printf(" sample_id_offset: %" PRId64 "\n", signals[i].sample_id_offset);
if (verbose) {
printf(" samples_per_data: %" PRIu32 "\n", signals[i].samples_per_data);
printf(" sample_decimate_factor: %" PRIu32 "\n", signals[i].sample_decimate_factor);
printf(" entries_per_summary: %" PRIu32 "\n", signals[i].entries_per_summary);
printf(" summary_decimate_factor: %" PRIu32 "\n", signals[i].summary_decimate_factor);
printf(" annotation_decimate_factor: %" PRIu32 "\n", signals[i].annotation_decimate_factor);
printf(" utc_decimate_factor: %" PRIu32 "\n", signals[i].utc_decimate_factor);
printf(" sample_id_offset: %" PRId64 "\n", signals[i].sample_id_offset);
}
printf(" units: %s\n", signals[i].units);
if (signals[i].signal_type == JLS_SIGNAL_TYPE_FSR) {
int64_t length = 0;
Expand Down
2 changes: 1 addition & 1 deletion example/jls_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static const char usage_str[] =
} \
} while (0)

static int usage() {
static int usage(void) {
printf("%s", usage_str);
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion example/performance.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ static int32_t print(const char * filename, uint32_t level) {
return 0;
}

static int usage() {
static int usage(void) {
printf("%s", usage_str);
return 1;
}
Expand Down
5 changes: 2 additions & 3 deletions src/backend_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <pthread.h>
#include <stdlib.h>
#include <errno.h>
#include <stdio.h>


// https://stackoverflow.com/questions/8883512/pthread-condition-variables-vs-win32-events-linux-vs-windows-ce
Expand All @@ -51,7 +50,7 @@ struct jls_twr_s {
struct jls_bkt_s * bk; // REQUIRED first entry
};

static struct event_flag* eventflag_create() {
static struct event_flag* eventflag_create(void) {
struct event_flag* ev;
ev = (struct event_flag*) malloc(sizeof(struct event_flag));
pthread_mutex_init(&ev->mutex, NULL);
Expand Down Expand Up @@ -173,7 +172,7 @@ int32_t jls_bk_fflush(struct jls_bkf_s * self) {
}

int32_t jls_bk_truncate(struct jls_bkf_s * self) {
int rc = ftruncate(fileno(self->fd), self->fpos);
int rc = ftruncate(self->fd, self->fpos);
if (rc) {
JLS_LOGE("truncate fail %d", errno);
return JLS_ERROR_IO;
Expand Down
2 changes: 1 addition & 1 deletion test/raw_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static void test_one_chunk(void **state) {
remove(filename);
}

static void construct_n_chunks() {
static void construct_n_chunks(void) {
struct jls_raw_s * j = NULL;
struct jls_chunk_header_s hdr;
uint32_t payload_prev_length = 0;
Expand Down

0 comments on commit 7bcc01b

Please sign in to comment.