Changed stol to stoll for int64_t

This commit is contained in:
Andrew S. Rightenburg 2023-04-04 22:02:11 -04:00
parent 646df27a83
commit 7bfcb20bef
3 changed files with 8 additions and 8 deletions

View file

@ -320,21 +320,21 @@ editor::instruction parse_instruction_string(string instruction_string) {
Now, to actually create the 'instruction' object
*/
if (is_replace_instruction) {
int64_t start_position = (int64_t)stol(instruction_vector[1]);
int64_t start_position = (int64_t)stoll(instruction_vector[1]);
return create_replace_instruction(start_position, instruction_vector[2]);
}
if (is_insert_instruction) {
int64_t start_position = (int64_t)stol(instruction_vector[1]);
int64_t start_position = (int64_t)stoll(instruction_vector[1]);
return create_insert_instruction(start_position, instruction_vector[2]);
}
if (is_remove_instruction) {
int64_t start_position = (int64_t)stol(instruction_vector[1]);
int64_t start_position = (int64_t)stoll(instruction_vector[1]);
int64_t end_position = (int64_t)stol(instruction_vector[2]);
int64_t end_position = (int64_t)stoll(instruction_vector[2]);
return create_remove_instruction(start_position, end_position);
}

View file

@ -66,7 +66,7 @@ int main(int argc, char* argv[]) {
cerr << program_name << ": '" << optarg << "' is not an integer" << endl << "Use -h for help" << endl;
return EXIT_BADARG;
}
start_position = (int64_t)atol(optarg);
start_position = (int64_t)stoll(optarg);
break;
case 'l':
@ -74,7 +74,7 @@ int main(int argc, char* argv[]) {
cerr << program_name << ": '" << optarg << "' is not an integer" << endl << "Use -h for help" << endl;
return EXIT_BADARG;
}
amount_to_read = (int64_t)atol(optarg);
amount_to_read = (int64_t)stoll(optarg);
break;
case 'V':

View file

@ -21,12 +21,12 @@ inline int parse_block_units(const std::string &user_input) {
}
if (last_character == "K" || last_character == "k") {
int blocksize = (int)stol(all_but_last_character);
int blocksize = (int)stoi(all_but_last_character);
return (blocksize * 1024);
}
if (last_character == "M" || last_character == "m") {
int blocksize = (int)stol(all_but_last_character);
int blocksize = (int)stoi(all_but_last_character);
return (blocksize * 1024 * 1024);
}