More ticket #774: replaced dependency to STL

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2623 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/third_party/g7221/common/stl-files/basop32.c b/third_party/g7221/common/basic_op.c
similarity index 96%
rename from third_party/g7221/common/stl-files/basop32.c
rename to third_party/g7221/common/basic_op.c
index efd5c20..1a7347c 100644
--- a/third_party/g7221/common/stl-files/basop32.c
+++ b/third_party/g7221/common/basic_op.c
@@ -1,61 +1,6 @@
-/*                                                      v.1.0 - 26.Jan.2000
-  =============================================================================
-
-                          U    U   GGG    SSSS  TTTTT
-                          U    U  G       S       T
-                          U    U  G  GG   SSSS    T
-                          U    U  G   G       S   T
-                           UUU     GG     SSS     T
-
-                   ========================================
-                    ITU-T - USER'S GROUP ON SOFTWARE TOOLS
-                   ========================================
-
-       =============================================================
-       COPYRIGHT NOTE: This source code, and all of its derivations,
-       is subject to the "ITU-T General Public License". Please have
-       it  read  in    the  distribution  disk,   or  in  the  ITU-T
-       Recommendation G.191 on "SOFTWARE TOOLS FOR SPEECH AND  AUDIO
-       CODING STANDARDS".
-       =============================================================
-
-MODULE:         BASOP, BASIC OPERATORS
-
-ORIGINAL BY:
-                Incorporated from anonymous contributions for 
-                ETSI Standards as well as G.723.1, G.729, and G.722.1
-
-DESCRIPTION:
-        This file contains the definition of 16- and 32-bit basic
-        operators to be used in the implementation of signal
-        processing algorithms. The basic operators try to resemble
-        assembly language instructions that are commonly found in
-        digital signal processor (DSP) CPUs, thus allowing algorithm
-        C-code implementations more directly mapeable to DSP assembly
-        code.
-
-        *********************************************************
-         NOTE: so far, this module does not have a demo program!
-        *********************************************************
-
-FUNCTIONS:
-  Defined in basop.h. Self-documentation within each function.
-
-HISTORY:
-  26.Jan.00	v1.0	Incorporated to the STL from updated G.723.1/G.729 
-                        basic operator library (based on basicop2.c) and 
-                        G.723.1's basop.c [L_mls(), div_l(), i_mult()]
-  05.Jul.00     v1.1    Added 32-bit shiftless accumulation basic 
-                        operators (L_msu0, L_mac0, L_mult0). Improved
-                        documentation for i_mult().
-  =============================================================================
-*/
-
 /*___________________________________________________________________________
  |                                                                           |
  | Basic arithmetic operators.                                               |
- |                                                                           |
- | $Id $
  |___________________________________________________________________________|
 */
 
@@ -68,7 +13,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "typedef.h"
-#include "basop32.h"
+#include "basic_op.h"
 
 #if (WMOPS)
 #include "count.h"
diff --git a/third_party/g7221/common/stl-files/basop32.h b/third_party/g7221/common/basic_op.h
similarity index 84%
rename from third_party/g7221/common/stl-files/basop32.h
rename to third_party/g7221/common/basic_op.h
index 14da776..93febd1 100644
--- a/third_party/g7221/common/stl-files/basop32.h
+++ b/third_party/g7221/common/basic_op.h
@@ -1,22 +1,5 @@
-/*
-  ===========================================================================
-   File: BASOP.H                                         v.1.1 - 05.Jul.2000
-  ===========================================================================
-
-		      ITU-T STL  BASIC OPERATORS
-
- 		      GLOBAL FUNCTION PROTOTYPES
-
-   History:
-   26.Jan.00	v1.0	Incorporated to the STL from updated G.723.1/G.729 
-                        basic operator library (based on basic_op.h) and 
-                        G.723.1's basop.h.
-   05.Jul.00    v1.1    Added 32-bit shiftless mult/mac/msub operators
-  ============================================================================
-*/
-
-#ifndef BASOP_H_DEFINED
-#define BASOP_H_DEFINED 110
+#ifndef __BASIC_OP_H__
+#define __BASIC_OP_H__
 
 /*___________________________________________________________________________
  |                                                                           |
@@ -26,14 +9,11 @@
  |___________________________________________________________________________|
 */
 
-extern Flag Overflow;
-extern Flag Carry;
-
 #define MAX_32 (Word32)0x7fffffffL
 #define MIN_32 (Word32)0x80000000L
 
 #define MAX_16 (Word16)0x7fff
-#define MIN_16 ((Word16)0x8000)
+#define MIN_16 (Word16)(pj_uint16_t)0x8000
 
 #define UMAX_32 (Word32)0xffffffffL
 #define UMIN_32 (Word32)0x00000000L
@@ -126,11 +106,10 @@
 #   define GET_CARRY()	    0
 #endif
 
-#include "basop32_i.h"
+#include "basic_op_i.h"
 
 
 
-#endif /* BASOP_H_DEFINED */
+#endif /* __BASIC_OP_H__ */
 
 
-/* ************************* END OF BASIC_OP.H ************************* */
diff --git a/third_party/g7221/common/stl-files/basop32_i.h b/third_party/g7221/common/basic_op_i.h
similarity index 99%
rename from third_party/g7221/common/stl-files/basop32_i.h
rename to third_party/g7221/common/basic_op_i.h
index ca61ed0..8eba815 100644
--- a/third_party/g7221/common/stl-files/basop32_i.h
+++ b/third_party/g7221/common/basic_op_i.h
@@ -658,12 +658,12 @@
 #if 1
     if (var1 >= 0)
     	return var1;
-    else if (var1 == (Word16)0x8000)
+    else if (var1 == MIN_16)
  	return MAX_16;
     else
     	return (Word16)-var1;
 #else
-    if (var1 == (Word16) 0x8000)
+    if (var1 == MIN_16)
     {
         return MAX_16;
     }
diff --git a/third_party/g7221/common/stl-files/count.h b/third_party/g7221/common/count.h
similarity index 93%
rename from third_party/g7221/common/stl-files/count.h
rename to third_party/g7221/common/count.h
index 5081595..791145e 100644
--- a/third_party/g7221/common/stl-files/count.h
+++ b/third_party/g7221/common/count.h
@@ -1,4 +1,4 @@
-/* $Id: config.h 2427 2009-01-22 20:30:32Z bennylp $ */
+/* $Id$ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  *
diff --git a/third_party/g7221/common/defs.h b/third_party/g7221/common/defs.h
index 40db16f..d4c7aa2 100644
--- a/third_party/g7221/common/defs.h
+++ b/third_party/g7221/common/defs.h
@@ -13,8 +13,8 @@
 #include <stdio.h>
 #include <math.h>
 #include <stdlib.h>
-#include "g7221/common/stl-files/typedef.h"
-#include "g7221/common/stl-files/basop32.h"
+#include "g7221/common/typedef.h"
+#include "g7221/common/basic_op.h"
 
 #define  PI             3.141592653589793238462
 
diff --git a/third_party/g7221/common/stl-files/typedef.h b/third_party/g7221/common/stl-files/typedef.h
deleted file mode 100644
index 9b0ef44..0000000
--- a/third_party/g7221/common/stl-files/typedef.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-  ===========================================================================
-   File: TYPEDEF.H                                       v.1.0 - 26.Jan.2000
-  ===========================================================================
-
-		      ITU-T STL  BASIC OPERATORS
-
- 		      TYPE DEFINITION PROTOTYPES
-
-   History:
-   26.Jan.00	v1.0	Incorporated to the STL from updated G.723.1/G.729 
-                        basic operator library (based on basic_op.h)
-  ============================================================================
-*/
-
-#ifndef TYPEDEF_H
-#define TYPEDEF_H "$Id $"
-
-#if 1
-
-/* Use PJLIB types definitions (for PJLIB sync'd platforms compatibility? 
- * e.g: mingw32 was not supported by the original version).
- */
-#include <pj/types.h>
-
-typedef pj_int8_t Word8;
-typedef pj_int16_t Word16;
-typedef pj_int32_t Word32;
-typedef pj_uint16_t UWord16;
-typedef pj_uint32_t UWord32;
-typedef int Flag;
-
-#else
-
-#include <limits.h>
-
-#if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(_MSC_VER) || defined(__ZTC__) || defined(__CYGWIN__)
-typedef signed char Word8;
-typedef short Word16;
-typedef long Word32;
-typedef int Flag;
-
-#elif defined(__sun)
-typedef signed char Word8;
-typedef short Word16;
-typedef long Word32;
-typedef int Flag;
-
-#elif defined(__unix__) || defined(__unix)
-typedef signed char Word8;
-typedef short Word16;
-typedef int Word32;
-typedef int Flag;
-
-#endif
-
-/* define 16 bit unsigned types for G.722.1 */
-#if INT_MAX == 32767
-typedef unsigned int UWord16;
-#elif SHRT_MAX == 32767
-typedef unsigned short UWord16;
-#endif
-
-/* define 32 bit unsigned types for G.722.1 */
-#if INT_MAX == 2147483647L
-typedef unsigned int UWord32;
-#elif LONG_MAX == 2147483647L
-typedef unsigned long UWord32;
-#endif
-
-#endif /* if 0 */
-
-#endif /* TYPEDEF_H */
-
diff --git a/third_party/g7221/common/stl-files/count.h b/third_party/g7221/common/typedef.h
similarity index 75%
copy from third_party/g7221/common/stl-files/count.h
copy to third_party/g7221/common/typedef.h
index 5081595..09ddaba 100644
--- a/third_party/g7221/common/stl-files/count.h
+++ b/third_party/g7221/common/typedef.h
@@ -1,4 +1,4 @@
-/* $Id: config.h 2427 2009-01-22 20:30:32Z bennylp $ */
+/* $Id$ */
 /* 
  * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
  *
@@ -16,13 +16,17 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
  */
-#ifndef COUNT_H
-#define COUNT_H
+#ifndef TYPEDEF_H
+#define TYPEDEF_H
 
-#define move16()
-#define move32()
-#define logic16()
-#define logic32()
-#define test()
+#include <pj/types.h>
 
-#endif
+typedef pj_int8_t Word8;
+typedef pj_int16_t Word16;
+typedef pj_int32_t Word32;
+typedef pj_uint16_t UWord16;
+typedef pj_uint32_t UWord32;
+typedef int Flag;
+
+#endif /* TYPEDEF_H */
+