Changeset 187546 in webkit
- Timestamp:
- Jul 29, 2015, 7:30:50 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/cairo/RefPtrCairo.cpp (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r187545 r187546 1 2015-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 1 14 2015-07-29 Dean Jackson <dino@apple.com> 2 15 -
trunk/Source/WebCore/platform/graphics/cairo/RefPtrCairo.cpp
r187527 r187546 33 33 template<> void refIfNotNull(cairo_t* ptr) 34 34 { 35 if (LIKELY(ptr != 0))35 if (LIKELY(ptr)) 36 36 cairo_reference(ptr); 37 37 } … … 39 39 template<> void derefIfNotNull(cairo_t* ptr) 40 40 { 41 if (LIKELY(ptr != 0))41 if (LIKELY(ptr)) 42 42 cairo_destroy(ptr); 43 43 } … … 45 45 template<> void refIfNotNull(cairo_surface_t* ptr) 46 46 { 47 if (LIKELY(ptr != 0))47 if (LIKELY(ptr)) 48 48 cairo_surface_reference(ptr); 49 49 } … … 51 51 template<> void derefIfNotNull(cairo_surface_t* ptr) 52 52 { 53 if (LIKELY(ptr != 0))53 if (LIKELY(ptr)) 54 54 cairo_surface_destroy(ptr); 55 55 } … … 57 57 template<> void refIfNotNull(cairo_font_face_t* ptr) 58 58 { 59 if (LIKELY(ptr != 0))59 if (LIKELY(ptr)) 60 60 cairo_font_face_reference(ptr); 61 61 } … … 63 63 template<> void derefIfNotNull(cairo_font_face_t* ptr) 64 64 { 65 if (LIKELY(ptr != 0))65 if (LIKELY(ptr)) 66 66 cairo_font_face_destroy(ptr); 67 67 } … … 69 69 template<> void refIfNotNull(cairo_scaled_font_t* ptr) 70 70 { 71 if (LIKELY(ptr != 0))71 if (LIKELY(ptr)) 72 72 cairo_scaled_font_reference(ptr); 73 73 } … … 75 75 template<> void derefIfNotNull(cairo_scaled_font_t* ptr) 76 76 { 77 if (LIKELY(ptr != 0))77 if (LIKELY(ptr)) 78 78 cairo_scaled_font_destroy(ptr); 79 79 } … … 81 81 template<> void refIfNotNull(cairo_pattern_t* ptr) 82 82 { 83 if (LIKELY(ptr != 0))83 if (LIKELY(ptr)) 84 84 cairo_pattern_reference(ptr); 85 85 } … … 87 87 template<> void derefIfNotNull(cairo_pattern_t* ptr) 88 88 { 89 if (LIKELY(ptr != 0))89 if (LIKELY(ptr)) 90 90 cairo_pattern_destroy(ptr); 91 91 } … … 93 93 template<> void refIfNotNull(cairo_region_t* ptr) 94 94 { 95 if (LIKELY(ptr != 0))95 if (LIKELY(ptr)) 96 96 cairo_region_reference(ptr); 97 97 } … … 99 99 template<> void derefIfNotNull(cairo_region_t* ptr) 100 100 { 101 if (LIKELY(ptr != 0))101 if (LIKELY(ptr)) 102 102 cairo_region_destroy(ptr); 103 103 } … … 106 106 template<> void refIfNotNull(FcPattern* ptr) 107 107 { 108 if (LIKELY(ptr != 0))108 if (LIKELY(ptr)) 109 109 FcPatternReference(ptr); 110 110 } … … 112 112 template<> void derefIfNotNull(FcPattern* ptr) 113 113 { 114 if (LIKELY(ptr != 0))114 if (LIKELY(ptr)) 115 115 FcPatternDestroy(ptr); 116 116 } … … 118 118 template<> void refIfNotNull(FcConfig* ptr) 119 119 { 120 if (LIKELY(ptr != nullptr))120 if (LIKELY(ptr)) 121 121 FcConfigReference(ptr); 122 122 } … … 124 124 template<> void derefIfNotNull(FcConfig* ptr) 125 125 { 126 if (LIKELY(ptr != nullptr))126 if (LIKELY(ptr)) 127 127 FcConfigDestroy(ptr); 128 128 }
Note:
See TracChangeset
for help on using the changeset viewer.