random tidying for MDNode printing.

random tidying for MDNode printing.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@92333 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/VMCore/AsmWriter.cpp
+++ lib/VMCore/AsmWriter.cpp
@@ -751,7 +751,8 @@
 void SlotTracker::CreateMetadataSlot(const MDNode *N) {
   assert(N && "Can't insert a null Value into SlotTracker!");

-  // Don't insert if N is a function-local metadata.
+  // Don't insert if N is a function-local metadata, these are always printed
+  // inline.
   if (N->isFunctionLocal())
     return;

@@ -762,12 +763,10 @@
   unsigned DestSlot = mdnNext++;
   mdnMap[N] = DestSlot;

-  for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
-    const Value *TV = N->getOperand(i);
-    if (TV)
-      if (const MDNode *N2 = dyn_cast<MDNode>(TV))
-        CreateMetadataSlot(N2);
-  }
+  // Recursively add any MDNodes referenced by operands.
+  for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
+    if (const MDNode *Op = dyn_cast_or_null<MDNode>(N->getOperand(i)))
+      CreateMetadataSlot(Op);
 }

 //===----------------------------------------------------------------------===//
@@ -1217,7 +1216,6 @@
                         AssemblyAnnotationWriter *AAW)
     : Out(o), Machine(Mac), TheModule(M), AnnotationWriter(AAW) {
     AddModuleTypesToPrinter(TypePrinter, NumberedTypes, M);
-    // FIXME: Provide MDPrinter
     if (M)
       M->getMDKindNames(MDNames);
   }
@@ -1996,8 +1994,7 @@

   for (unsigned i = 0, e = Nodes.size(); i != e; ++i) {
     Out << '!' << i << " = metadata ";
-    const MDNode *Node = Nodes[i];
-    printMDNodeBody(Node);
+    printMDNodeBody(Nodes[i]);
   }
 }


Change FormulaTreeNode* to std::shared_ptr to avoid memory leak during AST building

Change-Id: I1fc33c389829de99891cc765d322dac09950c8d2

Signed-off-by: I-Jui (Ray) Sung <7f525154e857f3d57a641a83dddc584f42addc6a@multicorewareinc.com>

--- sc/source/core/opencl/formulagroupcl.cxx
+++ sc/source/core/opencl/formulagroupcl.cxx
@@ -37,7 +37,7 @@
     {
         Children.reserve(8);
     }
-    std::vector<FormulaTreeNode *> Children;
+    std::vector<std::shared_ptr<FormulaTreeNode>> Children;
     FormulaToken *GetFormulaToken(void) const
     {
         return mpCurrentFormula;
@@ -52,7 +52,7 @@
 /// by a Push operation in the given RPN.
 class DynamicKernelArgument {
 public:
-    DynamicKernelArgument(const std::string &s, FormulaTreeNode *ft):
+    DynamicKernelArgument(const std::string &s,  std::shared_ptr<FormulaTreeNode> ft):
         mSymName(s), mFormulaTree(ft), mpClmem(NULL) {}
     const std::string &GetNameAsString(void) const { return mSymName; }
     /// Generate declaration
@@ -112,7 +112,7 @@
     }
 protected:
     const std::string mSymName;
-    FormulaTreeNode *mFormulaTree;
+    std::shared_ptr<FormulaTreeNode> mFormulaTree;
     // Used by marshaling
     cl_mem mpClmem;
 };
@@ -160,7 +160,7 @@
 class DynamicKernelConstantArgument: public DynamicKernelArgument
 {
 public:
-    DynamicKernelConstantArgument(const std::string &s, FormulaTreeNode *ft):
+    DynamicKernelConstantArgument(const std::string &s, std::shared_ptr<FormulaTreeNode> ft):
         DynamicKernelArgument(s, ft) {}
     /// Generate declaration
     virtual void GenDecl(std::stringstream &ss)
@@ -202,7 +202,7 @@
 class DynamicKernelSlidingArgument: public DynamicKernelArgument
 {
 public:
-    DynamicKernelSlidingArgument(const std::string &s, FormulaTreeNode *ft):
+    DynamicKernelSlidingArgument(const std::string &s, std::shared_ptr<FormulaTreeNode> ft):
         DynamicKernelArgument(s, ft)
     {
         FormulaToken *t = ft->GetFormulaToken();
@@ -464,7 +464,7 @@
 public:
     typedef std::unique_ptr<DynamicKernelArgument> SubArgument;

-    DynamicKernelSoPArguments(const std::string &s, FormulaTreeNode *ft);
+    DynamicKernelSoPArguments(const std::string &s, std::shared_ptr<FormulaTreeNode> ft);

     /// Create buffer and pass the buffer to a given kernel
     virtual size_t Marshal(cl_kernel k, int argno, int nVectorWidth)
@@ -538,7 +538,7 @@

 template <class Op>
 std::unique_ptr<DynamicKernelArgument> SoPHelper(const std::string &ts,
-    FormulaTreeNode *ft)
+    std::shared_ptr<FormulaTreeNode> ft)
 {
     return std::unique_ptr<DynamicKernelArgument>(
         new DynamicKernelSoPArguments<Op>(ts, ft));
@@ -546,7 +546,7 @@

 template <class Op>
 DynamicKernelSoPArguments<Op>::DynamicKernelSoPArguments(const std::string &s,
-    FormulaTreeNode *ft):
+    std::shared_ptr<FormulaTreeNode> ft):
     DynamicKernelArgument(s, ft) {
     size_t nChildren = ft->Children.size();

@@ -624,7 +624,7 @@
     typedef std::list< std::shared_ptr<DynamicKernelArgument> > ArgumentList;
     SymbolTable(void):mCurId(0) {}
     template <class T>
-    const DynamicKernelArgument *DeclRefArg(FormulaTreeNode *);
+    const DynamicKernelArgument *DeclRefArg(std::shared_ptr<FormulaTreeNode>);
     /// Used to generate sliding window helpers
     void DumpSlidingWindowFunctions(std::stringstream &ss)
     {
@@ -664,7 +664,7 @@
 /// Code generation
 class DynamicKernel {
 public:
-    DynamicKernel(FormulaTreeNode *r):mpRoot(r), mpProgram(NULL),
+    DynamicKernel(std::shared_ptr<FormulaTreeNode> r):mpRoot(r), mpProgram(NULL),
         mpKernel(NULL), mpResClmem(NULL) {}
     /// Code generation in OpenCL
     std::string CodeGen() {
@@ -765,8 +765,8 @@
     ~DynamicKernel();
     cl_mem GetResultBuffer(void) const { return mpResClmem; }
 private:
-    void TraverseAST(FormulaTreeNode *);
-    FormulaTreeNode *mpRoot;
+    void TraverseAST(std::shared_ptr<FormulaTreeNode>);
+    std::shared_ptr<FormulaTreeNode> mpRoot;
     SymbolTable mSyms;
     std::stringstream mKernelSrc;
     std::string mKernelSignature;
@@ -796,7 +796,7 @@
 // kernel with argument with unique name and return so.
 // The template argument T must be a subclass of DynamicKernelArgument
 template <typename T>
-const DynamicKernelArgument *SymbolTable::DeclRefArg(FormulaTreeNode *t)
+const DynamicKernelArgument *SymbolTable::DeclRefArg(std::shared_ptr<FormulaTreeNode> t)
 {
     FormulaToken *ref = t->GetFormulaToken();
     ArgumentMap::iterator it = mSymbols.find(ref);
@@ -856,14 +856,14 @@
     // Constructing "AST"
     FormulaTokenIterator aCode = rCode;
     std::list<FormulaToken *> list;
-    std::map<FormulaToken *, FormulaTreeNode*> m_hash_map;
+    std::map<FormulaToken *, std::shared_ptr<FormulaTreeNode>> m_hash_map;
     FormulaToken*  pCur;
     while( (pCur = (FormulaToken*)(aCode.Next()) ) != NULL)
     {
         OpCode eOp = pCur->GetOpCode();
         if ( eOp != ocPush )
         {
-            FormulaTreeNode *m_currNode = new FormulaTreeNode(pCur);
+            std::shared_ptr<FormulaTreeNode> m_currNode = std::shared_ptr<FormulaTreeNode>(new FormulaTreeNode(pCur));
             sal_uInt8 m_ParamCount =  pCur->GetParamCount();
             for(int i=0; i<m_ParamCount; i++)
             {
@@ -877,7 +877,7 @@
                 }
                 else
                 {
-                    FormulaTreeNode *m_ChildTreeNode = new FormulaTreeNode(m_TempFormula);
+                    std::shared_ptr<FormulaTreeNode> m_ChildTreeNode = std::shared_ptr<FormulaTreeNode>(new FormulaTreeNode(m_TempFormula));
                     m_currNode->Children.push_back(m_ChildTreeNode);
                 }
             }
@@ -887,7 +887,7 @@
         list.push_back(pCur);
     }

-    FormulaTreeNode *Root = new FormulaTreeNode(NULL);
+    std::shared_ptr<FormulaTreeNode> Root = std::shared_ptr<FormulaTreeNode>(new FormulaTreeNode(NULL));
     Root->Children.push_back(m_hash_map[list.back()]);
     // Code generation
     mpKernel = new DynamicKernel(Root);


minor cleanup/fastpath for the bcreader.  This speeds up the bcreader
from 1:41 -> 1:39 on the large python .bc file in a release build.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@23623 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/VMCore/Constants.cpp
+++ lib/VMCore/Constants.cpp
@@ -520,6 +520,9 @@
     typedef std::map<MapKey, ConstantClass *> MapTy;
     typedef typename MapTy::iterator MapIterator;
   private:
+    /// Map - This is the main map from the element descriptor to the Constants.
+    /// This is the primary way we avoid creating two of the same shape
+    /// constant.
     MapTy Map;

     typedef std::map<const TypeClass*, MapIterator> AbstractTypeMapTy;
@@ -547,6 +550,24 @@
       std::pair<MapIterator, bool> IP = Map.insert(InsertVal);
       Exists = !IP.second;
       return IP.first;
+    }
+
+    /// SimpleRemove - This method removes the specified constant from the map,
+    /// without updating type information.  This should only be used when we're
+    /// changing an element in the map, making this the second half of a 'move'
+    /// operation.
+    void SimpleRemove(ConstantClass *CP) {
+      MapIterator I = Map.find(MapKey((TypeClass*)CP->getRawType(),
+                                      getValType(CP)));
+      if (I == Map.end() || I->second != CP) {
+        // FIXME: This should not use a linear scan.  If this gets to be a
+        // performance problem, someone should look at this.
+        for (I = Map.begin(); I != Map.end() && I->second != CP; ++I)
+          /* empty */;
+      }
+      assert(I != Map.end() && "Constant not found in constant table!");
+      assert(I->second == CP && "Didn't find correct element?");
+      Map.erase(I);
     }

     /// getOrCreate - Return the specified constant from the map, creating it if
@@ -1383,7 +1404,7 @@
       // in place!
       if (I != ArrayConstants.map_end() && I->second == this)
         ++I;    // Do not invalidate iterator!
-      ArrayConstants.remove(this);   // Remove old shape from the map.
+      ArrayConstants.SimpleRemove(this);   // Remove old shape from the map.

       // Update to the new values.
       for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
@@ -1445,7 +1466,7 @@
       // in place!
       if (I != StructConstants.map_end() && I->second == this)
         ++I;    // Do not invalidate iterator!
-      StructConstants.remove(this);   // Remove old shape from the map.
+      StructConstants.SimpleRemove(this);   // Remove old shape from the map.

       // Update to the new values.
       for (unsigned i = 0, e = getNumOperands(); i != e; ++i)


remove some misleading comments.

remove some misleading comments.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@92311 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/VMCore/Constants.cpp
+++ lib/VMCore/Constants.cpp
@@ -481,15 +481,12 @@
   // If this is an all-zero array, return a ConstantAggregateZero object
   if (!V.empty()) {
     Constant *C = V[0];
-    if (!C->isNullValue()) {
-      // Implicitly locked.
+    if (!C->isNullValue())
       return pImpl->ArrayConstants.getOrCreate(Ty, V);
-    }
+
     for (unsigned i = 1, e = V.size(); i != e; ++i)
-      if (V[i] != C) {
-        // Implicitly locked.
+      if (V[i] != C)
         return pImpl->ArrayConstants.getOrCreate(Ty, V);
-      }
   }

   return ConstantAggregateZero::get(Ty);
@@ -550,7 +547,6 @@
   // Create a ConstantAggregateZero value if all elements are zeros...
   for (unsigned i = 0, e = V.size(); i != e; ++i)
     if (!V[i]->isNullValue())
-      // Implicitly locked.
       return pImpl->StructConstants.getOrCreate(T, V);

   return ConstantAggregateZero::get(T);
@@ -613,7 +609,6 @@
   if (isUndef)
     return UndefValue::get(T);

-  // Implicitly locked.
   return pImpl->VectorConstants.getOrCreate(T, V);
 }

@@ -894,14 +889,12 @@
          "Cannot create an aggregate zero of non-aggregate type!");

   LLVMContextImpl *pImpl = Ty->getContext().pImpl;
-  // Implicitly locked.
   return pImpl->AggZeroConstants.getOrCreate(Ty, 0);
 }

 /// destroyConstant - Remove the constant from the constant table...
 ///
 void ConstantAggregateZero::destroyConstant() {
-  // Implicitly locked.
   getType()->getContext().pImpl->AggZeroConstants.remove(this);
   destroyConstantImpl();
 }
@@ -909,7 +902,6 @@
 /// destroyConstant - Remove the constant from the constant table...
 ///
 void ConstantArray::destroyConstant() {
-  // Implicitly locked.
   getType()->getContext().pImpl->ArrayConstants.remove(this);
   destroyConstantImpl();
 }
@@ -974,7 +966,6 @@
 // destroyConstant - Remove the constant from the constant table...
 //
 void ConstantStruct::destroyConstant() {
-  // Implicitly locked.
   getType()->getContext().pImpl->StructConstants.remove(this);
   destroyConstantImpl();
 }
@@ -982,7 +973,6 @@
 // destroyConstant - Remove the constant from the constant table...
 //
 void ConstantVector::destroyConstant() {
-  // Implicitly locked.
   getType()->getContext().pImpl->VectorConstants.remove(this);
   destroyConstantImpl();
 }
@@ -1018,14 +1008,12 @@
 //

 ConstantPointerNull *ConstantPointerNull::get(const PointerType *Ty) {
-  // Implicitly locked.
   return Ty->getContext().pImpl->NullPtrConstants.getOrCreate(Ty, 0);
 }

 // destroyConstant - Remove the constant from the constant table...
 //
 void ConstantPointerNull::destroyConstant() {
-  // Implicitly locked.
   getType()->getContext().pImpl->NullPtrConstants.remove(this);
   destroyConstantImpl();
 }
@@ -1137,7 +1125,6 @@
   std::vector<Constant*> argVec(1, C);
   ExprMapKeyType Key(opc, argVec);

-  // Implicitly locked.
   return pImpl->ExprConstants.getOrCreate(Ty, Key);
 }

@@ -1383,8 +1370,6 @@
   ExprMapKeyType Key(Opcode, argVec, 0, Flags);

   LLVMContextImpl *pImpl = ReqTy->getContext().pImpl;
-
-  // Implicitly locked.
   return pImpl->ExprConstants.getOrCreate(ReqTy, Key);
 }

@@ -1535,8 +1520,6 @@
   ExprMapKeyType Key(Instruction::Select, argVec);

   LLVMContextImpl *pImpl = ReqTy->getContext().pImpl;
-
-  // Implicitly locked.
   return pImpl->ExprConstants.getOrCreate(ReqTy, Key);
 }

@@ -1564,8 +1547,6 @@
   const ExprMapKeyType Key(Instruction::GetElementPtr, ArgVec);

   LLVMContextImpl *pImpl = ReqTy->getContext().pImpl;
-
-  // Implicitly locked.
   return pImpl->ExprConstants.getOrCreate(ReqTy, Key);
 }

@@ -1595,8 +1576,6 @@
                            GEPOperator::IsInBounds);

   LLVMContextImpl *pImpl = ReqTy->getContext().pImpl;
-
-  // Implicitly locked.
   return pImpl->ExprConstants.getOrCreate(ReqTy, Key);
 }

@@ -1650,8 +1629,6 @@
   const ExprMapKeyType Key(Instruction::ICmp, ArgVec, pred);

   LLVMContextImpl *pImpl = LHS->getType()->getContext().pImpl;
-
-  // Implicitly locked.
   return
       pImpl->ExprConstants.getOrCreate(Type::getInt1Ty(LHS->getContext()), Key);
 }
@@ -1673,8 +1650,6 @@
   const ExprMapKeyType Key(Instruction::FCmp, ArgVec, pred);

   LLVMContextImpl *pImpl = LHS->getType()->getContext().pImpl;
-
-  // Implicitly locked.
   return
       pImpl->ExprConstants.getOrCreate(Type::getInt1Ty(LHS->getContext()), Key);
 }
@@ -1683,15 +1658,13 @@
                                             Constant *Idx) {
   if (Constant *FC = ConstantFoldExtractElementInstruction(
                                                 ReqTy->getContext(), Val, Idx))
-    return FC;          // Fold a few common cases...
+    return FC;          // Fold a few common cases.
   // Look up the constant in the table first to ensure uniqueness
   std::vector<Constant*> ArgVec(1, Val);
   ArgVec.push_back(Idx);
   const ExprMapKeyType Key(Instruction::ExtractElement,ArgVec);

   LLVMContextImpl *pImpl = ReqTy->getContext().pImpl;
-
-  // Implicitly locked.
   return pImpl->ExprConstants.getOrCreate(ReqTy, Key);
 }

@@ -1708,7 +1681,7 @@
                                            Constant *Elt, Constant *Idx) {
   if (Constant *FC = ConstantFoldInsertElementInstruction(
                                             ReqTy->getContext(), Val, Elt, Idx))
-    return FC;          // Fold a few common cases...
+    return FC;          // Fold a few common cases.
   // Look up the constant in the table first to ensure uniqueness
   std::vector<Constant*> ArgVec(1, Val);
   ArgVec.push_back(Elt);
@@ -1716,8 +1689,6 @@
   const ExprMapKeyType Key(Instruction::InsertElement,ArgVec);

   LLVMContextImpl *pImpl = ReqTy->getContext().pImpl;
-
-  // Implicitly locked.
   return pImpl->ExprConstants.getOrCreate(ReqTy, Key);
 }

@@ -1744,8 +1715,6 @@
   const ExprMapKeyType Key(Instruction::ShuffleVector,ArgVec);

   LLVMContextImpl *pImpl = ReqTy->getContext().pImpl;
-
-  // Implicitly locked.
   return pImpl->ExprConstants.getOrCreate(ReqTy, Key);
 }

@@ -1914,9 +1883,7 @@
 // destroyConstant - Remove the constant from the constant table...
 //
 void ConstantExpr::destroyConstant() {
-  // Implicitly locked.
-  LLVMContextImpl *pImpl = getType()->getContext().pImpl;
-  pImpl->ExprConstants.remove(this);
+  getType()->getContext().pImpl->ExprConstants.remove(this);
   destroyConstantImpl();
 }


Define HAVE_OPENCV before including w2xconv.h

Fix #14.

--- Waifu2x-w2xc/Waifu2x-w2xc.cpp
+++ Waifu2x-w2xc/Waifu2x-w2xc.cpp
@@ -28,6 +28,7 @@
 #include <VapourSynth.h>
 #include <VSHelper.h>

+#define HAVE_OPENCV
 #include <w2xconv.h>

 struct Waifu2xData {


Matrix inf norm was calculated wrong.

Matrix inf norm was calculated wrong.

Old code took the abs of the maximum entry -- it should take the maximum
of the abs entries.

Eigen has a direct way of doing this, but it threw an error I could not
resolve, so I made a note and implemented something that works.

--- include/eli/mutil/nls/iterative_system_root_base.hpp
+++ include/eli/mutil/nls/iterative_system_root_base.hpp
@@ -104,7 +104,12 @@
               }
               case(max_norm):      // for vectors this is equivalent to Linf, for matrices it is the largest element in matrix
               {
-                return std::abs(mat.maxCoeff());
+                data__ maxval = std::abs(mat.maxCoeff());
+                data__ minval = std::abs(mat.minCoeff());
+                if( maxval > minval ) return maxval;
+                else return minval;
+                // The following should work, but it throws an error: Expected expression.
+                // return mat.lpNorm<Eigen::Infinity>();
                 break;
               }
               case(L2):             // for vectors this is sqrt of sum of squares, for matrices this will be equivalent to the Frobenius norm


Fixed: Force of Nature will summon 3 Treants.

--- src/arcemu-world/SpellEffects.cpp
+++ src/arcemu-world/SpellEffects.cpp
@@ -2983,6 +2983,7 @@
 	case 41:
 	case 407:	SpellEffectSummonCritter(i);	return;
 	case 61:
+	case 669:
 	case 881:	SpellEffectSummonGuardian(i);	return;
 	case 64:	SpellEffectSummonWild(i);		return;
 	case 65:


Added stub PpapiPluginMsg_PDF_GetResourceImageReply for Chrome for TV.

Chrome for TV, using limited set of ppapi, needs stub PpapiPluginMsg_PDF_GetResourceImageReply
not to break the build.

BUG=

Review URL: https://chromiumcodereview.appspot.com/13575013

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@193288 0039d316-1c4b-4281-b951-d872f2087c98

--- chrome/renderer/pepper/pepper_pdf_host.cc
+++ chrome/renderer/pepper/pepper_pdf_host.cc
@@ -345,7 +345,13 @@
                                                      image_data_desc,
                                                      image_handle);
 #else
-#error Not implemented.
+  // Not supported on the other platforms.
+  // This is a stub reply_msg not to break the build.
+  PpapiPluginMsg_PDF_GetResourceImageReply reply_msg(host_resource,
+                                                     image_data_desc,
+                                                     0);
+  NOTIMPLEMENTED();
+  return PP_ERROR_NOTSUPPORTED;
 #endif

   SendReply(reply_context, reply_msg);


Fix a typo in a comment.

Fix a typo in a comment.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@46836 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/VMCore/Constants.cpp
+++ lib/VMCore/Constants.cpp
@@ -225,7 +225,7 @@
 }

 // Get a ConstantInt from an APInt. Note that the value stored in the DenseMap
-// as the key, is a DensMapAPIntKeyInfo::KeyTy which has provided the
+// as the key, is a DenseMapAPIntKeyInfo::KeyTy which has provided the
 // operator== and operator!= to ensure that the DenseMap doesn't attempt to
 // compare APInt's of different widths, which would violate an APInt class
 // invariant which generates an assertion.


Fix Qt bustage.

Fix Qt bustage.

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@37164 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- WebCore/page/PrintContext.cpp
+++ WebCore/page/PrintContext.cpp
@@ -124,7 +124,7 @@
     ctx.scale(FloatSize(scale, scale));
     ctx.translate(-pageRect.x(), -pageRect.y());
     ctx.clip(pageRect);
-    m_frame->paint(&ctx, pageRect);
+    m_frame->view()->paintContents(&ctx, pageRect);
     ctx.restore();
 }


removed ap_hook_insert_filter for the input filter, to be able to specify it via conf

--- src/mod_compare.cc
+++ src/mod_compare.cc
@@ -381,7 +381,7 @@
     ap_register_output_filter(gNameOut, outputFilterHandler, NULL, AP_FTYPE_RESOURCE);
     // output filter of type AP_FTYPE_CONNECTION => only the response header will be read
     ap_register_output_filter(gNameOut2, outputFilterHandler2, NULL, AP_FTYPE_TRANSCODE);
-    ap_hook_insert_filter(&insertInputFilter, NULL, NULL, APR_HOOK_FIRST);
+    // ap_hook_insert_filter(&insertInputFilter, NULL, NULL, APR_HOOK_FIRST);
     ap_hook_insert_filter(&insertOutputFilter, NULL, NULL, APR_HOOK_LAST);
     ap_hook_insert_filter(&insertOutputFilter2, NULL, NULL, APR_HOOK_LAST);


x86: Initialize the MXCSR register

x86: Initialize the MXCSR register

--- src/arch/x86/faults.cc
+++ src/arch/x86/faults.cc
@@ -268,6 +268,8 @@
         tc->setMiscReg(MISCREG_DR6, 0x00000000ffff0ff0ULL);
         tc->setMiscReg(MISCREG_DR7, 0x0000000000000400ULL);

+        tc->setMiscReg(MISCREG_MXCSR, 0x1f80);
+
         // Update the handy M5 Reg.
         tc->setMiscReg(MISCREG_M5_REG, 0);
         MicroPC entry = X86ISAInst::RomLabels::extern_label_initIntHalt;


INTEGRATION: CWS sb59 (1.6.488); FILE MERGED 2006/08/03 13:51:39 cl 1.6.488.1: removed compiler warnings

--- svx/source/editeng/SvXMLAutoCorrectExport.cxx
+++ svx/source/editeng/SvXMLAutoCorrectExport.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: SvXMLAutoCorrectExport.cxx,v $
  *
- *  $Revision: 1.7 $
+ *  $Revision: 1.8 $
  *
- *  last change: $Author: obo $ $Date: 2006-09-17 04:47:27 $
+ *  last change: $Author: obo $ $Date: 2006-10-12 12:33:34 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -64,7 +64,7 @@
                             XML_NAMESPACE_BLOCKLIST );
 }

-sal_uInt32 SvXMLAutoCorrectExport::exportDoc(enum XMLTokenEnum eClass)
+sal_uInt32 SvXMLAutoCorrectExport::exportDoc(enum XMLTokenEnum /*eClass*/)
 {
     GetDocHandler()->startDocument();

@@ -106,7 +106,7 @@
                             XML_NAMESPACE_BLOCKLIST );
 }

-sal_uInt32 SvXMLExceptionListExport::exportDoc(enum XMLTokenEnum eClass)
+sal_uInt32 SvXMLExceptionListExport::exportDoc(enum XMLTokenEnum /*eClass*/)
 {
     GetDocHandler()->startDocument();


changed % to fmod() for doubles

changed % to fmod() for doubles

--- nthRoot.cpp
+++ nthRoot.cpp
@@ -136,14 +136,14 @@
     int asRoot = b->getRoot();
     int asOperand = b->getOperand();
     int asCoefficient = b->getCoefficient();
-    if (root == asRoot && ((double)coefficient / (double)asCoefficient) % 1 == 0 && ((double)operand / (double)asOperand) % 1 == 0) {
+    if (root == asRoot && fmod( ((double)coefficient / (double)asCoefficient), 1) == 0 && fmod(((double)operand / (double)asOperand), 1) == 0) {
         int newCoefficient = coefficient / asCoefficient;
         int newOperand = operand / asOperand;
         nthRoot* newNthRoot = new nthRoot(root, newOperand, newCoefficient);
         nthRoot* simplifiedVersion = (nthRoot *)newNthRoot->simplify();
         return simplifiedVersion;
     }
-   else if (((double)coefficient / (double)asCoefficient) % 1 == 0) {
+   else if (fmod( ((double)coefficient / (double)asCoefficient),1) == 0) {
         int newCoefficient = coefficient / asCoefficient;
         nthRoot* newNthRoot = new nthRoot(root, operand, newCoefficient);
         nthRoot* simplifiedVersion = (nthRoot *)newNthRoot->simplify();


constructorInitializerList unit test added

--- src/tests/tests.cpp
+++ src/tests/tests.cpp
@@ -57,6 +57,21 @@
   constexpr bool operator==(weekday lhs, weekday rhs) noexcept { return lhs.get() == rhs.get(); }
   constexpr bool operator==(weekday::underlying_type lhs, weekday rhs) noexcept { return lhs == rhs.get(); }
   constexpr bool operator==(weekday lhs, weekday::underlying_type rhs) noexcept { return lhs.get() == rhs; }
+
+  class weekday_mask {
+  public:
+    using underlying_type = std::uint8_t;
+    constexpr explicit weekday_mask(std::initializer_list<weekday> days)
+    {
+      for(auto d : days)
+        mask_ |= (1 << d.get());
+    }
+    constexpr underlying_type mask() const noexcept { return mask_; }
+
+  private:
+    underlying_type mask_ = 0;
+  };
+
 }

 namespace mp {
@@ -103,6 +118,28 @@
     static constexpr storage_type null_value() noexcept { return storage_type{}; }
     static constexpr bool has_value(storage_type value) noexcept { return value.null_value != 7; }
   };
+
+  template<>
+  struct opt_default_policy<weekday_mask> {
+    union storage_type {
+      weekday_mask value;
+      weekday_mask::underlying_type null_value = 0b1111'1111;
+
+      constexpr storage_type() noexcept {};
+      constexpr storage_type(weekday_mask v) : value{v} {}
+      constexpr explicit storage_type(std::initializer_list<weekday> days) : value{days} {}
+
+      storage_type& operator=(weekday_mask v)
+      {
+        value = v;
+        return *this;
+      }
+    };
+
+  public:
+    static constexpr storage_type null_value() noexcept { return storage_type{}; }
+    static constexpr bool has_value(storage_type value) noexcept { return value.null_value != 0b1111'1111; }
+  };
 }

 namespace {
@@ -824,6 +861,18 @@
   EXPECT_EQ(this->value_1, o2.value_or(this->value_2));
 }

+TEST(opt, constructorInitializerList)
+{
+  using wd = weekday;
+  weekday_mask mask{wd{0}, wd{2}, wd{6}};
+  opt<weekday_mask> o1{in_place, {wd{0}, wd{2}, wd{6}}};
+  EXPECT_TRUE(o1);
+  EXPECT_TRUE(o1.has_value());
+  EXPECT_EQ(0b0100'0101, (*o1).mask());
+  EXPECT_EQ(0b0100'0101, o1.value().mask());
+  EXPECT_EQ(0b0100'0101, o1.value_or(weekday_mask{wd{0}, wd{1}, wd{3}}).mask());
+}
+
 TEST(opt, constructOutOfRange)
 {
   weekday::underlying_type d1{7};


x11 fixup

x11 fixup

--- Engine/system/api/x11api.cpp
+++ Engine/system/api/x11api.cpp
@@ -303,7 +303,7 @@

             uint32_t scan = xev.xkey.keycode;

-            Tempest::KeyEvent e(Event::KeyType(key),uint32_t(u16.size()>0 ? u16[0] : 0),(xev.type==KeyPress) ? Event::KeyDown : Event::KeyUp);
+            Tempest::KeyEvent e(Event::KeyType(key),uint32_t(u16.size()>0 ? u16[0] : 0),Event::M_NoModifier,(xev.type==KeyPress) ? Event::KeyDown : Event::KeyUp);
             if(xev.type==KeyPress)
               SystemApi::dispatchKeyDown(*cb,e,scan); else
               SystemApi::dispatchKeyUp  (*cb,e,scan);


update src/bin/sysctl_set

update src/bin/sysctl_set

--- src/bin/sysctl_set/main.cpp
+++ src/bin/sysctl_set/main.cpp
@@ -22,7 +22,7 @@

 int
-main(int argc, char **argv)
+main(int argc, char** argv)
 {
   if (argc != 3) {
     fprintf(stderr, "Usage: %s key value\n", argv[0]);
@@ -30,7 +30,6 @@
   }

   if (! verifyUser()) {
-    fprintf(stderr, "Permission denied\n");
     return 1;
   }

@@ -48,7 +47,5 @@
     return 1;
   }

-  fprintf(stderr, "%s -> %d\n", name, value);
-
   return 0;
 }