[gtk-vnc-devel] Drop ARRAY_SIZE



Hi, I just committed a little patch to use the GLib macro G_N_ELEMENTS.

-- 
Jonh Wendell
www.bani.com.br

# HG changeset patch
# User Jonh Wendell <wendell bani com br>
# Date 1206475776 10800
# Node ID 15d01d93a5feb5890d1f5f5ac749804e4c99f4ff
# Parent  ded3f3d052058e60a5ba4982c3f8c5d469d94a32
Use GLib's G_N_ELEMENTS instead of our ARRAY_SIZE macro

diff -r ded3f3d05205 -r 15d01d93a5fe src/utils.h
--- a/src/utils.h	Tue Mar 25 14:59:10 2008 -0300
+++ b/src/utils.h	Tue Mar 25 17:09:36 2008 -0300
@@ -17,6 +17,4 @@
 #define GVNC_DEBUG(fmt, ...) do { } while (0)
 #endif
 
-#define ARRAY_SIZE(array) (sizeof((array)) / sizeof((array)[0]))
-
 #endif
diff -r ded3f3d05205 -r 15d01d93a5fe src/vncdisplay.c
--- a/src/vncdisplay.c	Tue Mar 25 14:59:10 2008 -0300
+++ b/src/vncdisplay.c	Tue Mar 25 17:09:36 2008 -0300
@@ -1479,7 +1479,7 @@ static void *vnc_coroutine(void *opaque)
 	emit_signal_delayed(obj, VNC_INITIALIZED, &s);
 
 	encodingsp = encodings;
-	n_encodings = ARRAY_SIZE(encodings);
+	n_encodings = G_N_ELEMENTS(encodings);
 
 	if (check_pixbuf_support("jpeg")) {
 		if (!priv->allow_lossy) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]