src/protocols/jabber/xdata.h

Wed, 21 Dec 2005 18:36:19 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Wed, 21 Dec 2005 18:36:19 +0000
changeset 12600
7ecd4441fdc7
parent 8396
8681756b4769
permissions
-rw-r--r--

[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.

7923
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
1 /**
7926
2fcae802f5c3 [gaim-migrate @ 8597]
Nathan Walp <nwalp@pidgin.im>
parents: 7923
diff changeset
2 * @file xdata.h utility functions
7923
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
3 *
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
4 * gaim
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
5 *
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
6 * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com>
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
7 *
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
11 * (at your option) any later version.
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
12 *
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
16 * GNU General Public License for more details.
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
17 *
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
21 */
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
22 #ifndef _GAIM_JABBER_XDATA_H_
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
23 #define _GAIM_JABBER_XDATA_H_
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
24
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
25 #include "jabber.h"
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
26 #include "xmlnode.h"
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
27
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
28 typedef void (*jabber_x_data_cb)(JabberStream *js, xmlnode *result, gpointer user_data);
8396
8681756b4769 [gaim-migrate @ 9125]
Nathan Walp <nwalp@pidgin.im>
parents: 7926
diff changeset
29 void *jabber_x_data_request(JabberStream *js, xmlnode *packet, jabber_x_data_cb cb, gpointer user_data);
7923
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
30
fd43ed3cda18 [gaim-migrate @ 8592]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
31 #endif /* _GAIM_JABBER_XDATA_H_ */

mercurial