SF.net SVN: geany: [2691] branches/document-pointer
ntrel at users.sourceforge.net
ntrel at xxxxx
Fri Jun 13 15:03:06 UTC 2008
Revision: 2691
http://geany.svn.sourceforge.net/geany/?rev=2691&view=rev
Author: ntrel
Date: 2008-06-13 08:02:29 -0700 (Fri, 13 Jun 2008)
Log Message:
-----------
Move DOC_VALID() macro to document.h, add dox.
Modified Paths:
--------------
branches/document-pointer/ChangeLog
branches/document-pointer/src/document.h
branches/document-pointer/src/msgwindow.c
Modified: branches/document-pointer/ChangeLog
===================================================================
--- branches/document-pointer/ChangeLog 2008-06-13 14:37:59 UTC (rev 2690)
+++ branches/document-pointer/ChangeLog 2008-06-13 15:02:29 UTC (rev 2691)
@@ -3,6 +3,8 @@
* src/msgwindow.c:
Fix a segfault after clicking on a messages window Find Usage item
after the relevant document has been closed.
+ * src/msgwindow.c, src/document.h:
+ Move DOC_VALID() macro to document.h, add dox.
2008-06-12 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: branches/document-pointer/src/document.h
===================================================================
--- branches/document-pointer/src/document.h 2008-06-13 14:37:59 UTC (rev 2690)
+++ branches/document-pointer/src/document.h 2008-06-13 15:02:29 UTC (rev 2691)
@@ -130,6 +130,14 @@
**/
#define documents ((GeanyDocument **)documents_array->pdata)
+/** Check that the @a doc_ptr document still exists (has not been closed).
+ * This is useful when @a doc_ptr was stored some time earlier and documents may have been
+ * closed since then.
+ * @note This should not be used to check the result of the main API functions,
+ * these only need a NULL-pointer check - @c p_document->get_current() != @c NULL. */
+#define DOC_VALID(doc_ptr) \
+ ((doc_ptr) != NULL && (doc_ptr)->is_valid)
+
/** NULL-safe way to get the index of @a doc_ptr in the documents array. */
#define DOC_IDX(doc_ptr) \
(doc_ptr ? doc_ptr->index : -1)
Modified: branches/document-pointer/src/msgwindow.c
===================================================================
--- branches/document-pointer/src/msgwindow.c 2008-06-13 14:37:59 UTC (rev 2690)
+++ branches/document-pointer/src/msgwindow.c 2008-06-13 15:02:29 UTC (rev 2691)
@@ -791,9 +791,6 @@
}
-#define DOC_VALID(doc_ptr) \
- ((doc_ptr) != NULL && (doc_ptr)->is_valid)
-
gboolean msgwin_goto_messages_file_line()
{
GtkTreeIter iter;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list