From f6d1be0920261d105d561e1c1cc780ea476ecc24 Mon Sep 17 00:00:00 2001 From: Yuuki Galaxy Date: Thu, 28 Nov 2024 13:54:05 +0800 Subject: [PATCH] modified: src1/common.h modified: src1/input.c modified: src1/worker.c --- c_cpp/salusFstReCoord/src1/common.h | 2 ++ c_cpp/salusFstReCoord/src1/input.c | 4 ++++ c_cpp/salusFstReCoord/src1/worker.c | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/c_cpp/salusFstReCoord/src1/common.h b/c_cpp/salusFstReCoord/src1/common.h index 1f2001492..84831f7b4 100644 --- a/c_cpp/salusFstReCoord/src1/common.h +++ b/c_cpp/salusFstReCoord/src1/common.h @@ -218,7 +218,9 @@ https://stackoverflow.com/questions/3767284/using-printf-with-a-non-null-termina // #pragma pack(push, 1) struct fstBCdata_s { int8_t name[MAXFQIDLEN]; +#ifndef RELEASE char* comment; +#endif int8_t seq[BARCODELEN]; int8_t qual[BARCODELEN]; }; diff --git a/c_cpp/salusFstReCoord/src1/input.c b/c_cpp/salusFstReCoord/src1/input.c index f6f73610e..cf3eddcc1 100644 --- a/c_cpp/salusFstReCoord/src1/input.c +++ b/c_cpp/salusFstReCoord/src1/input.c @@ -46,6 +46,7 @@ void fill_worker(int_least16_t worker_id) { /* seq->comment.s is discarded */ STRcpyARRAY(fstBCdata_p->seq, seq->seq.s); STRcpyARRAY(fstBCdata_p->qual, seq->qual.s); +#ifndef RELEASE if (unlikely(seq->comment.l > 0)) { size_t oldSize = MALLOCSIZE(fstBCdata_p->comment); if (unlikely(1 + seq->comment.l > oldSize)) { @@ -60,6 +61,7 @@ void fill_worker(int_least16_t worker_id) { fstBCdata_p->comment = NULL; } } +#endif #ifdef DEBUG fprintf(stderr, "- %llu -\n", index); ARRAYcpySTR(Parameters.buffer, fstBCdata_p->name); @@ -74,8 +76,10 @@ void fill_worker(int_least16_t worker_id) { fstBCdata_p->name[0] = '\0'; fstBCdata_p->seq[0] = '\0'; fstBCdata_p->qual[0] = '\0'; +#ifndef RELEASE free(fstBCdata_p->comment); fstBCdata_p->comment = NULL; +#endif } // continue; } diff --git a/c_cpp/salusFstReCoord/src1/worker.c b/c_cpp/salusFstReCoord/src1/worker.c index d3fcb5fe8..2fd76e48e 100644 --- a/c_cpp/salusFstReCoord/src1/worker.c +++ b/c_cpp/salusFstReCoord/src1/worker.c @@ -35,7 +35,11 @@ void worker(int_least16_t worker_id) { fstBCoutput_t *fstBCoutput_p = &worker->output_array[index]; ARRAYcpySTR(readName, fstBCdata_p->name); assert(readName[sizeof(fstBCdata_p->name)] == '\0'); - printf("###### %llu\t[%s] %d [%s]<--\n", index, readName, readName[sizeof(fstBCdata_p->name)],fstBCdata_p->comment); +#ifndef RELEASE + printf("###### %llu\t[%s] %d [%s]<--\n", index, readName, readName[sizeof(fstBCdata_p->name)], fstBCdata_p->comment); +#else + printf("###### %llu\t[%s] %d <--\n", index, readName, readName[sizeof(fstBCdata_p->name)]); +#endif int_least16_t RowCol[2] = {0}; double oldXY[2] = {0.0}; double newXY[2] = {0.0}; -- 2.11.4.GIT