mirror of
https://bitbucket.org/Mattrixwv/cipherstream.git
synced 2025-12-06 18:33:58 -05:00
Fixed warning about comparing signed and unsigned integer types
This commit is contained in:
@@ -29,7 +29,7 @@ Atbash::~Atbash(){
|
||||
*/
|
||||
void Atbash::setInputString(std::string input){
|
||||
//Strip all punctuation and whitespace from input and make all letters capital
|
||||
for(int cnt = 0;cnt < input.size();++cnt){
|
||||
for(unsigned int cnt = 0;cnt < input.size();++cnt){
|
||||
char letter = input[cnt];
|
||||
//If it is upper case add it to the inputString
|
||||
if(isupper(letter)){
|
||||
@@ -68,7 +68,7 @@ std::string Atbash::getOutputString() const{
|
||||
*/
|
||||
std::string Atbash::encode(){
|
||||
//Step through every element in the inputString and shift it the correct amount
|
||||
for(int cnt = 0;cnt < inputString.size();++cnt){
|
||||
for(unsigned int cnt = 0;cnt < inputString.size();++cnt){
|
||||
outputString += (inputString[cnt] + 25 - (2 * (inputString[cnt] - 'A')));
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ std::string Atbash::encode(std::string input){
|
||||
* @return The decoded inputString (outputString)
|
||||
*/
|
||||
std::string Atbash::decode(){
|
||||
for(int cnt = 0;cnt < inputString.size();++cnt){
|
||||
for(unsigned int cnt = 0;cnt < inputString.size();++cnt){
|
||||
outputString += (inputString[cnt] + 25 - (2 * (inputString[cnt] - 'A')));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user