Skip to content

Commit

Permalink
Merge branch 'master' into rexx-extra
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrg committed Oct 31, 2024
2 parents 525a5d6 + 5be2479 commit 4c03203
Show file tree
Hide file tree
Showing 24 changed files with 186 additions and 222 deletions.
18 changes: 9 additions & 9 deletions kermit/dialer/kconnect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ kcopy(char *source, char *destination) {

x = strlen(destination);
len = strlen(destination) + strlen(source) + 2;
if (!(p = (char *)malloc(len)))
if ((p = (char *)malloc(len)) == NULL)
return(-1);
strcpy(p,destination); /* Directory part */
if (!ISDIRSEP(*(destination+x-1))) /* Separator, if needed */
Expand All @@ -296,7 +296,7 @@ kcopy(char *source, char *destination) {
strcat(p,q); /* Concatenate to new directory */
} else {
len = strlen(destination) + 64;
if (!(p = (char *)malloc(len)))
if ((p = (char *)malloc(len)) == NULL)
return(-1);
strcpy(p,destination);
}
Expand Down Expand Up @@ -332,7 +332,7 @@ kmkdir(const char *path) {
x = strlen(path);
if (x < 1 || x > CKMAXPATH) /* Check length */
return(-1);
if (!(tp = (char *)malloc(x+1))) /* Make a temporary copy */
if ((tp = (char *)malloc(x+1)) == NULL) /* Make a temporary copy */
return(-1);
strcpy(tp,path);

Expand Down Expand Up @@ -735,7 +735,7 @@ K_CONNECTOR::K_CONNECTOR(void)
if ( !isdir(dir) ) {
kmkdir(dir);

if ( common = GetAppData(1) ) {
if ( (common = GetAppData(1)) != NULL ) {
sprintf(file,"%s%s",(char *)common, "Kermit 95\\K95CUSTOM.INI");
kcopy(file,dir);
appdata = GetAppData(0);
Expand Down Expand Up @@ -7227,7 +7227,7 @@ StartKermit( KD_LIST_ITEM * entry, KD_CONFIG * config, KD_LIST_ITEM * def_entry
}

if (!StartKermitFileName &&
!(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE])) {
(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE]) == NULL) {

if ( !StartKermitFileName )
OutofMemory("Unable to create MESSAGE_WINDOW StartKermit 3");
Expand Down Expand Up @@ -8403,7 +8403,7 @@ ExportLocations(void)
}

if (!StartKermitFileName &&
!(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE])) {
(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE]) == NULL) {
if ( !StartKermitFileName )
OutofMemory("Unable to create ICHAR ExportLocations 1");

Expand Down Expand Up @@ -8511,7 +8511,7 @@ ExportModems(void)
}

if (!StartKermitFileName &&
!(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE])) {
(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE]) == NULL) {
if ( !StartKermitFileName )
OutofMemory("Unable to create ICHAR ExportModems");
#ifdef WIN32
Expand Down Expand Up @@ -8669,7 +8669,7 @@ CreateShortcut( KD_LIST_ITEM * entry, KD_CONFIG * config, KD_LIST_ITEM * def_ent
}

if (!StartKermitFileName &&
!(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE])) {
(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE]) == NULL) {
if ( !StartKermitFileName )
OutofMemory("Unable to create ICHAR CreateShortcut");
#ifdef WIN32
Expand Down Expand Up @@ -8945,7 +8945,7 @@ CreateScriptFile( KD_LIST_ITEM * entry, KD_CONFIG * config, KD_LIST_ITEM * def_e
}

if (!StartKermitFileName &&
!(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE])) {
(StartKermitFileName = (ZIL_ICHAR *) new ZIL_ICHAR[BUFFERSIZE]) == NULL) {
if ( !StartKermitFileName )
OutofMemory("Unable to create ICHAR CreateScriptFile");
#ifdef WIN32
Expand Down
2 changes: 1 addition & 1 deletion kermit/dialer/kquick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void K_QUICK::PopulateList( enum TRANSPORT type )
UIW_COMBO_BOX * combo = (UIW_COMBO_BOX *) Get( COMBO_QUICK );
UIW_VT_LIST * quicklist = (UIW_VT_LIST *) Get( LIST_QUICK );
UIW_BUTTON * button = NULL;
while ( button = (UIW_BUTTON *) quicklist->First() ) {
while ( (button = (UIW_BUTTON *)quicklist->First()) != NULL ) {
*quicklist - button;
delete button;
}
Expand Down
4 changes: 2 additions & 2 deletions kermit/dialer/ksetgeneral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ InitTCPProtoList()
{
UIW_BUTTON * button;
UIW_VT_LIST * list = (UIW_VT_LIST *) Get( LIST_TCP_PROTOCOL ) ;
while ( button = (UIW_BUTTON *) list->First() ) {
while ( (button = (UIW_BUTTON *)list->First()) != NULL ) {
*list - button;
delete button;
}
Expand Down Expand Up @@ -995,7 +995,7 @@ InitSSHProtoList()
{
UIW_BUTTON * button;
UIW_VT_LIST * list = (UIW_VT_LIST *) Get( LIST_TCP_PROTOCOL ) ;
while ( button = (UIW_BUTTON *) list->First() ) {
while ( (button = (UIW_BUTTON *)list->First()) != NULL ) {
*list - button;
delete button;
}
Expand Down
6 changes: 5 additions & 1 deletion kermit/dialer/ksetprinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
extern "C" {
#include "ckcdeb.h" /* Typedefs, debug formats, etc */
#include "ckucmd.h"
#ifdef printf
#undef printf
#endif
#ifdef fprintf
#undef fprintf
#endif
#include <windows.h> /* Windows Definitions */
}
#endif /* WIN32 */
Expand Down Expand Up @@ -809,7 +813,7 @@ Win32EnumPrt( struct keytab ** pTable, struct keytab ** pTable2, int * pN )
// (simple error checking, if these work assume rest will too)
//

if (!(pPrtInfo2 = (LPPRINTER_INFO_2) LocalAlloc (LPTR, dwBytesNeeded)))
if ((pPrtInfo2 = (LPPRINTER_INFO_2)LocalAlloc (LPTR, dwBytesNeeded)) == NULL)
{
return(FALSE);
}
Expand Down
6 changes: 3 additions & 3 deletions kermit/dialer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "kwinmgr.hpp"
#ifdef WIN32
extern "C" {
#define OS2
#define NT
//#define OS2
//#define NT
#include "ckcdeb.h"
#include "ckoetc.h"
#ifndef NODIAL
Expand Down Expand Up @@ -278,7 +278,7 @@ int UI_APPLICATION::Main(void)
#ifdef WIN32
#ifndef NODIAL
printf("Checking TAPI\n");
if (TapiAvail = cktapiinit(hInstance)) {
if ((TapiAvail = cktapiinit(hInstance)) != 0) {
printf("TAPI available\n");
cktapiopen();
printf("TAPI Open\n");
Expand Down
2 changes: 1 addition & 1 deletion kermit/k95/ckoco2.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ extern int inserver;
#endif /* IKSD */

extern int tt_cursor; /* Cursor type */
extern int tt_status[]; /* Status line displayed ? */
extern int tt_status[VNUM]; /* Status line displayed ? */

extern unsigned char colorstatus ;
extern unsigned char colorselect ;
Expand Down
4 changes: 2 additions & 2 deletions kermit/k95/ckoco3.c
Original file line number Diff line number Diff line change
Expand Up @@ -3447,7 +3447,7 @@ void
sendcharsduplex(unsigned char * s, int len, int no_xlate ) {
int i,j,n ;
static unsigned char * sendbuf = NULL;
static buflen = 0;
static int buflen = 0;
unsigned char * bufptr, *stuffptr ;
CHAR * bytes = NULL;
int count = 1;
Expand Down Expand Up @@ -10708,7 +10708,7 @@ debugses( unsigned char ch )
void
cwrite(unsigned short ch) { /* Used by ckcnet.c for */
/* TELNET options debug display. */
static vt52esclen = 0 ;
static int vt52esclen = 0 ;
/*
Edit 190.
New code, supporting APC, and integrating escape sequence state switching
Expand Down
2 changes: 1 addition & 1 deletion kermit/k95/ckofio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2470,7 +2470,7 @@ zchdir(dirnam) char *dirnam; {
#ifndef NOSPL
if (nmac) { /* Any macros defined? */
int k; /* Yes */
static on_cd = 0;
static int on_cd = 0;
if ( !on_cd ) {
on_cd = 1;
k = mlook(mactab,"on_cd",nmac); /* Look this up */
Expand Down
4 changes: 2 additions & 2 deletions kermit/k95/ckonssh.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ int parse_displayname(char *displayname, int *familyp, char **hostp,
* this DLL provides.
* @param params SSH initialisation parameters from Kermit 95
*/
int _System ssh_dll_init(ssh_init_parameters_t *params) {
int CKSSHAPI ssh_dll_init(ssh_init_parameters_t *params) {
p_get_current_terminal_dimensions = params->p_get_current_terminal_dimensions;
p_get_current_terminal_type = params->p_get_current_terminal_type;
p_ssh_get_uid = params->p_ssh_get_uid;
Expand Down Expand Up @@ -483,7 +483,7 @@ int _System ssh_dll_init(ssh_init_parameters_t *params) {
#undef free
#undef strdup

static void
void
fatal(char *msg) {
if (!msg) msg = "";

Expand Down
25 changes: 16 additions & 9 deletions kermit/k95/ckop.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@

#include "p_type.h"
#include "p.h"
#ifdef XYZ_DLL
#define XYZ_DLL_CLIENT
#include "ckop.h"
#endif /* XYZ_DLL */
#include "p_global.h"
#include "p_callbk.h"
#include "p_common.h"
Expand All @@ -47,8 +50,7 @@ extern int rpackets, spackets, spktl, rpktl, what ;
#ifdef XYZ_DLL
#ifdef OS2
static HMODULE dll_handle;
typedef U32 (_System * p_transfer_t)(P_CFG *);
p_transfer_t p_transfer = NULL;
p_transfer_func *p_transfer = NULL;
#endif /* OS2 */

#define PINBUFSIZE 8192
Expand All @@ -71,7 +73,7 @@ load_p_dll(void) {
debug(F101,"load_p_dll - Unable to load module: rc","",rc);
return rc;
}
p_transfer = (p_transfer_t)GetProcAddress( dll_handle, "p_transfer" ) ;
p_transfer = (p_transfer_func *)GetProcAddress( dll_handle, "p_transfer" ) ;
if ( !p_transfer )
{
rc = GetLastError() ;
Expand Down Expand Up @@ -118,13 +120,15 @@ unload_p_dll(void) {
#endif /* XYZ_DLL */


U32 _System
U32
CKDEVAPI
pushback_func( U8 * buf, U32 len )
{
return le_puts( buf, len );
}

U32 _System
U32
CKDEVAPI
in_func( U8 * buf, U32 len, U32 * bytes_received )
{
extern int network, carrier;
Expand Down Expand Up @@ -172,7 +176,8 @@ in_func( U8 * buf, U32 len, U32 * bytes_received )
return(ERROR_NO_DATA); /* Either no data was received or timeout */
}

U32 _System
U32
CKDEVAPI
out_func( U8 * buf, U32 len, U32 * bytes_written )
{
int rc = 0 ;
Expand Down Expand Up @@ -205,7 +210,8 @@ USHORT DosDevIOCtl32(PVOID pData, USHORT cbData, PVOID pParms, USHORT cbParms,
USHORT usFunction, USHORT usCategory, HFILE hDevice);
#endif /* OS2ONLY */

U32 _System
U32
CKDEVAPI
break_func( U8 on )
{
extern int ttmdm ;
Expand Down Expand Up @@ -245,7 +251,8 @@ break_func( U8 on )
return 0;
}

U32 _System
U32
CKDEVAPI
available_func( U32 * available )
{
int rc = ttchk() ;
Expand All @@ -269,7 +276,7 @@ pxyz(int sstate) {
extern CK_TTYFD_T ttyfd;
extern int network;
#ifndef NOLOCAL
extern term_io;
extern int term_io;
int term_io_sav = term_io;
#endif /* NOLOCAL */
#ifdef TCPSOCKET
Expand Down
19 changes: 17 additions & 2 deletions kermit/k95/ckop.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,25 @@
/* You may modify, recompile and distribute this file freely. */
/*****************************************************************************/

#ifdef NT
#define CKDEVDLLENTRY
#else /* NT */
#ifdef OS2
#define CKDEVDLLENTRY _System
#else /* OS2 */
#define CKDEVDLLENTRY
#endif /* OS2 */
#endif /* NT */

typedef U32 CKDEVDLLENTRY p_transfer_func(P_CFG *);
#ifdef XYZ_DLL
extern U32 (_System * p_transfer)(P_CFG *);
#ifdef XYZ_DLL_CLIENT
extern p_transfer_func * p_transfer;
#else /* XYZ_DLL_CLIENT */
extern p_transfer_func p_transfer;
#endif /* XYZ_DLL_CLIENT */
#else /* XYZ_DLL */
U32 _System p_transfer(P_CFG *);
extern p_transfer_func p_transfer;
#endif /* XYZ_DLL */
extern int load_p_dll(void);
extern int unload_p_dll(void);
Expand Down
Loading

0 comments on commit 4c03203

Please sign in to comment.