User Profile

Collapse

Profile Sidebar

Collapse
mahmoodn
mahmoodn
Last Activity: Apr 18 '12, 11:15 AM
Joined: May 21 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Is there any way to avoid static variable? any alternative?
    See more | Go to post

    Leave a comment:


  • mahmoodn
    started a topic "undefined symbol" right after execution of program
    in C

    "undefined symbol" right after execution of program

    Hi
    I have a data type and I can instantiate a variable of that type. like this:

    Code:
    FetchAddr faddr(VirtualMemoryAddress( 0x0a ));
    The definition of FetchAdr is:
    Code:
    struct FetchAddr {
      Flexus::SharedTypes::VirtualMemoryAddress theAddress;
      FetchAddr(Flexus::SharedTypes::VirtualMemoryAddress anAddress)
         : theAddress(anAddress)
      { }
    };
    Now I have a class that faddr is a private...
    See more | Go to post

  • mahmoodn
    replied to how to adjust line space?
    How? what should I wrote? Can you give an example?
    See more | Go to post

    Leave a comment:


  • mahmoodn
    started a topic how to adjust line space?

    how to adjust line space?

    Somewhere in my html code, I have wrote this
    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>
    ....
    The problem is when I open that...
    See more | Go to post

  • mahmoodn
    replied to passing a non string type to "fputs"
    in C
    No as I said, the data are some uint_32t numbers and I want to write to a text file.
    See more | Go to post

    Leave a comment:


  • mahmoodn
    replied to passing a non string type to "fputs"
    in C
    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
    See more | Go to post

    Leave a comment:


  • mahmoodn
    started a topic passing a non string type to "fputs"
    in C

    passing a non string type to "fputs"

    Hi
    I have a struct
    Code:
    struct b_entry_t {
       uint32_t source;  
       uint32_t target;
       int counter;  
    };
    and I have created an instance of that
    Code:
    struct b_entry_t *entry;
    Somewhere in my program I want to write it to file with fputs. The problem is how can I do that?
    Code:
    fputs (entry, pFile);
    I get this warning
    Code:
    warning: passing argument 1 of ‘fputs’
    ...
    See more | Go to post

  • mahmoodn
    replied to free memory for a pointer to struct
    in C
    I thought '=' will automatically new the pointer.

    Thanks for your suggestion
    See more | Go to post

    Leave a comment:


  • mahmoodn
    started a topic free memory for a pointer to struct
    in C

    free memory for a pointer to struct

    Hi,
    I have defined s struct and use it is this way:
    Code:
    struct bpred_t * backup =p->core[core].thread[thread].bpred;
    Then I want to free the memory like this:
    Code:
    free( backup );
    Is that true?
    However I get segmentation fault during "free"
    See more | Go to post

  • mahmoodn
    replied to negative zero in float calculation
    in C
    thanks for your helpful explanation. i understand :)
    See more | Go to post

    Leave a comment:


  • mahmoodn
    replied to negative zero in float calculation
    in C
    >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...
    See more | Go to post

    Leave a comment:


  • mahmoodn
    started a topic negative zero in float calculation
    in C

    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(
    ...
    See more | Go to post

  • mahmoodn
    replied to invalid initialization of non-const reference
    in C
    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);
    ...
    See more | Go to post

    Leave a comment:


  • mahmoodn
    replied to invalid initialization of non-const reference
    in C
    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) {
          //Ask
    ...
    See more | Go to post

    Leave a comment:


  • mahmoodn
    replied to invalid initialization of non-const reference
    in C
    The second error you mentioned 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*))’
    and that code is:
    Code:
     namespace aux_ {
       API::conf_object_t * NewObject_stub(API::conf_class_t
    ...
    See more | Go to post

    Leave a comment:


  • mahmoodn
    started a topic invalid initialization of non-const reference
    in C

    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...
    See more | Go to post

  • mahmoodn
    replied to expected unqualified-id before ‘:’ token
    in C
    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?
    See more | Go to post

    Leave a comment:


  • mahmoodn
    replied to expected unqualified-id before ‘:’ token
    in C
    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
    
    #else
    ...
    See more | Go to post

    Leave a comment:


  • mahmoodn
    replied to expected unqualified-id before ‘:’ token
    in C
    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,
    ...
    See more | Go to post

    Leave a comment:


  • mahmoodn
    started a topic expected unqualified-id before ‘:’ token
    in C

    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<
    ...
    See more | Go to post
No activity results to display
Show More
Working...