- Timestamp:
- Nov 19, 2012, 2:31:00 PM (12 years ago)
- Location:
- Common
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/UCommon.pas
r404 r434 48 48 function LoggedOnUserNameEx(Format: TUserNameFormat): string; 49 49 function SplitString(var Text: string; Count: Word): string; 50 function GetBitCount(Variable: QWord; MaxIndex: Integer): Integer; 50 51 function GetBit(Variable: QWord; Index: Byte): Boolean; 52 procedure SetBit(var Variable: Int64; Index: Byte; State: Boolean); overload; 51 53 procedure SetBit(var Variable: QWord; Index: Byte; State: Boolean); overload; 52 54 procedure SetBit(var Variable: Cardinal; Index: Byte; State: Boolean); overload; … … 336 338 end; 337 339 340 function GetBitCount(Variable: QWord; MaxIndex: Integer): Integer; 341 var 342 I: Integer; 343 begin 344 Result := 0; 345 for I := 0 to MaxIndex - 1 do 346 if ((Variable shr I) and 1) = 1 then Inc(Result); 347 end; 348 338 349 function GetBit(Variable:QWord;Index:Byte):Boolean; 339 350 begin … … 341 352 end; 342 353 354 procedure SetBit(var Variable: Int64; Index: Byte; State: Boolean); 355 begin 356 Variable := (Variable and ((1 shl Index) xor High(QWord))) or (Int64(State) shl Index); 357 end; 358 343 359 procedure SetBit(var Variable:QWord;Index:Byte;State:Boolean); overload; 344 360 begin 345 Variable := (Variable and ((1 shl Index) xor QWord($ffffffffffffffff))) or (QWord(State) shl Index);361 Variable := (Variable and ((1 shl Index) xor High(QWord))) or (QWord(State) shl Index); 346 362 end; 347 363 348 364 procedure SetBit(var Variable:Cardinal;Index:Byte;State:Boolean); overload; 349 365 begin 350 Variable := (Variable and ((1 shl Index) xor Cardinal($ffffffff))) or (Cardinal(State) shl Index);366 Variable := (Variable and ((1 shl Index) xor High(Cardinal))) or (Cardinal(State) shl Index); 351 367 end; 352 368 353 369 procedure SetBit(var Variable:Word;Index:Byte;State:Boolean); overload; 354 370 begin 355 Variable := (Variable and ((1 shl Index) xor Word($ffff))) or (Word(State) shl Index);371 Variable := (Variable and ((1 shl Index) xor High(Word))) or (Word(State) shl Index); 356 372 end; 357 373 -
Common/URegistry.pas
r432 r434 26 26 TRegistryEx = class(TRegistry) 27 27 private 28 function GetC ontext: TRegistryContext;29 procedure SetC ontext(AValue: TRegistryContext);28 function GetCurrentContext: TRegistryContext; 29 procedure SetCurrentContext(AValue: TRegistryContext); 30 30 public 31 31 function ReadBoolWithDefault(const Name: string; … … 37 37 function DeleteKeyRecursive(const Key: string): Boolean; 38 38 function OpenKey(const Key: string; CanCreate: Boolean): Boolean; 39 property C ontext: TRegistryContext read GetContext write SetContext;39 property CurrentContext: TRegistryContext read GetCurrentContext write SetCurrentContext; 40 40 end; 41 41 … … 109 109 end; 110 110 111 function TRegistryEx.GetC ontext: TRegistryContext;111 function TRegistryEx.GetCurrentContext: TRegistryContext; 112 112 begin 113 113 Result.Key := CurrentPath; … … 115 115 end; 116 116 117 procedure TRegistryEx.SetC ontext(AValue: TRegistryContext);117 procedure TRegistryEx.SetCurrentContext(AValue: TRegistryContext); 118 118 begin 119 119 RootKey := AValue.RootKey; -
Common/USyncCounter.pas
r432 r434 23 23 constructor Create; 24 24 destructor Destroy; override; 25 procedure Assign(Source: TSyncCounter); 25 26 end; 26 27 … … 71 72 end; 72 73 74 procedure TSyncCounter.Assign(Source: TSyncCounter); 75 begin 76 Current := Source.Current; 77 Top := Source.Top; 78 end; 79 73 80 end. 74 81 -
Common/UURI.pas
r230 r434 326 326 Drive := Drive + DriveSeparator; 327 327 end else Drive := ''; 328 Directory.AsString := AValue; 328 if (Drive <> '') and (AValue = '') then 329 Directory.AsString := Directory.DirSeparator 330 else Directory.AsString := AValue; 329 331 end; 330 332
Note:
See TracChangeset
for help on using the changeset viewer.