Ver código fonte

Fixed warnings in Visual Studio

Benoit Blanchon 11 anos atrás
pai
commit
3b77dbbed7

+ 3 - 0
include/ArduinoJson/Internals/JsonWriter.hpp

@@ -56,6 +56,9 @@ class JsonWriter {
 
   Print &_sink;
   size_t _length;
+
+ private:
+  JsonWriter &operator=(const JsonWriter &);  // cannot be assigned
 };
 }
 }

+ 5 - 3
include/ArduinoJson/Internals/Prettyfier.hpp

@@ -22,9 +22,7 @@ class Prettyfier : public Print {
   virtual size_t write(uint8_t);
 
  private:
-  uint8_t _previousChar;
-  IndentedPrint& _sink;
-  bool _inString;
+  Prettyfier& operator=(const Prettyfier&);  // cannot be assigned
 
   bool inEmptyBlock() { return _previousChar == '{' || _previousChar == '['; }
 
@@ -39,6 +37,10 @@ class Prettyfier : public Print {
   size_t handleNormalChar(uint8_t);
   size_t indentIfNeeded();
   size_t unindentIfNeeded();
+
+  uint8_t _previousChar;
+  IndentedPrint& _sink;
+  bool _inString;
 };
 }
 }

+ 3 - 0
test/Printers.cpp

@@ -17,6 +17,9 @@ class StreamPrintAdapter : public Print {
   }
 
  private:
+  // cannot be assigned
+  StreamPrintAdapter& operator=(const StreamPrintAdapter&);
+
   std::ostream& _os;
 };