X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=tack%2Fcontrol.c;h=54736d3609f555ad2448d13779a7c08761f71def;hp=4c2158e4dda399a9a8d48964513ec1af472ce94c;hb=55ccd2b959766810cf7db8d1c4462f338ce0afc8;hpb=0eb88fc5281804773e2a0c7a488a4452463535ce diff --git a/tack/control.c b/tack/control.c index 4c2158e4..54736d36 100644 --- a/tack/control.c +++ b/tack/control.c @@ -15,8 +15,8 @@ ** ** You should have received a copy of the GNU General Public License ** along with TACK; see the file COPYING. If not, write to -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -** Boston, MA 02111-1307, USA. +** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +** Boston, MA 02110-1301, USA */ #include @@ -25,7 +25,7 @@ #include #endif -MODULE_ID("$Id: control.c,v 1.2 1999/06/16 00:45:59 tom Exp $") +MODULE_ID("$Id: control.c,v 1.8 2005/09/17 19:49:16 tom Exp $") /* terminfo test program control subroutines */ @@ -40,11 +40,11 @@ int test_complete; /* counts number of tests completed */ char txt_longer_test_time[80]; /* +) use longer time */ char txt_shorter_test_time[80]; /* -) use shorter time */ -int pad_test_duration = 1; /* number of seconds for a pad test */ +static int pad_test_duration = 1; /* number of seconds for a pad test */ int auto_pad_mode; /* run the time tests */ int no_alarm_event; /* TRUE if the alarm has not gone off yet */ -int usec_run_time; /* length of last test in microseconds */ -MY_TIMER stop_watch[MAX_TIMERS]; /* Hold the start timers */ +unsigned long usec_run_time; /* length of last test in microseconds */ +static MY_TIMER stop_watch[MAX_TIMERS]; /* Hold the start timers */ char txt_longer_augment[80]; /* >) use bigger augment */ char txt_shorter_augment[80]; /* <) use smaller augment */ @@ -53,29 +53,26 @@ char txt_shorter_augment[80]; /* <) use smaller augment */ int tt_delay_max; /* max number of milliseconds we can delay */ int tt_delay_used; /* number of milliseconds consumed in delay */ const char *tt_cap[TT_MAX]; /* value of string */ -int tt_affected[TT_MAX]; /* lines or columns effected (repitition factor) */ +int tt_affected[TT_MAX]; /* lines or columns effected (repetition factor) */ int tt_count[TT_MAX]; /* Number of times sent */ int tt_delay[TT_MAX]; /* Number of milliseconds delay */ int ttp; /* number of entries used */ /* Saved value of the above data base */ const char *tx_cap[TT_MAX]; /* value of string */ -int tx_affected[TT_MAX]; /* lines or columns effected (repitition factor) */ +int tx_affected[TT_MAX]; /* lines or columns effected (repetition factor) */ int tx_count[TT_MAX]; /* Number of times sent */ int tx_index[TT_MAX]; /* String index */ int tx_delay[TT_MAX]; /* Number of milliseconds delay */ int txp; /* number of entries used */ int tx_characters; /* printing characters sent by test */ -int tx_cps; /* characters per second */ -struct test_list *tx_source; /* The test that generated this data */ - -extern struct test_menu pad_menu; /* Pad menu structure */ -extern struct test_list pad_test_list[]; +unsigned long tx_cps; /* characters per second */ +static struct test_list *tx_source; /* The test that generated this data */ #define RESULT_BLOCK 1024 static int blocks; /* number of result blocks available */ static struct test_results *results; /* pointer to next available */ -struct test_results *pads[STRCOUNT]; /* save pad results here */ +static struct test_results *pads[STRCOUNT]; /* save pad results here */ /* ** event_start(number) @@ -365,7 +362,7 @@ int sliding_scale( int dividend, int factor, - int divisor) + unsigned long divisor) { double d = dividend; @@ -500,7 +497,7 @@ show_cap_results( ptext(temp); while (r) { sprintf(temp, "$<%d>", r->delay / 1000); - put_columns(temp, strlen(temp), 10); + put_columns(temp, (int) strlen(temp), 10); r = r->next; } r = pads[x]; @@ -508,7 +505,7 @@ show_cap_results( if (r->reps > 1) { delay = r->delay / (r->reps * 100); sprintf(temp, "$<%d.%d*>", delay / 10, delay % 10); - put_columns(temp, strlen(temp), 10); + put_columns(temp, (int) strlen(temp), 10); } r = r->next; } @@ -544,9 +541,9 @@ dump_test_stats( put_crlf(); } } - sprintf(tbuf, "%011u", usec_run_time); - sprintf(temp, "Test time: %d.%s, characters per second %d, characters %d", - usec_run_time / 1000000, &tbuf[5], tx_cps, tx_characters); + sprintf(tbuf, "%011lu", usec_run_time); + sprintf(temp, "Test time: %lu.%s, characters per second %lu, characters %d", + usec_run_time / 1000000UL, &tbuf[5], tx_cps, tx_characters); ptextln(temp); for (i = 0; i < txp; i++) { if ((j = get_string_cap_byvalue(tx_cap[i])) >= 0) {