From 7968022c239363590b673d187cbbadabd7d02426 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 20 Jan 2019 00:30:34 +0100 Subject: [PATCH] Fix some warnings comparing char against EOF This is not possible on platforms where char is unsigned. In cases where fail() is checked, it is also unnecessary. --- panda/src/downloader/documentSpec.cxx | 4 ++-- panda/src/downloader/httpDate.cxx | 2 +- panda/src/pnmimagetypes/pnmFileTypePNM.cxx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/src/downloader/documentSpec.cxx b/panda/src/downloader/documentSpec.cxx index 34bfe3808d..a27ebe0338 100644 --- a/panda/src/downloader/documentSpec.cxx +++ b/panda/src/downloader/documentSpec.cxx @@ -66,7 +66,7 @@ input(std::istream &in) { // Scan the tag, up to but not including the closing paren. std::string tag; in >> ch; - while (!in.fail() && ch != EOF && ch != ')') { + while (!in.fail() && ch != ')') { tag += ch; // We want to include embedded whitespace, so we use get(). ch = in.get(); @@ -81,7 +81,7 @@ input(std::istream &in) { // Scan the date, up to but not including the closing bracket. if (ch != ']') { std::string date; - while (!in.fail() && ch != EOF && ch != ']') { + while (!in.fail() && ch != ']') { date += ch; ch = in.get(); } diff --git a/panda/src/downloader/httpDate.cxx b/panda/src/downloader/httpDate.cxx index e49769257f..e17c6c06d6 100644 --- a/panda/src/downloader/httpDate.cxx +++ b/panda/src/downloader/httpDate.cxx @@ -279,7 +279,7 @@ input(std::istream &in) { string date; ch = in.get(); - while (!in.fail() && ch != EOF && ch != '"') { + while (!in.fail() && ch != '"') { date += ch; ch = in.get(); } diff --git a/panda/src/pnmimagetypes/pnmFileTypePNM.cxx b/panda/src/pnmimagetypes/pnmFileTypePNM.cxx index cdc1e62f93..02411c0933 100644 --- a/panda/src/pnmimagetypes/pnmFileTypePNM.cxx +++ b/panda/src/pnmimagetypes/pnmFileTypePNM.cxx @@ -193,7 +193,7 @@ pm_getuint(istream * const ifP) { 'unsigned int'), issue an error message to stderr and abort the program. -----------------------------------------------------------------------------*/ - char ch; + int ch; unsigned int i; // skip whitespace