summaryrefslogtreecommitdiff
authorzecke <zecke>2004-10-17 18:38:39 (UTC)
committer zecke <zecke>2004-10-17 18:38:39 (UTC)
commite95fcb09fc069a83b3c10c19c081873daba49831 (patch) (side-by-side diff)
tree13d13bac82d5bcf2489075e4f2962685ff3c897d
parent7e28835e246e06e157d760a40754b6257f2ad6b3 (diff)
downloadopie-e95fcb09fc069a83b3c10c19c081873daba49831.zip
opie-e95fcb09fc069a83b3c10c19c081873daba49831.tar.gz
opie-e95fcb09fc069a83b3c10c19c081873daba49831.tar.bz2
G++ 4.0 compiler fixes
-Remove anonymous structures and name them -Include 'card.h' to cardpile to make 'Card' known to QList so deleteItem will work -cast 'enum' to char in event.cpp and opimevent.cpp
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/firstuse.cpp9
-rw-r--r--libopie2/opiepim/core/opimevent.cpp2
-rw-r--r--library/backend/event.cpp2
-rw-r--r--noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp18
-rw-r--r--noncore/games/qasteroids/view.cpp7
-rw-r--r--noncore/games/solitaire/cardpile.h2
6 files changed, 25 insertions, 15 deletions
diff --git a/core/launcher/firstuse.cpp b/core/launcher/firstuse.cpp
index acddeea..8344787 100644
--- a/core/launcher/firstuse.cpp
+++ b/core/launcher/firstuse.cpp
@@ -52,32 +52,33 @@ using namespace Opie::Core;
#include <qwsdisplay_qws.h>
#include <qgfx_qws.h>
#endif
/* STD */
#include <stdlib.h>
#include <sys/types.h>
#if defined(Q_OS_LINUX) || defined(_OS_LINUX_)
#include <unistd.h>
#endif
-struct {
- bool enabled;
+struct settingsTable_t {
+ bool enabled : 1;
const char *app;
const char *start;
const char *stop;
const char *desc;
-}
-settingsTable [] =
+};
+
+static settingsTable_t settingsTable [] =
{
{ FALSE, "language", "raise()", "accept()", // No tr
QT_TR_NOOP("Language") },
{ FALSE, "doctab", "raise()", "accept()", // No tr
QT_TR_NOOP("DocTab") },
#ifndef Q_OS_WIN32
{ FALSE, "systemtime", "raise()", "accept()", // No tr
QT_TR_NOOP("Time and Date") },
#endif
{ FALSE, "addressbook", "editPersonalAndClose()", "accept()", // No tr
QT_TR_NOOP("Personal Information") },
{ FALSE, 0, 0, 0, 0 }
diff --git a/libopie2/opiepim/core/opimevent.cpp b/libopie2/opiepim/core/opimevent.cpp
index c656c3d..7bc6c32 100644
--- a/libopie2/opiepim/core/opimevent.cpp
+++ b/libopie2/opiepim/core/opimevent.cpp
@@ -61,25 +61,25 @@ int OCalendarHelper::week( const QDate& date )
int OCalendarHelper::ocurrence( const QDate& date )
{
// calculates the number of occurrances of this day of the
// week till the given date (e.g 3rd Wednesday of the month)
return ( date.day() - 1 ) / 7 + 1;
}
int OCalendarHelper::dayOfWeek( char day )
{
int dayOfWeek = 1;
char i = OPimRecurrence::MON;
- while ( !( i & day ) && i <= OPimRecurrence::SUN )
+ while ( !( i & day ) && i <= static_cast<char>(OPimRecurrence::SUN) )
{
i <<= 1;
++dayOfWeek;
}
return dayOfWeek;
}
int OCalendarHelper::monthDiff( const QDate& first, const QDate& second )
{
return ( second.year() - first.year() ) * 12 +
second.month() - first.month();
diff --git a/library/backend/event.cpp b/library/backend/event.cpp
index 90860e8..abc420b 100644
--- a/library/backend/event.cpp
+++ b/library/backend/event.cpp
@@ -390,25 +390,25 @@ int Event::occurrence( const QDate& date )
// calculates the number of occurrances of this day of the
// week till the given date (e.g 3rd Wednesday of the month)
return ( date.day() - 1 ) / 7 + 1;
}
/*!
\internal
*/
int Event::dayOfWeek( char day )
{
int dayOfWeek = 1;
char i = Event::MON;
- while ( !( i & day ) && i <= Event::SUN ) {
+ while ( !( i & day ) && i <= static_cast<char>(Event::SUN) ) {
i <<= 1;
++dayOfWeek;
}
return dayOfWeek;
}
/*!
\internal
*/
int Event::monthDiff( const QDate& first, const QDate& second )
{
return ( second.year() - first.year() ) * 12 +
diff --git a/noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp b/noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp
index b2180ba..a47bf6c 100644
--- a/noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp
+++ b/noncore/applets/zkbapplet/keyzcfg/zkbnames.cpp
@@ -1,23 +1,25 @@
#include <qmap.h>
#include "zkbnames.h"
QString Null_String((const char*) 0);
// Implementation of KeyNames
-static struct {
+struct Key_Names_t {
int key;
char *name;
-} Key_Names[] = {
+};
+
+static const Key_Names_t Key_Names[] = {
{ 32, "Space" },
{ 39, "Apostrophe" },
{ 44, "Comma" },
{ 46, "Period" },
{ 47, "Slash" },
{ 65, "A" },
{ 66, "B" },
{ 67, "C" },
{ 68, "D" },
{ 69, "E" },
{ 70, "F" },
{ 71, "G" },
@@ -96,28 +98,30 @@ const QString& KeyNames::find(int k) {
init_kn_maps();
}
QMap<int, QString>::Iterator it = kn_rmap.find(k);
if (it == kn_rmap.end()) {
return Null_String;
} else {
return it.data();
}
}
// Implementation of ModifierNames
-struct {
+struct Modifier_Names_t {
int value;
char* name;
-} Modifier_Names[] = {
+};
+
+static const Modifier_Names_t Modifier_Names[] = {
{ 8, "Shift" },
{ 16, "Control" },
{ 32, "Alt" },
{ 0x4000, "Keypad" },
{ 0, 0 }
};
static QMap<QString, int> mn_map;
static QMap<int, QString> mn_rmap;
void init_mn_maps() {
int i = 0;
@@ -150,28 +154,30 @@ const QString& ModifierNames::find(int k) {
}
QMap<int, QString>::Iterator it = mn_rmap.find(k);
if (it == mn_rmap.end()) {
return Null_String;
} else {
return it.data();
}
}
// Implementation of KeycodeNames
-struct {
+struct Keycode_Names_t {
char* name;
int keycode;
-} Keycode_Names[] = {
+};
+
+static const Keycode_Names_t Keycode_Names[] = {
{ "Escape", 0x1000 },
{ "Tab", 0x1001 },
{ "Backtab", 0x1002 },
{ "Backspace", 0x1003 },
{ "BackSpace", 0x1003 },
{ "Return", 0x1004 },
{ "Enter", 0x1005 },
{ "Insert", 0x1006 },
{ "Delete", 0x1007 },
{ "Pause", 0x1008 },
{ "Print", 0x1009 },
{ "SysReq", 0x100a },
diff --git a/noncore/games/qasteroids/view.cpp b/noncore/games/qasteroids/view.cpp
index 352c63b..3a4d410 100644
--- a/noncore/games/qasteroids/view.cpp
+++ b/noncore/games/qasteroids/view.cpp
@@ -46,31 +46,32 @@
#define MAX_SHIP_SPEED 8
#define MAX_BRAKES 5
#define MAX_SHIELDS 5
#define MAX_FIREPOWER 5
#define TEXT_SPEED 4
#define PI_X_2 6.283185307
#ifndef M_PI
#define M_PI 3.141592654
#endif
-struct
+struct kas_animations_t
{
int id;
const char *path;
int frames;
-}
-kas_animations [] =
+};
+
+static const kas_animations_t kas_animations [] =
{
// { ID_ROCK_LARGE, "rock1/rock1\%1.png", 32 },
{ ID_ROCK_MEDIUM, "rock2/rock2\%1.png", 32 },
{ ID_ROCK_SMALL, "rock3/rock3\%1.png", 32 },
{ ID_SHIP, "ship/ship\%1.png", 32 },
{ ID_MISSILE, "missile/missile.png", 0 },
{ ID_BIT, "bits/bits\%1.png", 16 },
{ ID_EXHAUST, "exhaust/exhaust.png", 0 },
{ ID_ENERGY_POWERUP, "powerups/energy.png", 0 },
// { ID_TELEPORT_POWERUP, "powerups/teleport%1.png", 12 },
{ ID_BRAKE_POWERUP, "powerups/brake.png", 0 },
{ ID_SHIELD_POWERUP, "powerups/shield.png", 0 },
diff --git a/noncore/games/solitaire/cardpile.h b/noncore/games/solitaire/cardpile.h
index 1eb2499..757e6b3 100644
--- a/noncore/games/solitaire/cardpile.h
+++ b/noncore/games/solitaire/cardpile.h
@@ -11,24 +11,26 @@
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef CARD_PILE_H
#define CARD_PILE_H
+#include "card.h"
+
#include <qpoint.h>
#include <qlist.h>
enum ePileStackingType {
pileCascades = 0, pileStacks, pileCascadesOrStacks
};
enum ePileFaceingType {
pileFaceUp = 0, pileFaceDown, pileFaceUpOrDown