Am Friday 20 November 2009 07:40:33 schrieb Graeme Geldenhuys:
> Rainer Stratmann wrote:
> > May be it is possible to make a compiler switch like
> > $PASS_VAR_NO_HINT ON
>
> No. My issue is not the hint in general. The hint is if for "real"
> issues. My issue is that I tried to solve the compiler
Flávio Etrusco wrote:
>
> Out of curiosity, does anybody know how Delphi solves this? I don't
> remember seeing a warning (having to initialize variables) on FillChar
> in Delphi...
I tried the same thing last night with Kylix 3. It seems Kylix (and
probably Delphi) doesn't even have such a hint
Rainer Stratmann wrote:
> May be it is possible to make a compiler switch like
> $PASS_VAR_NO_HINT ON
No. My issue is not the hint in general. The hint is if for "real"
issues. My issue is that I tried to solve the compiler hint by manually
initializing my structured types using FillChar(). And it
- Original Message -
From: "Tomas Hajny"
To: ; "FPC-Pascal users discussions"
Sent: Wednesday, November 18, 2009 10:40 PM
Subject: Re: [fpc-pascal] How to solve "Conversion between ordinals and
pointers is not portable"
On Tue, November 17, 2009 10:48, Graeme Geldenhuys wrote:
Holger Bruns wrote:
At first, there must be a queue for incoming data despite I
ruled out a queue with an inbuffer with the length 1.
No, you did not rule out a queue at all, you are simply reading from it 1 byte
at a time.
I'm absolutely positive you can do what you want to do by simply us
On Thu, Nov 19, 2009 at 4:18 AM, Jonas Maebe wrote:
>
> On 19 Nov 2009, at 07:35, Graeme Geldenhuys wrote:
>
>> Somebody did once attempt to correct the var parameter to out parameter
>> in FillChar, but got to many errors. Probably not a high priority issue,
>> so the problem was simply swept und
Vinzent Höfler wrote:
Rainer Stratmann :
Am Thursday 19 November 2009 23:16:26 schrieb Vinzent Höfler:
{$HINTS OFF}
... code ...
{$HINTS DEFAULT}
maybe? Whereas DEFAULT restores the switch to the original state.
But then you have to do it everywhere in the code instead of on
Rainer Stratmann :
> Am Thursday 19 November 2009 23:16:26 schrieb Vinzent Höfler:
> >
> > {$HINTS OFF}
> >
> > ... code ...
> >
> > {$HINTS DEFAULT}
> >
> > maybe? Whereas DEFAULT restores the switch to the original state.
>
> But then you have to do it everywhere in the code instead of one time
Rainer Stratmann wrote:
Am Thursday 19 November 2009 23:16:26 schrieb Vinzent Höfler:
Martin :
Ideally it would be, if there was a directive or similar, to suppress it
for given lines (or statements).
one that is easier than {$push} { $HINT OFF} ... {$POP}
{$HINTS OFF}
... code
Am Thursday 19 November 2009 23:16:26 schrieb Vinzent Höfler:
> Martin :
> > Ideally it would be, if there was a directive or similar, to suppress it
> > for given lines (or statements).
> > one that is easier than {$push} { $HINT OFF} ... {$POP}
>
> {$HINTS OFF}
>
> ... code ...
>
> {$HINTS DEFAUL
Martin :
> Ideally it would be, if there was a directive or similar, to suppress it
> for given lines (or statements).
> one that is easier than {$push} { $HINT OFF} ... {$POP}
{$HINTS OFF}
... code ...
{$HINTS DEFAULT}
maybe? Whereas DEFAULT restores the switch to the original state.
Vinze
Jonas Maebe wrote:
On 19 Nov 2009, at 22:50, Rainer Stratmann wrote:
Yes, but for that is the compiler-switch $PASS_VAR_NO_HINT ON.
Then no hint is put out by the compiler.
When using FPC 2.4.0rc1 or later:
a) compile your code with -vq
b) note the message number for the warning/note/h
On 19 Nov 2009, at 22:50, Rainer Stratmann wrote:
> Yes, but for that is the compiler-switch $PASS_VAR_NO_HINT ON.
> Then no hint is put out by the compiler.
When using FPC 2.4.0rc1 or later:
a) compile your code with -vq
b) note the message number for the warning/note/hint you want to suppress
Am Thursday 19 November 2009 22:40:53 schrieb Vinzent Höfler:
> Rainer Stratmann :
> > For me a variable is initialised when it passes a procedure/function
> > which has a var declaration in the parameters.
>
> -- 8< --
> procedure Add_2 (var I : Integer);
> begin
>I := I + 2;
> end;
> -- 8< -
Rainer Stratmann :
> For me a variable is initialised when it passes a procedure/function
> which has a var declaration in the parameters.
-- 8< --
procedure Add_2 (var I : Integer);
begin
I := I + 2;
end;
-- 8< --
If the variable for the parameter I wasn't correctly initialized before, it
Graeme Geldenhuys :
> On 19/11/2009, Jonas Maebe wrote:
> >
> > > Or is it just a side effect?
> >
> > Yes.
>
> Well it seems the "side effect" is more popular use-case in FPC and
> Delphi developers projects than the original intention of "out" then.
Of course. The side-effect is much more in
Graeme Geldenhuys :
> 2009/11/19 "Vinzent Höfler" :
> >
> > Why don't you create your own initialization routine together with the
>
> Because not all the code I maintain is my own. Some code, as in the
> case of DCPCrypt gave stacks of hints which were all false positives.
I understand.
> If I
Florian Klaempfl :
> Vinzent Höfler schrieb:
> > Florian Klaempfl :
> >
> >> Out is not made to solve such problems but plainly to work with
> >> COM/Corba.
> >
> > Really? Well, that's not what the FPC manual says:
>
> And? Is there a different reason written? And even if it is:
> documentatio
mar...@stack.nl:
[Synapse/Synaser]
> How do you use it? I'm used to TComport, and it seems that synaser, like
> unit serial, only supports blocking use.
call Connect, call Config, call the appropriate reading and writing subroutines
(like SendString and RecvPacket)...
> Do you put it in a threa
For me a variable is initialised when it passes a procedure/function which has
a var declaration in the parameters.
May be it is possible to make a compiler switch like
$PASS_VAR_NO_HINT ON
instead of globally
$HINTS OFF
Then all variables wich passes for example the fillchar procedure are
init
Holger Bruns :
> > Despite queues an baud rates, you must expect data loss. You will
> > loss data in the physical layer. You have to implement some handshake
> > to prevent it. (using google translator, excuse my english).
>
> Which can be done through a direct port access and some lines of cod
On 19/11/2009, Jonas Maebe wrote:
>
> > Or is it just a side effect?
>
> Yes.
Well it seems the "side effect" is more popular use-case in FPC and
Delphi developers projects than the original intention of "out" then.
BTW:
I searched the Kylix and Delphi source folders. The "side effect" is
used
2009/11/19 "Vinzent Höfler" :
>> Then create a different FillChar -type
>> procedure to handle those corner cases, or create a different procedure
>> which allows structure types to be initialized without compiler hints.
>
> Why don't you create your own initialization routine together with the
Be
On 19 Nov 2009, at 20:44, cobines wrote:
> Is it wrong to use "out" for the sole purpose of informing the compiler that
> a function will set the initial value of a variable passed as the parameter?
No.
> Or is it just a side effect?
Yes.
> I use it all over the place in my programs. Is it s
W dniu 2009-11-19 20:29, Florian Klaempfl pisze:
Vinzent Höfler schrieb:
Florian Klaempfl:
Out is not made to solve such problems but plainly to work with
COM/Corba.
Really? Well, that's not what the FPC manual says:
And? Is there a different reason written? And even if it is:
documentatio
Vinzent Höfler schrieb:
> Florian Klaempfl :
>
>> Out is not made to solve such problems but plainly to work with
>> COM/Corba.
>
> Really? Well, that's not what the FPC manual says:
And? Is there a different reason written? And even if it is:
documentation writer know less than implementors :)
Florian Klaempfl :
> Out is not made to solve such problems but plainly to work with
> COM/Corba.
Really? Well, that's not what the FPC manual says:
-- 8< --
The purpose of an out parameter is to pass values back to the calling routine:
The variable is passed by reference. The initial value of
Graeme Geldenhuys :
[FillChar]
> As for the COM usage requirement (which I honestly believe is the
> minority use case in FPC).
AFAIK, the different semantic of "out" parameters applies to all reference
counted types. That's especially unfortunate with dynamic arrays, where you
lose transparenc
Marco van de Voort wrote:
In our previous episode, Gustavo Enrique Jimenez said:
Did you try Synaser? http://www.ararat.cz/synapse/doku.php/download .
I use it on all my projects since 2006 without problems (linux,
windows, etc...).
How do you use it? I'm used to TComport, and it seems that sy
2009/11/19 Holger Bruns :
> Gustavo Enrique Jimenez schrieb:
>>
>> Despite queues an baud rates, you must expect data loss. You will
>> loss data in the physical layer. You have to implement some handshake
>> to prevent it. (using google translator, excuse my english).
>>
>>
>> Gustavo
>>
>>
>
> W
2009/11/19 Marco van de Voort :
> In our previous episode, Gustavo Enrique Jimenez said:
>> Did you try Synaser? http://www.ararat.cz/synapse/doku.php/download .
>> I use it on all my projects since 2006 without problems (linux,
>> windows, etc...).
>
> How do you use it? I'm used to TComport, and
In our previous episode, Gustavo Enrique Jimenez said:
> Did you try Synaser? http://www.ararat.cz/synapse/doku.php/download .
> I use it on all my projects since 2006 without problems (linux,
> windows, etc...).
How do you use it? I'm used to TComport, and it seems that synaser, like
unit serial,
2009/11/19 Holger Bruns :
> Gustavo Enrique Jimenez schrieb:
>>>
>>> Thank you for your answer. I played with different baud rates. The sender
>>> delivers a stream of bytes. The faster a transmission rate is, the less
>>> amount of data can be received. This leds me to two conclusions: At
>>> firs
In our previous episode, Holger Bruns said:
> >
>
> Which can be done through a direct port access and some lines of code in
> assembler language. The second idea I have is the use of the device
> files /dev/ttySx, but how can these files be used to get access to all
> of the registers of an
Gustavo Enrique Jimenez schrieb:
Thank you for your answer. I played with different baud rates. The sender
delivers a stream of bytes. The faster a transmission rate is, the less
amount of data can be received. This leds me to two conclusions: At first,
there must be a queue for incoming data des
>
> Thank you for your answer. I played with different baud rates. The sender
> delivers a stream of bytes. The faster a transmission rate is, the less
> amount of data can be received. This leds me to two conclusions: At first,
> there must be a queue for incoming data despite I ruled out a queue
On 19 Nov 2009, at 14:30, Holger Bruns wrote:
Since iopl is still not available to fpc in its 64-bit-version, I
should move to c for future port programming.
$ man iopl
...
This call is mostly for the i386 architecture. On many other
architec-
tures it does not exist or will
Brad Campbell schrieb:
Holger Bruns wrote:
Hi,
one more question regarding the unit serial. I use the following
function to get one single byte form a serial port, which has been
open before with seropen:
function getdata(inhandle: tserialhandle; var recdata: char): longint;
begin
fillchar(
If my client will be willing to pay for it, or I'll find some time (and a
Windows machine, I'm using my Client's Windows, while I'm using Linux
myself), I'll be glad to do it :)
Ido
http://ik.homelinux.org/
On Thu, Nov 19, 2009 at 1:55 PM, Marco van de Voort wrote:
> In our previous episode, i
In our previous episode, ik said:
>
> Does anyone know of Pascal binding for Microsoft SAPI that can be used with
> FPC ?
maybe convert http://www.blong.com/Conferences/DCon2002/Speech/Speech.htm
?
___
fpc-pascal maillist - fpc-pascal@lists.freepasca
In our previous episode, Marc Santhoff said:
>
> I'm trying to get unix.popen() running. The RTL.pdf says the file opened
> with popen (stdin for reading here) has to be reset or rewritten. The
> example does not do anything like that.
Apparantly that is false;
uses unix;
var
f: text;
s: an
Zaher Dirkey wrote:
>
> procedure ZeroMemory(Destination: Pointer; Length: DWORD);
> begin
> FillChar(Destination^, Length, 0);
> end;
Out of interest, I would recommend you change DWORD to PtrUInt. DWORD is
limited two a 32bit value on 64bit systems.
Regards,
- Graeme -
--
fpGUI Toolkit
In our previous episode, Florian Klaempfl said:
> > have the time to seek through all my 200,000+ lines of code looking for
> > what is 'real' hints and what is 'fake' hints.
> >
> > I don't see any problem in trying to write code with no hints &
> > warnings. That's simply clean code!
>
> If hin
Hello,
Does anyone know of Pascal binding for Microsoft SAPI that can be used with
FPC ?
Thanks,
Ido
http://ik.homelinux.org/
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Hello,
I'm trying to get unix.popen() running. The RTL.pdf says the file opened
with popen (stdin for reading here) has to be reset or rewritten. The
example does not do anything like that.
The other part is the question whether the file has to be assign()'ed
befor or not.
var
f: text;
s: a
Graeme Geldenhuys schrieb:
> Jonas Maebe wrote:
>> It's not about it not being a high priority problem, it's about it
>> being fundamentally unfixable (except by using a completely different
>
> See my reply in fpc-devel mailing list.
>
> Bottom line is, I don't think it's right for a project th
Graeme Geldenhuys schrieb:
> Florian Klaempfl wrote:
>> If hints are really important, they would be warnings.
>
> And working with a uninitialized data structure is a good thing? I think
> not. So, like everybody else, I manually initialise my data structures -
> and because of my efforts to writ
Hello Graeme,
Thursday, November 19, 2009, 8:52:41 AM, you wrote:
GG> And working with a uninitialized data structure is a good thing? I think
GG> not. So, like everybody else, I manually initialise my data structures -
GG> and because of my efforts to write safer code, the compiler gives me a
GG
Holger Bruns wrote:
Hi,
one more question regarding the unit serial. I use the following
function to get one single byte form a serial port, which has been open
before with seropen:
function getdata(inhandle: tserialhandle; var recdata: char): longint;
begin
fillchar(inbuffer, sizeof(inbuffe
49 matches
Mail list logo