=== modified file 'osmtypes.h'
--- osmtypes.h	2010-11-07 18:54:12 +0000
+++ osmtypes.h	2011-01-13 13:49:52 +0000
@@ -6,6 +6,7 @@
 #include "keyvals.h"
 
 enum OsmType { OSMTYPE_WAY, OSMTYPE_NODE, OSMTYPE_RELATION };
+#define OSM_TYPE_COUNT 3
 
 struct osmNode {
     double lon;

=== modified file 'output-pgsql.c'
--- output-pgsql.c	2010-12-05 23:32:10 +0000
+++ output-pgsql.c	2011-01-13 13:49:52 +0000
@@ -86,8 +86,8 @@
     int count;
 };
 
-static struct taginfo *exportList[4]; /* Indexed by enum table_id */
-static int exportListCount[4];
+static struct taginfo *exportList[OSM_TYPE_COUNT]; /* Indexed by enum table_id */
+static int exportListCount[OSM_TYPE_COUNT];
 
 /* Data to generate z-order column and road table
  * The name of the roads table is misleading, this table
@@ -227,7 +227,7 @@
     // Currently this scales with n^2 number of styles
     int i,j;
 
-    for (i=0; i<NUM_TABLES; i++) {
+    for (i=0; i<OSM_TYPE_COUNT; i++) {
         for(j=0; j<exportListCount[i]; j++) {
             if (exportList[i][j].name == name)
                 exportList[i][j].name = NULL;
@@ -240,14 +240,14 @@
 static void free_style(void)
 {
     int i, j;
-    for (i=0; i<NUM_TABLES; i++) {
+    for (i=0; i<OSM_TYPE_COUNT; i++) {
         for(j=0; j<exportListCount[i]; j++) {
             free(exportList[i][j].name);
             free(exportList[i][j].type);
             free_style_refs(exportList[i][j].name, exportList[i][j].type);
         }
     }
-    for (i=0; i<NUM_TABLES; i++)
+    for (i=0; i<OSM_TYPE_COUNT; i++)
         free(exportList[i]);
 }
 

