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

Changeset 285188 in webkit


Ignore:
Timestamp:
Nov 2, 2021, 3:19:22 PM (5 years ago)
Author:
ddkilzer@apple.com
Message:

[WTF] Minor clean-up for format-related functions
<​https://webkit.org/b/232514>

Reviewed by Yusuke Suzuki.

  • wtf/Assertions.cpp:

(WTF::createWithFormatAndArguments):

  • Put WTF_ATTRIBUTE_PRINTF() on its own line to match other functions.

(WTF::vprintf_stderr_with_prefix):
(WTF::vprintf_stderr_with_trailing_newline):

  • Move ALLOW_NONLITERAL_FORMAT_{BEGIN,END} around specific function calls that need them.
Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r285187 r285188  
     12021-11-02  David Kilzer  <ddkilzer@apple.com>
     2
     3        [WTF] Minor clean-up for format-related functions
     4        <https://webkit.org/b/232514>
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * wtf/Assertions.cpp:
     9        (WTF::createWithFormatAndArguments):
     10        - Put WTF_ATTRIBUTE_PRINTF() on its own line to match other
     11          functions.
     12        (WTF::vprintf_stderr_with_prefix):
     13        (WTF::vprintf_stderr_with_trailing_newline):
     14        - Move ALLOW_NONLITERAL_FORMAT_{BEGIN,END} around specific
     15          function calls that need them.
     16
    1172021-11-02  Michael Catanzaro  <mcatanzaro@gnome.org>
    218
  • trunk/Source/WTF/wtf/Assertions.cpp

    r284673 r285188  
    7070namespace WTF {
    7171
    72 WTF_ATTRIBUTE_PRINTF(1, 0) static String createWithFormatAndArguments(const char* format, va_list args)
     72WTF_ATTRIBUTE_PRINTF(1, 0)
     73static String createWithFormatAndArguments(const char* format, va_list args)
    7374{
    7475    va_list argsCopy;
    … …  
    183184}
    184185
    185 ALLOW_NONLITERAL_FORMAT_BEGIN
    186 
    187186WTF_ATTRIBUTE_PRINTF(2, 0)
    188187static void vprintf_stderr_with_prefix(const char* prefix, const char* format, va_list args)
    … …  
    195194    formatWithPrefix[prefixLength + formatLength] = 0;
    196195
     196    ALLOW_NONLITERAL_FORMAT_BEGIN
    197197    vprintf_stderr_common(formatWithPrefix.data(), args);
     198    ALLOW_NONLITERAL_FORMAT_END
    198199}
    199200
    … …  
    212213    formatWithNewline[formatLength + 1] = 0;
    213214
     215    ALLOW_NONLITERAL_FORMAT_BEGIN
    214216    vprintf_stderr_common(formatWithNewline.data(), args);
    215 }
    216 
    217 ALLOW_NONLITERAL_FORMAT_END
     217    ALLOW_NONLITERAL_FORMAT_END
     218}
    218219
    219220WTF_ATTRIBUTE_PRINTF(1, 2)
Note: See TracChangeset for help on using the changeset viewer.