Ignore:
Timestamp:
Dec 15, 2017, 9:19:27 AM (19 months ago)
Author:
cameron
Message:

Small fixes

Location:
icGREP/icgrep-devel/icgrep/re
Files:
7 edited

Legend:

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

    r5770 r5781  
    2525    if (isa<CC>(re)) {
    2626        if (inCaseInsensitiveMode) {
    27             UCD::UnicodeSet * cased = caseInsensitize(cast<CC>(re));
    28             return makeCC(std::move(*cased));
     27            UCD::UnicodeSet cased = caseInsensitize(*cast<CC>(re));
     28            return makeCC(std::move(cased));
    2929        }
    3030        else return re;
  • icGREP/icgrep-devel/icgrep/re/printer_re.cpp

    r5765 r5781  
    4444    } else if (const CC* re_cc = dyn_cast<const CC>(re)) {
    4545        retVal = "CC \"";
    46         retVal += re_cc->canonicalName(UnicodeClass);
     46        retVal += re_cc->canonicalName(CC_type::UnicodeClass);
    4747        retVal += "\" ";
    4848
     
    6262        retVal += re_name->getName();
    6363        retVal += "\" ";
    64         if (re_name->getType() == Name::Type::Capture) {
    6564            retVal += "=(" + PrintRE(re_name->getDefinition()) + ")";
    66         }
    6765    } else if (const Range* rg = dyn_cast<const Range>(re)) {
    6866        retVal = "Range (";
  • icGREP/icgrep-devel/icgrep/re/re_cc.cpp

    r5770 r5781  
    1414    std::stringstream name;
    1515    name << std::hex;
    16     if ((type == ByteClass) && (max_codepoint() >= 0x80)) {
     16    if ((type == CC_type::ByteClass) && (max_codepoint() >= 0x80)) {
    1717        name << "BC";
    1818    } else {
  • icGREP/icgrep-devel/icgrep/re/re_cc.h

    r5770 r5781  
    1616using interval_t = UCD::interval_t;
    1717
    18 enum CC_type {UnicodeClass, ByteClass};
     18enum class CC_type {UnicodeClass, ByteClass};
    1919
    2020class CC : public RE, public UCD::UnicodeSet {
  • icGREP/icgrep-devel/icgrep/re/re_multiplex.cpp

    r5765 r5781  
    9292                        name << n->getName();
    9393                    } else if (isa<CC>(re)) {
    94                         name << cast<CC>(re)->canonicalName(UnicodeClass);
     94                        name << cast<CC>(re)->canonicalName(CC_type::UnicodeClass);
    9595                    }
    9696                    ai = alt->erase(ai);
  • icGREP/icgrep-devel/icgrep/re/re_name.h

    r5634 r5781  
    6060    }
    6161    inline const char * replicateString(const char * string, const length_t length) {
    62         if (string) {
     62        if (string && (length > 0)) {
    6363            char * allocated = reinterpret_cast<char*>(mAllocator.allocate(length));
    6464            std::memcpy(allocated, string, length);
    65             string = allocated;
     65            return allocated;
    6666        }
    67         return string;
     67        return nullptr;
    6868    }
    6969
  • icGREP/icgrep-devel/icgrep/re/re_name_resolve.cpp

    r5769 r5781  
    7373                        name << n->getName();
    7474                    } else if (isa<CC>(item)) {
    75                         name << cast<CC>(item)->canonicalName(UnicodeClass);
     75                        name << cast<CC>(item)->canonicalName(CC_type::UnicodeClass);
    7676                    }
    7777                    ai = alt->erase(ai);
Note: See TracChangeset for help on using the changeset viewer.