aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFunctions.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPFunctions.h')
-rw-r--r--Source/SPFunctions.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/SPFunctions.h b/Source/SPFunctions.h
index e462b8cb..0cda7e36 100644
--- a/Source/SPFunctions.h
+++ b/Source/SPFunctions.h
@@ -42,3 +42,10 @@ void SPMainQSync(void (^block)(void));
* @return 0 on success or -1 if something went wrong, check errno
*/
int SPBetterRandomBytes(uint8_t *buf, size_t count);
+
+/**
+ * Convert a signed integer into an unsigned integer or throw an exception if the values don't fit.
+ * @param i a signed integer
+ * @return the same value, casted to unsigned integer
+ */
+NSUInteger SPIntS2U(NSInteger i);