avoid ARRAYSIZE macro
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | #include "OptionDlg.h" |
| 2 | 2 | |
| 3 | +#include <array> | |
| 3 | 4 | #include <shlwapi.h> |
| 4 | 5 | #if defined(_MSC_VER) |
| 5 | 6 | #pragma comment(lib, "shlwapi.lib") |
| @@ -37,14 +38,11 @@ | ||
| 37 | 38 | HANDLE Handle; |
| 38 | 39 | FindFileHandle(HANDLE handle) |
| 39 | 40 | :Handle(handle) |
| 40 | - { | |
| 41 | - } | |
| 41 | + {} | |
| 42 | 42 | ~FindFileHandle() |
| 43 | 43 | { |
| 44 | 44 | if(Handle != INVALID_HANDLE_VALUE) |
| 45 | - { | |
| 46 | 45 | FindClose(Handle); |
| 47 | - } | |
| 48 | 46 | } |
| 49 | 47 | }; |
| 50 | 48 |
| @@ -86,10 +84,10 @@ | ||
| 86 | 84 | StrRsc::g_StrResource->GetLocalStr(SectionName,RS_CANCEL).c_str()); |
| 87 | 85 | |
| 88 | 86 | // ロケール設定 |
| 89 | - TCHAR exePath[MAX_PATH]; | |
| 90 | - GetModuleFileName(NULL, exePath, ARRAYSIZE(exePath)); | |
| 87 | + std::array<TCHAR, MAX_PATH> exePath; | |
| 88 | + GetModuleFileName(NULL, exePath.data(), std::tuple_size<decltype(exePath)>::value); | |
| 91 | 89 | |
| 92 | - const tstring langDir = ExtractFilePath(exePath) + TEXT("Plugins\\StrRsc\\Language\\"); | |
| 90 | + const tstring langDir = ExtractFilePath(exePath.data()) + TEXT("Plugins\\StrRsc\\Language\\"); | |
| 93 | 91 | |
| 94 | 92 | DirectoryList localeList; |
| 95 | 93 |
| @@ -2,6 +2,7 @@ | ||
| 2 | 2 | |
| 3 | 3 | #include <algorithm> |
| 4 | 4 | #include <vector> |
| 5 | +#include <array> | |
| 5 | 6 | #include <windows.h> |
| 6 | 7 | #include <shlwapi.h> |
| 7 | 8 | #if defined(_MSC_VER) |
| @@ -71,10 +72,10 @@ | ||
| 71 | 72 | |
| 72 | 73 | void StrRscMain::RegisterIniFile(const tstring &pluginName) |
| 73 | 74 | { |
| 74 | - TCHAR exePath[MAX_PATH]; | |
| 75 | - GetModuleFileName(NULL, exePath, ARRAYSIZE(exePath)); | |
| 75 | + std::array<TCHAR, MAX_PATH> exePath; | |
| 76 | + GetModuleFileName(NULL, exePath.data(), std::tuple_size<decltype(exePath)>::value); | |
| 76 | 77 | |
| 77 | - const tstring filePath = ExtractFilePath(exePath) | |
| 78 | + const tstring filePath = ExtractFilePath(exePath.data()) | |
| 78 | 79 | + TEXT("Plugins\\StrRsc\\Language\\") |
| 79 | 80 | + Config.Locale + TEXT('\\') |
| 80 | 81 | + pluginName + TEXT(".txt"); |
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | #include "StrRscConfig.h" |
| 2 | 2 | |
| 3 | +#include <array> | |
| 3 | 4 | #include <windows.h> |
| 4 | 5 | #include <shlwapi.h> |
| 5 | 6 | #if defined(_MSC_VER) |
| @@ -23,9 +24,9 @@ | ||
| 23 | 24 | if(!PathFileExists(fileName.c_str())) |
| 24 | 25 | return; |
| 25 | 26 | |
| 26 | - TCHAR buff[MAX_PATH]; | |
| 27 | - GetPrivateProfileString(SectionName,KeyName,Locale.c_str(),buff,ARRAYSIZE(buff),fileName.c_str()); | |
| 28 | - Locale = buff; | |
| 27 | + std::array<TCHAR, MAX_PATH> buff; | |
| 28 | + GetPrivateProfileString(SectionName,KeyName,Locale.c_str(),buff.data(),std::tuple_size<decltype(buff)>::value,fileName.c_str()); | |
| 29 | + Locale = buff.data(); | |
| 29 | 30 | } |
| 30 | 31 | |
| 31 | 32 | // StrRsc.iniにLocaleの書込み |
| @@ -25,7 +25,7 @@ | ||
| 25 | 25 | ProfManMain g_profManMain; |
| 26 | 26 | |
| 27 | 27 | const char passSeed[] = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; |
| 28 | - const int passSeedCount = ARRAYSIZE(passSeed) -1; | |
| 28 | + const std::size_t passSeedCount = std::extent<decltype(passSeed)>::value - 1; | |
| 29 | 29 | |
| 30 | 30 | std::string EncodePassword(const std::string &str) |
| 31 | 31 | { |
| @@ -171,13 +171,13 @@ | ||
| 171 | 171 | if(!PathFileExists(fileName.c_str())) |
| 172 | 172 | return; |
| 173 | 173 | |
| 174 | - TCHAR buff[1024] = {0}; | |
| 174 | + std::array<TCHAR, 1024> buff = {}; | |
| 175 | 175 | |
| 176 | - GetPrivateProfileSectionNames(buff, ARRAYSIZE(buff), fileName.c_str()); | |
| 176 | + GetPrivateProfileSectionNames(buff.data(), std::tuple_size<decltype(buff)>::value, fileName.c_str()); | |
| 177 | 177 | |
| 178 | 178 | std::vector<tstring> sections; |
| 179 | 179 | |
| 180 | - TCHAR *buffIt = buff; | |
| 180 | + TCHAR *buffIt = buff.data(); | |
| 181 | 181 | for(tstring tmp = buffIt; tmp.size(); tmp = buffIt) |
| 182 | 182 | { |
| 183 | 183 | sections.push_back(tmp); |
| @@ -191,28 +191,28 @@ | ||
| 191 | 191 | ProfileListSub prof(new Profile()); |
| 192 | 192 | Profiles.push_back(prof); |
| 193 | 193 | |
| 194 | - GetPrivateProfileString(it->c_str(), NULL, NULL, buff, ARRAYSIZE(buff), fileName.c_str()); | |
| 194 | + GetPrivateProfileString(it->c_str(), NULL, NULL, buff.data(), std::tuple_size<decltype(buff)>::value, fileName.c_str()); | |
| 195 | 195 | |
| 196 | - buffIt = buff; | |
| 196 | + buffIt = buff.data(); | |
| 197 | 197 | for(tstring key = buffIt; key.size(); key = buffIt) |
| 198 | 198 | { |
| 199 | - TCHAR buff2[1024]; | |
| 200 | - GetPrivateProfileString(it->c_str(), key.c_str(), L"", buff2, ARRAYSIZE(buff2), fileName.c_str()); | |
| 199 | + std::array<TCHAR, 1024> buff2; | |
| 200 | + GetPrivateProfileString(it->c_str(), key.c_str(), L"", buff2.data(), std::tuple_size<decltype(buff2)>::value, fileName.c_str()); | |
| 201 | 201 | |
| 202 | 202 | if(*it == KeyName::ProfileName) |
| 203 | - prof->ProfileName = buff2; | |
| 203 | + prof->ProfileName = buff2.data(); | |
| 204 | 204 | else if(*it == KeyName::Account) |
| 205 | - prof->Account = buff2; | |
| 205 | + prof->Account = buff2.data(); | |
| 206 | 206 | else if(*it == KeyName::Password) |
| 207 | - prof->Password = DecodePassword(buff2); | |
| 207 | + prof->Password = DecodePassword(buff2.data()); | |
| 208 | 208 | else if(*it == KeyName::Protocol) |
| 209 | - prof->Protocol = buff2; | |
| 209 | + prof->Protocol = buff2.data(); | |
| 210 | 210 | else if(*it == KeyName::Name) |
| 211 | - prof->Name = buff2; | |
| 211 | + prof->Name = buff2.data(); | |
| 212 | 212 | else if(*it == KeyName::Status) |
| 213 | 213 | prof->Status = GetPrivateProfileInt(it->c_str(), key.c_str(), 0, fileName.c_str()); |
| 214 | 214 | else |
| 215 | - prof->Specific[key] = buff2; | |
| 215 | + prof->Specific[key] = buff2.data(); | |
| 216 | 216 | |
| 217 | 217 | buffIt += key.size() + 1; |
| 218 | 218 | } |
| @@ -25,51 +25,51 @@ | ||
| 25 | 25 | const LPCTSTR OptionDlg::KeyName::PlaceToStoreReceivedFile = TEXT("PlaceToStoreReceivedFile"); |
| 26 | 26 | const LPCTSTR OptionDlg::KeyName::SelectFilePath = TEXT("SelectFilePath"); |
| 27 | 27 | |
| 28 | - INT_PTR OptionDlg::ShowOptionDialog(const HWND parent) const | |
| 28 | + INT_PTR OptionDlg::ShowOptionDialog(HWND parent) const | |
| 29 | 29 | { |
| 30 | - return DialogBoxParam(g_hInstance,MAKEINTRESOURCE(IDD_OPTION),parent,DialogFunc,reinterpret_cast<LPARAM>(this)); | |
| 30 | + return DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_OPTION), parent, DialogFunc, reinterpret_cast<LPARAM>(this)); | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - void OptionDlg::OnInitDialog(const HWND hDialog) const | |
| 33 | + void OptionDlg::OnInitDialog(HWND hDialog) const | |
| 34 | 34 | { |
| 35 | - SetWindowText(hDialog,StrRsc::g_StrResource->GetLocalStr(SectionName, KeyName::DialogCaption).c_str()); | |
| 35 | + SetWindowText(hDialog, StrRsc::g_StrResource->GetLocalStr(SectionName, KeyName::DialogCaption).c_str()); | |
| 36 | 36 | |
| 37 | - SetDlgItemText(hDialog,IDC_LABEL100, | |
| 37 | + SetDlgItemText(hDialog, IDC_LABEL100, | |
| 38 | 38 | StrRsc::g_StrResource->GetLocalStr(SectionName, KeyName::PlaceToStoreReceivedFile).c_str()); |
| 39 | 39 | |
| 40 | - SetDlgItemText(hDialog,IDOK, | |
| 40 | + SetDlgItemText(hDialog, IDOK, | |
| 41 | 41 | StrRsc::g_StrResource->GetLocalStr(SectionName, KeyName::Ok).c_str()); |
| 42 | 42 | |
| 43 | - SetDlgItemText(hDialog,IDCANCEL, | |
| 43 | + SetDlgItemText(hDialog, IDCANCEL, | |
| 44 | 44 | StrRsc::g_StrResource->GetLocalStr(SectionName, KeyName::Cancel).c_str()); |
| 45 | 45 | |
| 46 | 46 | //-- |
| 47 | 47 | |
| 48 | - SetDlgItemText(hDialog,IDC_EDTRCVDIR,FileDir.c_str()); | |
| 48 | + SetDlgItemText(hDialog, IDC_EDTRCVDIR, FileDir.c_str()); | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - void OptionDlg::OnEndDialog(const HWND hDialog, const DWORD modalResult) | |
| 51 | + void OptionDlg::OnEndDialog(HWND hDialog, DWORD modalResult) | |
| 52 | 52 | { |
| 53 | 53 | if(modalResult == IDOK) |
| 54 | 54 | { |
| 55 | 55 | LRESULT len = SendDlgItemMessage(hDialog, IDC_EDTRCVDIR, WM_GETTEXTLENGTH, 0, 0); |
| 56 | 56 | |
| 57 | - std::vector<TCHAR> fileDir(len+1); | |
| 57 | + std::vector<TCHAR> fileDir(len + 1); | |
| 58 | 58 | |
| 59 | - SendDlgItemMessage(hDialog, IDC_EDTRCVDIR, WM_GETTEXT, fileDir.size(), reinterpret_cast<LPARAM>(&fileDir[0])); | |
| 60 | - FileDir = &fileDir[0]; | |
| 59 | + SendDlgItemMessage(hDialog, IDC_EDTRCVDIR, WM_GETTEXT, fileDir.size(), reinterpret_cast<LPARAM>(fileDir.data())); | |
| 60 | + FileDir = fileDir.data(); | |
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - INT_PTR CALLBACK OptionDlg::DialogFunc(const HWND hDialog, const UINT message, const WPARAM wParam, const LPARAM lParam) | |
| 64 | + INT_PTR CALLBACK OptionDlg::DialogFunc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam) | |
| 65 | 65 | { |
| 66 | 66 | OptionDlg *const dlg = (message != WM_INITDIALOG) ? |
| 67 | - reinterpret_cast<OptionDlg*>(GetWindowLongPtr(hDialog,GWLP_USERDATA)) : reinterpret_cast<OptionDlg*>(lParam); | |
| 67 | + reinterpret_cast<OptionDlg*>(GetWindowLongPtr(hDialog, GWLP_USERDATA)) : reinterpret_cast<OptionDlg*>(lParam); | |
| 68 | 68 | |
| 69 | 69 | switch(message) |
| 70 | 70 | { |
| 71 | 71 | case WM_INITDIALOG: |
| 72 | - SetWindowLongPtr(hDialog,GWLP_USERDATA,lParam); | |
| 72 | + SetWindowLongPtr(hDialog, GWLP_USERDATA, lParam); | |
| 73 | 73 | dlg->OnInitDialog(hDialog); |
| 74 | 74 | return TRUE; |
| 75 | 75 | case WM_COMMAND: |
| @@ -82,24 +82,24 @@ | ||
| 82 | 82 | EndDialog(hDialog, id); |
| 83 | 83 | return TRUE; |
| 84 | 84 | case IDC_BTNSELFILE: |
| 85 | - TCHAR path[MAX_PATH] = {0}; | |
| 86 | - | |
| 87 | 85 | const tstring title = |
| 88 | 86 | StrRsc::g_StrResource->GetLocalStr(SectionName, KeyName::SelectFilePath, TEXT("保存フォルダの選択")); |
| 89 | 87 | |
| 90 | - BROWSEINFO browse = {0}; | |
| 88 | + TCHAR path[MAX_PATH] = {}; | |
| 89 | + | |
| 90 | + BROWSEINFO browse = {}; | |
| 91 | 91 | browse.hwndOwner = hDialog; |
| 92 | 92 | browse.lpszTitle = title.c_str(); |
| 93 | 93 | browse.ulFlags = BIF_RETURNONLYFSDIRS; |
| 94 | 94 | browse.pszDisplayName = path; |
| 95 | 95 | |
| 96 | - if(SUCCEEDED(CoInitializeEx(NULL,COINIT_APARTMENTTHREADED))) | |
| 96 | + if(SUCCEEDED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED))) | |
| 97 | 97 | { |
| 98 | 98 | PIDLIST_ABSOLUTE idList = SHBrowseForFolder(&browse); |
| 99 | - if(idList != NULL) | |
| 99 | + if(idList) | |
| 100 | 100 | { |
| 101 | - SHGetPathFromIDList(idList,path); | |
| 102 | - SetDlgItemText(hDialog,IDC_EDTRCVDIR,path); | |
| 101 | + SHGetPathFromIDList(idList, path); | |
| 102 | + SetDlgItemText(hDialog, IDC_EDTRCVDIR, path); | |
| 103 | 103 | CoTaskMemFree(idList); |
| 104 | 104 | } |
| 105 | 105 |
| @@ -25,12 +25,12 @@ | ||
| 25 | 25 | static const LPCTSTR SelectFilePath; |
| 26 | 26 | }; |
| 27 | 27 | //----------------------- |
| 28 | - void OnInitDialog(const HWND hDialog) const; | |
| 29 | - void OnEndDialog(const HWND hDialog,const DWORD modalResult); | |
| 30 | - static INT_PTR CALLBACK DialogFunc(const HWND hDialog,const UINT message,const WPARAM wParam,const LPARAM lParam); | |
| 28 | + void OnInitDialog(HWND hDialog) const; | |
| 29 | + void OnEndDialog(HWND hDialog, DWORD modalResult); | |
| 30 | + static INT_PTR CALLBACK DialogFunc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam); | |
| 31 | 31 | public: |
| 32 | 32 | tstring FileDir; |
| 33 | - INT_PTR ShowOptionDialog(const HWND parent) const; | |
| 33 | + INT_PTR ShowOptionDialog(HWND parent) const; | |
| 34 | 34 | }; |
| 35 | 35 | } |
| 36 | 36 | } |
| @@ -97,7 +97,7 @@ | ||
| 97 | 97 | |
| 98 | 98 | for(int count = 1; PathFileExists(newPath.c_str()); ++count) |
| 99 | 99 | { |
| 100 | - newPath = tstring(&buff[0]) + TEXT("(") + ToString(count) + TEXT(")") + ext; | |
| 100 | + newPath = tstring(buff.data()) + TEXT('(') + ToString(count) + TEXT(')') + ext; | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | return HandlePathPair( |
| @@ -1,3 +1,4 @@ | ||
| 1 | +#include <array> | |
| 1 | 2 | #include <windows.h> |
| 2 | 3 | #include <shlwapi.h> |
| 3 | 4 | #if defined(_MSC_VER) |
| @@ -22,9 +23,9 @@ | ||
| 22 | 23 | if(!PathFileExists(fileName.c_str())) |
| 23 | 24 | return; |
| 24 | 25 | |
| 25 | - TCHAR buff[MAX_PATH]; | |
| 26 | - GetPrivateProfileString(SectionName,KeyName,FileDir.c_str(),buff,ARRAYSIZE(buff),fileName.c_str()); | |
| 27 | - FileDir = buff; | |
| 26 | + std::array<TCHAR, MAX_PATH> buff; | |
| 27 | + GetPrivateProfileString(SectionName,KeyName,FileDir.c_str(),buff.data(),std::tuple_size<decltype(buff)>::value,fileName.c_str()); | |
| 28 | + FileDir = buff.data(); | |
| 28 | 29 | } |
| 29 | 30 | |
| 30 | 31 | void FileIOConfig::SaveToFile(const tstring &fileName) const |
| @@ -11,7 +11,7 @@ | ||
| 11 | 11 | |
| 12 | 12 | namespace dummy_private |
| 13 | 13 | { |
| 14 | - template <typename T> struct to_string_type {}; | |
| 14 | + template <typename T> struct to_string_type; | |
| 15 | 15 | template <> struct to_string_type<int> { typedef long long cast_type; }; |
| 16 | 16 | template <> struct to_string_type<long> { typedef long long cast_type; }; |
| 17 | 17 | template <> struct to_string_type<long long> { typedef long long cast_type; }; |
| @@ -59,15 +59,13 @@ | ||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | template <typename T, typename U> |
| 62 | -std::basic_string<T> ConvertString(const std::basic_string<U> &str, | |
| 63 | - typename std::enable_if<std::is_same<T, U>::value>::type* = 0) | |
| 62 | +std::basic_string<typename std::enable_if<std::is_same<T, U>::value, T>::type> ConvertString(const std::basic_string<U> &str) | |
| 64 | 63 | { |
| 65 | 64 | return str; |
| 66 | 65 | } |
| 67 | 66 | |
| 68 | 67 | template <typename T, typename U> |
| 69 | -std::basic_string<T> ConvertString(const std::basic_string<U> &str, | |
| 70 | - typename std::enable_if<!std::is_same<T, U>::value>::type* = 0) | |
| 68 | +std::basic_string<typename std::enable_if<!std::is_same<T, U>::value, T>::type> ConvertString(const std::basic_string<U> &str) | |
| 71 | 69 | { |
| 72 | 70 | return dummy_private::t2x(str); |
| 73 | 71 | } |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | #include "StrResource.h" |
| 2 | 2 | |
| 3 | -#include <cstring> | |
| 4 | 3 | #include <vector> |
| 4 | +#include <array> | |
| 5 | 5 | |
| 6 | 6 | #include <shlwapi.h> |
| 7 | 7 | #if defined(_MSC_VER) |
| @@ -54,13 +54,13 @@ | ||
| 54 | 54 | |
| 55 | 55 | tstring StrResource::GetPluginName() |
| 56 | 56 | { |
| 57 | - TCHAR buff[MAX_PATH]; | |
| 57 | + std::array<TCHAR, MAX_PATH> buff; | |
| 58 | 58 | |
| 59 | - GetModuleFileName(g_hInstance, buff, ARRAYSIZE(buff)); | |
| 60 | - PathStripPath(buff); | |
| 61 | - PathRemoveExtension(buff); | |
| 59 | + GetModuleFileName(g_hInstance, buff.data(), std::tuple_size<decltype(buff)>::value); | |
| 60 | + PathStripPath(buff.data()); | |
| 61 | + PathRemoveExtension(buff.data()); | |
| 62 | 62 | |
| 63 | - return buff; | |
| 63 | + return buff.data(); | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | HNsmService StrResource::GetService(const tstring &serviceName) const |
| @@ -87,8 +87,8 @@ | ||
| 87 | 87 | |
| 88 | 88 | if(HService) |
| 89 | 89 | { |
| 90 | - char buff[1024] = {0}; | |
| 91 | - NsmStrRsc rs = {0}; | |
| 90 | + std::array<char, 1024> buff = {}; | |
| 91 | + NsmStrRsc rs = {}; | |
| 92 | 92 | |
| 93 | 93 | std::string rsSection = t2c(section); |
| 94 | 94 | std::string rsKey = t2c(key); |
| @@ -99,8 +99,8 @@ | ||
| 99 | 99 | rs.lpSectionName = rsSection.c_str(); |
| 100 | 100 | rs.lpMessageTag = rsKey.c_str(); |
| 101 | 101 | rs.lpDefaultStr = rsDefStr.c_str(); |
| 102 | - rs.nBufferSize = ARRAYSIZE(buff); | |
| 103 | - rs.lpBuffer = buff; | |
| 102 | + rs.nBufferSize = std::tuple_size<decltype(buff)>::value; | |
| 103 | + rs.lpBuffer = buff.data(); | |
| 104 | 104 | |
| 105 | 105 | if(InitInfo.CallService(HService, reinterpret_cast<WPARAM>(&rs), 0) != 0) |
| 106 | 106 | result = c2t(rs.lpBuffer); |
| @@ -54,17 +54,17 @@ | ||
| 54 | 54 | { |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - tstring NsmPluginMain::GetPluginInfo(const int index) const | |
| 57 | + tstring NsmPluginMain::GetPluginInfo(int index) const | |
| 58 | 58 | { |
| 59 | - if(0 <= index && index < ARRAYSIZE(PluginInfo)) | |
| 59 | + if(0 <= index && index < std::tuple_size<decltype(PluginInfo)>::value) | |
| 60 | 60 | return PluginInfo[index]; |
| 61 | 61 | |
| 62 | - return TEXT(""); | |
| 62 | + return tstring(); | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - void NsmPluginMain::SetPluginInfo(const int index,const tstring &value) | |
| 65 | + void NsmPluginMain::SetPluginInfo(int index,const tstring &value) | |
| 66 | 66 | { |
| 67 | - if(0 <= index && index < ARRAYSIZE(PluginInfo)) | |
| 67 | + if(0 <= index && index < std::tuple_size<decltype(PluginInfo)>::value) | |
| 68 | 68 | PluginInfo[index] = value; |
| 69 | 69 | } |
| 70 | 70 |
| @@ -76,10 +76,10 @@ | ||
| 76 | 76 | |
| 77 | 77 | tstring NsmPluginMain::GetDllFileName() |
| 78 | 78 | { |
| 79 | - TCHAR buff[MAX_PATH]; | |
| 80 | - GetModuleFileName(g_hInstance, buff, ARRAYSIZE(buff)); | |
| 79 | + std::array<TCHAR, MAX_PATH> buff; | |
| 80 | + GetModuleFileName(g_hInstance, buff.data(), std::tuple_size<decltype(buff)>::value); | |
| 81 | 81 | |
| 82 | - return buff; | |
| 82 | + return buff.data(); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | tstring NsmPluginMain::GetWorkDir() |
| @@ -1,6 +1,9 @@ | ||
| 1 | +#include "NsmGetSetInfo.h" | |
| 2 | + | |
| 3 | +#include <array> | |
| 4 | + | |
| 1 | 5 | #include "dummy.h" |
| 2 | 6 | #include "NsmInfoUtility.h" |
| 3 | -#include "NsmGetSetInfo.h" | |
| 4 | 7 | |
| 5 | 8 | namespace Regnessem |
| 6 | 9 | { |
| @@ -23,14 +26,14 @@ | ||
| 23 | 26 | //-- |
| 24 | 27 | |
| 25 | 28 | NsmGetInfo::NsmGetInfo(const TNsmPluginInitInfo &initInfo) |
| 26 | - : NsmInfoBase(initInfo), | |
| 27 | - HGetPluginInfo(GetService(NMS_SYSTEM_GETPLUGININFO)), | |
| 28 | - HGetConnectionInfo(GetService(NMS_SYSTEM_CONNECTION_GETINFO)), | |
| 29 | - HGetConnectionMemberInfo(GetService(NMS_SYSTEM_CONNECTION_MEMBERS_GETINFO)), | |
| 30 | - HGetConnectionGroupInfo(GetService(NMS_SYSTEM_CONNECTION_GROUPS_GETINFO)), | |
| 31 | - HGetSessionInfo(GetService(NMS_SYSTEM_SESSION_GETINFO)), | |
| 32 | - HGetSessionMemberInfo(GetService(NMS_SYSTEM_SESSION_MEMBERS_GETINFO)), | |
| 33 | - HGetFileSessionInfo(GetService(NMS_SYSTEM_FILESESSION_GETINFO)) | |
| 29 | + :NsmInfoBase(initInfo) | |
| 30 | + ,HGetPluginInfo(GetService(NMS_SYSTEM_GETPLUGININFO)) | |
| 31 | + ,HGetConnectionInfo(GetService(NMS_SYSTEM_CONNECTION_GETINFO)) | |
| 32 | + ,HGetConnectionMemberInfo(GetService(NMS_SYSTEM_CONNECTION_MEMBERS_GETINFO)) | |
| 33 | + ,HGetConnectionGroupInfo(GetService(NMS_SYSTEM_CONNECTION_GROUPS_GETINFO)) | |
| 34 | + ,HGetSessionInfo(GetService(NMS_SYSTEM_SESSION_GETINFO)) | |
| 35 | + ,HGetSessionMemberInfo(GetService(NMS_SYSTEM_SESSION_MEMBERS_GETINFO)) | |
| 36 | + ,HGetFileSessionInfo(GetService(NMS_SYSTEM_FILESESSION_GETINFO)) | |
| 34 | 37 | {} |
| 35 | 38 | |
| 36 | 39 | LONG_PTR NsmGetInfo::GetConnectionInfo(HNsmConnection handle, const PNsmInfo nsmInfo, int infoKey) const |
| @@ -90,18 +93,18 @@ | ||
| 90 | 93 | |
| 91 | 94 | std::string NsmGetInfo::GetPluginInfo(const std::string &moduleName, int infoKey) const |
| 92 | 95 | { |
| 93 | - char buff[BufferSize] = {0}; | |
| 96 | + std::array<char, BufferSize> buff = {}; | |
| 94 | 97 | |
| 95 | - TNsmPluginInfo pluginInfo = {0}; | |
| 96 | - pluginInfo.cbSize = sizeof(TNsmPluginInfo); | |
| 98 | + TNsmPluginInfo pluginInfo = {}; | |
| 99 | + pluginInfo.cbSize = sizeof(pluginInfo); | |
| 97 | 100 | pluginInfo.lpModuleName = moduleName.c_str(); |
| 98 | 101 | pluginInfo.nInfoNo = infoKey; |
| 99 | - pluginInfo.lpBuffer = buff; | |
| 100 | - pluginInfo.nBufferSize = ARRAYSIZE(buff); | |
| 102 | + pluginInfo.lpBuffer = buff.data(); | |
| 103 | + pluginInfo.nBufferSize = std::tuple_size<decltype(buff)>::value; | |
| 101 | 104 | |
| 102 | 105 | InitInfo.CallService(HGetPluginInfo, reinterpret_cast<WPARAM>(&pluginInfo), 0); |
| 103 | 106 | |
| 104 | - return buff; | |
| 107 | + return buff.data(); | |
| 105 | 108 | } |
| 106 | 109 | |
| 107 | 110 | std::wstring NsmGetInfo::GetConnectionInfoStr(HNsmConnection handle, int infoKey) const |
| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | #ifndef NSMPLUGINMAIN_H |
| 2 | 2 | #define NSMPLUGINMAIN_H |
| 3 | 3 | |
| 4 | +#include <array> | |
| 5 | + | |
| 4 | 6 | #include "UNsmConsts.h" |
| 5 | 7 | #include "NsmTypes.h" |
| 6 | 8 | #include "tstring.h" |
| @@ -13,7 +15,7 @@ | ||
| 13 | 15 | { |
| 14 | 16 | private: |
| 15 | 17 | bool Initialized; |
| 16 | - tstring PluginInfo[NMPI_PLUGINVER + 1]; | |
| 18 | + std::array<tstring, NMPI_PLUGINVER + 1> PluginInfo; | |
| 17 | 19 | protected: |
| 18 | 20 | virtual void DoInitialize(); |
| 19 | 21 | virtual void DoTerminate(); |
| @@ -38,8 +40,8 @@ | ||
| 38 | 40 | int HookEvent(const tstring &eventName,const TNsmEventProc procAddr) const; |
| 39 | 41 | int UnhookEvent(const tstring &eventName,const TNsmEventProc procAddr) const; |
| 40 | 42 | |
| 41 | - tstring GetPluginInfo(const int index) const; | |
| 42 | - void SetPluginInfo(const int index,const tstring &value); | |
| 43 | + tstring GetPluginInfo(int index) const; | |
| 44 | + void SetPluginInfo(int index,const tstring &value); | |
| 43 | 45 | bool IsInitialized() const; |
| 44 | 46 | }; |
| 45 | 47 | } |
| @@ -6,6 +6,7 @@ | ||
| 6 | 6 | #include <stdexcept> |
| 7 | 7 | #include <vector> |
| 8 | 8 | #include <iomanip> |
| 9 | +#include <array> | |
| 9 | 10 | |
| 10 | 11 | #if defined(_WINDOWS) |
| 11 | 12 | #include <windows.h> |
| @@ -111,15 +112,16 @@ | ||
| 111 | 112 | |
| 112 | 113 | Regnessem::tstring TimeToStr(std::time_t t) |
| 113 | 114 | { |
| 114 | - TCHAR buffer[16]; | |
| 115 | + std::array<TCHAR, 16> buffer; | |
| 115 | 116 | #if defined(_MSC_VER) && !defined(WINCE) |
| 116 | 117 | tm tmp; |
| 117 | 118 | localtime_s(&tmp, &t); |
| 118 | - _tcsftime(buffer, ARRAYSIZE(buffer), TEXT("%H:%M:%S"), &tmp); | |
| 119 | + | |
| 120 | + _tcsftime(buffer.data(), std::tuple_size<decltype(buffer)>::value, TEXT("%H:%M:%S"), &tmp); | |
| 119 | 121 | #else |
| 120 | - _tcsftime(buffer,sizeof(buffer)/sizeof(buffer[0]),TEXT("%H:%M:%S"), localtime(&t)); | |
| 122 | + _tcsftime(buffer.data(), std::tuple_size<decltype(buffer)>::value, TEXT("%H:%M:%S"), localtime(&t)); | |
| 121 | 123 | #endif |
| 122 | - return buffer; | |
| 124 | + return buffer.data(); | |
| 123 | 125 | } |
| 124 | 126 | |
| 125 | 127 | Regnessem::tstring ExtractFileName(const Regnessem::tstring &fileName) |
| @@ -228,7 +230,7 @@ | ||
| 228 | 230 | |
| 229 | 231 | AutoVaList ls; |
| 230 | 232 | |
| 231 | - va_start(ls.List,fmt); | |
| 233 | + va_start(ls.List, fmt); | |
| 232 | 234 | |
| 233 | 235 | #if defined(_MSC_VER) && !defined(WINCE) |
| 234 | 236 | int length = _vsctprintf(fmt, ls.List) + 1; |
| @@ -236,20 +238,16 @@ | ||
| 236 | 238 | return fmt; |
| 237 | 239 | |
| 238 | 240 | std::vector<TCHAR> buffer(length); |
| 239 | - int result = _vstprintf_s(&buffer[0],length,fmt,ls.List); | |
| 241 | + int result = _vstprintf_s(buffer.data(), buffer.size(), fmt, ls.List); | |
| 240 | 242 | #else |
| 241 | - std::vector<TCHAR> buffer(8192); | |
| 242 | -#if defined(_MSC_VER) && defined(WINCE) | |
| 243 | - int result = _vsntprintf(&buffer.front(),8192,fmt,ls.List); | |
| 244 | -#else | |
| 245 | - int result = vsnprintf(&buffer.front(),8192,fmt,ls.List); | |
| 243 | + std::array<TCHAR, 8192> buffer; | |
| 244 | + int result = _vsntprintf(buffer.data(), buffer.size(), fmt, ls.List); | |
| 245 | + buffer.back() = TCHAR(); | |
| 246 | 246 | #endif |
| 247 | - *buffer.rbegin() = TEXT('\0'); | |
| 248 | -#endif | |
| 249 | 247 | if(result < 0) |
| 250 | 248 | return fmt; |
| 251 | 249 | |
| 252 | - return &buffer[0]; | |
| 250 | + return buffer.data(); | |
| 253 | 251 | } |
| 254 | 252 | |
| 255 | 253 | #if defined(WINCE) |
| @@ -36,16 +36,16 @@ | ||
| 36 | 36 | |
| 37 | 37 | FARPROC ProcAddress(LPCSTR procName) const; |
| 38 | 38 | |
| 39 | - NsmPlugin(const NsmPlugin &other); | |
| 40 | - NsmPlugin& operator=(const NsmPlugin &other); | |
| 39 | + NsmPlugin(const NsmPlugin &); | |
| 40 | + NsmPlugin& operator=(const NsmPlugin &); | |
| 41 | 41 | public: |
| 42 | 42 | struct FindByModuleName |
| 43 | 43 | { |
| 44 | 44 | const tstring x; |
| 45 | 45 | explicit FindByModuleName(const tstring &s); |
| 46 | - bool operator()(const NsmPluginListSub& v)const; | |
| 46 | + bool operator()(const NsmPluginListSub &v)const; | |
| 47 | 47 | private: |
| 48 | - FindByModuleName& operator=(const FindByModuleName& other); | |
| 48 | + FindByModuleName& operator=(const FindByModuleName &); | |
| 49 | 49 | }; |
| 50 | 50 | |
| 51 | 51 | struct NsmPluginInfoEx |
| @@ -62,7 +62,7 @@ | ||
| 62 | 62 | void Cls_OnKey(HWND /* hwnd */, UINT vk, BOOL /* fDown */, int /* cRepeat */, UINT /* flags */) const; |
| 63 | 63 | void Cls_OnDestroy(HWND /* hwnd */) const; |
| 64 | 64 | public: |
| 65 | - explicit NsmMainDebug(HWND hParent); | |
| 65 | + NsmMainDebug(); | |
| 66 | 66 | ~NsmMainDebug(); |
| 67 | 67 | }; |
| 68 | 68 | } |
| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | #include "nsmsgs.h" |
| 2 | 2 | |
| 3 | +#include <array> | |
| 3 | 4 | #include <algorithm> |
| 5 | + | |
| 4 | 6 | #if defined(_WINDOWS) |
| 5 | 7 | #include <windows.h> |
| 6 | 8 | #else |
| @@ -97,23 +99,23 @@ | ||
| 97 | 99 | } |
| 98 | 100 | #endif |
| 99 | 101 | |
| 100 | - WPARAM Initialize(int argc,TCHAR**argv) | |
| 102 | + WPARAM Initialize(int argc, TCHAR** argv) | |
| 101 | 103 | { |
| 102 | - HANDLE mutex = CreateMutex(NULL,FALSE,Application::Title); | |
| 104 | + HANDLE mutex = CreateMutex(NULL, FALSE, Application::Title); | |
| 103 | 105 | if(!mutex) |
| 104 | 106 | return 0; |
| 105 | 107 | |
| 106 | - const bool isRestart = (std::find(argv+1,argv+argc,tstring(CommandLineOption::Restart))!=argv+argc); | |
| 108 | + const bool isRestart = (std::find(argv + 1, argv + argc, tstring(CommandLineOption::Restart)) != argv + argc); | |
| 107 | 109 | |
| 108 | - if(WaitForSingleObject(mutex,isRestart ? 60000 : 0) == WAIT_TIMEOUT) | |
| 110 | + if(WaitForSingleObject(mutex, isRestart ? 60000 : 0) == WAIT_TIMEOUT) | |
| 109 | 111 | { |
| 110 | 112 | // 多重起動禁止 |
| 111 | - if(std::find(argv+1,argv+argc,tstring(CommandLineOption::ForceExecute))==argv+argc) | |
| 113 | + if(std::find(argv + 1, argv + argc, tstring(CommandLineOption::ForceExecute)) == argv + argc) | |
| 112 | 114 | return 0; |
| 113 | 115 | } |
| 114 | 116 | |
| 115 | 117 | #ifndef WINCE |
| 116 | - g_NsmCom.DebugMode = (std::find(argv+1,argv+argc,tstring(CommandLineOption::Debug))!=argv+argc); | |
| 118 | + g_NsmCom.DebugMode = (std::find(argv + 1, argv + argc, tstring(CommandLineOption::Debug)) != argv + argc); | |
| 117 | 119 | #else |
| 118 | 120 | g_NsmCom.DebugMode = false; |
| 119 | 121 | #endif |
| @@ -126,7 +128,7 @@ | ||
| 126 | 128 | } |
| 127 | 129 | else |
| 128 | 130 | { |
| 129 | - g_NsmCom.DebugWindow.reset(new NsmMainDebug(/*[TODO]適当にnullわたしています*/NULL)); | |
| 131 | + g_NsmCom.DebugWindow.reset(new NsmMainDebug()); | |
| 130 | 132 | g_NsmCom.DebugWindow->Initialize(); |
| 131 | 133 | } |
| 132 | 134 |
| @@ -139,7 +141,7 @@ | ||
| 139 | 141 | if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) |
| 140 | 142 | { |
| 141 | 143 | // HACK:delphiメッセージ |
| 142 | - if ((WM_KEYFIRST <= msg.message && msg.message <= WM_KEYLAST)) | |
| 144 | + if((WM_KEYFIRST <= msg.message && msg.message <= WM_KEYLAST)) | |
| 143 | 145 | { |
| 144 | 146 | if(SendMessage(msg.hwnd, CN_BASE + msg.message, msg.wParam, msg.lParam)) |
| 145 | 147 | continue; |
| @@ -184,7 +186,7 @@ | ||
| 184 | 186 | int APIENTRY _tWinMain(HINSTANCE /* hInstance */, HINSTANCE /* hPrevInstance */, LPTSTR /* lptCmdLine */, int /* nCmdShow */) |
| 185 | 187 | { |
| 186 | 188 | #if defined(_MSC_VER) |
| 187 | - return static_cast<int>(nsmsgs::Initialize(__argc,__targv)); | |
| 189 | + return static_cast<int>(nsmsgs::Initialize(__argc, __targv)); | |
| 188 | 190 | #else |
| 189 | 191 | |
| 190 | 192 | int argc; |
| @@ -219,9 +221,9 @@ | ||
| 219 | 221 | tstring Application::ExeName() |
| 220 | 222 | { |
| 221 | 223 | #ifdef _WINDOWS |
| 222 | - TCHAR filename[MAX_PATH]; | |
| 223 | - GetModuleFileName(GetModuleHandle(NULL),filename,ARRAYSIZE(filename)); | |
| 224 | - return filename; | |
| 224 | + std::array<TCHAR, MAX_PATH> filename; | |
| 225 | + GetModuleFileName(GetModuleHandle(NULL), filename.data(), std::tuple_size<decltype(filename)>::value); | |
| 226 | + return filename.data(); | |
| 225 | 227 | #else |
| 226 | 228 | // [TODO] テスト用あとで直す Binary Hacksあたり参照 |
| 227 | 229 | return "./a.exe"; |
| @@ -2,6 +2,7 @@ | ||
| 2 | 2 | |
| 3 | 3 | #include <cassert> |
| 4 | 4 | #include <algorithm> |
| 5 | +#include <array> | |
| 5 | 6 | |
| 6 | 7 | #include "../../Common/UNsmConsts.h" |
| 7 | 8 | #include "../../Common/dummy.h" |
| @@ -146,7 +147,7 @@ | ||
| 146 | 147 | DisconnectAll(); |
| 147 | 148 | |
| 148 | 149 | const NsmPluginList &p = Plugins; |
| 149 | - for(NsmPluginList::const_iterator it = p.begin();it != p.end();++it) | |
| 150 | + for(NsmPluginList::const_iterator it = p.begin(); it != p.end(); ++it) | |
| 150 | 151 | (*it)->Terminate(); |
| 151 | 152 | Plugins.clear(); |
| 152 | 153 |
| @@ -154,12 +155,12 @@ | ||
| 154 | 155 | } |
| 155 | 156 | |
| 156 | 157 | // connection に関連したセッションを全て閉じる |
| 157 | - void NsmSystem::CloseRelatedSessions(const NsmConnection *const connection) | |
| 158 | + void NsmSystem::CloseRelatedSessions(const NsmConnection* connection) | |
| 158 | 159 | { |
| 159 | 160 | NsmThreadSessionList::AutoLock lock(Sessions); |
| 160 | 161 | NsmSessionList &sesList = lock.List(); |
| 161 | 162 | |
| 162 | - for(NsmSessionList::size_type i = sesList.size() ; i ; --i) | |
| 163 | + for(NsmSessionList::size_type i = sesList.size(); i; --i) | |
| 163 | 164 | { |
| 164 | 165 | const NsmSession *const session = sesList.at(i - 1).get(); |
| 165 | 166 |
| @@ -166,7 +167,7 @@ | ||
| 166 | 167 | if(session->Connection == connection) |
| 167 | 168 | { |
| 168 | 169 | const tstring fmt = format(NMS_PROTOCOL_SESSION_CLOSE, connection->Protocol.c_str()); |
| 169 | - g_NsmCom.CallService(g_NsmCom.GetService(fmt),reinterpret_cast<WPARAM>(session), 0); | |
| 170 | + g_NsmCom.CallService(g_NsmCom.GetService(fmt), reinterpret_cast<WPARAM>(session), 0); | |
| 170 | 171 | } |
| 171 | 172 | } |
| 172 | 173 | } |
| @@ -177,7 +178,7 @@ | ||
| 177 | 178 | NsmThreadSessionList::AutoLock lock(Sessions); |
| 178 | 179 | NsmSessionList &sesList = lock.List(); |
| 179 | 180 | |
| 180 | - for(NsmSessionList::size_type i = sesList.size() ; i ; --i) | |
| 181 | + for(NsmSessionList::size_type i = sesList.size(); i; --i) | |
| 181 | 182 | { |
| 182 | 183 | const NsmSession *const session = sesList.at(i - 1).get(); |
| 183 | 184 |
| @@ -187,12 +188,12 @@ | ||
| 187 | 188 | } |
| 188 | 189 | |
| 189 | 190 | // session に関連したファイルセッションを全て閉じる |
| 190 | - void NsmSystem::CloseRelatedFileSessions(const NsmSession *const session) | |
| 191 | + void NsmSystem::CloseRelatedFileSessions(const NsmSession* session) | |
| 191 | 192 | { |
| 192 | 193 | NsmThreadFileSessionList::AutoLock lock(FileSessions); |
| 193 | 194 | NsmFileSessionList &fileSesList = lock.List(); |
| 194 | 195 | |
| 195 | - for(NsmFileSessionList::size_type i = fileSesList.size(); i ; --i) | |
| 196 | + for(NsmFileSessionList::size_type i = fileSesList.size(); i; --i) | |
| 196 | 197 | { |
| 197 | 198 | const NsmFileSession *const fileSes = fileSesList.at(i - 1).get(); |
| 198 | 199 |
| @@ -210,7 +211,7 @@ | ||
| 210 | 211 | NsmThreadFileSessionList::AutoLock lock(FileSessions); |
| 211 | 212 | NsmFileSessionList &fileSesList = lock.List(); |
| 212 | 213 | |
| 213 | - for(NsmFileSessionList::size_type i = fileSesList.size(); i ; --i) | |
| 214 | + for(NsmFileSessionList::size_type i = fileSesList.size(); i; --i) | |
| 214 | 215 | { |
| 215 | 216 | const NsmFileSession *const fileSes = fileSesList.at(i - 1).get(); |
| 216 | 217 |
| @@ -225,7 +226,7 @@ | ||
| 225 | 226 | NsmThreadConnectionList::AutoLock lock(Connections); |
| 226 | 227 | NsmConnectionList &conList = lock.List(); |
| 227 | 228 | |
| 228 | - for(NsmConnectionList::size_type i = conList.size(); i ; --i) | |
| 229 | + for(NsmConnectionList::size_type i = conList.size(); i; --i) | |
| 229 | 230 | { |
| 230 | 231 | const NsmConnection *const connection = conList.at(i - 1).get(); |
| 231 | 232 |
| @@ -237,7 +238,7 @@ | ||
| 237 | 238 | void NsmSystem::DoConnectionChange() |
| 238 | 239 | { |
| 239 | 240 | const NsmMainDebug *const wnd = g_NsmCom.DebugWindow.get(); |
| 240 | - if (OnConnectionChange!=NULL && wnd != NULL) | |
| 241 | + if(OnConnectionChange != NULL && wnd != NULL) | |
| 241 | 242 | (wnd->*OnConnectionChange)(); |
| 242 | 243 | } |
| 243 | 244 |
| @@ -244,13 +245,13 @@ | ||
| 244 | 245 | void NsmSystem::DoSessionChange() |
| 245 | 246 | { |
| 246 | 247 | const NsmMainDebug *const wnd = g_NsmCom.DebugWindow.get(); |
| 247 | - if (OnSessionChange!=NULL && wnd != NULL) | |
| 248 | + if(OnSessionChange != NULL && wnd != NULL) | |
| 248 | 249 | (wnd->*OnSessionChange)(); |
| 249 | 250 | } |
| 250 | 251 | |
| 251 | 252 | void NsmSystem::DoFileSessionChange() |
| 252 | 253 | { |
| 253 | - if (OnFileSessionChange) | |
| 254 | + if(OnFileSessionChange) | |
| 254 | 255 | OnFileSessionChange(this); |
| 255 | 256 | } |
| 256 | 257 |
| @@ -257,7 +258,7 @@ | ||
| 257 | 258 | void NsmSystem::DoModuleChange() |
| 258 | 259 | { |
| 259 | 260 | const NsmMainDebug *const wnd = g_NsmCom.DebugWindow.get(); |
| 260 | - if (OnModuleChange!=NULL && wnd != NULL) | |
| 261 | + if(OnModuleChange != NULL && wnd != NULL) | |
| 261 | 262 | (wnd->*OnModuleChange)(); |
| 262 | 263 | } |
| 263 | 264 |
| @@ -283,7 +284,7 @@ | ||
| 283 | 284 | |
| 284 | 285 | { |
| 285 | 286 | WIN32_FIND_DATA fd; |
| 286 | - FindFileHandle h(FindFirstFile(path.c_str(),&fd)); | |
| 287 | + FindFileHandle h(FindFirstFile(path.c_str(), &fd)); | |
| 287 | 288 | |
| 288 | 289 | if(h.Handle == INVALID_HANDLE_VALUE) |
| 289 | 290 | return; |
| @@ -290,32 +291,32 @@ | ||
| 290 | 291 | |
| 291 | 292 | const tstring dir = ExtractFilePath(path); |
| 292 | 293 | |
| 293 | - do{ | |
| 294 | + do { | |
| 294 | 295 | NsmPluginListSub t(new NsmPlugin(dir + fd.cFileName)); |
| 295 | 296 | |
| 296 | 297 | if(t->IsLoaded() && |
| 297 | - t->PluginInfo.ApiVersion == NSM_API_VERSION && | |
| 298 | - t->PluginInfo.ModuleName != NMM_SYSTEM && | |
| 299 | - std::find_if(Plugins.begin(), Plugins.end(), | |
| 300 | - NsmPlugin::FindByModuleName(t->PluginInfo.ModuleName)) == Plugins.end()) | |
| 298 | + t->PluginInfo.ApiVersion == NSM_API_VERSION && | |
| 299 | + t->PluginInfo.ModuleName != NMM_SYSTEM && | |
| 300 | + std::find_if(Plugins.begin(), Plugins.end(), | |
| 301 | + NsmPlugin::FindByModuleName(t->PluginInfo.ModuleName)) == Plugins.end()) | |
| 301 | 302 | { |
| 302 | 303 | Plugins.push_back(t); |
| 303 | 304 | } |
| 304 | - }while(FindNextFile(h.Handle, &fd)); | |
| 305 | + } while(FindNextFile(h.Handle, &fd)); | |
| 305 | 306 | } |
| 306 | 307 | |
| 307 | 308 | #else |
| 308 | 309 | // [TODO]超絶手抜きです。 誰かまともなコードに直して |
| 309 | - FILE*fp = popen(("dir "+path).c_str(),"r"); | |
| 310 | + FILE*fp = popen(("dir " + path).c_str(), "r"); | |
| 310 | 311 | char buf[256]; |
| 311 | - while(fscanf(fp,"%255s",buf)==1){ | |
| 312 | + while(fscanf(fp, "%255s", buf) == 1){ | |
| 312 | 313 | std::unique_ptr<TNsmPlugin> t(buf)); |
| 313 | 314 | |
| 314 | 315 | if(t->DllHandle != NULL && |
| 315 | - t->PluginInfo.ApiVersion == NSM_API_VERSION && | |
| 316 | - t->PluginInfo.ModuleName != NMM_SYSTEM && | |
| 317 | - std::find_if(Plugins.begin(),Plugins.end(), | |
| 318 | - std::bind2nd(TNsmPluginListFindByModuleName(),t->PluginInfo.ModuleName)) == Plugins.end()) | |
| 316 | + t->PluginInfo.ApiVersion == NSM_API_VERSION && | |
| 317 | + t->PluginInfo.ModuleName != NMM_SYSTEM && | |
| 318 | + std::find_if(Plugins.begin(), Plugins.end(), | |
| 319 | + std::bind2nd(TNsmPluginListFindByModuleName(), t->PluginInfo.ModuleName)) == Plugins.end()) | |
| 319 | 320 | { |
| 320 | 321 | Plugins.push_back(TNsmPluginListSub(t.release())); |
| 321 | 322 | } |
| @@ -328,7 +329,7 @@ | ||
| 328 | 329 | |
| 329 | 330 | // ----------------------------------------------------------------------------- |
| 330 | 331 | |
| 331 | - LONG_PTR Service::DoExit(const WPARAM /* wParam */,const LPARAM /* lParam */) | |
| 332 | + LONG_PTR Service::DoExit(WPARAM /* wParam */, LPARAM /* lParam */) | |
| 332 | 333 | { |
| 333 | 334 | #ifdef _WINDOWS |
| 334 | 335 | Application::Terminate(); |
| @@ -338,7 +339,7 @@ | ||
| 338 | 339 | return 0; |
| 339 | 340 | } |
| 340 | 341 | |
| 341 | - LONG_PTR Service::DoDebugPrint(const WPARAM wParam,const LPARAM /* lParam */) | |
| 342 | + LONG_PTR Service::DoDebugPrint(WPARAM wParam, LPARAM /* lParam */) | |
| 342 | 343 | { |
| 343 | 344 | if(wParam) |
| 344 | 345 | g_NsmCom.DoLog(c2t(reinterpret_cast<char *>(wParam)), true); |
| @@ -346,16 +347,16 @@ | ||
| 346 | 347 | return 0; |
| 347 | 348 | } |
| 348 | 349 | |
| 349 | - LONG_PTR Service::DoEnumProtocols(const WPARAM wParam,const LPARAM lParam) | |
| 350 | + LONG_PTR Service::DoEnumProtocols(WPARAM wParam, LPARAM lParam) | |
| 350 | 351 | { |
| 351 | 352 | const NsmPluginList &p = g_NsmSystem.Plugins; |
| 352 | - for(NsmPluginList::const_iterator it = p.begin();it != p.end();++it) | |
| 353 | + for(NsmPluginList::const_iterator it = p.begin(); it != p.end(); ++it) | |
| 353 | 354 | { |
| 354 | 355 | const tstring moduleName = (*it)->PluginInfo.ModuleName; |
| 355 | - if (Common::ModuleUtility::ExtractModuleType(moduleName) == NMM_PROTOCOL) | |
| 356 | + if(Common::ModuleUtility::ExtractModuleType(moduleName) == NMM_PROTOCOL) | |
| 356 | 357 | { |
| 357 | 358 | const tstring protcolName = Common::ModuleUtility::ExtractProtocolName(moduleName); |
| 358 | - reinterpret_cast<TEnumProtocolCallback>(wParam) (t2c(protcolName).c_str(), lParam); | |
| 359 | + reinterpret_cast<TEnumProtocolCallback>(wParam)(t2c(protcolName).c_str(), lParam); | |
| 359 | 360 | } |
| 360 | 361 | } |
| 361 | 362 |
| @@ -362,16 +363,16 @@ | ||
| 362 | 363 | return 0; |
| 363 | 364 | } |
| 364 | 365 | |
| 365 | - LONG_PTR Service::DoEnumModules(const WPARAM wParam,const LPARAM lParam) | |
| 366 | + LONG_PTR Service::DoEnumModules(WPARAM wParam, LPARAM lParam) | |
| 366 | 367 | { |
| 367 | 368 | const NsmPluginList &p = g_NsmSystem.Plugins; |
| 368 | - for(NsmPluginList::const_iterator it = p.begin();it != p.end();++it) | |
| 369 | - reinterpret_cast<TEnumModuleCallback>(wParam) (t2c((*it)->PluginInfo.ModuleName).c_str(), lParam); | |
| 369 | + for(NsmPluginList::const_iterator it = p.begin(); it != p.end(); ++it) | |
| 370 | + reinterpret_cast<TEnumModuleCallback>(wParam)(t2c((*it)->PluginInfo.ModuleName).c_str(), lParam); | |
| 370 | 371 | |
| 371 | 372 | return 0; |
| 372 | 373 | } |
| 373 | 374 | |
| 374 | - LONG_PTR Service::DoGetPluginInfo(const WPARAM wParam,const LPARAM /* lParam */ ) | |
| 375 | + LONG_PTR Service::DoGetPluginInfo(WPARAM wParam, LPARAM /* lParam */ ) | |
| 375 | 376 | { |
| 376 | 377 | const PNsmPluginInfo pin = reinterpret_cast<PNsmPluginInfo>(wParam); |
| 377 | 378 |
| @@ -380,17 +381,17 @@ | ||
| 380 | 381 | |
| 381 | 382 | const NsmPluginList &p = g_NsmSystem.Plugins; |
| 382 | 383 | NsmPluginList::const_iterator it = |
| 383 | - std::find_if(p.begin(),p.end(),NsmPlugin::FindByModuleName(c2t(pin->lpModuleName))); | |
| 384 | + std::find_if(p.begin(), p.end(), NsmPlugin::FindByModuleName(c2t(pin->lpModuleName))); | |
| 384 | 385 | |
| 385 | 386 | if(it != p.end()) |
| 386 | 387 | return (*it)->GetPluginInfo(pin->nInfoNo, pin->lpBuffer, pin->nBufferSize); |
| 387 | 388 | |
| 388 | - if (c2t(pin->lpModuleName) != NMM_SYSTEM) | |
| 389 | + if(c2t(pin->lpModuleName) != NMM_SYSTEM) | |
| 389 | 390 | return 0; |
| 390 | 391 | |
| 391 | 392 | tstring infoStr; |
| 392 | 393 | |
| 393 | - switch (pin->nInfoNo) | |
| 394 | + switch(pin->nInfoNo) | |
| 394 | 395 | { |
| 395 | 396 | case NMPI_APIVER: |
| 396 | 397 | infoStr = NSM_API_VERSION; |
| @@ -421,14 +422,14 @@ | ||
| 421 | 422 | if(result.empty()) |
| 422 | 423 | return 0; |
| 423 | 424 | |
| 424 | - std::string::size_type len = std::min<std::string::size_type>(pin->nBufferSize-1,result.size()); | |
| 425 | + std::string::size_type len = std::min<std::string::size_type>(pin->nBufferSize - 1, result.size()); | |
| 425 | 426 | |
| 426 | 427 | result.resize(len); |
| 427 | 428 | |
| 428 | 429 | #if defined(_MSC_VER) && !defined(WINCE) |
| 429 | - strcpy_s(pin->lpBuffer,pin->nBufferSize,result.c_str()); | |
| 430 | + strcpy_s(pin->lpBuffer, pin->nBufferSize, result.c_str()); | |
| 430 | 431 | #else |
| 431 | - strcpy(pin->lpBuffer,result.c_str()); | |
| 432 | + strcpy(pin->lpBuffer, result.c_str()); | |
| 432 | 433 | #endif |
| 433 | 434 | |
| 434 | 435 | return static_cast<LONG_PTR>(len); |
| @@ -436,7 +437,7 @@ | ||
| 436 | 437 | |
| 437 | 438 | // Connection ------------------------------------------------------------------ |
| 438 | 439 | |
| 439 | - LONG_PTR Service::DoCreateConnection(const WPARAM wParam,const LPARAM lParam) | |
| 440 | + LONG_PTR Service::DoCreateConnection(WPARAM wParam, LPARAM lParam) | |
| 440 | 441 | { |
| 441 | 442 | if(!wParam) |
| 442 | 443 | return 0; |
| @@ -447,8 +448,8 @@ | ||
| 447 | 448 | NsmConnectionList &p = lock.List(); |
| 448 | 449 | |
| 449 | 450 | result.reset(new NsmConnection( |
| 450 | - c2t(reinterpret_cast<char*>(wParam)), | |
| 451 | - c2t(reinterpret_cast<char*>(lParam ? lParam : wParam)))); | |
| 451 | + c2t(reinterpret_cast<char*>(wParam)), | |
| 452 | + c2t(reinterpret_cast<char*>(lParam ? lParam : wParam)))); | |
| 452 | 453 | |
| 453 | 454 | p.push_back(result); |
| 454 | 455 | } |
| @@ -459,7 +460,7 @@ | ||
| 459 | 460 | return reinterpret_cast<LONG_PTR>(result.get()); |
| 460 | 461 | } |
| 461 | 462 | |
| 462 | - LONG_PTR Service::DoDeleteConnection(const WPARAM wParam,const LPARAM /* lParam */ ) | |
| 463 | + LONG_PTR Service::DoDeleteConnection(WPARAM wParam, LPARAM /* lParam */ ) | |
| 463 | 464 | { |
| 464 | 465 | { |
| 465 | 466 | NsmThreadConnectionList::AutoLock lock(g_NsmSystem.Connections); |
| @@ -466,7 +467,7 @@ | ||
| 466 | 467 | NsmConnectionList &p = lock.List(); |
| 467 | 468 | |
| 468 | 469 | NsmConnectionList::iterator it = |
| 469 | - std::find_if(p.begin(), p.end(),NsmConnection::FindByHandle(reinterpret_cast<NsmConnection *>(wParam))); | |
| 470 | + std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(reinterpret_cast<NsmConnection *>(wParam))); | |
| 470 | 471 | if(it == p.end()) |
| 471 | 472 | return -1; |
| 472 | 473 |
| @@ -480,7 +481,7 @@ | ||
| 480 | 481 | return 1; |
| 481 | 482 | } |
| 482 | 483 | |
| 483 | - LONG_PTR Service::DoGetConnectionInfo(const WPARAM wParam,const LPARAM lParam) | |
| 484 | + LONG_PTR Service::DoGetConnectionInfo(WPARAM wParam, LPARAM lParam) | |
| 484 | 485 | { |
| 485 | 486 | const NsmConnection *const connection = reinterpret_cast<NsmConnection *>(wParam); |
| 486 | 487 | const PNsmConnectionInfo pin = reinterpret_cast<PNsmConnectionInfo>(lParam); |
| @@ -488,10 +489,10 @@ | ||
| 488 | 489 | NsmThreadConnectionList::ConstAutoLock lock(g_NsmSystem.Connections); |
| 489 | 490 | const NsmConnectionList &p = lock.List(); |
| 490 | 491 | |
| 491 | - if (std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(connection)) == p.end()) | |
| 492 | + if(std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(connection)) == p.end()) | |
| 492 | 493 | return 0; |
| 493 | 494 | |
| 494 | - switch (pin->nInfoKey) | |
| 495 | + switch(pin->nInfoKey) | |
| 495 | 496 | { |
| 496 | 497 | case NMCI_PROTOCOL: |
| 497 | 498 | //HACK:API 2.3 |
| @@ -515,7 +516,7 @@ | ||
| 515 | 516 | return Common::NsmInfoUtility::IntToNsmInfo(pin->lpInfo, connection->User.MailStatus); |
| 516 | 517 | case NMCI_USER_COMMENT: |
| 517 | 518 | return Common::NsmInfoUtility::StrToNsmInfo(pin->lpInfo, connection->User.Comment); |
| 518 | - // MSN7アイコンとFriendly パラメータ | |
| 519 | + // MSN7アイコンとFriendly パラメータ | |
| 519 | 520 | case NMCI_USER_TILE: |
| 520 | 521 | return Common::NsmInfoUtility::StrToNsmInfo(pin->lpInfo, connection->User.FilePath); |
| 521 | 522 | case NMCI_USER_FRIENDLY: |
| @@ -528,7 +529,7 @@ | ||
| 528 | 529 | } |
| 529 | 530 | } |
| 530 | 531 | |
| 531 | - LONG_PTR Service::DoSetConnectionInfo(const WPARAM wParam,const LPARAM lParam) | |
| 532 | + LONG_PTR Service::DoSetConnectionInfo(WPARAM wParam, LPARAM lParam) | |
| 532 | 533 | { |
| 533 | 534 | NsmConnection *const connection = reinterpret_cast<NsmConnection *>(wParam); |
| 534 | 535 |
| @@ -535,11 +536,11 @@ | ||
| 535 | 536 | NsmThreadConnectionList::ConstAutoLock lock(g_NsmSystem.Connections); |
| 536 | 537 | const NsmConnectionList &p = lock.List(); |
| 537 | 538 | |
| 538 | - if (std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(connection)) == p.end()) | |
| 539 | + if(std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(connection)) == p.end()) | |
| 539 | 540 | return 0; |
| 540 | 541 | |
| 541 | 542 | const TNsmConnectionInfo &pin = *reinterpret_cast<PNsmConnectionInfo>(lParam); |
| 542 | - switch (pin.nInfoKey) | |
| 543 | + switch(pin.nInfoKey) | |
| 543 | 544 | { |
| 544 | 545 | case NMCI_PROTOCOL: |
| 545 | 546 | //ReadOnly |
| @@ -592,13 +593,13 @@ | ||
| 592 | 593 | return 1; |
| 593 | 594 | } |
| 594 | 595 | |
| 595 | - LONG_PTR Service::DoEnumConnections(const WPARAM wParam,const LPARAM lParam) | |
| 596 | + LONG_PTR Service::DoEnumConnections(WPARAM wParam, LPARAM lParam) | |
| 596 | 597 | { |
| 597 | 598 | NsmThreadConnectionList::ConstAutoLock lock(g_NsmSystem.Connections); |
| 598 | 599 | const NsmConnectionList &p = lock.List(); |
| 599 | 600 | |
| 600 | - for (NsmConnectionList::const_iterator it = p.begin(); it != p.end(); ++it) | |
| 601 | - reinterpret_cast<TEnumConnectionCallback>(wParam) (reinterpret_cast<HNsmConnection>(it->get()), lParam); | |
| 601 | + for(NsmConnectionList::const_iterator it = p.begin(); it != p.end(); ++it) | |
| 602 | + reinterpret_cast<TEnumConnectionCallback>(wParam)(reinterpret_cast<HNsmConnection>(it->get()), lParam); | |
| 602 | 603 | |
| 603 | 604 | return 0; |
| 604 | 605 | } |
| @@ -605,7 +606,7 @@ | ||
| 605 | 606 | |
| 606 | 607 | // ----------------------------------------------------------------------------- |
| 607 | 608 | |
| 608 | - LONG_PTR Service::DoAddMember(const WPARAM wParam,const LPARAM lParam) | |
| 609 | + LONG_PTR Service::DoAddMember(WPARAM wParam, LPARAM lParam) | |
| 609 | 610 | { |
| 610 | 611 | if(!lParam) |
| 611 | 612 | return 0; |
| @@ -615,7 +616,7 @@ | ||
| 615 | 616 | const NsmConnectionList &p = lock.List(); |
| 616 | 617 | NsmConnectionList::const_iterator it = |
| 617 | 618 | std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(reinterpret_cast<NsmConnection *>(wParam))); |
| 618 | - if (it == p.end()) | |
| 619 | + if(it == p.end()) | |
| 619 | 620 | return 0; |
| 620 | 621 | |
| 621 | 622 | const TAddMemberInfo &pin = *reinterpret_cast<PAddMemberInfo>(lParam); |
| @@ -627,7 +628,7 @@ | ||
| 627 | 628 | |
| 628 | 629 | NsmMemberList &list = (*it)->SelectList(pin.nListKind); |
| 629 | 630 | |
| 630 | - if(!list.insert(NsmMemberList::value_type(q->Account,q)).second) | |
| 631 | + if(!list.insert(NsmMemberList::value_type(q->Account, q)).second) | |
| 631 | 632 | return 0; |
| 632 | 633 | } |
| 633 | 634 | g_NsmCom.NotifyEvent(g_NsmSystem.HConnectionMembersAdd, wParam, lParam); |
| @@ -634,7 +635,7 @@ | ||
| 634 | 635 | return 1; |
| 635 | 636 | } |
| 636 | 637 | |
| 637 | - LONG_PTR Service::DoRemoveMember(const WPARAM wParam,const LPARAM lParam) | |
| 638 | + LONG_PTR Service::DoRemoveMember(WPARAM wParam, LPARAM lParam) | |
| 638 | 639 | { |
| 639 | 640 | { |
| 640 | 641 | NsmThreadConnectionList::ConstAutoLock lock(g_NsmSystem.Connections); |
| @@ -641,12 +642,12 @@ | ||
| 641 | 642 | const NsmConnectionList &p = lock.List(); |
| 642 | 643 | NsmConnectionList::const_iterator it = |
| 643 | 644 | std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(reinterpret_cast<NsmConnection *>(wParam))); |
| 644 | - if (it == p.end()) | |
| 645 | + if(it == p.end()) | |
| 645 | 646 | return 0; |
| 646 | 647 | |
| 647 | 648 | NsmMemberList &list = (*it)->SelectList(reinterpret_cast<PNsmMemberInfo>(lParam)->nListKind); |
| 648 | 649 | NsmMemberList::iterator it2 = list.find(c2t(reinterpret_cast<PRemoveMemberInfo>(lParam)->lpAccount)); |
| 649 | - if (it2 == list.end()) | |
| 650 | + if(it2 == list.end()) | |
| 650 | 651 | return 0; |
| 651 | 652 | |
| 652 | 653 | list.erase(it2); |
| @@ -655,7 +656,7 @@ | ||
| 655 | 656 | return 1; |
| 656 | 657 | } |
| 657 | 658 | |
| 658 | - LONG_PTR Service::DoSetMemberInfo(const WPARAM wParam,const LPARAM lParam) | |
| 659 | + LONG_PTR Service::DoSetMemberInfo(WPARAM wParam, LPARAM lParam) | |
| 659 | 660 | { |
| 660 | 661 | const TNsmMemberInfo &MemberInfo = *reinterpret_cast<PNsmMemberInfo>(lParam); |
| 661 | 662 | { |
| @@ -663,17 +664,17 @@ | ||
| 663 | 664 | const NsmConnectionList &p = lock.List(); |
| 664 | 665 | NsmConnectionList::const_iterator it = |
| 665 | 666 | std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(reinterpret_cast<NsmConnection *>(wParam))); |
| 666 | - if (it == p.end()) | |
| 667 | + if(it == p.end()) | |
| 667 | 668 | return 0; |
| 668 | 669 | |
| 669 | 670 | const NsmMemberList &list = (*it)->SelectList(reinterpret_cast<PNsmMemberInfo>(lParam)->nListKind); |
| 670 | 671 | NsmMemberList::const_iterator it2 = list.find(c2t(reinterpret_cast<PRemoveMemberInfo>(lParam)->lpAccount)); |
| 671 | - if (it2 == list.end()) | |
| 672 | + if(it2 == list.end()) | |
| 672 | 673 | return 0; |
| 673 | 674 | |
| 674 | 675 | g_NsmCom.NotifyEvent(g_NsmSystem.HConnectionMembersInfoChanging, wParam, lParam); |
| 675 | 676 | NsmMember &Member = *it2->second; |
| 676 | - switch (MemberInfo.nInfoKey) | |
| 677 | + switch(MemberInfo.nInfoKey) | |
| 677 | 678 | { |
| 678 | 679 | case NMMI_ACCOUNT: |
| 679 | 680 | Member.Account = Common::NsmInfoUtility::NsmInfoToStr(MemberInfo.lpInfo); |
| @@ -710,28 +711,28 @@ | ||
| 710 | 711 | break; |
| 711 | 712 | } |
| 712 | 713 | } |
| 713 | - if ((MemberInfo.nFlags & NMIF_NOCHANGEEVENT) == 0) | |
| 714 | + if((MemberInfo.nFlags & NMIF_NOCHANGEEVENT) == 0) | |
| 714 | 715 | g_NsmCom.NotifyEvent(g_NsmSystem.HConnectionMembersInfoChange, wParam, lParam); |
| 715 | 716 | return 1; |
| 716 | 717 | } |
| 717 | 718 | |
| 718 | - LONG_PTR Service::DoGetMemberInfo(const WPARAM wParam,const LPARAM lParam) | |
| 719 | + LONG_PTR Service::DoGetMemberInfo(WPARAM wParam, LPARAM lParam) | |
| 719 | 720 | { |
| 720 | 721 | NsmThreadConnectionList::ConstAutoLock lock(g_NsmSystem.Connections); |
| 721 | 722 | const NsmConnectionList &p = lock.List(); |
| 722 | 723 | NsmConnectionList::const_iterator it = |
| 723 | 724 | std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(reinterpret_cast<NsmConnection *>(wParam))); |
| 724 | - if (it == p.end()) | |
| 725 | + if(it == p.end()) | |
| 725 | 726 | return 0; |
| 726 | 727 | |
| 727 | 728 | const PNsmMemberInfo pin = reinterpret_cast<PNsmMemberInfo>(lParam); |
| 728 | 729 | const NsmMemberList &list = (*it)->SelectList(pin->nListKind); |
| 729 | 730 | NsmMemberList::const_iterator it2 = list.find(c2t(pin->lpAccount)); |
| 730 | - if (it2 == list.end()) | |
| 731 | + if(it2 == list.end()) | |
| 731 | 732 | return 0; |
| 732 | 733 | |
| 733 | 734 | const NsmMember &Member = *it2->second; |
| 734 | - switch (pin->nInfoKey) | |
| 735 | + switch(pin->nInfoKey) | |
| 735 | 736 | { |
| 736 | 737 | case NMMI_ACCOUNT: |
| 737 | 738 | //HACK:API 2.3 |
| @@ -760,7 +761,7 @@ | ||
| 760 | 761 | } |
| 761 | 762 | } |
| 762 | 763 | |
| 763 | - LONG_PTR Service::DoEnumMembers(const WPARAM wParam,const LPARAM lParam) | |
| 764 | + LONG_PTR Service::DoEnumMembers(WPARAM wParam, LPARAM lParam) | |
| 764 | 765 | { |
| 765 | 766 | NsmThreadConnectionList::ConstAutoLock lock(g_NsmSystem.Connections); |
| 766 | 767 | const NsmConnectionList &p = lock.List(); |
| @@ -768,13 +769,13 @@ | ||
| 768 | 769 | NsmConnectionList::const_iterator it = |
| 769 | 770 | std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(reinterpret_cast<NsmConnection *>(wParam))); |
| 770 | 771 | |
| 771 | - if (it == p.end()) | |
| 772 | + if(it == p.end()) | |
| 772 | 773 | return 0; |
| 773 | 774 | |
| 774 | 775 | const TEnumMemberInfo &pin = *reinterpret_cast<PEnumMemberInfo>(lParam); |
| 775 | 776 | const NsmMemberList &list = (*it)->SelectList(pin.nListKind); |
| 776 | 777 | |
| 777 | - for(NsmMemberList::const_iterator it2 = list.begin() ; it2 != list.end(); ++it2) | |
| 778 | + for(NsmMemberList::const_iterator it2 = list.begin(); it2 != list.end(); ++it2) | |
| 778 | 779 | { |
| 779 | 780 | const NsmMember &Member = *it2->second; |
| 780 | 781 | pin.lpCallBackProc(t2c(Member.Account).c_str(), pin.nData); |
| @@ -782,12 +783,12 @@ | ||
| 782 | 783 | return 0; |
| 783 | 784 | } |
| 784 | 785 | |
| 785 | - LONG_PTR Service::DoBeginUpdate(const WPARAM /* wParam */ ,const LPARAM /* lParam */ ) | |
| 786 | + LONG_PTR Service::DoBeginUpdate(WPARAM /* wParam */, LPARAM /* lParam */ ) | |
| 786 | 787 | { |
| 787 | 788 | return 0; |
| 788 | 789 | } |
| 789 | 790 | |
| 790 | - LONG_PTR Service::DoEndUpdate(const WPARAM /* wParam */ ,const LPARAM /* lParam */ ) | |
| 791 | + LONG_PTR Service::DoEndUpdate(WPARAM /* wParam */, LPARAM /* lParam */ ) | |
| 791 | 792 | { |
| 792 | 793 | return 0; |
| 793 | 794 | } |
| @@ -794,7 +795,7 @@ | ||
| 794 | 795 | |
| 795 | 796 | // Group ----------------------------------------------------------------------- |
| 796 | 797 | |
| 797 | - LONG_PTR Service::DoAddGroup(const WPARAM wParam,const LPARAM lParam) | |
| 798 | + LONG_PTR Service::DoAddGroup(WPARAM wParam, LPARAM lParam) | |
| 798 | 799 | { |
| 799 | 800 | { |
| 800 | 801 | NsmThreadConnectionList::ConstAutoLock lock(g_NsmSystem.Connections); |
| @@ -801,7 +802,7 @@ | ||
| 801 | 802 | const NsmConnectionList &p = lock.List(); |
| 802 | 803 | NsmConnectionList::const_iterator it = |
| 803 | 804 | std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(reinterpret_cast<NsmConnection *>(wParam))); |
| 804 | - if (it == p.end()) | |
| 805 | + if(it == p.end()) | |
| 805 | 806 | return 0; |
| 806 | 807 | |
| 807 | 808 | NsmGroupList &group = (*it)->Groups; |
| @@ -816,7 +817,7 @@ | ||
| 816 | 817 | return 1; |
| 817 | 818 | } |
| 818 | 819 | |
| 819 | - LONG_PTR Service::DoRemoveGroup(const WPARAM wParam,const LPARAM lParam) | |
| 820 | + LONG_PTR Service::DoRemoveGroup(WPARAM wParam, LPARAM lParam) | |
| 820 | 821 | { |
| 821 | 822 | { |
| 822 | 823 | NsmThreadConnectionList::ConstAutoLock lock(g_NsmSystem.Connections); |
| @@ -823,12 +824,12 @@ | ||
| 823 | 824 | const NsmConnectionList &p = lock.List(); |
| 824 | 825 | NsmConnectionList::const_iterator it = |
| 825 | 826 | std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(reinterpret_cast<NsmConnection *>(wParam))); |
| 826 | - if (it == p.end()) | |
| 827 | + if(it == p.end()) | |
| 827 | 828 | return 0; |
| 828 | 829 | |
| 829 | - NsmGroupList::iterator it2 = | |
| 830 | - std::find_if((*it)->Groups.begin(),(*it)->Groups.end(),NsmGroup::FindById(static_cast<int>(lParam))); | |
| 831 | - if (it2 == (*it)->Groups.end()) | |
| 830 | + NsmGroupList::iterator it2 = | |
| 831 | + std::find_if((*it)->Groups.begin(), (*it)->Groups.end(), NsmGroup::FindById(static_cast<int>(lParam))); | |
| 832 | + if(it2 == (*it)->Groups.end()) | |
| 832 | 833 | return 0; |
| 833 | 834 | |
| 834 | 835 | (*it)->Groups.erase(it2); |
| @@ -838,7 +839,7 @@ | ||
| 838 | 839 | return 1; |
| 839 | 840 | } |
| 840 | 841 | |
| 841 | - LONG_PTR Service::DoSetGroupInfo(const WPARAM wParam,const LPARAM lParam) | |
| 842 | + LONG_PTR Service::DoSetGroupInfo(WPARAM wParam, LPARAM lParam) | |
| 842 | 843 | { |
| 843 | 844 | TNsmGroupInfo & GroupInfo = *reinterpret_cast<PNsmGroupInfo>(lParam); |
| 844 | 845 | { |
| @@ -846,15 +847,15 @@ | ||
| 846 | 847 | const NsmConnectionList &p = lock.List(); |
| 847 | 848 | NsmConnectionList::const_iterator it = |
| 848 | 849 | std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(reinterpret_cast<NsmConnection *>(wParam))); |
| 849 | - if (it == p.end()) | |
| 850 | + if(it == p.end()) | |
| 850 | 851 | return 0; |
| 851 | 852 | |
| 852 | - NsmGroupList::iterator it2 = | |
| 853 | - std::find_if((*it)->Groups.begin(),(*it)->Groups.end(),NsmGroup::FindById(GroupInfo.nGroupId)); | |
| 854 | - if (it2 == (*it)->Groups.end()) | |
| 853 | + NsmGroupList::iterator it2 = | |
| 854 | + std::find_if((*it)->Groups.begin(), (*it)->Groups.end(), NsmGroup::FindById(GroupInfo.nGroupId)); | |
| 855 | + if(it2 == (*it)->Groups.end()) | |
| 855 | 856 | return 0; |
| 856 | 857 | |
| 857 | - switch (reinterpret_cast<PNsmGroupInfo>(lParam)->nInfoKey) | |
| 858 | + switch(reinterpret_cast<PNsmGroupInfo>(lParam)->nInfoKey) | |
| 858 | 859 | { |
| 859 | 860 | case NMGI_ID: |
| 860 | 861 | (*it2)->Id = Common::NsmInfoUtility::NsmInfoToInt(GroupInfo.lpInfo); |
| @@ -870,28 +871,28 @@ | ||
| 870 | 871 | break; |
| 871 | 872 | } |
| 872 | 873 | } |
| 873 | - if ((GroupInfo.nFlags & NMIF_NOCHANGEEVENT) == 0) | |
| 874 | + if((GroupInfo.nFlags & NMIF_NOCHANGEEVENT) == 0) | |
| 874 | 875 | g_NsmCom.NotifyEvent(g_NsmSystem.HConnectionGroupsInfoChange, wParam, lParam); |
| 875 | 876 | return 1; |
| 876 | 877 | } |
| 877 | 878 | |
| 878 | - LONG_PTR Service::DoGetGroupInfo(const WPARAM wParam,const LPARAM lParam) | |
| 879 | + LONG_PTR Service::DoGetGroupInfo(WPARAM wParam, LPARAM lParam) | |
| 879 | 880 | { |
| 880 | 881 | NsmThreadConnectionList::ConstAutoLock lock(g_NsmSystem.Connections); |
| 881 | 882 | const NsmConnectionList &p = lock.List(); |
| 882 | 883 | NsmConnectionList::const_iterator it = |
| 883 | 884 | std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(reinterpret_cast<NsmConnection *>(wParam))); |
| 884 | - if (it == p.end()) | |
| 885 | + if(it == p.end()) | |
| 885 | 886 | return 0; |
| 886 | 887 | |
| 887 | 888 | PNsmGroupInfo pin = reinterpret_cast<PNsmGroupInfo>(lParam); |
| 888 | 889 | |
| 889 | - NsmGroupList::iterator it2 = | |
| 890 | - std::find_if((*it)->Groups.begin(),(*it)->Groups.end(),NsmGroup::FindById(pin->nGroupId)); | |
| 891 | - if (it2 == (*it)->Groups.end()) | |
| 890 | + NsmGroupList::iterator it2 = | |
| 891 | + std::find_if((*it)->Groups.begin(), (*it)->Groups.end(), NsmGroup::FindById(pin->nGroupId)); | |
| 892 | + if(it2 == (*it)->Groups.end()) | |
| 892 | 893 | return 0; |
| 893 | 894 | |
| 894 | - switch (pin->nInfoKey) | |
| 895 | + switch(pin->nInfoKey) | |
| 895 | 896 | { |
| 896 | 897 | case NMGI_ID: |
| 897 | 898 | return Common::NsmInfoUtility::IntToNsmInfo(pin->lpInfo, (*it2)->Id); |
| @@ -906,17 +907,17 @@ | ||
| 906 | 907 | return 0; |
| 907 | 908 | } |
| 908 | 909 | |
| 909 | - LONG_PTR Service::DoEnumGroups(const WPARAM wParam,const LPARAM lParam) | |
| 910 | + LONG_PTR Service::DoEnumGroups(WPARAM wParam, LPARAM lParam) | |
| 910 | 911 | { |
| 911 | 912 | NsmThreadConnectionList::ConstAutoLock lock(g_NsmSystem.Connections); |
| 912 | 913 | const NsmConnectionList &p = lock.List(); |
| 913 | 914 | NsmConnectionList::const_iterator it = |
| 914 | 915 | std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(reinterpret_cast<NsmConnection *>(wParam))); |
| 915 | - if (it == p.end()) | |
| 916 | + if(it == p.end()) | |
| 916 | 917 | return 0; |
| 917 | 918 | |
| 918 | 919 | const NsmGroupList &gList = (*it)->Groups; |
| 919 | - for (NsmGroupList::const_iterator it2 = gList.begin(); it2 != gList.end(); ++it2) | |
| 920 | + for(NsmGroupList::const_iterator it2 = gList.begin(); it2 != gList.end(); ++it2) | |
| 920 | 921 | { |
| 921 | 922 | PEnumGroupInfo pin = reinterpret_cast<PEnumGroupInfo>(lParam); |
| 922 | 923 | pin->lpCallBackProc((*it2)->Id, pin->nData); |
| @@ -925,12 +926,12 @@ | ||
| 925 | 926 | return 0; |
| 926 | 927 | } |
| 927 | 928 | |
| 928 | - LONG_PTR Service::DoBeginGroupsUpdate(const WPARAM /* wParam */,const LPARAM /* lParam */) | |
| 929 | + LONG_PTR Service::DoBeginGroupsUpdate(WPARAM /* wParam */, LPARAM /* lParam */) | |
| 929 | 930 | { |
| 930 | 931 | return 0; |
| 931 | 932 | } |
| 932 | 933 | |
| 933 | - LONG_PTR Service::DoEndGroupsUpdate(const WPARAM /* wParam */,const LPARAM /* lParam */) | |
| 934 | + LONG_PTR Service::DoEndGroupsUpdate(WPARAM /* wParam */, LPARAM /* lParam */) | |
| 934 | 935 | { |
| 935 | 936 | return 0; |
| 936 | 937 | } |
| @@ -937,7 +938,7 @@ | ||
| 937 | 938 | |
| 938 | 939 | // Session --------------------------------------------------------------------- |
| 939 | 940 | |
| 940 | - LONG_PTR Service::DoCreateSession(const WPARAM wParam,const LPARAM lParam) | |
| 941 | + LONG_PTR Service::DoCreateSession(WPARAM wParam, LPARAM lParam) | |
| 941 | 942 | { |
| 942 | 943 | NsmSessionListSub result; |
| 943 | 944 | { |
| @@ -945,7 +946,7 @@ | ||
| 945 | 946 | const NsmConnectionList &p = lock.List(); |
| 946 | 947 | NsmConnectionList::const_iterator it = |
| 947 | 948 | std::find_if(p.begin(), p.end(), NsmConnection::FindByHandle(reinterpret_cast<NsmConnection *>(wParam))); |
| 948 | - if (it == p.end()) | |
| 949 | + if(it == p.end()) | |
| 949 | 950 | return 0; |
| 950 | 951 | |
| 951 | 952 | NsmThreadSessionList::AutoLock lock2(g_NsmSystem.Sessions); |
| @@ -962,7 +963,7 @@ | ||
| 962 | 963 | return reinterpret_cast<LONG_PTR>(result.get()); |
| 963 | 964 | } |
| 964 | 965 | |
| 965 | - LONG_PTR Service::DoDeleteSession(const WPARAM wParam,const LPARAM /* lParam */) | |
| 966 | + LONG_PTR Service::DoDeleteSession(WPARAM wParam, LPARAM /* lParam */) | |
| 966 | 967 | { |
| 967 | 968 | { |
| 968 | 969 | NsmThreadSessionList::AutoLock lock(g_NsmSystem.Sessions); |
| @@ -970,7 +971,7 @@ | ||
| 970 | 971 | |
| 971 | 972 | NsmSessionList::iterator it = |
| 972 | 973 | std::find_if(p.begin(), p.end(), NsmSession::FindByHandle(reinterpret_cast<NsmSession *>(wParam))); |
| 973 | - if (it == p.end()) | |
| 974 | + if(it == p.end()) | |
| 974 | 975 | return -1; |
| 975 | 976 | |
| 976 | 977 | g_NsmSystem.CloseRelatedFileSessions(it->get()); |
| @@ -982,7 +983,7 @@ | ||
| 982 | 983 | return 1; |
| 983 | 984 | } |
| 984 | 985 | |
| 985 | - LONG_PTR Service::DoGetSessionInfo(const WPARAM wParam,const LPARAM lParam) | |
| 986 | + LONG_PTR Service::DoGetSessionInfo(WPARAM wParam, LPARAM lParam) | |
| 986 | 987 | { |
| 987 | 988 | NsmThreadSessionList::ConstAutoLock lock(g_NsmSystem.Sessions); |
| 988 | 989 | const NsmSessionList &p = lock.List(); |
| @@ -989,12 +990,12 @@ | ||
| 989 | 990 | |
| 990 | 991 | NsmSessionList::const_iterator it = |
| 991 | 992 | std::find_if(p.begin(), p.end(), NsmSession::FindByHandle(reinterpret_cast<NsmSession *>(wParam))); |
| 992 | - if (it == p.end()) | |
| 993 | + if(it == p.end()) | |
| 993 | 994 | return 0; |
| 994 | 995 | |
| 995 | 996 | const NsmSession &session = *reinterpret_cast<NsmSession *>(wParam); |
| 996 | 997 | const PNsmSessionInfo pin = reinterpret_cast<PNsmSessionInfo>(lParam); |
| 997 | - switch (pin->nInfoKey) | |
| 998 | + switch(pin->nInfoKey) | |
| 998 | 999 | { |
| 999 | 1000 | case NMSI_CAPTION: |
| 1000 | 1001 | return Common::NsmInfoUtility::StrToNsmInfo(pin->lpInfo, session.Caption); |
| @@ -1013,7 +1014,7 @@ | ||
| 1013 | 1014 | } |
| 1014 | 1015 | } |
| 1015 | 1016 | |
| 1016 | - LONG_PTR Service::DoSetSessionInfo(const WPARAM wParam,const LPARAM lParam) | |
| 1017 | + LONG_PTR Service::DoSetSessionInfo(WPARAM wParam, LPARAM lParam) | |
| 1017 | 1018 | { |
| 1018 | 1019 | { |
| 1019 | 1020 | NsmThreadSessionList::ConstAutoLock lock(g_NsmSystem.Sessions); |
| @@ -1021,12 +1022,12 @@ | ||
| 1021 | 1022 | |
| 1022 | 1023 | NsmSessionList::const_iterator it = |
| 1023 | 1024 | std::find_if(p.begin(), p.end(), NsmSession::FindByHandle(reinterpret_cast<NsmSession *>(wParam))); |
| 1024 | - if (it == p.end()) | |
| 1025 | + if(it == p.end()) | |
| 1025 | 1026 | return 0; |
| 1026 | 1027 | |
| 1027 | 1028 | NsmSession &session = *reinterpret_cast<NsmSession *>(wParam); |
| 1028 | 1029 | const TNsmSessionInfo *const pin = reinterpret_cast<PNsmSessionInfo>(lParam); |
| 1029 | - switch (pin->nInfoKey) | |
| 1030 | + switch(pin->nInfoKey) | |
| 1030 | 1031 | { |
| 1031 | 1032 | case NMSI_CAPTION: |
| 1032 | 1033 | session.Caption = Common::NsmInfoUtility::NsmInfoToStrW(pin->lpInfo); |
| @@ -1053,18 +1054,18 @@ | ||
| 1053 | 1054 | return 1; |
| 1054 | 1055 | } |
| 1055 | 1056 | |
| 1056 | - LONG_PTR Service::DoEnumSessions(const WPARAM wParam,const LPARAM lParam) | |
| 1057 | + LONG_PTR Service::DoEnumSessions(WPARAM wParam, LPARAM lParam) | |
| 1057 | 1058 | { |
| 1058 | 1059 | NsmThreadSessionList::ConstAutoLock lock(g_NsmSystem.Sessions); |
| 1059 | 1060 | const NsmSessionList &p = lock.List(); |
| 1060 | 1061 | |
| 1061 | - for(NsmSessionList::const_iterator it = p.begin();it!=p.end();++it) | |
| 1062 | + for(NsmSessionList::const_iterator it = p.begin(); it != p.end(); ++it) | |
| 1062 | 1063 | reinterpret_cast<TEnumSessionCallback>(wParam)(reinterpret_cast<HNsmSession>(it->get()), lParam); |
| 1063 | 1064 | |
| 1064 | 1065 | return 0; |
| 1065 | 1066 | } |
| 1066 | 1067 | |
| 1067 | - LONG_PTR Service::DoAddSessionMember(const WPARAM wParam,const LPARAM lParam) | |
| 1068 | + LONG_PTR Service::DoAddSessionMember(WPARAM wParam, LPARAM lParam) | |
| 1068 | 1069 | { |
| 1069 | 1070 | if(!lParam) |
| 1070 | 1071 | return 0; |
| @@ -1075,12 +1076,12 @@ | ||
| 1075 | 1076 | |
| 1076 | 1077 | NsmSessionList::const_iterator it = |
| 1077 | 1078 | std::find_if(p.begin(), p.end(), NsmSession::FindByHandle(reinterpret_cast<NsmSession *>(wParam))); |
| 1078 | - if (it == p.end()) | |
| 1079 | + if(it == p.end()) | |
| 1079 | 1080 | return 0; |
| 1080 | 1081 | |
| 1081 | 1082 | NsmMemberListSub q(new NsmMember(c2t(reinterpret_cast<char *>(lParam)))); |
| 1082 | 1083 | |
| 1083 | - if(!(*it)->Members.insert(NsmMemberList::value_type(q->Account,q)).second) | |
| 1084 | + if(!(*it)->Members.insert(NsmMemberList::value_type(q->Account, q)).second) | |
| 1084 | 1085 | return 0; |
| 1085 | 1086 | } |
| 1086 | 1087 |
| @@ -1088,7 +1089,7 @@ | ||
| 1088 | 1089 | return 1; |
| 1089 | 1090 | } |
| 1090 | 1091 | |
| 1091 | - LONG_PTR Service::DoRemoveSessionMember(const WPARAM wParam,const LPARAM lParam) | |
| 1092 | + LONG_PTR Service::DoRemoveSessionMember(WPARAM wParam, LPARAM lParam) | |
| 1092 | 1093 | { |
| 1093 | 1094 | { |
| 1094 | 1095 | NsmThreadSessionList::ConstAutoLock lock(g_NsmSystem.Sessions); |
| @@ -1096,13 +1097,13 @@ | ||
| 1096 | 1097 | |
| 1097 | 1098 | NsmSessionList::const_iterator it = |
| 1098 | 1099 | std::find_if(p.begin(), p.end(), NsmSession::FindByHandle(reinterpret_cast<NsmSession *>(wParam))); |
| 1099 | - if (it == p.end()) | |
| 1100 | + if(it == p.end()) | |
| 1100 | 1101 | return 0; |
| 1101 | 1102 | |
| 1102 | 1103 | NsmMemberList &q = (*it)->Members; |
| 1103 | 1104 | |
| 1104 | 1105 | NsmMemberList::iterator it2 = q.find(c2t(reinterpret_cast<char *>(lParam))); |
| 1105 | - if (it2 != q.end()) | |
| 1106 | + if(it2 != q.end()) | |
| 1106 | 1107 | q.erase(it2); |
| 1107 | 1108 | } |
| 1108 | 1109 |
| @@ -1110,7 +1111,7 @@ | ||
| 1110 | 1111 | return 1; |
| 1111 | 1112 | } |
| 1112 | 1113 | |
| 1113 | - LONG_PTR Service::DoSetSessionMemberInfo(const WPARAM wParam,const LPARAM lParam) | |
| 1114 | + LONG_PTR Service::DoSetSessionMemberInfo(WPARAM wParam, LPARAM lParam) | |
| 1114 | 1115 | { |
| 1115 | 1116 | { |
| 1116 | 1117 | NsmThreadSessionList::ConstAutoLock lock(g_NsmSystem.Sessions); |
| @@ -1118,16 +1119,16 @@ | ||
| 1118 | 1119 | |
| 1119 | 1120 | NsmSessionList::const_iterator it = |
| 1120 | 1121 | std::find_if(p.begin(), p.end(), NsmSession::FindByHandle(reinterpret_cast<NsmSession *>(wParam))); |
| 1121 | - if (it == p.end()) | |
| 1122 | + if(it == p.end()) | |
| 1122 | 1123 | return 0; |
| 1123 | 1124 | |
| 1124 | 1125 | const TNsmMemberInfo &pin = *reinterpret_cast<PNsmMemberInfo>(lParam); |
| 1125 | 1126 | NsmMemberList::iterator it2 = (*it)->Members.find(c2t(pin.lpAccount)); |
| 1126 | - if (it2 == (*it)->Members.end()) | |
| 1127 | + if(it2 == (*it)->Members.end()) | |
| 1127 | 1128 | return 0; |
| 1128 | 1129 | |
| 1129 | 1130 | NsmMember &Member = *it2->second; |
| 1130 | - switch (pin.nInfoKey) | |
| 1131 | + switch(pin.nInfoKey) | |
| 1131 | 1132 | { |
| 1132 | 1133 | case NMMI_ACCOUNT: |
| 1133 | 1134 | Member.Account = Common::NsmInfoUtility::NsmInfoToStr(pin.lpInfo); |
| @@ -1155,7 +1156,7 @@ | ||
| 1155 | 1156 | return 1; |
| 1156 | 1157 | } |
| 1157 | 1158 | |
| 1158 | - LONG_PTR Service::DoGetSessionMemberInfo(const WPARAM wParam,const LPARAM lParam) | |
| 1159 | + LONG_PTR Service::DoGetSessionMemberInfo(WPARAM wParam, LPARAM lParam) | |
| 1159 | 1160 | { |
| 1160 | 1161 | NsmThreadSessionList::ConstAutoLock lock(g_NsmSystem.Sessions); |
| 1161 | 1162 | const NsmSessionList &p = lock.List(); |
| @@ -1162,16 +1163,16 @@ | ||
| 1162 | 1163 | |
| 1163 | 1164 | NsmSessionList::const_iterator it = |
| 1164 | 1165 | std::find_if(p.begin(), p.end(), NsmSession::FindByHandle(reinterpret_cast<NsmSession *>(wParam))); |
| 1165 | - if (it == p.end()) | |
| 1166 | + if(it == p.end()) | |
| 1166 | 1167 | return 0; |
| 1167 | 1168 | |
| 1168 | 1169 | const PNsmMemberInfo pin = reinterpret_cast<PNsmMemberInfo>(lParam); |
| 1169 | 1170 | NsmMemberList::iterator it2 = (*it)->Members.find(c2t(pin->lpAccount)); |
| 1170 | - if (it2 == (*it)->Members.end()) | |
| 1171 | + if(it2 == (*it)->Members.end()) | |
| 1171 | 1172 | return 0; |
| 1172 | 1173 | |
| 1173 | 1174 | const NsmMember &Member = *it2->second; |
| 1174 | - switch (pin->nInfoKey) | |
| 1175 | + switch(pin->nInfoKey) | |
| 1175 | 1176 | { |
| 1176 | 1177 | case NMMI_ACCOUNT: |
| 1177 | 1178 | //HACK:API 2.3 |
| @@ -1194,17 +1195,17 @@ | ||
| 1194 | 1195 | } |
| 1195 | 1196 | } |
| 1196 | 1197 | |
| 1197 | - LONG_PTR Service::DoBeginSessionMembersUpdate(const WPARAM /* wParam */ ,const LPARAM /* lParam */ ) | |
| 1198 | + LONG_PTR Service::DoBeginSessionMembersUpdate(WPARAM /* wParam */, LPARAM /* lParam */ ) | |
| 1198 | 1199 | { |
| 1199 | 1200 | return 0; |
| 1200 | 1201 | } |
| 1201 | 1202 | |
| 1202 | - LONG_PTR Service::DoEndSessionMembersUpdate(const WPARAM /* wParam */ ,const LPARAM /* lParam */ ) | |
| 1203 | + LONG_PTR Service::DoEndSessionMembersUpdate(WPARAM /* wParam */, LPARAM /* lParam */ ) | |
| 1203 | 1204 | { |
| 1204 | 1205 | return 0; |
| 1205 | 1206 | } |
| 1206 | 1207 | |
| 1207 | - LONG_PTR Service::DoEnumSessionMembers(const WPARAM wParam,const LPARAM lParam) | |
| 1208 | + LONG_PTR Service::DoEnumSessionMembers(WPARAM wParam, LPARAM lParam) | |
| 1208 | 1209 | { |
| 1209 | 1210 | NsmThreadSessionList::ConstAutoLock lock(g_NsmSystem.Sessions); |
| 1210 | 1211 | const NsmSessionList &p = lock.List(); |
| @@ -1211,12 +1212,12 @@ | ||
| 1211 | 1212 | |
| 1212 | 1213 | NsmSessionList::const_iterator it = |
| 1213 | 1214 | std::find_if(p.begin(), p.end(), NsmSession::FindByHandle(reinterpret_cast<NsmSession *>(wParam))); |
| 1214 | - if (it == p.end()) | |
| 1215 | + if(it == p.end()) | |
| 1215 | 1216 | return 0; |
| 1216 | 1217 | |
| 1217 | 1218 | const NsmMemberList &ls = (*it)->Members; |
| 1218 | 1219 | const TEnumMemberInfo &pin = *reinterpret_cast<PEnumMemberInfo>(lParam); |
| 1219 | - for (NsmMemberList::const_iterator itr = ls.begin(); itr != ls.end(); ++itr) | |
| 1220 | + for(NsmMemberList::const_iterator itr = ls.begin(); itr != ls.end(); ++itr) | |
| 1220 | 1221 | { |
| 1221 | 1222 | pin.lpCallBackProc(t2c(itr->second->Account).c_str(), pin.nData); |
| 1222 | 1223 | } |
| @@ -1223,7 +1224,7 @@ | ||
| 1223 | 1224 | return 0; |
| 1224 | 1225 | } |
| 1225 | 1226 | |
| 1226 | - LONG_PTR Service::DoSendMessage(const WPARAM wParam,const LPARAM lParam) | |
| 1227 | + LONG_PTR Service::DoSendMessage(WPARAM wParam, LPARAM lParam) | |
| 1227 | 1228 | { |
| 1228 | 1229 | { |
| 1229 | 1230 | NsmThreadSessionList::ConstAutoLock lock(g_NsmSystem.Sessions); |
| @@ -1231,7 +1232,7 @@ | ||
| 1231 | 1232 | |
| 1232 | 1233 | NsmSessionList::const_iterator it = |
| 1233 | 1234 | std::find_if(p.begin(), p.end(), NsmSession::FindByHandle(reinterpret_cast<NsmSession *>(wParam))); |
| 1234 | - if (it == p.end()) | |
| 1235 | + if(it == p.end()) | |
| 1235 | 1236 | return 0; |
| 1236 | 1237 | |
| 1237 | 1238 | g_NsmCom.CallService(g_NsmCom.GetService(format(NMS_PROTOCOL_SESSION_SENDMESSAGE, (*it)->Protocol.c_str())), wParam, lParam); |
| @@ -1241,7 +1242,7 @@ | ||
| 1241 | 1242 | return 1; |
| 1242 | 1243 | } |
| 1243 | 1244 | |
| 1244 | - LONG_PTR Service::DoReceiveMessage(const WPARAM wParam,const LPARAM lParam) | |
| 1245 | + LONG_PTR Service::DoReceiveMessage(WPARAM wParam, LPARAM lParam) | |
| 1245 | 1246 | { |
| 1246 | 1247 | { |
| 1247 | 1248 | NsmThreadSessionList::ConstAutoLock lock(g_NsmSystem.Sessions); |
| @@ -1249,7 +1250,7 @@ | ||
| 1249 | 1250 | |
| 1250 | 1251 | NsmSessionList::const_iterator it = |
| 1251 | 1252 | std::find_if(p.begin(), p.end(), NsmSession::FindByHandle(reinterpret_cast<NsmSession *>(wParam))); |
| 1252 | - if (it == p.end()) | |
| 1253 | + if(it == p.end()) | |
| 1253 | 1254 | return 0; |
| 1254 | 1255 | } |
| 1255 | 1256 |
| @@ -1259,7 +1260,7 @@ | ||
| 1259 | 1260 | |
| 1260 | 1261 | // FileSession --------------------------------------------------------------------- |
| 1261 | 1262 | |
| 1262 | - LONG_PTR Service::DoCreateFileSession(const WPARAM wParam,const LPARAM /* lParam */) | |
| 1263 | + LONG_PTR Service::DoCreateFileSession(WPARAM wParam, LPARAM /* lParam */) | |
| 1263 | 1264 | { |
| 1264 | 1265 | NsmFileSessionListSub result; |
| 1265 | 1266 | { |
| @@ -1269,7 +1270,7 @@ | ||
| 1269 | 1270 | NsmSessionList::const_iterator it = |
| 1270 | 1271 | std::find_if(p.begin(), p.end(), NsmSession::FindByHandle(reinterpret_cast<NsmSession*>(wParam))); |
| 1271 | 1272 | |
| 1272 | - if (it == p.end()) | |
| 1273 | + if(it == p.end()) | |
| 1273 | 1274 | return 0; |
| 1274 | 1275 | |
| 1275 | 1276 | NsmThreadFileSessionList::AutoLock lock2(g_NsmSystem.FileSessions); |
| @@ -1286,7 +1287,7 @@ | ||
| 1286 | 1287 | return reinterpret_cast<LONG_PTR>(result.get()); |
| 1287 | 1288 | } |
| 1288 | 1289 | |
| 1289 | - LONG_PTR Service::DoDeleteFileSession(const WPARAM wParam,const LPARAM /* lParam */) | |
| 1290 | + LONG_PTR Service::DoDeleteFileSession(WPARAM wParam, LPARAM /* lParam */) | |
| 1290 | 1291 | { |
| 1291 | 1292 | { |
| 1292 | 1293 | NsmThreadFileSessionList::AutoLock lock(g_NsmSystem.FileSessions); |
| @@ -1293,7 +1294,7 @@ | ||
| 1293 | 1294 | NsmFileSessionList &p = lock.List(); |
| 1294 | 1295 | NsmFileSessionList::iterator it |
| 1295 | 1296 | = std::find_if(p.begin(), p.end(), NsmFileSession::FindByHandle(reinterpret_cast<NsmFileSession *>(wParam))); |
| 1296 | - if (it == p.end()) | |
| 1297 | + if(it == p.end()) | |
| 1297 | 1298 | return -1; |
| 1298 | 1299 | |
| 1299 | 1300 | p.erase(it); |
| @@ -1304,20 +1305,20 @@ | ||
| 1304 | 1305 | return 1; |
| 1305 | 1306 | } |
| 1306 | 1307 | |
| 1307 | - LONG_PTR Service::DoGetFileSessionInfo(const WPARAM wParam,const LPARAM lParam) | |
| 1308 | + LONG_PTR Service::DoGetFileSessionInfo(WPARAM wParam, LPARAM lParam) | |
| 1308 | 1309 | { |
| 1309 | 1310 | NsmThreadFileSessionList::ConstAutoLock lock(g_NsmSystem.FileSessions); |
| 1310 | 1311 | const NsmFileSessionList &p = lock.List(); |
| 1311 | 1312 | NsmFileSessionList::const_iterator it = |
| 1312 | 1313 | std::find_if(p.begin(), p.end(), NsmFileSession::FindByHandle(reinterpret_cast<NsmFileSession *>(wParam))); |
| 1313 | - if (it == p.end()) | |
| 1314 | + if(it == p.end()) | |
| 1314 | 1315 | return 0; |
| 1315 | 1316 | |
| 1316 | 1317 | const NsmFileSession &session = *reinterpret_cast<NsmFileSession *>(wParam); |
| 1317 | 1318 | const PNsmFileSessionInfo pin = reinterpret_cast<PNsmFileSessionInfo>(lParam); |
| 1318 | - switch (pin->nInfoKey) | |
| 1319 | + switch(pin->nInfoKey) | |
| 1319 | 1320 | { |
| 1320 | - //TODO:PtrToNsmInfoが必要? | |
| 1321 | + //TODO:PtrToNsmInfoが必要? | |
| 1321 | 1322 | case NMFI_SESSION: |
| 1322 | 1323 | return Common::NsmInfoUtility::IntToNsmInfo(pin->lpInfo, reinterpret_cast<INT32>(session.Session)); |
| 1323 | 1324 | case NMFI_PROTOCOL: |
| @@ -1340,7 +1341,7 @@ | ||
| 1340 | 1341 | } |
| 1341 | 1342 | } |
| 1342 | 1343 | |
| 1343 | - LONG_PTR Service::DoSetFileSessionInfo(const WPARAM wParam,const LPARAM lParam) | |
| 1344 | + LONG_PTR Service::DoSetFileSessionInfo(WPARAM wParam, LPARAM lParam) | |
| 1344 | 1345 | { |
| 1345 | 1346 | { |
| 1346 | 1347 | NsmThreadFileSessionList::ConstAutoLock lock(g_NsmSystem.FileSessions); |
| @@ -1348,12 +1349,12 @@ | ||
| 1348 | 1349 | |
| 1349 | 1350 | NsmFileSessionList::const_iterator it = |
| 1350 | 1351 | std::find_if(p.begin(), p.end(), NsmFileSession::FindByHandle(reinterpret_cast<NsmFileSession *>(wParam))); |
| 1351 | - if (it == p.end()) | |
| 1352 | + if(it == p.end()) | |
| 1352 | 1353 | return 0; |
| 1353 | 1354 | |
| 1354 | 1355 | NsmFileSession &session = *reinterpret_cast<NsmFileSession *>(wParam); |
| 1355 | 1356 | const TNsmFileSessionInfo &pin = *reinterpret_cast<PNsmFileSessionInfo>(lParam); |
| 1356 | - switch (pin.nInfoKey) | |
| 1357 | + switch(pin.nInfoKey) | |
| 1357 | 1358 | { |
| 1358 | 1359 | case NMFI_SESSION: |
| 1359 | 1360 | //ReadOnly |
| @@ -1385,12 +1386,12 @@ | ||
| 1385 | 1386 | return 1; |
| 1386 | 1387 | } |
| 1387 | 1388 | |
| 1388 | - LONG_PTR Service::DoEnumFileSessions(const WPARAM wParam,const LPARAM lParam) | |
| 1389 | + LONG_PTR Service::DoEnumFileSessions(WPARAM wParam, LPARAM lParam) | |
| 1389 | 1390 | { |
| 1390 | 1391 | NsmThreadFileSessionList::ConstAutoLock lock(g_NsmSystem.FileSessions); |
| 1391 | 1392 | const NsmFileSessionList &p = lock.List(); |
| 1392 | 1393 | |
| 1393 | - for(NsmFileSessionList::const_iterator it = p.begin();it != p.end();++it) | |
| 1394 | + for(NsmFileSessionList::const_iterator it = p.begin(); it != p.end(); ++it) | |
| 1394 | 1395 | reinterpret_cast<TEnumFileSessionCallback>(wParam)(reinterpret_cast<HNsmFileSession>(it->get()), lParam); |
| 1395 | 1396 | |
| 1396 | 1397 | return 0; |
| @@ -1398,20 +1399,20 @@ | ||
| 1398 | 1399 | |
| 1399 | 1400 | // UIService --------------------------------------------------------------------- |
| 1400 | 1401 | |
| 1401 | - void Service::DoEnumService(const tstring &requiredService,const TEnumUIServiceInfo *const pin) | |
| 1402 | + void Service::DoEnumService(const tstring &requiredService, const TEnumUIServiceInfo* pin) | |
| 1402 | 1403 | { |
| 1403 | 1404 | NsmThreadServiceList::ConstAutoLock lock(g_NsmCom.ServiceList); |
| 1404 | 1405 | const NsmServiceList &p = lock.List(); |
| 1405 | 1406 | |
| 1406 | - for (NsmServiceList::const_iterator it = p.begin(); it != p.end(); ++it) | |
| 1407 | + for(NsmServiceList::const_iterator it = p.begin(); it != p.end(); ++it) | |
| 1407 | 1408 | { |
| 1408 | 1409 | const tstring serviceName = it->first; |
| 1409 | 1410 | |
| 1410 | 1411 | tstring::size_type pos = serviceName.rfind(TEXT('/')); |
| 1411 | - if (pos == tstring::npos) | |
| 1412 | + if(pos == tstring::npos) | |
| 1412 | 1413 | continue; |
| 1413 | 1414 | |
| 1414 | - if (requiredService != serviceName.substr(0, pos)) | |
| 1415 | + if(requiredService != serviceName.substr(0, pos)) | |
| 1415 | 1416 | continue; |
| 1416 | 1417 | |
| 1417 | 1418 | pin->lpCallBackProc(t2c(serviceName).c_str(), pin->nData); |
| @@ -1420,7 +1421,7 @@ | ||
| 1420 | 1421 | |
| 1421 | 1422 | //----------------------------------------------------------------------------------------------- |
| 1422 | 1423 | |
| 1423 | - LONG_PTR Service::DoEnumConnectionUIService(const tstring &wParam,const LPARAM lParam,const LPCTSTR main) | |
| 1424 | + LONG_PTR Service::DoEnumConnectionUIService(const tstring &wParam, LPARAM lParam, LPCTSTR main) | |
| 1424 | 1425 | { |
| 1425 | 1426 | const tstring requiredService = format(main, wParam.c_str()); |
| 1426 | 1427 | DoEnumService(requiredService, reinterpret_cast<PEnumUIServiceInfo>(lParam)); |
| @@ -1427,32 +1428,32 @@ | ||
| 1427 | 1428 | return 0; |
| 1428 | 1429 | } |
| 1429 | 1430 | |
| 1430 | - LONG_PTR Service::DoEnumConnectionUIServiceMain(const WPARAM wParam,const LPARAM lParam) | |
| 1431 | + LONG_PTR Service::DoEnumConnectionUIServiceMain(WPARAM wParam, LPARAM lParam) | |
| 1431 | 1432 | { |
| 1432 | 1433 | return DoEnumConnectionUIService(reinterpret_cast<NsmConnection *>(wParam)->Protocol, lParam, NMD_PROTOCOL_CONNECTION_UISERVICE_MAIN); |
| 1433 | 1434 | } |
| 1434 | 1435 | |
| 1435 | - LONG_PTR Service::DoEnumConnectionUIServiceMember(const WPARAM wParam,const LPARAM lParam) | |
| 1436 | + LONG_PTR Service::DoEnumConnectionUIServiceMember(WPARAM wParam, LPARAM lParam) | |
| 1436 | 1437 | { |
| 1437 | 1438 | return DoEnumConnectionUIService(reinterpret_cast<NsmConnection *>(wParam)->Protocol, lParam, NMD_PROTOCOL_CONNECTION_UISERVICE_MEMBER); |
| 1438 | 1439 | } |
| 1439 | 1440 | |
| 1440 | - LONG_PTR Service::DoEnumConnectionUIServiceGroup(const WPARAM wParam,const LPARAM lParam) | |
| 1441 | + LONG_PTR Service::DoEnumConnectionUIServiceGroup(WPARAM wParam, LPARAM lParam) | |
| 1441 | 1442 | { |
| 1442 | 1443 | return DoEnumConnectionUIService(reinterpret_cast<NsmConnection *>(wParam)->Protocol, lParam, NMD_PROTOCOL_CONNECTION_UISERVICE_GROUP); |
| 1443 | 1444 | } |
| 1444 | 1445 | |
| 1445 | - LONG_PTR Service::DoEnumSessionUIServiceMain(const WPARAM wParam,const LPARAM lParam) | |
| 1446 | + LONG_PTR Service::DoEnumSessionUIServiceMain(WPARAM wParam, LPARAM lParam) | |
| 1446 | 1447 | { |
| 1447 | 1448 | return DoEnumConnectionUIService(reinterpret_cast<NsmSession *>(wParam)->Protocol, lParam, NMD_PROTOCOL_SESSION_UISERVICE_MAIN); |
| 1448 | 1449 | } |
| 1449 | 1450 | |
| 1450 | - LONG_PTR Service::DoEnumSessionUIServiceMember(const WPARAM wParam,const LPARAM lParam) | |
| 1451 | + LONG_PTR Service::DoEnumSessionUIServiceMember(WPARAM wParam, LPARAM lParam) | |
| 1451 | 1452 | { |
| 1452 | 1453 | return DoEnumConnectionUIService(reinterpret_cast<NsmSession *>(wParam)->Protocol, lParam, NMD_PROTOCOL_SESSION_UISERVICE_MEMBER); |
| 1453 | 1454 | } |
| 1454 | 1455 | |
| 1455 | - LONG_PTR Service::DoEnumFileSessionUIServiceMain(const WPARAM wParam,const LPARAM lParam) | |
| 1456 | + LONG_PTR Service::DoEnumFileSessionUIServiceMain(WPARAM wParam, LPARAM lParam) | |
| 1456 | 1457 | { |
| 1457 | 1458 | return DoEnumConnectionUIService(reinterpret_cast<NsmFileSession *>(wParam)->Protocol, lParam, NMD_PROTOCOL_FILESESSION_UISERVICE_MAIN); |
| 1458 | 1459 | } |
| @@ -1459,15 +1460,15 @@ | ||
| 1459 | 1460 | |
| 1460 | 1461 | //----------------------------------------------------------------------------------------------- |
| 1461 | 1462 | |
| 1462 | - LONG_PTR Service::DoEnumAddInUIService(const WPARAM ,const LPARAM lParam,const LPCTSTR main) | |
| 1463 | + LONG_PTR Service::DoEnumAddInUIService(WPARAM /* wParam */, LPARAM lParam, LPCTSTR main) | |
| 1463 | 1464 | { |
| 1464 | 1465 | const TEnumUIServiceInfo *const pin = reinterpret_cast<PEnumUIServiceInfo>(lParam); |
| 1465 | 1466 | |
| 1466 | 1467 | const NsmPluginList &p = g_NsmSystem.Plugins; |
| 1467 | - for(NsmPluginList::const_iterator it = p.begin();it != p.end();++it) | |
| 1468 | + for(NsmPluginList::const_iterator it = p.begin(); it != p.end(); ++it) | |
| 1468 | 1469 | { |
| 1469 | 1470 | const tstring moduleName = (*it)->PluginInfo.ModuleName; |
| 1470 | - if (Common::ModuleUtility::ExtractModuleType(moduleName) == NMM_ADDIN) | |
| 1471 | + if(Common::ModuleUtility::ExtractModuleType(moduleName) == NMM_ADDIN) | |
| 1471 | 1472 | { |
| 1472 | 1473 | const tstring requiredService = format(main, Common::ModuleUtility::ExtractAddInName(moduleName).c_str()); |
| 1473 | 1474 | DoEnumService(requiredService, pin); |
| @@ -1477,39 +1478,39 @@ | ||
| 1477 | 1478 | return 0; |
| 1478 | 1479 | } |
| 1479 | 1480 | |
| 1480 | - LONG_PTR Service::DoEnumAddInUIServiceMain(const WPARAM wParam,const LPARAM lParam) | |
| 1481 | + LONG_PTR Service::DoEnumAddInUIServiceMain(WPARAM wParam, LPARAM lParam) | |
| 1481 | 1482 | { |
| 1482 | - return DoEnumAddInUIService(wParam,lParam,NMD_ADDIN_UISERVICE_MAIN); | |
| 1483 | + return DoEnumAddInUIService(wParam, lParam, NMD_ADDIN_UISERVICE_MAIN); | |
| 1483 | 1484 | } |
| 1484 | 1485 | |
| 1485 | - LONG_PTR Service::DoEnumAddInUIServiceMember(const WPARAM wParam,const LPARAM lParam) | |
| 1486 | + LONG_PTR Service::DoEnumAddInUIServiceMember(WPARAM wParam, LPARAM lParam) | |
| 1486 | 1487 | { |
| 1487 | - return DoEnumAddInUIService(wParam,lParam,NMD_ADDIN_UISERVICE_MEMBER); | |
| 1488 | + return DoEnumAddInUIService(wParam, lParam, NMD_ADDIN_UISERVICE_MEMBER); | |
| 1488 | 1489 | } |
| 1489 | 1490 | |
| 1490 | - LONG_PTR Service::DoEnumAddInUIServiceGroup(const WPARAM wParam,const LPARAM lParam) | |
| 1491 | + LONG_PTR Service::DoEnumAddInUIServiceGroup(WPARAM wParam, LPARAM lParam) | |
| 1491 | 1492 | { |
| 1492 | - return DoEnumAddInUIService(wParam,lParam,NMD_ADDIN_UISERVICE_GROUP); | |
| 1493 | + return DoEnumAddInUIService(wParam, lParam, NMD_ADDIN_UISERVICE_GROUP); | |
| 1493 | 1494 | } |
| 1494 | 1495 | |
| 1495 | - LONG_PTR Service::DoEnumAddInUIServiceTab(const WPARAM wParam,const LPARAM lParam) | |
| 1496 | + LONG_PTR Service::DoEnumAddInUIServiceTab(WPARAM wParam, LPARAM lParam) | |
| 1496 | 1497 | { |
| 1497 | - return DoEnumAddInUIService(wParam,lParam,NMD_ADDIN_UISERVICE_TAB); | |
| 1498 | + return DoEnumAddInUIService(wParam, lParam, NMD_ADDIN_UISERVICE_TAB); | |
| 1498 | 1499 | } |
| 1499 | 1500 | |
| 1500 | - LONG_PTR Service::DoEnumAddInUIServiceSessionMain(const WPARAM wParam,const LPARAM lParam) | |
| 1501 | + LONG_PTR Service::DoEnumAddInUIServiceSessionMain(WPARAM wParam, LPARAM lParam) | |
| 1501 | 1502 | { |
| 1502 | - return DoEnumAddInUIService(wParam,lParam,NMD_ADDIN_UISERVICE_SESSION_MAIN); | |
| 1503 | + return DoEnumAddInUIService(wParam, lParam, NMD_ADDIN_UISERVICE_SESSION_MAIN); | |
| 1503 | 1504 | } |
| 1504 | 1505 | |
| 1505 | - LONG_PTR Service::DoEnumAddInUIServiceSessionMember(const WPARAM wParam,const LPARAM lParam) | |
| 1506 | + LONG_PTR Service::DoEnumAddInUIServiceSessionMember(WPARAM wParam, LPARAM lParam) | |
| 1506 | 1507 | { |
| 1507 | - return DoEnumAddInUIService(wParam,lParam,NMD_ADDIN_UISERVICE_SESSION_MEMBER); | |
| 1508 | + return DoEnumAddInUIService(wParam, lParam, NMD_ADDIN_UISERVICE_SESSION_MEMBER); | |
| 1508 | 1509 | } |
| 1509 | 1510 | |
| 1510 | - LONG_PTR Service::DoEnumAddInUIServiceFileSessionMain(const WPARAM wParam,const LPARAM lParam) | |
| 1511 | + LONG_PTR Service::DoEnumAddInUIServiceFileSessionMain(WPARAM wParam, LPARAM lParam) | |
| 1511 | 1512 | { |
| 1512 | - return DoEnumAddInUIService(wParam,lParam,NMD_ADDIN_UISERVICE_FILESESSION_MAIN); | |
| 1513 | + return DoEnumAddInUIService(wParam, lParam, NMD_ADDIN_UISERVICE_FILESESSION_MAIN); | |
| 1513 | 1514 | } |
| 1514 | 1515 | |
| 1515 | 1516 | //-------------------------------------------------------- |
| @@ -1519,7 +1520,7 @@ | ||
| 1519 | 1520 | // NMS_SYSTEM_MODULES_REINITIALIZEPLUGINS(ヘッダ未定義)処理関数 |
| 1520 | 1521 | // プラグインの再読み込みだから無くてもいいかな。 |
| 1521 | 1522 | // 仕様自体が動的読み込みするようにできてないし。 |
| 1522 | - LONG_PTR Service::DoReInitializePlugins(const WPARAM /* wParam */,const LPARAM /* lParam */) | |
| 1523 | + LONG_PTR Service::DoReInitializePlugins(WPARAM /* wParam */, LPARAM /* lParam */) | |
| 1523 | 1524 | { |
| 1524 | 1525 | if(!g_NsmSystem.HModulesLoaded) |
| 1525 | 1526 | return 0; |
| @@ -1555,13 +1556,13 @@ | ||
| 1555 | 1556 | // NMS_SYSTEM_RESTART(ヘッダ未定義)処理関数 |
| 1556 | 1557 | // こっちは再起動関数。 |
| 1557 | 1558 | // 独自拡張だし切ってもいいと思う。 |
| 1558 | - LONG_PTR Service::DoRestart(const WPARAM /* wParam */,const LPARAM /* lParam */) | |
| 1559 | + LONG_PTR Service::DoRestart(WPARAM /* wParam */, LPARAM /* lParam */) | |
| 1559 | 1560 | { |
| 1560 | - TCHAR currentDir[MAX_PATH]; | |
| 1561 | - GetCurrentDirectory(ARRAYSIZE(currentDir),currentDir); | |
| 1561 | + std::array<TCHAR, MAX_PATH> currentDir; | |
| 1562 | + GetCurrentDirectory(std::tuple_size<decltype(currentDir)>::value, currentDir.data()); | |
| 1562 | 1563 | |
| 1563 | - ShellExecute(NULL,NULL,Application::ExeName().c_str(),CommandLineOption::Restart,currentDir,SW_SHOWDEFAULT); | |
| 1564 | - DoExit(0,0); | |
| 1564 | + ShellExecute(NULL, NULL, Application::ExeName().c_str(), CommandLineOption::Restart, currentDir.data(), SW_SHOWDEFAULT); | |
| 1565 | + DoExit(0, 0); | |
| 1565 | 1566 | |
| 1566 | 1567 | return 0; |
| 1567 | 1568 | } |
| @@ -33,7 +33,7 @@ | ||
| 33 | 33 | wc.cbSize = sizeof(wc); |
| 34 | 34 | wc.lpszClassName = TEXT("NsmMain"); |
| 35 | 35 | wc.lpfnWndProc = WndProc; |
| 36 | - wc.hInstance = static_cast<HINSTANCE>(GetModuleHandle(nullptr)); | |
| 36 | + wc.hInstance = static_cast<HINSTANCE>(GetModuleHandle(NULL)); | |
| 37 | 37 | |
| 38 | 38 | RegisterClassEx(&wc); |
| 39 | 39 |
| @@ -1,8 +1,6 @@ | ||
| 1 | 1 | #include "UNsmPlugin.h" |
| 2 | 2 | |
| 3 | -#if !defined(_WINDOWS) | |
| 4 | -#include <iostream> | |
| 5 | -#endif | |
| 3 | +#include <array> | |
| 6 | 4 | |
| 7 | 5 | #include "../../Common/UNsmConsts.h" |
| 8 | 6 | #include "../../Common/dummy.h" |
| @@ -36,9 +34,9 @@ | ||
| 36 | 34 | return; |
| 37 | 35 | |
| 38 | 36 | #if defined(_WINDOWS) |
| 39 | - TCHAR buf[MAX_PATH]; | |
| 40 | - if(GetModuleFileName(DllHandle, buf, ARRAYSIZE(buf))) | |
| 41 | - FileName = buf; | |
| 37 | + std::array<TCHAR, MAX_PATH> buf; | |
| 38 | + if(GetModuleFileName(DllHandle, buf.data(), std::tuple_size<decltype(buf)>::value)) | |
| 39 | + FileName = buf.data(); | |
| 42 | 40 | else |
| 43 | 41 | FileName = filePath; |
| 44 | 42 | #else |
| @@ -88,11 +86,11 @@ | ||
| 88 | 86 | |
| 89 | 87 | tstring NsmPlugin::GetPluginInfoEx(int infoNo) const |
| 90 | 88 | { |
| 91 | - char buf[256]; | |
| 92 | - if(0 < GetPluginInfo(infoNo, buf, sizeof(buf))) | |
| 93 | - return c2t(buf); | |
| 89 | + std::array<char, 256> buf; | |
| 90 | + if(0 < GetPluginInfo(infoNo, buf.data(), std::tuple_size<decltype(buf)>::value)) | |
| 91 | + return c2t(buf.data()); | |
| 94 | 92 | else |
| 95 | - return TEXT(""); | |
| 93 | + return tstring(); | |
| 96 | 94 | } |
| 97 | 95 | |
| 98 | 96 | int NsmPlugin::Initialize(PNsmPluginInitInfo lpPluginInitInfo) const |
| @@ -53,13 +53,13 @@ | ||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | // 二段階目の初期化 |
| 56 | - NsmMainDebug::NsmMainDebug(HWND hParent) | |
| 56 | + NsmMainDebug::NsmMainDebug() | |
| 57 | 57 | { |
| 58 | 58 | #if defined(WINCE) |
| 59 | - WNDCLASS wc = {0}; | |
| 59 | + WNDCLASS wc = {}; | |
| 60 | 60 | #else |
| 61 | - WNDCLASSEX wc = {0}; | |
| 62 | - wc.cbSize = sizeof(WNDCLASSEX); | |
| 61 | + WNDCLASSEX wc = {}; | |
| 62 | + wc.cbSize = sizeof(wc); | |
| 63 | 63 | #endif |
| 64 | 64 | wc.lpszClassName = TEXT("NsmMainDebug"); |
| 65 | 65 | wc.lpfnWndProc = DebugWndProc; |
| @@ -85,9 +85,9 @@ | ||
| 85 | 85 | CW_USEDEFAULT, CW_USEDEFAULT, |
| 86 | 86 | WindowWidth, |
| 87 | 87 | WindowHeight, |
| 88 | - hParent, | |
| 89 | 88 | NULL, |
| 90 | 89 | NULL, |
| 90 | + NULL, | |
| 91 | 91 | this); |
| 92 | 92 | |
| 93 | 93 | UpdateWindow(Handle); |
| @@ -128,10 +128,9 @@ | ||
| 128 | 128 | |
| 129 | 129 | SetWindowSubclass(hwnd, DebugSubProc, reinterpret_cast<UINT_PTR>(hwnd), reinterpret_cast<DWORD_PTR>(parent)); |
| 130 | 130 | |
| 131 | - LVCOLUMN lvcol = {0}; | |
| 131 | + LVCOLUMN lvcol = {}; | |
| 132 | 132 | lvcol.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; |
| 133 | 133 | lvcol.fmt = LVCFMT_LEFT; |
| 134 | - lvcol.iSubItem = 0; | |
| 135 | 134 | |
| 136 | 135 | for(TabChildParam::const_iterator it = param.begin(); it != param.end(); ++lvcol.iSubItem, ++it) |
| 137 | 136 | { |
| @@ -161,7 +160,7 @@ | ||
| 161 | 160 | |
| 162 | 161 | void NsmMainDebug::AdjustTabChild() const |
| 163 | 162 | { |
| 164 | - RECT rc = {0}; | |
| 163 | + RECT rc = {}; | |
| 165 | 164 | GetClientRect(TabHandle, &rc); |
| 166 | 165 | TabCtrl_AdjustRect(TabHandle, FALSE, &rc); |
| 167 | 166 |
| @@ -188,7 +187,7 @@ | ||
| 188 | 187 | |
| 189 | 188 | SetWindowSubclass(TabHandle, DebugSubProc, reinterpret_cast<UINT_PTR>(TabHandle), reinterpret_cast<DWORD_PTR>(hwnd)); |
| 190 | 189 | |
| 191 | - TCITEM tcItem = {0}; | |
| 190 | + TCITEM tcItem = {}; | |
| 192 | 191 | tcItem.mask = TCIF_TEXT; |
| 193 | 192 | tcItem.pszText = const_cast<LPTSTR>(TEXT("Modules")); |
| 194 | 193 | TabCtrl_InsertItem(TabHandle, 0, &tcItem); |
| @@ -55,17 +55,17 @@ | ||
| 55 | 55 | NsmThreadFileSessionList FileSessions; |
| 56 | 56 | NsmPluginList Plugins; |
| 57 | 57 | //--- |
| 58 | - void(NsmMainDebug::*OnConnectionChange)() const; | |
| 59 | - void(NsmMainDebug::*OnSessionChange)() const; | |
| 60 | - void(NsmMainDebug::*OnModuleChange)() const; | |
| 61 | - void(*OnFileSessionChange)(void*); //TODO:未実装 | |
| 58 | + void (NsmMainDebug::*OnConnectionChange)() const; | |
| 59 | + void (NsmMainDebug::*OnSessionChange)() const; | |
| 60 | + void (NsmMainDebug::*OnModuleChange)() const; | |
| 61 | + void (*OnFileSessionChange)(void*); //TODO:未実装 | |
| 62 | 62 | |
| 63 | 63 | //--- |
| 64 | 64 | int Initialize(); |
| 65 | 65 | int Terminate(); |
| 66 | - void CloseRelatedSessions(const NsmConnection *const connection); | |
| 66 | + void CloseRelatedSessions(const NsmConnection* connection); | |
| 67 | 67 | void CloseAllSession(); |
| 68 | - void CloseRelatedFileSessions(const NsmSession *const session); | |
| 68 | + void CloseRelatedFileSessions(const NsmSession* session); | |
| 69 | 69 | void CloseAllFileSession(); |
| 70 | 70 | void DisconnectAll(); |
| 71 | 71 |
| @@ -76,9 +76,9 @@ | ||
| 76 | 76 | class Service |
| 77 | 77 | { |
| 78 | 78 | private: |
| 79 | - static void DoEnumService(const tstring &requiredService,const TEnumUIServiceInfo *const pin); | |
| 80 | - static LONG_PTR DoEnumConnectionUIService(const tstring &wParam,const LPARAM lParam,const LPCTSTR main); | |
| 81 | - static LONG_PTR DoEnumAddInUIService(const WPARAM /*wParam */ ,const LPARAM lParam,const LPCTSTR main); | |
| 79 | + static void DoEnumService(const tstring &requiredService, const TEnumUIServiceInfo* pin); | |
| 80 | + static LONG_PTR DoEnumConnectionUIService(const tstring &wParam, LPARAM lParam, LPCTSTR main); | |
| 81 | + static LONG_PTR DoEnumAddInUIService(WPARAM /* wParam */, LPARAM lParam, LPCTSTR main); | |
| 82 | 82 | public: |
| 83 | 83 | |
| 84 | 84 | // ----------------------------------------------------------------------------- |
| @@ -86,27 +86,27 @@ | ||
| 86 | 86 | // wParam : 0 |
| 87 | 87 | // lParam : 0 |
| 88 | 88 | // Return : 0 |
| 89 | - static LONG_PTR __stdcall DoExit(const WPARAM /* wParam */,const LPARAM /* lParam */); | |
| 89 | + static LONG_PTR __stdcall DoExit(WPARAM /* wParam */, LPARAM /* lParam */); | |
| 90 | 90 | |
| 91 | 91 | // wParam : LPSTR |
| 92 | 92 | // lParam : 0 |
| 93 | 93 | // Return : 0 |
| 94 | - static LONG_PTR __stdcall DoDebugPrint(const WPARAM wParam,const LPARAM /* lParam */); | |
| 94 | + static LONG_PTR __stdcall DoDebugPrint(WPARAM wParam, LPARAM /* lParam */); | |
| 95 | 95 | |
| 96 | 96 | // wParam : TEnumProtocolCallback |
| 97 | 97 | // lParam : 任意データ |
| 98 | 98 | // Return : 0 |
| 99 | - static LONG_PTR __stdcall DoEnumProtocols(const WPARAM wParam,const LPARAM lParam); | |
| 99 | + static LONG_PTR __stdcall DoEnumProtocols(WPARAM wParam, LPARAM lParam); | |
| 100 | 100 | |
| 101 | 101 | // wParam : TEnumModuleCallback |
| 102 | 102 | // lParam : 任意データ |
| 103 | 103 | // Return : 0 |
| 104 | - static LONG_PTR __stdcall DoEnumModules(const WPARAM wParam,const LPARAM lParam); | |
| 104 | + static LONG_PTR __stdcall DoEnumModules(WPARAM wParam, LPARAM lParam); | |
| 105 | 105 | |
| 106 | 106 | // wParam : LPPLUGININFO |
| 107 | 107 | // lParam : 0 |
| 108 | 108 | // Return : 実際に lpBuffer に書き込んだ文字数 |
| 109 | - static LONG_PTR __stdcall DoGetPluginInfo(const WPARAM wParam,const LPARAM /* lParam */); | |
| 109 | + static LONG_PTR __stdcall DoGetPluginInfo(WPARAM wParam, LPARAM /* lParam */); | |
| 110 | 110 | |
| 111 | 111 | // Connection ------------------------------------------------------------------ |
| 112 | 112 |
| @@ -113,27 +113,27 @@ | ||
| 113 | 113 | // wParam : LPSTR プロトコル名 |
| 114 | 114 | // lParam : LPSTR 作成するコネクションのキャプション |
| 115 | 115 | // Return : 成功したら HNsmConnection 失敗したら 0 を返す |
| 116 | - static LONG_PTR __stdcall DoCreateConnection(const WPARAM wParam,const LPARAM lParam); | |
| 116 | + static LONG_PTR __stdcall DoCreateConnection(WPARAM wParam, LPARAM lParam); | |
| 117 | 117 | |
| 118 | 118 | // wParam : 対象 HNsmConnection |
| 119 | 119 | // lParam : 0 |
| 120 | 120 | // Return : 成功したら -1 以外を返す |
| 121 | - static LONG_PTR __stdcall DoDeleteConnection(const WPARAM wParam,const LPARAM /* lParam */ ); | |
| 121 | + static LONG_PTR __stdcall DoDeleteConnection(WPARAM wParam, LPARAM /* lParam */); | |
| 122 | 122 | |
| 123 | 123 | // wParam : 対象 HNsmConnection |
| 124 | 124 | // lParam : PNsmConnectionInfo |
| 125 | 125 | // Return : 実際に書き込んだバッファサイズ |
| 126 | - static LONG_PTR __stdcall DoGetConnectionInfo(const WPARAM wParam,const LPARAM lParam); | |
| 126 | + static LONG_PTR __stdcall DoGetConnectionInfo(WPARAM wParam, LPARAM lParam); | |
| 127 | 127 | |
| 128 | 128 | // wParam : 対象 HNsmConnection |
| 129 | 129 | // lParam : PNsmConnectionInfo |
| 130 | 130 | // Return : 成功したら 0 以外を返す |
| 131 | - static LONG_PTR __stdcall DoSetConnectionInfo(const WPARAM wParam,const LPARAM lParam); | |
| 131 | + static LONG_PTR __stdcall DoSetConnectionInfo(WPARAM wParam, LPARAM lParam); | |
| 132 | 132 | |
| 133 | 133 | // wParam : TEnumConnectionCallback コールバック関数へのポインタ |
| 134 | 134 | // lParam : コールバック関数に渡す任意データ |
| 135 | 135 | // Return : 0 |
| 136 | - static LONG_PTR __stdcall DoEnumConnections(const WPARAM wParam,const LPARAM lParam); | |
| 136 | + static LONG_PTR __stdcall DoEnumConnections(WPARAM wParam, LPARAM lParam); | |
| 137 | 137 | |
| 138 | 138 | // ----------------------------------------------------------------------------- |
| 139 | 139 |
| @@ -140,31 +140,31 @@ | ||
| 140 | 140 | // wParam : 対象 HNsmConnection |
| 141 | 141 | // lParam : PAddMemberInfo |
| 142 | 142 | // Return : 成功したら 0 以外を返す |
| 143 | - static LONG_PTR __stdcall DoAddMember(const WPARAM wParam,const LPARAM lParam); | |
| 143 | + static LONG_PTR __stdcall DoAddMember(WPARAM wParam, LPARAM lParam); | |
| 144 | 144 | |
| 145 | 145 | // wParam : 対象 HNsmConnection |
| 146 | 146 | // lParam : PRemoveMemberInfo |
| 147 | 147 | // Return : 成功したら 0 以外を返す |
| 148 | - static LONG_PTR __stdcall DoRemoveMember(const WPARAM wParam,const LPARAM lParam); | |
| 148 | + static LONG_PTR __stdcall DoRemoveMember(WPARAM wParam, LPARAM lParam); | |
| 149 | 149 | |
| 150 | 150 | // wParam : 対象 HNsmConnection |
| 151 | 151 | // lParam : PNsmMemberInfo |
| 152 | 152 | // Return : 成功したら 0 以外を返す |
| 153 | - static LONG_PTR __stdcall DoSetMemberInfo(const WPARAM wParam,const LPARAM lParam); | |
| 153 | + static LONG_PTR __stdcall DoSetMemberInfo(WPARAM wParam, LPARAM lParam); | |
| 154 | 154 | |
| 155 | 155 | // wParam : 対象 HNsmConnection |
| 156 | 156 | // lParam : PNsmMemberInfo |
| 157 | 157 | // Return : 実際に lpBuffer に書き込んだサイズ |
| 158 | - static LONG_PTR __stdcall DoGetMemberInfo(const WPARAM wParam,const LPARAM lParam); | |
| 158 | + static LONG_PTR __stdcall DoGetMemberInfo(WPARAM wParam, LPARAM lParam); | |
| 159 | 159 | |
| 160 | 160 | // wParam : 対象 HNsmConnection |
| 161 | 161 | // lParam : PEnumMemberInfo |
| 162 | 162 | // Return : 0 |
| 163 | - static LONG_PTR __stdcall DoEnumMembers(const WPARAM wParam,const LPARAM lParam); | |
| 163 | + static LONG_PTR __stdcall DoEnumMembers(WPARAM wParam, LPARAM lParam); | |
| 164 | 164 | |
| 165 | - static LONG_PTR __stdcall DoBeginUpdate(const WPARAM /* wParam */ ,const LPARAM /* lParam */ ); | |
| 165 | + static LONG_PTR __stdcall DoBeginUpdate(WPARAM /* wParam */, LPARAM /* lParam */); | |
| 166 | 166 | |
| 167 | - static LONG_PTR __stdcall DoEndUpdate(const WPARAM /* wParam */ ,const LPARAM /* lParam */ ); | |
| 167 | + static LONG_PTR __stdcall DoEndUpdate(WPARAM /* wParam */, LPARAM /* lParam */); | |
| 168 | 168 | |
| 169 | 169 | // Group ----------------------------------------------------------------------- |
| 170 | 170 |
| @@ -171,37 +171,37 @@ | ||
| 171 | 171 | // wParam : ConnectionID |
| 172 | 172 | // lParam : GroupID |
| 173 | 173 | // Return : 成功したら 0 以外を返す |
| 174 | - static LONG_PTR __stdcall DoAddGroup(const WPARAM wParam,const LPARAM lParam); | |
| 174 | + static LONG_PTR __stdcall DoAddGroup(WPARAM wParam, LPARAM lParam); | |
| 175 | 175 | |
| 176 | 176 | // wParam : ConnectionID |
| 177 | 177 | // lParam : GroupID |
| 178 | 178 | // Return : 失敗したら 0 成功したら 1 |
| 179 | - static LONG_PTR __stdcall DoRemoveGroup(const WPARAM wParam,const LPARAM lParam); | |
| 179 | + static LONG_PTR __stdcall DoRemoveGroup(WPARAM wParam, LPARAM lParam); | |
| 180 | 180 | |
| 181 | 181 | // wParam : HConnection |
| 182 | 182 | // lParam : PNsmGroupInfo |
| 183 | 183 | // Return : 失敗したら 0 成功したら 1 |
| 184 | - static LONG_PTR __stdcall DoSetGroupInfo(const WPARAM wParam,const LPARAM lParam); | |
| 184 | + static LONG_PTR __stdcall DoSetGroupInfo(WPARAM wParam, LPARAM lParam); | |
| 185 | 185 | |
| 186 | 186 | // wParam : ConnectionID |
| 187 | 187 | // lParam : PNsmGroupInfo |
| 188 | 188 | // Return : 設定したバイト数 |
| 189 | - static LONG_PTR __stdcall DoGetGroupInfo(const WPARAM wParam,const LPARAM lParam); | |
| 189 | + static LONG_PTR __stdcall DoGetGroupInfo(WPARAM wParam, LPARAM lParam); | |
| 190 | 190 | |
| 191 | 191 | // wParam : HNsmConnection |
| 192 | 192 | // lParam : PEnumGroupInfo |
| 193 | 193 | // Return : 0 |
| 194 | - static LONG_PTR __stdcall DoEnumGroups(const WPARAM wParam,const LPARAM lParam); | |
| 194 | + static LONG_PTR __stdcall DoEnumGroups(WPARAM wParam, LPARAM lParam); | |
| 195 | 195 | |
| 196 | 196 | // wParam : 親HNsmConnection |
| 197 | 197 | // lParam : 0 |
| 198 | 198 | // Return : 0 |
| 199 | - static LONG_PTR __stdcall DoBeginGroupsUpdate(const WPARAM /* wParam */,const LPARAM /* lParam */); | |
| 199 | + static LONG_PTR __stdcall DoBeginGroupsUpdate(WPARAM /* wParam */, LPARAM /* lParam */); | |
| 200 | 200 | |
| 201 | 201 | // wParam : 親HNsmConnection |
| 202 | 202 | // lParam : 0 |
| 203 | 203 | // Return : 0 |
| 204 | - static LONG_PTR __stdcall DoEndGroupsUpdate(const WPARAM /* wParam */,const LPARAM /* lParam */); | |
| 204 | + static LONG_PTR __stdcall DoEndGroupsUpdate(WPARAM /* wParam */, LPARAM /* lParam */); | |
| 205 | 205 | |
| 206 | 206 | // Session --------------------------------------------------------------------- |
| 207 | 207 |
| @@ -208,63 +208,63 @@ | ||
| 208 | 208 | // wParam : 親HNsmConnection |
| 209 | 209 | // lParam : 0 |
| 210 | 210 | // Return : 成功したら HNsmSession 、失敗したら 0 |
| 211 | - static LONG_PTR __stdcall DoCreateSession(const WPARAM wParam,const LPARAM lParam); | |
| 211 | + static LONG_PTR __stdcall DoCreateSession(WPARAM wParam, LPARAM lParam); | |
| 212 | 212 | |
| 213 | 213 | // wParam : 削除する HNsmSession |
| 214 | 214 | // lParam : 0 |
| 215 | 215 | // Return : 成功すれば -1 以外の数値 |
| 216 | - static LONG_PTR __stdcall DoDeleteSession(const WPARAM wParam,const LPARAM /* lParam */); | |
| 216 | + static LONG_PTR __stdcall DoDeleteSession(WPARAM wParam, LPARAM /* lParam */); | |
| 217 | 217 | |
| 218 | 218 | // wParam : 対象 HNsmSession |
| 219 | 219 | // lParam : PSessionInfo |
| 220 | 220 | // Return : 実際に lpBuffer に格納した情報のサイズ |
| 221 | - static LONG_PTR __stdcall DoGetSessionInfo(const WPARAM wParam,const LPARAM lParam); | |
| 221 | + static LONG_PTR __stdcall DoGetSessionInfo(WPARAM wParam, LPARAM lParam); | |
| 222 | 222 | |
| 223 | 223 | // wParam : 対象 HNsmSession |
| 224 | 224 | // lParam : PSessionInfo |
| 225 | 225 | // Return : 成功したら 0 以外を返す |
| 226 | - static LONG_PTR __stdcall DoSetSessionInfo(const WPARAM wParam,const LPARAM lParam); | |
| 226 | + static LONG_PTR __stdcall DoSetSessionInfo(WPARAM wParam, LPARAM lParam); | |
| 227 | 227 | |
| 228 | 228 | // wParam : コールバック関数へのポインタ |
| 229 | 229 | // lParam : コールバック関数に渡す任意データ |
| 230 | 230 | // Return : 0 |
| 231 | - static LONG_PTR __stdcall DoEnumSessions(const WPARAM wParam,const LPARAM lParam); | |
| 231 | + static LONG_PTR __stdcall DoEnumSessions(WPARAM wParam, LPARAM lParam); | |
| 232 | 232 | |
| 233 | 233 | // wParam : セッション識別子 |
| 234 | 234 | // lParam : PChar メンバのアカウント |
| 235 | 235 | // Return : 成功したら 0 以外を返す |
| 236 | - static LONG_PTR __stdcall DoAddSessionMember(const WPARAM wParam,const LPARAM lParam); | |
| 236 | + static LONG_PTR __stdcall DoAddSessionMember(WPARAM wParam, LPARAM lParam); | |
| 237 | 237 | |
| 238 | 238 | // wParam : セッション識別子 |
| 239 | 239 | // lParam : PChar メンバのアカウント |
| 240 | 240 | // Return : 成功したら 0 以外を返す |
| 241 | - static LONG_PTR __stdcall DoRemoveSessionMember(const WPARAM wParam,const LPARAM lParam); | |
| 241 | + static LONG_PTR __stdcall DoRemoveSessionMember(WPARAM wParam, LPARAM lParam); | |
| 242 | 242 | |
| 243 | 243 | // wParam : SessionID |
| 244 | 244 | // lParam : PMemberInfo |
| 245 | 245 | // Return : 成功すれば 0 以外を返す |
| 246 | - static LONG_PTR __stdcall DoSetSessionMemberInfo(const WPARAM wParam,const LPARAM lParam); | |
| 246 | + static LONG_PTR __stdcall DoSetSessionMemberInfo(WPARAM wParam, LPARAM lParam); | |
| 247 | 247 | |
| 248 | 248 | // wParam : SessionID |
| 249 | 249 | // lParam : PMemberInfo |
| 250 | 250 | // Return : 成功すれば 0 以外を返す |
| 251 | - static LONG_PTR __stdcall DoGetSessionMemberInfo(const WPARAM wParam,const LPARAM lParam); | |
| 251 | + static LONG_PTR __stdcall DoGetSessionMemberInfo(WPARAM wParam, LPARAM lParam); | |
| 252 | 252 | |
| 253 | - static LONG_PTR __stdcall DoBeginSessionMembersUpdate(const WPARAM /* wParam */,const LPARAM /* lParam */); | |
| 253 | + static LONG_PTR __stdcall DoBeginSessionMembersUpdate(WPARAM /* wParam */, LPARAM /* lParam */); | |
| 254 | 254 | |
| 255 | - static LONG_PTR __stdcall DoEndSessionMembersUpdate(const WPARAM /* wParam */,const LPARAM /* lParam */); | |
| 255 | + static LONG_PTR __stdcall DoEndSessionMembersUpdate(WPARAM /* wParam */, LPARAM /* lParam */); | |
| 256 | 256 | |
| 257 | - static LONG_PTR __stdcall DoEnumSessionMembers(const WPARAM wParam,const LPARAM lParam); | |
| 257 | + static LONG_PTR __stdcall DoEnumSessionMembers(WPARAM wParam, LPARAM lParam); | |
| 258 | 258 | |
| 259 | 259 | // wParam : SessionID |
| 260 | 260 | // lParam : LPMESSAGEINFO |
| 261 | 261 | // Return : 成功すれば 0 以外を返す |
| 262 | - static LONG_PTR __stdcall DoSendMessage(const WPARAM wParam,const LPARAM lParam); | |
| 262 | + static LONG_PTR __stdcall DoSendMessage(WPARAM wParam, LPARAM lParam); | |
| 263 | 263 | |
| 264 | 264 | // wParam : SessionID |
| 265 | 265 | // lParam : LPMESSAGEINFO |
| 266 | 266 | // Return : 成功すれば 0 以外を返す |
| 267 | - static LONG_PTR __stdcall DoReceiveMessage(const WPARAM wParam,const LPARAM lParam); | |
| 267 | + static LONG_PTR __stdcall DoReceiveMessage(WPARAM wParam, LPARAM lParam); | |
| 268 | 268 | |
| 269 | 269 | // FileSession -------------------------------------------------------- |
| 270 | 270 |
| @@ -271,27 +271,27 @@ | ||
| 271 | 271 | // wParam : 親HNsmSession |
| 272 | 272 | // lParam : 0 |
| 273 | 273 | // Return : 成功したら HNsmFileSession 、失敗したら 0 |
| 274 | - static LONG_PTR __stdcall DoCreateFileSession(const WPARAM wParam,const LPARAM lParam); | |
| 274 | + static LONG_PTR __stdcall DoCreateFileSession(WPARAM wParam, LPARAM lParam); | |
| 275 | 275 | |
| 276 | 276 | // wParam : 削除する HNsmFileSession |
| 277 | 277 | // lParam : 0 |
| 278 | 278 | // Return : 成功すれば -1 以外の数値 |
| 279 | - static LONG_PTR __stdcall DoDeleteFileSession(const WPARAM wParam,const LPARAM lParam); | |
| 279 | + static LONG_PTR __stdcall DoDeleteFileSession(WPARAM wParam, LPARAM lParam); | |
| 280 | 280 | |
| 281 | 281 | // wParam : 対象 HNsmFileSession |
| 282 | 282 | // lParam : PFileSessionInfo |
| 283 | 283 | // Return : 実際に lpBuffer に格納した情報のサイズ |
| 284 | - static LONG_PTR __stdcall DoGetFileSessionInfo(const WPARAM wParam,const LPARAM lParam); | |
| 284 | + static LONG_PTR __stdcall DoGetFileSessionInfo(WPARAM wParam, LPARAM lParam); | |
| 285 | 285 | |
| 286 | 286 | // wParam : 対象 HNsmFileSession |
| 287 | 287 | // lParam : PFileSessionInfo |
| 288 | 288 | // Return : 成功したら 0 以外を返す |
| 289 | - static LONG_PTR __stdcall DoSetFileSessionInfo(const WPARAM wParam,const LPARAM lParam); | |
| 289 | + static LONG_PTR __stdcall DoSetFileSessionInfo(WPARAM wParam, LPARAM lParam); | |
| 290 | 290 | |
| 291 | 291 | // wParam : コールバック関数へのポインタ |
| 292 | 292 | // lParam : コールバック関数に渡す任意データ |
| 293 | 293 | // Return : 0 |
| 294 | - static LONG_PTR __stdcall DoEnumFileSessions(const WPARAM wParam,const LPARAM lParam); | |
| 294 | + static LONG_PTR __stdcall DoEnumFileSessions(WPARAM wParam, LPARAM lParam); | |
| 295 | 295 | |
| 296 | 296 | // UIService -------------------------------------------------------- |
| 297 | 297 |
| @@ -299,37 +299,37 @@ | ||
| 299 | 299 | // wParam : ConnectionID |
| 300 | 300 | // lParam : PEnumUIServiceInfo |
| 301 | 301 | // Return : 0 |
| 302 | - static LONG_PTR __stdcall DoEnumConnectionUIServiceMain(const WPARAM wParam,const LPARAM lParam); | |
| 302 | + static LONG_PTR __stdcall DoEnumConnectionUIServiceMain(WPARAM wParam, LPARAM lParam); | |
| 303 | 303 | |
| 304 | 304 | // SYSTEM_CONNECTION_UISERVICE_MEMBER_ENUM |
| 305 | 305 | // wParam : ConnectionID |
| 306 | 306 | // lParam : PEnumUIServiceInfo |
| 307 | 307 | // Return : 0 |
| 308 | - static LONG_PTR __stdcall DoEnumConnectionUIServiceMember(const WPARAM wParam,const LPARAM lParam); | |
| 308 | + static LONG_PTR __stdcall DoEnumConnectionUIServiceMember(WPARAM wParam, LPARAM lParam); | |
| 309 | 309 | |
| 310 | 310 | // SYSTEM_CONNECTION_UISERVICE_GROUP_ENUM |
| 311 | 311 | // wParam : ConnectionID |
| 312 | 312 | // lParam : PEnumUIServiceInfo |
| 313 | 313 | // Return : 0 |
| 314 | - static LONG_PTR __stdcall DoEnumConnectionUIServiceGroup(const WPARAM wParam,const LPARAM lParam); | |
| 314 | + static LONG_PTR __stdcall DoEnumConnectionUIServiceGroup(WPARAM wParam, LPARAM lParam); | |
| 315 | 315 | |
| 316 | 316 | // SYSTEM_SESSION_UISERVICE_MAIN_ENUM |
| 317 | 317 | // wParam : HNsmSession |
| 318 | 318 | // lParam : PEnumUIServiceInfo |
| 319 | 319 | // Return : 0 |
| 320 | - static LONG_PTR __stdcall DoEnumSessionUIServiceMain(const WPARAM wParam,const LPARAM lParam); | |
| 320 | + static LONG_PTR __stdcall DoEnumSessionUIServiceMain(WPARAM wParam, LPARAM lParam); | |
| 321 | 321 | |
| 322 | 322 | // SYSTEM_SESSION_UISERVICE_MEMBER_ENUM |
| 323 | 323 | // wParam : HNsmSession |
| 324 | 324 | // lParam : PEnumUIServiceInfo |
| 325 | 325 | // Return : 0 |
| 326 | - static LONG_PTR __stdcall DoEnumSessionUIServiceMember(const WPARAM wParam,const LPARAM lParam); | |
| 326 | + static LONG_PTR __stdcall DoEnumSessionUIServiceMember(WPARAM wParam, LPARAM lParam); | |
| 327 | 327 | |
| 328 | 328 | // SYSTEM_FILESESSION_UISERVICE_MAIN_ENUM |
| 329 | 329 | // wParam : HNsmFileSession |
| 330 | 330 | // lParam : PEnumUIServiceInfo |
| 331 | 331 | // Return : 0 |
| 332 | - static LONG_PTR __stdcall DoEnumFileSessionUIServiceMain(const WPARAM wParam,const LPARAM lParam); | |
| 332 | + static LONG_PTR __stdcall DoEnumFileSessionUIServiceMain(WPARAM wParam, LPARAM lParam); | |
| 333 | 333 | |
| 334 | 334 | //-------------------------------------------------------- |
| 335 | 335 |
| @@ -337,43 +337,43 @@ | ||
| 337 | 337 | // wParam : 0 |
| 338 | 338 | // lParam : PEnumUIServiceInfo |
| 339 | 339 | // Return : 0 |
| 340 | - static LONG_PTR __stdcall DoEnumAddInUIServiceMain(const WPARAM wParam,const LPARAM lParam); | |
| 340 | + static LONG_PTR __stdcall DoEnumAddInUIServiceMain(WPARAM wParam, LPARAM lParam); | |
| 341 | 341 | |
| 342 | 342 | // SYSTEM_ADDIN_UISERVICE_MEMBER_ENUM |
| 343 | 343 | // wParam : 0 |
| 344 | 344 | // lParam : PEnumUIServiceInfo |
| 345 | 345 | // Return : 0 |
| 346 | - static LONG_PTR __stdcall DoEnumAddInUIServiceMember(const WPARAM wParam,const LPARAM lParam); | |
| 346 | + static LONG_PTR __stdcall DoEnumAddInUIServiceMember(WPARAM wParam, LPARAM lParam); | |
| 347 | 347 | |
| 348 | 348 | // SYSTEM_ADDIN_UISERVICE_GROUP_ENUM |
| 349 | 349 | // wParam : 0 |
| 350 | 350 | // lParam : PEnumUIServiceInfo |
| 351 | 351 | // Return : 0 |
| 352 | - static LONG_PTR __stdcall DoEnumAddInUIServiceGroup(const WPARAM wParam,const LPARAM lParam); | |
| 352 | + static LONG_PTR __stdcall DoEnumAddInUIServiceGroup(WPARAM wParam, LPARAM lParam); | |
| 353 | 353 | |
| 354 | 354 | // SYSTEM_ADDIN_UISERVICE_TAB_ENUM |
| 355 | 355 | // wParam : 0 |
| 356 | 356 | // lParam : PEnumUIServiceInfo |
| 357 | 357 | // Return : 0 |
| 358 | - static LONG_PTR __stdcall DoEnumAddInUIServiceTab(const WPARAM wParam,const LPARAM lParam); | |
| 358 | + static LONG_PTR __stdcall DoEnumAddInUIServiceTab(WPARAM wParam, LPARAM lParam); | |
| 359 | 359 | |
| 360 | 360 | // SYSTEM_ADDIN_UISERVICE_SESSION_MAIN_ENUM |
| 361 | 361 | // wParam : 0 |
| 362 | 362 | // lParam : PEnumUIServiceInfo |
| 363 | 363 | // Return : 0 |
| 364 | - static LONG_PTR __stdcall DoEnumAddInUIServiceSessionMain(const WPARAM wParam,const LPARAM lParam); | |
| 364 | + static LONG_PTR __stdcall DoEnumAddInUIServiceSessionMain(WPARAM wParam, LPARAM lParam); | |
| 365 | 365 | |
| 366 | 366 | // SYSTEM_ADDIN_UISERVICE_SESSION_MEMBER_ENUM |
| 367 | 367 | // wParam : 0 |
| 368 | 368 | // lParam : PEnumUIServiceInfo |
| 369 | 369 | // Return : 0 |
| 370 | - static LONG_PTR __stdcall DoEnumAddInUIServiceSessionMember(const WPARAM wParam,const LPARAM lParam); | |
| 370 | + static LONG_PTR __stdcall DoEnumAddInUIServiceSessionMember(WPARAM wParam, LPARAM lParam); | |
| 371 | 371 | |
| 372 | 372 | // SYSTEM_ADDIN_UISERVICE_FILESESSION_MAIN_ENUM |
| 373 | 373 | // wParam : 0 |
| 374 | 374 | // lParam : PEnumUIServiceInfo |
| 375 | 375 | // Return : 0 |
| 376 | - static LONG_PTR __stdcall DoEnumAddInUIServiceFileSessionMain(const WPARAM wParam,const LPARAM lParam); | |
| 376 | + static LONG_PTR __stdcall DoEnumAddInUIServiceFileSessionMain(WPARAM wParam, LPARAM lParam); | |
| 377 | 377 | |
| 378 | 378 | //-------------------------------------------------------- |
| 379 | 379 | // UFrmNsmMainから移動 |
| @@ -382,12 +382,12 @@ | ||
| 382 | 382 | // NMS_SYSTEM_MODULES_REINITIALIZE(ヘッダ未定義)処理関数 |
| 383 | 383 | // プラグインの再読み込みだから無くてもいいかな。 |
| 384 | 384 | // 仕様自体が動的読み込みするようにできてないし。 |
| 385 | - static LONG_PTR __stdcall DoReInitializePlugins(const WPARAM /* wParam */,const LPARAM /* lParam */); | |
| 385 | + static LONG_PTR __stdcall DoReInitializePlugins(WPARAM /* wParam */, LPARAM /* lParam */); | |
| 386 | 386 | |
| 387 | 387 | // NMS_SYSTEM_RESTART(ヘッダ未定義)処理関数 |
| 388 | 388 | // こっちは再起動関数。 |
| 389 | 389 | // 独自拡張だし切ってもいいと思う。 |
| 390 | - static LONG_PTR __stdcall DoRestart(const WPARAM /* wParam */,const LPARAM /* lParam */); | |
| 390 | + static LONG_PTR __stdcall DoRestart(WPARAM /* wParam */, LPARAM /* lParam */); | |
| 391 | 391 | }; |
| 392 | 392 | } |
| 393 | 393 | } |