Skip to content

Commit

Permalink
bunch of warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cheat-engine committed Jun 1, 2018
1 parent 8ed1de5 commit d517b3c
Show file tree
Hide file tree
Showing 47 changed files with 775 additions and 556 deletions.
6 changes: 6 additions & 0 deletions Cheat Engine/CEFuncProc.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2414,6 +2414,7 @@ function GetCEdir:string;
function GetWinDir:string;
var x: pchar;
begin
result:='';
getmem(x,200);
if GetWindowsDirectory(x,200)>0 then
begin
Expand Down Expand Up @@ -2929,11 +2930,14 @@ function VariableTypeToTranslatedString(variableType: TVariableType): string;
vtPointer: result:=rs_vtPointer;
vtAutoAssembler: Result:=rs_vtAutoAssembler;
vtCustom: Result:=rs_vtCustom;
else
result:='Error';
end;
end;

function VariableTypeToString(variableType: TVariableType): string;
begin

case variabletype of
vtAll: result:='All';
vtBinary: result:='Binary';
Expand All @@ -2949,6 +2953,8 @@ function VariableTypeToString(variableType: TVariableType): string;
vtPointer: result:='Pointer';
vtAutoAssembler: Result:='Auto Assembler Script';
vtCustom: Result:='Custom';
else
result:='Error';
end;
end;

Expand Down
2 changes: 1 addition & 1 deletion Cheat Engine/CustomTypeHandler.pas
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ function registerCustomTypeLua(L: PLua_State): integer; cdecl;
function registerCustomTypeAutoAssembler(L: PLua_State): integer; cdecl;
var
parameters: integer;
typename: string;
typename: string='';
bytecount: integer;
script: string;
ct: TCustomType;
Expand Down
6 changes: 4 additions & 2 deletions Cheat Engine/FoundCodeUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,9 @@ procedure TFoundCodedialog.moreinfo;

d: TDisassembler;
begin
if processhandler.is64bit then
firstchar:='R' else firstchar:='E';

itemindex:=foundcodelist.ItemIndex;
if itemindex<>-1 then
begin
Expand Down Expand Up @@ -935,8 +938,7 @@ procedure TFoundCodedialog.moreinfo;
else
begin

if processhandler.is64bit then
firstchar:='R' else firstchar:='E';


lblRAX.caption:=firstchar+'AX='+IntToHex(coderecord.context.{$ifdef cpu64}Rax{$else}Eax{$endif},8);
lblRBX.caption:=firstchar+'BX='+IntToHex(coderecord.context.{$ifdef cpu64}Rbx{$else}Ebx{$endif},8);
Expand Down
1 change: 1 addition & 0 deletions Cheat Engine/HotKeys.pas
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ function THotkeyform.HotkeyActionToText(a: TMemrecHotkeyAction): string;
Increase value with:
}
result:='';
if memrec.VarType=vtAutoAssembler then
begin
case a of
Expand Down
8 changes: 7 additions & 1 deletion Cheat Engine/LuaClass.pas
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ TClasslistentry=record
function TRecordEntries.getEntry(index: integer): TRecordEntry;
begin
if index<length(list) then
result:=list[index];
result:=list[index]
else
begin
result.name:='';
result.getf:=nil;
result.setf:=nil;
end;
end;

procedure TRecordEntries.setEntry(index: integer; e: TRecordEntry);
Expand Down
27 changes: 15 additions & 12 deletions Cheat Engine/LuaHandler.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4667,7 +4667,7 @@ function lua_dbvm_getNMIcount(L: PLua_state): integer; cdecl;

function lua_dbvm_watch_writes(L: PLua_state): integer; cdecl;
var
physicalAddress: qword;
physicalAddress: qword=0;
size: integer;
options: DWORD;
MaxEntryCount: integer;
Expand Down Expand Up @@ -4704,7 +4704,7 @@ function lua_dbvm_watch_writes(L: PLua_state): integer; cdecl;

function lua_dbvm_watch_reads(L: PLua_state): integer; cdecl;
var
physicalAddress: qword;
physicalAddress: qword=0;
size: integer;
options: DWORD;
MaxEntryCount: integer;
Expand Down Expand Up @@ -5132,6 +5132,8 @@ function lua_dbvm_watch_disable(L: PLua_State): integer; cdecl;

id:=lua_tointeger(L,1);
dbvm_watch_delete(id);

result:=0;
end;

function lua_dbvm_cloak_activate(L: PLua_State): integer; cdecl;
Expand Down Expand Up @@ -6703,7 +6705,7 @@ function createTreeView(L: Plua_State): integer; cdecl; //undocument, unsupporte

function lua_loadTable(L: Plua_State): integer; cdecl;
var
filename: string;
filename: string='';
parameters: integer;
merge: boolean;
doc: TXMLDocument;
Expand Down Expand Up @@ -8668,6 +8670,7 @@ function lua_loadFontFromStream(L: PLua_state): integer; cdecl;

h: THandle;
begin
result:=0;

if lua_isuserdata(L, 1) then
begin
Expand All @@ -8679,12 +8682,7 @@ function lua_loadFontFromStream(L: PLua_state): integer; cdecl;
lua_pushinteger(L, h);
result:=1;
end;

end;




end;

function lua_speakex(engLang: boolean; L: Plua_State): integer; cdecl;
Expand All @@ -8696,7 +8694,10 @@ function lua_speakex(engLang: boolean; L: Plua_State): integer; cdecl;
pc:=lua_gettop(L);

if pc>=1 then
s:=Lua_ToString(L, 1);
s:=Lua_ToString(L, 1)
else
exit(0);


if engLang then
begin
Expand Down Expand Up @@ -9556,7 +9557,7 @@ function lua_getHandleList(L: PLua_state): integer; cdecl;
i,j: integer;

filter: integer;
peprocess: ptruint;
peprocess: ptruint=0;
begin
i:=sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO)+128*sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO);
getmem(shi,i);
Expand Down Expand Up @@ -9710,9 +9711,11 @@ function lua_cpuid(L: PLua_state): integer; cdecl;
var r: TCPUIDResult;
i: integer;
begin
if lua_gettop(L)=0 then exit(0);
if lua_gettop(L)>=1 then
a:=lua_tointeger(L,1);
a:=lua_tointeger(L,1)
else
exit(0);


if lua_gettop(L)>=2 then
c:=lua_tointeger(L,2)
Expand Down
2 changes: 1 addition & 1 deletion Cheat Engine/MainUnit2.pas
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ procedure initcetitle;



const beta='Beta 3'; //empty this for a release
const beta='Beta 4'; //empty this for a release

var
CEnorm:string;
Expand Down
2 changes: 2 additions & 0 deletions Cheat Engine/MemoryBrowserFormUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2920,6 +2920,7 @@ procedure TMemoryBrowser.EAXLabelDblClick(Sender: TObject);
labeltext: string;

begin
regname:='';
labeltext:=tlabel(sender).Caption;

if (debuggerthread<>nil) and (debuggerthread.isWaitingToContinue) then
Expand Down Expand Up @@ -2955,6 +2956,7 @@ procedure TMemoryBrowser.EAXLabelDblClick(Sender: TObject);
26: regname:='OF';

6408..6415: regname:='R'+inttostr(i-6400);

end;


Expand Down
28 changes: 14 additions & 14 deletions Cheat Engine/MemoryRecordUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1539,29 +1539,29 @@ function TMemoryRecord.hasSelectedParent: boolean;
procedure TMemoryRecord.getXMLNode(node: TDOMNode; selectedOnly: boolean);
{$IFNDEF UNIX}
var
doc: TDOMDocument;
cheatEntry: TDOMNode;
cheatEntries: TDOMNode;
offsets: TDOMNode;
doc: TDOMDocument=nil;
cheatEntry: TDOMNode=nil;
cheatEntries: TDOMNode=nil;
offsets: TDOMNode=nil;
hks, hk,hkkc: TDOMNode;
opt: TDOMNode;
laststate: TDOMNode;
soundentry: TDOMNode;
opt: TDOMNode=nil;
laststate: TDOMNode=nil;
soundentry: TDOMNode=nil;

n: TDOMNode;
n: TDOMNode=nil;

tn: TTreenode;
tn: TTreenode=nil;
i,j: integer;
a:TDOMAttr;

s: ansistring;

ddl: TDOMNode;
offset: TDOMNode;
ddl: TDOMNode=nil;
offset: TDOMNode=nil;
{$ENDIF}
begin
{$IFNDEF UNIX}
if selectedonly then
if selectedonly then
begin
if (not isselected) then exit; //don't add if not selected and only the selected items should be added

Expand Down Expand Up @@ -1682,8 +1682,7 @@ procedure TMemoryRecord.getXMLNode(node: TDOMNode; selectedOnly: boolean);
end;



if Active then
if (laststate<>nil) and Active then
begin
a:=doc.CreateAttribute('Activated');
a.TextContent:='1';
Expand Down Expand Up @@ -3169,6 +3168,7 @@ function TMemoryRecord.getlinkedDropDownMemrec_LoopDetected: boolean;

function MemRecHotkeyActionToText(action: TMemrecHotkeyAction): string;
begin
result:='';
//DO NOT TRANSLATE THIS
case action of
mrhToggleActivation: result:='Toggle Activation';
Expand Down
4 changes: 2 additions & 2 deletions Cheat Engine/StructuresFrm2.lfm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
object frmStructures2: TfrmStructures2
Left = 274
Left = 263
Height = 381
Top = 595
Top = 706
Width = 542
Caption = 'Structure dissect'
ClientHeight = 361
Expand Down
8 changes: 7 additions & 1 deletion Cheat Engine/StructuresFrm2.pas
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ function lookupStructureName(address: ptruint; defaultName: string) : string;

function DisplaymethodToString(d:TdisplayMethod): string;
begin
result:='';
case d of
dtUnsignedInteger: result:=rsUnsignedInteger;
dtSignedInteger: result:=rsSignedInteger;
Expand Down Expand Up @@ -4624,7 +4625,10 @@ procedure TfrmSTructures2.OnChangeTypeMenuItemClick(Sender: TObject);
else if (Sender = miChangeTypeString) then vt := vtString
else if (Sender = miChangeTypeUnicode) then vt := vtUnicodeString
else if (Sender = miChangeTypeArrayOfByte) then vt := vtByteArray
else if (Sender = miChangeTypePointer) then vt := vtPointer;
else if (Sender = miChangeTypePointer) then vt := vtPointer
else
vt:=vtByte;


case vt of
vtByte: size := 1;
Expand All @@ -4637,6 +4641,8 @@ procedure TfrmSTructures2.OnChangeTypeMenuItemClick(Sender: TObject);
vtByteArray: size := 16;
vtString: size := 32;
vtUnicodeString: size := 32;
else
size:=1;
end;

displayMethod := dtHexadecimal;
Expand Down
2 changes: 2 additions & 0 deletions Cheat Engine/asktorunluascript.pas
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ implementation

function TfrmLuaScriptQuestion.getLuaScriptAction: integer;
begin
result:=0;

if rbAlways.checked then result:=0 else
if rbSignedOnly.checked then result:=1 else
if rbAlwaysAsk.checked then result:=2 else
Expand Down
Loading

0 comments on commit d517b3c

Please sign in to comment.