mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
mark some cases as unlikely
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
b6fde31421
commit
91caea0b81
3 changed files with 14 additions and 14 deletions
|
@ -90,7 +90,7 @@ inline void debugBinaryString(const char *data, qint64 maxlen)
|
|||
|
||||
#define CHECK_MAXLEN(function, returnType) \
|
||||
do { \
|
||||
if (maxSize < 0) { \
|
||||
if (Q_UNLIKELY(maxSize < 0)) { \
|
||||
qWarning("QIODevice::"#function": Called with maxSize < 0"); \
|
||||
return returnType; \
|
||||
} \
|
||||
|
@ -98,7 +98,7 @@ inline void debugBinaryString(const char *data, qint64 maxlen)
|
|||
|
||||
#define CHECK_WRITABLE(function, returnType) \
|
||||
do { \
|
||||
if ((d->openMode & WriteOnly) == 0) { \
|
||||
if (Q_UNLIKELY((d->openMode & WriteOnly) == 0)) { \
|
||||
if (d->openMode == NotOpen) { \
|
||||
qWarning("QIODevice::"#function": device not open"); \
|
||||
return returnType; \
|
||||
|
@ -110,7 +110,7 @@ inline void debugBinaryString(const char *data, qint64 maxlen)
|
|||
|
||||
#define CHECK_READABLE(function, returnType) \
|
||||
do { \
|
||||
if ((d->openMode & ReadOnly) == 0) { \
|
||||
if (Q_UNLIKELY((d->openMode & ReadOnly) == 0)) { \
|
||||
if (d->openMode == NotOpen) { \
|
||||
qWarning("QIODevice::"#function": device not open"); \
|
||||
return returnType; \
|
||||
|
|
|
@ -93,7 +93,7 @@ static inline bool checkPixelSize(const QImage::Format format)
|
|||
|
||||
|
||||
#define QIMAGE_SANITYCHECK_MEMORY(image) \
|
||||
if ((image).isNull()) { \
|
||||
if (Q_UNLIKELY((image).isNull())) { \
|
||||
qWarning("QImage: out of memory, returning null image"); \
|
||||
return QImage(); \
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue