0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.2393: using old C style comments

Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
This commit is contained in:
Bram Moolenaar
2019-12-05 20:28:46 +01:00
parent 6e0ce171e1
commit 0f8737355d
9 changed files with 1532 additions and 1544 deletions

View File

@@ -17,13 +17,13 @@
#include "version.h"
#ifdef Window
# undef Window /* Amiga has its own Window definition */
# undef Window // Amiga has its own Window definition
#endif
#undef TRUE /* will be redefined by exec/types.h */
#undef TRUE // will be redefined by exec/types.h
#undef FALSE
/* cproto fails on missing include files, skip them */
// cproto fails on missing include files, skip them
#ifndef PROTO
#ifndef LATTICE
@@ -33,21 +33,19 @@
# include <intuition/intuition.h>
#endif
/* XXX These are included from os_amiga.h
#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/intuition.h>
*/
// XXX These are included from os_amiga.h
// #include <proto/exec.h>
// #include <proto/dos.h>
// #include <proto/intuition.h>
#include <exec/memory.h>
#include <libraries/dosextens.h>
#include <dos/dostags.h> /* for 2.0 functions */
#include <dos/dostags.h> // for 2.0 functions
#include <dos/dosasl.h>
/* From version 4 of AmigaOS, several system structures must be allocated
* and freed using system functions. "struct AnchorPath" is one.
*/
// From version 4 of AmigaOS, several system structures must be allocated
// and freed using system functions. "struct AnchorPath" is one.
#ifdef __amigaos4__
# include <dos/anchorpath.h>
# define free_fib(x) FreeDosObject(DOS_FIB, x)
@@ -59,7 +57,7 @@
# include <libraries/arp_pragmas.h>
#endif
#endif /* PROTO */
#endif // PROTO
/*
* Set stack size to 1 MiB on NG systems. This should be enough even for
@@ -92,9 +90,9 @@ static int sortcmp(const void *a, const void *b);
static BPTR raw_in = (BPTR)NULL;
static BPTR raw_out = (BPTR)NULL;
static int close_win = FALSE; /* set if Vim opened the window */
static int close_win = FALSE; // set if Vim opened the window
#ifndef __amigaos4__ /* Use autoopen for AmigaOS4 */
#ifndef __amigaos4__ // Use autoopen for AmigaOS4
struct IntuitionBase *IntuitionBase = NULL;
#endif
#ifdef FEAT_ARP
@@ -105,9 +103,9 @@ static struct Window *wb_window;
static char_u *oldwindowtitle = NULL;
#ifdef FEAT_ARP
int dos2 = FALSE; /* Amiga DOS 2.0x or higher */
int dos2 = FALSE; // Amiga DOS 2.0x or higher
#endif
int size_set = FALSE; /* set to TRUE if window size was set */
int size_set = FALSE; // set to TRUE if window size was set
#ifdef __GNUC__
static char version[] __attribute__((used)) =
@@ -151,7 +149,7 @@ mch_write(char_u *p, int len)
mch_inchar(
char_u *buf,
int maxlen,
long time, /* milli seconds */
long time, // milli seconds
int tb_change_cnt)
{
int len;
@@ -160,13 +158,13 @@ mch_inchar(
if (time >= 0)
{
if (time == 0)
utime = 100L; /* time = 0 causes problems in DOS 1.2 */
utime = 100L; // time = 0 causes problems in DOS 1.2
else
utime = time * 1000L; /* convert from milli to micro secs */
if (WaitForChar(raw_in, utime) == 0) /* no character available */
utime = time * 1000L; // convert from milli to micro secs
if (WaitForChar(raw_in, utime) == 0) // no character available
return 0;
}
else /* time == -1 */
else // time == -1
{
/*
* If there is no character available within 2 seconds (default)
@@ -186,12 +184,12 @@ mch_inchar(
}
}
for (;;) /* repeat until we got a character */
for (;;) // repeat until we got a character
{
len = Read(raw_in, (char *)buf, (long)maxlen / input_conv.vc_factor);
if (len > 0)
{
/* Convert from 'termencoding' to 'encoding'. */
// Convert from 'termencoding' to 'encoding'.
if (input_conv.vc_type != CONV_NONE)
len = convert_input(buf, len, maxlen);
return len;
@@ -228,14 +226,14 @@ mch_avail_mem(int special)
void
mch_delay(long msec, int ignoreinput)
{
#ifndef LATTICE /* SAS declares void Delay(ULONG) */
#ifndef LATTICE // SAS declares void Delay(ULONG)
void Delay(long);
#endif
if (msec > 0)
{
if (ignoreinput)
Delay(msec / 20L); /* Delay works with 20 msec intervals */
Delay(msec / 20L); // Delay works with 20 msec intervals
else
WaitForChar(raw_in, msec * 1000L);
}
@@ -260,7 +258,7 @@ mch_init(void)
static char intlibname[] = "intuition.library";
#ifdef AZTEC_C
Enable_Abort = 0; /* disallow vim to be aborted */
Enable_Abort = 0; // disallow vim to be aborted
#endif
Columns = 80;
Rows = 24;
@@ -313,7 +311,7 @@ mch_init(void)
* For the -f option (foreground mode) we open our own window and disable :sh.
* Otherwise the calling program would never know when editing is finished.
*/
#define BUF2SIZE 320 /* length of buffer for argument with complete path */
#define BUF2SIZE 320 // length of buffer for argument with complete path
int
mch_check_win(int argc, char **argv)
@@ -342,20 +340,20 @@ mch_check_win(int argc, char **argv)
#ifndef __amigaos4__
DosBase = OpenLibrary(DOS_LIBRARY, 37L);
if (DosBase != NULL)
/* if (((struct Library *)DOSBase)->lib_Version >= 37) */
// if (((struct Library *)DOSBase)->lib_Version >= 37)
{
CloseLibrary(DosBase);
# ifdef FEAT_ARP
dos2 = TRUE;
# endif
}
else /* without arp functions we NEED 2.0 */
else // without arp functions we NEED 2.0
{
# ifndef FEAT_ARP
mch_errmsg(_("Need Amigados version 2.04 or later\n"));
exit(3);
# else
/* need arp functions for dos 1.x */
// need arp functions for dos 1.x
if (!(ArpBase = (struct ArpBase *) OpenLibrary((UBYTE *)ArpName, ArpVersion)))
{
fprintf(stderr, _("Need %s version %ld\n"), ArpName, ArpVersion);
@@ -363,7 +361,7 @@ mch_check_win(int argc, char **argv)
}
# endif
}
#endif /* __amigaos4__ */
#endif // __amigaos4__
/*
* scan argv[] for the "-f" and "-d" arguments
@@ -380,7 +378,7 @@ mch_check_win(int argc, char **argv)
case 'd':
if (i < argc - 1
#ifdef FEAT_DIFF
/* require using "-dev", "-d" means diff mode */
// require using "-dev", "-d" means diff mode
&& argv[i][2] == 'e' && argv[i][3] == 'v'
#endif
)
@@ -419,7 +417,7 @@ mch_check_win(int argc, char **argv)
(long)MODE_NEWFILE)) != (BPTR)NULL)
break;
}
if (raw_in == (BPTR)NULL) /* all three failed */
if (raw_in == (BPTR)NULL) // all three failed
{
mch_errmsg(_(winerr));
goto exit;
@@ -458,7 +456,7 @@ mch_check_win(int argc, char **argv)
* Write the command into the file, put quotes around the arguments that
* have a space in them.
*/
if (argc == 0) /* run from workbench */
if (argc == 0) // run from workbench
ac = ((struct WBStartup *)argv)->sm_NumArgs;
else
ac = argc;
@@ -471,11 +469,11 @@ mch_check_win(int argc, char **argv)
if (argp->wa_Lock)
(void)lock2name(argp->wa_Lock, buf2, (long)(BUF2SIZE - 1));
#ifdef FEAT_ARP
if (dos2) /* use 2.0 function */
if (dos2) // use 2.0 function
#endif
AddPart((UBYTE *)buf2, (UBYTE *)argp->wa_Name, (long)(BUF2SIZE - 1));
#ifdef FEAT_ARP
else /* use arp function */
else // use arp function
TackOn((char *)buf2, argp->wa_Name);
#endif
av = (char *)buf2;
@@ -483,7 +481,7 @@ mch_check_win(int argc, char **argv)
else
av = argv[i];
/* skip '-d' or "-dev" option */
// skip '-d' or "-dev" option
if (av[0] == '-' && av[1] == 'd'
#ifdef FEAT_DIFF
&& av[2] == 'e' && av[3] == 'v'
@@ -530,13 +528,13 @@ mch_check_win(int argc, char **argv)
}
#endif
}
if (i == 3) /* all three failed */
if (i == 3) // all three failed
{
DeleteFile((UBYTE *)buf1);
mch_errmsg(_(winerr));
goto exit;
}
exitval = 0; /* The Execute succeeded: exit this program */
exitval = 0; // The Execute succeeded: exit this program
exit:
#ifdef FEAT_ARP
@@ -544,7 +542,7 @@ exit:
CloseLibrary((struct Library *) ArpBase);
#endif
exit(exitval);
/* NOTREACHED */
// NOTREACHED
return FAIL;
}
@@ -563,11 +561,11 @@ mch_input_isatty(void)
* This will cause the file name to remain exactly the same
* if the file system ignores, but preserves case.
*/
/*ARGSUSED*/
//ARGSUSED
void
fname_case(
char_u *name,
int len) /* buffer size, ignored here */
int len) // buffer size, ignored here
{
struct FileInfoBlock *fib;
size_t flen;
@@ -576,12 +574,12 @@ fname_case(
if (fib != NULL)
{
flen = STRLEN(name);
/* TODO: Check if this fix applies to AmigaOS < 4 too.*/
// TODO: Check if this fix applies to AmigaOS < 4 too.
#ifdef __amigaos4__
if (fib->fib_DirEntryType == ST_ROOT)
strcat(fib->fib_FileName, ":");
#endif
if (flen == strlen(fib->fib_FileName)) /* safety check */
if (flen == strlen(fib->fib_FileName)) // safety check
mch_memmove(name, fib->fib_FileName, flen);
free_fib(fib);
}
@@ -598,7 +596,7 @@ get_fib(char_u *fname)
BPTR flock;
struct FileInfoBlock *fib;
if (fname == NULL) /* safety check */
if (fname == NULL) // safety check
return NULL;
#ifdef __amigaos4__
fib = AllocDosObject(DOS_FIB,0);
@@ -610,7 +608,7 @@ get_fib(char_u *fname)
flock = Lock((UBYTE *)fname, (long)ACCESS_READ);
if (flock == (BPTR)NULL || !Examine(flock, fib))
{
free_fib(fib); /* in case of an error the memory is freed here */
free_fib(fib); // in case of an error the memory is freed here
fib = NULL;
}
if (flock)
@@ -703,9 +701,8 @@ mch_get_host_name(char_u *s, int len)
mch_get_pid(void)
{
#ifdef __amigaos4__
/* This is as close to a pid as we can come. We could use CLI numbers also,
* but then we would have two different types of process identifiers.
*/
// This is as close to a pid as we can come. We could use CLI numbers also,
// but then we would have two different types of process identifiers.
return((long)FindTask(0));
#else
return (long)0;
@@ -738,13 +735,13 @@ mch_FullName(
int retval = FAIL;
int i;
/* Lock the file. If it exists, we can get the exact name. */
// Lock the file. If it exists, we can get the exact name.
if ((l = Lock((UBYTE *)fname, (long)ACCESS_READ)) != (BPTR)0)
{
retval = lock2name(l, buf, (long)len - 1);
UnLock(l);
}
else if (force || !mch_isFullName(fname)) /* not a full path yet */
else if (force || !mch_isFullName(fname)) // not a full path yet
{
/*
* If the file cannot be locked (doesn't exist), try to lock the
@@ -757,8 +754,8 @@ mch_FullName(
if (retval == OK)
{
i = STRLEN(buf);
/* Concatenate the fname to the directory. Don't add a slash
* if fname is empty, but do change "" to "/". */
// Concatenate the fname to the directory. Don't add a slash
// if fname is empty, but do change "" to "/".
if (i == 0 || *fname != NUL)
{
if (i < len - 1 && (i == 0 || buf[i - 1] != ':'))
@@ -769,7 +766,7 @@ mch_FullName(
}
}
if (*buf == 0 || *buf == ':')
retval = FAIL; /* something failed; use the file name */
retval = FAIL; // something failed; use the file name
return retval;
}
@@ -792,11 +789,11 @@ mch_isFullName(char_u *fname)
lock2name(BPTR lock, char_u *buf, long len)
{
#ifdef FEAT_ARP
if (dos2) /* use 2.0 function */
if (dos2) // use 2.0 function
#endif
return ((int)NameFromLock(lock, (UBYTE *)buf, len) ? OK : FAIL);
#ifdef FEAT_ARP
else /* use arp function */
else // use arp function
return ((int)PathName(lock, (char *)buf, (long)(len/32)) ? OK : FAIL);
#endif
}
@@ -828,7 +825,7 @@ mch_getperm(char_u *name)
int
mch_setperm(char_u *name, long perm)
{
perm &= ~FIBF_ARCHIVE; /* reset archived bit */
perm &= ~FIBF_ARCHIVE; // reset archived bit
return (SetProtection((UBYTE *)name, (long)perm) ? OK : FAIL);
}
@@ -838,7 +835,7 @@ mch_setperm(char_u *name, long perm)
void
mch_hide(char_u *name)
{
/* can't hide a file */
// can't hide a file
}
/*
@@ -890,7 +887,7 @@ mch_mkdir(char_u *name)
int
mch_can_exe(char_u *name, char_u **path, int use_path)
{
/* TODO */
// TODO
return -1;
}
@@ -903,7 +900,7 @@ mch_can_exe(char_u *name, char_u **path, int use_path)
int
mch_nodetype(char_u *name)
{
/* TODO */
// TODO
return NODE_NORMAL;
}
@@ -920,7 +917,7 @@ mch_exit(int r)
{
exiting = TRUE;
if (raw_in) /* put terminal in 'normal' mode */
if (raw_in) // put terminal in 'normal' mode
{
settmode(TMODE_COOK);
stoptermcap();
@@ -930,18 +927,18 @@ mch_exit(int r)
{
if (term_console)
{
win_resize_off(); /* window resize events de-activated */
win_resize_off(); // window resize events de-activated
if (size_set)
OUT_STR("\233t\233u"); /* reset window size (CSI t CSI u) */
OUT_STR("\233t\233u"); // reset window size (CSI t CSI u)
}
out_flush();
}
#ifdef FEAT_TITLE
mch_restore_title(SAVE_RESTORE_BOTH); /* restore window title */
mch_restore_title(SAVE_RESTORE_BOTH); // restore window title
#endif
ml_close_all(TRUE); /* remove all memfiles */
ml_close_all(TRUE); // remove all memfiles
#ifdef FEAT_ARP
if (ArpBase)
@@ -950,7 +947,7 @@ mch_exit(int r)
if (close_win)
Close(raw_in);
if (r)
printf(_("Vim exiting with %d\n"), r); /* somehow this makes :cq work!? */
printf(_("Vim exiting with %d\n"), r); // somehow this makes :cq work!?
exit(r);
}
@@ -1027,10 +1024,10 @@ mch_get_shellsize(void)
#endif
struct InfoData *id=0;
if (!term_console) /* not an amiga window */
if (!term_console) // not an amiga window
goto out;
/* insure longword alignment */
// insure longword alignment
#ifdef __amigaos4__
if (!(id = AllocDosObject(DOS_INFODATA, 0)))
goto out;
@@ -1044,7 +1041,7 @@ mch_get_shellsize(void)
* is rarely needed, so we skip it now, unless we changed the size.
*/
if (size_set)
OUT_STR("\233t\233u"); /* CSI t CSI u */
OUT_STR("\233t\233u"); // CSI t CSI u
out_flush();
#ifdef __AROS__
@@ -1055,8 +1052,8 @@ mch_get_shellsize(void)
|| (wb_window = (struct Window *)id->id_VolumeNode) == NULL)
#endif
{
/* it's not an amiga window, maybe aux device */
/* terminal type should be set */
// it's not an amiga window, maybe aux device
// terminal type should be set
term_console = FALSE;
goto out;
}
@@ -1069,10 +1066,10 @@ mch_get_shellsize(void)
}
conUnit = (struct ConUnit *) ((struct IOStdReq *) id->id_InUse)->io_Unit;
/* get window size */
// get window size
Rows = conUnit->cu_YMax + 1;
Columns = conUnit->cu_XMax + 1;
if (Rows < 0 || Rows > 200) /* cannot be an amiga window */
if (Rows < 0 || Rows > 200) // cannot be an amiga window
{
Columns = 80;
Rows = 24;
@@ -1083,7 +1080,7 @@ mch_get_shellsize(void)
return OK;
out:
#ifdef __amigaos4__
FreeDosObject(DOS_INFODATA, id); /* Safe to pass NULL */
FreeDosObject(DOS_INFODATA, id); // Safe to pass NULL
#endif
return FAIL;
@@ -1114,7 +1111,7 @@ mch_set_shellsize(void)
void
mch_new_shellsize(void)
{
/* Nothing to do. */
// Nothing to do.
}
/*
@@ -1139,8 +1136,8 @@ out_num(long n)
*/
#ifndef PROTO
/* #include <proto/exec.h> */
/* #include <proto/dos.h> */
// #include <proto/exec.h>
// #include <proto/dos.h>
# include <exec/memory.h>
#endif
@@ -1152,9 +1149,9 @@ out_num(long n)
static long
dos_packet(
struct MsgPort *pid, /* process identifier ... (handlers message port) */
long action, /* packet type ... (what you want handler to do) */
long arg) /* single argument */
struct MsgPort *pid, // process identifier ... (handlers message port)
long action, // packet type ... (what you want handler to do)
long arg) // single argument
{
# ifdef FEAT_ARP
struct MsgPort *replyport;
@@ -1163,14 +1160,14 @@ dos_packet(
if (dos2)
# endif
return DoPkt(pid, action, arg, 0L, 0L, 0L, 0L); /* use 2.0 function */
return DoPkt(pid, action, arg, 0L, 0L, 0L, 0L); // use 2.0 function
# ifdef FEAT_ARP
replyport = (struct MsgPort *) CreatePort(NULL, 0); /* use arp function */
replyport = (struct MsgPort *) CreatePort(NULL, 0); // use arp function
if (!replyport)
return (0);
/* Allocate space for a packet, make it public and clear it */
// Allocate space for a packet, make it public and clear it
packet = (struct StandardPacket *)
AllocMem((long) sizeof(struct StandardPacket), MEMF_PUBLIC | MEMF_CLEAR);
if (!packet) {
@@ -1183,7 +1180,7 @@ dos_packet(
packet->sp_Pkt.dp_Type = action;
packet->sp_Pkt.dp_Arg1 = arg;
PutMsg(pid, (struct Message *)packet); /* send packet */
PutMsg(pid, (struct Message *)packet); // send packet
WaitPort(replyport);
GetMsg(replyport);
@@ -1196,7 +1193,7 @@ dos_packet(
return (res1);
# endif
}
#endif /* !defined(AZTEC_C) && !defined(__AROS__) */
#endif // !defined(AZTEC_C) && !defined(__AROS__)
/*
* Call shell.
@@ -1205,7 +1202,7 @@ dos_packet(
int
mch_call_shell(
char_u *cmd,
int options) /* SHELL_*, see vim.h */
int options) // SHELL_*, see vim.h
{
BPTR mydir;
int x;
@@ -1219,20 +1216,20 @@ mch_call_shell(
if (close_win)
{
/* if Vim opened a window: Executing a shell may cause crashes */
// if Vim opened a window: Executing a shell may cause crashes
emsg(_("E360: Cannot execute shell with -f option"));
return -1;
}
if (term_console)
win_resize_off(); /* window resize events de-activated */
win_resize_off(); // window resize events de-activated
out_flush();
if (options & SHELL_COOKED)
settmode(TMODE_COOK); /* set to normal mode */
mydir = Lock((UBYTE *)"", (long)ACCESS_READ); /* remember current dir */
settmode(TMODE_COOK); // set to normal mode
mydir = Lock((UBYTE *)"", (long)ACCESS_READ); // remember current dir
#if !defined(AZTEC_C) /* not tested very much */
#if !defined(AZTEC_C) // not tested very much
if (cmd == NULL)
{
# ifdef FEAT_ARP
@@ -1289,7 +1286,7 @@ mch_call_shell(
retval = x;
}
}
#else /* else part is for AZTEC_C */
#else // else part is for AZTEC_C
if (p_st >= 4 || (p_st >= 2 && !(options & SHELL_FILTER)))
use_execute = 1;
else
@@ -1300,11 +1297,11 @@ mch_call_shell(
* separate shell name from argument
*/
shellcmd = vim_strsave(p_sh);
if (shellcmd == NULL) /* out of memory, use Execute */
if (shellcmd == NULL) // out of memory, use Execute
use_execute = 1;
else
{
shellarg = skiptowhite(shellcmd); /* find start of arguments */
shellarg = skiptowhite(shellcmd); // find start of arguments
if (*shellarg != NUL)
{
*shellarg++ = NUL;
@@ -1392,17 +1389,17 @@ mch_call_shell(
}
}
vim_free(shellcmd);
#endif /* AZTEC_C */
#endif // AZTEC_C
if ((mydir = CurrentDir(mydir)) != 0) /* make sure we stay in the same directory */
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 */
settmode(TMODE_RAW); // set to raw mode
#ifdef FEAT_TITLE
resettitle();
#endif
if (term_console)
win_resize_on(); /* window resize events activated */
win_resize_on(); // window resize events activated
return retval;
}
@@ -1418,9 +1415,9 @@ mch_breakcheck(int force)
got_int = TRUE;
}
/* this routine causes manx to use this Chk_Abort() rather than its own */
/* otherwise it resets our ^C when doing any I/O (even when Enable_Abort */
/* is zero). Since we want to check for our own ^C's */
// this routine causes manx to use this Chk_Abort() rather than its own
// otherwise it resets our ^C when doing any I/O (even when Enable_Abort
// is zero). Since we want to check for our own ^C's
#ifdef _DCC
#define Chk_Abort chkabort
@@ -1464,7 +1461,7 @@ Chk_Abort(void)
mch_expandpath(
garray_T *gap,
char_u *pat,
int flags) /* EW_* flags */
int flags) // EW_* flags
{
struct AnchorPath *Anchor;
LONG Result;
@@ -1481,7 +1478,7 @@ mch_expandpath(
start_len = gap->ga_len;
/* Get our AnchorBase */
// Get our AnchorBase
#ifdef __amigaos4__
Anchor = AllocDosObject(DOS_ANCHORPATH, AnchorTags);
#else
@@ -1491,11 +1488,11 @@ mch_expandpath(
return 0;
#ifndef __amigaos4__
Anchor->ap_Strlen = ANCHOR_BUF_SIZE; /* ap_Length not supported anymore */
Anchor->ap_Strlen = ANCHOR_BUF_SIZE; // ap_Length not supported anymore
# ifdef APF_DODOT
Anchor->ap_Flags = APF_DODOT | APF_DOWILD; /* allow '.' for current dir */
Anchor->ap_Flags = APF_DODOT | APF_DOWILD; // allow '.' for current dir
# else
Anchor->ap_Flags = APF_DoDot | APF_DoWild; /* allow '.' for current dir */
Anchor->ap_Flags = APF_DoDot | APF_DoWild; // allow '.' for current dir
# endif
#endif
@@ -1503,7 +1500,7 @@ mch_expandpath(
if (dos2)
{
#endif
/* hack to replace '*' by '#?' */
// hack to replace '*' by '#?'
starbuf = alloc(2 * STRLEN(pat) + 1);
if (starbuf == NULL)
goto Return;
@@ -1561,7 +1558,7 @@ mch_expandpath(
qsort((void *)(((char_u **)gap->ga_data) + start_len),
(size_t)matches, sizeof(char_u *), sortcmp);
/* Free the wildcard stuff */
// Free the wildcard stuff
#ifdef FEAT_ARP
if (dos2)
#endif
@@ -1638,9 +1635,9 @@ mch_has_wildcard(char_u *p)
mch_getenv(char_u *var)
{
int len;
UBYTE *buf; /* buffer to expand in */
char_u *retval; /* return value */
static char_u *alloced = NULL; /* allocated memory */
UBYTE *buf; // buffer to expand in
char_u *retval; // return value
static char_u *alloced = NULL; // allocated memory
#ifdef FEAT_ARP
if (!dos2)
@@ -1665,7 +1662,7 @@ mch_getenv(char_u *var)
vim_free(buf);
}
/* if $VIM is not defined, use "vim:" instead */
// if $VIM is not defined, use "vim:" instead
if (retval == NULL && STRCMP(var, "VIM") == 0)
retval = (char_u *)"vim:";
@@ -1675,7 +1672,7 @@ mch_getenv(char_u *var)
/*
* Amiga version of setenv() with AmigaDOS 2.0 support.
*/
/* ARGSUSED */
// ARGSUSED
int
mch_setenv(char *var, char *value, int x)
{
@@ -1685,6 +1682,6 @@ mch_setenv(char *var, char *value, int x)
#endif
if (SetVar((UBYTE *)var, (UBYTE *)value, (LONG)-1, (ULONG)GVF_LOCAL_ONLY))
return 0; /* success */
return -1; /* failure */
return 0; // success
return -1; // failure
}

View File

@@ -21,7 +21,7 @@
#if USE_THREAD_FOR_INPUT_WITH_TIMEOUT
#ifdef PROTO /* making prototypes on Unix */
#ifdef PROTO // making prototypes on Unix
#define sem_id int
#define thread_id int
#endif
@@ -32,7 +32,7 @@ sem_id character_present;
sem_id character_wanted;
thread_id read_thread_id;
#define TRY_ABORT 0 /* This code does not work so turn it off. */
#define TRY_ABORT 0 // This code does not work so turn it off.
#if TRY_ABORT
static void
@@ -89,7 +89,7 @@ beos_select(int nbits,
bigtime_t tmo;
if (nbits == 0) {
/* select is purely being used for delay */
// select is purely being used for delay
snooze(timeout->tv_sec * 1e6 + timeout->tv_usec);
return 0;
}
@@ -140,10 +140,10 @@ beos_select(int nbits,
resume_thread(read_thread_id);
}
/* timeout == NULL means "indefinitely" */
// timeout == NULL means "indefinitely"
if (timeout) {
tmo = timeout->tv_sec * 1e6 + timeout->tv_usec;
/* 0 means "don't wait, which is impossible to do exactly. */
// 0 means "don't wait, which is impossible to do exactly.
if (tmo == 0)
tmo = 1.0;
}

View File

@@ -25,7 +25,7 @@
#if defined(MACOS_CONVERT) || defined(PROTO)
# ifdef PROTO
/* A few dummy types to be able to generate function prototypes. */
// A few dummy types to be able to generate function prototypes.
typedef int UniChar;
typedef int *TECObjectRef;
typedef int CFStringRef;
@@ -34,9 +34,9 @@ typedef int CFStringRef;
static char_u *mac_utf16_to_utf8(UniChar *from, size_t fromLen, size_t *actualLen);
static UniChar *mac_utf8_to_utf16(char_u *from, size_t fromLen, size_t *actualLen);
/* Converter for composing decomposed HFS+ file paths */
// Converter for composing decomposed HFS+ file paths
static TECObjectRef gPathConverter;
/* Converter used by mac_utf16_to_utf8 */
// Converter used by mac_utf16_to_utf8
static TECObjectRef gUTF16ToUTF8Converter;
/*
@@ -79,9 +79,9 @@ mac_string_convert(
if (cfstr == NULL)
fprintf(stderr, "Encoding failed\n");
/* When conversion failed, try excluding bytes from the end, helps when
* there is an incomplete byte sequence. Only do up to 6 bytes to avoid
* looping a long time when there really is something unconvertible. */
// When conversion failed, try excluding bytes from the end, helps when
// there is an incomplete byte sequence. Only do up to 6 bytes to avoid
// looping a long time when there really is something unconvertible.
while (cfstr == NULL && unconvlenp != NULL && len > 1 && *unconvlenp < 6)
{
--len;
@@ -104,7 +104,7 @@ mac_string_convert(
#if 0
CFRange convertRange = CFRangeMake(0, CFStringGetLength(cfstr));
/* Determine output buffer size */
// Determine output buffer size
CFStringGetBytes(cfstr, convertRange, to, NULL, FALSE, NULL, 0, (CFIndex *)&buflen);
retval = (buflen > 0) ? alloc(buflen) : NULL;
if (retval == NULL) {
@@ -127,8 +127,8 @@ mac_string_convert(
}
fprintf(stderr, "Trying char-by-char conversion...\n");
/* conversion failed for the whole string, but maybe it will work
* for each character */
// conversion failed for the whole string, but maybe it will work
// for each character
for (d = retval, in = 0, out = 0; in < len && out < buflen - 1;)
{
if (from == kCFStringEncodingUTF8)
@@ -188,8 +188,8 @@ macroman2enc(
CFRange r;
CFIndex len = *sizep;
/* MacRoman is an 8-bit encoding, no need to move bytes to
* conv_rest[]. */
// MacRoman is an 8-bit encoding, no need to move bytes to
// conv_rest[].
cfstr = CFStringCreateWithBytes(NULL, ptr, len,
kCFStringEncodingMacRoman, 0);
/*
@@ -203,8 +203,8 @@ macroman2enc(
r.length = CFStringGetLength(cfstr);
if (r.length != CFStringGetBytes(cfstr, r,
(enc_utf8) ? kCFStringEncodingUTF8 : kCFStringEncodingISOLatin1,
0, /* no lossy conversion */
0, /* not external representation */
0, // no lossy conversion
0, // not external representation
ptr + *sizep, real_size - *sizep, &len))
{
CFRelease(cfstr);
@@ -256,9 +256,9 @@ enc2macroman(
r.length = CFStringGetLength(cfstr);
if (r.length != CFStringGetBytes(cfstr, r,
kCFStringEncodingMacRoman,
0, /* no lossy conversion */
0, /* not external representation (since vim
* handles this internally */
0, // no lossy conversion
0, // not external representation (since vim
// handles this internally
to, maxtolen, &l))
{
CFRelease(cfstr);
@@ -296,8 +296,8 @@ mac_conv_init(void)
if (TECCreateConverter(&gUTF16ToUTF8Converter, utf16_encoding,
utf8_canon_encoding) != noErr)
{
/* On pre-10.3, Unicode normalization is not available so
* fall back to non-normalizing converter */
// On pre-10.3, Unicode normalization is not available so
// fall back to non-normalizing converter
if (TECCreateConverter(&gUTF16ToUTF8Converter, utf16_encoding,
utf8_encoding) != noErr)
gUTF16ToUTF8Converter = NULL;
@@ -334,30 +334,30 @@ mac_utf16_to_enc(
size_t fromLen,
size_t *actualLen)
{
/* Following code borrows somewhat from os_mswin.c */
// Following code borrows somewhat from os_mswin.c
vimconv_T conv;
size_t utf8_len;
char_u *utf8_str;
char_u *result = NULL;
/* Convert to utf-8 first, works better with iconv */
// Convert to utf-8 first, works better with iconv
utf8_len = 0;
utf8_str = mac_utf16_to_utf8(from, fromLen, &utf8_len);
if (utf8_str)
{
/* We might be called before we have p_enc set up. */
// We might be called before we have p_enc set up.
conv.vc_type = CONV_NONE;
/* If encoding (p_enc) is any unicode, it is actually in utf-8 (vim
* internal unicode is always utf-8) so don't convert in such cases */
// If encoding (p_enc) is any unicode, it is actually in utf-8 (vim
// internal unicode is always utf-8) so don't convert in such cases
if ((enc_canon_props(p_enc) & ENC_UNICODE) == 0)
convert_setup(&conv, (char_u *)"utf-8",
p_enc? p_enc: (char_u *)"macroman");
if (conv.vc_type == CONV_NONE)
{
/* p_enc is utf-8, so we're done. */
// p_enc is utf-8, so we're done.
result = utf8_str;
}
else
@@ -388,7 +388,7 @@ mac_enc_to_utf16(
size_t fromLen,
size_t *actualLen)
{
/* Following code borrows somewhat from os_mswin.c */
// Following code borrows somewhat from os_mswin.c
vimconv_T conv;
size_t utf8_len;
char_u *utf8_str;
@@ -397,9 +397,9 @@ mac_enc_to_utf16(
do
{
/* Use MacRoman by default, we might be called before we have p_enc
* set up. Convert to utf-8 first, works better with iconv(). Does
* nothing if 'encoding' is "utf-8". */
// Use MacRoman by default, we might be called before we have p_enc
// set up. Convert to utf-8 first, works better with iconv(). Does
// nothing if 'encoding' is "utf-8".
conv.vc_type = CONV_NONE;
if ((enc_canon_props(p_enc) & ENC_UNICODE) == 0 &&
convert_setup(&conv, p_enc ? p_enc : (char_u *)"macroman",
@@ -583,4 +583,4 @@ mac_lang_init(void)
}
}
}
#endif /* MACOS_CONVERT */
#endif // MACOS_CONVERT

File diff suppressed because it is too large Load Diff

View File

@@ -36,17 +36,17 @@ void qnx_init(void)
#define CLIP_TYPE_VIM "VIMTYPE"
#define CLIP_TYPE_TEXT "TEXT"
/* Turn on the clipboard for a console vim when photon is running */
// Turn on the clipboard for a console vim when photon is running
void qnx_clip_init(void)
{
if (is_photon_available == TRUE && !gui.in_use)
clip_init(TRUE);
}
/*****************************************************************************/
/* Clipboard */
/////////////////////////////////////////////////////////////////////////////
// Clipboard
/* No support for owning the clipboard */
// No support for owning the clipboard
int
clip_mch_own_selection(Clipboard_T *cbd)
{
@@ -69,13 +69,13 @@ clip_mch_request_selection(Clipboard_T *cbd)
cbdata = PhClipboardPasteStart(PhInputGroup(NULL));
if (cbdata != NULL)
{
/* Look for the vim specific clip first */
// Look for the vim specific clip first
clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_VIM);
if (clip_header != NULL && clip_header->data != NULL)
{
switch(*(char *) clip_header->data)
{
default: /* fallthrough to line type */
default: // fallthrough to line type
case 'L': type = MLINE; break;
case 'C': type = MCHAR; break;
case 'B': type = MBLOCK; break;
@@ -83,7 +83,7 @@ clip_mch_request_selection(Clipboard_T *cbd)
is_type_set = TRUE;
}
/* Try for just normal text */
// Try for just normal text
clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_TEXT);
if (clip_header != NULL)
{
@@ -109,7 +109,7 @@ clip_mch_set_selection(Clipboard_T *cbd)
char_u *text_clip, vim_clip[2], *str = NULL;
PhClipHeader clip_header[2];
/* Prevent recursion from clip_get_selection() */
// Prevent recursion from clip_get_selection()
if (cbd->owned == TRUE)
return;
@@ -136,7 +136,7 @@ clip_mch_set_selection(Clipboard_T *cbd)
switch(type)
{
default: /* fallthrough to MLINE */
default: // fallthrough to MLINE
case MLINE: *vim_clip = 'L'; break;
case MCHAR: *vim_clip = 'C'; break;
case MBLOCK: *vim_clip = 'B'; break;

File diff suppressed because it is too large Load Diff

View File

@@ -11,19 +11,19 @@
#include "vim.h"
/* define _generic_64 for use in time functions */
// define _generic_64 for use in time functions
#if !defined(VAX) && !defined(PROTO)
# include <gen64def.h>
#else
/* based on Alpha's gen64def.h; the file is absent on VAX */
// based on Alpha's gen64def.h; the file is absent on VAX
typedef struct _generic_64 {
# pragma __nomember_alignment
__union { /* You can treat me as... */
/* long long is not available on VAXen */
/* unsigned __int64 gen64$q_quadword; ...a single 64-bit value, or */
__union { // You can treat me as...
// long long is not available on VAXen
// unsigned __int64 gen64$q_quadword; ...a single 64-bit value, or
unsigned int gen64$l_longword [2]; /* ...two 32-bit values, or */
unsigned short int gen64$w_word [4]; /* ...four 16-bit values */
unsigned int gen64$l_longword [2]; // ...two 32-bit values, or
unsigned short int gen64$w_word [4]; // ...four 16-bit values
} gen64$r_quad_overlay;
} GENERIC_64;
#endif
@@ -67,13 +67,13 @@ typedef struct
} ITMLST2;
static TT_MODE orgmode;
static short iochan; /* TTY I/O channel */
static short iosb[4]; /* IO status block */
static short iochan; // TTY I/O channel
static short iosb[4]; // IO status block
static int vms_match_num = 0;
static int vms_match_free = 0;
static char_u **vms_fmatch = NULL;
static char *Fspec_Rms; /* rms file spec, passed implicitly between routines */
static char *Fspec_Rms; // rms file spec, passed implicitly between routines
@@ -139,7 +139,7 @@ mch_settmode(int tmode)
set_tty(int row, int col)
{
int status;
TT_MODE newmode; /* New TTY mode bits */
TT_MODE newmode; // New TTY mode bits
static short first_time = TRUE;
if (first_time)
@@ -165,7 +165,7 @@ set_tty(int row, int col)
get_tty(void)
{
static $DESCRIPTOR(odsc,"SYS$OUTPUT"); /* output descriptor */
static $DESCRIPTOR(odsc,"SYS$OUTPUT"); // output descriptor
int status;
TT_MODE tt_mode;
@@ -195,7 +195,7 @@ mch_get_shellsize(void)
{
TT_MODE tmode;
tmode = get_tty(); /* get size from VMS */
tmode = get_tty(); // get size from VMS
Columns = tmode.width;
Rows = tmode.x.y.length;
return OK;
@@ -262,7 +262,7 @@ mch_setenv(char *var, char *value, int x)
{
int res, dum;
long attrib = 0L;
char acmode = PSL$C_SUPER; /* needs SYSNAM privilege */
char acmode = PSL$C_SUPER; // needs SYSNAM privilege
DESC tabnam, lognam;
ITMLST1 itmlst;
@@ -288,9 +288,9 @@ vms_sys(char *cmd, char *out, char *inp)
if (inp)
vul_desc(&idsc, inp);
lib$spawn(cmd ? &cdsc : NULL, /* command string */
inp ? &idsc : NULL, /* input file */
out ? &odsc : NULL, /* output file */
lib$spawn(cmd ? &cdsc : NULL, // command string
inp ? &idsc : NULL, // input file
out ? &odsc : NULL, // output file
0, 0, 0, &status, 0, 0, 0, 0, 0, 0);
return status;
}
@@ -314,7 +314,7 @@ vms_tolower( char *name )
vms_sys_status(int status)
{
if (status != SS$_NORMAL && (status & STS$M_SUCCESS) == 0)
return status; /* Command failed. */
return status; // Command failed.
return 0;
}
@@ -329,35 +329,35 @@ vms_read(char *inbuf, size_t nbytes)
{
int status, function, len;
TT_MODE tt_mode;
ITEM itmlst[2]; /* terminates on everything */
ITEM itmlst[2]; // terminates on everything
static long trm_mask[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
/* whatever happened earlier we need an iochan here */
// whatever happened earlier we need an iochan here
if (!iochan)
tt_mode = get_tty();
/* important: clean the inbuf */
// important: clean the inbuf
memset(inbuf, 0, nbytes);
/* set up the itemlist for the first read */
// set up the itemlist for the first read
vul_item(&itmlst[0], 0, TRM$_MODIFIERS,
(char *)( TRM$M_TM_NOECHO | TRM$M_TM_NOEDIT |
TRM$M_TM_NOFILTR | TRM$M_TM_TRMNOECHO |
TRM$M_TM_NORECALL) , 0);
vul_item(&itmlst[1], sizeof(trm_mask), TRM$_TERM, (char *)&trm_mask, 0);
/* wait forever for a char */
// wait forever for a char
function = (IO$_READLBLK | IO$M_EXTEND);
status = sys$qiow(0, iochan, function, &iosb, 0, 0,
inbuf, nbytes-1, 0, 0, &itmlst, sizeof(itmlst));
len = strlen(inbuf); /* how many chars we got? */
len = strlen(inbuf); // how many chars we got?
/* read immediately the rest in the IO queue */
// read immediately the rest in the IO queue
function = (IO$_READLBLK | IO$M_TIMED | IO$M_ESCAPE | IO$M_NOECHO | IO$M_NOFILTR);
status = sys$qiow(0, iochan, function, &iosb, 0, 0,
inbuf+len, nbytes-1-len, 0, 0, 0, 0);
len = strlen(inbuf); /* return the total length */
len = strlen(inbuf); // return the total length
return len;
}
@@ -375,12 +375,12 @@ vms_wproc(char *name, int val)
int i;
static int vms_match_alloced = 0;
if (val == DECC$K_FOREIGN ) /* foreign non VMS files are not counting */
if (val == DECC$K_FOREIGN ) // foreign non VMS files are not counting
return 1;
/* accept all DECC$K_FILE and DECC$K_DIRECTORY */
// accept all DECC$K_FILE and DECC$K_DIRECTORY
if (vms_match_num == 0) {
/* first time through, setup some things */
// first time through, setup some things
if (NULL == vms_fmatch) {
vms_fmatch = ALLOC_MULT(char_u *, EXPL_ALLOC_INC);
if (!vms_fmatch)
@@ -389,16 +389,16 @@ vms_wproc(char *name, int val)
vms_match_free = EXPL_ALLOC_INC;
}
else {
/* re-use existing space */
// re-use existing space
vms_match_free = vms_match_alloced;
}
}
/* make matches look uniform */
// make matches look uniform
vms_remove_version(name);
name=vms_tolower(name);
/* if name already exists, don't add it */
// if name already exists, don't add it
for (i = 0; i<vms_match_num; i++) {
if (0 == STRCMP((char_u *)name,vms_fmatch[i]))
return 1;
@@ -406,7 +406,7 @@ vms_wproc(char *name, int val)
if (--vms_match_free == 0) {
char_u **old_vms_fmatch = vms_fmatch;
/* add more space to store matches */
// add more space to store matches
vms_match_alloced += EXPL_ALLOC_INC;
vms_fmatch = vim_realloc(old_vms_fmatch,
sizeof(char **) * vms_match_alloced);
@@ -445,7 +445,7 @@ mch_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file, i
int dir;
int files_alloced, files_free;
*num_file = 0; /* default: no files found */
*num_file = 0; // default: no files found
files_alloced = EXPL_ALLOC_INC;
files_free = EXPL_ALLOC_INC;
*file = ALLOC_MULT(char_u *, files_alloced);
@@ -456,13 +456,13 @@ mch_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file, i
}
for (i = 0; i < num_pat; i++)
{
/* expand environment var or home dir */
// expand environment var or home dir
if (vim_strchr(pat[i],'$') || vim_strchr(pat[i],'~'))
expand_env(pat[i],buf,MAXPATHL);
else
STRCPY(buf,pat[i]);
vms_match_num = 0; /* reset collection counter */
vms_match_num = 0; // reset collection counter
result = decc$translate_vms(vms_fixfilename(buf));
if ( (int) result == 0 || (int) result == -1 ) {
cnt = 0;
@@ -477,21 +477,21 @@ mch_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file, i
for (i = 0; i < cnt; i++)
{
/* files should exist if expanding interactively */
// files should exist if expanding interactively
if (!(flags & EW_NOTFOUND) && mch_getperm(vms_fmatch[i]) < 0)
continue;
/* do not include directories */
// do not include directories
dir = (mch_isdir(vms_fmatch[i]));
if (( dir && !(flags & EW_DIR)) || (!dir && !(flags & EW_FILE)))
continue;
/* Skip files that are not executable if we check for that. */
// Skip files that are not executable if we check for that.
if (!dir && (flags & EW_EXEC)
&& !mch_can_exe(vms_fmatch[i], NULL, !(flags & EW_SHELLCMD)))
continue;
/* allocate memory for pointers */
// allocate memory for pointers
if (--files_free < 1)
{
char_u **old_file = *file;
@@ -521,8 +521,8 @@ mch_expandpath(garray_T *gap, char_u *path, int flags)
char *result;
vms_match_num = 0;
/* the result from the decc$translate_vms needs to be handled */
/* otherwise it might create ACCVIO error in decc$to_vms */
// the result from the decc$translate_vms needs to be handled
// otherwise it might create ACCVIO error in decc$to_vms
result = decc$translate_vms(vms_fixfilename(path));
if ( (int) result == 0 || (int) result == -1 ) {
cnt = 0;
@@ -533,7 +533,7 @@ mch_expandpath(garray_T *gap, char_u *path, int flags)
cnt = vms_match_num;
for (i = 0; i < cnt; i++)
{
if (mch_getperm(vms_fmatch[i]) >= 0) /* add existing file */
if (mch_getperm(vms_fmatch[i]) >= 0) // add existing file
addfile(gap, vms_fmatch[i], flags);
}
return cnt;
@@ -551,10 +551,9 @@ vms_unix_mixed_filespec(char *in, char *out)
int len;
char *out_str=out;
/* copy vms filename portion up to last colon
* (node and/or disk)
*/
lastcolon = strrchr(in, ':'); /* find last colon */
// copy vms filename portion up to last colon
// (node and/or disk)
lastcolon = strrchr(in, ':'); // find last colon
if (lastcolon != NULL) {
len = lastcolon - in + 1;
strncpy(out, in, len);
@@ -562,49 +561,49 @@ vms_unix_mixed_filespec(char *in, char *out)
in += len;
}
end_of_dir = NULL; /* default: no directory */
end_of_dir = NULL; // default: no directory
/* start of directory portion */
// start of directory portion
ch = *in;
if ((ch == '[') || (ch == '/') || (ch == '<')) { /* start of directory(s) ? */
if ((ch == '[') || (ch == '/') || (ch == '<')) { // start of directory(s) ?
ch = '[';
SKIP_FOLLOWING_SLASHES(in);
} else if (EQN(in, "../", 3)) { /* Unix parent directory? */
} else if (EQN(in, "../", 3)) { // Unix parent directory?
*out++ = '[';
*out++ = '-';
end_of_dir = out;
ch = '.';
in += 2;
SKIP_FOLLOWING_SLASHES(in);
} else { /* not a special character */
while (EQN(in, "./", 2)) { /* Ignore Unix "current dir" */
} else { // not a special character
while (EQN(in, "./", 2)) { // Ignore Unix "current dir"
in += 2;
SKIP_FOLLOWING_SLASHES(in);
}
if (strchr(in, '/') == NULL) { /* any more Unix directories ? */
strcpy(out, in); /* No - get rest of the spec */
if (strchr(in, '/') == NULL) { // any more Unix directories ?
strcpy(out, in); // No - get rest of the spec
return;
} else {
*out++ = '['; /* Yes, denote a Vms subdirectory */
*out++ = '['; // Yes, denote a Vms subdirectory
ch = '.';
--in;
}
}
/* if we get here, there is a directory part of the filename */
// if we get here, there is a directory part of the filename
/* initialize output file spec */
// initialize output file spec
*out++ = ch;
++in;
while (*in != '\0') {
ch = *in;
if ((ch == ']') || (ch == '/') || (ch == '>') ) { /* end of (sub)directory ? */
if ((ch == ']') || (ch == '/') || (ch == '>') ) { // end of (sub)directory ?
end_of_dir = out;
ch = '.';
SKIP_FOLLOWING_SLASHES(in);
}
else if (EQN(in, "../", 3)) { /* Unix parent directory? */
else if (EQN(in, "../", 3)) { // Unix parent directory?
*out++ = '-';
end_of_dir = out;
ch = '.';
@@ -612,7 +611,7 @@ vms_unix_mixed_filespec(char *in, char *out)
SKIP_FOLLOWING_SLASHES(in);
}
else {
while (EQN(in, "./", 2)) { /* Ignore Unix "current dir" */
while (EQN(in, "./", 2)) { // Ignore Unix "current dir"
end_of_dir = out;
in += 2;
SKIP_FOLLOWING_SLASHES(in);
@@ -620,14 +619,14 @@ vms_unix_mixed_filespec(char *in, char *out)
}
}
/* Place next character into output file spec */
// Place next character into output file spec
*out++ = ch;
++in;
}
*out = '\0'; /* Terminate output file spec */
*out = '\0'; // Terminate output file spec
if (end_of_dir != NULL) /* Terminate directory portion */
if (end_of_dir != NULL) // Terminate directory portion
*end_of_dir = ']';
}
@@ -651,7 +650,7 @@ vms_fixfilename(void *instring)
static size_t buflen = 0;
size_t len;
/* get a big-enough buffer */
// get a big-enough buffer
len = strlen(instring) + 1;
if (len > buflen)
{
@@ -665,22 +664,22 @@ vms_fixfilename(void *instring)
strcpy(tmpbuf, instring);
#endif
Fspec_Rms = buf; /* for decc$to_vms */
Fspec_Rms = buf; // for decc$to_vms
if (strchr(instring,'/') == NULL)
/* It is already a VMS file spec */
// It is already a VMS file spec
strcpy(buf, instring);
else if (strchr(instring,'"') == NULL) /* password in the path? */
else if (strchr(instring,'"') == NULL) // password in the path?
{
/* Seems it is a regular file, let guess that it is pure Unix fspec */
// Seems it is a regular file, let guess that it is pure Unix fspec
if (decc$to_vms(instring, vms_fspec_proc, 0, 0) <= 0)
/* No... it must be mixed */
// No... it must be mixed
vms_unix_mixed_filespec(instring, buf);
}
else
/* we have a password in the path */
/* decc$ functions can not handle */
/* this is our only hope to resolv */
// we have a password in the path
// decc$ functions can not handle
// this is our only hope to resolv
vms_unix_mixed_filespec(instring, buf);
return buf;
@@ -697,7 +696,7 @@ vms_remove_version(void * fname)
char_u *cp;
char_u *fp;
if ((cp = vim_strchr( fname, ';')) != NULL) /* remove version */
if ((cp = vim_strchr( fname, ';')) != NULL) // remove version
*cp = '\0';
else if ((cp = vim_strrchr( fname, '.')) != NULL )
{
@@ -726,7 +725,7 @@ struct typeahead_st {
*/
int
RealWaitForChar(
int fd UNUSED, /* always read from iochan */
int fd UNUSED, // always read from iochan
long msec,
int *check_for_gpm UNUSED,
int *interrupted)
@@ -738,71 +737,71 @@ RealWaitForChar(
unsigned int convert_operation = LIB$K_DELTA_SECONDS_F;
float sec =(float) msec/1000;
/* make sure the iochan is set */
// make sure the iochan is set
if (!iochan)
get_tty();
if (sec > 0) {
/* time-out specified; convert it to absolute time */
/* sec>0 requirement of lib$cvtf_to_internal_time()*/
// time-out specified; convert it to absolute time
// sec>0 requirement of lib$cvtf_to_internal_time()
/* get current time (number of 100ns ticks since the VMS Epoch) */
// get current time (number of 100ns ticks since the VMS Epoch)
status = sys$gettim(&time_curr);
if (status != SS$_NORMAL)
return 0; /* error */
/* construct the delta time */
return 0; // error
// construct the delta time
#if __G_FLOAT==0
# ifndef VAX
/* IEEE is default on IA64, but can be used on Alpha too - but not on VAX */
// IEEE is default on IA64, but can be used on Alpha too - but not on VAX
status = lib$cvts_to_internal_time(
&convert_operation, &sec, &time_diff);
# endif
#else /* default on Alpha and VAX */
#else // default on Alpha and VAX
status = lib$cvtf_to_internal_time(
&convert_operation, &sec, &time_diff);
#endif
if (status != LIB$_NORMAL)
return 0; /* error */
/* add them up */
return 0; // error
// add them up
status = lib$add_times(
&time_curr,
&time_diff,
&time_out);
if (status != LIB$_NORMAL)
return 0; /* error */
return 0; // error
}
while (TRUE) {
/* select() */
// select()
status = sys$qiow(0, iochan, IO$_SENSEMODE | IO$M_TYPEAHDCNT, iosb,
0, 0, &typeahead, 8, 0, 0, 0, 0);
if (status != SS$_NORMAL || (iosb[0] & 0xFFFF) != SS$_NORMAL)
return 0; /* error */
return 0; // error
if (typeahead.numchars)
return 1; /* ready to read */
return 1; // ready to read
/* there's nothing to read; what now? */
// there's nothing to read; what now?
if (msec == 0) {
/* immediate time-out; return impatiently */
// immediate time-out; return impatiently
return 0;
} else if (msec < 0) {
/* no time-out; wait on indefinitely */
return 1; /* fakeout to force a wait in vms_read() */
// no time-out; wait on indefinitely
return 1; // fakeout to force a wait in vms_read()
} else {
/* time-out needs to be checked */
// time-out needs to be checked
status = sys$gettim(&time_curr);
if (status != SS$_NORMAL)
return 0; /* error */
return 0; // error
status = lib$sub_times(
&time_out,
&time_curr,
&time_diff);
if (status != LIB$_NORMAL)
return 0; /* error, incl. time_diff < 0 (i.e. time-out) */
return 0; // error, incl. time_diff < 0 (i.e. time-out)
/* otherwise wait some more */
// otherwise wait some more
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2393,
/**/
2392,
/**/