Add some casts in libveriuser to remove warnings.

The Cygwin compiler is a bit picky. This patch adds some casts
to remove compilation warnings. In the past I have had warnings
off because of problems with the STL, but for C directories
like this it makes sense to enable the warnings. It also does
not recognize that an assert(0) or assert(false) ends a routine
so it complains about no return at end of function or variables
not being defined.
This commit is contained in:
Cary R 2009-12-10 12:48:24 -08:00 committed by Stephen Williams
parent 3f12a401eb
commit 6ae1f64c3c
14 changed files with 50 additions and 452 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003 Stephen Williams (steve@icarus.com)
* Copyright (c) 2003-2009 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -16,9 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: a_configure.c,v 1.4 2003/12/17 15:45:07 steve Exp $"
#endif
#include <acc_user.h>
#include <vpi_user.h>
@ -70,41 +67,14 @@ int acc_configure(PLI_INT32 config_param, const char*value)
if (pli_trace) {
fprintf(pli_trace, "acc_configure(config=%d, %s)\n",
config_param, value);
(int)config_param, value);
}
vpi_printf("XXXX acc_configure(%d, %s)\n", config_param, value);
vpi_printf("XXXX acc_configure(%d, %s)\n", (int)config_param,
value);
rc = 0;
break;
}
return rc;
}
/*
* $Log: a_configure.c,v $
* Revision 1.4 2003/12/17 15:45:07 steve
* Add acc_set_scope function.
*
* Revision 1.3 2003/06/17 16:55:07 steve
* 1) setlinebuf() for vpi_trace
* 2) Addes error checks for trace file opens
* 3) removes now extraneous flushes
* 4) fixes acc_next() bug
*
* Revision 1.2 2003/05/18 00:16:35 steve
* Add PLI_TRACE tracing of PLI1 modules.
*
* Add tf_isetdelay and friends, and add
* callback return values for acc_vcl support.
*
* Revision 1.1 2003/02/17 06:39:47 steve
* Add at least minimal implementations for several
* acc_ functions. Add support for standard ACC
* string handling.
*
* Add the _pli_types.h header file to carry the
* IEEE1364-2001 standard PLI type declarations.
*
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003 Stephen Williams (steve@icarus.com)
* Copyright (c) 2003-2009 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -16,9 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: a_fetch_param.c,v 1.4 2003/06/17 16:55:07 steve Exp $"
#endif
#include <assert.h>
#include <vpi_user.h>
@ -43,31 +40,8 @@ double acc_fetch_paramval(handle object)
default:
vpi_printf("XXXX: parameter %s has type %d\n",
vpi_get_str(vpiName, object), val.format);
vpi_get_str(vpiName, object), (int)val.format);
assert(0);
return 0.0;
}
}
/*
* $Log: a_fetch_param.c,v $
* Revision 1.4 2003/06/17 16:55:07 steve
* 1) setlinebuf() for vpi_trace
* 2) Addes error checks for trace file opens
* 3) removes now extraneous flushes
* 4) fixes acc_next() bug
*
* Revision 1.3 2003/05/18 00:16:35 steve
* Add PLI_TRACE tracing of PLI1 modules.
*
* Add tf_isetdelay and friends, and add
* callback return values for acc_vcl support.
*
* Revision 1.2 2003/03/14 04:59:54 steve
* Better message when asserting funky value type.
*
* Revision 1.1 2003/03/13 04:35:09 steve
* Add a bunch of new acc_ and tf_ functions.
*
*/

View File

@ -1,5 +1,5 @@
/* vi:sw=6
* Copyright (c) 2002,2003 Michael Ruff (mruff at chiaro.com)
/*
* Copyright (c) 2002-2009 Michael Ruff (mruff at chiaro.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -16,9 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: a_fetch_tfarg.c,v 1.10 2004/10/04 01:10:56 steve Exp $"
#endif
#include <vpi_user.h>
#include <acc_user.h>
@ -50,7 +47,7 @@ double acc_fetch_itfarg(PLI_INT32 n, handle obj)
if (pli_trace) {
fprintf(pli_trace, "%s: acc_fetch_itfarg(%d, %p) --> %f\n",
vpi_get_str(vpiName, obj), n, obj, rtn);
vpi_get_str(vpiName, obj), (int)n, obj, rtn);
}
return rtn;
@ -85,7 +82,7 @@ PLI_INT32 acc_fetch_itfarg_int(PLI_INT32 n, handle obj)
if (pli_trace) {
fprintf(pli_trace, "%s: acc_fetch_itfarg_int(%d, %p) --> %d\n",
vpi_get_str(vpiName, obj), n, obj, rtn);
vpi_get_str(vpiName, obj), (int)n, obj, rtn);
}
return rtn;
@ -121,7 +118,7 @@ char *acc_fetch_itfarg_str(PLI_INT32 n, handle obj)
if (pli_trace) {
fprintf(pli_trace, "%s: acc_fetch_itfarg_str(%d, %p) --> \"%s\"\n",
vpi_get_str(vpiName, obj),
n, obj, rtn? rtn : "");
(int)n, obj, rtn? rtn : "");
}
return rtn;
@ -131,45 +128,3 @@ char *acc_fetch_tfarg_str(PLI_INT32 n)
{
return acc_fetch_itfarg_str(n, vpi_handle(vpiSysTfCall,0));
}
/*
* $Log: a_fetch_tfarg.c,v $
* Revision 1.10 2004/10/04 01:10:56 steve
* Clean up spurious trailing white space.
*
* Revision 1.9 2004/02/18 02:51:59 steve
* Fix type mismatches of various VPI functions.
*
* Revision 1.8 2003/06/14 01:16:17 steve
* ihand is system task, not scope.
*
* Revision 1.7 2003/06/13 19:23:42 steve
* Add a bunch more PLI1 routines.
*
* Revision 1.6 2003/05/18 00:16:35 steve
* Add PLI_TRACE tracing of PLI1 modules.
*
* Add tf_isetdelay and friends, and add
* callback return values for acc_vcl support.
*
* Revision 1.5 2003/03/14 04:58:50 steve
* Free the iterator when Im done.
*
* Revision 1.4 2003/03/13 04:35:09 steve
* Add a bunch of new acc_ and tf_ functions.
*
* Revision 1.3 2003/02/17 06:39:47 steve
* Add at least minimal implementations for several
* acc_ functions. Add support for standard ACC
* string handling.
*
* Add the _pli_types.h header file to carry the
* IEEE1364-2001 standard PLI type declarations.
*
* Revision 1.2 2002/08/12 01:35:02 steve
* conditional ident string using autoconfig.
*
* Revision 1.1 2002/06/07 02:58:58 steve
* Add a bunch of acc/tf functions. (mruff)
*
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003 Stephen Williams (steve@icarus.com)
* Copyright (c) 2003-2009 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -16,9 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: a_fetch_type.c,v 1.8 2004/10/04 01:10:56 steve Exp $"
#endif
# include <acc_user.h>
# include <vpi_user.h>
@ -62,7 +59,7 @@ PLI_INT32 acc_fetch_type(handle obj)
default:
vpi_printf("acc_fetch_type: vpiType %d is what accType?\n",
vpi_get(vpiType, obj));
(int)vpi_get(vpiType, obj));
return accUnknown;
}
@ -118,43 +115,3 @@ PLI_INT32 acc_fetch_fulltype(handle obj)
return accUnknown;
}
}
/*
* $Log: a_fetch_type.c,v $
* Revision 1.8 2004/10/04 01:10:56 steve
* Clean up spurious trailing white space.
*
* Revision 1.7 2003/06/04 01:56:20 steve
* 1) Adds configure logic to clean up compiler warnings
* 2) adds acc_compare_handle, acc_fetch_range, acc_next_scope and
* tf_isetrealdelay, acc_handle_scope
* 3) makes acc_next reentrant
* 4) adds basic vpiWire type support
* 5) fills in some acc_object_of_type() and acc_fetch_{full}type()
* 6) add vpiLeftRange/RigthRange to signals
*
* Revision 1.6 2003/05/30 04:18:31 steve
* Add acc_next function.
*
* Revision 1.5 2003/05/29 02:35:41 steve
* acc_fetch_type supports module.
*
* Revision 1.4 2003/04/24 18:57:06 steve
* Add acc_fetch_fulltype function.
*
* Revision 1.3 2003/04/12 18:57:14 steve
* More acc_ function stubs.
*
* Revision 1.2 2003/03/13 04:35:09 steve
* Add a bunch of new acc_ and tf_ functions.
*
* Revision 1.1 2003/02/17 06:39:47 steve
* Add at least minimal implementations for several
* acc_ functions. Add support for standard ACC
* string handling.
*
* Add the _pli_types.h header file to carry the
* IEEE1364-2001 standard PLI type declarations.
*
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003 Stephen Williams (steve@icarus.com)
* Copyright (c) 2003-2009 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -16,9 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: a_fetch_type_str.c,v 1.5 2003/04/12 18:57:14 steve Exp $"
#endif
#include <assert.h>
#include <vpi_user.h>
@ -41,34 +38,9 @@ char* acc_fetch_type_str(PLI_INT32 type)
return "accConstant";
default:
vpi_printf("XXXX acc_fetch_type_str(%d);\n", type);
vpi_printf("XXXX acc_fetch_type_str(%d);\n", (int)type);
return "acc_fetch_type_str(unknown)";
}
return "";
}
/*
* $Log: a_fetch_type_str.c,v $
* Revision 1.5 2003/04/12 18:57:14 steve
* More acc_ function stubs.
*
* Revision 1.4 2003/03/13 05:07:46 steve
* Declaration warnings.
*
* Revision 1.3 2003/03/13 04:35:09 steve
* Add a bunch of new acc_ and tf_ functions.
*
* Revision 1.2 2003/02/19 04:37:04 steve
* fullname for accConstant.
*
* Revision 1.1 2003/02/17 06:39:47 steve
* Add at least minimal implementations for several
* acc_ functions. Add support for standard ACC
* string handling.
*
* Add the _pli_types.h header file to carry the
* IEEE1364-2001 standard PLI type declarations.
*
*/

View File

@ -1,5 +1,5 @@
/* vi:sw=6
* Copyright (c) 2003 Michael Ruff (mruff at chiaro.com)
/*
* Copyright (c) 2003-2009 Michael Ruff (mruff at chiaro.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -16,9 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: a_next.c,v 1.4 2006/10/30 22:45:37 steve Exp $"
#endif
#include <stdio.h>
#include <acc_user.h>
@ -37,7 +34,7 @@ handle acc_next(PLI_INT32 *type, handle scope, handle prev)
PLI_INT32 *ip;
fprintf(pli_trace, "acc_next(%p <", type);
for (ip = type; *ip; ip++) {
fprintf(pli_trace, "%s%d", ip != type ? "," : "", *ip);
fprintf(pli_trace, "%s%d", ip != type ? "," : "", (int)*ip);
}
fprintf(pli_trace, ">, %p", scope);
if (scope)
@ -91,28 +88,3 @@ handle acc_next_scope(handle scope, handle prev)
PLI_INT32 type[2] = {accScope, 0};
return acc_next(type, scope, prev);
}
/*
* $Log: a_next.c,v $
* Revision 1.4 2006/10/30 22:45:37 steve
* Updates for Cygwin portability (pr1585922)
*
* Revision 1.3 2003/06/17 16:55:07 steve
* 1) setlinebuf() for vpi_trace
* 2) Addes error checks for trace file opens
* 3) removes now extraneous flushes
* 4) fixes acc_next() bug
*
* Revision 1.2 2003/06/04 01:56:20 steve
* 1) Adds configure logic to clean up compiler warnings
* 2) adds acc_compare_handle, acc_fetch_range, acc_next_scope and
* tf_isetrealdelay, acc_handle_scope
* 3) makes acc_next reentrant
* 4) adds basic vpiWire type support
* 5) fills in some acc_object_of_type() and acc_fetch_{full}type()
* 6) add vpiLeftRange/RigthRange to signals
*
* Revision 1.1 2003/05/30 04:18:31 steve
* Add acc_next function.
*
*/

View File

@ -1,5 +1,5 @@
/* vi:sw=6
* Copyright (c) 2002, 2003 Michael Ruff (mruff at chiaro.com)
/*
* Copyright (c) 2002-2009 Michael Ruff (mruff at chiaro.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -16,9 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: a_object_of_type.c,v 1.6 2004/02/18 02:51:59 steve Exp $"
#endif
#include <assert.h>
#include <vpi_user.h>
@ -35,7 +32,7 @@ int acc_object_of_type(handle object, PLI_INT32 type)
if (pli_trace) {
fprintf(pli_trace, "acc_object_of_type(%p \"%s\", %d)",
object, vpi_get_str(vpiName, object), type);
object, vpi_get_str(vpiName, object), (int)type);
fflush(pli_trace);
}
@ -77,7 +74,8 @@ int acc_object_of_type(handle object, PLI_INT32 type)
break;
default:
vpi_printf("acc_object_of_type: Unknown type %d\n", type);
vpi_printf("acc_object_of_type: Unknown type %d\n",
(int)type);
rtn = 0;
}
@ -98,36 +96,3 @@ int acc_object_in_typelist(handle object, PLI_INT32*typelist)
return 0;
}
/*
* $Log: a_object_of_type.c,v $
* Revision 1.6 2004/02/18 02:51:59 steve
* Fix type mismatches of various VPI functions.
*
* Revision 1.5 2003/06/04 01:56:20 steve
* 1) Adds configure logic to clean up compiler warnings
* 2) adds acc_compare_handle, acc_fetch_range, acc_next_scope and
* tf_isetrealdelay, acc_handle_scope
* 3) makes acc_next reentrant
* 4) adds basic vpiWire type support
* 5) fills in some acc_object_of_type() and acc_fetch_{full}type()
* 6) add vpiLeftRange/RigthRange to signals
*
* Revision 1.4 2003/05/30 04:18:31 steve
* Add acc_next function.
*
* Revision 1.3 2003/02/17 06:39:47 steve
* Add at least minimal implementations for several
* acc_ functions. Add support for standard ACC
* string handling.
*
* Add the _pli_types.h header file to carry the
* IEEE1364-2001 standard PLI type declarations.
*
* Revision 1.2 2002/08/12 01:35:02 steve
* conditional ident string using autoconfig.
*
* Revision 1.1 2002/06/07 02:58:58 steve
* Add a bunch of acc/tf functions. (mruff)
*
*/

View File

@ -1,5 +1,5 @@
/* vi:sw=6
* Copyright (c) 2002 Michael Ruff (mruff at chiaro.com)
/*
* Copyright (c) 2002-2009 Michael Ruff (mruff at chiaro.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -16,9 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: a_set_value.c,v 1.3 2003/05/18 00:16:35 steve Exp $"
#endif
#include <assert.h>
#include <acc_user.h>
@ -45,7 +42,7 @@ int acc_set_value(handle object, p_setval_value value, p_setval_delay delay)
case accPureTransportDelay: flags = vpiPureTransportDelay; break;
case accForceFlag: flags = vpiForceFlag; break;
case accReleaseFlag: flags = vpiReleaseFlag; break;
default: assert(0); break;
default: flags = -1; assert(0); break;
}
/* map acc_time to vpi_time */
@ -113,19 +110,3 @@ int acc_set_value(handle object, p_setval_value value, p_setval_delay delay)
return 1;
}
/*
* $Log: a_set_value.c,v $
* Revision 1.3 2003/05/18 00:16:35 steve
* Add PLI_TRACE tracing of PLI1 modules.
*
* Add tf_isetdelay and friends, and add
* callback return values for acc_vcl support.
*
* Revision 1.2 2002/08/12 01:35:02 steve
* conditional ident string using autoconfig.
*
* Revision 1.1 2002/06/07 02:58:59 steve
* Add a bunch of acc/tf functions. (mruff)
*
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003 Stephen Williams (steve@icarus.com)
* Copyright (c) 2003-2009 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -16,9 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: a_vcl.c,v 1.7 2004/10/04 01:10:56 steve Exp $"
#endif
#include <vpi_user.h>
#include <acc_user.h>
@ -185,13 +182,13 @@ void acc_vcl_add(handle obj, PLI_INT32(*consumer)(p_vc_record),
if (pli_trace) {
fprintf(pli_trace, "acc_vcl_add(<%s>, ..., %p, %d)\n",
vpi_get_str(vpiFullName, obj), data, vcl_flag);
vpi_get_str(vpiFullName, obj), data, (int)vcl_flag);
}
break;
default:
vpi_printf("XXXX acc_vcl_add(<type=%d>, ..., %d);\n",
vpi_get(vpiType, obj), vcl_flag);
(int)vpi_get(vpiType, obj), (int)vcl_flag);
break;
}
@ -202,36 +199,3 @@ void acc_vcl_delete(handle obj, PLI_INT32(*consumer)(p_vc_record),
{
vpi_printf("XXXX acc_vcl_delete(...)\n");
}
/*
* $Log: a_vcl.c,v $
* Revision 1.7 2004/10/04 01:10:56 steve
* Clean up spurious trailing white space.
*
* Revision 1.6 2003/06/17 16:55:07 steve
* 1) setlinebuf() for vpi_trace
* 2) Addes error checks for trace file opens
* 3) removes now extraneous flushes
* 4) fixes acc_next() bug
*
* Revision 1.5 2003/05/18 00:16:35 steve
* Add PLI_TRACE tracing of PLI1 modules.
*
* Add tf_isetdelay and friends, and add
* callback return values for acc_vcl support.
*
* Revision 1.4 2003/04/30 01:09:29 steve
* Conditionally include malloc.h
*
* Revision 1.3 2003/04/24 02:02:37 steve
* Clean up some simple warnings.
*
* Revision 1.2 2003/04/20 02:48:39 steve
* Support value change callbacks.
*
* Revision 1.1 2003/04/12 18:57:14 steve
* More acc_ function stubs.
*
*/

View File

@ -43,7 +43,7 @@ int tf_isetdelay(PLI_INT32 delay, void*ss)
if (pli_trace) {
fprintf(pli_trace, "%s: tf_isetdelay(%d, ...)"
" <unit=%d, prec=%d>;\n",
vpi_get_str(vpiName, sys), delay, unit, prec);
vpi_get_str(vpiName, sys), (int)delay, unit, prec);
}

View File

@ -1,5 +1,5 @@
/* vi:sw=6
* Copyright (c) 2002,2003 Michael Ruff (mruff at chiaro.com)
/*
* Copyright (c) 2002-2009 Michael Ruff (mruff at chiaro.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -16,9 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: getp.c,v 1.7 2004/10/04 01:10:56 steve Exp $"
#endif
# include <assert.h>
# include <ctype.h>
@ -67,7 +64,7 @@ PLI_INT32 tf_igetp(PLI_INT32 n, void *obj)
out:
if (pli_trace) {
fprintf(pli_trace, "tf_igetp(n=%d, obj=%p) --> %d\n",
n, obj, rtn);
(int)n, obj, rtn);
}
return rtn;
@ -114,7 +111,7 @@ double tf_igetrealp(PLI_INT32 n, void *obj)
out:
if (pli_trace) {
fprintf(pli_trace, "tf_igetrealp(n=%d, obj=%p) --> %f\n",
n, obj, rtn);
(int)n, obj, rtn);
}
return rtn;
@ -171,7 +168,7 @@ char *tf_istrgetp(PLI_INT32 n, PLI_INT32 fmt, void *obj)
out:
if (pli_trace) {
fprintf(pli_trace, "tf_istrgetp(n=%d, fmt=%c, obj=%p) --> \"%s\"\n",
n, fmt, obj, rtn);
(int)n, (int)fmt, obj, rtn);
}
return rtn;
@ -183,34 +180,3 @@ char *tf_strgetp(PLI_INT32 n, PLI_INT32 fmt)
return rtn;
}
/*
* $Log: getp.c,v $
* Revision 1.7 2004/10/04 01:10:56 steve
* Clean up spurious trailing white space.
*
* Revision 1.6 2003/06/17 16:55:07 steve
* 1) setlinebuf() for vpi_trace
* 2) Addes error checks for trace file opens
* 3) removes now extraneous flushes
* 4) fixes acc_next() bug
*
* Revision 1.5 2003/05/30 04:22:13 steve
* Add tf_strgetp functions.
*
* Revision 1.4 2003/05/29 03:46:21 steve
* Add tf_getp/putp support for integers
* and real valued arguments.
*
* Add tf_mipname function.
*
* Revision 1.3 2003/03/15 05:42:39 steve
* free argument iterators.
*
* Revision 1.2 2002/08/12 01:35:02 steve
* conditional ident string using autoconfig.
*
* Revision 1.1 2002/06/07 02:58:59 steve
* Add a bunch of acc/tf functions. (mruff)
*
*/

View File

@ -1,5 +1,5 @@
/* vi:sw=6
* Copyright (c) 2002,2003 Michael Ruff (mruff at chiaro.com)
/*
* Copyright (c) 2002-2009 Michael Ruff (mruff at chiaro.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -16,9 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: getsimtime.c,v 1.11 2003/06/21 23:40:15 steve Exp $"
#endif
#include <veriuser.h>
#include <vpi_user.h>
@ -62,9 +59,10 @@ char *tf_strgettime(void)
time.type = vpiSimTime;
vpi_get_time (0, &time);
if (time.high)
snprintf(buf, sizeof(buf)-1, "%u%08u", time.high, time.low);
snprintf(buf, sizeof(buf)-1, "%u%08u", (unsigned int)time.high,
(unsigned int)time.low);
else
snprintf(buf, sizeof(buf)-1, "%u", time.low);
snprintf(buf, sizeof(buf)-1, "%u", (unsigned int)time.low);
return buf;
}
@ -140,7 +138,7 @@ PLI_INT32 tf_gettimeprecision(void)
if (pli_trace)
fprintf(pli_trace, "tf_gettimeprecision(<%s>) --> %d\n",
vpi_get_str(vpiName, sys), rc);
vpi_get_str(vpiName, sys), (int)rc);
return rc;
}
@ -163,7 +161,7 @@ PLI_INT32 tf_igettimeprecision(void*obj)
if (pli_trace)
fprintf(pli_trace, "tf_igettimeprecision(<%s>) --> %d\n",
obj? vpi_get_str(vpiName, obj) : ".", rc);
obj? vpi_get_str(vpiName, obj) : ".", (int)rc);
return rc;
}
@ -179,47 +177,3 @@ PLI_INT32 tf_igettimeunit(void*obj)
{
return vpi_get(!obj ? vpiTimePrecision : vpiTimeUnit, (vpiHandle)obj);
}
/*
* $Log: getsimtime.c,v $
* Revision 1.11 2003/06/21 23:40:15 steve
* gettimeprecision will null argument has specific meaning.
*
* Revision 1.10 2003/06/13 19:23:42 steve
* Add a bunch more PLI1 routines.
*
* Revision 1.9 2003/06/04 01:56:20 steve
* 1) Adds configure logic to clean up compiler warnings
* 2) adds acc_compare_handle, acc_fetch_range, acc_next_scope and
* tf_isetrealdelay, acc_handle_scope
* 3) makes acc_next reentrant
* 4) adds basic vpiWire type support
* 5) fills in some acc_object_of_type() and acc_fetch_{full}type()
* 6) add vpiLeftRange/RigthRange to signals
*
* Revision 1.8 2003/05/30 04:01:55 steve
* Add tf_scale_longdelay.
*
* Revision 1.7 2003/05/28 03:14:20 steve
* Missing time related declarations.
*
* Revision 1.6 2003/05/27 16:22:10 steve
* PLI get time units/precision.
*
* Revision 1.5 2003/04/12 18:57:14 steve
* More acc_ function stubs.
*
* Revision 1.4 2003/03/13 04:35:09 steve
* Add a bunch of new acc_ and tf_ functions.
*
* Revision 1.3 2003/03/06 00:27:54 steve
* Fill in required fields when getting time.
*
* Revision 1.2 2002/08/12 01:35:02 steve
* conditional ident string using autoconfig.
*
* Revision 1.1 2002/05/31 18:25:51 steve
* Add tf_getlongtime (mruff)
*
*/

View File

@ -1,5 +1,5 @@
/* vi:sw=6
* Copyright (c) 2002,2003 Michael Ruff (mruff at chiaro.com)
/*
* Copyright (c) 2002-2009 Michael Ruff (mruff at chiaro.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -16,9 +16,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: putp.c,v 1.7 2004/09/10 23:13:05 steve Exp $"
#endif
# include <assert.h>
# include <veriuser.h>
@ -48,7 +45,7 @@ PLI_INT32 tf_iputp(PLI_INT32 n, PLI_INT32 value, void *obj)
if (pli_trace) {
fprintf(pli_trace, "tf_iputp(<return>, value=%d, func=%s) "
"--> %d\n", value, vpi_get_str(vpiName, obj), 0);
"--> %d\n", (int)value, vpi_get_str(vpiName, obj), 0);
}
return 0;
@ -57,7 +54,7 @@ PLI_INT32 tf_iputp(PLI_INT32 n, PLI_INT32 value, void *obj)
if ((n == 0) && (type != vpiSysFuncCall)) {
if (pli_trace) {
fprintf(pli_trace, "tf_iputp(<ERROR>, value=%d, func=%s) "
"--> %d\n", value, vpi_get_str(vpiName, obj), 1);
"--> %d\n", (int)value, vpi_get_str(vpiName, obj), 1);
}
return 1;
@ -82,7 +79,7 @@ PLI_INT32 tf_iputp(PLI_INT32 n, PLI_INT32 value, void *obj)
out:
if (pli_trace) {
fprintf(pli_trace, "tf_iputp(n=%d, value=%d, obj=%p) --> %d\n",
n, value, obj, rtn);
(int)n, (int)value, obj, rtn);
}
return rtn;
@ -131,7 +128,7 @@ free:
out:
if (pli_trace) {
fprintf(pli_trace, "tf_iputrealp(n=%d, value=%f, obj=%p) --> %d\n",
n, value, obj, rtn);
(int)n, value, obj, rtn);
}
return rtn;
@ -143,33 +140,3 @@ PLI_INT32 tf_putrealp(PLI_INT32 n, double value)
return rtn;
}
/*
* $Log: putp.c,v $
* Revision 1.7 2004/09/10 23:13:05 steve
* Compile cleanup of C code.
*
* Revision 1.6 2003/06/26 03:20:24 steve
* Correct handle of put to function return value.
*
* Revision 1.5 2003/06/17 16:55:08 steve
* 1) setlinebuf() for vpi_trace
* 2) Addes error checks for trace file opens
* 3) removes now extraneous flushes
* 4) fixes acc_next() bug
*
* Revision 1.4 2003/05/29 03:46:21 steve
* Add tf_getp/putp support for integers
* and real valued arguments.
*
* Add tf_mipname function.
*
* Revision 1.3 2003/03/15 05:42:39 steve
* free argument iterators.
*
* Revision 1.2 2002/08/12 01:35:02 steve
* conditional ident string using autoconfig.
*
* Revision 1.1 2002/06/07 16:21:13 steve
* Add tf_putlongp and tf_putp.
*
*/

View File

@ -1,4 +1,4 @@
/* vi:sw=6
/*
* Copyright (c) 2002-2009 Michael Ruff (mruff at chiaro.com)
* Michael Runyan (mrunyan at chiaro.com)
*
@ -322,6 +322,7 @@ static PLI_INT32 callback(p_cb_data data)
reason = reason_reactivate;
break;
default:
reason = -1;
assert(0);
}