text
stringlengths
4
6.14k
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -ast-dump %s | FileCheck --match-full-lines -implicit-check-not=openmp_structured_block %s void test() { #pragma omp target ; } // CHECK: TranslationUnitDecl {{.*}} <<invalid sloc>> <invalid sloc> // CHECK: `-FunctionDecl {{.*}} <{{.*}}ast-dump-openmp-target.c:3:1, line:6:1> line:3:6 test 'void ()' // CHECK-NEXT: `-CompoundStmt {{.*}} <col:13, line:6:1> // CHECK-NEXT: `-OMPTargetDirective {{.*}} <line:4:1, col:19> // CHECK-NEXT: `-CapturedStmt {{.*}} <line:5:3> // CHECK-NEXT: `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: |-CapturedStmt {{.*}} <col:3> // CHECK-NEXT: | `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: | |-NullStmt {{.*}} <col:3> openmp_structured_block // CHECK-NEXT: | `-ImplicitParamDecl {{.*}} <line:4:1> col:1 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-target.c:4:1) *const restrict' // CHECK-NEXT: |-AlwaysInlineAttr {{.*}} <<invalid sloc>> Implicit __forceinline // CHECK-NEXT: |-ImplicitParamDecl {{.*}} <col:1> col:1 implicit .global_tid. 'const int' // CHECK-NEXT: |-ImplicitParamDecl {{.*}} <col:1> col:1 implicit .part_id. 'const int *const restrict' // CHECK-NEXT: |-ImplicitParamDecl {{.*}} <col:1> col:1 implicit .privates. 'void *const restrict' // CHECK-NEXT: |-ImplicitParamDecl {{.*}} <col:1> col:1 implicit .copy_fn. 'void (*const restrict)(void *const restrict, ...)' // CHECK-NEXT: |-ImplicitParamDecl {{.*}} <col:1> col:1 implicit .task_t. 'void *const' // CHECK-NEXT: |-ImplicitParamDecl {{.*}} <col:1> col:1 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-target.c:4:1) *const restrict' // CHECK-NEXT: |-RecordDecl {{.*}} <col:1> col:1 implicit struct definition // CHECK-NEXT: | `-CapturedRecordAttr {{.*}} <<invalid sloc>> Implicit // CHECK-NEXT: `-CapturedDecl {{.*}} <<invalid sloc>> <invalid sloc> nothrow // CHECK-NEXT: |-NullStmt {{.*}} <line:5:3> openmp_structured_block // CHECK-NEXT: `-ImplicitParamDecl {{.*}} <line:4:1> col:1 implicit __context 'struct (anonymous at {{.*}}ast-dump-openmp-target.c:4:1) *const restrict'
/* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef WEBRTC_BASE_RACE_CHECKER_H_ #define WEBRTC_BASE_RACE_CHECKER_H_ #include "webrtc/base/checks.h" #include "webrtc/base/platform_thread.h" #include "webrtc/base/thread_annotations.h" namespace rtc { namespace internal { class RaceCheckerScope; } // namespace internal // Best-effort race-checking implementation. This primitive uses no // synchronization at all to be as-fast-as-possible in the non-racy case. class LOCKABLE RaceChecker { public: friend class internal::RaceCheckerScope; RaceChecker(); private: bool Acquire() const EXCLUSIVE_LOCK_FUNCTION(); void Release() const UNLOCK_FUNCTION(); // Volatile to prevent code being optimized away in Acquire()/Release(). mutable volatile int access_count_ = 0; mutable volatile PlatformThreadRef accessing_thread_; }; namespace internal { class SCOPED_LOCKABLE RaceCheckerScope { public: explicit RaceCheckerScope(const RaceChecker* race_checker) EXCLUSIVE_LOCK_FUNCTION(race_checker); bool RaceDetected() const; ~RaceCheckerScope() UNLOCK_FUNCTION(); private: const RaceChecker* const race_checker_; const bool race_check_ok_; }; class SCOPED_LOCKABLE RaceCheckerScopeDoNothing { public: explicit RaceCheckerScopeDoNothing(const RaceChecker* race_checker) EXCLUSIVE_LOCK_FUNCTION(race_checker) {} ~RaceCheckerScopeDoNothing() UNLOCK_FUNCTION() {} }; } // namespace internal } // namespace rtc #define RTC_CHECK_RUNS_SERIALIZED(x) \ rtc::internal::RaceCheckerScope race_checker(x); \ RTC_CHECK(!race_checker.RaceDetected()) #if RTC_DCHECK_IS_ON #define RTC_DCHECK_RUNS_SERIALIZED(x) \ rtc::internal::RaceCheckerScope race_checker(x); \ RTC_DCHECK(!race_checker.RaceDetected()) #else #define RTC_DCHECK_RUNS_SERIALIZED(x) \ rtc::internal::RaceCheckerScopeDoNothing race_checker(x) #endif #endif // WEBRTC_BASE_RACE_CHECKER_H_
// Filename: physxControllerReport.h // Created by: enn0x (24Sep09) // //////////////////////////////////////////////////////////////////// // // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // // All use of this software is subject to the terms of the revised BSD // license. You should have received a copy of this license along // with this source code in a file named "LICENSE." // //////////////////////////////////////////////////////////////////// #ifndef PHYSXCONTROLLERREPORT_H #define PHYSXCONTROLLERREPORT_H #include "pandabase.h" #include "callbackObject.h" #include "pStatCollector.h" #include "physx_includes.h" //////////////////////////////////////////////////////////////////// // Class : PhysxControllerReport // Description : Implementation of the NxUserControllerHitReport // interface. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSX PhysxControllerReport : public NxUserControllerHitReport { public: INLINE PhysxControllerReport(); INLINE ~PhysxControllerReport(); void enable(); void disable(); bool is_enabled() const; INLINE void set_shape_hit_callback(PT(CallbackObject) cbobj); INLINE void set_controller_hit_callback(PT(CallbackObject) cbobj); virtual NxControllerAction onShapeHit(const NxControllerShapeHit& hit); virtual NxControllerAction onControllerHit(const NxControllersHit& hit); private: bool _enabled; PT(CallbackObject) _shape_hit_cbobj; PT(CallbackObject) _controller_hit_cbobj; static PStatCollector _pcollector; }; #include "physxControllerReport.I" #endif // PHYSXCONTROLLERREPORT_H
/* * $Id: ossl_rand.h 11708 2007-02-12 23:01:19Z shyouhei $ * 'OpenSSL for Ruby' project * Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz> * All rights reserved. */ /* * This program is licenced under the same licence as Ruby. * (See the file 'LICENCE'.) */ #if !defined(_OSSL_RAND_H_) #define _OSSL_RAND_H_ extern VALUE mRandom; extern VALUE eRandomError; void Init_ossl_rand(void); #endif /* _OSSL_RAND_H_ */
#ifndef ALITOFTRACKERMI_H #define ALITOFTRACKERMI_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ //-----------------------------------------------------------------// // // // AliTOFtrackerMI Class // // Task: Perform association of the ESD tracks to TOF Clusters // // and Update ESD track with associated TOF Cluster parameters // // // //-----------------------------------------------------------------// #include "AliTracker.h" class TTreeSRedirector; class TClonesArray; class TObjArray; class AliESDEvent; class AliESDpid; class AliTOFcluster; class AliTOFRecoParam; class AliTOFGeometry; class AliTOFtrack; class AliTOFtrackerMI : public AliTracker { public: AliTOFtrackerMI(); // virtual ~AliTOFtrackerMI() {delete fTOFpid;} virtual ~AliTOFtrackerMI(); virtual void GetPidSettings(AliESDpid *esdPID); virtual Int_t Clusters2Tracks(AliESDEvent* /*event*/) {return -1;}; virtual Int_t PropagateBack(AliESDEvent * const event); virtual Int_t RefitInward(AliESDEvent* /*event*/) {return -1;}; virtual Int_t LoadClusters(TTree *dTree); // Loading Clusters from Digits virtual void UnloadClusters();// UnLoad Clusters virtual AliCluster *GetCluster(Int_t index) const {if (index==-1 || index >= fN) return NULL; return (AliCluster *) fClusters[index];}; void GetLikelihood(Float_t dy, Float_t dz, const Double_t *cov, AliTOFtrack * track, Float_t & py, Float_t &pz) const; void FillClusterArray(TObjArray* arr) const; private: enum {kMaxCluster=77777}; //maximal number of the TOF clusters AliTOFtrackerMI(const AliTOFtrackerMI &t); //Copy Ctor AliTOFtrackerMI& operator=(const AliTOFtrackerMI &source); // ass. op. Int_t InsertCluster(AliTOFcluster *c); // Fills TofClusters Array Int_t FindClusterIndex(Double_t z) const; // Returns cluster index void MatchTracks(Bool_t mLastStep) const; // Matching Algorithm void MatchTracksMI(Bool_t mLastStep); // Matching Algorithm void CollectESD(); // Select starting Set for Matching //void Init(); Float_t GetLinearDistances(AliTOFtrack * track, AliTOFcluster *cluster, Float_t distances[5]); const AliTOFRecoParam* fkRecoParam; // Pointer to TOF Recon. Pars AliTOFGeometry* fGeom; // Pointer to TOF geometry AliTOFcluster *fClusters[kMaxCluster]; // pointers to the TOF clusters Int_t fN; // Number of Clusters Int_t fNseeds; // Number of track seeds Int_t fNseedsTOF; // TPC BP tracks Int_t fngoodmatch; // Correctly matched tracks Int_t fnbadmatch; // Wrongly matched tracks Int_t fnunmatch; // Unmatched tracks Int_t fnmatch; // Total matched tracks Float_t fR; // Intermediate radius in TOF, used in matching Float_t fTOFHeigth; // Inner TOF radius for propagation Float_t fdCut; // Cut on minimum distance track-pad in matching Float_t fDx; // Pad Size in X Float_t fDy; // Pad Size in Y (== X TOF convention) Float_t fDz; // Pad Size in Z TClonesArray* fTracks; //! pointer to the TClonesArray with TOF tracks TObjArray* fSeeds; //! pointer to the TObjArray with ESD tracks TTreeSRedirector *fDebugStreamer; //!debug streamer ClassDef(AliTOFtrackerMI, 3) // TOF trackerMI }; #endif
/* zd_rf.h * * 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; either version 2 of the License, or * (at your option) any later version. * * 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 */ #ifndef _ZD_RF_H #define _ZD_RF_H #define UW2451_RF 0x2 #define UCHIP_RF 0x3 #define AL2230_RF 0x4 #define AL7230B_RF 0x5 /* a,b,g */ #define THETA_RF 0x6 #define AL2210_RF 0x7 #define MAXIM_NEW_RF 0x8 #define UW2453_RF 0x9 #define AL2230S_RF 0xa #define RALINK_RF 0xb #define INTERSIL_RF 0xc #define RF2959_RF 0xd #define MAXIM_NEW2_RF 0xe #define PHILIPS_RF 0xf #define RF_CHANNEL(ch) [(ch)-1] /* Provides functions of the RF transceiver. */ enum { RF_REG_BITS = 6, RF_VALUE_BITS = 18, RF_RV_BITS = RF_REG_BITS + RF_VALUE_BITS, }; struct zd_rf { u8 type; u8 channel; /* * Whether this RF should patch the 6M band edge * (assuming E2P_POD agrees) */ u8 patch_6m_band_edge:1; /* RF-specific functions */ int (*init_hw)(struct zd_rf *rf); int (*set_channel)(struct zd_rf *rf, u8 channel); int (*switch_radio_on)(struct zd_rf *rf); int (*switch_radio_off)(struct zd_rf *rf); }; const char *zd_rf_name(u8 type); void zd_rf_init(struct zd_rf *rf); void zd_rf_clear(struct zd_rf *rf); int zd_rf_init_hw(struct zd_rf *rf, u8 type); int zd_rf_scnprint_id(struct zd_rf *rf, char *buffer, size_t size); int zd_rf_set_channel(struct zd_rf *rf, u8 channel); int zd_switch_radio_on(struct zd_rf *rf); int zd_switch_radio_off(struct zd_rf *rf); /* Functions for individual RF chips */ int zd_rf_init_rf2959(struct zd_rf *rf); int zd_rf_init_al2230(struct zd_rf *rf); int zd_rf_init_al7230b(struct zd_rf *rf); #endif /* _ZD_RF_H */
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2020 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_SCRIPT_SIGCACHE_H #define BITCOIN_SCRIPT_SIGCACHE_H #include <script/interpreter.h> #include <span.h> #include <util/hasher.h> #include <vector> // DoS prevention: limit cache size to 32MB (over 1000000 entries on 64-bit // systems). Due to how we count cache size, actual memory usage is slightly // more (~32.25 MB) static const unsigned int DEFAULT_MAX_SIG_CACHE_SIZE = 32; // Maximum sig cache size allowed static const int64_t MAX_MAX_SIG_CACHE_SIZE = 16384; class CPubKey; class CachingTransactionSignatureChecker : public TransactionSignatureChecker { private: bool store; public: CachingTransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn, bool storeIn, PrecomputedTransactionData& txdataIn) : TransactionSignatureChecker(txToIn, nInIn, amountIn, txdataIn), store(storeIn) {} bool VerifyECDSASignature(const std::vector<unsigned char>& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const override; bool VerifySchnorrSignature(Span<const unsigned char> sig, const XOnlyPubKey& pubkey, const uint256& sighash) const override; }; void InitSignatureCache(); #endif // BITCOIN_SCRIPT_SIGCACHE_H
/*************************************************************************/ /* pane_drag.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef PANE_DRAG_H #define PANE_DRAG_H #include "scene/gui/control.h" class PaneDrag : public Control { GDCLASS(PaneDrag, Control) bool mouse_over; protected: void _gui_input(const Ref<InputEvent> &p_input); void _notification(int p_what); virtual Size2 get_minimum_size() const; static void _bind_methods(); public: PaneDrag(); }; #endif // PANE_DRAG_H
/* * txDataQueue_Api.h * * Copyright(c) 1998 - 2010 Texas Instruments. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name Texas Instruments nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /***************************************************************************/ /* */ /* */ /* PURPOSE: Tx Data Queue module api functions header file */ /* */ /***************************************************************************/ #ifndef _TX_DATA_QUEUE_API_H_ #define _TX_DATA_QUEUE_API_H_ #include "paramOut.h" #include "TWDriver.h" #include "DrvMainModules.h" #include "txMgmtQueue_Api.h" /* * Tx-Data-Queue functions: */ TI_HANDLE txDataQ_Create (TI_HANDLE hOs); void txDataQ_Init (TStadHandlesList *pStadHandles); TI_STATUS txDataQ_SetDefaults (TI_HANDLE hTxDataQ, txDataInitParams_t *pTxDataInitParams); TI_STATUS txDataQ_Destroy (TI_HANDLE hTxDataQ); void txDataQ_ClearQueues (TI_HANDLE hTxDataQ); TI_STATUS txDataQ_InsertPacket (TI_HANDLE hTxDataQ, TTxCtrlBlk *pPktCtrlBlk, TI_UINT8 uPacketDtag, TIntraBssBridge *pIntraBssBridgeParam); void txDataQ_StopQueue (TI_HANDLE hTxDataQ, TI_UINT32 tidBitMap); void txDataQ_StopLink (TI_HANDLE hTxDataQ, TI_UINT32 uHlid); void txDataQ_UpdateBusyMap (TI_HANDLE hTxDataQ, TI_UINT32 tidBitMap, TI_UINT32 uLinkBitMap); void txDataQ_StopAll (TI_HANDLE hTxDataQ); void txDataQ_WakeAll (TI_HANDLE hTxDataQ); void txDataQ_DisableLink (TI_HANDLE hTxDataQ, TI_UINT32 uHlid); void txDataQ_EnableLink (TI_HANDLE hTxDataQ, TI_UINT32 uHlid); /* * Tx data queue per link functions: */ void txDataQ_SetLinkType (TI_HANDLE hTxDataQ, TI_UINT32 uHlid, EWlanLinkType eLinkType); TI_STATUS txDataQ_LinkMacAdd (TI_HANDLE hTxDataQ, TI_UINT32 uHlid, TMacAddr tMacAddr); void txDataQ_LinkMacRemove (TI_HANDLE hTxDataQ, TI_UINT32 uHlid); TI_STATUS txDataQ_LinkMacFind (TI_HANDLE hTxDataQ, TI_UINT32 *uHlid, TMacAddr tMacAddr); void TxDataQ_SetEncryptFlag(TI_HANDLE hTxDataQ, TI_UINT32 uHlid,int flag); void TxDataQ_setEncryptionFieldSizes(TI_HANDLE hTxDataQ, TI_UINT32 uHlid,TI_UINT8 encryptionFieldSize); TI_UINT8 TxDataQ_getEncryptionFieldSizes(TI_HANDLE hTxDataQ, TI_UINT32 uHlid); void txDataQ_GetBcastLink (TI_HANDLE hTxDataQ, TI_UINT32 *uHlid); /* * Tx data resources functions: */ TI_STATUS txDataQ_AllocCheckResources (TI_HANDLE hTxDataQ, TTxCtrlBlk *pPktCtrlBlk); void txDataQ_FreeResources (TI_HANDLE hTxDataQ, TTxCtrlBlk *pPktCtrlBlk); void txDataQ_FlushLinkQueues (TI_HANDLE hTxDataQ, TI_UINT32 uHlid); #ifdef TI_DBG void txDataQ_PrintModuleParams (TI_HANDLE hTxDataQ); void txDataQ_PrintQueueStatistics (TI_HANDLE hTxDataQ); void txDataQ_ResetQueueStatistics (TI_HANDLE hTxDataQ); #endif /* TI_DBG */ /* * Tx-Data-Classifier functions: */ TI_STATUS txDataClsfr_Config (TI_HANDLE hTxDataQ, TClsfrParams *pClsfrInitParams); TI_STATUS txDataClsfr_ClassifyTxPacket (TI_HANDLE hTxDataQ, TTxCtrlBlk *pPktCtrlBlk, TI_UINT8 uPacketDtag); TI_STATUS txDataClsfr_InsertClsfrEntry (TI_HANDLE hTxDataQ, TClsfrTableEntry *pNewEntry); TI_STATUS txDataClsfr_RemoveClsfrEntry (TI_HANDLE hTxDataQ, TClsfrTableEntry *pRemEntry); TI_STATUS txDataClsfr_SetClsfrType (TI_HANDLE hTxDataQ, EClsfrType eNewClsfrType); TI_STATUS txDataClsfr_GetClsfrType (TI_HANDLE hTxDataQ, EClsfrType *pClsfrType); #ifdef TI_DBG void txDataClsfr_PrintClsfrTable (TI_HANDLE hTxDataQ); #endif /* TI_DBG */ #endif /* _TX_DATA_QUEUE_API_H_ */
/* * Copyright (C) 2015 The Paparazzi Community * * This file is part of Paparazzi. * * Paparazzi 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; either version 2, or (at your option) * any later version. * * Paparazzi 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 Paparazzi; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. */ /** * @file modules/computer_vision/opticflow/inter_thread_data.h * @brief Inter-thread data structures. * * Data structures used to for inter-thread communication via Unix Domain sockets. */ #ifndef _INTER_THREAD_DATA_H #define _INTER_THREAD_DATA_H /* The result calculated from the opticflow */ struct opticflow_result_t { float fps; ///< Frames per second of the optical flow calculation uint16_t corner_cnt; ///< The amount of coners found by FAST9 uint16_t tracked_cnt; ///< The amount of tracked corners int16_t flow_x; ///< Flow in x direction from the camera (in subpixels) int16_t flow_y; ///< Flow in y direction from the camera (in subpixels) int16_t flow_der_x; ///< The derotated flow calculation in the x direction (in subpixels) int16_t flow_der_y; ///< The derotated flow calculation in the y direction (in subpixels) float vel_x; ///< The velocity in the x direction float vel_y; ///< The velocity in the y direction float div_size; ///< Divergence as determined with the size_divergence script float surface_roughness; ///< Surface roughness as determined with a linear optical flow fit float divergence; ///< Divergence as determined with a linear flow fit float noise_measurement; ///< noise of measurement, for state filter }; /* The state of the drone when it took an image */ struct opticflow_state_t { float phi; ///< roll [rad] float theta; ///< pitch [rad] float agl; ///< height above ground [m] }; #endif
//============================================================================= // MuseScore // Music Composition & Notation // // Copyright (C) 2010-2011 Werner Schweer // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 // as published by the Free Software Foundation and appearing in // the file LICENCE.GPL //============================================================================= #ifndef __FRET_H__ #define __FRET_H__ #include "element.h" namespace Ms { class StringData; class Chord; class Harmony; static const int DEFAULT_STRINGS = 6; static const int DEFAULT_FRETS = 5; //--------------------------------------------------------- // @@ FretDiagram /// Fretboard diagram // // @P userMag qreal // @P strings int number of strings // @P frets int number of frets // @P barre int barre // @P fretOffset int //--------------------------------------------------------- class FretDiagram : public Element { #ifdef SCRIPT_INTERFACE Q_OBJECT Q_PROPERTY(qreal userMag READ userMag WRITE undoSetUserMag) Q_PROPERTY(int strings READ strings WRITE undoSetStrings) Q_PROPERTY(int frets READ frets WRITE undoSetFrets) Q_PROPERTY(int barre READ barre WRITE undoSetBarre) Q_PROPERTY(int fretOffset READ fretOffset WRITE undoSetFretOffset) public: void undoSetUserMag(qreal val); void undoSetStrings(int val); void undoSetFrets(int val); void undoSetBarre(int val); void undoSetFretOffset(int val); private: #endif int _strings { DEFAULT_STRINGS }; int maxStrings { 0 }; int _frets { DEFAULT_FRETS }; int _fretOffset { 0 }; int _maxFrets { 24 }; int _barre { 0 }; char* _dots { 0 }; char* _marker { 0 }; char* _fingering { 0 }; Harmony* _harmony { 0 }; qreal lw1; qreal lw2; // top line qreal stringDist; qreal fretDist; QFont font; qreal _userMag { 1.0 }; // allowed 0.1 - 10.0 public: FretDiagram(Score* s); FretDiagram(const FretDiagram&); ~FretDiagram(); virtual void draw(QPainter*) const override; virtual FretDiagram* clone() const override { return new FretDiagram(*this); } static FretDiagram* fromString(Score* score, const QString &s); virtual Element::Type type() const override { return Element::Type::FRET_DIAGRAM; } virtual void layout() override; virtual void write(Xml& xml) const override; virtual void read(XmlReader&) override; virtual QLineF dragAnchor() const override; virtual QPointF pagePos() const override; // read / write MusicXML void readMusicXML(XmlReader& de); void writeMusicXML(Xml& xml) const; int strings() const { return _strings; } int frets() const { return _frets; } void setOffset(int offset); void setStrings(int n); void setFrets(int n) { _frets = n; } void setDot(int string, int fret); void setBarre(int fret) { _barre = fret; } void setMarker(int string, int marker); void setFingering(int string, int finger); int fretOffset() const { return _fretOffset; } void setFretOffset(int val) { _fretOffset = val; } int maxFrets() const { return _maxFrets; } void setMaxFrets(int val) { _maxFrets = val; } char dot(int s) const { return _dots ? _dots[s] : 0; } char marker(int s) const { return _marker ? _marker[s] : 0; } char fingering(int s) const { return _fingering ? _fingering[s] : 0; } int barre() const { return _barre; } Harmony* harmony() const { return _harmony; } void init(Ms::StringData *, Chord*); virtual void add(Element*) override; virtual void remove(Element*) override; virtual bool acceptDrop(const DropData&) const override; virtual Element* drop(const DropData&) override; virtual void scanElements(void* data, void (*func)(void*, Element*), bool all=true) override; virtual QVariant getProperty(P_ID propertyId) const override; virtual bool setProperty(P_ID propertyId, const QVariant&) override; virtual QVariant propertyDefault(P_ID) const override; qreal userMag() const { return _userMag; } void setUserMag(qreal m) { _userMag = m; } }; } // namespace Ms #endif
/* include/version.h. Generated by configure. */ #define CONFIG_SND_VERSION "1.0.12rc1" #define CONFIG_SND_DATE " (Thu Jun 22 13:55:50 2006 UTC)"
/* * Copyright (c) 2013-2014 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "psmx2.h" struct psm2_am_parameters psmx2_am_param; static psm2_am_handler_fn_t psmx2_am_handlers[2] = { psmx2_am_rma_handler, psmx2_am_atomic_handler, }; static int psmx2_am_handlers_idx[2]; static int psmx2_am_handlers_initialized = 0; int psmx2_am_progress(struct psmx2_fid_domain *domain) { struct slist_entry *item; struct psmx2_am_request *req; struct psmx2_trigger *trigger; if (psmx2_env.tagged_rma) { fastlock_acquire(&domain->rma_queue.lock); while (!slist_empty(&domain->rma_queue.list)) { item = slist_remove_head(&domain->rma_queue.list); req = container_of(item, struct psmx2_am_request, list_entry); fastlock_release(&domain->rma_queue.lock); psmx2_am_process_rma(domain, req); fastlock_acquire(&domain->rma_queue.lock); } fastlock_release(&domain->rma_queue.lock); } fastlock_acquire(&domain->trigger_queue.lock); while (!slist_empty(&domain->trigger_queue.list)) { item = slist_remove_head(&domain->trigger_queue.list); trigger = container_of(item, struct psmx2_trigger, list_entry); fastlock_release(&domain->trigger_queue.lock); psmx2_process_trigger(domain, trigger); fastlock_acquire(&domain->trigger_queue.lock); } fastlock_release(&domain->trigger_queue.lock); return 0; } int psmx2_am_init(struct psmx2_fid_domain *domain) { psm2_ep_t psm2_ep = domain->psm2_ep; size_t size; int err = 0; FI_INFO(&psmx2_prov, FI_LOG_CORE, "\n"); psmx2_atomic_init(); if (!psmx2_am_handlers_initialized) { err = psm2_am_get_parameters(psm2_ep, &psmx2_am_param, sizeof(psmx2_am_param), &size); if (err) return psmx2_errno(err); err = psm2_am_register_handlers(psm2_ep, psmx2_am_handlers, 2, psmx2_am_handlers_idx); if (err) return psmx2_errno(err); if ((psmx2_am_handlers_idx[0] != PSMX2_AM_RMA_HANDLER) || (psmx2_am_handlers_idx[1] != PSMX2_AM_ATOMIC_HANDLER)) { FI_WARN(&psmx2_prov, FI_LOG_CORE, "failed to register one or more AM handlers " "at indecies %d, %d\n", PSMX2_AM_RMA_HANDLER, PSMX2_AM_ATOMIC_HANDLER); return -FI_EBUSY; } psmx2_am_handlers_initialized = 1; } slist_init(&domain->rma_queue.list); slist_init(&domain->trigger_queue.list); fastlock_init(&domain->rma_queue.lock); fastlock_init(&domain->trigger_queue.lock); return err; } int psmx2_am_fini(struct psmx2_fid_domain *domain) { fastlock_destroy(&domain->rma_queue.lock); fastlock_destroy(&domain->trigger_queue.lock); psmx2_atomic_fini(); return 0; }
/********************************************************************\ * cellblock.h -- group of cells that act as cursor within a table * * * * 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; either version 2 of * * the License, or (at your option) any later version. * * * * 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, contact: * * * * Free Software Foundation Voice: +1-617-542-5942 * * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * * Boston, MA 02110-1301, USA gnu@gnu.org * * * \********************************************************************/ /** @addtogroup RegisterCore Register Core * @{ * @addtogroup Cellblock Cellblock * @brief A "Cellblock" is an array of active cells. The cells are laid out in * rows and columns. The cellblock serves as a convenient container for * organizing active cells in an array. Through the mechanism of Cursors * (defined below), it allows a group of cells to be treated as a single * transactional entity. That is, the cursor/cellblock allows all edits to a * groups of cells to be simultaneously committed or rejected by underlying * engines. This makes it appropriate for use as a GUI for * transaction-processing applications with two-phase commit requirements. * @{ */ /** @file cellblock.h * @brief Declarations for the CellBlock object * @author Copyright (c) 1988 Linas Vepstas * @author Copyright (c) 2000-2001 Dave Peticolas <dave@krondo.com> * * @details * The CellBlock struct is a rectangular grid of cells that * define an arrangement of cells. It is typically used to * define a virtual cursor within a larger table of cells. */ #ifndef XACC_CELL_BLOCK_H #define XACC_CELL_BLOCK_H #include "basiccell.h" #include "gtable.h" typedef struct { short num_rows; short num_cols; short start_col; short stop_col; char *cursor_name; GPtrArray *cells; /* Holds the CellBlockCell table */ } CellBlock; /** Create a new CellBlock on the heap. * @param rows Number of rows. * @param cols Number of columns. * @param cursor_name A string name for the CellBlock. It will be copied with a * new string on the heap. * @return a newly-allocated CellBlock which should be deleted with * gnc_cellblock_destroy. */ CellBlock * gnc_cellblock_new (int rows, int cols, const char *cursor_name); /** Delete a CellBlock and its Cells. * @param cellblock The CellBlock to destroy. */ void gnc_cellblock_destroy (CellBlock *cellblock); /** Add a cell to the CellBlock at the specified coordinates. The CellBlock * takes ownership of the Cell. If there's already a Cell at the location it * will be leaked, so callers should first call gnc_cellblock_get_cell() and * delete the result if it's not NULL. * @param cellblock The CellBlock * @param row The row at which to add the cell * @param col The column at which to add the cell * @param cell The cell to place at the coordinates. */ void gnc_cellblock_set_cell (CellBlock *cellblock, int row, int col, BasicCell *cell); /** Retrieve the Cell at the specified coordinates. * @param cellblock The CellBlock * @param row The row of the requested Cell * @param col The column of the requested Cell * @return A pointer to the requested Cell. */ BasicCell * gnc_cellblock_get_cell (CellBlock *cellblock, int row, int col); /** Searches by name for a particular cell in a CellBlock. Parameters @c row * and/or @c col may be @c NULL. * * @param cellblock a ::CellBlock to search * * @param cell_name the name of the cell to find * * @param row pointer for returning the row in which the cell was * found, or @c NULL * * @param col pointer for returning the column in which the cell was * found, or @c NULL * * @return the matching cell, or @c NULL */ BasicCell * gnc_cellblock_get_cell_by_name(CellBlock *cellblock, const char *cell_name, int *row, int *col); /** Return number of changed cells. * @param cursor The cellblock to query * @param include_conditional If TRUE counts conditionally-changed cells * @return The number of changed cells found. */ int gnc_cellblock_changed (CellBlock *cursor, gboolean include_conditional); /** Sets all cells in the cellblock to not changed. * @param cursor The cellblock. */ void gnc_cellblock_clear_changes (CellBlock *cursor); #endif /** @} */ /** @} */
/* { dg-do compile } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ /* { dg-options "-mdejagnu-cpu=power9" } */ /* This test should succeed on both 32- and 64-bit configurations. */ #include <altivec.h> int doTestBCDSignificance (_Decimal64 *p) { _Decimal64 source = *p; return __builtin_dfp_dtstsfi_eq (5, source); } /* { dg-final { scan-assembler "dtstsfi" } } */
/******************************************************************** * gnc-price-sql.h: load and save data to SQL * * * * 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; either version 2 of * * the License, or (at your option) any later version. * * * * 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, contact: * * * * Free Software Foundation Voice: +1-617-542-5942 * * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * * Boston, MA 02110-1301, USA gnu@gnu.org * \********************************************************************/ /** @file gnc-price-sql.h * @brief load and save data to SQL * @author Copyright (c) 2006-2008 Phil Longstaff <plongstaff@rogers.com> * * This file implements the top-level QofBackend API for saving/ * restoring data to/from an SQL database */ #ifndef GNC_PRICE_SQL_H #define GNC_PRICE_SQL_H #include "gnc-sql-object-backend.hpp" class GncSqlPriceBackend : public GncSqlObjectBackend { public: GncSqlPriceBackend(); void load_all(GncSqlBackend*) override; void create_tables(GncSqlBackend*) override; bool commit (GncSqlBackend* sql_be, QofInstance* inst) override; bool write(GncSqlBackend*) override; }; #endif /* GNC_PRICE_SQL_H */
/* * \brief L4lxapi library task functions * \author Stefan Kalkowski * \date 2011-04-29 */ /* * Copyright (C) 2011-2013 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. */ #ifndef _L4LX__L4LX_TASK_H_ #define _L4LX__L4LX_TASK_H_ #include <linux.h> namespace Fiasco { #include <l4/sys/types.h> } #ifdef __cplusplus extern "C" { #endif FASTCALL void l4lx_task_init(void); FASTCALL Fiasco::l4_cap_idx_t l4lx_task_number_allocate(void); FASTCALL int l4lx_task_number_free(Fiasco::l4_cap_idx_t task); FASTCALL int l4lx_task_get_new_task(Fiasco::l4_cap_idx_t parent_id, Fiasco::l4_cap_idx_t *id); FASTCALL int l4lx_task_create(Fiasco::l4_cap_idx_t task_no); FASTCALL int l4lx_task_create_thread_in_task(Fiasco::l4_cap_idx_t thread, Fiasco::l4_cap_idx_t task, Fiasco::l4_cap_idx_t pager, unsigned cpu); FASTCALL int l4lx_task_create_pager(Fiasco::l4_cap_idx_t task_no, Fiasco::l4_cap_idx_t pager); FASTCALL int l4lx_task_delete_thread(Fiasco::l4_cap_idx_t thread); FASTCALL int l4lx_task_delete_task(Fiasco::l4_cap_idx_t task, unsigned option); #ifdef __cplusplus } #endif #endif /* _L4LX__L4LX_TASK_H_ */
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CORE_KERNELS_MKL_MKL_TFCONV_OP_H_ #define TENSORFLOW_CORE_KERNELS_MKL_MKL_TFCONV_OP_H_ #ifdef INTEL_MKL #include <algorithm> #include <string> #include <vector> #include "tensorflow/core/framework/numeric_op.h" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/framework/tensor.h" #include "tensorflow/core/framework/tensor_shape.h" #include "tensorflow/core/kernels/ops_util.h" #include "tensorflow/core/platform/byte_order.h" #include "tensorflow/core/platform/cpu_info.h" #include "tensorflow/core/platform/macros.h" #include "tensorflow/core/util/mkl_util.h" #include "tensorflow/core/util/tensor_format.h" using mkldnn::stream; namespace tensorflow { typedef Eigen::ThreadPoolDevice CPUDevice; /////////////////////////////////////////////////////////// // Op kernel /////////////////////////////////////////////////////////// template <typename Device, typename T> class MklToTfOp : public OpKernel { public: explicit MklToTfOp(OpKernelConstruction* context) : OpKernel(context) { OP_REQUIRES_OK(context, context->GetAttr("data_format", &data_format_str)); OP_REQUIRES_OK(context, context->GetAttr("T", &op_data_type)); has_avx512f_ = port::TestCPUFeature(port::CPUFeature::AVX512F); } void Compute(OpKernelContext* context) override { ConvertMklToTf(this, context, data_format_str, op_data_type, has_avx512f_, 0); VLOG(1) << "MKLToTFConversion complete successfully."; } // TODO(bhavanis): Move the below ConvertMklToTf() to mkl_util.h static void ConvertMklToTf(OpKernel* op_kernel, OpKernelContext* context, string data_format_str, DataType op_data_type, bool has_avx512f, uint input_number) { try { // Check that input tensor is in MKL format. const Tensor& input_tensor = MklGetInput(context, input_number); MklDnnShape input_shape; GetMklShape(context, input_number, &input_shape); // if input is already in Tf format, then copy input tensor to output. if (!input_shape.IsMklTensor()) { context->set_output(input_number, input_tensor); VLOG(1) << "MKLToTFConversion: No conversion needed, " << "copying input to output"; return; } // Check that input data type is same as operator data type and that it // is same as output data type. DataType input_data_type = op_kernel->input_type(input_number); DataType output_data_type = op_kernel->output_type(input_number); CHECK_EQ(op_data_type, input_data_type); CHECK_EQ(op_data_type, output_data_type); auto cpu_engine = engine(engine::kind::cpu, 0); MklDnnData<T> input(&cpu_engine); // Get MKL layout of input tensor. auto input_mkl_md = input_shape.GetMklLayout(); // Get TensorFlow layout of input tensor. Expected output of conversion // has same layout as Tensorflow layout of input tensor. auto output_tf_md = input_shape.GetTfLayout(); // Set input MKL layout as the user layout. input.SetUsrMem(input_mkl_md, &input_tensor); // Allocate output tensor. TensorShape output_shape = input_shape.GetTfShape(); Tensor* output_tensor = nullptr; OP_REQUIRES_OK(context, context->allocate_output( input_number, output_shape, &output_tensor)); DCHECK(output_tensor); // Check if input needs to be reordered if (input.IsReorderNeeded(output_tf_md)) { // Insert reorder between MKL layout and TensorFlow layout OP_REQUIRES( context, input.CheckReorderToOpMem(output_tf_md, output_tensor, context), errors::Internal("MklToTfOp: Failed to create input reorder")); } else { // If not, just forward input tensor to output tensor. OP_REQUIRES(context, output_tensor->CopyFrom(input_tensor, output_shape), errors::Internal( "MklToTfOp: Failed to forward input tensor to output")); } } catch (mkldnn::error& e) { OP_REQUIRES_OK( context, errors::Aborted("Operation received an exception: Status: ", e.status, ", message: ", StringPiece(e.message), ", in file ", __FILE__, ":", __LINE__)); } } private: /// Data format of the operation string data_format_str; /// Data type of the operation DataType op_data_type; /// CPUIDInfo bool has_avx512f_ = false; }; /////////////////////////////////////////////////////////// // Register kernel /////////////////////////////////////////////////////////// #define REGISTER_CPU(T) \ REGISTER_KERNEL_BUILDER( \ Name("_MklToTf") \ .Device(DEVICE_CPU) \ .TypeConstraint<T>("T") \ .Label(mkl_op_registry::kMklLayoutDependentOpLabel), \ MklToTfOp<CPUDevice, T>); TF_CALL_NUMBER_TYPES(REGISTER_CPU); TF_CALL_QUANTIZED_TYPES(REGISTER_CPU); #undef REGISTER_CPU } // namespace tensorflow #endif // INTEL_MKL #endif // TENSORFLOW_CORE_KERNELS_MKL_MKL_TFCONV_OP_H_
/* * * Copyright 2015, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #ifndef GRPCXX_IMPL_CODEGEN_RPC_METHOD_H #define GRPCXX_IMPL_CODEGEN_RPC_METHOD_H #include <memory> #include <grpc++/impl/codegen/channel_interface.h> namespace grpc { class RpcMethod { public: enum RpcType { NORMAL_RPC = 0, CLIENT_STREAMING, // request streaming SERVER_STREAMING, // response streaming BIDI_STREAMING }; RpcMethod(const char* name, RpcType type) : name_(name), method_type_(type), channel_tag_(NULL) {} RpcMethod(const char* name, RpcType type, const std::shared_ptr<ChannelInterface>& channel) : name_(name), method_type_(type), channel_tag_(channel->RegisterMethod(name)) {} const char* name() const { return name_; } RpcType method_type() const { return method_type_; } void* channel_tag() const { return channel_tag_; } private: const char* const name_; const RpcType method_type_; void* const channel_tag_; }; } // namespace grpc #endif // GRPCXX_IMPL_CODEGEN_RPC_METHOD_H
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BLIMP_ENGINE_APP_BLIMP_URL_REQUEST_CONTEXT_GETTER_H_ #define BLIMP_ENGINE_APP_BLIMP_URL_REQUEST_CONTEXT_GETTER_H_ #include <memory> #include "base/files/file_path.h" #include "base/macros.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/content_browser_client.h" #include "net/url_request/url_request_context_getter.h" namespace base { class MessageLoop; class SingleThreadTaskRunner; } namespace net { class HostResolver; class NetworkDelegate; class NetLog; class ProxyConfigService; class ProxyService; } namespace blimp { namespace engine { // The URLRequestContextGetter for Blimp "user" requests. // System request context is handled in a separate class. class BlimpURLRequestContextGetter : public net::URLRequestContextGetter { public: // The content of |protocol_handlers| is is swapped into the new instance. BlimpURLRequestContextGetter( bool ignore_certificate_errors, const base::FilePath& base_path, const scoped_refptr<base::SingleThreadTaskRunner>& io_loop_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& file_loop_task_runner, content::ProtocolHandlerMap* protocol_handlers, content::URLRequestInterceptorScopedVector request_interceptors, net::NetLog* net_log); // net::URLRequestContextGetter implementation. net::URLRequestContext* GetURLRequestContext() override; scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() const override; net::HostResolver* host_resolver(); private: ~BlimpURLRequestContextGetter() override; bool ignore_certificate_errors_; base::FilePath base_path_; scoped_refptr<base::SingleThreadTaskRunner> io_loop_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> file_loop_task_runner_; net::NetLog* net_log_; std::unique_ptr<net::ProxyConfigService> proxy_config_service_; std::unique_ptr<net::URLRequestContext> url_request_context_; content::ProtocolHandlerMap protocol_handlers_; content::URLRequestInterceptorScopedVector request_interceptors_; DISALLOW_COPY_AND_ASSIGN(BlimpURLRequestContextGetter); }; } // namespace engine } // namespace blimp #endif // BLIMP_ENGINE_APP_BLIMP_URL_REQUEST_CONTEXT_GETTER_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_ #pragma once #include <vector> #include "base/basictypes.h" #include "base/compiler_specific.h" #include "chrome/browser/profiles/avatar_menu_model_observer.h" #include "ui/views/bubble/bubble_delegate.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/link_listener.h" class AvatarMenuModel; class Browser; namespace views { class CustomButton; class Link; class Separator; } // This bubble view is displayed when the user clicks on the avatar button. // It displays a list of profiles and allows users to switch between profiles. class AvatarMenuBubbleView : public views::BubbleDelegateView, public views::ButtonListener, public views::LinkListener, public AvatarMenuModelObserver { public: AvatarMenuBubbleView(views::View* anchor_view, views::BubbleBorder::ArrowLocation arrow_location, const gfx::Rect& anchor_rect, Browser* browser); virtual ~AvatarMenuBubbleView(); // views::View implementation. virtual gfx::Size GetPreferredSize() OVERRIDE; virtual void Layout() OVERRIDE; virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; // views::ButtonListener implementation. virtual void ButtonPressed(views::Button* sender, const views::Event& event) OVERRIDE; // views::LinkListener implementation. virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; // BubbleDelegate implementation. virtual gfx::Rect GetAnchorRect() OVERRIDE; virtual void Init() OVERRIDE; // AvatarMenuModelObserver implementation. virtual void OnAvatarMenuModelChanged( AvatarMenuModel* avatar_menu_model) OVERRIDE; private: views::Link* add_profile_link_; scoped_ptr<AvatarMenuModel> avatar_menu_model_; gfx::Rect anchor_rect_; Browser* browser_; std::vector<views::CustomButton*> item_views_; views::Separator* separator_; DISALLOW_COPY_AND_ASSIGN(AvatarMenuBubbleView); }; #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_MENU_BUBBLE_VIEW_H_
/* server/ip/gen/tcp.h */ #ifndef __SERVER__IP__GEN__TCP_H__ #define __SERVER__IP__GEN__TCP_H__ #define TCP_MIN_HDR_SIZE 20 #define TCP_MAX_HDR_SIZE 60 #define TCPPORT_TELNET 23 #define TCPPORT_FINGER 79 #define TCPPORT_RESERVED 1024 typedef u16_t tcpport_t; typedef U16_t Tcpport_t; /* for use in prototypes */ #endif /* __SERVER__IP__GEN__TCP_H__ */
#include "../../../src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h"
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_DELEGATE_H_ #define CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_DELEGATE_H_ #pragma once #include "base/basictypes.h" class TabContentsWrapper; // Objects implement this interface to get notified about changes in the // TabContentsWrapper and to provide necessary functionality. // // This is considered part of the TabContentsWrapper "core" interface. If a // piece of code interacts with TabContentWrappers, it is guaranteed that it // will need to handle all of these callbacks. class CoreTabHelperDelegate { public: virtual void SwapTabContents(TabContentsWrapper* old_tc, TabContentsWrapper* new_tc) = 0; protected: virtual ~CoreTabHelperDelegate(); }; #endif // CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_DELEGATE_H_
/* * Copyright (c) 2010 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ /*!\defgroup vp8_decoder WebM VP8/VP9 Decoder * \ingroup vp8 * * @{ */ /*!\file * \brief Provides definitions for using VP8 or VP9 within the vpx Decoder * interface. */ #ifndef VPX_VP8DX_H_ #define VPX_VP8DX_H_ #ifdef __cplusplus extern "C" { #endif /* Include controls common to both the encoder and decoder */ #include "./vp8.h" /*!\name Algorithm interface for VP8 * * This interface provides the capability to decode VP8 streams. * @{ */ extern vpx_codec_iface_t vpx_codec_vp8_dx_algo; extern vpx_codec_iface_t *vpx_codec_vp8_dx(void); /*!@} - end algorithm interface member group*/ /*!\name Algorithm interface for VP9 * * This interface provides the capability to decode VP9 streams. * @{ */ extern vpx_codec_iface_t vpx_codec_vp9_dx_algo; extern vpx_codec_iface_t *vpx_codec_vp9_dx(void); /*!@} - end algorithm interface member group*/ /*!\name Algorithm interface for VP10 * * This interface provides the capability to decode VP10 streams. * @{ */ extern vpx_codec_iface_t vpx_codec_vp10_dx_algo; extern vpx_codec_iface_t *vpx_codec_vp10_dx(void); /*!@} - end algorithm interface member group*/ /*!\enum vp8_dec_control_id * \brief VP8 decoder control functions * * This set of macros define the control functions available for the VP8 * decoder interface. * * \sa #vpx_codec_control */ enum vp8_dec_control_id { /** control function to get info on which reference frames were updated * by the last decode */ VP8D_GET_LAST_REF_UPDATES = VP8_DECODER_CTRL_ID_START, /** check if the indicated frame is corrupted */ VP8D_GET_FRAME_CORRUPTED, /** control function to get info on which reference frames were used * by the last decode */ VP8D_GET_LAST_REF_USED, /** decryption function to decrypt encoded buffer data immediately * before decoding. Takes a vpx_decrypt_init, which contains * a callback function and opaque context pointer. */ VPXD_SET_DECRYPTOR, VP8D_SET_DECRYPTOR = VPXD_SET_DECRYPTOR, /** control function to get the dimensions that the current frame is decoded * at. This may be different to the intended display size for the frame as * specified in the wrapper or frame header (see VP9D_GET_DISPLAY_SIZE). */ VP9D_GET_FRAME_SIZE, /** control function to get the current frame's intended display dimensions * (as specified in the wrapper or frame header). This may be different to * the decoded dimensions of this frame (see VP9D_GET_FRAME_SIZE). */ VP9D_GET_DISPLAY_SIZE, /** control function to get the bit depth of the stream. */ VP9D_GET_BIT_DEPTH, /** control function to set the byte alignment of the planes in the reference * buffers. Valid values are power of 2, from 32 to 1024. A value of 0 sets * legacy alignment. I.e. Y plane is aligned to 32 bytes, U plane directly * follows Y plane, and V plane directly follows U plane. Default value is 0. */ VP9_SET_BYTE_ALIGNMENT, /** control function to invert the decoding order to from right to left. The * function is used in a test to confirm the decoding independence of tile * columns. The function may be used in application where this order * of decoding is desired. * * TODO(yaowu): Rework the unit test that uses this control, and in a future * release, this test-only control shall be removed. */ VP9_INVERT_TILE_DECODE_ORDER, /** control function to set the skip loop filter flag. Valid values are * integers. The decoder will skip the loop filter when its value is set to * nonzero. If the loop filter is skipped the decoder may accumulate decode * artifacts. The default value is 0. */ VP9_SET_SKIP_LOOP_FILTER, VP8_DECODER_CTRL_ID_MAX }; /** Decrypt n bytes of data from input -> output, using the decrypt_state * passed in VPXD_SET_DECRYPTOR. */ typedef void (*vpx_decrypt_cb)(void *decrypt_state, const unsigned char *input, unsigned char *output, int count); /*!\brief Structure to hold decryption state * * Defines a structure to hold the decryption state and access function. */ typedef struct vpx_decrypt_init { /*! Decrypt callback. */ vpx_decrypt_cb decrypt_cb; /*! Decryption state. */ void *decrypt_state; } vpx_decrypt_init; /*!\brief A deprecated alias for vpx_decrypt_init. */ typedef vpx_decrypt_init vp8_decrypt_init; /*!\cond */ /*!\brief VP8 decoder control function parameter type * * Defines the data types that VP8D control functions take. Note that * additional common controls are defined in vp8.h * */ VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_UPDATES, int *) #define VPX_CTRL_VP8D_GET_LAST_REF_UPDATES VPX_CTRL_USE_TYPE(VP8D_GET_FRAME_CORRUPTED, int *) #define VPX_CTRL_VP8D_GET_FRAME_CORRUPTED VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_USED, int *) #define VPX_CTRL_VP8D_GET_LAST_REF_USED VPX_CTRL_USE_TYPE(VPXD_SET_DECRYPTOR, vpx_decrypt_init *) #define VPX_CTRL_VPXD_SET_DECRYPTOR VPX_CTRL_USE_TYPE(VP8D_SET_DECRYPTOR, vpx_decrypt_init *) #define VPX_CTRL_VP8D_SET_DECRYPTOR VPX_CTRL_USE_TYPE(VP9D_GET_DISPLAY_SIZE, int *) #define VPX_CTRL_VP9D_GET_DISPLAY_SIZE VPX_CTRL_USE_TYPE(VP9D_GET_BIT_DEPTH, unsigned int *) #define VPX_CTRL_VP9D_GET_BIT_DEPTH VPX_CTRL_USE_TYPE(VP9D_GET_FRAME_SIZE, int *) #define VPX_CTRL_VP9D_GET_FRAME_SIZE VPX_CTRL_USE_TYPE(VP9_INVERT_TILE_DECODE_ORDER, int) #define VPX_CTRL_VP9_INVERT_TILE_DECODE_ORDER /*!\endcond */ /*! @} - end defgroup vp8_decoder */ #ifdef __cplusplus } // extern "C" #endif #endif // VPX_VP8DX_H_
#include <linux/hardirq.h> #include <asm/x86_init.h> #include <xen/interface/xen.h> #include <xen/interface/sched.h> #include <xen/interface/vcpu.h> #include <xen/features.h> #include <xen/events.h> #include <asm/xen/hypercall.h> #include <asm/xen/hypervisor.h> #include "xen-ops.h" /* * Force a proper event-channel callback from Xen after clearing the * callback mask. We do this in a very simple manner, by making a call * down into Xen. The pending flag will be checked by Xen on return. */ void xen_force_evtchn_callback(void) { (void)HYPERVISOR_xen_version(0, NULL); } asmlinkage unsigned long xen_save_fl(void) { struct vcpu_info *vcpu; unsigned long flags; vcpu = this_cpu_read(xen_vcpu); /* flag has opposite sense of mask */ flags = !vcpu->evtchn_upcall_mask; /* convert to IF type flag -0 -> 0x00000000 -1 -> 0xffffffff */ return (-flags) & X86_EFLAGS_IF; } PV_CALLEE_SAVE_REGS_THUNK(xen_save_fl); __visible void xen_restore_fl(unsigned long flags) { struct vcpu_info *vcpu; /* convert from IF type flag */ flags = !(flags & X86_EFLAGS_IF); /* See xen_irq_enable() for why preemption must be disabled. */ preempt_disable(); vcpu = this_cpu_read(xen_vcpu); vcpu->evtchn_upcall_mask = flags; if (flags == 0) { barrier(); /* unmask then check (avoid races) */ if (unlikely(vcpu->evtchn_upcall_pending)) xen_force_evtchn_callback(); preempt_enable(); } else preempt_enable_no_resched(); } PV_CALLEE_SAVE_REGS_THUNK(xen_restore_fl); asmlinkage void xen_irq_disable(void) { /* There's a one instruction preempt window here. We need to make sure we're don't switch CPUs between getting the vcpu pointer and updating the mask. */ preempt_disable(); this_cpu_read(xen_vcpu)->evtchn_upcall_mask = 1; preempt_enable_no_resched(); } PV_CALLEE_SAVE_REGS_THUNK(xen_irq_disable); asmlinkage void xen_irq_enable(void) { struct vcpu_info *vcpu; /* * We may be preempted as soon as vcpu->evtchn_upcall_mask is * cleared, so disable preemption to ensure we check for * events on the VCPU we are still running on. */ preempt_disable(); vcpu = this_cpu_read(xen_vcpu); vcpu->evtchn_upcall_mask = 0; /* Doesn't matter if we get preempted here, because any pending event will get dealt with anyway. */ barrier(); /* unmask then check (avoid races) */ if (unlikely(vcpu->evtchn_upcall_pending)) xen_force_evtchn_callback(); preempt_enable(); } PV_CALLEE_SAVE_REGS_THUNK(xen_irq_enable); static void xen_safe_halt(void) { /* Blocking includes an implicit local_irq_enable(). */ if (HYPERVISOR_sched_op(SCHEDOP_block, NULL) != 0) BUG(); } static void xen_halt(void) { if (irqs_disabled()) HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL); else xen_safe_halt(); } static const struct pv_irq_ops xen_irq_ops __initconst = { .save_fl = PV_CALLEE_SAVE(xen_save_fl), .restore_fl = PV_CALLEE_SAVE(xen_restore_fl), .irq_disable = PV_CALLEE_SAVE(xen_irq_disable), .irq_enable = PV_CALLEE_SAVE(xen_irq_enable), .safe_halt = xen_safe_halt, .halt = xen_halt, #ifdef CONFIG_X86_64 .adjust_exception_frame = xen_adjust_exception_frame, #endif }; void __init xen_init_irq_ops(void) { /* For PVH we use default pv_irq_ops settings. */ if (!xen_feature(XENFEAT_hvm_callback_vector)) pv_irq_ops = xen_irq_ops; x86_init.irqs.intr_init = xen_init_IRQ; }
/* * Copyright 1997, 1998, 1999 Computing Research Labs, * New Mexico State University * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef lint static char rcsid[] = "$Id: utbmstub.c,v 1.1 1999/09/21 15:45:18 mleisher Exp $"; #endif #include "utbm.h" /* * This should be redefined to use the `isspace' function available in the * Unicode support on the platform where this is being used. */ #define _platform_isspace(x) 0 /* * Return non-zero for any character that should be considered the equivalent * of a space character. Return zero otherwise. */ int _utbm_isspace(ucs4_t c, int compress) { if (compress) return (c == 0x09 || c == 0x0a || c == 0x0d || c == 0x2028 || c == 0x2029 || _platform_isspace(c)) ? 1 : 0; return _platform_isspace(c); } /* * Return non-zero if the character is a control character, or zero otherwise. */ int _utbm_iscntrl(ucs4_t c) { return 0; } /* * Return non-zero if the character is a non-spacing character, or zero * otherwise. */ int _utbm_nonspacing(ucs4_t c) { return 0; } /* * Convert a character to lower case. */ ucs4_t _utbm_tolower(ucs4_t c) { return c; } /* * Convert a character to upper case. */ ucs4_t _utbm_toupper(ucs4_t c) { return c; } /* * Convert a character to title case. */ ucs4_t _utbm_totitle(ucs4_t c) { return c; }
#include <stdio.h> #include <stdlib.h> asm ( ".text;" ".globl _us;.globl _ss;.globl _uc;.globl _sc;" "_us:;_ss:;_uc:;_sc:;" "movl $0x1234ABCD, %eax;" "ret;" ); #if 1 #define us _us #define ss _ss #define uc _uc #define sc _sc #endif int main() { unsigned short us(void); short ss(void); unsigned char uc(void); signed char sc(void); unsigned short (*fpus)(void) = us; short (*fpss)(void) = ss; unsigned char (*fpuc)(void) = uc; signed char (*fpsc)(void) = sc; printf("%08X %08X\n", us() + 1, fpus() + 1); printf("%08X %08X\n", ss() + 1, fpss() + 1); printf("%08X %08X\n", uc() + 1, fpuc() + 1); printf("%08X %08X\n", sc() + 1, fpsc() + 1); printf("\n"); printf("%08X %08X\n", fpus() + 1, us() + 1); printf("%08X %08X\n", fpss() + 1, ss() + 1); printf("%08X %08X\n", fpuc() + 1, uc() + 1); printf("%08X %08X\n", fpsc() + 1, sc() + 1); return 0; }
/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ #include "test_sve_acle.h" /* ** mulh_u16_m_tied1: ** umulh z0\.h, p0/m, z0\.h, z1\.h ** ret */ TEST_UNIFORM_Z (mulh_u16_m_tied1, svuint16_t, z0 = svmulh_u16_m (p0, z0, z1), z0 = svmulh_m (p0, z0, z1)) /* ** mulh_u16_m_tied2: ** mov (z[0-9]+)\.d, z0\.d ** movprfx z0, z1 ** umulh z0\.h, p0/m, z0\.h, \1\.h ** ret */ TEST_UNIFORM_Z (mulh_u16_m_tied2, svuint16_t, z0 = svmulh_u16_m (p0, z1, z0), z0 = svmulh_m (p0, z1, z0)) /* ** mulh_u16_m_untied: ** movprfx z0, z1 ** umulh z0\.h, p0/m, z0\.h, z2\.h ** ret */ TEST_UNIFORM_Z (mulh_u16_m_untied, svuint16_t, z0 = svmulh_u16_m (p0, z1, z2), z0 = svmulh_m (p0, z1, z2)) /* ** mulh_w0_u16_m_tied1: ** mov (z[0-9]+\.h), w0 ** umulh z0\.h, p0/m, z0\.h, \1 ** ret */ TEST_UNIFORM_ZX (mulh_w0_u16_m_tied1, svuint16_t, uint16_t, z0 = svmulh_n_u16_m (p0, z0, x0), z0 = svmulh_m (p0, z0, x0)) /* ** mulh_w0_u16_m_untied: { xfail *-*-* } ** mov (z[0-9]+\.h), w0 ** movprfx z0, z1 ** umulh z0\.h, p0/m, z0\.h, \1 ** ret */ TEST_UNIFORM_ZX (mulh_w0_u16_m_untied, svuint16_t, uint16_t, z0 = svmulh_n_u16_m (p0, z1, x0), z0 = svmulh_m (p0, z1, x0)) /* ** mulh_11_u16_m_tied1: ** mov (z[0-9]+\.h), #11 ** umulh z0\.h, p0/m, z0\.h, \1 ** ret */ TEST_UNIFORM_Z (mulh_11_u16_m_tied1, svuint16_t, z0 = svmulh_n_u16_m (p0, z0, 11), z0 = svmulh_m (p0, z0, 11)) /* ** mulh_11_u16_m_untied: { xfail *-*-* } ** mov (z[0-9]+\.h), #11 ** movprfx z0, z1 ** umulh z0\.h, p0/m, z0\.h, \1 ** ret */ TEST_UNIFORM_Z (mulh_11_u16_m_untied, svuint16_t, z0 = svmulh_n_u16_m (p0, z1, 11), z0 = svmulh_m (p0, z1, 11)) /* ** mulh_u16_z_tied1: ** movprfx z0\.h, p0/z, z0\.h ** umulh z0\.h, p0/m, z0\.h, z1\.h ** ret */ TEST_UNIFORM_Z (mulh_u16_z_tied1, svuint16_t, z0 = svmulh_u16_z (p0, z0, z1), z0 = svmulh_z (p0, z0, z1)) /* ** mulh_u16_z_tied2: ** movprfx z0\.h, p0/z, z0\.h ** umulh z0\.h, p0/m, z0\.h, z1\.h ** ret */ TEST_UNIFORM_Z (mulh_u16_z_tied2, svuint16_t, z0 = svmulh_u16_z (p0, z1, z0), z0 = svmulh_z (p0, z1, z0)) /* ** mulh_u16_z_untied: ** ( ** movprfx z0\.h, p0/z, z1\.h ** umulh z0\.h, p0/m, z0\.h, z2\.h ** | ** movprfx z0\.h, p0/z, z2\.h ** umulh z0\.h, p0/m, z0\.h, z1\.h ** ) ** ret */ TEST_UNIFORM_Z (mulh_u16_z_untied, svuint16_t, z0 = svmulh_u16_z (p0, z1, z2), z0 = svmulh_z (p0, z1, z2)) /* ** mulh_w0_u16_z_tied1: ** mov (z[0-9]+\.h), w0 ** movprfx z0\.h, p0/z, z0\.h ** umulh z0\.h, p0/m, z0\.h, \1 ** ret */ TEST_UNIFORM_ZX (mulh_w0_u16_z_tied1, svuint16_t, uint16_t, z0 = svmulh_n_u16_z (p0, z0, x0), z0 = svmulh_z (p0, z0, x0)) /* ** mulh_w0_u16_z_untied: ** mov (z[0-9]+\.h), w0 ** ( ** movprfx z0\.h, p0/z, z1\.h ** umulh z0\.h, p0/m, z0\.h, \1 ** | ** movprfx z0\.h, p0/z, \1 ** umulh z0\.h, p0/m, z0\.h, z1\.h ** ) ** ret */ TEST_UNIFORM_ZX (mulh_w0_u16_z_untied, svuint16_t, uint16_t, z0 = svmulh_n_u16_z (p0, z1, x0), z0 = svmulh_z (p0, z1, x0)) /* ** mulh_11_u16_z_tied1: ** mov (z[0-9]+\.h), #11 ** movprfx z0\.h, p0/z, z0\.h ** umulh z0\.h, p0/m, z0\.h, \1 ** ret */ TEST_UNIFORM_Z (mulh_11_u16_z_tied1, svuint16_t, z0 = svmulh_n_u16_z (p0, z0, 11), z0 = svmulh_z (p0, z0, 11)) /* ** mulh_11_u16_z_untied: ** mov (z[0-9]+\.h), #11 ** ( ** movprfx z0\.h, p0/z, z1\.h ** umulh z0\.h, p0/m, z0\.h, \1 ** | ** movprfx z0\.h, p0/z, \1 ** umulh z0\.h, p0/m, z0\.h, z1\.h ** ) ** ret */ TEST_UNIFORM_Z (mulh_11_u16_z_untied, svuint16_t, z0 = svmulh_n_u16_z (p0, z1, 11), z0 = svmulh_z (p0, z1, 11)) /* ** mulh_u16_x_tied1: ** umulh z0\.h, p0/m, z0\.h, z1\.h ** ret */ TEST_UNIFORM_Z (mulh_u16_x_tied1, svuint16_t, z0 = svmulh_u16_x (p0, z0, z1), z0 = svmulh_x (p0, z0, z1)) /* ** mulh_u16_x_tied2: ** umulh z0\.h, p0/m, z0\.h, z1\.h ** ret */ TEST_UNIFORM_Z (mulh_u16_x_tied2, svuint16_t, z0 = svmulh_u16_x (p0, z1, z0), z0 = svmulh_x (p0, z1, z0)) /* ** mulh_u16_x_untied: ** ( ** movprfx z0, z1 ** umulh z0\.h, p0/m, z0\.h, z2\.h ** | ** movprfx z0, z2 ** umulh z0\.h, p0/m, z0\.h, z1\.h ** ) ** ret */ TEST_UNIFORM_Z (mulh_u16_x_untied, svuint16_t, z0 = svmulh_u16_x (p0, z1, z2), z0 = svmulh_x (p0, z1, z2)) /* ** mulh_w0_u16_x_tied1: ** mov (z[0-9]+\.h), w0 ** umulh z0\.h, p0/m, z0\.h, \1 ** ret */ TEST_UNIFORM_ZX (mulh_w0_u16_x_tied1, svuint16_t, uint16_t, z0 = svmulh_n_u16_x (p0, z0, x0), z0 = svmulh_x (p0, z0, x0)) /* ** mulh_w0_u16_x_untied: ** mov z0\.h, w0 ** umulh z0\.h, p0/m, z0\.h, z1\.h ** ret */ TEST_UNIFORM_ZX (mulh_w0_u16_x_untied, svuint16_t, uint16_t, z0 = svmulh_n_u16_x (p0, z1, x0), z0 = svmulh_x (p0, z1, x0)) /* ** mulh_11_u16_x_tied1: ** mov (z[0-9]+\.h), #11 ** umulh z0\.h, p0/m, z0\.h, \1 ** ret */ TEST_UNIFORM_Z (mulh_11_u16_x_tied1, svuint16_t, z0 = svmulh_n_u16_x (p0, z0, 11), z0 = svmulh_x (p0, z0, 11)) /* ** mulh_11_u16_x_untied: ** mov z0\.h, #11 ** umulh z0\.h, p0/m, z0\.h, z1\.h ** ret */ TEST_UNIFORM_Z (mulh_11_u16_x_untied, svuint16_t, z0 = svmulh_n_u16_x (p0, z1, 11), z0 = svmulh_x (p0, z1, 11))
// eCos memory layout - Fri Oct 20 05:47:38 2000 // This is a generated file - do not edit #ifndef __ASSEMBLER__ #include <cyg/infra/cyg_type.h> #include <stddef.h> #endif #define CYGMEM_REGION_ram (0) #define CYGMEM_REGION_ram_SIZE (0xbfffff) #define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) #ifndef __ASSEMBLER__ extern char CYG_LABEL_NAME (__heap1) []; #endif #define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1)) #define CYGMEM_SECTION_heap1_SIZE (0xbfffff - (size_t) CYG_LABEL_NAME (__heap1))
/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2014 Freescale Semiconductor, Inc. * */ #ifndef _SHA_H #define _SHA_H #include <fsl_sec.h> #include <hash.h> #include "jr.h" /* We support at most 32 Scatter/Gather Entries.*/ #define MAX_SG_32 32 /* * Hash context contains the following fields * @sha_desc: Sha Descriptor * @sg_num: number of entries in sg table * @len: total length of buffer * @sg_tbl: sg entry table * @hash: index to the hash calculated */ struct sha_ctx { uint32_t sha_desc[64]; uint32_t sg_num; uint32_t len; struct sg_entry sg_tbl[MAX_SG_32]; u8 hash[HASH_MAX_DIGEST_SIZE]; }; #endif
/* * Copyright (C) 2005-2013 Team XBMC * http://www.xbmc.org * * 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, either version 2 of the License, or * (at your option) any later version. * * 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, see <http://www.gnu.org/licenses/>. * */ #pragma once #ifdef TSREADER_DEBUG #define TSDEBUG XBMC->Log #else #ifdef _MSC_VER #define TSDEBUG #else #define TSDEBUG(...) #endif #endif
/* *************************************************************************************** * * sun8iw1p1_vfe_cfg.h * * Hawkview ISP - sun8iw1p1_vfe_cfg.h module * * Copyright (c) 2014 by Allwinnertech Co., Ltd. http://www.allwinnertech.com * * Version Author Date Description * * 2.0 Yang Feng 2014/07/24 Second Version * **************************************************************************************** */ #ifndef _SUN8IW1P1_VFE_CFG_H_ #define _SUN8IW1P1_VFE_CFG_H_ #define VFE_ISP_REGULATOR "" #define VFE_CSI_REGULATOR "" #define CSI0_REGS_BASE 0x01cb0000 #define CSI1_REGS_BASE 0x01cb3000 #define ISP_REGS_BASE 0x01cb8000 #define GPIO_REGS_VBASE 0xf1c20800 #define CPU_DRAM_PADDR_ORG 0x40000000 #define HW_DMA_OFFSET 0x00000000 #define MAX_VFE_INPUT 2 //the maximum number of input source of video front end #define VFE_CORE_CLK CSI0_S_CLK #define VFE_CORE_CLK_SRC PLL10_CLK #define VFE_MASTER_CLK0 CSI0_M_CLK #define VFE_MASTER_CLK1 CSI1_M_CLK #define VFE_MASTER_CLK_24M_SRC HOSC_CLK #define VFE_MASTER_CLK_PLL_SRC PLL7_CLK #define VFE_MIPI_DPHY_CLK MIPICSI_CLK #define VFE_MIPI_DPHY_CLK_SRC PLL7_CLK #define VFE_MIPI_CSI_CLK VFE_CLK_NOT_EXIST #define VFE_MIPI_CSI_CLK_SRC VFE_CLK_NOT_EXIST #define VFE_VPU_CLK VFE_CLK_NOT_EXIST //set vfe core clk base on sensor size #define CORE_CLK_RATE_FOR_2M (108*1000*1000) #define CORE_CLK_RATE_FOR_3M (216*1000*1000) #define CORE_CLK_RATE_FOR_5M (216*1000*1000) #define CORE_CLK_RATE_FOR_8M (432*1000*1000) #define CORE_CLK_RATE_FOR_16M (500*1000*1000) //CSI & ISP size configs #define CSI0_REG_SIZE 0x1000 #define MIPI_CSI_REG_SIZE 0x1000 #define MIPI_DPHY_REG_SIZE 0x1000 #define CSI0_CCI_REG_SIZE 0x1000 #define CSI1_REG_SIZE 0x1000 #define CSI1_CCI_REG_SIZE 0x1000 #define ISP_REG_SIZE 0x1000 #define ISP_LOAD_REG_SIZE 0x1000 #define ISP_SAVED_REG_SIZE 0x1000 //ISP size configs //stat size configs #define ISP_STAT_TOTAL_SIZE 0x1700 #define ISP_STAT_HIST_MEM_SIZE 0x0200 #define ISP_STAT_AE_MEM_SIZE 0x0c00 #define ISP_STAT_AWB_MEM_SIZE 0x0500 #define ISP_STAT_AF_MEM_SIZE 0x0200 #define ISP_STAT_AFS_MEM_SIZE 0x0200 #define ISP_STAT_AWB_WIN_MEM_SIZE 0x0000 #define ISP_STAT_HIST_MEM_OFS 0x0 #define ISP_STAT_AE_MEM_OFS (ISP_STAT_HIST_MEM_OFS + ISP_STAT_HIST_MEM_SIZE) #define ISP_STAT_AWB_MEM_OFS (ISP_STAT_AE_MEM_OFS + ISP_STAT_AE_MEM_SIZE) #define ISP_STAT_AF_MEM_OFS (ISP_STAT_AWB_MEM_OFS + ISP_STAT_AWB_MEM_SIZE) #define ISP_STAT_AFS_MEM_OFS (ISP_STAT_AF_MEM_OFS + ISP_STAT_AF_MEM_SIZE) #define ISP_STAT_AWB_WIN_MEM_OFS (ISP_STAT_AFS_MEM_OFS + ISP_STAT_AFS_MEM_SIZE) //table size configs #define ISP_LINEAR_LUT_LENS_GAMMA_MEM_SIZE 0x1000 #define ISP_LUT_MEM_SIZE 0x0400 #define ISP_LENS_MEM_SIZE 0x0600 #define ISP_GAMMA_MEM_SIZE 0x0200 #define ISP_LINEAR_MEM_SIZE 0x0 #define ISP_DRC_DISC_MEM_SIZE 0x0200 #define ISP_DRC_MEM_SIZE 0x0200 #define ISP_DISC_MEM_SIZE 0 #define MAX_CH_NUM 4 #define MAX_INPUT_NUM 2 //the maximum number of device connected to the same bus #define MAX_ISP_STAT_BUF 5 //the maximum number of isp statistic buffer #define MAX_SENSOR_DETECT_NUM 3 //the maximum number of detect sensor on the same bus. #define MAX_AF_WIN_NUM 1 #define MAX_AE_WIN_NUM 1 #endif /*_SUN8IW1P1_VFE_CFG_H_*/
#ifndef FRAME_VIEWER_PLUGIN_H #define FRAME_VIEWER_PLUGIN_H class QAction; class JobAssignment; class FrameViewerPlugin { public: FrameViewerPlugin(){} virtual ~FrameViewerPlugin(){} virtual QString name(){return QString();}; virtual QString icon(){return QString();}; virtual void view(const JobAssignment &){}; virtual bool enabled(const JobAssignment &){return true;}; }; #endif // FRAME_VIEWER_PLUGIN_H
/* * Copyright (C) 2010-2012 OregonCore <http://www.oregoncore.com/> * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2012 MaNGOS <http://getmangos.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; either version 2 of the License, or (at your * option) any later version. * * 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, see <http://www.gnu.org/licenses/>. */ #ifndef OREGONCORE_PROGRESSBAR_H #define OREGONCORE_PROGRESSBAR_H #include <stdio.h> #include "Platform/Define.h" class barGoLink { static char const * const empty; static char const * const full; int rec_no; int rec_pos; int num_rec; int indic_len; public: void step( void ); barGoLink( int ); ~barGoLink(); }; #endif
/* * opencog/embodiment/Control/PredicateUpdaters/PredicatesUpdater.h * * Copyright (C) 2002-2009 Novamente LLC * All Rights Reserved * Author(s): Carlos Lopes * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License v3 as * published by the Free Software Foundation and including the exceptions * at http://opencog.org/wiki/Licenses * * 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 Affero General Public License * along with this program; if not, write to: * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /** * Update all is_X predicates once a XML message has been processed by the * PAI component. */ #ifndef PREDICATESUPDATER_H_ #define PREDICATESUPDATER_H_ #include "BasicPredicateUpdater.h" #include <opencog/embodiment/Control/AvatarInterface.h> #include <opencog/atomspace/AtomSpace.h> #include <vector> using namespace opencog; namespace opencog { namespace oac { class PredicatesUpdater { private: /** * holds all predicate updaters to be called when the update action * takes place */ std::vector<BasicPredicateUpdater *> updaters; BasicPredicateUpdater* petPsychePredicatesUpdater; AtomSpace &atomSpace; std::string petId; public: PredicatesUpdater(AtomSpace &_atomSpace, const std::string &_petId); ~PredicatesUpdater(); /** * Update the predicates based on the objects that were created or changed * via a PVPMessage processed by the PAI component. * * @param objects A std::vector containing the handles of all OBJECT_NODES * that were updated * @param timestamp The current timestamp in the virtual world. */ void update(std::vector<Handle> & objects, octime_t timestamp); };// class } } // namespace opencog::oac #endif /*PREDICATEUPDATER_H_*/
/* * This file is part of Cockpit. * * Copyright (C) 2014 Red Hat, Inc. * * Cockpit is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * Cockpit is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Cockpit; If not, see <http://www.gnu.org/licenses/>. */ #ifndef COCKPIT_MOUNT_MONITOR_H__ #define COCKPIT_MOUNT_MONITOR_H__ #include "types.h" G_BEGIN_DECLS #define TYPE_MOUNT_MONITOR (mount_monitor_get_type ()) #define MOUNT_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_MOUNT_MONITOR, MountMonitor)) #define IS_MOUNT_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_MOUNT_MONITOR)) GType mount_monitor_get_type (void) G_GNUC_CONST; CockpitMultiResourceMonitor * mount_monitor_new (GObject *tick_source); G_END_DECLS #endif /* COCKPIT_MOUNT_MONITOR_H__ */
// // NSDictionary+HYBUnicodeReadable.h // demo // // Created by huangyibiao on 15/12/29. // Copyright © 2015年 huangyibiao. All rights reserved. // #import <Foundation/Foundation.h> /*! * @author 黄仪标, 16-12-29 10:12:52 * * 请不要删除作者信息 * * @blog article http://www.henishuo.com/ios-unicode-readable/ * @github https://github.com/CoderJackyHuang/HYBUnicodeReadable * @email huangyibiao520@163.com * @sinaweibo 标哥Jacky */ @interface NSDictionary (HYBUnicodeReadable) @end
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_H_ #define CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_H_ #include "ui/base/page_transition_types.h" #include "ui/base/window_open_disposition.h" #include "url/gurl.h" class ExtensionAction; class LocationBarTesting; class OmniboxView; class Profile; namespace content { class WebContents; } namespace extensions { class Extension; } // The LocationBar class is a virtual interface, defining access to the // window's location bar component. This class exists so that cross-platform // components like the browser command system can talk to the platform // specific implementations of the location bar control. It also allows the // location bar to be mocked for testing. class LocationBar { public: explicit LocationBar(Profile* profile); // Shows the first run bubble anchored to the location bar. virtual void ShowFirstRunBubble() = 0; // The details necessary to open the user's desired omnibox match. virtual GURL GetDestinationURL() const = 0; virtual WindowOpenDisposition GetWindowOpenDisposition() const = 0; virtual ui::PageTransition GetPageTransition() const = 0; // Accepts the current string of text entered in the location bar. virtual void AcceptInput() = 0; // Focuses the location bar. Optionally also selects its contents. virtual void FocusLocation(bool select_all) = 0; // Clears the location bar, inserts an annoying little "?" turd and sets // focus to it. virtual void FocusSearch() = 0; // Updates the state of the images showing the content settings status. virtual void UpdateContentSettingsIcons() = 0; // Updates the password icon and pops up a bubble from the icon if needed. virtual void UpdateManagePasswordsIconAndBubble() = 0; // Updates the state of the page actions. virtual void UpdatePageActions() = 0; // Updates the visibility of the bookmark star. virtual void UpdateBookmarkStarVisibility() = 0; // Updates the visibility of the location bar. Animates the transition if // |animate| is true. virtual void UpdateLocationBarVisibility(bool visible, bool animate) = 0; // Shows the popup for the given |extension| and, if |grant_active_tab| is // true, grants the extension active tab permissions. // Returns true if a popup was shown. virtual bool ShowPageActionPopup(const extensions::Extension* extension, bool grant_active_tab) = 0; // Updates the state of the button to open a PDF in Adobe Reader. virtual void UpdateOpenPDFInReaderPrompt() = 0; // Updates the generated credit card view. This view serves as an anchor for // the generated credit card bubble, which can show on successful generation // of a new credit card number. virtual void UpdateGeneratedCreditCardView() = 0; // Saves the state of the location bar to the specified WebContents, so that // it can be restored later. (Done when switching tabs). virtual void SaveStateToContents(content::WebContents* contents) = 0; // Reverts the location bar. The bar's permanent text will be shown. virtual void Revert() = 0; virtual const OmniboxView* GetOmniboxView() const = 0; virtual OmniboxView* GetOmniboxView() = 0; // Returns a pointer to the testing interface. virtual LocationBarTesting* GetLocationBarForTesting() = 0; Profile* profile() { return profile_; } protected: virtual ~LocationBar(); // Checks if any extension has requested that the bookmark star be hidden. bool IsBookmarkStarHiddenByExtension() const; private: Profile* profile_; DISALLOW_COPY_AND_ASSIGN(LocationBar); }; class LocationBarTesting { public: // Returns the total number of page actions in the Omnibox. virtual int PageActionCount() = 0; // Returns the number of visible page actions in the Omnibox. virtual int PageActionVisibleCount() = 0; // Returns the ExtensionAction at |index|. virtual ExtensionAction* GetPageAction(size_t index) = 0; // Returns the visible ExtensionAction at |index|. virtual ExtensionAction* GetVisiblePageAction(size_t index) = 0; // Simulates a left mouse pressed on the visible page action at |index|. virtual void TestPageActionPressed(size_t index) = 0; // Returns whether or not the bookmark star decoration is visible. virtual bool GetBookmarkStarVisibility() = 0; protected: virtual ~LocationBarTesting() {} }; #endif // CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_H_
/* * Software License Agreement (BSD License) * * Point Cloud Library (PCL) - www.pointclouds.org * Copyright (c) 2010-2011, Willow Garage, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Willow Garage, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ #ifndef PCL_RECOGNITION_DOTMOD #define PCL_RECOGNITION_DOTMOD #include <vector> #include <cstddef> #include <string.h> #include <pcl/pcl_macros.h> #include <pcl/recognition/dot_modality.h> #include <pcl/recognition/dense_quantized_multi_mod_template.h> #include <pcl/recognition/mask_map.h> #include <pcl/recognition/region_xy.h> namespace pcl { struct DOTMODDetection { size_t bin_x; size_t bin_y; size_t template_id; float score; }; /** * \brief Template matching using the DOTMOD approach. * \author Stefan Holzer, Stefan Hinterstoisser */ class PCL_EXPORTS DOTMOD { public: /** \brief Constructor */ DOTMOD (size_t template_width, size_t template_height); /** \brief Destructor */ virtual ~DOTMOD (); /** \brief Creates a template from the specified data and adds it to the matching queue. * \param * \param * \param */ size_t createAndAddTemplate (const std::vector<DOTModality*> & modalities, const std::vector<MaskMap*> & masks, size_t template_anker_x, size_t template_anker_y, const RegionXY & region); void detectTemplates (const std::vector<DOTModality*> & modalities, float template_response_threshold, std::vector<DOTMODDetection> & detections, const size_t bin_size) const; inline const DenseQuantizedMultiModTemplate & getTemplate (size_t template_id) const { return (templates_[template_id]); } inline size_t getNumOfTemplates () { return (templates_.size ()); } void saveTemplates (const char * file_name) const; void loadTemplates (const char * file_name); void serialize (std::ostream & stream) const; void deserialize (std::istream & stream); private: /** template width */ size_t template_width_; /** template height */ size_t template_height_; /** template storage */ std::vector<DenseQuantizedMultiModTemplate> templates_; }; } #endif
// // TDFResource.h // DFImageManager // // Created by Alexander Grebenyuk on 2/28/15. // Copyright (c) 2015 Alexander Grebenyuk. All rights reserved. // #import <Foundation/Foundation.h> @interface TDFMockResource : NSObject <NSCopying> @property (nonatomic, readonly) NSString *ID; - (instancetype)initWithID:(NSString *)ID NS_DESIGNATED_INITIALIZER; - (instancetype)init NS_UNAVAILABLE; + (instancetype)resourceWithID:(NSString *)ID; @end
#define MICROPY_HW_BOARD_NAME "ItsyBitsy M4 Express" #define MICROPY_HW_MCU_NAME "SAMD51G19A" #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) #define MICROPY_PY_BUILTINS_COMPLEX (0) #define MICROPY_PY_MATH (0) #define MICROPY_PY_CMATH (0)
/*========================================================================= Program: Visualization Toolkit Module: vtkWeakPointer.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkWeakPointer - a weak reference to a vtkObject. // .SECTION Description // A weak reference to a vtkObject, which means that assigning // a vtkObject to the vtkWeakPointer does not affect the reference count of the // vtkObject. However, when the vtkObject is destroyed, the vtkWeakPointer gets // initialized to NULL, thus avoiding any dangling references. // // \code // vtkTable *table = vtkTable::New(); // vtkWeakPointer<vtkTable> weakTable = table; // \endcode // // Some time later the table may be deleted, but if it is tested for null then // the weak pointer will not leave a dangling pointer. // // \code // table->Delete(); // if (weakTable) // { // // Never executed as the weak table pointer will be null here // cout << "Number of columns in table: " << weakTable->GetNumberOfColumns() // << endl; // } // \endcode #ifndef __vtkWeakPointer_h #define __vtkWeakPointer_h #include "vtkWeakPointerBase.h" template <class T> class vtkWeakPointer: public vtkWeakPointerBase { public: // Description: // Initialize smart pointer to NULL. vtkWeakPointer() {} // Description: // Initialize smart pointer to given object. vtkWeakPointer(T* r): vtkWeakPointerBase(r) {} // Description: // Initialize smart pointer with the given smart pointer. vtkWeakPointer(const vtkWeakPointerBase& r): vtkWeakPointerBase(r) {} // Description: // Assign object to reference. vtkWeakPointer& operator=(T* r) { this->vtkWeakPointerBase::operator=(r); return *this; } // Description: // Assign object to reference. vtkWeakPointer& operator=(const vtkWeakPointerBase& r) { this->vtkWeakPointerBase::operator=(r); return *this; } // Description: // Get the contained pointer. T* GetPointer() const { return static_cast<T*>(this->Object); } // Description: // Get the contained pointer. operator T* () const { return static_cast<T*>(this->Object); } // Description: // Dereference the pointer and return a reference to the contained // object. T& operator*() const { return *static_cast<T*>(this->Object); } // Description: // Provides normal pointer target member access using operator ->. T* operator->() const { return static_cast<T*>(this->Object); } // Work-around for HP and IBM overload resolution bug. Since // NullPointerOnly is a private type the only pointer value that can // be passed by user code is a null pointer. This operator will be // chosen by the compiler when comparing against null explicitly and // avoid the bogus ambiguous overload error. #if defined(__HP_aCC) || defined(__IBMCPP__) # define VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND(op) \ vtkstd_bool operator op (NullPointerOnly*) const \ { \ return ::operator op (*this, 0); \ } private: class NullPointerOnly {}; public: VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND(==) VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND(!=) VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND(<) VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND(<=) VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND(>) VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND(>=) # undef VTK_WEAK_POINTER_DEFINE_OPERATOR_WORKAROUND #endif protected: vtkWeakPointer(T* r, const NoReference& n): vtkWeakPointerBase(r, n) {} private: // These are purposely not implemented to prevent callers from // trying to take references from other smart pointers. void TakeReference(const vtkWeakPointerBase&); // Not implemented. static void Take(const vtkWeakPointerBase&); // Not implemented. }; #define VTK_WEAK_POINTER_DEFINE_OPERATOR(op) \ template <class T> \ inline vtkstd_bool \ operator op (const vtkWeakPointer<T>& l, const vtkWeakPointer<T>& r) \ { \ return (l.GetPointer() op r.GetPointer()); \ } \ template <class T> \ inline vtkstd_bool operator op (T* l, const vtkWeakPointer<T>& r) \ { \ return (l op r.GetPointer()); \ } \ template <class T> \ inline vtkstd_bool operator op (const vtkWeakPointer<T>& l, T* r) \ { \ return (l.GetPointer() op r); \ } // Description: // Compare smart pointer values. VTK_WEAK_POINTER_DEFINE_OPERATOR(==) VTK_WEAK_POINTER_DEFINE_OPERATOR(!=) VTK_WEAK_POINTER_DEFINE_OPERATOR(<) VTK_WEAK_POINTER_DEFINE_OPERATOR(<=) VTK_WEAK_POINTER_DEFINE_OPERATOR(>) VTK_WEAK_POINTER_DEFINE_OPERATOR(>=) #undef VTK_WEAK_POINTER_DEFINE_OPERATOR // Description: // Streaming operator to print smart pointer like regular pointers. template <class T> inline ostream& operator << (ostream& os, const vtkWeakPointer<T>& p) { return os << static_cast<const vtkWeakPointerBase&>(p); } #endif
/* * Copyright (C) 2010 Andreas Steffen * HSR Hochschule fuer Technik Rapperswil * * 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; either version 2 of the License, or (at your * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. * * 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. */ /** * @defgroup tnccs_11 tnccs_11 * @ingroup cplugins * * @defgroup tnccs_11_plugin tnccs_11_plugin * @{ @ingroup tnccs_11 */ #ifndef TNCCS_11_PLUGIN_H_ #define TNCCS_11_PLUGIN_H_ #include <plugins/plugin.h> typedef struct tnccs_11_plugin_t tnccs_11_plugin_t; /** * EAP-TNC plugin */ struct tnccs_11_plugin_t { /** * implements plugin interface */ plugin_t plugin; }; #endif /** TNCCS_11_PLUGIN_H_ @}*/
/* * (C) 2007-2010 Taobao Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * * * Version: 0.1: ob_tablet_location_list.h,v 0.1 2010/09/26 14:01:30 zhidong Exp $ * * Authors: * chuanhui <xielun.szd@taobao.com> * - some work details if you want * */ #ifndef OB_COMMON_TABLET_LOCATION_ITEM_H_ #define OB_COMMON_TABLET_LOCATION_ITEM_H_ #include "common/ob_string_buf.h" #include "common/ob_tablet_info.h" // ObTabletLocation using namespace oceanbase::common; namespace oceanbase { namespace common { /// server and access err times struct ObTabletLocationItem { static const int64_t MAX_ERR_TIMES = 30; int64_t err_times_; common::ObTabletLocation server_; ObTabletLocationItem() : err_times_(0) {} }; /// tablet location item info class ObTabletLocationList { public: ObTabletLocationList(); virtual ~ObTabletLocationList(); public: static const int32_t MAX_REPLICA_COUNT = 3; /// operator = the static content not contain the range buffer ObTabletLocationList & operator = (const ObTabletLocationList & other); /// add a tablet location to item list int add(const common::ObTabletLocation & location); /// del the index pos TabletLocation int del(const int64_t index, ObTabletLocationItem & location); /// set item invalid status int set_item_invalid(const ObTabletLocationItem & location); /// set item valid status void set_item_valid(const int64_t timestamp); /// get valid item count int64_t get_valid_count(void) const; /// operator random access ObTabletLocationItem & operator[] (const uint64_t index); /// sort the server list int sort(const common::ObServer & server); /// current tablet locastion server count int64_t size(void) const; /// clear all items void clear(void); /// get modify timestamp int64_t get_timestamp(void) const; /// set timestamp void set_timestamp(const int64_t timestamp); /// dump all info void print_info(void) const; int set_tablet_range(const common::ObNewRange & tablet_range); const common::ObNewRange & get_tablet_range() const; void set_buffer(common::ObStringBuf & buf); const common::ObStringBuf * get_buffer(void) const; /// serailize or deserialization NEED_SERIALIZE_AND_DESERIALIZE; private: int64_t cur_count_; int64_t timestamp_; common::ObNewRange tablet_range_; common::ObStringBuf *tablet_range_rowkey_buf_; ObTabletLocationItem locations_[MAX_REPLICA_COUNT]; }; inline void ObTabletLocationList::set_buffer(common::ObStringBuf & buf) { tablet_range_rowkey_buf_ = &buf; } inline const common::ObStringBuf * ObTabletLocationList::get_buffer(void) const { return tablet_range_rowkey_buf_; } inline int ObTabletLocationList::set_tablet_range(const common::ObNewRange & tablet_range) { int ret = OB_SUCCESS; if(&tablet_range != &(tablet_range_)) { this->tablet_range_ = tablet_range; } /// ret = tablet_range_rowkey_buf_.reset(); /// if(OB_SUCCESS != ret) /// { /// TBSYS_LOG(WARN, "reset tablet range rowkey fail:ret[%d]", ret); /// } if((OB_SUCCESS == ret) && (NULL != tablet_range_rowkey_buf_)) { ret = tablet_range_rowkey_buf_->write_string(tablet_range.start_key_, &(tablet_range_.start_key_)); if(OB_SUCCESS != ret) { TBSYS_LOG(WARN, "write tablet range start key fail:ret[%d]", ret); } } if((OB_SUCCESS == ret) && (NULL != tablet_range_rowkey_buf_)) { ret = tablet_range_rowkey_buf_->write_string(tablet_range.end_key_, &(tablet_range_.end_key_)); if(OB_SUCCESS != ret) { TBSYS_LOG(WARN, "write tablet range end key fail:ret[%d]", ret); } } return ret; } inline const common::ObNewRange & ObTabletLocationList::get_tablet_range() const { return tablet_range_; } inline int64_t ObTabletLocationList::size(void) const { return cur_count_; } inline void ObTabletLocationList::clear(void) { timestamp_ = 0; cur_count_ = 0; tablet_range_rowkey_buf_ = NULL; } inline int64_t ObTabletLocationList::get_timestamp(void) const { return timestamp_; } inline void ObTabletLocationList::set_timestamp(const int64_t timestamp) { timestamp_ = timestamp; } inline ObTabletLocationItem & ObTabletLocationList::operator[] (const uint64_t index) { return locations_[index]; } } } #endif // OB_COMMON_TABLET_LOCATION_ITEM_H_
/* Test of ftell() function. Copyright (C) 2007-2015 Free Software Foundation, Inc. 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; either version 3 of the License, or (at your option) any later version. 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, see <http://www.gnu.org/licenses/>. */ /* Written by Bruno Haible <bruno@clisp.org>, 2007. */ #include <config.h> /* None of the files accessed by this test are large, so disable the fseek link warning if we are not using the gnulib fseek module. */ #define _GL_NO_LARGE_FILES #include <stdio.h> #include "signature.h" SIGNATURE_CHECK (ftell, long, (FILE *)); #include "binary-io.h" #include "macros.h" #ifndef FUNC_UNGETC_BROKEN # define FUNC_UNGETC_BROKEN 0 #endif int main (int argc, char **argv) { int ch; /* Assume stdin is seekable iff argc > 1. */ if (argc == 1) { ASSERT (ftell (stdin) == -1); return 0; } /* mingw ftell is unreliable on text mode input. */ SET_BINARY (0); /* Simple tests. */ ASSERT (ftell (stdin) == 0); ch = fgetc (stdin); ASSERT (ch == '#'); ASSERT (ftell (stdin) == 1); /* Test ftell after ungetc of read input. */ ch = ungetc ('#', stdin); ASSERT (ch == '#'); ASSERT (ftell (stdin) == 0); ch = fgetc (stdin); ASSERT (ch == '#'); ASSERT (ftell (stdin) == 1); /* Test ftell after fseek. */ ASSERT (fseek (stdin, 2, SEEK_SET) == 0); ASSERT (ftell (stdin) == 2); /* Test ftell after random ungetc. */ ch = fgetc (stdin); ASSERT (ch == '/'); ch = ungetc ('@', stdin); ASSERT (ch == '@'); ASSERT (ftell (stdin) == 2); ch = fgetc (stdin); ASSERT (ch == '@'); ASSERT (ftell (stdin) == 3); if (2 < argc) { if (FUNC_UNGETC_BROKEN) { fputs ("Skipping test: ungetc cannot handle arbitrary bytes\n", stderr); return 77; } /* Test ftell after ungetc without read. */ ASSERT (fseek (stdin, 0, SEEK_CUR) == 0); ASSERT (ftell (stdin) == 3); ch = ungetc ('~', stdin); ASSERT (ch == '~'); ASSERT (ftell (stdin) == 2); } #if !defined __MINT__ /* FreeMiNT has problems seeking past end of file */ /* Test ftell beyond end of file. */ ASSERT (fseek (stdin, 0, SEEK_END) == 0); ch = ftell (stdin); ASSERT (fseek (stdin, 10, SEEK_END) == 0); ASSERT (ftell (stdin) == ch + 10); #endif return 0; }
#include "std.h" #include "actuators.h" #include "servos_direct_hw.h" /* 40 Hz */ #ifndef SERVOS_PERIOD #define SERVOS_PERIOD SERVOS_TICS_OF_USEC(25000) #endif const uint8_t pwm_latch_value = 0 #if defined PWM_SERVO_0 | PWM_SERVO_0_LATCH #endif #if defined PWM_SERVO_1 | PWM_SERVO_1_LATCH #endif #if defined PWM_SERVO_2 | PWM_SERVO_2_LATCH #endif #if defined PWM_SERVO_3 | PWM_SERVO_3_LATCH #endif #if defined PWM_SERVO_4 | PWM_SERVO_4_LATCH #endif #if defined PWM_SERVO_5 | PWM_SERVO_5_LATCH #endif ; void actuators_init ( void ) { /* configure pins for PWM */ #if defined PWM_SERVO_0 PWM_SERVO_0_PINSEL = (PWM_SERVO_0_PINSEL & PWM_SERVO_0_PINSEL_MASK) | PWM_SERVO_0_PINSEL_VAL << PWM_SERVO_0_PINSEL_BIT; #endif #if defined PWM_SERVO_1 PWM_SERVO_1_PINSEL = (PWM_SERVO_1_PINSEL & PWM_SERVO_1_PINSEL_MASK) | PWM_SERVO_1_PINSEL_VAL << PWM_SERVO_1_PINSEL_BIT; #endif #if defined PWM_SERVO_2 PWM_SERVO_2_PINSEL = (PWM_SERVO_2_PINSEL & PWM_SERVO_2_PINSEL_MASK) | PWM_SERVO_2_PINSEL_VAL << PWM_SERVO_2_PINSEL_BIT; #endif #if defined PWM_SERVO_3 PWM_SERVO_3_PINSEL = (PWM_SERVO_3_PINSEL & PWM_SERVO_3_PINSEL_MASK) | PWM_SERVO_3_PINSEL_VAL << PWM_SERVO_3_PINSEL_BIT; #endif #if defined PWM_SERVO_4 PWM_SERVO_4_PINSEL = (PWM_SERVO_4_PINSEL & PWM_SERVO_4_PINSEL_MASK) | PWM_SERVO_4_PINSEL_VAL << PWM_SERVO_4_PINSEL_BIT; #endif #if defined PWM_SERVO_5 PWM_SERVO_5_PINSEL = (PWM_SERVO_5_PINSEL & PWM_SERVO_5_PINSEL_MASK) | PWM_SERVO_5_PINSEL_VAL << PWM_SERVO_5_PINSEL_BIT; #endif /* set servo refresh rate */ PWMMR0 = SERVOS_PERIOD; /* FIXME: For now, this prescaler needs to match the TIMER0 prescaler, as the higher level code treats them the same */ PWMPR = 1; /* enable all 6 PWM outputs in single edge mode*/ PWMPCR = 0 #if defined PWM_SERVO_0 | PWM_SERVO_0_ENA #endif #if defined PWM_SERVO_1 | PWM_SERVO_1_ENA #endif #if defined PWM_SERVO_2 | PWM_SERVO_2_ENA #endif #if defined PWM_SERVO_3 | PWM_SERVO_3_ENA #endif #if defined PWM_SERVO_4 | PWM_SERVO_4_ENA #endif #if defined PWM_SERVO_5 | PWM_SERVO_5_ENA #endif ; /* commit PWMMRx changes */ PWMLER = PWMLER_LATCH0; /* enable PWM timer in PWM mode */ PWMTCR = PWMTCR_COUNTER_ENABLE | PWMTCR_PWM_ENABLE; }
#import "CSHandle.h" #import "CSSubHandle.h" @interface CSHandle (Checksums) -(BOOL)hasChecksum; -(BOOL)isChecksumCorrect; @end @interface CSSubHandle (Checksums) -(BOOL)hasChecksum; -(BOOL)isChecksumCorrect; @end #define CSChecksumWrapperHandle XADChecksumWrapperHandle @interface CSChecksumWrapperHandle:CSHandle { CSHandle *parent,*checksum; } -(id)initWithHandle:(CSHandle *)handle checksumHandle:(CSHandle *)checksumhandle; -(void)dealloc; -(off_t)fileSize; -(off_t)offsetInFile; -(BOOL)atEndOfFile; -(void)seekToFileOffset:(off_t)offs; -(void)seekToEndOfFile; -(void)pushBackByte:(int)byte; -(int)readAtMost:(int)num toBuffer:(void *)buffer; -(void)writeBytes:(int)num fromBuffer:(const void *)buffer; -(BOOL)hasChecksum; -(BOOL)isChecksumCorrect; @end
/* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Author: jmarantz@google.com (Joshua Marantz) #ifndef PAGESPEED_KERNEL_BASE_NULL_MUTEX_H_ #define PAGESPEED_KERNEL_BASE_NULL_MUTEX_H_ #include "pagespeed/kernel/base/abstract_mutex.h" #include "pagespeed/kernel/base/thread_annotations.h" namespace net_instaweb { // Implements an empty mutex for single-threaded programs that need to work // with interfaces that require mutexes. class LOCKABLE NullMutex : public AbstractMutex { public: NullMutex() {} virtual ~NullMutex(); virtual bool TryLock() EXCLUSIVE_TRYLOCK_FUNCTION(true); virtual void Lock() EXCLUSIVE_LOCK_FUNCTION(); virtual void Unlock() UNLOCK_FUNCTION(); }; } // namespace net_instaweb #endif // PAGESPEED_KERNEL_BASE_NULL_MUTEX_H_
/* Copyright 2007-2015 QReal Research Group * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <ev3Kit/robotModel/parts/ev3Speaker.h> #include <utils/robotCommunication/robotCommunicator.h> namespace ev3 { namespace robotModel { namespace real { namespace parts { class Speaker : public robotModel::parts::Ev3Speaker { Q_OBJECT public: Speaker(const kitBase::robotModel::DeviceInfo &info , const kitBase::robotModel::PortInfo &port , utils::robotCommunication::RobotCommunicator &robotCommunicator); /// @param volume.Volume to play the tone (0-100). /// @param frequency.Frequency of the tone in hertz. /// @param duration.Duration of the tone in milliseconds. void playTone(int volume, int frequency, int duration) override; private: utils::robotCommunication::RobotCommunicator &mRobotCommunicator; }; } } } }
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_ #include <stdint.h> #include <map> #include <memory> #include <string> #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "dbus/object_path.h" #include "device/bluetooth/bluetooth_export.h" #include "device/bluetooth/dbus/bluetooth_gatt_descriptor_client.h" namespace bluez { // FakeBluetoothGattDescriptorClient simulates the behavior of the Bluetooth // Daemon GATT characteristic descriptor objects and is used in test cases in // place of a mock and on the Linux desktop. class DEVICE_BLUETOOTH_EXPORT FakeBluetoothGattDescriptorClient : public BluetoothGattDescriptorClient { public: struct Properties : public BluetoothGattDescriptorClient::Properties { explicit Properties(const PropertyChangedCallback& callback); ~Properties() override; // dbus::PropertySet override void Get(dbus::PropertyBase* property, dbus::PropertySet::GetCallback callback) override; void GetAll() override; void Set(dbus::PropertyBase* property, dbus::PropertySet::SetCallback callback) override; }; FakeBluetoothGattDescriptorClient(); ~FakeBluetoothGattDescriptorClient() override; // DBusClient override. void Init(dbus::Bus* bus) override; // BluetoothGattDescriptorClient overrides. void AddObserver(Observer* observer) override; void RemoveObserver(Observer* observer) override; std::vector<dbus::ObjectPath> GetDescriptors() override; Properties* GetProperties(const dbus::ObjectPath& object_path) override; void ReadValue(const dbus::ObjectPath& object_path, const ValueCallback& callback, const ErrorCallback& error_callback) override; void WriteValue(const dbus::ObjectPath& object_path, const std::vector<uint8_t>& value, const base::Closure& callback, const ErrorCallback& error_callback) override; // Makes the descriptor with the UUID |uuid| visible under the characteristic // with object path |characteristic_path|. Descriptor object paths are // hierarchical to their characteristics. |uuid| must belong to a descriptor // for which there is a constant defined below, otherwise this method has no // effect. Returns the object path of the created descriptor. In the no-op // case, returns an invalid path. dbus::ObjectPath ExposeDescriptor(const dbus::ObjectPath& characteristic_path, const std::string& uuid); void HideDescriptor(const dbus::ObjectPath& descriptor_path); // Object path components and UUIDs of GATT characteristic descriptors. static const char kClientCharacteristicConfigurationPathComponent[]; static const char kClientCharacteristicConfigurationUUID[]; private: // Property callback passed when we create Properties structures. void OnPropertyChanged(const dbus::ObjectPath& object_path, const std::string& property_name); // Notifies observers. void NotifyDescriptorAdded(const dbus::ObjectPath& object_path); void NotifyDescriptorRemoved(const dbus::ObjectPath& object_path); // Mapping from object paths to Properties structures. struct DescriptorData { DescriptorData(); ~DescriptorData(); std::unique_ptr<Properties> properties; }; typedef std::map<dbus::ObjectPath, DescriptorData*> PropertiesMap; PropertiesMap properties_; // List of observers interested in event notifications from us. base::ObserverList<Observer> observers_; // Weak pointer factory for generating 'this' pointers that might live longer // than we do. // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory<FakeBluetoothGattDescriptorClient> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattDescriptorClient); }; } // namespace bluez #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SyncError_h #define SyncError_h #include "core/dom/DOMException.h" #include "platform/heap/Handle.h" #include "public/platform/modules/background_sync/WebSyncError.h" namespace blink { class ScriptPromiseResolver; class SyncError { WTF_MAKE_NONCOPYABLE(SyncError); public: // For CallbackPromiseAdapter. using WebType = WebSyncError; static DOMException* take(ScriptPromiseResolver*, WebType*); static void dispose(WebType*); private: SyncError() = delete; }; } // namespace blink #endif // SyncError_h
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_ #define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_ #import <Cocoa/Cocoa.h> #include "base/basictypes.h" #include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/autocomplete/autocomplete_match.h" #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h" #include "chrome/browser/ui/omnibox/omnibox_popup_view.h" #include "ui/gfx/font.h" class AutocompleteResult; class OmniboxEditModel; class OmniboxPopupModel; class OmniboxView; // Implements OmniboxPopupView using a raw NSWindow containing an // NSTableView. class OmniboxPopupViewMac : public OmniboxPopupView, public OmniboxPopupMatrixDelegate { public: OmniboxPopupViewMac(OmniboxView* omnibox_view, OmniboxEditModel* edit_model, NSTextField* field); virtual ~OmniboxPopupViewMac(); // Overridden from OmniboxPopupView: virtual bool IsOpen() const OVERRIDE; virtual void InvalidateLine(size_t line) OVERRIDE {} virtual void UpdatePopupAppearance() OVERRIDE; virtual gfx::Rect GetTargetBounds() OVERRIDE; // This is only called by model in SetSelectedLine() after updating // everything. Popup should already be visible. virtual void PaintUpdatesNow() OVERRIDE; virtual void OnDragCanceled() OVERRIDE {} // Overridden from OmniboxPopupMatrixDelegate: virtual void OnMatrixRowSelected(OmniboxPopupMatrix* matrix, size_t row) OVERRIDE; virtual void OnMatrixRowClicked(OmniboxPopupMatrix* matrix, size_t row) OVERRIDE; virtual void OnMatrixRowMiddleClicked(OmniboxPopupMatrix* matrix, size_t row) OVERRIDE; OmniboxPopupMatrix* matrix() { return matrix_; } protected: // Gets the autocomplete results. This is virtual so that it can be overriden // by tests. virtual const AutocompleteResult& GetResult() const; private: // Create the popup_ instance if needed. void CreatePopupIfNeeded(); // Calculate the appropriate position for the popup based on the // field's screen position and the given target for the matrix // height, and makes the popup visible. Animates to the new frame // if the popup shrinks, snaps to the new frame if the popup grows, // allows existing animations to continue if the size doesn't // change. void PositionPopup(const CGFloat matrixHeight); // Returns the NSImage that should be used as an icon for the given match. NSImage* ImageForMatch(const AutocompleteMatch& match); // Opens the URL at the given row. void OpenURLForRow(size_t row, WindowOpenDisposition disposition); OmniboxView* omnibox_view_; scoped_ptr<OmniboxPopupModel> model_; NSTextField* field_; // owned by tab controller // Child window containing a matrix which implements the popup. base::scoped_nsobject<NSWindow> popup_; NSRect target_popup_frame_; base::scoped_nsobject<OmniboxPopupMatrix> matrix_; base::scoped_nsobject<NSView> top_separator_view_; base::scoped_nsobject<NSView> bottom_separator_view_; base::scoped_nsobject<NSBox> background_view_; DISALLOW_COPY_AND_ASSIGN(OmniboxPopupViewMac); }; #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_
/*************************************************************************/ /* balloon_allocator.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef BALLOON_ALLOCATOR_H #define BALLOON_ALLOCATOR_H #include "os/memory.h" #include "allocators.h" #endif // BALLOON_ALLOCATOR_H
// // NSArrayTests.h // Created by Devin on 7/18/12. // /* tapku || https://github.com/devinross/tapkulibrary Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ @import Foundation; @import XCTest; #import "NSArray+TKCategory.h" @interface NSArrayTests : XCTestCase @end
/* * arLabelingSub*.c * ARToolKit5 * * This file is part of ARToolKit. * * ARToolKit is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * ARToolKit is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with ARToolKit. If not, see <http://www.gnu.org/licenses/>. * * As a special exception, the copyright holders of this library give you * permission to link this library with independent modules to produce an * executable, regardless of the license terms of these independent modules, and to * copy and distribute the resulting executable under terms of your choice, * provided that you also meet, for each linked independent module, the terms and * conditions of the license of that module. An independent module is a module * which is neither derived from nor based on this library. If you modify this * library, you may extend this exception to your version of the library, but you * are not obligated to do so. If you do not wish to do so, delete this exception * statement from your version. * * Copyright 2015 Daqri, LLC. * Copyright 2003-2015 ARToolworks, Inc. * * Author(s): Hirokazu Kato, Philip Lamb * */ #include <AR/config.h> #if !AR_DISABLE_LABELING_DEBUG_MODE #undef AR_PIXEL_FORMAT_CCC #undef AR_PIXEL_FORMAT_CCCA #define AR_PIXEL_FORMAT_ACCC #undef AR_PIXEL_FORMAT_C #undef AR_PIXEL_FORMAT_CY #undef AR_PIXEL_FORMAT_YC #undef AR_PIXEL_FORMAT_CCC_565 #undef AR_PIXEL_FORMAT_CCCA_5551 #undef AR_PIXEL_FORMAT_CCCA_4444 #define AR_LABELING_DEBUG_ENABLE_F #undef AR_LABELING_WHITE_REGION_F #define AR_LABELING_FRAME_IMAGE_F #undef AR_LABELING_ADAPTIVE #include "arLabelingSub.h" #endif
#pragma once #include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> namespace mongo { class DBClientConnection; } /* ** Smart pointers for Mongo* staff */ namespace Robomongo { class AppRegistry; typedef boost::scoped_ptr<AppRegistry> AppRegistryScopedPtr; class SettingsManager; typedef boost::scoped_ptr<SettingsManager> SettingsManagerScopedPtr; class App; typedef boost::scoped_ptr<App> AppScopedPtr; class EventBus; typedef boost::scoped_ptr<EventBus> EventBusScopedPtr; class MongoCollection; typedef boost::shared_ptr<MongoCollection> MongoCollectionPtr; class MongoDocument; typedef boost::shared_ptr<MongoDocument> MongoDocumentPtr; }
/* * This file is part of Cleanflight. * * Cleanflight 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, either version 3 of the License, or * (at your option) any later version. * * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>. */ #include <stdbool.h> #include <stdint.h> #include <math.h> #include <string.h> #include "common/maths.h" #include "common/axis.h" #include "sensors.h" #include "boardalignment.h" static bool standardBoardAlignment = true; // board orientation correction static float boardRotation[3][3]; // matrix static bool isBoardAlignmentStandard(boardAlignment_t *boardAlignment) { return !boardAlignment->rollDegrees && !boardAlignment->pitchDegrees && !boardAlignment->yawDegrees; } void initBoardAlignment(boardAlignment_t *boardAlignment) { if (isBoardAlignmentStandard(boardAlignment)) { return; } standardBoardAlignment = false; fp_angles_t rotationAngles; rotationAngles.angles.roll = degreesToRadians(boardAlignment->rollDegrees ); rotationAngles.angles.pitch = degreesToRadians(boardAlignment->pitchDegrees); rotationAngles.angles.yaw = degreesToRadians(boardAlignment->yawDegrees ); buildRotationMatrix(&rotationAngles, boardRotation); } static void alignBoard(int32_t *vec) { int32_t x = vec[X]; int32_t y = vec[Y]; int32_t z = vec[Z]; vec[X] = lrintf(boardRotation[0][X] * x + boardRotation[1][X] * y + boardRotation[2][X] * z); vec[Y] = lrintf(boardRotation[0][Y] * x + boardRotation[1][Y] * y + boardRotation[2][Y] * z); vec[Z] = lrintf(boardRotation[0][Z] * x + boardRotation[1][Z] * y + boardRotation[2][Z] * z); } void alignSensors(int32_t *src, int32_t *dest, uint8_t rotation) { static uint32_t swap[3]; memcpy(swap, src, sizeof(swap)); switch (rotation) { default: case CW0_DEG: dest[X] = swap[X]; dest[Y] = swap[Y]; dest[Z] = swap[Z]; break; case CW90_DEG: dest[X] = swap[Y]; dest[Y] = -swap[X]; dest[Z] = swap[Z]; break; case CW180_DEG: dest[X] = -swap[X]; dest[Y] = -swap[Y]; dest[Z] = swap[Z]; break; case CW270_DEG: dest[X] = -swap[Y]; dest[Y] = swap[X]; dest[Z] = swap[Z]; break; case CW0_DEG_FLIP: dest[X] = -swap[X]; dest[Y] = swap[Y]; dest[Z] = -swap[Z]; break; case CW90_DEG_FLIP: dest[X] = swap[Y]; dest[Y] = swap[X]; dest[Z] = -swap[Z]; break; case CW180_DEG_FLIP: dest[X] = swap[X]; dest[Y] = -swap[Y]; dest[Z] = -swap[Z]; break; case CW270_DEG_FLIP: dest[X] = -swap[Y]; dest[Y] = -swap[X]; dest[Z] = -swap[Z]; break; } if (!standardBoardAlignment) alignBoard(dest); }
/* thread_info.h: x86_64 low-level thread information * * Copyright (C) 2002 David Howells (dhowells@redhat.com) * - Incorporating suggestions made by Linus Torvalds and Dave Miller */ #ifndef _ASM_THREAD_INFO_H #define _ASM_THREAD_INFO_H #ifdef __KERNEL__ #include <asm/page.h> #include <asm/types.h> #include <asm/pda.h> /* * low level task data that entry.S needs immediate access to * - this struct should fit entirely inside of one cache line * - this struct shares the supervisor stack pages */ #ifndef __ASSEMBLY__ struct task_struct; struct exec_domain; #include <asm/mmsegment.h> struct thread_info { struct task_struct *task; /* main task structure */ struct exec_domain *exec_domain; /* execution domain */ __u32 flags; /* low level flags */ __u32 status; /* thread synchronous flags */ __u32 cpu; /* current CPU */ int preempt_count; /* 0 => preemptable, <0 => BUG */ mm_segment_t addr_limit; struct restart_block restart_block; }; #endif /* * macros/functions for gaining access to the thread information structure * preempt_count needs to be 1 initially, until the scheduler is functional. */ #ifndef __ASSEMBLY__ #define INIT_THREAD_INFO(tsk) \ { \ .task = &tsk, \ .exec_domain = &default_exec_domain, \ .flags = 0, \ .cpu = 0, \ .preempt_count = 1, \ .addr_limit = KERNEL_DS, \ .restart_block = { \ .fn = do_no_restart_syscall, \ }, \ } #define init_thread_info (init_thread_union.thread_info) #define init_stack (init_thread_union.stack) static inline struct thread_info *current_thread_info(void) { struct thread_info *ti; ti = (void *)(read_pda(kernelstack) + PDA_STACKOFFSET - THREAD_SIZE); return ti; } /* do not use in interrupt context */ static inline struct thread_info *stack_thread_info(void) { struct thread_info *ti; __asm__("andq %%rsp,%0; ":"=r" (ti) : "0" (~(THREAD_SIZE - 1))); return ti; } /* thread information allocation */ #ifdef CONFIG_DEBUG_STACK_USAGE #define alloc_thread_info(tsk) \ ({ \ struct thread_info *ret; \ \ ret = ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)); \ if (ret) \ memset(ret, 0, THREAD_SIZE); \ ret; \ }) #else #define alloc_thread_info(tsk) \ ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)) #endif #define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER) #else /* !__ASSEMBLY__ */ /* how to get the thread information struct from ASM */ #define GET_THREAD_INFO(reg) \ movq %gs:pda_kernelstack,reg ; \ subq $(THREAD_SIZE-PDA_STACKOFFSET),reg #endif /* * thread information flags * - these are process state flags that various assembly files may need to access * - pending work-to-be-done flags are in LSW * - other flags in MSW * Warning: layout of LSW is hardcoded in entry.S */ #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ #define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ #define TIF_SIGPENDING 2 /* signal pending */ #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ #define TIF_SINGLESTEP 4 /* reenable singlestep on user return*/ #define TIF_IRET 5 /* force IRET */ #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ #define TIF_SECCOMP 8 /* secure computing */ #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */ /* 16 free */ #define TIF_IA32 17 /* 32bit process */ #define TIF_FORK 18 /* ret_from_fork */ #define TIF_ABI_PENDING 19 #define TIF_MEMDIE 20 #define TIF_DEBUG 21 /* uses debug registers */ #define TIF_IO_BITMAP 22 /* uses I/O bitmap */ #define TIF_FREEZE 23 /* is freezing for suspend */ #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) #define _TIF_IRET (1<<TIF_IRET) #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) #define _TIF_SECCOMP (1<<TIF_SECCOMP) #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) #define _TIF_IA32 (1<<TIF_IA32) #define _TIF_FORK (1<<TIF_FORK) #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) #define _TIF_DEBUG (1<<TIF_DEBUG) #define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP) #define _TIF_FREEZE (1<<TIF_FREEZE) /* work to do on interrupt/exception return */ #define _TIF_WORK_MASK \ (0x0000FFFF & ~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP|_TIF_SECCOMP)) /* work to do on any return to user space */ #define _TIF_ALLWORK_MASK (0x0000FFFF & ~_TIF_SECCOMP) /* flags to check in __switch_to() */ #define _TIF_WORK_CTXSW (_TIF_DEBUG|_TIF_IO_BITMAP) #define PREEMPT_ACTIVE 0x10000000 /* * Thread-synchronous status. * * This is different from the flags in that nobody else * ever touches our thread-synchronous status, so we don't * have to worry about atomic accesses. */ #define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */ #define TS_COMPAT 0x0002 /* 32bit syscall active */ #define TS_POLLING 0x0004 /* true if in idle loop and not sleeping */ #define tsk_is_polling(t) ((t)->thread_info->status & TS_POLLING) #endif /* __KERNEL__ */ #endif /* _ASM_THREAD_INFO_H */
/*++ Copyright (c) Microsoft Corporation. All rights reserved. Module Name: Wdfcore.h Environment: user mode NOTE: This header is generated by stubwork. To modify contents, add or remove <shared> or <umdf> tags in the corresponding .x and .y template files. --*/ #pragma once #ifndef WDF_EXTERN_C #ifdef __cplusplus #define WDF_EXTERN_C extern "C" #define WDF_EXTERN_C_START extern "C" { #define WDF_EXTERN_C_END } #else #define WDF_EXTERN_C #define WDF_EXTERN_C_START #define WDF_EXTERN_C_END #endif #endif WDF_EXTERN_C_START // // Time conversion related macros // // to to to // us ms sec #define WDF_TIMEOUT_TO_SEC ((LONGLONG) 1 * 10 * 1000 * 1000) #define WDF_TIMEOUT_TO_MS ((LONGLONG) 1 * 10 * 1000) #define WDF_TIMEOUT_TO_US ((LONGLONG) 1 * 10) LONGLONG FORCEINLINE WDF_REL_TIMEOUT_IN_SEC( _In_ ULONGLONG Time ) { return Time * -1 * WDF_TIMEOUT_TO_SEC; } LONGLONG FORCEINLINE WDF_ABS_TIMEOUT_IN_SEC( _In_ ULONGLONG Time ) { return Time * 1 * WDF_TIMEOUT_TO_SEC; } LONGLONG FORCEINLINE WDF_REL_TIMEOUT_IN_MS( _In_ ULONGLONG Time ) { return Time * -1 * WDF_TIMEOUT_TO_MS; } LONGLONG FORCEINLINE WDF_ABS_TIMEOUT_IN_MS( _In_ ULONGLONG Time ) { return Time * 1 * WDF_TIMEOUT_TO_MS; } LONGLONG FORCEINLINE WDF_REL_TIMEOUT_IN_US( _In_ ULONGLONG Time ) { return Time * -1 * WDF_TIMEOUT_TO_US; } LONGLONG FORCEINLINE WDF_ABS_TIMEOUT_IN_US( _In_ ULONGLONG Time ) { return Time * 1 * WDF_TIMEOUT_TO_US; } // // Rounding functions // size_t FORCEINLINE WDF_ALIGN_SIZE_DOWN( _In_ size_t Length, _In_ size_t AlignTo ) { return Length & ~(AlignTo - 1); } size_t FORCEINLINE WDF_ALIGN_SIZE_UP( _In_ size_t Length, _In_ size_t AlignTo ) { return WDF_ALIGN_SIZE_DOWN(Length + AlignTo - 1, AlignTo); } // // Pointer math // #define WDF_PTR_ADD_OFFSET_TYPE(_ptr, _offset, _type) \ ((_type) (((PUCHAR) (_ptr)) + (_offset))) #define WDF_PTR_ADD_OFFSET(_ptr, _offset) \ WDF_PTR_ADD_OFFSET_TYPE(_ptr, _offset, PVOID) #define WDF_PTR_GET_OFFSET(_base, _addr) \ (size_t) (((PUCHAR) _addr) - ((PUCHAR) _base)) #if (OSVER(NTDDI_VERSION) == NTDDI_WIN2K) // // These definitions are necessary for building under a Win2K Environment. // #ifndef DECLARE_UNICODE_STRING_SIZE #define DECLARE_UNICODE_STRING_SIZE(_var, _size) \ WCHAR _var ## _buffer[_size]; \ UNICODE_STRING _var = { 0, _size * sizeof(WCHAR) , _var ## _buffer } #endif #undef DECLARE_CONST_UNICODE_STRING #define DECLARE_CONST_UNICODE_STRING(_variablename, _string) \ const WCHAR _variablename ## _buffer[] = _string; \ __pragma(warning(suppress:4204)) __pragma(warning(suppress:4221)) \ const UNICODE_STRING _variablename = { sizeof(_string) - sizeof(WCHAR), sizeof(_string), (PWSTR) _variablename ## _buffer } #endif // (OSVER(NTDDI_VERSION) == NTDDI_WIN2K) WDF_EXTERN_C_END
/** ****************************************************************************** * @file stm32f4xx_rng.h * @author MCD Application Team * @version V1.2.1 * @date 19-September-2013 * @brief This file contains all the functions prototypes for the Random * Number Generator(RNG) firmware library. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2013 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.st.com/software_license_agreement_liberty_v2 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_RNG_H #define __STM32F4xx_RNG_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx.h" /** @addtogroup STM32F4xx_StdPeriph_Driver * @{ */ /** @addtogroup RNG * @{ */ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /** @defgroup RNG_Exported_Constants * @{ */ /** @defgroup RNG_flags_definition * @{ */ #define RNG_FLAG_DRDY ((uint8_t)0x0001) /*!< Data ready */ #define RNG_FLAG_CECS ((uint8_t)0x0002) /*!< Clock error current status */ #define RNG_FLAG_SECS ((uint8_t)0x0004) /*!< Seed error current status */ #define IS_RNG_GET_FLAG(RNG_FLAG) (((RNG_FLAG) == RNG_FLAG_DRDY) || \ ((RNG_FLAG) == RNG_FLAG_CECS) || \ ((RNG_FLAG) == RNG_FLAG_SECS)) #define IS_RNG_CLEAR_FLAG(RNG_FLAG) (((RNG_FLAG) == RNG_FLAG_CECS) || \ ((RNG_FLAG) == RNG_FLAG_SECS)) /** * @} */ /** @defgroup RNG_interrupts_definition * @{ */ #define RNG_IT_CEI ((uint8_t)0x20) /*!< Clock error interrupt */ #define RNG_IT_SEI ((uint8_t)0x40) /*!< Seed error interrupt */ #define IS_RNG_IT(IT) ((((IT) & (uint8_t)0x9F) == 0x00) && ((IT) != 0x00)) #define IS_RNG_GET_IT(RNG_IT) (((RNG_IT) == RNG_IT_CEI) || ((RNG_IT) == RNG_IT_SEI)) /** * @} */ /** * @} */ /* Exported macro ------------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ /* Function used to set the RNG configuration to the default reset state *****/ void RNG_DeInit(void); /* Configuration function *****************************************************/ void RNG_Cmd(FunctionalState NewState); /* Get 32 bit Random number function ******************************************/ uint32_t RNG_GetRandomNumber(void); /* Interrupts and flags management functions **********************************/ void RNG_ITConfig(FunctionalState NewState); FlagStatus RNG_GetFlagStatus(uint8_t RNG_FLAG); void RNG_ClearFlag(uint8_t RNG_FLAG); ITStatus RNG_GetITStatus(uint8_t RNG_IT); void RNG_ClearITPendingBit(uint8_t RNG_IT); #ifdef __cplusplus } #endif #endif /*__STM32F4xx_RNG_H */ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/** * \file * * \brief Serial USART service configuration. * * Copyright (C) 2014 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * \asf_license_stop * */ /** * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> */ #ifndef CONF_USART_SERIAL_H #define CONF_USART_SERIAL_H #include "sio2host.h" #endif /* CONF_USART_SERIAL_H_INCLUDED */
// // ZLPhotoBrowserViewController+SignlePhotoBrowser.h // ZLAssetsPickerDemo // // Created by 张磊 on 15/8/21. // Copyright (c) 2015年 com.zixue101.www. All rights reserved. // #import "ZLPhotoPickerBrowserViewController.h" @interface ZLPhotoPickerBrowserViewController (SignlePhotoBrowser) - (void)showHeadPortrait:(UIImageView *)toImageView; - (void)showHeadPortrait:(UIImageView *)toImageView originUrl:(NSString *)originUrl; @end
/** @file Math worker functions. Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #include "BaseLibInternals.h" /** Returns the bit position of the lowest bit set in a 32-bit value. This function computes the bit position of the lowest bit set in the 32-bit value specified by Operand. If Operand is zero, then -1 is returned. Otherwise, a value between 0 and 31 is returned. @param Operand The 32-bit operand to evaluate. @retval 0..31 The lowest bit set in Operand was found. @retval -1 Operand is zero. **/ INTN EFIAPI LowBitSet32 ( IN UINT32 Operand ) { INTN BitIndex; if (Operand == 0) { return -1; } for (BitIndex = 0; 0 == (Operand & 1); BitIndex++, Operand >>= 1); return BitIndex; }
///////////////////////////////////////////////////////////////////////////// // Name: funcmacro_gdi.h // Purpose: Graphics Device Interface function and macro docs // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @defgroup group_funcmacro_gdi Graphics Device Interface (GDI) @ingroup group_funcmacro The following are functions and macros related to GDI (Graphics Device Interface) access. Related Overviews: @ref overview_dc Related class group: @ref group_class_gdi */
/* * Copyright (C) 2018 UC Berkeley * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @ingroup drivers_fxos8700 * @{ * * @file * @brief FXOS8700 adaption to the RIOT actuator/sensor interface * * @author Hyung-Sin Kim <hs.kim@cs.berkeley.edu> * * @} */ #include <string.h> #include "saul.h" #include "fxos8700.h" #include "kernel_defines.h" static int read_mag(const void *dev, phydat_t *res) { if (fxos8700_read_cached(dev, NULL, (fxos8700_measurement_t *)res) != FXOS8700_OK) { /* Read failure */ return -ECANCELED; } res->unit = UNIT_GS; res->scale = -3; return 3; } static int read_acc(const void *dev, phydat_t *res) { if (fxos8700_read_cached(dev, (fxos8700_measurement_t *)res, NULL) != FXOS8700_OK) { /* Read failure */ return -ECANCELED; } if (IS_ACTIVE(CONFIG_FXOS8700_USE_ACC_RAW_VALUES)) { res->unit = UNIT_NONE; res->scale = 0; } else { res->unit = UNIT_G; if (((fxos8700_t *)dev)->p.acc_range == FXOS8700_REG_XYZ_DATA_CFG_FS__2G) { res->scale = -4; } else { res->scale = -3; } } return 3; } const saul_driver_t fxos8700_saul_mag_driver = { .read = read_mag, .write = saul_notsup, .type = SAUL_SENSE_MAG, }; const saul_driver_t fxos8700_saul_acc_driver = { .read = read_acc, .write = saul_notsup, .type = SAUL_SENSE_ACCEL, };
/* * GMP MPZ Wrapper * (C) 1999-2007 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_GMP_MPZ_WRAP_H__ #define BOTAN_GMP_MPZ_WRAP_H__ #include <botan/bigint.h> #include <gmp.h> namespace Botan { /* * Lightweight GMP mpz_t Wrapper */ class BOTAN_DLL GMP_MPZ { public: mpz_t value; BigInt to_bigint() const; void encode(byte[], u32bit) const; u32bit bytes() const; GMP_MPZ& operator=(const GMP_MPZ&); GMP_MPZ(const GMP_MPZ&); GMP_MPZ(const BigInt& = 0); GMP_MPZ(const byte[], u32bit); ~GMP_MPZ(); }; } #endif
//* This file is part of the MOOSE framework //* https://www.mooseframework.org //* //* All rights reserved, see COPYRIGHT for full restrictions //* https://github.com/idaholab/moose/blob/master/COPYRIGHT //* //* Licensed under LGPL 2.1, please see LICENSE for details //* https://www.gnu.org/licenses/lgpl-2.1.html #pragma once #include "IntegratedBC.h" // Forward Declarations /** * This class implements the "No BC" boundary condition * discussed by Griffiths, Papanastiou, and others. */ class INSTemperatureNoBCBC : public IntegratedBC { public: static InputParameters validParams(); INSTemperatureNoBCBC(const InputParameters & parameters); virtual ~INSTemperatureNoBCBC() {} protected: virtual Real computeQpResidual(); virtual Real computeQpJacobian(); virtual Real computeQpOffDiagJacobian(unsigned jvar); const MaterialProperty<Real> & _k; };
/* * OLSRd Quagga plugin * * Copyright (C) 2006-2008 Immo 'FaUl' Wehrenberg <immo@chaostreff-dortmund.de> * Copyright (C) 2007-2012 Vasilis Tsiligiannis <acinonyxs@yahoo.gr> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation or - at your option - under * the terms of the GNU General Public Licence version 2 but can be * linked to any BSD-Licenced Software with public available sourcecode * */ /* ------------------------------------------------------------------------- * File : parse.c * Description : functions to parse received zebra packets * ------------------------------------------------------------------------- */ #include "defs.h" #include "olsr.h" #include "common.h" #include "packet.h" #include "client.h" #include "parse.h" static void free_zroute(struct zroute *); static struct zroute *zparse_route(unsigned char *); static void free_zroute(struct zroute *r) { if(r->ifindex_num) free(r->ifindex); if(r->nexthop_num) free(r->nexthop); } static struct zroute *zparse_route(unsigned char *opt) { struct zroute *r; int c; size_t size; uint16_t length; unsigned char *pnt; memcpy(&length, opt, sizeof length); length = ntohs (length); r = olsr_malloc(sizeof *r, "QUAGGA: New zebra route"); pnt = &opt[3]; switch (zebra.version) { case 0: break; case 1: case 2: pnt = &opt[6]; break; default: olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE); break; } r->type = *pnt++; r->flags = *pnt++; r->message = *pnt++; r->prefixlen = *pnt++; size = (r->prefixlen + 7) / 8; memset(&r->prefix, 0, sizeof r->prefix); if (olsr_cnf->ip_version == AF_INET) memcpy(&r->prefix.v4.s_addr, pnt, size); else memcpy(r->prefix.v6.s6_addr, pnt, size); pnt += size; if (r->message & ZAPI_MESSAGE_NEXTHOP) { r->nexthop_num = *pnt++; r->nexthop = olsr_malloc((sizeof *r->nexthop) * r->nexthop_num, "QUAGGA: New zebra route nexthop"); for (c = 0; c < r->nexthop_num; c++) { if (olsr_cnf->ip_version == AF_INET) { memcpy(&r->nexthop[c].v4.s_addr, pnt, sizeof r->nexthop[c].v4.s_addr); pnt += sizeof r->nexthop[c].v4.s_addr; } else { memcpy(r->nexthop[c].v6.s6_addr, pnt, sizeof r->nexthop[c].v6.s6_addr); pnt += sizeof r->nexthop[c].v6.s6_addr; } } } if (r->message & ZAPI_MESSAGE_IFINDEX) { r->ifindex_num = *pnt++; r->ifindex = olsr_malloc(sizeof(uint32_t) * r->ifindex_num, "QUAGGA: New zebra route ifindex"); for (c = 0; c < r->ifindex_num; c++) { memcpy(&r->ifindex[c], pnt, sizeof r->ifindex[c]); r->ifindex[c] = ntohl (r->ifindex[c]); pnt += sizeof r->ifindex[c]; } } switch (zebra.version) { case 0: case 1: case 2: break; default: olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE); break; } if (r->message & ZAPI_MESSAGE_DISTANCE) { r->distance = *pnt++; } // Quagga v0.98.6 BUG workaround: metric is always sent by zebra // even without ZAPI_MESSAGE_METRIC message. if ((r->message & ZAPI_MESSAGE_METRIC) || !zebra.version) { memcpy(&r->metric, pnt, sizeof r->metric); r->metric = ntohl(r->metric); pnt += sizeof r->metric; } if (pnt - opt != length) { olsr_exit("(QUAGGA) Length does not match!", EXIT_FAILURE); } return r; } void zparse(void *foo __attribute__ ((unused))) { unsigned char *data, *f; uint16_t command; uint16_t length; ssize_t len; struct zroute *route; if (!(zebra.status & STATUS_CONNECTED)) { zclient_reconnect(); return; } data = zclient_read(&len); if (data) { f = data; do { memcpy(&length, f, sizeof length); length = ntohs (length); if (!length) // something weired happened olsr_exit("(QUAGGA) Zero message length!", EXIT_FAILURE); command = f[2]; switch (zebra.version) { case 0: break; case 1: case 2: if ((f[2] != ZEBRA_HEADER_MARKER) || (f[3] != zebra.version)) olsr_exit("(QUAGGA) Invalid zebra header received!", EXIT_FAILURE); memcpy(&command, &f[4], sizeof command); command = ntohs (command); break; default: olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE); break; } if (olsr_cnf->ip_version == AF_INET) { switch (command) { case ZEBRA_IPV4_ROUTE_ADD: route = zparse_route(f); ip_prefix_list_add(&olsr_cnf->hna_entries, &route->prefix, route->prefixlen); free_zroute(route); free(route); break; case ZEBRA_IPV4_ROUTE_DELETE: route = zparse_route(f); ip_prefix_list_remove(&olsr_cnf->hna_entries, &route->prefix, route->prefixlen); free_zroute(route); free(route); break; default: break; } } else { switch (command) { case ZEBRA_IPV6_ROUTE_ADD: route = zparse_route(f); ip_prefix_list_add(&olsr_cnf->hna_entries, &route->prefix, route->prefixlen); free_zroute(route); free(route); break; case ZEBRA_IPV6_ROUTE_DELETE: route = zparse_route(f); ip_prefix_list_remove(&olsr_cnf->hna_entries, &route->prefix, route->prefixlen); free_zroute(route); free(route); break; default: break; } } f += length; } while ((f - data) < len); free(data); } } /* * Local Variables: * c-basic-offset: 2 * indent-tabs-mode: nil * End: */
/** ****************************************************************************** * @file usbh_msc_core.h * @author MCD Application Team * @version V2.0.0 * @date 22-July-2011 * @brief This file contains all the prototypes for the usbh_msc_core.c ****************************************************************************** * @attention * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2> ****************************************************************************** */ /* Define to prevent recursive ----------------------------------------------*/ #ifndef __USBH_MSC_CORE_H #define __USBH_MSC_CORE_H /* Includes ------------------------------------------------------------------*/ #include "usbh_core.h" #include "usbh_stdreq.h" #include "usb_bsp.h" #include "usbh_ioreq.h" #include "usbh_hcs.h" #include "usbh_msc_core.h" #include "usbh_msc_scsi.h" #include "usbh_msc_bot.h" /** @addtogroup USBH_LIB * @{ */ /** @addtogroup USBH_CLASS * @{ */ /** @addtogroup USBH_MSC_CLASS * @{ */ /** @defgroup USBH_MSC_CORE * @brief This file is the Header file for usbh_msc_core.c * @{ */ /** @defgroup USBH_MSC_CORE_Exported_Types * @{ */ /* Structure for MSC process */ typedef struct _MSC_Process { uint8_t hc_num_in; uint8_t hc_num_out; uint8_t MSBulkOutEp; uint8_t MSBulkInEp; uint16_t MSBulkInEpSize; uint16_t MSBulkOutEpSize; uint8_t buff[USBH_MSC_MPS_SIZE]; uint8_t maxLun; } MSC_Machine_TypeDef; /** * @} */ /** @defgroup USBH_MSC_CORE_Exported_Defines * @{ */ #define USB_REQ_BOT_RESET 0xFF #define USB_REQ_GET_MAX_LUN 0xFE /** * @} */ /** @defgroup USBH_MSC_CORE_Exported_Macros * @{ */ /** * @} */ /** @defgroup USBH_MSC_CORE_Exported_Variables * @{ */ extern USBH_Class_cb_TypeDef USBH_MSC_cb; extern MSC_Machine_TypeDef MSC_Machine; extern uint8_t MSCErrorCount; /** * @} */ /** @defgroup USBH_MSC_CORE_Exported_FunctionsPrototype * @{ */ /** * @} */ #endif /* __USBH_MSC_CORE_H */ /** * @} */ /** * @} */ /** * @} */ /** * @} */ /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
#include <unistd.h> #include <stdio.h> int main(int argc, char **argv) { char *new_argv[] = { NULL, "3", NULL }; if (argc != 2) { fprintf(stderr, "Usage: %s exepath\n", argv[0]); return -1; } new_argv[0] = argv[1]; /* Actually run the command. */ if (execv(new_argv[0], new_argv) < 0) perror("execv"); _exit(1); }
/* * Copyright (C) 2010 Michael Brown <mbrown@fensystems.co.uk>. * * 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; either version 2 of the * License, or any later version. * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <stdio.h> #include <string.h> #include <errno.h> #include <getopt.h> #include <ipxe/command.h> #include <ipxe/parseopt.h> #include <ipxe/uri.h> #include <ipxe/sanboot.h> #include <usr/autoboot.h> FILE_LICENCE ( GPL2_OR_LATER ); /** @file * * SAN commands * */ /** "sanboot" options */ struct sanboot_options { /** Drive number */ unsigned int drive; /** Do not describe SAN device */ int no_describe; /** Keep SAN device */ int keep; }; /** "sanboot" option list */ static struct option_descriptor sanboot_opts[] = { OPTION_DESC ( "drive", 'd', required_argument, struct sanboot_options, drive, parse_integer ), OPTION_DESC ( "no-describe", 'n', no_argument, struct sanboot_options, no_describe, parse_flag ), OPTION_DESC ( "keep", 'k', no_argument, struct sanboot_options, keep, parse_flag ), }; /** "sanhook" command descriptor */ static struct command_descriptor sanhook_cmd = COMMAND_DESC ( struct sanboot_options, sanboot_opts, 1, 1, "[--drive <drive>] [--no-describe] <root-path>" ); /** "sanboot" command descriptor */ static struct command_descriptor sanboot_cmd = COMMAND_DESC ( struct sanboot_options, sanboot_opts, 0, 1, "[--drive <drive>] [--no-describe] [--keep] " "[<root-path>]" ); /** "sanunhook" command descriptor */ static struct command_descriptor sanunhook_cmd = COMMAND_DESC ( struct sanboot_options, sanboot_opts, 0, 0, "[--drive <drive>]" ); /** * The "sanboot", "sanhook" and "sanunhook" commands * * @v argc Argument count * @v argv Argument list * @v default_flags Default set of flags for uriboot() * @v no_root_path_flags Additional flags to apply if no root path is present * @ret rc Return status code */ static int sanboot_core_exec ( int argc, char **argv, struct command_descriptor *cmd, int default_flags, int no_root_path_flags ) { struct sanboot_options opts; const char *root_path; struct uri *uri; int flags; int rc; /* Initialise options */ memset ( &opts, 0, sizeof ( opts ) ); opts.drive = san_default_drive(); /* Parse options */ if ( ( rc = reparse_options ( argc, argv, cmd, &opts ) ) != 0 ) goto err_parse_options; /* Parse root path, if present */ if ( argc > optind ) { root_path = argv[optind]; uri = parse_uri ( root_path ); if ( ! uri ) { rc = -ENOMEM; goto err_parse_uri; } } else { root_path = NULL; uri = NULL; } /* Construct flags */ flags = default_flags; if ( opts.no_describe ) flags |= URIBOOT_NO_SAN_DESCRIBE; if ( opts.keep ) flags |= URIBOOT_NO_SAN_UNHOOK; if ( ! root_path ) flags |= no_root_path_flags; /* Boot from root path */ if ( ( rc = uriboot ( NULL, uri, opts.drive, flags ) ) != 0 ) goto err_uriboot; err_uriboot: uri_put ( uri ); err_parse_uri: err_parse_options: return rc; } /** * The "sanhook" command * * @v argc Argument count * @v argv Argument list * @ret rc Return status code */ static int sanhook_exec ( int argc, char **argv ) { return sanboot_core_exec ( argc, argv, &sanhook_cmd, ( URIBOOT_NO_SAN_BOOT | URIBOOT_NO_SAN_UNHOOK ), 0 ); } /** * The "sanboot" command * * @v argc Argument count * @v argv Argument list * @ret rc Return status code */ static int sanboot_exec ( int argc, char **argv ) { return sanboot_core_exec ( argc, argv, &sanboot_cmd, 0, URIBOOT_NO_SAN_UNHOOK ); } /** * The "sanunhook" command * * @v argc Argument count * @v argv Argument list * @ret rc Return status code */ static int sanunhook_exec ( int argc, char **argv ) { return sanboot_core_exec ( argc, argv, &sanunhook_cmd, ( URIBOOT_NO_SAN_DESCRIBE | URIBOOT_NO_SAN_BOOT ), 0 ); } /** SAN commands */ struct command sanboot_commands[] __command = { { .name = "sanhook", .exec = sanhook_exec, }, { .name = "sanboot", .exec = sanboot_exec, }, { .name = "sanunhook", .exec = sanunhook_exec, }, };
/* * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.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; either version 2 of the License, or (at your * option) any later version. * * 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, see <http://www.gnu.org/licenses/>. */ #ifndef _MOVEMENT_STRUCTURES_H #define _MOVEMENT_STRUCTURES_H #include "MovementInfo.h" #include "Opcodes.h" enum MovementStatusElements { MSEHasGuidByte0, MSEHasGuidByte1, MSEHasGuidByte2, MSEHasGuidByte3, MSEHasGuidByte4, MSEHasGuidByte5, MSEHasGuidByte6, MSEHasGuidByte7, MSEHasMovementFlags, MSEHasMovementFlags2, MSEHasTimestamp, MSEHasOrientation, MSEHasTransportData, MSEHasTransportGuidByte0, MSEHasTransportGuidByte1, MSEHasTransportGuidByte2, MSEHasTransportGuidByte3, MSEHasTransportGuidByte4, MSEHasTransportGuidByte5, MSEHasTransportGuidByte6, MSEHasTransportGuidByte7, MSEHasTransportTime2, MSEHasTransportTime3, MSEHasPitch, MSEHasFallData, MSEHasFallDirection, MSEHasSplineElevation, MSEHasSpline, MSEGuidByte0, MSEGuidByte1, MSEGuidByte2, MSEGuidByte3, MSEGuidByte4, MSEGuidByte5, MSEGuidByte6, MSEGuidByte7, MSEMovementFlags, MSEMovementFlags2, MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, MSEOrientation, MSETransportGuidByte0, MSETransportGuidByte1, MSETransportGuidByte2, MSETransportGuidByte3, MSETransportGuidByte4, MSETransportGuidByte5, MSETransportGuidByte6, MSETransportGuidByte7, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportOrientation, MSETransportSeat, MSETransportTime, MSETransportTime2, MSETransportTime3, MSEPitch, MSEFallTime, MSEFallVerticalSpeed, MSEFallCosAngle, MSEFallSinAngle, MSEFallHorizontalSpeed, MSESplineElevation, MSECounter, // Speed MSESpeedWalk, MSESpeedRun, MSESpeedRunBack, MSESpeedSwim, MSESpeedSwimBack, MSESpeedTurnRate, MSESpeedFlight, MSESpeedFlightBack, MSESpeedPitchRate, MSEHeight, // Special MSEZeroBit, // writes bit value 0 or skips read bit MSEOneBit, // writes bit value 1 or skips read bit MSEEnd, // marks end of parsing MSE_COUNT }; namespace Movement { class PacketSender { public: PacketSender(Unit* unit, Opcodes controlled, Opcodes self, MovementInfo* info, bool broadCastSelf = false, bool broadCastControlled = true); void Send() const; private: Unit* _unit; Opcodes _toSend; bool _BroadCastControlled, _BroadCastSelf, _isControlledPacket; MovementInfo* _info; }; } MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode); #endif
/*************************************************************************** qgsstorebadlayerinfo.h ---------------------- begin : Jan 2019 copyright : (C) 2019 by Marco Hugentobler email : marco dot hugentobler at sourcepole dot ch ***************************************************************************/ /*************************************************************************** * * * 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; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSSTOREBADLAYERINFO_H #define QGSSTOREBADLAYERINFO_H #include "qgsprojectbadlayerhandler.h" #include "qgis_server.h" #include <QStringList> /** * \ingroup server * Stores layer ids of bad layers * \since QGIS 3.6 */ class SERVER_EXPORT QgsStoreBadLayerInfo: public QgsProjectBadLayerHandler { public: /** * Default constructor */ QgsStoreBadLayerInfo() = default; /** * \brief handleBadLayers * \param layers layer nodes */ void handleBadLayers( const QList<QDomNode> &layers ); /** * \brief badLayers * \returns ids of bad layers */ QStringList badLayers() const { return mBadLayerIds; } private: QStringList mBadLayerIds; }; #endif // QGSSTOREBADLAYERINFO_H
// Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #ifndef CPLUSPLUS_LITERALTABLE_H #define CPLUSPLUS_LITERALTABLE_H #include "CPlusPlusForwardDeclarations.h" #include <cstring> namespace CPlusPlus { template <typename Literal> class LiteralTable { LiteralTable(const LiteralTable &other); void operator =(const LiteralTable &other); public: typedef Literal *const *iterator; public: LiteralTable() : _literals(0), _buckets(0), _allocatedLiterals(0), _literalCount(-1), _allocatedBuckets(0) { } ~LiteralTable() { reset(); } void reset() { if (_literals) { Literal **lastLiteral = _literals + _literalCount + 1; for (Literal **it = _literals; it != lastLiteral; ++it) delete *it; std::free(_literals); } if (_buckets) std::free(_buckets); _literals = 0; _buckets = 0; _allocatedLiterals = 0; _literalCount = -1; _allocatedBuckets = 0; } bool empty() const { return _literalCount == -1; } unsigned size() const { return _literalCount + 1; } const Literal *at(unsigned index) const { return _literals[index]; } iterator begin() const { return _literals; } iterator end() const { return _literals + _literalCount + 1; } const Literal *findLiteral(const char *chars, unsigned size) const { if (_buckets) { unsigned h = Literal::hashCode(chars, size); Literal *literal = _buckets[h % _allocatedBuckets]; for (; literal; literal = static_cast<Literal *>(literal->_next)) { if (literal->size() == size && ! std::strncmp(literal->chars(), chars, size)) return literal; } } return 0; } const Literal *findOrInsertLiteral(const char *chars, unsigned size) { if (_buckets) { unsigned h = Literal::hashCode(chars, size); Literal *literal = _buckets[h % _allocatedBuckets]; for (; literal; literal = static_cast<Literal *>(literal->_next)) { if (literal->size() == size && ! std::strncmp(literal->chars(), chars, size)) return literal; } } Literal *literal = new Literal(chars, size); if (++_literalCount == _allocatedLiterals) { if (! _allocatedLiterals) _allocatedLiterals = 4; else _allocatedLiterals <<= 1; _literals = (Literal **) std::realloc(_literals, sizeof(Literal *) * _allocatedLiterals); } _literals[_literalCount] = literal; if (! _buckets || _literalCount * 5 >= _allocatedBuckets * 3) rehash(); else { unsigned h = literal->hashCode() % _allocatedBuckets; literal->_next = _buckets[h]; _buckets[h] = literal; } return literal; } protected: void rehash() { if (_buckets) std::free(_buckets); if (! _allocatedBuckets) _allocatedBuckets = 4; else _allocatedBuckets <<= 1; _buckets = (Literal **) std::calloc(_allocatedBuckets, sizeof(Literal *)); Literal **lastLiteral = _literals + (_literalCount + 1); for (Literal **it = _literals; it != lastLiteral; ++it) { Literal *literal = *it; unsigned h = literal->hashCode() % _allocatedBuckets; literal->_next = _buckets[h]; _buckets[h] = literal; } } protected: Literal **_literals; Literal **_buckets; int _allocatedLiterals; int _literalCount; int _allocatedBuckets; }; } // namespace CPlusPlus #endif // CPLUSPLUS_LITERALTABLE_H
/* PR optimization/6842 This testcase caused ICE when trying to optimize V8QI subreg of VOIDmode CONST_DOUBLE. */ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ /* { dg-options "-O2 -mmmx" } */ typedef unsigned char __v8qi __attribute__ ((vector_size (8))); extern void abort (void); extern void exit (int); void foo (void) { unsigned long long a = 0x0102030405060708LL; unsigned long long b = 0x1020304050607080LL; unsigned long long c; c = (unsigned long long) __builtin_ia32_paddusb ((__v8qi) a, (__v8qi) b); __builtin_ia32_emms (); if (c != 0x1122334455667788LL) abort (); }
/* Copyright (C) 2000-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2000. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <limits.h> #include <math.h> #include <stdio.h> int main (void) { int result = 0; if (FP_ILOGB0 != INT_MIN && FP_ILOGB0 != -INT_MAX) { puts ("FP_ILOGB0 has no valid value"); result = 1; } else puts ("FP_ILOGB0 value is OK"); if (FP_ILOGBNAN != INT_MIN && FP_ILOGBNAN != INT_MAX) { puts ("FP_ILOBNAN has no valid value"); result = 1; } else puts ("FP_ILOGBNAN value is OK"); return result; }
//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by LAVSplitter.rc // #define IDD_PROPPAGE_LAVFSETTINGS 9 #define IDD_PROPPAGE_FORMATS 10 #define IDS_PAGE_TITLE 101 #define IDS_SUBMODE_NO_SUBS 102 #define IDI_ICON1 103 #define IDS_SUBMODE_FORCED_SUBS 104 #define IDS_SUBMODE_DEFAULT 105 #define IDS_SUBMODE_ADVANCED 106 #define IDS_INPUT_FORMATS 107 #define IDC_LBL_PREF_LANG 1001 #define IDC_PREF_LANG 1002 #define IDC_LBL_PREF_LANG_AUDIO 1003 #define IDC_PREF_LANG_SUBS 1004 #define IDC_LBL_PREF_LANG_SUBS 1005 #define IDC_SUBTITLE_MODE 1006 #define IDC_LBL_SUBMODE 1007 #define IDC_VC1TIMESTAMP 1009 #define IDC_SUBSTREAMS 1010 #define IDC_DEMUXER_SETTINGS 1011 #define IDC_SPLITTER_FOOTER 1012 #define IDC_FORMATS 1016 #define IDC_LBL_INPUT 1017 #define IDC_CUR_INPUT 1018 #define IDC_LBL_FORMATS 1019 #define IDC_BD_SUBS 1020 #define IDC_BD_SEPARATE_FORCED_SUBS 1021 #define IDC_BD_ONLY_FORCED_SUBS 1022 #define IDC_STREAM_SWITCH_REMOVE_AUDIO 1024 #define IDC_SUBTITLE_NOTE 1025 #define IDC_IMPAIRED_AUDIO 1026 #define IDC_QUEUE_SETTINGS 1027 #define IDC_LBL_QUEUE_MEM 1028 #define IDC_QUEUE_MEM 1029 #define IDC_QUEUE_MEM_SPIN 1030 #define IDC_TRAYICON 1031 #define IDC_SELECT_AUDIO_QUALITY 1032 #define IDC_FMT_SETTINGS 1033 #define IDC_MKV_EXTERNAL 1034 #define IDC_NETWORK_SETTINGS 1035 #define IDC_LBL_STREAM_BUFFER 1036 #define IDC_STREAM_ANADUR 1037 #define IDC_STREAM_ANADUR_SPIN 1038 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 107 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1039 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif
/* { dg-require-effective-target vect_condition } */ #include "tree-vect.h" #define N 16 int c[N] = {3,2,1,10,1,42,3,4,50,9,32,8,11,10,1,2}; int a[N+1] = {0,16,32,48,64,128,256,512,0,16,32,48,64,128,256,512,1024}; __attribute__ ((noinline)) void foo (int *x) { int i; int curr_a, flag, next_a; curr_a = a[0]; for (i = 0; i < N; i++) { flag = *x > c[i]; next_a = a[i+1]; curr_a = flag ? curr_a : next_a; } *x = curr_a; } int main (void) { int x = 7; check_vect (); foo (&x); if (x != 256) abort (); return 0; } /* The order of computation should not be changed for cond_expr, therefore, it cannot be vectorized in reduction. */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
#pragma once #include <stdint.h> #include <stdbool.h> #include "AP_HAL_Namespace.h" #include "AP_HAL_Boards.h" #include "AP_HAL_Macros.h" #include "AP_HAL_Main.h" /* HAL Module Classes (all pure virtual) */ #include "UARTDriver.h" #include "AnalogIn.h" #include "Storage.h" #include "GPIO.h" #include "RCInput.h" #include "RCOutput.h" #include "Scheduler.h" #include "Semaphores.h" #include "Util.h" #include "OpticalFlow.h" #include "utility/Print.h" #include "utility/Stream.h" #include "utility/BetterStream.h" /* HAL Class definition */ #include "HAL.h" #include "system.h"
/* ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio LPC11xx EXT driver - Copyright (C) 2013 Marcin Jokel Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * @file LPC11xx/ext_lld_isr.h * @brief LPC11xx EXT subsystem low level driver ISR header. * * @addtogroup EXT * @{ */ #ifndef _EXT_LLD_ISR_H_ #define _EXT_LLD_ISR_H_ #if HAL_USE_EXT || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ /*===========================================================================*/ #define EXTI0_IRQ 0 #define EXTI1_IRQ 1 #define EXTI2_IRQ 2 #define EXTI3_IRQ 3 /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ /** * @name Configuration options * @{ */ /** * @brief EXTI0 interrupt priority level setting. */ #if !defined(LPC11xx_EXT_EXTI0_IRQ_PRIORITY) || defined(__DOXYGEN__) #define LPC11xx_EXT_EXTI0_IRQ_PRIORITY 3 #endif /** * @brief EXTI1 interrupt priority level setting. */ #if !defined(LPC11xx_EXT_EXTI1_IRQ_PRIORITY) || defined(__DOXYGEN__) #define LPC11xx_EXT_EXTI1_IRQ_PRIORITY 3 #endif /** * @brief EXTI2 interrupt priority level setting. */ #if !defined(LPC11xx_EXT_EXTI2_IRQ_PRIORITY) || defined(__DOXYGEN__) #define LPC11xx_EXT_EXTI2_IRQ_PRIORITY 3 #endif /** * @brief EXTI3 interrupt priority level setting. */ #if !defined(LPC11xx_EXT_EXTI3_IRQ_PRIORITY) || defined(__DOXYGEN__) #define LPC11xx_EXT_EXTI3_IRQ_PRIORITY 3 #endif /** @} */ /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ /*===========================================================================*/ /* Driver data structures and types. */ /*===========================================================================*/ /** * @brief EXT irq port identifier. */ typedef uint32_t extirq_t; /*===========================================================================*/ /* Driver macros. */ /*===========================================================================*/ /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ #ifdef __cplusplus extern "C" { #endif void ext_lld_exti_irq_enable(extirq_t irqn); void ext_lld_exti_irq_disable(extirq_t irqn); #ifdef __cplusplus } #endif #endif /* HAL_USE_EXT */ #endif /* _EXT_LLD_ISR_H_ */ /** @} */
/* GIO - GLib Input, Output and Streaming Library * * Copyright (C) 2009 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General * Public License along with this library; if not, see <http://www.gnu.org/licenses/>. * * Author: Alexander Larsson <alexl@redhat.com> */ #ifndef __G_CONVERTER_H__ #define __G_CONVERTER_H__ #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) #error "Only <gio/gio.h> can be included directly." #endif #include <gio/giotypes.h> G_BEGIN_DECLS #define G_TYPE_CONVERTER (g_converter_get_type ()) #define G_CONVERTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_CONVERTER, GConverter)) #define G_IS_CONVERTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_CONVERTER)) #define G_CONVERTER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_CONVERTER, GConverterIface)) /** * GConverter: * * Seek object for streaming operations. * * Since: 2.24 **/ typedef struct _GConverterIface GConverterIface; /** * GConverterIface: * @g_iface: The parent interface. * @convert: Converts data. * @reset: Reverts the internal state of the converter to its initial state. * * Provides an interface for converting data from one type * to another type. The conversion can be stateful * and may fail at any place. * * Since: 2.24 **/ struct _GConverterIface { GTypeInterface g_iface; /* Virtual Table */ GConverterResult (* convert) (GConverter *converter, const void *inbuf, gsize inbuf_size, void *outbuf, gsize outbuf_size, GConverterFlags flags, gsize *bytes_read, gsize *bytes_written, GError **error); void (* reset) (GConverter *converter); }; GLIB_AVAILABLE_IN_ALL GType g_converter_get_type (void) G_GNUC_CONST; GLIB_AVAILABLE_IN_ALL GConverterResult g_converter_convert (GConverter *converter, const void *inbuf, gsize inbuf_size, void *outbuf, gsize outbuf_size, GConverterFlags flags, gsize *bytes_read, gsize *bytes_written, GError **error); GLIB_AVAILABLE_IN_ALL void g_converter_reset (GConverter *converter); G_END_DECLS #endif /* __G_CONVERTER_H__ */
/*++ Copyright (c) 2011 Microsoft Corporation Module Name: dlist.h Abstract: Templates for manipulating doubly linked lists. Author: Leonardo de Moura (leonardo) 2011-01-25. Revision History: --*/ #ifndef __DLIST_H_ #define __DLIST_H_ /** Add element \c elem to the list headed by \c head. NextProc and PrevProc must have the methods: T * & operator()(T *); T * & operator()(T *); They should return the next and prev fields of the given object. */ template<typename T, typename NextProc, typename PrevProc> void dlist_add(T * & head, T * elem, NextProc const & next = NextProc(), PrevProc const & prev = PrevProc()) { SASSERT(prev(elem) == 0); SASSERT(next(elem) == 0); if (head == 0) { head = elem; } else { next(elem) = head; prev(head) = elem; head = elem; } } template<typename T, typename NextProc, typename PrevProc> void dlist_del(T * & head, T * elem, NextProc const & next = NextProc(), PrevProc const & prev = PrevProc()) { T * & prev_elem = prev(elem); T * & next_elem = next(elem); if (head == elem) { SASSERT(prev_elem == 0); if (next_elem != 0) prev(next_elem) = 0; head = next_elem; } else { SASSERT(prev_elem != 0); next(prev_elem) = next_elem; if (next_elem != 0) prev(next_elem) = prev_elem; } prev_elem = 0; next_elem = 0; } /** \brief Remove the head of the list. Return the old head. */ template<typename T, typename NextProc, typename PrevProc> T * dlist_pop(T * & head, NextProc const & next = NextProc(), PrevProc const & prev = PrevProc()) { if (head == 0) { return 0; } else { SASSERT(prev(head) == 0); T * r = head; head = next(head); if (head) prev(head) = 0; next(r) = 0; return r; } } /** \brief Insert new element after elem. */ template<typename T, typename NextProc, typename PrevProc> void dlist_insert_after(T * elem, T * new_elem, NextProc const & next = NextProc(), PrevProc const & prev = PrevProc()) { SASSERT(elem); SASSERT(new_elem); T * & old_next_elem = next(elem); prev(new_elem) = elem; next(new_elem) = old_next_elem; if (old_next_elem) prev(old_next_elem) = new_elem; // next(elem) = new_elem; old_next_elem = new_elem; } template<typename T, typename NextProc> bool dlist_contains(T * head, T const * elem, NextProc const & next = NextProc()) { T * curr = head; while (curr != 0) { if (curr == elem) return true; curr = next(curr); } return false; } template<typename T, typename NextProc> unsigned dlist_length(T * head, NextProc const & next = NextProc()) { unsigned r = 0; T * curr = head; while (curr != 0) { r++; curr = next(curr); } return r; } template<typename T, typename NextProc, typename PrevProc> bool dlist_check_invariant(T * head, NextProc const & next = NextProc(), PrevProc const & prev = PrevProc()) { if (head == 0) return true; SASSERT(prev(head) == 0); T * old = head; T * curr = next(head); while (curr != 0) { SASSERT(prev(curr) == old); old = curr; curr = next(curr); } return true; } #endif
// license:BSD-3-Clause // copyright-holders:Ville Linde, Aaron Giles /*************************************************************************** polylgcy.h Legacy polygon helper routines. **************************************************************************** Pixel model: (0.0,0.0) (1.0,0.0) (2.0,0.0) (3.0,0.0) +---------------+---------------+---------------+ | | | | | | | | | (0.5,0.5) | (1.5,0.5) | (2.5,0.5) | | * | * | * | | | | | | | | | (0.0,1.0) (1.0,1.0) (2.0,1.0) (3.0,1.0) +---------------+---------------+---------------+ | | | | | | | | | (0.5,1.5) | (1.5,1.5) | (2.5,1.5) | | * | * | * | | | | | | | | | | | | | +---------------+---------------+---------------+ (0.0,2.0) (1.0,2.0) (2.0,2.0) (3.0,2.0) ***************************************************************************/ #ifndef MAME_VIDEO_POLYLGCY_H #define MAME_VIDEO_POLYLGCY_H #pragma once /*************************************************************************** CONSTANTS ***************************************************************************/ static constexpr unsigned POLYLGCY_MAX_VERTEX_PARAMS = 6; static constexpr unsigned POLYLGCY_MAX_POLYGON_VERTS = 32; static constexpr uint8_t POLYLGCY_FLAG_INCLUDE_BOTTOM_EDGE = 0x01; static constexpr uint8_t POLYLGCY_FLAG_INCLUDE_RIGHT_EDGE = 0x02; static constexpr uint8_t POLYLGCY_FLAG_NO_WORK_QUEUE = 0x04; static constexpr uint8_t POLYLGCY_FLAG_ALLOW_QUADS = 0x08; /*************************************************************************** TYPE DEFINITIONS ***************************************************************************/ /* opaque reference to the poly manager */ struct legacy_poly_manager; /* input vertex data */ struct poly_vertex { float x; /* X coordinate */ float y; /* Y coordinate */ float p[POLYLGCY_MAX_VERTEX_PARAMS]; /* interpolated parameter values */ }; /* poly_param_extent describes information for a single parameter in an extent */ struct poly_param_extent { float start; /* parameter value at starting X,Y */ float dpdx; /* dp/dx relative to starting X */ }; /* poly_extent describes start/end points for a scanline, along with per-scanline parameters */ struct poly_extent { int16_t startx; /* starting X coordinate (inclusive) */ int16_t stopx; /* ending X coordinate (exclusive) */ poly_param_extent param[POLYLGCY_MAX_VERTEX_PARAMS]; /* starting and dx values for each parameter */ }; /* callback routine to process a batch of scanlines in a triangle */ typedef void (*poly_draw_scanline_func)(void *dest, int32_t scanline, const poly_extent *extent, const void *extradata, int threadid); /*************************************************************************** TYPE DEFINITIONS ***************************************************************************/ /* ----- initialization/teardown ----- */ /* allocate a new poly manager that can render triangles */ legacy_poly_manager *poly_alloc(running_machine &machine, int max_polys, size_t extra_data_size, uint8_t flags); /* free a poly manager */ void poly_free(legacy_poly_manager *poly); /* ----- common functions ----- */ /* wait until all polygons in the queue have been rendered */ void poly_wait(legacy_poly_manager *poly, const char *debug_reason); /* get a pointer to the extra data for the next polygon */ void *poly_get_extra_data(legacy_poly_manager *poly); /* ----- core triangle rendering ----- */ /* render a single triangle given 3 vertexes */ uint32_t poly_render_triangle(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3); /* render a set of triangles in a fan */ uint32_t poly_render_triangle_fan(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v); /* perform a custom render of an object, given specific extents */ uint32_t poly_render_triangle_custom(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int startscanline, int numscanlines, const poly_extent *extents); /* ----- core quad rendering ----- */ /* render a single quad given 4 vertexes */ uint32_t poly_render_quad(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, const poly_vertex *v1, const poly_vertex *v2, const poly_vertex *v3, const poly_vertex *v4); /* render a set of quads in a fan */ uint32_t poly_render_quad_fan(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v); /* ----- core polygon rendering ----- */ /* render a single polygon up to 32 vertices */ uint32_t poly_render_polygon(legacy_poly_manager *poly, void *dest, const rectangle &cliprect, poly_draw_scanline_func callback, int paramcount, int numverts, const poly_vertex *v); /* ----- clipping ----- */ /* zclip (assumes p[0] == z) a polygon */ int poly_zclip_if_less(int numverts, const poly_vertex *v, poly_vertex *outv, int paramcount, float clipval); #endif // MAME_VIDEO_POLYLGCY_H
/* * Copyright (C) 2008 Daniel Verkamp <daniel@drv.nu>. * * 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; either version 2 of the * License, or any later version. * * 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., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ /** * @file SYSLINUX COM32 helpers * */ FILE_LICENCE ( GPL2_OR_LATER ); #include <stdint.h> #include <realmode.h> #include <comboot.h> #include <assert.h> #include <ipxe/uaccess.h> static com32sys_t __bss16 ( com32_regs ); #define com32_regs __use_data16 ( com32_regs ) static uint8_t __bss16 ( com32_int_vector ); #define com32_int_vector __use_data16 ( com32_int_vector ) static uint32_t __bss16 ( com32_farcall_proc ); #define com32_farcall_proc __use_data16 ( com32_farcall_proc ) uint16_t __bss16 ( com32_saved_sp ); /** * Interrupt call helper */ void __asmcall com32_intcall ( uint8_t interrupt, physaddr_t inregs_phys, physaddr_t outregs_phys ) { memcpy_user ( virt_to_user( &com32_regs ), 0, phys_to_user ( inregs_phys ), 0, sizeof(com32sys_t) ); com32_int_vector = interrupt; __asm__ __volatile__ ( REAL_CODE ( /* Save all registers */ "pushal\n\t" "pushw %%ds\n\t" "pushw %%es\n\t" "pushw %%fs\n\t" "pushw %%gs\n\t" /* Mask off unsafe flags */ "movl (com32_regs + 40), %%eax\n\t" "andl $0x200cd7, %%eax\n\t" "movl %%eax, (com32_regs + 40)\n\t" /* Load com32_regs into the actual registers */ "movw %%sp, %%ss:(com32_saved_sp)\n\t" "movw $com32_regs, %%sp\n\t" "popw %%gs\n\t" "popw %%fs\n\t" "popw %%es\n\t" "popw %%ds\n\t" "popal\n\t" "popfl\n\t" "movw %%ss:(com32_saved_sp), %%sp\n\t" /* patch INT instruction */ "pushw %%ax\n\t" "movb %%ss:(com32_int_vector), %%al\n\t" "movb %%al, %%cs:(com32_intcall_instr + 1)\n\t" /* perform a jump to avoid problems with cache * consistency in self-modifying code on some CPUs (486) */ "jmp 1f\n" "1:\n\t" "popw %%ax\n\t" "com32_intcall_instr:\n\t" /* INT instruction to be patched */ "int $0xFF\n\t" /* Copy regs back to com32_regs */ "movw %%sp, %%ss:(com32_saved_sp)\n\t" "movw $(com32_regs + 44), %%sp\n\t" "pushfl\n\t" "pushal\n\t" "pushw %%ds\n\t" "pushw %%es\n\t" "pushw %%fs\n\t" "pushw %%gs\n\t" "movw %%ss:(com32_saved_sp), %%sp\n\t" /* Restore registers */ "popw %%gs\n\t" "popw %%fs\n\t" "popw %%es\n\t" "popw %%ds\n\t" "popal\n\t") : : ); if ( outregs_phys ) { memcpy_user ( phys_to_user ( outregs_phys ), 0, virt_to_user( &com32_regs ), 0, sizeof(com32sys_t) ); } } /** * Farcall helper */ void __asmcall com32_farcall ( uint32_t proc, physaddr_t inregs_phys, physaddr_t outregs_phys ) { memcpy_user ( virt_to_user( &com32_regs ), 0, phys_to_user ( inregs_phys ), 0, sizeof(com32sys_t) ); com32_farcall_proc = proc; __asm__ __volatile__ ( REAL_CODE ( /* Save all registers */ "pushal\n\t" "pushw %%ds\n\t" "pushw %%es\n\t" "pushw %%fs\n\t" "pushw %%gs\n\t" /* Mask off unsafe flags */ "movl (com32_regs + 40), %%eax\n\t" "andl $0x200cd7, %%eax\n\t" "movl %%eax, (com32_regs + 40)\n\t" /* Load com32_regs into the actual registers */ "movw %%sp, %%ss:(com32_saved_sp)\n\t" "movw $com32_regs, %%sp\n\t" "popw %%gs\n\t" "popw %%fs\n\t" "popw %%es\n\t" "popw %%ds\n\t" "popal\n\t" "popfl\n\t" "movw %%ss:(com32_saved_sp), %%sp\n\t" /* Call procedure */ "lcall *%%ss:(com32_farcall_proc)\n\t" /* Copy regs back to com32_regs */ "movw %%sp, %%ss:(com32_saved_sp)\n\t" "movw $(com32_regs + 44), %%sp\n\t" "pushfl\n\t" "pushal\n\t" "pushw %%ds\n\t" "pushw %%es\n\t" "pushw %%fs\n\t" "pushw %%gs\n\t" "movw %%ss:(com32_saved_sp), %%sp\n\t" /* Restore registers */ "popw %%gs\n\t" "popw %%fs\n\t" "popw %%es\n\t" "popw %%ds\n\t" "popal\n\t") : : ); if ( outregs_phys ) { memcpy_user ( phys_to_user ( outregs_phys ), 0, virt_to_user( &com32_regs ), 0, sizeof(com32sys_t) ); } } /** * CDECL farcall helper */ int __asmcall com32_cfarcall ( uint32_t proc, physaddr_t stack, size_t stacksz ) { int32_t eax; copy_user_to_rm_stack ( phys_to_user ( stack ), stacksz ); com32_farcall_proc = proc; __asm__ __volatile__ ( REAL_CODE ( "lcall *%%ss:(com32_farcall_proc)\n\t" ) : "=a" (eax) : : "ecx", "edx" ); remove_user_from_rm_stack ( 0, stacksz ); return eax; }
/* * Unittest for curlftpsink */ #include <gst/check/gstcheck.h> #include <glib/gstdio.h> #include <curl/curl.h> static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); static GstPad *srcpad; static GstElement *sink; static GstElement * setup_curlftpsink (void) { GST_DEBUG ("setup_curlftpsink"); sink = gst_check_setup_element ("curlftpsink"); srcpad = gst_check_setup_src_pad (sink, &srctemplate); fail_unless (gst_pad_set_active (srcpad, TRUE)); return sink; } static void cleanup_curlftpsink (GstElement * sink) { GST_DEBUG ("cleanup_curlftpsink"); gst_check_teardown_src_pad (sink); gst_check_teardown_element (sink); } GST_START_TEST (test_properties) { GstElement *sink; gchar *res_location = NULL; gchar *res_file_name = NULL; gchar *res_ftp_port = NULL; gchar *res_tmp_file_name = NULL; gboolean res_create_tmpfile; gboolean res_epsv_mode; gboolean res_create_dirs; sink = setup_curlftpsink (); g_object_set (G_OBJECT (sink), "location", "mylocation", NULL); g_object_set (G_OBJECT (sink), "file-name", "myfile", NULL); g_object_set (G_OBJECT (sink), "ftp-port", "1.2.3.4:0", NULL); g_object_set (G_OBJECT (sink), "epsv-mode", FALSE, NULL); g_object_set (G_OBJECT (sink), "create-dirs", FALSE, NULL); g_object_set (G_OBJECT (sink), "create-tmp-file", FALSE, NULL); g_object_set (G_OBJECT (sink), "temp-file-name", "test_tmp_file_", NULL); g_object_get (sink, "location", &res_location, "file-name", &res_file_name, "ftp-port", &res_ftp_port, "epsv-mode", &res_epsv_mode, "create-dirs", &res_create_dirs, "create-tmp-file", &res_create_tmpfile, "temp-file-name", &res_tmp_file_name, NULL); fail_unless (strncmp (res_location, "mylocation", strlen ("mylocation")) == 0); fail_unless (strncmp (res_file_name, "myfile", strlen ("myfile")) == 0); fail_unless (strncmp (res_ftp_port, "1.2.3.4:0", strlen ("1.2.3.4:0")) == 0); fail_unless (strncmp (res_tmp_file_name, "test_tmp_file_", strlen ("test_tmp_file_")) == 0); fail_unless (res_epsv_mode == FALSE); fail_unless (res_create_dirs == FALSE); fail_unless (res_create_tmpfile == FALSE); g_free (res_location); g_free (res_file_name); g_free (res_ftp_port); g_free (res_tmp_file_name); /* change properties */ g_object_set (G_OBJECT (sink), "location", "newlocation", NULL); g_object_set (G_OBJECT (sink), "file-name", "newfilename", NULL); g_object_set (G_OBJECT (sink), "ftp-port", "", NULL); g_object_set (G_OBJECT (sink), "epsv-mode", TRUE, NULL); g_object_set (G_OBJECT (sink), "create-dirs", TRUE, NULL); g_object_set (G_OBJECT (sink), "create-tmp-file", TRUE, NULL); g_object_set (G_OBJECT (sink), "temp-file-name", "test_tmp_file_", NULL); g_object_get (sink, "location", &res_location, "file-name", &res_file_name, "ftp-port", &res_ftp_port, "epsv-mode", &res_epsv_mode, "create-dirs", &res_create_dirs, "create-tmp-file", &res_create_tmpfile, "temp-file-name", &res_tmp_file_name, NULL); fail_unless (strncmp (res_location, "newlocation", strlen ("newlocation")) == 0); fail_unless (strncmp (res_file_name, "newfilename", strlen ("newfilename")) == 0); fail_unless (strncmp (res_ftp_port, "", strlen ("")) == 0); fail_unless (strncmp (res_tmp_file_name, "test_tmp_file_", strlen ("test_tmp_file_")) == 0); fail_unless (res_epsv_mode == TRUE); fail_unless (res_create_dirs == TRUE); fail_unless (res_create_dirs == TRUE); fail_unless (res_create_tmpfile == TRUE); g_free (res_location); g_free (res_file_name); g_free (res_ftp_port); g_free (res_tmp_file_name); cleanup_curlftpsink (sink); } GST_END_TEST; static Suite * curlsink_suite (void) { Suite *s = suite_create ("curlftpsink"); TCase *tc_chain = tcase_create ("general"); suite_add_tcase (s, tc_chain); tcase_set_timeout (tc_chain, 20); tcase_add_test (tc_chain, test_properties); return s; } GST_CHECK_MAIN (curlsink);
/* * btree.h * */ int befs_btree_find(struct super_block *sb, befs_data_stream * ds, const char *key, befs_off_t * value); int befs_btree_read(struct super_block *sb, befs_data_stream * ds, loff_t key_no, size_t bufsize, char *keybuf, size_t * keysize, befs_off_t * value);
/*************************************************************************/ /*! @Title System Description Header @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved @Description This header provides system-specific declarations and macros @License Dual MIT/GPLv2 The contents of this file are subject to the MIT license as set out below. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. Alternatively, the contents of this file may be used under the terms of the GNU General Public License Version 2 ("GPL") in which case the provisions of GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of GPL, and not to allow others to use your version of this file under the terms of the MIT license, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by GPL as set out in the file called "GPL-COPYING" included in this distribution. If you do not delete the provisions above, a recipient may use your version of this file under the terms of either the MIT license or GPL. This License is also included in this distribution in the file called "MIT-COPYING". EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ #if !defined(__SYSINFO_H__) #define __SYSINFO_H__ #if defined(SGX540) && (SGX_CORE_REV == 120) #define SYS_SGX_CLOCK_SPEED 307200000 #else #define SYS_SGX_CLOCK_SPEED 200000000 #endif /*!< System specific poll/timeout details */ #if defined(PVR_LINUX_USING_WORKQUEUES) /* * The workqueue based 3rd party display driver may be blocked for up * to 500ms waiting for a vsync when the screen goes blank, so we * need to wait longer for the hardware if a flush of the swap chain is * required. */ #define MAX_HW_TIME_US (1000000) #define WAIT_TRY_COUNT (20000) #else #define MAX_HW_TIME_US (500000) #define WAIT_TRY_COUNT (10000) #endif #define SYS_DEVICE_COUNT 15 /* SGX, DISPLAYCLASS (external), BUFFERCLASS (external) */ #endif /* __SYSINFO_H__ */
/*********************************************************************** Copyright (c) 2006-2011, Skype Limited. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of Internet Society, IETF or IETF Trust, nor the names of specific contributors, may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***********************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" #include "SigProc_FIX.h" /* R. Laroia, N. Phamdo and N. Farvardin, "Robust and Efficient Quantization of Speech LSP Parameters Using Structured Vector Quantization", Proc. IEEE Int. Conf. Acoust., Speech, Signal Processing, pp. 641-644, 1991. */ /* Laroia low complexity NLSF weights */ void silk_NLSF_VQ_weights_laroia( opus_int16 *pNLSFW_Q_OUT, /* O Pointer to input vector weights [D] */ const opus_int16 *pNLSF_Q15, /* I Pointer to input vector [D] */ const opus_int D /* I Input vector dimension (even) */ ) { opus_int k; opus_int32 tmp1_int, tmp2_int; silk_assert( D > 0 ); silk_assert( ( D & 1 ) == 0 ); /* First value */ tmp1_int = silk_max_int( pNLSF_Q15[ 0 ], 1 ); tmp1_int = silk_DIV32_16( (opus_int32)1 << ( 15 + NLSF_W_Q ), tmp1_int ); tmp2_int = silk_max_int( pNLSF_Q15[ 1 ] - pNLSF_Q15[ 0 ], 1 ); tmp2_int = silk_DIV32_16( (opus_int32)1 << ( 15 + NLSF_W_Q ), tmp2_int ); pNLSFW_Q_OUT[ 0 ] = (opus_int16)silk_min_int( tmp1_int + tmp2_int, silk_int16_MAX ); silk_assert( pNLSFW_Q_OUT[ 0 ] > 0 ); /* Main loop */ for( k = 1; k < D - 1; k += 2 ) { tmp1_int = silk_max_int( pNLSF_Q15[ k + 1 ] - pNLSF_Q15[ k ], 1 ); tmp1_int = silk_DIV32_16( (opus_int32)1 << ( 15 + NLSF_W_Q ), tmp1_int ); pNLSFW_Q_OUT[ k ] = (opus_int16)silk_min_int( tmp1_int + tmp2_int, silk_int16_MAX ); silk_assert( pNLSFW_Q_OUT[ k ] > 0 ); tmp2_int = silk_max_int( pNLSF_Q15[ k + 2 ] - pNLSF_Q15[ k + 1 ], 1 ); tmp2_int = silk_DIV32_16( (opus_int32)1 << ( 15 + NLSF_W_Q ), tmp2_int ); pNLSFW_Q_OUT[ k + 1 ] = (opus_int16)silk_min_int( tmp1_int + tmp2_int, silk_int16_MAX ); silk_assert( pNLSFW_Q_OUT[ k + 1 ] > 0 ); } /* Last value */ tmp1_int = silk_max_int( ( 1 << 15 ) - pNLSF_Q15[ D - 1 ], 1 ); tmp1_int = silk_DIV32_16( (opus_int32)1 << ( 15 + NLSF_W_Q ), tmp1_int ); pNLSFW_Q_OUT[ D - 1 ] = (opus_int16)silk_min_int( tmp1_int + tmp2_int, silk_int16_MAX ); silk_assert( pNLSFW_Q_OUT[ D - 1 ] > 0 ); }
/* * Renesas Solutions Highlander R7785RP Support. * * Copyright (C) 2002 Atom Create Engineering Co., Ltd. * Copyright (C) 2006 Paul Mundt * Copyright (C) 2007 Magnus Damm * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/init.h> #include <linux/irq.h> #include <linux/io.h> #include <asm/r7780rp.h> enum { UNUSED = 0, /* board specific interrupt sources */ AX88796, /* Ethernet controller */ CF, /* Compact Flash */ }; static struct intc_vect vectors[] __initdata = { INTC_IRQ(CF, IRQ_CF), INTC_IRQ(AX88796, IRQ_AX88796), }; static struct intc_mask_reg mask_registers[] __initdata = { { 0xa4000010, 0, 16, /* IRLMCR1 */ { 0, 0, 0, 0, CF, AX88796, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, }; static unsigned char irl2irq[HL_NR_IRL] __initdata = { 0, IRQ_CF, 0, 0, 0, 0, 0, 0, 0, 0, IRQ_AX88796, 0, 0, 0, 0, }; static DECLARE_INTC_DESC(intc_desc, "r7785rp", vectors, NULL, NULL, mask_registers, NULL, NULL); unsigned char * __init highlander_init_irq_r7785rp(void) { if ((ctrl_inw(0xa4000158) & 0xf000) != 0x1000) return NULL; printk(KERN_INFO "Using r7785rp interrupt controller.\n"); ctrl_outw(0x0000, PA_IRLSSR1); /* FPGA IRLSSR1(CF_CD clear) */ /* Setup the FPGA IRL */ ctrl_outw(0x0000, PA_IRLPRA); /* FPGA IRLA */ ctrl_outw(0xe598, PA_IRLPRB); /* FPGA IRLB */ ctrl_outw(0x7060, PA_IRLPRC); /* FPGA IRLC */ ctrl_outw(0x0000, PA_IRLPRD); /* FPGA IRLD */ ctrl_outw(0x4321, PA_IRLPRE); /* FPGA IRLE */ ctrl_outw(0x0000, PA_IRLPRF); /* FPGA IRLF */ register_intc_controller(&intc_desc); return irl2irq; }
/* * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ #ifndef CURVE_H #define CURVE_H #ifdef __cplusplus extern "C" { #endif typedef struct { jfloat ax, ay, bx, by, cx, cy, dx, dy; jfloat dax, day, dbx, dby; } Curve; extern void Curve_set(Curve *pCurve, jfloat points[], jint type); extern void Curve_setquad(Curve *pCurve, jfloat x1, jfloat y1, jfloat x2, jfloat y2, jfloat x3, jfloat y3); extern void Curve_setcubic(Curve *pCurve, jfloat x1, jfloat y1, jfloat x2, jfloat y2, jfloat x3, jfloat y3, jfloat x4, jfloat y4); extern jint Curve_dxRoots(Curve *pCurve, jfloat roots[], jint off); extern jint Curve_dyRoots(Curve *pCurve, jfloat roots[], jint off); extern jint Curve_infPoints(Curve *pCurve, jfloat pts[], jint off); extern jint Curve_rootsOfROCMinusW(Curve *pCurve, jfloat roots[], jint off, const jfloat w, const jfloat err); #ifdef __cplusplus } #endif #endif /* CURVE_H */
/* * Copyright 2006 Sony Computer Entertainment Inc. * * Licensed under the MIT Open Source License, for details please see license.txt or the website * http://www.opensource.org/licenses/mit-license.php * */ #ifndef __domPlane_h__ #define __domPlane_h__ #include <dae/daeDocument.h> #include <dom/domTypes.h> #include <dom/domElements.h> #include <dom/domExtra.h> class DAE; /** * An infinite plane primitive. */ class domPlane : public daeElement { public: virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::PLANE; } static daeInt ID() { return 769; } virtual daeInt typeID() const { return ID(); } public: class domEquation; typedef daeSmartRef<domEquation> domEquationRef; typedef daeTArray<domEquationRef> domEquation_Array; /** * 4 float values that represent the coefficients for the plane’s equation: * Ax + By + Cz + D = 0 */ class domEquation : public daeElement { public: virtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::EQUATION; } static daeInt ID() { return 770; } virtual daeInt typeID() const { return ID(); } protected: // Value /** * The domFloat4 value of the text data of this element. */ domFloat4 _value; public: //Accessors and Mutators /** * Gets the _value array. * @return Returns a domFloat4 reference of the _value array. */ domFloat4 &getValue() { return _value; } /** * Gets the _value array. * @return Returns a constant domFloat4 reference of the _value array. */ const domFloat4 &getValue() const { return _value; } /** * Sets the _value array. * @param val The new value for the _value array. */ void setValue( const domFloat4 &val ) { _value = val; } protected: /** * Constructor */ domEquation(DAE& dae) : daeElement(dae), _value() {} /** * Destructor */ virtual ~domEquation() {} /** * Overloaded assignment operator */ virtual domEquation &operator=( const domEquation &cpy ) { (void)cpy; return *this; } public: // STATIC METHODS /** * Creates an instance of this class and returns a daeElementRef referencing it. * @return a daeElementRef referencing an instance of this object. */ static DLLSPEC daeElementRef create(DAE& dae); /** * Creates a daeMetaElement object that describes this element in the meta object reflection framework. * If a daeMetaElement already exists it will return that instead of creating a new one. * @return A daeMetaElement describing this COLLADA element. */ static DLLSPEC daeMetaElement* registerElement(DAE& dae); }; protected: // Elements /** * 4 float values that represent the coefficients for the plane’s equation: * Ax + By + Cz + D = 0 @see domEquation */ domEquationRef elemEquation; /** * The extra element may appear any number of times. @see domExtra */ domExtra_Array elemExtra_array; public: //Accessors and Mutators /** * Gets the equation element. * @return a daeSmartRef to the equation element. */ const domEquationRef getEquation() const { return elemEquation; } /** * Gets the extra element array. * @return Returns a reference to the array of extra elements. */ domExtra_Array &getExtra_array() { return elemExtra_array; } /** * Gets the extra element array. * @return Returns a constant reference to the array of extra elements. */ const domExtra_Array &getExtra_array() const { return elemExtra_array; } protected: /** * Constructor */ domPlane(DAE& dae) : daeElement(dae), elemEquation(), elemExtra_array() {} /** * Destructor */ virtual ~domPlane() {} /** * Overloaded assignment operator */ virtual domPlane &operator=( const domPlane &cpy ) { (void)cpy; return *this; } public: // STATIC METHODS /** * Creates an instance of this class and returns a daeElementRef referencing it. * @return a daeElementRef referencing an instance of this object. */ static DLLSPEC daeElementRef create(DAE& dae); /** * Creates a daeMetaElement object that describes this element in the meta object reflection framework. * If a daeMetaElement already exists it will return that instead of creating a new one. * @return A daeMetaElement describing this COLLADA element. */ static DLLSPEC daeMetaElement* registerElement(DAE& dae); }; #endif
/* * Copyright 2006 Sony Computer Entertainment Inc. * * Licensed under the MIT Open Source License, for details please see license.txt or the website * http://www.opensource.org/licenses/mit-license.php * */ #ifndef __DAE_DOM__ #define __DAE_DOM__ class daeMetaElement; class DAE; daeMetaElement* initializeDomMeta(DAE& dae); #endif //__DAE_DOM__
// // UYLZeroButton.h // Styles // // Created by Keith Harrison http://useyourloaf.com // Copyright (c) 2012 Keith Harrison. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // Neither the name of Keith Harrison nor the names of its contributors // may be used to endorse or promote products derived from this software // without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ''AS IS'' AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import <UIKit/UIKit.h> @interface UYLZeroButton : UIButton @end
/* * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef WEBRTC_MODULES_VIDEO_CODING_SOURCE_INTERNAL_DEFINES_H_ #define WEBRTC_MODULES_VIDEO_CODING_SOURCE_INTERNAL_DEFINES_H_ #include "webrtc/typedefs.h" namespace webrtc { #define MASK_32_BITS(x) (0xFFFFFFFF & (x)) inline uint32_t MaskWord64ToUWord32(int64_t w64) { return static_cast<uint32_t>(MASK_32_BITS(w64)); } #define VCM_MAX(a, b) (((a) > (b)) ? (a) : (b)) #define VCM_MIN(a, b) (((a) < (b)) ? (a) : (b)) #define VCM_DEFAULT_CODEC_WIDTH 352 #define VCM_DEFAULT_CODEC_HEIGHT 288 #define VCM_DEFAULT_FRAME_RATE 30 #define VCM_MIN_BITRATE 30 #define VCM_FLUSH_INDICATOR 4 // Helper macros for creating the static codec list #define VCM_NO_CODEC_IDX -1 #ifdef VIDEOCODEC_VP8 #define VCM_VP8_IDX (VCM_NO_CODEC_IDX + 1) #else #define VCM_VP8_IDX VCM_NO_CODEC_IDX #endif #ifdef VIDEOCODEC_VP9 #define VCM_VP9_IDX (VCM_VP8_IDX + 1) #else #define VCM_VP9_IDX VCM_VP8_IDX #endif #ifdef VIDEOCODEC_H264 #define VCM_H264_IDX (VCM_VP9_IDX + 1) #else #define VCM_H264_IDX VCM_VP9_IDX #endif #ifdef VIDEOCODEC_I420 #define VCM_I420_IDX (VCM_H264_IDX + 1) #else #define VCM_I420_IDX VCM_H264_IDX #endif #define VCM_NUM_VIDEO_CODECS_AVAILABLE (VCM_I420_IDX + 1) #define VCM_NO_RECEIVER_ID 0 inline int32_t VCMId(const int32_t vcmId, const int32_t receiverId = 0) { return static_cast<int32_t>((vcmId << 16) + receiverId); } } // namespace webrtc #endif // WEBRTC_MODULES_VIDEO_CODING_SOURCE_INTERNAL_DEFINES_H_
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_WEB_DIALOGS_WEB_DIALOG_UI_H_ #define UI_WEB_DIALOGS_WEB_DIALOG_UI_H_ #include <string> #include <vector> #include "base/compiler_specific.h" #include "base/strings/string16.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_ui_controller.h" #include "ui/base/ui_base_types.h" #include "ui/web_dialogs/web_dialogs_export.h" #include "url/gurl.h" namespace content { class WebContents; class WebUIMessageHandler; struct ContextMenuParams; } namespace gfx { class Size; } namespace ui { class WebDialogDelegate; // Displays file URL contents inside a modal web dialog. // // This application really should not use WebContents + WebUI. It should instead // just embed a RenderView in a dialog and be done with it. // // Before loading a URL corresponding to this WebUI, the caller should set its // delegate as user data on the WebContents by calling SetDelegate(). This WebUI // will pick it up from there and call it back. This is a bit of a hack to allow // the dialog to pass its delegate to the Web UI without having nasty accessors // on the WebContents. The correct design using RVH directly would avoid all of // this. class WEB_DIALOGS_EXPORT WebDialogUI : public content::WebUIController { public: struct WebDialogParams { // The URL for the content that will be loaded in the dialog. GURL url; // Width of the dialog. int width; // Height of the dialog. int height; // The JSON input to pass to the dialog when showing it. std::string json_input; }; // When created, the delegate should already be set as user data on the // WebContents. explicit WebDialogUI(content::WebUI* web_ui); ~WebDialogUI() override; // Close the dialog, passing the specified arguments to the close handler. void CloseDialog(const base::ListValue* args); // Sets the delegate on the WebContents. static void SetDelegate(content::WebContents* web_contents, WebDialogDelegate* delegate); private: // WebUIController void RenderViewCreated(content::RenderViewHost* render_view_host) override; // Gets the delegate for the WebContent set with SetDelegate. static WebDialogDelegate* GetDelegate(content::WebContents* web_contents); // JS message handler. void OnDialogClosed(const base::ListValue* args); DISALLOW_COPY_AND_ASSIGN(WebDialogUI); }; // Displays external URL contents inside a modal web dialog. // // Intended to be the place to collect the settings and lockdowns // necessary for running external UI components securely (e.g., the // cloud print dialog). class WEB_DIALOGS_EXPORT ExternalWebDialogUI : public WebDialogUI { public: explicit ExternalWebDialogUI(content::WebUI* web_ui); ~ExternalWebDialogUI() override; }; } // namespace ui #endif // UI_WEB_DIALOGS_WEB_DIALOG_UI_H_
/* *(C) Copyright 2007 Marvell International Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * All Rights Reserved */ #ifndef _CI_STUB_TTC_MACRO_H_ #define _CI_STUB_TTC_MACRO_H_ #define CiNullProcId 0x00 #define CiShRegisterReqProcId 0x01 #define CiShDeregisterReqProcId 0x02 #define CiShRequestProcId 0x03 #define CiRequestProcId 0x04 #define CiRespondProcId 0x05 #define CiStubRequestStartProcId 0x06 #define CiDataStubRequestStartProcId 0x07 #define CiDataStubReqDataProcId 0x08 #define CiShConfirmCbId 0x0001 #define CiConfirmDefCbId 0x0002 #define CiIndicateDefCbId 0x0003 #define CiConfirmCbId 0x0004 #define CiIndicateCbId 0x0005 #define CiStubConfirmStartProcId 0x0006 #define CiDatStubConfirmStartProcId 0x0007 #define CiDataStubIndDataProcId 0x0008 #define MAX_CI_STUB_RXMSG_LEN 2048 #define CI_DAT_INTERNAL_BUFFER 0xA #endif /* _CI_STUB_TTC_MACRO_H_ */
#ifndef __BOARD_8626M_H #define __BOARD_8626M_H #include <asm/page.h> #define PHYS_MEM_START (0x80000000) #define PHYS_MEM_SIZE (256*SZ_1M) #define PHYS_MEM_END (PHYS_MEM_START + PHYS_MEM_SIZE -1 ) /******** Reserved memory setting ************************/ #define RESERVED_MEM_START (0x80000000+64*SZ_1M) /*start at the second 64M*/ /******** CODEC memory setting ************************/ // Codec need 16M for 1080p decode // 4M for sd decode; #define ALIGN_MSK ((SZ_1M)-1) #define U_ALIGN(x) ((x+ALIGN_MSK)&(~ALIGN_MSK)) #define D_ALIGN(x) ((x)&(~ALIGN_MSK)) /******** AUDIODSP memory setting ************************/ #define AUDIODSP_ADDR_START U_ALIGN(RESERVED_MEM_START) /*audiodsp memstart*/ #define AUDIODSP_ADDR_END (AUDIODSP_ADDR_START+SZ_1M-1) /*audiodsp memend*/ /******** Frame buffer memory configuration ***********/ #define OSD_480_PIX (640*480) #define OSD_576_PIX (768*576) #define OSD_720_PIX (1280*720) #define OSD_1080_PIX (1920*1080) #define B16BpP (2) #define B32BpP (4) #define DOUBLE_BUFFER (2) #define OSD1_MAX_MEM U_ALIGN(OSD_1080_PIX*B32BpP*DOUBLE_BUFFER) #define OSD2_MAX_MEM U_ALIGN(32*32*B32BpP) /******** Reserved memory configuration ***************/ #define OSD1_ADDR_START U_ALIGN(AUDIODSP_ADDR_END ) #define OSD1_ADDR_END (OSD1_ADDR_START+OSD1_MAX_MEM - 1) #define OSD2_ADDR_START U_ALIGN(OSD1_ADDR_END) #define OSD2_ADDR_END (OSD2_ADDR_START+OSD2_MAX_MEM -1) #if defined(CONFIG_FB_OSD2_ENABLE) #define PMEM_START U_ALIGN(OSD2_ADDR_END) #else #define PMEM_START U_ALIGN(OSD1_ADDR_END) #endif #ifdef CONFIG_ANDROID_PMEM #define PMEM_SIZE (64*SZ_1M) #else #define PMEM_SIZE 0 #endif #define PMEM_END (PMEM_START + PMEM_SIZE-1) #if defined(CONFIG_AM_VDEC_H264) #define CODEC_MEM_SIZE U_ALIGN(32*SZ_1M) #else #define CODEC_MEM_SIZE U_ALIGN(16*SZ_1M) #endif #define CODEC_ADDR_START U_ALIGN(PMEM_END) #define CODEC_ADDR_END (CODEC_ADDR_START+CODEC_MEM_SIZE-1) /********VDIN memory configuration ***************/ #define VDIN_ADDR_START U_ALIGN(OSD2_ADDR_END) #define VDIN_ADDR_END (VDIN_ADDR_START +CODEC_MEM_SIZE -1) #define RESERVED_MEM_END (CODEC_ADDR_END) #endif
/* ------------------------------------------------------------------ * Copyright (C) 1998-2009 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. * See the License for the specific language governing permissions * and limitations under the License. * ------------------------------------------------------------------- */ /**************************************************************************************** Portions of this file are derived from the following 3GPP standard: 3GPP TS 26.073 ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec Available from http://www.3gpp.org (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) Permission to distribute, modify and use this file under the standard license terms listed above has been obtained from the copyright holder. ****************************************************************************************/ /* Filename: /audio/gsm_amr/c/include/shr.h ------------------------------------------------------------------------------ REVISION HISTORY Description: Created separate header file for shr function. Description: Changed the function prototype declaration. Updated template. Description: Updated template. Changed the parameter name from "overflow" to "pOverflow" in the function prototype declaration Description: Moved _cplusplus #ifdef after Include section. Who: Date: Description: ------------------------------------------------------------------------------ INCLUDE DESCRIPTION This file contains all the constant definitions and prototype definitions needed by the shr function. ------------------------------------------------------------------------------ */ /*---------------------------------------------------------------------------- ; CONTINUE ONLY IF NOT ALREADY DEFINED ----------------------------------------------------------------------------*/ #ifndef SHR_H #define SHR_H /*---------------------------------------------------------------------------- ; INCLUDES ----------------------------------------------------------------------------*/ #include "basicop_malloc.h" /*--------------------------------------------------------------------------*/ #ifdef __cplusplus extern "C" { #endif /*---------------------------------------------------------------------------- ; MACROS ; Define module specific macros here ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; DEFINES ; Include all pre-processor statements here. ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; EXTERNAL VARIABLES REFERENCES ; Declare variables used in this module but defined elsewhere ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; SIMPLE TYPEDEF'S ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; ENUMERATED TYPEDEF'S ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; STRUCTURES TYPEDEF'S ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; GLOBAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ Word16 shr(Word16 var1, Word16 var2, Flag *pOverflow); /*---------------------------------------------------------------------------- ; END ----------------------------------------------------------------------------*/ #ifdef __cplusplus } #endif #endif /* _SHR_H_ */
/* -*- buffer-read-only: t -*- vi: set ro: */ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* malloc() function that is glibc compatible. Copyright (C) 1997, 1998, 2006, 2007 Free Software Foundation, Inc. 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; either version 3, or (at your option) any later version. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* written by Jim Meyering and Bruno Haible */ #include <config.h> /* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */ #ifdef malloc # define NEED_MALLOC_GNU # undef malloc #endif /* Specification. */ #include <stdlib.h> #include <errno.h> /* Call the system's malloc below. */ #undef malloc /* Allocate an N-byte block of memory from the heap. If N is zero, allocate a 1-byte block. */ void * rpl_malloc (size_t n) { void *result; #ifdef NEED_MALLOC_GNU if (n == 0) n = 1; #endif result = malloc (n); #if !HAVE_MALLOC_POSIX if (result == NULL) errno = ENOMEM; #endif return result; }