summaryrefslogtreecommitdiff
path: root/src/lib/conf
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-09-04 10:50:09 -0400
committerNick Mathewson <nickm@torproject.org>2019-09-04 10:50:09 -0400
commit539158f2be6001a7849b7a85e053e43d7d78195a (patch)
tree7850ae2117e5307922cf0e52b6875e70633ea55b /src/lib/conf
parent34f3fcef408a91275561e86afc3bd1d2da3b0375 (diff)
downloadtor-539158f2be6001a7849b7a85e053e43d7d78195a.tar.gz
tor-539158f2be6001a7849b7a85e053e43d7d78195a.zip
config: use ptrdiff_t for all field-offset members.
Previously we used int here, but it is more correct to use ptrdiff_t. (This never actually matters for our code in practice, since the structure we are managing here never exceed INT_MAX in size.)
Diffstat (limited to 'src/lib/conf')
-rw-r--r--src/lib/conf/conftypes.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/conf/conftypes.h b/src/lib/conf/conftypes.h
index fabad97d0c..abfb53b21b 100644
--- a/src/lib/conf/conftypes.h
+++ b/src/lib/conf/conftypes.h
@@ -33,6 +33,8 @@
#include "lib/conf/conftesting.h"
#endif
+#include <stddef.h>
+
/** Enumeration of types which option values can take */
typedef enum config_type_t {
CONFIG_TYPE_STRING = 0, /**< An arbitrary string. */
@@ -89,7 +91,7 @@ typedef struct struct_member_t {
* Offset of this field within the structure. Compute this with
* offsetof(structure, fieldname).
**/
- int offset;
+ ptrdiff_t offset;
} struct_member_t;
/**
@@ -102,7 +104,7 @@ typedef struct struct_member_t {
typedef struct struct_magic_decl_t {
const char *typename;
uint32_t magic_val;
- int magic_offset;
+ ptrdiff_t magic_offset;
} struct_magic_decl_t;
/**