Welcome, Guest. Please login or register.

Author Topic: AFAOS and encodings  (Read 4361 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Georg

  • Jr. Member
  • **
  • Join Date: Feb 2002
  • Posts: 90
    • Show all replies
Re: AFAOS and encodings
« on: August 19, 2007, 11:41:41 AM »
Quote

Quote
is MOS strtolong enhanced that strtolong support too hex values ?

Yes.


Was that a good idea considering that autodocs say "Converts decimal string into LONG value."?
 

Offline Georg

  • Jr. Member
  • **
  • Join Date: Feb 2002
  • Posts: 90
    • Show all replies
Re: AFAOS and encodings
« Reply #1 on: August 19, 2007, 02:22:30 PM »
Quote

It automagically gave hex support for ReadArgs /N, too, so yes I consider it a good move.

Also, to specify a hex number you need a identifier before such number, thus I can't possibly see any disadvantages in it either.


Backwards compatibility. If you have a function which takes an input string and splits it into int_number and string_remainder then a input string "0x10Hello" would give

0 x10Hello

in the old AOS style implementation (not accepting hex), but
would give

16 Hello in the new MOS style implementation (accepting hex).


Okay, I would probably (have) to think much harder for an example which makes some more (any) sense, but OTOH how likely do you think it is that a similiar enhancement is ever done for clib/atoi() and why.



 

Offline Georg

  • Jr. Member
  • **
  • Join Date: Feb 2002
  • Posts: 90
    • Show all replies
Re: AFAOS and encodings
« Reply #2 on: August 19, 2007, 07:57:33 PM »
Quote

Piru wrote:

Considering the AROS StrToLong() isn't AmigaOS compatible either, that is a bit silly argument IMO.


Well, if so (which is very likely after a quick look at the source: for example the space/tab check should be in a loop I guess), it's because of buggy implementation not intended implementation.

Quote
Never.


And why?
 

Offline Georg

  • Jr. Member
  • **
  • Join Date: Feb 2002
  • Posts: 90
    • Show all replies
Re: AFAOS and encodings
« Reply #3 on: August 19, 2007, 08:01:55 PM »
Quote

bernd_afa wrote:

Do you have MOS source with stringtolong ?
I do it in a separate command.


No, we only have DOS sources from 2001 or 2002 which did not yet have hex support in. It's not something hard to implement but I would rather change ftmanager to use strtol() instead. Because for running ftmanager under AOS using StrToLong() would only work if you patch it to work like MOS.


 

Offline Georg

  • Jr. Member
  • **
  • Join Date: Feb 2002
  • Posts: 90
    • Show all replies
Re: AFAOS and encodings
« Reply #4 on: August 20, 2007, 06:37:58 PM »
Quote

Piru wrote:

The particular change was made in 2002. Georg himself had access to the source code at that time.


cvs access I had did not include dos sources. DOS sources from 2001 or 2002 were sent as archive by Emm (initial plan was to have final thing compilable for both AROS and MOS from same source (reason for added AROS_DOS_COMPATIBLE) but at end Emm/MOS coders did not have enough time and/or possibility to test)).