Closed Bug 1200187 Opened 9 years ago Closed 9 years ago

Failed to compile nsEdgeReadingListExtractor.cpp: error C2664: cannot convert argument from 'char16_t *' to 'JET_PCWSTR'

Categories

(Firefox :: Migration, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 43
Tracking Status
firefox43 --- fixed

People

(Reporter: JanH, Assigned: jaws)

References

Details

Attachments

(1 file)

Trying to build Firefox on Windows 7 and VS2015 with "--enable-debug --disable-optimize" fails with this error:

> 23:40.36 nsEdgeReadingListExtractor.cpp
> 23:40.36 d:/mozilla-source/mozilla-central/browser/components/migration/nsEdgeReadingListExtractor.cpp(57): error C2664: "JET_ERR JetGetDatabaseFileInfoW(JET_PCWSTR,void *,unsigned long,unsigned long)" : Konvertierung von Argument 1 von "char16_t *" in "JET_PCWSTR" nicht möglich
> 23:40.36 d:/mozilla-source/mozilla-central/browser/components/migration/nsEdgeReadingListExtractor.cpp(57): note: Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.
> 23:40.36 d:/mozilla-source/mozilla-central/browser/components/migration/nsEdgeReadingListExtractor.cpp(80): error C2664: "JET_ERR JetAttachDatabaseW(JET_SESID,JET_PCWSTR,JET_GRBIT)" : Konvertierung von Argument 2 von "char16_t *" in "JET_PCWSTR" nicht möglich
> 23:40.36 d:/mozilla-source/mozilla-central/browser/components/migration/nsEdgeReadingListExtractor.cpp(80): note: Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.
> 23:40.36 d:/mozilla-source/mozilla-central/browser/components/migration/nsEdgeReadingListExtractor.cpp(83): error C2664: "JET_ERR JetOpenDatabaseW(JET_SESID,JET_PCWSTR,JET_PCWSTR,JET_DBID *,JET_GRBIT)" : Konvertierung von Argument 2 von "char16_t *" in "JET_PCWSTR" nicht möglich
> 23:40.36 d:/mozilla-source/mozilla-central/browser/components/migration/nsEdgeReadingListExtractor.cpp(83): note: Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.

Two days ago, before the patch for bug 1193387 was merged into mozilla-central, I was able to build successfully.
Change line 53 from
> char16_t* dbPath = ToNewUnicode(aDBPath);
to
> char16ptr_t dbPath = ToNewUnicode(aDBPath);
should fix this issue.
Yes, build ran successfully with that change, thanks.
Attached patch PatchSplinter Review
Assignee: nobody → jaws
Status: NEW → ASSIGNED
Attachment #8654902 - Flags: review?(jmathies)
Component: Build Config → Migration
Product: Core → Firefox
Comment on attachment 8654902 [details] [diff] [review]
Patch

Review of attachment 8654902 [details] [diff] [review]:
-----------------------------------------------------------------

Aren't you leaking this string? ToNewUnicode calls NS_StringCloneData which allocated a new buffer, but I don't see where that gets freed in this code. The buffer should land in something that frees it when it falls out of scope.
Attachment #8654902 - Flags: review?(jmathies) → review-
(In reply to Jim Mathies [:jimm] from comment #4)
> Aren't you leaking this string? ToNewUnicode calls NS_StringCloneData which
> allocated a new buffer, but I don't see where that gets freed in this code.
> The buffer should land in something that frees it when it falls out of scope.

Isn't that a bug from bug 1193387? I don't think that should be a blocker for this bug...
Comment on attachment 8654902 [details] [diff] [review]
Patch

Yeah you're right, I was just being lazy. Filed bug 1200656.
Attachment #8654902 - Flags: review- → review+
https://hg.mozilla.org/mozilla-central/rev/395305136abd
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: