From d452a7c5b0b5926d6f1aa339900704de63e79515 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Sun, 10 Mar 2024 19:41:47 +0100 Subject: [PATCH] long -> int64_t --- lab01/zad1/src/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lab01/zad1/src/main.c b/lab01/zad1/src/main.c index feb784e..8bea2c3 100644 --- a/lab01/zad1/src/main.c +++ b/lab01/zad1/src/main.c @@ -2,14 +2,15 @@ #include #include +#include #include #include void test_queue(size_t size) { - Queue *q = queue_new(size, sizeof(long)); + Queue *q = queue_new(size, sizeof(int64_t)); for (size_t i = 0; i < 50; ++i) { - long val = rand() % 1000; + int64_t val = rand() % 1000; printf("%zu: writing %ld to queue...\n", i, val); if (queue_write(q, &val)) { printf("%zu: successfully wrote %ld to queue!\n", i, val); @@ -25,7 +26,7 @@ void test_queue(size_t size) { break; } - long val = *(long*)val_ptr; + int64_t val = *(int64_t*)val_ptr; printf("%zu: read %ld from queue\n", i, val); free(val_ptr); } @@ -34,10 +35,10 @@ void test_queue(size_t size) { } void test_stack(size_t size) { - Stack *s = stack_new(size, sizeof(long)); + Stack *s = stack_new(size, sizeof(int64_t)); for (size_t i = 0; i < 50; ++i) { - long val = rand() % 1000; + int64_t val = rand() % 1000; printf("%zu: pushing %ld on top of stack...\n", i, val); if (stack_push(s, &val)) { printf("%zu: successfully pushed %ld on top of stack!\n", i, val); @@ -53,7 +54,7 @@ void test_stack(size_t size) { break; } - long val = *(long*)val_ptr; + int64_t val = *(int64_t*)val_ptr; printf("%zu: popped %ld from stack\n", i, val); free(val_ptr); }