Fixed warning about comparing signed and unsigned integer types

This commit is contained in:
2018-05-13 22:26:42 -04:00
parent 0cfe5e40bd
commit 90dcd3412c
5 changed files with 18 additions and 18 deletions

View File

@@ -34,7 +34,7 @@ void Morse::setEncodeInputString(std::string input){
//Make sure the input is empty to begin
std::string temp;
//Step through every element in input, removing anything that is not a letter and making all letters uppercase
for(int cnt = 0;cnt < input.size();++cnt){
for(unsigned int cnt = 0;cnt < input.size();++cnt){
char letter = input[cnt];
//If it is a letter or number add it to the inputString, turning all letters capital
if(isalnum(letter)){
@@ -54,7 +54,7 @@ void Morse::setEncodeInputString(std::string input){
void Morse::setDecodeInputString(std::string input){
std::string temp;
//Step through every element in input, removing everything except . or -
for(int cnt = 0;cnt < input.size();++cnt){
for(unsigned int cnt = 0;cnt < input.size();++cnt){
char letter = input[cnt];
//If it is a letter or number add it to the inputString, turning all letters capital
if(letter == '.' || letter == '-' || letter == ' '){
@@ -95,7 +95,7 @@ std::string Morse::encode(){
std::string temp = inputString.str();
//Loop through every element in the input string and see what type it is
//while(!inputString.eof()){
for(int cnt = 0;cnt < temp.size();++cnt){
for(unsigned int cnt = 0;cnt < temp.size();++cnt){
char letter;
//Get the next character in the input
letter = temp[cnt];