From 13eb83bea655c3302c74a82d826d75bceb9232a2 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Mon, 8 Dec 2014 22:13:57 +0000 Subject: code cleanup around mir_snprintf git-svn-id: http://svn.miranda-ng.org/main/trunk@11285 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Nudge/src/nudge.cpp | 64 ++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'plugins/Nudge/src') diff --git a/plugins/Nudge/src/nudge.cpp b/plugins/Nudge/src/nudge.cpp index 66f8c47fbb..75dc07b063 100644 --- a/plugins/Nudge/src/nudge.cpp +++ b/plugins/Nudge/src/nudge.cpp @@ -3,55 +3,55 @@ void CNudge::Save(void) { char SectionName[512]; - mir_snprintf(SectionName, 512, "useByProtocol"); + mir_snprintf(SectionName, SIZEOF(SectionName), "useByProtocol"); db_set_b(NULL, MODULENAME, SectionName, this->useByProtocol); - mir_snprintf(SectionName, 512, "RecvTimeSec"); + mir_snprintf(SectionName, SIZEOF(SectionName), "RecvTimeSec"); db_set_dw(NULL, MODULENAME, SectionName, this->recvTimeSec); - mir_snprintf(SectionName, 512, "SendTimeSec"); + mir_snprintf(SectionName, SIZEOF(SectionName), "SendTimeSec"); db_set_dw(NULL, MODULENAME, SectionName, this->sendTimeSec); - mir_snprintf(SectionName, 512, "ResendDelaySec"); + mir_snprintf(SectionName, SIZEOF(SectionName), "ResendDelaySec"); db_set_dw(NULL, MODULENAME, SectionName, this->resendDelaySec); } void CNudge::Load(void) { char SectionName[512]; - mir_snprintf(SectionName, 512, "useByProtocol"); + mir_snprintf(SectionName, SIZEOF(SectionName), "useByProtocol"); this->useByProtocol = db_get_b(NULL, MODULENAME, SectionName, FALSE) != 0; - mir_snprintf(SectionName, 512, "RecvTimeSec"); + mir_snprintf(SectionName, SIZEOF(SectionName), "RecvTimeSec"); this->recvTimeSec = db_get_dw(NULL, MODULENAME, SectionName, 30); - mir_snprintf(SectionName, 512, "SendTimeSec"); + mir_snprintf(SectionName, SIZEOF(SectionName), "SendTimeSec"); this->sendTimeSec = db_get_dw(NULL, MODULENAME, SectionName, 30); - mir_snprintf(SectionName, 512, "ResendDelaySec"); + mir_snprintf(SectionName, SIZEOF(SectionName), "ResendDelaySec"); this->resendDelaySec = db_get_dw(NULL, MODULENAME, SectionName, 3); } void CNudgeElement::Save(void) { char SectionName[512]; - mir_snprintf(SectionName, 512, "%s-openMessageWindow", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-openMessageWindow", ProtocolName); db_set_b(NULL, MODULENAME, SectionName, this->openMessageWindow); - mir_snprintf(SectionName, 512, "%s-openContactList", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-openContactList", ProtocolName); db_set_b(NULL, MODULENAME, SectionName, this->openContactList); - mir_snprintf(SectionName, 512, "%s-useIgnore", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-useIgnore", ProtocolName); db_set_b(NULL, MODULENAME, SectionName, this->useIgnoreSettings); - mir_snprintf(SectionName, 512, "%s-showStatus", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-showStatus", ProtocolName); db_set_b(NULL, MODULENAME, SectionName, this->showStatus); - mir_snprintf(SectionName, 512, "%s-showPopup", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-showPopup", ProtocolName); db_set_b(NULL, MODULENAME, SectionName, this->showPopup); - mir_snprintf(SectionName, 512, "%s-shakeClist", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-shakeClist", ProtocolName); db_set_b(NULL, MODULENAME, SectionName, this->shakeClist); - mir_snprintf(SectionName, 512, "%s-shakeChat", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-shakeChat", ProtocolName); db_set_b(NULL, MODULENAME, SectionName, this->shakeChat); - mir_snprintf(SectionName, 512, "%s-enabled", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-enabled", ProtocolName); db_set_b(NULL, MODULENAME, SectionName, this->enabled); - mir_snprintf(SectionName, 512, "%s-autoResend", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-autoResend", ProtocolName); db_set_b(NULL, MODULENAME, SectionName, this->autoResend); - mir_snprintf(SectionName, 512, "%s-statusFlags", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-statusFlags", ProtocolName); db_set_dw(NULL, MODULENAME, SectionName, this->statusFlags); - mir_snprintf(SectionName, 512, "%s-recText", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-recText", ProtocolName); db_set_ts(NULL, MODULENAME, SectionName, this->recText); - mir_snprintf(SectionName, 512, "%s-senText", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-senText", ProtocolName); db_set_ts(NULL, MODULENAME, SectionName, this->senText); } @@ -59,28 +59,28 @@ void CNudgeElement::Load(void) { DBVARIANT dbv; char SectionName[512]; - mir_snprintf(SectionName, 512, "%s-openMessageWindow", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-openMessageWindow", ProtocolName); this->openMessageWindow = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0; - mir_snprintf(SectionName, 512, "%s-openContactList", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-openContactList", ProtocolName); this->openContactList = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0; - mir_snprintf(SectionName, 512, "%s-useIgnore", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-useIgnore", ProtocolName); this->useIgnoreSettings = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0; - mir_snprintf(SectionName, 512, "%s-showStatus", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-showStatus", ProtocolName); this->showStatus = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0; - mir_snprintf(SectionName, 512, "%s-showPopup", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-showPopup", ProtocolName); this->showPopup = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0; - mir_snprintf(SectionName, 512, "%s-shakeClist", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-shakeClist", ProtocolName); this->shakeClist = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0; - mir_snprintf(SectionName, 512, "%s-shakeChat", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-shakeChat", ProtocolName); this->shakeChat = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0; - mir_snprintf(SectionName, 512, "%s-enabled", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-enabled", ProtocolName); this->enabled = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0; - mir_snprintf(SectionName, 512, "%s-autoResend", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-autoResend", ProtocolName); this->autoResend = db_get_b(NULL, MODULENAME, SectionName, FALSE) != 0; - mir_snprintf(SectionName, 512, "%s-statusFlags", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-statusFlags", ProtocolName); this->statusFlags = db_get_dw(NULL, MODULENAME, SectionName, 967); - mir_snprintf(SectionName,512,"%s-recText", ProtocolName); + mir_snprintf(SectionName,SIZEOF(SectionName),"%s-recText", ProtocolName); if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) { _tcsncpy(this->recText, dbv.ptszVal, TEXT_LEN); if (_tcsclen(this->recText) < 1) @@ -89,7 +89,7 @@ void CNudgeElement::Load(void) } else _tcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN); - mir_snprintf(SectionName, 512, "%s-senText", ProtocolName); + mir_snprintf(SectionName, SIZEOF(SectionName), "%s-senText", ProtocolName); if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) { _tcsncpy(this->senText, dbv.ptszVal, TEXT_LEN); if (_tcsclen(this->senText) < 1) -- cgit v1.2.3