gmime r1532 - in trunk: . gmime util



Author: fejj
Date: Wed Apr  1 21:14:51 2009
New Revision: 1532
URL: http://svn.gnome.org/viewvc/gmime?rev=1532&view=rev

Log:
2009-04-01  Jeffrey Stedfast  <fejj novell com>

	* gmime/gmime-utils.c: Need to #include <unistd.h> for getpid().

	* gmime/gmime-stream-fs.c: Need to #include <unistd.h> here.

	* gmime/gmime-multipart-signed.c: Got rid of an unused variable.

	* gmime/gmime-message.c: Removed unused variables.

	* gmime/gmime-content-type.c: Don't need to #include
	"gmime-table-private.h" here as we don't actually use it.

	* util/gtrie.c: Disable g_warning()'s when compiled w/o
	--enable-warnings and also fixed some compile warnings.



Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/gmime/gmime-content-type.c
   trunk/gmime/gmime-message.c
   trunk/gmime/gmime-multipart-signed.c
   trunk/gmime/gmime-stream-fs.c
   trunk/gmime/gmime-utils.c
   trunk/util/gtrie.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Wed Apr  1 21:14:51 2009
@@ -108,6 +108,7 @@
 	#include <poll.h>
 	], [
 	nfds_t nfds = 1;
+	return nfds;
 	]
 ,
 	AC_MSG_RESULT(yes)
@@ -265,6 +266,8 @@
 	struct utsname unam;
 		
 	unam.domainname[0] = '\0';
+
+	return unam.domainname[0];
 	],
 	AC_MSG_RESULT(yes)
    	AC_DEFINE(HAVE_UTSNAME_DOMAINNAME, 1, [Define if struct utsname has a domainname member])
@@ -279,6 +282,7 @@
 		], [
 		struct tm tm;
 		tm.tm_gmtoff = 1;
+		return tm.tm_gmtoff;
 		], ac_cv_struct_tm_gmtoff="yes", ac_cv_struct_tm_gmtoff="no"))
 if test "$ac_cv_struct_tm_gmtoff" = "yes"; then
 	AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
@@ -331,7 +335,7 @@
 		#include <sys/stat.h>
 		#include <fcntl.h>
 	],[
-		int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644);
+		return open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644);
 	],[
 		ac_cv_largefile64_source="no"
 	],[
@@ -341,7 +345,7 @@
 			#include <sys/stat.h>
 			#include <fcntl.h>
 		],[
-			int fd = open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644);
+			return open ("__o_largefile", O_CREAT | O_RDWR | O_LARGEFILE, 0644);
 		],[
 			ac_cv_largefile64_source="yes"
 		],[

Modified: trunk/gmime/gmime-content-type.c
==============================================================================
--- trunk/gmime/gmime-content-type.c	(original)
+++ trunk/gmime/gmime-content-type.c	Wed Apr  1 21:14:51 2009
@@ -29,7 +29,6 @@
 
 #include "gmime-common.h"
 #include "gmime-content-type.h"
-#include "gmime-table-private.h"
 #include "gmime-parse-utils.h"
 
 

Modified: trunk/gmime/gmime-message.c
==============================================================================
--- trunk/gmime/gmime-message.c	(original)
+++ trunk/gmime/gmime-message.c	Wed Apr  1 21:14:51 2009
@@ -192,7 +192,6 @@
 g_mime_message_init (GMimeMessage *message, GMimeMessageClass *klass)
 {
 	GMimeHeaderList *headers = ((GMimeObject *) message)->headers;
-	InternetAddressList *list;
 	guint i;
 	
 	message->from = NULL;
@@ -707,9 +706,9 @@
 {
 	GMimeMessage *message = (GMimeMessage *) object;	
 	InternetAddressList *addrlist;
-	int offset, i;
 	time_t date;
-	gulong id;
+	int offset;
+	guint i;
 	
 	for (i = 0; i < G_N_ELEMENTS (message_headers); i++) {
 		if (!g_ascii_strcasecmp (message_headers[i], header))

Modified: trunk/gmime/gmime-multipart-signed.c
==============================================================================
--- trunk/gmime/gmime-multipart-signed.c	(original)
+++ trunk/gmime/gmime-multipart-signed.c	Wed Apr  1 21:14:51 2009
@@ -125,8 +125,6 @@
 static void
 g_mime_multipart_signed_finalize (GObject *object)
 {
-	GMimeMultipartSigned *mps = (GMimeMultipartSigned *) object;
-	
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 

Modified: trunk/gmime/gmime-stream-fs.c
==============================================================================
--- trunk/gmime/gmime-stream-fs.c	(original)
+++ trunk/gmime/gmime-stream-fs.c	Wed Apr  1 21:14:51 2009
@@ -25,6 +25,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
 

Modified: trunk/gmime/gmime-utils.c
==============================================================================
--- trunk/gmime/gmime-utils.c	(original)
+++ trunk/gmime/gmime-utils.c	Wed Apr  1 21:14:51 2009
@@ -29,14 +29,17 @@
 #include <stdlib.h>
 #include <string.h>
 #ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h> /* for MAXHOSTNAMELEN */
+#include <sys/param.h>      /* for MAXHOSTNAMELEN */
 #else
 #define MAXHOSTNAMELEN 64
 #endif
 #ifdef HAVE_UTSNAME_DOMAINNAME
-#include <sys/utsname.h>
+#include <sys/utsname.h>    /* for uname() */
 #endif
 #include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>         /* for getpid() */
+#endif
 #ifdef HAVE_NETDB_H
 #include <netdb.h>
 #endif

Modified: trunk/util/gtrie.c
==============================================================================
--- trunk/util/gtrie.c	(original)
+++ trunk/util/gtrie.c	Wed Apr  1 21:14:51 2009
@@ -28,6 +28,12 @@
 
 #include "gtrie.h"
 
+#ifdef ENABLE_WARNINGS
+#define w(x) x
+#else
+#define w(x)
+#endif /* ENABLE_WARNINGS */
+
 #define d(x)
 
 struct _trie_state {
@@ -87,9 +93,9 @@
 
 
 static inline gunichar
-trie_utf8_getc (const unsigned char **in, size_t inlen)
+trie_utf8_getc (const char **in, size_t inlen)
 {
-	register const unsigned char *inptr = *in;
+	register const unsigned char *inptr = (const unsigned char *) *in;
 	const unsigned char *inend = inptr + inlen;
 	register unsigned char c, r;
 	register gunichar m, u = 0;
@@ -99,7 +105,7 @@
 	
 	r = *inptr++;
 	if (r < 0x80) {
-		*in = inptr;
+		*in = (const char *) inptr;
 		u = r;
 	} else if (r < 0xfe) { /* valid start char? */
 		u = r;
@@ -117,7 +123,7 @@
 			m <<= 5;
 		} while (r & 0x40);
 		
-		*in = inptr;
+		*in = (const char *) inptr;
 		
 		u &= ~m;
 	} else {
@@ -240,7 +246,7 @@
 void
 g_trie_add (GTrie *trie, const char *pattern, int pattern_id)
 {
-	const unsigned char *inptr = (const unsigned char *) pattern;
+	const char *inptr = pattern;
 	struct _trie_state *q, *q1, *r;
 	struct _trie_match *m, *n;
 	int i, depth = 0;
@@ -252,8 +258,8 @@
 	
 	while ((c = trie_utf8_getc (&inptr, -1))) {
 		if (c == 0xfffe) {
-			g_warning ("Invalid UTF-8 sequence in pattern '%s' at %s",
-				   pattern, (inptr - 1));
+			w(g_warning ("Invalid UTF-8 sequence in pattern '%s' at %s",
+				     pattern, (inptr - 1)));
 			continue;
 		}
 		
@@ -331,14 +337,14 @@
 const char *
 g_trie_quick_search (GTrie *trie, const char *buffer, size_t buflen, int *matched_id)
 {
-	const unsigned char *inptr, *inend, *prev, *pat;
+	const char *inptr, *inend, *prev, *pat;
 	register size_t inlen = buflen;
 	struct _trie_match *m = NULL;
 	struct _trie_state *q;
 	gunichar c;
 	
-	inptr = (const unsigned char *) buffer;
-	inend = inptr + buflen;
+	inend = buffer + buflen;
+	inptr = buffer;
 	
 	q = &trie->root;
 	pat = prev = inptr;
@@ -346,10 +352,12 @@
 		inlen = (inend - inptr);
 		
 		if (c == 0xfffe) {
+#ifdef ENABLE_WARNINGS
 			prev = (inptr - 1);
-			pat = (const unsigned char *) buffer + buflen;
+			pat = buffer + buflen;
 			g_warning ("Invalid UTF-8 in buffer '%.*s' at %.*s",
 				   buflen, buffer, pat - prev, prev);
+#endif
 			
 			pat = prev = inptr;
 		}
@@ -386,15 +394,15 @@
 const char *
 g_trie_search (GTrie *trie, const char *buffer, size_t buflen, int *matched_id)
 {
-	const unsigned char *inptr, *inend, *prev, *pat;
+	const char *inptr, *inend, *prev, *pat;
 	register size_t inlen = buflen;
 	struct _trie_match *m = NULL;
 	struct _trie_state *q;
 	size_t matched = 0;
 	gunichar c;
 	
-	inptr = (const unsigned char *) buffer;
-	inend = inptr + buflen;
+	inend = buffer + buflen;
+	inptr = buffer;
 	
 	q = &trie->root;
 	pat = prev = inptr;
@@ -405,10 +413,12 @@
 			if (matched)
 				return pat;
 			
+#ifdef ENABLE_WARNINGS
 			prev = (inptr - 1);
-			pat = (const unsigned char *) buffer + buflen;
+			pat = buffer + buflen;
 			g_warning ("Invalid UTF-8 in buffer '%.*s' at %.*s",
 				   buflen, buffer, pat - prev, prev);
+#endif
 			
 			pat = prev = inptr;
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]