Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Michael Van Canneyt
On Wed, 13 May 2020, Noel Duffy via fpc-pascal wrote: On 12/05/20 10:32 pm, Michael Van Canneyt wrote:> On Tue, 12 May 2020, Noel Duffy via fpc-pascal wrote: A simple solution is to add functions to the sockets unit which accep a var record into which the output will be written and which

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Michael Van Canneyt
On Wed, 13 May 2020, Christo Crause via fpc-pascal wrote: On Tue, May 12, 2020 at 11:11 PM Noel Duffy via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: Sure, I can do that. I will look at creating a patch for this. For your purposes, do you prefer to have a new bug in the bug tracker

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Christo Crause via fpc-pascal
On Wed, May 13, 2020 at 9:31 AM Michael Van Canneyt wrote: > > On Wed, 13 May 2020, Christo Crause via fpc-pascal wrote: > > > On Tue, May 12, 2020 at 11:11 PM Noel Duffy via fpc-pascal < > > fpc-pascal@lists.freepascal.org> wrote: > > > >> Sure, I can do that. I will look at creating a patch for

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Noel Duffy via fpc-pascal
On 13/05/20 7:26 pm, Michael Van Canneyt wrote: Always a new issue for new changes. Makes it easier to track where something went wrong if something is wrong. Done. https://bugs.freepascal.org/view.php?id=37060 I will try to get a patch ready for this in the next couple of days. BTW, I didn

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Michael Van Canneyt
On Wed, 13 May 2020, Noel Duffy via fpc-pascal wrote: On 13/05/20 7:26 pm, Michael Van Canneyt wrote: Always a new issue for new changes. Makes it easier to track where something went wrong if something is wrong. Done. https://bugs.freepascal.org/view.php?id=37060 I will try to get a pat

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Noel Duffy via fpc-pascal
On 13/05/20 6:41 pm, Marc Weustink via fpc-pascal wrote: On 12-5-2020 14:56, Marco van de Voort wrote: Op 2020-05-12 om 12:32 schreef Michael Van Canneyt: I'm all for it, but please use the following names: function TryStrToHostAddr(IP: String; var ip4: in_addr): Boolean; function TryStrTo

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Noel Duffy via fpc-pascal
On 13/05/20 8:36 pm, Michael Van Canneyt wrote: On Wed, 13 May 2020, Noel Duffy via fpc-pascal wrote: On 13/05/20 7:26 pm, Michael Van Canneyt wrote: BTW, I didn't see an obvious way within Mantis to link one bug to another, or to indicate any kind of relationship. Is this possible? I've

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Bart via fpc-pascal
On Wed, May 13, 2020 at 10:40 AM Noel Duffy via fpc-pascal wrote: > > And maybe change the var into an out I agree, it gives unnecessary warning about uninitialized variables. > As I've already learned the hard way, the sockets unit is compiled in > "fpc" mode, so there's no "out" parameters. O

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Noel Duffy via fpc-pascal
On 13/05/20 9:24 pm, Bart via fpc-pascal wrote: On Wed, May 13, 2020 at 10:40 AM Noel Duffy via fpc-pascal As I've already learned the hard way, the sockets unit is compiled in "fpc" mode, so there's no "out" parameters. Otherwise I would definitely have used one. {$modeswicth out} perhaps?

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Marco van de Voort
Op 12/05/2020 om 23:05 schreef Noel Duffy via fpc-pascal: function TryStrToHostAddr(IP: String; var ip4: in_addr): Boolean; function TryStrToHostAddr6(IP: String; var ip6: in6_addr): Boolean; Rationale for this request: All conversion calls in sysutils and dateutils use this naming scheme, i

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Michael Van Canneyt
On Wed, 13 May 2020, Noel Duffy via fpc-pascal wrote: On 13/05/20 9:24 pm, Bart via fpc-pascal wrote: On Wed, May 13, 2020 at 10:40 AM Noel Duffy via fpc-pascal As I've already learned the hard way, the sockets unit is compiled in "fpc" mode, so there's no "out" parameters. Otherwise I wou

Re: [fpc-pascal] Return value of StrToHostAddr and StrToHostAddr6 in sockets unit

2020-05-13 Thread Noel Duffy via fpc-pascal
On 14/05/20 12:36 am, Michael Van Canneyt wrote: On Wed, 13 May 2020, Noel Duffy via fpc-pascal wrote: On 13/05/20 9:24 pm, Bart via fpc-pascal wrote: On Wed, May 13, 2020 at 10:40 AM Noel Duffy via fpc-pascal As I've already learned the hard way, the sockets unit is compiled in "fpc" mod