Skip to content

Commit

Permalink
Merge pull request #1000 from tbzatek/cc_attrs
Browse files Browse the repository at this point in the history
Some more symbol annotations fixes
  • Loading branch information
vojtechtrefny authored Jan 24, 2024
2 parents 0e373d0 + e77058c commit 269b9e2
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/lib/blockdev.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static void set_plugin_so_name (BDPlugin name, const gchar *so_name) {
plugins[name].spec.so_name = so_name;
}

static gint config_file_cmp (gconstpointer a, gconstpointer b, gpointer user_data __attribute__((unused))) {
static gint config_file_cmp (gconstpointer a, gconstpointer b, gpointer user_data G_GNUC_UNUSED) {
const gchar *name1 = (const gchar *) a;
const gchar *name2 = (const gchar *) b;

Expand Down
8 changes: 4 additions & 4 deletions src/plugins/check_deps.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define DBUS_PROPS_IFACE "org.freedesktop.DBus.Properties"


gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
check_deps (volatile guint *avail_deps, guint req_deps, const UtilDep *deps_specs, guint l_deps, GMutex *deps_check_lock, GError **error) {
guint i = 0;
gboolean ret = FALSE;
Expand Down Expand Up @@ -73,7 +73,7 @@ check_deps (volatile guint *avail_deps, guint req_deps, const UtilDep *deps_spec
return (val & req_deps) == req_deps;
}

gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
check_module_deps (volatile guint *avail_deps, guint req_deps, const gchar *const*modules, guint l_modules, GMutex *deps_check_lock, GError **error) {
guint i = 0;
gboolean ret = FALSE;
Expand Down Expand Up @@ -165,7 +165,7 @@ static gboolean _check_dbus_api_version (GBusType bus_type, const gchar *version
return cmp >= 0;
}

gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
check_dbus_deps (volatile guint *avail_deps, guint req_deps, const DBusDep *buses, guint l_buses, GMutex *deps_check_lock, GError **error) {
guint i = 0;
gboolean ret = FALSE;
Expand Down Expand Up @@ -320,7 +320,7 @@ static gboolean _check_util_feature (const gchar *util, const gchar *feature, co
return TRUE;
}

gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
check_features (volatile guint *avail_deps, guint req_deps, const UtilFeatureDep *deps_specs, guint l_deps, GMutex *deps_check_lock, GError **error) {
guint i = 0;
gboolean ret = FALSE;
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/dm_logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

#include "dm_logging.h"

void __attribute__ ((visibility ("hidden")))
redirect_dm_log (int level, const char *file __attribute__((unused)), int line __attribute__((unused)),
int dm_errno_or_class __attribute__((unused)), const char *f, ...) {
G_GNUC_INTERNAL void
redirect_dm_log (int level, const char *file G_GNUC_UNUSED, int line G_GNUC_UNUSED,
int dm_errno_or_class G_GNUC_UNUSED, const char *f, ...) {
gchar *dm_msg = NULL;
gchar *message = NULL;
gint ret = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dm_logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
#ifndef BD_DM_LOGGING
#define BD_DM_LOGGING

void redirect_dm_log (int level, const char *file, int line, int dm_errno_or_class, const char *f, ...);
void redirect_dm_log (int level, const char *file, int line, int dm_errno_or_class, const char *f, ...) G_GNUC_PRINTF (5, 6);

#endif /* BD_DM_LOGGING */
6 changes: 3 additions & 3 deletions src/plugins/fs/btrfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = {
* Returns: whether the @tech-@mode combination is available -- supported by the
* plugin implementation and having all the runtime dependencies available
*/
gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
bd_fs_btrfs_is_tech_avail (BDFSTech tech G_GNUC_UNUSED, guint64 mode, GError **error) {
guint32 required = 0;
guint i = 0;
Expand Down Expand Up @@ -112,8 +112,8 @@ void bd_fs_btrfs_info_free (BDFSBtrfsInfo *data) {
g_free (data);
}

BDExtraArg __attribute__ ((visibility ("hidden")))
**bd_fs_btrfs_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
G_GNUC_INTERNAL BDExtraArg **
bd_fs_btrfs_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
GPtrArray *options_array = g_ptr_array_new ();
const BDExtraArg **extra_p = NULL;

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/fs/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "fs.h"
#include "common.h"

gint __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gint
synced_close (gint fd) {
gint ret = 0;
ret = fsync (fd);
Expand All @@ -42,7 +42,7 @@ synced_close (gint fd) {
}


gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
get_uuid_label (const gchar *device, gchar **uuid, gchar **label, GError **error) {
blkid_probe probe = NULL;
gint fd = 0;
Expand Down Expand Up @@ -131,7 +131,7 @@ get_uuid_label (const gchar *device, gchar **uuid, gchar **label, GError **error
return TRUE;
}

gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
check_uuid (const gchar *uuid, GError **error) {
g_autofree gchar *lowercase = NULL;
gint ret = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/fs/exfat.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = {
* Returns: whether the @tech-@mode combination is available -- supported by the
* plugin implementation and having all the runtime dependencies available
*/
gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
bd_fs_exfat_is_tech_avail (BDFSTech tech G_GNUC_UNUSED, guint64 mode, GError **error) {
guint32 required = 0;
guint i = 0;
Expand Down Expand Up @@ -125,8 +125,8 @@ void bd_fs_exfat_info_free (BDFSExfatInfo *data) {
g_free (data);
}

BDExtraArg __attribute__ ((visibility ("hidden")))
**bd_fs_exfat_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
G_GNUC_INTERNAL BDExtraArg **
bd_fs_exfat_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
GPtrArray *options_array = g_ptr_array_new ();
const BDExtraArg **extra_p = NULL;

Expand Down
14 changes: 7 additions & 7 deletions src/plugins/fs/ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static gboolean extract_e2fsck_progress (const gchar *line, guint8 *completion)
* Returns: whether the @tech-@mode combination is available -- supported by the
* plugin implementation and having all the runtime dependencies available
*/
gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
bd_fs_ext_is_tech_avail (BDFSTech tech G_GNUC_UNUSED, guint64 mode, GError **error) {
guint32 required = 0;
guint i = 0;
Expand Down Expand Up @@ -267,18 +267,18 @@ static BDExtraArg **ext_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg
return (BDExtraArg **) g_ptr_array_free (options_array, FALSE);
}

BDExtraArg __attribute__ ((visibility ("hidden")))
**bd_fs_ext2_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
G_GNUC_INTERNAL BDExtraArg **
bd_fs_ext2_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
return ext_mkfs_options (options, extra);
}

BDExtraArg __attribute__ ((visibility ("hidden")))
**bd_fs_ext3_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
G_GNUC_INTERNAL BDExtraArg **
bd_fs_ext3_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
return ext_mkfs_options (options, extra);
}

BDExtraArg __attribute__ ((visibility ("hidden")))
**bd_fs_ext4_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
G_GNUC_INTERNAL BDExtraArg **
bd_fs_ext4_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
return ext_mkfs_options (options, extra);
}

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/fs/f2fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static gboolean can_check_f2fs_version (UtilDep dep, GError **error) {
* Returns: whether the @tech-@mode combination is available -- supported by the
* plugin implementation and having all the runtime dependencies available
*/
gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
bd_fs_f2fs_is_tech_avail (BDFSTech tech G_GNUC_UNUSED, guint64 mode, GError **error) {
guint32 required = 0;
guint i = 0;
Expand Down Expand Up @@ -171,8 +171,8 @@ void bd_fs_f2fs_info_free (BDFSF2FSInfo *data) {
g_free (data);
}

BDExtraArg __attribute__ ((visibility ("hidden")))
**bd_fs_f2fs_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
G_GNUC_INTERNAL BDExtraArg **
bd_fs_f2fs_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
GPtrArray *options_array = g_ptr_array_new ();
const BDExtraArg **extra_p = NULL;

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/fs/nilfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = {
* Returns: whether the @tech-@mode combination is available -- supported by the
* plugin implementation and having all the runtime dependencies available
*/
gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
bd_fs_nilfs2_is_tech_avail (BDFSTech tech G_GNUC_UNUSED, guint64 mode, GError **error) {
guint32 required = 0;
guint i = 0;
Expand Down Expand Up @@ -128,8 +128,8 @@ void bd_fs_nilfs2_info_free (BDFSNILFS2Info *data) {
g_free (data);
}

BDExtraArg __attribute__ ((visibility ("hidden")))
**bd_fs_nilfs2_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
G_GNUC_INTERNAL BDExtraArg **
bd_fs_nilfs2_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
GPtrArray *options_array = g_ptr_array_new ();
const BDExtraArg **extra_p = NULL;

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/fs/ntfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = {
* Returns: whether the @tech-@mode combination is available -- supported by the
* plugin implementation and having all the runtime dependencies available
*/
gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
bd_fs_ntfs_is_tech_avail (BDFSTech tech G_GNUC_UNUSED, guint64 mode, GError **error) {
guint32 required = 0;
guint i = 0;
Expand Down Expand Up @@ -115,8 +115,8 @@ void bd_fs_ntfs_info_free (BDFSNtfsInfo *data) {
g_free (data);
}

BDExtraArg __attribute__ ((visibility ("hidden")))
**bd_fs_ntfs_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
G_GNUC_INTERNAL BDExtraArg **
bd_fs_ntfs_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
GPtrArray *options_array = g_ptr_array_new ();
const BDExtraArg **extra_p = NULL;

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/fs/udf.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = {
* Returns: whether the @tech-@mode combination is available -- supported by the
* plugin implementation and having all the runtime dependencies available
*/
gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
bd_fs_udf_is_tech_avail (BDFSTech tech G_GNUC_UNUSED, guint64 mode, GError **error) {
guint32 required = 0;
guint i = 0;
Expand Down Expand Up @@ -174,8 +174,8 @@ static gchar* get_vid (const gchar *label) {
return vid;
}

BDExtraArg __attribute__ ((visibility ("hidden")))
**bd_fs_udf_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
G_GNUC_INTERNAL BDExtraArg **
bd_fs_udf_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
GPtrArray *options_array = g_ptr_array_new ();
const BDExtraArg **extra_p = NULL;
g_autofree gchar *vid = NULL;
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/fs/vfat.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = {
* Returns: whether the @tech-@mode combination is available -- supported by the
* plugin implementation and having all the runtime dependencies available
*/
gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
bd_fs_vfat_is_tech_avail (BDFSTech tech G_GNUC_UNUSED, guint64 mode, GError **error) {
guint32 required = 0;
guint i = 0;
Expand Down Expand Up @@ -141,8 +141,8 @@ static gchar *_fix_uuid (const gchar *uuid) {
return new_uuid;
}

BDExtraArg __attribute__ ((visibility ("hidden")))
**bd_fs_vfat_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
G_GNUC_INTERNAL BDExtraArg **
bd_fs_vfat_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
GPtrArray *options_array = g_ptr_array_new ();
const BDExtraArg **extra_p = NULL;
gchar *label;
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/fs/xfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static guint32 fs_mode_util[BD_FS_MODE_LAST+1] = {
* Returns: whether the @tech-@mode combination is available -- supported by the
* plugin implementation and having all the runtime dependencies available
*/
gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
bd_fs_xfs_is_tech_avail (BDFSTech tech G_GNUC_UNUSED, guint64 mode, GError **error) {
guint32 required = 0;
guint i = 0;
Expand Down Expand Up @@ -121,8 +121,8 @@ void bd_fs_xfs_info_free (BDFSXfsInfo *data) {
g_free (data);
}

BDExtraArg __attribute__ ((visibility ("hidden")))
**bd_fs_xfs_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
G_GNUC_INTERNAL BDExtraArg **
bd_fs_xfs_mkfs_options (BDFSMkfsOptions *options, const BDExtraArg **extra) {
GPtrArray *options_array = g_ptr_array_new ();
const BDExtraArg **extra_p = NULL;
gchar *uuid_option = NULL;
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/vdo_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define VDO_SYS_PATH "/sys/kvdo"


gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
get_stat_val64 (GHashTable *stats, const gchar *key, gint64 *val) {
const gchar *s;
gchar *endptr = NULL;
Expand All @@ -41,14 +41,14 @@ get_stat_val64 (GHashTable *stats, const gchar *key, gint64 *val) {
return TRUE;
}

gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
get_stat_val64_default (GHashTable *stats, const gchar *key, gint64 *val, gint64 def) {
if (!get_stat_val64 (stats, key, val))
*val = def;
return TRUE;
}

gboolean __attribute__ ((visibility ("hidden")))
G_GNUC_INTERNAL gboolean
get_stat_val_double (GHashTable *stats, const gchar *key, gdouble *val) {
const gchar *s;
gchar *endptr = NULL;
Expand Down Expand Up @@ -149,8 +149,8 @@ static gchar* _dm_node_from_name (const gchar *map_name, GError **error) {
return ret;
}

GHashTable __attribute__ ((visibility ("hidden")))
*vdo_get_stats_full (const gchar *name, GError **error) {
G_GNUC_INTERNAL GHashTable *
vdo_get_stats_full (const gchar *name, GError **error) {
GHashTable *stats;
GDir *dir;
gchar *stats_dir;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static int log_level = BD_UTILS_LOG_WARNING;
*
* Returns: whether logging was successfully initialized or not
*/
gboolean bd_utils_init_logging (BDUtilsLogFunc new_log_func, GError **error __attribute__((unused))) {
gboolean bd_utils_init_logging (BDUtilsLogFunc new_log_func, GError **error G_GNUC_UNUSED) {
/* XXX: the error attribute will likely be used in the future when this
function gets more complicated */

Expand Down

0 comments on commit 269b9e2

Please sign in to comment.