Changeset 52 for sources/src/sc_time.cc


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

    r27 r52  
    3535
    3636
    37 #include "sc_time.h"
    3837#include <ctime>
    3938#include <sys/time.h>
    4039#include <string>
    4140#include <sstream>
     41
     42#include "sc_time.h"
     43
    4244#ifdef HAVE_CONFIG_H
    4345#include "config.h"
    4446#endif
    4547
     48
    4649namespace sc_core {
    4750
    48 static const char *const unit_repr_string[6] =
    49 {
     51
     52static const char *const unit_repr_string[6] = {
    5053        "FS", "PS", "NS", "US", "MS", "SEC"
    5154};
     
    5356uint64_t nb_cycles = 0;
    5457
    55 const sc_time SC_ZERO_TIME(0,SC_NS);
    56 sc_time SC_CURRENT_TIME(0,SC_NS);
     58const sc_time SC_ZERO_TIME(0, SC_NS);
     59sc_time SC_CURRENT_TIME(0, SC_NS);
    5760
    58 sc_time::sc_time (const sc_time &t)
    59 {
    60         *this = t;
    61 }
    6261
    63 sc_time::sc_time (double val, sc_time_unit tu)
    64 {
    65   time = (uint64_t) val;
    66   unit = tu;
     62sc_time::sc_time (const sc_time & t) {
     63    *this = t;
    6764}
    6865
    6966
    70 sc_time&
    71 sc_time::operator = (const sc_time &t)
    72 {
    73   time = t.time;
    74   unit = t.unit;
    75   return *this;
     67sc_time::sc_time (double val, sc_time_unit tu) {
     68    time = (uint64_t) val;
     69    unit = tu;
    7670}
    7771
    7872
    79 const std::string
    80 sc_time::to_string () const
    81 {
    82         std::ostringstream o;
    83         o << time << ' ' << unit_repr_string[unit];
    84         return o.str();
     73sc_time & sc_time::operator = (const sc_time & t) {
     74    time = t.time;
     75    unit = t.unit;
     76    return *this;
    8577}
     78
     79
     80const std::string sc_time::to_string() const {
     81    std::ostringstream o;
     82    o << time << ' ' << unit_repr_string[unit];
     83    return o.str();
     84}
     85
    8686
    8787} // end of sc_core namespace
    8888
     89/*
     90# Local Variables:
     91# tab-width: 4;
     92# c-basic-offset: 4;
     93# c-file-offsets:((innamespace . 0)(inline-open . 0));
     94# indent-tabs-mode: nil;
     95# End:
     96#
     97# vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
     98*/
     99
Note: See TracChangeset for help on using the changeset viewer.