home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.amiga.programmer:17697 comp.sys.amiga.misc:18960
- Newsgroups: comp.sys.amiga.programmer,comp.sys.amiga.misc
- Path: sparky!uunet!gatech!concert!sas!mozart.unx.sas.com!walker
- From: walker@twix.unx.sas.com (Doug Walker)
- Subject: Re: SAS C6.1 datecmp bug [Was: Re: Advice to SAS/C 5.10b users]
- Originator: walker@twix.unx.sas.com
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <BznyFH.J3s@unx.sas.com>
- Date: Tue, 22 Dec 1992 13:50:04 GMT
- References: <BzD93n.JCo@usenet.ucs.indiana.edu> <BzEqDF.A5H@unx.sas.com> <1992Dec21.030843.16107@bohra.cpg.oz.au> <BzMJJB.84z@unx.sas.com>
- Nntp-Posting-Host: twix.unx.sas.com
- Organization: SAS Institute Inc.
- Lines: 64
-
-
- In article <BzMJJB.84z@unx.sas.com>, jamie@cdevil.unx.sas.com (James Cooper) writes:
- |> Doug was correct. Out of all those people, things can still slip past... for
- |> instance, one of the things fixed in 6.1 over 6.0 was not being able to compile
- |> with the F4 key in SE. This was finally traced down to having the system
- |> WildStar bit turned on. You might claim this is a common thing to do, but none
- |> of the Beta testers uses that bit, so it wasn't found until after release.
-
- ...or if they do, they don't use SE, or if they do, they don't compile
- using F4, or if they do, they shrugged their shoulders when it happened
- and used right-Amiga-B instead.
-
- |> As for why it was broken when you got it... well, I don't know any programmers
- |> who use the ANSI functions unless they are porting code, and we've only had 3
- |> people complain about the datecmp() function so far... and all of the complaints
- |> were *after* 6.1 came out. The function was there in 6.0, and hasn't been
- |> touched since, but we never knew there was a problem, so we couldn't fix it.
-
- Huh? Many, many people use the ANSI functions. datecmp() is not an
- ANSI function, however, it's an AmigaDOS function. This is probably
- why it got by unnoticed.
-
- The bug was a simple = vs == typo in datecmp(). I have fixed it and
- the fix will be in 6.2. I suggest coding a datecmp() yourself,
- it's pretty obvious how it has to work. In fact, here it is:
-
- #include <exec/types.h>
- #include <dos/dos.h>
-
- int datecmp(struct DateStamp *a, struct DateStamp *b)
- {
- LONG tmp;
- if((tmp = a->ds_Days - b->ds_Days) == 0)
- {
- if((tmp = a->ds_Minute - b->ds_Minute) == 0)
- {
- if((tmp = a->ds_Tick - b->ds_Tick) == 0)
- return(0);
- }
- }
- return(tmp < 0 ? -1 : 1);
- }
-
- (Actually, assuming the fields in the DateStamp structure can
- never be negative, you could use a simple memcmp() on it...
- hmmm....)
-
- Right now, 6.2 is being held pending discovery of a weird memory-
- trashing bug on '040 machines that was introduced after 6.1 was
- shipped. I apologize for the delay; I'd love to be able to ship
- it right now, but until we locate this problem, we can't ship
- anything.
-
- |> Jim Cooper
-
- --
- *****
- =*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
- *|. o.| || 1200/2400/9600 Dual
- | o |// For all you do, this bug's for you!
- ======
- usenet: walker@unx.sas.com bix: djwalker
- Any opinions expressed are mine, not those of SAS Institute, Inc.
-
-