--- a/PacketWriter.cpp
+++ b/PacketWriter.cpp
@@ -11,7 +11,9 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
-} PacketWriter::PacketWriter (char *hostname, int port)
+};
+
+PacketWriter::PacketWriter (char *hostname, int port)
{
unsigned int size;
unsigned int fd;
--- a/build
+++ b/build
@@ -4,7 +4,7 @@
#
rm -rf .moc .obj Makefile
-find -name *~ -exec rm -f {} \;
+find -name '*~' -exec rm -f {} \;
rm -f *.o
qmake-qt4 -project .ui
--- a/include/PacketParser.h
+++ b/include/PacketParser.h
@@ -17,7 +17,9 @@
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <netinet/ip_icmp.h>
-} class PacketParser:public PacketReader {
+};
+
+class PacketParser:public PacketReader {
public:
PacketParser (int tm = 500);
PacketParser (std::string);
--- a/include/PacketReader.h
+++ b/include/PacketReader.h
@@ -33,5 +33,4 @@
bool ready ();
bool dataAvailable ();
};
-
#endif
--- a/include/PacketWriter.h
+++ b/include/PacketWriter.h
@@ -4,7 +4,8 @@
*/
#ifndef PACKETWRITER_H
-#define PACKETWRITER_H 0x20053008
+#define PACKETWRITER_H
+
#include <PacketReader.h>
#include <sys/socket.h>
--- a/include/monitor.h
+++ b/include/monitor.h
@@ -28,7 +28,6 @@
public slots:virtual void startCapture ();
virtual void stopCapture ();
-
};
#endif
--- a/include/readerthread.h
+++ b/include/readerthread.h
@@ -18,15 +18,15 @@
class DataChangeEvent:public QEvent {
public:
DataChangeEvent (QString msg_)
- :QEvent ((QEvent::Type) MSG_EVENT) {
+ : QEvent ((QEvent::Type) MSG_EVENT) {
msg = msg_;
- }
+ };
QString Text () const {
return msg;
- }
+ };
private:
- QString msg;
+ QString msg;
};
class readerThread:public QThread {
@@ -36,5 +36,4 @@
private:
Monitor * handle;
};
-
#endif
--- a/include/tools.h
+++ b/include/tools.h
@@ -9,5 +9,4 @@
#include <sstream>
std::string itoa (const int &i);
-
#endif
--- a/main.cpp
+++ b/main.cpp
@@ -4,6 +4,7 @@
*/
#include <QApplication>
+#include <cstdlib>
#include "include/monitor.h"
#include <version.h>
--- a/monitor.cpp
+++ b/monitor.cpp
@@ -49,8 +49,7 @@
try {
reader = new readerThread (this);
- }
- catch (std::exception const &e) {
+ } catch (std::exception const &e) {
textEdit->append (e.what ());
reader = NULL;
}
--- a/readerthread.cpp
+++ b/readerthread.cpp
@@ -32,8 +32,7 @@
}
}
}
- }
- catch (std::exception const &e) {
+ } catch (std::exception const &e) {
dce = new DataChangeEvent (e.what ());
QApplication::postEvent ((QObject *) handle, (QEvent *) dce);
std::cerr << e.what () << std::endl;