Check-in [ab3b073ef6]

Not logged in
Overview
SHA1 Hash:ab3b073ef6df9d77fd5670cb1297c1b8d88dd5a4
Date: 2015-04-30 23:29:51
User: kinaba
Comment:private import => import (since in the latest D it is the default.)
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes
hide diffs side-by-side diffs patch

Modified src/bga_melter.d from [3b6f189d5603825c] to [cf24a8abe2b880fc].

1 -private import win32.windows; 2 -private import std.string; 3 -private import std.file; 4 -private import std.c.stdio; 5 -private import std.string; 6 -private import etc.c.zlib; 7 -private import libbz2.bzlib; 8 -private import util; 1 +import win32.windows; 2 +import std.c.stdio; 3 +import std.file; 4 +import std.string; 5 +import etc.c.zlib; 6 +import libbz2.bzlib; 7 +import util; 9 8 10 9 //---------------------------------------------------------------- 11 10 // Bga書庫のファイルヘッダ形式 12 11 //---------------------------------------------------------------- 13 12 14 13 align(1) struct BgaHeader 15 14 { ................................................................................ 93 92 class Filep 94 93 { 95 94 private FILE* fp; 96 95 private this( FILE* p ) { fp = p; } 97 96 98 97 static Filep open( string filename, bool read ) 99 98 { 100 - FILE* fp = fopen( toStringz(filename), read?"rb":"wb" ); 99 + FILE* fp = fopen(filename.toStringz(), read?"rb":"wb"); 101 100 return (fp ? new Filep(fp) : null); 102 101 } 103 102 104 103 int dup_han() 105 104 { 106 105 int fd = dup( fileno(fp) ); 107 106 lseek( fd, cur(), 0 ); ................................................................................ 153 152 //---------------------------------------------------------------- 154 153 // メインクラス 155 154 //---------------------------------------------------------------- 156 155 157 156 class BgaMelter 158 157 { 159 158 alias BgaAnswer delegate(ref BgaHeader) FileHandler; 160 - alias BgaAnswer delegate(int, int) ProgressHandler; 159 + alias BgaAnswer delegate(int, int) ProgressHandler; 161 160 162 161 private Filep fp = null; 163 162 164 163 this( string arc_name ) 165 164 { 166 165 fp = Filep.open( arc_name, true ); 167 166 if( fp is null ) ................................................................................ 213 212 bContinue = GzDec( hdr.compressed_size, hdr.original_size, outf, ph ); 214 213 else if( hdr.method == "BZ2\0" ) 215 214 bContinue = BzDec( hdr.original_size, outf, ph ); 216 215 217 216 // 閉じて属性設定 218 217 outf.close(); 219 218 dosSetFTime( hdr.fname, hdr.date, hdr.time ); 220 - SetFileAttributesA( toStringz(hdr.fname), hdr.attrib ); 219 + SetFileAttributesA( hdr.fname.toStringz(), hdr.attrib ); 221 220 if( !bContinue ) 222 221 return; 223 222 } 224 223 finally { fp.seek_to(nextpos); } 225 224 } 226 225 } 227 226 finally { close(); } ................................................................................ 284 283 if( hdr.arc_type==2 ) 285 284 return false; 286 285 if( hdr.arc_type==0 && hdr.compressed_size==hdr.original_size ) 287 286 { 288 287 int x = hdr.fname.lastIndexOf('.'); 289 288 if( x == -1 ) 290 289 return true; 291 - string ext = toLower(hdr.fname[x+1 .. $]); 290 + string ext = hdr.fname[x+1 .. $].toLower(); 292 291 if( ext=="arc" || ext=="arj" || ext=="bz2" || ext=="bza" 293 292 || ext=="cab" || ext=="gz" || ext=="gza" || ext=="lzh" 294 293 || ext=="lzs" || ext=="pak" || ext=="rar" || ext=="taz" 295 294 || ext=="tbz" || ext=="tgz" || ext=="z" || ext=="zip" 296 295 || ext=="zoo" ) 297 296 return false; 298 297 } 299 298 return true; 300 299 } 301 300 302 301 static string pathMake( string path ) 303 302 { 304 - char* ps = cast(char*)toStringz(path); 305 - for(char* p=ps;;) 303 + char* ps = cast(char*)path.toStringz(); 304 + for(char* p=ps;; ++p) 306 305 { 307 306 for(; *p!=0&&*p!='\\'&&*p!='/'; p=CharNextA(p)) {} 308 307 if( *p==0 ) 309 308 break; 310 - CreateDirectoryA( toStringz(ps[0..(p-ps)]), null ); 311 - ++p; 309 + CreateDirectoryA( ps[0..(p-ps)].toStringz(), null ); 312 310 } 313 311 return path; 314 312 } 315 313 316 - enum { BUFSIZ = 65536 } 314 + enum BUFSIZ = 65536; 317 315 318 316 private bool NcDec( uint usiz, Filep outf, ProgressHandler ph ) 319 317 { 320 318 uint init_usiz = usiz; 321 319 322 320 // 非圧縮。コピーするだけ 323 321 while( usiz )

Modified src/hack.d from [23c3e51375a8c6a1] to [bca565610f0d70a9].

1 -private import core.sys.windows.windows; 1 +import core.sys.windows.windows; 2 2 3 3 // Hack! 4 4 // 5 5 // _acrtused_dllが勝手に終了時に標準入出力ハンドルを 6 6 // 閉じちゃって困るので、その辺りだけは閉じないような 7 7 // CloseHandleを突っ込んで回避。いいのかこれ。 8 8

Modified src/qbga32.d from [bcd83037acfbb1eb] to [c2d888a3830db302].

1 -private import core.sys.windows.dll; 2 -private import win32.windows; 3 -private import win32.winuser; 4 -private import std.string; 5 -private import std.file; 6 -private import util; 7 -private import windll; 8 -private import bga_melter; 9 -private import qbga_gui; 1 +import core.sys.windows.dll; 2 +import win32.windows; 3 +import win32.winuser; 4 +import std.string; 5 +import std.file; 6 +import util; 7 +import windll; 8 +import bga_melter; 9 +import qbga_gui; 10 10 11 11 //---------------------------------------------------------------- 12 12 // おきまりのDLL初期化ルーチン 13 13 //---------------------------------------------------------------- 14 14 15 15 __gshared HINSTANCE g_hinst; 16 16

Modified src/util.d from [9a6609551ad86e62] to [affffc4f40848d74].

1 -private import win32.windows; 2 -private import std.string; 3 -private import std.file; 1 +import win32.windows; 2 +import std.string; 3 +import std.file; 4 4 5 5 char lastChar( string s ) 6 6 { return *CharPrevA(cast(char*)s.ptr, cast(char*)s.ptr+s.length); } 7 7 8 8 //---------------------------------------------------------------- 9 9 // int do_opApply!(E, C)( collection, delegate ); 10 10 // int do_opApply!(E) ( array, delegate );

Modified src/windll.d from [109289fec72a32d4] to [bbb6d5827e2268a2].

1 -private import win32.windows; 2 -private import std.string; 1 +import win32.windows; 2 +import std.string; 3 3 4 4 class WinDLLException : Exception 5 5 { 6 6 private this( string msg ) { super(msg); } 7 7 } 8 8 9 9 class WinDLL