Peeter Joot's (OLD) Blog.

Math, physics, perl, and programming obscurity.

A stupid coding error for today.

Posted by peeterjoot on October 27, 2009

I meant for the second if to be an else-if, and was scratching my head for a while trying to figure out how I got to the “impossible” UNEXPECTED codepath. Ugg.

inline sqlzRc MapReturnCode( int     nativeRc )
{
   sqlzRc rc = SQLO_OK ;

   if ( SUCCESS == nativeRc )
   {
      rc = SQLO_OK ;
   }
   if ( IsErrorFoo( nativeRc ) )
   {
      rc = SQLE_FOO ;
   }
   else if ( IsErrorBlah( nativeRc ) )
   {
      rc = SQLE_BLAH ;
   }
...
   else
   {
      rc = SQLE_UNEXPECTED_ERROR ;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: