sources/format.h

changeset 69
eb4c25284a19
parent 66
bd28a5730fd0
child 70
0e947b487b18
--- a/sources/format.h	Tue Dec 16 23:50:56 2014 +0200
+++ b/sources/format.h	Mon May 04 15:51:03 2015 +0300
@@ -34,7 +34,7 @@
 #include "geometry.h"
 
 #define FORMAT_OVERLOAD(...) \
-	inline FUNCTION make_format_argument (__VA_ARGS__ a) -> String
+	inline String make_format_argument (__VA_ARGS__ a)
 
 // -------------------------------------------------------------------------------------------------
 //
@@ -97,8 +97,15 @@
 	return "???";
 }
 
-FORMAT_OVERLOAD (Position) { return String ("(") + a.x + ", " + a.y + ")"; }
-FORMAT_OVERLOAD (Size) { return String ("(") + a.width + "x" + a.height + ")"; }
+FORMAT_OVERLOAD (Position)
+{
+	return String ("(") + a.x + ", " + a.y + ")";
+}
+
+FORMAT_OVERLOAD (Size)
+{
+	return String ("(") + a.width + "x" + a.height + ")";
+}
 
 FORMAT_OVERLOAD (Rectangle)
 {
@@ -117,8 +124,8 @@
 //
 // Expands the given arguments into a vector of strings.
 //
-template<typename T, typename... RestTypes> FUNCTION
-expand_format_arguments (Vector<String>& data, const T& arg, const RestTypes& ... rest) -> void
+template<typename T, typename... RestTypes>
+void expand_format_arguments (Vector<String>& data, const T& arg, const RestTypes& ... rest)
 {
 	data.append (make_format_argument (arg));
 	expand_format_arguments (data, rest...);
@@ -152,8 +159,8 @@
 //      argument did not expand into a number in the first place, 0 is used
 //      and 0x0 is printed.
 //
-template<typename... argtypes> FUNCTION
-format (const String& fmtstr, const argtypes&... raw_args) -> String
+template<typename... argtypes>
+String format (const String& fmtstr, const argtypes&... raw_args)
 {
 	Vector<String> args;
 	expand_format_arguments (args, raw_args...);
@@ -166,8 +173,7 @@
 // It returns the formatter string as-is.
 //
 static String format (const String& fmtstr) __attribute__ ((unused));
-static String // FUNCTION
-format (const String& fmtstr) // -> String
+static String format (const String& fmtstr) // -> String
 {
 	return fmtstr;
 }
@@ -176,8 +182,8 @@
 //
 // Prints the formatting result to the given file handle
 //
-template<typename... Args> FUNCTION
-print_to (FILE* fp, const String& fmtstr, Args const& ...args) -> void
+template<typename... Args>
+void print_to (FILE* fp, const String& fmtstr, Args const& ...args)
 {
 	std::fprintf (fp, "%s", format (fmtstr, args...).chars());
 }

mercurial