mbColorLib: Less hints and warnings.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8129 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2021-10-27 17:26:55 +00:00
parent 83b7ffa66d
commit abdec8801e
19 changed files with 61 additions and 45 deletions

View File

@@ -65,7 +65,7 @@ function ReadPhotoshopAct(PalFile: TFileName): string;
implementation
uses
Math, mbColorConv;
mbColorConv;
function ReplaceFlags(s: string; flags: array of string; value: integer): string;
var
@@ -239,7 +239,7 @@ var
Scolor: string;
Faktor: double;
a: RGBArray;
b: array of RGBArray;
b: array of RGBArray = nil;
begin
Result := '';
Span := 300;
@@ -683,13 +683,22 @@ end;
function ReadPhotoshopAco(PalFile: TFileName): AcoColors;
var
f: file;
ver, num, space, w, x, y, z, dummy: Word;
i: integer;
v0Length: byte;
v0Name: string;
v2Length: Word;
v2Name: WideString;
ver: word = 0;
num: word = 0;
space: word = 0;
w: word = 0;
x: word = 0;
y: word = 0;
z: word = 0;
dummy: Word = 0;
v0Length: byte = 0;
v0Name: string = '';
v2Length: Word = 0;
v2Name: WideString = '';
begin
Result := Default(AcoColors);
if not FileExists(PalFile) then
begin
SetLength(Result.Colors, 0);
@@ -744,7 +753,7 @@ begin
SetLength(v0Name, v0Length);
if v0Length > 0 then
BlockRead(f, PChar(v0Name)^, v0Length);
Result.Names[i] := v0Name;
Result.Names[i] := UTF8Decode(v0Name);
end;
2: begin
BlockRead(f, dummy, sizeof(dummy));
@@ -753,7 +762,7 @@ begin
SetLength(v2Name, v2Length - 1);
if v2Length > 0 then
begin
BlockRead(f, PWideChar(v2Name)^, 2*(v2Length - 1));
BlockRead(f, PWideChar(v2Name)^, (Int64(v2Length) - 1)*2);
ExchangeChars(v2Name);
end;
Result.Names[i] := v2Name;
@@ -767,7 +776,9 @@ end;
function ReadPhotoshopAct(PalFile: TFileName): string;
var
f: file;
r, g, b: byte;
r: byte = 0;
g: byte = 0;
b: byte = 0;
s: TStringList;
i: integer;
begin