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) ...@@ -186,7 +186,7 @@ need_crlf (mu_stream_t str)
186 186
187 if (mu_stream_ioctl (str, MU_IOCTL_TRANSPORT, MU_IOCTL_OP_GET, trans)) 187 if (mu_stream_ioctl (str, MU_IOCTL_TRANSPORT, MU_IOCTL_OP_GET, trans))
188 return 1; /* suppose we do need it */ 188 return 1; /* suppose we do need it */
189 if (tcgetattr ((int)trans[0], &tbuf) == 0 && 189 if (tcgetattr ((int) (intptr_t) trans[0], &tbuf) == 0 &&
190 (tbuf.c_oflag & OPOST) && (tbuf.c_oflag & ONLCR)) 190 (tbuf.c_oflag & OPOST) && (tbuf.c_oflag & ONLCR))
191 return 0; 191 return 0;
192 else 192 else
......
...@@ -640,6 +640,7 @@ AC_TYPE_MODE_T ...@@ -640,6 +640,7 @@ AC_TYPE_MODE_T
640 AC_TYPE_OFF_T 640 AC_TYPE_OFF_T
641 AC_TYPE_PID_T 641 AC_TYPE_PID_T
642 AC_TYPE_SIZE_T 642 AC_TYPE_SIZE_T
643 AC_TYPE_INTPTR_T
643 AC_CHECK_TYPE(ssize_t, , AC_DEFINE(ssize_t, int, [Define to int if <sys/types.h> does not define])) 644 AC_CHECK_TYPE(ssize_t, , AC_DEFINE(ssize_t, int, [Define to int if <sys/types.h> does not define]))
644 AC_TYPE_SIGNAL 645 AC_TYPE_SIGNAL
645 AC_DECL_SYS_SIGLIST 646 AC_DECL_SYS_SIGLIST
......
...@@ -131,7 +131,7 @@ puts_bidi (char *string) ...@@ -131,7 +131,7 @@ puts_bidi (char *string)
131 else 131 else
132 { 132 {
133 FriBidiStrIndex len; 133 FriBidiStrIndex len;
134 FriBidiCharType base = FRIBIDI_TYPE_ON; 134 FriBidiParType base = FRIBIDI_TYPE_ON;
135 fribidi_boolean log2vis; 135 fribidi_boolean log2vis;
136 136
137 static FriBidiChar *visual; 137 static FriBidiChar *visual;
...@@ -156,7 +156,6 @@ puts_bidi (char *string) ...@@ -156,7 +156,6 @@ puts_bidi (char *string)
156 if (log2vis) 156 if (log2vis)
157 { 157 {
158 FriBidiStrIndex idx, st; 158 FriBidiStrIndex idx, st;
159 FriBidiStrIndex new_len;
160 159
161 for (idx = 0; idx < len;) 160 for (idx = 0; idx < len;)
162 { 161 {
...@@ -183,9 +182,9 @@ puts_bidi (char *string) ...@@ -183,9 +182,9 @@ puts_bidi (char *string)
183 idx--; 182 idx--;
184 inlen = idx - st; 183 inlen = idx - st;
185 184
186 new_len = fribidi_unicode_to_charset (fb_charset_num, 185 fribidi_unicode_to_charset (fb_charset_num,
187 visual + st, inlen, 186 visual + st, inlen,
188 outstring); 187 outstring);
189 mu_printf ("%s", outstring); 188 mu_printf ("%s", outstring);
190 } 189 }
191 mu_printf ("\n"); 190 mu_printf ("\n");
......
...@@ -260,7 +260,7 @@ cb2_group (const char *gname, void *data) ...@@ -260,7 +260,7 @@ cb2_group (const char *gname, void *data)
260 if (!group) 260 if (!group)
261 mu_error (_("unknown group: %s"), gname); 261 mu_error (_("unknown group: %s"), gname);
262 else 262 else
263 mu_list_append (list, (void*)group->gr_gid); 263 mu_list_append (list, (void*) (intptr_t) group->gr_gid);
264 return 0; 264 return 0;
265 } 265 }
266 266
...@@ -480,11 +480,13 @@ mu_get_user_groups (const char *user, mu_list_t retain, mu_list_t *pgrouplist) ...@@ -480,11 +480,13 @@ mu_get_user_groups (const char *user, mu_list_t retain, mu_list_t *pgrouplist)
480 for (p = gr->gr_mem; *p; p++) 480 for (p = gr->gr_mem; *p; p++)
481 if (strcmp (*p, user) == 0) 481 if (strcmp (*p, user) == 0)
482 { 482 {
483 if (retain && mu_list_locate (retain, (void*)gr->gr_gid, NULL)) 483 if (retain
484 && mu_list_locate (retain, (void*) (intptr_t) gr->gr_gid,
485 NULL))
484 continue; 486 continue;
485 487
486 /* FIXME: Avoid duplicating gids */ 488 /* FIXME: Avoid duplicating gids */
487 rc = mu_list_append (list, (void*)gr->gr_gid); 489 rc = mu_list_append (list, (void*) (intptr_t) gr->gr_gid);
488 if (rc) 490 if (rc)
489 mu_error(_("%s: cannot append to list: %s"), 491 mu_error(_("%s: cannot append to list: %s"),
490 "mu_get_user_groups", 492 "mu_get_user_groups",
...@@ -592,7 +594,7 @@ imap4d_session_setup0 () ...@@ -592,7 +594,7 @@ imap4d_session_setup0 ()
592 free (real_homedir); 594 free (real_homedir);
593 return 1; 595 return 1;
594 } 596 }
595 mu_list_append (groups, (void*)auth_data->gid); 597 mu_list_append (groups, (void*) (intptr_t) auth_data->gid);
596 598
597 rc = mu_get_user_groups (auth_data->name, user_retain_groups, 599 rc = mu_get_user_groups (auth_data->name, user_retain_groups,
598 &groups); 600 &groups);
......
...@@ -31,8 +31,7 @@ extern void * mu_body_get_owner (mu_body_t); ...@@ -31,8 +31,7 @@ extern void * mu_body_get_owner (mu_body_t);
31 extern int mu_body_is_modified (mu_body_t); 31 extern int mu_body_is_modified (mu_body_t);
32 extern int mu_body_clear_modified (mu_body_t); 32 extern int mu_body_clear_modified (mu_body_t);
33 33
34 extern int mu_body_get_stream (mu_body_t, mu_stream_t *) 34 extern int mu_body_get_stream (mu_body_t, mu_stream_t *) MU_DEPRECATED;
35 __attribute__ ((deprecated));
36 extern int mu_body_get_streamref (mu_body_t body, mu_stream_t *pstream); 35 extern int mu_body_get_streamref (mu_body_t body, mu_stream_t *pstream);
37 extern int mu_body_set_stream (mu_body_t, mu_stream_t, void *owner); 36 extern int mu_body_set_stream (mu_body_t, mu_stream_t, void *owner);
38 extern int mu_body_set_get_stream (mu_body_t, 37 extern int mu_body_set_get_stream (mu_body_t,
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
18 #ifndef _MAILUTILS_CFG_H 18 #ifndef _MAILUTILS_CFG_H
19 #define _MAILUTILS_CFG_H 19 #define _MAILUTILS_CFG_H
20 20
21 #include <mailutils/types.h>
21 #include <mailutils/list.h> 22 #include <mailutils/list.h>
22 #include <mailutils/debug.h> 23 #include <mailutils/debug.h>
23 #include <mailutils/opool.h> 24 #include <mailutils/opool.h>
...@@ -263,7 +264,7 @@ int mu_config_register_plain_section (const char *parent_path, ...@@ -263,7 +264,7 @@ int mu_config_register_plain_section (const char *parent_path,
263 #ifdef MU_CFG_COMPATIBILITY 264 #ifdef MU_CFG_COMPATIBILITY
264 # define MU_CFG_DEPRECATED 265 # define MU_CFG_DEPRECATED
265 #else 266 #else
266 # define MU_CFG_DEPRECATED __attribute__ ((deprecated)) 267 # define MU_CFG_DEPRECATED MU_DEPRECATED
267 #endif 268 #endif
268 269
269 int mu_parse_config (const char *file, const char *progname, 270 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, ...@@ -152,8 +152,7 @@ extern int mu_header_get_field_value_unfold (mu_header_t header, size_t num,
152 extern int mu_header_aget_field_value_unfold (mu_header_t header, size_t num, 152 extern int mu_header_aget_field_value_unfold (mu_header_t header, size_t num,
153 char **pvalue); 153 char **pvalue);
154 154
155 extern int mu_header_get_stream (mu_header_t, mu_stream_t *) 155 extern int mu_header_get_stream (mu_header_t, mu_stream_t *) MU_DEPRECATED;
156 __attribute__ ((deprecated));
157 extern int mu_header_get_streamref (mu_header_t, mu_stream_t *); 156 extern int mu_header_get_streamref (mu_header_t, mu_stream_t *);
158 157
159 /* FIXME: This function does not exist: 158 /* FIXME: This function does not exist:
......
...@@ -78,7 +78,7 @@ error_t mu_argp_parse (const struct argp *myargp, ...@@ -78,7 +78,7 @@ error_t mu_argp_parse (const struct argp *myargp,
78 unsigned flags, 78 unsigned flags,
79 const char *capa[], 79 const char *capa[],
80 int *arg_index, 80 int *arg_index,
81 void *input) __attribute__ ((deprecated)); 81 void *input) MU_DEPRECATED;
82 82
83 void mu_argp_node_list_init (mu_list_t *); 83 void mu_argp_node_list_init (mu_list_t *);
84 void mu_argp_node_list_add (mu_list_t, mu_cfg_node_t *); 84 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 *); ...@@ -69,8 +69,7 @@ extern int mu_mailbox_messages_recent (mu_mailbox_t, size_t *);
69 extern int mu_mailbox_message_unseen (mu_mailbox_t, size_t *); 69 extern int mu_mailbox_message_unseen (mu_mailbox_t, size_t *);
70 extern int mu_mailbox_expunge (mu_mailbox_t); 70 extern int mu_mailbox_expunge (mu_mailbox_t);
71 extern int mu_mailbox_sync (mu_mailbox_t); 71 extern int mu_mailbox_sync (mu_mailbox_t);
72 extern int mu_mailbox_save_attributes (mu_mailbox_t) 72 extern int mu_mailbox_save_attributes (mu_mailbox_t) MU_DEPRECATED;
73 __attribute__ ((deprecated));
74 73
75 #define MU_UIDL_LENGTH 70 74 #define MU_UIDL_LENGTH 70
76 #define MU_UIDL_BUFFER_SIZE (MU_UIDL_LENGTH+1) 75 #define MU_UIDL_BUFFER_SIZE (MU_UIDL_LENGTH+1)
......
...@@ -52,8 +52,7 @@ extern int mu_mailer_get_url_default (const char** url); ...@@ -52,8 +52,7 @@ extern int mu_mailer_get_url_default (const char** url);
52 extern int mu_mailer_get_property (mu_mailer_t, mu_property_t *); 52 extern int mu_mailer_get_property (mu_mailer_t, mu_property_t *);
53 int mu_mailer_set_property (mu_mailer_t, mu_property_t); 53 int mu_mailer_set_property (mu_mailer_t, mu_property_t);
54 54
55 extern int mu_mailer_get_stream (mu_mailer_t, mu_stream_t *) 55 extern int mu_mailer_get_stream (mu_mailer_t, mu_stream_t *) MU_DEPRECATED;
56 __attribute__ ((deprecated));
57 extern int mu_mailer_get_streamref (mu_mailer_t, mu_stream_t *); 56 extern int mu_mailer_get_streamref (mu_mailer_t, mu_stream_t *);
58 extern int mu_mailer_set_stream (mu_mailer_t, mu_stream_t); 57 extern int mu_mailer_set_stream (mu_mailer_t, mu_stream_t);
59 extern int mu_mailer_get_observable (mu_mailer_t, mu_observable_t *); 58 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 *); ...@@ -134,12 +134,10 @@ extern int mu_message_set_header (mu_message_t, mu_header_t, void *);
134 extern int mu_message_get_body (mu_message_t, mu_body_t *); 134 extern int mu_message_get_body (mu_message_t, mu_body_t *);
135 extern int mu_message_set_body (mu_message_t, mu_body_t, void *); 135 extern int mu_message_set_body (mu_message_t, mu_body_t, void *);
136 136
137 extern int mu_message_get_stream (mu_message_t, mu_stream_t *) 137 extern int mu_message_get_stream (mu_message_t, mu_stream_t *) MU_DEPRECATED;
138 __attribute__((deprecated));
139 extern int mu_message_get_streamref (mu_message_t, mu_stream_t *); 138 extern int mu_message_get_streamref (mu_message_t, mu_stream_t *);
140 139
141 extern int mu_message_set_stream (mu_message_t, mu_stream_t, void *) 140 extern int mu_message_set_stream (mu_message_t, mu_stream_t, void *);
142 __attribute__((deprecated));
143 141
144 extern int mu_message_get_attribute (mu_message_t, mu_attribute_t *); 142 extern int mu_message_get_attribute (mu_message_t, mu_attribute_t *);
145 extern int mu_message_set_attribute (mu_message_t, mu_attribute_t, void *); 143 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); ...@@ -64,7 +64,7 @@ void mu_registrar_set_default_record (mu_record_t record);
64 64
65 /* Registration. */ 65 /* Registration. */
66 int mu_registrar_get_iterator (mu_iterator_t *); 66 int mu_registrar_get_iterator (mu_iterator_t *);
67 int mu_registrar_get_list (mu_list_t *) __attribute__ ((deprecated)); 67 int mu_registrar_get_list (mu_list_t *) MU_DEPRECATED;
68 68
69 int mu_registrar_lookup_scheme (const char *scheme, 69 int mu_registrar_lookup_scheme (const char *scheme,
70 mu_record_t *precord); 70 mu_record_t *precord);
......
...@@ -181,13 +181,13 @@ fd_ioctl (struct _mu_stream *str, int code, int opcode, void *ptr) ...@@ -181,13 +181,13 @@ fd_ioctl (struct _mu_stream *str, int code, int opcode, void *ptr)
181 { 181 {
182 case MU_IOCTL_OP_GET: 182 case MU_IOCTL_OP_GET:
183 ptrans = ptr; 183 ptrans = ptr;
184 ptrans[0] = (mu_transport_t) fstr->fd; 184 ptrans[0] = (mu_transport_t) (intptr_t) fstr->fd;
185 ptrans[1] = NULL; 185 ptrans[1] = NULL;
186 break; 186 break;
187 187
188 case MU_IOCTL_OP_SET: 188 case MU_IOCTL_OP_SET:
189 ptrans = ptr; 189 ptrans = ptr;
190 fstr->fd = (int) ptrans[0]; 190 fstr->fd = (int) (intptr_t) ptrans[0];
191 break; 191 break;
192 } 192 }
193 break; 193 break;
......
...@@ -222,7 +222,7 @@ _mapfile_ioctl (struct _mu_stream *str, int code, int opcode, void *ptr) ...@@ -222,7 +222,7 @@ _mapfile_ioctl (struct _mu_stream *str, int code, int opcode, void *ptr)
222 switch (opcode) 222 switch (opcode)
223 { 223 {
224 case MU_IOCTL_OP_GET: 224 case MU_IOCTL_OP_GET:
225 ptrans[0] = (mu_transport_t) mfs->fd; 225 ptrans[0] = (mu_transport_t) (intptr_t) mfs->fd;
226 ptrans[1] = NULL; 226 ptrans[1] = NULL;
227 break; 227 break;
228 case MU_IOCTL_OP_SET: 228 case MU_IOCTL_OP_SET:
......
...@@ -167,7 +167,7 @@ _tcp_ioctl (mu_stream_t stream, int code, int opcode, void *ptr) ...@@ -167,7 +167,7 @@ _tcp_ioctl (mu_stream_t stream, int code, int opcode, void *ptr)
167 switch (opcode) 167 switch (opcode)
168 { 168 {
169 case MU_IOCTL_OP_GET: 169 case MU_IOCTL_OP_GET:
170 ptrans[0] = (mu_transport_t) tcp->fd; 170 ptrans[0] = (mu_transport_t) (intptr_t) tcp->fd;
171 ptrans[1] = NULL; 171 ptrans[1] = NULL;
172 break; 172 break;
173 case MU_IOCTL_OP_SET: 173 case MU_IOCTL_OP_SET:
......
...@@ -300,7 +300,7 @@ cb2_group (const char *gname, void *data) ...@@ -300,7 +300,7 @@ cb2_group (const char *gname, void *data)
300 if (!group) 300 if (!group)
301 mu_error (_("unknown group: %s"), gname); 301 mu_error (_("unknown group: %s"), gname);
302 else 302 else
303 mu_list_append (list, (void*)group->gr_gid); 303 mu_list_append (list, (void*) (intptr_t) group->gr_gid);
304 return 0; 304 return 0;
305 } 305 }
306 306
......