/* **********************************************************************
 * *                                                                    *
 * *            TypeDef Explicit Value Conversions for C++              *
 * *                                                                    *
 * **********************************************************************
 * File: libs/config/AssignValue.C
 *
 *                        COPYRIGHT (c) 2003  BY
 *          SIGMET INCORPORATED, WESTFORD MASSACHUSETTS, U.S.A.
 * 
 * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
 * ONLY  IN  ACCORDANCE WITH  THE  TERMS  OF  SUCH  LICENSE  AND WITH THE
 * INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE  OR  ANY OTHER
 * COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
 * OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
 * TRANSFERED.
 */
#include <stdio.h>
#include <math.h>

#include "sigtypes.h"
#include "config_lib.h"

/* ------------------------------
 * Overloaded function to make explicit assign/coercion of narrowed
 * values in C++.  This allows us to be clear about how we want these
 * conversions to be done, thereby keeping the C++ compiler happy.
 */
void AssignValue
( UINT4 *pValue_a, FLT8 fNewValue_a )
{
  *pValue_a = (UINT4)floor( 0.5 + fNewValue_a );
}
void AssignValue
( UINT2 *pValue_a, FLT8 fNewValue_a )
{
  *pValue_a = (UINT2)floor( 0.5 + fNewValue_a );
}
void AssignValue
( UINT1 *pValue_a, FLT8 fNewValue_a )
{
  *pValue_a = (UINT1)floor( 0.5 + fNewValue_a );
}
void AssignValue
( SINT4 *pValue_a, FLT8 fNewValue_a )
{
  *pValue_a = (SINT4)floor( 0.5 + fNewValue_a );
}
void AssignValue
( SINT2 *pValue_a, FLT8 fNewValue_a )
{
  *pValue_a = (SINT2)floor( 0.5 + fNewValue_a );
}
void AssignValue
( SINT1 *pValue_a, FLT8 fNewValue_a )
{
  *pValue_a = (SINT1)floor( 0.5 + fNewValue_a );
}
void AssignValue
( FLT8 *pValue_a, FLT8 fNewValue_a )
{
  *pValue_a = fNewValue_a;
}
void AssignValue
( FLT4 *pValue_a, FLT8 fNewValue_a )
{
  *pValue_a = (FLT4)fNewValue_a;
}
