diff decoders/shn.c @ 387:fb519e6028e3

Changed all the Sound_SetError() calls to __Sound_SetError (or BAIL*_MACRO)
author Ryan C. Gordon <icculus@icculus.org>
date Fri, 05 Jul 2002 23:11:51 +0000
parents cbb15ecf423a
children c42ac9ee2ce4
line wrap: on
line diff
--- a/decoders/shn.c	Fri Jul 05 22:34:55 2002 +0000
+++ b/decoders/shn.c	Fri Jul 05 23:11:51 2002 +0000
@@ -420,7 +420,7 @@
             mean = 0x8000;
             break;
         default:
-            Sound_SetError("SHN: unknown file type");
+            __Sound_SetError("SHN: unknown file type");
             return;
     } /* switch */
 
@@ -640,7 +640,7 @@
         shn->qlpc = (int *) malloc((Uint32) (shn->maxnlpc * sizeof (Sint32)));
         if (shn->qlpc == NULL)
         {
-            Sound_SetError(ERR_OUT_OF_MEMORY);
+            __Sound_SetError(ERR_OUT_OF_MEMORY);
             goto shn_open_puke;
         } /* if */
     } /* if */
@@ -655,8 +655,8 @@
          (cmd != SHN_FN_VERBATIM) ||
          (!parse_riff_header(shn, sample)) )
     {
-        if (cmd != SHN_FN_VERBATIM)
-            Sound_SetError("SHN: Expected VERBATIM function");
+        if (cmd != SHN_FN_VERBATIM) /* the other conditions set error state */
+            __Sound_SetError("SHN: Expected VERBATIM function");
 
         goto shn_open_puke;
         return(0);
@@ -667,7 +667,7 @@
     shn = (shn_t *) malloc(sizeof (shn_t));
     if (shn == NULL)
     {
-        Sound_SetError(ERR_OUT_OF_MEMORY);
+        __Sound_SetError(ERR_OUT_OF_MEMORY);
         goto shn_open_puke;
     } /* if */
 
@@ -1290,9 +1290,8 @@
 
             case SHN_FN_VERBATIM:
             default:
-                Sound_SetError("SHN: Unhandled function.");
                 sample->flags |= SOUND_SAMPLEFLAG_ERROR;
-                return(retval);
+                BAIL_MACRO("SHN: Unhandled function.", retval);
         } /* switch */
     } /* while */