[easytag] Improve et_core_read_file_info invariant check
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Improve et_core_read_file_info invariant check
- Date: Wed, 15 May 2013 17:01:09 +0000 (UTC)
commit ace584e56ab3de44a5548d920f01985cf6e36307
Author: David King <amigadave amigadave com>
Date: Wed May 15 17:43:59 2013 +0100
Improve et_core_read_file_info invariant check
Use g_return_val_if_fail() for the invariant check. Add a gtk-doc style
comment above the function.
src/et_core.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/et_core.c b/src/et_core.c
index e18de5c..d607f6e 100644
--- a/src/et_core.c
+++ b/src/et_core.c
@@ -4625,7 +4625,15 @@ void ET_Mark_File_Name_As_Saved (ET_File *ETFile)
/*
- * Currently, it's a way by default to fill file size into ET_File_Info structure
+ * et_core_read_file_info:
+ * @filename: (type filename): a file from which to read information
+ * @ETFileInfo: (out caller-allocates): a file information structure
+ * @error: a #GError to provide information on erros, or %NULL to ignore
+ *
+ * Fille @ETFileInfo with information about the file. Currently, this only
+ * fills the file size.
+ *
+ * Returns: %TRUE on success, %FALSE otherwise
*/
static gboolean
et_core_read_file_info (const gchar *filename, ET_File_Info *ETFileInfo,
@@ -4633,10 +4641,9 @@ et_core_read_file_info (const gchar *filename, ET_File_Info *ETFileInfo,
{
GFile *file;
GFileInfo *info;
- g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- if (!filename || !ETFileInfo)
- return FALSE;
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+ g_return_val_if_fail (filename != NULL && ETFileInfo != NULL, FALSE);
file = g_file_new_for_path (filename);
info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_SIZE,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]