2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

ovs.db.types: Use toAtomicType() instead of open-coding it.

Suggested-by: Reid Price <reid@nicira.com>
This commit is contained in:
Ben Pfaff
2011-08-23 10:04:14 -07:00
parent f09aa106ee
commit ca2c5d3d32

View File

@@ -337,8 +337,8 @@ class BaseType(object):
def cInitBaseType(self, indent, var):
stmts = []
stmts.append('ovsdb_base_type_init(&%s, OVSDB_TYPE_%s);' % (
var, self.type.to_string().upper()),)
stmts.append('ovsdb_base_type_init(&%s, %s);' % (
var, self.toAtomicType()))
if self.enum:
stmts.append("%s.enum_ = xmalloc(sizeof *%s.enum_);"
% (var, var))