diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2002-06-10 19:42:11 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2002-06-10 19:42:11 +0000 |
commit | e48c510452324c07398f8223fa371f6fe68ec2bb (patch) | |
tree | cdf299b3172daafba1c92bc2a0ef2e9f5a8ef8a1 | |
parent | d13b62c02fcf764f0530f87a2da5db54aad474f7 (diff) | |
download | ATCD-e48c510452324c07398f8223fa371f6fe68ec2bb.tar.gz |
ChangeLogTag:Mon Jun 10 14:23:28 2002 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-02a | 11 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 11 | ||||
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | ace/OS_String.cpp | 79 | ||||
-rw-r--r-- | ace/Reactor.h | 4 |
6 files changed, 80 insertions, 37 deletions
diff --git a/ChangeLog b/ChangeLog index 0287b89b063..bbbae173127 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Mon Jun 10 14:23:28 2002 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * ace/Reactor.h (ACE_Reactor): Added a comment explaining that + the mask passed to notify() can only be READ_MASK, WRITE_MASK, + or EXCEPT_MASK. Thanks to Cary Steinmetz + <cary.s.steinmetz@boeing.com> for motivating this comment. + + * ace/OS_String.cpp: Make sure to check whether src == dst and + avoid doing any copies in this case. Thanks to Michael Searles + <msearles@base16.com> for reporting this. + Sun Jun 9 20:01:00 2002 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> * ace/Makefile: Something is wrong with my ACE_ROOT environment variable, diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 0287b89b063..bbbae173127 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,14 @@ +Mon Jun 10 14:23:28 2002 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * ace/Reactor.h (ACE_Reactor): Added a comment explaining that + the mask passed to notify() can only be READ_MASK, WRITE_MASK, + or EXCEPT_MASK. Thanks to Cary Steinmetz + <cary.s.steinmetz@boeing.com> for motivating this comment. + + * ace/OS_String.cpp: Make sure to check whether src == dst and + avoid doing any copies in this case. Thanks to Michael Searles + <msearles@base16.com> for reporting this. + Sun Jun 9 20:01:00 2002 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> * ace/Makefile: Something is wrong with my ACE_ROOT environment variable, diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 0287b89b063..bbbae173127 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,14 @@ +Mon Jun 10 14:23:28 2002 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> + + * ace/Reactor.h (ACE_Reactor): Added a comment explaining that + the mask passed to notify() can only be READ_MASK, WRITE_MASK, + or EXCEPT_MASK. Thanks to Cary Steinmetz + <cary.s.steinmetz@boeing.com> for motivating this comment. + + * ace/OS_String.cpp: Make sure to check whether src == dst and + avoid doing any copies in this case. Thanks to Michael Searles + <msearles@base16.com> for reporting this. + Sun Jun 9 20:01:00 2002 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> * ace/Makefile: Something is wrong with my ACE_ROOT environment variable, @@ -1526,6 +1526,7 @@ David Smith <dts@prismtechnologies.com> Dimitrije Jankovic <djankov99@yahoo.com> Frank O. Flemisch <f.o.flemisch@larc.nasa.gov> Ken Sedgwick <ken@bonsai.com> +Cary Steinmetz <cary.s.steinmetz@boeing.com> I would particularly like to thank Paul Stephenson, who worked with me at Ericsson in the early 1990's. Paul devised the recursive Makefile diff --git a/ace/OS_String.cpp b/ace/OS_String.cpp index 403bd5df919..9f74d115355 100644 --- a/ace/OS_String.cpp +++ b/ace/OS_String.cpp @@ -965,48 +965,55 @@ ACE_OS_String::strtoul_emulation (const char *nptr, /* * See strtol for comments as to the logic used. */ - do { - c = *s++; - } while (isspace(c)); - if (c == '-') { - neg = 1; + do c = *s++; - } else if (c == '+') + while (isspace(c)); + if (c == '-') + { + neg = 1; + c = *s++; + } + else if (c == '+') c = *s++; if ((base == 0 || base == 16) && - c == '0' && (*s == 'x' || *s == 'X')) { - c = s[1]; - s += 2; - base = 16; - } + c == '0' && (*s == 'x' || *s == 'X')) + { + c = s[1]; + s += 2; + base = 16; + } if (base == 0) base = c == '0' ? 8 : 10; - cutoff = (unsigned long)ULONG_MAX / (unsigned long)base; - cutlim = (unsigned long)ULONG_MAX % (unsigned long)base; - for (acc = 0, any = 0;; c = *s++) { - if (isdigit(c)) - c -= '0'; - else if (isalpha(c)) - c -= isupper(c) ? 'A' - 10 : 'a' - 10; - else - break; - if (c >= base) - break; - if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) - any = -1; - else { - any = 1; - acc *= base; - acc += c; + cutoff = (unsigned long) ULONG_MAX / (unsigned long) base; + cutlim = (unsigned long) ULONG_MAX % (unsigned long) base; + + for (acc = 0, any = 0;; c = *s++) + { + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + any = -1; + else + { + any = 1; + acc *= base; + acc += c; + } } - } - if (any < 0) { - acc = ULONG_MAX; - errno = ERANGE; - } else if (neg) + if (any < 0) + { + acc = ULONG_MAX; + errno = ERANGE; + } else if (neg) acc = -acc; if (endptr != 0) - *endptr = any ? (char *)s - 1 : (char *)nptr; + *endptr = any ? (char *) s - 1 : (char *) nptr; return (acc); } #endif /* ACE_LACKS_STRTOUL */ @@ -1018,7 +1025,7 @@ ACE_OS_String::strsncpy (char *dst, const char *src, size_t maxlen) register const char *rsrc = src; register size_t rmaxlen = maxlen; - if (rmaxlen > 0) + if (rmaxlen > 0 && dst != src) { *rdst = '\0'; if (rsrc != 0) @@ -1034,7 +1041,7 @@ ACE_OS_String::strsncpy (ACE_WCHAR_T *dst, const ACE_WCHAR_T *src, size_t maxlen register const ACE_WCHAR_T *rsrc = src; register size_t rmaxlen = maxlen; - if (rmaxlen > 0) + if (rmaxlen > 0 && dst != src) { *rdst = ACE_TEXT_WIDE ('\0'); if (rsrc != 0) diff --git a/ace/Reactor.h b/ace/Reactor.h index 596ba85317a..d7f91a6df46 100644 --- a/ace/Reactor.h +++ b/ace/Reactor.h @@ -534,7 +534,9 @@ public: * Notify <event_handler> of <mask> event. The <ACE_Time_Value> * indicates how long to blocking trying to notify. If <timeout> == * 0, the caller will block until action is possible, else will wait - * until the relative time specified in <timeout> elapses). + * until the relative time specified in <timeout> elapses). Note that + * <mask> can only be one of the pre-defined <ACE_Event_Handler> + * masks, e.g., <READ_MASK>, <WRITE_MASK>, or <EXCEPT_MASK>. */ virtual int notify (ACE_Event_Handler *event_handler = 0, ACE_Reactor_Mask mask = ACE_Event_Handler::EXCEPT_MASK, |