Files correlati : Ricompilazione Demo : [ ] Commento : Aggiunti i sorgenti per Greenleaf Math Library (gfm.dll) git-svn-id: svn://10.65.10.50/trunk@10079 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			63 lines
		
	
	
		
			901 B
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			901 B
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
| /* DEC	**ZeroDecimalArray(dst,	n);
 | |
|  *
 | |
|  * ARGUMENT
 | |
|  *	DEC	**dst;
 | |
|  *	int	n;
 | |
|  *
 | |
|  * DESCRIPTION
 | |
|  *	Sets each element in an	array of n DEC pointers	to 0 with id 2.
 | |
|  *
 | |
|  * SIDE	EFFECTS
 | |
|  *	None.
 | |
|  *
 | |
|  * RETURNS
 | |
|  *	Returns	dst if successful,
 | |
|  *   otherwise returns GM_NULLARR.
 | |
|  *
 | |
|  * POSSIBLE ERROR CODES
 | |
|  *
 | |
|  *	GM_NULLPOINTER
 | |
|  *	GM_ARGVAL
 | |
|  *
 | |
|  * AUTHOR
 | |
|  *	Jared Levy
 | |
|  *   Copyright (C) 1987-1990 Greenleaf Software	Inc.  All rights reserved.
 | |
|  *
 | |
|  * MODIFICATIONS
 | |
|  *
 | |
|  */
 | |
| 
 | |
| #include <stdio.h>
 | |
| #include "gm.h"
 | |
| #include "gmsystem.h"
 | |
| 
 | |
| DEC	**ZeroDecimalArray(dst,	n)
 | |
| DEC	**dst;
 | |
| int	n;
 | |
| {
 | |
| 	int i;
 | |
| 
 | |
| 	_MacStart(GM_DZEROARR);
 | |
| 
 | |
| 	if (n<=0)  {
 | |
| 		_MacErr(GM_ARGVAL);
 | |
| 		_MacRet(GM_NULLARR);
 | |
| 	}
 | |
| 
 | |
| 	if(!dst) {
 | |
| 		_MacErr(GM_NULLPOINTER);
 | |
| 		_MacRet(GM_NULLARR);
 | |
| 	}
 | |
| 
 | |
| 
 | |
| /* check that each element of array is allocated */
 | |
| 	for (i=0; i<n; i++)
 | |
| 		if (!dst[i])  {
 | |
| 			_MacErr(GM_NULLPOINTER);
 | |
| 		}
 | |
| 		else
 | |
| 			_MacDZero(dst[i]);
 | |
| 
 | |
| 	_MacRet(dst);
 | |
| }
 |