[balsa/70-libbalsa-message-structure: 15/18] message: Declare LibBalsaMessage:msgno as guint
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/70-libbalsa-message-structure: 15/18] message: Declare LibBalsaMessage:msgno as guint
- Date: Wed, 6 Apr 2022 18:10:18 +0000 (UTC)
commit 6ec108e6601b97c8fa623c235fd3a77695ce7a7e
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Tue Mar 15 20:08:22 2022 -0400
message: Declare LibBalsaMessage:msgno as guint
instead of glong; fix the fallout and remove redundant casts.
libbalsa/mailbox_imap.c | 8 ++++----
libbalsa/message.c | 6 +++---
libbalsa/message.h | 4 ++--
src/balsa-message.c | 2 +-
src/message-window.c | 2 +-
5 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/libbalsa/mailbox_imap.c b/libbalsa/mailbox_imap.c
index 929e3a2ef..df329ebda 100644
--- a/libbalsa/mailbox_imap.c
+++ b/libbalsa/mailbox_imap.c
@@ -2256,7 +2256,7 @@ libbalsa_mailbox_imap_fetch_structure(LibBalsaMailbox *mailbox,
LibBalsaMailboxImap *mimap = LIBBALSA_MAILBOX_IMAP(mailbox);
LibBalsaServer *server;
LibBalsaMessageHeaders *headers;
- glong msgno;
+ guint msgno;
ImapFetchType ift = 0;
g_return_val_if_fail(mimap->opened, FALSE);
@@ -2327,7 +2327,7 @@ libbalsa_mailbox_imap_fetch_headers(LibBalsaMailbox *mailbox,
ImapResponse rc;
guint msgno;
- msgno = (guint) libbalsa_message_get_msgno(message);
+ msgno = libbalsa_message_get_msgno(message);
/* If message numbers are out of sync with the mail store,
* just skip the message: */
if (msgno > imap_mbox_handle_get_exists(mimap->handle))
@@ -2473,7 +2473,7 @@ lbm_imap_get_msg_part_from_cache(LibBalsaMessage * message,
LibBalsaMailboxImap *mimap = LIBBALSA_MAILBOX_IMAP(mailbox);
FILE *fp;
gchar *section;
- glong msgno = libbalsa_message_get_msgno(message);
+ guint msgno = libbalsa_message_get_msgno(message);
ImapMessage *imsg = mi_get_imsg(mimap, msgno);
if (imsg == NULL) {
@@ -2538,7 +2538,7 @@ lbm_imap_get_msg_part_from_cache(LibBalsaMessage * message,
section, FALSE, ifbo, append_str, &dt));
libbalsa_unlock_mailbox(mailbox);
if(rc != IMR_OK) {
- g_debug("Error fetching imap message no %ld section %s",
+ g_debug("Error fetching imap message no %u section %s",
msgno, section);
g_set_error(err,
LIBBALSA_MAILBOX_ERROR, LIBBALSA_MAILBOX_ACCESS_ERROR,
diff --git a/libbalsa/message.c b/libbalsa/message.c
index a3d210f70..456587441 100644
--- a/libbalsa/message.c
+++ b/libbalsa/message.c
@@ -114,7 +114,7 @@ struct _LibBalsaMessage {
guint body_ref;
LibBalsaMessageBody *body_list;
- glong msgno; /* message no; always copy for faster sorting;
+ guint msgno; /* message no; always copy for faster sorting;
* counting starts at 1. */
#if MESSAGE_COPY_CONTENT
glong length; /* byte len */
@@ -1584,7 +1584,7 @@ libbalsa_message_get_message_id(LibBalsaMessage *message)
}
-glong
+guint
libbalsa_message_get_msgno(LibBalsaMessage *message)
{
g_return_val_if_fail(LIBBALSA_IS_MESSAGE(message), 0);
@@ -1747,7 +1747,7 @@ libbalsa_message_set_mailbox(LibBalsaMessage *message,
void
libbalsa_message_set_msgno(LibBalsaMessage *message,
- glong msgno)
+ guint msgno)
{
g_return_if_fail(LIBBALSA_IS_MESSAGE(message));
diff --git a/libbalsa/message.h b/libbalsa/message.h
index 8c20e3f5b..625061221 100644
--- a/libbalsa/message.h
+++ b/libbalsa/message.h
@@ -300,7 +300,7 @@ LibBalsaMessageBody *libbalsa_message_get_body_list(LibBalsaMessage *message)
GMimeMessage *libbalsa_message_get_mime_message(LibBalsaMessage *message);
LibBalsaMessageFlag libbalsa_message_get_flags(LibBalsaMessage *message);
const gchar *libbalsa_message_get_message_id(LibBalsaMessage *message);
-glong libbalsa_message_get_msgno(LibBalsaMessage *message);
+guint libbalsa_message_get_msgno(LibBalsaMessage *message);
glong libbalsa_message_get_length(LibBalsaMessage *message);
gboolean libbalsa_message_get_has_all_headers(LibBalsaMessage *message);
InternetAddressList *libbalsa_message_get_sender(LibBalsaMessage *message);
@@ -324,7 +324,7 @@ void libbalsa_message_set_flags(LibBalsaMessage *message,
void libbalsa_message_set_mailbox(LibBalsaMessage *message,
LibBalsaMailbox *mailbox);
void libbalsa_message_set_msgno(LibBalsaMessage *message,
- glong msgno);
+ guint msgno);
void libbalsa_message_set_has_all_headers(LibBalsaMessage *message,
gboolean has_all_headers);
diff --git a/src/balsa-message.c b/src/balsa-message.c
index dc4bcd980..0f1bc8f33 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -1146,7 +1146,7 @@ balsa_message_set(BalsaMessage * balsa_message, LibBalsaMailbox * mailbox, guint
balsa_information(LIBBALSA_INFORMATION_WARNING,
_("Could not access message %u "
"in mailbox ā%sā."),
- (guint) libbalsa_message_get_msgno(message),
+ libbalsa_message_get_msgno(message),
libbalsa_mailbox_get_name(mailbox));
return FALSE;
}
diff --git a/src/message-window.c b/src/message-window.c
index 46c5413b3..b2bfd8d5c 100644
--- a/src/message-window.c
+++ b/src/message-window.c
@@ -402,7 +402,7 @@ destroy_message_window(GtkWidget * widget, MessageWindow * mw)
static void
mw_expunged_cb(LibBalsaMailbox * mailbox, guint msgno, MessageWindow * mw)
{
- if (mw->message != NULL && (guint) libbalsa_message_get_msgno(mw->message) == msgno)
+ if (mw->message != NULL && libbalsa_message_get_msgno(mw->message) == msgno)
gtk_widget_destroy(mw->window);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]