#i124422# fix comparisons between pointers and bools or integers

comparing pointers with bools or integers is not a good idea and
clang>=3.4 or xcode>=5.1 now report errors for such code. The
errors break the build and so they have to be fixed.
#i124422# fix implicit conversions to pointer from bool/int32

implicit conversions from bool or int32 to pointer types are not a good idea
and clang>=3.4 or xcode>=5.1 now report errors for such code. The errors break
the build and so they have to be fixed.
#i124422# fix default arguments in friend declarations

chapter 8.3.6.4 of the C++11 standard requests that friend declarations must not
specify default unless these declarations are also definitions. Older compilers
still tolerate such constructs that were still undecided until
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#136
but clang>=3.4 or xcode>=5.1 now report errors for such code. The errors break the
build and so they have to be fixed. Cleaner alternatives to the fixes are possible
but for now they are intended to allow the build while being minimally invasive.