/pidgin/main: 9b112a06cbdc: Fix warnings for ciphers

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Sat Apr 13 19:04:26 EDT 2013


Changeset: 9b112a06cbdc2e329e40dc5dc893a9658396556e
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-04-14 01:04 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/9b112a06cbdc

Description:

Fix warnings for ciphers

diffstat:

 libpurple/cipher.c            |  15 +--------------
 libpurple/ciphers/Makefile.am |   3 +++
 libpurple/ciphers/ciphers.h   |  38 ++++++++++++++++++++++++++++++++++++++
 libpurple/ciphers/des.c       |   1 +
 libpurple/ciphers/gchecksum.c |   1 +
 libpurple/ciphers/hmac.c      |   1 +
 libpurple/ciphers/md4.c       |   1 +
 libpurple/ciphers/rc4.c       |   1 +
 8 files changed, 47 insertions(+), 14 deletions(-)

diffs (141 lines):

diff --git a/libpurple/cipher.c b/libpurple/cipher.c
--- a/libpurple/cipher.c
+++ b/libpurple/cipher.c
@@ -35,6 +35,7 @@
  */
 #include "internal.h"
 #include "cipher.h"
+#include "ciphers/ciphers.h"
 #include "dbus-maybe.h"
 #include "debug.h"
 #include "signals.h"
@@ -223,20 +224,6 @@ purple_ciphers_get_handle() {
 	return &handle;
 }
 
-/* These are implemented in the purple-ciphers sublibrary built in the ciphers
- * directory.  We could put a header file in there, but it's less hassle for
- * the developer to just add it here since they have to register it here as
- * well.
- */
-PurpleCipherOps *purple_des_cipher_get_ops();
-PurpleCipherOps *purple_des3_cipher_get_ops();
-PurpleCipherOps *purple_hmac_cipher_get_ops();
-PurpleCipherOps *purple_md4_cipher_get_ops();
-PurpleCipherOps *purple_md5_cipher_get_ops();
-PurpleCipherOps *purple_rc4_cipher_get_ops();
-PurpleCipherOps *purple_sha1_cipher_get_ops();
-PurpleCipherOps *purple_sha256_cipher_get_ops();
-
 void
 purple_ciphers_init() {
 	gpointer handle;
diff --git a/libpurple/ciphers/Makefile.am b/libpurple/ciphers/Makefile.am
--- a/libpurple/ciphers/Makefile.am
+++ b/libpurple/ciphers/Makefile.am
@@ -7,6 +7,9 @@ libpurple_ciphers_la_SOURCES=\
 	md4.c \
 	rc4.c
 
+noinst_HEADERS =\
+	ciphers.h
+
 INCLUDES = -I$(top_srcdir)/libpurple
 
 AM_CPPFLAGS = \
diff --git a/libpurple/ciphers/ciphers.h b/libpurple/ciphers/ciphers.h
new file mode 100644
--- /dev/null
+++ b/libpurple/ciphers/ciphers.h
@@ -0,0 +1,38 @@
+/* purple
+ *
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
+/* des.c */
+PurpleCipherOps * purple_des_cipher_get_ops(void);
+PurpleCipherOps * purple_des3_cipher_get_ops(void);
+
+/* gchecksum.c */
+PurpleCipherOps * purple_md5_cipher_get_ops(void);
+PurpleCipherOps * purple_sha1_cipher_get_ops(void);
+PurpleCipherOps * purple_sha256_cipher_get_ops(void);
+
+/* hmac.c */
+PurpleCipherOps * purple_hmac_cipher_get_ops(void);
+
+/* md4.c */
+PurpleCipherOps * purple_md4_cipher_get_ops(void);
+
+/* rc4.c */
+PurpleCipherOps * purple_rc4_cipher_get_ops(void);
diff --git a/libpurple/ciphers/des.c b/libpurple/ciphers/des.c
--- a/libpurple/ciphers/des.c
+++ b/libpurple/ciphers/des.c
@@ -34,6 +34,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 #include <cipher.h>
+#include "ciphers.h"
 
 /******************************************************************************
  * DES
diff --git a/libpurple/ciphers/gchecksum.c b/libpurple/ciphers/gchecksum.c
--- a/libpurple/ciphers/gchecksum.c
+++ b/libpurple/ciphers/gchecksum.c
@@ -1,4 +1,5 @@
 #include <cipher.h>
+#include "ciphers.h"
 
 static void
 purple_g_checksum_init(PurpleCipherContext *context, GChecksumType type)
diff --git a/libpurple/ciphers/hmac.c b/libpurple/ciphers/hmac.c
--- a/libpurple/ciphers/hmac.c
+++ b/libpurple/ciphers/hmac.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 #include <cipher.h>
+#include "ciphers.h"
 
 #include <util.h>
 
diff --git a/libpurple/ciphers/md4.c b/libpurple/ciphers/md4.c
--- a/libpurple/ciphers/md4.c
+++ b/libpurple/ciphers/md4.c
@@ -34,6 +34,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 #include <cipher.h>
+#include "ciphers.h"
 
 #define MD4_DIGEST_SIZE     16
 #define MD4_HMAC_BLOCK_SIZE 64
diff --git a/libpurple/ciphers/rc4.c b/libpurple/ciphers/rc4.c
--- a/libpurple/ciphers/rc4.c
+++ b/libpurple/ciphers/rc4.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 #include <cipher.h>
+#include "ciphers.h"
 #include <util.h>
 
 struct RC4Context {



More information about the Commits mailing list