While tracing through ACCOUNT/ciss_url_t lifetimes, I noticed this
cast.
Previously this may not have been changeable because the string fields
were fixed size inside the ACCOUNT. But now, they are dynamically
allocated. The ciss_url_t simply points at the dynamic fields, so it
won't trigger any compiler warnings.
---
account.c | 2 +-
account.h | 2 +-
mutt_socket.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/account.c b/account.c
index 5a711547..3ac2870d 100644
--- a/account.c
+++ b/account.c
@@ -139,7 +139,7 @@ int mutt_account_fromurl(ACCOUNT *account, ciss_url_t *url)
* to prevent cross-muttrc name collisions. For that case, pass 1 to
* force_users
*/
-void mutt_account_tourl(ACCOUNT *account, ciss_url_t *url, int force_user)
+void mutt_account_tourl(const ACCOUNT *account, ciss_url_t *url, int
force_user)
{
url->scheme = U_UNKNOWN;
url->user = NULL;
diff --git a/account.h b/account.h
index 137a7bb6..6e783f7a 100644
--- a/account.h
+++ b/account.h
@@ -57,7 +57,7 @@ void mutt_account_free(ACCOUNT *account);
void mutt_account_copy(ACCOUNT *dest, const ACCOUNT *src);
int mutt_account_match(const ACCOUNT *a1, const ACCOUNT *m2);
int mutt_account_fromurl(ACCOUNT *account, ciss_url_t *url);
-void mutt_account_tourl(ACCOUNT *account, ciss_url_t *url, int force_user);
+void mutt_account_tourl(const ACCOUNT *account, ciss_url_t *url, int
force_user);
int mutt_account_getuser(ACCOUNT *account);
int mutt_account_getlogin(ACCOUNT *account);
int _mutt_account_getpass(ACCOUNT *account,
diff --git a/mutt_socket.c b/mutt_socket.c
index 1a4ca46d..c1ba7764 100644
--- a/mutt_socket.c
+++ b/mutt_socket.c
@@ -307,7 +307,7 @@ CONNECTION *mutt_conn_find(const CONNECTION *start, const
ACCOUNT *account)
char hook[LONG_STRING];
/* account isn't actually modified, since url isn't either */
- mutt_account_tourl((ACCOUNT*) account, &url, 0);
+ mutt_account_tourl(account, &url, 0);
url.path = NULL;
url_ciss_tostring(&url, hook, sizeof(hook), 0);
mutt_account_hook(hook);
--
2.55.0