[flint] 10/24: Updated code_conventions.txt regarding WORD/UWORD macros and flint_printf.
felix salfelder
felix-guest at moszumanska.debian.org
Wed Jun 25 11:16:11 UTC 2014
This is an automated email from the git hooks/post-receive script.
felix-guest pushed a commit to branch master
in repository flint.
commit 20018a699b2a242cec8bf9082a52d231bdf5972b
Author: William Hart <goodwillhart at googlemail.com>
Date: Tue Jun 17 15:49:27 2014 +0100
Updated code_conventions.txt regarding WORD/UWORD macros and flint_printf.
---
code_conventions.txt | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/code_conventions.txt b/code_conventions.txt
index 3e9b08a..1253d47 100644
--- a/code_conventions.txt
+++ b/code_conventions.txt
@@ -40,6 +40,27 @@ The typical definitions of these in terms of primitive types are:
| slong | long or long long |
| ulong | ulong or ulong long |
+Constant integers
+-----------------
+
+Because the ulong/slong types can be (unsigned) long on Linux and (unsigned)
+long long on Windows, we cannot use the usual 123456789UL to declare them.
+
+Instead, we provide two macros:
+
+ WORD(123456789) /* slong constant */
+ UWORD(123456789) /* ulong constant */
+
+Format specifiers
+-----------------
+
+Again, because a ulong/slong use different types on Windows and Linux, we cannot
+use the format specifers %lu/%ld in printf. For this purpose we provide the
+flint_printf functions, which is the same as printf, except that it supports:
+
+ flint_printf("%wu", d); /* print ulong */
+ flint_printf("%wd", d); /* print slong */
+
Use of const
------------
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/flint.git
More information about the debian-science-commits
mailing list