Skip to content

Commit 580b6bd

Browse files
committed
f77-wfc: use args_num data type
1 parent 2bc03c3 commit 580b6bd

File tree

4 files changed

+25
-24
lines changed

4 files changed

+25
-24
lines changed

bld/f77/wfc/c/fccall.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Open Watcom Project
44
*
5-
* Copyright (c) 2002-2025 The Open Watcom Contributors. All Rights Reserved.
5+
* Copyright (c) 2002-2026 The Open Watcom Contributors. All Rights Reserved.
66
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
77
*
88
* ========================================================================
@@ -486,7 +486,7 @@ void FCCall( void )
486486
{
487487
sym_id sp;
488488
sym_id scb;
489-
uint num_args;
489+
args_num argc;
490490
uint idx;
491491
call_handle call;
492492
cg_type sp_cgtyp;
@@ -518,17 +518,17 @@ void FCCall( void )
518518
} else {
519519
rtn = CGFEName( sp, sp_cgtyp );
520520
}
521-
num_args = GetU16();
522-
if( num_args == 0 ) {
521+
argc = GetU16();
522+
if( argc == 0 ) {
523523
arg_vec = NULL;
524524
} else {
525-
// We need num_args + 1 because we use NULL at the end
526-
arg_vec = FMemAlloc( ( num_args + 1 ) * sizeof( cg_name ) );
525+
// We need argc + 1 because we use NULL at the end
526+
arg_vec = FMemAlloc( ( argc + 1 ) * sizeof( cg_name ) );
527527
}
528528
call = CGInitCall( rtn, sp_cgtyp, sp );
529529
if( sp->u.ns.flags & SY_INTRINSIC ) {
530530
if( IFVarArgs( sp->u.ns.si.fi.index ) ) {
531-
CGAddParm( call, CGInteger( num_args, TY_INTEGER ), TY_INTEGER );
531+
CGAddParm( call, CGInteger( argc, TY_INTEGER ), TY_INTEGER );
532532
}
533533
} else if( (sp->u.ns.flags & SY_SUBPROG_TYPE) == SY_FUNCTION ) {
534534
if( (Options & OPT_DESCRIPTOR) == 0
@@ -545,7 +545,7 @@ void FCCall( void )
545545
}
546546
}
547547
idx = 0;
548-
for( ; num_args != 0; --num_args ) {
548+
for( ; argc != 0; --argc ) {
549549
arg_info = GetU16();
550550
ptyp = _GetArgInfoPtyp( arg_info );
551551
pcode = _GetArgInfoPcode( arg_info );

bld/f77/wfc/c/fcstring.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Open Watcom Project
44
*
5-
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
5+
* Copyright (c) 2002-2026 The Open Watcom Contributors. All Rights Reserved.
66
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
77
*
88
* ========================================================================
@@ -95,31 +95,31 @@ cg_name SCBLength( cg_name scb )
9595
}
9696

9797

98-
cg_name Concat( uint num_args, cg_name dest )
98+
cg_name Concat( args_num argc, cg_name dest )
9999
//===========================================
100100
// Do concatenation operation.
101101
{
102-
uint count;
102+
args_num i;
103103
call_handle call;
104104
cg_name dest_1;
105105
cg_name dest_2;
106106

107-
if( num_args & CAT_TEMP ) {
107+
if( argc & CAT_TEMP ) {
108108
call = InitCall( RT_TCAT );
109-
num_args &= ~CAT_TEMP;
110-
} else if( num_args == 1 ) {
109+
argc &= ~CAT_TEMP;
110+
} else if( argc == 1 ) {
111111
call = InitCall( RT_MOVE );
112112
} else {
113113
call = InitCall( RT_CAT );
114114
}
115-
for( count = num_args; count > 0; --count ) {
116-
CGAddParm( call, StkElement( count ), TY_LOCAL_POINTER );
115+
for( i = argc; i > 0; --i ) {
116+
CGAddParm( call, StkElement( i ), TY_LOCAL_POINTER );
117117
}
118-
PopStkElements( num_args );
118+
PopStkElements( argc );
119119
CloneCGName( dest, &dest_1, &dest_2 );
120120
CGAddParm( call, dest_1, TY_LOCAL_POINTER );
121-
if( num_args != 1 ) {
122-
CGAddParm( call, CGInteger( num_args, TY_UNSIGNED ), TY_UNSIGNED );
121+
if( argc != 1 ) {
122+
CGAddParm( call, CGInteger( argc, TY_UNSIGNED ), TY_UNSIGNED );
123123
}
124124
return( CGBinary( O_COMMA, CGCall( call ), dest_2, TY_LOCAL_POINTER ) );
125125
}

bld/f77/wfc/c/gsubprog.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Open Watcom Project
44
*
5-
* Copyright (c) 2002-2025 The Open Watcom Contributors. All Rights Reserved.
5+
* Copyright (c) 2002-2026 The Open Watcom Contributors. All Rights Reserved.
66
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
77
*
88
* ========================================================================
@@ -70,7 +70,7 @@ void GBegCall( itnode *itptr )
7070
{
7171
sym_id sp;
7272
obj_ptr curr_obj;
73-
int num_args;
73+
args_num argc;
7474

7575
sp = itptr->sym_ptr;
7676
#if _CPU == 386
@@ -89,9 +89,9 @@ void GBegCall( itnode *itptr )
8989
}
9090
}
9191
}
92-
num_args = DumpArgInfo( itptr->list );
92+
argc = DumpArgInfo( itptr->list );
9393
curr_obj = ObjSeek( curr_obj );
94-
OutU16( num_args );
94+
OutU16( argc );
9595
ObjSeek( curr_obj );
9696
if( (sp->u.ns.flags & SY_SUBPROG_TYPE) == SY_FUNCTION ) {
9797
if( sp->u.ns.u1.s.typ == FT_CHAR ) {

bld/f77/wfc/h/fcstring.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*
33
* Open Watcom Project
44
*
5+
* Copyright (c) 2026 The Open Watcom Contributors. All Rights Reserved.
56
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
67
*
78
* ========================================================================
@@ -34,5 +35,5 @@ extern cg_name SCBPointer( cg_name scb );
3435
extern cg_name SCBLenAddr( cg_name scb );
3536
extern cg_name SCBFlagsAddr( cg_name scb );
3637
extern cg_name SCBLength( cg_name scb );
37-
extern cg_name Concat( uint num_args, cg_name dest );
38+
extern cg_name Concat( args_num argc, cg_name dest );
3839
extern cg_name CharItemLen( sym_id sym );

0 commit comments

Comments
 (0)