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

Side by Side Diff: src/engine/UpdateInstallDialog.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 <sstream> 1 #include <sstream>
2 #include <string> 2 #include <string>
3 #include <Windows.h> 3 #include <Windows.h>
4 4
5 #include "../shared/Dictionary.h" 5 #include "../shared/Dictionary.h"
6 #include "../shared/Utils.h" 6 #include "../shared/Utils.h"
7 #include "UpdateInstallDialog.h" 7 #include "UpdateInstallDialog.h"
8 8
9 namespace 9 namespace
10 { 10 {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 int GetAverageCharacterWidth(HDC deviceContext) 53 int GetAverageCharacterWidth(HDC deviceContext)
54 { 54 {
55 std::wstring alphabet; 55 std::wstring alphabet;
56 for (wchar_t letter = L'A'; letter != 'Z'; letter++) 56 for (wchar_t letter = L'A'; letter != 'Z'; letter++)
57 alphabet += letter; 57 alphabet += letter;
58 RECT alphabetRect = {}; 58 RECT alphabetRect = {};
59 DrawTextW(deviceContext, alphabet.c_str(), -1, &alphabetRect, 59 DrawTextW(deviceContext, alphabet.c_str(), -1, &alphabetRect,
60 DT_CALCRECT | DT_NOPREFIX); 60 DT_CALCRECT | DT_NOPREFIX);
61 return alphabetRect.right / alphabet.length(); 61 return alphabetRect.right / static_cast<int>(alphabet.length());
62 } 62 }
63 63
64 HWND CreateStaticText(HWND parent) 64 HWND CreateStaticText(HWND parent)
65 { 65 {
66 Dictionary* dictionary = Dictionary::GetInstance(); 66 Dictionary* dictionary = Dictionary::GetInstance();
67 std::wstring text = dictionary->Lookup("updater", "install-question-text"); 67 std::wstring text = dictionary->Lookup("updater", "install-question-text");
68 68
69 HDC deviceContext = GetDC(parent); 69 HDC deviceContext = GetDC(parent);
70 const int characterWidth = GetAverageCharacterWidth(deviceContext); 70 const int characterWidth = GetAverageCharacterWidth(deviceContext);
71 const int lineLength = 40; 71 const int lineLength = 40;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 ShowWindow(window, SW_SHOW); 180 ShowWindow(window, SW_SHOW);
181 MSG message; 181 MSG message;
182 while(GetMessage(&message, 0, 0, 0) > 0) 182 while(GetMessage(&message, 0, 0, 0) > 0)
183 { 183 {
184 TranslateMessage(&message); 184 TranslateMessage(&message);
185 DispatchMessage(&message); 185 DispatchMessage(&message);
186 } 186 }
187 ShowWindow(window, SW_HIDE); 187 ShowWindow(window, SW_HIDE);
188 return message.wParam == 0; 188 return message.wParam == 0;
189 } 189 }
OLDNEW
« no previous file with comments | « src/engine/Main.cpp ('k') | src/plugin/PluginClass.cpp » ('j') | src/plugin/PluginClass.cpp » ('J')

Powered by Google App Engine
This is Rietveld