⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 282469 in webkit


Ignore:
Timestamp:
Sep 15, 2021, 1:18:25 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Avoid GCC warnings introduced in r282125
​https://bugs.webkit.org/show_bug.cgi?id=230154

Patch by Michael Catanzaro <Michael Catanzaro> on 2021-09-15
Reviewed by Fujii Hironori.

Yusuke suggested casting to UChar to avoid -Wswitch-out-of-range. This works!

Also, avoid -Wredundant-move by removing one unnecessary WTFMove.

  • runtime/ISO8601.cpp:

(JSC::ISO8601::parseTimeZoneBracketedAnnotation):
(JSC::ISO8601::canBeTimeZone):
(JSC::ISO8601::parseTimeZone):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r282468 r282469  
     12021-09-15  Michael Catanzaro  <mcatanzaro@gnome.org>
     2
     3        Avoid GCC warnings introduced in r282125
     4        https://bugs.webkit.org/show_bug.cgi?id=230154
     5
     6        Reviewed by Fujii Hironori.
     7
     8        Yusuke suggested casting to UChar to avoid -Wswitch-out-of-range. This works!
     9
     10        Also, avoid -Wredundant-move by removing one unnecessary WTFMove.
     11
     12        * runtime/ISO8601.cpp:
     13        (JSC::ISO8601::parseTimeZoneBracketedAnnotation):
     14        (JSC::ISO8601::canBeTimeZone):
     15        (JSC::ISO8601::parseTimeZone):
     16
    1172021-09-15  Yusuke Suzuki  <ysuzuki@apple.com>
    218
  • trunk/Source/JavaScriptCore/runtime/ISO8601.cpp

    r282125 r282469  
    449449    buffer.advance();
    450450
    451     switch (*buffer) {
     451    switch (static_cast<UChar>(*buffer)) {
    452452    case '+':
    453453    case '-':
    … …  
    577577            return std::nullopt;
    578578        buffer.advance();
    579         return WTFMove(result);
     579        return result;
    580580    }
    581581    }
    … …  
    585585static bool canBeTimeZone(const StringParsingBuffer<CharacterType>& buffer, CharacterType character)
    586586{
    587     switch (character) {
     587    switch (static_cast<UChar>(character)) {
    588588    // UTCDesignator
    589589    // https://tc39.es/proposal-temporal/#prod-UTCDesignator
    … …  
    616616    if (buffer.atEnd())
    617617        return std::nullopt;
    618     switch (*buffer) {
     618    switch (static_cast<UChar>(*buffer)) {
    619619    // UTCDesignator
    620620    // https://tc39.es/proposal-temporal/#prod-UTCDesignator
Note: See TracChangeset for help on using the changeset viewer.