summaryrefslogtreecommitdiffstats
path: root/source/l/strigi/libstreams-0004-Fix-Krazy-issues.patch
blob: 57036e627cc650c1687b998f7acf7fa2fa3d77ea (plain) (blame)
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
From 8aa2b21fe596ddfe9de250190ede78ee34f19d2d Mon Sep 17 00:00:00 2001
From: Jos van den Oever <jos@vandenoever.info>
Date: Fri, 12 Jul 2013 13:04:44 +0200
Subject: [PATCH 4/5] Fix Krazy issues.

---
 .krazy                                     |  3 +++
 cmake/FindIconv.cmake                      | 19 +++++++++++++++++++
 include/strigi/archivereader.h             |  6 +++---
 include/strigi/bz2inputstream.h            |  2 +-
 include/strigi/dataeventinputstream.h      |  2 +-
 include/strigi/kmpsearcher.h               |  2 +-
 include/strigi/lzmainputstream.h           |  2 +-
 include/strigi/stringterminatedsubstream.h |  2 +-
 include/strigi/substreamprovider.h         |  2 +-
 lib/libstreams.pc.cmake                    | 19 +++++++++++++++++++
 lib/signatureinputstream.h                 |  2 +-
 lib/strigiconfig.cpp                       |  2 +-
 lib/stringreader.h                         |  2 --
 tests/api/ArchiveReaderTest.cpp            |  4 ++--
 tests/sharedtestcode/unknownsizestream.h   |  4 ++--
 15 files changed, 56 insertions(+), 17 deletions(-)
 create mode 100644 .krazy

diff --git a/.krazy b/.krazy
new file mode 100644
index 0000000..4822bdd
--- /dev/null
+++ b/.krazy
@@ -0,0 +1,3 @@
+# see http://techbase.kde.org/Development/Tutorials/Code_Checking#Controlling_Krazy_on_the_EBN for an explanation of this file
+EXCLUDE syscalls,typedefs
+IGNORESUBS tests/data
diff --git a/cmake/FindIconv.cmake b/cmake/FindIconv.cmake
index ce40ab2..fd5a3af 100644
--- a/cmake/FindIconv.cmake
+++ b/cmake/FindIconv.cmake
@@ -1,3 +1,22 @@
+# This file is part of Strigi Desktop Search
+#
+# Copyright (C) 2006 Jos van den Oever <jos@vandenoever.info>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
 # - Try to find Iconv 
 # Once done this will define 
 # 
diff --git a/include/strigi/archivereader.h b/include/strigi/archivereader.h
index 823a432..ffe3f22 100644
--- a/include/strigi/archivereader.h
+++ b/include/strigi/archivereader.h
@@ -38,7 +38,7 @@ public:
      * @brief Opens a stream for the given url.
      *
      * What is meant by @p url will depend on context.  In the context of an
-     * archive with a file system-like directory stucture, it will be the path
+     * archive with a file system-like directory structure, it will be the path
      * to the file relative the root of the archive (eg: /foo/bar).
      *
      * @param url unique name of or path to an item
@@ -49,7 +49,7 @@ public:
      * @brief Gets information about a given url
      *
      * What is meant by @p url will depend on context.  In the context of an
-     * archive with a file system-like directory stucture, it will be the path
+     * archive with a file system-like directory structure, it will be the path
      * to the file relative the root of the archive (eg: /foo/bar).
      *
      * @param url unique name of or path to an item
@@ -89,7 +89,7 @@ public:
          * @param e a vector containing information about each
          * item in the directory
          */
-        DirLister(Private* p);
+        explicit DirLister(Private* p);
         /**
          * @brief Copy constructor
          */
diff --git a/include/strigi/bz2inputstream.h b/include/strigi/bz2inputstream.h
index aa40e88..09e566a 100644
--- a/include/strigi/bz2inputstream.h
+++ b/include/strigi/bz2inputstream.h
@@ -30,7 +30,7 @@ private:
     Private* const p;
     int32_t fillBuffer(char* start, int32_t space);
 public:
-    BZ2InputStream(InputStream* input);
+    explicit BZ2InputStream(InputStream* input);
     ~BZ2InputStream();
     static bool checkHeader(const char* data, int32_t datasize);
 };
diff --git a/include/strigi/dataeventinputstream.h b/include/strigi/dataeventinputstream.h
index 05368e2..c8205c4 100644
--- a/include/strigi/dataeventinputstream.h
+++ b/include/strigi/dataeventinputstream.h
@@ -48,7 +48,7 @@ public:
      * When handleEnd is called, it is guaranteed that each
      * element in the input stream has been passed in exactly
      * one call to this function, and that the calls happened
-     * in the same order as the the data occurred in the
+     * in the same order as the data occurred in the
      * InputStream.
      *
      * You should not call this function yourself.  It forms
diff --git a/include/strigi/kmpsearcher.h b/include/strigi/kmpsearcher.h
index e3ec19d..28d049b 100644
--- a/include/strigi/kmpsearcher.h
+++ b/include/strigi/kmpsearcher.h
@@ -39,7 +39,7 @@ private:
     int32_t maxlen;
 public:
     KmpSearcher() :table(0) { }
-    KmpSearcher(const std::string& query);
+    explicit KmpSearcher(const std::string& query);
     ~KmpSearcher() {
         if (table) {
             free(table);
diff --git a/include/strigi/lzmainputstream.h b/include/strigi/lzmainputstream.h
index fa7cf87..530edc3 100644
--- a/include/strigi/lzmainputstream.h
+++ b/include/strigi/lzmainputstream.h
@@ -30,7 +30,7 @@ private:
     Private* const p;
     int32_t fillBuffer(char* start, int32_t space);
 public:
-    LZMAInputStream(InputStream* input);
+    explicit LZMAInputStream(InputStream* input);
     ~LZMAInputStream();
     static bool checkHeader(const char* data, int32_t datasize);
 };
diff --git a/include/strigi/stringterminatedsubstream.h b/include/strigi/stringterminatedsubstream.h
index 9f96bcc..fabb40d 100644
--- a/include/strigi/stringterminatedsubstream.h
+++ b/include/strigi/stringterminatedsubstream.h
@@ -30,7 +30,7 @@ namespace Strigi {
  *
  * This class stops reading data when either the end of the
  * underlying stream is reacher, or a given terminator is encountered
- * in the the stream.
+ * in the stream.
  */
 class STREAMS_EXPORT StringTerminatedSubStream : public InputStream {
 private:
diff --git a/include/strigi/substreamprovider.h b/include/strigi/substreamprovider.h
index 21ce324..3036d32 100644
--- a/include/strigi/substreamprovider.h
+++ b/include/strigi/substreamprovider.h
@@ -88,7 +88,7 @@ public:
      *
      * @param input the inputstream that will be split into substreams
      */
-    SubStreamProvider(InputStream *input)
+    explicit SubStreamProvider(InputStream *input)
         : m_status(Ok)
         , m_input(input)
         , m_entrystream(0)
diff --git a/lib/libstreams.pc.cmake b/lib/libstreams.pc.cmake
index 8259b46..ce1205d 100644
--- a/lib/libstreams.pc.cmake
+++ b/lib/libstreams.pc.cmake
@@ -1,3 +1,22 @@
+# This file is part of Strigi Desktop Search
+#
+# Copyright (C) 2007 Jos van den Oever <jos@vandenoever.info>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
 prefix=${CMAKE_INSTALL_PREFIX}
 exec_prefix=${CMAKE_INSTALL_PREFIX}/bin
 libdir=${LIB_DESTINATION}
diff --git a/lib/signatureinputstream.h b/lib/signatureinputstream.h
index 7302c75..63a2f0d 100644
--- a/lib/signatureinputstream.h
+++ b/lib/signatureinputstream.h
@@ -30,7 +30,7 @@ namespace Strigi {
  *
  * This class stops reading data when either the end of the
  * underlying stream is reacher, or a given terminator is encountered
- * in the the stream.
+ * in the stream.
  */
 class SignatureInputStream : public InputStream {
 private:
diff --git a/lib/strigiconfig.cpp b/lib/strigiconfig.cpp
index 6607ebd..9d9d8f9 100644
--- a/lib/strigiconfig.cpp
+++ b/lib/strigiconfig.cpp
@@ -32,4 +32,4 @@ namespace Strigi {
     const char* versionString() {
         return STRIGI_VERSION_STRING;
     }
-}
\ No newline at end of file
+}
diff --git a/lib/stringreader.h b/lib/stringreader.h
index 4d60b67..1a57c5c 100644
--- a/lib/stringreader.h
+++ b/lib/stringreader.h
@@ -20,11 +20,9 @@
 #ifndef STRINGREADER_H
 #define STRINGREADER_H
 
-#ifdef __GNUC__
 #error stringreader.h is deprecated. Include stringstream.h instead.
 #error StringReader has been renamed to StringStream
 #error Use StringInputStream for StringStream<char>
 #error Use StringReader for StringStream<wchar_t>
-#endif
 
 #endif
diff --git a/tests/api/ArchiveReaderTest.cpp b/tests/api/ArchiveReaderTest.cpp
index ffb7cd7..6d38050 100644
--- a/tests/api/ArchiveReaderTest.cpp
+++ b/tests/api/ArchiveReaderTest.cpp
@@ -50,7 +50,7 @@ test2(const char* path) {
     EntryInfo e;
     while (dl.nextEntry(e)) {
         string filepath(path);
-        filepath += "/";
+        filepath += '/';
         filepath += e.filename;
         if (e.type == EntryInfo::File) {
             test1(filepath.c_str());
@@ -83,7 +83,7 @@ walkdirectories(const char* path, void (*callback)(const char*)) {
             if (S_ISREG(dirstat.st_mode)) {
                 callback(filepath.c_str());
             } else if (S_ISDIR(dirstat.st_mode)) {
-                filepath += "/";
+                filepath += '/';
                 walkdirectories(filepath.c_str(), callback);
             }
         }
diff --git a/tests/sharedtestcode/unknownsizestream.h b/tests/sharedtestcode/unknownsizestream.h
index bde063e..73d3d49 100644
--- a/tests/sharedtestcode/unknownsizestream.h
+++ b/tests/sharedtestcode/unknownsizestream.h
@@ -17,8 +17,8 @@
  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  */
-#ifndef STRIGI_UNKNOWNSIZEINPUTSTREAM
-#define STRIGI_UNKNOWNSIZEINPUTSTREAM
+#ifndef STRIGI_UNKNOWNSIZEINPUTSTREAM_H
+#define STRIGI_UNKNOWNSIZEINPUTSTREAM_H
 
 #include <strigi/strigiconfig.h>
 #include <strigi/streambase.h>
-- 
1.8.4.2