diff -r 202e74157de5 -r eb4c25284a19 sources/format.h --- 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 FUNCTION -expand_format_arguments (Vector& data, const T& arg, const RestTypes& ... rest) -> void +template +void expand_format_arguments (Vector& 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 FUNCTION -format (const String& fmtstr, const argtypes&... raw_args) -> String +template +String format (const String& fmtstr, const argtypes&... raw_args) { Vector 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 FUNCTION -print_to (FILE* fp, const String& fmtstr, Args const& ...args) -> void +template +void print_to (FILE* fp, const String& fmtstr, Args const& ...args) { std::fprintf (fp, "%s", format (fmtstr, args...).chars()); }