From 32d079ffc7163567191f1e6deb876971d4e6c77a Mon Sep 17 00:00:00 2001 From: Nils Homer Date: Thu, 13 Nov 2025 15:47:39 -0700 Subject: [PATCH 1/2] fix: fix build issues with gcc-14 --- src/dwgsim.c | 4 ++-- src/dwgsim_opt.h | 6 +++--- src/mut.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dwgsim.c b/src/dwgsim.c index 2316cf2..a89156d 100644 --- a/src/dwgsim.c +++ b/src/dwgsim.c @@ -901,7 +901,7 @@ void dwgsim_core(dwgsim_opt_t * opt) } qstr[i] = 0; // BWA - FILE *fpo = (0 == j) ? opt->fp_bwa1: opt->fp_bwa2; + gzFile fpo = (0 == j) ? opt->fp_bwa1: opt->fp_bwa2; if (NULL != fpo) { if(ILLUMINA == opt->data_type || IONTORRENT == opt->data_type) { gzprintf(fpo, "@%s%s%s_%u_%u_%1u_%1u_%1u_%1u_%d:%d:%d_%d:%d:%d_%llx/%d\n", @@ -1009,7 +1009,7 @@ void dwgsim_core(dwgsim_opt_t * opt) } } // BWA - FILE *fpo = (0 == j) ? opt->fp_bwa1: opt->fp_bwa2; + gzFile fpo = (0 == j) ? opt->fp_bwa1: opt->fp_bwa2; if (NULL != fpo) { if(ILLUMINA == opt->data_type || IONTORRENT == opt->data_type) { gzprintf(fpo, "@%s%s%s_%u_%u_%1u_%1u_%1u_%1u_%d:%d:%d_%d:%d:%d_%llx/%d\n", diff --git a/src/dwgsim_opt.h b/src/dwgsim_opt.h index a2abbe8..d8725b4 100644 --- a/src/dwgsim_opt.h +++ b/src/dwgsim_opt.h @@ -45,9 +45,9 @@ typedef struct { char *fn_regions_bed; FILE *fp_mut; FILE *fp_vcf; - gzFile *fp_bfast; - gzFile *fp_bwa1; - gzFile *fp_bwa2; + gzFile fp_bfast; + gzFile fp_bwa1; + gzFile fp_bwa2; FILE *fp_fa; FILE *fp_fai; char *read_prefix; diff --git a/src/mut.h b/src/mut.h index 56504a4..be2237a 100644 --- a/src/mut.h +++ b/src/mut.h @@ -55,10 +55,10 @@ mutseq_init(); void mutseq_destroy(mutseq_t *seq); -inline int32_t +int32_t mut_get_ins_bytes(int32_t n); -inline uint8_t* +uint8_t* mut_get_ins_long_n(uint8_t *ins, uint32_t *n); mut_t From 57fcb963b7e6608e69e7e71c601e9c933c6a30fb Mon Sep 17 00:00:00 2001 From: Nils Homer Date: Thu, 13 Nov 2025 15:53:38 -0700 Subject: [PATCH 2/2] fix: gcc-15 build issues --- src/dwgsim.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dwgsim.c b/src/dwgsim.c index a89156d..a38cfe5 100644 --- a/src/dwgsim.c +++ b/src/dwgsim.c @@ -174,7 +174,7 @@ double ran_normal() } } -void unreachable(char *message) { +void unreachable_exit(char *message) { fprintf(stderr, "\n[dwgsim_core] Error: %s\n", message); exit(1); } @@ -713,7 +713,7 @@ void dwgsim_core(dwgsim_opt_t * opt) case 0: strand[0] = (drand48() < 0.5) ? 1 : 0; break; case 1: strand[0] = 0; break; case 2: strand[0] = 1; break; - default: unreachable("read strand was not between 0-2"); + default: unreachable_exit("read strand was not between 0-2"); } // set read two's strand @@ -723,12 +723,12 @@ void dwgsim_core(dwgsim_opt_t * opt) case ILLUMINA: strand[1] = 1 - strand[0]; break; // paired end for Illumina (opposite strand) case SOLID: case IONTORRENT: strand[1] = strand[0]; break; // mate pair for SOLiD and IonTorrent (same strand) - default: unreachable("data type was not between 0-2"); + default: unreachable_exit("data type was not between 0-2"); } break; case 1: strand[1] = strand[0]; break; // mate pair (same strand) case 2: strand[1] = 1 - strand[0]; break; // paired end (opposite strand) - default: unreachable("strandedness was not between 0-2"); + default: unreachable_exit("strandedness was not between 0-2"); } // generate the reads in base space