From f7ccf334a22a4241fd1337be2f4f4bcd8deb441e Mon Sep 17 00:00:00 2001 From: "J. David Bryan" Date: Thu, 16 Jun 2022 21:06:46 -0700 Subject: [PATCH] TIMER, TMXR: Add casts for down-conversion potential compiler warnings --- sim_timer.c | 7 ++++--- sim_tmxr.c | 25 +++++++++++++------------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/sim_timer.c b/sim_timer.c index ce43af53..e1ff6bba 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -1,6 +1,6 @@ /* sim_timer.c: simulator timer library - Copyright (c) 1993-2017, Robert M Supnik + Copyright (c) 1993-2021, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -23,6 +23,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Robert M Supnik. + 01-Feb-21 JDB Added cast for down-conversion 22-May-17 RMS Hacked for V4.0 CONST compatibility 23-Nov-15 RMS Fixed calibration lost path to reinitialize timer 28-Mar-15 RMS Revised to use sim_printf @@ -561,10 +562,10 @@ else { val = strtotv (cptr, &tptr, 10); if (cptr == tptr) return SCPE_ARG; - c = toupper (*tptr++); + c = (char) toupper (*tptr++); if (*tptr != 0) return SCPE_ARG; - if (c == 'M') + if (c == 'M') sim_throt_type = SIM_THROT_MCYC; else if (c == 'K') sim_throt_type = SIM_THROT_KCYC; diff --git a/sim_tmxr.c b/sim_tmxr.c index 8d1c9188..f2d50db5 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -1,6 +1,6 @@ /* sim_tmxr.c: Telnet terminal multiplexor library - Copyright (c) 2001-2020, Robert M Supnik + Copyright (c) 2001-2021, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -26,6 +26,7 @@ Based on the original DZ11 simulator by Thord Nilson, as updated by Arthur Krewat. + 31-Jan-21 JDB Added a cast in "tmxr_set_lnorder" from t_addr to uint32 26-Oct-20 JDB Line order now supports partial connection lists 23-Oct-20 JDB Added tmxr_table and tmxr_post_logs tmxr_set_log now takes -N switch for new file @@ -1107,12 +1108,12 @@ tptr = cptr + strlen (cptr); /* append a semicolon */ idx = 0; /* initialize the index of ordered values */ -while (*cptr != '\0') { /* while characters remain in the command string */ - if (strncmp (cptr, "ALL;", 4) == 0) { /* if the parameter is "ALL" */ - if (val != 0 || idx > 0 && idx <= max) /* then if some lines are restrictied or unspecified */ - for (line = min; line <= max; line++) /* then fill them in sequentially */ - if (set [line] == FALSE) /* setting each unspecified line */ - list [idx++] = line; /* into the line order */ +while (*cptr != '\0') { /* while characters remain in the command string */ + if (strncmp (cptr, "ALL;", 4) == 0) { /* if the parameter is "ALL" */ + if (val != 0 || idx > 0 && idx <= max) /* then if some lines are restrictied or unspecified */ + for (line = (uint32) min; line <= max; line++) /* then fill them in sequentially */ + if (set [line] == FALSE) /* setting each unspecified line */ + list [idx++] = line; /* into the line order */ cptr = cptr + 4; /* advance past "ALL" and the trailing semicolon */ @@ -1134,11 +1135,11 @@ while (*cptr != '\0') { /* while characters rema break; /* and terminate the parse */ } - else /* otherwise it's a valid range */ - for (line = (uint32) low; line <= (uint32) high; line++) /* so add the line(s) to the order */ - if (set [line] == FALSE) { /* if the line number has not been specified */ - set [line] = TRUE; /* then now it is */ - list [idx++] = line; /* and add it to the connection order */ + else /* otherwise it's a valid range */ + for (line = (uint32) low; line <= high; line++) /* so add the line(s) to the order */ + if (set [line] == FALSE) { /* if the line number has not been specified */ + set [line] = TRUE; /* then now it is */ + list [idx++] = line; /* and add it to the connection order */ } }