Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #18279

Re: D'oh! Oh, for lack of a code review.

From Don Y <this@is.not.me.com>
Newsgroups comp.arch.embedded
Subject Re: D'oh! Oh, for lack of a code review.
Date 2014-09-22 16:15 -0700
Organization Aioe.org NNTP Server
Message-ID <lvqaou$gu1$1@speranza.aioe.org> (permalink)
References <hIqdnZIpiN1C3ILJnZ2dnUVZ5rKdnZ2d@giganews.com> <ZNITv.377715$yK.115461@fx14.iad>

Show all headers | View raw


On 9/21/2014 4:02 PM, Clifford Heath wrote:
> On 22/09/14 07:23, Tim Wescott wrote:
>> See if YOU can find the error!
>> if (_port.elapsed() > 0 &&
>>     _port.elapsed() < ((_port.clockHz() * 50LL) / 1000000))
>
> 0 and 1 will always be less than ((_port.clockHz() * 50LL) / 1000000)
> Do I get a cookie?

Actually, there are more fundamental bugs.  Was the OP's intent to invoke
the "elapsed" method on "port" *once* or *twice*?  Or, twice iff the
first invocation yields 0?  Side-effects?  etc.

> This is why we should be using a language with a proper type system.

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

D'oh!  Oh, for lack of a code review. Tim Wescott <seemywebsite@myfooter.really> - 2014-09-21 16:23 -0500
  Re: D'oh!  Oh, for lack of a code review. Clifford Heath <no.spam@please.net> - 2014-09-22 09:02 +1000
    Re: D'oh!  Oh, for lack of a code review. Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2014-09-22 00:21 +0000
      Re: D'oh!  Oh, for lack of a code review. Clifford Heath <no.spam@please.net> - 2014-09-22 10:58 +1000
        Re: D'oh! Oh, for lack of a code review. Les Cargill <lcargill99@comcast.com> - 2014-09-21 22:28 -0500
      Re: D'oh!  Oh, for lack of a code review. rickman <gnuarm@gmail.com> - 2014-09-21 22:16 -0400
    Re: D'oh!  Oh, for lack of a code review. Paul E Bennett <Paul_E.Bennett@topmail.co.uk> - 2014-09-22 01:28 +0100
      Re: D'oh!  Oh, for lack of a code review. Don Y <this@is.not.me.com> - 2014-09-21 20:16 -0700
        Re: D'oh!  Oh, for lack of a code review. Bruce Varley - 2014-09-22 11:51 +0800
          Re: D'oh!  Oh, for lack of a code review. Don Y <this@is.not.me.com> - 2014-09-21 21:19 -0700
        Re: D'oh!  Oh, for lack of a code review. Paul E Bennett <Paul_E.Bennett@topmail.co.uk> - 2014-09-22 22:20 +0100
          Re: D'oh!  Oh, for lack of a code review. Don Y <this@is.not.me.com> - 2014-09-22 16:28 -0700
            Re: D'oh!  Oh, for lack of a code review. rickman <gnuarm@gmail.com> - 2014-09-23 00:43 -0400
        Re: D'oh!  Oh, for lack of a code review. rickman <gnuarm@gmail.com> - 2014-09-22 18:48 -0400
          Re: D'oh!  Oh, for lack of a code review. Don Y <this@is.not.me.com> - 2014-09-22 15:59 -0700
            Re: D'oh!  Oh, for lack of a code review. rickman <gnuarm@gmail.com> - 2014-09-23 00:49 -0400
    Re: D'oh!  Oh, for lack of a code review. Don Y <this@is.not.me.com> - 2014-09-22 16:15 -0700
      Re: D'oh!  Oh, for lack of a code review. Don Y <this@is.not.me.com> - 2014-09-22 16:30 -0700
  Re: D'oh!  Oh, for lack of a code review. David Brown <david.brown@hesbynett.no> - 2014-09-22 10:22 +0200
  Re: D'oh!  Oh, for lack of a code review. Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2014-09-22 19:08 +0200
    Re: D'oh!  Oh, for lack of a code review. Tim Wescott <seemywebsite@myfooter.really> - 2014-09-22 13:59 -0500
      Re: D'oh!  Oh, for lack of a code review. Paul Rubin <no.email@nospam.invalid> - 2014-09-22 12:18 -0700
        Re: D'oh!  Oh, for lack of a code review. tim <tim@seemywebsite.com> - 2014-09-23 00:27 -0500
          Re: D'oh!  Oh, for lack of a code review. Robert Wessel <robertwessel2@yahoo.com> - 2014-09-23 18:35 -0500
      Re: D'oh!  Oh, for lack of a code review. David Brown <david.brown@hesbynett.no> - 2014-09-22 21:26 +0200
  Re: D'oh!  Oh, for lack of a code review. John Speth <johnspeth@yahoo.com> - 2014-09-22 16:24 -0700
    Re: D'oh!  Oh, for lack of a code review. Don Y <this@is.not.me.com> - 2014-09-22 16:34 -0700
    Re: D'oh!  Oh, for lack of a code review. rickman <gnuarm@gmail.com> - 2014-09-23 01:11 -0400

csiph-web