summaryrefslogtreecommitdiffstats
path: root/src/kernel
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-12-01 23:30:27 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-12-01 23:30:27 -0600
commit7aa5ac7f0e76c5b87e4ca837b75b3edd522a3372 (patch)
tree9eff0506756adca6934846467804a19f291b4509 /src/kernel
parentbb07131a9191affa4c66f6bc720a388f96343836 (diff)
downloadqt3-7aa5ac7f0e76c5b87e4ca837b75b3edd522a3372.tar.gz
qt3-7aa5ac7f0e76c5b87e4ca837b75b3edd522a3372.zip
Fix a number of build warnings that could lead to unstable operation
This breaks the ABI
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/qapplication_x11.cpp4
-rw-r--r--src/kernel/qdragobject.cpp6
-rw-r--r--src/kernel/qeventloop_unix_glib.cpp4
-rw-r--r--src/kernel/qimage.cpp1
-rw-r--r--src/kernel/qinputcontext.cpp9
-rw-r--r--src/kernel/qinputcontext_x11.cpp2
-rw-r--r--src/kernel/qjpegio.cpp2
-rw-r--r--src/kernel/qnetworkprotocol.cpp8
-rw-r--r--src/kernel/qnetworkprotocol.h4
-rw-r--r--src/kernel/qprocess_unix.cpp8
-rw-r--r--src/kernel/qscriptengine_x11.cpp12
-rw-r--r--src/kernel/qstyle.h13
12 files changed, 54 insertions, 19 deletions
diff --git a/src/kernel/qapplication_x11.cpp b/src/kernel/qapplication_x11.cpp
index 2873b9e..c2c0288 100644
--- a/src/kernel/qapplication_x11.cpp
+++ b/src/kernel/qapplication_x11.cpp
@@ -430,7 +430,7 @@ static bool qt_x11EventFilter( XEvent* ev )
//XIM qt_xim = 0;
Q_EXPORT XIMStyle qt_xim_style = 0;
Q_EXPORT XIMStyle qt_xim_preferred_style = 0;
-Q_EXPORT static XIMStyle xim_default_style = XIMPreeditCallbacks | XIMStatusNothing;
+static XIMStyle xim_default_style = XIMPreeditCallbacks | XIMStatusNothing;
#endif
Q_EXPORT int qt_ximComposingKeycode=0;
@@ -5889,7 +5889,7 @@ static Bool qt_net_wm_sync_request_scanner(Display*, XEvent* event, XPointer arg
{
return (event->type == ClientMessage && event->xclient.window == *(Window*)arg
&& event->xclient.message_type == qt_wm_protocols
- && event->xclient.data.l[ 0 ] == qt_net_wm_sync_request );
+ && ((unsigned int)event->xclient.data.l[ 0 ]) == qt_net_wm_sync_request );
}
#endif
diff --git a/src/kernel/qdragobject.cpp b/src/kernel/qdragobject.cpp
index 4f3353b..d48d79f 100644
--- a/src/kernel/qdragobject.cpp
+++ b/src/kernel/qdragobject.cpp
@@ -1749,9 +1749,9 @@ QColorDrag::QColorDrag( QWidget *dragsource, const char *name )
void QColorDrag::setColor( const QColor &col )
{
- short r = (col.red() << 8) | col.red();
- short g = (col.green() << 8) | col.green();
- short b = (col.blue() << 8) | col.blue();
+ unsigned short r = (col.red() << 8) | col.red();
+ unsigned short g = (col.green() << 8) | col.green();
+ unsigned short b = (col.blue() << 8) | col.blue();
// make sure we transmit data in network order
r = htons(r);
diff --git a/src/kernel/qeventloop_unix_glib.cpp b/src/kernel/qeventloop_unix_glib.cpp
index 6852f6b..e607447 100644
--- a/src/kernel/qeventloop_unix_glib.cpp
+++ b/src/kernel/qeventloop_unix_glib.cpp
@@ -505,7 +505,9 @@ void QEventLoop::wakeUp()
size_t nbytes = 0;
char c = 0;
if ( ::ioctl( d->thread_pipe[0], FIONREAD, (char*)&nbytes ) >= 0 && nbytes == 0 ) {
- ::write( d->thread_pipe[1], &c, 1 );
+ if (::write( d->thread_pipe[1], &c, 1 ) < 0) {
+ // Failed!
+ }
}
}
diff --git a/src/kernel/qimage.cpp b/src/kernel/qimage.cpp
index b55a0e7..214fc85 100644
--- a/src/kernel/qimage.cpp
+++ b/src/kernel/qimage.cpp
@@ -5424,6 +5424,7 @@ static void write_pbm_image( QImageIO *iio )
class QImageIOFrameGrabber : public QImageConsumer {
public:
QImageIOFrameGrabber() : framecount(0) { }
+ virtual ~QImageIOFrameGrabber() { }
QImageDecoder *decoder;
int framecount;
diff --git a/src/kernel/qinputcontext.cpp b/src/kernel/qinputcontext.cpp
index 5433ae4..3b2d476 100644
--- a/src/kernel/qinputcontext.cpp
+++ b/src/kernel/qinputcontext.cpp
@@ -477,6 +477,7 @@ bool QInputContext::isComposing() const
*/
bool QInputContext::filterEvent( const QEvent *event )
{
+ Q_UNUSED(event);
return FALSE;
}
@@ -679,6 +680,11 @@ void QInputContext::unsetFocus()
*/
void QInputContext::setMicroFocus( int x, int y, int w, int h, QFont *f )
{
+ Q_UNUSED(x);
+ Q_UNUSED(y);
+ Q_UNUSED(w);
+ Q_UNUSED(h);
+ Q_UNUSED(f);
}
@@ -705,6 +711,9 @@ void QInputContext::mouseHandler( int x, QEvent::Type type,
Qt::ButtonState button,
Qt::ButtonState state )
{
+ Q_UNUSED(x);
+ Q_UNUSED(button);
+ Q_UNUSED(state);
// Default behavior for simple ephemeral input contexts. Some
// complex input contexts should not be reset here.
if ( type == QEvent::MouseButtonPress ||
diff --git a/src/kernel/qinputcontext_x11.cpp b/src/kernel/qinputcontext_x11.cpp
index 8bdfa5e..e7c82c1 100644
--- a/src/kernel/qinputcontext_x11.cpp
+++ b/src/kernel/qinputcontext_x11.cpp
@@ -67,6 +67,8 @@
*/
bool QInputContext::x11FilterEvent( QWidget *keywidget, XEvent *event )
{
+ Q_UNUSED(keywidget);
+ Q_UNUSED(event);
return FALSE;
}
diff --git a/src/kernel/qjpegio.cpp b/src/kernel/qjpegio.cpp
index 5d2a1b1..bdb4c27 100644
--- a/src/kernel/qjpegio.cpp
+++ b/src/kernel/qjpegio.cpp
@@ -80,7 +80,7 @@ void my_error_exit (j_common_ptr cinfo)
my_error_mgr* myerr = (my_error_mgr*) cinfo->err;
char buffer[JMSG_LENGTH_MAX];
(*cinfo->err->format_message)(cinfo, buffer);
- qWarning(buffer);
+ qWarning("%s", buffer);
longjmp(myerr->setjmp_buffer, 1);
}
diff --git a/src/kernel/qnetworkprotocol.cpp b/src/kernel/qnetworkprotocol.cpp
index 4173584..e6c4a6a 100644
--- a/src/kernel/qnetworkprotocol.cpp
+++ b/src/kernel/qnetworkprotocol.cpp
@@ -381,6 +381,14 @@ public:
of these values.
*/
+QNetworkProtocolFactoryBase::QNetworkProtocolFactoryBase() {
+ //
+}
+
+QNetworkProtocolFactoryBase::~QNetworkProtocolFactoryBase() {
+ //
+}
+
/*!
Constructor of the network protocol base class. Does some
initialization and connecting of signals and slots.
diff --git a/src/kernel/qnetworkprotocol.h b/src/kernel/qnetworkprotocol.h
index 096a9ad..fa350e3 100644
--- a/src/kernel/qnetworkprotocol.h
+++ b/src/kernel/qnetworkprotocol.h
@@ -64,6 +64,10 @@ template <class T> class QValueList;
class Q_EXPORT QNetworkProtocolFactoryBase
{
public:
+ QNetworkProtocolFactoryBase();
+ virtual ~QNetworkProtocolFactoryBase();
+
+public:
virtual QNetworkProtocol *createObject() = 0;
};
diff --git a/src/kernel/qprocess_unix.cpp b/src/kernel/qprocess_unix.cpp
index 2a4a2fd..c6066d4 100644
--- a/src/kernel/qprocess_unix.cpp
+++ b/src/kernel/qprocess_unix.cpp
@@ -379,7 +379,9 @@ void QProcessManager::sigchldHnd( int fd )
}
char tmp;
- ::read( fd, &tmp, sizeof(tmp) );
+ if (::read( fd, &tmp, sizeof(tmp) ) < 0) {
+ qWarning( "Could not read from file descriptor" );
+ }
#if defined(QT_QPROCESS_DEBUG)
qDebug( "QProcessManager::sigchldHnd()" );
#endif
@@ -562,7 +564,9 @@ QT_SIGNAL_RETTYPE qt_C_sigchldHnd( QT_SIGNAL_ARGS )
return;
char a = 1;
- ::write( QProcessPrivate::procManager->sigchldFd[0], &a, sizeof(a) );
+ if (::write( QProcessPrivate::procManager->sigchldFd[0], &a, sizeof(a) ) < 0) {
+ qWarning( "Could not write to file descriptor" );
+ }
}
diff --git a/src/kernel/qscriptengine_x11.cpp b/src/kernel/qscriptengine_x11.cpp
index 7d2b77d..b87680b 100644
--- a/src/kernel/qscriptengine_x11.cpp
+++ b/src/kernel/qscriptengine_x11.cpp
@@ -2725,11 +2725,7 @@ static bool khmer_shape_syllable(QOpenType *openType, QShaperItem *item)
#ifndef QT_NO_XFTFREETYPE
if (openType) {
- unsigned short logClusters[16];
- for (int i = 0; i < len; ++i)
- logClusters[i] = i;
-
- uint where[16];
+ uint where[16];
for (int i = 0; i < len; ++i) {
where[i] = ~(PreSubstProperty
@@ -3236,11 +3232,7 @@ static bool myanmar_shape_syllable(QOpenType *openType, QShaperItem *item, bool
#ifndef QT_NO_XFTFREETYPE
if (openType) {
- unsigned short logClusters[32];
- for (int i = 0; i < len; ++i)
- logClusters[i] = i;
-
- uint where[32];
+ uint where[32];
for (int i = 0; i < len; ++i) {
where[i] = ~(PreSubstProperty
diff --git a/src/kernel/qstyle.h b/src/kernel/qstyle.h
index cf7a235..0efc386 100644
--- a/src/kernel/qstyle.h
+++ b/src/kernel/qstyle.h
@@ -290,6 +290,7 @@ class Q_EXPORT QStyleControlElementData {
QString caption;
QStyleControlElementGenericWidgetData topLevelWidgetData;
Q_UINT32 topLevelWidgetFlags;
+ QPixmap paletteBgPixmap;
};
class Q_EXPORT QStyleWidgetActionRequestData {
@@ -1070,6 +1071,18 @@ public:
// bool - whether or not the upper two button drawing areas should be combined into one
SH_ScrollBar_CombineSubLineRegionDrawingAreas,
+ // Qt::QRgb - color of the popup menu arrow (active, menuitem enabled)
+ SH_PopupMenu_SubMenuArrowColorActiveEnabled,
+
+ // Qt::QRgb - color of the popup menu arrow (active, menuitem disabled)
+ SH_PopupMenu_SubMenuArrowColorActiveDisabled,
+
+ // Qt::QRgb - color of the popup menu arrow (inactive, menuitem enabled)
+ SH_PopupMenu_SubMenuArrowColorInactiveEnabled,
+
+ // Qt::QRgb - color of the popup menu arrow (active, menuitem disabled)
+ SH_PopupMenu_SubMenuArrowColorInactiveDisabled,
+
// do not add any values below/greater than this
SH_CustomBase = 0xf0000000
};