Skip to content
Commits on Source (2)
From: =?utf-8?q?Fabian_Kl=C3=B6tzl?= <fabian@kloetzl.info>
Date: Mon, 9 Jul 2018 14:49:11 +0200
Subject: fix absolute value of unsigned
---
src/patternset.cpp | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/src/patternset.cpp b/src/patternset.cpp
index 1b3e4f6..d859c92 100644
--- a/src/patternset.cpp
+++ b/src/patternset.cpp
@@ -188,19 +188,14 @@ void patternset::CheckParams(){
std::swap(max_dontcare,min_dontcare);
}
if(weight < 2){
- if(weight < 0){
- weight = std::abs(weight);
+ if(size != 1){
+ size = 1;
+ update = true;
}
- else{
- if(size != 1){
- size = 1;
- update = true;
- }
- if(max_dontcare != 0 || max_dontcare != 0){
- min_dontcare = 0;
- max_dontcare = 0;
- update = true;
- }
+ if(max_dontcare != 0 || max_dontcare != 0){
+ min_dontcare = 0;
+ max_dontcare = 0;
+ update = true;
}
}
if(weight == 2){
From: =?utf-8?q?Fabian_Kl=C3=B6tzl?= <fabian@kloetzl.info>
Date: Mon, 9 Jul 2018 14:50:32 +0200
Subject: include random header
---
src/patternset.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/patternset.cpp b/src/patternset.cpp
index d859c92..a910b8a 100644
--- a/src/patternset.cpp
+++ b/src/patternset.cpp
@@ -18,6 +18,7 @@
* @author: Lars Hahn - 12.05.2016, Georg-August-Universitaet Goettingen
* @version: 1.2.0 05/2016
*/
+#include <random>
#include "patternset.h"
From: =?utf-8?q?Fabian_Kl=C3=B6tzl?= <fabian@kloetzl.info>
Date: Mon, 9 Jul 2018 14:51:21 +0200
Subject: remove stray semicolon
---
src/spaced.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/spaced.cc b/src/spaced.cc
index 649997b..3f46d2e 100644
--- a/src/spaced.cc
+++ b/src/spaced.cc
@@ -186,7 +186,7 @@ int main(int argc, char *argv[]){
for(unsigned long long i=0; i<n;i++){
c=toupper(str[i]);
if(c=='>'){
- while(str[++i]!='\n');
+ while(str[++i]!='\n')
seq++;
}
if(isalpha(c)){
From: =?utf-8?q?Fabian_Kl=C3=B6tzl?= <fabian@kloetzl.info>
Date: Mon, 9 Jul 2018 15:28:43 +0200
Subject: fix some more signedness issues
---
src/patternset.cpp | 8 ++++----
src/sort.h | 10 +++++-----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/patternset.cpp b/src/patternset.cpp
index a910b8a..55b9b25 100644
--- a/src/patternset.cpp
+++ b/src/patternset.cpp
@@ -456,13 +456,13 @@ bool patternset::VerifyPatternCondition(){
weight = first_weight;
- min_dontcare -= weight;
- max_dontcare -= weight;
-
- if(min_dontcare < 0 || max_dontcare < 0){
+ if(min_dontcare < weight || max_dontcare < weight){
pattern_error = true;
}
+ min_dontcare -= weight;
+ max_dontcare -= weight;
+
return pattern_error;
}
diff --git a/src/sort.h b/src/sort.h
index 86ba729..8edaafd 100644
--- a/src/sort.h
+++ b/src/sort.h
@@ -80,7 +80,7 @@ void getFirstBits(vector<unsigned char>&pattern, unsigned char* firstBits, unsig
unsigned char p0,p1,p2,p3;
p0=pattern[0];p1=pattern[1];p2=pattern[2];p3=pattern[3];
if(weight>=4){
- for(int i=0; i<length;i++){
+ for(unsigned int i=0; i<length;i++){
w=0;
unsigned char* tmp=&seqData[i+pos];
w|=alphabet[*(tmp+p0)] << 6;
@@ -93,7 +93,7 @@ void getFirstBits(vector<unsigned char>&pattern, unsigned char* firstBits, unsig
else if (weight==3){
unsigned char p0,p1,p2;
p0=pattern[0];p1=pattern[1];p2=pattern[2];
- for(int i=0; i<length;i++){
+ for(unsigned int i=0; i<length;i++){
w=0;
unsigned char* tmp=&seqData[i+pos];
w|=alphabet[*(tmp+p0)] << 4;
@@ -105,7 +105,7 @@ void getFirstBits(vector<unsigned char>&pattern, unsigned char* firstBits, unsig
else if(weight==2){
unsigned char p0,p1;
p0=pattern[0];p1=pattern[1];
- for(int i=0; i<length;i++){
+ for(unsigned int i=0; i<length;i++){
w=0;
unsigned char* tmp=&seqData[i+pos];
w|=alphabet[*(tmp+p0)] << 2;
@@ -117,7 +117,7 @@ void getFirstBits(vector<unsigned char>&pattern, unsigned char* firstBits, unsig
else{
unsigned char p0;
p0=pattern[0];
- for(int i=0; i<length;i++){
+ for(unsigned int i=0; i<length;i++){
unsigned char* tmp=&seqData[i+pos];
w=alphabet[*(tmp+p0)];
firstBits[i]=w;
@@ -217,7 +217,7 @@ void spacedDNA(vector<string>& patternSet, unsigned char* seqData, uint n, int d
sequences.back().seqWordEnd=totalSeqLength-(weight+dontCare)+1;
seqNum=sequences.size();
uint cnt=0;
- for(uint i=0; i<seqNum;i++){
+ for(int i=0; i<seqNum;i++){
uint start=sequences[i].seqStart;
uint end=sequences[i].seqEnd-1;
sequences[i].revCompStart=cnt+totalSeqLength;
0002-Fix-FTBFS-without-OpenMP.patch
0003-Add-autotools-buildsystem.patch
0004-signed.patch
0005-fix-absolute-value-of-unsigned.patch
0006-include-random-header.patch
0007-remove-stray-semicolon.patch
0008-fix-some-more-signedness-issues.patch