Closed
Bug 1156398
Opened 10 years ago
Closed 10 years ago
Fix -Wunused-but-set-variable build warnings in widget/gonk/ProcessOrientation.cpp
Categories
(Core :: Hardware Abstraction Layer (HAL), defect)
Tracking
()
RESOLVED
FIXED
mozilla40
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: dholbert, Assigned: dholbert)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.86 KB,
patch
|
mwu
:
review+
|
Details | Diff | Splinter Review |
Build warning, when compiling an opt b2g build for a device:
{
widget/gonk/ProcessOrientation.cpp: In member function 'int mozilla::ProcessOrientation::OnSensorChanged(const mozilla::hal::SensorData&, int)':
widget/gonk/ProcessOrientation.cpp:210:8: warning: variable 'isAccelerating' set but not used [-Wunused-but-set-variable]
bool isAccelerating = false;
^
widget/gonk/ProcessOrientation.cpp:211:8: warning: variable 'isFlat' set but not used [-Wunused-but-set-variable]
bool isFlat = false;
^
widget/gonk/ProcessOrientation.cpp:212:8: warning: variable 'isSwinging' set but not used [-Wunused-but-set-variable]
bool isSwinging = false;
^
}
These bools are only used in a LOGD statement, which is currently #ifdeffed to be a no-op, like so:
> 30 #if 0
> 31 #define LOGD(args...) __android_log_print(ANDROID_LOG_DEBUG, "ProcessOrientation" , ## args)
> 32 #else
> 33 #define LOGD(args...)
> 34 #endif
> 35
The best way to hack around the build warning is probably just "mozilla::unused", I think. (DebugOnly<> won't work, because these variables aren't even used in debug builds, unless you tweak that "#if 0" check.)
Assignee | ||
Comment 1•10 years ago
|
||
Assignee | ||
Comment 2•10 years ago
|
||
You can't quite see it in the patch-context, but I'm adding these "unused <<" statements right after this LOGD statement which actually references these variables:
http://mxr.mozilla.org/mozilla-central/source/widget/gonk/ProcessOrientation.cpp?rev=ae78bb875714&mark=303-303,311-312#303
Updated•10 years ago
|
Attachment #8594877 -
Flags: review?(mwu) → review+
Assignee | ||
Comment 3•10 years ago
|
||
Flags: in-testsuite-
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in
before you can comment on or make changes to this bug.
Description
•