Change channel id type to quint16

My reading of the spec is that channel numbers are unsigned.
This commit is contained in:
Marcelo E. Magallon 2015-02-11 15:10:08 -06:00 committed by Marcelo E. Magallon
parent 99b0d32f3f
commit 79226ccb35
4 changed files with 8 additions and 8 deletions

View File

@ -6,7 +6,7 @@
#include "qamqpclient.h" #include "qamqpclient.h"
#include "qamqpclient_p.h" #include "qamqpclient_p.h"
int QAmqpChannelPrivate::nextChannelNumber = 0; quint16 QAmqpChannelPrivate::nextChannelNumber = 0;
QAmqpChannelPrivate::QAmqpChannelPrivate(QAmqpChannel *q) QAmqpChannelPrivate::QAmqpChannelPrivate(QAmqpChannel *q)
: channelNumber(0), : channelNumber(0),
opened(false), opened(false),

View File

@ -60,8 +60,8 @@ public:
QPointer<QAmqpClient> client; QPointer<QAmqpClient> client;
QString name; QString name;
int channelNumber; quint16 channelNumber;
static int nextChannelNumber; static quint16 nextChannelNumber;
bool opened; bool opened;
bool needOpen; bool needOpen;

View File

@ -22,12 +22,12 @@ QAmqpFrame::~QAmqpFrame()
{ {
} }
void QAmqpFrame::setChannel(qint16 channel) void QAmqpFrame::setChannel(quint16 channel)
{ {
channel_ = channel; channel_ = channel;
} }
qint16 QAmqpFrame::channel() const quint16 QAmqpFrame::channel() const
{ {
return channel_; return channel_;
} }

View File

@ -39,8 +39,8 @@ public:
FrameType type() const; FrameType type() const;
qint16 channel() const; quint16 channel() const;
void setChannel(qint16 channel); void setChannel(quint16 channel);
virtual qint32 size() const; virtual qint32 size() const;
@ -56,7 +56,7 @@ protected:
private: private:
qint8 type_; qint8 type_;
qint16 channel_; quint16 channel_;
friend QDataStream &operator<<(QDataStream &stream, const QAmqpFrame &frame); friend QDataStream &operator<<(QDataStream &stream, const QAmqpFrame &frame);
friend QDataStream &operator>>(QDataStream &stream, QAmqpFrame &frame); friend QDataStream &operator>>(QDataStream &stream, QAmqpFrame &frame);