From 78c9c967bb81e701f399be48a12a34e4dc18e853 Mon Sep 17 00:00:00 2001 From: fanasina Date: Sun, 28 Jun 2026 20:37:35 +0200 Subject: [PATCH] update: fix minor warning on macos --- test.c | 1 - y_test_h.h | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/test.c b/test.c index 2bb6fde..9d5d055 100644 --- a/test.c +++ b/test.c @@ -204,7 +204,6 @@ TEST(f2mock_test){ int main(int argc, char **argv){ - //run_all_tests(); //run_all_tests_parallel(4); diff --git a/y_test_h.h b/y_test_h.h index eee47e2..10abdb1 100644 --- a/y_test_h.h +++ b/y_test_h.h @@ -1141,7 +1141,7 @@ do{ #ifndef __TEST_ARRAY_C_H__ #define __TEST_ARRAY_C_H__ -#include "ftest/ftest.h" +//#include "ftest/ftest.h" #ifndef min #define min(a,b) (((a)<(b)) ? (a) : (b)) @@ -2891,7 +2891,7 @@ void append_failed_list(struct failed_lists **fn_failed_list ,const char *name_f * match the id global (gives by OS) of the thread with the local (the program) id of thread \ */ \ long int id_of_thread_executed(const char * func_call_name){ \ - size_t id_from_self = pthread_self(); \ + size_t id_from_self = (size_t)pthread_self(); \ for(long int i=0; i<= parallel_nb; ++i){ \ if(id_thread_self[i] == id_from_self) \ return i; \ @@ -3523,10 +3523,10 @@ void head_all_parallel_run(struct timespec *start_t){ \ * print on the top of test in parallel \ */ \ void head_parallel_run(struct timespec *start_t, size_t id_thrd){ \ - sprintf(log_name_file_thrd[id_thrd],"log_thread_%ld_id_%ld",id_thrd,pthread_self()); \ + sprintf(log_name_file_thrd[id_thrd],"log_thread_%ld_id_%ld",id_thrd,(size_t)pthread_self()); \ f_ou_th[id_thrd] = fopen(log_name_file_thrd[id_thrd], "w+"); \ clock_gettime(CLOCK_REALTIME, start_t); \ - PRINT_HK_C(colors_f[k_GREEN], tab_hk_f[hk_EQ]," Running tests on thread[%ld] ========== ==threadID== %ld \n", id_thrd,pthread_self()); \ + PRINT_HK_C(colors_f[k_GREEN], tab_hk_f[hk_EQ]," Running tests on thread[%ld] ========== ==threadID== %ld \n", id_thrd,(size_t)pthread_self()); \ } \ \ /* \ @@ -3639,7 +3639,7 @@ run_parallel_tests(void *id) \ { \ \ size_t id_th=*(size_t*)id; \ - id_thread_self[id_th] = pthread_self(); \ + id_thread_self[id_th] = (size_t)pthread_self(); \ struct timespec start_t; \ head_parallel_run(&start_t, id_th); \ execute_test_parallel(id_th); \ @@ -3673,7 +3673,7 @@ init_parallel_test_() \ /* \ * on thread principale \ */ \ - sprintf(log_name_file_thrd[parallel_nb],"log_principal_thread_%ld_id_%ld",parallel_nb,pthread_self()); \ + sprintf(log_name_file_thrd[parallel_nb],"log_principal_thread_%ld_id_%ld",parallel_nb,(size_t)pthread_self()); \ f_ou_th[parallel_nb] = fopen(log_name_file_thrd[parallel_nb], "w+"); \ \ \ @@ -3690,7 +3690,7 @@ init_parallel_test_() \ count_fail_thread = malloc(parallel_nb * sizeof(size_t)); \ id_thread_self = malloc((parallel_nb + 1) * sizeof(size_t)); \ \ - id_thread_self[parallel_nb]= pthread_self();/* main thread */\ + id_thread_self[parallel_nb]= (size_t)pthread_self();/* main thread */\ \ for(size_t i=0; i