Skip to content

Commit 58573d6

Browse files
jmalakPerditionC
authored andcommitted
tc2-build: correct various build breaks for Turbo C 2.0 build
1 parent d6c50eb commit 58573d6

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

kernel/config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2759,7 +2759,7 @@ STATIC void deletevar(BYTE far * pp) {
27592759
if (NULL == pp)
27602760
return;
27612761
variablelength = fstrlen(pp) + 1;
2762-
fmemcpy(pp, pp + variablelength, envp + 3 - (pp + variablelength));
2762+
fmemcpy(pp, pp + variablelength, (unsigned)(envp + 3 - (pp + variablelength)));
27632763
/* our fmemcpy always copies forwards */
27642764
envp -= variablelength;
27652765
return;

kernel/inthndlr.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ VOID ASMCFUNC int21_service(iregs FAR * r)
16401640
}
16411641
}
16421642
/* call to redirector */
1643-
saved_r = *r;
1643+
fmemcpy(&saved_r, r, sizeof(saved_r));
16441644
r->ES = FP_SEG(s);
16451645
r->DI = FP_OFF(s);
16461646
r->flags |= FLG_CARRY;
@@ -1652,9 +1652,8 @@ VOID ASMCFUNC int21_service(iregs FAR * r)
16521652
goto real_exit;
16531653
}
16541654
/* carry still set - unhandled */
1655-
*r = saved_r;
1655+
fmemcpy(r, &saved_r, sizeof(saved_r));
16561656
goto unsupp;
1657-
break;
16581657
}
16591658
#ifdef WITHLFNAPI
16601659
/* Win95 LFN - Win95 64 UTC file time to/from DOS date and time (local timezone) */
@@ -1682,7 +1681,6 @@ VOID ASMCFUNC int21_service(iregs FAR * r)
16821681
default:
16831682
goto unsupp;
16841683
}
1685-
break;
16861684
#ifdef WITHLFNAPI
16871685
/* Win95 beta LFN - find close */
16881686
case 0x72: goto lfn_findclose;
@@ -1942,7 +1940,7 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs FAR *pr)
19421940
size = ~offs; /* BX for query HMA */
19431941
if (r.AL == 0x02) /* allocate HMA space */
19441942
{
1945-
tsize = (r.BX + 0xf) & 0xfffffff0; /* align to paragraph */
1943+
tsize = (r.BX + 0xf) & 0xfffffff0UL; /* align to paragraph */
19461944
if (tsize < size)
19471945
size = (UWORD)tsize;
19481946
AllocateHMASpace(offs, offs+size);

kernel/makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ initclk.obj: initclk.c $(INITHEADERS) $(TARGET).lnk
155155

156156
#the string functions for INIT_TEXT
157157
iasmsupt.obj: asmsupt.asm $(TARGET).lnk
158-
$(NASM) -D$(COMPILER) -D_INIT -f obj $(NASMFLAGS) -o $@ asmsupt.asm
158+
$(NASM) -D$(COMPILER) -D_INIT -f obj $(NASMFLAGS) -o iasmsupt.obj asmsupt.asm
159159

160160
#the printf for INIT_TEXT - yet another special case, this file includes prf.c
161161
iprf.obj: iprf.c prf.c $(HDR)portab.h $(TARGET).lnk

kernel/newstuff.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,10 @@ COUNT truename(const char FAR * src, char * dest, COUNT mode)
321321
so we know src in the form of X:?
322322
fail if anything other than no path or path is \DEV\
323323
*/
324-
char drivesep[] = "\\/";
325324
const char FAR *s = src+2;
326-
const char *d = strchr(drivesep, *s); /* ?path starts with \ or / */
327-
325+
char c = *s;
326+
327+
if( c != '\\' && c != '/' ) c = '\0';
328328
/* could be 1 letter devicename, don't go scanning random memory */
329329
if (*(src+3) != '\0')
330330
{
@@ -336,7 +336,7 @@ COUNT truename(const char FAR * src, char * dest, COUNT mode)
336336
s = NULL;
337337
}
338338

339-
if (d == NULL)
339+
if (c == '\0')
340340
{
341341
/* either X:devicename or X:path\devicename */
342342
if (s != NULL) goto invalid_path;
@@ -712,7 +712,7 @@ if exist report.out del report.out
712712
cmdspy stop
713713
cmdspy flush
714714
cmdspy restart
715-
int ax=0x6000 -buf ds:si="abcöflkgsxkf\0" -buf es:di="%256s" -int 0x21 -d es:di:128 >spy_int.out
715+
int ax=0x6000 -buf ds:si="abcöflkgsxkf\0" -buf es:di="%256s" -int 0x21 -d es:di:128 >spy_int.out
716716
cmdspy stop
717717
cmdspy report report.out
718718
more report.out
@@ -732,11 +732,11 @@ more report.out
732732
1123: IN: C:\TOOL\INT.COM [FAIL 0001]
733733
1123: OUT: C:\INTRSPY\SPY_INT.OUT
734734
1123: orig buffer: C:\TOOL\INT.COM
735-
1123: IN: abcöflkgsxkf [FAIL 0001]
735+
1123: IN: abcöflkgsxkf [FAIL 0001]
736736
1123: OUT: C:\TOOL\INT.COM
737-
1123: orig buffer: abcöflkgsxkf
737+
1123: orig buffer: abcöflkgsxkf
738738
1123: IN: C:\INTRSPY\SPY_INT.BAT [FAIL 0001]
739-
1123: OUT: C:\INTRSPY\ABCÖFLKG
739+
1123: OUT: C:\INTRSPY\ABCÖFLKG
740740
1123: orig buffer: C:\INTRSPY\SPY_INT.BAT
741741
1123: IN: cmdspy.??? [FAIL 0001]
742742
1123: OUT: C:\INTRSPY
@@ -758,7 +758,7 @@ DOSERR: 0000 (0)
758758
759759
*<es:di:128> {
760760
43(C) 3A(:) 5C(\) 49(I) 4E(N) 54(T) 52(R) 53(S) 50(P) 59(Y) 5C(\) 41(A)
761-
42(B) 43(C) 99(Ö) 46(F) 4C(L) 4B(K) 47(G) 00(.) 3D(=) 30(0) 30(0) 30(0)
761+
42(B) 43(C) 99(Ö) 46(F) 4C(L) 4B(K) 47(G) 00(.) 3D(=) 30(0) 30(0) 30(0)
762762
30(0) 20( ) 20( ) 20( ) 43(C) 58(X) 3D(=) 30(0) 30(0) 30(0) 30(0) 28(()
763763
30(0) 29()) 20( ) 32(2) 38(8) 28(() 28(() 29()) 20( ) 33(3) 30(0) 28(()
764764
30(0) 29()) 20( ) 32(2) 39(9) 28(() 29()) 29()) 20( ) 32(2) 30(0) 28(()

0 commit comments

Comments
 (0)