trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #560: JIRA 2086 Support for largeint unsign...
Date Tue, 28 Jun 2016 22:13:06 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/560#discussion_r68853901
  
    --- Diff: core/sql/common/Int64.cpp ---
    @@ -136,6 +140,22 @@ void convertInt64ToAscii(const Int64 &src, char* tgt)
       strcpy(tgt, s);
     }
     
    +void convertUInt64ToAscii(const UInt64 &src, char* tgt)
    +{
    +  UInt64 temp = src;
    +  char buffer[21];
    +  char *s = &buffer[21];
    +  *--s = '\0';
    +  do {
    +    char c = (char) (temp % 10);
    +    if (c < 0)
    +      c = -c;
    --- End diff --
    
    I'm trying to imagine why c would ever be negative. Seems like since temp is unsigned,
we'd always see 0, ... 9 as possible values from temp % 10?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message