fix tabbing
authorbdemsky <bdemsky@uci.edu>
Fri, 21 Jun 2019 15:38:27 +0000 (08:38 -0700)
committerbdemsky <bdemsky@uci.edu>
Fri, 21 Jun 2019 15:38:27 +0000 (08:38 -0700)
execution.cc
main.cc
model.cc
params.h
snapshot.cc

index c32b628876fc22ccf3a4aba46d2839f182f99965..7b09871e4b5a73c335e04393c77b1667841ba04c 100644 (file)
@@ -64,7 +64,7 @@ ModelExecution::ModelExecution(ModelChecker *m, Scheduler *scheduler, NodeStack
        thrd_last_fence_release(),
        node_stack(node_stack),
        priv(new struct model_snapshot_members ()),
-       mo_graph(new CycleGraph()),
+                        mo_graph(new CycleGraph()),
        fuzzer(new Fuzzer())
 {
        /* Initialize a model-checker thread, for special ModelActions */
@@ -279,8 +279,8 @@ void ModelExecution::process_read(ModelAction *curr, SnapVector<const ModelActio
                        get_thread(curr)->set_return_value(curr->get_return_value());
                        delete priorset;
                        if (canprune && curr->get_type() == ATOMIC_READ) {
-                         int tid = id_to_int(curr->get_tid());
-                         (*obj_thrd_map.get(curr->get_location()))[tid].pop_back();
+                               int tid = id_to_int(curr->get_tid());
+                               (*obj_thrd_map.get(curr->get_location()))[tid].pop_back();
                        }
                        return;
                }
@@ -783,7 +783,7 @@ bool ModelExecution::r_modification_order(ModelAction *curr, const ModelAction *
        int tid = curr->get_tid();
        ModelAction *prev_same_thread = NULL;
        /* Iterate over all threads */
-       for (i = 0;i < thrd_lists->size();i++, tid = (((unsigned int)(tid+1)) == thrd_lists->size()) ? 0: tid + 1) {
+       for (i = 0;i < thrd_lists->size();i++, tid = (((unsigned int)(tid+1)) == thrd_lists->size()) ? 0 : tid + 1) {
                /* Last SC fence in thread tid */
                ModelAction *last_sc_fence_thread_local = NULL;
                if (i != 0)
@@ -796,11 +796,11 @@ bool ModelExecution::r_modification_order(ModelAction *curr, const ModelAction *
 
                //Only need to iterate if either hb has changed for thread in question or SC fence after last operation...
                if (prev_same_thread != NULL &&
-                   (prev_same_thread->get_cv()->getClock(tid) == curr->get_cv()->getClock(tid)) &&
-                   (last_sc_fence_thread_local == NULL || *last_sc_fence_thread_local < *prev_same_thread)) {
-                     continue;
+                               (prev_same_thread->get_cv()->getClock(tid) == curr->get_cv()->getClock(tid)) &&
+                               (last_sc_fence_thread_local == NULL || *last_sc_fence_thread_local < *prev_same_thread)) {
+                       continue;
                }
-               
+
                /* Iterate over actions in thread, starting from most recent */
                action_list_t *list = &(*thrd_lists)[tid];
                action_list_t::reverse_iterator rit;
@@ -850,12 +850,12 @@ bool ModelExecution::r_modification_order(ModelAction *curr, const ModelAction *
                         * before" curr
                         */
                        if (act->happens_before(curr)) {
-                         if (i==0) {
-                           if (last_sc_fence_local == NULL ||
-                               (*last_sc_fence_local < *prev_same_thread)) {
-                             prev_same_thread = act;
-                           }
-                         }
+                               if (i==0) {
+                                       if (last_sc_fence_local == NULL ||
+                                                       (*last_sc_fence_local < *prev_same_thread)) {
+                                               prev_same_thread = act;
+                                       }
+                               }
                                if (act->is_write()) {
                                        if (mo_graph->checkReachable(rf, act))
                                                return false;
diff --git a/main.cc b/main.cc
index df8b8776610a40a83ffc7b04540ccdc400586b70..0abc80b7e766063c5b3304be14d3a86dbc049045 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -103,9 +103,9 @@ static void parse_options(struct model_params *params, int argc, char **argv)
                case 'h':
                        print_usage(argv[0], params);
                        break;
-               case 'n':
-                 params->nofork = true;
-                 break;
+               case 'n':
+                       params->nofork = true;
+                       break;
                case 'x':
                        params->maxexecutions = atoi(optarg);
                        break;
index 6dce3682fe6971ad061d83dbc30c5cf785085b73..84a60a510456fbea7cd6f0e4e6df87499c40ee48 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -151,7 +151,7 @@ void ModelChecker::print_bugs() const
                                                        bugs->size(),
                                                        bugs->size() > 1 ? "s" : "");
        for (unsigned int i = 0;i < bugs->size();i++)
-               (*bugs)[i] -> print();
+               (*bugs)[i]->print();
 }
 
 /**
@@ -162,15 +162,15 @@ void ModelChecker::print_bugs() const
  */
 void ModelChecker::record_stats()
 {
-       stats.num_total ++;
+       stats.num_total++;
        if (!execution->isfeasibleprefix())
-               stats.num_infeasible ++;
+               stats.num_infeasible++;
        else if (execution->have_bug_reports())
-               stats.num_buggy_executions ++;
+               stats.num_buggy_executions++;
        else if (execution->is_complete_execution())
-               stats.num_complete ++;
+               stats.num_complete++;
        else {
-               stats.num_redundant ++;
+               stats.num_redundant++;
 
                /**
                 * @todo We can violate this ASSERT() when fairness/sleep sets
@@ -251,7 +251,7 @@ bool ModelChecker::next_execution()
                return true;
        }
 // test code
-       execution_number ++;
+       execution_number++;
        reset_to_initial_state();
        node_stack->full_reset();
        return false;
@@ -259,8 +259,8 @@ bool ModelChecker::next_execution()
 
 /** @brief Run trace analyses on complete trace */
 void ModelChecker::run_trace_analyses() {
-       for (unsigned int i = 0;i < trace_analyses.size();i ++)
-               trace_analyses[i] -> analyze(execution->get_action_trace());
+       for (unsigned int i = 0;i < trace_analyses.size();i++)
+               trace_analyses[i]->analyze(execution->get_action_trace());
 }
 
 /**
@@ -366,7 +366,7 @@ void ModelChecker::run()
        char random_state[256];
        initstate(423121, random_state, sizeof(random_state));
 
-       for(int exec = 0;exec < params.maxexecutions;exec ++) {
+       for(int exec = 0;exec < params.maxexecutions;exec++) {
                thrd_t user_thread;
                Thread *t = new Thread(execution->get_next_id(), &user_thread, &user_main_wrapper, NULL, NULL); // L: user_main_wrapper passes the user program
                execution->add_thread(t);
index 7f5c219205096ff3c5a6b38ceec1db2f983508c0..db86895890d8061cbe4fedbc04d908263c5081be 100644 (file)
--- a/params.h
+++ b/params.h
@@ -8,8 +8,8 @@
 struct model_params {
        unsigned int uninitvalue;
        int maxexecutions;
-  bool nofork;
-  
+       bool nofork;
+
        /** @brief Verbosity (0 = quiet; 1 = noisy; 2 = noisier) */
        int verbose;
 
index d73613832e867eb069b5f5288b72f95bc04c96ff..ce2b28fe3dc4cb0952ed9b11c8c79b923b71b021 100644 (file)
@@ -385,10 +385,10 @@ static void fork_snapshot_init(unsigned int numbackingpages,
        /* switch back here when takesnapshot is called */
        snapshotid = fork_snap->currSnapShotID;
        if (model->params.nofork) {
-         setcontext(&fork_snap->shared_ctxt);
-         exit(EXIT_SUCCESS);
+               setcontext(&fork_snap->shared_ctxt);
+               exit(EXIT_SUCCESS);
        }
-       
+
        while (true) {
                pid_t forkedID;
                fork_snap->currSnapShotID = snapshotid + 1;