Closed Bug 502296 Opened 16 years ago Closed 16 years ago

TM: warnings in jsxdrapi.cpp

Categories

(Core :: JavaScript Engine, defect, P3)

x86
macOS
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: gal, Assigned: gal)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

../jsxdrapi.cpp: In function ‘JSBool JS_XDRDouble(JSXDRState*, jsdouble**)’: ../jsxdrapi.cpp:508: warning: ‘d’ may be used uninitialized in this function ../jsxdrapi.cpp: In function ‘JSBool XDRValueBody(JSXDRState*, uint32, jsval*)’: ../jsxdrapi.cpp:508: warning: ‘d’ may be used uninitialized in this function ../jsxdrapi.cpp:547: warning: ‘dp’ may be used uninitialized in this function ../jsxdrapi.cpp: In function ‘JSBool js_XDRAtom(JSXDRState*, JSAtom**)’: ../jsxdrapi.cpp:497: warning: ‘d’ is used uninitialized in this function
Attachment #386780 - Flags: review?(jwalden+bmo)
Comment on attachment 386780 [details] [diff] [review] shutup gcc (might me a tiny overhead, but its not a really relevant path) >diff --git a/js/src/jsxdrapi.cpp b/js/src/jsxdrapi.cpp > JS_PUBLIC_API(JSBool) > JS_XDRDouble(JSXDRState *xdr, jsdouble **dpp) > { > jsdouble d; > >- if (xdr->mode == JSXDR_ENCODE) >- d = **dpp; >+ d = (xdr->mode == JSXDR_ENCODE) ? **dpp : 0.0; > case JSVAL_DOUBLE: { > jsdouble *dp; >- if (xdr->mode == JSXDR_ENCODE) >- dp = JSVAL_TO_DOUBLE(*vp); >+ dp = (xdr->mode == JSXDR_ENCODE) ? JSVAL_TO_DOUBLE(*vp) : NULL; > if (!JS_XDRDouble(xdr, &dp)) Unify declaration and assignment while you're here.
Attachment #386780 - Flags: review?(jwalden+bmo) → review+
Pushed with the nit above addressed. http://hg.mozilla.org/tracemonkey/rev/9cb0da88df44
Severity: normal → trivial
Priority: -- → P3
Whiteboard: fixed-in-tracemonkey
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: