summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2010-12-09 13:15:43 +0000
committerSebastian Dransfeld <sd@tango.flipp.net>2010-12-09 13:15:43 +0000
commite88061b9aa6f7d86e5f71e867e139b63297f5e65 (patch)
treea184913971d7e6e05897ba4e5e430483a09dfb94 /legacy
parent4e9fa3d6f7babcb4e2e58677cb716cd1a87e2f9f (diff)
Reduce stack usage
For functions often called, don't put unneded mem on stack SVN revision: 55411
Diffstat (limited to 'legacy')
-rw-r--r--legacy/efreet/src/lib/efreet_cache.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/legacy/efreet/src/lib/efreet_cache.c b/legacy/efreet/src/lib/efreet_cache.c
index dae2fe7df7..b890ac0f51 100644
--- a/legacy/efreet/src/lib/efreet_cache.c
+++ b/legacy/efreet/src/lib/efreet_cache.c
@@ -217,11 +217,12 @@ efreet_icon_cache_file(void)
217EAPI const char * 217EAPI const char *
218efreet_icon_theme_cache_file(void) 218efreet_icon_theme_cache_file(void)
219{ 219{
220 char tmp[PATH_MAX] = { '\0' }; 220 char *tmp;
221 221
222 if (icon_theme_cache_file) return icon_theme_cache_file; 222 if (icon_theme_cache_file) return icon_theme_cache_file;
223 223
224 snprintf(tmp, sizeof(tmp), "%s/efreet/icon_themes_%s.eet", 224 tmp = alloca(PATH_MAX);
225 snprintf(tmp, PATH_MAX, "%s/efreet/icon_themes_%s.eet",
225 efreet_cache_home_get(), efreet_hostname_get()); 226 efreet_cache_home_get(), efreet_hostname_get());
226 icon_theme_cache_file = eina_stringshare_add(tmp); 227 icon_theme_cache_file = eina_stringshare_add(tmp);
227 228
@@ -257,24 +258,25 @@ efreet_version_edd(void)
257EAPI const char * 258EAPI const char *
258efreet_desktop_cache_file(void) 259efreet_desktop_cache_file(void)
259{ 260{
260 char tmp[PATH_MAX] = { '\0' }; 261 char *tmp;
261 const char *cache, *lang, *country, *modifier; 262 const char *cache, *lang, *country, *modifier;
262 263
263 if (desktop_cache_file) return desktop_cache_file; 264 if (desktop_cache_file) return desktop_cache_file;
264 265
266 tmp = alloca(PATH_MAX);
265 cache = efreet_cache_home_get(); 267 cache = efreet_cache_home_get();
266 lang = efreet_lang_get(); 268 lang = efreet_lang_get();
267 country = efreet_lang_country_get(); 269 country = efreet_lang_country_get();
268 modifier = efreet_lang_modifier_get(); 270 modifier = efreet_lang_modifier_get();
269 271
270 if (lang && country && modifier) 272 if (lang && country && modifier)
271 snprintf(tmp, sizeof(tmp), "%s/efreet/desktop_%s_%s_%s@%s.eet", cache, efreet_hostname_get(), lang, country, modifier); 273 snprintf(tmp, PATH_MAX, "%s/efreet/desktop_%s_%s_%s@%s.eet", cache, efreet_hostname_get(), lang, country, modifier);
272 else if (lang && country) 274 else if (lang && country)
273 snprintf(tmp, sizeof(tmp), "%s/efreet/desktop_%s_%s_%s.eet", cache, efreet_hostname_get(), lang, country); 275 snprintf(tmp, PATH_MAX, "%s/efreet/desktop_%s_%s_%s.eet", cache, efreet_hostname_get(), lang, country);
274 else if (lang) 276 else if (lang)
275 snprintf(tmp, sizeof(tmp), "%s/efreet/desktop_%s_%s.eet", cache, efreet_hostname_get(), lang); 277 snprintf(tmp, PATH_MAX, "%s/efreet/desktop_%s_%s.eet", cache, efreet_hostname_get(), lang);
276 else 278 else
277 snprintf(tmp, sizeof(tmp), "%s/efreet/desktop_%s.eet", cache, efreet_hostname_get()); 279 snprintf(tmp, PATH_MAX, "%s/efreet/desktop_%s.eet", cache, efreet_hostname_get());
278 280
279 desktop_cache_file = eina_stringshare_add(tmp); 281 desktop_cache_file = eina_stringshare_add(tmp);
280 return desktop_cache_file; 282 return desktop_cache_file;
@@ -286,11 +288,12 @@ efreet_desktop_cache_file(void)
286EAPI const char * 288EAPI const char *
287efreet_desktop_cache_dirs(void) 289efreet_desktop_cache_dirs(void)
288{ 290{
289 char tmp[PATH_MAX] = { '\0' }; 291 char *tmp;
290 292
291 if (desktop_cache_dirs) return desktop_cache_dirs; 293 if (desktop_cache_dirs) return desktop_cache_dirs;
292 294
293 snprintf(tmp, sizeof(tmp), "%s/efreet/desktop_dirs.cache", efreet_cache_home_get()); 295 tmp = alloca(PATH_MAX);
296 snprintf(tmp, PATH_MAX, "%s/efreet/desktop_dirs.cache", efreet_cache_home_get());
294 297
295 desktop_cache_dirs = eina_stringshare_add(tmp); 298 desktop_cache_dirs = eina_stringshare_add(tmp);
296 return desktop_cache_dirs; 299 return desktop_cache_dirs;