remove C++-style comments

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@864 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Michael Gernoth 2005-03-15 11:25:50 +00:00
parent fe3011d666
commit 4cca15390d
9 changed files with 102 additions and 102 deletions

92
disk.c
View File

@ -260,7 +260,7 @@ disk_enum_devices(uint32 * id, char *optarg)
char *pos2;
int count = 0;
// skip the first colon
/* skip the first colon */
optarg++;
while ((pos = next_arg(optarg, ',')) && *id < RDPDR_MAX_DEVICES)
{
@ -306,38 +306,38 @@ disk_create(uint32 device_id, uint32 accessmask, uint32 sharemode, uint32 create
{
case CREATE_ALWAYS:
// Delete existing file/link.
/* Delete existing file/link. */
unlink(path);
flags |= O_CREAT;
break;
case CREATE_NEW:
// If the file already exists, then fail.
/* If the file already exists, then fail. */
flags |= O_CREAT | O_EXCL;
break;
case OPEN_ALWAYS:
// Create if not already exists.
/* Create if not already exists. */
flags |= O_CREAT;
break;
case OPEN_EXISTING:
// Default behaviour
/* Default behaviour */
break;
case TRUNCATE_EXISTING:
// If the file does not exist, then fail.
/* If the file does not exist, then fail. */
flags |= O_TRUNC;
break;
}
//printf("Open: \"%s\" flags: %X, accessmask: %X sharemode: %X create disp: %X\n", path, flags_and_attributes, accessmask, sharemode, create_disposition);
/*printf("Open: \"%s\" flags: %X, accessmask: %X sharemode: %X create disp: %X\n", path, flags_and_attributes, accessmask, sharemode, create_disposition);*/
// Get information about file and set that flag ourselfs
/* Get information about file and set that flag ourselfs */
if ((stat(path, &filestat) == 0) && (S_ISDIR(filestat.st_mode)))
{
if (flags_and_attributes & FILE_NON_DIRECTORY_FILE)
@ -568,7 +568,7 @@ disk_query_information(NTHANDLE handle, uint32 info_class, STREAM out)
path = g_fileinfo[handle].path;
// Get information about file
/* Get information about file */
if (fstat(handle, &filestat) != 0)
{
perror("stat");
@ -576,7 +576,7 @@ disk_query_information(NTHANDLE handle, uint32 info_class, STREAM out)
return STATUS_ACCESS_DENIED;
}
// Set file attributes
/* Set file attributes */
file_attributes = 0;
if (S_ISDIR(filestat.st_mode))
file_attributes |= FILE_ATTRIBUTE_DIRECTORY;
@ -591,25 +591,25 @@ disk_query_information(NTHANDLE handle, uint32 info_class, STREAM out)
if (!(filestat.st_mode & S_IWUSR))
file_attributes |= FILE_ATTRIBUTE_READONLY;
// Return requested data
/* Return requested data */
switch (info_class)
{
case FileBasicInformation:
seconds_since_1970_to_filetime(get_create_time(&filestat), &ft_high,
&ft_low);
out_uint32_le(out, ft_low); //create_access_time
out_uint32_le(out, ft_low); /* create_access_time */
out_uint32_le(out, ft_high);
seconds_since_1970_to_filetime(filestat.st_atime, &ft_high, &ft_low);
out_uint32_le(out, ft_low); //last_access_time
out_uint32_le(out, ft_low); /* last_access_time */
out_uint32_le(out, ft_high);
seconds_since_1970_to_filetime(filestat.st_mtime, &ft_high, &ft_low);
out_uint32_le(out, ft_low); //last_write_time
out_uint32_le(out, ft_low); /* last_write_time */
out_uint32_le(out, ft_high);
seconds_since_1970_to_filetime(filestat.st_ctime, &ft_high, &ft_low);
out_uint32_le(out, ft_low); //last_change_time
out_uint32_le(out, ft_low); /* last_change_time */
out_uint32_le(out, ft_high);
out_uint32_le(out, file_attributes);
@ -617,13 +617,13 @@ disk_query_information(NTHANDLE handle, uint32 info_class, STREAM out)
case FileStandardInformation:
out_uint32_le(out, filestat.st_size); //Allocation size
out_uint32_le(out, filestat.st_size); /* Allocation size */
out_uint32_le(out, 0);
out_uint32_le(out, filestat.st_size); //End of file
out_uint32_le(out, filestat.st_size); /* End of file */
out_uint32_le(out, 0);
out_uint32_le(out, filestat.st_nlink); //Number of links
out_uint8(out, 0); //Delete pending
out_uint8(out, S_ISDIR(filestat.st_mode) ? 1 : 0); //Directory
out_uint32_le(out, filestat.st_nlink); /* Number of links */
out_uint8(out, 0); /* Delete pending */
out_uint8(out, S_ISDIR(filestat.st_mode) ? 1 : 0); /* Directory */
break;
case FileObjectIdInformation:
@ -663,23 +663,23 @@ disk_set_information(NTHANDLE handle, uint32 info_class, STREAM in, STREAM out)
in_uint8s(in, 4); /* Handle of root dir? */
in_uint8s(in, 24); /* unknown */
// CreationTime
/* CreationTime */
in_uint32_le(in, ft_low);
in_uint32_le(in, ft_high);
// AccessTime
/* AccessTime */
in_uint32_le(in, ft_low);
in_uint32_le(in, ft_high);
if (ft_low || ft_high)
access_time = convert_1970_to_filetime(ft_high, ft_low);
// WriteTime
/* WriteTime */
in_uint32_le(in, ft_low);
in_uint32_le(in, ft_high);
if (ft_low || ft_high)
write_time = convert_1970_to_filetime(ft_high, ft_low);
// ChangeTime
/* ChangeTime */
in_uint32_le(in, ft_low);
in_uint32_le(in, ft_high);
if (ft_low || ft_high)
@ -718,7 +718,7 @@ disk_set_information(NTHANDLE handle, uint32 info_class, STREAM in, STREAM out)
}
if (!file_attributes)
break; // not valid
break; /* not valid */
mode = filestat.st_mode;
@ -835,7 +835,7 @@ disk_check_notify(NTHANDLE handle)
if (memcmp(&pfinfo->notify, &notify, sizeof(NOTIFY)))
{
//printf("disk_check_notify found changed event\n");
/*printf("disk_check_notify found changed event\n");*/
memcpy(&pfinfo->notify, &notify, sizeof(NOTIFY));
status = STATUS_NOTIFY_ENUM_DIR;
}
@ -970,7 +970,7 @@ FsVolumeInfo(char *fpath)
read(fd, buf, sizeof(buf));
strncpy(info.label, buf + 41, 32);
info.label[32] = '\0';
//info.Serial = (buf[128]<<24)+(buf[127]<<16)+(buf[126]<<8)+buf[125];
/* info.Serial = (buf[128]<<24)+(buf[127]<<16)+(buf[126]<<8)+buf[125]; */
}
close(fd);
}
@ -1073,14 +1073,14 @@ disk_query_directory(NTHANDLE handle, uint32 info_class, char *pattern, STREAM o
{
case FileBothDirectoryInformation:
// If a search pattern is received, remember this pattern, and restart search
/* If a search pattern is received, remember this pattern, and restart search */
if (pattern[0] != 0)
{
strncpy(pfinfo->pattern, 1 + strrchr(pattern, '/'), 64);
rewinddir(pdir);
}
// find next dirent matching pattern
/* find next dirent matching pattern */
pdirent = readdir(pdir);
while (pdirent && fnmatch(pfinfo->pattern, pdirent->d_name, 0) != 0)
pdirent = readdir(pdir);
@ -1088,7 +1088,7 @@ disk_query_directory(NTHANDLE handle, uint32 info_class, char *pattern, STREAM o
if (pdirent == NULL)
return STATUS_NO_MORE_FILES;
// Get information for directory entry
/* Get information for directory entry */
sprintf(fullpath, "%s/%s", dirname, pdirent->d_name);
if (stat(fullpath, &fstat))
@ -1119,34 +1119,34 @@ disk_query_directory(NTHANDLE handle, uint32 info_class, char *pattern, STREAM o
if (!(fstat.st_mode & S_IWUSR))
file_attributes |= FILE_ATTRIBUTE_READONLY;
// Return requested information
out_uint8s(out, 8); //unknown zero
/* Return requested information */
out_uint8s(out, 8); /* unknown zero */
seconds_since_1970_to_filetime(get_create_time(&fstat), &ft_high, &ft_low);
out_uint32_le(out, ft_low); // create time
out_uint32_le(out, ft_low); /* create time */
out_uint32_le(out, ft_high);
seconds_since_1970_to_filetime(fstat.st_atime, &ft_high, &ft_low);
out_uint32_le(out, ft_low); //last_access_time
out_uint32_le(out, ft_low); /* last_access_time */
out_uint32_le(out, ft_high);
seconds_since_1970_to_filetime(fstat.st_mtime, &ft_high, &ft_low);
out_uint32_le(out, ft_low); //last_write_time
out_uint32_le(out, ft_low); /* last_write_time */
out_uint32_le(out, ft_high);
seconds_since_1970_to_filetime(fstat.st_ctime, &ft_high, &ft_low);
out_uint32_le(out, ft_low); //change_write_time
out_uint32_le(out, ft_low); /* change_write_time */
out_uint32_le(out, ft_high);
out_uint32_le(out, fstat.st_size); //filesize low
out_uint32_le(out, 0); //filesize high
out_uint32_le(out, fstat.st_size); //filesize low
out_uint32_le(out, 0); //filesize high
out_uint32_le(out, fstat.st_size); /* filesize low */
out_uint32_le(out, 0); /* filesize high */
out_uint32_le(out, fstat.st_size); /* filesize low */
out_uint32_le(out, 0); /* filesize high */
out_uint32_le(out, file_attributes);
out_uint8(out, 2 * strlen(pdirent->d_name) + 2); //unicode length
out_uint8s(out, 7); //pad?
out_uint8(out, 0); //8.3 file length
out_uint8s(out, 2 * 12); //8.3 unicode length
out_uint8(out, 2 * strlen(pdirent->d_name) + 2); /* unicode length */
out_uint8s(out, 7); /* pad? */
out_uint8(out, 0); /* 8.3 file length */
out_uint8s(out, 2 * 12); /* 8.3 unicode length */
rdp_out_unistr(out, pdirent->d_name, 2 * strlen(pdirent->d_name));
break;
@ -1178,8 +1178,8 @@ disk_device_control(NTHANDLE handle, uint32 request, STREAM in, STREAM out)
switch (request)
{
case 25: // ?
case 42: // ?
case 25: /* ? */
case 42: /* ? */
default:
unimpl("DISK IOCTL %d\n", request);
return STATUS_INVALID_PARAMETER;

View File

@ -935,7 +935,7 @@ process_bmpcache(STREAM s)
/* Begin compressedBitmapData */
in_uint16_le(s, pad2); /* pad */
in_uint16_le(s, size);
/* in_uint8s(s, 4); *//* row_size, final_size */
/* in_uint8s(s, 4); */ /* row_size, final_size */
in_uint16_le(s, row_size);
in_uint16_le(s, final_size);

View File

@ -32,7 +32,7 @@ parallel_enum_devices(uint32 * id, char *optarg)
char *pos2;
int count = 0;
// skip the first colon
/* skip the first colon */
optarg++;
while ((pos = next_arg(optarg, ',')) && *id < RDPDR_MAX_DEVICES)
{
@ -47,7 +47,7 @@ parallel_enum_devices(uint32 * id, char *optarg)
strcpy(g_rdpdr_device[*id].local_path, pos2);
printf("PARALLEL %s to %s\n", optarg, pos2);
// set device type
/* set device type */
g_rdpdr_device[*id].device_type = DEVICE_TYPE_PARALLEL;
g_rdpdr_device[*id].pdevice_data = (void *) ppar_info;
g_rdpdr_device[*id].handle = 0;

View File

@ -25,8 +25,8 @@ printer_enum_devices(uint32 * id, char *optarg)
int count = 0;
int already = 0;
// we need to know how many printers we've already set up
// supplied from other -r flags than this one.
/* we need to know how many printers we've already set up
supplied from other -r flags than this one. */
while (count < *id)
{
if (g_rdpdr_device[count].device_type == DEVICE_TYPE_PRINTER)

View File

@ -239,9 +239,9 @@ printercache_process(STREAM s)
{
case 4: /* rename item */
in_uint8(s, printer_length);
in_uint8s(s, 0x3); // padding
in_uint8s(s, 0x3); /* padding */
in_uint8(s, driver_length);
in_uint8s(s, 0x3); // padding
in_uint8s(s, 0x3); /* padding */
/* NOTE - 'driver' doesn't contain driver, it contains the new printer name */
@ -253,7 +253,7 @@ printercache_process(STREAM s)
case 3: /* delete item */
in_uint8(s, printer_unicode_length);
in_uint8s(s, 0x3); // padding
in_uint8s(s, 0x3); /* padding */
printer_length = rdp_in_unistr(s, printer, printer_unicode_length);
printercache_unlink_blob(printer);
break;
@ -270,22 +270,22 @@ printercache_process(STREAM s)
break;
case 1: /* save device data */
in_uint8a(s, device_name, 5); // get LPTx/COMx name
in_uint8a(s, device_name, 5); /* get LPTx/COMx name */
// need to fetch this data so that we can get the length of the packet to store.
in_uint8s(s, 0x2); // ???
in_uint8s(s, 0x2) // pad??
/* need to fetch this data so that we can get the length of the packet to store. */
in_uint8s(s, 0x2); /* ??? */
in_uint8s(s, 0x2) /* pad?? */
in_uint32_be(s, driver_length);
in_uint32_be(s, printer_length);
in_uint8s(s, 0x7) // pad??
// next is driver in unicode
// next is printer in unicode
in_uint8s(s, 0x7) /* pad?? */
/* next is driver in unicode */
/* next is printer in unicode */
/* TODO: figure out how to use this information when reconnecting */
/* actually - all we need to store is the driver and printer */
/* and figure out what the first word is. */
/* rewind stream so that we can save this blob */
/* length is driver_length + printer_length + 19 */
// rewind stream
/* rewind stream */
s->p = s->p - 19;
printercache_save_blob(device_name, s->p,

2
rdp.c
View File

@ -1203,7 +1203,7 @@ process_data_pdu(STREAM s, uint32 * ext_disc_reason)
if (mppc_expand(s->p, clen, ctype, &roff, &rlen) == -1)
error("error while decompressing packet\n");
//len -= 18;
/* len -= 18; */
/* allocate memory and copy the uncompressed data into the temporary stream */
ns->data = (uint8 *) xrealloc(ns->data, rlen);

28
rdpdr.c
View File

@ -155,7 +155,7 @@ add_async_iorequest(uint32 device, uint32 file, uint32 id, uint32 major, uint32
while (iorq->fd != 0)
{
// create new element if needed
/* create new element if needed */
if (iorq->next == NULL)
{
iorq->next =
@ -228,7 +228,7 @@ announcedata_size()
int size, i;
PRINTER *printerinfo;
size = 8; //static announce size
size = 8; /* static announce size */
size += g_num_devices * 0x14;
for (i = 0; i < g_num_devices; i++)
@ -327,7 +327,7 @@ rdpdr_send_completion(uint32 device, uint32 id, uint32 status, uint32 result, ui
/* JIF */
#ifdef WITH_DEBUG_RDP5
printf("--> rdpdr_send_completion\n");
//hexdump(s->channel_hdr + 8, s->end - s->channel_hdr - 8);
/* hexdump(s->channel_hdr + 8, s->end - s->channel_hdr - 8); */
#endif
channel_send(s, rdpdr_channel);
}
@ -406,7 +406,7 @@ rdpdr_process_irp(STREAM s)
case IRP_MJ_CREATE:
in_uint32_be(s, desired_access);
in_uint8s(s, 0x08); // unknown
in_uint8s(s, 0x08); /* unknown */
in_uint32_le(s, error_mode);
in_uint32_le(s, share_mode);
in_uint32_le(s, disposition);
@ -463,7 +463,7 @@ rdpdr_process_irp(STREAM s)
break;
}
if (rw_blocking) // Complete read immediately
if (rw_blocking) /* Complete read immediately */
{
buffer = (uint8 *) xrealloc((void *) buffer, length);
if (!buffer)
@ -476,7 +476,7 @@ rdpdr_process_irp(STREAM s)
break;
}
// Add request to table
/* Add request to table */
pst_buf = (uint8 *) xmalloc(length);
if (!pst_buf)
{
@ -516,13 +516,13 @@ rdpdr_process_irp(STREAM s)
break;
}
if (rw_blocking) // Complete immediately
if (rw_blocking) /* Complete immediately */
{
status = fns->write(file, s->p, length, offset, &result);
break;
}
// Add to table
/* Add to table */
pst_buf = (uint8 *) xmalloc(length);
if (!pst_buf)
{
@ -629,7 +629,7 @@ rdpdr_process_irp(STREAM s)
/* JIF
unimpl("IRP major=0x%x minor=0x%x: IRP_MN_NOTIFY_CHANGE_DIRECTORY\n", major, minor); */
in_uint32_le(s, info_level); // notify mask
in_uint32_le(s, info_level); /* notify mask */
g_notify_stamp = True;
@ -835,7 +835,7 @@ rdpdr_init()
void
rdpdr_add_fds(int *n, fd_set * rfds, fd_set * wfds, struct timeval *tv, BOOL * timeout)
{
uint32 select_timeout = 0; // Timeout value to be used for select() (in millisecons).
uint32 select_timeout = 0; /* Timeout value to be used for select() (in millisecons). */
struct async_iorequest *iorq;
char c;
@ -920,7 +920,7 @@ rdpdr_remove_iorequest(struct async_iorequest *prev, struct async_iorequest *ior
}
else
{
// Even if NULL
/* Even if NULL */
g_iorequest = iorq->next;
xfree(iorq);
iorq = NULL;
@ -959,7 +959,7 @@ _rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out)
{
/* iv_timeout between 2 chars, send partial_len */
//printf("RDPDR: IVT total %u bytes read of %u\n", iorq->partial_len, iorq->length);
/*printf("RDPDR: IVT total %u bytes read of %u\n", iorq->partial_len, iorq->length);*/
rdpdr_send_completion(iorq->device,
iorq->id, STATUS_SUCCESS,
iorq->partial_len,
@ -1180,8 +1180,8 @@ rdpdr_abort_io(uint32 fd, uint32 major, NTSTATUS status)
prev = NULL;
while (iorq != NULL)
{
// Only remove from table when major is not set, or when correct major is supplied.
// Abort read should not abort a write io request.
/* Only remove from table when major is not set, or when correct major is supplied.
Abort read should not abort a write io request. */
if ((iorq->fd == fd) && (major == 0 || iorq->major == major))
{
result = 0;

View File

@ -324,9 +324,9 @@ wave_out_play(void)
gf = alGetFillable(output_port);
if (len > gf)
{
//len = gf * combinedFrameSize;
/* len = gf * combinedFrameSize; */
#if (defined(IRIX_DEBUG))
//fprintf(stderr,"Fillable...\n");
/* fprintf(stderr,"Fillable...\n"); */
#endif
}
@ -353,7 +353,7 @@ wave_out_play(void)
else
{
#if (defined(IRIX_DEBUG))
//fprintf(stderr,"Busy playing...\n");
/* fprintf(stderr,"Busy playing...\n"); */
#endif
g_dsp_busy = True;
return;

View File

@ -77,19 +77,19 @@
#define SERIAL_PURGE_RXCLEAR 0x00000008
/* SERIAL_WAIT_ON_MASK */
#define SERIAL_EV_RXCHAR 0x0001 // Any Character received
#define SERIAL_EV_RXFLAG 0x0002 // Received certain character
#define SERIAL_EV_TXEMPTY 0x0004 // Transmitt Queue Empty
#define SERIAL_EV_CTS 0x0008 // CTS changed state
#define SERIAL_EV_DSR 0x0010 // DSR changed state
#define SERIAL_EV_RLSD 0x0020 // RLSD changed state
#define SERIAL_EV_BREAK 0x0040 // BREAK received
#define SERIAL_EV_ERR 0x0080 // Line status error occurred
#define SERIAL_EV_RING 0x0100 // Ring signal detected
#define SERIAL_EV_PERR 0x0200 // Printer error occured
#define SERIAL_EV_RX80FULL 0x0400 // Receive buffer is 80 percent full
#define SERIAL_EV_EVENT1 0x0800 // Provider specific event 1
#define SERIAL_EV_EVENT2 0x1000 // Provider specific event 2
#define SERIAL_EV_RXCHAR 0x0001 /* Any Character received */
#define SERIAL_EV_RXFLAG 0x0002 /* Received certain character */
#define SERIAL_EV_TXEMPTY 0x0004 /* Transmitt Queue Empty */
#define SERIAL_EV_CTS 0x0008 /* CTS changed state */
#define SERIAL_EV_DSR 0x0010 /* DSR changed state */
#define SERIAL_EV_RLSD 0x0020 /* RLSD changed state */
#define SERIAL_EV_BREAK 0x0040 /* BREAK received */
#define SERIAL_EV_ERR 0x0080 /* Line status error occurred */
#define SERIAL_EV_RING 0x0100 /* Ring signal detected */
#define SERIAL_EV_PERR 0x0200 /* Printer error occured */
#define SERIAL_EV_RX80FULL 0x0400 /* Receive buffer is 80 percent full */
#define SERIAL_EV_EVENT1 0x0800 /* Provider specific event 1 */
#define SERIAL_EV_EVENT2 0x1000 /* Provider specific event 2 */
/* Modem Status */
#define SERIAL_MS_DTR 0x01
@ -503,11 +503,11 @@ serial_enum_devices(uint32 * id, char *optarg)
char *pos2;
int count = 0;
// skip the first colon
/* skip the first colon */
optarg++;
while ((pos = next_arg(optarg, ',')) && *id < RDPDR_MAX_DEVICES)
{
// Init data structures for device
/* Init data structures for device */
pser_inf = (SERIAL_DEVICE *) xmalloc(sizeof(SERIAL_DEVICE));
pser_inf->ptermios = (struct termios *) xmalloc(sizeof(struct termios));
memset(pser_inf->ptermios, 0, sizeof(struct termios));
@ -523,7 +523,7 @@ serial_enum_devices(uint32 * id, char *optarg)
strcpy(g_rdpdr_device[*id].local_path, pos2);
printf("SERIAL %s to %s\n", g_rdpdr_device[*id].name,
g_rdpdr_device[*id].local_path);
// set device type
/* set device type */
g_rdpdr_device[*id].device_type = DEVICE_TYPE_SERIAL;
g_rdpdr_device[*id].pdevice_data = (void *) pser_inf;
count++;
@ -559,7 +559,7 @@ serial_create(uint32 device_id, uint32 access, uint32 share_mode, uint32 disposi
return STATUS_ACCESS_DENIED;
}
// Store handle for later use
/* Store handle for later use */
g_rdpdr_device[device_id].handle = serial_fd;
/* some sane information */
@ -618,8 +618,8 @@ serial_read(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32
pser_inf = get_serial_info(handle);
ptermios = pser_inf->ptermios;
// Set timeouts kind of like the windows serial timeout parameters. Multiply timeout
// with requested read size
/* Set timeouts kind of like the windows serial timeout parameters. Multiply timeout
with requested read size */
if (pser_inf->read_total_timeout_multiplier | pser_inf->read_total_timeout_constant)
{
timeout =
@ -631,9 +631,9 @@ serial_read(NTHANDLE handle, uint8 * data, uint32 length, uint32 offset, uint32
timeout = (pser_inf->read_interval_timeout * length + 99) / 100;
}
// If a timeout is set, do a blocking read, which times out after some time.
// It will make rdesktop less responsive, but it will improve serial performance, by not
// reading one character at a time.
/* If a timeout is set, do a blocking read, which times out after some time.
It will make rdesktop less responsive, but it will improve serial performance, by not
reading one character at a time. */
if (timeout == 0)
{
ptermios->c_cc[VTIME] = 0;