Permalink
Browse files

changed comment style, added braces to one of the error handling cases

  • Loading branch information...
1 parent 174417a commit 67b9a15c98951f8c8fb4503ec7f52acb61b6589f Sebastian Niller committed Feb 22, 2011
Showing with 22 additions and 20 deletions.
  1. +22 −20 Language/Atom/Code.hs
View
@@ -245,66 +245,68 @@ writeC name config state rules schedule assertionNames coverageNames probeNames
, " static bool __first_call = true;"
, " " ++ globalType ++ " " ++ currentTime ++ ";"
, ""
- , " // save the current time"
+ , " /* save the current time */"
, " " ++ setTime
, ""
- , " // initialize static variables on the first call"
+ , " /* initialize static variables on the first call */"
, " if ( __first_call ) {"
, " " ++ lastPhaseStartTime ++ " = " ++ phaseStartTime ++ ";"
, " " ++ lastTime ++ " = " ++ currentTime ++ ";"
, " __first_call = false;"
, " }"
, ""
- , " // wait for the amount left for the phase start time to be reached,"
- , " // handle roll-overs of the system timer and the phase start time"
+ , " /* wait for the amount left for the phase start time to be reached,"
+ , " handle roll-overs of the system timer and the phase start time */"
, " if ( " ++ phaseStartTime ++ " >= " ++ lastPhaseStartTime ++ " ) {"
- , " // phase start time did not roll over"
+ , " /* phase start time did not roll over */"
, " if ( " ++ currentTime ++ " >= " ++ lastTime ++ " ) {"
- , " // system time and the phase start time did not roll over"
+ , " /* system time and the phase start time did not roll over */"
, " if ( " ++ phaseStartTime ++ " >= " ++ currentTime ++ " ) {"
, " " ++ delayFn ++ " ( " ++ phaseStartTime ++ " - " ++ currentTime ++ " );"
, " } else {"
- , " // we are late"
+ , " /* we are late */"
, " " ++ errHandler
, " }"
, " } else {"
- , " // system time rolled over, the start time of the"
- , " // phase did not, i.e. we are not late if currentTime"
- , " // is already in between lastPhaseStartTime and phaseStartTime"
+ , " /* system time rolled over, the start time of the"
+ , " phase did not, i.e. we are not late if currentTime"
+ , " is already in between lastPhaseStartTime and phaseStartTime */"
, " if ( ( " ++ currentTime ++ " >= " ++ lastPhaseStartTime ++ " ) "
, " && ( " ++ currentTime ++ " < " ++ phaseStartTime ++ " ) )"
, " " ++ delayFn ++ " ( " ++ phaseStartTime ++ " - " ++ currentTime ++ " );"
- , " else"
+ , " else {"
+ , " /* we are late */"
, " " ++ errHandler
+ , " }"
, " }"
, " } else {"
- , " // phase start time rolled over"
+ , " /* phase start time rolled over */"
, " if (" ++ currentTime ++ " >= " ++ lastTime ++ ") {"
- , " // current time did not yet roll over"
+ , " /* current time did not yet roll over */"
, " if (" ++ currentTime ++ " >= " ++ phaseStartTime ++ ") {"
, " " ++ delayFn ++ " ( " ++ maxConst
++ " - ( " ++ currentTime
++ " - " ++ phaseStartTime ++ " )" ++ " );"
, " } else {"
- , " // this should not happen, since " ++ phaseConst ++ " should be"
- , " // smaller than " ++ maxConst ++ " and " ++ lastTime ++ " should"
- , " // be smaller than or equal to " ++ currentTime
+ , " /* this should not happen, since " ++ phaseConst ++ " should be"
+ , " smaller than " ++ maxConst ++ " and " ++ lastTime ++ " should"
+ , " be smaller than or equal to " ++ currentTime ++ " */"
, " " ++ errHandler
, " }"
, " } else {"
- , " // current time and phase start time rolled over"
- , " // equal to the first case"
+ , " /* current time and phase start time rolled over"
+ , " equal to the first case */"
, " if ( " ++ phaseStartTime ++ " >= " ++ currentTime ++ " ) {"
, " " ++ delayFn ++ " ( " ++ phaseStartTime ++ " - " ++ currentTime ++ " );"
, " } else {"
- , " // we are late"
+ , " /* we are late */"
, " " ++ errHandler
, " }"
, " }"
, " }"
, ""
, ""
- , " // update to the next phase start time"
+ , " /* update to the next phase start time */"
, " " ++ lastPhaseStartTime ++ " = " ++ phaseStartTime ++ ";"
, " " ++ phaseStartTime ++ " = " ++ phaseStartTime ++ " + "
++ phaseConst ++ ";"

0 comments on commit 67b9a15

Please sign in to comment.