remove unneeded struct type specifier from sizeof.
authorSteven Hoving <stevenhoving@gmail.com>
Sat, 24 Oct 2015 12:39:29 +0000 (14:39 +0200)
committerErik Slagter <erik@openpli.org>
Fri, 30 Oct 2015 09:36:13 +0000 (10:36 +0100)
This seems to be a leftover from back in the days when everything was
written in C.

(cherry picked from commit 5004ac31144dac3c652605a73ceb2d9676df41ab)
Signed-off-by: Erik Slagter <erik@openpli.org>

lib/driver/rc.cpp
lib/dvb/decoder.cpp
lib/dvb/demux.cpp
lib/dvb/demux.h
lib/service/servicedvd.cpp

index 597aed0..068d273 100644 (file)
@@ -94,7 +94,7 @@ void eRCInputEventDriver::keyPressed(int)
        struct input_event ev;
        while (1)
        {
-               if (read(handle, &ev, sizeof(struct input_event))!=sizeof(struct input_event))
+               if (read(handle, &ev, sizeof(input_event))!=sizeof(input_event))
                        break;
                if (enabled && !input->islocked())
                        for (std::list<eRCDevice*>::iterator i(listeners.begin()); i!=listeners.end(); ++i)
index e194cc3..366764e 100644 (file)
@@ -1201,7 +1201,7 @@ RESULT eTSMPEGDecoder::showSinglePic(const char *filename)
                                unsigned char iframe[s.st_size];
                                unsigned char stuffing[8192];
                                int streamtype;
-                               memset(stuffing, 0, 8192);
+                               memset(stuffing, 0, sizeof(stuffing));
                                read(f, iframe, s.st_size);
                                if (iframe[0] == 0x00 && iframe[1] == 0x00 && iframe[2] == 0x00 && iframe[3] == 0x01 && (iframe[4] & 0x0f) == 0x07)
                                        streamtype = VIDEO_STREAMTYPE_MPEG4_H264;
index f88b46b..aa00287 100644 (file)
@@ -496,7 +496,7 @@ int eDVBRecordFileThread::AsyncIO::poll()
 
 int eDVBRecordFileThread::AsyncIO::start(int fd, off_t offset, size_t nbytes, void* buffer)
 {
-       memset(&aio, 0, sizeof(struct aiocb)); // Documentation says "zero it before call".
+       memset(&aio, 0, sizeof(aiocb)); // Documentation says "zero it before call".
        aio.aio_fildes = fd;
        aio.aio_nbytes = nbytes;
        aio.aio_offset = offset;   // Offset can be omitted with O_APPEND
index 64d6c83..9c7bacb 100644 (file)
@@ -111,7 +111,7 @@ protected:
                unsigned char* buffer;
                AsyncIO()
                {
-                       memset(&aio, 0, sizeof(struct aiocb));
+                       memset(&aio, 0, sizeof(aiocb));
                        buffer = NULL;
                }
                int wait();
index 9efe9c1..a9c7ce2 100644 (file)
@@ -363,7 +363,7 @@ void eServiceDVD::gotMessage(int /*what*/)
                                m_event(this, evUser + 8); // chapterUpdated
                        if ( info.pos_title != last_info.pos_title )
                                m_event(this, evUser + 9); // titleUpdated
-                       memcpy(&last_info, &info, sizeof(struct ddvd_time));
+                       memcpy(&last_info, &info, sizeof(last_info));
                        break;
                }
                case DDVD_SHOWOSD_TITLESTRING:
@@ -1055,7 +1055,7 @@ void eServiceDVD::loadCuesheet()
                if (fread(&where, sizeof(where), 1, f))
                        if (fread(&what, sizeof(what), 1, f))
                                if (ntohl(what) == 3)
-                                       if (fread(&m_resume_info, sizeof(struct ddvd_resume), 1, f))
+                                       if (fread(&m_resume_info, sizeof(m_resume_info), 1, f))
                                                if (fread(&what, sizeof(what), 1, f))
                                                        if (ntohl(what) == 4)
                                                                m_cue_pts = be64toh(where);
@@ -1166,7 +1166,7 @@ void eServiceDVD::saveCuesheet()
                what = htonl(3);
                fwrite(&what, sizeof(what), 1, f);
 
-               fwrite(&resume_info, sizeof(struct ddvd_resume), 1, f);
+               fwrite(&resume_info, sizeof(resume_info), 1, f);
                what = htonl(4);
                fwrite(&what, sizeof(what), 1, f);