[ovs-git] [openvswitch/ovs] 09dbf1: datapath-windows: fix MIN() macro

GitHub noreply at github.com
Thu Nov 26 05:55:50 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 09dbf169e129778d25e7e69a1d87d4e00cf34505
      https://github.com/openvswitch/ovs/commit/09dbf169e129778d25e7e69a1d87d4e00cf34505
  Author: Nithin Raju <nithin at vmware.com>
  Date:   2015-11-25 (Wed, 25 Nov 2015)

  Changed paths:
    M datapath-windows/ovsext/Util.h

  Log Message:
  -----------
  datapath-windows: fix MIN() macro

A quick implementation of MIN() didn't take into account operator
precedence as shown in the following example:

 #include <stdio.h>
 #define MYMIN(_a, _b) (_a) > (_b) ? (_b) : (_a)
 int main() {
     if (MYMIN(512, 256) < 14) {
   printf("buggy MYMIN\n");
     }
     return 0;
 }

Signed-off-by: Nithin Raju <nithin at vmware.com>
Acked-by: Russell Bryant <russell at ovn.org>
Signed-off-by: Ben Pfaff <blp at ovn.org>




More information about the git mailing list