pkgsrc/audio/maplay/patches/patch-af
wiz 804a257505 Unconditionalize the DragonFly patches for newer c++.
Use patches instead of sed.
Set LICENSE while here.
2011-11-22 20:57:34 +00:00

92 lines
2.8 KiB
Text

$NetBSD: patch-af,v 1.2 2011/11/22 20:57:35 wiz Exp $
--- ibitstream.cc.orig 1994-06-23 12:14:35.000000000 +0000
+++ ibitstream.cc
@@ -29,10 +29,16 @@
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
-#include <iostream.h>
+#include <iostream>
#include "all.h"
#include "ibitstream.h"
+#ifdef NETBSD
+#include <machine/endian.h>
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define DAMN_INTEL_BYTE_ORDER
+#endif
+#endif
#define swap_int32(int_32) (((int_32) << 24) | (((int_32) << 8) & 0x00ff0000) | \
(((int_32) >> 8) & 0x0000ff00) | ((int_32) >> 24))
@@ -50,7 +56,7 @@ Ibitstream::Ibitstream (const char *file
{
if ((fd = open (filename, O_RDONLY, 0)) < 0)
{
- cerr << "can't open file \"" << filename << "\" for reading!\n";
+ std::cerr << "can't open file \"" << filename << "\" for reading!\n";
exit (1);
}
wordpointer = buffer;
@@ -64,7 +70,7 @@ Ibitstream::~Ibitstream (void) // des
}
-bool Ibitstream::get_header (uint32 *headerstring)
+boolean Ibitstream::get_header (uint32 *headerstring)
{
int readvalue;
@@ -102,13 +108,13 @@ bool Ibitstream::get_header (uint32 *hea
}
-bool Ibitstream::read_frame (uint32 bytesize)
+boolean Ibitstream::read_frame (uint32 bytesize)
{
int readvalue;
if (bytesize > (bufferintsize << 2))
{
- cerr << "Internal error: framelength > bufferlength?!\n";
+ std::cerr << "Internal error: framelength > bufferlength?!\n";
exit (1);
}
@@ -170,7 +176,7 @@ uint32 Ibitstream::get_bits (uint32 numb
#ifdef DEBUG
if (number_of_bits < 1 || number_of_bits > 16)
{
- cerr << "illegal parameter in Ibitstream::get_bits() !\n";
+ std::cerr << "illegal parameter in Ibitstream::get_bits() !\n";
exit (1);
}
#endif
@@ -184,7 +190,7 @@ uint32 Ibitstream::get_bits (uint32 numb
bitindex = 0;
if ((char *)++wordpointer > (char *)buffer + framesize)
{
- cerr << "Ibitstream::get_bits(): no more bits in buffer!\n";
+ std::cerr << "Ibitstream::get_bits(): no more bits in buffer!\n";
exit (1);
}
}
@@ -197,7 +203,7 @@ uint32 Ibitstream::get_bits (uint32 numb
*(int16 *)&returnvalue = *((int16 *)wordpointer + 1);
if ((char *)++wordpointer > (char *)buffer + framesize)
{
- cerr << "Ibitstream::get_bits(): no more bits in buffer!\n";
+ std::cerr << "Ibitstream::get_bits(): no more bits in buffer!\n";
exit (1);
}
*((int16 *)&returnvalue + 1) = *(int16 *)wordpointer;
@@ -205,7 +211,7 @@ uint32 Ibitstream::get_bits (uint32 numb
*((int16 *)&returnvalue + 1) = *(int16 *)wordpointer;
if ((char *)++wordpointer > (char *)buffer + framesize)
{
- cerr << "Ibitstream::get_bits(): no more bits in buffer!\n";
+ std::cerr << "Ibitstream::get_bits(): no more bits in buffer!\n";
exit (1);
}
*(int16 *)&returnvalue = *((int16 *)wordpointer + 1);