Ignore:
Timestamp:
Jan 22, 2013, 4:23:22 PM (12 years ago)
Author:
meunier
Message:

Code formatting in all source files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sources/src/sc_interface.cc

    r31 r52  
    3434 */
    3535
     36#include <iostream>
     37#include <map>
     38#include <cstdlib>  //exit
     39
    3640#include "sc_interface.h"
    3741#include "sc_event.h"
    3842#include "assert.h"
    39 #include <iostream>
    40 #include <map>
     43
    4144#ifdef HAVE_CONFIG_H
    4245#include "config.h"
    4346#endif
    44 #include <cstdlib>  //exit
    4547
    4648using namespace std;
    4749
    4850namespace sc_core {
     51
    4952struct interface_infos_t {
    50         size_t data_size_in_bytes;
    51         sc_event default_event;
    52         interface_infos_t ()
    53         {
    54                 exit(12);
    55         }
    56         interface_infos_t (size_t s, sc_event e)
    57                 : data_size_in_bytes(s), default_event (e)
    58         {
    59         }
     53    size_t data_size_in_bytes;
     54    sc_event default_event;
     55    interface_infos_t() {
     56        exit(12);
     57    }
     58    interface_infos_t (size_t s, sc_event e) : data_size_in_bytes(s), default_event(e) {}
    6059};
    61 typedef std::map<const sc_interface*,interface_infos_t> interface2infos_t;
     60
     61typedef std::map<const sc_interface *,interface_infos_t> interface2infos_t;
    6262static interface2infos_t interface2infos;
     63
    6364}
    6465
     
    7172// ----------------------------------------------------------------------------
    7273
    73 #if 0
    74 static
    75 ostream&
    76 operator << (ostream &o,
    77              const sc_interface &i)
    78 {
    79         return o << hex << &i;
    80 }
    81 #endif
    82 
    83 /*
    84 void
    85 sc_interface::register_port (sc_port_base & port_, const char *if_typename_)
    86 {
    87 }
    88 */
    89 
    90 sc_interface::~sc_interface ()
    91 {}
     74sc_interface::~sc_interface() {}
    9275 
    9376// constructor
    94 sc_interface::sc_interface ()
    95 {
     77sc_interface::sc_interface() {
    9678  pointer = NULL; // => not assigned
    9779}
    9880
    99 void
    100 sc_interface::init (size_t s) const
    101 {
    102         interface2infos_t::value_type pair (this,
    103                         interface_infos_t (s,sc_event (*this, sc_event::VAL)));
    104         interface2infos.insert (pair);
     81
     82void sc_interface::init (size_t s) const {
     83    interface2infos_t::value_type pair (this, interface_infos_t(s,sc_event (*this, sc_event::VAL)));
     84    interface2infos.insert(pair);
    10585}
    10686
    107 size_t
    108 sc_interface::data_size_in_bytes () const
    109 {
    110         interface2infos_t::iterator i = interface2infos.find (this);
     87size_t sc_interface::data_size_in_bytes () const {
     88    interface2infos_t::iterator i = interface2infos.find(this);
    11189#ifdef CONFIG_DEBUG
    112         if (i == interface2infos.end ()) {
    113                 cerr << "Internal error : can't find data size of " << this << "\n";
    114                 exit (90);
    115         }
     90    if (i == interface2infos.end()) {
     91        cerr << "Internal error : can't find data size of " << this << "\n";
     92        exit (90);
     93    }
    11694#endif
    117         return i->second.data_size_in_bytes;
     95    return i->second.data_size_in_bytes;
    11896}
    11997
    120 const sc_event &
    121 sc_interface::default_event () const
    122 {
    123         interface2infos_t::iterator i = interface2infos.find (this);
     98
     99const sc_event & sc_interface::default_event () const {
     100    interface2infos_t::iterator i = interface2infos.find(this);
    124101#ifdef CONFIG_DEBUG
    125         if (i == interface2infos.end ()) {
    126                 cerr << "Internal error : can't find default event of " << this << "\n";
    127                 exit (90);
    128         }
     102    if (i == interface2infos.end ()) {
     103        cerr << "Internal error : can't find default event of " << this << "\n";
     104        exit (90);
     105    }
    129106#endif
    130         return i->second.default_event;
     107    return i->second.default_event;
    131108}
    132109
     110
     111/*
     112# Local Variables:
     113# tab-width: 4;
     114# c-basic-offset: 4;
     115# c-file-offsets:((innamespace . 0)(inline-open . 0));
     116# indent-tabs-mode: nil;
     117# End:
     118#
     119# vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
     120*/
     121
Note: See TracChangeset for help on using the changeset viewer.