Be more careful with double types.
This commit is contained in:
parent
0873c52474
commit
0c73f209de
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CVS_IDENT
|
#ifdef HAVE_CVS_IDENT
|
||||||
#ident "$Id: vpi_priv.cc,v 1.48 2005/06/09 05:04:45 steve Exp $"
|
#ident "$Id: vpi_priv.cc,v 1.49 2005/12/05 21:19:55 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "vpi_priv.h"
|
# include "vpi_priv.h"
|
||||||
|
|
@ -309,7 +309,7 @@ void vpi_get_time(vpiHandle obj, s_vpi_time*vp)
|
||||||
|
|
||||||
case vpiScaledRealTime:
|
case vpiScaledRealTime:
|
||||||
units = vpip_time_units_from_handle(obj);
|
units = vpip_time_units_from_handle(obj);
|
||||||
vp->real = pow(10, vpip_get_time_precision() - units);
|
vp->real = pow(10.0L, vpip_get_time_precision() - units);
|
||||||
vp->real *= time;
|
vp->real *= time;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -395,6 +395,7 @@ struct vpip_put_value_event : vvp_gen_event_s {
|
||||||
vpiHandle handle;
|
vpiHandle handle;
|
||||||
s_vpi_value value;
|
s_vpi_value value;
|
||||||
virtual void run_run();
|
virtual void run_run();
|
||||||
|
~vpip_put_value_event() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
void vpip_put_value_event::run_run()
|
void vpip_put_value_event::run_run()
|
||||||
|
|
@ -416,7 +417,7 @@ vpiHandle vpi_put_value(vpiHandle obj, s_vpi_value*vp,
|
||||||
switch (when->type) {
|
switch (when->type) {
|
||||||
case vpiScaledRealTime:
|
case vpiScaledRealTime:
|
||||||
dly = (vvp_time64_t)(when->real *
|
dly = (vvp_time64_t)(when->real *
|
||||||
(pow(10,
|
(pow(10.0L,
|
||||||
vpip_time_units_from_handle(obj) -
|
vpip_time_units_from_handle(obj) -
|
||||||
vpip_get_time_precision())));
|
vpip_get_time_precision())));
|
||||||
break;
|
break;
|
||||||
|
|
@ -685,6 +686,9 @@ extern "C" void vpi_control(PLI_INT32 operation, ...)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: vpi_priv.cc,v $
|
* $Log: vpi_priv.cc,v $
|
||||||
|
* Revision 1.49 2005/12/05 21:19:55 steve
|
||||||
|
* Be more careful with double types.
|
||||||
|
*
|
||||||
* Revision 1.48 2005/06/09 05:04:45 steve
|
* Revision 1.48 2005/06/09 05:04:45 steve
|
||||||
* Support UDP initial values.
|
* Support UDP initial values.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CVS_IDENT
|
#ifdef HAVE_CVS_IDENT
|
||||||
#ident "$Id: vpi_time.cc,v 1.16 2004/10/04 01:11:00 steve Exp $"
|
#ident "$Id: vpi_time.cc,v 1.17 2005/12/05 21:19:55 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -178,7 +178,7 @@ static void timevar_get_value(vpiHandle ref, s_vpi_value*vp)
|
||||||
the scaling, instead of the integer scaling done
|
the scaling, instead of the integer scaling done
|
||||||
everywhere else. */
|
everywhere else. */
|
||||||
units = rfp->scope? rfp->scope->time_units : vpi_time_precision;
|
units = rfp->scope? rfp->scope->time_units : vpi_time_precision;
|
||||||
vp->value.real = pow(10, vpi_time_precision - units);
|
vp->value.real = pow(10.0L, vpi_time_precision - units);
|
||||||
vp->value.real *= schedule_simtime();
|
vp->value.real *= schedule_simtime();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -274,6 +274,9 @@ void vpip_set_time_precision(int pre)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: vpi_time.cc,v $
|
* $Log: vpi_time.cc,v $
|
||||||
|
* Revision 1.17 2005/12/05 21:19:55 steve
|
||||||
|
* Be more careful with double types.
|
||||||
|
*
|
||||||
* Revision 1.16 2004/10/04 01:11:00 steve
|
* Revision 1.16 2004/10/04 01:11:00 steve
|
||||||
* Clean up spurious trailing white space.
|
* Clean up spurious trailing white space.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue