From 92fdecab3974d834fa2da497090ad32658c6cdc5 Mon Sep 17 00:00:00 2001 From: Markus Date: Wed, 4 Sep 2019 22:05:41 +0200 Subject: [PATCH] =?UTF-8?q?=C3=A4ndere=20++=20vom=20ende=20zum=20anfang=20?= =?UTF-8?q?(=20bis=20auf=20die,=20mit=20optarg,=20beidenen=20ist=20es=20n?= =?UTF-8?q?=C3=B6tig),=20da=20keine=20copy=20des=20wertes=20vor=20der=20ve?= =?UTF-8?q?rgr=C3=B6=C3=9Ferung=20n=C3=B6tig=20ist,=20der=20zur=C3=BCckgeg?= =?UTF-8?q?eben=20wird?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- accountManager.cpp | 2 +- pageManager.cpp | 2 +- parameterManager.cpp | 17 +++++++++-------- programManager.cpp | 6 +++--- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/accountManager.cpp b/accountManager.cpp index 72fdde9..3d36858 100644 --- a/accountManager.cpp +++ b/accountManager.cpp @@ -46,7 +46,7 @@ Account AccountManager::getNextAccount() exit(36); } size_t accountNumber = getLastAccountNumber(); - accountNumber++; + ++accountNumber; if( accountNumber >= accounts.size() ) accountNumber=0; diff --git a/pageManager.cpp b/pageManager.cpp index 98286d5..8ea6fb9 100644 --- a/pageManager.cpp +++ b/pageManager.cpp @@ -242,7 +242,7 @@ std::string PageManager::replace(std::string str, std::string substr1, std::stri int PageManager::counterContains(std::string text, std::string substring_with_prozent_i_for_number, int starte_mit_dieser_Zahl) { int i = starte_mit_dieser_Zahl; - for (; text.find( replace(substring_with_prozent_i_for_number, "%i", std::to_string(i)) ) != std::string::npos; i++); + for (; text.find( replace(substring_with_prozent_i_for_number, "%i", std::to_string(i)) ) != std::string::npos; ++i); return i-1; } diff --git a/parameterManager.cpp b/parameterManager.cpp index e13d573..60ce7eb 100644 --- a/parameterManager.cpp +++ b/parameterManager.cpp @@ -462,9 +462,9 @@ int unterOption_default(Settings *settings, int argc, char ** argv) //Alle nicht verwendeten Parameter == Name while (optind < argc) { if(argv[optind][0]) { - settings->name.append(argv[optind++]).append(" "); + settings->name.append(argv[optind++]).append(" "); // optind++ gives the value before ++ back } else - optind++; + ++optind; } if(settings->name.length() > 0) @@ -637,7 +637,7 @@ int unterOption_url(Settings *settings, int argc, char **argv) if(argv[optind][0]) { settings->name.append(argv[optind++]).append(","); } else - optind++; + ++optind; } if(settings->name.length() > 0) @@ -737,7 +737,7 @@ int unterOption_search(Settings *settings, int argc, char **argv) if(argv[optind][0]) { settings->name.append(argv[optind++]).append(" "); } else - optind++; + ++optind; } if(settings->name.length() > 0) settings->name.pop_back(); @@ -831,7 +831,7 @@ int unterOption_info(Settings *settings, int argc, char **argv) if(argv[optind][0]) { settings->name.append(argv[optind++]).append(" "); } else - optind++; + ++optind; } if(settings->name.length() > 0) settings->name.pop_back(); @@ -879,15 +879,15 @@ void unterOption_clean(Settings * settings, int argc, char **argv) perror(( " => Error: Das löschen von " + settings->cookieFilePath + " ist fehlgeschlagen: ").c_str()); return; } else - count++; + ++count; } - for (unsigned i = 0; i < UINT_MAX && fileExists(settings->cookieFilePath + std::to_string(i)); i++) { + for (unsigned i = 0; i < UINT_MAX && fileExists(settings->cookieFilePath + std::to_string(i)); ++i) { if(remove( (settings->cookieFilePath + std::to_string(i)).c_str() ) != 0) { perror((" => Error: Das löschen von " + settings->cookieFilePath + std::to_string(i) + " ist fehlgeschlagen: ").c_str()); return; } else { - count++; + ++count; } } @@ -1003,6 +1003,7 @@ int setS5ProxytoSettings(Settings &settings, std::string Optarg) std::cout << " > Defaults: Proxy Addresse: "<< settings.proxy_ip << ":" << settings.proxy_port << std::endl; return 0; + } diff --git a/programManager.cpp b/programManager.cpp index 4751130..2e1d013 100644 --- a/programManager.cpp +++ b/programManager.cpp @@ -303,7 +303,7 @@ int ProgramManager::defaultModus(Settings *settings) perror("pthread_creat failed"); return 48; } - nextThread++; + ++nextThread; } else { // Sonnst warte bis alle Fertig sind und restarte die Folge if(waitForThreads() != 0) return 231; @@ -678,7 +678,7 @@ int ProgramManager::searchModus_update(Settings *settings) ssize_t countBef = 0; std::ifstream myFileBef(settings->serienListPath); if(myFileBef.is_open()) - for(countBef = 0; std::getline(myFileBef,line); countBef++); + for(countBef = 0; std::getline(myFileBef,line); ++countBef); myFileBef.close(); //Schreibe die Liste in das TextFile @@ -694,7 +694,7 @@ int ProgramManager::searchModus_update(Settings *settings) ssize_t countAf = 0; std::ifstream myFileAf(settings->serienListPath); if(myFileAf.is_open()) - for(countAf = 0; std::getline(myFileAf,line); countAf++); + for(countAf = 0; std::getline(myFileAf,line); ++countAf); myFileAf.close(); std::cout << "Serienunterschied: " << ( ((countAf - countBef) > 0) ? "+" : "") << countAf - countBef << " Serien." << std::endl;