Fix warning messages in restrict_and_check_grant() to include the column name
when warning about column-level privileges.  This is more useful than before
and makes the apparent duplication complained of by Piyush Newe not so
duplicate.  Also fix lack of quote marks in a related message text.

Back-patch to 8.4, where column-level privileges were introduced.

Stephen Frost

--- src/backend/catalog/aclchk.c
+++ src/backend/catalog/aclchk.c
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *	  $PostgreSQL: pgsql/src/backend/catalog/aclchk.c,v 1.163 2010/02/26 02:00:35 momjian Exp $
+ *	  $PostgreSQL: pgsql/src/backend/catalog/aclchk.c,v 1.164 2010/03/06 23:10:42 tgl Exp $
  *
  * NOTES
  *	  See acl.h.
@@ -304,24 +304,60 @@
 	if (is_grant)
 	{
 		if (this_privileges == 0)
-			ereport(WARNING,
-					(errcode(ERRCODE_WARNING_PRIVILEGE_NOT_GRANTED),
-				  errmsg("no privileges were granted for \"%s\"", objname)));
+	   	{
+			if (objkind == ACL_KIND_COLUMN && colname)
+				ereport(WARNING,
+						(errcode(ERRCODE_WARNING_PRIVILEGE_NOT_GRANTED),
+						 errmsg("no privileges were granted for column \"%s\" of relation \"%s\"",
+								colname, objname)));
+			else
+				ereport(WARNING,
+						(errcode(ERRCODE_WARNING_PRIVILEGE_NOT_GRANTED),
+						 errmsg("no privileges were granted for \"%s\"",
+								objname)));
+		}
 		else if (!all_privs && this_privileges != privileges)
-			ereport(WARNING,
-					(errcode(ERRCODE_WARNING_PRIVILEGE_NOT_GRANTED),
-			 errmsg("not all privileges were granted for \"%s\"", objname)));
+		{
+			if (objkind == ACL_KIND_COLUMN && colname)
+				ereport(WARNING,
+						(errcode(ERRCODE_WARNING_PRIVILEGE_NOT_GRANTED),
+						 errmsg("not all privileges were granted for column \"%s\" of relation \"%s\"",
+								colname, objname)));
+			else
+				ereport(WARNING,
+						(errcode(ERRCODE_WARNING_PRIVILEGE_NOT_GRANTED),
+						 errmsg("not all privileges were granted for \"%s\"",
+								objname)));
+		}
 	}
 	else
 	{
 		if (this_privileges == 0)
-			ereport(WARNING,
-					(errcode(ERRCODE_WARNING_PRIVILEGE_NOT_REVOKED),
-			  errmsg("no privileges could be revoked for \"%s\"", objname)));
+		{
+			if (objkind == ACL_KIND_COLUMN && colname)
+				ereport(WARNING,
+						(errcode(ERRCODE_WARNING_PRIVILEGE_NOT_REVOKED),
+						 errmsg("no privileges could be revoked for column \"%s\" of relation \"%s\"",
+								colname, objname)));
+			else
+				ereport(WARNING,
+						(errcode(ERRCODE_WARNING_PRIVILEGE_NOT_REVOKED),
+						 errmsg("no privileges could be revoked for \"%s\"",
+								objname)));
+		}
 		else if (!all_privs && this_privileges != privileges)
-			ereport(WARNING,
-					(errcode(ERRCODE_WARNING_PRIVILEGE_NOT_REVOKED),
-					 errmsg("not all privileges could be revoked for \"%s\"", objname)));
+		{
+			if (objkind == ACL_KIND_COLUMN && colname)
+				ereport(WARNING,
+						(errcode(ERRCODE_WARNING_PRIVILEGE_NOT_REVOKED),
+						 errmsg("not all privileges could be revoked for column \"%s\" of relation \"%s\"",
+								colname, objname)));
+			else
+				ereport(WARNING,
+						(errcode(ERRCODE_WARNING_PRIVILEGE_NOT_REVOKED),
+						 errmsg("not all privileges could be revoked for \"%s\"",
+								objname)));
+		}
 	}

 	return this_privileges;
@@ -3046,7 +3082,7 @@
 		case ACLCHECK_NO_PRIV:
 			ereport(ERROR,
 					(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
-					 errmsg("permission denied for column %s of relation %s",
+					 errmsg("permission denied for column \"%s\" of relation \"%s\"",
 							colname, objectname)));
 			break;
 		case ACLCHECK_NOT_OWNER:


* subversion/libsvn_diff/diff_file.c

* subversion/libsvn_diff/diff_file.c

  Convert the tabs I just committed...  Remove trailing whitespace.

--- subversion/libsvn_diff/diff_file.c
+++ subversion/libsvn_diff/diff_file.c
@@ -96,7 +96,7 @@
 map_or_read_file(apr_file_t **file,
                  MMAP_T_PARAM(mm)
                  char **buffer, apr_off_t *size,
-		 const char *path, apr_pool_t *pool)
+                 const char *path, apr_pool_t *pool)
 {
   apr_finfo_t finfo;
   apr_status_t rv;
@@ -135,7 +135,7 @@
       if (rv != APR_SUCCESS)
         {
           return svn_error_createf(rv, NULL, "Failed to read file '%s'.",
-	                           path);
+                                   path);
         }

       /* Since we have the entire contents of the file we can
@@ -146,7 +146,7 @@
         {
           return svn_error_createf(rv, NULL, "Failed to close file '%s'.",
                                    path);
-	}
+        }

       *file = NULL;
     }
@@ -1037,8 +1037,8 @@
               return svn_error_createf(rv, NULL, "Failed to close file '%s'.",
                                        baton.path[idx]);
             }
-	}
-    }
-
-  return SVN_NO_ERROR;
-}
+        }
+    }
+
+  return SVN_NO_ERROR;
+}


Fix CLANG issue

Fix CLANG issue

--- src/PDPage.c
+++ src/PDPage.c
@@ -126,10 +126,10 @@
             }
         }

-    } else {
+    } else if (kids) {

         // find last entry in stack
-        for (s = kids; s && s->prev; s = s->prev) ;
+        for (s = kids; s->prev; s = s->prev) ;
         pd_stack dup = pd_stack_copy(s->info);
         sprintf(buf, "%ld", PDObjectGetObID(importedObject));
         free(as(pd_stack, dup->prev->info)->prev->info);


'StaticallyBufferedStringLight' module: hash caching bugs fixed, hash calculation optimized & redesigned

--- StaticallyBufferedStringLight.h
+++ StaticallyBufferedStringLight.h
@@ -1,5 +1,7 @@
 #ifndef StaticallyBufferedStringLightH
 #define StaticallyBufferedStringLightH
+
+//// [!] Version 1.01 [!]

 #include "..\..\FuncUtils.h"
 #include "..\..\HashUtils.h"
@@ -11,6 +13,7 @@

 EXEC_MEMBER_FUNC_IF_PRESENT(getHashIfKnown, size_t())
 EXEC_MEMBER_FUNC_IF_PRESENT(hashAlgoID, size_t())
+EXEC_MEMBER_FUNC_IF_PRESENT(setHash, false)

 //// Forward declaration
 class HashCodeChecker;
@@ -29,6 +32,10 @@
   //     support implementation to the original class [!]
 public:

+  // Share access
+  template<typename TOtherElemType, const size_t OtherMaxLen>
+  friend class StaticallyBufferedStringLight;
+
   typedef StaticallyBufferedStringLight TThisType;

   ADD_HASHER_FOR(TThisType, hasher)
@@ -40,6 +47,7 @@
                 std::is_same<char16_t, TElemType>::value ||
                 std::is_same<char32_t, TElemType>::value,
                 "'TElemType' SHOULD be 'char' / 'wchar_t' / 'char16_t' / 'char32_t'");
+  //// [?!] Is FNV1a works correclty ONLY wit the 1 byt chars?? [?!]
   typedef typename std::char_traits<TElemType> traits_type;

   typedef AllocatorInterface<TElemType> allocator_type; // mock object type
@@ -106,8 +114,10 @@
                                 const size_t len = std::string::npos) throw() {
     static_assert(!(BUF_SIZE % 8U), "Incorrect 'BUF_SIZE'");
     clear();
-    if (pos >= str.length()) return;
+    const auto otherLen = str.length();
+    if (pos >= otherLen) return;
     append(str.c_str() + pos, len);
+    tryShareHash(str); // ONLY if fully copied
   }

   //// Special implementations with the 'nullptr_t' is required
@@ -142,14 +152,17 @@
     // prevents the possible self-copying
     if (static_cast<void*>(this) == static_cast<const void*>(&str)) return;
     */
-    return (*this = str.c_str()); // invoking 'operator=(const TElemType* const str)'
+    *this = str.c_str(); // invoking 'operator=(const TElemType* const str)'
+    tryShareHash(str);
+    return *this;
   }

   // Can't 'steal' resources, so just copying
   //  [http://en.cppreference.com/w/cpp/language/move_operator]
   template<typename TStorageType>
   StaticallyBufferedStringLight& operator=(const TStorageType&& str) throw() {
-    return (*this = str.c_str()); // invoking 'operator=(const TElemType* const str)'
+    *this = str; // invoking 'operator=(const TStorageType& str)'
+    return *this;
   }

   // Make ONE symbol str.
@@ -176,7 +189,9 @@
   //   (like std::string, StaticallyBufferedStringLight<ANY SIZE> etc)
   template<class TStorageType>
   StaticallyBufferedStringLight& operator+=(const TStorageType& str) throw() {
-    return (*this += str.c_str()); // invoking 'operator+=(const TElemType* const str)'
+    *this += str.c_str(); // invoking 'operator+=(const TElemType* const str)'
+    tryShareHash(str);
+    return *this;
   }

   // Adds ONE symbol
@@ -196,7 +211,10 @@
              std::enable_if<std::is_arithmetic<TValueType>::value &&
                             !std::is_pointer<TValueType>::value && // 'std::nullptr_t' is OK
                             !std::is_same<TValueType, TElemType>::value>::type>
-  StaticallyBufferedStringLight& append(const TValueType value) throw() {
+  StaticallyBufferedStringLight& append(const TValueType value,
+                                        size_t* const actuallyAppended = nullptr) throw()
+  {
+    if (actuallyAppended) *actuallyAppended = size_t(); // reset
     const auto spaceLeft = std::extent<decltype(data_)>::value - length_;
     if (spaceLeft < 2U) { // NO actual space left (1 for the str. terminator)
       truncated_ = true;
@@ -238,16 +256,17 @@
     getMask();
     if (returnFlag) return *this;

+    auto const originEnd = data_ + length_;
     #ifdef _MSC_VER // MS VS specific
       // Number of characters stored in buffer, not counting the terminating null character
-      auto count = _snprintf_s(data_ + length_, spaceLeft, _TRUNCATE, mask, value);
+      auto count = _snprintf_s(originEnd, spaceLeft, _TRUNCATE, mask, value);
       if (count < 0) { // if NOT enough space left
         count = spaceLeft - 1U;
         truncated_ = true;
       }
     #else
       // Number of characters that properly SHOULD have been written (except terminating null character)
-      auto count = snprintf(data_ + length_, spaceLeft, mask, value);
+      auto count = snprintf(originEnd, spaceLeft, mask, value);
       if (count < 0) {
         data_[length_] = '\0'; // ensure NO actual changes
         return *this; // encoding error
@@ -257,12 +276,15 @@
         truncated_ = true;
       }
     #endif
-
+    // If actually updated AND hash WAS already known -
+    //  update hash, using accumulation mechanics [OPTIMIZATION]
+    if (!modified_ && count > 0)
+      hash_ = MathUtils::getFNV1aHash(originEnd, hash_, size_t() < length_); // accumulte if was't empty
     length_ += count;
-    modified_ = true;
-    return *this;
-  }
-
+    if (actuallyAppended) *actuallyAppended = static_cast<size_t>(count);
+    return *this;
+  }
+
   // Same as the 'append(const TValueType value)'
   template<typename TValueType,
            class = typename // remove from the overload resolution to avoid an ambiguity
@@ -279,6 +301,10 @@
     return *this;
   }

+  //// OPTIMIZATION/REDESIGN HINT: add parallel hash. code calc. during the strs. comparing
+  ////  (AND other similar funcs)
+  //// Partial hash. can be also calculated (using 'std::pair' like 'size_t charIdx', 'size_t partHash')
+
   // 'str' SHOULD points to the POD C str.
   // [!] Less effective, then 'operator==(const TElemType (&str)[ArrayElemCount])' [!]
   bool operator==(const TElemType* const str) const throw() {
@@ -336,6 +362,7 @@

     // Using hash code. algo. ID to identify if the same algo. is used by the 'str' instance
     // OPTIMIZATION HINT: use C++14 'constexpr' here
+    // HINT: static. check also if the storage str. type size <= sizeof(size_t) (to fit hash.)
     static const auto SAME_HASHING_ = (hashAlgoID() == hashAlgoID::ExecIfPresent(str));
     if (SAME_HASHING_) {
       const auto thisHash = getHashIfKnown(); // ONLY if already calculated
@@ -354,11 +381,17 @@
     static const auto SAME_CHAR_TYPE_ = // remove cv and ref.
       std::is_same<typename std::decay<decltype(*c_str())>::type,
                    typename std::decay<decltype(*str.c_str())>::type>::value;
+    auto result = false;
     switch (SAME_CHAR_TYPE_) {
-      case true: return isEqualMemD<>(data_, str.c_str(), sizeof(*data_) * length());
+      case true: result = isEqualMemD<>(data_, str.c_str(), sizeof(*data_) * length());
       // Diff. types: call 'operator==(const TOtherElemType* const str)'
-      default: return *this == str.c_str();
-    }
+      default: result = (*this == str.c_str());
+    }
+    if (result && SAME_HASHING_) { // equal AND uses same hashig algo.
+      const auto thisHash = getHashIfKnown(); // ONLY if already calculated [get possibly updated]
+      if (thisHash) setHash::ExecIfPresent(str, thisHash); // if relevant - share
+    }
+    return result;
   }

   template<typename TStorageType>
@@ -371,38 +404,27 @@
   //       (https://msdn.microsoft.com/ru-ru/library/5704bbxw(v=vs.100).aspx) [!]
   // HINT: we can also provide actually appended elems count
   // Zero 'count' means to attempt to copy ALL the possible elems from a 'str' (default)
-  StaticallyBufferedStringLight& append(const TElemType* str, size_t count = -1) throw() {
+  StaticallyBufferedStringLight& append(const TElemType* str, size_t count = -1,
+                                        size_t* const actuallyAppended = nullptr) throw() {
+    if (actuallyAppended) *actuallyAppended = size_t(); // reset
     if (!str || !*str) return *this;
     if (length_ >= MAX_LEN_) { // buff. end
       truncated_ = true;
       return *this;
     }
-    if (!count) count = std::numeric_limits<decltype(count)>::max(); // replace value
-
-    auto const strEnd = data_ + length_;
+    if (!count) count = std::numeric_limits<decltype(count)>::max(); // replace value [!IMPORTANT!]
+
+    auto const strEnd = data_ + length_; // original
     if (checkAddrIfInternal(str) && str < strEnd) { // if 'str' points to the substr. of 'data_'
       const decltype(count) restrictCount = strEnd - str; // restrict the count of chars to copy
       if (count > restrictCount) count = restrictCount; // update limit (if req.)
     }
-    auto currElem = *str++;
     auto actuallyCopiedCount = size_t();
     do {
-      // IN FUTURE: use 'push_back' instead of manually adding an elem.
-      //  (if so, req. to modify this code - remove redundant checks)
-      data_[length_++] = currElem;
+      if (!push_back(*str++)) break;
       if (++actuallyCopiedCount >= count) break; // stop at 'count'
-
-      currElem = *str++;
-      if (!currElem) break; // stop at '\0'
-
-      if (length_ >= MAX_LEN_) { // buff. end
-        truncated_ = true;
-        break;
-      }
     } while (true);
-    data_[length_] = '\0';
-    modified_ = actuallyCopiedCount > size_t();
-
+    if (actuallyAppended) *actuallyAppended = actuallyCopiedCount;
     return *this;
   }

@@ -411,7 +433,7 @@
     modified_ = false;

     length_ = size_t();
-    hash_ = size_t();
+    hash_ = size_t(); // hash of an empty str. SHOULD be zero

     *data_ = TElemType();
   }
@@ -472,7 +494,7 @@
   };

   #define PLACEHOLDER // to remove the warning
-  AT(PLACEHOLDER);
+  AT(PLACEHOLDER); // [!] CAN break hash caching mechanics, so use this at your own risk [!]
   AT(const);

   //// [!] If using none-const version of the 'at' OR 'operator[]' etc
@@ -482,6 +504,7 @@
   ////  AND protects the instance of ANY harmfull effects

   TElemType& operator[](const size_t pos) throw() {
+    // Compromise hash manually?? NO, better relay on the end user
     return at(pos);
   }

@@ -521,8 +544,13 @@
     }
     data_[length_++] = c;
     data_[length_] = TElemType();
-    modified_ = true;
-
+
+    // If hash WAS already known - update, using accumulation mechanics [OPTIMIZATION]
+    if (!modified_) {
+      if (decltype(length_)(1U) == length_)// if WAS empty
+        hash_ = MathUtils::getFNV1aStdOffsetBasis(); // prepare hash
+      MathUtils::FNV1aAccumulate(hash_, c); // add last
+    }
     return true;
   }

@@ -531,10 +559,11 @@
   TElemType pop_back() throw() {
     if (!length_) return TElemType();

-    const char c = data_[length_ - 1U];
-    data_[--length_] = TElemType();
-    modified_ = true;
-
+    const auto c = data_[--length_];
+    data_[length_] = TElemType();
+    // [!] We can NOT simply rollback the hash here, as the number could be easily overflowed
+    //      during the hash code calculation (deaccumulation mechanics MAY did NOT work correctly) [!]
+    length_ <= decltype(length_)() ? clear() : modified_ = true;
     return c;
   }

@@ -545,7 +574,7 @@
     static_assert(1U == sizeof(TElemType), "'TElemType' SHOULD be 1 byte long!");

     if (modified_) { // recalc. rather then returning cached value
-      hash_ = MathUtils::getFNV1aHash(data_);
+      hash_ = MathUtils::getFNV1aHash(data_); // [!] FNV-1a algo. used NOT ONLY in that func. [!]
       modified_ = false;
     }
     return hash_;
@@ -564,8 +593,18 @@

   // NEVER recalculates hash
   // Returns zero if actual hash is unknown OR if str. is empty
+  //  (what if actual hash is zero?? possible very rare case)
   size_t getHashIfKnown() const throw() {
     return modified_ ? size_t() : hash_;
+  }
+
+  // [!] Unsafe! Do NOT use OR use at your own risk [!]
+  bool setHash(const size_t hash) const throw() {
+    if (!modified_) // curr. hash value is relevant
+      assert(hash_ == hash); // DEBUG check ONLY
+    hash_ = hash;
+    modified_ = false;
+    return true;
   }

   // Manually setting '\0' is NOT allowed
@@ -575,6 +614,8 @@
     if (c == data_[pos]) return true; // already

     data_[pos] = c;
+    // NO way to easily rehash here
+    //  (store a table of the intermediate hashes to simplify the hash code recalc.??)
     modified_ = true;
     return true;
   }
@@ -657,6 +698,8 @@
     }
   }

+  //// [!] Using a none-const iterators to change the str. content
+  ////      CAN break hash caching mechanics, so use this at your own risk [!]
   iterator begin() throw() {
     return std::move(iterator(this));
   }
@@ -711,6 +754,22 @@

 private:

+  template<class TStorageType>
+  // If possible; strs. SHOULD be equal AND use the same hashing algo!
+  bool tryShareHash(const TStorageType& storage) const throw() {
+    if (truncated_ || length() != storage.length()) return false; // NOT fully copied, NOT equal
+
+    // Using hash code. algo. ID to identify if the same algo. is used by the 'storage' instance
+    // OPTIMIZATION HINT: use C++14 'constexpr' here
+    // HINT: static. check also if the storage str. type size <= sizeof(size_t) (to fit hash.)
+    static const auto SAME_HASHING_ = (hashAlgoID() == hashAlgoID::ExecIfPresent(storage));
+    if (!SAME_HASHING_) return false; // diff. algo.
+
+    const auto thisHash = getHashIfKnown(); // ONLY if already calculated
+    if (!thisHash) return false; // NOT relevant [a very rare 'relevant zero hash.' error is possible]
+    return setHash::ExecIfPresent(storage, thisHash); // if relevant - share
+  }
+
   // Returns true if the provided address lies withing the internal buffer
   // Used to check buffer overlapping
   bool checkAddrIfInternal(const TElemType* const addr) const throw() {
@@ -725,7 +784,7 @@
   mutable bool modified_;

   size_t length_;
-  mutable size_t hash_;
+  mutable size_t hash_; // treat hash. code properly on adding new str. changing routines

   TElemType data_[BUF_SIZE];
 };


* subversion/libsvn_diff/diff_file.c

* subversion/libsvn_diff/diff_file.c

  Convert the tabs I just committed...  Remove trailing whitespace.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@845703 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_diff/diff_file.c
+++ subversion/libsvn_diff/diff_file.c
@@ -90,13 +90,13 @@
 #define MMAP_T_PARAM(NAME)
 #define MMAP_T_ARG(NAME)
 #endif
-
+
 static
 svn_error_t *
 map_or_read_file(apr_file_t **file,
                  MMAP_T_PARAM(mm)
                  char **buffer, apr_off_t *size,
-		 const char *path, apr_pool_t *pool)
+                 const char *path, apr_pool_t *pool)
 {
   apr_finfo_t finfo;
   apr_status_t rv;
@@ -126,16 +126,16 @@
        */
     }
 #endif /* APR_HAS_MMAP */
-
+
    if (*buffer == NULL && finfo.size > 0)
     {
       *buffer = apr_palloc(pool, finfo.size);
-
+
       rv = apr_file_read_full(*file, *buffer, finfo.size, NULL);
       if (rv != APR_SUCCESS)
         {
           return svn_error_createf(rv, NULL, "Failed to read file '%s'.",
-	                           path);
+                                   path);
         }

       /* Since we have the entire contents of the file we can
@@ -146,7 +146,7 @@
         {
           return svn_error_createf(rv, NULL, "Failed to close file '%s'.",
                                    path);
-	}
+        }

       *file = NULL;
     }
@@ -369,11 +369,11 @@
   apr_file_t *file[2];

   apr_off_t   current_line[2];
-
+
   char        buffer[2][4096];
   apr_size_t  length[2];
   char       *curp[2];
-
+
   apr_off_t   hunk_start[2];
   apr_off_t   hunk_length[2];
   svn_stringbuf_t *hunk;
@@ -393,7 +393,7 @@
 static
 svn_error_t *
 svn_diff__file_output_unified_line(svn_diff__file_output_baton_t *baton,
-                                   svn_diff__file_output_unified_type_e type,
+                                   svn_diff__file_output_unified_type_e type,
                                    int idx)
 {
   char *curp;
@@ -401,7 +401,7 @@
   apr_size_t length;
   apr_status_t rv;
   svn_boolean_t bytes_processed = FALSE;
-
+
   length = baton->length[idx];
   curp = baton->curp[idx];

@@ -409,12 +409,12 @@
    * This way we fake output of context at EOF
    */
   baton->current_line[idx]++;
-
+
   if (length == 0 && apr_file_eof(baton->file[idx]))
     {
       return SVN_NO_ERROR;
     }
-
+
   do
     {
       if (length > 0)
@@ -440,7 +440,7 @@
                   break;
                 }
             }
-
+
           eol = memchr(curp, '\n', length);

           if (eol != NULL)
@@ -468,7 +468,7 @@
             {
               svn_stringbuf_appendbytes(baton->hunk, curp, length);
             }
-
+
           bytes_processed = TRUE;
         }

@@ -520,10 +520,10 @@
   target_line = baton->hunk_start[0] + baton->hunk_length[0]
                 + SVN_DIFF__UNIFIED_CONTEXT_SIZE;

-  /* Add trailing context to the hunk */
+  /* Add trailing context to the hunk */
   while (baton->current_line[0] < target_line)
     {
-      SVN_ERR(svn_diff__file_output_unified_line(baton,
+      SVN_ERR(svn_diff__file_output_unified_line(baton,
                 svn_diff__file_output_unified_context, 0));
     }

@@ -555,7 +555,7 @@
     }

   apr_file_printf(baton->output_file, " @@\n");
-
+
   /* Output the hunk content */
   hunk_len = baton->hunk->len;
   rv = apr_file_write(baton->output_file, baton->hunk->data, &hunk_len);
@@ -600,9 +600,9 @@
       SVN_ERR(svn_diff__file_output_unified_flush_hunk(output_baton));

       output_baton->hunk_start[0] = target_line[0];
-      output_baton->hunk_start[1] = target_line[1] + target_line[0]
+      output_baton->hunk_start[1] = target_line[1] + target_line[0]
                                     - original_start;
-
+
       /* Skip lines until we are at the beginning of the context we want to
          display */
       while (output_baton->current_line[0] < target_line[0])
@@ -622,10 +622,10 @@
   /* Output the context preceding the changed range */
   while (output_baton->current_line[0] < original_start)
     {
-      SVN_ERR(svn_diff__file_output_unified_line(output_baton,
+      SVN_ERR(svn_diff__file_output_unified_line(output_baton,
                 svn_diff__file_output_unified_context, 0));
     }
-
+
   target_line[0] = original_start + original_length;
   target_line[1] = modified_start + modified_length;

@@ -634,7 +634,7 @@
     {
       while (output_baton->current_line[i] < target_line[i])
         {
-          SVN_ERR(svn_diff__file_output_unified_line(output_baton, i == 0
+          SVN_ERR(svn_diff__file_output_unified_line(output_baton, i == 0
                     ? svn_diff__file_output_unified_delete
                     : svn_diff__file_output_unified_insert, i));
         }
@@ -655,7 +655,7 @@

   svn_io_stat(&file_info, path, APR_FINFO_MTIME, pool);
   apr_time_exp_lt(&exploded_time, file_info.mtime);
-
+
   apr_strftime(time_buffer, &time_len, sizeof(time_buffer) - 1,
                "%a %b %e %H:%M:%S %Y", &exploded_time);

@@ -682,8 +682,8 @@
 {
   svn_diff__file_output_baton_t baton;
   int i;
-
-  if (svn_diff_contains_diffs(diff))
+
+  if (svn_diff_contains_diffs(diff))
     {
       memset(&baton, 0, sizeof(baton));
       baton.output_file = output_file;
@@ -693,14 +693,14 @@
       baton.hunk = svn_stringbuf_create("", pool);

       for (i = 0; i < 2; i++)
-        {
+        {
           SVN_ERR( svn_io_file_open(&baton.file[i], baton.path[i],
                                     APR_READ, APR_OS_DEFAULT, pool) );
         }

       if (original_header == NULL)
         {
-          original_header =
+          original_header =
             svn_diff__file_output_unified_default_hdr(pool, original_path);
         }

@@ -720,7 +720,7 @@
       SVN_ERR(svn_diff__file_output_unified_flush_hunk(&baton));

       for (i = 0; i < 2; i++)
-        {
+        {
           apr_status_t rv = apr_file_close(baton.file[i]);
           if (rv != APR_SUCCESS)
             {
@@ -927,7 +927,7 @@
         }

       apr_file_putc('\n', file_baton->output_file);
-
+
       SVN_ERR(svn_diff3__file_output_hunk(baton, 0,
               original_start, original_length));
     }
@@ -991,7 +991,7 @@
                             : apr_psprintf(pool, "||||||| %s", original_path);
   baton.conflict_separator = conflict_separator ? conflict_separator
                              : "=======";
-  baton.conflict_latest = conflict_latest ? conflict_latest
+  baton.conflict_latest = conflict_latest ? conflict_latest
                           : apr_psprintf(pool, ">>>>>>> %s", latest_path);

   baton.display_original_in_conflict = display_original_in_conflict;
@@ -1037,8 +1037,8 @@
               return svn_error_createf(rv, NULL, "Failed to close file '%s'.",
                                        baton.path[idx]);
             }
-	}
-    }
-
-  return SVN_NO_ERROR;
-}
+        }
+    }
+
+  return SVN_NO_ERROR;
+}


[IOT-2175] Fix regression with optional 'pri' property.

The checks added in commit 6758c572ecfa068d953bd3d5ed9614885dae01b1
made 'pri' mandatory again.

Bug: https://jira.iotivity.org/browse/IOT-2175
Change-Id: Idb6137f45bf06910a9789f23c87486df2289abca
Signed-off-by: Todd Malsbary <8856a5d8416dae6d0ae52d024d7a973f628fb21e@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20261
Reviewed-by: Phil Coval <ff46fec9739d31cce915aabcc3a7a2c00eee4d6c@osg.samsung.com>
Tested-by: jenkins-iotivity <d95b56ce41a2e1ac4cecdd398defd7414407cc08@iotivity.org>
Reviewed-by: Dan Mihai <ba8e1833495515b49ded9e20cae80a8129155aa9@microsoft.com>
Reviewed-by: Uze Choi <3a26c91d8a4a3c9e246e43339f4782bb2483aece@samsung.com>

--- resource/csdk/stack/src/ocpayloadparse.c
+++ resource/csdk/stack/src/ocpayloadparse.c
@@ -514,10 +514,8 @@

                 if (OC_STACK_OK == parseResult)
                 {
-                    // pri
+                    // pri - optional
                     err = cbor_value_map_find_value(&epMap, OC_RSRVD_PRIORITY, &curVal);
-                    VERIFY_CBOR_SUCCESS(TAG, err, "to find priority tag");
-                    err = cbor_value_is_valid(&curVal) ? CborNoError : CborUnknownError;
                     VERIFY_CBOR_SUCCESS(TAG, err, "to find priority tag");
                     if (cbor_value_is_valid(&curVal))
                     {


Empress

Empress

--- SubTools/Hidemaru/ShowSetting.c
+++ SubTools/Hidemaru/ShowSetting.c
@@ -64,19 +64,23 @@

 	{
 		char *value = GetValue("HKCU\\Software\\Hidemaruo\\Hidemaru\\Default\\ColorSet");
-		autoBlock_t *bVal;
-		uint r;

-		errorCase(!value);
+		if(!value)
+		{
+			cout("\̐ݒ肪܂B\n");
+		}
+		else
+		{
+			autoBlock_t *bVal = ab_fromHexLine(value);
+			uint r;

-		bVal = ab_fromHexLine(value);
+			ShowColor("\1", bVal, 48);
+			ShowColor("\2", bVal, 84);
+			ShowColor("\3", bVal, 264);
+			ShowColor("\4", bVal, 276);

-		ShowColor("\1", bVal, 48);
-		ShowColor("\2", bVal, 84);
-		ShowColor("\3", bVal, 264);
-		ShowColor("\4", bVal, 276);
-
-		releaseAutoBlock(bVal);
+			releaseAutoBlock(bVal);
+		}
 	}

 	cout("\n");


* subversion/libsvn_ra_dav/session.c (ver_check): Remove unused function.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@852877 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_ra_dav/session.c
+++ subversion/libsvn_ra_dav/session.c
@@ -879,12 +879,6 @@
   svn_ra_dav__get_file_revs
 };

-/* Check the versions of our library dependencies. */
-static svn_error_t *
-ver_check(void)
-{
-}
-
 svn_error_t *
 svn_ra_dav__init (const svn_version_t *loader_version,
                   const svn_ra__vtable_t **vtable)


Eliminate unnecessary dependency on mktime(), and consequent 'Unable to convert date to tm' failures, by using DetermineLocalTimeZone() instead.

--- src/backend/utils/adt/date.c
+++ src/backend/utils/adt/date.c
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.70 2002/08/04 06:44:47 thomas Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.71 2002/09/03 19:41:28 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -337,45 +337,32 @@
 	TimestampTz result;
 	struct tm	tt,
 			   *tm = &tt;
-	time_t		utime;
-
-	j2date((dateVal + date2j(2000, 1, 1)), &(tm->tm_year), &(tm->tm_mon), &(tm->tm_mday));
+
+	j2date((dateVal + date2j(2000, 1, 1)),
+		   &(tm->tm_year), &(tm->tm_mon), &(tm->tm_mday));

 	if (IS_VALID_UTIME(tm->tm_year, tm->tm_mon, tm->tm_mday))
 	{
-#if defined(HAVE_TM_ZONE) || defined(HAVE_INT_TIMEZONE)
+		int		tz;
+
 		tm->tm_hour = 0;
 		tm->tm_min = 0;
 		tm->tm_sec = 0;
-		tm->tm_isdst = -1;
-
-		tm->tm_year -= 1900;
-		tm->tm_mon -= 1;
-		utime = mktime(tm);
-		if (utime == -1)
-			elog(ERROR, "Unable to convert date to tm");
-
-#ifdef HAVE_INT64_TIMESTAMP
-		result = ((utime * INT64CONST(1000000))
-				  + ((date2j(1970, 1, 1) - date2j(2000, 1, 1)) * INT64CONST(86400000000)));
-#else
-		result = utime + ((date2j(1970, 1, 1) - date2j(2000, 1, 1)) * 86400.0);
-#endif
-#else
-#ifdef HAVE_INT64_TIMESTAMP
-		result = ((dateVal * INT64CONST(86400000000))
-			+ (CTimeZone * INT64CONST(1000000)));
-#else
-		result = dateVal * 86400.0 + CTimeZone;
-#endif
+		tz = DetermineLocalTimeZone(tm);
+
+#ifdef HAVE_INT64_TIMESTAMP
+		result = (dateVal * INT64CONST(86400000000))
+			+ (tz * INT64CONST(1000000));
+#else
+		result = dateVal * 86400.0 + tz;
 #endif
 	}
 	else
 	{
+		/* Outside of range for timezone support, so assume UTC */
 #ifdef HAVE_INT64_TIMESTAMP
 		result = (dateVal * INT64CONST(86400000000));
 #else
-		/* Outside of range for timezone support, so assume UTC */
 		result = dateVal * 86400.0;
 #endif
 	}


Delete showcaseview.h

Delete showcaseview.h

--- SubZero/src/view/showcaseview.h
+++ SubZero/src/view/showcaseview.h
@@ -1,43 +0,0 @@
-#ifndef SHOWCASEVIEW_H
-#define SHOWCASEVIEW_H
-
-#include "view.h"
-#include <QPushButton>
-#include <QLabel>
-#include "../../git/SubZero/src/controller/controllers/Controller.h"
-#include "quicktaskadder.h"
-
-//#include <QAction> // for actions later on (systemActions)
-
-
-class ShowCaseView : public View
-{
-public:
-    ShowCaseView();
-
-    QLabel* movement;
-    QPushButton *leftButton;
-    QPushButton *rightButton;
-
-    QLabel* specialActions;
-    QPushButton *surfaceButton;
-    QPushButton *fireTorpedoButton;
-    QPushButton *fireGrabberButton;
-
-    QLabel* systemActions;
-    QPushButton *menuButton;
-    QPushButton *exitButton;
-
-    void initialize_VC_Connection(Controller *controller);
-
-
-
-private:
-    void initializeShowCaseView();
-    void makeQImage(Mat* imgData, QImage *imgHolder);
-
-
-
-};
-
-#endif // SHOWCASEVIEW_H


ra_serf: Properly handle added files and directories with commit.

* subversion/libsvn_ra_serf/update.c
  (dir_context_t): Add in copyfrom_path/revision fields.
  (add_directory): Implement.
  (add_file): Init changed/removed props fields; send the right PUT URL when
  we try to add the file.

--- subversion/libsvn_ra_serf/commit.c
+++ subversion/libsvn_ra_serf/commit.c
@@ -173,6 +173,9 @@
   /* The base revision of the dir. */
   svn_revnum_t base_revision;

+  const char *copyfrom_path;
+  svn_revnum_t copyfrom_revision;
+
   /* Changed and removed properties */
   apr_hash_t *changed_props;
   apr_hash_t *removed_props;
@@ -966,9 +969,62 @@
               apr_pool_t *dir_pool,
               void **child_baton)
 {
-  dir_context_t *ctx = parent_baton;
-
-  abort();
+  dir_context_t *parent = parent_baton;
+  dir_context_t *dir;
+  svn_ra_serf__handler_t *handler;
+  mkactivity_context_t *mkcol_ctx;
+
+  /* Ensure our parent is checked out. */
+  SVN_ERR(checkout_dir(parent));
+
+  dir = apr_pcalloc(dir_pool, sizeof(*dir));
+
+  dir->pool = dir_pool;
+
+  dir->parent_dir = parent;
+  dir->commit = parent->commit;
+
+  dir->base_revision = SVN_INVALID_REVNUM;
+  dir->copyfrom_revision = copyfrom_revision;
+  dir->copyfrom_path = copyfrom_path;
+  dir->name = path;
+  dir->checked_in_url =
+      svn_path_url_add_component(parent->commit->checked_in_url,
+                                 path, dir->pool);
+  dir->changed_props = apr_hash_make(dir->pool);
+  dir->removed_props = apr_hash_make(dir->pool);
+
+  if (copyfrom_path)
+    {
+      abort();
+    }
+
+  handler = apr_pcalloc(dir->pool, sizeof(*handler));
+  handler->method = "MKCOL";
+  handler->path = svn_path_url_add_component(parent->checkout->resource_url,
+                                             svn_path_basename(path, dir->pool),
+                                             dir->pool);
+  handler->conn = dir->commit->session->conns[0];
+  handler->session = dir->commit->session;
+
+  mkcol_ctx = apr_pcalloc(dir->pool, sizeof(*mkcol_ctx));
+
+  handler->response_handler = handle_mkactivity;
+  handler->response_baton = mkcol_ctx;
+
+  svn_ra_serf__request_create(handler);
+
+  SVN_ERR(svn_ra_serf__context_run_wait(&mkcol_ctx->done, dir->commit->session,
+                                        dir->pool));
+
+  if (mkcol_ctx->status != 201)
+    {
+      abort();
+    }
+
+  *child_baton = dir;
+
+  return SVN_NO_ERROR;
 }

 static svn_error_t *
@@ -1120,6 +1176,8 @@
   new_file->name = path;

   new_file->base_revision = SVN_INVALID_REVNUM;
+  new_file->changed_props = apr_hash_make(new_file->pool);
+  new_file->removed_props = apr_hash_make(new_file->pool);

   /* Set up so that we can perform the PUT later. */
   new_file->acceptor = svn_ra_serf__accept_response;
@@ -1161,7 +1219,8 @@

   new_file->put_url =
       svn_path_url_add_component(dir->checkout->resource_url,
-                                 path, new_file->pool);
+                                 svn_path_basename(path, new_file->pool),
+                                 new_file->pool);

   *file_baton = new_file;


Make ra_serf report absent files and directories with the complete editor
path instead of just the basename to unbreak some usage patterns that expect
ra_serf to follow the delta editor documentation.

* subversion/libsvn_ra_serf/update.c
  (start_report): Construct the full editor path for absent callbacks, to
    support editor usages that rely on this. (Our standard update editor
    doesn't)

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1163953 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_ra_serf/update.c
+++ subversion/libsvn_ra_serf/update.c
@@ -1611,9 +1611,11 @@

       SVN_ERR(open_dir(info->dir));

-      SVN_ERR(ctx->update_editor->absent_directory(file_name,
-                                                   info->dir->dir_baton,
-                                                   info->dir->pool));
+      SVN_ERR(ctx->update_editor->absent_directory(
+                                        svn_relpath_join(info->name, file_name,
+                                                         info->dir->pool),
+                                        info->dir->dir_baton,
+                                        info->dir->pool));
     }
   else if ((state == OPEN_DIR || state == ADD_DIR) &&
            strcmp(name.name, "absent-file") == 0)
@@ -1634,9 +1636,11 @@

       SVN_ERR(open_dir(info->dir));

-      SVN_ERR(ctx->update_editor->absent_file(file_name,
-                                              info->dir->dir_baton,
-                                              info->dir->pool));
+      SVN_ERR(ctx->update_editor->absent_file(
+                                        svn_relpath_join(info->name, file_name,
+                                                         info->dir->pool),
+                                        info->dir->dir_baton,
+                                        info->dir->pool));
     }
   else if (state == OPEN_DIR || state == ADD_DIR)
     {


Free the fonts list when done.

Free the fonts list when done.

--- src/bin/e_int_config_fonts.c
+++ src/bin/e_int_config_fonts.c
@@ -340,6 +340,7 @@
 	     e_widget_ilist_append(cfdata->gui.font_list, NULL, f, NULL, NULL, f);
 	  }
      }
+   evas_font_available_list_free(evas, fonts);

    e_widget_ilist_go(cfdata->gui.font_list);
    e_widget_min_size_set(cfdata->gui.font_list, 100, 200);


ra_serf: Continue improving memory usage.

* subversion/libsvn_ra_serf/update.c
  (finish_report): Use iterpool.

--- subversion/libsvn_ra_serf/update.c
+++ subversion/libsvn_ra_serf/update.c
@@ -2258,6 +2258,7 @@
   svn_boolean_t closed_root;
   int status_code, i;
   svn_stringbuf_t *buf = NULL;
+  apr_pool_t *iterpool;

   svn_xml_make_close_tag(&buf, pool, "S:update-report");
   SVN_ERR(svn_io_file_write_full(report->body_file, buf->data, buf->len,
@@ -2315,10 +2316,14 @@
   sess->cur_conn = 1;
   closed_root = FALSE;

+  iterpool = svn_pool_create(pool);
   while (!report->done || report->active_fetches || report->active_propfinds)
     {
       svn_error_t *err;
-      status = serf_context_run(sess->context, sess->timeout, pool);
+
+      svn_pool_clear(iterpool);
+
+      status = serf_context_run(sess->context, sess->timeout, iterpool);

       err = sess->pending_error;
       sess->pending_error = SVN_NO_ERROR;
@@ -2450,6 +2455,7 @@
          serf_debug__closed_conn(sess->conns[i]->bkt_alloc);
         }
     }
+  svn_pool_destroy(iterpool);

   /* Ensure that we opened and closed our root dir and that we closed
    * all of our children. */


Shelfs config dialog (the list of shelves) really doesn't need the Ok/Apply
buttons, just a close button.

git-svn-id: 0f3f1c46c6da7ffd142db61e503a7ff63af3a195@23474 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

--- src/bin/e_int_config_shelf.c
+++ src/bin/e_int_config_shelf.c
@@ -22,7 +22,7 @@

    v->create_cfdata = _create_data;
    v->free_cfdata = _free_data;
-   v->basic.apply_cfdata = _basic_apply_data;
+   v->basic.apply_cfdata = NULL;
    v->basic.create_widgets = _basic_create_widgets;
    v->advanced.apply_cfdata = NULL;
    v->advanced.create_widgets = NULL;


Revert r1533530.  It turns out that APR_TCP_NODELAY will have no effect
on real ethernet connections but only the loopback (localhost) device.
Tested with 'svn-bench null-list' over 1GbE and 10GbE on Linux.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1539207 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_ra_svn/marshal.c
+++ subversion/libsvn_ra_svn/marshal.c
@@ -120,16 +120,6 @@
             && apr_sockaddr_ip_get(&conn->remote_ip, sa) == APR_SUCCESS))
         conn->remote_ip = NULL;
       svn_ra_svn__stream_timeout(conn->stream, get_timeout(conn));
-
-      /* We are using large r/w buffers already.
-       * So, once we decide to actually send data, we want it to go over
-       * the wire a.s.a.p..  So disable Nagle's algorithm.
-       *
-       * We ignore the result of this call since it safe to continue even
-       * if we keep delaying.  The only negative effect is increased
-       * latency (can be additional 5 .. 10ms depending on circumstances).
-       */
-      apr_socket_opt_set(sock, APR_TCP_NODELAY, 1);
     }
   else
     {


free list

free list

SVN revision: 45139

--- src/bin/e_int_shelf_config.c
+++ src/bin/e_int_shelf_config.c
@@ -314,6 +314,7 @@
    E_Zone *zone;
    int idx;
    int restart = 0;
+   E_Config_Shelf_Desk *sd;

    /* Only change style is we need to */
    if (!cfdata->escfg->style)
@@ -410,6 +411,8 @@
    cfdata->escfg->hide_duration = cfdata->hide_duration;

    cfdata->escfg->desk_show_mode = cfdata->desk_show_mode;
+   EINA_LIST_FREE(cfdata->escfg->desk_list, sd)
+      free(sd);
    cfdata->escfg->desk_list = NULL;
    if (cfdata->desk_show_mode)
      {
@@ -421,7 +424,6 @@
 	EINA_LIST_FOREACH(e_widget_ilist_items_get(cfdata->desk_sel_list), l, item)
 	  {
 	     E_Desk *desk;
-	     E_Config_Shelf_Desk *sd;

 	     idx++;
 	     if ((!item) || (!item->selected)) continue;


* subversion/libsvn_repos/rev_hunt.c
  (svn_repos_trace_node_locations): Remember to destroy local pools before
   returning because of unreadable paths.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@1100999 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_repos/rev_hunt.c
+++ subversion/libsvn_repos/rev_hunt.c
@@ -732,6 +732,9 @@
                                   authz_read_baton, currpool));
           if (! readable)
             {
+              svn_pool_destroy(lastpool);
+              svn_pool_destroy(currpool);
+
               return SVN_NO_ERROR;
             }
         }


Prepare cleanup of svn_wc_crawl_revisions4() by updating restore_file() to
take a db and abspath.

* subversion/libsvn_wc/adm_crawler.c
  (restore_file): Take wc-db, local_abspath instead of an access baton and a
     path. Retrieve access baton to access not-updated functions.
  (report_revisions_and_depths): Reduce scope of several arguments and use
     abspath for restore_file().
  (svn_wc_crawl_revisions4): Retrieve db and abspath for call to
    restore_file().

--- subversion/libsvn_wc/adm_crawler.c
+++ subversion/libsvn_wc/adm_crawler.c
@@ -54,25 +54,34 @@

 /* Helper for report_revisions_and_depths().

-   Perform an atomic restoration of the file FILE_PATH; that is, copy
+   Perform an atomic restoration of the file LOCAL_ABSPATH; that is, copy
    the file's text-base to the administrative tmp area, and then move
-   that file to FILE_PATH with possible translations/expansions.  If
+   that file to LOCAL_ABSPATH with possible translations/expansions.  If
    USE_COMMIT_TIMES is set, then set working file's timestamp to
    last-commit-time.  Either way, set entry-timestamp to match that of
-   the working file when all is finished. */
+   the working file when all is finished.
+
+   Not that a valid access baton with a write lock to the directory of
+   LOCAL_ABSPATH must be available in DB.*/
 static svn_error_t *
-restore_file(const char *file_path,
-             svn_wc_adm_access_t *adm_access,
+restore_file(svn_wc__db_t *db,
+             const char *local_abspath,
              svn_boolean_t use_commit_times,
              apr_pool_t *pool)
 {
   svn_stream_t *src_stream;
   svn_boolean_t special;
   svn_wc_entry_t newentry;
-  const char *local_abspath;
-  svn_wc__db_t *db = svn_wc__adm_get_db(adm_access);
-
-  SVN_ERR(svn_dirent_get_absolute(&local_abspath, file_path, pool));
+  const char *adm_dir, *file_path;
+  svn_wc_adm_access_t *adm_access;
+
+  svn_dirent_split(local_abspath, &adm_dir, &file_path, pool);
+
+  adm_access = svn_wc__adm_retrieve_internal2(db, adm_dir, pool);
+  SVN_ERR_ASSERT(adm_access != NULL);
+
+  file_path = svn_dirent_join(svn_wc_adm_access_path(adm_access), file_path,
+                              pool);

   SVN_ERR(svn_wc_get_pristine_contents(&src_stream, file_path, pool, pool));

@@ -245,9 +254,6 @@
   apr_hash_t *dirents;
   apr_pool_t *subpool = svn_pool_create(pool), *iterpool;
   const svn_wc_entry_t *dot_entry;
-  const char *this_url;
-  const char *this_path;
-  const char *this_full_path;
   svn_wc_adm_access_t *dir_access;
   svn_wc_notify_t *notify;
   int i;
@@ -307,6 +313,10 @@
       svn_io_dirent_t *dirent;
       svn_node_kind_t dirent_kind;
       svn_boolean_t missing = FALSE;
+      const char *this_url;
+      const char *this_path;
+      const char *this_full_path;
+      const char *this_abspath;

       /* Clear the iteration subpool here because the loop has a bunch
          of 'continue' jump statements. */
@@ -319,6 +329,7 @@
       this_url = svn_path_url_add_component2(dot_entry->url, key, iterpool);
       this_path = svn_dirent_join(dir_path, key, iterpool);
       this_full_path = svn_dirent_join(full_path, key, iterpool);
+      this_abspath = svn_dirent_join(abspath, key, iterpool);

       SVN_ERR(svn_wc_entry(&current_entry, this_full_path, dir_access, TRUE,
                            iterpool));
@@ -409,8 +420,8 @@
               && (current_entry->schedule != svn_wc_schedule_replace))
             {
               /* ... recreate file from text-base, and ... */
-              SVN_ERR(restore_file(this_full_path, dir_access,
-                                   use_commit_times, iterpool));
+              SVN_ERR(restore_file(db, this_abspath, use_commit_times,
+                                   iterpool));

               /* ... report the restoration to the caller.  */
               if (notify_func != NULL)
@@ -616,6 +627,10 @@
   const svn_wc_entry_t *parent_entry = NULL;
   svn_wc_notify_t *notify;
   svn_boolean_t start_empty;
+  const char *local_abspath;
+  svn_wc__db_t *db = svn_wc__adm_get_db(adm_access);
+
+  SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));

   /* The first thing we do is get the base_rev from the working copy's
      ROOT_DIRECTORY.  This is the first revnum that entries will be
@@ -734,7 +749,7 @@
       if (missing && restore_files)
         {
           /* Recreate file from text-base. */
-          err = restore_file(path, adm_access, use_commit_times, pool);
+          err = restore_file(db, local_abspath, use_commit_times, pool);
           if (err)
             goto abort_report;


In the spirit of r933975, make the delta calculator of libsvn_wc open
a stream instead of an apr file, when it only needs the stream.

* subversion/libsvn_wc/adm_crawler.c
  (copying_stream): Create a stream instead of wrapping an apr file
    with astream.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@933988 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_wc/adm_crawler.c
+++ subversion/libsvn_wc/adm_crawler.c
@@ -1073,7 +1073,7 @@
    * *TEMPFILE to the path to it. */
   if (tempfile)
     {
-      apr_file_t *tempbasefile;
+      svn_stream_t *tempstream;

       SVN_ERR(svn_wc__text_base_path(tempfile, db, local_abspath, TRUE,
                                      scratch_pool));
@@ -1082,19 +1082,14 @@
          administrative tmp area because a) we need to detranslate eol
          and keywords anyway, and b) after the commit, we're going to
          copy the tmp file to become the new text base anyway. */
-      SVN_ERR(svn_io_file_open(&tempbasefile, *tempfile,
-                               APR_WRITE | APR_CREATE, APR_OS_DEFAULT,
-                               result_pool));
+      SVN_ERR(svn_stream_open_writable(&tempstream, *tempfile,
+                                       result_pool, scratch_pool));

       /* Wrap the translated stream with a new stream that writes the
          translated contents into the new text base file as we read from it.
          Note that the new text base file will be closed when the new stream
          is closed. */
-      local_stream
-        = copying_stream(local_stream,
-                         svn_stream_from_aprfile2(tempbasefile, FALSE,
-                                                  scratch_pool),
-                         scratch_pool);
+      local_stream = copying_stream(local_stream, tempstream, scratch_pool);
     }

   /* Set BASE_STREAM to a stream providing the base (source) content for the


Incorporate Greg Stein's review of revision 2637 (saving time for Ben,
who's working on the Handbook):

* subversion/mod_dav_svn/liveprops.c
  (dav_svn_insert_prop): Use APR_OFF_T_FMT.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@842714 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/mod_dav_svn/liveprops.c
+++ subversion/mod_dav_svn/liveprops.c
@@ -272,7 +272,7 @@
             break;
           }

-        value = apr_psprintf(p, "%ld", (long int) len);
+        value = apr_psprintf(p, "%" APR_OFF_T_FMT, len);
         break;
       }


Add OutputFilenames struct

Add OutputFilenames struct

error: pathspec 'Wangscape/OutputFilenames.h' did not match any file(s) known to git

--- Wangscape/OutputFilenames.h
+++ Wangscape/OutputFilenames.h
@@ -0,0 +1,11 @@
+#pragma once
+
+#include <string>
+
+struct OutputFilenames
+{
+    std::string tileDataFilename;
+    std::string tileGroupsFilename;
+    std::string tilesetDataFilename;
+    std::string terrainHypergraphFilename;
+};


update read method

update read method

--- src/R_read.c
+++ src/R_read.c
@@ -45,9 +45,9 @@
     //ADIOS_VARINFO *vi_vec[nvars];   // store ADIOS_VARINFO pointers
     int nelems_vec[nvars];     // store the number of elements in each variable

-    void *data,
-    ADIOS_SELECTION *sel,
-    ADIOS_VARINFO *vi
+    void *data;
+    ADIOS_SELECTION *sel;
+    ADIOS_VARINFO *vi;

     status = adios_read_init_method (ADIOS_READ_METHOD_BP, comm, "verbose=2");
     if (status) {
@@ -107,6 +107,7 @@
         return R_NilValue;
     }
     REprintf("end perform read\n");
+    REprintf("8th data is, %d \n", ((int *)data)[8]);

     // Copy data into R memory


obexd: Closes the session when the client leaves the bus

--- obexd/client/session.c
+++ obexd/client/session.c
@@ -783,6 +783,12 @@
 	return dbus_message_new_method_return(message);
 }

+static void owner_disconnected(DBusConnection *connection, void *user_data)
+{
+	struct session_data *session = user_data;
+
+	session_shutdown(session);
+}

 static GDBusMethodTable session_methods[] = {
 	{ "GetProperties",	"", "a{sv}",	get_properties	},
@@ -1439,6 +1445,9 @@
 		return -EIO;
 	}

+	g_dbus_add_disconnect_watch(session->conn, session->owner,
+				owner_disconnected, session, NULL);
+
 	session_ref(session);

 	return 0;


Create Board_Data.c

Create Board_Data.c

Former-commit-id: fd771cfed1d6699f8eab9c3c08b3c6470fc6e86c

error: pathspec 'pic32/variants/Olimex_PIC32_Pinguino/Board_Data.c' did not match any file(s) known to git

--- pic32/variants/Olimex_PIC32_Pinguino/Board_Data.c
+++ pic32/variants/Olimex_PIC32_Pinguino/Board_Data.c
@@ -0,0 +1,598 @@
+/************************************************************************/
+/*  																	*/
+/*	Board_Data.c --	Default Board Customization Data Declarations		*/
+/*																		*/
+/************************************************************************/
+/*	Author: Gene Apperson												*/
+/*	Copyright 2011, Digilent. All rights reserved						*/
+/************************************************************************/
+/*  File Description:													*/
+/*																		*/
+/* This file contains the board specific declartions and data structure	*/
+/* to customize the chipKIT MPIDE for use with a generic board using a	*/
+/* PIC32 part in a 64-pin package.										*/
+/*																		*/
+/* This code is based on earlier work:									*/
+/*		Copyright (c) 2010, 2011 by Mark Sproul							*/
+/*		Copyright (c) 2005, 2006 by David A. Mellis						*/
+/*																		*/
+/************************************************************************/
+/*  Revision History:													*/
+/*																		*/
+/*	11/28/2011(GeneA): Created by splitting data out of Board_Defs.h	*/
+/*  03/11/2012(BrianS): Modified for Fubarino board                     */
+/*	02/12/2013(GeneA): removed dependency on Microchip plib library		*/
+/*  20/05/2013(): Modified for Olimex Pinguino32 board					*/
+/*																		*/
+/************************************************************************/
+//*	This library is free software; you can redistribute it and/or
+//*	modify it under the terms of the GNU Lesser General Public
+//*	License as published by the Free Software Foundation; either
+//*	version 2.1 of the License, or (at your option) any later version.
+//*
+//*	This library is distributed in the hope that it will be useful,
+//*	but WITHOUT ANY WARRANTY; without even the implied warranty of
+//*	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//*	Lesser General Public License for more details.
+//*
+//*	You should have received a copy of the GNU Lesser General
+//*	Public License along with this library; if not, write to the
+//*	Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+//*	Boston, MA  02111-1307  USA
+/************************************************************************/
+
+#if !defined(BOARD_DATA_C)
+#define BOARD_DATA_C
+
+#include <inttypes.h>
+
+/* ------------------------------------------------------------ */
+/*					Data Tables									*/
+/* ------------------------------------------------------------ */
+/* The following declarations define data used in pin mapping.	*/
+/* ------------------------------------------------------------ */
+
+#if defined(OPT_BOARD_DATA)
+
+/* ------------------------------------------------------------ */
+/* This table is used to map from port number to the address of
+** the TRIS register for the port. This is used for setting the
+** pin direction.
+*/
+const uint32_t	port_to_tris_PGM[] = {
+	NOT_A_PORT,				//index value 0 is not used
+
+#if defined(_PORTA)
+	(uint32_t)&TRISA,
+#else
+	NOT_A_PORT,
+#endif
+
+#if defined(_PORTB)
+	(uint32_t)&TRISB,
+#else
+	NOT_A_PORT,
+#endif
+
+#if defined(_PORTC)
+	(uint32_t)&TRISC,
+#else
+	NOT_A_PORT,
+#endif
+
+#if defined(_PORTD)
+	(uint32_t)&TRISD,
+#else
+	NOT_A_PORT,
+#endif
+
+#if defined(_PORTE)
+	(uint32_t)&TRISE,
+#else
+	NOT_A_PORT,
+#endif
+
+#if defined(_PORTF)
+	(uint32_t)&TRISF,
+#else
+	NOT_A_PORT,
+#endif
+
+#if defined(_PORTG)
+	(uint32_t)&TRISG,
+#else
+	NOT_A_PORT,
+#endif
+
+	NOT_A_PORT,
+};
+
+/* ------------------------------------------------------------ */
+/* This table is used to map the digital pin number to the port
+** containing that pin. The default mapping is to assign pin numbers
+** for every possible port bit in order from PORTA to PORTG.
+*/
+const uint8_t	digital_pin_to_port_PGM[] = {
+
+	// 15 arduino digital gpio
+	_IOPORT_PD,	//  0  RD2  D0  U1RX/OC3/RD2
+	_IOPORT_PD,	//  1  RD3  D1  U1TX/OC4/RD3
+	_IOPORT_PD,	//  2  RD4  D2  OC5/IC5/PMWR/CN13/RD4 BUTTTON
+	_IOPORT_PD,	//  3  RD5  D3  PMRD/CN14/RD5
+	_IOPORT_PD,	//  4  RD6  D4  CN15/RD6
+	_IOPORT_PD,	//  5  RD7  D5  CN16/RD7
+	_IOPORT_PD,	//  6  RD8  D6  RTCC/IC1/INT1/RD8
+	_IOPORT_PD,	//  7  RD11 D7  IC4/PMCS1/PMA14/INT4/RD11
+	_IOPORT_PB,	//  8  RB14 D8  AN14/#U2RTS/PMALH/PMA1/RB14
+	_IOPORT_PB,	//  9  RB15 D9  AN15/OCFB/PMALL/PMA0/CN12/RB15
+	_IOPORT_PG,	//  10 RG9  D10 RG9/#SS2/PMA2/CN11
+	_IOPORT_PG,	//  11 RG8  D11 RG8/SDO2/PMA3/CN10
+	_IOPORT_PG,	//  12 RG7  D12 RG7/SDI2/PMA4/CN9
+	_IOPORT_PG,	//  13 RG6  D13 RG6/SCK2/PMA5/CN8 LED1
+
+	// 6 special purpose digital ports
+	_IOPORT_PD,	//  14 RD1	LED2 #U1RTS/OC2/RD1
+	_IOPORT_PD,	//  15 RD9  SDA #U1CTS/SDA1/IC2/INT2/RD9
+	_IOPORT_PD,	//  16 RD10 SCL SCL1/IC3/PMCS2/PMA15/INT3/RD10
+	_IOPORT_PD,	//  17 RD0  BUT OC1/INT0/RD0
+	_IOPORT_PF,	//  18 RF4  RX2 SDA2/U2RX/PMA9/CN17/RF4 no onboard pullup!
+	_IOPORT_PF,	//  19 RF5  TX2 SCL2/U2TX/PMA8/CN18/RF5 no onboard pullup!
+
+	// 8 PortRE digital ports
+	_IOPORT_PE,	//  20 RE0		RE0/PMD0
+	_IOPORT_PE,	//  21 RE1		RE0/PMD1
+	_IOPORT_PE,	//  22 RE2		RE0/PMD2
+	_IOPORT_PE,	//  23 RE3		RE0/PMD3
+	_IOPORT_PE,	//  24 RE4		RE0/PMD4
+	_IOPORT_PE,	//  25 RE5		RE0/PMD5
+	_IOPORT_PE,	//  26 RE6		RE0/PMD6
+	_IOPORT_PE,	//  27 RE7		RE0/PMD7
+
+	// 8 analog ports
+    	_IOPORT_PB,	//  28 RB1  A0  PGEC1/AN1/VREF-/CVREF-/CN3/RB1
+	_IOPORT_PB,	//  29 RB2  A1  AN2/C2IN-/CN4/RB2
+	_IOPORT_PB,	//  30 RB3  A2  AN3/C2IN+/CN5/RB3
+	_IOPORT_PB,	//  31 RB4  A3  AN4/C1IN-/CN6/RB4
+	_IOPORT_PB,	//  32 RB8  A4  AN8/#U2CTS/C1OUT/RB8
+	_IOPORT_PB,	//  33 RB9  A5  AN9/C2OUT/PMA7/RB9
+	_IOPORT_PB,	//  34 RB10 A6  TMS/AN10/CVREFOUT/PMA13/RB10
+	_IOPORT_PB,	//  35 RB11 A7  TDO/AN11/PMA12//RB11
+
+};
+
+/* ------------------------------------------------------------ */
+/* This table is used to map from digital pin number to a bit mask
+** for the corresponding bit within the port.
+*/
+const uint16_t	digital_pin_to_bit_mask_PGM[] = {
+
+
+	_BV( 2 ) ,	//  0  RD2  D0
+	_BV( 3 ) ,	//  1  RD3  D1
+	_BV( 4 ) ,	//  2  RD4  D2
+	_BV( 5 ) ,	//  3  RD5  D3
+	_BV( 6 ) ,	//  4  RD6  D4
+	_BV( 7 ) ,	//  5  RD7  D5
+	_BV( 8 ) ,	//  6  RD8  D6
+	_BV( 11 ) ,	//  7  RD11 D7
+	_BV( 14 ) ,	//  8  RB14 D8
+	_BV( 15 ) ,	//  9  RB15 D9
+ 	_BV( 9 ) ,	//  10 RG9  D10
+	_BV( 8 ) ,	//  11 RG8  D11
+	_BV( 7 ) ,	//  12 RG7  D12
+	_BV( 6 ) ,	//  13 RG6  D13
+
+	_BV( 1 ) ,	//  14 RD1  LED2
+	_BV( 9 ) ,	//  15 RD9  SDA
+	_BV( 10 ) ,	//  16 RD10 SCL
+	_BV( 0 ) ,	//  17 RD0	 BUTTON
+	_BV( 4 ) ,	//  18 RF4  RX2
+	_BV( 5 ) ,	//  19 RF5  TX2
+
+	_BV( 0 ) ,	//  20 RE0  RE0/PMD0
+	_BV( 1 ) ,	//  21 RE1	 RE0/PMD1
+	_BV( 2 ) ,	//  22 RE2	 RE0/PMD2
+	_BV( 3 ) ,	//  23 RE3	 RE0/PMD3
+	_BV( 4 ) ,	//  24 RE4	 RE0/PMD4
+	_BV( 5 ) ,	//  25 RE5	 RE0/PMD5
+	_BV( 6 ) ,	//  26 RE6	 RE0/PMD6
+	_BV( 7 ) ,	//  27 RE7	 RE0/PMD7
+
+	_BV( 1 ) ,	//  28 RB1  AN0  PGEC1/AN1/VREF-/CVREF-/CN3/RB1
+	_BV( 2 ) ,	//  29 RB2	 AN1  AN2/C2IN-/CN4/RB2
+	_BV( 3 ) ,	//  30 RB3  AN2  AN3/C2IN+/CN5/RB3
+	_BV( 4 ) ,	//  31 RB4  AN3  AN4/C1IN-/CN6/RB4
+	_BV( 8 ) ,	//  32 RB8  AN4  AN8/#U2CTS/C1OUT/RB8
+	_BV( 9 ) ,	//  33 RB9  AN5  AN9/C2OUT/PMA7/RB9
+	_BV( 10 ) ,	//  34 RB11 AN6  TMS/AN10/CVREFOUT/PMA13/RB10
+	_BV( 11 ) ,	//  35 RB10 AN7  TDO/AN11/PMA12//RB11
+};
+
+/* ------------------------------------------------------------ */
+/* This table is used to map from digital pin number to the output
+** compare number, input capture number, and timer external clock
+** input associated with that pin.
+*/
+const uint8_t	digital_pin_to_timer_PGM[] = {
+	_TIMER_OC3 ,	//  0  RD2  D0  U1RX/OC3/RD2
+	_TIMER_OC4 ,	//  1  RD3  D1  U1TX/OC4/RD3
+	_TIMER_OC5 | _TIMER_IC5,	//  2  RD4  D2  OC5/IC5/PMWR/CN13/RD4 BUTTTON
+	NOT_ON_TIMER ,	//  3  RD5  D3  PMRD/CN14/RD5
+	NOT_ON_TIMER ,	//  4  RD6  D4  CN15/RD6
+	NOT_ON_TIMER ,	//  5  RD7  D5  CN16/RD7
+	_TIMER_IC1 ,	//  6  RD8  D6  RTCC/IC1/INT1/RD8
+	_TIMER_IC4 ,	//  7  RD11 D7  IC4/PMCS1/PMA14/INT4/RD11
+	NOT_ON_TIMER ,	//  8  RB14 D8  AN14/#U2RTS/PMALH/PMA1/RB14
+	NOT_ON_TIMER ,	//  9  RB15 D9  AN15/OCFB/PMALL/PMA0/CN12/RB15
+	NOT_ON_TIMER ,	//  10 RG9  D10 RG9/#SS2/PMA2/CN11
+	NOT_ON_TIMER ,	//  11 RG8  D11 RG8/SDO2/PMA3/CN10
+	NOT_ON_TIMER ,	//  12 RG7  D12 RG7/SDI2/PMA4/CN9
+	NOT_ON_TIMER ,	//  13 RG6  D13 RG6/SCK2/PMA5/CN8 LED1
+
+	_TIMER_OC2 ,	//  14 RD1  LED2 #U1RTS/OC2/RD1
+	_TIMER_IC2 ,	//  15 RD9  SDA1 #U1CTS/SDA1/IC2/INT2/RD9
+	_TIMER_IC3 ,	//  16 RD10 SCL1 SCL1/IC3/PMCS2/PMA15/INT3/RD10
+	_TIMER_OC1 ,	//  17 RD0	BUT	OC1/INT0/RD0
+	NOT_ON_TIMER ,	//  18 RF4  RX2 SDA2/U2RX/PMA9/CN17/RF4
+	NOT_ON_TIMER ,	//  19 RF5  TX2 SCL2/U2TX/PMA8/CN18/RF5
+
+	NOT_ON_TIMER ,	//  20 RE0  RE0/PMD0
+	NOT_ON_TIMER ,	//  21 RE1	RE0/PMD1
+	NOT_ON_TIMER ,	//  22 RE2	RE0/PMD2
+	NOT_ON_TIMER ,	//  23 RE3	RE0/PMD3
+	NOT_ON_TIMER ,	//  24 RE4	RE0/PMD4
+	NOT_ON_TIMER ,	//  25 RE5	RE0/PMD5
+	NOT_ON_TIMER ,	//  26 RE6	RE0/PMD6
+	NOT_ON_TIMER ,	//  27 RE7	RE0/PMD7
+
+	NOT_ON_TIMER ,	//  28 RB1  A0  PGEC1/AN1/VREF-/CVREF-/CN3/RB1
+	NOT_ON_TIMER ,	//  29 RB2  A1  AN2/C2IN-/CN4/RB2
+	NOT_ON_TIMER ,	//  30 RB3  A2  AN3/C2IN+/CN5/RB3
+	NOT_ON_TIMER ,	//  31 RB4  A3  AN4/C1IN-/CN6/RB4
+	NOT_ON_TIMER ,	//  32 RB8  A4  AN8/#U2CTS/C1OUT/RB8
+	NOT_ON_TIMER ,	//  33 RB9  A5  AN9/C2OUT/PMA7/RB9
+	NOT_ON_TIMER ,	//  34 RB10 A6  TMS/AN10/CVREFOUT/PMA13/RB10
+	NOT_ON_TIMER ,	//  35 RB11 A7  TDO/AN11/PMA12//RB11
+
+};
+
+
+/* ------------------------------------------------------------ */
+/* This table maps from a digital pin number to the corresponding
+** analog pin number.
+*/
+//#if defined(_NOT_USED_)
+const uint8_t digital_pin_to_analog_PGM[] = {
+	NOT_ANALOG_PIN,	// 0
+	NOT_ANALOG_PIN,	// 1
+	NOT_ANALOG_PIN,	// 2
+	NOT_ANALOG_PIN,	// 3
+	NOT_ANALOG_PIN,	// 4
+	NOT_ANALOG_PIN,	// 5
+	NOT_ANALOG_PIN,	// 6
+	NOT_ANALOG_PIN,	// 7
+	NOT_ANALOG_PIN,	// 8
+	NOT_ANALOG_PIN,	// 9
+	NOT_ANALOG_PIN,	// 10
+	NOT_ANALOG_PIN,	// 11
+	NOT_ANALOG_PIN,	// 12
+	NOT_ANALOG_PIN,	// 13
+
+	NOT_ANALOG_PIN,	// 14
+	NOT_ANALOG_PIN,	// 15
+	NOT_ANALOG_PIN,	// 16
+	NOT_ANALOG_PIN,	// 17
+	NOT_ANALOG_PIN,	// 18
+	NOT_ANALOG_PIN,	// 19
+
+	NOT_ANALOG_PIN,	// 20 RE0  RE0/PMD0
+	NOT_ANALOG_PIN,	// 21 RE0  RE0/PMD0
+	NOT_ANALOG_PIN,	// 22 RE0  RE0/PMD0
+	NOT_ANALOG_PIN,	// 23 RE0  RE0/PMD0
+	NOT_ANALOG_PIN,	// 24 RE0  RE0/PMD0
+	NOT_ANALOG_PIN,	// 25 RE0  RE0/PMD0
+	NOT_ANALOG_PIN,	// 26 RE0  RE0/PMD0
+	NOT_ANALOG_PIN,	// 27 RE0  RE0/PMD0
+
+ 	_BOARD_AN0,	// 28 RB1  A0  PGEC1/AN1/VREF-/CVREF-/CN3/RB1
+	_BOARD_AN1,	// 29 RB2  A1  AN2/C2IN-/CN4/RB2
+	_BOARD_AN2,	// 30 RB3  A2  AN3/C2IN+/CN5/RB3
+	_BOARD_AN3,	// 31 RB4  A3  AN4/C1IN-/CN6/RB4
+	_BOARD_AN4,	// 32 RB8  A4  AN8/#U2CTS/C1OUT/RB8
+	_BOARD_AN5,	// 33 RB9  A5  AN9/C2OUT/PMA7/RB9
+	_BOARD_AN6,	// 34 RB10 A6  TMS/AN10/CVREFOUT/PMA13/RB10
+	_BOARD_AN7,	// 35 RB11 A7  TDO/AN11/PMA12//RB11
+};
+//#endif
+
+/* ------------------------------------------------------------ */
+/* This table is used to map from the analog pin number to the
+** actual A/D converter channel used for that pin.
+** In the default case, where there is a one-to-one mapping, this
+** table isn't needed as the analogInPinToChannel() macro is defined
+** to provide the mapping.
+*/
+//#if defined(_NOT_USED_)
+const uint8_t analog_pin_to_channel_PGM[] = {
+			//*	Arduino Pin		PIC32 Analog channel
+	1,		//*	A0				1 to 1 mapping
+	2,		//*	A1
+	3,		//*	A2
+	4,		//*	A3
+	8,		//*	A4
+	9,		//*	A5
+	10,		//*	A6
+	11,		//*	A7
+};
+//#endif
+
+/* ------------------------------------------------------------ */
+/*		Include Files for Board Customization Functions			*/
+/* ------------------------------------------------------------ */
+
+
+/* ------------------------------------------------------------ */
+/*				Board Customization Functions					*/
+/* ------------------------------------------------------------ */
+/*																*/
+/* The following can be used to customize the behavior of some	*/
+/* of the core API functions. These provide hooks that can be	*/
+/* used to extend or replace the default behavior of the core	*/
+/* functions. To use one of these functions, add the desired	*/
+/* code to the function skeleton below and then set the value	*/
+/* of the appropriate compile switch above to 1. This will		*/
+/* cause the hook function to be compiled into the build and	*/
+/* to cause the code to call the hook function to be compiled	*/
+/* into the appropriate core function.							*/
+/*																*/
+/* ------------------------------------------------------------ */
+/***	_board_init
+**
+**	Parameters:
+**		none
+**
+**	Return Value:
+**		none
+**
+**	Errors:
+**		none
+**
+**	Description:
+**		This function is called from the core init() function.
+**		This can be used to perform any board specific init
+**		that needs to be done when the processor comes out of
+**		reset and before the user sketch is run.
+*/
+#if	(OPT_BOARD_INIT != 0)
+
+void _board_init(void) {
+
+	/*	Turn off Secondary oscillator so pins can be used as GPIO
+	*/
+	OSCCONCLR	=	_OSCCON_SOSCEN_MASK;
+
+}
+
+#endif
+
+/* ------------------------------------------------------------ */
+/***	_board_pinMode
+**
+**	Parameters:
+**		pin		- digital pin number to configure
+**		mode	- mode to which the pin should be configured
+**
+**	Return Value:
+**		Returns 0 if not handled, !0 if handled.
+**
+**	Errors:
+**		none
+**
+**	Description:
+**		This function is called at the beginning of the pinMode
+**		function. It can perform any special processing needed
+**		when setting the pin mode. If this function returns zero,
+**		control will pass through the normal pinMode code. If
+**		it returns a non-zero value the normal pinMode code isn't
+**		executed.
+*/
+#if	(OPT_BOARD_DIGITAL_IO != 0)
+
+int	_board_pinMode(uint8_t pin, uint8_t mode) {
+
+	return 0;
+
+}
+
+#endif
+
+/* ------------------------------------------------------------ */
+/***	_board_getPinMode
+**
+**	Parameters:
+**		pin		- digital pin number
+**		mode	- pointer to variable to receive mode value
+**
+**	Return Value:
+**		Returns 0 if not handled, !0 if handled.
+**
+**	Errors:
+**		none
+**
+**	Description:
+**		This function is called at the beginning of the getPinMode
+**		function. It can perform any special processing needed
+**		when getting the pin mode. If this function returns zero,
+**		control will pass through the normal getPinMode code. If
+**		it returns a non-zero value the normal getPinMode code isn't
+**		executed.
+*/
+#if	(OPT_BOARD_DIGITAL_IO != 0)
+
+int	_board_getPinMode(uint8_t pin, uint8_t * mode) {
+
+	return 0;
+
+}
+
+#endif
+
+/* ------------------------------------------------------------ */
+/***	_board_digitalWrite
+**
+**	Parameters:
+**		pin		- digital pin number
+**		val		- value to write to the pin
+**
+**	Return Value:
+**		Returns 0 if not handled, !0 if handled.
+**
+**	Errors:
+**		none
+**
+**	Description:
+**		This function is called at the beginning of the digitalWrite
+**		function. It can perform any special processing needed
+**		in writing to the pin. If this function returns zero,
+**		control will pass through the normal digitalWrite code. If
+**		it returns a non-zero value the normal digitalWrite code isn't
+**		executed.
+*/#if	(OPT_BOARD_DIGITAL_IO != 0)
+
+int	_board_digitalWrite(uint8_t pin, uint8_t val) {
+
+	return 0;
+
+}
+
+#endif
+
+/* ------------------------------------------------------------ */
+/***	_board_digitalRead
+**
+**	Parameters:
+**		pin		- digital pin number
+**		val		- pointer to variable to receive pin value
+**
+**	Return Value:
+**		Returns 0 if not handled, !0 if handled.
+**
+**	Errors:
+**		none
+**
+**	Description:
+**		This function is called at the beginning of the digitalRead
+**		function. It can perform any special processing needed
+**		in reading from the pin. If this function returns zero,
+**		control will pass through the normal digitalRead code. If
+**		it returns a non-zero value the normal digitalRead code isn't
+**		executed.
+*/
+#if	(OPT_BOARD_DIGITAL_IO != 0)
+
+int	_board_digitalRead(uint8_t pin, uint8_t * val) {
+
+	return 0;
+
+}
+
+#endif
+
+/* ------------------------------------------------------------ */
+/***	_board_analogRead
+**
+**	Parameters:
+**		pin		- analog channel number
+**		val		- pointer to variable to receive analog value
+**
+**	Return Value:
+**		Returns 0 if not handled, !0 if handled.
+**
+**	Errors:
+**		none
+**
+**	Description:
+**		This function is called at the beginning of the analogRead
+**		function. It can perform any special processing needed
+**		in reading from the pin. If this function returns zero,
+**		control will pass through the normal analogRead code. If
+**		it returns a non-zero value the normal analogRead code isn't
+**		executed.
+*/
+#if (OPT_BOARD_ANALOG_READ != 0)
+
+int	_board_analogRead(uint8_t pin, int * val) {
+
+	return 0;
+
+}
+
+#endif
+
+/* ------------------------------------------------------------ */
+/***	_board_analogReference
+**
+**	Parameters:
+**
+**	Return Value:
+**		Returns 0 if not handled, !0 if handled.
+**
+**	Errors:
+**		none
+**
+**	Description:
+**		This function is called at the beginning of the analogReference
+**		function. It can perform any special processing needed
+**		to set the reference voltage. If this function returns zero,
+**		control will pass through the normal analogReference code. If
+**		it returns a non-zero value the normal analogReference code isn't
+**		executed.
+*/
+#if (OPT_BOARD_ANALOG_READ != 0)
+
+int	_board_analogReference(uint8_t mode) {
+
+	return 0;
+
+}
+
+#endif
+
+/* ------------------------------------------------------------ */
+/***	_board_analogWrite
+**
+**	Parameters:
+**		pin		- pin number
+**		val		- analog value to write
+**
+**	Return Value:
+**		Returns 0 if not handled, !0 if handled.
+**
+**	Errors:
+**		none
+**
+**	Description:
+**		This function is called at the beginning of the analogWrite
+**		function. It can perform any special processing needed
+**		in writing to the pin. If this function returns zero,
+**		control will pass through the normal analogWrite code. If
+**		it returns a non-zero value the normal analogWrite code isn't
+**		executed.
+*/
+#if (OPT_BOARD_ANALOG_WRITE != 0)
+
+int	_board_analogWrite(uint8_t pin, int val) {
+
+	return 0;
+
+}
+
+#endif
+
+#endif // OPT_BOARD_DATA
+
+/* ------------------------------------------------------------ */
+
+#endif	// BOARD_DATA_C
+
+/************************************************************************/


test-gles2: fix the accelerator reading in N9

--- tests/GLES2/test-gles2.c
+++ tests/GLES2/test-gles2.c
@@ -131,13 +131,17 @@
 #ifdef N900
 #define XA_ERR 36
 #define YA_ERR 54
+#define X_SIGN 1
 #define Y_SIGN 1
+#define SWAP_XY 0
 #define ACC_FILE "/sys/class/i2c-adapter/i2c-3/3-001d/coord"
 #define ACC_DATA_FMT "%d %d"
-#else
-#define XA_ERR 18
-#define YA_ERR 18
+#else  // N9
+#define XA_ERR 54
+#define YA_ERR 36
+#define X_SIGN -1
 #define Y_SIGN -1
+#define SWAP_XY 1
 #define ACC_FILE "/sys/devices/platform/lis3lv02d/position"
 #define ACC_DATA_FMT "(%d,%d,"
 #endif
@@ -152,6 +156,12 @@
   }
   if (fscanf(fd, ACC_DATA_FMT, &xi, &yi) != 2) xi = yi = 0;
   yi *= Y_SIGN;
+  xi *= X_SIGN;
+  if (SWAP_XY) {
+      int tmp = yi;
+      yi = xi;
+      xi = tmp;
+  }
   fclose(fd);
   /* correct for error */
   if (xi <= XA_ERR && xi >= -XA_ERR) xi = 0;


also allow placement new with LRBni

also allow placement new with LRBni

--- larrabee/types.h
+++ larrabee/types.h
@@ -129,6 +129,7 @@
     {
         public:
             void *operator new(size_t size) { void *r; if (posix_memalign(&r, VectorAlignment, size)) {}; return r; }
+            void *operator new(size_t, void *p) { return p; }
             void *operator new[](size_t size) { void *r; if (posix_memalign(&r, VectorAlignment, size)) {}; return r; }
             void operator delete(void *ptr, size_t) { free(ptr); }
             void operator delete[](void *ptr, size_t) { free(ptr); }


Don't reply files outside a user's area if he's limited

git-svn-id: fa0849429efd6140f8c6b0411d4b758884714b35@7218 94223b32-352b-4d6d-a509-7b239cf53eea

--- wired/files.c
+++ wired/files.c
@@ -687,7 +687,7 @@
 	char				*buffer = NULL, *messagebuffer;
 	wi_uinteger_t		i = 0, bufferlength, messagelength, accountpathlength;
 	uint32_t			entrylength, namelength, pathlength;
-	wi_boolean_t		deleted;
+	wi_boolean_t		deleted, sendreply;

 	wi_rwlock_rdlock(wd_files_index_lock);

@@ -738,6 +738,7 @@
 			wi_set_unlock(wd_files_index_deleted_files);

 			if(!deleted) {
+				sendreply = true;
 				messagelength = wd_files_search_replace_privileges_for_account(messagebuffer, messagelength, path, account);

 				if(accountpath && accountpathlength > 0) {
@@ -746,15 +747,19 @@

 						if(wi_string_has_prefix(newpath, WI_STR("/")))
 							messagelength = wd_files_search_replace_path_with_path(messagebuffer, messagelength, path, newpath);
+						else
+							sendreply = false;
 					}
 				}

-				reply = wi_p7_message_with_bytes(messagebuffer, messagelength, WI_P7_BINARY, wd_p7_spec);
-
-				if(reply)
-					wd_user_reply_message(user, reply, message);
-				else
-					wi_log_err(WI_STR("Could not create message from search entry: %m"));
+				if(sendreply) {
+					reply = wi_p7_message_with_bytes(messagebuffer, messagelength, WI_P7_BINARY, wd_p7_spec);
+
+					if(reply)
+						wd_user_reply_message(user, reply, message);
+					else
+						wi_log_err(WI_STR("Could not create message from search entry: %m"));
+				}
 			}

 			wi_release(path);


logproxy: increase ka interval to 30

logproxy: increase ka interval to 30

Signed-off-by: Ido Reis <1341de40bce750a3b7a8df8c495804d64e873404@ti.com>

--- wl_logproxy.c
+++ wl_logproxy.c
@@ -27,7 +27,7 @@

 #define BUFFER_SIZE 1024
 #define FILE_POLL_INTERVAL 5 // in seconds
-#define KEEP_ALIVE_INTERVAL 1 // in seconds
+#define KEEP_ALIVE_INTERVAL 30 // in seconds
 #define MAX_PATH 256
 #define MAX_FILE_SIZE 100000000 // Max file size is 100mb
 /***********/


use structure packing to make the word structure size 16 again (reduces # of page faults etc)

--- word2phrase.c
+++ word2phrase.c
@@ -14,23 +14,25 @@

 #include <stdio.h>
 #include <stdlib.h>
+#include <stddef.h>
 #include <string.h>
 #include <math.h>
 #include <pthread.h>

 #define MAX_STRING 60
-#define MAX_SHORT_WORD 12
+#define MAX_SHORT_WORD 12

 const int vocab_hash_size = 536870912; // Maximum 2^29 entries in the vocabulary
+//const int vocab_hash_size = 500000000;

 typedef float real;                    // Precision of float numbers

-struct vocab_word {
-  unsigned int cn;
-  union {
+struct __attribute__((packed)) vocab_word {
+  union __attribute__((packed)) {
 	char *word;
 	char shortword[MAX_SHORT_WORD];
   } w;
+  unsigned int cn;
 };

 const unsigned int SHORT_WORD = (1 << 31);
@@ -329,7 +331,7 @@
   if ((i = ArgPos((char *)"-output", argc, argv)) > 0) strcpy(output_file, argv[i + 1]);
   if ((i = ArgPos((char *)"-min-count", argc, argv)) > 0) min_count = atoi(argv[i + 1]);
   if ((i = ArgPos((char *)"-threshold", argc, argv)) > 0) threshold = atof(argv[i + 1]);
-  printf("%d\n", sizeof(struct vocab_word));
+  printf("%d %d\n", sizeof(struct vocab_word), offsetof(struct vocab_word, cn));
   vocab = (struct vocab_word *)calloc(vocab_max_size, sizeof(struct vocab_word));
   vocab_hash = (int *)calloc(vocab_hash_size, sizeof(int));
   TrainModel();


made readSocket method public

made readSocket method public

--- src/Socket.h
+++ src/Socket.h
@@ -35,6 +35,8 @@

    ssize_t receive(void* receiveBuffer, size_t bufferLength, int flags) noexcept;
    bool read(char* buffer, int bufferLen) noexcept;
+   bool readSocket(char* buffer, int bytesToRead) noexcept;
+

    void close() noexcept;
    bool isOpen() const noexcept;
@@ -76,7 +78,7 @@

 protected:
    bool readMsg(int length) noexcept;
-   bool readSocket(char* buffer, int bytesToRead) noexcept;
+   //bool readSocket(char* buffer, int bytesToRead) noexcept;
    bool open() noexcept;
    void init() noexcept;


kliu: default font = consolas patch

kliu: default font = consolas patch

http://code.kliu.org/misc/notepad2/
np2-4.0.22-default_font.patch

Does not include Scintilla patch, as this change is already merged into
Scintilla 2.11

Signed-off-by: Dan Savilonis <6ff51a6f90abb93e027b66b17da3ec7e8934be46@n-cube.org>

--- src/Styles.c
+++ src/Styles.c
@@ -42,7 +42,7 @@

 EDITLEXER lexDefault = { SCLEX_NULL, 63000, L"Default Text", L"txt; text; wtx; log; asc; doc; diz; nfo", L"", &KeyWords_NULL, {
-                /*  0 */ { STYLE_DEFAULT, 63100, L"Default Style", L"font:Lucida Console; size:10", L"" },
+                /*  0 */ { STYLE_DEFAULT, L"Default Style", L"font:Default; size:10", L"" },
                 /*  1 */ { STYLE_LINENUMBER, 63101, L"Margins and Line Numbers", L"size:-2; fore:#FF0000", L"" },
                 /*  2 */ { STYLE_BRACELIGHT, 63102, L"Matching Braces", L"size:+1; bold; fore:#FF0000", L"" },
                 /*  3 */ { STYLE_BRACEBAD, 63103, L"Matching Braces Error", L"size:+1; bold; fore:#000080", L"" },
@@ -1915,6 +1915,31 @@
   return TRUE;
 }

+//=============================================================================
+//
+//  IsConsolasAvailable()
+//
+int CALLBACK EnumFontsProc( CONST LOGFONT *plf, CONST TEXTMETRIC *ptm,
+                            DWORD FontType, LPARAM lParam )
+{
+  *((PBOOL)lParam) = TRUE;
+  return(FALSE);
+}
+
+BOOL IsConsolasAvailable( )
+{
+  // Yes, EnumFonts is old, but we neither need nor care about the additional
+  // info returned by the newer font enumeration APIs; all that we care about
+  // is whether the callback is ever called.
+
+  BOOL fFound = FALSE;
+
+  HDC hDC = GetDC(NULL);
+  EnumFonts(hDC, TEXT("Consolas"), EnumFontsProc, (LPARAM)&fFound);
+  ReleaseDC(NULL, hDC);
+
+  return(fFound);
+}

 //=============================================================================
 //
@@ -1931,7 +1956,19 @@
     if (p = StrChr(tch,L';'))
       *p = L'\0';
     TrimString(tch);
-    lstrcpyn(lpszFont,tch,cchFont);
+
+    if (lstrcmpi(tch,L"Default") == 0)
+    {
+      if (IsConsolasAvailable())
+        lstrcpyn(lpszFont,L"Consolas",cchFont);
+      else
+        lstrcpyn(lpszFont,L"Lucida Console",cchFont);
+    }
+    else
+    {
+      lstrcpyn(lpszFont,tch,cchFont);
+    }
+
     return TRUE;
   }
   return FALSE;


Formatting only.

Formatting only.

--- Demo/Cortex_STM32L152_IAR/main.c
+++ Demo/Cortex_STM32L152_IAR/main.c
@@ -212,7 +212,7 @@
 typedef struct
 {
 	char cMessageID;	/* << States what the message is. */
-	long lMessageValue; /* << States the message value (can be an integer, string pointer, etc. depending on the value of cMessageID. */
+	long lMessageValue; /* << States the message value (can be an integer, string pointer, etc. depending on the value of cMessageID). */
 } xQueueMessage;

 /*-----------------------------------------------------------*/
@@ -586,7 +586,7 @@

 void vApplicationIdleHook( void )
 {
-	/* Called on each itteration of the idle task.  In this case the idle task
+	/* Called on each iteration of the idle task.  In this case the idle task
 	just enters a low(ish) power mode. */
 	PWR_EnterSleepMode( PWR_Regulator_ON, PWR_SLEEPEntry_WFI );
 }


dump: reduce the max opened column files when 1 thread mode

--- lib/proc/proc_dump.c
+++ lib/proc/proc_dump.c
@@ -204,21 +204,42 @@
   }

   if (grn_table_columns(ctx, table, NULL, 0, (grn_obj *)columns) >= 0) {
-    grn_id *key;
-
-    GRN_HASH_EACH(ctx, columns, id, &key, NULL, NULL, {
+    grn_bool is_close_opened_object_mode = GRN_FALSE;
+
+    if (grn_thread_get_limit() == 1) {
+      is_close_opened_object_mode = GRN_TRUE;
+    }
+
+    GRN_HASH_EACH_BEGIN(ctx, columns, cursor, id) {
+      grn_bool is_opened = GRN_TRUE;
+      void *key;
+      grn_id column_id;
       grn_obj *column;
-      if ((column = grn_ctx_at(ctx, *key))) {
-        if (grn_obj_is_index_column(ctx, column)) {
-          /* do nothing */
-        } else if (grn_obj_is_reference_column(ctx, column)) {
-          GRN_PTR_PUT(ctx, pending_reference_columns, column);
-        } else {
-          dump_column(ctx, outbuf, table, column);
-          grn_obj_unlink(ctx, column);
-        }
-      }
-    });
+
+      grn_hash_cursor_get_key(ctx, cursor, &key);
+      column_id = *((grn_id *)key);
+
+      if (is_close_opened_object_mode) {
+        is_opened = grn_ctx_is_opened(ctx, column_id);
+      }
+
+      column = grn_ctx_at(ctx, column_id);
+      if (!column) {
+        continue;
+      }
+
+      if (grn_obj_is_index_column(ctx, column)) {
+        /* do nothing */
+      } else if (grn_obj_is_reference_column(ctx, column)) {
+        GRN_PTR_PUT(ctx, pending_reference_columns, column);
+      } else {
+        dump_column(ctx, outbuf, table, column);
+      }
+
+      if (is_close_opened_object_mode && !is_opened) {
+        grn_obj_close(ctx, column);
+      }
+    } GRN_HASH_EACH_END(ctx, cursor);
   }
   grn_hash_close(ctx, columns);
 }


Grammar fix in error message

Grammar fix in error message

--- process_socks.c
+++ process_socks.c
@@ -177,7 +177,7 @@
 	msg = "Read failure from SOCKS5 server";
     } else
     if(nn!=10) {
-	msg = "Not exactly 10 bytes is received from SOCKS5 server. This situation is not handeled.\n";
+	msg = "Not exactly 10 bytes is received from SOCKS5 server. This situation is not handled.\n";
     } else
     if(buf[0]!=5) {
 	msg = "Not SOCKS5 reply from SOCKS5 server [phase 3]\n";


missing include

missing include

--- libs/math/include/mrpt/math/CProbabilityDensityFunction.h
+++ libs/math/include/mrpt/math/CProbabilityDensityFunction.h
@@ -12,6 +12,8 @@
 #include <mrpt/math/CMatrixFixed.h>
 #include <mrpt/math/CVectorDynamic.h>
 #include <mrpt/math/math_frwds.h>
+
+#include <limits>  // numeric_limits

 namespace mrpt::math
 {


[rv1106]fix sys_uart_init function

[rv1106]fix sys_uart_init function


3K: numarray: replace buffer APIs by dummy+error. Some ob_types.

git-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@7897 94b884b6-d6fd-0310-90d3-974f1d3f35e1

--- numpy/numarray/_capi.c
+++ numpy/numarray/_capi.c
@@ -2,6 +2,7 @@

 #define _libnumarray_MODULE
 #include "numpy/libnumarray.h"
+#include "npy_config.h"
 #include <float.h>

 #if (defined(__unix__) || defined(unix)) && !defined(USG)
@@ -55,7 +56,7 @@
 {
     if (!obj) return PyErr_Format(PyExc_RuntimeError,
             "NULL object passed to getBuffer()");
-    if (obj->ob_type->tp_as_buffer == NULL) {
+    if (((PyObject*)obj)->ob_type->tp_as_buffer == NULL) {
         return PyObject_CallMethod(obj, "__buffer__", NULL);
     } else {
         Py_INCREF(obj);  /* Since CallMethod returns a new object when it
@@ -88,6 +89,12 @@
 static int
 getWriteBufferDataPtr(PyObject *buffobj, void **buff)
 {
+#if defined(NPY_PY3K)
+#warning XXX - needs implementation
+    PyErr_SetString(PyExc_RuntimeError,
+                    "XXX: getWriteBufferDataPtr is not implemented");
+    return -1;
+#else
     int rval = -1;
     PyObject *buff2;
     if ((buff2 = getBuffer(buffobj)))
@@ -98,6 +105,7 @@
         Py_DECREF(buff2);
     }
     return rval;
+#endif
 }

 /**********************************************************************/
@@ -118,6 +126,12 @@
 static int
 getReadBufferDataPtr(PyObject *buffobj, void **buff)
 {
+#if defined(NPY_PY3K)
+#warning XXX - needs implementation
+    PyErr_SetString(PyExc_RuntimeError,
+                    "XXX: getWriteBufferDataPtr is not implemented");
+    return -1;
+#else
     int rval = -1;
     PyObject *buff2;
     if ((buff2 = getBuffer(buffobj))) {
@@ -127,6 +141,7 @@
         Py_DECREF(buff2);
     }
     return rval;
+#endif
 }

 /**********************************************************************/
@@ -134,6 +149,12 @@
 static int
 getBufferSize(PyObject *buffobj)
 {
+#if defined(NPY_PY3K)
+#warning XXX - needs implementation
+    PyErr_SetString(PyExc_RuntimeError,
+                    "XXX: getWriteBufferDataPtr is not implemented");
+    return -1;
+#else
     Py_ssize_t size=0;
     PyObject *buff2;
     if ((buff2 = getBuffer(buffobj)))
@@ -144,6 +165,7 @@
     else
         size = -1;
     return size;
+#endif
 }

@@ -901,7 +923,7 @@
     }
 }

-staticforward PyTypeObject CfuncType;
+static PyTypeObject CfuncType;

 static void
 cfunc_dealloc(PyObject* self)
@@ -986,8 +1008,9 @@
 {
     CfuncObject* cfunc;

-    CfuncType.ob_type = &PyType_Type;  /* Should be done once at init.
-                                          Do now since there is no init. */
+    /* Should be done once at init.
+       Do now since there is no init. */
+    ((PyObject*)&CfuncType)->ob_type = &PyType_Type;

     cfunc = PyObject_New(CfuncObject, &CfuncType);

@@ -2439,7 +2462,11 @@
                     "NA_setFromPythonScalar: len(string) must be 1.");
             return -1;
         }
+#if defined(NPY_PY3K)
+        NA_set_Int64(a, offset, *PyBytes_AsString(value));
+#else
         NA_set_Int64(a, offset, *PyString_AsString(value));
+#endif
     } else {
         PyErr_Format(PyExc_TypeError,
                 "NA_setFromPythonScalar: bad value type.");


print errno if assert fails in unit test

--- test/assert.h
+++ test/assert.h
@@ -1,5 +1,19 @@
-#ifdef NDEBUG
-#undef NDEBUG
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef assert
+# undef assert
 #endif

-#include <assert.h>
+#define assert(expr) \
+	do { \
+		if (!(expr)) { \
+			if (errno) \
+				fprintf(stderr, "%s:%d: %s: assert(%s) failed: %s\n", __FILE__, __LINE__, __func__, #expr, strerror(errno)); \
+			else \
+				fprintf(stderr, "%s:%d: %s: assert(%s) failed\n", __FILE__, __LINE__, __func__, #expr); \
+			abort(); \
+		} \
+	} while (0)


Move valid media transport data to a common place

--- test/avtest.c
+++ test/avtest.c
@@ -97,6 +97,19 @@
 #else
 #error "Unknown byte order"
 #endif
+
+static const unsigned char media_transport[] = {
+		0x01,	/* Media transport category */
+		0x00,
+		0x07,	/* Media codec category */
+		0x06,
+		0x00,	/* Media type audio */
+		0x00,	/* Codec SBC */
+		0x22,	/* 44.1 kHz, stereo */
+		0x15,	/* 16 blocks, 8 subbands */
+		0x02,
+		0x33,
+};

 static void dump_header(struct avdtp_header *hdr)
 {
@@ -168,18 +181,11 @@
 				len = write(sk, buf, 3);
 			} else {
 				hdr->message_type = AVDTP_MSG_TYPE_ACCEPT;
-				buf[2] = 0x01;	/* Media transport category */
-				buf[3] = 0x00;
-				buf[4] = 0x07;	/* Media codec category */
-				buf[5] = 0x06;
-				buf[6] = 0x00;	/* Media type audio */
-				buf[7] = 0x00;	/* Codec SBC */
-				buf[8] = 0x22;	/* 44.1 kHz, stereo */
-				buf[9] = 0x15;	/* 16 blocks, 8 subbands */
-				buf[10] = 0x02;
-				buf[11] = 0x33;
+				memcpy(&buf[2], media_transport,
+						sizeof(media_transport));
 				printf("Accepting get capabilities command\n");
-				len = write(sk, buf, 12);
+				len = write(sk, buf,
+						2 + sizeof(media_transport));
 			}
 			break;

@@ -311,17 +317,8 @@
 		hdr->signal_id = AVDTP_SET_CONFIGURATION;
 		buf[2] = 1 << 2; /* ACP SEID */
 		buf[3] = 1 << 2; /* INT SEID */
-		buf[4] = 0x01;	/* Media transport category */
-		buf[5] = 0x00;
-		buf[6] = 0x07;	/* Media codec category */
-		buf[7] = 0x06;
-		buf[8] = 0x00;	/* Media type audio */
-		buf[9] = 0x00;	/* Codec SBC */
-		buf[10] = 0x22;	/* 44.1 kHz, stereo */
-		buf[11] = 0x15;	/* 16 blocks, 8 subbands */
-		buf[12] = 0x02;
-		buf[13] = 0x33;
-		len = write(sk, buf, 14);
+		memcpy(&buf[4], media_transport, sizeof(media_transport));
+		len = write(sk, buf, 4 + sizeof(media_transport));
 		break;

 	case AVDTP_GET_CONFIGURATION:


Add missing "static" marker.

Add missing "static" marker.

Per buildfarm member pademelon.

--- src/backend/access/brin/brin_minmax.c
+++ src/backend/access/brin/brin_minmax.c
@@ -303,7 +303,7 @@
 /*
  * Cache and return the procedure for the given strategy.
  */
-FmgrInfo *
+static FmgrInfo *
 minmax_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno, Oid subtype,
 							 uint16 strategynum)
 {


test/bntest.c: add bn_sqrx8x_internal regression test.

Reviewed-by: Rich Salz <c04971a99e5a9ee80eaab4b1deb37e845b0bd697@openssl.org>

--- test/bntest.c
+++ test/bntest.c
@@ -381,6 +381,54 @@
     bigstring = glue(bn2strings);
     BN_hex2bn(&a, bigstring);
     OPENSSL_free(bigstring);
+    BN_free(b);
+    b = BN_dup(a);
+    BN_MONT_CTX_set(mont, n, ctx);
+    BN_mod_mul_montgomery(c, a, a, mont, ctx);
+    BN_mod_mul_montgomery(d, a, b, mont, ctx);
+    if (!TEST_BN_eq(c, d))
+        goto err;
+
+    /* Regression test for carry bug in bn_sqrx8x_internal */
+    {
+        static const char *ahex[] = {
+                      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+            "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+            "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+            "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+            "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8FFEADBCFC4DAE7FFF908E92820306B",
+            "9544D954000000006C0000000000000000000000000000000000000000000000",
+            "00000000000000000000FF030202FFFFF8FFEBDBCFC4DAE7FFF908E92820306B",
+            "9544D954000000006C000000FF0302030000000000FFFFFFFFFFFFFFFFFFFFFF",
+            "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01FC00FF02FFFFFFFF",
+            "00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FCFD",
+            "FCFFFFFFFFFF000000000000000000FF0302030000000000FFFFFFFFFFFFFFFF",
+            "FF00FCFDFDFF030202FF00000000FFFFFFFFFFFFFFFFFF00FCFDFCFFFFFFFFFF",
+            NULL
+	};
+        static const char *nhex[] = {
+                      "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+            "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+            "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+            "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+            "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8F8F8F8000000",
+            "00000010000000006C0000000000000000000000000000000000000000000000",
+            "00000000000000000000000000000000000000FFFFFFFFFFFFF8F8F8F8000000",
+            "00000010000000006C000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF",
+            "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+            "00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+            "FFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFFFFFFFFFF",
+            "FFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
+            NULL
+	};
+
+        bigstring = glue(ahex);
+        BN_hex2bn(&a, bigstring);
+        OPENSSL_free(bigstring);
+        bigstring = glue(nhex);
+        BN_hex2bn(&n, bigstring);
+        OPENSSL_free(bigstring);
+    }
     BN_free(b);
     b = BN_dup(a);
     BN_MONT_CTX_set(mont, n, ctx);


Add comments describing interface to heap_getattr().

--- src/backend/access/common/heaptuple.c
+++ src/backend/access/common/heaptuple.c
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.17 1996/12/04 03:05:55 bryanh Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.18 1996/12/09 01:22:17 bryanh Exp $
  *
  * NOTES
  *    The old interface functions have been converted to macros
@@ -658,52 +658,61 @@
 }

 /* ----------------
- *	heap_getattr
- *
- *	returns an attribute from a heap tuple.  uses
- * ----------------
- */
+ *      heap_getattr
+ *
+ *      Find a particular field in a row represented as a heap tuple.
+ *      We return a pointer into that heap tuple, which points to the
+ *      first byte of the value of the field in question.
+ *
+ *      If the field in question has a NULL value, we return a null
+ *      pointer and return <*isnull> == true.  Otherwise, we return
+ *      <*isnull> == false.
+ *
+ *      <tup> is the pointer to the heap tuple.  <attnum> is the attribute
+ *      number of the column (field) caller wants.  <tupleDesc> is a
+ *      pointer to the structure describing the row and all its fields.
+ * ---------------- */
 char *
 heap_getattr(HeapTuple tup,
-	     Buffer b,
-	     int attnum,
-	     TupleDesc tupleDesc,
-	     bool *isnull)
-{
-    bool	localIsNull;
-
-    /* ----------------
-     *	sanity checks
+             Buffer b,
+             int attnum,
+             TupleDesc tupleDesc,
+             bool *isnull)
+{
+    bool        localIsNull;
+
+    /* ----------------
+     *  sanity checks
      * ----------------
      */
     Assert(tup != NULL);

     if (! PointerIsValid(isnull))
-	isnull = &localIsNull;
+        isnull = &localIsNull;

     if (attnum > (int) tup->t_natts) {
-	*isnull = true;
-	return ((char *) NULL);
-    }
-
-    /* ----------------
-     *	take care of user defined attributes
+        *isnull = true;
+        return ((char *) NULL);
+    }
+
+    /* ----------------
+     *  take care of user defined attributes
      * ----------------
      */
     if (attnum > 0) {
-	char  *datum;
-	datum = fastgetattr(tup, attnum, tupleDesc, isnull);
-
-	return (datum);
-    }
-
-    /* ----------------
-     *	take care of system attributes
+        char  *datum;
+        datum = fastgetattr(tup, attnum, tupleDesc, isnull);
+
+        return (datum);
+    }
+
+    /* ----------------
+     *  take care of system attributes
      * ----------------
      */
     *isnull = false;
     return
-	heap_getsysattr(tup, b, attnum);
+        heap_getsysattr(tup, b, attnum);
 }

 /* ----------------


Fix corruption of 2PC recovery with subxacts

Reading 2PC state files during recovery was borked, causing corruptions during
recovery. Effect limited to servers with 2PC, subtransactions and
recovery/replication.

Stas Kelvich, reviewed by Michael Paquier and Pavan Deolasee

--- src/backend/access/transam/twophase.c
+++ src/backend/access/transam/twophase.c
@@ -1758,8 +1758,9 @@
 			 * need to hold a lock while examining it.  We still acquire the
 			 * lock to modify it, though.
 			 */
-			subxids = (TransactionId *)
-				(buf + MAXALIGN(sizeof(TwoPhaseFileHeader)));
+			subxids = (TransactionId *) (buf +
+								MAXALIGN(sizeof(TwoPhaseFileHeader)) +
+								MAXALIGN(hdr->gidlen));
 			for (i = 0; i < hdr->nsubxacts; i++)
 			{
 				TransactionId subxid = subxids[i];
@@ -1877,8 +1878,9 @@
 			 * Examine subtransaction XIDs ... they should all follow main
 			 * XID.
 			 */
-			subxids = (TransactionId *)
-				(buf + MAXALIGN(sizeof(TwoPhaseFileHeader)));
+			subxids = (TransactionId *) (buf +
+								MAXALIGN(sizeof(TwoPhaseFileHeader)) +
+								MAXALIGN(hdr->gidlen));
 			for (i = 0; i < hdr->nsubxacts; i++)
 			{
 				TransactionId subxid = subxids[i];


Fix comments in StrategyNotifyBgWriter().

The interface for the function was changed in
d72731a70450b5e7084991b9caa15cb58a2820df but the comments of the
function was not updated.

Patch by Yugo Nagata.

--- src/backend/storage/buffer/freelist.c
+++ src/backend/storage/buffer/freelist.c
@@ -406,8 +406,8 @@
 /*
  * StrategyNotifyBgWriter -- set or clear allocation notification latch
  *
- * If bgwriterLatch isn't NULL, the next invocation of StrategyGetBuffer will
- * set that latch.  Pass NULL to clear the pending notification before it
+ * If bgwprocno isn't -1, the next invocation of StrategyGetBuffer will
+ * set that latch.  Pass -1 to clear the pending notification before it
  * happens.  This feature is used by the bgwriter process to wake itself up
  * from hibernation, and is not meant for anybody else to use.
  */


test/xml: add attr_key_val_match test

test/xml: add attr_key_val_match test

Currently a bug in the attribute match logic causes the search key to be
checked against XML path attribute keys _and_ values. Test for this.

Signed-off-by: David Disseldorp <589a549dc9f982d9f46aeeb82a09ab6d87ccf1d8@suse.de>

--- test/cm_xml.c
+++ test/cm_xml.c
@@ -89,10 +89,14 @@
 		"<foo full=\"bar\"/>"
 		"<goo />"
 	"</root>";
+static char *cm_xml_data_attr_key_val_match
+	= "<root>"
+		"<foo key=\"okey\"\n"
+		     "okey=\"dokey\" />"
+	"</root>";

 /*
  * TODO test:
- * - attributes where val = search!!!!
  * - multiple parse calls
  * - valgrind memory checks
  */
@@ -919,6 +923,39 @@
 	assert_null(val2);
 }

+/*
+ * Attribute searches should only match keys, not values. Confirm this.
+ */
+static void
+cm_xml_attr_key_val_match(void **state)
+{
+	int ret;
+	struct xml_doc *xdoc;
+	char *val0 = NULL;
+	bool val0_present = false;
+
+	ret = exml_slurp(cm_xml_data_attr_key_val_match,
+			 strlen(cm_xml_data_attr_key_val_match), &xdoc);
+	assert_int_equal(ret, 0);
+
+	ret = exml_str_want(xdoc,
+			    "/root/foo[@okey]",
+			    false,
+			    &val0,
+			    &val0_present);
+	assert_int_equal(ret, 0);
+
+	ret = exml_parse(xdoc);
+	assert_int_equal(ret, 0);
+
+	exml_free(xdoc);
+
+	assert_true(val0_present);
+	assert_non_null(val0);
+	assert_string_equal(val0, "dokey");
+}
+
+
 static const UnitTest cm_xml_tests[] = {
 	unit_test(cm_xml_str_basic),
 	unit_test(cm_xml_str_dup),
@@ -936,6 +973,7 @@
 	unit_test(cm_xml_indexed),
 	unit_test(cm_xml_empty_vals),
 	unit_test(cm_xml_empty_attrs),
+	unit_test(cm_xml_attr_key_val_match),
 };

 int


Adapting to change in button.h

Adapting to change in button.h

--- lax/menubutton.h
+++ lax/menubutton.h
@@ -27,16 +27,16 @@
 #include <lax/button.h>
 #include <lax/menuinfo.h>

-#define MENUBUTTON_DOWNARROW         (1<<22)
-#define MENUBUTTON_CLICK_CALLS_OWNER (1<<23)
-#define MENUBUTTON_LEFT              (1<<24)
-#define MENUBUTTON_RIGHT             (1<<25)
-#define MENUBUTTON_SEND_STRINGS      (1<<26)
+#define MENUBUTTON_DOWNARROW         (1<<23)
+#define MENUBUTTON_CLICK_CALLS_OWNER (1<<24)
+#define MENUBUTTON_LEFT              (1<<25)
+#define MENUBUTTON_RIGHT             (1<<26)
+#define MENUBUTTON_SEND_STRINGS      (1<<27)

-#define MENUBUTTON_ICON_ONLY         (1<<27)
-#define MENUBUTTON_TEXT_ONLY         (1<<28)
-#define MENUBUTTON_TEXT_ICON         (1<<29)
-#define MENUBUTTON_ICON_TEXT         (1<<30)
+#define MENUBUTTON_ICON_ONLY         (1<<28)
+#define MENUBUTTON_TEXT_ONLY         (1<<29)
+#define MENUBUTTON_TEXT_ICON         (1<<30)
+#define MENUBUTTON_ICON_TEXT         (1<<31)

 namespace Laxkit {


boundary checking bugfix

boundary checking bugfix

--- src/access.c
+++ src/access.c
@@ -32,9 +32,8 @@
 	if (array == NULL)
 		return M_ARRAY_E_NULL;

-	if (index >= array->used_length)
+	if (index + object_count >= array->used_length)
 		return M_ARRAY_E_OUT_OF_BOUNDS;
-

 	set(array, index, object_count, data);
 	return M_ARRAY_OK;


Fix prototype and syntax mistake

Fix prototype and syntax mistake

--- src/altera.c
+++ src/altera.c
@@ -1,13 +1,13 @@
 #include "mruby.h"

-extern void altera_piocore_init(mrb_state *mrb);
+extern void altera_piocore_init(mrb_state *mrb, struct RClass *mod);
 extern void altera_piocore_final(mrb_state *mrb);

 void
 mrb_embed_altera_gem_init(mrb_state *mrb)
 {
   struct RClass *mod;
-  mod = mrb_define_module(mrb, "Altera")
+  mod = mrb_define_module(mrb, "Altera");

   altera_piocore_init(mrb, mod);
 }


remove delete -pcd LSA from OS builds

remove delete -pcd LSA from OS builds

ndctl provides zero-label with proper checks

Signed-off-by: Juston Li <bae026f5770cdcf7038fd1a163b858ba9af8c79f@intel.com>

--- DcpmemPkg/cli/NvmDimmCli.c
+++ DcpmemPkg/cli/NvmDimmCli.c
@@ -50,7 +50,6 @@
 #include "Common.h"
 #include "ShowFirmwareCommand.h"
 #include "ShowPcdCommand.h"
-#include "DeletePcdCommand.h"
 #include "StartFormatCommand.h"
 #include "ShowPreferencesCommand.h"
 #include "SetPreferencesCommand.h"
@@ -65,6 +64,7 @@
 #include "DumpSupportCommand.h"
 extern void nvm_current_cmd(struct Command Command);
 #else
+#include "DeletePcdCommand.h"
 EFI_GUID gNvmDimmConfigProtocolGuid = EFI_DCPMM_CONFIG_PROTOCOL_GUID;
 #endif
 EFI_GUID gNvmDimmDriverHealthGuid = EFI_DRIVER_HEALTH_PROTOCOL_GUID;
@@ -453,6 +453,12 @@
   if (EFI_ERROR(Rc)) {
     goto done;
   }
+
+  Rc = RegisterDeletePcdCommand();
+  if (EFI_ERROR(Rc)) {
+    goto done;
+  }
+
 #endif
   Rc = RegisterShowErrorCommand();
   if (EFI_ERROR(Rc)) {
@@ -510,11 +516,6 @@
   }

   Rc = RegisterShowPcdCommand();
-  if (EFI_ERROR(Rc)) {
-    goto done;
-  }
-
-  Rc = RegisterDeletePcdCommand();
   if (EFI_ERROR(Rc)) {
     goto done;
   }


Eliminate const attribute in rdc function input

--- src/P434/P434_internal.h
+++ src/P434/P434_internal.h
@@ -172,12 +172,12 @@
 void fpcorrection434(digit_t* a);

 // 434-bit Montgomery reduction, c = a mod p
-void rdc_mont(const digit_t* a, digit_t* c);
+void rdc_mont(digit_t* a, digit_t* c);
+void rdc434_asm(digit_t* ma, digit_t* mc);

 // Field multiplication using Montgomery arithmetic, c = a*b*R^-1 mod p434, where R=2^768
 void fpmul434_mont(const digit_t* a, const digit_t* b, digit_t* c);
 void mul434_asm(const digit_t* a, const digit_t* b, digit_t* c);
-void rdc434_asm(const digit_t* ma, digit_t* mc);

 // Field squaring using Montgomery arithmetic, c = a*b*R^-1 mod p434, where R=2^768
 void fpsqr434_mont(const digit_t* ma, digit_t* mc);