Closed Bug 542054 Opened 15 years ago Closed 15 years ago

Fix warning spam from jstypedarray.cpp (unsigned/signed comparison, control reaches end of non-void function)

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file)

Attached patch fixSplinter Review
When compiling jstypedarray.cpp, I get the following warning-spew: { ../../../mozilla/js/src/jstypedarray.cpp: In member function ‘bool TypedArrayTemplate<NativeType>::copyFrom(JSContext*, JSObject*, jsuint) [with NativeType = signed char]’: ../../../mozilla/js/src/jstypedarray.cpp:707: instantiated from ‘bool TypedArrayTemplate<NativeType>::init(JSContext*, JSObject*, int32, int32) [with NativeType = signed char]’ ../../../mozilla/js/src/jstypedarray.cpp:573: instantiated from ‘static JSBool TypedArrayTemplate<NativeType>::class_constructor(JSContext*, JSObject*, uintN, jsval*, jsval*) [with NativeType = signed char]’ ../../../mozilla/js/src/jstypedarray.cpp:1144: instantiated from here ../../../mozilla/js/src/jstypedarray.cpp:805: warning: comparison between signed and unsigned integer expressions ../../../mozilla/js/src/jstypedarray.cpp: In member function ‘bool TypedArrayTemplate<NativeType>::copyFrom(JSContext*, JSObject*, jsuint) [with NativeType = unsigned char]’: ../../../mozilla/js/src/jstypedarray.cpp:707: instantiated from ‘bool TypedArrayTemplate<NativeType>::init(JSContext*, JSObject*, int32, int32) [with NativeType = unsigned char]’ ../../../mozilla/js/src/jstypedarray.cpp:573: instantiated from ‘static JSBool TypedArrayTemplate<NativeType>::class_constructor(JSContext*, JSObject*, uintN, jsval*, jsval*) [with NativeType = unsigned char]’ ../../../mozilla/js/src/jstypedarray.cpp:1145: instantiated from here ../../../mozilla/js/src/jstypedarray.cpp:805: warning: comparison between signed and unsigned integer expressions ../../../mozilla/js/src/jstypedarray.cpp: In member function ‘bool TypedArrayTemplate<NativeType>::copyFrom(JSContext*, JSObject*, jsuint) [with NativeType = short int]’: ../../../mozilla/js/src/jstypedarray.cpp:707: instantiated from ‘bool TypedArrayTemplate<NativeType>::init(JSContext*, JSObject*, int32, int32) [with NativeType = short int]’ ../../../mozilla/js/src/jstypedarray.cpp:573: instantiated from ‘static JSBool TypedArrayTemplate<NativeType>::class_constructor(JSContext*, JSObject*, uintN, jsval*, jsval*) [with NativeType = short int]’ ../../../mozilla/js/src/jstypedarray.cpp:1146: instantiated from here ../../../mozilla/js/src/jstypedarray.cpp:805: warning: comparison between signed and unsigned integer expressions ../../../mozilla/js/src/jstypedarray.cpp: In member function ‘bool TypedArrayTemplate<NativeType>::copyFrom(JSContext*, JSObject*, jsuint) [with NativeType = short unsigned int]’: ../../../mozilla/js/src/jstypedarray.cpp:707: instantiated from ‘bool TypedArrayTemplate<NativeType>::init(JSContext*, JSObject*, int32, int32) [with NativeType = short unsigned int]’ ../../../mozilla/js/src/jstypedarray.cpp:573: instantiated from ‘static JSBool TypedArrayTemplate<NativeType>::class_constructor(JSContext*, JSObject*, uintN, jsval*, jsval*) [with NativeType = short unsigned int]’ ../../../mozilla/js/src/jstypedarray.cpp:1147: instantiated from here ../../../mozilla/js/src/jstypedarray.cpp:805: warning: comparison between signed and unsigned integer expressions ../../../mozilla/js/src/jstypedarray.cpp: In member function ‘bool TypedArrayTemplate<NativeType>::copyFrom(JSContext*, JSObject*, jsuint) [with NativeType = int]’: ../../../mozilla/js/src/jstypedarray.cpp:707: instantiated from ‘bool TypedArrayTemplate<NativeType>::init(JSContext*, JSObject*, int32, int32) [with NativeType = int]’ ../../../mozilla/js/src/jstypedarray.cpp:573: instantiated from ‘static JSBool TypedArrayTemplate<NativeType>::class_constructor(JSContext*, JSObject*, uintN, jsval*, jsval*) [with NativeType = int]’ ../../../mozilla/js/src/jstypedarray.cpp:1148: instantiated from here ../../../mozilla/js/src/jstypedarray.cpp:805: warning: comparison between signed and unsigned integer expressions ../../../mozilla/js/src/jstypedarray.cpp: In member function ‘bool TypedArrayTemplate<NativeType>::copyFrom(JSContext*, JSObject*, jsuint) [with NativeType = unsigned int]’: ../../../mozilla/js/src/jstypedarray.cpp:707: instantiated from ‘bool TypedArrayTemplate<NativeType>::init(JSContext*, JSObject*, int32, int32) [with NativeType = unsigned int]’ ../../../mozilla/js/src/jstypedarray.cpp:573: instantiated from ‘static JSBool TypedArrayTemplate<NativeType>::class_constructor(JSContext*, JSObject*, uintN, jsval*, jsval*) [with NativeType = unsigned int]’ ../../../mozilla/js/src/jstypedarray.cpp:1149: instantiated from here ../../../mozilla/js/src/jstypedarray.cpp:805: warning: comparison between signed and unsigned integer expressions ../../../mozilla/js/src/jstypedarray.cpp: In member function ‘bool TypedArrayTemplate<NativeType>::copyFrom(JSContext*, JSObject*, jsuint) [with NativeType = float]’: ../../../mozilla/js/src/jstypedarray.cpp:707: instantiated from ‘bool TypedArrayTemplate<NativeType>::init(JSContext*, JSObject*, int32, int32) [with NativeType = float]’ ../../../mozilla/js/src/jstypedarray.cpp:573: instantiated from ‘static JSBool TypedArrayTemplate<NativeType>::class_constructor(JSContext*, JSObject*, uintN, jsval*, jsval*) [with NativeType = float]’ ../../../mozilla/js/src/jstypedarray.cpp:1150: instantiated from here ../../../mozilla/js/src/jstypedarray.cpp:805: warning: comparison between signed and unsigned integer expressions ../../../mozilla/js/src/jstypedarray.cpp: In function ‘bool TypedArrayConstruct(JSContext*, jsint, uintN, jsval*, jsval*)’: ../../../mozilla/js/src/jstypedarray.cpp:1219: warning: control reaches end of non-void function } That's 5 instances of the same unsigned/signed comparison (with 5 lines for each of those warnings), plus one instance of a "control reaches end of non-void function" warning. Fix attached.
Attachment #423401 - Flags: review?(vladimir)
Assignee: general → dholbert
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 15 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: