From 109c235bb23836ebe9a95bd5862a0e7ead568236 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 14 Jul 2004 15:19:58 +0000 Subject: un-const the return values, since they need to be freed (d): turn off * e-mktemp.c (e_mktemp, e_mkdtemp): un-const the return values, since they need to be freed (d): turn off debugging (expire_dir_rec): remove debug printfs svn path=/trunk/; revision=26647 --- e-util/ChangeLog | 7 +++++++ e-util/e-mktemp.c | 13 ++++++------- e-util/e-mktemp.h | 6 +++--- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 2e8cc8b4d4..d9da256403 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,10 @@ +2004-07-12 Dan Winship + + * e-mktemp.c (e_mktemp, e_mkdtemp): un-const the return values, + since they need to be freed + (d): turn off debugging + (expire_dir_rec): remove debug printfs + 2004-07-02 Chris Toshok [ fixes #60691 ] diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c index 2e40a4d8a2..9e5b8f7ba0 100644 --- a/e-util/e-mktemp.c +++ b/e-util/e-mktemp.c @@ -40,7 +40,7 @@ #include "e-mktemp.h" -#define d(x) x +#define d(x) /* define to put temporary files in ~/evolution/cache/tmp */ #define TEMP_HOME (1) @@ -60,7 +60,7 @@ expire_dir_rec(const char *base, time_t now) struct stat st; int count = 0; - printf("expire dir '%s'\n", base); + d(printf("expire dir '%s'\n", base)); dir = opendir(base); if (dir == NULL) @@ -100,7 +100,7 @@ expire_dir_rec(const char *base, time_t now) g_string_free(path, TRUE); closedir(dir); - printf("expire dir '%s' %d remaining files\n", base, count); + d(printf("expire dir '%s' %d remaining files\n", base, count)); return count; } @@ -153,8 +153,7 @@ get_dir (gboolean make) } #endif - if (path) - printf("temp dir '%s'\n", path->str); + d(printf("temp dir '%s'\n", path ? path->str : "(null)")); /* fire off an expirey attempt no more often than TEMP_SCAN seconds */ if (path && (last+TEMP_SCAN) < now) { @@ -165,7 +164,7 @@ get_dir (gboolean make) return path; } -const char * +char * e_mktemp (const char *template) { GString *path; @@ -211,7 +210,7 @@ e_mkstemp (const char *template) } -const char * +char * e_mkdtemp (const char *template) { GString *path; diff --git a/e-util/e-mktemp.h b/e-util/e-mktemp.h index b5eb587d86..14fbb9bcc8 100644 --- a/e-util/e-mktemp.h +++ b/e-util/e-mktemp.h @@ -23,10 +23,10 @@ #ifndef __E_MKTEMP_H__ #define __E_MKTEMP_H__ -const char *e_mktemp (const char *template); +char *e_mktemp (const char *template); -int e_mkstemp (const char *template); +int e_mkstemp (const char *template); -const char *e_mkdtemp (const char *template); +char *e_mkdtemp (const char *template); #endif /* __E_MKTEMP_H__ */ -- cgit v1.2.3