Reviewed all changes in pull request and made sure all cpp files
check orb_advert_t types against nullptr and c files check against
NULL.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The existing orb_advert_t use thoughout the code sometimes tries
to treat it as a file descriptor and there are checks for < 0
and ::close calls on orb_advert_t types which is an invalid use
of an object pointer, which is what orb_advert_t really is.
Initially I had changed the -1 initializations to 0 but it was
suggested that this should be nullptr. That was a good recommendation
but the definition of orb_advert_t had to change to void * because
you cannot initialize a uintptr_t as nullptr.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The calls to orb_advertise were being mishandled throughout the code.
There were ::close() calls on memory pointers, there were checks
against < 0 when it is a pointer to a object and values larger than
0x7ffffffff are valid. Some places orb_advert_t variables were
being initialized as 0 other places as -1.
The orb_advert_t type was changed to uintptr_t so the pointer value
would not be wrapped as a negative number. This was causing a failure
on ARM.
Tests for < 0 were changed to == 0 since a null pointer is the valid
representation for error, or uninitialized.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The orb_advertise and/or orb_publish calls were failing because
there were not enough devmap entries allocated for all the orb
topics advertised.
The number of entries was increased from 50 to 100.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>