Wed, 21 Dec 2005 18:36:19 +0000
[gaim-migrate @ 14934]
Enable the extra warnings regardless of --enable-debug.
Enable FORTIFY_SOURCE regardless of --enable-debug, adding a --disable-fortify flag to configure.
Enable (well, stop disabling) the missing initializer warnings.
This leads to warnings with: GValue v = {0,}; that must be worked around.
Basically, instead of:
GValue v = {0,};
...
g_value_init(&v, G_TYPE_FOO); /* or other use of the GValue */
We'd need to do:
GValue v;
...
v.g_type = 0;
g_value_init(&v, G_TYPE_FOO); /* or other use of the GValue */
Fix several cases of missing initializers. I don't think any of these are bugs, but having this warning seems like a good idea. It might prevent us from making a mistake in the future.
While I was fixing missing initializers, I optimized substitute_simple_word in plugins/spellchk.c, in the same way as I did substitute_word before. Yes, I'm bad for committing these together.
Added a --enable-fatal-asserts flag to configure. As the name implies, this makes g_return_... guards fatal. This is a useful flag to run on a debug copy of Gaim. It will make it very clear if your changes have triggered one of these guards. It's also useful in detecting g_return_... abuse, which helps prevent crashes if Gaim is compiled with G_DISABLE_ASSERT defined.
| 7014 | 1 | /** |
| 2 | * @file iq.h JabberID handlers | |
| 3 | * | |
| 4 | * gaim | |
| 5 | * | |
| 6 | * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com> | |
| 7 | * | |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 21 | */ | |
| 22 | #ifndef _GAIM_JABBER_IQ_H_ | |
| 23 | #define _GAIM_JABBER_IQ_H_ | |
| 24 | ||
| 25 | #include "jabber.h" | |
| 26 | ||
| 27 | typedef struct _JabberIq JabberIq; | |
| 28 | ||
| 29 | typedef enum { | |
| 30 | JABBER_IQ_SET, | |
| 31 | JABBER_IQ_GET, | |
| 32 | JABBER_IQ_RESULT, | |
| 33 | JABBER_IQ_ERROR, | |
| 34 | JABBER_IQ_NONE | |
| 35 | } JabberIqType; | |
| 36 | ||
| 7395 | 37 | typedef void (JabberIqCallback)(JabberStream *js, xmlnode *packet, gpointer data); |
| 38 | ||
| 7014 | 39 | struct _JabberIq { |
| 40 | JabberIqType type; | |
| 41 | char *id; | |
| 42 | xmlnode *node; | |
| 43 | ||
| 7395 | 44 | JabberIqCallback *callback; |
| 45 | gpointer callback_data; | |
| 7014 | 46 | |
| 47 | JabberStream *js; | |
| 48 | }; | |
| 49 | ||
| 50 | JabberIq *jabber_iq_new(JabberStream *js, JabberIqType type); | |
| 51 | JabberIq *jabber_iq_new_query(JabberStream *js, JabberIqType type, | |
| 52 | const char *xmlns); | |
| 53 | ||
| 54 | void jabber_iq_parse(JabberStream *js, xmlnode *packet); | |
| 55 | ||
| 7395 | 56 | void jabber_iq_set_callback(JabberIq *iq, JabberIqCallback *cb, gpointer data); |
| 7170 | 57 | void jabber_iq_set_id(JabberIq *iq, const char *id); |
| 7014 | 58 | |
| 59 | void jabber_iq_send(JabberIq *iq); | |
| 60 | void jabber_iq_free(JabberIq *iq); | |
| 61 | ||
| 62 | #endif /* _GAIM_JABBER_IQ_H_ */ |