sc_uint_base.cc (13322:7391057615bd) | sc_uint_base.cc (13325:86323e6cc8ec) |
---|---|
1/***************************************************************************** 2 3 Licensed to Accellera Systems Initiative Inc. (Accellera) under one or 4 more contributor license agreements. See the NOTICE file distributed 5 with this work for additional information regarding copyright ownership. 6 Accellera licenses this file to you under the Apache License, Version 2.0 7 (the "License"); you may not use this file except in compliance with the 8 License. You may obtain a copy of the License at --- 489 unchanged lines hidden (view full) --- 498 extend_sign(); 499 return *this; 500} 501 502sc_uint_base & 503sc_uint_base::operator = (const char *a) 504{ 505 if (a == 0) { | 1/***************************************************************************** 2 3 Licensed to Accellera Systems Initiative Inc. (Accellera) under one or 4 more contributor license agreements. See the NOTICE file distributed 5 with this work for additional information regarding copyright ownership. 6 Accellera licenses this file to you under the Apache License, Version 2.0 7 (the "License"); you may not use this file except in compliance with the 8 License. You may obtain a copy of the License at --- 489 unchanged lines hidden (view full) --- 498 extend_sign(); 499 return *this; 500} 501 502sc_uint_base & 503sc_uint_base::operator = (const char *a) 504{ 505 if (a == 0) { |
506 SC_REPORT_ERROR("conversion failed", | 506 SC_REPORT_ERROR(sc_core::SC_ID_CONVERSION_FAILED_, |
507 "character string is zero"); 508 } else if (*a == 0) { | 507 "character string is zero"); 508 } else if (*a == 0) { |
509 SC_REPORT_ERROR("conversion failed", | 509 SC_REPORT_ERROR(sc_core::SC_ID_CONVERSION_FAILED_, |
510 "character string is empty"); 511 } else try { 512 int len = m_len; 513 sc_ufix aa(a, len, len, SC_TRN, SC_WRAP, 0, SC_ON); 514 return this->operator = (aa); 515 } catch(const sc_core::sc_report &) { 516 std::stringstream msg; 517 msg << "character string '" << a << "' is not valid"; | 510 "character string is empty"); 511 } else try { 512 int len = m_len; 513 sc_ufix aa(a, len, len, SC_TRN, SC_WRAP, 0, SC_ON); 514 return this->operator = (aa); 515 } catch(const sc_core::sc_report &) { 516 std::stringstream msg; 517 msg << "character string '" << a << "' is not valid"; |
518 SC_REPORT_ERROR("conversion failed", msg.str().c_str()); | 518 SC_REPORT_ERROR(sc_core::SC_ID_CONVERSION_FAILED_, msg.str().c_str()); |
519 } 520 return *this; 521} 522 523 524// explicit conversion to character string 525const std::string 526sc_uint_base::to_string(sc_numrep numrep) const --- 182 unchanged lines hidden --- | 519 } 520 return *this; 521} 522 523 524// explicit conversion to character string 525const std::string 526sc_uint_base::to_string(sc_numrep numrep) const --- 182 unchanged lines hidden --- |