diff options
Diffstat (limited to 'src/itc.c')
-rw-r--r-- | src/itc.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -24,7 +24,7 @@ itc *itc_alloc(int nslots) ctx = calloc(1, sizeof(*ctx)); ctx->nslots = nslots; - ctx->slots = calloc(nslots, sizeof(*ctx->slots)); + ctx->slots = (void **)calloc(nslots, sizeof(*ctx->slots)); sem_init(&ctx->emptied, 0, nslots); sem_init(&ctx->occupied, 0, 0); @@ -41,7 +41,7 @@ void itc_free(itc **ctx, itc_free_element free_element) sem_destroy(&(*ctx)->emptied); sem_destroy(&(*ctx)->occupied); - free((*ctx)->slots); + free((void *)(*ctx)->slots); free(*ctx); *ctx = NULL; } @@ -55,7 +55,7 @@ void *itc_retrive(itc *ctx, int timeout_ms) return NULL; } - timespec_add_ms(gettimespec(&ts), timeout_ms); + timespec_add_ms(get_timespec(&ts), timeout_ms); if (sem_timedwait(&ctx->occupied, &ts)) { return NULL; @@ -75,7 +75,7 @@ int itc_inject(itc *ctx, int timeout_ms, void *element) return -1; } - timespec_add_ms(gettimespec(&ts), timeout_ms); + timespec_add_ms(get_timespec(&ts), timeout_ms); if (sem_timedwait(&ctx->emptied, &ts)) { return -1; |