From 6724dec6c640a59981402d7d4fbd2c24a67368a9 Mon Sep 17 00:00:00 2001 From: darkeye Date: Sun, 21 Jul 2002 08:47:06 +0000 Subject: [PATCH] some exception cleanup (throw clauses in function declarations) --- darkice/trunk/src/BufferedSink.h | 5 ++++- darkice/trunk/src/Util.cpp | 12 +++++++++--- darkice/trunk/src/Util.h | 7 +++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/darkice/trunk/src/BufferedSink.h b/darkice/trunk/src/BufferedSink.h index 64d357c..a7d0918 100644 --- a/darkice/trunk/src/BufferedSink.h +++ b/darkice/trunk/src/BufferedSink.h @@ -178,7 +178,7 @@ class BufferedSink : public Sink, public virtual Reporter * @see #chunkSize */ inline bool - align ( void ) + align ( void ) throw ( Exception ) { char b[] = { 0 }; @@ -391,6 +391,9 @@ class BufferedSink : public Sink, public virtual Reporter $Source$ $Log$ + Revision 1.7 2002/07/21 08:47:06 darkeye + some exception cleanup (throw clauses in function declarations) + Revision 1.6 2002/05/28 12:35:41 darkeye code cleanup: compiles under gcc-c++ 3.1, using -pedantic option diff --git a/darkice/trunk/src/Util.cpp b/darkice/trunk/src/Util.cpp index 6977eb0..e6998f8 100644 --- a/darkice/trunk/src/Util.cpp +++ b/darkice/trunk/src/Util.cpp @@ -289,7 +289,7 @@ Util :: conv8 ( unsigned char * pcmBuffer, unsigned int lenPcmBuffer, short int * leftBuffer, short int * rightBuffer, - unsigned int channels ) + unsigned int channels ) throw ( Exception ) { if ( channels == 1 ) { unsigned int i, j; @@ -301,7 +301,7 @@ Util :: conv8 ( unsigned char * pcmBuffer, leftBuffer[j] = (short int) value; ++j; } - } else { + } else if ( channels == 2 ) { unsigned int i, j; for ( i = 0, j = 0; i < lenPcmBuffer; ) { @@ -313,6 +313,9 @@ Util :: conv8 ( unsigned char * pcmBuffer, rightBuffer[j] = (short int) value; ++j; } + } else { + throw Exception( __FILE__, __LINE__, + "this number of channels not supported", channels); } } @@ -327,7 +330,7 @@ Util :: conv16 ( unsigned char * pcmBuffer, short int * leftBuffer, short int * rightBuffer, unsigned int channels, - bool isBigEndian ) + bool isBigEndian ) throw ( Exception ) { if ( isBigEndian ) { if ( channels == 1 ) { @@ -393,6 +396,9 @@ Util :: conv16 ( unsigned char * pcmBuffer, $Source$ $Log$ + Revision 1.8 2002/07/21 08:47:06 darkeye + some exception cleanup (throw clauses in function declarations) + Revision 1.7 2002/03/28 16:45:46 darkeye added functions strToD(), conv8(), conv16() and conv() diff --git a/darkice/trunk/src/Util.h b/darkice/trunk/src/Util.h index c22b241..3b609e2 100644 --- a/darkice/trunk/src/Util.h +++ b/darkice/trunk/src/Util.h @@ -251,7 +251,7 @@ class Util unsigned int lenPcmBuffer, short int * leftBuffer, short int * rightBuffer, - unsigned int channels ); + unsigned int channels ) throw ( Exception ); /** * Convert a char buffer holding 16 bit PCM values to a short buffer @@ -271,7 +271,7 @@ class Util short int * leftBuffer, short int * rightBuffer, unsigned int channels, - bool isBigEndian ); + bool isBigEndian ) throw ( Exception ); }; @@ -291,6 +291,9 @@ class Util $Source$ $Log$ + Revision 1.6 2002/07/21 08:47:06 darkeye + some exception cleanup (throw clauses in function declarations) + Revision 1.5 2002/03/28 16:45:46 darkeye added functions strToD(), conv8(), conv16() and conv()