]> git.openfabrics.org - ~shefty/libibverbs.git/commit
Do not use enum types for bit flags
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Thu, 30 Jul 2009 22:58:16 +0000 (16:58 -0600)
committerRoland Dreier <rolandd@cisco.com>
Mon, 14 Sep 2009 18:20:17 +0000 (11:20 -0700)
commit1687a15b6b1246bc6b66a6e04be4e84627a4855e
tree6f27252eff221ab2d0c63df76fa933ec707ba667
parente17c2efbeb0e2b1252fbeb7cafe43cb96f25bc52
Do not use enum types for bit flags

Arithmetic operations on enum members do not result in the enum type;
C++ is stricter about this than C.  So using flag enums results in
compile errors when they are OR'd together in a C++ application.

To fix this, replace all flag enum objects with int.  int was selected
to preserve the ABI; we checked that enum types are the same size as
int on at least i386, x86-64, ppc32, ppc64, ia64, and mips, and arm
and sparc also appear compatible with this choice.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
include/infiniband/driver.h
include/infiniband/verbs.h
man/ibv_modify_qp.3
man/ibv_modify_srq.3
man/ibv_poll_cq.3
man/ibv_post_send.3
man/ibv_query_qp.3
man/ibv_reg_mr.3
src/cmd.c
src/compat-1_0.c
src/verbs.c