]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make two 1-bit fields unsigned
authorSebastian Hahn <sebastian@torproject.org>
Thu, 1 Feb 2024 18:45:04 +0000 (19:45 +0100)
committerNick Mathewson <nickm@torproject.org>
Wed, 23 Apr 2025 12:33:35 +0000 (08:33 -0400)
This should be a completely harmless warning as we only check whether
the fields are true or false.

Closes #40911.

(Backported by nickm so that I can compile 0.4.8 without warnings.)

changes/bug40911 [new file with mode: 0644]
src/core/or/half_edge_st.h

diff --git a/changes/bug40911 b/changes/bug40911
new file mode 100644 (file)
index 0000000..c938b56
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes (compiler warnings):
+    - Make sure the two bitfields in the half-closed edge struct are
+      unsigned, as we're using them for boolean values and assign 1 to
+      them. Fixes bug 40911; bugfix on 0.4.7.2-alpha.
+
index 642d8e1ea5247bfdeac3b00ad96f2ca96906da11..d8c183a93c1f5086fc846860858f945ef8dfea1a 100644 (file)
@@ -41,10 +41,10 @@ typedef struct half_edge_t {
   /**
    * Did this edge use congestion control? If so, use
    * timer instead of pending data approach */
-  int used_ccontrol : 1;
+  unsigned int used_ccontrol : 1;
 
   /** Is there a connected cell pending? */
-  int connected_pending : 1;
+  unsigned int connected_pending : 1;
 } half_edge_t;
 
 #endif /* !defined(HALF_EDGE_ST_H) */