fix tests/fe/bdm_16

fix tests/fe/bdm_16

--- tests/fe/bdm_16.cc
+++ tests/fe/bdm_16.cc
@@ -44,7 +44,7 @@
           << std::endl;

   for (unsigned int i=0; i<fe_bdm.dofs_per_cell; ++i)
-    std::cout << fe_bdm.restriction_is_additive(i) << " ";
+    deallog << fe_bdm.restriction_is_additive(i) << " ";

   deallog << std::endl;
 }


Remove stray paren.

Remove stray paren.

--- src/global-init.cxx
+++ src/global-init.cxx
@@ -85,7 +85,7 @@
                 InitializerImpl::instance = new InitializerImpl;
             });
 #else
-        InitializerImpl::instance = new InitializerImpl);
+        InitializerImpl::instance = new InitializerImpl;
 #endif

     LOG4CPLUS_THREADED (


PostEffect: 特定のUniform値が宣言されていない場合でも警告を出さない

--- util/posteffect.cpp
+++ util/posteffect.cpp
@@ -43,7 +43,7 @@
 			e.setVStream(_rect11.getVertex(), 0);
 			auto ib = _rect11.getIndex();
 			e.setIStream(ib);
-			e.setUniform(U_RectScale, spn::Vec4{
+			e.setUniform<false>(U_RectScale, spn::Vec4{
 					(_drawRect.x0+_drawRect.x1)/2,
 					(_drawRect.y0+_drawRect.y1)/2,
 					_drawRect.width()/2,


Set all pixels transparent as default

Set all pixels transparent as default

--- include/sani/resource/inl/bitmap_content.inl
+++ include/sani/resource/inl/bitmap_content.inl
@@ -14,6 +14,8 @@
 		template <class PixelType>
 		PixelBitmapContent<PixelType>::PixelBitmapContent(uint32 width, uint32 height)
 			: BitmapContent(width, height), pixels(new PixelType[width * height]) {
+			// transparent
+			memset(pixels, 0, sizeof(PixelType) * width * height);
 			tryGetFormat(format);
 		}


Prevent possible overflow when requesting dialogs

--- Player.hpp
+++ Player.hpp
@@ -522,11 +522,20 @@
             LuaScript::triggerScriptError("Dialog must not be nil!");
         }

-        unsigned int dialogId = dialogCounter++;
-        DialogType *d = new DialogType(*dialog);
-        dialogs[dialogId] = d;
-        boost::shared_ptr<BasicServerCommand>cmd(new DialogCommandType(*dialog, dialogId));
-        Connection->addCommand(cmd);
+        if (dialogs.size() < 100) {
+            unsigned int dialogId = dialogCounter;
+
+            while (dialogs.find(dialogId) != dialogs.end()) {
+                ++dialogId;
+            }
+
+            DialogType *d = new DialogType(*dialog);
+            dialogs[dialogId] = d;
+            boost::shared_ptr<BasicServerCommand>cmd(new DialogCommandType(*dialog, dialogId));
+            Connection->addCommand(cmd);
+        } else {
+            inform("ERROR: Unable to open more than 100 dialogs.");
+        }
     }

 public:


Test: MoveOnly: 値のデリファレンス

Test: MoveOnly: 値のデリファレンス

--- tests/moveonly.hpp
+++ tests/moveonly.hpp
@@ -74,6 +74,14 @@
 		std::ostream& operator << (std::ostream& os, const MoveOnly<T>& m) {
 			return os << m.get();
 		}
+		template <class T>
+		decltype(auto) Deref_MoveOnly(const MoveOnly<T>& m) {
+			return m.get();
+		}
+		template <class T>
+		decltype(auto) Deref_MoveOnly(const T& t) {
+			return t;
+		}

 		template <class T>
 		void ModifyValue(MoveOnly<T>& t) {


Suppress new warnings introduced in g++ 4.3.

git-svn-id: 3ec853389310512053d525963cab269c063bb453@695422 13f79535-47bb-0310-9956-ffa450edef68

--- src/xercesc/framework/XMLBuffer.hpp
+++ src/xercesc/framework/XMLBuffer.hpp
@@ -136,7 +136,7 @@
         if (chars != 0 && *chars != 0) {
             // get length of chars
             XMLSize_t count = 0;
-            for (; *(chars+count); count++ );
+            for (; *(chars+count); count++ ) /*noop*/;

             if (fIndex + count >= fCapacity) {
                 insureCapacity(count);


Fix: need to keep the validation schema property after useScanner.

git-svn-id: 3ec853389310512053d525963cab269c063bb453@174652 13f79535-47bb-0310-9956-ffa450edef68

--- src/xercesc/internal/XMLScanner.cpp
+++ src/xercesc/internal/XMLScanner.cpp
@@ -657,6 +657,7 @@
     setNormalizeData(refScanner->getNormalizeData());
     setExternalSchemaLocation(refScanner->getExternalSchemaLocation());
     setExternalNoNamespaceSchemaLocation(refScanner->getExternalNoNamespaceSchemaLocation());
+    setValidationScheme(refScanner->getValidationScheme());
 }

 // ---------------------------------------------------------------------------


PAR_FIOR test

PAR_FIOR test

--- tests/test-ppluq.C
+++ tests/test-ppluq.C
@@ -59,26 +59,26 @@
   L = FFLAS::fflas_new<Field::Element>(m*R);
   U = FFLAS::fflas_new<Field::Element>(R*n);

-  for (size_t i=0; i<m*R; ++i)
+  PAR_FOR (size_t i=0; i<m*R; ++i)
     F.init(L[i], 0.0);

-  for (size_t i=0; i<m*R; ++i)
+  PAR_FOR (size_t i=0; i<m*R; ++i)
     F.init(U[i], 0.0);

-  for (size_t i=0; i<m*n; ++i)
+  PAR_FOR (size_t i=0; i<m*n; ++i)
     F.init(X[i], 0.0);

   Field::Element zero,one;
   F.init(zero,0.0);
   F.init(one,1.0);
-  for (size_t i=0; i<R; ++i){
+  PAR_FOR (size_t i=0; i<R; ++i){
     for (size_t j=0; j<i; ++j)
       F.assign ( *(U + i*n + j), zero);
     for (size_t j=i; j<n; ++j)
       F.assign (*(U + i*n + j), *(A+ i*n+j));
   }
-  for ( size_t j=0; j<R; ++j ){
+  PAR_FOR ( size_t j=0; j<R; ++j ){
     for (size_t i=0; i<=j; ++i )
       F.assign( *(L+i*R+j), zero);
     F.assign(*(L+j*R+j), one);
@@ -92,21 +92,22 @@
   FFLAS::fgemm (F, FFLAS::FflasNoTrans, FFLAS::FflasNoTrans, m,n,R,
 		1.0, L,R, U,n, 0.0, X,n);
   bool fail = false;
-  for (size_t i=0; i<m; ++i)
+  PAR_FOR (size_t i=0; i<m; ++i)
     for (size_t j=0; j<n; ++j)
       if (!F.areEqual (*(B+i*n+j), *(X+i*n+j))){
-	std::cerr << " B["<<i<<","<<j<<"] = " << (*(B+i*n+j))
-		  << " X["<<i<<","<<j<<"] = " << (*(X+i*n+j))
-		  << std::endl;
-	fail=true;
+          std::stringstream errs;
+          errs << " B["<<i<<","<<j<<"] = " << (*(B+i*n+j))
+                    << " X["<<i<<","<<j<<"] = " << (*(X+i*n+j))
+                    << std::endl;
+          std::cerr << errs;
+          fail=true;
       }
-
+
   if (fail)
-    std::cerr<<"FAIL"<<std::endl;
-
-
+      std::cerr<<"FAIL"<<std::endl;
   else
-    std::cerr<<"PASS"<<std::endl;
+      std::cerr<<"PASS"<<std::endl;
+
   FFLAS::fflas_delete( U);
   FFLAS::fflas_delete( L);
   FFLAS::fflas_delete( X);


Remove flic steering method to comply with kwsPlus.

       * src/hppciServer.cpp

--- src/hppciServer.cpp
+++ src/hppciServer.cpp
@@ -108,7 +108,6 @@
     {
       attMapSteeringMethodFactory["linear"] = new CkwsPlusLinearSteeringMethodFactory;
       attMapSteeringMethodFactory["rs"] = new CkwsPlusRSSteeringMethodFactory(1.0);
-      attMapSteeringMethodFactory["flic"] = new CkwsPlusFlicSteeringMethodFactory();
     }

     void ChppciServer::destroySteeringMethodFactory()
@@ -164,7 +163,6 @@
     {
       attMapDistanceFunctionFactory["linear"] = new CkwsPlusLinearDistanceFactory;
       attMapDistanceFunctionFactory["rs"] = new CkwsPlusRSDistanceFactory(1.0);
-      attMapDistanceFunctionFactory["flic"] = new CkwsPlusApproxFlicDistanceFactory;
     }

     void ChppciServer::destroyDistanceFunctionFactory()


Return JNI_ERR on bad version to AttachCurrentThread

Change-Id: I056cfb0c28ae45033f2080ec99c368b7121f10f0

--- src/jni_internal.cc
+++ src/jni_internal.cc
@@ -377,7 +377,11 @@
   const char* thread_name = NULL;
   jobject thread_group = NULL;
   if (args != NULL) {
-    CHECK_GE(args->version, JNI_VERSION_1_2);
+    if (args->version < JNI_VERSION_1_2) {
+      LOG(WARNING) << "Failed to AttachCurrentThread due to insufficent version "
+                   << std::hex << args->version << " < JNI_VERSION_1_2(" << JNI_VERSION_1_2 << ")";
+      return JNI_ERR;
+    }
     thread_name = args->name;
     thread_group = args->group;
   }


JNI ScopedObjectAccess tweaks for micro benchmarks.

Remove unnecessary ScopedObjectAccess objects (prompted by a micro
benchmark regression) make other uses smaller in scope when possible.

Change-Id: I2fb6d4fdc35b761e0ad505f04f1225d6ca34d747

--- src/jni_internal.cc
+++ src/jni_internal.cc
@@ -666,13 +666,11 @@

 class JNI {
  public:
-  static jint GetVersion(JNIEnv* env) {
-    ScopedObjectAccess soa(env);
+  static jint GetVersion(JNIEnv*) {
     return JNI_VERSION_1_6;
   }

-  static jclass DefineClass(JNIEnv* env, const char*, jobject, const jbyte*, jsize) {
-    ScopedObjectAccess soa(env);
+  static jclass DefineClass(JNIEnv*, const char*, jobject, const jbyte*, jsize) {
     LOG(WARNING) << "JNI DefineClass is not supported";
     return NULL;
   }
@@ -803,8 +801,7 @@
     return soa.AddLocalReference<jthrowable>(exception);
   }

-  static void FatalError(JNIEnv* env, const char* msg) {
-    ScopedObjectAccess soa(env);
+  static void FatalError(JNIEnv*, const char* msg) {
     LOG(FATAL) << "JNI FatalError called: " << msg;
   }

@@ -830,11 +827,10 @@
   }

   static jobject NewGlobalRef(JNIEnv* env, jobject obj) {
-    ScopedObjectAccess soa(env);
     if (obj == NULL) {
       return NULL;
     }
-
+    ScopedObjectAccess soa(env);
     JavaVMExt* vm = soa.Vm();
     IndirectReferenceTable& globals = vm->globals;
     Object* decoded_obj = soa.Decode<Object*>(obj);
@@ -844,11 +840,10 @@
   }

   static void DeleteGlobalRef(JNIEnv* env, jobject obj) {
-    ScopedObjectAccess soa(env);
     if (obj == NULL) {
       return;
     }
-
+    ScopedObjectAccess soa(env);
     JavaVMExt* vm = soa.Vm();
     IndirectReferenceTable& globals = vm->globals;
     MutexLock mu(vm->globals_lock);
@@ -865,11 +860,10 @@
   }

   static void DeleteWeakGlobalRef(JNIEnv* env, jweak obj) {
-    ScopedObjectAccess soa(env);
     if (obj == NULL) {
       return;
     }
-
+    ScopedObjectAccess soa(env);
     JavaVMExt* vm = soa.Vm();
     IndirectReferenceTable& weak_globals = vm->weak_globals;
     MutexLock mu(vm->weak_globals_lock);
@@ -881,11 +875,10 @@
   }

   static jobject NewLocalRef(JNIEnv* env, jobject obj) {
-    ScopedObjectAccess soa(env);
     if (obj == NULL) {
       return NULL;
     }
-
+    ScopedObjectAccess soa(env);
     IndirectReferenceTable& locals = soa.Env()->locals;

     uint32_t cookie = soa.Env()->local_ref_cookie;
@@ -894,11 +887,10 @@
   }

   static void DeleteLocalRef(JNIEnv* env, jobject obj) {
-    ScopedObjectAccess soa(env);
     if (obj == NULL) {
       return;
     }
-
+    ScopedObjectAccess soa(env);
     IndirectReferenceTable& locals = soa.Env()->locals;

     uint32_t cookie = soa.Env()->local_ref_cookie;
@@ -929,7 +921,6 @@
   }

   static jobject NewObject(JNIEnv* env, jclass c, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list args;
     va_start(args, mid);
     jobject result = NewObjectV(env, c, mid, args);
@@ -986,9 +977,9 @@
   }

   static jobject CallObjectMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap));
     va_end(ap);
     return soa.AddLocalReference<jobject>(result.GetL());
@@ -1007,9 +998,9 @@
   }

   static jboolean CallBooleanMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap));
     va_end(ap);
     return result.GetZ();
@@ -1045,9 +1036,9 @@
   }

   static jchar CallCharMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap));
     va_end(ap);
     return result.GetC();
@@ -1064,9 +1055,9 @@
   }

   static jdouble CallDoubleMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap));
     va_end(ap);
     return result.GetD();
@@ -1102,9 +1093,9 @@
   }

   static jint CallIntMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap));
     va_end(ap);
     return result.GetI();
@@ -1121,9 +1112,9 @@
   }

   static jlong CallLongMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap));
     va_end(ap);
     return result.GetJ();
@@ -1140,9 +1131,9 @@
   }

   static jshort CallShortMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap));
     va_end(ap);
     return result.GetS();
@@ -1159,9 +1150,9 @@
   }

   static void CallVoidMethod(JNIEnv* env, jobject obj, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     InvokeVirtualOrInterfaceWithVarArgs(soa, obj, mid, ap);
     va_end(ap);
   }
@@ -1177,9 +1168,9 @@
   }

   static jobject CallNonvirtualObjectMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, obj, mid, ap));
     jobject local_result = soa.AddLocalReference<jobject>(result.GetL());
     va_end(ap);
@@ -1202,9 +1193,9 @@

   static jboolean CallNonvirtualBooleanMethod(JNIEnv* env,
       jobject obj, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, obj, mid, ap));
     va_end(ap);
     return result.GetZ();
@@ -1223,9 +1214,9 @@
   }

   static jbyte CallNonvirtualByteMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, obj, mid, ap));
     va_end(ap);
     return result.GetB();
@@ -1265,9 +1256,9 @@
   }

   static jshort CallNonvirtualShortMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, obj, mid, ap));
     va_end(ap);
     return result.GetS();
@@ -1286,9 +1277,9 @@
   }

   static jint CallNonvirtualIntMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, obj, mid, ap));
     va_end(ap);
     return result.GetI();
@@ -1307,9 +1298,9 @@
   }

   static jlong CallNonvirtualLongMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, obj, mid, ap));
     va_end(ap);
     return result.GetJ();
@@ -1328,9 +1319,9 @@
   }

   static jfloat CallNonvirtualFloatMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, obj, mid, ap));
     va_end(ap);
     return result.GetF();
@@ -1349,9 +1340,9 @@
   }

   static jdouble CallNonvirtualDoubleMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, obj, mid, ap));
     va_end(ap);
     return result.GetD();
@@ -1370,9 +1361,9 @@
   }

   static void CallNonvirtualVoidMethod(JNIEnv* env, jobject obj, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     InvokeWithVarArgs(soa, obj, mid, ap);
     va_end(ap);
   }
@@ -1569,9 +1560,9 @@
   }

   static jobject CallStaticObjectMethod(JNIEnv* env, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, NULL, mid, ap));
     jobject local_result = soa.AddLocalReference<jobject>(result.GetL());
     va_end(ap);
@@ -1591,9 +1582,9 @@
   }

   static jboolean CallStaticBooleanMethod(JNIEnv* env, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, NULL, mid, ap));
     va_end(ap);
     return result.GetZ();
@@ -1610,9 +1601,9 @@
   }

   static jbyte CallStaticByteMethod(JNIEnv* env, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, NULL, mid, ap));
     va_end(ap);
     return result.GetB();
@@ -1629,9 +1620,9 @@
   }

   static jchar CallStaticCharMethod(JNIEnv* env, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, NULL, mid, ap));
     va_end(ap);
     return result.GetC();
@@ -1648,9 +1639,9 @@
   }

   static jshort CallStaticShortMethod(JNIEnv* env, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, NULL, mid, ap));
     va_end(ap);
     return result.GetS();
@@ -1667,9 +1658,9 @@
   }

   static jint CallStaticIntMethod(JNIEnv* env, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, NULL, mid, ap));
     va_end(ap);
     return result.GetI();
@@ -1686,9 +1677,9 @@
   }

   static jlong CallStaticLongMethod(JNIEnv* env, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, NULL, mid, ap));
     va_end(ap);
     return result.GetJ();
@@ -1705,9 +1696,9 @@
   }

   static jfloat CallStaticFloatMethod(JNIEnv* env, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, NULL, mid, ap));
     va_end(ap);
     return result.GetF();
@@ -1724,9 +1715,9 @@
   }

   static jdouble CallStaticDoubleMethod(JNIEnv* env, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     JValue result(InvokeWithVarArgs(soa, NULL, mid, ap));
     va_end(ap);
     return result.GetD();
@@ -1743,9 +1734,9 @@
   }

   static void CallStaticVoidMethod(JNIEnv* env, jclass, jmethodID mid, ...) {
-    ScopedObjectAccess soa(env);
     va_list ap;
     va_start(ap, mid);
+    ScopedObjectAccess soa(env);
     InvokeWithVarArgs(soa, NULL, mid, ap);
     va_end(ap);
   }


fix json test to handle explicit bool

fix json test to handle explicit bool

--- tests/test_json.cc
+++ tests/test_json.cc
@@ -151,7 +151,7 @@
         { "corge", json::array({ 1, 3.14159 }) },
         { "grault", json::array({ "hello", string("world") }) },
     };
-    ASSERT_TRUE(meta);
+    ASSERT_TRUE((bool)meta);
     ASSERT_TRUE(meta.is_object());
     EXPECT_EQ(meta.osize(), 5);
     EXPECT_EQ(meta["foo"].integer(), 17);
@@ -199,9 +199,9 @@

 TEST(Json, Create) {
     json obj1{{}};
-    EXPECT_TRUE(obj1);
+    EXPECT_TRUE((bool)obj1);
     obj1.set("test", "set");
-    EXPECT_TRUE(obj1.get("test"));
+    EXPECT_TRUE((bool)obj1.get("test"));
     json root{
         {"obj1", obj1}
     };


Add some tests to check if the internal flags are updated when writing WAV files.

--- tests/test_wav.cpp
+++ tests/test_wav.cpp
@@ -91,26 +91,29 @@
     {
       RIFF::WAV::File f(filename.c_str());
       CPPUNIT_ASSERT(f.isValid());
+      CPPUNIT_ASSERT(!f.hasID3v2Tag());

       f.ID3v2Tag()->setTitle(L"Title");
       f.ID3v2Tag()->setArtist(L"Artist");
       f.save();
-    }
-
-    {
-      RIFF::WAV::File f(filename.c_str());
-      CPPUNIT_ASSERT(f.isValid());
+      CPPUNIT_ASSERT(f.hasID3v2Tag());
+    }
+    {
+      RIFF::WAV::File f(filename.c_str());
+      CPPUNIT_ASSERT(f.isValid());
+      CPPUNIT_ASSERT(f.hasID3v2Tag());
       CPPUNIT_ASSERT_EQUAL(String(L"Title"),  f.ID3v2Tag()->title());
       CPPUNIT_ASSERT_EQUAL(String(L"Artist"), f.ID3v2Tag()->artist());

       f.ID3v2Tag()->setTitle(L"");
       f.ID3v2Tag()->setArtist(L"");
       f.save();
-    }
-
-    {
-      RIFF::WAV::File f(filename.c_str());
-      CPPUNIT_ASSERT(f.isValid());
+      CPPUNIT_ASSERT(!f.hasID3v2Tag());
+    }
+    {
+      RIFF::WAV::File f(filename.c_str());
+      CPPUNIT_ASSERT(f.isValid());
+      CPPUNIT_ASSERT(!f.hasID3v2Tag());
       CPPUNIT_ASSERT_EQUAL(String(L""), f.ID3v2Tag()->title());
       CPPUNIT_ASSERT_EQUAL(String(L""), f.ID3v2Tag()->artist());
     }
@@ -124,26 +127,30 @@
     {
       RIFF::WAV::File f(filename.c_str());
       CPPUNIT_ASSERT(f.isValid());
+      CPPUNIT_ASSERT(!f.hasInfoTag());

       f.InfoTag()->setTitle(L"Title");
       f.InfoTag()->setArtist(L"Artist");
       f.save();
-    }
-
-    {
-      RIFF::WAV::File f(filename.c_str());
-      CPPUNIT_ASSERT(f.isValid());
+      CPPUNIT_ASSERT(f.hasInfoTag());
+    }
+    {
+      RIFF::WAV::File f(filename.c_str());
+      CPPUNIT_ASSERT(f.isValid());
+      CPPUNIT_ASSERT(f.hasInfoTag());
       CPPUNIT_ASSERT_EQUAL(String(L"Title"),  f.InfoTag()->title());
       CPPUNIT_ASSERT_EQUAL(String(L"Artist"), f.InfoTag()->artist());

       f.InfoTag()->setTitle(L"");
       f.InfoTag()->setArtist(L"");
       f.save();
-    }
-
-    {
-      RIFF::WAV::File f(filename.c_str());
-      CPPUNIT_ASSERT(f.isValid());
+      CPPUNIT_ASSERT(!f.hasInfoTag());
+    }
+
+    {
+      RIFF::WAV::File f(filename.c_str());
+      CPPUNIT_ASSERT(f.isValid());
+      CPPUNIT_ASSERT(!f.hasInfoTag());
       CPPUNIT_ASSERT_EQUAL(String(L""), f.InfoTag()->title());
       CPPUNIT_ASSERT_EQUAL(String(L""), f.InfoTag()->artist());
     }


Roll external/skia 1b0126b01..05784d9b1 (1 commits)

https://skia.googlesource.com/skia.git/+log/1b0126b01..05784d9b1

2017-06-17 halcanary@google.com Image Encoder:  more benches

Test: Presubmit checks will test this change.
Change-Id: Ibb106f80b67d2dce9b121b6bf81ec934ee4913b4

--- bench/EncoderBench.cpp
+++ bench/EncoderBench.cpp
@@ -8,76 +8,115 @@
 #include "Benchmark.h"
 #include "Resources.h"
 #include "SkBitmap.h"
-#include "SkData.h"
-#include "SkImageEncoder.h"
-
-#include "sk_tool_utils.h"
+#include "SkJpegEncoder.h"
+#include "SkPngEncoder.h"
+#include "SkWebpEncoder.h"
+#include "SkStream.h"

 class EncodeBench : public Benchmark {
 public:
-    EncodeBench(const char* filename, SkEncodedImageFormat type, int quality)
-        : fFilename(filename)
-        , fType(type)
-        , fQuality(quality)
-    {
-        // Set the name of the bench
-        SkString name("Encode_");
-        name.append(filename);
-        name.append("_");
-        switch (type) {
-            case SkEncodedImageFormat::kJPEG:
-                name.append("JPEG");
-                break;
-            case SkEncodedImageFormat::kPNG:
-                name.append("PNG");
-                break;
-            case SkEncodedImageFormat::kWEBP:
-                name.append("WEBP");
-                break;
-            default:
-                name.append("Unknown");
-                break;
-        }
-
-        fName = name;
-    }
+    using Encoder = bool (*)(SkWStream*, const SkPixmap&);
+    EncodeBench(const char* filename, Encoder encoder, const char* encoderName)
+        : fSourceFilename(filename)
+        , fEncoder(encoder)
+        , fName(SkStringPrintf("Encode_%s_%s", filename, encoderName)) {}

     bool isSuitableFor(Backend backend) override { return backend == kNonRendering_Backend; }
-
+
     const char* onGetName() override { return fName.c_str(); }
-
+
     void onPreDraw(SkCanvas*) override {
-#ifdef SK_DEBUG
-        bool result =
-#endif
-        GetResourceAsBitmap(fFilename, &fBitmap);
-        SkASSERT(result);
+        SkAssertResult(GetResourceAsBitmap(fSourceFilename, &fBitmap));
     }

     void onDraw(int loops, SkCanvas*) override {
-        for (int i = 0; i < loops; i++) {
-            sk_sp<SkData> data(sk_tool_utils::EncodeImageToData(fBitmap, fType, fQuality));
-            SkASSERT(data);
+        while (loops-- > 0) {
+            SkPixmap pixmap;
+            SkAssertResult(fBitmap.peekPixels(&pixmap));
+            SkNullWStream dst;
+            SkAssertResult(fEncoder(&dst, pixmap));
+            SkASSERT(dst.bytesWritten() > 0);
         }
     }

 private:
-    const char*                fFilename;
-    const SkEncodedImageFormat fType;
-    const int                  fQuality;
-    SkString                   fName;
-    SkBitmap                   fBitmap;
+    const char* fSourceFilename;
+    Encoder     fEncoder;
+    SkString    fName;
+    SkBitmap    fBitmap;
 };

+static bool encode_jpeg(SkWStream* dst, const SkPixmap& src) {
+    SkJpegEncoder::Options opts;
+    opts.fQuality = 90;
+    return SkJpegEncoder::Encode(dst, src, opts);
+}
+
+static bool encode_webp_lossy(SkWStream* dst, const SkPixmap& src) {
+    SkWebpEncoder::Options opts;
+    opts.fCompression = SkWebpEncoder::Compression::kLossy;
+    opts.fQuality = 90;
+    opts.fUnpremulBehavior = SkTransferFunctionBehavior::kIgnore;
+    return SkWebpEncoder::Encode(dst, src, opts);
+}
+
+static bool encode_webp_lossless(SkWStream* dst, const SkPixmap& src) {
+    SkWebpEncoder::Options opts;
+    opts.fCompression = SkWebpEncoder::Compression::kLossless;
+    opts.fQuality = 90;
+    opts.fUnpremulBehavior = SkTransferFunctionBehavior::kIgnore;
+    return SkWebpEncoder::Encode(dst, src, opts);
+}
+
+static bool encode_png(SkWStream* dst,
+                       const SkPixmap& src,
+                       SkPngEncoder::FilterFlag filters,
+                       int zlibLevel) {
+    SkPngEncoder::Options opts;
+    opts.fFilterFlags = filters;
+    opts.fUnpremulBehavior = SkTransferFunctionBehavior::kIgnore;
+    opts.fZLibLevel = zlibLevel;
+    return SkPngEncoder::Encode(dst, src, opts);
+}
+
+#define PNG(FLAG, ZLIBLEVEL) [](SkWStream* d, const SkPixmap& s) { \
+           return encode_png(d, s, SkPngEncoder::FilterFlag::FLAG, ZLIBLEVEL); }
+
+static const char* srcs[2] = {"mandrill_512.png", "color_wheel.jpg"};

 // The Android Photos app uses a quality of 90 on JPEG encodes
-DEF_BENCH(return new EncodeBench("mandrill_512.png", SkEncodedImageFormat::kJPEG, 90));
-DEF_BENCH(return new EncodeBench("color_wheel.jpg", SkEncodedImageFormat::kJPEG, 90));
-
-// PNG encodes are lossless so quality should be ignored
-DEF_BENCH(return new EncodeBench("mandrill_512.png", SkEncodedImageFormat::kPNG, 90));
-DEF_BENCH(return new EncodeBench("color_wheel.jpg", SkEncodedImageFormat::kPNG, 90));
+DEF_BENCH(return new EncodeBench(srcs[0], &encode_jpeg, "JPEG"));
+DEF_BENCH(return new EncodeBench(srcs[1], &encode_jpeg, "JPEG"));

 // TODO: What is the appropriate quality to use to benchmark WEBP encodes?
-DEF_BENCH(return new EncodeBench("mandrill_512.png", SkEncodedImageFormat::kWEBP, 90));
-DEF_BENCH(return new EncodeBench("color_wheel.jpg", SkEncodedImageFormat::kWEBP, 90));
+DEF_BENCH(return new EncodeBench(srcs[0], encode_webp_lossy, "WEBP"));
+DEF_BENCH(return new EncodeBench(srcs[1], encode_webp_lossy, "WEBP"));
+
+DEF_BENCH(return new EncodeBench(srcs[0], encode_webp_lossless, "WEBP_LL"));
+DEF_BENCH(return new EncodeBench(srcs[1], encode_webp_lossless, "WEBP_LL"));
+
+DEF_BENCH(return new EncodeBench(srcs[0], PNG(kAll, 6), "PNG"));
+DEF_BENCH(return new EncodeBench(srcs[0], PNG(kAll, 3), "PNG_3"));
+DEF_BENCH(return new EncodeBench(srcs[0], PNG(kAll, 1), "PNG_1"));
+
+DEF_BENCH(return new EncodeBench(srcs[0], PNG(kSub, 6), "PNG_6s"));
+DEF_BENCH(return new EncodeBench(srcs[0], PNG(kSub, 3), "PNG_3s"));
+DEF_BENCH(return new EncodeBench(srcs[0], PNG(kSub, 1), "PNG_1s"));
+
+DEF_BENCH(return new EncodeBench(srcs[0], PNG(kNone, 6), "PNG_6n"));
+DEF_BENCH(return new EncodeBench(srcs[0], PNG(kNone, 3), "PNG_3n"));
+DEF_BENCH(return new EncodeBench(srcs[0], PNG(kNone, 1), "PNG_1n"));
+
+DEF_BENCH(return new EncodeBench(srcs[1], PNG(kAll, 6), "PNG"));
+DEF_BENCH(return new EncodeBench(srcs[1], PNG(kAll, 3), "PNG_3"));
+DEF_BENCH(return new EncodeBench(srcs[1], PNG(kAll, 1), "PNG_1"));
+
+DEF_BENCH(return new EncodeBench(srcs[1], PNG(kSub, 6), "PNG_6s"));
+DEF_BENCH(return new EncodeBench(srcs[1], PNG(kSub, 3), "PNG_3s"));
+DEF_BENCH(return new EncodeBench(srcs[1], PNG(kSub, 1), "PNG_1s"));
+
+DEF_BENCH(return new EncodeBench(srcs[1], PNG(kNone, 6), "PNG_6n"));
+DEF_BENCH(return new EncodeBench(srcs[1], PNG(kNone, 3), "PNG_3n"));
+DEF_BENCH(return new EncodeBench(srcs[1], PNG(kNone, 1), "PNG_1n"));
+
+#undef PNG


WaE: unused function

WaE: unused function

--- sc/qa/unit/helper/debughelper.hxx
+++ sc/qa/unit/helper/debughelper.hxx
@@ -59,6 +59,9 @@

 namespace {

+#ifdef __GNUC__
+__attribute__((used))
+#endif
 ::std::ostream& operator<< (::std::ostream& os, const rtl::OUString& str)
 {
     return os << ::rtl::OUStringToOString(str, RTL_TEXTENCODING_UTF8).getStr();


fix another validation error for OOXML, related fdo#40746

e.g. exporting fdo40746-2.ods as OOXML

Change-Id: I8a19ec2caecbc3687229d820ac2ec11fc01facd1

--- sc/source/filter/excel/xelink.cxx
+++ sc/source/filter/excel/xelink.cxx
@@ -241,7 +241,7 @@
     /** Writes the list of externalName elements. */
     void                WriteExtNameBufferXml( XclExpXmlStream& rStrm );

-private:
+protected:
     typedef boost::shared_ptr< XclExpExtNameBuffer >   XclExpExtNameBfrRef;
     XclExpExtNameBfrRef mxExtNameBfr;   /// List of EXTERNNAME records.
 };
@@ -1680,14 +1680,18 @@

     }

-    pExternalLink->startElement( XML_sheetDataSet, FSEND);
-
-    // sheetData elements
-    maXctList.SaveXml( rStrm );
-    // externalName elements
-    WriteExtNameBufferXml( rStrm );
-
-    pExternalLink->endElement( XML_sheetDataSet);
+    if (!maXctList.IsEmpty() || mxExtNameBfr)
+    {
+        pExternalLink->startElement( XML_sheetDataSet, FSEND);
+
+        // sheetData elements
+        maXctList.SaveXml( rStrm );
+        // externalName elements
+        WriteExtNameBufferXml( rStrm );
+
+        pExternalLink->endElement( XML_sheetDataSet);
+
+    }
     pExternalLink->endElement( XML_externalBook);
     pExternalLink->endElement( XML_externalLink);
 }


INTEGRATION: CWS changefileheader (1.31.244); FILE MERGED 2008/04/01 15:30:10 thb 1.31.244.3: #i85898# Stripping all external header guards 2008/04/01 12:36:14 thb 1.31.244.2: #i85898# Stripping all external header guards 2008/03/31 17:14:33 rt 1.31.244.1: #i87441# Change license header to LPGL v3.

--- sc/source/filter/excel/xlroot.cxx
+++ sc/source/filter/excel/xlroot.cxx
@@ -1,118 +1,59 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
- *
- *  $RCSfile: xlroot.cxx,v $
- *
- *  $Revision: 1.31 $
- *
- *  last change: $Author: rt $ $Date: 2007-07-03 15:52:14 $
- *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
- *
- *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *    This library is free software; you can redistribute it and/or
- *    modify it under the terms of the GNU Lesser General Public
- *    License version 2.1, as published by the Free Software Foundation.
- *
- *    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
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xlroot.cxx,v $
+ * $Revision: 1.32 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
  *
  ************************************************************************/

 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sc.hxx"
-
-#ifndef SC_XLROOT_HXX
 #include "xlroot.hxx"
-#endif
-
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HPP_
 #include <com/sun/star/i18n/ScriptType.hpp>
-#endif
-
-#ifndef _SV_SVAPP_HXX
 #include <vcl/svapp.hxx>
-#endif
-#ifndef _SFXSTRITEM_HXX
 #include <svtools/stritem.hxx>
-#endif
-#ifndef _SVTOOLS_LANGUAGEOPTIONS_HXX
 #include <svtools/languageoptions.hxx>
-#endif
-#ifndef _SFX_OBJSH_HXX
 #include <sfx2/objsh.hxx>
-#endif
-#ifndef _SFX_PRINTER_HXX
 #include <sfx2/printer.hxx>
-#endif
-#ifndef _SFXDOCFILE_HXX
 #include <sfx2/docfile.hxx>
-#endif
-#ifndef _SV_FONT_HXX
 #include <vcl/font.hxx>
-#endif
-#ifndef _EDITSTAT_HXX
 #include <svx/editstat.hxx>
-#endif
-
-#ifndef SC_ITEMS_HXX
 #include "scitems.hxx"
-#endif
-#ifndef _EEITEM_HXX
 #include <svx/eeitem.hxx>
-#endif
-
-#ifndef SC_DOCUMENT_HXX
 #include "document.hxx"
-#endif
-#ifndef SC_SCDOCPOL_HXX
 #include "docpool.hxx"
-#endif
-#ifndef SC_DOCUNO_HXX
 #include "docuno.hxx"
-#endif
-#ifndef SC_EDITUTIL_HXX
 #include "editutil.hxx"
-#endif
-#ifndef SC_DRWLAYER_HXX
 #include "drwlayer.hxx"
-#endif
-#ifndef SC_SCEXTOPT_HXX
 #include "scextopt.hxx"
-#endif
-#ifndef SC_SCPATATR_HXX
 #include "patattr.hxx"
-#endif
-
-#ifndef SC_FAPIHELPER_HXX
 #include "fapihelper.hxx"
-#endif
-#ifndef SC_XLCONST_HXX
 #include "xlconst.hxx"
-#endif
-#ifndef SC_XLSTYLE_HXX
 #include "xlstyle.hxx"
-#endif
-#ifndef SC_XLCHART_HXX
 #include "xlchart.hxx"
-#endif
-#ifndef SC_XLTRACER_HXX
 #include "xltracer.hxx"
-#endif

 #include "root.hxx"


#89751# don't write COL_AUTO as black background, in fact don't write any transparent background as color

--- sc/source/filter/html/htmlexp.cxx
+++ sc/source/filter/html/htmlexp.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: htmlexp.cxx,v $
  *
- *  $Revision: 1.11 $
- *
- *  last change: $Author: er $ $Date: 2001-07-17 17:53:24 $
+ *  $Revision: 1.12 $
+ *
+ *  last change: $Author: er $ $Date: 2001-07-17 18:43:35 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -684,8 +684,14 @@
             OUT_STR( INetURLObject::AbsToRel( *pLink ) ) << '\"';
         }
     }
-    OUT_SP_CSTR_ASS( sHTML_O_bgcolor );
-    HTMLOutFuncs::Out_Color( rStrm, aHTMLStyle.aBackgroundColor );
+    if ( !aHTMLStyle.aBackgroundColor.GetTransparency() )
+    {   // A transparent background color should always result in default
+        // background of the browser. Also, HTMLOutFuncs::Out_Color() writes
+        // black #000000 for COL_AUTO which is the same as white #ffffff with
+        // transparency set to 0xff, our default background.
+        OUT_SP_CSTR_ASS( sHTML_O_bgcolor );
+        HTMLOutFuncs::Out_Color( rStrm, aHTMLStyle.aBackgroundColor );
+    }

     rStrm << '>'; OUT_LF();


fix bugs in creating data for writing.

fix bugs in creating data for writing.

--- thread_private.cpp
+++ thread_private.cpp
@@ -34,17 +34,25 @@
 	long start_data = aligned_start / sizeof(off_t);
 	long end_data = aligned_end / sizeof(off_t);

+	/* If all data is in one 8-byte word. */
+	if (aligned_start == aligned_end) {
+		memcpy(buf, ((char *) &start_data) + (off - aligned_start), size);
+		return;
+	}
+
 	int first_size =  (int)(sizeof(off_t) - (off - aligned_start));
+	int last_size = (int) (off + size - aligned_end);
+
 	if (first_size == sizeof(off_t))
 		first_size = 0;
 	if (first_size)
 		memcpy(buf, ((char *) &start_data) + (off - aligned_start),
 				first_size);
-	for (int i = first_size; i < size; i += sizeof(off_t)) {
+	for (int i = first_size; i < aligned_end - off; i += sizeof(off_t)) {
 		*((long *) (buf + i)) = (off + i) / sizeof(off_t);
 	}
-	if (aligned_end > aligned_start) {
-		int last_size = (int) (off + size - aligned_end);
+	if (aligned_end > aligned_start
+			|| (aligned_end == aligned_start && first_size == 0)) {
 		if (last_size)
 			memcpy(buf + (aligned_end - off), (char *) &end_data, last_size);
 	}


INTEGRATION: CWS calcwarnings (1.32.60); FILE MERGED 2006/12/14 14:01:17 dr 1.32.60.3: #i69284# remove compiler warnings for unxsols4 2006/12/12 16:42:48 dr 1.32.60.2: #i69284# remove compiler warnings for unxlngi6 2006/12/01 15:39:59 dr 1.32.60.1: #i69284# remove compiler warnings for wntmsci10

--- sc/source/filter/html/htmlexp.cxx
+++ sc/source/filter/html/htmlexp.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: htmlexp.cxx,v $
  *
- *  $Revision: 1.32 $
+ *  $Revision: 1.33 $
  *
- *  last change: $Author: vg $ $Date: 2006-09-27 10:31:46 $
+ *  last change: $Author: vg $ $Date: 2007-02-27 12:30:47 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -182,7 +182,7 @@
 //========================================================================

 FltError ScExportHTML( SvStream& rStrm, const String& rBaseURL, ScDocument* pDoc,
-        const ScRange& rRange, const CharSet eNach, BOOL bAll,
+        const ScRange& rRange, const CharSet /*eNach*/, BOOL bAll,
         const String& rStreamPath, String& rNonConvertibleChars )
 {
     ScHTMLExport aEx( rStrm, rBaseURL, pDoc, rRange, bAll, rStreamPath );
@@ -281,8 +281,8 @@
                             const ScRange& rRangeP,
                             BOOL bAllP, const String& rStreamPathP ) :
     ScExportBase( rStrmP, pDocP, rRangeP ),
+    aBaseURL( rBaseURL ),
     aStreamPath( rStreamPathP ),
-    aBaseURL( rBaseURL ),
     pAppWin( Application::GetDefaultDevice() ),
     pSrcArr( NULL ),
     pDestArr( NULL ),
@@ -291,8 +291,8 @@
     bAll( bAllP ),
     bTabHasGraphics( FALSE ),
     bCalcAsShown( pDocP->GetDocOptions().IsCalcAsShown() ),
-    bTableDataHeight( TRUE ),
-    bTableDataWidth( TRUE )
+    bTableDataWidth( TRUE ),
+    bTableDataHeight( TRUE )
 {
     strcpy( sIndent, sIndentSource );       // #100211# - checked
     sIndent[0] = 0;
@@ -531,7 +531,7 @@
                         ScGlobal::GetScriptedWhichID(
                             aHTMLStyle.nDefaultScriptType, ATTR_FONT_HEIGHT
                             )))).GetHeight();
-        aHTMLStyle.nFontSizeNumber = GetFontSizeNumber( aHTMLStyle.nFontHeight );
+        aHTMLStyle.nFontSizeNumber = GetFontSizeNumber( static_cast< USHORT >( aHTMLStyle.nFontHeight ) );
     }

     // Page style sheet printer settings, e.g. for background graphics.
@@ -570,7 +570,7 @@

         // color
         char hex[7];
-        snprintf( hex, 7, "%06x", pLine->GetColor().GetRGBColor() );
+        snprintf( hex, 7, "%06x", static_cast< unsigned int >( pLine->GetColor().GetRGBColor() ) );
         hex[6] = 0;

         rOut += hex;
@@ -668,10 +668,10 @@
     SCCOL           nEndCol;
     SCROW           nEndRow;
     SCTAB           nEndTab;
-    SCCOL           nStartColFix;
-    SCROW           nStartRowFix;
-    SCCOL           nEndColFix;
-    SCROW           nEndRowFix;
+    SCCOL           nStartColFix = 0;
+    SCROW           nStartRowFix = 0;
+    SCCOL           nEndColFix = 0;
+    SCROW           nEndRowFix = 0;
     ScDrawLayer*    pDrawLayer = pDoc->GetDrawLayer();
     if ( bAll )
     {
@@ -807,14 +807,14 @@

             IncIndent(1); TAG_ON_LF( sHTML_tablerow );
             bTableDataHeight = TRUE;  // height at every first cell of each row
-            for ( SCCOL nCol=nStartCol; nCol<=nEndCol; nCol++ )
+            for ( SCCOL nCol2=nStartCol; nCol2<=nEndCol; nCol2++ )
             {
-                if ( pDoc->GetColFlags( nCol, nTab ) & CR_HIDDEN )
+                if ( pDoc->GetColFlags( nCol2, nTab ) & CR_HIDDEN )
                     continue;   // for

-                if ( nCol == nEndCol )
+                if ( nCol2 == nEndCol )
                     IncIndent(-1);
-                WriteCell( nCol, nRow, nTab );
+                WriteCell( nCol2, nRow, nTab );
                 bTableDataHeight = FALSE;
             }
             bTableDataWidth = FALSE;    // widths only in first row
@@ -867,14 +867,12 @@
         for ( pGraphEntry = aGraphList.First(); pGraphEntry;
               pGraphEntry = aGraphList.Next() )
         {
-
             if ( pGraphEntry->bInCell && pGraphEntry->aRange.In( aPos ) )
             {
                 if ( pGraphEntry->aRange.aStart == aPos )
                     break;  // for
                 else
                     return ;        // ist ein Col/RowSpan, Overlapped
-                break;
             }
         }
     }
@@ -914,7 +912,6 @@
         aStrTD += '"';
     }

-    String      aStr;
     const sal_Char* pChar;
     USHORT nWidthPixel;
     USHORT nHeightPixel;
@@ -923,7 +920,7 @@
     if ( pGraphEntry || rMergeAttr.IsMerged() )
     {
         SCCOL nC, jC;
-        SCROW nR, jR;
+        SCROW nR;
         ULONG v;
         if ( pGraphEntry )
             nC = Max( SCCOL(pGraphEntry->aRange.aEnd.Col() - nCol + 1),
@@ -933,10 +930,10 @@
         if ( nC > 1 )
         {
             (((aStrTD += ' ') += sHTML_O_colspan) += '=') += ByteString::CreateFromInt32( nC );
-            nC += nCol;
+            nC = nC + nCol;
             for ( jC=nCol, v=0; jC<nC; jC++ )
                 v += pDoc->GetColWidth( jC, nTab );
-            nWidthPixel = ToPixel( v );
+            nWidthPixel = ToPixel( static_cast< USHORT >( v ) );
         }
         else
             nWidthPixel = ToPixel( pDoc->GetColWidth( nCol, nTab ) );
@@ -951,7 +948,7 @@
             (((aStrTD += ' ') += sHTML_O_rowspan) += '=') += ByteString::CreateFromInt32( nR );
             nR += nRow;
             v = pDoc->GetRowHeight( nRow, nR-1, nTab );
-            nHeightPixel = ToPixel( v );
+            nHeightPixel = ToPixel( static_cast< USHORT >( v ) );
         }
         else
             nHeightPixel = ToPixel( pDoc->GetRowHeight( nRow, nTab ) );
@@ -1351,7 +1348,7 @@
 void ScHTMLExport::IncIndent( short nVal )
 {
     sIndent[nIndent] = '\t';
-    nIndent += nVal;
+    nIndent = nIndent + nVal;
     if ( nIndent < 0 )
         nIndent = 0;
     else if ( nIndent > nIndentMax )


INTEGRATION: CWS ooo19126 (1.20.114); FILE MERGED 2005/09/05 15:03:35 rt 1.20.114.1: #i54170# Change license header: remove SISSL

--- sc/source/filter/xml/xmldpimp.cxx
+++ sc/source/filter/xml/xmldpimp.cxx
@@ -1,61 +1,35 @@
 /*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
  *
  *  $RCSfile: xmldpimp.cxx,v $
  *
- *  $Revision: 1.20 $
+ *  $Revision: 1.21 $
  *
- *  last change: $Author: rt $ $Date: 2005-03-29 12:53:38 $
+ *  last change: $Author: rt $ $Date: 2005-09-08 20:06:08 $
  *
- *  The Contents of this file are made available subject to the terms of
- *  either of the following licenses
- *
- *         - GNU Lesser General Public License Version 2.1
- *         - Sun Industry Standards Source License Version 1.1
- *
- *  Sun Microsystems Inc., October, 2000
- *
- *  GNU Lesser General Public License Version 2.1
- *  =============================================
- *  Copyright 2000 by Sun Microsystems, Inc.
- *  901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License version 2.1, as published by the Free Software Foundation.
- *
- *  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
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
  *
  *
- *  Sun Industry Standards Source License Version 1.1
- *  =================================================
- *  The contents of this file are subject to the Sun Industry Standards
- *  Source License Version 1.1 (the "License"); You may not use this file
- *  except in compliance with the License. You may obtain a copy of the
- *  License at http://www.openoffice.org/license.html.
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
  *
- *  Software provided under this License is provided on an "AS IS" basis,
- *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
- *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
- *  See the License for the specific provisions governing your rights and
- *  obligations concerning the Software.
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
  *
- *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *    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.
  *
- *  Copyright: 2000 by Sun Microsystems, Inc.
- *
- *  All Rights Reserved.
- *
- *  Contributor(s): _______________________________________
- *
+ *    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
  *
  ************************************************************************/


fix for fdo#37323: Correct autofilter import from ODS.

Signed-off-by: Kohei Yoshida <9e4d5b032dac9356f08b4c568a6a5bfefe761338@novell.com>

--- sc/source/filter/xml/xmldrani.cxx
+++ sc/source/filter/xml/xmldrani.cxx
@@ -466,10 +466,27 @@

         if (pData.get())
         {
-            // Infer sheet index from the name.
-            OUString aStrNum = sDatabaseRangeName.copy(aName.getLength());
-            SCTAB nTab = static_cast<SCTAB>(aStrNum.toInt32());
-
+            ScRange aRange;
+            pData->GetArea(aRange);
+            if (pData->HasAutoFilter())
+            {
+                // Set autofilter flags so that the buttons get displayed.
+                pDoc->ApplyFlagsTab(
+                    aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aStart.Row(),
+                    aRange.aStart.Tab(), SC_MF_AUTO);
+            }
+
+            pDoc->SetAnonymousDBData(aRange.aStart.Tab(), pData.release());
+        }
+        return;
+    }
+    else if (meRangeType == GlobalAnonymous)
+    {
+        OUString aName(RTL_CONSTASCII_USTRINGPARAM(STR_DB_GLOBAL_NONAME));
+        ::std::auto_ptr<ScDBData> pData(ConvertToDBData(aName));
+
+        if (pData.get())
+        {
             if (pData->HasAutoFilter())
             {
                 // Set autofilter flags so that the buttons get displayed.
@@ -478,30 +495,10 @@
                 pDoc->ApplyFlagsTab(
                     aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aStart.Row(),
                     aRange.aStart.Tab(), SC_MF_AUTO);
-            }
-
-            pDoc->SetAnonymousDBData(nTab, pData.release());
-        }
-        return;
-    }
-    else if (meRangeType == GlobalAnonymous)
-    {
-        OUString aName(RTL_CONSTASCII_USTRINGPARAM(STR_DB_GLOBAL_NONAME));
-        ::std::auto_ptr<ScDBData> pData(ConvertToDBData(aName));
-
-        if (pData.get())
-        {
-            if (pData->HasAutoFilter())
-            {
-                // Set autofilter flags so that the buttons get displayed.
-                ScRange aRange;
-                pData->GetArea(aRange);
-                pDoc->ApplyFlagsTab(
-                    aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aStart.Row(),
-                    aRange.aStart.Tab(), SC_MF_AUTO);
-            }
-
-            pDoc->GetDBCollection()->insertAnonRange(pData.release());
+                pDoc->SetAnonymousDBData(aRange.aStart.Tab(), pData.release());
+            }
+            else
+                pDoc->GetDBCollection()->insertAnonRange(pData.release());
         }
         return;
     }


don't export empty color formats & conditional formats

Change-Id: I880facafc155af2e8c67f66f9d3463daf1191207

--- sc/source/filter/xml/xmlexprt.cxx
+++ sc/source/filter/xml/xmlexprt.cxx
@@ -2851,7 +2851,7 @@
             WriteNamedRange(pRangeName);
         }

-        if(getDefaultVersion() > ODFVER_012)
+        if(getDefaultVersion() > SvtSaveOptions::ODFVER_012)
         {
             //export new conditional format information
             ExportConditionalFormat(nTable);
@@ -3823,6 +3823,16 @@
     ScColorFormatList* pColorFormatList = pDoc->GetColorScaleList(nTab);
     if(pCondFormatList || pColorFormatList)
     {
+        bool bExport = false;
+        if(pCondFormatList && pCondFormatList->size())
+            bExport = true;
+
+        if(pColorFormatList && pColorFormatList->size())
+            bExport = true;
+
+        if(!bExport)
+            return;
+
         SvXMLElementExport aElementCondFormats(*this, XML_NAMESPACE_CALC_EXT, XML_CONDITIONAL_FORMATS, true, true);

         if(pCondFormatList)


#90389#; only set the new attributes and not all attributes

--- sc/source/ui/pagedlg/tphfedit.cxx
+++ sc/source/ui/pagedlg/tphfedit.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: tphfedit.cxx,v $
  *
- *  $Revision: 1.5 $
- *
- *  last change: $Author: dr $ $Date: 2001-05-14 09:21:35 $
+ *  $Revision: 1.6 $
+ *
+ *  last change: $Author: sab $ $Date: 2001-08-01 12:10:43 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -527,6 +527,7 @@
         pDlg->SetText( ScGlobal::GetRscString( STR_TEXTATTRS ) );
         if ( pDlg->Execute() == RET_OK )
         {
+            aSet.ClearItem();
             aSet.Put( *pDlg->GetOutputItemSet() );
             pEdView->SetAttribs( aSet );
         }


Substatements, new vector per comma

Substatements, new vector per comma

--- tool/opcc/opcc.cpp
+++ tool/opcc/opcc.cpp
@@ -498,15 +498,15 @@
 };

 struct token_t {
-	filesrcpos		srcpos;
-	token_type		type;
+	filesrcpos			srcpos;
+	token_type			type;
 	union {
-		int64_t		si;
-		uint64_t	ui;
+		int64_t			si;
+		uint64_t		ui;
 	} vali;
-	long double		valf;
-	string			str;
-	vector<token_t>		subtok;
+	long double			valf;
+	string				str;
+	vector< vector<token_t>	>	subtok;

 	void clear(void) {
 		srcpos.clear();
@@ -527,6 +527,15 @@
 		for (si=0;si < tokens.size();si++) {
 			tokens[si].dump(fp);
 			if ((si+1u) < tokens.size()) fprintf(fp," ");
+		}
+	}
+
+	void dumpvvector(FILE *fp,vector< vector<token_t> > &tokens) {
+		size_t si;
+
+		for (si=0;si < tokens.size();si++) {
+			dumpvector(fp,tokens[si]);
+			if ((si+1u) < tokens.size()) fprintf(fp,", ");
 		}
 	}

@@ -551,12 +560,12 @@
 				break;
 			case TK_ARRAYOP:
 				fprintf(fp,"[");
-				dumpvector(fp,subtok);
+				dumpvvector(fp,subtok);
 				fprintf(fp,"]");
 				break;
 			case TK_PARENOP:
 				fprintf(fp,"(");
-				dumpvector(fp,subtok);
+				dumpvvector(fp,subtok);
 				fprintf(fp,")");
 				break;
 			default:
@@ -829,6 +838,8 @@
 bool process_source_statement_sub(token_statement_t &statement,token_substatement_t &tss,token_t &ptok,enum token_type_t end_token,filesource *fsrc) { /* always apppends */
 	token_t tok;

+	ptok.subtok.resize(1);
+
 	do {
 		fsrctok(tok,fsrc);
 		if (tok == TK_EOF) {
@@ -842,7 +853,11 @@

 		if (tok == end_token) break; /* do not include end token */

-		if (tok == TK_SQRBRKT_OPEN) {
+		if (tok == TK_COMMA) {
+			ptok.subtok.push_back(vector<token_t>());
+			continue;
+		}
+		else if (tok == TK_SQRBRKT_OPEN) {
 			tok.type = TK_ARRAYOP;
 			if (!process_source_statement_sub(statement,tss,tok,TK_SQRBRKT_CLOSE,fsrc)) return false;
 		}
@@ -851,7 +866,7 @@
 			if (!process_source_statement_sub(statement,tss,tok,TK_PAREN_CLOSE,fsrc)) return false;
 		}

-		ptok.subtok.push_back(tok);
+		ptok.subtok[ptok.subtok.size()-1u].push_back(tok);
 	} while (1);

 	return true;


createFromAscii->RTL_CONSTASCII_USTRINGPARAM

--- sc/source/ui/unoobj/chart2uno.cxx
+++ sc/source/ui/unoobj/chart2uno.cxx
@@ -1065,7 +1065,7 @@
             if ( xContext.is() )
             {
                 xResult.set( xContext->getServiceManager()->createInstanceWithContext(
-                    ::rtl::OUString::createFromAscii( "com.sun.star.chart2.data.LabeledDataSequence" ),
+                    ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.data.LabeledDataSequence")),
                         xContext ), uno::UNO_QUERY_THROW );
             }
             if ( bHasValues )


Check to db_stress to not allow disable_wal and reopens set together

Summary: db can't reopen safely with disable_wal set!

Test Plan: make db_stress; run db_stress with disable_wal and reopens set and see error

Reviewers: dhruba, vamsi

Reviewed By: dhruba

CC: leveldb

Differential Revision: https://reviews.facebook.net/D10857

--- tools/db_stress.cc
+++ tools/db_stress.cc
@@ -1152,7 +1152,10 @@
       fprintf(stderr, "Error: Read + Delete percents > 100!\n");
       exit(1);
   }
-
+  if (FLAGS_disable_wal == 1 && FLAGS_reopen > 0) {
+      fprintf(stderr, "Error: Db cannot reopen safely with disable_wal set!\n");
+      exit(1);
+  }
   if ((unsigned)FLAGS_reopen >= FLAGS_ops_per_thread) {
       fprintf(stderr, "Error: #DB-reopens should be < ops_per_thread\n"
         "Provided reopens = %d and ops_per_thread = %u\n", FLAGS_reopen,


flags for otc-distance

flags for otc-distance

--- tools/distance.cpp
+++ tools/distance.cpp
@@ -63,6 +63,8 @@
                 }
             }
             totalNumNotDisplayed += numNotDisplayed;
+            totalNumDisplayed += numDisplayed;
+
         }
         // display
         // header if first comparison
@@ -118,11 +120,61 @@

 };

+bool handleShowRF(OTCLI & otCLI, const std::string &);
+bool handleShowNumDisplayed(OTCLI & otCLI, const std::string &);
+bool handleShowShowNumNotDisplayed(OTCLI & otCLI, const std::string &);
+bool handleShowInternals(OTCLI & otCLI, const std::string &);
+
+bool handleShowRF(OTCLI & otCLI, const std::string &) {
+    DistanceState * proc = static_cast<DistanceState *>(otCLI.blob);
+    assert(proc != nullptr);
+    proc->showRF = true;
+    return true;
+}
+
+bool handleShowNumDisplayed(OTCLI & otCLI, const std::string &) {
+    DistanceState * proc = static_cast<DistanceState *>(otCLI.blob);
+    assert(proc != nullptr);
+    proc->showNumDisplayed = true;
+    return true;
+}
+
+bool handleShowShowNumNotDisplayed(OTCLI & otCLI, const std::string &) {
+    DistanceState * proc = static_cast<DistanceState *>(otCLI.blob);
+    assert(proc != nullptr);
+    proc->showNumNotDisplayed = true;
+    return true;
+}
+
+bool handleShowInternals(OTCLI & otCLI, const std::string &) {
+    DistanceState * proc = static_cast<DistanceState *>(otCLI.blob);
+    assert(proc != nullptr);
+    proc->showNumInternals = true;
+    return true;
+}
+
 int main(int argc, char *argv[]) {
     OTCLI otCLI("otc-distance",
                 "takes at least 2 newick file paths: a supertree and some number of input trees. Writes one line for each input tree with the statistics requested for the comparison of the supertree to each input tree.",
                 "synth.tre inp1.tre inp2.tre");
     DistanceState proc;
+    otCLI.addFlag('r',
+                  "Show RF symmetric distance",
+                  handleShowRF,
+                  false);
+    otCLI.addFlag('d',
+                  "Show number of grouping in each input displayed on full tree",
+                  handleShowNumDisplayed,
+                  false);
+    otCLI.addFlag('n',
+                  "Show number of grouping in each input NOT displayed on full tree",
+                  handleShowShowNumNotDisplayed,
+                  false);
+    otCLI.addFlag('i',
+                  "Show the number of internal groupings in each input tree",
+                  handleShowInternals,
+                  false);
+
     auto rc = taxDependentTreeProcessingMain(otCLI, argc, argv, proc, 2, true);
     return rc;
 }


transport/event: Eliminate ifdef'd code

transport/event: Eliminate ifdef'd code

We do serialization in transport/server.cc and there's no need for
the equals() and hashCode() function so just drop ifdef'd code.

Signed-off-by: Pekka Enberg <add4fcd06328a394f0ad91feda7ee057316dc5ed@cloudius-systems.com>

--- transport/event.hh
+++ transport/event.hh
@@ -45,35 +45,6 @@
     { }
 public:

-#if 0
-    public static Event deserialize(ByteBuf cb, int version)
-    {
-        switch (CBUtil.readEnumValue(Type.class, cb))
-        {
-            case TOPOLOGY_CHANGE:
-                return TopologyChange.deserializeEvent(cb, version);
-            case STATUS_CHANGE:
-                return StatusChange.deserializeEvent(cb, version);
-            case SCHEMA_CHANGE:
-                return SchemaChange.deserializeEvent(cb, version);
-        }
-        throw new AssertionError();
-    }
-
-    public void serialize(ByteBuf dest, int version)
-    {
-        CBUtil.writeEnumValue(type, dest);
-        serializeEvent(dest, version);
-    }
-
-    public int serializedSize(int version)
-    {
-        return CBUtil.sizeOfEnumValue(type) + eventSerializedSize(version);
-    }
-
-    protected abstract void serializeEvent(ByteBuf dest, int version);
-    protected abstract int eventSerializedSize(int version);
-#endif
     class topology_change;
     class status_change;
     class schema_change;
@@ -106,50 +77,6 @@
         {
             return topology_change{change_type::MOVED_NODE, ipv4_addr{host.raw_addr(), port}};
         }
-
-#if 0
-        // Assumes the type has already been deserialized
-        private static TopologyChange deserializeEvent(ByteBuf cb, int version)
-        {
-            Change change = CBUtil.readEnumValue(Change.class, cb);
-            InetSocketAddress node = CBUtil.readInet(cb);
-            return new TopologyChange(change, node);
-        }
-
-        protected void serializeEvent(ByteBuf dest, int version)
-        {
-            CBUtil.writeEnumValue(change, dest);
-            CBUtil.writeInet(node, dest);
-        }
-
-        protected int eventSerializedSize(int version)
-        {
-            return CBUtil.sizeOfEnumValue(change) + CBUtil.sizeOfInet(node);
-        }
-
-        @Override
-        public String toString()
-        {
-            return change + " " + node;
-        }
-
-        @Override
-        public int hashCode()
-        {
-            return Objects.hashCode(change, node);
-        }
-
-        @Override
-        public boolean equals(Object other)
-        {
-            if (!(other instanceof TopologyChange))
-                return false;
-
-            TopologyChange tpc = (TopologyChange)other;
-            return Objects.equal(change, tpc.change)
-                && Objects.equal(node, tpc.node);
-        }
-#endif
     };

     class event::status_change : public event {
@@ -174,50 +101,6 @@
         {
             return status_change{status_type::DOWN, ipv4_addr{host.raw_addr(), port}};
         }
-
-#if 0
-        // Assumes the type has already been deserialized
-        private static StatusChange deserializeEvent(ByteBuf cb, int version)
-        {
-            Status status = CBUtil.readEnumValue(Status.class, cb);
-            InetSocketAddress node = CBUtil.readInet(cb);
-            return new StatusChange(status, node);
-        }
-
-        protected void serializeEvent(ByteBuf dest, int version)
-        {
-            CBUtil.writeEnumValue(status, dest);
-            CBUtil.writeInet(node, dest);
-        }
-
-        protected int eventSerializedSize(int version)
-        {
-            return CBUtil.sizeOfEnumValue(status) + CBUtil.sizeOfInet(node);
-        }
-
-        @Override
-        public String toString()
-        {
-            return status + " " + node;
-        }
-
-        @Override
-        public int hashCode()
-        {
-            return Objects.hashCode(status, node);
-        }
-
-        @Override
-        public boolean equals(Object other)
-        {
-            if (!(other instanceof StatusChange))
-                return false;
-
-            StatusChange stc = (StatusChange)other;
-            return Objects.equal(status, stc.status)
-                && Objects.equal(node, stc.node);
-        }
-#endif
     };

     class event::schema_change : public event {
@@ -246,107 +129,6 @@
         schema_change(const change_type change_, const sstring keyspace_)
             : schema_change{change_, target_type::KEYSPACE, keyspace_, std::experimental::optional<sstring>{}}
         { }
-#if 0
-        // Assumes the type has already been deserialized
-        public static SchemaChange deserializeEvent(ByteBuf cb, int version)
-        {
-            Change change = CBUtil.readEnumValue(Change.class, cb);
-            if (version >= 3)
-            {
-                Target target = CBUtil.readEnumValue(Target.class, cb);
-                String keyspace = CBUtil.readString(cb);
-                String tableOrType = target == Target.KEYSPACE ? null : CBUtil.readString(cb);
-                return new SchemaChange(change, target, keyspace, tableOrType);
-            }
-            else
-            {
-                String keyspace = CBUtil.readString(cb);
-                String table = CBUtil.readString(cb);
-                return new SchemaChange(change, table.isEmpty() ? Target.KEYSPACE : Target.TABLE, keyspace, table.isEmpty() ? null : table);
-            }
-        }
-
-        public void serializeEvent(ByteBuf dest, int version)
-        {
-            if (version >= 3)
-            {
-                CBUtil.writeEnumValue(change, dest);
-                CBUtil.writeEnumValue(target, dest);
-                CBUtil.writeString(keyspace, dest);
-                if (target != Target.KEYSPACE)
-                    CBUtil.writeString(tableOrTypeOrFunction, dest);
-            }
-            else
-            {
-                if (target == Target.TYPE)
-                {
-                    // For the v1/v2 protocol, we have no way to represent type changes, so we simply say the keyspace
-                    // was updated.  See CASSANDRA-7617.
-                    CBUtil.writeEnumValue(Change.UPDATED, dest);
-                    CBUtil.writeString(keyspace, dest);
-                    CBUtil.writeString("", dest);
-                }
-                else
-                {
-                    CBUtil.writeEnumValue(change, dest);
-                    CBUtil.writeString(keyspace, dest);
-                    CBUtil.writeString(target == Target.KEYSPACE ? "" : tableOrTypeOrFunction, dest);
-                }
-            }
-        }
-
-        public int eventSerializedSize(int version)
-        {
-            if (version >= 3)
-            {
-                int size = CBUtil.sizeOfEnumValue(change)
-                         + CBUtil.sizeOfEnumValue(target)
-                         + CBUtil.sizeOfString(keyspace);
-
-                if (target != Target.KEYSPACE)
-                    size += CBUtil.sizeOfString(tableOrTypeOrFunction);
-
-                return size;
-            }
-            else
-            {
-                if (target == Target.TYPE)
-                {
-                    return CBUtil.sizeOfEnumValue(Change.UPDATED)
-                         + CBUtil.sizeOfString(keyspace)
-                         + CBUtil.sizeOfString("");
-                }
-                return CBUtil.sizeOfEnumValue(change)
-                     + CBUtil.sizeOfString(keyspace)
-                     + CBUtil.sizeOfString(target == Target.KEYSPACE ? "" : tableOrTypeOrFunction);
-            }
-        }
-
-        @Override
-        public String toString()
-        {
-            return change + " " + target + " " + keyspace + (tableOrTypeOrFunction == null ? "" : "." + tableOrTypeOrFunction);
-        }
-
-        @Override
-        public int hashCode()
-        {
-            return Objects.hashCode(change, target, keyspace, tableOrTypeOrFunction);
-        }
-
-        @Override
-        public boolean equals(Object other)
-        {
-            if (!(other instanceof SchemaChange))
-                return false;
-
-            SchemaChange scc = (SchemaChange)other;
-            return Objects.equal(change, scc.change)
-                && Objects.equal(target, scc.target)
-                && Objects.equal(keyspace, scc.keyspace)
-                && Objects.equal(tableOrTypeOrFunction, scc.tableOrTypeOrFunction);
-        }
-#endif
     };

 }


Fix a problem in TTree::ChangeFile when the current file contains several Trees.
The headers of the non-current Tree were written to the new file instead of the old file.
Thanks to Andriy Zatserklyaniy for reporting this problem.

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@10225 27541ba8-7e3a-0410-8455-c3a389f83636

--- tree/src/TTree.cxx
+++ tree/src/TTree.cxx
@@ -1,4 +1,4 @@
-// @(#)root/tree:$Name:  $:$Id: TTree.cxx,v 1.208 2004/09/04 11:03:28 brun Exp $
+// @(#)root/tree:$Name:  $:$Id: TTree.cxx,v 1.209 2004/09/22 07:19:39 brun Exp $
 // Author: Rene Brun   12/01/96

 /*************************************************************************
@@ -1598,7 +1598,7 @@
       if (obj->InheritsFrom("TTree")) {
          TTree *t = (TTree*)obj;
          if (t != this) {
-            t->Write();
+            t->AutoSave();
             t->Reset();
             t->fFileNumber = fFileNumber;
          }
@@ -1607,7 +1607,7 @@
          while ((branch = (TBranch*)nextb())) {
             branch->SetFile(newfile);
          }
-		 if (t->GetBranchRef()) t->GetBranchRef()->SetFile(newfile);
+	 if (t->GetBranchRef()) t->GetBranchRef()->SetFile(newfile);
       }
    }
    delete file;


Remove tools/list.hxx include

Remove tools/list.hxx include

--- sd/source/filter/ppt/propread.hxx
+++ sd/source/filter/ppt/propread.hxx
@@ -35,7 +35,6 @@
 #include <tools/solar.h>
 #include <sot/storage.hxx>
 #include <tools/gen.hxx>
-#include <tools/list.hxx>
 #include <tools/stream.hxx>
 #include <tools/datetime.hxx>


Fix config file conversion for DEF_SOUND

svn path=/trunk/KDE/kdepim/; revision=597535

--- kalarm/preferences.cpp
+++ kalarm/preferences.cpp
@@ -607,6 +607,7 @@

 	// Convert KAlarm pre-1.4.5 preferences
 	static const char* DEF_SOUND = "DefSound";
+	config->setGroup(DEFAULTS_SECTION);
 	bool sound = config->readEntry(DEF_SOUND, false);
 	if (!sound)
 		config->writeEntry(DEF_SOUND_TYPE, static_cast<int>(SoundPicker::NONE));


printing enter/exit inside the critical region

--- loom-bit/sync_objs.cpp
+++ loom-bit/sync_objs.cpp
@@ -20,13 +20,13 @@
 int enter_critical_region(argument_t arg) {
 	long fix_id = (long)arg;
 	pthread_mutex_lock(&mutexes[fix_id]);
-	fprintf(stderr, "enter_critical_region %p\n", &mutexes[fix_id]);
+	// fprintf(stderr, "enter_critical_region %p\n", &mutexes[fix_id]);
 	return 0;
 }

 int exit_critical_region(argument_t arg) {
 	long fix_id = (long)arg;
-	fprintf(stderr, "exit_critical_region %p\n", &mutexes[fix_id]);
+	// fprintf(stderr, "exit_critical_region %p\n", &mutexes[fix_id]);
 	pthread_mutex_unlock(&mutexes[fix_id]);
 	return 0;
 }


INTEGRATION: CWS ooo19126 (1.11.346); FILE MERGED 2005/09/05 15:00:53 rt 1.11.346.1: #i54170# Change license header: remove SISSL

--- sc/inc/patattr.hxx
+++ sc/inc/patattr.hxx
@@ -1,61 +1,35 @@
 /*************************************************************************
  *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
  *  $RCSfile: patattr.hxx,v $
  *
- *  $Revision: 1.11 $
- *
- *  last change: $Author: rt $ $Date: 2004-08-23 09:25:17 $
- *
- *  The Contents of this file are made available subject to the terms of
- *  either of the following licenses
- *
- *         - GNU Lesser General Public License Version 2.1
- *         - Sun Industry Standards Source License Version 1.1
- *
- *  Sun Microsystems Inc., October, 2000
- *
- *  GNU Lesser General Public License Version 2.1
- *  =============================================
- *  Copyright 2000 by Sun Microsystems, Inc.
- *  901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License version 2.1, as published by the Free Software Foundation.
- *
- *  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
- *
- *
- *  Sun Industry Standards Source License Version 1.1
- *  =================================================
- *  The contents of this file are subject to the Sun Industry Standards
- *  Source License Version 1.1 (the "License"); You may not use this file
- *  except in compliance with the License. You may obtain a copy of the
- *  License at http://www.openoffice.org/license.html.
- *
- *  Software provided under this License is provided on an "AS IS" basis,
- *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
- *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
- *  See the License for the specific provisions governing your rights and
- *  obligations concerning the Software.
- *
- *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
- *
- *  Copyright: 2000 by Sun Microsystems, Inc.
- *
- *  All Rights Reserved.
- *
- *  Contributor(s): _______________________________________
- *
+ *  $Revision: 1.12 $
+ *
+ *  last change: $Author: rt $ $Date: 2005-09-08 17:48:10 $
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
+ *
+ *    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
  *
  ************************************************************************/


GoView: random color choice gives less saturated colors

--- viewlib/src/gvApplication.C
+++ viewlib/src/gvApplication.C
@@ -91,22 +91,52 @@
 //class ParametricSurfaceTesselator;

-
-#define MAX_COLORS 12
-int colors[MAX_COLORS][3] = {
-  {255, 0, 0},
-  {0, 255, 0},
-  {0, 0, 255},
-  {255, 255, 0},
-  {255, 0, 255},
-  {0, 255, 255},
-  {128, 255, 0},
-  {255, 128, 0},
-  {128, 0, 255},
-  {255, 0, 128},
-  {0, 128, 255},
-  {0, 255, 128},
-};
+// define some color transformations
+#define RETURN_HSV(h, s, v) {HSV.H = h; HSV.S = s; HSV.V = v; return HSV;}
+#define RETURN_RGB(r, g, b) {RGB.R = r; RGB.G = g; RGB.B = b; return RGB;}
+#define min(x,y,z) (x<y) ? ((x<z)?x:z) : ((y<z)?y:z)
+#define max(x,y,z) (x>y) ? ((x>z)?x:z) : ((y>z)?y:z)
+#define UNDEFINED -1
+typedef struct {float R, G, B;} RGBType;
+typedef struct {float H, S, V;} HSVType;
+HSVType RGB_to_HSV( RGBType RGB ) {
+	// RGB are each on [0, 1]. S and V are returned on [0, 1] and H is
+	// returned on [0, 6]. Exception: H is returned UNDEFINED if S==0.
+	float R = RGB.R, G = RGB.G, B = RGB.B, v, x, f;
+	int i;
+	HSVType HSV;
+
+	x = min(R, G, B);
+	v = max(R, G, B);
+	if(v == x) RETURN_HSV(UNDEFINED, 0, v);
+	f = (R == x) ? G - B : ((G == x) ? B - R : R - G);
+	i = (R == x) ? 3 : ((G == x) ? 5 : 1);
+	RETURN_HSV(i - f /(v - x), (v - x)/v, v);
+}
+RGBType HSV_to_RGB( HSVType HSV ) {
+	// H is given on [0, 6] or UNDEFINED. S and V are given on [0, 1].
+	// RGB are each returned on [0, 1].
+	float h = HSV.H, s = HSV.S, v = HSV.V, m, n, f;
+	int i;
+	RGBType RGB;
+
+	if (h == UNDEFINED) RETURN_RGB(v, v, v);
+	i = floor(h);
+	f = h - i;
+	if ( !(i&1) ) f = 1 - f; // if i is even
+	m = v * (1 - s);
+	n = v * (1 - s * f);
+	switch (i) {
+		case 6:
+		case 0: RETURN_RGB(v, n, m);
+		case 1: RETURN_RGB(n, v, m);
+		case 2: RETURN_RGB(m, v, n)
+		case 3: RETURN_RGB(m, n, v);
+		case 4: RETURN_RGB(n, m, v);
+		case 5: RETURN_RGB(v, m, n);
+	}
+	RETURN_RGB(0,0,0); // should never reach here, but compiler complains
+}

 string getFileName(const string& s) {
@@ -1084,22 +1114,23 @@
 //===========================================================================
 {
     srand ( time(NULL) );
-    int col_id = rand() % MAX_COLORS;
     for (int ki = 0; ki < data_.numObjects(); ++ki)
     {
-	if (data_.getSelectedStateObject(ki))
-	{
-	    col_id = col_id%MAX_COLORS;
-	    shared_ptr<gvColor> col = data_.color(ki);
-	    if (col.get() == NULL)
-	    {
-		col = shared_ptr<gvColor>(new gvColor());
-
-	    }
-	    for (int kj = 0; kj < 3; ++kj)
-		col->rgba[kj] = (float)colors[col_id][kj]/(float)255;
-	    ++col_id;
-	}
+        if (data_.getSelectedStateObject(ki))
+        {
+            HSVType newCol={4.6*rand()/RAND_MAX    ,  // hue        [0,4.6]
+                             .3*rand()/RAND_MAX +.4,  // saturation [.4,.7]
+                             .4*rand()/RAND_MAX +.55};// value    [.55,.95]
+            RGBType newColRGB = HSV_to_RGB(newCol);
+            shared_ptr<gvColor> col = data_.color(ki);
+            if (col.get() == NULL)
+            {
+                col = shared_ptr<gvColor>(new gvColor());
+            }
+            col->rgba[0] = newColRGB.R;
+            col->rgba[1] = newColRGB.G;
+            col->rgba[2] = newColRGB.B;
+        }
     }

     int num_objs = data_.numObjects();
@@ -1259,7 +1290,8 @@
 	object_menu_->addAction("Show control nets...", this,
 			       SLOT(show_control_nets()));
 	object_menu_->addAction("Set random color...", this,
-			       SLOT(set_random_color()));
+			       SLOT(set_random_color()),
+                   Qt::CTRL+Qt::Key_C);
 	object_menu_->addAction("Toggle enable", this,
 				SLOT(toggle_enable()),
 			       Qt::CTRL+Qt::Key_T);


test: fix a race in ResetLargeResponseUponReceivingHeaders (#22980)

Signed-off-by: Benjamin Peterson <fe09bc2ef2737a3258f978e26226dcbac1b3f948@engflow.com>

--- test/integration/protocol_integration_test.cc
+++ test/integration/protocol_integration_test.cc
@@ -3290,8 +3290,6 @@
   if (downstreamProtocol() == Http::CodecType::HTTP1) {
     return;
   }
-  autonomous_upstream_ = true;
-  autonomous_allow_incomplete_streams_ = true;
   initialize();

   envoy::config::core::v3::Http2ProtocolOptions http2_options =
@@ -3302,22 +3300,33 @@
   codec_client_ = makeRawHttpConnection(makeClientConnection(lookupPort("http")), http2_options);

   // The response is larger than the stream flow control window. So the reset of it will
-  // likely be buffered QUIC stream send buffer.
+  // likely be buffered in the QUIC stream send buffer.
   constexpr uint64_t response_size = 100 * 1024;
-  auto encoder_decoder = codec_client_->startRequest(
-      Http::TestRequestHeaderMapImpl{{":method", "POST"},
-                                     {":path", "/"},
-                                     {":scheme", "http"},
-                                     {":authority", "sni.lyft.com"},
-                                     {"content-length", "10"},
-                                     {"response_size_bytes", absl::StrCat(response_size)}});
+
+  auto encoder_decoder =
+      codec_client_->startRequest(Http::TestRequestHeaderMapImpl{{":method", "POST"},
+                                                                 {":path", "/"},
+                                                                 {":scheme", "http"},
+                                                                 {":authority", "sni.lyft.com"},
+                                                                 {"content-length", "10"}});
   auto& encoder = encoder_decoder.first;
+
   std::string data(10, 'a');
   codec_client_->sendData(encoder, data, true);

+  ASSERT_TRUE(fake_upstreams_[0]->waitForHttpConnection(*dispatcher_, fake_upstream_connection_));
+  ASSERT_TRUE(fake_upstream_connection_->waitForNewStream(*dispatcher_, upstream_request_));
+  upstream_request_->encodeHeaders(
+      Http::TestResponseHeaderMapImpl{{":status", "200"},
+                                      {"content-length", absl::StrCat(response_size)}},
+      false);
+
   auto response = std::move(encoder_decoder.second);
   response->waitForHeaders();
-  // Reset stream while the quic server stream might have FIN buffered in its send buffer.
+  encoder.getStream().readDisable(true);
+  upstream_request_->encodeData(response_size, true);
+  ASSERT_TRUE(fake_upstream_connection_->waitForNoPost());
+  // Reset stream while the quic server stream has FIN buffered in its send buffer.
   codec_client_->sendReset(encoder);
   codec_client_->close();
 }


Detect checkerboard corners

Detect checkerboard corners

--- vision/calibrate_cameras.cc
+++ vision/calibrate_cameras.cc
@@ -20,6 +20,7 @@

     // Open video capture devices
     vector<VideoCapture> devices;
+    vector<vector<Point2f>> img_points;
     for (int i = 4; i < argc; i++) {
         int id = atoi(argv[i]);
         VideoCapture device(id);
@@ -27,22 +28,44 @@
             devices.push_back(device);
             device.set(CV_CAP_PROP_FRAME_WIDTH, 1280);
             device.set(CV_CAP_PROP_FRAME_HEIGHT, 720);
+            device.set(CV_CAP_PROP_FPS, 30);
+            img_points.push_back(vector<Point2f>());
         }
         else {
             std::cerr << "Failed to open video capture device " << id << std::endl;
         }
     }

+    // Calibration variables
+    Size checkerboard_size(cols, rows);
+
+    int key = 0;
     Mat frame, gray;
-    while (true) {
+    vector<Point2f> corners;
+    while (key != 27) { // Quit on escape keypress
         for (size_t i = 0; i < devices.size(); i++) {
             devices[i] >> frame;
+
+            // Detect checkerboards on spacebar
+            if (waitKey(1) == 32) {
+                cvtColor(frame, gray, COLOR_BGR2GRAY);
+                bool found = findChessboardCorners(gray, checkerboard_size, corners);
+                if (found) {
+                    std::cout << "Found checkerboard on " << i << std::endl;
+                    img_points[i].insert(
+                            std::end(img_points[i]), std::begin(corners), std::end(corners));
+                    cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1),
+                            TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
+                }
+                drawChessboardCorners(frame, checkerboard_size, Mat(corners), found);
+            }
+
             imshow(std::to_string(i), frame);
         }

-        // Quit on escape keypress
-        if (waitKey(16) >= 27) {
-            break;
+        key = waitKey(16);
+        if (key == 'W') { // Write calibration to text files
+            std::cout << "TODO Write to output" << std:: endl;
         }
     }
 }


parentLookup is only used locally.

parentLookup is only used locally.

--- server/src/handler/list.cpp
+++ server/src/handler/list.cpp
@@ -163,7 +163,6 @@
 Collection::List List::retrieveChildren(const Collection &topParent, int depth)
 {
     QHash<qint64 /*id*/, Collection> collections;
-    QMultiHash<qint64 /* parent */, qint64 /* children */> parentLookup;

     const qint64 parentId = topParent.isValid() ? topParent.id() : 0;
     {
@@ -207,12 +206,15 @@
         }
         Q_FOREACH (const Collection &col, qb.result()) {
             collections.insert(col.id(), col);
-            parentLookup.insertMulti(col.parentId(), col.id());
         }
     }

     //Post filtering that we couldn't do as part of the sql query
     if (topParent.isValid() || !mMimeTypes.isEmpty()) {
+        QMultiHash<qint64 /* parent */, qint64 /* children */> parentLookup;
+        Q_FOREACH (const Collection &col, collections) {
+            parentLookup.insertMulti(col.parentId(), col.id());
+        }
         auto it = collections.begin();
         while (it != collections.end()) {
             //Filter by mimetype
@@ -268,7 +270,6 @@
                 //Don't include the collection when only looking for enabled collections.
                 //However, a referenced collection should be still synchronized by the resource, so we exclude this case.
                 if (!checkFilterCondition(*it) && !(mCollectionsToSynchronize && connection()->context()->resource().isValid())) {
-                    parentLookup.remove(it->id());
                     it = collections.erase(it);
                     continue;
                 }


fix 2

fix 2

--- src/lv5/jsobject.cc
+++ src/lv5/jsobject.cc
@@ -233,8 +233,8 @@
       if (!current.IsConfigurableAbsent() && !current.IsConfigurable()) {
         const AccessorDescriptor* const lhs = current.AsAccessorDescriptor();
         const AccessorDescriptor* const rhs = desc.AsAccessorDescriptor();
-        if ((lhs->set() && (lhs->set() != rhs->set())) ||
-            (lhs->get() && (lhs->get() != rhs->get()))) {
+        if ((rhs->set() && (lhs->set() != rhs->set())) ||
+            (rhs->get() && (lhs->get() != rhs->get()))) {
           REJECT("changing [[Set]] or [[Get]] "
                  "of unconfigurable property not allowed");
         }


Fix --help output

Fix --help output

--- jsonnet.cpp
+++ jsonnet.cpp
@@ -64,14 +64,14 @@
     o << "jsonnet {<option>} [<filename>]\n";
     o << "where <filename> defaults to - (stdin)\n";
     o << "and <option> can be:\n";
-    o << "    -h / --help            This message\n";
-    o << "    -e / --exec            Treat filename as code (requires explicit filename)\n";
-    o << "    -E --env               Add an environment variable\n\n";
-    o << "    -s / --max-stack <n>   Number of allowed stack frames\n";
-    o << "    -t / --max-trace <n>   Max length of stack trace before cropping\n";
-    o << "    --gc-min-objects       Do not run garbage collector until this many\n";
-    o << "    --gc-growth-trigger    Run garbage collector after this amount of object growth\n";
-    o << "    --debug-ast            Unparse the parsed AST without executing it\n\n";
+    o << "  -h / --help             This message\n";
+    o << "  -e / --exec             Treat filename as code (requires explicit filename)\n";
+    o << "  -E / --env              Add an environment variable\n\n";
+    o << "  -s / --max-stack <n>    Number of allowed stack frames\n";
+    o << "  -t / --max-trace <n>    Max length of stack trace before cropping\n";
+    o << "  --gc-min-objects <n>    Do not run garbage collector until this many\n";
+    o << "  --gc-growth-trigger <n> Run garbage collector after this amount of object growth\n";
+    o << "  --debug-ast             Unparse the parsed AST without executing it\n\n";
     o << "Multichar options are expanded e.g. -abc becomes -a -b -c.\n";
     o << "The -- option suppresses option processing.  Note that since jsonnet programs can\n";
     o << "begin with -, it is advised to use -- with -e if the program is unknown.";


flood fill 2

flood fill 2

--- rise_ip.cpp
+++ rise_ip.cpp
@@ -53,7 +53,7 @@
     Mat img_eroded;
     Mat circ_str_elem=getStructuringElement(MORPH_ELLIPSE,str_elem_dim_11,anchor);
     erode( img_edge_dilated,img_eroded,circ_str_elem);
-*/
+*/
     Mat img_flood_fill;
     Point origin=Point(0,0);  // is this have to be origin or (-1,-1) ?

@@ -72,7 +72,7 @@
 	erode(img_erode_post_fill1,img_erode_post_erode,circ_str_elem);

 	Mat img_final_filled;
-	floodFill(img_final_filled,origin,Scalar(255),);   /// got an issue with arguments SCALAR
+	floodFill(img_final_filled,origin,Scalar(255),0,Scalar(),Scalar(),4);   /// got an issue with arguments SCALAR

 ////////////////////////////////////////////////////////////////////////////


FIX: FileDimensionality( 3 ) was missing. Print's removed.

--- RawImageReadWrite/itkRawImageReadWrite.cxx
+++ RawImageReadWrite/itkRawImageReadWrite.cxx
@@ -66,6 +66,7 @@
   fileSource->SetFileName( inputFileName );

   RawReaderType::Pointer  rawReader  = RawReaderType::New();
+  rawReader->SetFileDimensionality( 3 );
   rawReader->SetDimensions( 0, nx );
   rawReader->SetDimensions( 1, ny );
   rawReader->SetDimensions( 2, nz );
@@ -85,11 +86,6 @@

   std::cout << "File succesfully read ! " << std::endl;

-  // Print information about the image
-  ImageType::Pointer  image = fileSource->GetOutput();
-  image->Print( std::cout );
-
-

   // Write a Raw File
   typedef  itk::ImageFileWriter< ImageType >      FileSinkType;
@@ -101,7 +97,7 @@

   fileSink->SetImageIO( rawWriter );
   fileSink->SetFileName( outputFileName );
-  fileSink->SetInput( image );
+  fileSink->SetInput( fileSource->GetOutput() );

   try


edge color fix for solarized #64

edge color fix for solarized #64

--- ride/builtinthemes.cc
+++ ride/builtinthemes.cc
@@ -125,6 +125,10 @@
   }
   BasicThemeBuilder& set_select_hi(const ride::Color& c) {
     select_hi_ = c;
+    return *this;
+  }
+  BasicThemeBuilder& set_edge_color(const ride::Color& c) {
+    edge_color_ = c;
     return *this;
   }

@@ -143,6 +147,7 @@
   const ride::Color& warning_front() { return warning_front_; }
   const ride::Color& search_hi() { return search_hi_; }
   const ride::Color& select_hi() { return select_hi_; }
+  const ride::Color& edge_color() { return edge_color_; }

   void Setup(ride::FontsAndColors* colors) {
     colors->set_use_selection_background(true);
@@ -193,6 +198,8 @@
         New(Style(New(error_front_), New(error_))));
     colors->set_allocated_annotation_warning_style(
         New(Style(New(warning_front_), New(warning_))));
+
+    colors->set_allocated_edgecolor(New(edge_color_));
   }

  private:
@@ -211,6 +218,7 @@
   ride::Color warning_front_;
   ride::Color search_hi_;
   ride::Color select_hi_;
+  ride::Color edge_color_;
 };

 //////////////////////////////////////////////////////////////////////////
@@ -232,6 +240,7 @@
       .set_warning_front(Color(0))
       .set_search_hi(Color(200))
       .set_select_hi(Color(180))
+      .set_edge_color(Color(0))
       .Setup(colors);
 }

@@ -272,6 +281,7 @@
       .set_warning_front(solarized_base03)
       .set_search_hi(solarized_base01)
       .set_select_hi(solarized_base02)
+      .set_edge_color(solarized_base01)
       .Setup(colors);
 }


Windows tests: fix missing "M_PI"

Windows tests: fix missing "M_PI"

--- test/unit/vertex_adapter/line_offset_test.cpp
+++ test/unit/vertex_adapter/line_offset_test.cpp
@@ -2,6 +2,7 @@

 // mapnik
 #include <mapnik/vertex_cache.hpp>
+#include <mapnik/global.hpp>

 // stl
 #include <iostream>


squelch empty line in GMCP commands

squelch empty line in GMCP commands

--- code/code/sys/connect.cc
+++ code/code/sys/connect.cc
@@ -400,15 +400,20 @@
   sstring buf;
   TBeing *ch = original ? original : character;

-  if (!prompt_mode && !connected && !m_bIsClient)
-    if (socket->writeToSocket("\n\r") < 0)
-      return -1;
+  bool sentNewline = false;

   memset(i, '\0', sizeof(i));
   // Take everything from queued output
   while(!output.empty()){
     CommPtr c(output.front());
     output.pop();
+
+    if (!sentNewline) {
+      sentNewline = true;
+      if (!prompt_mode && !connected && !m_bIsClient && dynamic_cast<GmcpComm*>(&*c) == nullptr)
+        if (socket->writeToSocket("\n\r") < 0)
+          return -1;
+    }

     strncpy(i, c->getComm().c_str(), MAX_STRING_LENGTH + MAX_STRING_LENGTH);
     counter++;


Fix for no-color mesh rendering on win32

[git-p4: depot-paths = "//depot/Golf/": change = 1109]

--- code/engine/RudeMesh.cpp
+++ code/engine/RudeMesh.cpp
@@ -245,7 +245,10 @@
 				glColorPointer(4, GL_UNSIGNED_BYTE, mesh->sVtxColours.nStride, mesh->pInterleaved + (long)mesh->sVtxColours.pData);
 			}
 			else
+			{
 				RGL.EnableClient(kColorArray, false);
+				glColor4f(1.0, 1.0, 1.0, 1.0);
+			}
 		}

 		glDrawElements(GL_TRIANGLES, mesh->nNumFaces*3, GL_UNSIGNED_SHORT, indices);


implement getCertificateList and getRequestList

--- src/CA.cpp
+++ src/CA.cpp
@@ -53,10 +53,13 @@

 CA::~CA()
 {
-    int r = path::removeFile(repositoryDir+"/"+caName+"/openssl.cnf");
-
-    if(r != 0) {
-        LOGIT_INFO("Remove of openssl.cnf failed: " << r);
+    path::PathInfo pi(repositoryDir+"/"+caName+"/openssl.cnf");
+    if(pi.exists()) {
+        int r = path::removeFile(repositoryDir+"/"+caName+"/openssl.cnf");
+
+        if(r != 0) {
+            LOGIT_INFO("Remove of openssl.cnf failed: " << r);
+        }
     }
 }

@@ -450,16 +453,44 @@
     return false;
 }

-StringMapList
+blocxx::Array<blocxx::Map<blocxx::String, blocxx::String> >
 CA::getCertificateList()
 {
-    return StringMapList();
-}
-
-StringMapList
+    updateDB();
+
+    Array<Map<String, String>* > ret;
+
+    ret = listCertificates(caName, repositoryDir);
+
+    Array<Map<String, String> > ret2;
+
+    Array<Map<String, String>* >::iterator it = ret.begin();
+
+    for(; it != ret.end(); ++it) {
+        ret2.push_back( *(*it) );
+        delete(*it);
+    }
+
+    return ret2;
+}
+
+blocxx::Array<blocxx::Map<blocxx::String, blocxx::String> >
 CA::getRequestList()
 {
-    return StringMapList();
+    Array<Map<String, String>* > ret;
+
+    ret = listRequests(caName, repositoryDir);
+
+    Array<Map<String, String> > ret2;
+
+    Array<Map<String, String>* >::iterator it = ret.begin();
+
+    for(; it != ret.end(); ++it) {
+        ret2.push_back( *(*it) );
+        delete(*it);
+    }
+
+    return ret2;
 }


INTEGRATION: CWS sb59 (1.66.60); FILE MERGED 2006/08/16 09:31:13 sb 1.66.60.1: #i67487# Made code warning-free (wntmsci10).

--- sfx2/source/appl/appcfg.cxx
+++ sfx2/source/appl/appcfg.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: appcfg.cxx,v $
  *
- *  $Revision: 1.67 $
+ *  $Revision: 1.68 $
  *
- *  last change: $Author: obo $ $Date: 2006-09-17 16:13:51 $
+ *  last change: $Author: obo $ $Date: 2006-10-12 15:46:41 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -326,7 +326,7 @@
                         if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEGRAPHICS))
                         {
                             SfxDocumentInfo *pDocInf = SfxObjectShell::Current() ? &SfxObjectShell::Current()->GetDocInfo() : 0;
-                            BOOL bComprGraph = pDocInf ? pDocInf->IsSaveGraphicsCompressed() : aSaveOptions.GetSaveGraphicsMode() == SvtSaveOptions::SaveGraphicsCompressed;
+                            bool bComprGraph = pDocInf ? pDocInf->IsSaveGraphicsCompressed() : aSaveOptions.GetSaveGraphicsMode() == SvtSaveOptions::SaveGraphicsCompressed;
                             if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_OPT_SAVEGRAPHICSCOMPRESSED ),bComprGraph )))
                                 bRet = FALSE;
                         }
@@ -340,7 +340,7 @@
                         if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEGRAPHICS))
                         {
                             SfxDocumentInfo *pDocInf = SfxObjectShell::Current() ? &SfxObjectShell::Current()->GetDocInfo() : 0;
-                            BOOL bOrigGraph = pDocInf ? pDocInf->IsSaveOriginalGraphics() : aSaveOptions.GetSaveGraphicsMode() == SvtSaveOptions::SaveGraphicsOriginal;
+                            bool bOrigGraph = pDocInf ? pDocInf->IsSaveOriginalGraphics() : aSaveOptions.GetSaveGraphicsMode() == SvtSaveOptions::SaveGraphicsOriginal;
                             if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_OPT_SAVEORIGINALGRAPHICS ), bOrigGraph )))
                                 bRet = FALSE;
                         }
@@ -451,7 +451,7 @@
                         bRet = TRUE;
                         if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_BASICMODE))
                         {
-                            if ( !rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_BASIC_ENABLED ), aSecurityOptions.GetBasicMode())))
+                            if ( !rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_BASIC_ENABLED ), sal::static_int_cast< UINT16 >(aSecurityOptions.GetBasicMode()))))
                                 bRet = FALSE;
                         }
                     }
@@ -563,7 +563,7 @@
                     SfxAllEnumItem aNames(rPool.GetWhich(SID_ATTR_PATHGROUP));
                     SfxAllEnumItem aValues(rPool.GetWhich(SID_ATTR_PATHNAME));
                     SvtPathOptions aPathCfg;
-                    for ( int nProp = SvtPathOptions::PATH_ADDIN;
+                    for ( USHORT nProp = SvtPathOptions::PATH_ADDIN;
                           nProp <= SvtPathOptions::PATH_WORK; nProp++ )
                     {
                         const String aName( SfxResId( CONFIG_PATH_START + nProp ) );
@@ -650,7 +650,9 @@
     {
         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
         BOOL bBigSize = ( (const SfxBoolItem*)pItem )->GetValue();
-        aMiscOptions.SetSymbolsSize( bBigSize ? SFX_SYMBOLS_SIZE_LARGE : SFX_SYMBOLS_SIZE_SMALL );
+        aMiscOptions.SetSymbolsSize(
+            sal::static_int_cast< sal_Int16 >(
+                bBigSize ? SFX_SYMBOLS_SIZE_LARGE : SFX_SYMBOLS_SIZE_SMALL ) );
         SfxViewFrame* pCurrViewFrame = SfxViewFrame::GetFirst();
         while ( pCurrViewFrame )
         {


include mnuitem.hxx to build with --enable-dbgutil


#84491#: save on existing document does not work

--- sfx2/source/doc/docfile.cxx
+++ sfx2/source/doc/docfile.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: docfile.cxx,v $
  *
- *  $Revision: 1.44 $
+ *  $Revision: 1.45 $
  *
- *  last change: $Author: mba $ $Date: 2001-02-26 12:07:45 $
+ *  last change: $Author: mba $ $Date: 2001-03-01 16:54:02 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -2464,7 +2464,10 @@
         DELETEZ( pImp->pTempFile );

     BOOL bDeleteInputStream = ( pInStream == 0);
+    ULONG nOpenMode = nStorOpenMode;
     GetInStream();
+    BOOL bCopy = ( nStorOpenMode == nOpenMode );
+    nStorOpenMode = nOpenMode;
     ResetError();

     String          aParentName;
@@ -2475,17 +2478,21 @@

     pImp->pTempFile = new ::utl::TempFile( &aParentName );
     pImp->pTempFile->EnableKillingFile( sal_True );
-
     aName = pImp->pTempFile->GetFileName();

-    GetOutStream();
-    if ( pInStream && pOutStream )
-    {
-        *pInStream >> *pOutStream;
+    if ( bCopy )
+    {
+        GetOutStream();
+        if ( pInStream && pOutStream )
+        {
+            *pInStream >> *pOutStream;
+            CloseInStream();
+        }
+
+        CloseOutStream_Impl();
+    }
+    else
         CloseInStream();
-    }
-
-    CloseOutStream_Impl();
     CloseStorage();
 }


handle case: no LockBytes

handle case: no LockBytes

--- sfx2/source/doc/docfile.cxx
+++ sfx2/source/doc/docfile.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: docfile.cxx,v $
  *
- *  $Revision: 1.22 $
+ *  $Revision: 1.23 $
  *
- *  last change: $Author: mba $ $Date: 2000-11-13 13:14:16 $
+ *  last change: $Author: mba $ $Date: 2000-11-13 13:23:24 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -1424,7 +1424,6 @@
                     && bIsWritable && bAllowReadOnlyMode )
             {
                 // later error code will be corrected to ERRCODE_ACCESS_DENIED !
-                xLockBytes = ::utl::UcbLockBytes:: CreateLockBytes( GetContent(), nStorOpenMode, pHandler );
                 QueryBox aBox( 0, SfxResId(MSG_OPEN_READONLY) );
                 BOOL bSilent = TRUE;    // don't ask at the moment
                 if ( bSilent || RET_YES == aBox.Execute() )
@@ -1432,11 +1431,11 @@
                     GetItemSet()->Put( SfxBoolItem(SID_DOC_READONLY, sal_True));
                     SetOpenMode(SFX_STREAM_READONLY, sal_False);
                     ResetError();
-                    xLockBytes = ::utl::UcbLockBytes:: CreateLockBytes( GetContent(), nStorOpenMode, pHandler );
+                    xLockBytes = ::utl::UcbLockBytes::CreateLockBytes( GetContent(), nStorOpenMode, pHandler );
                 }
             }
             else
-                Done_Impl( xLockBytes->GetError() );
+                Done_Impl( xLockBytes.Is() ? xLockBytes->GetError() : ERRCODE_IO_NOTSUPPORTED );
         }

         if ( xLockBytes.Is() )