From 8c6adeb85a0d3a1bf520376a51ca3a0b3ed2a47b Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Mon, 30 Jun 2008 07:10:23 -0400 Subject: [PATCH] Internals: Convert to use common string convert routine --- include/verilated.cpp | 20 +++++++++++++------- include/verilated.h | 15 --------------- src/V3AstNodes.h | 2 +- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/include/verilated.cpp b/include/verilated.cpp index 983cfc2dd..6329831c7 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -248,14 +248,24 @@ void _VL_VINT_TO_STRING(int obits, char* destoutp, WDataInP sourcep) { while (isspace(*(destp-1)) && destp>destoutp) *--destp = '\0'; // Drop trailing spaces } -IData VL_FGETS_IXQ(int sbits, void* strgp, QData fpq) { +void _VL_STRING_TO_VINT(int obits, void* destp, int srclen, const char* srcp) { + // Convert C string to Verilog format + int bytes = VL_BYTES_I(obits); + char* op = ((char*)(destp)); + if (srclen > bytes) srclen = bytes; // Don't overflow destination + int i; + for (i=0; i