Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: Source/core/css/CSSSelector.cpp

Issue 809823002: replace COMPILE_ASSERT with static assert in core/css/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/css/CSSRule.cpp ('k') | Source/core/css/CSSValue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * 1999 Waldo Bastian (bastian@kde.org) 3 * 1999 Waldo Bastian (bastian@kde.org)
4 * 2001 Andreas Schlapbach (schlpbch@iam.unibe.ch) 4 * 2001 Andreas Schlapbach (schlpbch@iam.unibe.ch)
5 * 2001-2003 Dirk Mueller (mueller@kde.org) 5 * 2001-2003 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2002, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2002, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2008 David Smith (catfish.man@gmail.com) 7 * Copyright (C) 2008 David Smith (catfish.man@gmail.com)
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 30 matching lines...) Expand all
41 41
42 namespace blink { 42 namespace blink {
43 43
44 using namespace HTMLNames; 44 using namespace HTMLNames;
45 45
46 struct SameSizeAsCSSSelector { 46 struct SameSizeAsCSSSelector {
47 unsigned bitfields; 47 unsigned bitfields;
48 void *pointers[1]; 48 void *pointers[1];
49 }; 49 };
50 50
51 COMPILE_ASSERT(sizeof(CSSSelector) == sizeof(SameSizeAsCSSSelector), CSSSelector ShouldStaySmall); 51 static_assert(sizeof(CSSSelector) == sizeof(SameSizeAsCSSSelector), "CSSSelector should stay small");
52 52
53 void CSSSelector::createRareData() 53 void CSSSelector::createRareData()
54 { 54 {
55 ASSERT(m_match != Tag); 55 ASSERT(m_match != Tag);
56 if (m_hasRareData) 56 if (m_hasRareData)
57 return; 57 return;
58 AtomicString value(m_data.m_value); 58 AtomicString value(m_data.m_value);
59 if (m_data.m_value) 59 if (m_data.m_value)
60 m_data.m_value->deref(); 60 m_data.m_value->deref();
61 m_data.m_rareData = RareData::create(value).leakRef(); 61 m_data.m_rareData = RareData::create(value).leakRef();
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 if (count < nthBValue()) 919 if (count < nthBValue())
920 return false; 920 return false;
921 return (count - nthBValue()) % nthAValue() == 0; 921 return (count - nthBValue()) % nthAValue() == 0;
922 } 922 }
923 if (count > nthBValue()) 923 if (count > nthBValue())
924 return false; 924 return false;
925 return (nthBValue() - count) % (-nthAValue()) == 0; 925 return (nthBValue() - count) % (-nthAValue()) == 0;
926 } 926 }
927 927
928 } // namespace blink 928 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSRule.cpp ('k') | Source/core/css/CSSValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698