Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fix for older gcc #1722

Merged
merged 1 commit into from
Nov 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions common/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ internal_log_config_dump(struct log_config *config)
{
char str_level[20];
struct log_logger_level* logger;
int i;

g_printf("logging configuration:\r\n");
internal_log_lvl2str(config->log_level, str_level);
Expand All @@ -421,13 +422,13 @@ internal_log_config_dump(struct log_config *config)
g_printf("\tSyslogLevel: %s\r\n", str_level);

g_printf("per logger configuration:\r\n");
for (int i = 0; i < config->per_logger_level->count; i++)
for (i = 0; i < config->per_logger_level->count; i++)
{
logger = (struct log_logger_level*)list_get_item(config->per_logger_level, i);
internal_log_lvl2str(logger->log_level, str_level);
g_printf("\t%-*s: %s\r\n", LOGGER_NAME_SIZE, logger->logger_name, str_level);
}
if(config->per_logger_level->count == 0)
if (config->per_logger_level->count == 0)
{
g_printf("\tNone\r\n");
}
Expand Down Expand Up @@ -465,6 +466,8 @@ internalInitAndAllocStruct(void)
void
internal_log_config_copy(struct log_config *dest, const struct log_config *src)
{
int i;

dest->enable_syslog = src->enable_syslog;
dest->fd = src->fd;
dest->log_file = g_strdup(src->log_file);
Expand All @@ -477,7 +480,7 @@ internal_log_config_copy(struct log_config *dest, const struct log_config *src)
dest->enable_console = src->enable_console;
dest->console_level = src->console_level;
dest->enable_pid = src->enable_pid;
for (int i = 0; i < src->per_logger_level->count; ++i)
for (i = 0; i < src->per_logger_level->count; ++i)
{
struct log_logger_level *dst_logger =
(struct log_logger_level*)g_malloc(sizeof(struct log_logger_level), 1);
Expand Down