{
off_t ret = m_file->Read(buffer, size);
- switch ( ret )
- {
- case 0:
- m_lasterror = wxSTREAM_EOF;
- break;
-
- case wxInvalidOffset:
- m_lasterror = wxSTREAM_READ_ERROR;
- ret = 0;
- break;
+ // NB: we can't use a switch here because HP-UX CC doesn't allow
+ // switching over long long (which off_t is in 64bit mode)
- default:
- m_lasterror = wxSTREAM_NO_ERROR;
+ if ( !ret )
+ {
+ // nothing read, so nothing more to read
+ m_lasterror = wxSTREAM_EOF;
+ }
+ else if ( ret == wxInvalidOffset )
+ {
+ m_lasterror = wxSTREAM_READ_ERROR;
+ ret = 0;
+ }
+ else
+ {
+ // normal case
+ m_lasterror = wxSTREAM_NO_ERROR;
}
return ret;