Revision: 4399 http://geany.svn.sourceforge.net/geany/?rev=4399&view=rev Author: ntrel Date: 2009-11-04 15:28:38 +0000 (Wed, 04 Nov 2009)
Log Message: ----------- Deprecate documents_foreach() as it looks more like a function; use foreach_document() instead. Generate dox even for GEANY_DISABLE_DEPRECATED declarations.
Modified Paths: -------------- trunk/ChangeLog trunk/doc/Doxyfile.in trunk/src/document.c trunk/src/document.h trunk/src/filetypes.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-11-04 15:06:56 UTC (rev 4398) +++ trunk/ChangeLog 2009-11-04 15:28:38 UTC (rev 4399) @@ -14,6 +14,10 @@ * src/highlighting.c: Only reload filetype files when changing color scheme, not all configuration files. + * src/filetypes.c, src/document.c, src/document.h, doc/Doxyfile.in: + Deprecate documents_foreach() as it looks more like a function; use + foreach_document() instead. + Generate dox even for GEANY_DISABLE_DEPRECATED declarations.
2009-10-30 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/doc/Doxyfile.in =================================================================== --- trunk/doc/Doxyfile.in 2009-11-04 15:06:56 UTC (rev 4398) +++ trunk/doc/Doxyfile.in 2009-11-04 15:28:38 UTC (rev 4399) @@ -229,7 +229,7 @@ INCLUDE_PATH = INCLUDE_FILE_PATTERNS = # make G_GNUC_PRINTF a no-op unless doxygen would ignore functions with varargs -PREDEFINED = "G_GNUC_PRINTF(x,y)=" GEANY_DISABLE_DEPRECATED HAVE_PLUGINS GEANY_FUNCTIONS_H +PREDEFINED = "G_GNUC_PRINTF(x,y)=" HAVE_PLUGINS GEANY_FUNCTIONS_H EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = NO #---------------------------------------------------------------------------
Modified: trunk/src/document.c =================================================================== --- trunk/src/document.c 2009-11-04 15:06:56 UTC (rev 4398) +++ trunk/src/document.c 2009-11-04 15:28:38 UTC (rev 4399) @@ -90,7 +90,7 @@ * file by then. * * You also need to check @c GeanyDocument::is_valid when iterating over this array, - * although usually you would just use the documents_foreach() macro. + * although usually you would just use the foreach_document() macro. * * Never assume that the order of document pointers is the same as the order of notebook tabs. * Notebook tabs can be reordered. Use @c document_get_from_page(). */
Modified: trunk/src/document.h =================================================================== --- trunk/src/document.h 2009-11-04 15:06:56 UTC (rev 4398) +++ trunk/src/document.h 2009-11-04 15:28:38 UTC (rev 4399) @@ -114,10 +114,18 @@ * @see document_index(). */ #define documents ((GeanyDocument **)GEANY(documents_array)->pdata)
+/** @deprecated Use @ref foreach_document() instead. + * Iterates all valid documents. + * Use like a @c for statement. + * @param i @c guint index for document_index(). */ +#ifndef GEANY_DISABLE_DEPRECATED +#define documents_foreach(i) foreach_document(i) +#endif + /** Iterates all valid documents. * Use like a @c for statement. * @param i @c guint index for document_index(). */ -#define documents_foreach(i) \ +#define foreach_document(i) \ for (i = 0; i < GEANY(documents_array)->len; i++)\ if (!documents[i]->is_valid)\ {}\
Modified: trunk/src/filetypes.c =================================================================== --- trunk/src/filetypes.c 2009-11-04 15:06:56 UTC (rev 4398) +++ trunk/src/filetypes.c 2009-11-04 15:28:38 UTC (rev 4399) @@ -774,7 +774,7 @@ * The user can do this manually with 'Tools->Reload Configuration' */ filetypes_load_config(GEANY_FILETYPES_NONE, TRUE);
- documents_foreach(i) + foreach_document(i) document_reload_config(documents[i]); } } @@ -1618,7 +1618,7 @@ filetypes_load_config(i, TRUE); } /* update document styling */ - documents_foreach(i) + foreach_document(i) document_reload_config(documents[i]); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.