Closed
Bug 603471
Opened 14 years ago
Closed 14 years ago
int32* and int32_t* are not inter-convertible
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: billm, Assigned: billm)
References
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file, 1 obsolete file)
1.11 KB,
patch
|
jimb
:
review+
|
Details | Diff | Splinter Review |
On Windows, int32 is typedef'd to long while int32_t is typedef'd to the compiler's 32-bit integer intrinsic. This means that passing an int32* to a function taking int32_t* causes a compiler error. The codebase contains a mixture of int32 and int32_t, so this cases problems. The problem is especially annoying because it's only a problem on Windows.
Assignee | ||
Comment 1•14 years ago
|
||
It's not entirely clear how to fix this problem. Fixing them all in one pass would rot a lot of people's patches unnecessarily. This patch makes int32 and int32_t be the same type, so that we can fix the problem incrementally.
Assignee | ||
Comment 2•14 years ago
|
||
I forgot to say: I have no idea why there was a special case for Windows in the first place. The patch seems to work now, but it would be nice if someone knew.
Comment 3•14 years ago
|
||
(In reply to comment #2) > I forgot to say: I have no idea why there was a special case for Windows in the > first place. The patch seems to work now, but it would be nice if someone knew. My understanding is that it's due to Windows lacking stdint.h.
Assignee | ||
Comment 4•14 years ago
|
||
(In reply to comment #3) > My understanding is that it's due to Windows lacking stdint.h. OK, I didn't know that. That's lame. It looks like jsinttypes.h, which provides a sort of platform-independent version of stdint.h, is newer than the definitions of int32 and uint32 in jsotypes.h. So that might explain things.
Assignee | ||
Updated•14 years ago
|
Attachment #482358 -
Flags: review?(brendan)
Comment 5•14 years ago
|
||
I think comment 3 was referring to the special case to provide definitions for int32_t and friends -- *not* for the special case in making int32 long versus JSInt32. So I think the patch here is still good to go.
Assignee | ||
Comment 6•14 years ago
|
||
The previous patch worked for the JS engine, but the browser failed to build. This fixes that problem. The issue was that some browser code was calling js_CreateArrayBuffer, which takes a jsuint. We typedef'd jsuint to a uint32. Unfortunately, the browser has its own definition of uint32 (at least in Windows). The result was a link error. I've changed jsint and jsuint to be JSInt32/JSUint32, since these are supposed to be platform-independent and they can be exposed to code outside of the JS engine. I'm still not sure this is 100% the right thing to do, but it seems to work.
Attachment #482358 -
Attachment is obsolete: true
Attachment #482581 -
Flags: review?(brendan)
Comment 7•14 years ago
|
||
Comment on attachment 482581 [details] [diff] [review] updated patch Jim did the stdint/inttypes veneering and is a better reviewer for this patch. /be
Attachment #482581 -
Flags: review?(brendan) → review?(jimb)
Comment 8•14 years ago
|
||
Can we get an expedited review on this? The patch is tiny and it blocks key perf work on trace tuning.
Comment 9•14 years ago
|
||
Reviewing...
Updated•14 years ago
|
Attachment #482581 -
Flags: review?(jimb) → review+
Comment 10•14 years ago
|
||
Looks good to me.
Assignee | ||
Comment 11•14 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/7a451e204442
Whiteboard: fixed-in-tracemonkey
Comment 12•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/7a451e204442
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•