text
stringlengths
4
6.14k
#pragma once #include "IFile.h" namespace ParaEngine { class CMemReadFile : public IReadFile { public: CMemReadFile(void); CMemReadFile(const char * filename); CMemReadFile(IReadFile* pFile, DWORD nSize); /* zip buffer * @param buffer: * @param nSize: size in byte of the buffer * @param bDeleteBuffer: true if the zip file will take the ownership of the buffer and will delete it on exit. */ CMemReadFile(byte* buffer, DWORD nSize, bool bDeleteBuffer=true); virtual ~CMemReadFile(void); /// returns how much was read virtual DWORD read(void* buffer, DWORD sizeToRead); /// changes position in file, returns true if successful /// if relativeMovement==true, the pos is changed relative to current pos, /// otherwise from begin of file virtual bool seek(DWORD finalPos, bool relativeMovement = false); /// returns size of file virtual DWORD getSize(){return m_CacheEndPos - m_CacheStartPos;}; /// returns if file is open virtual bool isOpen(){return m_CacheData!=0;}; /// returns where in the file we are. virtual DWORD getPos(){return m_curPos;}; /// returns name of file virtual const char* getFileName(){return "MemReadFile";}; /// delete this virtual void Release(){delete this;}; /** get the buffer at current location*/ byte* getBuffer(); private: DWORD m_CacheStartPos; DWORD m_CacheEndPos; DWORD m_curPos; byte* m_CacheData; bool m_bOwnBuffer; void Unload(); }; }
static void traverse_face (FttCell * cell, gpointer * datum) { FttDirection * d = datum[0]; gint max_depth = *((gint *) datum[1]); FttFaceTraverseFunc func = (FttFaceTraverseFunc) datum[2]; gpointer data = datum[3]; gboolean check = *((gboolean *) datum[4]); gboolean boundary_faces = *((gboolean *) datum[5]); FttCellFace face; face.d = *d; face.cell = cell; face.neighbor = ftt_cell_neighbor (cell, face.d); if (face.neighbor) { if (!check || (face.neighbor->flags & FTT_FLAG_TRAVERSED) == 0) { if (FTT_CELL_IS_LEAF (cell) && !FTT_CELL_IS_LEAF (face.neighbor) && (max_depth < 0 || ftt_cell_level (face.neighbor) < max_depth)) { /* coarse -> fine */ FttCellChildren children; guint i, n; face.d = FTT_OPPOSITE_DIRECTION (face.d); n = ftt_cell_children_direction (face.neighbor, face.d, &children); face.neighbor = face.cell; for (i = 0; i < n; i++) if ((face.cell = children.c[i]) && (!check || (face.cell->flags & FTT_FLAG_TRAVERSED) == 0)) (* func) (&face, data); } else (* func) (&face, data); } } else if (boundary_faces) (* func) (&face, data); } static void traverse_all_faces (FttCell * cell, gpointer * datum) { FttDirection d; datum[0] = &d; for (d = 0; d < FTT_NEIGHBORS; d++) traverse_face (cell, datum); cell->flags |= FTT_FLAG_TRAVERSED; } static void traverse_all_direct_faces (FttCell * cell, gpointer * datum) { FttDirection d; datum[0] = &d; for (d = 0; d < FTT_NEIGHBORS; d += 2) traverse_face (cell, datum); cell->flags |= FTT_FLAG_TRAVERSED; } static void traverse_face_direction (FttCell * cell, gpointer * datum) { traverse_face (cell, datum); cell->flags |= FTT_FLAG_TRAVERSED; } static void traverse_face_component (FttCell * cell, gpointer * datum) { FttComponent * c = datum[0]; FttDirection d; datum[0] = &d; d = 2*(*c); traverse_face (cell, datum); d++; traverse_face (cell, datum); cell->flags |= FTT_FLAG_TRAVERSED; datum[0] = c; } static void reset_flag (FttCell * cell) { cell->flags &= ~FTT_FLAG_TRAVERSED; }
#ifndef OPENANN_TEST_LMA_TEST_CASE_H_ #define OPENANN_TEST_LMA_TEST_CASE_H_ #include <Test/TestCase.h> class LMATestCase : public TestCase { virtual void run(); void quadratic(); void restart(); }; #endif // OPENANN_TEST_LMA_TEST_CASE_H_
/* Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely. */ #include "testnative.h" #ifdef TEST_NATIVE_OS2 #define WIN_CLIENT_CLASS "SDL Test" static void *CreateWindowNative(int w, int h); static void DestroyWindowNative(void *window); NativeWindowFactory OS2WindowFactory = { "DIVE", CreateWindowNative, DestroyWindowNative }; static void *CreateWindowNative(int w, int h) { HWND hwnd; HWND hwndFrame; ULONG ulFrameFlags = FCF_TASKLIST | FCF_DLGBORDER | FCF_TITLEBAR | FCF_SYSMENU | FCF_SHELLPOSITION | FCF_SIZEBORDER | FCF_MINBUTTON | FCF_MAXBUTTON; WinRegisterClass( 0, WIN_CLIENT_CLASS, WinDefWindowProc, CS_SIZEREDRAW | CS_MOVENOTIFY, sizeof(ULONG) ); // We should have minimum 4 bytes. hwndFrame = WinCreateStdWindow( HWND_DESKTOP, 0, &ulFrameFlags, WIN_CLIENT_CLASS, "SDL Test", 0, 0, 1, &hwnd ); if ( hwndFrame == NULLHANDLE ) { return 0; } WinSetWindowPos( hwndFrame, HWND_TOP, 0, 0, w, h, SWP_ZORDER | SWP_ACTIVATE | SWP_SIZE | SWP_SHOW ); return (void *)hwndFrame; // We may returns client or frame window handle // for SDL_CreateWindowFrom(). } static void DestroyWindowNative(void *window) { WinDestroyWindow( (HWND)window ); } #endif /* TEST_NATIVE_OS2 */
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "EUTRA-RRC-Definitions" * found in "36331-c10.asn" * `asn1c -S /usr/local/share/asn1c -fcompound-names -fskeletons-copy -gen-PER` */ #ifndef _N1PUCCH_AN_CS_r10_H_ #define _N1PUCCH_AN_CS_r10_H_ #include <asn_application.h> /* Including external dependencies */ #include <NativeInteger.h> #include <asn_SEQUENCE_OF.h> #include <constr_SEQUENCE_OF.h> #ifdef __cplusplus extern "C" { #endif /* N1PUCCH-AN-CS-r10 */ typedef struct N1PUCCH_AN_CS_r10 { A_SEQUENCE_OF(long) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } N1PUCCH_AN_CS_r10_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_N1PUCCH_AN_CS_r10; #ifdef __cplusplus } #endif #endif /* _N1PUCCH_AN_CS_r10_H_ */ #include <asn_internal.h>
/* Copyright (C) Research In Motion Limited 2010. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SVGAnimatedPropertySynchronizer_h #define SVGAnimatedPropertySynchronizer_h #include "SVGAnimatedPropertyTraits.h" #if ENABLE(SVG) namespace WebCore { class SVGElement; // GetOwnerElementForType implementation template<typename OwnerType, bool isDerivedFromSVGElement> struct GetOwnerElementForType; template<typename OwnerType> struct GetOwnerElementForType<OwnerType, true> : public Noncopyable { static SVGElement* ownerElement(OwnerType* type) { return type; } }; template<typename OwnerType> struct GetOwnerElementForType<OwnerType, false> : public Noncopyable { static SVGElement* ownerElement(OwnerType* type); }; template<typename OwnerType> SVGElement* GetOwnerElementForType<OwnerType, false>::ownerElement(OwnerType* type) { SVGElement* context = type->contextElement(); ASSERT(context); return context; } // IsDerivedFromSVGElement implementation template<typename OwnerType> struct IsDerivedFromSVGElement : public Noncopyable { static const bool value = true; }; class SVGViewSpec; template<> struct IsDerivedFromSVGElement<SVGViewSpec> : public Noncopyable { static const bool value = false; }; // Helper template used for synchronizing SVG <-> XML properties template<bool isDerivedFromSVGElement> struct SVGAnimatedPropertySynchronizer { static void synchronize(SVGElement*, const QualifiedName&, const AtomicString&); }; template<> struct SVGAnimatedPropertySynchronizer<true> { static void synchronize(SVGElement* ownerElement, const QualifiedName& attrName, const AtomicString& value) { NamedNodeMap* namedAttrMap = ownerElement->attributes(false); Attribute* old = namedAttrMap->getAttributeItem(attrName); if (old && value.isNull()) namedAttrMap->removeAttribute(old->name()); else if (!old && !value.isNull()) namedAttrMap->addAttribute(ownerElement->createAttribute(attrName, value)); else if (old && !value.isNull()) old->setValue(value); } }; template<> struct SVGAnimatedPropertySynchronizer<false> { static void synchronize(SVGElement*, const QualifiedName&, const AtomicString&) { // no-op, for types not inheriting from Element, thus nothing to synchronize } }; }; #endif #endif
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms and ** conditions see http://www.qt.io/terms-conditions. For further information ** use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef QMLDESIGNER_ICONCHECKBOXITEMDELEGATE_H #define QMLDESIGNER_ICONCHECKBOXITEMDELEGATE_H #include <QStyledItemDelegate> namespace QmlDesigner { class NavigatorTreeModel; class IconCheckboxItemDelegate : public QStyledItemDelegate { public: explicit IconCheckboxItemDelegate(QObject *parent, QString checkedPixmapURL, QString uncheckedPixmapURL, NavigatorTreeModel *treeModel); QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; private: QPixmap offPixmap; QPixmap onPixmap; NavigatorTreeModel *m_navigatorTreeModel; }; } // namespace QmlDesigner #endif // QMLDESIGNER_ICONCHECKBOXITEMDELEGATE_H
/** @file The header <limits.h> defines several macros that expand to various limits and parameters of the standard integer types. The values given below are constant expressions suitable for use in #if preprocessing directives. Except for CHAR_BIT and MB_LEN_MAX, they have the same type as would an expression that is an object of the corresponding type converted according to the integer promotions. Copyright (c) 2010 - 2012, 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 that accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef _LIMITS_H #define _LIMITS_H #include <sys/EfiCdefs.h> #include <Library/PcdLib.h> /* Get the architecturally defined limits for this compilation unit. */ #include <machine/limits.h> /* Define the values required by the ISO/IEC 9899 Specification. */ /** Maximum number of bytes in a multibyte character, for any supported locale. **/ #define MB_LEN_MAX 4 /* UTF-8 can require up to 4 bytes */ /** Number of bits comprising the smallest object that is not a bit-field (byte). **/ #define CHAR_BIT __CHAR_BIT /** Minimum value for an object of type signed char. **/ #define SCHAR_MIN __SCHAR_MIN /** Maximum value for an object of type signed char. **/ #define SCHAR_MAX __SCHAR_MAX /** Maximum value for an object of type unsigned char. **/ #define UCHAR_MAX __UCHAR_MAX #ifdef __CHAR_UNSIGNED__ /** Maximum value for an object of type char. **/ #define CHAR_MAX UCHAR_MAX /** Minimum value for an object of type char. **/ #define CHAR_MIN 0 #else /** Maximum value for an object of type char. **/ #define CHAR_MAX SCHAR_MAX /** Minimum value for an object of type char. **/ #define CHAR_MIN SCHAR_MIN #endif /** Minimum value for an object of type short int. **/ #define SHRT_MIN __SHRT_MIN /** Maximum value for an object of type short int. **/ #define SHRT_MAX __SHRT_MAX /** Maximum value for an object of type unsigned short int. **/ #define USHRT_MAX __USHRT_MAX /** Minimum value for an object of type int. **/ #define INT_MIN __INT_MIN /** Maximum value for an object of type int. **/ #define INT_MAX __INT_MAX /** Maximum value for an object of type unsigned int. **/ #define UINT_MAX __UINT_MAX /** Minimum value for an object of type long int. **/ #define LONG_MIN __LONG_MIN /** Maximum value for an object of type long int. **/ #define LONG_MAX __LONG_MAX /** Maximum value for an object of type unsigned long int. **/ #define ULONG_MAX __ULONG_MAX /** Minimum value for an object of type long long int. **/ #define LLONG_MIN __LLONG_MIN /** Maximum value for an object of type long long int. **/ #define LLONG_MAX __LLONG_MAX /** Maximum value for an object of type unsigned long long int. **/ #define ULLONG_MAX __ULLONG_MAX /* Object limits used in the Standard Libraries */ #if (PcdGet32(PcdMaximumAsciiStringLength) > 0) /** Maximum length of an arbitrary "narrow-character" string. **/ #define ASCII_STRING_MAX PcdGet32(PcdMaximumAsciiStringLength) #else /** Maximum length of an arbitrary "narrow-character" string. **/ #define ASCII_STRING_MAX 256 #endif #if (PcdGet32(PcdMaximumUnicodeStringLength) > 0) /** Maximum length of an arbitrary "wide-character" string. **/ #define UNICODE_STRING_MAX PcdGet32(PcdMaximumUnicodeStringLength) #else /** Maximum length of an arbitrary "wide-character" string. **/ #define UNICODE_STRING_MAX 512 #endif /* Limits for BSD Compatibility */ #define NL_TEXTMAX 2048 #include <sys/syslimits.h> #endif /* _LIMITS_H */
// // MPAnalyticsTracker.h // // Copyright 2018-2020 Twitter, Inc. // Licensed under the MoPub SDK License Agreement // http://www.mopub.com/legal/sdk-license-agreement/ // #import <Foundation/Foundation.h> @class MPAdConfiguration; @class MPVASTTrackingEvent; @protocol MPAnalyticsTracker <NSObject> - (void)trackImpressionForConfiguration:(MPAdConfiguration *)configuration; - (void)trackClickForConfiguration:(MPAdConfiguration *)configuration; - (void)sendTrackingRequestForURLs:(NSArray<NSURL *> *)URLs; @end @interface MPAnalyticsTracker : NSObject + (MPAnalyticsTracker *)sharedTracker; @end @interface MPAnalyticsTracker (MPAnalyticsTracker) <MPAnalyticsTracker> @end
/* * This file is part of the Soletta (TM) Project * * Copyright (C) 2015 Intel Corporation. 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. */ #pragma once #include <v8.h> v8::Local<v8::Value> ReverseLookupConstant(const char *nameSpace, int value);
/*============================================================================= * parser for CSP instances represented in XML format * * Copyright (c) 2008 Olivier ROUSSEL (olivier.roussel <at> cril.univ-artois.fr) * * 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 _C_AST_h_ #define _C_AST_h_ #include "XMLParser_constants.h" /** * * a simple representation of an Abstract Syntax Tree (AST) for C * */ /* * abtract node (the field type is present in every node of the * tree). All other nodes in the tree "inherit" from this type. * * This is also the representation of a symbolic constant. */ typedef struct { NodeType type; } C_AST; /* * representation of a variable (necessarily a leaf in the tree) */ typedef struct { NodeType type; char *varName; int idVar; } C_AST_VarNode; /* * representation of a constant (boolean or integer -- necessarily a * leaf in the tree) */ typedef struct { NodeType type; int val; } C_AST_CstNode; /* * representation of a function */ typedef struct { NodeType type; int nbarg; C_AST *args[]; } C_AST_FxNode; /* * representation of a list */ typedef struct { NodeType type; int size; /* number of items in the list */ C_AST *items[]; } C_AST_ListNode; /* * entry in a dictionary */ typedef struct { char *key; C_AST *value; } C_AST_DictEntry; /* * representation of a dictionary */ typedef struct { NodeType type; int size; /* number of items in the dictionary */ C_AST_DictEntry items[]; } C_AST_DictNode; #endif
/* Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #pragma once #include <string> #include "kernel/expr.h" namespace lean { /** \brief Declare a new kind of annotation. It must only be invoked at startup time Use helper obect #register_annotation_fn. */ void register_annotation(name const & n); /** \brief Create an annotated expression with tag \c kind based on \c e. \pre \c kind must have been registered using #register_annotation. \remark Annotations have no real semantic meaning, but are useful for guiding pretty printer and/or automation. */ expr mk_annotation(name const & kind, expr const & e, tag g); expr mk_annotation(name const & kind, expr const & e); /** \brief Return true iff \c e was created using #mk_annotation. */ bool is_annotation(expr const & e); /** \brief Return true iff \c e was created using #mk_annotation, and has tag \c kind. */ bool is_annotation(expr const & e, name const & kind); /** \brief Return true iff \c e is of the form (a_1 ... (a_k e') ...) where all a_i's are annotations and one of the is \c kind. \remark is_nested_annotation(e, kind) implies is_annotation(e, kind) */ bool is_nested_annotation(expr const & e, name const & kind); /** \brief Return the annotated expression, \c e must have been created using #mk_annotation. \post get_annotation_arg(mk_annotation(k, e)) == e */ expr const & get_annotation_arg(expr const & e); /** \brief Return the king of the annotated expression, \c e must have been created using #mk_annotation. \post get_annotation_arg(mk_annotation(k, e)) == k */ name const & get_annotation_kind(expr const & e); /** \brief Return the nested annotated expression, \c e must have been created using #mk_annotation. This function is the "transitive" version of #get_annotation_arg. It guarantees that the result does not satisfy the predicate is_annotation. */ expr const & get_nested_annotation_arg(expr const & e); /** \brief Copy annotation from \c from to \c to. */ expr copy_annotations(expr const & from, expr const & to); /** \brief Tag \c e as a 'have'-expression. 'have' is a pre-registered annotation. */ expr mk_have_annotation(expr const & e); /** \brief Tag \c e as a 'show'-expression. 'show' is a pre-registered annotation. */ expr mk_show_annotation(expr const & e); expr mk_checkpoint_annotation(expr const & e); /** \brief Return true iff \c e was created using #mk_have_annotation. */ bool is_have_annotation(expr const & e); /** \brief Return true iff \c e was created using #mk_show_annotation. */ bool is_show_annotation(expr const & e); bool is_checkpoint_annotation(expr const & e); /** \brief Return the serialization 'opcode' for annotation macros. */ std::string const & get_annotation_opcode(); void initialize_annotation(); void finalize_annotation(); }
#include "delta.h" #include "../mem/pool.h" typedef struct delta_t { pony_actor_t* actor; size_t rc; } delta_t; static size_t delta_hash(delta_t* delta) { return ponyint_hash_ptr(delta->actor); } static bool delta_cmp(delta_t* a, delta_t* b) { return a->actor == b->actor; } static void delta_free(delta_t* delta) { POOL_FREE(delta_t, delta); } pony_actor_t* ponyint_delta_actor(delta_t* delta) { return delta->actor; } size_t ponyint_delta_rc(delta_t* delta) { return delta->rc; } DEFINE_HASHMAP(ponyint_deltamap, deltamap_t, delta_t, delta_hash, delta_cmp, delta_free); deltamap_t* ponyint_deltamap_update(deltamap_t* map, pony_actor_t* actor, size_t rc) { size_t index = HASHMAP_UNKNOWN; if(map == NULL) { // allocate a new map with space for at least one element map = (deltamap_t*)POOL_ALLOC(deltamap_t); ponyint_deltamap_init(map, 1); } else { delta_t key; key.actor = actor; delta_t* delta = ponyint_deltamap_get(map, &key, &index); if(delta != NULL) { delta->rc = rc; return map; } } delta_t* delta = (delta_t*)POOL_ALLOC(delta_t); delta->actor = actor; delta->rc = rc; if(index == HASHMAP_UNKNOWN) { // new map ponyint_deltamap_put(map, delta); } else { // didn't find it in the map but index is where we can put the // new one without another search ponyint_deltamap_putindex(map, delta, index); } return map; } void ponyint_deltamap_free(deltamap_t* map) { ponyint_deltamap_destroy(map); POOL_FREE(deltamap_t, map); } #ifdef USE_MEMTRACK size_t ponyint_deltamap_total_mem_size(deltamap_t* map) { return ponyint_deltamap_mem_size(map) + (ponyint_deltamap_size(map) * sizeof(delta_t)); } size_t ponyint_deltamap_total_alloc_size(deltamap_t* map) { return ponyint_deltamap_alloc_size(map) + (ponyint_deltamap_size(map) * POOL_ALLOC_SIZE(delta_t)); } #endif
#include <../Source/cs_leaf.c>
/***************************************************************************** Copyright (c) 2014, Intel Corp. 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 Intel Corporation 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. ****************************************************************************** * Contents: Native high-level C interface to LAPACK function ctpqrt2 * Author: Intel Corporation * Generated November 2015 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_ctpqrt2( int matrix_layout, lapack_int m, lapack_int n, lapack_int l, lapack_complex_float* a, lapack_int lda, lapack_complex_float* b, lapack_int ldb, lapack_complex_float* t, lapack_int ldt ) { if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_ctpqrt2", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) { return -4; } if( LAPACKE_cge_nancheck( matrix_layout, m, n, b, ldb ) ) { return -6; } #endif return LAPACKE_ctpqrt2_work( matrix_layout, m, n, l, a, lda, b, ldb, t, ldt ); }
/* * Copyright (C) 2010 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 BaseTemporalInputType_h #define BaseTemporalInputType_h #include "core/html/forms/InputType.h" #include "core/html/shadow/DateTimeEditElement.h" #include "platform/DateComponents.h" namespace blink { class ExceptionState; // A super class of date, datetime, datetime-local, month, time, and week types. // TODO(tkent): A single temporal input type creates two InputTypeView instances // unnecessarily. One is ChooserOnlyTemporalInputTypeView or // MultipleFieldsTemporalInputType, and another is BaseTemporalInputType, which // inherits from InputTypeView through InputType. The latter is not used. class BaseTemporalInputType : public InputType { public: String visibleValue() const override; String sanitizeValue(const String&) const override; // Parses the specified string for this InputType, and returns true if it // is successfully parsed. An instance pointed by the DateComponents* // parameter will have parsed values and be modified even if the parsing // fails. The DateComponents* parameter may be 0. bool parseToDateComponents(const String&, DateComponents*) const; virtual bool setMillisecondToDateComponents(double, DateComponents*) const = 0; // Provide some helpers for MultipleFieldsTemporalInputTypeView. virtual String formatDateTimeFieldsState(const DateTimeFieldsState&) const = 0; virtual void setupLayoutParameters(DateTimeEditElement::LayoutParameters&, const DateComponents&) const = 0; virtual bool isValidFormat(bool hasYear, bool hasMonth, bool hasWeek, bool hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) const = 0; protected: BaseTemporalInputType(HTMLInputElement& element) : InputType(element) { } Decimal parseToNumber(const String&, const Decimal&) const override; String serialize(const Decimal&) const override; String serializeWithComponents(const DateComponents&) const; bool shouldHaveSecondField(const DateComponents&) const; private: virtual bool parseToDateComponentsInternal(const String&, DateComponents*) const = 0; String badInputText() const override; InputTypeView* createView() override; double valueAsDate() const override; void setValueAsDate(double, ExceptionState&) const override; double valueAsDouble() const override; void setValueAsDouble(double, TextFieldEventBehavior, ExceptionState&) const override; bool typeMismatchFor(const String&) const override; bool typeMismatch() const override; bool valueMissing(const String&) const override; String rangeOverflowText(const Decimal& maximum) const override; String rangeUnderflowText(const Decimal& minimum) const override; Decimal defaultValueForStepUp() const override; bool isSteppable() const override; virtual String serializeWithMilliseconds(double) const; String localizeValue(const String&) const override; bool supportsReadOnly() const override; bool shouldRespectListAttribute() override; bool shouldShowFocusRingOnMouseFocus() const override; }; } // namespace blink #endif // BaseTemporalInputType_h
// Copyright 2020 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 COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_ANDROID_ONBOARDING_FETCHER_FACTORY_H_ #define COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_ANDROID_ONBOARDING_FETCHER_FACTORY_H_ #include "components/keyed_service/content/browser_context_keyed_service_factory.h" namespace content { class BrowserContext; } // namespace content namespace autofill_assistant { class AutofillAssistantOnboardingFetcher; } // namespace autofill_assistant // Creates instances of |AutofillAssistantOnboardingFetcher| per // |BrowserContext|. class OnboardingFetcherFactory : public BrowserContextKeyedServiceFactory { public: OnboardingFetcherFactory(); ~OnboardingFetcherFactory() override; static OnboardingFetcherFactory* GetInstance(); static autofill_assistant::AutofillAssistantOnboardingFetcher* GetForBrowserContext(content::BrowserContext* browser_context); private: KeyedService* BuildServiceInstanceFor( content::BrowserContext* browser_context) const override; }; #endif // COMPONENTS_AUTOFILL_ASSISTANT_BROWSER_ANDROID_ONBOARDING_FETCHER_FACTORY_H_
// 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 COMPONENTS_MUS_WS_TEST_SERVER_WINDOW_DELEGATE_H_ #define COMPONENTS_MUS_WS_TEST_SERVER_WINDOW_DELEGATE_H_ #include "base/macros.h" #include "components/mus/ws/server_window_delegate.h" namespace mus { namespace ws { struct WindowId; class TestServerWindowDelegate : public ServerWindowDelegate { public: TestServerWindowDelegate(); ~TestServerWindowDelegate() override; void set_root_window(const ServerWindow* window) { root_window_ = window; } private: // ServerWindowDelegate: mus::SurfacesState* GetSurfacesState() override; void OnScheduleWindowPaint(ServerWindow* window) override; const ServerWindow* GetRootWindow(const ServerWindow* window) const override; void ScheduleSurfaceDestruction(ServerWindow* window) override; ServerWindow* FindWindowForSurface( const ServerWindow* ancestor, mojom::SurfaceType surface_type, const ClientWindowId& client_window_id) override; const ServerWindow* root_window_; scoped_refptr<mus::SurfacesState> surfaces_state_; DISALLOW_COPY_AND_ASSIGN(TestServerWindowDelegate); }; } // namespace ws } // namespace mus #endif // COMPONENTS_MUS_WS_TEST_SERVER_WINDOW_DELEGATE_H_
/******************************************************* * Copyright (c) 2014, ArrayFire * All rights reserved. * * This file is distributed under 3-clause BSD license. * The complete license agreement can be obtained at: * http://arrayfire.com/licenses/BSD-3-Clause ********************************************************/ #ifndef MAGMA_CPU_LAPACK #define MAGMA_CPU_LAPACK #include "magma_types.h" #define LAPACKE_sunmqr_work(...) LAPACKE_sormqr_work(__VA_ARGS__) #define LAPACKE_dunmqr_work(...) LAPACKE_dormqr_work(__VA_ARGS__) #define LAPACKE_sungqr_work(...) LAPACKE_sorgqr_work(__VA_ARGS__) #define LAPACKE_dungqr_work(...) LAPACKE_dorgqr_work(__VA_ARGS__) #define lapack_complex_float magmaFloatComplex #define lapack_complex_double magmaDoubleComplex #define LAPACK_PREFIX LAPACKE_ #define ORDER_TYPE int #define LAPACK_NAME(fn) LAPACKE_##fn #if defined(__APPLE__) #define LAPACK_COL_MAJOR 102 #include "../../lapacke.hpp" #else #ifdef USE_MKL #include<mkl_lapacke.h> #else // NETLIB LAPACKE #include<lapacke.h> #endif // MKL/NETLIB #endif //APPLE #define CPU_LAPACK_FUNC_DEF(NAME) \ template<typename T> \ struct NAME##_func; #define CPU_LAPACK_FUNC(NAME, TYPE, X) \ template<> \ struct NAME##_func<TYPE> \ { \ template<typename... Args> \ int \ operator() (Args... args) \ { return LAPACK_NAME(X##NAME)(args...); } \ }; CPU_LAPACK_FUNC_DEF(getrf) CPU_LAPACK_FUNC(getrf, float, s) CPU_LAPACK_FUNC(getrf, double, d) CPU_LAPACK_FUNC(getrf, magmaFloatComplex, c) CPU_LAPACK_FUNC(getrf, magmaDoubleComplex, z) CPU_LAPACK_FUNC_DEF(potrf) CPU_LAPACK_FUNC(potrf, float, s) CPU_LAPACK_FUNC(potrf, double, d) CPU_LAPACK_FUNC(potrf, magmaFloatComplex, c) CPU_LAPACK_FUNC(potrf, magmaDoubleComplex, z) CPU_LAPACK_FUNC_DEF(trtri) CPU_LAPACK_FUNC(trtri, float, s) CPU_LAPACK_FUNC(trtri, double, d) CPU_LAPACK_FUNC(trtri, magmaFloatComplex, c) CPU_LAPACK_FUNC(trtri, magmaDoubleComplex, z) CPU_LAPACK_FUNC_DEF(geqrf_work) CPU_LAPACK_FUNC(geqrf_work, float, s) CPU_LAPACK_FUNC(geqrf_work, double, d) CPU_LAPACK_FUNC(geqrf_work, magmaFloatComplex, c) CPU_LAPACK_FUNC(geqrf_work, magmaDoubleComplex, z) CPU_LAPACK_FUNC_DEF(larft) CPU_LAPACK_FUNC(larft, float, s) CPU_LAPACK_FUNC(larft, double, d) CPU_LAPACK_FUNC(larft, magmaFloatComplex, c) CPU_LAPACK_FUNC(larft, magmaDoubleComplex, z) CPU_LAPACK_FUNC_DEF(unmqr_work) CPU_LAPACK_FUNC(unmqr_work, float, s) CPU_LAPACK_FUNC(unmqr_work, double, d) CPU_LAPACK_FUNC(unmqr_work, magmaFloatComplex, c) CPU_LAPACK_FUNC(unmqr_work, magmaDoubleComplex, z) CPU_LAPACK_FUNC_DEF(ungqr_work) CPU_LAPACK_FUNC(ungqr_work, float, s) CPU_LAPACK_FUNC(ungqr_work, double, d) CPU_LAPACK_FUNC(ungqr_work, magmaFloatComplex, c) CPU_LAPACK_FUNC(ungqr_work, magmaDoubleComplex, z) CPU_LAPACK_FUNC_DEF(laswp) CPU_LAPACK_FUNC(laswp, float, s) CPU_LAPACK_FUNC(laswp, double, d) CPU_LAPACK_FUNC(laswp, magmaFloatComplex, c) CPU_LAPACK_FUNC(laswp, magmaDoubleComplex, z) #endif
// Copyright 2021 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_ANDROID_WEBID_ACCOUNT_SELECTION_VIEW_ANDROID_H_ #define CHROME_BROWSER_UI_ANDROID_WEBID_ACCOUNT_SELECTION_VIEW_ANDROID_H_ #include <string> #include "base/android/scoped_java_ref.h" #include "base/callback.h" #include "chrome/browser/ui/webid/account_selection_view.h" // This class provides an implementation of the AccountSelectionView interface // and communicates via JNI with its AccountSelectionBridge Java counterpart. class AccountSelectionViewAndroid : public AccountSelectionView { public: explicit AccountSelectionViewAndroid( AccountSelectionView::Delegate* delegate); ~AccountSelectionViewAndroid() override; // AccountSelectionView: void Show(const std::string& rp_etld_plus_one, const std::string& idp_etld_plus_one, base::span<const Account> accounts, const content::IdentityProviderMetadata& idp_metadata, const content::ClientIdData& client_data, Account::SignInMode sign_in_mode) override; void OnAccountSelected( JNIEnv* env, const base::android::JavaParamRef<jobjectArray>& account_string_fields, const base::android::JavaParamRef<jobject>& account_picture_url, bool is_sign_in); void OnDismiss(JNIEnv* env); void OnAutoSignInCancelled(JNIEnv* env); private: // Returns either true if the java counterpart of this bridge is initialized // successfully or false if the creation failed. This method will recreate the // java object whenever Show() is called. bool RecreateJavaObject(); base::android::ScopedJavaGlobalRef<jobject> java_object_internal_; }; #endif // CHROME_BROWSER_UI_ANDROID_WEBID_ACCOUNT_SELECTION_VIEW_ANDROID_H_
// Copyright 2013 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 CC_LAYERS_SOLID_COLOR_SCROLLBAR_LAYER_H_ #define CC_LAYERS_SOLID_COLOR_SCROLLBAR_LAYER_H_ #include <memory> #include "cc/cc_export.h" #include "cc/layers/layer.h" #include "cc/layers/scrollbar_layer_base.h" namespace cc { // A solid color scrollbar that can be fully drawn on the impl thread. In // practice, this is used for overlay scrollbars on Android. class CC_EXPORT SolidColorScrollbarLayer : public ScrollbarLayerBase { public: std::unique_ptr<LayerImpl> CreateLayerImpl( LayerTreeImpl* tree_impl) const override; static scoped_refptr<SolidColorScrollbarLayer> CreateOrReuse( scoped_refptr<Scrollbar>, SolidColorScrollbarLayer* existing_layer); static scoped_refptr<SolidColorScrollbarLayer> Create( ScrollbarOrientation orientation, int thumb_thickness, int track_start, bool is_left_side_vertical_scrollbar); SolidColorScrollbarLayer(const SolidColorScrollbarLayer&) = delete; SolidColorScrollbarLayer& operator=(const SolidColorScrollbarLayer&) = delete; // Layer overrides. bool OpacityCanAnimateOnImplThread() const override; void SetOpacity(float opacity) override; void SetNeedsDisplayRect(const gfx::Rect& rect) override; bool HitTestable() const override; int thumb_thickness() const { return thumb_thickness_; } int track_start() const { return track_start_; } ScrollbarLayerType GetScrollbarLayerType() const override; private: SolidColorScrollbarLayer(ScrollbarOrientation orientation, int thumb_thickness, int track_start, bool is_left_side_vertical_scrollbar); ~SolidColorScrollbarLayer() override; int thumb_thickness_; int track_start_; }; } // namespace cc #endif // CC_LAYERS_SOLID_COLOR_SCROLLBAR_LAYER_H_
/* * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com> * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> * Copyright (C) 2013 Google Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef SourceGraphic_h #define SourceGraphic_h #include "platform/geometry/IntRect.h" #include "platform/graphics/filters/FilterEffect.h" namespace blink { class PLATFORM_EXPORT SourceGraphic final : public FilterEffect { public: static SourceGraphic* create(Filter*); ~SourceGraphic() override; FloatRect determineAbsolutePaintRect(const FloatRect& requestedRect) override; FilterEffectType getFilterEffectType() const override { return FilterEffectTypeSourceInput; } TextStream& externalRepresentation(TextStream&, int indention) const override; void setSourceRect(const IntRect&); private: explicit SourceGraphic(Filter*); IntRect m_sourceRect; }; } //namespace blink #endif // SourceGraphic_h
/* * Part of esp-open-rtos * Copyright (C) 2016 Oto Petrik <oto.petrik@gmail.com> * BSD Licensed as described in the file LICENSE */ #ifndef _STDOUT_REDIRECT_H_ #define _STDOUT_REDIRECT_H_ #include <sys/reent.h> #ifdef __cplusplus extern "C" { #endif typedef long _WriteFunction(struct _reent *r, int fd, const char *ptr, int len ); /** Set implementation of write syscall for stdout. * * Use this function to redirect stdout for further processing (save to file, send over network). * It may be good idea to save result of `get_write_stdout()` beforehand and call * it at the end of the supplied function. * * NOTE: use NULL to reset to default implementation. * * @param[in] f New code to handle stdout output * */ void set_write_stdout(_WriteFunction *f); /** Get current implementation of write syscall for stdout. * * Save returned value before calling `set_write_stdout`, it allows for chaining * multiple independent handlers. * * @returns current stdout handler */ _WriteFunction *get_write_stdout(); #ifdef __cplusplus } #endif #endif /* _STDOUT_REDIRECT_H_ */
#include <assert.h> #include <stdio.h> #include <string.h> #include "houdini.h" #include "html_unescape.h" #define UNESCAPE_GROW_FACTOR(x) (x) /* unescaping shouldn't grow our buffer */ static inline void bufput_utf8(struct buf *ob, int c) { unsigned char unichar[4]; if (c < 0x80) { bufputc(ob, c); } else if (c < 0x800) { unichar[0] = 192 + (c / 64); unichar[1] = 128 + (c % 64); bufput(ob, unichar, 2); } else if (c - 0xd800u < 0x800) { bufputc(ob, '?'); } else if (c < 0x10000) { unichar[0] = 224 + (c / 4096); unichar[1] = 128 + (c / 64) % 64; unichar[2] = 128 + (c % 64); bufput(ob, unichar, 3); } else if (c < 0x110000) { unichar[0] = 240 + (c / 262144); unichar[1] = 128 + (c / 4096) % 64; unichar[2] = 128 + (c / 64) % 64; unichar[3] = 128 + (c % 64); bufput(ob, unichar, 4); } else { bufputc(ob, '?'); } } static size_t unescape_ent(struct buf *ob, const uint8_t *src, size_t size) { size_t i = 0; if (size > 3 && src[0] == '#') { int codepoint = 0; if (_isdigit(src[1])) { for (i = 1; i < size && _isdigit(src[i]); ++i) codepoint = (codepoint * 10) + (src[i] - '0'); } else if (src[1] == 'x' || src[1] == 'X') { for (i = 2; i < size && _isxdigit(src[i]); ++i) codepoint = (codepoint * 16) + ((src[i] | 32) % 39 - 9); } if (i < size && src[i] == ';') { bufput_utf8(ob, codepoint); return i + 1; } } else { if (size > MAX_WORD_LENGTH) size = MAX_WORD_LENGTH; for (i = MIN_WORD_LENGTH; i < size; ++i) { if (src[i] == ' ') break; if (src[i] == ';') { const struct html_ent *entity = find_entity((char *)src, i); if (entity != NULL) { bufput(ob, entity->utf8, entity->utf8_len); return i + 1; } break; } } } bufputc(ob, '&'); return 0; } void houdini_unescape_html(struct buf *ob, const uint8_t *src, size_t size) { size_t i = 0, org; bufgrow(ob, UNESCAPE_GROW_FACTOR(size)); while (i < size) { org = i; while (i < size && src[i] != '&') i++; if (i > org) bufput(ob, src + org, i - org); /* escaping */ if (i >= size) break; i++; i += unescape_ent(ob, src + i, size - i); } }
#define CONFIG_FEATURE_SYSLOGD_CFG 1
/* SESC: Super ESCalar simulator Copyright (C) 2005 University California, Santa Cruz. Contributed by Saangetha Keertika Jose Renau This file is part of SESC. SESC 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. SESC 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 SESC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef QEMU_SESC_READER_H #define QEMU_SESC_READER_H #include "ThreadContext.h" #include "minidecoder.h" #include "TraceEntry.h" #include "TraceReader.h" #include "QemuSescTrace.h" class QemuSescReader : public TraceReader { private: FILE* trace; uint32_t PC; bool tracEof; void readPC(); void readInst(); uint32_t getCurrentPC() { return PC; } void advancePC(); QemuSescTrace *qst; public: QemuSescTrace *currentInst() { return qst; } QemuSescReader(); void openTrace(const char* basename); void closeTrace(); void fillTraceEntry(TraceEntry *te, int32_t id); }; #endif
/* Copyright 2009, 2010, 2011 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/>. Contributed by Jan Kratochvil <jan.kratochvil@redhat.com>. */ void libsym (void) { } #ifdef SYMB void libsymb (void) { } #endif
/* * Utility routines. * * Copyright (C) 2017 Denys Vlasenko * * Licensed under GPLv2, see file LICENSE in this source tree. */ //kbuild:lib-y += bb_getgroups.o #include "libbb.h" gid_t* FAST_FUNC bb_getgroups(int *ngroups, gid_t *group_array) { int n = ngroups ? *ngroups : 0; /* getgroups may be a bit expensive, try to use it only once */ if (n < 32) n = 32; for (;;) { // FIXME: ash tries so hard to not die on OOM (when we are called from test), // and we spoil it with just one xrealloc here group_array = xrealloc(group_array, (n+1) * sizeof(group_array[0])); n = getgroups(n, group_array); /* * If buffer is too small, kernel does not return new_n > n. * It returns -1 and EINVAL: */ if (n >= 0) { /* Terminator for bb_getgroups(NULL, NULL) usage */ group_array[n] = (gid_t) -1; break; } if (errno == EINVAL) { /* too small? */ /* This is the way to ask kernel how big the array is */ n = getgroups(0, group_array); continue; } /* Some other error (should never happen on Linux) */ bb_simple_perror_msg_and_die("getgroups"); } if (ngroups) *ngroups = n; return group_array; }
/* This testcase is part of GDB, the GNU debugger. Copyright 2010, 2011 Free Software Foundation, Inc. Contributed by Pierre Muller. 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/>. Test for Solaris specific watchpoint problem. */ struct rec { int x; double y; int z; }; static struct rec myrec; int main () { myrec.x = 5; myrec.y = 3.4; myrec.z = 56; myrec.x = 78; return myrec.x; }
/* * jabberd - Jabber Open Source Server * Copyright (c) 2002-2004 Jeremie Miller, Thomas Muldowney, * Ryan Eatmon, Robert Norris * * 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, MA02111-1307USA */ /** @file util/jid.h * @brief Jabber identifiers * @author Robert Norris * $Date: 2004/05/01 00:51:10 $ * $Revision: 1.1 $ * * JID manipulation. Validity is checked via stringprep, using * the "nodeprep", "nameprep" and "resourceprep" profiles (see xmpp-core * section 3). * * The application should fill out node, domain and resource directly, then * call jid_expand(), or set the dirty flag. */ #ifndef INCL_UTIL_JID_H #define INCL_UTIL_JID_H 1 /** these sizings come from xmpp-core */ #define MAXLEN_JID_COMP 1023 /* XMPP (RFC3920) 3.1 */ #define MAXLEN_JID 3071 /* nodename (1023) + '@' + domain (1023) + '/' + resource (1023) = 3071 */ typedef struct jid_st { /* basic components of the jid */ char *node; char *domain; char *resource; /* Points to jid broken with \0s into componets. node/domain/resource point * into this string (or to statically allocated empty string, if they are * empty) */ char *jid_data; /* Valid only when jid_data != NULL. When = 0, jid_data is statically * allocated. Otherwise it tells length of the allocated data. Used to * implement jid_dup() */ size_t jid_data_len; /* the "user" part of the jid (sans resource) */ char *_user; /* the complete jid */ char *_full; /* application should set to 1 if user/full need regenerating */ int dirty; /* for lists of jids */ struct jid_st *next; } *jid_t; typedef enum { jid_NODE = 1, jid_DOMAIN = 2, jid_RESOURCE = 3 } jid_part_t; /** JID static buffer **/ typedef char jid_static_buf[3*1025]; /** make a new jid, and call jid_reset() to populate it */ JABBERD2_API jid_t jid_new(const char *id, int len); /** Make jid to use static buffer (jid data won't be allocated dynamically, but * given buffer will be always used. */ JABBERD2_API void jid_static(jid_t jid, jid_static_buf *buf); /** clear and populate the jid with the given id. if id == NULL, just clears the jid to 0 */ JABBERD2_API jid_t jid_reset(jid_t jid, const char *id, int len); JABBERD2_API jid_t jid_reset_components(jid_t jid, const char *node, const char *domain, const char *resource); /** free the jid */ JABBERD2_API void jid_free(jid_t jid); /** do string preparation on a jid */ JABBERD2_API int jid_prep(jid_t jid); /** fill jid's resource with a random string **/ JABBERD2_API void jid_random_part(jid_t jid, jid_part_t part); /** expands user and full if the dirty flag is set */ JABBERD2_API void jid_expand(jid_t jid); /** return the user or full jid. these call jid_expand to make sure the user and * full jid are up to date */ JABBERD2_API const char *jid_user(jid_t jid); JABBERD2_API const char *jid_full(jid_t jid); /** compare two user or full jids. these call jid_expand, then strcmp. returns * 0 if they're the same, < 0 if a < b, > 0 if a > b */ JABBERD2_API int jid_compare_user(jid_t a, jid_t b); JABBERD2_API int jid_compare_full(jid_t a, jid_t b); /** duplicate a jid */ JABBERD2_API jid_t jid_dup(jid_t jid); /** list helpers */ /** see if a jid is present in a list */ JABBERD2_API int jid_search(jid_t list, jid_t jid); /** remove a jid from a list, and return the new list */ JABBERD2_API jid_t jid_zap(jid_t list, jid_t jid); /** insert of a copy of jid into list, avoiding dups */ JABBERD2_API jid_t jid_append(jid_t list, jid_t jid); #endif
/* coverhd.h * * This include file has defines to represent the overhead associated * with calling a particular directive from C. These are used in the * Timing Test Suite to ignore the overhead required to pass arguments * to directives. On some CPUs and/or target boards, this overhead * is significant and makes it difficult to distinguish internal * RTEMS execution time from that used to call the directive. * This file should be updated after running the C overhead timing * test. Once this update has been performed, the RTEMS Time Test * Suite should be rebuilt to account for these overhead times in the * timing results. * * NOTE: If these are all zero, then the times reported include all * all calling overhead including passing of arguments. * * * These are the figures tmoverhd.exe reported with gcc-2.95.1 -O4 * on a Hitachi SH7045F Evaluation Board with SH7045F at 29 MHz * * These results are assumed to be applicable to most SH7045/29MHz boards * * Author: John M.Mills (jmills@tga.com) * * COPYRIGHT (c) 1999. TGA Technologies, Inc., Norcross, GA, USA * * 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. * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * * This file may be copied and distributed in accordance * the above-referenced license. It is provided for critique and * developmental purposes without any warranty nor representation * by the authors or by TGA Technologies. */ #ifndef __COVERHD_h #define __COVERHD_h #ifdef __cplusplus extern "C" { #endif #define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 1 #define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 1 #define CALLING_OVERHEAD_TASK_CREATE 2 #define CALLING_OVERHEAD_TASK_IDENT 1 #define CALLING_OVERHEAD_TASK_START 1 #define CALLING_OVERHEAD_TASK_RESTART 1 #define CALLING_OVERHEAD_TASK_DELETE 1 #define CALLING_OVERHEAD_TASK_SUSPEND 1 #define CALLING_OVERHEAD_TASK_RESUME 1 #define CALLING_OVERHEAD_TASK_SET_PRIORITY 1 #define CALLING_OVERHEAD_TASK_MODE 1 #define CALLING_OVERHEAD_TASK_GET_NOTE 1 #define CALLING_OVERHEAD_TASK_SET_NOTE 1 #define CALLING_OVERHEAD_TASK_WAKE_WHEN 2 #define CALLING_OVERHEAD_TASK_WAKE_AFTER 1 #define CALLING_OVERHEAD_INTERRUPT_CATCH 1 #define CALLING_OVERHEAD_CLOCK_GET 3 #define CALLING_OVERHEAD_CLOCK_SET 2 #define CALLING_OVERHEAD_CLOCK_TICK 1 #define CALLING_OVERHEAD_TIMER_CREATE 1 #define CALLING_OVERHEAD_TIMER_IDENT 1 #define CALLING_OVERHEAD_TIMER_DELETE 1 #define CALLING_OVERHEAD_TIMER_FIRE_AFTER 1 #define CALLING_OVERHEAD_TIMER_FIRE_WHEN 3 #define CALLING_OVERHEAD_TIMER_RESET 1 #define CALLING_OVERHEAD_TIMER_CANCEL 1 #define CALLING_OVERHEAD_SEMAPHORE_CREATE 1 #define CALLING_OVERHEAD_SEMAPHORE_IDENT 1 #define CALLING_OVERHEAD_SEMAPHORE_DELETE 1 #define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 1 #define CALLING_OVERHEAD_SEMAPHORE_RELEASE 1 #define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 1 #define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 1 #define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 1 #define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 1 #define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 1 #define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 1 #define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 1 #define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 1 #define CALLING_OVERHEAD_EVENT_SEND 1 #define CALLING_OVERHEAD_EVENT_RECEIVE 1 #define CALLING_OVERHEAD_SIGNAL_CATCH 1 #define CALLING_OVERHEAD_SIGNAL_SEND 1 #define CALLING_OVERHEAD_PARTITION_CREATE 2 #define CALLING_OVERHEAD_PARTITION_IDENT 1 #define CALLING_OVERHEAD_PARTITION_DELETE 1 #define CALLING_OVERHEAD_PARTITION_GET_BUFFER 1 #define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 1 #define CALLING_OVERHEAD_REGION_CREATE 2 #define CALLING_OVERHEAD_REGION_IDENT 1 #define CALLING_OVERHEAD_REGION_DELETE 1 #define CALLING_OVERHEAD_REGION_GET_SEGMENT 2 #define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 1 #define CALLING_OVERHEAD_PORT_CREATE 2 #define CALLING_OVERHEAD_PORT_IDENT 1 #define CALLING_OVERHEAD_PORT_DELETE 1 #define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 1 #define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 1 #define CALLING_OVERHEAD_IO_INITIALIZE 1 #define CALLING_OVERHEAD_IO_OPEN 1 #define CALLING_OVERHEAD_IO_CLOSE 1 #define CALLING_OVERHEAD_IO_READ 1 #define CALLING_OVERHEAD_IO_WRITE 1 #define CALLING_OVERHEAD_IO_CONTROL 1 #define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 1 #define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 1 #define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 1 #define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 1 #define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 1 #define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 1 #define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 1 #ifdef __cplusplus } #endif #endif
/* * bw_tcp.c - simple TCP bandwidth test * * Three programs in one - * server usage: bw_tcp -s * client usage: bw_tcp [-m <message size>] [-M <total bytes>] [-P <parallelism>] [-W <warmup>] [-N <repetitions>] hostname * shutdown: bw_tcp -hostname * * Copyright (c) 2000 Carl Staelin. * Copyright (c) 1994 Larry McVoy. Distributed under the FSF GPL with * additional restriction that results may published only if * (1) the benchmark is unmodified, and * (2) the version in the sccsid below is included in the report. * Support for this development by Sun Microsystems is gratefully acknowledged. */ char *id = "$Id$\n"; #include "bench.h" typedef struct _state { int sock; uint64 move; size_t msize; char *server; int fd; char *buf; } state_t; void server_main(); void client_main(int parallel, state_t *state); void source(int data); void initialize(iter_t iterations, void* cookie); void loop_transfer(iter_t iterations, void *cookie); void cleanup(iter_t iterations, void* cookie); int main(int ac, char **av) { int parallel = 1; int warmup = LONGER; int repetitions = -1; int shutdown = 0; state_t state; char *usage = "-s\n OR [-m <message size>] [-M <bytes to move>] [-P <parallelism>] [-W <warmup>] [-N <repetitions>] server\n OR -S serverhost\n"; int c; state.msize = 0; state.move = 0; /* Rest is client argument processing */ while (( c = getopt(ac, av, "sS:m:M:P:W:N:")) != EOF) { switch(c) { case 's': /* Server */ if (fork() == 0) { server_main(); } exit(0); break; case 'S': /* shutdown serverhost */ { int conn; conn = tcp_connect(optarg, TCP_DATA, SOCKOPT_NONE); write(conn, "0", 1); exit(0); } case 'm': state.msize = bytes(optarg); break; case 'M': state.move = bytes(optarg); break; case 'P': parallel = atoi(optarg); if (parallel <= 0) lmbench_usage(ac, av, usage); break; case 'W': warmup = atoi(optarg); break; case 'N': repetitions = atoi(optarg); break; default: lmbench_usage(ac, av, usage); break; } } if (optind < ac - 2 || optind >= ac) { lmbench_usage(ac, av, usage); } state.server = av[optind++]; if (state.msize == 0 && state.move == 0) { state.msize = state.move = XFERSIZE; } else if (state.msize == 0) { state.msize = state.move; } else if (state.move == 0) { state.move = state.msize; } /* make the number of bytes to move a multiple of the message size */ if (state.move % state.msize) { state.move += state.msize - state.move % state.msize; } /* * Default is to warmup the connection for seven seconds, * then measure performance over each timing interval. * This minimizes the effect of opening and initializing TCP * connections. */ benchmp(initialize, loop_transfer, cleanup, 0, parallel, warmup, repetitions, &state); if (gettime() > 0) { fprintf(stderr, "%.6f ", state.msize / (1000. * 1000.)); mb(state.move * get_n() * parallel); } return(0); } void initialize(iter_t iterations, void *cookie) { char buf[100]; state_t *state = (state_t *) cookie; if (iterations) return; state->buf = valloc(state->msize); if (!state->buf) { perror("valloc"); exit(1); } touch(state->buf, state->msize); state->sock = tcp_connect(state->server, TCP_DATA, SOCKOPT_READ|SOCKOPT_WRITE|SOCKOPT_REUSE); if (state->sock < 0) { perror("socket connection"); exit(1); } sprintf(buf, "%lu", (unsigned long)state->msize); if (write(state->sock, buf, strlen(buf) + 1) != strlen(buf) + 1) { perror("control write"); exit(1); } } void loop_transfer(iter_t iterations, void *cookie) { int c; uint64 todo; state_t *state = (state_t *) cookie; while (iterations-- > 0) { for (todo = state->move; todo > 0; todo -= c) { if ((c = read(state->sock, state->buf, state->msize)) <= 0) { exit(1); } if (c > todo) c = todo; } } } void cleanup(iter_t iterations, void* cookie) { state_t *state = (state_t *) cookie; if (iterations) return; /* close connection */ (void)close(state->sock); } void server_main() { int data, newdata; GO_AWAY; data = tcp_server(TCP_DATA, SOCKOPT_WRITE|SOCKOPT_REUSE); if (data < 0) { perror("server socket creation"); exit(1); } signal(SIGCHLD, sigchld_wait_handler); for ( ;; ) { newdata = tcp_accept(data, SOCKOPT_WRITE); switch (fork()) { case -1: perror("fork"); break; case 0: source(newdata); exit(0); default: close(newdata); break; } } } /* * Read the message size. Keep transferring * data in message-size sized packets until * the socket goes away. */ void source(int data) { size_t m; unsigned long nbytes; char *buf, scratch[100]; /* * read the message size */ bzero(scratch, 100); if (read(data, scratch, 100) <= 0) { perror("control nbytes"); exit(7); } sscanf(scratch, "%lu", &nbytes); m = nbytes; /* * A hack to allow turning off the absorb daemon. */ if (m == 0) { tcp_done(TCP_DATA); kill(getppid(), SIGTERM); exit(0); } buf = valloc(m); if (!buf) { perror("valloc"); exit(1); } bzero(buf, m); /* * Keep sending messages until the connection is closed */ while (write(data, buf, m) == m) { #ifdef TOUCH touch(buf, m); #endif } free(buf); }
/* * watchdog.c - driver for i.mx on-chip watchdog * * Licensed under the GPL-2 or later. */ #include <common.h> #include <asm/io.h> #include <watchdog.h> #include <asm/arch/imx-regs.h> #include <fsl_wdog.h> #ifdef CONFIG_IMX_WATCHDOG void hw_watchdog_reset(void) { struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; writew(0x5555, &wdog->wsr); writew(0xaaaa, &wdog->wsr); } void hw_watchdog_init(void) { struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; u16 timeout; /* * The timer watchdog can be set between * 0.5 and 128 Seconds. If not defined * in configuration file, sets 128 Seconds */ #ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS #define CONFIG_WATCHDOG_TIMEOUT_MSECS 128000 #endif timeout = (CONFIG_WATCHDOG_TIMEOUT_MSECS / 500) - 1; writew(WCR_WDZST | WCR_WDBG | WCR_WDE | WCR_WDT | WCR_SRS | SET_WCR_WT(timeout), &wdog->wcr); hw_watchdog_reset(); } #endif void reset_cpu(ulong addr) { struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR; clrsetbits_le16(&wdog->wcr, WCR_WT_MSK, WCR_WDE); writew(0x5555, &wdog->wsr); writew(0xaaaa, &wdog->wsr); /* load minimum 1/2 second timeout */ while (1) { /* * spin for .5 seconds before reset */ } }
#define CONFIG_HW_CONSOLE 1
/**************************************************************************** * * * Velena Source Code V1.0 * * Written by Giuliano Bertoletti * * Based on the knowledged approach of Louis Victor Allis * * Copyright (C) 1996-97 by Giuliano Bertoletti & GBE 32241 Software PR * * * **************************************************************************** Portable engine version. read the README file for further informations. ============================================================================ Changes have been made to this code for inclusion with Gnect. It is released under the GNU General Public License with Giuliano's approval. The original and complete Velena Engine source code can be found at: http://www.ce.unipr.it/~gbe/velena.html */ #ifndef _CONNECT4_H_ #define _CONNECT4_H_ 1 #define WHITE_BOOK "white_ob.cn4.gz" #define OPENINGBOOK_LENGTH 846986 #define OPENINGBOOK_CRC 0x82131150 #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #define YES 1 #define NO 0 #define ON 1 #define OFF 0 #define FULL -1 #define EMPTY 0 #define WHITE 1 #define BLACK 2 #define SWITCHSIDE 3 #define WIN 2 #define DRAW 1 #define NOTHING 0 #define BOARDX 7 #define BOARDY 6 #define MAXSQUARES (BOARDX*BOARDY) #define GROUPS 69 #define MAXSOLS 700 #define MAXGROUPS 50 #define TILES 4 #define MAXMEN 42 #define ELM(x,y) ((x)+((y)<<3)) #define ELX(n) ((n)&7) #define ELY(n) ((n)>>3) #define BOTH(x,y) ((x)+((y)<<6)) #define ALLOC_SOLUTIONS (9*GROUPS) #define CHARS 0 #define VESAGR 1 #define SQ_a1 ELM(0,0) #define SQ_a2 ELM(0,1) #define SQ_a3 ELM(0,2) #define SQ_a4 ELM(0,3) #define SQ_a5 ELM(0,4) #define SQ_a6 ELM(0,5) #define SQ_b1 ELM(1,0) #define SQ_b2 ELM(1,1) #define SQ_b3 ELM(1,2) #define SQ_b4 ELM(1,3) #define SQ_b5 ELM(1,4) #define SQ_b6 ELM(1,5) #define SQ_c1 ELM(2,0) #define SQ_c2 ELM(2,1) #define SQ_c3 ELM(2,2) #define SQ_c4 ELM(2,3) #define SQ_c5 ELM(2,4) #define SQ_c6 ELM(2,5) #define SQ_d1 ELM(3,0) #define SQ_d2 ELM(3,1) #define SQ_d3 ELM(3,2) #define SQ_d4 ELM(3,3) #define SQ_d5 ELM(3,4) #define SQ_d6 ELM(3,5) #define SQ_e1 ELM(4,0) #define SQ_e2 ELM(4,1) #define SQ_e3 ELM(4,2) #define SQ_e4 ELM(4,3) #define SQ_e5 ELM(4,4) #define SQ_e6 ELM(4,5) #define SQ_f1 ELM(5,0) #define SQ_f2 ELM(5,1) #define SQ_f3 ELM(5,2) #define SQ_f4 ELM(5,3) #define SQ_f5 ELM(5,4) #define SQ_f6 ELM(5,5) #define SQ_g1 ELM(6,0) #define SQ_g2 ELM(6,1) #define SQ_g3 ELM(6,2) #define SQ_g4 ELM(6,3) #define SQ_g5 ELM(6,4) #define SQ_g6 ELM(6,5) struct solvable_groups { short square[64][16]; short sqpnt[64]; }; struct solution { short valid; short solname; short solpoint[2]; short sqinv[2 * TILES]; short sqinvnumb; short solgroups[GROUPS]; short solgroupsnumb; }; struct intgp { short tgroups[GROUPS]; short j, k; short mygroups[GROUPS]; }; struct board { short square[(BOARDX + 1) * (BOARDY + 2)]; short wipesq[(BOARDX + 1) * (BOARDY + 2)]; short usablegroup[GROUPS]; short sqused[(BOARDX + 1) * (BOARDY + 2)]; short stack[BOARDX + 1]; short *groups[GROUPS][TILES]; short xplace[GROUPS][TILES]; short yplace[GROUPS][TILES]; short turn; short moves[MAXMEN], choices[MAXMEN], mlist[MAXMEN]; short filled; struct intgp intgp; struct solution *solution[ALLOC_SOLUTIONS]; short sp; short problem_solved, solused; short oracle[2], oracle_guesses, lastguess, bestguess; long nodes_visited; short maxtreedepth; unsigned long rule[3]; unsigned long instances[10]; short wins[2], draws, lastwin; struct solvable_groups *solvable_groups; unsigned char *white_book, *black_book; long wbposit, bbposit; long lastob; short autotest, cpu, white_lev, black_lev; short videotype, usegraphics, enablegr; short debug; }; struct board *veleng_init (void); void veleng_free (struct board *board); short playgame (char *input_str, struct board *board); int get_random_int (int n); #endif
#ifndef __MAG_H__ #define __MAG_H__ #include <linux/wakelock.h> #include <linux/interrupt.h> #include <linux/miscdevice.h> #include <linux/platform_device.h> #include <linux/input.h> #include <linux/workqueue.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/hwmsensor.h> #include <linux/earlysuspend.h> #include <linux/hwmsen_dev.h> #include "mag_factory.h" #define MAG_TAG "<MAGNETIC> " #define MAG_FUN(f) printk(MAG_TAG"%s\n", __func__) #define MAG_ERR(fmt, args...) printk(MAG_TAG"%s %d : "fmt, __func__, __LINE__, ##args) #define MAG_LOG(fmt, args...) printk(MAG_TAG fmt, ##args) #define MAG_VER(fmt, args...) printk(MAG_TAG"%s: "fmt, __func__, ##args) //((void)0) #define OP_MAG_DELAY 0X01 #define OP_MAG_ENABLE 0X02 #define OP_MAG_GET_DATA 0X04 #define MAG_INVALID_VALUE -1 #define EVENT_TYPE_MAGEL_X ABS_X #define EVENT_TYPE_MAGEL_Y ABS_Y #define EVENT_TYPE_MAGEL_Z ABS_Z #define EVENT_TYPE_MAGEL_UPDATE REL_X #define EVENT_DIV_MAGEL ABS_RUDDER #define EVENT_TYPE_MAGEL_STATUS ABS_WHEEL #define EVENT_TYPE_MAG_UPDATE REL_X #define EVENT_TYPE_MAG_TIMESTAMP_HI REL_HWHEEL #define EVENT_TYPE_MAG_TIMESTAMP_LO REL_DIAL #define EVENT_TYPE_O_X ABS_RX #define EVENT_TYPE_O_Y ABS_RY #define EVENT_TYPE_O_Z ABS_RZ #define EVENT_TYPE_O_UPDATE REL_RX #define EVENT_DIV_O ABS_GAS #define EVENT_TYPE_O_STATUS ABS_THROTTLE #define EVENT_TYPE_ORIENT_UPDATE REL_RX #define EVENT_TYPE_ORIENT_TIMESTAMP_HI REL_WHEEL #define EVENT_TYPE_ORIENT_TIMESTAMP_LO REL_MISC #define MAG_DIV_MAX (32767) #define MAG_DIV_MIN (1) #define MAG_VALUE_MAX (32767) #define MAG_VALUE_MIN (-32768) #define MAG_STATUS_MIN (0) #define MAG_STATUS_MAX (64) #define MAX_CHOOSE_G_NUM 5 #define MAX_M_V_SENSOR 5 #define ID_M_V_MAGNETIC 0 #define ID_M_V_ORIENTATION 1 enum MAG_TYPE { MAGNETIC = 0, ORIENTATION = 1, }; struct mag_data_path { int div_m; int div_o; int (*get_data_m)(int *x,int *y, int *z,int *status); int (*get_data_o)(int *x,int *y, int *z,int *status); int (*get_raw_data)(int *x,int *y, int *z);//version3 sensor common layer factory mode API2 }; struct mag_control_path { int (*m_open_report_data)(int en); int (*m_set_delay)(u64 delay); int (*m_enable)(int en); int (*o_open_report_data)(int en); int (*o_set_delay)(u64 delay); int (*o_enable)(int en); bool is_report_input_direct; bool is_support_batch; bool is_use_common_factory; }; struct mag_init_info { char *name; int (*init)(void); int (*uninit)(void); struct platform_driver* platform_diver_addr; }; struct mag_data{ hwm_sensor_data mag_data ; int data_updata; //struct mutex lock; }; struct mag_drv_obj { void *self; int polling; int (*mag_operate)(void* self, uint32_t command, void* buff_in, int size_in, void* buff_out, int size_out, int* actualout); }; struct mag_context { struct input_dev *idev; struct miscdevice mdev; struct work_struct report; struct mutex mag_op_mutex; atomic_t delay; /*polling period for reporting input event*/ atomic_t wake; /*user-space request to wake-up, used with stop*/ struct timer_list timer; /* polling timer */ struct hrtimer hrTimer; ktime_t target_ktime; atomic_t trace; struct workqueue_struct *mag_workqueue; struct early_suspend early_drv; struct mag_data_path mag_dev_data; struct mag_control_path mag_ctl; atomic_t early_suspend; struct mag_drv_obj* drv_obj[MAX_M_V_SENSOR]; struct mag_data drv_data[MAX_M_V_SENSOR]; bool is_first_data_after_enable; bool is_polling_run; bool is_batch_enable; uint32_t active_nodata_sensor; uint32_t active_data_sensor; //bool mag_type_enabled[MAX_M_V_SENSOR]; //uint32_t mag_active_sensor; }; extern int mag_attach(int sensor,struct mag_drv_obj *obj); extern int mag_driver_add(struct mag_init_info* obj) ; extern int mag_data_report(enum MAG_TYPE type, int x, int y, int z, int status, int64_t nt); extern int mag_register_control_path(struct mag_control_path *ctl); extern int mag_register_data_path(struct mag_data_path *ctl); #endif
/* { dg-do run } */ /* { dg-options "-O3 --save-temps" } */ #include <arm_neon.h> extern void abort (void); #define MAPs(size, xx) int##size##xx##_t #define MAPu(size, xx) uint##size##xx##_t #define TEST_VMLA(q, su, size, in1_lanes, in2_lanes) \ static void \ test_vmlaq_lane##q##_##su##size (MAP##su (size, ) * res, \ const MAP##su(size, ) *in1, \ const MAP##su(size, ) *in2) \ { \ MAP##su (size, x##in1_lanes) a = vld1q_##su##size (res); \ MAP##su (size, x##in1_lanes) b = vld1q_##su##size (in1); \ MAP##su (size, x##in2_lanes) c = vld1##q##_##su##size (in2); \ a = vmlaq_lane##q##_##su##size (a, b, c, 1); \ vst1q_##su##size (res, a); \ } #define BUILD_VARS(width, n_lanes, n_half_lanes) \ TEST_VMLA (, s, width, n_lanes, n_half_lanes) \ TEST_VMLA (q, s, width, n_lanes, n_lanes) \ TEST_VMLA (, u, width, n_lanes, n_half_lanes) \ TEST_VMLA (q, u, width, n_lanes, n_lanes) \ BUILD_VARS (32, 4, 2) BUILD_VARS (16, 8, 4) #define POOL4 {0, 1, 2, 3} #define POOL8 {0, 1, 2, 3, 4, 5, 6, 7} #define EMPTY4 {0, 0, 0, 0} #define EMPTY8 {0, 0, 0, 0, 0, 0, 0, 0} #define BUILD_TEST(su, size, lanes) \ static void \ test_##su##size (void) \ { \ int i; \ MAP##su (size,) pool[lanes] = POOL##lanes; \ MAP##su (size,) res[lanes] = EMPTY##lanes; \ MAP##su (size,) res2[lanes] = EMPTY##lanes; \ \ /* Forecfully avoid optimization. */ \ asm volatile ("" : : : "memory"); \ test_vmlaq_lane_##su##size (res, pool, pool); \ for (i = 0; i < lanes; i++) \ if (res[i] != pool[i]) \ abort (); \ \ /* Forecfully avoid optimization. */ \ asm volatile ("" : : : "memory"); \ test_vmlaq_laneq_##su##size (res2, pool, pool); \ for (i = 0; i < lanes; i++) \ if (res2[i] != pool[i]) \ abort (); \ } #undef BUILD_VARS #define BUILD_VARS(size, lanes) \ BUILD_TEST (s, size, lanes) \ BUILD_TEST (u, size, lanes) BUILD_VARS (32, 4) BUILD_VARS (16, 8) int main (int argc, char **argv) { test_s32 (); test_u32 (); test_s16 (); test_u16 (); return 0; } /* { dg-final { scan-assembler-times "mla\\tv\[0-9\]+\.4s, v\[0-9\]+\.4s, v\[0-9\]+\.s\\\[\[0-9\]+\\\]" 4 } } */ /* { dg-final { scan-assembler-times "mla\\tv\[0-9\]+\.8h, v\[0-9\]+\.8h, v\[0-9\]+\.h\\\[\[0-9\]+\\\]" 4 } } */
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef TITANIC_BARBOT_SCRIPT_H #define TITANIC_BARBOT_SCRIPT_H #include "titanic/true_talk/tt_npc_script.h" namespace Titanic { class BarbotScript : public TTnpcScript { private: int _state; int _arrIndex; TTsentenceEntries _entries2; TTupdateStateArray _states; TTmapEntryArray _preResponses; private: /** * Adjust a given dial number by a given delta amount */ void adjustDial(int dialNum, int amount); /** * Setup sentence data */ void setupSentences(); bool isState9() const; int applySentenceIds(int dialogueId, int v34 = -1); /** * Add a response and optionally set the state */ int setResponse(int dialogueId, int state = -1); public: BarbotScript(int val1, const char *charClass, int v2, const char *charName, int v3, int val2, int v4, int v5, int v6, int v7); /** * Chooses and adds a conversation response based on a specified tag Id. */ virtual int chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag); /** * Does NPC specific processing of the parsed sentence */ virtual int process(const TTroomScript *roomScript, const TTsentence *sentence); /** * Called when the script/id changes */ virtual ScriptChangedResult scriptChanged(const TTroomScript *roomScript, uint id); virtual int handleQuote(const TTroomScript *roomScript, const TTsentence *sentence, uint val, uint tagId, uint remainder); /** * Handles updating NPC state based on specified dialogue Ids and dial positions */ virtual int updateState(uint oldId, uint newId, int index); /** * Handles getting a pre-response */ virtual int preResponse(uint id); /** * Returns a bitset of the first three dialgs being on or not */ virtual uint getDialsBitset() const; /** * Process a sentence fragment entry */ virtual int doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence); /** * Sets a given dial to be pointing in a specified region (0 to 2) */ virtual void setDialRegion(int dialNum, int region); }; } // End of namespace Titanic #endif /* TITANIC_BARBOT_SCRIPT_H */
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. #ifndef ALICEO2_EMCAL_SIMPARAM_H_ #define ALICEO2_EMCAL_SIMPARAM_H_ #include <iosfwd> #include "CommonUtils/ConfigurableParam.h" #include "CommonUtils/ConfigurableParamHelper.h" #include "Rtypes.h" namespace o2 { namespace emcal { /// \class SimParam /// \brief EMCal simulation parameters /// \ingroup EMCALsimulation class SimParam : public o2::conf::ConfigurableParamHelper<SimParam> { public: ~SimParam() override = default; // Parameters used in Digitizer Int_t getDigitThreshold() const { return mDigitThreshold; } Float_t getPinNoise() const { return mPinNoise; } Float_t getPinNoiseLG() const { return mPinNoiseLG; } Float_t getTimeNoise() const { return mTimeNoise; } Float_t getTimeDelay() const { return mTimeDelay; } Bool_t isTimeDelayFromOCDB() const { return mTimeDelayFromOCDB; } Float_t getTimeResolutionPar0() const { return mTimeResolutionPar0; } Float_t getTimeResolutionPar1() const { return mTimeResolutionPar1; } Double_t getTimeResolution(Double_t energy) const; Int_t getNADCEC() const { return mNADCEC; } Int_t getMeanPhotonElectron() const { return mMeanPhotonElectron; } Float_t getGainFluctuations() const { return mGainFluctuations; } Float_t getTimeResponseTau() const { return mTimeResponseTau; } Float_t getTimeResponsePower() const { return mTimeResponsePower; } Float_t getTimeResponseThreshold() const { return mTimeResponseThreshold; } // Parameters used in SDigitizer Float_t getA() const { return mA; } Float_t getB() const { return mB; } Float_t getECPrimaryThreshold() const { return mECPrimThreshold; } Float_t getSignalDelay() const { return mSignalDelay; } Float_t getLiveTime() const { return mLiveTime; } Float_t getBusyTime() const { return mBusyTime; } Bool_t doSmearEnergy() const { return mSmearEnergy; } Bool_t doSimulateTimeResponse() const { return mSimulateTimeResponse; } Bool_t doRemoveDigitsBelowThreshold() const { return mRemoveDigitsBelowThreshold; } Bool_t doSimulateNoiseDigits() const { return mSimulateNoiseDigits; } Bool_t isDisablePileup() const { return mDisablePileup; } void PrintStream(std::ostream& stream) const; private: // Digitizer Int_t mDigitThreshold{3}; ///< Threshold for storing digits in EMC Int_t mMeanPhotonElectron{4400}; ///< number of photon electrons per GeV deposited energy Float_t mGainFluctuations{15.}; ///< correct fMeanPhotonElectron by the gain fluctuations Float_t mPinNoise{0.012}; ///< Electronics noise in EMC, APD Float_t mPinNoiseLG{0.1}; ///< Electronics noise in EMC, APD, Low Gain Float_t mTimeNoise{1.28e-5}; ///< Electronics noise in EMC, time Float_t mTimeDelay{600e-9}; ///< Simple time delay to mimick roughly delay in data Bool_t mTimeDelayFromOCDB{false}; ///< Get time delay from OCDB Float_t mTimeResolutionPar0{0.26666}; ///< Time resolution of FEE electronics Float_t mTimeResolutionPar1{1.4586}; ///< Time resolution of FEE electronics Int_t mNADCEC{0x10000}; ///< number of channels in EC section ADC Float_t mTimeResponseTau{2.35}; ///< Raw time response function tau parameter Float_t mTimeResponsePower{2}; ///< Raw time response function power parameter Float_t mTimeResponseThreshold{0.001}; ///< Raw time response function energy threshold // SDigitizer Float_t mA{0.}; ///< Pedestal parameter Float_t mB{1.e+6}; ///< Slope Digitizition parameters Float_t mECPrimThreshold{0.05}; ///< To store primary if EC Shower Elos > threshold // Timing Float_t mSignalDelay{700}; ///< Signal delay time (ns) Float_t mLiveTime{1500}; ///< EMCal live time (ns) Float_t mBusyTime{35000}; ///< EMCal busy time (ns) //Processing Bool_t mSmearEnergy{true}; ///< do time and energy smearing Bool_t mSimulateTimeResponse{true}; ///< simulate time response Bool_t mRemoveDigitsBelowThreshold{true}; ///< remove digits below threshold Bool_t mSimulateNoiseDigits{true}; ///< simulate noise digits // DigitizerSpec Bool_t mDisablePileup{false}; ///< disable pileup simulation O2ParamDef(SimParam, "EMCSimParam"); }; std::ostream& operator<<(std::ostream& stream, const SimParam& s); } // namespace emcal } // namespace o2 #endif
#include "ets_sys.h" #include "spi_flash.h" //#include "net80211/ieee80211_var.h" //#include "lwip/mem.h" #include "mem.h" #include "upgrade.h" #include "user_interface.h" #define ESP_DBG os_printf struct upgrade_param { uint32 fw_bin_addr; uint16 fw_bin_sec; uint16 fw_bin_sec_num; uint16 fw_bin_sec_earse; uint8 extra; uint8 save[4]; uint8 *buffer; }; LOCAL struct upgrade_param *upgrade; extern SpiFlashChip *flashchip; /****************************************************************************** * FunctionName : system_upgrade_internal * Description : a * Parameters : * Returns : *******************************************************************************/ LOCAL bool ICACHE_FLASH_ATTR system_upgrade_internal(struct upgrade_param *upgrade, uint8 *data, uint16 len) { bool ret = false; if(data == NULL || len == 0) { return true; } upgrade->buffer = (uint8 *)os_zalloc(len + upgrade->extra); os_delay_us(1000); os_memcpy(upgrade->buffer, upgrade->save, upgrade->extra); os_memcpy(upgrade->buffer + upgrade->extra, data, len); len += upgrade->extra; upgrade->extra = len & 0x03; len -= upgrade->extra; os_memcpy(upgrade->save, upgrade->buffer + len, upgrade->extra); do { if (upgrade->fw_bin_addr + len >= (upgrade->fw_bin_sec + upgrade->fw_bin_sec_num) * SPI_FLASH_SEC_SIZE) { break; } if (len > SPI_FLASH_SEC_SIZE) { } else { // os_printf("%x %x\n",upgrade->fw_bin_sec_earse,upgrade->fw_bin_addr); /* earse sector, just earse when first enter this zone */ if (upgrade->fw_bin_sec_earse != (upgrade->fw_bin_addr + len) >> 12) { upgrade->fw_bin_sec_earse = (upgrade->fw_bin_addr + len) >> 12; // spi_flash_erase_sector(upgrade->fw_bin_sec_earse); // os_printf("%x\n",upgrade->fw_bin_sec_earse); } } os_printf("-------------------\r\n"); os_printf("flash write: 0x%08x ; len: %d \r\n",upgrade->fw_bin_addr,len); #if 0 os_printf("data: \r\n"); int i; for(i=0;i<len;i++) os_printf("%02x ",*((uint8*)((upgrade->buffer)+i))); os_printf("-------------------\r\n"); #endif if (spi_flash_write(upgrade->fw_bin_addr, (uint32 *)upgrade->buffer, len) != SPI_FLASH_RESULT_OK) { break; } ret = true; upgrade->fw_bin_addr += len; } while (0); os_free(upgrade->buffer); upgrade->buffer = NULL; return ret; } /****************************************************************************** * FunctionName : system_upgrade * Description : a * Parameters : * Returns : *******************************************************************************/ bool ICACHE_FLASH_ATTR system_upgrade(uint8 *data, uint16 len) { bool ret; ret = system_upgrade_internal(upgrade, data, len); return ret; } /****************************************************************************** * FunctionName : system_upgrade_init * Description : a * Parameters : * Returns : *******************************************************************************/ void ICACHE_FLASH_ATTR system_upgrade_init(void) { uint32 user_bin1_start, user_bin2_start; uint8 spi_size_map = system_get_flash_size_map(); ESP_DBG("system_get_flash_size_map: %d \r\n",system_get_flash_size_map()); if (upgrade == NULL) { upgrade = (struct upgrade_param *)os_zalloc(sizeof(struct upgrade_param)); } system_upgrade_flag_set(UPGRADE_FLAG_IDLE); ESP_DBG("-------------------------\r\n"); ESP_DBG("FLG SET IDLE: %d \r\n",system_upgrade_flag_check()); user_bin1_start = 1; if (spi_size_map == FLASH_SIZE_8M_MAP_512_512 || spi_size_map == FLASH_SIZE_16M_MAP_512_512 || spi_size_map == FLASH_SIZE_32M_MAP_512_512) { user_bin2_start = 129; // 512/4 + 1 upgrade->fw_bin_sec_num = 123; // 512/4 - 1 - 4 } else if (spi_size_map == FLASH_SIZE_16M_MAP_1024_1024 || spi_size_map == FLASH_SIZE_32M_MAP_1024_1024) { user_bin2_start = 257; // 1024/4 + 1 upgrade->fw_bin_sec_num = 251; // 1024/4 - 1 - 4 } else { user_bin2_start = 65; // 256/4 + 1 upgrade->fw_bin_sec_num = 59; // 256/4 - 1 - 4 } upgrade->fw_bin_sec = (system_upgrade_userbin_check() == USER_BIN1) ? user_bin2_start : user_bin1_start; ESP_DBG("system_upgrade_userbin_check: %d \r\n",system_upgrade_userbin_check()); ESP_DBG("upgrade->fw_bin_sec_num: %d \r\n",upgrade->fw_bin_sec_num); ESP_DBG("-------------------------\r\n"); upgrade->fw_bin_addr = upgrade->fw_bin_sec * SPI_FLASH_SEC_SIZE; } /****************************************************************************** * FunctionName : system_upgrade_deinit * Description : a * Parameters : * Returns : *******************************************************************************/ void ICACHE_FLASH_ATTR system_upgrade_deinit(void) { if (upgrade != NULL) { os_free(upgrade); upgrade = NULL; }else { return; } }
/* * Copyright (C) 2005-2011 MaNGOS <http://www.getmangos.com/> * * Copyright (C) 2008-2011 Trinity <http://www.trinitycore.org/> * * Copyright (C) 2010-2011 Project SkyFire <http://www.projectskyfire.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, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _FOLLOWERREFMANAGER #define _FOLLOWERREFMANAGER #include "RefManager.h" class Unit; class TargetedMovementGeneratorBase; class FollowerRefManager : public RefManager<Unit, TargetedMovementGeneratorBase> { }; #endif
/* Simple DirectMedia Layer Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef SDL_power_h_ #define SDL_power_h_ /** * \file SDL_power.h * * Header for the SDL power management routines. */ #include "SDL_stdinc.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /** * The basic state for the system's power supply. */ typedef enum { SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ } SDL_PowerState; /** * Get the current power supply details. * * You should never take a battery status as absolute truth. Batteries * (especially failing batteries) are delicate hardware, and the values * reported here are best estimates based on what that hardware reports. It's * not uncommon for older batteries to lose stored power much faster than it * reports, or completely drain when reporting it has 20 percent left, etc. * * Battery status can change at any time; if you are concerned with power * state, you should call this function frequently, and perhaps ignore changes * until they seem to be stable for a few seconds. * * It's possible a platform can only report battery percentage or time left * but not both. * * \param secs seconds of battery life left, you can pass a NULL here if you * don't care, will return -1 if we can't determine a value, or * we're not running on a battery * \param pct percentage of battery life left, between 0 and 100, you can pass * a NULL here if you don't care, will return -1 if we can't * determine a value, or we're not running on a battery * \returns an SDL_PowerState enum representing the current battery state. * * \since This function is available since SDL 2.0.0. */ extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #include "close_code.h" #endif /* SDL_power_h_ */ /* vi: set ts=4 sw=4 expandtab: */
// Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL // For more information, see LICENCE in the main folder #ifndef COMMON_MUTEX_H #define COMMON_MUTEX_H #include "../common/cbasetypes.h" typedef struct ramutex ramutex; // Mutex typedef struct racond racond; // Condition Var /** * Creates a Mutex * * @return not NULL */ ramutex *ramutex_create(); /** * Destroys a Mutex * * @param m - the mutex to destroy */ void ramutex_destroy(ramutex *m); /** * Gets a lock * * @param m - the mutex to lock */ void ramutex_lock(ramutex *m); /** * Trys to get the Lock * * @param m - the mutex try to lock * * @return boolean (true = got the lock) */ bool ramutex_trylock(ramutex *m); /** * Unlocks a mutex * * @param m - the mutex to unlock */ void ramutex_unlock(ramutex *m); /** * Creates a Condition variable * * @return not NULL */ racond *racond_create(); /** * Destroy a Condition variable * * @param c - the condition variable to destroy */ void racond_destroy(racond *c); /** * Waits Until state is signaled * * @param c - the condition var to wait for signaled state * @param m - the mutex used for synchronization * @param timeout_ticks - timeout in ticks ( -1 = INFINITE ) */ void racond_wait(racond *c, ramutex *m, sysint timeout_ticks); /** * Sets the given condition var to signaled state * * @param c - condition var to set in signaled state. * * @note: * Only one waiter gets notified. */ void racond_signal(racond *c); /** * Sets notifies all waiting threads thats signaled. * @param c - condition var to set in signaled state * * @note: * All Waiters getting notified. */ void racond_broadcast(racond *c); #endif /* COMMON_MUTEX_H */
/* * 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/>. */ #pragma once bool ms4525Detect(pitot_t *pitot);
/* * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Affero 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 Affero 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 APPENDERCONSOLE_H #define APPENDERCONSOLE_H #include "Appender.h" // EnumUtils: DESCRIBE THIS enum ColorTypes { BLACK, RED, GREEN, BROWN, BLUE, MAGENTA, CYAN, GREY, YELLOW, LRED, LGREEN, LBLUE, LMAGENTA, LCYAN, WHITE, NUM_COLOR_TYPES // SKIP }; class AppenderConsole : public Appender { public: static constexpr AppenderType type = APPENDER_CONSOLE; AppenderConsole(uint8 _id, std::string const& name, LogLevel level, AppenderFlags flags, std::vector<std::string_view> const& args); void InitColors(std::string const& name, std::string_view init_str); AppenderType getType() const override { return type; } private: void SetColor(bool stdout_stream, ColorTypes color); void ResetColor(bool stdout_stream); void _write(LogMessage const* message) override; bool _colored; ColorTypes _colors[NUM_ENABLED_LOG_LEVELS]; }; #endif
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** ** GNU Lesser General Public License Usage ** ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this file. ** Please review the following information to ensure the GNU Lesser General ** Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** Other Usage ** ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** **************************************************************************/ #ifndef HELP_GLOBAL_H #define HELP_GLOBAL_H #include <qglobal.h> #if defined(HELP_LIBRARY) # define HELP_EXPORT Q_DECL_EXPORT #else # define HELP_EXPORT Q_DECL_IMPORT #endif #endif // HELP_GLOBAL_H
/* * libdivecomputer * * Copyright (C) 2009 Jef Driesen * * 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include <stdlib.h> // malloc, realloc, free #include <string.h> // memcpy, memmove #include <libdivecomputer/buffer.h> struct dc_buffer_t { unsigned char *data; size_t capacity, offset, size; }; dc_buffer_t * dc_buffer_new (size_t capacity) { dc_buffer_t *buffer = (dc_buffer_t *) malloc (sizeof (dc_buffer_t)); if (buffer == NULL) return NULL; if (capacity) { buffer->data = (unsigned char *) malloc (capacity); if (buffer->data == NULL) { free (buffer); return NULL; } } else { buffer->data = NULL; } buffer->capacity = capacity; buffer->offset = 0; buffer->size = 0; return buffer; } void dc_buffer_free (dc_buffer_t *buffer) { if (buffer == NULL) return; if (buffer->data) free (buffer->data); free (buffer); } int dc_buffer_clear (dc_buffer_t *buffer) { if (buffer == NULL) return 0; buffer->offset = 0; buffer->size = 0; return 1; } static size_t dc_buffer_expand_calc (dc_buffer_t *buffer, size_t n) { size_t oldsize = buffer->capacity; size_t newsize = (oldsize ? oldsize : n); while (newsize < n) newsize *= 2; return newsize; } static int dc_buffer_expand_append (dc_buffer_t *buffer, size_t n) { if (n > buffer->capacity - buffer->offset) { if (n > buffer->capacity) { size_t capacity = dc_buffer_expand_calc (buffer, n); unsigned char *data = (unsigned char *) malloc (capacity); if (data == NULL) return 0; if (buffer->size) memcpy (data, buffer->data + buffer->offset, buffer->size); free (buffer->data); buffer->data = data; buffer->capacity = capacity; buffer->offset = 0; } else { if (buffer->size) memmove (buffer->data, buffer->data + buffer->offset, buffer->size); buffer->offset = 0; } } return 1; } static int dc_buffer_expand_prepend (dc_buffer_t *buffer, size_t n) { size_t available = buffer->capacity - buffer->size; if (n > buffer->offset + buffer->size) { if (n > buffer->capacity) { size_t capacity = dc_buffer_expand_calc (buffer, n); unsigned char *data = (unsigned char *) malloc (capacity); if (data == NULL) return 0; if (buffer->size) memcpy (data + capacity - buffer->size, buffer->data + buffer->offset, buffer->size); free (buffer->data); buffer->data = data; buffer->capacity = capacity; buffer->offset = capacity - buffer->size; } else { if (buffer->size) memmove (buffer->data + available, buffer->data + buffer->offset, buffer->size); buffer->offset = available; } } return 1; } int dc_buffer_reserve (dc_buffer_t *buffer, size_t capacity) { if (buffer == NULL) return 0; if (capacity <= buffer->capacity) return 1; unsigned char *data = (unsigned char *) realloc (buffer->data, capacity); if (data == NULL) return 0; buffer->data = data; buffer->capacity = capacity; return 1; } int dc_buffer_resize (dc_buffer_t *buffer, size_t size) { if (buffer == NULL) return 0; if (!dc_buffer_expand_append (buffer, size)) return 0; if (size > buffer->size) memset (buffer->data + buffer->offset + buffer->size, 0, size - buffer->size); buffer->size = size; return 1; } int dc_buffer_append (dc_buffer_t *buffer, const unsigned char data[], size_t size) { if (buffer == NULL) return 0; if (!dc_buffer_expand_append (buffer, buffer->size + size)) return 0; if (size) memcpy (buffer->data + buffer->offset + buffer->size, data, size); buffer->size += size; return 1; } int dc_buffer_prepend (dc_buffer_t *buffer, const unsigned char data[], size_t size) { if (buffer == NULL) return 0; if (!dc_buffer_expand_prepend (buffer, buffer->size + size)) return 0; if (size) memcpy (buffer->data + buffer->offset - size, data, size); buffer->size += size; buffer->offset -= size; return 1; } int dc_buffer_slice (dc_buffer_t *buffer, size_t offset, size_t size) { if (buffer == NULL) return 0; if (offset + size > buffer->size) return 0; buffer->offset += offset; buffer->size = size; return 1; } size_t dc_buffer_get_size (dc_buffer_t *buffer) { if (buffer == NULL) return 0; return buffer->size; } unsigned char * dc_buffer_get_data (dc_buffer_t *buffer) { if (buffer == NULL) return NULL; return buffer->size ? buffer->data + buffer->offset : NULL; }
/*************************************************************************** * Copyright (c) 2010 Juergen Riegel <FreeCAD@juergen-riegel.net> * * * * This file is part of the FreeCAD CAx development system. * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Library General Public * * License as published by the Free Software Foundation; either * * version 2 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 Library General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this library; see the file COPYING.LIB. If not, * * write to the Free Software Foundation, Inc., 59 Temple Place, * * Suite 330, Boston, MA 02111-1307, USA * * * ***************************************************************************/ #ifndef PARTDESIGN_DressUp_H #define PARTDESIGN_DressUp_H #include <App/PropertyStandard.h> #include "FeatureAddSub.h" namespace PartDesign { class PartDesignExport DressUp : public PartDesign::FeatureAddSub { PROPERTY_HEADER(PartDesign::DressUp); public: DressUp(); /** * Base feature and it's subelements to which dressup operation will be applied to. * Unlike Feature::BaseFeature it includes Sublinks and set not only inside a body. * But for consistency if BaseFeature is nonzero this links to the same body as it. */ App::PropertyLinkSub Base; App::PropertyBool SupportTransform; short mustExecute() const; /// updates the Placement property from the Placement of the BaseFeature void positionByBaseFeature(void); /** * Returns the BaseFeature property's object if it's set otherwise returns Base's * feature property object otherwise feature property's object (if any) * @param silent if couldn't determine the base feature and silent == true, * silently return a nullptr, otherwise throw Base::Exception. * Default is false. */ virtual Part::Feature* getBaseObject(bool silent=false) const; /// extracts all edges from the subshapes (including face edges) and furthermore adds /// all C0 continuous edges to the vector void getContinuousEdges(Part::TopoShape, std::vector< std::string >&); // add argument to return the selected face that edges were derived from void getContinuousEdges(Part::TopoShape, std::vector< std::string >&, std::vector< std::string >&); virtual void getAddSubShape(Part::TopoShape &addShape, Part::TopoShape &subShape); protected: virtual void onChanged(const App::Property* prop); }; } //namespace PartDesign #endif // PARTDESIGN_DressUp_H
/* * Adplug - Replayer for many OPL2/OPL3 audio file formats. * Copyright (C) 1999 - 2007 Simon Peter, <dn.tlp@gmx.net>, et al. * * 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, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * protrack.h - Generic Protracker Player by Simon Peter <dn.tlp@gmx.net> */ #ifndef H_PROTRACK #define H_PROTRACK #include "player.h" class CmodPlayer: public CPlayer { public: CmodPlayer(Copl *newopl); virtual ~CmodPlayer(); bool update(); void rewind(int subsong); float getrefresh(); unsigned int getpatterns() { return nop; } unsigned int getpattern() { return order[ord]; } unsigned int getorders() { return length; } unsigned int getorder() { return ord; } unsigned int getrow() { return rw; } unsigned int getspeed() { return speed; } protected: enum Flags { Standard = 0, Decimal = 1 << 0, Faust = 1 << 1, NoKeyOn = 1 << 2, Opl3 = 1 << 3, Tremolo = 1 << 4, Vibrato = 1 << 5, Percussion = 1 << 6 }; struct Instrument { unsigned char data[11],arpstart,arpspeed,arppos,arpspdcnt,misc; signed char slide; } *inst; struct Tracks { unsigned char note,command,inst,param2,param1; } **tracks; unsigned char *order, *arplist, *arpcmd, initspeed; unsigned short tempo, **trackord, bpm, nop; unsigned long length, restartpos, activechan; int flags, curchip; struct Channel { unsigned short freq,nextfreq; unsigned char oct,vol1,vol2,inst,fx,info1,info2,key,nextoct, note,portainfo,vibinfo1,vibinfo2,arppos,arpspdcnt; signed char trigger; } *channel; void init_trackord(); bool init_specialarp(); void init_notetable(const unsigned short *newnotetable); bool realloc_order(unsigned long len); bool realloc_patterns(unsigned long pats, unsigned long rows, unsigned long chans); bool realloc_instruments(unsigned long len); void dealloc(); private: static const unsigned short sa2_notetable[12]; static const unsigned char vibratotab[32]; unsigned char speed, del, songend, regbd; unsigned short rows, notetable[12]; unsigned long rw, ord, nrows, npats, nchans; void setvolume(unsigned char chan); void setvolume_alt(unsigned char chan); void setfreq(unsigned char chan); void playnote(unsigned char chan); void setnote(unsigned char chan, int note); void slide_down(unsigned char chan, int amount); void slide_up(unsigned char chan, int amount); void tone_portamento(unsigned char chan, unsigned char info); void vibrato(unsigned char chan, unsigned char speed, unsigned char depth); void vol_up(unsigned char chan, int amount); void vol_down(unsigned char chan, int amount); void vol_up_alt(unsigned char chan, int amount); void vol_down_alt(unsigned char chan, int amount); void dealloc_patterns(); bool resolve_order(); unsigned char set_opl_chip(unsigned char chan); }; #endif
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of Qt Designer. This header // file may change from version to version without notice, or even be removed. // // We mean it. // #ifndef ABSTRACTOPTIONSPAGE_P_H #define ABSTRACTOPTIONSPAGE_P_H #include <sdk_global.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class QString; class QWidget; class QDESIGNER_SDK_EXPORT QDesignerOptionsPageInterface { public: virtual ~QDesignerOptionsPageInterface() {} virtual QString name() const = 0; virtual QWidget *createPage(QWidget *parent) = 0; virtual void apply() = 0; virtual void finish() = 0; }; QT_END_NAMESPACE QT_END_HEADER #endif // ABSTRACTOPTIONSPAGE_P_H
/* * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> * Copyright (C) 2006 Apple Computer Inc. * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> * Copyright (C) Research In Motion Limited 2010. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef SVGRootInlineBox_h #define SVGRootInlineBox_h #include "core/layout/line/RootInlineBox.h" #include "core/layout/svg/SVGTextLayoutEngine.h" namespace blink { class SVGRootInlineBox final : public RootInlineBox { public: SVGRootInlineBox(LayoutBlockFlow& block) : RootInlineBox(block) , m_logicalHeight(0) { } virtual bool isSVGRootInlineBox() const override { return true; } virtual LayoutUnit virtualLogicalHeight() const override { return m_logicalHeight; } void setLogicalHeight(LayoutUnit height) { m_logicalHeight = height; } virtual void paint(const PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom) override; virtual void markDirty() override; void computePerCharacterLayoutInformation(); InlineBox* closestLeafChildForPosition(const LayoutPoint&); private: void reorderValueLists(Vector<SVGTextLayoutAttributes*>&); void layoutChildBoxes(InlineFlowBox*, LayoutRect* = nullptr); void layoutRootBox(const LayoutRect&); private: LayoutUnit m_logicalHeight; }; DEFINE_INLINE_BOX_TYPE_CASTS(SVGRootInlineBox); } // namespace blink #endif // SVGRootInlineBox_h
#pragma once namespace StaticLib2 { void UselessMethod(); }
/* * Copyright (c) 2020 Intel Corporation. * * SPDX-License-Identifier: Apache-2.0 */ #include <kernel.h> #include <zephyr.h> #include <ksched.h> #include "footprint.h" static const char const_string[] = "String!\n"; static char new_string[32]; void run_libc(void) { int len; len = strlen(const_string); len = strnlen(const_string, len); memset(new_string, 0, sizeof(new_string)); if (memcmp(const_string, new_string, 0) != 0) { /* avoid unused return error */ } if (memcmp(const_string, new_string, len) != 0) { /* avoid unused return error */ } strcpy(new_string, const_string); strncpy(new_string, const_string, len); }
// // KFOnboardingViewController.h // Kickflip // // Created by Christopher Ballinger on 6/13/14. // Copyright (c) 2014 Kickflip. All rights reserved. // #import <UIKit/UIKit.h> @class BButton; @interface KFOnboardingViewController : UIViewController @property (strong, nonatomic) IBOutlet UIImageView *logoImageView; @property (strong, nonatomic) IBOutlet UILabel *titleLabel; @property (strong, nonatomic) IBOutlet UITextView *introductionTextView; @property (strong, nonatomic) IBOutlet BButton *dismissButton; - (IBAction)dismissButtonPressed:(id)sender; @end
// 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_PREFS_VALUE_MAP_PREF_STORE_H_ #define CHROME_BROWSER_PREFS_VALUE_MAP_PREF_STORE_H_ #pragma once #include <map> #include <string> #include "base/basictypes.h" #include "base/observer_list.h" #include "chrome/browser/prefs/pref_value_map.h" #include "chrome/common/pref_store.h" // A basic PrefStore implementation that uses a simple name-value map for // storing the preference values. class ValueMapPrefStore : public PrefStore { public: typedef std::map<std::string, base::Value*>::iterator iterator; typedef std::map<std::string, base::Value*>::const_iterator const_iterator; ValueMapPrefStore(); // PrefStore overrides: virtual ReadResult GetValue(const std::string& key, const base::Value** value) const OVERRIDE; virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE; virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE; virtual size_t NumberOfObservers() const OVERRIDE; iterator begin(); iterator end(); const_iterator begin() const; const_iterator end() const; protected: virtual ~ValueMapPrefStore(); // Store a |value| for |key| in the store. Also generates an notification if // the value changed. Assumes ownership of |value|, which must be non-NULL. void SetValue(const std::string& key, base::Value* value); // Remove the value for |key| from the store. Sends a notification if there // was a value to be removed. void RemoveValue(const std::string& key); // Notify observers about the initialization completed event. void NotifyInitializationCompleted(); private: PrefValueMap prefs_; ObserverList<PrefStore::Observer, true> observers_; DISALLOW_COPY_AND_ASSIGN(ValueMapPrefStore); }; #endif // CHROME_BROWSER_PREFS_VALUE_MAP_PREF_STORE_H_
/* * Copyright (C) 2011 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 THIRD_PARTY_BLINK_RENDERER_CORE_DOM_MUTATION_OBSERVER_INTEREST_GROUP_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_MUTATION_OBSERVER_INTEREST_GROUP_H_ #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/mutation_observer.h" #include "third_party/blink/renderer/core/dom/node.h" #include "third_party/blink/renderer/core/dom/qualified_name.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/wtf/hash_map.h" namespace blink { class MutationObserverInterestGroup final : public GarbageCollected<MutationObserverInterestGroup> { public: static MutationObserverInterestGroup* CreateForChildListMutation( Node& target) { if (!target.GetDocument().HasMutationObserversOfType( kMutationTypeChildList)) return nullptr; MutationRecordDeliveryOptions old_value_flag = 0; return CreateIfNeeded(target, kMutationTypeChildList, old_value_flag); } static MutationObserverInterestGroup* CreateForCharacterDataMutation( Node& target) { if (!target.GetDocument().HasMutationObserversOfType( kMutationTypeCharacterData)) return nullptr; return CreateIfNeeded(target, kMutationTypeCharacterData, MutationObserver::kCharacterDataOldValue); } static MutationObserverInterestGroup* CreateForAttributesMutation( Node& target, const QualifiedName& attribute_name) { if (!target.GetDocument().HasMutationObserversOfType( kMutationTypeAttributes)) return nullptr; return CreateIfNeeded(target, kMutationTypeAttributes, MutationObserver::kAttributeOldValue, &attribute_name); } MutationObserverInterestGroup( HeapHashMap<Member<MutationObserver>, MutationRecordDeliveryOptions>& observers, MutationRecordDeliveryOptions old_value_flag); bool IsOldValueRequested(); void EnqueueMutationRecord(MutationRecord*); void Trace(Visitor*) const; private: static MutationObserverInterestGroup* CreateIfNeeded( Node& target, MutationType, MutationRecordDeliveryOptions old_value_flag, const QualifiedName* attribute_name = nullptr); bool HasOldValue(MutationRecordDeliveryOptions options) { return options & old_value_flag_; } HeapHashMap<Member<MutationObserver>, MutationRecordDeliveryOptions> observers_; MutationRecordDeliveryOptions old_value_flag_; }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_DOM_MUTATION_OBSERVER_INTEREST_GROUP_H_
// Copyright 2019 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_METRICS_PERF_PROCESS_TYPE_COLLECTOR_H_ #define CHROME_BROWSER_METRICS_PERF_PROCESS_TYPE_COLLECTOR_H_ #include <map> #include <vector> #include "third_party/metrics_proto/execution_context.pb.h" #include "third_party/re2/src/re2/stringpiece.h" namespace metrics { // Enables collection of process and thread types for Chrome PIDs and TIDs. class ProcessTypeCollector { public: // NOTE: ChromeProcessTypes and ChromeThreadTypes methods make blocking call // to base::GetAppOutput. Callers, who are calling these methods from a scope // that disallows blocking, should post a task with MayBlock() task trait to // execute these methods or make sure to call these methods asynchronously. // Collects process types by running ps command and returns a map of Chrome // PIDs to their process types. It also populates a list of Lacros PID's, // if any. static std::map<uint32_t, Process> ChromeProcessTypes( std::vector<uint32_t>& lacros_pids); // Collects thread types by running ps command and returns a map of Chrome // TIDs to their thread types. static std::map<uint32_t, Thread> ChromeThreadTypes(); protected: ProcessTypeCollector() = delete; ~ProcessTypeCollector() = delete; // Parses the output of `ps -ewwo pid,cmd` command and returns a map of Chrome // PIDs to their process types. It also populates a list of Lacros PID's, // if any. static std::map<uint32_t, Process> ParseProcessTypes( re2::StringPiece contents, std::vector<uint32_t>& lacros_pids); // Parses the output of `ps -ewLo pid,lwp,comm` command and returns a map of // Chrome TIDs to their thread types. static std::map<uint32_t, Thread> ParseThreadTypes(re2::StringPiece contents); // Enumeration representing success and various failure modes for collecting // types data. These values are persisted to logs. Entries should not be // renumbered and numeric values should never be reused. enum class CollectionAttemptStatus { kProcessTypeCmdError, kThreadTypeCmdError, kEmptyProcessType, kEmptyThreadType, kProcessTypeTruncated, kThreadTypeTruncated, kProcessTypeSuccess, kThreadTypeSuccess, // Magic constant used by the histogram macros. kMaxValue = kThreadTypeSuccess, }; }; } // namespace metrics #endif // CHROME_BROWSER_METRICS_PERF_PROCESS_TYPE_COLLECTOR_H_
// // firpfbch_synthesis_equivalence_test.c // #include <stdio.h> #include <math.h> #include <assert.h> #include "liquid.internal.h" #define DEBUG 1 int main() { // options unsigned int num_channels=4; // number of channels unsigned int m=3; // filter delay unsigned int num_symbols=5; // number of symbols // derived values unsigned int num_samples = num_channels * num_symbols; unsigned int i; unsigned int j; // generate filter // NOTE : these coefficients can be random; the purpose of this // exercise is to demonstrate mathematical equivalence unsigned int h_len = 2*m*num_channels; float h[h_len]; for (i=0; i<h_len; i++) h[i] = randnf(); //for (i=0; i<h_len; i++) h[i] = 0.1f*i; //for (i=0; i<h_len; i++) h[i] = (i<=m) ? 1.0f : 0.0f; //for (i=0; i<h_len; i++) h[i] = 1.0f; // create filterbank manually dotprod_crcf dp[num_channels]; // vector dot products windowcf w[num_channels]; // window buffers #if DEBUG // print coefficients printf("h_prototype:\n"); for (i=0; i<h_len; i++) printf(" h[%3u] = %12.8f\n", i, h[i]); #endif // create objects unsigned int h_sub_len = 2*m; float h_sub[h_sub_len]; for (i=0; i<num_channels; i++) { // sub-sample prototype filter, loading coefficients in // reverse order #if 0 for (j=0; j<h_sub_len; j++) h_sub[j] = h[j*num_channels+i]; #else for (j=0; j<h_sub_len; j++) h_sub[h_sub_len-j-1] = h[j*num_channels+i]; #endif // create window buffer and dotprod objects dp[i] = dotprod_crcf_create(h_sub, h_sub_len); w[i] = windowcf_create(h_sub_len); #if DEBUG printf("h_sub[%u] : \n", i); for (j=0; j<h_sub_len; j++) printf(" h[%3u] = %12.8f\n", j, h_sub[j]); #endif } // generate inverse DFT object float complex x[num_channels]; // time-domain buffer float complex X[num_channels]; // freq-domain buffer #if 1 fftplan ifft = fft_create_plan(num_channels, X, x, LIQUID_FFT_BACKWARD, 0); #else fftplan ifft = fft_create_plan(num_channels, X, x, LIQUID_FFT_FORWARD, 0); #endif // generate filter object firfilt_crcf f = firfilt_crcf_create(h, h_len); float complex Y[num_symbols][num_channels]; // channelized input float complex y0[num_samples]; // time-domain output float complex y1[num_samples]; // time-domain output // generate input sequence (complex noise) for (i=0; i<num_symbols; i++) { for (j=0; j<num_channels; j++) Y[i][j] = randnf() * cexpf(_Complex_I*randf()*2*M_PI); #if 0 for (j=0; j<num_channels; j++) Y[i][j] = i==0 ? randnf() * cexpf(_Complex_I*randf()*2*M_PI) : 0.0f; #endif } // // run synthesis filter bank // float complex * r; // read pointer for (i=0; i<num_symbols; i++) { // load buffers for (j=0; j<num_channels; j++) { X[j] = Y[i][j]; } // execute inverse DFT, store result in buffer 'x' fft_execute(ifft); // push samples into filter bank and execute for (j=0; j<num_channels; j++) { windowcf_push(w[j], x[j]); windowcf_read(w[j], &r); dotprod_crcf_execute(dp[j], r, &y0[i*num_channels+j]); // normalize by DFT scaling factor //y0[i*num_channels+j] /= (float) num_channels; } } // // run traditional up-converter (inefficient) // // clear output array for (i=0; i<num_samples; i++) y1[i] = 0.0f; unsigned int n; float dphi; // carrier frequency float complex y_hat; for (i=0; i<num_channels; i++) { // reset filter firfilt_crcf_reset(f); // set center frequency dphi = 2.0f * M_PI * (float)i / (float)num_channels; // reset input symbol counter n=0; for (j=0; j<num_samples; j++) { // interpolate sequence if ( (j%num_channels)==0 ) { assert(n<num_symbols); firfilt_crcf_push(f, Y[n][i]); n++; } else { firfilt_crcf_push(f, 0); } firfilt_crcf_execute(f, &y_hat); // accumulate up-converted sample y1[j] += y_hat * cexpf(_Complex_I*j*dphi); } assert(n==num_symbols); } // destroy objects for (i=0; i<num_channels; i++) { dotprod_crcf_destroy(dp[i]); windowcf_destroy(w[i]); } fft_destroy_plan(ifft); firfilt_crcf_destroy(f); // // print channelizer outputs // printf("\n"); printf("output: filterbank: traditional:\n"); for (i=0; i<num_samples; i++) { printf("%3u: %10.5f+%10.5fj %10.5f+%10.5fj\n", i, crealf(y0[i]), cimagf(y0[i]), crealf(y1[i]), cimagf(y1[i])); } // // compare results // float mse = 0.0f; float complex d; for (i=0; i<num_samples; i++) { d = y0[i] - y1[i]; mse += crealf(d*conjf(d)); } mse /= num_samples; printf("\n"); printf("rmse: %12.4e\n", sqrtf(mse)); printf("done.\n"); return 0; }
#ifndef BITCOINGUI_H #define BITCOINGUI_H #include <QMainWindow> #include <QSystemTrayIcon> class TransactionTableModel; class ClientModel; class WalletModel; class TransactionView; class OverviewPage; class MiningPage; class AddressBookPage; class SendCoinsDialog; class MessagePage; class Notificator; class RPCConsole; QT_BEGIN_NAMESPACE class QLabel; class QLineEdit; class QTableView; class QAbstractItemModel; class QModelIndex; class QProgressBar; class QStackedWidget; class QUrl; QT_END_NAMESPACE /** Bitcoin GUI main class. This class represents the main window of the Bitcoin UI. It communicates with both the client and wallet models to give the user an up-to-date view of the current core state. */ class BitcoinGUI : public QMainWindow { Q_OBJECT public: explicit BitcoinGUI(QWidget *parent = 0); ~BitcoinGUI(); /** Set the client model. The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic. */ void setClientModel(ClientModel *clientModel); /** Set the wallet model. The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending functionality. */ void setWalletModel(WalletModel *walletModel); protected: void changeEvent(QEvent *e); void closeEvent(QCloseEvent *event); void dragEnterEvent(QDragEnterEvent *event); void dropEvent(QDropEvent *event); private: ClientModel *clientModel; WalletModel *walletModel; QStackedWidget *centralWidget; OverviewPage *overviewPage; MiningPage *miningPage; QWidget *transactionsPage; AddressBookPage *addressBookPage; AddressBookPage *receiveCoinsPage; SendCoinsDialog *sendCoinsPage; MessagePage *messagePage; QLabel *labelEncryptionIcon; QLabel *labelMiningIcon; QLabel *labelConnectionsIcon; QLabel *labelBlocksIcon; QLabel *progressBarLabel; QProgressBar *progressBar; QMenuBar *appMenuBar; QAction *overviewAction; QAction *miningAction; QAction *historyAction; QAction *quitAction; QAction *sendCoinsAction; QAction *addressBookAction; QAction *messageAction; QAction *verifyMessageAction; QAction *aboutAction; QAction *receiveCoinsAction; QAction *optionsAction; QAction *toggleHideAction; QAction *exportAction; QAction *encryptWalletAction; QAction *backupWalletAction; QAction *changePassphraseAction; QAction *aboutQtAction; QAction *openRPCConsoleAction; QSystemTrayIcon *trayIcon; Notificator *notificator; TransactionView *transactionView; RPCConsole *rpcConsole; QMovie *syncIconMovie; /** Create the main UI actions. */ void createActions(); /** Create the menu bar and submenus. */ void createMenuBar(); /** Create the toolbars */ void createToolBars(); /** Create system tray (notification) icon */ void createTrayIcon(); public slots: /** Set number of connections shown in the UI */ void setNumConnections(int count); /** Set number of blocks shown in the UI */ void setNumBlocks(int count, int countOfPeers); /** Set mining status and hashrate in the UI */ void setMining(bool mining, int hashrate); /** Set the encryption status as shown in the UI. @param[in] status current encryption status @see WalletModel::EncryptionStatus */ void setEncryptionStatus(int status); /** Notify the user of an error in the network or transaction handling code. */ void error(const QString &title, const QString &message, bool modal); /** Asks the user whether to pay the transaction fee or to cancel the transaction. It is currently not possible to pass a return value to another thread through BlockingQueuedConnection, so an indirected pointer is used. http://bugreports.qt.nokia.com/browse/QTBUG-10440 @param[in] nFeeRequired the required fee @param[out] payFee true to pay the fee, false to not pay the fee */ void askFee(qint64 nFeeRequired, bool *payFee); void handleURI(QString strURI); void gotoMessagePage(QString addr = ""); private slots: /** Switch to overview (home) page */ void gotoOverviewPage(); /** Switch to mining page */ void gotoMiningPage(); /** Switch to history (transactions) page */ void gotoHistoryPage(); /** Switch to address book page */ void gotoAddressBookPage(); /** Switch to receive coins page */ void gotoReceiveCoinsPage(); /** Switch to send coins page */ void gotoSendCoinsPage(); /** Show configuration dialog */ void optionsClicked(); /** Show about dialog */ void aboutClicked(); #ifndef Q_WS_MAC /** Handle tray icon clicked */ void trayIconActivated(QSystemTrayIcon::ActivationReason reason); #endif /** Show incoming transaction notification for new transactions. The new items are those between start and end inclusive, under the given parent item. */ void incomingTransaction(const QModelIndex & parent, int start, int end); /** Encrypt the wallet */ void encryptWallet(bool status); /** Backup the wallet */ void backupWallet(); /** Change encrypted wallet passphrase */ void changePassphrase(); /** Verify a message signature */ void verifyMessage(); /** Ask for pass phrase to unlock wallet temporarily */ void unlockWallet(); /** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */ void showNormalIfMinimized(bool fToggleHidden = false); /** simply calls showNormalIfMinimized(true) for use in SLOT() macro */ void toggleHidden(); }; #endif
// // SDCAlertViewContentView.h // SDCAlertView // // Created by Scott Berrevoets on 11/5/13. // Copyright (c) 2013 Scotty Doesn't Code. All rights reserved. // @import UIKit; #import "SDCAlertView.h" // Required for SDCAlertViewStyle @class SDCAlertViewContentView; @protocol SDCAlertViewContentViewDelegate <NSObject> - (void)alertContentView:(SDCAlertViewContentView *)sender didTapButtonAtIndex:(NSUInteger)index; - (BOOL)alertContentView:(SDCAlertViewContentView *)sender shouldDeselectButtonAtIndex:(NSUInteger)index; @end @interface SDCAlertViewContentView : UIView <UITableViewDataSource, UITableViewDelegate> @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSAttributedString *attributedTitle; @property (nonatomic, copy) NSString *message; @property (nonatomic, copy) NSAttributedString *attributedMessage; @property (nonatomic, readonly) NSArray *textFields; @property (nonatomic, strong) UIView *customContentView; @property (nonatomic, readonly) NSInteger numberOfButtons; @property (nonatomic) NSInteger cancelButtonIndex; @property (nonatomic, copy) NSString *cancelButtonTitle; @property (nonatomic, readonly) NSInteger firstOtherButtonIndex; @property (nonatomic, getter = isFirstOtherButtonEnabled) BOOL firstOtherButtonEnabled; @property (nonatomic) BOOL alwaysShowsButtonsVertically; @property (nonatomic) CGSize maximumSize; @property (nonatomic, weak) id <SDCAlertViewContentViewDelegate> delegate; - (instancetype)initWithDelegate:(id <SDCAlertViewContentViewDelegate>)delegate NS_DESIGNATED_INITIALIZER; - (void)updateContentForStyle:(SDCAlertViewStyle)style; - (void)prepareForShowing; - (NSInteger)addButtonWithTitle:(NSString *)buttonTitle; - (NSString *)buttonTitleAtIndex:(NSInteger)buttonIndex; /* * Appearance properties */ @property (nonatomic, strong) UIFont *titleLabelFont; @property (nonatomic, strong) UIColor *titleLabelTextColor; @property (nonatomic, strong) UIFont *messageLabelFont; @property (nonatomic, strong) UIColor *messageLabelTextColor; @property (nonatomic, strong) UIFont *textFieldFont; @property (nonatomic, strong) UIColor *textFieldTextColor; @property (nonatomic, strong) UIFont *suggestedButtonFont; @property (nonatomic, strong) UIFont *normalButtonFont; @property (nonatomic, strong) UIColor *buttonTextColor; @property (nonatomic, assign) UIEdgeInsets contentPadding; @property (nonatomic, assign) CGFloat labelSpacing; @end
/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2015 Cavium, Inc */ #include "eal_private.h" #include "rte_cycles.h" uint64_t get_tsc_freq_arch(void) { #if defined RTE_ARCH_ARM64 && !defined RTE_ARM_EAL_RDTSC_USE_PMU return __rte_arm64_cntfrq(); #elif defined RTE_ARCH_ARM64 && defined RTE_ARM_EAL_RDTSC_USE_PMU #define CYC_PER_1MHZ 1E6 /* Use the generic counter ticks to calculate the PMU * cycle frequency. */ uint64_t ticks; uint64_t start_ticks, cur_ticks; uint64_t start_pmu_cycles, end_pmu_cycles; /* Number of ticks for 1/10 second */ ticks = __rte_arm64_cntfrq() / 10; start_ticks = __rte_arm64_cntvct_precise(); start_pmu_cycles = rte_rdtsc_precise(); do { cur_ticks = __rte_arm64_cntvct(); } while ((cur_ticks - start_ticks) < ticks); end_pmu_cycles = rte_rdtsc_precise(); /* Adjust the cycles to next 1Mhz */ return RTE_ALIGN_MUL_CEIL(end_pmu_cycles - start_pmu_cycles, CYC_PER_1MHZ) * 10; #else return 0; #endif }
@class CLPlacemark; @class Temperature; @interface TRWeatherUpdate : NSObject <NSCoding> @property (nonatomic, copy, readonly) NSString *city; @property (nonatomic, copy, readonly) NSString *state; @property (nonatomic, copy, readonly) NSString *conditionsDescription; @property (nonatomic, copy, readonly) NSString *precipitationType; @property (nonatomic, readonly) Temperature *currentTemperature; @property (nonatomic, readonly) Temperature *currentHigh; @property (nonatomic, readonly) Temperature *currentLow; @property (nonatomic, readonly) Temperature *yesterdaysTemperature; @property (nonatomic, readonly) CGFloat precipitationPercentage; @property (nonatomic, readonly) CGFloat windSpeed; @property (nonatomic, readonly) CGFloat windBearing; @property (nonatomic, readonly) NSDate *date; @property (nonatomic, copy, readonly) NSArray *dailyForecasts; - (instancetype)initWithPlacemark:(CLPlacemark *)placemark currentConditionsJSON:(id)currentConditionsJSON yesterdaysConditionsJSON:(id)yesterdaysConditionsJSON; - (instancetype)initWithPlacemark:(CLPlacemark *)placemark currentConditionsJSON:(NSDictionary *)currentConditionsJSON yesterdaysConditionsJSON:(NSDictionary *)yesterdaysConditionsJSON date:(NSDate *)date; @end #import "TRAnalyticsEvent.h" @interface TRWeatherUpdate (TRAnalytics) <TRAnalyticsEvent> @end
/*********************************************************************************************************************** * DISCLAIMER * This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No * other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all * applicable laws, including copyright laws. * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM * EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES * SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS * SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of * this software. By using this software, you agree to the additional terms and conditions found by accessing the * following link: * http://www.renesas.com/disclaimer * * Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved. ***********************************************************************************************************************/ /*********************************************************************************************************************** * File Name : dbsct.c * Device(s) : RX * Description : Defines the structure of the ROM and RAM areas. ***********************************************************************************************************************/ /*********************************************************************************************************************** * History : DD.MM.YYYY Version Description * : 26.10.2011 1.00 First Release ***********************************************************************************************************************/ /*********************************************************************************************************************** Includes <System Includes> , "Project Includes" ***********************************************************************************************************************/ /* Defines type structures used in this file */ #include <stdint.h> /* Preprocessor directive */ #pragma unpack /* Section start */ #pragma section C C$DSEC /* MCU ROM and RAM structure definition */ extern const struct { uint8_t *rom_s; /* Start address of the initialized data section in ROM */ uint8_t *rom_e; /* End address of the initialized data section in ROM */ uint8_t *ram_s; /* Start address of the initialized data section in RAM */ } _DTBL[] = { { __sectop("D"), __secend("D"), __sectop("R") }, { __sectop("D_2"), __secend("D_2"), __sectop("R_2") }, { __sectop("D_1"), __secend("D_1"), __sectop("R_1") } }; /* Section start */ #pragma section C C$BSEC /* MCU ROM and RAM structure definition */ extern const struct { uint8_t *b_s; /* Start address of non-initialized data section */ uint8_t *b_e; /* End address of non-initialized data section */ } _BTBL[] = { { __sectop("B"), __secend("B") }, { __sectop("B_2"), __secend("B_2") }, { __sectop("B_1"), __secend("B_1") } }; /* Section start */ #pragma section /* CTBL prevents excessive output of L1100 messages when linking. Even if CTBL is deleted, the operation of the program does not change. */ uint8_t * const _CTBL[] = { __sectop("C_1"), __sectop("C_2"), __sectop("C"), __sectop("W_1"), __sectop("W_2"), __sectop("W") }; /* Preprocessor directive */ #pragma packoption /* This is to ensure compatibility with new L section in version 1.1 and up of the RXC compiler. Do not remove! */ #pragma section C L const unsigned long deadSpace = 0xDEADDEAD; #pragma section
#ifndef _MUSIC_H_ #define _MUSIC_H_ #include <string> #include <map> #include <memory> #include "SDL_mixer.h" class ThemeData; class Music { std::string mPath; Mix_Music * music; bool playing; public: static std::shared_ptr<Music> getFromTheme(const std::shared_ptr<ThemeData>& theme, const std::string& view, const std::string& element); static std::shared_ptr<Music> get(const std::string& path); void play(bool repeat, void (* callback)()); ~Music(); private: Music(const std::string & path = ""); static std::map< std::string, std::shared_ptr<Music> > sMap; void initMusic(); void deinitMusic(); }; #endif
/* pbrt source code Copyright(c) 1998-2010 Matt Pharr and Greg Humphreys. This file is part of pbrt. pbrt 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. Note that the text contents of the book "Physically Based Rendering" are *not* licensed under the GNU GPL. pbrt 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/>. */ #if defined(_MSC_VER) #pragma once #endif #ifndef PBRT_TEXTURES_CONSTANT_H #define PBRT_TEXTURES_CONSTANT_H // textures/constant.h* #include "pbrt.h" #include "texture.h" #include "paramset.h" // ConstantTexture Declarations template <typename T> class ConstantTexture : public Texture<T> { public: // ConstantTexture Public Methods ConstantTexture(const T &v) { value = v; } T Evaluate(const DifferentialGeometry &) const { return value; } private: T value; }; ConstantTexture<float> *CreateConstantFloatTexture(const Transform &tex2world, const TextureParams &tp); ConstantTexture<Spectrum> *CreateConstantSpectrumTexture(const Transform &tex2world, const TextureParams &tp); #endif // PBRT_TEXTURES_CONSTANT_H
/* * PCI Backend - Configuration space overlay for power management * * Author: Ryan Wilson <hap9@epoch.ncsc.mil> */ #include <linux/pci.h> #include "conf_space.h" #include "conf_space_capability.h" static int pm_caps_read(struct pci_dev *dev, int offset, u16 *value, void *data) { int err; u16 real_value; err = pci_read_config_word(dev, offset, &real_value); if (err) goto out; *value = real_value & ~PCI_PM_CAP_PME_MASK; out: return err; } /* PM_OK_BITS specifies the bits that the driver domain is allowed to change. * Can't allow driver domain to enable PMEs - they're shared */ #define PM_OK_BITS (PCI_PM_CTRL_PME_STATUS|PCI_PM_CTRL_DATA_SEL_MASK) static int pm_ctrl_write(struct pci_dev *dev, int offset, u16 new_value, void *data) { int err; u16 old_value; pci_power_t new_state, old_state; err = pci_read_config_word(dev, offset, &old_value); if (err) goto out; old_state = (pci_power_t)(old_value & PCI_PM_CTRL_STATE_MASK); new_state = (pci_power_t)(new_value & PCI_PM_CTRL_STATE_MASK); new_value &= PM_OK_BITS; if ((old_value & PM_OK_BITS) != new_value) { new_value = (old_value & ~PM_OK_BITS) | new_value; err = pci_write_config_word(dev, offset, new_value); if (err) goto out; } /* Let pci core handle the power management change */ dev_dbg(&dev->dev, "set power state to %x\n", new_state); err = pci_set_power_state(dev, new_state); if (err) { err = PCIBIOS_SET_FAILED; goto out; } out: return err; } /* Ensure PMEs are disabled */ static void *pm_ctrl_init(struct pci_dev *dev, int offset) { int err; u16 value; err = pci_read_config_word(dev, offset, &value); if (err) goto out; if (value & PCI_PM_CTRL_PME_ENABLE) { value &= ~PCI_PM_CTRL_PME_ENABLE; err = pci_write_config_word(dev, offset, value); } out: return ERR_PTR(err); } static const struct config_field caplist_pm[] = { { .offset = PCI_PM_PMC, .size = 2, .u.w.read = pm_caps_read, }, { .offset = PCI_PM_CTRL, .size = 2, .init = pm_ctrl_init, .u.w.read = pciback_read_config_word, .u.w.write = pm_ctrl_write, }, { .offset = PCI_PM_PPB_EXTENSIONS, .size = 1, .u.b.read = pciback_read_config_byte, }, { .offset = PCI_PM_DATA_REGISTER, .size = 1, .u.b.read = pciback_read_config_byte, }, {} }; struct pciback_config_capability pciback_config_capability_pm = { .capability = PCI_CAP_ID_PM, .fields = caplist_pm, };
/* * (C) Copyright 2010-2012 * NVIDIA Corporation <www.nvidia.com> * * See file CREDITS for list of people who contributed to this * project. * * 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 __CONFIG_H #define __CONFIG_H #include <asm/sizes.h> #include "tegra2-common.h" /* Enable fdt support for TrimSlice. Flash the image in u-boot-dtb.bin */ #define CONFIG_DEFAULT_DEVICE_TREE tegra2-trimslice #define CONFIG_OF_CONTROL #define CONFIG_OF_SEPARATE /* High-level configuration options */ #define V_PROMPT "Tegra2 (TrimSlice) # " #define CONFIG_TEGRA2_BOARD_STRING "Compulab Trimslice" /* Board-specific serial config */ #define CONFIG_SERIAL_MULTI #define CONFIG_TEGRA2_ENABLE_UARTA #define CONFIG_TEGRA2_UARTA_GPU #define CONFIG_SYS_NS16550_COM1 NV_PA_APB_UARTA_BASE #define CONFIG_MACH_TYPE MACH_TYPE_TRIMSLICE #define CONFIG_BOARD_EARLY_INIT_F /* SPI */ #define CONFIG_TEGRA_SPI #define CONFIG_SPI_FLASH #define CONFIG_SPI_FLASH_WINBOND #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0 #define CONFIG_CMD_SPI #define CONFIG_CMD_SF /* I2C */ #define CONFIG_TEGRA_I2C #define CONFIG_SYS_I2C_INIT_BOARD #define CONFIG_I2C_MULTI_BUS #define CONFIG_SYS_MAX_I2C_BUS 4 #define CONFIG_SYS_I2C_SPEED 100000 #define CONFIG_CMD_I2C /* SD/MMC */ #define CONFIG_MMC #define CONFIG_GENERIC_MMC #define CONFIG_TEGRA_MMC #define CONFIG_CMD_MMC #define CONFIG_DOS_PARTITION #define CONFIG_EFI_PARTITION #define CONFIG_CMD_EXT2 #define CONFIG_CMD_FAT /* Environment in SPI */ #define CONFIG_ENV_IS_IN_SPI_FLASH #define CONFIG_ENV_SPI_MAX_HZ 48000000 #define CONFIG_ENV_SPI_MODE SPI_MODE_0 #define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE #define CONFIG_ENV_OFFSET (512 * 1024) /* USB Host support */ #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_TEGRA #define CONFIG_USB_STORAGE #define CONFIG_CMD_USB /* USB networking support */ #define CONFIG_USB_HOST_ETHER #define CONFIG_USB_ETHER_ASIX /* General networking support */ #define CONFIG_CMD_NET #define CONFIG_CMD_DHCP #include "tegra2-common-post.h" #endif /* __CONFIG_H */
/* { dg-require-effective-target vect_int } */ /* { dg-additional-options "-O3" } */ #include <string.h> #include "tree-vect.h" #define FOO(T,N) \ void __attribute__((noinline,noclone)) \ foo_ ## T ## _ ## N (T * __restrict__ in_, T * __restrict__ out_, int s) \ { \ T *in = __builtin_assume_aligned (in_, __BIGGEST_ALIGNMENT__); \ T *out = __builtin_assume_aligned (out_, __BIGGEST_ALIGNMENT__); \ for (int i = 0; i < 16; i++) \ { \ for (int j = 0; j < N; ++j) \ out[j] = in[j]; \ in += N; \ out += s*N; \ } \ } #define TEST(T,N) \ do { \ memset (out, 0, 4096); \ foo_ ## T ## _ ## N ((T *)in, (T *)out, 1); \ if (memcmp (in, out, sizeof (T) * 16 * N) != 0) \ __builtin_abort (); \ for (int i = sizeof (T) * 16 * N; i < 4096; ++i) \ if (out[i] != 0) \ __builtin_abort (); \ } while (0) FOO(char, 1) FOO(char, 2) FOO(char, 3) FOO(char, 4) FOO(char, 6) FOO(char, 8) FOO(int, 1) FOO(int, 2) FOO(int, 3) FOO(int, 4) FOO(int, 6) FOO(int, 8) FOO(int, 16) char in[4096] __attribute__((aligned(__BIGGEST_ALIGNMENT__))); char out[4096] __attribute__((aligned(__BIGGEST_ALIGNMENT__))); int main() { check_vect (); for (int i = 0; i < 4096; ++i) { in[i] = i; __asm__ volatile ("" : : : "memory"); } TEST(char, 1); TEST(char, 2); TEST(char, 3); TEST(char, 4); TEST(char, 6); TEST(char, 8); TEST(int, 1); TEST(int, 2); TEST(int, 3); TEST(int, 4); TEST(int, 6); TEST(int, 8); TEST(int, 16); return 0; } /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 13 "vect" { target vect_hw_misalign } } } */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { ! vect_hw_misalign } } } } */
/* * This file is part of the coreboot project. * * Copyright 2016 Rockchip 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; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <arch/io.h> #include <console/console.h> #include <gpio.h> #include <soc/addressmap.h> #include <soc/gpio.h> #include <soc/grf.h> #include <soc/soc.h> #include <stdlib.h> struct rockchip_gpio_regs *gpio_port[] = { (struct rockchip_gpio_regs *)GPIO0_BASE, (struct rockchip_gpio_regs *)GPIO1_BASE, (struct rockchip_gpio_regs *)GPIO2_BASE, (struct rockchip_gpio_regs *)GPIO3_BASE, (struct rockchip_gpio_regs *)GPIO4_BASE, }; #define PMU_GPIO_PORT0 0 #define PMU_GPIO_PORT1 1 int is_pmu_gpio(gpio_t gpio) { if (gpio.port == PMU_GPIO_PORT0 || gpio.port == PMU_GPIO_PORT1) return 1; return 0; } void *gpio_grf_reg(gpio_t gpio) { if (is_pmu_gpio(gpio)) return &rk3399_pmugrf->gpio0_p[gpio.port][gpio.bank]; /* There are two pmu gpio, 0 and 1, so " - 2" */ return &rk3399_grf->gpio2_p[(gpio.port - 2)][gpio.bank]; } #define IS_GPIO_BANK(g, p, b) (g.port == p && g.bank == GPIO_##b) enum { PULLNONE_1V8 = 0, PULLDOWN_1V8 = 1, PULLUP_1V8 = 3, }; u32 gpio_get_pull_val(gpio_t gpio, enum gpio_pull pull) { /* The default pull bias setting defined in soc/gpio.h */ u32 pull_val = pull; /* GPIO0_A, GPIO0_B, GPIO2_C, GPIO2_D use the 1V8 pull bias setting. * Defined in TRM V.03 Part1 Page 331 and Page 458 */ if (IS_GPIO_BANK(gpio, 0, A) || IS_GPIO_BANK(gpio, 0, B) || IS_GPIO_BANK(gpio, 2, C) || IS_GPIO_BANK(gpio, 2, D)) { switch (pull) { case GPIO_PULLUP: pull_val = PULLUP_1V8; break; case GPIO_PULLDOWN: pull_val = PULLDOWN_1V8; break; case GPIO_PULLNONE: pull_val = PULLNONE_1V8; } } return pull_val; }
/* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS PairStyle(lj/cut/coul/msm/gpu,PairLJCutCoulMSMGPU) #else #ifndef LMP_PAIR_LJ_CUT_COUL_MSM_GPU_H #define LMP_PAIR_LJ_CUT_COUL_MSM_GPU_H #include "pair_lj_cut_coul_msm.h" namespace LAMMPS_NS { class PairLJCutCoulMSMGPU : public PairLJCutCoulMSM { public: PairLJCutCoulMSMGPU(LAMMPS *lmp); ~PairLJCutCoulMSMGPU(); void cpu_compute(int, int, int, int, int *, int *, int **); void compute(int, int); void init_style(); double memory_usage(); enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; } #endif #endif /* ERROR/WARNING messages: E: Insufficient memory on accelerator There is insufficient memory on one of the devices specified for the gpu package E: Cannot use newton pair with lj/cut/coul/msm/gpu pair style Self-explanatory. E: Must use 'kspace_modify pressure/scalar no' with GPU MSM Pair styles The kspace scalar pressure option is not (yet) compatible with GPU MSM Pair styles. */
/* * This file is part of the coreboot project. * * Copyright (C) 2006 Jon Dufresne <jon.dufresne@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; 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. */ #define MCH_DRC 0x70 #define DRC_DONE (1 << 29) /* If I have already booted once skip a bunch of initialization */ /* To see if I have already booted I check to see if memory * has been enabled. */ static int bios_reset_detected(void) { uint32_t dword; dword = pci_read_config32(PCI_DEV(0, 0, 0), MCH_DRC); if ( (dword & DRC_DONE) != 0 ) { return 1; } return 0; }
// // Author: Marcin Kosiba // // 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 CHIANG_MOBILITY_H #define CHIANG_MOBILITY_H #include "INETDefs.h" #include <LineSegmentsMobilityBase.h> /** * @brief Chiang's random walk movement model. See NED file for more info. * * @author Marcin Kosiba */ class INET_API ChiangMobility : public LineSegmentsMobilityBase { protected: double speed; ///< speed of the host double stateTransitionUpdateInterval; ///< how often to calculate the new state int xState; ///< 0 = negative direction, 1 = no move, 2 = positive direction int yState; ///< 0 = negative direction, 1 = no move, 2 = positive direction protected: /** @brief Initializes mobility model parameters.*/ virtual void initialize(int stage); /** @brief Gets the next state based on the current state. */ int getNextStateIndex(int currentState); /** @brief Calculate a new target position to move to. */ void setTargetPosition(); /** @brief Move the host according to the current simulation time. */ virtual void move(); public: ChiangMobility(); }; #endif
/* rwsem.h: R/W semaphores, public interface * * Written by David Howells (dhowells@redhat.com). * Derived from asm-i386/semaphore.h */ #ifndef _LINUX_RWSEM_H #define _LINUX_RWSEM_H #include <linux/linkage.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/rt_lock.h> #include <asm/system.h> #include <asm/atomic.h> struct rw_anon_semaphore; struct rw_semaphore; #ifdef CONFIG_RWSEM_GENERIC_SPINLOCK #include <linux/rwsem-spinlock.h> /* use a generic implementation */ #else #include <asm/rwsem.h> /* use an arch-specific implementation */ #endif /* * lock for reading */ extern void anon_down_read(struct rw_anon_semaphore *sem); /* * trylock for reading -- returns 1 if successful, 0 if contention */ extern int anon_down_read_trylock(struct rw_anon_semaphore *sem); /* * lock for writing */ extern void anon_down_write(struct rw_anon_semaphore *sem); /* * trylock for writing -- returns 1 if successful, 0 if contention */ extern int anon_down_write_trylock(struct rw_anon_semaphore *sem); /* * release a read lock */ extern void anon_up_read(struct rw_anon_semaphore *sem); /* * release a write lock */ extern void anon_up_write(struct rw_anon_semaphore *sem); /* * downgrade write lock to read lock */ extern void anon_downgrade_write(struct rw_anon_semaphore *sem); #ifdef CONFIG_DEBUG_LOCK_ALLOC /* * nested locking. NOTE: rwsems are not allowed to recurse * (which occurs if the same task tries to acquire the same * lock instance multiple times), but multiple locks of the * same lock class might be taken, if the order of the locks * is always the same. This ordering rule can be expressed * to lockdep via the _nested() APIs, but enumerating the * subclasses that are used. (If the nesting relationship is * static then another method for expressing nested locking is * the explicit definition of lock class keys and the use of * lockdep_set_class() at lock initialization time. * See Documentation/lockdep-design.txt for more details.) */ extern void anon_down_read_nested(struct rw_anon_semaphore *sem, int subclass); extern void anon_down_write_nested(struct rw_anon_semaphore *sem, int subclass); /* * Take/release a lock when not the owner will release it. * * [ This API should be avoided as much as possible - the * proper abstraction for this case is completions. ] */ extern void anon_down_read_non_owner(struct rw_anon_semaphore *sem); extern void anon_up_read_non_owner(struct rw_anon_semaphore *sem); #else # define anon_down_read_nested(sem, subclass) anon_down_read(sem) # define anon_down_write_nested(sem, subclass) anon_down_write(sem) # define anon_down_read_non_owner(sem) anon_down_read(sem) # define anon_up_read_non_owner(sem) anon_up_read(sem) #endif #ifdef CONFIG_PREEMPT_RT #include <linux/rt_lock.h> #define init_rwsem(sem) rt_init_rwsem(sem) #define rwsem_is_locked(s) rt_mutex_is_locked(&(s)->lock) static inline void down_read(struct rw_semaphore *sem) { rt_down_read(sem); } static inline int down_read_trylock(struct rw_semaphore *sem) { return rt_down_read_trylock(sem); } static inline void down_write(struct rw_semaphore *sem) { rt_down_write(sem); } static inline int down_write_trylock(struct rw_semaphore *sem) { return rt_down_write_trylock(sem); } static inline void up_read(struct rw_semaphore *sem) { rt_up_read(sem); } static inline void up_write(struct rw_semaphore *sem) { rt_up_write(sem); } static inline void downgrade_write(struct rw_semaphore *sem) { rt_downgrade_write(sem); } static inline void down_read_nested(struct rw_semaphore *sem, int subclass) { return rt_down_read_nested(sem, subclass); } static inline void down_write_nested(struct rw_semaphore *sem, int subclass) { rt_down_write_nested(sem, subclass); } #else /* * Non preempt-rt implementations */ static inline void down_read(struct rw_semaphore *sem) { anon_down_read((struct rw_anon_semaphore *)sem); } static inline int down_read_trylock(struct rw_semaphore *sem) { return anon_down_read_trylock((struct rw_anon_semaphore *)sem); } static inline void down_write(struct rw_semaphore *sem) { anon_down_write((struct rw_anon_semaphore *)sem); } static inline int down_write_trylock(struct rw_semaphore *sem) { return anon_down_write_trylock((struct rw_anon_semaphore *)sem); } static inline void up_read(struct rw_semaphore *sem) { anon_up_read((struct rw_anon_semaphore *)sem); } static inline void up_write(struct rw_semaphore *sem) { anon_up_write((struct rw_anon_semaphore *)sem); } static inline void downgrade_write(struct rw_semaphore *sem) { anon_downgrade_write((struct rw_anon_semaphore *)sem); } static inline void down_read_nested(struct rw_semaphore *sem, int subclass) { return anon_down_read_nested((struct rw_anon_semaphore *)sem, subclass); } static inline void down_write_nested(struct rw_semaphore *sem, int subclass) { anon_down_write_nested((struct rw_anon_semaphore *)sem, subclass); } #endif #endif /* _LINUX_RWSEM_H */
/* Copyright (C) 2006 Paul Davis 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __ardour_midi_ring_buffer_h__ #define __ardour_midi_ring_buffer_h__ #include <iostream> #include <algorithm> #include "ardour/event_ring_buffer.h" #include "ardour/libardour_visibility.h" #include "ardour/types.h" #include "ardour/midi_state_tracker.h" namespace ARDOUR { class MidiBuffer; /** A RingBuffer for (MIDI) events. * * This is simply a wrapper around a raw ringbuffer which writes/reads events * as flat placked blobs. * The buffer looks like this: * * [timestamp][type][size][size bytes of raw MIDI][timestamp][type][size](etc...) */ template<typename T> class /*LIBARDOUR_API*/ MidiRingBuffer : public EventRingBuffer<T> { public: /** @param size Size in bytes. */ MidiRingBuffer(size_t size) : EventRingBuffer<T>(size) {} inline bool read_prefix(T* time, Evoral::EventType* type, uint32_t* size); inline bool read_contents(uint32_t size, uint8_t* buf); size_t read(MidiBuffer& dst, framepos_t start, framepos_t end, framecnt_t offset=0, bool stop_on_overflow_in_destination=false); size_t skip_to(framepos_t start); void dump(std::ostream& dst); void flush (framepos_t start, framepos_t end); void reset_tracker (); void resolve_tracker (MidiBuffer& dst, framepos_t); void resolve_tracker (Evoral::EventSink<framepos_t>& dst, framepos_t); private: MidiStateTracker _tracker; }; /** Read the time and size of an event. This call MUST be immediately proceeded * by a call to read_contents (or the read pointer will be garbage). */ template<typename T> inline bool MidiRingBuffer<T>::read_prefix(T* time, Evoral::EventType* type, uint32_t* size) { if (PBD::RingBufferNPT<uint8_t>::read((uint8_t*)time, sizeof(T)) != sizeof (T)) { return false; } if (PBD::RingBufferNPT<uint8_t>::read((uint8_t*)type, sizeof(Evoral::EventType)) != sizeof (Evoral::EventType)) { return false; } if (PBD::RingBufferNPT<uint8_t>::read((uint8_t*)size, sizeof(uint32_t)) != sizeof (uint32_t)) { return false; } return true; } /** Read the content of an event. This call MUST be immediately preceded * by a call to read_prefix (or the returned even will be garbage). */ template<typename T> inline bool MidiRingBuffer<T>::read_contents(uint32_t size, uint8_t* buf) { return PBD::RingBufferNPT<uint8_t>::read(buf, size) == size; } } // namespace ARDOUR #endif // __ardour_midi_ring_buffer_h__
// // Fader.h // Artificial I // // Created by Matej Jan on 4.12.10. // Copyright 2010 Retronator. All rights reserved. // #import <Foundation/Foundation.h> @interface Fader : NSObject { BOOL finished; float value; float min; float max; NSTimeInterval duration; float rate; float remaining; float target; } - (id) initWithMin:(float)minValue max:(float)maxValue duration:(NSTimeInterval)theDuration; @property (nonatomic, readonly) BOOL finished; @property (nonatomic) float value; @property (nonatomic) float min; @property (nonatomic) float max; @property (nonatomic) NSTimeInterval duration; - (void) fadeIn; - (void) fadeOut; - (void) updateWithElapsed:(NSTimeInterval)elapsed; @end
/* Copyright (C) 2016 Jeremiah Orians * This file is part of stage0. * * stage0 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. * * stage0 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 stage0. If not, see <http://www.gnu.org/licenses/>. */ #define FALSE 0 // CONSTANT FALSE 0 #define TRUE 1 // CONSTANT TRUE 1 int match(char* a, char* b) { int i = -1; do { i = i + 1; if(a[i] != b[i]) { return FALSE; } } while((0 != a[i]) && (0 !=b[i])); return TRUE; }
/* Open Asset Import Library (ASSIMP) ---------------------------------------------------------------------- Copyright (c) 2006-2010, ASSIMP Development Team All rights reserved. Redistribution and use of this software 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 the ASSIMP team, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission of the ASSIMP Development Team. 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. ---------------------------------------------------------------------- */ /** @file Defines a post processing step to remove specific parts of the scene */ #ifndef AI_REMOVEVCPROCESS_H_INCLUDED #define AI_REMOVEVCPROCESS_H_INCLUDED #include "BaseProcess.h" #include "../include/aiMesh.h" class RemoveVCProcessTest; namespace Assimp { // --------------------------------------------------------------------------- /** RemoveVCProcess: Class to exclude specific parts of the data structure * from further processing by removing them, */ class ASSIMP_API RemoveVCProcess : public BaseProcess { friend class Importer; friend class ::RemoveVCProcessTest; protected: /** Constructor to be privately used by Importer */ RemoveVCProcess(); /** Destructor, private as well */ ~RemoveVCProcess(); public: // ------------------------------------------------------------------- /** Returns whether the processing step is present in the given flag field. * @param pFlags The processing flags the importer was called with. A bitwise * combination of #aiPostProcessSteps. * @return true if the process is present in this flag fields, false if not. */ bool IsActive( unsigned int pFlags) const; // ------------------------------------------------------------------- /** Executes the post processing step on the given imported data. * At the moment a process is not supposed to fail. * @param pScene The imported data to work at. */ void Execute( aiScene* pScene); // ------------------------------------------------------------------- /** Called prior to ExecuteOnScene(). * The function is a request to the process to update its configuration * basing on the Importer's configuration property list. */ virtual void SetupProperties(const Importer* pImp); // ------------------------------------------------------------------- /** Manually setup the configuration flags for the step * * @param Bitwise combintion of the #aiComponent enumerated values. */ void SetDeleteFlags(unsigned int f) { configDeleteFlags = f; } // ------------------------------------------------------------------- /** Query the current configuration. */ unsigned int GetDeleteFlags() const { return configDeleteFlags; } private: bool ProcessMesh (aiMesh* pcMesh); /** Configuration flag */ unsigned int configDeleteFlags; /** The scene we're working with */ aiScene* mScene; }; } // end of namespace Assimp #endif // !!AI_REMOVEVCPROCESS_H_INCLUDED
/* Copyright 2020 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_COMPILER_XLA_SERVICE_SPMD_CANONICALIZE_ALL_GATHER_FOR_CSE_H_ #define TENSORFLOW_COMPILER_XLA_SERVICE_SPMD_CANONICALIZE_ALL_GATHER_FOR_CSE_H_ #include "tensorflow/compiler/xla/service/hlo_module.h" #include "tensorflow/compiler/xla/service/hlo_pass_interface.h" namespace xla { // Performs canonicalizations on AllGather for CSE. class CanonicalizeAllGatherForCSE : public HloModulePass { public: CanonicalizeAllGatherForCSE() : next_channel_id_(0) {} ~CanonicalizeAllGatherForCSE() override = default; absl::string_view name() const override { return "canon-all-gather-for-cse"; } StatusOr<bool> Run(HloModule* module) override; private: StatusOr<bool> RunOnComputation(HloComputation* comp); int64_t NextChannelId() { return next_channel_id_++; } int64_t next_channel_id_; }; } // namespace xla #endif // TENSORFLOW_COMPILER_XLA_SERVICE_SPMD_CANONICALIZE_ALL_GATHER_FOR_CSE_H_
// // ATLUIMessageComposeTextView.h // Atlas // // Created by Kevin Coleman on 8/31/14. // Copyright (c) 2014 Layer, Inc. 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. // #import <UIKit/UIKit.h> /** @abstract The ATLMessageComposeTextView handles displaying content in an `ATLMessageInputToolbar`. The class provides support for displaying text, images, and locations objects represented by a map image via NSTextAttachemts. */ @interface ATLMessageComposeTextView : UITextView /** @abstract Configures the placeholder text for the textView */ @property (nonatomic) NSString *placeholder; /** @abstract Overrides the default next responder when keeping the keyboard visible while presenting a `UIMenuController`. */ @property (nonatomic, weak) UIResponder *overrideNextResponder; @end
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * gsf-infile-msvba.h: * * Copyright (C) 2002-2006 Jody Goldberg (jody@gnome.org) * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2.1 of the GNU Lesser General Public * License as published by the Free Software Foundation. * * 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA */ #ifndef GSF_INFILE_MSVBA_H #define GSF_INFILE_MSVBA_H #include <gsf/gsf-fwd.h> #include <gsf/gsf-infile.h> G_BEGIN_DECLS typedef struct _GsfInfileMSVBA GsfInfileMSVBA; #define GSF_INFILE_MSVBA_TYPE (gsf_infile_msvba_get_type ()) #define GSF_INFILE_MSVBA(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSF_INFILE_MSVBA_TYPE, GsfInfileMSVBA)) #define GSF_IS_INFILE_MSVBA(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSF_INFILE_MSVBA_TYPE)) GType gsf_infile_msvba_get_type (void); /* void gsf_infile_msvba_register_type (GTypeModule *module); glib dynamic types are not thread safe */ GsfInfile *gsf_infile_msvba_new (GsfInfile *source, GError **err); GHashTable *gsf_infile_msvba_get_modules (GsfInfileMSVBA const *vba_stream); GHashTable *gsf_infile_msvba_steal_modules (GsfInfileMSVBA *vba_stream); guint8 *gsf_vba_inflate (GsfInput *input, gsf_off_t offset, int *size, gboolean add_null_terminator); /* Utility */ GsfInfileMSVBA *gsf_input_find_vba (GsfInput *input, GError **err); G_END_DECLS #endif /* GSF_INFILE_MSVBA_H */
/* * Copyright 2010-present Facebook. * * 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. */ #import "FBAppCall.h" @interface FBAppCall (Internal) // Defined here for the rest of the SDK to use @property (readonly) BOOL isValid; // Re-defined here as readwrite to allow the rest of the SDK to set these // properties @property (nonatomic, readwrite, retain) NSError *error; @property (nonatomic, readwrite, retain) FBDialogsData *dialogData; @property (nonatomic, readwrite, retain) FBAppLinkData *appLinkData; @property (nonatomic, readwrite, retain) FBAccessTokenData *accessTokenData; - (instancetype)initWithID:(NSString *)ID; /*! @abstract Designated initializer for FBAppCall @param ID the unique identifier for matching the FBAppCall. If nil, a random uid will be generated @param enforceScheme a flag determining if we need to detect if the url scheme that will be used for a FAS is correctly configured to allow a callback from iOS. In general, if you are creating an "outbound" FBAppCall, you should use the default of YES to make sure the schemes are set correctly. If the scheme is not set correctly, a developer error is logged and this will return nil. @param appID the explicit app id to use. If nil, defaults to [FBSettings defaultAppID] @param urlSchemeSuffix the explicit url scheme suffix to use. If nil, defaults to [FBSettings defaultUrlSchemeSuffix]. @discussion The app id and url scheme parameters are overrides that can be specified on an FBSession instance. In order to wire up bridge call backs properly, FBAppCall must know about any such overrides. */ - (instancetype)initWithID:(NSString *)ID enforceScheme:(BOOL)enforceScheme appID:(NSString *)appID urlSchemeSuffix:(NSString *)urlSchemeSuffix; + (BOOL)openURL:(NSURL *)url; #pragma mark - SafariViewController methods + (BOOL)openURLWithSafariViewController:(NSURL *)url fromViewController:(UIViewController *)fromViewController; + (void)dismissSafariViewController; @end
// Copyright 2009 Sebastien Martini (seb@dbzteam.org) // // 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 KEYCZAR_KEYCZAR_TEST_H_ #define KEYCZAR_KEYCZAR_TEST_H_ #include <string> #include <keyczar/platform_test.h> #include <gtest/gtest.h> #include <keyczar/base/file_path.h> #include <keyczar/base/file_util.h> #include <keyczar/base/logging.h> #include <keyczar/base_test/path_service.h> namespace keyczar { class KeyczarTest : public PlatformTest { protected: virtual void SetUp() { PlatformTest::SetUp(); base_test::PathService::Get(base_test::DIR_TEMP, &temp_path_); temp_path_ = temp_path_.Append("keyczar"); base::CreateDirectory(temp_path_); base_test::PathService::Get(base_test::DIR_SOURCE_ROOT, &data_path_); data_path_ = data_path_.Append("keyczar"); data_path_ = data_path_.Append("data"); #ifdef COMPAT_KEYCZAR_06B data_path_ = data_path_.Append("06b"); #endif input_data_ = "This is some test data"; hidden_data_ = "This is some hidden data"; } virtual void TearDown() { PlatformTest::TearDown(); base::Delete(temp_path_, true); } // Paths used in testing. FilePath temp_path_; FilePath data_path_; std::string input_data_; std::string hidden_data_; // Common test routines void TestSignAndVerify(const std::string& sign_key, const std::string& verify_key) const; void TestAttachedSignAndVerify(const std::string& sign_key, const std::string& verify_key) const; void TestSignAndVerifyUnversioned(const std::string& sign_key, const std::string& verify_key) const; // Utility methods void ReadDataFile(const std::string& filename, std::string* content) const; }; } // namespace keyczar #endif // KEYCZAR_KEYCZAR_TEST_H_
/***************************************************************************** * * * OpenNI 1.x Alpha * * Copyright (C) 2012 PrimeSense Ltd. * * * * This file is part of OpenNI. * * * * 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 __EXPORTED_PLAYER_H__ #define __EXPORTED_PLAYER_H__ //--------------------------------------------------------------------------- // Includes //--------------------------------------------------------------------------- #include <XnModuleCppInterface.h> #include <XnTypes.h> //--------------------------------------------------------------------------- // Types //--------------------------------------------------------------------------- class ExportedPlayer : public xn::ModuleExportedProductionNode { public: ExportedPlayer(); virtual ~ExportedPlayer(); virtual void GetDescription(XnProductionNodeDescription* pDescription); virtual XnStatus EnumerateProductionTrees(xn::Context& context, xn::NodeInfoList& TreesList, xn::EnumerationErrors* pErrors); virtual XnStatus Create(xn::Context& context, const XnChar* strInstanceName, const XnChar* strCreationInfo, xn::NodeInfoList* pNeededTrees, const XnChar* strConfigurationDir, xn::ModuleProductionNode** ppInstance); virtual void Destroy(xn::ModuleProductionNode* pInstance); private: //--------------------------------------------------------------------------- // Constants //--------------------------------------------------------------------------- static const char NAME[]; static const char CREATION_INFO[]; }; #endif // __EXPORTED_PLAYER_H__
/* * Copyright 2015 The SageTV 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. */ // The following ifdef block is the standard way of creating macros which make exporting // from a DLL simpler. All files within this DLL are compiled with the DSHOWCAPTURE_EXPORTS // symbol defined on the command line. this symbol should not be defined on any project // that uses this DLL. This way any other project whose source files include this file see // DSHOWCAPTURE_API functions as being imported from a DLL, wheras this DLL sees symbols // defined with this macro as being exported. #ifndef _H_INCLUDE_DSHOWCAPTURE_H_ #define _H_INCLUDE_DSHOWCAPTURE_H_ #ifdef DSHOWCAPTURE_EXPORTS #define DSHOWCAPTURE_API __declspec(dllexport) #else #define DSHOWCAPTURE_API __declspec(dllimport) #endif #include <bdatif.h> //ZQ #include <tuner.h> //ZQ #include <tune.h> //ZQ #ifdef WIN32 #include <pshpack1.h> #endif #define MAX_CAPTURE_NUM 4 //The maximum number of BDA tuners that are supported typedef struct TUNING_TBL { unsigned short channel; unsigned short onid; unsigned short tsid; unsigned short program; unsigned long freq; unsigned long band; unsigned long ctrl; unsigned short modulation; //unsigned char audio; char comment[20]; } TUNING_TBL; typedef struct DShowCaptureInfo { char TAG[8]; ICaptureGraphBuilder2* pBuilder; IGraphBuilder* pGraph; IBaseFilter* pVideoCaptureFilter; char videoCaptureFilterName[256]; int videoCaptureFilterNum; char videoCaptureFilterNameOrg[256]; //we use a tag<> at end of Filter name, need save orignal name for posting messge char audioCaptureFilterName[256]; int audioCaptureFilterNum; int audioCaptureFilterSrcIndex; char videoProcessorName[256]; char audioProcessorName[256]; char bdaCaptureFilterName[256]; //ZQ for BDA char bdaTunerFilterName[256]; //ZQ for BDA int captureConfig; DWORD dwRegister; IMediaControl* pMC; IBaseFilter* pSink; IBaseFilter* pCCSink; IBaseFilter* pTVTuner; IBaseFilter* pTVAudio; IBaseFilter* pCrossbar; IBaseFilter* pEncoder; IBaseFilter* pVideoCompressor; IBaseFilter* pAudioCompressor; IBaseFilter* pAudioCaptureFilter; //ZQ for BDA int filterState; DWORD dwBDAType; DWORD dwTuneState; ITuningSpace* pTuningSpace; IScanningTuner* pTuner; IBaseFilter* pBDANetworkProvider; IBaseFilter* pBDATuner; IBaseFilter* pBDADemod; IBaseFilter* pBDACapture; IBaseFilter* pBDADemux; IBaseFilter* pBDATIF; IBaseFilter* pBDASectionTbl; //IBaseFilter* pTeeFilter; IBaseFilter* pSplitter; IBaseFilter* pDebugSink; IBaseFilter* pDebugSrcSink; IBaseFilter* pPrePlugin; //MDAPI filter may use IBaseFilter* pResync; char encodeQuality[256]; void* encodeParams; jlong recordBufferSize; DWORD videoFormatCode; char deviceName[1024]; char TuningMode[16]; char tvType[16]; char Country[80]; IVideoWindow* pPreviewVideo; void* channel; //BDA channel void* pCamCtrlData; void* pQAMCtrlData; void* pTunerPluginCtrlData; char TunerIDName[256]; void* pDiSEQC; //for DVB-S DisSEQC char virtualTunerParam[128]; unsigned long virtualTunerMask; unsigned long EPG_post_counter; unsigned long EPG_post_time; int EPG_post_flow_rate_ctrl; int captureNum; DShowCaptureInfo* captures[MAX_CAPTURE_NUM]; } DShowCaptureInfo; //define SageTV error code that starts from 0x81000xxx ZQ. //we'll put into sage java code later #define E_FREQUENCY_NOT_UNDEFINED 0x81000201 #define E_CHANNEL_DISABLED 0x81000202 #ifdef WIN32 #include <poppack.h> #endif extern HANDLE mutex350Encoder; #endif
/* Copyright 1998 by the Massachusetts Institute of Technology. * Copyright (C) 2009 by Jakub Hrozek <jhrozek@redhat.com> * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided that the above copyright * notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in * advertising or publicity pertaining to distribution of the * software without specific, written prior permission. * M.I.T. makes no representations about the suitability of * this software for any purpose. It is provided "as is" * without express or implied warranty. */ #include "ares_setup.h" #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #ifdef HAVE_ARPA_INET_H # include <arpa/inet.h> #endif #include "ares_nameser.h" #ifdef HAVE_STRINGS_H # include <strings.h> #endif #include "ares.h" #include "ares_dns.h" #include "ares_data.h" #include "ares_private.h" static int ares__parse_txt_reply (const unsigned char *abuf, int alen, int ex, void **txt_out) { size_t substr_len; unsigned int qdcount, ancount, i; const unsigned char *aptr; const unsigned char *strptr; int status, rr_type, rr_class, rr_len; long len; char *hostname = NULL, *rr_name = NULL; struct ares_txt_ext *txt_head = NULL; struct ares_txt_ext *txt_last = NULL; struct ares_txt_ext *txt_curr; /* Set *txt_out to NULL for all failure cases. */ *txt_out = NULL; /* Give up if abuf doesn't have room for a header. */ if (alen < HFIXEDSZ) return ARES_EBADRESP; /* Fetch the question and answer count from the header. */ qdcount = DNS_HEADER_QDCOUNT (abuf); ancount = DNS_HEADER_ANCOUNT (abuf); if (qdcount != 1) return ARES_EBADRESP; if (ancount == 0) return ARES_ENODATA; /* Expand the name from the question, and skip past the question. */ aptr = abuf + HFIXEDSZ; status = ares_expand_name (aptr, abuf, alen, &hostname, &len); if (status != ARES_SUCCESS) return status; if (aptr + len + QFIXEDSZ > abuf + alen) { ares_free (hostname); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; /* Examine each answer resource record (RR) in turn. */ for (i = 0; i < ancount; i++) { /* Decode the RR up to the data field. */ status = ares_expand_name (aptr, abuf, alen, &rr_name, &len); if (status != ARES_SUCCESS) { break; } aptr += len; if (aptr + RRFIXEDSZ > abuf + alen) { status = ARES_EBADRESP; break; } rr_type = DNS_RR_TYPE (aptr); rr_class = DNS_RR_CLASS (aptr); rr_len = DNS_RR_LEN (aptr); aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { status = ARES_EBADRESP; break; } /* Check if we are really looking at a TXT record */ if ((rr_class == C_IN || rr_class == C_CHAOS) && rr_type == T_TXT) { /* * There may be multiple substrings in a single TXT record. Each * substring may be up to 255 characters in length, with a * "length byte" indicating the size of the substring payload. * RDATA contains both the length-bytes and payloads of all * substrings contained therein. */ strptr = aptr; while (strptr < (aptr + rr_len)) { substr_len = (unsigned char)*strptr; if (strptr + substr_len + 1 > aptr + rr_len) { status = ARES_EBADRESP; break; } /* Allocate storage for this TXT answer appending it to the list */ txt_curr = ares_malloc_data(ex ? ARES_DATATYPE_TXT_EXT : ARES_DATATYPE_TXT_REPLY); if (!txt_curr) { status = ARES_ENOMEM; break; } if (txt_last) { txt_last->next = txt_curr; } else { txt_head = txt_curr; } txt_last = txt_curr; if (ex) txt_curr->record_start = (strptr == aptr); txt_curr->length = substr_len; txt_curr->txt = ares_malloc (substr_len + 1/* Including null byte */); if (txt_curr->txt == NULL) { status = ARES_ENOMEM; break; } ++strptr; memcpy ((char *) txt_curr->txt, strptr, substr_len); /* Make sure we NULL-terminate */ txt_curr->txt[substr_len] = 0; strptr += substr_len; } } /* Propagate any failures */ if (status != ARES_SUCCESS) { break; } /* Don't lose memory in the next iteration */ ares_free (rr_name); rr_name = NULL; /* Move on to the next record */ aptr += rr_len; } if (hostname) ares_free (hostname); if (rr_name) ares_free (rr_name); /* clean up on error */ if (status != ARES_SUCCESS) { if (txt_head) ares_free_data (txt_head); return status; } /* everything looks fine, return the data */ *txt_out = txt_head; return ARES_SUCCESS; } int ares_parse_txt_reply (const unsigned char *abuf, int alen, struct ares_txt_reply **txt_out) { return ares__parse_txt_reply(abuf, alen, 0, (void **) txt_out); } int ares_parse_txt_reply_ext (const unsigned char *abuf, int alen, struct ares_txt_ext **txt_out) { return ares__parse_txt_reply(abuf, alen, 1, (void **) txt_out); }
/* Copyright (C) 2015 Fabio Utzig This file is part of ChibiOS. ChibiOS 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. ChibiOS 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/>. */ /** * @file NRF51822/cmparams.h * @brief ARM Cortex-M0 parameters for the Nordic Semi NRF51822 family. * * @defgroup ARMCMx_NRF51x Nordic semiconductor NRF51x. * @ingroup ARMCMx_SPECIFIC * @details This file contains the Cortex-M0 specific parameters for the * NRF51x platform. * @{ */ #ifndef _CMPARAMS_H_ #define _CMPARAMS_H_ /** * @brief Cortex core model. */ #define CORTEX_MODEL 0 /** * @brief Memory Protection unit presence. */ #define CORTEX_HAS_MPU 1 /** * @brief Floating Point unit presence. */ #define CORTEX_HAS_FPU 0 /** * @brief Number of bits in priority masks. */ #define CORTEX_PRIORITY_BITS 2 /** * @brief Number of interrupt vectors. * @note This number does not include the 16 system vectors and must be * rounded to a multiple of 8. */ #define CORTEX_NUM_VECTORS 32 /* The following code is not processed when the file is included from an asm module.*/ #if !defined(_FROM_ASM_) /* Including the device CMSIS header. Note, we are not using the definitions from this header because we need this file to be usable also from assembler source files. We verify that the info matches instead.*/ #include "nrf51.h" #if CORTEX_MODEL != __CORTEX_M #error "CMSIS __CORTEX_M mismatch" #endif #if CORTEX_PRIORITY_BITS != __NVIC_PRIO_BITS #error "CMSIS __NVIC_PRIO_BITS mismatch" #endif #endif /* !defined(_FROM_ASM_) */ #endif /* _CMPARAMS_H_ */ /** @} */
/*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITK_WIIMOTEACTIVATOR_H_ #define MITK_WIIMOTEACTIVATOR_H_ // berry #include <berryIPreferences.h> #include <berryIPreferencesService.h> #include <berryPlatform.h> // mitk #include "mitkIInputDevice.h" #include "mitkWiiMoteVtkCameraController.h" #include <mitkWiiMoteInteractor.h> #include <mitkDataStorage.h> namespace mitk { class WiiMoteActivator : public IInputDevice { public: WiiMoteActivator(); ~WiiMoteActivator(); /** * @see mitk::IInputDevice::RegisterInputDevice() */ bool RegisterInputDevice(); /** * @see mitk::IInputDevice::UnRegisterInputDevice() */ bool UnRegisterInputDevice(); protected: private: bool m_IsRegistered; // listener for headtracking and interactor for surface interaction mitk::WiiMoteVtkCameraController::Pointer m_Controller; mitk::WiiMoteInteractor::Pointer m_Interactor; // for xml accesss berry::IPreferences::Pointer m_WiiMotePreferencesNode; berry::IPreferencesService::Pointer m_PrefService; // needed for surface interaction mitk::DataNode::Pointer m_Node; /** * Gets the current active data storage. <br> * * @return the current data storage, if it fails <code>NULL</code> */ mitk::DataStorage::Pointer GetDataStorage(); void AddSurfaceInteractor(); void RemoveSurfaceInteractor(); }; // end class WiiMoteActivator } // end namespace mitk #endif // MITK_WIIMOTEACTIVATOR_H_
/** * @file telnetInit.c * */ /* Embedded Xinu, Copyright (C) 2009. All rights reserved. */ #include <stddef.h> #include <device.h> #include <telnet.h> #include <stdlib.h> struct telnet telnettab[NTELNET]; /** * @ingroup telnet * * Initialize TELNET structures. * @param devptr TELNET device table entry * @return OK if device is initialized */ devcall telnetInit(device *devptr) { struct telnet *tntptr; tntptr = &telnettab[devptr->minor]; bzero(tntptr, sizeof(struct telnet)); if (0 == devptr->minor) { tntptr->killswitch = semcreate(0); } else { tntptr->killswitch = telnettab[0].killswitch; } return OK; }
// 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 MEDIA_AUDIO_SAMPLE_RATES_H_ #define MEDIA_AUDIO_SAMPLE_RATES_H_ #include "media/base/media_export.h" namespace media { // Enumeration used for histogramming sample rates into distinct buckets. enum AudioSampleRate { // Do not change the order of these values. k8000Hz = 0, k16000Hz = 1, k32000Hz = 2, k48000Hz = 3, k96000Hz = 4, k11025Hz = 5, k22050Hz = 6, k44100Hz = 7, kUnexpectedAudioSampleRate // Must always be last! }; // Helper method to convert integral values to their respective enum values, // or kUnexpectedAudioSampleRate if no match exists. MEDIA_EXPORT AudioSampleRate AsAudioSampleRate(int sample_rate); } // namespace media #endif // MEDIA_AUDIO_SAMPLE_RATES_H_
/* Copyright (c) 2006-2007 Christopher J. W. Lloyd 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/NSURLRequest.h> @interface NSMutableURLRequest : NSURLRequest -(void)setURL:(NSURL *)value; -(void)setCachePolicy:(NSURLRequestCachePolicy)value; -(void)setTimeoutInterval:(NSTimeInterval)value; -(void)setHTTPMethod:(NSString *)value; -(void)setHTTPBody:(NSData *)value; -(void)setHTTPBodyStream:(NSInputStream *)value; -(void)setAllHTTPHeaderFields:(NSDictionary *)allValues; -(void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field; -(void)addValue:(NSString *)value forHTTPHeaderField:(NSString *)field; -(void)setHTTPShouldHandleCookies:(BOOL)value; -(void)setMainDocumentURL:(NSURL *)value; @end
/* * Copyright (C) ST-Ericsson SA 2011 * * Author: Lee Jones <lee.jones@linaro.org> for ST-Ericsson. * License terms: GNU General Public License (GPL), version 2 */ #include <linux/sysfs.h> #include <linux/module.h> #include <linux/init.h> #include <linux/stat.h> #include <linux/slab.h> #include <linux/idr.h> #include <linux/spinlock.h> #include <linux/sys_soc.h> #include <linux/err.h> static DEFINE_IDA(soc_ida); static DEFINE_SPINLOCK(soc_lock); static ssize_t soc_info_get(struct device *dev, struct device_attribute *attr, char *buf); struct soc_device { struct device dev; struct soc_device_attribute *attr; int soc_dev_num; }; static struct bus_type soc_bus_type = { .name = "soc", }; static DEVICE_ATTR(machine, S_IRUGO, soc_info_get, NULL); static DEVICE_ATTR(family, S_IRUGO, soc_info_get, NULL); static DEVICE_ATTR(soc_id, S_IRUGO, soc_info_get, NULL); static DEVICE_ATTR(revision, S_IRUGO, soc_info_get, NULL); struct device *soc_device_to_device(struct soc_device *soc_dev) { return &soc_dev->dev; } static mode_t soc_attribute_mode(struct kobject *kobj, struct attribute *attr, int index) { struct device *dev = container_of(kobj, struct device, kobj); struct soc_device *soc_dev = container_of(dev, struct soc_device, dev); if ((attr == &dev_attr_machine.attr) && (soc_dev->attr->machine != NULL)) return attr->mode; if ((attr == &dev_attr_family.attr) && (soc_dev->attr->family != NULL)) return attr->mode; if ((attr == &dev_attr_revision.attr) && (soc_dev->attr->revision != NULL)) return attr->mode; if ((attr == &dev_attr_soc_id.attr) && (soc_dev->attr->soc_id != NULL)) return attr->mode; /* */ return 0; } static ssize_t soc_info_get(struct device *dev, struct device_attribute *attr, char *buf) { struct soc_device *soc_dev = container_of(dev, struct soc_device, dev); if (attr == &dev_attr_machine) return sprintf(buf, "%s\n", soc_dev->attr->machine); if (attr == &dev_attr_family) return sprintf(buf, "%s\n", soc_dev->attr->family); if (attr == &dev_attr_revision) return sprintf(buf, "%s\n", soc_dev->attr->revision); if (attr == &dev_attr_soc_id) return sprintf(buf, "%s\n", soc_dev->attr->soc_id); return -EINVAL; } static struct attribute *soc_attr[] = { &dev_attr_machine.attr, &dev_attr_family.attr, &dev_attr_soc_id.attr, &dev_attr_revision.attr, NULL, }; static const struct attribute_group soc_attr_group = { .attrs = soc_attr, .is_visible = soc_attribute_mode, }; static const struct attribute_group *soc_attr_groups[] = { &soc_attr_group, NULL, }; static void soc_release(struct device *dev) { struct soc_device *soc_dev = container_of(dev, struct soc_device, dev); kfree(soc_dev); } struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr) { struct soc_device *soc_dev; int ret; soc_dev = kzalloc(sizeof(*soc_dev), GFP_KERNEL); if (!soc_dev) { ret = -ENOMEM; goto out1; } /* */ do { if (!ida_pre_get(&soc_ida, GFP_KERNEL)) { ret = -ENOMEM; goto out2; } spin_lock(&soc_lock); ret = ida_get_new(&soc_ida, &soc_dev->soc_dev_num); spin_unlock(&soc_lock); } while (ret == -EAGAIN); if (ret) goto out2; soc_dev->attr = soc_dev_attr; soc_dev->dev.bus = &soc_bus_type; soc_dev->dev.groups = soc_attr_groups; soc_dev->dev.release = soc_release; dev_set_name(&soc_dev->dev, "soc%d", soc_dev->soc_dev_num); ret = device_register(&soc_dev->dev); if (ret) goto out3; return soc_dev; out3: ida_remove(&soc_ida, soc_dev->soc_dev_num); out2: kfree(soc_dev); out1: return ERR_PTR(ret); } /* */ void soc_device_unregister(struct soc_device *soc_dev) { ida_remove(&soc_ida, soc_dev->soc_dev_num); device_unregister(&soc_dev->dev); } static int __init soc_bus_register(void) { return bus_register(&soc_bus_type); } core_initcall(soc_bus_register); static void __exit soc_bus_unregister(void) { ida_destroy(&soc_ida); bus_unregister(&soc_bus_type); } module_exit(soc_bus_unregister);
/* * Copyright (C) 2008 Google, Inc. * Copyright (C) 2008 HTC Corporation * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * 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, you can find it at http://www.fsf.org. */ #ifndef _MSM_PCM_H #define _MSM_PCM_H #include <sound/apr_audio.h> #include <sound/q6asm.h> #define MAX_PLAYBACK_SESSIONS 2 #define MAX_CAPTURE_SESSIONS 1 #define MAX_COPP 12 extern int copy_count; struct buffer { void *data; unsigned size; unsigned used; unsigned addr; }; struct buffer_rec { void *data; unsigned int size; unsigned int read; unsigned int addr; }; struct audio_locks { wait_queue_head_t read_wait; wait_queue_head_t write_wait; wait_queue_head_t eos_wait; wait_queue_head_t enable_wait; }; extern struct audio_locks the_locks; struct msm_audio { struct snd_pcm_substream *substream; unsigned int pcm_size; unsigned int pcm_count; unsigned int pcm_irq_pos; /* */ uint16_t source; /* */ struct audio_client *audio_client; uint16_t session_id; int copp_id; uint32_t samp_rate; uint32_t channel_mode; uint32_t dsp_cnt; uint32_t device_events; /* */ int abort; /* */ int enabled; int close_ack; int cmd_ack; atomic_t start; atomic_t out_count; atomic_t in_count; atomic_t out_needed; int periods; int mmap_flag; }; struct pcm_session { unsigned short playback_session[MAX_PLAYBACK_SESSIONS][MAX_COPP]; unsigned short capture_session[MAX_CAPTURE_SESSIONS][MAX_COPP]; }; /* */ extern struct snd_soc_platform_driver msm_soc_platform; extern struct pcm_session session_route; #endif /* */
/* Copyright (C) 2006 - 2013 ScriptDev2 <http://www.scriptdev2.com/> * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ #ifndef DEF_GRUULS_LAIR_H #define DEF_GRUULS_LAIR_H enum { MAX_ENCOUNTER = 2, MAX_COUNCIL = 5, // Encounter Status TYPE_MAULGAR_EVENT = 0, TYPE_GRUUL_EVENT = 1, GO_PORT_GRONN_1 = 183817, // 184468 not in use GO_PORT_GRONN_2 = 184662, // NPC GUIDs NPC_MAULGAR = 18831, // NPC_BLINDEYE = 18836, // NPC_KIGGLER = 18835, // NPC_KROSH = 18832, // NPC_OLM = 18834, }; class MANGOS_DLL_DECL instance_gruuls_lair : public ScriptedInstance { public: instance_gruuls_lair(Map* pMap); void Initialize() override; bool IsEncounterInProgress() const override; void OnCreatureCreate(Creature* pCreature) override; void OnObjectCreate(GameObject* pGo) override; void SetData(uint32 uiType, uint32 uiData) override; uint32 GetData(uint32 uiType) const override; const char* Save() const override { return m_strSaveData.c_str(); } void Load(const char* chrIn) override; private: uint32 m_auiEncounter[MAX_ENCOUNTER]; std::string m_strSaveData; uint8 m_uiCouncilMembersDied; }; #endif
/* Copyright (C) 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. 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/>. */ #define DATABASE_NAME aliases #include "XXX-lookup.c"
/* Open a file by name. NaCl version. Copyright (C) 2015 Free Software Foundation, Inc. This file is part of the GNU C Library. 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 <fcntl.h> #include <stdarg.h> #include <stdio.h> #include <nacl-interfaces.h> /* Open FILE with access OFLAG. If OFLAG includes O_CREAT, a third argument is the file protection. */ int __libc_open (const char *file, int oflag, ...) { mode_t mode = 0; if (oflag & O_CREAT) { va_list arg; va_start (arg, oflag); mode = va_arg (arg, mode_t); va_end (arg); } int fd; return NACL_CALL (__nacl_irt_dev_filename.open (file, oflag, mode, &fd), fd); } libc_hidden_def (__libc_open) weak_alias (__libc_open, __open) libc_hidden_weak (__open) weak_alias (__libc_open, open) /* open64 is just an alias. */ strong_alias (__libc_open, __libc_open64) strong_alias (__libc_open64, __open64) libc_hidden_def (__open64) weak_alias (__libc_open64, open64)
/* * Cavium Networks CNS3420 Validation Board * * Copyright 2000 Deep Blue Solutions Ltd * Copyright 2008 ARM Limited * Copyright 2008 Cavium Networks * Scott Shu * Copyright 2010 MontaVista Software, LLC. * Anton Vorontsov <avorontsov@mvista.com> * * This file 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. */ #include <linux/init.h> #include <linux/kernel.h> #include <linux/compiler.h> #include <linux/io.h> #include <linux/dma-mapping.h> #include <linux/serial_core.h> #include <linux/serial_8250.h> #include <linux/platform_device.h> #include <linux/mtd/mtd.h> #include <linux/mtd/physmap.h> #include <linux/mtd/partitions.h> #include <asm/setup.h> #include <asm/mach-types.h> #include <asm/hardware/gic.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/time.h> #include <mach/cns3xxx.h> #include <mach/irqs.h> #include "core.h" #include "devices.h" /* */ static struct mtd_partition cns3420_nor_partitions[] = { { .name = "uboot", .size = 0x00040000, .offset = 0, .mask_flags = MTD_WRITEABLE, }, { .name = "kernel", .size = 0x004C0000, .offset = MTDPART_OFS_APPEND, }, { .name = "filesystem", .size = 0x7000000, .offset = MTDPART_OFS_APPEND, }, { .name = "filesystem2", .size = 0x0AE0000, .offset = MTDPART_OFS_APPEND, }, { .name = "ubootenv", .size = MTDPART_SIZ_FULL, .offset = MTDPART_OFS_APPEND, }, }; static struct physmap_flash_data cns3420_nor_pdata = { .width = 2, .parts = cns3420_nor_partitions, .nr_parts = ARRAY_SIZE(cns3420_nor_partitions), }; static struct resource cns3420_nor_res = { .start = CNS3XXX_FLASH_BASE, .end = CNS3XXX_FLASH_BASE + SZ_128M - 1, .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT, }; static struct platform_device cns3420_nor_pdev = { .name = "physmap-flash", .id = 0, .resource = &cns3420_nor_res, .num_resources = 1, .dev = { .platform_data = &cns3420_nor_pdata, }, }; /* */ static void __init cns3420_early_serial_setup(void) { #ifdef CONFIG_SERIAL_8250_CONSOLE static struct uart_port cns3420_serial_port = { .membase = (void __iomem *)CNS3XXX_UART0_BASE_VIRT, .mapbase = CNS3XXX_UART0_BASE, .irq = IRQ_CNS3XXX_UART0, .iotype = UPIO_MEM, .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE, .regshift = 2, .uartclk = 24000000, .line = 0, .type = PORT_16550A, .fifosize = 16, }; early_serial_setup(&cns3420_serial_port); #endif } /* */ static struct resource cns3xxx_usb_ehci_resources[] = { [0] = { .start = CNS3XXX_USB_BASE, .end = CNS3XXX_USB_BASE + SZ_16M - 1, .flags = IORESOURCE_MEM, }, [1] = { .start = IRQ_CNS3XXX_USB_EHCI, .flags = IORESOURCE_IRQ, }, }; static u64 cns3xxx_usb_ehci_dma_mask = DMA_BIT_MASK(32); static struct platform_device cns3xxx_usb_ehci_device = { .name = "cns3xxx-ehci", .num_resources = ARRAY_SIZE(cns3xxx_usb_ehci_resources), .resource = cns3xxx_usb_ehci_resources, .dev = { .dma_mask = &cns3xxx_usb_ehci_dma_mask, .coherent_dma_mask = DMA_BIT_MASK(32), }, }; static struct resource cns3xxx_usb_ohci_resources[] = { [0] = { .start = CNS3XXX_USB_OHCI_BASE, .end = CNS3XXX_USB_OHCI_BASE + SZ_16M - 1, .flags = IORESOURCE_MEM, }, [1] = { .start = IRQ_CNS3XXX_USB_OHCI, .flags = IORESOURCE_IRQ, }, }; static u64 cns3xxx_usb_ohci_dma_mask = DMA_BIT_MASK(32); static struct platform_device cns3xxx_usb_ohci_device = { .name = "cns3xxx-ohci", .num_resources = ARRAY_SIZE(cns3xxx_usb_ohci_resources), .resource = cns3xxx_usb_ohci_resources, .dev = { .dma_mask = &cns3xxx_usb_ohci_dma_mask, .coherent_dma_mask = DMA_BIT_MASK(32), }, }; /* */ static struct platform_device *cns3420_pdevs[] __initdata = { &cns3420_nor_pdev, &cns3xxx_usb_ehci_device, &cns3xxx_usb_ohci_device, }; static void __init cns3420_init(void) { cns3xxx_l2x0_init(); platform_add_devices(cns3420_pdevs, ARRAY_SIZE(cns3420_pdevs)); cns3xxx_ahci_init(); cns3xxx_sdhci_init(); pm_power_off = cns3xxx_power_off; } static struct map_desc cns3420_io_desc[] __initdata = { { .virtual = CNS3XXX_UART0_BASE_VIRT, .pfn = __phys_to_pfn(CNS3XXX_UART0_BASE), .length = SZ_4K, .type = MT_DEVICE, }, }; static void __init cns3420_map_io(void) { cns3xxx_map_io(); iotable_init(cns3420_io_desc, ARRAY_SIZE(cns3420_io_desc)); cns3420_early_serial_setup(); } MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board") .atag_offset = 0x100, .map_io = cns3420_map_io, .init_irq = cns3xxx_init_irq, .timer = &cns3xxx_timer, .handle_irq = gic_handle_irq, .init_machine = cns3420_init, .restart = cns3xxx_restart, MACHINE_END
/* * Copyright (C) 2008 Tobias Brunner * 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 kernel_klips kernel_klips * @ingroup hplugins * * @defgroup kernel_klips_plugin kernel_klips_plugin * @{ @ingroup kernel_klips */ #ifndef KERNEL_KLIPS_PLUGIN_H_ #define KERNEL_KLIPS_PLUGIN_H_ #include <plugins/plugin.h> typedef struct kernel_klips_plugin_t kernel_klips_plugin_t; /** * PF_KEY kernel interface plugin */ struct kernel_klips_plugin_t { /** * implements plugin interface */ plugin_t plugin; }; #endif /** KERNEL_KLIPS_PLUGIN_H_ @}*/
#ifndef __USBAUDIO_ENDPOINT_H #define __USBAUDIO_ENDPOINT_H void snd_usb_init_substream(struct snd_usb_stream *as, int stream, struct audioformat *fp); int snd_usb_init_substream_urbs(struct snd_usb_substream *subs, unsigned int period_bytes, unsigned int rate, unsigned int frame_bits); void snd_usb_release_substream_urbs(struct snd_usb_substream *subs, int force); int snd_usb_substream_prepare(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime); int snd_usb_substream_playback_trigger(struct snd_pcm_substream *substream, int cmd); int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream, int cmd); #endif /* */
#include <linux/version.h> #include <linux/module.h> #include <linux/types.h> #include <linux/delay.h> #include <linux/kernel.h> #include <linux/interrupt.h> #include <linux/fs.h> #include <linux/init.h> #include <linux/device.h> #include <linux/mm.h> #include <linux/major.h> #include <linux/mutex.h> #include <linux/cdev.h> #include "mach_reg.h" #define __asmeq(x, y) ".ifnc " x "," y " ; .err ; .endif\n\t" void sec_reg_write(unsigned *addr, unsigned value) { register long x0 asm("x0") = 0x82000019; register long x1 asm("x1") = (unsigned long)addr; register long x2 asm("x2") = value; asm volatile( __asmeq("%0", "x0") __asmeq("%1", "x1") __asmeq("%2", "x2") "smc #0\n" : : "r"(x0), "r"(x1), "r"(x2) ); } unsigned sec_reg_read(unsigned *addr) { register long x0 asm("x0") = 0x82000018; register long x1 asm("x1") = (unsigned long)addr; asm volatile( __asmeq("%0", "x0") __asmeq("%1", "x1") "smc #0\n" : "+r"(x0) : "r"(x1) ); return (unsigned)(x0&0xffffffff); }
/* * fb-background-monitor.h: * * Copyright (C) 2001, 2002 Ian McKellar <yakk@yakk.net> * 2002 Sun Microsystems, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. * * Authors: * Ian McKellar <yakk@yakk.net> * Mark McLoughlin <mark@skynet.ie> */ #ifndef __FB_BG_H__ #define __FB_BG_H__ /* FIXME: this needs to be made multiscreen aware * panel_bg_get should take * a GdkScreen argument. */ #include <glib.h> #include <glib-object.h> #include <gtk/gtk.h> #define FB_TYPE_BG (fb_bg_get_type ()) #define FB_BG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), \ FB_TYPE_BG, \ FbBg)) #define FB_BG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), \ FB_TYPE_BG, \ FbBgClass)) #define FB_IS_BG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \ FB_TYPE_BG)) #define FB_IS_BG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), \ FB_TYPE_BG)) #define FB_BG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \ FB_TYPE_BG, \ FbBgClass)) typedef struct _FbBgClass FbBgClass; typedef struct _FbBg FbBg; GType fb_bg_get_type (void); #define fb_bg_new() (FbBg *)g_object_new(FB_TYPE_BG, NULL) void fb_bg_composite(GdkDrawable *base, GdkColor *tintcolor, gint alpha); GdkPixmap *fb_bg_get_xroot_pix_for_win(FbBg *bg, GtkWidget *widget); void fb_bg_notify_changed_bg(FbBg *bg); FbBg *fb_bg_get_for_display(void); GdkPixmap *fb_bg_get_pix_from_file(GtkWidget *widget, const char *filename); #endif /* __FB_BG_H__ */