author | alwin <alwin> | 2004-03-02 19:15:03 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 19:15:03 (UTC) |
commit | 4e214ca53f618d2d848c6f281c545e1883bc52eb (patch) (unidiff) | |
tree | 0c276ac7e2578fc92ba10287d7a9cc90a2be3d64 | |
parent | d07327ddaab9214cde73081794dc13e33e1a1279 (diff) | |
download | opie-4e214ca53f618d2d848c6f281c545e1883bc52eb.zip opie-4e214ca53f618d2d848c6f281c545e1883bc52eb.tar.gz opie-4e214ca53f618d2d848c6f281c545e1883bc52eb.tar.bz2 |
hack so it compiles with gcc2 toolchain
-rw-r--r-- | noncore/settings/sysinfo/benchmarkinfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp index d6ecec5..2c68fd5 100644 --- a/noncore/settings/sysinfo/benchmarkinfo.cpp +++ b/noncore/settings/sysinfo/benchmarkinfo.cpp | |||
@@ -1,93 +1,97 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** BenchmarkInfo | 2 | ** BenchmarkInfo |
3 | ** | 3 | ** |
4 | ** A benchmark for Qt/Embedded | 4 | ** A benchmark for Qt/Embedded |
5 | ** | 5 | ** |
6 | ** Copyright (C) 2004 Michael Lauer <mickey@vanille.de> | 6 | ** Copyright (C) 2004 Michael Lauer <mickey@vanille.de> |
7 | ** Inspired by ZBench (C) 2002 Satoshi <af230533@im07.alpha-net.ne.jp> | 7 | ** Inspired by ZBench (C) 2002 Satoshi <af230533@im07.alpha-net.ne.jp> |
8 | ** | 8 | ** |
9 | ** This file may be distributed and/or modified under the terms of the | 9 | ** This file may be distributed and/or modified under the terms of the |
10 | ** GNU General Public License version 2 as published by the Free Software | 10 | ** GNU General Public License version 2 as published by the Free Software |
11 | ** Foundation and appearing in the file LICENSE.GPL included in the | 11 | ** Foundation and appearing in the file LICENSE.GPL included in the |
12 | ** packaging of this file. | 12 | ** packaging of this file. |
13 | ** | 13 | ** |
14 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 14 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
15 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 15 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
16 | ** | 16 | ** |
17 | **********************************************************************/ | 17 | **********************************************************************/ |
18 | 18 | ||
19 | /* OPIE */ | 19 | /* OPIE */ |
20 | #include <opie2/ostorageinfo.h> | 20 | #include <opie2/ostorageinfo.h> |
21 | #include <qpe/qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
22 | #include <qpe/qcopenvelope_qws.h> | 22 | #include <qpe/qcopenvelope_qws.h> |
23 | #include <qpe/qpedecoration_qws.h> | 23 | #include <qpe/qpedecoration_qws.h> |
24 | #include <qpe/resource.h> | 24 | #include <qpe/resource.h> |
25 | #include <qpe/config.h> | 25 | #include <qpe/config.h> |
26 | 26 | ||
27 | /* QT */ | 27 | /* QT */ |
28 | #include <qclipboard.h> | 28 | #include <qclipboard.h> |
29 | #include <qcolor.h> | 29 | #include <qcolor.h> |
30 | #include <qcombobox.h> | 30 | #include <qcombobox.h> |
31 | #include <qdirectpainter_qws.h> | 31 | #include <qdirectpainter_qws.h> |
32 | #include <qfile.h> | 32 | #include <qfile.h> |
33 | #include <qtextstream.h> | 33 | #include <qtextstream.h> |
34 | #include <qfiledialog.h> | 34 | #include <qfiledialog.h> |
35 | #include <qlabel.h> | 35 | #include <qlabel.h> |
36 | #include <qlayout.h> | 36 | #include <qlayout.h> |
37 | #include <qpainter.h> | 37 | #include <qpainter.h> |
38 | #include <qpushbutton.h> | 38 | #include <qpushbutton.h> |
39 | #include <qtimer.h> | 39 | #include <qtimer.h> |
40 | 40 | ||
41 | /* STD */ | 41 | /* STD */ |
42 | #include <time.h> | 42 | #include <time.h> |
43 | #include <stdio.h> | 43 | #include <stdio.h> |
44 | #include <stdlib.h> | 44 | #include <stdlib.h> |
45 | #include <math.h> | 45 | #include <math.h> |
46 | #if defined (__GNUC__) && (__GNUC__ < 3) | ||
47 | extern double round(double); | ||
48 | #endif | ||
49 | |||
46 | 50 | ||
47 | #include "benchmarkinfo.h" | 51 | #include "benchmarkinfo.h" |
48 | 52 | ||
49 | extern "C" | 53 | extern "C" |
50 | { | 54 | { |
51 | void BenchFFT( void ); | 55 | void BenchFFT( void ); |
52 | double dhry_main( int ); | 56 | double dhry_main( int ); |
53 | } | 57 | } |
54 | 58 | ||
55 | #define DHRYSTONE_RUNS 20000000 | 59 | #define DHRYSTONE_RUNS 20000000 |
56 | #define TEST_DURATION 3 | 60 | #define TEST_DURATION 3 |
57 | 61 | ||
58 | #define BUFF_SIZE 8192 | 62 | #define BUFF_SIZE 8192 |
59 | #define FILE_SIZE 1024 * 1024 // 1Mb | 63 | #define FILE_SIZE 1024 * 1024 // 1Mb |
60 | 64 | ||
61 | //=========================================================================== | 65 | //=========================================================================== |
62 | 66 | ||
63 | class BenchmarkPaintWidget : public QWidget | 67 | class BenchmarkPaintWidget : public QWidget |
64 | { | 68 | { |
65 | public: | 69 | public: |
66 | BenchmarkPaintWidget() : QWidget( 0, "Benchmark Paint Widget", WStyle_Customize|WStyle_StaysOnTop|WPaintUnclipped|WPaintClever ) | 70 | BenchmarkPaintWidget() : QWidget( 0, "Benchmark Paint Widget", WStyle_Customize|WStyle_StaysOnTop|WPaintUnclipped|WPaintClever ) |
67 | { | 71 | { |
68 | resize( QApplication::desktop()->size() ); | 72 | resize( QApplication::desktop()->size() ); |
69 | show(); | 73 | show(); |
70 | p.begin( this ); | 74 | p.begin( this ); |
71 | }; | 75 | }; |
72 | 76 | ||
73 | ~BenchmarkPaintWidget() | 77 | ~BenchmarkPaintWidget() |
74 | { | 78 | { |
75 | p.end(); | 79 | p.end(); |
76 | hide(); | 80 | hide(); |
77 | }; | 81 | }; |
78 | 82 | ||
79 | QPainter p; | 83 | QPainter p; |
80 | }; | 84 | }; |
81 | 85 | ||
82 | //=========================================================================== | 86 | //=========================================================================== |
83 | 87 | ||
84 | BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags ) | 88 | BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags ) |
85 | : QWidget( parent, name, wFlags ) | 89 | : QWidget( parent, name, wFlags ) |
86 | { | 90 | { |
87 | 91 | ||
88 | setMinimumSize( 200, 150 ); | 92 | setMinimumSize( 200, 150 ); |
89 | 93 | ||
90 | QVBoxLayout* vb = new QVBoxLayout( this ); | 94 | QVBoxLayout* vb = new QVBoxLayout( this ); |
91 | vb->setSpacing( 4 ); | 95 | vb->setSpacing( 4 ); |
92 | vb->setMargin( 4 ); | 96 | vb->setMargin( 4 ); |
93 | 97 | ||