text
stringlengths
4
6.14k
/* * libtu/locale.h * * Copyright (c) Tuomo Valkonen 2004. * * You may distribute and modify this library under the terms of either * the Clarified Artistic License or the GNU LGPL, version 2.1 or later. */ #ifndef LIBTU_LOCALE_H #define LIBTU_LOCALE_H #ifdef CF_NO_GETTEXT #define TR(X) X #define DUMMY_TR(X) X #else #include <libintl.h> #define TR(X) gettext(X) #define DUMMY_TR(X) X #endif #endif /* LIBTU_LOCALE_H */
/* /% C++ %/ */ /*********************************************************************** * cint (C/C++ interpreter) ************************************************************************ * Header file MethodAr.h ************************************************************************ * Description: * Extended Run Time Type Identification API ************************************************************************ * Copyright(c) 1995~1999 Masaharu Goto * * For the licensing terms see the file COPYING * ************************************************************************/ #ifndef G__METHODARGINFO_H #define G__METHODARGINFO_H #ifndef G__API_H #include "Api.h" #endif namespace Cint { /********************************************************************* * class G__MethodArgInfo * * *********************************************************************/ class #ifndef __CINT__ G__EXPORT #endif G__MethodArgInfo { public: ~G__MethodArgInfo() {} void Init(class G__MethodInfo &a); G__MethodArgInfo(class G__MethodInfo &a) : argn(0), belongingmethod(NULL), type() { Init(a); } G__MethodArgInfo(const G__MethodArgInfo& mai) : argn(mai.argn), belongingmethod(mai.belongingmethod), type(mai.type) { } G__MethodArgInfo& operator=(const G__MethodArgInfo& mai) { if (&mai != this) { argn=mai.argn; belongingmethod=mai.belongingmethod; type=mai.type; } return *this;} const char *Name(); G__TypeInfo* Type() { return(&type); } long Property(); char *DefaultValue(); G__MethodInfo* ArgOf() { return(belongingmethod); } int IsValid(); int Next(); private: long argn; G__MethodInfo *belongingmethod; G__TypeInfo type; public: G__MethodArgInfo(): argn(0), belongingmethod(NULL), type() {} }; } // namespace Cint using namespace Cint; #endif
/* * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2018-11-5 zylx first version */ #ifndef __BOARD_H__ #define __BOARD_H__ #include <rtthread.h> #include <stm32f4xx.h> #include "drv_common.h" #include "drv_gpio.h" #ifdef __cplusplus extern "C" { #endif #define STM32_SRAM_SIZE (192) #define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024) #define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000) #define STM32_FLASH_SIZE (2 * 1024 * 1024) #define STM32_FLASH_END_ADDRESS ((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE)) #if defined(__CC_ARM) || defined(__CLANG_ARM) extern int Image$$RW_IRAM1$$ZI$$Limit; #define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit) #elif __ICCARM__ #pragma section="CSTACK" #define HEAP_BEGIN (__segment_end("CSTACK")) #else extern int __bss_end; #define HEAP_BEGIN (&__bss_end) #endif #define HEAP_END STM32_SRAM_END /* Board Pin definitions */ #define LED0_PIN GET_PIN(B, 1) #define LED1_PIN GET_PIN(B, 0) void SystemClock_Config(void); void MX_GPIO_Init(void); #ifdef __cplusplus } #endif #endif
/* * Copyright (c) 2019-2020 SparkFun Electronics * SPDX-License-Identifier: MIT * * 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. */ /* MBED TARGET LIST: SFE_ARTEMIS_MODULE */ #ifndef MBED_PINNAMES_H #define MBED_PINNAMES_H #include "am_bsp.h" #include "objects_gpio.h" #ifdef __cplusplus extern "C" { #endif #define NC_VAL (int)0xFFFFFFFF typedef enum { // Digital naming D0 = 0, D1 = 1, D2 = 2, D3 = 3, D4 = 4, D5 = 5, D6 = 6, D7 = 7, D8 = 8, D9 = 9, D10 = 10, D11 = 11, D12 = 12, D13 = 13, D14 = 14, D15 = 15, D16 = 16, D17 = 17, D18 = 18, D19 = 19, D20 = 20, D21 = 21, D22 = 22, D23 = 23, D24 = 24, D25 = 25, D26 = 26, D27 = 27, D28 = 28, D29 = 29, // D30 = NC D31 = 31, D32 = 32, D33 = 33, D34 = 34, D35 = 35, D36 = 36, D37 = 37, D38 = 38, D39 = 39, D40 = 40, D41 = 41, D42 = 42, D43 = 43, D44 = 44, D45 = 45, // Analog naming A11 = D11, A12 = D12, A13 = D13, A16 = D16, A29 = D29, A31 = D31, A32 = D32, A33 = D33, A34 = D34, A35 = D35, LED1 = D1, SERIAL_TX = 48, SERIAL_RX = 49, CONSOLE_TX = SERIAL_TX, CONSOLE_RX = SERIAL_RX, // Not connected NC = NC_VAL } PinName; #if defined(MBED_CONF_TARGET_STDIO_UART_TX) #define STDIO_UART_TX MBED_CONF_TARGET_STDIO_UART_TX #else #define STDIO_UART_TX CONSOLE_TX #endif #if defined(MBED_CONF_TARGET_STDIO_UART_RX) #define STDIO_UART_RX MBED_CONF_TARGET_STDIO_UART_RX #else #define STDIO_UART_RX CONSOLE_RX #endif #ifdef __cplusplus } #endif #endif
/* 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_CORE_PROFILER_UTILS_STEP_INTERSECTION_H_ #define TENSORFLOW_CORE_PROFILER_UTILS_STEP_INTERSECTION_H_ #include <algorithm> #include "absl/container/flat_hash_map.h" #include "tensorflow/core/platform/types.h" #include "tensorflow/core/profiler/protobuf/steps_db.pb.h" namespace tensorflow { namespace profiler { // Description of how two step sequences are aligned. struct StepsAlignment { uint32 begin_subordinate_idx; // where the alignment begins on the // subordinate steps. uint32 begin_chief_idx; // where the alignment begins on the chief steps. uint32 num_steps; // aligned for how many steps. }; class StepIntersection { public: StepIntersection( uint32 max_steps, const absl::flat_hash_map</*host_id=*/uint32, const StepDatabaseResult*>& perhost_stepdb); // Returns the number of steps in the intersection. uint32 NumSteps() const { return end_chief_idx_ - begin_chief_idx_; } // Returns the step numbers for the destination (i.e. the intersection // result). std::vector<uint32> DstStepNumbers() const; // Returns the index to the step in the given host that corresponds to the // first step in the intersection. uint32 FirstStepIndex(uint32 host_id) const; // Returns the number of steps dropped due to the max_steps constraint // specified in the constructor. uint32 StepsDropped() const { return steps_dropped_; } std::string DebugString() const; private: absl::flat_hash_map</*host_id=*/uint32, StepsAlignment> perhost_alignment_; uint32 chief_host_id_; // the host whose step sequence is selected as the chief. uint32 steps_dropped_; // number of steps dropped. // The begin and end indices to the chief step sequence for this step // intersection. Note that the begin index is inclusive but the end index is // exclusive. uint32 begin_chief_idx_; uint32 end_chief_idx_; }; } // namespace profiler } // namespace tensorflow #endif // TENSORFLOW_CORE_PROFILER_UTILS_STEP_INTERSECTION_H_
/* * * Copyright 2015 gRPC authors. * * 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 GRPC_IMPL_CODEGEN_SYNC_WINDOWS_H #define GRPC_IMPL_CODEGEN_SYNC_WINDOWS_H // IWYU pragma: private, include <grpc/support/sync.h> #include <grpc/impl/codegen/port_platform.h> #ifdef GPR_WINDOWS #include <grpc/impl/codegen/sync_generic.h> typedef struct { CRITICAL_SECTION cs; /* Not an SRWLock until Vista is unsupported */ int locked; } gpr_mu; typedef CONDITION_VARIABLE gpr_cv; typedef INIT_ONCE gpr_once; #define GPR_ONCE_INIT INIT_ONCE_STATIC_INIT #endif /* GPR_WINDOWS */ #endif /* GRPC_IMPL_CODEGEN_SYNC_WINDOWS_H */
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_REQUEST_VIEW_BASE_H_ #define COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_REQUEST_VIEW_BASE_H_ #include <sstream> #include <string> #include <vector> #include "base/memory/scoped_ptr.h" #include "components/dom_distiller/core/distilled_page_prefs.h" #include "components/dom_distiller/core/dom_distiller_service.h" #include "components/dom_distiller/core/task_tracker.h" namespace dom_distiller { // Handles receiving data asynchronously for a specific entry, and passing // it along to the data callback for the data source. Lifetime matches that of // the current main frame's page in the Viewer instance. class DomDistillerRequestViewBase : public ViewRequestDelegate, public DistilledPagePrefs::Observer { public: explicit DomDistillerRequestViewBase( DistilledPagePrefs* distilled_page_prefs); ~DomDistillerRequestViewBase() override; // Flag this request as an error and send the error page template. void FlagAsErrorPage(); // Get if this viewer is in an error state. bool IsErrorPage(); // ViewRequestDelegate implementation: void OnArticleReady(const DistilledArticleProto* article_proto) override; void OnArticleUpdated(ArticleDistillationUpdate article_update) override; void TakeViewerHandle(scoped_ptr<ViewerHandle> viewer_handle); protected: // DistilledPagePrefs::Observer implementation: void OnChangeFontFamily( DistilledPagePrefs::FontFamily new_font_family) override; void OnChangeTheme(DistilledPagePrefs::Theme new_theme) override; // Sends JavaScript to the attached Viewer, buffering data if the viewer isn't // ready. virtual void SendJavaScript(const std::string& buffer) = 0; // The handle to the view request towards the DomDistillerService. It // needs to be kept around to ensure the distillation request finishes. scoped_ptr<ViewerHandle> viewer_handle_; // Number of pages of the distilled article content that have been rendered by // the viewer. int page_count_; // Interface for accessing preferences for distilled pages. DistilledPagePrefs* distilled_page_prefs_; // Flag to tell this observer that the web contents are in an error state. bool is_error_page_; }; } // namespace dom_distiller #endif // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_REQUEST_VIEW_BASE_H_
#import <Foundation/Foundation.h> #import <Cordova/CDVPlugin.h> #import "SSZipArchive.h" @interface Zip : CDVPlugin <SSZipArchiveDelegate> { @private CDVInvokedUrlCommand* _command; } - (void)unzip:(CDVInvokedUrlCommand*)command; - (void)zipArchiveProgressEvent:(NSInteger)loaded total:(NSInteger)total; @end
/* * Copyright © 2020 Google, Inc. * * This is part of HarfBuzz, a text shaping library. * * Permission is hereby granted, without written agreement and without * license or royalty fees, to use, copy, modify, and distribute this * software and its documentation for any purpose, provided that the * above copyright notice and the following two paragraphs appear in * all copies of this software. * * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * Google Author(s): Calder Kitagawa */ #include "hb-test.h" #include "hb-subset-test.h" /* Unit tests for CBDT/CBLC subsetting */ static void test_subset_cbdt_noop (void) { hb_face_t *face = hb_test_open_font_file ("fonts/NotoColorEmoji.subset.ttf"); hb_set_t *codepoints = hb_set_create (); hb_face_t *face_subset; hb_set_add (codepoints, 0x38); hb_set_add (codepoints, 0x39); hb_set_add (codepoints, 0xAE); hb_set_add (codepoints, 0x2049); hb_set_add (codepoints, 0x20E3); face_subset = hb_subset_test_create_subset (face, hb_subset_test_create_input (codepoints)); hb_set_destroy (codepoints); hb_subset_test_check (face, face_subset, HB_TAG ('C','B','L','C')); hb_subset_test_check (face, face_subset, HB_TAG ('C','B','D','T')); hb_face_destroy (face_subset); hb_face_destroy (face); } static void test_subset_cbdt_keep_one (void) { hb_face_t *face = hb_test_open_font_file ("fonts/NotoColorEmoji.subset.ttf"); hb_face_t *face_expected = hb_test_open_font_file ("fonts/NotoColorEmoji.subset.default.39.ttf"); hb_set_t *codepoints = hb_set_create (); hb_face_t *face_subset; hb_set_add (codepoints, 0x39); face_subset = hb_subset_test_create_subset (face, hb_subset_test_create_input (codepoints)); hb_set_destroy (codepoints); hb_subset_test_check (face_expected, face_subset, HB_TAG ('C','B','L','C')); hb_subset_test_check (face_expected, face_subset, HB_TAG ('C','B','D','T')); hb_face_destroy (face_subset); hb_face_destroy (face_expected); hb_face_destroy (face); } static void test_subset_cbdt_keep_one_last_subtable (void) { hb_face_t *face = hb_test_open_font_file ("fonts/NotoColorEmoji.subset.ttf"); hb_face_t *face_expected = hb_test_open_font_file ("fonts/NotoColorEmoji.subset.default.2049.ttf"); hb_set_t *codepoints = hb_set_create (); hb_face_t *face_subset; hb_set_add (codepoints, 0x2049); face_subset = hb_subset_test_create_subset (face, hb_subset_test_create_input (codepoints)); hb_set_destroy (codepoints); hb_subset_test_check (face_expected, face_subset, HB_TAG ('C','B','L','C')); hb_subset_test_check (face_expected, face_subset, HB_TAG ('C','B','D','T')); hb_face_destroy (face_subset); hb_face_destroy (face_expected); hb_face_destroy (face); } static void test_subset_cbdt_keep_multiple_subtables (void) { hb_face_t *face = hb_test_open_font_file ("fonts/NotoColorEmoji.subset.multiple_size_tables.ttf"); hb_face_t *face_expected = hb_test_open_font_file ("fonts/NotoColorEmoji.subset.multiple_size_tables.default.38,AE,2049.ttf"); hb_set_t *codepoints = hb_set_create (); hb_face_t *face_subset; hb_set_add (codepoints, 0x38); hb_set_add (codepoints, 0xAE); hb_set_add (codepoints, 0x2049); face_subset = hb_subset_test_create_subset (face, hb_subset_test_create_input (codepoints)); hb_set_destroy (codepoints); hb_subset_test_check (face_expected, face_subset, HB_TAG ('C','B','L','C')); hb_subset_test_check (face_expected, face_subset, HB_TAG ('C','B','D','T')); hb_face_destroy (face_subset); hb_face_destroy (face_expected); hb_face_destroy (face); } static void test_subset_cbdt_index_format_3 (void) { hb_face_t *face = hb_test_open_font_file ("fonts/NotoColorEmoji.subset.index_format3.ttf"); hb_face_t *face_expected = hb_test_open_font_file ("fonts/NotoColorEmoji.subset.index_format3.default.38,AE,2049.ttf"); hb_set_t *codepoints = hb_set_create (); hb_face_t *face_subset; hb_set_add (codepoints, 0x38); hb_set_add (codepoints, 0xAE); hb_set_add (codepoints, 0x2049); face_subset = hb_subset_test_create_subset (face, hb_subset_test_create_input (codepoints)); hb_set_destroy (codepoints); hb_subset_test_check (face_expected, face_subset, HB_TAG ('C','B','L','C')); hb_subset_test_check (face_expected, face_subset, HB_TAG ('C','B','D','T')); hb_face_destroy (face_subset); hb_face_destroy (face_expected); hb_face_destroy (face); } // TODO: add support/tests for index formats 2,4,5 (image formats are treated as // opaque blobs when subsetting so don't need to be tested separately). // TODO: add a test that keeps no codepoints. int main (int argc, char **argv) { hb_test_init (&argc, &argv); hb_test_add (test_subset_cbdt_noop); hb_test_add (test_subset_cbdt_keep_one); hb_test_add (test_subset_cbdt_keep_one_last_subtable); // The following use manually crafted expectation files as they are not // binary compatible with FontTools. hb_test_add (test_subset_cbdt_keep_multiple_subtables); // Can use FontTools after https://github.com/fonttools/fonttools/issues/1817 // is resolved. hb_test_add (test_subset_cbdt_index_format_3); return hb_test_run(); }
#ifndef ALIPI0EVENTSTATSTRUCT_H #define ALIPI0EVENTSTATSTRUCT_H #include <TObject.h> /// \class Alipi0EventStatStruct /// \brief Event information structure pion/eta in PbPb /// /// \author Astrid Morreale astridmorreale@cern.ch subatech /// \date April 10 2015 class EventStatStruct: public TObject { public: /// object name (re-implemented) virtual const char* GetName() const { return "eventStatStruct"; } EventStatStruct( void): kAllMB(kFALSE), isPileup(kFALSE), isMB(kFALSE), isAnyINT(kFALSE), isCentral(kFALSE), isSemiCentral(kFALSE), isEga(kFALSE), CentralityVZERO(0), CentralitySPD(0), multiplicity(0), runNumber(0), nV(0), vX(0), vY(0), vZ(0) {} Bool_t kAllMB; Bool_t isPileup; Bool_t isMB; Bool_t isAnyINT; Bool_t isCentral; Bool_t isSemiCentral; Bool_t isEga; Float_t CentralityVZERO; Float_t CentralitySPD; Int_t multiplicity; Int_t runNumber; Int_t nV; Float_t vX; Float_t vY; Float_t vZ; ClassDef(EventStatStruct,1) }; #endif
/* * Copyright (c) 2021, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef TRF_H #define TRF_H void trf_enable(void); #endif /* TRF_H */
/* * Copyright (c) 2014, Ford Motor Company * 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 the Ford Motor Company 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 HOLDER 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 SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ARRAY_SCHEMA_ITEM_H_ #define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ARRAY_SCHEMA_ITEM_H_ #include <stddef.h> #include "utils/shared_ptr.h" #include "smart_objects/schema_item.h" #include "smart_objects/always_true_schema_item.h" #include "smart_objects/schema_item_parameter.h" namespace NsSmartDeviceLink { namespace NsSmartObjects { /** * @brief Array schema item. **/ class CArraySchemaItem : public ISchemaItem { public: /** * @brief Create a new schema item. * * @param ElementSchemaItem SchemaItem for array elements. * @param MinSize Minimum allowed size. * @param MaxSize Maximum allowed size. * * @return Shared pointer to a new schema item. **/ static utils::SharedPtr<CArraySchemaItem> create( const ISchemaItemPtr ElementSchemaItem = CAlwaysTrueSchemaItem::create(), const TSchemaItemParameter<size_t>& MinSize = TSchemaItemParameter<size_t>(), const TSchemaItemParameter<size_t>& MaxSize = TSchemaItemParameter<size_t>()); /** * @brief Validate smart object. * * @param Object Object to validate. * * @return NsSmartObjects::Errors::eType **/ Errors::eType validate(const SmartObject& Object) OVERRIDE; /** * @brief Apply schema. * * @param Object Object to apply schema. * * @param RemoveFakeParameters contains true if need to remove fake parameters * from smart object otherwise contains false. **/ void applySchema(SmartObject& Object, const bool RemoveFakeParameters) OVERRIDE; /** * @brief Unapply schema. * * @param Object Object to unapply schema. **/ void unapplySchema(SmartObject& Object) OVERRIDE; /** * @brief Build smart object by smart schema having copied matched * parameters from pattern smart object * * @param pattern_object pattern object * @param result_object object to build */ void BuildObjectBySchema(const SmartObject& pattern_object, SmartObject& result_object) OVERRIDE; private: /** * @brief Constructor. * * @param ElementSchemaItem SchemaItem for array elements. * @param MinSize Minimum allowed size. * @param MaxSize Maximum allowed size. **/ CArraySchemaItem(const ISchemaItemPtr ElementSchemaItem, const TSchemaItemParameter<size_t>& MinSize, const TSchemaItemParameter<size_t>& MaxSize); /** * @brief SchemaItem for array elements. **/ const ISchemaItemPtr mElementSchemaItem; /** * @brief Minimum allowed size. **/ const TSchemaItemParameter<size_t> mMinSize; /** * @brief Maximum allowed size. **/ const TSchemaItemParameter<size_t> mMaxSize; DISALLOW_COPY_AND_ASSIGN(CArraySchemaItem); }; } // namespace NsSmartObjects } // namespace NsSmartDeviceLink #endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ARRAY_SCHEMA_ITEM_H_
// Copyright 2017 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 IOS_CHROME_BROWSER_FIND_IN_PAGE_FIND_TAB_HELPER_H_ #define IOS_CHROME_BROWSER_FIND_IN_PAGE_FIND_TAB_HELPER_H_ #include <Foundation/Foundation.h> #include "base/ios/block_types.h" #include "base/scoped_observation.h" #include "ios/web/public/web_state_observer.h" #import "ios/web/public/web_state_user_data.h" @class FindInPageController; @class FindInPageModel; @protocol FindInPageResponseDelegate; // Adds support for the "Find in page" feature. class FindTabHelper : public web::WebStateObserver, public web::WebStateUserData<FindTabHelper> { public: FindTabHelper(const FindTabHelper&) = delete; FindTabHelper& operator=(const FindTabHelper&) = delete; ~FindTabHelper() override; enum FindDirection { FORWARD, REVERSE, }; // Sets the FindInPageResponseDelegate delegate to send responses to // StartFinding(), ContinueFinding(), and StopFinding(). void SetResponseDelegate(id<FindInPageResponseDelegate> response_delegate); // Starts an asynchronous Find operation that will call the given completion // handler with results. Highlights matches on the current page. Always // searches in the FORWARD direction. void StartFinding(NSString* search_string); // Runs an asynchronous Find operation that will call the given completion // handler with results. Highlights matches on the current page. Uses the // previously remembered search string and searches in the given |direction|. void ContinueFinding(FindDirection direction); // Stops any running find operations and runs the given completion block. // Removes any highlighting from the current page. void StopFinding(); // Returns the FindInPageModel that contains the latest find results. FindInPageModel* GetFindResult() const; // Returns true if the currently loaded page supports Find in Page. bool CurrentPageSupportsFindInPage() const; // Returns true if the Find in Page UI is currently visible. bool IsFindUIActive() const; // Marks the Find in Page UI as visible or not. This method does not directly // show or hide the UI. It simply acts as a marker for whether or not the UI // is visible. void SetFindUIActive(bool active); // Saves the current find text to persistent storage. void PersistSearchTerm(); // Restores the current find text from persistent storage. void RestoreSearchTerm(); private: friend class FindTabHelperTest; friend class web::WebStateUserData<FindTabHelper>; // Private constructor used by CreateForWebState(). FindTabHelper(web::WebState* web_state); // Create the FindInPageController for |web_state|. Only called if/when // the WebState is realized. void CreateFindInPageController(web::WebState* web_state); // web::WebStateObserver. void WebStateRealized(web::WebState* web_state) override; void WebStateDestroyed(web::WebState* web_state) override; void DidFinishNavigation(web::WebState* web_state, web::NavigationContext* navigation_context) override; // The ObjC find in page controller (nil if the WebState is not realized). FindInPageController* controller_ = nil; // The delegate to register with FindInPageController when it is created. __weak id<FindInPageResponseDelegate> response_delegate_ = nil; // Manage the registration of this instance as a WebStateObserver. base::ScopedObservation<web::WebState, web::WebStateObserver> observation_{ this}; WEB_STATE_USER_DATA_KEY_DECL(); }; #endif // IOS_CHROME_BROWSER_FIND_IN_PAGE_FIND_TAB_HELPER_H_
/* Copyright (c) 2001-2011 Timothy B. Terriberry Copyright (c) 2008-2009 Xiph.Org Foundation */ /* 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. 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. */ #include "opus_types.h" #include "opus_defines.h" #if !defined(_entcode_H) # define _entcode_H (1) # include <limits.h> # include <stddef.h> # include "ecintrin.h" /*OPT: ec_window must be at least 32 bits, but if you have fast arithmetic on a larger type, you can speed up the decoder by using it here.*/ typedef opus_uint32 ec_window; typedef struct ec_ctx ec_ctx; typedef struct ec_ctx ec_enc; typedef struct ec_ctx ec_dec; # define EC_WINDOW_SIZE ((int)sizeof(ec_window)*CHAR_BIT) /*The number of bits to use for the range-coded part of unsigned integers.*/ # define EC_UINT_BITS (8) /*The resolution of fractional-precision bit usage measurements, i.e., 3 => 1/8th bits.*/ # define BITRES 3 /*The entropy encoder/decoder context. We use the same structure for both, so that common functions like ec_tell() can be used on either one.*/ struct ec_ctx{ /*Buffered input/output.*/ unsigned char *buf; /*The size of the buffer.*/ opus_uint32 storage; /*The offset at which the last byte containing raw bits was read/written.*/ opus_uint32 end_offs; /*Bits that will be read from/written at the end.*/ ec_window end_window; /*Number of valid bits in end_window.*/ int nend_bits; /*The total number of whole bits read/written. This does not include partial bits currently in the range coder.*/ int nbits_total; /*The offset at which the next range coder byte will be read/written.*/ opus_uint32 offs; /*The number of values in the current range.*/ opus_uint32 rng; /*In the decoder: the difference between the top of the current range and the input value, minus one. In the encoder: the low end of the current range.*/ opus_uint32 val; /*In the decoder: the saved normalization factor from ec_decode(). In the encoder: the number of oustanding carry propagating symbols.*/ opus_uint32 ext; /*A buffered input/output symbol, awaiting carry propagation.*/ int rem; /*Nonzero if an error occurred.*/ int error; }; static OPUS_INLINE opus_uint32 ec_range_bytes(ec_ctx *_this){ return _this->offs; } static OPUS_INLINE unsigned char *ec_get_buffer(ec_ctx *_this){ return _this->buf; } static OPUS_INLINE int ec_get_error(ec_ctx *_this){ return _this->error; } /*Returns the number of bits "used" by the encoded or decoded symbols so far. This same number can be computed in either the encoder or the decoder, and is suitable for making coding decisions. Return: The number of bits. This will always be slightly larger than the exact value (e.g., all rounding error is in the positive direction).*/ static OPUS_INLINE int ec_tell(ec_ctx *_this){ return _this->nbits_total-EC_ILOG(_this->rng); } /*Returns the number of bits "used" by the encoded or decoded symbols so far. This same number can be computed in either the encoder or the decoder, and is suitable for making coding decisions. Return: The number of bits scaled by 2**BITRES. This will always be slightly larger than the exact value (e.g., all rounding error is in the positive direction).*/ opus_uint32 ec_tell_frac(ec_ctx *_this); #endif
/* * TAP-Win32/TAP-Win64 -- A kernel driver to provide virtual tap * device functionality on Windows. * * This code was inspired by the CIPE-Win32 driver by Damion K. Wilson. * * This source code is Copyright (C) 2002-2009 OpenVPN Technologies, Inc., * and is released under the GPL version 2 (see below), however due * to the extra costs of supporting Windows Vista, OpenVPN Solutions * LLC reserves the right to change the terms of the TAP-Win32/TAP-Win64 * license for versions 9.1 and higher prior to the official release of * OpenVPN 2.1. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * 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 (see the file COPYING included with this * distribution); if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef TAP_TYPES_DEFINED #define TAP_TYPES_DEFINED typedef struct _Queue { ULONG base; ULONG size; ULONG capacity; ULONG max_size; PVOID data[]; } Queue; typedef struct _TapAdapter; typedef struct _TapPacket; typedef union _TapAdapterQuery { NDIS_HARDWARE_STATUS m_HardwareStatus; NDIS_MEDIUM m_Medium; NDIS_PHYSICAL_MEDIUM m_PhysicalMedium; UCHAR m_MacAddress [6]; UCHAR m_Buffer [256]; ULONG m_Long; USHORT m_Short; UCHAR m_Byte; } TapAdapterQuery, *TapAdapterQueryPointer; typedef struct _TapExtension { // TAP device object and packet queues Queue *m_PacketQueue, *m_IrpQueue; PDEVICE_OBJECT m_TapDevice; NDIS_HANDLE m_TapDeviceHandle; ULONG m_TapOpens; // Used to lock packet queues NDIS_SPIN_LOCK m_QueueLock; BOOLEAN m_AllocatedSpinlocks; // Used to bracket open/close // state changes. MUTEX m_OpenCloseMutex; // True if device has been permanently halted BOOLEAN m_Halt; // TAP device name unsigned char *m_TapName; UNICODE_STRING m_UnicodeLinkName; BOOLEAN m_CreatedUnicodeLinkName; // Used for device status ioctl only const char *m_LastErrorFilename; int m_LastErrorLineNumber; LONG m_NumTapOpens; // Flags BOOLEAN m_TapIsRunning; BOOLEAN m_CalledTapDeviceFreeResources; // DPC queue for deferred packet injection BOOLEAN m_InjectDpcInitialized; KDPC m_InjectDpc; NDIS_SPIN_LOCK m_InjectLock; Queue *m_InjectQueue; } TapExtension, *TapExtensionPointer; typedef struct _TapPacket { # define TAP_PACKET_SIZE(data_size) (sizeof (TapPacket) + (data_size)) # define TP_TUN 0x80000000 # define TP_SIZE_MASK (~TP_TUN) ULONG m_SizeFlags; UCHAR m_Data []; // m_Data must be the last struct member } TapPacket, *TapPacketPointer; typedef struct _InjectPacket { # define INJECT_PACKET_SIZE(data_size) (sizeof (InjectPacket) + (data_size)) # define INJECT_PACKET_FREE(ib) NdisFreeMemory ((ib), INJECT_PACKET_SIZE ((ib)->m_Size), 0) ULONG m_Size; UCHAR m_Data []; // m_Data must be the last struct member } InjectPacket, *InjectPacketPointer; typedef struct _TapAdapter { # define NAME(a) ((a)->m_NameAnsi.Buffer) ANSI_STRING m_NameAnsi; MACADDR m_MAC; BOOLEAN m_InterfaceIsRunning; NDIS_HANDLE m_MiniportAdapterHandle; LONG m_Rx, m_Tx, m_RxErr, m_TxErr; #if PACKET_TRUNCATION_CHECK LONG m_RxTrunc, m_TxTrunc; #endif NDIS_MEDIUM m_Medium; ULONG m_Lookahead; ULONG m_MTU; // TRUE if adapter should always be // "connected" even when device node // is not open by a userspace process. BOOLEAN m_MediaStateAlwaysConnected; // TRUE if device is "connected" BOOLEAN m_MediaState; // Adapter power state char m_DeviceState; // Info for point-to-point mode BOOLEAN m_tun; IPADDR m_localIP; IPADDR m_remoteNetwork; IPADDR m_remoteNetmask; ETH_HEADER m_TapToUser; ETH_HEADER m_UserToTap; MACADDR m_MAC_Broadcast; // Used for DHCP server masquerade BOOLEAN m_dhcp_enabled; IPADDR m_dhcp_addr; ULONG m_dhcp_netmask; IPADDR m_dhcp_server_ip; BOOLEAN m_dhcp_server_arp; MACADDR m_dhcp_server_mac; ULONG m_dhcp_lease_time; UCHAR m_dhcp_user_supplied_options_buffer[DHCP_USER_SUPPLIED_OPTIONS_BUFFER_SIZE]; ULONG m_dhcp_user_supplied_options_buffer_len; BOOLEAN m_dhcp_received_discover; ULONG m_dhcp_bad_requests; // Help to tear down the adapter by keeping // some state information on allocated // resources. BOOLEAN m_CalledAdapterFreeResources; BOOLEAN m_RegisteredAdapterShutdownHandler; // Multicast list info NDIS_SPIN_LOCK m_MCLock; BOOLEAN m_MCLockAllocated; ULONG m_MCListSize; MC_LIST m_MCList; // Information on the TAP device TapExtension m_Extension; } TapAdapter, *TapAdapterPointer; #endif
/** * Copyright (c) 2012-2014, NVIDIA Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope 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 __AR0330_H__ #define __AR0330_H__ #include <linux/ioctl.h> /* For IOCTL macros */ #include <media/nvc.h> #include <media/nvc_image.h> #define AR0330_IOCTL_SET_MODE _IOW('o', 1, struct ar0330_mode) #define AR0330_IOCTL_GET_STATUS _IOR('o', 2, __u8) #define AR0330_IOCTL_SET_FRAME_LENGTH _IOW('o', 3, __u32) #define AR0330_IOCTL_SET_COARSE_TIME _IOW('o', 4, __u32) #define AR0330_IOCTL_SET_GAIN _IOW('o', 5, __u16) #define AR0330_IOCTL_GET_SENSORDATA _IOR('o', 6, struct ar0330_sensordata) #define AR0330_IOCTL_SET_GROUP_HOLD _IOW('o', 7, struct ar0330_ae) #define AR0330_IOCTL_SET_POWER _IOW('o', 20, __u32) #define AR0330_IOCTL_GET_FLASH_CAP _IOR('o', 30, __u32) #define AR0330_IOCTL_SET_FLASH_MODE _IOW('o', 31, \ struct ar0330_flash_control) struct ar0330_mode { int xres; int yres; __u32 frame_length; __u32 coarse_time; __u16 gain; }; struct ar0330_ae { __u32 frame_length; __u8 frame_length_enable; __u32 coarse_time; __u8 coarse_time_enable; __s32 gain; __u8 gain_enable; }; struct ar0330_sensordata { __u32 fuse_id_size; __u8 fuse_id[16]; }; struct ar0330_flash_control { u8 enable; u8 edge_trig_en; u8 start_edge; u8 repeat; u16 delay_frm; }; #ifdef __KERNEL__ struct ar0330_power_rail { struct regulator *dvdd; struct regulator *avdd; struct regulator *iovdd; }; struct ar0330_platform_data { struct ar0330_flash_control flash_cap; const char *mclk_name; /* NULL for default default_mclk */ const char *dev_name; /* NULL for default default_mclk */ unsigned int cam2_gpio; bool ext_reg; int (*power_on)(struct ar0330_power_rail *pw); int (*power_off)(struct ar0330_power_rail *pw); }; #endif /* __KERNEL__ */ #endif /* __AR0330_H__ */
/* * Performance event support - Freescale embedded specific definitions. * * Copyright 2008-2009 Paul Mackerras, IBM Corporation. * Copyright 2010 Freescale Semiconductor, 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 * 2 of the License, or (at your option) any later version. */ #include <linux/types.h> #include <asm/hw_irq.h> #define MAX_HWEVENTS 4 /* */ #define FSL_EMB_EVENT_VALID 1 #define FSL_EMB_EVENT_RESTRICTED 2 /* */ #define FSL_EMB_EVENT_THRESHMUL 0x0000070000000000ULL #define FSL_EMB_EVENT_THRESH 0x0000003f00000000ULL struct fsl_emb_pmu { const char *name; int n_counter; /* */ /* */ int n_restricted; /* */ u64 (*xlate_event)(u64 event_id); int n_generic; int *generic_events; int (*cache_events)[PERF_COUNT_HW_CACHE_MAX] [PERF_COUNT_HW_CACHE_OP_MAX] [PERF_COUNT_HW_CACHE_RESULT_MAX]; }; int register_fsl_emb_pmu(struct fsl_emb_pmu *);
/* * DaVinci Voice Codec Core Interface for TI platforms * * Copyright (C) 2010 Texas Instruments, Inc * * Author: Miguel Aguilar <miguel.aguilar@ridgerun.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <linux/init.h> #include <linux/module.h> #include <linux/device.h> #include <linux/slab.h> #include <linux/delay.h> #include <linux/io.h> #include <linux/clk.h> #include <sound/pcm.h> #include <linux/mfd/davinci_voicecodec.h> u32 davinci_vc_read(struct davinci_vc *davinci_vc, int reg) { return __raw_readl(davinci_vc->base + reg); } void davinci_vc_write(struct davinci_vc *davinci_vc, int reg, u32 val) { __raw_writel(val, davinci_vc->base + reg); } static int __init davinci_vc_probe(struct platform_device *pdev) { struct davinci_vc *davinci_vc; struct resource *res, *mem; struct mfd_cell *cell = NULL; int ret; davinci_vc = kzalloc(sizeof(struct davinci_vc), GFP_KERNEL); if (!davinci_vc) { dev_dbg(&pdev->dev, "could not allocate memory for private data\n"); return -ENOMEM; } davinci_vc->clk = clk_get(&pdev->dev, NULL); if (IS_ERR(davinci_vc->clk)) { dev_dbg(&pdev->dev, "could not get the clock for voice codec\n"); ret = -ENODEV; goto fail1; } clk_enable(davinci_vc->clk); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { dev_err(&pdev->dev, "no mem resource\n"); ret = -ENODEV; goto fail2; } davinci_vc->pbase = res->start; davinci_vc->base_size = resource_size(res); mem = request_mem_region(davinci_vc->pbase, davinci_vc->base_size, pdev->name); if (!mem) { dev_err(&pdev->dev, "VCIF region already claimed\n"); ret = -EBUSY; goto fail2; } davinci_vc->base = ioremap(davinci_vc->pbase, davinci_vc->base_size); if (!davinci_vc->base) { dev_err(&pdev->dev, "can't ioremap mem resource.\n"); ret = -ENOMEM; goto fail3; } res = platform_get_resource(pdev, IORESOURCE_DMA, 0); if (!res) { dev_err(&pdev->dev, "no DMA resource\n"); ret = -ENXIO; goto fail4; } davinci_vc->davinci_vcif.dma_tx_channel = res->start; davinci_vc->davinci_vcif.dma_tx_addr = (dma_addr_t)(io_v2p(davinci_vc->base) + DAVINCI_VC_WFIFO); res = platform_get_resource(pdev, IORESOURCE_DMA, 1); if (!res) { dev_err(&pdev->dev, "no DMA resource\n"); ret = -ENXIO; goto fail4; } davinci_vc->davinci_vcif.dma_rx_channel = res->start; davinci_vc->davinci_vcif.dma_rx_addr = (dma_addr_t)(io_v2p(davinci_vc->base) + DAVINCI_VC_RFIFO); davinci_vc->dev = &pdev->dev; davinci_vc->pdev = pdev; /* */ cell = &davinci_vc->cells[DAVINCI_VC_VCIF_CELL]; cell->name = "davinci-vcif"; cell->platform_data = davinci_vc; cell->pdata_size = sizeof(*davinci_vc); /* */ cell = &davinci_vc->cells[DAVINCI_VC_CQ93VC_CELL]; cell->name = "cq93vc-codec"; cell->platform_data = davinci_vc; cell->pdata_size = sizeof(*davinci_vc); ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells, DAVINCI_VC_CELLS, NULL, 0); if (ret != 0) { dev_err(&pdev->dev, "fail to register client devices\n"); goto fail4; } return 0; fail4: iounmap(davinci_vc->base); fail3: release_mem_region(davinci_vc->pbase, davinci_vc->base_size); fail2: clk_disable(davinci_vc->clk); clk_put(davinci_vc->clk); davinci_vc->clk = NULL; fail1: kfree(davinci_vc); return ret; } static int __devexit davinci_vc_remove(struct platform_device *pdev) { struct davinci_vc *davinci_vc = platform_get_drvdata(pdev); mfd_remove_devices(&pdev->dev); iounmap(davinci_vc->base); release_mem_region(davinci_vc->pbase, davinci_vc->base_size); clk_disable(davinci_vc->clk); clk_put(davinci_vc->clk); davinci_vc->clk = NULL; kfree(davinci_vc); return 0; } static struct platform_driver davinci_vc_driver = { .driver = { .name = "davinci_voicecodec", .owner = THIS_MODULE, }, .remove = __devexit_p(davinci_vc_remove), }; static int __init davinci_vc_init(void) { return platform_driver_probe(&davinci_vc_driver, davinci_vc_probe); } module_init(davinci_vc_init); static void __exit davinci_vc_exit(void) { platform_driver_unregister(&davinci_vc_driver); } module_exit(davinci_vc_exit); MODULE_AUTHOR("Miguel Aguilar"); MODULE_DESCRIPTION("Texas Instruments DaVinci Voice Codec Core Interface"); MODULE_LICENSE("GPL");
/*********************************************************************** Copyright (c) 2006-2012, Skype Limited. All rights reserved. Redistribution and use in source and binary forms, with or without modification, (subject to the limitations in the disclaimer below) 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 Skype Limited, nor the names of specific contributors, may be used to endorse or promote products derived from this software without specific prior written permission. NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. 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 SKP_SILK_TABLES_FLP_H #define SKP_SILK_TABLES_FLP_H #include "SKP_Silk_structs_FLP.h" #ifdef __cplusplus extern "C" { #endif /* filters */ extern const SKP_float SKP_Silk_HarmShapeFIR_FLP[ HARM_SHAPE_FIR_TAPS ]; /* Table of quantization offset values */ extern const SKP_float SKP_Silk_Quantization_Offsets[ 2 ][ 2 ]; /* NLSF codebooks */ extern const SKP_Silk_NLSF_CB_FLP SKP_Silk_NLSF_CB0_16_FLP, SKP_Silk_NLSF_CB1_16_FLP; extern const SKP_Silk_NLSF_CB_FLP SKP_Silk_NLSF_CB0_10_FLP, SKP_Silk_NLSF_CB1_10_FLP; #ifdef __cplusplus } #endif #endif
#include <config.h> #include "testutils.h" #ifdef WITH_BHYVE # include "bhyve/bhyve_capabilities.h" # include "bhyve/bhyve_utils.h" # define VIR_FROM_THIS VIR_FROM_NONE static bhyveConn driver; static int testCompareXMLToXMLFiles(const char *inxml, const char *outxml) { char *inXmlData = NULL; char *outXmlData = NULL; char *actual = NULL; virDomainDefPtr def = NULL; int ret = -1; if (virtTestLoadFile(inxml, &inXmlData) < 0) goto fail; if (virtTestLoadFile(outxml, &outXmlData) < 0) goto fail; if (!(def = virDomainDefParseString(inXmlData, driver.caps, driver.xmlopt, 1 << VIR_DOMAIN_VIRT_BHYVE, VIR_DOMAIN_DEF_PARSE_INACTIVE))) goto fail; if (!(actual = virDomainDefFormat(def, VIR_DOMAIN_DEF_FORMAT_INACTIVE))) goto fail; if (STRNEQ(outXmlData, actual)) { virtTestDifference(stderr, outXmlData, actual); goto fail; } ret = 0; fail: VIR_FREE(inXmlData); VIR_FREE(outXmlData); VIR_FREE(actual); virDomainDefFree(def); return ret; } struct testInfo { const char *name; bool different; }; static int testCompareXMLToXMLHelper(const void *data) { const struct testInfo *info = data; char *xml_in = NULL; char *xml_out = NULL; int ret = -1; if (virAsprintf(&xml_in, "%s/bhyvexml2argvdata/bhyvexml2argv-%s.xml", abs_srcdir, info->name) < 0 || virAsprintf(&xml_out, "%s/bhyvexml2xmloutdata/bhyvexml2xmlout-%s.xml", abs_srcdir, info->name) < 0) goto cleanup; ret = testCompareXMLToXMLFiles(xml_in, info->different ? xml_out : xml_in); cleanup: VIR_FREE(xml_in); VIR_FREE(xml_out); return ret; } static int mymain(void) { int ret = 0; if ((driver.caps = virBhyveCapsBuild()) == NULL) return EXIT_FAILURE; if ((driver.xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL)) == NULL) return EXIT_FAILURE; # define DO_TEST_FULL(name, is_different) \ do { \ const struct testInfo info = {name, is_different}; \ if (virtTestRun("BHYVE XML-2-XML " name, \ testCompareXMLToXMLHelper, &info) < 0) \ ret = -1; \ } while (0) # define DO_TEST_DIFFERENT(name) \ DO_TEST_FULL(name, true) DO_TEST_DIFFERENT("metadata"); virObjectUnref(driver.caps); virObjectUnref(driver.xmlopt); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } VIRT_TEST_MAIN(mymain) #else int main(void) { return EXIT_AM_SKIP; } #endif /* WITH_BHYVE */
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. * * This 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 software 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 software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef WINVNCCONF_AUTHENTICATION #define WINVNCCONF_AUTHENTICATION #include <vncconfig/PasswordDialog.h> #include <rfb_win32/Registry.h> #include <rfb_win32/SecurityPage.h> #include <rfb_win32/OSVersion.h> #include <rfb_win32/MsgBox.h> #include <rfb/ServerCore.h> #include <rfb/Security.h> #include <rfb/SecurityServer.h> #include <rfb/SSecurityVncAuth.h> #include <rfb/Password.h> static rfb::BoolParameter queryOnlyIfLoggedOn("QueryOnlyIfLoggedOn", "Only prompt for a local user to accept incoming connections if there is a user logged on", false); namespace rfb { namespace win32 { class SecPage : public SecurityPage { public: SecPage(const RegKey& rk) : SecurityPage(NULL), regKey(rk) { security = new SecurityServer(); } void initDialog() { SecurityPage::initDialog(); setItemChecked(IDC_QUERY_CONNECT, rfb::Server::queryConnect); setItemChecked(IDC_QUERY_LOGGED_ON, queryOnlyIfLoggedOn); onCommand(IDC_AUTH_NONE, 0); } bool onCommand(int id, int cmd) { SecurityPage::onCommand(id, cmd); setChanged(true); if (id == IDC_AUTH_VNC_PASSWD) { PasswordDialog passwdDlg(regKey, registryInsecure); passwdDlg.showDialog(handle); } else if (id == IDC_QUERY_LOGGED_ON) { enableItem(IDC_QUERY_LOGGED_ON, enableQueryOnlyIfLoggedOn()); } return true; } bool onOk() { SecurityPage::onOk(); if (isItemChecked(IDC_AUTH_VNC)) verifyVncPassword(regKey); else if (haveVncPassword() && MsgBox(0, _T("The VNC authentication method is disabled, but a password is still stored for it.\n") _T("Do you want to remove the VNC authentication password from the registry?"), MB_ICONWARNING | MB_YESNO) == IDYES) { regKey.setBinary(_T("Password"), 0, 0); } regKey.setString(_T("SecurityTypes"), security->ToString()); regKey.setBool(_T("QueryConnect"), isItemChecked(IDC_QUERY_CONNECT)); regKey.setBool(_T("QueryOnlyIfLoggedOn"), isItemChecked(IDC_QUERY_LOGGED_ON)); return true; } void setWarnPasswdInsecure(bool warn) { registryInsecure = warn; } bool enableQueryOnlyIfLoggedOn() { return isItemChecked(IDC_QUERY_CONNECT) && osVersion.isPlatformNT && (osVersion.dwMajorVersion >= 5); } static bool haveVncPassword() { PlainPasswd password, passwordReadOnly; SSecurityVncAuth::vncAuthPasswd.getVncAuthPasswd(&password, &passwordReadOnly); return password.buf && strlen(password.buf) != 0; } static void verifyVncPassword(const RegKey& regKey) { if (!haveVncPassword()) { MsgBox(0, _T("The VNC authentication method is enabled, but no password is specified.\n") _T("The password dialog will now be shown."), MB_ICONINFORMATION | MB_OK); PasswordDialog passwd(regKey, registryInsecure); passwd.showDialog(); } } virtual void loadX509Certs(void) {} virtual void enableX509Dialogs(void) { enableItem(IDC_LOAD_CERT, true); enableItem(IDC_LOAD_CERTKEY, true); } virtual void disableX509Dialogs(void) { enableItem(IDC_LOAD_CERT, false); enableItem(IDC_LOAD_CERTKEY, false); } virtual void loadVncPasswd() { enableItem(IDC_AUTH_VNC_PASSWD, isItemChecked(IDC_AUTH_VNC)); } protected: RegKey regKey; static bool registryInsecure; private: inline void modifyAuthMethod(int enc_idc, int auth_idc, bool enable) { setItemChecked(enc_idc, enable); setItemChecked(auth_idc, enable); } }; }; bool SecPage::registryInsecure = false; }; #endif
#ifndef DEPRECATED_HEADER_QtDesigner_qdesignerexportwidget_h #define DEPRECATED_HEADER_QtDesigner_qdesignerexportwidget_h #if defined(__GNUC__) # warning Header <QtDesigner/qdesignerexportwidget.h> is deprecated. Please include <QtUiPlugin/qdesignerexportwidget.h> instead. #elif defined(_MSC_VER) # pragma message ("Header <QtDesigner/qdesignerexportwidget.h> is deprecated. Please include <QtUiPlugin/qdesignerexportwidget.h> instead.") #endif #include <QtUiPlugin/qdesignerexportwidget.h> #if 0 #pragma qt_no_master_include #endif #endif
#include <stdio.h> #include <stdlib.h> #include "unity.h" #include "test_utils.h" #include "esp_partition.h" TEST_CASE("Can read partition table", "[partition]") { const esp_partition_t *p = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_ANY, NULL); TEST_ASSERT_NOT_NULL(p); TEST_ASSERT_EQUAL(0x10000, p->address); TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_FACTORY, p->subtype); esp_partition_iterator_t it = esp_partition_find(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, NULL); TEST_ASSERT_NOT_NULL(it); int count = 0; const esp_partition_t* prev = NULL; for (; it != NULL; it = esp_partition_next(it)) { const esp_partition_t *p = esp_partition_get(it); TEST_ASSERT_NOT_NULL(p); if (prev) { TEST_ASSERT_TRUE_MESSAGE(prev->address < p->address, "incorrect partition order"); } prev = p; ++count; } esp_partition_iterator_release(it); TEST_ASSERT_EQUAL(4, count); } TEST_CASE("Can write, read, mmap partition", "[partition][ignore]") { const esp_partition_t *p = get_test_data_partition(); printf("Using partition %s at 0x%x, size 0x%x\n", p->label, p->address, p->size); TEST_ASSERT_NOT_NULL(p); const size_t max_size = 2 * SPI_FLASH_SEC_SIZE; uint8_t *data = (uint8_t *) malloc(max_size); TEST_ASSERT_NOT_NULL(data); TEST_ASSERT_EQUAL(ESP_OK, esp_partition_erase_range(p, 0, p->size)); srand(0); size_t block_size; for (size_t offset = 0; offset < p->size; offset += block_size) { block_size = ((rand() + 4) % max_size) & (~0x3); size_t left = p->size - offset; if (block_size > left) { block_size = left; } for (size_t i = 0; i < block_size / 4; ++i) { ((uint32_t *) (data))[i] = rand(); } TEST_ASSERT_EQUAL(ESP_OK, esp_partition_write(p, offset, data, block_size)); } srand(0); for (size_t offset = 0; offset < p->size; offset += block_size) { block_size = ((rand() + 4) % max_size) & (~0x3); size_t left = p->size - offset; if (block_size > left) { block_size = left; } TEST_ASSERT_EQUAL(ESP_OK, esp_partition_read(p, offset, data, block_size)); for (size_t i = 0; i < block_size / 4; ++i) { TEST_ASSERT_EQUAL(rand(), ((uint32_t *) data)[i]); } } free(data); const uint32_t *mmap_data; spi_flash_mmap_handle_t mmap_handle; size_t begin = 3000; size_t size = 64000; //chosen so size is smaller than 64K but the mmap straddles 2 MMU blocks TEST_ASSERT_EQUAL(ESP_OK, esp_partition_mmap(p, begin, size, SPI_FLASH_MMAP_DATA, (const void **)&mmap_data, &mmap_handle)); srand(0); for (size_t offset = 0; offset < p->size; offset += block_size) { block_size = ((rand() + 4) % max_size) & (~0x3); size_t left = p->size - offset; if (block_size > left) { block_size = left; } for (size_t i = 0; i < block_size / 4; ++i) { size_t pos = offset + i * 4; uint32_t expected = rand(); if (pos < begin || pos >= (begin + size)) { continue; } TEST_ASSERT_EQUAL(expected, mmap_data[(pos - begin) / 4]); } } spi_flash_munmap(mmap_handle); }
/* * Copyright (C) 2015 Apple 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: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 WTF_PointerComparison_h #define WTF_PointerComparison_h namespace WTF { template<typename T> inline bool arePointingToEqualData(const T& a, const T& b) { return a == b || (a && b && *a == *b); } } // namespace WTF using WTF::arePointingToEqualData; #endif // WTF_PointerComparison_h
/*------------------------------------------------------------------------- * * plperl.h * Common include file for PL/Perl files * * This should be included _AFTER_ postgres.h and system include files * * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group * Portions Copyright (c) 1995, Regents of the University of California * * src/pl/plperl/plperl.h */ #ifndef PL_PERL_H #define PL_PERL_H /* stop perl headers from hijacking stdio and other stuff on Windows */ #ifdef WIN32 #define WIN32IO_IS_STDIO #endif /* WIN32 */ /* * Supply a value of PERL_UNUSED_DECL that will satisfy gcc - the one * perl itself supplies doesn't seem to. */ #define PERL_UNUSED_DECL pg_attribute_unused() /* * Sometimes perl carefully scribbles on our *printf macros. * So we undefine them here and redefine them after it's done its dirty deed. */ #undef vsnprintf #undef snprintf #undef vsprintf #undef sprintf #undef vfprintf #undef fprintf #undef vprintf #undef printf /* * Perl scribbles on the "_" macro too. */ #undef _ /* * ActivePerl 5.18 and later are MinGW-built, and their headers use GCC's * __inline__. Translate to something MSVC recognizes. Also, perl.h sometimes * defines isnan, so undefine it here and put back the definition later if * perl.h doesn't. */ #ifdef _MSC_VER #define __inline__ inline #ifdef isnan #undef isnan #endif #endif /* * Regarding bool, both PostgreSQL and Perl might use stdbool.h or not, * depending on configuration. If both agree, things are relatively harmless. * If not, things get tricky. If PostgreSQL does but Perl does not, define * HAS_BOOL here so that Perl does not redefine bool; this avoids compiler * warnings. If PostgreSQL does not but Perl does, we need to undefine bool * after we include the Perl headers; see below. */ #ifdef USE_STDBOOL #define HAS_BOOL 1 #endif /* * ActivePerl 5.18 and later are MinGW-built, and their headers use GCC's * __inline__. Translate to something MSVC recognizes. */ #ifdef _MSC_VER #define __inline__ inline #endif /* * Get the basic Perl API. We use PERL_NO_GET_CONTEXT mode so that our code * can compile against MULTIPLICITY Perl builds without including XSUB.h. */ #define PERL_NO_GET_CONTEXT #include "EXTERN.h" #include "perl.h" /* * We want to include XSUB.h only within .xs files, because on some platforms * it undesirably redefines a lot of libc functions. But it must appear * before ppport.h, so use a #define flag to control inclusion here. */ #ifdef PG_NEED_PERL_XSUB_H /* * On Windows, win32_port.h defines macros for a lot of these same functions. * To avoid compiler warnings when XSUB.h redefines them, #undef our versions. */ #ifdef WIN32 #undef accept #undef bind #undef connect #undef fopen #undef kill #undef listen #undef lstat #undef mkdir #undef open #undef putenv #undef recv #undef rename #undef select #undef send #undef socket #undef stat #undef unlink #endif #include "XSUB.h" #endif /* put back our *printf macros ... this must match src/include/port.h */ #ifdef vsnprintf #undef vsnprintf #endif #ifdef snprintf #undef snprintf #endif #ifdef vsprintf #undef vsprintf #endif #ifdef sprintf #undef sprintf #endif #ifdef vfprintf #undef vfprintf #endif #ifdef fprintf #undef fprintf #endif #ifdef vprintf #undef vprintf #endif #ifdef printf #undef printf #endif #define vsnprintf pg_vsnprintf #define snprintf pg_snprintf #define vsprintf pg_vsprintf #define sprintf pg_sprintf #define vfprintf pg_vfprintf #define fprintf pg_fprintf #define vprintf pg_vprintf #define printf(...) pg_printf(__VA_ARGS__) /* * Put back "_" too; but rather than making it just gettext() as the core * code does, make it dgettext() so that the right things will happen in * loadable modules (if they've set up TEXTDOMAIN correctly). Note that * we can't just set TEXTDOMAIN here, because this file is used by more * extensions than just PL/Perl itself. */ #undef _ #define _(x) dgettext(TEXTDOMAIN, x) /* put back the definition of isnan if needed */ #ifdef _MSC_VER #ifndef isnan #define isnan(x) _isnan(x) #endif #endif /* perl version and platform portability */ #define NEED_eval_pv #define NEED_newRV_noinc #define NEED_sv_2pv_flags #include "ppport.h" /* * perl might have included stdbool.h. If we also did that earlier (see c.h), * then that's fine. If not, we probably rejected it for some reason. In * that case, undef bool and proceed with our own bool. (Note that stdbool.h * makes bool a macro, but our own replacement is a typedef, so the undef * makes ours visible again). */ #ifndef USE_STDBOOL #ifdef bool #undef bool #endif #endif /* supply HeUTF8 if it's missing - ppport.h doesn't supply it, unfortunately */ #ifndef HeUTF8 #define HeUTF8(he) ((HeKLEN(he) == HEf_SVKEY) ? \ SvUTF8(HeKEY_sv(he)) : \ (U32)HeKUTF8(he)) #endif /* supply GvCV_set if it's missing - ppport.h doesn't supply it, unfortunately */ #ifndef GvCV_set #define GvCV_set(gv, cv) (GvCV(gv) = cv) #endif /* Perl 5.19.4 changed array indices from I32 to SSize_t */ #if PERL_BCDVERSION >= 0x5019004 #define AV_SIZE_MAX SSize_t_MAX #else #define AV_SIZE_MAX I32_MAX #endif /* declare routines from plperl.c for access by .xs files */ HV *plperl_spi_exec(char *, int); void plperl_return_next(SV *); SV *plperl_spi_query(char *); SV *plperl_spi_fetchrow(char *); SV *plperl_spi_prepare(char *, int, SV **); HV *plperl_spi_exec_prepared(char *, HV *, int, SV **); SV *plperl_spi_query_prepared(char *, int, SV **); void plperl_spi_freeplan(char *); void plperl_spi_cursor_close(char *); void plperl_spi_commit(void); void plperl_spi_rollback(void); char *plperl_sv_to_literal(SV *, char *); void plperl_util_elog(int level, SV *msg); #endif /* PL_PERL_H */
//--------------------------------------------------------------------------- // Greenplum Database // Copyright (C) 2014 VMware, Inc. or its affiliates. // // @filename: // CDXLScalarBitmapIndexProbe.h // // @doc: // Class for representing DXL bitmap index probe operators //--------------------------------------------------------------------------- #ifndef GPDXL_CDXLScalarBitmapIndexProbe_H #define GPDXL_CDXLScalarBitmapIndexProbe_H #include "gpos/base.h" #include "naucrates/dxl/operators/CDXLScalar.h" namespace gpdxl { using namespace gpos; // fwd declarations class CDXLIndexDescr; class CXMLSerializer; //--------------------------------------------------------------------------- // @class: // CDXLScalarBitmapIndexProbe // // @doc: // Class for representing DXL bitmap index probe operators // //--------------------------------------------------------------------------- class CDXLScalarBitmapIndexProbe : public CDXLScalar { private: // index descriptor associated with the scanned table CDXLIndexDescr *m_dxl_index_descr; public: CDXLScalarBitmapIndexProbe(CDXLScalarBitmapIndexProbe &) = delete; // ctor CDXLScalarBitmapIndexProbe(CMemoryPool *mp, CDXLIndexDescr *dxl_index_descr); //dtor ~CDXLScalarBitmapIndexProbe() override; // operator type Edxlopid GetDXLOperator() const override { return EdxlopScalarBitmapIndexProbe; } // operator name const CWStringConst *GetOpNameStr() const override; // index descriptor virtual const CDXLIndexDescr * GetDXLIndexDescr() const { return m_dxl_index_descr; } // serialize operator in DXL format void SerializeToDXL(CXMLSerializer *xml_serializer, const CDXLNode *dxlnode) const override; // does the operator return a boolean result BOOL HasBoolResult(CMDAccessor * //md_accessor ) const override { return false; } #ifdef GPOS_DEBUG // checks whether the operator has valid structure, i.e. number and // types of child nodes void AssertValid(const CDXLNode *dxlnode, BOOL validate_children) const override; #endif // GPOS_DEBUG // conversion function static CDXLScalarBitmapIndexProbe * Cast(CDXLOperator *dxl_op) { GPOS_ASSERT(nullptr != dxl_op); GPOS_ASSERT(EdxlopScalarBitmapIndexProbe == dxl_op->GetDXLOperator()); return dynamic_cast<CDXLScalarBitmapIndexProbe *>(dxl_op); } }; // class CDXLScalarBitmapIndexProbe } // namespace gpdxl #endif // !GPDXL_CDXLScalarBitmapIndexProbe_H // EOF
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_AURA_EXTRA_AURA_EXTRA_EXPORT_H_ #define UI_AURA_EXTRA_AURA_EXTRA_EXPORT_H_ // Defines AURA_EXTRA_EXPORT so that functionality implemented by the aura-extra // module can be exported to consumers. #if defined(COMPONENT_BUILD) #if defined(WIN32) #if defined(AURA_EXTRA_IMPLEMENTATION) #define AURA_EXTRA_EXPORT __declspec(dllexport) #else #define AURA_EXTRA_EXPORT __declspec(dllimport) #endif // defined(AURA_EXTRA_IMPLEMENTATION) #else // defined(WIN32) #if defined(AURA_EXTRA_IMPLEMENTATION) #define AURA_EXTRA_EXPORT __attribute__((visibility("default"))) #else #define AURA_EXTRA_EXPORT #endif #endif #else // defined(COMPONENT_BUILD) #define AURA_EXTRA_EXPORT #endif #endif // UI_AURA_EXTRA_AURA_EXTRA_EXPORT_H_
// Copyright 2018 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_EXO_WAYLAND_WAYLAND_INPUT_DELEGATE_H_ #define COMPONENTS_EXO_WAYLAND_WAYLAND_INPUT_DELEGATE_H_ #include "base/observer_list.h" #include "base/time/time.h" namespace exo { namespace wayland { class WaylandInputDelegate { public: class Observer { public: virtual void OnDelegateDestroying(WaylandInputDelegate* delegate) = 0; virtual void OnSendTimestamp(base::TimeTicks time_stamp) = 0; protected: virtual ~Observer() = default; }; WaylandInputDelegate(const WaylandInputDelegate&) = delete; WaylandInputDelegate& operator=(const WaylandInputDelegate&) = delete; void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); void SendTimestamp(base::TimeTicks time_stamp); protected: WaylandInputDelegate(); virtual ~WaylandInputDelegate(); private: base::ObserverList<Observer>::Unchecked observers_; }; } // namespace wayland } // namespace exo #endif // COMPONENTS_EXO_WAYLAND_WAYLAND_INPUT_DELEGATE_H_
#include <unistd.h> void func1() {} void func2() {} int main(void) { char *const args[] = {"-l", "-h", (char*)0}; func1(); execvp("ls", args); func2(); return 0; }
// Copyright 2018 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_VR_ELEMENTS_OVAL_H_ #define CHROME_BROWSER_VR_ELEMENTS_OVAL_H_ #include "chrome/browser/vr/elements/rect.h" #include "chrome/browser/vr/vr_ui_export.h" namespace vr { // An oval behaves like a rect save for the fact that it manages its own corner // radii to ensure circular right and left end caps. class VR_UI_EXPORT Oval : public Rect { public: Oval(); Oval(const Oval&) = delete; Oval& operator=(const Oval&) = delete; ~Oval() override; private: void OnSizeAnimated(const gfx::SizeF& size, int target_property_id, gfx::KeyframeModel* keyframe_model) override; }; } // namespace vr #endif // CHROME_BROWSER_VR_ELEMENTS_OVAL_H_
// Copyright 2018 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_ASH_FILE_MANAGER_FILE_MANAGER_TEST_UTIL_H_ #define CHROME_BROWSER_ASH_FILE_MANAGER_FILE_MANAGER_TEST_UTIL_H_ #include <vector> #include "base/files/file_path.h" #include "chrome/browser/ash/file_manager/file_tasks.h" #include "chrome/browser/ash/file_manager/volume_manager.h" #include "chrome/browser/platform_util.h" class Profile; namespace file_manager { namespace test { // A dummy folder in a temporary path that is automatically mounted as a // Profile's Downloads folder. class FolderInMyFiles { public: explicit FolderInMyFiles(Profile* profile); ~FolderInMyFiles(); // Copies additional files into |folder_|, appending to |files_|. void Add(const std::vector<base::FilePath>& files); // Copies the contents of |file| to |folder_| with the given |new_base_name|. void AddWithName(const base::FilePath& file, const base::FilePath& new_base_name); // Use platform_util::OpenItem() on the file with basename matching |path| to // simulate a user request to open that path, e.g., from the Files app or // chrome://downloads. platform_util::OpenOperationResult Open(const base::FilePath& path); // Refreshes `files_` by re-reading directory contents, sorting by name. void Refresh(); const std::vector<base::FilePath> files() { return files_; } private: FolderInMyFiles(const FolderInMyFiles&) = delete; FolderInMyFiles& operator=(const FolderInMyFiles&) = delete; Profile* const profile_; base::FilePath folder_; std::vector<base::FilePath> files_; }; // Load the default set of component extensions used on ChromeOS. This should be // done in an override of InProcessBrowserTest::SetUpOnMainThread(). void AddDefaultComponentExtensionsOnMainThread(Profile* profile); // Installs the chrome app at the provided |test_path_ascii| under DIR_TEST_DATA // and waits for the background page to start up. scoped_refptr<const extensions::Extension> InstallTestingChromeApp( Profile* profile, const char* test_path_ascii); // Installs a test File System Provider chrome app that provides a file system // containing readwrite.gif and readonly.png files, and wait for the file system // to be mounted. Returns a base::WeakPtr<file_manager::Volume> to the mounted // file system. base::WeakPtr<file_manager::Volume> InstallFileSystemProviderChromeApp( Profile* profile); // Gets the list of available tasks for the provided `file`. Note only the path // string is used for this helper, so it must have a well-known MIME type // according to net::GetMimeTypeFromFile(). std::vector<file_tasks::FullTaskDescriptor> GetTasksForFile( Profile* profile, const base::FilePath& file); } // namespace test } // namespace file_manager #endif // CHROME_BROWSER_ASH_FILE_MANAGER_FILE_MANAGER_TEST_UTIL_H_
#ifndef RPCCONSOLE_H #define RPCCONSOLE_H #include "guiutil.h" #include "net.h" #include "peertablemodel.h" #include <QWidget> namespace Ui { class RPCConsole; } class ClientModel; QT_BEGIN_NAMESPACE class QMenu; class QItemSelection; QT_END_NAMESPACE /** Local Bitcoin RPC console. */ class RPCConsole: public QWidget { Q_OBJECT public: explicit RPCConsole(QWidget *parent = 0); ~RPCConsole(); void setClientModel(ClientModel *model); enum MessageClass { MC_ERROR, MC_DEBUG, CMD_REQUEST, CMD_REPLY, CMD_ERROR }; protected: virtual bool eventFilter(QObject* obj, QEvent *event); void keyPressEvent(QKeyEvent *); private slots: void on_lineEdit_returnPressed(); void on_tabWidget_currentChanged(int index); /** open the debug.log from the current datadir */ void on_openDebugLogfileButton_clicked(); /** display messagebox with program parameters (same as bitcoin-qt --help) */ void on_showCLOptionsButton_clicked(); /** change the time range of the network traffic graph */ void on_sldGraphRange_valueChanged(int value); /** update traffic statistics */ void updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut); void resizeEvent(QResizeEvent *event); void showEvent(QShowEvent *event); void hideEvent(QHideEvent *event); /** Show custom context menu on Peers tab */ void showPeersTableContextMenu(const QPoint& point); /** Show custom context menu on Bans tab */ void showBanTableContextMenu(const QPoint& point); /** Hides ban table if no bans are present */ void showOrHideBanTableIfRequired(); /** clear the selected node */ void clearSelectedNode(); /** clear traffic graph */ void on_btnClearTrafficGraph_clicked(); /** paste clipboard to line */ void on_pasteButton_clicked(); /** copy to clipboard */ void on_copyButton_clicked(); public slots: void clear(); void message(int category, const QString &message, bool html = false); /** Set number of connections shown in the UI */ void setNumConnections(int count); /** Set number of blocks shown in the UI */ void setNumBlocks(int count); /** Set number of masternodes shown in the UI */ void setMasternodeCount(const QString &strMasternodes); /** Go forward or back in history */ void browseHistory(int offset); /** Scroll console view to end */ void scrollToEnd(); /** Handle selection of peer in peers list */ void peerSelected(const QItemSelection &selected, const QItemSelection &deselected); /** Handle updated peer information */ void peerLayoutChanged(); /** Disconnect a selected node on the Peers tab */ void disconnectSelectedNode(); /** Ban a selected node on the Peers tab */ void banSelectedNode(int bantime); /** Unban a selected node on the Bans tab */ void unbanSelectedNode(); /** Show folder with wallet backups in default browser */ void showBackups(); signals: // For RPC command executor void stopExecutor(); void cmdRequest(const QString &command); private: static QString FormatBytes(quint64 bytes); void startExecutor(); void setTrafficGraphRange(int mins); /** show detailed information on ui about selected node */ void updateNodeDetail(const CNodeCombinedStats *stats); enum ColumnWidths { ADDRESS_COLUMN_WIDTH = 200, SUBVERSION_COLUMN_WIDTH = 100, PING_COLUMN_WIDTH = 80, BANSUBNET_COLUMN_WIDTH = 200, BANTIME_COLUMN_WIDTH = 250 }; Ui::RPCConsole *ui; ClientModel *clientModel; QStringList history; int historyPtr; NodeId cachedNodeid; QMenu *peersTableContextMenu; QMenu *banTableContextMenu; }; #endif // RPCCONSOLE_H
/* MD5.H - header file for MD5C.C */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #ifndef _MD5_H_ #define _MD5_H_ 1 #if defined(__MINGW32__) # include <basetyps.h> #endif #if !defined(_WIN32) #include <sys/types.h> #ifdef sun typedef uint32_t uint32; #else typedef u_int32_t uint32; #endif /* sun */ #else typedef unsigned __int32 uint32; #endif /* _WIN32 */ #ifndef POINTER_TYPE #define POINTER_TYPE 1 typedef unsigned char *POINTER; #endif #ifdef __cplusplus extern "C" { #endif /* MD5 context. */ typedef struct { uint32 state[4]; /* state (ABCD) */ uint32 count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ } MD5_CTX; void MD5_Init (MD5_CTX *); void MD5_Update (MD5_CTX *, const unsigned char *, unsigned int); void MD5_Final (unsigned char [16], MD5_CTX *); #ifdef __cplusplus } #endif #endif
/* Pango * pango-matrix.h: Matrix manipulation routines * * Copyright (C) 2002, 2006 Red Hat Software * * 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., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __PANGO_MATRIX_H__ #define __PANGO_MATRIX_H__ #include <glib.h> #include <glib-object.h> G_BEGIN_DECLS typedef struct _PangoMatrix PangoMatrix; /** * PangoMatrix: * @xx: 1st component of the transformation matrix * @xy: 2nd component of the transformation matrix * @yx: 3rd component of the transformation matrix * @yy: 4th component of the transformation matrix * @x0: x translation * @y0: y translation * * A structure specifying a transformation between user-space * coordinates and device coordinates. The transformation * is given by * * <programlisting> * x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0; * y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0; * </programlisting> * * Since: 1.6 **/ struct _PangoMatrix { double xx; double xy; double yx; double yy; double x0; double y0; }; /** * PANGO_TYPE_MATRIX: * * The GObject type for #PangoMatrix **/ #define PANGO_TYPE_MATRIX (pango_matrix_get_type ()) /** * PANGO_MATRIX_INIT: * * Constant that can be used to initialize a PangoMatrix to * the identity transform. * * <informalexample><programlisting> * PangoMatrix matrix = PANGO_MATRIX_INIT; * pango_matrix_rotate (&amp;matrix, 45.); * </programlisting></informalexample> * * Since: 1.6 **/ #define PANGO_MATRIX_INIT { 1., 0., 0., 1., 0., 0. } /* for PangoRectangle */ #include <pango/pango-types.h> GType pango_matrix_get_type (void) G_GNUC_CONST; PangoMatrix *pango_matrix_copy (const PangoMatrix *matrix); void pango_matrix_free (PangoMatrix *matrix); void pango_matrix_translate (PangoMatrix *matrix, double tx, double ty); void pango_matrix_scale (PangoMatrix *matrix, double scale_x, double scale_y); void pango_matrix_rotate (PangoMatrix *matrix, double degrees); void pango_matrix_concat (PangoMatrix *matrix, const PangoMatrix *new_matrix); void pango_matrix_transform_point (const PangoMatrix *matrix, double *x, double *y); void pango_matrix_transform_distance (const PangoMatrix *matrix, double *dx, double *dy); void pango_matrix_transform_rectangle (const PangoMatrix *matrix, PangoRectangle *rect); void pango_matrix_transform_pixel_rectangle (const PangoMatrix *matrix, PangoRectangle *rect); double pango_matrix_get_font_scale_factor (const PangoMatrix *matrix) G_GNUC_PURE; G_END_DECLS #endif /* __PANGO_MATRIX_H__ */
/*=========================================================================== SiI9234_DRIVER.H DESCRIPTION This file explains the SiI9234 initialization and call the virtual main function. Copyright (c) 2002-2009, Silicon Image, Inc. All rights reserved. No part of this work may be reproduced, modified, distributed, transmitted, transcribed, or translated into any language or computer format, in any form or by any means without written permission of: Silicon Image, Inc., 1060 East Arques Avenue, Sunnyvale, California 94085 ===========================================================================*/ /*=========================================================================== EDIT HISTORY FOR FILE when who what, where, why -------- --- ---------------------------------------------------------- 2010/11/06 Daniel Lee(Philju) Initial version of file, SIMG Korea ===========================================================================*/ /*=========================================================================== INCLUDE FILES FOR MODULE ===========================================================================*/ /*=========================================================================== FUNCTION DEFINITIONS ===========================================================================*/ void SiI9234_interrupt_event(void); bool SiI9234_init(void); //Disabling //NAGSM_Android_SEL_Kernel_Aakash_20101206 /*extern byte GetCbusRcpData(void); extern void ResetCbusRcpData(void);*/ //MHL IOCTL INTERFACE #define MHL_READ_RCP_DATA 0x1
/* * Copyright 2010 Tilera Corporation. All Rights Reserved. * * 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. * * 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, GOOD TITLE or * NON INFRINGEMENT. See the GNU General Public License for * more details. */ #ifndef _ASM_TILE_CACHE_H #define _ASM_TILE_CACHE_H #include <linux/const.h> #include <arch/chip.h> /* bytes per L1 data cache line */ #define L1_CACHE_SHIFT CHIP_L1D_LOG_LINE_SIZE() #define L1_CACHE_BYTES (_AC(1,UL) << L1_CACHE_SHIFT) /* bytes per L2 cache line */ #define L2_CACHE_SHIFT CHIP_L2_LOG_LINE_SIZE() #define L2_CACHE_BYTES (1 << L2_CACHE_SHIFT) #define L2_CACHE_ALIGN(x) (((x)+(L2_CACHE_BYTES-1)) & -L2_CACHE_BYTES) /* * TILEPro I/O is not always coherent (networking typically uses coherent * I/O, but PCI traffic does not) and setting ARCH_DMA_MINALIGN to the * L2 cacheline size helps ensure that kernel heap allocations are aligned. * TILE-Gx I/O is always coherent when used on hash-for-home pages. * * However, it's possible at runtime to request not to use hash-for-home * for the kernel heap, in which case the kernel will use flush-and-inval * to manage coherence. As a result, we use L2_CACHE_BYTES for the * DMA minimum alignment to avoid false sharing in the kernel heap. */ #define ARCH_DMA_MINALIGN L2_CACHE_BYTES /* use the cache line size for the L2, which is where it counts */ #define SMP_CACHE_BYTES_SHIFT L2_CACHE_SHIFT #define SMP_CACHE_BYTES L2_CACHE_BYTES #define INTERNODE_CACHE_SHIFT L2_CACHE_SHIFT #define INTERNODE_CACHE_BYTES L2_CACHE_BYTES /* Group together read-mostly things to avoid cache false sharing */ #define __read_mostly __attribute__((__section__(".data..read_mostly"))) /* * Originally we used small TLB pages for kernel data and grouped some * things together as "write once", enforcing the property at the end * of initialization by making those pages read-only and non-coherent. * This allowed better cache utilization since cache inclusion did not * need to be maintained. However, to do this requires an extra TLB * entry, which on balance is more of a performance hit than the * non-coherence is a performance gain, so we now just make "read * mostly" and "write once" be synonyms. We keep the attribute * separate in case we change our minds at a future date. */ #define __write_once __read_mostly #endif /* _ASM_TILE_CACHE_H */
// Copyright 2017 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include <QDockWidget> #include "Common/CommonTypes.h" class QAction; class QCloseEvent; class QShowEvent; class QTableWidget; class QToolBar; class BreakpointWidget : public QDockWidget { Q_OBJECT public: explicit BreakpointWidget(QWidget* parent = nullptr); ~BreakpointWidget(); void AddBP(u32 addr); void AddBP(u32 addr, bool temp, bool break_on_hit, bool log_on_hit); void AddAddressMBP(u32 addr, bool on_read = true, bool on_write = true, bool do_log = true, bool do_break = true); void AddRangedMBP(u32 from, u32 to, bool do_read = true, bool do_write = true, bool do_log = true, bool do_break = true); void UpdateButtonsEnabled(); void Update(); signals: void BreakpointsChanged(); void SelectedBreakpoint(u32 address); protected: void closeEvent(QCloseEvent*) override; void showEvent(QShowEvent* event) override; private: void CreateWidgets(); void OnDelete(); void OnClear(); void OnNewBreakpoint(); void OnLoad(); void OnSave(); void UpdateIcons(); QToolBar* m_toolbar; QTableWidget* m_table; QAction* m_new; QAction* m_delete; QAction* m_clear; QAction* m_load; QAction* m_save; };
/* * Copyright (C) 2013 ARM Ltd. * Copyright (c) 2014, NVIDIA Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * 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/>. */ #include <linux/export.h> #include <linux/slab.h> #include <asm/cacheflush.h> #include <asm/cpu_ops.h> #include <asm/pgtable.h> #include <asm/memory.h> #include <asm/smp_plat.h> #include <asm/suspend.h> #include <asm/tlbflush.h> extern int __cpu_suspend(unsigned long, int (*)(unsigned long)); /* * This is called by __cpu_suspend() to save the state, and do whatever * flushing is required to ensure that when the CPU goes to sleep we have * the necessary data available when the caches are not searched. * * @ptr: CPU context virtual address * @save_ptr: address of the location where the context physical address * must be saved */ void __cpu_suspend_save(struct cpu_suspend_ctx *ptr, u64 *save_ptr) { *save_ptr = virt_to_phys(ptr); ptr->ttbr0_el1 = virt_to_phys(idmap_pg_dir); cpu_do_suspend(ptr); /* * Only flush the context that must be retrieved with the MMU * off. VA primitives ensure the flush is applied to all * cache levels so context is pushed to DRAM. */ __flush_dcache_area(ptr, sizeof(*ptr)); __flush_dcache_area(save_ptr, sizeof(*save_ptr)); } /* * This hook is provided so that cpu_suspend code can restore HW * breakpoints as early as possible in the resume path, before reenabling * debug exceptions. Code cannot be run from a CPU PM notifier since by the * time the notifier runs debug exceptions might have been enabled already, * with HW breakpoints registers content still in an unknown state. */ void (*hw_breakpoint_restore)(void *); void __init cpu_suspend_set_dbg_restorer(void (*hw_bp_restore)(void *)) { /* Prevent multiple restore hook initializations */ if (WARN_ON(hw_breakpoint_restore)) return; hw_breakpoint_restore = hw_bp_restore; } /** * cpu_suspend * * @arg: argument to pass to the finisher function * @fn: suspend finisher function, the function that executes last * operations required to suspend a processor */ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) { struct mm_struct *mm = current->active_mm; int ret; #ifdef CONFIG_ARM64_CPU_SUSPEND int cpu = smp_processor_id(); if (!fn && (!cpu_ops[cpu] || !cpu_ops[cpu]->cpu_suspend)) return -EOPNOTSUPP; if (!fn && cpu_ops[cpu] && cpu_ops[cpu]->cpu_suspend) fn = cpu_ops[cpu]->cpu_suspend; #endif /* * Save the mm context on the stack, it will be restored when * the cpu comes out of reset through the identity mapped * page tables, so that the thread address space is properly * set-up on function return. */ ret = __cpu_suspend(arg, fn); if (ret == 0) { cpu_switch_mm(mm->pgd, mm); flush_tlb_all(); /* * Restore HW breakpoint registers to sane values * before debug exceptions are possibly reenabled * through local_dbg_restore. */ if (hw_breakpoint_restore) hw_breakpoint_restore(NULL); } return ret; } EXPORT_SYMBOL(cpu_suspend); extern struct sleep_save_sp sleep_save_sp; static int cpu_suspend_alloc_sp(void) { void *ctx_ptr; /* ctx_ptr is an array of physical addresses */ ctx_ptr = kcalloc(mpidr_hash_size(), sizeof(phys_addr_t), GFP_KERNEL); if (WARN_ON(!ctx_ptr)) return -ENOMEM; sleep_save_sp.save_ptr_stash = ctx_ptr; sleep_save_sp.save_ptr_stash_phys = virt_to_phys(ctx_ptr); __flush_dcache_area(&sleep_save_sp, sizeof(struct sleep_save_sp)); return 0; } early_initcall(cpu_suspend_alloc_sp);
// // Copyright(C) 2005-2014 Simon Howard // // 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. // // Sound control menu #include <stdlib.h> #include "m_config.h" #include "textscreen.h" #include "mode.h" #include "compatibility.h" #define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup-compat" int vanilla_savegame_limit = 1; int vanilla_demo_limit = 1; void CompatibilitySettings(void) { txt_window_t *window; window = TXT_NewWindow("Compatibility"); TXT_SetWindowHelpURL(window, WINDOW_HELP_URL); TXT_AddWidgets(window, TXT_NewCheckBox("Vanilla savegame limit", &vanilla_savegame_limit), TXT_NewCheckBox("Vanilla demo limit", &vanilla_demo_limit), NULL); } void BindCompatibilityVariables(void) { if (gamemission == doom || gamemission == strife) { M_BindIntVariable("vanilla_savegame_limit", &vanilla_savegame_limit); M_BindIntVariable("vanilla_demo_limit", &vanilla_demo_limit); } }
/***************************************************************************** Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is also distributed with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have included with MySQL. 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, version 2.0, 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, Suite 500, Boston, MA 02110-1335 USA *****************************************************************************/ /******************************************************************//** @file include/ut0sort.h Sort utility Created 11/9/1995 Heikki Tuuri ***********************************************************************/ #ifndef ut0sort_h #define ut0sort_h #include "univ.i" /* This module gives a macro definition of the body of a standard sort function for an array of elements of any type. The comparison function is given as a parameter to the macro. The sort algorithm is mergesort which has logarithmic worst case. */ /*******************************************************************//** This macro expands to the body of a standard sort function. The sort function uses mergesort and must be defined separately for each type of array. Also the comparison function has to be defined individually for each array cell type. SORT_FUN is the sort function name. The function takes the array to be sorted (ARR), the array of auxiliary space (AUX_ARR) of same size, and the low (LOW), inclusive, and high (HIGH), noninclusive, limits for the sort interval as arguments. CMP_FUN is the comparison function name. It takes as arguments two elements from the array and returns 1, if the first is bigger, 0 if equal, and -1 if the second bigger. */ #define UT_SORT_FUNCTION_BODY(SORT_FUN, ARR, AUX_ARR, LOW, HIGH, CMP_FUN)\ {\ ulint ut_sort_mid77;\ ulint ut_sort_i77;\ ulint ut_sort_low77;\ ulint ut_sort_high77;\ \ ut_ad((LOW) < (HIGH));\ ut_ad(ARR);\ ut_ad(AUX_ARR);\ \ if ((LOW) == (HIGH) - 1) {\ return;\ } else if ((LOW) == (HIGH) - 2) {\ if (CMP_FUN((ARR)[LOW], (ARR)[(HIGH) - 1]) > 0) {\ (AUX_ARR)[LOW] = (ARR)[LOW];\ (ARR)[LOW] = (ARR)[(HIGH) - 1];\ (ARR)[(HIGH) - 1] = (AUX_ARR)[LOW];\ }\ return;\ }\ \ ut_sort_mid77 = ((LOW) + (HIGH)) / 2;\ \ SORT_FUN((ARR), (AUX_ARR), (LOW), ut_sort_mid77);\ SORT_FUN((ARR), (AUX_ARR), ut_sort_mid77, (HIGH));\ \ ut_sort_low77 = (LOW);\ ut_sort_high77 = ut_sort_mid77;\ \ for (ut_sort_i77 = (LOW); ut_sort_i77 < (HIGH); ut_sort_i77++) {\ \ if (ut_sort_low77 >= ut_sort_mid77) {\ (AUX_ARR)[ut_sort_i77] = (ARR)[ut_sort_high77];\ ut_sort_high77++;\ } else if (ut_sort_high77 >= (HIGH)) {\ (AUX_ARR)[ut_sort_i77] = (ARR)[ut_sort_low77];\ ut_sort_low77++;\ } else if (CMP_FUN((ARR)[ut_sort_low77],\ (ARR)[ut_sort_high77]) > 0) {\ (AUX_ARR)[ut_sort_i77] = (ARR)[ut_sort_high77];\ ut_sort_high77++;\ } else {\ (AUX_ARR)[ut_sort_i77] = (ARR)[ut_sort_low77];\ ut_sort_low77++;\ }\ }\ \ memcpy((void*) ((ARR) + (LOW)), (AUX_ARR) + (LOW),\ ((HIGH) - (LOW)) * sizeof *(ARR));\ }\ #endif
/* * linux/arch/arm/mach-at91/board-ek.c * * Copyright (C) 2005 SAN People * * Epson S1D framebuffer glue code is: * Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.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 */ #include <linux/types.h> #include <linux/init.h> #include <linux/mm.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/spi/spi.h> #include <linux/mtd/physmap.h> #include <asm/hardware.h> #include <asm/setup.h> #include <asm/mach-types.h> #include <asm/irq.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/irq.h> #include <asm/arch/board.h> #include <asm/arch/gpio.h> #include <asm/arch/at91rm9200_mc.h> #include "generic.h" /* * Serial port configuration. * 0 .. 3 = USART0 .. USART3 * 4 = DBGU */ static struct at91_uart_config __initdata ek_uart_config = { .console_tty = 0, /* ttyS0 */ .nr_tty = 2, .tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */ }; static void __init ek_map_io(void) { /* Initialize processor: 18.432 MHz crystal */ at91rm9200_initialize(18432000, AT91RM9200_BGA); /* Setup the LEDs */ at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2); /* Setup the serial ports and console */ at91_init_serial(&ek_uart_config); } static void __init ek_init_irq(void) { at91rm9200_init_interrupts(NULL); } static struct at91_eth_data __initdata ek_eth_data = { .phy_irq_pin = AT91_PIN_PC4, .is_rmii = 1, }; static struct at91_usbh_data __initdata ek_usbh_data = { .ports = 2, }; static struct at91_udc_data __initdata ek_udc_data = { .vbus_pin = AT91_PIN_PD4, .pullup_pin = AT91_PIN_PD5, }; static struct at91_mmc_data __initdata ek_mmc_data = { .det_pin = AT91_PIN_PB27, .slot_b = 0, .wire4 = 1, .wp_pin = AT91_PIN_PA17, }; static struct spi_board_info ek_spi_devices[] = { { /* DataFlash chip */ .modalias = "mtd_dataflash", .chip_select = 0, .max_speed_hz = 15 * 1000 * 1000, }, #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD { /* DataFlash card */ .modalias = "mtd_dataflash", .chip_select = 3, .max_speed_hz = 15 * 1000 * 1000, }, #endif }; static struct i2c_board_info __initdata ek_i2c_devices[] = { { I2C_BOARD_INFO("ics1523", 0x26), }, { I2C_BOARD_INFO("dac3550", 0x4d), } }; #define EK_FLASH_BASE AT91_CHIPSELECT_0 #define EK_FLASH_SIZE 0x200000 static struct physmap_flash_data ek_flash_data = { .width = 2, }; static struct resource ek_flash_resource = { .start = EK_FLASH_BASE, .end = EK_FLASH_BASE + EK_FLASH_SIZE - 1, .flags = IORESOURCE_MEM, }; static struct platform_device ek_flash = { .name = "physmap-flash", .id = 0, .dev = { .platform_data = &ek_flash_data, }, .resource = &ek_flash_resource, .num_resources = 1, }; static struct gpio_led ek_leds[] = { { /* "user led 1", DS2 */ .name = "green", .gpio = AT91_PIN_PB0, .active_low = 1, .default_trigger = "mmc0", }, { /* "user led 2", DS4 */ .name = "yellow", .gpio = AT91_PIN_PB1, .active_low = 1, .default_trigger = "heartbeat", }, { /* "user led 3", DS6 */ .name = "red", .gpio = AT91_PIN_PB2, .active_low = 1, } }; static void __init ek_board_init(void) { /* Serial */ at91_add_device_serial(); /* Ethernet */ at91_add_device_eth(&ek_eth_data); /* USB Host */ at91_add_device_usbh(&ek_usbh_data); /* USB Device */ at91_add_device_udc(&ek_udc_data); at91_set_multi_drive(ek_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */ /* I2C */ at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); /* SPI */ at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD /* DataFlash card */ at91_set_gpio_output(AT91_PIN_PB22, 0); #else /* MMC */ at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ at91_add_device_mmc(0, &ek_mmc_data); #endif /* NOR Flash */ platform_device_register(&ek_flash); /* LEDs */ at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); /* VGA */ // ek_add_device_video(); } MACHINE_START(AT91RM9200EK, "Atmel AT91RM9200-EK") /* Maintainer: SAN People/Atmel */ .phys_io = AT91_BASE_SYS, .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc, .boot_params = AT91_SDRAM_BASE + 0x100, .timer = &at91rm9200_timer, .map_io = ek_map_io, .init_irq = ek_init_irq, .init_machine = ek_board_init, MACHINE_END
#import <CoreData/CoreData.h> @class Blog; @interface Theme : NSManagedObject @property (nonatomic, retain) NSNumber *popularityRank; @property (nonatomic, retain) NSString *details; @property (nonatomic, retain) NSString *themeId; @property (nonatomic, retain) NSNumber *premium; @property (nonatomic, retain) NSDate *launchDate; @property (nonatomic, retain) NSString *screenshotUrl; @property (nonatomic, retain) NSNumber *trendingRank; @property (nonatomic, retain) NSString *version; @property (nonatomic, retain) NSArray *tags; @property (nonatomic, retain) NSString *name; @property (nonatomic, retain) NSString *previewUrl; @property (nonatomic, retain) Blog *blog; /** * @brief Call this method to know the entity name for objects of this class. * @details Returns the same name as the class for this implementation. If child classes * have a difference in the CoreData and class name, they should override this method. * * @returns The entity name. */ + (NSString *)entityName; - (BOOL)isCurrentTheme; - (BOOL)isPremium; @end
/* Check if effective user id can access file Copyright (C) 1990-2013 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/>. */ /* Written by David MacKenzie and Torbjorn Granlund. Adapted for GNU C library by Roland McGrath. */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <sys/types.h> #include <sys/stat.h> #ifdef S_IEXEC # ifndef S_IXUSR # define S_IXUSR S_IEXEC # endif # ifndef S_IXGRP # define S_IXGRP (S_IEXEC >> 3) # endif # ifndef S_IXOTH # define S_IXOTH (S_IEXEC >> 6) # endif #endif /* S_IEXEC */ #if defined HAVE_UNISTD_H || defined _LIBC # include <unistd.h> #endif #ifndef _POSIX_VERSION uid_t getuid (); gid_t getgid (); uid_t geteuid (); gid_t getegid (); #endif /* not POSIX_VERSION */ #include <errno.h> #ifndef errno extern int errno; #endif #ifndef __set_errno # define __set_errno(val) errno = (val) #endif #if defined EACCES && !defined EACCESS # define EACCESS EACCES #endif #ifndef F_OK # define F_OK 0 # define X_OK 1 # define W_OK 2 # define R_OK 4 #endif #if !defined S_IROTH && defined R_OK # define S_IROTH R_OK #endif #if !defined S_IWOTH && defined W_OK # define S_IWOTH W_OK #endif #if !defined S_IXOTH && defined X_OK # define S_IXOTH X_OK #endif #ifdef _LIBC # define group_member __group_member # define euidaccess __euidaccess #else /* The user's real user id. */ static uid_t uid; /* The user's real group id. */ static gid_t gid; /* The user's effective user id. */ static uid_t euid; /* The user's effective group id. */ static gid_t egid; /* Nonzero if UID, GID, EUID, and EGID have valid values. */ static int have_ids; # ifdef HAVE_GETGROUPS int group_member (); # else # define group_member(gid) 0 # endif #endif /* Return 0 if the user has permission of type MODE on file PATH; otherwise, return -1 and set `errno' to EACCESS. Like access, except that it uses the effective user and group id's instead of the real ones, and it does not check for read-only filesystem, text busy, etc. */ int euidaccess (path, mode) const char *path; int mode; { struct stat64 stats; int granted; #ifdef _LIBC uid_t euid; gid_t egid; #else if (have_ids == 0) { have_ids = 1; uid = getuid (); gid = getgid (); euid = geteuid (); egid = getegid (); } if (uid == euid && gid == egid) /* If we are not set-uid or set-gid, access does the same. */ return access (path, mode); #endif if (stat64 (path, &stats)) return -1; mode &= (X_OK | W_OK | R_OK); /* Clear any bogus bits. */ #if R_OK != S_IROTH || W_OK != S_IWOTH || X_OK != S_IXOTH ?error Oops, portability assumptions incorrect. #endif if (mode == F_OK) return 0; /* The file exists. */ #ifdef _LIBC /* Now we need the IDs. */ euid = __geteuid (); egid = __getegid (); if (__getuid () == euid && __getgid () == egid) /* If we are not set-uid or set-gid, access does the same. */ return __access (path, mode); #endif /* The super-user can read and write any file, and execute any file that anyone can execute. */ if (euid == 0 && ((mode & X_OK) == 0 || (stats.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))) return 0; if (euid == stats.st_uid) granted = (unsigned int) (stats.st_mode & (mode << 6)) >> 6; else if (egid == stats.st_gid || group_member (stats.st_gid)) granted = (unsigned int) (stats.st_mode & (mode << 3)) >> 3; else granted = (stats.st_mode & mode); /* XXX Add support for ACLs. */ if (granted == mode) return 0; __set_errno (EACCESS); return -1; } #undef euidaccess #undef eaccess #ifdef weak_alias weak_alias (__euidaccess, euidaccess) weak_alias (__euidaccess, eaccess) #endif #ifdef TEST # include <stdio.h> # include <errno.h> # include "error.h" char *program_name; int main (argc, argv) int argc; char **argv; { char *file; int mode; int err; program_name = argv[0]; if (argc < 3) abort (); file = argv[1]; mode = atoi (argv[2]); err = euidaccess (file, mode); printf ("%d\n", err); if (err != 0) error (0, errno, "%s", file); exit (0); } #endif
/****************************************************************************** * $Id: FilterButton.h 13162 2012-01-14 17:12:04Z livings124 $ * * Copyright (c) 2007-2012 Transmission authors and contributors * * 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 <Cocoa/Cocoa.h> @interface FilterButton : NSButton { NSUInteger fCount; } - (void) setCount: (NSUInteger) count; @end
/* * Copyright (C) 2011 * Heiko Schocher, DENX Software Engineering, hs@denx.de. * * SPDX-License-Identifier: GPL-2.0+ */ #include <common.h> #include <config.h> #include <spl.h> #include <asm/u-boot.h> #include <asm/utils.h> #include <nand.h> #include <asm/arch/dm365_lowlevel.h> #include <ns16550.h> #include <malloc.h> #include <spi_flash.h> #include <mmc.h> DECLARE_GLOBAL_DATA_PTR; #ifndef CONFIG_SPL_LIBCOMMON_SUPPORT void puts(const char *str) { while (*str) putc(*str++); } void putc(char c) { if (c == '\n') NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), '\r'); NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), c); } #endif /* CONFIG_SPL_LIBCOMMON_SUPPORT */ void spl_board_init(void) { #ifdef CONFIG_SOC_DM365 dm36x_lowlevel_init(0); #endif #ifdef CONFIG_SOC_DA8XX arch_cpu_init(); #endif preloader_console_init(); } u32 spl_boot_mode(void) { return MMCSD_MODE_RAW; } u32 spl_boot_device(void) { #ifdef CONFIG_SPL_NAND_SIMPLE return BOOT_DEVICE_NAND; #elif defined(CONFIG_SPL_SPI_LOAD) return BOOT_DEVICE_SPI; #elif defined(CONFIG_SPL_MMC_LOAD) return BOOT_DEVICE_MMC1; #else puts("Unknown boot device\n"); hang(); #endif }
/* KSysGuard, the KDE System Guard Copyright (c) 1999 - 2001 Chris Schlaeger <cs@kde.org> This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU 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 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 KSG_LMSENSORS_H #define KSG_LMSENSORS_H void initLmSensors( struct SensorModul* ); void exitLmSensors( void ); void printLmSensor( const char* ); void printLmSensorInfo( const char* ); #endif
/* arch/arm/mach-msm/qdsp5v2_1x/adsp_audio.h * * Copyright (C) 2010 Google, Inc. * * 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. * */ #ifndef _MSM_ADSP_AUDIO_H_ #define _MSM_ADSP_AUDIO_H_ struct audplay; struct audpp; struct audplay *audplay_get(void (*cb)(void *cookie), void *cookie); void audplay_put(struct audplay *audplay); void audplay_send_data(struct audplay *audplay, unsigned phys, unsigned len); void audplay_dsp_config(struct audplay *audplay, int enable); void audplay_config_pcm(struct audplay *audplay, unsigned rate, unsigned width, unsigned channels); void audplay_mix_select(struct audplay *audplay, unsigned mix); void audplay_volume_pan(struct audplay *audplay, unsigned volume, unsigned pan); int afe_enable(unsigned device, unsigned rate, unsigned channels); int afe_disable(unsigned device); int msm_codec_output(int enable); void adsp_audio_init(void); #endif
/* Generated by tuneup.c, 2014-03-20, gcc 4.7 */ #define MUL_KARATSUBA_THRESHOLD 21 #define MUL_TOOM3_THRESHOLD 133 #define MUL_TOOM4_THRESHOLD 360 #define MUL_TOOM8H_THRESHOLD 414 #define SQR_BASECASE_THRESHOLD 0 /* always (native) */ #define SQR_KARATSUBA_THRESHOLD 30 #define SQR_TOOM3_THRESHOLD 121 #define SQR_TOOM4_THRESHOLD 532 #define SQR_TOOM8_THRESHOLD 552 #define POWM_THRESHOLD 984 #define DIVREM_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */ #define DIVREM_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */ #define MOD_1_NORM_THRESHOLD 0 /* always */ #define MOD_1_UNNORM_THRESHOLD 0 /* always */ #define USE_PREINV_DIVREM_1 1 /* native */ #define USE_PREINV_MOD_1 1 #define DIVEXACT_1_THRESHOLD 0 /* always */ #define MODEXACT_1_ODD_THRESHOLD 0 /* always (native) */ #define MOD_1_1_THRESHOLD 5 #define MOD_1_2_THRESHOLD 8 #define MOD_1_3_THRESHOLD 32 #define DIVREM_HENSEL_QR_1_THRESHOLD 7 #define RSH_DIVREM_HENSEL_QR_1_THRESHOLD 6 #define DIVREM_EUCLID_HENSEL_THRESHOLD 25 #define MUL_FFT_FULL_THRESHOLD 7232 #define SQR_FFT_FULL_THRESHOLD 3904 #define MULLOW_BASECASE_THRESHOLD 9 #define MULLOW_DC_THRESHOLD 29 #define MULLOW_MUL_THRESHOLD 9970 #define MULHIGH_BASECASE_THRESHOLD 13 #define MULHIGH_DC_THRESHOLD 33 #define MULHIGH_MUL_THRESHOLD 5732 #define MULMOD_2EXPM1_THRESHOLD 16 #define DC_DIV_QR_THRESHOLD 60 #define INV_DIV_QR_THRESHOLD 2747 #define INV_DIVAPPR_Q_N_THRESHOLD 60 #define DC_DIV_Q_THRESHOLD 60 #define INV_DIV_Q_THRESHOLD 2009 #define DC_DIVAPPR_Q_THRESHOLD 32 #define INV_DIVAPPR_Q_THRESHOLD 19406 #define DC_BDIV_QR_THRESHOLD 51 #define DC_BDIV_Q_THRESHOLD 31 #define BINV_NEWTON_THRESHOLD 155 #define REDC_1_TO_REDC_2_THRESHOLD 58 #define REDC_2_TO_REDC_N_THRESHOLD 0 /* always */ #define ROOTREM_THRESHOLD 6 #define MATRIX22_STRASSEN_THRESHOLD 27 #define HGCD_THRESHOLD 105 #define HGCD_APPR_THRESHOLD 50 #define HGCD_REDUCE_THRESHOLD 6852 #define GCD_DC_THRESHOLD 535 #define GCDEXT_DC_THRESHOLD 368 #define JACOBI_BASE_METHOD 1 #define GET_STR_DC_THRESHOLD 13 #define GET_STR_PRECOMPUTE_THRESHOLD 22 #define SET_STR_DC_THRESHOLD 542 #define SET_STR_PRECOMPUTE_THRESHOLD 1655 #define FAC_DSC_THRESHOLD 890 #define FAC_ODD_THRESHOLD 29 /* fft_tuning -- autogenerated by tune-fft */ #define FFT_TAB \ { { 4, 4 }, { 4, 3 }, { 3, 2 }, { 2, 1 }, { 2, 1 } } #define MULMOD_TAB \ { 4, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 1 } #define FFT_N_NUM 23 #define FFT_MULMOD_2EXPP1_CUTOFF 256 /* Tuneup completed successfully, took 151 seconds */
#ifndef RDESTL_FIXED_VECTOR_H #define RDESTL_FIXED_VECTOR_H #include "alignment.h" #include "vector.h" #define RDESTL_RECORD_WATERMARKS 0 // @TODO Wont work on 64-bit! // 4267 -- conversion from size_t to int. #pragma warning(push) #pragma warning(disable: 4267) namespace rde { //============================================================================= template<typename T, class TAllocator, int TCapacity, bool TGrowOnOverflow> struct fixed_vector_storage { explicit fixed_vector_storage(const TAllocator& allocator) : m_begin((T*)&m_data[0]), m_end(m_begin), m_capacityEnd(m_begin + TCapacity), m_allocator(allocator) #if RDESTL_RECORD_WATERMARKS , m_max_size(0) #endif { /**/ } explicit fixed_vector_storage(e_noinitialize) { } // @note Cant shrink void reallocate(base_vector::size_type newCapacity, base_vector::size_type oldSize) { if (!TGrowOnOverflow) { RDE_ASSERT(!"fixed_vector cannot grow"); // @TODO: do something more spectacular here... do NOT throw exception, tho :) } T* newBegin = static_cast<T*>(m_allocator.allocate(newCapacity * sizeof(T))); const base_vector::size_type newSize = oldSize < newCapacity ? oldSize : newCapacity; // Copy old data if needed. if (m_begin) { rde::copy_construct_n(m_begin, newSize, newBegin); destroy(m_begin, oldSize); } m_begin = newBegin; m_end = m_begin + newSize; m_capacityEnd = m_begin + newCapacity; record_high_watermark(); RDE_ASSERT(invariant()); } // Reallocates memory, doesnt copy contents of old buffer. void reallocate_discard_old(base_vector::size_type newCapacity) { if (newCapacity > base_vector::size_type(m_capacityEnd - m_begin)) { if (!TGrowOnOverflow) { RDE_ASSERT(!"fixed_vector cannot grow"); } T* newBegin = static_cast<T*>(m_allocator.allocate(newCapacity * sizeof(T))); const base_vector::size_type currSize((size_t)(m_end - m_begin)); if (m_begin) destroy(m_begin, currSize); m_begin = newBegin; m_end = m_begin + currSize; record_high_watermark(); m_capacityEnd = m_begin + newCapacity; } RDE_ASSERT(invariant()); } RDE_FORCEINLINE void destroy(T* ptr, base_vector::size_type n) { rde::destruct_n(ptr, n); if ((etype_t*)ptr != &m_data[0]) m_allocator.deallocate(ptr, n * sizeof(T)); } bool invariant() const { return m_end >= m_begin; } RDE_FORCEINLINE void record_high_watermark() { #if RDESTL_RECORD_WATERMARKS const base_vector::size_type curr_size((size_t)(m_end - m_begin)); if (curr_size > m_max_size) m_max_size = curr_size; #endif } base_vector::size_type get_high_watermark() const { #if RDESTL_RECORD_WATERMARKS return m_max_size; #else return TCapacity; // ??? #endif } typedef typename aligned_as<T>::res etype_t; T* m_begin; T* m_end; // Not T[], because we need uninitialized memory. etype_t m_data[(TCapacity * sizeof(T)) / sizeof(etype_t)]; T* m_capacityEnd; TAllocator m_allocator; #if RDESTL_RECORD_WATERMARKS base_vector::size_type m_max_size; #endif }; //============================================================================= template<typename T, int TCapacity, bool TGrowOnOverflow, class TAllocator = rde::allocator> class fixed_vector : public vector<T, TAllocator, fixed_vector_storage<T, TAllocator, TCapacity, TGrowOnOverflow> > { typedef vector<T, TAllocator, fixed_vector_storage<T, TAllocator, TCapacity, TGrowOnOverflow> > base_vector; typedef TAllocator allocator_type; typedef typename base_vector::size_type size_type; typedef T value_type; public: explicit fixed_vector(const allocator_type& allocator = allocator_type()) : base_vector(allocator) { /**/ } explicit fixed_vector(size_type initialSize, const allocator_type& allocator = allocator_type()) : base_vector(initialSize, allocator) { /**/ } fixed_vector(const T* first, const T* last, const allocator_type& allocator = allocator_type()) : base_vector(first, last, allocator) { /**/ } // @note: allocator is not copied from rhs. // @note: will not perform default constructor for newly created objects. fixed_vector(const fixed_vector& rhs, const allocator_type& allocator = allocator_type()) : base_vector(rhs, allocator) { /**/ } explicit fixed_vector(e_noinitialize n) : base_vector(n) { /**/ } fixed_vector& operator=(const fixed_vector& rhs) { if (&rhs != this) { base_vector::copy(rhs); } return *this; } }; #pragma warning(pop) } // rde #endif // #ifndef RDESTL_FIXED_VECTOR_H
#ifndef BACKENDS_NULL_H #define BACKENDS_NULL_H #include "backends/base.h" struct NullBackendFactory final : public BackendFactory { public: bool init() override; bool querySupport(BackendType type) override; void probe(DevProbe type, std::string *outnames) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; static BackendFactory &getFactory(); }; #endif /* BACKENDS_NULL_H */
// Copyright 2012 Google 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. // // Utilities for dealing with block-graphs and blocks. #ifndef SYZYGY_BLOCK_GRAPH_BLOCK_UTIL_H_ #define SYZYGY_BLOCK_GRAPH_BLOCK_UTIL_H_ #include "syzygy/block_graph/basic_block.h" #include "syzygy/block_graph/basic_block_subgraph.h" #include "syzygy/block_graph/block_graph.h" namespace block_graph { // Determines whether @p bb's instructions and successors comprise a contiguous // source range, and return it if so. // @param bb the basic block to inspect. // @param source_range returns @p bb's source range on success. // @returns true iff @p bb's instructions and successors comprise a contiguous // source range. // @note @p bb's source range is deemed contiguous if at least one instruction // or successor has a source range, and if all the source ranges constitute // a single contiguous range, irrespective order. This means that this // function may succeed even if instructions in @p bb have been added, // reordered or mutated. bool GetBasicBlockSourceRange(const BasicCodeBlock& bb, BlockGraph::Block::SourceRange* source_range); // Returns true if the given references @p ref from @p referrer may not safely // be redirected. If both the referrer and the referenced blocks are irregular // in any way (i.e., inline assembly, not generated by cl.exe, etc) we cannot // safely assume that @p ref has call semantics, i.e., where a return address // is at the top of stack at entry. Ideally we would decide this on the basis // of a full stack analysis, but beggars can't be choosers; plus, for // hand-coded assembly that's the halting problem :). // For any instrumentation or manipulation that uses return address swizzling, // instrumenting an unsafe reference generally leads to crashes. bool IsUnsafeReference(const BlockGraph::Block* referrer, const BlockGraph::Reference& ref); // Returns true if there are any instructions manipulating the stack frame // pointer in an unexpected way. We expect the compiler to produce a standard // stack frame with two pointers (base EBP, top ESP). Any writes to EBP inside // this scope is reported as unexpected by this function. // @param subgraph The subgraph to inspect. bool HasUnexpectedStackFrameManipulation(BasicBlockSubGraph* subgraph); // Calculates the number of entries in a given jump table. A jump table is a run // of contiguous 32-bit references terminating when there is no next reference, // at the next data label or the end of the block, whichever comes first. // @param block The block containing this jump table. // @param jump_table_label An iterator to the jump table label in this block. // @param table_size Will receive the size of the jump table. // @returns true on success, false otherwise. bool GetJumpTableSize(const block_graph::BlockGraph::Block* block, block_graph::BlockGraph::Block::LabelMap::const_iterator jump_table_label, size_t* table_size); } // namespace block_graph #endif // SYZYGY_BLOCK_GRAPH_BLOCK_UTIL_H_
/* The MIT License Copyright (c) 2008 Genome Research Ltd (GRL). 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. */ /* Contact: Heng Li <lh3@sanger.ac.uk> */ #ifndef BWA_BWT_H #define BWA_BWT_H #include <stdint.h> #include <stddef.h> // requirement: (OCC_INTERVAL%16 == 0); please DO NOT change this line because some part of the code assume OCC_INTERVAL=0x80 #define OCC_INTV_SHIFT 7 #define OCC_INTERVAL (1LL<<OCC_INTV_SHIFT) #define OCC_INTV_MASK (OCC_INTERVAL - 1) #ifndef BWA_UBYTE #define BWA_UBYTE typedef unsigned char ubyte_t; #endif typedef uint64_t bwtint_t; typedef struct { bwtint_t primary; // S^{-1}(0), or the primary index of BWT bwtint_t L2[5]; // C(), cumulative count bwtint_t seq_len; // sequence length bwtint_t bwt_size; // size of bwt, about seq_len/4 uint32_t *bwt; // BWT // occurance array, separated to two parts uint32_t cnt_table[256]; // suffix array int sa_intv; bwtint_t n_sa; bwtint_t *sa; } bwt_t; typedef struct { bwtint_t x[3], info; } bwtintv_t; typedef struct { size_t n, m; bwtintv_t *a; } bwtintv_v; /* For general OCC_INTERVAL, the following is correct: #define bwt_bwt(b, k) ((b)->bwt[(k)/OCC_INTERVAL * (OCC_INTERVAL/(sizeof(uint32_t)*8/2) + sizeof(bwtint_t)/4*4) + sizeof(bwtint_t)/4*4 + (k)%OCC_INTERVAL/16]) #define bwt_occ_intv(b, k) ((b)->bwt + (k)/OCC_INTERVAL * (OCC_INTERVAL/(sizeof(uint32_t)*8/2) + sizeof(bwtint_t)/4*4) */ // The following two lines are ONLY correct when OCC_INTERVAL==0x80 #define bwt_bwt(b, k) ((b)->bwt[((k)>>7<<4) + sizeof(bwtint_t) + (((k)&0x7f)>>4)]) #define bwt_occ_intv(b, k) ((b)->bwt + ((k)>>7<<4)) /* retrieve a character from the $-removed BWT string. Note that * bwt_t::bwt is not exactly the BWT string and therefore this macro is * called bwt_B0 instead of bwt_B */ #define bwt_B0(b, k) (bwt_bwt(b, k)>>((~(k)&0xf)<<1)&3) #define bwt_set_intv(bwt, c, ik) ((ik).x[0] = (bwt)->L2[(int)(c)]+1, (ik).x[2] = (bwt)->L2[(int)(c)+1]-(bwt)->L2[(int)(c)], (ik).x[1] = (bwt)->L2[3-(c)]+1, (ik).info = 0) #ifdef __cplusplus extern "C" { #endif void bwt_dump_bwt(const char *fn, const bwt_t *bwt); void bwt_dump_sa(const char *fn, const bwt_t *bwt); bwt_t *bwt_restore_bwt(const char *fn); void bwt_restore_sa(const char *fn, bwt_t *bwt); void bwt_destroy(bwt_t *bwt); void bwt_bwtgen(const char *fn_pac, const char *fn_bwt); // from BWT-SW void bwt_cal_sa(bwt_t *bwt, int intv); void bwt_bwtupdate_core(bwt_t *bwt); bwtint_t bwt_occ(const bwt_t *bwt, bwtint_t k, ubyte_t c); void bwt_occ4(const bwt_t *bwt, bwtint_t k, bwtint_t cnt[4]); bwtint_t bwt_sa(const bwt_t *bwt, bwtint_t k); // more efficient version of bwt_occ/bwt_occ4 for retrieving two close Occ values void bwt_gen_cnt_table(bwt_t *bwt); void bwt_2occ(const bwt_t *bwt, bwtint_t k, bwtint_t l, ubyte_t c, bwtint_t *ok, bwtint_t *ol); void bwt_2occ4(const bwt_t *bwt, bwtint_t k, bwtint_t l, bwtint_t cntk[4], bwtint_t cntl[4]); int bwt_match_exact(const bwt_t *bwt, int len, const ubyte_t *str, bwtint_t *sa_begin, bwtint_t *sa_end); int bwt_match_exact_alt(const bwt_t *bwt, int len, const ubyte_t *str, bwtint_t *k0, bwtint_t *l0); /** * Extend bi-SA-interval _ik_ */ void bwt_extend(const bwt_t *bwt, const bwtintv_t *ik, bwtintv_t ok[4], int is_back); /** * Given a query _q_, collect potential SMEMs covering position _x_ and store them in _mem_. * Return the end of the longest exact match starting from _x_. */ int bwt_smem1(const bwt_t *bwt, int len, const uint8_t *q, int x, int min_intv, bwtintv_v *mem, bwtintv_v *tmpvec[2]); // SMEM iterator interface #ifdef __cplusplus } #endif #endif
/* * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. 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. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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 <aws/email/SES_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace SES { namespace Model { enum class IdentityType { NOT_SET, EmailAddress, Domain }; namespace IdentityTypeMapper { AWS_SES_API IdentityType GetIdentityTypeForName(const Aws::String& name); AWS_SES_API Aws::String GetNameForIdentityType(IdentityType value); } // namespace IdentityTypeMapper } // namespace Model } // namespace SES } // namespace Aws
/* * This file is a part of the open source stm32plus library. * Copyright (c) 2011,2012,2013,2014 Andy Brown <www.andybrown.me.uk> * Please see website for licensing terms. */ #pragma once // ensure the MCU series is correct #ifndef STM32PLUS_F4 #error This class can only be used with the STM32F4 series #endif namespace stm32plus { /** * Feature collection for this DMA channel. Parameterise this class with the features * that you want to use on this channel. */ template<class... Features> class Dma2Channel2Stream0 : public Dma, public Features... { public: /** * Constructor */ Dma2Channel2Stream0() : Dma(DMA2_Stream0,DMA_Channel_2,DMA_FLAG_TCIF0,DMA_FLAG_HTIF0,DMA_FLAG_TEIF0), Features(static_cast<Dma&>(*this))... { ClockControl<PERIPHERAL_DMA2>::On(); } }; /** * Types for the peripherals mapped to this channel */ template<class... Features> using Adc3DmaChannel=Dma2Channel2Stream0<Features...>; }
// 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 THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_WIN_FALLBACK_FAMILY_STYLE_CACHE_WIN_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_WIN_FALLBACK_FAMILY_STYLE_CACHE_WIN_H_ #include "third_party/blink/renderer/platform/fonts/font_description.h" #include "third_party/blink/renderer/platform/fonts/font_fallback_priority.h" #include "third_party/blink/renderer/platform/wtf/lru_cache.h" #include "third_party/skia/include/core/SkRefCnt.h" #include "third_party/skia/include/core/SkTypeface.h" namespace blink { using TypefaceVector = Vector<sk_sp<SkTypeface>>; using FallbackLruCache = WTF::LruCache<String, TypefaceVector>; class FallbackFamilyStyleCache { USING_FAST_MALLOC(FallbackFamilyStyleCache); public: FallbackFamilyStyleCache(); FallbackFamilyStyleCache(const FallbackFamilyStyleCache&) = delete; FallbackFamilyStyleCache& operator=(const FallbackFamilyStyleCache&) = delete; // Places a SkTypeface object in the cache for specified language tag and // fallback priority, taking a reference on SkTypeface. Adds the |SkTypeface| // to the beginning of a list of typefaces if previous |SkTypefaces| objects // where added for this set of parameters. Note, the internal list of // typefaces for a language tag and fallback priority is not checked for // duplicates when adding a |typeface| object. void Put(FontDescription::GenericFamilyType generic_family, String bcp47_language_tag, FontFallbackPriority fallback_priority, SkTypeface* typeface); // Fetches a |fallback_family| and |fallback_style| for a given language tag, // fallback priority and codepoint. Checks the internal cache for whether a // fallback font with glyph coverage for |character| is available for the // given parameters, then returns its family name and style. void Get(FontDescription::GenericFamilyType generic_family, String bcp47_language_tag, FontFallbackPriority fallback_priority, UChar32 character, String* fallback_family, SkFontStyle* fallback_style); // Empties the internal cache, deleting keys and unrefing the typefaces that // were placed in the cache. void Clear(); private: FallbackLruCache recent_fallback_fonts_; }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_WIN_FALLBACK_FAMILY_STYLE_CACHE_WIN_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_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_ #define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_ #include <string> #include <vector> #include "base/callback_forward.h" namespace gcm { class GCMDriver; } namespace net { class URLRequestContextGetter; } namespace copresence { class Message; class WhispernetClient; // AUDIO_FAIL indicates that we weren't able to hear the audio token that // we were playing. enum CopresenceStatus { SUCCESS, FAIL, AUDIO_FAIL }; // Callback type to send a status. using StatusCallback = base::Callback<void(CopresenceStatus)>; // A delegate interface for users of Copresence. class CopresenceDelegate { public: // This method will be called when we have subscribed messages // that need to be sent to their respective apps. virtual void HandleMessages( const std::string& app_id, const std::string& subscription_id, const std::vector<Message>& messages) = 0; virtual void HandleStatusUpdate(CopresenceStatus status) = 0; // Thw URLRequestContextGetter must outlive the CopresenceManager. virtual net::URLRequestContextGetter* GetRequestContext() const = 0; virtual const std::string GetPlatformVersionString() const = 0; // This is deprecated. Clients should pass in the project ID instead. virtual const std::string GetAPIKey(const std::string& app_id) const = 0; virtual const std::string GetProjectId(const std::string& app_id) const = 0; // Thw WhispernetClient must outlive the CopresenceManager. virtual WhispernetClient* GetWhispernetClient() = 0; // Clients may optionally provide a GCMDriver to receive messages from. // If no driver is available, this can return null. virtual gcm::GCMDriver* GetGCMDriver() = 0; // Get the copresence device ID for authenticated or anonymous calls, // as specified. If none exists, return the empty string. virtual const std::string GetDeviceId(bool authenticated) = 0; // Save a copresence device ID for authenticated or anonymous calls. // If the device ID is empty, any stored ID should be deleted. virtual void SaveDeviceId(bool authenticated, const std::string& device_id) = 0; protected: virtual ~CopresenceDelegate() {} }; } // namespace copresence #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_DELEGATE_H_
// // IClientSharedObjectDelegate.h // RTMPStream // // Created by Вячеслав Вдовиченко on 12.05.11. // Copyright 2011 The Midnight Coders, Inc. All rights reserved. // #import <Foundation/Foundation.h> @protocol ISharedObjectMessage; @protocol IClientSharedObjectDelegate <NSObject> -(void)makeUpdateMessage:(id <ISharedObjectMessage>)message; @end
/* { dg-options "-O -msve-vector-bits=512" } */ typedef float v16sf __attribute__ ((vector_size(64))); v16sf foo (float a) { return (v16sf) { 0, 0, 0, a, 0, 0, 0, 0, 0, a, 0, 0, 0, 0, 0, 0 }; }
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === * * Copyright 2013, Uwe L. Korn <uwelk@xhochy.com> * * Tomahawk 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. * * Tomahawk 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 Tomahawk. If not, see <http://www.gnu.org/licenses/>. */ #ifndef TOMAHAWK_UTILS_WEAKOBJECTLIST_H #define TOMAHAWK_UTILS_WEAKOBJECTLIST_H #include <QList> #include <QObject> #include <QWeakPointer> namespace Tomahawk { namespace Utils { class WeakObjectListBase { public: virtual void remove( QObject* object ); virtual ~WeakObjectListBase(); protected: WeakObjectListBase() {} }; class WeakObjectListPrivate : public QObject { Q_OBJECT public: WeakObjectListPrivate( WeakObjectListBase* parent ); public slots: void remove( QObject* object ); private: WeakObjectListBase* m_parent; }; template<class T> class WeakObjectList : public WeakObjectListBase { typedef QWeakPointer<T> wptr; public: WeakObjectList() : m_private( this ) {} WeakObjectList( const WeakObjectList& list ) : m_list( list.m_list ) , m_private( this ) { } void insert( const QSharedPointer<T>& value ) { m_private.connect( value.data(), SIGNAL( destroyed( QObject* ) ), &m_private, SLOT( remove( QObject* )) ); m_list.append( value.toWeakRef() ); } const QList<wptr>& list() { return m_list; } QMutableListIterator< wptr > iter() { return QMutableListIterator< wptr >( m_list ); } virtual void remove( QObject* object ) { QMutableListIterator< wptr > iter( m_list ); while ( iter.hasNext() ) { wptr ptr = iter.next(); if ( ptr.data() == object || ptr.isNull() ) { iter.remove(); } } } private: QList< wptr > m_list; WeakObjectListPrivate m_private; }; } // namespace Utils } // namespace Tomahawk #endif // TOMAHAWK_UTILS_WEAKOBJECTLIST_H
#ifndef TENSORFLOW_FRAMEWORK_QUEUE_INTERFACE_H_ #define TENSORFLOW_FRAMEWORK_QUEUE_INTERFACE_H_ #include <string> #include <vector> #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/framework/resource_mgr.h" #include "tensorflow/core/framework/types.h" #include "tensorflow/core/platform/port.h" #include "tensorflow/core/public/tensor.h" namespace tensorflow { // All implementations must be thread-safe. class QueueInterface : public ResourceBase { public: typedef std::vector<Tensor> Tuple; typedef AsyncOpKernel::DoneCallback DoneCallback; typedef std::function<void(const Tuple&)> CallbackWithTuple; virtual Status ValidateTuple(const Tuple& tuple) = 0; virtual Status ValidateManyTuple(const Tuple& tuple) = 0; // Stashes a function object for future execution, that will eventually // enqueue the tuple of tensors into the queue, and returns immediately. The // function object is guaranteed to call 'callback'. virtual void TryEnqueue(const Tuple& tuple, OpKernelContext* ctx, DoneCallback callback) = 0; // Same as above, but the component tensors are sliced along the 0th dimension // to make multiple queue-element components. virtual void TryEnqueueMany(const Tuple& tuple, OpKernelContext* ctx, DoneCallback callback) = 0; // Stashes a function object for future execution, that will eventually // dequeue an element from the queue and call 'callback' with that tuple // element as argument. virtual void TryDequeue(OpKernelContext* ctx, CallbackWithTuple callback) = 0; // Same as above, but the stashed function object will attempt to dequeue // num_elements items. virtual void TryDequeueMany(int num_elements, OpKernelContext* ctx, CallbackWithTuple callback) = 0; // Signals that no more elements will be enqueued, and optionally // cancels pending Enqueue(Many) operations. // // After calling this function, subsequent calls to Enqueue(Many) // will fail. If `cancel_pending_enqueues` is true, all pending // calls to Enqueue(Many) will fail as well. // // After calling this function, all current and subsequent calls to // Dequeue(Many) will fail instead of blocking (though they may // succeed if they can be satisfied by the elements in the queue at // the time it was closed). virtual void Close(OpKernelContext* ctx, bool cancel_pending_enqueues, DoneCallback callback) = 0; // Assuming *this represents a shared queue, verify that it matches // another instantiation indicated by node_def. virtual Status MatchesNodeDef(const NodeDef& node_def) = 0; // Returns the number of elements in the queue. virtual int32 size() = 0; virtual const DataTypeVector& component_dtypes() const = 0; string DebugString() override { return "A queue"; } protected: virtual ~QueueInterface() {} }; } // namespace tensorflow #endif // TENSORFLOW_FRAMEWORK_QUEUE_INTERFACE_H_
#ifndef CYCLUS_TESTS_TOOLKIT_COMMODITY_TEST_HELPER_H_ #define CYCLUS_TESTS_TOOLKIT_COMMODITY_TEST_HELPER_H_ #include <string> #include "toolkit/commodity.h" #include "toolkit/commodity_producer.h" #include "toolkit/commodity_producer_manager.h" namespace cyclus { namespace toolkit { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - class CommodityTestHelper { public: /// constructor CommodityTestHelper(); /// destructor ~CommodityTestHelper(); /// commodity name std::string commodity_name; /// commodity Commodity commodity; /// first producer CommodityProducer* producer1; /// second producer CommodityProducer* producer2; /// production capacity double capacity; /// number of producers int nproducers; /// a manager of commodity producers CommodityProducerManager manager; /// initialize the producers void SetUpProducers(); /// initialize the producer manager void SetUpProducerManager(); }; } // namespace toolkit } // namespace cyclus #endif // CYCLUS_TESTS_TOOLKIT_COMMODITY_TEST_HELPER_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 THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_SCOPED_REFPTR_CROSS_THREAD_COPIER_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_SCOPED_REFPTR_CROSS_THREAD_COPIER_H_ #include "third_party/blink/renderer/platform/wtf/cross_thread_copier.h" #include "third_party/webrtc/api/scoped_refptr.h" namespace WTF { template <typename T> struct CrossThreadCopier<rtc::scoped_refptr<T>> { STATIC_ONLY(CrossThreadCopier); using Type = rtc::scoped_refptr<T>; static Type Copy(Type pointer) { return pointer; } }; } // namespace WTF #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_SCOPED_REFPTR_CROSS_THREAD_COPIER_H_
/* Copyright (C) 2006, 2007, 2008, 2009 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 V8NPUtils_h #define V8NPUtils_h #include <bindings/npruntime.h> #include <v8.h> namespace blink { // Convert a V8 Value of any type (string, bool, object, etc) to a NPVariant. void convertV8ObjectToNPVariant(v8::Isolate*, v8::Local<v8::Value>, NPObject*, NPVariant*); // Convert a NPVariant (string, bool, object, etc) back to a V8 Value. The owner object is the NPObject which relates to the // object, if the object is an Object. The created NPObject will be tied to the lifetime of the owner. v8::Handle<v8::Value> convertNPVariantToV8Object(v8::Isolate*, const NPVariant*, NPObject*); // Helper function to create an NPN String Identifier from a v8 string. NPIdentifier getStringIdentifier(v8::Handle<v8::String>); // The ExceptionHandler will be notified of any exceptions thrown while // operating on a NPObject. typedef void (*ExceptionHandler)(void* data, const NPUTF8* message); void pushExceptionHandler(ExceptionHandler, void* data); void popExceptionHandler(); // Upon destruction, an ExceptionCatcher will pass a caught exception to the // current ExceptionHandler. class ExceptionCatcher { public: ExceptionCatcher(); ~ExceptionCatcher(); private: v8::TryCatch m_tryCatch; }; } // namespace blink #endif // V8NPUtils_h
/* SCTP kernel implementation * (C) Copyright 2007 Hewlett-Packard Development Company, L.P. * * This file is part of the SCTP kernel implementation * * This SCTP implementation 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. * * This SCTP implementation 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 GNU CC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * * Please send any bug reports or fixes you make to the * email address(es): * lksctp developers <linux-sctp@vger.kernel.org> * * Written or modified by: * Vlad Yasevich <vladislav.yasevich@hp.com> */ #ifndef __sctp_auth_h__ #define __sctp_auth_h__ #include <linux/list.h> #include <linux/crypto.h> struct sctp_endpoint; struct sctp_association; struct sctp_authkey; struct sctp_hmacalgo; /* * Define a generic struct that will hold all the info * necessary for an HMAC transform */ struct sctp_hmac { __u16 hmac_id; /* one of the above ids */ char *hmac_name; /* name for loading */ __u16 hmac_len; /* length of the signature */ }; /* This is generic structure that containst authentication bytes used * as keying material. It's a what is referred to as byte-vector all * over SCTP-AUTH */ struct sctp_auth_bytes { atomic_t refcnt; __u32 len; __u8 data[]; }; /* Definition for a shared key, weather endpoint or association */ struct sctp_shared_key { struct list_head key_list; __u16 key_id; struct sctp_auth_bytes *key; }; #define key_for_each(__key, __list_head) \ list_for_each_entry(__key, __list_head, key_list) #define key_for_each_safe(__key, __tmp, __list_head) \ list_for_each_entry_safe(__key, __tmp, __list_head, key_list) static inline void sctp_auth_key_hold(struct sctp_auth_bytes *key) { if (!key) return; atomic_inc(&key->refcnt); } void sctp_auth_key_put(struct sctp_auth_bytes *key); struct sctp_shared_key *sctp_auth_shkey_create(__u16 key_id, gfp_t gfp); void sctp_auth_destroy_keys(struct list_head *keys); int sctp_auth_asoc_init_active_key(struct sctp_association *asoc, gfp_t gfp); struct sctp_shared_key *sctp_auth_get_shkey( const struct sctp_association *asoc, __u16 key_id); int sctp_auth_asoc_copy_shkeys(const struct sctp_endpoint *ep, struct sctp_association *asoc, gfp_t gfp); int sctp_auth_init_hmacs(struct sctp_endpoint *ep, gfp_t gfp); void sctp_auth_destroy_hmacs(struct crypto_hash *auth_hmacs[]); struct sctp_hmac *sctp_auth_get_hmac(__u16 hmac_id); struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc); void sctp_auth_asoc_set_default_hmac(struct sctp_association *asoc, struct sctp_hmac_algo_param *hmacs); int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc, __be16 hmac_id); int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc); int sctp_auth_recv_cid(sctp_cid_t chunk, const struct sctp_association *asoc); void sctp_auth_calculate_hmac(const struct sctp_association *asoc, struct sk_buff *skb, struct sctp_auth_chunk *auth, gfp_t gfp); /* API Helpers */ int sctp_auth_ep_add_chunkid(struct sctp_endpoint *ep, __u8 chunk_id); int sctp_auth_ep_set_hmacs(struct sctp_endpoint *ep, struct sctp_hmacalgo *hmacs); int sctp_auth_set_key(struct sctp_endpoint *ep, struct sctp_association *asoc, struct sctp_authkey *auth_key); int sctp_auth_set_active_key(struct sctp_endpoint *ep, struct sctp_association *asoc, __u16 key_id); int sctp_auth_del_key_id(struct sctp_endpoint *ep, struct sctp_association *asoc, __u16 key_id); #endif
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2020 Jim Mussared * * 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. */ #include "py/runtime.h" #include "py/mperrno.h" #include "py/mphal.h" #if MICROPY_PY_BLUETOOTH && MICROPY_BLUETOOTH_BTSTACK #include "lib/btstack/src/btstack.h" #include "lib/btstack/platform/embedded/btstack_run_loop_embedded.h" #include "lib/btstack/platform/embedded/hal_cpu.h" #include "lib/btstack/platform/embedded/hal_time_ms.h" #include "extmod/btstack/modbluetooth_btstack.h" #include "mpbtstackport.h" // Called by the UART polling thread in mpbthciport.c, or by the USB polling thread in mpbtstackport_usb.c. bool mp_bluetooth_hci_poll(void) { if (mp_bluetooth_btstack_state == MP_BLUETOOTH_BTSTACK_STATE_STARTING || mp_bluetooth_btstack_state == MP_BLUETOOTH_BTSTACK_STATE_ACTIVE || mp_bluetooth_btstack_state == MP_BLUETOOTH_BTSTACK_STATE_HALTING) { // Pretend like we're running in IRQ context (i.e. other things can't be running at the same time). mp_uint_t atomic_state = MICROPY_BEGIN_ATOMIC_SECTION(); #if MICROPY_BLUETOOTH_BTSTACK_H4 mp_bluetooth_hci_poll_h4(); #endif btstack_run_loop_embedded_execute_once(); MICROPY_END_ATOMIC_SECTION(atomic_state); return true; } return false; } bool mp_bluetooth_hci_active(void) { return mp_bluetooth_btstack_state != MP_BLUETOOTH_BTSTACK_STATE_OFF && mp_bluetooth_btstack_state != MP_BLUETOOTH_BTSTACK_STATE_TIMEOUT; } // The IRQ functionality in btstack_run_loop_embedded.c is not used, so the // following three functions are empty. void hal_cpu_disable_irqs(void) { } void hal_cpu_enable_irqs(void) { } void hal_cpu_enable_irqs_and_sleep(void) { } uint32_t hal_time_ms(void) { return mp_hal_ticks_ms(); } void mp_bluetooth_btstack_port_init(void) { static bool run_loop_init = false; if (!run_loop_init) { run_loop_init = true; btstack_run_loop_init(btstack_run_loop_embedded_get_instance()); } else { btstack_run_loop_embedded_get_instance()->init(); } // hci_dump_open(NULL, HCI_DUMP_STDOUT); #if MICROPY_BLUETOOTH_BTSTACK_H4 mp_bluetooth_btstack_port_init_h4(); #endif #if MICROPY_BLUETOOTH_BTSTACK_USB mp_bluetooth_btstack_port_init_usb(); #endif } #endif // MICROPY_PY_BLUETOOTH && MICROPY_BLUETOOTH_BTSTACK
/* bind.c - DNS SRV backend bind function */ /* $OpenLDAP: pkg/ldap/servers/slapd/back-dnssrv/bind.c,v 1.11.2.2 2003/03/03 17:10:09 kurt Exp $ */ /* * Copyright 2000-2003 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ #include "portable.h" #include <stdio.h> #include <ac/socket.h> #include <ac/string.h> #include "slap.h" #include "external.h" int dnssrv_back_bind( Backend *be, Connection *conn, Operation *op, struct berval *dn, struct berval *ndn, int method, struct berval *cred, struct berval *edn ) { Debug( LDAP_DEBUG_TRACE, "DNSSRV: bind %s (%d)\n", dn->bv_val == NULL ? "" : dn->bv_val, method, NULL ); if( method == LDAP_AUTH_SIMPLE && cred != NULL && cred->bv_len ) { Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu DNSSRV BIND dn=\"%s\" provided passwd\n", op->o_connid, op->o_opid, dn->bv_val == NULL ? "" : dn->bv_val , 0, 0 ); Debug( LDAP_DEBUG_TRACE, "DNSSRV: BIND dn=\"%s\" provided cleartext password\n", dn->bv_val == NULL ? "" : dn->bv_val, 0, 0 ); send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, NULL, "you shouldn\'t send strangers your password", NULL, NULL ); } else { Debug( LDAP_DEBUG_TRACE, "DNSSRV: BIND dn=\"%s\"\n", dn->bv_val == NULL ? "" : dn->bv_val, 0, 0 ); send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, NULL, "anonymous bind expected", NULL, NULL ); } return 1; }
/* $Id: tif_codec.c,v 1.4 2012/10/07 15:54:03 drolon Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. * * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ /* * TIFF Library * * Builtin Compression Scheme Configuration Support. */ #include "tiffiop.h" static int NotConfigured(TIFF*, int); #ifndef LZW_SUPPORT #define TIFFInitLZW NotConfigured #endif #ifndef PACKBITS_SUPPORT #define TIFFInitPackBits NotConfigured #endif #ifndef THUNDER_SUPPORT #define TIFFInitThunderScan NotConfigured #endif #ifndef NEXT_SUPPORT #define TIFFInitNeXT NotConfigured #endif #ifndef JPEG_SUPPORT #define TIFFInitJPEG NotConfigured #endif #ifndef OJPEG_SUPPORT #define TIFFInitOJPEG NotConfigured #endif #ifndef CCITT_SUPPORT #define TIFFInitCCITTRLE NotConfigured #define TIFFInitCCITTRLEW NotConfigured #define TIFFInitCCITTFax3 NotConfigured #define TIFFInitCCITTFax4 NotConfigured #endif #ifndef JBIG_SUPPORT #define TIFFInitJBIG NotConfigured #endif #ifndef ZIP_SUPPORT #define TIFFInitZIP NotConfigured #endif #ifndef PIXARLOG_SUPPORT #define TIFFInitPixarLog NotConfigured #endif #ifndef LOGLUV_SUPPORT #define TIFFInitSGILog NotConfigured #endif #ifndef LZMA_SUPPORT #define TIFFInitLZMA NotConfigured #endif /* * Compression schemes statically built into the library. */ #ifdef VMS const TIFFCodec _TIFFBuiltinCODECS[] = { #else TIFFCodec _TIFFBuiltinCODECS[] = { #endif { "None", COMPRESSION_NONE, TIFFInitDumpMode }, { "LZW", COMPRESSION_LZW, TIFFInitLZW }, { "PackBits", COMPRESSION_PACKBITS, TIFFInitPackBits }, { "ThunderScan", COMPRESSION_THUNDERSCAN,TIFFInitThunderScan }, { "NeXT", COMPRESSION_NEXT, TIFFInitNeXT }, { "JPEG", COMPRESSION_JPEG, TIFFInitJPEG }, { "Old-style JPEG", COMPRESSION_OJPEG, TIFFInitOJPEG }, { "CCITT RLE", COMPRESSION_CCITTRLE, TIFFInitCCITTRLE }, { "CCITT RLE/W", COMPRESSION_CCITTRLEW, TIFFInitCCITTRLEW }, { "CCITT Group 3", COMPRESSION_CCITTFAX3, TIFFInitCCITTFax3 }, { "CCITT Group 4", COMPRESSION_CCITTFAX4, TIFFInitCCITTFax4 }, { "ISO JBIG", COMPRESSION_JBIG, TIFFInitJBIG }, { "Deflate", COMPRESSION_DEFLATE, TIFFInitZIP }, { "AdobeDeflate", COMPRESSION_ADOBE_DEFLATE , TIFFInitZIP }, { "PixarLog", COMPRESSION_PIXARLOG, TIFFInitPixarLog }, { "SGILog", COMPRESSION_SGILOG, TIFFInitSGILog }, { "SGILog24", COMPRESSION_SGILOG24, TIFFInitSGILog }, { "LZMA", COMPRESSION_LZMA, TIFFInitLZMA }, { NULL, 0, NULL } }; static int _notConfigured(TIFF* tif) { const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression); char compression_code[20]; sprintf( compression_code, "%d", tif->tif_dir.td_compression ); TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "%s compression support is not configured", c ? c->name : compression_code ); return (0); } static int NotConfigured(TIFF* tif, int scheme) { (void) scheme; tif->tif_fixuptags = _notConfigured; tif->tif_decodestatus = FALSE; tif->tif_setupdecode = _notConfigured; tif->tif_encodestatus = FALSE; tif->tif_setupencode = _notConfigured; return (1); } /************************************************************************/ /* TIFFIsCODECConfigured() */ /************************************************************************/ /** * Check whether we have working codec for the specific coding scheme. * * @return returns 1 if the codec is configured and working. Otherwise * 0 will be returned. */ int TIFFIsCODECConfigured(uint16 scheme) { const TIFFCodec* codec = TIFFFindCODEC(scheme); if(codec == NULL) { return 0; } if(codec->init == NULL) { return 0; } if(codec->init != NotConfigured){ return 1; } return 0; } /* * Local Variables: * mode: c * c-basic-offset: 8 * fill-column: 78 * End: */
// [The "BSD licence"] // Copyright (c) 2006-2007 Kay Roepke // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // 3. The name of the author may not be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import <Cocoa/Cocoa.h> #import "ANTLRTreeParser.h" #import "ANTLRDebugEventProxy.h" #import "ANTLRDebugTreeNodeStream.h" @interface ANTLRDebugTreeParser : ANTLRTreeParser { id<ANTLRDebugEventListener> debugListener; } - (id) initWithTreeNodeStream:(id<ANTLRTreeNodeStream>)theStream; - (id) initWithTreeNodeStream:(id<ANTLRTreeNodeStream>)theStream debuggerPort:(NSInteger)portNumber; // designated initializer - (id) initWithTreeNodeStream:(id<ANTLRTreeNodeStream>)theStream debugListener:(id<ANTLRDebugEventListener>)theDebugListener debuggerPort:(NSInteger)portNumber; - (id<ANTLRDebugEventListener>) debugListener; - (void) setDebugListener: (id<ANTLRDebugEventListener>) aDebugListener; - (void) recoverFromMismatchedToken:(id<ANTLRIntStream>)inputStream exception:(NSException *)e tokenType:(ANTLRTokenType)ttype follow:(ANTLRBitSet *)follow; @end
/* 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. * * Clipping rectangle defines */ #ifndef TINSEL_CURSOR_H // prevent multiple includes #define TINSEL_CURSOR_H #include "tinsel/dw.h" // for SCNHANDLE namespace Tinsel { void AdjustCursorXY(int deltaX, int deltaY); void SetCursorXY(int x, int y); void SetCursorScreenXY(int newx, int newy); void GetCursorXY(int *x, int *y, bool absolute); bool GetCursorXYNoWait(int *x, int *y, bool absolute); bool isCursorShown(); void RestoreMainCursor(); void SetTempCursor(SCNHANDLE pScript); void DwHideCursor(); void UnHideCursor(); void FreezeCursor(); void DoFreezeCursor(bool bFreeze); void HideCursorTrails(); void UnHideCursorTrails(); void DelAuxCursor(); void SetAuxCursor(SCNHANDLE hFilm); void DwInitCursor(SCNHANDLE bfilm); void DropCursor(); void RestartCursor(); void RebootCursor(); void StartCursorFollowed(); void EndCursorFollowed(); } // End of namespace Tinsel #endif // TINSEL_CURSOR_H
/* * drivers/usb/sun5i_usb/udc/sw_udc_config.h * * (C) Copyright 2007-2012 * Allwinner Technology Co., Ltd. <www.allwinnertech.com> * javen <javen@allwinnertech.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ #ifndef __SW_UDC_CONFIG_H__ #define __SW_UDC_CONFIG_H__ #include <linux/slab.h> #include <linux/list.h> #include <linux/interrupt.h> #include <linux/errno.h> #include <linux/clk.h> #include <linux/device.h> #include <linux/usb/ch9.h> #include "../include/sw_usb_config.h" #define SW_UDC_DOUBLE_FIFO /* 双 FIFO */ //#define SW_UDC_DMA /* DMA 传输 */ #define SW_UDC_HS_TO_FS /* 支持高速跳转全速 */ //#define SW_UDC_DEBUG //--------------------------------------------------------------- // 调试 //--------------------------------------------------------------- /* sw udc 调试打印 */ #if 0 #define DMSG_DBG_UDC DMSG_MSG #else #define DMSG_DBG_UDC(...) #endif #endif //__SW_UDC_CONFIG_H__
/* Initialization code run first thing by the ELF startup code. Linux/PowerPC. Copyright (C) 2007-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/>. */ #ifdef SHARED # include <dl-vdso.h> # include <libc-vdso.h> int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *) attribute_hidden; int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *); int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *); unsigned long long (*VDSO_SYMBOL(get_tbfreq)) (void); int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *); time_t (*VDSO_SYMBOL(time)) (time_t *); #if defined(__PPC64__) || defined(__powerpc64__) void *VDSO_SYMBOL(sigtramp_rt64); #else void *VDSO_SYMBOL(sigtramp32); void *VDSO_SYMBOL(sigtramp_rt32); #endif static inline void _libc_vdso_platform_setup (void) { PREPARE_VERSION (linux2615, "LINUX_2.6.15", 123718565); void *p = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2615); PTR_MANGLE (p); VDSO_SYMBOL (gettimeofday) = p; p = _dl_vdso_vsym ("__kernel_clock_gettime", &linux2615); PTR_MANGLE (p); VDSO_SYMBOL (clock_gettime) = p; p = _dl_vdso_vsym ("__kernel_clock_getres", &linux2615); PTR_MANGLE (p); VDSO_SYMBOL (clock_getres) = p; p = _dl_vdso_vsym ("__kernel_get_tbfreq", &linux2615); PTR_MANGLE (p); VDSO_SYMBOL (get_tbfreq) = p; p = _dl_vdso_vsym ("__kernel_getcpu", &linux2615); PTR_MANGLE (p); VDSO_SYMBOL (getcpu) = p; p = _dl_vdso_vsym ("__kernel_time", &linux2615); PTR_MANGLE (p); VDSO_SYMBOL (time) = p; /* PPC64 uses only one signal trampoline symbol, while PPC32 will use two depending if SA_SIGINFO is used (__kernel_sigtramp_rt32) or not (__kernel_sigtramp32). There is no need to pointer mangle these symbol because they will used only for pointer comparison. */ #if defined(__PPC64__) || defined(__powerpc64__) VDSO_SYMBOL(sigtramp_rt64) = _dl_vdso_vsym ("__kernel_sigtramp_rt64", &linux2615); #else VDSO_SYMBOL(sigtramp32) = _dl_vdso_vsym ("__kernel_sigtramp32", &linux2615); VDSO_SYMBOL(sigtramp_rt32) = _dl_vdso_vsym ("__kernel_sigtramp_rt32", &linux2615); #endif } # define VDSO_SETUP _libc_vdso_platform_setup #endif #include <csu/init-first.c>
/* * structures and definitions for the int 15, ax=e820 memory map * scheme. * * In a nutshell, arch/i386/boot/setup.S populates a scratch table * in the empty_zero_block that contains a list of usable address/size * duples. In arch/i386/kernel/setup.c, this information is * transferred into the e820map, and in arch/i386/mm/init.c, that * new information is used to mark pages reserved or not. * */ #ifndef __E820_HEADER #define __E820_HEADER #define E820MAP 0x2d0 /* our map */ #define E820MAX 128 /* number of entries in E820MAP */ #define E820NR 0x1e8 /* # entries in E820MAP */ #define E820_RAM 1 #define E820_RESERVED 2 #define E820_ACPI 3 /* usable as RAM once ACPI tables have been read */ #define E820_NVS 4 #define HIGH_MEMORY (1024*1024) #ifndef __ASSEMBLY__ struct e820map { int nr_map; struct e820entry { unsigned long long addr; /* start of memory segment */ unsigned long long size; /* size of memory segment */ unsigned long type; /* type of memory segment */ } map[E820MAX]; }; extern struct e820map e820; extern int e820_all_mapped(unsigned long start, unsigned long end, unsigned type); #endif/*!__ASSEMBLY__*/ #endif/*__E820_HEADER*/
#define _BULK_DATA_LEN 64 typedef struct { unsigned char data[_BULK_DATA_LEN]; unsigned int size; unsigned int pipe; }bulk_transfer_t,*pbulk_transfer_t; #define DABUSB_MINOR 240 /* some unassigned USB minor */ #define DABUSB_VERSION 0x1000 #define IOCTL_DAB_BULK _IOWR('d', 0x30, bulk_transfer_t) #define IOCTL_DAB_OVERRUNS _IOR('d', 0x15, int) #define IOCTL_DAB_VERSION _IOR('d', 0x3f, int) #ifdef __KERNEL__ typedef enum { _stopped=0, _started } driver_state_t; typedef struct { struct semaphore mutex; struct usb_device *usbdev; wait_queue_head_t wait; wait_queue_head_t remove_ok; spinlock_t lock; atomic_t pending_io; driver_state_t state; int remove_pending; int got_mem; int total_buffer_size; unsigned int overruns; int readptr; int opened; struct list_head free_buff_list; struct list_head rec_buff_list; } dabusb_t,*pdabusb_t; typedef struct { pdabusb_t s; purb_t purb; struct list_head buff_list; } buff_t,*pbuff_t; typedef struct { wait_queue_head_t wait; } bulk_completion_context_t, *pbulk_completion_context_t; #define _DABUSB_IF 2 #define _DABUSB_ISOPIPE 0x09 #define _ISOPIPESIZE 16384 #define _BULK_DATA_LEN 64 // Vendor specific request code for Anchor Upload/Download // This one is implemented in the core #define ANCHOR_LOAD_INTERNAL 0xA0 // EZ-USB Control and Status Register. Bit 0 controls 8051 reset #define CPUCS_REG 0x7F92 #define _TOTAL_BUFFERS 384 #define MAX_INTEL_HEX_RECORD_LENGTH 16 #ifndef _BYTE_DEFINED #define _BYTE_DEFINED typedef unsigned char BYTE; #endif // !_BYTE_DEFINED #ifndef _WORD_DEFINED #define _WORD_DEFINED typedef unsigned short WORD; #endif // !_WORD_DEFINED typedef struct _INTEL_HEX_RECORD { BYTE Length; WORD Address; BYTE Type; BYTE Data[MAX_INTEL_HEX_RECORD_LENGTH]; } INTEL_HEX_RECORD, *PINTEL_HEX_RECORD; #endif
#ifndef UONEAUTH_H #define UONEAUTH_H #include <stdint.h> #include <stddef.h> #include <stdlib.h> typedef void TestType_; typedef void PlainTestType_; #ifdef __cplusplus extern "C" { #endif TestType_ *newTestType(); int plainTestTypeN(PlainTestType_ *plain); #ifdef __cplusplus } #endif #endif // UONEAUTH_H
/* * Copyright (C) 2011 Luca Vaccaro * * TrueCrack 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #include "Charset.h" /*La funzione numberOfStrings dice di quante parole è composta la permutazione completa di n caratteri in alfabeto per stringhe lunghe da 1 a n caratteri (è di supporto).*/ unsigned long numberOfStrings(const int alphLength, const int stringMinLength, const int stringMaxLength) { unsigned long res = 0; int i; for (i=stringMinLength;i<=stringMaxLength;i++) { res += pow(alphLength,i); } return res; } /*La funzione indexedWordFromAlphabet da la i-esima parola dell’elenco delle permutazioni di n caratteri in alfabeto per stringhe da 1 a n caratteri di lunghezza massima. */ char* indexedWordFromAlphabet (unsigned long idx, const char* alphCharset, const int alphLength, const int minWordLength, const int maxWordLength) { if (idx >= numberOfStrings(alphLength,minWordLength,maxWordLength)) { return NULL; } char* genWord = (char*) malloc(sizeof(char)*(maxWordLength+1)); //Ciclo 0, primo carattere NON null genWord[0] = alphCharset[idx % alphLength]; //Ciclo i-esimo int i, charIdx; for (i=minWordLength;i<(maxWordLength+1);i++) { if (idx<numberOfStrings(alphLength,minWordLength,i)) { genWord[i] = '\0'; break; } else { charIdx = (idx-numberOfStrings(alphLength,minWordLength,i)) / (int) pow(alphLength,i); genWord[i] = alphCharset[charIdx % alphLength]; } } return genWord; } int charset_readWordsBlock (int block_size, char *alphabet, int minlength, int maxlength,char *words, int *words_init, int *words_length) { char *buffer; static int count=0; int i; if (count >= numberOfStrings(strlen(alphabet),minlength,maxlength)) return 0; for (i=0;i<block_size && count+i<numberOfStrings(strlen(alphabet),minlength,maxlength);i++) { //printf("* %s\n",indexedWordFromAlphabet(i+j,"abc",3,3)); if (i==0) words_init[0]=0; else words_init[i]=words_init[i-1]+words_length[i-1]; buffer=indexedWordFromAlphabet(i+count,alphabet,strlen(alphabet),minlength,maxlength); //printf (">>> %d [%d] /%d: %s\n",i,strlen(buffer),numberOfStrings(strlen(alphabet),minlength,maxlength),buffer); words_length[i]=strlen(buffer); memcpy(words+words_init[i],buffer,strlen(buffer)); words[words_init[i]+strlen(buffer)]='\0'; //remember the \0 } count+=i; return i; } /* int main() { printf("Example of word list from alphabet='a,b,c' and maxLength=3\n\n"); int i,j; for(i=0;i<numberOfStrings(3,3);){ for (j=0;j<3 && i<numberOfStrings(3,3);j++) printf("* %s\n",indexedWordFromAlphabet(i+j,"abc",3,3)); i+=j; } printf("--DONE!\n"); return 0; } */
/* * Copyright (C) 2020 Inria * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @defgroup drivers_screen_dev Screen device generic API * @ingroup drivers_display * @brief Define the generic API of a screen device * * The screen device API is a generic API built on top of display and touch * device APIs. * * Each display/touch device driver implementing this interface has to expose * a set of predefined functions and it has to register itself to the central * display/touch device registry. From here devices can be found, listed, and * accessed. * * The display and touch devices are linked to a screen by providing the * screen id (basically an index) they correspond to. * * @see drivers_disp_dev @see drivers_touch_dev * * @experimental This API is experimental and in an early state - expect * changes! * @{ * * @author Alexandre Abadie <alexandre.abadie@inria.fr> */ #ifndef SCREEN_DEV_H #define SCREEN_DEV_H #ifdef __cplusplus extern "C" { #endif #include "disp_dev.h" #ifdef MODULE_TOUCH_DEV #include "touch_dev.h" #endif /** * @brief Screen device descriptor */ typedef struct { disp_dev_t *display; /**< Pointer to the display device */ #if MODULE_TOUCH_DEV || DOXYGEN touch_dev_t *touch; /**< Pointer to the touch device */ #endif } screen_dev_t; #ifdef __cplusplus } #endif #endif /* SCREEN_DEV_H */ /** @} */
/* * Copyright (C) 2008,2009 Apple 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: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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 MediaDocument_h #define MediaDocument_h #if ENABLE(VIDEO) #include "HTMLDocument.h" namespace WebCore { class MediaDocument : public HTMLDocument { public: static PassRefPtr<MediaDocument> create(Frame* frame) { return adoptRef(new MediaDocument(frame)); } virtual ~MediaDocument(); void mediaElementSawUnsupportedTracks(); private: MediaDocument(Frame*); virtual bool isMediaDocument() const { return true; } virtual Tokenizer* createTokenizer(); virtual void defaultEventHandler(Event*); void replaceMediaElementTimerFired(Timer<MediaDocument>*); Timer<MediaDocument> m_replaceMediaElementTimer; }; } #endif #endif
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_COOKIES_VIEW_HANDLER_H_ #define CHROME_BROWSER_UI_WEBUI_OPTIONS_COOKIES_VIEW_HANDLER_H_ #include <memory> #include "base/compiler_specific.h" #include "base/macros.h" #include "chrome/browser/browsing_data/cookies_tree_model.h" #include "chrome/browser/ui/webui/options/options_ui.h" class CookiesTreeModelUtil; namespace options { class CookiesViewHandler : public OptionsPageUIHandler, public CookiesTreeModel::Observer { public: CookiesViewHandler(); ~CookiesViewHandler() override; // OptionsPageUIHandler implementation. void GetLocalizedValues(base::DictionaryValue* localized_strings) override; void RegisterMessages() override; // CookiesTreeModel::Observer implementation. void TreeNodesAdded(ui::TreeModel* model, ui::TreeModelNode* parent, int start, int count) override; void TreeNodesRemoved(ui::TreeModel* model, ui::TreeModelNode* parent, int start, int count) override; void TreeNodeChanged(ui::TreeModel* model, ui::TreeModelNode* node) override { } void TreeModelBeginBatch(CookiesTreeModel* model) override; void TreeModelEndBatch(CookiesTreeModel* model) override; private: // Creates the CookiesTreeModel if neccessary. void EnsureCookiesTreeModelCreated(); // Updates search filter for cookies tree model. void UpdateSearchResults(const base::ListValue* args); // Remove all sites data. void RemoveAll(const base::ListValue* args); // Remove selected sites data. void Remove(const base::ListValue* args); // Get the tree node using the tree path info in |args| and call // SendChildren to pass back children nodes data to WebUI. void LoadChildren(const base::ListValue* args); // Get children nodes data and pass it to 'CookiesView.loadChildren' to // update the WebUI. void SendChildren(const CookieTreeNode* parent); // Reloads the CookiesTreeModel and passes the nodes to // 'CookiesView.loadChildren' to update the WebUI. void ReloadCookies(const base::ListValue* args); // The Cookies Tree model std::unique_ptr<CookiesTreeModel> cookies_tree_model_; // Flag to indicate whether there is a batch update in progress. bool batch_update_; std::unique_ptr<CookiesTreeModelUtil> model_util_; DISALLOW_COPY_AND_ASSIGN(CookiesViewHandler); }; } // namespace options #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_COOKIES_VIEW_HANDLER_H_
//===-- mulodi4.c - Implement __mulodi4 -----------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file implements __mulodi4 for the compiler_rt library. // //===----------------------------------------------------------------------===// #include "int_lib.h" // Returns: a * b // Effects: sets *overflow to 1 if a * b overflows COMPILER_RT_ABI di_int __mulodi4(di_int a, di_int b, int *overflow) { const int N = (int)(sizeof(di_int) * CHAR_BIT); const di_int MIN = (di_int)1 << (N - 1); const di_int MAX = ~MIN; *overflow = 0; di_int result = a * b; if (a == MIN) { if (b != 0 && b != 1) *overflow = 1; return result; } if (b == MIN) { if (a != 0 && a != 1) *overflow = 1; return result; } di_int sa = a >> (N - 1); di_int abs_a = (a ^ sa) - sa; di_int sb = b >> (N - 1); di_int abs_b = (b ^ sb) - sb; if (abs_a < 2 || abs_b < 2) return result; if (sa == sb) { if (abs_a > MAX / abs_b) *overflow = 1; } else { if (abs_a > MIN / -abs_b) *overflow = 1; } return result; }
/* linux/arm/arm/mach-exynos/include/mach/regs-clock.h * * Copyright (C) 2013 Samsung Electronics Co., Ltd. * http://www.samsung.com * * EXYNOS5 - Header file for exynos pm support * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef _LINUX_EXYNOS_PM_H #define _LINUX_EXYNOS_PM_H #include <linux/kernel.h> #include <linux/notifier.h> /* * Event codes for PM states */ enum exynos_pm_event { /* CPU is entering the LPA state */ LPA_ENTER, /* CPU failed to enter the LPA state */ LPA_ENTER_FAIL, /* CPU is exiting the LPA state */ LPA_EXIT, }; int exynos_pm_register_notifier(struct notifier_block *nb); int exynos_pm_unregister_notifier(struct notifier_block *nb); int exynos_lpa_enter(void); int exynos_lpa_exit(void); #endif
/**************************************************************************** * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. * * * * 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, distribute with modifications, 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 ABOVE 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. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 * * and: Eric S. Raymond <esr@snark.thyrsus.com> * * and: Thomas E. Dickey 1996-on * * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* * lib_napms.c * * The routine napms. * * (This file was originally written by Eric Raymond; however except for * comments, none of the original code remains - T.Dickey). */ #include <curses.priv.h> #if HAVE_NANOSLEEP #include <time.h> #if HAVE_SYS_TIME_H #include <sys/time.h> /* needed for MacOS X DP3 */ #endif #endif MODULE_ID("$Id: lib_napms.c,v 1.24 2014/03/08 20:32:59 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(napms) (NCURSES_SP_DCLx int ms) { T((T_CALLED("napms(%d)"), ms)); #ifdef USE_TERM_DRIVER if (HasTerminal(SP_PARM)) { CallDriver_1(SP_PARM, td_nap, ms); } #else /* !USE_TERM_DRIVER */ #if NCURSES_SP_FUNCS (void) sp; #endif #if HAVE_NANOSLEEP { struct timespec request, remaining; request.tv_sec = ms / 1000; request.tv_nsec = (ms % 1000) * 1000000; while (nanosleep(&request, &remaining) == -1 && errno == EINTR) { request = remaining; } } #else _nc_timed_wait(0, 0, ms, (int *) 0 EVENTLIST_2nd(0)); #endif #endif /* !USE_TERM_DRIVER */ returnCode(OK); } #if NCURSES_SP_FUNCS NCURSES_EXPORT(int) napms(int ms) { return NCURSES_SP_NAME(napms) (CURRENT_SCREEN, ms); } #endif
// // WMFCrashAlertView.h // Wikipedia // // Created by Adam Baso on 3/5/15. // Copyright (c) 2015 Wikimedia Foundation. All rights reserved. // #import <UIKit/UIKit.h> extern NSString* const WMFHockeyAppServiceName; @interface WMFCrashAlertView : UIAlertView + (NSString*)wmf_hockeyAppPrivacyButtonText; @end
#include <linux/kernel.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/proc_fs.h> #include <linux/fs.h> #include <linux/uaccess.h> #include <linux/i2c.h> #include <linux/interrupt.h> #include "vtl_ts.h" #include "chip.h" #define APK_ITOUCH 0x01 #define INVALID 0x00 #define HW_RESET_CMD 0x01 #define CHIP_INFO_CMD 0x02 #define DRIVER_INFO_CMD 0x03 #define CHIP_ID_CMD 0x04 #define WRITE_CHIP_CMD 0x05 #define READ_CHIP_CMD 0x06 #define RECOVERY_CMD 0x07 #define INTERRUPT_CMD 0x08 #define READ_CHECKSUM_CMD 0x09 #define READ_FWCHECKSUM_CMD 0x0a #define XY_DEBUG_CMD 0x0b #define LINUX_SHELL 'c' #define SHELL_CHECKSUM_CMD '1' #define SHELL_UPDATE_CMD '2' #define SHELL_DEBUG_CMD '3' static struct ts_info * ts_object = NULL; /***************************************************************************** ** Function define *****************************************************************************/ static int apk_i2c_transfer(struct i2c_client *client,unsigned char i2c_addr,unsigned char len,unsigned char *buf,unsigned char rw) { struct i2c_msg msgs[1]; DEBUG(); msgs[0].flags = rw; msgs[0].addr = i2c_addr; msgs[0].len = len; msgs[0].buf = buf; msgs[0].scl_rate = TS_I2C_SPEED; //only for rockchip if(i2c_transfer(client->adapter, msgs, 1)!= 1) { return -1; } return 0; } static int apk_open(struct inode *inode, struct file *file) { printk("___%s___\n",__func__); DEBUG(); ts_object = vtl_ts_get_object(); if(ts_object == NULL) { return -1; } return 0; } static int apk_close(struct inode *inode, struct file *file) { printk("___%s___\n",__func__); DEBUG(); return 0; } static int apk_write(struct file *file, const char __user *buff, size_t count, loff_t *offp) { struct i2c_client *client = ts_object->driver->client; unsigned char frame_data[255] = {0}; int bin_checksum = 0; int fw_checksum = 0; int ret = 0; DEBUG(); if(copy_from_user(frame_data, buff, count)){ return -EFAULT; } if(frame_data[0]==APK_ITOUCH){ switch(frame_data[1]){ case HW_RESET_CMD :{ vtl_ts_hw_reset(); }break; case INTERRUPT_CMD :{ if(frame_data[4]){ enable_irq(ts_object->config_info.irq_number); }else{ disable_irq(ts_object->config_info.irq_number); } }break; case RECOVERY_CMD :{ ret = update(client); }break; case WRITE_CHIP_CMD:{ ret = apk_i2c_transfer(client,frame_data[2],frame_data[3],&frame_data[4],0); }break; case XY_DEBUG_CMD :{ if(ts_object->debug){ ts_object->debug = 0x00; }else{ ts_object->debug = 0x01; } }break; default :{ }break; } }else if(frame_data[0]==LINUX_SHELL){ printk("CMD: %s,count = %d\n",frame_data,count); switch(frame_data[1]){ case SHELL_CHECKSUM_CMD :{ chip_get_checksum(client,&bin_checksum,&fw_checksum); printk("bin_checksum = 0x%x,fw_checksum = 0x%x\n",bin_checksum,fw_checksum); }break; case SHELL_UPDATE_CMD :{ chip_update(client); }break; case SHELL_DEBUG_CMD :{ if(ts_object->debug){ ts_object->debug = 0x00; }else{ ts_object->debug = 0x01; } }break; default :{ }break; } }else{ return -1; } if(ret<0){ return -1; } return count; } static int apk_read(struct file *file, char __user *buff, size_t count, loff_t *offp) { struct i2c_client *client = ts_object->driver->client; unsigned char frame_data[255]; int bin_checksum = 0; int fw_checksum = 0; int len = 0; int ret = 0; DEBUG(); if(copy_from_user(frame_data, buff, count)) { return -EFAULT; } len = frame_data[3]; if(frame_data[0]==APK_ITOUCH){ switch(frame_data[1]){ case DRIVER_INFO_CMD :{ frame_data[0] = client->addr; }break; case READ_CHIP_CMD :{ ret = apk_i2c_transfer(client,frame_data[2],frame_data[3],frame_data,1); }break; case READ_CHECKSUM_CMD :{ ret = chip_get_checksum(client,&bin_checksum,&fw_checksum); frame_data[0] = bin_checksum & 0x00ff; frame_data[1] = bin_checksum >> 8; frame_data[2] = fw_checksum & 0x00ff; frame_data[3] = fw_checksum >> 8; }break; case READ_FWCHECKSUM_CMD :{ ret = chip_get_fwchksum(client,&fw_checksum); frame_data[0] = fw_checksum & 0x00ff; frame_data[1] = fw_checksum >> 8; }break; default :{ }break; } } if(copy_to_user(buff, frame_data,len)){ return -EFAULT; }; if(ret<0){ return -1; } return count; } struct file_operations apk_fops = { .owner = THIS_MODULE, .open = apk_open, .release = apk_close, .write = apk_write, .read = apk_read, };
/** * @file * * @brief POSIX Threads Initialize User Threads Body * @ingroup POSIX_PTHREAD */ /* * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.org/license/LICENSE. */ #if HAVE_CONFIG_H #include "config.h" #endif #include <errno.h> #include <pthread.h> #include <limits.h> #include <rtems/system.h> #include <rtems/config.h> #include <rtems/score/apiext.h> #include <rtems/score/stack.h> #include <rtems/score/thread.h> #include <rtems/score/wkspace.h> #include <rtems/posix/cancel.h> #include <rtems/posix/posixapi.h> #include <rtems/posix/pthreadimpl.h> #include <rtems/posix/priorityimpl.h> #include <rtems/posix/config.h> #include <rtems/posix/time.h> #include <rtems/rtems/config.h> void _POSIX_Threads_Initialize_user_threads_body(void) { int eno; uint32_t index; uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; bool register_global_construction; void *(*thread_entry)(void *); user_threads = Configuration_POSIX_API.User_initialization_threads_table; maximum = Configuration_POSIX_API.number_of_initialization_threads; if ( !user_threads ) return; register_global_construction = Configuration_RTEMS_API.number_of_initialization_tasks == 0; /* * Be careful .. if the default attribute set changes, this may need to. * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ eno = pthread_attr_init( &attr ); _Assert( eno == 0 ); eno = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); _Assert( eno == 0 ); eno = pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); _Assert( eno == 0 ); thread_entry = user_threads[ index ].thread_entry; if ( register_global_construction && thread_entry != NULL ) { register_global_construction = false; thread_entry = (void *(*)(void *)) _Thread_Global_construction; } eno = pthread_create( &thread_id, &attr, thread_entry, NULL ); if ( eno ) _POSIX_Fatal_error( POSIX_FD_PTHREAD, eno ); } }
/* * Copyright (C) 2004 FhG FOKUS * Copyright (C) 2008 iptelorg GmbH * Written by Jan Janak <jan@iptel.org> * * This file is part of Kamailio, a free SIP server. * * Kamailio 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. * * Kamailio 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 */ /** \addtogroup flatstore * @{ */ /** \file * Flatstore management interface */ #include "flat_rpc.h" #include "db_flatstore.h" #include "km_flatstore_mod.h" #include <time.h> /** Register a new file rotation request. * This function can be called through the management interface in SER and it * will register a new file rotation request. This function only registers the * request, it will be carried out next time SER attempts to write new data * into the file. */ static void rotate(rpc_t* rpc, void* c) { *km_flat_rotate = time(0); *flat_rotate = time(0); } static const char* flat_rotate_doc[2] = { "Close and reopen flatrotate files during log rotation.", 0 }; rpc_export_t flat_rpc[] = { {"flatstore.rotate", rotate, flat_rotate_doc, 0}, {0, 0, 0, 0}, }; /** @} */
/****************************************************************************** * Project: libspatialindex - A C++ library for spatial indexing * Author: Marios Hadjieleftheriou, mhadji@gmail.com ****************************************************************************** * Copyright (c) 2002, Marios Hadjieleftheriou * * All rights reserved. * * 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. ******************************************************************************/ #pragma once namespace SpatialIndex { namespace TPRTree { class Index : public Node { public: virtual ~Index(); private: Index(TPRTree* pTree, id_type id, uint32_t level); virtual NodePtr chooseSubtree(const MovingRegion& mbr, uint32_t level, std::stack<id_type>& pathBuffer); virtual NodePtr findLeaf(const MovingRegion& mbr, id_type id, std::stack<id_type>& pathBuffer); virtual void split(uint32_t dataLength, byte* pData, MovingRegion& mbr, id_type id, NodePtr& left, NodePtr& right); uint32_t findLeastEnlargement(const MovingRegion&) const; uint32_t findLeastOverlap(const MovingRegion&) const; void adjustTree(Node*, std::stack<id_type>&); void adjustTree(Node*, Node*, std::stack<id_type>&, byte* overflowTable); class OverlapEntry { public: uint32_t m_index; double m_enlargement; MovingRegionPtr m_original; MovingRegionPtr m_combined; double m_oa; double m_ca; static int compareEntries(const void* pv1, const void* pv2) { OverlapEntry* pe1 = * (OverlapEntry**) pv1; OverlapEntry* pe2 = * (OverlapEntry**) pv2; if (pe1->m_enlargement < pe2->m_enlargement) return -1; if (pe1->m_enlargement > pe2->m_enlargement) return 1; return 0; } }; // OverlapEntry friend class TPRTree; friend class Node; friend class BulkLoader; }; // Index } }
#ifndef __CR_LIBNETLINK_H__ #define __CR_LIBNETLINK_H__ #define CR_NLMSG_SEQ 24680 /* arbitrary chosen */ extern int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len); #define parse_rtattr_nested(tb, max, rta) \ (parse_rtattr((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta))) extern int do_rtnl_req(int nl, void *req, int size, int (*receive_callback)(struct nlmsghdr *h, void *), int (*error_callback)(int err, void *), void *); extern int addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data, int alen); #define NLMSG_TAIL(nmsg) \ ((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len))) #endif /* __CR_LIBNETLINK_H__ */
//===----------------------------------------------------------------------===// // // Peloton // // counter_metric.h // // Identification: src/statistics/counter_metric.h // // Copyright (c) 2015-16, Carnegie Mellon University Database Group // //===----------------------------------------------------------------------===// #pragma once #include <string> #include <sstream> #include "type/types.h" #include "statistics/abstract_metric.h" namespace peloton { namespace stats { /** * Metric as a counter. E.g. # txns committed, # tuples read, etc. */ class CounterMetric : public AbstractMetric { public: CounterMetric(MetricType type); //===--------------------------------------------------------------------===// // ACCESSORS //===--------------------------------------------------------------------===// inline void Increment() { count_++; } inline void Increment(int64_t count) { count_ += count; } inline void Decrement() { count_--; } inline void Decrement(int64_t count) { count_ -= count; } //===--------------------------------------------------------------------===// // HELPER METHODS //===--------------------------------------------------------------------===// inline void Reset() { count_ = 0; } inline int64_t GetCounter() { return count_; } inline bool operator==(const CounterMetric &other) { return count_ == other.count_; } inline bool operator!=(const CounterMetric &other) { return !(*this == other); } // Adds the source counter to this counter void Aggregate(AbstractMetric &source); // Returns a string representation of this counter inline const std::string GetInfo() const { std::stringstream ss; ss << count_; return ss.str(); } private: //===--------------------------------------------------------------------===// // MEMBERS //===--------------------------------------------------------------------===// // The current count int64_t count_; }; } // namespace stats } // namespace peloton
// 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 CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TRUETYPE_FONT_HOST_H_ #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TRUETYPE_FONT_HOST_H_ #include <stdint.h> #include <memory> #include <string> #include <vector> #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/sequenced_task_runner.h" #include "content/browser/renderer_host/pepper/pepper_truetype_font.h" #include "content/common/content_export.h" #include "ppapi/host/host_message_context.h" #include "ppapi/host/resource_host.h" namespace content { class BrowserPpapiHost; class CONTENT_EXPORT PepperTrueTypeFontHost : public ppapi::host::ResourceHost { public: PepperTrueTypeFontHost(BrowserPpapiHost* host, PP_Instance instance, PP_Resource resource, const ppapi::proxy::SerializedTrueTypeFontDesc& desc); ~PepperTrueTypeFontHost() override; int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; private: int32_t OnHostMsgGetTableTags(ppapi::host::HostMessageContext* context); int32_t OnHostMsgGetTable(ppapi::host::HostMessageContext* context, uint32_t table, int32_t offset, int32_t max_data_length); void OnInitializeComplete(ppapi::proxy::SerializedTrueTypeFontDesc* desc, int32_t result); void OnGetTableTagsComplete(std::vector<uint32_t>* tags, ppapi::host::ReplyMessageContext reply_context, int32_t result); void OnGetTableComplete(std::string* data, ppapi::host::ReplyMessageContext reply_context, int32_t result); // We use a SequencedTaskRunner to run potentially slow font operations and // ensure that Initialize completes before we make any calls to get font data. // Even though we allow multiple pending GetTableTags and GetTable calls, this // implies that they run serially. scoped_refptr<base::SequencedTaskRunner> task_runner_; scoped_refptr<PepperTrueTypeFont> font_; bool initialize_completed_; base::WeakPtrFactory<PepperTrueTypeFontHost> weak_factory_; DISALLOW_COPY_AND_ASSIGN(PepperTrueTypeFontHost); }; } // namespace content #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_TRUETYPE_FONT_HOST_H_
/* linux/arch/arm/plat-s5p/dev-dsim.c * * Copyright (c) 2010 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * * DSIM controller configuration * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/kernel.h> #include <linux/string.h> #include <linux/err.h> #include <linux/platform_device.h> #include <asm/irq.h> #include <plat/devs.h> #include <plat/cpu.h> #include <mach/map.h> #include <mach/dsim.h> #include <mach/mipi_ddi.h> static struct dsim_config dsim_info = { .auto_flush = false, /* main frame fifo auto flush at VSYNC pulse */ .eot_disable = false, /* only DSIM_1_02 or DSIM_1_03 */ .auto_vertical_cnt = true, .hse = false, .hfp = false, .hbp = false, .hsa = false, .e_no_data_lane = DSIM_DATA_LANE_2, .e_byte_clk = DSIM_PLL_OUT_DIV8, .p = 3, .m = 90, .s = 1, .pll_stable_time = 500, /* D-PHY PLL stable time spec :min = 200usec ~ max 400usec */ .esc_clk = 20 * 1000000, /* escape clk : 10MHz */ .stop_holding_cnt = 0x07ff, /* stop state holding counter after bta change count 0 ~ 0xfff */ .bta_timeout = 0xff, /* bta timeout 0 ~ 0xff */ .rx_timeout = 0xffff, /* lp rx timeout 0 ~ 0xffff */ .e_lane_swap = DSIM_NO_CHANGE, }; /* define ddi platform data based on MIPI-DSI. */ static struct mipi_ddi_platform_data mipi_ddi_pd = { .backlight_on = NULL, }; static struct dsim_lcd_config dsim_lcd_info = { .e_interface = DSIM_VIDEO, .parameter[DSI_VIRTUAL_CH_ID] = (unsigned int) DSIM_VIRTUAL_CH_0, .parameter[DSI_FORMAT] = (unsigned int) DSIM_24BPP_888, .parameter[DSI_VIDEO_MODE_SEL] = (unsigned int) DSIM_NON_BURST_SYNC_PULSE, .mipi_ddi_pd = (void *) &mipi_ddi_pd, }; static struct resource s5p_dsim_resource[] = { [0] = { .start = S5P_PA_DSIM0, .end = S5P_PA_DSIM0 + SZ_64K - 1, .flags = IORESOURCE_MEM, }, [1] = { .start = IRQ_MIPIDSI0, .end = IRQ_MIPIDSI0, .flags = IORESOURCE_IRQ, }, }; static void s5p_dsim_mipi_power(int enable) { return; } static struct s5p_platform_dsim dsim_platform_data = { .clk_name = "dsim0", .dsim_info = &dsim_info, .dsim_lcd_info = &dsim_lcd_info, .mipi_power = s5p_dsim_mipi_power, .enable_clk = s5p_dsim_enable_clk, .part_reset = s5p_dsim_part_reset, .init_d_phy = s5p_dsim_init_d_phy, .cfg_gpio = exynos4_dsim_gpio_setup_24bpp, }; struct platform_device s5p_device_dsim = { .name = "s5p-dsim", .id = 0, .num_resources = ARRAY_SIZE(s5p_dsim_resource), .resource = s5p_dsim_resource, .dev = { .platform_data = (void *) &dsim_platform_data, }, };
/* Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 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 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 _MDP4_VIDEO_ENHANCE_H_ #define _MDP4_VIDEO_ENHANCE_H_ #define SIG_MDNIE_UI_MODE 0 #define SIG_MDNIE_VIDEO_MODE 1 #define SIG_MDNIE_VIDEO_WARM_MODE 2 #define SIG_MDNIE_VIDEO_COLD_MODE 3 #define SIG_MDNIE_CAMERA_MODE 4 #define SIG_MDNIE_NAVI 5 #define SIG_MDNIE_GALLERY 6 #define SIG_MDNIE_BYPASS 7 #define SIG_MDNIE_DYNAMIC 0 #define SIG_MDNIE_STANDARD 1 #define SIG_MDNIE_MOVIE 2 #if defined(CONFIG_TDMB) || defined(CONFIG_TDMB_MODULE) #define SIG_MDNIE_DMB_MODE 20 #define SIG_MDNIE_DMB_WARM_MODE 21 #define SIG_MDNIE_DMB_COLD_MODE 22 #endif #ifdef CONFIG_TARGET_LOCALE_NTT #define SIG_MDNIE_ISDBT_MODE 30 #define SIG_MDNIE_ISDBT_WARM_MODE 31 #define SIG_MDNIE_ISDBT_COLD_MODE 32 #endif void init_mdnie_class(void); #endif // _MDP4_VIDEO_ENHANCE_H_
/* { dg-do run } */ /* { dg-options "-O" } */ struct I { int i; }; struct A { struct I i1; struct I i2; struct I i3; }; struct B { struct I i0; struct A a; }; struct C { struct I i00; struct B b; }; volatile int v; void __attribute__((noipa)) consume_i (struct I i) { v = i.i; } void __attribute__((noipa)) consume_a (struct A a) { v = a.i1.i; } void __attribute__((noipa)) consume_b (struct B b) { v = b.a.i1.i; } void __attribute__((noipa)) consume_c (struct C c) { v = c.b.a.i1.i; } int __attribute__((noipa)) foo (struct I input) { struct I i1, i2, i3; struct A a1, a2, a3; struct B b1; struct C c; i1 = input; a1.i1 = i1; b1.a = a1; i2.i = 1; b1.i0 = i2; c.b = b1; a2 = c.b.a; a3 = a2; i3 = a3.i1; int t = c.b.i0.i; a2.i3.i = 4; consume_i (i1); consume_i (i2); consume_b (b1); consume_a (a1); consume_a (a2); consume_a (a3); consume_c (c); return i3.i + t; } int main (int argc, char *argv[]) { struct I s; s.i = 1234; int i = foo (s); if (i != 1235) __builtin_abort (); return 0; }
/* * This file is part of Cleanflight and Betaflight. * * Cleanflight and Betaflight are free software. You can redistribute * this software and/or modify this software 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 and Betaflight are distributed in the hope that they * 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 software. * * If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include "axis.h" #include "maths.h" typedef enum { ALIGN_DEFAULT = 0, // driver-provided alignment // the order of these 8 values also correlate to corresponding code in ALIGNMENT_TO_BITMASK. // R, P, Y CW0_DEG = 1, // 00,00,00 CW90_DEG = 2, // 00,00,01 CW180_DEG = 3, // 00,00,10 CW270_DEG = 4, // 00,00,11 CW0_DEG_FLIP = 5, // 00,10,00 // _FLIP = 2x90 degree PITCH rotations CW90_DEG_FLIP = 6, // 00,10,01 CW180_DEG_FLIP = 7, // 00,10,10 CW270_DEG_FLIP = 8, // 00,10,11 ALIGN_CUSTOM = 9, // arbitrary sensor angles, e.g. for external sensors } sensor_align_e; typedef union sensorAlignment_u { // value order is the same as axis_e // values are in DECIDEGREES, and should be limited to +/- 3600 int16_t raw[XYZ_AXIS_COUNT]; struct { int16_t roll; int16_t pitch; int16_t yaw; }; } sensorAlignment_t; #define SENSOR_ALIGNMENT(ROLL, PITCH, YAW) ((sensorAlignment_t){\ .roll = DEGREES_TO_DECIDEGREES(ROLL), \ .pitch = DEGREES_TO_DECIDEGREES(PITCH), \ .yaw = DEGREES_TO_DECIDEGREES(YAW), \ }) #define CUSTOM_ALIGN_CW0_DEG SENSOR_ALIGNMENT( 0, 0, 0) #define CUSTOM_ALIGN_CW90_DEG SENSOR_ALIGNMENT( 0, 0, 90) #define CUSTOM_ALIGN_CW180_DEG SENSOR_ALIGNMENT( 0, 0, 180) #define CUSTOM_ALIGN_CW270_DEG SENSOR_ALIGNMENT( 0, 0, 270) #define CUSTOM_ALIGN_CW0_DEG_FLIP SENSOR_ALIGNMENT( 0, 180, 0) #define CUSTOM_ALIGN_CW90_DEG_FLIP SENSOR_ALIGNMENT( 0, 180, 90) #define CUSTOM_ALIGN_CW180_DEG_FLIP SENSOR_ALIGNMENT( 0, 180, 180) #define CUSTOM_ALIGN_CW270_DEG_FLIP SENSOR_ALIGNMENT( 0, 180, 270) void buildRotationMatrixFromAlignment(const sensorAlignment_t* alignment, fp_rotationMatrix_t* rm); void buildAlignmentFromStandardAlignment(sensorAlignment_t* sensorAlignment, sensor_align_e alignment);
// // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2010 Dennis Nienhüser <earthwings@gentoo.org> // #ifndef MARBLE_KMLSTYLEMAPTAGWRITER_H #define MARBLE_KMLSTYLEMAPTAGWRITER_H #include "GeoTagWriter.h" namespace Marble { class KmlStyleMapTagWriter : public GeoTagWriter { public: virtual bool write( const GeoNode *node, GeoWriter& writer ) const; }; } #endif
/*---------------------------------------------------------------------------- * File: ooaofooa_SM_SUPDT_class.c * * Class: Event Supplemental Data (SM_SUPDT) * Component: ooaofooa * * your copyright statement can go here (from te_copyright.body) *--------------------------------------------------------------------------*/ #include "sys_sys_types.h" #include "LOG_bridge.h" #include "POP_bridge.h" #include "T_bridge.h" #include "ooaofooa_classes.h" /* * Instance Loader (from string data). */ Escher_iHandle_t ooaofooa_SM_SUPDT_instanceloader( Escher_iHandle_t instance, const c_t * avlstring[] ) { Escher_iHandle_t return_identifier = 0; ooaofooa_SM_SUPDT * self = (ooaofooa_SM_SUPDT *) instance; /* Initialize application analysis class attributes. */ self->SMspd_ID = (Escher_iHandle_t) Escher_atoi( avlstring[ 1 ] ); return_identifier = self->SMspd_ID; self->SM_ID = (Escher_iHandle_t) Escher_atoi( avlstring[ 2 ] ); self->Non_Local = ( '0' != *avlstring[ 3 ] ); return return_identifier; } /* * Select any where using referential/identifying attribute set. * If not_empty, relate this instance to the selected instance. */ void ooaofooa_SM_SUPDT_batch_relate( Escher_iHandle_t instance ) { ooaofooa_SM_SUPDT * ooaofooa_SM_SUPDT_instance = (ooaofooa_SM_SUPDT *) instance; ooaofooa_SM_SM * ooaofooa_SM_SMrelated_instance1 = (ooaofooa_SM_SM *) Escher_instance_cache[ (intptr_t) ooaofooa_SM_SUPDT_instance->SM_ID ]; if ( ooaofooa_SM_SMrelated_instance1 ) { ooaofooa_SM_SUPDT_R523_Link_contains( ooaofooa_SM_SMrelated_instance1, ooaofooa_SM_SUPDT_instance ); } } /* * Scan the extent for a matching instance. */ ooaofooa_SM_SUPDT * ooaofooa_SM_SUPDT_AnyWhere1( Escher_UniqueID_t w_SMspd_ID, Escher_UniqueID_t w_SM_ID ) { ooaofooa_SM_SUPDT * w; Escher_Iterator_s iter_SM_SUPDT; Escher_IteratorReset( &iter_SM_SUPDT, &pG_ooaofooa_SM_SUPDT_extent.active ); while ( (w = (ooaofooa_SM_SUPDT *) Escher_IteratorNext( &iter_SM_SUPDT )) != 0 ) { if ( w->SMspd_ID == w_SMspd_ID && w->SM_ID == w_SM_ID ) { return w; } } return 0; } /* * RELATE SM_SM TO SM_SUPDT ACROSS R523 */ void ooaofooa_SM_SUPDT_R523_Link_contains( ooaofooa_SM_SM * part, ooaofooa_SM_SUPDT * form ) { /* Use TagEmptyHandleDetectionOn() to detect empty handle references. */ form->SM_ID = part->SM_ID; form->SM_SM_R523_is_assigned_to = part; Escher_SetInsertElement( &part->SM_SUPDT_R523_contains, (Escher_ObjectSet_s *) form ); } /* * UNRELATE SM_SM FROM SM_SUPDT ACROSS R523 */ void ooaofooa_SM_SUPDT_R523_Unlink_contains( ooaofooa_SM_SM * part, ooaofooa_SM_SUPDT * form ) { /* Use TagEmptyHandleDetectionOn() to detect empty handle references. */ form->SM_SM_R523_is_assigned_to = 0; Escher_SetRemoveElement( &part->SM_SUPDT_R523_contains, (Escher_ObjectSet_s *) form ); } /* * Dump instances in SQL format. */ void ooaofooa_SM_SUPDT_instancedumper( Escher_iHandle_t instance ) { ooaofooa_SM_SUPDT * self = (ooaofooa_SM_SUPDT *) instance; printf( "INSERT INTO SM_SUPDT VALUES ( %ld,%ld,%d );\n", ((long)self->SMspd_ID & ESCHER_IDDUMP_MASK), ((long)self->SM_ID & ESCHER_IDDUMP_MASK), self->Non_Local ); } /* * Statically allocate space for the instance population for this class. * Allocate space for the class instance and its attribute values. * Depending upon the collection scheme, allocate containoids (collection * nodes) for gathering instances into free and active extents. */ static Escher_SetElement_s ooaofooa_SM_SUPDT_container[ ooaofooa_SM_SUPDT_MAX_EXTENT_SIZE ]; static ooaofooa_SM_SUPDT ooaofooa_SM_SUPDT_instances[ ooaofooa_SM_SUPDT_MAX_EXTENT_SIZE ]; Escher_Extent_t pG_ooaofooa_SM_SUPDT_extent = { {0,0}, {0,0}, &ooaofooa_SM_SUPDT_container[ 0 ], (Escher_iHandle_t) &ooaofooa_SM_SUPDT_instances, sizeof( ooaofooa_SM_SUPDT ), 0, ooaofooa_SM_SUPDT_MAX_EXTENT_SIZE };
/* mbed Microcontroller Library * Copyright (c) 2013-2016 Realtek Semiconductor Corp. * * 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. */ #include "objects.h" #include "timer_api.h" #if CONFIG_TIMER_EN extern HAL_TIMER_OP HalTimerOp; extern HAL_Status HalTimerInitRtl8195a_Patch( IN VOID *Data ); static void gtimer_timeout_handler (uint32_t tid) { gtimer_t *obj = (gtimer_t *)tid; gtimer_irq_handler handler; u8 timer_id = obj->hal_gtimer_adp.TimerId; if (obj->handler != NULL) { handler = (gtimer_irq_handler)obj->handler; handler(obj->hid); } if (!obj->is_periodcal) { gtimer_stop(obj); } if(timer_id < 2) { // Timer0 | Timer1: clear ISR here // Timer 2~7 ISR will be cleared in HAL HalTimerClearIsr(timer_id); } } void gtimer_init (gtimer_t *obj, uint32_t tid) { PTIMER_ADAPTER pTimerAdapter = &(obj->hal_gtimer_adp); if ((tid == 1) || (tid == 6) || (tid == 7)) { DBG_TIMER_ERR("gtimer_init: This timer is reserved for HAL driver\r\n", tid); return; } if (tid > GTIMER_MAX) { DBG_TIMER_ERR("gtimer_init: Invalid TimerId=%d\r\n", tid); return; } pTimerAdapter->IrqDis = 0; // Enable Irq @ initial pTimerAdapter->IrqHandle.IrqFun = (IRQ_FUN) gtimer_timeout_handler; if(tid == 0) { pTimerAdapter->IrqHandle.IrqNum = TIMER0_IRQ; } else if(tid == 1) { pTimerAdapter->IrqHandle.IrqNum = TIMER1_IRQ; } else { pTimerAdapter->IrqHandle.IrqNum = TIMER2_7_IRQ; } pTimerAdapter->IrqHandle.Priority = 0; pTimerAdapter->IrqHandle.Data = (u32)obj; pTimerAdapter->TimerId = (u8)tid; pTimerAdapter->TimerIrqPriority = 0; pTimerAdapter->TimerLoadValueUs = 0xFFFFFFFF; // Just a whatever value pTimerAdapter->TimerMode = USER_DEFINED; HalTimerInit ((VOID*) pTimerAdapter); } void gtimer_deinit (gtimer_t *obj) { PTIMER_ADAPTER pTimerAdapter = &(obj->hal_gtimer_adp); HalTimerDeInit((void*)pTimerAdapter); } uint32_t gtimer_read_tick (gtimer_t *obj) { PTIMER_ADAPTER pTimerAdapter = &obj->hal_gtimer_adp; return (HalTimerOp.HalTimerReadCount(pTimerAdapter->TimerId)); } uint64_t gtimer_read_us (gtimer_t *obj) { uint64_t time_us; time_us = gtimer_read_tick(obj)*1000000/32768; return (time_us); } void gtimer_reload (gtimer_t *obj, uint32_t duration_us) { PTIMER_ADAPTER pTimerAdapter = &obj->hal_gtimer_adp; HalTimerReLoad(pTimerAdapter->TimerId, duration_us); } void gtimer_start (gtimer_t *obj) { PTIMER_ADAPTER pTimerAdapter = &obj->hal_gtimer_adp; u8 TimerId = pTimerAdapter->TimerId; HalTimerEnable(TimerId); } void gtimer_start_one_shout (gtimer_t *obj, uint32_t duration_us, void* handler, uint32_t hid) { obj->is_periodcal = _FALSE; obj->handler = handler; obj->hid = hid; gtimer_reload(obj, duration_us); gtimer_start(obj); } void gtimer_start_periodical (gtimer_t *obj, uint32_t duration_us, void* handler, uint32_t hid) { obj->is_periodcal = _TRUE; obj->handler = handler; obj->hid = hid; if (duration_us > GTIMER_TICK_US) { // reload will takes extra 1 tick duration_us -= GTIMER_TICK_US; } gtimer_reload(obj, duration_us); gtimer_start(obj); } void gtimer_stop (gtimer_t *obj) { PTIMER_ADAPTER pTimerAdapter = &obj->hal_gtimer_adp; HalTimerDisable(pTimerAdapter->TimerId); } #endif // end of "#if CONFIG_TIMER_EN"
/*========================================================================= Program: Visualization Toolkit Module: vtkPDataSetWriter.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkPDataSetWriter - Manages writing pieces of a data set. // .SECTION Description // vtkPDataSetWriter will write a piece of a file, and will also create // a metadata file that lists all of the files in a data set. #ifndef __vtkPDataSetWriter_h #define __vtkPDataSetWriter_h #include "vtkDataSetWriter.h" class vtkImageData; class vtkRectilinearGrid; class vtkStructuredGrid; class VTK_PARALLEL_EXPORT vtkPDataSetWriter : public vtkDataSetWriter { public: void PrintSelf(ostream& os, vtkIndent indent); vtkTypeMacro(vtkPDataSetWriter,vtkDataSetWriter); static vtkPDataSetWriter *New(); // Description: // Write the pvtk file and cooresponding vtk files. virtual int Write(); // Description: // This is how many pieces the whole data set will be divided into. void SetNumberOfPieces(int num); vtkGetMacro(NumberOfPieces, int); // Description: // Extra ghost cells will be written out to each piece file // if this value is larger than 0. vtkSetMacro(GhostLevel, int); vtkGetMacro(GhostLevel, int); // Description: // This is the range of pieces that that this writer is // responsible for writing. All pieces must be written // by some process. The process that writes piece 0 also // writes the pvtk file that lists all the piece file names. vtkSetMacro(StartPiece, int); vtkGetMacro(StartPiece, int); vtkSetMacro(EndPiece, int); vtkGetMacro(EndPiece, int); // Description: // This file pattern uses the file name and piece number // to contruct a file name for the piece file. vtkSetStringMacro(FilePattern); vtkGetStringMacro(FilePattern); // Description: // This flag determines whether to use absolute paths for the piece files. // By default the pieces are put in the main directory, and the piece file // names in the meta data pvtk file are relative to this directory. // This should make moving the whole lot to another directory, an easier task. vtkSetMacro(UseRelativeFileNames, int); vtkGetMacro(UseRelativeFileNames, int); vtkBooleanMacro(UseRelativeFileNames, int); protected: vtkPDataSetWriter(); ~vtkPDataSetWriter(); //BTX ostream *OpenFile(); int WriteUnstructuredMetaData(vtkDataSet *input, char *root, char *str, ostream *fptr); int WriteImageMetaData(vtkImageData *input, char *root, char *str, ostream *fptr); int WriteRectilinearGridMetaData(vtkRectilinearGrid *input, char *root, char *str, ostream *fptr); int WriteStructuredGridMetaData(vtkStructuredGrid *input, char *root, char *str, ostream *fptr); //ETX int StartPiece; int EndPiece; int NumberOfPieces; int GhostLevel; int UseRelativeFileNames; char *FilePattern; void DeleteFiles(); private: vtkPDataSetWriter(const vtkPDataSetWriter&); // Not implemented void operator=(const vtkPDataSetWriter&); // Not implemented }; #endif
/* * Generated by class-dump 3.1.1. * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2006 by Steve Nygard. */ #import <BackRow/BRMusicStore.h> @interface BRMusicStore (Private) - (void)_bootstrapMusicStore; - (void)_seedMusicStore; - (void)_musicStoreUnseeded; - (void)_musicStoreSeeded:(id)fp8; - (void)_seedMusicStoreWithDocument:(id)fp8; - (id)_makeStoreRequest:(id)fp8; - (void)_updateStoreFrontFromResponse:(id)fp8; - (void)_processJobs:(id)fp8; - (void)_loadCollectionsForCollection:(id)fp8; - (void)_loadMediaForCollection:(id)fp8; - (void)_terminateNotification:(id)fp8; - (void)_networkStateChanged:(id)fp8; @end
/* * Copyright (C) Leigh Brown 2002. * * 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. */ #include "of1275.h" phandle instancetopackage(const ihandle instance) { struct prom_args { char *service; int nargs; int nret; ihandle instance; phandle package; } args; args.service = "instance-to-package"; args.nargs = 1; args.nret = 1; args.instance = instance; (*of_prom_entry)(&args); return args.package; }
/* * IA-32 Huge TLB Page Support for Kernel. * * Copyright (C) 2002, Rohit Seth <rohit.seth@intel.com> */ #include <linux/init.h> #include <linux/fs.h> #include <linux/mm.h> #include <linux/sched/mm.h> #include <linux/hugetlb.h> #include <linux/pagemap.h> #include <linux/err.h> #include <linux/sysctl.h> #include <linux/compat.h> #include <asm/mman.h> #include <asm/tlb.h> #include <asm/tlbflush.h> #include <asm/pgalloc.h> #include <asm/elf.h> #if 0 /* This is just for testing */ struct page * follow_huge_addr(struct mm_struct *mm, unsigned long address, int write) { unsigned long start = address; int length = 1; int nr; struct page *page; struct vm_area_struct *vma; vma = find_vma(mm, addr); if (!vma || !is_vm_hugetlb_page(vma)) return ERR_PTR(-EINVAL); pte = huge_pte_offset(mm, address); /* hugetlb should be locked, and hence, prefaulted */ WARN_ON(!pte || pte_none(*pte)); page = &pte_page(*pte)[vpfn % (HPAGE_SIZE/PAGE_SIZE)]; WARN_ON(!PageHead(page)); return page; } int pmd_huge(pmd_t pmd) { return 0; } int pud_huge(pud_t pud) { return 0; } #else /* * pmd_huge() returns 1 if @pmd is hugetlb related entry, that is normal * hugetlb entry or non-present (migration or hwpoisoned) hugetlb entry. * Otherwise, returns 0. */ int pmd_huge(pmd_t pmd) { return !pmd_none(pmd) && (pmd_val(pmd) & (_PAGE_PRESENT|_PAGE_PSE)) != _PAGE_PRESENT; } int pud_huge(pud_t pud) { return !!(pud_val(pud) & _PAGE_PSE); } #endif #ifdef CONFIG_HUGETLB_PAGE static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { struct hstate *h = hstate_file(file); struct vm_unmapped_area_info info; info.flags = 0; info.length = len; info.low_limit = get_mmap_base(1); info.high_limit = in_compat_syscall() ? tasksize_32bit() : tasksize_64bit(); info.align_mask = PAGE_MASK & ~huge_page_mask(h); info.align_offset = 0; return vm_unmapped_area(&info); } static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file, unsigned long addr0, unsigned long len, unsigned long pgoff, unsigned long flags) { struct hstate *h = hstate_file(file); struct vm_unmapped_area_info info; unsigned long addr; info.flags = VM_UNMAPPED_AREA_TOPDOWN; info.length = len; info.low_limit = PAGE_SIZE; info.high_limit = get_mmap_base(0); info.align_mask = PAGE_MASK & ~huge_page_mask(h); info.align_offset = 0; addr = vm_unmapped_area(&info); /* * A failed mmap() very likely causes application failure, * so fall back to the bottom-up function here. This scenario * can happen with large stack limits and large mmap() * allocations. */ if (addr & ~PAGE_MASK) { VM_BUG_ON(addr != -ENOMEM); info.flags = 0; info.low_limit = TASK_UNMAPPED_BASE; info.high_limit = TASK_SIZE; addr = vm_unmapped_area(&info); } return addr; } unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { struct hstate *h = hstate_file(file); struct mm_struct *mm = current->mm; struct vm_area_struct *vma; if (len & ~huge_page_mask(h)) return -EINVAL; if (len > TASK_SIZE) return -ENOMEM; if (flags & MAP_FIXED) { if (prepare_hugepage_range(file, addr, len)) return -EINVAL; return addr; } if (addr) { addr = ALIGN(addr, huge_page_size(h)); vma = find_vma(mm, addr); if (TASK_SIZE - len >= addr && (!vma || addr + len <= vma->vm_start)) return addr; } if (mm->get_unmapped_area == arch_get_unmapped_area) return hugetlb_get_unmapped_area_bottomup(file, addr, len, pgoff, flags); else return hugetlb_get_unmapped_area_topdown(file, addr, len, pgoff, flags); } #endif /* CONFIG_HUGETLB_PAGE */ #ifdef CONFIG_X86_64 static __init int setup_hugepagesz(char *opt) { unsigned long ps = memparse(opt, &opt); if (ps == PMD_SIZE) { hugetlb_add_hstate(PMD_SHIFT - PAGE_SHIFT); } else if (ps == PUD_SIZE && boot_cpu_has(X86_FEATURE_GBPAGES)) { hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT); } else { hugetlb_bad_size(); printk(KERN_ERR "hugepagesz: Unsupported page size %lu M\n", ps >> 20); return 0; } return 1; } __setup("hugepagesz=", setup_hugepagesz); #if (defined(CONFIG_MEMORY_ISOLATION) && defined(CONFIG_COMPACTION)) || defined(CONFIG_CMA) static __init int gigantic_pages_init(void) { /* With compaction or CMA we can allocate gigantic pages at runtime */ if (boot_cpu_has(X86_FEATURE_GBPAGES) && !size_to_hstate(1UL << PUD_SHIFT)) hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT); return 0; } arch_initcall(gigantic_pages_init); #endif #endif