Commit 626208b1 authored by Ell's avatar Ell

app: write floating-point vars using C locale in performance logs

When writing floating-point instrumentation variables in
performance logs, always use the C locale, rather than the current
locale.
parent a0263f40
......@@ -3463,6 +3463,16 @@ gimp_dashboard_log_sample (GimpDashboard *dashboard,
__VA_ARGS__, \
variable_info->name)
#define LOG_VAR_FLOAT(value) \
G_STMT_START \
{ \
gchar buffer[G_ASCII_DTOSTR_BUF_SIZE]; \
\
LOG_VAR ("%s", g_ascii_dtostr (buffer, sizeof (buffer), \
value)); \
} \
G_STMT_END
switch (variable_info->type)
{
case VARIABLE_TYPE_BOOLEAN:
......@@ -3498,25 +3508,23 @@ gimp_dashboard_log_sample (GimpDashboard *dashboard,
break;
case VARIABLE_TYPE_PERCENTAGE:
LOG_VAR (
"%.16g",
LOG_VAR_FLOAT (
variable_data->value.percentage);
break;
case VARIABLE_TYPE_DURATION:
LOG_VAR (
"%.16g",
LOG_VAR_FLOAT (
variable_data->value.duration);
break;
case VARIABLE_TYPE_RATE_OF_CHANGE:
LOG_VAR (
"%.16g",
LOG_VAR_FLOAT (
variable_data->value.rate_of_change);
break;
}
#undef LOG_VAR
#undef LOG_VAR_FLOAT
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment