third_party/skia/src/ports/SkFontHost_FreeType.cpp:957:7:error: switch case is
in protected scope
      default:
      ^
third_party/skia/src/ports/SkFontHost_FreeType.cpp:918:17: note: jump bypasses
variable initialization
        FT_BBox bbox;
                ^
third_party/skia/src/ports/SkFontHost_FreeType.cpp:946:7:error: switch case is
in protected scope
      case FT_GLYPH_FORMAT_BITMAP:
      ^
third_party/skia/src/ports/SkFontHost_FreeType.cpp:918:17: note: jump bypasses
variable initialization
        FT_BBox bbox;
                ^
2 errors generated.

This is arguably a false positive, but since |bbox| can only safely be used in
the first case branch, it's a good idea to scope it to there anyway. This is
the only instance this warning occurs in all of chrome.

Review URL: http://codereview.appspot.com/4532081/



git-svn-id: http://skia.googlecode.com/svn/trunk@1402 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
thakis@chromium.org 2011-05-24 05:42:55 +00:00
Родитель eb5a8151a5
Коммит 598b859211
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -914,7 +914,7 @@ void SkScalerContext_FreeType::generateMetrics(SkGlyph* glyph) {
}
switch ( fFace->glyph->format ) {
case FT_GLYPH_FORMAT_OUTLINE:
case FT_GLYPH_FORMAT_OUTLINE: {
FT_BBox bbox;
if (fRec.fFlags & kEmbolden_Flag) {
@ -942,6 +942,7 @@ void SkScalerContext_FreeType::generateMetrics(SkGlyph* glyph) {
glyph->fTop = -SkToS16(bbox.yMax >> 6);
glyph->fLeft = SkToS16(bbox.xMin >> 6);
break;
}
case FT_GLYPH_FORMAT_BITMAP:
if (fRec.fFlags & kEmbolden_Flag) {