summaryrefslogtreecommitdiff
path: root/plugins/TipperYM/src/translations.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
commit4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch)
tree9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /plugins/TipperYM/src/translations.cpp
parentf0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (diff)
SIZEOF replaced with more secure analog - _countof
git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TipperYM/src/translations.cpp')
-rw-r--r--plugins/TipperYM/src/translations.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp
index e492d4bbf8..d888abc7a0 100644
--- a/plugins/TipperYM/src/translations.cpp
+++ b/plugins/TipperYM/src/translations.cpp
@@ -233,21 +233,21 @@ TCHAR *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const cha
{
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sDay", prefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sDay", prefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sMonth", prefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sMonth", prefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
db_free(&dbv);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sYear", prefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sYear", prefix);
int year = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -281,21 +281,21 @@ TCHAR *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const char
{
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sDay", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sDay", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sMonth", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sMonth", szPrefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
db_free(&dbv);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sYear", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sYear", szPrefix);
int year = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -330,21 +330,21 @@ TCHAR *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName, co
{
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sHours", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sHours", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
db_free(&dbv);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sMinutes", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sMinutes", szPrefix);
int minutes = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &minutes))
{
db_free(&dbv);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sSeconds", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sSeconds", szPrefix);
int seconds = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -374,14 +374,14 @@ TCHAR *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const cha
{
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sHours", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sHours", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
db_free(&dbv);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sMinutes", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sMinutes", szPrefix);
int minutes = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -410,42 +410,42 @@ TCHAR *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const ch
{
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sDay", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sDay", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sMonth", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sMonth", szPrefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
db_free(&dbv);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sYear", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sYear", szPrefix);
int year = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &year))
{
db_free(&dbv);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sHours", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sHours", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
db_free(&dbv);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sMinutes", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sMinutes", szPrefix);
int minutes = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &minutes))
{
db_free(&dbv);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sSeconds", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sSeconds", szPrefix);
int seconds = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -512,14 +512,14 @@ TCHAR *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleName,
{
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sDay", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sDay", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sMonth", szPrefix);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%sMonth", szPrefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -657,7 +657,7 @@ TCHAR *ByteToLanguage(MCONTACT hContact, const char *szModuleName, const char *s
int iLang = db_get_b(hContact, szModuleName, szSettingName, 0);
if (iLang)
{
- for (int i = 0; i < SIZEOF(languages); i++)
+ for (int i = 0; i < _countof(languages); i++)
{
if (iLang == languages[i].id)
{
@@ -711,7 +711,7 @@ static DBVTranslation internalTranslations[] =
void InitTranslations()
{
dwNextFuncId = db_get_dw(0, MODULE_ITEMS, "NextFuncId", 1);
- for (int i = 0; i < SIZEOF(internalTranslations); i++)
+ for (int i = 0; i < _countof(internalTranslations); i++)
AddTranslation(&internalTranslations[i]);
hServiceAdd = CreateServiceFunction(MS_TIPPER_ADDTRANSLATION, ServiceAddTranslation);