From 9a0555cacd326bf1839d9aa60d582c07879cb411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Sun, 8 Sep 2024 10:31:39 +0200 Subject: [PATCH] * Prefix and add const --- packages/wasm-utils/src/wasm.pas2js.regexp.pas | 4 ++-- packages/wasm-utils/src/wasm.regexp.shared.pp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/wasm-utils/src/wasm.pas2js.regexp.pas b/packages/wasm-utils/src/wasm.pas2js.regexp.pas index a30386d..febdcd8 100644 --- a/packages/wasm-utils/src/wasm.pas2js.regexp.pas +++ b/packages/wasm-utils/src/wasm.pas2js.regexp.pas @@ -257,7 +257,7 @@ var begin lRegExp:=env.GetUTF8StringFromMem(aExpr,aExprLen); - lFlags:=FlagsToString(aFlags); + lFlags:=RegexpFlagsToString(aFlags); {$IFNDEF NOLOGAPICALLS} If LogAPICalls then LogCall('RegExp.Allocate("%s","%s",[%x])',[lRegExp,lFlags,aID]); @@ -363,7 +363,7 @@ begin lRegExp:=FindRegExp(aExprID); if lRegExp=Nil then Exit(WASMRE_RESULT_INVALIDID); - lFlags:=StringToFlags(lRegexp.RegExp.Flags); + lFlags:=StringToRegexpFlags(lRegexp.RegExp.Flags); Env.SetMemInfoInt32(aFlags,lFLags); Result:=WASMRE_RESULT_SUCCESS; end; diff --git a/packages/wasm-utils/src/wasm.regexp.shared.pp b/packages/wasm-utils/src/wasm.regexp.shared.pp index 253bd7e..6531842 100644 --- a/packages/wasm-utils/src/wasm.regexp.shared.pp +++ b/packages/wasm-utils/src/wasm.regexp.shared.pp @@ -59,8 +59,8 @@ Const regexpFN_GetIndexes = 'get_indexes'; regexpFN_GetNamedGroupIndexes = 'get_named_group_indexes'; -Function StringToFlags(S : String; IgnoreUnknown : Boolean = True) : Longint; -Function FlagsToString(S : Longint) : String; +Function StringToRegexpFlags(const S : String; IgnoreUnknown : Boolean = True) : Longint; +Function RegexpFlagsToString(S : Longint) : String; implementation @@ -72,7 +72,7 @@ uses {$ENDIF} -Function StringToFlags(S : String; IgnoreUnknown : Boolean = True) : Longint; +Function StringToRegexpFlags(const S : String; IgnoreUnknown : Boolean = True) : Longint; var C : Char; @@ -100,7 +100,7 @@ begin end; end; -Function FlagsToString(S : Longint) : String; +Function RegexpFlagsToString(S : Longint) : String; var C,I : Longint;