From 505e15ae9a6468db8a9f9a0c11a344bc59e40347 Mon Sep 17 00:00:00 2001 From: Jiri Malak Date: Thu, 16 Jan 2025 23:10:49 +0100 Subject: [PATCH] crtl: correct definition for int86../int386../intdos.. and auxiliary functions now it uses pointer to constant object (input registers) with regards to appropriate changes in header files --- bld/clib/_dos/c/intd086.c | 2 +- bld/clib/_dos/c/intd386.c | 2 +- bld/clib/_dos/c/intdx086.c | 2 +- bld/clib/_dos/c/intdx386.c | 2 +- bld/clib/_dos/h/dodoscal.h | 4 ++-- bld/clib/intel/c/int386.c | 2 +- bld/clib/intel/c/intq16.c | 2 +- bld/clib/intel/c/intx086.c | 4 ++-- bld/clib/intel/c/intx386.c | 4 ++-- bld/clib/intel/c/intxq16.c | 2 +- bld/clib/intel/c/intxw32.c | 4 ++-- bld/lib_misc/h/clibxw32.h | 8 ++++---- bld/wattcp/src/wdpmi.c | 4 ++-- bld/win386/c/clib.c | 10 +++++----- 14 files changed, 26 insertions(+), 26 deletions(-) diff --git a/bld/clib/_dos/c/intd086.c b/bld/clib/_dos/c/intd086.c index b2180192d2..6190f6c003 100644 --- a/bld/clib/_dos/c/intd086.c +++ b/bld/clib/_dos/c/intd086.c @@ -37,7 +37,7 @@ #include "seterrno.h" -_WCRTLINK int intdos( union REGS *inregs, union REGS *outregs ) +_WCRTLINK int intdos( const union REGS *inregs, union REGS *outregs ) { int reg_ax; diff --git a/bld/clib/_dos/c/intd386.c b/bld/clib/_dos/c/intd386.c index 62d97ddcd6..14d1d94b92 100644 --- a/bld/clib/_dos/c/intd386.c +++ b/bld/clib/_dos/c/intd386.c @@ -41,7 +41,7 @@ #endif -_WCRTLINK int intdos( union REGS *inregs, union REGS *outregs ) +_WCRTLINK int intdos( const union REGS *inregs, union REGS *outregs ) { #if defined( __WINDOWS_386__ ) return( _clib_intdos( inregs, outregs ) ); diff --git a/bld/clib/_dos/c/intdx086.c b/bld/clib/_dos/c/intdx086.c index d7473476d0..f425c9fdeb 100644 --- a/bld/clib/_dos/c/intdx086.c +++ b/bld/clib/_dos/c/intdx086.c @@ -37,7 +37,7 @@ #include "seterrno.h" -_WCRTLINK int intdosx( union REGS *inregs, union REGS *outregs, struct SREGS *segregs ) +_WCRTLINK int intdosx( const union REGS *inregs, union REGS *outregs, struct SREGS *segregs ) { int reg_ax; diff --git a/bld/clib/_dos/c/intdx386.c b/bld/clib/_dos/c/intdx386.c index 31cef27d5d..ed797566c9 100644 --- a/bld/clib/_dos/c/intdx386.c +++ b/bld/clib/_dos/c/intdx386.c @@ -41,7 +41,7 @@ #endif -_WCRTLINK int intdosx( union REGS *inregs, union REGS *outregs, struct SREGS *segregs ) +_WCRTLINK int intdosx( const union REGS *inregs, union REGS *outregs, struct SREGS *segregs ) { #if defined( __WINDOWS_386__ ) return( _clib_intdosx( inregs, outregs, segregs ) ); diff --git a/bld/clib/_dos/h/dodoscal.h b/bld/clib/_dos/h/dodoscal.h index 466df94038..b234d917ff 100644 --- a/bld/clib/_dos/h/dodoscal.h +++ b/bld/clib/_dos/h/dodoscal.h @@ -37,8 +37,8 @@ #define WIN386FAR #endif -extern int DoDosCall( union REGS WIN386FAR *in, union REGS WIN386FAR *out ); -extern int DoDosxCall( union REGS WIN386FAR *in, union REGS WIN386FAR *out, struct SREGS WIN386FAR *sr ); +extern int DoDosCall( const union REGS WIN386FAR *in, union REGS WIN386FAR *out ); +extern int DoDosxCall( const union REGS WIN386FAR *in, union REGS WIN386FAR *out, struct SREGS WIN386FAR *sr ); #if defined( _M_I86 ) diff --git a/bld/clib/intel/c/int386.c b/bld/clib/intel/c/int386.c index 2057463084..2b98ead8a5 100644 --- a/bld/clib/intel/c/int386.c +++ b/bld/clib/intel/c/int386.c @@ -34,7 +34,7 @@ #include -_WCRTLINK int int386( int intno, union REGS *inregs, union REGS *outregs ) +_WCRTLINK int int386( int intno, const union REGS *inregs, union REGS *outregs ) { struct SREGS segregs; diff --git a/bld/clib/intel/c/intq16.c b/bld/clib/intel/c/intq16.c index ea19c0342d..9ea1170826 100644 --- a/bld/clib/intel/c/intq16.c +++ b/bld/clib/intel/c/intq16.c @@ -33,7 +33,7 @@ #include "variety.h" #include -_WCRTLINK int (int86)( int intno, union REGS *inregs, union REGS *outregs ) +_WCRTLINK int (int86)( int intno, const union REGS *inregs, union REGS *outregs ) { struct SREGS segregs; diff --git a/bld/clib/intel/c/intx086.c b/bld/clib/intel/c/intx086.c index d6b771f4ab..dd78219b56 100644 --- a/bld/clib/intel/c/intx086.c +++ b/bld/clib/intel/c/intx086.c @@ -36,7 +36,7 @@ #include "dointr.h" -_WCRTLINK int int86x( int intno, union REGS *inregs, union REGS *outregs, struct SREGS *segregs ) +_WCRTLINK int int86x( int intno, const union REGS *inregs, union REGS *outregs, struct SREGS *segregs ) { union REGPACK regs; @@ -65,7 +65,7 @@ _WCRTLINK int int86x( int intno, union REGS *inregs, union REGS *outregs, struct return( regs.x.ax ); } -_WCRTLINK int int86( int intno, union REGS *inregs, union REGS *outregs ) +_WCRTLINK int int86( int intno, const union REGS *inregs, union REGS *outregs ) { struct SREGS segregs; diff --git a/bld/clib/intel/c/intx386.c b/bld/clib/intel/c/intx386.c index 37f223ca8d..d547966756 100644 --- a/bld/clib/intel/c/intx386.c +++ b/bld/clib/intel/c/intx386.c @@ -35,13 +35,13 @@ #include -extern void __int386x( unsigned char intno, void _WCNEAR *inregs, void _WCNEAR *outregs, void _WCNEAR *segregs ); +extern void __int386x( unsigned char intno, const void _WCNEAR *inregs, void _WCNEAR *outregs, void _WCNEAR *segregs ); #pragma aux __int386x "*_" \ __parm __caller [__eax] [__edi] [__edx] [__ebx] \ __modify [__ecx __esi] -_WCRTLINK int int386x( int intno, union REGS *inregs, union REGS *outregs, struct SREGS *segregs ) +_WCRTLINK int int386x( int intno, const union REGS *inregs, union REGS *outregs, struct SREGS *segregs ) { __int386x( intno, inregs, outregs, segregs ); return( outregs->x.eax ); diff --git a/bld/clib/intel/c/intxq16.c b/bld/clib/intel/c/intxq16.c index 93e89ad154..b1369a190f 100644 --- a/bld/clib/intel/c/intxq16.c +++ b/bld/clib/intel/c/intxq16.c @@ -36,7 +36,7 @@ _WCRTLINK int (int86x)( int intno, - union REGS *inregs, + const union REGS *inregs, union REGS *outregs, struct SREGS *segregs ) { diff --git a/bld/clib/intel/c/intxw32.c b/bld/clib/intel/c/intxw32.c index dbdaff8144..ebaa0dd5bb 100644 --- a/bld/clib/intel/c/intxw32.c +++ b/bld/clib/intel/c/intxw32.c @@ -36,12 +36,12 @@ #include "clibxw32.h" -_WCRTLINK int int86( int intno, union REGS *inregs, union REGS *outregs ) +_WCRTLINK int int86( int intno, const union REGS *inregs, union REGS *outregs ) { return( _clib_int86( intno, inregs, outregs ) ); } -_WCRTLINK int int86x( int intno, union REGS *inregs, union REGS *outregs, struct SREGS *segregs ) +_WCRTLINK int int86x( int intno, const union REGS *inregs, union REGS *outregs, struct SREGS *segregs ) { return( _clib_int86x( intno, inregs, outregs, segregs ) ); } diff --git a/bld/lib_misc/h/clibxw32.h b/bld/lib_misc/h/clibxw32.h index 7584afe1fd..e27dbaf1ad 100644 --- a/bld/lib_misc/h/clibxw32.h +++ b/bld/lib_misc/h/clibxw32.h @@ -37,10 +37,10 @@ #define _FAR #endif -extern int _FAR __pascal _clib_intdos( union REGS _FAR *in_regs, union REGS _FAR *out_regs ); -extern int _FAR __pascal _clib_intdosx( union REGS _FAR *in_regs, union REGS _FAR *out_regs, struct SREGS _FAR *seg_regs ); -extern int _FAR __pascal _clib_int86( int inter_no, union REGS _FAR *in_regs, union REGS _FAR *out_regs ); -extern int _FAR __pascal _clib_int86x( int inter_no, union REGS _FAR *in_regs, union REGS _FAR *out_regs, struct SREGS _FAR *seg_regs ); +extern int _FAR __pascal _clib_intdos( const union REGS _FAR *in_regs, union REGS _FAR *out_regs ); +extern int _FAR __pascal _clib_intdosx( const union REGS _FAR *in_regs, union REGS _FAR *out_regs, struct SREGS _FAR *seg_regs ); +extern int _FAR __pascal _clib_int86( int inter_no, const union REGS _FAR *in_regs, union REGS _FAR *out_regs ); +extern int _FAR __pascal _clib_int86x( int inter_no, const union REGS _FAR *in_regs, union REGS _FAR *out_regs, struct SREGS _FAR *seg_regs ); extern void _FAR __pascal _clib_intr( int inter_no, union REGPACK _FAR *regs ); extern void _FAR __pascal _clib_intrf( int inter_no, union REGPACK _FAR *regs ); extern unsigned _FAR __pascal _clib_dos_findfirst( char _FAR *__path,unsigned __attr, struct find_t _FAR *__buf ); diff --git a/bld/wattcp/src/wdpmi.c b/bld/wattcp/src/wdpmi.c index 8996b53464..3c50637a2d 100644 --- a/bld/wattcp/src/wdpmi.c +++ b/bld/wattcp/src/wdpmi.c @@ -288,7 +288,7 @@ int dpmi_dos_yield (void) return (-1); } - int int386 (int intno, union REGS *ireg, union REGS *oreg) + int int386 (int intno, const union REGS *ireg, union REGS *oreg) { struct SREGS sreg; @@ -296,7 +296,7 @@ int dpmi_dos_yield (void) return int386x (intno, ireg, oreg, &sreg); } - int int386x (int intno, union REGS *ireg, union REGS *oreg, struct SREGS *sreg) + int int386x (int intno, const union REGS *ireg, union REGS *oreg, struct SREGS *sreg) { static struct DPMI_regs rm_reg; diff --git a/bld/win386/c/clib.c b/bld/win386/c/clib.c index cc9b8ac679..c3003bb05f 100644 --- a/bld/win386/c/clib.c +++ b/bld/win386/c/clib.c @@ -56,7 +56,7 @@ * here lie all interrupt functions */ -int __far __pascal _clib_intdos( union REGS __far *inregs, union REGS __far *outregs ) +int __far __pascal _clib_intdos( const union REGS __far *inregs, union REGS __far *outregs ) { int reg_ax; @@ -66,7 +66,7 @@ int __far __pascal _clib_intdos( union REGS __far *inregs, union REGS __far *out return( reg_ax ); } -int __far __pascal _clib_intdosx( union REGS __far *inregs, union REGS __far *outregs, +int __far __pascal _clib_intdosx( const union REGS __far *inregs, union REGS __far *outregs, struct SREGS __far *segregs ) { int reg_ax; @@ -77,7 +77,7 @@ int __far __pascal _clib_intdosx( union REGS __far *inregs, union REGS __far *ou return( reg_ax ); } -static int __int86x( int intno, union REGS __far *inregs, union REGS __far *outregs, +static int __int86x( int intno, const union REGS __far *inregs, union REGS __far *outregs, struct SREGS __far *segregs ) { union REGPACK regs; @@ -107,7 +107,7 @@ static int __int86x( int intno, union REGS __far *inregs, union REGS __far *outr return( regs.x.ax ); } -int __far __pascal _clib_int86( int intno, union REGS __far *inregs, +int __far __pascal _clib_int86( int intno, const union REGS __far *inregs, union REGS __far *outregs ) { #ifdef DLL32 @@ -120,7 +120,7 @@ int __far __pascal _clib_int86( int intno, union REGS __far *inregs, return( __int86x( intno, inregs, outregs, &segregs ) ); } -int __far __pascal _clib_int86x( int intno, union REGS __far *inregs, +int __far __pascal _clib_int86x( int intno, const union REGS __far *inregs, union REGS __far *outregs, struct SREGS __far *segregs ) { return( __int86x( intno, inregs, outregs, segregs ) );