Browse Source

bin2c: fix compilation warning

rdb 6 years ago
parent
commit
191a5b09e9
1 changed files with 2 additions and 3 deletions
  1. 2 3
      pandatool/src/miscprogs/binToC.cxx

+ 2 - 3
pandatool/src/miscprogs/binToC.cxx

@@ -99,8 +99,7 @@ run() {
   out << std::hex << std::setfill('0');
   out << std::hex << std::setfill('0');
   int count = 0;
   int count = 0;
   int col = 0;
   int col = 0;
-  unsigned int ch;
-  ch = in.get();
+  int ch = in.get();
   while (!in.fail() && ch != EOF) {
   while (!in.fail() && ch != EOF) {
     if (col == 0) {
     if (col == 0) {
       out << "\n  ";
       out << "\n  ";
@@ -110,7 +109,7 @@ run() {
     } else {
     } else {
       out << ", ";
       out << ", ";
     }
     }
-    out << "0x" << std::setw(2) << ch;
+    out << "0x" << std::setw(2) << (unsigned int)ch;
     col++;
     col++;
     count++;
     count++;
     ch = in.get();
     ch = in.get();