change PIIODevice read* and write* methods size to "ssize_t"

This commit is contained in:
2022-08-01 18:52:30 +03:00
parent 1b499530c5
commit b1e220e454
39 changed files with 135 additions and 128 deletions

View File

@@ -151,7 +151,7 @@ void PIBroadcast::initAll(PIVector<PIEthernet::Address> al) {
//piCout << "mcast " << ce->readAddress() << ce->sendAddress();
if (ce->open()) {
eth_mcast << ce;
CONNECT2(void, const uchar *, int, ce, threadedReadEvent, this, mcastRead);
CONNECT2(void, const uchar *, ssize_t, ce, threadedReadEvent, this, mcastRead);
} else {
delete ce;
}
@@ -173,7 +173,7 @@ void PIBroadcast::initAll(PIVector<PIEthernet::Address> al) {
//piCout << "bcast " << ce->readAddress() << ce->sendAddress();
if (ce->open()) {
eth_mcast << ce;
CONNECT2(void, const uchar *, int, ce, threadedReadEvent, this, mcastRead);
CONNECT2(void, const uchar *, ssize_t, ce, threadedReadEvent, this, mcastRead);
} else {
delete ce;
}
@@ -189,7 +189,7 @@ void PIBroadcast::initAll(PIVector<PIEthernet::Address> al) {
eth_lo->setName("PIMulticast_loopback");
if (!_send_only) {
eth_lo->setParameter(PIEthernet::ReuseAddress, false);
CONNECT2(void, const uchar *, int, eth_lo, threadedReadEvent, this, mcastRead);
CONNECT2(void, const uchar *, ssize_t, eth_lo, threadedReadEvent, this, mcastRead);
for (int i = 0; i < lo_pcnt; ++i) {
eth_lo->setReadAddress("127.0.0.1", lo_port + i);
if (eth_lo->open()) {
@@ -248,7 +248,7 @@ void PIBroadcast::reinit() {
}
void PIBroadcast::mcastRead(const uchar * data, int size) {
void PIBroadcast::mcastRead(const uchar * data, ssize_t size) {
PIByteArray cd = decryptData(PIByteArray(data, size));
if (cd.isEmpty()) return;
received(cd);

View File

@@ -111,7 +111,7 @@ void PIStreamPacker::send(const PIByteArray & data) {
}
void PIStreamPacker::received(const uchar * readed, int size) {
void PIStreamPacker::received(const uchar * readed, ssize_t size) {
received(PIByteArray(readed, size));
}
@@ -198,6 +198,6 @@ void PIStreamPacker::assignDevice(PIIODevice * dev) {
if (!dev->infoFlags()[PIIODevice::Reliable]) {
piCoutObj << "Warning! Not recommended to use with non-reliable" << dev;
}
CONNECT2(void, const uchar *, int, dev, threadedReadEvent, this, received);
CONNECT2(void, const uchar *, ssize_t, dev, threadedReadEvent, this, received);
CONNECT1(void, PIByteArray, this, sendRequest, dev, write);
}