]> git.tdb.fi Git - libs/core.git/commitdiff
Further style fixes
authorMikko Rasa <tdb@tdb.fi>
Sat, 11 Jun 2011 10:41:25 +0000 (13:41 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 11 Jun 2011 11:44:21 +0000 (14:44 +0300)
Header updates

source/io/buffered.cpp
source/io/poll.cpp
source/io/poll.h
source/io/serial.cpp

index f72522361b1d013d8f79d21fedefff910d0b1c1c..5dbd49463fc2666a39019036c4882231b73b653d 100644 (file)
@@ -40,7 +40,7 @@ void Buffered::flush()
                {
                        unsigned len = below.write(begin, used);
 
-                       begin=end = buf;
+                       begin = end = buf;
 
                        if(len<used)
                                throw runtime_error("Couldn't flush all data");
index a0ccf84a4c07fcf5c601edf8eac6f943241c1245..d610665161b16f47cb20a8480beb3859eb62bbbd 100644 (file)
@@ -1,7 +1,7 @@
-#include <errno.h>
+#include <cerrno>
 #include <stdexcept>
 #include <msp/core/systemerror.h>
-#include <msp/strings/formatter.h>
+#include <msp/strings/format.h>
 #include <msp/time/units.h>
 #include "base.h"
 #include "poll.h"
@@ -37,8 +37,7 @@ inline PollEvent poll_event_from_sys(int event)
        PollEvent result = P_NONE;
 
 #ifdef WIN32
-       // Stop the compiler from complaining about unused parameter
-       event = event;
+       (void)event;
 #else
        if(event&POLLIN)
                result = result|P_INPUT;
@@ -67,7 +66,7 @@ inline PollEvent do_poll(Base &obj, PollEvent pe, int timeout)
 
        return P_NONE;
 #else
-       pollfd pfd = {obj.get_event_handle(), sys_poll_event(pe), 0};
+       pollfd pfd = { obj.get_event_handle(), sys_poll_event(pe), 0 };
 
        int ret = ::poll(&pfd, 1, timeout);
        if(ret==-1)
@@ -84,6 +83,7 @@ inline PollEvent do_poll(Base &obj, PollEvent pe, int timeout)
 
 }
 
+
 namespace Msp {
 namespace IO {
 
index 6367d8f2b301544f26953220284868d7658b22fb..595237474c706acd35d9fdc48aa186d65225b7de 100644 (file)
@@ -61,15 +61,16 @@ private:
        bool pfd_dirty;
        SlotSeq poll_result;
 
-       void rebuild_pfd();
-       int do_poll(int);
-
 public:
        Poller();
 
        void set_object(Base &, PollEvent);
        int poll();
        int poll(const Time::TimeDelta &);
+private:
+       void rebuild_pfd();
+       int do_poll(int);
+public:
        const SlotSeq &get_result() const { return poll_result; }
 };
 
index dbfee955f9ae85b954daf1ff11c9c689c8476d92..5d5871ef74f1f85855e75fb228a6b4e7e8149b68 100644 (file)
@@ -5,8 +5,8 @@
 #include <fcntl.h>
 #include <errno.h>
 #endif
+#include <msp/strings/format.h>
 #include <msp/core/systemerror.h>
-#include <msp/strings/formatter.h>
 #include "serial.h"
 
 using namespace std;