shithub: opus

Download patch

ref: 71a84590e705ed4a985b2b67445f758dc22848db
parent: a82dfdd240c59a7c56c43a69831545a1eb91f54e
author: Jean-Marc Valin <[email protected]>
date: Fri Mar 14 07:09:50 EDT 2008

Removed unnecessary header inclusions

--- a/libcelt/entenc.c
+++ b/libcelt/entenc.c
@@ -2,8 +2,7 @@
 #include "config.h"
 #endif
 
-#include <stdlib.h>
-#include <string.h>
+#include "os_support.h"
 #include "entenc.h"
 
 
@@ -11,7 +10,7 @@
 #define EC_BUFFER_INCREMENT (256)
 
 void ec_byte_writeinit(ec_byte_buffer *_b){
-  _b->ptr=_b->buf=malloc(EC_BUFFER_INCREMENT*sizeof(char));
+  _b->ptr=_b->buf=celt_alloc(EC_BUFFER_INCREMENT*sizeof(char));
   _b->storage=EC_BUFFER_INCREMENT;
 }
 
@@ -23,7 +22,7 @@
   ptrdiff_t endbyte;
   endbyte=_b->ptr-_b->buf;
   if(endbyte>=_b->storage){
-    _b->buf=realloc(_b->buf,(_b->storage+EC_BUFFER_INCREMENT)*sizeof(char));
+    _b->buf=celt_realloc(_b->buf,(_b->storage+EC_BUFFER_INCREMENT)*sizeof(char));
     _b->storage+=EC_BUFFER_INCREMENT;
     _b->ptr=_b->buf+endbyte;
   }
@@ -34,7 +33,7 @@
   ptrdiff_t endbyte;
   endbyte=_b->ptr-_b->buf;
   if(endbyte+4>_b->storage){
-    _b->buf=realloc(_b->buf,(_b->storage+EC_BUFFER_INCREMENT)*sizeof(char));
+    _b->buf=celt_realloc(_b->buf,(_b->storage+EC_BUFFER_INCREMENT)*sizeof(char));
     _b->storage+=EC_BUFFER_INCREMENT;
     _b->ptr=_b->buf+endbyte;
   }
@@ -52,7 +51,7 @@
   endbyte=_b->ptr-_b->buf;
   if(endbyte+_bytes>_b->storage){
     _b->storage=endbyte+_bytes+EC_BUFFER_INCREMENT;
-    _b->buf=realloc(_b->buf,_b->storage*sizeof(char));
+    _b->buf=celt_realloc(_b->buf,_b->storage*sizeof(char));
     _b->ptr=_b->buf+endbyte;
   }
   memmove(_b->ptr,_source,_bytes);
--- a/libcelt/pitch.c
+++ b/libcelt/pitch.c
@@ -43,8 +43,6 @@
 #include "kiss_fftr.h"*/
 #include "kfft_single.h"
 
-#include <stdio.h>
-#include <math.h>
 #include "pitch.h"
 #include "psy.h"
 #include "os_support.h"
--- a/libcelt/rangedec.c
+++ b/libcelt/rangedec.c
@@ -2,7 +2,6 @@
 #include "config.h"
 #endif
 
-#include <stddef.h>
 #include "entdec.h"
 #include "mfrngcod.h"
 
@@ -113,8 +112,6 @@
    URL="http://www.stanford.edu/class/ee398/handouts/papers/Moffat98ArithmCoding.pdf"
   }*/
 
-
-#include <stdio.h>
 
 /*Gets the next byte of input.
   After all the bytes in the current packet have been consumed, and the extra
--- a/libcelt/rangeenc.c
+++ b/libcelt/rangeenc.c
@@ -2,7 +2,6 @@
 #include "config.h"
 #endif
 
-#include <stddef.h>
 #include "entenc.h"
 #include "mfrngcod.h"
 
--- a/libcelt/vq.c
+++ b/libcelt/vq.c
@@ -33,8 +33,6 @@
 #include "config.h"
 #endif
 
-#include <math.h>
-#include <stdlib.h>
 #include "mathops.h"
 #include "cwrs.h"
 #include "vq.h"