[pan2] * fixes : https://bugzilla.gnome.org/show_bug.cgi?id=673753 * beginning to silence compiler with -Wa
- From: Heinrich MÃller <henmull src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2] * fixes : https://bugzilla.gnome.org/show_bug.cgi?id=673753 * beginning to silence compiler with -Wa
- Date: Tue, 24 Apr 2012 11:23:52 +0000 (UTC)
commit 8680b6082081d8415d36cd2bb54f64ac06a545a4
Author: Heinrich MÃller <henmull src gnome org>
Date: Tue Apr 24 12:55:00 2012 +0200
* fixes : https://bugzilla.gnome.org/show_bug.cgi?id=673753
* beginning to silence compiler with -Wall (looong task)
configure.in | 10 +++++-----
pan/data-impl/data-impl.h | 4 ++--
pan/data/cert-store.cc | 9 ++-------
pan/data/cert-store.h | 2 +-
pan/gui/gui.cc | 34 ++++++++++++++++++++++++++++------
pan/gui/post-ui.cc | 13 +------------
pan/tasks/nzb.cc | 2 +-
pan/tasks/socket-impl-main.cc | 11 ++++++-----
pan/tasks/socket-impl-main.h | 4 ++--
pan/tasks/socket-impl-openssl.cc | 7 +++----
pan/tasks/socket-impl-openssl.h | 2 +-
pan/tasks/task-upload.cc | 2 +-
pan/tasks/task-upload.h | 4 +++-
pan/usenet-utils/ssl-utils.h | 23 ++++++-----------------
14 files changed, 62 insertions(+), 65 deletions(-)
---
diff --git a/configure.in b/configure.in
index b2486ef..def0c3e 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,7 @@
-AC_INIT([Pan],[0.136],[https://bugzilla.gnome.org/enter_bug.cgi?product=Pan],[pan],[http://pan.rebelbase.com/])
+AC_INIT([Pan],[0.137],[https://bugzilla.gnome.org/enter_bug.cgi?product=Pan],[pan],[http://pan.rebelbase.com/])
AC_DEFINE(VERSION_MAJOR,0,[Major part of version number])
-AC_DEFINE(VERSION_MINOR,136,[Minor part of version number])
-AC_DEFINE(VERSION_REVISION,1,[Revision part of version number])
+AC_DEFINE(VERSION_MINOR,137,[Minor part of version number])
+AC_DEFINE(VERSION_REVISION,0,[Revision part of version number])
AC_DEFINE(VERSION_TITLE,["I'm far too busy being delicious"],[Release Name])
AC_PREREQ([2.64])
@@ -240,8 +240,8 @@ case $host_os in
esac
AM_CONDITIONAL([HAVE_WIN32],[test "$win32" = "yes"])
-dnl CXXFLAGS="$CXXFLAGS -Wall"
-dnl CPPFLAGS="$CPPFLAGS -Wall"
+CXXFLAGS="-O0 -Wall"
+CPPFLAGS="-O0 -Wall"
dnl Build the output files
AC_SUBST(panlocaledir)
diff --git a/pan/data-impl/data-impl.h b/pan/data-impl/data-impl.h
index 6672fb7..cfe9d1e 100644
--- a/pan/data-impl/data-impl.h
+++ b/pan/data-impl/data-impl.h
@@ -89,8 +89,8 @@ namespace pan
virtual const CertStore& get_certstore () const { return _certstore; }
private:
- EncodeCache _encode_cache;
ArticleCache _cache;
+ EncodeCache _encode_cache;
CertStore _certstore;
public:
@@ -476,8 +476,8 @@ namespace pan
private: // implementation fields
const Quark _group;
- const Quark _save_path; // for auto-download
DataImpl & _data;
+ const Quark _save_path; // for auto-download
nodes_t _nodes;
MemChunk<ArticleNode> _node_chunk;
FilterInfo _filter;
diff --git a/pan/data/cert-store.cc b/pan/data/cert-store.cc
index b994d6c..de3d5f8 100644
--- a/pan/data/cert-store.cc
+++ b/pan/data/cert-store.cc
@@ -4,7 +4,7 @@
* Copyright (C) 2002-2006 Charles Kerr <charles rebelbase com>
*
* This file
- * Copyright (C) 2011 Heinrich Mïller <sphemuel stud informatik uni-erlangen de>
+ * Copyright (C) 2011 Heinrich Mïller <henmull src gnome org>
*
* 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
@@ -61,8 +61,8 @@ namespace pan
struct SaveCBStruct
{
CertStore& cs;
- Data& data;
const Quark& server;
+ Data& data;
SaveCBStruct(CertStore& store, const Quark& s, Data& d) : cs(store), server(s), data(d) {}
};
@@ -237,8 +237,6 @@ namespace pan
int cnt(0);
quarks_t servers(_data.get_servers());
int ret(0);
- size_t filelen;
- char * buf;
GError* err(NULL);
foreach_const(quarks_t, servers, it)
@@ -260,7 +258,6 @@ namespace pan
{
char filename[PATH_MAX];
const char * fname;
- struct stat stat_p;
while ((fname = g_dir_read_name (dir)))
{
struct stat stat_p;
@@ -292,9 +289,7 @@ namespace pan
void
CertStore :: remove_hard(const Quark& server)
{
- char buf[2048];
std::string fn = _data.get_server_cert(server);
- std::cerr<<"unlink "<<fn<<"\n";
unlink(fn.c_str());
}
diff --git a/pan/data/cert-store.h b/pan/data/cert-store.h
index 7e5abfd..aa391fa 100644
--- a/pan/data/cert-store.h
+++ b/pan/data/cert-store.h
@@ -4,7 +4,7 @@
* Copyright (C) 2002-2006 Charles Kerr <charles rebelbase com>
*
* This file
- * Copyright (C) 2011 Heinrich Mü<sphemuel stud informatik uni-erlangen de>
+ * Copyright (C) 2011 Heinrich Mü<henmull src gnome org>
*
* 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
diff --git a/pan/gui/gui.cc b/pan/gui/gui.cc
index be0c69e..cb712aa 100644
--- a/pan/gui/gui.cc
+++ b/pan/gui/gui.cc
@@ -358,6 +358,7 @@ namespace
{
GtkWidget * hpane (0);
GtkWidget * vpane (0);
+ GtkWidget * sep_vpane (0);
}
GUI :: ~GUI ()
@@ -379,6 +380,11 @@ GUI :: ~GUI ()
res = gtk_paned_get_position(GTK_PANED(vpane));
if (res > 0) _prefs.set_int ("main-window-vpane-position", res);
}
+ if (sep_vpane)
+ {
+ res = gtk_paned_get_position(GTK_PANED(sep_vpane));
+ if (res > 0) _prefs.set_int ("sep-vpane-position", res);
+ }
const bool maximized = gtk_widget_get_window(_root)
@@ -1626,11 +1632,28 @@ namespace
GtkWidget * w;
if (w1!=NULL && w2!=NULL) {
- int pos = uglyhack_idx==0
- ? prefs.get_int ("main-window-vpane-position", 300)
- : prefs.get_int ("main-window-hpane-position", 266);
+ int pos(0);
+ if (uglyhack_idx==0)
+ {
+ pos = prefs.get_int ("main-window-vpane-position", 300);
+ }
+ else if (uglyhack_idx==1)
+ {
+ pos = prefs.get_int ("main-window-hpane-position", 266);
+ }
+ else if (uglyhack_idx==2)
+ {
+ pos = prefs.get_int ("sep-vpane-position", 266);
+ }
if (orient == VERTICAL) {
- w = vpane = gtk_vpaned_new ();
+ if (uglyhack_idx==0)
+ {
+ w = vpane = gtk_vpaned_new ();
+ }
+ else if (uglyhack_idx==2)
+ {
+ w = sep_vpane = gtk_vpaned_new ();
+ }
gtk_widget_set_size_request (w1, -1, 50);
gtk_widget_set_size_request (w2, -1, 50);
} else {
@@ -1732,7 +1755,7 @@ void GUI :: do_tabbed_layout (bool tabbed)
w = pack_widgets (_prefs, w, p[2], HORIZONTAL, 1);
} else if (layout == "stacked-vertical") {
w = pack_widgets (_prefs, p[0], p[1], VERTICAL, 0);
- w = pack_widgets (_prefs, w, p[2], VERTICAL, 1);
+ w = pack_widgets (_prefs, w, p[2], VERTICAL, 2);
} else { // stacked right
w = pack_widgets (_prefs, p[1], p[2], VERTICAL, 0);
w = pack_widgets (_prefs, p[0], w, HORIZONTAL, 1);
@@ -1846,7 +1869,6 @@ void GUI :: do_show_selected_article_info ()
foreach_const (std::set<number_t>, missing_parts, it)
s << ' ' << *it;
-
const char* author = iconv_inited ? __g_mime_iconv_strdup(conv, a->author.c_str()) : a->author.c_str();
const char* subject = iconv_inited ? __g_mime_iconv_strdup(conv, a->subject.c_str()) : a->subject.c_str();
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index bccc3a7..0fb455f 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -78,10 +78,7 @@ PostUI :: generate_unique_id (StringView& mid, int cnt, std::string& s)
{
std::stringstream out;
- struct stat sb;
struct timeval tv;
- const time_t now (time(NULL));
- struct tm local_now = *gmtime (&now);
out << "pan$";
gettimeofday (&tv, NULL);
out << std::hex << tv.tv_usec << "$" << std::hex
@@ -183,7 +180,7 @@ PostUI:: update_filequeue_label (GtkTreeSelection *selection)
TaskUpload * task (dynamic_cast<TaskUpload*>(*it));
if (task) kb += task->_bytes/1024;
}
- g_snprintf(str,sizeof(str), _("Upload queue: %ld tasks, %ld KB (~ %.2f MB) total."), tasks.size(), kb, kb/1024.0f);
+ g_snprintf(str,sizeof(str), _("Upload queue: %lu tasks, %ld KB (~ %.2f MB) total."), tasks.size(), kb, kb/1024.0f);
gtk_label_set_text (GTK_LABEL(_filequeue_label), str);
}
@@ -1115,7 +1112,6 @@ PostUI :: maybe_post_message (GMimeMessage * message)
std::vector<Task*> tasks;
_upload_queue.get_all_tasks(tasks);
- struct stat sb;
_running_uploads = tasks.size();
if (master_reply) ++_running_uploads;
@@ -2547,8 +2543,6 @@ PostUI:: on_parts_box_clicked_cb (GtkCellRendererToggle *cell, gchar *path_str,
{
PostUI* data(static_cast<PostUI*>(user_data));
GtkWidget * w = data->parts_store() ;
- GtkListStore *store = GTK_LIST_STORE(
- gtk_tree_view_get_model(GTK_TREE_VIEW(w)));
GtkTreeModel * model = gtk_tree_view_get_model(GTK_TREE_VIEW(w));
int part(42);
GtkTreeIter iter;
@@ -2756,7 +2750,6 @@ void
PostUI :: remove_files (void)
{
_upload_queue.remove_tasks (get_selected_files());
- GtkTreeView * view (GTK_TREE_VIEW (_filequeue_store));
}
void
@@ -2848,7 +2841,6 @@ PostUI :: select_parts ()
_upload_ptr = dynamic_cast<TaskUpload*>(set[0]);
if (!_upload_ptr) return;
- GtkTreeIter iter;
GtkWidget * w = _part_select = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (_part_select, "delete-event", G_CALLBACK(delete_parts_cb), this);
gtk_window_set_role (GTK_WINDOW(w), "pan-parts-window");
@@ -2909,7 +2901,6 @@ PostUI::draft_save_cb(gpointer ptr)
char * filename = g_build_filename (draft_filename.c_str(), "autosave", NULL);
std::ofstream o (filename);
- gboolean unused;
char * headers (g_mime_object_get_headers ((GMimeObject *) msg));
o << headers;
const std::string body (data->get_body ());
@@ -3143,7 +3134,6 @@ PostUI :: prompt_user_for_queueable_files (GtkWindow * parent, const Prefs& pref
GMimeMessage * msg (new_message_from_ui (UPLOADING));
TaskUpload* tmp;
Article a;
- struct stat sb;
a.subject = subject;
a.author = author;
foreach_const (quarks_t, groups, git)
@@ -3171,7 +3161,6 @@ std::string
PostUI :: prompt_user_for_upload_nzb_dir (GtkWindow * parent, const Prefs& prefs)
{
char buf[4096];
- struct stat sb;
std::string path;
std::string prev_path = prefs.get_string ("default-save-attachments-path", g_get_home_dir ());
diff --git a/pan/tasks/nzb.cc b/pan/tasks/nzb.cc
index bdc1577..176aaf9 100644
--- a/pan/tasks/nzb.cc
+++ b/pan/tasks/nzb.cc
@@ -75,8 +75,8 @@ namespace
tasks_t tasks;
Article a;
ArticleCache& cache;
- ArticleRead& read;
EncodeCache& encode_cache;
+ ArticleRead& read;
const ServerRank& ranks;
const GroupServer& gs;
Quark server;
diff --git a/pan/tasks/socket-impl-main.cc b/pan/tasks/socket-impl-main.cc
index 01f5993..7c0b1f1 100644
--- a/pan/tasks/socket-impl-main.cc
+++ b/pan/tasks/socket-impl-main.cc
@@ -5,7 +5,7 @@
* Copyright (C) 2002-2006 Charles Kerr <charles rebelbase com>
*
* This file
- * Copyright (C) 2011 Heinrich Mü<sphemuel stud informatik uni-erlangen de>
+ * Copyright (C) 2011 Heinrich Mü<henmull src gnome org>
*
* 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
@@ -71,16 +71,17 @@ namespace
struct ThreadWorker : public WorkerPool::Worker,
public WorkerPool::Worker::Listener
{
+
+
+ ServerInfo& data;
+ std::string err;
+ const Quark server;
std::string host;
int port;
Socket::Creator::Listener * listener;
-
bool ok;
- ServerInfo& data;
Socket * socket;
- std::string err;
bool use_ssl;
- const Quark server;
#ifdef HAVE_GNUTLS
CertStore& store;
ThreadWorker (ServerInfo& d, const Quark& s, const StringView& h, int p, Socket::Creator::Listener *l,
diff --git a/pan/tasks/socket-impl-main.h b/pan/tasks/socket-impl-main.h
index e0f0643..a38398e 100644
--- a/pan/tasks/socket-impl-main.h
+++ b/pan/tasks/socket-impl-main.h
@@ -4,7 +4,7 @@
* Copyright (C) 2002-2006 Charles Kerr <charles rebelbase com>
*
* This file
- * Copyright (C) 2011 Heinrich Mü<sphemuel stud informatik uni-erlangen de>
+ * Copyright (C) 2011 Heinrich Mü<henmull src gnome org>
*
* 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
@@ -137,8 +137,8 @@ namespace pan
virtual void on_verify_cert_failed(gnutls_x509_crt_t, std::string, int);
virtual void on_valid_cert_added (gnutls_x509_crt_t, std::string );
#endif
- CertStore & store;
Data& data;
+ CertStore & store;
public:
virtual void create_socket (ServerInfo&,
diff --git a/pan/tasks/socket-impl-openssl.cc b/pan/tasks/socket-impl-openssl.cc
index 6862240..f7035c9 100644
--- a/pan/tasks/socket-impl-openssl.cc
+++ b/pan/tasks/socket-impl-openssl.cc
@@ -4,7 +4,7 @@
* Copyright (C) 2002-2006 Charles Kerr <charles rebelbase com>
*
* This file
- * Copyright (C) 2011 Heinrich Mü<sphemuel stud informatik uni-erlangen de>
+ * Copyright (C) 2011 Heinrich Mü<henmull src gnome org>
*
* 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
@@ -409,9 +409,8 @@ namespace
GIOStatus gnutls_seek(GIOChannel *handle, gint64 offset, GSeekType type, GError **gerr)
{
GIOGnuTLSChannel *chan = (GIOGnuTLSChannel *)handle;
- GIOError e;
- e = g_io_channel_seek(chan->giochan, offset, type);
- return (e == G_IO_ERROR_NONE) ? G_IO_STATUS_NORMAL : G_IO_STATUS_ERROR;
+ g_io_channel_seek_position(chan->giochan, offset, type, gerr);
+ return !gerr ? G_IO_STATUS_NORMAL : G_IO_STATUS_ERROR;
}
GIOStatus gnutls_close(GIOChannel *handle, GError **gerr)
diff --git a/pan/tasks/socket-impl-openssl.h b/pan/tasks/socket-impl-openssl.h
index 32e195d..b3199ba 100644
--- a/pan/tasks/socket-impl-openssl.h
+++ b/pan/tasks/socket-impl-openssl.h
@@ -4,7 +4,7 @@
* Copyright (C) 2002-2006 Charles Kerr <charles rebelbase com>
*
* This file
- * Copyright (C) 2011 Heinrich Mü<sphemuel stud informatik uni-erlangen de>
+ * Copyright (C) 2011 Heinrich Mü<henmull src gnome org>
* SSL functions : Copyright (C) 2002 vjt (irssi project)
*
* This program is free software; you can redistribute it and/or modify
diff --git a/pan/tasks/task-upload.cc b/pan/tasks/task-upload.cc
index 7bfde74..3b66406 100644
--- a/pan/tasks/task-upload.cc
+++ b/pan/tasks/task-upload.cc
@@ -66,7 +66,7 @@ namespace
{
std::string r;
quarks_t groups;
- int cnt(1);
+ size_t cnt(1);
foreach_const (Xref, a.xref, xit)
{
r += xit->group.to_string();
diff --git a/pan/tasks/task-upload.h b/pan/tasks/task-upload.h
index 8e425f2..2eb9a8a 100644
--- a/pan/tasks/task-upload.h
+++ b/pan/tasks/task-upload.h
@@ -73,9 +73,11 @@ namespace pan
typedef std::vector<Quark> mid_sequence_t;
struct Needed {
+
+ NNTP* nntp;
unsigned long bytes;
int partno;
- NNTP* nntp;
+
std::string message_id, last_mid;
std::string mid; // for rng
std::string cachename;
diff --git a/pan/usenet-utils/ssl-utils.h b/pan/usenet-utils/ssl-utils.h
index d369a95..d834ba1 100644
--- a/pan/usenet-utils/ssl-utils.h
+++ b/pan/usenet-utils/ssl-utils.h
@@ -5,10 +5,8 @@
* Copyright (C) 2002-2006 Charles Kerr <charles rebelbase com>
*
* This file
- * Copyright (C) 2011 Heinrich MÃller <sphemuel stud informatik uni-erlangen de>
+ * Copyright (C) 2011 Heinrich MÃller <henmull src gnome org>
* SSL functions : Copyright (C) 2002 vjt (irssi project)
- * getTimeFromASN1 : Copyright (C) 2003 Jay Case,
- * taken from : http://www.mail-archive.com/openssl-users openssl org/msg33365.html
*
* GnuTLS functions and code
* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2010 Free Software
@@ -77,14 +75,14 @@ namespace pan
{
std::map<Quark, Quark> tags;
std::string iss, sub;
- int pos1, pos2, tmp_pos1, idx;
char buf[2048];
char * dn_buf;
- size_t num_tags;
+ gnutls_x509_crt_t cert;
const char delim;
size_t len;
gnutls_datum_t d;
- gnutls_x509_crt_t cert;
+ int pos1, pos2, tmp_pos1, idx;
+ int num_tags;
gnutls_x509_dn_t dn;
size_t size;
@@ -127,6 +125,7 @@ namespace pan
pos1 = (int)index + strlen(tags_idx[idx]);
pos2 = (int)iss.find(delim, pos1);
if (pos2<=0) goto _end;
+ // seperate handling for CN tag
if (!strcmp(cleaned_tags[idx],"CN"))
{
int tmp_pos = (int)iss.find("://",pos2-1);
@@ -169,7 +168,7 @@ namespace pan
std::string build_complete (std::vector<quarks_p>& v)
{
std::stringstream s;
- for (int i=0;i<v.size(); ++i)
+ for (size_t i=0; i< v.size(); ++i)
{
s << "\t<b>"<<v[i].first<<"</b> : "<<v[i].second<<"\n";
}
@@ -181,15 +180,6 @@ namespace pan
}
};
- static std::string escaped (const std::string& s)
- {
- char * pch = g_markup_escape_text (s.c_str(), s.size());
- const std::string ret (pch);
- g_free (pch);
- return ret;
- }
-
-
static void
pretty_print_x509 (char* buf, size_t size, const Quark& server, gnutls_x509_crt_t c, bool on_connect)
{
@@ -211,7 +201,6 @@ namespace pan
char * until = date_maker.get_date_string (t);
char * before = date_maker.get_date_string (t2);
- char email1[2048], email2[2048];
char tmp1[2048], tmp2[2048];
g_snprintf(tmp1,sizeof(tmp1), _("The current server <b>'%s'</b> sent this security certificate:\n\n"), server.c_str());
g_snprintf(tmp2,sizeof(tmp2), _("Certificate information for server <b>'%s'</b>:\n\n"), server.c_str());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]