diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-15 15:34:59 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-15 15:34:59 +0300 |
commit | b572f4308e640ea46e9381ff642bed2950ffa888 (patch) | |
tree | e083208223c0be2138d88c055ef14659446af4a5 /plugins | |
parent | 44b60862c97e5ec855d2bacd4d15f81f7ae7f410 (diff) |
warning fixes
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp | 16 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp | 80 | ||||
-rw-r--r-- | plugins/YAMN/src/services.cpp | 2 |
3 files changed, 46 insertions, 52 deletions
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index c6fa31e5ff..5c90624aaa 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -532,9 +532,6 @@ int CExImContactXML::LoadXmlElemnt(TiXmlElement *xContact) LPCSTR pUID = xContact->Attribute("uidv");
if (pUID != nullptr) {
- size_t valLen;
- PBYTE pbVal = nullptr;
-
switch (*(pUID++)) {
case 'b':
uid((BYTE)atoi(pUID));
@@ -553,9 +550,12 @@ int CExImContactXML::LoadXmlElemnt(TiXmlElement *xContact) uidu(pUID);
break;
case 'n':
- pbVal = (PBYTE)mir_base64_decode(pUID, &valLen);
- if (pbVal != nullptr)
- uidn(pbVal, valLen);
+ size_t valLen;
+ {
+ PBYTE pbVal = (PBYTE)mir_base64_decode(pUID, &valLen);
+ if (pbVal != nullptr)
+ uidn(pbVal, (DWORD)valLen);
+ }
break;
default:
uidu((LPCSTR)nullptr);
@@ -888,7 +888,7 @@ int CExImContactXML::ImportSetting(LPCSTR pszModule, TiXmlElement *xmlEntry) dbv.type = DBVT_BLOB;
dbv.pbVal = (PBYTE)mir_base64_decode(value + 1, &baselen);
if (dbv.pbVal != nullptr)
- dbv.cpbVal = baselen;
+ dbv.cpbVal = (WORD)baselen;
else {
mir_free(dbv.pbVal);
return ERROR_NOT_ADDED;
@@ -952,7 +952,7 @@ int CExImContactXML::ImportEvent(LPCSTR pszModule, TiXmlElement *xmlEvent) if (tmpVal != NULL) {
// event owning module
dbei.pBlob = tmpVal;
- dbei.cbBlob = baselen;
+ dbei.cbBlob = (WORD)baselen;
dbei.szModule = (LPSTR)pszModule;
xmlEvent->Attribute("type", (LPINT)&dbei.eventType);
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp index 8c55ff4aae..1b7b7b3a76 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImINI.cpp @@ -39,61 +39,55 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. **/ static void ExportModule(MCONTACT hContact, LPCSTR pszModule, FILE* file) { - DB::CEnumList Settings; - - if (!Settings.EnumSettings(hContact, pszModule)) - { - DBVARIANT dbv; - LPSTR here; - WORD j; - int i; - //char tmp[32]; + DB::CEnumList Settings; + if (!Settings.EnumSettings(hContact, pszModule)) { // print the module header.. fprintf(file, "\n[%s]\n", pszModule); for (auto &it : Settings) { + DBVARIANT dbv; if (!DB::Setting::GetAsIs(hContact, pszModule, it, &dbv)) { switch (dbv.type) { - case DBVT_BYTE: - fprintf(file, "%s=b%u\n", it, dbv.bVal); - break; + case DBVT_BYTE: + fprintf(file, "%s=b%u\n", it, dbv.bVal); + break; - case DBVT_WORD: - fprintf(file, "%s=w%u\n", it, dbv.wVal); - break; + case DBVT_WORD: + fprintf(file, "%s=w%u\n", it, dbv.wVal); + break; - case DBVT_DWORD: - fprintf(file, "%s=d%u\n", it, dbv.dVal); - break; + case DBVT_DWORD: + fprintf(file, "%s=d%u\n", it, dbv.dVal); + break; - case DBVT_ASCIIZ: - case DBVT_UTF8: - for (here = dbv.pszVal; here && *here; here++) - { - switch (*here) { - // convert \r to STX - case '\r': - *here = 2; - break; - - // convert \n to ETX - case '\n': - *here = 3; - } + case DBVT_ASCIIZ: + case DBVT_UTF8: + for (LPSTR here = dbv.pszVal; here && *here; here++) { + switch (*here) { + // convert \r to STX + case '\r': + *here = 2; + break; + + // convert \n to ETX + case '\n': + *here = 3; } - if (dbv.type == DBVT_UTF8) - fprintf(file, "%s=u%s\n", it, dbv.pszVal); - else - fprintf(file, "%s=s%s\n", it, dbv.pszVal); - break; + } + + if (dbv.type == DBVT_UTF8) + fprintf(file, "%s=u%s\n", it, dbv.pszVal); + else + fprintf(file, "%s=s%s\n", it, dbv.pszVal); + break; - case DBVT_BLOB: - fprintf(file, "%s=n", it); - for (j = 0; j < dbv.cpbVal; j++) - fprintf(file, "%02X ", (BYTE)dbv.pbVal[j]); - fputc('\n', file); - break; + case DBVT_BLOB: + fprintf(file, "%s=n", it); + for (WORD j = 0; j < dbv.cpbVal; j++) + fprintf(file, "%02X ", (BYTE)dbv.pbVal[j]); + fputc('\n', file); + break; } db_free(&dbv); } diff --git a/plugins/YAMN/src/services.cpp b/plugins/YAMN/src/services.cpp index 56c7477213..c667d3df4a 100644 --- a/plugins/YAMN/src/services.cpp +++ b/plugins/YAMN/src/services.cpp @@ -148,7 +148,7 @@ static INT_PTR AccountMailCheck(WPARAM wParam, LPARAM lParam) DebugLog(SynchroFile, "ForceCheck:ActualAccountSO-read enter\n");
#endif
if ((ActualAccount->Flags & YAMN_ACC_ENA) && ActualAccount->Plugin->Fcn->SynchroFcnPtr) {
- struct CheckParam ParamToPlugin = {YAMN_CHECKVERSION, ThreadRunningEV, ActualAccount, lParam?YAMN_FORCECHECK:YAMN_NORMALCHECK, nullptr, nullptr};
+ CheckParam ParamToPlugin = { YAMN_CHECKVERSION, ThreadRunningEV, ActualAccount, lParam ? YAMN_FORCECHECK : YAMN_NORMALCHECK, nullptr, nullptr };
ActualAccount->TimeLeft = ActualAccount->Interval;
DWORD tid;
|