Commit 4c698e8d 4c698e8d63d1348803c076f992b9fe82f978cb34 by Sergey Poznyakoff

Fix compilation warnings

* configure.ac: Check for intptr_t
* comsat/action.c (need_crlf): Use intermediate cast to intptr_t.
* imap4d/imap4d.c (cb2_group, mu_get_user_groups): Likewise.
* libmailutils/stream/file_stream.c (fd_ioctl): Likewise.
* libmailutils/stream/mapfile_stream.c (_mapfile_ioctl): Likewise.
* libmailutils/stream/tcp.c (_tcp_ioctl): Likewise.
* maidag/maidag.c (cb2_group): Likewise.

* frm/common.c (puts_bidi): Fix the type of 3rd parameter to
fribidi_log2vis

* include/mailutils/body.h: Use MU_DEPRECATED instead of\
 __attribute__ ((deprecated)).
* include/mailutils/cfg.h: Likewise.
* include/mailutils/header.h: Likewise.
* include/mailutils/libargp.h: Likewise.
* include/mailutils/mailbox.h: Likewise.
* include/mailutils/mailer.h: Likewise.
* include/mailutils/registrar.h: Likewise.
* include/mailutils/message.h: Likewise.
(mu_message_set_stream): Remove deprecation marker.
1 parent a9d4381b
......@@ -186,7 +186,7 @@ need_crlf (mu_stream_t str)
if (mu_stream_ioctl (str, MU_IOCTL_TRANSPORT, MU_IOCTL_OP_GET, trans))
return 1; /* suppose we do need it */
if (tcgetattr ((int)trans[0], &tbuf) == 0 &&
if (tcgetattr ((int) (intptr_t) trans[0], &tbuf) == 0 &&
(tbuf.c_oflag & OPOST) && (tbuf.c_oflag & ONLCR))
return 0;
else
......
......@@ -640,6 +640,7 @@ AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_INTPTR_T
AC_CHECK_TYPE(ssize_t, , AC_DEFINE(ssize_t, int, [Define to int if <sys/types.h> does not define]))
AC_TYPE_SIGNAL
AC_DECL_SYS_SIGLIST
......
......@@ -131,7 +131,7 @@ puts_bidi (char *string)
else
{
FriBidiStrIndex len;
FriBidiCharType base = FRIBIDI_TYPE_ON;
FriBidiParType base = FRIBIDI_TYPE_ON;
fribidi_boolean log2vis;
static FriBidiChar *visual;
......@@ -156,7 +156,6 @@ puts_bidi (char *string)
if (log2vis)
{
FriBidiStrIndex idx, st;
FriBidiStrIndex new_len;
for (idx = 0; idx < len;)
{
......@@ -183,9 +182,9 @@ puts_bidi (char *string)
idx--;
inlen = idx - st;
new_len = fribidi_unicode_to_charset (fb_charset_num,
visual + st, inlen,
outstring);
fribidi_unicode_to_charset (fb_charset_num,
visual + st, inlen,
outstring);
mu_printf ("%s", outstring);
}
mu_printf ("\n");
......
......@@ -260,7 +260,7 @@ cb2_group (const char *gname, void *data)
if (!group)
mu_error (_("unknown group: %s"), gname);
else
mu_list_append (list, (void*)group->gr_gid);
mu_list_append (list, (void*) (intptr_t) group->gr_gid);
return 0;
}
......@@ -480,11 +480,13 @@ mu_get_user_groups (const char *user, mu_list_t retain, mu_list_t *pgrouplist)
for (p = gr->gr_mem; *p; p++)
if (strcmp (*p, user) == 0)
{
if (retain && mu_list_locate (retain, (void*)gr->gr_gid, NULL))
if (retain
&& mu_list_locate (retain, (void*) (intptr_t) gr->gr_gid,
NULL))
continue;
/* FIXME: Avoid duplicating gids */
rc = mu_list_append (list, (void*)gr->gr_gid);
rc = mu_list_append (list, (void*) (intptr_t) gr->gr_gid);
if (rc)
mu_error(_("%s: cannot append to list: %s"),
"mu_get_user_groups",
......@@ -592,7 +594,7 @@ imap4d_session_setup0 ()
free (real_homedir);
return 1;
}
mu_list_append (groups, (void*)auth_data->gid);
mu_list_append (groups, (void*) (intptr_t) auth_data->gid);
rc = mu_get_user_groups (auth_data->name, user_retain_groups,
&groups);
......
......@@ -31,8 +31,7 @@ extern void * mu_body_get_owner (mu_body_t);
extern int mu_body_is_modified (mu_body_t);
extern int mu_body_clear_modified (mu_body_t);
extern int mu_body_get_stream (mu_body_t, mu_stream_t *)
__attribute__ ((deprecated));
extern int mu_body_get_stream (mu_body_t, mu_stream_t *) MU_DEPRECATED;
extern int mu_body_get_streamref (mu_body_t body, mu_stream_t *pstream);
extern int mu_body_set_stream (mu_body_t, mu_stream_t, void *owner);
extern int mu_body_set_get_stream (mu_body_t,
......
......@@ -18,6 +18,7 @@
#ifndef _MAILUTILS_CFG_H
#define _MAILUTILS_CFG_H
#include <mailutils/types.h>
#include <mailutils/list.h>
#include <mailutils/debug.h>
#include <mailutils/opool.h>
......@@ -263,7 +264,7 @@ int mu_config_register_plain_section (const char *parent_path,
#ifdef MU_CFG_COMPATIBILITY
# define MU_CFG_DEPRECATED
#else
# define MU_CFG_DEPRECATED __attribute__ ((deprecated))
# define MU_CFG_DEPRECATED MU_DEPRECATED
#endif
int mu_parse_config (const char *file, const char *progname,
......
......@@ -152,8 +152,7 @@ extern int mu_header_get_field_value_unfold (mu_header_t header, size_t num,
extern int mu_header_aget_field_value_unfold (mu_header_t header, size_t num,
char **pvalue);
extern int mu_header_get_stream (mu_header_t, mu_stream_t *)
__attribute__ ((deprecated));
extern int mu_header_get_stream (mu_header_t, mu_stream_t *) MU_DEPRECATED;
extern int mu_header_get_streamref (mu_header_t, mu_stream_t *);
/* FIXME: This function does not exist:
......
......@@ -78,7 +78,7 @@ error_t mu_argp_parse (const struct argp *myargp,
unsigned flags,
const char *capa[],
int *arg_index,
void *input) __attribute__ ((deprecated));
void *input) MU_DEPRECATED;
void mu_argp_node_list_init (mu_list_t *);
void mu_argp_node_list_add (mu_list_t, mu_cfg_node_t *);
......
......@@ -69,8 +69,7 @@ extern int mu_mailbox_messages_recent (mu_mailbox_t, size_t *);
extern int mu_mailbox_message_unseen (mu_mailbox_t, size_t *);
extern int mu_mailbox_expunge (mu_mailbox_t);
extern int mu_mailbox_sync (mu_mailbox_t);
extern int mu_mailbox_save_attributes (mu_mailbox_t)
__attribute__ ((deprecated));
extern int mu_mailbox_save_attributes (mu_mailbox_t) MU_DEPRECATED;
#define MU_UIDL_LENGTH 70
#define MU_UIDL_BUFFER_SIZE (MU_UIDL_LENGTH+1)
......
......@@ -52,8 +52,7 @@ extern int mu_mailer_get_url_default (const char** url);
extern int mu_mailer_get_property (mu_mailer_t, mu_property_t *);
int mu_mailer_set_property (mu_mailer_t, mu_property_t);
extern int mu_mailer_get_stream (mu_mailer_t, mu_stream_t *)
__attribute__ ((deprecated));
extern int mu_mailer_get_stream (mu_mailer_t, mu_stream_t *) MU_DEPRECATED;
extern int mu_mailer_get_streamref (mu_mailer_t, mu_stream_t *);
extern int mu_mailer_set_stream (mu_mailer_t, mu_stream_t);
extern int mu_mailer_get_observable (mu_mailer_t, mu_observable_t *);
......
......@@ -134,12 +134,10 @@ extern int mu_message_set_header (mu_message_t, mu_header_t, void *);
extern int mu_message_get_body (mu_message_t, mu_body_t *);
extern int mu_message_set_body (mu_message_t, mu_body_t, void *);
extern int mu_message_get_stream (mu_message_t, mu_stream_t *)
__attribute__((deprecated));
extern int mu_message_get_stream (mu_message_t, mu_stream_t *) MU_DEPRECATED;
extern int mu_message_get_streamref (mu_message_t, mu_stream_t *);
extern int mu_message_set_stream (mu_message_t, mu_stream_t, void *)
__attribute__((deprecated));
extern int mu_message_set_stream (mu_message_t, mu_stream_t, void *);
extern int mu_message_get_attribute (mu_message_t, mu_attribute_t *);
extern int mu_message_set_attribute (mu_message_t, mu_attribute_t, void *);
......
......@@ -64,7 +64,7 @@ void mu_registrar_set_default_record (mu_record_t record);
/* Registration. */
int mu_registrar_get_iterator (mu_iterator_t *);
int mu_registrar_get_list (mu_list_t *) __attribute__ ((deprecated));
int mu_registrar_get_list (mu_list_t *) MU_DEPRECATED;
int mu_registrar_lookup_scheme (const char *scheme,
mu_record_t *precord);
......
......@@ -181,13 +181,13 @@ fd_ioctl (struct _mu_stream *str, int code, int opcode, void *ptr)
{
case MU_IOCTL_OP_GET:
ptrans = ptr;
ptrans[0] = (mu_transport_t) fstr->fd;
ptrans[0] = (mu_transport_t) (intptr_t) fstr->fd;
ptrans[1] = NULL;
break;
case MU_IOCTL_OP_SET:
ptrans = ptr;
fstr->fd = (int) ptrans[0];
fstr->fd = (int) (intptr_t) ptrans[0];
break;
}
break;
......
......@@ -222,7 +222,7 @@ _mapfile_ioctl (struct _mu_stream *str, int code, int opcode, void *ptr)
switch (opcode)
{
case MU_IOCTL_OP_GET:
ptrans[0] = (mu_transport_t) mfs->fd;
ptrans[0] = (mu_transport_t) (intptr_t) mfs->fd;
ptrans[1] = NULL;
break;
case MU_IOCTL_OP_SET:
......
......@@ -167,7 +167,7 @@ _tcp_ioctl (mu_stream_t stream, int code, int opcode, void *ptr)
switch (opcode)
{
case MU_IOCTL_OP_GET:
ptrans[0] = (mu_transport_t) tcp->fd;
ptrans[0] = (mu_transport_t) (intptr_t) tcp->fd;
ptrans[1] = NULL;
break;
case MU_IOCTL_OP_SET:
......
......@@ -300,7 +300,7 @@ cb2_group (const char *gname, void *data)
if (!group)
mu_error (_("unknown group: %s"), gname);
else
mu_list_append (list, (void*)group->gr_gid);
mu_list_append (list, (void*) (intptr_t) group->gr_gid);
return 0;
}
......