After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 710345 - [Patches] Fix some redundant-decls
[Patches] Fix some redundant-decls
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-10-17 01:11 UTC by Djalal Harouni
Modified: 2013-10-20 19:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gconvert: fix redundant-decls of _g_charset_get_aliases() (897 bytes, patch)
2013-10-17 01:13 UTC, Djalal Harouni
committed Details | Review
gutils: fix redundant-decls of g_init_user_config_dir() (762 bytes, patch)
2013-10-17 01:15 UTC, Djalal Harouni
committed Details | Review
gio/gbufferedinputstream: fix redundant-decls of g_buffered_input_stream_finalize() (1.06 KB, patch)
2013-10-17 01:16 UTC, Djalal Harouni
committed Details | Review
[PATCH 1/2] gmem: remove glib-init.h inclusion (751 bytes, patch)
2013-10-20 13:36 UTC, Djalal Harouni
committed Details | Review
[PATCH 2/2] glib-init: fix redundant-decls of g_mem_gc_friendly (1.42 KB, patch)
2013-10-20 13:37 UTC, Djalal Harouni
committed Details | Review

Description Djalal Harouni 2013-10-17 01:11:21 UTC
The following are patches to fix some redundant-decls reports.

I just fixed the ones that seem obvious and not related to a specific OS or system.

There is a one that's get reported several times:
'g_mem_gc_friendly' global variable declared in gmem.h and glib-init.h, the declaration inside gmem.h is the older one.

This is related to this commit 47444dacc069be5984: Deprecate g_thread_init()
which is related to thread-safety, more on https://bugzilla.gnome.org/show_bug.cgi?id=660744

Since this is thread-safety stuff and perhaps others parts? I didn't touch it.

Thanks.
Comment 1 Djalal Harouni 2013-10-17 01:13:47 UTC
Created attachment 257472 [details] [review]
gconvert: fix redundant-decls of _g_charset_get_aliases()

_g_charset_get_aliases() is already declared in gcharsetprivate.h
which was added by commit 4c2a6595889eff44fa, and gconvert.c includes
this gcharsetprivate header, so no need to declare it again.
Comment 2 Djalal Harouni 2013-10-17 01:15:22 UTC
Created attachment 257473 [details] [review]
gutils: fix redundant-decls of g_init_user_config_dir()

g_init_user_config_dir() is already declared as static in this gutils.c
file, so just remove the redundant declaration.
Comment 3 Djalal Harouni 2013-10-17 01:16:41 UTC
Created attachment 257474 [details] [review]
gio/gbufferedinputstream: fix redundant-decls of g_buffered_input_stream_finalize()

g_buffered_input_stream_finalize() is already declared as static in this
gbufferedinputstream.c file, so just remove the redundant declaration.
Comment 4 Dan Winship 2013-10-19 16:22:53 UTC
(In reply to comment #0)
> There is a one that's get reported several times:
> 'g_mem_gc_friendly' global variable declared in gmem.h and glib-init.h, the
> declaration inside gmem.h is the older one.
> 
> This is related to this commit 47444dacc069be5984: Deprecate g_thread_init()
> which is related to thread-safety, more on
> https://bugzilla.gnome.org/show_bug.cgi?id=660744
> 
> Since this is thread-safety stuff and perhaps others parts? I didn't touch it.

The commits that moved things around were related to thread-safety, but the declarations themselves are entirely a compile-time matter, so there are no thread-safety concerns with where they are. Feel free to attach a patch to fix that one too.
Comment 5 Djalal Harouni 2013-10-20 13:35:34 UTC
(In reply to comment #4)
> (In reply to comment #0)
> > There is a one that's get reported several times:
> > 'g_mem_gc_friendly' global variable declared in gmem.h and glib-init.h, the
> > declaration inside gmem.h is the older one.
> > 
> > This is related to this commit 47444dacc069be5984: Deprecate g_thread_init()
> > which is related to thread-safety, more on
> > https://bugzilla.gnome.org/show_bug.cgi?id=660744
> > 
> > Since this is thread-safety stuff and perhaps others parts? I didn't touch it.
> 
> The commits that moved things around were related to thread-safety, but the
> declarations themselves are entirely a compile-time matter, so there are no
> thread-safety concerns with where they are. Feel free to attach a patch to fix
> that one too.
Ok, I'm attaching two patches that fix this.

Thanks Dan!
Comment 6 Djalal Harouni 2013-10-20 13:36:29 UTC
Created attachment 257752 [details] [review]
[PATCH 1/2] gmem: remove glib-init.h inclusion

[PATCH 1/2] gmem: remove glib-init.h inclusion

No need to include glib-init.h here. This was added by
commit 47444dacc069be but that commit did not make use of any its
exported symbols, so just remove it.
Comment 7 Djalal Harouni 2013-10-20 13:37:52 UTC
Created attachment 257753 [details] [review]
[PATCH 2/2] glib-init: fix redundant-decls of g_mem_gc_friendly

Currently g_mem_gc_friendly is declared in both gmem.h and glib-init.h
files, we will have reports on each unit that include these two files.

This patch removes the redundant declaration from glib-init.h

Since g_mem_gc_friendly is related to gmem.h and was first declared in
this header which also exports it via glib.h, then declare it in gmem.h

Other files already include gmem.h: garray.c and gslice.c, no need to
change anything.
Comment 8 Dan Winship 2013-10-20 19:45:42 UTC
great. thanks