...
 
Commits (2)
......@@ -118,7 +118,6 @@ var PNGcount, newgfxcount : dword;
songlist : array of string[12];
var game, crctableid : dword;
filu : file; // used by decomp_music, todo: replace with SaveFile()
procedure PrintError(const wak : UTF8string);
......@@ -715,10 +714,6 @@ var filusr : TSearchRec;
begin
decomp_logger('----------------------------------------------------------------------');
decomp_logger('scanning ' + currentsearch);
setlength(exelist, 0); // <-- why no friendly TList of UTF8string? ;_;
setlength(comlist, 0);
setlength(dirlist, 0);
setlength(filulist, 0);
execount := 0; comcount := 0; dircount := 0; filucount := 0;
// Figure out what directory the current search is in.
curdir := ExtractFilePath(currentsearch);
......
......@@ -356,7 +356,7 @@ begin
blockread(infilu, minibuf[0], i);
// Parse the PNG header. (mcg_ReadHeaderOnly was set to 1 earlier)
//workimu.image := NIL; // just to remove a compiler warning
workimu.image := NIL; // just to remove a compiler warning
fillbyte(workimu, sizeof(workimu), 0);
try
workimu := mcg_bitmap.FromPNG(@minibuf[0], i);
......
......@@ -463,6 +463,7 @@ begin
IsConsole := TRUE;
SysInitStdIO;
conhandle := GetStdHandle(STD_OUTPUT_HANDLE);
coninfo.dwSize.x := 0; // silence a compiler warning...
GetConsoleScreenBufferInfo(conhandle, coninfo);
// Starting as a GUI program immediately releases the parent console, which causes the standard directory prompt to be
// printed. Since the above attach only happens afterward, we have to capture and clear the prompt. This doesn't regain
......@@ -506,6 +507,7 @@ var coninfo : CONSOLE_SCREEN_BUFFER_INFO;
begin
if length(promptBuffer) = 0 then exit;
writeln;
coninfo.dwSize.x := 0; // silence a compiler warning...
GetConsoleScreenBufferInfo(conhandle, coninfo);
bufferSize.X := length(promptBuffer);
bufferSize.Y := 1;
......
......@@ -206,6 +206,7 @@ begin
while (lenp < buffyendp) and (byte(lenp^) <> 0) do inc(lenp);
length := lenp - readp;
result := ''; // UTF8string when used as function result is not auto-inited, have to clear it manually before use.
setlength(result, length);
if length <> 0 then move(readp^, result[1], length);
inc(readp, length + 1);
......@@ -240,15 +241,16 @@ function TFileLoader.ReadStringFrom(readofs : ptruint) : UTF8string;
// Does not advance read counters, but does range checking. If the requested string goes beyond the buffer, cuts the string at
// the buffer boundary.
var startp, lenp : pointer;
length : ptruint;
len : ptruint;
begin
startp := buffy + readofs;
lenp := startp;
while (lenp < buffyendp) and (byte(lenp^) <> 0) do inc(lenp);
length := lenp - startp;
len := lenp - startp;
setlength(result, length);
if length <> 0 then move(startp^, result[1], length);
result := ''; // UTF8string when used as function result is not auto-inited, have to clear it manually before use.
setlength(result, len);
if len <> 0 then move(startp^, result[1], len);
end;
function TFileLoader.PtrAt(writeofs : ptruint) : pointer;
......