-rw-r--r-- | noncore/settings/sysinfo/benchmarkinfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp index 2a52b00..96bcdfc 100644 --- a/noncore/settings/sysinfo/benchmarkinfo.cpp +++ b/noncore/settings/sysinfo/benchmarkinfo.cpp | |||
@@ -3,97 +3,97 @@ | |||
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 | #include "benchmarkinfo.h" | 19 | #include "benchmarkinfo.h" |
20 | 20 | ||
21 | /* OPIE */ | 21 | /* OPIE */ |
22 | #include <opie2/ostorageinfo.h> | 22 | #include <opie2/ostorageinfo.h> |
23 | #include <opie2/olistview.h> | 23 | #include <opie2/olistview.h> |
24 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
25 | #include <qpe/qcopenvelope_qws.h> | 25 | #include <qpe/qcopenvelope_qws.h> |
26 | #include <qpe/qpedecoration_qws.h> | 26 | #include <qpe/qpedecoration_qws.h> |
27 | #include <qpe/resource.h> | 27 | #include <qpe/resource.h> |
28 | #include <qpe/config.h> | 28 | #include <qpe/config.h> |
29 | 29 | ||
30 | /* QT */ | 30 | /* QT */ |
31 | #include <qclipboard.h> | 31 | #include <qclipboard.h> |
32 | #include <qcolor.h> | 32 | #include <qcolor.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qdirectpainter_qws.h> | 34 | #include <qdirectpainter_qws.h> |
35 | #include <qfile.h> | 35 | #include <qfile.h> |
36 | #include <qtextstream.h> | 36 | #include <qtextstream.h> |
37 | #include <qfiledialog.h> | 37 | #include <qfiledialog.h> |
38 | #include <qlabel.h> | 38 | #include <qlabel.h> |
39 | #include <qlayout.h> | 39 | #include <qlayout.h> |
40 | #include <qpainter.h> | 40 | #include <qpainter.h> |
41 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
42 | #include <qtimer.h> | 42 | #include <qtimer.h> |
43 | #include <qwhatsthis.h> | 43 | #include <qwhatsthis.h> |
44 | 44 | ||
45 | /* STD */ | 45 | /* STD */ |
46 | #include <time.h> | 46 | #include <time.h> |
47 | #include <stdio.h> | 47 | #include <stdio.h> |
48 | #include <stdlib.h> | 48 | #include <stdlib.h> |
49 | #include <math.h> | 49 | #include <math.h> |
50 | #if defined (__GNUC__) && (__GNUC__ < 3) | 50 | #if defined (__GNUC__) && (__GNUC__ < 3) |
51 | extern double round(double); | 51 | #define round qRound |
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | using namespace Opie::Ui; | 54 | using namespace Opie::Ui; |
55 | using namespace Opie::Core; | 55 | using namespace Opie::Core; |
56 | extern "C" | 56 | extern "C" |
57 | 57 | ||
58 | { | 58 | { |
59 | void BenchFFT( void ); | 59 | void BenchFFT( void ); |
60 | double dhry_main( int ); | 60 | double dhry_main( int ); |
61 | } | 61 | } |
62 | 62 | ||
63 | #define DHRYSTONE_RUNS 20000000 | 63 | #define DHRYSTONE_RUNS 20000000 |
64 | #define TEST_DURATION 3 | 64 | #define TEST_DURATION 3 |
65 | 65 | ||
66 | #define BUFF_SIZE 8192 | 66 | #define BUFF_SIZE 8192 |
67 | #define FILE_SIZE 1024 * 1024 // 1Mb | 67 | #define FILE_SIZE 1024 * 1024 // 1Mb |
68 | 68 | ||
69 | //=========================================================================== | 69 | //=========================================================================== |
70 | 70 | ||
71 | class BenchmarkPaintWidget : public QWidget | 71 | class BenchmarkPaintWidget : public QWidget |
72 | { | 72 | { |
73 | public: | 73 | public: |
74 | BenchmarkPaintWidget() : QWidget( 0, "Benchmark Paint Widget", WStyle_Customize|WStyle_StaysOnTop|WPaintUnclipped|WPaintClever ) | 74 | BenchmarkPaintWidget() : QWidget( 0, "Benchmark Paint Widget", WStyle_Customize|WStyle_StaysOnTop|WPaintUnclipped|WPaintClever ) |
75 | { | 75 | { |
76 | resize( QApplication::desktop()->size() ); | 76 | resize( QApplication::desktop()->size() ); |
77 | show(); | 77 | show(); |
78 | p.begin( this ); | 78 | p.begin( this ); |
79 | }; | 79 | }; |
80 | 80 | ||
81 | ~BenchmarkPaintWidget() | 81 | ~BenchmarkPaintWidget() |
82 | { | 82 | { |
83 | p.end(); | 83 | p.end(); |
84 | hide(); | 84 | hide(); |
85 | }; | 85 | }; |
86 | 86 | ||
87 | QPainter p; | 87 | QPainter p; |
88 | }; | 88 | }; |
89 | 89 | ||
90 | //=========================================================================== | 90 | //=========================================================================== |
91 | 91 | ||
92 | BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags ) | 92 | BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags ) |
93 | : QWidget( parent, name, wFlags ) | 93 | : QWidget( parent, name, wFlags ) |
94 | { | 94 | { |
95 | 95 | ||
96 | setMinimumSize( 200, 150 ); | 96 | setMinimumSize( 200, 150 ); |
97 | 97 | ||
98 | QVBoxLayout* vb = new QVBoxLayout( this ); | 98 | QVBoxLayout* vb = new QVBoxLayout( this ); |
99 | vb->setSpacing( 4 ); | 99 | vb->setSpacing( 4 ); |