Library header patches (was Re: [theora-dev] compglobals.c)

Mauricio Piacentini mauricio at tabuleiro.com
Thu Oct 24 07:35:28 PDT 2002


I agree with you about the warnings being harmless in this case. Some
compilers (CodeWarrior specially) really want to force you to cast, but I
will reduce the warning level for now. I get the same warnings building the
rest of the ogg tree, btw.

Attached is a patch for the theora/lib directory, with the missing includes.
I can also submit a VisualC++ project for building the libs. Should I put it
at theora/win32 to mimic what happens on the other branches (ogg, vorbis,
etc?)

a note: I created the patch with cvs diff -u, let me know if another format
is preferred.

Regards,
Mauricio Piacentini
Tabuleiro

> Generally you should just send patches here, I think.
>
> I can't speak for Monty, but regarding the warnings:
>
> The 'possible loss of data during conversions' are almost certainly
> spurious. The xiph code tends to rely on the truncation effects, and
> generally casts don't help readability much. It's best to turn these
> off an not worry about them.
>
> The missing includes are a bug, and patches would be welcome.

<p>
-------------- next part --------------
Index: dct_decode.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/dct_decode.c,v
retrieving revision 1.4
diff -u -r1.4 dct_decode.c
--- dct_decode.c	25 Sep 2002 10:01:52 -0000	1.4
+++ dct_decode.c	24 Oct 2002 14:04:54 -0000
@@ -15,6 +15,9 @@
 
  ********************************************************************/
 
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
 #include <ogg/ogg.h>
 #include "encoder_internal.h"
 
Index: dct_encode.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/dct_encode.c,v
retrieving revision 1.6
diff -u -r1.6 dct_encode.c
--- dct_encode.c	25 Sep 2002 11:11:42 -0000	1.6
+++ dct_encode.c	24 Oct 2002 14:04:55 -0000
@@ -15,6 +15,7 @@
 
  ********************************************************************/
 
+#include <math.h>
 #include "encoder_internal.h"
 
 static int ModeUsesMC[MAX_MODES] = { 0, 0, 1, 1, 1, 0, 1, 1 };
Index: decode.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/decode.c,v
retrieving revision 1.3
diff -u -r1.3 decode.c
--- decode.c	23 Sep 2002 02:01:28 -0000	1.3
+++ decode.c	24 Oct 2002 14:04:56 -0000
@@ -15,6 +15,8 @@
 
  ********************************************************************/
 
+#include <stdlib.h>
+#include <string.h>
 #include <ogg/ogg.h>
 #include "encoder_internal.h"
 #include "block_inline.h"
Index: encode.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/encode.c,v
retrieving revision 1.8
diff -u -r1.8 encode.c
--- encode.c	23 Sep 2002 23:18:06 -0000	1.8
+++ encode.c	24 Oct 2002 14:04:58 -0000
@@ -15,6 +15,9 @@
 
  ********************************************************************/
 
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
 #include "ogg/ogg.h"
 #include "encoder_internal.h"
 #include "encoder_lookup.h"
Index: frarray.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/frarray.c,v
retrieving revision 1.4
diff -u -r1.4 frarray.c
--- frarray.c	20 Sep 2002 22:01:43 -0000	1.4
+++ frarray.c	24 Oct 2002 14:04:59 -0000
@@ -14,7 +14,9 @@
   last mod: $Id: frarray.c,v 1.4 2002/09/20 22:01:43 xiphmont Exp $
 
  ********************************************************************/
-
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
 #include <ogg/ogg.h>
 #include "encoder_internal.h"
 #include "block_inline.h"
Index: idct.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/idct.c,v
retrieving revision 1.3
diff -u -r1.3 idct.c
--- idct.c	20 Sep 2002 22:01:43 -0000	1.3
+++ idct.c	24 Oct 2002 14:05:00 -0000
@@ -15,6 +15,9 @@
 
  ********************************************************************/
 
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
 #include <ogg/ogg.h>
 #include "encoder_internal.h"
 #include "quant_lookup.h"
Index: mcomp.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/mcomp.c,v
retrieving revision 1.5
diff -u -r1.5 mcomp.c
--- mcomp.c	23 Sep 2002 08:31:02 -0000	1.5
+++ mcomp.c	24 Oct 2002 14:05:01 -0000
@@ -15,6 +15,9 @@
 
  ********************************************************************/
 
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
 #include <stdio.h>
 #include <ogg/ogg.h>
 #include "encoder_internal.h"
Index: misc_common.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/misc_common.c,v
retrieving revision 1.7
diff -u -r1.7 misc_common.c
--- misc_common.c	23 Sep 2002 08:31:02 -0000	1.7
+++ misc_common.c	24 Oct 2002 14:05:02 -0000
@@ -15,6 +15,9 @@
 
  ********************************************************************/
 
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
 #include <ogg/ogg.h>
 #include "encoder_internal.h"
 #include "block_inline.h"
Index: pb.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/pb.c,v
retrieving revision 1.3
diff -u -r1.3 pb.c
--- pb.c	23 Sep 2002 08:31:02 -0000	1.3
+++ pb.c	24 Oct 2002 14:05:02 -0000
@@ -16,6 +16,8 @@
  ********************************************************************/
 
 #include <stdlib.h>
+#include <string.h>
+#include <math.h>
 #include <ogg/ogg.h>
 #include "encoder_internal.h"
 
Index: pp.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/pp.c,v
retrieving revision 1.6
diff -u -r1.6 pp.c
--- pp.c	23 Sep 2002 08:31:02 -0000	1.6
+++ pp.c	24 Oct 2002 14:05:03 -0000
@@ -16,6 +16,8 @@
  ********************************************************************/
 
 #include <stdlib.h>
+#include <string.h>
+#include <math.h>
 #include <ogg/ogg.h>
 #include "encoder_internal.h"
 #include "pp.h"
Index: quant.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/quant.c,v
retrieving revision 1.4
diff -u -r1.4 quant.c
--- quant.c	23 Sep 2002 09:15:04 -0000	1.4
+++ quant.c	24 Oct 2002 14:05:04 -0000
@@ -15,6 +15,9 @@
 
  ********************************************************************/
 
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
 #include <ogg/ogg.h>
 #include "encoder_internal.h"
 #include "quant_lookup.h"
Index: scan.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/scan.c,v
retrieving revision 1.4
diff -u -r1.4 scan.c
--- scan.c	23 Sep 2002 08:31:02 -0000	1.4
+++ scan.c	24 Oct 2002 14:05:06 -0000
@@ -15,8 +15,9 @@
 
  ********************************************************************/
 
-#include <math.h>
 #include <stdlib.h>
+#include <string.h>
+#include <math.h>
 #include <ogg/ogg.h>
 #include "encoder_internal.h"
 
Index: toplevel.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/toplevel.c,v
retrieving revision 1.12
diff -u -r1.12 toplevel.c
--- toplevel.c	25 Sep 2002 02:38:10 -0000	1.12
+++ toplevel.c	24 Oct 2002 14:05:08 -0000
@@ -16,6 +16,8 @@
  ********************************************************************/
 
 #include <stdlib.h>
+#include <string.h>
+#include <math.h>
 #include <ogg/ogg.h>
 #include <theora/theora.h>
 #include "encoder_internal.h"



More information about the Theora-dev mailing list