Closed Bug 453094 Opened 18 years ago Closed 17 years ago

Some strong type conversion make GCC not complain

Categories

(Core :: XPConnect, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: Techrazy.Yang, Assigned: Techrazy.Yang)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

Attached patch The trivial patch (obsolete) — — Splinter Review
I add these strong type conversion which make mingw GCC not complain...
Attachment #336311 - Flags: review?(shaver)
Attachment #336311 - Flags: review?(shaver) → review?(jorendorff)
Comment on attachment 336311 [details] [diff] [review] The trivial patch I'm not a good reviewer for this patch. I recommend jorendorff.
Blocks: 449557
Comment on attachment 336311 [details] [diff] [review] The trivial patch Thanks for posting this. > - chars = (len == 0 ? traits::sEmptyBuffer : JS_GetStringChars(s)); > - new(mBuf) implementation_type(chars, len); > + chars = (len == 0 ? > + (jschar*) traits::sEmptyBuffer : JS_GetStringChars((JSString*)s)); > + new(mBuf) implementation_type((const PRUnichar*)chars, len); Only one cast should be needed, I think. Change the type of chars to const PRUnichar *. The cast (JSString*)s looks redundant to me. > - *pstr = JS_GetStringChars(str); > + *pstr = (PRUnichar*)JS_GetStringChars((JSString*)str); Here too.
Attachment #336311 - Flags: review?(jorendorff)
Attached patch The second version (obsolete) — — Splinter Review
Attachment #336311 - Attachment is obsolete: true
Attachment #336598 - Flags: review?(jorendorff)
Jason, are you around now?
Comment on attachment 336598 [details] [diff] [review] The second version Ack! I'm sorry I missed this. Please change the type of chars to const PRUnichar * though.
Attachment #336598 - Flags: review?(jorendorff)
Do you mean this way?
Attachment #336598 - Attachment is obsolete: true
Attachment #339743 - Flags: review?(jorendorff)
Comment on attachment 339743 [details] [diff] [review] Third version [Checkin: Comment 9] Yep, that's the way.
Attachment #339743 - Flags: review?(jorendorff) → review+
Attachment #339743 - Flags: superreview?(peterv)
Attachment #339743 - Flags: superreview?(peterv) → superreview+
It's already reviewed two months ago and still applies cleanly.
Keywords: checkin-needed
Assignee: nobody → Techrazy.Yang
Attachment #339743 - Attachment description: Third version → Third version [Checkin: Comment 9]
Status: NEW → RESOLVED
Closed: 17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: