Closed Bug 766797 Opened 8 years ago Closed 8 years ago

Fix compiler warnings in APKOpen.cpp

Categories

(Firefox for Android :: General, defect, minor)

ARM
Android
defect
Not set
minor

Tracking

()

RESOLVED FIXED
Firefox 16
Tracking Status
firefox15 --- wontfix
firefox16 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

Details

Attachments

(1 file)

No description provided.
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+
https://hg.mozilla.org/mozilla-central/rev/9a7a000b252e
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Flipping flag, correct me if I'm wrong.
Thanks for fixing the status. You are correct.
You need to log in before you can comment on or make changes to this bug.