summaryrefslogtreecommitdiff
path: root/navit/attr.h
diff options
context:
space:
mode:
authorSebastian Leske <sebastian.leske@sleske.name>2015-11-12 18:10:36 +0100
committerSebastian Leske <sebastian.leske@sleske.name>2015-11-14 00:34:06 +0100
commitb1c61538efd863473ce1fa1b3a8effd59b48e219 (patch)
tree394a225536559b0dbb101199a032344e11e7658c /navit/attr.h
parent655d54922f552ffc493ef5f24d8351ed21d25c0a (diff)
downloadnavit-b1c61538efd863473ce1fa1b3a8effd59b48e219.tar.gz
Refactor:Add comments and #defines for relative attribute values.
Diffstat (limited to 'navit/attr.h')
-rw-r--r--navit/attr.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/navit/attr.h b/navit/attr.h
index 6835f6ef2..27b37be60 100644
--- a/navit/attr.h
+++ b/navit/attr.h
@@ -97,9 +97,24 @@ enum attr_format {
#define AF_DG_EXPLOSIVE (1<<2)
#define AF_DG_FLAMMABLE (1<<3)
-/* Values for attributes that could carry relative values */
-#define ATTR_REL_MAXABS 0x40000000
-#define ATTR_REL_RELSHIFT 0x60000000
+/*
+ * Values for attributes that could carry relative values.
+ * Some attributes allow both absolute and relative values. The value for these
+ * attributes is stored as an int. Absolute values are stored as-is, relative
+ * values are stored shifted by adding ATTR_REL_RELSHIFT.
+ */
+/** Minimum value for an absolute attribute value. */
+#define ATTR_REL_MINABS -0x40000000
+/** Maximum value for an absolute attribute value. */
+#define ATTR_REL_MAXABS 0x40000000
+/** Minimum value for an relative attribute value (without value shift). */
+#define ATTR_REL_MINREL -0x1FFFFFFF
+/** Maximum value for an relative attribute value (without value shift). */
+#define ATTR_REL_MAXREL 0x20000000
+/**
+ * Value shift for relative values. This value is added to an attribute values to indicate
+ * a relative value. */
+#define ATTR_REL_RELSHIFT 0x60000000
/** Indicates whether a position is valid **/
enum attr_position_valid {