File shorten.patch of Package shorten (Revision 5)

Currently displaying revision 5 , Show latest

50
 
1
---
2
 src/fixio.c      |    9 +++++----
3
 utils/mkbshift.c |    4 ++--
4
 2 files changed, 7 insertions(+), 6 deletions(-)
5
6
--- a/src/fixio.c
7
+++ b/src/fixio.c
8
@@ -10,16 +10,17 @@
9
  * $Id: fixio.c,v 1.4 2002/01/28 01:16:52 jason Exp $
10
  */
11
 
12
+#ifdef HAVE_CONFIG_H
13
+#include "config.h"
14
+#endif
15
+#define _XOPEN_SOURCE
16
 #include <stdio.h>
17
 #include <stdlib.h>
18
 #include <string.h>
19
+#include <unistd.h>
20
 #include "shorten.h"
21
 #include "bitshift.h"
22
 
23
-#ifdef HAVE_CONFIG_H
24
-#include "config.h"
25
-#endif
26
-
27
 extern int WriteWaveFile;
28
 
29
 #define CAPMAXSCHAR(x)  ((x > 127) ? 127 : x)
30
--- a/utils/mkbshift.c
31
+++ b/utils/mkbshift.c
32
@@ -46,7 +46,7 @@
33
       tab[Slinear2ulaw(sample)] = shift;
34
 
35
   /* print this out as a lookup table */
36
-  fprintf(fout, "char ulaw_maxshift[%d] = {", USIZE);
37
+  fprintf(fout, "signed int ulaw_maxshift[%d] = {", USIZE);
38
   for(i = 0; i < USIZE - 1; i++)
39
     fprintf(fout, "%d,", tab[i]);
40
   fprintf(fout, "%d};\n\n", tab[USIZE - 1]);
41
@@ -79,7 +79,7 @@
42
        error_exit("identity maping failed for shift: %d\tindex: %d\n",shift,i);
43
 
44
   /* print out the ulaw_inward lookup table */
45
-  fprintf(fout, "schar ulaw_inward[%d][%d] = {\n", SHIFTSIZE, USIZE);
46
+  fprintf(fout, "signed int ulaw_inward[%d][%d] = {\n", SHIFTSIZE, USIZE);
47
   for(shift = 0; shift < SHIFTSIZE; shift++) {
48
     fprintf(fout, "{");
49
     for(i = 0; i < USIZE - 1; i++)
50