CXX ?= g++
ifdef DEBUG
-CXXFLAGS ?= -g -Wall -Woverloaded-virtual -Wno-parentheses #-Werror
+CXXFLAGS ?= -g -Wall -Woverloaded-virtual -Wno-parentheses -Werror
else
-CXXFLAGS ?= -O2 -Wall -Woverloaded-virtual -Wno-parentheses #-Werror
+CXXFLAGS ?= -O2 -Wall -Woverloaded-virtual -Wno-parentheses -Werror
endif
### The directory environment:
void MVPReceiver::threadMethod()
{
+ ULONG *p;
ULONG headerLength = sizeof(ULONG) * 4;
UCHAR buffer[streamChunkSize + headerLength];
int amountReceived;
amountReceived = processed.get(buffer+headerLength, streamChunkSize);
pthread_mutex_unlock(&processedRingLock);
- *(ULONG*)&buffer[0] = htonl(2); // stream channel
- *(ULONG*)&buffer[4] = htonl(streamID);
- *(ULONG*)&buffer[8] = htonl(0); // here insert flag: 0 = ok, data follows
- *(ULONG*)&buffer[12] = htonl(amountReceived);
+ p = (ULONG*)&buffer[0]; *p = htonl(2); // stream channel
+ p = (ULONG*)&buffer[4]; *p = htonl(streamID);
+ p = (ULONG*)&buffer[8]; *p = htonl(0); // here insert flag: 0 = ok, data follows
+ p = (ULONG*)&buffer[12]; *p = htonl(amountReceived);
tcp->sendPacket(buffer, amountReceived + headerLength);
} while(processed.getContent() >= streamChunkSize);
void MVPReceiver::sendStreamEnd()
{
+ ULONG *p;
ULONG bufferLength = sizeof(ULONG) * 4;
UCHAR buffer[bufferLength];
- *(ULONG*)&buffer[0] = htonl(2); // stream channel
- *(ULONG*)&buffer[4] = htonl(streamID);
- *(ULONG*)&buffer[8] = htonl(1); // stream end
- *(ULONG*)&buffer[12] = htonl(0); // zero length, no more data
+ p = (ULONG*)&buffer[0]; *p = htonl(2); // stream channel
+ p = (ULONG*)&buffer[4]; *p = htonl(streamID);
+ p = (ULONG*)&buffer[8]; *p = htonl(1); // stream end
+ p = (ULONG*)&buffer[12]; *p = htonl(0); // zero length, no more data
tcp->sendPacket(buffer, bufferLength);
}
// Construct reply packet
+ ULONG* p;
UCHAR out[52];
memset(out, 0, 52);
memcpy(out, in, 4);
// Return magic number is 0xfafebabe
- *(ULONG*)&out[4] = htonl(0xfafebabe);
+ p = (ULONG*)&out[4];
+ *p = htonl(0xfafebabe);
// Copy client IP and port to reply
memcpy(&out[16], &in[16], 6);
// Insert server address
- *(ULONG*)&out[24] = myIP;
+ p = (ULONG*)&out[24];
+ *p = myIP;
// Send it
ds.send(ds.getFromIPA(), peerPort, (char*)out, 52);
#include "recplayer.h"
+#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
+#endif
+
#include <fcntl.h>
RecPlayer::RecPlayer(cRecording* rec)
int TftpClient::sendBlock()
{
- *(USHORT*)&buffer[0] = htons(3);
- *(USHORT*)&buffer[2] = htons(blockNumber++);
+ USHORT* p;
+ p = (USHORT*)&buffer[0]; *p = htons(3);
+ p = (USHORT*)&buffer[2]; *p = htons(blockNumber++);
bufferLength = 4 + fread(&buffer[4], 1, 512, file);
if (bufferLength < 516) // 512 + 4 header
log->log("Client", Log::DEBUG, "Received chan=%lu kats=%lu", channelID, kaTimeStamp);
+ ULONG* p;
UCHAR buffer[8];
- *(ULONG*)&buffer[0] = htonl(3); // KA CHANNEL
- *(ULONG*)&buffer[4] = htonl(kaTimeStamp);
+ p = (ULONG*)&buffer[0]; *p = htonl(3); // KA CHANNEL
+ p = (ULONG*)&buffer[4]; *p = htonl(kaTimeStamp);
if (!tcp.sendPacket(buffer, 8))
{
log->log("Client", Log::ERR, "Could not send back KA reply");
result = processGetLanguageContent();
break;
case VDR_GETMEDIAINFO:
- result= processGetMediaInfo();
- break;
+ result = processGetMediaInfo();
+ break;
case VDR_CLOSECHANNEL:
- result= processCloseMediaChannel();
- break;
+ result = processCloseMediaChannel();
+ break;
case 37:
result = processSetCharset();
break;
-
}
delete resp;
int VompClientRRProc::processSetCharset()
{
- int charset = ntohl(*(ULONG*)req->data);
- if (charset>0 && charset<3) {
- log->log("RRProc", Log::DEBUG, "Set charset to %d", charset);
- x.setCharset(charset);
- resp->addULONG(1);
- } else {
- log->log("RRProc", Log::DEBUG, "Invalid charset %d", charset);
- resp->addULONG(0);
- }
+ int charset = ntohl(*(ULONG*)req->data);
+ if (charset>0 && charset<3)
+ {
+ log->log("RRProc", Log::DEBUG, "Set charset to %d", charset);
+ x.setCharset(charset);
+ resp->addULONG(1);
+ }
+ else
+ {
+ log->log("RRProc", Log::DEBUG, "Invalid charset %d", charset);
+ resp->addULONG(0);
+ }
resp->finalise();
x.tcp.sendPacket(resp->getPtr(), resp->getLen());
-
+ return 1;
}
-
-
-
int VompClientRRProc::processConfigSave()
{
char* section = (char*)req->data;