qulogic/pidgin

Fix warnings from clang

7 months ago, Elliott Sales de Andrade
0f3a16f3ce7f
Parents 89b3308fc82f
Children d0faa9b1ac85
Fix warnings from clang

This fixes a 'missing struct initializer' warning, and a read out-of-bounds of
a static array.

Also, delete an unused struct typedef.

Testing Done:
Compiled with clang and saw fewer warnings.

Reviewed at https://reviews.imfreedom.org/r/2785/
--- a/libpurple/purpleoptions.c Mon Nov 06 01:23:11 2023 -0600
+++ b/libpurple/purpleoptions.c Tue Nov 07 00:33:50 2023 -0600
@@ -50,13 +50,14 @@
GOptionGroup *group = NULL;
GOptionEntry entries[] = {
{
- "force-online", 'f', G_OPTION_FLAG_NO_ARG,
- G_OPTION_ARG_CALLBACK, &purple_options_force_online_cb,
- _("force online, regardless of network status"),
- NULL
- }, {
- NULL
+ .long_name = "force-online",
+ .short_name = 'f',
+ .flags = G_OPTION_FLAG_NO_ARG,
+ .arg = G_OPTION_ARG_CALLBACK,
+ .arg_data = &purple_options_force_online_cb,
+ .description = _("force online, regardless of network status"),
},
+ G_OPTION_ENTRY_NULL,
};
group = g_option_group_new(
--- a/libpurple/status.c Mon Nov 06 01:23:11 2023 -0600
+++ b/libpurple/status.c Tue Nov 07 00:33:50 2023 -0600
@@ -89,12 +89,6 @@
PROP_LAST
};
-typedef struct
-{
- PurpleAccount *account;
- char *name;
-} PurpleStatusBuddyKey;
-
static GParamSpec *properties[PROP_LAST];
G_DEFINE_TYPE(PurpleStatus, purple_status, G_TYPE_OBJECT);
@@ -114,9 +108,11 @@
10 /* Offline messageable */
};
-#define SCORE_IDLE 9
-#define SCORE_IDLE_TIME 10
-#define SCORE_OFFLINE_MESSAGE 11
+enum {
+ SCORE_IDLE = PURPLE_STATUS_NUM_PRIMITIVES,
+ SCORE_IDLE_TIME,
+ SCORE_OFFLINE_MESSAGE,
+};
/**************************************************************************
* PurpleStatusPrimitive API
--- a/libpurple/tests/test_tags.c Mon Nov 06 01:23:11 2023 -0600
+++ b/libpurple/tests/test_tags.c Tue Nov 07 00:33:50 2023 -0600
@@ -538,7 +538,7 @@
{"foo:bar", "foo", "bar"},
{"🐦:", "🐦", ""},
{":🐦", "", "🐦"},
- {NULL},
+ {NULL, NULL, NULL},
};
for(int i = 0; data[i].tag != NULL; i++) {