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;
