From 3ebd121d45ceb08918a3dcb5b3b7ac29448c862f Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 9 Mar 2016 09:59:23 -0500 Subject: Review and cleanup lint warnings. This CL goes through the remaining list of list warnings and records why they are currently blacklisted, or fixes and enables them. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1773733002 . --- core/include/fpdfapi/fpdf_objects.h | 2 +- core/include/fxcrt/fx_system.h | 7 +++++-- core/include/fxge/fx_ge.h | 2 +- core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp | 8 +++++--- core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp | 6 +++--- core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp | 2 ++ core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp | 2 ++ .../src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp | 2 ++ .../fpdf_parser/fpdf_parser_objects_unittest.cpp | 1 + .../fpdf_parser/fpdf_parser_parser_unittest.cpp | 3 +++ core/src/fpdfdoc/doc_action.cpp | 2 ++ core/src/fpdfdoc/doc_form.cpp | 3 +++ core/src/fpdfdoc/doc_link.cpp | 2 ++ core/src/fpdfdoc/doc_tagged.cpp | 2 ++ core/src/fpdfdoc/doc_utils.cpp | 1 + core/src/fpdftext/fpdf_text_int.cpp | 1 + core/src/fxcodec/codec/codec_int.h | 1 + core/src/fxcodec/codec/fx_codec_jbig.cpp | 2 ++ core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp | 2 ++ core/src/fxcrt/fx_basic_bstring.cpp | 22 ++++++++++---------- core/src/fxcrt/fx_basic_gcc.cpp | 24 +++++++++++----------- core/src/fxcrt/fx_basic_wstring.cpp | 15 +++++++------- core/src/fxcrt/fx_system_unittest.cpp | 1 + core/src/fxcrt/fx_xml_parser.cpp | 2 ++ core/src/fxge/win32/fx_win32_gdipext.cpp | 7 ++++--- core/src/fxge/win32/fx_win32_print.cpp | 6 +++--- core/src/fxge/win32/win32_int.h | 2 +- 27 files changed, 82 insertions(+), 48 deletions(-) (limited to 'core') diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h index 58d98e5436..a6fa056e13 100644 --- a/core/include/fpdfapi/fpdf_objects.h +++ b/core/include/fpdfapi/fpdf_objects.h @@ -337,7 +337,7 @@ class CPDF_Dictionary : public CPDF_Object { // Set* functions invalidate iterators for the element with the key |key|. void SetAt(const CFX_ByteStringC& key, CPDF_Object* pObj); void SetAtName(const CFX_ByteStringC& key, const CFX_ByteString& name); - void SetAtString(const CFX_ByteStringC& key, const CFX_ByteString& string); + void SetAtString(const CFX_ByteStringC& key, const CFX_ByteString& str); void SetAtInteger(const CFX_ByteStringC& key, int i); void SetAtNumber(const CFX_ByteStringC& key, FX_FLOAT f); void SetAtReference(const CFX_ByteStringC& key, diff --git a/core/include/fxcrt/fx_system.h b/core/include/fxcrt/fx_system.h index 462fb3babf..76c413e7e3 100644 --- a/core/include/fxcrt/fx_system.h +++ b/core/include/fxcrt/fx_system.h @@ -157,9 +157,12 @@ FXSYS_FILE* FXSYS_wfopen(const FX_WCHAR* filename, const FX_WCHAR* mode); #ifdef __cplusplus } // extern "C" + #include "third_party/base/numerics/safe_conversions.h" + #define FXSYS_strlen(ptr) pdfium::base::checked_cast(strlen(ptr)) #define FXSYS_wcslen(ptr) pdfium::base::checked_cast(wcslen(ptr)) + extern "C" { #else #define FXSYS_strlen(ptr) ((FX_STRSIZE)strlen(ptr)) @@ -206,7 +209,7 @@ extern "C" { #define FXSYS_GetModuleFileName GetModuleFileName #else int FXSYS_GetACP(void); -char* FXSYS_itoa(int value, char* string, int radix); +char* FXSYS_itoa(int value, char* str, int radix); int FXSYS_WideCharToMultiByte(FX_DWORD codepage, FX_DWORD dwFlags, const wchar_t* wstr, @@ -229,7 +232,7 @@ FX_DWORD FXSYS_GetModuleFileName(void* hModule, char* buf, FX_DWORD bufsize); char* FXSYS_strlwr(char* str); char* FXSYS_strupr(char* str); int FXSYS_stricmp(const char*, const char*); -int FXSYS_wcsicmp(const wchar_t* string1, const wchar_t* string2); +int FXSYS_wcsicmp(const wchar_t* str1, const wchar_t* str2); wchar_t* FXSYS_wcslwr(wchar_t* str); wchar_t* FXSYS_wcsupr(wchar_t* str); #endif // _FXM_PLATFORM == _FXM_PLATFORM_WINDOWS_ diff --git a/core/include/fxge/fx_ge.h b/core/include/fxge/fx_ge.h index c5d409c41c..fc9119b123 100644 --- a/core/include/fxge/fx_ge.h +++ b/core/include/fxge/fx_ge.h @@ -591,7 +591,7 @@ class IFX_RenderDeviceDriver { class IFX_PSOutput { public: virtual void Release() = 0; - virtual void OutputPS(const FX_CHAR* string, int len) = 0; + virtual void OutputPS(const FX_CHAR* str, int len) = 0; protected: virtual ~IFX_PSOutput() {} diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp index 8b1571a496..df9c13714d 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp @@ -771,10 +771,12 @@ CPDF_Font* CPDF_Document::AddMacFont(CTFontRef pFont, pFontDesc->SetAtInteger("CapHeight", capheight); CGFloat fStemV = 0; int16_t min_width = SHRT_MAX; + static const UniChar stem_chars[] = {'i', 'I', '!', '1'}; - const size_t count = sizeof(stem_chars) / sizeof(stem_chars[0]); - CGGlyph glyphs[count]; - CGRect boundingRects[count]; + CGGlyph glyphs[FX_ArraySize(stem_chars)]; + CGRect boundingRects[FX_ArraySize(stem_chars)]; + + const size_t count = FX_ArraySize(stem_chars); if (CTFontGetGlyphsForCharacters(font, stem_chars, glyphs, count)) { CTFontGetBoundingRectsForGlyphs(font, kCTFontHorizontalOrientation, glyphs, boundingRects, count); diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp index a8ae866f81..f428bf89a1 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp @@ -120,7 +120,7 @@ class CPDF_PSEngine { CPDF_PSEngine(); ~CPDF_PSEngine(); - FX_BOOL Parse(const FX_CHAR* string, int size); + FX_BOOL Parse(const FX_CHAR* str, int size); FX_BOOL Execute() { return m_MainProc.Execute(this); } FX_BOOL DoOperator(PDF_PSOP op); void Reset() { m_StackCount = 0; } @@ -207,8 +207,8 @@ const struct PDF_PSOpName { {"dup", PSOP_DUP}, {"copy", PSOP_COPY}, {"index", PSOP_INDEX}, {"roll", PSOP_ROLL}}; -FX_BOOL CPDF_PSEngine::Parse(const FX_CHAR* string, int size) { - CPDF_SimpleParser parser((uint8_t*)string, size); +FX_BOOL CPDF_PSEngine::Parse(const FX_CHAR* str, int size) { + CPDF_SimpleParser parser((uint8_t*)str, size); CFX_ByteStringC word = parser.GetWord(); if (word != "{") { return FALSE; diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp index 7114f764ac..2dffc09f9f 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp @@ -6,6 +6,8 @@ #include "core/src/fpdfapi/fpdf_page/pageint.h" +#include + #include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_page.h" diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp index 0287b4fed3..f7c3f7d8d3 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp @@ -6,6 +6,8 @@ #include "core/src/fpdfapi/fpdf_page/pageint.h" +#include + #include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_page.h" diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp index 0b7a841cd4..4fb471713b 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp @@ -6,6 +6,8 @@ #include +#include + #include "core/include/fpdfapi/fpdf_module.h" #include "core/include/fpdfapi/fpdf_parser.h" #include "core/include/fxcodec/fx_codec.h" diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects_unittest.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects_unittest.cpp index d2c30fa6ae..a377a92e44 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects_unittest.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects_unittest.cpp @@ -5,6 +5,7 @@ #include "core/include/fpdfapi/fpdf_objects.h" #include +#include #include #include "core/include/fxcrt/fx_basic.h" diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp index 294a99675d..68068cb522 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include +#include + #include "core/include/fpdfapi/fpdf_parser.h" #include "core/include/fxcrt/fx_stream.h" #include "core/src/fpdfapi/fpdf_parser/cpdf_syntax_parser.h" diff --git a/core/src/fpdfdoc/doc_action.cpp b/core/src/fpdfdoc/doc_action.cpp index 9a0ba57951..12ec4c1907 100644 --- a/core/src/fpdfdoc/doc_action.cpp +++ b/core/src/fpdfdoc/doc_action.cpp @@ -4,6 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include + #include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfdoc/fpdf_doc.h" diff --git a/core/src/fpdfdoc/doc_form.cpp b/core/src/fpdfdoc/doc_form.cpp index 8080dc7597..7469cfd28f 100644 --- a/core/src/fpdfdoc/doc_form.cpp +++ b/core/src/fpdfdoc/doc_form.cpp @@ -4,6 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include + #include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfdoc/fpdf_doc.h" #include "core/src/fpdfdoc/doc_utils.h" @@ -385,6 +387,7 @@ static FX_BOOL RetrieveSpecificFont(uint8_t charSet, lf.lfCharSet = charSet; lf.lfPitchAndFamily = pitchAndFamily; if (pcsFontName) { + // TODO(dsinclair): Should this be strncpy? strcpy(lf.lfFaceName, pcsFontName); } return RetrieveSpecificFont(lf); diff --git a/core/src/fpdfdoc/doc_link.cpp b/core/src/fpdfdoc/doc_link.cpp index 7da29e0954..d2fe67df43 100644 --- a/core/src/fpdfdoc/doc_link.cpp +++ b/core/src/fpdfdoc/doc_link.cpp @@ -6,6 +6,8 @@ #include "core/include/fpdfdoc/fpdf_doc.h" +#include + CPDF_LinkList::CPDF_LinkList() { } diff --git a/core/src/fpdfdoc/doc_tagged.cpp b/core/src/fpdfdoc/doc_tagged.cpp index d4ce4a4b31..6eb1c98592 100644 --- a/core/src/fpdfdoc/doc_tagged.cpp +++ b/core/src/fpdfdoc/doc_tagged.cpp @@ -4,6 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include + #include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_page.h" #include "core/include/fpdfapi/fpdf_parser.h" diff --git a/core/src/fpdfdoc/doc_utils.cpp b/core/src/fpdfdoc/doc_utils.cpp index bc09c9a2c4..11359c9129 100644 --- a/core/src/fpdfdoc/doc_utils.cpp +++ b/core/src/fpdfdoc/doc_utils.cpp @@ -5,6 +5,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include +#include #include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfdoc/fpdf_doc.h" diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp index 4a0aae501c..75677332ec 100644 --- a/core/src/fpdftext/fpdf_text_int.cpp +++ b/core/src/fpdftext/fpdf_text_int.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "core/include/fpdfapi/fpdf_module.h" diff --git a/core/src/fxcodec/codec/codec_int.h b/core/src/fxcodec/codec/codec_int.h index 707088e1a9..bde3daeaea 100644 --- a/core/src/fxcodec/codec/codec_int.h +++ b/core/src/fxcodec/codec/codec_int.h @@ -12,6 +12,7 @@ #include #include #include +#include #include "core/include/fxcodec/fx_codec.h" #include "core/src/fxcodec/jbig2/JBig2_Context.h" diff --git a/core/src/fxcodec/codec/fx_codec_jbig.cpp b/core/src/fxcodec/codec/fx_codec_jbig.cpp index 0e39e19bc9..44e30aa953 100644 --- a/core/src/fxcodec/codec/fx_codec_jbig.cpp +++ b/core/src/fxcodec/codec/fx_codec_jbig.cpp @@ -4,6 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include + #include "core/include/fxcodec/fx_codec.h" #include "core/src/fxcodec/codec/codec_int.h" diff --git a/core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp b/core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp index b3f9911141..2fac8df5a9 100644 --- a/core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp +++ b/core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp @@ -6,6 +6,8 @@ #include "core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.h" +#include + #include "core/include/fxcrt/fx_basic.h" namespace { diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp index 8b4442e823..5d38d57757 100644 --- a/core/src/fxcrt/fx_basic_bstring.cpp +++ b/core/src/fxcrt/fx_basic_bstring.cpp @@ -4,7 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include // For offsetof(). +#include + #include #include "core/include/fxcrt/fx_basic.h" @@ -22,15 +23,15 @@ static int _Buffer_itoa(char* buf, int i, FX_DWORD flags) { u = -i; } int base = 10; - const FX_CHAR* string = "0123456789abcdef"; + const FX_CHAR* str = "0123456789abcdef"; if (flags & FXFORMAT_HEX) { base = 16; if (flags & FXFORMAT_CAPITAL) { - string = "0123456789ABCDEF"; + str = "0123456789ABCDEF"; } } while (u != 0) { - buf1[buf_pos--] = string[u % base]; + buf1[buf_pos--] = str[u % base]; u = u / base; } if ((flags & FXFORMAT_SIGNED) && i < 0) { @@ -202,19 +203,18 @@ const CFX_ByteString& CFX_ByteString::operator+=(char ch) { ConcatInPlace(1, &ch); return *this; } -const CFX_ByteString& CFX_ByteString::operator+=(const CFX_ByteString& string) { - if (!string.m_pData) { +const CFX_ByteString& CFX_ByteString::operator+=(const CFX_ByteString& str) { + if (!str.m_pData) { return *this; } - ConcatInPlace(string.m_pData->m_nDataLength, string.m_pData->m_String); + ConcatInPlace(str.m_pData->m_nDataLength, str.m_pData->m_String); return *this; } -const CFX_ByteString& CFX_ByteString::operator+=( - const CFX_ByteStringC& string) { - if (string.IsEmpty()) { +const CFX_ByteString& CFX_ByteString::operator+=(const CFX_ByteStringC& str) { + if (str.IsEmpty()) { return *this; } - ConcatInPlace(string.GetLength(), string.GetCStr()); + ConcatInPlace(str.GetLength(), str.GetCStr()); return *this; } bool CFX_ByteString::Equal(const char* ptr) const { diff --git a/core/src/fxcrt/fx_basic_gcc.cpp b/core/src/fxcrt/fx_basic_gcc.cpp index e2ec939e7d..2c9c54c8b6 100644 --- a/core/src/fxcrt/fx_basic_gcc.cpp +++ b/core/src/fxcrt/fx_basic_gcc.cpp @@ -33,20 +33,20 @@ IntType FXSYS_StrToInt(const CharType* str) { } template -STR_T FXSYS_IntToStr(T value, STR_T string, int radix) { +STR_T FXSYS_IntToStr(T value, STR_T str, int radix) { if (radix < 2 || radix > 16) { - string[0] = 0; - return string; + str[0] = 0; + return str; } if (value == 0) { - string[0] = '0'; - string[1] = 0; - return string; + str[0] = '0'; + str[1] = 0; + return str; } int i = 0; UT uvalue; if (value < 0) { - string[i++] = '-'; + str[i++] = '-'; // Standard trick to avoid undefined behaviour when negating INT_MIN. uvalue = static_cast(-(value + 1)) + 1; } else { @@ -59,11 +59,11 @@ STR_T FXSYS_IntToStr(T value, STR_T string, int radix) { order = order / radix; } for (int d = digits - 1; d > -1; d--) { - string[d + i] = "0123456789abcdef"[uvalue % radix]; + str[d + i] = "0123456789abcdef"[uvalue % radix]; uvalue /= radix; } - string[digits + i] = 0; - return string; + str[digits + i] = 0; + return str; } #ifdef __cplusplus @@ -191,8 +191,8 @@ int FXSYS_wcsicmp(const FX_WCHAR* dst, const FX_WCHAR* src) { } while (f && (f == l)); return (f - l); } -char* FXSYS_itoa(int value, char* string, int radix) { - return FXSYS_IntToStr(value, string, radix); +char* FXSYS_itoa(int value, char* str, int radix) { + return FXSYS_IntToStr(value, str, radix); } #ifdef __cplusplus } diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp index 8df72466e8..11a840a806 100644 --- a/core/src/fxcrt/fx_basic_wstring.cpp +++ b/core/src/fxcrt/fx_basic_wstring.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include // For offsetof(). +#include #include #include @@ -184,19 +184,18 @@ const CFX_WideString& CFX_WideString::operator+=(const FX_WCHAR* lpsz) { } return *this; } -const CFX_WideString& CFX_WideString::operator+=(const CFX_WideString& string) { - if (!string.m_pData) { +const CFX_WideString& CFX_WideString::operator+=(const CFX_WideString& str) { + if (!str.m_pData) { return *this; } - ConcatInPlace(string.m_pData->m_nDataLength, string.m_pData->m_String); + ConcatInPlace(str.m_pData->m_nDataLength, str.m_pData->m_String); return *this; } -const CFX_WideString& CFX_WideString::operator+=( - const CFX_WideStringC& string) { - if (string.IsEmpty()) { +const CFX_WideString& CFX_WideString::operator+=(const CFX_WideStringC& str) { + if (str.IsEmpty()) { return *this; } - ConcatInPlace(string.GetLength(), string.GetPtr()); + ConcatInPlace(str.GetLength(), str.GetPtr()); return *this; } bool CFX_WideString::Equal(const wchar_t* ptr) const { diff --git a/core/src/fxcrt/fx_system_unittest.cpp b/core/src/fxcrt/fx_system_unittest.cpp index 4a07a77ad2..f877eb2aa5 100644 --- a/core/src/fxcrt/fx_system_unittest.cpp +++ b/core/src/fxcrt/fx_system_unittest.cpp @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include #include #include "core/include/fxcrt/fx_system.h" diff --git a/core/src/fxcrt/fx_xml_parser.cpp b/core/src/fxcrt/fx_xml_parser.cpp index 59c3de444e..da2b26b5b8 100644 --- a/core/src/fxcrt/fx_xml_parser.cpp +++ b/core/src/fxcrt/fx_xml_parser.cpp @@ -6,6 +6,8 @@ #include "core/src/fxcrt/xml_int.h" +#include + #include "core/include/fxcrt/fx_ext.h" #include "core/include/fxcrt/fx_xml.h" #include "third_party/base/stl_util.h" diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp index 629f3235ed..aba67dacfe 100644 --- a/core/src/fxge/win32/fx_win32_gdipext.cpp +++ b/core/src/fxge/win32/fx_win32_gdipext.cpp @@ -16,11 +16,12 @@ using std::max; } // namespace Gdiplus #include + #include "core/include/fxge/fx_ge_win32.h" #include "core/src/fxge/win32/win32_int.h" -using namespace Gdiplus; -using namespace Gdiplus::DllExports; +using namespace Gdiplus; // NOLINT +using namespace Gdiplus::DllExports; // NOLINT #define GdiFillType2Gdip(fill_type) \ (fill_type == ALTERNATE ? FillModeAlternate : FillModeWinding) @@ -420,7 +421,7 @@ typedef GpStatus(WINGDIPAPI* FuncType_GdipDrawImageRectI)(GpGraphics* graphics, INT height); typedef GpStatus(WINGDIPAPI* FuncType_GdipDrawString)( GpGraphics* graphics, - GDIPCONST WCHAR* string, + GDIPCONST WCHAR* str, INT length, GDIPCONST GpFont* font, GDIPCONST RectF* layoutRect, diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp index 6c262d83dc..acd73d1427 100644 --- a/core/src/fxge/win32/fx_win32_print.cpp +++ b/core/src/fxge/win32/fx_win32_print.cpp @@ -287,15 +287,15 @@ CPSOutput::~CPSOutput() { void CPSOutput::Init() { m_pBuf = FX_Alloc(FX_CHAR, 1026); } -void CPSOutput::OutputPS(const FX_CHAR* string, int len) { +void CPSOutput::OutputPS(const FX_CHAR* str, int len) { if (len < 0) { - len = (int)FXSYS_strlen(string); + len = (int)FXSYS_strlen(str); } int sent_len = 0; while (len > 0) { int send_len = len > 1024 ? 1024 : len; *(FX_WORD*)m_pBuf = send_len; - FXSYS_memcpy(m_pBuf + 2, string + sent_len, send_len); + FXSYS_memcpy(m_pBuf + 2, str + sent_len, send_len); ExtEscape(m_hDC, PASSTHROUGH, send_len + 2, m_pBuf, 0, NULL); sent_len += send_len; len -= send_len; diff --git a/core/src/fxge/win32/win32_int.h b/core/src/fxge/win32/win32_int.h index 97da0ac15c..233fe367f5 100644 --- a/core/src/fxge/win32/win32_int.h +++ b/core/src/fxge/win32/win32_int.h @@ -277,7 +277,7 @@ class CPSOutput : public IFX_PSOutput { // IFX_PSOutput void Release() override { delete this; } - void OutputPS(const FX_CHAR* string, int len) override; + void OutputPS(const FX_CHAR* str, int len) override; void Init(); -- cgit v1.2.3