Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / audio / maplay / patches / patch-ad
blob5dd0c291a8ef321afe85357ff74ed638ea9e3f63
1 $NetBSD: patch-ad,v 1.4 2002/06/27 15:52:14 agc Exp $
3 --- header.cc.orig      1994-06-23 12:14:35.000000000 +0000
4 +++ header.cc
5 @@ -20,15 +20,15 @@
6  
7  /*
8   *  Changes from version 1.1 to 1.2:
9 - *    - iostreams manipulator calls like "cerr << setw (2) << ..." replaced by
10 - *      "cerr.width (2); ..." due to problems with older GNU C++ releases.
11 + *    - iostreams manipulator calls like "std::cerr << setw (2) << ..." replaced by
12 + *      "std::cerr.width (2); ..." due to problems with older GNU C++ releases.
13   *    - syncword recognition slightly changed
14   */
16  #include <sys/types.h>
17  #include <unistd.h>
18 -#include <iostream.h>
19 -#include <iomanip.h>
20 +#include <iostream>
21 +#include <iomanip>
22  #include <stdlib.h>
23  #include "header.h"
25 @@ -36,7 +36,7 @@
26  const uint32 Header::frequencies[3] = { 44100, 48000, 32000 };
29 -bool Header::read_header (Ibitstream *stream, Crc16 **crcp)
30 +boolean Header::read_header (Ibitstream *stream, Crc16 **crcp)
31  {
32    uint32 headerstring;
34 @@ -45,41 +45,41 @@ bool Header::read_header (Ibitstream *st
36    if ((headerstring & 0xFFF80000) != 0xFFF80000)
37    {
38 -    cerr << "invalid syncword 0x";
39 -    cerr.width (8);
40 -    cerr.fill ('0');
41 -    cerr << hex << headerstring
42 -        << " found at fileoffset " << dec
43 +    std::cerr << "invalid syncword 0x";
44 +    std::cerr.width (8);
45 +    std::cerr.fill ('0');
46 +    std::cerr << headerstring
47 +        << " found at fileoffset "
48          << lseek (stream->filedescriptor (), 0, SEEK_CUR) - 4 << '\n';
49      return False;
50    }
52    if ((h_layer = (headerstring >> 17) & 3) == 0)
53    {
54 -    cerr << "unknown layer identifier found!\n";
55 +    std::cerr << "unknown layer identifier found!\n";
56      exit (1);
57    }
58    h_layer = 4 - h_layer;               // now 1 means Layer I and 3 means Layer III
59    if (h_layer == 3)
60    {
61 -    cerr << "Sorry, Layer III not implemented!\n";
62 +    std::cerr << "Sorry, Layer III not implemented!\n";
63      exit (1);
64    }
65    h_protection_bit = (headerstring >> 16) & 1;
66    if ((h_bitrate_index = (headerstring >> 12) & 0xF) == 15)
67    {
68 -    cerr << "unknown bitrate index found!\n";
69 +    std::cerr << "unknown bitrate index found!\n";
70      exit (1);
71    }
72    if (!h_bitrate_index)
73    {
74 -    cerr << "free format not yet implemented!\n";
75 +    std::cerr << "free format not yet implemented!\n";
76      exit (1);
77    }
79    if ((h_sample_frequency = (e_sample_frequency)((headerstring >> 10) & 3)) == 3)
80    {
81 -    cerr << "unknown sample frequency!\n";
82 +    std::cerr << "unknown sample frequency!\n";
83      exit (1);
84    }
85    h_padding_bit = (headerstring >> 9) & 1;
86 @@ -90,7 +90,7 @@ bool Header::read_header (Ibitstream *st
87          h_mode != single_channel) ||
88         (h_bitrate_index >= 11 && h_mode == single_channel))
89      {
90 -      cerr << "illegal combination of mode and bitrate in a layer II stream:\n"
91 +      std::cerr << "illegal combination of mode and bitrate in a layer II stream:\n"
92               "  mode: " << mode_string ()
93            << "\n  bitrate: " << bitrate_string () << '\n';
94        exit (1);
95 @@ -161,7 +161,7 @@ uint32 Header::calculate_framesize ()
96    static const int32 bitrates_layer_2[15] = {
97      0 /*free format*/, 32000, 48000, 56000, 64000, 80000, 96000,
98      112000, 128000, 160000, 192000, 224000, 256000, 320000, 384000 };
99 -  static const samplefrequencies[3] = { 44100, 48000, 32000 };
100 +  static const int32 samplefrequencies[3] = { 44100, 48000, 32000 };
101    uint32 framesize;
103    if (h_layer == 1)