[fpc-pascal] MSEide+MSEgui 1.8rc1

2008-05-24 Thread Martin Schreiber
Hi,
MSEide+MSEgui revision 1.8rc1 has been released:

http://sourceforge.net/project/showfiles.php?group_id=165409

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


[fpc-pascal] Cross-compile on Linux from 32bits to 64bits

2008-05-24 Thread TOUZEAU DAVID


Dear

I'm using a 32 bits Linux system to developp and i want my program to be 
64 Bits compatible.
What is the best method to allow my program to be compatible on 32 And 
64 bits ?


Besst regards


--
David Touzeau -- Linux Ubuntu 7.04 feisty 
FreePascal-Lazarus,perl,delphi,php artica for postfix management console 
(http://www.artica.fr) icq:160018849

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


Re: [fpc-pascal] Cross-compile on Linux from 32bits to 64bits

2008-05-24 Thread Jonas Maebe


On 24 May 2008, at 17:15, TOUZEAU DAVID wrote:

I'm using a 32 bits Linux system to developp and i want my program  
to be 64 Bits compatible.
What is the best method to allow my program to be compatible on 32  
And 64 bits ?


Do not type cast between integer and pointer types (and if you have  
to, always use the ptrint and ptruint types). Do not use assembler.



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


[fpc-pascal] ibconnection patch

2008-05-24 Thread Joao Morais


Hello,

The following patches fixes the lack of sqlscale var when writing 
decimal and numeric fields to ib/fb databases. I've used the same 
approach used to read such fields, ie, intpower.


Patch 1 has also a small improvement regarding the read of the XSQLVAR 
record, patch 2 only fixes the sqlscale.


Both patches are against fixes_2_2. Let me know if it's still useful, 
otherwise I will checkout trunk and create another patch.


--
Joao Morais
Index: fcl-db/src/sqldb/interbase/ibconnection.pp
===
--- fcl-db/src/sqldb/interbase/ibconnection.pp  (revision 11044)
+++ fcl-db/src/sqldb/interbase/ibconnection.pp  (working copy)
@@ -693,6 +693,7 @@
 var ParNr,SQLVarNr : integer;
 s   : string;
 i   : integer;
+si  : smallint;
 li  : LargeInt;
 currbuff: pchar;
 w   : word;
@@ -736,30 +737,40 @@
 {$R+}
   end;
 
+var
+  VSQLVar: XSQLVAR;
 begin
 {$R-}
   with cursor as TIBCursor do for SQLVarNr := 0 to 
High(ParamBinding){AParams.count-1} do
 begin
 ParNr := ParamBinding[SQLVarNr];
+VSQLVar := in_sqlda^.SQLvar[SQLVarNr];
 if AParams[ParNr].IsNull then
   begin
-  If Assigned(in_sqlda^.SQLvar[SQLVarNr].SQLInd) then
-in_sqlda^.SQLvar[SQLVarNr].SQLInd^ := -1;
+  If Assigned(VSQLVar.SQLInd) then
+VSQLVar.SQLInd^ := -1;
   end
 else
   begin
-  if assigned(in_sqlda^.SQLvar[SQLVarNr].SQLInd) then 
in_sqlda^.SQLvar[SQLVarNr].SQLInd^ := 0;
+  if assigned(VSQLVar.SQLInd) then VSQLVar.SQLInd^ := 0;
 
-  case (in_sqlda^.SQLvar[SQLVarNr].sqltype and not 1) of
+  case (VSQLVar.sqltype and not 1) of
 SQL_LONG :
   begin
-  i := AParams[ParNr].AsInteger;
-  Move(i, in_sqlda^.SQLvar[SQLVarNr].SQLData^, 
in_SQLDA^.SQLVar[SQLVarNr].SQLLen);
+if VSQLVar.sqlscale = 0 then
+  i := AParams[ParNr].AsInteger
+else
+  i := Round(AParams[ParNr].AsCurrency * IntPower(10, 
-VSQLVar.sqlscale));
+Move(i, VSQLVar.SQLData^, VSQLVar.SQLLen);
   end;
 SQL_SHORT :
   begin
-  i := AParams[ParNr].AsSmallInt;
-  Move(i, in_sqlda^.SQLvar[SQLVarNr].SQLData^, 
in_SQLDA^.SQLVar[SQLVarNr].SQLLen);
+if VSQLVar.sqlscale = 0 then
+  si := AParams[ParNr].AsSmallint
+else
+  si := Round(AParams[ParNr].AsCurrency * IntPower(10, 
-VSQLVar.sqlscale));
+i := si;
+Move(i, VSQLVar.SQLData^, VSQLVar.SQLLen);
   end;
 SQL_BLOB :
   SetBlobParam;
@@ -767,27 +778,30 @@
   begin
   s := AParams[ParNr].AsString;
   w := length(s); // a word is enough, since the max-length of a 
string in interbase is 32k
-  if ((in_sqlda^.SQLvar[SQLVarNr].SQLType and not 1) = SQL_VARYING) 
then
+  if ((VSQLVar.SQLType and not 1) = SQL_VARYING) then
 begin
-in_sqlda^.SQLvar[SQLVarNr].SQLLen := w;
-
ReAllocMem(in_sqlda^.SQLvar[SQLVarNr].SQLData,in_SQLDA^.SQLVar[SQLVarNr].SQLLen+2);
-CurrBuff := in_sqlda^.SQLvar[SQLVarNr].SQLData;
+VSQLVar.SQLLen := w;
+ReAllocMem(VSQLVar.SQLData, VSQLVar.SQLLen+2);
+CurrBuff := VSQLVar.SQLData;
 move(w,CurrBuff^,sizeof(w));
 inc(CurrBuff,2);
 end
   else
-CurrBuff := in_sqlda^.SQLvar[SQLVarNr].SQLData;
+CurrBuff := VSQLVar.SQLData;
   Move(s[1], CurrBuff^, w);
   end;
 SQL_TYPE_DATE, SQL_TYPE_TIME, SQL_TIMESTAMP :
-  SetDateTime(in_sqlda^.SQLvar[SQLVarNr].SQLData, 
AParams[ParNr].AsDateTime, in_SQLDA^.SQLVar[SQLVarNr].SQLType);
+  SetDateTime(VSQLVar.SQLData, AParams[ParNr].AsDateTime, 
VSQLVar.SQLType);
 SQL_INT64:
   begin
-  li := AParams[ParNr].AsLargeInt;
-  Move(li, in_sqlda^.SQLvar[SQLVarNr].SQLData^, 
in_SQLDA^.SQLVar[SQLVarNr].SQLLen);
+if VSQLVar.sqlscale = 0 then
+  li := AParams[ParNr].AsLargeInt
+else
+  li := Round(AParams[ParNr].AsCurrency * IntPower(10, 
-VSQLVar.sqlscale));
+Move(li, VSQLVar.SQLData^, VSQLVar.SQLLen);
   end;
 SQL_DOUBLE, SQL_FLOAT:
-  SetFloat(in_sqlda^.SQLvar[SQLVarNr].SQLData, AParams[ParNr].AsFloat, 
in_SQLDA^.SQLVar[SQLVarNr].SQLLen);
+  SetFloat(VSQLVar.SQLData, AParams[ParNr].AsFloat, VSQLVar.SQLLen);
   else
 
DatabaseErrorFmt(SUnsupportedParameter,[Fieldtypenames[AParams[ParNr].DataType]],self);
   end {case}
Index: fcl-db/src/sqldb/interbase/ibconnection.pp
===
--- fcl-db/src/sqldb/interbase/ibconnection.pp  (revision 11044)
+++ fcl-db/src/sqldb/interbase/ibconnection.pp  (working copy)
@@ -693,6 +693,7 @@
 var ParNr,SQLVarNr : int

[fpc-pascal] avl_tree.pp unit license

2008-05-24 Thread Vladimir Zhirov
Hi,

I've got a question about the license of unit avl_tree.pp, that comes
with FCL. FPC FAQ states that

> Applications created by the compiler and using the runtime library
> come under a modified library gnu public license (LGPL), which permit
> no restriction on the type of license the application has.

Meanwhile, the avl_tree.pp contains the following comment:

> This source is free software; you can redistribute it and/or modify   *
> it under the terms of the GNU General Public License as published by  *
> the Free Software Foundation; either version 2 of the License, or *
> (at your option) any later version.

AVL_Tree unit is used by dom.pp.

So the question is: are there any restrictions on the license of
applications that use dom.pp and avl_tree.pp?

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