[fpc-devel] Building of FPC trunk broken on Darwin

2014-11-23 Thread Joao Morais


Hello list!

Trunk is broken on Darwin i386 since rev 29085 with the following message:

=
/Applications/Xcode.app/Contents/Developer/usr/bin/make echotime
Start now 13:25:24
/usr/bin/diff ppc3 ppc386
Binary files ppc3 and ppc386 differ
make[2]: *** [cycle] Error 2
make[1]: *** [compiler_cycle] Error 2
make: *** [build-stamp.i386-darwin] Error 2
=

Using both 2.6.2 or 2.6.4 as the starting compiler. Rev 29084 is nice.

Joao Morais

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Customize TRequest and TResponse

2012-05-16 Thread Joao Morais
On Fri, Mar 2, 2012 at 8:37 PM, Michael Van Canneyt
mich...@freepascal.org wrote:
 On Fri, 2 Mar 2012, Joao Morais wrote:
 Hello Michael, plans to implement the patch? Perhaps you prefer
 against trunk, including all webhandlers, registering a mantis, ...

 My apologies, I totally forgot about it :/

 Btw we have another patches that make fcl-web easier to extend and
 we'd like to see them implemented (asap =) ), how would we send them
 to you?

 Please, register them in mantis, and try to make patches against trunk.

Hello Michael, registered as mantis #21980 a while ago. Is this kind
of patch a candidate to be merged to 2.6? Before 2.6.2?

Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Customize TRequest and TResponse

2012-03-02 Thread Joao Morais
On Sun, Feb 5, 2012 at 17:41, Joao Morais jcmorai...@gmail.com wrote:
 On Sun, Feb 5, 2012 at 18:11, Michael Van Canneyt
 mich...@freepascal.org wrote:

 for instance in src/base/custfcgi.pp I would add

    function CreateRequest: TFCGIRequest; virtual;
    function CreateResponse(ARequest: TFCGIRequest): TFCGIResponse; virtual;

 And similar functions in the other webhandler components.
 ...
 I started on this procedure already.

 I just need to complete the work.

 If you want, you can of course provide a patch that completes the work.

 Nice, attached for fcgi against rev 20265, 2.6 branch, packages/fcl-web/ dir.

Hello Michael, plans to implement the patch? Perhaps you prefer
against trunk, including all webhandlers, registering a mantis, ...

Btw we have another patches that make fcl-web easier to extend and
we'd like to see them implemented (asap =) ), how would we send them
to you?

Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Customize TRequest and TResponse

2012-02-05 Thread Joao Morais
Hello fpc-devel list.

I need to implement some customizations to the request and response
classes of the fastcgi implementation -- maybe others as well -- but
afaics I cannot override such classes without copy/paste the whole
FCGI.ProcessRecord method.

A draft of the implementation I'd like to see in the fcl-web is
described below. Is it possible to implement? Perhaps 2.6 branch?

Joao Morais



1. New virtual methods used to create requests and responses:

--- src/base/custweb.pp (revision 20261)
+++ src/base/custweb.pp (workcopy)
@@ -108,6 +108,8 @@
 Procedure SetBaseURL(AModule : TCustomHTTPModule; Const
AModuleName : String; ARequest : TRequest); virtual;
 function GetApplicationURL(ARequest : TRequest): String; virtual;
 procedure ShowRequestException(R: TResponse; E: Exception); virtual;
+function CreateRequest: TRequest; virtual; abstract;
+function CreateResponse(ARequest: TRequest): TResponse; virtual; abstract;
 Procedure InitRequest(ARequest : TRequest); virtual;
 Procedure InitResponse(AResponse : TResponse); virtual;
 Function GetEmail : String; virtual;

2. Patch every fcl-web implementation in order to use the virtual
method instead of a hardcoded class:

--- src/base/custfcgi.pp(revision 20261)
+++ src/base/custfcgi.pp(workcopy)
@@ -119,6 +119,8 @@
 function Read_FCGIRecord : PFCGI_Header;
 function DataAvailable : Boolean;
   protected
+function CreateRequest: TRequest; override;
+function CreateResponse(ARequest: TRequest): TResponse; override;
 Function DoFastCGIRead(AHandle : THandle; Var ABuf; ACount :
Integer) : Integer; virtual;
 Function DoFastCGIWrite(AHandle : THandle; Const ABuf; ACount :
Integer) : Integer; virtual;
 function  ProcessRecord(AFCGI_Record: PFCGI_Header; out ARequest:
TRequest;  out AResponse: TResponse): boolean; virtual;
@@ -793,6 +795,16 @@
 end;
 {$endif}

+function TFCgiHandler.CreateRequest: TRequest;
+begin
+  Result := TFCGIRequest.Create;
+end;
+
+function TFCgiHandler.CreateResponse(ARequest: TRequest): TResponse;
+begin
+  Result := TFCGIResponse.Create(ARequest);
+end;
+
 function TFCgiHandler.DoFastCGIRead(AHandle: THandle; var ABuf;
ACount: Integer): Integer;
 begin
 {$ifdef windowspipe}
@@ -831,7 +843,7 @@
   end;
 assert(not assigned(FRequestsArray[ARequestID].Request));
 assert(not assigned(FRequestsArray[ARequestID].Response));
-ATempRequest:=TFCGIRequest.Create;
+ATempRequest:=CreateRequest as TFCGIRequest;
 InitRequest(ATempRequest);
 ATempRequest.RequestID:=ARequestID;
 ATempRequest.Handle:=FHandle;
@@ -848,7 +860,7 @@
   else if FRequestsArray[ARequestID].Request.ProcessFCGIRecord(AFCGI_Record)
then
 begin
 ARequest:=FRequestsArray[ARequestID].Request;
-FRequestsArray[ARequestID].Response := TFCGIResponse.Create(ARequest);
+FRequestsArray[ARequestID].Response := CreateResponse(ARequest)
as TFCGIResponse;
 InitResponse(FRequestsArray[ARequestID].Response);
 FRequestsArray[ARequestID].Response.ProtocolOptions:=Self.ProtocolOptions;
 FRequestsArray[ARequestID].Response.FOnWrite:=@DoFastCGIWrite;
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] circular uses clauses

2008-10-02 Thread Joao Morais

Graeme Geldenhuys wrote:

Hi.

Quote from CodeGear news
circular uses clauses - why can't I declare two classes in two units
that refer to each other? Why doesn't forward declarations cope with
this? I've got this feature in C, C++ and C# why not Delphi?


Because a Pascal compiler parses the interface section of an unit only 
once, ...



That's a good question... Why can't FPC allow that either?  I don't
know the internals of FPC, but can't FPC simply keep a list of used
units as it compiles, so it simply skips any later references. What is
the technical issue?  I'm just curious here.


... and the interface section of an unit need to be parsed before used 
by another one?



Regards,
  - Graeme -


--
Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Unicodestring branch, please test and help fixing

2008-09-09 Thread Joao Morais

Anton Kavalenka wrote:
I only have a dream - controllable way of string assignment without any 
magic like implicit call of _LStrAddRefCnt


Do you have a real-world sample of usage, ie, where or when the object 
pascal way is a problem?


Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Re: Multi threading support

2008-07-31 Thread Joao Morais

Mattias Gaertner wrote:

On Thu, 31 Jul 2008 16:22:01 +0200
Graeme Geldenhuys [EMAIL PROTECTED] wrote:


On Thu, Jul 31, 2008 at 2:59 PM, Boian Mitov [EMAIL PROTECTED] wrote:

  Hmm... it looks almost one to one copy from our code in Version
4.0 of our libraries ;-) . Are you one of our customers, or you
have simply come with the same idea as us?


I'm not Henri, but we did similar setting and auto-restoring mouse
cursors in our Delphi applications.  I can't imagine why I never
thought of using the same idea for critical sections. :-)


I think, this sounds like a misuse of interfaces.


I'd say 'another use for refcounted interfaces'.

Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] protected members access across classes in the same package, but what about inherited cross package

2008-07-20 Thread Joao Morais

Martin Friebe wrote:

[file foo.pp]
type
  TThat = class(TObject)
   protected
 ThatValue : integer
  end;

  TThis = class(TObject)

  end;
implementation ...
[/end of file foo.pp]

[file bar.pp]
type
 TThatFake class(TThat)
 end; // intntionally empty class

 TSomething = class(...)

[/end of file bar.pp]]

- If TThatFake had any code, then any code belonging to TThatFake would 
be allowed to see it's anchestor protected members, that would be correct.


Yes. Inheritance.

- If TThatFake had any protected mebers implemented in bar.pp they 
should be visble to other code in bar.pp


Yes. Friend classes.

- But what about inherited members? Should TSomething be able to access 
ThatValue?


Yes, if the object pointer is declared as TThatFake or you cast the 
pointer to TThatFake. Otherwise no, only public members of TThat would 
be visible.


Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] C style operator doesn't work with properties in 2.3.1

2008-07-17 Thread Joao Morais

Graeme Geldenhuys wrote:

So is what you mentioned above by design, or an oversight?  In normal
code like x := x+y  you are allowed to use properties or variables.
So surely the += operator which translates to x := x+y should also
be allowed to use properties.


Except that, when using variables, the first and the second x are the 
same entity.


I think what you need is a new feature. If the statement before the += 
token is a property, instead of a variable, the compiler converts it 
into one getter and one setter, and after that use them to perform the 
calculation.


--
Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] C style operator doesn't work with properties in 2.3.1

2008-07-16 Thread Joao Morais

Graeme Geldenhuys wrote:

On Wed, Jul 16, 2008 at 4:29 PM, Marco van de Voort [EMAIL PROTECTED] wrote:

After our discussion about not being able to use Include() with a
class property, I thought I would then use the C Style += operator.
After all that boils down to:  i += 2;   i := i + 2;

Suspect that it gets translated to inc(i,2); not i:=i+2; and then it makes
sense again, for the same reasons as before.


Boy of boy FPC 2.3.1 is becoming frustrating!!

So is there a performance difference between:
   inc(i,2)vsi := i + 2;

If not, then can the += operator rather use the latter?  After all,
just about every peace of documentation on += operator I could find,
they mention that it's an shorthand form of x := x + y


Just if you want to know my humble opinion: your statement isn't fair. 
You know a property isn't a variable, so don't assume it will behave 
like that. If you want a property function as a variable, eg reading and 
writing a class member directly, do use a public variable instead. Fpc 
core is doing a really nice job, improving and extending the compiler in 
their spare time, helping all developers writing better source code. 
This one is a good sample. They don't deserve such comment.


--
Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] StrToDateTime issue

2008-06-04 Thread Joao Morais

Joao Morais wrote:

Michael Van Canneyt wrote:


A patch is welcome.


Here it is.

This patch fixes a misbehaviour when space is left in front of the date 
or time, as well as call StrToTime if only a time is provided.


Remember.

Joao Morais
Index: rtl/objpas/sysutils/dati.inc
===
--- rtl/objpas/sysutils/dati.inc(revision 11126)
+++ rtl/objpas/sysutils/dati.inc(working copy)
@@ -516,15 +516,37 @@
 end ;
 
 {   StrToDateTime converts the string S to a TDateTime value
-if S does not represent a valid date and time value
+if S does not represent a valid date and/or time value
 an EConvertError will be raised   }
 
 function StrToDateTime(const s: string): TDateTime;
-var i: integer;
+var
+  i, j, k, l: integer;
+  sd, st: string;
 begin
-i := pos(' ', s);
-if i  0 then result := ComposeDateTime(StrToDate(Copy(S, 1, i - 1)), 
StrToTime(Copy(S, i + 1, length(S
-else result := StrToDate(S);
+  l := Length(s);
+  i := 1;
+  while (i = l) and (s[i] = ' ') do
+Inc(i);
+  j := i;
+  while (j = l) and (s[j]  ' ') do
+Inc(j);
+  k := j;
+  while (k = l) and (s[k] = ' ') do
+Inc(k);
+  sd := Copy(s, i, j - i);
+  st := Copy(s, k, l);
+  if (st = '') and (Pos(TimeSeparator, sd)  0) then
+  begin
+st := sd;
+sd := '';
+  end;
+  if (sd  '') and (st  '') then
+Result := ComposeDateTime(StrToDate(sd), StrToTime(st))
+  else if st = '' then
+Result := StrToDate(sd)
+  else
+Result := StrToTime(st);
 end ;
 
 {   FormatDateTime formats DateTime to the given format string FormatStr   }
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] StrToDateTime issue

2008-05-29 Thread Joao Morais


Hello,

Performing some tests with date and time routines I discovered that 
StrToDateTime doesn't work if I only use time. This was designed that 
way or a patch is welcome?


Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] StrToDateTime issue

2008-05-29 Thread Joao Morais

Michael Van Canneyt wrote:


On Thu, 29 May 2008, Joao Morais wrote:


Hello,

Performing some tests with date and time routines I discovered that
StrToDateTime doesn't work if I only use time. This was designed that way or a
patch is welcome?


A patch is welcome.


Here it is.

This patch fixes a misbehaviour when space is left in front of the date 
or time, as well as call StrToTime if only a time is provided.


Joao Morais

Index: rtl/objpas/sysutils/dati.inc
===
--- rtl/objpas/sysutils/dati.inc(revision 11126)
+++ rtl/objpas/sysutils/dati.inc(working copy)
@@ -516,15 +516,37 @@
 end ;
 
 {   StrToDateTime converts the string S to a TDateTime value
-if S does not represent a valid date and time value
+if S does not represent a valid date and/or time value
 an EConvertError will be raised   }
 
 function StrToDateTime(const s: string): TDateTime;
-var i: integer;
+var
+  i, j, k, l: integer;
+  sd, st: string;
 begin
-i := pos(' ', s);
-if i  0 then result := ComposeDateTime(StrToDate(Copy(S, 1, i - 1)), 
StrToTime(Copy(S, i + 1, length(S
-else result := StrToDate(S);
+  l := Length(s);
+  i := 1;
+  while (i = l) and (s[i] = ' ') do
+Inc(i);
+  j := i;
+  while (j = l) and (s[j]  ' ') do
+Inc(j);
+  k := j;
+  while (k = l) and (s[k] = ' ') do
+Inc(k);
+  sd := Copy(s, i, j - i);
+  st := Copy(s, k, l);
+  if (st = '') and (Pos(TimeSeparator, sd)  0) then
+  begin
+st := sd;
+sd := '';
+  end;
+  if (sd  '') and (st  '') then
+Result := ComposeDateTime(StrToDate(sd), StrToTime(st))
+  else if st = '' then
+Result := StrToDate(sd)
+  else
+Result := StrToTime(st);
 end ;
 
 {   FormatDateTime formats DateTime to the given format string FormatStr   }
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Build FPC 2.3.1 from SVN sources

2008-01-17 Thread Joao Morais

Vincent Snijders wrote:

Fabio Dell'Aria schreef:


Where I can find the make program (command) on Windows?

On the FPC\bin I found only fpcmake.exe



IMO, the best way to get it, is to install the latest FPC release (which 
you have anyway for the starting compiler as explained in the buildfaq) 
and get it from the compiler directory (the directory with ppc386.exe).


You can also checkout 
http://svn.freepascal.org/svn/fpcbuild/trunk/install/binw32


--
Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] {$Interfaces Corba} and TInterfacedObject

2007-11-29 Thread Joao Morais

Graeme Geldenhuys wrote:

So what do I use to create interfaces and classes that implement interfaces?
Which declaration style do I use?  Or doesn't it make a difference?

type
  ICommand = interface(IInterface)
  vs
  ICommand = interface(IUnkown)


They are exactly the same ? (D=5 and D=6 compatibility)


  ICommand = interface


Under $interfaces com, interface = interface(iunknown)


Now for created classes that implement those interfaces. What base
object do I use?

type
  TCommandClass = class(TInterfacedObject, ICommand)
  vs
  TCommandClass = class(TSomeCustomNonReferenceCountedClass, ICommand)


I am using my own classes that implement _addref, _release and QueryIntf 
and am very happy with them. I do use refcounting where I want 
(everywhere btw) and don't destroy the instance where I don't want.


You will want to use TInterfacedObject class if you:

1. Want refcounting;
2. Don't want to destroy the instance if the refcount  0 (the object 
will raise an exception);

3. Don't need to descend from another class.
4. Will take care with circular references.

Otherwise you will need to create your own class and:

1. implement _addref, _release and QueryIntf if using com interfaces;
2. do nothing if using corba interfaces (I have no idea how an interface 
is queried here).



I can't imagine that usig Corba style interfaces that I'm allowed to
use TInterfacedObject as a based class, because TInterfacedObject
implements reference counting.  Is there some other base class I'm
supposed to use with Corba style interfaces?


Any class. Afaik corba interfaces doesn't implement a method ?


Does FPC have a Non-Reference counted base class already?  It's quite
simple to implement you own, but is stupid if FPC doesn't already have
one.


Err... a class doesn't have refcount, just start with TObject or a 
descendant.



Also, do I have to specify {$Interfaces Corba} in every unit I have,
or is it only needed in the using that defines the interface itself?


You need. See eg MSE units.


Basically, is that compiler setting unit based or project (global)
based.  Why I ask, is because {$mode xxx} is unit based, not global
across my whole project.  So can I mix Reference counted and
Non-Reference counted interface styles in the same project?


Any compiler directive is unit based. The unit where you declared the 
interface is what will count here.



I found find any help referencing these issues The help topics on
interfaces and $Interfaces styles are very vague.


Not vague, they was straight to the point imo.

--
Joao Morais

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] RTTI's GetPropValue returns corrupt Boolean value

2007-11-20 Thread Joao Morais

Graeme Geldenhuys wrote:

On 20/11/2007, Graeme Geldenhuys [EMAIL PROTECTED] wrote:

I've extended the PropertyMatch() function to test for tkBool types
(no variants) and do a writeln when it finds it. That parts seems to
work fine.


Here is the debug code I added to PropertyMatch() which successfully
compare the results, but I have to explicitly cast GetOrdProp to a
Boolean.  Is that normal???

PropInfo := GetPropInfo(AObject.ClassType, PropName);
if tiGetTypeInfo(PropInfo)^.Kind = tkBool then
begin
  writeln('Found rtti bool type');
  lbool := Boolean(GetOrdProp(AObject, PropName));
  if lSearch = lbool then
writeln('Comparison was a success');
end;


Sounds familiar. Here I have:

  if UsePublishedGetter then
Result := Boolean(GetOrdProp(Owner, Metadata.Name))
  else
Result := Value;

--
Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] How to force the child's constructor to call its parent constructor

2007-10-21 Thread Joao Morais

amir wrote:
I want to force the all childs of TParent to call the Create constructor 
(with appropriate parameter). But one can implement a child class like 
this:

 constructor TChild.Create;
 begin
// do any thing but not use inherited.
 end;


No way. But you can override the NewInstance method; constructors will 
call it for sure. You can also override the AfterConstruction method.


--
Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] property syntax extension

2007-10-18 Thread Joao Morais

Marco van de Voort wrote:
These idiots had to do it totally against the Pascal Language specs. 

This is not Pascal language anymore. This is Delphi language.


Delphi or Delphi.NET? Does native Delphi do more with it than ignore it?


Delphi.net in this case.


(like the dotted unit names introduced in D7)


Yup. D7 introduced the Delphi Language and killed Object Pascal, perhaps 
because of the .net stuff.


--
Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Unreachable code warnings

2007-10-14 Thread Joao Morais

Micha Nelissen wrote:

Joao Morais wrote:

The compiler warns that the result wasn't assigned, but that function's
result simply cannot be reached.


Why not make it a procedure ?


Because it is an abstract method.

--
Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Unreachable code warnings

2007-10-14 Thread Joao Morais

Florian Klaempfl wrote:

Joao Morais schrieb:

The compiler warns that the result wasn't assigned, but that function's
result simply cannot be reached.


Fixed in trunk when compiled with -Oodfa which will be probably a
default in 2.4.0.


Thanks. Now a note:

{$mode objfpc}
var
  vobj: tclass;
  vmethod: function: string of object;
begin
  vobj := tobject;
  vmethod := @vobj.classname;
  writeln(vmethod);
end.

Remove the comment and the note is also removed.

--
Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Unreachable code warnings

2007-10-14 Thread Joao Morais

Joao Morais wrote:

Remove the comment and the note is also removed.


sed 's/^Remove.*//'

--
Joao Morais

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] GetConnectionDef in the interface section

2007-07-16 Thread Joao Morais

Michael Van Canneyt wrote:


On Sun, 15 Jul 2007, Joao Morais wrote:


Hello,

It's possible include the following declaration:

function GetConnectionDef(ConnectorName: string): TConnectionDef;

in the interface section of the sqldb unit and merge to 2.2?


Moving it to interface is not a problem.


Nice, thanks. Can you upload the change?


Merge to 2.2 is another matter.


This means no or this means perhaps?

If this means no, give me how can I instantiate a SQLConnection from a 
string, or sqldb isn't flexible enough?


Anyway I see your point.

Thanks.

--
Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] GetConnectionDef in the interface section

2007-07-15 Thread Joao Morais


Hello,

It's possible include the following declaration:

function GetConnectionDef(ConnectorName: string): TConnectionDef;

in the interface section of the sqldb unit and merge to 2.2?

Thanks.

--
Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FormatFloat bug

2007-05-29 Thread Joao Morais

Graeme Geldenhuys wrote:


Hi,

Attached is a application that demonstrates a bug in FormatFloat.  All
tests pass when run under Delphi, but test four fails under Free
Pascal.


IMHO, fpc behaves correctly. 0.005 is closer than 0 instead 0.01. If you 
try 0.0050001, you will have 0.01, also correct.


--
Joao Morais




Here is the application output:

---
$ ./project1
Time:00.001 N:7 E:0 F:1 I:0
 TTestFormatFloat Time:00.001 N:7 E:0 F:1 I:0
   00.000  Test1
   00.000  Test2
   00.000  Test3
   00.000  Test4  Failed: Failed on 4 expected: $ 0.01 but was: $ 0.00
   00.000  Test5
   00.000  Test6
   00.000  Test7

Number of run tests: 7
Number of errors:0
Number of failures:  1

List of failures:
 Failure:
   Message:   TTestFormatFloat.Test4: Failed on 4 expected:
$ 0.01 but was: $ 0.00
   Exception class:   EAssertionFailedError
   Exception message: Failed on 4 expected: $ 0.01 but was: $ 0.00

---




___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Efficient way to inc loop over hexadecimal values

2006-11-22 Thread Joao Morais

ik wrote:

On 11/22/06, Dominique Leducq [EMAIL PROTECTED] wrote:

ik a écrit :
 Hi List,

 I have two cardinal numbers that represent ranges.

 The 10 base value of that two variables are useless and far from
 having any meaning for my needs.However the hexa number does have
 meaning after I'm changing the network order (aka big endian).

 I can think on many non efficient ways to while loop with inc but not
 even one way to inc it in an efficient way.

 So, I'm looking for an efficient way to loop from left range to right
 range when the values are in Hexa-decimal.

 Thank you for any help on this matter,

 Ido

I'm afraid I don't understand your problem. Decimal or hexadecimal are
string representation formats, cardinal and integer values are stored
and dealt with internally in binary form !
If your values are hexadecimal number stored in strings, why not convert
them first to Cardinal ?

Could you perhaps give an example or be more precise ?


OK, I have (for this example, taken from my own testing) the following 
numbers:

Decima numbers: a = 3616538624 b = 3616669696
The hexa values are: a = D790 b = D792

As you can see the range differences between the decimals are way
bigger then the hexa values.

The thing is that the hexa numbers represent chars of a UTF-8
encoding. D790 is the char א.
(http://www.utf8-chartable.de/unicode-utf8-table.pl look for Hebrew).

So I wish to run on the range between a..b (in Hexa) and to have all
of the values in between.

There are many bad ways to do it such as:

while (not hexStr (i) = b) do
begin
 ...
 inc (i)
 
end;

This exampel does not cover all the possible values I might need.

So, I'm looking for a much faster and smarter way to do it, rather the
bad way above.


Something like this?

for I := $D790 to $D792 do
  YourValue := I * $1;

Otherwise, if I didn't get what you mean, perhaps you can use some 
boolean arithmetic.


--
Joao Morais

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] $Y raises internal error

2006-04-23 Thread Joao Morais


Hello,

I have a D5 project that uses a {$Y+}. Whenever I include this unit (say 
WithY.pas) into the uses clause of another unit (say Test.pas) *and* my 
WithY.ppu is updated, fpc raises a:

Fatal: Internal Error 200310221
trying to:
Add Dependency of 'WithY' to 'AnFPCUnit'.

2.0.2 and currenct svn.

HTH

--
Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] FExpand function

2006-03-04 Thread Joao Morais


Hello,

Should this comparison (!) be fixed? Seeing that this code is going to 
be changed, what about change Pa[I] assignment from a variable to a 
constant?


rtl/inc/fexpand.inc

 (* Allow both '/' and '\' as directory separators *)
 (* by converting all to the native one.   *)
 if DirectorySeparator = '\' then
 {Allow slash as backslash}
   begin
 for I := 1 to Length (Pa) do
   if Pa [I] = '/' then
 Pa [I] := DirectorySeparator
   end
 else
!  if DirectorySeparator = '\' then
 {Allow backslash as slash}
 begin
   for I := 1 to Length (Pa) do
 if Pa [I] = '\' then
   Pa [I] := DirectorySeparator;
 end;

Thanks,
--
Joao Morais
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel