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

Changeset 187546 in webkit


Ignore:
Timestamp:
Jul 29, 2015, 7:30:50 AM (11 years ago)
Author:
Michael Catanzaro
Message:

Clean up RefPtrCairo.cpp
https://bugs.webkit.org/show_bug.cgi?id=147384

Reviewed by Martin Robinson.

Tests for null/non-null should all be done without equality comparisons.

  • platform/graphics/cairo/RefPtrCairo.cpp:

(WTF::refIfNotNull):
(WTF::derefIfNotNull):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r187545 r187546  
     12015-07-29  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        Clean up RefPtrCairo.cpp
     4        https://bugs.webkit.org/show_bug.cgi?id=147384
     5
     6        Reviewed by Martin Robinson.
     7
     8        Tests for null/non-null should all be done without equality comparisons.
     9
     10        * platform/graphics/cairo/RefPtrCairo.cpp:
     11        (WTF::refIfNotNull):
     12        (WTF::derefIfNotNull):
     13
    1142015-07-29  Dean Jackson  <dino@apple.com>
    215
  • trunk/Source/WebCore/platform/graphics/cairo/RefPtrCairo.cpp

    r187527 r187546  
    3333template<> void refIfNotNull(cairo_t* ptr)
    3434{
    35     if (LIKELY(ptr != 0))
     35    if (LIKELY(ptr))
    3636        cairo_reference(ptr);
    3737}
     
    3939template<> void derefIfNotNull(cairo_t* ptr)
    4040{
    41     if (LIKELY(ptr != 0))
     41    if (LIKELY(ptr))
    4242        cairo_destroy(ptr);
    4343}
     
    4545template<> void refIfNotNull(cairo_surface_t* ptr)
    4646{
    47     if (LIKELY(ptr != 0))
     47    if (LIKELY(ptr))
    4848        cairo_surface_reference(ptr);
    4949}
     
    5151template<> void derefIfNotNull(cairo_surface_t* ptr)
    5252{
    53     if (LIKELY(ptr != 0))
     53    if (LIKELY(ptr))
    5454        cairo_surface_destroy(ptr);
    5555}
     
    5757template<> void refIfNotNull(cairo_font_face_t* ptr)
    5858{
    59     if (LIKELY(ptr != 0))
     59    if (LIKELY(ptr))
    6060        cairo_font_face_reference(ptr);
    6161}
     
    6363template<> void derefIfNotNull(cairo_font_face_t* ptr)
    6464{
    65     if (LIKELY(ptr != 0))
     65    if (LIKELY(ptr))
    6666        cairo_font_face_destroy(ptr);
    6767}
     
    6969template<> void refIfNotNull(cairo_scaled_font_t* ptr)
    7070{
    71     if (LIKELY(ptr != 0))
     71    if (LIKELY(ptr))
    7272        cairo_scaled_font_reference(ptr);
    7373}
     
    7575template<> void derefIfNotNull(cairo_scaled_font_t* ptr)
    7676{
    77     if (LIKELY(ptr != 0))
     77    if (LIKELY(ptr))
    7878        cairo_scaled_font_destroy(ptr);
    7979}
     
    8181template<> void refIfNotNull(cairo_pattern_t* ptr)
    8282{
    83     if (LIKELY(ptr != 0))
     83    if (LIKELY(ptr))
    8484        cairo_pattern_reference(ptr);
    8585}
     
    8787template<> void derefIfNotNull(cairo_pattern_t* ptr)
    8888{
    89     if (LIKELY(ptr != 0))
     89    if (LIKELY(ptr))
    9090        cairo_pattern_destroy(ptr);
    9191}
     
    9393template<> void refIfNotNull(cairo_region_t* ptr)
    9494{
    95     if (LIKELY(ptr != 0))
     95    if (LIKELY(ptr))
    9696        cairo_region_reference(ptr);
    9797}
     
    9999template<> void derefIfNotNull(cairo_region_t* ptr)
    100100{
    101     if (LIKELY(ptr != 0))
     101    if (LIKELY(ptr))
    102102        cairo_region_destroy(ptr);
    103103}
     
    106106template<> void refIfNotNull(FcPattern* ptr)
    107107{
    108     if (LIKELY(ptr != 0))
     108    if (LIKELY(ptr))
    109109        FcPatternReference(ptr);
    110110}
     
    112112template<> void derefIfNotNull(FcPattern* ptr)
    113113{
    114     if (LIKELY(ptr != 0))
     114    if (LIKELY(ptr))
    115115        FcPatternDestroy(ptr);
    116116}
     
    118118template<> void refIfNotNull(FcConfig* ptr)
    119119{
    120     if (LIKELY(ptr != nullptr))
     120    if (LIKELY(ptr))
    121121        FcConfigReference(ptr);
    122122}
     
    124124template<> void derefIfNotNull(FcConfig* ptr)
    125125{
    126     if (LIKELY(ptr != nullptr))
     126    if (LIKELY(ptr))
    127127        FcConfigDestroy(ptr);
    128128}
Note: See TracChangeset for help on using the changeset viewer.