Closed
Bug 776902
Opened 12 years ago
Closed 12 years ago
nsFilePicker nullptr related build error with vc11
Categories
(Core :: Widget: Win32, defect)
Tracking
()
RESOLVED
FIXED
mozilla17
People
(Reporter: jimm, Unassigned)
References
Details
Attachments
(1 file)
(deleted),
patch
|
bbondy
:
review+
|
Details | Diff | Splinter Review |
nsFilePicker.cpp f:/Mozilla/firefox/mc/widget/windows/nsFilePicker.cpp(542) : error C2440: '=' : cannot convert from 'nullptr' to 'int' A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type f:/Mozilla/firefox/mc/widget/windows/nsFilePicker.cpp(551) : error C2440: '=' : cannot convert from 'nullptr' to 'LPARAM' A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type f:/Mozilla/firefox/mc/widget/windows/nsFilePicker.cpp(780) : error C2440: '=' : cannot convert from 'nullptr' to 'WCHAR' A native nullptr can only be converted to bool or, using reinterpret_cast, to an integral type make[4]: *** [nsFilePicker.obj] Error 2
Comment 1•12 years ago
|
||
Should be 0, 0, L'\0' respectively. Making them all 0 would work too.
![]() |
Reporter | |
Comment 2•12 years ago
|
||
![]() |
Reporter | |
Comment 3•12 years ago
|
||
I made use of NULL instead for the string pointers.
![]() |
Reporter | |
Comment 4•12 years ago
|
||
(and function pointers)
![]() |
Reporter | |
Updated•12 years ago
|
Attachment #645286 -
Flags: review?(netzen)
Comment 5•12 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #3) > I made use of NULL instead for the string pointers. There are no string pointers or function pointers here. The first one is an int, and the last is a WCHAR (= wchar_t). NULL will work too because it's defined to be 0 anyway, but IMO it's clearer only to use it for pointers.
Updated•12 years ago
|
Attachment #645286 -
Flags: review?(netzen) → review+
![]() |
Reporter | |
Comment 6•12 years ago
|
||
Ah, your right, iImage is an int. lpfn is a function though, which is fine with NULL, and the NULL terminator I can make a '\0'.
Comment 7•12 years ago
|
||
Comment on attachment 645286 [details] [diff] [review] patch Review of attachment 645286 [details] [diff] [review]: ----------------------------------------------------------------- ::: widget/windows/nsFilePicker.cpp @@ +538,5 @@ > browserInfo.pszDisplayName = (LPWSTR)dirBuffer; > browserInfo.lpszTitle = mTitle.get(); > browserInfo.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS; > browserInfo.hwndOwner = adtw.get(); > + browserInfo.iImage = NULL; This is an index so you might as well use 0 here too. @@ +776,5 @@ > if (GetLastError() == ERROR_INVALID_PARAMETER || > CommDlgExtendedError() == FNERR_INVALIDFILENAME) { > // Probably the default file name is too long or contains illegal > // characters. Try again, without a starting file name. > + ofn.lpstrFile[0] = NULL; Agreed with previous comment. But use L'\0'
Comment 8•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/34e8766ffabd
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in
before you can comment on or make changes to this bug.
Description
•