a fix for poor function declarations in namedentity.cpp

* Major: missing const member function declaration
* Minor: correct return type for void function

This fixes compilation problems on OSX Mavericks, but the fixes should
be generally incorporated in the library.