diff options
author | George Hazan <george.hazan@gmail.com> | 2015-08-28 16:22:41 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-08-28 16:22:41 +0000 |
commit | c370af60855db957c5b200914bf0bde743845528 (patch) | |
tree | 0bd2ef127097c9e937c2650e8b202c3f09453323 /plugins/NotesAndReminders/src | |
parent | 7f082bd5d4865c30b313661b7a02f048b4b137be (diff) |
mir_sntprintf / mir_snprintf: obsoleted second parameter removed wherever possible
git-svn-id: http://svn.miranda-ng.org/main/trunk@15064 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NotesAndReminders/src')
-rw-r--r-- | plugins/NotesAndReminders/src/notes.cpp | 8 | ||||
-rw-r--r-- | plugins/NotesAndReminders/src/reminders.cpp | 62 |
2 files changed, 35 insertions, 35 deletions
diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp index 8ad6753abf..b017f04e94 100644 --- a/plugins/NotesAndReminders/src/notes.cpp +++ b/plugins/NotesAndReminders/src/notes.cpp @@ -381,7 +381,7 @@ void LoadNotes(BOOL bIsStartup) { char *DelPos; - mir_snprintf(ValueName, _countof(ValueName), "NotesData%d", I); + mir_snprintf(ValueName, "NotesData%d", I); if (Value) { @@ -694,7 +694,7 @@ void PurgeNotes(void) NotesCount = db_get_dw(0,MODULENAME,"NotesData",0); for(I = 0; I < NotesCount; I++) { - mir_snprintf(ValueName, _countof(ValueName), "NotesData%d", I); + mir_snprintf(ValueName, "NotesData%d", I); db_unset(0,MODULENAME,ValueName); } } @@ -940,7 +940,7 @@ static void JustSaveNotesEx(STICKYNOTE *pModified) Value[0xffff] = 0; } - mir_snprintf(ValueName, _countof(ValueName), "NotesData%d", NotesCount - I - 1); // we do not reverse notes in DB + mir_snprintf(ValueName, "NotesData%d", NotesCount - I - 1); // we do not reverse notes in DB db_set_blob(0, MODULENAME, ValueName, Value, n+1); @@ -956,7 +956,7 @@ static void JustSaveNotesEx(STICKYNOTE *pModified) // delete any left over DB note entries for(; I < OldNotesCount; I++) { - mir_snprintf(ValueName, _countof(ValueName), "NotesData%d", I); + mir_snprintf(ValueName, "NotesData%d", I); db_unset(0,MODULENAME,ValueName); } diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index 8e4238cff7..e356728c4a 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -215,7 +215,7 @@ void PurgeReminders(void) ReminderCount = db_get_dw(0,MODULENAME,"RemindersData",0);
for(I = 0;I < ReminderCount;I++)
{
- mir_snprintf(ValueName, _countof(ValueName), "RemindersData%d", I);
+ mir_snprintf(ValueName, "RemindersData%d", I);
db_unset(0, MODULENAME, ValueName);
}
}
@@ -287,7 +287,7 @@ void JustSaveReminders(void) Value[0xffff] = 0;
}
- mir_snprintf(ValueName, _countof(ValueName), "RemindersData%d", ReminderCount - I - 1); // do not want to reverse in DB
+ mir_snprintf(ValueName, "RemindersData%d", ReminderCount - I - 1); // do not want to reverse in DB
db_set_blob(0, MODULENAME, ValueName, Value, n+1);
@@ -297,7 +297,7 @@ void JustSaveReminders(void) // delete any left over DB reminder entries
for(; I < OldReminderCount; I++)
{
- mir_snprintf(ValueName, _countof(ValueName), "RemindersData%d", I);
+ mir_snprintf(ValueName, "RemindersData%d", I);
db_unset(0, MODULENAME, ValueName);
}
}
@@ -317,7 +317,7 @@ void LoadReminders(void) {
Size = 65535;
Value = NULL;
- mir_snprintf(ValueName, _countof(ValueName), "RemindersData%d", I);
+ mir_snprintf(ValueName, "RemindersData%d", I);
ReadSettingBlob(0, MODULENAME, ValueName, &Size, (void**)&Value);
@@ -607,7 +607,7 @@ INT_PTR OpenTriggeredReminder(WPARAM w, LPARAM l) pReminder->handle = H = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_NOTIFYREMINDER), 0, DlgProcNotifyReminder);
- mir_snprintf(S, _countof(S), "%s! - %s", Translate("Reminder"), S1);
+ mir_snprintf(S, "%s! - %s", Translate("Reminder"), S1);
SetWindowText(H, S);
if (pReminder->Reminder)
@@ -642,7 +642,7 @@ static void SkinPlaySoundPoly(LPCSTR pszSoundName) char szShort[MAX_PATH];
char s[512];
GetShortPathNameA(szFull, szShort, sizeof(szShort));
- mir_snprintf(s, _countof(s), "play \"%s\"", szShort);
+ mir_snprintf(s, "play \"%s\"", szShort);
mciSendStringA(s, NULL, 0, NULL);
}
@@ -1055,7 +1055,7 @@ static void PopulateTimeCombo(HWND Dialog, UINT nIDTime, BOOL bRelative, const S const int m = (i&1) ? 30 : 0;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
+ mir_snprintf(s, "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
// item data contains time offset from midnight in seconds (bit 31 is set to flag that
// combo box items are absolute times and not relative times like below
@@ -1086,35 +1086,35 @@ static void PopulateTimeCombo(HWND Dialog, UINT nIDTime, BOOL bRelative, const S FileTimeToTzLocalST((FILETIME*)&li, &tm2);
wCurHour = tm2.wHour;
wCurMinute = tm2.wMinute;
- mir_snprintf(s, _countof(s), "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
+ mir_snprintf(s, "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 5 minutes
li.QuadPart += (ULONGLONG)5 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d (5 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (5 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 10 minutes
li.QuadPart += (ULONGLONG)5 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d (10 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (10 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 15 minutes
li.QuadPart += (ULONGLONG)5 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d (15 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (15 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 30 minutes
li.QuadPart += (ULONGLONG)15 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d (30 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (30 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
@@ -1142,13 +1142,13 @@ static void PopulateTimeCombo(HWND Dialog, UINT nIDTime, BOOL bRelative, const S }
// icq-style display 1.0, 1.5 etc. hours even though that isn't accurate due to rounding
- //mir_snprintf(s, _countof(s), "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, 1+(i>>1), (i&1) ? 5 : 0, lpszHours);
+ //mir_snprintf(s, "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, 1+(i>>1), (i&1) ? 5 : 0, lpszHours);
// display delta time more accurately to match reformatting (that icq doesn't do)
dt = (UINT)((li.QuadPart/MinutesToFileTime) - (ref/MinutesToFileTime));
if (dt < 60)
- mir_snprintf(s, _countof(s), "%02d:%02d (%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt, lpszMinutes);
else
- mir_snprintf(s, _countof(s), "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt/60, ((dt%60)*10)/60, lpszHours);
+ mir_snprintf(s, "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt/60, ((dt%60)*10)/60, lpszHours);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDTime,CB_SETITEMDATA,n, dt*60);
@@ -1179,39 +1179,39 @@ static void PopulateTimeOffsetCombo(HWND Dialog, UINT nIDCombo) // 5 - 55 minutes (in 5 minute steps)
for (i = 1; i < 12; i++)
{
- mir_snprintf(s, _countof(s), "%d %s", i*5, lpszMinutes);
+ mir_snprintf(s, "%d %s", i*5, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, i*5);
}
// 1 hour
- mir_snprintf(s, _countof(s), "1 %s", lpszHour);
+ mir_snprintf(s, "1 %s", lpszHour);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, 60);
// 2, 4, 8 hours
for (i = 2; i <= 8; i+=2)
{
- mir_snprintf(s, _countof(s), "%d %s", i, lpszHours);
+ mir_snprintf(s, "%d %s", i, lpszHours);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, i*60);
}
// 1 day
- mir_snprintf(s, _countof(s), "1 %s", lpszDay);
+ mir_snprintf(s, "1 %s", lpszDay);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, 24*60);
// 2-4 days
for (i = 2; i <= 4; i++)
{
- mir_snprintf(s, _countof(s), "%d %s", i, lpszDays);
+ mir_snprintf(s, "%d %s", i, lpszDays);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, i*24*60);
}
// 1 week
- mir_snprintf(s, _countof(s), "1 %s", lpszWeek);
+ mir_snprintf(s, "1 %s", lpszWeek);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, 7*24*60);
}
@@ -1570,7 +1570,7 @@ INT_PTR CALLBACK DlgProcNotifyReminder(HWND Dialog,UINT Message,WPARAM wParam,LP // which could potentially mess up things otherwise)
{
char s[32];
- mir_snprintf(s, _countof(s), "%I64x", li.QuadPart);
+ mir_snprintf(s, "%I64x", li.QuadPart);
SetDlgItemText(Dialog, IDC_REFTIME, s);
}
@@ -1915,7 +1915,7 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA // which could potentially mess up things otherwise)
{
char s[32];
- mir_snprintf(s, _countof(s), "%I64x", li.QuadPart);
+ mir_snprintf(s, "%I64x", li.QuadPart);
SetDlgItemText(Dialog, IDC_REFTIME, s);
}
@@ -1938,7 +1938,7 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA {
int n;
char s[32];
- mir_snprintf(s, _countof(s), "%02d:%02d", (UINT)tm.wHour, (UINT)tm.wMinute);
+ mir_snprintf(s, "%02d:%02d", (UINT)tm.wHour, (UINT)tm.wMinute);
// search for preset first
n = SendDlgItemMessage(Dialog, IDC_TIME, CB_FINDSTRING, (WPARAM)-1, (LPARAM)s);
@@ -1966,33 +1966,33 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA n = SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_ADDSTRING, 0, (LPARAM)Translate("Never"));
SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_SETITEMDATA, n, 0);
- mir_snprintf(s, _countof(s), "%s 5 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 5 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND, CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)5);
- mir_snprintf(s, _countof(s), "%s 10 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 10 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)10);
- mir_snprintf(s, _countof(s), "%s 15 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 15 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)15);
- mir_snprintf(s, _countof(s), "%s 20 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 20 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)20);
- mir_snprintf(s, _countof(s), "%s 30 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 30 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)30);
- mir_snprintf(s, _countof(s), "%s 60 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 60 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)60);
if (NewReminderVisible == 2 && pEditReminder->RepeatSound)
{
- mir_snprintf(s, _countof(s), "%s %d %s", lpszEvery, pEditReminder->RepeatSound, lpszSeconds);
+ mir_snprintf(s, "%s %d %s", lpszEvery, pEditReminder->RepeatSound, lpszSeconds);
SetDlgItemText(Dialog, IDC_COMBO_REPEATSND, s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETCURSEL, SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)s), 0);
}
|