Changeset 59 for sources/src/sc_port.cc


Ignore:
Timestamp:
Feb 6, 2017, 11:35:42 AM (8 years ago)
Author:
meunier
Message:
  • Fixed memory leaks
  • Fixed indentation in some files
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sources/src/sc_port.cc

    r58 r59  
    5353    extern char unstable;
    5454    char unstable = 0; // not in sc_core namespace because dynamic link support C linkage only
    55     unsigned int pending_write_vector_nb = 0;
     55    int32 pending_write_vector_nb = 0;
    5656}
    5757
     
    6767extern equi_list_t equi_list;
    6868
    69 const char * get_module_name (const tab_t * pointer) {
    70         const equi_t & eq = get_equi (pointer);
    71     return get_module_name (eq);
     69const char * get_module_name(const tab_t * pointer) {
     70    const equi_t & eq = get_equi(pointer);
     71    return get_module_name(eq);
    7272}
    7373
     
    8787
    8888sc_port_base::sc_port_base() {
    89         init ();
     89    init ();
    9090}
    9191
     
    216216            // stl vectors are too slow
    217217            // memcopy is not better
    218             // signal table sorting doesn't give any better performance 
     218            // signal table sorting doesn't give any better performance
    219219#if defined(DUMP_STAGE)
    220220            cerr << "(" << pending_write_vector_nb
     
    229229                    exit (8);
    230230                }
    231 #endif 
     231#endif
    232232#ifdef DUMP_SIGNAL_STATS
    233233                if (*(iter.pointer) == iter.value) {
     
    236236                counter[iter.pointer]++;
    237237#endif
    238                 *(iter.pointer) = iter.value;   
     238                *(iter.pointer) = iter.value;
    239239#undef iter
    240240            }
     
    277277    for (k = counter.begin(); k != counter.end(); ++k) {
    278278        string module_name = get_module_name (k->first);
    279         counter_by_module[module_name] += k->second;   
     279        counter_by_module[module_name] += k->second;
    280280    }
    281281    o << "module name / usage\n";
     
    290290#endif
    291291}
     292
    292293
    293294static bool is_bound(/*const*/ sc_port_base & port) {
     
    297298        return false; // case : sc_in not bound
    298299    }
    299     return has_equi (port);
    300 }
     300    return has_equi(port);
     301}
     302
    301303
    302304static void check_port(/*const*/ sc_port_base & port) {
    303     if (!is_bound (port)) {
     305    if (!is_bound(port)) {
    304306        cerr << "Error : '" << port.name() << "' port"
    305307            " (" << port.kind() << ")"
     
    316318    port2module_t::/*const_*/iterator i;
    317319    for (i = port2module.begin(); i != port2module.end(); ++i) {
    318         /*const*/ sc_port_base *port = i->first;
     320        /*const*/ sc_port_base * port = i->first;
    319321        assert(port != NULL);
    320322        check_port(*port);
Note: See TracChangeset for help on using the changeset viewer.