git-svn-id: https://ibamr.googlecode.com/svn/ibamr/trunk@129 d09065f7-430b-272c-15e1-d58225cc4d83

--- src/IB/IBHierarchyIntegrator_New.h
+++ src/IB/IBHierarchyIntegrator_New.h
@@ -1,735 +0,0 @@
-#ifndef included_IBHierarchyIntegrator
-#define included_IBHierarchyIntegrator
-
-// Filename: IBHierarchyIntegrator.h
-// Created on 12 Jul 2004 by Boyce Griffith (boyce@trasnaform.speakeasy.net)
-// Last modified: <11.Jan.2007 17:20:13 griffith@box221.cims.nyu.edu>
-
-/////////////////////////////// INCLUDES /////////////////////////////////////
-
-// IBAMR INCLUDES
-#include <ibamr/IBEulerianForceSetter.h>
-#include <ibamr/IBEulerianSourceSetter.h>
-#include <ibamr/IBLagrangianForceStrategy.h>
-#include <ibamr/IBLagrangianSourceStrategy.h>
-#include <ibamr/INSHierarchyIntegrator.h>
-#include <ibamr/LDataManager.h>
-#include <ibamr/LNodePosnInitStrategy.h>
-#include <ibamr/LagSiloDataWriter.h>
-#include <ibamr/SetDataStrategy.h>
-
-// SAMRAI INCLUDES
-#include <CellVariable.h>
-#include <CoarsenAlgorithm.h>
-#include <CoarsenSchedule.h>
-#include <GriddingAlgorithm.h>
-#include <HierarchyCellDataOpsReal.h>
-#include <IntVector.h>
-#include <LoadBalancer.h>
-#include <PatchHierarchy.h>
-#include <PatchLevel.h>
-#include <RefineAlgorithm.h>
-#include <RefineSchedule.h>
-#include <VariableContext.h>
-#include <VisItDataWriter.h>
-#include <tbox/Database.h>
-#include <tbox/Pointer.h>
-
-// STL INCLUDES
-#include <map>
-#include <vector>
-
-/////////////////////////////// CLASS DEFINITION /////////////////////////////
-
-namespace IBAMR
-{
-/*!
- * XXXX
- */
-class IBHierarchyIntegrator
-    : public SAMRAI::mesh::StandardTagAndInitStrategy<NDIM>,
-      public SAMRAI::tbox::Serializable
-{
-public:
-    typedef std::map<std::string,SAMRAI::tbox::Pointer<SAMRAI::xfer::RefineAlgorithm<NDIM> > >              RefineAlgMap;
-    typedef std::map<std::string,std::vector<SAMRAI::tbox::Pointer<SAMRAI::xfer::RefineSchedule<NDIM> > > > RefineSchedMap;
-
-    typedef std::map<std::string,SAMRAI::tbox::Pointer<SAMRAI::xfer::CoarsenAlgorithm<NDIM> > >          CoarsenAlgMap;
-    typedef std::map<std::string,std::vector<SAMRAI::tbox::Pointer<SAMRAI::xfer::CoarsenSchedule<NDIM> > > > CoarsenSchedMap;
-
-    /*!
-     * XXXX
-     *
-     * When assertion checking is active, passing any null pointer or
-     * an empty string as an argument will result in an assertion
-     * failure.
-     */
-    IBHierarchyIntegrator(
-        const std::string& object_name,
-        SAMRAI::tbox::Pointer<SAMRAI::tbox::Database> input_db,
-        SAMRAI::tbox::Pointer<SAMRAI::hier::PatchHierarchy<NDIM> > hierarchy,
-        SAMRAI::tbox::Pointer<INSHierarchyIntegrator> ins_hier_integrator,
-        SAMRAI::tbox::Pointer<IBLagrangianForceStrategy> force_strategy,
-        SAMRAI::tbox::Pointer<IBLagrangianSourceStrategy> source_strategy=NULL,
-        bool register_for_restart=true);
-
-    /*!
-     * The destructor for IBHierarchyIntegrator unregisters the
-     * integrator object with the restart manager when so registered.
-     */
-    virtual ~IBHierarchyIntegrator();
-
-    /*!
-     * Supply an optional cell centered body forcing term.
-     *
-     * NOTE: This forcing term will be added to the Eulerian force
-     * density.
-     */
-    void registerBodyForceSpecification(
-        SAMRAI::tbox::Pointer<SetDataStrategy> body_force_set);
-
-    /*!
-     * Register a concrete strategy object with the integrator that
-     * specifies the initial configuration of the curvilinear mesh
-     * nodes.
-     */
-    void registerLNodePosnInitStrategy(
-        SAMRAI::tbox::Pointer<LNodePosnInitStrategy> lag_posn_init);
-
-    /*!
-     * Free the concrete initialization strategy object.
-     *
-     * NOTE: Be sure to call this method only once the initialization
-     * object is no longer needed.
-     */
-    void freeLNodePosnInitStrategy();
-
-    /*!
-     * Register a VisIt data writer so this class will write plot
-     * files that may be postprocessed with the VisIt visualization
-     * tool.
-     */
-    void registerVisItDataWriter(
-        SAMRAI::tbox::Pointer<SAMRAI::appu::VisItDataWriter<NDIM> > visit_writer);
-
-    /*!
-     * Register a Lagrangian Silo data writer so this class will write
-     * plot files that may be postprocessed with the VisIt
-     * visualization tool.
-     */
-    void registerLagSiloDataWriter(
-        SAMRAI::tbox::Pointer<LagSiloDataWriter> silo_writer);
-
-    /*!
-     * @brief Register a load balancer for non-uniform load balancing.
-     */
-    void registerLoadBalancer(
-        SAMRAI::tbox::Pointer<SAMRAI::mesh::LoadBalancer<NDIM> > load_balancer);
-
-    /*!
-     * @brief Gather all data to the specified root MPI process,
-     * assuming that markers have larger Lagrangian indices than
-     * material points.
-     */
-    void gatherAllData(
-        const int mpi_root,
-        double* const X_structure,
-        const int struct_sz,
-        double* const X_marker,
-        const int marker_sz,
-        const int level_num=-1);
-
-    ///
-    ///  The following routines:
-    ///
-    ///      initializeHierarchyIntegrator(),
-    ///      initializeHierarchy(),
-    ///      advanceHierarchy(),
-    ///      atRegridPoint(),
-    ///      getIntegratorTime(),
-    ///      getStartTime(),
-    ///      getEndTime(),
-    ///      getIntegratorStep(),
-    ///      getMaxIntegratorSteps(),
-    ///      stepsRemaining(),
-    ///      getPatchHierarchy(),
-    ///      getGriddingAlgorithm()
-    ///
-    ///  allow the IBHierarchyIntegrator to be used as a hierarchy
-    ///  integrator.
-    ///
-
-    /*!
-     * XXXX.
-     */
-    virtual void initializeHierarchyIntegrator(
-        SAMRAI::tbox::Pointer<SAMRAI::mesh::GriddingAlgorithm<NDIM> > gridding_alg);
-
-    /*!
-     * XXXX.
-     */
-    virtual double initializeHierarchy();
-
-    /*!
-     * Integrate data on all patches on all levels of the patch
-     * hierarchy from current time (current_time) to new time
-     * (new_time).
-     *
-     * When assertion checking is active, an unrecoverable exception
-     * will result if the new time is not greater than the given time.
-     */
-    virtual double advanceHierarchy(
-        const double dt,
-        const bool rebalance_coarsest=false);
-
-    /*!
-     * Return true if the current step count indicates that regridding
-     * should occur.
-     */
-    bool atRegridPoint() const;
-
-    /*!
-     * Return the current integration time for coarsest hierarchy
-     * level.
-     */
-    double getIntegratorTime() const;
-
-    /*!
-     * Return the initial integration time.
-     */
-    double getStartTime() const;
-
-    /*!
-     * Return the final integration time.
-     */
-    double getEndTime() const;
-
-    /*!
-     * Return the integration step count for entire hierarchy (i.e.,
-     * number of steps taken on the coarsest level).
-     */
-    int getIntegratorStep() const;
-
-    /*!
-     * Return the maximum number of integration steps allowed for
-     * entire hierarchy (i.e., steps allowed on coarsest level).
-     */
-    int getMaxIntegratorSteps() const;
-
-    /*!
-     * Return true if any integration steps remain, false otherwise.
-     */
-    bool stepsRemaining() const;
-
-    /*!
-     * Return a const pointer to the patch hierarchy managed by integrator.
-     */
-    const SAMRAI::tbox::Pointer<SAMRAI::hier::PatchHierarchy<NDIM> > getPatchHierarchy() const;
-
-    /*!
-     * Return a pointer to the gridding algorithm object.
-     */
-    SAMRAI::tbox::Pointer<SAMRAI::mesh::GriddingAlgorithm<NDIM> > getGriddingAlgorithm() const;
-
-    ///
-    ///  The following routines:
-    ///
-    ///      rebalanceCoarsestLevel(),
-    ///      regridHierarchy(),
-    ///      synchronizeHierarchy(),
-    ///      synchronizeNewLevels(),
-    ///      resetTimeDependentHierData(),
-    ///      resetHierDataToPreadvanceState()
-    ///
-    ///  allow the IBHierarchyIntegrator to provide data management
-    ///  for a time integrator which making use of this class.
-    ///
-
-    /*!
-     * Rebalance the hierarchy.
-     */
-    virtual void rebalanceCoarsestLevel();
-
-    /*!
-     * Regrid the hierarchy.
-     */
-    virtual void regridHierarchy();
-
-    /*!
-     * Synchronize the hierarchy.
-     */
-    virtual void synchronizeHierarchy();
-
-    /*!
-     * Coarsen current solution data from finest hierarchy level specified
-     * down through the coarsest hierarchy level specified, if initial_time
-     * is true.  In this case, the hierarchy is being constructed at the
-     * initial simulation time,  After data is coarsened, the application-
-     * specific initialization routine is called to set data before that
-     * solution is further coarsened to the next coarser level in the
-     * hierarchy.  This operation makes the solution consistent between
-     * coarser levels and finer levels that did not exist when the coarse
-     * levels where created and initialized originally.
-     *
-     * When initial_time is false, this routine does nothing since the
-     * standard hyperbolic AMR algorithm for conservation laws requires
-     * no data synchronization after regridding beyond interpolation of
-     * data from coarser levels in the hierarchy in some conservative fashion.
-     *
-     * When assertion checking is active, an unrecoverable exception will
-     * result if the hierarchy pointer is null, the level numbers do
-     * not properly match existing levels in the hierarchy (either
-     * coarsest_level > finest_level or some level is null).
-     */
-    virtual void synchronizeNewLevels(
-        const SAMRAI::tbox::Pointer<SAMRAI::hier::PatchHierarchy<NDIM> > hierarchy,
-        const int coarsest_level,
-        const int finest_level,
-        const double sync_time,
-        const bool initial_time);
-
-    /*!
-     * Reset time dependent data.
-     */
-    virtual void resetTimeDependentHierData(
-        const double new_time);
-
-    /*!
-     * Deallocate all new simulation data.
-     */
-    virtual void resetHierDataToPreadvanceState();
-
-    ///
-    ///  The following routines:
-    ///
-    ///      initializeLevelData(),
-    ///      resetHierarchyConfiguration(),
-    ///      applyGradientDetector()
-    ///
-    ///  are concrete implementations of functions declared in the
-    ///  SAMRAI::mesh::StandardTagAndInitStrategy<NDIM> abstract base class.
-    ///
-
-    /*!
-     * Initialize data on a new level after it is inserted into an AMR
-     * patch hierarchy by the gridding algorithm.  The level number
-     * indicates that of the new level.  The old_level pointer
-     * corresponds to the level that resided in the hierarchy before
-     * the level with the specified number was introduced.  If the
-     * pointer is null, there was no level in the hierarchy prior to
-     * the call and the level data is set based on the user routines
-     * and the simulation time.  Otherwise, the specified level
-     * replaces the old level and the new level receives data from the
-     * old level appropriately before it is destroyed.
-     *
-     * Typically, when data is set, it is interpolated from coarser
-     * levels in the hierarchy.  If the data is to be set, the level
-     * number must match that of the old level, if non-null.  If the
-     * old level is non-null, then data is copied from the old level
-     * to the new level on regions of intersection between those
-     * levels before interpolation occurs.  Then, user-supplied patch
-     * routines are called to further initialize the data if needed.
-     * The boolean argument initial_time is passed into the user's
-     * routines.
-     *
-     * The boolean argument initial_time indicates whether the level
-     * is being introduced for the first time (i.e., at initialization
-     * time), or after some regrid process during the calculation
-     * beyond the initial hierarchy construction.  This information is
-     * provided since the initialization of the data on a patch may be
-     * different in each of those circumstances.  The can_be_refined
-     * boolean argument indicates whether the level is the finest
-     * level allowed in the hierarchy.  This may or may not affect the
-     * data initialization process depending on the problem.
-     *
-     * When assertion checking is active, an unrecoverable exception
-     * will result if the hierarchy pointer is null, the level number
-     * does not match any level in the hierarchy, or the old level
-     * number does not match the level number (if the old level
-     * pointer is non-null).
-     */
-    virtual void initializeLevelData(
-        const SAMRAI::tbox::Pointer<SAMRAI::hier::BasePatchHierarchy<NDIM> > hierarchy,
-        const int level_number,
-        const double init_data_time,
-        const bool can_be_refined,
-        const bool initial_time,
-        const SAMRAI::tbox::Pointer<SAMRAI::hier::BasePatchLevel<NDIM> > old_level=SAMRAI::tbox::Pointer<SAMRAI::hier::BasePatchLevel<NDIM> >(NULL),
-        const bool allocate_data=true);
-
-    /*!
-     * Reset cached communication schedules after the hierarchy has
-     * changed (for example, due to regidding) and the data has been
-     * initialized on the new levels.  The intent is that the cost of
-     * data movement on the hierarchy will be amortized across
-     * multiple communication cycles, if possible.  The level numbers
-     * indicate the range of levels in the hierarchy that have
-     * changed.  However, this routine updates communication schedules
-     * every level finer than and including that indexed by the
-     * coarsest level number given.
-     *
-     * When assertion checking is active, an unrecoverable exception
-     * will result if the hierarchy pointer is null, any pointer to a
-     * level in the hierarchy that is coarser than the finest level is
-     * null, or the given level numbers not specified properly; e.g.,
-     * coarsest_level > finest_level.
-     */
-    virtual void resetHierarchyConfiguration(
-        const SAMRAI::tbox::Pointer<SAMRAI::hier::BasePatchHierarchy<NDIM> > hierarchy,
-        const int coarsest_level,
-        const int finest_level);
-
-    /*!
-     * Set integer tags to "one" in cells where refinement of the
-     * given level should occur according to some user-supplied
-     * gradient criteria.  The double time argument is the regrid
-     * time.  The integer "tag_index" argument is the patch descriptor
-     * index of the cell centered integer tag array on each patch in
-     * the hierarchy.  The boolean argument initial_time indicates
-     * whether the level is being subject to refinement at the initial
-     * simulation time.  If it is false, then the error estimation
-     * process is being invoked at some later time after the AMR
-     * hierarchy was initially constructed.  The boolean argument
-     * uses_richardson_extrapolation_too is true when Richardson
-     * extrapolation error estimation is used in addition to the
-     * gradient detector, and false otherwise.  This argument helps
-     * the user to manage multiple regridding criteria.  This
-     * information is passed along to the user's patch tagging
-     * routines since the application of the gradient detector may be
-     * different in each case.
-     *
-     * When assertion checking is active, an unrecoverable exception
-     * will result if the hierarchy pointer is null or the level
-     * number does not match any existing level in the hierarchy.
-     */
-    virtual void applyGradientDetector(
-        const SAMRAI::tbox::Pointer<SAMRAI::hier::BasePatchHierarchy<NDIM> > hierarchy,
-        const int level_number,
-        const double error_data_time,
-        const int tag_index,
-        const bool initial_time,
-        const bool uses_richardson_extrapolation_too);
-
-    ///
-    ///  The following routines:
-    ///
-    ///      getCurrentContext(),
-    ///      getNewContext(),
-    ///      getOldContext(),
-    ///      getScratchContext(),
-    ///      getPlotContext()
-    ///
-    ///  allow access to the various variable contexts maintained by
-    ///  the integrator.
-    ///
-
-    /*!
-     * Return pointer to "current" variable context used by
-     * integrator.  Current data corresponds to state data at the
-     * beginning of a timestep, or when a new level is initialized.
-     */
-    SAMRAI::tbox::Pointer<SAMRAI::hier::VariableContext> getCurrentContext() const;
-
-    /*!
-     * Return pointer to "new" variable context used by integrator.
-     * New data corresponds to advanced state data at the end of a
-     * timestep.  The data is one timestep later than the "current"
-     * data.
-     */
-    SAMRAI::tbox::Pointer<SAMRAI::hier::VariableContext> getNewContext() const;
-
-    /*!
-     * Return pointer to "old" variable context used by integrator.
-     * Old data corresponds to an extra time level of state data used
-     * for Richardson extrapolation error estimation.  The data is one
-     * timestep earlier than the "current" data.
-     *
-     * Note that only in certain cases when using time-dependent error
-     * estimation, such as Richardson extrapolation, is the returned
-     * pointer will non-null.  See contructor for more information.
-     */
-    SAMRAI::tbox::Pointer<SAMRAI::hier::VariableContext> getOldContext() const;
-
-    /*!
-     * Return pointer to "scratch" variable context used by
-     * integrator.  Scratch data typically corresponds to storage that
-     * user-routines in the concrete GodunovAdvector object
-     * manipulate; in particular, scratch data contains ghost cells.
-     */
-    SAMRAI::tbox::Pointer<SAMRAI::hier::VariableContext> getScratchContext() const;
-
-    /*!
-     * Return pointer to variable context used for plotting.  This
-     * context corresponds to the data storage that should be written
-     * to plot files.  Typically, this is the same as the "current"
-     * context.
-     */
-    SAMRAI::tbox::Pointer<SAMRAI::hier::VariableContext> getPlotContext() const;
-
-    ///
-    ///  The following routines:
-    ///
-    ///      putToDatabase()
-    ///
-    ///  are concrete implementations of functions declared in the
-    ///  SAMRAI::tbox::Serializable abstract base class.
-    ///
-
-    /*!
-     * Write out object state to the given database.
-     *
-     * When assertion checking is active, database pointer must be
-     * non-null.
-     */
-    virtual void putToDatabase(
-        SAMRAI::tbox::Pointer<SAMRAI::tbox::Database> db);
-
-    ///
-    ///  The following routines:
-    ///
-    ///      printClassData()
-    ///
-    ///  are provided for your viewing pleasure.
-    ///
-
-    /*!
-     * Print all data members for IBHierarchyIntegrator
-     * class.
-     */
-    virtual void printClassData(
-        ostream& os) const;
-
-private:
-    /*!
-     * @brief Default constructor.
-     *
-     * NOTE: This constructor is not implemented and should not be
-     * used.
-     */
-    IBHierarchyIntegrator();
-
-    /*!
-     * @brief Copy constructor.
-     *
-     * NOTE: This constructor is not implemented and should not be
-     * used.
-     *
-     * @param from The value to copy to this object.
-     */
-    IBHierarchyIntegrator(
-        const IBHierarchyIntegrator& from);
-
-    /*!
-     * @brief Assignment operator.
-     *
-     * NOTE: This operator is not implemented and should not be used.
-     *
-     * @param that The value to assign to this object.
-     *
-     * @return A reference to this object.
-     */
-    IBHierarchyIntegrator& operator=(
-        const IBHierarchyIntegrator& that);
-
-    /*!
-     * Initialize the IBLagrangianForceStrategy object for the current
-     * configuration of the curvilinear mesh.
-     */
-    void resetLagrangianForceStrategy(
-        const double init_data_time,
-        const bool initial_time);
-
-    /*!
-     * Initialize the IBLagrangianSourceStrategy object for the
-     * current configuration of the curvilinear mesh.
-     */
-    void resetLagrangianSourceStrategy(
-        const double init_data_time,
-        const bool initial_time);
-
-    /*!
-     * Read input values, indicated above, from given database.  The
-     * boolean argument is_from_restart should be set to true if the
-     * simulation is beginning from restart.  Otherwise it should be
-     * set to false.
-     *
-     * When assertion checking is active, the database pointer must be
-     * non-null.  Otherwise, all your base are belong to us.
-     */
-    void getFromInput(
-        SAMRAI::tbox::Pointer<SAMRAI::tbox::Database> db,
-        bool is_from_restart);
-
-    /*!
-     * Read object state from the restart file and initialize class
-     * data members.  The database from which the restart data is read
-     * is determined by the object_name specified in the constructor.
-     *
-     * Unrecoverable Errors:
-     *
-     *    -   The database corresponding to object_name is not found
-     *        in the restart file.
-     *
-     *    -   The class version number and restart version number do not
-     *        match.
-     *
-     */
-    void getFromRestart();
-
-    /*
-     * The object name is used as a handle to databases stored in
-     * restart files and for error reporting purposes.  The boolean is
-     * used to control restart file writing operations.
-     */
-    std::string d_object_name;
-    bool d_registered_for_restart;
-
-    /*
-     * Pointers to the patch hierarchy and gridding algorithm objects
-     * associated with this time integration object.
-     *
-     * The gridding algorithm provides grid generation and regridding
-     * routines for the AMR hierarchy.
-     */
-    SAMRAI::tbox::Pointer<SAMRAI::hier::PatchHierarchy<NDIM> > d_hierarchy;
-    SAMRAI::tbox::Pointer<SAMRAI::mesh::GriddingAlgorithm<NDIM> > d_gridding_alg;
-
-    /*
-     * We cache a pointer to the VisIt and Silo data writers to
-     * register plot variables.
-     */
-    SAMRAI::tbox::Pointer<SAMRAI::appu::VisItDataWriter<NDIM> > d_visit_writer;
-    SAMRAI::tbox::Pointer<LagSiloDataWriter> d_silo_writer;
-
-    /*
-     * We cache a pointer to the load balancer.
-     */
-    SAMRAI::tbox::Pointer<SAMRAI::mesh::LoadBalancer<NDIM> > d_load_balancer;
-
-    /*
-     * The INSHierarchyIntegrator is used to provide time integration
-     * capabilitiy for the incompressible Navier-Stokes equations.
-     */
-    SAMRAI::tbox::Pointer<INSHierarchyIntegrator> d_ins_hier_integrator;
-
-    /*
-     * The LDataManager is used to coordinate the distribution of
-     * Lagrangian data on the patch hierarchy.
-     */
-    LDataManager* d_lag_data_manager;
-
-    /*
-     * The specification and initialization information for the
-     * Lagrangian data used by the integrator.
-     */
-    SAMRAI::tbox::Pointer<LNodePosnInitStrategy> d_lag_posn_init;
-
-    /*
-     * The force generators.
-     */
-    SAMRAI::tbox::Pointer<SetDataStrategy> d_body_force_set;
-    SAMRAI::tbox::Pointer<IBEulerianForceSetter> d_eulerian_force_set;
-    SAMRAI::tbox::Pointer<IBLagrangianForceStrategy> d_force_strategy;
-    bool d_force_strategy_needs_init;
-
-    /*
-     * The source/sink generators.
-     */
-    SAMRAI::tbox::Pointer<IBEulerianSourceSetter> d_eulerian_source_set;
-    SAMRAI::tbox::Pointer<IBLagrangianSourceStrategy> d_source_strategy;
-    bool d_source_strategy_needs_init;
-
-    /*
-     * The name of the discrete delta function to employ for
-     * interpolation and spreading.
-     */
-    std::string d_delta_fcn;
-    SAMRAI::hier::IntVector<NDIM> d_ghosts;
-
-    /*
-     * Integrator data read from input or set at initialization.
-     */
-    double d_start_time;
-    double d_end_time;
-    double d_grow_dt;
-    int d_max_integrator_steps;
-
-    /*
-     * The number of initial cycles to perform each timestep.
-     */
-    int d_num_cycles;
-
-    /*
-     * The number of initial cycles to perform in order to obtain a
-     * sufficiently accurate guess for P(n=1/2).
-     */
-    int d_num_init_cycles;
-
-    /*
-     * The regrid interval indicates the number of integration steps
-     * taken between invocations of the regridding process.
-     */
-    int d_regrid_interval;
-
-    /*
-     * Integrator data that evolves during time integration and
-     * maintains the state of the timestep sequence over the levels in
-     * the AMR hierarchy.
-     */
-    double d_old_dt;
-    double d_integrator_time;
-    int    d_integrator_step;
-
-    /*
-     * A maximum timestep constraint over the specified time interval.
-     */
-    double d_dt_max;
-    double d_dt_max_time_max;
-    double d_dt_max_time_min;
-
-    /*
-     * Indicates whether the integrator has been initialized.
-     */
-    bool d_is_initialized;
-
-    /*
-     * Indicates whether the integrator should output logging
-     * messages.
-     */
-    bool d_do_log;
-
-    /*
-     * Communications algorithms and schedules.
-     */
-    RefineAlgMap    d_ralgs;
-    RefineSchedMap  d_rscheds;
-
-    CoarsenAlgMap   d_calgs;
-    CoarsenSchedMap d_cscheds;
-
-    SAMRAI::tbox::Pointer<SAMRAI::xfer::RefineAlgorithm<NDIM> > d_force_ralg;
-    std::vector<SAMRAI::tbox::Pointer<SAMRAI::xfer::RefineSchedule<NDIM> > > d_force_rscheds;
-
-    /*
-     * Hierarchy operations objects.
-     */
-    SAMRAI::tbox::Pointer<SAMRAI::math::HierarchyCellDataOpsReal<NDIM,double> > d_hier_cc_data_ops;
-
-    /*
-     * Variables and variable contexts.
-     */
-    SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM,double> > d_V_var, d_W_var;
-    SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM,double> > d_F_var;
-    SAMRAI::tbox::Pointer<SAMRAI::pdat::CellVariable<NDIM,double> > d_P_var, d_Q_var;
-    SAMRAI::tbox::Pointer<SAMRAI::hier::VariableContext> d_current, d_scratch;
-    int d_V_idx, d_W_idx, d_F_idx, d_F_scratch1_idx, d_F_scratch2_idx, d_P_idx, d_Q_idx;
-};
-}// namespace IBAMR
-
-/////////////////////////////// INLINE ///////////////////////////////////////
-
-//#include <ibamr/IBHierarchyIntegrator.I>
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif //#ifndef included_IBHierarchyIntegrator


samples: drivers: eeprom: remove needless null pointer check

This commit removes a superfluous null pointer check.
The device is accessed via a label.
so in case it is not available a build error arises,
but the pointer won't ever be null.

Signed-off-by: Thomas Stranger <289fb7da2789c69f49f06a4b4e006530cf91f1de@outlook.com>

--- samples/drivers/eeprom/src/main.c
+++ samples/drivers/eeprom/src/main.c
@@ -23,11 +23,6 @@
 static const struct device *get_eeprom_device(void)
 {
 	const struct device *dev = DEVICE_DT_GET(DT_ALIAS(eeprom_0));
-
-	if (dev == NULL) {
-		printk("\nError: EEPROM with alias eeprom_0 not found.\n");
-		return NULL;
-	}

 	if (!device_is_ready(dev)) {
 		printk("\nError: Device \"%s\" is not ready; "


Update MQController.h

Update MQController.h

--- MQWeb/include/MQ/Web/MQController.h
+++ MQWeb/include/MQ/Web/MQController.h
@@ -96,7 +96,7 @@

 inline QueueManager::Ptr MQController::qmgr()
 {
-	return _qmgrPoolGuard->getObject()->getObject();
+	return _qmgrPoolGuard->getObject();
 }


fgddfg

fgddfg

--- src/math/transform/coTransform_f.h
+++ src/math/transform/coTransform_f.h
@@ -57,6 +57,30 @@
 	r.translation = coRotateVector(_b.rotation, _a.translation * _b.scale) + _b.translation;
 	return r;
 }
+
+coFORCE_INLINE coTransform coScale(const coTransform& a, const coVec3& v)
+{
+	coTransform r(a);
+	r.scale *= v;
+	r.translation *= v;
+	return r;
+}
+
+coFORCE_INLINE coTransform coTranslate(const coTransform& a, const coVec3& v)
+{
+	coTransform r(a);
+	r.translation += v;
+	return r;
+}
+coFORCE_INLINE coTransform coRotate(const coTransform& a, const coQuat& v)
+{
+	coTransform r(nullptr);
+	r.rotation = v * a.rotation;
+	r.scale = a.scale;
+	r.translation = coRotateVector(v, a.translation);
+	return r;
+}
+
 coFORCE_INLINE coTransform coNormalize(const coTransform& _this)
 {
 	coTransform r(_this);


i965: Delete fs_visitor::nir_setup_single_output_varying prototype.

I deleted this function in 59864e8e02057cc6fa0448a8af067a3cf53389da.

Signed-off-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>

--- src/mesa/drivers/dri/i965/brw_fs.h
+++ src/mesa/drivers/dri/i965/brw_fs.h
@@ -190,8 +190,6 @@
    bool opt_zero_samples();

    void emit_nir_code();
-   void nir_setup_single_output_varying(fs_reg *reg, const glsl_type *type,
-                                        unsigned *location);
    void nir_setup_outputs();
    void nir_setup_uniforms();
    void nir_emit_system_values();


i965: Fill out the rest of brw_debug_recompile_sampler_key().

This makes INTEL_DEBUG=perf report shader recompiles due to CMS vs.
UMS/IMS differences and Sandybridge textureGather workarounds.

Previously, we just flagged them as "Something else".

Signed-off-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>
Reviewed-by: Topi Pohjolainen <749697f19798b7f640b17221fd283b903825f071@intel.com>

--- src/mesa/drivers/dri/i965/brw_wm.c
+++ src/mesa/drivers/dri/i965/brw_wm.c
@@ -266,6 +266,14 @@
                       old_key->gl_clamp_mask[2], key->gl_clamp_mask[2]);
    found |= key_debug(brw, "gather channel quirk on any texture unit",
                       old_key->gather_channel_quirk_mask, key->gather_channel_quirk_mask);
+   found |= key_debug(brw, "compressed multisample layout",
+                      old_key->compressed_multisample_layout_mask,
+                      key->compressed_multisample_layout_mask);
+
+   for (unsigned int i = 0; i < MAX_SAMPLERS; i++) {
+      found |= key_debug(brw, "textureGather workarounds",
+                         old_key->gen6_gather_wa[i], key->gen6_gather_wa[i]);
+   }

    return found;
 }


roll back the parameter check of AsyncInterruptTransfer() and SyncInterruptTransfer() of Usb2HcProtocol to follow current uefi spec.
current uefi spec only supports interrupt in endpoint.
but there are usb devices which support interrupt out endpoint. we propose to update uefi spec to remove the limitation. after the ecr is approved, the corresponding patch will be submitted.

git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@10205 6f19259b-4bc3-4df7-8a09-765794883524

--- MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
+++ MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
@@ -969,8 +969,7 @@
   //
   // Validate parameters
   //
-  if (!(EndPointAddress >= 0x01 && EndPointAddress <= 0x0F)
-    && !(EndPointAddress >= 0x81 && EndPointAddress <= 0x8F)) {
+  if (!EHCI_IS_DATAIN (EndPointAddress)) {
     return EFI_INVALID_PARAMETER;
   }

@@ -1119,8 +1118,7 @@
     return EFI_INVALID_PARAMETER;
   }

-  if (!(EndPointAddress >= 0x01 && EndPointAddress <= 0x0F)
-    && !(EndPointAddress >= 0x81 && EndPointAddress <= 0x8F)) {
+  if (!EHCI_IS_DATAIN (EndPointAddress)) {
     return EFI_INVALID_PARAMETER;
   }


First pass at implementing structure compares.

Need to improve this.  There may be holes in a structure so we can't
just blindly compare the full 4-float registers.

--- src/mesa/shader/slang/slang_emit.c
+++ src/mesa/shader/slang/slang_emit.c
@@ -778,8 +778,11 @@
 emit_compare(slang_emit_info *emitInfo, slang_ir_node *n)
 {
    struct prog_instruction *inst;
+   gl_inst_opcode opcode;

    assert(n->Opcode == IR_SEQUAL || n->Opcode == IR_SNEQUAL);
+
+   opcode = n->Opcode == IR_SEQUAL ? OPCODE_SEQ : OPCODE_SNE;

    /* gen code for children */
    emit(emitInfo, n->Children[0]);
@@ -787,16 +790,36 @@

    assert(n->Children[0]->Store->Size == n->Children[1]->Store->Size);

-   /* gen this instruction and src registers */
-   inst = new_instruction(emitInfo,
-                          (n->Opcode == IR_SEQUAL) ? OPCODE_SEQ : OPCODE_SNE);
+   if (!n->Store) {
+      if (!alloc_temp_storage(emitInfo, n, 1))  /* 1 bool */
+         return NULL;
+   }
+
    if (n->Children[0]->Store->Size > 4) {
       /* struct compare */
-      _mesa_problem(NULL, "struct compare not implemented!");
-      return NULL;
+      GLint i, num = (n->Children[0]->Store->Size + 3) / 4;
+
+      /*printf("BEGIN COMPARE size %d\n", num);*/
+      for (i = 0; i < num; i++) {
+         inst = new_instruction(emitInfo, opcode);
+         inst->SrcReg[0].File = n->Children[0]->Store->File;
+         inst->SrcReg[0].Index = n->Children[0]->Store->Index + i;
+         inst->SrcReg[1].File = n->Children[1]->Store->File;
+         inst->SrcReg[1].Index = n->Children[1]->Store->Index + i;
+         inst->DstReg.File = n->Store->File;
+         inst->DstReg.Index = n->Store->Index;
+         if (i == 0) {
+            inst->CondUpdate = 1; /* update cond code */
+         }
+         else {
+            inst->DstReg.CondMask = COND_NE; /* update if !=0 */
+         }
+         /*_mesa_print_instruction(inst);*/
+      }
    }
    else {
       /* small/simple types */
+      inst = new_instruction(emitInfo, opcode);
       storage_to_src_reg(&inst->SrcReg[0], n->Children[0]->Store);
       storage_to_src_reg(&inst->SrcReg[1], n->Children[1]->Store);
    }
@@ -806,10 +829,6 @@
    free_temp_storage(emitInfo->vt, n->Children[1]);

    /* result storage */
-   if (!n->Store) {
-      if (!alloc_temp_storage(emitInfo, n, 1))  /* 1 bool */
-         return NULL;
-   }
    storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask);

    return inst;


Don't pad renderbuffers to multiple of two pixels anymore.

This was only needed to avoid out-of-bounds memory accesses with the
2x2 quad_read/write() functions which no longer exist.

--- src/mesa/state_tracker/st_cb_fbo.c
+++ src/mesa/state_tracker/st_cb_fbo.c
@@ -64,7 +64,6 @@
    const struct pipe_format_info *info = st_get_format_info(pipeFormat);
    GLuint cpp;
    GLbitfield flags = PIPE_SURFACE_FLAG_RENDER; /* want to render to surface */
-   GLuint width2, height2;

    assert(info);
    if (!info)
@@ -99,11 +98,7 @@
       pipe->region_release(pipe, &strb->surface->region);
    }

-   /* Softpipe operates on quads, so pad dimensions to multiples of 2 */
-   width2 = (width + 1) & ~1;
-   height2 = (height + 1) & ~1;
-
-   strb->surface->region = pipe->region_alloc(pipe, cpp, width2, height2, flags);
+   strb->surface->region = pipe->region_alloc(pipe, cpp, width, height, flags);
    if (!strb->surface->region)
       return GL_FALSE; /* out of memory, try s/w buffer? */


admin state uses cw_out_radio_generic

admin state uses cw_out_radio_generic

FossilOrigin-Name: 2487e0e0c8f2926ad135ff29ecac93a34294f85452925da99f1bc108db45209d

--- src/mod/capwap/capwap_actions_ac.c
+++ src/mod/capwap/capwap_actions_ac.c
@@ -754,8 +754,9 @@
 		.msg_id = CW_MSG_CONFIGURATION_UPDATE_REQUEST,
 		.elem_id = CW_ELEM_RADIO_ADMINISTRATIVE_STATE,
 		.item_id = CW_RADIOITEM_ADMIN_STATE,
-	 	.out = cw_out_radio_administrative_states,
-		.get = cw_out_get_outgoing,
+//	 	.out = cw_out_radio_administrative_states,
+//		.get = cw_out_get_outgoing,
+		.out = cw_out_radio_generic,
 		.mand = 0
 	}
 	,


ensure lyrics panel gets hidden when escaping from music player

--- src/modules/activity/music/music.c
+++ src/modules/activity/music/music.c
@@ -342,6 +342,7 @@
 	enna_mediaplayer_default_seek_forward ();
 	break;
     case ENNA_KEY_CANCEL:
+        panel_lyrics_display (0);
 	ENNA_TIMER_DEL(mod->timer_show_mediaplayer);
 	mod->timer_show_mediaplayer = ecore_timer_add(TIMER_VALUE,_show_mediaplayer_cb, NULL);
 	edje_object_signal_emit(mod->o_edje, "mediaplayer,hide","enna");


Don't expand list.

Don't expand list.

SVN revision: 46662

--- src/modules/battery/e_mod_config.c
+++ src/modules/battery/e_mod_config.c
@@ -25,7 +25,7 @@
 {
    E_Config_Dialog *cfd;
    E_Config_Dialog_View *v;
-   char buf[4096];
+   char buf[PATH_MAX];

    v = E_NEW(E_Config_Dialog_View, 1);
    v->create_cfdata = _create_data;
@@ -94,7 +94,7 @@
    ob = e_widget_check_add(evas, _("Show alert when battery is low"),
                            &(cfdata->show_alert));
    e_widget_framelist_object_append(of, ob);
-   e_widget_list_object_append(o, of, 1, 1, 0.5);
+   e_widget_list_object_append(o, of, 1, 0, 0.5);
    return o;
 }

@@ -130,7 +130,7 @@
    Evas_Object *o, *ob, *otb;
    E_Radio_Group *rg;

-   otb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
+   otb = e_widget_toolbook_add(evas, (48 * e_scale), (48 * e_scale));

    /* Use Sliders for both cfg options */
    o = e_widget_table_add(evas, 0);


evry_util_plugin_items_add: let plugin decide minimum input

SVN revision: 48974

--- src/modules/everything/evry_util.c
+++ src/modules/everything/evry_util.c
@@ -365,6 +365,16 @@

    EINA_LIST_FOREACH(items, l, it)
      {
+	if (!input)
+	  {
+	     p->items = eina_list_append(p->items, it);
+
+	     if (set_usage)
+	       evry_history_item_usage_set(it, NULL, NULL);
+
+	     continue;
+	  }
+
 	it->fuzzy_match = evry_fuzzy_match(it->label, input);

 	if (match_detail)


issue certificates valid starting 5 minutes in the past to account for possible clock skew between hosts

--- certauth_extensions.c
+++ certauth_extensions.c
@@ -554,7 +554,7 @@

   myproxy_debug("cert lifetime: %d", not_after );

-  X509_gmtime_adj(X509_get_notBefore(cert), 0);
+  X509_gmtime_adj(X509_get_notBefore(cert), -5*60); /* allow 5m clock skew */
   X509_gmtime_adj(X509_get_notAfter(cert), (long)not_after);

   X509_set_pubkey(cert, pkey);


producer_pixbuf.c: bugfix image sequences

git-svn-id: 5ee9a2a761147e4d9fa32565ef7949b666b061d3@1108 d19143bc-622f-0410-bfdd-b5b2a6649095

--- src/modules/gtk2/producer_pixbuf.c
+++ src/modules/gtk2/producer_pixbuf.c
@@ -417,7 +417,7 @@
 				if ( stat( full, &buf ) == 0 )
 				{
 					sprintf( key, "%d", keyvalue ++ );
-					mlt_properties_set( this->filenames, "0", full );
+					mlt_properties_set( this->filenames, key, full );
 					gap = 0;
 				}
 				else


Setup v8::MicrotasksScope for callbacks

Setup v8::MicrotasksScope for callbacks

--- native_mate/function_template.h
+++ native_mate/function_template.h
@@ -185,6 +185,8 @@

   template <typename ReturnType>
   void DispatchToCallback(base::Callback<ReturnType(ArgTypes...)> callback) {
+    v8::MicrotasksScope script_scope(
+        args_->isolate(), v8::MicrotasksScope::kRunMicrotasks);
     args_->Return(callback.Run(ArgumentHolder<indices, ArgTypes>::value...));
   }

@@ -192,6 +194,8 @@
   // expression to foo. As a result, we must specialize the case of Callbacks
   // that have the void return type.
   void DispatchToCallback(base::Callback<void(ArgTypes...)> callback) {
+    v8::MicrotasksScope script_scope(
+        args_->isolate(), v8::MicrotasksScope::kRunMicrotasks);
     callback.Run(ArgumentHolder<indices, ArgTypes>::value...);
   }


fixed compilation with tracing enabled

fixed compilation with tracing enabled

--- src/mongoc/mongoc-client-session.c
+++ src/mongoc/mongoc-client-session.c
@@ -260,7 +260,7 @@
    timeout_usec =
       server_session->last_used_usec + session_timeout_minutes * minute_to_usec;

-   RETURN (timeout_usec - bson_get_monotonic_time ()) < 1 * minute_to_usec;
+   RETURN (timeout_usec - bson_get_monotonic_time () < 1 * minute_to_usec);
 }


nodedev: dont rely on ignoring errors on missing properties

The udevProcessStorage method relies on udevGetIntProperty ignoring
errors about non-existant properties and instead setting the value to
zero. In theory when seeing ID_CDROM=1, you might expect that devices
which are not CDs will get ID_CDROM=0, but that's not what happens in
practice. Instead the property simply won't get set at all.

IOW, the code does not need to care about the value of the property,
merely whether it exists or not.

Reviewed-by: Laine Stump <c23361c43fbf79fed83e8b76173707b083d6caf5@redhat.com>
Signed-off-by: Daniel P. Berrangé <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com>

--- src/node_device/node_device_udev.c
+++ src/node_device/node_device_udev.c
@@ -962,37 +962,16 @@

     if (!storage->drive_type ||
         STREQ(def->caps->data.storage.drive_type, "generic")) {
-        int val = 0;
-        const char *str = NULL;
-
         /* All floppy drives have the ID_DRIVE_FLOPPY prop. This is
          * needed since legacy floppies don't have a drive_type */
-        if (udevGetIntProperty(device, "ID_DRIVE_FLOPPY", &val, 0) < 0)
+        if (udevHasDeviceProperty(device, "ID_DRIVE_FLOPPY"))
+            storage->drive_type = g_strdup("floppy");
+        else if (udevHasDeviceProperty(device, "ID_CDROM"))
+            storage->drive_type = g_strdup("cd");
+        else if (udevHasDeviceProperty(device, "ID_DRIVE_FLASH_SD"))
+            storage->drive_type = g_strdup("sd");
+        else if (udevKludgeStorageType(def) != 0)
             goto cleanup;
-        else if (val == 1)
-            str = "floppy";
-
-        if (!str) {
-            if (udevGetIntProperty(device, "ID_CDROM", &val, 0) < 0)
-                goto cleanup;
-            else if (val == 1)
-                str = "cd";
-        }
-
-        if (!str) {
-            if (udevGetIntProperty(device, "ID_DRIVE_FLASH_SD", &val, 0) < 0)
-                goto cleanup;
-            if (val == 1)
-                str = "sd";
-        }
-
-        if (str) {
-            storage->drive_type = g_strdup(str);
-        } else {
-            /* If udev doesn't have it, perhaps we can guess it. */
-            if (udevKludgeStorageType(def) != 0)
-                goto cleanup;
-        }
     }

     if (STREQ(def->caps->data.storage.drive_type, "cd")) {


nodedev: Mark device initialization complete even in case of an error

To speed up nodedev driver initialization, the device enumeration
is done in a separate thread. Once finished, the thread sets a
boolean variable that allows public APIs to be called (instead of
waiting for the thread to finish).

However, if there's an error in the device enumeration thread
then the control jumps over at the 'error' label and the boolean
is never set. This means, that any virNodeDev*() API is stuck
forever. Mark the initialization as complete (the thread is
quitting anyway) and let the APIs proceed.

Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>
Reviewed-by: Erik Skultety <2c14d38fa47c8799f1b9c16280abe27f8edfec6e@redhat.com>

--- src/node_device/node_device_udev.c
+++ src/node_device/node_device_udev.c
@@ -1982,6 +1982,7 @@
     if (nodeDeviceUpdateMediatedDevices() != 0)
         goto error;

+ cleanup:
     nodeDeviceLock();
     driver->initialized = true;
     virCondBroadcast(&driver->initCond);
@@ -1996,6 +1997,8 @@
     priv->threadQuit = true;
     virCondSignal(&priv->threadCond);
     virObjectUnlock(priv);
+
+    goto cleanup;
 }


Free resources on error in udev startup

Free resources on error in udev startup

* The udev driver didn't properly free resources that it allocates when setting up the 'computer' device in the error case.

--- src/node_device/node_device_udev.c
+++ src/node_device/node_device_udev.c
@@ -1440,33 +1440,15 @@
 }

-static int udevSetupSystemDev(void)
-{
-    virNodeDeviceDefPtr def = NULL;
-    virNodeDeviceObjPtr dev = NULL;
+static void
+udevGetDMIData(union _virNodeDevCapData *data)
+{
     struct udev *udev = NULL;
     struct udev_device *device = NULL;
-    union _virNodeDevCapData *data = NULL;
     char *tmp = NULL;
-    int ret = -1;
-
-    if (VIR_ALLOC(def) != 0) {
-        virReportOOMError();
-        goto out;
-    }
-
-    def->name = strdup("computer");
-    if (def->name == NULL) {
-        virReportOOMError();
-        goto out;
-    }
-
-    if (VIR_ALLOC(def->caps) != 0) {
-        virReportOOMError();
-        goto out;
-    }

     udev = udev_monitor_get_udev(DRV_STATE_UDEV_MONITOR(driverState));
+
     device = udev_device_new_from_syspath(udev, DMI_DEVPATH);
     if (device == NULL) {
         device = udev_device_new_from_syspath(udev, DMI_DEVPATH_FALLBACK);
@@ -1477,8 +1459,6 @@
         }
     }

-    data = &def->caps->data;
-
     if (udevGetStringSysfsAttr(device,
                                "product_name",
                                &data->system.product_name) == PROPERTY_ERROR) {
@@ -1508,8 +1488,7 @@
                                &tmp) == PROPERTY_ERROR) {
         goto out;
     }
-    virUUIDParse(tmp, def->caps->data.system.hardware.uuid);
-    VIR_FREE(tmp);
+    virUUIDParse(tmp, data->system.hardware.uuid);

     if (udevGetStringSysfsAttr(device,
                                "bios_vendor",
@@ -1530,20 +1509,54 @@
         goto out;
     }

-    udev_device_unref(device);
+out:
+    VIR_FREE(tmp);
+    if (device != NULL) {
+        udev_device_unref(device);
+    }
+    return;
+}
+
+
+static int udevSetupSystemDev(void)
+{
+    virNodeDeviceDefPtr def = NULL;
+    virNodeDeviceObjPtr dev = NULL;
+    int ret = -1;
+
+    if (VIR_ALLOC(def) != 0) {
+        virReportOOMError();
+        goto out;
+    }
+
+    def->name = strdup("computer");
+    if (def->name == NULL) {
+        virReportOOMError();
+        goto out;
+    }
+
+    if (VIR_ALLOC(def->caps) != 0) {
+        virReportOOMError();
+        goto out;
+    }
+
+    udevGetDMIData(&def->caps->data);

     dev = virNodeDeviceAssignDef(&driverState->devs, def);
     if (dev == NULL) {
         VIR_ERROR("Failed to create device for '%s'", def->name);
+        goto out;
+    }
+
+    virNodeDeviceObjUnlock(dev);
+
+    ret = 0;
+
+out:
+    if (ret == -1) {
         virNodeDeviceDefFree(def);
-        goto out;
-    }
-
-    virNodeDeviceObjUnlock(dev);
-
-    ret = 0;
-
-out:
+    }
+
     return ret;
 }


Promoted _setRenderTarget from the OpenGL render system.

--HG--
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/trunk%40667

--- OgreMain/include/OgreRenderSystem.h
+++ OgreMain/include/OgreRenderSystem.h
@@ -1153,6 +1153,11 @@
 			mDerivedDepthBiasSlopeScale = slopeScale;
 		}

+		/**
+         * Set current render target to target, enabling its GL context if needed
+         */
+        virtual void _setRenderTarget(RenderTarget *target) = 0;
+
 		/** Defines a listener on the custom events that this render system
 		can raise.
 		@see RenderSystem::addListener


batman-adv: use unregister_netdevice() when softif_create fails

When entering softif_create(), the rtnl lock has already been acquired
by store_mesh_iface().
(store_mesh_iface() -> hardif_enable_interface() -> softif_create)

In case of an error, we should therefore call unregister_netdevice()
instead of unregister_netdev().

unregister_netdev() tries to acquire the rtnl lock itself and deadlocks
in this situation. unregister_netdevice() assumes that the rtnl lock
is already been held.

Signed-off-by: Simon Wunderlich <ee8cb2fe367357431f9fb32cc761adf92c257cce@hrz.tu-chemnitz.de>
Signed-off-by: Sven Eckelmann <dd860110a62b19214c4ee03aec0abffecb4e86b8@narfation.org>

--- net/batman-adv/soft-interface.c
+++ net/batman-adv/soft-interface.c
@@ -874,7 +874,7 @@
 unreg_sysfs:
 	sysfs_del_meshif(soft_iface);
 unreg_soft_iface:
-	unregister_netdev(soft_iface);
+	unregister_netdevice(soft_iface);
 	return NULL;

 free_soft_iface:


batman-adv: encourage batman to take shorter routes by changing the default hop penalty

Signed-off-by: Marek Lindner <104240d543ffdbcddd3f116d866dc6166bffcd7a@yahoo.de>
Signed-off-by: Antonio Quartulli <ed91ce0fd2670d4a98b12fc9ec6b7a497c7ed53f@autistici.org>

--- net/batman-adv/soft-interface.c
+++ net/batman-adv/soft-interface.c
@@ -834,7 +834,7 @@
 	atomic_set(&bat_priv->gw_sel_class, 20);
 	atomic_set(&bat_priv->gw_bandwidth, 41);
 	atomic_set(&bat_priv->orig_interval, 1000);
-	atomic_set(&bat_priv->hop_penalty, 10);
+	atomic_set(&bat_priv->hop_penalty, 30);
 	atomic_set(&bat_priv->log_level, 0);
 	atomic_set(&bat_priv->fragmentation, 1);
 	atomic_set(&bat_priv->bcast_queue_left, BCAST_QUEUE_LEN);


Just changing to assign

Just changing to assign

--- quickdialog/QuickDialogTableView.h
+++ quickdialog/QuickDialogTableView.h
@@ -35,7 +35,7 @@

 @property(nonatomic, readonly) QuickDialogController *controller;

-@property(nonatomic, unsafe_unretained) NSObject<QuickDialogStyleProvider> *styleProvider;
+@property(nonatomic, assign) NSObject<QuickDialogStyleProvider> *styleProvider;
 @property(nonatomic) BOOL deselectRowWhenViewAppears;


[NETFILTER]: ebtables: don't compute gap before checking struct type

We cannot compute the gap until we know we have a 'struct ebt_entry' and
not 'struct ebt_entries'.  Failure to check can cause crash.

Tested-by: Santiago Garcia Mantinan <340a1faa95ae9427d9248b6f5fc3d1cd599bc82b@manty.net>
Acked-by: Al Viro <de609eb4d5d70b1d38ec6642adbfc33a2781f63c@zeniv.linux.org.uk>
Signed-off-by: Chuck Ebbert <b951995537429da8a77f77b3db331e2f955ae5e8@compuserve.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Patrick McHardy <3a4d625ce225e891399f98db96a382ac4a84080b@trash.net>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- net/bridge/netfilter/ebtables.c
+++ net/bridge/netfilter/ebtables.c
@@ -610,7 +610,7 @@
 	struct ebt_entry_target *t;
 	struct ebt_target *target;
 	unsigned int i, j, hook = 0, hookmask = 0;
-	size_t gap = e->next_offset - e->target_offset;
+	size_t gap;
 	int ret;

 	/* don't mess with the struct ebt_entries */
@@ -660,6 +660,7 @@
 	if (ret != 0)
 		goto cleanup_watchers;
 	t = (struct ebt_entry_target *)(((char *)e) + e->target_offset);
+	gap = e->next_offset - e->target_offset;
 	target = find_target_lock(t->u.name, &ret, &ebt_mutex);
 	if (!target)
 		goto cleanup_watchers;


Oops - wasn't setting GATT tx time.

Oops - wasn't setting GATT tx time.

--- net/nimble/host/src/ble_gattc.c
+++ net/nimble/host/src/ble_gattc.c
@@ -279,6 +279,7 @@
     ble_gattc_entry_remove(entry, prev);
     entry->flags &= ~BLE_GATT_ENTRY_F_PENDING;
     entry->flags |= BLE_GATT_ENTRY_F_EXPECTING;
+    entry->tx_time = os_time_get();
     STAILQ_INSERT_TAIL(&ble_gattc_list, entry, next);
 }

@@ -337,7 +338,6 @@
             }
         } else if (entry->flags & BLE_GATT_ENTRY_F_EXPECTING) {
             if (now - entry->tx_time >= BLE_GATT_UNRESPONSIVE_TIMEOUT) {
-                /* XXX: Disconnect. */
                 rc = ble_gap_conn_terminate(entry->conn_handle);
                 assert(rc == 0); /* XXX */
             }


Compile fix for OpenGL/ES 1.1 systems

Compile fix for OpenGL/ES 1.1 systems

Reviewed-by: trustme

--- src/opengl/qpaintengine_opengl_p.h
+++ src/opengl/qpaintengine_opengl_p.h
@@ -58,6 +58,7 @@
 QT_BEGIN_NAMESPACE

 class QOpenGLPaintEnginePrivate;
+class QGLTexture;

 class QOpenGLPaintEngineState : public QPainterState
 {


energy

energy

--- PWGGA/EMCALTasks/AliEmcalParticle.h
+++ PWGGA/EMCALTasks/AliEmcalParticle.h
@@ -30,7 +30,7 @@
   Double_t          OneOverPt() const { return 1./fPt; }
   Double_t          Phi()       const { return fPhi; }
   Double_t          Theta()     const { return 0.; }
-  Double_t          E()         const { if (fTrack) return fTrack->M(); return fCluster->E(); }
+  Double_t          E()         const { if (fTrack) return fTrack->E(); return fCluster->E(); }
   Double_t          M()         const { if (fTrack) return fTrack->M(); return 0; }
   Double_t          Eta()       const { return fEta; }
   Double_t          Y()         const { if (fTrack) return fTrack->Y(); return fEta; }


Fixed a typo in njs interactive test.

Fixed a typo in njs interactive test.

--- njs/test/njs_interactive_test.c
+++ njs/test/njs_interactive_test.c
@@ -188,7 +188,7 @@
     { nxt_string("var o = { toString: function() { return [1] } }" ENTER
                  "o" ENTER),
       nxt_string("TypeError\n"
-                 "at main\n") },
+                 "    at main (native)\n") },

 };


+ [TCUPropertyAttributes propertyDictionary] deprecated. + [TCUPropertyAttributes propertyDictionaryOfClass] should be used instead.

--- Pod/Classes/TCUPropertyAttributes.h
+++ Pod/Classes/TCUPropertyAttributes.h
@@ -33,7 +33,7 @@

 @interface NSObject (PropertyDictionary)

-+ (NSDictionary *)propertyDictionary;
++ (NSDictionary *)propertyDictionary __attribute__((deprecated)); // TODO: Should be removed at next major version.
 + (NSDictionary *)propertyDictionaryOfClass;
 + (NSDictionary *)propertyDictionaryOfClassHierarchy;


crypto: fix crypto perf unittest crash

crypto: fix crypto perf unittest crash

Type: fix

crypto perf test crashes for key size different than 16 bytes.
This patch fixes the issue

Signed-off-by: Fan Zhang <b46d470dc79aa6fd718cd24d07380f6203b7fc3c@intel.com>
Change-Id: Ic8a8ca83ca189c879815dc5d065b8c6f7826cd41

--- src/plugins/unittest/crypto_test.c
+++ src/plugins/unittest/crypto_test.c
@@ -268,6 +268,37 @@
   return 0;
 }

+static u32
+test_crypto_get_key_sz (vnet_crypto_alg_t alg)
+{
+  switch (alg)
+    {
+#define _(n, s, l) \
+  case VNET_CRYPTO_ALG_##n: \
+    return l;
+  /* *INDENT-OFF* */
+  foreach_crypto_cipher_alg
+  foreach_crypto_aead_alg
+  /* *INDENT-ON* */
+#undef _
+    case VNET_CRYPTO_ALG_HMAC_MD5:
+    case VNET_CRYPTO_ALG_HMAC_SHA1:
+      return 20;
+    case VNET_CRYPTO_ALG_HMAC_SHA224:
+      return 28;
+    case VNET_CRYPTO_ALG_HMAC_SHA256:
+      return 32;
+    case VNET_CRYPTO_ALG_HMAC_SHA384:
+      return 48;
+    case VNET_CRYPTO_ALG_HMAC_SHA512:
+      return 64;
+    default:
+      return 0;
+    }
+
+  return 0;
+}
+
 static clib_error_t *
 test_crypto_perf (vlib_main_t * vm, crypto_test_main_t * tm)
 {
@@ -320,7 +351,8 @@
   for (i = 0; i < sizeof (key); i++)
     key[i] = i;

-  key_index = vnet_crypto_key_add (vm, tm->alg, key, sizeof (key));
+  key_index = vnet_crypto_key_add (vm, tm->alg, key,
+				   test_crypto_get_key_sz (tm->alg));

   for (i = 0; i < VNET_CRYPTO_OP_N_TYPES; i++)
     {


Update GetProgress.h

Update GetProgress.h

--- src/progress/SsrcEnc/GetProgress.h
+++ src/progress/SsrcEnc/GetProgress.h
@@ -1,20 +1,5 @@
-//
-// BatchEncoder - GetProgress SsrcEnc
-// Copyright (C) 2005-2017 Wiesław Šoltés <wieslaw.soltes@gmail.com>
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program 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 General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
+// Copyright (c) Wiesław Šoltés. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.

 #pragma once


Corrects the header used to import RXTraversal.h.

--- RXCollections/RXIntervalTraversal.h
+++ RXCollections/RXIntervalTraversal.h
@@ -2,7 +2,7 @@
 //  Created by Rob Rix on 2013-03-01.
 //  Copyright (c) 2013 Rob Rix. All rights reserved.

-#import "RXTraversal.h"
+#import <RXCollections/RXTraversal.h>
 #import <float.h>

 #if defined(__LP64__) && __LP64__


runtime/cgo: enable arm64 EXC_BAD_ACCESS handler

Change-Id: I8e912ff9327a4163b63b8c628aa3546e86ddcc02
Reviewed-on: https://go-review.googlesource.com/8983
Reviewed-by: Hyang-Ah Hana Kim <d7e82c3c07f92613bcbf9a1e88f6b96c13caa3b0@gmail.com>

--- src/runtime/cgo/gcc_darwin_arm64.c
+++ src/runtime/cgo/gcc_darwin_arm64.c
@@ -86,6 +86,8 @@
 	ts = *(ThreadStart*)v;
 	free(v);

+	darwin_arm_init_thread_exception_port();
+
 	crosscall1(ts.fn, setg_gcc, (void*)ts.g);
 	return nil;
 }
@@ -148,5 +150,8 @@
 	// yes, tlsbase from mrs might not be correctly aligned.
 	inittls(tlsg, (void**)((uintptr)tlsbase & ~7));

+	darwin_arm_init_mach_exception_handler();
+	darwin_arm_init_thread_exception_port();
+
 	init_working_dir();
 }


Handle cases where the number of pixels is not divisible by 32

--- src/strategies/avx2/picture-avx2.c
+++ src/strategies/avx2/picture-avx2.c
@@ -1076,7 +1076,7 @@

   size_t i;
   __m256i sums = zero;
-  for (i = 0; i < len; i += 32) {
+  for (i = 0; i + 31 < len; i += 32) {
     __m256i curr = _mm256_loadu_si256((const __m256i *)(buf + i));
     __m256i curr_sum = _mm256_sad_epu8(curr, zero);
             sums = _mm256_add_epi64(sums, curr_sum);
@@ -1088,11 +1088,17 @@
   __m128i sum_5  = _mm_add_epi64           (sum_3,  sum_4);

   int64_t sum    = _mm_cvtsi128_si64(sum_5);
+
+  // Remaining len mod 32 pixels
+  for (; i < len; ++i) {
+    sum += buf[i];
+  }
+
   float   mean_f = (float)sum / len_f;
   __m256  mean   = _mm256_set1_ps(mean_f);
   __m256  accum  = _mm256_setzero_ps();

-  for (i = 0; i < len; i += 32) {
+  for (i = 0; i + 31 < len; i += 32) {
     __m128i curr0    = _mm_loadl_epi64((const __m128i *)(buf + i +  0));
     __m128i curr1    = _mm_loadl_epi64((const __m128i *)(buf + i +  8));
     __m128i curr2    = _mm_loadl_epi64((const __m128i *)(buf + i + 16));
@@ -1134,6 +1140,13 @@
   __m256  accum7   = _mm256_add_ps        (accum5, accum6);

   float   var_sum  = _mm256_cvtss_f32     (accum7);
+
+  // Remaining len mod 32 pixels
+  for (; i < len; ++i) {
+    float diff = buf[i] - mean_f;
+    var_sum += diff * diff;
+  }
+
   return  var_sum / len_f;
 }


Rename variables to be less misleading

Rename variables to be less misleading


fixes #770 Assertion in NNG TLS layer

fixes #770 Assertion in NNG TLS layer

--- src/supplemental/tls/mbedtls/tls.c
+++ src/supplemental/tls/mbedtls/tls.c
@@ -412,7 +412,7 @@
 		tp->tcp_closed = true;
 	} else {
 		size_t n = nni_aio_count(aio);
-		NNI_ASSERT(tp->sendlen <= n);
+		NNI_ASSERT(tp->sendlen >= n);
 		tp->sendlen -= n;
 		if (tp->sendlen) {
 			nni_iov iov;


Fix up numarray requirements flags.

Fix up numarray requirements flags.

--- numpy/numarray/numpy/nummacro.h
+++ numpy/numarray/numpy/nummacro.h
@@ -32,10 +32,10 @@
 typedef enum
 {
 	NUM_CONTIGUOUS=1,
-	NUM_NOTSWAPPED=2,
-	NUM_ALIGNED=4,
-	NUM_WRITABLE=8,
-	NUM_COPY=16,
+	NUM_NOTSWAPPED=0x0200,
+	NUM_ALIGNED=0x0100,
+	NUM_WRITABLE=0x0400,
+	NUM_COPY=0x0020,

 	NUM_C_ARRAY  = (NUM_CONTIGUOUS | NUM_ALIGNED | NUM_NOTSWAPPED),
 	NUM_UNCONVERTED = 0


fix iocp object free

fix iocp object free

--- src/tbox/platform/windows/socket.c
+++ src/tbox/platform/windows/socket.c
@@ -625,21 +625,23 @@
     // trace
     tb_trace_d("close: %p", sock);

+    // init poller object
+    tb_poller_object_t object;
+    object.type     = TB_POLLER_OBJECT_SOCK;
+    object.ref.sock = sock;
+
 #ifdef TB_CONFIG_MODULE_HAVE_COROUTINE
     // attempt to cancel waiting from coroutine first
-    tb_poller_object_t object;
     tb_pointer_t scheduler_io = tb_null;
-    object.type     = TB_POLLER_OBJECT_SOCK;
-    object.ref.sock = sock;
 #   ifndef TB_CONFIG_MICRO_ENABLE
     if ((scheduler_io = tb_co_scheduler_io_self()) && tb_co_scheduler_io_cancel((tb_co_scheduler_io_ref_t)scheduler_io, &object)) {}
     else
 #   endif
     if ((scheduler_io = tb_lo_scheduler_io_self()) && tb_lo_scheduler_io_cancel((tb_lo_scheduler_io_ref_t)scheduler_io, &object)) {}
+#endif

     // remove iocp object for this socket if exists
     tb_iocp_object_remove(&object);
-#endif

     // close it
     tb_bool_t ok = !tb_ws2_32()->closesocket(tb_sock2fd(sock))? tb_true : tb_false;


net/lwip: RFC 4861 clause 7.1.1.

net/lwip: RFC 4861 clause 7.1.1.

If src address is unspecified in IPV6 header,
There is no source link layer option header.
But target link layer option is valid for DAD NS message.

RFC 4429 clause 2.2
Never sending Neighbor Solicitations from an Optimistic Address.
NSes include a Source Link-Layer Address Option (SLLAO), which
may cause Neighbor Cache disruption.  NSes sent as part of DAD
are sent from the unspecified address, without a SLLAO.

Change-Id: I54dbeabe75c4a1b1203e23bbea32e56cbcc5ec89
Signed-off-by: jisuu.kim <800dec47d2987cee7cc3d7aee71bc11b56f5042e@samsung.com>

--- os/net/lwip/src/core/ipv6/nd6.c
+++ os/net/lwip/src/core/ipv6/nd6.c
@@ -459,6 +459,16 @@

 		/* Check for ANY address in src (DAD algorithm). */
 		if (ip6_addr_isany(ip6_current_src_addr())) {
+			if ((lladdr_opt != NULL) && (ND6H_LLADDR_OPT_TYPE(lladdr_opt) == ND6_OPTION_TYPE_SOURCE_LLADDR)) {
+				/* RFC 7.1.1.
+				 * If the IP source address is the unspecified address, there is no
+				 * source link-layer address option in the message. */
+				pbuf_free(p);
+				ND6_STATS_INC(nd6.proterr);
+				ND6_STATS_INC(nd6.drop);
+				return;
+			}
+
 			if (ip6_addr_issolicitednode(ip6_current_dest_addr())) {
 				/* Sender is validating this address. */
 				for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; ++i) {
@@ -483,16 +493,6 @@
 				/* RFC 7.1.1.
 				 * If the IP source address is the unspecified address, the IP
 				 * destination address is a solicited-node multicast address. */
-				pbuf_free(p);
-				ND6_STATS_INC(nd6.proterr);
-				ND6_STATS_INC(nd6.drop);
-				return;
-			}
-
-			if (lladdr_opt != NULL) {
-				/* RFC 7.1.1.
-				 * If the IP source address is the unspecified address, there is no
-				 * source link-layer address option in the message. */
 				pbuf_free(p);
 				ND6_STATS_INC(nd6.proterr);
 				ND6_STATS_INC(nd6.drop);


net/lwip: fix the exception order

net/lwip: fix the exception order

According to RFC 4862 clause 5.4.5.
If DAD is failed, interface SHOULD be disabled, but it was not processed
because of the exception order.

Change-Id: I64c5fc4a7c2d5ea98cf19fbffe6df50b4e4ad82d
Signed-off-by: jisuu.kim <800dec47d2987cee7cc3d7aee71bc11b56f5042e@samsung.com>

--- os/net/lwip/src/core/ipv6/nd6.c
+++ os/net/lwip/src/core/ipv6/nd6.c
@@ -418,16 +418,6 @@

 		/* Check for ANY address in src (DAD algorithm). */
 		if (ip6_addr_isany(ip6_current_src_addr())) {
-			if (lladdr_opt != NULL) {
-				/* RFC 7.1.1.
-				 * If the IP source address is the unspecified address, there is no
-				 * source link-layer address option in the message. */
-				pbuf_free(p);
-				ND6_STATS_INC(nd6.proterr);
-				ND6_STATS_INC(nd6.drop);
-				return;
-			}
-
 			if (ip6_addr_issolicitednode(ip6_current_dest_addr())) {
 				/* Sender is validating this address. */
 				for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; ++i) {
@@ -444,6 +434,16 @@
 				/* RFC 7.1.1.
 				 * If the IP source address is the unspecified address, the IP
 				 * destination address is a solicited-node multicast address. */
+				pbuf_free(p);
+				ND6_STATS_INC(nd6.proterr);
+				ND6_STATS_INC(nd6.drop);
+				return;
+			}
+
+			if (lladdr_opt != NULL) {
+				/* RFC 7.1.1.
+				 * If the IP source address is the unspecified address, there is no
+				 * source link-layer address option in the message. */
 				pbuf_free(p);
 				ND6_STATS_INC(nd6.proterr);
 				ND6_STATS_INC(nd6.drop);


fix spell miss

fix spell miss

--- package/konoha.date/date_glue.h
+++ package/konoha.date/date_glue.h
@@ -144,7 +144,7 @@
 	RETURNi_(ret);
 }

-//## int Date.getimezoneOffset(); FIXME
+//## int Date.getTimezoneOffset(); FIXME
 static KMETHOD Date_getTimezoneOffset(KonohaContext *kctx, KonohaStack *sfp)
 {
 	time_t tv_sec = ((struct _kDate *)sfp[0].asObject)->tv.tv_sec;


Fix warnings.

Fix warnings.

--- regress/modify.c
+++ regress/modify.c
@@ -147,6 +147,7 @@
     return 0;
 }

+int
 add_nul(int argc, char *argv[]) {
     zip_source_t *zs;
     zip_uint64_t length = strtoull(argv[1], NULL, 10);
@@ -574,13 +575,18 @@
             return 0;

         case ZIP_SOURCE_READ:
+	    if (length > ZIP_INT64_MAX) {
+		zip_error_set(&ctx->error, ZIP_ER_INVAL, 0);
+		return -1;
+	    }
+
             if (length > ctx->length - ctx->offset) {
                 length =ctx->length - ctx->offset;
             }

             memset(data, 0, length);
             ctx->offset += length;
-            return length;
+            return (zip_int64_t)length;

         case ZIP_SOURCE_STAT: {
             zip_stat_t *st = ZIP_SOURCE_GET_ARGS(zip_stat_t, data, length, &ctx->error);
@@ -605,13 +611,13 @@
 }

 static zip_source_t *
-source_nul(zip_t *za, zip_uint64_t length)
+source_nul(zip_t *zs, zip_uint64_t length)
 {
     source_nul_t *ctx;
     zip_source_t *src;

     if ((ctx = (source_nul_t *)malloc(sizeof(*ctx))) == NULL) {
-        zip_error_set(zip_get_error(za), ZIP_ER_MEMORY, 0);
+        zip_error_set(zip_get_error(zs), ZIP_ER_MEMORY, 0);
         return NULL;
     }

@@ -619,7 +625,7 @@
     ctx->length = length;
     ctx->offset = 0;

-    if ((src = zip_source_function(za, source_nul_cb, ctx)) == NULL) {
+    if ((src = zip_source_function(zs, source_nul_cb, ctx)) == NULL) {
         free(ctx);
         return NULL;
     }


fix confusing trace
PR:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: b4be4a41b2a3352907de631eb6da1671a2f7b614@70810 13f79535-47bb-0310-9956-ffa450edef68

--- xs/Apache/Filter/Apache__Filter.h
+++ xs/Apache/Filter/Apache__Filter.h
@@ -31,7 +31,7 @@

     mpxs_usage_va_1(modperl_filter, "$filter->print(...)");

-    MP_TRACE_f(MP_FUNC, "%s::print\n",
+    MP_TRACE_f(MP_FUNC, "from %s\n",
                ((modperl_filter_ctx_t *)modperl_filter->f->ctx)->handler->name);
     if (modperl_filter->mode == MP_OUTPUT_FILTER_MODE) {
         mpxs_write_loop(modperl_output_filter_write, modperl_filter);
@@ -54,7 +54,7 @@

     mpxs_usage_va_2(modperl_filter, buffer, "$filter->read(buf, [len])");

-    MP_TRACE_f(MP_FUNC, "%s::read\n",
+    MP_TRACE_f(MP_FUNC, "from %s\n",
                ((modperl_filter_ctx_t *)modperl_filter->f->ctx)->handler->name);

     if (items > 2) {


colour_coded_pixel is less enthusiastic about bad matches

--- sparrow.c
+++ sparrow.c
@@ -276,8 +276,8 @@

 static inline void
 colour_coded_pixel(guint32* pixel, guint32 lag, guint32 shift){
-  if (shift < 72){
-    shift >>= 3;
+  if (shift < 18){
+    shift >>= 1;
     if (shift == 0){
       *pixel = (guint32)-1;
     }


pi3usb9201 shim: Remove unneeded guard

pi3usb9201 shim: Remove unneeded guard

All boards and tests now define the BC1.1 devices in the devictree.
Remove an obsolete guard.

BUG=none
BRANCH=none
TEST=twister
TEST=zmake compare-builds

Signed-off-by: Keith Short <f6d578f97033c25f1206cb57d52f358974c82954@chromium.org>
Change-Id: If28f1932bb7b1febccc07475f759867a45c01299
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4023769
Code-Coverage: Zoss <345cf107e82c70959d46f59d98bddc98ce458aff@prod.google.com>
Reviewed-by: Yuval Peress <50dc11c009bd4d7e9d9d15a383c1743ce5ee82ef@google.com>
Reviewed-by: Abe Levkoy <2e1ad7039298f93262cf06bbb457275fb3e2ecb5@chromium.org>

--- zephyr/shim/src/bc12_pi3usb9201.c
+++ zephyr/shim/src/bc12_pi3usb9201.c
@@ -14,11 +14,6 @@
 #include "usb_pd.h"
 #include "usbc/utils.h"
 #include "i2c/i2c.h"
-
-#if DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT)
-
-BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) > 0,
-	     "No compatible BC1.2 instance found");

 #define USBC_PORT_BC12(usbc_id, bc12_id)                \
 	[USBC_PORT_NEW(usbc_id)] = {                    \
@@ -56,5 +51,3 @@
 	usb_charger_task_set_event(1, USB_CHG_EVENT_BC12);
 }
 #endif
-
-#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */


kbuild: fix sh64 section mismatch problems

There's a special .cranges section that is almost always generated,
with data being moved to the appropriate section by the linker at a later
stage.

To give a bit of background, sh64 has both a native SHmedia instruction
set (32-bit instructions) and SHcompact (which is compatability with
normal SH -- 16-bit, a massively reduced register set, etc.). code ranges
are emitted when we're using the 32-bit ABI, but not the 64-bit one.

It is a special staging section used solely by binutils where code with
different flags get placed (more specifically differing flags for input
and output sections), before being lazily merged by the linker.

The closest I've been able to find to documentation is:
  http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/sh64elf.em?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=src

It's an array of 8-byte Elf32_CRange structure given in
  http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf32-sh64.h?rev=1.4&content-type=text/x-cvsweb-markup&cvsroot=src
that describes for which ISA a range is used.

Silence the warnings by allowing references from .init.text to .cranges.

The following warnings are fixed:

WARNING: init/built-in.o(.cranges+0x0): Section mismatch: reference to .init.text:
WARNING: init/built-in.o(.cranges+0xa): Section mismatch: reference to .init.text:
WARNING: init/built-in.o(.cranges+0x14): Section mismatch: reference to .init.text:
WARNING: init/built-in.o(.cranges+0x1e): Section mismatch: reference to .init.text:
WARNING: init/built-in.o(.cranges+0x28): Section mismatch: reference to .init.text:
WARNING: init/built-in.o(.cranges+0x32): Section mismatch: reference to .init.text:
WARNING: kernel/built-in.o(.cranges+0x50): Section mismatch: reference to .init.text:
WARNING: kernel/built-in.o(.cranges+0x5a): Section mismatch: reference to .init.text:
WARNING: kernel/built-in.o(.cranges+0x64): Section mismatch: reference to .init.text:
WARNING: kernel/built-in.o(.cranges+0xfa): Section mismatch: reference to .init.text:
WARNING: kernel/built-in.o(.cranges+0x104): Section mismatch: reference to .init.text:
WARNING: kernel/built-in.o(.cranges+0x10e): Section mismatch: reference to .init.text:
WARNING: kernel/built-in.o(.cranges+0x14a): Section mismatch: reference to .init.text:
WARNING: kernel/built-in.o(.cranges+0x154): Section mismatch: reference to .init.text:
WARNING: kernel/built-in.o(.cranges+0x15e): Section mismatch: reference to .init.text:
WARNING: mm/built-in.o(.cranges+0x6e): Section mismatch: reference to .init.text:
WARNING: mm/built-in.o(.cranges+0x78): Section mismatch: reference to .init.text:
WARNING: mm/built-in.o(.cranges+0x82): Section mismatch: reference to .init.text:
WARNING: mm/built-in.o(.cranges+0xaa): Section mismatch: reference to .init.text:
WARNING: fs/built-in.o(.cranges+0x136): Section mismatch: reference to .init.text:
WARNING: fs/built-in.o(.cranges+0x140): Section mismatch: reference to .init.text:
WARNING: fs/built-in.o(.cranges+0x14a): Section mismatch: reference to .init.text:
WARNING: fs/built-in.o(.cranges+0x168): Section mismatch: reference to .init.text:
WARNING: fs/built-in.o(.cranges+0x1f4): Section mismatch: reference to .init.text:
WARNING: fs/built-in.o(.cranges+0x1fe): Section mismatch: reference to .init.text:
WARNING: net/built-in.o(.cranges+0x302): Section mismatch: reference to .init.text:
WARNING: net/built-in.o(.cranges+0x30c): Section mismatch: reference to .init.text:
WARNING: net/built-in.o(.cranges+0x316): Section mismatch: reference to .init.text:
WARNING: net/built-in.o(.cranges+0x3a2): Section mismatch: reference to .init.text:
WARNING: net/built-in.o(.cranges+0x3ac): Section mismatch: reference to .init.text:
WARNING: net/built-in.o(.cranges+0x4ce): Section mismatch: reference to .init.text:
WARNING: net/built-in.o(.cranges+0x4d8): Section mismatch: reference to .init.text:

Signed-off-by: Paul Mundt <38b52dbb5f0b63d149982b6c5de788ec93a89032@linux-sh.org>
Cc: Kaz Kojima <5f374640ce4129c6fb14371ee9c992d96e0e729c@rr.iij4u.or.jp>
Signed-off-by: Sam Ravnborg <f16bed56189e249fe4ca8ed10a1ecae60e8ceac0@ravnborg.org>

--- scripts/mod/modpost.c
+++ scripts/mod/modpost.c
@@ -1052,6 +1052,7 @@
 		".plt",  /* seen on ARCH=um build on x86_64. Harmless */
 		"__ftr_fixup",		/* powerpc cpu feature fixup */
 		"__fw_ftr_fixup",	/* powerpc firmware feature fixup */
+		".cranges",	/* used by sh64 */
 		NULL
 	};
 	/* Start of section names */
@@ -1132,6 +1133,7 @@
 		".fixup",
 		".smp_locks",
 		".plt",  /* seen on ARCH=um build on x86_64. Harmless */
+		".cranges",	/* used by sh64 */
 		NULL
 	};
 	/* Start of section names */


primus: enable CONFIG_USB_PD_REQUIRE_AP_MODE_ENTRY

BUG=b:196287208
BRANCH=none
TEST=make -j BOARD=primus

Signed-off-by: Scott Chao <8cefa9751fac9aaa897ba1213763a96ba8dbd20d@wistron.corp-partner.google.com>
Change-Id: I7a3a484b1a4f47292688698fb49c833e19bffc35
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3088967
Reviewed-by: caveh jalali <08e24a66aefda7a55ca7d73f8903e0fb16eec763@chromium.org>

--- board/primus/board.h
+++ board/primus/board.h
@@ -33,6 +33,7 @@
 #define CONFIG_USB_PORT_POWER_DUMB

 /* USB Type C and USB PD defines */
+#define CONFIG_USB_PD_REQUIRE_AP_MODE_ENTRY

 #undef  CONFIG_USB_PD_TCPM_NCT38XX
 #define CONFIG_USB_PD_TCPM_RT1715


board/shuboz/board.h: Format with clang-format

BUG=b:236386294
BRANCH=none
TEST=none

Change-Id: I106723233b727e5ff2563be8306e8fa7caaf0de0
Signed-off-by: Jack Rosenthal <d3f605bef1867f59845d4ce6e4f83b8dc9e4e0ae@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728943
Reviewed-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>

--- board/shuboz/board.h
+++ board/shuboz/board.h
@@ -21,11 +21,11 @@
 #define CONFIG_USB_PD_PORT_MAX_COUNT 2
 #define CONFIG_USB_PORT_ENABLE_DYNAMIC

-#undef  PD_MAX_POWER_MW
-#define PD_MAX_POWER_MW		45000
-#undef  PD_MAX_CURRENT_MA
-#define PD_MAX_CURRENT_MA	3000
-#undef  CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON
+#undef PD_MAX_POWER_MW
+#define PD_MAX_POWER_MW 45000
+#undef PD_MAX_CURRENT_MA
+#define PD_MAX_CURRENT_MA 3000
+#undef CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON
 #define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON 40000

 #define CONFIG_CHARGER_PROFILE_OVERRIDE
@@ -61,59 +61,46 @@
 #define CONFIG_POWER_BUTTON_INIT_TIMEOUT 5

 /* GPIO mapping from board specific name to EC common name. */
-#define CONFIG_BATTERY_PRESENT_GPIO	GPIO_EC_BATT_PRES_ODL
-#define CONFIG_SCI_GPIO			GPIO_EC_FCH_SCI_ODL
-#define GPIO_AC_PRESENT			GPIO_ACOK_OD
-#define GPIO_CPU_PROCHOT		GPIO_PROCHOT_ODL
-#define GPIO_EC_INT_L			GPIO_EC_AP_INT_ODL
-#define GPIO_ENABLE_BACKLIGHT_L		GPIO_EC_EDP_BL_DISABLE
-#define GPIO_ENTERING_RW		GPIO_EC_ENTERING_RW
-#define GPIO_KBD_KSO2			GPIO_EC_KSO_02_INV
-#define GPIO_PCH_PWRBTN_L		GPIO_EC_FCH_PWR_BTN_L
-#define GPIO_PCH_RSMRST_L		GPIO_EC_FCH_RSMRST_L
-#define GPIO_PCH_SLP_S3_L		GPIO_SLP_S3_L
-#define GPIO_PCH_SLP_S5_L		GPIO_SLP_S5_L
-#define GPIO_PCH_SYS_PWROK		GPIO_EC_FCH_PWROK
-#define GPIO_PCH_WAKE_L			GPIO_EC_FCH_WAKE_L
-#define GPIO_POWER_BUTTON_L		GPIO_EC_PWR_BTN_ODL
-#define GPIO_S0_PGOOD			GPIO_S0_PWROK_OD
-#define GPIO_S5_PGOOD			GPIO_EC_PWROK_OD
-#define GPIO_SYS_RESET_L		GPIO_EC_SYS_RST_L
-#define GPIO_VOLUME_DOWN_L		GPIO_VOLDN_BTN_ODL
-#define GPIO_VOLUME_UP_L		GPIO_VOLUP_BTN_ODL
-#define GPIO_WP_L			GPIO_EC_WP_L
-#define GPIO_PACKET_MODE_EN		GPIO_EC_H1_PACKET_MODE
+#define CONFIG_BATTERY_PRESENT_GPIO GPIO_EC_BATT_PRES_ODL
+#define CONFIG_SCI_GPIO GPIO_EC_FCH_SCI_ODL
+#define GPIO_AC_PRESENT GPIO_ACOK_OD
+#define GPIO_CPU_PROCHOT GPIO_PROCHOT_ODL
+#define GPIO_EC_INT_L GPIO_EC_AP_INT_ODL
+#define GPIO_ENABLE_BACKLIGHT_L GPIO_EC_EDP_BL_DISABLE
+#define GPIO_ENTERING_RW GPIO_EC_ENTERING_RW
+#define GPIO_KBD_KSO2 GPIO_EC_KSO_02_INV
+#define GPIO_PCH_PWRBTN_L GPIO_EC_FCH_PWR_BTN_L
+#define GPIO_PCH_RSMRST_L GPIO_EC_FCH_RSMRST_L
+#define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L
+#define GPIO_PCH_SLP_S5_L GPIO_SLP_S5_L
+#define GPIO_PCH_SYS_PWROK GPIO_EC_FCH_PWROK
+#define GPIO_PCH_WAKE_L GPIO_EC_FCH_WAKE_L
+#define GPIO_POWER_BUTTON_L GPIO_EC_PWR_BTN_ODL
+#define GPIO_S0_PGOOD GPIO_S0_PWROK_OD
+#define GPIO_S5_PGOOD GPIO_EC_PWROK_OD
+#define GPIO_SYS_RESET_L GPIO_EC_SYS_RST_L
+#define GPIO_VOLUME_DOWN_L GPIO_VOLDN_BTN_ODL
+#define GPIO_VOLUME_UP_L GPIO_VOLUP_BTN_ODL
+#define GPIO_WP_L GPIO_EC_WP_L
+#define GPIO_PACKET_MODE_EN GPIO_EC_H1_PACKET_MODE

 #ifndef __ASSEMBLER__

 /* This I2C moved. Temporarily detect and support the V0 HW. */
 extern int I2C_PORT_BATTERY;

-enum adc_channel {
-	ADC_TEMP_SENSOR_CHARGER,
-	ADC_TEMP_SENSOR_SOC,
-	ADC_CH_COUNT
-};
+enum adc_channel { ADC_TEMP_SENSOR_CHARGER, ADC_TEMP_SENSOR_SOC, ADC_CH_COUNT };

 enum battery_type {
 	BATTERY_CM1500,
 	BATTERY_TYPE_COUNT,
 };

-enum pwm_channel {
-	PWM_CH_KBLIGHT = 0,
-	PWM_CH_COUNT
-};
+enum pwm_channel { PWM_CH_KBLIGHT = 0, PWM_CH_COUNT };

-enum ioex_port {
-	IOEX_C0_NCT3807 = 0,
-	IOEX_C1_NCT3807,
-	IOEX_PORT_COUNT
-};
+enum ioex_port { IOEX_C0_NCT3807 = 0, IOEX_C1_NCT3807, IOEX_PORT_COUNT };

-#define PORT_TO_HPD(port) ((port == 0) \
-	? GPIO_USB3_C0_DP2_HPD \
-	: GPIO_DP1_HPD)
+#define PORT_TO_HPD(port) ((port == 0) ? GPIO_USB3_C0_DP2_HPD : GPIO_DP1_HPD)

 enum temp_sensor_id {
 	TEMP_SENSOR_CHARGER = 0,
@@ -122,17 +109,9 @@
 	TEMP_SENSOR_COUNT
 };

-enum usba_port {
-	USBA_PORT_A0 = 0,
-	USBA_PORT_A1,
-	USBA_PORT_COUNT
-};
+enum usba_port { USBA_PORT_A0 = 0, USBA_PORT_A1, USBA_PORT_COUNT };

-enum usbc_port {
-	USBC_PORT_C0 = 0,
-	USBC_PORT_C1,
-	USBC_PORT_COUNT
-};
+enum usbc_port { USBC_PORT_C0 = 0, USBC_PORT_C1, USBC_PORT_COUNT };

 /*****************************************************************************
  * CBI EC FW Configuration


snappy: limit max input current for safety

Cancel snappy total power spec (adapter - 5W), follow reef setting.
Max = Max * 95%

BUG=b:35937839
BRANCH=reef
TEST=make buildall

Change-Id: I2bf8ef8856a6ac93efee3f5a53fdd5e99d6d68dd
Signed-off-by: Bruce.Wan <a898a81068da7266439365c3bd380deb6a0a895f@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/451080
Commit-Ready: Bruce Wan <a898a81068da7266439365c3bd380deb6a0a895f@quantatw.com>
Tested-by: Bruce Wan <a898a81068da7266439365c3bd380deb6a0a895f@quantatw.com>
Reviewed-by: Aaron Durbin <af0622ab041e8b0f8e5819838dcc93898196e71f@chromium.org>

--- board/snappy/board.c
+++ board/snappy/board.c
@@ -612,7 +612,7 @@
 	if (bd9995x_bc12_enable_charging(port, bc12_enable))
 		return;

-	charge_ma = (charge_ma * 89) / 100;
+	charge_ma = (charge_ma * 95) / 100;
 	charge_set_input_current_limit(MAX(charge_ma,
 				   CONFIG_CHARGER_INPUT_CURRENT), charge_mv);
 }


vell: Update fan table version 4

vell: Update fan table version 4

BUG=b:216026302
BRANCH=none
TEST=Thermal team verified thermal policy is expected.

Signed-off-by: Devin Lu <052fe648504800b810f29702ef4f3db83fad68bf@quantatw.com>
Change-Id: I084c758bb6a6380b08bb11c62a76af6cf3b61916
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3782348
Tested-by: Devin Lu <d4ad47e36dbc9c8af8e155263d0bf0afaae16ab2@quantatw.com>
Commit-Queue: Devin Lu <d4ad47e36dbc9c8af8e155263d0bf0afaae16ab2@quantatw.com>
Reviewed-by: caveh jalali <08e24a66aefda7a55ca7d73f8903e0fb16eec763@chromium.org>


Turn on CACHE_HASH, for 2% speedier dict lookups

--- Include/stringobject.h
+++ Include/stringobject.h
@@ -47,6 +47,9 @@

 /* NB The type is revealed here only because it is used in dictobject.c */

+/* Take this out to save 4 bytes per string object and to lose 2% speedup */
+#define CACHE_HASH
+
 typedef struct {
 	PyObject_VAR_HEAD
 #ifdef CACHE_HASH


[1] Increased HERTZ by an order of magnitude. [1.5] Inspired by SofPWM. [2] Works significantly better.

--- Diminuto/bin/pwmtest.c
+++ Diminuto/bin/pwmtest.c
@@ -35,7 +35,7 @@
 #include <sys/time.h>
 #include <unistd.h>

-static const diminuto_ticks_t HERTZ = 1000;
+static const diminuto_ticks_t HERTZ = 10000; /* 100us */

 static const int PRIMES[] = {
     7, 5, 3, 2


tests: Make metadata-only uploads work with Drive v2

Same issue as folder creation. See
a9c8516b4380a213cd92d83a11f9793414588319 for the rationale.

https://bugzilla.gnome.org/show_bug.cgi?id=684920

--- gdata/tests/documents.c
+++ gdata/tests/documents.c
@@ -775,15 +775,9 @@
 	}

 	if (test_params->payload_type == UPLOAD_METADATA_ONLY) {
-		gchar *upload_uri;
-
-		/* Insert the document */
-		upload_uri = gdata_documents_service_get_upload_uri (data->folder);
-		data->new_document = GDATA_DOCUMENTS_DOCUMENT (gdata_service_insert_entry (GDATA_SERVICE (test_params->service),
-		                                                                           gdata_documents_service_get_primary_authorization_domain (),
-		                                                                           upload_uri, GDATA_ENTRY (document), NULL, &error));
-		g_free (upload_uri);
-
+		data->new_document = GDATA_DOCUMENTS_DOCUMENT (gdata_documents_service_add_entry_to_folder (test_params->service,
+		                                                                              GDATA_DOCUMENTS_ENTRY (document),
+		                                                                              data->folder, NULL, &error));
 		g_assert_no_error (error);
 	} else {
 		GDataUploadStream *upload_stream;


Delete extra whitespace

Delete extra whitespace

--- include/Utility/String.h
+++ include/Utility/String.h
@@ -108,7 +108,7 @@
                 return '-' + format_integer(-n, separator);
             }
         }
-
+
         auto s = std::to_string(n);
         auto group_size = 3;
         auto index = s.size() % group_size;


sh: Reworked swap cache entry encoding for SH-X2 MMU.

In the 64-bit PTE case there's no point in restricting the encoding
to the low bits of the PTE, we can instead bump all of this up to
the high 32 bits and extend PTE_FILE_MAX_BITS to 32, adopting the
same convention used by x86 PAE.

There's a minor discrepency between the number of bits used for the
swap type encoding between 32 and 64-bit PTEs, but this is unlikely
to cause any problem given the extended offset.

Signed-off-by: Paul Mundt <38b52dbb5f0b63d149982b6c5de788ec93a89032@linux-sh.org>

--- include/asm-sh/pgtable.h
+++ include/asm-sh/pgtable.h
@@ -508,16 +508,50 @@
 extern void update_mmu_cache(struct vm_area_struct * vma,
 			     unsigned long address, pte_t pte);

-/* Encode and de-code a swap entry */
-/*
+/*
+ * Encode and de-code a swap entry
+ *
+ * Constraints:
+ *	_PAGE_FILE at bit 0
+ *	_PAGE_PRESENT at bit 8
+ *	_PAGE_PROTNONE at bit 9
+ *
+ * For the normal case, we encode the swap type into bits 0:7 and the
+ * swap offset into bits 10:30. For the 64-bit PTE case, we keep the
+ * preserved bits in the low 32-bits and use the upper 32 as the swap
+ * offset (along with a 5-bit type), following the same approach as x86
+ * PAE. This keeps the logic quite simple, and allows for a full 32
+ * PTE_FILE_MAX_BITS, as opposed to the 29-bits we're constrained with
+ * in the pte_low case.
+ *
+ * As is evident by the Alpha code, if we ever get a 64-bit unsigned
+ * long (swp_entry_t) to match up with the 64-bit PTEs, this all becomes
+ * much cleaner..
+ *
  * NOTE: We should set ZEROs at the position of _PAGE_PRESENT
  *       and _PAGE_PROTNONE bits
  */
-#define __swp_type(x)		((x).val & 0xff)
-#define __swp_offset(x)		((x).val >> 10)
-#define __swp_entry(type, offset) ((swp_entry_t) { (type) | ((offset) << 10) })
-#define __pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) >> 1 })
-#define __swp_entry_to_pte(x)	((pte_t) { (x).val << 1 })
+#ifdef CONFIG_X2TLB
+#define __swp_type(x)			((x).val & 0x1f)
+#define __swp_offset(x)			((x).val >> 5)
+#define __swp_entry(type, offset)	((swp_entry_t){ (type) | (offset) << 5})
+#define __pte_to_swp_entry(pte)		((swp_entry_t){ (pte).pte_high })
+#define __swp_entry_to_pte(x)		((pte_t){ 0, (x).val })
+
+/*
+ * Encode and decode a nonlinear file mapping entry
+ */
+#define pte_to_pgoff(pte)		((pte).pte_high)
+#define pgoff_to_pte(off)		((pte_t) { _PAGE_FILE, (off) })
+
+#define PTE_FILE_MAX_BITS		32
+#else
+#define __swp_type(x)			((x).val & 0xff)
+#define __swp_offset(x)			((x).val >> 10)
+#define __swp_entry(type, offset)	((swp_entry_t){(type) | (offset) <<10)})
+
+#define __pte_to_swp_entry(pte)		((swp_entry_t) { pte_val(pte) >> 1 })
+#define __swp_entry_to_pte(x)		((pte_t) { (x).val << 1 })

 /*
  * Encode and decode a nonlinear file mapping entry
@@ -525,6 +559,7 @@
 #define PTE_FILE_MAX_BITS	29
 #define pte_to_pgoff(pte)	(pte_val(pte) >> 1)
 #define pgoff_to_pte(off)	((pte_t) { ((off) << 1) | _PAGE_FILE })
+#endif

 typedef pte_t *pte_addr_t;


new files

new files

--- src/CPs.h
+++ src/CPs.h
@@ -3,7 +3,6 @@

 #include <CComposite.h>
 #include <CChild.h>
-#include <CAutoPtr.h>
 #include <memory>
 #include <string>


sparc: copy asm-sparc64/fbio.h to asm-sparc

There were only a few trivial changes and a few additions
in the sparc64 variant of this file.
This patch copies the sparc64 specific bits to the sparc version
of fbio.h so they are equal. A later patch will merge the two.

Signed-off-by: Sam Ravnborg <f16bed56189e249fe4ca8ed10a1ecae60e8ceac0@ravnborg.org>

--- include/asm-sparc/fbio.h
+++ include/asm-sparc/fbio.h
@@ -1,5 +1,8 @@
 #ifndef __LINUX_FBIO_H
 #define __LINUX_FBIO_H
+
+#include <linux/compiler.h>
+#include <linux/types.h>

 /* Constants used for fbio SunOS compatibility */
 /* (C) 1996 Miguel de Icaza */
@@ -38,6 +41,9 @@
 #define FBTYPE_PCI_IGA1682	23
 #define FBTYPE_P9100COLOR	24

+#define FBTYPE_PCI_GENERIC	1000
+#define FBTYPE_PCI_MACH64	1001
+
 /* fbio ioctls */
 /* Returned by FBIOGTYPE */
 struct  fbtype {
@@ -97,8 +103,8 @@
         struct fbcurpos hot;    /* cursor hot spot */
         struct fbcmap cmap;     /* color map info */
         struct fbcurpos size;   /* cursor bit map size */
-        char *image;            /* cursor image bits */
-        char *mask;             /* cursor mask bits */
+        char __user *image;     /* cursor image bits */
+        char __user *mask;      /* cursor mask bits */
 };

 /* set/get cursor attributes/shape */
@@ -294,4 +300,31 @@
 #define LEO_LD_GBL_MAP         0x01009000
 #define LEO_UNK2_MAP           0x0100a000

+#ifdef __KERNEL__
+struct  fbcmap32 {
+	int             index;          /* first element (0 origin) */
+	int             count;
+	u32		red;
+	u32		green;
+	u32		blue;
+};
+
+#define FBIOPUTCMAP32	_IOW('F', 3, struct fbcmap32)
+#define FBIOGETCMAP32	_IOW('F', 4, struct fbcmap32)
+
+struct fbcursor32 {
+	short set;		/* what to set, choose from the list above */
+	short enable;		/* cursor on/off */
+	struct fbcurpos pos;	/* cursor position */
+	struct fbcurpos hot;	/* cursor hot spot */
+	struct fbcmap32 cmap;	/* color map info */
+	struct fbcurpos size;	/* cursor bit map size */
+	u32	image;		/* cursor image bits */
+	u32	mask;		/* cursor mask bits */
+};
+
+#define FBIOSCURSOR32	_IOW('F', 24, struct fbcursor32)
+#define FBIOGCURSOR32	_IOW('F', 25, struct fbcursor32)
+#endif
+
 #endif /* __LINUX_FBIO_H */


Make function match prototype.  Fixes mingw crash.

--- src/FFT.c
+++ src/FFT.c
@@ -285,7 +285,7 @@
  * of its code.
  */

-void PowerSpectrum(sox_size_t NumSamples, const float *In, float *Out)
+void PowerSpectrum(unsigned NumSamples, const float *In, float *Out)
 {
   unsigned Half, i, i3;
   float theta, wtemp, wpr, wpi, wr, wi;


Bluetooth: host: Fix doxygen in addr header

Fix doxygen in addr.h file, missing /** needed for doxygen,
and placing the brief on the first line of the comment consistenly.

Signed-off-by: Joakim Andersson <cf0fcab5d38d6e132e92a97bcb0bae257abf4936@nordicsemi.no>

--- include/bluetooth/addr.h
+++ include/bluetooth/addr.h
@@ -41,14 +41,14 @@
 	bt_addr_t a;
 } bt_addr_le_t;

-/* Bluetooth device "any" address, not a valid address */
+/** Bluetooth device "any" address, not a valid address */
 #define BT_ADDR_ANY     ((bt_addr_t[]) { { { 0, 0, 0, 0, 0, 0 } } })
-/* Bluetooth device "none" address, not a valid address */
+/** Bluetooth device "none" address, not a valid address */
 #define BT_ADDR_NONE    ((bt_addr_t[]) { { \
 			 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } } })
-/* Bluetooth LE device "any" address, not a valid address */
+/** Bluetooth LE device "any" address, not a valid address */
 #define BT_ADDR_LE_ANY  ((bt_addr_le_t[]) { { 0, { { 0, 0, 0, 0, 0, 0 } } } })
-/* Bluetooth LE device "none" address, not a valid address */
+/** Bluetooth LE device "none" address, not a valid address */
 #define BT_ADDR_LE_NONE ((bt_addr_le_t[]) { { 0, \
 			 { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } } } })

@@ -151,38 +151,35 @@
 	return BT_ADDR_IS_STATIC(&addr->a);
 }

-/**
- * @def BT_ADDR_STR_LEN
- *
- * @brief Recommended length of user string buffer for Bluetooth address
- *
- * @details The recommended length guarantee the output of address
- * conversion will not lose valuable information about address being
- * processed.
+/** @def BT_ADDR_STR_LEN
+ *
+ *  @brief Recommended length of user string buffer for Bluetooth address
+ *
+ *  @details The recommended length guarantee the output of address
+ *  conversion will not lose valuable information about address being
+ *  processed.
  */
 #define BT_ADDR_STR_LEN 18

-/**
- * @def BT_ADDR_LE_STR_LEN
- *
- * @brief Recommended length of user string buffer for Bluetooth LE address
- *
- * @details The recommended length guarantee the output of address
- * conversion will not lose valuable information about address being
- * processed.
+/** @def BT_ADDR_LE_STR_LEN
+ *
+ *  @brief Recommended length of user string buffer for Bluetooth LE address
+ *
+ *  @details The recommended length guarantee the output of address
+ *  conversion will not lose valuable information about address being
+ *  processed.
  */
 #define BT_ADDR_LE_STR_LEN 30

-/**
- * @brief Converts binary Bluetooth address to string.
- *
- * @param addr Address of buffer containing binary Bluetooth address.
- * @param str Address of user buffer with enough room to store formatted
- * string containing binary address.
- * @param len Length of data to be copied to user string buffer. Refer to
- * BT_ADDR_STR_LEN about recommended value.
- *
- * @return Number of successfully formatted bytes from binary address.
+/** @brief Converts binary Bluetooth address to string.
+ *
+ *  @param addr Address of buffer containing binary Bluetooth address.
+ *  @param str Address of user buffer with enough room to store formatted
+ *  string containing binary address.
+ *  @param len Length of data to be copied to user string buffer. Refer to
+ *  BT_ADDR_STR_LEN about recommended value.
+ *
+ *  @return Number of successfully formatted bytes from binary address.
  */
 static inline int bt_addr_to_str(const bt_addr_t *addr, char *str, size_t len)
 {
@@ -191,16 +188,15 @@
 			addr->val[2], addr->val[1], addr->val[0]);
 }

-/**
- * @brief Converts binary LE Bluetooth address to string.
- *
- * @param addr Address of buffer containing binary LE Bluetooth address.
- * @param str Address of user buffer with enough room to store
- * formatted string containing binary LE address.
- * @param len Length of data to be copied to user string buffer. Refer to
- * BT_ADDR_LE_STR_LEN about recommended value.
- *
- * @return Number of successfully formatted bytes from binary address.
+/** @brief Converts binary LE Bluetooth address to string.
+ *
+ *  @param addr Address of buffer containing binary LE Bluetooth address.
+ *  @param str Address of user buffer with enough room to store
+ *  formatted string containing binary LE address.
+ *  @param len Length of data to be copied to user string buffer. Refer to
+ *  BT_ADDR_LE_STR_LEN about recommended value.
+ *
+ *  @return Number of successfully formatted bytes from binary address.
  */
 static inline int bt_addr_le_to_str(const bt_addr_le_t *addr, char *str,
 				    size_t len)
@@ -230,25 +226,23 @@
 			addr->a.val[2], addr->a.val[1], addr->a.val[0], type);
 }

-/**
- * @brief Convert Bluetooth address from string to binary.
- *
- * @param[in]  str   The string representation of a Bluetooth address.
- * @param[out] addr  Address of buffer to store the Bluetooth address
- *
- * @return Zero on success or (negative) error code otherwise.
+/** @brief Convert Bluetooth address from string to binary.
+ *
+ *  @param[in]  str   The string representation of a Bluetooth address.
+ *  @param[out] addr  Address of buffer to store the Bluetooth address
+ *
+ *  @return Zero on success or (negative) error code otherwise.
  */
 int bt_addr_from_str(const char *str, bt_addr_t *addr);

-/**
- * @brief Convert LE Bluetooth address from string to binary.
- *
- * @param[in]  str   The string representation of an LE Bluetooth address.
- * @param[in]  type  The string representation of the LE Bluetooth address
+/** @brief Convert LE Bluetooth address from string to binary.
+ *
+ *  @param[in]  str   The string representation of an LE Bluetooth address.
+ *  @param[in]  type  The string representation of the LE Bluetooth address
  *                   type.
- * @param[out] addr  Address of buffer to store the LE Bluetooth address
- *
- * @return Zero on success or (negative) error code otherwise.
+ *  @param[out] addr  Address of buffer to store the LE Bluetooth address
+ *
+ *  @return Zero on success or (negative) error code otherwise.
  */
 int bt_addr_le_from_str(const char *str, const char *type, bt_addr_le_t *addr);


Test isolated deletion.

Test isolated deletion.

--- testapp.c
+++ testapp.c
@@ -192,6 +192,30 @@
     assert_item_eq(h, h1, item2, fetched_item2);
 }

+static void test_two_engines_del(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1) {
+    item *item1, *item2, *fetched_item1 = NULL, *fetched_item2 = NULL;
+    const void *cookie1 = "user1", *cookie2 = "user2";
+    char *key = "somekey";
+    char *value1 = "some value1", *value2 = "some value 2";
+
+    store(h, h1, cookie1, key, value1, &item1);
+    store(h, h1, cookie2, key, value2, &item2);
+
+    ENGINE_ERROR_CODE rv = ENGINE_SUCCESS;
+
+    // Delete an item
+    rv = h1->remove(h, cookie1, item1);
+    assert(rv == ENGINE_SUCCESS);
+
+    rv = h1->get(h, cookie1, &fetched_item1, key, strlen(key));
+    assert(rv == ENGINE_KEY_ENOENT);
+    assert(fetched_item1 == NULL);
+    rv = h1->get(h, cookie2, &fetched_item2, key, strlen(key));
+    assert(rv == ENGINE_SUCCESS);
+
+    assert_item_eq(h, h1, item2, fetched_item2);
+}
+
 static void test_get_info(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1) {
     const char *info = h1->get_info(h);
     assert(strncmp(info, "Bucket engine", 13) == 0);
@@ -213,6 +237,7 @@
         {"get info", test_get_info},
         {"default storage", test_default_storage},
         {"distinct storage", test_two_engines},
+        {"delete from one of two nodes", test_two_engines_del},
         {NULL, NULL}
     };


Bluetooth: host: Document security changed and no security level change

Document the security changed callback can be called with no change
in the security level when the encryption key has been changed
in the link-layer.

Also update the documentation for set security function to include
the bond information so that it matches the documentation for security
changed callback.

Update pairing process to pairing procedure for consistency.

Signed-off-by: Joakim Andersson <cf0fcab5d38d6e132e92a97bcb0bae257abf4936@nordicsemi.no>

--- include/bluetooth/conn.h
+++ include/bluetooth/conn.h
@@ -696,14 +696,15 @@

 /** @brief Set security level for a connection.
  *
- *  This function enable security (encryption) for a connection. If device is
- *  already paired with sufficiently strong key encryption will be enabled. If
- *  link is already encrypted with sufficiently strong key this function does
- *  nothing.
- *
- *  If device is not paired pairing will be initiated. If device is paired and
- *  keys are too weak but input output capabilities allow for strong enough keys
- *  pairing will be initiated.
+ *  This function enable security (encryption) for a connection. If the device
+ *  has bond information for the peer with sufficiently strong key encryption
+ *  will be enabled. If the connection is already encrypted with sufficiently
+ *  strong key this function does nothing.
+ *
+ *  If the device has no bond information for the peer and is not already paired
+ *  then the pairing procedure will be initiated. If the device has bond
+ *  information or is already paired and the keys are too weak then the pairing
+ *  procedure will be initiated.
  *
  *  This function may return error if required level of security is not possible
  *  to achieve due to local or remote device limitation (e.g., input output
@@ -881,8 +882,15 @@
 #if defined(CONFIG_BT_SMP) || defined(CONFIG_BT_BREDR)
 	/** @brief The security level of a connection has changed.
 	 *
-	 *  This callback notifies the application that the security level
-	 *  of a connection has changed.
+	 *  This callback notifies the application that the security of a
+	 *  connection has changed.
+	 *
+	 *  The security level of the connection can either have been increased
+	 *  or remain unchanged. An increased security level means that the
+	 *  pairing procedure has been performed or the bond information from
+	 *  a previous connection has been applied. If the security level
+	 *  remains unchanged this means that the encryption key has been
+	 *  refreshed for the connection.
 	 *
 	 *  @param conn Connection object.
 	 *  @param level New security level of the connection.
@@ -1276,13 +1284,14 @@
 	void (*pincode_entry)(struct bt_conn *conn, bool highsec);
 #endif

-	/** @brief notify that pairing process was complete.
-	 *
-	 *  This callback notifies the application that the pairing process
+	/** @brief notify that pairing procedure was complete.
+	 *
+	 *  This callback notifies the application that the pairing procedure
 	 *  has been completed.
 	 *
 	 *  @param conn Connection object.
-	 *  @param bonded pairing is bonded or not.
+	 *  @param bonded Bond information has been distributed during the
+	 *                pairing procedure.
 	 */
 	void (*pairing_complete)(struct bt_conn *conn, bool bonded);


Remove isnan() and isinf() templated from QGC.h only if prior to Visual Studio 2013

--- src/QGC.h
+++ src/QGC.h
@@ -33,6 +33,24 @@

 /* Windows fixes */
 #ifdef _MSC_VER
+#if (_MSC_VER < 1800)	/* only PRIOR to Visual Studio 2013 */
+/* Needed define for Eigen */
+//#define NOMINMAX
+#include <limits>
+template<typename T>
+inline bool isnan(T value)
+{
+	return value != value;
+
+}
+
+// requires #include <limits>
+template<typename T>
+inline bool isinf(T value)
+{
+	return (value == std::numeric_limits<T>::infinity() || (-1 * value) == std::numeric_limits<T>::infinity()) && std::numeric_limits<T>::has_infinity;
+}
+#endif
 #elif defined __APPLE__
 #include <cmath>
 #ifndef isnan


add missing override

add missing override

Xcode 7 squawks that 'clone' overrides a member function but is without the override keyword.

--- include/cinder/TriMesh.h
+++ include/cinder/TriMesh.h
@@ -79,7 +79,7 @@
 	static Format		formatFromSource( const geom::Source &source );

 	void			loadInto( geom::Target *target, const geom::AttribSet &requestedAttribs ) const override;
-	geom::Source*	clone() const { return new TriMesh( *this ); }
+	geom::Source*	clone() const override { return new TriMesh( *this ); }

 	void		clear();


updated osbase header file

updated osbase header file

--- IntrOS/kernel/osbase.h
+++ IntrOS/kernel/osbase.h
@@ -2,7 +2,7 @@

     @file    IntrOS: osbase.h
     @author  Rajmund Szymanski
-    @date    31.07.2018
+    @date    08.08.2018
     @brief   This file contains basic definitions for IntrOS.

  ******************************************************************************
@@ -32,6 +32,7 @@
 #ifndef __INTROSBASE_H
 #define __INTROSBASE_H

+#include <stdint.h>
 #include <stdbool.h>
 #include <setjmp.h>
 #include "osport.h"