[Libreoffice-commits] core.git: compilerplugins/clang include/vcl vcl/inc vcl/source
Noel Grandin
noel.grandin at collabora.co.uk
Mon Feb 6 05:48:48 UTC 2017
compilerplugins/clang/unusedenumconstants.py | 2 ++
include/vcl/settings.hxx | 2 +-
vcl/inc/unx/i18n_cb.hxx | 6 ++++--
vcl/inc/unx/printergfx.hxx | 1 -
vcl/source/fontsubset/ttcr.hxx | 13 ++++++-------
5 files changed, 13 insertions(+), 11 deletions(-)
New commits:
commit 8b2ffb280b494253dbdb8abd4230fbb6f1d78db0
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Fri Feb 3 15:59:06 2017 +0200
loplugin:unusedenumconstants in vcl
- drop TTCR_GLYPHSEQ
- drop ImageType::Invalid
- give preedit_data_t a default constructor, so my plugin spots that the
eState field is being initalised to DontKnow effectively by a memset
- document ToolbarIconSize::Small as unused, but can't remove since
it might be stored in a user-setting somewhere
Change-Id: I94b34bba83a04de16f95e4faec95b4bd29f3c652
Reviewed-on: https://gerrit.libreoffice.org/33887
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py
index 5a9fe36..f2876b5 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -89,6 +89,7 @@ for d in definitionSet:
"sw/source/filter/inc/wwstyles.hxx",
"sw/source/filter/ww8/fields.hxx",
"vcl/source/fontsubset/cff.cxx",
+ "include/vcl/settings.hxx", # stored in a setting, can't remove it without potentially triggering UBSAN
# unit test code
"cppu/source/uno/check.cxx",
# general weird nonsense going on
@@ -97,6 +98,7 @@ for d in definitionSet:
# Windows or OSX only
"include/canvas/rendering/icolorbuffer.hxx",
"include/vcl/commandevent.hxx",
+ "vcl/inc/unx/gendata.hxx",
# must match some other enum
"include/editeng/bulletitem.hxx",
"include/editeng/svxenum.hxx",
diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index 343559d..7fef457 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -227,7 +227,7 @@ namespace o3tl
enum class ToolbarIconSize
{
Unknown = 0,
- Small = 1,
+ Small = 1, // unused
Large = 2,
Size32 = 3,
};
diff --git a/vcl/inc/unx/i18n_cb.hxx b/vcl/inc/unx/i18n_cb.hxx
index 2ab73da..a63905d 100644
--- a/vcl/inc/unx/i18n_cb.hxx
+++ b/vcl/inc/unx/i18n_cb.hxx
@@ -63,13 +63,15 @@ enum class PreeditStatus {
StartPending
};
-typedef struct {
+struct preedit_data_t {
SalFrame* pFrame;
PreeditStatus eState;
preedit_text_t aText;
SalExtTextInputEvent aInputEv;
std::vector< ExtTextInputAttr > aInputFlags;
-} preedit_data_t;
+
+ preedit_data_t() : eState(PreeditStatus::DontKnow) {}
+};
#endif // INCLUDED_VCL_INC_UNX_I18N_CB_HXX
diff --git a/vcl/inc/unx/printergfx.hxx b/vcl/inc/unx/printergfx.hxx
index bf47793..820f047 100644
--- a/vcl/inc/unx/printergfx.hxx
+++ b/vcl/inc/unx/printergfx.hxx
@@ -128,7 +128,6 @@ public:
};
enum class ImageType {
- Invalid = 0,
TrueColorImage,
MonochromeImage,
PaletteImage,
diff --git a/vcl/source/fontsubset/ttcr.hxx b/vcl/source/fontsubset/ttcr.hxx
index dd6c262..3f9963d 100644
--- a/vcl/source/fontsubset/ttcr.hxx
+++ b/vcl/source/fontsubset/ttcr.hxx
@@ -48,13 +48,12 @@ namespace vcl
/** Error codes for most functions */
enum TTCRErrCodes {
- TTCR_OK = 0, /**< no error */
- TTCR_ZEROGLYPHS = 1, /**< At least one glyph should be defined */
- TTCR_UNKNOWN = 2, /**< Unknown TrueType table */
- TTCR_GLYPHSEQ = 3, /**< Glyph IDs are not sequential in the glyf table */
- TTCR_NONAMES = 4, /**< 'name' table does not contain any names */
- TTCR_NAMETOOLONG = 5, /**< 'name' table is too long (string data > 64K) */
- TTCR_POSTFORMAT = 6 /**< unsupported format of a 'post' table */
+ TTCR_OK, /**< no error */
+ TTCR_ZEROGLYPHS, /**< At least one glyph should be defined */
+ TTCR_UNKNOWN, /**< Unknown TrueType table */
+ TTCR_NONAMES, /**< 'name' table does not contain any names */
+ TTCR_NAMETOOLONG, /**< 'name' table is too long (string data > 64K) */
+ TTCR_POSTFORMAT /**< unsupported format of a 'post' table */
};
/**
More information about the Libreoffice-commits
mailing list