text
stringlengths
4
6.14k
// // Copyright (c) 2010-2013 The ANGLE 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 LIBGLESV2_UNIFORM_H_ #define LIBGLESV2_UNIFORM_H_ #include <string> #include <vector> #define GL_APICALL #include <GLES2/gl2.h> #include "common/debug.h" namespace gl { // Helper struct representing a single shader uniform struct Uniform { Uniform(GLenum type, GLenum precision, const std::string &name, unsigned int arraySize); ~Uniform(); bool isArray() const; unsigned int elementCount() const; const GLenum type; const GLenum precision; const std::string name; const unsigned int arraySize; unsigned char *data; bool dirty; int psRegisterIndex; int vsRegisterIndex; unsigned int registerCount; }; typedef std::vector<Uniform*> UniformArray; } #endif // LIBGLESV2_UNIFORM_H_
// -*- mode: c++; indent-tabs-mode: nil; tab-width:2 -*- // (c) 2006,2007,2008 Ulrich Germann // #ifndef __num_read_write_hh // #define __num_read_write_hh #pragma once #include <stdint.h> #include <iostream> // #include <endian.h> // #include <byteswap.h> // #include "tpt_typedefs.h" namespace tpt { void numwrite(std::ostream& out, uint16_t const& x); void numwrite(std::ostream& out, uint32_t const& x); void numwrite(std::ostream& out, uint64_t const& x); char const* numread(char const* src, uint16_t & x); char const* numread(char const* src, uint32_t & x); char const* numread(char const* src, uint64_t & x); } // end of namespace ugdiss
#pragma once #include "OSL/oslconfig.h" OSL_NAMESPACE_ENTER inline float fresnel_dielectric(float cosi, float eta) { // special case: ignore fresnel if (eta == 0) return 1; // compute fresnel reflectance without explicitly computing the refracted direction if (cosi < 0.0f) eta = 1.0f / eta; float c = fabsf(cosi); float g = eta * eta - 1 + c * c; if (g > 0) { g = sqrtf(g); float A = (g - c) / (g + c); float B = (c * (g + c) - 1) / (c * (g - c) + 1); return 0.5f * A * A * (1 + B * B); } return 1.0f; // TIR (no refracted component) } inline float fresnel_refraction(const Dual2<Vec3>& I, const Vec3& N, float eta, Dual2<Vec3>& T) { // compute refracted direction and fresnel term // return value will be 0 if TIR occurs // NOTE: I is the incoming ray direction (points toward the surface, normalized) // N is the surface normal (points toward the incoming ray origin, normalized) // T is the outgoing refracted direction (points away from the surface) Dual2<float> cosi = -dot(I, N); // check which side of the surface we are on Vec3 Nn; float neta; if (cosi.val() > 0) { // we are on the outside of the surface, going in neta = 1 / eta; Nn = N; } else { // we are inside the surface, cosi = -cosi; neta = eta; Nn = -N; } Dual2<float> arg = 1.0f - (neta * neta * (1.0f - cosi * cosi)); if (arg.val() >= 0) { Dual2<float> dnp = sqrt(arg); Dual2<float> nK = (neta * cosi) - dnp; T = I * neta + Nn * nK; return 1 - fresnel_dielectric(cosi.val(), eta); } T = make_Vec3(0, 0, 0); return 0; } OSL_NAMESPACE_EXIT
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef REMOTING_HOST_MOJO_IPC_MOJO_IPC_TEST_UTIL_H_ #define REMOTING_HOST_MOJO_IPC_MOJO_IPC_TEST_UTIL_H_ #include "mojo/public/cpp/platform/named_platform_channel.h" namespace remoting { namespace test { // Generates a random server name for unittests. mojo::NamedPlatformChannel::ServerName GenerateRandomServerName(); } // namespace test } // namespace remoting #endif // REMOTING_HOST_MOJO_IPC_MOJO_IPC_TEST_UTIL_H_
/* * libtcod 1.6.0 * Copyright (c) 2008,2009,2010,2012,2013 Jice & Mingos * 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. * * The name of Jice or Mingos may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``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 JICE OR MINGOS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _TCOD_MOUSE_H #define _TCOD_MOUSE_H #include "mouse_types.h" TCODLIB_API void TCOD_mouse_show_cursor(bool visible); TCODLIB_API TCOD_mouse_t TCOD_mouse_get_status(); TCODLIB_API bool TCOD_mouse_is_cursor_visible(); TCODLIB_API void TCOD_mouse_move(int x, int y); TCODLIB_API void TCOD_mouse_includes_touch(bool enable); #endif
#pragma once /* * Copyright (C) 2005-2013 Team XBMC * http://xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, 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 XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include "threads/CriticalSection.h" #include "threads/Event.h" #include "threads/Thread.h" #include "guilib/DispResource.h" #include "utils/log.h" #include "cores/VideoPlayer/DVDClock.h" #include <mutex> #include <queue> #include <condition_variable> #include <algorithm> #include <atomic> #include <thread> #include <map> #define DIFFRINGSIZE 60 #define FB_DEVICE "/dev/fb0" class CIMX; extern CIMX g_IMX; class CIMX : public CThread, IDispResource { public: CIMX(void); ~CIMX(void); bool Initialize(); void Deinitialize(); int WaitVsync(); virtual void OnResetDisplay(); static bool IsBlank(); private: virtual void Process(); bool UpdateDCIC(); int m_fddcic; bool m_change; unsigned long m_counter; unsigned long m_counterLast; CEvent m_VblankEvent; int m_frameTime; CCriticalSection m_critSection; uint32_t m_lastSyncFlag; }; // A blocking FIFO buffer template <typename T> class lkFIFO { public: lkFIFO() { m_size = queue.max_size(); queue.clear(); m_abort = false; } public: T pop() { std::unique_lock<std::mutex> m_lock(lkqueue); m_abort = false; while (!queue.size() && !m_abort) read.wait(m_lock); T val; if (!queue.empty()) { val = queue.front(); queue.pop_front(); } m_lock.unlock(); write.notify_one(); return val; } bool push(const T& item) { std::unique_lock<std::mutex> m_lock(lkqueue); m_abort = false; while (queue.size() >= m_size && !m_abort) write.wait(m_lock); if (m_abort) return false; queue.push_back(item); m_lock.unlock(); read.notify_one(); return true; } void signal() { m_abort = true; read.notify_one(); write.notify_one(); } void setquotasize(size_t newsize) { m_size = newsize; write.notify_one(); } size_t getquotasize() { return m_size; } void for_each(void (*fn)(T &t), bool clear = true) { std::unique_lock<std::mutex> m_lock(lkqueue); std::for_each(queue.begin(), queue.end(), fn); if (clear) queue.clear(); write.notify_one(); } size_t size() { return queue.size(); } void clear() { std::unique_lock<std::mutex> m_lock(lkqueue); queue.clear(); write.notify_one(); } bool full() { return queue.size() >= m_size; } private: std::deque<T> queue; std::mutex lkqueue; std::condition_variable write; std::condition_variable read; size_t m_size; volatile bool m_abort; }; // Generell description of a buffer used by // the IMX context, e.g. for blitting class CIMXBuffer { public: CIMXBuffer() : m_iRefs(0) {} // Shared pointer interface virtual void Lock() = 0; virtual long Release() = 0; int GetFormat() { return iFormat; } public: uint32_t iWidth; uint32_t iHeight; int pPhysAddr; uint8_t *pVirtAddr; int iFormat; double m_fps; protected: std::atomic<long> m_iRefs; }; class CIMXFps { public: CIMXFps() { Flush(); } void Add(double pts); void Flush(); double GetFrameDuration(bool raw = false) { return m_frameDuration; } bool Recalc(); private: std::map<unsigned long,int> m_hgraph; std::deque<double> m_ts; double m_frameDuration; };
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _DT_STRTAB_H #define _DT_STRTAB_H #ifndef VBOX #pragma ident "%Z%%M% %I% %E% SMI" #include <sys/types.h> #else # include "VBoxDTraceTypes.h" #endif #ifdef __cplusplus extern "C" { #endif typedef struct dt_strhash { const char *str_data; /* pointer to actual string data */ ulong_t str_buf; /* index of string data buffer */ size_t str_off; /* offset in bytes of this string */ size_t str_len; /* length in bytes of this string */ struct dt_strhash *str_next; /* next string in hash chain */ } dt_strhash_t; typedef struct dt_strtab { dt_strhash_t **str_hash; /* array of hash buckets */ ulong_t str_hashsz; /* size of hash bucket array */ char **str_bufs; /* array of buffer pointers */ char *str_ptr; /* pointer to current buffer location */ ulong_t str_nbufs; /* size of buffer pointer array */ size_t str_bufsz; /* size of individual buffer */ ulong_t str_nstrs; /* total number of strings in strtab */ size_t str_size; /* total size of strings in bytes */ } dt_strtab_t; typedef ssize_t dt_strtab_write_f(const char *, size_t, size_t, void *); extern dt_strtab_t *dt_strtab_create(size_t); extern void dt_strtab_destroy(dt_strtab_t *); extern ssize_t dt_strtab_index(dt_strtab_t *, const char *); extern ssize_t dt_strtab_insert(dt_strtab_t *, const char *); extern size_t dt_strtab_size(const dt_strtab_t *); extern ssize_t dt_strtab_write(const dt_strtab_t *, dt_strtab_write_f *, void *); extern ulong_t dt_strtab_hash(const char *, size_t *); #ifdef __cplusplus } #endif #endif /* _DT_STRTAB_H */
// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2018 NXP */ #include <common.h> #include <asm/arch-fsl-layerscape/immap_lsch2.h> #include <asm/arch-fsl-layerscape/fsl_icid.h> #include <asm/arch-fsl-layerscape/fsl_portals.h> #include <fsl_sec.h> #ifdef CONFIG_SYS_DPAA_QBMAN struct qportal_info qp_info[CONFIG_SYS_QMAN_NUM_PORTALS] = { SET_QP_INFO(FSL_DPAA1_STREAM_ID_END, 0), SET_QP_INFO(FSL_DPAA1_STREAM_ID_END, 0), SET_QP_INFO(FSL_DPAA1_STREAM_ID_END, 0), SET_QP_INFO(FSL_DPAA1_STREAM_ID_END, 0), SET_QP_INFO(FSL_DPAA1_STREAM_ID_END, 0), SET_QP_INFO(FSL_DPAA1_STREAM_ID_END, 0), SET_QP_INFO(FSL_DPAA1_STREAM_ID_END, 0), SET_QP_INFO(FSL_DPAA1_STREAM_ID_END, 0), SET_QP_INFO(FSL_DPAA1_STREAM_ID_END, 0), SET_QP_INFO(FSL_DPAA1_STREAM_ID_END, 0), }; #endif struct icid_id_table icid_tbl[] = { #ifdef CONFIG_SYS_DPAA_QBMAN SET_QMAN_ICID(FSL_DPAA1_STREAM_ID_START), SET_BMAN_ICID(FSL_DPAA1_STREAM_ID_START + 1), #endif SET_SDHC_ICID(FSL_SDHC_STREAM_ID), SET_USB_ICID(1, "snps,dwc3", FSL_USB1_STREAM_ID), SET_USB_ICID(2, "snps,dwc3", FSL_USB2_STREAM_ID), SET_USB_ICID(3, "snps,dwc3", FSL_USB3_STREAM_ID), SET_SATA_ICID("fsl,ls1043a-ahci", FSL_SATA_STREAM_ID), SET_QDMA_ICID("fsl,ls1043a-qdma", FSL_QDMA_STREAM_ID), SET_EDMA_ICID(FSL_EDMA_STREAM_ID), SET_ETR_ICID(FSL_ETR_STREAM_ID), SET_DEBUG_ICID(FSL_DEBUG_STREAM_ID), SET_QE_ICID(FSL_QE_STREAM_ID), #ifdef CONFIG_FSL_CAAM SET_SEC_QI_ICID(FSL_DPAA1_STREAM_ID_END), SET_SEC_JR_ICID_ENTRY(0, FSL_DPAA1_STREAM_ID_START + 3), SET_SEC_JR_ICID_ENTRY(1, FSL_DPAA1_STREAM_ID_START + 4), SET_SEC_JR_ICID_ENTRY(2, FSL_DPAA1_STREAM_ID_START + 5), SET_SEC_JR_ICID_ENTRY(3, FSL_DPAA1_STREAM_ID_START + 6), SET_SEC_RTIC_ICID_ENTRY(0, FSL_DPAA1_STREAM_ID_START + 7), SET_SEC_RTIC_ICID_ENTRY(1, FSL_DPAA1_STREAM_ID_START + 8), SET_SEC_RTIC_ICID_ENTRY(2, FSL_DPAA1_STREAM_ID_START + 9), SET_SEC_RTIC_ICID_ENTRY(3, FSL_DPAA1_STREAM_ID_START + 10), SET_SEC_DECO_ICID_ENTRY(0, FSL_DPAA1_STREAM_ID_START + 11), SET_SEC_DECO_ICID_ENTRY(1, FSL_DPAA1_STREAM_ID_START + 12), #endif }; int icid_tbl_sz = ARRAY_SIZE(icid_tbl); #ifdef CONFIG_SYS_DPAA_FMAN struct fman_icid_id_table fman_icid_tbl[] = { /* port id, icid */ SET_FMAN_ICID_ENTRY(0x02, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x03, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x04, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x05, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x06, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x07, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x08, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x09, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x0a, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x0b, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x0c, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x0d, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x28, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x29, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x2a, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x2b, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x2c, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x2d, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x10, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x11, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x30, FSL_DPAA1_STREAM_ID_END), SET_FMAN_ICID_ENTRY(0x31, FSL_DPAA1_STREAM_ID_END), }; int fman_icid_tbl_sz = ARRAY_SIZE(fman_icid_tbl); #endif
#define CONFIG_FEATURE_IFUPDOWN_MAPPING 1
// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2018 * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc */ #include <common.h> #include <hexdump.h> #include <test/lib.h> #include <test/test.h> #include <test/ut.h> static int lib_test_hex_to_bin(struct unit_test_state *uts) { ut_asserteq(0x0, hex_to_bin('0')); ut_asserteq(0x1, hex_to_bin('1')); ut_asserteq(0x2, hex_to_bin('2')); ut_asserteq(0x3, hex_to_bin('3')); ut_asserteq(0x4, hex_to_bin('4')); ut_asserteq(0x5, hex_to_bin('5')); ut_asserteq(0x6, hex_to_bin('6')); ut_asserteq(0x7, hex_to_bin('7')); ut_asserteq(0x8, hex_to_bin('8')); ut_asserteq(0x9, hex_to_bin('9')); ut_asserteq(0xa, hex_to_bin('a')); ut_asserteq(0xb, hex_to_bin('b')); ut_asserteq(0xc, hex_to_bin('c')); ut_asserteq(0xd, hex_to_bin('d')); ut_asserteq(0xe, hex_to_bin('e')); ut_asserteq(0xf, hex_to_bin('f')); ut_asserteq(-1, hex_to_bin('g')); return 0; } LIB_TEST(lib_test_hex_to_bin, 0); static int lib_test_hex2bin(struct unit_test_state *uts) { u8 dst[4]; hex2bin(dst, "649421de", 4); ut_asserteq_mem("\x64\x94\x21\xde", dst, 4); hex2bin(dst, "aa2e7545", 4); ut_asserteq_mem("\xaa\x2e\x75\x45", dst, 4); hex2bin(dst, "75453bc5", 4); ut_asserteq_mem("\x75\x45\x3b\xc5", dst, 4); hex2bin(dst, "a16884c3", 4); ut_asserteq_mem("\xa1\x68\x84\xc3", dst, 4); hex2bin(dst, "156b2e5e", 4); ut_asserteq_mem("\x15\x6b\x2e\x5e", dst, 4); hex2bin(dst, "2e035fff", 4); ut_asserteq_mem("\x2e\x03\x5f\xff", dst, 4); hex2bin(dst, "0ffce99f", 4); ut_asserteq_mem("\x0f\xfc\xe9\x9f", dst, 4); hex2bin(dst, "d3999443", 4); ut_asserteq_mem("\xd3\x99\x94\x43", dst, 4); hex2bin(dst, "91dd87bc", 4); ut_asserteq_mem("\x91\xdd\x87\xbc", dst, 4); hex2bin(dst, "7fec8963", 4); ut_asserteq_mem("\x7f\xec\x89\x63", dst, 4); return 0; } LIB_TEST(lib_test_hex2bin, 0); static int lib_test_bin2hex(struct unit_test_state *uts) { char dst[8 + 1] = "\0"; bin2hex(dst, "\x64\x94\x21\xde", 4); ut_asserteq_str("649421de", dst); bin2hex(dst, "\xaa\x2e\x75\x45", 4); ut_asserteq_str("aa2e7545", dst); bin2hex(dst, "\x75\x45\x3b\xc5", 4); ut_asserteq_str("75453bc5", dst); bin2hex(dst, "\xa1\x68\x84\xc3", 4); ut_asserteq_str("a16884c3", dst); bin2hex(dst, "\x15\x6b\x2e\x5e", 4); ut_asserteq_str("156b2e5e", dst); bin2hex(dst, "\x2e\x03\x5f\xff", 4); ut_asserteq_str("2e035fff", dst); bin2hex(dst, "\x0f\xfc\xe9\x9f", 4); ut_asserteq_str("0ffce99f", dst); bin2hex(dst, "\xd3\x99\x94\x43", 4); ut_asserteq_str("d3999443", dst); bin2hex(dst, "\x91\xdd\x87\xbc", 4); ut_asserteq_str("91dd87bc", dst); bin2hex(dst, "\x7f\xec\x89\x63", 4); ut_asserteq_str("7fec8963", dst); return 0; } LIB_TEST(lib_test_bin2hex, 0);
/* contrib/earthdistance/earthdistance.c */ #include "postgres.h" #include <math.h> #include "utils/geo_decls.h" /* for Point */ #ifndef M_PI #define M_PI 3.14159265358979323846 #endif PG_MODULE_MAGIC; /* Earth's radius is in statute miles. */ static const double EARTH_RADIUS = 3958.747716; static const double TWO_PI = 2.0 * M_PI; /****************************************************** * * degtorad - convert degrees to radians * * arg: double, angle in degrees * * returns: double, same angle in radians ******************************************************/ static double degtorad(double degrees) { return (degrees / 360.0) * TWO_PI; } /****************************************************** * * geo_distance_internal - distance between points * * args: * a pair of points - for each point, * x-coordinate is longitude in degrees west of Greenwich * y-coordinate is latitude in degrees above equator * * returns: double * distance between the points in miles on earth's surface ******************************************************/ static double geo_distance_internal(Point *pt1, Point *pt2) { double long1, lat1, long2, lat2; double longdiff; double sino; /* convert degrees to radians */ long1 = degtorad(pt1->x); lat1 = degtorad(pt1->y); long2 = degtorad(pt2->x); lat2 = degtorad(pt2->y); /* compute difference in longitudes - want < 180 degrees */ longdiff = fabs(long1 - long2); if (longdiff > M_PI) longdiff = TWO_PI - longdiff; sino = sqrt(sin(fabs(lat1 - lat2) / 2.) * sin(fabs(lat1 - lat2) / 2.) + cos(lat1) * cos(lat2) * sin(longdiff / 2.) * sin(longdiff / 2.)); if (sino > 1.) sino = 1.; return 2. * EARTH_RADIUS * asin(sino); } /****************************************************** * * geo_distance - distance between points * * args: * a pair of points - for each point, * x-coordinate is longitude in degrees west of Greenwich * y-coordinate is latitude in degrees above equator * * returns: float8 * distance between the points in miles on earth's surface ******************************************************/ PG_FUNCTION_INFO_V1(geo_distance); Datum geo_distance(PG_FUNCTION_ARGS) { Point *pt1 = PG_GETARG_POINT_P(0); Point *pt2 = PG_GETARG_POINT_P(1); float8 result; result = geo_distance_internal(pt1, pt2); PG_RETURN_FLOAT8(result); }
// Copyright 2017 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_SNAPSHOT_PARTIAL_DESERIALIZER_H_ #define V8_SNAPSHOT_PARTIAL_DESERIALIZER_H_ #include "src/snapshot/deserializer.h" #include "src/snapshot/snapshot.h" namespace v8 { namespace internal { class Context; // Deserializes the context-dependent object graph rooted at a given object. // The PartialDeserializer is not expected to deserialize any code objects. class V8_EXPORT_PRIVATE PartialDeserializer final : public Deserializer { public: static MaybeHandle<Context> DeserializeContext( Isolate* isolate, const SnapshotData* data, bool can_rehash, Handle<JSGlobalProxy> global_proxy, v8::DeserializeEmbedderFieldsCallback embedder_fields_deserializer); private: explicit PartialDeserializer(const SnapshotData* data) : Deserializer(data, false) {} // Deserialize a single object and the objects reachable from it. MaybeHandle<Object> Deserialize( Isolate* isolate, Handle<JSGlobalProxy> global_proxy, v8::DeserializeEmbedderFieldsCallback embedder_fields_deserializer); void DeserializeEmbedderFields( v8::DeserializeEmbedderFieldsCallback embedder_fields_deserializer); }; } // namespace internal } // namespace v8 #endif // V8_SNAPSHOT_PARTIAL_DESERIALIZER_H_
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ // Simple hash functions used for internal data structures #ifndef TENSORFLOW_LIB_HASH_HASH_H_ #define TENSORFLOW_LIB_HASH_HASH_H_ #include <stddef.h> #include <stdint.h> #include <string> #include "tensorflow/core/lib/core/stringpiece.h" #include "tensorflow/core/platform/types.h" namespace tensorflow { extern uint32 Hash32(const char* data, size_t n, uint32 seed); extern uint64 Hash64(const char* data, size_t n, uint64 seed); inline uint64 Hash64(const char* data, size_t n) { return Hash64(data, n, 0xDECAFCAFFE); } inline uint64 Hash64(const string& str) { return Hash64(str.data(), str.size()); } inline uint64 Hash64Combine(uint64 a, uint64 b) { return a ^ (b + 0x9e3779b97f4a7800ULL + (a << 10) + (a >> 4)); } // Hash functor suitable for use with power-of-two sized hashtables. Use // instead of std::hash<T>. // // In particular, tensorflow::hash is not the identity function for pointers. // This is important for power-of-two sized hashtables like FlatMap and FlatSet, // because otherwise they waste the majority of their hash buckets. template <typename T> struct hash { size_t operator()(const T& t) const { return std::hash<T>()(t); } }; template <typename T> struct hash<T*> { size_t operator()(const T* t) const { // Hash pointers as integers, but bring more entropy to the lower bits. size_t k = static_cast<size_t>(reinterpret_cast<uintptr_t>(t)); return k + (k >> 6); } }; template <> struct hash<string> { size_t operator()(const string& s) const { return static_cast<size_t>(Hash64(s)); } }; template <> struct hash<StringPiece> { size_t operator()(StringPiece sp) const { return static_cast<size_t>(Hash64(sp.data(), sp.size())); } }; } // namespace tensorflow #endif // TENSORFLOW_LIB_HASH_HASH_H_
/*------------------------------------------------------------------------- * * rewriteSupport.h * * * * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * $PostgreSQL: pgsql/src/include/rewrite/rewriteSupport.h,v 1.30 2008/01/01 19:45:58 momjian Exp $ * *------------------------------------------------------------------------- */ #ifndef REWRITESUPPORT_H #define REWRITESUPPORT_H /* The ON SELECT rule of a view is always named this: */ #define ViewSelectRuleName "_RETURN" extern void SetRelationRuleStatus(Oid relationId, bool relHasRules, bool relIsBecomingView); extern Oid get_rewrite_oid(Oid relid, const char *rulename, bool missing_ok); extern Oid get_rewrite_oid_without_relid(const char *rulename, Oid *relid); #endif /* REWRITESUPPORT_H */
/* * Copyright (C) 2013 Apple Inc. All rights reserved. * Copyright (C) 2013 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_HTML_PARSER_HTML_SRCSET_PARSER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_PARSER_HTML_SRCSET_PARSER_H_ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/text/string_view.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" namespace blink { class Document; constexpr int kUninitializedDescriptor = -1; class DescriptorParsingResult { STACK_ALLOCATED(); public: DescriptorParsingResult() : density_(kUninitializedDescriptor), resource_width_(kUninitializedDescriptor), resource_height_(kUninitializedDescriptor) {} bool HasDensity() const { return density_ >= 0; } bool HasWidth() const { return resource_width_ >= 0; } bool HasHeight() const { return resource_height_ >= 0; } float Density() const { DCHECK(HasDensity()); return density_; } unsigned GetResourceWidth() const { DCHECK(HasWidth()); return resource_width_; } unsigned ResourceHeight() const { DCHECK(HasHeight()); return resource_height_; } void SetResourceWidth(int width) { DCHECK_GE(width, 0); resource_width_ = (unsigned)width; } void SetResourceHeight(int height) { DCHECK_GE(height, 0); resource_height_ = (unsigned)height; } void SetDensity(float density_to_set) { DCHECK_GE(density_to_set, 0); density_ = density_to_set; } private: float density_; int resource_width_; int resource_height_; }; class ImageCandidate { DISALLOW_NEW(); public: enum OriginAttribute { kSrcsetOrigin, kSrcOrigin }; ImageCandidate() : density_(1.0), resource_width_(kUninitializedDescriptor), origin_attribute_(kSrcsetOrigin) {} ImageCandidate(const String& source, unsigned start, unsigned length, const DescriptorParsingResult& result, OriginAttribute origin_attribute) : source_(source), string_(source, start, length), density_(result.HasDensity() ? result.Density() : kUninitializedDescriptor), resource_width_(result.HasWidth() ? result.GetResourceWidth() : kUninitializedDescriptor), origin_attribute_(origin_attribute) {} String ToString() const { return string_.ToString(); } AtomicString Url() const { return AtomicString(ToString()); } void SetDensity(float factor) { density_ = factor; } float Density() const { return density_; } int GetResourceWidth() const { return resource_width_; } bool SrcOrigin() const { return (origin_attribute_ == kSrcOrigin); } inline bool IsEmpty() const { return string_.IsEmpty(); } private: String source_; // Keep the StringView buffer alive. StringView string_; float density_; int resource_width_; OriginAttribute origin_attribute_; }; ImageCandidate BestFitSourceForSrcsetAttribute(float device_scale_factor, float source_size, const String& srcset_attribute, Document* = nullptr); CORE_EXPORT ImageCandidate BestFitSourceForImageAttributes(float device_scale_factor, float source_size, const String& src_attribute, const String& srcset_attribute, Document* = nullptr); String BestFitSourceForImageAttributes(float device_scale_factor, float source_size, const String& src_attribute, ImageCandidate& srcset_image_candidate); } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_HTML_PARSER_HTML_SRCSET_PARSER_H_
#ifndef ALITOFLTMADCDATA_H #define ALITOFLTMADCDATA_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id: AliTOFRawDataFormat.h 23881 2008-02-12 16:46:22Z decaro $ */ /////////////////////////////////////////////////////////////// // // // This classes provide the TOF raw data bit fields. // // // /////////////////////////////////////////////////////////////// #include "TROOT.h" class AliTOFLTMADCData { public: UInt_t GetADCValue1() const {return fADCValue1;}; UInt_t GetADCValue2() const {return fADCValue2;}; UInt_t GetADCValue3() const {return fADCValue3;}; UInt_t GetMBZ() const {return fMBZ;}; private: UInt_t fADCValue1: 10; UInt_t fADCValue2: 10; UInt_t fADCValue3: 10; UInt_t fMBZ: 2; }; #endif
#include "../src/tcommandlineinterface.h"
/*************************************************************************** Copyright (c) 2013, The OpenBLAS Project All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the OpenBLAS project 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 OPENBLAS PROJECT 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. *****************************************************************************/ /************************************************************************************** * 2013/09/14 Saar * BLASTEST float : OK * BLASTEST double : OK * CTEST : OK * TEST : OK * **************************************************************************************/ #include "common.h" int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT da, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT *dummy, BLASLONG dummy2) { BLASLONG i=0,j=0; if ( (n <= 0) || (inc_x <= 0)) return(0); while(j < n) { if ( da == 0.0 ) x[i]=0.0; else x[i] = da * x[i] ; i += inc_x ; j++; } return 0; }
/* * This file is a part of the open source stm32plus library. * Copyright (c) 2011,2012,2013,2014 Andy Brown <www.andybrown.me.uk> * Please see website for licensing terms. */ #pragma once namespace stm32plus { namespace ili9327 { namespace SetScrollAreaCmd { enum { Opcode=0x33 }; } } }
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef IOS_CHROME_SEARCH_WIDGET_EXTENSION_COPIED_CONTENT_VIEW_H_ #define IOS_CHROME_SEARCH_WIDGET_EXTENSION_COPIED_CONTENT_VIEW_H_ #import <UIKit/UIKit.h> #import "ios/chrome/common/ui/elements/highlight_button.h" typedef NS_ENUM(NSInteger, CopiedContentType) { CopiedContentTypeNone, CopiedContentTypeURL, CopiedContentTypeString, CopiedContentTypeImage, }; // View to show and allow opening of the copied URL. Shows a button with the // |copiedURLString| if it has been set. When tapped, |actionSelector| in // |target| is called. If no |copiedURLString| was set, the button is replaced // by a hairline separation and placeholder text. @interface CopiedContentView : HighlightButton // Designated initializer, creates the copiedURLView with a |target| to open the // URL. - (instancetype)initWithActionTarget:(id)target actionSelector:(SEL)actionSelector NS_DESIGNATED_INITIALIZER; - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; - (void)setCopiedContentType:(CopiedContentType)type; @end #endif // IOS_CHROME_SEARCH_WIDGET_EXTENSION_COPIED_CONTENT_VIEW_H_
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef IOS_CHROME_TEST_SCOPED_KEY_WINDOW_H_ #define IOS_CHROME_TEST_SCOPED_KEY_WINDOW_H_ #import <UIKit/UIKit.h> // Sets temporary key window and returns it via Get method. Saves the current // key window and restores it on destruction. class ScopedKeyWindow { public: explicit ScopedKeyWindow(); ~ScopedKeyWindow(); UIWindow* Get(); private: __strong UIWindow* current_key_window_; __strong UIWindow* original_key_window_; }; #endif // IOS_CHROME_TEST_SCOPED_KEY_WINDOW_H_
#ifndef __KS885X_TARGET__H__ #define __KS885X_TARGET__H__ #include "ks885x_snl.h" #define DATA_ALIGNMENT 4 /* WORD boundary */ #define MIO_DWORD(x) (*((volatile unsigned int*)(x))) #define MIO_WORD(x) (*((volatile unsigned short*)(x))) #define MIO_BYTE(x) (*((volatile unsigned char*)(x))) #define HW_READ_START(phwi) \ { \ HW_WRITE_WORD(phwi, REG_RX_ADDR_PTR, ADDR_PTR_AUTO_INC); \ HW_WRITE_WORD(phwi, REG_RXQ_CMD, (RXQ_CMD_CNTL | RXQ_START)); \ } #define HW_READ_END(phwi) \ { \ HW_WRITE_WORD(phwi, REG_RXQ_CMD, RXQ_CMD_CNTL); \ } #define HW_WRITE_START(phwi) \ { \ WORD w; \ HW_READ_WORD(phwi, REG_RXQ_CMD, &w); \ w |= RXQ_CMD_CNTL | RXQ_START; \ HW_WRITE_WORD(phwi, REG_RXQ_CMD, w); \ } #define HW_WRITE_END(phwi) \ { \ WORD w; \ HW_READ_WORD(phwi, REG_RXQ_CMD, &w); \ w &= ~RXQ_START; \ w |= RXQ_CMD_CNTL; \ HW_WRITE_WORD(phwi, REG_RXQ_CMD, w); \ } /* Chip data aligment is 4 byte */ #define GET_DATA_ALIGNMENT(in, pout) \ { \ unsigned short wMask = (4-1); \ if ((in & wMask) != 0) \ *pout = (in + wMask) & ~wMask; \ else \ *pout = in;\ } void HW_WRITE_DATA_HEADER(void *phwi, USHORT *puiPacketLength); /* * before call this macro, we has start the DMA and wrote the DATA header * data length should have been adjusted to 16 or 32 bit alignment. */ void HW_WRITE_DATA_BUFFER(void *phwi, LPBYTE pbuf, LPBYTE * ppOut, \ SHORT buflen, \ USHORT *pPacketLen); /* * Read single frame from KS8851MQL QMU RxQ packet memory * at one DMA interval. Frame size (len) must be DWORD alignment * (1). reset RX frame pointer. * (2). start transfer. * (3). dummy read. * (4). read 4-byte frame header. * (5). read frame data. * (6). stop transfer. */ void HW_READ_BUFFER(void *phwi, unsigned char *data, unsigned short len, \ unsigned short *pRealLen); #endif /*__KS885X_TAREGT__H__ */
/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ /* { dg-add-options arm_v8_1m_mve_fp } */ /* { dg-additional-options "-O2" } */ #include "arm_mve.h" uint16x8_t foo (uint16x8_t inactive, float16x8_t a, mve_pred16_t p) { return vcvtmq_m_u16_f16 (inactive, a, p); } /* { dg-final { scan-assembler "vpst" } } */ /* { dg-final { scan-assembler "vcvtmt.u16.f16" } } */ uint16x8_t foo1 (uint16x8_t inactive, float16x8_t a, mve_pred16_t p) { return vcvtmq_m (inactive, a, p); } /* { dg-final { scan-assembler "vpst" } } */
#ifndef CYGONCE_HAL_PLATFORM_INTS_H #define CYGONCE_HAL_PLATFORM_INTS_H //========================================================================== // // hal_platform_ints.h // // HAL Interrupt and clock support // //========================================================================== // ####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): gthomas // Contributors: gthomas // Date: 1999-02-20 // Purpose: Define Interrupt support // Description: The interrupt details for the PID are defined here. // Usage: // #include <cyg/hal/hal_platform_ints.h> // ... // // //####DESCRIPTIONEND#### // //========================================================================== #define CYGNUM_HAL_INTERRUPT_unused 0 #define CYGNUM_HAL_INTERRUPT_PROGRAMMED_INTERRUPT 1 #define CYGNUM_HAL_INTERRUPT_DEBUG_Rx 2 #define CYGNUM_HAL_INTERRUPT_DEBUG_Tx 3 #define CYGNUM_HAL_INTERRUPT_TIMER1 4 #define CYGNUM_HAL_INTERRUPT_TIMER2 5 #define CYGNUM_HAL_INTERRUPT_PC_SLOTA 6 #define CYGNUM_HAL_INTERRUPT_PC_SLOTB 7 #define CYGNUM_HAL_INTERRUPT_SERIALA 8 #define CYGNUM_HAL_INTERRUPT_SERIALB 9 #define CYGNUM_HAL_INTERRUPT_PARALLEL_PORT 10 #define CYGNUM_HAL_INTERRUPT_ASB0 11 #define CYGNUM_HAL_INTERRUPT_ASB1 12 #define CYGNUM_HAL_INTERRUPT_APB0 13 #define CYGNUM_HAL_INTERRUPT_APB1 14 #define CYGNUM_HAL_INTERRUPT_APB2 15 #define CYGNUM_HAL_INTERRUPT_EXTERNAL_FIQ 16 #define CYGNUM_HAL_ISR_MIN 0 #define CYGNUM_HAL_ISR_MAX 16 #define CYGNUM_HAL_ISR_COUNT 17 // The vector used by the Real time clock #define CYGNUM_HAL_INTERRUPT_RTC CYGNUM_HAL_INTERRUPT_TIMER2 //---------------------------------------------------------------------------- // Reset. #define HAL_PLATFORM_RESET() CYG_EMPTY_STATEMENT #define HAL_PLATFORM_RESET_ENTRY 0x4000000 #endif // CYGONCE_HAL_PLATFORM_INTS_H
/* vi: set sw=4 ts=4: * Functions to convert between host and network byte order. * * Copyright (C) 2003 by Erik Andersen <andersen@uclibc.org> * * This program 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 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 Library General Public License * for more details. * * You should have received a copy of the GNU Library 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 <stdint.h> #include <endian.h> #include <byteswap.h> #if __BYTE_ORDER == __BIG_ENDIAN extern uint32_t ntohl (uint32_t x) { return x; } extern uint16_t ntohs (uint16_t x) { return x; } extern uint32_t htonl (uint32_t x) { return x; } extern uint16_t htons (uint16_t x) { return x; } #elif __BYTE_ORDER == __LITTLE_ENDIAN extern uint32_t ntohl (uint32_t x) { return __bswap_32(x); } extern uint16_t ntohs (uint16_t x) { return __bswap_16(x); } extern uint32_t htonl (uint32_t x) { return __bswap_32(x); } extern uint16_t htons (uint16_t x) { return __bswap_16(x); } #else #error "You seem to have an unsupported byteorder" #endif
// license:BSD-3-Clause // copyright-holders:Carl #ifndef MAME_OSD_OSDNET_H #define MAME_OSD_OSDNET_H #pragma once #include <algorithm> class osd_netdev; #define CREATE_NETDEV(name) class osd_netdev *name(const char *ifname, class device_network_interface *ifdev, int rate) typedef class osd_netdev *(*create_netdev)(const char *ifname, class device_network_interface *ifdev, int rate); class osd_netdev { public: struct entry_t { entry_t() { std::fill(std::begin(name), std::end(name), 0); std::fill(std::begin(description), std::end(description), 0); } int id = 0; char name[256]; char description[256]; create_netdev func = nullptr; }; osd_netdev(class device_network_interface *ifdev, int rate); virtual ~osd_netdev(); void start(); void stop(); virtual int send(uint8_t *buf, int len); virtual void set_mac(const char *mac); virtual void set_promisc(bool promisc); const char *get_mac(); bool get_promisc(); protected: virtual int recv_dev(uint8_t **buf); private: void recv(void *ptr, int param); class device_network_interface *m_dev; emu_timer *m_timer; }; class osd_netdev *open_netdev(int id, class device_network_interface *ifdev, int rate); void add_netdev(const char *name, const char *description, create_netdev func); void clear_netdev(); const std::vector<std::unique_ptr<osd_netdev::entry_t>>& get_netdev_list(); int netdev_count(); #endif // MAME_OSD_OSDNET_H
#define CONFIG_FEATURE_FAST_TOP 1
#ifndef _UMLBASEACTIVITYCONTROLNODE_H #define _UMLBASEACTIVITYCONTROLNODE_H #include "UmlActivityNode.h" #include <q3cstring.h> class UmlBaseActivityControlNode : public UmlActivityNode { protected: // the constructor, do not call it yourself !!!!!!!!!! UmlBaseActivityControlNode(void * id, const Q3CString & s) : UmlActivityNode(id, s) { } }; #endif
/* $Xorg: bigreqstr.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $ */ /* Copyright 1992, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. 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 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* $XFree86$ */ #ifndef _BIGREQSTR_H_ #define _BIGREQSTR_H_ #define X_BigReqEnable 0 #define XBigReqNumberEvents 0 #define XBigReqNumberErrors 0 #define XBigReqExtensionName "BIG-REQUESTS" typedef struct { CARD8 reqType; /* always XBigReqCode */ CARD8 brReqType; /* always X_BigReqEnable */ CARD16 length B16; } xBigReqEnableReq; #define sz_xBigReqEnableReq 4 typedef struct { BYTE type; /* X_Reply */ CARD8 pad0; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 max_request_size B32; CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; } xBigReqEnableReply; #define sz_xBigReqEnableReply 32 typedef struct { CARD8 reqType; CARD8 data; CARD16 zero B16; CARD32 length B32; } xBigReq; #endif /* _BIGREQSTR_H_ */
/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */ #include "test_sve_acle.h" /* ** addwt_s32_tied1: ** saddwt z0\.s, z0\.s, z4\.h ** ret */ TEST_DUAL_Z (addwt_s32_tied1, svint32_t, svint16_t, z0 = svaddwt_s32 (z0, z4), z0 = svaddwt (z0, z4)) /* ** addwt_s32_tied2: ** saddwt z0\.s, z4\.s, z0\.h ** ret */ TEST_DUAL_Z_REV (addwt_s32_tied2, svint32_t, svint16_t, z0_res = svaddwt_s32 (z4, z0), z0_res = svaddwt (z4, z0)) /* ** addwt_s32_untied: ** saddwt z0\.s, z1\.s, z4\.h ** ret */ TEST_DUAL_Z (addwt_s32_untied, svint32_t, svint16_t, z0 = svaddwt_s32 (z1, z4), z0 = svaddwt (z1, z4)) /* ** addwt_w0_s32_tied1: ** mov (z[0-9]+\.h), w0 ** saddwt z0\.s, z0\.s, \1 ** ret */ TEST_UNIFORM_ZX (addwt_w0_s32_tied1, svint32_t, int16_t, z0 = svaddwt_n_s32 (z0, x0), z0 = svaddwt (z0, x0)) /* ** addwt_w0_s32_untied: ** mov (z[0-9]+\.h), w0 ** saddwt z0\.s, z1\.s, \1 ** ret */ TEST_UNIFORM_ZX (addwt_w0_s32_untied, svint32_t, int16_t, z0 = svaddwt_n_s32 (z1, x0), z0 = svaddwt (z1, x0)) /* ** addwt_11_s32_tied1: ** mov (z[0-9]+\.h), #11 ** saddwt z0\.s, z0\.s, \1 ** ret */ TEST_UNIFORM_Z (addwt_11_s32_tied1, svint32_t, z0 = svaddwt_n_s32 (z0, 11), z0 = svaddwt (z0, 11)) /* ** addwt_11_s32_untied: ** mov (z[0-9]+\.h), #11 ** saddwt z0\.s, z1\.s, \1 ** ret */ TEST_UNIFORM_Z (addwt_11_s32_untied, svint32_t, z0 = svaddwt_n_s32 (z1, 11), z0 = svaddwt (z1, 11))
/* * This file is part of the coreboot project. * * Copyright (C) 2006 Uwe Hermann <uwe@hermann-uwe.de> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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. */ #ifndef SUPERIO_ITE_IT8661F_H #define SUPERIO_ITE_IT8661F_H /* Datasheet: http://www.ite.com.tw/product_info/PC/Brief-IT8661_2.asp */ /* Logical device numbers (LDNs). */ #define IT8661F_FDC 0x00 /* Floppy */ #define IT8661F_SP1 0x01 /* Com1 */ #define IT8661F_SP2 0x02 /* Com2 */ #define IT8661F_PP 0x03 /* Parallel port */ #define IT8661F_IR 0x04 /* IR */ #define IT8661F_GPIO 0x05 /* GPIO & Alternate Function Configuration */ /* Register and bit definitions. */ #define IT8661F_REG_CC 0x02 /* Configure Control (write-only). */ #define IT8661F_REG_LDE 0x23 /* PnP Logical Device Enable. */ #define IT8661F_REG_SWSUSP 0x24 /* Software Suspend + Clock Select. */ #define IT8661F_ISA_PNP_PORT 0x0279 /* Write-only. */ #define IT8661F_CLKIN_24_MHZ 0 #define IT8661F_CLKIN_48_MHZ 1 /* * Special values used for entering MB PnP mode. The first four bytes of * each line determine the address port, the last four are data. */ static const u8 init_values[] = { 0x6a, 0xb5, 0xda, 0xed, /**/ 0xf6, 0xfb, 0x7d, 0xbe, 0xdf, 0x6f, 0x37, 0x1b, /**/ 0x0d, 0x86, 0xc3, 0x61, 0xb0, 0x58, 0x2c, 0x16, /**/ 0x8b, 0x45, 0xa2, 0xd1, 0xe8, 0x74, 0x3a, 0x9d, /**/ 0xce, 0xe7, 0x73, 0x39, }; void it8661f_enable_serial(pnp_devfn_t dev, u16 iobase); #endif /* SUPERIO_ITE_IT8661F_H */
/* * This file is part of the coreboot project. * * Copyright (C) 2011 - 2012 Advanced Micro Devices, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * 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. */ #include <console/console.h> #include <device/pci.h> #include <string.h> #include <stdint.h> #include <arch/pirq_routing.h> #include <cpu/amd/amdfam10_sysconf.h> static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, u8 link0, u16 bitmap0, u8 link1, u16 bitmap1, u8 link2, u16 bitmap2, u8 link3, u16 bitmap3, u8 slot, u8 rfu) { pirq_info->bus = bus; pirq_info->devfn = devfn; pirq_info->irq[0].link = link0; pirq_info->irq[0].bitmap = bitmap0; pirq_info->irq[1].link = link1; pirq_info->irq[1].bitmap = bitmap1; pirq_info->irq[2].link = link2; pirq_info->irq[2].bitmap = bitmap2; pirq_info->irq[3].link = link3; pirq_info->irq[3].bitmap = bitmap3; pirq_info->slot = slot; pirq_info->rfu = rfu; } unsigned long write_pirq_routing_table(unsigned long addr) { struct irq_routing_table *pirq; struct irq_info *pirq_info; u32 slot_num; u8 *v; u8 sum = 0; int i; /* Align the table to be 16 byte aligned. */ addr += 15; addr &= ~15; /* This table must be between 0xf0000 & 0x100000 */ printk(BIOS_INFO, "Writing IRQ routing tables to 0x%lx...", addr); pirq = (void *)(addr); v = (u8 *) (addr); pirq->signature = PIRQ_SIGNATURE; pirq->version = PIRQ_VERSION; pirq->rtr_bus = 0; pirq->rtr_devfn = PCI_DEVFN(0x14, 4); pirq->exclusive_irqs = 0; pirq->rtr_vendor = 0x1002; pirq->rtr_device = 0x4384; pirq->miniport_data = 0; memset(pirq->rfu, 0, sizeof(pirq->rfu)); pirq_info = (void *)(&pirq->checksum + 1); slot_num = 0; /* pci bridge */ write_pirq_info(pirq_info, 0, PCI_DEVFN(0x14, 4), 0x1, 0xdef8, 0x2, 0xdef8, 0x3, 0xdef8, 0x4, 0xdef8, 0, 0); pirq_info++; slot_num++; pirq->size = 32 + 16 * slot_num; for (i = 0; i < pirq->size; i++) sum += v[i]; sum = pirq->checksum - sum; if (sum != pirq->checksum) { pirq->checksum = sum; } printk(BIOS_INFO, "write_pirq_routing_table done.\n"); return (unsigned long)pirq_info; }
/*************************************************************************** qgsoptionswidgetfactory.h ------------------------------- Date : March 2017 Copyright : (C) 2017 Nyall Dawson Email : nyall dot dawson at gmail dot com *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSOPTIONSWIDGETFACTORY_H #define QGSOPTIONSWIDGETFACTORY_H #include <QListWidgetItem> #include "qgis_gui.h" #include "qgis.h" #include "qgsoptionsdialoghighlightwidget.h" /** * \ingroup gui * \class QgsOptionsPageWidget * Base class for widgets for pages included in the options dialog. * \since QGIS 3.0 */ class GUI_EXPORT QgsOptionsPageWidget : public QWidget { Q_OBJECT public: /** * Constructor for QgsOptionsPageWidget. */ QgsOptionsPageWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr ) : QWidget( parent ) {} /** * Returns the optional help key for the options page. The default implementation * returns an empty string. * * If a non-empty string is returned by this method, it will be used as the help key * retrieved when the "help" button is clicked while this options page is active. * * If an empty string is returned by this method the default QGIS options * help will be retrieved. */ virtual QString helpKey() const { return QString(); } /** * Returns the registered highlight widgets used to search and highlight text in * options dialogs. */ QMap<QWidget *, QgsOptionsDialogHighlightWidget *> registeredHighlightWidgets() {return mHighlighWidgets;} SIP_SKIP public slots: /** * Called to permanently apply the settings shown in the options page (e.g. save them to * QgsSettings objects). This is usually called when the options dialog is accepted. */ virtual void apply() = 0; protected: /** * Register a highlight widget to be used to search and highlight text in * options dialogs. This can be used to provide a custom implementation of * QgsOptionsDialogHighlightWidget. */ void registerHighlightWidget( QgsOptionsDialogHighlightWidget *highlightWidget ) { mHighlighWidgets.insert( highlightWidget->widget(), highlightWidget ); } private: QMap<QWidget *, QgsOptionsDialogHighlightWidget *> mHighlighWidgets; }; /** * \ingroup gui * \class QgsOptionsWidgetFactory * A factory class for creating custom options pages. * \since QGIS 3.0 */ // NOTE - this is a QObject so we can detect its destruction and avoid // QGIS crashing when a plugin crashes/exits without deregistering a factory class GUI_EXPORT QgsOptionsWidgetFactory : public QObject { Q_OBJECT public: //! Constructor QgsOptionsWidgetFactory() = default; //! Constructor QgsOptionsWidgetFactory( const QString &title, const QIcon &icon ) : mTitle( title ) , mIcon( icon ) {} /** * \brief The icon that will be shown in the UI for the panel. * \returns A QIcon for the panel icon. * \see setIcon() */ virtual QIcon icon() const { return mIcon; } /** * Set the \a icon to show in the interface for the factory object. * \see icon() */ void setIcon( const QIcon &icon ) { mIcon = icon; } /** * The title of the panel. * \see setTitle() */ virtual QString title() const { return mTitle; } /** * Set the \a title for the interface. * \see title() */ void setTitle( const QString &title ) { mTitle = title; } /** * \brief Factory function to create the widget on demand as needed by the options dialog. * \param parent The parent of the widget. * \returns A new widget to show as a page in the options dialog. */ virtual QgsOptionsPageWidget *createWidget( QWidget *parent = nullptr ) const = 0 SIP_FACTORY; private: QString mTitle; QIcon mIcon; }; #endif // QGSOPTIONSWIDGETFACTORY_H
#ifndef CYGONCE_ISO_STAT_H #define CYGONCE_ISO_STAT_H /*======================================================================== // // stat.h // // POSIX file characteristics // //======================================================================== // ####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): jlarmour // Contributors: // Date: 2000-05-08 // Purpose: This file provides the macros, types and functions // for file characteristics required by POSIX 1003.1. // Description: The real contents of this file get set from the // configuration (set by the implementation) // Usage: #include <sys/stat.h> // //####DESCRIPTIONEND#### // //====================================================================== */ /* CONFIGURATION */ #include <pkgconf/isoinfra.h> /* Configuration header */ /* INCLUDES */ #include <cyg/infra/cyg_type.h> /* __externC */ #ifdef CYGBLD_ISO_STAT_DEFS_HEADER # include CYGBLD_ISO_STAT_DEFS_HEADER #else #include <sys/types.h> /* ino_t, dev_t, etc. */ #include <time.h> /* time_t */ #define __stat_mode_DIR (1<<0) #define __stat_mode_CHR (1<<1) #define __stat_mode_BLK (1<<2) #define __stat_mode_REG (1<<3) #define __stat_mode_FIFO (1<<4) #define __stat_mode_MQ (1<<5) #define __stat_mode_SEM (1<<6) #define __stat_mode_SHM (1<<7) #define __stat_mode_LNK (1<<8) #define __stat_mode_SOCK (1<<9) #if !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE >= 200112L) #define S_IFDIR (__stat_mode_DIR) #define S_IFCHR (__stat_mode_CHR) #define S_IFBLK (__stat_mode_BLK) #define S_IFREG (__stat_mode_REG) #define S_IFIFO (__stat_mode_FIFO) #define S_IFLNK (__stat_mode_LNK) #define S_IFSOCK (__stat_mode_SOCK) #define S_IFMT (S_IFDIR|S_IFCHR|S_IFBLK|S_IFREG| \ S_IFIFO|S_IFLNK|S_IFSOCK) #endif #define S_ISDIR(__mode) ((__mode) & __stat_mode_DIR ) #define S_ISCHR(__mode) ((__mode) & __stat_mode_CHR ) #define S_ISBLK(__mode) ((__mode) & __stat_mode_BLK ) #define S_ISREG(__mode) ((__mode) & __stat_mode_REG ) #define S_ISFIFO(__mode) ((__mode) & __stat_mode_FIFO ) #if !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE >= 200112L) #define S_ISLNK(__mode) ((__mode) & __stat_mode_LNK ) #define S_ISSOCK(__mode) ((__mode) & __stat_mode_SOCK ) #endif #define S_TYPEISMQ(__buf) ((__buf)->st_mode & __stat_mode_MQ ) #define S_TYPEISSEM(__buf) ((__buf)->st_mode & __stat_mode_SEM ) #define S_TYPEISSHM(__buf) ((__buf)->st_mode & __stat_mode_SHM ) #define S_IRUSR (1<<16) #define S_IWUSR (1<<17) #define S_IXUSR (1<<18) #define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR) #define S_IRGRP (1<<19) #define S_IWGRP (1<<20) #define S_IXGRP (1<<21) #define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP) #define S_IROTH (1<<22) #define S_IWOTH (1<<23) #define S_IXOTH (1<<24) #define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH) #define S_ISUID (1<<25) #define S_ISGID (1<<26) struct stat { mode_t st_mode; /* File mode */ ino_t st_ino; /* File serial number */ dev_t st_dev; /* ID of device containing file */ nlink_t st_nlink; /* Number of hard links */ uid_t st_uid; /* User ID of the file owner */ gid_t st_gid; /* Group ID of the file's group */ off_t st_size; /* File size (regular files only) */ time_t st_atime; /* Last access time */ time_t st_mtime; /* Last data modification time */ time_t st_ctime; /* Last file status change time */ }; #endif /* ifndef CYGBLD_ISO_STAT_DEFS_HEADER */ /* PROTOTYPES */ __externC int stat( const char *path, struct stat *buf ); __externC int fstat( int fd, struct stat *buf ); __externC int mkdir(const char *path, mode_t mode); __externC int chmod(const char *path, mode_t mode); #endif /* CYGONCE_ISO_STAT_H multiple inclusion protection */ /* EOF stat.h */
// Copyright (C) 2011 Davis E. King (davis@dlib.net) // License: Boost Software License See LICENSE.txt for the full license. #undef DLIB_CROSS_VALIDATE_ASSiGNEMNT_TRAINER_ABSTRACT_H__ #ifdef DLIB_CROSS_VALIDATE_ASSiGNEMNT_TRAINER_ABSTRACT_H__ #include <vector> #include "../matrix.h" #include "svm.h" namespace dlib { // ---------------------------------------------------------------------------------------- template < typename assignment_function > double test_assignment_function ( const assignment_function& assigner, const std::vector<typename assignment_function::sample_type>& samples, const std::vector<typename assignment_function::label_type>& labels ); /*! requires - is_assignment_problem(samples, labels) - if (assigner.forces_assignment()) then - is_forced_assignment_problem(samples, labels) - assignment_function == an instantiation of the dlib::assignment_function template or an object with a compatible interface. ensures - Tests assigner against the given samples and labels and returns the fraction of assignments predicted correctly. !*/ // ---------------------------------------------------------------------------------------- template < typename trainer_type > double cross_validate_assignment_trainer ( const trainer_type& trainer, const std::vector<typename trainer_type::sample_type>& samples, const std::vector<typename trainer_type::label_type>& labels, const long folds ); /*! requires - is_assignment_problem(samples, labels) - if (trainer.forces_assignment()) then - is_forced_assignment_problem(samples, labels) - 1 < folds <= samples.size() - trainer_type == dlib::structural_assignment_trainer or an object with a compatible interface. ensures - performs k-fold cross validation by using the given trainer to solve the given assignment learning problem for the given number of folds. Each fold is tested using the output of the trainer and the fraction of assignments predicted correctly is returned. - The number of folds used is given by the folds argument. !*/ // ---------------------------------------------------------------------------------------- } #endif // DLIB_CROSS_VALIDATE_ASSiGNEMNT_TRAINER_ABSTRACT_H__
/* -*- c++ -*- */ /* * Copyright 2005 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_VCO_F_H #define INCLUDED_GR_VCO_F_H #include <gr_sync_block.h> #include <gr_fxpt_vco.h> /*! * \brief VCO - Voltage controlled oscillator * \ingroup misc * * \param sampling_rate sampling rate (Hz) * \param sensitivity units are radians/sec/volt * \param amplitude output amplitude */ class gr_vco_f; typedef boost::shared_ptr<gr_vco_f> gr_vco_f_sptr; gr_vco_f_sptr gr_make_vco_f(double sampling_rate, double sensitivity, double amplitude); /*! * \brief VCO - Voltage controlled oscillator * \ingroup modulator_blk * * input: float stream of control voltages; output: float oscillator output */ class gr_vco_f : public gr_sync_block { friend gr_vco_f_sptr gr_make_vco_f(double sampling_rate, double sensitivity, double amplitude); /*! * \brief VCO - Voltage controlled oscillator * * \param sampling_rate sampling rate (Hz) * \param sensitivity units are radians/sec/volt * \param amplitude output amplitude */ gr_vco_f(double sampling_rate, double sensitivity, double amplitude); double d_sampling_rate; double d_sensitivity; double d_amplitude; double d_k; gr_fxpt_vco d_vco; public: int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); }; #endif /* INCLUDED_GR_VCO_F_H */
/* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 Copyright (C) 2004-2008 Tord Romstad (Glaurung author) Copyright (C) 2008-2015 Marco Costalba, Joona Kiiski, Tord Romstad Copyright (C) 2015-2016 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad Stockfish 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. Stockfish 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 UCI_H_INCLUDED #define UCI_H_INCLUDED #include <map> #include <string> #include "types.h" class Position; namespace UCI { class Option; /// Custom comparator because UCI options should be case insensitive struct CaseInsensitiveLess { bool operator() (const std::string&, const std::string&) const; }; /// Our options container is actually a std::map typedef std::map<std::string, Option, CaseInsensitiveLess> OptionsMap; /// Option class implements an option as defined by UCI protocol class Option { typedef void (*OnChange)(const Option&); public: Option(OnChange = nullptr); Option(bool v, OnChange = nullptr); Option(const char* v, OnChange = nullptr); Option(int v, int min, int max, OnChange = nullptr); Option& operator=(const std::string&); void operator<<(const Option&); operator int() const; operator std::string() const; private: friend std::ostream& operator<<(std::ostream&, const OptionsMap&); std::string defaultValue, currentValue, type; int min, max; size_t idx; OnChange on_change; }; void init(OptionsMap&); void loop(int argc, char* argv[]); std::string value(Value v); std::string square(Square s); std::string move(Move m, bool chess960); std::string pv(const Position& pos, Depth depth, Value alpha, Value beta); Move to_move(const Position& pos, std::string& str); } // namespace UCI extern UCI::OptionsMap Options; #endif // #ifndef UCI_H_INCLUDED
/***************************************************************************** * Copyright (c) 2014 Ted John * OpenRCT2, an open source clone of Roller Coaster Tycoon 2. * * This file is part of OpenRCT2. * * OpenRCT2 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 _AWARD_H_ #define _AWARD_H_ #include "../common.h" typedef struct { uint16 time; uint16 type; } rct_award; enum { PARK_AWARD_MOST_UNTIDY, PARK_AWARD_MOST_TIDY, PARK_AWARD_BEST_ROLLERCOASTERS, PARK_AWARD_BEST_VALUE, PARK_AWARD_MOST_BEAUTIFUL, PARK_AWARD_WORST_VALUE, PARK_AWARD_SAFEST, PARK_AWARD_BEST_STAFF, PARK_AWARD_BEST_FOOD, PARK_AWARD_WORST_FOOD, PARK_AWARD_BEST_RESTROOMS, PARK_AWARD_MOST_DISAPPOINTING, PARK_AWARD_BEST_WATER_RIDES, PARK_AWARD_BEST_CUSTOM_DESIGNED_RIDES, PARK_AWARD_MOST_DAZZLING_RIDE_COLOURS, PARK_AWARD_MOST_CONFUSING_LAYOUT, PARK_AWARD_BEST_GENTLE_RIDES, PARK_AWARD_COUNT }; #define MAX_AWARDS 4 extern rct_award *gCurrentAwards; bool award_is_positive(int type); void award_reset(); void award_update_all(); #endif
#include <QDialog> #include <QWidget> #include <AIS_InteractiveContext.hxx> class DialogTransparency : public QDialog { Q_OBJECT public: DialogTransparency ( QWidget * parent=0, Qt::WindowFlags f=0, bool modal=true ); ~DialogTransparency(); signals: void sendTransparencyChanged(int value); };
/****************************************************************/ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* All contents are licensed under LGPL V2.1 */ /* See LICENSE for full restrictions */ /****************************************************************/ #ifndef GRAINFORCEANDTORQUESUM_H #define GRAINFORCEANDTORQUESUM_H #include "GrainForceAndTorqueInterface.h" #include "GeneralUserObject.h" //Forward Declarations class GrainForceAndTorqueSum; template<> InputParameters validParams<GrainForceAndTorqueSum>(); /** * This class is here to get the force and torque acting on a grain * from different userobjects and sum them all */ class GrainForceAndTorqueSum : public GrainForceAndTorqueInterface, public GeneralUserObject { public: GrainForceAndTorqueSum(const InputParameters & parameters); virtual void initialize(); virtual void execute(){}; virtual void finalize(){}; virtual const std::vector<RealGradient> & getForceValues() const; virtual const std::vector<RealGradient> & getTorqueValues() const; virtual const std::vector<RealGradient> & getForceDerivatives() const; virtual const std::vector<RealGradient> & getTorqueDerivatives() const; protected: /// Vector of userobjects providing forces and torques acting on grains std::vector<UserObjectName> _sum_objects; /// Total no. of userobjects that provides forces and torques acting on grains unsigned int _num_forces; unsigned int _ncrys; std::vector<const GrainForceAndTorqueInterface *> _sum_forces; ///@{ providing sum of all grain forces, torques & their derivatives std::vector<RealGradient> _force_values; std::vector<RealGradient> _torque_values; std::vector<RealGradient> _force_derivatives; std::vector<RealGradient> _torque_derivatives; ///@} }; #endif //GRAINFORCEANDTORQUESUM_H
// This file is part of XmlPlus package // // Copyright (C) 2010-2013 Satya Prakash Tripathi // // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE VERSION 3 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 LESSER GENERAL PUBLIC LICENSE VERSION 3 for more details. // // You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE VERSION 3 // along with this program. If not, see <http://www.gnu.org/licenses/>. // #ifndef __DOM_TEXT_NODE_H__ #define __DOM_TEXT_NODE_H__ #include "DOM/DOMCommonInc.h" #include "DOM/CharacterData.h" namespace DOM { class TextNode : public CharacterData { public: TextNode( DOMString* nodeValue, Document* ownerDocument=NULL, Node* parentNode=NULL, Node* prevSibling=NULL ); virtual ~TextNode() {} virtual TextNodeP splitText(unsigned long offset); // throws(); }; } #endif
/* FreeRDP: A Remote Desktop Protocol Client * Alpha blending routines. * vi:ts=4 sw=4: * * (c) Copyright 2012 Hewlett-Packard Development Company, L.P. * 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. * * Note: this code assumes the second operand is fully opaque, * e.g. * newval = alpha1*val1 + (1-alpha1)*val2 * rather than * newval = alpha1*val1 + (1-alpha1)*alpha2*val2 * The IPP gives other options. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <freerdp/types.h> #include <freerdp/primitives.h> #include "prim_internal.h" #define ALPHA(_k_) (((_k_)&0xFF000000U) >> 24) #define RED(_k_) (((_k_)&0x00FF0000U) >> 16) #define GRN(_k_) (((_k_)&0x0000FF00U) >> 8) #define BLU(_k_) (((_k_)&0x000000FFU)) /* ------------------------------------------------------------------------- */ static pstatus_t general_alphaComp_argb(const BYTE* pSrc1, UINT32 src1Step, const BYTE* pSrc2, UINT32 src2Step, BYTE* pDst, UINT32 dstStep, UINT32 width, UINT32 height) { UINT32 y; for (y = 0; y < height; y++) { const UINT32* sptr1 = (const UINT32*)(pSrc1 + y * src1Step); const UINT32* sptr2 = (const UINT32*)(pSrc2 + y * src2Step); UINT32* dptr = (UINT32*)(pDst + y * dstStep); UINT32 x; for (x = 0; x < width; x++) { const UINT32 src1 = *sptr1++; const UINT32 src2 = *sptr2++; UINT32 alpha = ALPHA(src1) + 1; if (alpha == 256) { /* If alpha is 255+1, just copy src1. */ *dptr++ = src1; } else if (alpha <= 1) { /* If alpha is 0+1, just copy src2. */ *dptr++ = src2; } else { /* A perfectly accurate blend would do (a*src + (255-a)*dst)/255 * rather than adding one to alpha and dividing by 256, but this * is much faster and only differs by one 16% of the time. * I'm not sure who first designed the double-ops trick * (Red Blue and Alpha Green). */ UINT32 rb, ag; UINT32 s2rb = src2 & 0x00FF00FFU; UINT32 s2ag = (src2 >> 8) & 0x00FF00FFU; UINT32 s1rb = src1 & 0x00FF00FFU; UINT32 s1ag = (src1 >> 8) & 0x00FF00FFU; UINT32 drb = s1rb - s2rb; UINT32 dag = s1ag - s2ag; drb *= alpha; dag *= alpha; rb = ((drb >> 8) + s2rb) & 0x00FF00FFU; ag = (((dag >> 8) + s2ag) << 8) & 0xFF00FF00U; *dptr++ = rb | ag; } } } return PRIMITIVES_SUCCESS; } /* ------------------------------------------------------------------------- */ void primitives_init_alphaComp(primitives_t* prims) { prims->alphaComp_argb = general_alphaComp_argb; }
/* ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio. This file is part of ChibiOS. ChibiOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. ChibiOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * @file e200/compilers/CW/chtypes.h * @brief Power e200 port system types. * * @addtogroup PPC_CW_CORE * @{ */ #ifndef _CHTYPES_H_ #define _CHTYPES_H_ #include <stddef.h> #include <stdint.h> #include <stdbool.h> /** * @name Common constants */ /** * @brief Generic 'false' boolean constant. */ #if !defined(FALSE) || defined(__DOXYGEN__) #define FALSE 0 #endif /** * @brief Generic 'true' boolean constant. */ #if !defined(TRUE) || defined(__DOXYGEN__) #define TRUE 1 #endif /** @} */ /** * @name Kernel types * @{ */ typedef uint32_t rtcnt_t; /**< Realtime counter. */ typedef uint64_t rttime_t; /**< Realtime accumulator. */ typedef uint32_t syssts_t; /**< System status word. */ typedef uint8_t tmode_t; /**< Thread flags. */ typedef uint8_t tstate_t; /**< Thread state. */ typedef uint8_t trefs_t; /**< Thread references counter. */ typedef uint8_t tslices_t; /**< Thread time slices counter.*/ typedef uint32_t tprio_t; /**< Thread priority. */ typedef int32_t msg_t; /**< Inter-thread message. */ typedef int32_t eventid_t; /**< Numeric event identifier. */ typedef uint32_t eventmask_t; /**< Mask of event identifiers. */ typedef uint32_t eventflags_t; /**< Mask of event flags. */ typedef int32_t cnt_t; /**< Generic signed counter. */ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */ /** @} */ /** * @brief ROM constant modifier. * @note It is set to use the "const" keyword in this port. */ #define ROMCONST const /** * @brief Makes functions not inlineable. * @note If the compiler does not support such attribute then the * realtime counter precision could be degraded. */ #define NOINLINE __attribute__((noinline)) /** * @brief Optimized thread function declaration macro. */ #define PORT_THD_FUNCTION(tname, arg) void tname(void *arg) #endif /* _CHTYPES_H_ */ /** @} */
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_FIRST_RUN_DIALOG_H_ #define CHROME_BROWSER_FIRST_RUN_DIALOG_H_ #import <Cocoa/Cocoa.h> // Class that acts as a controller for the modal first run dialog. // The dialog asks the user's explicit permission for reporting stats to help // us improve Chromium. @interface FirstRunDialogController : NSWindowController { @private // Bound to the value of the checkbox in FirstRunDialog.xib. BOOL statsEnabled_; BOOL makeDefaultBrowser_; IBOutlet NSArray* objectsToSize_; IBOutlet NSButton* setAsDefaultCheckbox_; IBOutlet NSButton* statsCheckbox_; BOOL beenSized_; } // Called when the "Start Google Chrome" button is pressed. - (IBAction)ok:(id)sender; // Called when the "Learn More" button is pressed. - (IBAction)learnMore:(id)sender; // Properties for bindings. @property(assign, nonatomic) BOOL statsEnabled; @property(assign, nonatomic) BOOL makeDefaultBrowser; @end #endif // CHROME_BROWSER_FIRST_RUN_DIALOG_H_
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_PROFILE_POLICY_PROVIDER_H_ #define CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_PROFILE_POLICY_PROVIDER_H_ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/weak_ptr.h" #include "components/policy/core/common/configuration_policy_provider.h" #include "components/policy/core/common/policy_service.h" namespace policy { // Policy provider for the login profile. Since the login profile is not // associated with any user, it does not receive regular user policy. However, // several device policies that control features on the login screen surface as // user policies in the login profile. class LoginProfilePolicyProvider : public ConfigurationPolicyProvider, public PolicyService::Observer { public: explicit LoginProfilePolicyProvider(PolicyService* device_policy_service); virtual ~LoginProfilePolicyProvider(); // ConfigurationPolicyProvider: virtual void Init(SchemaRegistry* registry) override; virtual void Shutdown() override; virtual void RefreshPolicies() override; // PolicyService::Observer: virtual void OnPolicyUpdated(const PolicyNamespace& ns, const PolicyMap& previous, const PolicyMap& current) override; virtual void OnPolicyServiceInitialized(PolicyDomain domain) override; void OnDevicePolicyRefreshDone(); private: void UpdateFromDevicePolicy(); PolicyService* device_policy_service_; // Not owned. bool waiting_for_device_policy_refresh_; base::WeakPtrFactory<LoginProfilePolicyProvider> weak_factory_; DISALLOW_COPY_AND_ASSIGN(LoginProfilePolicyProvider); }; } // namespace policy #endif // CHROME_BROWSER_CHROMEOS_POLICY_LOGIN_PROFILE_POLICY_PROVIDER_H_
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // -------------------------------------------------------------------------------- // PEImageLayout.h // // -------------------------------------------------------------------------------- #ifndef PEIMAGELAYOUT_H_ #define PEIMAGELAYOUT_H_ // -------------------------------------------------------------------------------- // Required headers // -------------------------------------------------------------------------------- #include "clrtypes.h" #include "pedecoder.h" #include "holder.h" // -------------------------------------------------------------------------------- // Forward declarations // -------------------------------------------------------------------------------- class Crst; class PEImage; typedef VPTR(class PEImageLayout) PTR_PEImageLayout; class PEImageLayout : public PEDecoder { VPTR_BASE_CONCRETE_VTABLE_CLASS(PEImageLayout) friend class PEModule; public: // ------------------------------------------------------------ // Public constants // ------------------------------------------------------------ enum { LAYOUT_MAPPED =1, LAYOUT_FLAT =2, LAYOUT_LOADED =4, LAYOUT_LOADED_FOR_INTROSPECTION =8, LAYOUT_ANY =0xf }; public: #ifndef DACCESS_COMPILE static PEImageLayout* CreateFlat(const void *flat, COUNT_T size,PEImage* pOwner); static PEImageLayout* CreateFromHMODULE(HMODULE mappedbase,PEImage* pOwner, BOOL bTakeOwnership); static PEImageLayout* LoadFromFlat(PEImageLayout* pflatimage); static PEImageLayout* Load(PEImage* pOwner, BOOL bNTSafeLoad, BOOL bThrowOnError = TRUE); static PEImageLayout* LoadFlat(PEImage* pOwner); static PEImageLayout* Map(PEImage* pOwner); #endif PEImageLayout(); virtual ~PEImageLayout(); static void Startup(); static CHECK CheckStartup(); static BOOL CompareBase(UPTR path, UPTR mapping); // Refcount above images. void AddRef(); ULONG Release(); const SString& GetPath(); void ApplyBaseRelocations(); public: #ifdef DACCESS_COMPILE void EnumMemoryRegions(CLRDataEnumMemoryFlags flags); #endif private: Volatile<LONG> m_refCount; public: PEImage* m_pOwner; DWORD m_Layout; }; typedef ReleaseHolder<PEImageLayout> PEImageLayoutHolder; //RawImageView is built on external data, does not need cleanup class RawImageLayout: public PEImageLayout { VPTR_VTABLE_CLASS(RawImageLayout,PEImageLayout) protected: CLRMapViewHolder m_DataCopy; #ifndef FEATURE_PAL HModuleHolder m_LibraryHolder; #endif // !FEATURE_PAL public: RawImageLayout(const void *flat, COUNT_T size,PEImage* pOwner); RawImageLayout(const void *mapped, PEImage* pOwner, BOOL bTakeOwnerShip, BOOL bFixedUp); }; // ConvertedImageView is for the case when we manually layout a flat image class ConvertedImageLayout: public PEImageLayout { VPTR_VTABLE_CLASS(ConvertedImageLayout,PEImageLayout) protected: HandleHolder m_FileMap; CLRMapViewHolder m_FileView; public: #ifndef DACCESS_COMPILE ConvertedImageLayout(PEImageLayout* source); #endif }; class MappedImageLayout: public PEImageLayout { VPTR_VTABLE_CLASS(MappedImageLayout,PEImageLayout) VPTR_UNIQUE(0x15) protected: #ifndef FEATURE_PAL HandleHolder m_FileMap; CLRMapViewHolder m_FileView; #else PALPEFileHolder m_LoadedFile; #endif public: #ifndef DACCESS_COMPILE MappedImageLayout(PEImage* pOwner); #endif }; #if !defined(CROSSGEN_COMPILE) && !defined(FEATURE_PAL) class LoadedImageLayout: public PEImageLayout { VPTR_VTABLE_CLASS(LoadedImageLayout,PEImageLayout) protected: HINSTANCE m_Module; public: #ifndef DACCESS_COMPILE LoadedImageLayout(PEImage* pOwner, BOOL bNTSafeLoad, BOOL bThrowOnError); ~LoadedImageLayout() { CONTRACTL { NOTHROW; GC_TRIGGERS; MODE_ANY; } CONTRACTL_END; if (m_Module) CLRFreeLibrary(m_Module); } #endif // !DACCESS_COMPILE }; #endif // !CROSSGEN_COMPILE && !FEATURE_PAL class FlatImageLayout: public PEImageLayout { VPTR_VTABLE_CLASS(FlatImageLayout,PEImageLayout) VPTR_UNIQUE(0x59) protected: HandleHolder m_FileMap; CLRMapViewHolder m_FileView; public: #ifndef DACCESS_COMPILE FlatImageLayout(PEImage* pOwner); #endif }; #endif // PEIMAGELAYOUT_H_
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ /*** This file is part of systemd. Copyright 2014 David Herrmann <dh.herrmann@gmail.com> systemd 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. systemd 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 systemd; If not, see <http://www.gnu.org/licenses/>. ***/ #include <errno.h> #include <inttypes.h> #include <stdlib.h> #include "consoled.h" #include "grdev.h" #include "list.h" #include "macro.h" #include "util.h" int display_new(Display **out, Session *s, grdev_display *display) { _cleanup_(display_freep) Display *d = NULL; assert(out); assert(s); assert(display); d = new0(Display, 1); if (!d) return -ENOMEM; d->session = s; d->grdev = display; d->width = grdev_display_get_width(display); d->height = grdev_display_get_height(display); LIST_PREPEND(displays_by_session, d->session->display_list, d); grdev_display_enable(display); *out = d; d = NULL; return 0; } Display *display_free(Display *d) { if (!d) return NULL; LIST_REMOVE(displays_by_session, d->session->display_list, d); free(d); return NULL; } void display_refresh(Display *d) { assert(d); d->width = grdev_display_get_width(d->grdev); d->height = grdev_display_get_height(d->grdev); } void display_render(Display *d, Workspace *w) { const grdev_display_target *target; assert(d); assert(w); GRDEV_DISPLAY_FOREACH_TARGET(d->grdev, target) { if (workspace_draw(w, target)) grdev_display_flip_target(d->grdev, target); } }
/** * @file * * @ingroup lpc24xx * * @brief Reset code. */ /* * Copyright (c) 2008-2013 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Obere Lagerstr. 30 * 82178 Puchheim * Germany * <rtems@embedded-brains.de> * * 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. */ #include <rtems.h> #include <rtems/score/armv7m.h> #include <bsp/bootcard.h> #include <bsp/lpc24xx.h> #include <bsp/start.h> BSP_START_TEXT_SECTION __attribute__((flatten)) void bsp_reset(void) { rtems_interrupt_level level; (void) level; rtems_interrupt_disable(level); #if defined(ARM_MULTILIB_ARCH_V4) /* Trigger watchdog reset */ WDCLKSEL = 0; WDTC = 0xff; WDMOD = 0x3; WDFEED = 0xaa; WDFEED = 0x55; #elif defined(ARM_MULTILIB_ARCH_V7M) _ARMV7M_SCB->aircr = ARMV7M_SCB_AIRCR_VECTKEY | ARMV7M_SCB_AIRCR_SYSRESETREQ; #endif while (true) { /* Do nothing */ } }
/** @file Support functions for UEFI protocol notification infrastructure. Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #include "PiSmmCore.h" /** Signal event for every protocol in protocol entry. @param Prot Protocol interface **/ VOID SmmNotifyProtocol ( IN PROTOCOL_INTERFACE *Prot ) { PROTOCOL_ENTRY *ProtEntry; PROTOCOL_NOTIFY *ProtNotify; LIST_ENTRY *Link; ProtEntry = Prot->Protocol; for (Link=ProtEntry->Notify.ForwardLink; Link != &ProtEntry->Notify; Link=Link->ForwardLink) { ProtNotify = CR(Link, PROTOCOL_NOTIFY, Link, PROTOCOL_NOTIFY_SIGNATURE); ProtNotify->Function (&ProtEntry->ProtocolID, Prot->Interface, Prot->Handle); } } /** Removes Protocol from the protocol list (but not the handle list). @param Handle The handle to remove protocol on. @param Protocol GUID of the protocol to be moved @param Interface The interface of the protocol @return Protocol Entry **/ PROTOCOL_INTERFACE * SmmRemoveInterfaceFromProtocol ( IN IHANDLE *Handle, IN EFI_GUID *Protocol, IN VOID *Interface ) { PROTOCOL_INTERFACE *Prot; PROTOCOL_NOTIFY *ProtNotify; PROTOCOL_ENTRY *ProtEntry; LIST_ENTRY *Link; Prot = SmmFindProtocolInterface (Handle, Protocol, Interface); if (Prot != NULL) { ProtEntry = Prot->Protocol; // // If there's a protocol notify location pointing to this entry, back it up one // for(Link = ProtEntry->Notify.ForwardLink; Link != &ProtEntry->Notify; Link=Link->ForwardLink) { ProtNotify = CR(Link, PROTOCOL_NOTIFY, Link, PROTOCOL_NOTIFY_SIGNATURE); if (ProtNotify->Position == &Prot->ByProtocol) { ProtNotify->Position = Prot->ByProtocol.BackLink; } } // // Remove the protocol interface entry // RemoveEntryList (&Prot->ByProtocol); } return Prot; } /** Add a new protocol notification record for the request protocol. @param Protocol The requested protocol to add the notify registration @param Function Points to the notification function @param Registration Returns the registration record @retval EFI_INVALID_PARAMETER Invalid parameter @retval EFI_SUCCESS Successfully returned the registration record that has been added **/ EFI_STATUS EFIAPI SmmRegisterProtocolNotify ( IN CONST EFI_GUID *Protocol, IN EFI_SMM_NOTIFY_FN Function, OUT VOID **Registration ) { PROTOCOL_ENTRY *ProtEntry; PROTOCOL_NOTIFY *ProtNotify; LIST_ENTRY *Link; EFI_STATUS Status; if ((Protocol == NULL) || (Function == NULL) || (Registration == NULL)) { return EFI_INVALID_PARAMETER; } ProtNotify = NULL; // // Get the protocol entry to add the notification too // ProtEntry = SmmFindProtocolEntry ((EFI_GUID *) Protocol, TRUE); if (ProtEntry != NULL) { // // Find whether notification already exist // for (Link = ProtEntry->Notify.ForwardLink; Link != &ProtEntry->Notify; Link = Link->ForwardLink) { ProtNotify = CR(Link, PROTOCOL_NOTIFY, Link, PROTOCOL_NOTIFY_SIGNATURE); if (CompareGuid (&ProtNotify->Protocol->ProtocolID, Protocol) && (ProtNotify->Function == Function)) { // // Notification already exist // *Registration = ProtNotify; return EFI_SUCCESS; } } // // Allocate a new notification record // ProtNotify = AllocatePool (sizeof(PROTOCOL_NOTIFY)); if (ProtNotify != NULL) { ProtNotify->Signature = PROTOCOL_NOTIFY_SIGNATURE; ProtNotify->Protocol = ProtEntry; ProtNotify->Function = Function; // // Start at the ending // ProtNotify->Position = ProtEntry->Protocols.BackLink; InsertTailList (&ProtEntry->Notify, &ProtNotify->Link); } } // // Done. If we have a protocol notify entry, then return it. // Otherwise, we must have run out of resources trying to add one // Status = EFI_OUT_OF_RESOURCES; if (ProtNotify != NULL) { *Registration = ProtNotify; Status = EFI_SUCCESS; } return Status; }
/* ---------------------------------------------------------------------------- * ATMEL Microcontroller Software Support * ---------------------------------------------------------------------------- * Copyright (c) 2008, Atmel Corporation * * 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 disclaimer below. * * Atmel's name may not be used to endorse or promote products derived from * this software without specific prior written permission. * * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ---------------------------------------------------------------------------- */ /* Title: Trace About: Purpose Standard output methods for reporting debug information, warnings and errors, which can be turned on/off. About: Usage 1 - Initialize the DBGU using <trace_CONFIGURE>. 2 - Uses the <trace_LOG> macro to output traces throughout the program. 3 - Turn off all traces by defining the NOTRACE symbol during compilation. 4 - Disable a group of trace by changing the value of <trace_LEVEL> during compilation; traces with a level below <trace_LEVEL> are not generated. */ #ifndef TRACE_H #define TRACE_H //------------------------------------------------------------------------------ // Headers //------------------------------------------------------------------------------ #if !defined(NOTRACE) #include <board.h> #include <dbgu/dbgu.h> #include <pio/pio.h> #include <stdio.h> #endif //------------------------------------------------------------------------------ // Definitions //------------------------------------------------------------------------------ /* Constants: Trace levels trace_FATAL - Indicates a major error which prevents the program from going any further. trace_ERROR - Indicates an error which may not stop the program execution, but which indicates there is a problem with the code. trace_WARNING - Indicates that a minor error has happened. In most case it can be discarded safely; it may even be expected. trace_INFO - Informational trace about the program execution. Should enable the user to see the execution flow. trace_DEBUG - Traces whose only purpose is for debugging the program, and which do not produce meaningful information otherwise. */ #define trace_DEBUG 0 #define trace_INFO 1 #define trace_WARNING 2 #define trace_ERROR 3 #define trace_FATAL 4 /* Constant: trace_LEVEL Minimum level of traces that are output. By default, all traces are output; change the value of this symbol during compilation for a more restrictive behavior. */ #if !defined(trace_LEVEL) #define trace_LEVEL 0 #endif /* Macro: trace_CONFIGURE Initializes the DBGU unless the NOTRACE symbol has been defined. Parameters: mode - DBGU mode. baudrate - DBGU baudrate. mck - Master clock frequency. */ #if !defined(NOTRACE) #define trace_CONFIGURE(mode, baudrate, mck) { \ const Pin pinsDbgu[] = {PINS_DBGU}; \ PIO_Configure(pinsDbgu, PIO_LISTSIZE(pinsDbgu)); \ DBGU_Configure(mode, baudrate, mck); \ } #else #define trace_CONFIGURE(...) #endif /* Macro: trace_LOG Outputs a formatted string using <printf> if the log level is high enough. Can be disabled by defining the NOTRACE symbol during compilation. Parameters: level - Trace level (see <Trace levels>). format - Formatted string to output. ... - Additional parameters, depending on the formatted string. */ #if !defined(NOTRACE) #define trace_LOG(level, ...) { \ if (level >= trace_LEVEL) { \ printf(__VA_ARGS__); \ } \ } #else #define trace_LOG(...) #endif #endif //#ifndef TRACE_H
#ifndef __DE_HAL_H__ #define __DE_HAL_H__ #include "de_rtmx.h" #include "de_scaler.h" #include "de_csc.h" #include "../disp_private.h" extern int de_al_mgr_apply(unsigned int screen_id, struct disp_manager_data *data); extern int de_al_init(disp_bsp_init_para *para); extern int de_al_lyr_apply(unsigned int screen_id, struct disp_layer_config_data *data, unsigned int layer_num); extern int de_al_mgr_sync(unsigned int screen_id); extern int de_al_mgr_update_regs(unsigned int screen_id); extern int de_al_query_irq(unsigned int screen_id); extern int de_al_enable_irq(unsigned int screen_id, unsigned en); extern int de_enhance_set_size(unsigned int screen_id, disp_rectsz *size); #endif
/* ex7 * * Test case that illustrates a timed wait on a condition variable. */ #include <errno.h> #include <stdio.h> #include <string.h> #include <pthread.h> #include <sys/time.h> #include <unistd.h> /* Our event variable using a condition variable contruct. */ typedef struct { pthread_mutex_t mutex; pthread_cond_t cond; int flag; } event_t; /* Global event to signal main thread the timeout of the child thread. */ event_t main_event; void * test_thread (void *ms_param) { int status = 0; event_t foo; struct timespec time; struct timeval now; long ms = (long) ms_param; /* initialize cond var */ pthread_cond_init(&foo.cond, NULL); pthread_mutex_init(&foo.mutex, NULL); foo.flag = 0; /* set the time out value */ printf("waiting %ld ms ...\n", ms); gettimeofday(&now, NULL); time.tv_sec = now.tv_sec + ms/1000 + (now.tv_usec + (ms%1000)*1000)/1000000; time.tv_nsec = ((now.tv_usec + (ms%1000)*1000) % 1000000) * 1000; /* Just use this to test the time out. The cond var is never signaled. */ pthread_mutex_lock(&foo.mutex); while (foo.flag == 0 && status != ETIMEDOUT) { status = pthread_cond_timedwait(&foo.cond, &foo.mutex, &time); } pthread_mutex_unlock(&foo.mutex); /* post the main event */ pthread_mutex_lock(&main_event.mutex); main_event.flag = 1; pthread_cond_signal(&main_event.cond); pthread_mutex_unlock(&main_event.mutex); /* that's it, bye */ return (void*) status; } int main (void) { unsigned long count; setvbuf (stdout, NULL, _IONBF, 0); /* initialize main event cond var */ pthread_cond_init(&main_event.cond, NULL); pthread_mutex_init(&main_event.mutex, NULL); main_event.flag = 0; for (count = 0; count < 20; ++count) { pthread_t thread; int status; /* pass down the milli-second timeout in the void* param */ status = pthread_create (&thread, NULL, test_thread, (void*) (count*100)); if (status != 0) { printf ("status = %d, count = %lu: %s\n", status, count, strerror (errno)); return 1; } else { /* wait for the event posted by the child thread */ pthread_mutex_lock(&main_event.mutex); while (main_event.flag == 0) { pthread_cond_wait(&main_event.cond, &main_event.mutex); } main_event.flag = 0; pthread_mutex_unlock(&main_event.mutex); printf ("count = %lu\n", count); } usleep (10); } return 0; }
/* proto_data.c * Protocol-specific data * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * * 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. */ #include "config.h" #include <glib.h> #if 0 #include <epan/epan.h> #include <wiretap/wtap.h> #endif #include <epan/wmem/wmem.h> #include <epan/packet_info.h> #include <epan/proto_data.h> #include <epan/proto.h> #if 0 #include <epan/packet.h> #endif #if 0 #include <epan/timestamp.h> #endif /* Protocol-specific data attached to a frame_data structure - protocol index and opaque pointer. */ typedef struct _proto_data { int proto; guint32 key; void *proto_data; } proto_data_t; static gint p_compare(gconstpointer a, gconstpointer b) { const proto_data_t *ap = (const proto_data_t *)a; const proto_data_t *bp = (const proto_data_t *)b; if (ap -> proto > bp -> proto) { return 1; } else if (ap -> proto == bp -> proto) { if (ap->key > bp->key){ return 1; } else if (ap -> key == bp -> key) { return 0; } return -1; } else { return -1; } } void p_add_proto_data(wmem_allocator_t *tmp_scope, struct _packet_info* pinfo, int proto, guint32 key, void *proto_data) { proto_data_t *p1; GSList **proto_list; wmem_allocator_t *scope; if (tmp_scope == pinfo->pool) { scope = tmp_scope; proto_list = &pinfo->proto_data; } else { scope = wmem_file_scope(); proto_list = &pinfo->fd->pfd; } p1 = (proto_data_t *)wmem_alloc(scope, sizeof(proto_data_t)); p1->proto = proto; p1->key = key; p1->proto_data = proto_data; /* Add it to the GSLIST */ *proto_list = g_slist_prepend(*proto_list, p1); } void * p_get_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int proto, guint32 key) { proto_data_t temp, *p1; GSList *item; temp.proto = proto; temp.key = key; temp.proto_data = NULL; if (scope == pinfo->pool) { item = g_slist_find_custom(pinfo->proto_data, &temp, p_compare); } else { item = g_slist_find_custom(pinfo->fd->pfd, &temp, p_compare); } if (item) { p1 = (proto_data_t *)item->data; return p1->proto_data; } return NULL; } void p_remove_proto_data(wmem_allocator_t *scope, struct _packet_info* pinfo, int proto, guint32 key) { proto_data_t temp; GSList *item; GSList **proto_list; temp.proto = proto; temp.key = key; temp.proto_data = NULL; if (scope == pinfo->pool) { item = g_slist_find_custom(pinfo->fd->pfd, &temp, p_compare); proto_list = &pinfo->proto_data; } else { item = g_slist_find_custom(pinfo->fd->pfd, &temp, p_compare); proto_list = &pinfo->fd->pfd; } if (item) { *proto_list = g_slist_remove(*proto_list, item->data); } } gchar * p_get_proto_name_and_key(wmem_allocator_t *scope, struct _packet_info* pinfo, guint pfd_index){ proto_data_t *temp; if (scope == pinfo->pool) { temp = (proto_data_t *)g_slist_nth_data(pinfo->proto_data, pfd_index); } else { temp = (proto_data_t *)g_slist_nth_data(pinfo->fd->pfd, pfd_index); } return wmem_strdup_printf(wmem_packet_scope(),"[%s, key %u]",proto_get_protocol_name(temp->proto), temp->key); } /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 2 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=2 tabstop=8 expandtab: * :indentSize=2:tabSize=8:noTabs=true: */
#pragma once /* * Copyright 2010-2016 OpenXcom Developers. * * This file is part of OpenXcom. * * OpenXcom is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * OpenXcom is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>. */ #include <string> #include <yaml-cpp/yaml.h> namespace OpenXcom { class Language; /** * Enumerator for time periods. */ enum TimeTrigger { TIME_5SEC, TIME_10MIN, TIME_30MIN, TIME_1HOUR, TIME_1DAY, TIME_1MONTH }; /** * Stores the current ingame time/date according to GMT. * Takes care of managing and representing each component, * as well as common time operations. */ class GameTime { private: int _second, _minute, _hour, _weekday, _day, _month, _year; public: /// Creates a new ingame time at a certain point. GameTime(int weekday, int day, int month, int year, int hour, int minute, int second); /// Cleans up the ingame time. ~GameTime(); /// Loads the time from YAML. void load(const YAML::Node& node); /// Saves the time to YAML. YAML::Node save() const; /// Advances the time by 5 seconds. TimeTrigger advance(); /// Gets the ingame second. int getSecond() const; /// Gets the ingame minute. int getMinute() const; /// Gets the ingame hour. int getHour() const; /// Gets the ingame weekday. int getWeekday() const; // Gets a string version of the ingame weekday. std::string getWeekdayString() const; /// Gets the ingame day. int getDay() const; // Gets a string version of the ingame day. std::string getDayString(Language *lang) const; /// Gets the ingame month. int getMonth() const; // Gets a string version of the ingame month. std::string getMonthString() const; /// Gets the ingame year. int getYear() const; /// Gets the position of the daylight according to the ingame time. double getDaylight() const; }; }
/* * This file is part of Cleanflight and Betaflight. * * Cleanflight and Betaflight are free software. You can redistribute * this software and/or modify this software under the terms of the * GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) * any later version. * * Cleanflight and Betaflight are distributed in the hope that they * will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software. * * If not, see <http://www.gnu.org/licenses/>. */ #pragma once #define USE_TARGET_CONFIG #define TARGET_BOARD_IDENTIFIER "TT41" #define USBD_PRODUCT_STRING "TransTECF411" #define TARGET_MANUFACTURER_IDENTIFIER "TTRH" #define LED0_PIN PA14 #define USE_BEEPER #define BEEPER_PIN PB5 #define BEEPER_INVERTED #define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON #define USE_PINIO #define PINIO1_PIN PB6 //VTX Power Switch #define USE_PINIOBOX // *************** Gyro & ACC ********************** #define USE_SPI #define USE_SPI_DEVICE_1 #define SPI1_SCK_PIN PA5 #define SPI1_MISO_PIN PA6 #define SPI1_MOSI_PIN PA7 #define GYRO_1_CS_PIN PA4 #define GYRO_1_SPI_INSTANCE SPI1 #define USE_EXTI #define USE_GYRO_EXTI #define GYRO_1_EXTI_PIN PA1 #define USE_MPU_DATA_READY_SIGNAL #define USE_GYRO #define USE_GYRO_SPI_MPU6000 #define GYRO_1_ALIGN CW90_DEG #define USE_ACC #define USE_ACC_SPI_MPU6000 // *************** UART ***************************** #define USE_VCP #define USB_DETECT_PIN PC15 #define USE_USB_DETECT #define USE_UART1 #define UART1_RX_PIN PA10 #define UART1_TX_PIN PA9 #define USE_UART2 #define UART2_RX_PIN PA3 #define UART2_TX_PIN PA2 #define SERIAL_PORT_COUNT 3 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL #define SERIALRX_PROVIDER SERIALRX_SBUS #define SERIALRX_UART SERIAL_PORT_USART1 #define INVERTER_PIN_UART1 PC13 // *************** OSD ***************************** #define USE_SPI_DEVICE_2 #define SPI2_SCK_PIN PB13 #define SPI2_MISO_PIN PB14 #define SPI2_MOSI_PIN PB15 #define USE_MAX7456 #define MAX7456_SPI_INSTANCE SPI2 #define MAX7456_SPI_CS_PIN PB12 // *************** ADC ***************************** #define USE_ADC #define ADC_INSTANCE ADC1 #define ADC1_DMA_OPT 0 #define VBAT_ADC_PIN PA0 #define CURRENT_METER_ADC_PIN PB4 #define USE_ESCSERIAL #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_AIRMODE) #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC #define TARGET_IO_PORTA 0xffff #define TARGET_IO_PORTB 0xffff #define TARGET_IO_PORTC 0xffff #define TARGET_IO_PORTD (BIT(2)) #define USABLE_TIMER_CHANNEL_COUNT 5 #define USED_TIMERS ( TIM_N(1)|TIM_N(2)|TIM_N(3)|TIM_N(4) )
/* * Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra * * This file is part of Essentia * * Essentia is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation (FSF), 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 Affero GNU General Public License * version 3 along with this program. If not, see http://www.gnu.org/licenses/ */ #ifndef ESSENTIA_BPMHISTOGRAM_H #define ESSENTIA_BPMHISTOGRAM_H #include "algorithmfactory.h" #include "streamingalgorithmcomposite.h" #include "pool.h" #include "network.h" namespace essentia { namespace streaming { class BpmHistogram : public AlgorithmComposite { protected: SinkProxy<Real> _signal; Source<Real> _bpm; Source<std::vector<Real> > _bpmCandidates; Source<std::vector<Real> > _bpmMagnitudes; // it has to be a TNT::Array cause Pool doesn't support vector<vector<type> > Source<TNT::Array2D<Real> > _tempogram; Source<std::vector<Real> > _frameBpms; Source<std::vector<Real> > _ticks; Source<std::vector<Real> > _ticksMagnitude; Source<std::vector<Real> > _sinusoid; // inner algos Algorithm* _frameCutter; Algorithm* _windowing; Algorithm* _fft; Algorithm* _cart2polar; Algorithm* _peakDetection; scheduler::Network* _network; // parameters: Real _binWidth; Real _minBpm, _maxBpm; Real _frameRate; Real _bpmTolerance; int _frameSize, _hopSize; int _maxPeaks; int _preferredBufferSize; bool _normalize; bool _weightByMagnitude; bool _constantTempo; Real _meanBpm; Pool _pool; std::vector<Real> _window; void computeBpm(); // functions for computing ticks: void createWindow(int size); void createTicks(Real bpm); void createSinusoid(std::vector<Real>& sinusoid, Real freq, Real phase, int idx); void unwrapPhase(Real& ph, const Real& uwph); void postProcessBpms(Real mainBpm, std::vector<Real>& bpms); void computeHistogram(std::vector<Real>& bpmPositions, std::vector<Real>& bpmMagnitudes); Real deviationWeight(Real x, Real mu, Real sigma); public: BpmHistogram(); ~BpmHistogram(); void declareParameters() { declareParameter("frameRate", "the sampling rate of the novelty curve [frame/s]", "[1,inf)", 44100./512.); declareParameter("frameSize", "the minimum length to compute the fft [s]", "[1,inf)", 4.0); declareParameter("zeroPadding", "zero padding factor to compute the fft [s]", "[0,inf)", 0); declareParameter("overlap", "the overlap factor", "(0,inf)", 16); declareParameter("windowType", "the window type to be used when computing the fft", "", "hann"); declareParameter("maxPeaks", "the number of peaks to be considered at each spectrum", "(0,inf]", 50); declareParameter("minBpm", "the minimum bpm to consider", "[0,inf)", 30.); declareParameter("maxBpm", "the maximum bpm to consider", "(0,inf)", 560.); declareParameter("weightByMagnitude", "whether to consider peaks' magnitude when building the histogram", "{true,false}", true); declareParameter("constantTempo", "whether to consider constant tempo. Set to true when inducina specific tempo", "{true,false}", false); declareParameter("tempoChange", "the minimum length to consider a change in tempo as stable [s]", "[0,inf)", 5.); declareParameter("bpm", "bpm to induce a certain tempo tracking. Zero if unknown", "[0,inf)", 0.0); } void declareProcessOrder() { declareProcessStep(ChainFrom(_frameCutter)); declareProcessStep(SingleShot(this)); } void configure(); AlgorithmStatus process(); static const char* name; static const char* description; }; } // namespace streaming } // namespace essentia #endif // ESSENTIA_BPMHISTOGRAM_H
// @(#)root/meta:$Id$ // Author: Rene Brun 05/03/95 /************************************************************************* * Copyright (C) 1995-2000, 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_TRealData #define ROOT_TRealData ////////////////////////////////////////////////////////////////////////// // // // TRealData // // // // Description of persistent data members. // // // ////////////////////////////////////////////////////////////////////////// #ifndef ROOT_TObject #include "TObject.h" #endif #ifndef ROOT_TString #include "TString.h" #endif class TDataMember; class TRealData : public TObject { private: TDataMember *fDataMember; //pointer to data member descriptor Long_t fThisOffset; //offset with the THIS object pointer TString fName; //Concatenated names of this realdata TMemberStreamer *fStreamer; //Object to stream the data member. Bool_t fIsObject; //true if member is an object TRealData(const TRealData& rhs); // Copying TRealData in not allowed. TRealData& operator=(const TRealData& rhs); // Copying TRealData in not allowed. public: enum { kTransient = BIT(14) // The member is transient. }; TRealData(); TRealData(const char *name, Long_t offset, TDataMember *datamember); virtual ~TRealData(); void AdoptStreamer(TMemberStreamer *p); virtual const char *GetName() const {return fName.Data();} TDataMember *GetDataMember() const {return fDataMember;} TMemberStreamer *GetStreamer() const; Long_t GetThisOffset() const {return fThisOffset;} Bool_t IsObject() const {return fIsObject;} void SetIsObject(Bool_t isObject) {fIsObject=isObject;} void WriteRealData(void *pointer, char *&buffer); ClassDef(TRealData,0) //Description of persistent data members }; #endif
/* * Copyright (C) 2016 Freie Universität Berlin * * This file is subject to the terms and conditions of the GNU Lesser General * Public License v2.1. See the file LICENSE in the top level directory for more * details. */ /** * @ingroup cpu_nrf51 * @ingroup drivers_periph_i2c * @{ * * @file * @brief Low-level I2C driver implementation * * @author Hauke Petersen <hauke.petersen@fu-berlin.de> * * @} */ /** * @ingroup cpu_nrf51 * @ingroup drivers_periph_i2c * @{ * * @file * @brief Low-level I2V driver implementation * * @} */ #include <assert.h> #include <errno.h> #include "cpu.h" #include "mutex.h" #include "assert.h" #include "periph/i2c.h" #include "periph_conf.h" #define ENABLE_DEBUG (0) #include "debug.h" /** * @brief If any of the 4 lower bits are set, the speed value is invalid */ #define INVALID_SPEED_MASK (0x0f) /** * @brief Initialized bus locks */ static mutex_t locks[I2C_NUMOF]; static inline NRF_TWI_Type *i2c(i2c_t dev) { return i2c_config[dev].dev; } static int error(i2c_t dev) { i2c(dev)->EVENTS_ERROR = 0; DEBUG("[i2c] error 0x%02x\n", (int)i2c(dev)->ERRORSRC); if (i2c(dev)->ERRORSRC & TWI_ERRORSRC_ANACK_Msk) { i2c(dev)->ERRORSRC = TWI_ERRORSRC_ANACK_Msk; DEBUG("[i2c] check_error: NACK on address byte\n"); return -ENXIO; } if (i2c(dev)->ERRORSRC & TWI_ERRORSRC_DNACK_Msk) { i2c(dev)->ERRORSRC = TWI_ERRORSRC_DNACK_Msk; DEBUG("[i2c] check_error: NACK on data byte\n"); return -EIO; } return 0; } static int write(i2c_t dev, uint16_t addr, const void *data, int len, uint8_t flags) { assert(len > 0); assert(dev < I2C_NUMOF); uint8_t *buf = (uint8_t *)data; DEBUG("[i2c] writing %i byte to the bus\n", len); i2c(dev)->ADDRESS = (addr & 0x7f); for (int i = 0; i < len; i++) { i2c(dev)->TXD = *buf++; i2c(dev)->EVENTS_TXDSENT = 0; i2c(dev)->TASKS_STARTTX = 1; while (!(i2c(dev)->EVENTS_TXDSENT) && !(i2c(dev)->EVENTS_ERROR)) {} if (i2c(dev)->EVENTS_ERROR) { return error(dev); } } if (!(flags & I2C_NOSTOP)) { i2c(dev)->EVENTS_STOPPED = 0; i2c(dev)->TASKS_STOP = 1; while (!(i2c(dev)->EVENTS_STOPPED) && !(i2c(dev)->EVENTS_ERROR)) {} if (i2c(dev)->EVENTS_ERROR) { return error(dev); } } return len; } void i2c_init(i2c_t dev) { assert(dev < I2C_NUMOF); /* Initialize mutex */ mutex_init(&locks[dev]); /* power on the bus */ i2c(dev)->POWER = TWI_POWER_POWER_Enabled; /* pin configuration */ NRF_GPIO->PIN_CNF[i2c_config[dev].pin_scl] = (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos); NRF_GPIO->PIN_CNF[i2c_config[dev].pin_scl] = (GPIO_PIN_CNF_DRIVE_S0D1 << GPIO_PIN_CNF_DRIVE_Pos); i2c(dev)->PSELSCL = i2c_config[dev].pin_scl; i2c(dev)->PSELSDA = i2c_config[dev].pin_sda; NRF_PPI->CHENCLR = (1 << i2c_config[dev].ppi); NRF_PPI->CH[i2c_config[dev].ppi].EEP = (uint32_t)&i2c(dev)->EVENTS_BB; /* bus clock speed configuration */ i2c(dev)->FREQUENCY = i2c_config[dev].speed; /* enable the device */ i2c(dev)->ENABLE = TWI_ENABLE_ENABLE_Enabled; } int i2c_acquire(i2c_t dev) { assert(dev < I2C_NUMOF); mutex_lock(&locks[dev]); return 0; } void i2c_release(i2c_t dev) { assert(dev < I2C_NUMOF); mutex_unlock(&locks[dev]); } int i2c_read_bytes(i2c_t dev, uint16_t address, void *data, size_t length, uint8_t flags) { assert(length > 0); assert(dev < I2C_NUMOF); if (flags & (I2C_NOSTART | I2C_REG16 | I2C_ADDR10)) { return -EOPNOTSUPP; } uint8_t *in_buf = (uint8_t *)data; DEBUG("[i2c] reading %i byte from the bus\n", length); /* set the client address */ i2c(dev)->ADDRESS = (address & 0x7f); /* setup PPI channel as alternative to the broken SHORTS * -> see PAN notice #36: "Shortcuts described in nRF51 Reference Manual are * not functional." */ if (length == 1) { NRF_PPI->CH[i2c_config[dev].ppi].TEP = (uint32_t)&i2c(dev)->TASKS_STOP; } else { NRF_PPI->CH[i2c_config[dev].ppi].TEP = (uint32_t)&i2c(dev)->TASKS_SUSPEND; } NRF_PPI->CHENSET = (1 << i2c_config[dev].ppi); i2c(dev)->EVENTS_RXDREADY = 0; i2c(dev)->EVENTS_STOPPED = 0; i2c(dev)->TASKS_STARTRX = 1; for (int i = (length - 1); i >= 0; i--) { while (!(i2c(dev)->EVENTS_RXDREADY) && !(i2c(dev)->EVENTS_ERROR)) {} if (i2c(dev)->EVENTS_ERROR) { return error(dev); } *in_buf++ = (uint8_t)i2c(dev)->RXD; if (i == 1) { NRF_PPI->CH[i2c_config[dev].ppi].TEP = (uint32_t)&i2c(dev)->TASKS_STOP; } i2c(dev)->EVENTS_RXDREADY = 0; i2c(dev)->TASKS_RESUME = 1; } /* wait for the device to finish up */ while (i2c(dev)->EVENTS_STOPPED == 0) {} NRF_PPI->CHENCLR = (1 << i2c_config[dev].ppi); return length; } int i2c_read_regs(i2c_t dev, uint16_t address, uint16_t reg, void *data, size_t length, uint8_t flags) { if (flags & (I2C_NOSTART | I2C_REG16 | I2C_ADDR10)) { return -EOPNOTSUPP; } write(dev, address, &reg, 1, flags | I2C_NOSTOP); return i2c_read_bytes(dev, address, data, length, flags); } int i2c_write_bytes(i2c_t dev, uint16_t address, const void *data, size_t length, uint8_t flags) { if (flags & (I2C_NOSTART | I2C_REG16 | I2C_ADDR10)) { return -EOPNOTSUPP; } return write(dev, address, data, length, flags); } int i2c_write_regs(i2c_t dev, uint16_t address, uint16_t reg, const void *data, size_t length, uint8_t flags) { if (flags & (I2C_NOSTART | I2C_REG16 | I2C_ADDR10)) { return -EOPNOTSUPP; } write(dev, address, &reg, 1, flags | I2C_NOSTOP); return write(dev, address, data, length, flags); }
/* * Copyright (C) 2012-2013 Red Hat, Inc. * * Licensed under the GNU Lesser General Public License Version 2.1 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef EXCEPTION_PY_H #define EXCEPTION_PY_H extern PyObject *HyExc_Exception; extern PyObject *HyExc_Value; extern PyObject *HyExc_Query; extern PyObject *HyExc_Arch; extern PyObject *HyExc_Runtime; extern PyObject *HyExc_Validation; int init_exceptions(void); int ret2e(int ret, const char *msg); #endif // EXCEPTION_PY_H
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #ifndef _THRIFT_BUFFERED_TRANSPORT_H #define _THRIFT_BUFFERED_TRANSPORT_H #include <glib.h> #include <glib-object.h> #include <thrift/c_glib/transport/thrift_transport.h> G_BEGIN_DECLS /*! \file thrift_buffered_transport.h * \brief Implementation of a Thrift buffered transport. Subclasses * the ThriftTransport class. */ /* type macros */ #define THRIFT_TYPE_BUFFERED_TRANSPORT (thrift_buffered_transport_get_type ()) #define THRIFT_BUFFERED_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_BUFFERED_TRANSPORT, ThriftBufferedTransport)) #define THRIFT_IS_BUFFERED_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_BUFFERED_TRANSPORT)) #define THRIFT_BUFFERED_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_BUFFERED_TRANSPORT, ThriftBufferedTransportClass)) #define THRIFT_IS_BUFFERED_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_BUFFERED_TRANSPORT)) #define THRIFT_BUFFERED_TRANSPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_BUFFERED_TRANSPORT, ThriftBufferedTransportClass)) typedef struct _ThriftBufferedTransport ThriftBufferedTransport; /*! * ThriftBufferedTransport instance. */ struct _ThriftBufferedTransport { ThriftTransport parent; /* protected */ ThriftTransport *transport; /* private */ GByteArray *r_buf; GByteArray *w_buf; guint32 r_buf_size; guint32 w_buf_size; }; typedef struct _ThriftBufferedTransportClass ThriftBufferedTransportClass; /*! * ThriftBufferedTransport class. */ struct _ThriftBufferedTransportClass { ThriftTransportClass parent; }; /* used by THRIFT_TYPE_BUFFERED_TRANSPORT */ GType thrift_buffered_transport_get_type (void); G_END_DECLS #endif
/* * Jitsi, the OpenSource Java VoIP and Instant Messaging client. * * Distributable under LGPL license. * See terms of license at gnu.org. */ /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_jitsi_impl_neomedia_quicktime_QTSampleBuffer */ #ifndef _Included_org_jitsi_impl_neomedia_quicktime_QTSampleBuffer #define _Included_org_jitsi_impl_neomedia_quicktime_QTSampleBuffer #ifdef __cplusplus extern "C" { #endif /* * Class: org_jitsi_impl_neomedia_quicktime_QTSampleBuffer * Method: bytesForAllSamples * Signature: (J)[B */ JNIEXPORT jbyteArray JNICALL Java_org_jitsi_impl_neomedia_quicktime_QTSampleBuffer_bytesForAllSamples (JNIEnv *, jclass, jlong); /* * Class: org_jitsi_impl_neomedia_quicktime_QTSampleBuffer * Method: formatDescription * Signature: (J)J */ JNIEXPORT jlong JNICALL Java_org_jitsi_impl_neomedia_quicktime_QTSampleBuffer_formatDescription (JNIEnv *, jclass, jlong); #ifdef __cplusplus } #endif #endif
//////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2013, Typhoon Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// #import "TyphoonDefinition.h" @class TyphoonConfigPostProcessor; @protocol TyphoonResource; @class TyphoonRuntimeArguments; /** Declares short-hand definition factory methods for infrastructure components. */ @interface TyphoonDefinition (Infrastructure) @property (nonatomic, strong) TyphoonRuntimeArguments *currentRuntimeArguments; /** This flag used to distinguish definitions from reference to them. First time, when definition created, processed flag set to NO, * but next time, when this definition returned by reference (shortcut with another runtime args) processed flag will be set to YES */ @property (nonatomic) BOOL processed; /** * The key of the component. A key is useful when multiple configuration of the same class or protocol are desired - for example * MasterCardPaymentClient and VisaPaymentClient. * * If using the TyphoonBlockComponentFactory style of assembly, the key is automatically generated based on the selector name of the * component, thus avoiding "magic strings" and providing better integration with IDE refactoring tools. */ @property (nonatomic, strong) NSString *key; /** * Describes the initializer, ie the selector and arguments that will be used to instantiate this component. * * An initializer can be an instance method, a class method, or even a reference to another component's method (see factory property). * * If no explicit initializer has been set, returns a default initializer representing the init method. * * @see factory */ @property (nonatomic, strong, readonly) TyphoonMethod *initializer; /** * Returns true if this is a default initializer generated by Typhoon. A manually specified initializer will return false, even if the * selector is @selector(init) */ @property (nonatomic, getter = isInitializerGenerated) BOOL initializerGenerated; /** * Returns a definition with the given class and key. In the block-style assembly, keys are auto-generated, however infrastructure components * may specify their own key. */ + (instancetype)withClass:(Class)clazz key:(NSString *)key; /** Factory method for a TyphoonConfigPostProcessor. Don't use it in test targets! @param fileName The config filename to load. File should be placed in main bundle @return a definition. */ + (instancetype)configDefinitionWithName:(NSString *)fileName; /** Factory method for a TyphoonConfigPostProcessor. @param fileName The config filename to load. @param fileBundle The bundle, where the config file is placed @return a definition. */ + (instancetype)configDefinitionWithName:(NSString *)fileName bundle:(NSBundle *)fileBundle; /** Factory method for a TyphoonConfigPostProcessor. @param filePath The path to config file to load. @return a definition. */ + (instancetype)configDefinitionWithPath:(NSString *)filePath; - (id)initWithClass:(Class)clazz key:(NSString *)key; - (BOOL)isCandidateForInjectedClass:(Class)clazz includeSubclasses:(BOOL)includeSubclasses; - (BOOL)isCandidateForInjectedProtocol:(Protocol *)aProtocol; @end
#pragma once /* * Copyright (C) 2010-2012 Team XBMC * http://xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, 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 XBMC; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ #include "AE.h" #include "threads/Thread.h" class IThreadedAE : public IAE, public IRunnable { public: virtual void Run () = 0; virtual void Stop() = 0; };
// POD character, std::char_traits specialization -*- C++ -*- // Copyright (C) 2002-2017 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This 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. // 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/>. /** @file ext/pod_char_traits.h * This file is a GNU extension to the Standard C++ Library. */ // Gabriel Dos Reis <gdr@integrable-solutions.net> // Benjamin Kosnik <bkoz@redhat.com> #ifndef _POD_CHAR_TRAITS_H #define _POD_CHAR_TRAITS_H 1 #pragma GCC system_header #include <string> namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION // POD character abstraction. // NB: The char_type parameter is a subset of int_type, as to allow // int_type to properly hold the full range of char_type values as // well as EOF. /// @brief A POD class that serves as a character abstraction class. template<typename _Value, typename _Int, typename _St = std::mbstate_t> struct character { typedef _Value value_type; typedef _Int int_type; typedef _St state_type; typedef character<_Value, _Int, _St> char_type; value_type value; template<typename V2> static char_type from(const V2& v) { char_type ret = { static_cast<value_type>(v) }; return ret; } template<typename V2> static V2 to(const char_type& c) { V2 ret = { static_cast<V2>(c.value) }; return ret; } }; template<typename _Value, typename _Int, typename _St> inline bool operator==(const character<_Value, _Int, _St>& lhs, const character<_Value, _Int, _St>& rhs) { return lhs.value == rhs.value; } template<typename _Value, typename _Int, typename _St> inline bool operator<(const character<_Value, _Int, _St>& lhs, const character<_Value, _Int, _St>& rhs) { return lhs.value < rhs.value; } _GLIBCXX_END_NAMESPACE_VERSION } // namespace namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION /// char_traits<__gnu_cxx::character> specialization. template<typename _Value, typename _Int, typename _St> struct char_traits<__gnu_cxx::character<_Value, _Int, _St> > { typedef __gnu_cxx::character<_Value, _Int, _St> char_type; typedef typename char_type::int_type int_type; typedef typename char_type::state_type state_type; typedef fpos<state_type> pos_type; typedef streamoff off_type; static void assign(char_type& __c1, const char_type& __c2) { __c1 = __c2; } static bool eq(const char_type& __c1, const char_type& __c2) { return __c1 == __c2; } static bool lt(const char_type& __c1, const char_type& __c2) { return __c1 < __c2; } static int compare(const char_type* __s1, const char_type* __s2, size_t __n) { for (size_t __i = 0; __i < __n; ++__i) if (!eq(__s1[__i], __s2[__i])) return lt(__s1[__i], __s2[__i]) ? -1 : 1; return 0; } static size_t length(const char_type* __s) { const char_type* __p = __s; while (__p->value) ++__p; return (__p - __s); } static const char_type* find(const char_type* __s, size_t __n, const char_type& __a) { for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p) if (*__p == __a) return __p; return 0; } static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) { if (__n == 0) return __s1; return static_cast<char_type*> (__builtin_memmove(__s1, __s2, __n * sizeof(char_type))); } static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) { if (__n == 0) return __s1; std::copy(__s2, __s2 + __n, __s1); return __s1; } static char_type* assign(char_type* __s, size_t __n, char_type __a) { std::fill_n(__s, __n, __a); return __s; } static char_type to_char_type(const int_type& __i) { return char_type::template from(__i); } static int_type to_int_type(const char_type& __c) { return char_type::template to<int_type>(__c); } static bool eq_int_type(const int_type& __c1, const int_type& __c2) { return __c1 == __c2; } static int_type eof() { int_type __r = { static_cast<typename __gnu_cxx::__conditional_type <std::__is_integer<int_type>::__value, int_type, int>::__type>(-1) }; return __r; } static int_type not_eof(const int_type& __c) { return eq_int_type(__c, eof()) ? int_type() : __c; } }; _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef GLK_HUGO_HTOKENS #define GLK_HUGO_HTOKENS namespace Glk { namespace Hugo { /* * This file contains token definitions for the Hugo Compiler and Engine * The enum constants of type TOKEN_T reflect the token names given in the token array. * Token names followed by a # are for system use. */ /* i.e., highest numbered token */ #define TOKENS 0x7B /* arbitrary */ #define HASH_KEY 1023 enum TOKEN_T { /* 0x00 - 0x0f */ NULL_T, OPEN_BRACKET_T, CLOSE_BRACKET_T, DECIMAL_T, COLON_T, EQUALS_T, MINUS_T, PLUS_T, ASTERISK_T, FORWARD_SLASH_T, PIPE_T, SEMICOLON_T, OPEN_BRACE_T, CLOSE_BRACE_T, OPEN_SQUARE_T, CLOSE_SQUARE_T, /* 0x10 - 0x1f */ POUND_T, TILDE_T, GREATER_EQUAL_T, LESS_EQUAL_T, NOT_EQUAL_T, AMPERSAND_T, GREATER_T, LESS_T, IF_T, COMMA_T, ELSE_T, ELSEIF_T, WHILE_T, DO_T, SELECT_T, CASE_T, /* 0x20 - 0x2f */ FOR_T, RETURN_T, BREAK_T, AND_T, OR_T, JUMP_T, RUN_T, IS_T, NOT_T, TRUE_T, FALSE_T, LOCAL_T, VERB_T, XVERB_T, HELD_T, MULTI_T, /* 0x30 - 0x3f */ MULTIHELD_T, NEWLINE_T, ANYTHING_T, PRINT_T, NUMBER_T, CAPITAL_T, TEXT_T, GRAPHICS_T, COLOR_T, REMOVE_T, MOVE_T, TO_T, PARENT_T, SIBLING_T, CHILD_T, YOUNGEST_T, /* 0x40 - 0x4f */ ELDEST_T, YOUNGER_T, ELDER_T, PROP_T, ATTR_T, VAR_T, DICTENTRY_T, TEXTDATA_T, ROUTINE_T, DEBUGDATA_T, OBJECTNUM_T, VALUE_T, EOL_T, SYSTEM_T, NOTHELD_T, MULTINOTHELD_T, /* 0x50 - 0x5f */ WINDOW_T, RANDOM_T, WORD_T, LOCATE_T, PARSE_T, CHILDREN_T, IN_T, PAUSE_T, RUNEVENTS_T, ARRAYDATA_T, CALL_T, STRINGDATA_T, SAVE_T, RESTORE_T, QUIT_T, INPUT_T, /* 0x60 - 0x6f */ SERIAL_T, CLS_T, SCRIPTON_T, SCRIPTOFF_T, RESTART_T, HEX_T, OBJECT_T, XOBJECT_T, STRING_T, ARRAY_T, PRINTCHAR_T, UNDO_T, DICT_T, RECORDON_T, RECORDOFF_T, WRITEFILE_T, /* 0x70 - */ READFILE_T, WRITEVAL_T, READVAL_T, PLAYBACK_T, COLOUR_T, PICTURE_T, LABEL_T, SOUND_T, MUSIC_T, REPEAT_T, ADDCONTEXT_T, VIDEO_T }; struct HTokens { static const char *const token[]; static int token_hash[]; HTokens(); }; } // End of namespace Hugo } // End of namespace Glk #endif
#include <linux/types.h> #include <upgrade.h> #include <common.h> #include <command.h> //simple_strtoul (argv[3], NULL, 16); //partition inline int size_align(int size) { size = (((size / 0x10000) + 1) * 0x10000); } void self_check(void) { unsigned long size; char str[128]; printf("u-boot come into the world!!!\n"); size = simple_strtoul (getenv ("bootfilesize"), NULL, 16); run_command ("defenv", 0); sprintf(str, "set bootfilesize 0x%x", size); run_command (str, 0); run_command ("set tag 2", 0); run_command ("save", 0); } int upgrade_bootloader(void) { int i = 0, j = 0, retry = 2; char str[128]; unsigned long size, size1; char *filepath; printf("u-boot upgrading...\n"); if(run_command ("mmcinfo", 0)) { UPGRADE_DPRINT("## ERROR: SD card not find!!!\n"); } else { UPGRADE_DPRINT("Find SD card!!!\n"); for(i = 0; i < SCAN_MMC_PARTITION; i++) { sprintf(str, "fatexist mmc 0:%d %s", (i + 1), UBOOTPATH); UPGRADE_DPRINT("command: %s\n", str); if(!run_command (str, 0)) { size = simple_strtoul (getenv ("bootfilesize"), NULL, 16); size1 = simple_strtoul (getenv ("filesize"), NULL, 16); //if(size != size1) { UPGRADE_DPRINT("bootfilesize:%d != filesize:%d\n", size, size1); while(retry-- > 0) { sprintf(str, "fatload mmc 0:%d ${loadaddr} %s", (i + 1), UBOOTPATH); UPGRADE_DPRINT("command: %s\n", str); run_command (str, 0); run_command ("nand rom_protect off", 0); run_command ("nand rom_write ${loadaddr} ${bootstart} ${bootsize}", 0); run_command ("nand rom_protect on", 0); size = simple_strtoul (getenv ("filesize"), NULL, 16); sprintf(str, "set bootfilesize 0x%x", size); run_command (str, 0); UPGRADE_DPRINT("bootloader upgrade successful!\n"); run_command ("save", 0); return 1; } } } } } return 0; } int upgrade_env(void) { int i = 0, partition_num = 0; char str[128]; char *filepath; printf("environment upgrading...\n"); if(run_command ("mmcinfo", 0)) { UPGRADE_DPRINT("## ERROR: SD card not find!!!\n"); } else { UPGRADE_DPRINT("Find SD card!!!\n"); for(i = 0; i < SCAN_MMC_PARTITION; i++) { sprintf(str, "fatexist mmc 0:%d ${envpath}", (i + 1)); UPGRADE_DPRINT("command: %s\n", str); if(!run_command (str, 0)) { sprintf(str, "fatload mmc 0:%d ${loadaddr} ${envpath}", (i + 1)); run_command (str, 0); run_command ("loadenv ${loadaddr}", 0); run_command ("save", 0); return 1; } } } return 0; } int upgrade_partition(void) { int i = 0, j = 0, ret = 0, partition_num = 0; char upgrade_status_list[16]; char str[128]; unsigned long size, size1; char *filepath; printf("partition upgrading...\n"); if(run_command ("mmcinfo", 0)) { UPGRADE_DPRINT("## ERROR: SD card not find!!!\n"); } else { UPGRADE_DPRINT("Find SD card!!!\n"); memset(upgrade_status_list, 0, 16); partition_num = simple_strtoul(getenv ("partnum"), NULL, 16); for(i = 0; i < SCAN_MMC_PARTITION; i++) { for(j = 0; j < partition_num; j++) { if(!upgrade_status_list[j]) { sprintf(str, "p%dpath", j); filepath = getenv (str); sprintf(str, "fatexist mmc 0:%d %s", (i + 1), filepath); UPGRADE_DPRINT("command: %s\n", str); if(!run_command (str, 0)) { sprintf(str, "p%dfilesize", j); size = simple_strtoul (getenv (str), NULL, 16); size1 = simple_strtoul (getenv ("filesize"), NULL, 16); //if(size != size1) { sprintf(str, "fatload mmc 0:%d ${loadaddr} ${p%dpath}", (i + 1), j); UPGRADE_DPRINT("command: %s\n", str); run_command (str, 0); sprintf(str, "nand erase ${p%dstart} ${p%dsize}", j, j); run_command(str, 0); sprintf(str, "nand write ${loadaddr} ${p%dstart} ${p%dsize}", j, j); run_command (str, 0); sprintf(str, "set p%dfilesize ${filesize}", j); run_command (str, 0); upgrade_status_list[j] = 1; } } } } } } for(j = 0; j < partition_num; j++) { if(upgrade_status_list[j]) { UPGRADE_DPRINT("p% upgrade successful!\n", j); ret = 1; } } if(ret) { run_command ("save", 0); } return ret; }
#include <stdio.h> #include <unistd.h> extern long ce_exec_config[]; int main(int argc, char *argv[]) { int i, cnt, pos, len; unsigned int cksum, val; unsigned char *lp; unsigned char buf[8192]; if (argc != 2) { fprintf(stderr, "usage: %s name <in-file >out-file\n", argv[0]); exit(1); } fprintf(stdout, "#\n"); fprintf(stdout, "# Miscellaneous data structures:\n"); fprintf(stdout, "# WARNING - this file is automatically generated!\n"); fprintf(stdout, "#\n"); fprintf(stdout, "\n"); fprintf(stdout, "\t.data\n"); fprintf(stdout, "\t.globl %s_data\n", argv[1]); fprintf(stdout, "%s_data:\n", argv[1]); pos = 0; cksum = 0; while ((len = read(0, buf, sizeof(buf))) > 0) { cnt = 0; lp = (unsigned char *)buf; len = (len + 3) & ~3; /* Round up to longwords */ for (i = 0; i < len; i += 4) { if (cnt == 0) { fprintf(stdout, "\t.long\t"); } fprintf(stdout, "0x%02X%02X%02X%02X", lp[0], lp[1], lp[2], lp[3]); val = *(unsigned long *)lp; cksum ^= val; lp += 4; if (++cnt == 4) { cnt = 0; fprintf(stdout, " # %x \n", pos+i-12); fflush(stdout); } else { fprintf(stdout, ","); } } if (cnt) { fprintf(stdout, "0\n"); } pos += len; } fprintf(stdout, "\t.globl %s_len\n", argv[1]); fprintf(stdout, "%s_len:\t.long\t0x%x\n", argv[1], pos); fflush(stdout); fclose(stdout); fprintf(stderr, "cksum = %x\n", cksum); exit(0); }
#include <glib.h> #include <stdlib.h> #include <Ivy/ivy.h> #include <Ivy/ivyglibloop.h> void on_MOTOR_BENCH_STATUS(IvyClientPtr app, void *user_data, int argc, char *argv[]){ //guint time_tick = atoi(argv[0]); //guint time_sec = atoi(argv[1]); //guint throttle = atoi(argv[2]); //guint new_mode = atoi(argv[3]); } int main ( int argc, char** argv) { GMainLoop *ml = g_main_loop_new(NULL, FALSE); IvyInit ("IvyExample", "IvyExample READY", NULL, NULL, NULL, NULL); IvyBindMsg(on_MOTOR_BENCH_STATUS, NULL, "^\\S* MOTOR_BENCH_STATUS (\\S*) (\\S*) (\\S*) (\\S*)"); IvyStart("127.255.255.255"); g_main_loop_run(ml); return 0; }
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://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 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QXCBCLIPBOARD_H #define QXCBCLIPBOARD_H #include <qpa/qplatformclipboard.h> #include <qxcbobject.h> #include <xcb/xcb.h> #include <xcb/xfixes.h> QT_BEGIN_NAMESPACE #ifndef QT_NO_CLIPBOARD class QXcbConnection; class QXcbScreen; class QXcbClipboardMime; class QXcbClipboard : public QXcbObject, public QPlatformClipboard { public: QXcbClipboard(QXcbConnection *connection); ~QXcbClipboard(); QMimeData *mimeData(QClipboard::Mode mode) override; void setMimeData(QMimeData *data, QClipboard::Mode mode) override; bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; QXcbScreen *screen() const; xcb_window_t requestor() const; void setRequestor(xcb_window_t window); xcb_window_t owner() const; void handleSelectionRequest(xcb_selection_request_event_t *event); void handleSelectionClearRequest(xcb_selection_clear_event_t *event); void handleXFixesSelectionRequest(xcb_xfixes_selection_notify_event_t *event); bool clipboardReadProperty(xcb_window_t win, xcb_atom_t property, bool deleteProperty, QByteArray *buffer, int *size, xcb_atom_t *type, int *format); QByteArray clipboardReadIncrementalProperty(xcb_window_t win, xcb_atom_t property, int nbytes, bool nullterm); QByteArray getDataInFormat(xcb_atom_t modeAtom, xcb_atom_t fmtatom); void setProcessIncr(bool process) { m_incr_active = process; } bool processIncr() { return m_incr_active; } void incrTransactionPeeker(xcb_generic_event_t *ge, bool &accepted); xcb_window_t getSelectionOwner(xcb_atom_t atom) const; QByteArray getSelection(xcb_atom_t selection, xcb_atom_t target, xcb_atom_t property, xcb_timestamp_t t = 0); private: xcb_generic_event_t *waitForClipboardEvent(xcb_window_t win, int type, int timeout, bool checkManager = false); xcb_atom_t sendTargetsSelection(QMimeData *d, xcb_window_t window, xcb_atom_t property); xcb_atom_t sendSelection(QMimeData *d, xcb_atom_t target, xcb_window_t window, xcb_atom_t property); xcb_atom_t atomForMode(QClipboard::Mode mode) const; QClipboard::Mode modeForAtom(xcb_atom_t atom) const; // Selection and Clipboard QScopedPointer<QXcbClipboardMime> m_xClipboard[2]; QMimeData *m_clientClipboard[2]; xcb_timestamp_t m_timestamp[2]; xcb_window_t m_requestor = XCB_NONE; xcb_window_t m_owner = XCB_NONE; static const int clipboard_timeout; bool m_incr_active = false; bool m_clipboard_closing = false; xcb_timestamp_t m_incr_receive_time = 0; }; #endif // QT_NO_CLIPBOARD QT_END_NAMESPACE #endif // QXCBCLIPBOARD_H
/* ======================================================================== * Copyright 1988-2006 University of Washington * * 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 * * * ======================================================================== */ /* * Program: WCE environment routines * * Author: Mark Crispin * Networks and Distributed Computing * Computing & Communications * University of Washington * Administration Building, AG-44 * Seattle, WA 98195 * Internet: MRC@CAC.Washington.EDU * * Date: 1 August 1988 * Last Edited: 30 August 2006 */ #define SUBSCRIPTIONFILE(t) sprintf (t,"%s\\MAILBOX.LST",myhomedir ()) #define SUBSCRIPTIONTEMP(t) sprintf (t,"%s\\MAILBOX.TMP",myhomedir ()) #define L_SET SEEK_SET /* Function prototypes */ #include "env.h" static char *defaultDrive (void); static char *homeDrive (void); static char *homePath (char *path); char *sysinbox (); long random (); unsigned long unix_crlfcpy (char **dst,unsigned long *dstl,char *src, unsigned long srcl); unsigned long unix_crlflen (STRING *s); #define getpid random /* syslog() emulation */ #define LOG_MAIL (2<<3) /* mail system */ #define LOG_DAEMON (3<<3) /* system daemons */ #define LOG_AUTH (4<<3) /* security/authorization messages */ #define LOG_EMERG 0 /* system is unusable */ #define LOG_ALERT 1 /* action must be taken immediately */ #define LOG_CRIT 2 /* critical conditions */ #define LOG_ERR 3 /* error conditions */ #define LOG_WARNING 4 /* warning conditions */ #define LOG_NOTICE 5 /* normal but signification condition */ #define LOG_INFO 6 /* informational */ #define LOG_DEBUG 7 /* debug-level messages */ #define LOG_PID 0x01 /* log the pid with each message */ #define LOG_CONS 0x02 /* log on the console if errors in sending */ #define LOG_ODELAY 0x04 /* delay open until syslog() is called */ #define LOG_NDELAY 0x08 /* don't delay open */ #define LOG_NOWAIT 0x10 /* if forking to log on console, don't wait() */ void openlog (const char *ident,int logopt,int facility); void syslog (int priority,const char *message,...);
// Filename: config_lwo.h // Created by: drose (23Apr01) // //////////////////////////////////////////////////////////////////// // // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // // All use of this software is subject to the terms of the revised BSD // license. You should have received a copy of this license along // with this source code in a file named "LICENSE." // //////////////////////////////////////////////////////////////////// #ifndef CONFIG_LWO_H #define CONFIG_LWO_H #include "pandatoolbase.h" extern void init_liblwo(); #endif
/* This is a generated file */ #ifndef __kcm_protos_h__ #define __kcm_protos_h__ #include <stdarg.h> #ifdef __cplusplus extern "C" { #endif krb5_error_code kcm_access ( krb5_context /*context*/, kcm_client */*client*/, kcm_operation /*opcode*/, kcm_ccache /*ccache*/); krb5_error_code kcm_ccache_acquire ( krb5_context /*context*/, kcm_ccache /*ccache*/, krb5_creds **/*credp*/); krb5_error_code kcm_ccache_destroy ( krb5_context /*context*/, const char */*name*/); krb5_error_code kcm_ccache_destroy_client ( krb5_context /*context*/, kcm_client */*client*/, const char */*name*/); krb5_error_code kcm_ccache_destroy_if_empty ( krb5_context /*context*/, kcm_ccache /*ccache*/); krb5_error_code kcm_ccache_enqueue_default ( krb5_context /*context*/, kcm_ccache /*ccache*/, krb5_creds */*newcred*/); struct kcm_creds * kcm_ccache_find_cred_uuid ( krb5_context /*context*/, kcm_ccache /*ccache*/, kcmuuid_t /*uuid*/); char * kcm_ccache_first_name (kcm_client */*client*/); krb5_error_code kcm_ccache_gen_new ( krb5_context /*context*/, pid_t /*pid*/, uid_t /*uid*/, gid_t /*gid*/, kcm_ccache */*ccache*/); krb5_error_code kcm_ccache_get_uuids ( krb5_context /*context*/, kcm_client */*client*/, kcm_operation /*opcode*/, krb5_storage */*sp*/); krb5_error_code kcm_ccache_new ( krb5_context /*context*/, const char */*name*/, kcm_ccache */*ccache*/); krb5_error_code kcm_ccache_new_client ( krb5_context /*context*/, kcm_client */*client*/, const char */*name*/, kcm_ccache */*ccache_p*/); char *kcm_ccache_nextid ( pid_t /*pid*/, uid_t /*uid*/, gid_t /*gid*/); krb5_error_code kcm_ccache_refresh ( krb5_context /*context*/, kcm_ccache /*ccache*/, krb5_creds **/*credp*/); krb5_error_code kcm_ccache_remove_cred ( krb5_context /*context*/, kcm_ccache /*ccache*/, krb5_flags /*whichfields*/, const krb5_creds */*mcreds*/); krb5_error_code kcm_ccache_remove_cred_internal ( krb5_context /*context*/, kcm_ccache /*ccache*/, krb5_flags /*whichfields*/, const krb5_creds */*mcreds*/); krb5_error_code kcm_ccache_remove_creds ( krb5_context /*context*/, kcm_ccache /*ccache*/); krb5_error_code kcm_ccache_remove_creds_internal ( krb5_context /*context*/, kcm_ccache /*ccache*/); krb5_error_code kcm_ccache_resolve ( krb5_context /*context*/, const char */*name*/, kcm_ccache */*ccache*/); krb5_error_code kcm_ccache_resolve_by_uuid ( krb5_context /*context*/, kcmuuid_t /*uuid*/, kcm_ccache */*ccache*/); krb5_error_code kcm_ccache_resolve_client ( krb5_context /*context*/, kcm_client */*client*/, kcm_operation /*opcode*/, const char */*name*/, kcm_ccache */*ccache*/); krb5_error_code kcm_ccache_retrieve_cred ( krb5_context /*context*/, kcm_ccache /*ccache*/, krb5_flags /*whichfields*/, const krb5_creds */*mcreds*/, krb5_creds **/*credp*/); krb5_error_code kcm_ccache_retrieve_cred_internal ( krb5_context /*context*/, kcm_ccache /*ccache*/, krb5_flags /*whichfields*/, const krb5_creds */*mcreds*/, krb5_creds **/*creds*/); krb5_error_code kcm_ccache_store_cred ( krb5_context /*context*/, kcm_ccache /*ccache*/, krb5_creds */*creds*/, int /*copy*/); krb5_error_code kcm_ccache_store_cred_internal ( krb5_context /*context*/, kcm_ccache /*ccache*/, krb5_creds */*creds*/, int /*copy*/, krb5_creds **/*credp*/); krb5_error_code kcm_chmod ( krb5_context /*context*/, kcm_client */*client*/, kcm_ccache /*ccache*/, uint16_t /*mode*/); krb5_error_code kcm_chown ( krb5_context /*context*/, kcm_client */*client*/, kcm_ccache /*ccache*/, uid_t /*uid*/, gid_t /*gid*/); krb5_error_code kcm_cleanup_events ( krb5_context /*context*/, kcm_ccache /*ccache*/); void kcm_configure ( int /*argc*/, char **/*argv*/); krb5_error_code kcm_debug_ccache (krb5_context /*context*/); krb5_error_code kcm_debug_events (krb5_context /*context*/); krb5_error_code kcm_dispatch ( krb5_context /*context*/, kcm_client */*client*/, krb5_data */*req_data*/, krb5_data */*resp_data*/); krb5_error_code kcm_enqueue_event ( krb5_context /*context*/, kcm_event */*event*/); krb5_error_code kcm_enqueue_event_internal ( krb5_context /*context*/, kcm_event */*event*/); krb5_error_code kcm_enqueue_event_relative ( krb5_context /*context*/, kcm_event */*event*/); krb5_error_code kcm_internal_ccache ( krb5_context /*context*/, kcm_ccache /*c*/, krb5_ccache /*id*/); int kcm_is_same_session ( kcm_client */*client*/, uid_t /*uid*/, pid_t /*session*/); void kcm_log ( int /*level*/, const char */*fmt*/, ...); char* kcm_log_msg ( int /*level*/, const char */*fmt*/, ...); char* kcm_log_msg_va ( int /*level*/, const char */*fmt*/, va_list /*ap*/); const char * kcm_op2string (kcm_operation /*opcode*/); void kcm_openlog (void); krb5_error_code kcm_release_ccache ( krb5_context /*context*/, kcm_ccache /*c*/); krb5_error_code kcm_remove_event ( krb5_context /*context*/, kcm_event */*event*/); krb5_error_code kcm_retain_ccache ( krb5_context /*context*/, kcm_ccache /*ccache*/); krb5_error_code kcm_run_events ( krb5_context /*context*/, time_t /*now*/); void kcm_service ( void */*ctx*/, const heim_idata */*req*/, const heim_icred /*cred*/, heim_ipc_complete /*complete*/, heim_sipc_call /*cctx*/); void kcm_session_add (pid_t /*session_id*/); void kcm_session_setup_handler (void); krb5_error_code kcm_zero_ccache_data ( krb5_context /*context*/, kcm_ccache /*cache*/); krb5_error_code kcm_zero_ccache_data_internal ( krb5_context /*context*/, kcm_ccache_data */*cache*/); #ifdef __cplusplus } #endif #endif /* __kcm_protos_h__ */
/* * net/9p/util.c * * This file contains some helper functions * * Copyright (C) 2007 by Latchesar Ionkov <lucho@ionkov.net> * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com> * Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov> * * 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: * Free Software Foundation * 51 Franklin Street, Fifth Floor * Boston, MA 02111-1301 USA * */ #include <linux/module.h> #include <linux/errno.h> #include <linux/fs.h> #include <linux/sched.h> #include <linux/parser.h> #include <linux/idr.h> #include <net/9p/9p.h> /** * struct p9_idpool - per-connection accounting for tag idpool * @lock: protects the pool * @pool: idr to allocate tag id from * */ struct p9_idpool { spinlock_t lock; struct idr pool; }; /** * p9_idpool_create - create a new per-connection id pool * */ struct p9_idpool *p9_idpool_create(void) { struct p9_idpool *p; p = kmalloc(sizeof(struct p9_idpool), GFP_KERNEL); if (!p) return ERR_PTR(-ENOMEM); spin_lock_init(&p->lock); idr_init(&p->pool); return p; } EXPORT_SYMBOL(p9_idpool_create); /** * p9_idpool_destroy - create a new per-connection id pool * @p: idpool to destory */ void p9_idpool_destroy(struct p9_idpool *p) { idr_destroy(&p->pool); kfree(p); } EXPORT_SYMBOL(p9_idpool_destroy); /** * p9_idpool_get - allocate numeric id from pool * @p: pool to allocate from * * Bugs: This seems to be an awful generic function, should it be in idr.c with * the lock included in struct idr? */ int p9_idpool_get(struct p9_idpool *p) { int i = 0; int error; unsigned long flags; retry: if (idr_pre_get(&p->pool, GFP_KERNEL) == 0) return 0; spin_lock_irqsave(&p->lock, flags); /* no need to store exactly p, we just need something non-null */ error = idr_get_new(&p->pool, p, &i); spin_unlock_irqrestore(&p->lock, flags); if (error == -EAGAIN) goto retry; else if (error) return -1; P9_DPRINTK(P9_DEBUG_MUX, " id %d pool %p\n", i, p); return i; } EXPORT_SYMBOL(p9_idpool_get); /** * p9_idpool_put - release numeric id from pool * @id: numeric id which is being released * @p: pool to release id into * * Bugs: This seems to be an awful generic function, should it be in idr.c with * the lock included in struct idr? */ void p9_idpool_put(int id, struct p9_idpool *p) { unsigned long flags; P9_DPRINTK(P9_DEBUG_MUX, " id %d pool %p\n", id, p); spin_lock_irqsave(&p->lock, flags); idr_remove(&p->pool, id); spin_unlock_irqrestore(&p->lock, flags); } EXPORT_SYMBOL(p9_idpool_put); /** * p9_idpool_check - check if the specified id is available * @id: id to check * @p: pool to check */ int p9_idpool_check(int id, struct p9_idpool *p) { return idr_find(&p->pool, id) != NULL; } EXPORT_SYMBOL(p9_idpool_check);
/* * Copyright (c) 2002 Dieter Shirley * * dct_unquantize_h263_altivec: * Copyright (c) 2003 Romain Dolbeau <romain@dolbeau.org> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <stdlib.h> #include <stdio.h> #include "config.h" #include "libavutil/attributes.h" #include "libavutil/cpu.h" #include "libavutil/ppc/types_altivec.h" #include "libavutil/ppc/util_altivec.h" #include "libavcodec/mpegvideo.h" #include "dsputil_altivec.h" #if HAVE_ALTIVEC /* AltiVec version of dct_unquantize_h263 this code assumes `block' is 16 bytes-aligned */ static void dct_unquantize_h263_altivec(MpegEncContext *s, int16_t *block, int n, int qscale) { int i, level, qmul, qadd; int nCoeffs; assert(s->block_last_index[n]>=0); qadd = (qscale - 1) | 1; qmul = qscale << 1; if (s->mb_intra) { if (!s->h263_aic) { if (n < 4) block[0] = block[0] * s->y_dc_scale; else block[0] = block[0] * s->c_dc_scale; }else qadd = 0; i = 1; nCoeffs= 63; //does not always use zigzag table } else { i = 0; nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ]; } { register const vector signed short vczero = (const vector signed short)vec_splat_s16(0); DECLARE_ALIGNED(16, short, qmul8) = qmul; DECLARE_ALIGNED(16, short, qadd8) = qadd; register vector signed short blockv, qmulv, qaddv, nqaddv, temp1; register vector bool short blockv_null, blockv_neg; register short backup_0 = block[0]; register int j = 0; qmulv = vec_splat((vec_s16)vec_lde(0, &qmul8), 0); qaddv = vec_splat((vec_s16)vec_lde(0, &qadd8), 0); nqaddv = vec_sub(vczero, qaddv); // vectorize all the 16 bytes-aligned blocks // of 8 elements for(; (j + 7) <= nCoeffs ; j+=8) { blockv = vec_ld(j << 1, block); blockv_neg = vec_cmplt(blockv, vczero); blockv_null = vec_cmpeq(blockv, vczero); // choose between +qadd or -qadd as the third operand temp1 = vec_sel(qaddv, nqaddv, blockv_neg); // multiply & add (block{i,i+7} * qmul [+-] qadd) temp1 = vec_mladd(blockv, qmulv, temp1); // put 0 where block[{i,i+7} used to have 0 blockv = vec_sel(temp1, blockv, blockv_null); vec_st(blockv, j << 1, block); } // if nCoeffs isn't a multiple of 8, finish the job // using good old scalar units. // (we could do it using a truncated vector, // but I'm not sure it's worth the hassle) for(; j <= nCoeffs ; j++) { level = block[j]; if (level) { if (level < 0) { level = level * qmul - qadd; } else { level = level * qmul + qadd; } block[j] = level; } } if (i == 1) { // cheat. this avoid special-casing the first iteration block[0] = backup_0; } } } #endif /* HAVE_ALTIVEC */ av_cold void ff_MPV_common_init_ppc(MpegEncContext *s) { #if HAVE_ALTIVEC if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) return; if ((s->avctx->dct_algo == FF_DCT_AUTO) || (s->avctx->dct_algo == FF_DCT_ALTIVEC)) { s->dct_unquantize_h263_intra = dct_unquantize_h263_altivec; s->dct_unquantize_h263_inter = dct_unquantize_h263_altivec; } #endif /* HAVE_ALTIVEC */ }
/* * ================================================================= * * * Description: samsung display panel file * * Author: jb09.kim * Company: Samsung Electronics * * ================================================================ */ /* <one line to give the program's name and a brief idea of what it does.> Copyright (C) 2012, Samsung Electronics. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * */ #ifndef SAMSUNG_DSI_PANEL_S6E3FA3_AMS568HN01_H #define SAMSUNG_DSI_PANEL_S6E3FA3_AMS568HN01_H #include <linux/completion.h> #include "../ss_dsi_panel_common.h" struct smartdim_conf *smart_get_conf_S6E3FA3_AMS568HN01(void); #endif
#ifndef BLK_MQ_SCHED_H #define BLK_MQ_SCHED_H #include "blk-mq.h" #include "blk-mq-tag.h" int blk_mq_sched_init_hctx_data(struct request_queue *q, size_t size, int (*init)(struct blk_mq_hw_ctx *), void (*exit)(struct blk_mq_hw_ctx *)); void blk_mq_sched_free_hctx_data(struct request_queue *q, void (*exit)(struct blk_mq_hw_ctx *)); struct request *blk_mq_sched_get_request(struct request_queue *q, struct bio *bio, unsigned int op, struct blk_mq_alloc_data *data); void blk_mq_sched_put_request(struct request *rq); void blk_mq_sched_request_inserted(struct request *rq); bool blk_mq_sched_try_merge(struct request_queue *q, struct bio *bio, struct request **merged_request); bool __blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio); bool blk_mq_sched_try_insert_merge(struct request_queue *q, struct request *rq); void blk_mq_sched_restart_queues(struct blk_mq_hw_ctx *hctx); void blk_mq_sched_insert_request(struct request *rq, bool at_head, bool run_queue, bool async, bool can_block); void blk_mq_sched_insert_requests(struct request_queue *q, struct blk_mq_ctx *ctx, struct list_head *list, bool run_queue_async); void blk_mq_sched_dispatch_requests(struct blk_mq_hw_ctx *hctx); void blk_mq_sched_move_to_dispatch(struct blk_mq_hw_ctx *hctx, struct list_head *rq_list, struct request *(*get_rq)(struct blk_mq_hw_ctx *)); int blk_mq_sched_setup(struct request_queue *q); void blk_mq_sched_teardown(struct request_queue *q); int blk_mq_sched_init(struct request_queue *q); static inline bool blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio) { struct elevator_queue *e = q->elevator; if (!e || blk_queue_nomerges(q) || !bio_mergeable(bio)) return false; return __blk_mq_sched_bio_merge(q, bio); } static inline int blk_mq_sched_get_rq_priv(struct request_queue *q, struct request *rq, struct bio *bio) { struct elevator_queue *e = q->elevator; if (e && e->type->ops.mq.get_rq_priv) return e->type->ops.mq.get_rq_priv(q, rq, bio); return 0; } static inline void blk_mq_sched_put_rq_priv(struct request_queue *q, struct request *rq) { struct elevator_queue *e = q->elevator; if (e && e->type->ops.mq.put_rq_priv) e->type->ops.mq.put_rq_priv(q, rq); } static inline bool blk_mq_sched_allow_merge(struct request_queue *q, struct request *rq, struct bio *bio) { struct elevator_queue *e = q->elevator; if (e && e->type->ops.mq.allow_merge) return e->type->ops.mq.allow_merge(q, rq, bio); return true; } static inline void blk_mq_sched_completed_request(struct blk_mq_hw_ctx *hctx, struct request *rq) { struct elevator_queue *e = hctx->queue->elevator; if (e && e->type->ops.mq.completed_request) e->type->ops.mq.completed_request(hctx, rq); BUG_ON(rq->internal_tag == -1); blk_mq_put_tag(hctx, hctx->sched_tags, rq->mq_ctx, rq->internal_tag); } static inline void blk_mq_sched_started_request(struct request *rq) { struct request_queue *q = rq->q; struct elevator_queue *e = q->elevator; if (e && e->type->ops.mq.started_request) e->type->ops.mq.started_request(rq); } static inline void blk_mq_sched_requeue_request(struct request *rq) { struct request_queue *q = rq->q; struct elevator_queue *e = q->elevator; if (e && e->type->ops.mq.requeue_request) e->type->ops.mq.requeue_request(rq); } static inline bool blk_mq_sched_has_work(struct blk_mq_hw_ctx *hctx) { struct elevator_queue *e = hctx->queue->elevator; if (e && e->type->ops.mq.has_work) return e->type->ops.mq.has_work(hctx); return false; } /* * Mark a hardware queue as needing a restart. */ static inline void blk_mq_sched_mark_restart_hctx(struct blk_mq_hw_ctx *hctx) { if (!test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state)) set_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state); } /* * Mark a hardware queue and the request queue it belongs to as needing a * restart. */ static inline void blk_mq_sched_mark_restart_queue(struct blk_mq_hw_ctx *hctx) { struct request_queue *q = hctx->queue; if (!test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state)) set_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state); if (!test_bit(QUEUE_FLAG_RESTART, &q->queue_flags)) set_bit(QUEUE_FLAG_RESTART, &q->queue_flags); } static inline bool blk_mq_sched_needs_restart(struct blk_mq_hw_ctx *hctx) { return test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state); } #endif
/* Copyright 2013-2014 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ extern int bar () { return 1; /* gdb break at bar */ } extern int foo (int a) { return a; /* gdb break at foo */ }
/* * arch/arm/mach-sun3i/pm/standby/standby_twi.h * * (C) Copyright 2007-2012 * Allwinner Technology Co., Ltd. <www.allwinnertech.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ #ifndef _STANDBY_TWI_H_ #define _STANDBY_TWI_H_ #include "ePDK.h" #include "standby_cfg.h" #include "standby_reg.h" #define TWI_OP_RD (0) #define TWI_OP_WR (1) extern __s32 standby_twi_init(void); extern __s32 standby_twi_exit(void); extern __s32 twi_byte_rw(__s32 op_type, __u8 saddr, __u8 baddr, __u8 *data); #endif //_STANDBY_TWI_H_
/******************************************************************************/ /* */ /* File: xinput.h */ /* Auth: bkenwright@xbdev.net */ /* Desc: GamePad entry code for use on the xbox. */ /* */ /******************************************************************************/ /* This is our xinput header file, this is where all our functions that we'll use in our game or app for the xbox that 'require' gamepad support will be put. */ /******************************************************************************/ /* How does this code work? What lib's does it need? How would I use it in my code? Well the aim of the gamepad code was to develop an independent set of code for the openxdk - but because it's lib independent it also works on the xdk. <1> Include our header file, and the other files which do all the work.. later they'll be put into a library e.g. #include "xinput/xinput.h" // Gamepad input <2> Init our gamepad code e.g. stXINPUT xin; xInitInput(&xin); You do this ocne at the start of the program, I did it this way as I don't like globals, so you need to pass it a stuct called stXINPUT which keeps all our usb/gampad information in. <3> Get our gamepad information in our main loop e.g: stXPAD pad; xGetPadInput(&pad, &xin); <4> When we've all finished, call xReleaseInput(&xin); <Misc> You can also set the rumble effect - still in development e.g. xSetPadInput(&pad, &xin); */ /******************************************************************************/ #ifndef __XINPUT__ #define __XINPUT__ #if defined(__cplusplus) extern "C" { #endif #include "ohci.h" #include "pad.h" // for stXPAD definition // About this - at the moment it just contains the offset to the ohci memory // location (e.g. 0xfed00000...but we will also use this to keep track of // alocated memory - how many gamepads are plugged in...usb dev drivers etc. struct stXINPUT { ohci_t my_ohci; }; struct stXPAD; // Defined in xpad.h /******************************************************************************/ /* */ /* Interface Functions */ /* */ /******************************************************************************/ //<1> Creation int xInitInput(stXINPUT* p); //<2> Probing/ Getting or Setting Gamepad int xGetPadInput(stXPAD * p, stXINPUT * xin, int iWhichPad = 0); // 0 is default pad int xSetPadInput(stXPAD * p, stXINPUT * xin, int iWhichPad = 0); //<3> Death End int xReleaseInput(stXINPUT * p); #if defined(__cplusplus) } #endif #endif // __XINPUT__
/* mbed Microcontroller Library * Copyright (c) 2018 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * 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 "PeripheralPins.h" /************RTC***************/ const PinMap PinMap_RTC[] = { {NC, OSC32KCLK, 0}, }; /************ADC***************/ const PinMap PinMap_ADC[] = { {PTB1, ADC0_SE1, 0}, {PTB3, ADC0_SE2, 0}, {PTB2, ADC0_SE3, 0}, {PTB18, ADC0_SE4, 0}, {PTA19, ADC0_SE5, 0}, {NC , NC , 0} }; /************DAC***************/ const PinMap PinMap_DAC[] = { {DAC0_OUT, DAC_0, 0}, {NC, NC, 0} }; /************I2C***************/ const PinMap PinMap_I2C_SDA[] = { {PTB1, I2C_0, 3}, {PTB17, I2C_1, 3}, {PTC1, I2C_0, 3}, {PTC3, I2C_1, 3}, {PTC7, I2C_1, 3}, {PTC16, I2C_0, 3}, {PTC18, I2C_1, 3}, {NC , NC , 0} }; const PinMap PinMap_I2C_SCL[] = { {PTB0, I2C_0, 3}, {PTB16, I2C_1, 3}, {PTB18, I2C_1, 3}, {PTC2, I2C_1, 3}, {PTC6, I2C_1, 3}, {PTC17, I2C_1, 3}, {PTC19, I2C_0, 3}, {NC , NC , 0} }; /************UART***************/ const PinMap PinMap_UART_TX[] = { {PTC3, LPUART_0, 4}, {PTC7, LPUART_0, 4}, {PTC18, LPUART_0, 4}, {NC , NC , 0} }; const PinMap PinMap_UART_RX[] = { {PTC2, LPUART_0, 4}, {PTC6, LPUART_0, 4}, {PTC17, LPUART_0, 4}, {NC , NC , 0} }; const PinMap PinMap_UART_CTS[] = { {PTC4, LPUART_0, 4}, {PTC19, LPUART_0, 4}, {NC , NC , 0} }; const PinMap PinMap_UART_RTS[] = { {PTC1, LPUART_0, 4}, {PTC5, LPUART_0, 4}, {PTC16, LPUART_0, 4}, {NC , NC , 0} }; /************SPI***************/ const PinMap PinMap_SPI_SCLK[] = { {PTA18, SPI_1, 2}, {PTC16, SPI_0, 2}, {NC , NC , 0} }; const PinMap PinMap_SPI_MOSI[] = { {PTA16, SPI_1, 2}, {PTC17, SPI_0, 2}, {NC , NC , 0} }; const PinMap PinMap_SPI_MISO[] = { {PTA17, SPI_1, 2}, {PTC18, SPI_0, 2}, {NC , NC , 0} }; const PinMap PinMap_SPI_SSEL[] = { {PTA1, SPI_1, 2}, {PTA19, SPI_1, 2}, {PTC19, SPI_0, 2}, {NC , NC , 0} }; /************PWM***************/ const PinMap PinMap_PWM[] = { /* TPM 0 */ {PTA16, PWM_1, 5}, {PTB0, PWM_2, 5}, {PTB1, PWM_3, 5}, {PTA2, PWM_4, 5}, {PTB18, PWM_1, 5}, {PTC3, PWM_2, 5}, {PTC1, PWM_3, 5}, {PTC16, PWM_4, 5}, /* TPM 1 */ {PTA0, PWM_5, 5}, {PTA1, PWM_6, 5}, {PTB2, PWM_5, 5}, {PTB3, PWM_6, 5}, {PTC4, PWM_5, 5}, {PTC5, PWM_6, 5}, {NC , NC , 0} };
/* * Definitions for API from sdio common code (bcmsdh) to individual * host controller drivers. * * Copyright (C) 1999-2011, Broadcom Corporation * * Unless you and Broadcom execute a separate written software license * agreement governing use of this software, this software is licensed to you * under the terms of the GNU General Public License version 2 (the "GPL"), * available at http://www.broadcom.com/licenses/GPLv2.php, with the * following added to such license: * * As a special exception, the copyright holders of this software give you * permission to link this software with independent modules, and to copy and * distribute the resulting executable under terms of your choice, provided that * you also meet, for each linked independent module, the terms and conditions of * the license of that module. An independent module is a module which is not * derived from this software. The special exception does not apply to any * modifications of the software. * * 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. * * $Id: bcmsdbus.h 275703 2011-08-04 20:20:27Z $ */ #ifndef _sdio_api_h_ #define _sdio_api_h_ #define SDIOH_API_RC_SUCCESS (0x00) #define SDIOH_API_RC_FAIL (0x01) #define SDIOH_API_SUCCESS(status) (status == 0) #define SDIOH_READ 0 /* Read request */ #define SDIOH_WRITE 1 /* Write request */ #define SDIOH_DATA_FIX 0 /* Fixed addressing */ #define SDIOH_DATA_INC 1 /* Incremental addressing */ #define SDIOH_CMD_TYPE_NORMAL 0 /* Normal command */ #define SDIOH_CMD_TYPE_APPEND 1 /* Append command */ #define SDIOH_CMD_TYPE_CUTTHRU 2 /* Cut-through command */ #define SDIOH_DATA_PIO 0 /* PIO mode */ #define SDIOH_DATA_DMA 1 /* DMA mode */ typedef int SDIOH_API_RC; /* SDio Host structure */ typedef struct sdioh_info sdioh_info_t; /* callback function, taking one arg */ typedef void (*sdioh_cb_fn_t)(void *); /* attach, return handler on success, NULL if failed. * The handler shall be provided by all subsequent calls. No local cache * cfghdl points to the starting address of pci device mapped memory */ extern sdioh_info_t * sdioh_attach(osl_t *osh, void *cfghdl, uint irq); extern SDIOH_API_RC sdioh_detach(osl_t *osh, sdioh_info_t *si); extern SDIOH_API_RC sdioh_interrupt_register(sdioh_info_t *si, sdioh_cb_fn_t fn, void *argh); extern SDIOH_API_RC sdioh_interrupt_deregister(sdioh_info_t *si); /* query whether SD interrupt is enabled or not */ extern SDIOH_API_RC sdioh_interrupt_query(sdioh_info_t *si, bool *onoff); /* enable or disable SD interrupt */ extern SDIOH_API_RC sdioh_interrupt_set(sdioh_info_t *si, bool enable_disable); #if defined(DHD_DEBUG) extern bool sdioh_interrupt_pending(sdioh_info_t *si); #endif /* read or write one byte using cmd52 */ extern SDIOH_API_RC sdioh_request_byte(sdioh_info_t *si, uint rw, uint fnc, uint addr, uint8 *byte); /* read or write 2/4 bytes using cmd53 */ extern SDIOH_API_RC sdioh_request_word(sdioh_info_t *si, uint cmd_type, uint rw, uint fnc, uint addr, uint32 *word, uint nbyte); /* read or write any buffer using cmd53 */ extern SDIOH_API_RC sdioh_request_buffer(sdioh_info_t *si, uint pio_dma, uint fix_inc, uint rw, uint fnc_num, uint32 addr, uint regwidth, uint32 buflen, uint8 *buffer, void *pkt); /* get cis data */ extern SDIOH_API_RC sdioh_cis_read(sdioh_info_t *si, uint fuc, uint8 *cis, uint32 length); extern SDIOH_API_RC sdioh_cfg_read(sdioh_info_t *si, uint fuc, uint32 addr, uint8 *data); extern SDIOH_API_RC sdioh_cfg_write(sdioh_info_t *si, uint fuc, uint32 addr, uint8 *data); /* query number of io functions */ extern uint sdioh_query_iofnum(sdioh_info_t *si); /* handle iovars */ extern int sdioh_iovar_op(sdioh_info_t *si, const char *name, void *params, int plen, void *arg, int len, bool set); /* Issue abort to the specified function and clear controller as needed */ extern int sdioh_abort(sdioh_info_t *si, uint fnc); /* Start and Stop SDIO without re-enumerating the SD card. */ extern int sdioh_start(sdioh_info_t *si, int stage); extern int sdioh_stop(sdioh_info_t *si); /* Wait system lock free */ extern int sdioh_waitlockfree(sdioh_info_t *si); /* Reset and re-initialize the device */ extern int sdioh_sdio_reset(sdioh_info_t *si); /* Helper function */ void *bcmsdh_get_sdioh(bcmsdh_info_t *sdh); extern SDIOH_API_RC sdioh_sleep(sdioh_info_t *si, bool enab); /* GPIO support */ extern SDIOH_API_RC sdioh_gpio_init(sdioh_info_t *sd); extern bool sdioh_gpioin(sdioh_info_t *sd, uint32 gpio); extern SDIOH_API_RC sdioh_gpioouten(sdioh_info_t *sd, uint32 gpio); extern SDIOH_API_RC sdioh_gpioout(sdioh_info_t *sd, uint32 gpio, bool enab); #endif /* _sdio_api_h_ */
/* * Copyright (c) 2010 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ScriptCallStackFactory_h #define ScriptCallStackFactory_h #include "core/inspector/ScriptCallStack.h" #include "wtf/Forward.h" #include <v8.h> namespace blink { class ScriptArguments; class ScriptCallStack; class ScriptState; const v8::StackTrace::StackTraceOptions stackTraceOptions = static_cast<v8::StackTrace::StackTraceOptions>( v8::StackTrace::kLineNumber | v8::StackTrace::kColumnOffset | v8::StackTrace::kScriptId | v8::StackTrace::kScriptNameOrSourceURL | v8::StackTrace::kFunctionName); PassRefPtrWillBeRawPtr<ScriptCallStack> createScriptCallStack(v8::Handle<v8::StackTrace>, size_t maxStackSize, v8::Isolate*); PassRefPtrWillBeRawPtr<ScriptCallStack> createScriptCallStack(size_t maxStackSize, bool emptyStackIsAllowed = false); PassRefPtrWillBeRawPtr<ScriptCallStack> createScriptCallStackForConsole(size_t maxStackSize = ScriptCallStack::maxCallStackSizeToCapture, bool emptyStackIsAllowed = false); PassRefPtrWillBeRawPtr<ScriptArguments> createScriptArguments(ScriptState*, const v8::FunctionCallbackInfo<v8::Value>& v8arguments, unsigned skipArgumentCount); } // namespace blink #endif // ScriptCallStackFactory_h
/* * Copyright (c) 2013 The Native Client 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 NATIVE_CLIENT_SRC_TRUSTED_SECCOMP_BPF_SECCOMP_BPF_H_ #define NATIVE_CLIENT_SRC_TRUSTED_SECCOMP_BPF_SECCOMP_BPF_H_ 1 #include "native_client/src/include/nacl_base.h" EXTERN_C_BEGIN /* * Turns on seccomp-bpf syscall policy. * On success, returns 0. */ int NaClInstallBpfFilter(void); EXTERN_C_END #endif /* NATIVE_CLIENT_SRC_TRUSTED_SECCOMP_BPF_SECCOMP_BPF_H_ */
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <linux/err.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/etherdevice.h> #include <linux/of.h> #include <linux/of_address.h> #include <linux/of_platform.h> #include <linux/of_fdt.h> #include <linux/of_irq.h> #include <linux/msm_tsens.h> #include <linux/msm_thermal.h> #include <linux/clk/msm-clk-provider.h> #include <linux/regulator/rpm-smd-regulator.h> #include <asm/mach/arch.h> #include <soc/qcom/socinfo.h> #include <mach/board.h> #include <mach/msm_memtypes.h> #include <soc/qcom/smem.h> #include <soc/qcom/spm.h> #include <soc/qcom/pm.h> #include <soc/qcom/rpm-smd.h> #include <mach/msm_smd.h> #include <mach/restart.h> #include <linux/io.h> #include <linux/gpio.h> #include <linux/irq.h> #include <linux/irqdomain.h> #include <linux/regulator/qpnp-regulator.h> #include <linux/regulator/krait-regulator.h> #include "board-dt.h" #include "clock.h" #include "platsmp.h" #define MPQ8092_MAC_FUSE_PHYS 0xfc4bc0e0 #define MPQ8092_MAC_FUSE_SIZE 0x10 static const char mac_addr_prop_name[] = "mac-address"; static void __init mpq8092_early_memory(void) { of_scan_flat_dt(dt_scan_for_memory_hole, NULL); } static void __init mpq8092_dt_reserve(void) { of_scan_flat_dt(dt_scan_for_memory_reserve, NULL); } static void __init mpq8092_map_io(void) { msm_map_mpq8092_io(); } static struct of_dev_auxdata mpq8092_auxdata_lookup[] __initdata = { OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF9824000, "msm_sdcc.1", NULL), OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF98A4000, "msm_sdcc.2", NULL), OF_DEV_AUXDATA("qcom,sdhci-msm", 0xF9824900, "msm_sdcc.1", NULL), OF_DEV_AUXDATA("qcom,sdhci-msm", 0xF98A4900, "msm_sdcc.2", NULL), OF_DEV_AUXDATA("qcom,msm_pcie", 0xFC520000, "msm_pcie", NULL), {} }; static int emac_dt_update(int cell, phys_addr_t addr, unsigned long size) { static int offset[ETH_ALEN] = { 5, 4, 3, 2, 1, 0}; void __iomem *fuse_reg; struct device_node *np = NULL; struct property *pmac = NULL; struct property *pp = NULL; u8 buf[ETH_ALEN]; int n, retval = 0; fuse_reg = ioremap(addr, size); if (!fuse_reg) { pr_err("failed to ioremap efuse to read mac address"); return -ENOMEM; } for (n = 0; n < ETH_ALEN; n++) buf[n] = ioread8(fuse_reg + offset[n]); iounmap(fuse_reg); if (!is_valid_ether_addr(buf)) { pr_err("invalid MAC address in efuse\n"); return -ENODATA; } pmac = kzalloc(sizeof(*pmac) + ETH_ALEN, GFP_KERNEL); if (!pmac) { pr_err("failed to alloc memory for mac address\n"); return -ENOMEM; } pmac->value = pmac + 1; pmac->length = ETH_ALEN; pmac->name = (char *)mac_addr_prop_name; memcpy(pmac->value, buf, ETH_ALEN); for_each_compatible_node(np, NULL, "qcom,emac") { if (of_property_read_u32(np, "cell-index", &n)) continue; if (n == cell) break; } if (!np) { pr_err("failed to find dt node for emac%d", cell); retval = -ENODEV; goto out; } pp = of_find_property(np, pmac->name, NULL); if (pp) of_update_property(np, pmac); else of_add_property(np, pmac); out: if (retval && pmac) kfree(pmac); return retval; } /* * Used to satisfy dependencies for devices that need to be * run early or in a particular order. Most likely your device doesn't fall * into this category, and thus the driver should not be added here. The * EPROBE_DEFER can satisfy most dependency problems. */ void __init mpq8092_add_drivers(void) { msm_smd_init(); msm_rpm_driver_init(); msm_pm_sleep_status_init(); msm_spm_device_init(); rpm_smd_regulator_driver_init(); qpnp_regulator_init(); krait_power_init(); if (of_board_is_rumi()) msm_clock_init(&mpq8092_rumi_clock_init_data); else msm_clock_init(&mpq8092_clock_init_data); tsens_tm_init_driver(); msm_thermal_device_init(); emac_dt_update(0, MPQ8092_MAC_FUSE_PHYS, MPQ8092_MAC_FUSE_SIZE); } static void __init mpq8092_init(void) { struct of_dev_auxdata *adata = mpq8092_auxdata_lookup; /* * populate devices from DT first so smem probe will get called as part * of msm_smem_init. socinfo_init needs smem support so call * msm_smem_init before it. */ board_dt_populate(adata); msm_smem_init(); if (socinfo_init() < 0) pr_err("%s: socinfo_init() failed\n", __func__); mpq8092_init_gpiomux(); mpq8092_add_drivers(); } static const char *mpq8092_dt_match[] __initconst = { "qcom,mpq8092", NULL }; DT_MACHINE_START(MSM8092_DT, "Qualcomm MSM 8092 (Flattened Device Tree)") .map_io = mpq8092_map_io, .init_machine = mpq8092_init, .dt_compat = mpq8092_dt_match, .reserve = mpq8092_dt_reserve, .init_very_early = mpq8092_early_memory, .restart = msm_restart, .smp = &msm8974_smp_ops, MACHINE_END
// // SPSQLExporterProtocol.h // sequel-pro // // Created by Stuart Connolly (stuconnolly.com) on April 15, 2010. // Copyright (c) 2010 Stuart Connolly. 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. // // More info at <https://github.com/sequelpro/sequelpro> @class SPSQLExporter; /** * @protocol SPSQLExporterProtocol SPSQLExporterProtocol.h * * @author Stuart Connolly http://stuconnolly.com/ * * SQL exporter delegate protocol. */ @protocol SPSQLExporterProtocol /** * Called when the SQL export process is about to begin. * * @param SPSQLExporter The expoter calling the method. */ - (void)sqlExportProcessWillBegin:(SPSQLExporter *)exporter; /** * Called when the SQL export process is complete. * * @param SPSQLExporter The expoter calling the method. */ - (void)sqlExportProcessComplete:(SPSQLExporter *)exporter; /** * alled when the progress of the SQL export process is updated. * * @param SPSQLExporter The expoter calling the method. */ - (void)sqlExportProcessProgressUpdated:(SPSQLExporter *)exporter; /** * Called when the SQL export process is about to begin fetching data from the database. * * @param SPSQLExporter The expoter calling the method. */ - (void)sqlExportProcessWillBeginFetchingData:(SPSQLExporter *)exporter; /** * Called when the SQL export process is about to begin writing data to disk. * * @param SPSQLExporter The expoter calling the method. */ - (void)sqlExportProcessWillBeginWritingData:(SPSQLExporter *)exporter; @end
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #if !defined(_ILASMPCH_H) #define _ILASMPCH_H #define NEW_INLINE_NAMES #include "cor.h" // for CorMethodAttr ... #include <crtdbg.h> // For _ASSERTE #include <corsym.h> #include <stdio.h> #include <stdlib.h> #include <assert.h> #include "utilcode.h" #include "debugmacros.h" #include "corpriv.h" #include "specstrings.h" #include <string.h> // for strcmp #include <mbstring.h> // for _mbsinc #include <ctype.h> // for isspace #include "openum.h" // for CEE_* #include <stdarg.h> // for vararg macros #endif
/** * @file * * @brief Instantiate RTEMS Period Data * @ingroup ClassicRateMon */ /* * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.org/license/LICENSE. */ #if HAVE_CONFIG_H #include "config.h" #endif /* instantiate RTEMS period data */ #define RTEMS_RATEMON_EXTERN #include <rtems/rtems/ratemonimpl.h>
/* PR sanitizer/88333 */ /* { dg-do compile { target fstack_protector } } */ /* { dg-options "-fstack-protector-strong -fsanitize=address" } */ void bar (int *); void foo (void) { int c; bar (&c); }
/* * Generated by class-dump 3.1.1. * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2006 by Steve Nygard. */ #import <BackRow/BRVideoRingBufferLoadMonitor.h> @interface BRVideoRingBufferLoadMonitor (BufferedRange) - (void)_startLoadPolling; - (void)_stopLoadPolling; - (void)_updateAmountLoaded:(id)fp8; @end
/* 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. */ // // GTLAnalyticsFilterRef.h // // ---------------------------------------------------------------------------- // NOTE: This file is generated from Google APIs Discovery Service. // Service: // Google Analytics API (analytics/v3) // Description: // View and manage your Google Analytics data // Documentation: // https://developers.google.com/analytics/ // Classes: // GTLAnalyticsFilterRef (0 custom class methods, 5 custom properties) #if GTL_BUILT_AS_FRAMEWORK #import "GTL/GTLObject.h" #else #import "GTLObject.h" #endif // ---------------------------------------------------------------------------- // // GTLAnalyticsFilterRef // // JSON template for a profile filter link. @interface GTLAnalyticsFilterRef : GTLObject // Account ID to which this filter belongs. @property (nonatomic, copy) NSString *accountId; // Link for this filter. @property (nonatomic, copy) NSString *href; // Filter ID. // identifier property maps to 'id' in JSON (to avoid Objective C's 'id'). @property (nonatomic, copy) NSString *identifier; // Kind value for filter reference. @property (nonatomic, copy) NSString *kind; // Name of this filter. @property (nonatomic, copy) NSString *name; @end
// // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2011 Niko Sams <niko.sams@gmail.com> // #ifndef MARBLE_GPX_ELETAGHANDLER_H #define MARBLE_GPX_ELETAGHANDLER_H #include "GeoTagHandler.h" namespace Marble { namespace gpx { class GPXeleTagHandler : public GeoTagHandler { public: virtual GeoNode* parse(GeoParser&) const; }; } } #endif
/* * Transitional compatibility translation from old name to new. * * Copyright (C) 1999-2011, Broadcom Corporation * * Unless you and Broadcom execute a separate written software license * agreement governing use of this software, this software is licensed to you * under the terms of the GNU General Public License version 2 (the "GPL"), * available at http://www.broadcom.com/licenses/GPLv2.php, with the * following added to such license: * * As a special exception, the copyright holders of this software give you * permission to link this software with independent modules, and to copy and * distribute the resulting executable under terms of your choice, provided that * you also meet, for each linked independent module, the terms and conditions of * the license of that module. An independent module is a module which is not * derived from this software. The special exception does not apply to any * modifications of the software. * * 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. * * $Id:$ */ #ifndef _bcmwifi_channels_h_ #define _bcmwifi_channels_h_ #include "bcmwifi.h" #endif
/*--------------------------------------------------------------------------- * Copyright (c) 2016, u-blox Malmö, All Rights Reserved * SPDX-License-Identifier: LicenseRef-PBL * * This file and the related binary are licensed under the * Permissive Binary License, Version 1.0 (the "License"); * you may not use these files except in compliance with the License. * * You may obtain a copy of the License here: * LICENSE-permissive-binary-license-1.0.txt and at * https://www.mbed.com/licenses/PBL-1.0 * * See the License for the specific language governing permissions and * limitations under the License. * * Component : * File : bt_types.h * * Description : Common Bluetooth types *-------------------------------------------------------------------------*/ /** * @file bt_types.h * @brief Common Bluetooth types */ #ifndef _BT_TYPES_H_ #define _BT_TYPES_H_ #include "cb_comdefs.h" /*=========================================================================== * DEFINES *=========================================================================*/ #define SIZE_OF_BD_ADDR (6) #define SIZE_OF_COD (3) #define SIZE_OF_LINK_KEY (16) #define SIZE_OF_NAME (248) #define SIZE_OF_PIN_CODE ((cb_uint8)16) #define SIZE_OF_LAP (3) #define SIZE_OF_AFH_LMP_HCI_CHANNEL_MAP (10) #define CHANNEL_MAP_SIZE (5) #define SIZE_OF_EXT_INQ_RSP (240) #define MIN_PASSKEY_VALUE (0) #define MAX_PASSKEY_VALUE (999999) #define INVALID_CONN_HANDLE ((TConnHandle)0xFFFF) #define MAX_ADV_DATA_LENGTH (31) #define UUID_LENGTH (16) #define PACKET_TYPE_DM1 (0x0008) #define PACKET_TYPE_DH1 (0x0010) #define PACKET_TYPE_DM3 (0x0400) #define PACKET_TYPE_DH3 (0x0800) #define PACKET_TYPE_DM5 (0x4000) #define PACKET_TYPE_DH5 (0x8000) #define PACKET_TYPE_NO_2_DH1 (0x0002) #define PACKET_TYPE_NO_3_DH1 (0x0004) #define PACKET_TYPE_NO_2_DH3 (0x0100) #define PACKET_TYPE_NO_3_DH3 (0x0200) #define PACKET_TYPE_NO_2_DH5 (0x1000) #define PACKET_TYPE_NO_3_DH5 (0x2000) #define PACKET_TYPE_ALL (PACKET_TYPE_DM1 | PACKET_TYPE_DH1 | PACKET_TYPE_DM3 | PACKET_TYPE_DH3 | PACKET_TYPE_DM5 | PACKET_TYPE_DH5) /*=========================================================================== * TYPES *=========================================================================*/ typedef cb_int32 int32; typedef cb_uint32 uint32; typedef cb_boolean boolean; typedef cb_int8 int8; typedef cb_uint8 uint8; typedef cb_int16 int16; typedef cb_uint16 uint16; typedef cb_uint8 TErrorCode; typedef cb_uint8 TLinkType; typedef cb_uint16 TPacketType; typedef cb_uint16 TConnHandle; typedef enum { BT_SECURITY_MODE_1 = 1, BT_SECURITY_MODE_2, BT_SECURITY_MODE_3, BT_SECURITY_MODE_4 } TSecurityMode; typedef enum { BT_SECURITY_LEVEL_0 = 0, BT_SECURITY_LEVEL_1, BT_SECURITY_LEVEL_2, BT_SECURITY_LEVEL_3, // Used with security modes 1,2,3 where security level is not applicable BT_SECURITY_LEVEL_DUMMY = 5, } TSecurityLevel; typedef enum { BT_MASTER_SLAVE_POLICY_ALWAYS_MASTER = 0, BT_MASTER_SLAVE_POLICY_OTHER_SIDE_DECIDE = 1 } TMasterSlavePolicy; typedef enum { BT_TYPE_CLASSIC = 0, BT_TYPE_LOW_ENERGY = 1 } TBluetoothType; typedef enum { BT_PUBLIC_ADDRESS = 0x00, BT_RANDOM_ADDRESS = 0x01, } TAddressType; typedef struct { cb_uint8 BdAddress[SIZE_OF_BD_ADDR]; TAddressType AddrType; } TBdAddr; typedef struct { cb_uint8 Cod[SIZE_OF_COD]; } TCod; typedef struct { cb_uint8 LinkKey[SIZE_OF_LINK_KEY]; } TLinkKey; typedef struct { cb_uint8 Name[SIZE_OF_NAME]; } TName; typedef struct { cb_uint8 PinCode[SIZE_OF_PIN_CODE]; } TPinCode; typedef cb_uint32 TPasskey; typedef struct { cb_uint8 Lap[SIZE_OF_LAP]; } TLap; typedef struct { cb_uint8 Data[SIZE_OF_EXT_INQ_RSP]; } TExtInqRsp; typedef cb_uint8 TAfhLmpHciChannelMap[SIZE_OF_AFH_LMP_HCI_CHANNEL_MAP]; typedef struct { uint16 channel[CHANNEL_MAP_SIZE]; } TChannelMap; typedef enum { BT_ADV_TYPE_ADV = 0x01, BT_ADV_TYPE_SCAN = 0x00, } TAdvDataType; typedef struct { TAdvDataType type; cb_uint8 length; cb_uint8 data[MAX_ADV_DATA_LENGTH]; } TAdvData; typedef struct { cb_uint16 createConnectionTimeout; cb_uint16 connectionIntervalMin; cb_uint16 connectionIntervalMax; cb_uint16 connectionLatency; cb_uint16 linkLossTimeout; cb_uint16 scanInterval; cb_uint16 scanWindow; } TAclParamsLe; #endif /* _BT_TYPES_H */
/*********************************************************************/ /* Copyright 2009, 2010 The University of Texas at Austin. */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or */ /* without modification, are permitted provided that the following */ /* conditions are met: */ /* */ /* 1. Redistributions of source code must retain the above */ /* copyright notice, this list of conditions and the following */ /* disclaimer. */ /* */ /* 2. Redistributions in binary form must reproduce the above */ /* copyright notice, this list of conditions and the following */ /* disclaimer in the documentation and/or other materials */ /* provided with the distribution. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */ /* AUSTIN ``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 UNIVERSITY OF TEXAS AT */ /* AUSTIN 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 views and conclusions contained in the software and */ /* documentation are those of the authors and should not be */ /* interpreted as representing official policies, either expressed */ /* or implied, of The University of Texas at Austin. */ /*********************************************************************/ #include <stdio.h> #include <ctype.h> #include "common.h" int CNAME(BLASLONG m, FLOAT *a, FLOAT *b, BLASLONG incb, void *buffer){ BLASLONG i; FLOAT *gemvbuffer = (FLOAT *)buffer; FLOAT *B = b; if (incb != 1) { B = buffer; gemvbuffer = (FLOAT *)(((BLASLONG)buffer + m * sizeof(FLOAT) + 4095) & ~4095); COPY_K(m, b, incb, buffer, 1); } for (i = 0; i < m; i++) { #ifdef TRANSA if (i > 0) B[i] -= DOTU_K(i, a, 1, B, 1); #endif #ifndef UNIT #ifndef TRANSA B[i] /= a[0]; #else B[i] /= a[i]; #endif #endif #ifndef TRANSA if (i < m - 1) { AXPYU_K(m - i - 1 , 0, 0, - B[i], a + 1, 1, B + i + 1, 1, NULL, 0); } #endif #ifndef TRANSA a += (m - i); #else a += (i + 1); #endif } if (incb != 1) { COPY_K(m, buffer, 1, b, incb); } return 0; }
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_FAKE_ATTACHMENT_DOWNLOADER_H_ #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_FAKE_ATTACHMENT_DOWNLOADER_H_ #include "base/macros.h" #include "base/threading/non_thread_safe.h" #include "sync/internal_api/public/attachments/attachment_downloader.h" namespace syncer { // FakeAttachmentDownloader is for tests. For every request it posts a success // callback with empty attachment. class SYNC_EXPORT FakeAttachmentDownloader : public AttachmentDownloader, public base::NonThreadSafe { public: FakeAttachmentDownloader(); ~FakeAttachmentDownloader() override; // AttachmentDownloader implementation. void DownloadAttachment(const AttachmentId& attachment_id, const DownloadCallback& callback) override; private: DISALLOW_COPY_AND_ASSIGN(FakeAttachmentDownloader); }; } // namespace syncer #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_FAKE_ATTACHMENT_DOWNLOADER_H_
/* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <stddef.h> #include <sys/stat.h> #include <hurd.h> #include <hurd/fd.h> /* Change the flags of the file referenced by FD to FLAGS. */ /* XXX should be __fchflags? */ int fchflags (int fd, unsigned long int flags) { error_t err; if (err = HURD_DPORT_USE (fd, __file_chflags (port, flags))) return __hurd_dfail (fd, err); return 0; }
/* * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __UPDATEMASK_H #define __UPDATEMASK_H #include "UpdateFields.h" #include "Errors.h" class UpdateMask { public: UpdateMask( ) : mCount( 0 ), mBlocks( 0 ), mUpdateMask( 0 ) { } UpdateMask( const UpdateMask& mask ) : mUpdateMask( 0 ) { *this = mask; } ~UpdateMask( ) { if(mUpdateMask) delete [] mUpdateMask; } void SetBit (uint32 index) { ( (uint8 *)mUpdateMask )[ index >> 3 ] |= 1 << ( index & 0x7 ); } void UnsetBit (uint32 index) { ( (uint8 *)mUpdateMask )[ index >> 3 ] &= (0xff ^ (1 << ( index & 0x7 ) ) ); } bool GetBit (uint32 index) const { return ( ( (uint8 *)mUpdateMask)[ index >> 3 ] & ( 1 << ( index & 0x7 ) )) != 0; } uint32 GetBlockCount() const { return mBlocks; } uint32 GetLength() const { return mBlocks << 2; } uint32 GetCount() const { return mCount; } uint8* GetMask() { return (uint8*)mUpdateMask; } void SetCount (uint32 valuesCount) { if(mUpdateMask) delete [] mUpdateMask; mCount = valuesCount; mBlocks = (valuesCount + 31) / 32; mUpdateMask = new uint32[mBlocks]; memset(mUpdateMask, 0, mBlocks << 2); } void Clear() { if (mUpdateMask) memset(mUpdateMask, 0, mBlocks << 2); } UpdateMask& operator = ( const UpdateMask& mask ) { SetCount(mask.mCount); memcpy(mUpdateMask, mask.mUpdateMask, mBlocks << 2); return *this; } void operator &= ( const UpdateMask& mask ) { MANGOS_ASSERT(mask.mCount <= mCount); for (uint32 i = 0; i < mBlocks; ++i) mUpdateMask[i] &= mask.mUpdateMask[i]; } void operator |= ( const UpdateMask& mask ) { MANGOS_ASSERT(mask.mCount <= mCount); for (uint32 i = 0; i < mBlocks; ++i) mUpdateMask[i] |= mask.mUpdateMask[i]; } UpdateMask operator & ( const UpdateMask& mask ) const { MANGOS_ASSERT(mask.mCount <= mCount); UpdateMask newmask; newmask = *this; newmask &= mask; return newmask; } UpdateMask operator | ( const UpdateMask& mask ) const { MANGOS_ASSERT(mask.mCount <= mCount); UpdateMask newmask; newmask = *this; newmask |= mask; return newmask; } private: uint32 mCount; uint32 mBlocks; uint32 *mUpdateMask; }; #endif
/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 2001--2012 The R Core Team. * * 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, a copy is available at * http://www.r-project.org/Licenses/ */ #include <R_ext/Complex.h> #include <R_ext/RS.h> /* use declarations in R_ext/Lapack.h (instead of having them there *and* here) but ``delete'' the 'extern' there : */ #define La_extern #define BLAS_extern #include <R_ext/Lapack.h> #undef La_extern #undef BLAS_extern
/* This does not assemble on m68hc11 because the function is larger than 64K. */ /* { dg-do assemble } */ /* { dg-xfail-if "function larger than 64K" { m6811-*-* } { "*" } { "" } } */ /* { dg-skip-if "too much code for avr" { "avr-*-*" } { "*" } { "" } } */ /* { dg-skip-if "too much code for pdp11" { "pdp11-*-*" } { "*" } { "" } } */ /* { dg-xfail-if "jump beyond 128K not supported" { xtensa*-*-* } { "-O0" } { "" } } */ /* { dg-xfail-if "PR36698" { spu-*-* } { "-O0" } { "" } } */ /* { dg-skip-if "" { m32c-*-* } { "*" } { "" } } */ /* { dg-timeout-factor 4.0 } */ /* This testcase exposed two branch shortening bugs on powerpc. */ #define C(a,b) \ if (a > b) goto gt; \ if (a < b) goto lt; #define C4(x,b) C((x)[0], b) C((x)[1],b) C((x)[2],b) C((x)[3],b) #define C16(x,y) C4(x, (y)[0]) C4(x, (y)[1]) C4(x, (y)[2]) C4(x, (y)[3]) #define C64(x,y) C16(x,y) C16(x+4,y) C16(x+8,y) C16(x+12,y) #define C256(x,y) C64(x,y) C64(x,y+4) C64(x,y+8) C64(x,y+12) #define C1024(x,y) C256(x,y) C256(x+16,y) C256(x+32,y) C256(x+48,y) #define C4096(x,y) C1024(x,y) C1024(x,y+16) C1024(x,y+32) C1024(x,y+48) unsigned foo(int x[64], int y[64]) { C4096(x,y); return 0x01234567; gt: return 0x12345678; lt: return 0xF0123456; }
/**************************************************************************** Copyright (C) 2013 Henry van Merode. All rights reserved. Copyright (c) 2015-2017 Chukong Technologies Inc. http://www.cocos2d-x.org 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 __CC_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_TRANSLATOR_H__ #define __CC_PU_PARTICLE_3D_DO_ENABLE_COMPONENT_EVENT_HANDLER_TRANSLATOR_H__ #include "extensions/Particle3D/PU/CCPUScriptTranslator.h" #include "extensions/Particle3D/PU/CCPUScriptCompiler.h" #include "extensions/Particle3D/PU/CCPUDoEnableComponentEventHandler.h" NS_CC_BEGIN class PUDoEnableComponentEventHandlerTranslator : public PUScriptTranslator { public: PUDoEnableComponentEventHandlerTranslator(); virtual ~PUDoEnableComponentEventHandlerTranslator(){}; virtual bool translateChildProperty(PUScriptCompiler* compiler, PUAbstractNode *node); virtual bool translateChildObject(PUScriptCompiler* compiler, PUAbstractNode *node); }; NS_CC_END #endif