Skip to content

Commit

Permalink
fix: Int64/QWord now good on IntToBin()
Browse files Browse the repository at this point in the history
  • Loading branch information
gcarreno committed Feb 1, 2021
1 parent 8a29a6e commit 66e0d97
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/application/ljv.application.version.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
interface

const
cVersion = '0.1.3.25';
cVersion = '0.1.3.26';
cVersionMajor = 0;
cVersionMinor = 1;
cVersionRevision = 3;
cVersionBuild = 25;
cVersionBuild = 26;

implementation

Expand Down
18 changes: 4 additions & 14 deletions src/forms/ljv.forms.main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,6 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData);
jtNumber:begin
posY:= 8;

//lbl:= TLabel.Create(panValue);
//lbl.Parent:= panValue;
//lbl.Top:= posY;
//lbl.Left:=8;
//lbl.Caption:= rsLabelValue;
//Inc(posY, 17);

edt:= TEdit.Create(panValue);
edt.Parent:= panValue;
edt.Top:= posY;
Expand All @@ -659,7 +652,7 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData);
edt.ReadOnly:= True;
Inc(posY, 50);

if TJSONNumber(AJSONData).NumberType in [ntInteger, ntQWord] then
if TJSONNumber(AJSONData).NumberType in [ntInteger, ntInt64, ntQWord] then
begin
lblBin:= TLabel.Create(panValue);
lblBin.Parent:= panValue;
Expand All @@ -676,10 +669,7 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData);
edtBin.Anchors:= [akTop, akLeft, akRight];
edtBin.ReadOnly:= True;
Inc(posY, 34);
end;

if TJSONNumber(AJSONData).NumberType in [ntInteger, ntInt64, ntQWord] then
begin
lblHex:= TLabel.Create(panValue);
lblHex.Parent:= panValue;
lblHex.Top:= posY;
Expand Down Expand Up @@ -744,7 +734,7 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData);
case TJSONNumber(AJSONData).NumberType of
ntInteger:begin
edt.Text:= Format('%d', [AJSONData.AsInteger]);
edtBin.Text:= IntToBin(AJSONData.AsInteger, 32, 8);
edtBin.Text:= IntToBin(AJSONData.AsInt64, 32);
edtHex.Text:= IntToHex(AJSONData.AsInteger, 16);
edtBytes.Text:= FormatBytes(AJSONData.AsInteger);
edtDateTime.Text:= FormatDateTime(cDateTimeFormat, UnixToDateTime(AJSONData.AsInteger));
Expand All @@ -754,7 +744,7 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData);
edt.Text:= Format('%d', [AJSONData.AsInt64]);

{ #todo -ogcarreno : Need to fix IntToBin only outputting 32 bits }
//edtBin.Text:= IntToBin(AJSONData.AsInteger, 32, 8);
edtBin.Text:= IntToBin(AJSONData.AsInt64, 64);

edtHex.Text:= IntToHex(AJSONData.AsInt64, 16);
edtBytes.Text:= FormatBytes(AJSONData.AsInt64);
Expand All @@ -766,7 +756,7 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData);
end;
ntQWord:begin
edt.Text:= Format('%d', [AJSONData.AsQWord]);
edtBin.Text:= IntToBin(AJSONData.AsQWord, 32, 8);
edtBin.Text:= IntToBin(AJSONData.AsInt64, 64);
edtHex.Text:= IntToHex(AJSONData.AsQWord, 16);
edtBytes.Text:= FormatBytes(AJSONData.AsQWord);
edtDateTime.Text:= FormatDateTime(cDateTimeFormat, UnixToDateTime(AJSONData.AsQWord));
Expand Down
2 changes: 1 addition & 1 deletion src/lazJSONViewer.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<UseVersionInfo Value="True"/>
<MinorVersionNr Value="1"/>
<RevisionNr Value="3"/>
<BuildNr Value="25"/>
<BuildNr Value="26"/>
<Language Value="0809"/>
</VersionInfo>
<BuildModes Count="4">
Expand Down
Binary file modified src/lazJSONViewer.res
Binary file not shown.

0 comments on commit 66e0d97

Please sign in to comment.