Browse Source

rtl: less hints

mattias 3 weeks ago
parent
commit
5a4f33946e
3 changed files with 13 additions and 10 deletions
  1. 7 2
      packages/rtl/src/classes.pas
  2. 5 8
      packages/rtl/src/js.pas
  3. 1 0
      packages/rtl/src/sysutils.pas

+ 7 - 2
packages/rtl/src/classes.pas

@@ -907,12 +907,12 @@ type
   TResourceStream = class(TCustomMemoryStream)
   TResourceStream = class(TCustomMemoryStream)
   private
   private
     procedure Initialize(aInfo : TResourceInfo);
     procedure Initialize(aInfo : TResourceInfo);
-    procedure Initialize(Instance{%H-}: TFPResourceHMODULE; Name, ResType{%H-}: String);
+    procedure Initialize(Instance: TFPResourceHMODULE; Name, ResType: String);
   public
   public
     constructor Create(aInfo: TResourceInfo);
     constructor Create(aInfo: TResourceInfo);
     constructor Create(Instance: TFPResourceHMODULE; const ResName, ResType : String);
     constructor Create(Instance: TFPResourceHMODULE; const ResName, ResType : String);
     constructor CreateFromID(Instance: TFPResourceHMODULE; ResID: Integer; ResType: String);
     constructor CreateFromID(Instance: TFPResourceHMODULE; ResID: Integer; ResType: String);
-    function Write(const Buffer{%H-}: TBytes; Offset{%H-}, Count{%H-}: LongInt): LongInt; override;
+    function Write(const Buffer: TBytes; Offset, Count: LongInt): LongInt; override;
     destructor Destroy; override;
     destructor Destroy; override;
   end;
   end;
 
 
@@ -1720,6 +1720,8 @@ begin
   if not GetResourceInfo(Name, aInfo) then
   if not GetResourceInfo(Name, aInfo) then
     raise EResNotFound.CreateFmt(SResNotFound,[Name]);
     raise EResNotFound.CreateFmt(SResNotFound,[Name]);
   Initialize(aInfo);
   Initialize(aInfo);
+  if Instance=0 then ;
+  if ResType='' then ;
 end;
 end;
 
 
 constructor TResourceStream.Create(aInfo: TResourceInfo);
 constructor TResourceStream.Create(aInfo: TResourceInfo);
@@ -1745,6 +1747,9 @@ function TResourceStream.Write(const Buffer: TBytes; Offset, Count: LongInt
   ): LongInt;
   ): LongInt;
 begin
 begin
   Raise ENotSupportedException.Create(SErrResourceStreamNoWrite);
   Raise ENotSupportedException.Create(SErrResourceStreamNoWrite);
+  if Buffer=nil then ;
+  if Offset=0 then ;
+  if Count=0 then ;
   Result:=0;
   Result:=0;
 end;
 end;
 
 

+ 5 - 8
packages/rtl/src/js.pas

@@ -967,9 +967,6 @@ type
     function finally_(value : TFinallyHandler): TJSPromise; external name 'finally';
     function finally_(value : TFinallyHandler): TJSPromise; external name 'finally';
   end;
   end;
 
 
-
-
-
   TJSFunctionArguments = class external name 'arguments'
   TJSFunctionArguments = class external name 'arguments'
   private
   private
     FLength: NativeInt; external name 'length';
     FLength: NativeInt; external name 'length';
@@ -1037,7 +1034,7 @@ type
   end;
   end;
 
 
   generic TGGenerator<T> = class external name 'Generator' (TJSObject)
   generic TGGenerator<T> = class external name 'Generator' (TJSObject)
-  private type
+  public type
     TGGeneratorValue = class external name 'Generator' (TJSObject)
     TGGeneratorValue = class external name 'Generator' (TJSObject)
     public
     public
       done: Boolean;
       done: Boolean;
@@ -1061,9 +1058,9 @@ type
   TJSNumber = class external name 'Number' (TJSFunction)
   TJSNumber = class external name 'Number' (TJSFunction)
   private
   private
     class var FEPSILON: Double; external name 'EPSILON';
     class var FEPSILON: Double; external name 'EPSILON';
-    class var {%H-}FMAX_SAFE_INTEGER: Int64; external name 'MAX_SAFE_INTEGER';
+    class var {%H-}FMAX_SAFE_INTEGER: NativeInt; external name 'MAX_SAFE_INTEGER';
     class var FMAX_VALUE: Double; external name 'MAX_VALUE';
     class var FMAX_VALUE: Double; external name 'MAX_VALUE';
-    class var {%H-}FMIN_SAFE_INTEGER: Int64; external name 'MIN_SAFE_INTEGER';
+    class var {%H-}FMIN_SAFE_INTEGER: NativeInt; external name 'MIN_SAFE_INTEGER';
     class var FMIN_VALUE: Double; external name 'MIN_VALUE';
     class var FMIN_VALUE: Double; external name 'MIN_VALUE';
     class var FNaN: Double; external name 'NaN';
     class var FNaN: Double; external name 'NaN';
     class var FNEGATIVE_INFINITY: TJSNumber; external name 'NEGATIVE_INFINITY';
     class var FNEGATIVE_INFINITY: TJSNumber; external name 'NEGATIVE_INFINITY';
@@ -1099,9 +1096,9 @@ type
     function valueOf: Double; reintroduce;
     function valueOf: Double; reintroduce;
 
 
     class property EPSILON: Double read FEPSILON;
     class property EPSILON: Double read FEPSILON;
-    class property MAX_SAFE_INTEGER{%H-}: Int64 read FMAX_SAFE_INTEGER;
+    class property MAX_SAFE_INTEGER{%H-}: NativeInt read FMAX_SAFE_INTEGER;
     class property MAX_VALUE: Double read FMAX_VALUE;
     class property MAX_VALUE: Double read FMAX_VALUE;
-    class property MIN_SAFE_INTEGER{%H-}: Int64 read FMIN_SAFE_INTEGER;
+    class property MIN_SAFE_INTEGER{%H-}: NativeInt read FMIN_SAFE_INTEGER;
     class property MIN_VALUE: Double read FMIN_VALUE;
     class property MIN_VALUE: Double read FMIN_VALUE;
     class property NaN: Double read FNaN;
     class property NaN: Double read FNaN;
     class property NEGATIVE_INFINITY: TJSNumber read FNEGATIVE_INFINITY;
     class property NEGATIVE_INFINITY: TJSNumber read FNEGATIVE_INFINITY;

+ 1 - 0
packages/rtl/src/sysutils.pas

@@ -94,6 +94,7 @@ type
     TimeAMString: string;
     TimeAMString: string;
     TimePMString: string;
     TimePMString: string;
     TimeSeparator: Char;
     TimeSeparator: Char;
+    ListSeparator: Char;
     TwoDigitYearCenturyWindow: Word;
     TwoDigitYearCenturyWindow: Word;
   public
   public
     Type
     Type