summaryrefslogtreecommitdiff
path: root/plugins/TipperYM
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-12-08 22:13:57 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-12-08 22:13:57 +0000
commit13eb83bea655c3302c74a82d826d75bceb9232a2 (patch)
treeea992cbd9002e078a06e9fe65a73698eec4fbc22 /plugins/TipperYM
parentef741fcb36d679b094e44d01714f423c34357383 (diff)
code cleanup around mir_snprintf
git-svn-id: http://svn.miranda-ng.org/main/trunk@11285 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TipperYM')
-rw-r--r--plugins/TipperYM/src/options.cpp6
-rw-r--r--plugins/TipperYM/src/skin_parser.cpp10
-rw-r--r--plugins/TipperYM/src/translations.cpp38
3 files changed, 27 insertions, 27 deletions
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp
index b9edda957c..d9afc09f7a 100644
--- a/plugins/TipperYM/src/options.cpp
+++ b/plugins/TipperYM/src/options.cpp
@@ -324,16 +324,16 @@ void LoadObsoleteSkinSetting()
for (int i = 0; i < SKIN_ITEMS_COUNT; i++)
{
- mir_snprintf(setting, 128, "SPaintMode%d", i);
+ mir_snprintf(setting, SIZEOF(setting), "SPaintMode%d", i);
opt.transfMode[i] = (TransformationMode)db_get_b(0, MODULE, setting, 0);
- mir_snprintf(setting, 128, "SImgFile%d", i);
+ mir_snprintf(setting, SIZEOF(setting), "SImgFile%d", i);
if (!db_get_ts(NULL, MODULE, setting, &dbv))
{
opt.szImgFile[i] = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
- mir_snprintf(setting, 128, "SGlyphMargins%d", i);
+ mir_snprintf(setting, SIZEOF(setting), "SGlyphMargins%d", i);
DWORD margins = db_get_dw(NULL, MODULE, setting, 0);
opt.margins[i].top = LOBYTE(LOWORD(margins));
opt.margins[i].right = HIBYTE(LOWORD(margins));
diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp
index 92bca196e0..d5db13e01d 100644
--- a/plugins/TipperYM/src/skin_parser.cpp
+++ b/plugins/TipperYM/src/skin_parser.cpp
@@ -172,15 +172,15 @@ char *GetSettingName(TCHAR *szValue, char *szPostfix, char *buff)
buff[0] = 0;
if (_tcsstr(szValue, _T("traytitle")))
- mir_snprintf(buff, 64, "FontTrayTitle%s", szPostfix);
+ mir_snprintf(buff, SIZEOF(buff), "FontTrayTitle%s", szPostfix);
else if (_tcsstr(szValue, _T("title")))
- mir_snprintf(buff, 64, "FontFirst%s", szPostfix);
+ mir_snprintf(buff, SIZEOF(buff), "FontFirst%s", szPostfix);
else if (_tcsstr(szValue, _T("label")))
- mir_snprintf(buff, 64, "FontLabels%s", szPostfix);
+ mir_snprintf(buff, SIZEOF(buff), "FontLabels%s", szPostfix);
else if (_tcsstr(szValue, _T("value")))
- mir_snprintf(buff, 64, "FontValues%s", szPostfix);
+ mir_snprintf(buff, SIZEOF(buff), "FontValues%s", szPostfix);
else if (_tcsstr(szValue, _T("divider")))
- mir_snprintf(buff, 64, "Divider%s", szPostfix);
+ mir_snprintf(buff, SIZEOF(buff), "Divider%s", szPostfix);
if (buff[0]) return buff;
else return NULL;
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp
index 4b3050ce9e..fa37d0cb99 100644
--- a/plugins/TipperYM/src/translations.cpp
+++ b/plugins/TipperYM/src/translations.cpp
@@ -247,21 +247,21 @@ TCHAR *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const cha
{
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, 256, "%sDay", prefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sDay", prefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, 256, "%sMonth", prefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sMonth", prefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
db_free(&dbv);
- mir_snprintf(szSettingName, 256, "%sYear", prefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sYear", prefix);
int year = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -295,21 +295,21 @@ TCHAR *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const char
{
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, 256, "%sDay", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sDay", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, 256, "%sMonth", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sMonth", szPrefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
db_free(&dbv);
- mir_snprintf(szSettingName, 256, "%sYear", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sYear", szPrefix);
int year = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -344,21 +344,21 @@ TCHAR *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName, co
{
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, 256, "%sHours", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sHours", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
db_free(&dbv);
- mir_snprintf(szSettingName, 256, "%sMinutes", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sMinutes", szPrefix);
int minutes = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &minutes))
{
db_free(&dbv);
- mir_snprintf(szSettingName, 256, "%sSeconds", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sSeconds", szPrefix);
int seconds = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -388,14 +388,14 @@ TCHAR *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const cha
{
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, 256, "%sHours", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sHours", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
db_free(&dbv);
- mir_snprintf(szSettingName, 256, "%sMinutes", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sMinutes", szPrefix);
int minutes = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -424,42 +424,42 @@ TCHAR *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const ch
{
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, 256, "%sDay", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sDay", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, 256, "%sMonth", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sMonth", szPrefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
db_free(&dbv);
- mir_snprintf(szSettingName, 256, "%sYear", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sYear", szPrefix);
int year = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &year))
{
db_free(&dbv);
- mir_snprintf(szSettingName, 256, "%sHours", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sHours", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
db_free(&dbv);
- mir_snprintf(szSettingName, 256, "%sMinutes", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sMinutes", szPrefix);
int minutes = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &minutes))
{
db_free(&dbv);
- mir_snprintf(szSettingName, 256, "%sSeconds", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sSeconds", szPrefix);
int seconds = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -526,14 +526,14 @@ TCHAR *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleName,
{
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, 256, "%sDay", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sDay", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, 256, "%sMonth", szPrefix);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sMonth", szPrefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{