From 86e02354547be2e038017318709f46ee1b954728 Mon Sep 17 00:00:00 2001 From: Tomas Mlcoch Date: Fri, 6 Feb 2015 10:58:53 +0100 Subject: [PATCH] cleanup: Add _cleanup_file_fclose_ --- src/cleanup.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/cleanup.h b/src/cleanup.h index 9b850b4..b3109f0 100644 --- a/src/cleanup.h +++ b/src/cleanup.h @@ -50,18 +50,19 @@ G_BEGIN_DECLS func (*(Type*)v, TRUE); \ } +CR_DEFINE_CLEANUP_FUNCTION0(FILE*, cr_local_file_fclose, fclose) CR_DEFINE_CLEANUP_FUNCTION0(GArray*, cr_local_array_unref, g_array_unref) CR_DEFINE_CLEANUP_FUNCTION0(GChecksum*, cr_local_checksum_free, g_checksum_free) CR_DEFINE_CLEANUP_FUNCTION0(GDir*, cr_local_dir_close, g_dir_close) -CR_DEFINE_CLEANUP_FUNCTION0(int, cr_local_file_close, close) CR_DEFINE_CLEANUP_FUNCTION0(GError*, cr_local_free_error, g_error_free) CR_DEFINE_CLEANUP_FUNCTION0(GHashTable*, cr_local_hashtable_unref, g_hash_table_unref) +CR_DEFINE_CLEANUP_FUNCTION0(GKeyFile*, cr_local_keyfile_free, g_key_file_free) #if GLIB_CHECK_VERSION(2, 32, 0) CR_DEFINE_CLEANUP_FUNCTION0(GKeyFile*, cr_local_keyfile_unref, g_key_file_unref) #endif -CR_DEFINE_CLEANUP_FUNCTION0(GKeyFile*, cr_local_keyfile_free, g_key_file_free) CR_DEFINE_CLEANUP_FUNCTION0(GPtrArray*, cr_local_ptrarray_unref, g_ptr_array_unref) CR_DEFINE_CLEANUP_FUNCTION0(GTimer*, cr_local_destroy_timer, g_timer_destroy) +CR_DEFINE_CLEANUP_FUNCTION0(int, cr_local_file_close, close) CR_DEFINE_CLEANUP_FUNCTIONt(GString*, cr_local_free_string, g_string_free) @@ -69,20 +70,21 @@ CR_DEFINE_CLEANUP_FUNCTION(char**, cr_local_strfreev, g_strfreev) CR_DEFINE_CLEANUP_FUNCTION(GList*, cr_local_free_list, g_list_free) CR_DEFINE_CLEANUP_FUNCTION(void*, cr_local_free, g_free) +#define _cleanup_array_unref_ __attribute__ ((cleanup(cr_local_array_unref))) +#define _cleanup_checksum_free_ __attribute__ ((cleanup(cr_local_checksum_free))) #define _cleanup_dir_close_ __attribute__ ((cleanup(cr_local_dir_close))) +#define _cleanup_error_free_ __attribute__ ((cleanup(cr_local_free_error))) #define _cleanup_file_close_ __attribute__ ((cleanup(cr_local_file_close))) -#define _cleanup_timer_destroy_ __attribute__ ((cleanup(cr_local_destroy_timer))) +#define _cleanup_file_fclose_ __attribute__ ((cleanup(cr_local_file_fclose))) #define _cleanup_free_ __attribute__ ((cleanup(cr_local_free))) -#define _cleanup_checksum_free_ __attribute__ ((cleanup(cr_local_checksum_free))) -#define _cleanup_error_free_ __attribute__ ((cleanup(cr_local_free_error))) -#define _cleanup_list_free_ __attribute__ ((cleanup(cr_local_free_list))) -#define _cleanup_string_free_ __attribute__ ((cleanup(cr_local_free_string))) -#define _cleanup_strv_free_ __attribute__ ((cleanup(cr_local_strfreev))) -#define _cleanup_array_unref_ __attribute__ ((cleanup(cr_local_array_unref))) #define _cleanup_hashtable_unref_ __attribute__ ((cleanup(cr_local_hashtable_unref))) -#define _cleanup_keyfile_unref_ __attribute__ ((cleanup(cr_local_keyfile_unref))) #define _cleanup_keyfile_free_ __attribute__ ((cleanup(cr_local_keyfile_free))) +#define _cleanup_keyfile_unref_ __attribute__ ((cleanup(cr_local_keyfile_unref))) +#define _cleanup_list_free_ __attribute__ ((cleanup(cr_local_free_list))) #define _cleanup_ptrarray_unref_ __attribute__ ((cleanup(cr_local_ptrarray_unref))) +#define _cleanup_string_free_ __attribute__ ((cleanup(cr_local_free_string))) +#define _cleanup_strv_free_ __attribute__ ((cleanup(cr_local_strfreev))) +#define _cleanup_timer_destroy_ __attribute__ ((cleanup(cr_local_destroy_timer))) G_END_DECLS -- 2.7.4