From 879bcc8acd73d74372b9f4980dd2c396bd76cca9 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 14 Sep 2025 10:53:35 +0200 Subject: [PATCH] Reacted on compiler warnings of Debian 13 Sid about calloc argument swap --- xorriso/filters.c | 8 ++++---- xorriso/findjob.c | 18 +++++++++--------- xorriso/sort_cmp.c | 4 ++-- xorriso/xorriso_timestamp.h | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/xorriso/filters.c b/xorriso/filters.c index 63746861..eddd8c08 100644 --- a/xorriso/filters.c +++ b/xorriso/filters.c @@ -1,7 +1,7 @@ /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. - Copyright 2007-2020 Thomas Schmitt, + Copyright 2007-2025 Thomas Schmitt, Provided under GPL version 2 or later. @@ -60,12 +60,12 @@ int Xorriso_extf_new(struct XorrisO *xorriso, struct Xorriso_extF **filter, struct Xorriso_extF *o= NULL; IsoExternalFilterCommand *cmd; - *filter= o= calloc(sizeof(struct Xorriso_extF), 1); + *filter= o= calloc(1, sizeof(struct Xorriso_extF)); if(o == NULL) goto failure; o->flag= flag; o->cmd= NULL; - o->cmd= cmd= calloc(sizeof(IsoExternalFilterCommand), 1); + o->cmd= cmd= calloc(1, sizeof(IsoExternalFilterCommand)); if(cmd == NULL) goto failure; cmd->version= 0; @@ -83,7 +83,7 @@ int Xorriso_extf_new(struct XorrisO *xorriso, struct Xorriso_extF **filter, cmd->path= strdup(path); if(cmd->path == NULL) goto failure; - cmd->argv= calloc(sizeof(char *), argc + 2); + cmd->argv= calloc(argc + 2, sizeof(char *)); if(cmd->argv == NULL) goto failure; for(i= 0; i < argc + 2; i++) diff --git a/xorriso/findjob.c b/xorriso/findjob.c index 96f9a4e3..10bbe68f 100644 --- a/xorriso/findjob.c +++ b/xorriso/findjob.c @@ -1,7 +1,7 @@ /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. - Copyright 2007-2024 Thomas Schmitt, + Copyright 2007-2025 Thomas Schmitt, Provided under GPL version 2 or later. @@ -891,8 +891,8 @@ int Findjob_set_num_filter(struct FindjoB *o, int test_type, t= o->cursor->test; t->test_type= test_type; - t->arg1= calloc(sizeof(int), 1); - t->arg2= calloc(sizeof(int), 1); + t->arg1= calloc(1, sizeof(int)); + t->arg2= calloc(1, sizeof(int)); if(t->arg1 == NULL || t->arg2 == NULL) return(-1); *((int *) t->arg1)= num1; @@ -913,8 +913,8 @@ int Findjob_set_size_filter(struct FindjoB *o, int test_type, t= o->cursor->test; t->test_type= test_type; - t->arg1= calloc(sizeof(off_t), 1); - t->arg2= calloc(sizeof(int), 1); + t->arg1= calloc(1, sizeof(off_t)); + t->arg2= calloc(1, sizeof(int)); if(t->arg1 == NULL || t->arg2 == NULL) return(-1); *((off_t *) t->arg1)= num1; @@ -935,8 +935,8 @@ int Findjob_set_off_t_filter(struct FindjoB *o, int test_type, t= o->cursor->test; t->test_type= test_type; - t->arg1= calloc(sizeof(off_t), 1); - t->arg2= calloc(sizeof(off_t), 1); + t->arg1= calloc(1, sizeof(off_t)); + t->arg2= calloc(1, sizeof(off_t)); if(t->arg1 == NULL || t->arg2 == NULL) return(-1); *((off_t *) t->arg1)= num1; @@ -971,7 +971,7 @@ int Findjob_set_test_hidden(struct FindjoB *o, int mode, int flag) t= o->cursor->test; t->test_type= 17; - t->arg1= calloc(sizeof(int), 1); + t->arg1= calloc(1, sizeof(int)); if(t->arg1 == NULL) return(-1); *((int *) t->arg1)= mode; @@ -1110,7 +1110,7 @@ int Findjob_set_uint64_filter(struct FindjoB *o, int test_type, uint64_t value, t= o->cursor->test; t->test_type= test_type; - t->arg1= calloc(sizeof(uint64_t), 1); + t->arg1= calloc(1, sizeof(uint64_t)); *((uint64_t *) t->arg1)= value; return(1); } diff --git a/xorriso/sort_cmp.c b/xorriso/sort_cmp.c index 7be85666..ddd27004 100644 --- a/xorriso/sort_cmp.c +++ b/xorriso/sort_cmp.c @@ -1,7 +1,7 @@ /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. - Copyright 2007-2024 Thomas Schmitt, + Copyright 2007-2025 Thomas Schmitt, Provided under GPL version 2 or later. @@ -354,7 +354,7 @@ int Xorriso_sorted_node_array(struct XorrisO *xorriso, if(ret<=0) return(ret); - *node_array= calloc(sizeof(IsoNode *), (*nodec)+1); + *node_array= calloc((*nodec) + 1, sizeof(IsoNode *)); if(*node_array==NULL) { sprintf(xorriso->info_text, "Cannot allocate memory for %d directory entries", *nodec); diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 73b4573f..b85958f4 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2025.06.24.171249" +#define Xorriso_timestamP "2025.09.14.085312"