[xiph-commits] r7213 - in trunk/speex: include/speex libspeex

conrad at dactyl.lonelymoon.com conrad
Wed Jul 21 00:18:58 PDT 2004


Author: conrad
Date: Wed Jul 21 00:18:58 2004
New Revision: 7213

Modified:
trunk/speex/include/speex/speex_noglobals.h
trunk/speex/libspeex/modes_noglobals.c
Log:
remove unneeded public constructors/destructors for _noglobals modes;
replaced with cleaner speex_mode_{new,destroy}() functions.


Modified: trunk/speex/include/speex/speex_noglobals.h
===================================================================
--- trunk/speex/include/speex/speex_noglobals.h	2004-07-21 07:00:52 UTC (rev 7212)
+++ trunk/speex/include/speex/speex_noglobals.h	2004-07-21 07:18:57 UTC (rev 7213)
@@ -37,28 +37,13 @@
#ifndef SPEEX_NOGLOBALS_H
#define SPEEX_NOGLOBALS_H

+/* See README.symbian in the Speex source distribution for information
+ * on using this API */
+
#ifdef __cplusplus
extern "C" {
#endif

-/** Default narrowband mode */
-const SpeexMode * speex_nb_mode_new (void);
-void speex_nb_mode_free (const SpeexMode * mode);
-
-/** Default wideband mode */
-const SpeexMode * speex_wb_mode_new (void);
-void speex_wb_mode_free (const SpeexMode * mode);
-
-/** Default "ultra-wideband" mode */
-const SpeexMode * speex_uwb_mode_new (void);
-void speex_uwb_mode_free (const SpeexMode * mode);
-
-/** Query modes available */
-const SpeexMode * speex_mode_new_byID (int id);
-
-/** Free a mode, using its ID */
-void speex_mode_free_byID (SpeexMode * mode, int id);
-
/** Instantiate a mode */
const SpeexMode * speex_mode_new (int modeID);


Modified: trunk/speex/libspeex/modes_noglobals.c
===================================================================
--- trunk/speex/libspeex/modes_noglobals.c	2004-07-21 07:00:52 UTC (rev 7212)
+++ trunk/speex/libspeex/modes_noglobals.c	2004-07-21 07:18:57 UTC (rev 7213)
@@ -745,7 +745,7 @@


/* Default mode for narrowband */
-const SpeexMode * speex_nb_mode_new (void)
+static const SpeexMode * speex_nb_mode_new (void)
{
const SpeexNBMode * _nb_mode;

@@ -769,7 +769,7 @@
);
}

-void speex_nb_mode_free (const SpeexMode * mode)
+static void speex_nb_mode_free (const SpeexMode * mode)
{
nb_mode_free ((SpeexNBMode *)mode->mode);
speex_free ((void *)mode);
@@ -959,7 +959,7 @@
speex_nb_mode_free (mode->nb_mode);
}

-const SpeexMode * speex_wb_mode_new (void)
+static const SpeexMode * speex_wb_mode_new (void)
{
const SpeexSBMode * sb_mode;

@@ -983,7 +983,7 @@
);
}

-void speex_wb_mode_free (const SpeexMode * mode)
+static void speex_wb_mode_free (const SpeexMode * mode)
{
sb_wb_mode_free (mode->mode);
speex_free ((void *)mode);
@@ -1051,13 +1051,13 @@
return NULL;
}

-void sb_uwb_mode_free (const SpeexSBMode * mode)
+static void sb_uwb_mode_free (const SpeexSBMode * mode)
{
sb_wb_mode_free ((const SpeexSBMode *)mode->nb_mode);
sb_mode_free (mode);
}

-const SpeexMode * speex_uwb_mode_new (void)
+static const SpeexMode * speex_uwb_mode_new (void)
{
const SpeexSBMode * sb_mode;

@@ -1081,32 +1081,12 @@
);
}

-void speex_uwb_mode_free (const SpeexMode * mode)
+static void speex_uwb_mode_free (const SpeexMode * mode)
{
sb_uwb_mode_free (mode->mode);
speex_free ((void *)mode);
}

-const SpeexMode * speex_mode_new_byID (int id)
-{
-  switch (id) {
-  case 0: return speex_nb_mode_new(); break;
-  case 1: return speex_wb_mode_new(); break;
-  case 2: return speex_uwb_mode_new(); break;
-  default: return NULL;
-  }
-}
-
-void speex_mode_free_byID (SpeexMode * mode, int id)
-{
-  switch (id) {
-  case 0: speex_nb_mode_free(mode); break;
-  case 1: speex_wb_mode_free(mode); break;
-  case 2:  speex_uwb_mode_free(mode); break;
-  default: break;
-  }
-}
-
const SpeexMode * speex_mode_new (int modeID)
{
switch (modeID) {



More information about the commits mailing list