To: vim-dev@vim.org Subject: Patch 6.2.115 (extra) Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.115 (extra) Problem: Compiler warnings with various Amiga compilers. Solution: Add typecast, prototypes, et al. Those changes that are Amiga-specific. (Flavio Stanchina) Files: src/fileio.c, src/memfile.c, src/os_amiga.c, src/os_amiga.h, src/vim.h *** ../vim-6.2.114/src/fileio.c Sat Sep 27 19:36:46 2003 --- src/fileio.c Wed Sep 17 22:01:56 2003 *************** *** 25,34 **** # include #endif - #ifdef LATTICE - # include /* for Lock() and UnLock() */ - #endif - #ifdef __TANDEM # include /* for SSIZE_MAX */ #endif --- 25,30 ---- *** ../vim-6.2.114/src/memfile.c Sun May 4 22:43:59 2003 --- src/memfile.c Wed Sep 17 22:03:02 2003 *************** *** 660,667 **** Flush(fp->ufbfh); } # else ! # ifdef _DCC { BPTR fh = (BPTR)fdtofh(mfp->mf_fd); if (fh != 0) --- 660,673 ---- Flush(fp->ufbfh); } # else ! # if defined(_DCC) || defined(__GNUC__) { + # ifdef __GNUC__ + /* Have function (in libnix at least), + * but ain't got no prototype anywhere. */ + unsigned long fdtofh(int filedescriptor); + # endif + BPTR fh = (BPTR)fdtofh(mfp->mf_fd); if (fh != 0) *** ../vim-6.2.114/src/os_amiga.c Sat Apr 19 15:10:39 2003 --- src/os_amiga.c Sun Oct 12 17:24:09 2003 *************** *** 62,68 **** static int lock2name __ARGS((BPTR lock, char_u *buf, long len)); static void out_num __ARGS((long n)); static struct FileInfoBlock *get_fib __ARGS((char_u *)); ! static int sortcmp __ARGS((char **a, char **b)); static BPTR raw_in = (BPTR)NULL; static BPTR raw_out = (BPTR)NULL; --- 62,68 ---- static int lock2name __ARGS((BPTR lock, char_u *buf, long len)); static void out_num __ARGS((long n)); static struct FileInfoBlock *get_fib __ARGS((char_u *)); ! static int sortcmp __ARGS((const void *a, const void *b)); static BPTR raw_in = (BPTR)NULL; static BPTR raw_out = (BPTR)NULL; *************** *** 233,239 **** suspend_shell(); } ! #define DOS_LIBRARY ((UBYTE *) "dos.library") void mch_init() --- 233,241 ---- suspend_shell(); } ! #ifndef DOS_LIBRARY ! # define DOS_LIBRARY ((UBYTE *)"dos.library") ! #endif void mch_init() *************** *** 304,310 **** static char_u *(constrings[3]) = {(char_u *)"con:0/0/662/210/", (char_u *)"con:0/0/640/200/", (char_u *)"con:0/0/320/200/"}; ! static char_u winerr[] = _("VIM: Can't open window!\n"); struct WBArg *argp; int ac; char *av; --- 306,312 ---- static char_u *(constrings[3]) = {(char_u *)"con:0/0/662/210/", (char_u *)"con:0/0/640/200/", (char_u *)"con:0/0/320/200/"}; ! static char_u winerr[] = (char_u *)N_("VIM: Can't open window!\n"); struct WBArg *argp; int ac; char *av; *************** *** 316,322 **** /* * check if we are running under DOS 2.0x or higher */ ! if (DosBase = OpenLibrary(DOS_LIBRARY, 37L)) { CloseLibrary(DosBase); #ifdef FEAT_ARP --- 318,326 ---- /* * check if we are running under DOS 2.0x or higher */ ! DosBase = OpenLibrary(DOS_LIBRARY, 37L); ! if (DosBase != NULL) ! /* if (((struct Library *)DOSBase)->lib_Version >= 37) */ { CloseLibrary(DosBase); #ifdef FEAT_ARP *************** *** 394,400 **** } if (raw_in == (BPTR)NULL) /* all three failed */ { ! mch_errmsg((char *)winerr); goto exit; } raw_out = raw_in; --- 398,404 ---- } if (raw_in == (BPTR)NULL) /* all three failed */ { ! mch_errmsg(_(winerr)); goto exit; } raw_out = raw_in; *************** *** 412,418 **** * Make a unique name for the temp file (which we will not delete!). * Use a pointer on the stack (nobody else will be using it). */ ! sprintf((char *)buf1, "t:nc%ld", (char *)buf1); if ((fh = Open((UBYTE *)buf1, (long)MODE_NEWFILE)) == (BPTR)NULL) { mch_errmsg(_("Cannot create ")); --- 416,422 ---- * Make a unique name for the temp file (which we will not delete!). * Use a pointer on the stack (nobody else will be using it). */ ! sprintf((char *)buf1, "t:nc%ld", (long)buf1); if ((fh = Open((UBYTE *)buf1, (long)MODE_NEWFILE)) == (BPTR)NULL) { mch_errmsg(_("Cannot create ")); *************** *** 499,505 **** if (i == 3) /* all three failed */ { DeleteFile((UBYTE *)buf1); ! mch_errmsg((char *)winerr); goto exit; } exitval = 0; /* The Execute succeeded: exit this program */ --- 503,509 ---- if (i == 3) /* all three failed */ { DeleteFile((UBYTE *)buf1); ! mch_errmsg(_(winerr)); goto exit; } exitval = 0; /* The Execute succeeded: exit this program */ *************** *** 1198,1204 **** else if (x) # endif { ! if (x = IoErr()) { if (!(options & SHELL_SILENT)) { --- 1202,1208 ---- else if (x) # endif { ! if ((x = IoErr()) != 0) { if (!(options & SHELL_SILENT)) { *************** *** 1314,1320 **** vim_free(shellcmd); #endif /* AZTEC_C */ ! if (mydir = CurrentDir(mydir)) /* make sure we stay in the same directory */ UnLock(mydir); if (tmode == TMODE_RAW) settmode(TMODE_RAW); /* set to raw mode */ --- 1318,1324 ---- vim_free(shellcmd); #endif /* AZTEC_C */ ! if ((mydir = CurrentDir(mydir)) != 0) /* make sure we stay in the same directory */ UnLock(mydir); if (tmode == TMODE_RAW) settmode(TMODE_RAW); /* set to raw mode */ *************** *** 1478,1486 **** static int sortcmp(a, b) ! char **a, **b; { ! return pathcmp(*a, *b); } /* --- 1482,1492 ---- static int sortcmp(a, b) ! const void *a, *b; { ! char_u *s = *(char **)a, ! *t = *(char **)b; ! return pathcmp(s, t); } /* *** ../vim-6.2.114/src/os_amiga.h Thu Jul 26 14:00:21 2001 --- src/os_amiga.h Wed Sep 17 22:15:14 2003 *************** *** 17,23 **** #define HAVE_AVAIL_MEM #ifndef HAVE_CONFIG_H ! # ifndef _DCC # define HAVE_STAT_H # endif # define HAVE_STDLIB_H --- 17,23 ---- #define HAVE_AVAIL_MEM #ifndef HAVE_CONFIG_H ! # ifdef AZTEC_C # define HAVE_STAT_H # endif # define HAVE_STDLIB_H *************** *** 44,49 **** --- 44,60 ---- #endif /* HAVE_CONFIG_H */ + #include + #include + #include + + /* Currently, all Amiga compilers except AZTEC C have these... */ + #ifndef AZTEC_C + # include + # include + # include + #endif + #define FNAME_ILLEGAL ";*?`#%" /* illegal characters in a file name */ /* *************** *** 55,60 **** --- 66,76 ---- #ifdef LATTICE # define USE_TMPNAM /* use tmpnam() instead of mktemp() */ + #endif + + #ifdef __GNUC__ + # include + # include #endif /* *** ../vim-6.2.114/src/vim.h Sun Oct 12 16:42:14 2003 --- src/vim.h Wed Sep 17 22:15:42 2003 *************** *** 128,134 **** #ifdef AMIGA /* Be conservative about sizeof(int). It could be 4 too. */ # ifndef FEAT_GUI_GTK /* avoid problems when generating prototypes */ ! # define SIZEOF_INT 2 # endif #endif #ifdef MACOS --- 130,140 ---- #ifdef AMIGA /* Be conservative about sizeof(int). It could be 4 too. */ # ifndef FEAT_GUI_GTK /* avoid problems when generating prototypes */ ! # ifdef __GNUC__ ! # define SIZEOF_INT 4 ! # else ! # define SIZEOF_INT 2 ! # endif # endif #endif #ifdef MACOS *** ../vim-6.2.114/src/version.c Sun Oct 12 17:14:12 2003 --- src/version.c Sun Oct 12 17:15:47 2003 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 115, /**/ -- Rule #1: Don't give somebody a tool that he's going to hurt himself with. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///