diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 04:50:22 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 04:50:22 +0000 |
commit | 41a7300678e4bb3cd703e2c236e57af4a31962c7 (patch) | |
tree | 36318f807498cf15b405eda5c451fd37bfe1b675 /plugins/HTTPServer | |
parent | 97e0ada5c34d6e7eba1cf47a8d8ac029197be6de (diff) |
mir_snprintf(..., sizeof() -> SIZEOF(), ...)
small fixs cleanups
git-svn-id: http://svn.miranda-ng.org/main/trunk@11188 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/HTTPServer')
-rw-r--r-- | plugins/HTTPServer/src/GuiElements.cpp | 18 | ||||
-rw-r--r-- | plugins/HTTPServer/src/HttpUser.cpp | 10 | ||||
-rw-r--r-- | plugins/HTTPServer/src/main.cpp | 2 |
3 files changed, 15 insertions, 15 deletions
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index e6e656197d..53334e5b9b 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -201,7 +201,7 @@ unsigned long GetExternIP(const char *szURL, const char *szPattern) { string sCreateLink(const char * pszSrvPath) {
char szTemp[30];
string sLink = DBGetString(NULL, MODULE, "ExternalSrvName", szDefaultExternalSrvName);
- mir_snprintf(szTemp, sizeof(szTemp), "%d.%d.%d.%d", SplitIpAddress(dwLocalIpAddress));
+ mir_snprintf(szTemp, SIZEOF(szTemp), "%d.%d.%d.%d", SplitIpAddress(dwLocalIpAddress));
ReplaceAll(sLink, "%LocalIP%", szTemp);
if (sLink.find("%ExternalIP%") != sLink.npos) {
@@ -214,11 +214,11 @@ string sCreateLink(const char * pszSrvPath) { dwExternalIpAddressGenerated = GetTickCount();
}
- mir_snprintf(szTemp, sizeof(szTemp), "%d.%d.%d.%d", SplitIpAddress(dwExternalIpAddress));
+ mir_snprintf(szTemp, SIZEOF(szTemp), "%d.%d.%d.%d", SplitIpAddress(dwExternalIpAddress));
ReplaceAll(sLink, "%ExternalIP%", szTemp);
}
- mir_snprintf(szTemp, sizeof(szTemp), "%d", dwLocalPortUsed, szTemp);
+ mir_snprintf(szTemp, SIZEOF(szTemp), "%d", dwLocalPortUsed, szTemp);
ReplaceAll(sLink, "%Port%", szTemp);
string sSrvPath = pszSrvPath;
@@ -463,7 +463,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) { DWORD dwError = CommDlgExtendedError();
if (dwError) {
char szTemp[200];
- mir_snprintf(szTemp, sizeof(szTemp), "Failed to create File Open dialog the error returned was %d", dwError);
+ mir_snprintf(szTemp, SIZEOF(szTemp), "Failed to create File Open dialog the error returned was %d", dwError);
MessageBox(NULL, szTemp, MSG_BOX_TITEL, MB_OK);
}
return false;
@@ -560,7 +560,7 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) { ListView_InsertItem(hShareList, &sItem);
- mir_snprintf(szTmp, sizeof(szTmp), "%d", pclCur->st.nMaxDownloads);
+ mir_snprintf(szTmp, SIZEOF(szTmp), "%d", pclCur->st.nMaxDownloads);
sItem.iSubItem = 1;
sItem.pszText = szTmp;
ListView_SetItem(hShareList, &sItem);
@@ -600,7 +600,7 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) { ListView_SetItem(hUserList, &sItem);
if (pclCurUser->dwTotalSize) {
- mir_snprintf(szTmp, sizeof(szTmp), "%d %%", (pclCurUser->dwCurrentDL * 100) / pclCurUser->dwTotalSize);
+ mir_snprintf(szTmp, SIZEOF(szTmp), "%d %%", (pclCurUser->dwCurrentDL * 100) / pclCurUser->dwTotalSize);
} else {
strcpy(szTmp, "? %%");
}
@@ -612,9 +612,9 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) { if (dwSpeed > 10000) {
dwSpeed += 512; // make sure we round ot down correctly.
dwSpeed /= 1024;
- mir_snprintf(szTmp, sizeof(szTmp), "%d KB/Sec", dwSpeed);
+ mir_snprintf(szTmp, SIZEOF(szTmp), "%d KB/Sec", dwSpeed);
} else {
- mir_snprintf(szTmp, sizeof(szTmp), "%d B/Sec", dwSpeed);
+ mir_snprintf(szTmp, SIZEOF(szTmp), "%d B/Sec", dwSpeed);
}
sItem.iSubItem = 4;
sItem.pszText = szTmp;
@@ -1218,7 +1218,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP GetDlgItemText(hwndDlg, IDC_PAGE_KEYWORD, szKeyWord, SIZEOF(szKeyWord));
DWORD dwExternalIP = GetExternIP(szUrl, szKeyWord);
- mir_snprintf(szKeyWord, sizeof(szKeyWord), Translate("Your external IP was detected as %d.%d.%d.%d\r\nby: %s") ,
+ mir_snprintf(szKeyWord, SIZEOF(szKeyWord), Translate("Your external IP was detected as %d.%d.%d.%d\r\nby: %s") ,
SplitIpAddress(dwExternalIP) ,
szUrl);
MessageBox(hwndDlg, szKeyWord, MSG_BOX_TITEL, MB_OK);
diff --git a/plugins/HTTPServer/src/HttpUser.cpp b/plugins/HTTPServer/src/HttpUser.cpp index 428a5cb087..ee196fbcb5 100644 --- a/plugins/HTTPServer/src/HttpUser.cpp +++ b/plugins/HTTPServer/src/HttpUser.cpp @@ -231,7 +231,7 @@ void CLHttpUser::SendError(int iErrorCode, const char * pszError, const char * p pszDescription = pszError;
char szBuf[1000];
- DWORD dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf),
+ DWORD dwBytesToWrite = mir_snprintf(szBuf, SIZEOF(szBuf),
"HTTP/1.1 %i %s\r\n"
"Date: %s\r\n"
"Server: MirandaWeb/%s\r\n"
@@ -281,7 +281,7 @@ void CLHttpUser::SendRedir(int iErrorCode, const char * pszError, const char * p pszDescription = pszError;
char szBuff[1000];
- DWORD dwBytesToWrite = mir_snprintf(szBuff, sizeof(szBuff),
+ DWORD dwBytesToWrite = mir_snprintf(szBuff, SIZEOF(szBuff),
"HTTP/1.1 %i %s\r\n"
"Date: %s\r\n"
"Server: MirandaWeb/%s\r\n"
@@ -546,7 +546,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { char szETag[ 50 ];
{
- int nETagLen = mir_snprintf(szETag, sizeof(szETag), "\"%x-%x-%x\"",
+ int nETagLen = mir_snprintf(szETag, SIZEOF(szETag), "\"%x-%x-%x\"",
nDataSize, stFileTime.dwHighDateTime, stFileTime.dwLowDateTime);
if (!apszParam[eIfRange] || (strncmp(szETag, apszParam[eIfRange], nETagLen) == 0)) {
@@ -616,7 +616,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { "Last-Modified: %s\r\n"
"\r\n";
- dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf), szHttpPartial,
+ dwBytesToWrite = mir_snprintf(szBuf, SIZEOF(szBuf), szHttpPartial,
szCurTime,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
szETag,
@@ -638,7 +638,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { "Last-Modified: %s\r\n"
"\r\n";
- dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf), szHttpOk,
+ dwBytesToWrite = mir_snprintf(szBuf, SIZEOF(szBuf), szHttpOk,
szCurTime,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
szETag,
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index 11c1350bc8..5c289bbb75 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -345,7 +345,7 @@ bool bWriteConfigurationFile() { } else {
CLFileShareNode * pclCur = pclFirstNode;
while (pclCur) {
- DWORD dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf), szXmlData ,
+ DWORD dwBytesToWrite = mir_snprintf(szBuf, SIZEOF(szBuf), szXmlData ,
pclCur->st.pszSrvPath,
pclCur->pszOrigRealPath,
pclCur->st.nMaxDownloads,
|