Merge commit 'origin/stable'
[pspp-builds.git] / src / libpspp / misc.h
index 3b02515709ca9969c8d67eab5c9c2210e4822d1e..c2f865d90c95512d7ec4d3517c68dff96e0181d4 100644 (file)
@@ -77,4 +77,23 @@ maximize (double *dest, double src)
     *dest = src;
 }
 
+
+/* Set *DEST to the lower of *DEST and SRC */
+static inline void
+minimize_int (int *dest, int src)
+{
+  if (src < *dest)
+    *dest = src;
+}
+
+
+/* Set *DEST to the greater of *DEST and SRC */
+static inline void
+maximize_int (int *dest, int src)
+{
+  if (src > *dest)
+    *dest = src;
+}
+
+
 #endif /* libpspp/misc.h */