Skip to content

Commit 53fb3b3

Browse files
committed
Resolved all but 7 warings
1 parent 8ecd7ea commit 53fb3b3

23 files changed

+185
-261
lines changed

Rhodus_Version_3/RhodusVersionThreeProject.dproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<FrameworkType>None</FrameworkType>
66
<MainSource>RhodusVersionThreeProject.dpr</MainSource>
77
<Base>True</Base>
8-
<Config Condition="'$(Config)'==''">Release</Config>
8+
<Config Condition="'$(Config)'==''">Debug</Config>
99
<Platform Condition="'$(Platform)'==''">Win32</Platform>
1010
<TargetedPlatforms>3</TargetedPlatforms>
1111
<AppType>Console</AppType>
0 Bytes
Binary file not shown.

Rhodus_Version_3/uBuiltInConfig.pas

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@ TBuiltInConfig= class (TModuleLib)
2626

2727
implementation
2828

29-
Uses Windows, uSymboLTable, uVM, uStringObject, uListObject, uMemoryManager, uRhodusEngine;
29+
Uses Windows,
30+
uSymboLTable,
31+
uVM,
32+
uStringObject,
33+
uListObject,
34+
uMemoryManager,
35+
uMachineStack,
36+
uRhodusEngine;
3037

3138
// --------------------------------------------------------------------------------------------
3239

@@ -55,7 +62,7 @@ procedure TBuiltInConfig.showByteCode (vm : TObject);
5562

5663
procedure TBuiltInConfig.getVersion (vm : TObject);
5764
begin
58-
TVM (vm).push (TStringObject.create(RHODUS_VERSION));
65+
TVM (vm).push (TStringObject.create(string (RHODUS_VERSION)));
5966
end;
6067

6168

Rhodus_Version_3/uBuiltInFile.pas

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ procedure TBuiltInFile.openFile (vm : TObject);
156156

157157
procedure TBuiltInFile.closeFile (vm : TObject);
158158
var fileHandle : integer;
159-
f : TStreamReader;
160159
fr : TFileRecord;
161160
begin
162161
fileHandle := TVM (vm).popInteger;

Rhodus_Version_3/uBuiltInGlobal.pas

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ procedure computeBaseLineMemoryAllocated;
1818
procedure addGlobalMethodsToModule (module : TModuleLib);
1919

2020
var mainModule : TModuleLib;
21-
baseLineMemoryAllocated : integer;
21+
baseLineMemoryAllocated : UInt64;
2222

2323
procedure createGlobalBuiltIns;
2424

@@ -100,7 +100,7 @@ procedure argMustBeNumber;
100100

101101
function getMemoryAllocated : integer;
102102
var st: TMemoryManagerState; sb: TSmallBlockTypeState;
103-
value : integer;
103+
value : UInt64;
104104
begin
105105
getMemoryManagerState(st);
106106
value := st.TotalAllocatedMediumBlockSize + st.TotalAllocatedLargeBlockSize;
@@ -227,7 +227,7 @@ function countElements (alist : TListObject) : integer;
227227

228228
function getDimensions (alist : TListObject; count : integer) : TIndexArray;
229229
var firstdim : integer;
230-
i, n, dimIndex : integer;
230+
n, dimIndex : integer;
231231
aitem : TListItem;
232232
begin
233233
firstdim := alist.list.Count;
@@ -410,13 +410,13 @@ procedure TBuiltInGlobal.readString (vm : TObject);
410410
nArgs := TVM (vm).popInteger;
411411
case nArgs of
412412
0 : prompt := '';
413-
1 : prompt := TVM (vm).popString ().value;
413+
1 : prompt := AnsiString (TVM (vm).popString ().value);
414414
else
415415
raise ERuntimeException.Create('readString takes a single string argument or none at all');
416416
end;
417417

418418
if Assigned (TVM (vm).readStringCallbackPtr) then
419-
s := TVM (vm).readStringCallbackPtr(prompt);
419+
s := string (AnsiString (TVM (vm).readStringCallbackPtr(prompt)));
420420
sobj := TStringObject.create (s);
421421
TVM (vm).push (sObj);
422422
end;
@@ -432,20 +432,20 @@ procedure TBuiltInGlobal.readNumber (vm : TObject);
432432
nArgs := TVM (vm).popInteger;
433433
case nArgs of
434434
0 : prompt := '';
435-
1 : prompt := TVM (vm).popString ().value;
435+
1 : prompt := AnsiString (TVM (vm).popString ().value);
436436
else
437437
raise ERuntimeException.Create('readString takes a single string argument or none at all');
438438
end;
439439

440440
if Assigned (TVM (vm).readStringCallbackPtr) then
441-
s := TVM (vm).readStringCallbackPtr(prompt);
441+
s := string (AnsiString (TVM (vm).readStringCallbackPtr(prompt)));
442442

443443
while (not TryStrToInt(s, iValue)) and (not TryStrToFloat(s, dValue)) do
444444
begin
445445
if assigned (TVM (vm).printlnCallbackPtr) then
446-
TVM (vm).printlnCallbackPtr ('Number error: ' + s + ' is not a number, try again');
446+
TVM (vm).printlnCallbackPtr (AnsiString ('Number error: ' + s + ' is not a number, try again'));
447447
if Assigned (TVM (vm).readStringCallbackPtr) then
448-
s := TVM (vm).readStringCallbackPtr(prompt);
448+
s := string (AnsiString (TVM (vm).readStringCallbackPtr(prompt)));
449449
end;
450450
if TryStrToInt(s, iValue) then
451451
TVM (vm).push (iValue)

Rhodus_Version_3/uBuiltInMatrix.pas

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ procedure TBuiltInMatrix.getTranspose (vm : TObject);
147147

148148

149149
procedure TBuiltInMatrix.getAdd (vm : TObject);
150-
var m1, m2, ar : TArrayObject;
150+
var m1, m2 : TArrayObject;
151151
begin
152152
m2 := TVM (vm).popArray;
153153
m1 := TVM (vm).popArray;
@@ -159,7 +159,7 @@ procedure TBuiltInMatrix.getAdd (vm : TObject);
159159

160160

161161
procedure TBuiltInMatrix.getSub (vm : TObject);
162-
var m1, m2, ar : TArrayObject;
162+
var m1, m2 : TArrayObject;
163163
begin
164164
m2 := TVM (vm).popArray;
165165
m1 := TVM (vm).popArray;
@@ -266,8 +266,6 @@ procedure TBuiltInMatrix.matrixGeneralMult (vm : TObject; m : TArrayObject; x :
266266

267267
procedure TBuiltInMatrix.getMult (vm : TObject);
268268
var m1, m2 : PMachineStackRecord;
269-
ar : TArrayObject;
270-
sum : double;
271269
begin
272270
m2 := TVM (vm).pop;
273271
m1 := TVM (vm).pop;

Rhodus_Version_3/uBuiltInSys.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ constructor TBuiltInSys.Create;
4646
begin
4747
inherited Create ('sys', 'System module');
4848

49-
addStringValue ('version', uBuiltInConfig.RHODUS_VERSION, 'returns the current version number for Rhodus', True);
49+
addStringValue ('version', string (uBuiltInConfig.RHODUS_VERSION), 'returns the current version number for Rhodus', True);
5050
addStringValue ('doubleFormat', TBuiltInSys.defaultDoubleFormat, 'default output format string for double values', False);
5151
addStringValue ('integerFormat', TBuiltInSys.defaultIntegerFormat, 'default output format string for integer values', False);
5252

Rhodus_Version_3/uConstructAST.pas

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ TConstructAST = class(TObject)
5454

5555
function expect(thisToken: TTokenCode) : TASTNode;
5656
function variable: TASTNode;
57-
function parseList: TASTNode;
5857
function parseIndexOrSlice : TASTNode;
5958
function parseIndexedVariable : TASTNode;
6059
function parseFunctionCall: TASTNode;
@@ -251,21 +250,6 @@ function TConstructAST.variable: TASTNode;
251250
end;
252251
end;
253252

254-
// Parse a list of the form: expression ',' expression ','' etc.
255-
// Returns the number of items found in the list
256-
function TConstructAST.parseList: TASTNode;
257-
var node : TASTNodeList;
258-
begin
259-
node := TASTNodeList.Create (ntNodeList);
260-
node.list.Add(expression);
261-
while sc.token = tComma do
262-
begin
263-
sc.nextToken;
264-
node.list.Add(expression);
265-
end;
266-
exit (node);
267-
end;
268-
269253

270254
// Parse: x:y :y x: : x
271255
function TConstructAST.parseIndexOrSlice : TASTNode;
@@ -301,8 +285,7 @@ function TConstructAST.parseIndexOrSlice : TASTNode;
301285
// Parse something of the form variable '[' expressionList ']'
302286
// Such indexing applies to lists and strings
303287
function TConstructAST.parseIndexedVariable : TASTNode;
304-
var node : TASTNode;
305-
nodeList : TASTNodeList;
288+
var nodeList : TASTNodeList;
306289
exp : TASTNode;
307290
begin
308291
nodelist := TASTNodeList.Create (ntNodeList);
@@ -1323,7 +1306,7 @@ function TConstructAST.forStatement: TASTNode;
13231306
breakStack: TStack<integer>;
13241307
assignment: TASTAssignment;
13251308
iterationBlock: TASTIterationBlock;
1326-
rightSide, body, node: TASTNode;
1309+
body, node: TASTNode;
13271310
lower, upper : TASTExpression;
13281311
id : TASTIdentifier;
13291312
begin

Rhodus_Version_3/uObjectSupport.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ implementation
3636

3737
Uses uListObject,
3838
uStringObject,
39+
uMachineStack,
3940
uVM;
4041

4142
constructor TMethodsBase.Create;
@@ -53,9 +54,8 @@ destructor TMethodsBase.Destroy;
5354

5455
procedure TMethodsBase.dir(vm: TObject);
5556
var ls : TListObject;
56-
md : TMethodDetails;
5757
begin
58-
md := TVM (vm).popMethodDetails;
58+
TVM (vm).popMethodDetails;
5959
ls := TListObject.create (0);
6060
for var i := 0 to methodList.Count - 1 do
6161
begin

Rhodus_Version_3/uRepl.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function myRead (const prompt : AnsiString) : PAnsiChar;
6161

6262
procedure setColor (acolor : AnsiString);
6363
begin
64-
uTerminal.setColor(aColor);
64+
uTerminal.setColor(string (aColor));
6565
end;
6666

6767

@@ -153,7 +153,7 @@ function executeCommand (src : string) : boolean;
153153
var index : integer;
154154
helpStr : string;
155155
begin
156-
result := False;
156+
//result := False;
157157

158158
if listOfCommands.find (getCommand (src), index) then
159159
begin

0 commit comments

Comments
 (0)