Skip to content

Commit

Permalink
replaced all the __u8, __u16, __u32 etc types with stdint verstions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Captnoord committed Aug 16, 2014
1 parent 8d3b639 commit 3fd5bd0
Show file tree
Hide file tree
Showing 33 changed files with 332 additions and 324 deletions.
11 changes: 5 additions & 6 deletions lib/base/buffer.cpp
Expand Up @@ -17,7 +17,7 @@ void eIOBuffer::removeblock()
eIOBuffer::eIOBufferData &eIOBuffer::addblock()
{
eIOBufferData s;
s.data=new __u8[allocationsize];
s.data=new uint8_t[allocationsize];
s.len=0;
buffer.push_back(s);
return buffer.back();
Expand Down Expand Up @@ -50,7 +50,7 @@ int eIOBuffer::empty() const

int eIOBuffer::peek(void *dest, int len) const
{
__u8 *dst=(__u8*)dest;
uint8_t *dst=(uint8_t*)dest;
std::list<eIOBufferData>::const_iterator i(buffer.begin());
int p=ptr;
int written=0;
Expand Down Expand Up @@ -92,15 +92,15 @@ void eIOBuffer::skip(int len)

int eIOBuffer::read(void *dest, int len)
{
__u8 *dst=(__u8*)dest;
uint8_t *dst=(uint8_t*)dest;
len=peek(dst, len);
skip(len);
return len;
}

void eIOBuffer::write(const void *source, int len)
{
const __u8 *src=(const __u8*)source;
const uint8_t *src=(const uint8_t*)source;
while (len)
{
int tc=len;
Expand Down Expand Up @@ -147,7 +147,6 @@ int eIOBuffer::fromfile(int fd, int len)
int eIOBuffer::tofile(int fd, int len)
{
int written=0;
int w;
while (len && !buffer.empty())
{
if (buffer.begin() == buffer.end())
Expand All @@ -156,7 +155,7 @@ int eIOBuffer::tofile(int fd, int len)
if (tc > len)
tc = len;

w=::write(fd, buffer.front().data+ptr, tc);
int w=::write(fd, buffer.front().data+ptr, tc);
if (w < 0)
{
if (errno != EWOULDBLOCK && errno != EBUSY && errno != EINTR)
Expand Down
2 changes: 1 addition & 1 deletion lib/base/buffer.h
Expand Up @@ -12,7 +12,7 @@ class eIOBuffer
int allocationsize;
struct eIOBufferData
{
__u8 *data;
uint8_t *data;
int len;
};
std::list<eIOBufferData> buffer;
Expand Down
7 changes: 4 additions & 3 deletions lib/base/freesatv2.cpp
Expand Up @@ -38,9 +38,10 @@ GNU General Public License for more details.
static void loadFile(huffTableEntry **table, const char *filename);


struct huffTableEntry {
__u32 value;
__u16 bits;
struct huffTableEntry
{
uint32_t value;
uint16_t bits;
char next;
huffTableEntry * nextEntry;

Expand Down
2 changes: 1 addition & 1 deletion lib/driver/rc.cpp
Expand Up @@ -58,7 +58,7 @@ eRCDriver::~eRCDriver()

void eRCShortDriver::keyPressed(int)
{
__u16 rccode;
uint16_t rccode;
while (1)
{
if (read(handle, &rccode, 2)!=2)
Expand Down
12 changes: 6 additions & 6 deletions lib/dvb/demux.cpp
Expand Up @@ -169,7 +169,7 @@ RESULT eDVBDemux::connectEvent(const Slot1<void,int> &event, ePtr<eConnection> &

void eDVBSectionReader::data(int)
{
__u8 data[4096]; // max. section size
uint8_t data[4096]; // max. section size
int r;
r = ::read(fd, data, 4096);
if(r < 0)
Expand Down Expand Up @@ -270,7 +270,7 @@ RESULT eDVBSectionReader::stop()
return 0;
}

RESULT eDVBSectionReader::connectRead(const Slot1<void,const __u8*> &r, ePtr<eConnection> &conn)
RESULT eDVBSectionReader::connectRead(const Slot1<void,const uint8_t*> &r, ePtr<eConnection> &conn)
{
conn = new eConnection(this, read.connect(r));
return 0;
Expand All @@ -280,7 +280,7 @@ void eDVBPESReader::data(int)
{
while (1)
{
__u8 buffer[16384];
uint8_t buffer[16384];
int r;
r = ::read(m_fd, buffer, 16384);
if (!r)
Expand Down Expand Up @@ -372,7 +372,7 @@ RESULT eDVBPESReader::stop()
return 0;
}

RESULT eDVBPESReader::connectRead(const Slot2<void,const __u8*,int> &r, ePtr<eConnection> &conn)
RESULT eDVBPESReader::connectRead(const Slot2<void,const uint8_t*,int> &r, ePtr<eConnection> &conn)
{
conn = new eConnection(this, m_read.connect(r));
return 0;
Expand Down Expand Up @@ -862,7 +862,7 @@ RESULT eDVBTSRecorder::connectEvent(const Slot1<void,int> &event, ePtr<eConnecti
RESULT eDVBTSRecorder::startPID(int pid)
{
while(true) {
__u16 p = pid;
uint16_t p = pid;
if (::ioctl(m_source_fd, DMX_ADD_PID, &p) < 0) {
perror("DMX_ADD_PID");
if (errno == EAGAIN || errno == EINTR) {
Expand All @@ -881,7 +881,7 @@ void eDVBTSRecorder::stopPID(int pid)
if (m_pids[pid] != -1)
{
while(true) {
__u16 p = pid;
uint16_t p = pid;
if (::ioctl(m_source_fd, DMX_REMOVE_PID, &p) < 0) {
perror("DMX_REMOVE_PID");
if (errno == EAGAIN || errno == EINTR) {
Expand Down
8 changes: 4 additions & 4 deletions lib/dvb/demux.h
Expand Up @@ -55,7 +55,7 @@ class eDVBSectionReader: public iDVBSectionReader, public Object
{
DECLARE_REF(eDVBSectionReader);
int fd;
Signal1<void, const __u8*> read;
Signal1<void, const uint8_t*> read;
ePtr<eDVBDemux> demux;
int active;
int checkcrc;
Expand All @@ -67,14 +67,14 @@ class eDVBSectionReader: public iDVBSectionReader, public Object
RESULT setBufferSize(int size);
RESULT start(const eDVBSectionFilterMask &mask);
RESULT stop();
RESULT connectRead(const Slot1<void,const __u8*> &read, ePtr<eConnection> &conn);
RESULT connectRead(const Slot1<void,const uint8_t*> &read, ePtr<eConnection> &conn);
};

class eDVBPESReader: public iDVBPESReader, public Object
{
DECLARE_REF(eDVBPESReader);
int m_fd;
Signal2<void, const __u8*, int> m_read;
Signal2<void, const uint8_t*, int> m_read;
ePtr<eDVBDemux> m_demux;
int m_active;
void data(int);
Expand All @@ -85,7 +85,7 @@ class eDVBPESReader: public iDVBPESReader, public Object
RESULT setBufferSize(int size);
RESULT start(int pid);
RESULT stop();
RESULT connectRead(const Slot2<void,const __u8*, int> &read, ePtr<eConnection> &conn);
RESULT connectRead(const Slot2<void,const uint8_t*, int> &read, ePtr<eConnection> &conn);
};

class eDVBRecordFileThread: public eFilePushThreadRecorder
Expand Down
4 changes: 2 additions & 2 deletions lib/dvb/dvbtime.cpp
Expand Up @@ -67,7 +67,7 @@ time_t getRTC()
return rtc_time != prev_time ? rtc_time : 0;
}

time_t parseDVBtime(__u8 t1, __u8 t2, __u8 t3, __u8 t4, __u8 t5, __u16 *hash)
time_t parseDVBtime(uint8_t t1, uint8_t t2, uint8_t t3, uint8_t t4, uint8_t t5, uint16_t *hash)
{
tm t;
t.tm_sec=fromBCD(t5);
Expand Down Expand Up @@ -109,7 +109,7 @@ void TDT::ready(int error)
eDVBLocalTimeHandler::getInstance()->updateTime(error, chan, ++update_count);
}

int TDT::createTable(unsigned int nr, const __u8 *data, unsigned int max)
int TDT::createTable(unsigned int nr, const uint8_t *data, unsigned int max)
{
if ( data && (data[0] == 0x70 || data[0] == 0x73 ))
{
Expand Down

0 comments on commit 3fd5bd0

Please sign in to comment.