nodestack: don't use uint32_t
authorBrian Norris <banorris@uci.edu>
Wed, 22 Aug 2012 22:56:13 +0000 (15:56 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 23 Aug 2012 01:36:32 +0000 (18:36 -0700)
uint32_t (and similar) should only be used when an exact field-size is needed
across platforms with different integer sizes. In this case, we only need an
unsigned type, so just use unsigned int.

nodestack.cc
nodestack.h

index 75ca012b2b65c4fe48eae6bb7f9cfccf109cd118..47f724d856652a501805241df58e939121429e43 100644 (file)
@@ -60,7 +60,7 @@ void Node::print_may_read_from()
  * Sets a promise to explore meeting with the given node.
  * @param i is the promise index.
  */
-void Node::set_promise(uint32_t i) {
+void Node::set_promise(unsigned int i) {
        if (i>=promises.size())
                promises.resize(i+1,0);
        promises[i]=1;
@@ -71,7 +71,7 @@ void Node::set_promise(uint32_t i) {
  * @param i The promise index.
  * @return true if the promise should be satisfied by the given model action.
  */
-bool Node::get_promise(uint32_t i) {
+bool Node::get_promise(unsigned int i) {
        return (i<promises.size())&&(promises[i]==2);
 }
 
index 996bdf3f68fc51e72534815e5caebeab8dc77014..68604675cec7363f29864b10c98e5a4788add85c 100644 (file)
@@ -52,8 +52,8 @@ public:
        bool increment_read_from();
        bool read_from_empty();
 
-       void set_promise(uint32_t i);
-       bool get_promise(uint32_t i);
+       void set_promise(unsigned int i);
+       bool get_promise(unsigned int i);
        bool increment_promise();
        bool promise_empty();
 
@@ -78,7 +78,7 @@ private:
        unsigned int read_from_index;
 
        std::vector< uint64_t, MyAlloc< uint64_t > > future_values;
-       std::vector< uint32_t, MyAlloc< uint32_t > > promises;
+       std::vector< unsigned int, MyAlloc<unsigned int> > promises;
        unsigned int future_index;
 };