summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2010-11-08 16:26:13 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-11-08 17:29:51 (GMT)
commit551a8648b93055afa92c2938af5cede7495fd7f5 (patch)
treeb0e7bf1f77a68fa02940f902a8fe4e5759a06dc6 /tests/benchmarks
parent38f7873d8f3104ede6f7e70392f2e1ba2970b508 (diff)
downloadQt-551a8648b93055afa92c2938af5cede7495fd7f5.zip
Qt-551a8648b93055afa92c2938af5cede7495fd7f5.tar.gz
Qt-551a8648b93055afa92c2938af5cede7495fd7f5.tar.bz2
fix build on mingw
> data.cpp:2: error: 'ushort' does not name a type > data.cpp:1133: error: 'ushort' does not name a type and lot of > data.cpp:1276: error: too many initializers for 'StringCollection' when the issue with ushort is fixed (by including qglobal.h, for example) a bunch of some new build errors occurs: > data.cpp:4: error: 'stringCollectionData' was declared 'extern' and later 'static' > data.h:54: error: previous declaration of 'stringCollectionData' > data.cpp:1131: error: redefinition of 'struct StringCollection' > data.h:48: error: previous definition of 'struct StringCollection' > data.cpp:1136: error: invalid type in declaration before '=' token > data.cpp:1136: error: conflicting declaration 'int stringCollection []' > data.h:55: error: 'stringCollection' has a previous declaration as 'StringCollection stringCollection [] > data.cpp:1279: error: 'stringCollectionCount' was declared 'extern' and later 'static' > data.h:56: error: previous declaration of 'stringCollectionCount' Merge-request: 910 Reviewed-By: Thiago Macieira <thiago.macieira@nokia.com>
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/corelib/tools/qstring/data.cpp18
-rw-r--r--tests/benchmarks/corelib/tools/qstring/data.h7
-rw-r--r--tests/benchmarks/corelib/tools/qstring/generatelist.pl5
3 files changed, 15 insertions, 15 deletions
diff --git a/tests/benchmarks/corelib/tools/qstring/data.cpp b/tests/benchmarks/corelib/tools/qstring/data.cpp
index 6d1a069..a674336 100644
--- a/tests/benchmarks/corelib/tools/qstring/data.cpp
+++ b/tests/benchmarks/corelib/tools/qstring/data.cpp
@@ -1,5 +1,7 @@
+#include "data.h"
+
// This is a generated file - DO NOT EDIT
-static const ushort stringCollectionData[] __attribute__((aligned(16))) = {
+const ushort stringCollectionData[] __attribute__((aligned(16))) = {
// #0
65535,
99, 111, 109, 112, 105, 108, 101, 114, 32, 118, 101, 114, 115, 105, 111, 110, 115, 47,
@@ -1123,15 +1125,9 @@ static const ushort stringCollectionData[] __attribute__((aligned(16))) = {
65535,
84, 69, 65, 77, 66, 85, 73, 76, 68, 69, 82, 61,
65535,65534,65533, // 5216
-
-
};
-static struct StringCollection
-{
- int len;
- int offset1, offset2;
- ushort align1, align2;
-} stringCollection[] = {
+
+const struct StringCollection stringCollection[] = {
{18, 1, 29, 3666, 106}, // #0
{18, 53, 77, 106, 1978}, // #1
{20, 97, 125, 2850, 3210}, // #2
@@ -1274,8 +1270,8 @@ static struct StringCollection
{12, 5153, 5169, 130, 2930}, // #139
{12, 5185, 5201, 242, 2930}, // #140
};
-static const int stringCollectionCount = 141;
-static const int stringCollectionMaxLen = 51;
+const int stringCollectionCount = 141;
+const int stringCollectionMaxLen = 51;
// average comparison length: 12.0922
// cache-line crosses: 6 (2.1%)
// alignment histogram:
diff --git a/tests/benchmarks/corelib/tools/qstring/data.h b/tests/benchmarks/corelib/tools/qstring/data.h
index c7a7467..ce733fb 100644
--- a/tests/benchmarks/corelib/tools/qstring/data.h
+++ b/tests/benchmarks/corelib/tools/qstring/data.h
@@ -39,6 +39,9 @@
**
****************************************************************************/
+#ifndef DATA_H
+#define DATA_H
+
#include <qglobal.h>
struct StringCollection
@@ -49,5 +52,7 @@ struct StringCollection
};
extern const ushort stringCollectionData[];
-extern StringCollection stringCollection[];
+extern const StringCollection stringCollection[];
extern const int stringCollectionCount;
+
+#endif // DATA_H
diff --git a/tests/benchmarks/corelib/tools/qstring/generatelist.pl b/tests/benchmarks/corelib/tools/qstring/generatelist.pl
index d027adb..8c8eb20 100644
--- a/tests/benchmarks/corelib/tools/qstring/generatelist.pl
+++ b/tests/benchmarks/corelib/tools/qstring/generatelist.pl
@@ -160,11 +160,10 @@ while (1) {
$totalsize += $len;
$maxlen = $len if $len > $maxlen;
}
-print "\n};\n";
+print "};\n";
close IN;
-print "struct StringCollection stringCollection[] = {\n";
-
+print "const struct StringCollection stringCollection[] = {\n";
for $i (0..$count-1) {
print " {",
$data[$i]->{len}, ", ",