configure: Add option --enable-Werror to add -Werror to CFLAGS.
[sliver-openvswitch.git] / ovsdb / ovsdb-idlc.in
index e8371aa..2a4c67c 100755 (executable)
@@ -20,9 +20,7 @@ def annotateSchema(schemaFile, annotationFile):
     ovs.json.to_stream(schemaJson, sys.stdout)
 
 def constify(cType, const):
-    if (const
-        and cType.endswith('*') and not cType.endswith('**')
-        and (cType.startswith('struct uuid') or cType.startswith('char'))):
+    if (const and cType.endswith('*') and not cType.endswith('**')):
         return 'const %s' % cType
     else:
         return cType
@@ -310,7 +308,7 @@ static void
 {
     /* Nothing to do. */
 }''' % {'s': structName, 'c': columnName}
+
         # First, next functions.
         print '''
 const struct %(s)s *
@@ -489,7 +487,11 @@ static void\n%s_columns_init(void)
     print "struct ovsdb_idl_table_class %stable_classes[%sN_TABLES] = {" % (prefix, prefix.upper())
     for tableName, table in sorted(schema.tables.iteritems()):
         structName = "%s%s" % (prefix, tableName.lower())
-        print "    {\"%s\"," % tableName
+        if table.is_root:
+            is_root = "true"
+        else:
+            is_root = "false"
+        print "    {\"%s\", %s," % (tableName, is_root)
         print "     %s_columns, ARRAY_SIZE(%s_columns)," % (
             structName, structName)
         print "     sizeof(struct %s)}," % structName
@@ -566,7 +568,7 @@ if __name__ == "__main__":
         except getopt.GetoptError, geo:
             sys.stderr.write("%s: %s\n" % (argv0, geo.msg))
             sys.exit(1)
-            
+
         for key, value in options:
             if key in ['-h', '--help']:
                 usage()
@@ -576,7 +578,7 @@ if __name__ == "__main__":
                 os.chdir(value)
             else:
                 sys.exit(0)
-            
+
         optKeys = [key for key, value in options]
 
         if not args: