From 274fe375264e1767a8dcaea06eaa5d6735e32e37 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 19 Mar 2013 01:10:28 +0100 Subject: rewritten CHR2STR() using compound statement * fixes compilation on g++ 4.7 where compound literals are suddenly temporaries (from which you cannot get a pointer) * the compound statement (also GCC extension) should ensure that the string is allocated on the stack with automatic lifetime --- src/parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/parser.cpp') diff --git a/src/parser.cpp b/src/parser.cpp index cb1f577..66880e3 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -322,7 +322,7 @@ StateCtlE: break; default: set(StateStart); - return g_strdup((gchar []){CTL_KEY('E'), chr, '\0'}); + return g_strdup(CHR2STR(CTL_KEY('E'), chr)); } return NULL; @@ -343,7 +343,7 @@ StateCtlEU: undo.push_obj(qregspec_machine) = NULL; set(StateStart); - return g_strdup(CHR2STR(reg->get_integer())); + return g_strdup(CHR2STR((gchar)reg->get_integer())); StateCtlEQ: reg = qregspec_machine->input(chr); -- cgit v1.2.3