From 1dd4bd6d2a3ab71872d5b818748be13482180c27 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Wed, 2 Mar 2011 23:45:51 -0500 Subject: [PATCH] Removing Client operator==(int) and operator!=(int) from Ethernet library. http://code.google.com/p/arduino/issues/detail?id=408 --- libraries/Ethernet/Client.cpp | 14 ++------------ libraries/Ethernet/Client.h | 2 -- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/libraries/Ethernet/Client.cpp b/libraries/Ethernet/Client.cpp index 4781bcad9..d65020df7 100644 --- a/libraries/Ethernet/Client.cpp +++ b/libraries/Ethernet/Client.cpp @@ -140,18 +140,8 @@ uint8_t Client::status() { return W5100.readSnSR(_sock); } -// the next three functions are a hack so we can compare the client returned -// by Server::available() to null, or use it as the condition in an -// if-statement. this lets us stay compatible with the Processing network -// library. - -uint8_t Client::operator==(int p) { - return _sock == MAX_SOCK_NUM; -} - -uint8_t Client::operator!=(int p) { - return _sock != MAX_SOCK_NUM; -} +// the next function allows us to use the client returned by +// Server::available() as the condition in an if-statement. Client::operator bool() { return _sock != MAX_SOCK_NUM; diff --git a/libraries/Ethernet/Client.h b/libraries/Ethernet/Client.h index d7f4e7f5c..69e8f4464 100644 --- a/libraries/Ethernet/Client.h +++ b/libraries/Ethernet/Client.h @@ -22,8 +22,6 @@ public: virtual void flush(); void stop(); uint8_t connected(); - uint8_t operator==(int); - uint8_t operator!=(int); operator bool(); friend class Server;