Skip to content

Commit

Permalink
Tabs2Spaces & Whitespace Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
NTX authored and NTX committed May 12, 2012
1 parent 98f4b84 commit dab3248
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Application/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void FreezeDetector::Run()
}

Application::Application(int argc, char* argv[], const char *conf):
debug(false), control(false), daemonize(false), libLoaded(false), terminate(false),
debug(false), control(false), daemonize(false), libLoaded(false), terminate(false),
_diffTime(0)
{
gettimeofday(&_lastUpdate, 0);
Expand Down
2 changes: 1 addition & 1 deletion Application/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class Runnable
class FreezeDetector : public Runnable
{
public:
FreezeDetector(uint64 maxDiffTime, uint64& diff):
FreezeDetector(uint64 maxDiffTime, uint64& diff):
_maxDiffTime(maxDiffTime), _diff(diff), _exit(false), _pause(false), _active(false) { }

void Run();
Expand Down
8 changes: 4 additions & 4 deletions MySQL/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const char* DuplicateString(const char* _a)
return const_cast<const char*>(b);
}

Database::Database():
Database::Database():
connected(false), _host(NULL), _user(NULL), _db(NULL), _port(0), _unix_socket(NULL), _client_flag(0)
{
database = mysql_init(NULL);
Expand Down Expand Up @@ -97,14 +97,14 @@ bool Database::PExecute(const char* stmt, ...) const
QueryResult::QueryResult(MYSQL_RES* result, MYSQL_ROW row, MYSQL_FIELD* fields):
_result(result), _fields(fields)
{
num_rows = mysql_num_rows(_result);
num_fields = mysql_num_fields(_result);
num_rows = mysql_num_rows(_result);
num_fields = mysql_num_fields(_result);
_currentRow = new Field[num_fields];
_currentRowId = 0;
FillFields(row, fields);
}

QueryResult::~QueryResult()
QueryResult::~QueryResult()
{
if (_result)
{
Expand Down
12 changes: 6 additions & 6 deletions Protocol/FTP/Base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ void Init()

if (boolConfigs[CONFIG_BOOL_USE_DB_AUTH])
{
db->Connect(stringConfigs[CONFIG_STRING_DATABASE_HOST].c_str(),
stringConfigs[CONFIG_STRING_DATABASE_USERNAME].c_str(),
stringConfigs[CONFIG_STRING_DATABASE_PASSWORD].c_str(),
db->Connect(stringConfigs[CONFIG_STRING_DATABASE_HOST].c_str(),
stringConfigs[CONFIG_STRING_DATABASE_USERNAME].c_str(),
stringConfigs[CONFIG_STRING_DATABASE_PASSWORD].c_str(),
stringConfigs[CONFIG_STRING_DATABASE_NAME].c_str());
if (!db->IsConnected())
{
Expand Down Expand Up @@ -233,7 +233,7 @@ void processRecieve(in_addr /* address */, int fd, char* data)
session.password = password;
if (boolConfigs[CONFIG_BOOL_USE_DB_AUTH])
{
QueryResult* result = db->PQuery("Select * from users where username = '%s' and password = '%s'",
QueryResult* result = db->PQuery("Select * from users where username = '%s' and password = '%s'",
db->EscapeString(session.username.c_str()), db->EscapeString(session.password.c_str()));
if (!result)
{
Expand Down Expand Up @@ -313,7 +313,7 @@ void processRecieve(in_addr /* address */, int fd, char* data)
for (uint8 i = 0; i < 4; i++)
session.ip[i] = a[i];
session.ip.Restore();
//protoLog->outDebug("IP Struct: %s %d %d %d %d 0x%08x 0x%08x",
//protoLog->outDebug("IP Struct: %s %d %d %d %d 0x%08x 0x%08x",
//session.ip.ToChar(), session.ip[0], session.ip[1],session.ip[2],session.ip[3], *(int*)(&session.ip.ipB), *(int*)(&session.ip.ipI.s_addr));
session.port = a[4] * 256 + a[5];
session.isPassive = false;
Expand Down Expand Up @@ -519,7 +519,7 @@ void processRecieve(in_addr /* address */, int fd, char* data)
Files::BinFile file(address.c_str());
if (!file.is_open())
{
FTP::SendCommandResponse(sock, 450); // Not Found
FTP::SendCommandResponse(sock, 450); // Not Found
break;
}
protoLog->outDebug("Sending Requested file: %s length: %lu", address.c_str(), file.getLength());
Expand Down
2 changes: 1 addition & 1 deletion Protocol/FTP/Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


#ifdef __cplusplus
extern "C"
extern "C"
{
#endif

Expand Down
24 changes: 12 additions & 12 deletions Protocol/FTP/FTP.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,18 @@ struct SessionDataStruct

struct SessionSendStruct
{
SessionSendStruct(SessionDataStruct& sdata, Socket* sock, char* data, size_t length, const char* file = NULL):
s(sdata), so(sock), d(data), l(length)
{
if (file)
{
f = new char[strlen(file)+1];
memset(f, 0, strlen(file)+1);
memcpy(f, file, strlen(file));
}
SessionSendStruct(SessionDataStruct& sdata, Socket* sock, char* data, size_t length, const char* file = NULL):
s(sdata), so(sock), d(data), l(length)
{
if (file)
{
f = new char[strlen(file)+1];
memset(f, 0, strlen(file)+1);
memcpy(f, file, strlen(file));
}
else
f = NULL;
}
}

SessionDataStruct& s;
Socket* so;
Expand All @@ -120,7 +120,7 @@ struct SessionSendStruct

struct SessionRecvStruct
{
SessionRecvStruct(SessionDataStruct& sdata, Socket* sock, const char* fileName):
SessionRecvStruct(SessionDataStruct& sdata, Socket* sock, const char* fileName):
s(sdata), so(sock), f(new char[strlen(fileName) + 1])
{
char* fi = new char[strlen(fileName) + 1];
Expand All @@ -145,7 +145,7 @@ Database* db;
std::map<int, const char*> responseCodeMessage;

#ifdef __cplusplus
extern "C"
extern "C"
{
#endif

Expand Down
4 changes: 2 additions & 2 deletions Protocol/FTP/FileAccessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ DirectoryEntryInfo const* GetFileInfo(char* fileName)
class DirectoryInfo : public DirectoryEntryInfo
{
public:
DirectoryInfo(char* _directoryName, struct stat _dirStat):
DirectoryInfo(char* _directoryName, struct stat _dirStat):
DirectoryEntryInfo(_directoryName, _dirStat), dir(NULL), isDir(true), err(0) { }

char* GetDirectoryName() const { return entryName; }
Expand Down Expand Up @@ -89,7 +89,7 @@ class TerminalFuction // Used for manipulation output of applications ran from t
public:
TerminalFuction(string _program, string _args): program(_program), args(_args) { }
int Run() const { return system((program + " " + args).c_str()); }
char* RunWithCallback(int* returnValue = NULL) const
char* RunWithCallback(int* returnValue = NULL) const
{
int ret = 0;
stringstream call;
Expand Down
2 changes: 1 addition & 1 deletion Protocol/HTTP/Adds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ bool isWithinRootDir(string file)

if (!test.compare("..")/* == 0*/)
deep--;
else
else
deep++;
file = file.substr(file.find('/'), string::npos);
}
Expand Down
2 changes: 1 addition & 1 deletion Protocol/HTTP/Base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void LoadConfig()
intConfigs[CONFIG_INT_MAX_MAIN_THREAD_FILE_SIZE] = configMgr->LoadIntConfig("MaximalMainThreadFileSize", 40000);
if (intConfigs[CONFIG_INT_MAX_MAIN_THREAD_FILE_SIZE] <= 0)
{
protoLog->outError("MaximalMainThreadFileSize must be > 0 (configured value: %d) setting back to default 40000",
protoLog->outError("MaximalMainThreadFileSize must be > 0 (configured value: %d) setting back to default 40000",
intConfigs[CONFIG_INT_MAX_MAIN_THREAD_FILE_SIZE]);
intConfigs[CONFIG_INT_MAX_MAIN_THREAD_FILE_SIZE] = 40000;
}
Expand Down
2 changes: 1 addition & 1 deletion Protocol/HTTP/HTTP.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "ConfigMgr.cpp"

#ifdef __cplusplus
extern "C"
extern "C"
{
#endif

Expand Down
2 changes: 1 addition & 1 deletion Protocol/SMTP/Base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void processRecieve(in_addr /* address */, int fd, char* data)
}
break;
}

case SMTP_QUIT: // Client quit
app->socketMgr->CloseSocketByFd(fd);
break;
Expand Down
2 changes: 1 addition & 1 deletion Protocol/SMTP/Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


#ifdef __cplusplus
extern "C"
extern "C"
{
#endif

Expand Down
2 changes: 1 addition & 1 deletion Protocol/SMTP/SMTP.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SimpleLog* protoLog;
ConfigMgr* configMgr;

#ifdef __cplusplus
extern "C"
extern "C"
{
#endif

Expand Down
2 changes: 1 addition & 1 deletion Protocol/libdump/libdump.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "libdump.h"
#include <iostream>
using std::cout;
using std::cout;
using std::endl;

void Recieve(char* data)
Expand Down
8 changes: 4 additions & 4 deletions Threads/Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ Thread* Thread::CreateThread(CalledFunction func, void *args)

int Thread::Kill() const
{
return pthread_kill(thread, SIGKILL);
return pthread_kill(thread, SIGKILL);
}

int Thread::Terminate() const
{
return pthread_kill(thread, SIGTERM);
return pthread_kill(thread, SIGTERM);
}

int Thread::Interrupt() const
{
return pthread_kill(thread, SIGINT);
return pthread_kill(thread, SIGINT);
}

int Thread::Continue() const
{
return pthread_kill(thread, SIGCONT);
return pthread_kill(thread, SIGCONT);
}

int Thread::SendSignal(int sig)
Expand Down

0 comments on commit dab3248

Please sign in to comment.