Differences From Artifact [cf24a8abe2b880fc]:
- File
src/bga_melter.d
- 2015-04-30 23:29:51 - part of checkin [ab3b073ef6] on branch trunk - private import => import (since in the latest D it is the default.) (user: kinaba) [annotate]
To Artifact [4c58bb3061c0a99d]:
- File
src/bga_melter.d
-
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
The problem was __gshared. Replacing it with TLS fixed the issue. Remaining problem is that "hack.d"'s CloseHandle hack is not working anymore.
(user: kinaba) [annotate]
-
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
256 256
257 257 return -1;
258 258 }
259 259
260 260 private bool read_header( out BgaHeader hdr )
261 261 {
262 262 // リトルエンディアンを仮定。ヘッダ読み込み
263 - string buf = cast(string) fp.read(28);
263 + void[] buf = fp.read(28);
264 264 if( buf.length < 28 ) return false;
265 265 buf.length = BgaHeader.sizeof;
266 266 hdr = (cast(BgaHeader[]) buf)[0];
267 267 hdr.fname = "";
268 268
269 269 // ファイル名
270 270 hdr.fname = cast(string) fp.read(hdr.dir_name_len + hdr.file_name_len);
271 271 if( hdr.fname.length < hdr.dir_name_len + hdr.file_name_len ) return false;
272 272
273 273 // チェックサム
274 274 int sum = 0;
275 - for( int i=4; i!=28; ++i ) sum += signed_char(buf[i]);
275 + for( int i=4; i!=28; ++i ) sum += signed_char((cast(char[])buf)[i]);
276 276 foreach( char c ; hdr.fname ) sum += signed_char(c);
277 277 return (sum == hdr.checksum);
278 278 }
279 279
280 280 private bool is_compressed( ref BgaHeader hdr ) // ref=just for optimization
281 281 {
282 282 // ヘッダから、ファイルが圧縮格納されているかどうかを判定