Commit a85bdb81 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Make ArduinoJson work with msp430.h

msp430.h defines the preprocessor variable "N", which is a frequently
used template parameter name. These two do not go together.
parent ff5cca72
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -141,9 +141,9 @@ class JsonArray : public Internals::JsonPrintable<JsonArray>,
  }

  // Imports a 1D array
  template <typename T, size_t N>
  bool copyFrom(T (&array)[N]) {
    return copyFrom(array, N);
  template <typename T, size_t TN>
  bool copyFrom(T (&array)[TN]) {
    return copyFrom(array, TN);
  }

  // Imports a 1D array
@@ -170,9 +170,9 @@ class JsonArray : public Internals::JsonPrintable<JsonArray>,
  }

  // Exports a 1D array
  template <typename T, size_t N>
  size_t copyTo(T (&array)[N]) const {
    return copyTo(array, N);
  template <typename T, size_t TN>
  size_t copyTo(T (&array)[TN]) const {
    return copyTo(array, TN);
  }

  // Exports a 1D array
+6 −6
Original line number Diff line number Diff line
@@ -49,9 +49,9 @@ class JsonPrintable {
    return printTo(sb);
  }

  template <size_t N>
  size_t printTo(char (&buffer)[N]) const {
    return printTo(buffer, N);
  template <size_t TN>
  size_t printTo(char (&buffer)[TN]) const {
    return printTo(buffer, TN);
  }

  template <typename TString>
@@ -72,9 +72,9 @@ class JsonPrintable {
    return prettyPrintTo(sb);
  }

  template <size_t N>
  size_t prettyPrintTo(char (&buffer)[N]) const {
    return prettyPrintTo(buffer, N);
  template <size_t TN>
  size_t prettyPrintTo(char (&buffer)[TN]) const {
    return prettyPrintTo(buffer, TN);
  }

  template <typename Print>
+2 −2
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@ template <typename T>
struct IsArray<T[]> {
  static const bool value = true;
};
template <typename T, size_t N>
struct IsArray<T[N]> {
template <typename T, size_t TN>
struct IsArray<T[TN]> {
  static const bool value = true;
};
}