Subject: bin/2526: compilation of gnu/usr.bin/dc fails
To: None <gnats-bugs@NetBSD.ORG>
From: Matthias Scheler <tron@sandra.owl.de>
List: netbsd-bugs
Date: 06/07/1996 20:45:20
>Number:         2526
>Category:       bin
>Synopsis:       compilation of gnu/usr.bin/dc fails
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun  7 15:05:01 1996
>Last-Modified:
>Originator:     Matthias Scheler
>Organization:
Matthias Scheler
tron@sandra.owl.de
>Release:        1.2_ALPHA
>Environment:
System: NetBSD sandra 1.2_ALPHA NetBSD 1.2_ALPHA (SANDRA) #0: Fri Jun 7 15:06:39 MET DST 1996 tron@sandra:/usr/src/sys/arch/i386/compile/SANDRA i386


>Description:
After the recent changes to "src/usr.bin/bc/number.c" the compilation of
"gnu/usr.bin/dc" fails.

>How-To-Repeat:
cd src/gnu/usr.bin/gnu/dc
make depend all

>Fix:
*** src/gnu/usr.bin/dc/dc-number.c.old	Sat Oct 14 01:13:11 1995
--- src/gnu/usr.bin/dc/dc-number.c	Fri Jun  7 20:30:50 1996
*************** dc_add DC_DECLARG((a, b, kscale, result)
*** 45,51 ****
  	dc_num *result DC_DECLEND
  {
  	init_num((bc_num *)result);
! 	bc_add(CastNum(a), CastNum(b), (bc_num *)result);
  	return DC_SUCCESS;
  }
  
--- 45,51 ----
  	dc_num *result DC_DECLEND
  {
  	init_num((bc_num *)result);
! 	bc_add(CastNum(a), CastNum(b), (bc_num *)result,0 );
  	return DC_SUCCESS;
  }
  
*************** dc_sub DC_DECLARG((a, b, kscale, result)
*** 60,66 ****
  	dc_num *result DC_DECLEND
  {
  	init_num((bc_num *)result);
! 	bc_sub(CastNum(a), CastNum(b), (bc_num *)result);
  	return DC_SUCCESS;
  }
  
--- 60,66 ----
  	dc_num *result DC_DECLEND
  {
  	init_num((bc_num *)result);
! 	bc_sub(CastNum(a), CastNum(b), (bc_num *)result, 0);
  	return DC_SUCCESS;
  }
  
*************** dc_getnum DC_DECLARG((input, ibase, read
*** 248,254 ****
  		c = (*input)();
  		int2num(&tmp, digit);
  		bc_multiply(result, base, &result, 0);
! 		bc_add(result, tmp, &result);
  	}
  	if (c == '.'){
  		free_num(&build);
--- 248,254 ----
  		c = (*input)();
  		int2num(&tmp, digit);
  		bc_multiply(result, base, &result, 0);
! 		bc_add(result, tmp, &result, 0);
  	}
  	if (c == '.'){
  		free_num(&build);
*************** dc_getnum DC_DECLARG((input, ibase, read
*** 266,281 ****
  				break;
  			int2num(&tmp, digit);
  			bc_multiply(build, base, &build, 0);
! 			bc_add(build, tmp, &build);
  			bc_multiply(divisor, base, &divisor, 0);
  			++decimal;
  		}
  		bc_divide(build, divisor, &build, decimal);
! 		bc_add(result, build, &result);
  	}
  	/* Final work. */
  	if (negative)
! 		bc_sub(_zero_, result, &result);
  
  	free_num(&tmp);
  	free_num(&build);
--- 266,281 ----
  				break;
  			int2num(&tmp, digit);
  			bc_multiply(build, base, &build, 0);
! 			bc_add(build, tmp, &build, 0);
  			bc_multiply(divisor, base, &divisor, 0);
  			++decimal;
  		}
  		bc_divide(build, divisor, &build, decimal);
! 		bc_add(result, build, &result, 0);
  	}
  	/* Final work. */
  	if (negative)
! 		bc_sub(_zero_, result, &result, 0);
  
  	free_num(&tmp);
  	free_num(&build);
*** src/gnu/usr.bin/dc/misc.c.old	Sat Oct 14 01:13:15 1995
--- src/gnu/usr.bin/dc/misc.c	Fri Jun  7 20:34:14 1996
***************
*** 61,66 ****
--- 61,68 ----
  
  const char *progname;	/* basename of program invocation */
  
+ char std_only = 0;
+ 
  /* your generic usage function */
  static void
  usage DC_DECLARG((f))
>Audit-Trail:
>Unformatted: