From 51b584880e550545ced3aa8ba4ccad3cf79bb53e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 28 Jan 2019 14:09:45 -0500 Subject: [PATCH 1/4] [pragma] Silence MSVC unknown-pragma warning --- src/hb.hh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hb.hh b/src/hb.hh index 860236b7c..5b66ba85d 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -30,6 +30,9 @@ #define HB_HH #ifndef HB_NO_PRAGMA_GCC_DIAGNOSTIC +#if defined(_MSC_VER) +#pragma warning( disable: 4068 ) /* Unknown pragma */ +#endif #if defined(__GNUC__) || defined(__clang__) /* Rules: * From 9db7a7da6339eacbb6c699fa1939bbd7e9e148f5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 28 Jan 2019 14:09:59 -0500 Subject: [PATCH 2/4] Fix warning c:\projects\harfbuzz\src\hb-ot-color-cbdt-table.hh(59): warning C4146: unary minus operator applied to unsigned type, result still unsigned [C:\projects\harfbuzz\build\harfbuzz.vcxproj] --- src/hb-ot-color-cbdt-table.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-ot-color-cbdt-table.hh b/src/hb-ot-color-cbdt-table.hh index 71c31aff8..333ceaaba 100644 --- a/src/hb-ot-color-cbdt-table.hh +++ b/src/hb-ot-color-cbdt-table.hh @@ -56,7 +56,7 @@ struct SmallGlyphMetrics extents->x_bearing = bearingX; extents->y_bearing = bearingY; extents->width = width; - extents->height = -height; + extents->height = - (hb_position_t) height; } HBUINT8 height; From 6e1c3eaf7005d06c89f0807f693aadd835aa0468 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 28 Jan 2019 14:12:41 -0500 Subject: [PATCH 3/4] Fix sign comparison error --- src/hb-open-file.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hb-open-file.hh b/src/hb-open-file.hh index de22ed55d..32a223cdf 100644 --- a/src/hb-open-file.hh +++ b/src/hb-open-file.hh @@ -154,7 +154,8 @@ typedef struct OffsetTable c->align (4); const char *end = (const char *) c->head; - if (items[i].tag == HB_OT_TAG_head && end - start >= head::static_size) + if (items[i].tag == HB_OT_TAG_head && + (unsigned) (end - start) >= head::static_size) { head *h = (head *) start; checksum_adjustment = &h->checkSumAdjustment; From 9a1df82e3f13fbd4488ee9955814bbb5d0957074 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 28 Jan 2019 14:15:18 -0500 Subject: [PATCH 4/4] [uniscribe] Whitelist function type cast --- src/hb-uniscribe.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc index 8e9fda269..31c50dfeb 100644 --- a/src/hb-uniscribe.cc +++ b/src/hb-uniscribe.cc @@ -215,9 +215,12 @@ struct hb_uniscribe_shaper_funcs_t hinstLib = GetModuleHandle (TEXT ("usp10.dll")); if (hinstLib) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-function-type" this->ScriptItemizeOpenType = (SIOT) GetProcAddress (hinstLib, "ScriptItemizeOpenType"); this->ScriptShapeOpenType = (SSOT) GetProcAddress (hinstLib, "ScriptShapeOpenType"); this->ScriptPlaceOpenType = (SPOT) GetProcAddress (hinstLib, "ScriptPlaceOpenType"); +#pragma GCC diagnostic pop } if (!this->ScriptItemizeOpenType || !this->ScriptShapeOpenType ||