/soc/2015/jgeboski/facebook: be11d9f148a6: facebook: initialize ...

James Geboski <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: be11d9f148a63521cb6053ea6d389cde4e620649
Author:	 James Geboski <[email protected]>
Date:	 2015-06-03 20:14 -0400
Branch:	 facebook
URL: https://hg.pidgin.im/soc/2015/jgeboski/facebook/rev/be11d9f148a6

Description:

facebook: initialize static GQuarks

The ISO-C standard defines that statics must be initialized to zero,
but this is not always clear. To avoid confusion, initialize these
statics to zero.

diffstat:

 libpurple/protocols/facebook/api.c  |  2 +-
 libpurple/protocols/facebook/http.c |  2 +-
 libpurple/protocols/facebook/json.c |  2 +-
 libpurple/protocols/facebook/mqtt.c |  2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diffs (48 lines):

diff --git a/libpurple/protocols/facebook/api.c b/libpurple/protocols/facebook/api.c
--- a/libpurple/protocols/facebook/api.c
+++ b/libpurple/protocols/facebook/api.c
@@ -290,7 +290,7 @@ fb_api_init(FbApi *api)
 GQuark
 fb_api_error_quark(void)
 {
-	static GQuark q;
+	static GQuark q = 0;
 
 	if (G_UNLIKELY(q == 0)) {
 		q = g_quark_from_static_string("fb-api-error-quark");
diff --git a/libpurple/protocols/facebook/http.c b/libpurple/protocols/facebook/http.c
--- a/libpurple/protocols/facebook/http.c
+++ b/libpurple/protocols/facebook/http.c
@@ -24,7 +24,7 @@
 GQuark
 fb_http_error_quark(void)
 {
-	static GQuark q;
+	static GQuark q = 0;
 
 	if (G_UNLIKELY(q == 0)) {
 		q = g_quark_from_static_string("fb-http-error-quark");
diff --git a/libpurple/protocols/facebook/json.c b/libpurple/protocols/facebook/json.c
--- a/libpurple/protocols/facebook/json.c
+++ b/libpurple/protocols/facebook/json.c
@@ -28,7 +28,7 @@
 GQuark
 fb_json_error_quark(void)
 {
-	static GQuark q;
+	static GQuark q = 0;
 
 	if (G_UNLIKELY(q == 0)) {
 		q = g_quark_from_static_string("fb-json-error-quark");
diff --git a/libpurple/protocols/facebook/mqtt.c b/libpurple/protocols/facebook/mqtt.c
--- a/libpurple/protocols/facebook/mqtt.c
+++ b/libpurple/protocols/facebook/mqtt.c
@@ -159,7 +159,7 @@ fb_mqtt_message_init(FbMqttMessage *msg)
 GQuark
 fb_mqtt_error_quark(void)
 {
-	static GQuark q;
+	static GQuark q = 0;
 
 	if (G_UNLIKELY(q == 0)) {
 		q = g_quark_from_static_string("fb-mqtt-error-quark");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.