Skip to content

Commit

Permalink
Merge pull request #416 from jmalak/cleanup-7
Browse files Browse the repository at this point in the history
cleanup-true: rename variable true to more suitable names
  • Loading branch information
davidrg authored Nov 10, 2024
2 parents 9c6e935 + 282861e commit 4831644
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions kermit/k95/ckuus3.c
Original file line number Diff line number Diff line change
Expand Up @@ -4140,7 +4140,7 @@ dosexp(s) char *s;
}
goto xdosexp;
} else if (x == SX_IFC) { /* Conditional expression */
int true = 0;
int bool_result = 0;
if (n > 4) {
printf("?Too many operands: IF - \"%s\"\n",s);
sexprc++;
Expand All @@ -4157,12 +4157,12 @@ dosexp(s) char *s;
} else {
fpj = atof(s2);
}
true = ((fpj != 0.0) ? 1 : 0);
bool_result = ((fpj != 0.0) ? 1 : 0);
}
if (!true && n < 4) {
if (!bool_result && n < 4) {
s2 = NULL;
} else {
s2 = dosexp(true ? p[3] : p[4]);
s2 = dosexp(bool_result ? p[3] : p[4]);
if (sexprc) goto xdosexp;
j = s2 ? ckatofs(s2) : 0;
if (xxfloat(s2,0) == 2) {
Expand Down
18 changes: 9 additions & 9 deletions kermit/p95/pdll_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

_Inline void tcp_open(void) {

U32 true = 1;
U32 true_u32 = 1;
struct hostent *hostnm; /* server host name information */
struct sockaddr_in server; /* server address information */
#ifdef NT
Expand All @@ -68,7 +68,7 @@ _Inline void tcp_open(void) {
MODULE_SOCKET, __LINE__, 0);

if (setsockopt(passive_socket, SOL_SOCKET, SO_REUSEADDR,
(char *)&true, sizeof(true)))
(char *)&true_u32, sizeof(true_u32)))
p_error(P_ERROR_SETSOCKOPT, sock_errno(),
MODULE_SOCKET, __LINE__, passive_socket);

Expand All @@ -87,9 +87,9 @@ _Inline void tcp_open(void) {
/***********************************************/
if (
#ifdef NT
ioctlsocket( passive_socket, FIONBIO, &true )
ioctlsocket( passive_socket, FIONBIO, &true_u32 )
#else
ioctl(passive_socket, FIONBIO, (char *)&true, sizeof(U32))
ioctl(passive_socket, FIONBIO, (char *)&true_u32, sizeof(true_u32))
#endif
)
p_error(P_ERROR_IOCTL, sock_errno(),
Expand Down Expand Up @@ -119,9 +119,9 @@ ioctl(passive_socket, FIONBIO, (char *)&true, sizeof(U32))
MODULE_SOCKET, __LINE__, socket_handle);
if (
#ifdef NT
ioctlsocket( socket_handle, FIONBIO, &true )
ioctlsocket( socket_handle, FIONBIO, &true_u32 )
#else
ioctl(socket_handle, FIONBIO, (char *)&true, sizeof(U32))
ioctl(socket_handle, FIONBIO, (char *)&true_u32, sizeof(true_u32))
#endif
)
p_error(P_ERROR_IOCTL, sock_errno(),
Expand All @@ -134,7 +134,7 @@ ioctl(socket_handle, FIONBIO, (char *)&true, sizeof(U32))
_Inline U32 tcp_connect(void) {

U32 namelen;
U32 true = 1;
U32 true_u32 = 1;
struct hostent *hostnm; /* client host name information */
struct sockaddr_in client; /* client address information */

Expand Down Expand Up @@ -169,9 +169,9 @@ _Inline U32 tcp_connect(void) {

if (
#ifdef NT
ioctlsocket( socket_handle, FIONBIO, &true )
ioctlsocket( socket_handle, FIONBIO, &true_u32 )
#else
ioctl(socket_handle, FIONBIO, (char *)&true, sizeof(U32))
ioctl(socket_handle, FIONBIO, (char *)&true_u32, sizeof(true_u32))
#endif
)
p_error(P_ERROR_IOCTL, sock_errno(),
Expand Down

0 comments on commit 4831644

Please sign in to comment.