From 7308ffb91e48f5f1dccee36f868b296cbb74b4a3 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 21 Jan 2014 15:52:16 +1100 Subject: Using ELEMENTS for clarity and safety. Avoid memset for safety. --- gtk/ScintillaGTK.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gtk/ScintillaGTK.cxx') diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index f2efd84fc..ee0758bcd 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -31,6 +31,7 @@ #ifdef SCI_LEXER #include "SciLexer.h" #endif +#include "StringCopy.h" #include "SplitVector.h" #include "Partitioning.h" #include "RunStyles.h" @@ -338,14 +339,14 @@ static const GtkTargetEntry clipboardCopyTargets[] = { { (gchar *) "UTF8_STRING", 0, TARGET_UTF8_STRING }, { (gchar *) "STRING", 0, TARGET_STRING }, }; -static const gint nClipboardCopyTargets = sizeof(clipboardCopyTargets) / sizeof(clipboardCopyTargets[0]); +static const gint nClipboardCopyTargets = ELEMENTS(clipboardCopyTargets); static const GtkTargetEntry clipboardPasteTargets[] = { { (gchar *) "text/uri-list", 0, TARGET_URI }, { (gchar *) "UTF8_STRING", 0, TARGET_UTF8_STRING }, { (gchar *) "STRING", 0, TARGET_STRING }, }; -static const gint nClipboardPasteTargets = sizeof(clipboardPasteTargets) / sizeof(clipboardPasteTargets[0]); +static const gint nClipboardPasteTargets = ELEMENTS(clipboardPasteTargets); static GtkWidget *PWidget(Window &w) { return reinterpret_cast(w.GetID()); -- cgit v1.2.3