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_sensitive.cc

    r27 r52  
    4141#include "sc_module.h"
    4242#include "internal.h"
     43
    4344#ifdef HAVE_CONFIG_H
    4445#include "config.h"
     
    4849
    4950namespace sc_core {
    50   void assert_before_init ()
    51   {
    52     if (sc_core::already_initialized == true)
    53       exit (14);
    54   }
    55   static
    56         void add_sensitivity (const sc_event &s)
    57   {
    58                 if (method == NULL) {
    59                         cerr << "declare a process before declaring " << s << " event\n";
    60                         exit (1);
    61                 }
    62     method->sensitivity_list.push_back(s);
    63   }
     51
     52
     53void assert_before_init() {
     54    if (sc_core::already_initialized) {
     55        exit(14);
     56    }
    6457}
    6558
    66 //
     59
     60static void add_sensitivity(const sc_event & s) {
     61    if (method == NULL) {
     62        cerr << "declare a process before declaring " << s << " event\n";
     63        exit(1);
     64    }
     65    method->sensitivity_list.push_back(s);
     66}
     67
     68}
     69
     70
    6771using namespace sc_core;
    6872
     
    7377// ----------------------------------------------------------------------------
    7478
    75 sc_sensitive& sc_sensitive::operator << (const sc_port_base& port)
    76 {
    77   sc_event s (port,sc_event::VAL);
    78   sc_core::add_sensitivity (s);
    79   return *this;
     79sc_sensitive & sc_sensitive::operator << (const sc_port_base & port) {
     80    sc_event s(port, sc_event::VAL);
     81    sc_core::add_sensitivity(s);
     82    return *this;
    8083}
    8184
    82 sc_sensitive& sc_sensitive::operator () (const sc_port_base& port)
    83 {
    84   return *this << port;
     85
     86sc_sensitive & sc_sensitive::operator () (const sc_port_base & port) {
     87    return *this << port;
    8588}
    8689
    87 sc_sensitive& sc_sensitive::operator << (const sc_event &e)
    88 {
    89   sc_core::add_sensitivity (e);
    90   return *this;
     90
     91sc_sensitive & sc_sensitive::operator << (const sc_event & e) {
     92    sc_core::add_sensitivity(e);
     93    return *this;
    9194}
    9295
    93 sc_sensitive& sc_sensitive::operator () (const sc_event& e)
    94 {
    95   return *this << e;
     96
     97sc_sensitive & sc_sensitive::operator () (const sc_event & e) {
     98    return *this << e;
    9699}
    97100
    98 sc_sensitive& sc_sensitive::operator << (sc_event_finder& e)
    99 {
    100   return *this << e.port ();
     101
     102sc_sensitive & sc_sensitive::operator << (sc_event_finder & e) {
     103    return *this << e.port();
    101104}
    102105
    103 sc_sensitive& sc_sensitive::operator () (sc_event_finder& e)
    104 {
    105   return *this << e;
     106
     107sc_sensitive & sc_sensitive::operator () (sc_event_finder & e) {
     108    return *this << e;
    106109}
    107110
    108 sc_sensitive& sc_sensitive::operator << (const sc_interface &e)
    109 {
    110   return *this << e.default_event ();
     111
     112sc_sensitive & sc_sensitive::operator << (const sc_interface & e) {
     113    return *this << e.default_event();
    111114}
    112115
    113 sc_sensitive& sc_sensitive::operator () (const sc_interface &e)
    114 {
    115   return *this << e;
     116
     117sc_sensitive & sc_sensitive::operator () (const sc_interface & e) {
     118    return *this << e;
    116119}
     120
    117121
    118122
     
    124128// ----------------------------------------------------------------------------
    125129
    126 sc_sensitive_pos& sc_sensitive_pos::operator << (const sc_port_base& port)
    127 {
    128   sc_event s (port,sc_event::POS);
    129   sc_core::add_sensitivity (s);
    130   return *this;
     130
     131sc_sensitive_pos & sc_sensitive_pos::operator << (const sc_port_base & port) {
     132    sc_event s(port, sc_event::POS);
     133    sc_core::add_sensitivity(s);
     134    return *this;
    131135}
    132136
    133 sc_sensitive_pos& sc_sensitive_pos::operator () (const sc_port_base& port)
    134 {
    135   return *this << port;
     137
     138sc_sensitive_pos& sc_sensitive_pos::operator () (const sc_port_base & port) {
     139    return *this << port;
    136140}
    137141
    138 /*
    139 sc_sensitive_pos& sc_sensitive_pos::operator << (const sc_interface &e)
    140 {
    141         sc_event s (e, sc_event::POS);
    142   sc_core::add_sensitivity (s);
    143   return *this;
    144 };
    145142
    146 sc_sensitive_pos& sc_sensitive_pos::operator () (const sc_interface &e)
    147 {
    148   return *this << e;
    149 };
    150 */
    151143
    152144// ----------------------------------------------------------------------------
     
    156148// ----------------------------------------------------------------------------
    157149
    158 sc_sensitive_neg& sc_sensitive_neg::operator << (const sc_port_base& port)
    159 {
    160   sc_event s (port,sc_event::NEG);
    161   sc_core::add_sensitivity (s);
    162   return *this;
     150sc_sensitive_neg & sc_sensitive_neg::operator << (const sc_port_base & port) {
     151    sc_event s(port, sc_event::NEG);
     152    sc_core::add_sensitivity(s);
     153    return *this;
    163154}
    164155
    165 sc_sensitive_neg& sc_sensitive_neg::operator () (const sc_port_base& port)
    166 {
    167   return *this << port;
     156
     157sc_sensitive_neg & sc_sensitive_neg::operator () (const sc_port_base & port) {
     158    return *this << port;
    168159}
    169160
    170161
    171162
     163/*
     164# Local Variables:
     165# tab-width: 4;
     166# c-basic-offset: 4;
     167# c-file-offsets:((innamespace . 0)(inline-open . 0));
     168# indent-tabs-mode: nil;
     169# End:
     170#
     171# vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
     172*/
     173
Note: See TracChangeset for help on using the changeset viewer.