[pan2] some compile fixes



commit 05a5e7e0e2f8a1e6cc9d247736a6efdf3ac00511
Author: Heinrich MÃller <henmull src gnome org>
Date:   Tue Apr 10 22:51:25 2012 +0200

    some compile fixes

 configure.in                   |    3 +++
 pan.cbp                        |    1 +
 pan/general/Makefile.am        |    3 ++-
 pan/general/typedefs.h         |   30 ++++++++++++++++++++++++++++++
 pan/gui/e-cte-dialog.c         |   12 ++++++------
 pan/gui/gui.h                  |    1 +
 pan/gui/pan-tree.cc            |   12 ++++++------
 pan/gui/pan.cc                 |    1 +
 pan/usenet-utils/gpg.h         |    6 +++---
 pan/usenet-utils/mime-utils.cc |    5 +++--
 pan/usenet-utils/mime-utils.h  |   10 +++++-----
 11 files changed, 61 insertions(+), 23 deletions(-)
---
diff --git a/configure.in b/configure.in
index 9c46bb5..41a3b9c 100644
--- a/configure.in
+++ b/configure.in
@@ -240,6 +240,9 @@ case $host_os in
 esac
 AM_CONDITIONAL([HAVE_WIN32],[test "$win32" = "yes"])
 
+CXXFLAGS="$CXXFLAGS -Wall"
+CPPFLAGS="$CPPFLAGS -Wall"
+
 dnl Build the output files
 AC_SUBST(panlocaledir)
 AC_CONFIG_FILES([Makefile
diff --git a/pan.cbp b/pan.cbp
index 581628d..e9dc378 100644
--- a/pan.cbp
+++ b/pan.cbp
@@ -145,6 +145,7 @@
 		<Unit filename="pan/general/text-match.cc" />
 		<Unit filename="pan/general/text-match.h" />
 		<Unit filename="pan/general/time-elapsed.h" />
+		<Unit filename="pan/general/typedefs.h" />
 		<Unit filename="pan/general/utf8-utils.cc" />
 		<Unit filename="pan/general/utf8-utils.h" />
 		<Unit filename="pan/general/worker-pool.cc" />
diff --git a/pan/general/Makefile.am b/pan/general/Makefile.am
index edf7a2f..9251e7d 100644
--- a/pan/general/Makefile.am
+++ b/pan/general/Makefile.am
@@ -35,7 +35,8 @@ noinst_HEADERS = \
  text-match.h \
  time-elapsed.h \
  utf8-utils.h \
- worker-pool.h
+ worker-pool.h \
+ typedefs.h
 
 #noinst_PROGRAMS = \
 #  progress-test \
diff --git a/pan/general/typedefs.h b/pan/general/typedefs.h
new file mode 100644
index 0000000..269a69c
--- /dev/null
+++ b/pan/general/typedefs.h
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * Pan - A Newsreader for Gtk+
+ * Copyright (C) 2002-2006  Charles Kerr <charles rebelbase com>
+ *
+ * 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; version 2 of the License.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+// all compatibility / custom typedefs for different targets go here....
+#ifndef _Pan_td_h_
+#define _Pan_td_h_
+
+// fixes some compilation issues on OSX
+#ifdef G_OS_DARWIN
+  typedef unsigned long guint64;
+  typedef unsigned long gulong;
+#endif
+
+#endif
diff --git a/pan/gui/e-cte-dialog.c b/pan/gui/e-cte-dialog.c
index 81d826a..e039d3a 100644
--- a/pan/gui/e-cte-dialog.c
+++ b/pan/gui/e-cte-dialog.c
@@ -127,12 +127,12 @@ e_cte_dialog (const char *title, const char *prompt, GMimeContentEncoding now, G
     GtkTreeIter iter;
     GMimeContentEncoding value;
 
-    if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX(picker), &iter))
-      return;
-
-    model = gtk_combo_box_get_model (GTK_COMBO_BOX(picker));
-    gtk_tree_model_get (model, &iter, 1, &value, -1);
-    ret = value;
+    if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX(picker), &iter))
+    {
+      model = gtk_combo_box_get_model (GTK_COMBO_BOX(picker));
+      gtk_tree_model_get (model, &iter, 1, &value, -1);
+      ret = value;
+    }
 	}
 
 	gtk_widget_destroy (GTK_WIDGET (dialog));
diff --git a/pan/gui/gui.h b/pan/gui/gui.h
index 95ca13d..a0b4ea0 100644
--- a/pan/gui/gui.h
+++ b/pan/gui/gui.h
@@ -32,6 +32,7 @@
 #include <pan/gui/prefs.h>
 #include <pan/gui/group-prefs.h>
 #include <pan/gui/wait.h>
+#include <pan/general/typedefs.h>
 
 #include "gtk-compat.h"
 
diff --git a/pan/gui/pan-tree.cc b/pan/gui/pan-tree.cc
index 5915590..952b084 100644
--- a/pan/gui/pan-tree.cc
+++ b/pan/gui/pan-tree.cc
@@ -296,7 +296,7 @@ PanTreeStore :: model_iter_parent (GtkTreeModel * model,
 GtkTreePath*
 PanTreeStore :: get_path (const Row * row) const
 {
-  g_return_val_if_fail (row, false);
+  g_return_val_if_fail (row, NULL);
 
   std::vector<int> indices;
   while (row && row!=root) {
@@ -314,8 +314,8 @@ PanTreeStore :: get_path (const Row * row) const
 GtkTreePath*
 PanTreeStore :: get_path (GtkTreeIter  * iter)
 {
-  g_return_val_if_fail (iter, false);
-  g_return_val_if_fail (iter->stamp == stamp, false);
+  g_return_val_if_fail (iter, NULL);
+  g_return_val_if_fail (iter->stamp == stamp, NULL);
 
   return get_path (get_row (iter));
 }
@@ -361,7 +361,7 @@ PanTreeStore :: is_in_tree (Row * row) const
     row = row->parent;
   return row == root;
 }
-  
+
 /*****
 ******
 ******  implementing GtkTreeSortable
@@ -816,7 +816,7 @@ PanTreeStore :: insert_sorted (const parent_to_children_t& new_parents)
 
     // sort these from shallowest to deepest
     std::sort (keys.begin(), keys.end(), depth_compare);
- 
+
     // process each of them
     foreach_const (rows_t, keys, it)
     {
@@ -1117,7 +1117,7 @@ PanTreeStore :: reparent (const parent_to_children_t& new_parents)
 
   insert_sorted (new_parents);
 }
-  
+
 /***
 ****
 ***/
diff --git a/pan/gui/pan.cc b/pan/gui/pan.cc
index a7df3c4..6acaa78 100644
--- a/pan/gui/pan.cc
+++ b/pan/gui/pan.cc
@@ -213,6 +213,7 @@ namespace
     static gboolean status_icon_periodic_refresh (gpointer p)
     {
       static_cast<StatusIconListener*>(p)->update_status_tooltip();
+      return true;
     }
 
 #ifdef HAVE_LIBNOTIFY
diff --git a/pan/usenet-utils/gpg.h b/pan/usenet-utils/gpg.h
index 06ba2ee..06fb6f6 100644
--- a/pan/usenet-utils/gpg.h
+++ b/pan/usenet-utils/gpg.h
@@ -82,7 +82,7 @@ namespace pan
     GMimeObject * decrypted;
     GMimeDecryptResult * result;
 
-    GPGDecErr(GPGDecType t) : err(NULL), type(t), decrypted(NULL), result(g_mime_decrypt_result_new())  {}
+    GPGDecErr(GPGDecType t) : err(NULL), no_sigs(true), type(t), decrypted(NULL), result(g_mime_decrypt_result_new())  {}
     ~GPGDecErr()
     {
       if (err) g_error_free(err);
@@ -91,7 +91,7 @@ namespace pan
 //      if (result) g_object_unref(result);
     }
 
-    GPGDecErr() : no_sigs(true), err(NULL), type(GPG_DECODE), decrypted(NULL), result(g_mime_decrypt_result_new()) {}
+    GPGDecErr() : err(NULL), no_sigs(true), type(GPG_DECODE), decrypted(NULL), result(g_mime_decrypt_result_new()) {}
 
     void clear()
     {
@@ -116,7 +116,7 @@ namespace pan
     GPGEncType type;
     GPGSignersInfo signers;
 
-    GPGEncErr(GPGEncType t) : err(NULL), type(t), no_sigs(true)  {}
+    GPGEncErr(GPGEncType t) : err(NULL), no_sigs(true), type(t)   {}
     ~GPGEncErr()
     {
       if (err) g_error_free(err);
diff --git a/pan/usenet-utils/mime-utils.cc b/pan/usenet-utils/mime-utils.cc
index 9980f9e..ca27980 100644
--- a/pan/usenet-utils/mime-utils.cc
+++ b/pan/usenet-utils/mime-utils.cc
@@ -1724,7 +1724,7 @@ namespace pan
     return body;
   }
 
-  GMimeMessage*
+  bool
   gpg_encrypt (const std::string& uid, const std::string& body_str,
                GMimeMessage* body, GPtrArray* rcp, bool sign)
   {
@@ -1740,13 +1740,14 @@ namespace pan
     {
       g_object_unref(mpe);
       g_object_unref(G_OBJECT(part));
-      return 0;
+      return false;
     }
 
     g_mime_message_set_mime_part(body,GMIME_OBJECT(mpe));
     g_object_unref(G_OBJECT(part));
     g_object_unref(mpe);
 
+    return true;
   }
 #endif
 }
diff --git a/pan/usenet-utils/mime-utils.h b/pan/usenet-utils/mime-utils.h
index 021ee2b..66802e2 100644
--- a/pan/usenet-utils/mime-utils.h
+++ b/pan/usenet-utils/mime-utils.h
@@ -69,7 +69,7 @@ namespace pan
 
 #ifdef HAVE_GMIME_CRYPTO
   GMimeMessage* message_add_signed_part (const std::string& uid, const std::string& body_str, GMimeMessage* body);
-  GMimeMessage* gpg_encrypt (const std::string& uid, const std::string& body_str, GMimeMessage* body, GPtrArray* rcp, bool sign);
+  bool gpg_encrypt (const std::string& uid, const std::string& body_str, GMimeMessage* body, GPtrArray* rcp, bool sign);
   bool gpg_verify_mps (GMimeObject*, GPGDecErr&);
 #endif
   /**
@@ -120,10 +120,10 @@ namespace pan
 
   char * __g_mime_iconv_strndup (iconv_t cd, const char *str, size_t n, const char* charset=0);
 
-  static char * __g_mime_iconv_strdup (iconv_t cd, const char *str, const char* charset=0)
-  {
-    return __g_mime_iconv_strndup(cd, str, strlen(str), charset);
-  }
+//  static char * __g_mime_iconv_strdup (iconv_t cd, const char *str, const char* charset=0)
+//  {
+//    return __g_mime_iconv_strndup(cd, str, strlen(str), charset);
+//  }
 
 }
 



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