summaryrefslogtreecommitdiff
path: root/lib/intprops.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2015-12-29 21:39:08 -0800
committerJohn Wiegley <johnw@newartisans.com>2015-12-29 21:39:08 -0800
commitec0a80cc283badc7f7fd5ef78512dde6d34b1355 (patch)
tree7190e0fb3d4aa06018d8cf997f06b806fb09a9c8 /lib/intprops.h
parentd259328fb87db8cc67d52771efcfa653e52c5b71 (diff)
parente823c34072bf045800d91e12c7ddb61fa23c6e30 (diff)
downloademacs-25-merge.tar.gz
Merge emacs-25 into master (using imerge)emacs-25-merge
Diffstat (limited to 'lib/intprops.h')
-rw-r--r--lib/intprops.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/intprops.h b/lib/intprops.h
index 8fff86d4371..ecafaf70e15 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -272,9 +272,10 @@
Example usage, assuming A and B are long int:
- long int result = INT_MULTIPLY_WRAPV (a, b);
- printf ("result is %ld (%s)\n", result,
- INT_MULTIPLY_OVERFLOW (a, b) ? "after overflow" : "no overflow");
+ if (INT_MULTIPLY_OVERFLOW (a, b))
+ printf ("result would overflow\n");
+ else
+ printf ("result is %ld (no overflow)\n", a * b);
Example usage with WRAPV flavor: