Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34450 )
Change subject: string: implement strspn, strcspn, atol
......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34450/7/src/lib/string.c
File src/lib/string.c:
https://review.coreboot.org/c/coreboot/+/34450/7/src/lib/string.c@168
PS7, Line 168: long ret = 0;
: long sign = 1;
Done
Sorry, I don't think this works? Now your result is off by a factor of 10 for positive numbers (because you start with 1 rather than 0), and for negative numbers it doesn't work at all (because you're still adding positive numbers to them). I don't really know what Angel meant here, but I think the way you had it before with two variables is the easiest way to do this. ("Saving" variables generally isn't a good thing to do if readability suffers from it anyway.)
--
To view, visit
https://review.coreboot.org/c/coreboot/+/34450
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id8fa880357124b620bde8884949bd8ffff7d0762
Gerrit-Change-Number: 34450
Gerrit-PatchSet: 8
Gerrit-Owner: Patrick Georgi
pgeorgi@google.com
Gerrit-Reviewer: Angel Pons
th3fanbus@gmail.com
Gerrit-Reviewer: Julius Werner
jwerner@chromium.org
Gerrit-Reviewer: Nitheesh Sekar
nsekar@codeaurora.org
Gerrit-Reviewer: Patrick Georgi
pgeorgi@google.com
Gerrit-Reviewer: Paul Menzel
paulepanter@users.sourceforge.net
Gerrit-Reviewer: Yuji Sasaki
sasakiy@chromium.org
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-Comment-Date: Thu, 08 Aug 2019 21:27:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Angel Pons
th3fanbus@gmail.com
Comment-In-Reply-To: Patrick Georgi
pgeorgi@google.com
Gerrit-MessageType: comment