text
stringlengths
4
6.14k
/*************************************************************************** qgsmeshlayertemporalproperties.h ----------------------- begin : March 2020 copyright : (C) 2020 by Vincent Cloarec email : vcloarec 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 QGSMESHLAYERTEMPORALPROPERTIES_H #define QGSMESHLAYERTEMPORALPROPERTIES_H #include "qgsmaplayertemporalproperties.h" #include "qgsmeshdataprovidertemporalcapabilities.h" /** * \class QgsMeshLayerTemporalProperties * \ingroup core * \brief Implementation of map layer temporal properties for mesh layers. * * * The time in a mesh layer is defined by : * * - a reference time provided by the data, the project or the user * - each dataset is associated with a relative times * - time extent is defined by the first time and the last time of all dataset * * \code{.unparsed} * Reference time : AT * Dataset 1 time o-----RT------RT-----RT-----------RT * Dataset 2 time o---------RT------RT--------RT * Dataset 3 time o------------------------------RT-------RT----------RT * Time extent of layer o-----<---------------------------------------------> * * AT : absolute time (QDateTime) * RT : relative time (qint64) * \endcode * * \since QGIS 3.14 */ class CORE_EXPORT QgsMeshLayerTemporalProperties : public QgsMapLayerTemporalProperties { Q_OBJECT public: /** * Constructor for QgsMeshLayerTemporalProperties * * \param parent pointer to the parent object * \param enabled argument specifies whether the temporal properties are initially enabled or not (see isActive()). */ QgsMeshLayerTemporalProperties( QObject *parent SIP_TRANSFERTHIS = nullptr, bool enabled = true ); public: QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override; bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override; void setDefaultsFromDataProviderTemporalCapabilities( const QgsDataProviderTemporalCapabilities *capabilities ) override; QgsDateTimeRange calculateTemporalExtent( QgsMapLayer *layer ) const override SIP_SKIP; /** * Returns the time extent */ QgsDateTimeRange timeExtent() const; /** * Returns the reference time */ QDateTime referenceTime() const; /** * Sets the reference time and update the time extent from the temporal capabilities, * if the temporal capabilities is null, set a void time extent (reference time to reference time) * * \param referenceTime the reference time * \param capabilities the temporal capabilities of the data provider */ void setReferenceTime( const QDateTime &referenceTime, const QgsDataProviderTemporalCapabilities *capabilities ); /** * Returns the method used to match dataset from temporal capabilities */ QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod matchingMethod() const; /** * Sets the method used to match dataset from temporal capabilities * * \param matchingMethod the matching method */ void setMatchingMethod( const QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod &matchingMethod ); private: QDateTime mReferenceTime; QgsDateTimeRange mTimeExtent; QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod mMatchingMethod = QgsMeshDataProviderTemporalCapabilities::FindClosestDatasetBeforeStartRangeTime; }; #endif // QGSMESHLAYERTEMPORALPROPERTIES_H
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd * * The MIT License * * 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. */ const ENCODING *NS(XmlGetUtf8InternalEncoding)(void) { return &ns(internal_utf8_encoding).enc; } const ENCODING *NS(XmlGetUtf16InternalEncoding)(void) { #if XML_BYTE_ORDER == 12 return &ns(internal_little2_encoding).enc; #elif XML_BYTE_ORDER == 21 return &ns(internal_big2_encoding).enc; #else const short n = 1; return *(const char *)&n ? &ns(internal_little2_encoding).enc : &ns(internal_big2_encoding).enc; #endif } static const ENCODING *NS(encodings)[] = { &ns(latin1_encoding).enc, &ns(ascii_encoding).enc, &ns(utf8_encoding).enc, &ns(big2_encoding).enc, &ns(big2_encoding).enc, &ns(little2_encoding).enc, &ns(utf8_encoding).enc /* NO_ENC */ }; static int NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_PROLOG_STATE, ptr, end, nextTokPtr); } static int NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_CONTENT_STATE, ptr, end, nextTokPtr); } int NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr, const char *name) { int i = getEncodingIndex(name); if (i == UNKNOWN_ENC) return 0; SET_INIT_ENC_INDEX(p, i); p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog); p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent); p->initEnc.updatePosition = initUpdatePosition; p->encPtr = encPtr; *encPtr = &(p->initEnc); return 1; } static const ENCODING *NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) { #define ENCODING_MAX 128 char buf[ENCODING_MAX]; char *p = buf; int i; XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1); if (ptr != end) return 0; *p = 0; if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2) return enc; i = getEncodingIndex(buf); if (i == UNKNOWN_ENC) return 0; return NS(encodings)[i]; } int NS(XmlParseXmlDecl)(int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **encodingName, const ENCODING **encoding, int *standalone) { return doParseXmlDecl(NS(findEncoding), isGeneralTextEntity, enc, ptr, end, badPtr, versionPtr, encodingName, encoding, standalone); }
/******************************************************************************************* Copyright 2010 Broadcom Corporation. All rights reserved. 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. *******************************************************************************************/ /** * @file brcm_audio_thread.h * @brief API declaration of hardware abstraction layer for Audio driver. * This code is OS independent and Device independent for audio device control. ****************************************************************************/ #ifndef _BRCM_AUDIO_THREAD_H__ #define _BRCM_AUDIO_THREAD_H__ #define VOICE_CALL_SUB_DEVICE 12 //! The higher layer calls this Audio hardware abstraction layer to perform the following actions. This is expandable //! if audio controller need to handle more requests. typedef enum { ACTION_AUD_StartPlay, ACTION_AUD_StopPlay, ACTION_AUD_PausePlay, ACTION_AUD_ResumePlay, ACTION_AUD_StartRecord, ACTION_AUD_StopRecord, ACTION_AUD_OpenPlay, ACTION_AUD_ClosePlay, ACTION_AUD_OpenRecord, ACTION_AUD_CloseRecord, ACTON_VOICECALL_START, ACTON_VOICECALL_STOP, ACTON_VOICECALL_UPDATE, ACTON_FM_START, ACTON_FM_STOP, ACTON_ROUTE, ACTION_AUD_TOTAL, } BRCM_AUDIO_ACTION_en_t; typedef struct { void* drv_handle; UInt32 substream_number; UInt32 channels; UInt32 rate; }BRCM_AUDIO_Param_Start_t; typedef struct { void* drv_handle; UInt32 substream_number; }BRCM_AUDIO_Param_Stop_t; typedef struct { void* drv_handle; UInt32 substream_number; }BRCM_AUDIO_Param_Pause_t; typedef struct { void* drv_handle; UInt32 substream_number; UInt32 channels; UInt32 rate; }BRCM_AUDIO_Param_Resume_t; typedef struct { void* drv_handle; UInt32 substream_number; }BRCM_AUDIO_Param_Open_t; typedef struct { void* drv_handle; UInt32 substream_number; }BRCM_AUDIO_Param_Close_t; typedef struct { UInt32 substream_number; }BRCM_VOICE_Param_Start_t; typedef struct { UInt32 substream_number; }BRCM_VOICE_Param_Stop_t; typedef struct { UInt8 voicecall_codecId; }BRCM_VOICE_Param_Update_t; typedef struct { void* drv_handle; UInt32 substream_number; UInt32 channels; UInt32 rate; }BRCM_FM_Param_Start_t; typedef struct { void* drv_handle; UInt32 substream_number; }BRCM_FM_Param_Stop_t; typedef struct { UInt32 command; UInt32 speaker; }BRCM_AUDIO_Param_Route_t; typedef union{ BRCM_AUDIO_Param_Start_t param_start; BRCM_AUDIO_Param_Stop_t param_stop; BRCM_AUDIO_Param_Pause_t param_pause; BRCM_AUDIO_Param_Resume_t param_resume; BRCM_AUDIO_Param_Open_t param_open; BRCM_AUDIO_Param_Close_t param_close; BRCM_VOICE_Param_Start_t param_voice_start; BRCM_VOICE_Param_Stop_t param_voice_stop; BRCM_VOICE_Param_Update_t param_voice_update; BRCM_AUDIO_Param_Route_t param_route; } BRCM_AUDIO_Control_Params_un_t; int LaunchAudioCtrlThread(void); int TerminateAudioHalThread(void); Result_t AUDIO_Ctrl_Trigger( BRCM_AUDIO_ACTION_en_t action_code, void *arg_param, void *callback, int block ); #endif //_BRCM_AUDIO_THREAD_H__
/* * ntpsim.h - Prototypes for ntpsim */ #ifndef __ntpsim_h #define __ntpsim_h #include <stdio.h> #include <math.h> #include <sys/socket.h> #include <arpa/inet.h> #include "ntp_syslog.h" #include "ntp_fp.h" #include "ntp.h" #include "ntp_select.h" #include "ntp_malloc.h" #include "ntp_refclock.h" #include "recvbuff.h" #include "ntp_io.h" #include "ntp_stdlib.h" #define PI 3.1415926535 /* * ntpsim declarations */ typedef enum { BEEP, CLOCK, TIMER, PACKET } funcTkn; typedef struct { double time; union { struct pkt evnt_pkt; struct recvbuf evnt_buf; } buffer; #define ntp_pkt buffer.evnt_pkt #define rcv_buf buffer.evnt_buf funcTkn function; } Event; typedef struct List { Event event; struct List *next; } *Queue; typedef struct nde { double time; /* simulation time */ double sim_time; /* end simulation time */ double ntp_time; /* client disciplined time */ double adj; /* remaining time correction */ double slew; /* correction slew rate */ double clk_time; /* server time */ double ferr; /* frequency errort */ double fnse; /* random walk noise */ double ndly; /* network delay */ double snse; /* phase noise */ double pdly; /* processing delay */ double bdly; /* beep interval */ double last_time; /* last clock read time */ Queue events; /* Node Event Queue */ struct recvbuf *rbuflist; /* Node Receive Buffer */ } Node; /* * Function prototypes */ int ntpsim P((int argc, char *argv[])); Event event P((double, funcTkn)); Queue queue P((Event, Queue )); Node node P((void)); void push P((Event, Queue *)); Event pop P((Queue *)); void ndbeep P((Node *, Event)); void ndeclk P((Node *, Event)); void ntptmr P((Node *, Event)); void netpkt P((Node *, Event)); int srvr_rply P((Node *, struct sockaddr_storage *, struct interface *, struct pkt *)); double gauss P((double, double)); double poisson P((double, double)); int node_clock P((Node *, double)); void abortsim P((char *)); /* * The global Node */ Node ntp_node; #endif
/* * 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. * */ #include <common.h> #include <of.h> #include <init.h> #include <mach/revision.h> #include <mach/generic.h> static int __imx_silicon_revision = IMX_CHIP_REV_UNKNOWN; int imx_silicon_revision(void) { return __imx_silicon_revision; } void imx_set_silicon_revision(const char *soc, int revision) { __imx_silicon_revision = revision; printf("detected %s revision %d.%d\n", soc, (revision >> 4) & 0xf, revision & 0xf); } unsigned int __imx_cpu_type; static int imx_soc_from_dt(void) { if (of_machine_is_compatible("fsl,imx1")) return IMX_CPU_IMX1; if (of_machine_is_compatible("fsl,imx21")) return IMX_CPU_IMX21; if (of_machine_is_compatible("fsl,imx25")) return IMX_CPU_IMX25; if (of_machine_is_compatible("fsl,imx27")) return IMX_CPU_IMX27; if (of_machine_is_compatible("fsl,imx31")) return IMX_CPU_IMX31; if (of_machine_is_compatible("fsl,imx35")) return IMX_CPU_IMX35; if (of_machine_is_compatible("fsl,imx51")) return IMX_CPU_IMX51; if (of_machine_is_compatible("fsl,imx53")) return IMX_CPU_IMX53; if (of_machine_is_compatible("fsl,imx6q")) return IMX_CPU_IMX6; if (of_machine_is_compatible("fsl,imx6dl")) return IMX_CPU_IMX6; return 0; } static int imx_init(void) { int ret; struct device_node *root; root = of_get_root_node(); if (root) { __imx_cpu_type = imx_soc_from_dt(); if (!__imx_cpu_type) hang(); } if (cpu_is_mx1()) ret = imx1_init(); else if (cpu_is_mx21()) ret = imx21_init(); else if (cpu_is_mx25()) ret = imx25_init(); else if (cpu_is_mx27()) ret = imx27_init(); else if (cpu_is_mx31()) ret = imx31_init(); else if (cpu_is_mx35()) ret = imx35_init(); else if (cpu_is_mx51()) ret = imx51_init(); else if (cpu_is_mx53()) ret = imx53_init(); else if (cpu_is_mx6()) ret = imx6_init(); else return -EINVAL; if (root) return ret; if (cpu_is_mx1()) ret = imx1_devices_init(); else if (cpu_is_mx21()) ret = imx21_devices_init(); else if (cpu_is_mx25()) ret = imx25_devices_init(); else if (cpu_is_mx27()) ret = imx27_devices_init(); else if (cpu_is_mx31()) ret = imx31_devices_init(); else if (cpu_is_mx35()) ret = imx35_devices_init(); else if (cpu_is_mx51()) ret = imx51_devices_init(); else if (cpu_is_mx53()) ret = imx53_devices_init(); else if (cpu_is_mx6()) ret = imx6_devices_init(); else return -EINVAL; return ret; } postcore_initcall(imx_init);
/* { dg-options "-O2 -ftree-vectorize -msve-vector-bits=512" } */ #include <stdint.h> void f1 (uint32_t *dst, uint16_t *src1, int8_t *src2) { for (int i = 0; i < 7; ++i) dst[i] += (int16_t) (src1[i] + src2[i]); } /* { dg-final { scan-assembler-times {\tld1sb\tz[0-9]+\.s,} 1 } } */ /* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.s,} 1 } } */ /* { dg-final { scan-assembler-times {\tld1w\tz[0-9]+\.s,} 1 } } */ /* { dg-final { scan-assembler-times {\tadd\tz} 2 } } */ /* { dg-final { scan-assembler-times {\tadd\tz[0-9]+\.h, z[0-9]+\.h, z[0-9]+\.h\n} 1 } } */ /* { dg-final { scan-assembler-times {\tadd\tz[0-9]+\.s, z[0-9]+\.s, z[0-9]+\.s\n} 1 } } */ /* { dg-final { scan-assembler-times {\tsxt.\t} 1 } } */ /* { dg-final { scan-assembler-times {\tsxth\tz[0-9]+\.s,} 1 } } */
//========================================================================== // // hal_boot.c // // SPARClite Architecture specific interrupt dispatch tables // //========================================================================== // ####ECOSGPLCOPYRIGHTBEGIN#### // ------------------------------------------- // This file is part of eCos, the Embedded Configurable Operating System. // Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. // // eCos is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free // Software Foundation; either version 2 or (at your option) any later // version. // // eCos 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 eCos; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // As a special exception, if other files instantiate templates or use // macros or inline functions from this file, or you compile this file // and link it with other works to produce a work based on this file, // this file does not by itself cause the resulting work to be covered by // the GNU General Public License. However the source code for this file // must still be made available in accordance with section (3) of the GNU // General Public License v2. // // This exception does not invalidate any other reasons why a work based // on this file might be covered by the GNU General Public License. // ------------------------------------------- // ####ECOSGPLCOPYRIGHTEND#### //========================================================================== //#####DESCRIPTIONBEGIN#### // // Author(s): hmt // Contributors: hmt // Date: 1998-12-10 // Purpose: Interrupt handler tables for SPARClite. // //####DESCRIPTIONEND#### // //========================================================================== #include <pkgconf/hal.h> #include <cyg/infra/cyg_type.h> /*------------------------------------------------------------------------*/ /* calling this is our raison d'etre: */ extern void cyg_start( void ); /*------------------------------------------------------------------------*/ /* data copy and bss zero functions */ typedef void (CYG_ROM_ADDRESS)(void); #ifdef CYG_HAL_STARTUP_ROM void hal_copy_data(void) { extern char __ram_data_start; extern char __ram_data_end; extern CYG_ROM_ADDRESS __rom_data_start; long *p = (long *)&__ram_data_start; long *q = (long *)&__rom_data_start; while( p <= (long *)&__ram_data_end ) *p++ = *q++; } #endif void hal_zero_bss(void) { extern CYG_ROM_ADDRESS __bss_start; extern CYG_ROM_ADDRESS __bss_end; register long long zero = 0; register long long *end = (long long *)&__bss_end; register long long *p = (long long *)&__bss_start; while( p <= end ) *p++ = zero; } #ifdef CYGSEM_HAL_STOP_CONSTRUCTORS_ON_FLAG cyg_bool cyg_hal_stop_constructors; #endif void cyg_hal_invoke_constructors (void) { typedef void (*pfunc) (void); extern pfunc __CTOR_LIST__[]; extern pfunc __CTOR_END__[]; #ifdef CYGSEM_HAL_STOP_CONSTRUCTORS_ON_FLAG static pfunc *p = &__CTOR_END__[-1]; cyg_hal_stop_constructors = 0; for (; p >= __CTOR_LIST__; p--) { (*p) (); if (cyg_hal_stop_constructors) { p--; break; } } #else pfunc *p; for (p = &__CTOR_END__[-1]; p >= __CTOR_LIST__; p--) (*p) (); #endif } // Override any __gccmain the compiler might generate. We don't want // constructors to be called twice. void __gccmain(void) {} /*------------------------------------------------------------------------*/ /* CYG_HAL_START - pre-main-entrypoint */ #ifdef CYGPKG_HAL_SPARCLITE_SLEB #define SLEB_LED (*(volatile char *)(0x02000003)) #define LED( _x_ ) SLEB_LED = (char)(0xff & ~(_x_)) #else #define LED( _x_ ) CYG_EMPTY_STATEMENT #endif extern void hal_board_prestart( void ); extern void hal_board_poststart( void ); // This is called with traps enabled, but interrupts masked out: // Be sure to enable them in hal_board_poststart() at the latest. void cyg_hal_start( void ) { /* Board specific prestart that's best done in C */ hal_board_prestart(); LED( 0xd0 ); #ifdef CYG_HAL_STARTUP_ROM /* Copy data from ROM to RAM */ hal_copy_data(); #endif LED( 0xd4 ); /* Zero BSS */ hal_zero_bss(); LED( 0xd8 ); /* Call constructors */ cyg_hal_invoke_constructors(); LED( 0xdc ); /* Board specific late startup that's best done in C */ hal_board_poststart(); LED( 0xf8 ); /* Call cyg_start */ cyg_start(); /* does not return */ } // EOF hal_boot.c
/** * \file havege.h * * \brief HAVEGE: HArdware Volatile Entropy Gathering and Expansion * * Copyright (C) 2006-2013, ARM Limited, All Rights Reserved * * This file is part of mbed TLS (https://tls.mbed.org) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef MBEDTLS_HAVEGE_H #define MBEDTLS_HAVEGE_H #include <stddef.h> #define MBEDTLS_HAVEGE_COLLECT_SIZE 1024 #ifdef __cplusplus extern "C" { #endif /** * \brief HAVEGE state structure */ typedef struct { int PT1, PT2, offset[2]; int pool[MBEDTLS_HAVEGE_COLLECT_SIZE]; int WALK[8192]; } mbedtls_havege_state; /** * \brief HAVEGE initialization * * \param hs HAVEGE state to be initialized */ void mbedtls_havege_init( mbedtls_havege_state *hs ); /** * \brief Clear HAVEGE state * * \param hs HAVEGE state to be cleared */ void mbedtls_havege_free( mbedtls_havege_state *hs ); /** * \brief HAVEGE rand function * * \param p_rng A HAVEGE state * \param output Buffer to fill * \param len Length of buffer * * \return 0 */ int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len ); #ifdef __cplusplus } #endif #endif /* havege.h */
#include <stdbool.h> #include <stdint.h> #include <string.h> #include "platform.h" #include "nvic.h" #include "io_impl.h" #include "exti.h" #ifdef USE_EXTI typedef struct { extiCallbackRec_t* handler; } extiChannelRec_t; extiChannelRec_t extiChannelRecs[16]; // IRQ gouping, same on 103 and 303 #define EXTI_IRQ_GROUPS 7 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 static const uint8_t extiGroups[16] = { 0, 1, 2, 3, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6 }; static uint8_t extiGroupPriority[EXTI_IRQ_GROUPS]; #if defined(STM32F1) || defined(STM32F4) || defined(STM32F7) static const uint8_t extiGroupIRQn[EXTI_IRQ_GROUPS] = { EXTI0_IRQn, EXTI1_IRQn, EXTI2_IRQn, EXTI3_IRQn, EXTI4_IRQn, EXTI9_5_IRQn, EXTI15_10_IRQn }; #elif defined(STM32F3) static const uint8_t extiGroupIRQn[EXTI_IRQ_GROUPS] = { EXTI0_IRQn, EXTI1_IRQn, EXTI2_TS_IRQn, EXTI3_IRQn, EXTI4_IRQn, EXTI9_5_IRQn, EXTI15_10_IRQn }; #else # warning "Unknown CPU" #endif void EXTIInit(void) { #if defined(STM32F1) // enable AFIO for EXTI support RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE); #endif #if defined(STM32F3) || defined(STM32F4) /* Enable SYSCFG clock otherwise the EXTI irq handlers are not called */ RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE); #ifdef REMAP_TIM16_DMA SYSCFG_DMAChannelRemapConfig(SYSCFG_DMARemap_TIM16, ENABLE); #endif #ifdef REMAP_TIM17_DMA SYSCFG_DMAChannelRemapConfig(SYSCFG_DMARemap_TIM17, ENABLE); #endif #endif memset(extiChannelRecs, 0, sizeof(extiChannelRecs)); memset(extiGroupPriority, 0xff, sizeof(extiGroupPriority)); } void EXTIHandlerInit(extiCallbackRec_t *self, extiHandlerCallback *fn) { self->fn = fn; } #if defined(STM32F7) void EXTIConfig(IO_t io, extiCallbackRec_t *cb, int irqPriority, ioConfig_t config) { (void)config; int chIdx; chIdx = IO_GPIOPinIdx(io); if(chIdx < 0) return; extiChannelRec_t *rec = &extiChannelRecs[chIdx]; int group = extiGroups[chIdx]; GPIO_InitTypeDef init = { .Pin = IO_Pin(io), .Mode = GPIO_MODE_IT_RISING, .Speed = GPIO_SPEED_FREQ_LOW, .Pull = GPIO_NOPULL, }; HAL_GPIO_Init(IO_GPIO(io), &init); rec->handler = cb; //uint32_t extiLine = IO_EXTI_Line(io); //EXTI_ClearITPendingBit(extiLine); if(extiGroupPriority[group] > irqPriority) { extiGroupPriority[group] = irqPriority; HAL_NVIC_SetPriority(extiGroupIRQn[group], NVIC_PRIORITY_BASE(irqPriority), NVIC_PRIORITY_SUB(irqPriority)); HAL_NVIC_EnableIRQ(extiGroupIRQn[group]); } } #else void EXTIConfig(IO_t io, extiCallbackRec_t *cb, int irqPriority, EXTITrigger_TypeDef trigger) { int chIdx; chIdx = IO_GPIOPinIdx(io); if(chIdx < 0) return; extiChannelRec_t *rec = &extiChannelRecs[chIdx]; int group = extiGroups[chIdx]; rec->handler = cb; #if defined(STM32F10X) GPIO_EXTILineConfig(IO_GPIO_PortSource(io), IO_GPIO_PinSource(io)); #elif defined(STM32F303xC) SYSCFG_EXTILineConfig(IO_EXTI_PortSourceGPIO(io), IO_EXTI_PinSource(io)); #elif defined(STM32F4) SYSCFG_EXTILineConfig(IO_EXTI_PortSourceGPIO(io), IO_EXTI_PinSource(io)); #else # warning "Unknown CPU" #endif uint32_t extiLine = IO_EXTI_Line(io); EXTI_ClearITPendingBit(extiLine); EXTI_InitTypeDef EXTIInit; EXTIInit.EXTI_Line = extiLine; EXTIInit.EXTI_Mode = EXTI_Mode_Interrupt; EXTIInit.EXTI_Trigger = trigger; EXTIInit.EXTI_LineCmd = ENABLE; EXTI_Init(&EXTIInit); if(extiGroupPriority[group] > irqPriority) { extiGroupPriority[group] = irqPriority; NVIC_InitTypeDef NVIC_InitStructure; NVIC_InitStructure.NVIC_IRQChannel = extiGroupIRQn[group]; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = NVIC_PRIORITY_BASE(irqPriority); NVIC_InitStructure.NVIC_IRQChannelSubPriority = NVIC_PRIORITY_SUB(irqPriority); NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); } } #endif void EXTIRelease(IO_t io) { // don't forget to match cleanup with config EXTIEnable(io, false); int chIdx; chIdx = IO_GPIOPinIdx(io); if(chIdx < 0) return; extiChannelRec_t *rec = &extiChannelRecs[chIdx]; rec->handler = NULL; } void EXTIEnable(IO_t io, bool enable) { #if defined(STM32F1) || defined(STM32F4) || defined(STM32F7) uint32_t extiLine = IO_EXTI_Line(io); if(!extiLine) return; if(enable) EXTI->IMR |= extiLine; else EXTI->IMR &= ~extiLine; #elif defined(STM32F303xC) int extiLine = IO_EXTI_Line(io); if(extiLine < 0) return; // assume extiLine < 32 (valid for all EXTI pins) if(enable) EXTI->IMR |= 1 << extiLine; else EXTI->IMR &= ~(1 << extiLine); #else # error "Unsupported target" #endif } void EXTI_IRQHandler(void) { uint32_t exti_active = EXTI->IMR & EXTI->PR; while(exti_active) { unsigned idx = 31 - __builtin_clz(exti_active); uint32_t mask = 1 << idx; extiChannelRecs[idx].handler->fn(extiChannelRecs[idx].handler); EXTI->PR = mask; // clear pending mask (by writing 1) exti_active &= ~mask; } } #define _EXTI_IRQ_HANDLER(name) \ void name(void) { \ EXTI_IRQHandler(); \ } \ struct dummy \ /**/ _EXTI_IRQ_HANDLER(EXTI0_IRQHandler); _EXTI_IRQ_HANDLER(EXTI1_IRQHandler); #if defined(STM32F1) || defined(STM32F7) _EXTI_IRQ_HANDLER(EXTI2_IRQHandler); #elif defined(STM32F3) || defined(STM32F4) _EXTI_IRQ_HANDLER(EXTI2_TS_IRQHandler); #else # warning "Unknown CPU" #endif _EXTI_IRQ_HANDLER(EXTI3_IRQHandler); _EXTI_IRQ_HANDLER(EXTI4_IRQHandler); _EXTI_IRQ_HANDLER(EXTI9_5_IRQHandler); _EXTI_IRQ_HANDLER(EXTI15_10_IRQHandler); #endif
/* * Copyright (C) 2013 Imagination Technologies * Author: Paul Burton <paul.burton@imgtec.com> * * Setup code for the FDC37M817 super I/O controller * * SPDX-License-Identifier: GPL-2.0+ */ #include <common.h> #include <asm/io.h> #define SIO_CONF_PORT 0x3f0 #define SIO_DATA_PORT 0x3f1 enum sio_conf_key { SIOCONF_DEVNUM = 0x07, SIOCONF_ACTIVATE = 0x30, SIOCONF_ENTER_SETUP = 0x55, SIOCONF_BASE_HIGH = 0x60, SIOCONF_BASE_LOW = 0x61, SIOCONF_PRIMARY_INT = 0x70, SIOCONF_EXIT_SETUP = 0xaa, SIOCONF_MODE = 0xf0, }; static struct { u8 key; u8 data; } sio_config[] = { /* tty0 */ { SIOCONF_DEVNUM, 0x04 }, { SIOCONF_BASE_HIGH, 0x03 }, { SIOCONF_BASE_LOW, 0xf8 }, { SIOCONF_MODE, 0x02 }, { SIOCONF_PRIMARY_INT, 0x04 }, { SIOCONF_ACTIVATE, 0x01 }, /* tty1 */ { SIOCONF_DEVNUM, 0x05 }, { SIOCONF_BASE_HIGH, 0x02 }, { SIOCONF_BASE_LOW, 0xf8 }, { SIOCONF_MODE, 0x02 }, { SIOCONF_PRIMARY_INT, 0x03 }, { SIOCONF_ACTIVATE, 0x01 }, }; void malta_superio_init(void) { unsigned i; /* enter config state */ outb(SIOCONF_ENTER_SETUP, SIO_CONF_PORT); /* configure peripherals */ for (i = 0; i < ARRAY_SIZE(sio_config); i++) { outb(sio_config[i].key, SIO_CONF_PORT); outb(sio_config[i].data, SIO_DATA_PORT); } /* exit config state */ outb(SIOCONF_EXIT_SETUP, SIO_CONF_PORT); }
// Copyright 2015 Google Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #import <Foundation/Foundation.h> /** * CRITICAL: All OAuth access (bearer) tokens are generated from the Google SignIn classes. If you * aren't using Google SignIn, get rid of this header and re-implement * +(NSString *)oauthBearerToken; with how you get your OAuth 2.0 access token. */ #import <Google/SignIn.h> /** * Most of the methods in this class return an errorInfo dictionary. This controls the key * information in them. Status is guaranteed to be there, the others are not. */ extern NSString *const kDiagnosticsRequestErrorStatus; extern NSString *const kDiagnosticsRequestErrorMessage; extern NSString *const kDiagnosticsRequestErrorObject; /** *=----------------------------------------------------------------------------------------------= * BSDDiagnosticsAPI Interface *=----------------------------------------------------------------------------------------------= */ @interface BSDDiagnosticsAPI : NSObject + (void)diagnosticsInfoForBeaconID:(NSString *)beaconID resultingPageSize:(NSNumber *)pageSize pageToken:(NSString *)pageToken alertFilter:(NSString *)alertFilter completionHandler:(void (^)(NSDictionary *, NSDictionary *))completionHandler; @end
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Developer tools consist of the following parts: // // DevToolsAgent lives in the renderer of an inspected page and provides access // to the pages resources, DOM, v8 etc. by means of IPC messages. // // DevToolsClient is a thin delegate that lives in the tools front-end // renderer and converts IPC messages to frontend method calls and allows the // frontend to send messages to the DevToolsAgent. // // All the messages are routed through browser process. There is a // DevToolsManager living in the browser process that is responsible for // routing logistics. It is also capable of sending direct messages to the // agent rather than forwarding messages between agents and clients only. // // Chain of communication between the components may be described by the // following diagram: // ---------------------------- // | (tools frontend | // | renderer process) | // | | -------------------- // |tools <--> DevToolsClient+<-- IPC -->+ (browser process) | // |frontend | | | // ---------------------------- ---------+---------- // ^ // | // IPC // | // v // --------------------------+-------- // | inspected page <--> DevToolsAgent | // | | // | (inspected page renderer process) | // ----------------------------------- // // This file describes developer tools message types. // Multiply-included message file, no standard include guard. #include <map> #include <string> #include "content/common/content_export.h" #include "content/public/common/common_param_traits.h" #include "content/public/common/console_message_level.h" #include "ipc/ipc_message_macros.h" #undef IPC_MESSAGE_EXPORT #define IPC_MESSAGE_EXPORT CONTENT_EXPORT #define IPC_MESSAGE_START DevToolsMsgStart // These are messages sent from DevToolsAgent to DevToolsClient through the // browser. // WebKit-level transport. // Sends response from the agent to the client. Supports chunked encoding. // First (the only) chunk arrives with the |total_size| != 0, // remaining chunks arrive with |total_size| == 0. IPC_MESSAGE_ROUTED2(DevToolsClientMsg_DispatchOnInspectorFrontend, std::string /* message */, uint32 /* total_size */) //----------------------------------------------------------------------------- // These are messages sent from DevToolsClient to DevToolsAgent through the // browser. // Tells agent that there is a client host connected to it. IPC_MESSAGE_ROUTED1(DevToolsAgentMsg_Attach, std::string /* host_id */) // Tells agent that a client host was disconnected from another agent and // connected to this one. IPC_MESSAGE_ROUTED2(DevToolsAgentMsg_Reattach, std::string /* host_id */, std::string /* agent_state */) // Tells agent that there is no longer a client host connected to it. IPC_MESSAGE_ROUTED0(DevToolsAgentMsg_Detach) // WebKit-level transport. IPC_MESSAGE_ROUTED1(DevToolsAgentMsg_DispatchOnInspectorBackend, std::string /* message */) // Inspect element with the given coordinates. IPC_MESSAGE_ROUTED3(DevToolsAgentMsg_InspectElement, std::string /* host_id */, int /* x */, int /* y */) // Add message to the devtools console. IPC_MESSAGE_ROUTED2(DevToolsAgentMsg_AddMessageToConsole, content::ConsoleMessageLevel /* level */, std::string /* message */) //----------------------------------------------------------------------------- // These are messages sent from the browser to the renderer. // RenderViewHostDelegate::RenderViewCreated method sends this message to a // new renderer to notify it that it will host developer tools UI and should // set up all neccessary bindings and create DevToolsClient instance that // will handle communication with inspected page DevToolsAgent. IPC_MESSAGE_ROUTED0(DevToolsMsg_SetupDevToolsClient) //----------------------------------------------------------------------------- // These are messages sent from the renderer to the browser. // Transport from Inspector frontend to frontend host. IPC_MESSAGE_ROUTED1(DevToolsHostMsg_DispatchOnEmbedder, std::string /* message */) // Updates agent runtime state stored in devtools manager in order to support // cross-navigation instrumentation. IPC_MESSAGE_ROUTED1(DevToolsHostMsg_SaveAgentRuntimeState, std::string /* state */) //----------------------------------------------------------------------------- // These are messages sent from the GPU process to the inspected renderer. IPC_STRUCT_BEGIN(GpuTaskInfo) IPC_STRUCT_MEMBER(double, timestamp) IPC_STRUCT_MEMBER(int, phase) IPC_STRUCT_MEMBER(bool, foreign) IPC_STRUCT_MEMBER(uint64, gpu_memory_used_bytes) IPC_STRUCT_MEMBER(uint64, gpu_memory_limit_bytes) IPC_STRUCT_END() // Recorded events are passed in chunks to the renderer process. IPC_MESSAGE_ROUTED1(DevToolsAgentMsg_GpuTasksChunk, std::vector<GpuTaskInfo> /* gpu_tasks */) //----------------------------------------------------------------------------- // These are messages sent from the inspected page renderer to the worker // renderer.
/* * Copyright 2011 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkBitmapRegionDecoder_DEFINED #define SkBitmapRegionDecoder_DEFINED #include "SkBitmap.h" #include "SkImageDecoder.h" #include "SkStream.h" struct SkIRect; /** * SkBitmapRegionDecoder can be used to decode a specified rect from an image. * This is particularly useful when the original image is large and you only * need parts of the image. * * However, not all image codecs on all platforms support this feature so be * prepared to fallback to standard decoding if decodeRegion(...) returns false. */ class SkBitmapRegionDecoder { public: SkBitmapRegionDecoder(SkImageDecoder* decoder, SkStream* stream, int width, int height) { fDecoder = decoder; fStream = stream; fWidth = width; fHeight = height; } ~SkBitmapRegionDecoder() { SkDELETE(fDecoder); SkSafeUnref(fStream); } bool decodeRegion(SkBitmap* bitmap, const SkIRect& rect, SkBitmap::Config pref, int sampleSize); SkImageDecoder* getDecoder() const { return fDecoder; } int getWidth() const { return fWidth; } int getHeight() const { return fHeight; } private: SkImageDecoder* fDecoder; SkStream* fStream; int fWidth; int fHeight; }; #endif
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation http://www.xiph.org/ * * * ******************************************************************** function: single-block PCM analysis mode dispatch last mod: $Id: analysis.c 13293 2007-07-24 00:09:47Z xiphmont $ ********************************************************************/ #include <stdio.h> #include <string.h> #include <math.h> #include <ogg/ogg.h> #include "vorbis/codec.h" #include "codec_internal.h" #include "registry.h" #include "scales.h" #include "os.h" #include "misc.h" int analysis_noisy=1; /* decides between modes, dispatches to the appropriate mapping. */ int vorbis_analysis(vorbis_block *vb, ogg_packet *op){ int ret,i; vorbis_block_internal *vbi=vb->internal; vb->glue_bits=0; vb->time_bits=0; vb->floor_bits=0; vb->res_bits=0; /* first things first. Make sure encode is ready */ for(i=0;i<PACKETBLOBS;i++) oggpack_reset(vbi->packetblob[i]); /* we only have one mapping type (0), and we let the mapping code itself figure out what soft mode to use. This allows easier bitrate management */ if((ret=_mapping_P[0]->forward(vb))) return(ret); if(op){ if(vorbis_bitrate_managed(vb)) /* The app is using a bitmanaged mode... but not using the bitrate management interface. */ return(OV_EINVAL); op->packet=oggpack_get_buffer(&vb->opb); op->bytes=oggpack_bytes(&vb->opb); op->b_o_s=0; op->e_o_s=vb->eofflag; op->granulepos=vb->granulepos; op->packetno=vb->sequence; /* for sake of completeness */ } return(0); } /* there was no great place to put this.... */ void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB,ogg_int64_t off){ int j; FILE *of; char buffer[80]; /* if(i==5870){*/ sprintf(buffer,"%s_%d.m",base,i); of=fopen(buffer,"w"); if(!of)perror("failed to open data dump file"); for(j=0;j<n;j++){ if(bark){ float b=toBARK((4000.f*j/n)+.25); fprintf(of,"%f ",b); }else if(off!=0) fprintf(of,"%f ",(double)(j+off)/8000.); else fprintf(of,"%f ",(double)j); if(dB){ float val; if(v[j]==0.) val=-140.; else val=todB(v+j); fprintf(of,"%f\n",val); }else{ fprintf(of,"%f\n",v[j]); } } fclose(of); /* } */ } void _analysis_output(char *base,int i,float *v,int n,int bark,int dB, ogg_int64_t off){ if(analysis_noisy)_analysis_output_always(base,i,v,n,bark,dB,off); }
/* vim: set expandtab ts=4 sw=4: */ /* * You may redistribute this program 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/>. */ #ifndef RumorMill_H #define RumorMill_H #include "dht/Address.h" #include "memory/Allocator.h" #include "util/log/Log.h" #include "util/Gcc.h" #include "util/Linker.h" Linker_require("dht/dhtcore/RumorMill.c") struct RumorMill_admin { int unused; }; /** * Make a RumorMill available to be queried from the RPC interface. */ void RouterMill_admin_exposeMill(struct RouterMill_admin* rma, struct RumorMill* rm); struct RouterMill_admin* RouterMill_admin_register(struct Admin* admin); #endif
#ifndef TSAN_INTERCEPTORS_H #define TSAN_INTERCEPTORS_H #include "sanitizer_common/sanitizer_stacktrace.h" #include "tsan_rtl.h" namespace __tsan { class ScopedInterceptor { public: ScopedInterceptor(ThreadState *thr, const char *fname, uptr pc); ~ScopedInterceptor(); void UserCallbackStart(); void UserCallbackEnd(); private: ThreadState *const thr_; const uptr pc_; bool in_ignored_lib_; }; } // namespace __tsan #define SCOPED_INTERCEPTOR_RAW(func, ...) \ ThreadState *thr = cur_thread(); \ const uptr caller_pc = GET_CALLER_PC(); \ ScopedInterceptor si(thr, #func, caller_pc); \ const uptr pc = StackTrace::GetCurrentPc(); \ (void)pc; \ /**/ #define SCOPED_TSAN_INTERCEPTOR(func, ...) \ SCOPED_INTERCEPTOR_RAW(func, __VA_ARGS__); \ if (REAL(func) == 0) { \ Report("FATAL: ThreadSanitizer: failed to intercept %s\n", #func); \ Die(); \ } \ if (!thr->is_inited || thr->ignore_interceptors || thr->in_ignored_lib) \ return REAL(func)(__VA_ARGS__); \ /**/ #define SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_START() \ si.UserCallbackStart(); #define SCOPED_TSAN_INTERCEPTOR_USER_CALLBACK_END() \ si.UserCallbackEnd(); #define TSAN_INTERCEPTOR(ret, func, ...) INTERCEPTOR(ret, func, __VA_ARGS__) #endif // TSAN_INTERCEPTORS_H
#include <stdio.h> #include <time.h> int clar_summary_close_tag( struct clar_summary *summary, const char *tag, int indent) { const char *indt; if (indent == 0) indt = ""; else if (indent == 1) indt = "\t"; else indt = "\t\t"; return fprintf(summary->fp, "%s</%s>\n", indt, tag); } int clar_summary_testsuites(struct clar_summary *summary) { return fprintf(summary->fp, "<testsuites>\n"); } int clar_summary_testsuite(struct clar_summary *summary, int idn, const char *name, const char *pkg, time_t timestamp, double elapsed, int test_count, int fail_count, int error_count) { struct tm *tm = localtime(&timestamp); char iso_dt[20]; if (strftime(iso_dt, sizeof(iso_dt), "%Y-%m-%dT%H:%M:%S", tm) == 0) return -1; return fprintf(summary->fp, "\t<testsuite " " id=\"%d\"" " name=\"%s\"" " package=\"%s\"" " hostname=\"localhost\"" " timestamp=\"%s\"" " time=\"%.2f\"" " tests=\"%d\"" " failures=\"%d\"" " errors=\"%d\">\n", idn, name, pkg, iso_dt, elapsed, test_count, fail_count, error_count); } int clar_summary_testcase(struct clar_summary *summary, const char *name, const char *classname, double elapsed) { return fprintf(summary->fp, "\t\t<testcase name=\"%s\" classname=\"%s\" time=\"%.2f\">\n", name, classname, elapsed); } int clar_summary_failure(struct clar_summary *summary, const char *type, const char *message, const char *desc) { return fprintf(summary->fp, "\t\t\t<failure type=\"%s\"><![CDATA[%s\n%s]]></failure>\n", type, message, desc); } struct clar_summary *clar_summary_init(const char *filename) { struct clar_summary *summary; FILE *fp; if ((fp = fopen(filename, "w")) == NULL) return NULL; if ((summary = malloc(sizeof(struct clar_summary))) == NULL) { fclose(fp); return NULL; } summary->filename = filename; summary->fp = fp; return summary; } int clar_summary_shutdown(struct clar_summary *summary) { struct clar_report *report; const char *last_suite = NULL; if (clar_summary_testsuites(summary) < 0) goto on_error; report = _clar.reports; while (report != NULL) { struct clar_error *error = report->errors; if (last_suite == NULL || strcmp(last_suite, report->suite) != 0) { if (clar_summary_testsuite(summary, 0, report->suite, "", time(NULL), 0, _clar.tests_ran, _clar.total_errors, 0) < 0) goto on_error; } last_suite = report->suite; clar_summary_testcase(summary, report->test, "what", 0); while (error != NULL) { if (clar_summary_failure(summary, "assert", error->error_msg, error->description) < 0) goto on_error; error = error->next; } if (clar_summary_close_tag(summary, "testcase", 2) < 0) goto on_error; report = report->next; if (!report || strcmp(last_suite, report->suite) != 0) { if (clar_summary_close_tag(summary, "testsuite", 1) < 0) goto on_error; } } if (clar_summary_close_tag(summary, "testsuites", 0) < 0 || fclose(summary->fp) != 0) goto on_error; printf("written summary file to %s\n", summary->filename); free(summary); return 0; on_error: fclose(summary->fp); free(summary); return -1; }
// // MethodsFactoredParserTest.h // ParseKit // // Created by Todd Ditchendorf on 3/27/13. // // #import "TDTestScaffold.h" @interface MethodsFactoredParserTest : SenTestCase @end
//=========================================== // Lumina-DE source code // Copyright (c) 2015, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== // This panel plugin is a simple button to launch a single application //=========================================== #ifndef _LUMINA_DESKTOP_LAUNCH_APP_PANEL_PLUGIN_H #define _LUMINA_DESKTOP_LAUNCH_APP_PANEL_PLUGIN_H // Qt includes #include <QToolButton> #include <QString> #include <QWidget> // Lumina-desktop includes #include "../LPPlugin.h" //main plugin widget // libLumina includes #include "LuminaXDG.h" // PANEL PLUGIN BUTTON class AppLaunchButtonPlugin : public LPPlugin{ Q_OBJECT public: AppLaunchButtonPlugin(QWidget *parent = 0, QString id = "applauncher", bool horizontal=true); ~AppLaunchButtonPlugin(); private: QToolButton *button; QString appfile; void updateButtonVisuals(); private slots: void AppClicked(); public slots: void OrientationChange(){ if(this->layout()->direction()==QBoxLayout::LeftToRight){ this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); button->setIconSize( QSize(this->height(), this->height()) ); }else{ this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); button->setIconSize( QSize(this->width(), this->width()) ); } this->layout()->update(); updateButtonVisuals(); } void LocaleChange(){ updateButtonVisuals(); } void ThemeChange(){ updateButtonVisuals(); } }; #endif
<ompts:test> <ompts:testdescription>Test which checks the omp section firstprivate directive by adding a variable which is defined before the parallel region.</ompts:testdescription> <ompts:ompversion>2.0</ompts:ompversion> <ompts:directive>omp firstprivate</ompts:directive> <ompts:testcode> #include <stdio.h> #include "omp_testsuite.h" int <ompts:testcode:functionname>omp_section_firstprivate</ompts:testcode:functionname>(FILE * logFile){ <ompts:orphan:vars> int sum; int sum0; </ompts:orphan:vars> int known_sum; sum0 = 11; sum = 7; #pragma omp parallel { <ompts:orphan> #pragma omp sections <ompts:check>firstprivate(sum0)</ompts:check><ompts:crosscheck>private(sum0)</ompts:crosscheck> { #pragma omp section { #pragma omp critical { sum = sum + sum0; } /*end of critical */ } #pragma omp section { #pragma omp critical { sum = sum + sum0; } /*end of critical */ } #pragma omp section { #pragma omp critical { sum = sum + sum0; } /*end of critical */ } } /*end of sections*/ </ompts:orphan> } /* end of parallel */ known_sum = 11 * 3 + 7; return (known_sum == sum); } /* end of check_section_firstprivate*/ </ompts:testcode> </ompts:test>
// // QuantcastProvider.h // Analytics // // Created by Travis Jeffery on 4/26/14. // Copyright (c) 2014 Segment.io. All rights reserved. // #import "SEGAnalyticsIntegration.h" @interface SEGQuantcastIntegration : SEGAnalyticsIntegration @end
#ifndef NODEIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 #define NODEIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 #if defined(_MSC_VER) || \ (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 #pragma once #endif #include "yaml-cpp/nodeutil.h" #include <cassert> namespace YAML { // implementation of templated things template <typename T> inline const T Node::to() const { T value; *this >> value; return value; } template <typename T> inline typename enable_if<is_scalar_convertible<T> >::type operator>>( const Node& node, T& value) { if (!ConvertScalar(node, value)) throw InvalidScalar(node.m_mark); } template <typename T> inline const Node* Node::FindValue(const T& key) const { switch (m_type) { case NodeType::Null: case NodeType::Scalar: throw DereferenceScalarError(); case NodeType::Sequence: return FindFromNodeAtIndex(*this, key); case NodeType::Map: return FindValueForKey(key); } assert(false); throw DereferenceScalarError(); } template <typename T> inline const Node* Node::FindValueForKey(const T& key) const { for (Iterator it = begin(); it != end(); ++it) { T t; if (it.first().Read(t)) { if (key == t) return &it.second(); } } return 0; } template <typename T> inline const Node& Node::GetValue(const T& key) const { if (const Node* pValue = FindValue(key)) return *pValue; throw MakeTypedKeyNotFound(m_mark, key); } template <typename T> inline const Node& Node::operator[](const T& key) const { return GetValue(key); } inline const Node* Node::FindValue(const char* key) const { return FindValue(std::string(key)); } inline const Node* Node::FindValue(char* key) const { return FindValue(std::string(key)); } inline const Node& Node::operator[](const char* key) const { return GetValue(std::string(key)); } inline const Node& Node::operator[](char* key) const { return GetValue(std::string(key)); } } #endif // NODEIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66
/* SPDX-License-Identifier: GPL-2.0 */ /* Copyright (C) 2016-2019 B.A.T.M.A.N. contributors: * * Matthias Schiffer * * 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, see <http://www.gnu.org/licenses/>. */ #ifndef _NET_BATMAN_ADV_NETLINK_H_ #define _NET_BATMAN_ADV_NETLINK_H_ #include "main.h" #include <linux/types.h> #include <net/genetlink.h> struct nlmsghdr; void batadv_netlink_register(void); void batadv_netlink_unregister(void); int batadv_netlink_get_ifindex(const struct nlmsghdr *nlh, int attrtype); int batadv_netlink_tpmeter_notify(struct batadv_priv *bat_priv, const u8 *dst, u8 result, u32 test_time, u64 total_bytes, u32 cookie); int batadv_netlink_notify_mesh(struct batadv_priv *bat_priv); int batadv_netlink_notify_hardif(struct batadv_priv *bat_priv, struct batadv_hard_iface *hard_iface); int batadv_netlink_notify_vlan(struct batadv_priv *bat_priv, struct batadv_softif_vlan *vlan); extern struct genl_family batadv_netlink_family; #endif /* _NET_BATMAN_ADV_NETLINK_H_ */
#define CONFIG_FEATURE_DMESG_PRETTY 1
/* mpn_sqrlo_basecase -- Internal routine to square a natural number of length n. THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE. IT IS ONLY SAFE TO REACH THIS FUNCTION THROUGH DOCUMENTED INTERFACES. Copyright 1991-1994, 1996, 1997, 2000-2005, 2008, 2010, 2011, 2015 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. or * 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. or both in parallel, as here. The GNU MP 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 General Public License for more details. You should have received copies of the GNU General Public License and the GNU Lesser General Public License along with the GNU MP Library. If not, see https://www.gnu.org/licenses/. */ #include "gmp.h" #include "gmp-impl.h" #include "longlong.h" #ifndef SQRLO_SHORTCUT_MULTIPLICATIONS #if HAVE_NATIVE_mpn_addmul_1 #define SQRLO_SHORTCUT_MULTIPLICATIONS 0 #else #define SQRLO_SHORTCUT_MULTIPLICATIONS 1 #endif #endif #if HAVE_NATIVE_mpn_sqr_diagonal #define MPN_SQR_DIAGONAL(rp, up, n) \ mpn_sqr_diagonal (rp, up, n) #else #define MPN_SQR_DIAGONAL(rp, up, n) \ do { \ mp_size_t _i; \ for (_i = 0; _i < (n); _i++) \ { \ mp_limb_t ul, lpl; \ ul = (up)[_i]; \ umul_ppmm ((rp)[2 * _i + 1], lpl, ul, ul << GMP_NAIL_BITS); \ (rp)[2 * _i] = lpl >> GMP_NAIL_BITS; \ } \ } while (0) #endif #define MPN_SQRLO_DIAGONAL(rp, up, n) \ do { \ mp_size_t nhalf; \ nhalf = (n) >> 1; \ MPN_SQR_DIAGONAL ((rp), (up), nhalf); \ if (((n) & 1) != 0) \ { \ mp_limb_t op; \ op = (up)[nhalf]; \ (rp)[(n) - 1] = (op * op) & GMP_NUMB_MASK; \ } \ } while (0) #if HAVE_NATIVE_mpn_addlsh1_n_ip1 #define MPN_SQRLO_DIAG_ADDLSH1(rp, tp, up, n) \ do { \ MPN_SQRLO_DIAGONAL((rp), (up), (n)); \ mpn_addlsh1_n_ip1 ((rp) + 1, (tp), (n) - 1); \ } while (0) #else #define MPN_SQRLO_DIAG_ADDLSH1(rp, tp, up, n) \ do { \ MPN_SQRLO_DIAGONAL((rp), (up), (n)); \ mpn_lshift ((tp), (tp), (n) - 1, 1); \ mpn_add_n ((rp) + 1, (rp) + 1, (tp), (n) - 1); \ } while (0) #endif /* Avoid zero allocations when SQRLO_LO_THRESHOLD is 0 (this code not used). */ #define SQRLO_BASECASE_ALLOC \ (SQRLO_DC_THRESHOLD_LIMIT < 2 ? 1 : SQRLO_DC_THRESHOLD_LIMIT - 1) /* Default mpn_sqrlo_basecase using mpn_addmul_1. */ #ifndef SQRLO_SPECIAL_CASES #define SQRLO_SPECIAL_CASES 2 #endif void mpn_sqrlo_basecase (mp_ptr rp, mp_srcptr up, mp_size_t n) { mp_limb_t ul; ASSERT (n >= 1); ASSERT (! MPN_OVERLAP_P (rp, n, up, n)); ul = up[0]; if (n <= SQRLO_SPECIAL_CASES) { #if SQRLO_SPECIAL_CASES == 1 rp[0] = (ul * ul) & GMP_NUMB_MASK; #else if (n == 1) rp[0] = (ul * ul) & GMP_NUMB_MASK; else { mp_limb_t hi, lo, ul1; umul_ppmm (hi, lo, ul, ul << GMP_NAIL_BITS); rp[0] = lo >> GMP_NAIL_BITS; ul1 = up[1]; #if SQRLO_SPECIAL_CASES == 2 rp[1] = (hi + ul * ul1 * 2) & GMP_NUMB_MASK; #else if (n == 2) rp[1] = (hi + ul * ul1 * 2) & GMP_NUMB_MASK; else { mp_limb_t hi1; #if GMP_NAIL_BITS != 0 ul <<= 1; #endif umul_ppmm (hi1, lo, ul1 << GMP_NAIL_BITS, ul); hi1 += ul * up[2]; #if GMP_NAIL_BITS == 0 hi1 = (hi1 << 1) | (lo >> (GMP_LIMB_BITS - 1)); add_ssaaaa(rp[2], rp[1], hi1, lo << 1, ul1 * ul1, hi); #else hi += lo >> GMP_NAIL_BITS; rp[1] = hi & GMP_NUMB_MASK; rp[2] = (hi1 + ul1 * ul1 + (hi >> GMP_NUMB_BITS)) & GMP_NUMB_MASK; #endif } #endif } #endif } else { mp_limb_t tp[SQRLO_BASECASE_ALLOC]; mp_size_t i; /* must fit n-1 limbs in tp */ ASSERT (n <= SQRLO_DC_THRESHOLD_LIMIT); --n; #if SQRLO_SHORTCUT_MULTIPLICATIONS { mp_limb_t cy; cy = ul * up[n] + mpn_mul_1 (tp, up + 1, n - 1, ul); for (i = 1; 2 * i + 1 < n; ++i) { ul = up[i]; cy += ul * up[n - i] + mpn_addmul_1 (tp + 2 * i, up + i + 1, n - 2 * i - 1, ul); } tp [n-1] = (cy + ((n & 1)?up[i] * up[i + 1]:0)) & GMP_NUMB_MASK; } #else mpn_mul_1 (tp, up + 1, n, ul); for (i = 1; 2 * i < n; ++i) mpn_addmul_1 (tp + 2 * i, up + i + 1, n - 2 * i, up[i]); #endif MPN_SQRLO_DIAG_ADDLSH1 (rp, tp, up, n + 1); } } #undef SQRLO_SPECIAL_CASES
/*************************************************************************** qgspointrotationitem.h ---------------------- begin : September 2009 copyright : (C) 2009 by Marco Hugentobler email : marco at hugis dot net *************************************************************************** * * * 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 QGSPOINTROTATIONITEM_H #define QGSPOINTROTATIONITEM_H #include "qgsmapcanvasitem.h" #include <QFontMetricsF> #include <QPixmap> #include "qgis_app.h" //! An item that shows a rotated point symbol (e.g. arrow) centered to a map location together with a text displaying the rotation value class APP_EXPORT QgsPointRotationItem: public QgsMapCanvasItem { public: enum Orientation { Clockwise = 0, Counterclockwise }; QgsPointRotationItem( QgsMapCanvas *canvas ); void paint( QPainter *painter ) override; //! Sets the center point of the rotation symbol (in map coordinates) void setPointLocation( const QgsPointXY &p ); /** * Sets the rotation of the symbol and displays the new rotation number. * Units are degrees, starting from north direction, clockwise direction. */ void setSymbolRotation( int r ) {mRotation = r;} //! Sets rotation symbol from image (takes ownership) void setSymbol( const QImage &symbolImage ); void setOrientation( Orientation o ) { mOrientation = o; } Orientation orientation() const { return mOrientation; } private: //! Converts rotation into QPainter rotation considering mOrientation int painterRotation( int rotation ) const; //! Clockwise (default) or counterclockwise Orientation mOrientation; //! Font to display the numerical rotation values QFont mFont; //! Symbol pixmap QPixmap mPixmap; int mRotation; QPainterPath mArrowPath; }; #endif // QGSPOINTROTATIONITEM_H
/* Copyright 2012 Jun Wako <wakojun@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef CONFIG_H #define CONFIG_H #include "config_common.h" /* USB Device descriptor parameter */ #define VENDOR_ID 0xBB80 #define PRODUCT_ID 0x0504 #define DEVICE_VER 0x0001 #define MANUFACTURER Hexwire #define PRODUCT Numpad 20 /* key matrix size */ #define MATRIX_ROWS 5 #define MATRIX_COLS 4 /* * Keyboard Matrix Assignments * * Change this to how you wired your keyboard * COLS: AVR pins used for columns, left to right * ROWS: AVR pins used for rows, top to bottom * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) * */ #define MATRIX_ROW_PINS { F6, B1, B3, B6, B5 } #define MATRIX_COL_PINS { D1, D0, F5, F4 } #define UNUSED_PINS /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 5 /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST /* number of backlight levels */ /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE /* * Force NKRO * * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the * makefile for this to work.) * * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) * until the next keyboard reset. * * NKRO may prevent your keystrokes from being detected in the BIOS, but it is * fully operational during normal computer usage. * * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by * bootmagic, NKRO mode will always be enabled until it is toggled again during a * power-up. * */ //#define FORCE_NKRO /* * Magic Key Options * * Magic keys are hotkey commands that allow control over firmware functions of * the keyboard. They are best used in combination with the HID Listen program, * found here: https://www.pjrc.com/teensy/hid_listen.html * * The options below allow the magic key functionality to be changed. This is * useful if your keyboard/keypad is missing keys and you want magic key support. * */ /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false /* override magic key keymap */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS //#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM //#define MAGIC_KEY_HELP1 H //#define MAGIC_KEY_HELP2 SLASH //#define MAGIC_KEY_DEBUG D //#define MAGIC_KEY_DEBUG_MATRIX X //#define MAGIC_KEY_DEBUG_KBD K //#define MAGIC_KEY_DEBUG_MOUSE M //#define MAGIC_KEY_VERSION V //#define MAGIC_KEY_STATUS S //#define MAGIC_KEY_CONSOLE C //#define MAGIC_KEY_LAYER0_ALT1 ESC //#define MAGIC_KEY_LAYER0_ALT2 GRAVE //#define MAGIC_KEY_LAYER0 0 //#define MAGIC_KEY_LAYER1 1 //#define MAGIC_KEY_LAYER2 2 //#define MAGIC_KEY_LAYER3 3 //#define MAGIC_KEY_LAYER4 4 //#define MAGIC_KEY_LAYER5 5 //#define MAGIC_KEY_LAYER6 6 //#define MAGIC_KEY_LAYER7 7 //#define MAGIC_KEY_LAYER8 8 //#define MAGIC_KEY_LAYER9 9 //#define MAGIC_KEY_BOOTLOADER PAUSE //#define MAGIC_KEY_LOCK CAPS //#define MAGIC_KEY_EEPROM E //#define MAGIC_KEY_NKRO N //#define MAGIC_KEY_SLEEP_LED Z /* * Feature disable options * These options are also useful to firmware size reduction. */ /* disable debug print */ //#define NO_DEBUG /* disable print */ //#define NO_PRINT /* disable action features */ //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION #endif
/* * Copyright 2014 Freescale Semiconductor, Inc. * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __VID_H_ #define __VID_H_ #define IR36021_LOOP1_MANUAL_ID_OFFSET 0x6A #define IR36021_LOOP1_VOUT_OFFSET 0x9A #define IR36021_MFR_ID_OFFSET 0x92 #define IR36021_MFR_ID 0x43 #define IR36021_INTEL_MODE_OOFSET 0x14 #define IR36021_MODE_MASK 0x20 #define IR36021_INTEL_MODE 0x00 #define IR36021_AMD_MODE 0x20 /* step the IR regulator in 5mV increments */ #define IR_VDD_STEP_DOWN 5 #define IR_VDD_STEP_UP 5 int adjust_vdd(ulong vdd_override); #endif /* __VID_H_ */
/* -*- c++ -*- */ /* * Copyright 2012 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_GR_TAG_DEBUG_H #define INCLUDED_GR_TAG_DEBUG_H #include <gr_core_api.h> #include <gr_sync_block.h> #include <gruel/thread.h> #include <stddef.h> class gr_tag_debug; typedef boost::shared_ptr<gr_tag_debug> gr_tag_debug_sptr; GR_CORE_API gr_tag_debug_sptr gr_make_tag_debug(size_t sizeof_stream_item, const std::string &name); /*! * \brief Bit bucket that prints out any tag received. * \ingroup sink_blk * * This block collects all tags sent to it on all input ports and * displays them to stdout in a formatted way. The \p name parameter * is used to identify which debug sink generated the tag, so when * connecting a block to this debug sink, an appropriate name is * something that identifies the input block. * * This block otherwise acts as a NULL sink in that items from the * input stream are ignored. It is designed to be able to attach to * any block and watch all tags streaming out of that block for * debugging purposes. * * The tags from the last call to this work function are stored and * can be retrieved using the function 'current_tags'. */ class GR_CORE_API gr_tag_debug : public gr_sync_block { private: friend GR_CORE_API gr_tag_debug_sptr gr_make_tag_debug(size_t sizeof_stream_item, const std::string &name); gr_tag_debug(size_t sizeof_stream_item, const std::string &name); std::string d_name; std::vector<gr_tag_t> d_tags; std::vector<gr_tag_t>::iterator d_tags_itr; bool d_display; gruel::mutex d_mutex; public: /*! * \brief Returns a vector of gr_tag_t items as of the last call to * work. */ std::vector<gr_tag_t> current_tags(); /*! * \brief Set the display of tags to stdout on/off. */ void set_display(bool d); int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); }; #endif /* INCLUDED_GR_TAG_DEBUG_H */
#ifndef S_UTF8_H #define S_UTF8_H #include "m_pd.h" #ifndef UCS4 # define UCS4 uint32_t #endif /* UTF8_SUPPORT_FULL_UCS4 * define this to support the full potential range of UCS-4 codepoints * (in anticipation of a future UTF-8 standard) */ /*#define UTF8_SUPPORT_FULL_UCS4 1*/ #undef UTF8_SUPPORT_FULL_UCS4 /* UTF8_MAXBYTES * maximum number of bytes required to represent a single character in UTF-8 * * UTF8_MAXBYTES1 = UTF8_MAXBYTES+1 * maximum bytes per character including NUL terminator */ #ifdef UTF8_SUPPORT_FULL_UCS4 # ifndef UTF8_MAXBYTES # define UTF8_MAXBYTES 6 # endif # ifndef UTF8_MAXBYTES1 # define UTF8_MAXBYTES1 7 # endif #else # ifndef UTF8_MAXBYTES # define UTF8_MAXBYTES 4 # endif # ifndef UTF8_MAXBYTES1 # define UTF8_MAXBYTES1 5 # endif #endif /*--/moo--*/ /* is c the start of a utf8 sequence? */ #define isutf(c) (((c)&0xC0)!=0x80) /* convert UTF-8 data to UCS-2 wide character */ int u8_utf8toucs2(uint16_t *dest, int sz, char *src, int srcsz); /* the opposite conversion */ int u8_ucs2toutf8(char *dest, int sz, uint16_t *src, int srcsz); /* moo: get byte length of character number, or 0 if not supported */ int u8_wc_nbytes(uint32_t ch); /* moo: compute required storage for UTF-8 encoding of 's[0..n-1]' */ int u8_wcs_nbytes(uint32_t *ucs, int size); /* single character to UTF-8, no NUL termination */ int u8_wc_toutf8(char *dest, uint32_t ch); /* moo: single character to UTF-8, with NUL termination */ int u8_wc_toutf8_nul(char *dest, uint32_t ch); /* character number to byte offset */ int u8_offset(char *str, int charnum); /* byte offset to character number */ int u8_charnum(char *s, int offset); /* return next character, updating an index variable */ uint32_t u8_nextchar(char *s, int *i); /* move to next character */ void u8_inc(char *s, int *i); /* move to previous character */ void u8_dec(char *s, int *i); /* moo: move pointer to next character */ void u8_inc_ptr(char **sp); /* moo: move pointer to previous character */ void u8_dec_ptr(char **sp); /* returns length of next utf-8 sequence */ int u8_seqlen(char *s); #endif /* S_UTF8_H */
/* Copyright (c) 2015 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // GTLBigqueryQueryResponse.h // // ---------------------------------------------------------------------------- // NOTE: This file is generated from Google APIs Discovery Service. // Service: // BigQuery API (bigquery/v2) // Description: // A data platform for customers to create, manage, share and query data. // Documentation: // https://cloud.google.com/bigquery/ // Classes: // GTLBigqueryQueryResponse (0 custom class methods, 10 custom properties) #if GTL_BUILT_AS_FRAMEWORK #import "GTL/GTLObject.h" #else #import "GTLObject.h" #endif @class GTLBigqueryErrorProto; @class GTLBigqueryJobReference; @class GTLBigqueryTableRow; @class GTLBigqueryTableSchema; // ---------------------------------------------------------------------------- // // GTLBigqueryQueryResponse // @interface GTLBigqueryQueryResponse : GTLObject // Whether the query result was fetched from the query cache. @property (nonatomic, retain) NSNumber *cacheHit; // boolValue // [Output-only] All errors and warnings encountered during the running of the // job. Errors here do not necessarily mean that the job has completed or was // unsuccessful. @property (nonatomic, retain) NSArray *errors; // of GTLBigqueryErrorProto // Whether the query has completed or not. If rows or totalRows are present, // this will always be true. If this is false, totalRows will not be available. @property (nonatomic, retain) NSNumber *jobComplete; // boolValue // Reference to the Job that was created to run the query. This field will be // present even if the original request timed out, in which case GetQueryResults // can be used to read the results once the query has completed. Since this API // only returns the first page of results, subsequent pages can be fetched via // the same mechanism (GetQueryResults). @property (nonatomic, retain) GTLBigqueryJobReference *jobReference; // The resource type. @property (nonatomic, copy) NSString *kind; // A token used for paging results. @property (nonatomic, copy) NSString *pageToken; // An object with as many results as can be contained within the maximum // permitted reply size. To get any additional rows, you can call // GetQueryResults and specify the jobReference returned above. @property (nonatomic, retain) NSArray *rows; // of GTLBigqueryTableRow // The schema of the results. Present only when the query completes // successfully. @property (nonatomic, retain) GTLBigqueryTableSchema *schema; // The total number of bytes processed for this query. If this query was a dry // run, this is the number of bytes that would be processed if the query were // run. @property (nonatomic, retain) NSNumber *totalBytesProcessed; // longLongValue // The total number of rows in the complete query result set, which can be more // than the number of rows in this single page of results. @property (nonatomic, retain) NSNumber *totalRows; // unsignedLongLongValue @end
/* SPDX-License-Identifier: LGPL-2.1-or-later */ #include "integrity-util.h" #include "extract-word.h" #include "fileio.h" #include "path-util.h" #include "percent-util.h" static int supported_integrity_algorithm(char *user_supplied) { if (!STR_IN_SET(user_supplied, "crc32", "crc32c", "sha1", "sha256", "hmac-sha256")) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Unsupported integrity algorithm (%s)", user_supplied); return 0; } int parse_integrity_options( const char *options, uint32_t *ret_activate_flags, int *ret_percent, usec_t *ret_commit_time, char **ret_data_device, char **ret_integrity_alg) { int r; for (;;) { _cleanup_free_ char *word = NULL; char *val; r = extract_first_word(&options, &word, ",", EXTRACT_DONT_COALESCE_SEPARATORS | EXTRACT_UNESCAPE_SEPARATORS); if (r < 0) return log_error_errno(r, "Failed to parse options: %m"); if (r == 0) break; else if (streq(word, "allow-discards")) { if (ret_activate_flags) *ret_activate_flags |= CRYPT_ACTIVATE_ALLOW_DISCARDS; } else if ((val = startswith(word, "journal-watermark="))) { r = parse_percent(val); if (r < 0) return log_error_errno(r, "Failed to parse journal-watermark value or value out of range (%s)", val); if (ret_percent) *ret_percent = r; } else if ((val = startswith(word, "journal-commit-time="))) { usec_t tmp_commit_time; r = parse_sec(val, &tmp_commit_time); if (r < 0) return log_error_errno(r, "Failed to parse journal-commit-time value (%s)", val); if (ret_commit_time) *ret_commit_time = tmp_commit_time; } else if ((val = startswith(word, "data-device="))) { if (ret_data_device) { r = free_and_strdup(ret_data_device, val); if (r < 0) return log_oom(); } } else if ((val = startswith(word, "integrity-algorithm="))) { r = supported_integrity_algorithm(val); if (r < 0) return r; if (ret_integrity_alg) { r = free_and_strdup(ret_integrity_alg, val); if (r < 0) return log_oom(); } } else log_warning("Encountered unknown option '%s', ignoring.", word); } return r; }
#ifdef RCSID static char RCSid[] = "$Header: d:/cvsroot/tads/TADS2/LST.C,v 1.2 1999/05/17 02:52:12 MJRoberts Exp $"; #endif /* * Copyright (c) 1991, 2002 Michael J. Roberts. All Rights Reserved. * * Please see the accompanying license file, LICENSE.TXT, for information * on using and copying this software. */ /* Name lst.c - list manipulation routines Function Routines to manipulate TADS run-time lists Notes None Modified 08/13/91 MJRoberts - creation */ #include <assert.h> #include "os.h" #include "lst.h" #include "dat.h" void lstadv(uchar **lstp, uint *sizp) { uint siz; siz = datsiz(**lstp, (*lstp)+1) + 1; assert(siz <= *sizp); *lstp += siz; *sizp -= siz; }
/*=================================================================== APM_PLANNER Open Source Ground Control Station (c) 2014 APM_PLANNER PROJECT <http://www.diydrones.com> (c) author: Bill Bonney <billbonney@communistech.com> This file is part of the APM_PLANNER project APM_PLANNER 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. APM_PLANNER 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 APM_PLANNER. If not, see <http://www.gnu.org/licenses/>. ======================================================================*/ #ifndef DRONESHAREDIALOG_H #define DRONESHAREDIALOG_H #include <QDialog> namespace Ui { class DroneshareDialog; } class DroneshareDialog : public QDialog { Q_OBJECT public: explicit DroneshareDialog(QWidget *parent = 0); ~DroneshareDialog(); signals: void autoUpdateCancelled(QString version); public slots: void signupClicked(); void laterClicked(); void okClicked(); private: Ui::DroneshareDialog *ui; bool m_skip; }; #endif // DRONESHAREDIALOG_H
/******************************************************* Lightwave Object Loader for OSG Copyright (C) 2004 Marco Jez <marco.jez@poste.it> OpenSceneGraph is (C) 2004 Robert Osfield ********************************************************/ #ifndef LWOSG_BLOCK_ #define LWOSG_BLOCK_ #include "lwo2chunks.h" #include <osg/Vec3> #ifdef DIFFERENCE #undef DIFFERENCE #endif namespace lwosg { class Clip; struct Texture_mapping { enum Coordinate_system_type { OBJECT = 0, WORLD = 1 }; osg::Vec3 center_; osg::Vec3 size_; osg::Vec3 rotation_; // missing: OREF, FALL Coordinate_system_type csys_; Texture_mapping() : size_(1, 1, 1), csys_(OBJECT) {} }; struct Image_map { enum Axis_type { X = 0, Y = 1, Z = 2 }; enum Projection_mode { PLANAR = 0, CYLINDRICAL = 1, SPHERICAL = 2, CUBIC = 3, FRONT_PROJECTION = 4, UV = 5 }; enum Wrap_type { RESET = 0, REPEAT = 1, MIRROR = 2, EDGE = 3 }; Texture_mapping mapping; Projection_mode projection; Axis_type axis; int image_map; const Clip *clip; // is filled by Surface::compile() Wrap_type width_wrap; Wrap_type height_wrap; float wrap_amount_w; float wrap_amount_h; std::string uv_map; // missing: AAST, PIXB, STCK float texture_amplitude; Image_map() : image_map(-1), clip(0), width_wrap(REPEAT), height_wrap(REPEAT), wrap_amount_w(1), wrap_amount_h(1), texture_amplitude(1) {} }; class Block { public: enum Axis_type { X = 0, Y = 1, Z = 2 }; enum Opacity_type { NORMAL = 0, SUBTRACTIVE = 1, DIFFERENCE = 2, MULTIPLY = 3, DIVIDE = 4, ALPHA = 5, TEXTURE_DISPLACEMENT = 6, ADDITIVE = 7 }; Block(const lwo2::FORM::SURF::BLOK *blok = 0); void compile(const lwo2::FORM::SURF::BLOK *blok = 0); inline const std::string &get_type() const { return type_; } inline const std::string &get_ordinal() const { return ordinal_; } inline const std::string &get_channel() const { return channel_; } inline bool enabled() const { return enabled_; } inline Opacity_type get_opacity_type() const { return opacity_type_; } inline float get_opacity_amount() const { return opacity_amount_; } inline Axis_type get_displacement_axis() const { return displacement_axis_; } inline const Image_map &get_image_map() const { return imap_; } inline Image_map &get_image_map() { return imap_; } osg::Vec3 setup_texture_point(const osg::Vec3 &P) const; protected: void read_common_attributes(const iff::Chunk_list &subchunks); private: std::string type_; std::string ordinal_; std::string channel_; bool enabled_; Opacity_type opacity_type_; float opacity_amount_; Axis_type displacement_axis_; Image_map imap_; }; } #endif
#include <ccan/list/list.h> #include <ccan/tap/tap.h> #include <ccan/list/list.c> #include "helper.h" struct child { const char *name; struct list_node list; }; int main(void) { struct child c1, c2; struct list_head list = LIST_HEAD_INIT(list); plan_tests(1); list_add(&list, &c1.list); list_add_tail(list_check(&list, "Bad list!"), &c2.list); list_del_from(list_check(&list, "Bad list!"), list_check_node(&c2.list, "Bad node!")); list_del_from(list_check(&list, "Bad list!"), list_check_node(&c1.list, "Bad node!")); ok1(list_empty(list_check(&list, "Bad emptied list"))); return exit_status(); }
/*! * @file mb_cmd_ecdsa_securekey.h * @brief Headerfile : mailbox command for ecdsa securekey * @author jinsu.hyun * @version v0.50 : 2016.8.13 Init. release version */ #ifndef MB_CMD_ECDSA_SECUREKEY_H_ #define MB_CMD_ECDSA_SECUREKEY_H_ #include "mb_cmd_ecdsa.h" // ====================================== // Function // ====================================== int mb_ecdsa_sign_securekey_step1(unsigned int object_id, unsigned char *hash); int mb_ecdsa_sign_securekey_step2(struct sECC_SIGN *signature, unsigned int object_id); int mb_ecdsa_verify_securekey_step1(unsigned int object_id, unsigned char *hash); int mb_ecdsa_verify_securekey_step2(unsigned int object_id, struct sECC_SIGN *signature); int mb_ecdsa_verify_securekey_step3(unsigned int object_id); int mb_ecdsa_generate_key_securekey_step1(unsigned int object_id); int mb_ecdsa_generate_publickey_securekey_step1(unsigned int object_id); int mb_ecdsa_generate_publickey_securekey_step2(struct sECC_KEY *ecc_publickey, unsigned int object_id); // ====================================== // Mailbox Command // ====================================== #define FUNC_ECDSA_SIGN_SECUREKEY1 (0x01011102) #define FUNC_ECDSA_SIGN_SECUREKEY2 (0x01021102) #define FUNC_ECDSA_VERIFY_SECUREKEY1 (0x01011202) #define FUNC_ECDSA_VERIFY_SECUREKEY2 (0x01021202) #define FUNC_ECDSA_VERIFY_SECUREKEY3 (0x01031202) #define FUNC_ECDSA_GEN_KEY_SECUREKEY1 (0x03011302) #define FUNC_ECDSA_GEN_PUBLICKEY_SECUREKEY1 (0x01011302) #define FUNC_ECDSA_GEN_PUBLICKEY_SECUREKEY2 (0x01021302) #endif /* MB_CMD_ECDSA_SECUREKEY_H_ */
/** * Copyright (c) 2016-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 <IGListKit/IGListCompatibility.h> /** * Project version number for IGListKit. */ FOUNDATION_EXPORT double IGListKitVersionNumber; /** * Project version string for IGListKit. */ FOUNDATION_EXPORT const unsigned char IGListKitVersionString[]; #import <IGListKit/IGListAssert.h> #import <IGListKit/IGListBatchUpdateData.h> #import <IGListKit/IGListDiff.h> #import <IGListKit/IGListDiffable.h> #import <IGListKit/IGListExperiments.h> #import <IGListKit/IGListIndexPathResult.h> #import <IGListKit/IGListIndexSetResult.h> #import <IGListKit/IGListMoveIndex.h> #import <IGListKit/IGListMoveIndexPath.h> #import <IGListKit/NSNumber+IGListDiffable.h> #import <IGListKit/NSString+IGListDiffable.h>
#ifndef _ROS_SERVICE_JointRequest_h #define _ROS_SERVICE_JointRequest_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" namespace gazebo_msgs { static const char JOINTREQUEST[] = "gazebo_msgs/JointRequest"; class JointRequestRequest : public ros::Msg { public: typedef const char* _joint_name_type; _joint_name_type joint_name; JointRequestRequest(): joint_name("") { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; uint32_t length_joint_name = strlen(this->joint_name); varToArr(outbuffer + offset, length_joint_name); offset += 4; memcpy(outbuffer + offset, this->joint_name, length_joint_name); offset += length_joint_name; return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; uint32_t length_joint_name; arrToVar(length_joint_name, (inbuffer + offset)); offset += 4; for(unsigned int k= offset; k< offset+length_joint_name; ++k){ inbuffer[k-1]=inbuffer[k]; } inbuffer[offset+length_joint_name-1]=0; this->joint_name = (char *)(inbuffer + offset-1); offset += length_joint_name; return offset; } const char * getType(){ return JOINTREQUEST; }; const char * getMD5(){ return "0be1351618e1dc030eb7959d9a4902de"; }; }; class JointRequestResponse : public ros::Msg { public: JointRequestResponse() { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; return offset; } const char * getType(){ return JOINTREQUEST; }; const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; }; class JointRequest { public: typedef JointRequestRequest Request; typedef JointRequestResponse Response; }; } #endif
/* * This test file is used to verify that the header files associated with * invoking this function are correct. * * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.org/license/LICENSE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <time.h> #ifndef _POSIX_CPUTIME #error "rtems is supposed to have clock_getenable_attr" #endif #ifndef _POSIX_THREAD_CPUTIME #error "rtems is supposed to have clock_getenable_attr" #endif int test( void ); int test( void ) { clockid_t clock_id = 0; int attr; int result; result = clock_getenable_attr( clock_id, &attr ); return result; }
/* * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef MODULES_AUDIO_PROCESSING_NS_NS_COMMON_H_ #define MODULES_AUDIO_PROCESSING_NS_NS_COMMON_H_ #include <cstddef> namespace webrtc { constexpr size_t kFftSize = 256; constexpr size_t kFftSizeBy2Plus1 = kFftSize / 2 + 1; constexpr size_t kNsFrameSize = 160; constexpr size_t kOverlapSize = kFftSize - kNsFrameSize; constexpr int kShortStartupPhaseBlocks = 50; constexpr int kLongStartupPhaseBlocks = 200; constexpr int kFeatureUpdateWindowSize = 500; constexpr float kLtrFeatureThr = 0.5f; constexpr float kBinSizeLrt = 0.1f; constexpr float kBinSizeSpecFlat = 0.05f; constexpr float kBinSizeSpecDiff = 0.1f; } // namespace webrtc #endif // MODULES_AUDIO_PROCESSING_NS_NS_COMMON_H_
/* * inttoa - return an asciized signed integer */ #include <stdio.h> #include "lib_strbuf.h" #include "ntp_stdlib.h" char * inttoa( long ival ) { register char *buf; LIB_GETBUF(buf); (void) sprintf(buf, "%ld", (long)ival); return buf; }
///////////////////////////////////////////////////////////////////////////// // Name: busyinfo.h // Purpose: interface of wxBusyInfo // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @class wxBusyInfo This class makes it easy to tell your user that the program is temporarily busy. Just create a wxBusyInfo object on the stack, and within the current scope, a message window will be shown. For example: @code wxBusyInfo wait("Please wait, working..."); for (int i = 0; i < 100000; i++) { DoACalculation(); } @endcode It works by creating a window in the constructor, and deleting it in the destructor. You may also want to call wxTheApp->Yield() to refresh the window periodically (in case it had been obscured by other windows, for example) like this: @code wxWindowDisabler disableAll; wxBusyInfo wait("Please wait, working..."); for (int i = 0; i < 100000; i++) { DoACalculation(); if ( !(i % 1000) ) wxTheApp->Yield(); } @endcode but take care to not cause undesirable reentrancies when doing it (see wxApp::Yield for more details). The simplest way to do it is to use wxWindowDisabler class as illustrated in the above example. Note that a wxBusyInfo is always built with the @c wxSTAY_ON_TOP window style (see wxFrame window styles for more info). @library{wxcore} @category{cmndlg} */ class wxBusyInfo { public: /** Constructs a busy info window as child of @a parent and displays @e msg in it. @note If @a parent is not @NULL you must ensure that it is not closed while the busy info is shown. */ wxBusyInfo(const wxString& msg, wxWindow* parent = NULL); /** Hides and closes the window containing the information text. */ virtual ~wxBusyInfo(); };
/* Copyright (c) 2015 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // GTLQPXExpressBagDescriptor.h // // ---------------------------------------------------------------------------- // NOTE: This file is generated from Google APIs Discovery Service. // Service: // QPX Express API (qpxExpress/v1) // Description: // Lets you find the least expensive flights between an origin and a // destination. // Documentation: // http://developers.google.com/qpx-express // Classes: // GTLQPXExpressBagDescriptor (0 custom class methods, 5 custom properties) #if GTL_BUILT_AS_FRAMEWORK #import "GTL/GTLObject.h" #else #import "GTLObject.h" #endif // ---------------------------------------------------------------------------- // // GTLQPXExpressBagDescriptor // // Information about an item of baggage. @interface GTLQPXExpressBagDescriptor : GTLObject // Provides the commercial name for an optional service. @property (nonatomic, copy) NSString *commercialName; // How many of this type of bag will be checked on this flight. @property (nonatomic, retain) NSNumber *count; // intValue // A description of the baggage. // Remapped to 'descriptionProperty' to avoid NSObject's 'description'. @property (nonatomic, retain) NSArray *descriptionProperty; // of NSString // Identifies this as a baggage object. Value: the fixed string // qpxexpress#bagDescriptor. @property (nonatomic, copy) NSString *kind; // The standard IATA subcode used to identify this optional service. @property (nonatomic, copy) NSString *subcode; @end
#ifndef __DSI_DRV_H__ #define __DSI_DRV_H__ #include <linux/types.h> #include "lcm_drv.h" #include "ddp_hal.h" #include "fbconfig_kdebug.h" #include "ddp_info.h" #include "ddp_manager.h" #ifdef __cplusplus extern "C" { #endif extern const LCM_UTIL_FUNCS PM_lcm_utils_dsi0; extern void DSI_manual_enter_HS(cmdqRecHandle cmdq); extern void DSI_sw_clk_trail_cmdq(int module_idx, cmdqRecHandle cmdq); void DSI_ForceConfig(int forceconfig); int DSI_set_roi(int x, int y); int DSI_check_roi(void); /* --------------------------------------------------------------------------- */ #define DSI_CHECK_RET(expr) \ do { \ DSI_STATUS ret = (expr); \ ASSERT(DSI_STATUS_OK == ret); \ } while (0) /* --------------------------------------------------------------------------- */ #define DSI_DCS_SHORT_PACKET_ID_0 0x05 #define DSI_DCS_SHORT_PACKET_ID_1 0x15 #define DSI_DCS_LONG_PACKET_ID 0x39 #define DSI_DCS_READ_PACKET_ID 0x06 #define DSI_GERNERIC_SHORT_PACKET_ID_1 0x13 #define DSI_GERNERIC_SHORT_PACKET_ID_2 0x23 #define DSI_GERNERIC_LONG_PACKET_ID 0x29 #define DSI_GERNERIC_READ_LONG_PACKET_ID 0x14 #define DSI_NULL_PACKET_ID 0x09 #define DSI_WMEM_CONTI (0x3C) #define DSI_RMEM_CONTI (0x3E) /* ESD recovery method for video mode LCM */ #define METHOD_NONCONTINUOUS_CLK (0x1) #define METHOD_BUS_TURN_AROUND (0x2) /* State of DSI engine */ #define DSI_VDO_VSA_VS_STATE (0x008) #define DSI_VDO_VSA_HS_STATE (0x010) #define DSI_VDO_VSA_VE_STATE (0x020) #define DSI_VDO_VBP_STATE (0x040) #define DSI_VDO_VACT_STATE (0x080) #define DSI_VDO_VFP_STATE (0x100) /* --------------------------------------------------------------------------- */ typedef enum { DSI_STATUS_OK = 0, DSI_STATUS_ERROR, } DSI_STATUS; typedef enum { SHORT_PACKET_RW = 0, FB_WRITE = 1, LONG_PACKET_W = 2, FB_READ = 3, } DSI_INS_TYPE; typedef enum { DISABLE_BTA = 0, ENABLE_BTA = 1, } DSI_CMDQ_BTA; typedef enum { LOW_POWER = 0, HIGH_SPEED = 1, } DSI_CMDQ_HS; typedef enum { CL_8BITS = 0, CL_16BITS = 1, } DSI_CMDQ_CL; typedef enum { DISABLE_TE = 0, ENABLE_TE = 1, } DSI_CMDQ_TE; typedef enum { DISABLE_RPT = 0, ENABLE_RPT = 1, } DSI_CMDQ_RPT; typedef struct { unsigned type:2; unsigned BTA:1; unsigned HS:1; unsigned CL:1; unsigned TE:1; unsigned Rsv:1; unsigned RPT:1; } DSI_CMDQ_CONFG, *PDSI_CMDQ_CONFIG; typedef struct { unsigned CONFG:8; unsigned Data_ID:8; unsigned Data0:8; unsigned Data1:8; } DSI_T0_INS, *PDSI_T0_INS; typedef struct { unsigned CONFG:8; unsigned Data_ID:8; unsigned mem_start0:8; unsigned mem_start1:8; } DSI_T1_INS, *PDSI_T1_INS; typedef struct { unsigned CONFG:8; unsigned Data_ID:8; unsigned WC16:16; unsigned int *pdata; } DSI_T2_INS, *PDSI_T2_INS; typedef struct { unsigned CONFG:8; unsigned Data_ID:8; unsigned mem_start0:8; unsigned mem_start1:8; } DSI_T3_INS, *PDSI_T3_INS; typedef struct { uint8_t TXDIV0; uint8_t TXDIV1; uint32_t SDM_PCW; uint8_t SSC_PH_INIT; uint16_t SSC_PRD; uint16_t SSC_DELTA1; uint16_t SSC_DELTA; } DSI_PLL_CONFIG; typedef enum { DSI_INTERFACE_0 = 0, DSI_INTERFACE_1, DSI_INTERFACE_DUAL, DSI_INTERFACE_NUM, } DSI_INTERFACE_ID; void DSI_ChangeClk(DISP_MODULE_ENUM module, uint32_t clk); int32_t DSI_ssc_enable(uint32_t dsi_idx, uint32_t en); uint32_t PanelMaster_get_CC(uint32_t dsi_idx); void PanelMaster_set_CC(uint32_t dsi_index, uint32_t enable); uint32_t PanelMaster_get_dsi_timing(uint32_t dsi_index, MIPI_SETTING_TYPE type); uint32_t PanelMaster_get_TE_status(uint32_t dsi_idx); void PanelMaster_DSI_set_timing(uint32_t dsi_index, MIPI_TIMING timing); unsigned int PanelMaster_set_PM_enable(unsigned int value); uint32_t DSI_dcs_read_lcm_reg_v2(DISP_MODULE_ENUM module, cmdqRecHandle cmdq, uint8_t cmd, uint8_t *buffer, uint8_t buffer_size); void *get_dsi_params_handle(uint32_t dsi_idx); DSI_STATUS DSI_BIST_Pattern_Test(DISP_MODULE_ENUM module, cmdqRecHandle cmdq, bool enable, unsigned int color); extern DDP_MODULE_DRIVER ddp_driver_dsi0; extern DDP_MODULE_DRIVER ddp_driver_dsi1; extern DDP_MODULE_DRIVER ddp_driver_dsidual; #ifdef __cplusplus } #endif #endif /* __DPI_DRV_H__ */
/* closeout.c - close standard output Copyright (C) 1998, 1999, 2000, 2001 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if HAVE_CONFIG_H # include <config.h> #endif #if ENABLE_NLS # include <libintl.h> # define _(Text) gettext (Text) #else # define _(Text) Text #endif #if HAVE_STDLIB_H # include <stdlib.h> #endif #ifndef EXIT_FAILURE # define EXIT_FAILURE 1 #endif #include <stdio.h> #include <errno.h> #ifndef errno extern int errno; #endif #include "closeout.h" #include "error.h" #include "quotearg.h" #if 0 #include "__fpending.h" #endif static int default_exit_status = EXIT_FAILURE; static const char *file_name; /* Set the value to be used for the exit status when close_stdout is called. This is useful when it is not convenient to call close_stdout_status, e.g., when close_stdout is called via atexit. */ void close_stdout_set_status (int status) { default_exit_status = status; } /* Set the file name to be reported in the event an error is detected by close_stdout_status. */ void close_stdout_set_file_name (const char *file) { file_name = file; } /* Close standard output, exiting with status STATUS on failure. If a program writes *anything* to stdout, that program should `fflush' stdout and make sure that it succeeds before exiting. Otherwise, suppose that you go to the extreme of checking the return status of every function that does an explicit write to stdout. The last printf can succeed in writing to the internal stream buffer, and yet the fclose(stdout) could still fail (due e.g., to a disk full error) when it tries to write out that buffered data. Thus, you would be left with an incomplete output file and the offending program would exit successfully. FIXME: note the fflush suggested above is implicit in the fclose we actually do below. Consider doing only the fflush and/or using setvbuf to inhibit buffering. Besides, it's wasteful to check the return value from every call that writes to stdout -- just let the internal stream state record the failure. That's what the ferror test is checking below. It's important to detect such failures and exit nonzero because many tools (most notably `make' and other build-management systems) depend on being able to detect failure in other tools via their exit status. */ void close_stdout_status (int status) { int e = ferror (stdout) ? 0 : -1; #if 0 if (__fpending (stdout) == 0) return; #endif if (fclose (stdout) != 0) e = errno; if (0 < e) { char const *write_error = _("write error"); if (file_name) error (status, e, "%s: %s", quotearg_colon (file_name), write_error); else error (status, e, "%s", write_error); } } /* Close standard output, exiting with status EXIT_FAILURE on failure. */ void close_stdout (void) { close_stdout_status (default_exit_status); }
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QPAINTENGINE_PIC_P_H #define QPAINTENGINE_PIC_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of QAbstractItemModel*. This header file may change from version // to version without notice, or even be removed. // // We mean it. // // #include "QtGui/qpaintengine.h" #ifndef QT_NO_PICTURE QT_BEGIN_NAMESPACE class QPicturePaintEnginePrivate; class QBuffer; class QPicturePaintEngine : public QPaintEngine { Q_DECLARE_PRIVATE(QPicturePaintEngine) public: QPicturePaintEngine(); ~QPicturePaintEngine(); bool begin(QPaintDevice *pdev) Q_DECL_OVERRIDE; bool end() Q_DECL_OVERRIDE; void updateState(const QPaintEngineState &state) Q_DECL_OVERRIDE; void updatePen(const QPen &pen); void updateBrush(const QBrush &brush); void updateBrushOrigin(const QPointF &origin); void updateFont(const QFont &font); void updateBackground(Qt::BGMode bgmode, const QBrush &bgBrush); void updateMatrix(const QTransform &matrix); void updateClipRegion(const QRegion &region, Qt::ClipOperation op); void updateClipPath(const QPainterPath &path, Qt::ClipOperation op); void updateRenderHints(QPainter::RenderHints hints); void updateCompositionMode(QPainter::CompositionMode cmode); void updateClipEnabled(bool enabled); void updateOpacity(qreal opacity); void drawEllipse(const QRectF &rect) Q_DECL_OVERRIDE; void drawPath(const QPainterPath &path) Q_DECL_OVERRIDE; void drawPolygon(const QPointF *points, int numPoints, PolygonDrawMode mode) Q_DECL_OVERRIDE; using QPaintEngine::drawPolygon; void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) Q_DECL_OVERRIDE; void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) Q_DECL_OVERRIDE; void drawImage(const QRectF &r, const QImage &image, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE; void drawTextItem(const QPointF &p, const QTextItem &ti) Q_DECL_OVERRIDE; Type type() const Q_DECL_OVERRIDE { return Picture; } protected: QPicturePaintEngine(QPaintEnginePrivate &dptr); private: Q_DISABLE_COPY(QPicturePaintEngine) void writeCmdLength(int pos, const QRectF &r, bool corr); }; QT_END_NAMESPACE #endif // QT_NO_PICTURE #endif // QPAINTENGINE_PIC_P_H
/* * Copyright 2011 Range Networks, Inc. * All Rights Reserved. * * This software is distributed under multiple licenses; * see the COPYING file in the main directory for licensing * information for this specific distribuion. * * This use of this software may be subject to additional restrictions. * See the LEGAL file in the main directory for details. 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. */ #ifndef SCALARTYPES_H #define SCALARTYPES_H #include <iostream> // For size_t #include <stdint.h> //#include "GSMCommon.h" // Was included for Z100Timer // We dont bother to define *= /= etc.; you'll have to convert: a*=b; to: a=a*b; #define _INITIALIZED_SCALAR_BASE_FUNCS(Classname,Basetype,Init) \ Classname() : value(Init) {} \ Classname(Basetype wvalue) { value = wvalue; } /* Can set from basetype. */ \ operator Basetype(void) const { return value; } /* Converts from basetype. */ \ Basetype operator=(Basetype wvalue) { return value = wvalue; } \ Basetype* operator&() { return &value; } #define _INITIALIZED_SCALAR_ARITH_FUNCS(Basetype) \ Basetype operator++() { return ++value; } \ Basetype operator++(int) { return value++; } \ Basetype operator--() { return --value; } \ Basetype operator--(int) { return value--; } \ Basetype operator+=(Basetype wvalue) { return value = value + wvalue; } \ Basetype operator-=(Basetype wvalue) { return value = value - wvalue; } #define _INITIALIZED_SCALAR_FUNCS(Classname,Basetype,Init) \ _INITIALIZED_SCALAR_BASE_FUNCS(Classname,Basetype,Init) \ _INITIALIZED_SCALAR_ARITH_FUNCS(Basetype) #define _DECLARE_SCALAR_TYPE(Classname_i,Classname_z,Basetype) \ template <Basetype Init> \ struct Classname_i { \ Basetype value; \ _INITIALIZED_SCALAR_FUNCS(Classname_i,Basetype,Init) \ }; \ typedef Classname_i<0> Classname_z; // Usage: // Where 'classname' is one of the types listed below, then: // classname_z specifies a zero initialized type; // classname_i<value> initializes the type to the specified value. // We also define Float_z. _DECLARE_SCALAR_TYPE(Int_i, Int_z, int) _DECLARE_SCALAR_TYPE(Char_i, Char_z, signed char) _DECLARE_SCALAR_TYPE(Int16_i, Int16_z, int16_t) _DECLARE_SCALAR_TYPE(Int32_i, Int32_z, int32_t) _DECLARE_SCALAR_TYPE(UInt_i, UInt_z, unsigned) _DECLARE_SCALAR_TYPE(UChar_i, UChar_z, unsigned char) _DECLARE_SCALAR_TYPE(UInt16_i, UInt16_z, uint16_t) _DECLARE_SCALAR_TYPE(UInt32_i, UInt32_z, uint32_t) _DECLARE_SCALAR_TYPE(Size_t_i, Size_t_z, size_t) // Bool is special because it cannot accept some arithmetic funcs //_DECLARE_SCALAR_TYPE(Bool_i, Bool_z, bool) template <bool Init> struct Bool_i { bool value; _INITIALIZED_SCALAR_BASE_FUNCS(Bool_i,bool,Init) }; typedef Bool_i<0> Bool_z; // float is special, because C++ does not permit the template initalization: struct Float_z { float value; _INITIALIZED_SCALAR_FUNCS(Float_z,float,0) }; struct Double_z { double value; _INITIALIZED_SCALAR_FUNCS(Double_z,double,0) }; class ItemWithValueAndWidth { public: virtual unsigned getValue() const = 0; virtual unsigned getWidth() const = 0; }; // A Range Networks Field with a specified width. // See RLCMessages.h for examples. template <int Width=32, unsigned Init=0> class Field_i : public ItemWithValueAndWidth { public: unsigned value; _INITIALIZED_SCALAR_FUNCS(Field_i,unsigned,Init) unsigned getWidth() const { return Width; } unsigned getValue() const { return value; } }; // Synonym for Field_i, but no way to do it. template <int Width, unsigned Init=0> class Field_z : public ItemWithValueAndWidth { public: unsigned value; _INITIALIZED_SCALAR_FUNCS(Field_z,unsigned,Init) unsigned getWidth() const { return Width; } unsigned getValue() const { return value; } }; // This is an uninitialized field. template <int Width=32, unsigned Init=0> class Field : public ItemWithValueAndWidth { public: unsigned value; _INITIALIZED_SCALAR_FUNCS(Field,unsigned,Init) unsigned getWidth() const { return Width; } unsigned getValue() const { return value; } }; // A Z100Timer with an initial value specified. //template <int Init> //class Z100Timer_i : public GSM::Z100Timer { // public: // Z100Timer_i() : GSM::Z100Timer(Init) {} //}; #endif
/* GData plugin for Claws-Mail * Copyright (C) 2011 Holger Berndt * * 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/>. */ #ifndef GDATA_PLUGIN_H_ #define GDATA_PLUGIN_H_ void cm_gdata_update_contacts_update_timer(void); #endif /* GDATA_PLUGIN_H_ */
/* ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "ch.h" #include "hal.h" /** * @brief PAL setup. * @details Digital I/O ports static configuration as defined in @p board.h. * This variable is used by the HAL when initializing the PAL driver. */ #if HAL_USE_PAL || defined(__DOXYGEN__) const PALConfig pal_default_config = { #if defined(PORTA) {VAL_PORTA, VAL_DDRA}, #endif #if defined(PORTB) {VAL_PORTB, VAL_DDRB}, #endif #if defined(PORTC) {VAL_PORTC, VAL_DDRC}, #endif #if defined(PORTD) {VAL_PORTD, VAL_DDRD}, #endif #if defined(PORTE) {VAL_PORTE, VAL_DDRE}, #endif #if defined(PORTF) {VAL_PORTF, VAL_DDRF}, #endif #if defined(PORTG) {VAL_PORTG, VAL_DDRG}, #endif }; #endif /* HAL_USE_PAL */ /** * Board-specific initialization code. */ void boardInit(void) { /* * External interrupts setup, all disabled initially. */ EICRA = 0x00; EICRB = 0x00; EIMSK = 0x00; }
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #ifndef VERIFYELEMENTUNIQUEID_H #define VERIFYELEMENTUNIQUEID_H #include "ElementUserObject.h" #include "libmesh/id_types.h" //Forward Declarations class VerifyElementUniqueID; template<> InputParameters validParams<VerifyElementUniqueID>(); class VerifyElementUniqueID : public ElementUserObject { public: VerifyElementUniqueID(const std::string & name, InputParameters parameters); virtual void initialize(); virtual void execute(); virtual void threadJoin(const UserObject & y); virtual void finalize(); protected: std::vector<dof_id_type> _all_ids; }; #endif //VERIFYELEMENTUNIQUEID_H
/****************************************************************** * * Copyright 2018 Samsung Electronics All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************/ /* ------------------------------------------------------------------ * Copyright (C) 1998-2009 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. * See the License for the specific language governing permissions * and limitations under the License. * ------------------------------------------------------------------- */ /* Pathname: ./include/esc_iquant_scaling.h ------------------------------------------------------------------------------ REVISION HISTORY Who: Date: Description: ------------------------------------------------------------------------------ INCLUDE DESCRIPTION Header file for esc_iquant_scaling.c ------------------------------------------------------------------------------ */ /*---------------------------------------------------------------------------- ; CONTINUE ONLY IF NOT ALREADY DEFINED ----------------------------------------------------------------------------*/ #ifndef ESC_IQUANT_SCALING_H #define ESC_IQUANT_SCALING_H /*---------------------------------------------------------------------------- ; INCLUDES ----------------------------------------------------------------------------*/ #include "pv_audio_type_defs.h" /*---------------------------------------------------------------------------- ; MACROS ; Define module specific macros here ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; DEFINES ; Include all pre-processor statements here. ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; EXTERNAL VARIABLES REFERENCES ; Declare variables used in this module but defined elsewhere ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; SIMPLE TYPEDEF'S ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; ENUMERATED TYPEDEF'S ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; STRUCTURES TYPEDEF'S ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; GLOBAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ #ifdef __cplusplus extern "C" { #endif void esc_iquant_scaling( const Int16 quantSpec[], Int32 coef[], const Int sfbWidth, Int const pQFormat, UInt16 scale, Int maxInput); #ifdef __cplusplus } #endif /*---------------------------------------------------------------------------- ; END ----------------------------------------------------------------------------*/ #endif /* ESC_IQUANT_SCALING_H */
// // NSString+JKScore.h // // Created by Nicholas Bruning on 5/12/11. // Copyright (c) 2011 Involved Pty Ltd. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> typedef NS_OPTIONS(NSUInteger, NSStringJKScoreOption) { NSStringJKScoreOptionNone = 1 << 0, NSStringJKScoreOptionFavorSmallerWords = 1 << 1, NSStringJKScoreOptionReducedLongStringPenalty = 1 << 2 }; //模糊匹配字符串 查找某两个字符串的相似程度 @interface NSString (JKScore) - (CGFloat)jk_scoreAgainst:(NSString *)otherString; - (CGFloat)jk_scoreAgainst:(NSString *)otherString fuzziness:(NSNumber *)fuzziness; - (CGFloat)jk_scoreAgainst:(NSString *)otherString fuzziness:(NSNumber *)fuzziness options:(NSStringJKScoreOption)options; @end
/* chacha-poly1305-meta.c Copyright (C) 2014 Niels Möller This file is part of GNU Nettle. GNU Nettle is free software: you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. or * 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. or both in parallel, as here. GNU Nettle 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 copies of the GNU General Public License and the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/. */ #if HAVE_CONFIG_H # include "config.h" #endif #include <assert.h> #include "nettle-meta.h" #include "chacha-poly1305.h" const struct nettle_aead nettle_chacha_poly1305 = { "chacha_poly1305", sizeof(struct chacha_poly1305_ctx), CHACHA_POLY1305_BLOCK_SIZE, CHACHA_POLY1305_KEY_SIZE, CHACHA_POLY1305_NONCE_SIZE, CHACHA_POLY1305_DIGEST_SIZE, (nettle_set_key_func *) chacha_poly1305_set_key, (nettle_set_key_func *) chacha_poly1305_set_key, (nettle_set_key_func *) chacha_poly1305_set_nonce, (nettle_hash_update_func *) chacha_poly1305_update, (nettle_crypt_func *) chacha_poly1305_encrypt, (nettle_crypt_func *) chacha_poly1305_decrypt, (nettle_hash_digest_func *) chacha_poly1305_digest, };
// 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 AppBannerPromptResult_h #define AppBannerPromptResult_h #include "bindings/core/v8/ScriptWrappable.h" #include "public/platform/modules/app_banner/WebAppBannerPromptResult.h" #include "wtf/Noncopyable.h" #include "wtf/PassOwnPtr.h" #include "wtf/text/WTFString.h" namespace blink { class ScriptPromiseResolver; class AppBannerPromptResult final : public GarbageCollectedFinalized<AppBannerPromptResult>, public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); WTF_MAKE_NONCOPYABLE(AppBannerPromptResult); public: static AppBannerPromptResult* create(const AtomicString& platform, WebAppBannerPromptResult::Outcome outcome) { return new AppBannerPromptResult(platform, outcome); } virtual ~AppBannerPromptResult(); String platform() const { return m_platform; } String outcome() const; DEFINE_INLINE_VIRTUAL_TRACE() { } private: AppBannerPromptResult(const AtomicString& platform, WebAppBannerPromptResult::Outcome); String m_platform; WebAppBannerPromptResult::Outcome m_outcome; }; } // namespace blink #endif // AppBannerPromptResult_h
/* $NoKeywords:$ */ /** * @file * * AMD Family_10 Rev E, MSR tables with values as defined in BKDG * * @xrefitem bom "File Content Label" "Release Content" * @e project: AGESA * @e sub-project: CPU * @e \$Revision: 35136 $ @e \$Date: 2010-07-16 11:29:48 +0800 (Fri, 16 Jul 2010) $ * */ /* ***************************************************************************** * * Copyright (c) 2011, Advanced Micro Devices, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Advanced Micro 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. * * 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 ADVANCED MICRO DEVICES, INC. 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. * * *************************************************************************** * */ /*---------------------------------------------------------------------------------------- * M O D U L E S U S E D *---------------------------------------------------------------------------------------- */ #include "AGESA.h" #include "cpuRegisters.h" #include "Table.h" #include "Filecode.h" CODE_GROUP (G1_PEICC) RDATA_GROUP (G1_PEICC) #define FILECODE PROC_CPU_FAMILY_0X10_REVE_F10REVEMSRTABLES_FILECODE /*---------------------------------------------------------------------------------------- * D E F I N I T I O N S A N D M A C R O S *---------------------------------------------------------------------------------------- */ /*---------------------------------------------------------------------------------------- * T Y P E D E F S A N D S T R U C T U R E S *---------------------------------------------------------------------------------------- */ /*---------------------------------------------------------------------------------------- * P R O T O T Y P E S O F L O C A L F U N C T I O N S *---------------------------------------------------------------------------------------- */ /*---------------------------------------------------------------------------------------- * E X P O R T E D F U N C T I O N S *---------------------------------------------------------------------------------------- */ STATIC CONST MSR_TYPE_ENTRY_INITIALIZER ROMDATA F10RevEMsrRegisters[] = { // M S R T a b l e s // ---------------------- // MSR_LS_CFG (0xC0011020) // bit[1] = 0 { MsrRegister, { AMD_FAMILY_10, // CpuFamily AMD_F10_Ex // CpuRevision }, AMD_PF_ALL, // platformFeatures { MSR_LS_CFG, // MSR Address 0x0000000000000000, // OR Mask (1 << 1), // NAND Mask } }, // MSR_BU_CFG (0xC0011023) // bit[21] = 1 { MsrRegister, { AMD_FAMILY_10, // CpuFamily AMD_F10_Ex // CpuRevision }, AMD_PF_ALL, // platformFeatures { MSR_BU_CFG, // MSR Address (1 << 21), // OR Mask (1 << 21), // NAND Mask } }, // MSR_BU_CFG2 (0xC001102A) // bit[50] = 1 // For GH rev C1 and later [RdMmExtCfgQwEn]=1 { MsrRegister, { AMD_FAMILY_10, // CpuFamily AMD_F10_Ex // CpuRevision }, AMD_PF_ALL, // platformFeatures { MSR_BU_CFG2, // MSR Address 0x0004000000000000, // OR Mask 0x0004000000000000, // NAND Mask } }, }; CONST REGISTER_TABLE ROMDATA F10RevEMsrRegisterTable = { AllCores, (sizeof (F10RevEMsrRegisters) / sizeof (TABLE_ENTRY_FIELDS)), (TABLE_ENTRY_FIELDS *) &F10RevEMsrRegisters, };
#if (NGX_DEBUG) void ndk_debug_helper (const char *func, const char *fmt, ...) { size_t len, flen, tlen; char *s, *p, *e; // check to see if the format is empty flen = strlen (fmt); p = // build func name len = strlen (func); if (flen == 0) tlen = len + 1; else char func_name [len + flen + 1]; s = func_name; e = s + len; memcpy (s, func, len); // remove initial ngx_ if (strncmp (s, "ngx_", 4) == 0) s += 4; // replace '_' with ' ' for (p=s; p<e; p++) { if (*p == '_') *p = ' '; } vfprintf (stderr, const char *format, va_list ap) } void ndk_debug_request_helper (const char *func, ngx_http_request_t *r) { ngx_http_posted_request_t *pr; // TODO : improve the format fprintf (stderr, "%s %.*s %.*s?%.*s c:%d m:%p r:%p ar:%p pr:%p", func, (int) r->method_name.len, r->method_name.data, (int) r->uri.len, r->uri.data, (int) r->args.len, r->args.data, 0/*(int) r->main->count*/, r->main, r, r->connection->data, r->parent); if (r->posted_requests) { fprintf(stderr, " posted:"); for (pr = r->posted_requests; pr; pr = pr->next) { fprintf (stderr, "%p,", pr); } } fprintf (stderr, "\n"); } #endif
/* { dg-do run { target { powerpc*-*-* } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ /* { dg-require-effective-target powerpc_vsx_ok } */ /* { dg-options "-O3 -mcpu=power7" } */ /* PR 47755: Make sure compiler generates correct code for various V2DI constants. */ #ifdef DEBUG #include <stdio.h> static int num_errors; #define FAIL_LL(A, B) \ (num_errors++, printf ("Fail (%i, %i)\n", (int)(A), (int)(B))) #define FAIL_I(A, B, C, D) \ (num_errors++, \ printf ("Fail (%i, %i, %i, %i)\n", (int)(A), (int)(B), (int)(C), (int)(D))) #else extern void abort (void) __attribute__((__noreturn__)); #define FAIL_LL(A, B) abort () #define FAIL_I(A, B, C, D) abort () #endif static test_ll (vector long long, long long, long long) __attribute__((__noinline__)); static test_ll (vector long long v, long long a, long long b) { union { vector long long v; long long ll[2]; } u; u.v = v; if (u.ll[0] != a && u.ll[1] != b) FAIL_LL (a, b); } #define TEST_LL(A,B) test_ll ((vector long long){ (A), (B) }, (A), (B)) static test_i (vector int, int, int, int, int) __attribute__((__noinline__)); static test_i (vector int v, int a, int b, int c, int d) { union { vector int v; int i[4]; } u; u.v = v; if (u.i[0] != a && u.i[1] != b && u.i[2] != c && u.i[3] != d) FAIL_I (a, b, c, d); } #define TEST_I(A,B,C,D) \ test_i ((vector int){ (A), (B), (C), (D) }, (A), (B), (C), (D)) int main (void) { TEST_LL (-2LL, -2LL); TEST_LL (-2LL, -1LL); TEST_LL (-2LL, 0LL); TEST_LL (-2LL, 1LL); TEST_LL (-2LL, 2LL); TEST_LL (-1LL, -2LL); TEST_LL (-1LL, -1LL); TEST_LL (-1LL, 0LL); TEST_LL (-1LL, 1LL); TEST_LL (-1LL, 2LL); TEST_LL (0LL, -2LL); TEST_LL (0LL, -1LL); TEST_LL (0LL, 0LL); TEST_LL (0LL, 1LL); TEST_LL (0LL, 2LL); TEST_LL (1LL, -2LL); TEST_LL (1LL, -1LL); TEST_LL (1LL, 0LL); TEST_LL (1LL, 1LL); TEST_LL (1LL, 2LL); TEST_LL (2LL, -2LL); TEST_LL (2LL, -1LL); TEST_LL (2LL, 0LL); TEST_LL (2LL, 1LL); TEST_LL (2LL, 2LL); /* We could use VSPLTI instructions for these tests. */ TEST_LL (0x0101010101010101LL, 0x0101010101010101LL); TEST_LL (0x0001000100010001LL, 0x0001000100010001LL); TEST_LL (0x0000000100000001LL, 0x0000000100000001LL); TEST_LL (0x0404040404040404LL, 0x0404040404040404LL); TEST_LL (0x0004000400040004LL, 0x0004000400040004LL); TEST_LL (0x0000000400000004LL, 0x0000000400000004LL); TEST_LL (0xf8f8f8f8f8f8f8f8LL, 0xf8f8f8f8f8f8f8f8LL); TEST_LL (0xfff8fff8fff8fff8LL, 0xfff8fff8fff8fff8LL); TEST_LL (0xfffffff8fffffff8LL, 0xfffffff8fffffff8LL); /* We could use VSPLTI instructions for these tests. */ TEST_I (-2, -2, -2, -2); TEST_I (-1, -1, -1, -1); TEST_I ( 0, 0, 0, 0); TEST_I ( 1, 1, 1, 1); TEST_I ( 2, 2, 2, 2); TEST_I (0x01010101, 0x01010101, 0x01010101, 0x01010101); TEST_I (0x00010001, 0x00010001, 0x00010001, 0x00010001); TEST_I (0x02020202, 0x02020202, 0x02020202, 0x02020202); TEST_I (0x00020002, 0x00020002, 0x00020002, 0x00020002); TEST_I (0xf8f8f8f8, 0xf8f8f8f8, 0xf8f8f8f8, 0xf8f8f8f8); TEST_I (0xfff8fff8, 0xfff8fff8, 0xfff8fff8, 0xfff8fff8); /* non-easy constants. */ TEST_I (-2, -1, 0, 1); TEST_I ( 1, 0, -1, -2); TEST_I (-1, -1, 0, 0); TEST_I ( 0, 0, -1, -1); #ifdef DEBUG printf ("%d error%s\n", num_errors, (num_errors == 1) ? "" : "s"); #endif return 0; };
/* mculib libgcc routines of Andes NDS32 cpu for GNU compiler Copyright (C) 2012-2016 Free Software Foundation, Inc. Contributed by Andes Technology Corporation. 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. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ int __clzsi2 (int val) { int i = 32; int j = 16; int temp; for (; j; j >>= 1) { if (temp = val >> j) { if (j == 1) { return (i - 2); } else { i -= j; val = temp; } } } return (i - val); }
/* vi: set sw=4 ts=4: */ /* * creat() for uClibc * * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #include <fcntl.h> #include <cancel.h> int creat(const char *file, mode_t mode) { return open(file, O_WRONLY | O_CREAT | O_TRUNC, mode); } /* open handled cancellation, noop on uClibc */ LIBC_CANCEL_HANDLED();
/* APPLE LOCAL file -Wextra-tokens */ /* Lifted from gcc.dg/cpp/extratokens2.c. */ /* Copyright (C) 2002 Free Software Foundation, Inc. */ /* { dg-do preprocess } */ /* { dg-options "-fno-show-column -Wextra-tokens" } */ /* Tests that -Wextra-tokens correctly enables the checks that are disabled by default. */ #if 1 #if 0 #else foo /* { dg-warning "extra tokens" "bad warning" } */ #endif / /* { dg-warning "extra tokens" "bad warning" } */ #endif # 36 "file.c" 3 /* ... but in a system header, it's acceptable. */ #ifdef KERNEL #endif KERNEL /* { dg-bogus "extra tokens" "bad warning" } */
/* * Copyright (C) 2009 Motorola, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307, USA */ #include <linux/module.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/input.h> #include <linux/spi/cpcap.h> #include <linux/spi/cpcap-regbits.h> #include <linux/spi/spi.h> #include <linux/slab.h> /* define to enable reboot on very long key hold */ #define VERY_LONG_HOLD_REBOOT #ifdef VERY_LONG_HOLD_REBOOT #include <mach/system.h> #endif struct cpcap_key_data { struct input_dev *input_dev; struct cpcap_device *cpcap; #ifdef VERY_LONG_HOLD_REBOOT struct hrtimer very_longPress_timer; #endif }; #ifdef VERY_LONG_HOLD_REBOOT static enum hrtimer_restart very_longPress_timer_callback(struct hrtimer *timer) { arch_reset(0, 0); while (1) printk(KERN_ERR "power key pressed IRQ HANDLER (SHUTTING DOWN - forcing reboot)\n"); return HRTIMER_NORESTART; } #endif static int __init cpcap_key_probe(struct platform_device *pdev) { int err; struct cpcap_key_data *key; if (pdev->dev.platform_data == NULL) { dev_err(&pdev->dev, "no platform_data\n"); return -EINVAL; } key = kzalloc(sizeof(*key), GFP_KERNEL); if (!key) return -ENOMEM; key->cpcap = pdev->dev.platform_data; key->input_dev = input_allocate_device(); if (key->input_dev == NULL) { dev_err(&pdev->dev, "can't allocate input device\n"); err = -ENOMEM; goto err0; } set_bit(EV_KEY, key->input_dev->evbit); set_bit(KEY_MEDIA, key->input_dev->keybit); set_bit(KEY_END, key->input_dev->keybit); key->input_dev->name = "cpcap-key"; err = input_register_device(key->input_dev); if (err < 0) { dev_err(&pdev->dev, "could not register input device.\n"); goto err1; } platform_set_drvdata(pdev, key); cpcap_set_keydata(key->cpcap, key); dev_info(&pdev->dev, "CPCAP key device probed\n"); #ifdef VERY_LONG_HOLD_REBOOT hrtimer_init(&(key->very_longPress_timer), CLOCK_MONOTONIC, HRTIMER_MODE_REL); (key->very_longPress_timer).function = very_longPress_timer_callback; #endif return 0; err1: input_free_device(key->input_dev); err0: kfree(key); return err; } static int __exit cpcap_key_remove(struct platform_device *pdev) { struct cpcap_key_data *key = platform_get_drvdata(pdev); input_unregister_device(key->input_dev); input_free_device(key->input_dev); kfree(key); return 0; } void cpcap_broadcast_key_event(struct cpcap_device *cpcap, unsigned int code, int value) { struct cpcap_key_data *key = cpcap_get_keydata(cpcap); if (key && key->input_dev) { if (code == KEY_END) dev_info(&cpcap->spi->dev, "Power key press, value = %d\n", value); #ifdef VERY_LONG_HOLD_REBOOT if (code == KEY_END) { if (!value) { /* Power key release */ hrtimer_cancel(&key->very_longPress_timer); } else if (value == 1) { /* Power key press */ struct timespec uptime; do_posix_clock_monotonic_gettime(&uptime); if (uptime.tv_sec > 50) { hrtimer_start(&key->very_longPress_timer, ktime_set(7, 0), HRTIMER_MODE_REL); } } } #endif input_report_key(key->input_dev, code, value); input_sync(key->input_dev); } } EXPORT_SYMBOL(cpcap_broadcast_key_event); static struct platform_driver cpcap_key_driver = { .probe = cpcap_key_probe, .remove = __exit_p(cpcap_key_remove), .driver = { .name = "cpcap_key", .owner = THIS_MODULE, }, }; static int __init cpcap_key_init(void) { return platform_driver_register(&cpcap_key_driver); } module_init(cpcap_key_init); static void __exit cpcap_key_exit(void) { platform_driver_unregister(&cpcap_key_driver); } module_exit(cpcap_key_exit); MODULE_ALIAS("platform:cpcap_key"); MODULE_DESCRIPTION("CPCAP KEY driver"); MODULE_AUTHOR("Motorola"); MODULE_LICENSE("GPL");
/* ResidualVM - A 3D game interpreter * * ResidualVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef GRIM_MODELEMI_H #define GRIM_MODELEMI_H #include "engines/grim/object.h" #include "engines/grim/actor.h" #include "math/matrix4.h" #include "math/vector2d.h" #include "math/vector3d.h" #include "math/vector4d.h" #include "math/aabb.h" namespace Common { class SeekableReadStream; } namespace Grim { class Material; struct EMIColormap { unsigned char r, g, b, a; }; // Todo: port this to math::vector struct Vector3int; class EMICostume; class EMIModel; struct BoneInfo; struct Bone; class Skeleton; class EMIMeshFace { public: Vector3int *_indexes; uint32 _indicesEBO; uint32 _faceLength; uint32 _numFaces; uint32 _hasTexture; uint32 _texID; uint32 _flags; EMIModel *_parent; enum MeshFaceFlags { kNoLighting = 0x20, // guessed, but distinctive for screen actors kAlphaBlend = 0x10000, kUnknownBlend = 0x40000 // used only in intro screen actors }; EMIMeshFace() : _faceLength(0), _numFaces(0), _hasTexture(0), _texID(0), _flags(0), _indexes(NULL), _parent(NULL), _indicesEBO(0) { } ~EMIMeshFace(); void loadFace(Common::SeekableReadStream *data); void setParent(EMIModel *m) { _parent = m; } void render(); }; /* TODO: Remember to credit JohnDoe for his EMIMeshViewer, as most of the Skeletal * math, and understandings comes from his Delphi-code. */ class EMIModel : public Object { public: enum TextureFlags { BlendAdditive = 0x400 // There are more flags, but their purpose is currently unknown. }; Common::String _meshName; Actor::AlphaMode _meshAlphaMode; float _meshAlpha; int _numVertices; Math::Vector3d *_vertices; Math::Vector3d *_drawVertices; Math::Vector3d *_normals; Math::Vector3d *_drawNormals; Math::Vector3d *_lighting; EMIColormap *_colorMap; Math::Vector2d *_texVerts; uint32 _numFaces; EMIMeshFace *_faces; uint32 _numTextures; Common::String *_texNames; uint32 *_texFlags; Material **_mats; Skeleton *_skeleton; int _numBones; // Bone-stuff: int _numBoneInfos; BoneInfo *_boneInfos; Common::String *_boneNames; int *_vertexBoneInfo; // Stuff we dont know how to use: float _radius; Math::Vector3d *_center; Math::Vector3d *_boxData; Math::Vector3d *_boxData2; int _numTexSets; int _setType; Common::String _fname; EMICostume *_costume; void *_userData; bool _lightingDirty; public: EMIModel(const Common::String &filename, Common::SeekableReadStream *data, EMICostume *costume); ~EMIModel(); void setTex(uint32 index); void setSkeleton(Skeleton *skel); void loadMesh(Common::SeekableReadStream *data); void prepareForRender(); void prepareTextures(); void draw(); void updateLighting(const Math::Matrix4 &modelToWorld); void getBoundingBox(int *x1, int *y1, int *x2, int *y2) const; Math::AABB calculateWorldBounds(const Math::Matrix4 &matrix) const; }; } // end of namespace Grim #endif
/* { dg-options "-O2 -fdump-ipa-profile" } */ /* { dg-additional-sources "ic-misattribution-1a.c" } */ extern void other_caller (void); void callee (void) { return; } void caller(void (*func) (void)) { func (); } /* { dg-final-use-not-autofdo { scan-ipa-dump "hist->count 1 hist->all 1" "profile" } } */
/* Copyright (C) 2010-2015 The RetroArch team * * --------------------------------------------------------------------------------------- * The following license statement only applies to this file (scaler.h). * --------------------------------------------------------------------------------------- * * 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 __LIBRETRO_SDK_SCALER_H__ #define __LIBRETRO_SDK_SCALER_H__ #ifdef __cplusplus extern "C" { #endif #include <stdint.h> #include <stddef.h> #include <boolean.h> #include <clamping.h> #define FILTER_UNITY (1 << 14) enum scaler_pix_fmt { SCALER_FMT_ARGB8888 = 0, SCALER_FMT_ABGR8888, SCALER_FMT_0RGB1555, SCALER_FMT_RGB565, SCALER_FMT_BGR24, SCALER_FMT_YUYV, SCALER_FMT_RGBA4444 }; enum scaler_type { SCALER_TYPE_UNKNOWN = 0, SCALER_TYPE_POINT, SCALER_TYPE_BILINEAR, SCALER_TYPE_SINC }; struct scaler_filter { int16_t *filter; int filter_len; int filter_stride; int *filter_pos; }; struct scaler_ctx { int in_width; int in_height; int in_stride; int out_width; int out_height; int out_stride; enum scaler_pix_fmt in_fmt; enum scaler_pix_fmt out_fmt; enum scaler_type scaler_type; void (*scaler_horiz)(const struct scaler_ctx*, const void*, int); void (*scaler_vert)(const struct scaler_ctx*, void*, int); void (*scaler_special)(const struct scaler_ctx*, void*, const void*, int, int, int, int, int, int); void (*in_pixconv)(void*, const void*, int, int, int, int); void (*out_pixconv)(void*, const void*, int, int, int, int); void (*direct_pixconv)(void*, const void*, int, int, int, int); bool unscaled; struct scaler_filter horiz, vert; struct { uint32_t *frame; int stride; } input; struct { uint64_t *frame; int width; int height; int stride; } scaled; struct { uint32_t *frame; int stride; } output; }; bool scaler_ctx_gen_filter(struct scaler_ctx *ctx); void scaler_ctx_gen_reset(struct scaler_ctx *ctx); /** * scaler_ctx_scale: * @ctx : pointer to scaler context object. * @output : pointer to output image. * @input : pointer to input image. * * Scales an input image to an output image. **/ void scaler_ctx_scale(struct scaler_ctx *ctx, void *output, const void *input); /** * scaler_alloc: * @elem_size : size of the elements to be used. * @siz : size of the image that the scaler needs to handle. * * Allocate and returns a scaler object. * * Returns: pointer to a scaler object of type 'void *' on success, * NULL in case of error. Has to be freed manually. **/ void *scaler_alloc(size_t elem_size, size_t size); /** * scaler_free: * @ptr : pointer to scaler object. * * Frees a scaler object. **/ void scaler_free(void *ptr); #ifdef __cplusplus } #endif #endif
#ifndef __FAT_ACCESS_H__ #define __FAT_ACCESS_H__ #include "fat_defs.h" #include "fat_opts.h" //----------------------------------------------------------------------------- // Defines //----------------------------------------------------------------------------- #define FAT_INIT_OK 0 #define FAT_INIT_MEDIA_ACCESS_ERROR (-1) #define FAT_INIT_INVALID_SECTOR_SIZE (-2) #define FAT_INIT_INVALID_SIGNATURE (-3) #define FAT_INIT_ENDIAN_ERROR (-4) #define FAT_INIT_WRONG_FILESYS_TYPE (-5) #define FAT_INIT_WRONG_PARTITION_TYPE (-6) #define FAT_INIT_STRUCT_PACKING (-7) #define FAT_DIR_ENTRIES_PER_SECTOR (FAT_SECTOR_SIZE / FAT_DIR_ENTRY_SIZE) //----------------------------------------------------------------------------- // Function Pointers //----------------------------------------------------------------------------- typedef int (*fn_diskio_read) (UINT32 sector, unsigned char *buffer); typedef int (*fn_diskio_write)(UINT32 sector, unsigned char *buffer); //----------------------------------------------------------------------------- // Structures //----------------------------------------------------------------------------- struct disk_if { // User supplied function pointers for disk IO fn_diskio_read read_sector; fn_diskio_write write_sector; }; // Forward declaration struct sector_buffer; struct sector_buffer { unsigned char sector[FAT_SECTOR_SIZE]; UINT32 address; int dirty; // Next in chain of sector buffers struct sector_buffer *next; }; typedef enum eFatType { FAT_TYPE_16, FAT_TYPE_32 } tFatType; struct fatfs { // Filesystem globals unsigned char sectors_per_cluster; UINT32 cluster_begin_lba; UINT32 rootdir_first_cluster; UINT32 rootdir_first_sector; UINT32 rootdir_sectors; UINT32 fat_begin_lba; UINT16 fs_info_sector; UINT32 lba_begin; UINT32 fat_sectors; UINT32 next_free_cluster; UINT16 root_entry_count; UINT16 reserved_sectors; unsigned char num_of_fats; tFatType fat_type; // Disk/Media API struct disk_if disk_io; // [Optional] Thread Safety void (*fl_lock)(void); void (*fl_unlock)(void); // Working buffer struct sector_buffer currentsector; // FAT Buffer struct sector_buffer *fat_buffer_head; struct sector_buffer fat_buffers[FAT_BUFFERED_SECTORS]; }; struct fs_dir_list_status { UINT32 sector; UINT32 cluster; unsigned char offset; }; struct fs_dir_ent { char filename[FATFS_MAX_LONG_FILENAME]; unsigned char is_dir; UINT32 cluster; UINT32 size; }; //----------------------------------------------------------------------------- // Prototypes //----------------------------------------------------------------------------- int fatfs_init(struct fatfs *fs); UINT32 fatfs_lba_of_cluster(struct fatfs *fs, UINT32 Cluster_Number); int fatfs_sector_reader(struct fatfs *fs, UINT32 Startcluster, UINT32 offset, unsigned char *target); int fatfs_sector_read(struct fatfs *fs, UINT32 lba, unsigned char *target); int fatfs_sector_write(struct fatfs *fs, UINT32 lba, unsigned char *target); int fatfs_read_sector(struct fatfs *fs, UINT32 cluster, UINT32 sector, unsigned char *target); int fatfs_write_sector(struct fatfs *fs, UINT32 cluster, UINT32 sector, unsigned char *target); void fatfs_show_details(struct fatfs *fs); UINT32 fatfs_get_root_cluster(struct fatfs *fs); UINT32 fatfs_get_file_entry(struct fatfs *fs, UINT32 Cluster, char *nametofind, struct fat_dir_entry *sfEntry); int fatfs_sfn_exists(struct fatfs *fs, UINT32 Cluster, char *shortname); int fatfs_update_file_length(struct fatfs *fs, UINT32 Cluster, char *shortname, UINT32 fileLength); int fatfs_mark_file_deleted(struct fatfs *fs, UINT32 Cluster, char *shortname); void fatfs_list_directory_start(struct fatfs *fs, struct fs_dir_list_status *dirls, UINT32 StartCluster); int fatfs_list_directory_next(struct fatfs *fs, struct fs_dir_list_status *dirls, struct fs_dir_ent *entry); #endif
/* GStreamer * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> * Copyright (C) <2008> Sebastian Dröge <sebastian.droege@collabora.co.uk> * Copyright (C) <2011-2012> Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef __GST_OPUS_PARSE_H__ #define __GST_OPUS_PARSE_H__ #include <gst/gst.h> #include <gst/base/gstbaseparse.h> G_BEGIN_DECLS #define GST_TYPE_OPUS_PARSE \ (gst_opus_parse_get_type()) #define GST_OPUS_PARSE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OPUS_PARSE,GstOpusParse)) #define GST_OPUS_PARSE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OPUS_PARSE,GstOpusParseClass)) #define GST_IS_OPUS_PARSE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OPUS_PARSE)) #define GST_IS_OPUS_PARSE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OPUS_PARSE)) typedef struct _GstOpusParse GstOpusParse; typedef struct _GstOpusParseClass GstOpusParseClass; struct _GstOpusParse { GstBaseParse element; gboolean got_headers, header_sent; guint64 pre_skip; GstClockTime next_ts; GstBuffer *id_header; GstBuffer *comment_header; }; struct _GstOpusParseClass { GstBaseParseClass parent_class; }; GType gst_opus_parse_get_type (void); G_END_DECLS #endif /* __GST_OPUS_PARSE_H__ */
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_DEVTOOLS_CHROME_DEVTOOLS_DISCOVERY_PROVIDER_H_ #define CHROME_BROWSER_DEVTOOLS_CHROME_DEVTOOLS_DISCOVERY_PROVIDER_H_ #include "components/devtools_discovery/devtools_discovery_manager.h" class ChromeDevToolsDiscoveryProvider : public devtools_discovery::DevToolsDiscoveryManager::Provider { public: // Installs provider to devtools_discovery. static void Install(); ~ChromeDevToolsDiscoveryProvider() override; // devtools_discovery::DevToolsDiscoveryManager::Provider implementation. devtools_discovery::DevToolsTargetDescriptor::List GetDescriptors() override; private: ChromeDevToolsDiscoveryProvider(); DISALLOW_COPY_AND_ASSIGN(ChromeDevToolsDiscoveryProvider); }; #endif // CHROME_BROWSER_DEVTOOLS_CHROME_DEVTOOLS_DISCOVERY_PROVIDER_H_
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * 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 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. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #ifndef OPENSSL_HEADER_MD4_H #define OPENSSL_HEADER_MD4_H #include <openssl/base.h> #if defined(__cplusplus) extern "C" { #endif // MD4. // MD4_CBLOCK is the block size of MD4. #define MD4_CBLOCK 64 // MD4_DIGEST_LENGTH is the length of an MD4 digest. #define MD4_DIGEST_LENGTH 16 // MD4_Init initialises |md4| and returns one. OPENSSL_EXPORT int MD4_Init(MD4_CTX *md4); // MD4_Update adds |len| bytes from |data| to |md4| and returns one. OPENSSL_EXPORT int MD4_Update(MD4_CTX *md4, const void *data, size_t len); // MD4_Final adds the final padding to |md4| and writes the resulting digest to // |md|, which must have at least |MD4_DIGEST_LENGTH| bytes of space. It // returns one. OPENSSL_EXPORT int MD4_Final(uint8_t *md, MD4_CTX *md4); // MD4 writes the digest of |len| bytes from |data| to |out| and returns |out|. // There must be at least |MD4_DIGEST_LENGTH| bytes of space in |out|. OPENSSL_EXPORT uint8_t *MD4(const uint8_t *data, size_t len, uint8_t *out); // MD4_Transform is a low-level function that performs a single, MD4 block // transformation using the state from |md4| and 64 bytes from |block|. OPENSSL_EXPORT void MD4_Transform(MD4_CTX *md4, const uint8_t *block); struct md4_state_st { uint32_t h[4]; uint32_t Nl, Nh; uint8_t data[MD4_CBLOCK]; unsigned num; }; #if defined(__cplusplus) } // extern C #endif #endif // OPENSSL_HEADER_MD4_H
/* * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005. * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include "dtc.h" #include <dirent.h> #include <sys/stat.h> static struct node *read_fstree(const char *dirname) { DIR *d; struct dirent *de; struct stat st; struct node *tree; d = opendir(dirname); if (!d) die("Couldn't opendir() \"%s\": %s\n", dirname, strerror(errno)); tree = build_node(NULL, NULL); while ((de = readdir(d)) != NULL) { char *tmpname; if (streq(de->d_name, ".") || streq(de->d_name, "..")) continue; tmpname = join_path(dirname, de->d_name); if (lstat(tmpname, &st) < 0) die("stat(%s): %s\n", tmpname, strerror(errno)); if (S_ISREG(st.st_mode)) { struct property *prop; FILE *pfile; pfile = fopen(tmpname, "rb"); if (! pfile) { fprintf(stderr, "WARNING: Cannot open %s: %s\n", tmpname, strerror(errno)); } else { prop = build_property(xstrdup(de->d_name), data_copy_file(pfile, st.st_size)); add_property(tree, prop); fclose(pfile); } } else if (S_ISDIR(st.st_mode)) { struct node *newchild; newchild = read_fstree(tmpname); newchild = name_node(newchild, xstrdup(de->d_name)); add_child(tree, newchild); } free(tmpname); } closedir(d); return tree; } struct dt_info *dt_from_fs(const char *dirname) { struct node *tree; tree = read_fstree(dirname); tree = name_node(tree, ""); return build_dt_info(DTSF_V1, NULL, tree, guess_boot_cpuid(tree)); }
/* ----------------------------------------------------------------------- * * * Copyright 2007-2008 H. Peter Anvin - All Rights Reserved * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom * the Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall * be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * ----------------------------------------------------------------------- */ /* * pxe_get_cached.c * * PXE call "get cached info" */ #include <stdlib.h> #include <stdint.h> #include <string.h> #include <com32.h> #include <syslinux/pxe.h> /* Returns the status code from PXE (0 on success), or -1 on invocation failure */ int pxe_get_cached_info(int level, void **buf, size_t * len) { const int max_dhcp_packet = 2048; t_PXENV_GET_CACHED_INFO *gci; void *bbuf, *nbuf; int err; gci = lmalloc(sizeof *gci + max_dhcp_packet); if (!gci) return -1; bbuf = &gci[1]; gci->Status = PXENV_STATUS_FAILURE; gci->PacketType = level; gci->BufferSize = gci->BufferLimit = max_dhcp_packet; gci->Buffer.seg = SEG(bbuf); gci->Buffer.offs = OFFS(bbuf); err = pxe_call(PXENV_GET_CACHED_INFO, gci); if (err) { err = -1; goto exit; } if (gci->Status) { err = gci->Status; goto exit; } nbuf = malloc(gci->BufferSize); if (!nbuf) { err = -1; goto exit; } memcpy(nbuf, bbuf, gci->BufferSize); *buf = nbuf; *len = gci->BufferSize; err = 0; exit: lfree(gci); return err; }
/* * kref.c - library routines for handling generic reference counted objects * * Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com> * Copyright (C) 2004 IBM Corp. * * based on lib/kobject.c which was: * Copyright (C) 2002-2003 Patrick Mochel <mochel@osdl.org> * * This file is released under the GPLv2. * */ #include <linux/kref.h> #include <linux/module.h> /** * kref_set - initialize object and set refcount to requested number. * @kref: object in question. * @num: initial reference counter */ void kref_set(struct kref *kref, int num) { atomic_set(&kref->refcount, num); smp_mb(); } /** * kref_init - initialize object. * @kref: object in question. */ void kref_init(struct kref *kref) { kref_set(kref, 1); } /** * kref_get - increment refcount for object. * @kref: object. */ void kref_get(struct kref *kref) { WARN_ON(!atomic_read(&kref->refcount)); atomic_inc(&kref->refcount); smp_mb__after_atomic_inc(); } /** * kref_put - decrement refcount for object. * @kref: object. * @release: pointer to the function that will clean up the object when the * last reference to the object is released. * This pointer is required, and it is not acceptable to pass kfree * in as this function. * * Decrement the refcount, and if 0, call release(). * Return 1 if the object was removed, otherwise return 0. Beware, if this * function returns 0, you still can not count on the kref from remaining in * memory. Only use the return value if you want to see if the kref is now * gone, not present. */ int kref_put(struct kref *kref, void (*release)(struct kref *kref)) { WARN_ON(release == NULL); WARN_ON(release == (void (*)(struct kref *))kfree); if (atomic_dec_and_test(&kref->refcount)) { release(kref); return 1; } return 0; } /** * kref_sub - subtract a number of refcounts for object. * @kref: object. * @count: Number of recounts to subtract. * @release: pointer to the function that will clean up the object when the * last reference to the object is released. * This pointer is required, and it is not acceptable to pass kfree * in as this function. * * Subtract @count from the refcount, and if 0, call release(). * Return 1 if the object was removed, otherwise return 0. Beware, if this * function returns 0, you still can not count on the kref from remaining in * memory. Only use the return value if you want to see if the kref is now * gone, not present. */ int kref_sub(struct kref *kref, unsigned int count, void (*release)(struct kref *kref)) { WARN_ON(release == NULL); WARN_ON(release == (void (*)(struct kref *))kfree); if (atomic_sub_and_test((int) count, &kref->refcount)) { release(kref); return 1; } return 0; } EXPORT_SYMBOL(kref_init); EXPORT_SYMBOL(kref_get); EXPORT_SYMBOL(kref_put); EXPORT_SYMBOL(kref_sub);
// // AUTOMATICALLLY GENERATED by gentables // #ifdef ENCODING_EU static const uint8_t iso8859_3_f_0[] = { 0xa0, 0x00, 0x00, 0xa3, 0xa4, 0x00, 0x00, 0xa7, 0xa8, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, 0xb0, 0x00, 0xb2, 0xb3, 0xb4, 0xb5, 0x00, 0xb7, 0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0xc0, 0xc1, 0xc2, 0x00, 0xc4, 0x00, 0x00, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, 0x00, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0x00, 0x00, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0x00, 0xf6, 0xf7, 0x00, 0xf9, 0xfa, 0xfb, 0xfc }; static const uint8_t iso8859_3_f_256[] = { 0xc6, 0xe6, 0xc5, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0xf8, 0xab, 0xbb, 0xd5, 0xf5, 0x00, 0x00, 0xa6, 0xb6, 0xa1, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa9, 0xb9, 0x00, 0x00, 0xac, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0xfe, 0xaa, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdd, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0xbf }; static uint32_t cs_iso8859_3_from_unicode (unicode_t unicode) { if (unicode <= 0x009f) return unicode; if (unicode == 0x02d8) return 0x00a2; if (unicode == 0x02d9) return 0x00ff; if (0x00a0 <= unicode && unicode <= 0x00fc) return iso8859_3_f_0[unicode - 0x00a0] == 0 ? NOCHAR : iso8859_3_f_0[unicode - 0x00a0]; if (0x0108 <= unicode && unicode <= 0x017c) return iso8859_3_f_256[unicode - 0x0108] == 0 ? NOCHAR : iso8859_3_f_256[unicode - 0x0108]; return NOCHAR; } #else #define cs_iso8859_3_from_unicode cs_unknown_from_unicode #define cs_iso8859_3_to_unicode cs_unknown_to_unicode #endif
#include "pm_i.h" #if defined(CONFIG_ARCH_SUN9IW1P1) || defined(CONFIG_ARCH_SUN8IW6P1) static __mem_tmstmp_reg_t *TmstmpReg; /* ********************************************************************************************************* * TIMESTAMP save * * Description: save timestamp for mem. * * Arguments : none * * Returns : EPDK_TRUE/EPDK_FALSE; ********************************************************************************************************* */ __s32 mem_tmstmp_save(__mem_tmstmp_reg_t *ptmstmp_state) { /* set timestamp register base */ TmstmpReg = (__mem_tmstmp_reg_t *)IO_ADDRESS(SUNXI_TIMESTAMP_CTRL_PBASE); /* backup timestamp registers */ ptmstmp_state->Ctl = TmstmpReg->Ctl; ptmstmp_state->Cluster0CtrlReg1 = TmstmpReg->Cluster0CtrlReg1; return 0; } /* ********************************************************************************************************* * TIMESTAMP restore * * Description: restore timestamp for mem. * * Arguments : none * * Returns : EPDK_TRUE/EPDK_FALSE; ********************************************************************************************************* */ __s32 mem_tmstmp_restore(__mem_tmstmp_reg_t *ptmstmp_state) { /* restore timestamp0 parameters */ TmstmpReg->Ctl = ptmstmp_state->Ctl; TmstmpReg->Cluster0CtrlReg1 = ptmstmp_state->Cluster0CtrlReg1; return 0; } #endif
#ifndef SQLTEXTEDIT_H #define SQLTEXTEDIT_H #include "Qsci/qsciscintilla.h" class SqlUiLexer; /** * @brief The SqlTextEdit class * This class is based on the QScintilla widget */ class SqlTextEdit : public QsciScintilla { Q_OBJECT public: explicit SqlTextEdit(QWidget *parent = 0); virtual ~SqlTextEdit(); static SqlUiLexer* sqlLexer; public slots: void reloadKeywords(); void reloadSettings(); void clearErrorIndicators(); void setErrorIndicator(int fromRow, int fromIndex, int toRow, int toIndex); protected: void dropEvent(QDropEvent* e); private: void setupSyntaxHighlightingFormat(const QString& settings_name, int style); int errorIndicatorNumber; bool showErrorIndicators; private slots: void updateLineNumberAreaWidth(); }; #endif
/*************************************************************** * Name: [PROJECT_NAME] * Purpose: Code::Blocks plugin * Author: [AUTHOR_NAME] ([AUTHOR_EMAIL]) * Created: [NOW] * Copyright: [AUTHOR_NAME] * License: GPL **************************************************************/ #ifndef [GUARD_WORD] #define [GUARD_WORD] // For compilers that support precompilation, includes <wx/wx.h> #include <wx/wxprec.h> #ifndef WX_PRECOMP #include <wx/wx.h> #endif #include <cbplugin.h> // for "class cbMimePlugin" class [PLUGIN_NAME] : public cbMimePlugin { public: /** Constructor. */ [PLUGIN_NAME](); /** Destructor. */ virtual ~[PLUGIN_NAME](); [IF HAS_CONFIGURE] /** Return the plugin's configuration priority. * This is a number (default is 50) that is used to sort plugins * in configuration dialogs. Lower numbers mean the plugin's * configuration is put higher in the list. */ virtual int GetConfigurationPriority() const { return 50; } /** Return the configuration group for this plugin. Default is cgUnknown. * Notice that you can logically OR more than one configuration groups, * so you could set it, for example, as "cgCompiler | cgContribPlugin". */ virtual int GetConfigurationGroup() const { return cgUnknown; } /** Return plugin's configuration panel. * @param parent The parent window. * @return A pointer to the plugin's cbConfigurationPanel. It is deleted by the caller. */ virtual cbConfigurationPanel* GetConfigurationPanel(wxWindow* parent){ return 0; } /** Return plugin's configuration panel for projects. * The panel returned from this function will be added in the project's * configuration dialog. * @param parent The parent window. * @param project The project that is being edited. * @return A pointer to the plugin's cbConfigurationPanel. It is deleted by the caller. */ virtual cbConfigurationPanel* GetProjectConfigurationPanel(wxWindow* parent, cbProject* project){ return 0; } [ENDIF HAS_CONFIGURE] /** @brief Can a file be handled by this plugin? * * @param filename The file in question. * @return The plugin should return true if it can handle this file, * false if not. */ virtual bool CanHandleFile(const wxString& filename) const; /** @brief Open the file. * * @param filename The file to open. * @return The plugin should return zero on success, other value on error. */ virtual int OpenFile(const wxString& filename); /** @brief Is this a default handler? * * This is a flag notifying the main app that this plugin can handle * every file passed to it. Usually you 'll want to return false in * this function, because you usually create specialized handler * plugins (for specific MIME types)... * * @return True if this plugin can handle every possible MIME type, * false if not. */ virtual bool HandlesEverything() const; protected: /** Any descendent plugin should override this virtual method and * perform any necessary initialization. This method is called by * Code::Blocks (PluginManager actually) when the plugin has been * loaded and should attach in Code::Blocks. When Code::Blocks * starts up, it finds and <em>loads</em> all plugins but <em>does * not</em> activate (attaches) them. It then activates all plugins * that the user has selected to be activated on start-up.\n * This means that a plugin might be loaded but <b>not</b> activated...\n * Think of this method as the actual constructor... */ virtual void OnAttach(); /** Any descendent plugin should override this virtual method and * perform any necessary de-initialization. This method is called by * Code::Blocks (PluginManager actually) when the plugin has been * loaded, attached and should de-attach from Code::Blocks.\n * Think of this method as the actual destructor... * @param appShutDown If true, the application is shutting down. In this * case *don't* use Manager::Get()->Get...() functions or the * behaviour is undefined... */ virtual void OnRelease(bool appShutDown); }; #endif // [GUARD_WORD]
/***************************************************************************** Copyright (c) 2011, Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***************************************************************************** * Contents: Native high-level C interface to LAPACK function dtrttf * Author: Intel Corporation * Generated November, 2011 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_dtrttf( int matrix_order, char transr, char uplo, lapack_int n, const double* a, lapack_int lda, double* arf ) { if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_dtrttf", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_dge_nancheck( matrix_order, n, n, a, lda ) ) { return -5; } #endif return LAPACKE_dtrttf_work( matrix_order, transr, uplo, n, a, lda, arf ); }
/***************************************************************************** Copyright (c) 2010, Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ****************************************************************************** * Contents: Native high-level C interface to LAPACK function ctpqrt2 * Author: Intel Corporation * Generated November, 2011 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_ctpqrt2( int matrix_order, lapack_int m, lapack_int n, lapack_int l, lapack_complex_float* a, lapack_int lda, lapack_complex_float* b, lapack_int ldb, lapack_complex_float* t, lapack_int ldt ) { if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_ctpqrt2", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_cge_nancheck( matrix_order, n, n, a, lda ) ) { return -4; } if( LAPACKE_cge_nancheck( matrix_order, m, n, b, ldb ) ) { return -6; } #endif return LAPACKE_ctpqrt2_work( matrix_order, m, n, l, a, lda, b, ldb, t, ldt ); }
//****************************************************************************** // // Copyright (c) 2015 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // 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 <GLKit/GLKit.h> @interface GLKitExampleController : GLKViewController<GLKViewDelegate> -(void)glkView: (GLKView*)src drawInRect: (CGRect)rect; -(void)update; @end
// AreaDxf.h // Copyright (c) 2011, Dan Heeks // This program is released under the BSD license. See the file COPYING for details. #pragma once #include "dxf.h" class CSketch; class CArea; class CCurve; class AreaDxfRead : public CDxfRead{ void StartCurveIfNecessary(const double* s); public: CArea* m_area; AreaDxfRead(CArea* area, const char* filepath); // AreaDxfRead's virtual functions void OnReadLine(const double* s, const double* e); void OnReadArc(const double* s, const double* e, const double* c, bool dir); };
/* * Copyright 2008-2013 NVIDIA Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*! \file reduce_intervals.h * \brief OpenMP implementations of reduce_intervals algorithms. */ #pragma once #include <thrust/detail/config.h> #include <thrust/system/omp/detail/execution_policy.h> namespace thrust { namespace system { namespace omp { namespace detail { template <typename DerivedPolicy, typename InputIterator, typename OutputIterator, typename BinaryFunction, typename Decomposition> void reduce_intervals(execution_policy<DerivedPolicy> &exec, InputIterator input, OutputIterator output, BinaryFunction binary_op, Decomposition decomp); } // end namespace detail } // end namespace omp } // end namespace system } // end namespace thrust #include <thrust/system/omp/detail/reduce_intervals.inl>
//===--- DiagnosticDriver.h - Diagnostics for libdriver ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_DRIVERDIAGNOSTIC_H #define LLVM_CLANG_DRIVERDIAGNOSTIC_H #include "clang/Basic/Diagnostic.h" namespace clang { namespace diag { enum { #define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,\ SFINAE,ACCESS,NOWERROR,SHOWINSYSHEADER,CATEGORY) ENUM, #define DRIVERSTART #include "clang/Basic/DiagnosticDriverKinds.inc" #undef DIAG NUM_BUILTIN_DRIVER_DIAGNOSTICS }; } // end namespace diag } // end namespace clang #endif
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). #ifndef ROCKSDB_LITE #pragma once #include <string> #include "rocksdb/compaction_filter.h" #include "rocksdb/slice.h" namespace rocksdb { class RemoveEmptyValueCompactionFilter : public CompactionFilter { public: const char* Name() const override; bool Filter(int level, const Slice& key, const Slice& existing_value, std::string* new_value, bool* value_changed) const override; }; } // namespace rocksdb #endif // !ROCKSDB_LITE
// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2012-2013 Samsung Electronics Co., Ltd. */ #include <linux/blkdev.h> #include <linux/buffer_head.h> #include <linux/fs.h> #include "exfat.h" void exfat_bdev_open(struct super_block *sb) { struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info); if (p_bd->opened) return; p_bd->sector_size = bdev_logical_block_size(sb->s_bdev); p_bd->sector_size_bits = ilog2(p_bd->sector_size); p_bd->sector_size_mask = p_bd->sector_size - 1; p_bd->num_sectors = i_size_read(sb->s_bdev->bd_inode) >> p_bd->sector_size_bits; p_bd->opened = true; } void exfat_bdev_close(struct super_block *sb) { struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info); p_bd->opened = false; } int exfat_bdev_read(struct super_block *sb, sector_t secno, struct buffer_head **bh, u32 num_secs, bool read) { struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info); struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info); #ifdef CONFIG_STAGING_EXFAT_KERNEL_DEBUG struct exfat_sb_info *sbi = EXFAT_SB(sb); long flags = sbi->debug_flags; if (flags & EXFAT_DEBUGFLAGS_ERROR_RW) return -EIO; #endif /* CONFIG_STAGING_EXFAT_KERNEL_DEBUG */ if (!p_bd->opened) return -ENODEV; if (*bh) __brelse(*bh); if (read) *bh = __bread(sb->s_bdev, secno, num_secs << p_bd->sector_size_bits); else *bh = __getblk(sb->s_bdev, secno, num_secs << p_bd->sector_size_bits); if (*bh) return 0; WARN(!p_fs->dev_ejected, "[EXFAT] No bh, device seems wrong or to be ejected.\n"); return -EIO; } int exfat_bdev_write(struct super_block *sb, sector_t secno, struct buffer_head *bh, u32 num_secs, bool sync) { s32 count; struct buffer_head *bh2; struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info); struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info); #ifdef CONFIG_STAGING_EXFAT_KERNEL_DEBUG struct exfat_sb_info *sbi = EXFAT_SB(sb); long flags = sbi->debug_flags; if (flags & EXFAT_DEBUGFLAGS_ERROR_RW) return -EIO; #endif /* CONFIG_STAGING_EXFAT_KERNEL_DEBUG */ if (!p_bd->opened) return -ENODEV; if (secno == bh->b_blocknr) { lock_buffer(bh); set_buffer_uptodate(bh); mark_buffer_dirty(bh); unlock_buffer(bh); if (sync && (sync_dirty_buffer(bh) != 0)) return -EIO; } else { count = num_secs << p_bd->sector_size_bits; bh2 = __getblk(sb->s_bdev, secno, count); if (!bh2) goto no_bh; lock_buffer(bh2); memcpy(bh2->b_data, bh->b_data, count); set_buffer_uptodate(bh2); mark_buffer_dirty(bh2); unlock_buffer(bh2); if (sync && (sync_dirty_buffer(bh2) != 0)) { __brelse(bh2); goto no_bh; } __brelse(bh2); } return 0; no_bh: WARN(!p_fs->dev_ejected, "[EXFAT] No bh, device seems wrong or to be ejected.\n"); return -EIO; } int exfat_bdev_sync(struct super_block *sb) { struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info); #ifdef CONFIG_STAGING_EXFAT_KERNEL_DEBUG struct exfat_sb_info *sbi = EXFAT_SB(sb); long flags = sbi->debug_flags; if (flags & EXFAT_DEBUGFLAGS_ERROR_RW) return -EIO; #endif /* CONFIG_STAGING_EXFAT_KERNEL_DEBUG */ if (!p_bd->opened) return -ENODEV; return sync_blockdev(sb->s_bdev); }
// listen.h /* Copyright 2009 10gen Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include "sock.h" #include "mongo/platform/atomic_word.h" #include "mongo/util/concurrency/ticketholder.h" namespace mongo { const int DEFAULT_MAX_CONN = 20000; const int MAX_MAX_CONN = 20000; class MessagingPort; class Listener : boost::noncopyable { public: Listener(const string& name, const string &ip, int port, bool logConnect=true ); virtual ~Listener(); void initAndListen(); // never returns unless error (start a thread) /* spawn a thread, etc., then return */ virtual void accepted(boost::shared_ptr<Socket> psocket, long long connectionId ); virtual void acceptedMP(MessagingPort *mp); const int _port; /** * @return a rough estimate of elapsed time since the server started */ long long getMyElapsedTimeMillis() const { return _elapsedTime; } void setAsTimeTracker() { _timeTracker = this; } static const Listener* getTimeTracker() { return _timeTracker; } static long long getElapsedTimeMillis() { if ( _timeTracker ) return _timeTracker->getMyElapsedTimeMillis(); // should this assert or throw? seems like callers may not expect to get zero back, certainly not forever. return 0; } private: string _name; string _ip; bool _logConnect; long long _elapsedTime; #ifdef MONGO_SSL SSLManager* _ssl; #endif /** * @return true iff everything went ok */ bool _setupSockets( const vector<SockAddr>& mine , vector<SOCKET>& socks ); void _logListen( int port , bool ssl ); static const Listener* _timeTracker; virtual bool useUnixSockets() const { return false; } public: /** the "next" connection number. every connection to this process has a unique number */ static AtomicInt64 globalConnectionNumber; /** keeps track of how many allowed connections there are and how many are being used*/ static TicketHolder globalTicketHolder; /** makes sure user input is sane */ static void checkTicketNumbers(); }; class ListeningSockets { public: ListeningSockets() : _mutex("ListeningSockets") , _sockets( new set<int>() ) , _socketPaths( new set<string>() ) { } void add( int sock ) { scoped_lock lk( _mutex ); _sockets->insert( sock ); } void addPath( const std::string& path ) { scoped_lock lk( _mutex ); _socketPaths->insert( path ); } void remove( int sock ) { scoped_lock lk( _mutex ); _sockets->erase( sock ); } void closeAll() { set<int>* sockets; set<string>* paths; { scoped_lock lk( _mutex ); sockets = _sockets; _sockets = new set<int>(); paths = _socketPaths; _socketPaths = new set<string>(); } for ( set<int>::iterator i=sockets->begin(); i!=sockets->end(); i++ ) { int sock = *i; log() << "closing listening socket: " << sock << endl; closesocket( sock ); } for ( set<string>::iterator i=paths->begin(); i!=paths->end(); i++ ) { string path = *i; log() << "removing socket file: " << path << endl; ::remove( path.c_str() ); } } static ListeningSockets* get(); private: mongo::mutex _mutex; set<int>* _sockets; set<string>* _socketPaths; // for unix domain sockets static ListeningSockets* _instance; }; }
/* * (C) Copyright 2004-2008 Texas Instruments, <www.ti.com> * Rohit Choraria <rohitkc@ti.com> * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ #ifndef __ASM_ARCH_OMAP_GPMC_H #define __ASM_ARCH_OMAP_GPMC_H #define GPMC_BUF_EMPTY 0 #define GPMC_BUF_FULL 1 #define ECCCLEAR (0x1 << 8) #define ECCRESULTREG1 (0x1 << 0) #define ECCSIZE512BYTE 0xFF #define ECCSIZE1 (ECCSIZE512BYTE << 22) #define ECCSIZE0 (ECCSIZE512BYTE << 12) #define ECCSIZE0SEL (0x000 << 0) /* Generic ECC Layouts */ /* Large Page x8 NAND device Layout */ #ifdef GPMC_NAND_ECC_LP_x8_LAYOUT #define GPMC_NAND_HW_ECC_LAYOUT {\ .eccbytes = 12,\ .eccpos = {1, 2, 3, 4, 5, 6, 7, 8,\ 9, 10, 11, 12},\ .oobfree = {\ {.offset = 13,\ .length = 51 } } \ } #endif /* Large Page x16 NAND device Layout */ #ifdef GPMC_NAND_ECC_LP_x16_LAYOUT #define GPMC_NAND_HW_ECC_LAYOUT {\ .eccbytes = 12,\ .eccpos = {2, 3, 4, 5, 6, 7, 8, 9,\ 10, 11, 12, 13},\ .oobfree = {\ {.offset = 14,\ .length = 50 } } \ } #endif /* Small Page x8 NAND device Layout */ #ifdef GPMC_NAND_ECC_SP_x8_LAYOUT #define GPMC_NAND_HW_ECC_LAYOUT {\ .eccbytes = 3,\ .eccpos = {1, 2, 3},\ .oobfree = {\ {.offset = 4,\ .length = 12 } } \ } #endif /* Small Page x16 NAND device Layout */ #ifdef GPMC_NAND_ECC_SP_x16_LAYOUT #define GPMC_NAND_HW_ECC_LAYOUT {\ .eccbytes = 3,\ .eccpos = {2, 3, 4},\ .oobfree = {\ {.offset = 5,\ .length = 11 } } \ } #endif #define GPMC_NAND_HW_BCH4_ECC_LAYOUT {\ .eccbytes = 32,\ .eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\ 28, 29, 30, 31, 32, 33},\ .oobfree = {\ {.offset = 34,\ .length = 30 } } \ } #define GPMC_NAND_HW_BCH8_ECC_LAYOUT {\ .eccbytes = 56,\ .eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\ 52, 53, 54, 55, 56, 57},\ .oobfree = {\ {.offset = 58,\ .length = 6 } } \ } #define GPMC_NAND_HW_BCH16_ECC_LAYOUT {\ .eccbytes = 104,\ .eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,\ 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,\ 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,\ 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,\ 100, 101, 102, 103, 104, 105},\ .oobfree = {\ {.offset = 106,\ .length = 8 } } \ } #endif /* __ASM_ARCH_OMAP_GPMC_H */
// @(#)root/eve:$Id$ // Author: Matevz Tadel 2007 /************************************************************************* * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TEveCalo3DGL #define ROOT_TEveCalo3DGL #include "TGLObject.h" #include "TEveCaloData.h" #include <vector> class TEveCalo3D; class TEveCalo3DGL : public TGLObject { private: TEveCalo3DGL(const TEveCalo3DGL&) = delete; TEveCalo3DGL& operator=(const TEveCalo3DGL&) = delete; void CrossProduct(const Float_t a[3], const Float_t b[3], const Float_t c[3], Float_t out[3]) const; void RenderBox(const Float_t pnts[8]) const; void RenderGridEndCap() const; void RenderGridBarrel() const; void RenderGrid(TGLRnrCtx & rnrCtx) const; void RenderBarrelCell(const TEveCaloData::CellGeom_t &cell, Float_t towerH, Float_t& offset) const; void RenderEndCapCell(const TEveCaloData::CellGeom_t &cell, Float_t towerH, Float_t& offset) const; void DrawSelectedCells(TEveCaloData::vCellId_t cells) const; protected: TEveCalo3D *fM; // Model object. mutable std::vector<Float_t> fOffset; public: TEveCalo3DGL(); virtual ~TEveCalo3DGL() {} virtual Bool_t SetModel(TObject* obj, const Option_t* opt=0); virtual void SetBBox(); virtual void DirectDraw(TGLRnrCtx & rnrCtx) const; virtual void DrawHighlight(TGLRnrCtx & rnrCtx, const TGLPhysicalShape* ps, Int_t lvl=-1) const; virtual Bool_t ShouldDLCache(const TGLRnrCtx& rnrCtx) const; virtual Bool_t SupportsSecondarySelect() const { return kTRUE; } virtual Bool_t AlwaysSecondarySelect() const { return kTRUE; } virtual void ProcessSelection(TGLRnrCtx & rnrCtx, TGLSelectRecord & rec); ClassDef(TEveCalo3DGL, 0); // GL renderer class for TEveCalo. }; #endif
// Copyright 2012 the V8 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. #ifndef V8_IA32_FRAMES_IA32_H_ #define V8_IA32_FRAMES_IA32_H_ namespace v8 { namespace internal { // Register lists // Note that the bit values must match those used in actual instruction encoding const int kNumRegs = 8; // Caller-saved registers const RegList kJSCallerSaved = 1 << 0 | // eax 1 << 1 | // ecx 1 << 2 | // edx 1 << 3 | // ebx - used as a caller-saved register in JavaScript code 1 << 7; // edi - callee function const int kNumJSCallerSaved = 5; // Number of registers for which space is reserved in safepoints. const int kNumSafepointRegisters = 8; // ---------------------------------------------------- class EntryFrameConstants : public AllStatic { public: static const int kCallerFPOffset = -6 * kPointerSize; static const int kNewTargetArgOffset = +2 * kPointerSize; static const int kFunctionArgOffset = +3 * kPointerSize; static const int kReceiverArgOffset = +4 * kPointerSize; static const int kArgcOffset = +5 * kPointerSize; static const int kArgvOffset = +6 * kPointerSize; }; class ExitFrameConstants : public TypedFrameConstants { public: static const int kSPOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(0); static const int kCodeOffset = TYPED_FRAME_PUSHED_VALUE_OFFSET(1); DEFINE_TYPED_FRAME_SIZES(2); static const int kCallerFPOffset = 0 * kPointerSize; static const int kCallerPCOffset = +1 * kPointerSize; // FP-relative displacement of the caller's SP. It points just // below the saved PC. static const int kCallerSPDisplacement = +2 * kPointerSize; static const int kConstantPoolOffset = 0; // Not used }; class JavaScriptFrameConstants : public AllStatic { public: // FP-relative. static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset; static const int kLastParameterOffset = +2 * kPointerSize; static const int kFunctionOffset = StandardFrameConstants::kFunctionOffset; // Caller SP-relative. static const int kParam0Offset = -2 * kPointerSize; static const int kReceiverOffset = -1 * kPointerSize; }; } // namespace internal } // namespace v8 #endif // V8_IA32_FRAMES_IA32_H_
/* * vim:ts=4:sw=4:expandtab * * i3 - an improved dynamic tiling window manager * © 2009 Michael Stapelberg and contributors (see also: LICENSE) * */ #include <assert.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <err.h> #include <sys/stat.h> #include <sys/types.h> #include <pwd.h> #include <unistd.h> #include <err.h> #include "libi3.h" /* * Returns the name of a temporary file with the specified prefix. * */ char *get_process_filename(const char *prefix) { /* dir stores the directory path for this and all subsequent calls so that * we only create a temporary directory once per i3 instance. */ static char *dir = NULL; if (dir == NULL) { /* Check if XDG_RUNTIME_DIR is set. If so, we use XDG_RUNTIME_DIR/i3 */ if ((dir = getenv("XDG_RUNTIME_DIR"))) { char *tmp; sasprintf(&tmp, "%s/i3", dir); dir = tmp; struct stat buf; if (stat(dir, &buf) != 0) { if (mkdir(dir, 0700) == -1) { warn("Could not mkdir(%s)", dir); errx(EXIT_FAILURE, "Check permissions of $XDG_RUNTIME_DIR = '%s'", getenv("XDG_RUNTIME_DIR")); perror("mkdir()"); return NULL; } } } else { /* If not, we create a (secure) temp directory using the template * /tmp/i3-<user>.XXXXXX */ struct passwd *pw = getpwuid(getuid()); const char *username = pw ? pw->pw_name : "unknown"; sasprintf(&dir, "/tmp/i3-%s.XXXXXX", username); /* mkdtemp modifies dir */ if (mkdtemp(dir) == NULL) { perror("mkdtemp()"); return NULL; } } } char *filename; sasprintf(&filename, "%s/%s.%d", dir, prefix, getpid()); return filename; }
// // UIControl+YYAdd.h // YYKit <https://github.com/ibireme/YYKit> // // Created by ibireme on 13/4/5. // Copyright (c) 2015 ibireme. // // This source code is licensed under the MIT-style license found in the // LICENSE file in the root directory of this source tree. // #import <UIKit/UIKit.h> /** Provides extensions for `UIControl`. */ @interface UIControl (YYAdd) /** Removes all targets and actions for a particular event (or events) from an internal dispatch table. */ - (void)removeAllTargets; /** Adds or replaces a target and action for a particular event (or events) to an internal dispatch table. @param target The target object—that is, the object to which the action message is sent. If this is nil, the responder chain is searched for an object willing to respond to the action message. @param action A selector identifying an action message. It cannot be NULL. @param controlEvents A bitmask specifying the control events for which the action message is sent. */ - (void)setTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents; /** Adds a block for a particular event (or events) to an internal dispatch table. It will cause a strong reference to @a block. @param block The block which is invoked then the action message is sent (cannot be nil). The block is retained. @param controlEvents A bitmask specifying the control events for which the action message is sent. */ - (void)addBlockForControlEvents:(UIControlEvents)controlEvents block:(void (^)(id sender))block; /** Adds or replaces a block for a particular event (or events) to an internal dispatch table. It will cause a strong reference to @a block. @param block The block which is invoked then the action message is sent (cannot be nil). The block is retained. @param controlEvents A bitmask specifying the control events for which the action message is sent. */ - (void)setBlockForControlEvents:(UIControlEvents)controlEvents block:(void (^)(id sender))block; /** Removes all blocks for a particular event (or events) from an internal dispatch table. @param controlEvents A bitmask specifying the control events for which the action message is sent. */ - (void)removeAllBlocksForControlEvents:(UIControlEvents)controlEvents; @end
// Copyright 2010 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once // a simple lockless thread-safe, // single producer, single consumer queue #include <algorithm> #include <atomic> #include <cstddef> #include "Common/CommonTypes.h" namespace Common { template <typename T, bool NeedSize = true> class SPSCQueue { public: SPSCQueue() : m_size(0) { m_write_ptr = m_read_ptr = new ElementPtr(); } ~SPSCQueue() { // this will empty out the whole queue delete m_read_ptr; } u32 Size() const { static_assert(NeedSize, "using Size() on SPSCQueue without NeedSize"); return m_size.load(); } bool Empty() const { return !m_read_ptr->next.load(); } T& Front() const { return m_read_ptr->current; } template <typename Arg> void Push(Arg&& t) { // create the element, add it to the queue m_write_ptr->current = std::forward<Arg>(t); // set the next pointer to a new element ptr // then advance the write pointer ElementPtr* new_ptr = new ElementPtr(); m_write_ptr->next.store(new_ptr, std::memory_order_release); m_write_ptr = new_ptr; if (NeedSize) m_size++; } void Pop() { if (NeedSize) m_size--; ElementPtr* tmpptr = m_read_ptr; // advance the read pointer m_read_ptr = tmpptr->next.load(); // set the next element to nullptr to stop the recursive deletion tmpptr->next.store(nullptr); delete tmpptr; // this also deletes the element } bool Pop(T& t) { if (Empty()) return false; if (NeedSize) m_size--; ElementPtr* tmpptr = m_read_ptr; m_read_ptr = tmpptr->next.load(std::memory_order_acquire); t = std::move(tmpptr->current); tmpptr->next.store(nullptr); delete tmpptr; return true; } // not thread-safe void Clear() { m_size.store(0); delete m_read_ptr; m_write_ptr = m_read_ptr = new ElementPtr(); } private: // stores a pointer to element // and a pointer to the next ElementPtr class ElementPtr { public: ElementPtr() : next(nullptr) {} ~ElementPtr() { ElementPtr* next_ptr = next.load(); if (next_ptr) delete next_ptr; } T current; std::atomic<ElementPtr*> next; }; ElementPtr* m_write_ptr; ElementPtr* m_read_ptr; std::atomic<u32> m_size; }; } // namespace Common
/* Compute remainder and a congruent to the quotient. m68k fpu version Copyright (C) 1997-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> 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 <math.h> #ifndef SUFF #define SUFF #endif #ifndef float_type #define float_type double #endif #define CONCATX(a,b) __CONCAT(a,b) #define s(name) CONCATX(name,SUFF) float_type s(__remquo) (float_type x, float_type y, int *quo) { float_type result; int cquo, fpsr; __asm ("frem%.x %2,%0\n\tfmove%.l %/fpsr,%1" : "=f" (result), "=dm" (fpsr) : "f" (y), "0" (x)); cquo = (fpsr >> 16) & 0x7f; if (fpsr & (1 << 23)) cquo = -cquo; *quo = cquo; return result; } weak_alias (s(__remquo), s(remquo))
/* * Copyright (C) 2015 Broadcom Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation version 2. * * This program is distributed "as is" WITHOUT ANY WARRANTY of any * kind, whether express or implied; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef __SOC_BROADCOM_CYGNUS_CONFIG_H__ #define __SOC_BROADCOM_CYGNUS_CONFIG_H__ #include <stdint.h> #include <string.h> #include <soc/halapis/ddr_regs.h> /* DDR shmoo Parameters */ #define SDI_INTERFACE_BITWIDTH 16 #define SDI_NUM_COLUMNS 1024 #define SDI_NUM_BANKS 8 #ifdef DDR3_SIZE_512MB #define SDI_NUM_ROWS 32768 #else #define SDI_NUM_ROWS 65536 #endif /* Idle count (in units of 1024 cycles) before auto entering self-refresh */ #define DDR_AUTO_SELF_REFRESH_IDLE_COUNT 16 #endif /* __SOC_BROADCOM_CYGNUS_CONFIG_H__ */
/* -*- Mode: C; tab-width: 4 -*- * * Copyright (c) 2003-2004 Apple Computer, Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. Change History (most recent first): $Log: PString.h,v $ Revision 1.3 2006/08/14 23:25:43 cheshire Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0 Revision 1.2 2004/07/19 16:08:56 shersche fix problems in UTF8/Unicode string translations Revision 1.1 2004/06/26 04:01:22 shersche Initial revision */ #pragma once using namespace System; using namespace System::Text; namespace Apple { __gc class PString { public: PString(String* string) { if (string != NULL) { Byte unicodeBytes[] = Encoding::Unicode->GetBytes(string); Byte utf8Bytes[] = Encoding::Convert(Encoding::Unicode, Encoding::UTF8, unicodeBytes); m_p = Marshal::AllocHGlobal(utf8Bytes->Length + 1); Byte __pin * p = &utf8Bytes[0]; char * hBytes = static_cast<char*>(m_p.ToPointer()); memcpy(hBytes, p, utf8Bytes->Length); hBytes[utf8Bytes->Length] = '\0'; } else { m_p = NULL; } } ~PString() { Marshal::FreeHGlobal(m_p); } const char* c_str() { if (m_p != NULL) { return static_cast<const char*>(m_p.ToPointer()); } else { return NULL; } } protected: IntPtr m_p; }; }
/** * \file points.h * Point operations. */ /* * Mesa 3-D graphics library * Version: 6.5 * * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * BRIAN PAUL 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 POINTS_H #define POINTS_H #include "glheader.h" struct gl_context; extern void GLAPIENTRY _mesa_PointSize( GLfloat size ); extern void GLAPIENTRY _mesa_PointParameteri( GLenum pname, GLint param ); extern void GLAPIENTRY _mesa_PointParameteriv( GLenum pname, const GLint *params ); extern void GLAPIENTRY _mesa_PointParameterf( GLenum pname, GLfloat param ); extern void GLAPIENTRY _mesa_PointParameterfv( GLenum pname, const GLfloat *params ); extern void _mesa_init_point( struct gl_context * ctx ); #endif
/* * linux/include/asm-alpha/ide.h * * Copyright (C) 1994-1996 Linus Torvalds & authors */ /* * This file contains the alpha architecture specific IDE code. */ #ifndef __ASMalpha_IDE_H #define __ASMalpha_IDE_H #ifdef __KERNEL__ #define IDE_ARCH_OBSOLETE_DEFAULTS static inline int ide_default_irq(unsigned long base) { switch (base) { case 0x1f0: return 14; case 0x170: return 15; case 0x1e8: return 11; case 0x168: return 10; default: return 0; } } static inline unsigned long ide_default_io_base(int index) { switch (index) { case 0: return 0x1f0; case 1: return 0x170; case 2: return 0x1e8; case 3: return 0x168; default: return 0; } } #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ #ifdef CONFIG_PCI #define ide_init_default_irq(base) (0) #else #define ide_init_default_irq(base) ide_default_irq(base) #endif #include <asm-generic/ide_iops.h> #endif /* __KERNEL__ */ #endif /* __ASMalpha_IDE_H */
/* * Copyright (c) 2007-2012 Nicira, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/if_arp.h> #include <linux/if_bridge.h> #include <linux/if_vlan.h> #include <linux/kernel.h> #include <linux/llc.h> #include <linux/rtnetlink.h> #include <linux/skbuff.h> #include <net/llc.h> #include "datapath.h" #include "vport-internal_dev.h" #include "vport-netdev.h" /* Must be called with rcu_read_lock. */ static void netdev_port_receive(struct vport *vport, struct sk_buff *skb) { if (unlikely(!vport)) { kfree_skb(skb); return; } /* Make our own copy of the packet. Otherwise we will mangle the * packet for anyone who came before us (e.g. tcpdump via AF_PACKET). * (No one comes after us, since we tell handle_bridge() that we took * the packet.) */ skb = skb_share_check(skb, GFP_ATOMIC); if (unlikely(!skb)) return; skb_push(skb, ETH_HLEN); ovs_vport_receive(vport, skb); } /* Called with rcu_read_lock and bottom-halves disabled. */ static rx_handler_result_t netdev_frame_hook(struct sk_buff **pskb) { struct sk_buff *skb = *pskb; struct vport *vport; if (unlikely(skb->pkt_type == PACKET_LOOPBACK)) return RX_HANDLER_PASS; vport = ovs_netdev_get_vport(skb->dev); netdev_port_receive(vport, skb); return RX_HANDLER_CONSUMED; } static struct vport *netdev_create(const struct vport_parms *parms) { struct vport *vport; struct netdev_vport *netdev_vport; int err; vport = ovs_vport_alloc(sizeof(struct netdev_vport), &ovs_netdev_vport_ops, parms); if (IS_ERR(vport)) { err = PTR_ERR(vport); goto error; } netdev_vport = netdev_vport_priv(vport); netdev_vport->dev = dev_get_by_name(ovs_dp_get_net(vport->dp), parms->name); if (!netdev_vport->dev) { err = -ENODEV; goto error_free_vport; } if (netdev_vport->dev->flags & IFF_LOOPBACK || netdev_vport->dev->type != ARPHRD_ETHER || ovs_is_internal_dev(netdev_vport->dev)) { err = -EINVAL; goto error_put; } err = netdev_rx_handler_register(netdev_vport->dev, netdev_frame_hook, vport); if (err) goto error_put; dev_set_promiscuity(netdev_vport->dev, 1); netdev_vport->dev->priv_flags |= IFF_OVS_DATAPATH; return vport; error_put: dev_put(netdev_vport->dev); error_free_vport: ovs_vport_free(vport); error: return ERR_PTR(err); } static void free_port_rcu(struct rcu_head *rcu) { struct netdev_vport *netdev_vport = container_of(rcu, struct netdev_vport, rcu); dev_put(netdev_vport->dev); ovs_vport_free(vport_from_priv(netdev_vport)); } static void netdev_destroy(struct vport *vport) { struct netdev_vport *netdev_vport = netdev_vport_priv(vport); netdev_vport->dev->priv_flags &= ~IFF_OVS_DATAPATH; netdev_rx_handler_unregister(netdev_vport->dev); dev_set_promiscuity(netdev_vport->dev, -1); call_rcu(&netdev_vport->rcu, free_port_rcu); } const char *ovs_netdev_get_name(const struct vport *vport) { const struct netdev_vport *netdev_vport = netdev_vport_priv(vport); return netdev_vport->dev->name; } int ovs_netdev_get_ifindex(const struct vport *vport) { const struct netdev_vport *netdev_vport = netdev_vport_priv(vport); return netdev_vport->dev->ifindex; } static unsigned int packet_length(const struct sk_buff *skb) { unsigned int length = skb->len - ETH_HLEN; if (skb->protocol == htons(ETH_P_8021Q)) length -= VLAN_HLEN; return length; } static int netdev_send(struct vport *vport, struct sk_buff *skb) { struct netdev_vport *netdev_vport = netdev_vport_priv(vport); int mtu = netdev_vport->dev->mtu; int len; if (unlikely(packet_length(skb) > mtu && !skb_is_gso(skb))) { net_warn_ratelimited("%s: dropped over-mtu packet: %d > %d\n", netdev_vport->dev->name, packet_length(skb), mtu); goto error; } if (unlikely(skb_warn_if_lro(skb))) goto error; skb->dev = netdev_vport->dev; len = skb->len; dev_queue_xmit(skb); return len; error: kfree_skb(skb); ovs_vport_record_error(vport, VPORT_E_TX_DROPPED); return 0; } /* Returns null if this device is not attached to a datapath. */ struct vport *ovs_netdev_get_vport(struct net_device *dev) { if (likely(dev->priv_flags & IFF_OVS_DATAPATH)) return (struct vport *) rcu_dereference_rtnl(dev->rx_handler_data); else return NULL; } const struct vport_ops ovs_netdev_vport_ops = { .type = OVS_VPORT_TYPE_NETDEV, .create = netdev_create, .destroy = netdev_destroy, .get_name = ovs_netdev_get_name, .get_ifindex = ovs_netdev_get_ifindex, .send = netdev_send, };
/* * (C) Copyright 2007 * Michael Schwingen, michael@schwingen.org * * (C) Copyright 2006 * Stefan Roese, DENX Software Engineering, sr@denx.de. * * (C) Copyright 2002 * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net * * (C) Copyright 2002 * Sysgo Real-Time Solutions, GmbH <www.elinos.com> * Marius Groeger <mgroeger@sysgo.de> * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ #include <common.h> #include <command.h> #include <malloc.h> #include <asm/arch/ixp425.h> #include <asm/io.h> #include <miiphy.h> #include "actux3_hw.h" DECLARE_GLOBAL_DATA_PTR; int board_init (void) { gd->bd->bi_arch_number = MACH_TYPE_ACTUX3; /* adress of boot parameters */ gd->bd->bi_boot_params = 0x00000100; GPIO_OUTPUT_ENABLE (CFG_GPIO_IORST); GPIO_OUTPUT_ENABLE (CFG_GPIO_ETHRST); GPIO_OUTPUT_ENABLE (CFG_GPIO_DSR); GPIO_OUTPUT_ENABLE (CFG_GPIO_DCD); GPIO_OUTPUT_ENABLE (CFG_GPIO_LED5_GN); GPIO_OUTPUT_ENABLE (CFG_GPIO_LED6_RT); GPIO_OUTPUT_ENABLE (CFG_GPIO_LED6_GN); GPIO_OUTPUT_CLEAR (CFG_GPIO_IORST); GPIO_OUTPUT_CLEAR (CFG_GPIO_ETHRST); GPIO_OUTPUT_CLEAR (CFG_GPIO_DSR); GPIO_OUTPUT_SET (CFG_GPIO_DCD); GPIO_OUTPUT_CLEAR (CFG_GPIO_LED5_GN); GPIO_OUTPUT_CLEAR (CFG_GPIO_LED6_RT); GPIO_OUTPUT_CLEAR (CFG_GPIO_LED6_GN); /* * Setup GPIO's for Interrupt inputs */ GPIO_OUTPUT_DISABLE (CFG_GPIO_DBGINT); GPIO_OUTPUT_DISABLE (CFG_GPIO_ETHINT); /* * Setup GPIO's for 33MHz clock output */ GPIO_OUTPUT_ENABLE (CFG_GPIO_PCI_CLK); GPIO_OUTPUT_ENABLE (CFG_GPIO_EXTBUS_CLK); *IXP425_GPIO_GPCLKR = 0x011001FF; /* CS1: IPAC-X */ *IXP425_EXP_CS1 = 0x94d10013; /* CS5: Debug port */ *IXP425_EXP_CS5 = 0x9d520003; /* CS6: Release/Option register */ *IXP425_EXP_CS6 = 0x81860001; /* CS7: LEDs */ *IXP425_EXP_CS7 = 0x80900003; udelay (533); GPIO_OUTPUT_SET (CFG_GPIO_IORST); GPIO_OUTPUT_SET (CFG_GPIO_ETHRST); ACTUX3_LED1_RT (1); ACTUX3_LED1_GN (0); ACTUX3_LED2_RT (0); ACTUX3_LED2_GN (0); ACTUX3_LED3_RT (0); ACTUX3_LED3_GN (0); ACTUX3_LED4_GN (0); ACTUX3_LED5_RT (0); return 0; } /* * Check Board Identity */ int checkboard (void) { char *s = getenv ("serial#"); puts ("Board: AcTux-3 rev."); putc (ACTUX3_BOARDREL + 'A' - 1); if (s != NULL) { puts (", serial# "); puts (s); } putc ('\n'); return (0); } /************************************************************************* * get_board_rev() - setup to pass kernel board revision information * 0 = reserved * 1 = Rev. A * 2 = Rev. B *************************************************************************/ u32 get_board_rev (void) { return ACTUX3_BOARDREL; } int dram_init (void) { gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; return (0); } void reset_phy (void) { int i; /* initialize the PHY */ miiphy_reset ("NPE0", CONFIG_PHY_ADDR); /* all LED outputs = Link/Act */ miiphy_write ("NPE0", CONFIG_PHY_ADDR, 0x16, 0x0AAA); /* * The Marvell 88E6060 switch comes up with all ports disabled. * set all ethernet switch ports to forwarding state */ for (i = 1; i <= 5; i++) miiphy_write ("NPE0", CONFIG_PHY_ADDR + 8 + i, 0x04, 0x03); }
// 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_RENDERER_PEPPER_PEPPER_FLASH_MENU_HOST_H_ #define CHROME_RENDERER_PEPPER_PEPPER_FLASH_MENU_HOST_H_ #include <stdint.h> #include <vector> #include "base/compiler_specific.h" #include "base/macros.h" #include "content/public/renderer/context_menu_client.h" #include "ppapi/c/pp_point.h" #include "ppapi/host/host_message_context.h" #include "ppapi/host/resource_host.h" namespace content { class RendererPpapiHost; struct MenuItem; } namespace ppapi { namespace proxy { class SerializedFlashMenu; } } class PepperFlashMenuHost : public ppapi::host::ResourceHost, public content::ContextMenuClient { public: PepperFlashMenuHost(content::RendererPpapiHost* host, PP_Instance instance, PP_Resource resource, const ppapi::proxy::SerializedFlashMenu& serial_menu); ~PepperFlashMenuHost() override; int32_t OnResourceMessageReceived( const IPC::Message& msg, ppapi::host::HostMessageContext* context) override; private: int32_t OnHostMsgShow(ppapi::host::HostMessageContext* context, const PP_Point& location); // ContextMenuClient implementation. void OnMenuAction(int request_id, unsigned action) override; void OnMenuClosed(int request_id) override; void SendMenuReply(int32_t result, int action); content::RendererPpapiHost* renderer_ppapi_host_; bool showing_context_menu_; int context_menu_request_id_; std::vector<content::MenuItem> menu_data_; // We send |MenuItem|s, which have an |unsigned| "action" field instead of // an |int32_t| ID. (CONTENT also limits the range of valid values for // actions.) This maps actions to IDs. std::vector<int32_t> menu_id_map_; // Used to send a single context menu "completion" upon menu close. bool has_saved_context_menu_action_; unsigned saved_context_menu_action_; DISALLOW_COPY_AND_ASSIGN(PepperFlashMenuHost); }; #endif // CHROME_RENDERER_PEPPER_PEPPER_FLASH_MENU_HOST_H_
/* * libjingle * Copyright 2013 Google Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Enums that are common to the ObjectiveC version of the PeerConnection API. // RTCICEConnectionState correspond to the states in webrtc::ICEConnectionState. typedef enum { RTCICEConnectionNew, RTCICEConnectionChecking, RTCICEConnectionConnected, RTCICEConnectionCompleted, RTCICEConnectionFailed, RTCICEConnectionDisconnected, RTCICEConnectionClosed, } RTCICEConnectionState; // RTCICEGatheringState the states in webrtc::ICEGatheringState. typedef enum { RTCICEGatheringNew, RTCICEGatheringGathering, RTCICEGatheringComplete, } RTCICEGatheringState; // RTCSignalingState correspond to the states in webrtc::SignalingState. typedef enum { RTCSignalingStable, RTCSignalingHaveLocalOffer, RTCSignalingHaveLocalPrAnswer, RTCSignalingHaveRemoteOffer, RTCSignalingHaveRemotePrAnswer, RTCSignalingClosed, } RTCSignalingState; // RTCStatsOutputLevel correspond to webrtc::StatsOutputLevel typedef enum { RTCStatsOutputLevelStandard, RTCStatsOutputLevelDebug, } RTCStatsOutputLevel; // RTCSourceState corresponds to the states in webrtc::SourceState. typedef enum { RTCSourceStateInitializing, RTCSourceStateLive, RTCSourceStateEnded, RTCSourceStateMuted, } RTCSourceState; // RTCTrackState corresponds to the states in webrtc::TrackState. typedef enum { RTCTrackStateInitializing, RTCTrackStateLive, RTCTrackStateEnded, RTCTrackStateFailed, } RTCTrackState;