Discussion:
[PATCH 1/3] uchar : fix build with clang
Xavier Chantry
2010-05-23 16:39:47 UTC
Permalink
To quote Andrew Price on clang ML :
"Judging by the wording of the standard (wchar.h should be included in
wctype.h to provide wint_t, as I understand it) it looks like this is a
glibc quirk. I felt it was easier to bodge my code to include wchar.h
before wctype.h than to get this fixed but good luck to you if you
attempt to do so."

http://permalink.gmane.org/gmane.comp.compilers.clang.devel/7123

Signed-off-by: Xavier Chantry <***@gmail.com>
---
uchar.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/uchar.c b/uchar.c
index 5a99c57..6f342b0 100644
--- a/uchar.c
+++ b/uchar.c
@@ -22,6 +22,7 @@

#include <stdlib.h>
#include <string.h>
+#include <wchar.h>
#include <wctype.h>
#include <ctype.h>
--
1.7.1
Xavier Chantry
2010-05-23 16:39:48 UTC
Permalink
This reverts commit 1a95d03bd7cde0ba7ab7852ca1139a92802d3906.

It's quite strange, but it seems the header always had "unsigned long" :
http://faac.cvs.sourceforge.net/viewvc/faac/faad2/include/neaacdec.h?view=log

However there was one change in 2.7 version named "Use public headers
internally to prevent duplicate declarations" (http://www.audiocoding.com/)
that caused uint32_t -> unsigned long change in decoder.c :
http://faac.cvs.sourceforge.net/viewvc/faac/faad2/libfaad/decoder.c?r1=1.115&r2=1.116
---
aac.c | 4 ++--
mp4.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/aac.c b/aac.c
index 5d42200..5e4f43c 100644
--- a/aac.c
+++ b/aac.c
@@ -41,7 +41,7 @@ struct aac_private {
int rbuf_pos;

unsigned char channels;
- uint32_t sample_rate;
+ unsigned long sample_rate;

char *overflow_buf;
int overflow_buf_len;
@@ -226,7 +226,7 @@ static int aac_open(struct input_plugin_data *ip_data)
goto out;
}

- d_print("sample rate %uhz, channels %u\n", priv->sample_rate, priv->channels);
+ d_print("sample rate %luhz, channels %u\n", priv->sample_rate, priv->channels);
if (!priv->sample_rate || !priv->channels) {
ret = -IP_ERROR_FILE_FORMAT;
goto out;
diff --git a/mp4.c b/mp4.c
index a8054c3..a26569d 100644
--- a/mp4.c
+++ b/mp4.c
@@ -41,7 +41,7 @@ struct mp4_private {
int overflow_buf_len;

unsigned char channels;
- uint32_t sample_rate;
+ unsigned long sample_rate;

NeAACDecHandle decoder; /* typedef void * */

@@ -151,7 +151,7 @@ static int mp4_open(struct input_plugin_data *ip_data)

free(buf);

- d_print("sample rate %uhz, channels %u\n", priv->sample_rate, priv->channels);
+ d_print("sample rate %luhz, channels %u\n", priv->sample_rate, priv->channels);

ip_data->sf = sf_rate(priv->sample_rate) | sf_channels(priv->channels) | sf_bits(16) | sf_signed(1);
#if defined(WORDS_BIGENDIAN)
--
1.7.1
Gregory Petrosyan
2010-05-23 17:49:11 UTC
Permalink
On Sun, May 23, 2010 at 8:39 PM, Xavier Chantry
Post by Xavier Chantry
This reverts commit 1a95d03bd7cde0ba7ab7852ca1139a92802d3906.
http://faac.cvs.sourceforge.net/viewvc/faac/faad2/include/neaacdec.h?view=log
Yeah, strange indeed. Maybe that was some distro-tweaked version of FAAD?

Anyway, thanks once again – GCC build is now entirely warning-free!
Pushed to -maint.

Gregory

Gregory Petrosyan
2010-05-23 17:27:44 UTC
Permalink
On Sun, May 23, 2010 at 8:39 PM, Xavier Chantry
Post by Xavier Chantry
"Judging by the wording of the standard (wchar.h should be included in
wctype.h to provide wint_t, as I understand it) it looks like this is a
glibc quirk. I felt it was easier to bodge my code to include wchar.h
before wctype.h than to get this fixed but good luck to you if you
attempt to do so."
http://permalink.gmane.org/gmane.comp.compilers.clang.devel/7123
---
uchar.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/uchar.c b/uchar.c
index 5a99c57..6f342b0 100644
--- a/uchar.c
+++ b/uchar.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <string.h>
+#include <wchar.h>
#include <wctype.h>
#include <ctype.h>
Thanks a lot! Pushed to -maint.

Gregory
Loading...