tc2-build: correct various build breaks for Turbo C 2.0 build

This commit is contained in:
Jiri Malak 2024-07-13 23:38:35 +02:00 committed by Kenneth J Davis
parent d6c50ebbe6
commit 58573d69d9
4 changed files with 14 additions and 16 deletions

View File

@ -2759,7 +2759,7 @@ STATIC void deletevar(BYTE far * pp) {
if (NULL == pp) if (NULL == pp)
return; return;
variablelength = fstrlen(pp) + 1; variablelength = fstrlen(pp) + 1;
fmemcpy(pp, pp + variablelength, envp + 3 - (pp + variablelength)); fmemcpy(pp, pp + variablelength, (unsigned)(envp + 3 - (pp + variablelength)));
/* our fmemcpy always copies forwards */ /* our fmemcpy always copies forwards */
envp -= variablelength; envp -= variablelength;
return; return;

View File

@ -1640,7 +1640,7 @@ lfn_findclose:
} }
} }
/* call to redirector */ /* call to redirector */
saved_r = *r; fmemcpy(&saved_r, r, sizeof(saved_r));
r->ES = FP_SEG(s); r->ES = FP_SEG(s);
r->DI = FP_OFF(s); r->DI = FP_OFF(s);
r->flags |= FLG_CARRY; r->flags |= FLG_CARRY;
@ -1652,9 +1652,8 @@ lfn_findclose:
goto real_exit; goto real_exit;
} }
/* carry still set - unhandled */ /* carry still set - unhandled */
*r = saved_r; fmemcpy(r, &saved_r, sizeof(saved_r));
goto unsupp; goto unsupp;
break;
} }
#ifdef WITHLFNAPI #ifdef WITHLFNAPI
/* Win95 LFN - Win95 64 UTC file time to/from DOS date and time (local timezone) */ /* Win95 LFN - Win95 64 UTC file time to/from DOS date and time (local timezone) */
@ -1682,7 +1681,6 @@ lfn_findclose:
default: default:
goto unsupp; goto unsupp;
} }
break;
#ifdef WITHLFNAPI #ifdef WITHLFNAPI
/* Win95 beta LFN - find close */ /* Win95 beta LFN - find close */
case 0x72: goto lfn_findclose; case 0x72: goto lfn_findclose;
@ -1942,7 +1940,7 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr)
size = ~offs; /* BX for query HMA */ size = ~offs; /* BX for query HMA */
if (r.AL == 0x02) /* allocate HMA space */ if (r.AL == 0x02) /* allocate HMA space */
{ {
tsize = (r.BX + 0xf) & 0xfffffff0; /* align to paragraph */ tsize = (r.BX + 0xf) & 0xfffffff0UL; /* align to paragraph */
if (tsize < size) if (tsize < size)
size = (UWORD)tsize; size = (UWORD)tsize;
AllocateHMASpace(offs, offs+size); AllocateHMASpace(offs, offs+size);

View File

@ -155,7 +155,7 @@ initclk.obj: initclk.c $(INITHEADERS) $(TARGET).lnk
#the string functions for INIT_TEXT #the string functions for INIT_TEXT
iasmsupt.obj: asmsupt.asm $(TARGET).lnk iasmsupt.obj: asmsupt.asm $(TARGET).lnk
$(NASM) -D$(COMPILER) -D_INIT -f obj $(NASMFLAGS) -o $@ asmsupt.asm $(NASM) -D$(COMPILER) -D_INIT -f obj $(NASMFLAGS) -o iasmsupt.obj asmsupt.asm
#the printf for INIT_TEXT - yet another special case, this file includes prf.c #the printf for INIT_TEXT - yet another special case, this file includes prf.c
iprf.obj: iprf.c prf.c $(HDR)portab.h $(TARGET).lnk iprf.obj: iprf.c prf.c $(HDR)portab.h $(TARGET).lnk

View File

@ -321,10 +321,10 @@ COUNT truename(const char FAR * src, char * dest, COUNT mode)
so we know src in the form of X:? so we know src in the form of X:?
fail if anything other than no path or path is \DEV\ fail if anything other than no path or path is \DEV\
*/ */
char drivesep[] = "\\/";
const char FAR *s = src+2; const char FAR *s = src+2;
const char *d = strchr(drivesep, *s); /* ?path starts with \ or / */ char c = *s;
if( c != '\\' && c != '/' ) c = '\0';
/* could be 1 letter devicename, don't go scanning random memory */ /* could be 1 letter devicename, don't go scanning random memory */
if (*(src+3) != '\0') if (*(src+3) != '\0')
{ {
@ -336,7 +336,7 @@ COUNT truename(const char FAR * src, char * dest, COUNT mode)
s = NULL; s = NULL;
} }
if (d == NULL) if (c == '\0')
{ {
/* either X:devicename or X:path\devicename */ /* either X:devicename or X:path\devicename */
if (s != NULL) goto invalid_path; if (s != NULL) goto invalid_path;
@ -712,7 +712,7 @@ if exist report.out del report.out
cmdspy stop cmdspy stop
cmdspy flush cmdspy flush
cmdspy restart cmdspy restart
int ax=0x6000 -buf ds:si="abcöflkgsxkf\0" -buf es:di="%256s" -int 0x21 -d es:di:128 >spy_int.out int ax=0x6000 -buf ds:si="abcöflkgsxkf\0" -buf es:di="%256s" -int 0x21 -d es:di:128 >spy_int.out
cmdspy stop cmdspy stop
cmdspy report report.out cmdspy report report.out
more report.out more report.out
@ -732,11 +732,11 @@ more report.out
1123: IN: C:\TOOL\INT.COM [FAIL 0001] 1123: IN: C:\TOOL\INT.COM [FAIL 0001]
1123: OUT: C:\INTRSPY\SPY_INT.OUT 1123: OUT: C:\INTRSPY\SPY_INT.OUT
1123: orig buffer: C:\TOOL\INT.COM 1123: orig buffer: C:\TOOL\INT.COM
1123: IN: abcöflkgsxkf [FAIL 0001] 1123: IN: abcöflkgsxkf [FAIL 0001]
1123: OUT: C:\TOOL\INT.COM 1123: OUT: C:\TOOL\INT.COM
1123: orig buffer: abcöflkgsxkf 1123: orig buffer: abcöflkgsxkf
1123: IN: C:\INTRSPY\SPY_INT.BAT [FAIL 0001] 1123: IN: C:\INTRSPY\SPY_INT.BAT [FAIL 0001]
1123: OUT: C:\INTRSPY\ABCÖFLKG 1123: OUT: C:\INTRSPY\ABCÖFLKG
1123: orig buffer: C:\INTRSPY\SPY_INT.BAT 1123: orig buffer: C:\INTRSPY\SPY_INT.BAT
1123: IN: cmdspy.??? [FAIL 0001] 1123: IN: cmdspy.??? [FAIL 0001]
1123: OUT: C:\INTRSPY 1123: OUT: C:\INTRSPY
@ -758,7 +758,7 @@ DOSERR: 0000 (0)
*<es:di:128> { *<es:di:128> {
43(C) 3A(:) 5C(\) 49(I) 4E(N) 54(T) 52(R) 53(S) 50(P) 59(Y) 5C(\) 41(A) 43(C) 3A(:) 5C(\) 49(I) 4E(N) 54(T) 52(R) 53(S) 50(P) 59(Y) 5C(\) 41(A)
42(B) 43(C) 99(Ö) 46(F) 4C(L) 4B(K) 47(G) 00(.) 3D(=) 30(0) 30(0) 30(0) 42(B) 43(C) 99(Ö) 46(F) 4C(L) 4B(K) 47(G) 00(.) 3D(=) 30(0) 30(0) 30(0)
30(0) 20( ) 20( ) 20( ) 43(C) 58(X) 3D(=) 30(0) 30(0) 30(0) 30(0) 28(() 30(0) 20( ) 20( ) 20( ) 43(C) 58(X) 3D(=) 30(0) 30(0) 30(0) 30(0) 28(()
30(0) 29()) 20( ) 32(2) 38(8) 28(() 28(() 29()) 20( ) 33(3) 30(0) 28(() 30(0) 29()) 20( ) 32(2) 38(8) 28(() 28(() 29()) 20( ) 33(3) 30(0) 28(()
30(0) 29()) 20( ) 32(2) 39(9) 28(() 29()) 29()) 20( ) 32(2) 30(0) 28(() 30(0) 29()) 20( ) 32(2) 39(9) 28(() 29()) 29()) 20( ) 32(2) 30(0) 28(()