shithub: opus

Download patch

ref: 0abd1b0dea2ed9c771597549caf7ad4482150a8c
parent: ebec87a287c6c18058a1fc843b51091b9044e672
author: Jean-Marc Valin <[email protected]>
date: Mon Aug 29 12:31:52 EDT 2011

Makes the allocation more C++-friendly

--- a/libcelt/tests/ectest.c
+++ b/libcelt/tests/ectest.c
@@ -46,7 +46,7 @@
     else
 	seed = time(NULL);
   /*Testing encoding of raw bit values.*/
-  ptr = malloc(DATA_SIZE);
+  ptr = (unsigned char *)malloc(DATA_SIZE);
   ec_enc_init(&enc,ptr, DATA_SIZE);
   for(ft=2;ft<1024;ft++){
     for(i=0;i<ft;i++){
--- a/libcelt/tests/laplace-test.c
+++ b/libcelt/tests/laplace-test.c
@@ -31,7 +31,7 @@
    unsigned char *ptr;
    int val[10000], decay[10000];
    ALLOC_STACK;
-   ptr = malloc(DATA_SIZE);
+   ptr = (unsigned char *)malloc(DATA_SIZE);
    ec_enc_init(&enc,ptr,DATA_SIZE);
 
    val[0] = 3; decay[0] = 6000;
--- a/src/opus_multistream.c
+++ b/src/opus_multistream.c
@@ -201,7 +201,7 @@
 )
 {
    int ret;
-   OpusMSEncoder *st = opus_alloc(opus_multistream_encoder_get_size(streams, coupled_streams));
+   OpusMSEncoder *st = (OpusMSEncoder *)opus_alloc(opus_multistream_encoder_get_size(streams, coupled_streams));
    if (st==NULL)
    {
       if (error)
@@ -510,7 +510,7 @@
 )
 {
    int ret;
-   OpusMSDecoder *st = opus_alloc(opus_multistream_decoder_get_size(streams, coupled_streams));
+   OpusMSDecoder *st = (OpusMSDecoder *)opus_alloc(opus_multistream_decoder_get_size(streams, coupled_streams));
    if (st==NULL)
    {
       if (error)