[Scummvm-cvs-logs] SF.net SVN: scummvm: [26722] scummvm/trunk/backends/platform/PalmOS/Src/ launcher/forms/formSelect.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue May 1 18:11:20 CEST 2007


Revision: 26722
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26722&view=rev
Author:   fingolfin
Date:     2007-05-01 09:11:19 -0700 (Tue, 01 May 2007)

Log Message:
-----------
Don't manually compute & hardcode the sizes of static arrays -- using ARRAYSIZE, which is less error prone and easier to maintain/extend

Modified Paths:
--------------
    scummvm/trunk/backends/platform/PalmOS/Src/launcher/forms/formSelect.cpp

Modified: scummvm/trunk/backends/platform/PalmOS/Src/launcher/forms/formSelect.cpp
===================================================================
--- scummvm/trunk/backends/platform/PalmOS/Src/launcher/forms/formSelect.cpp	2007-05-01 15:47:49 UTC (rev 26721)
+++ scummvm/trunk/backends/platform/PalmOS/Src/launcher/forms/formSelect.cpp	2007-05-01 16:11:19 UTC (rev 26722)
@@ -27,6 +27,7 @@
 #include "formUtil.h"
 #include "games.h"
 #include "start.h"
+#include "common/util.h"
 
 static Char **items = NULL;
 Int16 selectedEngine = -1;
@@ -146,21 +147,21 @@
 	int size;
 	const char **listP;
 } supported[] = {
-	{	10, engine_agos },
-	{	1, engine_sky },
-	{	2, engine_sword1 },
-	{	2, engine_sword2 },
-	{	2, engine_cine },
-	{	1, engine_queen },
-	{	1, engine_lure },
-	{	6, engine_gob },
-	{	3, engine_kyra },
-	{	1, engine_parallaction },
-	{	2, engine_saga },
-	{	10, engine_scumm },
-	{	22, engine_agi },
-	{	1, engine_touche },
-	{	1, engine_cruise }
+	{ ARRAYSIZE(engine_agos), engine_agos },
+	{ ARRAYSIZE(engine_sky), engine_sky },
+	{ ARRAYSIZE(engine_sword1), engine_sword1 },
+	{ ARRAYSIZE(engine_sword2), engine_sword2 },
+	{ ARRAYSIZE(engine_cine), engine_cine },
+	{ ARRAYSIZE(engine_queen), engine_queen },
+	{ ARRAYSIZE(engine_lure), engine_lure },
+	{ ARRAYSIZE(engine_gob), engine_gob },
+	{ ARRAYSIZE(engine_kyra), engine_kyra },
+	{ ARRAYSIZE(engine_parallaction), engine_parallaction },
+	{ ARRAYSIZE(engine_saga), engine_saga },
+	{ ARRAYSIZE(engine_scumm), engine_scumm },
+	{ ARRAYSIZE(engine_agi), engine_agi },
+	{ ARRAYSIZE(engine_touche), engine_touche },
+	{ ARRAYSIZE(engine_cruise), engine_cruise }
 };
 
 static void SelectorSetList(Int16 sel) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list