Bug 1079321 - Fix some more bad implicit constructors in gfx; r=jrmuizel

This commit is contained in:
Ehsan Akhgari 2014-09-24 09:16:53 -04:00
parent 9499aaec6a
commit 6f5bb65d78
4 changed files with 8 additions and 8 deletions

View File

@ -111,7 +111,7 @@ MOZ_END_ENUM_CLASS(LogOptions)
template<typename T>
struct Hexa {
Hexa(T aVal) : mVal(aVal) {}
explicit Hexa(T aVal) : mVal(aVal) {}
T mVal;
};
template<typename T>

View File

@ -706,7 +706,7 @@ namespace {
struct Format14CmapWrapper
{
const Format14Cmap& mCmap14;
Format14CmapWrapper(const Format14Cmap& cmap14) : mCmap14(cmap14) {}
explicit Format14CmapWrapper(const Format14Cmap& cmap14) : mCmap14(cmap14) {}
uint32_t operator[](size_t index) const {
return mCmap14.varSelectorRecords[index].varSelector;
}
@ -715,7 +715,7 @@ struct Format14CmapWrapper
struct NonDefUVSTableWrapper
{
const NonDefUVSTable& mTable;
NonDefUVSTableWrapper(const NonDefUVSTable& table) : mTable(table) {}
explicit NonDefUVSTableWrapper(const NonDefUVSTable& table) : mTable(table) {}
uint32_t operator[](size_t index) const {
return mTable.uvsMappings[index].unicodeValue;
}
@ -1337,7 +1337,7 @@ struct MacCharsetMappingComparator
{
typedef gfxFontUtils::MacFontNameCharsetMapping MacFontNameCharsetMapping;
const MacFontNameCharsetMapping& mSearchValue;
MacCharsetMappingComparator(const MacFontNameCharsetMapping& aSearchValue)
explicit MacCharsetMappingComparator(const MacFontNameCharsetMapping& aSearchValue)
: mSearchValue(aSearchValue) {}
int operator()(const MacFontNameCharsetMapping& aEntry) const {
if (mSearchValue < aEntry) {

View File

@ -361,7 +361,7 @@ namespace {
struct GlyphArrayWrapper
{
const GlyphID* const mGlyphArray;
GlyphArrayWrapper(const GlyphID* const aGlyphArray) : mGlyphArray(aGlyphArray)
explicit GlyphArrayWrapper(const GlyphID* const aGlyphArray) : mGlyphArray(aGlyphArray)
{}
uint16_t operator[](size_t index) const {
return mGlyphArray[index];
@ -371,7 +371,7 @@ struct GlyphArrayWrapper
struct RangeRecordComparator
{
const uint32_t mGlyph;
RangeRecordComparator(uint32_t aGlyph) : mGlyph(aGlyph) {}
explicit RangeRecordComparator(uint32_t aGlyph) : mGlyph(aGlyph) {}
int operator()(const RangeRecord& aRecord) const {
if (mGlyph < static_cast<uint16_t>(aRecord.mStart)) {
return -1;

View File

@ -9,7 +9,7 @@
struct SkippedRangeStartComparator
{
const uint32_t mOffset;
SkippedRangeStartComparator(const uint32_t aOffset) : mOffset(aOffset) {}
explicit SkippedRangeStartComparator(const uint32_t aOffset) : mOffset(aOffset) {}
int operator()(const gfxSkipChars::SkippedRange& aRange) const {
return (mOffset < aRange.Start()) ? -1 : 1;
}
@ -69,7 +69,7 @@ gfxSkipCharsIterator::SetOriginalOffset(int32_t aOffset)
struct SkippedRangeOffsetComparator
{
const uint32_t mOffset;
SkippedRangeOffsetComparator(const uint32_t aOffset) : mOffset(aOffset) {}
explicit SkippedRangeOffsetComparator(const uint32_t aOffset) : mOffset(aOffset) {}
int operator()(const gfxSkipChars::SkippedRange& aRange) const {
return (mOffset < aRange.SkippedOffset()) ? -1 : 1;
}