On a piece of equipment I use OrbForms to interface with (via IrDA), the device error codes are passed as negative integers. On other C type compilers and systems, I use an enum to set up the error code constants like this: