Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Issue 369343003: Remove uninitialized const global g_GbFontNameMap. (Closed)

Created:
6 years, 5 months ago by Nico
Modified:
6 years, 5 months ago
Reviewers:
Bo Xu, jun_fang, jam
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Visibility:
Public.

Description

Remove uninitialized const global g_GbFontNameMap. C++11 makes uninitialized const PODs an error, because they contain uninitialized memory (they're uninitialized that can never be initialized (because they're const). In this case, the memory was only used by _GetSubFontName() if the lang parameter was 1, but _GetSubFontName() is only called from one place, with a lang parameter of 0. So remove _GetSubFontName()'s lang parameter too. (Using bsearch for searching an array that always has exactly 2 entries is overkill too, but I'm trying to keep the diff small.) No intended behavior change. Fixes this error on the clang/win bot: ..\..\third_party\pdfium\core\src\fxge\win32\fx_win32_device.cpp(207,20) : error(clang): default initialization of an object of const type 'const _FontNameMap [1]' const _FontNameMap g_GbFontNameMap[1]; ^ BUG=chromium:82385 R=bo_xu@foxitsoftware.com Committed: https://pdfium.googlesource.com/pdfium/+/27e35a8

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -9 lines) Patch
M core/src/fxge/win32/fx_win32_device.cpp View 2 chunks +2 lines, -9 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Nico
6 years, 5 months ago (2014-07-04 22:49:25 UTC) #1
jam
Nico: for changes to pdfium, Bo/Jun are better suited to review this since they're more ...
6 years, 5 months ago (2014-07-14 22:48:20 UTC) #2
Nico
Bo/Jun: Ping.
6 years, 5 months ago (2014-07-15 21:45:15 UTC) #3
Bo Xu
On 2014/07/15 21:45:15, Nico (away) wrote: > Bo/Jun: Ping. I looked at this issue. Although ...
6 years, 5 months ago (2014-07-15 22:10:10 UTC) #4
Nico
On 2014/07/15 22:10:10, Bo Xu wrote: > On 2014/07/15 21:45:15, Nico (away) wrote: > > ...
6 years, 5 months ago (2014-07-15 22:17:58 UTC) #5
Bo Xu
On 2014/07/15 22:17:58, Nico (away) wrote: > On 2014/07/15 22:10:10, Bo Xu wrote: > > ...
6 years, 5 months ago (2014-07-16 03:33:21 UTC) #6
Nico
6 years, 5 months ago (2014-07-16 18:07:43 UTC) #7
Message was sent while issue was closed.
Committed patchset #1 manually as r27e35a8 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698