Browse Source

fcl-db: change var params to out in TParams.ParseSQL to reduce compiler hints about uninitialized variables.

git-svn-id: trunk@22960 -
lacak 12 years ago
parent
commit
2a7c9f0848
2 changed files with 5 additions and 5 deletions
  1. 2 2
      packages/fcl-db/src/base/db.pas
  2. 3 3
      packages/fcl-db/src/base/dsparams.inc

+ 2 - 2
packages/fcl-db/src/base/db.pas

@@ -1231,8 +1231,8 @@ type
     Function  ParamByName(const Value: string): TParam;
     Function  ParamByName(const Value: string): TParam;
     Function  ParseSQL(SQL: String; DoCreate: Boolean): String; overload;
     Function  ParseSQL(SQL: String; DoCreate: Boolean): String; overload;
     Function  ParseSQL(SQL: String; DoCreate, EscapeSlash, EscapeRepeat : Boolean; ParameterStyle : TParamStyle): String; overload;
     Function  ParseSQL(SQL: String; DoCreate, EscapeSlash, EscapeRepeat : Boolean; ParameterStyle : TParamStyle): String; overload;
-    Function  ParseSQL(SQL: String; DoCreate, EscapeSlash, EscapeRepeat : Boolean; ParameterStyle : TParamStyle; var ParamBinding: TParambinding): String; overload;
-    Function  ParseSQL(SQL: String; DoCreate, EscapeSlash, EscapeRepeat : Boolean; ParameterStyle : TParamStyle; var ParamBinding: TParambinding; var ReplaceString : string): String; overload;
+    Function  ParseSQL(SQL: String; DoCreate, EscapeSlash, EscapeRepeat : Boolean; ParameterStyle : TParamStyle; out ParamBinding: TParambinding): String; overload;
+    Function  ParseSQL(SQL: String; DoCreate, EscapeSlash, EscapeRepeat : Boolean; ParameterStyle : TParamStyle; out ParamBinding: TParambinding; out ReplaceString : string): String; overload;
     Procedure RemoveParam(Value: TParam);
     Procedure RemoveParam(Value: TParam);
     Procedure CopyParamValuesFromDataset(ADataset : TDataset; CopyBound : Boolean);
     Procedure CopyParamValuesFromDataset(ADataset : TDataset; CopyBound : Boolean);
     Property Dataset : TDataset Read GetDataset;
     Property Dataset : TDataset Read GetDataset;

+ 3 - 3
packages/fcl-db/src/base/dsparams.inc

@@ -181,7 +181,7 @@ begin
   Result := ParseSQL(SQL,DoCreate,EscapeSlash,EscapeRepeat,ParameterStyle,pb, rs);
   Result := ParseSQL(SQL,DoCreate,EscapeSlash,EscapeRepeat,ParameterStyle,pb, rs);
 end;
 end;
 
 
-Function TParams.ParseSQL(SQL: String; DoCreate, EscapeSlash, EscapeRepeat : Boolean; ParameterStyle : TParamStyle; var ParamBinding: TParambinding): String;
+Function TParams.ParseSQL(SQL: String; DoCreate, EscapeSlash, EscapeRepeat : Boolean; ParameterStyle : TParamStyle; out ParamBinding: TParambinding): String;
 
 
 var rs : string;
 var rs : string;
 
 
@@ -236,7 +236,7 @@ begin
   end; {case}
   end; {case}
 end;
 end;
 
 
-Function TParams.ParseSQL(SQL: String; DoCreate, EscapeSlash, EscapeRepeat: Boolean; ParameterStyle : TParamStyle; var ParamBinding: TParambinding; var ReplaceString : string): String;
+Function TParams.ParseSQL(SQL: String; DoCreate, EscapeSlash, EscapeRepeat: Boolean; ParameterStyle : TParamStyle; out ParamBinding: TParambinding; out ReplaceString : string): String;
 
 
 type
 type
   // used for ParamPart
   // used for ParamPart
@@ -268,7 +268,7 @@ begin
   ParamCount:=0;
   ParamCount:=0;
   NewQueryLength:=Length(SQL);
   NewQueryLength:=Length(SQL);
   SetLength(ParamPart,ParamAllocStepSize);
   SetLength(ParamPart,ParamAllocStepSize);
-  SetLength(Parambinding,ParamAllocStepSize);
+  SetLength(ParamBinding,ParamAllocStepSize);
   QuestionMarkParamCount:=0; // number of ? params found in query so far
   QuestionMarkParamCount:=0; // number of ? params found in query so far
 
 
   ReplaceString := '$';
   ReplaceString := '$';