Ignore:
Timestamp:
May 10, 2016, 12:12:41 AM (3 years ago)
Author:
nmedfort
Message:

UnicodeSet? bug fix and compile warning clean-up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r5036 r5037  
    9696}
    9797
    98 std::vector<int> total_CountOnly;
     98std::vector<uint64_t> total_CountOnly;
    9999std::mutex count_mutex;
    100100size_t fileCount;
     
    124124// Returns true if the command line argument shouldn't be passed to icGrep or Grep.
    125125bool isArgUnwantedForAll(char *argument) {
    126 
    127     bool isUnwated = false;
    128126    std::vector<std::string> unwantedFlags = {"-gs"};
    129 
    130     for (int i=0; i<unwantedFlags.size(); i++){   
     127    for (unsigned i = 0; i < unwantedFlags.size(); ++i){
    131128        if (strcmp(argument, unwantedFlags[i].c_str()) == 0) {
    132             isUnwated = true;
    133         }
    134     }
    135 
    136     return isUnwated;
     129            return true;
     130        }
     131    }
     132    return false;
    137133}
    138134// Filters out the command line strings that shouldn't be passed on to Grep
    139135bool isArgUnwantedForGrep(char *argument) {
    140     bool isUnwated = false;
    141136    std::vector<std::string> unwantedFlags = {"-n"};
    142137
    143     for (int i = 0; i < unwantedFlags.size(); i++){
     138    for (unsigned i = 0; i < inputFiles.size(); ++i){
    144139        if (strcmp(argument, unwantedFlags[i].c_str()) == 0) {
    145             isUnwated = true;
    146         }
    147     }
    148 
    149     for (int i = 0; i < inputFiles.size(); i++){    // filter out input content files.
     140            return true;
     141        }
     142    }
     143
     144    for (unsigned i = 0; i < inputFiles.size(); ++i){    // filter out input content files.
    150145        if (strcmp(argument, inputFiles[i].c_str()) == 0) {
    151             isUnwated = true;
    152         }
    153     }
    154 
    155     return isUnwated;
     146            return true;
     147        }
     148    }
     149
     150    return false;
    156151}
    157152// Filters out the command line strings that shouldn't be passed on to IcGrep
     
    160155    std::vector<std::string> unwantedFlags = {"-c"};
    161156
    162     for (int i=0; i<unwantedFlags.size(); i++){
     157    for (unsigned i = 0; i < unwantedFlags.size(); ++i){
    163158        if (strcmp(argument, unwantedFlags[i].c_str()) == 0) {
    164159            isUnwated = true;
     
    180175    // Construct the shell arguments for icgrep and grep
    181176    // by filtering out the command line arguments passed into this process.
    182     for (int i=1; i< argc; i++) {
     177    for (int i = 1; i < argc; i++) {
    183178        if (!isArgUnwantedForAll(argv[i])) {
    184179
     
    220215   
    221216    initResult(inputFiles);
    222     for (int i=0; i<inputFiles.size(); i++){
     217    for (unsigned i=0; i<inputFiles.size(); ++i){
    223218        total_CountOnly.push_back(0);
    224219    }
Note: See TracChangeset for help on using the changeset viewer.