aboutsummaryrefslogtreecommitdiffstats
path: root/libj2.h
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-12-14 16:28:56 +0100
committerMattias Andrée <m@maandree.se>2025-12-14 16:28:56 +0100
commit276ceee498d9dda587207ec51a86c6d094db9e46 (patch)
tree71e3b1e8f7bb57bd8095a2bf59f890d4f178c582 /libj2.h
parentDocument the macros, structs, and enum (diff)
downloadlibj2-276ceee498d9dda587207ec51a86c6d094db9e46.tar.gz
libj2-276ceee498d9dda587207ec51a86c6d094db9e46.tar.bz2
libj2-276ceee498d9dda587207ec51a86c6d094db9e46.tar.xz
Add negative overflow to enum libj2_overflow
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libj2.h')
-rw-r--r--libj2.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/libj2.h b/libj2.h
index c351e43..07c251b 100644
--- a/libj2.h
+++ b/libj2.h
@@ -114,7 +114,9 @@ struct libj2_j2i {
* is costly in edge cases, and thus stopped
* as soon as such an edge case is detected
*
- * @since 1.0
+ * @since 1.0 LIBJ2_NO_OVERFLOW, LIBJ2_OVERFLOW, LIBJ2_OVERFLOW_UNKNOWN
+ * @since 1.1 LIBJ2_POSITIVE_OVERFLOW, LIBJ2_POSITIVE_OVERFLOW_UNKNOWN,
+ * LIBJ2_NEGATIVE_OVERFLOW, LIBJ2_NEGATIVE_OVERFLOW_UNKNOWN
*/
enum libj2_overflow {
/**
@@ -123,15 +125,30 @@ enum libj2_overflow {
LIBJ2_NO_OVERFLOW = 0,
/**
- * Where will be an overflow
+ * Where will be a positive overflow
+ */
+ LIBJ2_POSITIVE_OVERFLOW = 1,
+#define LIBJ2_OVERFLOW LIBJ2_POSITIVE_OVERFLOW
+
+ /**
+ * Overflow prediction stopped
+ * (due to high cost);
+ * result is positive
+ */
+ LIBJ2_POSITIVE_OVERFLOW_UNKNOWN = 2,
+#define LIBJ2_OVERFLOW_UNKNOWN LIBJ2_POSITIVE_OVERFLOW_UNKNOWN
+
+ /**
+ * Where will be a positive overflow
*/
- LIBJ2_OVERFLOW = 1,
+ LIBJ2_NEGATIVE_OVERFLOW = -1,
/**
* Overflow prediction stopped
- * (due to high cost)
+ * (due to high cost);
+ * result is positive
*/
- LIBJ2_OVERFLOW_UNKNOWN = 2
+ LIBJ2_NEGATIVE_OVERFLOW_UNKNOWN = -2
};