BIND 10 #1774: use uint8_t for "characters" of Name data

BIND 10 Development do-not-reply at isc.org
Wed Jun 27 16:49:00 UTC 2012


#1774: use uint8_t for "characters" of Name data
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  jinmei
  jinmei                             |                Status:  reviewing
                       Type:         |             Milestone:
  defect                             |  Sprint-20120703
                   Priority:         |            Resolution:
  medium                             |             Sensitive:  0
                  Component:         |           Sub-Project:  DNS
  libdns++                           |  Estimated Difficulty:  3
                   Keywords:         |           Total Hours:  0
            Defect Severity:  N/A    |
Feature Depending on Ticket:         |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------

Comment (by jinmei):

 Replying to [comment:12 muks]:

 > > - same sense of comment applies to labelsequence test.  I'd first
 > >   clarify the type of getData() and test data, too.  On top of that
 > >   I'd make overall cleanup.  If it still seems to require casting from
 > >   unsigned char* to char*, something should be wrong.
 >
 > This is because string literals are of type `(const char *)`. They need
 casting to unsigned, but instead of doing it in a dozen places, it is cast
 inside `getDataCheck()`.

 This can be avoided by providing a few-line wrapper function.  See
 my proposed patch: test.diff.

 I also suggest one last update: using uint8_t for Name::offsets_
 (see patch "name.diff").  Using unsigned char is not necessarily
 incorrect, but when we allow `LabelSequence` to be constructed from
 serialized raw data it would be more convenient if it's defined as
 uint8_t (so we can construct it in the unified way either from a
 `Name` or from serialized data).

 If you're okay with these suggestions, please apply them and merge.
 If not, please continue the discussion.

-- 
Ticket URL: <http://bind10.isc.org/ticket/1774#comment:13>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list