Fix compiler warnings in APKOpen.cpp

RESOLVED FIXED in Firefox 16

Status

()

Firefox for Android
General
--
minor
RESOLVED FIXED
5 years ago
11 months ago

People

(Reporter: cpeterson, Assigned: cpeterson)

Tracking

Trunk
Firefox 16
ARM
Android
Points:
---

Firefox Tracking Flags

(firefox15 wontfix, firefox16 fixed)

Details

Attachments

(1 attachment)

Comment hidden (empty)
(Assignee)

Comment 1

5 years ago
Created attachment 635145 [details] [diff] [review]
fix-APKOpen-warnings.patch

Sorry to keep bugging you about low-value warnings that pop up in APKOpen.cpp!

On my dev machine, APKOpen.cpp is always the first file to be compiled. I find myself doing a double-take *every* time I run make because the first thing I see are a bunch of warnings. <:)

I add a xul_dlsym() helper function consolidate the pedantic (uintptr_t) dlsym() casts in one place.


APKOpen.cpp:551: warning: unused variable 'skipLibCache'
APKOpen.cpp: In function 'mozglueresult loadGeckoLibs(const char*)':
APKOpen.cpp:745: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object
android/APKOpen.cpp:753: warning: format '%ld' expects type 'long int', but argument 4 has type 'MOZTime'
Attachment #635145 - Flags: review?(mh+mozilla)
Comment on attachment 635145 [details] [diff] [review]
fix-APKOpen-warnings.patch

Review of attachment 635145 [details] [diff] [review]:
-----------------------------------------------------------------

::: mozglue/android/APKOpen.cpp
@@ +408,5 @@
> +static uintptr_t
> +xul_dlsym(const char * symbolName)
> +{
> +  return (uintptr_t) __wrap_dlsym(xul_handle, symbolName);
> +}

While you're doing that, you could completely get rid of casting with something like:

template <typename T> void
xul_dl_sym(const char *symbolName, T *value)
{
  *value = (T)(uintptr_t)__wrap_dlsym(xul_handle, symbolName);
}
Attachment #635145 - Flags: review?(mh+mozilla) → review+
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/9a7a000b252e
Status: NEW → ASSIGNED
status-firefox16: affected → fixed

Comment 4

5 years ago
https://hg.mozilla.org/mozilla-central/rev/9a7a000b252e
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Flipping flag, correct me if I'm wrong.
status-firefox15: affected → wontfix
(Assignee)

Comment 6

5 years ago
Thanks for fixing the status. You are correct.
You need to log in before you can comment on or make changes to this bug.