summaryrefslogtreecommitdiffstats
path: root/build/install-build-deps.sh
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-01 00:51:50 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-01 00:51:50 +0000
commit9ad3f0c227121fc3bb55723894cf21254b566de7 (patch)
tree6a9f7dddf418156791116ffdd8e477d0513732ca /build/install-build-deps.sh
parent05094a3fd1209ad3c5fa5c92c78694da589b9448 (diff)
downloadchromium_src-9ad3f0c227121fc3bb55723894cf21254b566de7.zip
chromium_src-9ad3f0c227121fc3bb55723894cf21254b566de7.tar.gz
chromium_src-9ad3f0c227121fc3bb55723894cf21254b566de7.tar.bz2
For MergeUrls(), convert anonymous enum that gives bit values into a typedefed uint32. This allows places wishing to refer to "a bitfield composed of these values" to use an explicit type. (This isn't possible by simply naming the enum as technically the enum doesn't define all of the possible combinations of bits.) This also means the individual named bit constants themselves have the same explicit type.
The drawback to defining constants at their declaration point is that supplying them to a templated function, like what EXPECT_EQ() expands into, triggers an "undefined symbol" error on Mac/Linux (and adding explicit storage for them in the .cc file can cause duplicate symbol errors on Windows). Here I've worked around that by converting EXPECT_EQ(a, b) to EXPECT_TRUE(b == a). Another possibility is to define the constants in the .cc file and merely declare them in the header, which works but is more verbose and less readable. The original motiviation for this change was to find a way to eliminate some cases of passing anonymous-typed values as template arguments (which happens when you use a value from the enum in e.g. EXPECT_EQ()), which is technically illegal in C++03, though we don't warn about it. Simply naming the enum would have done this, but this would have encouraged readers to actually use the enum name as a type, which for a bitfield is inappropriate for the reason given in the first paragraph. BUG=92247 TEST=Compiles Review URL: http://codereview.chromium.org/7756007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/install-build-deps.sh')
0 files changed, 0 insertions, 0 deletions