Add a 'ctrans()' test for sparse vector/dense vector multiplications ('svecdvecmult')

--- blazetest/blazetest/mathtest/svecdvecmult/OperationTest.h
+++ blazetest/blazetest/mathtest/svecdvecmult/OperationTest.h
@@ -149,8 +149,9 @@
                           void testNegatedOperation  ();
    template< typename T > void testScaledOperation   ( T scalar );
                           void testTransposeOperation();
+                          void testConjOperation     ();
+                          void testCTransOperation   ();
                           void testAbsOperation      ();
-                          void testConjOperation     ();
                           void testEvalOperation     ();
                           void testSerialOperation   ();
                           void testSubvectorOperation();
@@ -296,8 +297,9 @@
    testScaledOperation( 2.0F );
    testScaledOperation( 2.0 );
    testTransposeOperation();
+   testConjOperation();
+   testCTransOperation();
    testAbsOperation();
-   testConjOperation();
    testEvalOperation();
    testSerialOperation();
    testSubvectorOperation();
@@ -2490,6 +2492,570 @@

 //*************************************************************************************************
+/*!\brief Testing the conjugate sparse vector/dense vector multiplication.
+//
+// \return void
+// \exception std::runtime_error Multiplication error detected.
+//
+// This function tests the conjugate vector multiplication with plain assignment, addition
+// assignment, subtraction assignment, and multiplication assignment. In case any error resulting
+// from the multiplication or the subsequent assignment is detected, a \a std::runtime_error
+// exception is thrown.
+*/
+template< typename VT1    // Type of the left-hand side sparse vector
+        , typename VT2 >  // Type of the right-hand side dense vector
+void OperationTest<VT1,VT2>::testConjOperation()
+{
+#if BLAZETEST_MATHTEST_TEST_CONJ_OPERATION
+   if( BLAZETEST_MATHTEST_TEST_CONJ_OPERATION > 1 )
+   {
+      //=====================================================================================
+      // Conjugate multiplication
+      //=====================================================================================
+
+      // Conjugate multiplication with the given vectors
+      {
+         test_  = "Conjugate multiplication with the given vectors";
+         error_ = "Failed multiplication operation";
+
+         try {
+            initResults();
+            dres_   = conj( lhs_ * rhs_ );
+            sres_   = conj( lhs_ * rhs_ );
+            refres_ = conj( reflhs_ * refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkResults<VT1,VT2>();
+
+         try {
+            initTransposeResults();
+            tdres_   = conj( tlhs_ * trhs_ );
+            tsres_   = conj( tlhs_ * trhs_ );
+            trefres_ = conj( treflhs_ * trefrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkTransposeResults<TVT1,TVT2>();
+      }
+
+      // Conjugate multiplication with evaluated vectors
+      {
+         test_  = "Conjugate multiplication with evaluated vectors";
+         error_ = "Failed multiplication operation";
+
+         try {
+            initResults();
+            dres_   = conj( eval( lhs_ ) * eval( rhs_ ) );
+            sres_   = conj( eval( lhs_ ) * eval( rhs_ ) );
+            refres_ = conj( eval( reflhs_ ) * eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkResults<VT1,VT2>();
+
+         try {
+            initTransposeResults();
+            tdres_   = conj( eval( tlhs_ ) * eval( trhs_ ) );
+            tsres_   = conj( eval( tlhs_ ) * eval( trhs_ ) );
+            trefres_ = conj( eval( treflhs_ ) * eval( trefrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkTransposeResults<TVT1,TVT2>();
+      }
+
+
+      //=====================================================================================
+      // Conjugate multiplication with addition assignment
+      //=====================================================================================
+
+      // Conjugate multiplication with addition assignment with the given vectors
+      {
+         test_  = "Conjugate multiplication with addition assignment with the given vectors";
+         error_ = "Failed addition assignment operation";
+
+         try {
+            initResults();
+            dres_   += conj( lhs_ * rhs_ );
+            sres_   += conj( lhs_ * rhs_ );
+            refres_ += conj( reflhs_ * refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkResults<VT1,VT2>();
+
+         try {
+            initTransposeResults();
+            tdres_   += conj( tlhs_ * trhs_ );
+            tsres_   += conj( tlhs_ * trhs_ );
+            trefres_ += conj( treflhs_ * trefrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkTransposeResults<TVT1,TVT2>();
+      }
+
+      // Conjugate multiplication with addition assignment with evaluated vectors
+      {
+         test_  = "Conjugate multiplication with addition assignment with evaluated vectors";
+         error_ = "Failed addition assignment operation";
+
+         try {
+            initResults();
+            dres_   += conj( eval( lhs_ ) * eval( rhs_ ) );
+            sres_   += conj( eval( lhs_ ) * eval( rhs_ ) );
+            refres_ += conj( eval( reflhs_ ) * eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkResults<VT1,VT2>();
+
+         try {
+            initTransposeResults();
+            tdres_   += conj( eval( tlhs_ ) * eval( trhs_ ) );
+            tsres_   += conj( eval( tlhs_ ) * eval( trhs_ ) );
+            trefres_ += conj( eval( treflhs_ ) * eval( trefrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkTransposeResults<TVT1,TVT2>();
+      }
+
+
+      //=====================================================================================
+      // Conjugate multiplication with subtraction assignment
+      //=====================================================================================
+
+      // Conjugate multiplication with subtraction assignment with the given vectors
+      {
+         test_  = "Conjugate multiplication with subtraction assignment with the given types";
+         error_ = "Failed subtraction assignment operation";
+
+         try {
+            initResults();
+            dres_   -= conj( lhs_ * rhs_ );
+            sres_   -= conj( lhs_ * rhs_ );
+            refres_ -= conj( reflhs_ * refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkResults<VT1,VT2>();
+
+         try {
+            initTransposeResults();
+            tdres_   -= conj( tlhs_ * trhs_ );
+            tsres_   -= conj( tlhs_ * trhs_ );
+            trefres_ -= conj( treflhs_ * trefrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkTransposeResults<TVT1,TVT2>();
+      }
+
+      // Conjugate multiplication with subtraction assignment with evaluated vectors
+      {
+         test_  = "Conjugate multiplication with subtraction assignment with evaluated vectors";
+         error_ = "Failed subtraction assignment operation";
+
+         try {
+            initResults();
+            dres_   -= conj( eval( lhs_ ) * eval( rhs_ ) );
+            sres_   -= conj( eval( lhs_ ) * eval( rhs_ ) );
+            refres_ -= conj( eval( reflhs_ ) * eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkResults<VT1,VT2>();
+
+         try {
+            initTransposeResults();
+            tdres_   -= conj( eval( tlhs_ ) * eval( trhs_ ) );
+            tsres_   -= conj( eval( tlhs_ ) * eval( trhs_ ) );
+            trefres_ -= conj( eval( treflhs_ ) * eval( trefrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkTransposeResults<TVT1,TVT2>();
+      }
+
+
+      //=====================================================================================
+      // Conjugate multiplication with multiplication assignment
+      //=====================================================================================
+
+      // Conjugate multiplication with multiplication assignment with the given vectors
+      {
+         test_  = "Conjugate multiplication with multiplication assignment with the given vectors";
+         error_ = "Failed multiplication assignment operation";
+
+         try {
+            initResults();
+            dres_   *= conj( lhs_ * rhs_ );
+            sres_   *= conj( lhs_ * rhs_ );
+            refres_ *= conj( reflhs_ * refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkResults<VT1,VT2>();
+
+         try {
+            initTransposeResults();
+            tdres_   *= conj( tlhs_ * trhs_ );
+            tsres_   *= conj( tlhs_ * trhs_ );
+            trefres_ *= conj( treflhs_ * trefrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkTransposeResults<TVT1,TVT2>();
+      }
+
+      // Conjugate multiplication with multiplication assignment with evaluated vectors
+      {
+         test_  = "Conjugate multiplication with multiplication assignment with evaluated vectors";
+         error_ = "Failed multiplication assignment operation";
+
+         try {
+            initResults();
+            dres_   *= conj( eval( lhs_ ) * eval( rhs_ ) );
+            sres_   *= conj( eval( lhs_ ) * eval( rhs_ ) );
+            refres_ *= conj( eval( reflhs_ ) * eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkResults<VT1,VT2>();
+
+         try {
+            initTransposeResults();
+            tdres_   *= conj( eval( tlhs_ ) * eval( trhs_ ) );
+            tsres_   *= conj( eval( tlhs_ ) * eval( trhs_ ) );
+            trefres_ *= conj( eval( treflhs_ ) * eval( trefrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkTransposeResults<TVT1,TVT2>();
+      }
+   }
+#endif
+}
+//*************************************************************************************************
+
+
+//*************************************************************************************************
+/*!\brief Testing the conjugate transpose sparse vector/dense vector multiplication.
+//
+// \return void
+// \exception std::runtime_error Multiplication error detected.
+//
+// This function tests the conjugate transpose vector multiplication with plain assignment,
+// addition assignment, subtraction assignment, and multiplication assignment. In case any
+// error resulting from the multiplication or the subsequent assignment is detected, a
+// \a std::runtime_error exception is thrown.
+*/
+template< typename VT1    // Type of the left-hand side sparse vector
+        , typename VT2 >  // Type of the right-hand side dense vector
+void OperationTest<VT1,VT2>::testCTransOperation()
+{
+#if BLAZETEST_MATHTEST_TEST_CTRANS_OPERATION
+   if( BLAZETEST_MATHTEST_TEST_CTRANS_OPERATION > 1 )
+   {
+      //=====================================================================================
+      // Conjugate transpose multiplication
+      //=====================================================================================
+
+      // Conjugate transpose multiplication with the given vectors
+      {
+         test_  = "Conjugate transpose multiplication with the given vectors";
+         error_ = "Failed multiplication operation";
+
+         try {
+            initTransposeResults();
+            tdres_   = ctrans( lhs_ * rhs_ );
+            tsres_   = ctrans( lhs_ * rhs_ );
+            trefres_ = ctrans( reflhs_ * refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkTransposeResults<VT1,VT2>();
+
+         try {
+            initResults();
+            dres_   = ctrans( tlhs_ * trhs_ );
+            sres_   = ctrans( tlhs_ * trhs_ );
+            refres_ = ctrans( treflhs_ * trefrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkResults<TVT1,TVT2>();
+      }
+
+      // Conjugate transpose multiplication with evaluated vectors
+      {
+         test_  = "Conjugate transpose multiplication with evaluated vectors";
+         error_ = "Failed multiplication operation";
+
+         try {
+            initTransposeResults();
+            tdres_   = ctrans( eval( lhs_ ) * eval( rhs_ ) );
+            tsres_   = ctrans( eval( lhs_ ) * eval( rhs_ ) );
+            trefres_ = ctrans( eval( reflhs_ ) * eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkTransposeResults<VT1,VT2>();
+
+         try {
+            initResults();
+            dres_   = ctrans( eval( tlhs_ ) * eval( trhs_ ) );
+            sres_   = ctrans( eval( tlhs_ ) * eval( trhs_ ) );
+            refres_ = ctrans( eval( treflhs_ ) * eval( trefrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkResults<TVT1,TVT2>();
+      }
+
+
+      //=====================================================================================
+      // Conjugate transpose multiplication with addition assignment
+      //=====================================================================================
+
+      // Conjugate transpose multiplication with addition assignment with the given vectors
+      {
+         test_  = "Conjugate transpose multiplication with addition assignment with the given vectors";
+         error_ = "Failed addition assignment operation";
+
+         try {
+            initTransposeResults();
+            tdres_   += ctrans( lhs_ * rhs_ );
+            tsres_   += ctrans( lhs_ * rhs_ );
+            trefres_ += ctrans( reflhs_ * refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkTransposeResults<VT1,VT2>();
+
+         try {
+            initResults();
+            dres_   += ctrans( tlhs_ * trhs_ );
+            sres_   += ctrans( tlhs_ * trhs_ );
+            refres_ += ctrans( treflhs_ * trefrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkResults<TVT1,TVT2>();
+      }
+
+      // Conjugate transpose multiplication with addition assignment with evaluated vectors
+      {
+         test_  = "Conjugate transpose multiplication with addition assignment with evaluated vectors";
+         error_ = "Failed addition assignment operation";
+
+         try {
+            initTransposeResults();
+            tdres_   += ctrans( eval( lhs_ ) * eval( rhs_ ) );
+            tsres_   += ctrans( eval( lhs_ ) * eval( rhs_ ) );
+            trefres_ += ctrans( eval( reflhs_ ) * eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkTransposeResults<VT1,VT2>();
+
+         try {
+            initResults();
+            dres_   += ctrans( eval( tlhs_ ) * eval( trhs_ ) );
+            sres_   += ctrans( eval( tlhs_ ) * eval( trhs_ ) );
+            refres_ += ctrans( eval( treflhs_ ) * eval( trefrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkResults<TVT1,TVT2>();
+      }
+
+
+      //=====================================================================================
+      // Conjugate transpose multiplication with subtraction assignment
+      //=====================================================================================
+
+      // Conjugate transpose multiplication with subtraction assignment with the given vectors
+      {
+         test_  = "Conjugate transpose multiplication with subtraction assignment with the given vectors";
+         error_ = "Failed subtraction assignment operation";
+
+         try {
+            initTransposeResults();
+            tdres_   -= ctrans( lhs_ * rhs_ );
+            tsres_   -= ctrans( lhs_ * rhs_ );
+            trefres_ -= ctrans( reflhs_ * refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkTransposeResults<VT1,VT2>();
+
+         try {
+            initResults();
+            dres_   -= ctrans( tlhs_ * trhs_ );
+            sres_   -= ctrans( tlhs_ * trhs_ );
+            refres_ -= ctrans( treflhs_ * trefrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkResults<TVT1,TVT2>();
+      }
+
+      // Conjugate transpose multiplication with subtraction assignment with evaluated vectors
+      {
+         test_  = "Conjugate transpose multiplication with subtraction assignment with evaluated vectors";
+         error_ = "Failed subtraction assignment operation";
+
+         try {
+            initTransposeResults();
+            tdres_   -= ctrans( eval( lhs_ ) * eval( rhs_ ) );
+            tsres_   -= ctrans( eval( lhs_ ) * eval( rhs_ ) );
+            trefres_ -= ctrans( eval( reflhs_ ) * eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkTransposeResults<VT1,VT2>();
+
+         try {
+            initResults();
+            dres_   -= ctrans( eval( tlhs_ ) * eval( trhs_ ) );
+            sres_   -= ctrans( eval( tlhs_ ) * eval( trhs_ ) );
+            refres_ -= ctrans( eval( treflhs_ ) * eval( trefrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkResults<TVT1,TVT2>();
+      }
+
+
+      //=====================================================================================
+      // Conjugate transpose multiplication with multiplication assignment
+      //=====================================================================================
+
+      // Conjugate transpose multiplication with multiplication assignment with the given vectors
+      {
+         test_  = "Conjugate transpose multiplication with multiplication assignment with the given vectors";
+         error_ = "Failed multiplication assignment operation";
+
+         try {
+            initTransposeResults();
+            tdres_   *= ctrans( lhs_ * rhs_ );
+            tsres_   *= ctrans( lhs_ * rhs_ );
+            trefres_ *= ctrans( reflhs_ * refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkTransposeResults<VT1,VT2>();
+
+         try {
+            initResults();
+            dres_   *= ctrans( tlhs_ * trhs_ );
+            sres_   *= ctrans( tlhs_ * trhs_ );
+            refres_ *= ctrans( treflhs_ * trefrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkResults<TVT1,TVT2>();
+      }
+
+      // Conjugate transpose multiplication with multiplication assignment with evaluated vectors
+      {
+         test_  = "Conjugate transpose multiplication with multiplication assignment with evaluated vectors";
+         error_ = "Failed multiplication assignment operation";
+
+         try {
+            initTransposeResults();
+            tdres_   *= ctrans( eval( lhs_ ) * eval( rhs_ ) );
+            tsres_   *= ctrans( eval( lhs_ ) * eval( rhs_ ) );
+            trefres_ *= ctrans( eval( reflhs_ ) * eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<VT1,VT2>( ex );
+         }
+
+         checkTransposeResults<VT1,VT2>();
+
+         try {
+            initResults();
+            dres_   *= ctrans( eval( tlhs_ ) * eval( trhs_ ) );
+            sres_   *= ctrans( eval( tlhs_ ) * eval( trhs_ ) );
+            refres_ *= ctrans( eval( treflhs_ ) * eval( trefrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<TVT1,TVT2>( ex );
+         }
+
+         checkResults<TVT1,TVT2>();
+      }
+   }
+#endif
+}
+//*************************************************************************************************
+
+
+//*************************************************************************************************
 /*!\brief Testing the abs sparse vector/dense vector multiplication.
 //
 // \return void
@@ -2758,288 +3324,6 @@
             tdres_   *= abs( eval( tlhs_ ) * eval( trhs_ ) );
             tsres_   *= abs( eval( tlhs_ ) * eval( trhs_ ) );
             trefres_ *= abs( eval( treflhs_ ) * eval( trefrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<TVT1,TVT2>( ex );
-         }
-
-         checkTransposeResults<TVT1,TVT2>();
-      }
-   }
-#endif
-}
-//*************************************************************************************************
-
-
-//*************************************************************************************************
-/*!\brief Testing the conj sparse vector/dense vector multiplication.
-//
-// \return void
-// \exception std::runtime_error Multiplication error detected.
-//
-// This function tests the conj vector multiplication with plain assignment, addition assignment,
-// subtraction assignment, and multiplication assignment. In case any error resulting from the
-// multiplication or the subsequent assignment is detected, a \a std::runtime_error exception
-// is thrown.
-*/
-template< typename VT1    // Type of the left-hand side sparse vector
-        , typename VT2 >  // Type of the right-hand side dense vector
-void OperationTest<VT1,VT2>::testConjOperation()
-{
-#if BLAZETEST_MATHTEST_TEST_CONJ_OPERATION
-   if( BLAZETEST_MATHTEST_TEST_CONJ_OPERATION > 1 )
-   {
-      //=====================================================================================
-      // Conj multiplication
-      //=====================================================================================
-
-      // Conj multiplication with the given vectors
-      {
-         test_  = "Conj multiplication with the given vectors";
-         error_ = "Failed multiplication operation";
-
-         try {
-            initResults();
-            dres_   = conj( lhs_ * rhs_ );
-            sres_   = conj( lhs_ * rhs_ );
-            refres_ = conj( reflhs_ * refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<VT1,VT2>( ex );
-         }
-
-         checkResults<VT1,VT2>();
-
-         try {
-            initTransposeResults();
-            tdres_   = conj( tlhs_ * trhs_ );
-            tsres_   = conj( tlhs_ * trhs_ );
-            trefres_ = conj( treflhs_ * trefrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<TVT1,TVT2>( ex );
-         }
-
-         checkTransposeResults<TVT1,TVT2>();
-      }
-
-      // Conj multiplication with evaluated vectors
-      {
-         test_  = "Conj multiplication with evaluated vectors";
-         error_ = "Failed multiplication operation";
-
-         try {
-            initResults();
-            dres_   = conj( eval( lhs_ ) * eval( rhs_ ) );
-            sres_   = conj( eval( lhs_ ) * eval( rhs_ ) );
-            refres_ = conj( eval( reflhs_ ) * eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<VT1,VT2>( ex );
-         }
-
-         checkResults<VT1,VT2>();
-
-         try {
-            initTransposeResults();
-            tdres_   = conj( eval( tlhs_ ) * eval( trhs_ ) );
-            tsres_   = conj( eval( tlhs_ ) * eval( trhs_ ) );
-            trefres_ = conj( eval( treflhs_ ) * eval( trefrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<TVT1,TVT2>( ex );
-         }
-
-         checkTransposeResults<TVT1,TVT2>();
-      }
-
-
-      //=====================================================================================
-      // Conj multiplication with addition assignment
-      //=====================================================================================
-
-      // Conj multiplication with addition assignment with the given vectors
-      {
-         test_  = "Conj multiplication with addition assignment with the given vectors";
-         error_ = "Failed addition assignment operation";
-
-         try {
-            initResults();
-            dres_   += conj( lhs_ * rhs_ );
-            sres_   += conj( lhs_ * rhs_ );
-            refres_ += conj( reflhs_ * refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<VT1,VT2>( ex );
-         }
-
-         checkResults<VT1,VT2>();
-
-         try {
-            initTransposeResults();
-            tdres_   += conj( tlhs_ * trhs_ );
-            tsres_   += conj( tlhs_ * trhs_ );
-            trefres_ += conj( treflhs_ * trefrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<TVT1,TVT2>( ex );
-         }
-
-         checkTransposeResults<TVT1,TVT2>();
-      }
-
-      // Conj multiplication with addition assignment with evaluated vectors
-      {
-         test_  = "Conj multiplication with addition assignment with evaluated vectors";
-         error_ = "Failed addition assignment operation";
-
-         try {
-            initResults();
-            dres_   += conj( eval( lhs_ ) * eval( rhs_ ) );
-            sres_   += conj( eval( lhs_ ) * eval( rhs_ ) );
-            refres_ += conj( eval( reflhs_ ) * eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<VT1,VT2>( ex );
-         }
-
-         checkResults<VT1,VT2>();
-
-         try {
-            initTransposeResults();
-            tdres_   += conj( eval( tlhs_ ) * eval( trhs_ ) );
-            tsres_   += conj( eval( tlhs_ ) * eval( trhs_ ) );
-            trefres_ += conj( eval( treflhs_ ) * eval( trefrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<TVT1,TVT2>( ex );
-         }
-
-         checkTransposeResults<TVT1,TVT2>();
-      }
-
-
-      //=====================================================================================
-      // Conj multiplication with subtraction assignment
-      //=====================================================================================
-
-      // Conj multiplication with subtraction assignment with the given vectors
-      {
-         test_  = "Conj multiplication with subtraction assignment with the given types";
-         error_ = "Failed subtraction assignment operation";
-
-         try {
-            initResults();
-            dres_   -= conj( lhs_ * rhs_ );
-            sres_   -= conj( lhs_ * rhs_ );
-            refres_ -= conj( reflhs_ * refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<VT1,VT2>( ex );
-         }
-
-         checkResults<VT1,VT2>();
-
-         try {
-            initTransposeResults();
-            tdres_   -= conj( tlhs_ * trhs_ );
-            tsres_   -= conj( tlhs_ * trhs_ );
-            trefres_ -= conj( treflhs_ * trefrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<TVT1,TVT2>( ex );
-         }
-
-         checkTransposeResults<TVT1,TVT2>();
-      }
-
-      // Conj multiplication with subtraction assignment with evaluated vectors
-      {
-         test_  = "Conj multiplication with subtraction assignment with evaluated vectors";
-         error_ = "Failed subtraction assignment operation";
-
-         try {
-            initResults();
-            dres_   -= conj( eval( lhs_ ) * eval( rhs_ ) );
-            sres_   -= conj( eval( lhs_ ) * eval( rhs_ ) );
-            refres_ -= conj( eval( reflhs_ ) * eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<VT1,VT2>( ex );
-         }
-
-         checkResults<VT1,VT2>();
-
-         try {
-            initTransposeResults();
-            tdres_   -= conj( eval( tlhs_ ) * eval( trhs_ ) );
-            tsres_   -= conj( eval( tlhs_ ) * eval( trhs_ ) );
-            trefres_ -= conj( eval( treflhs_ ) * eval( trefrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<TVT1,TVT2>( ex );
-         }
-
-         checkTransposeResults<TVT1,TVT2>();
-      }
-
-
-      //=====================================================================================
-      // Conj multiplication with multiplication assignment
-      //=====================================================================================
-
-      // Conj multiplication with multiplication assignment with the given vectors
-      {
-         test_  = "Conj multiplication with multiplication assignment with the given vectors";
-         error_ = "Failed multiplication assignment operation";
-
-         try {
-            initResults();
-            dres_   *= conj( lhs_ * rhs_ );
-            sres_   *= conj( lhs_ * rhs_ );
-            refres_ *= conj( reflhs_ * refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<VT1,VT2>( ex );
-         }
-
-         checkResults<VT1,VT2>();
-
-         try {
-            initTransposeResults();
-            tdres_   *= conj( tlhs_ * trhs_ );
-            tsres_   *= conj( tlhs_ * trhs_ );
-            trefres_ *= conj( treflhs_ * trefrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<TVT1,TVT2>( ex );
-         }
-
-         checkTransposeResults<TVT1,TVT2>();
-      }
-
-      // Conj multiplication with multiplication assignment with evaluated vectors
-      {
-         test_  = "Conj multiplication with multiplication assignment with evaluated vectors";
-         error_ = "Failed multiplication assignment operation";
-
-         try {
-            initResults();
-            dres_   *= conj( eval( lhs_ ) * eval( rhs_ ) );
-            sres_   *= conj( eval( lhs_ ) * eval( rhs_ ) );
-            refres_ *= conj( eval( reflhs_ ) * eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<VT1,VT2>( ex );
-         }
-
-         checkResults<VT1,VT2>();
-
-         try {
-            initTransposeResults();
-            tdres_   *= conj( eval( tlhs_ ) * eval( trhs_ ) );
-            tsres_   *= conj( eval( tlhs_ ) * eval( trhs_ ) );
-            trefres_ *= conj( eval( treflhs_ ) * eval( trefrhs_ ) );
          }
          catch( std::exception& ex ) {
             convertException<TVT1,TVT2>( ex );


fix combined-compare-jump params on MIPS32r5


pnfs-obj: pNFS errors are communicated on iodata->pnfs_error

Some time along the way pNFS IO errors were switched to
communicate with a special iodata->pnfs_error member instead
of the regular RPC members. But objlayout was not switched
over.

Fix that!
Without this fix any IO error is hanged, because IO is not
switched to MDS and pages are never cleared or read.

[Applies to 3.2.0. Same bug different patch for 3.1/0 Kernels]
CC: Stable Tree <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org>
Signed-off-by: Boaz Harrosh <c7aa24d52dd751aba44a7843602dc14649cc8bce@panasas.com>
Signed-off-by: Trond Myklebust <6a1f9db795c9fc44be97d66ab114c53193bd3d13@netapp.com>

--- fs/nfs/objlayout/objlayout.c
+++ fs/nfs/objlayout/objlayout.c
@@ -254,6 +254,8 @@
 	oir->status = rdata->task.tk_status = status;
 	if (status >= 0)
 		rdata->res.count = status;
+	else
+		rdata->pnfs_error = status;
 	objlayout_iodone(oir);
 	/* must not use oir after this point */

@@ -334,6 +336,8 @@
 	if (status >= 0) {
 		wdata->res.count = status;
 		wdata->verf.committed = oir->committed;
+	} else {
+		wdata->pnfs_error = status;
 	}
 	objlayout_iodone(oir);
 	/* must not use oir after this point */


xfs: kill some warnings on i386 builds

xfs: kill some warnings on i386 builds

Randy Dunlap Reported printk() format-related warnings reported
on i386 builds in his environment.  Dave Chinner provided this
patch to eliminate them.

Signed-off by: Dave Chinner <david@fromorbit.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>

Signed-off-by: Alex Elder <f556392d917047d964350b9c68912016c96d5e94@sgi.com>

--- fs/xfs/linux-2.6/xfs_trace.h
+++ fs/xfs/linux-2.6/xfs_trace.h
@@ -815,7 +815,7 @@
 	), \
 	TP_printk("dev %d:%d ino 0x%llx size 0x%llx new_size 0x%llx " \
 		  "offset 0x%llx count %zd flags %s " \
-		  "startoff 0x%llx startblock 0x%llx blockcount 0x%llx", \
+		  "startoff 0x%llx startblock %s blockcount 0x%llx", \
 		  MAJOR(__entry->dev), MINOR(__entry->dev), \
 		  __entry->ino, \
 		  __entry->size, \
@@ -824,7 +824,7 @@
 		  __entry->count, \
 		  __print_flags(__entry->flags, "|", BMAPI_FLAGS), \
 		  __entry->startoff, \
-		  __entry->startblock, \
+		  xfs_fmtfsblock(__entry->startblock), \
 		  __entry->blockcount) \
 )
 DEFINE_IOMAP_EVENT(xfs_iomap_enter);
@@ -1201,7 +1201,7 @@
 	TP_printk("dev %d:%d agno %u agbno %u minlen %u maxlen %u mod %u " \
 		  "prod %u minleft %u total %u alignment %u minalignslop %u " \
 		  "len %u type %s otype %s wasdel %d wasfromfl %d isfl %d " \
-		  "userdata %d firstblock 0x%llx", \
+		  "userdata %d firstblock %s", \
 		  MAJOR(__entry->dev), MINOR(__entry->dev), \
 		  __entry->agno, \
 		  __entry->agbno, \
@@ -1220,7 +1220,7 @@
 		  __entry->wasfromfl, \
 		  __entry->isfl, \
 		  __entry->userdata, \
-		  __entry->firstblock) \
+		  xfs_fmtfsblock(__entry->firstblock)) \
 )

 DEFINE_ALLOC_EVENT(xfs_alloc_exact_done);


Do not pull the whole ndarrayobject header in npy math, to avoid unused _import_array warning, and because we don't need it anyway.

--- numpy/core/include/numpy/npy_math.h
+++ numpy/core/include/numpy/npy_math.h
@@ -3,7 +3,6 @@

 #include <math.h>
 #include <numpy/npy_common.h>
-#include <numpy/ndarrayobject.h>

 /*
  * NAN and INFINITY like macros (same behavior as glibc for NAN, same as C99


FIX: wrong function types in ufunc_object.c

assign_reduce_identity_{zero,one} were treated as
PyArray_AssignReduceIdentityFunc, but that type has
an extra void* argument. Added the argument.

--- numpy/core/src/umath/ufunc_object.c
+++ numpy/core/src/umath/ufunc_object.c
@@ -72,10 +72,10 @@
 _does_loop_use_arrays(void *data);

 static int
-assign_reduce_identity_zero(PyArrayObject *result);
+assign_reduce_identity_zero(PyArrayObject *result, void *data);

 static int
-assign_reduce_identity_one(PyArrayObject *result);
+assign_reduce_identity_one(PyArrayObject *result, void *data);

 /*
  * fpstatus is the ufunc_formatted hardware status
@@ -2180,10 +2180,10 @@
             if (PyArray_SIZE(op[i]) != 0) {
                 switch (ufunc->identity) {
                     case PyUFunc_Zero:
-                        assign_reduce_identity_zero(op[i]);
+                        assign_reduce_identity_zero(op[i], NULL);
                         break;
                     case PyUFunc_One:
-                        assign_reduce_identity_one(op[i]);
+                        assign_reduce_identity_one(op[i], NULL);
                         break;
                     case PyUFunc_None:
                     case PyUFunc_ReorderableNone:
@@ -2641,13 +2641,13 @@
 }

 static int
-assign_reduce_identity_zero(PyArrayObject *result)
+assign_reduce_identity_zero(PyArrayObject *result, void *NPY_UNUSED(data))
 {
     return PyArray_FillWithScalar(result, PyArrayScalar_False);
 }

 static int
-assign_reduce_identity_one(PyArrayObject *result)
+assign_reduce_identity_one(PyArrayObject *result, void *NPY_UNUSED(data))
 {
     return PyArray_FillWithScalar(result, PyArrayScalar_True);
 }


CETECH-20 - clean up cvars in applicaton.c

--- engine/sources/engine/application/private/application.c
+++ engine/sources/engine/application/private/application.c
@@ -35,17 +35,17 @@

 static struct G {
     struct {
-        cvar_t cv_boot_pkg;
-        cvar_t cv_boot_script;
-        cvar_t cv_screen_x;
-        cvar_t cv_screen_y;
-        cvar_t cv_fullscreen;
-
-        cvar_t cv_daemon;
-        cvar_t cv_compile;
-        cvar_t cv_continue;
-        cvar_t cv_wait;
-        cvar_t cv_wid;
+        cvar_t boot_pkg;
+        cvar_t boot_script;
+        cvar_t screen_x;
+        cvar_t screen_y;
+        cvar_t fullscreen;
+
+        cvar_t daemon;
+        cvar_t compile;
+        cvar_t continue_;
+        cvar_t wait;
+        cvar_t wid;
     } config;

     const struct game_callbacks *game;
@@ -98,18 +98,18 @@
     memsys_init(4 * 1024 * 1024);
     cvar_init();

-    _G.config.cv_boot_pkg = cvar_new_str("core.boot_pkg", "Boot package", "boot");
-    _G.config.cv_boot_script = cvar_new_str("core.boot_script", "Boot script", "lua/boot");
-
-    _G.config.cv_screen_x = cvar_new_int("screen.x", "Screen width", 1024);
-    _G.config.cv_screen_y = cvar_new_int("screen.y", "Screen height", 768);
-    _G.config.cv_fullscreen = cvar_new_int("screen.fullscreen", "Fullscreen", 0);
-
-    _G.config.cv_daemon = cvar_new_int("daemon", "Daemon mode", 0);
-    _G.config.cv_compile = cvar_new_int("compile", "Comple", 0);
-    _G.config.cv_continue = cvar_new_int("continue", "Continue after compile", 0);
-    _G.config.cv_wait = cvar_new_int("wait", "Wait for client", 0);
-    _G.config.cv_wid = cvar_new_int("wid", "Wid", 0);
+    _G.config.boot_pkg = cvar_new_str("core.boot_pkg", "Boot package", "boot");
+    _G.config.boot_script = cvar_new_str("core.boot_script", "Boot script", "lua/boot");
+
+    _G.config.screen_x = cvar_new_int("screen.x", "Screen width", 1024);
+    _G.config.screen_y = cvar_new_int("screen.y", "Screen height", 768);
+    _G.config.fullscreen = cvar_new_int("screen.fullscreen", "Fullscreen", 0);
+
+    _G.config.daemon = cvar_new_int("daemon", "Daemon mode", 0);
+    _G.config.compile = cvar_new_int("compile", "Comple", 0);
+    _G.config.continue_ = cvar_new_int("continue", "Continue after compile", 0);
+    _G.config.wait = cvar_new_int("wait", "Wait for client", 0);
+    _G.config.wid = cvar_new_int("wid", "Wid", 0);

     // Cvar stage
     for (int i = 0; i < STATIC_SYSTEMS_SIZE; ++i) {
@@ -121,7 +121,7 @@
     }

     cvar_parse_core_args(_G.args);
-    if (cvar_get_int(_G.config.cv_compile)) {
+    if (cvar_get_int(_G.config.compile)) {
         resource_compiler_create_build_dir();
         cvar_compile_global();
     }
@@ -174,11 +174,11 @@
 }

 static void _boot_stage() {
-    stringid64_t boot_pkg = stringid64_from_string(cvar_get_string(_G.config.cv_boot_pkg));
+    stringid64_t boot_pkg = stringid64_from_string(cvar_get_string(_G.config.boot_pkg));
     stringid64_t pkg = stringid64_from_string("package");

     // TODO: remove, this must be done by boot_package and load in boot_script
-    if (!cvar_get_int(_G.config.cv_daemon)) {
+    if (!cvar_get_int(_G.config.daemon)) {
         stringid64_t core_pkg = stringid64_from_string("core");
         resource_load_now(pkg, &core_pkg, 1);
         package_load(core_pkg);
@@ -189,19 +189,19 @@
     package_load(boot_pkg);
     package_flush(boot_pkg);

-    stringid64_t boot_script = stringid64_from_string(cvar_get_string(_G.config.cv_boot_script));
+    stringid64_t boot_script = stringid64_from_string(cvar_get_string(_G.config.boot_script));
     luasys_execute_boot_script(boot_script);
 }

 static void _boot_unload() {
-    stringid64_t boot_pkg = stringid64_from_string(cvar_get_string(_G.config.cv_boot_pkg));
+    stringid64_t boot_pkg = stringid64_from_string(cvar_get_string(_G.config.boot_pkg));
     stringid64_t pkg = stringid64_from_string("package");

     package_unload(boot_pkg);
     resource_unload(pkg, &boot_pkg, 1);

-    if (!cvar_get_int(_G.config.cv_daemon)) {
+    if (!cvar_get_int(_G.config.daemon)) {
         stringid64_t core_pkg = stringid64_from_string("core");
         resource_load_now(pkg, &core_pkg, 1);
         package_load(core_pkg);
@@ -217,27 +217,27 @@
     resource_set_autoload(0);
 #endif

-    if (cvar_get_int(_G.config.cv_compile)) {
+    if (cvar_get_int(_G.config.compile)) {
         resource_compiler_compile_all();

-        if (!cvar_get_int(_G.config.cv_continue)) {
+        if (!cvar_get_int(_G.config.continue_)) {
             return;
         }
     }

-    if (!cvar_get_int(_G.config.cv_daemon)) {
-        intptr_t wid = cvar_get_int(_G.config.cv_wid);
+    if (!cvar_get_int(_G.config.daemon)) {
+        intptr_t wid = cvar_get_int(_G.config.wid);

         char title[128] = {0};
-        snprintf(title, CEL_ARRAY_LEN(title), "cetech - %s", cvar_get_string(_G.config.cv_boot_script));
+        snprintf(title, CEL_ARRAY_LEN(title), "cetech - %s", cvar_get_string(_G.config.boot_script));

         if (wid == 0) {
             _G.main_window = cel_window_new(
                     title,
                     WINDOWPOS_UNDEFINED,
                     WINDOWPOS_UNDEFINED,
-                    cvar_get_int(_G.config.cv_screen_x), cvar_get_int(_G.config.cv_screen_y),
-                    cvar_get_int(_G.config.cv_fullscreen) ? WINDOW_FULLSCREEN : WINDOW_NOFLAG
+                    cvar_get_int(_G.config.screen_x), cvar_get_int(_G.config.screen_y),
+                    cvar_get_int(_G.config.fullscreen) ? WINDOW_FULLSCREEN : WINDOW_NOFLAG
             );
         } else {
             _G.main_window = cel_window_new_from((void *) wid);
@@ -285,7 +285,7 @@
         _G.game->update(dt);

         if(frame_time_accum >= frame_time) {
-            if (!cvar_get_int(_G.config.cv_daemon)) {
+            if (!cvar_get_int(_G.config.daemon)) {
                 struct scope_data render_sd = developsys_enter_scope("Game::render()");
                 _G.game->render();
                 developsys_leave_scope("Game::render()", render_sd);


wayland: Make the event source use _gdk_display_get_next_serial

--- gdk/wayland/gdkeventsource.c
+++ gdk/wayland/gdkeventsource.c
@@ -113,10 +113,10 @@
 _gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event)
 {
   GList *node;
-  static int serial;

   node = _gdk_event_queue_append (display, event);
-  _gdk_windowing_got_event (display, node, event, serial++);
+  _gdk_windowing_got_event (display, node, event,
+                            _gdk_display_get_next_serial (display));
 }

 GSource *


Use a correct upper bound for the inversion search in binomial distributions.

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

--- numpy/random/mtrand/distributions.c
+++ numpy/random/mtrand/distributions.c
@@ -389,7 +389,7 @@
         state->q = q = 1.0 - p;
         state->r = qn = exp(n * log(q));
         state->c = np = n*p;
-        state->m = bound = min(n, np + 10.0*sqrt(np));
+        state->m = bound = min(n, np + 10.0*sqrt(np*q + 1));
     } else
     {
         q = state->q;


* src/gnomevfs-mime-application.c: Fixed wrong definition of 	GnomeVFS::Mime::ArgumentType.


AVRCP: Add additional protocol discriptor list for Browsing channel

This is documented in the spec and is checked by PTS when testing the
browsing channel.

--- profiles/audio/avrcp.c
+++ profiles/audio/avrcp.c
@@ -240,13 +240,13 @@

 static sdp_record_t *avrcp_ct_record(void)
 {
-	sdp_list_t *svclass_id, *pfseq, *apseq, *root;
+	sdp_list_t *svclass_id, *pfseq, *apseq, *apseq1, *root;
 	uuid_t root_uuid, l2cap, avctp, avrct;
 	sdp_profile_desc_t profile[1];
-	sdp_list_t *aproto, *proto[2];
+	sdp_list_t *aproto, *aproto1, *proto[2], *proto1[2];
 	sdp_record_t *record;
 	sdp_data_t *psm, *version, *features;
-	uint16_t lp = AVCTP_CONTROL_PSM;
+	uint16_t lp = AVCTP_CONTROL_PSM, ap = AVCTP_BROWSING_PSM;
 	uint16_t avrcp_ver = 0x0105, avctp_ver = 0x0103;
 	uint16_t feat = ( AVRCP_FEATURE_CATEGORY_1 |
 						AVRCP_FEATURE_CATEGORY_2 |
@@ -282,6 +282,21 @@
 	aproto = sdp_list_append(0, apseq);
 	sdp_set_access_protos(record, aproto);

+	/* Additional Protocol Descriptor List */
+	sdp_uuid16_create(&l2cap, L2CAP_UUID);
+	proto1[0] = sdp_list_append(0, &l2cap);
+	psm = sdp_data_alloc(SDP_UINT16, &ap);
+	proto1[0] = sdp_list_append(proto1[0], psm);
+	apseq1 = sdp_list_append(0, proto1[0]);
+
+	sdp_uuid16_create(&avctp, AVCTP_UUID);
+	proto1[1] = sdp_list_append(0, &avctp);
+	proto1[1] = sdp_list_append(proto1[1], version);
+	apseq1 = sdp_list_append(apseq1, proto1[1]);
+
+	aproto1 = sdp_list_append(0, apseq1);
+	sdp_set_add_access_protos(record, aproto1);
+
 	/* Bluetooth Profile Descriptor List */
 	sdp_uuid16_create(&profile[0].uuid, AV_REMOTE_PROFILE_ID);
 	profile[0].version = avrcp_ver;
@@ -298,6 +313,9 @@
 	sdp_list_free(proto[0], 0);
 	sdp_list_free(proto[1], 0);
 	sdp_list_free(apseq, 0);
+	sdp_list_free(proto1[0], 0);
+	sdp_list_free(proto1[1], 0);
+	sdp_list_free(apseq1, 0);
 	sdp_list_free(pfseq, 0);
 	sdp_list_free(aproto, 0);
 	sdp_list_free(root, 0);


audio/media - Fix crash at deferencing NULL pointer

The boolean pointer passed in to config_cb could be NULL
in media_endpoint_cancel(). In that case we should not
derefence it but pass FALSE instead to indicate error.

Below is the core dump to demonstrate the crash:

config_cb (endpoint=0xb814ff40, ret=0x0, size=-1,
    user_data=0xb8157758) at profiles/audio/media.c:537
0xb6eb7ba4 in media_endpoint_cancel (request=0xb815b4d0)
    at profiles/audio/media.c:141
0xb6eb7c98 in media_endpoint_cancel_all (endpoint=0xb814ff40)
    at profiles/audio/media.c:149
clear_endpoint (endpoint=endpoint@entry=0xb814ff40)
    at profiles/audio/media.c:250
0xb6eb7e74 in endpoint_reply (call=<optimized out>, user_data=0xb815b4d0)
    at profiles/audio/media.c:277
0xb6d50336 in ?? () from /usr/lib/libdbus-1.so.3

--- profiles/audio/media.c
+++ profiles/audio/media.c
@@ -534,7 +534,7 @@
 	struct a2dp_config_data *data = user_data;
 	gboolean *ret_value = ret;

-	data->cb(data->setup, *ret_value ? TRUE : FALSE);
+	data->cb(data->setup, ret_value ? *ret_value : FALSE);
 }

 static int set_config(struct a2dp_sep *sep, uint8_t *configuration,


newline

newline

--- lib/isc/unix/socket.c
+++ lib/isc/unix/socket.c
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */

-/* $Id: socket.c,v 1.282 2008/06/23 23:47:11 tbox Exp $ */
+/* $Id: socket.c,v 1.283 2008/06/24 01:58:16 jinmei Exp $ */

 /*! \file */

@@ -3325,6 +3325,7 @@
 	char strbuf[ISC_STRERRORSIZE];
 #endif
 	isc_result_t result;
+
 	REQUIRE(managerp != NULL && *managerp == NULL);

 #ifndef ISC_PLATFORM_USETHREADS


Fix problem with canceling connecting sockets. The manager will no longer try to dispatch internal events for dead sockets, preventing a situation where the ref count could go from 0 back to 1!

--- lib/isc/unix/socket.c
+++ lib/isc/unix/socket.c
@@ -244,6 +244,8 @@
 #define SELECT_POKE_SHUTDOWN		(-1)
 #define SELECT_POKE_NOTHING		(-2)
 #define SELECT_POKE_RESCAN		(-3) /* XXX implement */
+
+#define SOCK_DEAD(s)			((s)->references == 0)

 /*
  * Poke the select loop when there is something for us to do.
@@ -1880,10 +1882,12 @@
 					i, manager->fds[i]));
 				unlock_sock = ISC_TRUE;
 				LOCK(&sock->lock);
-				if (sock->listener)
-					dispatch_accept(sock);
-				else
-					dispatch_read(sock);
+				if (!SOCK_DEAD(sock)) {
+					if (sock->listener)
+						dispatch_accept(sock);
+					else
+						dispatch_read(sock);
+				}
 				FD_CLR(i, &manager->read_fds);
 			}
 		check_write:
@@ -1899,10 +1903,12 @@
 					unlock_sock = ISC_TRUE;
 					LOCK(&sock->lock);
 				}
-				if (sock->connecting)
-					dispatch_connect(sock);
-				else
-					dispatch_write(sock);
+				if (!SOCK_DEAD(sock)) {
+					if (sock->connecting)
+						dispatch_connect(sock);
+					else
+						dispatch_write(sock);
+				}
 				FD_CLR(i, &manager->write_fds);
 			}
 			if (unlock_sock)
@@ -2744,9 +2750,6 @@
 	XTRACE(TRACE_CONNECT,
 	       ("internal_connect called, locked parent sock %p\n", sock));

-	INSIST(sock->connecting);
-	sock->connecting = 0;
-
 	/*
 	 * When the internal event was sent the reference count was bumped
 	 * to keep the socket around for us.  Decrement the count here.
@@ -2764,9 +2767,13 @@
 	 */
 	dev = sock->connect_ev;
 	if (dev == NULL) {
+		INSIST(!sock->connecting);
 		UNLOCK(&sock->lock);
 		return;
 	}
+
+	INSIST(sock->connecting);
+	sock->connecting = 0;

 	/*
 	 * Get any possible error status here.
@@ -2966,6 +2973,9 @@
 		isc_socket_connev_t    *dev;
 		isc_task_t	       *current_task;

+		INSIST(sock->connecting);
+		sock->connecting = 0;
+
 		dev = sock->connect_ev;
 		current_task = dev->sender;


Add verbose and terse output for print_mappings

--- debugger/commands/print_mappings.c
+++ debugger/commands/print_mappings.c
@@ -1,19 +1,28 @@
 #include "commands.h"
 #include "debugger.h"

+#include <string.h>
+
 int command_print_mappings(struct debugger_state *state, int argc, char **argv) {
-    if (argc != 1) {
-        state->print(state, "%s - Print the MMU page mappings.\n", argv[0]);
+    if (argc > 2 || (argc == 2 && strcmp(argv[1], "-v") != 0)) {
+        state->print(state, "%s [-v] - Print the MMU page mappings.\n The -v flag adds verbosity to the output.\n", argv[0]);
+        state->print(state, " The terse output is formatted like this: \"Bank 0: F:00\".\n"
+            " 'F' says the mapped page is a flash page, 'R' says the mapped page is a ram page.\n");
         return 0;
     }

+    int verbose = argc > 1 && strcmp(argv[1], "-v") == 0;
     int i = 0;

     for (i = 0; i < 4; i++) {
         ti_mmu_bank_state_t mapping = state->asic->mmu->banks[i];
-        state->print(state, "Page %d (0x%04X - 0x%04X): mapped to %s page %d (0x%04X - 0x%04X).\n",
-            i, i * 0x4000, (i + 1) * 0x4000 - 1, mapping.flash ? "ROM" : "RAM", mapping.page,
-            mapping.page * 0x4000, (mapping.page + 1) * 0x4000 - 1);
+        if (verbose) {
+            state->print(state, "Page %d (0x%04X - 0x%04X): mapped to %s page %d (0x%04X - 0x%04X).\n",
+                i, i * 0x4000, (i + 1) * 0x4000 - 1, mapping.flash ? "ROM" : "RAM", mapping.page,
+                mapping.page * 0x4000, (mapping.page + 1) * 0x4000 - 1);
+        } else {
+            state->print(state, "Bank %d: %c:%02X\n", i, mapping.flash ? 'F' : 'R', mapping.page);
+        }
     }

     return 0;


Force loadType to 0

Force loadType to 0

--- lib/libc/nls/msgcat.c
+++ lib/libc/nls/msgcat.c
@@ -1,4 +1,4 @@
-/*	$Id: msgcat.c,v 1.13 1998/04/30 10:14:55 ache Exp $ */
+/*	$Id: msgcat.c,v 1.14 1998/04/30 11:06:12 ache Exp $ */

 /***********************************************************
 Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
@@ -149,7 +149,7 @@
 	if (!catpath) return(NLERR);
     }

-    return(loadCat(catpath, type));
+    return(loadCat(catpath));
 }

 /*
@@ -296,9 +296,8 @@
 #define CORRUPT() {fprintf(stderr, "%s: corrupt file.\n", ERRNAME); free(cat); return(NLERR);}
 #define NOSPACE() {fprintf(stderr, "%s: no more memory.\n", ERRNAME); free(cat); return(NLERR);}

-static nl_catd loadCat( catpath, type)
+static nl_catd loadCat(catpath)
 __const char *catpath;
-int type;
 {
     MCHeaderT	header;
     MCCatT	*cat;
@@ -308,7 +307,7 @@

     cat = (MCCatT *) malloc(sizeof(MCCatT));
     if (!cat) return(NLERR);
-    cat->loadType = type;
+    cat->loadType = MCLoadBySet;

     if ((cat->fd = open(catpath, O_RDONLY)) < 0) {
 	free(cat);


Whitespace.

Whitespace.

git-svn-id: 9ed0004971709408f906b8bdafa7f98a7bcab630@1406 f854266a-e20d-0410-a9be-8852184c940f

--- lib/libiax2/src/iax.c
+++ lib/libiax2/src/iax.c
@@ -857,9 +857,9 @@

 		if (ntohs(h->scallno) & IAX_FLAG_FULL)
 			iax_showframe(f, NULL, 0, f->transfer ?
-										&(f->session->transfer) :
-										&(f->session->peeraddr),
-										f->datalen - sizeof(struct ast_iax2_full_hdr));
+					&(f->session->transfer) :
+					&(f->session->peeraddr),
+					f->datalen - sizeof(struct ast_iax2_full_hdr));
 	}
 #endif
 	/* Send the frame raw */
@@ -1425,7 +1425,6 @@
 	int transfer_id = 1 + (int)(32767.0 * (iax_random() / (RAND_MAX + 1.0)));

 	memset(&ied0, 0, sizeof(ied0));
-
 	memset(&ied1, 0, sizeof(ied1));

 	/* reversed setup */


Removed trailing comments, removed extra semicolons

--- lib/libpolypasshash.c
+++ lib/libpolypasshash.c
@@ -551,7 +551,7 @@
     // the information just provided about the user.
     memcpy(salted_password,current_entry->salt,current_entry->salt_length);
     memcpy(salted_password+current_entry->salt_length, password,
-        current_entry->password_length);;
+        current_entry->password_length);
     _calculate_digest(resulting_hash, salted_password,
        current_entry->salt_length + password_length);

@@ -708,7 +708,6 @@
   // initialize the share numbers
   for(i=0;i<MAX_NUMBER_OF_SHARES;i++){
     share_numbers[i] = 0;
-    //share_numbers[i] = (uint8)(i+1);
   }
   // do the reconstruction.
   G = gfshare_ctx_init_dec( share_numbers, MAX_NUMBER_OF_SHARES-1,
@@ -775,7 +774,7 @@
   memcpy(ctx->secret,secret,SHARE_LENGTH-ctx->partial_bytes);
   // check that we got a valid secret

-  // if the share context is not initialized, intialize one with the information
+  // if the share context is not initialized, initialize one with the information
   // we have about our context.
   if(ctx->share_context == NULL){
     for(i=0;i<MAX_NUMBER_OF_SHARES;i++){


[BEETLE] Add comment to clarify LEDs Emulation

Beetle board is built to optimize power consumption therefore does not
provide on-board LEDs.

This patch adds a comment in PinNames in order to clarify that the
Emulated LEDs are provided for compatibility reasons with the MBED test
suite.

Signed-off-by: Vincenzo Frascino <3ace7bb34570a19a202c4c73ce7a798ea734bba6@arm.com>

--- hal/targets/hal/TARGET_ARM_SSG/TARGET_BEETLE/PinNames.h
+++ hal/targets/hal/TARGET_ARM_SSG/TARGET_BEETLE/PinNames.h
@@ -127,6 +127,15 @@
     SENSOR_SCL = 507,

     // Emulated LEDS
+    /*
+     * Beetle board is built to optimize power consumption therefore does not
+     * provide on-board LEDs. The configuration below is provided only for
+     * compatibility purposes with MBED test suite.
+     * The LEDs [1:4] are emulated and trapped in our GPIO driver.
+     * For more details on how to use a Led on an external PIN via GPIO
+     * configuration please refer to the connected community page below:
+     * https://community.arm.com/docs/DOC-11713
+     */
     LED1 = 1001,
     LED2 = 1002,
     LED3 = 1003,


config: factor out usage parser

config: factor out usage parser

Signed-off-by: Andrew Gregory <13115e38efea9b5bf08524f6765f5bb44291d47f@gmail.com>

--- lib/pacutils/config.c
+++ lib/pacutils/config.c
@@ -160,6 +160,28 @@
   return ret;
 }

+static int _pu_config_parse_usage(char *val, int *dest)
+{
+  char *v, *ctx;
+  int ret = 0;
+  for(v = strtok_r(val, " ", &ctx); v; v = strtok_r(NULL, " ", &ctx)) {
+    if(strcmp(v, "Sync") == 0) {
+      *dest |= ALPM_DB_USAGE_SYNC;
+    } else if(strcmp(v, "Search") == 0) {
+      *dest |= ALPM_DB_USAGE_SEARCH;
+    } else if(strcmp(v, "Install") == 0) {
+      *dest |= ALPM_DB_USAGE_INSTALL;
+    } else if(strcmp(v, "Upgrade") == 0) {
+      *dest |= ALPM_DB_USAGE_UPGRADE;
+    } else if(strcmp(v, "All") == 0) {
+      *dest |= ALPM_DB_USAGE_ALL;
+    } else {
+      ret = -1;
+    }
+  }
+  return ret;
+}
+
 static int _pu_config_parse_siglevel(char *val, int *level, int *mask)
 {
   char *v, *ctx;
@@ -614,7 +636,6 @@

     if(reader->repo) {
       pu_repo_t *r = reader->repo;
-      char *v, *ctx;
       switch(s->type) {
         case PU_CONFIG_OPTION_SIGLEVEL:
           if(_pu_config_parse_siglevel(mini->value,
@@ -626,21 +647,8 @@
           r->servers = alpm_list_add(r->servers, strdup(mini->value));
           break;
         case PU_CONFIG_OPTION_USAGE:
-          for(v = strtok_r(mini->value, " ", &ctx); v; v = strtok_r(NULL, " ", &ctx)) {
-            if(strcmp(v, "Sync") == 0) {
-              r->usage |= ALPM_DB_USAGE_SYNC;
-            } else if(strcmp(v, "Search") == 0) {
-              r->usage |= ALPM_DB_USAGE_SEARCH;
-            } else if(strcmp(v, "Install") == 0) {
-              r->usage |= ALPM_DB_USAGE_INSTALL;
-            } else if(strcmp(v, "Upgrade") == 0) {
-              r->usage |= ALPM_DB_USAGE_UPGRADE;
-            } else if(strcmp(v, "All") == 0) {
-              r->usage |= ALPM_DB_USAGE_ALL;
-            } else {
-              reader->status = PU_CONFIG_READER_STATUS_INVALID_VALUE;
-              reader->error = 1;
-            }
+          if(_pu_config_parse_usage(mini->value, &r->usage) != 0) {
+            _PU_ERR(reader, PU_CONFIG_READER_STATUS_INVALID_VALUE);
           }
           break;
         default:


Disable FUSE entry caching

Disable FUSE entry caching

By default, FUSE caches entry names for 1 second. This is awesome for
disk-backed file systems; not so much for network-backed ones (such as
spotifile), since it means that a stat for an as of yet unknown name
results in that name still being unresolvable even when the entry has
been created, for example as the result of a readdir operation.

In particular, this causes great annoyance with the autocompleters that
many shells use, since it might trigger, for example, a full traversal
and subsequent loading of all playlists and their tracks while looking
for a completion for the file that really does exist.

Signed-off-by: Anton Lofgren <644ec9b400317727ea69122efab4ea2fa19fba46@gmail.com>

--- src/spotify-fs.c
+++ src/spotify-fs.c
@@ -97,7 +97,7 @@
 	}

 	fuse_opt_parse(&args, &conf, spfs_opts, spfs_opt_process);
-
+	fuse_opt_add_arg(&args, "-oentry_timeout=0");
 	g_log_set_default_handler(spfs_log_handler, stdout);

 	if (conf.spotify_username != NULL && !conf.spotify_password)