2 Subject: Patch 6.2.115 (extra)
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Compiler warnings with various Amiga compilers.
12 Solution: Add typecast, prototypes, et al. Those changes that are
13 Amiga-specific. (Flavio Stanchina)
14 Files: src/fileio.c, src/memfile.c, src/os_amiga.c, src/os_amiga.h,
18 *** ../vim-6.2.114/src/fileio.c Sat Sep 27 19:36:46 2003
19 --- src/fileio.c Wed Sep 17 22:01:56 2003
26 - # include <proto/dos.h> /* for Lock() and UnLock() */
30 # include <limits.h> /* for SSIZE_MAX */
33 *** ../vim-6.2.114/src/memfile.c Sun May 4 22:43:59 2003
34 --- src/memfile.c Wed Sep 17 22:03:02 2003
42 BPTR fh = (BPTR)fdtofh(mfp->mf_fd);
49 ! # if defined(_DCC) || defined(__GNUC__)
52 + /* Have function (in libnix at least),
53 + * but ain't got no prototype anywhere. */
54 + unsigned long fdtofh(int filedescriptor);
57 BPTR fh = (BPTR)fdtofh(mfp->mf_fd);
60 *** ../vim-6.2.114/src/os_amiga.c Sat Apr 19 15:10:39 2003
61 --- src/os_amiga.c Sun Oct 12 17:24:09 2003
64 static int lock2name __ARGS((BPTR lock, char_u *buf, long len));
65 static void out_num __ARGS((long n));
66 static struct FileInfoBlock *get_fib __ARGS((char_u *));
67 ! static int sortcmp __ARGS((char **a, char **b));
69 static BPTR raw_in = (BPTR)NULL;
70 static BPTR raw_out = (BPTR)NULL;
72 static int lock2name __ARGS((BPTR lock, char_u *buf, long len));
73 static void out_num __ARGS((long n));
74 static struct FileInfoBlock *get_fib __ARGS((char_u *));
75 ! static int sortcmp __ARGS((const void *a, const void *b));
77 static BPTR raw_in = (BPTR)NULL;
78 static BPTR raw_out = (BPTR)NULL;
84 ! #define DOS_LIBRARY ((UBYTE *) "dos.library")
93 ! # define DOS_LIBRARY ((UBYTE *)"dos.library")
100 static char_u *(constrings[3]) = {(char_u *)"con:0/0/662/210/",
101 (char_u *)"con:0/0/640/200/",
102 (char_u *)"con:0/0/320/200/"};
103 ! static char_u winerr[] = _("VIM: Can't open window!\n");
108 static char_u *(constrings[3]) = {(char_u *)"con:0/0/662/210/",
109 (char_u *)"con:0/0/640/200/",
110 (char_u *)"con:0/0/320/200/"};
111 ! static char_u winerr[] = (char_u *)N_("VIM: Can't open window!\n");
118 * check if we are running under DOS 2.0x or higher
120 ! if (DosBase = OpenLibrary(DOS_LIBRARY, 37L))
122 CloseLibrary(DosBase);
126 * check if we are running under DOS 2.0x or higher
128 ! DosBase = OpenLibrary(DOS_LIBRARY, 37L);
129 ! if (DosBase != NULL)
130 ! /* if (((struct Library *)DOSBase)->lib_Version >= 37) */
132 CloseLibrary(DosBase);
137 if (raw_in == (BPTR)NULL) /* all three failed */
139 ! mch_errmsg((char *)winerr);
145 if (raw_in == (BPTR)NULL) /* all three failed */
147 ! mch_errmsg(_(winerr));
153 * Make a unique name for the temp file (which we will not delete!).
154 * Use a pointer on the stack (nobody else will be using it).
156 ! sprintf((char *)buf1, "t:nc%ld", (char *)buf1);
157 if ((fh = Open((UBYTE *)buf1, (long)MODE_NEWFILE)) == (BPTR)NULL)
159 mch_errmsg(_("Cannot create "));
161 * Make a unique name for the temp file (which we will not delete!).
162 * Use a pointer on the stack (nobody else will be using it).
164 ! sprintf((char *)buf1, "t:nc%ld", (long)buf1);
165 if ((fh = Open((UBYTE *)buf1, (long)MODE_NEWFILE)) == (BPTR)NULL)
167 mch_errmsg(_("Cannot create "));
170 if (i == 3) /* all three failed */
172 DeleteFile((UBYTE *)buf1);
173 ! mch_errmsg((char *)winerr);
176 exitval = 0; /* The Execute succeeded: exit this program */
178 if (i == 3) /* all three failed */
180 DeleteFile((UBYTE *)buf1);
181 ! mch_errmsg(_(winerr));
184 exitval = 0; /* The Execute succeeded: exit this program */
192 if (!(options & SHELL_SILENT))
198 ! if ((x = IoErr()) != 0)
200 if (!(options & SHELL_SILENT))
207 ! if (mydir = CurrentDir(mydir)) /* make sure we stay in the same directory */
209 if (tmode == TMODE_RAW)
210 settmode(TMODE_RAW); /* set to raw mode */
215 ! if ((mydir = CurrentDir(mydir)) != 0) /* make sure we stay in the same directory */
217 if (tmode == TMODE_RAW)
218 settmode(TMODE_RAW); /* set to raw mode */
226 ! return pathcmp(*a, *b);
236 ! char_u *s = *(char **)a,
238 ! return pathcmp(s, t);
242 *** ../vim-6.2.114/src/os_amiga.h Thu Jul 26 14:00:21 2001
243 --- src/os_amiga.h Wed Sep 17 22:15:14 2003
246 #define HAVE_AVAIL_MEM
248 #ifndef HAVE_CONFIG_H
252 # define HAVE_STDLIB_H
254 #define HAVE_AVAIL_MEM
256 #ifndef HAVE_CONFIG_H
260 # define HAVE_STDLIB_H
265 #endif /* HAVE_CONFIG_H */
267 + #include <exec/types.h>
268 + #include <libraries/dos.h>
269 + #include <libraries/dosextens.h>
271 + /* Currently, all Amiga compilers except AZTEC C have these... */
273 + # include <proto/exec.h>
274 + # include <proto/dos.h>
275 + # include <proto/intuition.h>
278 #define FNAME_ILLEGAL ";*?`#%" /* illegal characters in a file name */
286 # define USE_TMPNAM /* use tmpnam() instead of mktemp() */
290 + # include <sys/stat.h>
291 + # include <unistd.h>
295 *** ../vim-6.2.114/src/vim.h Sun Oct 12 16:42:14 2003
296 --- src/vim.h Wed Sep 17 22:15:42 2003
300 /* Be conservative about sizeof(int). It could be 4 too. */
301 # ifndef FEAT_GUI_GTK /* avoid problems when generating prototypes */
302 ! # define SIZEOF_INT 2
308 /* Be conservative about sizeof(int). It could be 4 too. */
309 # ifndef FEAT_GUI_GTK /* avoid problems when generating prototypes */
311 ! # define SIZEOF_INT 4
313 ! # define SIZEOF_INT 2
318 *** ../vim-6.2.114/src/version.c Sun Oct 12 17:14:12 2003
319 --- src/version.c Sun Oct 12 17:15:47 2003
323 { /* Add new patch number below this line */
329 Rule #1: Don't give somebody a tool that he's going to hurt himself with.
331 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
332 /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
333 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
334 \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///