mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
compiler warnings fixes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
6c1d8dfab5
commit
1345df9a54
10 changed files with 23 additions and 34 deletions
|
@ -2508,7 +2508,8 @@ QDataStream &operator>>(QDataStream &in, QByteArray &ba)
|
|||
return in;
|
||||
|
||||
ba.resize(len);
|
||||
if (in.readRawData(ba.data(), len) != len) {
|
||||
const quint32 readlen = in.readRawData(ba.data(), len);
|
||||
if (readlen != len) {
|
||||
ba.clear();
|
||||
in.setStatus(QDataStream::ReadPastEnd);
|
||||
return in;
|
||||
|
|
|
@ -328,7 +328,7 @@ char *qfcvt(double x, int n, int *dp, int *sign, char* buf)
|
|||
QSTACKARRAY(char, tmp, 1500);
|
||||
int i, lz;
|
||||
|
||||
if (n > 1400U) n = 1400;
|
||||
if (n > 1400) n = 1400;
|
||||
sprintf(tmp, "%.*f", n, x);
|
||||
i = (tmp[0] == '-');
|
||||
if (tmp[i] == '0') lz = strspn(tmp+i+2, "0");
|
||||
|
@ -337,7 +337,7 @@ char *qfcvt(double x, int n, int *dp, int *sign, char* buf)
|
|||
if (n<=lz) {
|
||||
*sign = i;
|
||||
*dp = 1;
|
||||
if (n>14U) n = 14;
|
||||
if (n>14) n = 14;
|
||||
return (char*)"000000000000000"+14-n;
|
||||
}
|
||||
|
||||
|
@ -349,7 +349,7 @@ char *qecvt(double x, int n, int *dp, int *sign, char* buf)
|
|||
QSTACKARRAY(char, tmp, 32);
|
||||
int i, j;
|
||||
|
||||
if (n-1U > 15) n = 15;
|
||||
if (n-1 > 15) n = 15;
|
||||
sprintf(tmp, "%.*e", n-1, x);
|
||||
i = *sign = (tmp[0]=='-');
|
||||
for (j=0; tmp[i]!='e'; j+=(tmp[i++]!='.'))
|
||||
|
|
|
@ -6693,7 +6693,8 @@ QDataStream &operator>>(QDataStream &in, QString &str)
|
|||
|
||||
int len = (bytes / sizeof(QChar));
|
||||
str.resize(len);
|
||||
if (in.readRawData(reinterpret_cast<char *>(str.data()), bytes) != bytes) {
|
||||
const quint32 readlen = in.readRawData(reinterpret_cast<char *>(str.data()), bytes);
|
||||
if (readlen != bytes) {
|
||||
str.clear();
|
||||
in.setStatus(QDataStream::ReadPastEnd);
|
||||
return in;
|
||||
|
|
|
@ -853,7 +853,7 @@ void QGraphicsItemPrivate::updateAncestorFlag(QGraphicsItem::GraphicsItemFlag ch
|
|||
|
||||
void QGraphicsItemPrivate::updateAncestorFlags()
|
||||
{
|
||||
int flags = 0;
|
||||
uint flags = 0;
|
||||
if (parent) {
|
||||
// Inherit the parent's ancestor flags.
|
||||
QGraphicsItemPrivate *pd = parent->d_ptr.data();
|
||||
|
@ -1773,7 +1773,7 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags)
|
|||
|
||||
// Flags that alter the geometry of the item (or its children).
|
||||
const quint32 geomChangeFlagsMask = (ItemClipsChildrenToShape | ItemClipsToShape | ItemIgnoresTransformations | ItemIsSelectable);
|
||||
bool fullUpdate = (quint32(flags) & geomChangeFlagsMask) != (d_ptr->flags & geomChangeFlagsMask);
|
||||
bool fullUpdate = (quint32(flags) & geomChangeFlagsMask) != (quint32(d_ptr->flags) & geomChangeFlagsMask);
|
||||
if (fullUpdate)
|
||||
d_ptr->updatePaintedViewBoundingRects(/*children=*/true);
|
||||
|
||||
|
|
|
@ -109,7 +109,8 @@ static void iod_read_fn(png_structp png_ptr, png_bytep data, png_size_t length)
|
|||
QPngHandlerPrivate *d = (QPngHandlerPrivate *)png_get_io_ptr(png_ptr);
|
||||
QIODevice *in = d->q->device();
|
||||
|
||||
int nr = in->read((char*)data, length);
|
||||
Q_ASSERT(sizeof(uint) == sizeof(png_size_t)); // may overflow otherwise
|
||||
uint nr = in->read((char*)data, length);
|
||||
if (nr != length) {
|
||||
png_error(png_ptr, "Read Error");
|
||||
}
|
||||
|
|
|
@ -1186,17 +1186,16 @@ void QClipboard::setMimeData(QMimeData* src, Mode mode)
|
|||
Atom atom, sentinel_atom;
|
||||
QClipboardData *d;
|
||||
switch (mode) {
|
||||
case QClipboard::Selection:
|
||||
atom = XA_PRIMARY;
|
||||
sentinel_atom = ATOM(_QT_SELECTION_SENTINEL);
|
||||
d = selectionData();
|
||||
break;
|
||||
|
||||
case QClipboard::Clipboard:
|
||||
atom = ATOM(CLIPBOARD);
|
||||
sentinel_atom = ATOM(_QT_CLIPBOARD_SENTINEL);
|
||||
d = clipboardData();
|
||||
break;
|
||||
case QClipboard::Selection:
|
||||
atom = XA_PRIMARY;
|
||||
sentinel_atom = ATOM(_QT_SELECTION_SENTINEL);
|
||||
d = selectionData();
|
||||
break;
|
||||
}
|
||||
|
||||
Display *dpy = qt_x11Data->display;
|
||||
|
|
|
@ -186,7 +186,7 @@ static int translateKeySym(const uint key)
|
|||
return key;
|
||||
}
|
||||
|
||||
static bool getX11AutoRepeat() {
|
||||
static int getX11AutoRepeat() {
|
||||
XKeyboardState state;
|
||||
XGetKeyboardControl(qt_x11Data->display, &state);
|
||||
if (state.global_auto_repeat == AutoRepeatModeOn) {
|
||||
|
@ -238,7 +238,7 @@ bool QKeyMapper::translateKeyEvent(QWidget *keyWidget, const XEvent *event)
|
|||
if (curr_autorep.serial == event->xkey.serial ||
|
||||
(event->xkey.window == curr_autorep.window &&
|
||||
event->xkey.keycode == curr_autorep.keycode &&
|
||||
event->xkey.time - curr_autorep.time < qt_x11_autorepeat)) {
|
||||
event->xkey.time - curr_autorep.time < qulonglong(qt_x11_autorepeat))) {
|
||||
autorepeat = true;
|
||||
}
|
||||
curr_autorep = {
|
||||
|
|
|
@ -173,7 +173,7 @@ bool QPainterPrivate::attachPainterPrivate(QPainter *q, QPaintDevice *pdev)
|
|||
sp->d_ptr->d_ptrs_size = 4;
|
||||
sp->d_ptr->d_ptrs = (QPainterPrivate **)::malloc(4 * sizeof(QPainterPrivate *));
|
||||
Q_CHECK_PTR(sp->d_ptr->d_ptrs);
|
||||
} else if (sp->d_ptr->refcount - 1 == sp->d_ptr->d_ptrs_size) {
|
||||
} else if (sp->d_ptr->refcount - 1 == uint(sp->d_ptr->d_ptrs_size)) {
|
||||
// However, to support corner cases we grow the array dynamically if needed.
|
||||
sp->d_ptr->d_ptrs_size <<= 1;
|
||||
const int newSize = sp->d_ptr->d_ptrs_size * sizeof(QPainterPrivate *);
|
||||
|
|
|
@ -1830,7 +1830,7 @@ QString WriteInitialization::pixCall(const QString &t, const QString &text) cons
|
|||
type += QLatin1String("()");
|
||||
return type;
|
||||
}
|
||||
if (const DomImage *image = findImage(text)) {
|
||||
if (hasImage(text)) {
|
||||
QString rc = WriteIconInitialization::iconFromDataFunction();
|
||||
rc += QLatin1Char('(');
|
||||
rc += text;
|
||||
|
@ -2335,21 +2335,9 @@ void WriteInitialization::acceptConnection(DomConnection *connection)
|
|||
<< ");\n";
|
||||
}
|
||||
|
||||
DomImage *WriteInitialization::findImage(const QString &name) const
|
||||
bool WriteInitialization::hasImage(const QString &name) const
|
||||
{
|
||||
return m_registeredImages.value(name);
|
||||
}
|
||||
|
||||
DomWidget *WriteInitialization::findWidget(const QLatin1String &widgetClass)
|
||||
{
|
||||
for (int i = m_widgetChain.count() - 1; i >= 0; --i) {
|
||||
DomWidget *widget = m_widgetChain.at(i);
|
||||
|
||||
if (widget && m_uic->customWidgetsInfo()->extends(widget->attributeClass(), widgetClass))
|
||||
return widget;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return m_registeredImages.contains(name);
|
||||
}
|
||||
|
||||
void WriteInitialization::acceptImage(DomImage *image)
|
||||
|
|
|
@ -218,8 +218,7 @@ private:
|
|||
void enableSorting(DomWidget *w, const QString &varName, const QString &tempName);
|
||||
|
||||
QString findDeclaration(const QString &name);
|
||||
DomWidget *findWidget(const QLatin1String &widgetClass);
|
||||
DomImage *findImage(const QString &name) const;
|
||||
bool hasImage(const QString &name) const;
|
||||
|
||||
bool isValidObject(const QString &name) const;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue