[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rtems-980923 is available



"D. V. Henkel-Wallace" <gumby at zembu.com> wrote:
> I have no comment on the specific technical issue, but this
> suggestion I clearly don't like.
>
> If the return value is of unpredictable accuracy, then responsible
> programmers shouldn't use it.  But commenting it lends it an air of
> legitimacy that could lead less experienced programmers to use it.
> Although this is a small case, it's basically the equivalent of
> leaving a loaded firearm lying around.

My feelings, precisely.

>
> In a case like this it's better to resolve the "does so"/"does not"
> issue than to finesse it with a compromise.

Like I said before, ``Be reasonable -- do it my way''   :-)

>
> If this value is really so unstable (equivalent to choosing a
> random number between 0 and the input count) it's hard to believe
> that it could make another function cleaner to implement.
>

I think the best solution here is to have  
rtems_termios_dequeue_characters return 0 if the last characters have  
been dequeued and return 1 if they have not.

That's the way the return value is being used now.

In fact, I am sure I sent a patch with this change several weeks ago  
-- it must have gotten lost in the shuffle.

The change is so small that I'm including it in this message.
=============================================================
diff -u -r rtems-980923.orig/c/src/lib/libc/termios.c  
rtems-980923/c/src/lib/libc/termios.c
--- rtems-980923.orig/c/src/lib/libc/termios.c  Wed Sep 23 07:20:29 1998
+++ rtems-980923/c/src/lib/libc/termios.c       Wed Sep 23 13:13:42 1998
@@ -928,8 +928,5 @@
                tty->rawOutBufState = rob_busy;
        }
        tty->rawOutBufTail = newTail;
-
-       return nToSend;
+       return 1;
 }
-
-
========================================================

BTW -- Sorry about this, Joel.  I realize that keeping all these  
submissions straight is tough enough without the rest of us getting  
into disagreements like this.

---
Eric Norum                                 eric at skatter.usask.ca
Saskatchewan Accelerator Laboratory        Phone: (306) 966-6308
University of Saskatchewan                 FAX:   (306) 966-6058
Saskatoon, Canada.