Skip to content
Permalink
Browse files

Fix warnings

  • Loading branch information
martin-steinegger committed Dec 5, 2019
1 parent 987a932 commit 8874e31ddda89d0039b9f92c78a08d27dc51dfdf
@@ -54,16 +54,15 @@
# define __noreturn __attribute__((noreturn))
# define __format(type, format_str, args_start) \
__attribute__((format(type, format_str, args_start)))
# define max(a,b) ({ __typeof__(a) _a = (a); __typeof__(b) _b = (b); _a > _b ? _a : _b; })
# define min(a,b) ({ __typeof__(a) _a = (a); __typeof__(b) _b = (b); _a < _b ? _a : _b; })
# define inline inline __attribute__((always_inline))

#else
# define __noreturn
# define __cold
# define __format(type, format_str, args_start)
#endif

# define max(a,b) (((a) > (b)) ? (a) : (b))
# define min(a,b) (((a) < (b)) ? (a) : (b))
#endif

/* Sum the values an 8 x 8 bit vector and return a 32-bit result. */
static inline uint32_t
@@ -360,12 +359,12 @@ generate_combined_read(const struct read *read_1,
char * combined_seq;
char * combined_qual;

if (combined_read->seq_bufsz < combined_seq_len) {
if (combined_read->seq_bufsz < static_cast<size_t >(combined_seq_len)) {
combined_read->seq = (char *)xrealloc(combined_read->seq,
combined_seq_len);
combined_read->seq_bufsz = combined_seq_len;
}
if (combined_read->qual_bufsz < combined_seq_len) {
if (combined_read->qual_bufsz < static_cast<size_t >(combined_seq_len)) {
combined_read->qual = (char *)xrealloc(combined_read->qual,
combined_seq_len);
combined_read->qual_bufsz = combined_seq_len;
@@ -60,6 +60,7 @@ xmalloc(size_t size)
return p;
}
fprintf(stderr, "Out of memory: tried to allocate %zu bytes", size);
return NULL;
}


@@ -78,5 +79,6 @@ xrealloc(void *ptr, size_t size)
return p;
}
fprintf(stderr, "Out of memory: tried to reallocate %zu bytes", size);
return NULL;
}

@@ -11,7 +11,6 @@ extern int hybridassembleresults(int argc, const char** argv, const Command &com
extern int filternoncoding(int argc, const char** argv, const Command &command);
extern int mergereads(int argc, const char** argv, const Command &command);
extern int findassemblystart(int argc, const char** argv, const Command &command);
extern int correctreads(int argc, const char** argv, const Command &command);
extern int cyclecheck(int argc, const char** argv, const Command &command);
extern int createhdb(int argc, const char** argv, const Command &command);
#endif
@@ -1,7 +1,6 @@
set(assembler_source_files
assembler/assembleresult.cpp
assembler/hybridassembleresult.cpp
assembler/correctreads.cpp
assembler/findassemblystart.cpp
assembler/filternoncoding.cpp
assembler/mergereads.cpp
@@ -45,8 +45,8 @@ Matcher::result_t selectFragmentToExtend(QueueByScore &alignments,
alignments.pop();
size_t dbKey = res.dbKey;
const bool notRightStartAndLeftStart = !(res.dbStartPos == 0 && res.qStartPos == 0 );
const bool rightStart = res.dbStartPos == 0 && (res.dbEndPos != res.dbLen-1);
const bool leftStart = res.qStartPos == 0 && (res.qEndPos != res.qLen-1);
const bool rightStart = res.dbStartPos == 0 && (res.dbEndPos != static_cast<int>(res.dbLen)-1);
const bool leftStart = res.qStartPos == 0 && (res.qEndPos != static_cast<int>(res.qLen)-1);
const bool isNotIdentity = (dbKey != queryKey);

if ((rightStart || leftStart) && notRightStartAndLeftStart && isNotIdentity){
@@ -205,7 +205,7 @@ int doassembly(LocalParameters &par) {
continue;
}
} else if (besttHitToExtend.qStartPos == 0) {
if (besttHitToExtend.dbStartPos <= leftQueryOffsetToUse) {
if (besttHitToExtend.dbStartPos <= static_cast<int>(leftQueryOffsetToUse)) {
continue;
}
}
@@ -236,7 +236,7 @@ int doassembly(LocalParameters &par) {
}

// check right extension or reverse left
if (dbStartPos == 0 && qEndPos == (querySeqLen - 1) ) {
if (dbStartPos == 0 && qEndPos == (static_cast<int>(querySeqLen) - 1) ) {
if((!isReverse && queryCouldBeExtendedRight == true) || (isReverse && queryCouldBeExtendedLeft == true)) {
float alnLen = qEndPos - qStartPos;
float scorePerCol = static_cast<float>(score) / (alnLen+0.5);
@@ -278,7 +278,7 @@ int doassembly(LocalParameters &par) {
}

//check left extension
} else if (qStartPos == 0 && dbEndPos == (targetSeqLen - 1)) {
} else if (qStartPos == 0 && dbEndPos == (static_cast<int>(targetSeqLen) - 1)) {
if ((!isReverse && queryCouldBeExtendedLeft == true)|| (isReverse && queryCouldBeExtendedRight == true)) {
float alnLen = qEndPos - qStartPos;
float scorePerCol = static_cast<float>(score) / (alnLen+0.5);

This file was deleted.

0 comments on commit 8874e31

Please sign in to comment.
You can’t perform that action at this time.