SF.net SVN: geany:[4969] branches/sm/src/main.c

statc at users.sourceforge.net statc at xxxxx
Mon May 31 09:23:33 UTC 2010


Revision: 4969
          http://geany.svn.sourceforge.net/geany/?rev=4969&view=rev
Author:   statc
Date:     2010-05-31 09:23:33 +0000 (Mon, 31 May 2010)

Log Message:
-----------
Add g_assert() to ensure that `optentries' and `optentries_aux' are of the same size.

Modified Paths:
--------------
    branches/sm/src/main.c

Modified: branches/sm/src/main.c
===================================================================
--- branches/sm/src/main.c	2010-05-31 09:23:04 UTC (rev 4968)
+++ branches/sm/src/main.c	2010-05-31 09:23:33 UTC (rev 4969)
@@ -125,9 +125,9 @@
  * NOTE: Currently optentries of type G_OPTION_ARG_CALLBACK are not supported by
  * X session management support implementation.
  */
-/* in alphabetical order of short options */
 GOptionEntry optentries[] =
 {
+	/* in alphabetical order of short options */
 	{ "column", 0, 0, G_OPTION_ARG_INT, &cl_options.goto_column, N_("Set initial column number for the first opened file (useful in conjunction with --line)"), NULL },
 	{ "config", 'c', 0, G_OPTION_ARG_FILENAME, &alternate_config, N_("Use an alternate configuration directory"), NULL },
 	{ "ft-names", 0, 0, G_OPTION_ARG_NONE, &ft_names, N_("Print internal filetype names"), NULL },
@@ -980,6 +980,9 @@
 
 	log_handlers_init();
 
+	g_assert_cmpint(sizeof(optentries)/sizeof(optentries[0]) - 1 /* null */, ==,
+		sizeof(optentries_aux)/sizeof(optentries_aux[0]));
+
 	app = g_new0(GeanyApp, 1);
 	memset(&main_status, 0, sizeof(GeanyStatus));
 	memset(&prefs, 0, sizeof(GeanyPrefs));


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