INTEGRATION: CWS aw019 (1.9.298); FILE MERGED 2004/10/18 19:35:45 aw 1.9.298.2: RESYNC: (1.9-1.10); FILE MERGED 2004/09/28 15:53:05 aw 1.9.298.1: #i11190#

--- svx/source/form/fmmodel.cxx
+++ svx/source/form/fmmodel.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: fmmodel.cxx,v $
  *
- *  $Revision: 1.10 $
- *
- *  last change: $Author: kz $ $Date: 2004-10-04 17:50:50 $
+ *  $Revision: 1.11 $
+ *
+ *  last change: $Author: pjunck $ $Date: 2004-11-03 10:43:12 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -115,7 +115,7 @@
 FmFormModel::FmFormModel(SfxItemPool* pPool, SfxObjectShell* pPers)
             :SdrModel(pPool, pPers, LOADREFCOUNTS)
             ,pObjShell(0)
-            ,bStreamingOldVersion(sal_False)
+//BFS01         ,bStreamingOldVersion(sal_False)
             ,m_pImpl(NULL)
             ,m_bOpenInDesignMode(sal_False)
             ,m_bAutoControlFocus(sal_False)
@@ -135,7 +135,7 @@
 FmFormModel::FmFormModel(const XubString& rPath, SfxItemPool* pPool, SfxObjectShell* pPers)
             :SdrModel(rPath, pPool, pPers)
             ,pObjShell(0)
-            ,bStreamingOldVersion(sal_False)
+//BFS01         ,bStreamingOldVersion(sal_False)
             ,m_pImpl(NULL)
             ,m_bOpenInDesignMode(sal_False)
             ,m_bAutoControlFocus(sal_False)
@@ -157,7 +157,7 @@
                          )
             :SdrModel(pPool, pPers, bUseExtColorTable, LOADREFCOUNTS)
             ,pObjShell(0)
-            ,bStreamingOldVersion(sal_False)
+//BFS01         ,bStreamingOldVersion(sal_False)
             ,m_pImpl(NULL)
 {
 #ifndef SVX_LIGHT
@@ -176,7 +176,7 @@
                          FASTBOOL bUseExtColorTable)
             :SdrModel(rPath, pPool, pPers, bUseExtColorTable, LOADREFCOUNTS)
             ,pObjShell(0)
-            ,bStreamingOldVersion(sal_False)
+//BFS01         ,bStreamingOldVersion(sal_False)
             ,m_bOpenInDesignMode(sal_False)
             ,m_bAutoControlFocus(sal_False)
 {
@@ -257,32 +257,32 @@
 |*
 \************************************************************************/

-void FmFormModel::WriteData(SvStream& rOut) const
-{
-#ifndef SVX_LIGHT
-
-    if( rOut.GetVersion() < SOFFICE_FILEFORMAT_50 )
-        ((FmFormModel*)this)->bStreamingOldVersion = sal_True;
-
-    SdrModel::WriteData( rOut );
-
-    //////////////////////////////////////////////////////////////////////
-    // Speichern der Option OpenInDesignMode
-    if (!bStreamingOldVersion)
-    {
-        SdrDownCompat aModelFormatCompat(rOut,STREAM_WRITE);
-
-        sal_uInt8 nTemp = m_bOpenInDesignMode;
-        rOut << nTemp;
-
-        nTemp = m_bAutoControlFocus;
-        rOut << nTemp;
-    }
-
-    ((FmFormModel*)this)->bStreamingOldVersion = sal_False;
-
-#endif
-}
+//BFS01void FmFormModel::WriteData(SvStream& rOut) const
+//BFS01{
+//BFS01#ifndef SVX_LIGHT
+//BFS01
+//BFS01 if( rOut.GetVersion() < SOFFICE_FILEFORMAT_50 )
+//BFS01     ((FmFormModel*)this)->bStreamingOldVersion = sal_True;
+//BFS01
+//BFS01 SdrModel::WriteData( rOut );
+//BFS01
+//BFS01 //////////////////////////////////////////////////////////////////////
+//BFS01 // Speichern der Option OpenInDesignMode
+//BFS01 if (!bStreamingOldVersion)
+//BFS01 {
+//BFS01     SdrDownCompat aModelFormatCompat(rOut,STREAM_WRITE);
+//BFS01
+//BFS01     sal_uInt8 nTemp = m_bOpenInDesignMode;
+//BFS01     rOut << nTemp;
+//BFS01
+//BFS01     nTemp = m_bAutoControlFocus;
+//BFS01     rOut << nTemp;
+//BFS01 }
+//BFS01
+//BFS01 ((FmFormModel*)this)->bStreamingOldVersion = sal_False;
+//BFS01
+//BFS01#endif
+//BFS01}

 /*************************************************************************
@@ -290,32 +290,32 @@
 |* ReadData
 |*
 \************************************************************************/
-void FmFormModel::ReadData(const SdrIOHeader& rHead, SvStream& rIn)
-{
-    if( rIn.GetVersion() < SOFFICE_FILEFORMAT_50 )
-        ((FmFormModel*)this)->bStreamingOldVersion = sal_True;
-
-    SdrModel::ReadData( rHead, rIn );
-
-    //////////////////////////////////////////////////////////////////////
-    // Lesen der Option OpenInDesignMode
-    if (!bStreamingOldVersion)
-    {
-        SdrDownCompat aCompat(rIn,STREAM_READ);
-        sal_uInt8 nTemp = 0;
-        rIn >> nTemp;
-
-        implSetOpenInDesignMode( nTemp ? sal_True : sal_False, sal_True );
-
-        if (aCompat.GetBytesLeft())
-        {   // it is a version which already wrote the AutoControlFocus flag
-            rIn >> nTemp;
-            m_bAutoControlFocus = nTemp ? sal_True : sal_False;
-        }
-    }
-
-    ((FmFormModel*)this)->bStreamingOldVersion = sal_False;
-}
+//BFS01void FmFormModel::ReadData(const SdrIOHeader& rHead, SvStream& rIn)
+//BFS01{
+//BFS01 if( rIn.GetVersion() < SOFFICE_FILEFORMAT_50 )
+//BFS01     ((FmFormModel*)this)->bStreamingOldVersion = sal_True;
+//BFS01
+//BFS01 SdrModel::ReadData( rHead, rIn );
+//BFS01
+//BFS01 //////////////////////////////////////////////////////////////////////
+//BFS01 // Lesen der Option OpenInDesignMode
+//BFS01 if (!bStreamingOldVersion)
+//BFS01 {
+//BFS01     SdrDownCompat aCompat(rIn,STREAM_READ);
+//BFS01     sal_uInt8 nTemp = 0;
+//BFS01     rIn >> nTemp;
+//BFS01
+//BFS01     implSetOpenInDesignMode( nTemp ? sal_True : sal_False, sal_True );
+//BFS01
+//BFS01     if (aCompat.GetBytesLeft())
+//BFS01     {   // it is a version which already wrote the AutoControlFocus flag
+//BFS01         rIn >> nTemp;
+//BFS01         m_bAutoControlFocus = nTemp ? sal_True : sal_False;
+//BFS01     }
+//BFS01 }
+//BFS01
+//BFS01 ((FmFormModel*)this)->bStreamingOldVersion = sal_False;
+//BFS01}

 /*************************************************************************


add. include FrameSearchFlag.hpp

add. include FrameSearchFlag.hpp

--- svx/source/form/fmshimp.cxx
+++ svx/source/form/fmshimp.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: fmshimp.cxx,v $
  *
- *  $Revision: 1.2 $
+ *  $Revision: 1.3 $
  *
- *  last change: $Author: fs $ $Date: 2000-09-21 12:31:31 $
+ *  last change: $Author: kz $ $Date: 2000-09-26 11:42:52 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -124,6 +124,9 @@
 #include <sfx2/dispatch.hxx>
 #endif

+#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#endif
 #ifndef _COM_SUN_STAR_FORM_XLOADABLE_HPP_
 #include <com/sun/star/form/XLoadable.hpp>
 #endif


delilah finally connects to workers

delilah finally connects to workers

git-svn-id: 9714148d14941aebeae8d7f7841217f5ffc02bc5@251 4143565c-f3ec-42ea-b729-f8ce0cf5cbc3

--- libs/network/Network.cpp
+++ libs/network/Network.cpp
@@ -442,10 +442,10 @@

 				endpoint[ix]->name  = std::string(name);
 				endpoint[ix]->fd    = fd;
-				endpoint[ix]->state = Endpoint::Connected;
 				endpoint[ix]->type  = Endpoint::Temporal;
 				endpoint[ix]->ip    = ip;
 				endpoint[ix]->alias = (alias != NULL)? alias : "NO ALIAS" ;
+				endpoint[ix]->state = (fd > 0)? Endpoint::Connected : Endpoint::Unconnected;   /* XXX */

 				return endpoint[ix];
 			}
@@ -467,7 +467,7 @@
 				endpoint[ix]->name       = std::string(name);
 				endpoint[ix]->alias      = (alias != NULL)? alias : "NO ALIAS" ;
 				endpoint[ix]->fd         = fd;
-				endpoint[ix]->state      = Endpoint::Connected;
+				endpoint[ix]->state      = (fd > 0)? Endpoint::Connected : Endpoint::Unconnected;   /* XXX */
 				endpoint[ix]->type       = type;
 				endpoint[ix]->ip         = ip;
 				endpoint[ix]->port       = port;
@@ -522,8 +522,7 @@
 				endpoint[ix]->type     = Endpoint::Worker;
 				endpoint[ix]->ip       = ip;
 				endpoint[ix]->port     = port;
-
-				endpoint[ix]->state    = Endpoint::Connected;
+				endpoint[ix]->state    = (fd > 0)? Endpoint::Connected : Endpoint::Unconnected;   /* XXX */

 				return endpoint[ix];
 			}
@@ -627,7 +626,7 @@
 		if (endpoint[ix] == NULL)
 			continue;

-		LM_M(("comparing '%s' to '%s' (state: '%s')", endpoint[ix]->alias.c_str(), alias, endpoint[ix]->stateName()));
+		LM_M(("comparing ep %02d '%s' to '%s' (state: '%s')", ix, endpoint[ix]->alias.c_str(), alias, endpoint[ix]->stateName()));
 		if ((strcmp(endpoint[ix]->alias.c_str(), alias) == 0) && (endpoint[ix]->state == Endpoint::Connected))
 		{
 			LM_M(("found occupied (state: '%s') endpoint with alias '%s'", endpoint[ix]->stateName(), alias));
@@ -816,6 +815,7 @@
 					endpoint[3 + ix] = new Endpoint(Endpoint::Worker, workerV[ix].name, workerV[ix].ip, workerV[ix].port, -1);
 					LM_M(("endpoint[%d] at %p", 3 + ix, endpoint[3 + ix]));
 					endpoint[3 + ix]->state = Endpoint::Unconnected;
+					endpoint[3 + ix]->alias = workerV[ix].alias;
 				}

 				epP = endpoint[3 + ix];
@@ -831,8 +831,8 @@
 				{
 					int workerFd;

-					LM_T(LMT_WORKERS, ("Connect to worker %d: %s (host %s, port %d)",
-									   ix, epP->name.c_str(), epP->ip.c_str(), epP->port));
+					LM_T(LMT_WORKERS, ("Connect to worker %d: %s (host %s, port %d, alias '%s')",
+									   ix, epP->name.c_str(), epP->ip.c_str(), epP->port, epP->alias.c_str()));

 					if ((workerFd = iomConnect(epP->ip.c_str(), epP->port)) == -1)
 					{
@@ -842,8 +842,6 @@
 					else
 					{
 						Endpoint* ep;
-
-						// epP->state = Endpoint::Connected;

 						ep = endpointAdd(workerFd, (char*) "to be worker", NULL, 0, Endpoint::Temporal, epP->ip, epP->port);
 						if (ep != NULL)


INTEGRATION: CWS changefileheader (1.4.368); FILE MERGED 2008/04/01 12:49:10 thb 1.4.368.2: #i85898# Stripping all external header guards 2008/03/31 14:22:22 rt 1.4.368.1: #i87441# Change license header to LPGL v3.

--- svx/source/inc/unopracc.hxx
+++ svx/source/inc/unopracc.hxx
@@ -1,48 +1,38 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  $RCSfile: unopracc.hxx,v $
+ * Copyright 2008 by Sun Microsystems, Inc.
  *
- *  $Revision: 1.4 $
+ * OpenOffice.org - a multi-platform office productivity suite
  *
- *  last change: $Author: hr $ $Date: 2007-06-27 18:25:09 $
+ * $RCSfile: unopracc.hxx,v $
+ * $Revision: 1.5 $
  *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
+ * 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.
  *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ * 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).
  *
- *    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
+ * 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.
  *
  ************************************************************************/

 #ifndef _SVX_UNOPRACC_HXX
 #define _SVX_UNOPRACC_HXX

-#ifndef _SVX_UNOSHAPE_HXX
 #include <svx/unoshape.hxx>
-#endif
-
-#ifndef _SVX_UNOTEXT_HXX
 #include <svx/unotext.hxx>
-#endif

 class SvxEditSource;


prevent second call of ExecFormLetter

prevent second call of ExecFormLetter

--- sw/source/ui/dbui/dbmgr.cxx
+++ sw/source/ui/dbui/dbmgr.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: dbmgr.cxx,v $
  *
- *  $Revision: 1.19 $
+ *  $Revision: 1.20 $
  *
- *  last change: $Author: os $ $Date: 2001-02-09 13:57:43 $
+ *  last change: $Author: os $ $Date: 2001-02-16 14:58:11 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -892,6 +892,7 @@

 SwNewDBMgr::SwNewDBMgr() :
             pMergeData(0),
+            pMergeDialog(0),
             bInMerge(FALSE),
             nMergeType(DBMGR_INSERT),
             bInitDBFields(FALSE)
@@ -2199,6 +2200,9 @@
 void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
                         const Sequence<PropertyValue>& rProperties)
 {
+    //prevent second call
+    if(pMergeDialog)
+        return ;
     OUString sDataSource, sDataTableOrQuery;
     Reference<XResultSet>  xResSet;
     Sequence<sal_Int32> aSelection;
@@ -2228,15 +2232,15 @@
         DBG_ERROR("PropertyValues missing or unset")
         return;
     }
-    SwMailMergeDlg* pDlg = new SwMailMergeDlg(
+    pMergeDialog = new SwMailMergeDlg(
                     &rSh.GetView().GetViewFrame()->GetWindow(), rSh,
                     sDataSource,
                     sDataTableOrQuery,
                     nCmdType, aSelection );

-    if (pDlg->Execute() == RET_OK)
-    {
-        SetMergeType(  pDlg->GetMergeType() );
+    if(pMergeDialog->Execute() == RET_OK)
+    {
+        SetMergeType(  pMergeDialog->GetMergeType() );

         Sequence<PropertyValue> aNewProperties = rProperties;
         if(!bHasSelectionProperty)
@@ -2245,13 +2249,13 @@
             aNewProperties.realloc(rProperties.getLength() + 1);
         }
         PropertyValue* pNewValues = aNewProperties.getArray();
-        pNewValues[nSelectionPos].Value <<= pDlg->GetSelection();
+        pNewValues[nSelectionPos].Value <<= pMergeDialog->GetSelection();
         OFF_APP()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, rSh.GetView().GetViewFrame()->GetObjectShell()));
         MergeNew(GetMergeType(),
                             rSh,
                             aNewProperties);
-        delete(pDlg);
-    }
+    }
+    DELETEZ(pMergeDialog);
 }
 /* -----------------------------13.11.00 08:20--------------------------------


Added dictionary tests

Added dictionary tests

--- libscratch_test/main.cpp
+++ libscratch_test/main.cpp
@@ -73,11 +73,30 @@
   TEST(aiNumbers.Count() == 2);
 }

+/// Dictionary testing
+void TestDictionary()
+{
+  printf("Testing dictionary\n");
+
+  CDictionary<CString, INDEX> diTest;
+  TEST(!diTest.HasKey("Test"));
+
+  diTest["Test"] = 100;
+  diTest["Test2"] = 200;
+  TEST(diTest.HasKey("Test"));
+  TEST(diTest["Test"] == 100);
+
+  diTest.RemoveByKey("Test");
+  TEST(diTest.Count() == 1);
+  TEST(!diTest.HasKey("Test"));
+}
+
 int main()
 {
   // perform tests
   TestString();
   TestStackArray();
+  TestDictionary();

   // check if all went OK
   if(_ctFailed == 0) {


INTEGRATION: CWS changefileheader (1.5.656); FILE MERGED 2008/04/01 15:59:14 thb 1.5.656.2: #i85898# Stripping all external header guards 2008/03/31 16:58:33 rt 1.5.656.1: #i87441# Change license header to LPGL v3.

--- sw/source/ui/inc/inpdlg.hxx
+++ sw/source/ui/inc/inpdlg.hxx
@@ -1,50 +1,41 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  $RCSfile: inpdlg.hxx,v $
+ * Copyright 2008 by Sun Microsystems, Inc.
  *
- *  $Revision: 1.5 $
+ * OpenOffice.org - a multi-platform office productivity suite
  *
- *  last change: $Author: kz $ $Date: 2006-11-06 14:53:00 $
+ * $RCSfile: inpdlg.hxx,v $
+ * $Revision: 1.6 $
  *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
+ * 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.
  *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ * 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).
  *
- *    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
+ * 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.
  *
  ************************************************************************/
 #ifndef _INPDLG_HXX
 #define _INPDLG_HXX

-#ifndef _SVX_STDDLG_HXX //autogen
 #include <svx/stddlg.hxx>
-#endif

 #ifndef _SV_SVMEDIT_HXX //autogen
 #include <svtools/svmedit.hxx>
 #endif
-#ifndef _SV_FIXED_HXX
 #include <vcl/fixed.hxx>
-#endif
 #ifndef _BUTTON_HXX //autogen
 #include <vcl/button.hxx>
 #endif


INTEGRATION: CWS swwarnings (1.6.222); FILE MERGED 2007/03/26 12:09:31 tl 1.6.222.1: #i69287# warning-free code

--- sw/source/ui/uno/detreg.cxx
+++ sw/source/ui/uno/detreg.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: detreg.cxx,v $
  *
- *  $Revision: 1.6 $
+ *  $Revision: 1.7 $
  *
- *  last change: $Author: obo $ $Date: 2006-09-16 23:28:24 $
+ *  last change: $Author: hr $ $Date: 2007-09-27 12:41:02 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -46,13 +46,13 @@

 SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
         const  sal_Char**   ppEnvironmentTypeName,
-        uno_Environment**   ppEnvironment           )
+        uno_Environment**   /*ppEnvironment*/ )
 {
     *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
 }

 SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
-    void*   pServiceManager ,
+    void*   /*pServiceManager*/,
     void*   pRegistryKey    )
 {
     Reference< ::registry::XRegistryKey >
@@ -78,7 +78,7 @@
 SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
     const sal_Char* pImplementationName,
     void* pServiceManager,
-    void* pRegistryKey )
+    void* /*pRegistryKey*/ )
 {
     // Set default return value for this operation - if it failed.
     void* pReturn = NULL ;


write_delta carries new file size on write

--- libsyndicate-ug/impl.cpp
+++ libsyndicate-ug/impl.cpp
@@ -44,7 +44,8 @@
 }

-// update a file's manifest, in response to a remote call
+// update a file's manifest, in response to a remote call
+// write_delta must contain the new file size
 // return 0 on success
 // return -ENOENT if not found
 // return -ESTALE if not local


don't re-update the manifest when we finish flushing blocks at the end of fsync.  We do this already as part of write().

--- libsyndicate-ug/sync.cpp
+++ libsyndicate-ug/sync.cpp
@@ -133,6 +133,7 @@
          }
       }

+      /* DEPRECATED; handled by write()
       // make it coherent with the inode's manifest
       rc = UG_inode_dirty_block_update_manifest( gateway, inode, &itr->second );
       if( rc != 0 ) {
@@ -143,6 +144,7 @@
          worst_rc = rc;
          break;
       }
+      */
    }

    return worst_rc;


Refactoring enum types in UvUtils package.

--- libtbag/util/UvUtils.hpp
+++ libtbag/util/UvUtils.hpp
@@ -76,37 +76,32 @@
     TBAG_UTIL_UV_HANDLE_MAP(_TBAG_XX, _TBAG_XX, _TBAG_XX)
 #endif

+typedef int UvPodType;
+
 /**
  * Table of libuv types.
  *
  * @author zer0
  * @date   2016-12-07
  */
-enum class UvType : int
+enum class UvType : UvPodType
 {
     UNKNOWN = 0,
 #define _TBAG_XX(name, type) name,
     TBAG_UTIL_UV_HANDLE_MAP_ALL(_TBAG_XX)
 #undef _TBAG_XX
-    SIZE
+    _SIZE_
 };

-/**
- * Table of libuv handle types.
- *
- * @author zer0
- * @date   2016-12-17
- */
-enum class UvHandleType : int
-{
-    UNKNOWN = 0,
-#define _TBAG_XX(name, type) name = static_cast<int>(UvType::name),
-#define _TBAG_NX(name, type)
-    TBAG_UTIL_UV_HANDLE_MAP(_TBAG_XX, _TBAG_NX, _TBAG_NX)
+// @formatter:off
+#define _TBAG_XX(name, type) name = static_cast<UvPodType>(UvType::name),
+#define _TBAG_NOT(name, type)
+enum class UvHandleType  : UvPodType { _START_NUMBER_ = -1, TBAG_UTIL_UV_HANDLE_MAP(_TBAG_XX, _TBAG_NOT, _TBAG_NOT) _SIZE_ };
+enum class UvRequsetType : UvPodType { _START_NUMBER_ = -1, TBAG_UTIL_UV_HANDLE_MAP(_TBAG_NOT, _TBAG_XX, _TBAG_NOT) _SIZE_ };
+enum class UvEtcType     : UvPodType { _START_NUMBER_ = -1, TBAG_UTIL_UV_HANDLE_MAP(_TBAG_NOT, _TBAG_NOT, _TBAG_XX) _SIZE_ };
 #undef _TBAG_XX
-#undef _TBAG_NX
-    SIZE
-};
+#undef _TBAG_NOT
+// @formatter:on

 TBAG_API void initUv();
 TBAG_API char const * getUvHandleName(void * handle);


remove

remove

--- AFRODITE.cc
+++ AFRODITE.cc
@@ -1,202 +0,0 @@
-//
-// ********************************************************************
-// * License and Disclaimer                                           *
-// *                                                                  *
-// * The  Geant4 software  is  copyright of the Copyright Holders  of *
-// * the Geant4 Collaboration.  It is provided  under  the terms  and *
-// * conditions of the Geant4 Software License,  included in the file *
-// * LICENSE and available at  http://cern.ch/geant4/license .  These *
-// * include a list of copyright holders.                             *
-// *                                                                  *
-// * Neither the authors of this software system, nor their employing *
-// * institutes,nor the agencies providing financial support for this *
-// * work  make  any representation or  warranty, express or implied, *
-// * regarding  this  software system or assume any liability for its *
-// * use.  Please see the license in the file  LICENSE  and URL above *
-// * for the full disclaimer and the limitation of liability.         *
-// *                                                                  *
-// * This  code  implementation is the result of  the  scientific and *
-// * technical work of the GEANT4 collaboration.                      *
-// * By using,  copying,  modifying or  distributing the software (or *
-// * any work based  on the software)  you  agree  to acknowledge its *
-// * use  in  resulting  scientific  publications,  and indicate your *
-// * acceptance of all terms of the Geant4 Software license.          *
-// ********************************************************************
-//
-// $Id: exampleB4a.cc 75215 2013-10-29 16:07:06Z gcosmo $
-//
-/// \file exampleB4a.cc
-/// \brief Main program of the B4a example
-
-#include "DetectorConstruction.hh"
-#include "ActionInitialization.hh"
-
-#ifdef G4MULTITHREADED
-#include "G4MTRunManager.hh"
-#else
-#include "G4RunManager.hh"
-#endif
-
-#include "G4UImanager.hh"
-#include "G4UIcommand.hh"
-#include "FTFP_BERT.hh"
-#include "QGSP_BERT.hh"
-#include "QGSP_BERT_HP.hh"
-
-#include "G4PhysListFactory.hh"
-#include "G4RadioactiveDecayPhysics.hh"
-
-#include "Randomize.hh"
-
-#ifdef G4VIS_USE
-#include "G4VisExecutive.hh"
-#endif
-
-#ifdef G4UI_USE
-#include "G4UIExecutive.hh"
-#endif
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-namespace {
-    void PrintUsage() {
-        G4cerr << " Usage: " << G4endl;
-        G4cerr << " exampleB4a [-m macro ] [-u UIsession] [-t nThreads]" << G4endl;
-        G4cerr << "   note: -t option is available only for multi-threaded mode."
-        << G4endl;
-    }
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-int main(int argc,char** argv)
-{
-    // Evaluate arguments
-    //
-    if ( argc > 7 ) {
-        PrintUsage();
-        return 1;
-    }
-
-    G4String macro;
-    G4String session;
-#ifdef G4MULTITHREADED
-    G4int nThreads = 0;
-#endif
-    for ( G4int i=1; i<argc; i=i+2 ) {
-        if      ( G4String(argv[i]) == "-m" ) macro = argv[i+1];
-        else if ( G4String(argv[i]) == "-u" ) session = argv[i+1];
-#ifdef G4MULTITHREADED
-        else if ( G4String(argv[i]) == "-t" ) {
-            nThreads = G4UIcommand::ConvertToInt(argv[i+1]);
-        }
-#endif
-        else {
-            PrintUsage();
-            return 1;
-        }
-    }
-
-
-
-    // Choose the Random engine
-    //
-    //G4Random::setTheEngine(new CLHEP::RanecuEngine);
-
-    CLHEP::RanluxEngine defaultEngine( 1234567, 4 );
-    G4Random::setTheEngine( &defaultEngine );
-    G4int seed = time( NULL );
-    G4Random::setTheSeed( seed );
-
-    // Construct the default run manager
-    //
-#ifdef G4MULTITHREADED
-    G4MTRunManager * runManager = new G4MTRunManager;
-    runManager->SetNumberOfThreads(1);
-
-    /*
-     if ( nThreads > 0 ) {
-     runManager->SetNumberOfThreads(4);
-     }
-     */
-#else
-    G4RunManager * runManager = new G4RunManager;
-#endif
-
-    // Set mandatory initialization classes
-    //
-    DetectorConstruction* detConstruction = new DetectorConstruction();
-    runManager->SetUserInitialization(detConstruction);
-
-    /*
-    G4VModularPhysicsList* physicsList = new QGSP_BERT;
-    runManager->SetUserInitialization(physicsList);
-    */
-
-    ////////////////////////////////////////////////////////////////////
-    //      Initialising the Physics List with Radioactive Decay
-    ////////////////////////////////////////////////////////////////////
-
-    G4PhysListFactory factory;
-    G4VModularPhysicsList* phys = 0;
-    G4String physName = "QGSP_BERT";
-    // reference PhysicsList via its name
-    phys = factory.GetReferencePhysList(physName);
-    phys->RegisterPhysics(new G4RadioactiveDecayPhysics());
-    runManager->SetUserInitialization(phys);
-
-
-    ActionInitialization* actionInitialization
-    = new ActionInitialization(detConstruction);
-    runManager->SetUserInitialization(actionInitialization);
-
-    // Initialize G4 kernel
-    //
-    runManager->Initialize();
-
-#ifdef G4VIS_USE
-    // Initialize visualization
-    G4VisManager* visManager = new G4VisExecutive;
-    // G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
-    // G4VisManager* visManager = new G4VisExecutive("Quiet");
-    visManager->Initialize();
-#endif
-
-    // Get the pointer to the User Interface manager
-    G4UImanager* UImanager = G4UImanager::GetUIpointer();
-
-    if ( macro.size() ) {
-        // batch mode
-        G4String command = "/control/execute ";
-        UImanager->ApplyCommand(command+macro);
-    }
-    else  {
-        // interactive mode : define UI session
-#ifdef G4UI_USE
-        G4UIExecutive* ui = new G4UIExecutive(argc, argv, session);
-#ifdef G4VIS_USE
-        UImanager->ApplyCommand("/control/execute init_vis.mac");
-#else
-        UImanager->ApplyCommand("/control/execute init.mac");
-#endif
-        if (ui->IsGUI())
-            UImanager->ApplyCommand("/control/execute gui.mac");
-        ui->SessionStart();
-        delete ui;
-#endif
-    }
-
-    // Job termination
-    // Free the store: user actions, physics_list and detector_description are
-    // owned and deleted by the run manager, so they should not be deleted
-    // in the main() program !
-
-#ifdef G4VIS_USE
-    delete visManager;
-#endif
-    delete runManager;
-
-    return 0;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....


Cleanup some syntax in alc.cpp

Cleanup some syntax in alc.cpp

--- Alc/alc.cpp
+++ Alc/alc.cpp
@@ -4005,10 +4005,6 @@
  */
 ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
 {
-    const ALCchar *fmt;
-    ALCdevice *device;
-    ALCenum err;
-
     DO_INITCONFIG();

     if(!PlaybackBackend.name)
@@ -4029,7 +4025,7 @@
     ))
         deviceName = nullptr;

-    device = static_cast<ALCdevice*>(al_calloc(16, sizeof(ALCdevice)));
+    auto device = static_cast<ALCdevice*>(al_calloc(16, sizeof(ALCdevice)));
     if(!device)
     {
         alcSetError(nullptr, ALC_OUT_OF_MEMORY);
@@ -4054,9 +4050,10 @@
     device->AuxiliaryEffectSlotMax = 64;
     device->NumAuxSends = DEFAULT_SENDS;

+    const ALCchar *fmt{};
     if(ConfigValueStr(deviceName, nullptr, "channels", &fmt))
     {
-        static const struct {
+        static constexpr struct {
             const char name[16];
             enum DevFmtChannels chans;
             ALsizei order;
@@ -4089,7 +4086,7 @@
     }
     if(ConfigValueStr(deviceName, nullptr, "sample-type", &fmt))
     {
-        static const struct {
+        static constexpr struct {
             const char name[16];
             enum DevFmtType type;
         } typelist[] = {
@@ -4156,7 +4153,8 @@
     }

     // Find a playback device to open
-    if((err=V(device->Backend,open)(deviceName)) != ALC_NO_ERROR)
+    ALCenum err{V(device->Backend,open)(deviceName)};
+    if(err != ALC_NO_ERROR)
     {
         FreeDevice(device);
         alcSetError(nullptr, err);
@@ -4251,9 +4249,6 @@
  ************************************************/
 ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName, ALCuint frequency, ALCenum format, ALCsizei samples)
 {
-    ALCdevice *device = nullptr;
-    ALCenum err;
-
     DO_INITCONFIG();

     if(!CaptureBackend.name)
@@ -4271,7 +4266,7 @@
     if(deviceName && (!deviceName[0] || strcasecmp(deviceName, alcDefaultName) == 0 || strcasecmp(deviceName, "openal-soft") == 0))
         deviceName = nullptr;

-    device = static_cast<ALCdevice*>(al_calloc(16, sizeof(ALCdevice)));
+    auto device = static_cast<ALCdevice*>(al_calloc(16, sizeof(ALCdevice)));
     if(!device)
     {
         alcSetError(nullptr, ALC_OUT_OF_MEMORY);
@@ -4311,7 +4306,8 @@
         DevFmtChannelsString(device->FmtChans), DevFmtTypeString(device->FmtType),
         device->Frequency, device->UpdateSize, device->NumUpdates
     );
-    if((err=V(device->Backend,open)(deviceName)) != ALC_NO_ERROR)
+    ALCenum err{V(device->Backend,open)(deviceName)};
+    if(err != ALC_NO_ERROR)
     {
         FreeDevice(device);
         alcSetError(nullptr, err);
@@ -4448,7 +4444,7 @@
         return nullptr;
     }

-    ALCdevice *device{static_cast<ALCdevice*>(al_calloc(16, sizeof(ALCdevice)))};
+    auto device = static_cast<ALCdevice*>(al_calloc(16, sizeof(ALCdevice)));
     if(!device)
     {
         alcSetError(nullptr, ALC_OUT_OF_MEMORY);
@@ -4517,7 +4513,7 @@
  */
 ALC_API ALCboolean ALC_APIENTRY alcIsRenderFormatSupportedSOFT(ALCdevice *device, ALCsizei freq, ALCenum channels, ALCenum type)
 {
-    ALCboolean ret = ALC_FALSE;
+    ALCboolean ret{ALC_FALSE};

     if(!VerifyDevice(&device) || device->Type != Loopback)
         alcSetError(device, ALC_INVALID_DEVICE);
@@ -4621,7 +4617,7 @@
  */
 ALC_API const ALCchar* ALC_APIENTRY alcGetStringiSOFT(ALCdevice *device, ALCenum paramName, ALCsizei index)
 {
-    const ALCchar *str = nullptr;
+    const ALCchar *str{nullptr};

     if(!VerifyDevice(&device) || device->Type == Capture)
         alcSetError(device, ALC_INVALID_DEVICE);
@@ -4649,8 +4645,6 @@
  */
 ALC_API ALCboolean ALC_APIENTRY alcResetDeviceSOFT(ALCdevice *device, const ALCint *attribs)
 {
-    ALCenum err;
-
     std::unique_lock<std::recursive_mutex> listlock{ListLock};
     if(!VerifyDevice(&device) || device->Type == Capture ||
        !ATOMIC_LOAD(&device->Connected, almemory_order_relaxed))
@@ -4663,7 +4657,7 @@
     almtx_lock(&device->BackendLock);
     listlock.unlock();

-    err = UpdateDeviceParams(device, attribs);
+    ALCenum err{UpdateDeviceParams(device, attribs)};
     almtx_unlock(&device->BackendLock);

     if(err != ALC_NO_ERROR)


Fix applied scalars for B-Format source mixing

--- Alc/alu.cpp
+++ Alc/alu.cpp
@@ -694,16 +694,16 @@
              * matrix is transposed, for the inputs to align on the rows and
              * outputs on the columns.
              */
-            const ALfloat &scale0 = AmbiScale::FromFuMa[0];
-            const ALfloat &scale1 = AmbiScale::FromFuMa[1];
-            const ALfloat &scale2 = AmbiScale::FromFuMa[2];
-            const ALfloat &scale3 = AmbiScale::FromFuMa[3];
+            const ALfloat &wscale = AmbiScale::FromFuMa[0];
+            const ALfloat &yscale = AmbiScale::FromFuMa[1];
+            const ALfloat &zscale = AmbiScale::FromFuMa[2];
+            const ALfloat &xscale = AmbiScale::FromFuMa[3];
             const alu::Matrix matrix{
             //    ACN0          ACN1          ACN2          ACN3
-                scale0,         0.0f,         0.0f,         0.0f, // Ambi W
-                  0.0f, -N[0]*scale1,  N[1]*scale2, -N[2]*scale3, // Ambi X
-                  0.0f,  U[0]*scale1, -U[1]*scale2,  U[2]*scale3, // Ambi Y
-                  0.0f, -V[0]*scale1,  V[1]*scale2, -V[2]*scale3  // Ambi Z
+                wscale,         0.0f,         0.0f,         0.0f, // FuMa W
+                  0.0f, -N[0]*xscale,  N[1]*xscale, -N[2]*xscale, // FuMa X
+                  0.0f,  U[0]*yscale, -U[1]*yscale,  U[2]*yscale, // FuMa Y
+                  0.0f, -V[0]*zscale,  V[1]*zscale, -V[2]*zscale  // FuMa Z
             };

             voice->Direct.Buffer = Device->FOAOut.Buffer;


ファイル名取り出し

ファイル名取り出し

git-svn-id: 1b1825424466b5276ddcd9426f9a3cef7eaa5ac3@112 38616c85-8a89-495d-9829-d15a903298fa

--- C700GUI.cpp
+++ C700GUI.cpp
@@ -40,11 +40,11 @@
 	CFRelease(extlesspath);
 	CFRelease(url);
 #else
-	//TODO : Windowsł̊gqApX
+	//Windowsł̊gqApX
 	int	len = strlen(path);
 	int extPos = len;
 	int bcPos = 0;
-	for ( int i=len-1 i>=0; i-- ) {
+	for ( int i=len-1; i>=0; i-- ) {
 		if ( path[i] == '.' ) {
 			extPos = i;
 			break;
@@ -56,6 +56,7 @@
 		}
 	}
 	strncpy(out, path+bcPos, extPos-bcPos);
+	out[extPos-bcPos] = 0;
 #endif
 }


Add the code to actually create a Parrot interpreter. Doesn't compile yet because we haven't told cmake to compile against libparrot yet

--- Chimera.cpp
+++ Chimera.cpp
@@ -11,6 +11,7 @@

 #include "Chimera.h"
 #include "parrot/api.h"
+#include "stdio.h"

 ///////////////////////////////////////////////////////////////////////////////
 /// @fn Chimera::StaticInitialize()
@@ -23,6 +24,13 @@
 {
     // Place one-time initialization stuff here; As of FireBreath 1.4 this should only
     // be called once per process
+    Parrot_PMC interp = NULL;
+
+    if (!Parrot_api_make_interpreter(NULL, NULL, 0, &interp)) {
+        fprintf(stderr, "Cannot create Parrot interpreter!\n");
+    } else {
+        printf("Parrot interp created!\n");
+    }
 }

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


Oops, let's compare instead of assign.

Oops, let's compare instead of assign.

--- src/musikcube/cursespp/Window.cpp
+++ src/musikcube/cursespp/Window.cpp
@@ -819,7 +819,7 @@
 }

 void Window::Blur() {
-    if (::focused = this) {
+    if (::focused == this) {
         ::focused = nullptr;
         this->isDirty = true;
         this->OnFocusChanged(false);


MOD: use std::ostringstream to append numbers to log output

--HG--
branch : string-fixes

--- cegui/src/Font_xmlHandler.cpp
+++ cegui/src/Font_xmlHandler.cpp
@@ -41,6 +41,8 @@
 #   include "CEGUI/FreeTypeFont.h"
 #endif

+#include <sstream>
+
 // Start of CEGUI namespace section
 namespace CEGUI
 {
@@ -213,7 +215,10 @@
         throw InvalidRequestException(
         "The Fonts node was closed but the loading for the last font has not been completed.");

-    Logger::getSingleton().logEvent("Finished Fonts loading. Number of loaded fonts: " + d_loadedFonts.size(), Informative);
+    std::ostringstream stream;
+    stream << "Finished Fonts loading. Number of loaded fonts: " << d_loadedFonts.size();
+
+    Logger::getSingleton().logEvent(stream.str(), Informative);
 }

 void Font_xmlHandler::elementMappingStart(const XMLAttributes& attributes)


Moved timer reset

Moved timer reset

--- VajraFramework/ExampleGame/Code/ExampleGame/Ui/MenuManager/MenuManager.cpp
+++ VajraFramework/ExampleGame/Code/ExampleGame/Ui/MenuManager/MenuManager.cpp
@@ -54,8 +54,6 @@
 		SINGLETONS->GetMenuManager()->loadScreen->SetSpriteColor(loadScreenColor);
 		if(currentNumber == toNumber) {
 			SINGLETONS->GetMenuManager()->loadScreen->SetVisible(false);
-			SINGLETONS->GetMenuManager()->UpdateTimer(0);
-			SINGLETONS->GetMenuManager()->UpdateLoot(0);
 		}
 	} else if (tweenClipName == "updatePreMenu") {
 		SINGLETONS->GetMenuManager()->updatePreMenu(userParams->i);
@@ -317,6 +315,8 @@
 		startButton->GetTransform()->SetPositionWorld(halfScreenWidth - startButton->GetWidth() / 2.0f, startPos.y, startPos.z);
 		ENGINE->GetTween()->TweenToNumber(1.0f, 0.0f, 1.5f, INTERPOLATION_TYPE_LINEAR, true, false, true, "loadScreenFadeOut", NUMBER_TWEEN_AFFILIATION_SCENEGRAPH_Ui, nullptr, menuManagerNumberTweenCallback);

+		SINGLETONS->GetMenuManager()->UpdateTimer(0);
+		SINGLETONS->GetMenuManager()->UpdateLoot(0);
 		//ENGINE->GetTween()->TweenToNumber(0.0f, 0.1f, .2f, INTERPOLATION_TYPE_LINEAR, true, false, true, "delayPreMenuOpen", NUMBER_TWEEN_AFFILIATION_SCENEGRAPH_Ui, NULL, menuManagerNumberTweenCallback);
 	}
 }


Day 23 part two

Day 23 part two

--- 2016/Day23/Day23.cpp
+++ 2016/Day23/Day23.cpp
@@ -92,6 +92,8 @@
 			break;
 		case OpCode::Toggle:
 			{
+				State.Print();
+				std::cout << std::endl;
 				size_t Instruction = State.IP + (RefFetch ? RefFetch(State) : Arg1(State));
 				if (Instruction < Instructions.size())
 				{
@@ -182,16 +184,20 @@

 InstructionVector ParseAssembly(const StringVectorVector & Lines);
-Registers Run(InstructionVector & Instructions, Registers InitialState = Registers());
+Registers Run(InstructionVector Instructions, Registers InitialState = Registers());

 int main()
 {
 	StringVectorVector Lines = GetFileLineParts("Input.txt");
 	InstructionVector Instructions = ParseAssembly(Lines);

+	// A = 7! + 81 * 73
 	Registers PartOne = Run(Instructions, { 7, 0, 0, 0, 0 });
-
-	std::cout << "A: " << PartOne.A << std::endl;
+	std::cout << "Part One: " << PartOne.A << std::endl;
+
+	// A = 12! + 81 * 73
+	Registers PartTwo = Run(Instructions, { 12, 0, 0, 0, 0 });
+	std::cout << "Part Two: " << PartTwo.A << std::endl;

 	system("pause");

@@ -229,7 +235,7 @@
 	getchar();
 }

-Registers Run(InstructionVector & Instructions, Registers InitialState)
+Registers Run(InstructionVector Instructions, Registers InitialState)
 {
 	Registers & State = InitialState;

@@ -317,4 +323,37 @@
 	{
 		return Instruction(OpCode::Toggle, GetFetchValueFunction(Line[1]));
 	}
-}+}
+
+
+
+/*
+
+cpy a b
+dec b
+cpy a d
+cpy 0 a
+cpy b c
+inc a
+dec c
+jnz c -2
+dec d
+jnz d -5
+dec b
+cpy b c
+cpy c d
+dec d
+inc c
+jnz d -2
+tgl c
+cpy -16 c
+jnz 1 c
+cpy 81 c
+jnz 73 d
+inc a
+inc d
+jnz d -2
+inc c
+jnz c -5
+
+*/


Implement v2 eject OSD

Implement v2 eject OSD

--- 3RVX/Skin/SkinV2.cpp
+++ 3RVX/Skin/SkinV2.cpp
@@ -85,7 +85,10 @@
 }

 OSDComponent *SkinV2::EjectOSD() {
-    return nullptr;
+    OSDComponent *eject = new OSDComponent;
+    eject->background = LoadImg(_skinDir + L"\\OSD\\eject.png");
+    eject->mask = LoadImg(_skinDir + L"\\OSD\\glassMask.png");
+    return eject;
 }

 std::vector<HICON> SkinV2::VolumeIconset() {


Only load resources for renderer, extension, and zygote processes
(and plugins processes on Windows).

We used to always try to load them, even if we didn't use them.  It would
work fine if an update happened (because we didn't use them) and the files
were replaced.

Review URL: http://codereview.chromium.org/487001

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

--- chrome/app/chrome_dll_main.cc
+++ chrome/app/chrome_dll_main.cc
@@ -32,6 +32,7 @@
 #endif

 #include "app/app_paths.h"
+#include "app/app_switches.h"
 #include "app/resource_bundle.h"
 #include "base/at_exit.h"
 #include "base/command_line.h"
@@ -329,11 +330,6 @@
 }

 void CommonSubprocessInit() {
-  // Initialize ResourceBundle which handles files loaded from external
-  // sources.  The language should have been passed in to us from the
-  // browser process as a command line flag.
-  ResourceBundle::InitSharedInstance(std::wstring());
-
 #if defined(OS_WIN)
   // HACK: Let Windows know that we have started.  This is needed to suppress
   // the IDC_APPSTARTING cursor from being displayed for a prolonged period
@@ -342,6 +338,22 @@
   MSG msg;
   PeekMessage(&msg, NULL, 0, 0, PM_REMOVE);
 #endif
+}
+
+// Returns true if this subprocess type needs the ResourceBundle initialized
+// and resources loaded.
+bool SubprocessNeedsResourceBundle(const std::string& process_type) {
+  return
+#if defined(OS_WIN)
+      // Windows needs resources for the default/null plugin.
+      process_type == switches::kPluginProcess ||
+#endif
+#if defined(OS_LINUX)
+      // The zygote process opens the resources for the renderers.
+      process_type == switches::kZygoteProcess ||
+#endif
+      process_type == switches::kRendererProcess ||
+      process_type == switches::kExtensionProcess;
 }

 }  // namespace
@@ -611,10 +623,19 @@
   }
 #endif  // NDEBUG

+  if (SubprocessNeedsResourceBundle(process_type)) {
+    // Initialize ResourceBundle which handles files loaded from external
+    // sources.  The language should have been passed in to us from the
+    // browser process as a command line flag.
+    DCHECK(parsed_command_line.HasSwitch(switches::kLang) ||
+           process_type == switches::kZygoteProcess);
+    ResourceBundle::InitSharedInstance(std::wstring());
+  }
+
   if (!process_type.empty())
     CommonSubprocessInit();

-#if defined (OS_MACOSX)
+#if defined(OS_MACOSX)
   // On OS X the renderer sandbox needs to be initialized later in the startup
   // sequence in RendererMainPlatformDelegate::PlatformInitialize().
   if (process_type != switches::kRendererProcess &&
@@ -651,7 +672,7 @@
   } else if (process_type == switches::kUtilityProcess) {
     rv = UtilityMain(main_params);
   } else if (process_type == switches::kProfileImportProcess) {
-#if defined (OS_MACOSX)
+#if defined(OS_MACOSX)
     rv = ProfileImportMain(main_params);
 #else
     // TODO(port): Use OOP profile import - http://crbug.com/22142 .
@@ -727,9 +748,8 @@
     NOTREACHED() << "Unknown process type";
   }

-  if (!process_type.empty()) {
+  if (SubprocessNeedsResourceBundle(process_type))
     ResourceBundle::CleanupSharedInstance();
-  }

 #if defined(OS_WIN)
 #ifdef _CRTDBG_MAP_ALLOC


Remove disable-gpu-vsync about:flags entry

This entry completely breaks Chrome and has for a while.

BUG=303293
R=jbauman@chromium.org

Review URL: https://codereview.chromium.org/25814003

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

--- chrome/browser/about_flags.cc
+++ chrome/browser/about_flags.cc
@@ -446,13 +446,6 @@
     SINGLE_VALUE_TYPE(switches::kEnableAcceleratedFilters)
   },
   {
-    "disable-gpu-vsync",
-    IDS_FLAGS_DISABLE_GPU_VSYNC_NAME,
-    IDS_FLAGS_DISABLE_GPU_VSYNC_DESCRIPTION,
-    kOsDesktop,
-    SINGLE_VALUE_TYPE(switches::kDisableGpuVsync)
-  },
-  {
     "disable-webgl",
     IDS_FLAGS_DISABLE_WEBGL_NAME,
     IDS_FLAGS_DISABLE_WEBGL_DESCRIPTION,


Fix a leak in the view unit tests.

Fix a leak in the view unit tests.

Review URL: http://codereview.chromium.org/3115

git-svn-id: http://src.chromium.org/svn/trunk/src@2328 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: c9783a0b5f48b5b0ee015bade36649085370a372

--- chrome/views/view_unittest.cc
+++ chrome/views/view_unittest.cc
@@ -548,8 +548,8 @@
 }

 TEST_F(ViewTest, HitTestMasks) {
-  ChromeViews::HWNDViewContainer* window = new ChromeViews::HWNDViewContainer;
-  ChromeViews::RootView* root_view = window->GetRootView();
+  ChromeViews::HWNDViewContainer window;
+  ChromeViews::RootView* root_view = window.GetRootView();
   root_view->SetBounds(0, 0, 500, 500);

   gfx::Rect v1_bounds = gfx::Rect(0, 0, 100, 100);


Modification to get Energia compatibility

--- Adafruit_SSD1306.cpp
+++ Adafruit_SSD1306.cpp
@@ -17,7 +17,7 @@
 *********************************************************************/

 #include <avr/pgmspace.h>
-#ifndef __SAM3X8E__
+#if !defined(__SAM3X8E__) &&  !defined(ENERGIA)
  #include <util/delay.h>
 #endif
 #include <stdlib.h>
@@ -181,7 +181,7 @@
       }
     if (hwSPI){
       SPI.begin ();
-#ifdef __SAM3X8E__
+#if !defined(__SAM3X8E__) &&  !defined(ENERGIA)
       SPI.setClockDivider (9); // 9.3 MHz
 #else
       SPI.setClockDivider (SPI_CLOCK_DIV2); // 8 MHz
@@ -192,7 +192,7 @@
   {
     // I2C Init
     Wire.begin();
-#ifdef __SAM3X8E__
+#if !defined(__SAM3X8E__) &&  !defined(ENERGIA)
     // Force 400 KHz I2C, rawr! (Uses pins 20, 21 for SDA, SCL)
     TWI1->TWI_CWGR = 0;
     TWI1->TWI_CWGR = ((VARIANT_MCK / (2 * 400000)) - 4) * 0x101;
@@ -506,7 +506,7 @@
   else
   {
     // save I2C bitrate
-#ifndef __SAM3X8E__
+#if !defined(__SAM3X8E__) &&  !defined(ENERGIA)
     uint8_t twbrbackup = TWBR;
     TWBR = 12; // upgrade to 400KHz!
 #endif
@@ -526,7 +526,7 @@
       i--;
       Wire.endTransmission();
     }
-#ifndef __SAM3X8E__
+#if !defined(__SAM3X8E__) &&  !defined(ENERGIA)
     TWBR = twbrbackup;
 #endif
   }


Update Vector.cpp

Update Vector.cpp

--- Apoc/Math/Vector.cpp
+++ Apoc/Math/Vector.cpp
@@ -25,6 +25,7 @@
 */

 #include <Apoc/Math/Vector.h>
+#include <math.h>

 Vector::Vector()
 {
@@ -182,6 +183,16 @@
 	return out;
 };

+Vector Vector::normalize()
+{
+	return (*this) * (1.0/length());
+};
+
+float Vector::length()
+{
+	return sqrt(x()*x()/w() + y()*y()/w() + z()*z()/w());
+};
+
 ostream& operator<<(ostream &os, Vector vec)
 {
 	os << "(" << vec.x() << ", " << vec.y() << ", " << vec.z() << ", " << vec.w() << ")";


From Jean-Sebastien Guay, "
The problem can be reproduced by simply changing the osgpick example to
use a CompositeViewer with a single view initialized using
setUpViewAcrossAllScreens(). I have attached a modified osgpick.cpp so
you can test it out quickly (please don't check this file in though :-)
) The eventState is then incorrect and picking does not work. The only
changes are in CompositeViewer.cpp (eventTraversal() method), and fix
the problem for me.
"

git-svn-id: 23b6355f2bb369032457de4eb5f713ee134f73a8@7915 16af8721-9629-0410-8352-f15c8da7e697

--- src/osgViewer/CompositeViewer.cpp
+++ src/osgViewer/CompositeViewer.cpp
@@ -658,10 +658,18 @@
                                     {
                                         setCameraWithFocus(camera);

-                                        const osg::GraphicsContext::Traits* traits = gw ? gw->getTraits() : 0;
-                                        if (traits)
+                                        // If this camera is not a slave camera
+                                        if (camera->getView()->getCamera() == camera)
                                         {
-                                            eventState->setInputRange( 0, 0, traits->width, traits->height);
+                                            const osg::GraphicsContext::Traits* traits = gw ? gw->getTraits() : 0;
+                                            if (traits)
+                                            {
+                                                eventState->setInputRange( 0, 0, traits->width, traits->height);
+                                            }
+                                            else
+                                            {
+                                                eventState->setInputRange(-1.0, -1.0, 1.0, 1.0);
+                                            }
                                         }
                                         else
                                         {


Fix bug in TIPS4

Fix bug in TIPS4

--- src/phase_field/PFTypes/TIPS4.cpp
+++ src/phase_field/PFTypes/TIPS4.cpp
@@ -119,7 +119,7 @@
                 // mobility...
                 double Mc = 1.0;
                 if (cc > 0.1) Mc = 0.018/(pow(cc,1.75));
-                mob.setValue(ndx,Mc);
+                mob.setValue(ndx,Mc);
             }
         }
     }
@@ -129,6 +129,7 @@
     // ---------------------------------------

     mu.updateBoundaryConditions();
+    mob.updateBoundaryConditions();
     MPI::COMM_WORLD.Barrier();

     //c += p.dt*M*mu.Laplacian();


mergfe

mergfe

--- src/pks/flow/richards/richards.cc
+++ src/pks/flow/richards/richards.cc
@@ -558,7 +558,7 @@
                      - ponded_depth("cell",c) * surface_cell_volume("cell",c) / dt)
           * dens("cell",cells[0]); // residual mismatch, plus water available on surface

-      if (q_out >= 0.) {
+      if (q_out >= 0. || Q_ss >= 0.) {
         // Flux is outward, use the Dirichlet condition and the calculated flux
         bc_markers_[f] = Operators::MFD_BC_DIRICHLET;
         bc_values_[f] = pres("face",f);
@@ -568,7 +568,9 @@
           // Flux wants to be inward and the subsurface
           // can accomodate all water on the surface.
           bc_markers_[f] = Operators::MFD_BC_FLUX;
-          bc_values_[f] = Q_ss / surface_cell_volume("cell",c);
+
+          // note these are NOT the same necessarily!
+          bc_values_[f] = Q_ss / mesh_->face_area(f); //surface_cell_volume("cell",c);
           (*source)("cell",c) = Q_ss / dens("cell",cells[0]);
         } else {
           // Flux wants to be inward, but the subsurface cannot handle the
@@ -579,17 +581,18 @@
         }
       }

-      /*
+
       //      if (out_.get() && includesVerbLevel(verbosity_, Teuchos::VERB_HIGH, true)) {

-        if (ponded_depth("cell",c) < 0) {
-          AmanziGeometry::Point c_surf_point = surface->cell_centroid(c);
-          AmanziGeometry::Point f_point = mesh_->face_centroid(f);
-          AmanziGeometry::Point c_sub_point = mesh_->cell_centroid(cells[0]);
+      if (bc_markers_[f] == Operators::MFD_BC_DIRICHLET) {
+          //          AmanziGeometry::Point c_surf_point = surface->cell_centroid(c);
+          //          AmanziGeometry::Point f_point = mesh_->face_centroid(f);
+          //          AmanziGeometry::Point c_sub_point = mesh_->cell_centroid(cells[0]);

           Teuchos::OSTab tab = getOSTab();
           std::cout<< "SURFACE BC: c_surf: " << c << " f: " << f << " c_sub: " << cells[0] << std::endl;
-          std::cout<< "    c_surf: " << c_surf_point << "    f: " << f_point << "    c_sub: " << c_sub_point << std::endl;
+          std::cout<< "   sizes:  cell_area: " << surface_cell_volume("cell",c) << "  face area: " << mesh_->face_area(f) << std::endl;
+          //          std::cout<< "    c_surf: " << c_surf_point << "    f: " << f_point << "    c_sub: " << c_sub_point << std::endl;
           std::cout<< "            p = " << pres("cell",cells[0]) << " p_eff = " << pres("face",f) << std::endl;
           std::cout<< "            h = " << ponded_depth("cell",c) << ", q_out = " << q_out << ", Q_ss = " << Q_ss << std::endl;
           if (bc_markers_[f] == Operators::MFD_BC_FLUX) {
@@ -599,7 +602,6 @@
           }
         }
         // }
-        */
     }
   }


updated to match MaterialElement changes

--- SimModule/Scene.cpp
+++ SimModule/Scene.cpp
@@ -58,9 +58,15 @@

 //Modifier
-void Scene::addExternalAction(Vect F, unsigned int place) // add force to element i
+
+void Scene::addExternalAction(unsigned int place, Vect F, Torsor T)	// adds force to element i starting from 0
 {
-	S[place]->addExternalAction(F);
+	S[place]->addExternalAction(F, T);
+}
+
+void Scene::addExternalAction(unsigned int place, Torsor T)
+{
+	addExternalAction(place, Vect(0, 0, 0), T);
 }

 void Scene::update(double dt)
@@ -91,13 +97,21 @@
 	S.push_back(Mp);
 }

-void Scene::addMatPoint(double x, double y, double z, double mass, double charge)
+void Scene::addMatPoint(Point p, Vect velocity, double mass, double charge_)
 {
-	MaterialPoint *Mp = new MaterialPoint;
-	Mp->place(x, y, z);
-	Mp->setMass(mass);
-	Mp->setCharge(charge);
-	Mp->setMass(mass);
-	Mp->place(x, y, z);
+	MaterialElement *Mp = new MaterialPoint(p, velocity, mass, charge_);
 	S.push_back(Mp);
 }
+
+
+void Scene::addSolid()
+{
+	Solid *Sol = new Solid;
+	S.push_back(Sol);
+}
+
+void Scene::addSolid(Point p, Vect velocity, double mass, double charge_)
+{
+	Solid *Sol = new Solid(p, velocity, mass, charge_);
+	S.push_back(Sol);
+}


be more careful when selecting fingers looking for updates

svn path=/trunk/libavg/; revision=2007

--- src/player/TrackerEventSource.cpp
+++ src/player/TrackerEventSource.cpp
@@ -408,8 +408,10 @@
                 pBitmap);
         }
         for(EventMap::iterator it=m_Events.begin();it!=m_Events.end();++it){
-            (*it).second->m_Stale = true;
-            old_fingers->push_back((*it).first);
+            if (it->second->m_State != EventStream::UP_DELIVERED ||it->second->m_State != EventStream::UP_PENDING) {
+                (*it).second->m_Stale = true;
+                old_fingers->push_back((*it).first);
+            }
         }
         int known_counter=0, new_counter=0, ignored_counter=0;
         // 2. For each old_blob choose the best match of an new blob and update its event stream accordingly


Update Skia's handling of vertical text when freetype metrics are available.

This is a cherry-pick of a larger change going into upstream Skia at...
https://codereview.appspot.com/6554064/

bug: 7124435
Change-Id: Id8b030afaf493741e133b592a4e08a3fd90ec2f3

--- src/ports/SkFontHost_FreeType.cpp
+++ src/ports/SkFontHost_FreeType.cpp
@@ -176,6 +176,7 @@
     FT_Matrix   fMatrix22;
     uint32_t    fLoadGlyphFlags;
     bool        fDoLinearMetrics;
+    bool        fUseVertMetrics;

     FT_Error setupSize();
     void emboldenOutline(FT_Outline* outline);
@@ -786,6 +787,7 @@
     fScaleY = SkScalarToFixed(sy);

     // compute the flags we send to Load_Glyph
+    fUseVertMetrics = false;
     {
         FT_Int32 loadFlags = FT_LOAD_DEFAULT;
         bool linearMetrics = SkToBool(fRec.fFlags & SkScalerContext::kSubpixelPositioning_Flag);
@@ -841,6 +843,12 @@
         // See http://code.google.com/p/skia/issues/detail?id=222.
         loadFlags |= FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;

+        // Use vertical layout if requested and supported.
+        if ((fRec.fFlags & SkScalerContext::kVertical_Flag) && FT_HAS_VERTICAL(fFace)) {
+            loadFlags |= FT_LOAD_VERTICAL_LAYOUT;
+            fUseVertMetrics = true;
+        }
+
         fLoadGlyphFlags = loadFlags;
         fDoLinearMetrics = linearMetrics;
     }
@@ -1010,6 +1018,20 @@
         bbox->xMax  = (bbox->xMax + 63) & ~63;
         bbox->yMax  = (bbox->yMax + 63) & ~63;
     }
+
+    // Must come after snapToPixelBoundary so that the width and height are
+    // consistent. Otherwise asserts will fire later on when generating the
+    // glyph image.
+    if (fUseVertMetrics) {
+        FT_Vector vector;
+        vector.x = fFace->glyph->metrics.vertBearingX - fFace->glyph->metrics.horiBearingX;
+        vector.y = -fFace->glyph->metrics.vertBearingY - fFace->glyph->metrics.horiBearingY;
+        FT_Vector_Transform(&vector, &fMatrix22);
+        bbox->xMin += vector.x;
+        bbox->xMax += vector.x;
+        bbox->yMin += vector.y;
+        bbox->yMax += vector.y;
+    }
 }

 void SkScalerContext_FreeType::updateGlyphIfLCD(SkGlyph* glyph) {
@@ -1080,6 +1102,16 @@
             FT_GlyphSlot_Own_Bitmap(fFace->glyph);
             FT_Bitmap_Embolden(gFTLibrary, &fFace->glyph->bitmap, kBitmapEmboldenStrength, 0);
         }
+
+        if (fUseVertMetrics) {
+            FT_Vector vector;
+            vector.x = fFace->glyph->metrics.vertBearingX - fFace->glyph->metrics.horiBearingX;
+            vector.y = -fFace->glyph->metrics.vertBearingY - fFace->glyph->metrics.horiBearingY;
+            FT_Vector_Transform(&vector, &fMatrix22);
+            fFace->glyph->bitmap_left += SkFDot6Floor(vector.x);
+            fFace->glyph->bitmap_top  += SkFDot6Floor(vector.y);
+        }
+
         glyph->fWidth   = SkToU16(fFace->glyph->bitmap.width);
         glyph->fHeight  = SkToU16(fFace->glyph->bitmap.rows);
         glyph->fTop     = -SkToS16(fFace->glyph->bitmap_top);
@@ -1104,8 +1136,17 @@
         }
     }

-    if ((fRec.fFlags & SkScalerContext::kVertical_Flag)
-            && fFace->glyph->format == FT_GLYPH_FORMAT_OUTLINE) {
+    if (fUseVertMetrics) {
+        if (fDoLinearMetrics) {
+            glyph->fAdvanceX = -SkFixedMul(fMatrix22.xy, fFace->glyph->linearVertAdvance);
+            glyph->fAdvanceY = SkFixedMul(fMatrix22.yy, fFace->glyph->linearVertAdvance);
+        } else {
+            glyph->fAdvanceX = -SkFDot6ToFixed(fFace->glyph->advance.x);
+            glyph->fAdvanceY = SkFDot6ToFixed(fFace->glyph->advance.y);
+        }
+
+    } else if ((fRec.fFlags & SkScalerContext::kVertical_Flag)
+                && fFace->glyph->format == FT_GLYPH_FORMAT_OUTLINE) {

         //TODO: do we need to specially handle SubpixelPositioning and Kerning?

@@ -1568,6 +1609,14 @@
         emboldenOutline(&fFace->glyph->outline);
     }

+    if (fUseVertMetrics) {
+        FT_Vector vector;
+        vector.x = fFace->glyph->metrics.vertBearingX - fFace->glyph->metrics.horiBearingX;
+        vector.y = -fFace->glyph->metrics.vertBearingY - fFace->glyph->metrics.horiBearingY;
+        FT_Vector_Transform(&vector, &fMatrix22);
+        FT_Outline_Translate(&fFace->glyph->outline, vector.x, vector.y);
+    }
+
     FT_Outline_Funcs    funcs;

     funcs.move_to   = move_proc;


only call FT_Get_Advance if we really want linear metrics

git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@2721 2bbb7eff-a529-9590-31e7-b0007b416f81

--- src/ports/SkFontHost_FreeType.cpp
+++ src/ports/SkFontHost_FreeType.cpp
@@ -150,6 +150,7 @@
     SkFixed     fScaleX, fScaleY;
     FT_Matrix   fMatrix22;
     uint32_t    fLoadGlyphFlags;
+    bool        fDoLinearMetrics;

     FT_Error setupSize();
     void emboldenOutline(FT_Outline* outline);
@@ -720,20 +721,24 @@
     // compute the flags we send to Load_Glyph
     {
         FT_Int32 loadFlags = FT_LOAD_DEFAULT;
+        bool linearMetrics = false;

         if (SkMask::kBW_Format == fRec.fMaskFormat) {
             // See http://code.google.com/p/chromium/issues/detail?id=43252#c24
             loadFlags = FT_LOAD_TARGET_MONO;
             if (fRec.getHinting() == SkPaint::kNo_Hinting) {
                 loadFlags = FT_LOAD_NO_HINTING;
+                linearMetrics = true;
             }
         } else {
             switch (fRec.getHinting()) {
             case SkPaint::kNo_Hinting:
                 loadFlags = FT_LOAD_NO_HINTING;
+                linearMetrics = true;
                 break;
             case SkPaint::kSlight_Hinting:
                 loadFlags = FT_LOAD_TARGET_LIGHT;  // This implies FORCE_AUTOHINT
+                linearMetrics = true;
                 break;
             case SkPaint::kNormal_Hinting:
                 if (fRec.fFlags & SkScalerContext::kAutohinting_Flag)
@@ -771,6 +776,7 @@
         loadFlags |= FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;

         fLoadGlyphFlags = loadFlags;
+        fDoLinearMetrics = linearMetrics;
     }

     // now create the FT_Size
@@ -898,7 +904,7 @@
    /* unhinted and light hinted text have linearly scaled advances
     * which are very cheap to compute with some font formats...
     */
-    {
+    if (fDoLinearMetrics) {
         SkAutoMutexAcquire  ac(gFTMutex);

         if (this->setupSize()) {


Fixed build.

Fixed build.

--- examples/36-sky/sky.cpp
+++ examples/36-sky/sky.cpp
@@ -504,10 +504,10 @@
 			return 0;
 		}

-		void imgui(uint32_t _width)
+		void imgui(float _width)
 		{
 			ImGui::Begin("ProceduralSky");
-			ImGui::SetWindowSize(ImVec2(float(_width), 200.0f) );
+			ImGui::SetWindowSize(ImVec2(_width, 200.0f) );
 			ImGui::SliderFloat("Time scale", &m_timeScale, 0.0f, 1.0f);
 			ImGui::SliderFloat("Time", &m_time, 0.0f, 24.0f);
 			ImGui::SliderFloat("Latitude", &m_sun.m_latitude, -90.0f, 90.0f);


Backout Force Diffing algorithm to insert views Bottom Up

Summary: This is a temporary backout of D14817454, to verify if this is related T45503571

Reviewed By: JoshuaGross

Differential Revision: D15780018

fbshipit-source-id: 455034ce7b7096101db93a8604b77e1233db1137

--- ReactCommon/fabric/mounting/Differentiator.cpp
+++ ReactCommon/fabric/mounting/Differentiator.cpp
@@ -284,12 +284,12 @@
       createMutations.end(),
       std::back_inserter(mutations));
   std::move(
+      insertMutations.begin(),
+      insertMutations.end(),
+      std::back_inserter(mutations));
+  std::move(
       downwardMutations.begin(),
       downwardMutations.end(),
-      std::back_inserter(mutations));
-  std::move(
-      insertMutations.begin(),
-      insertMutations.end(),
       std::back_inserter(mutations));
 }


Use linear metrics with new FreeType light autohint.

Starting in FreeType 2.8 the light hinting setting only hints in the y
direction and can be used with linear metrics and subpixel positioning.

Change-Id: I6e478a904001216ade7f319fe98aa863ac6bd672
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211105
Auto-Submit: Ben Wagner <53965154ffeecc4a10886eab9259e95965f2979a@google.com>
Reviewed-by: Herb Derby <9e12a3d2bbf73546e47cc9958f6ba8f3215b7eaf@google.com>
Commit-Queue: Ben Wagner <53965154ffeecc4a10886eab9259e95965f2979a@google.com>

--- src/ports/SkFontHost_FreeType.cpp
+++ src/ports/SkFontHost_FreeType.cpp
@@ -129,6 +129,7 @@
         , fGetVarAxisFlags(nullptr)
         , fLibrary(nullptr)
         , fIsLCDSupported(false)
+        , fLightHintingIsYOnly(false)
         , fLCDExtra(0)
     {
         if (FT_New_Library(&gFTMemory, &fLibrary)) {
@@ -176,6 +177,16 @@
         }
 #endif

+// The 'light' hinting is vertical only starting in 2.8.0.
+#if SK_FREETYPE_MINIMUM_RUNTIME_VERSION >= 0x02080000
+        fLightHintingIsYOnly = true;
+#else
+        if (major > 2 || ((major == 2 && minor > 8) || (major == 2 && minor == 8 && patch >= 0))) {
+            fLightHintingIsYOnly = true;
+        }
+#endif
+
+
 #if SK_FREETYPE_MINIMUM_RUNTIME_VERSION >= 0x02080100
         fGetVarAxisFlags = FT_Get_Var_Axis_Flags;
 #elif SK_FREETYPE_MINIMUM_RUNTIME_VERSION & SK_FREETYPE_DLOPEN
@@ -205,6 +216,7 @@
     FT_Library library() { return fLibrary; }
     bool isLCDSupported() { return fIsLCDSupported; }
     int lcdExtra() { return fLCDExtra; }
+    bool lightHintingIsYOnly() { return fLightHintingIsYOnly; }

     // FT_Get_{MM,Var}_{Blend,Design}_Coordinates were added in FreeType 2.7.1.
     // Prior to this there was no way to get the coordinates out of the FT_Face.
@@ -222,6 +234,7 @@
 private:
     FT_Library fLibrary;
     bool fIsLCDSupported;
+    bool fLightHintingIsYOnly;
     int fLCDExtra;

     // FT_Library_SetLcdFilterWeights was introduced in FreeType 2.4.0.
@@ -864,6 +877,9 @@
                 break;
             case kSlight_SkFontHinting:
                 loadFlags = FT_LOAD_TARGET_LIGHT;  // This implies FORCE_AUTOHINT
+                if (gFTLibrary->lightHintingIsYOnly()) {
+                    linearMetrics = true;
+                }
                 break;
             case kNormal_SkFontHinting:
                 loadFlags = FT_LOAD_TARGET_NORMAL;


WaE: case value not in enumerated type 'NSEventSubtype'

Change-Id: Iaf5de07b7f0da7294681b9cdc152575a756a73c7

--- vcl/osx/salinst.cxx
+++ vcl/osx/salinst.cxx
@@ -445,7 +445,8 @@

 void AquaSalInstance::handleAppDefinedEvent( NSEvent* pEvent )
 {
-    switch( [pEvent subtype] )
+    int nSubtype = [pEvent subtype];
+    switch( nSubtype )
     {
     case AppStartTimerEvent:
         AquaSalTimer::handleStartTimerEvent( pEvent );


Patch 3403816: use size_type instead of unsigned int to correct comparison errors on 64 bit systems

--HG--
branch : v1-8
extra : rebase_source : 666f36b74163d086ba83e884820fbc6e14663d70

--- RenderSystems/GL/src/nvparse/ps1.0_program.cpp
+++ RenderSystems/GL/src/nvparse/ps1.0_program.cpp
@@ -464,7 +464,7 @@
             alphaComp = GL_ALPHA;
 			map = GL_SIGNED_IDENTITY_NV;

-			unsigned int offset;
+			string::size_type offset;
 			if(
                 (offset = s.find(".a")) != string::npos ||
                 (offset = s.find(".w")) != string::npos
@@ -571,7 +571,7 @@
               instr_base = 1;
             }
 			op = instr[instr_base];
-			unsigned int offset;
+			string::size_type offset;
 			if((offset = op.find("_x2")) != string::npos)
 			{
 				scale = GL_SCALE_BY_TWO_NV;


PROTON-1400: [C++ example] Use multiple threads in broker example if available

--- examples/cpp/broker.cpp
+++ examples/cpp/broker.cpp
@@ -44,10 +44,18 @@
 #include <map>
 #include <string>

+#if PN_CPP_SUPPORTS_THREADS
+#include <thread>
+#endif
+
 #include "fake_cpp11.hpp"

 // This is a simplified model for a message broker, that only allows for messages to go to a
 // single receiver.
+//
+// This broker is multithread safe and if compiled with C++11 with a multithreaded Proton
+// binding library will use as many threads as there are thread resources available (usually
+// cores)
 //
 // Queues are only created and never destroyed
 //
@@ -387,7 +395,12 @@
     }

     void run() {
-        container_.run(/* std::thread::hardware_concurrency() */);
+#if PN_CPP_SUPPORTS_THREADS
+        std::cout << "starting " << std::thread::hardware_concurrency() << " listening threads\n";
+        container_.run(std::thread::hardware_concurrency());
+#else
+        container_.run();
+#endif
     }

   private:


vector example expansion

vector example expansion

--- examples/cpp/vector.cpp
+++ examples/cpp/vector.cpp
@@ -79,8 +79,10 @@

 	v2.insert(v2.begin(), -1); //insert an element - you need an iterator
 	v2.emplace(v2.end(), int(1000)); //construct and place an element at the iterator
-	v2.push_back(0); //adds element to end
-	v2.emplace_back(int(10)); //constructs an element in place at the end
+
+	int x = 10;
+	v2.push_back(x); //adds element to end
+	v2.emplace_back(10); //constructs an element in place at the end

 	std::cout << std::endl << "v2: " << std::endl;
 	for (const auto & t : v2)
@@ -114,5 +116,7 @@
 	}
 	std::cout << std::endl;

+	std::cout << "std::vector size: " << sizeof(std::vector<char>) << std::endl;
+
 	return 0;
 }


removed a cout

removed a cout

--- FEM/FEMImageRegLMEx.cxx
+++ FEM/FEMImageRegLMEx.cxx
@@ -224,7 +224,7 @@

       for (unsigned int ii=0; ii < ImageDimension; ii++)
       {
-        tindex[ii]+=(long int)(disp[ii]+0.5);
+        tindex[ii]+=(long int)(disp[ii]);  //+0.5);
         if (tindex[ii] >=0 && tindex[ii] < m_FieldSize[ii]) InImage=true;
           else
           {
@@ -297,7 +297,7 @@
   vnl_vector<double> ElementsPerDimension;  ElementsPerDimension.resize(ImageDimension);
   for (unsigned int i=0; i<ImageDimension; i++)
   {
-    MeshSize[i]=(double)m_Nx-1; // FIX ME make more general
+    MeshSize[i]=(double)m_Nx-1; // FIX ME  make more general
     MeshOrigin[i]=(double)0.0;// FIX ME make more general
     ElementsPerDimension[i]=(double)m_MeshResolution;
   }
@@ -496,8 +496,6 @@
         rindex[ii]=(long int) (Gpt[ii]+0.5);
         disp[ii] =(Float) 1.*Sol[ii];
       }
-
-      std::cout << rindex << std::endl;
       m_Field->SetPixel(rindex, disp );
     }
   }


remove duped function

remove duped function

--- Code/GraphMol/Descriptors/Wrap/rdMolDescriptors.cpp
+++ Code/GraphMol/Descriptors/Wrap/rdMolDescriptors.cpp
@@ -282,14 +282,6 @@
                python::arg("fromAtoms")=python::list()),
               docString.c_str(),
               python::return_value_policy<python::manage_new_object>());
-  docString="Returns the atom-pair fingerprint for a molecule as an IntSparseIntVect";
-  python::def("GetAtomPairFingerprint", GetAtomPairFingerprint,
-              (python::arg("mol"),
-               python::arg("minLength")=1,
-               python::arg("maxLength")=RDKit::AtomPairs::maxPathLen-1,
-               python::arg("fromAtoms")=python::list()),
-              docString.c_str(),
-              python::return_value_policy<python::manage_new_object>());

   python::def("GetHashedAtomPairFingerprint",
 	      (RDKit::SparseIntVect<boost::int32_t> *(*)(const RDKit::ROMol&,unsigned int,unsigned int,unsigned int))RDKit::AtomPairs::getHashedAtomPairFingerprint,


ADD LightShaderHandler SetShaderParameters() implemented

--- SSPSolution/GraphicsDLL/LightShaderHandler.cpp
+++ SSPSolution/GraphicsDLL/LightShaderHandler.cpp
@@ -148,5 +148,35 @@

 int LightShaderHandler::SetShaderParameters(ID3D11DeviceContext * deviceContext, ShaderLib::LightConstantBuffer * shaderParams)
 {
+	HRESULT hResult;
+	D3D11_MAPPED_SUBRESOURCE mappedResource;
+	ShaderLib::LightConstantBuffer* dataPtr;
+	unsigned int bufferNumber;
+
+	//Map the constant buffer so we can write to it (denies GPU access)
+	hResult = deviceContext->Map(this->m_matrixBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
+	if (FAILED(hResult)) {
+		return 1;
+	}
+
+	//Get pointer to the data
+	dataPtr = (ShaderLib::LightConstantBuffer*)mappedResource.pData;
+
+	//Copy the matrices to the constant buffer
+	dataPtr->viewMatrix = shaderParams->viewMatrix;
+	dataPtr->projectionMatrix = shaderParams->projectionMatrix;
+
+	dataPtr->camPos = shaderParams->camPos;
+
+	//Unmap the constant buffer to give the GPU access agin
+	deviceContext->Unmap(this->m_matrixBuffer, 0);
+
+	//Set constant buffer position in vertex shader
+	bufferNumber = 0;
+
+	//Set the constant buffer in vertex and pixel shader with updated values
+	deviceContext->VSSetConstantBuffers(bufferNumber, 1, &this->m_matrixBuffer);
+	deviceContext->PSSetConstantBuffers(bufferNumber, 1, &this->m_matrixBuffer);
+
 	return 0;
 }


small ui improvements

small ui improvements

--- ui/interface.cpp
+++ ui/interface.cpp
@@ -140,6 +140,7 @@
 			Show_main_menu = true;
 		}
 	}
+	ImGui::Checkbox("Open Menu on startup", &Menu_open_at_start);
 	ImGui::Separator();

 	static int type = static_cast<uint8_t>(Emulator_type);
@@ -154,7 +155,6 @@
 		reset_machine();
 	} else {
 	}
-	ImGui::Checkbox("Open Menu on startup", &Menu_open_at_start);
 }

 static void ui_get_disk_image(uint8_t slot_num)
@@ -219,13 +219,13 @@

 static void ui_show_speed_menu()
 {
-	if (ImGui::SliderInt("Emulator Speed", (int *)&Speed_multiplier, 1, 10) == true) {
+	if (ImGui::SliderInt("Emulator Speed", (int *)&Speed_multiplier, 1, 100) == true) {
 	}
 }

 static void ui_show_main_menu()
 {
-	ImGui::Begin("Options");
+	ImGui::Begin("Options", nullptr, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_ShowBorders);
 	ui_show_general_options();
 	ImGui::Separator();
 	ui_show_video_output_menu();
@@ -287,6 +287,10 @@
 	// initlialize imgui if it has not been initialized yet
 	if (Imgui_initialized == false) {
 		ImGui_ImplSdl_Init(window);
+
+		// maybe use apple 2 font here
+		//ImGuiIO& io = ImGui::GetIO();
+		//io.Fonts->AddFontFromFileTTF("printchar21.ttf", 8.0f);
 		Imgui_initialized = true;
 	}

@@ -298,7 +302,10 @@
 		ui_show_debug_menu();
 	}
 	//ImGui::ShowTestWindow();
-	ImGui::Render();
+
+	if (Show_main_menu || Show_debug_menu) {
+		ImGui::Render();
+	}
 }

 void ui_toggle_main_menu()


Change luminance range.

Change luminance range.

--- renderer/post/hdr.cpp
+++ renderer/post/hdr.cpp
@@ -68,8 +68,8 @@
 	} push;
 	push.size = uvec2(half_width, half_height);
 	push.lerp = 1.0f - pow(0.5f, timer.frame_time);
-	push.minimum = -2.0f;
-	push.maximum = 1.0f;
+	push.minimum = -5.0f;
+	push.maximum = 4.0f;
 	cmd.push_constants(&push, 0, sizeof(push));
 	cmd.dispatch(1, 1, 1);
 }


Namespace cleanup in view

Namespace cleanup in view

Nukes an unused namespace and moves code outside of views namespace
into views namespace.

BUG=none
TEST=none
TBR=sadrul@chromium.org
R=sadrul@chromium.org

Review URL: https://codereview.chromium.org/791993003

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#307842}

--- ui/views/view.cc
+++ ui/views/view.cc
@@ -51,6 +51,8 @@
 #include "base/win/scoped_gdi_object.h"
 #endif

+namespace views {
+
 namespace {

 #if defined(OS_WIN)
@@ -68,20 +70,14 @@
 const int kDefaultVerticalDragThreshold = 8;

 // Returns the top view in |view|'s hierarchy.
-const views::View* GetHierarchyRoot(const views::View* view) {
-  const views::View* root = view;
+const View* GetHierarchyRoot(const View* view) {
+  const View* root = view;
   while (root && root->parent())
     root = root->parent();
   return root;
 }

 }  // namespace
-
-namespace views {
-
-namespace internal {
-
-}  // namespace internal

 // static
 ViewsDelegate* ViewsDelegate::views_delegate = NULL;


fixed db print config file location

fixed db print config file location

--- src/proxy/tests/user-db-print.cpp
+++ src/proxy/tests/user-db-print.cpp
@@ -38,8 +38,6 @@
    std::string dbfile = argv[1];
    std::string basedir = argv[2];

-   seeks_proxy::_configfile = "config";
-
    seeks_proxy::_configfile = basedir + "/config";

    seeks_proxy::initialize_mutexes();


QString( i18n ( ) ) ? No way !

QString( i18n ( ) ) ? No way !

svn path=/trunk/kdepim/; revision=209015

--- libkpimexchange/core/exchangeprogress.cpp
+++ libkpimexchange/core/exchangeprogress.cpp
@@ -65,7 +65,7 @@
 void ExchangeProgress::updateLabel()
 {
   progressBar()->setValue( m_finished );
-  QString str = QString( i18n( "Downloading, %1 of %2" ) ).arg( m_finished ).arg( m_total );
+  QString str = i18n( "Downloading, %1 of %2" ).arg( m_finished ).arg( m_total );
   setLabel( str );
 }


fix some synthetic ellipses

fix some synthetic ellipses

--- libnanocv/tasks/task_synthetic_shapes.cpp
+++ libnanocv/tasks/task_synthetic_shapes.cpp
@@ -43,7 +43,7 @@

                 rect_t make_rect(coord_t rows, coord_t cols)
                 {
-                        random_t<coord_t> rng(2, std::min(rows / 4, cols / 4));
+                        random_t<coord_t> rng(3, std::min(rows / 4, cols / 4));

                         const coord_t dx = rng();
                         const coord_t dy = rng();
@@ -55,7 +55,7 @@

                 rect_t make_interior_rect(coord_t x, coord_t y, coord_t w, coord_t h)
                 {
-                        random_t<coord_t> rng(3, std::min(w / 4, h / 4));
+                        random_t<coord_t> rng(4, std::min(w / 4, h / 4));

                         const coord_t dx = rng();
                         const coord_t dy = rng();
@@ -126,7 +126,7 @@
                 random_t<size_t> rng_protocol(1, 10);
                 random_t<size_t> rng_output(1, osize());

-                random_t<scalar_t> rng_gauss(scalar_t(1), math::cast<scalar_t>(icols() + irows()) / scalar_t(8));
+                random_t<scalar_t> rng_gauss(scalar_t(0.5), math::cast<scalar_t>(icols() + irows()) / scalar_t(8));

                 const coord_t rows = static_cast<coord_t>(irows());
                 const coord_t cols = static_cast<coord_t>(icols());


fixed freezing issues, debug prints

fixed freezing issues, debug prints

--- franka_control/src/franka_control_node.cpp
+++ franka_control/src/franka_control_node.cpp
@@ -2,6 +2,8 @@
 // Use of this source code is governed by the Apache-2.0 license, see LICENSE
 #include <algorithm>
 #include <atomic>
+#include <thread>
+#include <chrono>

 #include <actionlib/server/simple_action_server.h>
 #include <controller_manager/controller_manager.h>
@@ -14,6 +16,7 @@
 #include <std_srvs/Trigger.h>

 using franka_hw::ServiceContainer;
+using namespace std::chrono_literals;

 int main(int argc, char** argv) {
   ros::init(argc, argv, "franka_control_node");
@@ -35,31 +38,44 @@

   auto disconnect = [&](std_srvs::Trigger::Request& request,
                         std_srvs::Trigger::Response& response) -> bool {
+   ROS_INFO("franka_control, disconnect, db1");
     if (franka_control.controllerActive()) {
       response.success = false;
       response.message = "Controller is active. Cannont disconnect while a controller is running.";
       return true;
     }
+   ROS_INFO("franka_control, disconnect, db2");
     response.success = true;
     response.message = "";
     services.reset();
+    ROS_INFO("franka_control, disconnect, db3");
     recovery_action_server.reset();
-    return franka_control.disconnect();
+    ROS_INFO("franka_control, disconnect, db4");
+    auto result = franka_control.disconnect();
+    ROS_INFO("franka_control, disconnect, db5 finished destroying robot");
+    return true;
   };

   auto connect = [&](std_srvs::Trigger::Request& request,
                      std_srvs::Trigger::Response& response) -> bool {
+    ROS_INFO("Connect db1");
     if (franka_control.connected()) {
       response.success = false;
       response.message = "Already conneceted to robot. Cannot connect twice.";
       return true;
     }
+ROS_INFO("Connect db2");
     franka_control.connect();
+ROS_INFO("Connect db3");
     std::lock_guard<std::mutex> lock(franka_control.robotMutex());
+ROS_INFO("Connect db4");
     auto& robot = franka_control.robot();
+ROS_INFO("Connect db5");

     // ServiceContainer services;
+    services = std::make_unique<ServiceContainer>();
     franka_hw::setupServices(robot, franka_control.robotMutex(), node_handle, *services);
+ROS_INFO("Connect db6");

     recovery_action_server =
         std::make_unique<actionlib::SimpleActionServer<franka_msgs::ErrorRecoveryAction>>(
@@ -76,12 +92,14 @@
               }
             },
             false);
+ROS_INFO("Connect db7");

     recovery_action_server->start();

+ROS_INFO("Connect db8");
     // Initialize robot state before loading any controller
     franka_control.update(robot.readOnce());
-
+ROS_INFO("Connect db9");
     response.success = true;
     response.message = "";
     return true;
@@ -115,11 +133,14 @@
       if (franka_control.connected()) {
         std::lock_guard<std::mutex> lock(franka_control.robotMutex());
         franka_control.update(franka_control.robot().readOnce());
+
+         ros::Time now = ros::Time::now();
+         control_manager.update(now, now - last_time);
+          franka_control.checkJointLimits();
+         last_time = now;
+      } else {
+        std::this_thread::sleep_for(10ms);
       }
-      ros::Time now = ros::Time::now();
-      control_manager.update(now, now - last_time);
-      franka_control.checkJointLimits();
-      last_time = now;

       if (!ros::ok()) {
         return 0;
@@ -147,7 +168,7 @@
         has_error = true;
       }
     }
-    ros::Duration(0.001).sleep();
+    ROS_INFO_THROTTLE(1, "franka_control, main loop");
   }

   return 0;


Added missing calls to CHKERRABORT().

Added missing calls to CHKERRABORT().

git-svn-id: e88a1e38e13faf406e05cc89eca8dd613216f6c4@3979 434f946d-2f3d-0410-ba4c-cb9f52fb0dbf

--- trunk/libmesh/src/numerics/petsc_preconditioner.C
+++ trunk/libmesh/src/numerics/petsc_preconditioner.C
@@ -46,7 +46,8 @@
   Vec x_vec = x_pvec.vec();
   Vec y_vec = y_pvec.vec();

-  PCApply(_pc,x_vec,y_vec);
+  int ierr = PCApply(_pc,x_vec,y_vec);
+  CHKERRABORT(libMesh::COMM_WORLD,ierr);
 }

 template <typename T>
@@ -63,14 +64,18 @@
   if(!this->_is_initialized)
   {
     //Create the preconditioning object
-    PCCreate(libMesh::COMM_WORLD,&_pc);
+    int ierr = PCCreate(libMesh::COMM_WORLD,&_pc);
+    CHKERRABORT(libMesh::COMM_WORLD,ierr);

     //Set the PCType
     set_petsc_preconditioner_type(this->_preconditioner_type, _pc);

 #ifdef LIBMESH_HAVE_PETSC_HYPRE
     if(this->_preconditioner_type == AMG_PRECOND)
-      PCHYPRESetType(this->_pc, "boomeramg");
+      {
+	PCHYPRESetType(this->_pc, "boomeramg");
+	CHKERRABORT(libMesh::COMM_WORLD,ierr);
+      }
 #endif

     PetscMatrix<T> * pmatrix = libmesh_cast_ptr<PetscMatrix<T>*, SparseMatrix<T> >(this->_matrix);
@@ -78,7 +83,8 @@
     _mat = pmatrix->mat();
   }

-  PCSetOperators(_pc,_mat,_mat,SAME_NONZERO_PATTERN);
+  int ierr = PCSetOperators(_pc,_mat,_mat,SAME_NONZERO_PATTERN);
+  CHKERRABORT(libMesh::COMM_WORLD,ierr);

   this->_is_initialized = true;
 }
@@ -141,7 +147,10 @@

   //Let the commandline override stuff
   if( preconditioner_type != AMG_PRECOND )
-    PCSetFromOptions(pc);
+    {
+      PCSetFromOptions(pc);
+      CHKERRABORT(libMesh::COMM_WORLD,ierr);
+    }
 }

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


Remove traits.hpp

Remove traits.hpp

--- cuda_wrapper/traits.hpp
+++ cuda_wrapper/traits.hpp
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2010  Peter Colberg
- *
- * This file is part of cuda-wrapper.
- *
- * This software may be modified and distributed under the terms of the
- * 3-clause BSD license.  See accompanying file LICENSE for details.
- */
-
-#ifndef CUDA_TRAITS_HPP
-#define CUDA_TRAITS_HPP
-
-#include <cstddef>
-#include <cuda.h>
-
-namespace cuda {
-
-typedef std::size_t size_type;
-
-} // namespace cuda
-
-#endif /* ! CUDA_TRAITS_HPP */


Better exception message

Better exception message

--- Python/klampt/src/motionplanning.cpp
+++ Python/klampt/src/motionplanning.cpp
@@ -1030,7 +1030,13 @@
   else if(0==strcmp(setting,"restart"))
     factory.restart = (value != 0);
   else {
-    throw PyException("Invalid setting");
+    stringstream ss;
+    ss<<"Invalid numeric setting \""<<setting<<"\""<<endl;
+    ss<<"Valid keys are:"<<endl;
+    ss<<"  knn, connectionThreshold, perturbationRadius, bidirectional,"<<endl;
+    ss<<"  grid, gridResolution, suboptimalityFactor, randomizeFrequency,"<<endl;
+    ss<<"  shortcut, restart"<<endl;
+    throw PyException(ss.str());
   }
 }

@@ -1041,7 +1047,11 @@
   else if(0==strcmp(setting,"restartTermCond"))
     factory.restartTermCond = value;
   else {
-    throw PyException("Invalid setting");
+    stringstream ss;
+    ss<<"Invalid string-valued setting \""<<setting<<"\""<<endl;
+    ss<<"Valid keys are:"<<endl;
+    ss<<"  pointLocation, restartTermCond"<<endl;
+    throw PyException(ss.str());
   }
 }


add notes to top of code

add notes to top of code

--- linux/simulation_mpi.cpp
+++ linux/simulation_mpi.cpp
@@ -9,6 +9,14 @@

 //TODO: Add softening if ever use this again, figure out how to overlap communication and
 //computation more in Barnes-Hut
+
+//README!!!!!!!!!!!!! IMPORTANT: Set these environment variables before running
+/*
+export OMP_NUM_THREADS=<value>
+export OMP_THREAD_LIMIT=<equal to OMP_NUM_THREADS>
+export OMP_NESTED=TRUE
+export KMP_AFFINITY=compact,granularity=fine //On Intel Xeon Phi
+*/

 #include <cmath>
 #include <iostream>


remove HYBRID directive

remove HYBRID directive

--- linux/simulation_mpi.cpp
+++ linux/simulation_mpi.cpp
@@ -30,8 +30,6 @@
 //#define TILES
 #define CUTOFF //If strips, use cutoff distance or not?
 #define OUTPUT //print output?
-//#define HYBRID //Pure OpenMP or hybrid?
-

 //===================================BEGIN FUNCTION HEADERS===================================
 //Determines shortest vector from particle 1 to particle 2 (including across boundary) in one direction
@@ -395,11 +393,6 @@
             printf("Error: Number of processes is not a (small) factor of 1024\n");
             MPI_Abort(MPI_COMM_WORLD, 1);
       }
-      #endif
-
-      //Setup openMP
-      #ifdef HYBRID
-      omp_set_nested(1);
       #endif

       //START SETUP


More FIFO logging fixes.

More FIFO logging fixes.

--- Source/SFZDebug.cpp
+++ Source/SFZDebug.cpp
@@ -85,11 +85,11 @@
 	// Read the string.
 	String result;
 	fifo.prepareToRead(msgSize, start1, size1, start2, size2);
-	if (start1 > 0) {
+	if (size1 > 0) {
 		p = &buffer[start1];
 		result = String(CharPointer_UTF8(p), CharPointer_UTF8(p + size1));
 		}
-	if (start2 > 0) {
+	if (size2 > 0) {
 		p = &buffer[start2];
 		result += String(CharPointer_UTF8(p), CharPointer_UTF8(p + size2));
 		}


SpriteBatch.End resets the setCustomShaders lambda to null.   This breaks circular reference chains, in case the state lambda closed over an object that in turn holds a reference to the SpriteBatch.

--- Src/SpriteBatch.cpp
+++ Src/SpriteBatch.cpp
@@ -383,6 +383,10 @@
         FlushBatch();
     }

+    // Break circular reference chains, in case the state lambda closed
+    // over an object that holds a reference to this SpriteBatch.
+    mSetCustomShaders = nullptr;
+
     mInBeginEndPair = false;
 }


Enabled ball switch interrupts

Enabled ball switch interrupts

--- Subsystems/Claw.cpp
+++ Subsystems/Claw.cpp
@@ -34,7 +34,7 @@
     // Set up interrupt for catching ball
     m_haveBallSwitch->RequestInterrupts( Claw::CloseClaw , this );
     m_haveBallSwitch->SetUpSourceEdge( false , true );
-    //m_haveBallSwitch->EnableInterrupts();
+    m_haveBallSwitch->EnableInterrupts();

     //magical values found using empirical testing don't change.
     setK(0.238f);
@@ -155,9 +155,6 @@

 		m_shootTimer.Reset();
 		m_shooterStates = SHOOTER_IDLE;
-	}
-	if (!m_zeroSwitch->Get()){
-		ResetEncoders();
 	}

 	setF(calcF());


Minesweeper now has colorful output.

Minesweeper now has colorful output.

--- examples/minesweeper.cc
+++ examples/minesweeper.cc
@@ -199,6 +199,13 @@

 class Printer {
  public:
+  static constexpr int RESET = 0;
+  static constexpr int BRIGHT = 1;
+  static constexpr int DIM = 2;
+  static constexpr int BLACK = 30;
+  static constexpr int RED = 31;
+  static constexpr int GREEN = 32;
+
   void Print(std::ostream& os, const Field& f) {
     const int width = 3;
     os << std::setw(width) << "";
@@ -209,33 +216,34 @@
     for (size_t y = 0; y < f.dimension(); ++y) {
       os << std::setw(width) << y;
       for (size_t x = 0; x < f.dimension(); ++x) {
-        os << std::setw(width) << label(f, Point(x, y));
+        std::pair<int, std::string> l = label(f, Point(x, y));
+        os << "\033[" << l.first << "m" << std::setw(width) << l.second << "\033[0m";
       }
       os << std::endl;
     }
   }

-  virtual std::string label(const Field& f, Point p) = 0;
+  virtual std::pair<int, std::string> label(const Field&, Point) = 0;
 };

 class OmniscientPrinter : public Printer {
  public:
-  std::string label(const Field& f, Point p) {
-    return f.mine(p) ? "X" : "";
+  std::pair<int, std::string> label(const Field& f, Point p) {
+    return f.mine(p) ? std::make_pair(RED, "X") : std::make_pair(RESET, "");
   }
 };

 class SimplePrinter : public Printer {
  public:
-  std::string label(const Field& f, Point p) override {
+  std::pair<int, std::string> label(const Field& f, Point p) override {
     switch (f.state(p)) {
-      case Field::UNEXPLORED: return "";
-      case Field::HIT_MINE:   return "X";
-      case 0:                 return ".";
+      case Field::UNEXPLORED: return std::make_pair(RESET, "");
+      case Field::HIT_MINE:   return std::make_pair(RED, "X");
+      case 0:                 return std::make_pair(DIM, ".");
       default: {
         std::stringstream ss;
         ss << f.state(p);
-        return ss.str();
+        return std::make_pair(RESET, ss.str());
       }
     }
   }
@@ -259,35 +267,35 @@
     return Clause(Ewff::TRUE, c);
   }

-  std::string label(const Field& f, Point p) override {
+  std::pair<int, std::string> label(const Field& f, Point p) override {
     assert(&f == f_);
     UpdateKb();
     switch (f.state(p)) {
       case Field::UNEXPLORED: {
         SimpleClause yes_mine({MineLit(true, p)});
         SimpleClause no_mine({MineLit(false, p)});
-        for (Setup::split_level k = 0; k < 3; ++k) {
+        for (Setup::split_level k = 0; k < 2; ++k) {
           if (s_.Entails(yes_mine, k)) {
             assert(f_->mine(p));
-            return "X";
+            return std::make_pair(RED, "X");
           } else if (s_.Entails(no_mine, k)) {
             assert(!f_->mine(p));
-            return "$";
+            return std::make_pair(GREEN, "$");
           }
         }
-        return "";
+        return std::make_pair(RESET, "");
       }
       case Field::HIT_MINE: {
-        return "X";
+        return std::make_pair(RED, "X");
       }
       default: {
         const int m = f.state(p);
         if (m == 0) {
-          return ".";
+          return std::make_pair(DIM, ".");
         }
         std::stringstream ss;
         ss << m;
-        return ss.str();
+        return std::make_pair(RESET, ss.str());
       }
     }
   }


make protections agains failed retrieval of the CDB object in a proper way

--- TOF/AliTOFcalib.cxx
+++ TOF/AliTOFcalib.cxx
@@ -15,6 +15,9 @@

 /*
 $Log$
+Revision 1.12  2007/03/23 11:31:16  arcelli
+CDB Entry for TOF Reconstruction Parameters
+
 Revision 1.11  2007/02/28 18:08:26  arcelli
 Add protection against failed retrieval of the CDB cal object

@@ -790,15 +793,18 @@
   Char_t *sel1 = "Par" ;
   Char_t  out[100];
   sprintf(out,"%s/%s",sel,sel1);
+  if (!man->Get(out,nrun)) {
+    return kFALSE;
+  }
   AliCDBEntry *entry = man->Get(out,nrun);
-  if (!entry) {
-    AliError(Form("Failed to get entry: %s",out));
-    return kFALSE;
-  }
+  if(!entry->GetObject()){
+    return kFALSE;
+  }
+
   AliTOFCal *cal =(AliTOFCal*)entry->GetObject();
   fTOFCal = cal;
   return kTRUE;
-
+
 }
 //_____________________________________________________________________________
 void AliTOFcalib::WriteSimParOnCDB(Char_t *sel, Int_t minrun, Int_t maxrun)
@@ -880,15 +886,37 @@
   //Read miscalibration parameters from the CDB
   AliCDBManager *man = AliCDBManager::Instance();
   if(!man->IsDefaultStorageSet())man->SetDefaultStorage("local://$ALICE_ROOT");
+
+  // The Slewing Pars
+
   Char_t *sel1 = "SimPar" ;
   Char_t  out[100];
   sprintf(out,"%s/%s",sel,sel1);
+  if (!man->Get(out,nrun)) {
+    AliFatal("Exiting, no CDB object (SimPar) found!!!");
+    exit(0);
+  }
   AliCDBEntry *entry1 = man->Get(out,nrun);
+  if(!entry1->GetObject()){
+    AliFatal("Exiting, no CDB object (SimPar) found!!!");
+    exit(0);
+  }
   AliTOFCal *cal =(AliTOFCal*)entry1->GetObject();
   fTOFSimCal=cal;
+
+  // The Tot Histo
+
   Char_t *sel2 = "SimHisto" ;
   sprintf(out,"%s/%s",sel,sel2);
+  if (!man->Get(out,nrun)) {
+    AliFatal("Exiting, no CDB object (SimHisto) found!!!");
+    exit(0);
+  }
   AliCDBEntry *entry2 = man->Get(out,nrun);
+  if(!entry2->GetObject()){
+    AliFatal("Exiting, no CDB object (SimHisto) found!!!");
+    exit(0);
+  }
   TH1F *histo =(TH1F*)entry2->GetObject();
   fTOFSimToT=histo;
 }
@@ -918,7 +946,16 @@
   Char_t *sel1 = "RecPar" ;
   Char_t  out[100];
   sprintf(out,"%s/%s",sel,sel1);
+  if (!man->Get(out,nrun)) {
+    AliFatal("Exiting, no CDB object (RecPar) found!!!");
+    exit(0);
+  }
   AliCDBEntry *entry = man->Get(out,nrun);
+  if(!entry->GetObject()){
+    AliFatal("Exiting, no CDB object (RecPar) found!!!");
+    exit(0);
+  }
+
   AliTOFRecoParam *param=(AliTOFRecoParam*)entry->GetObject();
   return param;
 }


Fix some copy and paste typos.

Fix some copy and paste typos.

git-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@24540 91177308-0d34-0410-b5e6-96231b3b80d8

--- TableGen/Record.cpp
+++ TableGen/Record.cpp
@@ -741,7 +741,7 @@
   if (IntInit *II = dynamic_cast<IntInit*>(R->getValue()))
     return II->getValue();
   throw "Record `" + getName() + "', field `" + FieldName +
-        "' does not have a list initializer!";
+        "' does not have an int initializer!";
 }

 /// getValueAsDef - This method looks up the specified field and returns its
@@ -757,7 +757,7 @@
   if (DefInit *DI = dynamic_cast<DefInit*>(R->getValue()))
     return DI->getDef();
   throw "Record `" + getName() + "', field `" + FieldName +
-        "' does not have a list initializer!";
+        "' does not have a def initializer!";
 }

 /// getValueAsBit - This method looks up the specified field and returns its


[new compiler] Fix crash in tst_qquickpathview

QQuickPathView's attached object uses a dynamic meta-object. So when installing
bindings - such as a signal handler - on it and we want to determine the
property cache for it, we must not use the QQmlEnginePrivate::cache overload
that takes a QObject pointer, as that will - rightly so - return a null
pointer. Instead in this case it is okay to go with the static type overload,
by using the meta-object of the attached type known at compile time.  This is
consistent with the VME code path.

Change-Id: Iffc64f7ee4677c6cc60d071b80f4032cf8037ab7
Reviewed-by: Lars Knoll <a812617a4072dcbeb80684eca0f369f0083af109@digia.com>

--- src/qml/qml/qqmlobjectcreator.cpp
+++ src/qml/qml/qqmlobjectcreator.cpp
@@ -737,7 +737,8 @@
         QQmlType *attachedType = tr->type;
         const int id = attachedType->attachedPropertiesId();
         QObject *qmlObject = qmlAttachedPropertiesObjectById(id, _qobject);
-        QQmlRefPointer<QQmlPropertyCache> cache = QQmlEnginePrivate::get(engine)->cache(qmlObject);
+        QQmlRefPointer<QQmlPropertyCache> cache = QQmlEnginePrivate::get(engine)->cache(attachedType->attachedPropertiesType());
+        Q_ASSERT(!cache.isNull());
         if (!populateInstance(binding->value.objectIndex, qmlObject, cache, qmlObject, /*value type property*/0))
             return false;
         return true;
@@ -1288,6 +1289,7 @@
         vmeMetaObject = QQmlVMEMetaObject::get(_qobject);
     }
     if (installPropertyCache) {
+        Q_ASSERT(_propertyCache);
         _ddata->propertyCache = _propertyCache;
         _ddata->propertyCache->addref();
     }


test, SignalsCatchingTestCase: change order of arguments for HandlerStep's function call operator

--- test/Signals/SignalsCatchingTestCase.cpp
+++ test/Signals/SignalsCatchingTestCase.cpp
@@ -308,15 +308,15 @@
 	 *
 	 * Marks first sequence point, executes internal test step and marks last sequence point.
 	 *
-	 * \param [in] signalInformation is a reference to received SignalInformation object
 	 * \param [in] sequenceAsserter is a reference to shared SequenceAsserter object
 	 * \param [in] softwareTimer is a pointer to software timer, required only for SoftwareTimerStep
+	 * \param [in] signalInformation is a reference to received SignalInformation object
 	 *
 	 * \return 0 on success, error code otherwise
 	 */

-	int operator()(const SignalInformation& signalInformation, SequenceAsserter& sequenceAsserter,
-			SoftwareTimerBase* softwareTimer) const;
+	int operator()(SequenceAsserter& sequenceAsserter, SoftwareTimerBase* softwareTimer,
+			const SignalInformation& signalInformation) const;

 	/**
 	 * \return true if another available HandlerStep should be executed in the same signal handler, false otherwise
@@ -527,8 +527,8 @@
 | HandlerStep's public functions
 +---------------------------------------------------------------------------------------------------------------------*/

-int HandlerStep::operator()(const SignalInformation& signalInformation, SequenceAsserter& sequenceAsserter,
-		SoftwareTimerBase* const softwareTimer) const
+int HandlerStep::operator()(SequenceAsserter& sequenceAsserter, SoftwareTimerBase* const softwareTimer,
+		const SignalInformation& signalInformation) const
 {
 	sequenceAsserter.sequencePoint(sequencePoints_.first);

@@ -624,7 +624,7 @@
 		auto& handlerStep = *handlerStepsRange.begin();
 		handlerStepsRange = {handlerStepsRange.begin() + 1, handlerStepsRange.end()};

-		const auto ret = handlerStep(signalInformation, sharedSequenceAsserter, softwareTimerPointer);
+		const auto ret = handlerStep(sharedSequenceAsserter, softwareTimerPointer, signalInformation);
 		if (ret != 0)
 			sharedSigAtomic = ret;


Add tests for ReadAsciiNumber

Add tests for ReadAsciiNumber

--- Test/NumberTest.cpp
+++ Test/NumberTest.cpp
@@ -45,3 +45,10 @@
   EXPECT_EQ( 7, number[6] );
   EXPECT_EQ( 8, number[7] );
 }
+
+TEST( NumberTest, ReadAsciiNumber )
+{
+  EXPECT_EQ( 42, ReadAsciiNumber<uint8_t>( DataRef( "42" ) ) );
+  EXPECT_EQ( 1970, ReadAsciiNumber<int32_t>( DataRef( "1970" ) ) );
+  EXPECT_THROW( ReadAsciiNumber<uint8_t>( DataRef( "hello" ) ), Error );
+}


Fixed bug in rtkImportImageFilter: the CudaImageDataManager did not correctly allocate the GPU buffer

--- code/rtkImportImageFilter.hxx
+++ code/rtkImportImageFilter.hxx
@@ -197,6 +197,19 @@
   // opposed to the container) if the user wants it to.
   outputPtr->GetPixelContainer()->SetImportPointer(m_ImportPointer,
                                                    m_Size, false);
+
+#ifdef RTK_USE_CUDA
+  typedef itk::CudaImage<typename TImage::PixelType, TImage::ImageDimension> TCudaImage;
+  if (TCudaImage* cudaOutputPtr = dynamic_cast<TCudaImage*>(outputPtr.GetPointer()))
+    {
+    cudaOutputPtr->GetDataManager()->SetBufferSize(m_Size * sizeof(typename OutputImageType::PixelType));
+    cudaOutputPtr->GetDataManager()->SetImagePointer(outputPtr);
+    cudaOutputPtr->GetDataManager()->SetCPUBufferPointer(m_ImportPointer);
+    cudaOutputPtr->GetDataManager()->SetGPUDirtyFlag(true);
+    cudaOutputPtr->GetDataManager()->SetCPUDirtyFlag(false);
+    cudaOutputPtr->GetDataManager()->SetTimeStamp(outputPtr->GetPixelContainer()->GetTimeStamp());
+    }
+#endif
 }

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