Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-steinegger committed Dec 5, 2019
1 parent 987a932 commit 8874e31
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 285 deletions.
11 changes: 5 additions & 6 deletions lib/flash/combine_reads.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions lib/flash/util.cpp
Expand Up @@ -60,6 +60,7 @@ xmalloc(size_t size)
return p;
}
fprintf(stderr, "Out of memory: tried to allocate %zu bytes", size);
return NULL;
}


Expand All @@ -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;
}

1 change: 0 additions & 1 deletion src/LocalCommandDeclarations.h
Expand Up @@ -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 change: 0 additions & 1 deletion src/assembler/CMakeLists.txt
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/assembler/assembleresult.cpp
Expand Up @@ -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){
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
260 changes: 0 additions & 260 deletions src/assembler/correctreads.cpp

This file was deleted.

0 comments on commit 8874e31

Please sign in to comment.