[ovs-dev] [of1.2 errors 4/4] Add error codes for Open Flow v1.2

Ben Pfaff blp at nicira.com
Mon Mar 26 22:45:09 UTC 2012


On Mon, Mar 26, 2012 at 02:46:19PM -0700, Reid Price wrote:
> On Mon, Mar 26, 2012 at 1:59 PM, Ben Pfaff <blp at nicira.com> wrote:
> 
> > From: Simon Horman <horms at verge.net.au>
> > @@ -254,12 +304,17 @@ static enum ofperr
> >  %s_decode(uint16_t type, uint16_t code)
> >  {
> >     switch ((type << 16) | code) {""" % name
> > +        found = []
> >
> 
> found = set() might be more appropriate here, won't matter.

Thanks, Reid, I applied:

diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors
index 7054408..efaf103 100755
--- a/build-aux/extract-ofp-errors
+++ b/build-aux/extract-ofp-errors
@@ -304,7 +304,7 @@ static enum ofperr
 %s_decode(uint16_t type, uint16_t code)
 {
     switch ((type << 16) | code) {""" % name
-        found = []
+        found = set()
         for enum in names:
             if enum not in map:
                 continue
@@ -314,7 +314,7 @@ static enum ofperr
             value = (type_ << 16) | code
             if value in found:
                 continue
-            found.append(value)
+            found.add(value)
             print "    case (%d << 16) | %d:" % (type_, code)
             print "        return OFPERR_%s;" % enum
         print """\



More information about the dev mailing list