Closed
Bug 944894
Opened 11 years ago
Closed 11 years ago
Fix char16_t/wchar_t mismatch in widget/windows/.
Categories
(Core :: Widget: Win32, defect)
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: jacek, Assigned: jacek)
References
Details
(Whiteboard: [qa-])
Attachments
(1 file)
57.24 KB,
patch
|
jimm
:
review+
|
Details | Diff | Splinter Review |
This is followup of bug 928351 for widget/windows/.
- Use wchar_t for strings used in Windows API.
- Use AppendPrintf instead of sprintf_s to avoid conflictx in GfxInfo::GetCleartypeParameters
- Replace a few BeginReading() with get() where possible. get() returns the new char16ptr_t type that hides char16_t/wchar_t differences.
- Not really related, but also needed for mingw: remove a few MOZ_ALWAYS_INLINE. Those functions are implemented in KeyboardLayout.cpp, so they can't be inlined in other files and that causes errors on GCC.
- Use char16ptr_t type in a few cases, which are used both as wchar_t and char16_t.
Attachment #8340635 -
Flags: review?(jmathies)
![]() |
||
Comment 1•11 years ago
|
||
Comment on attachment 8340635 [details] [diff] [review]
patch.diff
Review of attachment 8340635 [details] [diff] [review]:
-----------------------------------------------------------------
Is PRUnichar going away at some point? There are still some uses in widget/windows/winrt/*.
http://mxr.mozilla.org/mozilla-central/search?find=%2Fwidget%2Fwindows%2Fwinrt%2F&string=PRUnichar
::: widget/windows/nsDeviceContextSpecWin.cpp
@@ +333,5 @@
> }
>
> //----------------------------------------------------------------------------------
> static nsresult
> +CheckForPrintToFile(nsIPrintSettings* aPS, const PRUnichar* aPrinterName, const PRUnichar* aUPrinterName)
Did you intend to keep these?
::: widget/windows/nsPrintSettingsWin.cpp
@@ +56,5 @@
> }
> NS_IMETHODIMP nsPrintSettingsWin::GetDeviceName(PRUnichar **aDeviceName)
> {
> NS_ENSURE_ARG_POINTER(aDeviceName);
> + *aDeviceName = mDeviceName?reinterpret_cast<PRUnichar*>(wcsdup(mDeviceName)):nullptr;
here as well?
Attachment #8340635 -
Flags: review?(jmathies) → review+
Assignee | ||
Comment 2•11 years ago
|
||
Thanks for the review.
(In reply to Jim Mathies [:jimm] from comment #1)
> Comment on attachment 8340635 [details] [diff] [review]
> patch.diff
>
> Review of attachment 8340635 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Is PRUnichar going away at some point? There are still some uses in
> widget/windows/winrt/*.
There a massive PRUnichar->char16_t change is planned. I guess it will happen for the whole tree at once.
> http://mxr.mozilla.org/mozilla-central/
> search?find=%2Fwidget%2Fwindows%2Fwinrt%2F&string=PRUnichar
>
> ::: widget/windows/nsDeviceContextSpecWin.cpp
> @@ +333,5 @@
> > }
> >
> > //----------------------------------------------------------------------------------
> > static nsresult
> > +CheckForPrintToFile(nsIPrintSettings* aPS, const PRUnichar* aPrinterName, const PRUnichar* aUPrinterName)
>
> Did you intend to keep these?
Yes, mostly because this function is currently called only with PRUnichar* arguments.
>
> ::: widget/windows/nsPrintSettingsWin.cpp
> @@ +56,5 @@
> > }
> > NS_IMETHODIMP nsPrintSettingsWin::GetDeviceName(PRUnichar **aDeviceName)
> > {
> > NS_ENSURE_ARG_POINTER(aDeviceName);
> > + *aDeviceName = mDeviceName?reinterpret_cast<PRUnichar*>(wcsdup(mDeviceName)):nullptr;
>
> here as well?
Yes, this is a part of an interface.
https://hg.mozilla.org/integration/mozilla-inbound/rev/eba1adf9482a
Comment 3•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Updated•11 years ago
|
Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•