summaryrefslogtreecommitdiff
path: root/protocols/Xfire/src/variables.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-08-11 13:33:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-08-11 13:33:42 +0000
commit85bd008c039eb1d93894e94fba9d158a42a71a12 (patch)
tree2d72d10759f6928e9e4b960175d2de01b5cf7e12 /protocols/Xfire/src/variables.cpp
parent222802c2986dcaf029fdfb828b7679bdabfa7bb2 (diff)
massive code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@14910 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Xfire/src/variables.cpp')
-rw-r--r--protocols/Xfire/src/variables.cpp63
1 files changed, 27 insertions, 36 deletions
diff --git a/protocols/Xfire/src/variables.cpp b/protocols/Xfire/src/variables.cpp
index e77c4e22b2..e3b7eabedc 100644
--- a/protocols/Xfire/src/variables.cpp
+++ b/protocols/Xfire/src/variables.cpp
@@ -2,7 +2,6 @@
#include "stdafx.h"
#include "variables.h"
-#include <string>
extern HANDLE XFireWorkingFolder, XFireIconFolder, XFireAvatarFolder;
@@ -13,16 +12,13 @@ char* Varxfiregame(ARGUMENTSINFO *ai)
if (ai->cbSize < sizeof(ARGUMENTSINFO))
return NULL;
- if (ai->fi->hContact == NULL)
- {
+ if (ai->fi->hContact == NULL) {
//
}
- else
- {
+ else {
char temp[256];
DBVARIANT dbv3;
- if (!db_get(ai->fi->hContact, protocolname, "RGame", &dbv3))
- {
+ if (!db_get(ai->fi->hContact, protocolname, "RGame", &dbv3)) {
strncpy(temp, dbv3.pszVal, 255);
db_free(&dbv3);
return mir_strdup(temp);
@@ -39,8 +35,7 @@ char* Varmyxfiregame(ARGUMENTSINFO *ai)
return NULL;
DBVARIANT dbv3;
- if (!db_get(NULL, protocolname, "currentgamename", &dbv3))
- {
+ if (!db_get(NULL, protocolname, "currentgamename", &dbv3)) {
char* ret = mir_strdup(dbv3.pszVal);
db_free(&dbv3);
return ret;
@@ -55,8 +50,7 @@ char* Varxfirevoice(ARGUMENTSINFO *ai)
return NULL;
DBVARIANT dbv3;
- if (!db_get(ai->fi->hContact, protocolname, "RVoice", &dbv3))
- {
+ if (!db_get(ai->fi->hContact, protocolname, "RVoice", &dbv3)) {
char* ret = mir_strdup(dbv3.pszVal);
db_free(&dbv3);
return ret;
@@ -67,13 +61,13 @@ char* Varxfirevoice(ARGUMENTSINFO *ai)
}
-char* Varmyxfirevoiceip(ARGUMENTSINFO *ai) {
+char* Varmyxfirevoiceip(ARGUMENTSINFO *ai)
+{
if (ai->cbSize < sizeof(ARGUMENTSINFO))
return NULL;
DBVARIANT dbv3;
- if (!db_get(NULL, protocolname, "VServerIP", &dbv3))
- {
+ if (!db_get(NULL, protocolname, "VServerIP", &dbv3)) {
char* ret = mir_strdup(dbv3.pszVal);
db_free(&dbv3);
return ret;
@@ -83,13 +77,13 @@ char* Varmyxfirevoiceip(ARGUMENTSINFO *ai) {
return mir_strdup("");
}
-char* Varmyxfireserverip(ARGUMENTSINFO *ai) {
+char* Varmyxfireserverip(ARGUMENTSINFO *ai)
+{
if (ai->cbSize < sizeof(ARGUMENTSINFO))
return NULL;
DBVARIANT dbv3;
- if (!db_get(NULL, protocolname, "ServerIP", &dbv3))
- {
+ if (!db_get(NULL, protocolname, "ServerIP", &dbv3)) {
char* ret = mir_strdup(dbv3.pszVal);
db_free(&dbv3);
return ret;
@@ -99,15 +93,15 @@ char* Varmyxfireserverip(ARGUMENTSINFO *ai) {
return mir_strdup("");
}
-char* Varxfireserverip(ARGUMENTSINFO *ai) {
+char* Varxfireserverip(ARGUMENTSINFO *ai)
+{
if (ai->cbSize < sizeof(ARGUMENTSINFO))
return NULL;
if (ai->fi->hContact != NULL) {
char temp[24];
DBVARIANT dbv3;
- if (!db_get(ai->fi->hContact, protocolname, "ServerIP", &dbv3))
- {
+ if (!db_get(ai->fi->hContact, protocolname, "ServerIP", &dbv3)) {
mir_snprintf(temp, _countof(temp), "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "Port", 0));
db_free(&dbv3);
return mir_strdup(temp);
@@ -118,21 +112,19 @@ char* Varxfireserverip(ARGUMENTSINFO *ai) {
return mir_strdup("");
}
-char* Varxfirevoiceip(ARGUMENTSINFO *ai) {
+char* Varxfirevoiceip(ARGUMENTSINFO *ai)
+{
if (ai->cbSize < sizeof(ARGUMENTSINFO))
return NULL;
- if (ai->fi->hContact == NULL)
- {
+ if (ai->fi->hContact == NULL) {
ai->flags = AIF_FALSE;
return mir_strdup("");
}
- else
- {
+ else {
char temp[24];
DBVARIANT dbv3;
- if (!db_get(ai->fi->hContact, protocolname, "VServerIP", &dbv3))
- {
+ if (!db_get(ai->fi->hContact, protocolname, "VServerIP", &dbv3)) {
mir_snprintf(temp, _countof(temp), "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "VPort", 0));
db_free(&dbv3);
return mir_strdup(temp);
@@ -148,8 +140,7 @@ char* Varmyxfirevoice(ARGUMENTSINFO *ai)
return NULL;
DBVARIANT dbv3;
- if (!db_get(NULL, protocolname, "currentvoicename", &dbv3))
- {
+ if (!db_get(NULL, protocolname, "currentvoicename", &dbv3)) {
char* ret = mir_strdup(dbv3.pszVal);
db_free(&dbv3);
return ret;
@@ -161,14 +152,14 @@ char* Varmyxfirevoice(ARGUMENTSINFO *ai)
char* XFireGetFoldersPath(char * pathtype)
{// Get XFire folder path
static char path[1024]; path[0] = 0;
- if (ServiceExists(MS_FOLDERS_REGISTER_PATH)){
- if (!mir_strcmp(pathtype, "Avatar")){
+ if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) {
+ if (!mir_strcmp(pathtype, "Avatar")) {
FoldersGetCustomPath(XFireAvatarFolder, path, 1024, "");
}
- if (!mir_strcmp(pathtype, "IniFile")){
+ if (!mir_strcmp(pathtype, "IniFile")) {
FoldersGetCustomPath(XFireWorkingFolder, path, 1024, "");
}
- if (!mir_strcmp(pathtype, "IconsFile")){
+ if (!mir_strcmp(pathtype, "IconsFile")) {
FoldersGetCustomPath(XFireIconFolder, path, 1024, "");
}
mir_strcat(path, "\\");
@@ -183,8 +174,8 @@ char* XFireGetFoldersPath(char * pathtype)
mir_strcat(BaseFolder, "\\");
CallService(MS_DB_GETPROFILENAME, (WPARAM)MAX_PATH, (LPARAM)CurProfileF);
int i;
- for (i = MAX_PATH - 1; i > 5; i--){
- if (CurProfileF[i] == 't' && CurProfileF[i - 3] == '.'){
+ for (i = MAX_PATH - 1; i > 5; i--) {
+ if (CurProfileF[i] == 't' && CurProfileF[i - 3] == '.') {
i -= 3;
break;
}
@@ -195,7 +186,7 @@ char* XFireGetFoldersPath(char * pathtype)
mir_strcat(BaseFolder, "XFire");
mir_strcat(BaseFolder, "\\");
/*******BASE********/
- if (!mir_strcmp(pathtype, "Avatar")){
+ if (!mir_strcmp(pathtype, "Avatar")) {
mir_strcat(BaseFolder, "Avatars");
mir_strcat(BaseFolder, "\\");
}