]>
Commit | Line | Data |
---|---|---|
27ce4d0c | 1 | diff -urN djvulibre-3.5.16.orig/libdjvu/ByteStream.h djvulibre-3.5.16/libdjvu/ByteStream.h |
2 | --- djvulibre-3.5.16.orig/libdjvu/ByteStream.h 2003-11-07 23:08:20.000000000 +0100 | |
3 | +++ djvulibre-3.5.16/libdjvu/ByteStream.h 2005-12-11 12:39:57.000000000 +0100 | |
4 | @@ -242,7 +242,7 @@ | |
d9d3a5ee | 5 | and writes it to the specified stream. */ |
6 | void formatmessage( const char *fmt, ... ); | |
7 | /** Looks up the message and writes it to the specified stream. */ | |
8 | - void ByteStream::writemessage( const char *message ); | |
9 | + void writemessage( const char *message ); | |
10 | /** Writes a one-byte integer to a ByteStream. */ | |
11 | void write8 (unsigned int card8); | |
12 | /** Writes a two-bytes integer to a ByteStream. | |
27ce4d0c | 13 | diff -urN djvulibre-3.5.16.orig/libdjvu/GContainer.h djvulibre-3.5.16/libdjvu/GContainer.h |
14 | --- djvulibre-3.5.16.orig/libdjvu/GContainer.h 2004-05-13 17:16:34.000000000 +0200 | |
15 | +++ djvulibre-3.5.16/libdjvu/GContainer.h 2005-12-11 12:39:53.000000000 +0100 | |
d9d3a5ee | 16 | @@ -969,6 +969,92 @@ |
17 | ||
18 | ||
19 | // ------------------------------------------------------------ | |
20 | +// HASH FUNCTIONS | |
21 | +// ------------------------------------------------------------ | |
22 | + | |
23 | + | |
24 | +/** @name Hash functions | |
25 | + These functions let you use template class \Ref{GMap} with the | |
26 | + corresponding elementary types. The returned hash code may be reduced to | |
27 | + an arbitrary range by computing its remainder modulo the upper bound of | |
28 | + the range. | |
29 | + @memo Hash functions for elementary types. */ | |
30 | +//@{ | |
31 | + | |
32 | +/** Hashing function (unsigned int). */ | |
33 | +static inline unsigned int | |
34 | +hash(const unsigned int & x) | |
35 | +{ | |
36 | + return x; | |
37 | +} | |
38 | + | |
39 | +/** Hashing function (int). */ | |
40 | +static inline unsigned int | |
41 | +hash(const int & x) | |
42 | +{ | |
43 | + return (unsigned int)x; | |
44 | +} | |
45 | + | |
46 | +/** Hashing function (long). */ | |
47 | +static inline unsigned int | |
48 | +hash(const long & x) | |
49 | +{ | |
50 | + return (unsigned int)x; | |
51 | +} | |
52 | + | |
53 | +/** Hashing function (unsigned long). */ | |
54 | +static inline unsigned int | |
55 | +hash(const unsigned long & x) | |
56 | +{ | |
57 | + return (unsigned int)x; | |
58 | +} | |
59 | + | |
60 | +/** Hashing function (void *). */ | |
61 | +static inline unsigned int | |
62 | +hash(void * const & x) | |
63 | +{ | |
64 | + return (unsigned long) x; | |
65 | +} | |
66 | + | |
67 | +/** Hashing function (const void *). */ | |
68 | +static inline unsigned int | |
69 | +hash(const void * const & x) | |
70 | +{ | |
71 | + return (unsigned long) x; | |
72 | +} | |
73 | + | |
74 | +/** Hashing function (float). */ | |
75 | +static inline unsigned int | |
76 | +hash(const float & x) | |
77 | +{ | |
78 | + // optimizer will get rid of unnecessary code | |
79 | + unsigned int *addr = (unsigned int*)&x; | |
80 | + if (sizeof(float)<2*sizeof(unsigned int)) | |
81 | + return addr[0]; | |
82 | + else | |
83 | + return addr[0]^addr[1]; | |
84 | +} | |
85 | + | |
86 | +/** Hashing function (double). */ | |
87 | +static inline unsigned int | |
88 | +hash(const double & x) | |
89 | +{ | |
90 | + // optimizer will get rid of unnecessary code | |
91 | + unsigned int *addr = (unsigned int*)&x; | |
92 | + if (sizeof(double)<2*sizeof(unsigned int)) | |
93 | + return addr[0]; | |
94 | + else if (sizeof(double)<4*sizeof(unsigned int)) | |
95 | + return addr[0]^addr[1]; | |
96 | + else | |
97 | + return addr[0]^addr[1]^addr[2]^addr[3]; | |
98 | +} | |
99 | + | |
100 | + | |
101 | +//@} | |
102 | + | |
103 | + | |
104 | + | |
105 | +// ------------------------------------------------------------ | |
106 | // ASSOCIATIVE MAPS | |
107 | // ------------------------------------------------------------ | |
108 | ||
109 | @@ -1266,89 +1352,6 @@ | |
110 | }; | |
111 | ||
112 | ||
113 | -// ------------------------------------------------------------ | |
114 | -// HASH FUNCTIONS | |
115 | -// ------------------------------------------------------------ | |
116 | - | |
117 | - | |
118 | -/** @name Hash functions | |
119 | - These functions let you use template class \Ref{GMap} with the | |
120 | - corresponding elementary types. The returned hash code may be reduced to | |
121 | - an arbitrary range by computing its remainder modulo the upper bound of | |
122 | - the range. | |
123 | - @memo Hash functions for elementary types. */ | |
124 | -//@{ | |
125 | - | |
126 | -/** Hashing function (unsigned int). */ | |
127 | -static inline unsigned int | |
128 | -hash(const unsigned int & x) | |
129 | -{ | |
130 | - return x; | |
131 | -} | |
132 | - | |
133 | -/** Hashing function (int). */ | |
134 | -static inline unsigned int | |
135 | -hash(const int & x) | |
136 | -{ | |
137 | - return (unsigned int)x; | |
138 | -} | |
139 | - | |
140 | -/** Hashing function (long). */ | |
141 | -static inline unsigned int | |
142 | -hash(const long & x) | |
143 | -{ | |
144 | - return (unsigned int)x; | |
145 | -} | |
146 | - | |
147 | -/** Hashing function (unsigned long). */ | |
148 | -static inline unsigned int | |
149 | -hash(const unsigned long & x) | |
150 | -{ | |
151 | - return (unsigned int)x; | |
152 | -} | |
153 | - | |
154 | -/** Hashing function (void *). */ | |
155 | -static inline unsigned int | |
156 | -hash(void * const & x) | |
157 | -{ | |
158 | - return (unsigned long) x; | |
159 | -} | |
160 | - | |
161 | -/** Hashing function (const void *). */ | |
162 | -static inline unsigned int | |
163 | -hash(const void * const & x) | |
164 | -{ | |
165 | - return (unsigned long) x; | |
166 | -} | |
167 | - | |
168 | -/** Hashing function (float). */ | |
169 | -static inline unsigned int | |
170 | -hash(const float & x) | |
171 | -{ | |
172 | - // optimizer will get rid of unnecessary code | |
173 | - unsigned int *addr = (unsigned int*)&x; | |
174 | - if (sizeof(float)<2*sizeof(unsigned int)) | |
175 | - return addr[0]; | |
176 | - else | |
177 | - return addr[0]^addr[1]; | |
178 | -} | |
179 | - | |
180 | -/** Hashing function (double). */ | |
181 | -static inline unsigned int | |
182 | -hash(const double & x) | |
183 | -{ | |
184 | - // optimizer will get rid of unnecessary code | |
185 | - unsigned int *addr = (unsigned int*)&x; | |
186 | - if (sizeof(double)<2*sizeof(unsigned int)) | |
187 | - return addr[0]; | |
188 | - else if (sizeof(double)<4*sizeof(unsigned int)) | |
189 | - return addr[0]^addr[1]; | |
190 | - else | |
191 | - return addr[0]^addr[1]^addr[2]^addr[3]; | |
192 | -} | |
193 | - | |
194 | - | |
195 | -//@} | |
196 | //@} | |
197 | //@} | |
198 | ||
27ce4d0c | 199 | diff -urN djvulibre-3.5.16.orig/libdjvu/GURL.h djvulibre-3.5.16/libdjvu/GURL.h |
200 | --- djvulibre-3.5.16.orig/libdjvu/GURL.h 2003-11-07 23:08:21.000000000 +0100 | |
201 | +++ djvulibre-3.5.16/libdjvu/GURL.h 2005-12-11 12:39:56.000000000 +0100 | |
202 | @@ -278,10 +278,10 @@ | |
203 | //@} | |
204 | ||
205 | /// Returns TRUE if #gurl1# and #gurl2# are the same | |
206 | - bool GURL::operator==(const GURL & gurl2) const; | |
207 | + bool operator==(const GURL & gurl2) const; | |
208 | ||
209 | /// Returns TRUE if #gurl1# and #gurl2# are different | |
210 | - bool GURL::operator!=(const GURL & gurl2) const; | |
211 | + bool operator!=(const GURL & gurl2) const; | |
212 | ||
213 | /// Assignment operator | |
214 | GURL & operator=(const GURL & url); |