void
filter_undeletables(ProxySnapshots& snapshots, vector<ProxySnapshots::iterator>& nums)
{
- auto filter = [&snapshots, &nums](ProxySnapshots::const_iterator undeletable, const string& message)
+ auto filter = [&snapshots, &nums](ProxySnapshots::const_iterator undeletable, const char* message)
{
if (undeletable == snapshots.end())
return;
using namespace std;
-string _(const char* msgid)
+
+const char*
+_(const char* msgid)
{
return dgettext("snapper", msgid);
}
-string _(const char* msgid, const char* msgid_plural, unsigned long int n)
+
+const char*
+_(const char* msgid, const char* msgid_plural, unsigned long int n)
{
return dngettext("snapper", msgid, msgid_plural, n);
}
#include <string>
#include <iosfwd>
-std::string _(const char* msgid);
-std::string _(const char* msgid, const char* msgid_plural, unsigned long int n);
+const char* _(const char* msgid) __attribute__ ((format_arg(1)));
+
+const char* _(const char* msgid, const char* msgid_plural, unsigned long int n)
+ __attribute__ ((format_arg(1))) __attribute__ ((format_arg(2)));
/** Returns the column width of a multi-byte character string \a str */
unsigned mbs_width (const std::string & str);
string
- sformat(const string& format, ...)
+ sformat(const char* format, ...)
{
char* result;
string str;
va_list ap;
va_start(ap, format);
- if (vasprintf(&result, format.c_str(), ap) != -1)
+ if (vasprintf(&result, format, ap) != -1)
{
str = result;
free(result);
};
- string sformat(const string& format, ...);
+ string sformat(const char* format, ...) __attribute__ ((format(printf, 1, 2)));
struct runtime_error_with_errno : public std::runtime_error