diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2016-03-08 12:48:52 -0500 |
---|---|---|
committer | Dan Sinclair <dsinclair@chromium.org> | 2016-03-08 12:48:52 -0500 |
commit | 83c523a519477a2fe5a7e3e8044c767bfee36770 (patch) | |
tree | acfcd6a165b610cae93a1493a17108a007adbcef | |
parent | 6f6388fee1fdb4bec57549fe87a0833b2b20bebe (diff) | |
download | pdfium-83c523a519477a2fe5a7e3e8044c767bfee36770.tar.xz |
Update cast to fix lint warning.
The current cast confused runtime/casting. Update to use static_cast and enable
the lint warning.
BUG=pdfium:426
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1770253003 .
-rw-r--r-- | PRESUBMIT.py | 1 | ||||
-rw-r--r-- | core/include/fxge/fx_freetype.h | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 502aaac9b3..7c8f8f439b 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -20,7 +20,6 @@ LINT_FILTERS = [ '-readability/todo', '-readability/utf8', '-runtime/arrays', - '-runtime/casting', '-runtime/explicit', '-runtime/int', '-runtime/printf', diff --git a/core/include/fxge/fx_freetype.h b/core/include/fxge/fx_freetype.h index 5721784eb7..698cd5cd5a 100644 --- a/core/include/fxge/fx_freetype.h +++ b/core/include/fxge/fx_freetype.h @@ -132,7 +132,7 @@ typedef FT_CharMap FXFT_CharMap; #define FXFT_Get_Face_Descender(face) ((FT_Face)face)->descender #define FXFT_Get_Glyph_HoriAdvance(face) \ ((FT_Face)face)->glyph->metrics.horiAdvance -#define FXFT_Get_MM_Axis(var, index) &((FT_MM_Var*)var)->axis[index] +#define FXFT_Get_MM_Axis(var, index) &static_cast<FT_MM_Var*>(var)->axis[index] #define FXFT_Get_MM_Axis_Min(axis) ((FT_Var_Axis*)axis)->minimum #define FXFT_Get_MM_Axis_Max(axis) ((FT_Var_Axis*)axis)->maximum #define FXFT_Get_MM_Axis_Def(axis) ((FT_Var_Axis*)axis)->def @@ -140,7 +140,7 @@ typedef FT_CharMap FXFT_CharMap; ((FT_Library)library)->memory->alloc(((FT_Library)library)->memory, size) #define FXFT_Free(face, p) \ ((FT_Face)face)->memory->free(((FT_Face)face)->memory, p) -#define FXFT_Get_Glyph_Outline(face) &((FT_Face)face)->glyph->outline +#define FXFT_Get_Glyph_Outline(face) &static_cast<FT_Face>(face)->glyph->outline #define FXFT_Get_Outline_Bbox(outline, cbox) FT_Outline_Get_CBox(outline, cbox) #define FXFT_Render_Glyph(face, mode) \ FT_Render_Glyph(((FT_Face)face)->glyph, (enum FT_Render_Mode_)mode) @@ -150,7 +150,7 @@ typedef FT_CharMap FXFT_CharMap; #define FXFT_Set_Pixel_Sizes(face, w, h) FT_Set_Pixel_Sizes((FT_Face)face, w, h) #define FXFT_Set_Transform(face, m, d) FT_Set_Transform((FT_Face)face, m, d) #define FXFT_Outline_Embolden(outline, s) FT_Outline_Embolden(outline, s) -#define FXFT_Get_Glyph_Bitmap(face) &((FT_Face)face)->glyph->bitmap +#define FXFT_Get_Glyph_Bitmap(face) &static_cast<FT_Face>(face)->glyph->bitmap #define FXFT_Get_Bitmap_Width(bitmap) ((FT_Bitmap*)bitmap)->width #define FXFT_Get_Bitmap_Rows(bitmap) ((FT_Bitmap*)bitmap)->rows #define FXFT_Get_Bitmap_PixelMode(bitmap) ((FT_Bitmap*)bitmap)->pixel_mode |