summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeigo Nonaka <nona@google.com>2015-10-27 14:56:12 +0900
committerSeigo Nonaka <nona@google.com>2015-10-27 21:18:22 +0900
commit63635cff5861dcaed963c7332eecf51b9d7d920a (patch)
treea1c2f6aaec1c3fa11834efbffab44ac9dce55db2
parent4b723bf22b1bbc5fcdaa9bd96178c921199905d5 (diff)
downloadandroid_frameworks_minikin-63635cff5861dcaed963c7332eecf51b9d7d920a.tar.gz
android_frameworks_minikin-63635cff5861dcaed963c7332eecf51b9d7d920a.tar.bz2
android_frameworks_minikin-63635cff5861dcaed963c7332eecf51b9d7d920a.zip
Add -Werror -Wall -Wextra to compiler option.
- To suppress noisy unused parameter warnings, comment out unused arguments. - Add -Werror for suppressing further warning. - Add -Wall -Wextra for safety. Change-Id: I30a0914a4633bd93eb60957cdf378770f04d8428
-rw-r--r--include/minikin/Layout.h2
-rw-r--r--libs/minikin/Android.mk3
-rw-r--r--libs/minikin/HbFaceCache.cpp9
-rw-r--r--libs/minikin/Layout.cpp9
-rw-r--r--libs/minikin/MinikinFontFreeType.cpp8
-rw-r--r--tests/Android.mk2
-rw-r--r--tests/HbFaceCacheTest.cpp10
-rw-r--r--tests/MinikinFontForTest.cpp8
8 files changed, 26 insertions, 25 deletions
diff --git a/include/minikin/Layout.h b/include/minikin/Layout.h
index 83eb963..cb68db9 100644
--- a/include/minikin/Layout.h
+++ b/include/minikin/Layout.h
@@ -59,7 +59,7 @@ struct LayoutGlyph {
};
// Internal state used during layout operation
-class LayoutContext;
+struct LayoutContext;
enum {
kBidi_LTR = 0,
diff --git a/libs/minikin/Android.mk b/libs/minikin/Android.mk
index 4d34c11..c728b09 100644
--- a/libs/minikin/Android.mk
+++ b/libs/minikin/Android.mk
@@ -50,6 +50,7 @@ LOCAL_MODULE := libminikin
LOCAL_EXPORT_C_INCLUDE_DIRS := frameworks/minikin/include
LOCAL_SRC_FILES := $(minikin_src_files)
LOCAL_C_INCLUDES := $(minikin_c_includes)
+LOCAL_CPPFLAGS += -Werror -Wall -Wextra
LOCAL_SHARED_LIBRARIES := $(minikin_shared_libraries)
include $(BUILD_SHARED_LIBRARY)
@@ -61,6 +62,7 @@ LOCAL_MODULE_TAGS := optional
LOCAL_EXPORT_C_INCLUDE_DIRS := frameworks/minikin/include
LOCAL_SRC_FILES := $(minikin_src_files)
LOCAL_C_INCLUDES := $(minikin_c_includes)
+LOCAL_CPPFLAGS += -Werror -Wall -Wextra
LOCAL_SHARED_LIBRARIES := $(minikin_shared_libraries)
include $(BUILD_STATIC_LIBRARY)
@@ -73,6 +75,7 @@ LOCAL_MODULE := libminikin_host
LOCAL_MODULE_TAGS := optional
LOCAL_EXPORT_C_INCLUDE_DIRS := frameworks/minikin/include
LOCAL_C_INCLUDES := $(minikin_c_includes)
+LOCAL_CPPFLAGS += -Werror -Wall -Wextra
LOCAL_SHARED_LIBRARIES := liblog libicuuc-host
LOCAL_SRC_FILES := Hyphenator.cpp
diff --git a/libs/minikin/HbFaceCache.cpp b/libs/minikin/HbFaceCache.cpp
index fde2fa8..a12cd95 100644
--- a/libs/minikin/HbFaceCache.cpp
+++ b/libs/minikin/HbFaceCache.cpp
@@ -26,7 +26,7 @@
namespace android {
-static hb_blob_t* referenceTable(hb_face_t* face, hb_tag_t tag, void* userData) {
+static hb_blob_t* referenceTable(hb_face_t* /* face */, hb_tag_t tag, void* userData) {
MinikinFont* font = reinterpret_cast<MinikinFont*>(userData);
size_t length = 0;
bool ok = font->GetTable(tag, NULL, &length);
@@ -50,11 +50,6 @@ static hb_blob_t* referenceTable(hb_face_t* face, hb_tag_t tag, void* userData)
HB_MEMORY_MODE_WRITABLE, buffer, free);
}
-static unsigned int disabledDecomposeCompatibility(
- hb_unicode_funcs_t*, hb_codepoint_t, hb_codepoint_t*, void*) {
- return 0;
-}
-
class HbFaceCache : private OnEntryRemoved<int32_t, hb_face_t*> {
public:
HbFaceCache() : mCache(kMaxEntries) {
@@ -62,7 +57,7 @@ public:
}
// callback for OnEntryRemoved
- void operator()(int32_t& key, hb_face_t*& value) {
+ void operator()(int32_t& /* key */, hb_face_t*& value) {
hb_face_destroy(value);
}
diff --git a/libs/minikin/Layout.cpp b/libs/minikin/Layout.cpp
index 6d62d5d..9084eba 100644
--- a/libs/minikin/Layout.cpp
+++ b/libs/minikin/Layout.cpp
@@ -276,16 +276,17 @@ void Layout::setFontCollection(const FontCollection* collection) {
mCollection = collection;
}
-static hb_position_t harfbuzzGetGlyphHorizontalAdvance(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, void* userData)
-{
+static hb_position_t harfbuzzGetGlyphHorizontalAdvance(hb_font_t* /* hbFont */, void* fontData,
+ hb_codepoint_t glyph, void* /* userData */) {
MinikinPaint* paint = reinterpret_cast<MinikinPaint*>(fontData);
MinikinFont* font = paint->font;
float advance = font->GetHorizontalAdvance(glyph, *paint);
return 256 * advance + 0.5;
}
-static hb_bool_t harfbuzzGetGlyphHorizontalOrigin(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, hb_position_t* x, hb_position_t* y, void* userData)
-{
+static hb_bool_t harfbuzzGetGlyphHorizontalOrigin(hb_font_t* /* hbFont */, void* /* fontData */,
+ hb_codepoint_t /* glyph */, hb_position_t* /* x */, hb_position_t* /* y */,
+ void* /* userData */) {
// Just return true, following the way that Harfbuzz-FreeType
// implementation does.
return true;
diff --git a/libs/minikin/MinikinFontFreeType.cpp b/libs/minikin/MinikinFontFreeType.cpp
index cbeed61..c9eb456 100644
--- a/libs/minikin/MinikinFontFreeType.cpp
+++ b/libs/minikin/MinikinFontFreeType.cpp
@@ -47,8 +47,8 @@ float MinikinFontFreeType::GetHorizontalAdvance(uint32_t glyph_id,
return advance * (1.0 / 65536);
}
-void MinikinFontFreeType::GetBounds(MinikinRect* bounds, uint32_t glyph_id,
- const MinikinPaint& paint) const {
+void MinikinFontFreeType::GetBounds(MinikinRect* /* bounds */, uint32_t /* glyph_id*/,
+ const MinikinPaint& /* paint */) const {
// TODO: NYI
}
@@ -66,8 +66,8 @@ int32_t MinikinFontFreeType::GetUniqueId() const {
return mUniqueId;
}
-bool MinikinFontFreeType::Render(uint32_t glyph_id,
- const MinikinPaint &paint, GlyphBitmap *result) {
+bool MinikinFontFreeType::Render(uint32_t glyph_id, const MinikinPaint& /* paint */,
+ GlyphBitmap *result) {
FT_Error error;
FT_Int32 load_flags = FT_LOAD_DEFAULT; // TODO: respect hinting settings
error = FT_Load_Glyph(mTypeface, glyph_id, load_flags);
diff --git a/tests/Android.mk b/tests/Android.mk
index b69b8f2..b6bc15c 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -54,4 +54,6 @@ LOCAL_C_INCLUDES := \
external/libxml2/include \
external/skia/src/core
+LOCAL_CPPFLAGS += -Werror -Wall -Wextra
+
include $(BUILD_NATIVE_TEST)
diff --git a/tests/HbFaceCacheTest.cpp b/tests/HbFaceCacheTest.cpp
index fbaf0ea..76eec5b 100644
--- a/tests/HbFaceCacheTest.cpp
+++ b/tests/HbFaceCacheTest.cpp
@@ -35,18 +35,18 @@ public:
MockMinikinFont(int32_t id) : mId(id) {
}
- virtual float GetHorizontalAdvance(
- uint32_t glyph_id, const MinikinPaint &paint) const {
+ virtual float GetHorizontalAdvance(uint32_t /* glyph_id */,
+ const MinikinPaint& /* paint */) const {
LOG_ALWAYS_FATAL("MockMinikinFont::GetHorizontalAdvance is not implemented.");
return 0.0f;
}
- virtual void GetBounds(MinikinRect* bounds, uint32_t glyph_id,
- const MinikinPaint &paint) const {
+ virtual void GetBounds(MinikinRect* /* bounds */, uint32_t /* glyph_id */,
+ const MinikinPaint& /* paint */) const {
LOG_ALWAYS_FATAL("MockMinikinFont::GetBounds is not implemented.");
}
- virtual bool GetTable(uint32_t tag, uint8_t *buf, size_t *size) {
+ virtual bool GetTable(uint32_t /* tag */, uint8_t* /* buf */, size_t* /* size */) {
LOG_ALWAYS_FATAL("MockMinikinFont::GetTable is not implemented.");
return false;
}
diff --git a/tests/MinikinFontForTest.cpp b/tests/MinikinFontForTest.cpp
index 033241e..ed70751 100644
--- a/tests/MinikinFontForTest.cpp
+++ b/tests/MinikinFontForTest.cpp
@@ -29,14 +29,14 @@ MinikinFontForTest::MinikinFontForTest(const std::string& font_path) : mFontPath
MinikinFontForTest::~MinikinFontForTest() {
}
-float MinikinFontForTest::GetHorizontalAdvance(
- uint32_t glyph_id, const android::MinikinPaint &paint) const {
+float MinikinFontForTest::GetHorizontalAdvance(uint32_t /* glyph_id */,
+ const android::MinikinPaint& /* paint */) const {
LOG_ALWAYS_FATAL("MinikinFontForTest::GetHorizontalAdvance is not yet implemented");
return 0.0f;
}
-void MinikinFontForTest::GetBounds(android::MinikinRect* bounds, uint32_t glyph_id,
- const android::MinikinPaint& paint) const {
+void MinikinFontForTest::GetBounds(android::MinikinRect* /* bounds */, uint32_t /* glyph_id */,
+ const android::MinikinPaint& /* paint */) const {
LOG_ALWAYS_FATAL("MinikinFontForTest::GetBounds is not yet implemented");
}