[haiku-development] Re: DeskCalc Improvements (was need strtold() function)

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 31 Dec 2009 16:47:34 +0100

On 2009-12-31 at 14:50:44 [+0100], John Scipione <jscipione@xxxxxxxxx> wrote:
> On Thu, Dec 31, 2009 at 7:32 AM, Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
> >
> > On 2009-12-31 at 10:01:31 [+0100], Stephan Assmus <superstippi@xxxxxx> 
> > wrote:
> >> Thanks for your work! Can you post another version where you use spaces
> >> instead of tabs? (Maybe it's just an editor setting?)
> >
> > Er, tabs instead of spaces. Already "tasted" the New Year's Eve punch? ;-)

> I converted tabs to spaces.

No, please use tabs as our coding style guide requires. Stephan seemed to be 
somewhat confused suggesting otherwise.

> I put a space after the while and if
> statements. I changed decimalPlaces to be a uint32 instead of an int32
> and took out the check about decimalPlaces being < 0. I didn't quite
> understand what you were trying to say about the allocation check
> being "copy&paste left-over" but in my defense I didn't write that
> code, I just moved it.

What Stephan was referring to:

+    char buffer[decimalPlaces + 15];
+    value.toString(buffer, decimalPlaces);
+    if (buffer == NULL)
+        throw ParseException("out of memory", 0);

buffer cannot be NULL, since it is allocated on the stack.

CU, Ingo

Other related posts: