Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / external / graphite / graphite2.win64.patch.1
blob4e1172ad8222aeb89623000cc559e06041922516
1 diff -urN graphite2-1.3.4.orig/src/inc/json.h graphite2-1.3.4/src/inc/json.h
2 --- graphite2-1.3.4.orig/src/inc/json.h 2015-12-22 14:25:46.403566441 +0100
3 +++ graphite2-1.3.4/src/inc/json.h      2015-12-22 14:26:13.439722846 +0100
4 @@ -85,6 +85,9 @@
5      json & operator << (string) throw();
6      json & operator << (number) throw();
7      json & operator << (integer) throw();
8 +#ifdef _WIN64
9 +    json & operator << (size_t) throw();
10 +#endif
11      json & operator << (long unsigned int d) throw();
12      json & operator << (boolean) throw();
13      json & operator << (_null_t) throw();
14 diff -urN graphite2-1.3.4.orig/src/inc/Main.h graphite2-1.3.4/src/inc/Main.h
15 --- graphite2-1.3.4.orig/src/inc/Main.h 2015-12-22 14:25:46.399566417 +0100
16 +++ graphite2-1.3.4/src/inc/Main.h      2015-12-22 14:26:13.439722846 +0100
17 @@ -25,6 +25,9 @@
18  of the License or (at your option) any later version.
19  */
20  #pragma once
21 +#ifdef _WIN32
22 +#pragma warning(disable: 4510 4610)
23 +#endif
25  #include <cstdlib>
26  #include "graphite2/Types.h"
27 diff -urN graphite2-1.3.4.orig/src/json.cpp graphite2-1.3.4/src/json.cpp
28 --- graphite2-1.3.4.orig/src/json.cpp   2015-12-22 14:25:46.399566417 +0100
29 +++ graphite2-1.3.4/src/json.cpp        2015-12-22 14:26:13.439722846 +0100
30 @@ -133,6 +133,9 @@
31  }
32  json & json::operator << (json::integer d) throw()  { context(seq); fprintf(_stream, "%ld", d); return *this; }
33  json & json::operator << (long unsigned d) throw()  { context(seq); fprintf(_stream, "%ld", d); return *this; }
34 +#ifdef _WIN64
35 +json & json::operator << (size_t d) throw()         { context(seq); fprintf(_stream, "%ld", d); return *this; }
36 +#endif
37  json & json::operator << (json::boolean b) throw()  { context(seq); fputs(b ? "true" : "false", _stream); return *this; }
38  json & json::operator << (json::_null_t) throw()    { context(seq); fputs("null",_stream); return *this; }
40 diff -urN graphite2-1.3.4.orig/src/Pass.cpp graphite2-1.3.4/src/Pass.cpp
41 --- graphite2-1.3.4.orig/src/Pass.cpp   2015-12-22 14:25:46.399566417 +0100
42 +++ graphite2-1.3.4/src/Pass.cpp        2015-12-22 14:26:13.439722846 +0100
43 @@ -554,7 +554,7 @@
44          if (r->rule->preContext > fsm.slots.context())
45              continue;
46          *fsm.dbgout << json::flat << json::object
47 -                    << "id" << r->rule - m_rules
48 +                    << "id" << static_cast<size_t>(r->rule - m_rules)
49                      << "failed" << true
50                      << "input" << json::flat << json::object
51                          << "start" << objectid(dslot(&fsm.slots.segment, input_slot(fsm.slots, -r->rule->preContext)))
52 @@ -568,7 +568,7 @@
53  void Pass::dumpRuleEventOutput(const FiniteStateMachine & fsm, Machine & m, const Rule & r, Slot * const last_slot) const
54  {
55      *fsm.dbgout     << json::item << json::flat << json::object
56 -                        << "id"     << &r - m_rules
57 +                        << "id"     << static_cast<size_t>(&r - m_rules)
58                          << "failed" << false
59                          << "input" << json::flat << json::object
60                              << "start" << objectid(dslot(&fsm.slots.segment, input_slot(fsm.slots, 0)))