text
stringlengths
4
6.14k
/* { dg-do compile } */ /* { dg-options "-O2 -mavx512f" } */ /* { dg-final { scan-assembler-times "vcmpss\[ \\t\]+\[^\{\n\]*\[^\}\]%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcmpss\[ \\t\]+\[^\{\n\]*\[^\}\]%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcmpss\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */ /* { dg-final { scan-assembler-times "vcmpss\[ \\t\]+\[^\{\n\]*\{sae\}\[^\n\]*%xmm\[0-9\]+\[^\n^k\]*%k\[0-7\]\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ #include <immintrin.h> volatile __m128 x; volatile __mmask8 m; void extern avx512f_test (void) { m = _mm_cmp_ss_mask (x, x, _CMP_FALSE_OQ); m = _mm_mask_cmp_ss_mask (m, x, x, _CMP_FALSE_OQ); m = _mm_cmp_round_ss_mask (x, x, _CMP_FALSE_OQ, _MM_FROUND_NO_EXC); m = _mm_mask_cmp_round_ss_mask (m, x, x, _CMP_FALSE_OQ, _MM_FROUND_NO_EXC); }
/****************************************************************************** * * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * * 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, USA * * ******************************************************************************/ #ifndef __RTW_AP_H_ #define __RTW_AP_H_ #ifdef CONFIG_AP_MODE //external function extern void rtw_indicate_sta_assoc_event(_adapter *padapter, struct sta_info *psta); extern void rtw_indicate_sta_disassoc_event(_adapter *padapter, struct sta_info *psta); void init_mlme_ap_info(_adapter *padapter); void free_mlme_ap_info(_adapter *padapter); //void update_BCNTIM(_adapter *padapter); void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *data, u8 len); void rtw_remove_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index); void update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx); void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level); void expire_timeout_chk(_adapter *padapter); void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta); int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len); void rtw_ap_restore_network(_adapter *padapter); void rtw_set_macaddr_acl(_adapter *padapter, int mode); int rtw_acl_add_sta(_adapter *padapter, u8 *addr); int rtw_acl_remove_sta(_adapter *padapter, u8 *addr); u8 rtw_ap_set_pairwise_key(_adapter *padapter, struct sta_info *psta); int rtw_ap_set_group_key(_adapter *padapter, u8 *key, u8 alg, int keyid); int rtw_ap_set_wep_key(_adapter *padapter, u8 *key, u8 keylen, int keyid, u8 set_tx); #ifdef CONFIG_NATIVEAP_MLME void associated_clients_update(_adapter *padapter, u8 updated); void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta); u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta); void sta_info_update(_adapter *padapter, struct sta_info *psta); void ap_sta_info_defer_update(_adapter *padapter, struct sta_info *psta); u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reason); int rtw_sta_flush(_adapter *padapter); int rtw_ap_inform_ch_switch(_adapter *padapter, u8 new_ch, u8 ch_offset); void start_ap_mode(_adapter *padapter); void stop_ap_mode(_adapter *padapter); #endif #ifdef CONFIG_AUTO_AP_MODE extern void rtw_start_auto_ap(_adapter *adapter); #endif //CONFIG_AUTO_AP_MODE #endif //end of CONFIG_AP_MODE #endif
/* Copyright (c) 2008 The Board of Trustees of The Leland Stanford * Junior University * * We are making the OpenFlow specification and associated documentation * (Software) available for public use and benefit with the expectation * that others will use, modify and enhance the Software and contribute * those enhancements back to the community. However, since we would * like to make the Software available for broadest use, with as few * restrictions as possible permission is hereby granted, free of * charge, to any person obtaining a copy of this Software to deal in * the Software under the copyrights 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. * * The name and trademarks of copyright holder(s) may NOT be used in * advertising or publicity pertaining to the Software or any * derivatives without specific, written prior permission. */ #ifndef RATELIMIT_H #define RATELIMIT_H 1 struct rconn; struct secchan; struct settings; struct switch_status; void rate_limit_start(struct secchan *, const struct settings *, struct switch_status *, struct rconn *remote); #endif /* ratelimit.h */
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { int i, j, k; while (i < 10 && j < 10 || i == k) { printf("1\n"); while (k < 20) printf("2\n"); } return 0; }
/*-----------------------------------------------------------------------*/ /* Low level disk I/O module skeleton for FatFs (C)ChaN, 2007 */ /*-----------------------------------------------------------------------*/ /* This is a stub disk I/O module that acts as front end of the existing */ /* disk I/O modules and attach it to FatFs module with common interface. */ /*-----------------------------------------------------------------------*/ #include "diskio.h" /*-----------------------------------------------------------------------*/ /* Initialize a Drive */ DSTATUS disk_initialize ( BYTE drv /* Physical drive number (0..) */ ) { return FR_OK; } /*-----------------------------------------------------------------------*/ /* Return Disk Status */ DSTATUS disk_status ( BYTE drv /* Physical drive number (0..) */ ) { return FR_OK; } /*-----------------------------------------------------------------------*/ /* Read Sector(s) */ DRESULT disk_read ( BYTE drv, /* Physical drive number (0..) */ BYTE *buff, /* Data buffer to store read data */ DWORD sector, /* Sector address (LBA) */ BYTE count /* Number of sectors to read (1..255) */ ) { DataflashManager_ReadBlocks_RAM(sector, count, buff); return RES_OK; } /*-----------------------------------------------------------------------*/ /* Write Sector(s) */ #if _READONLY == 0 DRESULT disk_write ( BYTE drv, /* Physical drive number (0..) */ const BYTE *buff, /* Data to be written */ DWORD sector, /* Sector address (LBA) */ BYTE count /* Number of sectors to write (1..255) */ ) { DataflashManager_WriteBlocks_RAM(sector, count, buff); return RES_OK; } #endif /* _READONLY */
/* Copyright (c) 2011-2012 - Tőkés Attila This file is part of SmtpClient for Qt. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. See the LICENSE file for more details. */ #ifndef QUOTEDPRINTABLE_H #define QUOTEDPRINTABLE_H #include <QObject> #include <QByteArray> #include "smtpexports.h" class SMTP_EXPORT QuotedPrintable : public QObject { Q_OBJECT public: static QString encode(const QByteArray &input); static QByteArray decode(const QString &input); private: QuotedPrintable(); }; #endif // QUOTEDPRINTABLE_H
/** * @copyright * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. * ==================================================================== * @endcopyright * * @file svn_time.h * @brief Time/date utilities */ #ifndef SVN_TIME_H #define SVN_TIME_H #include <apr_pools.h> #include <apr_time.h> #include "svn_error.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** Convert @a when to a <tt>const char *</tt> representation allocated * in @a pool. Use svn_time_from_cstring() for the reverse * conversion. */ const char * svn_time_to_cstring(apr_time_t when, apr_pool_t *pool); /** Convert @a data to an @c apr_time_t @a when. * Use @a pool for temporary memory allocation. */ svn_error_t * svn_time_from_cstring(apr_time_t *when, const char *data, apr_pool_t *pool); /** Convert @a when to a <tt>const char *</tt> representation allocated * in @a pool, suitable for human display in UTF8. */ const char * svn_time_to_human_cstring(apr_time_t when, apr_pool_t *pool); /** Convert a human-readable date @a text into an @c apr_time_t, using * @a now as the current time and storing the result in @a result. * The local time zone will be used to compute the appropriate GMT * offset if @a text contains a local time specification. Set @a * matched to indicate whether or not @a text was parsed successfully. * Perform any allocation in @a pool. Return an error iff an internal * error (rather than a simple parse error) occurs. */ svn_error_t * svn_parse_date(svn_boolean_t *matched, apr_time_t *result, const char *text, apr_time_t now, apr_pool_t *pool); /** Sleep until the next second, to ensure that any files modified * after we exit have a different timestamp than the one we recorded. * * @deprecated Provided for backward compatibility with the 1.5 API. * Use svn_io_sleep_for_timestamps() instead. */ SVN_DEPRECATED void svn_sleep_for_timestamps(void); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SVN_TIME_H */
/* GStreamer - GParamSpecs for for some of our types * Copyright (C) 2007 Tim-Philipp Müller <tim centricular net> * * 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 __GST_PARAMSPECS_H__ #define __GST_PARAMSPECS_H__ #include <gst/gstvalue.h> G_BEGIN_DECLS /* --- paramspec flags */ /** * GST_PARAM_CONTROLLABLE: * * Use this flag on GObject properties to signal they can make sense to be. * controlled over time. This hint is used by the GstController. */ #define GST_PARAM_CONTROLLABLE (1 << (G_PARAM_USER_SHIFT + 1)) /** * GST_PARAM_MUTABLE_READY: * * Use this flag on GObject properties of GstElements to indicate that * they can be changed when the element is in the READY or lower state. * * Since: 0.10.23 */ #define GST_PARAM_MUTABLE_READY (1 << (G_PARAM_USER_SHIFT + 2)) /** * GST_PARAM_MUTABLE_PAUSED: * * Use this flag on GObject properties of GstElements to indicate that * they can be changed when the element is in the PAUSED or lower state. * This flag implies GST_PARAM_MUTABLE_READY. * * Since: 0.10.23 */ #define GST_PARAM_MUTABLE_PAUSED (1 << (G_PARAM_USER_SHIFT + 3)) /** * GST_PARAM_MUTABLE_PLAYING: * * Use this flag on GObject properties of GstElements to indicate that * they can be changed when the element is in the PLAYING or lower state. * This flag implies GST_PARAM_MUTABLE_PAUSED. * * Since: 0.10.23 */ #define GST_PARAM_MUTABLE_PLAYING (1 << (G_PARAM_USER_SHIFT + 4)) /** * GST_PARAM_USER_SHIFT: * * Bits based on GST_PARAM_USER_SHIFT can be used by 3rd party applications. */ #define GST_PARAM_USER_SHIFT (1 << (G_PARAM_USER_SHIFT + 8)) /* --- type macros --- */ #define GST_TYPE_PARAM_FRACTION (gst_param_spec_fraction_get_type ()) #define GST_IS_PARAM_SPEC_FRACTION(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GST_TYPE_PARAM_FRACTION)) #define GST_PARAM_SPEC_FRACTION(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GST_TYPE_PARAM_FRACTION, GstParamSpecFraction)) /* --- get_type functions --- */ GType gst_param_spec_fraction_get_type (void); /* --- typedefs & structures --- */ typedef struct _GstParamSpecFraction GstParamSpecFraction; /** * GstParamSpecFraction: * @parent_instance: super class * @min_num: minimal numerator * @min_den: minimal denominator * @max_num: maximal numerator * @max_den: maximal denominator * @def_num: default numerator * @def_den: default denominator * * A GParamSpec derived structure that contains the meta data for fractional * properties. */ struct _GstParamSpecFraction { GParamSpec parent_instance; gint min_num, min_den; gint max_num, max_den; gint def_num, def_den; }; /* --- GParamSpec prototypes --- */ GParamSpec * gst_param_spec_fraction (const gchar * name, const gchar * nick, const gchar * blurb, gint min_num, gint min_denom, gint max_num, gint max_denom, gint default_num, gint default_denom, GParamFlags flags); G_END_DECLS #endif /* __GST_PARAMSPECS_H__ */
/* LUFA Library Copyright (C) Dean Camera, 2011. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation, and that the name of the author not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The author disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the author be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. */ /** \file * \brief Common USB Pipe definitions for all architectures. * \copydetails Group_PipeManagement * * \note This file should not be included directly. It is automatically included as needed by the USB driver * dispatch header located in LUFA/Drivers/USB/USB.h. */ /** \ingroup Group_PipeManagement * \defgroup Group_PipeRW Pipe Data Reading and Writing * \brief Pipe data read/write definitions. * * Functions, macros, variables, enums and types related to data reading and writing from and to pipes. */ /** \ingroup Group_PipeRW * \defgroup Group_PipePrimitiveRW Read/Write of Primitive Data Types * \brief Pipe data primitive read/write definitions. * * Functions, macros, variables, enums and types related to data reading and writing of primitive data types * from and to pipes. */ /** \ingroup Group_PipeManagement * \defgroup Group_PipePacketManagement Pipe Packet Management * \brief Pipe packet management definitions. * * Functions, macros, variables, enums and types related to packet management of pipes. */ /** \ingroup Group_PipeManagement * \defgroup Group_PipeControlReq Pipe Control Request Management * \brief Pipe control request definitions. * * Module for host mode request processing. This module allows for the transmission of standard, class and * vendor control requests to the default control endpoint of an attached device while in host mode. * * \see Chapter 9 of the USB 2.0 specification. */ /** \ingroup Group_USB * \defgroup Group_PipeManagement Pipe Management * \brief Pipe management definitions. * * This module contains functions, macros and enums related to pipe management when in USB Host mode. This * module contains the pipe management macros, as well as pipe interrupt and data send/receive functions * for various data types. * * @{ */ #ifndef __PIPE_H__ #define __PIPE_H__ /* Includes: */ #include "../../../Common/Common.h" #include "USBMode.h" /* Enable C linkage for C++ Compilers: */ #if defined(__cplusplus) extern "C" { #endif /* Preprocessor Checks: */ #if !defined(__INCLUDE_FROM_USB_DRIVER) #error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead. #endif /* Public Interface - May be used in end-application: */ /* Macros: */ /** Pipe address for the default control pipe, which always resides in address 0. This is * defined for convenience to give more readable code when used with the pipe macros. */ #define PIPE_CONTROLPIPE 0 /** Pipe number mask, for masking against pipe addresses to retrieve the pipe's numerical address * in the device. */ #define PIPE_PIPENUM_MASK 0x07 /** Endpoint number mask, for masking against endpoint addresses to retrieve the endpoint's * numerical address in the attached device. */ #define PIPE_EPNUM_MASK 0x0F /** Endpoint direction mask, for masking against endpoint addresses to retrieve the endpoint's * direction for comparing with the \c ENDPOINT_DESCRIPTOR_DIR_* masks. */ #define PIPE_EPDIR_MASK 0x80 /* Architecture Includes: */ #if (ARCH == ARCH_AVR8) #include "AVR8/Pipe_AVR8.h" #elif (ARCH == ARCH_UC3) #include "UC3/Pipe_UC3.h" #endif /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) } #endif #endif /** @} */
/* Copyright (C) 2007-2008 Jean-Marc Valin Copyright (C) 2008 Thorvald Natvig File: resample.c 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.
/***************************************************************************//** * @file * @brief EFM32GG_PRS_CH register and bit field definitions ******************************************************************************* * # License * <b>Copyright 2019 Silicon Laboratories Inc. www.silabs.com</b> ******************************************************************************* * * SPDX-License-Identifier: Zlib * * The licensor of this software is Silicon Laboratories Inc. * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * ******************************************************************************/ #if defined(__ICCARM__) #pragma system_include /* Treat file as system include file. */ #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) #pragma clang system_header /* Treat file as system include file. */ #endif /***************************************************************************//** * @addtogroup Parts * @{ ******************************************************************************/ /***************************************************************************//** * @brief PRS_CH EFM32GG PRS CH ******************************************************************************/ typedef struct { __IOM uint32_t CTRL; /**< Channel Control Register */ } PRS_CH_TypeDef; /** @} End of group Parts */
/*! * @file isp_driver_hmac_securekey.h * @brief Headerfile : isp driver for hmac securekey * @author jinsu.hyun * @version v0.50 : 2016.8.13 Init. release version */ #ifndef ISP_DRIVER_HMAC_SECUREKEY_H_ #define ISP_DRIVER_HMAC_SECUREKEY_H_ #include "mb_cmd_hmac_securekey.h" // ====================================== // Function // ====================================== int isp_hmac_generate_key_securekey(unsigned int key_byte_len, unsigned int key_index); int isp_hmac_securekey(unsigned char *mac, struct sHMAC_MSG *hmac_msg, unsigned int object_id, unsigned int key_index); #endif /* ISP_DRIVER_HMAC_SECUREKEY_H_ */
/** * Copyright (c) 2014, Analog Devices, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted (subject to the limitations in the * disclaimer below) 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 Analog Devices, Inc. nor the names of its * 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. */ /** @module include.h @brief Main Include file @version V0.2 @author PAD CSE group, Analog Devices Inc @date January 2013 @par Revision History: - V0.1, February 2012: initial version. - V0.2, January 2013: addition of PwmLib, FeeLib and DmaLib remove uart.h **/ #ifndef __INCLUDE_H #define __INCLUDE_H #include <stdlib.h> #include <stddef.h> #include <stdio.h> #include <string.h> #include <limits.h> #include <defs.h> #include <ADuCRF101.h> #include "radioeng.h" #endif // __INCLUDE_H
/* The CPM2 internal interrupt controller. It is usually * the only interrupt controller. * There are two 32-bit registers (high/low) for up to 64 * possible interrupts. * * Now, the fun starts.....Interrupt Numbers DO NOT MAP * in a simple arithmetic fashion to mask or pending registers. * That is, interrupt 4 does not map to bit position 4. * We create two tables, indexed by vector number, to indicate * which register to use and which bit in the register to use. */ #include <linux/stddef.h> #include <linux/init.h> #include <linux/sched.h> #include <linux/signal.h> #include <linux/irq.h> #include <asm/immap_cpm2.h> #include <asm/mpc8260.h> #include "cpm2_pic.h" static u_char irq_to_siureg[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* bit numbers do not match the docs, these are precomputed so the bit for * a given irq is (1 << irq_to_siubit[irq]) */ static u_char irq_to_siubit[] = { 0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 2, 1, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 0, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, }; static void cpm2_mask_irq(unsigned int irq_nr) { int bit, word; volatile uint *simr; irq_nr -= CPM_IRQ_OFFSET; bit = irq_to_siubit[irq_nr]; word = irq_to_siureg[irq_nr]; simr = &(cpm2_immr->im_intctl.ic_simrh); ppc_cached_irq_mask[word] &= ~(1 << bit); simr[word] = ppc_cached_irq_mask[word]; } static void cpm2_unmask_irq(unsigned int irq_nr) { int bit, word; volatile uint *simr; irq_nr -= CPM_IRQ_OFFSET; bit = irq_to_siubit[irq_nr]; word = irq_to_siureg[irq_nr]; simr = &(cpm2_immr->im_intctl.ic_simrh); ppc_cached_irq_mask[word] |= 1 << bit; simr[word] = ppc_cached_irq_mask[word]; } static void cpm2_mask_and_ack(unsigned int irq_nr) { int bit, word; volatile uint *simr, *sipnr; irq_nr -= CPM_IRQ_OFFSET; bit = irq_to_siubit[irq_nr]; word = irq_to_siureg[irq_nr]; simr = &(cpm2_immr->im_intctl.ic_simrh); sipnr = &(cpm2_immr->im_intctl.ic_sipnrh); ppc_cached_irq_mask[word] &= ~(1 << bit); simr[word] = ppc_cached_irq_mask[word]; sipnr[word] = 1 << bit; } static void cpm2_end_irq(unsigned int irq_nr) { int bit, word; volatile uint *simr; if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS)) && irq_desc[irq_nr].action) { irq_nr -= CPM_IRQ_OFFSET; bit = irq_to_siubit[irq_nr]; word = irq_to_siureg[irq_nr]; simr = &(cpm2_immr->im_intctl.ic_simrh); ppc_cached_irq_mask[word] |= 1 << bit; simr[word] = ppc_cached_irq_mask[word]; } } static struct hw_interrupt_type cpm2_pic = { .typename = " CPM2 SIU ", .enable = cpm2_unmask_irq, .disable = cpm2_mask_irq, .ack = cpm2_mask_and_ack, .end = cpm2_end_irq, }; int cpm2_get_irq(struct pt_regs *regs) { int irq; unsigned long bits; /* For CPM2, read the SIVEC register and shift the bits down * to get the irq number. */ bits = cpm2_immr->im_intctl.ic_sivec; irq = bits >> 26; if (irq == 0) return(-1); return irq+CPM_IRQ_OFFSET; } void cpm2_init_IRQ(void) { int i; /* Clear the CPM IRQ controller, in case it has any bits set * from the bootloader */ /* Mask out everything */ cpm2_immr->im_intctl.ic_simrh = 0x00000000; cpm2_immr->im_intctl.ic_simrl = 0x00000000; wmb(); /* Ack everything */ cpm2_immr->im_intctl.ic_sipnrh = 0xffffffff; cpm2_immr->im_intctl.ic_sipnrl = 0xffffffff; wmb(); /* Dummy read of the vector */ i = cpm2_immr->im_intctl.ic_sivec; rmb(); /* Initialize the default interrupt mapping priorities, * in case the boot rom changed something on us. */ cpm2_immr->im_intctl.ic_sicr = 0; cpm2_immr->im_intctl.ic_scprrh = 0x05309770; cpm2_immr->im_intctl.ic_scprrl = 0x05309770; /* Enable chaining to OpenPIC, and make everything level */ for (i = 0; i < NR_CPM_INTS; i++) { irq_desc[i+CPM_IRQ_OFFSET].handler = &cpm2_pic; irq_desc[i+CPM_IRQ_OFFSET].status |= IRQ_LEVEL; } }
#ifndef _XEN_NUMA_H #define _XEN_NUMA_H #include <xen/config.h> #include <asm/numa.h> #ifndef NODES_SHIFT #define NODES_SHIFT 0 #endif #define NUMA_NO_NODE 0xFF #define MAX_NUMNODES (1 << NODES_SHIFT) #define vcpu_to_node(v) (cpu_to_node((v)->processor)) #define domain_to_node(d) \ (((d)->vcpu != NULL && (d)->vcpu[0] != NULL) \ ? vcpu_to_node((d)->vcpu[0]) : NUMA_NO_NODE) #endif /* _XEN_NUMA_H */
/* * ===================================================================================== * * Filename: heap.h * * Description: 简单的内核堆管理 * * Version: 1.0 * Created: 2013年11月08日 16时53分35秒 * Revision: none * Compiler: gcc * * Author: Hurley (LiuHuan), liuhuan1992@gmail.com * Company: Class 1107 of Computer Science and Technology * * ===================================================================================== */ #ifndef INCLUDE_HEAP_H_ #define INCLUDE_HEAP_H_ #include "types.h" // 堆起始地址 #define HEAP_START 0xE0000000 // 内存块管理结构 typedef struct header { struct header *prev; // 前后内存块管理结构指针 struct header *next; uint32_t allocated : 1; // 该内存块是否已经被申请 uint32_t length : 31; // 当前内存块的长度 } header_t; // 初始化堆 void init_heap(); // 内存申请 void *kmalloc(uint32_t len); // 内存释放 void kfree(void *p); // 测试内核堆申请释放 void test_heap(); #endif // INCLUDE_HEAP_H_
#ifndef HD_EXT8BIT_H #define HD_EXT8BIT_H #include "lcd.h" /* for Driver */ // initialise this particular driver int hd_init_ext8bit(Driver *drvthis); #endif
/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #import <UIKit/UIKit.h> #import <React/RCTFrameUpdate.h> @class RCTBridge; @interface RCTTouchHandler : UIGestureRecognizer - (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; - (void)attachToView:(UIView *)view; - (void)detachFromView:(UIView *)view; - (void)cancel; @end
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_NET_NSS_CONTEXT_H_ #define CHROME_BROWSER_NET_NSS_CONTEXT_H_ #include <string> #include "base/callback.h" #include "base/compiler_specific.h" #include "crypto/scoped_nss_types.h" class Profile; namespace net { class NSSCertDatabase; } namespace content { class ResourceContext; } // namespace content // Returns a reference to the public slot for the user associated with // |context|. Should be called only on the IO thread. crypto::ScopedPK11Slot GetPublicNSSKeySlotForResourceContext( content::ResourceContext* context); // Returns a reference to the private slot for the user associated with // |context|, if it is loaded. If it is not loaded and |callback| is non-null, // the |callback| will be run once the slot is loaded. // Should be called only on the IO thread. crypto::ScopedPK11Slot GetPrivateNSSKeySlotForResourceContext( content::ResourceContext* context, const base::Callback<void(crypto::ScopedPK11Slot)>& callback) WARN_UNUSED_RESULT; // Returns a pointer to the NSSCertDatabase for the user associated with // |context|, if it is ready. If it is not ready and |callback| is non-null, the // |callback| will be run once the DB is initialized. Ownership is not // transferred, but the caller may save the pointer, which will remain valid for // the lifetime of the ResourceContext. // Should be called only on the IO thread. net::NSSCertDatabase* GetNSSCertDatabaseForResourceContext( content::ResourceContext* context, const base::Callback<void(net::NSSCertDatabase*)>& callback) WARN_UNUSED_RESULT; // Gets a pointer to the NSSCertDatabase for the user associated with |context|. // It's a wrapper around |GetNSSCertDatabaseForResourceContext| which makes // sure it's called on IO thread (with |profile|'s resource context). The // callback will be called on the originating message loop. // It's accessing profile, so it should be called on the UI thread. void GetNSSCertDatabaseForProfile( Profile* profile, const base::Callback<void(net::NSSCertDatabase*)>& callback); #endif // CHROME_BROWSER_NET_NSS_CONTEXT_H_
/* SPDX-License-Identifier: LGPL-2.1+ */ #include <fcntl.h> #include "alloc-util.h" #include "env-util.h" #include "escape.h" #include "fileio.h" #include "missing_mman.h" #include "missing_syscall.h" #include "parse-util.h" #include "process-util.h" #include "serialize.h" #include "strv.h" #include "tmpfile-util.h" int serialize_item(FILE *f, const char *key, const char *value) { assert(f); assert(key); if (!value) return 0; /* Make sure that anything we serialize we can also read back again with read_line() with a maximum line size * of LONG_LINE_MAX. This is a safety net only. All code calling us should filter this out earlier anyway. */ if (strlen(key) + 1 + strlen(value) + 1 > LONG_LINE_MAX) { log_warning("Attempted to serialize overly long item '%s', refusing.", key); return -EINVAL; } fputs(key, f); fputc('=', f); fputs(value, f); fputc('\n', f); return 1; } int serialize_item_escaped(FILE *f, const char *key, const char *value) { _cleanup_free_ char *c = NULL; assert(f); assert(key); if (!value) return 0; c = cescape(value); if (!c) return log_oom(); return serialize_item(f, key, c); } int serialize_item_format(FILE *f, const char *key, const char *format, ...) { char buf[LONG_LINE_MAX]; va_list ap; int k; assert(f); assert(key); assert(format); va_start(ap, format); k = vsnprintf(buf, sizeof(buf), format, ap); va_end(ap); if (k < 0 || (size_t) k >= sizeof(buf) || strlen(key) + 1 + k + 1 > LONG_LINE_MAX) { log_warning("Attempted to serialize overly long item '%s', refusing.", key); return -EINVAL; } fputs(key, f); fputc('=', f); fputs(buf, f); fputc('\n', f); return 1; } int serialize_fd(FILE *f, FDSet *fds, const char *key, int fd) { int copy; assert(f); assert(key); if (fd < 0) return 0; copy = fdset_put_dup(fds, fd); if (copy < 0) return log_error_errno(copy, "Failed to add file descriptor to serialization set: %m"); return serialize_item_format(f, key, "%i", copy); } int serialize_usec(FILE *f, const char *key, usec_t usec) { assert(f); assert(key); if (usec == USEC_INFINITY) return 0; return serialize_item_format(f, key, USEC_FMT, usec); } int serialize_dual_timestamp(FILE *f, const char *name, const dual_timestamp *t) { assert(f); assert(name); assert(t); if (!dual_timestamp_is_set(t)) return 0; return serialize_item_format(f, name, USEC_FMT " " USEC_FMT, t->realtime, t->monotonic); } int serialize_strv(FILE *f, const char *key, char **l) { int ret = 0, r; char **i; /* Returns the first error, or positive if anything was serialized, 0 otherwise. */ STRV_FOREACH(i, l) { r = serialize_item_escaped(f, key, *i); if ((ret >= 0 && r < 0) || (ret == 0 && r > 0)) ret = r; } return ret; } int deserialize_usec(const char *value, usec_t *ret) { int r; assert(value); r = safe_atou64(value, ret); if (r < 0) return log_debug_errno(r, "Failed to parse usec value \"%s\": %m", value); return 0; } int deserialize_dual_timestamp(const char *value, dual_timestamp *t) { uint64_t a, b; int r, pos; assert(value); assert(t); pos = strspn(value, WHITESPACE); if (value[pos] == '-') return -EINVAL; pos += strspn(value + pos, DIGITS); pos += strspn(value + pos, WHITESPACE); if (value[pos] == '-') return -EINVAL; r = sscanf(value, "%" PRIu64 "%" PRIu64 "%n", &a, &b, &pos); if (r != 2) return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to parse dual timestamp value \"%s\".", value); if (value[pos] != '\0') /* trailing garbage */ return -EINVAL; t->realtime = a; t->monotonic = b; return 0; } int deserialize_environment(const char *value, char ***list) { _cleanup_free_ char *unescaped = NULL; int r; assert(value); assert(list); /* Changes the *environment strv inline. */ r = cunescape(value, 0, &unescaped); if (r < 0) return log_error_errno(r, "Failed to unescape: %m"); r = strv_env_replace(list, unescaped); if (r < 0) return log_error_errno(r, "Failed to append environment variable: %m"); unescaped = NULL; /* now part of 'list' */ return 0; } int open_serialization_fd(const char *ident) { int fd; fd = memfd_create(ident, MFD_CLOEXEC); if (fd < 0) { const char *path; path = getpid_cached() == 1 ? "/run/systemd" : "/tmp"; fd = open_tmpfile_unlinkable(path, O_RDWR|O_CLOEXEC); if (fd < 0) return fd; log_debug("Serializing %s to %s.", ident, path); } else log_debug("Serializing %s to memfd.", ident); return fd; }
/* * $Id: mi_datagram_writer.c 1133 2007-04-02 17:31:13Z ancuta_onofrei $ * * Copyright (C) 2007 Voice Sistem SRL * * 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. * * * History: * --------- * 2007-06-25 first version (ancuta) */ /*! * \file * \brief MI_DATAGRAM :: Writer * \ingroup mi */ #include <stdio.h> #include <string.h> #include "../../str.h" #include "../../ut.h" #include "../../dprint.h" #include "../../lib/kmi/mi.h" #include "../../mem/mem.h" #include "mi_datagram.h" #include "datagram_fnc.h" #include "mi_datagram_parser.h" static unsigned int mi_write_buffer_len = 0; static str mi_datagram_indent; int mi_datagram_writer_init( unsigned int size , char *indent) { mi_write_buffer_len = size; if (indent==NULL || indent[0]==0 ) { mi_datagram_indent.s = 0; mi_datagram_indent.len = 0; } else { mi_datagram_indent.s = indent; mi_datagram_indent.len = strlen(indent); } return 0; } static inline int mi_datagram_write_node(datagram_stream * dtgram, struct mi_node *node, int level) { struct mi_attr *attr; char *start, *end, *p; start = p = dtgram->current; end = dtgram->start + dtgram->len; LM_DBG("writing the name <%.*s> and value <%.*s> \n", node->name.len, node->name.s, node->value.len, node->value.s); /* write indents */ if (mi_datagram_indent.s) { if (p + level*mi_datagram_indent.len>end) { LM_DBG("a too long line\n"); return -1; } for( ; level>0 ; level-- ) { memcpy( p, mi_datagram_indent.s, mi_datagram_indent.len); p += mi_datagram_indent.len; } } /* name and value */ if (node->name.s!=NULL) { if (p+node->name.len+3>end) { LM_DBG("too long name\n"); return -1; } memcpy(p,node->name.s,node->name.len); p += node->name.len; *(p++) = MI_ATTR_VAL_SEP1; *(p++) = MI_ATTR_VAL_SEP2; *(p++) = ' '; } /*LM_DBG("after adding the " "name, the datagram is %s\n ", dtgram->datagram.s);*/ if (node->value.s!=NULL) { if (p+node->value.len>end) { LM_DBG("too long value\n"); return -1; } memcpy(p,node->value.s,node->value.len); p += node->value.len; } /* LM_DBG("after adding the " "value, the datagram is %s\n ", dtgram->datagram.s);*/ /* attributes */ for( attr=node->attributes ; attr!=NULL ; attr=attr->next ) { if (attr->name.s!=NULL) { if (p+attr->name.len+2>end) { LM_DBG("too long attr name\n"); return -1; } *(p++) = ' '; memcpy(p,attr->name.s,attr->name.len); p += attr->name.len; *(p++) = '='; } if (attr->value.s!=NULL) { if (p+attr->value.len>end) { LM_DBG("too long attr value\n"); return -1; } memcpy(p,attr->value.s,attr->value.len); p += attr->value.len; } } /* LM_DBG("after adding the " "attributes, the datagram is %s\n ", dtgram->datagram.s);*/ if (p+1>end) { LM_DBG("overflow before returning\n"); return -1; } *(p++) = '\n'; dtgram->len -= p-start; dtgram->current = p; return 0; } static int datagram_recur_write_tree(datagram_stream *dtgram, struct mi_node *tree, int level) { for( ; tree ; tree=tree->next ) { if (mi_datagram_write_node( dtgram, tree, level)!=0) { LM_ERR("failed to write -line too long!!!\n"); return -1; } if (tree->kids) { if (datagram_recur_write_tree(dtgram, tree->kids, level+1)<0) return -1; } } return 0; } int mi_datagram_write_tree(datagram_stream * dtgram, struct mi_root *tree) { str code; dtgram->current = dtgram->start; dtgram->len = mi_write_buffer_len; /* write the root node */ code.s = int2str((unsigned long)tree->code, &code.len); if (code.len+tree->reason.len+1 > dtgram->len) { LM_ERR("failed to write - reason too long!!!\n"); return -1; } memcpy( dtgram->start, code.s, code.len); dtgram->current += code.len; *(dtgram->current) = ' '; dtgram->current++; if (tree->reason.len) { memcpy(dtgram->current, tree->reason.s, tree->reason.len); dtgram->current += tree->reason.len; } *(dtgram->current) = '\n'; dtgram->current++; dtgram->len -= code.len + 1 + tree->reason.len+1; if (datagram_recur_write_tree(dtgram, tree->node.kids, 0)!=0) return -1; if (dtgram->len<=0) { LM_ERR("failed to write - EOC does not fit in!!!\n"); return -1; } *(dtgram->current) = '\n'; dtgram->len--; *(dtgram->current) = '\0'; return 0; }
/* -*- buffer-read-only: t -*- vi: set ro: */ /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Test of perror() function. Copyright (C) 2008-2011 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, 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 <config.h> #include <stdio.h> #include "signature.h" SIGNATURE_CHECK (perror, void, (char const *)); #include <errno.h> int main (int argc, char **argv) { const char *prefix = (argc > 1 ? argv[1] : NULL); errno = EACCES; perror (prefix); errno = ETIMEDOUT; perror (prefix); errno = EOVERFLOW; perror (prefix); return 0; }
/* { dg-options "-fdiagnostics-show-caret" } */ /* Various versions of the same C error, with a variety of line spacing, and of columns, to exercise the line-span handling in diagnostic-show-locus.c (PR other/69554). */ /* All on one line. */ int test_1 (const char *p, const char *q) { return (p + 1) + (q + 1); /* { dg-error "invalid operands" } */ /* { dg-begin-multiline-output "" } return (p + 1) + (q + 1); ~~~~~~~ ^ ~~~~~~~ | | | const char * const char * { dg-end-multiline-output "" } */ } /* On separate lines, but without intervening lines. This can be printed as a single span of lines. */ int test_2 (const char *p, const char *q) { return (p + 1) + /* { dg-error "invalid operands" } */ (q + 1); /* { dg-begin-multiline-output "" } return (p + 1) ~~~~~~~ | const char * + ^ (q + 1); ~~~~~~~ | const char * { dg-end-multiline-output "" } */ } /* On separate lines, with an intervening line between lines 1 and 2. This is printed as 2 "spans" of lines, broken up by the intervening line. */ int test_3 (const char *p, const char *q) { return (p + 1) /* { dg-locus "10" } */ + /* { dg-error "invalid operands" } */ (q + 1); /* { dg-locus "12" "" { target *-*-* } "51" } */ /* { dg-begin-multiline-output "" } return (p + 1) ~~~~~~~ | const char * { dg-end-multiline-output "" } */ /* { dg-begin-multiline-output "" } + ^ (q + 1); ~~~~~~~ | const char * { dg-end-multiline-output "" } */ } /* As above, but the intervening line is between lines 2 and 3, so that the 2 spans are grouped the other way. */ int test_4 (const char *p, const char *q) { return (p + 1) + /* { dg-error "invalid operands" } */ (q + 1); /* { dg-locus "14" } */ /* { dg-begin-multiline-output "" } return (p + 1) ~~~~~~~ | const char * + ^ { dg-end-multiline-output "" } */ /* { dg-begin-multiline-output "" } (q + 1); ~~~~~~~ | const char * { dg-end-multiline-output "" } */ } /* On separate lines, with intervening lines. This is printed as 3 "spans" of lines, each span being an individual line. */ int test_5 (const char *p, const char *q) { return (p + 1) /* { dg-locus "10" } */ + /* { dg-error "invalid operands" } */ (q + 1); /* { dg-locus "14" } */ /* { dg-locus "12" "" { target *-*-* } "103" } */ /* { dg-begin-multiline-output "" } return (p + 1) ~~~~~~~ | const char * { dg-end-multiline-output "" } */ /* { dg-begin-multiline-output "" } + ^ { dg-end-multiline-output "" } */ /* { dg-begin-multiline-output "" } (q + 1); ~~~~~~~ | const char * { dg-end-multiline-output "" } */ } /* On separate lines, with numerous intervening lines. This is printed as 3 "spans" of lines, each span being an individual line. */ int test_6 (const char *p, const char *q) { return (p + 1) /* { dg-locus "10" } */ /* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nisl sapien, rutrum non euismod et, rutrum ac felis. Morbi nec nisi ipsum. Quisque pulvinar ante nec urna rhoncus, a cursus nisi commodo. Praesent euismod neque lectus, at dapibus ipsum gravida in. Pellentesque tempor massa eu viverra feugiat. Proin eleifend pulvinar urna, ut dapibus metus vehicula ac. Suspendisse rutrum finibus quam, ac dignissim diam blandit maximus. In blandit viverra pulvinar. Praesent vel tellus elementum, placerat lacus quis, ornare lectus. Donec ac eleifend nulla, sit amet condimentum risus. Vestibulum aliquam maximus ante non pellentesque. Praesent mollis ante in risus feugiat hendrerit. Praesent feugiat maximus urna nec blandit. */ + /* { dg-error "invalid operands" } */ /* Vestibulum ac nunc eget enim tempor tristique. Suspendisse potenti. Nam et sollicitudin enim. Morbi sed tincidunt lectus. Sed facilisis velit at ante maximus feugiat. Sed vestibulum mi id leo tempor, sed ullamcorper sapien efficitur. Vestibulum purus lacus, dignissim non magna at, tincidunt luctus nisl. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec elit elit, laoreet a dolor quis, eleifend dapibus metus. Proin lectus turpis, eleifend nec pharetra eu, fermentum in lacus. Morbi sit amet mauris orci. Nam sagittis, nibh vel fermentum dictum, purus ex hendrerit odio, feugiat fringilla sapien elit vitae nisl. Fusce mattis commodo risus nec convallis. */ (q + 1); /* { dg-locus "14" } */ /* { dg-locus "12" "" { target *-*-* } "144" } */ /* { dg-begin-multiline-output "" } return (p + 1) ~~~~~~~ | const char * { dg-end-multiline-output "" } */ /* { dg-begin-multiline-output "" } + ^ { dg-end-multiline-output "" } */ /* { dg-begin-multiline-output "" } (q + 1); ~~~~~~~ | const char * { dg-end-multiline-output "" } */ }
/* linux/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c * * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. * http://www.samsung.com/ * * S5PV210 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC) * * 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/types.h> #include <linux/interrupt.h> #include <linux/platform_device.h> #include <linux/io.h> #include <linux/gpio.h> #include <linux/mmc/host.h> #include <linux/mmc/card.h> #include <plat/gpio-cfg.h> #include <plat/regs-sdhci.h> #include <plat/sdhci.h> #include "herring.h" #if defined (CONFIG_SAMSUNG_GALAXYS) || defined(CONFIG_SAMSUNG_FASCINATE) # define DRVSTR S3C_GPIO_DRVSTR_3X #else # define DRVSTR S3C_GPIO_DRVSTR_2X #endif void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) { unsigned int gpio; switch (width) { /* Channel 0 supports 4 and 8-bit bus width */ case 8: /* Set all the necessary GPIO function and pull up/down */ for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) { s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); s3c_gpio_set_drvstrength(gpio, DRVSTR); } case 0: case 1: case 4: /* Set all the necessary GPIO function and pull up/down */ for (gpio = S5PV210_GPG0(0); gpio <= S5PV210_GPG0(6); gpio++) { if (gpio != S5PV210_GPG0(2)) { s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); } s3c_gpio_set_drvstrength(gpio, DRVSTR); } break; default: printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width); } if (machine_is_herring() || machine_is_aries()) { s3c_gpio_cfgpin(S5PV210_GPJ2(7), S3C_GPIO_OUTPUT); s3c_gpio_setpull(S5PV210_GPJ2(7), S3C_GPIO_PULL_NONE); gpio_set_value(S5PV210_GPJ2(7), 1); } if (machine_is_herring()) { // This is not done for aries in the original kernel gpio_direction_output(S5PV210_GPJ2(7), 1); s3c_gpio_setpull(S5PV210_GPJ2(7), S3C_GPIO_PULL_NONE); } } void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) { unsigned int gpio; switch (width) { /* Channel 1 supports 4-bit bus width */ case 0: case 1: case 4: /* Set all the necessary GPIO function and pull up/down */ for (gpio = S5PV210_GPG1(0); gpio <= S5PV210_GPG1(6); gpio++) { if (gpio != S5PV210_GPG1(2)) { s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); } s3c_gpio_set_drvstrength(gpio, DRVSTR); } break; default: printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width); } } void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) { unsigned int gpio; switch (width) { /* Channel 2 supports 4 and 8-bit bus width */ case 8: /* Set all the necessary GPIO function and pull up/down */ for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) { s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); s3c_gpio_set_drvstrength(gpio, DRVSTR); } case 0: case 1: case 4: if (machine_is_herring() && herring_is_cdma_wimax_dev()) break; /* Set all the necessary GPIO function and pull up/down */ for (gpio = S5PV210_GPG2(0); gpio <= S5PV210_GPG2(6); gpio++) { if (gpio != S5PV210_GPG2(2)) { s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); } s3c_gpio_set_drvstrength(gpio, DRVSTR); } break; default: printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width); } } void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width) { unsigned int gpio; switch (width) { /* Channel 3 supports 4-bit bus width */ case 0: case 1: case 4: /* Set all the necessary GPIO function and pull up/down */ for (gpio = S5PV210_GPG3(0); gpio <= S5PV210_GPG3(6); gpio++) { if (gpio != S5PV210_GPG3(2)) { s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); } s3c_gpio_set_drvstrength(gpio, DRVSTR); } break; default: printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width); } }
/* Simple DirectMedia Layer Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "../../SDL_internal.h" #if SDL_VIDEO_DRIVER_WINDOWS extern int WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); #endif /* SDL_VIDEO_DRIVER_WINDOWS */ /* vi: set ts=4 sw=4 expandtab: */
/* * Copyright (c) 2018 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #include <mmintrin.h> #include "vpx_ports/system_state.h" void vpx_clear_system_state() { _mm_empty(); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) Microsoft Corporation. All rights reserved. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////#include <tinyhal.h> #include <tinyhal.h> //--// #ifndef _ZeligRAM_BS_Driver #define _ZeligRAM_BS_Driver 1 extern "C" { UINT32 Extern__Storage_Write( UINT32 address, UINT8* buffer, UINT32 offset, UINT32 len ); UINT32 Extern__Storage_Read( UINT32 address, UINT8* buffer, UINT32 offset, UINT32 len ); UINT32 Extern__Storage_Memset( UINT32 address, UINT8 data, UINT32 len ); UINT32 Extern__Storage_IsErased( UINT32 address, UINT32 len ); UINT32 Extern__Storage_EraseBlock( UINT32 address, UINT32 len ); } //--// struct ZeligRAM_BS_Driver { static BOOL ChipInitialize( void* context ); static BOOL ChipUnInitialize( void* context ); static const BlockDeviceInfo* GetDeviceInfo( void* context ); static BOOL Read( void* context, ByteAddress Address, UINT32 NumBytes, BYTE * pSectorBuff ); static BOOL Write( void* context, ByteAddress Address, UINT32 NumBytes, BYTE * pSectorBuff, BOOL ReadModifyWrite ); static BOOL Memset( void* context, ByteAddress Address, UINT8 Data, UINT32 NumBytes ); static BOOL GetSectorMetadata(void* context, ByteAddress SectorStart, SectorMetadata* pSectorMetadata); static BOOL SetSectorMetadata(void* context, ByteAddress SectorStart, SectorMetadata* pSectorMetadata); static BOOL IsBlockErased( void* context, ByteAddress BlockStart, UINT32 BlockLength ); static BOOL EraseBlock( void* context, ByteAddress Address ); static void SetPowerState( void* context, UINT32 State ); static UINT32 MaxSectorWrite_uSec( void* context ); static UINT32 MaxBlockErase_uSec( void* context ); //--// static BOOL ChipReadOnly( void* context, BOOL On, UINT32 ProtectionKey ); static BOOL ReadProductID( void* context, FLASH_WORD& ManufacturerCode, FLASH_WORD& DeviceCode ); }; //--// #endif // _ZeligRAM_BS_Driver
/* Complex power of long double values. Copyright (C) 1997-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <complex.h> #include <math.h> __complex__ long double __cpowl (__complex__ long double x, __complex__ long double c) { return __cexpl (c * __clogl (x)); } weak_alias (__cpowl, cpowl)
/* Copyright (c) 2010-2011, The Linux Foundation. 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. * */ #ifndef __KGSL_PWRCTRL_H #define __KGSL_PWRCTRL_H /***************************************************************************** ** power flags *****************************************************************************/ #define KGSL_PWRFLAGS_ON 1 #define KGSL_PWRFLAGS_OFF 0 #define KGSL_PWRLEVEL_TURBO 0 #define KGSL_PWRLEVEL_NOMINAL 1 #define KGSL_MAX_CLKS 5 struct platform_device; struct kgsl_busy { struct timeval start; struct timeval stop; int on_time; int time; int on_time_old; int time_old; unsigned int no_nap_cnt; }; struct kgsl_pwrctrl { int interrupt_num; int have_irq; struct clk *ebi1_clk; struct clk *grp_clks[KGSL_MAX_CLKS]; unsigned long power_flags; struct kgsl_pwrlevel pwrlevels[KGSL_MAX_PWRLEVELS]; unsigned int active_pwrlevel; int thermal_pwrlevel; unsigned int num_pwrlevels; unsigned int interval_timeout; struct regulator *gpu_reg; uint32_t pcl; unsigned int nap_allowed; unsigned int idle_needed; const char *regulator_name; const char *irq_name; s64 time; struct kgsl_busy busy; unsigned int restore_slumber; }; void kgsl_pwrctrl_irq(struct kgsl_device *device, int state); int kgsl_pwrctrl_init(struct kgsl_device *device); void kgsl_pwrctrl_close(struct kgsl_device *device); void kgsl_timer(unsigned long data); void kgsl_idle_check(struct work_struct *work); void kgsl_pre_hwaccess(struct kgsl_device *device); void kgsl_check_suspended(struct kgsl_device *device); int kgsl_pwrctrl_sleep(struct kgsl_device *device); void kgsl_pwrctrl_wake(struct kgsl_device *device); void kgsl_pwrctrl_pwrlevel_change(struct kgsl_device *device, unsigned int level); int kgsl_pwrctrl_init_sysfs(struct kgsl_device *device); void kgsl_pwrctrl_uninit_sysfs(struct kgsl_device *device); void kgsl_pwrctrl_enable(struct kgsl_device *device); void kgsl_pwrctrl_disable(struct kgsl_device *device); static inline unsigned long kgsl_get_clkrate(struct clk *clk) { return (clk != NULL) ? clk_get_rate(clk) : 0; } void kgsl_pwrctrl_set_state(struct kgsl_device *device, unsigned int state); void kgsl_pwrctrl_request_state(struct kgsl_device *device, unsigned int state); #endif /* __KGSL_PWRCTRL_H */
/* force-elision.h: Automatic enabling of elision for mutexes Copyright (C) 2013-2014 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/>. */ /* Check for elision on this lock without upgrading. */ #define DO_ELISION(m) \ (__pthread_force_elision \ && (m->__data.__kind & PTHREAD_MUTEX_NO_ELISION_NP) == 0) \ /* Automatically enable elision for existing user lock kinds. */ #define FORCE_ELISION(m, s) \ if (__pthread_force_elision \ && (m->__data.__kind & PTHREAD_MUTEX_ELISION_FLAGS_NP) == 0) \ { \ mutex->__data.__kind |= PTHREAD_MUTEX_ELISION_NP; \ s; \ }
/* Convert between lowlevel sigmask and libc representation of sigset_t. Generic version. Copyright (C) 1998-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Joe Keane <jgk@jgk.org>. 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/>. */ /* Convert between an old-style 32-bit signal mask and a POSIX sigset_t. */ /* Perform *SET = MASK. Unused bits of *SET are set to 0. Returns zero for success or -1 for errors (from sigaddset/sigemptyset). */ static inline int __attribute__ ((unused)) sigset_set_old_mask (sigset_t *set, int mask) { if (sizeof (__sigset_t) == sizeof (unsigned int)) *set = (unsigned int) mask; else { unsigned int __sig; if (__sigemptyset (set) < 0) return -1; for (__sig = 1; __sig < NSIG && __sig <= sizeof (mask) * 8; __sig++) if (mask & sigmask (__sig)) if (__sigaddset (set, __sig) < 0) return -1; } return 0; } /* Return the sigmask corresponding to *SET. Unused bits of *SET are thrown away. */ static inline int __attribute__ ((unused)) sigset_get_old_mask (const sigset_t *set) { if (sizeof (sigset_t) == sizeof (unsigned int)) return (unsigned int) *set; else { unsigned int mask = 0; unsigned int sig; for (sig = 1; sig < NSIG && sig <= sizeof (mask) * 8; sig++) if (__sigismember (set, sig)) mask |= sigmask (sig); return mask; } }
#ifndef AMBDEC_H #define AMBDEC_H #include "alstring.h" #include "alMain.h" /* Helpers to read .ambdec configuration files. */ enum AmbDecScaleType { ADS_N3D, ADS_SN3D, ADS_FuMa, }; typedef struct AmbDecConf { al_string Description; ALuint Version; /* Must be 3 */ ALuint ChanMask; ALuint FreqBands; /* Must be 1 or 2 */ ALsizei NumSpeakers; enum AmbDecScaleType CoeffScale; ALfloat XOverFreq; ALfloat XOverRatio; struct { al_string Name; ALfloat Distance; ALfloat Azimuth; ALfloat Elevation; al_string Connection; } Speakers[MAX_OUTPUT_CHANNELS]; /* Unused when FreqBands == 1 */ ALfloat LFOrderGain[MAX_AMBI_ORDER+1]; ALfloat LFMatrix[MAX_OUTPUT_CHANNELS][MAX_AMBI_COEFFS]; ALfloat HFOrderGain[MAX_AMBI_ORDER+1]; ALfloat HFMatrix[MAX_OUTPUT_CHANNELS][MAX_AMBI_COEFFS]; } AmbDecConf; void ambdec_init(AmbDecConf *conf); void ambdec_deinit(AmbDecConf *conf); int ambdec_load(AmbDecConf *conf, const char *fname); #endif /* AMBDEC_H */
/* * Copyright (C) 2013 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: * * 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. 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 CustomElementException_h #define CustomElementException_h #include "wtf/Allocator.h" #include "wtf/text/AtomicString.h" #include "wtf/text/WTFString.h" namespace blink { class ExceptionState; class CustomElementException { STATIC_ONLY(CustomElementException); public: enum Reason { CannotRegisterFromExtension, ConstructorPropertyNotConfigurable, ContextDestroyedCheckingPrototype, ContextDestroyedCreatingCallbacks, ContextDestroyedRegisteringDefinition, ExtendsIsInvalidName, ExtendsIsCustomElementName, InvalidName, PrototypeInUse, TypeAlreadyRegistered }; static void throwException(Reason, const AtomicString& type, ExceptionState&); private: static String preamble(const AtomicString& type); }; } // namespace blink #endif // CustomElementException_h
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CHROME_CONTENT_RULES_REGISTRY_H_ #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CHROME_CONTENT_RULES_REGISTRY_H_ #include <map> #include <set> #include <string> #include <vector> #include "base/memory/linked_ptr.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" #include "chrome/browser/extensions/api/declarative_content/content_action.h" #include "chrome/browser/extensions/api/declarative_content/content_condition.h" #include "components/url_matcher/url_matcher.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "extensions/browser/api/declarative/declarative_rule.h" #include "extensions/browser/api/declarative_content/content_rules_registry.h" #include "extensions/browser/info_map.h" class ContentPermissions; namespace content { class BrowserContext; class RenderProcessHost; class WebContents; struct FrameNavigateParams; struct LoadCommittedDetails; } namespace extension_web_request_api_helpers { struct EventResponseDelta; } namespace net { class URLRequest; } namespace extensions { class RulesRegistryService; typedef DeclarativeRule<ContentCondition, ContentAction> ContentRule; // The ChromeContentRulesRegistry is responsible for managing // the internal representation of rules for the Declarative Content API. // // Here is the high level overview of this functionality: // // RulesRegistry::Rule consists of Conditions and Actions, these are // represented as a ContentRule with ContentConditions and // ContentRuleActions. // // The evaluation of URL related condition attributes (host_suffix, path_prefix) // is delegated to a URLMatcher, because this is capable of evaluating many // of such URL related condition attributes in parallel. class ChromeContentRulesRegistry : public ContentRulesRegistry, public content::NotificationObserver { public: // For testing, |ui_part| can be NULL. In that case it constructs the // registry with storage functionality suspended. ChromeContentRulesRegistry(content::BrowserContext* browser_context, RulesCacheDelegate* cache_delegate); // ChromeContentRulesRegistry implementation: // Applies all content rules given an update (CSS match change or // page navigation, for now) from the renderer. void Apply(content::WebContents* contents, const std::vector<std::string>& matching_css_selectors) override; // Applies all content rules given that a tab was just navigated. void DidNavigateMainFrame( content::WebContents* tab, const content::LoadCommittedDetails& details, const content::FrameNavigateParams& params) override; // Implementation of RulesRegistry: std::string AddRulesImpl( const std::string& extension_id, const std::vector<linked_ptr<RulesRegistry::Rule>>& rules) override; std::string RemoveRulesImpl( const std::string& extension_id, const std::vector<std::string>& rule_identifiers) override; std::string RemoveAllRulesImpl(const std::string& extension_id) override; // content::NotificationObserver implementation. void Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) override; // Returns true if this object retains no allocated data. Only for debugging. bool IsEmpty() const; protected: ~ChromeContentRulesRegistry() override; // Virtual for testing: virtual base::Time GetExtensionInstallationTime( const std::string& extension_id) const; private: friend class DeclarativeChromeContentRulesRegistryTest; std::set<ContentRule*> GetMatches( const RendererContentMatchData& renderer_data) const; // Scans the rules for the set of conditions they're watching. If the set has // changed, calls InstructRenderProcess() for each RenderProcessHost in the // current browser_context. void UpdateConditionCache(); // Tells a renderer what page attributes to watch for using an // ExtensionMsg_WatchPages. void InstructRenderProcess(content::RenderProcessHost* process); typedef std::map<url_matcher::URLMatcherConditionSet::ID, ContentRule*> URLMatcherIdToRule; typedef std::map<ContentRule::GlobalRuleId, linked_ptr<ContentRule> > RulesMap; // Map that tells us which ContentRules may match under the condition that // the URLMatcherConditionSet::ID was returned by the |url_matcher_|. URLMatcherIdToRule match_id_to_rule_; RulesMap content_rules_; // Maps tab_id to the set of rules that match on that tab. This // lets us call Revert as appropriate. std::map<int, std::set<ContentRule*> > active_rules_; // Matches URLs for the page_url condition. url_matcher::URLMatcher url_matcher_; // All CSS selectors any rule's conditions watch for. std::vector<std::string> watched_css_selectors_; // Manages our notification registrations. content::NotificationRegistrar registrar_; scoped_refptr<InfoMap> extension_info_map_; DISALLOW_COPY_AND_ASSIGN(ChromeContentRulesRegistry); }; } // namespace extensions #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CHROME_CONTENT_RULES_REGISTRY_H_
/* arch/arm/mach-msm/board-univa-panel.c * Copyright (C) 2009 LGE, 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. */ #include <linux/err.h> #include <linux/i2c.h> #include <linux/i2c-gpio.h> #include <mach/msm_rpcrouter.h> #include <mach/gpio.h> #include <mach/vreg.h> #include <mach/board.h> #include <mach/board_lge.h> #include "devices.h" #include "board-univa.h" #define MSM_FB_LCDC_VREG_OP(name, op, level) \ do { \ vreg = vreg_get(0, name); \ vreg_set_level(vreg, level); \ if (vreg_##op(vreg)) \ printk(KERN_ERR "%s: %s vreg operation failed \n", \ (vreg_##op == vreg_enable) ? "vreg_enable" \ : "vreg_disable", name); \ } while (0) static char *msm_fb_vreg[] = { "gp1", "gp2", }; static int mddi_power_save_on; static int msm_fb_mddi_power_save(int on) { struct vreg *vreg; int flag_on = !!on; if (mddi_power_save_on == flag_on) return 0; mddi_power_save_on = flag_on; if (on) { MSM_FB_LCDC_VREG_OP(msm_fb_vreg[0], enable, 1800); MSM_FB_LCDC_VREG_OP(msm_fb_vreg[1], enable, 2800); } else{ MSM_FB_LCDC_VREG_OP(msm_fb_vreg[0], disable, 0); MSM_FB_LCDC_VREG_OP(msm_fb_vreg[1], disable, 0); } return 0; } static struct mddi_platform_data mddi_pdata = { .mddi_power_save = msm_fb_mddi_power_save, }; static struct msm_panel_common_pdata mdp_pdata = { .gpio = 97, }; static void __init msm_fb_add_devices(void) { msm_fb_register_device("mdp", &mdp_pdata); msm_fb_register_device("pmdh", &mddi_pdata); msm_fb_register_device("lcdc", 0); } static int mddi_ldp_pmic_backlight(int level) { /* TODO: Backlight control here */ return 0; } static struct msm_panel_ldp_pdata mddi_ldp_panel_data = { .gpio = 102, /* lcd reset_n */ .pmic_backlight = mddi_ldp_pmic_backlight, .initialized = 1, }; static struct platform_device mddi_ldp_panel_device = { .name = "mddi_ldp_hvga", .id = 0, .dev = { .platform_data = &mddi_ldp_panel_data, } }; /* backlight device */ static struct gpio_i2c_pin bl_i2c_pin[] = { [0] = { .sda_pin = 89, .scl_pin = 88, .reset_pin = 82, .irq_pin = 0, }, }; static struct i2c_gpio_platform_data bl_i2c_pdata = { .sda_is_open_drain = 0, .scl_is_open_drain = 0, .udelay = 2, }; static struct platform_device bl_i2c_device = { .name = "i2c-gpio", .dev.platform_data = &bl_i2c_pdata, }; void bl_config_gpio(int config) { if (config) { /* for wake state */ gpio_tlmm_config(GPIO_CFG(bl_i2c_pin[0].sda_pin, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA), GPIO_CFG_ENABLE); gpio_tlmm_config(GPIO_CFG(bl_i2c_pin[0].scl_pin, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA), GPIO_CFG_ENABLE); } else { /* for sleep state */ gpio_tlmm_config(GPIO_CFG(bl_i2c_pin[0].sda_pin, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA), GPIO_CFG_ENABLE); gpio_tlmm_config(GPIO_CFG(bl_i2c_pin[0].scl_pin, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA), GPIO_CFG_ENABLE); } } EXPORT_SYMBOL(bl_config_gpio); #if 1 // UNIVA_LCD_BL static struct lm3530_platform_data lm3530bl_data = { .gpio = 82, .version = 2862, .init_on_boot = 0, }; static struct i2c_board_info bl_i2c_bdinfo[] = { [0] = { I2C_BOARD_INFO("lm3530bl", 0x38), .type = "lm3530bl", .platform_data = NULL, }, }; #else static struct aat28xx_platform_data aat2870bl_data = { .gpio = 82, .version = 2862, .initialized = 1, }; static struct i2c_board_info bl_i2c_bdinfo[] = { [0] = { I2C_BOARD_INFO("aat2870bl", 0x60), .type = "aat2870bl", .platform_data = NULL, }, }; #endif struct device* univa_backlight_dev(void) { return &bl_i2c_device.dev; } void __init univa_init_i2c_backlight(int bus_num) { bl_i2c_device.id = bus_num; #if 1 // UNIVA_LCD_BL bl_i2c_bdinfo[0].platform_data = &lm3530bl_data; #else bl_i2c_bdinfo[0].platform_data = &aat2870bl_data; #endif init_gpio_i2c_pin(&bl_i2c_pdata, bl_i2c_pin[0], &bl_i2c_bdinfo[0]); i2c_register_board_info(bus_num, &bl_i2c_bdinfo[0], 1); platform_device_register(&bl_i2c_device); } static void univa_panel_set_maker_id(void) { if(lge_bd_rev == LGE_REV_B) mddi_ldp_panel_data.maker_id = PANEL_ID_LDP; else mddi_ldp_panel_data.maker_id = PANEL_ID_AUO; } #if defined(UNIVA_EVB) /* SUB PMIC device */ #include <../../../../drivers/video/backlight/lp8720.h> static struct gpio_i2c_pin ldo_i2c_pin[] = { [0] = { .sda_pin = 76, .scl_pin = 77, .reset_pin = 0, .irq_pin = 0, }, }; static struct i2c_gpio_platform_data ldo_i2c_pdata = { .sda_is_open_drain = 0, .scl_is_open_drain = 0, .udelay = 2, }; static struct platform_device ldo_i2c_device = { .name = "i2c-gpio", .dev.platform_data = &ldo_i2c_pdata, }; static struct lp8720_platform_data lp8720ldo_data = { .en_gpio_num = LP8720_ENABLE, }; static struct i2c_board_info ldo_i2c_bdinfo[] = { [0] = { I2C_BOARD_INFO(LP8720_I2C_NAME, LP8720_I2C_ADDR), .type = LP8720_I2C_NAME, .platform_data = NULL, }, }; struct device* univa_ldo_dev(void) { return &ldo_i2c_device.dev; } void __init univa_init_i2c_ldo(int bus_num) { ldo_i2c_device.id = bus_num; ldo_i2c_bdinfo[0].platform_data = &lp8720ldo_data; init_gpio_i2c_pin(&ldo_i2c_pdata, ldo_i2c_pin[0], &ldo_i2c_bdinfo[0]); i2c_register_board_info(bus_num, &ldo_i2c_bdinfo[0], 1); platform_device_register(&ldo_i2c_device); } #endif /* common functions */ void __init lge_add_lcd_devices(void) { univa_panel_set_maker_id(); platform_device_register(&mddi_ldp_panel_device); msm_fb_add_devices(); lge_add_gpio_i2c_device(univa_init_i2c_backlight); #if defined(UNIVA_EVB) lge_add_gpio_i2c_device(univa_init_i2c_ldo); #endif }
/* Copyright (c) 2010-2012, The Linux Foundation. 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. * */ #ifndef __KGSL_PWRCTRL_H #define __KGSL_PWRCTRL_H /***************************************************************************** ** power flags *****************************************************************************/ #define KGSL_PWRFLAGS_ON 1 #define KGSL_PWRFLAGS_OFF 0 #define KGSL_PWRLEVEL_TURBO 0 #define KGSL_PWRLEVEL_NOMINAL 1 #define KGSL_PWRLEVEL_LAST_OFFSET 2 #define KGSL_MAX_CLKS 5 struct platform_device; struct kgsl_clk_stats { unsigned int old_clock_time[KGSL_MAX_PWRLEVELS]; unsigned int clock_time[KGSL_MAX_PWRLEVELS]; unsigned int on_time_old; ktime_t start; ktime_t stop; unsigned int no_nap_cnt; unsigned int elapsed; unsigned int elapsed_old; }; /** * struct kgsl_pwrctrl - Power control settings for a KGSL device * @interrupt_num - The interrupt number for the device * @ebi1_clk - Pointer to the EBI clock structure * @grp_clks - Array of clocks structures that we control * @power_flags - Control flags for power * @pwrlevels - List of supported power levels * @active_pwrlevel - The currently active power level * @thermal_pwrlevel - maximum powerlevel constraint from thermal * @max_pwrlevel - maximum allowable powerlevel per the user * @min_pwrlevel - minimum allowable powerlevel per the user * @num_pwrlevels - number of available power levels * @interval_timeout - timeout in jiffies to be idle before a power event * @strtstp_sleepwake - true if the device supports low latency GPU start/stop * @gpu_reg - pointer to the regulator structure for gpu_reg * @gpu_cx - pointer to the regulator structure for gpu_cx * @pcl - bus scale identifier * @nap_allowed - true if the device supports naps * @idle_needed - true if the device needs a idle before clock change * @irq_name - resource name for the IRQ * @restore_slumber - Flag to indicate that we are in a suspend/restore sequence * @clk_stats - structure of clock statistics */ struct kgsl_pwrctrl { int interrupt_num; struct clk *ebi1_clk; struct clk *grp_clks[KGSL_MAX_CLKS]; unsigned long power_flags; struct kgsl_pwrlevel pwrlevels[KGSL_MAX_PWRLEVELS]; unsigned int active_pwrlevel; int thermal_pwrlevel; unsigned int default_pwrlevel; unsigned int max_pwrlevel; unsigned int min_pwrlevel; unsigned int num_pwrlevels; unsigned int interval_timeout; bool strtstp_sleepwake; struct regulator *gpu_reg; struct regulator *gpu_cx; uint32_t pcl; unsigned int nap_allowed; unsigned int idle_needed; const char *irq_name; s64 time; unsigned int restore_slumber; struct kgsl_clk_stats clk_stats; }; void kgsl_pwrctrl_irq(struct kgsl_device *device, int state); int kgsl_pwrctrl_init(struct kgsl_device *device); void kgsl_pwrctrl_close(struct kgsl_device *device); void kgsl_timer(unsigned long data); void kgsl_idle_check(struct work_struct *work); void kgsl_pre_hwaccess(struct kgsl_device *device); int kgsl_pwrctrl_sleep(struct kgsl_device *device); int kgsl_pwrctrl_wake(struct kgsl_device *device); void kgsl_pwrctrl_pwrlevel_change(struct kgsl_device *device, unsigned int level); int kgsl_pwrctrl_init_sysfs(struct kgsl_device *device); void kgsl_pwrctrl_uninit_sysfs(struct kgsl_device *device); void kgsl_pwrctrl_enable(struct kgsl_device *device); void kgsl_pwrctrl_disable(struct kgsl_device *device); static inline unsigned long kgsl_get_clkrate(struct clk *clk) { return (clk != NULL) ? clk_get_rate(clk) : 0; } void kgsl_pwrctrl_set_state(struct kgsl_device *device, unsigned int state); void kgsl_pwrctrl_request_state(struct kgsl_device *device, unsigned int state); int kgsl_active_count_get(struct kgsl_device *device); int kgsl_active_count_get_light(struct kgsl_device *device); void kgsl_active_count_put(struct kgsl_device *device); void kgsl_active_count_wait(struct kgsl_device *device); #ifdef CONFIG_MSM_KGSL_KERNEL_API_ENABLE int kgsl_pwrctrl_min_pwrlevel_store_kernel(int level); int kgsl_pwrctrl_num_pwrlevels_show_kernel(void); #endif #endif /* __KGSL_PWRCTRL_H */
// Copyright 2016 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include <optional> #include <string> #include "Common/CommonTypes.h" namespace DiscIO { // Increment CACHE_REVISION (GameFileCache.cpp) if these enums are modified enum class Platform { GameCubeDisc = 0, WiiDisc, WiiWAD, ELFOrDOL, NumberOfPlatforms }; enum class Country { Europe = 0, Japan, USA, Australia, France, Germany, Italy, Korea, Netherlands, Russia, Spain, Taiwan, World, Unknown, NumberOfCountries }; // This numbering matches Nintendo's GameCube/Wii region numbering. enum class Region { NTSC_J = 0, // Japan and Taiwan (and South Korea for GameCube only) NTSC_U = 1, // Mainly North America PAL = 2, // Mainly Europe and Oceania Unknown = 3, // Nintendo uses this to mean region free, but we also use it for unknown regions NTSC_K = 4 // South Korea (Wii only) }; // Languages 0 - 9 match Nintendo's Wii language numbering. // Languages 1 - 6 match Nintendo's PAL GameCube languages 0 - 5. // NTSC GameCubes only support one language and thus don't number languages. enum class Language { Japanese = 0, English = 1, German = 2, French = 3, Spanish = 4, Italian = 5, Dutch = 6, SimplifiedChinese = 7, // Not selectable on any unmodded retail Wii TraditionalChinese = 8, // Not selectable on any unmodded retail Wii Korean = 9, Unknown }; std::string GetName(Country country, bool translate); std::string GetName(Language language, bool translate); bool IsDisc(Platform volume_type); bool IsWii(Platform volume_type); bool IsNTSC(Region region); Country TypicalCountryForRegion(Region region); Region SysConfCountryToRegion(u8 country_code); // Avoid using this function if you can. Country codes aren't always reliable region indicators. Region CountryCodeToRegion(u8 country_code, Platform platform, Region expected_region = Region::Unknown, std::optional<u16> revision = {}); Country CountryCodeToCountry(u8 country_code, Platform platform, Region region = Region::Unknown, std::optional<u16> revision = {}); Region GetSysMenuRegion(u16 title_version); std::string GetSysMenuVersionString(u16 title_version); const std::string& GetCompanyFromID(const std::string& company_id); } // namespace DiscIO
/*************************************************************************** qgscolumntypethread.cpp - lookup postgres geometry type and srid in a thread ------------------- begin : 3.1.2012 copyright : (C) 2012 by Juergen E. Fischer email : jef at norbit dot de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSCOLUMNTYPETHREAD_H #define QGSCOLUMNTYPETHREAD_H #include <QThread> #include "qgspostgresconn.h" // A class that determines the geometry type of a given database // schema.table.column, with the option of doing so in a separate // thread. class QgsGeomColumnTypeThread : public QThread { Q_OBJECT public: QgsGeomColumnTypeThread( QString connName, bool useEstimatedMetaData, bool allowGeometrylessTables ); // These functions get the layer types and pass that information out // by emitting the setLayerType() signal. virtual void run() override; signals: void setLayerType( QgsPostgresLayerProperty layerProperty ); void progress( int, int ); void progressMessage( QString ); public slots: void stop(); private: QgsGeomColumnTypeThread() {} QgsPostgresConn *mConn; QString mName; bool mUseEstimatedMetadata; bool mAllowGeometrylessTables; bool mStopped; QList<QgsPostgresLayerProperty> layerProperties; }; #endif // QGSCOLUMNTYPETHREAD_H
/* Copyright (C) 2009-2010 Electronic Arts, 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. 3. Neither the name of Electronic Arts, Inc. ("EA") 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 ELECTRONIC ARTS 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 ELECTRONIC ARTS 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. */ ///////////////////////////////////////////////////////////////////////////// // EAFileStreamUnix.h // // Copyright (c) 2003, Electronic Arts Inc. All rights reserved. // Created by Paul Pedriana // ///////////////////////////////////////////////////////////////////////////// #ifndef EAIO_EAFILESTREAM_UNIX_H #define EAIO_EAFILESTREAM_UNIX_H #include <EAIO/EAFileStream.h> #include <EAIO/EAFileBase.h> #include <EAIO/PathString.h> #include <stddef.h> namespace EA { namespace IO { class EAIO_API FileStream : public IStream { public: enum { kTypeFileStream = 0x34722300 }; enum Share { kShareNone = 0x00, /// No sharing. kShareRead = 0x01, /// Allow sharing for reading. kShareWrite = 0x02, /// Allow sharing for writing. kShareDelete = 0x04 /// Allow sharing for deletion. }; enum UsageHints { kUsageHintNone = 0x00, kUsageHintSequential = 0x01, kUsageHintRandom = 0x02 }; public: FileStream(const char8_t* pPath8 = NULL); FileStream(const char16_t* pPath16); // FileStream // Does not copy information related to an open file, such as the file handle. FileStream(const FileStream& fs); virtual ~FileStream(); // operator= // Does not copy information related to an open file, such as the file handle. FileStream& operator=(const FileStream& fs); virtual int AddRef(); virtual int Release(); virtual void SetPath(const char8_t* pPath8); virtual void SetPath(const char16_t* pPath16); virtual size_t GetPath(char8_t* pPath8, size_t nPathCapacity); virtual size_t GetPath(char16_t* pPath16, size_t nPathCapacity); virtual bool Open(int nAccessFlags = kAccessFlagRead, int nCreationDisposition = kCDDefault, int nSharing = kShareRead, int nUsageHints = kUsageHintNone); virtual bool Close(); virtual uint32_t GetType() const { return kTypeFileStream; } virtual int GetAccessFlags() const; virtual int GetState() const; virtual size_type GetSize() const; virtual bool SetSize(size_type size); virtual off_type GetPosition(PositionType positionType = kPositionTypeBegin) const; virtual bool SetPosition(off_type position, PositionType positionType = kPositionTypeBegin); virtual size_type GetAvailable() const; virtual size_type Read(void* pData, size_type nSize); virtual bool Write(const void* pData, size_type nSize); virtual bool Flush(); protected: typedef EA::IO::Path::PathString8 PathString8; int mnFileHandle; PathString8 mPath8; /// Path for the file. int mnRefCount; /// Reference count, which may or may not be in use. int mnAccessFlags; /// See enum AccessFlags. int mnCD; /// See enum CD (creation disposition). int mnSharing; /// See enum Share. int mnUsageHints; /// See enum UsageHints. mutable int mnLastError; /// Used for error reporting. }; // class FileStream } // namespace IO } // namespace EA #endif // #ifndef EAIO_EAFILESTREAM_UNIX_H
/* Copyright 2010 SINTEF ICT, Applied Mathematics. This file is part of the Open Porous Media project (OPM). OPM 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. OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>. */ #ifndef OPM_IFS_TPFA_HEADER_INCLUDED #define OPM_IFS_TPFA_HEADER_INCLUDED /** * \file * Interfaces and data structures to assemble a system of simultaneous linear * equations discretising a flow problem that is either incompressible or * features rock compressibility using the two-point flux approximation method. * * Includes support for reconstructing the Darcy flux field as well as well * connection fluxes. */ #include <opm/core/grid.h> #ifdef __cplusplus extern "C" { #endif struct ifs_tpfa_impl; struct CSRMatrix; struct FlowBoundaryConditions; struct Wells; /** * Main data structure presenting a view of an assembled system of simultaneous * linear equations which may be solved using external software. */ struct ifs_tpfa_data { struct CSRMatrix *A; /**< Coefficient matrix */ double *b; /**< Right-hand side */ double *x; /**< Solution */ struct ifs_tpfa_impl *pimpl; /**< Internal management structure */ }; /** * Solution variables. */ struct ifs_tpfa_solution { double *cell_press; /**< Cell pressures */ double *face_flux ; /**< Interface fluxes */ double *well_press; /**< Bottom-hole pressures for each well */ double *well_flux ; /**< Well connection total fluxes */ }; /** * Driving forces pertaining to a particular model setup. */ struct ifs_tpfa_forces { const double *src; /**< Explicit source terms */ const struct FlowBoundaryConditions *bc ; /**< Boundary conditions */ const struct Wells *W ; /**< Well topology */ const double *totmob; /**< Total mobility in each cell */ const double *wdp ; /**< Gravity adjustment at each perforation */ }; /** * Allocate TPFA management structure capable of assembling a system of * simultaneous linear equations corresponding to a particular grid and well * configuration. * * @param[in] G Grid. * @param[in] W Well topology. * @return Fully formed TPFA management structure if successful, @c NULL in case * of allocation failure. */ struct ifs_tpfa_data * ifs_tpfa_construct(struct UnstructuredGrid *G, struct Wells *W); /** * * @param[in] G * @param[in] F * @param[in] trans * @param[in] gpress * @param[in,out] h * @return */ int ifs_tpfa_assemble(struct UnstructuredGrid *G , const struct ifs_tpfa_forces *F , const double *trans , const double *gpress, struct ifs_tpfa_data *h ); int ifs_tpfa_assemble_comprock(struct UnstructuredGrid *G , const struct ifs_tpfa_forces *F , const double *trans , const double *gpress , const double *porevol , const double *rock_comp, const double dt , const double *pressure , struct ifs_tpfa_data *h ); int ifs_tpfa_assemble_comprock_increment(struct UnstructuredGrid *G , const struct ifs_tpfa_forces *F , const double *trans , const double *gpress , const double *porevol , const double *rock_comp, const double dt , const double *prev_pressure , const double *initial_porevolume, struct ifs_tpfa_data *h ); void ifs_tpfa_press_flux(struct UnstructuredGrid *G , const struct ifs_tpfa_forces *F , const double *trans, struct ifs_tpfa_data *h , struct ifs_tpfa_solution *soln ); void ifs_tpfa_destroy(struct ifs_tpfa_data *h); #ifdef __cplusplus } #endif #endif /* OPM_IFS_TPFA_HEADER_INCLUDED */
/*========================================================================= Program: GDCM (Grassroots DICOM). A DICOM library Module: $URL$ Copyright (c) 2006-2010 Mathieu Malaterre All rights reserved. See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html 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. =========================================================================*/ #ifndef GDCMSOPCLASSUIDTOIOD_H #define GDCMSOPCLASSUIDTOIOD_H #include "gdcmUIDs.h" namespace gdcm { /** * \brief Class convert a class SOP Class UID into IOD * * Reference PS 3.4 Table B.5-1 STANDARD SOP CLASSES */ class GDCM_EXPORT SOPClassUIDToIOD { public: /// Return the associated IOD based on a SOP Class UID uid /// (there is a one-to-one mapping from SOP Class UID to matching IOD) static const char *GetIOD(UIDs const & uid); /// Return the number of SOP Class UID listed internally static unsigned int GetNumberOfSOPClassToIOD(); typedef const char* const (SOPClassUIDToIODType)[2]; static SOPClassUIDToIODType* GetSOPClassUIDToIODs(); static SOPClassUIDToIODType& GetSOPClassUIDToIOD(unsigned int i); static const char *GetSOPClassUIDFromIOD(const char *iod); static const char *GetIODFromSOPClassUID(const char *sopclassuid); }; } // end namespace gdcm #endif //GDCMSOPCLASSUIDTOIOD_H
/****************************************************************************** * * Copyright 2010 Duane Merrill * * 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. * * * * * AUTHORS' REQUEST: * * If you use|reference|benchmark this code, please cite our Technical * Report (http://www.cs.virginia.edu/~dgm4d/papers/RadixSortTR.pdf): * * @TechReport{ Merrill:Sorting:2010, * author = "Duane Merrill and Andrew Grimshaw", * title = "Revisiting Sorting for GPGPU Stream Architectures", * year = "2010", * institution = "University of Virginia, Department of Computer Science", * address = "Charlottesville, VA, USA", * number = "CS2010-03" * } * * For more information, see our Google Code project site: * http://code.google.com/p/back40computing/ * * Thanks! * ******************************************************************************/ /****************************************************************************** * Top-level histogram/spine scanning kernel ******************************************************************************/ #pragma once #include "radixsort_kernel_common.h" namespace thrust { namespace system { namespace cuda { namespace detail { namespace detail { namespace b40c_thrust { /****************************************************************************** * Scans a cycle of RADIXSORT_CYCLE_ELEMENTS elements ******************************************************************************/ template<int PARTIALS_PER_SEG> __device__ __forceinline__ void SrtsScanCycle( int *smem_offset, int *smem_segment, int warpscan[2][B40C_WARP_THREADS], int4 *in, int4 *out, int &carry) { int4 datum; // read input data datum = in[threadIdx.x]; smem_offset[0] = datum.x + datum.y + datum.z + datum.w; __syncthreads(); if (threadIdx.x < B40C_WARP_THREADS) { int partial_reduction = SerialReduce<PARTIALS_PER_SEG>(smem_segment); int seed = WarpScan<B40C_WARP_THREADS, false>(warpscan, partial_reduction, 0); seed += carry; SerialScan<PARTIALS_PER_SEG>(smem_segment, seed); carry += warpscan[1][B40C_WARP_THREADS - 1]; } __syncthreads(); int part0 = smem_offset[0]; int part1; part1 = datum.x + part0; datum.x = part0; part0 = part1 + datum.y; datum.y = part1; part1 = datum.z + part0; datum.z = part0; part0 = part1 + datum.w; datum.w = part1; out[threadIdx.x] = datum; } /****************************************************************************** * Spine/histogram Scan Kernel Entry Point ******************************************************************************/ template <typename T> __global__ void SrtsScanSpine( int *d_ispine, int *d_ospine, int normal_block_elements) { const int LOG_PARTIALS = B40C_RADIXSORT_LOG_THREADS; const int PARTIALS = 1 << LOG_PARTIALS; const int LOG_PARTIALS_PER_SEG = LOG_PARTIALS - B40C_LOG_WARP_THREADS; const int PARTIALS_PER_SEG = 1 << LOG_PARTIALS_PER_SEG; const int LOG_PARTIALS_PER_ROW = (LOG_PARTIALS_PER_SEG < B40C_LOG_MEM_BANKS(__CUDA_ARCH__)) ? B40C_LOG_MEM_BANKS(__CUDA_ARCH__) : LOG_PARTIALS_PER_SEG; // floor of 32 elts per row const int PARTIALS_PER_ROW = 1 << LOG_PARTIALS_PER_ROW; const int LOG_SEGS_PER_ROW = LOG_PARTIALS_PER_ROW - LOG_PARTIALS_PER_SEG; const int SEGS_PER_ROW = 1 << LOG_SEGS_PER_ROW; const int SMEM_ROWS = PARTIALS / PARTIALS_PER_ROW; __shared__ int smem[SMEM_ROWS][PARTIALS_PER_ROW + 1]; __shared__ int warpscan[2][B40C_WARP_THREADS]; // WAR spurious unused constant warning SuppressUnusedConstantWarning(PARTIALS_PER_SEG); int *smem_segment = 0; int carry = 0; int row = threadIdx.x >> LOG_PARTIALS_PER_ROW; int col = threadIdx.x & (PARTIALS_PER_ROW - 1); int *smem_offset = &smem[row][col]; if (blockIdx.x > 0) { return; } if (threadIdx.x < B40C_WARP_THREADS) { // two segs per row, odd segs are offset by 8 row = threadIdx.x >> LOG_SEGS_PER_ROW; col = (threadIdx.x & (SEGS_PER_ROW - 1)) << LOG_PARTIALS_PER_SEG; smem_segment = &smem[row][col]; if (threadIdx.x < B40C_WARP_THREADS) { carry = 0; warpscan[0][threadIdx.x] = 0; } } // scan the spine in blocks of cycle_elements int block_offset = 0; while (block_offset < normal_block_elements) { SrtsScanCycle<PARTIALS_PER_SEG>( smem_offset, smem_segment, warpscan, reinterpret_cast<int4 *>((void *) &d_ispine[block_offset]), reinterpret_cast<int4 *>((void *) &d_ospine[block_offset]), carry); block_offset += B40C_RADIXSORT_SPINE_CYCLE_ELEMENTS; } } } // end namespace b40c_thrust } // end namespace detail } // end namespace detail } // end namespace cuda } // end namespace system } // end namespace thrust
/**************************************************************************** ** ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtNetwork module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QNETWORKACCESSCACHEBACKEND_P_H #define QNETWORKACCESSCACHEBACKEND_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of the Network Access API. This header file may change from // version to version without notice, or even be removed. // // We mean it. // #include "qnetworkaccessbackend_p.h" #include "qnetworkrequest.h" #include "qnetworkreply.h" QT_BEGIN_NAMESPACE class QNetworkAccessCacheBackend : public QNetworkAccessBackend { public: QNetworkAccessCacheBackend(); ~QNetworkAccessCacheBackend(); void open(); void closeDownstreamChannel(); void closeUpstreamChannel(); void upstreamReadyRead(); void downstreamReadyWrite(); private: bool sendCacheContents(); QIODevice *device; }; QT_END_NAMESPACE #endif // QNETWORKACCESSCACHEBACKEND_P_H
// RUN: %clang %s -o %t && %run %t 2>&1 #include <assert.h> #include <stdlib.h> #include <wchar.h> int main(int argc, char **argv) { wchar_t *buff = wcsdup(L"foo"); assert(buff[0] == L'f'); assert(buff[1] == L'o'); assert(buff[2] == L'o'); assert(buff[3] == L'\0'); free(buff); return 0; }
#ifndef _SOCK_ADDR_EQ_H_INCLUDED_ #define _SOCK_ADDR_EQ_H_INCLUDED_ /*++ /* NAME /* sock_addr 3h /* SUMMARY /* socket address utilities /* SYNOPSIS /* #include <sock_addr.h> /* DESCRIPTION /* .nf /* * System library. */ #include <sys/socket.h> #include <netinet/in.h> #include <string.h> /* * External interface. */ #define SOCK_ADDR_PTR(ptr) ((struct sockaddr *)(ptr)) #define SOCK_ADDR_FAMILY(ptr) SOCK_ADDR_PTR(ptr)->sa_family #ifdef HAS_SA_LEN #define SOCK_ADDR_LEN(ptr) SOCK_ADDR_PTR(ptr)->sa_len #endif #define SOCK_ADDR_IN_PTR(sa) ((struct sockaddr_in *)(sa)) #define SOCK_ADDR_IN_FAMILY(sa) SOCK_ADDR_IN_PTR(sa)->sin_family #define SOCK_ADDR_IN_PORT(sa) SOCK_ADDR_IN_PTR(sa)->sin_port #define SOCK_ADDR_IN_ADDR(sa) SOCK_ADDR_IN_PTR(sa)->sin_addr #define IN_ADDR(ia) (*((struct in_addr *) (ia))) extern int sock_addr_cmp_addr(const struct sockaddr *, const struct sockaddr *); extern int sock_addr_cmp_port(const struct sockaddr *, const struct sockaddr *); extern int sock_addr_in_loopback(const struct sockaddr *); #ifdef HAS_IPV6 #ifndef HAS_SA_LEN #define SOCK_ADDR_LEN(sa) \ (SOCK_ADDR_PTR(sa)->sa_family == AF_INET6 ? \ sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in)) #endif #define SOCK_ADDR_PORT(sa) \ (SOCK_ADDR_PTR(sa)->sa_family == AF_INET6 ? \ SOCK_ADDR_IN6_PORT(sa) : SOCK_ADDR_IN_PORT(sa)) #define SOCK_ADDR_PORTP(sa) \ (SOCK_ADDR_PTR(sa)->sa_family == AF_INET6 ? \ &SOCK_ADDR_IN6_PORT(sa) : &SOCK_ADDR_IN_PORT(sa)) #define SOCK_ADDR_IN6_PTR(sa) ((struct sockaddr_in6 *)(sa)) #define SOCK_ADDR_IN6_FAMILY(sa) SOCK_ADDR_IN6_PTR(sa)->sin6_family #define SOCK_ADDR_IN6_PORT(sa) SOCK_ADDR_IN6_PTR(sa)->sin6_port #define SOCK_ADDR_IN6_ADDR(sa) SOCK_ADDR_IN6_PTR(sa)->sin6_addr #define IN6_ADDR(ia) (*((struct in6_addr *) (ia))) #define SOCK_ADDR_EQ_ADDR(sa, sb) \ ((SOCK_ADDR_FAMILY(sa) == AF_INET && SOCK_ADDR_FAMILY(sb) == AF_INET \ && SOCK_ADDR_IN_ADDR(sa).s_addr == SOCK_ADDR_IN_ADDR(sb).s_addr) \ || (SOCK_ADDR_FAMILY(sa) == AF_INET6 && SOCK_ADDR_FAMILY(sb) == AF_INET6 \ && memcmp((char *) &(SOCK_ADDR_IN6_ADDR(sa)), \ (char *) &(SOCK_ADDR_IN6_ADDR(sb)), \ sizeof(SOCK_ADDR_IN6_ADDR(sa))) == 0)) #define SOCK_ADDR_EQ_PORT(sa, sb) \ ((SOCK_ADDR_FAMILY(sa) == AF_INET && SOCK_ADDR_FAMILY(sb) == AF_INET \ && SOCK_ADDR_IN_PORT(sa) == SOCK_ADDR_IN_PORT(sb)) \ || (SOCK_ADDR_FAMILY(sa) == AF_INET6 && SOCK_ADDR_FAMILY(sb) == AF_INET6 \ && SOCK_ADDR_IN6_PORT(sa) == SOCK_ADDR_IN6_PORT(sb))) #else #ifndef HAS_SA_LEN #define SOCK_ADDR_LEN(sa) sizeof(struct sockaddr_in) #endif #define SOCK_ADDR_PORT(sa) SOCK_ADDR_IN_PORT(sa)) #define SOCK_ADDR_PORTP(sa) &SOCK_ADDR_IN_PORT(sa)) #define SOCK_ADDR_EQ_ADDR(sa, sb) \ (SOCK_ADDR_FAMILY(sa) == AF_INET && SOCK_ADDR_FAMILY(sb) == AF_INET \ && SOCK_ADDR_IN_ADDR(sa).s_addr == SOCK_ADDR_IN_ADDR(sb).s_addr) #define SOCK_ADDR_EQ_PORT(sa, sb) \ (SOCK_ADDR_FAMILY(sa) == AF_INET && SOCK_ADDR_FAMILY(sb) == AF_INET \ && SOCK_ADDR_IN_PORT(sa) == SOCK_ADDR_IN_PORT(sb)) #endif /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA /*--*/ #endif
/* -*- c-basic-offset: 4 -*- */ #ifndef CLICKNET_ICMP6_H #define CLICKNET_ICMP6_H #include <clicknet/ip6.h> /* * <clicknet/icmp6.h> -- our own definitions for ICMP6 packets * Based on RFC 1885 */ /* types for ICMP6 packets */ #define ICMP6_UNREACH 1 #define ICMP6_PKTTOOBIG 2 #define ICMP6_TIMXCEED 3 #define ICMP6_PARAMPROB 4 #define ICMP6_ECHO 128 #define ICMP6_ECHOREPLY 129 #define ICMP6_MEMBERSHIPQUERY 130 #define ICMP6_MEMBERSHIPREPORT 131 #define ICMP6_MEMBERSHIPREDUCTION 132 #define ICMP6_REDIRECT 137 /* codes for spefic types of ICMP6 packets */ /* ICMP6 Error Message - Type: 1 */ #define ICMP6_UNREACH_NOROUTE 0 #define ICMP6_UNREACH_ADMIN 1 #define ICMP6_UNREACH_NOTNEIGHBOR 2 #define ICMP6_UNREACH_ADDR 3 #define ICMP6_UNREACH_NOPORT 4 /* ICMP6 Time Exceeded Message - Type: 3 */ #define ICMP6_TIMXCEED_TRANSIT 0 #define ICMP6_TIMXCEED_REASSEMBLY 1 /* ICMP6 Parameter Problem Message - Type: 4 */ #define ICMP6_PARAMPROB_HEADER 0 #define ICMP6_PARAMPROB_NEXTHEADER 1 #define ICMP6_PARAMPROB_OPTION 2 /* remove possible definitions for symbols */ #undef icmp6_identifier #undef icmp6_sequence #undef icmp6_pointer #undef icmp6_maxdelay /* most ICMP6 request types */ struct click_icmp6 { uint8_t icmp6_type; /* one of the ICMP6_TYPE_*'s above */ uint8_t icmp6_code; /* one of the ICMP6_CODE_*'s above */ uint16_t icmp6_cksum; /* 16 1's comp csum */ uint32_t padding; /* should be zero */ /* followed by as much of invoking packet as will fit without the ICMPv6 packet exceeding 576 octets*/ }; /* packet too big header */ struct click_icmp6_pkttoobig { uint8_t icmp6_type; /* one of the ICMP6_TYPE_*'s above */ uint8_t icmp6_code; /* one of the ICMP6_CODE_*'s above */ uint16_t icmp6_cksum; /* 16 1's comp csum */ uint32_t icmp6_mtusize; /* maximum packet size */ /* followed by as much of invoking packet as will fit without the ICMPv6 packet exceeding 576 octets*/ }; /* parameter problem header */ struct click_icmp6_paramprob { uint8_t icmp6_type; /* one of the ICMP_TYPE_*'s above */ uint8_t icmp6_code; /* one of the ICMP6_CODE_*'s above */ uint16_t icmp6_cksum; /* 16 1's comp csum */ uint32_t icmp6_pointer; /* which octect in orig. IP6 pkt was a problem */ /* followed by as much of invoking packet as will fit without the ICMPv6 packet exceeding 576 octets*/ }; /* struct for things with sequence numbers - echo request & echo reply msgs*/ struct click_icmp6_sequenced { uint8_t icmp6_type; /* one of the ICMP6_TYPE_*'s above */ uint8_t icmp6_code; /* one of the ICMP6_CODE_*'s above */ uint16_t icmp6_cksum; /* 16 1's comp csum */ uint16_t icmp6_identifier; uint16_t icmp6_sequence; /* Followed by: */ /* Echo Request: zero or more octets of arbitary data */ /* Echo Reply: the data fromm the invoking Echo Request msg */ }; /* struct for group membership messages */ struct click_icmp6_membership { uint8_t icmp6_type; /* one of the ICMP6_TYPE_*'s above */ uint8_t icmp6_code; /* one of the ICMP6_CODE_*'s above */ uint16_t icmp6_cksum; /* 16 1's comp csum */ uint16_t icmp6_maxdelay; /* maximum response delay, in milliseconds */ uint16_t padding; /* followed by multicast address */ }; /* struct for redirect messages */ struct click_icmp6_redirect { uint8_t icmp6_type; uint8_t icmp6_code; uint16_t icmp6_cksum; uint32_t padding; struct in6_addr icmp6_target; struct in6_addr icmp6_dst; }; /* different struct names for each type of packet */ #define click_icmp6_unreach click_icmp6 #define click_icmp6_timxceed click_icmp6 #define click_icmp6_echo click_icmp6_sequenced #endif
/**************************************************************************** * * Copyright (c) 2007-2008 Broadcom Corporation * * Unless you and Broadcom execute a separate written software license * agreement governing use of this software, this software is licensed to you * under the terms of the GNU General Public License version 2, available * at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL"). * * Notwithstanding the above, under no circumstances may you combine this * software in any way with any other Broadcom software provided under a license * other than the GPL, without Broadcom's express prior written consent. * ****************************************************************************/ /** * * @file rpc_client_msgs.c * * @brief This file builds lookup table for client registered messages. * ****************************************************************************/ #include <linux/sched.h> #include <linux/kernel.h> /* printk() */ #include <linux/fs.h> /* everything... */ #include <linux/errno.h> /* error codes */ #include <linux/delay.h> /* udelay */ #include <linux/slab.h> #include <linux/ioport.h> #include <linux/interrupt.h> #include <linux/workqueue.h> #include <linux/timer.h> #include <linux/poll.h> #include <linux/unistd.h> #include <linux/init.h> #include <linux/cdev.h> #include <linux/device.h> #include <linux/fs.h> #include <linux/fcntl.h> #include <asm/system.h> #include <linux/kthread.h> #include "mobcom_types.h" #include "rpc_global.h" #include "resultcode.h" #include "taskmsgs.h" #include "rpc_client_msgs.h" static UInt32 **tableBase = NULL; #undef _DBG_ #define _DBG_(a) static Boolean rpc_build_lookup_msgs(UInt16 *tbl, UInt16 table_size, UInt32 mask) { Boolean bRetVal = TRUE; if (tableBase == NULL) { tableBase = (UInt32 **) capi2_malloc(256 * sizeof(UInt32)); if (tableBase) { int i; for (i = 0; i < 256; i++) tableBase[i] = 0; } } if (tableBase) { int i; for (i = 0; i < (int)(table_size); i++) { unsigned short id = (unsigned short)tbl[i]; unsigned short id1 = ((unsigned short)((id & (unsigned short)0xff00) >> 8)); unsigned short id2 = id & ((unsigned short)0x00ff); UInt32 *tableBase2 = NULL; if (tableBase[id1] == 0) { int j; tableBase[id1] = (UInt32 *) capi2_malloc(256 * sizeof(UInt32)); tableBase2 = tableBase[id1]; if (tableBase2) { for (j = 0; j < 256; j++) tableBase2[j] = 0xFFFF; } } tableBase2 = tableBase[id1]; if (tableBase2 == 0) { bRetVal = FALSE; } else { if (tableBase2[id2] == 0xFFFF) tableBase2[id2] = 0; tableBase2[id2] |= mask; /*_DBG_(RPC_TRACE("rpc_build_lookup = 0x%x, 0x%x, 0x%x\r\n", id, id1, id2));*/ } } } else { bRetVal = FALSE; } return bRetVal; } Boolean rpc_reset_client_msgs(UInt8 clientId) { int i, k; UInt32 mask = 1; if (!tableBase) return FALSE; if (clientId >= 60 && clientId < 92) { mask = mask << (clientId - 60); _DBG_(RPC_TRACE ("rpc_register_client_msgs cid=%d mask=%x \r\n", clientId, mask)); for (i = 0; i < 256; i++) { if (tableBase[i] != 0) { UInt32 *tableBase2 = tableBase[i]; for (k = 0; k < 256; k++) { if (tableBase2[k] != 0xFFFF && tableBase2[k] & mask) tableBase2[k] &= ~mask; } } } } else return FALSE; return TRUE; } Boolean rpc_register_client_msgs(UInt8 clientId, UInt16 *tbl, UInt16 table_size) { UInt32 mask = 1; if (clientId >= 60 && clientId < 92) { mask = mask << (clientId - 60); _DBG_(RPC_TRACE ("rpc_register_client_msgs cid=%d sz=%d mask=%x \r\n", clientId, table_size, mask)); /* printk("rpc_register_client_msgs cid=%d sz=%d mask=%x \r\n", */ /* (int)clientId, (int)table_size, (int)mask); */ return rpc_build_lookup_msgs(tbl, table_size, mask); } return FALSE; } int rpc_is_registered_msg(UInt16 dscm, UInt8 clientId) { UInt32 nodeVal = 0; unsigned short id = (unsigned short)dscm; unsigned short id1 = ((unsigned short)((id & (unsigned short)(((unsigned short)0xff00))) >> 8)); unsigned short id2 = id & ((unsigned short)0x00ff); UInt32 *tableBase2 = NULL; /* Make sure the table is built up */ if (!tableBase) return -1; tableBase2 = tableBase[id1]; if (tableBase2 == NULL) { /* message not handled in RPC */ _DBG_(RPC_TRACE ("rpc_is_registered_msg no RPC entry (tableBase2 is NULL) = 0x%x, 0x%x, 0x%x\r\n", id, id1, id2)); return -1; } else if (tableBase2[id2] != 0xFFFF) { nodeVal = tableBase2[id2]; } else { /* message not handled in RPC */ _DBG_(RPC_TRACE ("rpc_is_registered_msg no RPC entry = 0x%x, 0x%x, 0x%x\r\n", id, id1, id2)); return -1; } if (clientId >= 60 && clientId < 92) { UInt32 mask = 1; mask = mask << (clientId - 60); _DBG_(RPC_TRACE ("rpc_is_registered_msg cid=%d msgId=%x mask=%x val=%x ret=%d\r\n", clientId, dscm, mask, nodeVal, (nodeVal & mask) ? 1 : 0)); return (nodeVal & mask) ? 1 : 0; } return 0; }
/* * Copyright 2006 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio 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 Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_PAGERI_BCH3221_H #define INCLUDED_PAGERI_BCH3221_H #include <gr_types.h> // Perform BCH (32,21) error correction on supplied data // Return number of errors found/corrected (0, 1, or 2) int pageri_bch3221(gr_int32 &data); #endif /* INCLUDED_PAGERI_BCH3221_H */
/* * AU muxer and demuxer * Copyright (c) 2001 Fabrice Bellard * * This file is part of FFmpeg. * * FFmpeg 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. * * FFmpeg 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 FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * First version by Francois Revol revol@free.fr * * Reference documents: * http://www.opengroup.org/public/pubs/external/auformat.html * http://www.goice.co.jp/member/mo/formats/au.html */ #include "avformat.h" #include "raw.h" #include "riff.h" /* if we don't know the size in advance */ #define AU_UNKNOWN_SIZE ((uint32_t)(~0)) /* The ffmpeg codecs we support, and the IDs they have in the file */ static const AVCodecTag codec_au_tags[] = { { CODEC_ID_PCM_MULAW, 1 }, { CODEC_ID_PCM_S8, 2 }, { CODEC_ID_PCM_S16BE, 3 }, { CODEC_ID_PCM_S24BE, 4 }, { CODEC_ID_PCM_S32BE, 5 }, { CODEC_ID_PCM_F32BE, 6 }, { CODEC_ID_PCM_F64BE, 7 }, { CODEC_ID_PCM_ALAW, 27 }, { CODEC_ID_NONE, 0 }, }; #if CONFIG_AU_MUXER /* AUDIO_FILE header */ static int put_au_header(ByteIOContext *pb, AVCodecContext *enc) { if(!enc->codec_tag) return -1; put_tag(pb, ".snd"); /* magic number */ put_be32(pb, 24); /* header size */ put_be32(pb, AU_UNKNOWN_SIZE); /* data size */ put_be32(pb, (uint32_t)enc->codec_tag); /* codec ID */ put_be32(pb, enc->sample_rate); put_be32(pb, (uint32_t)enc->channels); return 0; } static int au_write_header(AVFormatContext *s) { ByteIOContext *pb = s->pb; s->priv_data = NULL; /* format header */ if (put_au_header(pb, s->streams[0]->codec) < 0) { return -1; } put_flush_packet(pb); return 0; } static int au_write_packet(AVFormatContext *s, AVPacket *pkt) { ByteIOContext *pb = s->pb; put_buffer(pb, pkt->data, pkt->size); return 0; } static int au_write_trailer(AVFormatContext *s) { ByteIOContext *pb = s->pb; int64_t file_size; if (!url_is_streamed(s->pb)) { /* update file size */ file_size = url_ftell(pb); url_fseek(pb, 8, SEEK_SET); put_be32(pb, (uint32_t)(file_size - 24)); url_fseek(pb, file_size, SEEK_SET); put_flush_packet(pb); } return 0; } #endif /* CONFIG_AU_MUXER */ static int au_probe(AVProbeData *p) { /* check file header */ if (p->buf[0] == '.' && p->buf[1] == 's' && p->buf[2] == 'n' && p->buf[3] == 'd') return AVPROBE_SCORE_MAX; else return 0; } /* au input */ static int au_read_header(AVFormatContext *s, AVFormatParameters *ap) { int size; unsigned int tag; ByteIOContext *pb = s->pb; unsigned int id, channels, rate; enum CodecID codec; AVStream *st; /* check ".snd" header */ tag = get_le32(pb); if (tag != MKTAG('.', 's', 'n', 'd')) return -1; size = get_be32(pb); /* header size */ get_be32(pb); /* data size */ id = get_be32(pb); rate = get_be32(pb); channels = get_be32(pb); codec = ff_codec_get_id(codec_au_tags, id); if (!av_get_bits_per_sample(codec)) { av_log_ask_for_sample(s, "could not determine bits per sample\n"); return AVERROR_INVALIDDATA; } if (size >= 24) { /* skip unused data */ url_fseek(pb, size - 24, SEEK_CUR); } /* now we are ready: build format streams */ st = av_new_stream(s, 0); if (!st) return -1; st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_tag = id; st->codec->codec_id = codec; st->codec->channels = channels; st->codec->sample_rate = rate; av_set_pts_info(st, 64, 1, rate); return 0; } #define BLOCK_SIZE 1024 static int au_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret; ret= av_get_packet(s->pb, pkt, BLOCK_SIZE * s->streams[0]->codec->channels * av_get_bits_per_sample(s->streams[0]->codec->codec_id) >> 3); if (ret < 0) return ret; pkt->stream_index = 0; /* note: we need to modify the packet size here to handle the last packet */ pkt->size = ret; return 0; } #if CONFIG_AU_DEMUXER AVInputFormat au_demuxer = { "au", NULL_IF_CONFIG_SMALL("SUN AU format"), 0, au_probe, au_read_header, au_read_packet, NULL, pcm_read_seek, .codec_tag= (const AVCodecTag* const []){codec_au_tags, 0}, }; #endif #if CONFIG_AU_MUXER AVOutputFormat au_muxer = { "au", NULL_IF_CONFIG_SMALL("SUN AU format"), "audio/basic", "au", 0, CODEC_ID_PCM_S16BE, CODEC_ID_NONE, au_write_header, au_write_packet, au_write_trailer, .codec_tag= (const AVCodecTag* const []){codec_au_tags, 0}, }; #endif //CONFIG_AU_MUXER
/* Copyright Rene Rivera 2008-2014 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef MSGPACK_PREDEF_COMPILER_GCC_XML_H #define MSGPACK_PREDEF_COMPILER_GCC_XML_H #include <msgpack/predef/version_number.h> #include <msgpack/predef/make.h> /*` [heading `MSGPACK_COMP_GCCXML`] [@http://www.gccxml.org/ GCC XML] compiler. [table [[__predef_symbol__] [__predef_version__]] [[`__GCCXML__`] [__predef_detection__]] ] */ #define MSGPACK_COMP_GCCXML MSGPACK_VERSION_NUMBER_NOT_AVAILABLE #if defined(__GCCXML__) # define MSGPACK_COMP_GCCXML_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE #endif #ifdef MSGPACK_COMP_GCCXML_DETECTION # if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED) # define MSGPACK_COMP_GCCXML_EMULATED MSGPACK_COMP_GCCXML_DETECTION # else # undef MSGPACK_COMP_GCCXML # define MSGPACK_COMP_GCCXML MSGPACK_COMP_GCCXML_DETECTION # endif # define MSGPACK_COMP_GCCXML_AVAILABLE # include <msgpack/predef/detail/comp_detected.h> #endif #define MSGPACK_COMP_GCCXML_NAME "GCC XML" #include <msgpack/predef/detail/test.h> MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_GCCXML,MSGPACK_COMP_GCCXML_NAME) #ifdef MSGPACK_COMP_GCCXML_EMULATED #include <msgpack/predef/detail/test.h> MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_GCCXML_EMULATED,MSGPACK_COMP_GCCXML_NAME) #endif #endif
// -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- /*************************************************************************** file : cardata.h created : Thu Sep 23 12:31:33 CET 2004 copyright : (C) 2004 Bernhard Wymann email : berniw@bluewin.ch version : $Id: cardata.h,v 1.9 2005/08/05 08:54:08 berniw Exp $ ***************************************************************************/ /*************************************************************************** * * * 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 class holds global facts about cars, therefore no data relative to each other (for that is the class Opponents/Opponent responsible). */ #ifndef _OLETHROS_CARDATA_H_ #define _OLETHROS_CARDATA_H_ #include <stdio.h> #include <math.h> #include <car.h> #include <robottools.h> #include <raceman.h> #include "linalg.h" #ifdef USE_OLETHROS_NAMESPACE namespace olethros { #endif class SingleCardata { public: SingleCardata() { speed = 0.0; width = 1.0; trackangle = 0.0; angle = 0.0; car = NULL; } inline void init(CarElt *car) { this->car = car; } inline float getSpeedInTrackDirection() { return speed; } inline float getWidthOnTrack() { return width; } inline float getTrackangle() { return trackangle; } inline float getCarAngle() { return angle; } inline bool thisCar(tCarElt *car) { return (car == this->car); } void update(); protected: static float getSpeed(tCarElt *car, float trackangle); float speed; // speed in direction of the track. float width; // the cars needed width on the track. float trackangle; // Track angle at the opponents position. float angle; // The angle of the car relative to the track tangent. tCarElt *car; // For identification. }; class Cardata { public: Cardata(tSituation* s); ~Cardata(); void update(); SingleCardata *findCar(tCarElt *car); protected: SingleCardata *data; // Array with car data. int ncars; // # of elements in data. }; #ifdef USE_OLETHROS_NAMESPACE } #endif #endif // _OLETHROS_CARDATA_H_
/* Stub for getpid. */ #include <_ansi.h> /* This should really return pid_t, but that doesn't seem to be in <sys/types.h>. */ int _getpid (void) { return 1; }
/* Copyright (c) 2012-2013, The Linux Foundation. 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. * */ #ifndef _MSM_VIDC_INTERNAL_H_ #define _MSM_VIDC_INTERNAL_H_ #include <linux/list.h> #include <linux/types.h> #include <linux/completion.h> #include <linux/wait.h> #include <mach/msm_bus.h> #include <mach/msm_bus_board.h> #include <mach/ocmem.h> #include <media/v4l2-dev.h> #include <media/v4l2-device.h> #include <media/v4l2-ioctl.h> #include <media/v4l2-event.h> #include <media/v4l2-ctrls.h> #include <media/videobuf2-core.h> #include <media/msm_vidc.h> #include <media/msm_media_info.h> #include "vidc_hfi_api.h" #include "vidc_hfi_api.h" #define MSM_VIDC_DRV_NAME "msm_vidc_driver" #define MSM_VIDC_VERSION KERNEL_VERSION(0, 0, 1); #define MAX_DEBUGFS_NAME 50 #define DEFAULT_TIMEOUT 3 #define DEFAULT_HEIGHT 1088 #define DEFAULT_WIDTH 1920 #define MIN_SUPPORTED_WIDTH 32 #define MIN_SUPPORTED_HEIGHT 32 #define MAX_SUPPORTED_WIDTH 3820 #define MAX_SUPPORTED_HEIGHT 2160 #define V4L2_EVENT_VIDC_BASE 10 #define SYS_MSG_START VIDC_EVENT_CHANGE #define SYS_MSG_END SYS_DEBUG #define SESSION_MSG_START SESSION_LOAD_RESOURCE_DONE #define SESSION_MSG_END SESSION_PROPERTY_INFO #define SYS_MSG_INDEX(__msg) (__msg - SYS_MSG_START) #define SESSION_MSG_INDEX(__msg) (__msg - SESSION_MSG_START) #define MAX_NAME_LENGTH 64 #define EXTRADATA_IDX(__num_planes) (__num_planes - 1) enum vidc_ports { OUTPUT_PORT, CAPTURE_PORT, MAX_PORT_NUM }; enum vidc_core_state { VIDC_CORE_UNINIT = 0, VIDC_CORE_INIT, VIDC_CORE_INIT_DONE, VIDC_CORE_INVALID }; /*Donot change the enum values unless * you know what you are doing*/ enum instance_state { MSM_VIDC_CORE_UNINIT_DONE = 0x0001, MSM_VIDC_CORE_INIT, MSM_VIDC_CORE_INIT_DONE, MSM_VIDC_OPEN, MSM_VIDC_OPEN_DONE, MSM_VIDC_LOAD_RESOURCES, MSM_VIDC_LOAD_RESOURCES_DONE, MSM_VIDC_START, MSM_VIDC_START_DONE, MSM_VIDC_STOP, MSM_VIDC_STOP_DONE, MSM_VIDC_RELEASE_RESOURCES, MSM_VIDC_RELEASE_RESOURCES_DONE, MSM_VIDC_CLOSE, MSM_VIDC_CLOSE_DONE, MSM_VIDC_CORE_UNINIT, MSM_VIDC_CORE_INVALID }; struct buf_info { struct list_head list; struct vb2_buffer *buf; }; struct internal_buf { struct list_head list; enum hal_buffer buffer_type; struct msm_smem *handle; }; struct msm_vidc_format { char name[MAX_NAME_LENGTH]; u8 description[32]; u32 fourcc; int num_planes; int type; u32 (*get_frame_size)(int plane, u32 height, u32 width); }; struct msm_vidc_drv { struct mutex lock; struct list_head cores; int num_cores; struct dentry *debugfs_root; }; struct msm_video_device { int type; struct video_device vdev; }; struct session_prop { u32 width; u32 height; u32 fps; u32 bitrate; }; struct buf_queue { struct vb2_queue vb2_bufq; struct mutex lock; }; enum profiling_points { SYS_INIT = 0, SESSION_INIT, LOAD_RESOURCES, FRAME_PROCESSING, FW_IDLE, MAX_PROFILING_POINTS, }; struct buf_count { int etb; int ftb; int fbd; int ebd; }; struct profile_data { int start; int stop; int cumulative; char name[64]; int sampling; int average; }; struct msm_vidc_debug { struct profile_data pdata[MAX_PROFILING_POINTS]; int profile; int samples; }; enum msm_vidc_mode { VIDC_NON_SECURE, VIDC_SECURE, }; struct msm_vidc_core_capability { struct hal_capability_supported width; struct hal_capability_supported height; struct hal_capability_supported frame_rate; u32 capability_set; }; struct msm_vidc_core { struct list_head list; struct mutex sync_lock, lock; int id; void *device; struct msm_video_device vdev[MSM_VIDC_MAX_DEVICES]; struct v4l2_device v4l2_dev; struct list_head instances; struct dentry *debugfs_root; enum vidc_core_state state; struct completion completions[SYS_MSG_END - SYS_MSG_START + 1]; enum msm_vidc_hfi_type hfi_type; struct msm_vidc_platform_resources resources; }; struct msm_vidc_inst { struct list_head list; struct mutex sync_lock, lock; struct msm_vidc_core *core; int session_type; void *session; struct session_prop prop; int state; struct msm_vidc_format *fmts[MAX_PORT_NUM]; struct buf_queue bufq[MAX_PORT_NUM]; struct list_head pendingq; struct list_head internalbufs; struct list_head persistbufs; struct buffer_requirements buff_req; void *mem_client; struct v4l2_ctrl_handler ctrl_handler; struct completion completions[SESSION_MSG_END - SESSION_MSG_START + 1]; struct list_head ctrl_clusters; struct v4l2_fh event_handler; struct msm_smem *extradata_handle; wait_queue_head_t kernel_event_queue; bool in_reconfig; u32 reconfig_width; u32 reconfig_height; struct dentry *debugfs_root; u32 ftb_count; struct vb2_buffer *vb2_seq_hdr; void *priv; struct msm_vidc_debug debug; struct buf_count count; enum msm_vidc_mode mode; struct msm_vidc_core_capability capability; }; extern struct msm_vidc_drv *vidc_driver; struct msm_vidc_ctrl_cluster { struct v4l2_ctrl **cluster; struct list_head list; }; struct msm_vidc_ctrl { u32 id; char name[MAX_NAME_LENGTH]; enum v4l2_ctrl_type type; s32 minimum; s32 maximum; s32 default_value; u32 step; u32 menu_skip_mask; const char * const *qmenu; u32 cluster; struct v4l2_ctrl *priv; }; void handle_cmd_response(enum command_response cmd, void *data); int msm_vidc_trigger_ssr(struct msm_vidc_core *core, enum hal_ssr_trigger_type type); int msm_vidc_check_session_supported(struct msm_vidc_inst *inst); void msm_vidc_queue_v4l2_event(struct msm_vidc_inst *inst, int event_type); #endif
/* * nghttp2 - HTTP/2 C Library * * Copyright (c) 2015 Tatsuhiro Tsujikawa * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef ASIO_SERVER_STREAM_H #define ASIO_SERVER_STREAM_H #include "nghttp2_config.h" #include <nghttp2/asio_http2_server.h> namespace nghttp2 { namespace asio_http2 { namespace server { class http2_handler; class stream { public: stream(http2_handler *h, int32_t stream_id); int32_t get_stream_id() const; class request &request(); class response &response(); http2_handler *handler() const; private: http2_handler *handler_; class request request_; class response response_; int32_t stream_id_; }; } // namespace server } // namespace asio_http2 } // namespace nghttp2 #endif // ASIO_SERVER_STREAM_H
/* Test for integer/buffer overflow in strtod. Copyright (C) 2012-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #define EXPONENT "e-2147483649" #define SIZE 214748364 static int do_test (void) { char *p = malloc (1 + SIZE + sizeof (EXPONENT)); if (p == NULL) { puts ("malloc failed, cannot test for overflow"); return 0; } p[0] = '1'; memset (p + 1, '0', SIZE); memcpy (p + 1 + SIZE, EXPONENT, sizeof (EXPONENT)); double d = strtod (p, NULL); if (d != 0) { printf ("strtod returned wrong value: %a\n", d); return 1; } return 0; } #define TEST_FUNCTION do_test () #define TIMEOUT 30 #include "../test-skeleton.c"
/* Dump registers. Copyright (C) 2000-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Jaeger <aj@suse.de>, 2000. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library. If not, see <http://www.gnu.org/licenses/>. */ #include <sgidefs.h> #include <sys/uio.h> #include <_itoa.h> #if _MIPS_SIM == _ABIO32 # define CTX_TYPE struct sigcontext * # define CTX_REG(ctx, i) ((ctx)->sc_regs[(i)]) # define CTX_PC(ctx) ((ctx)->sc_pc) # define CTX_MDHI(ctx) ((ctx)->sc_mdhi) # define CTX_MDLO(ctx) ((ctx)->sc_mdlo) # define REG_HEX_SIZE 8 #else # define CTX_TYPE ucontext_t * # define CTX_REG(ctx, i) ((ctx)->uc_mcontext.gregs[(i)]) # define CTX_PC(ctx) ((ctx)->uc_mcontext.pc) # define CTX_MDHI(ctx) ((ctx)->uc_mcontext.mdhi) # define CTX_MDLO(ctx) ((ctx)->uc_mcontext.mdhi) # define REG_HEX_SIZE 16 #endif /* We will print the register dump in this format: R0 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX R8 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX R16 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX R24 XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX pc lo hi XXXXXXXX XXXXXXXX XXXXXXXX The FPU registers will not be printed. */ static void hexvalue (_ITOA_WORD_TYPE value, char *buf, size_t len) { char *cp = _itoa_word (value, buf + len, 16, 0); while (cp > buf) *--cp = '0'; } static void register_dump (int fd, CTX_TYPE ctx) { char regs[38][REG_HEX_SIZE]; struct iovec iov[38 * 2 + 10]; size_t nr = 0; int i; #define ADD_STRING(str) \ iov[nr].iov_base = (char *) str; \ iov[nr].iov_len = strlen (str); \ ++nr #define ADD_MEM(str, len) \ iov[nr].iov_base = str; \ iov[nr].iov_len = len; \ ++nr /* Generate strings of register contents. */ for (i = 0; i < 32; i++) hexvalue (CTX_REG (ctx, i), regs[i], REG_HEX_SIZE); hexvalue (CTX_PC (ctx), regs[32], REG_HEX_SIZE); hexvalue (CTX_MDHI (ctx), regs[33], REG_HEX_SIZE); hexvalue (CTX_MDLO (ctx), regs[34], REG_HEX_SIZE); /* Generate the output. */ ADD_STRING ("Register dump:\n\n R0 "); for (i = 0; i < 8; i++) { ADD_MEM (regs[i], REG_HEX_SIZE); ADD_STRING (" "); } ADD_STRING ("\n R8 "); for (i = 8; i < 16; i++) { ADD_MEM (regs[i], REG_HEX_SIZE); ADD_STRING (" "); } ADD_STRING ("\n R16 "); for (i = 16; i < 24; i++) { ADD_MEM (regs[i], REG_HEX_SIZE); ADD_STRING (" "); } ADD_STRING ("\n R24 "); for (i = 24; i < 32; i++) { ADD_MEM (regs[i], REG_HEX_SIZE); ADD_STRING (" "); } ADD_STRING ("\n pc lo hi\n "); for (i = 32; i < 35; i++) { ADD_MEM (regs[i], REG_HEX_SIZE); ADD_STRING (" "); } ADD_STRING ("\n"); /* Write the stuff out. */ writev (fd, iov, nr); } #define REGISTER_DUMP register_dump (fd, ctx)
/* Copyright (C) 2011-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@gmail.com>, 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <fenv.h> #include <math.h> #include <math_private.h> /* wrapper jn */ double jn (int n, double x) { if (__builtin_expect (isgreater (fabs (x), X_TLOSS), 0) && _LIB_VERSION != _IEEE_ && _LIB_VERSION != _POSIX_) /* jn(n,|x|>X_TLOSS) */ return __kernel_standard (n, x, 38); return __ieee754_jn (n, x); } #ifdef NO_LONG_DOUBLE weak_alias (jn, jnl) #endif /* wrapper yn */ double yn (int n, double x) { if (__builtin_expect (islessequal (x, 0.0) || isgreater (x, X_TLOSS), 0) && _LIB_VERSION != _IEEE_) { if (x < 0.0) { /* d = zero/(x-x) */ __feraiseexcept (FE_INVALID); return __kernel_standard (n, x, 13); } else if (x == 0.0) { /* d = -one/(x-x) */ __feraiseexcept (FE_DIVBYZERO); return __kernel_standard (n, x, 12); } else if (_LIB_VERSION != _POSIX_) /* yn(n,x>X_TLOSS) */ return __kernel_standard (n, x, 39); } return __ieee754_yn (n, x); } #ifdef NO_LONG_DOUBLE weak_alias (yn, ynl) #endif
/* ********************************************************************** * recmgr.c -- Recording manager for emu10k1 driver * Copyright 1999, 2000 Creative Labs, Inc. * ********************************************************************** * * Date Author Summary of changes * ---- ------ ------------------ * October 20, 1999 Bertrand Lee base code release * ********************************************************************** * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, * USA. * ********************************************************************** */ #include <asm/delay.h> #include "8010.h" #include "recmgr.h" void emu10k1_reset_record(struct emu10k1_card *card, struct wavein_buffer *buffer) { DPF(2, "emu10k1_reset_record()\n"); sblive_writeptr(card, buffer->sizereg, 0, ADCBS_BUFSIZE_NONE); sblive_writeptr(card, buffer->sizereg, 0, buffer->sizeregval); while (sblive_readptr(card, buffer->idxreg, 0)) udelay(5); } void emu10k1_start_record(struct emu10k1_card *card, struct wavein_buffer *buffer) { DPF(2, "emu10k1_start_record()\n"); if (buffer->adcctl) sblive_writeptr(card, ADCCR, 0, buffer->adcctl); } void emu10k1_stop_record(struct emu10k1_card *card, struct wavein_buffer *buffer) { DPF(2, "emu10k1_stop_record()\n"); /* Disable record transfer */ if (buffer->adcctl) sblive_writeptr(card, ADCCR, 0, 0); } void emu10k1_set_record_src(struct emu10k1_card *card, struct wiinst *wiinst) { struct wavein_buffer *buffer = &wiinst->buffer; DPF(2, "emu10k1_set_record_src()\n"); switch (wiinst->recsrc) { case WAVERECORD_AC97: DPF(2, "recording source: AC97\n"); buffer->sizereg = ADCBS; buffer->addrreg = ADCBA; buffer->idxreg = ADCIDX_IDX; switch (wiinst->format.samplingrate) { case 0xBB80: buffer->adcctl = ADCCR_SAMPLERATE_48; break; case 0xAC44: buffer->adcctl = ADCCR_SAMPLERATE_44; break; case 0x7D00: buffer->adcctl = ADCCR_SAMPLERATE_32; break; case 0x5DC0: buffer->adcctl = ADCCR_SAMPLERATE_24; break; case 0x5622: buffer->adcctl = ADCCR_SAMPLERATE_22; break; case 0x3E80: buffer->adcctl = ADCCR_SAMPLERATE_16; break; case 0x2B11: buffer->adcctl = ADCCR_SAMPLERATE_11; break; case 0x1F40: buffer->adcctl = ADCCR_SAMPLERATE_8; break; default: BUG(); break; } buffer->adcctl |= ADCCR_LCHANENABLE; if (wiinst->format.channels == 2) buffer->adcctl |= ADCCR_RCHANENABLE; break; case WAVERECORD_MIC: DPF(2, "recording source: MIC\n"); buffer->sizereg = MICBS; buffer->addrreg = MICBA; buffer->idxreg = MICIDX_IDX; buffer->adcctl = 0; break; case WAVERECORD_FX: DPF(2, "recording source: FX\n"); buffer->sizereg = FXBS; buffer->addrreg = FXBA; buffer->idxreg = FXIDX_IDX; buffer->adcctl = 0; sblive_writeptr(card, FXWC, 0, wiinst->fxwc); break; default: BUG(); break; } DPD(2, "bus addx: %#lx\n", (unsigned long) buffer->dma_handle); sblive_writeptr(card, buffer->addrreg, 0, (u32)buffer->dma_handle); }
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QX11INFO_X11_H #define QX11INFO_X11_H #include <QtCore/qnamespace.h> typedef struct _XDisplay Display; QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Gui) struct QX11InfoData; class QX11Info; class QPaintDevice; class QApplicationPrivate; class QX11InfoPrivate; struct QX11WindowAttributes; void qt_x11_getX11InfoForWindow(QX11Info * xinfo, const QX11WindowAttributes &a); class Q_GUI_EXPORT QX11Info { public: QX11Info(); ~QX11Info(); QX11Info(const QX11Info &other); QX11Info &operator=(const QX11Info &other); static Display *display(); static const char *appClass(); int screen() const; int depth() const; int cells() const; Qt::HANDLE colormap() const; bool defaultColormap() const; void *visual() const; bool defaultVisual() const; static int appScreen(); static int appDepth(int screen = -1); static int appCells(int screen = -1); static Qt::HANDLE appColormap(int screen = -1); static void *appVisual(int screen = -1); static Qt::HANDLE appRootWindow(int screen = -1); static bool appDefaultColormap(int screen = -1); static bool appDefaultVisual(int screen = -1); static int appDpiX(int screen = -1); static int appDpiY(int screen = -1); static void setAppDpiX(int screen, int dpi); static void setAppDpiY(int screen, int dpi); static unsigned long appTime(); static unsigned long appUserTime(); static void setAppTime(unsigned long time); static void setAppUserTime(unsigned long time); static bool isCompositingManagerRunning(); protected: void copyX11Data(const QPaintDevice *); void cloneX11Data(const QPaintDevice *); void setX11Data(const QX11InfoData *); QX11InfoData* getX11Data(bool def = false) const; QX11InfoData *x11data; friend class QX11PaintEngine; friend class QPixmap; friend class QX11PixmapData; friend class QWidget; friend class QWidgetPrivate; friend class QGLWidget; friend void qt_init(QApplicationPrivate *priv, int, Display *display, Qt::HANDLE visual, Qt::HANDLE colormap); friend void qt_cleanup(); friend void qt_x11_getX11InfoForWindow(QX11Info * xinfo, const QX11WindowAttributes &a); }; QT_END_NAMESPACE QT_END_HEADER #endif // QX11INFO_X11_H
/* ** $Id: psp_version.h 1.2.2.3 2014/10/01 15:41:27GMT-05:00 sstrege Exp $ ** ** ** Copyright (c) 2004-2006, United States government as represented by the ** administrator of the National Aeronautics Space Administration. ** All rights reserved. This software(cFE) was created at NASA's Goddard ** Space Flight Center pursuant to government contracts. ** ** This software may be used only pursuant to a United States government ** sponsored project and the United States government may not be charged ** for use thereof. ** ** ** ** Purpose: ** Provide version identifiers for the cFE Platform Support Packages (PSP). ** */ #ifndef _psp_version_ #define _psp_version_ /* ** Macro Definitions */ #define CFE_PSP_MAJOR_VERSION 1 #define CFE_PSP_MINOR_VERSION 2 #define CFE_PSP_REVISION 0 #define CFE_PSP_MISSION_REV 0 /* For backwards compatibility */ #define CFE_PSP_SUBMINOR_VERSION CFE_PSP_REVISION #endif /* _psp_version_ */
/****************************************************************** iLBC Speech Coder ANSI-C Source Code iCBConstruct.c Copyright (C) The Internet Society (2004). All Rights Reserved. ******************************************************************/ #include <math.h> #include "iLBC_define.h" #include "iCBConstruct.h" #include "gainquant.h" #include "getCBvec.h" /*----------------------------------------------------------------* * Convert the codebook indexes to make the search easier *---------------------------------------------------------------*/ void index_conv_enc( int *index /* (i/o) Codebook indexes */ ){ int k; for (k=1; k<CB_NSTAGES; k++) { if ((index[k]>=108)&&(index[k]<172)) { index[k]-=64; } else if (index[k]>=236) { index[k]-=128; } else { /* ERROR */ } } } void index_conv_dec( int *index /* (i/o) Codebook indexes */ ){ int k; for (k=1; k<CB_NSTAGES; k++) { if ((index[k]>=44)&&(index[k]<108)) { index[k]+=64; } else if ((index[k]>=108)&&(index[k]<128)) { index[k]+=128; } else { /* ERROR */ } } } /*----------------------------------------------------------------* * Construct decoded vector from codebook and gains. *---------------------------------------------------------------*/ void iCBConstruct( float *decvector, /* (o) Decoded vector */ int *index, /* (i) Codebook indices */ int *gain_index,/* (i) Gain quantization indices */ float *mem, /* (i) Buffer for codevector construction */ int lMem, /* (i) Length of buffer */ int veclen, /* (i) Length of vector */ int nStages /* (i) Number of codebook stages */ ){ int j,k; float gain[CB_NSTAGES]; float cbvec[SUBL]; /* gain de-quantization */ gain[0] = gaindequant(gain_index[0], 1.0, 32); if (nStages > 1) { gain[1] = gaindequant(gain_index[1], (float)fabs(gain[0]), 16); } if (nStages > 2) { gain[2] = gaindequant(gain_index[2], (float)fabs(gain[1]), 8); } /* codebook vector construction and construction of total vector */ getCBvec(cbvec, mem, index[0], lMem, veclen); for (j=0;j<veclen;j++){ decvector[j] = gain[0]*cbvec[j]; } if (nStages > 1) { for (k=1; k<nStages; k++) { getCBvec(cbvec, mem, index[k], lMem, veclen); for (j=0;j<veclen;j++) { decvector[j] += gain[k]*cbvec[j]; } } } }
/*************************************************************************** * (c) Jürgen Riegel (juergen.riegel@web.de) 2008 * * * * This file is part of the FreeCAD CAx development system. * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Library General Public * * License as published by the Free Software Foundation; either * * version 2 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Library General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this library; see the file COPYING.LIB. If not, * * write to the Free Software Foundation, Inc., 59 Temple Place, * * Suite 330, Boston, MA 02111-1307, USA * * * ***************************************************************************/ #ifndef APP_DOCUMENTOBJECTFILEINCLUDED_H #define APP_DOCUMENTOBJECTFILEINCLUDED_H #include "DocumentObject.h" #include "PropertyFile.h" namespace App { class AppExport DocumentObjectFileIncluded : public DocumentObject { PROPERTY_HEADER(App::DocumentObjectFileIncluded); public: /// Constructor DocumentObjectFileIncluded(void); virtual ~DocumentObjectFileIncluded(); /// returns the type name of the ViewProvider virtual const char* getViewProviderName(void) const { return "Gui::ViewProviderDocumentObject"; } /// Properties PropertyFileIncluded File; }; } //namespace App #endif // APP_DOCUMENTOBJECTFILEINCLUDED_H
/* * This file is part of the coreboot project. * * 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. */ #include <console/uart.h> #define VEXPRESS_UART0_IO_ADDRESS (0x10009000) uintptr_t uart_platform_base(int idx) { return VEXPRESS_UART0_IO_ADDRESS; }
/* vasprintf and asprintf with out-of-memory checking. Copyright (C) 1999, 2002-2004, 2006-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> /* Specification. */ #include "xvasprintf.h" #include <errno.h> #include <limits.h> #include <string.h> #include <stdio.h> #include "xalloc.h" /* Checked size_t computations. */ #include "xsize.h" static inline char * xstrcat (size_t argcount, va_list args) { char *result; va_list ap; size_t totalsize; size_t i; char *p; /* Determine the total size. */ totalsize = 0; va_copy (ap, args); for (i = argcount; i > 0; i--) { const char *next = va_arg (ap, const char *); totalsize = xsum (totalsize, strlen (next)); } va_end (ap); /* Test for overflow in the summing pass above or in (totalsize + 1) below. Also, don't return a string longer than INT_MAX, for consistency with vasprintf(). */ if (totalsize == SIZE_MAX || totalsize > INT_MAX) { errno = EOVERFLOW; return NULL; } /* Allocate and fill the result string. */ result = XNMALLOC (totalsize + 1, char); p = result; for (i = argcount; i > 0; i--) { const char *next = va_arg (args, const char *); size_t len = strlen (next); memcpy (p, next, len); p += len; } *p = '\0'; return result; } char * xvasprintf (const char *format, va_list args) { char *result; /* Recognize the special case format = "%s...%s". It is a frequently used idiom for string concatenation and needs to be fast. We don't want to have a separate function xstrcat() for this purpose. */ { size_t argcount = 0; const char *f; for (f = format;;) { if (*f == '\0') /* Recognized the special case of string concatenation. */ return xstrcat (argcount, args); if (*f != '%') break; f++; if (*f != 's') break; f++; argcount++; } } if (vasprintf (&result, format, args) < 0) { if (errno == ENOMEM) xalloc_die (); return NULL; } return result; }
#ifndef _X_TABLES_H #define _X_TABLES_H #include <linux/types.h> #define XT_FUNCTION_MAXNAMELEN 30 #define XT_TABLE_MAXNAMELEN 32 struct xt_entry_match { union { struct { __u16 match_size; /* Used by userspace */ char name[XT_FUNCTION_MAXNAMELEN-1]; __u8 revision; } user; struct { __u16 match_size; /* Used inside the kernel */ struct xt_match *match; } kernel; /* Total length */ __u16 match_size; } u; unsigned char data[0]; }; struct xt_entry_target { union { struct { __u16 target_size; /* Used by userspace */ char name[XT_FUNCTION_MAXNAMELEN-1]; __u8 revision; } user; struct { __u16 target_size; /* Used inside the kernel */ struct xt_target *target; } kernel; /* Total length */ __u16 target_size; } u; unsigned char data[0]; }; #define XT_TARGET_INIT(__name, __size) \ { \ .target.u.user = { \ .target_size = XT_ALIGN(__size), \ .name = __name, \ }, \ } struct xt_standard_target { struct xt_entry_target target; int verdict; }; /* The argument to IPT_SO_GET_REVISION_*. Returns highest revision * kernel supports, if >= revision. */ struct xt_get_revision { char name[XT_FUNCTION_MAXNAMELEN-1]; __u8 revision; }; /* CONTINUE verdict for targets */ #define XT_CONTINUE 0xFFFFFFFF /* For standard target */ #define XT_RETURN (-NF_REPEAT - 1) /* this is a dummy structure to find out the alignment requirement for a struct * containing all the fundamental data types that are used in ipt_entry, * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my * personal pleasure to remove it -HW */ struct _xt_align { __u8 u8; __u16 u16; __u32 u32; __u64 u64; }; #define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) \ & ~(__alignof__(struct _xt_align)-1)) /* Standard return verdict, or do jump. */ #define XT_STANDARD_TARGET "" /* Error verdict. */ #define XT_ERROR_TARGET "ERROR" #define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0) #define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0) struct xt_counters { __u64 pcnt, bcnt; /* Packet and byte counters */ }; /* The argument to IPT_SO_ADD_COUNTERS. */ struct xt_counters_info { /* Which table. */ char name[XT_TABLE_MAXNAMELEN]; unsigned int num_counters; /* The counters (actually `number' of these). */ struct xt_counters counters[0]; }; #define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */ /* fn returns 0 to continue iteration */ #define XT_MATCH_ITERATE(type, e, fn, args...) \ ({ \ unsigned int __i; \ int __ret = 0; \ struct xt_entry_match *__m; \ \ for (__i = sizeof(type); \ __i < (e)->target_offset; \ __i += __m->u.match_size) { \ __m = (void *)e + __i; \ \ __ret = fn(__m , ## args); \ if (__ret != 0) \ break; \ } \ __ret; \ }) /* fn returns 0 to continue iteration */ #define XT_ENTRY_ITERATE_CONTINUE(type, entries, size, n, fn, args...) \ ({ \ unsigned int __i, __n; \ int __ret = 0; \ type *__entry; \ \ for (__i = 0, __n = 0; __i < (size); \ __i += __entry->next_offset, __n++) { \ __entry = (void *)(entries) + __i; \ if (__n < n) \ continue; \ \ __ret = fn(__entry , ## args); \ if (__ret != 0) \ break; \ } \ __ret; \ }) /* fn returns 0 to continue iteration */ #define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \ XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args) #endif /* _X_TABLES_H */
#pragma once /* * Copyright 2010-2016 OpenXcom Developers. * * This file is part of OpenXcom. * * OpenXcom 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. * * OpenXcom 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 OpenXcom. If not, see <http://www.gnu.org/licenses/>. */ #include <string> #include "OptionsBaseState.h" #include "../Engine/State.h" namespace OpenXcom { class TextButton; class Window; class Text; /** * window used to confirm save game deletion. */ class DeleteGameState : public State { private: TextButton *_btnNo, *_btnYes; Window *_window; Text *_txtMessage; std::string _filename; OptionsOrigin _origin; public: /// Creates the Confirm state. DeleteGameState(OptionsOrigin origin, const std::string &save); /// Cleans up the Confirm state. ~DeleteGameState(); /// Handler for clicking the confirm button. void btnYesClick(Action *action); /// Handler for clicking the cancel button. void btnNoClick(Action *action); }; }
/* * Copyright (C) 2010 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 CoreIPCMessageKinds_h #define CoreIPCMessageKinds_h #include "MessageID.h" namespace CoreIPC { namespace CoreIPCMessage { enum Kind { InitializeConnection, SyncMessageReply, #if PLATFORM(MAC) SetExceptionPort, #endif }; } // namespace CoreIPCMessage template<> struct MessageKindTraits<CoreIPCMessage::Kind> { static const MessageClass messageClass = MessageClassCoreIPC; }; } // namespace CoreIPC #endif // CoreIPCMessageKinds_h
/* $Id: ioctl.h,v 1.1 2000/04/14 16:48:21 mjd Exp $ * * linux/ioctl.h for Linux by H.H. Bergman. */ #ifndef __ASM_SH_IOCTL_H #define __ASM_SH_IOCTL_H /* ioctl command encoding: 32 bits total, command in lower 16 bits, * size of the parameter structure in the lower 14 bits of the * upper 16 bits. * Encoding the size of the parameter structure in the ioctl request * is useful for catching programs compiled with old versions * and to avoid overwriting user space outside the user buffer area. * The highest 2 bits are reserved for indicating the ``access mode''. * NOTE: This limits the max parameter size to 16kB -1 ! */ /* * The following is for compatibility across the various Linux * platforms. The i386 ioctl numbering scheme doesn't really enforce * a type field. De facto, however, the top 8 bits of the lower 16 * bits are indeed used as a type field, so we might just as well make * this explicit here. Please be sure to use the decoding macros * below from now on. */ #define _IOC_NRBITS 8 #define _IOC_TYPEBITS 8 #define _IOC_SIZEBITS 14 #define _IOC_DIRBITS 2 #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) #define _IOC_NRSHIFT 0 #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) /* * Direction bits. */ #define _IOC_NONE 0U #define _IOC_WRITE 1U #define _IOC_READ 2U #define _IOC(dir,type,nr,size) \ (((dir) << _IOC_DIRSHIFT) | \ ((type) << _IOC_TYPESHIFT) | \ ((nr) << _IOC_NRSHIFT) | \ ((size) << _IOC_SIZESHIFT)) /* used to create numbers */ #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) /* used to decode ioctl numbers.. */ #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) /* ...and for the drivers/sound files... */ #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) #endif /* __ASM_SH_IOCTL_H */
// BranchARMThumb.h #ifndef __BRANCH_ARM_THUMB_H #define __BRANCH_ARM_THUMB_H #include "Common/Types.h" UInt32 ARMThumb_Convert(Byte *data, UInt32 size, UInt32 nowPos, int encoding); #endif
/******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * * Copyright (C) 2017 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Limited and/or its subsidiaries. * * Copyright (C) 2004-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * * www.broadcom.com * * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * 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. * * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * * TO BE LEGALLY INVALID. See the GNU General Public License for * * more details, a copy of which can be found in the file COPYING * * included with this package. * ********************************************************************/ #define LPFC_NVMET_MIN_SEGS 16 #define LPFC_NVMET_DEFAULT_SEGS 64 /* 256K IOs */ #define LPFC_NVMET_MAX_SEGS 510 #define LPFC_NVMET_SUCCESS_LEN 12 /* Used for NVME Target */ struct lpfc_nvmet_tgtport { struct lpfc_hba *phba; struct completion tport_unreg_done; /* Stats counters - lpfc_nvmet_unsol_ls_buffer */ atomic_t rcv_ls_req_in; atomic_t rcv_ls_req_out; atomic_t rcv_ls_req_drop; atomic_t xmt_ls_abort; /* Stats counters - lpfc_nvmet_xmt_ls_rsp */ atomic_t xmt_ls_rsp; atomic_t xmt_ls_drop; /* Stats counters - lpfc_nvmet_xmt_ls_rsp_cmp */ atomic_t xmt_ls_rsp_error; atomic_t xmt_ls_rsp_cmpl; /* Stats counters - lpfc_nvmet_unsol_fcp_buffer */ atomic_t rcv_fcp_cmd_in; atomic_t rcv_fcp_cmd_out; atomic_t rcv_fcp_cmd_drop; /* Stats counters - lpfc_nvmet_xmt_fcp_op */ atomic_t xmt_fcp_abort; atomic_t xmt_fcp_drop; atomic_t xmt_fcp_read_rsp; atomic_t xmt_fcp_read; atomic_t xmt_fcp_write; atomic_t xmt_fcp_rsp; /* Stats counters - lpfc_nvmet_xmt_fcp_op_cmp */ atomic_t xmt_fcp_rsp_cmpl; atomic_t xmt_fcp_rsp_error; atomic_t xmt_fcp_rsp_drop; /* Stats counters - lpfc_nvmet_unsol_issue_abort */ atomic_t xmt_abort_rsp; atomic_t xmt_abort_rsp_error; /* Stats counters - lpfc_nvmet_xmt_abort_cmp */ atomic_t xmt_abort_cmpl; }; struct lpfc_nvmet_rcv_ctx { union { struct nvmefc_tgt_ls_req ls_req; struct nvmefc_tgt_fcp_req fcp_req; } ctx; struct lpfc_hba *phba; struct lpfc_iocbq *wqeq; struct lpfc_iocbq *abort_wqeq; dma_addr_t txrdy_phys; uint32_t *txrdy; uint32_t sid; uint32_t offset; uint16_t oxid; uint16_t size; uint16_t entry_cnt; uint16_t cpu; uint16_t state; /* States */ #define LPFC_NVMET_STE_FREE 0 #define LPFC_NVMET_STE_RCV 1 #define LPFC_NVMET_STE_DATA 2 #define LPFC_NVMET_STE_ABORT 3 #define LPFC_NVMET_STE_RSP 4 #define LPFC_NVMET_STE_DONE 5 uint16_t flag; #define LPFC_NVMET_IO_INP 1 #define LPFC_NVMET_ABORT_OP 2 struct rqb_dmabuf *rqb_buffer; #ifdef CONFIG_SCSI_LPFC_DEBUG_FS uint64_t ts_isr_cmd; uint64_t ts_cmd_nvme; uint64_t ts_nvme_data; uint64_t ts_data_wqput; uint64_t ts_isr_data; uint64_t ts_data_nvme; uint64_t ts_nvme_status; uint64_t ts_status_wqput; uint64_t ts_isr_status; uint64_t ts_status_nvme; #endif };
// 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 REMOTING_TEST_REFRESH_TOKEN_STORE_H_ #define REMOTING_TEST_REFRESH_TOKEN_STORE_H_ #include <string> #include "base/memory/scoped_ptr.h" namespace base { class FilePath; } namespace remoting { namespace test { // Used to store and retrieve refresh tokens. This interface is provided to // allow for stubbing out the storage mechanism for testing. class RefreshTokenStore { public: RefreshTokenStore() {} virtual ~RefreshTokenStore() {} virtual std::string FetchRefreshToken() = 0; virtual bool StoreRefreshToken(const std::string& refresh_token) = 0; // Returns a RefreshTokenStore which reads/writes to a user specific token // file on the local disk. static scoped_ptr<RefreshTokenStore> OnDisk( const std::string& user_name, const base::FilePath& refresh_token_file_path); }; } // namespace test } // namespace remoting #endif // REMOTING_TEST_REFRESH_TOKEN_STORE_H_
/* * IBM Accurate Mathematical Library * Written by International Business Machines Corp. * Copyright (C) 2001 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /******************************************************************/ /* */ /* MODULE_NAME:mplog.h */ /* */ /* common data and variables prototype and definition */ /******************************************************************/ #ifndef MPLOG_H #define MPLOG_H #ifdef BIG_ENDI static const number /**/ one = {{0x3ff00000, 0x00000000} }; /* 1 */ #else #ifdef LITTLE_ENDI static const number /**/ one = {{0x00000000, 0x3ff00000} }; /* 1 */ #endif #endif #define ONE one.d #endif
#ifndef __DISP_DRV_PLATFORM_H__ #define __DISP_DRV_PLATFORM_H__ #include <linux/dma-mapping.h> #include <mach/mt_typedefs.h> #include <mach/mt_gpio.h> #include <mach/m4u.h> #include <mach/mt_reg_base.h> #include <mach/mt_clkmgr.h> #include <mach/mt_irq.h> #include <board-custom.h> #include <linux/disp_assert_layer.h> #include "ddp_hal.h" #include "ddp_drv.h" #include "ddp_path.h" #include "ddp_rdma.h" #include "ddp_ovl.h" #include <mach/sync_write.h> #define ALIGN_TO(x, n) \ (((x) + ((n) - 1)) & ~((n) - 1)) /************************Feature options****************************/ /** * SODI enable. */ #define MTK_FB_SODI_SUPPORT /** * ESD recovery support. */ #define MTK_FB_ESD_ENABLE /** * FB Ion support. */ #define MTK_FB_ION_SUPPORT /** * Enable idle screen low power mode. */ #define MTK_DISP_IDLE_LP /** * Enable Multipass support. */ //#define OVL_MULTIPASS_SUPPORT /** * Enable Ovl time-sharing. */ #define OVL_TIME_SHARING /** * Build CMDQ command in trigger stage. */ #define CONFIG_ALL_IN_TRIGGER_STAGE /** * Disable M4U of display engines. */ //#define MTKFB_NO_M4U /** * Bring-up display in kernel stage (not LK stage). * Please also turn on the option MACH_FPGA_NO_DISPLAY=y in LK. */ //#define MTK_NO_DISP_IN_LK // do not enable display in LK /** * Disable using CMDQ in display driver. * The registers and system event would be processed by CPU. */ //#define MTK_FB_CMDQ_DISABLE /** * Bypass display module. No frame would be updated to screen. */ //#define MTK_FB_DO_NOTHING /** * Bypass ALL display PQ engine. */ //#define MTKFB_FB_BYPASS_PQ /** * Enable display auto-update testing. * Display driver would fill the FB and output to panel directly while probe complete. */ //#define FPGA_DEBUG_PAN /** * Disable dynamic display resolution adjustment. */ #define MTK_FB_DFO_DISABLE //#define DFO_USE_NEW_API /************************Display Capabilies****************************/ //These configurations should not be changed. /** * FB alignment byte. */ #ifdef CONFIG_FPGA_EARLY_PORTING #define MTK_FB_ALIGNMENT 16 #else #define MTK_FB_ALIGNMENT 32 #endif /** * DUAL OVL engine support. */ //#define OVL_CASCADE_SUPPORT /** * OVL layer configurations. */ #define HW_OVERLAY_COUNT (OVL_LAYER_NUM) #define RESERVED_LAYER_COUNT (2) #define VIDEO_LAYER_COUNT (HW_OVERLAY_COUNT - RESERVED_LAYER_COUNT) #define PRIMARY_DISPLAY_HW_OVERLAY_LAYER_NUMBER (4) #define PRIMARY_DISPLAY_HW_OVERLAY_ENGINE_COUNT (2) #ifdef OVL_CASCADE_SUPPORT #define PRIMARY_DISPLAY_HW_OVERLAY_CASCADE_COUNT (2) #else #define PRIMARY_DISPLAY_HW_OVERLAY_CASCADE_COUNT (1) #endif #define PRIMARY_DISPLAY_SESSION_LAYER_COUNT (PRIMARY_DISPLAY_HW_OVERLAY_LAYER_NUMBER*PRIMARY_DISPLAY_HW_OVERLAY_CASCADE_COUNT) #define EXTERNAL_DISPLAY_SESSION_LAYER_COUNT (PRIMARY_DISPLAY_HW_OVERLAY_LAYER_NUMBER*PRIMARY_DISPLAY_HW_OVERLAY_CASCADE_COUNT) #define DISP_SESSION_OVL_TIMELINE_ID(x) (x) //#define DISP_SESSION_OUTPUT_TIMELINE_ID (PRIMARY_DISPLAY_SESSION_LAYER_COUNT) //#define DISP_SESSION_PRESENT_TIMELINE_ID (PRIMARY_DISPLAY_SESSION_LAYER_COUNT+1) //#define DISP_SESSION_TIMELINE_COUNT (DISP_SESSION_PRESENT_TIMELINE_ID+1) typedef enum { DISP_SESSION_OUTPUT_TIMELINE_ID = PRIMARY_DISPLAY_SESSION_LAYER_COUNT, DISP_SESSION_PRESENT_TIMELINE_ID, DISP_SESSION_OUTPUT_INTERFACE_TIMELINE_ID, DISP_SESSION_TIMELINE_COUNT, }DISP_SESSION_ENUM; /** * Session count. */ #define MAX_SESSION_COUNT 5 /** * Need to control SODI enable/disable by SW. */ //#define FORCE_SODI_BY_SW /** * Support RDMA1 engine. */ //#define MTK_FB_RDMA1_SUPPORT /** * The maximum compose layer OVL can support in one pass. */ #define DISP_HW_MAX_LAYER 4 /** * WDMA_PATH_CLOCK_DYNAMIC_SWITCH: * Dynamice turn on/off WDMA path clock. This feature is necessary in MultiPass for SODI. */ #ifdef OVL_MULTIPASS_SUPPORT #define WDMA_PATH_CLOCK_DYNAMIC_SWITCH #endif /** * HW_MODE_CAP: Direct-Link, Decouple or Switchable. * HW_PASS_MODE: Multi-Pass, Single-Pass. */ #ifdef CONFIG_MTK_GMO_RAM_OPTIMIZE #define DISP_HW_MODE_CAP DISP_OUTPUT_CAP_DIRECT_LINK #define DISP_HW_PASS_MODE DISP_OUTPUT_CAP_SINGLE_PASS #ifdef OVL_TIME_SHARING #undef OVL_TIME_SHARING #endif #define DISP_INTERNAL_BUFFER_COUNT 3 #else #define DISP_HW_MODE_CAP DISP_OUTPUT_CAP_SWITCHABLE #ifdef OVL_MULTIPASS_SUPPORT #define DISP_HW_PASS_MODE DISP_OUTPUT_CAP_MULTI_PASS #else #define DISP_HW_PASS_MODE DISP_OUTPUT_CAP_SINGLE_PASS #endif #define DISP_INTERNAL_BUFFER_COUNT 3 #endif #endif //__DISP_DRV_PLATFORM_H__
/* -*- mode: c++; indent-tabs-mode: nil -*- */ #ifndef CERT_TRANS_SERVER_EVENT_H_ #define CERT_TRANS_SERVER_EVENT_H_ #include <glog/logging.h> #include <netinet/in.h> #include <sys/socket.h> #include <sys/types.h> #include <time.h> #include <deque> #include <string> #include "base/macros.h" class Services { public: // because time is expensive, for most tasks we can just use some // time sampled within this event handling loop. So, the main loop // needs to call SetRoughTime() appropriately. static time_t RoughTime() { if (rough_time_ == 0) rough_time_ = time(NULL); return rough_time_; } static void SetRoughTime() { rough_time_ = 0; } static bool InitServer(int* sock, int port, const char* ip, int type); private: // This class is only used as a namespace, it should never be // instantiated. // TODO(pphaneuf): Make this into normal functions in a namespace. Services(); static time_t rough_time_; }; class EventLoop; class FD { public: enum CanDelete { DELETE, NO_DELETE }; FD(EventLoop* loop, int fd, CanDelete deletable = DELETE); virtual ~FD() = default; virtual bool WantsWrite() const = 0; virtual void WriteIsAllowed() = 0; virtual bool WantsRead() const = 0; virtual void ReadIsAllowed() = 0; bool WantsErase() const { return wants_erase_; } void Close(); int fd() const { return fd_; } bool CanDrop() const { return deletable_ == DELETE; } // Don't forget to call me if anything happens! void Activity() { last_activity_ = Services::RoughTime(); } time_t LastActivity() const { return last_activity_; } protected: EventLoop* loop() const { return loop_; } bool WillAccept(int fd); private: int fd_; EventLoop* loop_; bool wants_erase_; CanDelete deletable_; time_t last_activity_; // Note that while you can set these low for test, they behave a // bit strangely when set low - for example, it is quite easy to // hit the limit even if the window is not 0. I'm guessing 1000 // and 100 would be good numbers. Note EventLoop::kIdleTime below, // also. static const int kFDLimit = 1000; static const int kFDLimitWindow = 1; DISALLOW_COPY_AND_ASSIGN(FD); }; class Listener : public FD { public: Listener(EventLoop* loop, int fd) : FD(loop, fd, NO_DELETE) { } bool WantsRead() const { return true; } void ReadIsAllowed(); bool WantsWrite() const { return false; } void WriteIsAllowed(); virtual void Accepted(int fd) = 0; }; class RepeatedEvent { public: RepeatedEvent(time_t repeat_frequency_seconds) : frequency_(repeat_frequency_seconds), last_activity_(Services::RoughTime()) { } // The time when we should execute next. time_t Trigger() { return last_activity_ + frequency_; } virtual std::string Description() = 0; virtual void Execute() = 0; void Activity() { last_activity_ = Services::RoughTime(); } private: time_t frequency_; time_t last_activity_; }; class EventLoop { public: EventLoop() : go_(true) { } void Add(FD* fd) { fds_.push_back(fd); } void Add(RepeatedEvent* event) { events_.push_back(event); } // Returns remaining time until the next alarm. time_t ProcessRepeatedEvents(); void OneLoop(); void Forever(); void MaybeDropOne(); void Stop(); private: bool EraseCheck(std::deque<FD*>::iterator* pfd); static void Set(int fd, fd_set* fdset, int* max); std::deque<FD*> fds_; std::vector<RepeatedEvent*> events_; // This should probably be set to 2 for anything but test (or 1 or 0). // 2: everything gets a chance to speak. // 1: sometimes the clock will tick before some get a chance to speak. // 0: maybe no-one ever gets a chance to speak. static const time_t kIdleTime = 20; bool go_; DISALLOW_COPY_AND_ASSIGN(EventLoop); }; class Server : public FD { public: Server(EventLoop* loop, int fd) : FD(loop, fd) { } bool WantsRead() const { return true; } void ReadIsAllowed(); // There are fresh bytes available in rbuffer. It is the callee's // responsibility to remove consumed bytes from rbuffer. This will // NOT be called again until more data arrives from the network, // even if there are unconsumed bytes in rbuffer. virtual void BytesRead(std::string* rbuffer) = 0; bool WantsWrite() const { return !wbuffer_.empty(); } void WriteIsAllowed(); void Write(std::string str) { wbuffer_.append(str); } private: std::string rbuffer_; std::string wbuffer_; }; class UDPServer : public FD { public: UDPServer(EventLoop* loop, int fd) : FD(loop, fd, NO_DELETE) { } bool WantsRead() const { return true; } void ReadIsAllowed(); bool WantsWrite() const { return !write_queue_.empty(); } void WriteIsAllowed(); // A packet has been read. It will not be re-presented if you do not // process it now. virtual void PacketRead(const sockaddr_in& from, const char* buf, size_t len) = 0; // Queue a packet for sending void QueuePacket(const sockaddr_in& to, const char* buf, size_t len); void QueuePacket(const sockaddr_in& to, const unsigned char* buf, size_t len) { QueuePacket(to, reinterpret_cast<const char*>(buf), len); } private: struct WBuffer { sockaddr_in sa; std::string packet; }; std::deque<WBuffer> write_queue_; }; class UDPEchoServer : public UDPServer { public: UDPEchoServer(EventLoop* loop, int fd) : UDPServer(loop, fd) { } virtual void PacketRead(const sockaddr_in& from, const char* buf, size_t len) { QueuePacket(from, buf, len); } }; #endif // CERT_TRANS_SERVER_EVENT_H_
#import <Foundation/Foundation.h> #import "CedarDouble.h" #import "CDRFake.h" #import <sstream> #import <string> @interface CDRProtocolFake : CDRFake - (id)initWithClass:(Class)klass forProtocol:(Protocol *)protocol requireExplicitStubs:(bool)requireExplicitStubs; @end id CDR_fake_for(Protocol *protocol, bool require_explicit_stubs = true);
/* Copyright (C) 2002, 2005, 2006 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2002. Red Hat elfutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. Red Hat elfutils 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 Red Hat elfutils; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. Red Hat elfutils is an included package of the Open Invention Network. An included package of the Open Invention Network is a package for which Open Invention Network licensees cross-license their patents. No patent license is granted, either expressly or impliedly, by designation as an included package. Should you wish to participate in the Open Invention Network licensing program, please visit www.openinventionnetwork.com <http://www.openinventionnetwork.com>. */ #include <config.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <libelfP.h> static struct { int id; const char *expected; } libelf_msgs[ELF_E_NUM] = { { ELF_E_NOERROR, "no error" }, { ELF_E_UNKNOWN_ERROR, "unknown error" }, { ELF_E_UNKNOWN_VERSION, "unknown version" }, { ELF_E_UNKNOWN_TYPE, "unknown type" }, { ELF_E_INVALID_HANDLE, "invalid `Elf' handle" }, { ELF_E_SOURCE_SIZE, "invalid size of source operand" }, { ELF_E_DEST_SIZE, "invalid size of destination operand" }, { ELF_E_INVALID_ENCODING, "invalid encoding" }, { ELF_E_NOMEM, "out of memory" }, { ELF_E_INVALID_FILE, "invalid file descriptor" }, { ELF_E_INVALID_OP, "invalid operation" }, { ELF_E_NO_VERSION, "ELF version not set" }, { ELF_E_INVALID_CMD, "invalid command" }, { ELF_E_RANGE, "offset out of range" }, { ELF_E_ARCHIVE_FMAG, "invalid fmag field in archive header" }, { ELF_E_INVALID_ARCHIVE, "invalid archive file" }, { ELF_E_NO_ARCHIVE, "descriptor is not for an archive" }, { ELF_E_NO_INDEX, "no index available" }, { ELF_E_READ_ERROR, "cannot read data from file" }, { ELF_E_WRITE_ERROR, "cannot write data to file" }, { ELF_E_INVALID_CLASS, "invalid binary class" }, { ELF_E_INVALID_INDEX, "invalid section index" }, { ELF_E_INVALID_OPERAND, "invalid operand" }, { ELF_E_INVALID_SECTION, "invalid section" }, { ELF_E_INVALID_COMMAND, "invalid command" }, { ELF_E_WRONG_ORDER_EHDR, "executable header not created first" }, { ELF_E_FD_DISABLED, "file descriptor disabled" }, { ELF_E_FD_MISMATCH, "archive/member fildes mismatch" }, { ELF_E_OFFSET_RANGE, "offset out of range" }, { ELF_E_NOT_NUL_SECTION, "cannot manipulate null section" }, { ELF_E_DATA_MISMATCH, "data/scn mismatch" }, { ELF_E_INVALID_SECTION_HEADER, "invalid section header" }, { ELF_E_INVALID_DATA, "invalid data" }, { ELF_E_DATA_ENCODING, "unknown data encoding" }, { ELF_E_SECTION_TOO_SMALL, "section `sh_size' too small for data" }, { ELF_E_INVALID_ALIGN, "invalid section alignment" }, { ELF_E_INVALID_SHENTSIZE, "invalid section entry size" }, { ELF_E_UPDATE_RO, "update() for write on read-only file" }, { ELF_E_NOFILE, "no such file" }, { ELF_E_GROUP_NOT_REL, "only relocatable files can contain section groups" }, { ELF_E_INVALID_PHDR, "program header only allowed in executables, shared objects, \ and core files" }, { ELF_E_NO_PHDR, "file has no program header" }, { ELF_E_INVALID_OFFSET, "invalid offset" } }; int main (void) { size_t cnt; int result = EXIT_SUCCESS; /* Clear the error state. */ (void) elf_errno (); /* Check all the messages of libelf. */ for (cnt = 1; cnt < ELF_E_NUM; ++cnt) { const char *str = elf_errmsg (libelf_msgs[cnt].id); if (strcmp (str, libelf_msgs[cnt].expected) != 0) { printf ("libelf msg %zu: expected \"%s\", got \"%s\"\n", cnt, libelf_msgs[cnt].expected, str); result = EXIT_FAILURE; } } return result; }
/*************************************************************************** qgsscrollarea.h --------------- begin : March 2017 copyright : (C) 2017 by Nyall Dawson email : nyall dot dawson at gmail dot 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. * * * ***************************************************************************/ #ifndef QGSSCROLLAREA_H #define QGSSCROLLAREA_H #include <QScrollArea> #include "qgis_sip.h" #include "qgis_gui.h" #include <QTimer> class ScrollAreaFilter; /** * \class QgsScrollArea * \ingroup gui * A QScrollArea subclass with improved scrolling behavior. * * QgsScrollArea should be used instead of QScrollArea widgets. * In most cases the use is identical, however QgsScrollArea * has extra logic to avoid wheel events changing child widget * values when the mouse cursor is temporarily located over * a child widget during a scroll event. * * All QGIS code and plugins should use QgsScrollArea in place * of QScrollArea. * * \since QGIS 3.0 */ class GUI_EXPORT QgsScrollArea : public QScrollArea { Q_OBJECT public: /** * Constructor for QgsScrollArea. */ explicit QgsScrollArea( QWidget *parent SIP_TRANSFERTHIS = nullptr ); /** * Should be called when a scroll occurs on with the * QScrollArea itself or its child viewport(). */ void scrollOccurred(); /** * Returns TRUE if a scroll recently occurred within * the QScrollArea or its child viewport() */ bool hasScrolled() const; /** * Sets whether the scroll area only applies vertical. * * If set to TRUE, then scroll area children will resize horizontally to match the width of * the scroll area widget. * * \since QGIS 3.8 */ void setVerticalOnly( bool verticalOnly ); protected: void wheelEvent( QWheelEvent *event ) override; void resizeEvent( QResizeEvent *event ) override; private: QTimer mTimer; ScrollAreaFilter *mFilter = nullptr; bool mVerticalOnly = false; }; #ifndef SIP_RUN ///@cond PRIVATE /** * \class ScrollAreaFilter * Swallows wheel events for QScrollArea children for a short period * following a scroll. */ class ScrollAreaFilter : public QObject { Q_OBJECT public: ScrollAreaFilter( QgsScrollArea *parent = nullptr, QWidget *viewPort = nullptr ); protected: bool eventFilter( QObject *obj, QEvent *event ) override; private: QgsScrollArea *mScrollAreaWidget = nullptr; QWidget *mViewPort = nullptr; void addChild( QObject *child ); void removeChild( QObject *child ); }; ///@endcond PRIVATE #endif #endif // QGSSCROLLAREA_H
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder #include "showmsg.h" #include "timer.h" // gettick #include "random.h" #if defined(WIN32) #include "winapi.h" #elif defined(HAVE_GETPID) || defined(HAVE_GETTID) #include <sys/types.h> #include <unistd.h> #endif #include <mt19937ar.h> // init_genrand, genrand_int32, genrand_res53 /// Initializes the random number generator with an appropriate seed. void rnd_init(void) { uint32 seed = gettick(); seed += (uint32)time(NULL); #if defined(WIN32) seed += GetCurrentProcessId(); seed += GetCurrentThreadId(); #else #if defined(HAVE_GETPID) seed += (uint32)getpid(); #endif // HAVE_GETPID #if defined(HAVE_GETTID) seed += (uint32)gettid(); #endif // HAVE_GETTID #endif init_genrand(seed); } /// Initializes the random number generator. void rnd_seed(uint32 seed) { init_genrand(seed); } /// Generates a random number in the interval [0, SINT32_MAX] int32 rnd(void) { return (int32)genrand_int31(); } /// Generates a random number in the interval [0, dice_faces) /// NOTE: interval is open ended, so dice_faces is excluded (unless it's 0) uint32 rnd_roll(uint32 dice_faces) { return (uint32)(rnd_uniform()*dice_faces); } /// Generates a random number in the interval [min, max] /// Returns min if range is invalid. int32 rnd_value(int32 min, int32 max) { if( min >= max ) return min; return min + (int32)(rnd_uniform()*(max-min+1)); } /// Generates a random number in the interval [0.0, 1.0) /// NOTE: interval is open ended, so 1.0 is excluded double rnd_uniform(void) { return ((uint32)genrand_int32())*(1.0/4294967296.0);// divided by 2^32 } /// Generates a random number in the interval [0.0, 1.0) with 53-bit resolution /// NOTE: interval is open ended, so 1.0 is excluded /// NOTE: 53 bits is the maximum precision of a double double rnd_uniform53(void) { return genrand_res53(); }
/* * Persistent Storage - pstore.h * * Copyright (C) 2010 Intel Corporation <tony.luck@intel.com> * * This code is the generic layer to export data records from platform * level persistent storage via a file system. * * 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, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _LINUX_PSTORE_H #define _LINUX_PSTORE_H #include <linux/time.h> #include <linux/kmsg_dump.h> /* types */ enum pstore_type_id { PSTORE_TYPE_DMESG = 0, PSTORE_TYPE_MCE = 1, PSTORE_TYPE_UNKNOWN = 255 }; struct pstore_info { struct module *owner; char *name; spinlock_t buf_lock; /* serialize access to 'buf' */ char *buf; size_t bufsize; struct mutex read_mutex; /* serialize open/read/close */ int (*open)(struct pstore_info *psi); int (*close)(struct pstore_info *psi); ssize_t (*read)(u64 *id, enum pstore_type_id *type, struct timespec *time, char **buf, struct pstore_info *psi); int (*write)(enum pstore_type_id type, enum kmsg_dump_reason reason, u64 *id, unsigned int part, size_t size, struct pstore_info *psi); int (*erase)(enum pstore_type_id type, u64 id, struct pstore_info *psi); void *data; }; #ifdef CONFIG_PSTORE extern int pstore_register(struct pstore_info *); #else static inline int pstore_register(struct pstore_info *psi) { return -ENODEV; } #endif #endif /*_LINUX_PSTORE_H*/
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #pragma mark - // // File: /Applications/Xcode-7GM.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/CoreMedia.framework/CoreMedia // UUID: 481499E0-AAAB-3679-BE08-1995F7DD29D3 // // Arch: x86_64 // Current version: 1.0.0 // Compatibility version: 1.0.0 // Source version: 1731.1.16.0.0 // Minimum iOS version: 9.0.0 // SDK version: 9.0.0 // // // This file does not contain any Objective-C runtime information. //
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. /*============================================================ ** Source : test6.c ** ** Purpose: Test for GetEnvironmentVariableW() function ** Create environment variables that differ only ** in case and verify that they return the appropriate ** value on the BSD environment. ** ** ===========================================================*/ #include <palsuite.h> int __cdecl main(int argc, char *argv[]) { #if WIN32 /* Define some buffers needed for the function */ WCHAR * pResultBuffer = NULL; WCHAR FirstEnvironmentVariable[] = {'P','A','L','T','E','S','T','\0'}; WCHAR FirstEnvironmentValue[] = {'F','I','R','S','T','\0'}; WCHAR ModifiedEnvironmentVariable[] = {'p','a','l','t','e','s','t','\0'}; DWORD size = 0; BOOL bRc = TRUE; /* * Initialize the PAL and return FAILURE if this fails */ if(0 != (PAL_Initialize(argc, argv))) { return FAIL; } /* Set the first environment variable */ bRc = SetEnvironmentVariableW(FirstEnvironmentVariable, FirstEnvironmentValue); if(!bRc) { Fail("ERROR: SetEnvironmentVariable failed to set a " "proper environment variable with error %u.\n", GetLastError()); } /* Normal case, PATH should fit into this buffer */ size = GetEnvironmentVariableW(ModifiedEnvironmentVariable, pResultBuffer, 0); /* To account for the nul character at the end of the string */ size = size + 1; pResultBuffer = malloc(sizeof(WCHAR)*size); if ( pResultBuffer == NULL ) { Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n"); } /* Try to retrieve the value of the first environment variable */ GetEnvironmentVariableW(ModifiedEnvironmentVariable, pResultBuffer, size); if ( pResultBuffer == NULL ) { free(pResultBuffer); Fail("ERROR: GetEnvironmentVariable failed to return a value " "from a proper environment variable with error %u.\n", GetLastError()); } /* Compare the strings to see that the correct variable was returned */ if(wcsncmp(pResultBuffer,FirstEnvironmentValue,wcslen(pResultBuffer)) != 0) { free(pResultBuffer); Fail("ERROR: The value in the buffer should have been '%S' but " "was really '%S'.\n",FirstEnvironmentValue, pResultBuffer); } free(pResultBuffer); PAL_Terminate(); return PASS; #else return PASS; #endif }
// // ASSection.h // AsyncDisplayKit // // Created by Huy Nguyen on 28/08/16. // // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. // #import <Foundation/Foundation.h> @protocol ASSectionContext; @interface ASSection : NSObject @property (nonatomic, assign, readonly) NSInteger sectionID; @property (nonatomic, strong, nullable, readonly) id<ASSectionContext> context; - (nullable instancetype)init __unavailable; - (nullable instancetype)initWithSectionID:(NSInteger)sectionID context:(nullable id<ASSectionContext>)context NS_DESIGNATED_INITIALIZER; @end
/* * Copyright (c) 2007-2012 SlimDX Group * * 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 #include "../ComObject.h" #include "../dxgi/Enums.h" #include "DeviceChild10.h" #include "Enums.h" #include "../dxgi/SwapChainDxgi.h" #include "../dxgi/SurfaceDxgi.h" #include "TextureLoadInformation10.h" namespace SlimDX { namespace Direct3D10 { /// <summary> /// A resource object. /// </summary> /// <unmanaged>ID3D10Resource</unmanaged> public ref class Resource abstract : public DeviceChild { COMOBJECT_BASE(ID3D10Resource); internal: static int GetMipSize( int mipSlice, int baseSliceSize ); static ID3D10Resource* ConstructFromFile( SlimDX::Direct3D10::Device^ device, System::String^ fileName, D3DX10_IMAGE_LOAD_INFO* info ); static ID3D10Resource* ConstructFromMemory( SlimDX::Direct3D10::Device^ device, array<System::Byte>^ memory, D3DX10_IMAGE_LOAD_INFO* info ); static ID3D10Resource* ConstructFromStream( SlimDX::Direct3D10::Device^ device, System::IO::Stream^ stream, int sizeInBytes, D3DX10_IMAGE_LOAD_INFO* info ); static Resource^ FromPointer( ID3D10Resource* pointer ); protected: Resource() { } public: /// <summary> /// Returns a DXGI Surface for this resource. /// </summary> /// <returns>The buffer interface, or <c>null</c> on failure.</returns> SlimDX::DXGI::Surface^ AsSurface(); /// <summary> /// Gets a swap chain back buffer. /// </summary> /// <typeparam name="T">The type of the buffer.</typeparam> /// <param name="swapChain">The swap chain to get the buffer from.</param> /// <param name="index">The index of the desired buffer.</param> /// <returns>The buffer interface, or <c>null</c> on failure.</returns> generic< class T > where T : Resource, ref class static T FromSwapChain( SlimDX::DXGI::SwapChain^ swapChain, int index ); static Resource^ FromPointer( System::IntPtr pointer ); /// <summary> /// Gets or sets the resource's eviction priority. /// </summary> property DXGI::ResourcePriority EvictionPriority { DXGI::ResourcePriority get(); void set(DXGI::ResourcePriority value); } /// <summary> /// Gets the resource's dimension (type). /// </summary> property ResourceDimension Dimension { ResourceDimension get(); } static Result SaveTextureToFile( Resource^ resource, ImageFileFormat destinationFormat, System::String^ destinationFile ); static Result LoadTextureFromTexture(Resource^ source, Resource^ destination, TextureLoadInformation loadInformation); static Result FilterTexture(Resource^ texture, int sourceLevel, FilterFlags mipFilter); /// <summary> /// Calculates a subresource index. /// </summary> /// <param name="mipSlice">The index of the desired mip slice.</param> /// <param name="arraySlice">The index of the desired array slice.</param> /// <param name="mipLevels">The total number of mip levels.</param> /// <returns>The subresource index (equivalent to mipSlice + (arraySlice * mipLevels)).</returns> static int CalculateSubresourceIndex( int mipSlice, int arraySlice, int mipLevels ); literal int MaximumMipLevels = D3D10_REQ_MIP_LEVELS; literal int ResourceSizeInMegabytes = D3D10_REQ_RESOURCE_SIZE_IN_MEGABYTES; literal int MaximumTexture1DArraySize = D3D10_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION; literal int MaximumTexture2DArraySize = D3D10_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION; literal int MaximumTexture1DSize = D3D10_REQ_TEXTURE1D_U_DIMENSION; literal int MaximumTexture2DSize = D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION; literal int MaximumTexture3DSize = D3D10_REQ_TEXTURE3D_U_V_OR_W_DIMENSION; literal int MaximumTextureCubeSize = D3D10_REQ_TEXTURECUBE_DIMENSION; }; } };
/* Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND * NON-INFRINGEMENT 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 __MACH_QDSP5_V2_SNDDEV_ECODEC_H #define __MACH_QDSP5_V2_SNDDEV_ECODEC_H #include <mach/qdsp5v2/audio_def.h> struct snddev_ecodec_data { u32 capability; /* RX or TX */ const char *name; u32 copp_id; /* audpp routing */ u32 acdb_id; /* Audio Cal purpose */ u8 channel_mode; u32 conf_pcm_ctl_val; u32 conf_aux_codec_intf; u32 conf_data_format_padding_val; u32 vol_idx; }; struct q5v2audio_ecodec_ops { void (*bt_sco_enable)(int en); }; void htc_7x30_register_ecodec_ops(struct q5v2audio_ecodec_ops *ops); #endif
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <shadow.h> #define LOOKUP_TYPE struct spwd #define SETFUNC_NAME setspent #define GETFUNC_NAME getspent #define ENDFUNC_NAME endspent #define DATABASE_NAME shadow #define BUFLEN 1024 #include "../nss/getXXent.c"
/* Default to -msecure-plt. Copyright (C) 2005-2013 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC 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 GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
// Copyright 2012 Google Inc. All Rights Reserved. // // This code is licensed under the same terms as WebM: // Software License Agreement: http://www.webmproject.org/license/software/ // Additional IP Rights Grant: http://www.webmproject.org/license/additional/ // ----------------------------------------------------------------------------- // // Lossless decoder: internal header. // // Author: Skal (pascal.massimino@gmail.com) // Vikas Arora(vikaas.arora@gmail.com) #ifndef WEBP_DEC_VP8LI_H_ #define WEBP_DEC_VP8LI_H_ #include <string.h> // for memcpy() #include "./webpi.h" #include "../utils/bit_reader.h" #include "../utils/color_cache.h" #include "../utils/huffman.h" #include "../webp/format_constants.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { READ_DATA = 0, READ_HDR = 1, READ_DIM = 2 } VP8LDecodeState; typedef struct VP8LTransform VP8LTransform; struct VP8LTransform { VP8LImageTransformType type_; // transform type. int bits_; // subsampling bits defining transform window. int xsize_; // transform window X index. int ysize_; // transform window Y index. uint32_t *data_; // transform data. }; typedef struct { HuffmanTree htrees_[HUFFMAN_CODES_PER_META_CODE]; } HTreeGroup; typedef struct { int color_cache_size_; VP8LColorCache color_cache_; int huffman_mask_; int huffman_subsample_bits_; int huffman_xsize_; uint32_t *huffman_image_; int num_htree_groups_; HTreeGroup *htree_groups_; } VP8LMetadata; typedef struct { VP8StatusCode status_; VP8LDecodeState action_; VP8LDecodeState state_; VP8Io *io_; const WebPDecBuffer *output_; // shortcut to io->opaque->output uint32_t *pixels_; // Internal data: either uint8_t* for alpha // or uint32_t* for BGRA. uint32_t *argb_cache_; // Scratch buffer for temporary BGRA storage. VP8LBitReader br_; int width_; int height_; int last_row_; // last input row decoded so far. int last_out_row_; // last row output so far. VP8LMetadata hdr_; int next_transform_; VP8LTransform transforms_[NUM_TRANSFORMS]; // or'd bitset storing the transforms types. uint32_t transforms_seen_; uint8_t *rescaler_memory; // Working memory for rescaling work. WebPRescaler *rescaler; // Common rescaler for all channels. } VP8LDecoder; //------------------------------------------------------------------------------ // internal functions. Not public. // in vp8l.c // Decodes a raw image stream (without header) and store the alpha data // into *output, which must be of size width x height. Returns false in case // of error. int VP8LDecodeAlphaImageStream(int width, int height, const uint8_t* const data, size_t data_size, uint8_t* const output); // Allocates and initialize a new lossless decoder instance. VP8LDecoder* VP8LNew(void); // Decodes the image header. Returns false in case of error. int VP8LDecodeHeader(VP8LDecoder* const dec, VP8Io* const io); // Decodes an image. It's required to decode the lossless header before calling // this function. Returns false in case of error, with updated dec->status_. int VP8LDecodeImage(VP8LDecoder* const dec); // Resets the decoder in its initial state, reclaiming memory. // Preserves the dec->status_ value. void VP8LClear(VP8LDecoder* const dec); // Clears and deallocate a lossless decoder instance. void VP8LDelete(VP8LDecoder* const dec); //------------------------------------------------------------------------------ #if defined(__cplusplus) || defined(c_plusplus) } // extern "C" #endif #endif /* WEBP_DEC_VP8LI_H_ */
#ifndef _PARISC_SEMBUF_H #define _PARISC_SEMBUF_H #include <asm/bitsperlong.h> /* * The semid64_ds structure for parisc architecture. * Note extra padding because this structure is passed back and forth * between kernel and user space. * * Pad space is left for: * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ struct semid64_ds { struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ #if __BITS_PER_LONG != 64 unsigned int __pad1; #endif __kernel_time_t sem_otime; /* last semop time */ #if __BITS_PER_LONG != 64 unsigned int __pad2; #endif __kernel_time_t sem_ctime; /* last change time */ unsigned long sem_nsems; /* no. of semaphores in array */ unsigned long __unused1; unsigned long __unused2; }; #endif /* _PARISC_SEMBUF_H */
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #pragma mark - // // File: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/CoreWiFi.framework/Versions/A/CoreWiFi // UUID: 5491896D-78C5-30B6-96E9-D8DDECF3BE73 // // Arch: x86_64 // Source version: 200.21.1.0.0 // Minimum Mac OS X version: 10.9.0 // SDK version: 10.9.0 // // Objective-C Garbage Collection: Unknown //
/* * Copyright (C) 2010 Samsung Electronics. 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, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA */ #ifndef __LINUX_TAOS_H #define __LINUX_TAOS_H #include <linux/types.h> #ifdef __KERNEL__ #define TAOS_OPT "taos-opt" #define MIN 1 #define WINTYPE_OTHERS '0' #define WINTYPE_WHITE '2' #define WHITEWINDOW_HI_THRESHOLD 720 #define WHITEWINDOW_LOW_THRESHOLD 590 #if defined(CONFIG_MACH_MELIUS_USC) || defined(CONFIG_MACH_MELIUS_SPR) #define BLACKWINDOW_HI_THRESHOLD 750 #define BLACKWINDOW_LOW_THRESHOLD 520 #else #define BLACKWINDOW_HI_THRESHOLD 650 #define BLACKWINDOW_LOW_THRESHOLD 520 #endif struct taos_platform_data { int als_int; u32 als_int_flags; #if defined(CONFIG_SEC_S_PROJECT) int enable; #endif void (*power)(bool); int (*light_adc_value)(void); void (*led_on)(bool); int prox_thresh_hi; int prox_thresh_low; int prox_th_hi_cal; int prox_th_low_cal; int als_time; int intr_filter; int prox_pulsecnt; int als_gain; int coef_atime; int ga; int coef_a; int coef_b; int coef_c; int coef_d; int min_max; }; #endif /*__KERNEL__*/ #endif
/******************************************************************************* * Copyright 2010 Broadcom Corporation. All rights reserved. * * @file include/linux/broadcom/bcm_memalloc_ioctl.h * * Unless you and Broadcom execute a separate written software license agreement * governing use of this software, this software is licensed to you under the * terms of the GNU General Public License version 2, available at * http://www.gnu.org/copyleft/gpl.html (the "GPL"). * * Notwithstanding the above, under no circumstances may you combine this * software in any way with any other Broadcom software provided under a license * other than the GPL, without Broadcom's express prior written consent. *******************************************************************************/ #ifndef _GEMEMALLOC_IOCTL_H_ #define _GEMEMALLOC_IOCTL_H_ #include <linux/ioctl.h> /* needed for the _IOW etc stuff used later */ /* * Ioctl definitions */ #define GEMEMALLOC_WRAP_MAGIC 'B' #define GEMEMALLOC_WRAP_ACQUIRE_BUFFER\ _IOWR(GEMEMALLOC_WRAP_MAGIC, 1, unsigned long) #define GEMEMALLOC_WRAP_RELEASE_BUFFER\ _IOW(GEMEMALLOC_WRAP_MAGIC, 2, unsigned long) #define GEMEMALLOC_WRAP_MAXNR 15 typedef struct { unsigned long busAddress; unsigned int size; } GEMemallocwrapParams; #endif /* _MEMALLOC_IOCTL_H_ */
/* * Copyright (c) 2012 Samsung Electronics Co., Ltd. * http://www.samsung.com * * 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/platform_device.h> #include "board-universal5410.h" #define CORESIGHT_PHYS_BASE 0x10880000 #define CORESIGHT_ETB_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x1000) #define CORESIGHT_TPIU_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x3000) #define CORESIGHT_FUNNEL_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x4000) #define CORESIGHT_ETM_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x1C000) static struct resource coresight_etb_resources[] = { { .start = CORESIGHT_ETB_PHYS_BASE, .end = CORESIGHT_ETB_PHYS_BASE + SZ_4K - 1, .flags = IORESOURCE_MEM, }, }; struct platform_device coresight_etb_device = { .name = "coresight_etb", .id = -1, .num_resources = ARRAY_SIZE(coresight_etb_resources), .resource = coresight_etb_resources, }; static struct resource coresight_tpiu_resources[] = { { .start = CORESIGHT_TPIU_PHYS_BASE, .end = CORESIGHT_TPIU_PHYS_BASE + SZ_4K - 1, .flags = IORESOURCE_MEM, }, }; struct platform_device coresight_tpiu_device = { .name = "coresight_tpiu", .id = -1, .num_resources = ARRAY_SIZE(coresight_tpiu_resources), .resource = coresight_tpiu_resources, }; static struct resource coresight_funnel_resources[] = { { .start = CORESIGHT_FUNNEL_PHYS_BASE, .end = CORESIGHT_FUNNEL_PHYS_BASE + SZ_4K - 1, .flags = IORESOURCE_MEM, }, }; struct platform_device coresight_funnel_device = { .name = "coresight_funnel", .id = -1, .num_resources = ARRAY_SIZE(coresight_funnel_resources), .resource = coresight_funnel_resources, }; static struct resource coresight_etm_resources[] = { { .start = CORESIGHT_ETM_PHYS_BASE, .end = CORESIGHT_ETM_PHYS_BASE + (SZ_4K * 2) - 1, .flags = IORESOURCE_MEM, }, }; struct platform_device coresight_etm_device = { .name = "coresight_etm", .id = -1, .num_resources = ARRAY_SIZE(coresight_etm_resources), .resource = coresight_etm_resources, }; static struct platform_device *coresight_devices[] __initdata = { &coresight_etb_device, &coresight_tpiu_device, &coresight_funnel_device, &coresight_etm_device, }; void __init exynos5_universal5410_coresight_init(void) { printk(KERN_ERR "[%s] initialization start!\n", __func__); platform_add_devices(coresight_devices, ARRAY_SIZE(coresight_devices)); };
//===-- NVPTXUtilities - Utilities -----------------------------*- C++ -*-====// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains the declaration of the NVVM specific utility functions. // //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXUTILITIES_H #define LLVM_LIB_TARGET_NVPTX_NVPTXUTILITIES_H #include "llvm/IR/Function.h" #include "llvm/IR/GlobalVariable.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/Value.h" #include <cstdarg> #include <set> #include <string> #include <vector> namespace llvm { void clearAnnotationCache(const Module *); bool findOneNVVMAnnotation(const GlobalValue *, const std::string &, unsigned &); bool findAllNVVMAnnotation(const GlobalValue *, const std::string &, std::vector<unsigned> &); bool isTexture(const Value &); bool isSurface(const Value &); bool isSampler(const Value &); bool isImage(const Value &); bool isImageReadOnly(const Value &); bool isImageWriteOnly(const Value &); bool isImageReadWrite(const Value &); bool isManaged(const Value &); std::string getTextureName(const Value &); std::string getSurfaceName(const Value &); std::string getSamplerName(const Value &); bool getMaxNTIDx(const Function &, unsigned &); bool getMaxNTIDy(const Function &, unsigned &); bool getMaxNTIDz(const Function &, unsigned &); bool getReqNTIDx(const Function &, unsigned &); bool getReqNTIDy(const Function &, unsigned &); bool getReqNTIDz(const Function &, unsigned &); bool getMinCTASm(const Function &, unsigned &); bool getMaxNReg(const Function &, unsigned &); bool isKernelFunction(const Function &); bool getAlign(const Function &, unsigned index, unsigned &); bool getAlign(const CallInst &, unsigned index, unsigned &); } #endif
#include <ccan/check_type/check_type.h> int main(int argc, char *argv[]) { #ifdef FAIL #if HAVE_TYPEOF check_type(argc, unsigned int); #else /* This doesn't work without typeof, so just fail */ #error "Fail without typeof" #endif #endif return 0; }
/* { dg-require-effective-target vect_int } */ #include <stdarg.h> #include "tree-vect.h" #define N 16 unsigned short out[N]; unsigned short in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; __attribute__ ((noinline)) int main1 () { int i; unsigned short *pin = &in[0]; unsigned short *pout = &out[0]; *pout++ = *pin++; *pout++ = *pin++; *pout++ = *pin++; *pout++ = *pin++; *pout++ = *pin++; *pout++ = *pin++; *pout++ = *pin++; *pout++ = *pin++; /* Check results. */ if (out[0] != in[0] || out[1] != in[1] || out[2] != in[2] || out[3] != in[3] || out[4] != in[4] || out[5] != in[5] || out[6] != in[6] || out[7] != in[7]) abort(); return 0; } int main (void) { check_vect (); main1 (); return 0; } /* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" } } */ /* { dg-final { cleanup-tree-dump "slp2" } } */
/* * Architecture specific mm hooks * * Copyright (C) 2015, IBM Corporation * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com> * * 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 _ASM_X86_MM_ARCH_HOOKS_H #define _ASM_X86_MM_ARCH_HOOKS_H #endif /* _ASM_X86_MM_ARCH_HOOKS_H */
/* * ll_types.c * * 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. * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <syslog.h> #include <fcntl.h> #include <sys/ioctl.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <netinet/in.h> #include <arpa/inet.h> #include <string.h> #include <linux/netdevice.h> #include <linux/if_arp.h> #include <linux/sockios.h> #include "rt_names.h" const char * ll_type_n2a(int type, char *buf, int len) { #define __PF(f,n) { ARPHRD_##f, #n }, static const struct { int type; const char *name; } arphrd_names[] = { { 0, "generic" }, __PF(ETHER,ether) __PF(EETHER,eether) __PF(AX25,ax25) __PF(PRONET,pronet) __PF(CHAOS,chaos) __PF(IEEE802,ieee802) __PF(ARCNET,arcnet) __PF(APPLETLK,atalk) __PF(DLCI,dlci) __PF(ATM,atm) __PF(METRICOM,metricom) __PF(IEEE1394,ieee1394) __PF(INFINIBAND,infiniband) __PF(SLIP,slip) __PF(CSLIP,cslip) __PF(SLIP6,slip6) __PF(CSLIP6,cslip6) __PF(RSRVD,rsrvd) __PF(ADAPT,adapt) __PF(ROSE,rose) __PF(X25,x25) __PF(HWX25,hwx25) __PF(CAN,can) __PF(PPP,ppp) __PF(HDLC,hdlc) __PF(LAPB,lapb) __PF(DDCMP,ddcmp) __PF(RAWHDLC,rawhdlc) __PF(TUNNEL,ipip) __PF(TUNNEL6,tunnel6) __PF(FRAD,frad) __PF(SKIP,skip) __PF(LOOPBACK,loopback) __PF(LOCALTLK,ltalk) __PF(FDDI,fddi) __PF(BIF,bif) __PF(SIT,sit) __PF(IPDDP,ip/ddp) __PF(IPGRE,gre) __PF(PIMREG,pimreg) __PF(HIPPI,hippi) __PF(ASH,ash) __PF(ECONET,econet) __PF(IRDA,irda) __PF(FCPP,fcpp) __PF(FCAL,fcal) __PF(FCPL,fcpl) __PF(FCFABRIC,fcfb0) __PF(FCFABRIC+1,fcfb1) __PF(FCFABRIC+2,fcfb2) __PF(FCFABRIC+3,fcfb3) __PF(FCFABRIC+4,fcfb4) __PF(FCFABRIC+5,fcfb5) __PF(FCFABRIC+6,fcfb6) __PF(FCFABRIC+7,fcfb7) __PF(FCFABRIC+8,fcfb8) __PF(FCFABRIC+9,fcfb9) __PF(FCFABRIC+10,fcfb10) __PF(FCFABRIC+11,fcfb11) __PF(FCFABRIC+12,fcfb12) __PF(IEEE802_TR,tr) __PF(IEEE80211,ieee802.11) __PF(IEEE80211_PRISM,ieee802.11/prism) __PF(IEEE80211_RADIOTAP,ieee802.11/radiotap) __PF(IEEE802154, ieee802.15.4) __PF(PHONET, phonet) __PF(PHONET_PIPE, phonet_pipe) __PF(CAIF, caif) __PF(IP6GRE, gre6) __PF(NETLINK, netlink) __PF(NONE, none) __PF(VOID,void) }; #undef __PF int i; for (i=0; i<sizeof(arphrd_names)/sizeof(arphrd_names[0]); i++) { if (arphrd_names[i].type == type) return arphrd_names[i].name; } snprintf(buf, len, "[%d]", type); return buf; }
// // ______ ______ ______ // /\ __ \ /\ ___\ /\ ___\ // \ \ __< \ \ __\_ \ \ __\_ // \ \_____\ \ \_____\ \ \_____\ // \/_____/ \/_____/ \/_____/ // // // Copyright (c) 2014-2015, Geek Zoo Studio // http://www.bee-framework.com // // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. // #import "Bee.h" #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) #pragma mark - @interface ServiceShare_TencentWeibo_Post : NSObject AS_SINGLETON( ServiceShare_TencentWeibo_Post ) @property (nonatomic, retain) NSString * text; @property (nonatomic, retain) id photo; @end #endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
/* * Copyright (c) 2013-2014 Chukong Technologies 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, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef __XMLHTTPHELPER_H__ #define __XMLHTTPHELPER_H__ #include "jsapi.h" #include "jsfriendapi.h" #include <typeinfo> #include <string> #include <memory> //#pragma mark - Helpful Macros #define JS_BINDED_CLASS_GLUE(klass) \ static JSClass js_class; \ static JSObject* js_proto; \ static JSObject* js_parent; \ static void _js_register(JSContext* cx, JS::HandleObject global); #define JS_BINDED_CLASS_GLUE_IMPL(klass) \ JSClass klass::js_class = {}; \ JSObject* klass::js_proto = NULL; \ JSObject* klass::js_parent = NULL; \ #define JS_BINDED_FUNC(klass, name) \ bool name(JSContext *cx, unsigned argc, jsval *vp) #define JS_BINDED_CONSTRUCTOR(klass) \ static bool _js_constructor(JSContext *cx, unsigned argc, jsval *vp) #define JS_BINDED_CONSTRUCTOR_IMPL(klass) \ bool klass::_js_constructor(JSContext *cx, unsigned argc, jsval *vp) #define JS_BINDED_FUNC_IMPL(klass, name) \ static bool klass##_func_##name(JSContext *cx, unsigned argc, jsval *vp) { \ JSObject* thisObj = JS_THIS_OBJECT(cx, vp); \ klass* obj = (klass*)JS_GetPrivate(thisObj); \ if (obj) { \ return obj->name(cx, argc, vp); \ } \ JS_ReportError(cx, "Invalid object call for function %s", #name); \ return false; \ } \ bool klass::name(JSContext *cx, unsigned argc, jsval *vp) #define JS_WRAP_OBJECT_IN_VAL(klass, cobj, out) \ do { \ JSObject *obj = JS_NewObject(cx, &klass::js_class, klass::js_proto, klass::js_parent); \ if (obj) { \ JS_SetPrivate(obj, cobj); \ out = OBJECT_TO_JSVAL(obj); \ } \ } while(0) \ #define JS_BINDED_FUNC_FOR_DEF(klass, name) \ JS_FN(#name, klass##_func_##name, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT) #define JS_BINDED_PROP_GET(klass, propName) \ bool _js_get_##propName(JSContext *cx, const JS::CallArgs& args) #define JS_BINDED_PROP_GET_IMPL(klass, propName) \ static bool _js_get_##klass##_##propName(JSContext *cx, unsigned argc, jsval *vp) { \ JS::CallArgs args = JS::CallArgsFromVp(argc, vp); \ JSObject* obj = args.thisv().toObjectOrNull(); \ klass* cobj = (klass*)JS_GetPrivate(obj); \ if (cobj) { \ return cobj->_js_get_##propName(cx, args); \ } \ JS_ReportError(cx, "Invalid getter call for property %s", #propName); \ return false; \ } \ bool klass::_js_get_##propName(JSContext *cx, const JS::CallArgs& args) #define JS_BINDED_PROP_SET(klass, propName) \ bool _js_set_##propName(JSContext *cx, const JS::CallArgs& args) #define JS_BINDED_PROP_SET_IMPL(klass, propName) \ static bool _js_set_##klass##_##propName(JSContext *cx, unsigned argc, jsval *vp) { \ JS::CallArgs args = JS::CallArgsFromVp(argc, vp); \ JSObject* obj = args.thisv().toObjectOrNull(); \ klass* cobj = (klass*)JS_GetPrivate(obj); \ if (cobj) { \ return cobj->_js_set_##propName(cx, args); \ } \ JS_ReportError(cx, "Invalid setter call for property %s", #propName); \ return false; \ } \ bool klass::_js_set_##propName(JSContext *cx, const JS::CallArgs& args) #define JS_BINDED_PROP_ACCESSOR(klass, propName) \ JS_BINDED_PROP_GET(klass, propName); \ JS_BINDED_PROP_SET(klass, propName); #define JS_BINDED_PROP_DEF_GETTER(klass, propName) \ JS_PSG(#propName, _js_get_##klass##_##propName, JSPROP_ENUMERATE | JSPROP_PERMANENT) #define JS_BINDED_PROP_DEF_ACCESSOR(klass, propName) \ JS_PSGS(#propName, _js_get_##klass##_##propName, _js_set_##klass##_##propName, JSPROP_ENUMERATE | JSPROP_PERMANENT) #define JS_CREATE_UINT_WRAPPED(valOut, propName, val) \ do { \ JSObject* jsobj = JS_NewObject(cx, NULL, NULL, NULL); \ jsval propVal = UINT_TO_JSVAL(val); \ JS_SetProperty(cx, jsobj, "__" propName, &propVal); \ valOut = OBJECT_TO_JSVAL(jsobj); \ } while(0) #define JS_GET_UINT_WRAPPED(inVal, propName, out) \ do { \ if (inVal.isObject()) {\ JSObject* jsobj = JSVAL_TO_OBJECT(inVal); \ jsval outVal; \ JS_GetProperty(cx, jsobj, "__" propName, &outVal); \ JS_ValueToECMAUint32(cx, outVal, &out); \ } else { \ int32_t tmp; \ JS_ValueToInt32(cx, inVal, &tmp); \ out = (uint32_t)tmp; \ } \ } while (0) #endif /* __XMLHTTPHELPER_H__ */
sound_type snd_make_quantize(sound_type s1, long steps); sound_type snd_quantize(sound_type s1, long steps); /* LISP: (snd-quantize SOUND FIXNUM) */