* fix resourcestring assignment in typedconst

git-svn-id: trunk@7339 -
This commit is contained in:
peter 2007-05-15 06:52:36 +00:00
parent 5c914393d5
commit aa72495049
7 changed files with 33 additions and 13 deletions

2
.gitattributes vendored
View File

@ -8190,6 +8190,7 @@ tests/webtbs/tw8304.pp svneol=native#text/plain
tests/webtbs/tw8312.pp svneol=native#text/plain
tests/webtbs/tw8321.pp svneol=native#text/plain
tests/webtbs/tw8371.pp svneol=native#text/plain
tests/webtbs/tw8372.pp svneol=native#text/plain
tests/webtbs/tw8391.pp svneol=native#text/plain
tests/webtbs/tw8434.pp svneol=native#text/plain
tests/webtbs/tw8462.pp svneol=native#text/plain
@ -8260,6 +8261,7 @@ tests/webtbs/uw6203.pp svneol=native#text/plain
tests/webtbs/uw6767.pp svneol=native#text/plain
tests/webtbs/uw7381.pp svneol=native#text/plain
tests/webtbs/uw8180.pp svneol=native#text/plain
tests/webtbs/uw8372.pp svneol=native#text/plain
utils/Makefile svneol=native#text/plain
utils/Makefile.fpc svneol=native#text/plain
utils/README -text

View File

@ -43,7 +43,7 @@ type
{$endif Test_Double_checksum}
const
CurrentPPUVersion=78;
CurrentPPUVersion=79;
{ buffer sizes }
maxentrysize = 1024;

View File

@ -512,7 +512,7 @@ implementation
list.concat(Tai_const.Createname(tlabelsym(srsym).mangledname,offset));
constsym :
if tconstsym(srsym).consttyp=constresourcestring then
list.concat(Tai_const.Createname(make_mangledname('RESOURCESTRINGLIST',tconstsym(srsym).owner,''),tconstsym(srsym).resstrindex*(4+sizeof(aint)*3)+4+sizeof(aint)))
list.concat(Tai_const.Createname(make_mangledname('RESSTR',tconstsym(srsym).owner,tconstsym(srsym).name),sizeof(aint)))
else
Message(type_e_variable_id_expected);
else
@ -1077,7 +1077,7 @@ implementation
begin
flush_packed_value(list,bp);
curroffset:=align(curroffset,8);
end;
end;
read_typed_const_data(list,tfieldvarsym(srsym).vardef);
end
else

View File

@ -249,7 +249,6 @@ interface
constdefderef : tderef;
consttyp : tconsttyp;
value : tconstvalue;
resstrindex : longint; { needed for resource strings }
constructor create_ord(const n : string;t : tconsttyp;v : tconstexprint;def:tdef);
constructor create_ordptr(const n : string;t : tconsttyp;v : tconstptruint;def:tdef);
constructor create_ptr(const n : string;t : tconsttyp;v : pointer;def:tdef);
@ -1496,7 +1495,6 @@ implementation
fillchar(value, sizeof(value), #0);
consttyp:=t;
value.valueord:=v;
ResStrIndex:=0;
constdef:=def;
end;
@ -1507,7 +1505,6 @@ implementation
fillchar(value, sizeof(value), #0);
consttyp:=t;
value.valueordptr:=v;
ResStrIndex:=0;
constdef:=def;
end;
@ -1518,7 +1515,6 @@ implementation
fillchar(value, sizeof(value), #0);
consttyp:=t;
value.valueptr:=v;
ResStrIndex:=0;
constdef:=def;
end;
@ -1580,8 +1576,6 @@ implementation
value.len:=ppufile.getlongint;
getmem(pc,value.len+1);
ppufile.getdata(pc^,value.len);
if consttyp=constresourcestring then
ResStrIndex:=ppufile.getlongint;
value.valueptr:=pc;
end;
constreal :
@ -1668,8 +1662,6 @@ implementation
begin
ppufile.putlongint(value.len);
ppufile.putdata(pchar(value.valueptr)^,value.len);
if consttyp=constresourcestring then
ppufile.putlongint(ResStrIndex);
end;
constreal :
ppufile.putreal(pbestreal(value.valueptr)^);

View File

@ -1471,8 +1471,6 @@ begin
writeln(space,' Length : ',len);
writeln(space,' Value : "',pc,'"');
freemem(pc,len+1);
if tconsttyp(b)=constresourcestring then
writeln(space,' Index : ',getlongint);
end;
constreal :
writeln(space,' Value : ',getreal);

13
tests/webtbs/tw8372.pp Normal file
View File

@ -0,0 +1,13 @@
program a;
{$APPTYPE CONSOLE}
{$IFDEF fpc}
{$mode delphi}
{$ENDIF}
{$H+}
uses SysUtils,uw8372;
begin
writeln(sChromatogram);
end.

15
tests/webtbs/uw8372.pp Normal file
View File

@ -0,0 +1,15 @@
unit uw8372;
{$mode delphi}
interface
resourcestring
sChromatogram='Chromatogram';
var
ps:PResStringRec=@sChromatogram;
implementation
end.