]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't use signed 1-bit bitfields
authorSebastian Hahn <sebastian@torproject.org>
Wed, 8 Jun 2011 19:27:32 +0000 (21:27 +0200)
committerSebastian Hahn <sebastian@torproject.org>
Wed, 8 Jun 2011 19:30:41 +0000 (21:30 +0200)
This was harmless, we never compared it to anything but itself or 0.
But Coverity complained, and it had a point.

changes/coverity_maint
src/or/policies.c

index fd8c44050582ae6f04aeed29f4aca4067a86044f..6d60355b113411ae76484ff5b020843057a1e115 100644 (file)
@@ -4,4 +4,5 @@
   o Minor bugfixes:
     - Add some forgotten return value checks during unit tests. Found
       by coverity.
+    - Don't use 1-bit wide signed bit fields. Found by coverity.
 
index e48f42058fe92d9484793c73e523deec4a6ce24d..c87036013d2b9ca0063c6bd2889a6263280f20cb 100644 (file)
@@ -45,7 +45,7 @@ typedef struct policy_summary_item_t {
     uint16_t prt_max; /**< Highest port number to accept/reject. */
     uint64_t reject_count; /**< Number of IP-Addresses that are rejected to
                                 this port range. */
-    int accepted:1; /** Has this port already been accepted */
+    unsigned int accepted:1; /** Has this port already been accepted */
 } policy_summary_item_t;
 
 /** Private networks.  This list is used in two places, once to expand the