User Profile
Collapse
-
Is there any way to avoid static variable? any alternative? -
"undefined symbol" right after execution of program
Hi
I have a data type and I can instantiate a variable of that type. like this:
The definition of FetchAdr is:Code:FetchAddr faddr(VirtualMemoryAddress( 0x0a ));
Now I have a class that faddr is a private...Code:struct FetchAddr { Flexus::SharedTypes::VirtualMemoryAddress theAddress; FetchAddr(Flexus::SharedTypes::VirtualMemoryAddress anAddress) : theAddress(anAddress) { } }; -
-
how to adjust line space?
Somewhere in my html code, I have wrote this
The problem is when I open that...Code:<div class="container"> <div class="content"> <table width="962" border="0"> <tr> <td width="649" height="324"><h2>my name</h2> <p>my affiliation </p> .... -
No as I said, the data are some uint_32t numbers and I want to write to a text file.Leave a comment:
-
I want to write those fields in a plain text with fputs (is there another way? I don't know...)
As in your example, the output.txt should looks like
Code:1066 1492 1941
Leave a comment:
-
passing a non string type to "fputs"
Hi
I have a struct
and I have created an instance of thatCode:struct b_entry_t { uint32_t source; uint32_t target; int counter; };
Somewhere in my program I want to write it to file with fputs. The problem is how can I do that?Code:struct b_entry_t *entry;
I get this warningCode:fputs (entry, pFile);
...Code:warning: passing argument 1 of ‘fputs’
-
I thought '=' will automatically new the pointer.
Thanks for your suggestionLeave a comment:
-
free memory for a pointer to struct
Hi,
I have defined s struct and use it is this way:
Then I want to free the memory like this:Code:struct bpred_t * backup =p->core[core].thread[thread].bpred;
Is that true?Code:free( backup );
However I get segmentation fault during "free" -
-
>I'm guessing it's a very small negative number and you just aren't showing enough decimal places to see the value.
Yes. It is in the order of 1E-18
>Use an int (or integer type) to control loop iterations and then the guarantee that you get exactly the right number.
You are right. thanks for the tip. However the negative zero which is the value of 'e' does not control the loop.
My problem...Leave a comment:
-
negative zero in float calculation
Hi,
I have written this code:
...Code:float x, y, y1, y2, z, e; float deltax = 0.1, deltay = 0.1; int width = 10; int precision = 4; outF << "Zeta" << setw(width) << "Eta" << endl; outF.setf( ios::fixed | ios::showpoint ); outF.precision(precision); for( x=0; x<=0.5; x+=deltax ){ y1 = 0.1*x; y2 = 3*x; for( -
With the definition of constructor as this
...Code:static API::conf_object_t * constructor(API::parse_object_t * aParseObject) { sim_object * object = new sim_object(); //Note: the reintepret cast here is safe since SimObject is POD and //conf_object comes first in SimObject. APIFwd::SIM_object_constructor(reinterpret_cast<API::conf_object *>(object), aParseObject);Leave a comment:
-
You mean this (the static definition of theClass)
...Code:template <class CppObjectClass > class Factory { typedef Class<CppObjectClass> class_; class_ * theClass; public: Factory() { static class_ theStaticClass; theClass = &theStaticClass; } typename class_::object_type create(std::string aSimicsName) { //AskLeave a comment:
-
The second error you mentioned is:
and that code is:Code:error: in passing argument 3 of Flexus::Simics::API::conf_object_t* Flexus::Simics::aux_::NewObject_stub(Flexus::Simics::API::conf_class_t*, const std::string&, Flexus::Simics::API::conf_object_t* (&)(Flexus::Simics::API::parse_object_t*))’
...Code:namespace aux_ { API::conf_object_t * NewObject_stub(API::conf_class_tLeave a comment:
-
invalid initialization of non-const reference
Hi,
While trying to port my application to new gcc, I face this error:
In member function ‘typename Flexus::Simics: :Class<DestType >::object_typ e
Flexus::Simics: :Factory<CppObj ectClass>::crea te(std::string) [with CppObjectClass = nDecoupledFeede r::SimicsTracer]’:
SimicsTracer.cp p:719: instantiated from here
/home/mahmood/flexus-4.0/core/simics/configuration_a pi.hpp:605: error: invalid... -
I find the solution fairly easy....
I did a diff for numeric_op.hpp between 1.33.1 and current 1.46 (revision 70743) and found little differences in lines between two files. I did replace the old one with new one and the error disappeared.
I want to upload the files but don't see any attachment link. Where can I upload the files?Leave a comment:
-
Sorry for that. You may find this code snippet.
...Code:{ BOOST_MPL_AUX_LAMBDA_SUPPORT( AUX778076_OP_ARITY , AUX778076_OP_NAME , ( BOOST_MPL_PP_PARAMS(AUX778076_OP_ARITY, N) ) ) }; template< typename N1 , typename N2 > struct BOOST_PP_CAT(AUX778076_OP_NAME,2) #endif #elseLeave a comment:
-
This is the full stack
...Code:compiling OneWayMuxImpl.cpp (g++) In file included from /opt/boost_1_33_1/boost/mpl/aux_/arithmetic_op.hpp:26, from /opt/boost_1_33_1/boost/mpl/plus.hpp:19, from /opt/boost_1_33_1/boost/mpl/vector/aux_/iterator.hpp:19, from /opt/boost_1_33_1/boost/mpl/vector/aux_/vector0.hpp:22, from /opt/boost_1_33_1/boost/mpl/vector/aux_/clear.hpp:18,Leave a comment:
-
expected unqualified-id before ‘:’ token
I have a program which uses boost 1.33.1 and it works fine with gcc 4.1 however now that I want to compile with gcc 4.4 it get many errors. For example somewhere in the boost files, it says:
/opt/boost_1_33_1/boost/mpl/aux_/numeric_op.hpp: 250: error: expected unqualified-id before ‘:’ token
the code at that line is (note the second line):
...Code:#if !defined(BOOST_MPL_CFG_MSVC_ETI_BUG) : AUX778076_OP_IMPL_NAME<
No activity results to display
Show More
Leave a comment: