summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-06-29 12:26:16 +0200
committerAndras Timar <andras.timar@collabora.com>2016-02-22 08:58:14 +0100
commit8f45f60a0d8a8b5a1b1e6f520b685b62aec29a59 (patch)
treea6cbd8ef89d1aef883ce7c7fd753bc7ae3a8cea1 /external
parent0338f652fb81f9eb6e6f4b42365b60e8fe041389 (diff)
update graphite to 1.3.5
(cherry picked from commit c64ea526dc71da6e3aad188ac71e58047ed74b5a) and sync the various upgrade patches together Change-Id: I3287d51430d7a0901dd8bbf2458b845bcf92a8d2 Reviewed-on: https://gerrit.libreoffice.org/22210 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit d2ef084eb0e26b5ee18133269249e7a80efb23d6)
Diffstat (limited to 'external')
-rw-r--r--external/graphite/StaticLibrary_graphite.mk9
-rw-r--r--external/graphite/UnpackedTarball_graphite.mk4
-rw-r--r--external/graphite/graphite2.issue1115.patch.16
-rw-r--r--external/graphite/graphite2.win64.patch.134
-rw-r--r--external/graphite/ubsan.patch51
5 files changed, 86 insertions, 18 deletions
diff --git a/external/graphite/StaticLibrary_graphite.mk b/external/graphite/StaticLibrary_graphite.mk
index de3950f10b86..ddbf9955e6d7 100644
--- a/external/graphite/StaticLibrary_graphite.mk
+++ b/external/graphite/StaticLibrary_graphite.mk
@@ -19,8 +19,8 @@ $(eval $(call gb_StaticLibrary_set_include,graphite,\
))
$(eval $(call gb_StaticLibrary_add_defs,graphite,\
- -DDISABLE_TRACING \
- -DGR2_STATIC \
+ -DGRAPHITE2_NTRACING \
+ -DGRAPHITE2_STATIC \
))
ifeq ($(COM),GCC)
@@ -43,19 +43,22 @@ $(eval $(call gb_StaticLibrary_add_generated_cxxobjects,graphite,\
UnpackedTarball/graphite/src/gr_segment \
UnpackedTarball/graphite/src/gr_slot \
UnpackedTarball/graphite/src/json \
- UnpackedTarball/graphite/src/Bidi \
UnpackedTarball/graphite/src/CachedFace \
UnpackedTarball/graphite/src/CmapCache \
UnpackedTarball/graphite/src/Code \
+ UnpackedTarball/graphite/src/Collider \
+ UnpackedTarball/graphite/src/Decompressor \
UnpackedTarball/graphite/src/Face \
UnpackedTarball/graphite/src/FeatureMap \
UnpackedTarball/graphite/src/FileFace \
UnpackedTarball/graphite/src/Font \
UnpackedTarball/graphite/src/GlyphCache \
UnpackedTarball/graphite/src/GlyphFace \
+ UnpackedTarball/graphite/src/Intervals \
UnpackedTarball/graphite/src/Justifier \
UnpackedTarball/graphite/src/NameTable \
UnpackedTarball/graphite/src/Pass \
+ UnpackedTarball/graphite/src/Position \
UnpackedTarball/graphite/src/SegCache \
UnpackedTarball/graphite/src/SegCacheEntry \
UnpackedTarball/graphite/src/SegCacheStore \
diff --git a/external/graphite/UnpackedTarball_graphite.mk b/external/graphite/UnpackedTarball_graphite.mk
index c7fa86e0e149..a162d172b795 100644
--- a/external/graphite/UnpackedTarball_graphite.mk
+++ b/external/graphite/UnpackedTarball_graphite.mk
@@ -11,10 +11,12 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,graphite))
$(eval $(call gb_UnpackedTarball_set_tarball,graphite,$(GRAPHITE_TARBALL)))
-# http://projects.palaso.org/issues/1115
+$(eval $(call gb_UnpackedTarball_set_patchlevel,graphite,0))
+
$(eval $(call gb_UnpackedTarball_add_patches,graphite,\
external/graphite/graphite2.issue1115.patch.1 \
external/graphite/graphite2.win64.patch.1 \
+ external/graphite/ubsan.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/graphite/graphite2.issue1115.patch.1 b/external/graphite/graphite2.issue1115.patch.1
index f19c8a3749f4..454114bb32c9 100644
--- a/external/graphite/graphite2.issue1115.patch.1
+++ b/external/graphite/graphite2.issue1115.patch.1
@@ -1,6 +1,6 @@
--- graphite/src/Code.cpp
+++ graphite/src/Code.cpp
-@@ -169,8 +169,8 @@ Machine::Code::Code(bool is_constraint,
+@@ -175,8 +175,8 @@ Machine::Code::Code(bool is_constraint,
bytecode_end,
pre_context,
rule_length,
@@ -11,7 +11,7 @@
face.numFeatures(),
{1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,255,
-@@ -178,7 +178,7 @@ Machine::Code::Code(bool is_constraint,
+@@ -184,7 +184,7 @@ Machine::Code::Code(bool is_constraint,
1,1,1,1,1,1,0,0,
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
@@ -19,4 +19,4 @@
+ 0,0,0,0,0,0,0, static_cast<byte>(silf.numUser())}
};
- decoder dec(lims, *this);
+ decoder dec(lims, *this, pt);
diff --git a/external/graphite/graphite2.win64.patch.1 b/external/graphite/graphite2.win64.patch.1
index 6bf8c88907d1..e7c36c63c21b 100644
--- a/external/graphite/graphite2.win64.patch.1
+++ b/external/graphite/graphite2.win64.patch.1
@@ -1,7 +1,20 @@
+diff -ur graphite.org/src/inc/Main.h graphite/src/inc/Main.h
+--- graphite.org/src/inc/Main.h 2015-09-07 20:09:25.572279671 +0700
+--- graphite/src/inc/Main.h 2015-09-07 20:09:25.572279671 +0700
+@@ -25,6 +25,9 @@
+ of the License or (at your option) any later version.
+ */
+ #pragma once
++#ifdef _WIN32
++#pragma warning(disable: 4510 4610)
++#endif
+
+ #include <cstdlib>
+ #include "graphite2/Types.h"
diff -ur graphite.org/src/inc/json.h graphite/src/inc/json.h
--- graphite.org/src/inc/json.h 2015-02-03 14:49:24.408101900 +0100
+++ graphite/src/inc/json.h 2015-02-03 14:50:59.697552200 +0100
-@@ -78,6 +78,9 @@
+@@ -85,6 +85,9 @@
json & operator << (string) throw();
json & operator << (number) throw();
json & operator << (integer) throw();
@@ -14,8 +27,7 @@ diff -ur graphite.org/src/inc/json.h graphite/src/inc/json.h
diff -ur graphite.org/src/json.cpp graphite/src/json.cpp
--- graphite.org/src/json.cpp 2015-02-03 14:49:24.409102000 +0100
+++ graphite/src/json.cpp 2015-02-03 14:50:49.814986900 +0100
-@@ -119,6 +119,9 @@
- json & json::operator << (json::number f) throw() { context(seq); fprintf(_stream, "%g", f); return *this; }
+@@ -134,5 +134,8 @@
json & json::operator << (json::integer d) throw() { context(seq); fprintf(_stream, "%ld", d); return *this; }
json & json::operator << (long unsigned d) throw() { context(seq); fprintf(_stream, "%ld", d); return *this; }
+#ifdef _WIN64
@@ -27,17 +39,17 @@ diff -ur graphite.org/src/json.cpp graphite/src/json.cpp
diff -ur graphite.org/src/Pass.cpp graphite/src/Pass.cpp
--- graphite.org/src/Pass.cpp 2015-02-03 14:49:24.413102200 +0100
+++ graphite/src/Pass.cpp 2015-02-03 14:50:37.873303900 +0100
-@@ -466,7 +466,7 @@
- {
- if (r->rule->preContext > fsm.slots.context()) continue;
- *fsm.dbgout << json::flat << json::object
-- << "id" << r->rule - m_rules
-+ << "id" << static_cast<size_t>(r->rule - m_rules)
+@@ -544,7 +544,7 @@
+ if (r->rule->preContext > fsm.slots.context())
+ continue;
+ *fsm.dbgout << json::flat << json::object
+- << "id" << r->rule - m_rules
++ << "id" << static_cast<size_t>(r->rule - m_rules)
<< "failed" << true
<< "input" << json::flat << json::object
<< "start" << objectid(dslot(&fsm.slots.segment, input_slot(fsm.slots, -r->rule->preContext)))
-@@ -480,7 +480,7 @@
- void Pass::dumpRuleEventOutput(const FiniteStateMachine & fsm, const Rule & r, Slot * const last_slot) const
+@@ -558,7 +558,7 @@
+ void Pass::dumpRuleEventOutput(const FiniteStateMachine & fsm, Machine & m, const Rule & r, Slot * const last_slot) const
{
*fsm.dbgout << json::item << json::flat << json::object
- << "id" << &r - m_rules
diff --git a/external/graphite/ubsan.patch b/external/graphite/ubsan.patch
new file mode 100644
index 000000000000..b1617b138630
--- /dev/null
+++ b/external/graphite/ubsan.patch
@@ -0,0 +1,51 @@
+--- src/Pass.cpp
++++ src/Pass.cpp
+@@ -294,7 +294,7 @@
+ s->rules = begin;
+ s->rules_end = (end - begin <= FiniteStateMachine::MAX_RULES)? end :
+ begin + FiniteStateMachine::MAX_RULES;
+- qsort(begin, end - begin, sizeof(RuleEntry), &cmpRuleEntry);
++ if (end != begin) qsort(begin, end - begin, sizeof(RuleEntry), &cmpRuleEntry);
+ }
+
+ return true;
+--- src/gr_face.cpp
++++ src/gr_face.cpp
+@@ -87,7 +87,7 @@
+
+ Face *res = new Face(appFaceHandle, *ops);
+ if (res && load_face(*res, faceOptions))
+- return static_cast<gr_face *>(res);
++ return reinterpret_cast<gr_face *>(res);
+
+ delete res;
+ return 0;
+@@ -195,7 +195,7 @@
+
+ void gr_face_destroy(gr_face *face)
+ {
+- delete face;
++ delete static_cast<Face *>(face);
+ }
+
+
+--- src/gr_font.cpp
++++ src/gr_font.cpp
+@@ -50,7 +50,7 @@
+ if (face == 0) return 0;
+
+ Font * const res = new Font(ppm, *face, appFontHandle, font_ops);
+- return static_cast<gr_font*>(res);
++ return reinterpret_cast<gr_font*>(res);
+ }
+
+ gr_font* gr_make_font_with_advance_fn(float ppm/*pixels per em*/, const void* appFontHandle/*non-NULL*/, gr_advance_fn getAdvance, const gr_face * face/*needed for scaling*/)
+@@ -61,7 +61,7 @@
+
+ void gr_font_destroy(gr_font *font)
+ {
+- delete font;
++ delete static_cast<Font *>(font);
+ }
+
+