1 diff -ur a/src/c-client/netmsg.c b/src/c-client/netmsg.c
2 --- a/src/c-client/netmsg.c 2011-07-22 20:20:18.000000000 -0400
3 +++ b/src/c-client/netmsg.c 2023-10-17 22:23:29.026638315 -0400
9 extern int errno; /* just in case */
12 diff -ur a/src/c-client/nntp.c b/src/c-client/nntp.c
13 --- a/src/c-client/nntp.c 2011-07-22 20:20:18.000000000 -0400
14 +++ b/src/c-client/nntp.c 2023-10-17 22:23:05.195194961 -0400
23 diff -ur a/src/dmail/dmail.c b/src/dmail/dmail.c
24 --- a/src/dmail/dmail.c 2011-07-22 20:19:57.000000000 -0400
25 +++ b/src/dmail/dmail.c 2023-10-17 22:44:23.049223758 -0400
33 extern int errno; /* just in case */
34 diff -ur a/src/mlock/mlock.c b/src/mlock/mlock.c
35 --- a/src/mlock/mlock.c 2011-07-22 20:19:57.000000000 -0400
36 +++ b/src/mlock/mlock.c 2023-10-17 22:44:44.533985203 -0400
45 #include <sys/types.h>
47 diff -ur a/src/osdep/unix/dummy.c b/src/osdep/unix/dummy.c
48 --- a/src/osdep/unix/dummy.c 2011-07-22 20:20:10.000000000 -0400
49 +++ b/src/osdep/unix/dummy.c 2023-10-17 22:23:17.123963204 -0400
55 extern int errno; /* just in case */
58 diff -ur a/src/osdep/unix/mbx.c b/src/osdep/unix/mbx.c
59 --- a/src/osdep/unix/mbx.c 2011-07-22 20:20:11.000000000 -0400
60 +++ b/src/osdep/unix/mbx.c 2023-10-17 22:25:13.189158845 -0400
69 diff -ur a/src/osdep/unix/mh.c b/src/osdep/unix/mh.c
70 --- a/src/osdep/unix/mh.c 2011-07-22 20:20:09.000000000 -0400
71 +++ b/src/osdep/unix/mh.c 2023-10-17 22:31:50.240740603 -0400
77 extern int errno; /* just in case */
82 long mh_append (MAILSTREAM *stream,char *mailbox,append_t af,void *data);
84 -int mh_select (struct direct *name);
85 -int mh_numsort (const void *d1,const void *d2);
86 +int mh_select (const struct direct *name);
87 +int mh_numsort (const struct dirent **d1,const struct dirent **d2);
88 char *mh_file (char *dst,char *name);
89 long mh_canonicalize (char *pattern,char *ref,char *pat);
90 void mh_setdate (char *file,MESSAGECACHE *elt);
92 * Returns: T to use file name, NIL to skip it
95 -int mh_select (struct direct *name)
96 +int mh_select (const struct direct *name)
99 char *s = name->d_name;
100 @@ -1209,10 +1210,10 @@
101 * Returns: negative if d1 < d2, 0 if d1 == d2, postive if d1 > d2
104 -int mh_numsort (const void *d1,const void *d2)
105 +int mh_numsort (const struct dirent **d1,const struct dirent **d2)
107 - return atoi ((*(struct direct **) d1)->d_name) -
108 - atoi ((*(struct direct **) d2)->d_name);
109 + return atoi ((*d1)->d_name) -
110 + atoi ((*d2)->d_name);
114 diff -ur a/src/osdep/unix/mix.c b/src/osdep/unix/mix.c
115 --- a/src/osdep/unix/mix.c 2011-07-22 20:20:10.000000000 -0400
116 +++ b/src/osdep/unix/mix.c 2023-10-17 22:35:22.368131654 -0400
118 long mix_create (MAILSTREAM *stream,char *mailbox);
119 long mix_delete (MAILSTREAM *stream,char *mailbox);
120 long mix_rename (MAILSTREAM *stream,char *old,char *newname);
121 -int mix_rselect (struct direct *name);
122 +int mix_rselect (const struct direct *name);
123 MAILSTREAM *mix_open (MAILSTREAM *stream);
124 void mix_close (MAILSTREAM *stream,long options);
125 void mix_abort (MAILSTREAM *stream);
127 long mix_ping (MAILSTREAM *stream);
128 void mix_check (MAILSTREAM *stream);
129 long mix_expunge (MAILSTREAM *stream,char *sequence,long options);
130 -int mix_select (struct direct *name);
131 -int mix_msgfsort (const void *d1,const void *d2);
132 +int mix_select (const struct direct *name);
133 +int mix_msgfsort (const struct dirent **d1,const struct dirent **d2);
134 long mix_addset (SEARCHSET **set,unsigned long start,unsigned long size);
135 long mix_burp (MAILSTREAM *stream,MIXBURP *burp,unsigned long *reclaimed);
136 long mix_burp_check (SEARCHSET *set,size_t size,char *file);
138 * Returns: T if mix file name, NIL otherwise
141 -int mix_rselect (struct direct *name)
142 +int mix_rselect (const struct direct *name)
144 return mix_dirfmttest (name->d_name);
146 @@ -1146,7 +1146,7 @@
147 * ".mix" with no suffix was used by experimental versions
150 -int mix_select (struct direct *name)
151 +int mix_select (const struct direct *name)
154 /* make sure name has prefix */
155 @@ -1165,10 +1165,10 @@
156 * Returns: -1 if d1 < d2, 0 if d1 == d2, 1 d1 > d2
159 -int mix_msgfsort (const void *d1,const void *d2)
160 +int mix_msgfsort (const struct dirent **d1,const struct dirent **d2)
162 - char *n1 = (*(struct direct **) d1)->d_name + sizeof (MIXNAME) - 1;
163 - char *n2 = (*(struct direct **) d2)->d_name + sizeof (MIXNAME) - 1;
164 + char *n1 = (*d1)->d_name + sizeof (MIXNAME) - 1;
165 + char *n2 = (*d2)->d_name + sizeof (MIXNAME) - 1;
166 return compare_ulong (*n1 ? strtoul (n1,NIL,16) : 0,
167 *n2 ? strtoul (n2,NIL,16) : 0);
169 diff -ur a/src/osdep/unix/mmdf.c b/src/osdep/unix/mmdf.c
170 --- a/src/osdep/unix/mmdf.c 2011-07-22 20:20:10.000000000 -0400
171 +++ b/src/osdep/unix/mmdf.c 2023-10-17 22:25:37.095313031 -0400
177 #include <sys/stat.h>
179 #include "fdstring.h"
180 diff -ur a/src/osdep/unix/mtx.c b/src/osdep/unix/mtx.c
181 --- a/src/osdep/unix/mtx.c 2011-07-22 20:20:10.000000000 -0400
182 +++ b/src/osdep/unix/mtx.c 2023-10-17 22:26:48.973160400 -0400
188 extern int errno; /* just in case */
191 diff -ur a/src/osdep/unix/mx.c b/src/osdep/unix/mx.c
192 --- a/src/osdep/unix/mx.c 2011-07-22 20:20:09.000000000 -0400
193 +++ b/src/osdep/unix/mx.c 2023-10-17 22:33:25.621907970 -0400
199 extern int errno; /* just in case */
203 long mx_append_msg (MAILSTREAM *stream,char *flags,MESSAGECACHE *elt,
204 STRING *st,SEARCHSET *set);
206 -int mx_select (struct direct *name);
207 -int mx_numsort (const void *d1,const void *d2);
208 +int mx_select (const struct direct *name);
209 +int mx_numsort (const struct dirent **d1,const struct dirent **d2);
210 char *mx_file (char *dst,char *name);
211 long mx_lockindex (MAILSTREAM *stream);
212 void mx_unlockindex (MAILSTREAM *stream);
213 @@ -1110,7 +1111,7 @@
214 * Returns: T to use file name, NIL to skip it
217 -int mx_select (struct direct *name)
218 +int mx_select (const struct direct *name)
221 char *s = name->d_name;
222 @@ -1125,10 +1126,10 @@
223 * Returns: negative if d1 < d2, 0 if d1 == d2, postive if d1 > d2
226 -int mx_numsort (const void *d1,const void *d2)
227 +int mx_numsort (const struct dirent **d1,const struct dirent **d2)
229 - return atoi ((*(struct direct **) d1)->d_name) -
230 - atoi ((*(struct direct **) d2)->d_name);
231 + return atoi ((*d1)->d_name) -
232 + atoi ((*d2)->d_name);
236 diff -ur a/src/osdep/unix/news.c b/src/osdep/unix/news.c
237 --- a/src/osdep/unix/news.c 2011-07-22 20:20:10.000000000 -0400
238 +++ b/src/osdep/unix/news.c 2023-10-17 22:29:32.461013229 -0400
240 long news_delete (MAILSTREAM *stream,char *mailbox);
241 long news_rename (MAILSTREAM *stream,char *old,char *newname);
242 MAILSTREAM *news_open (MAILSTREAM *stream);
243 -int news_select (struct direct *name);
244 -int news_numsort (const void *d1,const void *d2);
245 +int news_select (const struct direct *name);
246 +int news_numsort (const struct dirent **d1,const struct dirent **d2);
247 void news_close (MAILSTREAM *stream,long options);
248 void news_fast (MAILSTREAM *stream,char *sequence,long flags);
249 void news_flags (MAILSTREAM *stream,char *sequence,long flags);
251 * Returns: T to use file name, NIL to skip it
254 -int news_select (struct direct *name)
255 +int news_select (const struct direct *name)
258 char *s = name->d_name;
259 @@ -417,10 +417,10 @@
260 * Returns: negative if d1 < d2, 0 if d1 == d2, postive if d1 > d2
263 -int news_numsort (const void *d1,const void *d2)
264 +int news_numsort (const struct dirent **d1,const struct dirent **d2)
266 - return atoi ((*(struct direct **) d1)->d_name) -
267 - atoi ((*(struct direct **) d2)->d_name);
268 + return atoi ((*d1)->d_name) -
269 + atoi ((*d2)->d_name);
273 diff -ur a/src/osdep/unix/tenex.c b/src/osdep/unix/tenex.c
274 --- a/src/osdep/unix/tenex.c 2011-07-22 20:20:10.000000000 -0400
275 +++ b/src/osdep/unix/tenex.c 2023-10-17 22:26:15.349497223 -0400
282 extern int errno; /* just in case */
285 diff -ur a/src/osdep/unix/unix.c b/src/osdep/unix/unix.c
286 --- a/src/osdep/unix/unix.c 2011-07-22 20:20:10.000000000 -0400
287 +++ b/src/osdep/unix/unix.c 2023-10-17 22:24:46.358134773 -0400
293 #include <sys/stat.h>
296 diff -ur a/src/tmail/tmail.c b/src/tmail/tmail.c
297 --- a/src/tmail/tmail.c 2011-07-22 20:19:58.000000000 -0400
298 +++ b/src/tmail/tmail.c 2023-10-17 22:36:32.723585260 -0400
306 extern int errno; /* just in case */