Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/PluginUserSettings.cpp

Issue 11449051: Fix 64-bit conversion errors (Closed)
Patch Set: Created Aug. 16, 2013, 2:56 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 #include "PluginUserSettings.h" 2 #include "PluginUserSettings.h"
3 #include <algorithm> 3 #include <algorithm>
4 #include "PluginSettings.h" 4 #include "PluginSettings.h"
5 #include "PluginClient.h" 5 #include "PluginClient.h"
6 #include "../shared/Dictionary.h" 6 #include "../shared/Dictionary.h"
7 7
8 static const CString s_GetMessage = L"GetMessage"; 8 static const CString s_GetMessage = L"GetMessage";
9 static const CString s_GetLanguageCount = L"GetLanguageCount"; 9 static const CString s_GetLanguageCount = L"GetLanguageCount";
10 static const CString s_GetLanguageByIndex = L"GetLanguageByIndex"; 10 static const CString s_GetLanguageByIndex = L"GetLanguageByIndex";
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 size_t indxMethod = 0; 79 size_t indxMethod = 0;
80 for (; indxMethod < countof(s_Methods); indxMethod++) 80 for (; indxMethod < countof(s_Methods); indxMethod++)
81 { 81 {
82 if (*rgszNames == s_Methods[indxMethod]) 82 if (*rgszNames == s_Methods[indxMethod])
83 break; 83 break;
84 } 84 }
85 85
86 if (indxMethod == countof(s_Methods)) 86 if (indxMethod == countof(s_Methods))
87 return DISP_E_MEMBERNOTFOUND; 87 return DISP_E_MEMBERNOTFOUND;
88 88
89 *rgdispid = indxMethod; 89 *rgdispid = static_cast<DISPID>(indxMethod);
90 90
91 return S_OK; 91 return S_OK;
92 } 92 }
93 93
94 94
95 static CString sGetLanguage() 95 static CString sGetLanguage()
96 { 96 {
97 CPluginSettings* settings = CPluginSettings::GetInstance(); 97 CPluginSettings* settings = CPluginSettings::GetInstance();
98 return settings->GetSubscription(); 98 return settings->GetSubscription();
99 } 99 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 else if (s_GetLanguageCount == method) 152 else if (s_GetLanguageCount == method)
153 { 153 {
154 if (pDispparams->cArgs) 154 if (pDispparams->cArgs)
155 return DISP_E_BADPARAMCOUNT; 155 return DISP_E_BADPARAMCOUNT;
156 156
157 if (pVarResult) 157 if (pVarResult)
158 { 158 {
159 std::map<CString, CString> languageList = settings->GetFilterLanguageTitle List(); 159 std::map<CString, CString> languageList = settings->GetFilterLanguageTitle List();
160 160
161 pVarResult->vt = VT_I4; 161 pVarResult->vt = VT_I4;
162 pVarResult->lVal = languageList.size(); 162 pVarResult->lVal = static_cast<LONG>(languageList.size());
163 } 163 }
164 } 164 }
165 else if (s_GetLanguageByIndex == method) 165 else if (s_GetLanguageByIndex == method)
166 { 166 {
167 if (1 != pDispparams->cArgs) 167 if (1 != pDispparams->cArgs)
168 return DISP_E_BADPARAMCOUNT; 168 return DISP_E_BADPARAMCOUNT;
169 169
170 if (VT_I4 != pDispparams->rgvarg[0].vt) 170 if (VT_I4 != pDispparams->rgvarg[0].vt)
171 return DISP_E_TYPEMISMATCH; 171 return DISP_E_TYPEMISMATCH;
172 172
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 322
323 pVarResult->vt = VT_BSTR; 323 pVarResult->vt = VT_BSTR;
324 pVarResult->bstrVal = SysAllocString(settings->GetDocumentationLink()); 324 pVarResult->bstrVal = SysAllocString(settings->GetDocumentationLink());
325 } 325 }
326 else 326 else
327 return DISP_E_MEMBERNOTFOUND; 327 return DISP_E_MEMBERNOTFOUND;
328 328
329 return S_OK; 329 return S_OK;
330 } 330 }
331 331
OLDNEW

Powered by Google App Engine
This is Rietveld