diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index e165e9e4a098..0b31a3a96a87 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -1180,14 +1179,16 @@ namespace cppcanvas SAL_INFO("cppcanvas.emf", "EMF+\tfont\nEMF+\theader: 0x" << std::hex << (header >> 12) << " version: 0x" << (header & 0x1fff) << " size: " << std::dec << emSize << " unit: 0x" << std::hex << sizeUnit << std::dec); SAL_INFO("cppcanvas.emf", "EMF+\tflags: 0x" << std::hex << fontFlags << " reserved: 0x" << reserved << " length: 0x" << std::hex << length << std::dec); - if( length > 0 && length < 0x4000 ) { - sal_Unicode *chars = static_cast(alloca( sizeof( sal_Unicode ) * length )); + if (length > 0 && length < 0x4000) + { + rtl_uString *pStr = rtl_uString_alloc(length); + sal_Unicode *chars = pStr->buffer; - for( sal_uInt32 i = 0; i < length; i++ ) - s.ReadUtf16( chars[ i ] ); + for (sal_uInt32 i = 0; i < length; ++i) + s.ReadUtf16(chars[i]); - family = OUString( chars, length ); - SAL_INFO("cppcanvas.emf", "EMF+\tfamily: " << OUStringToOString( family, RTL_TEXTENCODING_UTF8).getStr()); // TODO: can we just use family? + family = OUString(pStr, SAL_NO_ACQUIRE); + SAL_INFO("cppcanvas.emf", "EMF+\tfamily: " << family); } } }; diff --git a/hwpfilter/source/grammar.cxx b/hwpfilter/source/grammar.cxx index b72e4040c23d..282145890e16 100644 --- a/hwpfilter/source/grammar.cxx +++ b/hwpfilter/source/grammar.cxx @@ -362,33 +362,6 @@ static const short yycheck[] = { 11, It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ -#ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || (defined (__sun) && defined (__i386)) -#define YYSTACK_USE_ALLOCA -#include -#else /* not sparc */ -#if defined(_AIX) - #pragma alloca -#define YYSTACK_USE_ALLOCA -#endif /* not _AIX */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ - -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif - /* Note: there must be only one dollar sign in this file. It is replaced by the list of actions, each action as one case of the switch. */ @@ -612,17 +585,15 @@ yynewstate: yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA yyfree_stacks = 1; -#endif - yyss = static_cast(YYSTACK_ALLOC (yystacksize * sizeof (*yyssp))); + yyss = static_cast(malloc (yystacksize * sizeof (*yyssp))); memcpy (yyss, yyss1, size * (unsigned int) sizeof (*yyssp)); - yyvs = static_cast(YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp))); + yyvs = static_cast(malloc (yystacksize * sizeof (*yyvsp))); memcpy (yyvs, yyvs1, size * (unsigned int) sizeof (*yyvsp)); #ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + yyls = (YYLTYPE *) malloc (yystacksize * sizeof (*yylsp)); memcpy ((char *)yyls, (char *)yyls1, size * (unsigned int) sizeof (*yylsp)); #endif