Compiler suggested cleanups

This commit is contained in:
Mark Pizzolato 2013-01-23 05:07:44 -08:00
parent e6e6262f45
commit e3207c2009
6 changed files with 13 additions and 15 deletions

View file

@ -1584,5 +1584,6 @@ static t_stat vh_help_attach (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, ch
{ {
char *devtype = (UNIBUS) ? "DH11" : "DHQ11"; char *devtype = (UNIBUS) ? "DH11" : "DHQ11";
return tmxr_attach_help (st, dptr, uptr, flag, cptr); fprintf (st, "%s %s Terminal Multiplexer Attach Help\n\n", devtype, dptr->name);
return tmxr_attach_help (st, dptr, uptr, 1, cptr);
} }

View file

@ -952,7 +952,6 @@ _console_poll(void *arg)
{ {
int sched_policy; int sched_policy;
struct sched_param sched_priority; struct sched_param sched_priority;
int poll_timeout_count = 0;
int wait_count = 0; int wait_count = 0;
DEVICE *d; DEVICE *d;

View file

@ -1148,8 +1148,6 @@ return SCPE_OK;
t_stat sim_disk_attach_help(FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr) t_stat sim_disk_attach_help(FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr)
{ {
size_t unit_number = (uptr-dptr->units);
fprintf (st, "%s Disk Attach Help\n\n", dptr->name); fprintf (st, "%s Disk Attach Help\n\n", dptr->name);
fprintf (st, "Disk container files can be one of 3 different types:\n\n"); fprintf (st, "Disk container files can be one of 3 different types:\n\n");

View file

@ -890,19 +890,18 @@ memset(list, 0, max*sizeof(*list));
#if defined(__linux__) #if defined(__linux__)
if (1) { if (1) {
struct dirent **namelist; struct dirent **namelist;
int n;
struct stat st; struct stat st;
n = scandir("/sys/class/tty/", &namelist, NULL, NULL); i = scandir("/sys/class/tty/", &namelist, NULL, NULL);
while (n--) { while (i--) {
if (strcmp(namelist[n]->d_name, ".") && if (strcmp(namelist[i]->d_name, ".") &&
strcmp(namelist[n]->d_name, "..")) { strcmp(namelist[i]->d_name, "..")) {
char path[1024], devicepath[1024], driverpath[1024]; char path[1024], devicepath[1024], driverpath[1024];
sprintf (path, "/sys/class/tty/%s", namelist[n]->d_name); sprintf (path, "/sys/class/tty/%s", namelist[i]->d_name);
sprintf (devicepath, "/sys/class/tty/%s/device", namelist[n]->d_name); sprintf (devicepath, "/sys/class/tty/%s/device", namelist[i]->d_name);
sprintf (driverpath, "/sys/class/tty/%s/device/driver", namelist[n]->d_name); sprintf (driverpath, "/sys/class/tty/%s/device/driver", namelist[i]->d_name);
if ((lstat(devicepath, &st) == 0) && S_ISLNK(st.st_mode)) { if ((lstat(devicepath, &st) == 0) && S_ISLNK(st.st_mode)) {
char buffer[1024]; char buffer[1024];
@ -918,7 +917,7 @@ if (1) {
} }
} }
} }
free (namelist[n]); free (namelist[i]);
} }
free (namelist); free (namelist);
} }

View file

@ -1255,7 +1255,7 @@ pthread_mutex_lock (&sim_timer_lock);
if (sim_asynch_enabled && sim_asynch_timer) { if (sim_asynch_enabled && sim_asynch_timer) {
pthread_attr_t attr; pthread_attr_t attr;
UNIT *cptr; UNIT *cptr;
double delta_due_time; double delta_due_time = 0;
/* when restarting after being manually stopped the due times for all */ /* when restarting after being manually stopped the due times for all */
/* timer events needs to slide so they fire in the future. (clock ticks */ /* timer events needs to slide so they fire in the future. (clock ticks */

View file

@ -2763,7 +2763,8 @@ t_bool single_line = FALSE; /* default to Multi-Line help */
if (mux) if (mux)
single_line = (mux->lines == 1); single_line = (mux->lines == 1);
fprintf (st, "%s Multiplexer Attach Help\n\n", dptr->name); if (!flag)
fprintf (st, "%s Multiplexer Attach Help\n\n", dptr->name);
if (single_line) { /* Single Line Multiplexer */ if (single_line) { /* Single Line Multiplexer */
fprintf (st, "The %s multiplexer may be connected to terminal emulators supporting the\n", dptr->name); fprintf (st, "The %s multiplexer may be connected to terminal emulators supporting the\n", dptr->name);
fprintf (st, "Telnet protocol via sockets, or to hardware terminals via host serial\n"); fprintf (st, "Telnet protocol via sockets, or to hardware terminals via host serial\n");