avro-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [avro] emkornfield commented on a change in pull request #1153: AVRO-3051: C++ Reader and writers modernized
Date Tue, 23 Mar 2021 15:43:05 GMT

emkornfield commented on a change in pull request #1153:
URL: https://github.com/apache/avro/pull/1153#discussion_r599691253



##########
File path: lang/c++/impl/DataFile.cc
##########
@@ -306,20 +306,20 @@ void DataFileReaderBase::init(const ValidSchema& readerSchema)
 
 static void drain(InputStream& in)
 {
-    const uint8_t *p = 0;
+    const uint8_t *p = nullptr;
     size_t n = 0;
     while (in.next(&p, &n));
 }
 
 char hex(unsigned int x)
 {
-    return x + (x < 10 ? '0' :  ('a' - 10));
+    return static_cast<char>(x + (x < 10 ? '0' :  ('a' - 10)));
 }
 
 std::ostream& operator << (std::ostream& os, const DataFileSync& s)
 {
-    for (size_t i = 0; i < s.size(); ++i) {
-        os << hex(s[i] / 16)  << hex(s[i] % 16) << ' ';
+    for (unsigned char i : s) {

Review comment:
       it looks like elsewhere uint8_t might be used of rhte same type?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message