SF.net SVN: geany: [1878] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Wed Sep 12 16:25:22 UTC 2007
Revision: 1878
http://geany.svn.sourceforge.net/geany/?rev=1878&view=rev
Author: ntrel
Date: 2007-09-12 09:25:19 -0700 (Wed, 12 Sep 2007)
Log Message:
-----------
Use G_N_ELEMENTS(arr) instead of sizeof(arr) / sizeof(arr[0]).
Correct prev_translators email address.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/about.c
trunk/src/ui_utils.c
trunk/src/win32.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-09-12 16:08:26 UTC (rev 1877)
+++ trunk/ChangeLog 2007-09-12 16:25:19 UTC (rev 1878)
@@ -17,6 +17,9 @@
Rename ui_widgets.popup_items to popup_copy_items.
* doc/geany.txt, doc/geany.html:
Edit how to manually edit geany.conf hidden prefs.
+ * src/win32.c, src/about.c, src/ui_utils.c:
+ Use G_N_ELEMENTS(arr) instead of sizeof(arr) / sizeof(arr[0]).
+ Correct prev_translators email address.
2007-09-11 Enrico Tröger <enrico.troeger at uvena.de>
Modified: trunk/src/about.c
===================================================================
--- trunk/src/about.c 2007-09-12 16:08:26 UTC (rev 1877)
+++ trunk/src/about.c 2007-09-12 16:25:19 UTC (rev 1878)
@@ -60,12 +60,12 @@
{ "zh_CN", "Dormouse Young <dormouse.young at gmail.com>" },
{ "zh_TW", "KoViCH <kovich.ian at gmail.com>" }
};
-static const gint translators_len = sizeof(translators) / sizeof(translators[0]);
+static const gint translators_len = G_N_ELEMENTS(translators);
const gchar *prev_translators[][2] = {
- { "pl_PL", "Jacek Wolszczak <shutdownrunnter at 02.pl>" },
+ { "pl_PL", "Jacek Wolszczak <shutdownrunner at o2.pl>" },
};
-static const gint prev_translators_len = sizeof(prev_translators) / sizeof(prev_translators[0]);
+static const gint prev_translators_len = G_N_ELEMENTS(prev_translators);
static void header_eventbox_style_set(GtkWidget *widget);
Modified: trunk/src/ui_utils.c
===================================================================
--- trunk/src/ui_utils.c 2007-09-12 16:08:26 UTC (rev 1877)
+++ trunk/src/ui_utils.c 2007-09-12 16:25:19 UTC (rev 1878)
@@ -290,7 +290,7 @@
if (idx == -1) enable = FALSE;
else enable = sci_can_copy(doc_list[idx].sci);
- for(i = 0; i < (sizeof(ui_widgets.popup_copy_items)/sizeof(GtkWidget*)); i++)
+ for (i = 0; i < G_N_ELEMENTS(ui_widgets.popup_copy_items); i++)
gtk_widget_set_sensitive(ui_widgets.popup_copy_items[i], enable);
}
@@ -322,7 +322,7 @@
enable = gtk_text_buffer_get_selection_bounds(buffer, NULL, NULL);
}
- for(i = 0; i < (sizeof(ui_widgets.menu_copy_items)/sizeof(GtkWidget*)); i++)
+ for (i = 0; i < G_N_ELEMENTS(ui_widgets.menu_copy_items); i++)
gtk_widget_set_sensitive(ui_widgets.menu_copy_items[i], enable);
}
Modified: trunk/src/win32.c
===================================================================
--- trunk/src/win32.c 2007-09-12 16:08:26 UTC (rev 1877)
+++ trunk/src/win32.c 2007-09-12 16:25:19 UTC (rev 1878)
@@ -525,8 +525,8 @@
// convert the Unicode chars to wide chars
/// TODO test if LANG == C then possibly skip conversion => g_win32_getlocale()
- MultiByteToWideChar(CP_UTF8, 0, msg, -1, w_msg, sizeof(w_msg)/sizeof(w_msg[0]));
- MultiByteToWideChar(CP_UTF8, 0, title, -1, w_title, sizeof(w_title)/sizeof(w_title[0]));
+ MultiByteToWideChar(CP_UTF8, 0, msg, -1, w_msg, G_N_ELEMENTS(w_msg));
+ MultiByteToWideChar(CP_UTF8, 0, title, -1, w_title, G_N_ELEMENTS(w_title));
// display the message box
if (parent == NULL)
@@ -549,8 +549,8 @@
gint ret;
// convert the Unicode chars to wide chars
- MultiByteToWideChar(CP_UTF8, 0, msg, -1, w_msg, sizeof(w_msg)/sizeof(w_msg[0]));
- MultiByteToWideChar(CP_UTF8, 0, _("Question"), -1, w_title, sizeof(w_title)/sizeof(w_title[0]));
+ MultiByteToWideChar(CP_UTF8, 0, msg, -1, w_msg, G_N_ELEMENTS(w_msg));
+ MultiByteToWideChar(CP_UTF8, 0, _("Question"), -1, w_title, G_N_ELEMENTS(w_title));
ret = MessageBoxW(GDK_WINDOW_HWND(app->window->window), w_msg, w_title, MB_YESNOCANCEL | MB_ICONQUESTION);
switch(ret)
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