updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / d-lib-arc / arc-tango.patch
blob9b37fd1b3cf101d1a88e7e6c143b4ae7e284f2d6
1 diff -r -u -x .svn arc/font.d /usr/include/d/arc/font.d
2 --- arc/font.d 2010-03-18 02:47:34.000000000 +0100
3 +++ /usr/include/d/arc/font.d 2010-03-18 01:45:51.000000000 +0100
4 @@ -59,7 +59,7 @@
6 import
7 tango.text.convert.Integer,
8 - tango.io.File,
9 + tango.io.device.File,
10 tango.io.FilePath,
11 tango.math.Math,
12 tango.util.log.Log;
13 @@ -150,7 +150,7 @@
15 logger.info("Loading new font " ~ nameStr);
17 - this.fontData = cast(ubyte[])(new File(fontPath)).read(); // we'll store the data in a buffer, because FreeType doesn't copy it.
18 + this.fontData = cast(ubyte[])(new File(fontPath)).load(); // we'll store the data in a buffer, because FreeType doesn't copy it.
20 FT_Open_Args args;
21 args.memory_base = this.fontData.ptr;
22 diff -r -u -x .svn arc/math/routines.d /usr/include/d/arc/math/routines.d
23 --- arc/math/routines.d 2010-03-18 01:27:42.000000000 +0100
24 +++ /usr/include/d/arc/math/routines.d 2010-03-18 02:41:31.885351651 +0100
25 @@ -99,13 +99,7 @@
27 body
29 - static if(Tango.Minor >= 998)
30 - {
31 - return cast(int)(a + (Kiss.instance.toInt() % (b+1-a) ));
32 - } else
33 - {
34 - return cast(int)(a + (Kiss.shared.toInt() % (b+1-a) ));
35 - }
36 + return cast(int)(a + (Kiss.instance.toInt() % (b+1-a) ));
39 /// Finds the roots
40 diff -r -u -x .svn arc/sound.d /usr/include/d/arc/sound.d
41 --- arc/sound.d 2010-03-18 02:47:34.000000000 +0100
42 +++ /usr/include/d/arc/sound.d 2010-03-18 01:45:51.000000000 +0100
43 @@ -62,13 +62,16 @@
44 import
45 tango.util.log.Log,
46 tango.io.FilePath,
47 - tango.io.FileConduit,
48 - tango.io.MappedBuffer,
49 + tango.io.device.File,
50 + tango.io.device.FileMap,
51 tango.stdc.stdio;
53 import tango.stdc.stringz : toStringz;
54 import tango.text.convert.Integer : toString;
55 import tango.text.convert.Float : toString;
57 +import tango.util.Convert;
60 /// logger for this module
61 public Logger logger;
62 @@ -597,10 +600,10 @@
64 // Get first four bytes of sound file to determine type
65 // And then load the file. sound_file will have all of our important info
66 - auto fdata = new MappedBuffer(filename,FileConduit.ReadExisting);
67 + auto fdata = new MappedFile(filename,File.ReadExisting);
70 - char[] data = cast(char[])fdata.slice();
71 + char[] data = cast(char[])fdata.map();
73 delete fdata;
75 @@ -783,7 +786,7 @@
76 /// A Wave implementation of BaseSoundFile
77 private class WaveFile : BaseSoundFile
79 - MappedBuffer mmbuffer;
80 + MappedFile mmbuffer;
81 char[] file;
83 /// Open a wave file and store attributes from its headers
84 @@ -791,8 +794,8 @@
86 logger.info("Loading WAV file " ~ filename);
87 super(filename);
88 - mmbuffer = new MappedBuffer(filename, FileConduit.ReadExisting);
89 - file = cast(char[])mmbuffer.slice();
90 + mmbuffer = new MappedFile(filename, File.ReadExisting);
91 + file = cast(char[])mmbuffer.map();
93 // First 4 bytes of Wave file should be "RIFF"
94 if (file[0..4] != "RIFF")
95 @@ -841,8 +844,10 @@
97 // Open the file
98 file = fopen(toStringz(filename), toStringz("rb"));
99 - if(ov_open(file, &vf, null, 0) < 0)
100 - logger.fatal("'"~filename~"' is not an Ogg Vorbis file.\n");
102 + auto err = ov_open(file, &vf, null, 0);
103 + if(err < 0)
104 + logger.fatal("'"~filename~"' is not an Ogg Vorbis file. Error code: \n"~to!(char[])(err)~".");
105 vorbis_info *vi = ov_info(&vf, -1);
107 // Get relevant data from the file
108 @@ -868,7 +873,7 @@
109 buffer.length = _size;
110 long ret = 0;
111 while (ret<_size) // because it may take several requests to fill our buffer
112 - ret += ov_read(&vf, cast(byte*)buffer[ret..length], _size-ret, 0, 2, 1, &current_section);
113 + ret += ov_read(&vf, cast(byte*)buffer[ret..$].ptr, _size-ret, 0, 2, 1, &current_section);
114 return buffer;