more reformatting/indentation
authorBrian Norris <banorris@uci.edu>
Thu, 2 Aug 2012 17:25:17 +0000 (10:25 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 2 Aug 2012 18:03:11 +0000 (11:03 -0700)
hashtable.h
model.cc

index 5d9e2d620045924a20db2b3bea491622bfe1ebd0..75d68f2c97793bd3208aedea5a216cc58ad68513 100644 (file)
@@ -9,10 +9,10 @@
 #include <stdio.h>
 
 template<typename _Key, typename _Val, void * (* _malloc)(size_t), void * (* _calloc)(size_t, size_t), void (*_free)(void *)>
-       struct hashlistnode {
-               _Key key;
-               _Val val;
-               struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> *next;
+struct hashlistnode {
+       _Key key;
+       _Val val;
+       struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> *next;
 
        void * operator new(size_t size) {
                return _malloc(size);
@@ -29,11 +29,12 @@ template<typename _Key, typename _Val, void * (* _malloc)(size_t), void * (* _ca
        void operator delete[](void *p, size_t size) {
                _free(p);
        }
-       };
-
-/** Hashtable class.  By default it is snapshotting, but you can pass
-               in your own allocation functions. */
+};
 
+/**
+ * Hashtable class.  By default it is snapshotting, but you can pass in your
+ * own allocation functions.
+ */
 template<typename _Key, typename _Val, typename _KeyInt, int _Shift=0, void * (* _malloc)(size_t)=malloc, void * (* _calloc)(size_t, size_t)=calloc, void (*_free)(void *)=free>
        class HashTable {
  public:
@@ -118,13 +119,13 @@ template<typename _Key, typename _Val, typename _KeyInt, int _Shift=0, void * (*
 
        /** Put a key entry into the table. */
        _Val * ensureptr(_Key key) {
-               if(size > threshold) {
+               if (size > threshold) {
                        //Resize
-                 unsigned int newsize = capacity << 1;
-                 resize(newsize);
-         }
+                       unsigned int newsize = capacity << 1;
+                       resize(newsize);
+               }
 
-         struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> *ptr = table[(((_KeyInt)key) & mask)>>_Shift];
+               struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> *ptr = table[(((_KeyInt)key) & mask)>>_Shift];
                size++;
                struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> *search = ptr;
 
index 2b2a5f0ecef177282c4a065d8ac4a91d01eb20dc..b456c246468cd7d5674e65bfe42ff2cd4a348462 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -15,8 +15,7 @@
 ModelChecker *model;
 
 /** @brief Constructor */
-ModelChecker::ModelChecker()
-       :
+ModelChecker::ModelChecker() :
        /* Initialize default scheduler */
        scheduler(new Scheduler()),
        /* First thread created will have id INITIAL_THREAD_ID */