summaryrefslogtreecommitdiff
path: root/libcdr/libcdr-0.0.7-clang.patch
blob: fd5e163cd54921bff539a2b2c70b55f9114d779c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
--- misc/libcdr-0.0.7/src/lib/CDRCollector.cpp	2012-04-24 13:25:22.000000000 +0200
+++ misc/build/libcdr-0.0.7/src/lib/CDRCollector.cpp	2012-04-24 16:54:16.083829620 +0200
@@ -30,6 +30,7 @@
 #include <math.h>
 #include <string.h>
 #include "CDRCollector.h"
+#include "libcdr_utils.h"
 
 libcdr::CDRParserState::CDRParserState()
   : m_fillStyles(), m_lineStyles(), m_bmps(), m_patterns(), m_vects(), m_pages(),
--- misc/libcdr-0.0.7/src/lib/CDRCollector.h	2012-04-24 13:12:28.000000000 +0200
+++ misc/build/libcdr-0.0.7/src/lib/CDRCollector.h	2012-04-24 16:54:16.084829635 +0200
@@ -42,32 +42,7 @@
 
 namespace
 {
-int cdr_round(double d)
-{
-  return (d>0) ? int(d+0.5) : int(d-0.5);
-}
-
-void writeU16(WPXBinaryData &buffer, const int value)
-{
-  buffer.append((unsigned char)(value & 0xFF));
-  buffer.append((unsigned char)((value >> 8) & 0xFF));
-}
-
-void writeU32(WPXBinaryData &buffer, const int value)
-{
-  buffer.append((unsigned char)(value & 0xFF));
-  buffer.append((unsigned char)((value >> 8) & 0xFF));
-  buffer.append((unsigned char)((value >> 16) & 0xFF));
-  buffer.append((unsigned char)((value >> 24) & 0xFF));
-}
-
-void writeU8(WPXBinaryData &buffer, const int value)
-{
-  buffer.append((unsigned char)(value & 0xFF));
-}
-
 #include "CDRColorProfiles.h"
-
 }
 
 namespace libcdr
--- misc/libcdr-0.0.7/src/lib/CDRParser.cpp	2012-04-24 15:40:42.000000000 +0200
+++ misc/build/libcdr-0.0.7/src/lib/CDRParser.cpp	2012-04-24 16:54:16.084829635 +0200
@@ -466,7 +466,7 @@
         m_collector->collectObject(level);
       else if (listType == FOURCC_grp)
         m_collector->collectGroup(level);
-      else if ((listType & 0xffffff) == FOURCC_CDR || (listType && 0xffffff) == FOURCC_cdr)
+      else if ((listType & 0xffffff) == FOURCC_CDR || (listType & 0xffffff) == FOURCC_cdr)
         m_version = getCDRVersion((listType & 0xff000000) >> 24);
       else if (listType == FOURCC_vect)
         m_collector->collectVect(level);
--- misc/libcdr-0.0.7/src/lib/libcdr_utils.cpp	2012-04-24 13:11:13.000000000 +0200
+++ misc/build/libcdr-0.0.7/src/lib/libcdr_utils.cpp	2012-04-24 16:54:16.085829649 +0200
@@ -139,6 +139,30 @@
   return ((double)fixedPointNumberIntegerPart + fixedPointNumberFractionalPart);
 }
 
+int libcdr::cdr_round(double d)
+{
+  return (d>0) ? int(d+0.5) : int(d-0.5);
+}
+
+void libcdr::writeU16(WPXBinaryData &buffer, const int value)
+{
+  buffer.append((unsigned char)(value & 0xFF));
+  buffer.append((unsigned char)((value >> 8) & 0xFF));
+}
+
+void libcdr::writeU32(WPXBinaryData &buffer, const int value)
+{
+  buffer.append((unsigned char)(value & 0xFF));
+  buffer.append((unsigned char)((value >> 8) & 0xFF));
+  buffer.append((unsigned char)((value >> 16) & 0xFF));
+  buffer.append((unsigned char)((value >> 24) & 0xFF));
+}
+
+void libcdr::writeU8(WPXBinaryData &buffer, const int value)
+{
+  buffer.append((unsigned char)(value & 0xFF));
+}
+
 #ifdef DEBUG
 const char *libcdr::toFourCC(unsigned value, bool bigEndian)
 {
--- misc/libcdr-0.0.7/src/lib/libcdr_utils.h	2012-04-24 16:54:56.803806935 +0200
+++ misc/build/libcdr-0.0.7/src/lib/libcdr_utils.h	2012-04-24 16:54:16.085829649 +0200
@@ -35,6 +35,7 @@
 #include <string>
 #include <math.h>
 #include <libwpd-stream/libwpd-stream.h>
+#include <libwpd/libwpd.h>
 
 #ifndef M_PI
 #define M_PI 3.14159265358979323846
@@ -90,6 +91,12 @@
 
 double readFixedPoint(WPXInputStream *input, bool bigEndian=false);
 
+int cdr_round(double d);
+
+void writeU8(WPXBinaryData &buffer, const int value);
+void writeU16(WPXBinaryData &buffer, const int value);
+void writeU32(WPXBinaryData &buffer, const int value);
+
 #ifdef DEBUG
 const char *toFourCC(unsigned value, bool bigEndian=false);
 #endif