text
stringlengths
4
6.14k
/* * frame CRC encoder (for codec/format testing) * Copyright (c) 2002 Fabrice Bellard * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libavutil/adler32.h" #include "libavutil/avstring.h" #include "avformat.h" #include "internal.h" static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt) { uint32_t crc = av_adler32_update(0, pkt->data, pkt->size); char buf[256]; snprintf(buf, sizeof(buf), "%d, %10"PRId64", %10"PRId64", %8d, %8d, 0x%08x", pkt->stream_index, pkt->dts, pkt->pts, pkt->duration, pkt->size, crc); if (pkt->flags != AV_PKT_FLAG_KEY) av_strlcatf(buf, sizeof(buf), ", F=0x%0X", pkt->flags); if (pkt->side_data_elems) av_strlcatf(buf, sizeof(buf), ", S=%d", pkt->side_data_elems); av_strlcatf(buf, sizeof(buf), "\n"); avio_write(s->pb, buf, strlen(buf)); avio_flush(s->pb); return 0; } AVOutputFormat ff_framecrc_muxer = { .name = "framecrc", .long_name = NULL_IF_CONFIG_SMALL("framecrc testing"), .audio_codec = AV_CODEC_ID_PCM_S16LE, .video_codec = AV_CODEC_ID_RAWVIDEO, .write_header = ff_framehash_write_header, .write_packet = framecrc_write_packet, .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT, };
/* * Copyright (C) 2019 Otto-von-Guericke-Universität Magdeburg * * 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 sys_auto_init_saul * @{ * * @file * @brief Auto initialization for INA2XX power/current monitors * * @author Marian Buschsieweke <marian.buschsieweke@ovgu.de> * * @} */ #ifdef MODULE_INA2XX #include "assert.h" #include "log.h" #include "saul_reg.h" #include "ina2xx_params.h" #include "ina2xx.h" /** * @brief Define the number of configured sensors */ #define INA2XX_NUM ARRAY_SIZE(ina2xx_params) /** * @brief Allocate memory for the device descriptors */ static ina2xx_t ina2xx_devs[INA2XX_NUM]; /** * @brief Memory for the SAUL registry entries */ static saul_reg_t saul_entries[INA2XX_NUM * 3]; /** * @brief Define the number of saul info */ #define INA2XX_INFO_NUM ARRAY_SIZE(ina2xx_saul_info) /** * @name Import SAUL endpoints * @{ */ extern const saul_driver_t ina2xx_saul_current_driver; extern const saul_driver_t ina2xx_saul_power_driver; extern const saul_driver_t ina2xx_saul_voltage_driver; /** @} */ void auto_init_ina2xx(void) { assert(INA2XX_INFO_NUM == 3 * INA2XX_NUM); for (unsigned int i = 0; i < INA2XX_NUM; i++) { LOG_DEBUG("[auto_init_saul] initializing ina2xx #%u\n", i); if (ina2xx_init(&ina2xx_devs[i], &ina2xx_params[i])) { LOG_ERROR("[auto_init_saul] error initializing ina2xx #%u\n", i); continue; } for (unsigned int j = 0; j < 3; j++) { saul_entries[i * 3 + j].dev = &(ina2xx_devs[i]); saul_entries[i * 3 + j].name = ina2xx_saul_info[3 * i + j].name; saul_entries[i * 3 + j].driver = &ina2xx_saul_power_driver; saul_reg_add(&(saul_entries[i * 3 + j])); } } } #else typedef int dont_be_pedantic; #endif /* MODULE_INA2XX */
#pragma once #include <string> typedef std::string Property; /* class Property { public: std::string str; }; */
// @(#)root/reflex:$Id$ // Author: Axel Naumann, 2009 // Copyright CERN, CH-1211 Geneva 23, 2004-2009, All rights reserved. // // Permission to use, copy, modify, and distribute this software for any // purpose is hereby granted without fee, provided that this copyright and // permissions notice appear in all copies and derivatives. // // This software is provided "as is" without express or implied warranty. #ifndef Reflex_BuilderContainer #define Reflex_BuilderContainer #include "Reflex/Kernel.h" namespace Reflex { class OnDemandBuilder; class RFLX_API BuilderContainer { public: BuilderContainer(): fFirst(0) {} ~BuilderContainer() { Clear(); } void Insert(OnDemandBuilder* odb); void Remove(OnDemandBuilder* odb); void Clear(); OnDemandBuilder* First() const { return fFirst; } bool Empty() const { return !fFirst; } void BuildAll(); private: OnDemandBuilder* fFirst; }; } // namespace Reflex #endif // Reflex_BuilderContainer
#include <ccan/container_of/container_of.h> #include <ccan/tap/tap.h> struct foo { int a; char b; }; int main(int argc, char *argv[]) { struct foo foo = { .a = 1, .b = 2 }; int *intp = &foo.a; char *charp = &foo.b; (void)argc; (void)argv; plan_tests(6); ok1(container_of(intp, struct foo, a) == &foo); ok1(container_of(charp, struct foo, b) == &foo); ok1(container_of_var(intp, &foo, a) == &foo); ok1(container_of_var(charp, &foo, b) == &foo); ok1(container_off(struct foo, a) == 0); ok1(container_off(struct foo, b) == offsetof(struct foo, b)); return exit_status(); }
#ifndef _SIGNAL_H #define _SIGNAL_H #ifdef __cplusplus extern "C" { #endif #include <features.h> #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) #ifdef _GNU_SOURCE #define __ucontext ucontext #endif #define __NEED_size_t #define __NEED_pid_t #define __NEED_uid_t #define __NEED_struct_timespec #define __NEED_pthread_t #define __NEED_pthread_attr_t #define __NEED_time_t #define __NEED_clock_t #define __NEED_sigset_t #include <bits/alltypes.h> #define SIG_HOLD ((void (*)(int)) 2) #define SIG_BLOCK 0 #define SIG_UNBLOCK 1 #define SIG_SETMASK 2 #define SI_ASYNCNL (-60) #define SI_TKILL (-6) #define SI_SIGIO (-5) #define SI_ASYNCIO (-4) #define SI_MESGQ (-3) #define SI_TIMER (-2) #define SI_QUEUE (-1) #define SI_USER 0 #define SI_KERNEL 128 #define FPE_INTDIV 1 #define FPE_INTOVF 2 #define FPE_FLTDIV 3 #define FPE_FLTOVF 4 #define FPE_FLTUND 5 #define FPE_FLTRES 6 #define FPE_FLTINV 7 #define FPE_FLTSUB 8 #define ILL_ILLOPC 1 #define ILL_ILLOPN 2 #define ILL_ILLADR 3 #define ILL_ILLTRP 4 #define ILL_PRVOPC 5 #define ILL_PRVREG 6 #define ILL_COPROC 7 #define ILL_BADSTK 8 #define SEGV_MAPERR 1 #define SEGV_ACCERR 2 #define BUS_ADRALN 1 #define BUS_ADRERR 2 #define BUS_OBJERR 3 #define BUS_MCEERR_AR 4 #define BUS_MCEERR_AO 5 #define CLD_EXITED 1 #define CLD_KILLED 2 #define CLD_DUMPED 3 #define CLD_TRAPPED 4 #define CLD_STOPPED 5 #define CLD_CONTINUED 6 typedef struct sigaltstack stack_t; union sigval { int sival_int; void *sival_ptr; }; typedef struct { int si_signo, si_errno, si_code; union { char __pad[128 - 2*sizeof(int) - sizeof(long)]; struct { union { struct { pid_t si_pid; uid_t si_uid; } __piduid; struct { int si_timerid; int si_overrun; } __timer; } __first; union { union sigval si_value; struct { int si_status; clock_t si_utime, si_stime; } __sigchld; } __second; } __si_common; struct { void *si_addr; short si_addr_lsb; } __sigfault; struct { long si_band; int si_fd; } __sigpoll; struct { void *si_call_addr; int si_syscall; unsigned si_arch; } __sigsys; } __si_fields; } siginfo_t; #define si_pid __si_fields.__si_common.__first.__piduid.si_pid #define si_uid __si_fields.__si_common.__first.__piduid.si_uid #define si_status __si_fields.__si_common.__second.__sigchld.si_status #define si_utime __si_fields.__si_common.__second.__sigchld.si_utime #define si_stime __si_fields.__si_common.__second.__sigchld.si_stime #define si_value __si_fields.__si_common.__second.si_value #define si_addr __si_fields.__sigfault.si_addr #define si_addr_lsb __si_fields.__sigfault.si_addr_lsb #define si_band __si_fields.__sigpoll.si_band #define si_fd __si_fields.__sigpoll.si_fd #define si_timerid __si_fields.__si_common.__first.__timer.si_timerid #define si_overrun __si_fields.__si_common.__first.__timer.si_overrun #define si_ptr si_value.sival_ptr #define si_int si_value.sival_int #define si_call_addr __si_fields.__sigsys.si_call_addr #define si_syscall __si_fields.__sigsys.si_syscall #define si_arch __si_fields.__sigsys.si_arch struct sigaction { union { void (*sa_handler)(int); void (*sa_sigaction)(int, siginfo_t *, void *); } __sa_handler; sigset_t sa_mask; int sa_flags; void (*sa_restorer)(void); }; #define sa_handler __sa_handler.sa_handler #define sa_sigaction __sa_handler.sa_sigaction struct sigevent { union sigval sigev_value; int sigev_signo; int sigev_notify; void (*sigev_notify_function)(union sigval); pthread_attr_t *sigev_notify_attributes; char __pad[56-3*sizeof(long)]; }; #define SIGEV_SIGNAL 0 #define SIGEV_NONE 1 #define SIGEV_THREAD 2 int __libc_current_sigrtmin(void); int __libc_current_sigrtmax(void); #define SIGRTMIN (__libc_current_sigrtmin()) #define SIGRTMAX (__libc_current_sigrtmax()) int kill(pid_t, int); int sigemptyset(sigset_t *); int sigfillset(sigset_t *); int sigaddset(sigset_t *, int); int sigdelset(sigset_t *, int); int sigismember(const sigset_t *, int); int sigprocmask(int, const sigset_t *__restrict, sigset_t *__restrict); int sigsuspend(const sigset_t *); int sigaction(int, const struct sigaction *__restrict, struct sigaction *__restrict); int sigpending(sigset_t *); int sigwait(const sigset_t *__restrict, int *__restrict); int sigwaitinfo(const sigset_t *__restrict, siginfo_t *__restrict); int sigtimedwait(const sigset_t *__restrict, siginfo_t *__restrict, const struct timespec *__restrict); int sigqueue(pid_t, int, const union sigval); int pthread_sigmask(int, const sigset_t *__restrict, sigset_t *__restrict); int pthread_kill(pthread_t, int); void psiginfo(const siginfo_t *, const char *); void psignal(int, const char *); #endif #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) int killpg(pid_t, int); int sigaltstack(const stack_t *__restrict, stack_t *__restrict); int sighold(int); int sigignore(int); int siginterrupt(int, int); int sigpause(int); int sigrelse(int); void (*sigset(int, void (*)(int)))(int); #define TRAP_BRKPT 1 #define TRAP_TRACE 2 #define POLL_IN 1 #define POLL_OUT 2 #define POLL_MSG 3 #define POLL_ERR 4 #define POLL_PRI 5 #define POLL_HUP 6 #define SS_ONSTACK 1 #define SS_DISABLE 2 #define MINSIGSTKSZ 2048 #define SIGSTKSZ 8192 #endif #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) #define NSIG _NSIG typedef void (*sig_t)(int); #endif #ifdef _GNU_SOURCE typedef void (*sighandler_t)(int); void (*bsd_signal(int, void (*)(int)))(int); int sigisemptyset(const sigset_t *); int sigorset (sigset_t *, const sigset_t *, const sigset_t *); int sigandset(sigset_t *, const sigset_t *, const sigset_t *); #define SA_NOMASK SA_NODEFER #define SA_ONESHOT SA_RESETHAND #endif #include <bits/signal.h> #define SIG_ERR ((void (*)(int))-1) #define SIG_DFL ((void (*)(int)) 0) #define SIG_IGN ((void (*)(int)) 1) typedef int sig_atomic_t; void (*signal(int, void (*)(int)))(int); int raise(int); #ifdef __cplusplus } #endif #endif
/* * Copyright (C) 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef AXSVGRoot_h #define AXSVGRoot_h #include "modules/accessibility/AXLayoutObject.h" namespace blink { class AXObjectCacheImpl; class AXSVGRoot final : public AXLayoutObject { protected: AXSVGRoot(LayoutObject*, AXObjectCacheImpl&); public: static PassRefPtrWillBeRawPtr<AXSVGRoot> create(LayoutObject*, AXObjectCacheImpl&); ~AXSVGRoot() override; void setParent(AXObject*) override; private: AXObject* computeParent() const override; bool isAXSVGRoot() const override { return true; } }; DEFINE_AX_OBJECT_TYPE_CASTS(AXSVGRoot, isAXSVGRoot()); } // namespace blink #endif // AXSVGRoot_h
/////////////////////////////////////////////////////////////////////////////// // Name: samples/image/canvas.h // Purpose: sample showing operations with wxImage // Author: Robert Roebling // Modified by: Francesco Montorsi // Created: 1998 // Copyright: (c) 1998-2005 Robert Roebling // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #include "wx/scrolwin.h" //----------------------------------------------------------------------------- // MyCanvas //----------------------------------------------------------------------------- class MyCanvas: public wxScrolledWindow { public: MyCanvas( wxWindow *parent, wxWindowID, const wxPoint &pos, const wxSize &size ); ~MyCanvas(); void OnPaint( wxPaintEvent &event ); void CreateAntiAliasedBitmap(); wxBitmap my_horse_png; wxBitmap my_horse_jpeg; wxBitmap my_horse_gif; wxBitmap my_horse_bmp; wxBitmap my_horse_bmp2; wxBitmap my_horse_pcx; wxBitmap my_horse_pnm; wxBitmap my_horse_tiff; wxBitmap my_horse_tga; wxBitmap my_horse_xpm; wxBitmap my_horse_ico32; wxBitmap my_horse_ico16; wxBitmap my_horse_ico; wxBitmap my_horse_cur; wxBitmap my_png_from_res, my_png_from_mem; wxBitmap my_smile_xbm; wxBitmap my_square; wxBitmap my_anti; wxBitmap my_horse_asciigrey_pnm; wxBitmap my_horse_rawgrey_pnm; wxBitmap colorized_horse_jpeg; wxBitmap my_cmyk_jpeg; wxBitmap my_toucan; wxBitmap my_toucan_flipped_horiz; wxBitmap my_toucan_flipped_vert; wxBitmap my_toucan_flipped_both; wxBitmap my_toucan_grey; wxBitmap my_toucan_head; wxBitmap my_toucan_scaled_normal; wxBitmap my_toucan_scaled_high; wxBitmap my_toucan_blur; int xH, yH; int m_ani_images; wxBitmap *my_horse_ani; private: wxBitmap m_bmpSmileXpm; wxIcon m_iconSmileXpm; wxDECLARE_EVENT_TABLE(); };
// // StressTest.h // AutoHyperlinks.framework // // Created by Stephen Holt on 5/15/08. // Copyright 2008 __MyCompanyName__. All rights reserved. // #import <SenTestingKit/SenTestingKit.h> @interface StressTest : SenTestCase { } - (void)testStress; @end
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_EXTENSIONS_API_DNS_DNS_API_H_ #define CHROME_BROWSER_EXTENSIONS_API_DNS_DNS_API_H_ #include <string> #include "chrome/browser/extensions/extension_function.h" #include "chrome/browser/io_thread.h" #include "net/base/address_list.h" #include "net/base/completion_callback.h" #include "net/base/host_resolver.h" class IOThread; namespace extensions { class DnsResolveFunction : public AsyncExtensionFunction { public: DECLARE_EXTENSION_FUNCTION_NAME("experimental.dns.resolve") DnsResolveFunction(); protected: virtual ~DnsResolveFunction(); // ExtensionFunction: virtual bool RunImpl() OVERRIDE; void WorkOnIOThread(); void RespondOnUIThread(); private: void OnLookupFinished(int result); std::string hostname_; bool response_; // The value sent in SendResponse(). // This instance is widely available through BrowserProcess, but we need to // acquire it on the UI thread and then use it on the IO thread, so we keep a // plain pointer to it here as we move from thread to thread. IOThread* io_thread_; scoped_ptr<net::HostResolver::RequestHandle> request_handle_; scoped_ptr<net::AddressList> addresses_; }; } // namespace extensions #endif // CHROME_BROWSER_EXTENSIONS_API_DNS_DNS_API_H_
/* * Copyright (c) 2013, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following * disclaimer in the documentation and/or other materials provided with the * distribution. * * Neither the name of the Ford Motor Company nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef SRC_COMPONENTS_INCLUDE_UTILS_LOCK_H_ #define SRC_COMPONENTS_INCLUDE_UTILS_LOCK_H_ #if defined(OS_POSIX) #include <pthread.h> #include <sched.h> #else #error Please implement lock for your OS #endif #include <stdint.h> #include "utils/macro.h" #include "utils/atomic.h" #include "utils/memory_barrier.h" namespace sync_primitives { namespace impl { #if defined(OS_POSIX) typedef pthread_mutex_t PlatformMutex; #endif } // namespace impl class SpinMutex { public: SpinMutex() : state_(0) {} void Lock() { // Comment below add exception for lint error // Reason: FlexeLint doesn't know about compiler's built-in instructions /*lint -e1055*/ if (atomic_post_set(&state_) == 0) { return; } for (;;) { sched_yield(); /*lint -e1055*/ if (state_ == 0 && atomic_post_set(&state_) == 0) { return; } } } void Unlock() { state_ = 0; } ~SpinMutex() {} private: volatile unsigned int state_; }; /* Platform-indepenednt NON-RECURSIVE lock (mutex) wrapper Please use AutoLock to ackquire and (automatically) release it It eases balancing of multple lock taking/releasing and makes it Impossible to forget to release the lock: ... ConcurentlyAccessedData data_; sync_primitives::Lock data_lock_; ... { sync_primitives::AutoLock auto_lock(data_lock_); data_.ReadOrWriteData(); } // lock is automatically released here */ class Lock { public: Lock(); Lock(bool is_recursive); ~Lock(); // Ackquire the lock. Must be called only once on a thread. // Please consider using AutoLock to capture it. void Acquire(); // Release the lock. Must be called only once on a thread after lock. // was acquired. Please consider using AutoLock to automatically release // the lock void Release(); // Try if lock can be captured and lock it if it was possible. // If it captured, lock must be manually released calling to Release // when protected resource access was finished. // @returns wether lock was captured. bool Try(); private: impl::PlatformMutex mutex_; #ifndef NDEBUG /** * @brief Basic debugging aid, a flag that signals wether this lock is * currently taken * Allows detection of abandoned and recursively captured mutexes */ uint32_t lock_taken_; /** * @brief Describe if mutex is recurcive or not */ bool is_mutex_recursive_; void AssertFreeAndMarkTaken(); void AssertTakenAndMarkFree(); #else void AssertFreeAndMarkTaken() {} void AssertTakenAndMarkFree() {} #endif void Init(bool is_recursive); friend class ConditionalVariable; DISALLOW_COPY_AND_ASSIGN(Lock); }; // This class is used to automatically acquire and release the a lock class AutoLock { public: explicit AutoLock(Lock& lock) : lock_(lock) { lock_.Acquire(); } ~AutoLock() { lock_.Release(); } private: Lock& GetLock() { return lock_; } Lock& lock_; private: friend class AutoUnlock; friend class ConditionalVariable; DISALLOW_COPY_AND_ASSIGN(AutoLock); }; // This class is used to temporarly unlock autolocked lock class AutoUnlock { public: explicit AutoUnlock(Lock& lock) : lock_(lock) { lock_.Release(); } explicit AutoUnlock(AutoLock& lock) : lock_(lock.GetLock()) { lock_.Release(); } ~AutoUnlock() { lock_.Acquire(); } private: Lock& lock_; private: DISALLOW_COPY_AND_ASSIGN(AutoUnlock); }; } // namespace sync_primitives #endif // SRC_COMPONENTS_INCLUDE_UTILS_LOCK_H_
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ #define CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_ #include "base/callback_forward.h" #include "base/id_map.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "components/content_settings/core/browser/content_settings_observer.h" #include "components/content_settings/core/common/content_settings.h" #include "components/keyed_service/core/keyed_service.h" #include "content/public/browser/permission_manager.h" class Profile; namespace content { enum class PermissionType; class WebContents; }; // namespace content class PermissionManager : public KeyedService, public content::PermissionManager, public content_settings::Observer { public: explicit PermissionManager(Profile* profile); ~PermissionManager() override; // content::PermissionManager implementation. int RequestPermission( content::PermissionType permission, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, bool user_gesture, const base::Callback<void(content::PermissionStatus)>& callback) override; int RequestPermissions( const std::vector<content::PermissionType>& permissions, content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, bool user_gesture, const base::Callback<void( const std::vector<content::PermissionStatus>&)>& callback) override; void CancelPermissionRequest(int request_id) override; void ResetPermission(content::PermissionType permission, const GURL& requesting_origin, const GURL& embedding_origin) override; content::PermissionStatus GetPermissionStatus( content::PermissionType permission, const GURL& requesting_origin, const GURL& embedding_origin) override; void RegisterPermissionUsage(content::PermissionType permission, const GURL& requesting_origin, const GURL& embedding_origin) override; int SubscribePermissionStatusChange( content::PermissionType permission, const GURL& requesting_origin, const GURL& embedding_origin, const base::Callback<void(content::PermissionStatus)>& callback) override; void UnsubscribePermissionStatusChange(int subscription_id) override; private: class PendingRequest; using PendingRequestsMap = IDMap<PendingRequest, IDMapOwnPointer>; struct Subscription; using SubscriptionsMap = IDMap<Subscription, IDMapOwnPointer>; // Called when a permission was decided for a given PendingRequest. The // PendingRequest is identified by its |request_id| and the permission is // identified by its |permission_id|. If the PendingRequest contains more than // one permission, it will wait for the remaining permissions to be resolved. // When all the permissions have been resolved, the PendingRequest's callback // is run. void OnPermissionsRequestResponseStatus( int request_id, int permission_id, content::PermissionStatus status); // Not all WebContents are able to display permission requests. If the PBM // is required but missing for |web_contents|, don't pass along the request. bool IsPermissionBubbleManagerMissing(content::WebContents* web_contents); // content_settings::Observer implementation. void OnContentSettingChanged(const ContentSettingsPattern& primary_pattern, const ContentSettingsPattern& secondary_pattern, ContentSettingsType content_type, std::string resource_identifier) override; Profile* profile_; PendingRequestsMap pending_requests_; SubscriptionsMap subscriptions_; base::WeakPtrFactory<PermissionManager> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(PermissionManager); }; #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_MANAGER_H_
#include <math.h> void diffVt(double vec1[3],double vec2[3], double ans[3]); void crossProd(double a[3], double b[3], double ans[3]); double dotProd(double a[3], double b[3]); double vecMag(double a[3]); int vecEqual(double a[3], double b[3]);
/* * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H #define WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H #include "webrtc/system_wrappers/include/critical_section_wrapper.h" #include "webrtc/typedefs.h" #include "webrtc/voice_engine/voice_engine_defines.h" namespace webrtc { class DtmfInbandQueue { public: DtmfInbandQueue(int32_t id); virtual ~DtmfInbandQueue(); int AddDtmf(uint8_t DtmfKey, uint16_t len, uint8_t level); int8_t NextDtmf(uint16_t* len, uint8_t* level); bool PendingDtmf(); void ResetDtmf(); private: enum {kDtmfInbandMax = 20}; int32_t _id; CriticalSectionWrapper& _DtmfCritsect; uint8_t _nextEmptyIndex; uint8_t _DtmfKey[kDtmfInbandMax]; uint16_t _DtmfLen[kDtmfInbandMax]; uint8_t _DtmfLevel[kDtmfInbandMax]; }; } // namespace webrtc #endif // WEBRTC_VOICE_ENGINE_DTMF_INBAND_QUEUE_H
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_ASH_LOGIN_SCREENS_PARENTAL_HANDOFF_SCREEN_H_ #define CHROME_BROWSER_ASH_LOGIN_SCREENS_PARENTAL_HANDOFF_SCREEN_H_ #include <string> #include "base/bind.h" #include "chrome/browser/ash/login/screens/base_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration. #include "chrome/browser/ui/webui/chromeos/login/parental_handoff_screen_handler.h" namespace ash { class ParentalHandoffScreen : public BaseScreen { public: using TView = ParentalHandoffScreenView; enum class Result { DONE, SKIPPED }; static std::string GetResultString(Result result); using ScreenExitCallback = base::RepeatingCallback<void(Result)>; ParentalHandoffScreen(ParentalHandoffScreenView* view, const ScreenExitCallback& exit_callback); ParentalHandoffScreen(const ParentalHandoffScreen&) = delete; ParentalHandoffScreen& operator=(const ParentalHandoffScreen&) = delete; ~ParentalHandoffScreen() override; void OnViewDestroyed(ParentalHandoffScreenView* view); ScreenExitCallback get_exit_callback_for_test() { return exit_callback_; } void set_exit_callback_for_test(const ScreenExitCallback& exit_callback) { exit_callback_ = exit_callback; } private: // BaseScreen: bool MaybeSkip(WizardContext* context) override; void ShowImpl() override; void HideImpl() override; void OnUserAction(const std::string& action_id) override; ParentalHandoffScreenView* view_ = nullptr; ScreenExitCallback exit_callback_; }; } // namespace ash // TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos // source migration is finished. namespace chromeos { using ::ash::ParentalHandoffScreen; } #endif // CHROME_BROWSER_ASH_LOGIN_SCREENS_PARENTAL_HANDOFF_SCREEN_H_
// Copyright 2014 Rui Ueyama. Released under the MIT license. #ifndef __STDFLOAT_H #define __STDFLOAT_H #define DECIMAL_DIG 21 #define FLT_EVAL_METHOD 0 // C11 5.2.4.2.2p9 #define FLT_RADIX 2 #define FLT_ROUNDS 1 // C11 5.2.4.2.2p8: to nearest #define FLT_DIG 6 #define FLT_EPSILON 0x1p-23 #define FLT_MANT_DIG 24 #define FLT_MAX 0x1.fffffep+127 #define FLT_MAX_10_EXP 38 #define FLT_MAX_EXP 128 #define FLT_MIN 0x1p-126 #define FLT_MIN_10_EXP -37 #define FLT_MIN_EXP -125 #define FLT_TRUE_MIN 0x1p-149 #define DBL_DIG 15 #define DBL_EPSILON 0x1p-52 #define DBL_MANT_DIG 53 #define DBL_MAX 0x1.fffffffffffffp+1023 #define DBL_MAX_10_EXP 308 #define DBL_MAX_EXP 1024 #define DBL_MIN 0x1p-1022 #define DBL_MIN_10_EXP -307 #define DBL_MIN_EXP -1021 #define DBL_TRUE_MIN 0x0.0000000000001p-1022 #define LDBL_DIG 15 #define LDBL_EPSILON 0x1p-52 #define LDBL_MANT_DIG 53 #define LDBL_MAX 0x1.fffffffffffffp+1023 #define LDBL_MAX_10_EXP 308 #define LDBL_MAX_EXP 1024 #define LDBL_MIN 0x1p-1022 #define LDBL_MIN_10_EXP -307 #define LDBL_MIN_EXP -1021 #define LDBL_TRUE_MIN 0x0.0000000000001p-1022 #endif
/* ----------------------------------------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android © Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding scheme for digital audio. This FDK AAC Codec software is intended to be used on a wide variety of Android devices. AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient general perceptual audio codecs. AAC-ELD is considered the best-performing full-bandwidth communications codec by independent studies and is widely deployed. AAC has been standardized by ISO and IEC as part of the MPEG specifications. Patent licenses for necessary patent claims for the FDK AAC Codec (including those of Fraunhofer) may be obtained through Via Licensing (www.vialicensing.com) or through the respective patent owners individually for the purpose of encoding or decoding bit streams in products that are compliant with the ISO/IEC MPEG audio standards. Please note that most manufacturers of Android devices already license these patent claims through Via Licensing or directly from the patent owners, and therefore FDK AAC Codec software may already be covered under those patent licenses when it is used for those licensed purposes only. Commercially-licensed AAC software libraries, including floating-point versions with enhanced sound quality, are also available from Fraunhofer. Users are encouraged to check the Fraunhofer website for additional applications information and documentation. 2. COPYRIGHT LICENSE Redistribution and use in source and binary forms, with or without modification, are permitted without payment of copyright license fees provided that you satisfy the following conditions: You must retain the complete text of this software license in redistributions of the FDK AAC Codec or your modifications thereto in source code form. You must retain the complete text of this software license in the documentation and/or other materials provided with redistributions of the FDK AAC Codec or your modifications thereto in binary form. You must make available free of charge copies of the complete source code of the FDK AAC Codec and your modifications thereto to recipients of copies in binary form. The name of Fraunhofer may not be used to endorse or promote products derived from this library without prior written permission. You may not charge copyright license fees for anyone to use, copy or distribute the FDK AAC Codec software or your modifications thereto. Your modified versions of the FDK AAC Codec must carry prominent notices stating that you changed the software and the date of any change. For modified versions of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android" must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK AAC Codec Library for Android." 3. NO PATENT LICENSE NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE. Fraunhofer provides no warranty of patent non-infringement with respect to this software. You may use this FDK AAC Codec software or modifications thereto only for purposes that are authorized by appropriate patent licenses. 4. DISCLAIMER This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary, or consequential damages, including but not limited to procurement of substitute goods or services; loss of use, data, or profits, or business interruption, however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence), arising in any way out of the use of this software, even if advised of the possibility of such damage. 5. CONTACT INFORMATION Fraunhofer Institute for Integrated Circuits IIS Attention: Audio and Multimedia Departments - FDK AAC LL Am Wolfsmantel 33 91058 Erlangen, Germany www.iis.fraunhofer.de/amm amm-info@iis.fraunhofer.de ----------------------------------------------------------------------------------------------------------- */ /*************************** Fraunhofer IIS FDK Tools ********************** Author(s): Description: ******************************************************************************/ #ifndef MIPS_SCALE_H #define MIPS_SCALE_H #if defined(__mips_dsp) /*! * * \brief Scale input value by 2^{scale} and saturate output to 2^{dBits-1} * \return scaled and saturated value * * This macro scales src value right or left and applies saturation to (2^dBits)-1 * maxima output. */ #define SATURATE_RIGHT_SHIFT(src, scale, dBits) \ (__builtin_mips_shll_s_w((src)>>scale,(DFRACT_BITS-(dBits)))>>(DFRACT_BITS-(dBits))) #endif /*__mips_dsp */ #endif /* MIPS_SCALE_H */
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and 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 QWINDOWSSTYLE_P_P_H #define QWINDOWSSTYLE_P_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header // file may change from version to version without notice, or even be removed. // // We mean it. // #include <QtWidgets/private/qtwidgetsglobal_p.h> #include "qwindowsstyle_p.h" #include "qcommonstyle_p.h" #if QT_CONFIG(style_windows) #include <qlist.h> QT_BEGIN_NAMESPACE class QTime; class QWindowsStylePrivate : public QCommonStylePrivate { Q_DECLARE_PUBLIC(QWindowsStyle) public: enum { InvalidMetric = -23576 }; QWindowsStylePrivate(); static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option = 0, const QWidget *widget = 0); static int fixedPixelMetric(QStyle::PixelMetric pm); static qreal devicePixelRatio(const QWidget *widget = 0) { return widget ? widget->devicePixelRatioF() : QWindowsStylePrivate::appDevicePixelRatio(); } static qreal nativeMetricScaleFactor(const QWidget *widget = Q_NULLPTR); bool hasSeenAlt(const QWidget *widget) const; bool altDown() const { return alt_down; } bool alt_down; QList<const QWidget *> seenAlt; int menuBarTimer; QColor inactiveCaptionText; QColor activeCaptionColor; QColor activeGradientCaptionColor; QColor inactiveCaptionColor; QColor inactiveGradientCaptionColor; enum { windowsItemFrame = 2, // menu item frame width windowsSepHeight = 9, // separator item height windowsItemHMargin = 3, // menu item hor text margin windowsItemVMargin = 2, // menu item ver text margin windowsArrowHMargin = 6, // arrow horizontal margin windowsRightBorder = 15, // right border on windows windowsCheckMarkWidth = 12 // checkmarks width on windows }; private: static qreal appDevicePixelRatio(); }; QT_END_NAMESPACE #endif // style_windows #endif //QWINDOWSSTYLE_P_P_H ;
//#define AML_NAND_UBOOT /**************PHY****************/ #define AML_SLC_NAND_SUPPORT #define AML_MLC_NAND_SUPPORT //#define AML_NAND_DBG #define NEW_NAND_SUPPORT #define AML_NAND_NEW_OOB #define NAND_ADJUST_PART_TABLE #ifdef NAND_ADJUST_PART_TABLE #define ADJUST_BLOCK_NUM 4 #else #define ADJUST_BLOCK_NUM 0 #endif #define AML_NAND_RB_IRQ //#define AML_NAND_DMA_POLLING extern int is_phydev_off_adjust(void); extern int get_adjust_block_num(void);
#ifndef SOME_GUARD /* { dg-error "unterminated" } */ #if 1 /* Typo here: "endfi" should have been "endif". */ #endfi /* { dg-error "invalid preprocessing directive #endfi; did you mean #endif?" } */ int make_non_empty; /* Another transposition typo: */ #deifne FOO /* { dg-error "invalid preprocessing directive #deifne; did you mean #define?" } */ #endif /* #ifndef SOME_GUARD */
/* 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. * */ #if !defined(SCUMM_IMUSE_DIGI_H) && defined(ENABLE_SCUMM_7_8) #define SCUMM_IMUSE_DIGI_H #include "common/scummsys.h" #include "common/mutex.h" #include "common/serializer.h" #include "common/textconsole.h" #include "common/util.h" #include "scumm/imuse_digi/dimuse.h" #include "scumm/imuse_digi/dimuse_bndmgr.h" #include "scumm/imuse_digi/dimuse_sndmgr.h" #include "scumm/music.h" #include "scumm/sound.h" namespace Audio { class AudioStream; class Mixer; } namespace Scumm { enum { MAX_DIGITAL_TRACKS = 8, MAX_DIGITAL_FADETRACKS = 8 }; struct imuseDigTable; struct imuseComiTable; class ScummEngine_v7; struct Track; class IMuseDigital : public MusicEngine { private: int _callbackFps; // value how many times callback needs to be called per second struct TriggerParams { char marker[10]; int fadeOutDelay; char filename[13]; int soundId; int hookId; int volume; }; TriggerParams _triggerParams; bool _triggerUsed; Track *_track[MAX_DIGITAL_TRACKS + MAX_DIGITAL_FADETRACKS]; Common::Mutex _mutex; ScummEngine_v7 *_vm; Audio::Mixer *_mixer; ImuseDigiSndMgr *_sound; char *_audioNames; // filenames of sound SFX used in FT int32 _numAudioNames; // number of above filenames bool _pause; // flag mean that iMuse callback should be idle int32 _attributes[188]; // internal attributes for each music file to store and check later int32 _nextSeqToPlay; // id of sequence type of music needed played int32 _curMusicState; // current or previous id of music int32 _curMusicSeq; // current or previous id of sequence music int32 _curMusicCue; // current cue for current music. used in FT int _stopingSequence; bool _radioChatterSFX; static void timer_handler(void *refConf); void callback(); void switchToNextRegion(Track *track); int allocSlot(int priority); void startSound(int soundId, const char *soundName, int soundType, int volGroupId, Audio::AudioStream *input, int hookId, int volume, int priority, Track *otherTrack); void selectVolumeGroup(int soundId, int volGroupId); int32 getPosInMs(int soundId); void getLipSync(int soundId, int syncId, int32 msPos, int32 &width, int32 &height); int getSoundIdByName(const char *soundName); void fadeOutMusic(int fadeDelay); void fadeOutMusicAndStartNew(int fadeDelay, const char *filename, int soundId); void setTrigger(TriggerParams *trigger); void setHookIdForMusic(int hookId); Track *cloneToFadeOutTrack(Track *track, int fadeDelay); void setFtMusicState(int stateId); void setFtMusicSequence(int seqId); void setFtMusicCuePoint(int cueId); void playFtMusic(const char *songName, int opcode, int volume); void setComiMusicState(int stateId); void setComiMusicSequence(int seqId); void playComiMusic(const char *songName, const imuseComiTable *table, int attribPos, bool sequence); void setDigMusicState(int stateId); void setDigMusicSequence(int seqId); void playDigMusic(const char *songName, const imuseDigTable *table, int attribPos, bool sequence); void flushTrack(Track *track); public: IMuseDigital(ScummEngine_v7 *scumm, Audio::Mixer *mixer, int fps); virtual ~IMuseDigital(); void setAudioNames(int32 num, char *names); void startVoice(int soundId, Audio::AudioStream *input); void startVoice(int soundId, const char *soundName); void startMusic(int soundId, int volume); void startMusic(const char *soundName, int soundId, int hookId, int volume); void startMusicWithOtherPos(const char *soundName, int soundId, int hookId, int volume, Track *otherTrack); void startSfx(int soundId, int priority); void startSound(int sound) { error("IMuseDigital::startSound(int) should be never called"); } void saveLoadEarly(Common::Serializer &ser); void resetState(); void setRadioChatterSFX(bool state) { _radioChatterSFX = state; } void setPriority(int soundId, int priority); void setVolume(int soundId, int volume); void setPan(int soundId, int pan); void setFade(int soundId, int destVolume, int delay60HzTicks); int getCurMusicSoundId(); void setHookId(int soundId, int hookId); void setMusicVolume(int vol) {} void stopSound(int sound); void stopAllSounds(); void pause(bool pause); void parseScriptCmds(int cmd, int soundId, int sub_cmd, int d, int e, int f, int g, int h); void refreshScripts(); void flushTracks(); int getSoundStatus(int sound) const; int32 getCurMusicPosInMs(); int32 getCurVoiceLipSyncWidth(); int32 getCurVoiceLipSyncHeight(); int32 getCurMusicLipSyncWidth(int syncId); int32 getCurMusicLipSyncHeight(int syncId); int32 getSoundElapsedTimeInMs(int soundId); }; } // End of namespace Scumm #endif
/* * Copyright (c) 2003, 2007-8 Matteo Frigo * Copyright (c) 2003, 2007-8 Massachusetts Institute of Technology * * 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 * */ /* This file was automatically generated --- DO NOT EDIT */ /* Generated on Sun Jul 12 06:40:37 EDT 2009 */ #include "codelet-dft.h" #ifdef HAVE_FMA /* Generated by: ../../../genfft/gen_notw -fma -reorder-insns -schedule-for-pipeline -simd -compact -variables 4 -pipeline-latency 8 -n 4 -name n2sv_4 -with-ostride 1 -include n2s.h -store-multiple 4 */ /* * This function contains 16 FP additions, 0 FP multiplications, * (or, 16 additions, 0 multiplications, 0 fused multiply/add), * 25 stack variables, 0 constants, and 18 memory accesses */ #include "n2s.h" static void n2sv_4(const R *ri, const R *ii, R *ro, R *io, stride is, stride os, INT v, INT ivs, INT ovs) { INT i; for (i = v; i > 0; i = i - (2 * VL), ri = ri + ((2 * VL) * ivs), ii = ii + ((2 * VL) * ivs), ro = ro + ((2 * VL) * ovs), io = io + ((2 * VL) * ovs), MAKE_VOLATILE_STRIDE(is), MAKE_VOLATILE_STRIDE(os)) { V T1, T2, T7, T8, T4, T5, Tc, Td; T1 = LD(&(ri[0]), ivs, &(ri[0])); T2 = LD(&(ri[WS(is, 2)]), ivs, &(ri[0])); T7 = LD(&(ii[0]), ivs, &(ii[0])); T8 = LD(&(ii[WS(is, 2)]), ivs, &(ii[0])); T4 = LD(&(ri[WS(is, 1)]), ivs, &(ri[WS(is, 1)])); T5 = LD(&(ri[WS(is, 3)]), ivs, &(ri[WS(is, 1)])); Tc = LD(&(ii[WS(is, 1)]), ivs, &(ii[WS(is, 1)])); Td = LD(&(ii[WS(is, 3)]), ivs, &(ii[WS(is, 1)])); { V T3, Tb, T9, Tf, T6, Ta, Te, Tg; T3 = VADD(T1, T2); Tb = VSUB(T1, T2); T9 = VSUB(T7, T8); Tf = VADD(T7, T8); T6 = VADD(T4, T5); Ta = VSUB(T4, T5); Te = VSUB(Tc, Td); Tg = VADD(Tc, Td); { V Th, Ti, Tj, Tk; Th = VADD(Ta, T9); STM4(&(io[3]), Th, ovs, &(io[1])); Ti = VSUB(T9, Ta); STM4(&(io[1]), Ti, ovs, &(io[1])); Tj = VADD(T3, T6); STM4(&(ro[0]), Tj, ovs, &(ro[0])); Tk = VSUB(T3, T6); STM4(&(ro[2]), Tk, ovs, &(ro[0])); { V Tl, Tm, Tn, To; Tl = VADD(Tf, Tg); STM4(&(io[0]), Tl, ovs, &(io[0])); Tm = VSUB(Tf, Tg); STM4(&(io[2]), Tm, ovs, &(io[0])); STN4(&(io[0]), Tl, Ti, Tm, Th, ovs); Tn = VSUB(Tb, Te); STM4(&(ro[3]), Tn, ovs, &(ro[1])); To = VADD(Tb, Te); STM4(&(ro[1]), To, ovs, &(ro[1])); STN4(&(ro[0]), Tj, To, Tk, Tn, ovs); } } } } } static const kdft_desc desc = { 4, "n2sv_4", {16, 0, 0, 0}, &GENUS, 0, 1, 0, 0 }; void X(codelet_n2sv_4) (planner *p) { X(kdft_register) (p, n2sv_4, &desc); } #else /* HAVE_FMA */ /* Generated by: ../../../genfft/gen_notw -simd -compact -variables 4 -pipeline-latency 8 -n 4 -name n2sv_4 -with-ostride 1 -include n2s.h -store-multiple 4 */ /* * This function contains 16 FP additions, 0 FP multiplications, * (or, 16 additions, 0 multiplications, 0 fused multiply/add), * 17 stack variables, 0 constants, and 18 memory accesses */ #include "n2s.h" static void n2sv_4(const R *ri, const R *ii, R *ro, R *io, stride is, stride os, INT v, INT ivs, INT ovs) { INT i; for (i = v; i > 0; i = i - (2 * VL), ri = ri + ((2 * VL) * ivs), ii = ii + ((2 * VL) * ivs), ro = ro + ((2 * VL) * ovs), io = io + ((2 * VL) * ovs), MAKE_VOLATILE_STRIDE(is), MAKE_VOLATILE_STRIDE(os)) { V T3, Tb, T9, Tf, T6, Ta, Te, Tg; { V T1, T2, T7, T8; T1 = LD(&(ri[0]), ivs, &(ri[0])); T2 = LD(&(ri[WS(is, 2)]), ivs, &(ri[0])); T3 = VADD(T1, T2); Tb = VSUB(T1, T2); T7 = LD(&(ii[0]), ivs, &(ii[0])); T8 = LD(&(ii[WS(is, 2)]), ivs, &(ii[0])); T9 = VSUB(T7, T8); Tf = VADD(T7, T8); } { V T4, T5, Tc, Td; T4 = LD(&(ri[WS(is, 1)]), ivs, &(ri[WS(is, 1)])); T5 = LD(&(ri[WS(is, 3)]), ivs, &(ri[WS(is, 1)])); T6 = VADD(T4, T5); Ta = VSUB(T4, T5); Tc = LD(&(ii[WS(is, 1)]), ivs, &(ii[WS(is, 1)])); Td = LD(&(ii[WS(is, 3)]), ivs, &(ii[WS(is, 1)])); Te = VSUB(Tc, Td); Tg = VADD(Tc, Td); } { V Th, Ti, Tj, Tk; Th = VSUB(T3, T6); STM4(&(ro[2]), Th, ovs, &(ro[0])); Ti = VSUB(Tf, Tg); STM4(&(io[2]), Ti, ovs, &(io[0])); Tj = VADD(T3, T6); STM4(&(ro[0]), Tj, ovs, &(ro[0])); Tk = VADD(Tf, Tg); STM4(&(io[0]), Tk, ovs, &(io[0])); { V Tl, Tm, Tn, To; Tl = VSUB(T9, Ta); STM4(&(io[1]), Tl, ovs, &(io[1])); Tm = VADD(Tb, Te); STM4(&(ro[1]), Tm, ovs, &(ro[1])); Tn = VADD(Ta, T9); STM4(&(io[3]), Tn, ovs, &(io[1])); STN4(&(io[0]), Tk, Tl, Ti, Tn, ovs); To = VSUB(Tb, Te); STM4(&(ro[3]), To, ovs, &(ro[1])); STN4(&(ro[0]), Tj, Tm, Th, To, ovs); } } } } static const kdft_desc desc = { 4, "n2sv_4", {16, 0, 0, 0}, &GENUS, 0, 1, 0, 0 }; void X(codelet_n2sv_4) (planner *p) { X(kdft_register) (p, n2sv_4, &desc); } #endif /* HAVE_FMA */
#include "x86_64/getregs_old.h"
/* * Copyright 1993-2010 NVIDIA Corporation. All rights reserved. * * NVIDIA Corporation and its licensors retain all intellectual property and * proprietary rights in and to this software and related documentation. * Any use, reproduction, disclosure, or distribution of this software * and related documentation without an express license agreement from * NVIDIA Corporation is strictly prohibited. * * Please refer to the applicable NVIDIA end user license agreement (EULA) * associated with this source code for terms and conditions that govern * your use of this NVIDIA software. * */ #ifndef __CPU_ANIM_H__ #define __CPU_ANIM_H__ #include "gl_helper.h" #include <iostream> struct CPUAnimBitmap { unsigned char *pixels; int width, height; void *dataBlock; void (*fAnim)(void*,int); void (*animExit)(void*); void (*clickDrag)(void*,int,int,int,int); int dragStartX, dragStartY; CPUAnimBitmap( int w, int h, void *d = NULL ) { width = w; height = h; pixels = new unsigned char[width * height * 4]; dataBlock = d; clickDrag = NULL; } ~CPUAnimBitmap() { delete [] pixels; } unsigned char* get_ptr( void ) const { return pixels; } long image_size( void ) const { return width * height * 4; } void click_drag( void (*f)(void*,int,int,int,int)) { clickDrag = f; } void anim_and_exit( void (*f)(void*,int), void(*e)(void*) ) { CPUAnimBitmap** bitmap = get_bitmap_ptr(); *bitmap = this; fAnim = f; animExit = e; // a bug in the Windows GLUT implementation prevents us from // passing zero arguments to glutInit() int c=1; char* dummy = ""; glutInit( &c, &dummy ); glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA ); glutInitWindowSize( width, height ); glutCreateWindow( "bitmap" ); glutKeyboardFunc(Key); glutDisplayFunc(Draw); if (clickDrag != NULL) glutMouseFunc( mouse_func ); glutIdleFunc( idle_func ); glutMainLoop(); } // static method used for glut callbacks static CPUAnimBitmap** get_bitmap_ptr( void ) { static CPUAnimBitmap* gBitmap; return &gBitmap; } // static method used for glut callbacks static void mouse_func( int button, int state, int mx, int my ) { if (button == GLUT_LEFT_BUTTON) { CPUAnimBitmap* bitmap = *(get_bitmap_ptr()); if (state == GLUT_DOWN) { bitmap->dragStartX = mx; bitmap->dragStartY = my; } else if (state == GLUT_UP) { bitmap->clickDrag( bitmap->dataBlock, bitmap->dragStartX, bitmap->dragStartY, mx, my ); } } } // static method used for glut callbacks static void idle_func( void ) { static int ticks = 1; CPUAnimBitmap* bitmap = *(get_bitmap_ptr()); bitmap->fAnim( bitmap->dataBlock, ticks++ ); glutPostRedisplay(); } // static method used for glut callbacks static void Key(unsigned char key, int x, int y) { switch (key) { case 27: CPUAnimBitmap* bitmap = *(get_bitmap_ptr()); bitmap->animExit( bitmap->dataBlock ); //delete bitmap; exit(0); } } // static method used for glut callbacks static void Draw( void ) { CPUAnimBitmap* bitmap = *(get_bitmap_ptr()); glClearColor( 0.0, 0.0, 0.0, 1.0 ); glClear( GL_COLOR_BUFFER_BIT ); glDrawPixels( bitmap->width, bitmap->height, GL_RGBA, GL_UNSIGNED_BYTE, bitmap->pixels ); glutSwapBuffers(); } }; #endif // __CPU_ANIM_H__
/* Copyright (C) 2006 MySQL AB & Ramil Kalimullin & MySQL Finland AB & TCX DataKonsult AB 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ /* Written by Ramil Kalimullin, who has a shared copyright to this code */ #ifndef _rt_key_h #define _rt_key_h #ifdef HAVE_RTREE_KEYS int maria_rtree_add_key(const MARIA_KEY *key, MARIA_PAGE *page, my_off_t *new_page); int maria_rtree_delete_key(MARIA_PAGE *page, uchar *key, uint key_length); int maria_rtree_set_key_mbr(MARIA_HA *info, MARIA_KEY *key, my_off_t child_page); #endif /*HAVE_RTREE_KEYS*/ #endif /* _rt_key_h */
/* * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes */ #include <math.h> /* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS CRT * FILE: lib/crt/math/cos.c * PURPOSE: Generic C Implementation of cos * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) */ #define PRECISION 9 static double cos_off_tbl[] = {0.0, -M_PI/2., 0, -M_PI/2.}; static double cos_sign_tbl[] = {1,-1,-1,1}; static double sin_off_tbl[] = {0.0, -M_PI/2., 0, -M_PI/2.}; static double sin_sign_tbl[] = {1,-1,-1,1}; double sin(double x) { int quadrant; double x2, result; /* Calculate the quadrant */ quadrant = x * (2./M_PI); /* Get offset inside quadrant */ x = x - quadrant * (M_PI/2.); /* Normalize quadrant to [0..3] */ quadrant = (quadrant - 1) & 0x3; /* Fixup value for the generic function */ x += sin_off_tbl[quadrant]; /* Calculate the negative of the square of x */ x2 = - (x * x); /* This is an unrolled taylor series using <PRECISION> iterations * Example with 4 iterations: * result = 1 - x^2/2! + x^4/4! - x^6/6! + x^8/8! * To save multiplications and to keep the precision high, it's performed * like this: * result = 1 - x^2 * (1/2! - x^2 * (1/4! - x^2 * (1/6! - x^2 * (1/8!)))) */ /* Start with 0, compiler will optimize this away */ result = 0; #if (PRECISION >= 10) result += 1./(1.*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20); result *= x2; #endif #if (PRECISION >= 9) result += 1./(1.*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18); result *= x2; #endif #if (PRECISION >= 8) result += 1./(1.*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16); result *= x2; #endif #if (PRECISION >= 7) result += 1./(1.*2*3*4*5*6*7*8*9*10*11*12*13*14); result *= x2; #endif #if (PRECISION >= 6) result += 1./(1.*2*3*4*5*6*7*8*9*10*11*12); result *= x2; #endif #if (PRECISION >= 5) result += 1./(1.*2*3*4*5*6*7*8*9*10); result *= x2; #endif result += 1./(1.*2*3*4*5*6*7*8); result *= x2; result += 1./(1.*2*3*4*5*6); result *= x2; result += 1./(1.*2*3*4); result *= x2; result += 1./(1.*2); result *= x2; result += 1; /* Apply correct sign */ result *= sin_sign_tbl[quadrant]; return result; } double cos(double x) { int quadrant; double x2, result; /* Calculate the quadrant */ quadrant = x * (2./M_PI); /* Get offset inside quadrant */ x = x - quadrant * (M_PI/2.); /* Normalize quadrant to [0..3] */ quadrant = quadrant & 0x3; /* Fixup value for the generic function */ x += cos_off_tbl[quadrant]; /* Calculate the negative of the square of x */ x2 = - (x * x); /* This is an unrolled taylor series using <PRECISION> iterations * Example with 4 iterations: * result = 1 - x^2/2! + x^4/4! - x^6/6! + x^8/8! * To save multiplications and to keep the precision high, it's performed * like this: * result = 1 - x^2 * (1/2! - x^2 * (1/4! - x^2 * (1/6! - x^2 * (1/8!)))) */ /* Start with 0, compiler will optimize this away */ result = 0; #if (PRECISION >= 10) result += 1./(1.*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20); result *= x2; #endif #if (PRECISION >= 9) result += 1./(1.*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18); result *= x2; #endif #if (PRECISION >= 8) result += 1./(1.*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16); result *= x2; #endif #if (PRECISION >= 7) result += 1./(1.*2*3*4*5*6*7*8*9*10*11*12*13*14); result *= x2; #endif #if (PRECISION >= 6) result += 1./(1.*2*3*4*5*6*7*8*9*10*11*12); result *= x2; #endif #if (PRECISION >= 5) result += 1./(1.*2*3*4*5*6*7*8*9*10); result *= x2; #endif result += 1./(1.*2*3*4*5*6*7*8); result *= x2; result += 1./(1.*2*3*4*5*6); result *= x2; result += 1./(1.*2*3*4); result *= x2; result += 1./(1.*2); result *= x2; result += 1; /* Apply correct sign */ result *= cos_sign_tbl[quadrant]; return result; }
/* Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #pragma once namespace lean { void initialize_definitional_module(); void finalize_definitional_module(); }
// Copyright (c) 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef SOURCE_FUZZ_FUZZER_PASS_ADD_DEAD_CONTINUES_H_ #define SOURCE_FUZZ_FUZZER_PASS_ADD_DEAD_CONTINUES_H_ #include "source/fuzz/fuzzer_pass.h" namespace spvtools { namespace fuzz { // A fuzzer pass for adding dead continue edges to the module. class FuzzerPassAddDeadContinues : public FuzzerPass { public: FuzzerPassAddDeadContinues(opt::IRContext* ir_context, TransformationContext* transformation_context, FuzzerContext* fuzzer_context, protobufs::TransformationSequence* transformations, bool ignore_inapplicable_transformations); void Apply() override; }; } // namespace fuzz } // namespace spvtools #endif // SOURCE_FUZZ_FUZZER_PASS_ADD_DEAD_CONTINUES_H_
/** ****************************************************************************** * @file rtl8710b_inic.h * @author * @version V1.0.0 * @date 2016-05-17 * @brief This file contains all the functions prototypes for the USB & SDIO INIC firmware * library. ****************************************************************************** * @attention * * This module is a confidential and proprietary property of RealTek and * possession or use of this module requires written permission of RealTek. * * Copyright(c) 2015, Realtek Semiconductor Corporation. All rights reserved. ****************************************************************************** */ #ifndef _RTL8721D_INIC_H_ #define _RTL8721D_INIC_H_ /** @addtogroup AmebaD_Periph_Driver * @{ */ /** @defgroup INIC * @brief INIC driver modules * @{ */ /* Exported types ------------------------------------------------------------*/ /** @defgroup INIC_Exported_Types INIC Exported Types * @{ */ /** * @brief INIC TX DESC structure definition * @note: Ameba1 is 6 dword, but AmebaZ is 4 dwords */ typedef struct { /* u4Byte 0 */ u32 txpktsize:16; // bit[15:0] u32 offset:8; // bit[23:16], store the sizeof(INIC_TX_DESC) u32 bus_agg_num:8; // bit[31:24], the bus aggregation number /* u4Byte 1 */ u32 type:8; // bit[7:0], the packet type u32 data:8; // bit[8:15], the value to be written to the memory u32 reply:1; // bit[16], request to send a reply message u32 rsvd0:15; /* u4Byte 2 */ u32 start_addr; // 1) memory write/read start address 2) RAM start_function address /* u4Byte 3 */ u32 data_len:16; // bit[15:0], the length to write/read u32 rsvd2:16; // bit[31:16] } INIC_TX_DESC, *PINIC_TX_DESC; /** * @brief INIC RX DESC structure definition * @note: Ameba1 is 6 dword, but AmebaZ is 4 dwords */ typedef struct { /* u4Byte 0 */ u32 pkt_len:16; // bit[15:0], the packet size u32 offset:8; // bit[23:16], the offset from the packet start to the buf start, also means the size of RX Desc u32 rsvd0:6; // bit[29:24] u32 icv:1; //icv error u32 crc:1; // crc error /* u4Byte 1 */ /************************************************/ /*****************receive packet type*********************/ /* 0x82: 802.3 packet */ /* 0x80: 802.11 packet */ /* 0x10: C2H command */ /* 0x50: Memory Read */ /* 0x52: Memory Write */ /* 0x54: Memory Set */ /* 0x60: Indicate the firmware is started */ u32 type:8; // bit[7:0], the type of this packet u32 rsvd1:24; // bit[31:8] /* u4Byte 2 */ u32 start_addr; /* u4Byte 3 */ u32 data_len:16; // bit[15:0], the type of this packet u32 result:8; // bit[23:16], the result of memory write command u32 rsvd2:8; // bit[31:24] } INIC_RX_DESC, *PINIC_RX_DESC; /** * @} */ /* Exported constants --------------------------------------------------------*/ /** @defgroup INIC_Exported_Constants INIC Exported Constants * @{ */ /** @defgroup INIC_packet_type_definitions * @{ */ #define TX_PACKET_802_3 (0x83) #define TX_PACKET_802_11 (0x81) #define TX_H2C_CMD (0x11) #define TX_MEM_READ (0x51) #define TX_MEM_WRITE (0x53) #define TX_MEM_SET (0x55) #define TX_FM_FREETOGO (0x61) #define TX_PACKET_USER (0x41) #define TX_REG_WRITE (0xE3) #define TX_FLASH_READ (0xF1) #define TX_FLASH_WRITE (0xF3) #define TX_FLASH_SECERASE (0xF5) #define TX_FLASH_CHECKSUM (0xF7) #define RX_PACKET_802_3 (0x82) #define RX_PACKET_802_11 (0x80) #define RX_C2H_CMD (0x10) #define RX_MEM_READ (0x50) #define RX_MEM_WRITE (0x52) #define RX_MEM_SET (0x54) #define RX_FM_FREETOGO (0x60) #define RX_PACKET_USER (0x40) #define RX_REG_WRITE (0xE4) #define RX_FLASH_READ (0xF2) #define RX_FLASH_WRITE (0xF4) #define RX_FLASH_SECERASE (0xF6) #define RX_FLASH_CHECKSUM (0xF8) /** * @} */ /** @defgroup INIC_DESC_Size_definitions * @{ */ #define SIZE_RX_DESC (sizeof(INIC_RX_DESC)) #define SIZE_TX_DESC (sizeof(INIC_TX_DESC)) /** * @} */ /** * @} */ /** @defgroup INIC_Exported_Functions INIC Exported Functions * @{ */ //_LONG_CALL_ /** * @} */ /** * @} */ /** * @} */ #endif //_RTL8710B_INIC_H_ /******************* (C) COPYRIGHT 2016 Realtek Semiconductor *****END OF FILE****/
// // CBLUICollectionSource.h // // Based on CBLUITableSource // CouchbaseLite // // Created by Ewan Mcdougall mrloop.com on 06/02/2013. // Copyright (c) 2013 Ewan Mcdougall. All rights reserved. // // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file // except in compliance with the License. You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software distributed under the // License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, // either express or implied. See the License for the specific language governing permissions // and limitations under the License. #import "CBLBase.h" #import <UIKit/UIKit.h> @class CBLDocument, CBLLiveQuery, CBLQueryRow, RESTOperation; NS_ASSUME_NONNULL_BEGIN /** A UICollectionView data source driven by a CBLLiveQuery. It populates the collection view from the query rows, and automatically updates the collection as the query results change when the database is updated. A CBLUICollectionSource can be created in a nib. If so, its collectionView outlet should be wired up to the UICollectionView it manages, and the collection view's dataSource outlet should be wired to it. */ @interface CBLUICollectionSource : NSObject <UICollectionViewDataSource #if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000) , UIDataSourceModelAssociation #endif > @property (nonatomic, retain) IBOutlet UICollectionView* collectionView; @property (retain) CBLLiveQuery* query; /** Rebuilds the collection from the query's current .rows property. */ -(void) reloadFromQuery; #pragma mark Row Accessors: /** The current array of CBLQueryRows being used as the data source for the collection. */ @property (nonatomic, readonly, nullable) NSMutableArray* rows; /** Convenience accessor to get the row object for a given collection row index. */ - (nullable CBLQueryRow*) rowAtIndex: (NSUInteger)index; /** Convenience accessor to find the index path of the row with a given document. */ - (nullable NSIndexPath*) indexPathForDocument: (CBLDocument*)document; /** Convenience accessor to return the query row at a given index path. */ - (nullable CBLQueryRow*) rowAtIndexPath: (NSIndexPath*)path; /** Convenience accessor to return the document at a given index path. */ - (nullable CBLDocument*) documentAtIndexPath: (NSIndexPath*)path; #pragma mark Editing The Collection: /** Deletes the documents at the given row indexes, animating the removal from the collection. */ - (BOOL) deleteDocumentsAtIndexes: (CBLArrayOf(NSIndexPath*)*)indexPaths error: (NSError**)outError; /** Deletes the given documents, animating the removal from the collection. */ - (BOOL) deleteDocuments: (CBLArrayOf(CBLDocument*)*)documents error: (NSError**)outError; @end #pragma mark CouchUICollectionDelegate: /** Additional methods for the collection view's delegate, that will be invoked by the CouchUICollectionSource. */ @protocol CBLUICollectionDelegate <UICollectionViewDelegate> @optional /** Allows delegate to return its own custom cell, just like -collectionView:cellForRowAtIndexPath:. If this returns nil the collection source will create its own cell, as if this method were not implemented. */ - (UICollectionViewCell *)couchCollectionSource:(CBLUICollectionSource*)source cellForRowAtIndexPath:(NSIndexPath *)indexPath; /** Called after the query's results change, before the collection view is reloaded. */ - (void)couchCollectionSource:(CBLUICollectionSource*)source willUpdateFromQuery:(CBLLiveQuery*)query; /** Called after the query's results change to update the collection view. If this method is not implemented by the delegate, reloadData is called on the collection view.*/ - (void)couchCollectionSource:(CBLUICollectionSource*)source updateFromQuery:(CBLLiveQuery*)query previousRows:(CBLArrayOf(CBLQueryRow*) *)previousRows; /** Called from -collectionView:cellForItemAtIndexPath: just before it returns, giving the delegate a chance to customize the new cell. */ - (void)couchCollectionSource:(CBLUICollectionSource*)source willUseCell:(UICollectionViewCell*)cell forRow:(CBLQueryRow*)row; @end NS_ASSUME_NONNULL_END
// Derived from Inferno utils/6c/gc.h // http://code.google.com/p/inferno-os/source/browse/utils/6c/gc.h // // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Portions Copyright © 1997-1999 Vita Nuova Limited // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) // Portions Copyright © 2004,2006 Bruce Ellis // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others // Portions Copyright © 2009 The Go Authors. 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. #include "../gc/popt.h" #define Z N #define Adr Addr #define D_HI D_NONE #define D_LO D_NONE #define BLOAD(r) band(bnot(r->refbehind), r->refahead) #define BSTORE(r) band(bnot(r->calbehind), r->calahead) #define LOAD(r) (~r->refbehind.b[z] & r->refahead.b[z]) #define STORE(r) (~r->calbehind.b[z] & r->calahead.b[z]) #define CLOAD 5 #define CREF 5 #define CINF 1000 #define LOOP 3 typedef struct Reg Reg; typedef struct Rgn Rgn; // A Reg is a wrapper around a single Prog (one instruction) that holds // register optimization information while the optimizer runs. // r->prog is the instruction. // r->prog->opt points back to r. struct Reg { Flow f; Bits set; // variables written by this instruction. Bits use1; // variables read by prog->from. Bits use2; // variables read by prog->to. Bits refbehind; Bits refahead; Bits calbehind; Bits calahead; Bits regdiff; Bits act; int32 regu; // register used bitmap int32 rpo; // reverse post ordering int32 active; uint16 loop; // x5 for every loop uchar refset; // diagnostic generated Reg* p1; // predecessors of this instruction: p1, Reg* p2; // and then p2 linked though p2link. Reg* p2link; Reg* s1; // successors of this instruction (at most two: s1 and s2). Reg* s2; Reg* link; // next instruction in function code Prog* prog; // actual instruction }; #define R ((Reg*)0) #define NRGN 600 struct Rgn { Reg* enter; short cost; short varno; short regno; }; EXTERN int32 exregoffset; // not set EXTERN int32 exfregoffset; // not set EXTERN Reg zreg; EXTERN Reg* freer; EXTERN Reg** rpo2r; EXTERN Rgn region[NRGN]; EXTERN Rgn* rgp; EXTERN int nregion; EXTERN int nvar; EXTERN int32 regbits; EXTERN int32 exregbits; EXTERN Bits externs; EXTERN Bits params; EXTERN Bits consts; EXTERN Bits addrs; EXTERN Bits ovar; EXTERN int change; EXTERN int32 maxnr; EXTERN int32* idom; EXTERN struct { int32 ncvtreg; int32 nspill; int32 nreload; int32 ndelmov; int32 nvar; int32 naddr; } ostats; /* * reg.c */ Reg* rega(void); int rcmp(const void*, const void*); void regopt(Prog*); void addmove(Reg*, int, int, int); Bits mkvar(Reg*, Adr*); void prop(Reg*, Bits, Bits); void loopit(Reg*, int32); void synch(Reg*, Bits); uint32 allreg(uint32, Rgn*); void paint1(Reg*, int); uint32 paint2(Reg*, int); void paint3(Reg*, int, int32, int); void addreg(Adr*, int); void dumpone(Flow*, int); void dumpit(char*, Flow*, int); /* * peep.c */ void peep(Prog*); void excise(Flow*); int copyu(Prog*, Adr*, Adr*); int32 RtoB(int); int32 FtoB(int); int BtoR(int32); int BtoF(int32); #pragma varargck type "D" Adr* /* * prog.c */ typedef struct ProgInfo ProgInfo; struct ProgInfo { uint32 flags; // the bits below uint32 reguse; // required registers used by this instruction uint32 regset; // required registers set by this instruction uint32 regindex; // registers used by addressing mode }; enum { // Pseudo-op, like TEXT, GLOBL, TYPE, PCDATA, FUNCDATA. Pseudo = 1<<1, // There's nothing to say about the instruction, // but it's still okay to see. OK = 1<<2, // Size of right-side write, or right-side read if no write. SizeB = 1<<3, SizeW = 1<<4, SizeL = 1<<5, SizeQ = 1<<6, SizeF = 1<<7, // float aka float32 SizeD = 1<<8, // double aka float64 // Left side: address taken, read, write. LeftAddr = 1<<9, LeftRead = 1<<10, LeftWrite = 1<<11, // Right side: address taken, read, write. RightAddr = 1<<12, RightRead = 1<<13, RightWrite = 1<<14, // Set, use, or kill of carry bit. // Kill means we never look at the carry bit after this kind of instruction. SetCarry = 1<<15, UseCarry = 1<<16, KillCarry = 1<<17, // Instruction kinds Move = 1<<18, // straight move Conv = 1<<19, // size conversion Cjmp = 1<<20, // conditional jump Break = 1<<21, // breaks control flow (no fallthrough) Call = 1<<22, // function call Jump = 1<<23, // jump Skip = 1<<24, // data instruction // Special cases for register use. ShiftCX = 1<<25, // possible shift by CX ImulAXDX = 1<<26, // possible multiply into DX:AX }; void proginfo(ProgInfo*, Prog*);
// 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. // A RendererNetPredictor instance is maintained for each RenderThread. // URL strings are typically added to the embedded queue during rendering. // The first addition to the queue (transitioning from empty to having // some names) causes a processing task to be added to the Renderer Thread. // The processing task gathers all buffered names, and send them via IPC // to the browser, so that DNS lookups can be performed before the user attempts // to traverse a link. // This class removed some duplicates, and discards numeric IP addresss // (which wouldn't looked up in DNS anyway). // To limit the time during the processing task (and avoid stalling the Render // thread), several limits are placed on how much of the queue to process. // If the processing task is not able to completely empty the queue, it // schedules a future continuation of the task, and keeps the map of already // sent names. If the entire queue is processed, then the list of "sent names" // is cleared so that future gatherings might again pass along the same names. #ifndef COMPONENTS_DNS_PREFETCH_RENDERER_RENDERER_NET_PREDICTOR_H_ #define COMPONENTS_DNS_PREFETCH_RENDERER_RENDERER_NET_PREDICTOR_H_ #include <map> #include <string> #include "base/basictypes.h" #include "base/memory/weak_ptr.h" #include "components/dns_prefetch/renderer/predictor_queue.h" namespace dns_prefetch { class RendererNetPredictor { public: RendererNetPredictor(); ~RendererNetPredictor(); // Push a name into the queue to be resolved. void Resolve(const char* name, size_t length); // SubmitHosts processes the buffered names, and submits them for DNS // prefetching. // Note that browser process may decide which names should be looked up (to // pre-warm the cache) based on what has been (or not been) looked up // recently. // If sending for DNS lookup is incomplete (queue is not empty, or not all // names in map are sent, or ...) then a task to continue processing is // sent to our thread loop. void SubmitHostnames(); // The following is private, but exposed for testing purposes only. static bool is_numeric_ip(const char* name, size_t length); private: // ExtractBufferedNames pulls names from queue into the map, reducing or // eliminating a waiting queue. // The size_goal argument can be used to reduce the amount of // processing done in this method, and can leave some data // in the buffer under some circumstances. // If size_goal is zero, then extraction proceeds until // the queue is empty. If size goal is positive, then // extraction continues until the domain_map_ contains // at least the specified number of names, or the buffer is empty. void ExtractBufferedNames(size_t size_goal = 0); // DnsPrefetchNames does not check the buffer, and just sends names // that are already collected in the domain_map_ for DNS lookup. // If max_count is zero, then all available names are sent; and // if positive, then at most max_count names will be sent. void DnsPrefetchNames(size_t max_count = 0); // Reset() restores initial state provided after construction. // This discards ALL queue entries, and map entries. void Reset(); // We use c_string_queue_ to hold lists of names supplied typically) by the // renderer. It queues the names, at minimal cost to the renderer's thread, // and allows this class to process them when time permits (in a later task). DnsQueue c_string_queue_; // domain_map_ contains (for each domain) one of the next two constants, // depending on whether we have asked the browser process to do the actual // DNS lookup. static const int kLookupRequested = 0x1; static const int kPending = 0x0; typedef std::map<std::string, int> DomainUseMap; DomainUseMap domain_map_; // Cache a tally of the count of names that haven't yet been sent // for DNS pre-fetching. Note that we *could* recalculate this // count by iterating over domain_map_, looking for even values. size_t new_name_count_; // We have some metrics to examine performance. We might use // these metrics to modify buffer counts etc. some day. int buffer_full_discard_count_; int numeric_ip_discard_count_; base::WeakPtrFactory<RendererNetPredictor> weak_factory_; DISALLOW_COPY_AND_ASSIGN(RendererNetPredictor); }; // class RendererNetPredictor } // namespace dns_prefetch #endif // COMPONENTS_DNS_PREFETCH_RENDERER_RENDERER_NET_PREDICTOR_H_
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_NETWORK_PROVIDER_H_ #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_NETWORK_PROVIDER_H_ #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/supports_user_data.h" #include "content/common/content_export.h" #include "content/common/service_worker/service_worker_types.h" namespace content { class ServiceWorkerProviderContext; // A unique provider_id is generated for each instance. // Instantiated prior to the main resource load being started and remains // allocated until after the last subresource load has occurred. // This is used to track the lifetime of a Document to create // and dispose the ServiceWorkerProviderHost in the browser process // to match its lifetime. Each request coming from the Document is // tagged with this id in willSendRequest. // // Basically, it's a scoped integer that sends an ipc upon construction // and destruction. class CONTENT_EXPORT ServiceWorkerNetworkProvider : public base::SupportsUserData::Data { public: // Ownership is transferred to the DocumentState. static void AttachToDocumentState( base::SupportsUserData* document_state, scoped_ptr<ServiceWorkerNetworkProvider> network_provider); static ServiceWorkerNetworkProvider* FromDocumentState( base::SupportsUserData* document_state); ServiceWorkerNetworkProvider(int render_frame_id, ServiceWorkerProviderType type); ~ServiceWorkerNetworkProvider() override; int provider_id() const { return provider_id_; } ServiceWorkerProviderContext* context() { return context_.get(); } // This method is called for a provider that's associated with a // running service worker script. The version_id indicates which // ServiceWorkerVersion should be used. void SetServiceWorkerVersionId(int64 version_id); private: const int provider_id_; scoped_refptr<ServiceWorkerProviderContext> context_; DISALLOW_COPY_AND_ASSIGN(ServiceWorkerNetworkProvider); }; } // namespace content #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_NETWORK_PROVIDER_H_
#ifndef ALIHLTCALOCOORDINATE_H #define ALIHLTCALOCOORDINATE_H /************************************************************************** * This file is property of and copyright by the Experimental Nuclear * * Physics Group, Dep. of Physics * * University of Oslo, Norway, 2007 * * * * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.* * Contributors are mentioned in the code where appropriate. * * Please report bugs to perthi@fys.uio.no * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ #include "Rtypes.h" //struct AliHLTCaloCoordinate struct AliHLTCaloCoordinate { UShort_t fX; UShort_t fZ; UShort_t fGain; UShort_t fModuleId; }; #endif
/***************************************************************************** Copyright (c) 2014, Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***************************************************************************** * Contents: Native middle-level C interface to LAPACK function ssbevx * Author: Intel Corporation * Generated November 2015 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_ssbevx_work( int matrix_layout, char jobz, char range, char uplo, lapack_int n, lapack_int kd, float* ab, lapack_int ldab, float* q, lapack_int ldq, float vl, float vu, lapack_int il, lapack_int iu, float abstol, lapack_int* m, float* w, float* z, lapack_int ldz, float* work, lapack_int* iwork, lapack_int* ifail ) { lapack_int info = 0; if( matrix_layout == LAPACK_COL_MAJOR ) { /* Call LAPACK function and adjust info */ LAPACK_ssbevx( &jobz, &range, &uplo, &n, &kd, ab, &ldab, q, &ldq, &vl, &vu, &il, &iu, &abstol, m, w, z, &ldz, work, iwork, ifail, &info ); if( info < 0 ) { info = info - 1; } } else if( matrix_layout == LAPACK_ROW_MAJOR ) { lapack_int ncols_z = ( LAPACKE_lsame( range, 'a' ) || LAPACKE_lsame( range, 'v' ) ) ? n : ( LAPACKE_lsame( range, 'i' ) ? (iu-il+1) : 1); lapack_int ldab_t = MAX(1,kd+1); lapack_int ldq_t = MAX(1,n); lapack_int ldz_t = MAX(1,n); float* ab_t = NULL; float* q_t = NULL; float* z_t = NULL; /* Check leading dimension(s) */ if( ldab < n ) { info = -8; LAPACKE_xerbla( "LAPACKE_ssbevx_work", info ); return info; } if( ldq < n ) { info = -10; LAPACKE_xerbla( "LAPACKE_ssbevx_work", info ); return info; } if( ldz < ncols_z ) { info = -19; LAPACKE_xerbla( "LAPACKE_ssbevx_work", info ); return info; } /* Allocate memory for temporary array(s) */ ab_t = (float*)LAPACKE_malloc( sizeof(float) * ldab_t * MAX(1,n) ); if( ab_t == NULL ) { info = LAPACK_TRANSPOSE_MEMORY_ERROR; goto exit_level_0; } if( LAPACKE_lsame( jobz, 'v' ) ) { q_t = (float*)LAPACKE_malloc( sizeof(float) * ldq_t * MAX(1,n) ); if( q_t == NULL ) { info = LAPACK_TRANSPOSE_MEMORY_ERROR; goto exit_level_1; } } if( LAPACKE_lsame( jobz, 'v' ) ) { z_t = (float*) LAPACKE_malloc( sizeof(float) * ldz_t * MAX(1,ncols_z) ); if( z_t == NULL ) { info = LAPACK_TRANSPOSE_MEMORY_ERROR; goto exit_level_2; } } /* Transpose input matrices */ LAPACKE_ssb_trans( matrix_layout, uplo, n, kd, ab, ldab, ab_t, ldab_t ); /* Call LAPACK function and adjust info */ LAPACK_ssbevx( &jobz, &range, &uplo, &n, &kd, ab_t, &ldab_t, q_t, &ldq_t, &vl, &vu, &il, &iu, &abstol, m, w, z_t, &ldz_t, work, iwork, ifail, &info ); if( info < 0 ) { info = info - 1; } /* Transpose output matrices */ LAPACKE_ssb_trans( LAPACK_COL_MAJOR, uplo, n, kd, ab_t, ldab_t, ab, ldab ); if( LAPACKE_lsame( jobz, 'v' ) ) { LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, n, q_t, ldq_t, q, ldq ); } if( LAPACKE_lsame( jobz, 'v' ) ) { LAPACKE_sge_trans( LAPACK_COL_MAJOR, n, ncols_z, z_t, ldz_t, z, ldz ); } /* Release memory and exit */ if( LAPACKE_lsame( jobz, 'v' ) ) { LAPACKE_free( z_t ); } exit_level_2: if( LAPACKE_lsame( jobz, 'v' ) ) { LAPACKE_free( q_t ); } exit_level_1: LAPACKE_free( ab_t ); exit_level_0: if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_ssbevx_work", info ); } } else { info = -1; LAPACKE_xerbla( "LAPACKE_ssbevx_work", info ); } return info; }
/*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef CHANGETEXTREGISTRY_H_ #define CHANGETEXTREGISTRY_H_ #include <berryObject.h> #include "ChangeTextDescriptor.h" class ChangeTextRegistry : public berry::Object { public: ChangeTextRegistry(); ~ChangeTextRegistry(); /** * Return an "change text" descriptor with the given extension id. If no "change text" exists, * with the id return <code>null</code>. * * @param id * the id to search for * @return the descriptor or <code>null</code> */ ChangeTextDescriptor::Pointer Find(const QString& id) const; /** * Return a list of "change texts" defined in the registry. * * @return the change texts. */ QList<ChangeTextDescriptor::Pointer> GetChangeTexts() const; private: QHash<QString, ChangeTextDescriptor::Pointer> m_ListRegisteredTexts; }; #endif /*CHANGETEXTREGISTRY_H_*/
//===-- SparcMCAsmInfo.h - Sparc asm properties ----------------*- C++ -*--===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains the declaration of the SparcMCAsmInfo class. // //===----------------------------------------------------------------------===// #ifndef SPARCTARGETASMINFO_H #define SPARCTARGETASMINFO_H #include "llvm/MC/MCAsmInfoELF.h" namespace llvm { class StringRef; class SparcELFMCAsmInfo : public MCAsmInfoELF { virtual void anchor(); public: explicit SparcELFMCAsmInfo(StringRef TT); }; } // namespace llvm #endif
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef IOS_CHROME_BROWSER_WEB_IMAGE_FETCH_IMAGE_FETCH_JAVA_SCRIPT_FEATURE_H_ #define IOS_CHROME_BROWSER_WEB_IMAGE_FETCH_IMAGE_FETCH_JAVA_SCRIPT_FEATURE_H_ #include "base/callback.h" #include "base/no_destructor.h" #import "ios/web/public/js_messaging/java_script_feature.h" class GURL; // A feature which can retrieve image data from a webpage. class ImageFetchJavaScriptFeature : public web::JavaScriptFeature { public: // Returns a singleton instance of ImageFetchJavaScriptFeature which uses // ImageFetchTabHelper as its handler. static ImageFetchJavaScriptFeature* GetInstance(); class Handler { public: virtual ~Handler() = default; // Called when the webpage successfully sends back image data. |call_id| was // the token originally passed to GetImageData(). |decoded_data| is the raw // image data. |from| is a string explaining how the image data was // retrieved and may be empty. virtual void HandleJsSuccess(int call_id, std::string& decoded_data, std::string& from) = 0; // Called when the webpage fails to retrieve image data. |call_id| was the // token originally passed to GetImageData(). virtual void HandleJsFailure(int call_id) = 0; }; // Gets image data in binary format by trying 2 JavaScript methods in order: // 1. Draw <img> to <canvas> and export its data; // 2. Download the image by XMLHttpRequest and hopefully get responded from // cache. // |url| should be equal to the resolved "src" attribute of <img>, otherwise // method 1 will fail. |call_id| is an opaque token that will be passed back // along with the response. // // Upon success or failure, this will invoke the appropriate Handler method. void GetImageData(web::WebState* web_state, int call_id, const GURL& url); private: // Tests are added as friends so that they can call the // ImageFetchJavaScriptFeature constructor, rather than relying on the // singleton instance. friend class ImageFetchTabHelperTest; friend class ImageFetchJavaScriptFeatureTest; friend class base::NoDestructor<ImageFetchJavaScriptFeature>; // Constructs an ImageFetchJavaScriptFeature which uses the given // |handler_factory|. Production code will generally install a factory which // returns the ImageFetchTabHelper for the given WebState, while test code can // install a custom factory to make testing easier. |handler_factory| can // return nullptr and will always be passed a non-nullptr WebState. ImageFetchJavaScriptFeature( base::RepeatingCallback<Handler*(web::WebState*)> handler_factory); ~ImageFetchJavaScriptFeature() override; ImageFetchJavaScriptFeature(const ImageFetchJavaScriptFeature&) = delete; ImageFetchJavaScriptFeature& operator=(const ImageFetchJavaScriptFeature&) = delete; // JavaScriptFeature: absl::optional<std::string> GetScriptMessageHandlerName() const override; void ScriptMessageReceived(web::WebState* web_state, const web::ScriptMessage& message) override; base::RepeatingCallback<Handler*(web::WebState*)> handler_factory_; }; #endif // IOS_CHROME_BROWSER_WEB_IMAGE_FETCH_IMAGE_FETCH_JAVA_SCRIPT_FEATURE_H_
/* * Copyright 2011, The Android Open Source Project * * 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 <fcntl.h> #include <sys/ioctl.h> #include <sys/mount.h> /* for BLKGETSIZE */ #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include <cutils/properties.h> static int only_one_char(char *buf, int len, char c) { int i, ret; ret = 1; for (i=0; i<len; i++) { if (buf[i] != c) { ret = 0; break; } } return ret; } int partition_wiped(char *source) { char buf[4096]; int fd, ret; if ((fd = open(source, O_RDONLY)) < 0) { return 0; } ret = read(fd, buf, sizeof(buf)); close(fd); if (ret != sizeof(buf)) { return 0; } /* Check for all zeros */ if (only_one_char(buf, sizeof(buf), 0)) { return 1; } /* Check for all ones */ if (only_one_char(buf, sizeof(buf), 0xff)) { return 1; } return 0; }
#ifndef MASTER_INTERFACE_H #define MASTER_INTERFACE_H /* We are attempting semi-compatibility with Postfix's master process here. Whether this is useful or not remains to be seen. */ /* Child processes should send status updates whenever they accept a new connection (decrease available_count) and when they close existing connection (increase available_count). */ struct master_status { pid_t pid; /* uid is used to check for old/invalid status messages */ unsigned int uid; /* number of new connections process is currently accepting */ unsigned int available_count; }; /* When connecting to log service, send this handshake first */ struct log_service_handshake { /* If magic is invalid, assume the data is already what we want to log */ #define MASTER_LOG_MAGIC 0x02ff03fe unsigned int log_magic; /* Add this prefix to each logged line */ #define MASTER_LOG_PREFIX_NAME "MASTER" unsigned int prefix_len; /* unsigned char prefix[]; */ }; enum master_login_state { MASTER_LOGIN_STATE_NONFULL = 0, MASTER_LOGIN_STATE_FULL }; /* getenv(MASTER_IS_PARENT_ENV) != NULL if process was started by Dovecot master */ #define MASTER_IS_PARENT_ENV "DOVECOT_CHILD_PROCESS" /* getenv(MASTER_UID_ENV) provides master_status.uid value */ #define MASTER_UID_ENV "GENERATION" /* getenv(MASTER_CLIENT_LIMIT_ENV) provides maximum master_status.available_count as specified in configuration file */ #define MASTER_CLIENT_LIMIT_ENV "CLIENT_LIMIT" /* getenv(MASTER_PROCESS_LIMIT_ENV) specifies how many processes of this type can be created before reaching the limit */ #define MASTER_PROCESS_LIMIT_ENV "PROCESS_LIMIT" /* getenv(MASTER_PROCESS_MIN_AVAIL_ENV) specifies how many processes of this type are created at startup and are kept running all the time */ #define MASTER_PROCESS_MIN_AVAIL_ENV "PROCESS_MIN_AVAIL" /* getenv(MASTER_SERVICE_COUNT_ENV) specifies how many client connections the process can finish handling before it should kill itself. */ #define MASTER_SERVICE_COUNT_ENV "SERVICE_COUNT" /* getenv(MASTER_SERVICE_IDLE_KILL_ENV) specifies service's idle_kill timeout in seconds. */ #define MASTER_SERVICE_IDLE_KILL_ENV "IDLE_KILL" /* getenv(MASTER_CONFIG_FILE_ENV) provides path to configuration file/socket */ #define MASTER_CONFIG_FILE_ENV "CONFIG_FILE" /* getenv(MASTER_DOVECOT_VERSION_ENV) provides master's version number (unset if version_ignore=yes) */ #define MASTER_DOVECOT_VERSION_ENV "DOVECOT_VERSION" /* getenv(MASTER_SSL_KEY_PASSWORD_ENV) returns manually typed SSL key password, if dovecot was started with -p parameter. */ #define MASTER_SSL_KEY_PASSWORD_ENV "SSL_KEY_PASSWORD" /* getenv(DOVECOT_PRESERVE_ENVS_ENV) returns a space separated list of environments that should be preserved. */ #define DOVECOT_PRESERVE_ENVS_ENV "DOVECOT_PRESERVE_ENVS" /* Write pipe to anvil. */ #define MASTER_ANVIL_FD 3 /* Anvil reads new log fds from this fd */ #define MASTER_ANVIL_LOG_FDPASS_FD 4 /* Master's "all processes full" notification fd for login processes */ #define MASTER_LOGIN_NOTIFY_FD 4 /* Shared pipe to master, used to send master_status reports */ #define MASTER_STATUS_FD 5 /* Pipe to master, used to detect when it dies. (MASTER_STATUS_FD would have been fine for this, except it's inefficient in Linux) */ #define MASTER_DEAD_FD 6 /* First file descriptor where process is expected to be listening. The file descriptor count is given in -s parameter, defaulting to 1. master_status.available_count reports how many accept()s we're still accepting. Once no children are listening, master will do it and create new child processes when needed. */ #define MASTER_LISTEN_FD_FIRST 7 /* Timeouts: base everything on how long we can wait for login clients. */ #define MASTER_LOGIN_TIMEOUT_SECS (3*60) /* auth server should abort auth requests before that happens */ #define MASTER_AUTH_SERVER_TIMEOUT_SECS (MASTER_LOGIN_TIMEOUT_SECS - 30) /* auth clients should abort auth lookups after server was supposed to have done that */ #define MASTER_AUTH_LOOKUP_TIMEOUT_SECS (MASTER_AUTH_SERVER_TIMEOUT_SECS + 5) #endif
/* Copyright (c) 2007 Christopher J. W. Lloyd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import <Foundation/NSIndexSet.h> @interface NSMutableIndexSet : NSIndexSet { NSUInteger _capacity; } - (void)addIndexesInRange:(NSRange)range; - (void)addIndexes:(NSIndexSet *)other; - (void)addIndex:(NSUInteger)index; - (void)removeAllIndexes; - (void)removeIndexesInRange:(NSRange)range; - (void)removeIndexes:(NSIndexSet *)other; - (void)removeIndex:(NSUInteger)index; - (void)shiftIndexesStartingAtIndex:(NSUInteger)index by:(NSInteger)delta; - (void)encodeWithCoder:(NSCoder *)coder; - (id)initWithCoder:(NSCoder *)coder; @end
// // PlotGalleryController.h // CorePlotGallery // // Created by Jeff Buck on 9/5/10. // Copyright 2010 Jeff Buck. All rights reserved. // #import <Cocoa/Cocoa.h> #import <CorePlot/CorePlot.h> #import <Quartz/Quartz.h> #import "PlotGallery.h" #import "PlotView.h" @interface PlotGalleryController : NSObject<NSSplitViewDelegate, PlotViewDelegate> { @private IBOutlet NSSplitView *splitView; IBOutlet NSScrollView *scrollView; IBOutlet IKImageBrowserView *imageBrowser; IBOutlet NSPopUpButton *themePopUpButton; IBOutlet PlotView *hostingView; PlotItem *plotItem; NSString *currentThemeName; } @property (nonatomic, retain) PlotItem *plotItem; @property (nonatomic, copy) NSString *currentThemeName; -(IBAction)themeSelectionDidChange:(id)sender; @end
#ifndef __ASMPARISC_ELF_H #define __ASMPARISC_ELF_H /* * ELF register definitions.. */ #include <asm/ptrace.h> #define EM_PARISC 15 #define ELF_NGREG 32 #define ELF_NFPREG 32 typedef unsigned long elf_greg_t; typedef elf_greg_t elf_gregset_t[ELF_NGREG]; typedef double elf_fpreg_t; typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; #define ELF_CORE_COPY_REGS(gregs, regs) \ memcpy(gregs, regs, \ sizeof(struct pt_regs) < sizeof(elf_gregset_t)? \ sizeof(struct pt_regs): sizeof(elf_gregset_t)); /* * This is used to ensure we don't load something for the wrong architecture. * * Note that this header file is used by default in fs/binfmt_elf.c. So * the following macros are for the default case. However, for the 64 * bit kernel we also support 32 bit parisc binaries. To do that * arch/parisc64/kernel/binfmt_elf32.c defines its own set of these * macros, and then if includes fs/binfmt_elf.c to provide an alternate * elf binary handler for 32 bit binaries (on the 64 bit kernel). */ #ifdef __LP64__ #define ELF_CLASS ELFCLASS64 #else #define ELF_CLASS ELFCLASS32 #endif #define elf_check_arch(x) ((x)->e_machine == EM_PARISC && (x)->e_ident[EI_CLASS] == ELF_CLASS) /* * These are used to set parameters in the core dumps. */ #define ELF_DATA ELFDATA2MSB #define ELF_ARCH EM_PARISC /* %r23 is set by ld.so to a pointer to a function which might be registered using atexit. This provides a mean for the dynamic linker to call DT_FINI functions for shared libraries that have been loaded before the code runs. So that we can use the same startup file with static executables, we start programs with a value of 0 to indicate that there is no such function. */ #define ELF_PLAT_INIT(_r) _r->gr[23] = 0 #define USE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE 4096 /* This is the location that an ET_DYN program is loaded if exec'ed. Typical use of this is to invoke "./ld.so someprog" to test out a new version of the loader. We need to make sure that it is out of the way of the program that it will "exec", and that there is sufficient room for the brk. (2 * TASK_SIZE / 3) turns into something undefined when run through a 32 bit preprocessor and in some cases results in the kernel trying to map ld.so to the kernel virtual base. Use a sane value instead. /Jes */ #define ELF_ET_DYN_BASE (TASK_UNMAPPED_BASE + 0x01000000) /* This yields a mask that user programs can use to figure out what instruction set this CPU supports. This could be done in user space, but it's not easy, and we've already done it here. */ #define ELF_HWCAP 0 /* (boot_cpu_data.x86_capability) */ /* This yields a string that ld.so will use to load implementation specific libraries for optimization. This is more specific in intent than poking at uname or /proc/cpuinfo. For the moment, we have only optimizations for the Intel generations, but that could change... */ #define ELF_PLATFORM ("PARISC\0" /*+((boot_cpu_data.x86-3)*5) */) #ifdef __KERNEL__ #define SET_PERSONALITY(ex, ibcs2) \ current->personality = PER_LINUX #endif #endif
/******************************** -*- C -*- **************************** * * Header for memory allocation within separate mmap'ed regions * * ***********************************************************************/ /*********************************************************************** * * Copyright 2000, 2001, 2002, 2006 Free Software Foundation, Inc. * Written by Paolo Bonzini. * * This file is part of GNU Smalltalk. * * GNU Smalltalk 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. * * Linking GNU Smalltalk statically or dynamically with other modules is * making a combined work based on GNU Smalltalk. Thus, the terms and * conditions of the GNU General Public License cover the whole * combination. * * In addition, as a special exception, the Free Software Foundation * give you permission to combine GNU Smalltalk with free software * programs or libraries that are released under the GNU LGPL and with * independent programs running under the GNU Smalltalk virtual machine. * * You may copy and distribute such a system following the terms of the * GNU GPL for GNU Smalltalk and the licenses of the other code * concerned, provided that you include the source code of that other * code when and as the GNU GPL requires distribution of source code. * * Note that people who make modified versions of GNU Smalltalk are not * obligated to grant this special exception for their modified * versions; it is their choice whether to do so. The GNU General * Public License gives permission to release a modified version without * this exception; this exception also makes it possible to release a * modified version which carries forward this exception. * * GNU Smalltalk 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 Smalltalk; see the file COPYING. If not, write to the Free Software * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ***********************************************************************/ #ifndef GST_HEAP_H #define GST_HEAP_H typedef char *heap; /* Initialize access to a heap managed region of the given SIZE, trying to put it at the specified address. On success, returns a "heap descriptor" which is used in subsequent calls to other heap package functions. It is explicitly "char *" so that users of the package don't have to worry about the actual implementation details. On failure returns NULL. */ extern heap _gst_heap_create (PTR address, int size) ATTRIBUTE_HIDDEN; /* Terminate access to a heap managed region by unmapping all memory pages associated with the region, and closing the file descriptor if it is one that we opened. Returns NULL on success. Returns the heap descriptor on failure, which can subsequently be used for further action. */ extern heap _gst_heap_destroy (heap hd) ATTRIBUTE_HIDDEN; /* Get core for the memory region specified by HD, using SIZE as the amount to either add to or subtract from the existing region. Works like sbrk(), but using mmap() if HD is not NULL. */ extern PTR _gst_heap_sbrk (heap hd, size_t size) ATTRIBUTE_HIDDEN; #endif /* GST_HEAP_H */
#pragma once /* * 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 St, Fifth Floor, Boston, MA 02110-1301, USA */ /** * $Id$ * * @file lib/server/radmin.h * @brief Administration tools * * @copyright 2018 The FreeRADIUS server project * @copyright 2018 Alan DeKok (aland@freeradius.org) */ RCSIDH(radmin_h, "$Id$") #include <freeradius-devel/server/command.h> #ifdef __cplusplus extern "C" { #endif /* * For radmin over TCP. */ #define FR_RADMIN_PORT 18120 int fr_radmin_start(main_config_t *config, bool cli); void fr_radmin_stop(void); int fr_radmin_register(TALLOC_CTX *talloc_ctx, char const *name, void *ctx, fr_cmd_table_t *table); int fr_radmin_run(fr_cmd_info_t *info, FILE *fp, FILE *fp_err, char *command, bool read_only); void fr_radmin_help(FILE *fp, char const *text); void fr_radmin_complete(FILE *fp, const char *text, int start); #ifdef __cplusplus } #endif
/* * Dallas Semiconductors 1603 RTC driver * * Brian Murphy <brian@murphy.dk> * */ #include <linux/kernel.h> #include <asm/lasat/lasat.h> #include <linux/delay.h> #include <asm/lasat/ds1603.h> #include "ds1603.h" #define READ_TIME_CMD 0x81 #define SET_TIME_CMD 0x80 #define TRIMMER_SET_CMD 0xC0 #define TRIMMER_VALUE_MASK 0x38 #define TRIMMER_SHIFT 3 struct ds_defs *ds1603 = NULL; /* HW specific register functions */ static void rtc_reg_write(unsigned long val) { *ds1603->reg = val; } static unsigned long rtc_reg_read(void) { unsigned long tmp = *ds1603->reg; return tmp; } static unsigned long rtc_datareg_read(void) { unsigned long tmp = *ds1603->data_reg; return tmp; } static void rtc_nrst_high(void) { rtc_reg_write(rtc_reg_read() | ds1603->rst); } static void rtc_nrst_low(void) { rtc_reg_write(rtc_reg_read() & ~ds1603->rst); } static void rtc_cycle_clock(unsigned long data) { data |= ds1603->clk; rtc_reg_write(data); ndelay(250); if (ds1603->data_reversed) data &= ~ds1603->data; else data |= ds1603->data; data &= ~ds1603->clk; rtc_reg_write(data); ndelay(250 + ds1603->huge_delay); } static void rtc_write_databit(unsigned int bit) { unsigned long data = rtc_reg_read(); if (ds1603->data_reversed) bit = !bit; if (bit) data |= ds1603->data; else data &= ~ds1603->data; rtc_reg_write(data); ndelay(50 + ds1603->huge_delay); rtc_cycle_clock(data); } static unsigned int rtc_read_databit(void) { unsigned int data; data = (rtc_datareg_read() & (1 << ds1603->data_read_shift)) >> ds1603->data_read_shift; rtc_cycle_clock(rtc_reg_read()); return data; } static void rtc_write_byte(unsigned int byte) { int i; for (i = 0; i<=7; i++) { rtc_write_databit(byte & 1L); byte >>= 1; } } static void rtc_write_word(unsigned long word) { int i; for (i = 0; i<=31; i++) { rtc_write_databit(word & 1L); word >>= 1; } } static unsigned long rtc_read_word(void) { int i; unsigned long word = 0; unsigned long shift = 0; for (i = 0; i<=31; i++) { word |= rtc_read_databit() << shift; shift++; } return word; } static void rtc_init_op(void) { rtc_nrst_high(); rtc_reg_write(rtc_reg_read() & ~ds1603->clk); ndelay(50); } static void rtc_end_op(void) { rtc_nrst_low(); ndelay(1000); } /* interface */ unsigned long ds1603_read(void) { unsigned long word; rtc_init_op(); rtc_write_byte(READ_TIME_CMD); word = rtc_read_word(); rtc_end_op(); return word; } int ds1603_set(unsigned long time) { rtc_init_op(); rtc_write_byte(SET_TIME_CMD); rtc_write_word(time); rtc_end_op(); return 0; } void ds1603_set_trimmer(unsigned int trimval) { rtc_init_op(); rtc_write_byte(((trimval << TRIMMER_SHIFT) & TRIMMER_VALUE_MASK) | (TRIMMER_SET_CMD)); rtc_end_op(); } void ds1603_disable(void) { ds1603_set_trimmer(TRIMMER_DISABLE_RTC); } void ds1603_enable(void) { ds1603_set_trimmer(TRIMMER_DEFAULT); }
/* <!-- copyright */ /* * aria2 - The high speed download utility * * Copyright (C) 2006 Tatsuhiro Tsujikawa * * 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 * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. */ /* copyright --> */ #ifndef D_BT_REQUEST_MESSAGE_H #define D_BT_REQUEST_MESSAGE_H #include "RangeBtMessage.h" namespace aria2 { class BtRequestMessage : public RangeBtMessage { private: size_t blockIndex_; public: BtRequestMessage(size_t index = 0, int32_t begin = 0, int32_t length = 0, size_t blockIndex = 0); static const uint8_t ID = 6; static const char NAME[]; size_t getBlockIndex() const { return blockIndex_; } void setBlockIndex(size_t blockIndex) { blockIndex_ = blockIndex; } static std::unique_ptr<BtRequestMessage> create (const unsigned char* data, size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; virtual void onQueued() CXX11_OVERRIDE; virtual void onAbortOutstandingRequestEvent (const BtAbortOutstandingRequestEvent& event) CXX11_OVERRIDE; }; } // namespace aria2 #endif // D_BT_REQUEST_MESSAGE_H
/* Tests to check the utilization of the addc and subc instructions. If everything works as expected we won't see any movt instructions in these cases. */ /* { dg-do compile } */ /* { dg-options "-O1" } */ /* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } } */ /* { dg-final { scan-assembler-times "addc" 1 } } */ /* { dg-final { scan-assembler-times "subc" 1 } } */ /* { dg-final { scan-assembler-not "movt" } } */ int test_000 (int* x, unsigned int c) { /* 1x addc */ int s = 0; unsigned int i; for (i = 0; i < c; ++i) s += ! (x[i] & 0x3000); return s; } int test_001 (int* x, unsigned int c) { /* 1x subc */ int s = 0; unsigned int i; for (i = 0; i < c; ++i) s -= ! (x[i] & 0x3000); return s; }
/* * arch/sh/kernel/cpu/init.c * * CPU init code * * Copyright (C) 2002, 2003 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/init.h> #include <linux/kernel.h> #include <asm/processor.h> #include <asm/uaccess.h> #include <asm/system.h> #include <asm/cacheflush.h> #include <asm/cache.h> #include <asm/io.h> extern void detect_cpu_and_cache_system(void); /* * Generic wrapper for command line arguments to disable on-chip * peripherals (nofpu, nodsp, and so forth). */ #define onchip_setup(x) \ static int x##_disabled __initdata = 0; \ \ static int __init x##_setup(char *opts) \ { \ x##_disabled = 1; \ return 1; \ } \ __setup("no" __stringify(x), x##_setup); onchip_setup(fpu); onchip_setup(dsp); /* * Generic first-level cache init */ static void __init cache_init(void) { unsigned long ccr, flags; if (cpu_data->type == CPU_SH_NONE) panic("Unknown CPU"); jump_to_P2(); ccr = ctrl_inl(CCR); /* * If the cache is already enabled .. flush it. */ if (ccr & CCR_CACHE_ENABLE) { unsigned long ways, waysize, addrstart; waysize = cpu_data->dcache.sets; /* * If the OC is already in RAM mode, we only have * half of the entries to flush.. */ if (ccr & CCR_CACHE_ORA) waysize >>= 1; waysize <<= cpu_data->dcache.entry_shift; #ifdef CCR_CACHE_EMODE /* If EMODE is not set, we only have 1 way to flush. */ if (!(ccr & CCR_CACHE_EMODE)) ways = 1; else #endif ways = cpu_data->dcache.ways; addrstart = CACHE_OC_ADDRESS_ARRAY; do { unsigned long addr; for (addr = addrstart; addr < addrstart + waysize; addr += cpu_data->dcache.linesz) ctrl_outl(0, addr); addrstart += cpu_data->dcache.way_incr; } while (--ways); } /* * Default CCR values .. enable the caches * and invalidate them immediately.. */ flags = CCR_CACHE_ENABLE | CCR_CACHE_INVALIDATE; #ifdef CCR_CACHE_EMODE /* Force EMODE if possible */ if (cpu_data->dcache.ways > 1) flags |= CCR_CACHE_EMODE; #endif #ifdef CONFIG_SH_WRITETHROUGH /* Turn on Write-through caching */ flags |= CCR_CACHE_WT; #else /* .. or default to Write-back */ flags |= CCR_CACHE_CB; #endif #ifdef CONFIG_SH_OCRAM /* Turn on OCRAM -- halve the OC */ flags |= CCR_CACHE_ORA; cpu_data->dcache.sets >>= 1; #endif ctrl_outl(flags, CCR); back_to_P1(); } #ifdef CONFIG_SH_DSP static void __init release_dsp(void) { unsigned long sr; /* Clear SR.DSP bit */ __asm__ __volatile__ ( "stc\tsr, %0\n\t" "and\t%1, %0\n\t" "ldc\t%0, sr\n\t" : "=&r" (sr) : "r" (~SR_DSP) ); } static void __init dsp_init(void) { unsigned long sr; /* * Set the SR.DSP bit, wait for one instruction, and then read * back the SR value. */ __asm__ __volatile__ ( "stc\tsr, %0\n\t" "or\t%1, %0\n\t" "ldc\t%0, sr\n\t" "nop\n\t" "stc\tsr, %0\n\t" : "=&r" (sr) : "r" (SR_DSP) ); /* If the DSP bit is still set, this CPU has a DSP */ if (sr & SR_DSP) cpu_data->flags |= CPU_HAS_DSP; /* Now that we've determined the DSP status, clear the DSP bit. */ release_dsp(); } #endif /* CONFIG_SH_DSP */ /** * sh_cpu_init * * This is our initial entry point for each CPU, and is invoked on the boot * CPU prior to calling start_kernel(). For SMP, a combination of this and * start_secondary() will bring up each processor to a ready state prior * to hand forking the idle loop. * * We do all of the basic processor init here, including setting up the * caches, FPU, DSP, kicking the UBC, etc. By the time start_kernel() is * hit (and subsequently platform_setup()) things like determining the * CPU subtype and initial configuration will all be done. * * Each processor family is still responsible for doing its own probing * and cache configuration in detect_cpu_and_cache_system(). */ asmlinkage void __init sh_cpu_init(void) { /* First, probe the CPU */ detect_cpu_and_cache_system(); /* Init the cache */ cache_init(); /* Disable the FPU */ if (fpu_disabled) { printk("FPU Disabled\n"); cpu_data->flags &= ~CPU_HAS_FPU; disable_fpu(); } /* FPU initialization */ if ((cpu_data->flags & CPU_HAS_FPU)) { clear_thread_flag(TIF_USEDFPU); clear_used_math(); } #ifdef CONFIG_SH_DSP /* Probe for DSP */ dsp_init(); /* Disable the DSP */ if (dsp_disabled) { printk("DSP Disabled\n"); cpu_data->flags &= ~CPU_HAS_DSP; release_dsp(); } #endif #ifdef CONFIG_UBC_WAKEUP /* * Some brain-damaged loaders decided it would be a good idea to put * the UBC to sleep. This causes some issues when it comes to things * like PTRACE_SINGLESTEP or doing hardware watchpoints in GDB. So .. * we wake it up and hope that all is well. */ ubc_wakeup(); #endif }
/* { dg-require-effective-target arm_v8_1m_mve_ok } */ /* { dg-add-options arm_v8_1m_mve } */ /* { dg-additional-options "-O2" } */ #include "arm_mve.h" uint32x4_t foo (uint16_t const * base, uint32x4_t offset, mve_pred16_t p) { return vldrhq_gather_offset_z_u32 (base, offset, p); } /* { dg-final { scan-assembler "vldrht.u32" } } */ uint32x4_t foo1 (uint16_t const * base, uint32x4_t offset, mve_pred16_t p) { return vldrhq_gather_offset_z (base, offset, p); } /* { dg-final { scan-assembler "vldrht.u32" } } */
/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU General ** Public License version 3.0 as published by the Free Software Foundation ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: ** http://www.gnu.org/copyleft/gpl.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QWINDOWDEFS_WIN_H #define QWINDOWDEFS_WIN_H #include <QtCore/qglobal.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Gui) QT_END_NAMESPACE #if !defined(Q_NOWINSTRICT) #define Q_WINSTRICT #endif #if defined(Q_WINSTRICT) #if !defined(STRICT) #define STRICT #endif #undef NO_STRICT #define Q_DECLARE_HANDLE(name) struct name##__; typedef struct name##__ *name #else #if !defined(NO_STRICT) #define NO_STRICT #endif #undef STRICT #define Q_DECLARE_HANDLE(name) typedef HANDLE name #endif #ifndef HINSTANCE Q_DECLARE_HANDLE(HINSTANCE); #endif #ifndef HDC Q_DECLARE_HANDLE(HDC); #endif #ifndef HWND Q_DECLARE_HANDLE(HWND); #endif #ifndef HFONT Q_DECLARE_HANDLE(HFONT); #endif #ifndef HPEN Q_DECLARE_HANDLE(HPEN); #endif #ifndef HBRUSH Q_DECLARE_HANDLE(HBRUSH); #endif #ifndef HBITMAP Q_DECLARE_HANDLE(HBITMAP); #endif #ifndef HICON Q_DECLARE_HANDLE(HICON); #endif #ifndef HCURSOR typedef HICON HCURSOR; #endif #ifndef HPALETTE Q_DECLARE_HANDLE(HPALETTE); #endif #ifndef HRGN Q_DECLARE_HANDLE(HRGN); #endif #ifndef HMONITOR Q_DECLARE_HANDLE(HMONITOR); #endif #ifndef HRESULT typedef long HRESULT; #endif typedef struct tagMSG MSG; typedef HWND WId; QT_BEGIN_NAMESPACE Q_CORE_EXPORT HINSTANCE qWinAppInst(); Q_CORE_EXPORT HINSTANCE qWinAppPrevInst(); Q_CORE_EXPORT int qWinAppCmdShow(); Q_GUI_EXPORT HDC qt_win_display_dc(); QT_END_NAMESPACE QT_END_HEADER #endif // QWINDOWDEFS_WIN_H
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QBACKINGSTORE_COCOA_H #define QBACKINGSTORE_COCOA_H #include <Cocoa/Cocoa.h> #include "qcocoawindow.h" #include "qnsview.h" #include <qpa/qplatformbackingstore.h> QT_BEGIN_NAMESPACE class QCocoaBackingStore : public QPlatformBackingStore { public: QCocoaBackingStore(QWindow *window); ~QCocoaBackingStore(); QPaintDevice *paintDevice(); void flush(QWindow *widget, const QRegion &region, const QPoint &offset); QImage toImage() const; void resize (const QSize &size, const QRegion &); bool scroll(const QRegion &area, int dx, int dy); void beginPaint(const QRegion &region); void beforeBeginPaint(QWindow *widget); void afterEndPaint(QWindow *widget); qreal getBackingStoreDevicePixelRatio(); private: QImage m_qImage; QSize m_requestedSize; bool m_imageWasEqual; }; QT_END_NAMESPACE #endif
/* -*- c++ -*- */ /* * Copyright 2015 Free Software Foundation, Inc. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_DTV_DVBT_BIT_INNER_DEINTERLEVER_IMPL_H #define INCLUDED_DTV_DVBT_BIT_INNER_DEINTERLEVER_IMPL_H #include <gnuradio/dtv/dvbt_bit_inner_deinterleaver.h> #include "dvbt_configure.h" namespace gr { namespace dtv { class dvbt_bit_inner_deinterleaver_impl : public dvbt_bit_inner_deinterleaver { private: const dvbt_configure config; int d_nsize; dvbt_hierarchy_t d_hierarchy; // constellation int d_v; // Bit interleaver block size static const int d_bsize; // Table to keep interleaved indices unsigned char * d_perm; // Permutation function int H(int e, int w); public: dvbt_bit_inner_deinterleaver_impl(int nsize, dvb_constellation_t constellation, dvbt_hierarchy_t hierarchy, dvbt_transmission_mode_t transmission); ~dvbt_bit_inner_deinterleaver_impl(); void forecast (int noutput_items, gr_vector_int &ninput_items_required); int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); }; } // namespace dtv } // namespace gr #endif /* INCLUDED_DTV_DVBT_BIT_INNER_DEINTERLEVER_IMPL_H */
#ifndef EVENTOBJECT_H #define EVENTOBJECT_H #include <pthread.h> #include <cvd/synchronized.h> namespace CVD { //! Encapsulation of a condition variable and its boolean condition. class EventObject : public Synchronized { public: //! Construct an initially untriggered event. EventObject(); virtual ~EventObject(); //! Set the condition boolean to true and wake up one thread waiting on the event. void trigger(); //! Set the condition boolean to true and wake up all threads waiting on the event. void triggerAll(); //! Block until the condition is true. Reset the condition before returning. void wait(); //! Block until the condition is true or the specified timeout has elapsed. Reset the condition before returning if the condition became true. bool wait(unsigned int milli); protected: pthread_cond_t myCondVar; }; } #endif
/***************************************************************************** * Author: Vadim Zeitlin <vadim@wxwidgets.org> * ***************************************************************************** * Copyright (c) 2004 Vadim Zeitlin * * This library is free software; you can distribute it and/or modify it under * the terms of the GNU Lesser General Public License (LGPL), 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 LGPL in the file COPYING for more * details. * */ #ifndef _Mutex_incl_ #define _Mutex_incl_ #include <rlog/common.h> #ifdef _WIN32 #include <windows.h> // conflict with our own ERROR... #undef ERROR typedef CRITICAL_SECTION rlog_mutex_t; #define rlog_mutex_init InitializeCriticalSection #define rlog_mutex_destroy DeleteCriticalSection #define rlog_mutex_lock EnterCriticalSection #define rlog_mutex_unlock LeaveCriticalSection #else #include <pthread.h> typedef pthread_mutex_t rlog_mutex_t; #define rlog_mutex_init(m) pthread_mutex_init((m), 0) #define rlog_mutex_destroy pthread_mutex_destroy #define rlog_mutex_lock pthread_mutex_lock #define rlog_mutex_unlock pthread_mutex_unlock #endif namespace rlog { /*! @class Mutex @brief Class encapsulating a critical section under Win32 or a mutex under Unix. This class should never be used standalone but always passed to Lock, see the example there. */ class RLOG_DECL Mutex { public: Mutex() { rlog_mutex_init(&m_mutex); } ~Mutex() { rlog_mutex_destroy(&m_mutex); } void Lock() { rlog_mutex_lock(&m_mutex); } void Unlock() { rlog_mutex_unlock(&m_mutex); } private: rlog_mutex_t m_mutex; Mutex( const Mutex & ); Mutex & operator = ( const Mutex & ); }; } // namespace rlog #endif // _Mutex_incl_
//========= Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: Base class for simple projectiles // // $NoKeywords: $ //=============================================================================// #ifndef CBASESPRITEPROJECTILE_H #define CBASESPRITEPROJECTILE_H #ifdef _WIN32 #pragma once #endif #include "Sprite.h" enum MoveType_t; enum MoveCollide_t; //============================================================================= //============================================================================= class CBaseSpriteProjectile : public CSprite { DECLARE_DATADESC(); DECLARE_CLASS( CBaseSpriteProjectile, CSprite ); public: void Touch( CBaseEntity *pOther ); virtual void HandleTouch( CBaseEntity *pOther ); void Think(); virtual void HandleThink(); void Spawn( char *pszModel, const Vector &vecOrigin, const Vector &vecVelocity, edict_t *pOwner, MoveType_t iMovetype, MoveCollide_t nMoveCollide, int iDamage, int iDamageType, CBaseEntity *pIntendedTarget = NULL ); virtual void Precache( void ) {}; int m_iDmg; int m_iDmgType; EHANDLE m_hIntendedTarget; }; #endif // CBASESPRITEPROJECTILE_H
/* * Copyright (C) 2007 The Android Open Source Project * * 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. */ /* * Read-only access to Zip archives, with minimal heap allocation. * * This is similar to the more-complete ZipFile class, but no attempt * has been made to make them interchangeable. This class operates under * a very different set of assumptions and constraints. * * One such assumption is that if you're getting file descriptors for * use with this class as a child of a fork() operation, you must be on * a pread() to guarantee correct operation. This is because pread() can * atomically read at a file offset without worrying about a lock around an * lseek() + read() pair. */ #ifndef __LIBS_ZIPFILERO_H #define __LIBS_ZIPFILERO_H #include <utils/Compat.h> #include <utils/Errors.h> #include <utils/FileMap.h> #include <utils/threads.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <time.h> typedef void* ZipArchiveHandle; namespace android { /* * Trivial typedef to ensure that ZipEntryRO is not treated as a simple * integer. We use NULL to indicate an invalid value. */ typedef void* ZipEntryRO; /* * Open a Zip archive for reading. * * Implemented as a thin wrapper over system/core/libziparchive. * * "open" and "find entry by name" are fast operations and use as little * memory as possible. * * We also support fast iteration over all entries in the file (with a * stable, but unspecified iteration order). * * NOTE: If this is used on file descriptors inherited from a fork() operation, * you must be on a platform that implements pread() to guarantee correctness * on the shared file descriptors. */ class ZipFileRO { public: /* Zip compression methods we support */ enum : uint16_t { kCompressStored = 0, kCompressDeflated = 8 }; /* * Open an archive. */ static ZipFileRO* open(const char* zipFileName); /* * Find an entry, by name. Returns the entry identifier, or NULL if * not found. */ ZipEntryRO findEntryByName(const char* entryName) const; /* * Start iterating over the list of entries in the zip file. Requires * a matching call to endIteration with the same cookie. */ bool startIteration(void** cookie); bool startIteration(void** cookie, const char* prefix, const char* suffix); /** * Return the next entry in iteration order, or NULL if there are no more * entries in this archive. */ ZipEntryRO nextEntry(void* cookie); void endIteration(void* cookie); void releaseEntry(ZipEntryRO entry) const; /* * Return the #of entries in the Zip archive. */ int getNumEntries(); /* * Copy the filename into the supplied buffer. Returns 0 on success, * -1 if "entry" is invalid, or the filename length if it didn't fit. The * length, and the returned string, include the null-termination. */ int getEntryFileName(ZipEntryRO entry, char* buffer, size_t bufLen) const; /* * Get the vital stats for an entry. Pass in NULL pointers for anything * you don't need. * * "*pOffset" holds the Zip file offset of the entry's data. * * Returns "false" if "entry" is bogus or if the data in the Zip file * appears to be bad. */ bool getEntryInfo(ZipEntryRO entry, uint16_t* pMethod, uint32_t* pUncompLen, uint32_t* pCompLen, off64_t* pOffset, uint32_t* pModWhen, uint32_t* pCrc32) const; /* * Create a new FileMap object that maps a subset of the archive. For * an uncompressed entry this effectively provides a pointer to the * actual data, for a compressed entry this provides the input buffer * for inflate(). */ FileMap* createEntryFileMap(ZipEntryRO entry) const; /* * Uncompress the data into a buffer. Depending on the compression * format, this is either an "inflate" operation or a memcpy. * * Use "uncompLen" from getEntryInfo() to determine the required * buffer size. * * Returns "true" on success. */ bool uncompressEntry(ZipEntryRO entry, void* buffer, size_t size) const; /* * Uncompress the data to an open file descriptor. */ bool uncompressEntry(ZipEntryRO entry, int fd) const; ~ZipFileRO(); private: /* these are private and not defined */ ZipFileRO(const ZipFileRO& src); ZipFileRO& operator=(const ZipFileRO& src); ZipFileRO(ZipArchiveHandle handle, char* fileName) : mHandle(handle), mFileName(fileName) { } const ZipArchiveHandle mHandle; char* mFileName; }; }; // namespace android #endif /*__LIBS_ZIPFILERO_H*/
/* Copyright (c) 2013 The Chromium Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" #if defined(__native_client__) && defined(__GLIBC__) // GLIBC-only entry point. // TODO(sbc): remove once this bug gets fixed: // https://code.google.com/p/nativeclient/issues/detail?id=3709 int chdir(const char* path) { return ki_chdir(path); } #endif
// Copyright (c) 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 BASE_DEBUG_DWARF_LINE_NO_H_ #define BASE_DEBUG_DWARF_LINE_NO_H_ #include <cstddef> #include <cstdint> namespace base { namespace debug { // Finds the compile unit offset in .debug_info for each frame in `trace`. // // Expects `trace` and `cu_offsets` to be `num_frames` in size. If a frame // cannot be found, the corresponding value stored in `cu_offsets` is 0. void GetDwarfCompileUnitOffsets(void* const* trace, uint64_t* cu_offsets, size_t num_frames); // Formats the source file, line number and column for `pc` and into `out`. // // The `cu_offsets` is the offset in the .debug_info section for the compile // unit or partial unit DIE corresponding to the `pc`. It can be found using // GetDwarfCompileUnitOffsets() and must not be 0. // // Example: // ../../base/debug/stack_trace_unittest.cc:120,16 // // This means `pc` was from line 120, column 16, of stack_trace_unittest.cc. bool GetDwarfSourceLineNumber(void* pc, uint64_t cu_offsets, char* out, size_t out_size); } // namespace debug } // namespace base #endif // BASE_DEBUG_DWARF_LINE_NO_H_
/* * Copyright (c) 2012 Samsung Electronics Co., Ltd. * http://www.samsung.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/gpio.h> #include <linux/pwm_backlight.h> #include <linux/fb.h> #include <linux/delay.h> #include <linux/clk.h> #include <linux/lcd.h> #include <video/s5p-dp.h> #include <plat/cpu.h> #include <plat/clock.h> #include <plat/devs.h> #include <plat/fb.h> #include <plat/fb-core.h> #include <plat/regs-fb-v4.h> #include <plat/dp.h> #include <plat/backlight.h> #include <plat/gpio-cfg.h> #include <mach/map.h> #include <mach/setup-disp-clock.h> #include "board-universal5260.h" #if defined(CONFIG_S5P_DP) static void s5p_dp_backlight_on(void); static void s5p_dp_backlight_off(void); #define LCD_POWER_OFF_TIME_US (500 * USEC_PER_MSEC) static ktime_t lcd_on_time; static void universal5260_lcd_on(void) { s64 us = ktime_us_delta(lcd_on_time, ktime_get_boottime()); if (us > LCD_POWER_OFF_TIME_US) { pr_warn("lcd on sleep time too long\n"); us = LCD_POWER_OFF_TIME_US; } if (us > 0) usleep_range(us, us); s3c_gpio_setpull(EXYNOS5260_GPB2(0), S3C_GPIO_PULL_NONE); s3c_gpio_setpull(EXYNOS5260_GPD2(2), S3C_GPIO_PULL_NONE); gpio_request_one(EXYNOS5260_GPD2(2), GPIOF_OUT_INIT_HIGH, "GPD2"); usleep_range(5000, 6000); gpio_free(EXYNOS5260_GPD2(2)); s3c_gpio_setpull(EXYNOS5260_GPD2(1), S3C_GPIO_PULL_NONE); gpio_request_one(EXYNOS5260_GPD2(1), GPIOF_OUT_INIT_HIGH, "GPD2"); usleep_range(5000, 6000); gpio_free(EXYNOS5260_GPD2(1)); } static void universal5260_lcd_off(void) { gpio_request_one(EXYNOS5260_GPD2(2), GPIOF_OUT_INIT_LOW, "GPD2"); gpio_free(EXYNOS5260_GPD2(2)); usleep_range(5000, 6000); gpio_request_one(EXYNOS5260_GPD2(1), GPIOF_OUT_INIT_LOW, "GPD2"); usleep_range(5000, 6000); gpio_free(EXYNOS5260_GPD2(1)); lcd_on_time = ktime_add_us(ktime_get_boottime(), LCD_POWER_OFF_TIME_US); } static void dp_lcd_set_power(struct plat_lcd_data *pd, unsigned int power) { if (power) universal5260_lcd_on(); else universal5260_lcd_off(); } static struct plat_lcd_data universal5260_dp_lcd_data = { .set_power = dp_lcd_set_power, }; static struct platform_device universal5260_dp_lcd = { .name = "platform-lcd", .dev = { .parent = &s5p_device_fimd1.dev, .platform_data = &universal5260_dp_lcd_data, }, }; static struct s3c_fb_pd_win universal5260_fb_win0 = { .win_mode = { .left_margin = 80, .right_margin = 48, .upper_margin = 37, .lower_margin = 3, .hsync_len = 32, .vsync_len = 6, .xres = 2560, .yres = 1600, }, .virtual_x = 2560, .virtual_y = 1640 * 2, .max_bpp = 32, .default_bpp = 24, }; #endif static void universal5260_fimd_gpio_setup_24bpp(void) { gpio_request(EXYNOS5260_GPX0(7), "GPX0"); s3c_gpio_cfgpin(EXYNOS5260_GPX0(7), S3C_GPIO_SFN(3)); } static struct s3c_fb_platdata universal5260_lcd1_pdata __initdata = { .win[0] = &universal5260_fb_win0, .win[1] = &universal5260_fb_win0, .win[2] = &universal5260_fb_win0, .win[3] = &universal5260_fb_win0, .win[4] = &universal5260_fb_win0, .default_win = 0, .clock_init = s3c_fb_clock_init, .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, #if defined(CONFIG_S5P_DP) .vidcon1 = 0, .backlight_off = s5p_dp_backlight_off, .lcd_off = universal5260_lcd_off, #else .vidcon1 = VIDCON1_INV_VCLK, #endif .setup_gpio = universal5260_fimd_gpio_setup_24bpp, .ip_version = EXYNOS5_813, }; #ifdef CONFIG_S5P_DP static struct video_info universal5260_dp_config = { .name = "WQXGA(2560x1600) LCD, for XYREF TEST", .h_sync_polarity = 0, .v_sync_polarity = 0, .interlaced = 0, .color_space = COLOR_RGB, .dynamic_range = VESA, .ycbcr_coeff = COLOR_YCBCR601, .color_depth = COLOR_8, .link_rate = LINK_RATE_2_70GBPS, .lane_count = LANE_COUNT4, }; static void s5p_dp_backlight_on(void) { usleep_range(97000, 97000); /* LED_BACKLIGHT_RESET: GPD2_0 */ gpio_request_one(EXYNOS5260_GPD2(0), GPIOF_OUT_INIT_HIGH, "GPD2"); gpio_free(EXYNOS5260_GPD2(0)); } static void s5p_dp_backlight_off(void) { usleep_range(97000, 97000); /* LED_BACKLIGHT_RESET: GPD2_0 */ gpio_request_one(EXYNOS5260_GPD2(0), GPIOF_OUT_INIT_LOW, "GPD2"); gpio_free(EXYNOS5260_GPD2(0)); } static struct s5p_dp_platdata universal5260_dp_data __initdata = { .video_info = &universal5260_dp_config, .phy_init = s5p_dp_phy_init, .phy_exit = s5p_dp_phy_exit, .backlight_on = s5p_dp_backlight_on, .backlight_off = s5p_dp_backlight_off, .clock_init = s5p_dp_clock_init, }; #endif static struct platform_device *universal5260_display_devices[] __initdata = { &s5p_device_fimd1, #ifdef CONFIG_S5P_DP &s5p_device_dp, &universal5260_dp_lcd, #endif }; #ifdef CONFIG_BACKLIGHT_PWM /* LCD Backlight data */ static struct samsung_bl_gpio_info universal5260_bl_gpio_info = { .no = EXYNOS5420_GPB2(0), .func = S3C_GPIO_SFN(2), }; static struct platform_pwm_backlight_data universal5260_bl_data = { .pwm_id = 0, .pwm_period_ns = 30000, }; #endif void __init exynos5_universal5260_display_init(void) { clk_add_alias("sclk_fimd", "exynos5-fb.1", "sclk_fimd1_128_extclkpl", &s5p_device_fimd1.dev); #ifdef CONFIG_S5P_DP s5p_dp_set_platdata(&universal5260_dp_data); #endif s5p_fimd1_set_platdata(&universal5260_lcd1_pdata); #ifdef CONFIG_BACKLIGHT_PWM samsung_bl_set(&universal5260_bl_gpio_info, &universal5260_bl_data); #endif platform_add_devices(universal5260_display_devices, ARRAY_SIZE(universal5260_display_devices)); #ifdef CONFIG_S5P_DP exynos5_fimd1_setup_clock(&s5p_device_fimd1.dev, "sclk_fimd", "sclk_disp_pixel", 267 * MHZ); #endif }
/* This file is part of UFFS, the Ultra-low-cost Flash File System. Copyright (C) 2005-2009 Ricky Zheng <ricky_gz_zheng@yahoo.co.nz> UFFS is free software; you can redistribute it and/or modify it under 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. UFFS 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 or GNU Library General Public License, as applicable, for more details. You should have received a copy of the GNU General Public License and GNU Library General Public License along with UFFS; 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. */ /** * \file uffs_fileem.h * \brief Emulate NAND flash with host file. * \author Ricky Zheng */ #ifndef _UFFS_FILEEM_H_ #define _UFFS_FILEEM_H_ #include "uffs/uffs_device.h" #define UFFS_FEMU_FILE_NAME "uffsemfile.bin" #define UFFS_FEMU_MAX_BLOCKS (1024 * 16) // maximum 16K blocks #define UFFS_FEMU_ENABLE_INJECTION // enable bad block & ecc error injection extern struct uffs_FlashOpsSt g_femu_ops_ecc_soft; // for software ECC or no ECC. extern struct uffs_FlashOpsSt g_femu_ops_ecc_hw; // for hardware ECC extern struct uffs_FlashOpsSt g_femu_ops_ecc_hw_auto; // for auto hardware ECC #define PAGE_DATA_WRITE_COUNT_LIMIT 1 #define PAGE_SPARE_WRITE_COUNT_LIMIT 1 typedef struct uffs_FileEmuSt { int initCount; FILE *fp; FILE *dump_fp; u8 *em_monitor_page; // page write monitor u8 * em_monitor_spare; // spare write monitor u32 *em_monitor_block; // block erease monitor const char *emu_filename; #ifdef UFFS_FEMU_ENABLE_INJECTION struct uffs_FlashOpsSt ops_orig; UBOOL wrap_inited; #endif } uffs_FileEmu; /* file emulator device init/release entry */ URET femu_InitDevice(uffs_Device *dev); URET femu_ReleaseDevice(uffs_Device *dev); struct uffs_StorageAttrSt * femu_GetStorage(void); struct uffs_FileEmuSt * femu_GetPrivate(void); #ifdef UFFS_FEMU_ENABLE_INJECTION void femu_setup_wrapper_functions(uffs_Device *dev); #endif /* internal used functions, shared by all ecc option implementations */ int femu_InitFlash(uffs_Device *dev); int femu_ReleaseFlash(uffs_Device *dev); int femu_EraseBlock(uffs_Device *dev, u32 blockNumber); #endif
/***************************************************************************** * * Filename: * --------- * sensor.h * * Project: * -------- * DUMA * * Description: * ------------ * Header file of camera customized parameters. * * * Author: * ------- * PC Huang (MTK02204) * *============================================================================ * HISTORY * Below this line, this part is controlled by CC/CQ. DO NOT MODIFY!! *------------------------------------------------------------------------------ * $Revision:$ * $Modtime:$ * $Log:$ * * 04 20 2012 chengxue.shen * [ALPS00272900] HI542 Sensor Driver Check In * HI542 Sensor driver Check in and modify For MT6577 dual core processor * * Feb 9 2010 mtk80461 * [DUMA00154355] JPeg Orientation feature check in * * * Oct 27 2009 mtk02204 * [DUMA00015869] [Camera Driver] Modifiy camera related drivers for dual/backup sensor/lens drivers. * * * Sep 24 2009 mtk02204 * [DUMA00134387] [LTK][GW616][Camera]4040 Camera:Camera Quality Test failed. * * * Jul 8 2009 mtk02204 * [DUMA00008051] [Camera Driver] Add drivers for camera high ISO binning mode. * * * Jul 8 2009 mtk02204 * [DUMA00008051] [Camera Driver] Add drivers for camera high ISO binning mode. * * * Jul 7 2009 mtk02204 * [DUMA00008051] [Camera Driver] Add drivers for camera high ISO binning mode. * * * Jun 6 2009 mtk02204 * [DUMA00119628] MTK camera_recorded video only contain audio but no video with Jean effect * * * Apr 10 2009 mtk02204 * [DUMA00004178] [Camera] Check in for MTK camera integration * * * Mar 13 2009 mtk02204 * [DUMA00001084] First Check in of MT6516 multimedia drivers * * * Mar 2 2009 mtk02204 * [DUMA00001084] First Check in of MT6516 multimedia drivers * * * Feb 6 2009 mtk02204 * [DUMA00001084] First Check in of MT6516 multimedia drivers * * *------------------------------------------------------------------------------ * Upper this line, this part is controlled by CC/CQ. DO NOT MODIFY!! *============================================================================ ****************************************************************************/ #ifndef __CAMERA_CUSTOMIZED_H #define __CAMERA_CUSTOMIZED_H // the angle between handset and sensor placement in clockwise, should be one of 0, 90, 270 #define MAIN_SENSOR_ORIENTATION_ANGLE 90 #define SUB_SENSOR_ORIENTATION_ANGLE 0 // do not care if the sub sensor does not exist // First, we think you hold the cell phone vertical. // Second, we suppose the direction of upward is 0 // Third, it is 90, 180, 270 in clockwise // here we define the main sensor and sub sensor angles to deal with the jpeg orientation #define MAIN_SENSOR_TO_PHONE_ANGLE 90 #define SUB_SENSOR_TO_PHONE_ANGLE 0 #define CAM_SIZE_QVGA_WIDTH 320 #define CAM_SIZE_QVGA_HEIGHT 240 #define CAM_SIZE_VGA_WIDTH 640 #define CAM_SIZE_VGA_HEIGHT 480 #define CAM_SIZE_05M_WIDTH 800 #define CAM_SIZE_05M_HEIGHT 600 #define CAM_SIZE_1M_WIDTH 1280 #define CAM_SIZE_1M_HEIGHT 960 #define CAM_SIZE_2M_WIDTH 1600 #define CAM_SIZE_2M_HEIGHT 1200 #define CAM_SIZE_3M_WIDTH 2048 #define CAM_SIZE_3M_HEIGHT 1536 #define CAM_SIZE_5M_WIDTH 2592 #define CAM_SIZE_5M_HEIGHT 1944 // for main sensor #define MAIN_NUM_OF_PREVIEW_RESOLUTION 3 #define MAIN_NUM_OF_VIDEO_RESOLUTION 4 #define MAIN_NUM_OF_STILL_RESOLUTION 7 #define MAIN_VIDEO_RESOLUTION_PROFILE {{176,144},{320,240},{640,480},{720,480}} #define MAIN_PREVIEW_RESOLUTION_PROFILE {{232,174},{320,240},{240,320}} #define MAIN_STILL_RESOLUTION_PROFILE {{CAM_SIZE_QVGA_WIDTH,CAM_SIZE_QVGA_HEIGHT}, \ {CAM_SIZE_VGA_WIDTH,CAM_SIZE_VGA_HEIGHT}, \ {CAM_SIZE_05M_WIDTH,CAM_SIZE_05M_HEIGHT}, \ {CAM_SIZE_1M_WIDTH,CAM_SIZE_1M_HEIGHT}, \ {CAM_SIZE_2M_WIDTH,CAM_SIZE_2M_HEIGHT}, \ {CAM_SIZE_3M_WIDTH,CAM_SIZE_3M_HEIGHT}, \ {CAM_SIZE_5M_WIDTH,CAM_SIZE_5M_HEIGHT}} // if sub sensor does not exist, set all the parameters as 0 #define SUB_NUM_OF_PREVIEW_RESOLUTION 0 #define SUB_NUM_OF_VIDEO_RESOLUTION 0 #define SUB_NUM_OF_STILL_RESOLUTION 0 #define SUB_VIDEO_RESOLUTION_PROFILE {{0,0}} #define SUB_PREVIEW_RESOLUTION_PROFILE {{0,0}} #define SUB_STILL_RESOLUTION_PROFILE {{0,0}} //#define NUM_OF_PREVIEW_RESOLUTION max(MAIN_NUM_OF_PREVIEW_RESOLUTION,SUB_NUM_OF_PREVIEW_RESOLUTION) //#define NUM_OF_VIDEO_RESOLUTION max(MAIN_NUM_OF_VIDEO_RESOLUTION,SUB_NUM_OF_VIDEO_RESOLUTION) //#define NUM_OF_STILL_RESOLUTION max(MAIN_NUM_OF_STILL_RESOLUTION,SUB_NUM_OF_STILL_RESOLUTION) #define NUM_OF_VIDEO_STREAM_BUFF 8 // Maximun is 8 #endif
/* Simple DirectMedia Layer Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef SDL_audio_c_h_ #define SDL_audio_c_h_ #include "../SDL_internal.h" #ifndef DEBUG_CONVERT #define DEBUG_CONVERT 0 #endif #if DEBUG_CONVERT #define LOG_DEBUG_CONVERT(from, to) fprintf(stderr, "Converting %s to %s.\n", from, to); #else #define LOG_DEBUG_CONVERT(from, to) #endif /* Functions and variables exported from SDL_audio.c for SDL_sysaudio.c */ #ifdef HAVE_LIBSAMPLERATE_H #include "samplerate.h" extern SDL_bool SRC_available; extern int SRC_converter; extern SRC_STATE* (*SRC_src_new)(int converter_type, int channels, int *error); extern int (*SRC_src_process)(SRC_STATE *state, SRC_DATA *data); extern int (*SRC_src_reset)(SRC_STATE *state); extern SRC_STATE* (*SRC_src_delete)(SRC_STATE *state); extern const char* (*SRC_src_strerror)(int error); #endif /* Functions to get a list of "close" audio formats */ extern SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format); extern SDL_AudioFormat SDL_NextAudioFormat(void); /* Function to calculate the size and silence for a SDL_AudioSpec */ extern Uint8 SDL_SilenceValueForFormat(const SDL_AudioFormat format); extern void SDL_CalculateAudioSpec(SDL_AudioSpec * spec); /* Choose the audio filter functions below */ extern void SDL_ChooseAudioConverters(void); /* These pointers get set during SDL_ChooseAudioConverters() to various SIMD implementations. */ extern SDL_AudioFilter SDL_Convert_S8_to_F32; extern SDL_AudioFilter SDL_Convert_U8_to_F32; extern SDL_AudioFilter SDL_Convert_S16_to_F32; extern SDL_AudioFilter SDL_Convert_U16_to_F32; extern SDL_AudioFilter SDL_Convert_S32_to_F32; extern SDL_AudioFilter SDL_Convert_F32_to_S8; extern SDL_AudioFilter SDL_Convert_F32_to_U8; extern SDL_AudioFilter SDL_Convert_F32_to_S16; extern SDL_AudioFilter SDL_Convert_F32_to_U16; extern SDL_AudioFilter SDL_Convert_F32_to_S32; /* You need to call SDL_PrepareResampleFilter() before using the internal resampler. SDL_AudioQuit() calls SDL_FreeResamplerFilter(), you should never call it yourself. */ extern int SDL_PrepareResampleFilter(void); extern void SDL_FreeResampleFilter(void); #endif /* SDL_audio_c_h_ */ /* vi: set ts=4 sw=4 expandtab: */
/* { dg-do compile } */ /* { dg-options "-O2" } */ double test () { double x = 1.0; asm ("fld %1" /* { dg-error "explicitly used registers must be grouped at top of stack" } */ : "=&t" (x) : "u" (x)); return x; }
/* * Copyright (C) 2010-2012 OregonCore <http://www.oregoncore.com/> * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2006-2012 ScriptDev2 <http://www.scriptdev2.com/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef DEF_WAILING_CAVERNS_H #define DEF_WAILING_CAVERNS_H enum eTypes { TYPE_LORD_COBRAHN = 1, TYPE_LORD_PYTHAS = 2, TYPE_LADY_ANACONDRA = 3, TYPE_LORD_SERPENTIS = 4, TYPE_NARALEX_EVENT = 5, TYPE_NARALEX_PART1 = 6, TYPE_NARALEX_PART2 = 7, TYPE_NARALEX_PART3 = 8, TYPE_MUTANUS_THE_DEVOURER = 9, TYPE_NARALEX_YELLED = 10, DATA_NARALEX = 3679, }; #endif
/** * Copyright (C) 2009 Daniel-Constantin Mierla (asipto.com) * * This file is part of kamailio, a free SIP server. * * Kamailio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version * * Kamailio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*! * \file * \brief Faked message handling * \ingroup libkcore * Module: \ref libkcore */ #include "../../dprint.h" #include "../../globals.h" #include "../../dset.h" #include "faked_msg.h" #define FAKED_SIP_MSG "OPTIONS sip:you@kamailio.org SIP/2.0\r\nVia: SIP/2.0/UDP 127.0.0.1\r\nFrom: <you@kamailio.org>;tag=123\r\nTo: <you@kamailio.org>\r\nCall-ID: 123\r\nCSeq: 1 OPTIONS\r\nContent-Length: 0\r\n\r\n" #define FAKED_SIP_MSG_LEN (sizeof(FAKED_SIP_MSG)-1) static char _faked_sip_buf[FAKED_SIP_MSG_LEN+1]; static struct sip_msg _faked_msg; static unsigned int _faked_msg_no = 0; int faked_msg_init(void) { if(_faked_msg_no>0) return 0; /* init faked sip msg */ memcpy(_faked_sip_buf, FAKED_SIP_MSG, FAKED_SIP_MSG_LEN); _faked_sip_buf[FAKED_SIP_MSG_LEN] = '\0'; memset(&_faked_msg, 0, sizeof(struct sip_msg)); _faked_msg.buf=_faked_sip_buf; _faked_msg.len=FAKED_SIP_MSG_LEN; _faked_msg.set_global_address=default_global_address; _faked_msg.set_global_port=default_global_port; if (parse_msg(_faked_msg.buf, _faked_msg.len, &_faked_msg)!=0) { LM_ERR("parse_msg failed\n"); return -1; } _faked_msg.rcv.proto = PROTO_UDP; _faked_msg.rcv.src_port = 5060; _faked_msg.rcv.src_ip.u.addr32[0] = 0x7f000001; _faked_msg.rcv.src_ip.af = AF_INET; _faked_msg.rcv.src_ip.len = 4; _faked_msg.rcv.dst_port = 5060; _faked_msg.rcv.dst_ip.u.addr32[0] = 0x7f000001; _faked_msg.rcv.dst_ip.af = AF_INET; _faked_msg.rcv.dst_ip.len = 4; return 0; } sip_msg_t* faked_msg_next(void) { _faked_msg.id = 1 + _faked_msg_no++; _faked_msg.pid = my_pid(); memset(&_faked_msg.tval, 0, sizeof(struct timeval)); clear_branches(); return &_faked_msg; } sip_msg_t* faked_msg_get_next(void) { faked_msg_init(); return faked_msg_next(); }
/* * 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 */ #ifndef AVUTIL_HWCONTEXT_CUDA_INTERNAL_H #define AVUTIL_HWCONTEXT_CUDA_INTERNAL_H #include "compat/cuda/dynlink_loader.h" #include "hwcontext_cuda.h" /** * @file * FFmpeg internal API for CUDA. */ struct AVCUDADeviceContextInternal { CudaFunctions *cuda_dl; int is_allocated; }; #endif /* AVUTIL_HWCONTEXT_CUDA_INTERNAL_H */
/* * Copyright (C) 2016 Eistec AB * * 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 drivers_mtd_spi_nor * @{ * * @file * @brief Configurations for some known serial flash memory devices * * @author Joakim Nohlgård <joakim.nohlgard@eistec.se> */ #include <stdint.h> #include "mtd_spi_nor.h" /* Define opcode tables for SPI NOR flash memory devices here. */ /* Linker garbage collection (gcc -fdata-sections -Wl,--gc-sections) should ensure * that only the tables that are actually used by the application will take up * space in the .rodata section in program ROM. */ const mtd_spi_nor_opcode_t mtd_spi_nor_opcode_default = { .rdid = 0x9f, .wren = 0x06, .rdsr = 0x05, .wrsr = 0x01, .read = 0x03, .read_fast = 0x0b, .page_program = 0x02, .sector_erase = 0x20, .block_erase_32k = 0x52, .block_erase_64k = 0xd8, .chip_erase = 0xc7, .sleep = 0xb9, .wake = 0xab, }; const mtd_spi_nor_opcode_t mtd_spi_nor_opcode_default_4bytes = { .rdid = 0x9f, .wren = 0x06, .rdsr = 0x05, .wrsr = 0x01, .read = 0x13, .read_fast = 0x0c, .page_program = 0x12, .sector_erase = 0x21, .block_erase_32k = 0x5c, .block_erase_64k = 0xdc, .chip_erase = 0xc7, .sleep = 0xb9, .wake = 0xab, }; /** @} */
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s void test0() { // CHECK: define void @test0() // CHECK: [[F:%.*]] = alloca float // CHECK-NEXT: [[REAL:%.*]] = load volatile float* getelementptr inbounds ({ float, float }* @test0_v, i32 0, i32 0) // CHECK-NEXT: load volatile float* getelementptr inbounds ({{.*}} @test0_v, i32 0, i32 1) // CHECK-NEXT: store float [[REAL]], float* [[F]], align 4 // CHECK-NEXT: ret void extern volatile _Complex float test0_v; float f = (float) test0_v; } void test1() { // CHECK: define void @test1() // CHECK: [[REAL:%.*]] = load volatile float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0) // CHECK-NEXT: [[IMAG:%.*]] = load volatile float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1) // CHECK-NEXT: store volatile float [[REAL]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0) // CHECK-NEXT: store volatile float [[IMAG]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1) // CHECK-NEXT: ret void extern volatile _Complex float test1_v; test1_v = test1_v; }
/* ---------------------------------------------------------------------------- */ /* Atmel Microcontroller Software Support */ /* SAM Software Package License */ /* ---------------------------------------------------------------------------- */ /* Copyright (c) 2014, Atmel Corporation */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following condition is 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. */ /* ---------------------------------------------------------------------------- */ #ifndef SYSTEM_SAMV71_H_INCLUDED #define SYSTEM_SAMV71_H_INCLUDED /* @cond 0 */ /**INDENT-OFF**/ #ifdef __cplusplus extern "C" { #endif /**INDENT-ON**/ /* @endcond */ #include <stdint.h> extern uint32_t SystemCoreClock; /* System Clock Frequency (Core Clock) */ /** * @brief Setup the microcontroller system. * Initialize the System and update the SystemCoreClock variable. */ void SystemInit(void); /** * @brief Updates the SystemCoreClock with current core Clock * retrieved from cpu registers. */ void SystemCoreClockUpdate(void); /** * Initialize flash. */ void system_init_flash(uint32_t dw_clk); void sysclk_enable_usb(void); void sysclk_disable_usb(void); /* @cond 0 */ /**INDENT-OFF**/ #ifdef __cplusplus } #endif /**INDENT-ON**/ /* @endcond */ #endif /* SYSTEM_SAMV71_H_INCLUDED */
/* * 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 ColorInputType_h #define ColorInputType_h #include "core/html/forms/BaseClickableWithKeyInputType.h" #include "core/html/forms/ColorChooserClient.h" namespace blink { class ColorChooser; class ColorInputType final : public BaseClickableWithKeyInputType, public ColorChooserClient { WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ColorInputType); public: static PassRefPtrWillBeRawPtr<InputType> create(HTMLInputElement&); ~ColorInputType() override; DECLARE_VIRTUAL_TRACE(); // ColorChooserClient implementation. void didChooseColor(const Color&) override; void didEndChooser() override; Element& ownerElement() const override; IntRect elementRectRelativeToViewport() const override; Color currentColor() override; bool shouldShowSuggestions() const override; Vector<ColorSuggestion> suggestions() const override; ColorChooserClient* colorChooserClient() override; private: ColorInputType(HTMLInputElement& element) : BaseClickableWithKeyInputType(element) { } void valueAttributeChanged() override; void countUsage() override; const AtomicString& formControlType() const override; bool supportsRequired() const override; String fallbackValue() const override; String sanitizeValue(const String&) const override; void createShadowSubtree() override; void setValue(const String&, bool valueChanged, TextFieldEventBehavior) override; void handleDOMActivateEvent(Event*) override; void closePopupView() override; bool shouldRespectListAttribute() override; bool typeMismatchFor(const String&) const override; void warnIfValueIsInvalid(const String&) const override; void updateView() override; AXObject* popupRootAXObject() override; Color valueAsColor() const; void endColorChooser(); HTMLElement* shadowColorSwatch() const; OwnPtrWillBeMember<ColorChooser> m_chooser; }; } // namespace blink #endif // ColorInputType_h
/* * This is an OpenSSL-compatible implementation of the RSA Data Security, * Inc. MD5 Message-Digest Algorithm. * * Written by Solar Designer <solar@openwall.com> in 2001, and placed in * the public domain. See md5.c for more information. */ #ifndef MD5_H #define MD5_H #include "hash-method.h" #define MD5_RESULTLEN (128/8) struct md5_context { uint_fast32_t lo, hi; uint_fast32_t a, b, c, d; unsigned char buffer[64]; uint_fast32_t block[MD5_RESULTLEN]; }; void md5_init(struct md5_context *ctx); void md5_update(struct md5_context *ctx, const void *data, size_t size); void md5_final(struct md5_context *ctx, unsigned char result[MD5_RESULTLEN]); void md5_get_digest(const void *data, size_t size, unsigned char result[MD5_RESULTLEN]); extern const struct hash_method hash_method_md5; #endif
// perform editing operations // headers #include "edelf.h" #include "trans.h" // editing program headers void readphdrs(ElfObject &eo, char *) { eo.readehdr(); eo.readphdrs(); return; } static void review(ElfObject &eo, int seg) { if (seg < 0 || seg >= eo.pehdr()->e_phnum) { printf("out-of-range segment number.\n"); return; } printf("\nsegment : %d\n", seg); printf("p_type : 0x%lx (%s)\n", eo.pphdr(seg).p_type, ir2s(p_types, rp_types, eo.pphdr(seg).p_type)); printf("p_offset: 0x%lx\n", eo.pphdr(seg).p_offset); printf("p_vaddr : 0x%lx\n", eo.pphdr(seg).p_vaddr); printf("p_paddr : 0x%lx\n", eo.pphdr(seg).p_paddr); printf("p_filesz: 0x%lx\n", eo.pphdr(seg).p_filesz); printf("p_memsz : 0x%lx\n", eo.pphdr(seg).p_memsz); printf("p_flags : 0x%lx (%s)\n", eo.pphdr(seg).p_flags, b2s(p_flags, eo.pphdr(seg).p_flags)); printf("p_align : 0x%lx\n", eo.pphdr(seg).p_align); return; } static void update(ElfObject &eo, int seg) { int upd = 0; char s[BUFSIZ]; // tell user which segment is being updated printf("\nsegment %d header:\n", seg); // update segment fields printf("p_type [cr=0x%lx]: ", eo.pphdr(seg).p_type); rmvnlgets(s); if (*s != '\0') { upd++; eo.pphdr(seg).p_type = MYatoi(s); printf("p_type: 0x%lx\n", eo.pphdr(seg).p_type); } printf("p_offset [cr=0x%lx]: ", eo.pphdr(seg).p_offset); rmvnlgets(s); if (*s != '\0') { upd++; eo.pphdr(seg).p_offset = MYatoi(s); printf("p_offset: 0x%lx\n", eo.pphdr(seg).p_offset); } printf("p_vaddr [cr=0x%lx]: ", eo.pphdr(seg).p_vaddr); rmvnlgets(s); if (*s != '\0') { upd++; eo.pphdr(seg).p_vaddr = MYatoi(s); printf("p_vaddr: 0x%lx\n", eo.pphdr(seg).p_vaddr); } printf("p_paddr [cr=0x%lx]: ", eo.pphdr(seg).p_paddr); rmvnlgets(s); if (*s != '\0') { upd++; eo.pphdr(seg).p_paddr = MYatoi(s); printf("p_paddr: 0x%lx\n", eo.pphdr(seg).p_paddr); } printf("p_filesz [cr=0x%lx]: ", eo.pphdr(seg).p_filesz); rmvnlgets(s); if (*s != '\0') { upd++; eo.pphdr(seg).p_filesz = MYatoi(s); printf("p_filesz: 0x%lx\n", eo.pphdr(seg).p_filesz); } printf("p_memsz [cr=0x%lx]: ", eo.pphdr(seg).p_memsz); rmvnlgets(s); if (*s != '\0') { upd++; eo.pphdr(seg).p_memsz = MYatoi(s); printf("p_memsz: 0x%lx\n", eo.pphdr(seg).p_memsz); } printf("p_flags [cr=0x%lx]: ", eo.pphdr(seg).p_flags); rmvnlgets(s); if (*s != '\0') { upd++; eo.pphdr(seg).p_flags = MYatoi(s); printf("p_flags: 0x%lx\n", eo.pphdr(seg).p_flags); } printf("p_align [cr=0x%lx]: ", eo.pphdr(seg).p_align); rmvnlgets(s); if (*s != '\0') { upd++; eo.pphdr(seg).p_align = MYatoi(s); printf("p_align: 0x%lx\n", eo.pphdr(seg).p_align); } if (upd > 0) { printf("write to file [cr=n/n/y] ? "); rmvnlgets(s); if (*s == 'y') { eo.writephdrs(); } else { // no data was written, but now the current data // is wrong. reread the data from disk. char dummy[1]; readphdrs(eo, dummy); } } return; } static void printmenu() { printf("\nprogram headers menu:\n\n"); printf("? or h - show menu\n"); printf("r - review current program header data\n"); printf("r * - review all program headers data\n"); printf("r <number> - review <number> program header data\n"); printf("+ - show next program header data\n"); printf("- - show previous program header data\n"); printf("u - update current program data\n"); printf("q - quit\n\n"); return; } void editphdrs(ElfObject &eo, char *) { char s[BUFSIZ]; // start of program headers editing printf("editing program headers:\n"); // set current segment int cseg = 0; // start interactive loop for (int done=0; !done; ) { // get cmd from user printf("phdrs cmd: "); rmvnlgets(s); tokenize(s, " \t"); char *pt = gettoken(1); // what is the command if (pt == NULL || *pt == '\0') { if ((cseg + 1) < eo.pehdr()->e_phnum) { cseg++; review(eo, cseg); } else printf("cannot increment beyond last segment.\n"); } else if (*pt == '?' || *pt == 'h') { printmenu(); } else if (*pt == 'r') { // get next token pt = gettoken(2); // type of review if (pt == NULL || *pt == '\0') { review(eo, cseg); } else if (*pt == '*') { printf("program segment hdrs data:\n"); for (int seg=0; seg<eo.pehdr()->e_phnum; seg++) { review(eo, seg); } } else if (strspn(pt, "0123456789") == strlen(pt)) { // show a specific segment printf("segment hdr data:\n"); int seg = MYatoi(pt); if (seg < 0 || seg >= eo.pehdr()->e_phnum) { printf("out-of-range segment number.\n"); return; } cseg = seg; review(eo, cseg); } else { printf("invalid segment number.\n"); } } else if (*pt == 'u') { update(eo, cseg); } else if (*pt == '+') { if ((cseg + 1) < eo.pehdr()->e_phnum) { cseg++; review(eo, cseg); } else printf("cannot increment beyond last segment.\n"); } else if (*pt == '-') { if ((cseg - 1) >= 0) { cseg--; review(eo, cseg); } else printf("cannot decrement before first segment.\n"); } else if (*pt == 'q') { done = 1; } else { printf("unknown cmd.\n"); } } return; }
//****************************************************************************** // // Copyright (c) 2015 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // //****************************************************************************** // WindowsGlobalizationCollation.h // Generated from winmd2objc #pragma once #include "interopBase.h" @class WGCCharacterGrouping, WGCCharacterGroupings; @class RTArray_C_WGCCharacterGrouping; @protocol WGCICharacterGrouping, WGCICharacterGroupings; #include "WindowsFoundationCollections.h" #import <Foundation/Foundation.h> // Windows.Globalization.Collation.CharacterGrouping #ifndef __WGCCharacterGrouping_DEFINED__ #define __WGCCharacterGrouping_DEFINED__ WINRT_EXPORT @interface WGCCharacterGrouping : RTObject @property (readonly) NSString * first; @property (readonly) NSString * label; @end #endif // __WGCCharacterGrouping_DEFINED__ // Windows.Globalization.Collation.CharacterGroupings #ifndef __WGCCharacterGroupings_DEFINED__ #define __WGCCharacterGroupings_DEFINED__ WINRT_EXPORT @interface WGCCharacterGroupings : RTObject + (instancetype)create ACTIVATOR; @property (readonly) unsigned int size; - (unsigned int)count; - (id)objectAtIndex:(unsigned)idx; - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id __unsafe_unretained [])buffer count:(NSUInteger)len; - (NSString *)lookup:(NSString *)text; @end #endif // __WGCCharacterGroupings_DEFINED__
/* * Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef ScenePackets_h__ #define ScenePackets_h__ #include "Packet.h" #include "Object.h" namespace WorldPackets { namespace Scenes { class TC_GAME_API PlayScene final : public ServerPacket { public: PlayScene() : ServerPacket(SMSG_PLAY_SCENE, 34) { } WorldPacket const* Write() override; int32 SceneID = 0; int32 PlaybackFlags = 0; int32 SceneInstanceID = 0; int32 SceneScriptPackageID = 0; ObjectGuid TransportGUID; Position Location; }; class TC_GAME_API CancelScene final : public ServerPacket { public: CancelScene() : ServerPacket(SMSG_CANCEL_SCENE, 4) { } WorldPacket const* Write() override; int32 SceneInstanceID = 0; }; class SceneTriggerEvent final : public ClientPacket { public: SceneTriggerEvent(WorldPacket&& packet) : ClientPacket(CMSG_SCENE_TRIGGER_EVENT, std::move(packet)) { } void Read() override; uint32 SceneInstanceID = 0; std::string Event; }; class ScenePlaybackComplete final : public ClientPacket { public: ScenePlaybackComplete(WorldPacket&& packet) : ClientPacket(CMSG_SCENE_PLAYBACK_COMPLETE, std::move(packet)) { } void Read() override; uint32 SceneInstanceID = 0; }; class ScenePlaybackCanceled final : public ClientPacket { public: ScenePlaybackCanceled(WorldPacket&& packet) : ClientPacket(CMSG_SCENE_PLAYBACK_CANCELED, std::move(packet)) { } void Read() override; uint32 SceneInstanceID = 0; }; } } #endif // ScenePackets_h__
#include <sys/types.h> #include <stdarg.h> extern void *xmalloc(size_t size); extern void *xrealloc(void *p, size_t size); extern char *xstrdup(const char *s); extern void die(int err, const char *fmt, ...); extern void (*at_die)(void);
/* NetWinder Floating Point Emulator (c) Rebel.com, 1998-1999 Direct questions, comments to Scott Bambrough <scottb@netwinder.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __FPA11_H__ #define __FPA11_H__ /* includes */ #include "fpsr.h" /* FP control and status register definitions */ #include "softfloat.h" #define typeNone 0x00 #define typeSingle 0x01 #define typeDouble 0x02 #define typeExtended 0x03 typedef union tagFPREG { float32 fSingle; float64 fDouble; floatx80 fExtended; } FPREG; /* FPA11 device model */ typedef struct tagFPA11 { FPREG fpreg[8]; /* 8 floating point registers */ FPSR fpsr; /* floating point status register */ FPCR fpcr; /* floating point control register */ unsigned char fType[8]; /* type of floating point value held in floating point registers. One of none single, double or extended. */ int initflag; /* this is special. The kernel guarantees to set it to 0 when a thread is launched, so we can use it to detect whether this instance of the emulator needs to be initialised. */ } FPA11; extern void resetFPA11(void); extern void SetRoundingMode(const unsigned int); extern void SetRoundingPrecision(const unsigned int); extern FPA11 *fpa11; #endif
/* Test accepting a connection to a server socket. Copyright (C) 2011-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> #include <sys/socket.h> #include "signature.h" SIGNATURE_CHECK (accept, int, (int, struct sockaddr *, socklen_t *)); #include <errno.h> #include <netinet/in.h> #include <unistd.h> #include "sockets.h" #include "macros.h" int main (void) { (void) gl_sockets_startup (SOCKETS_1_1); /* Test behaviour for invalid file descriptors. */ { struct sockaddr_in addr; socklen_t addrlen = sizeof (addr); errno = 0; ASSERT (accept (-1, (struct sockaddr *) &addr, &addrlen) == -1); ASSERT (errno == EBADF); } { struct sockaddr_in addr; socklen_t addrlen = sizeof (addr); close (99); errno = 0; ASSERT (accept (99, (struct sockaddr *) &addr, &addrlen) == -1); ASSERT (errno == EBADF); } return 0; }
/***************************** Include Files *******************************/ #include "axi_dispctrl.h" #include "xparameters.h" #include "stdio.h" //#include "xio.h" /************************** Constant Definitions ***************************/ #define READ_WRITE_MUL_FACTOR 0x10 /************************** Function Definitions ***************************/ /** * * Run a self-test on the driver/device. Note this may be a destructive test if * resets of the device are performed. * * If the hardware system is not built correctly, this function may never * return to the caller. * * @param baseaddr_p is the base address of the AXI_DISPCTRLinstance to be worked on. * * @return * * - XST_SUCCESS if all self-test code passed * - XST_FAILURE if any self-test code failed * * @note Caching must be turned off for this function to work. * @note Self test may fail if data memory and device are not on the same bus. * */ XStatus AXI_DISPCTRL_Reg_SelfTest(void * baseaddr_p) { Xuint32 baseaddr; int write_loop_index; int read_loop_index; int Index; baseaddr = (Xuint32) baseaddr_p; xil_printf("******************************\n\r"); xil_printf("* User Peripheral Self Test\n\r"); xil_printf("******************************\n\n\r"); /* * Write to user logic slave module register(s) and read back */ xil_printf("User logic slave module test...\n\r"); for (write_loop_index = 0 ; write_loop_index < 4; write_loop_index++) AXI_DISPCTRL_mWriteReg (baseaddr, write_loop_index*4, (write_loop_index+1)*READ_WRITE_MUL_FACTOR); for (read_loop_index = 0 ; read_loop_index < 4; read_loop_index++) if ( AXI_DISPCTRL_mReadReg (baseaddr, read_loop_index*4) != (read_loop_index+1)*READ_WRITE_MUL_FACTOR){ xil_printf ("Error reading register value at address %x\n", (int)baseaddr + read_loop_index*4); return XST_FAILURE; } xil_printf(" - slave register write/read passed\n\n\r"); return XST_SUCCESS; }
/* * Copyright (C) 2014 Hamburg University of Applied Sciences (HAW) * * 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 tests * @{ * * @file * @brief pthread tls test application * * @author Martin Landsmann <martin.landsmann@haw-hamburg.de> * * @} */ #include <stdio.h> #include "pthread.h" #define NUMBER_OF_TLS (20) void *run(void *parameter) { pthread_key_t aKeys[NUMBER_OF_TLS]; int aTLS_values[NUMBER_OF_TLS]; (void)parameter; printf("\n-= TEST 1 - create %d tls with sequential values 0...%d =-\n", NUMBER_OF_TLS, NUMBER_OF_TLS - 1); for (int i = 0; i < NUMBER_OF_TLS; ++i) { aTLS_values[i] = i; pthread_key_create(&(aKeys[i]), NULL); pthread_setspecific(aKeys[i], &aTLS_values[i]); } printf("now rise sequential by one values 1...%d\n", NUMBER_OF_TLS); for (int i = 0; i < NUMBER_OF_TLS; ++i) { aTLS_values[i]++; } printf("pick deliberate storage (key[3]:%d) and change the value\n", (int)aKeys[3]); void *val = pthread_getspecific(aKeys[3]); *((int *)val) = 42; puts("show tls values:"); for (int i = 0; i < NUMBER_OF_TLS; ++i) { void *val = pthread_getspecific(aKeys[i]); int x = *(int *)val; printf("key[%d]: %d, val: %d\n",i, (int)aKeys[i], x); } printf("\n -= TEST 2 - delete deliberate key (key[5]:%d) =-\n", (int)aKeys[5]); pthread_key_delete(aKeys[5]); puts("show tls values:"); for (int i = 0; i < NUMBER_OF_TLS; ++i) { void *val = pthread_getspecific(aKeys[i]); if (val != NULL) { int x = *(int *)val; printf("key[%d]: %d, val: %d\n",i, (int)aKeys[i], x); } } puts(""); puts("-= TEST 3 - create new tls =-"); int new_val = 99; pthread_key_t new_key; pthread_key_create(&new_key, NULL); pthread_setspecific(new_key, &new_val); printf("added new tls, key: %d, val: %d\n", (int)new_key, new_val); printf("show tls values:\n"); for (int i = 0; i < NUMBER_OF_TLS; ++i) { void *val = pthread_getspecific(aKeys[i]); if (val != NULL) { int x = *(int *)val; printf("key[%d]: %d, val: %d\n",i, (int)aKeys[i], x); } } puts(""); puts("-= TEST 4 - delete all keys =-"); for (int i = 0; i < NUMBER_OF_TLS; ++i) { pthread_key_delete(aKeys[i]); } printf("show tls values:\n"); for (int i = 0; i < NUMBER_OF_TLS; ++i) { void *val = pthread_getspecific(aKeys[i]); if (val != NULL) { int x = *(int *)val; printf("key[%d]: %d, val: %d\n",i, (int)aKeys[i], x); } } puts(""); puts("-= TEST 5 - try delete non-existing key =-"); printf("try to delete returns: %d\n", pthread_key_delete((pthread_key_t)99)); puts(""); puts("-= TEST 6 - add key and delete without a tls =-"); pthread_key_create(&new_key, NULL); printf("created key: %d\n", (int)new_key); printf("try to delete returns: %d\n", pthread_key_delete(new_key)); puts(""); puts("-= TEST 7 - add key without tls =-"); pthread_key_create(&new_key, NULL); printf("created key: %d\n", (int)new_key); void* test_7_val = pthread_getspecific(new_key); printf("test_7_val: %p\n", test_7_val); return NULL; } int main(void) { puts("START"); pthread_t th_id; pthread_attr_t th_attr; pthread_attr_init(&th_attr); pthread_create(&th_id, &th_attr, run, NULL); size_t res; pthread_join(th_id, (void **) &res); puts("tls tests finished."); if (res == 0) { puts("SUCCESS"); } else { puts("FAILURE"); } return 0; }
// // UILabel+ESAdjustableLabel.h // =========================== // This category adds a few helper methods to adjust // a UIlabel to fit its text. // // You can specify the minimum and maximum label size, // minimum font size, or none at all. // ---- // // Created by Edgar Schmidt (@edgarschmidt) on 4/14/12. // Copyright (c) 2012 Edgar Schmidt. All rights reserved. // // This code is provided without any warranties. // Hack around and enjoy ;) // #import <UIKit/UIKit.h> @interface UILabel (JKAdjustableLabel) // General method. If minSize is set to CGSizeZero then // it is ignored // ===================================================== - (void)jk_adjustLabelToMaximumSize:(CGSize)maxSize minimumSize:(CGSize)minSize minimumFontSize:(int)minFontSize; // Adjust label using only the maximum size and the // font size as constraints // ===================================================== - (void)jk_adjustLabelToMaximumSize:(CGSize)maxSize minimumFontSize:(int)minFontSize; // Adjust the size of the label using only the font // size as a constraint (the maximum size will be // calculated automatically based on the screen size) // ===================================================== - (void)jk_adjustLabelSizeWithMinimumFontSize:(int)minFontSize; // Adjust label without any constraints (the maximum // size will be calculated automatically based on the // screen size) // ===================================================== - (void)jk_adjustLabel; @end
// RUN: %clang_cc1 -emit-llvm -o %t %s // RUN: grep "hello" %t | count 3 // RUN: grep 'c"hello\\00"' %t | count 2 // RUN: grep 'c"hello\\00\\00\\00"' %t | count 1 // RUN: grep 'c"ola"' %t | count 1 /* Should be 3 hello string, two global (of different sizes), the rest are shared. */ void f0() { bar("hello"); } void f1() { static char *x = "hello"; bar(x); } void f2() { static char x[] = "hello"; bar(x); } void f3() { static char x[8] = "hello"; bar(x); } void f4() { static struct s { char *name; } x = { "hello" }; gaz(&x); } char x[3] = "ola";
/* Definitions for StrongARM running FreeBSD using the ELF format Copyright (C) 2001, 2004, 2007, 2010, 2011 Free Software Foundation, Inc. Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER } #undef SUBTARGET_CPP_SPEC #define SUBTARGET_CPP_SPEC FBSD_CPP_SPEC #undef LINK_SPEC #define LINK_SPEC " \ %{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \ %{v:-V} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ %{shared:-Bshareable %{h*} %{soname*}} \ %{!shared: \ %{!static: \ %{rdynamic:-export-dynamic} \ -dynamic-linker %(fbsd_dynamic_linker) } \ %{static:-Bstatic}} \ %{symbolic:-Bsymbolic}" /************************[ Target stuff ]***********************************/ /* Define the actual types of some ANSI-mandated types. Needs to agree with <machine/ansi.h>. GCC defaults come from c-decl.c, c-common.c, and config/<arch>/<arch>.h. */ /* arm.h gets this wrong for FreeBSD. We use the GCC defaults instead. */ #undef SIZE_TYPE #define SIZE_TYPE "unsigned int" #undef PTRDIFF_TYPE #define PTRDIFF_TYPE "int" /* We use the GCC defaults here. */ #undef WCHAR_TYPE #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE 32 #undef SUBTARGET_CPU_DEFAULT #define SUBTARGET_CPU_DEFAULT TARGET_CPU_strongarm
//===-- MSP430InstrInfo.h - MSP430 Instruction Information ------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file contains the MSP430 implementation of the TargetInstrInfo class. // //===----------------------------------------------------------------------===// #ifndef LLVM_TARGET_MSP430INSTRINFO_H #define LLVM_TARGET_MSP430INSTRINFO_H #include "MSP430RegisterInfo.h" #include "llvm/Target/TargetInstrInfo.h" #define GET_INSTRINFO_HEADER #include "MSP430GenInstrInfo.inc" namespace llvm { class MSP430Subtarget; /// MSP430II - This namespace holds all of the target specific flags that /// instruction info tracks. /// namespace MSP430II { enum { SizeShift = 2, SizeMask = 7 << SizeShift, SizeUnknown = 0 << SizeShift, SizeSpecial = 1 << SizeShift, Size2Bytes = 2 << SizeShift, Size4Bytes = 3 << SizeShift, Size6Bytes = 4 << SizeShift }; } class MSP430InstrInfo : public MSP430GenInstrInfo { const MSP430RegisterInfo RI; virtual void anchor(); public: explicit MSP430InstrInfo(MSP430Subtarget &STI); /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As /// such, whenever a client has an instance of instruction info, it should /// always be able to get register info as well (through this method). /// const TargetRegisterInfo &getRegisterInfo() const { return RI; } void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, DebugLoc DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const override; void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override; void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, int FrameIdx, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override; unsigned GetInstSizeInBytes(const MachineInstr *MI) const; // Branch folding goodness bool ReverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override; bool isUnpredicatedTerminator(const MachineInstr *MI) const override; bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl<MachineOperand> &Cond, bool AllowModify) const override; unsigned RemoveBranch(MachineBasicBlock &MBB) const override; unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, const SmallVectorImpl<MachineOperand> &Cond, DebugLoc DL) const override; }; } #endif
/* GWEN Copyright (c) 2010 Facepunch Studios See license in Gwen.h */ #pragma once #ifndef GWEN_CONTROLS_SCROLLBARBAR_H #define GWEN_CONTROLS_SCROLLBARBAR_H #include "Gwen/Controls/Dragger.h" #include "Gwen/Gwen.h" #include "Gwen/Skin.h" namespace Gwen { namespace ControlsInternal { class GWEN_EXPORT ScrollBarBar : public ControlsInternal::Dragger { public: GWEN_CONTROL( ScrollBarBar, ControlsInternal::Dragger ); virtual void Render( Skin::Base* skin ); virtual void Layout( Skin::Base* skin ); virtual void OnMouseMoved( int x, int y, int deltaX, int deltaY ); virtual void OnMouseClickLeft( int x, int y, bool bDown ); virtual void MoveTo( int x, int y ); virtual void SetHorizontal() { m_bHorizontal = true; } virtual void SetVertical() { m_bHorizontal = false; } virtual bool IsVertical() { return !m_bHorizontal; } virtual bool IsHorizontal() { return m_bHorizontal; } virtual bool IsDepressed() { return m_bDepressed; } protected: bool m_bHorizontal; }; } } #endif
/* * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef APPENDERCONSOLE_H #define APPENDERCONSOLE_H #include "Appender.h" #include <string> enum ColorTypes { BLACK, RED, GREEN, BROWN, BLUE, MAGENTA, CYAN, GREY, YELLOW, LRED, LGREEN, LBLUE, LMAGENTA, LCYAN, WHITE }; const uint8 MaxColors = uint8(WHITE) + 1; class AppenderConsole: public Appender { public: AppenderConsole(uint8 _id, std::string const& name, LogLevel level, AppenderFlags flags); void InitColors(const std::string& init_str); private: void SetColor(bool stdout_stream, ColorTypes color); void ResetColor(bool stdout_stream); void _write(LogMessage& message); bool _colored; ColorTypes _colors[MaxLogLevels]; }; #endif
/* Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef OBJECT_QUEUE_INCLUDED #define OBJECT_QUEUE_INCLUDED #include "i_object_reader.h" #include "abstract_object_reader_wrapper.h" #include "abstract_dump_task.h" #include "base/abstract_program.h" #include "thread_group.h" #include "base/mutex.h" #include "base/atomic.h" #include <map> #include <queue> namespace Mysql{ namespace Tools{ namespace Dump{ /** Wrapper to another Object Reader, adds all objects to read on queue. Allows specified number of threads to dequeue and process objects. */ class Object_queue : public Abstract_object_reader_wrapper, public I_object_reader { public: Object_queue( Mysql::I_callable<bool, const Mysql::Tools::Base::Message_data&>* message_handler, Simple_id_generator* object_id_generator, uint threads_count, Mysql::I_callable<void, bool>* thread_callback, Mysql::Tools::Base::Abstract_program* program); ~Object_queue(); void read_object(Item_processing_data* item_to_process); void stop_queue(); private: void queue_thread(); void task_availability_callback(const Abstract_dump_task* available_task); void add_ready_items_to_queue( std::map<const I_dump_task*, std::vector<Item_processing_data*>* > ::iterator it); /* Group of threads to process objects on queue. */ my_boost::thread_group m_thread_group; my_boost::mutex m_queue_mutex; /* Maps task to all processing items that processes specified task. */ std::map<const I_dump_task*, std::vector<Item_processing_data*>*> m_tasks_map; std::queue<Item_processing_data*> m_items_ready_for_processing; /* Standard callback on task completion to run all possible dependent tasks. */ Mysql::Instance_callback<void, const Abstract_dump_task*, Object_queue> m_task_availability_callback; /* Indicates if queue is running. If set to false, all pending and being processed tasks should complete, then queue is ready to close. */ my_boost::atomic_bool m_is_queue_running; /* Callback called when created thread is starting or exiting. Call is done in execution context of created thread. Parameter value of true is used for thread start, false for thread exit. */ Mysql::I_callable<void, bool>* m_thread_callback; Mysql::Tools::Base::Abstract_program* m_program; }; } } } #endif
/* PR target/89903 */ /* { dg-do compile { target ia32 } } */ /* { dg-options "-O2 -march=skylake" } */ int a, b; void foo (void) { unsigned long long d = 983040; d += a; d >>= (short) d; b = d; }
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ #ifndef foosdipv4acdfoo #define foosdipv4acdfoo /*** This file is part of systemd. Copyright (C) 2014 Axis Communications AB. All rights reserved. Copyright (C) 2015 Tom Gundersen 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 <stdbool.h> #include <netinet/in.h> #include <net/ethernet.h> #include "sd-event.h" enum { SD_IPV4ACD_EVENT_STOP = 0, SD_IPV4ACD_EVENT_BIND = 1, SD_IPV4ACD_EVENT_CONFLICT = 2, }; typedef struct sd_ipv4acd sd_ipv4acd; typedef void (*sd_ipv4acd_cb_t)(sd_ipv4acd *ll, int event, void *userdata); int sd_ipv4acd_detach_event(sd_ipv4acd *ll); int sd_ipv4acd_attach_event(sd_ipv4acd *ll, sd_event *event, int priority); int sd_ipv4acd_get_address(sd_ipv4acd *ll, struct in_addr *address); int sd_ipv4acd_set_callback(sd_ipv4acd *ll, sd_ipv4acd_cb_t cb, void *userdata); int sd_ipv4acd_set_mac(sd_ipv4acd *ll, const struct ether_addr *addr); int sd_ipv4acd_set_index(sd_ipv4acd *ll, int interface_index); int sd_ipv4acd_set_address(sd_ipv4acd *ll, const struct in_addr *address); bool sd_ipv4acd_is_running(sd_ipv4acd *ll); int sd_ipv4acd_start(sd_ipv4acd *ll); int sd_ipv4acd_stop(sd_ipv4acd *ll); sd_ipv4acd *sd_ipv4acd_ref(sd_ipv4acd *ll); sd_ipv4acd *sd_ipv4acd_unref(sd_ipv4acd *ll); int sd_ipv4acd_new (sd_ipv4acd **ret); #endif
// 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 BASE_PROFILER_TRACKED_TIME_H_ #define BASE_PROFILER_TRACKED_TIME_H_ #include "base/base_export.h" #include "base/basictypes.h" #include "base/time.h" namespace tracked_objects { typedef int DurationInt; //------------------------------------------------------------------------------ #define USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS #if defined(USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS) // TimeTicks maintains a wasteful 64 bits of data (we need less than 32), and on // windows, a 64 bit timer is expensive to even obtain. We use a simple // millisecond counter for most of our time values, as well as millisecond units // of duration between those values. This means we can only handle durations // up to 49 days (range), or 24 days (non-negative time durations). // We only define enough methods to service the needs of the tracking classes, // and our interfaces are modeled after what TimeTicks and TimeDelta use (so we // can swap them into place if we want to use the "real" classes). class BASE_EXPORT Duration { // Similar to base::TimeDelta. public: Duration(); Duration& operator+=(const Duration& other); Duration operator+(const Duration& other) const; bool operator==(const Duration& other) const; bool operator!=(const Duration& other) const; bool operator>(const Duration& other) const; static Duration FromMilliseconds(int ms); int32 InMilliseconds() const; private: friend class TrackedTime; explicit Duration(int32 duration); // Internal time is stored directly in milliseconds. int32 ms_; }; class BASE_EXPORT TrackedTime { // Similar to base::TimeTicks. public: TrackedTime(); explicit TrackedTime(const base::TimeTicks& time); static TrackedTime Now(); Duration operator-(const TrackedTime& other) const; TrackedTime operator+(const Duration& other) const; bool is_null() const; private: friend class Duration; explicit TrackedTime(int32 ms); // Internal duration is stored directly in milliseconds. uint32 ms_; }; #else // Just use full 64 bit time calculations, and the slower TimeTicks::Now(). // This allows us (as an alternative) to test with larger ranges of times, and // with a more thoroughly tested class. typedef base::TimeTicks TrackedTime; typedef base::TimeDelta Duration; #endif // USE_FAST_TIME_CLASS_FOR_DURATION_CALCULATIONS } // namespace tracked_objects #endif // BASE_PROFILER_TRACKED_TIME_H_
#include <stdio.h> #include <winpr/crt.h> #include <winpr/path.h> #include <winpr/tchar.h> #include <winpr/winpr.h> static const TCHAR testBasePathBackslash[] = _T("C:\\Program Files\\"); static const TCHAR testBasePathNoBackslash[] = _T("C:\\Program Files"); static const TCHAR testMorePathBackslash[] = _T("\\Microsoft Visual Studio 11.0"); static const TCHAR testMorePathNoBackslash[] = _T("Microsoft Visual Studio 11.0"); static const TCHAR testPathOut[] = _T("C:\\Program Files\\Microsoft Visual Studio 11.0"); int TestPathCchAppend(int argc, char* argv[]) { HRESULT status; TCHAR Path[PATHCCH_MAX_CCH]; size_t i; /* Base Path: Backslash, More Path: No Backslash */ _tcscpy(Path, testBasePathBackslash); status = PathCchAppend(Path, PATHCCH_MAX_CCH, testMorePathNoBackslash); if (status != S_OK) { _tprintf(_T("PathCchAppend status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } if (_tcscmp(Path, testPathOut) != 0) { _tprintf(_T("Path Mismatch: Actual: %s, Expected: %s\n"), Path, testPathOut); return -1; } /* Base Path: Backslash, More Path: Backslash */ _tcscpy(Path, testBasePathBackslash); status = PathCchAppend(Path, PATHCCH_MAX_CCH, testMorePathBackslash); if (status != S_OK) { _tprintf(_T("PathCchAppend status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } if (_tcscmp(Path, testPathOut) != 0) { _tprintf(_T("Path Mismatch: Actual: %s, Expected: %s\n"), Path, testPathOut); return -1; } /* Base Path: No Backslash, More Path: Backslash */ _tcscpy(Path, testBasePathNoBackslash); status = PathCchAppend(Path, PATHCCH_MAX_CCH, testMorePathBackslash); if (status != S_OK) { _tprintf(_T("PathCchAppend status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } if (_tcscmp(Path, testPathOut) != 0) { _tprintf(_T("Path Mismatch: Actual: %s, Expected: %s\n"), Path, testPathOut); return -1; } /* Base Path: No Backslash, More Path: No Backslash */ _tcscpy(Path, testBasePathNoBackslash); status = PathCchAppend(Path, PATHCCH_MAX_CCH, testMorePathNoBackslash); if (status != S_OK) { _tprintf(_T("PathCchAppend status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } if (_tcscmp(Path, testPathOut) != 0) { _tprintf(_T("Path Mismatch: Actual: %s, Expected: %s\n"), Path, testPathOut); return -1; } /* According to msdn a NULL Path is an invalid argument */ status = PathCchAppend(NULL, PATHCCH_MAX_CCH, testMorePathNoBackslash); if (status != E_INVALIDARG) { _tprintf(_T("PathCchAppend with NULL path unexpectedly returned status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } /* According to msdn a NULL pszMore is an invalid argument (although optional !?) */ _tcscpy(Path, testBasePathNoBackslash); status = PathCchAppend(Path, PATHCCH_MAX_CCH, NULL); if (status != E_INVALIDARG) { _tprintf(_T("PathCchAppend with NULL pszMore unexpectedly returned status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } /* According to msdn cchPath must be > 0 and <= PATHCCH_MAX_CCH */ _tcscpy(Path, testBasePathNoBackslash); status = PathCchAppend(Path, 0, testMorePathNoBackslash); if (status != E_INVALIDARG) { _tprintf(_T("PathCchAppend with cchPath value 0 unexpectedly returned status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } _tcscpy(Path, testBasePathNoBackslash); status = PathCchAppend(Path, PATHCCH_MAX_CCH + 1, testMorePathNoBackslash); if (status != E_INVALIDARG) { _tprintf(_T("PathCchAppend with cchPath value > PATHCCH_MAX_CCH unexpectedly returned status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } /* Resulting file must not exceed PATHCCH_MAX_CCH */ for (i = 0; i < PATHCCH_MAX_CCH - 1; i++) Path[i] = _T('X'); Path[PATHCCH_MAX_CCH - 1] = 0; status = PathCchAppend(Path, PATHCCH_MAX_CCH, _T("\\This cannot be appended to Path")); if (SUCCEEDED(status)) { _tprintf(_T("PathCchAppend unexepectedly succeeded with status: 0x%08")_T(PRIX32)_T("\n"), status); return -1; } return 0; }
#ifndef __TZ_NDBG_T__ #define __TZ_NDBG_T__ /* enable ndbg implementation */ //#define CC_ENABLE_NDBG extern void tz_ndbg_init(void); #endif /* __TZ_NDBG_T__ */
//===-- SystemZCallingConv.h - Calling conventions for SystemZ --*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef SYSTEMZCALLINGCONV_H #define SYSTEMZCALLINGCONV_H namespace llvm { namespace SystemZ { const unsigned NumArgGPRs = 5; extern const unsigned ArgGPRs[NumArgGPRs]; const unsigned NumArgFPRs = 4; extern const unsigned ArgFPRs[NumArgFPRs]; } // end namespace SystemZ } // end namespace llvm #endif
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #import "FBSimulatorSessionState.h" @class FBAgentLaunchConfiguration; @class FBApplicationLaunchConfiguration; /** Queries for obtaining information from Session State */ @interface FBSimulatorSessionState (Queries) /** Returns the Application that was launched most recently. Reaches into previous states in order to find Applications that have been terminated. */ - (FBApplicationLaunchConfiguration *)lastLaunchedApplication; /** Returns the Agent that was launched most recently. Reaches into previous states in order to find Agents that have been terminated. */ - (FBAgentLaunchConfiguration *)lastLaunchedAgent; /** Returns the Process State for the given launch configuration, does not reach into previous states. */ - (FBSimulatorSessionProcessState *)processForLaunchConfiguration:(FBProcessLaunchConfiguration *)launchConfig; /** Returns the Process State for the given binary, does not reach into previous states. */ - (FBSimulatorSessionProcessState *)processForBinary:(FBSimulatorBinary *)binary; /** Returns the Process State for the given Application, does not reach into previous states. */ - (FBSimulatorSessionProcessState *)processForApplication:(FBSimulatorApplication *)application; /** Returns Agent State for all running agents, does not reach into previous states. */ - (NSArray *)runningAgents; /** Returns Application State for all running applications, does not reach into previous states. */ - (NSArray *)runningApplications; /** Finds the first diagnostic for the provided name, matching the application. Reaches into previous states in order to find Diagnostics for Applications that have been terminated. */ - (id)diagnosticNamed:(NSString *)name forApplication:(FBSimulatorApplication *)application; /** Reaches into previous states in order to find Diagnostics for Applications. */ - (NSDictionary *)allDiagnostics; @end
// Copyright (c) 2010 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_FRAME_READY_MODE_INTERNAL_READY_MODE_STATE_H_ #define CHROME_FRAME_READY_MODE_INTERNAL_READY_MODE_STATE_H_ #pragma once // Allows the UI element to signal the user's response to a Ready Mode prompt. class ReadyModeState { public: virtual ~ReadyModeState() {} // Indicates that the user has temporarily declined the product. virtual void TemporarilyDeclineChromeFrame() = 0; // Indicates that the user has permanently declined the product. virtual void PermanentlyDeclineChromeFrame() = 0; // Indicates that the user has accepted the product. virtual void AcceptChromeFrame() = 0; }; // class ReadyModeState #endif // CHROME_FRAME_READY_MODE_INTERNAL_READY_MODE_STATE_H_
// Copyright (c) 2014 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #ifndef ATOM_BROWSER_UI_TRAY_ICON_COCOA_H_ #define ATOM_BROWSER_UI_TRAY_ICON_COCOA_H_ #import <Cocoa/Cocoa.h> #include <string> #include "atom/browser/ui/tray_icon.h" #include "base/mac/scoped_nsobject.h" @class AtomMenuController; @class StatusItemView; namespace atom { class TrayIconCocoa : public TrayIcon { public: TrayIconCocoa(); virtual ~TrayIconCocoa(); void SetImage(const gfx::Image& image) override; void SetPressedImage(const gfx::Image& image) override; void SetToolTip(const std::string& tool_tip) override; void SetTitle(const std::string& title) override; void SetHighlightMode(bool highlight) override; void PopContextMenu(const gfx::Point& pos) override; void SetContextMenu(ui::SimpleMenuModel* menu_model) override; private: // Atom custom view for NSStatusItem. base::scoped_nsobject<StatusItemView> status_item_view_; // Status menu shown when right-clicking the system icon. base::scoped_nsobject<AtomMenuController> menu_; DISALLOW_COPY_AND_ASSIGN(TrayIconCocoa); }; } // namespace atom #endif // ATOM_BROWSER_UI_TRAY_ICON_COCOA_H_
#ifndef JSON_SPIRIT_READ_STREAM #define JSON_SPIRIT_READ_STREAM // Copyright John W. Wilkinson 2007 - 2011 // Distributed under the MIT License, see accompanying file LICENSE.txt // json spirit version 4.05 #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include "json_spirit_reader_template.h" namespace json_spirit { // these classes allows you to read multiple top level contiguous values from a stream, // the normal stream read functions have a bug that prevent multiple top level values // from being read unless they are separated by spaces template< class Istream_type, class Value_type > class Stream_reader { public: Stream_reader( Istream_type& is ) : iters_( is ) { } bool read_next( Value_type& value ) { return read_range( iters_.begin_, iters_.end_, value ); } private: typedef Multi_pass_iters< Istream_type > Mp_iters; Mp_iters iters_; }; template< class Istream_type, class Value_type > class Stream_reader_thrower { public: Stream_reader_thrower( Istream_type& is ) : iters_( is ) , posn_begin_( iters_.begin_, iters_.end_ ) , posn_end_( iters_.end_, iters_.end_ ) { } void read_next( Value_type& value ) { posn_begin_ = read_range_or_throw( posn_begin_, posn_end_, value ); } private: typedef Multi_pass_iters< Istream_type > Mp_iters; typedef spirit_namespace::position_iterator< typename Mp_iters::Mp_iter > Posn_iter_t; Mp_iters iters_; Posn_iter_t posn_begin_, posn_end_; }; } #endif
// // ASNavigationController.h // AsyncDisplayKit // // Created by Garrett Moon on 4/27/16. // // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. // #import <UIKit/UIKit.h> #import <AsyncDisplayKit/ASVisibilityProtocols.h> NS_ASSUME_NONNULL_BEGIN /** * ASNavigationController * * @discussion ASNavigationController is a drop in replacement for UINavigationController * which improves memory efficiency by implementing the @c ASManagesChildVisibilityDepth protocol. * You can use ASNavigationController with regular UIViewControllers, as well as ASViewControllers. * It is safe to subclass or use even where AsyncDisplayKit is not adopted. * * @see ASManagesChildVisibilityDepth */ @interface ASNavigationController : UINavigationController <ASManagesChildVisibilityDepth> @end NS_ASSUME_NONNULL_END
/* * Various lcr related functions * * Copyright (C) 2009-2010 Juha Heinanen * * This file is part of SIP Router, a free SIP server. * * SIP Router 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 * * For a license to use the SIP Router software under conditions * other than those described here, or to purchase support for this * software, please contact iptel.org by e-mail at the following addresses: * info@iptel.org * * SIP Router 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 */ /*! * \file * \brief SIP-router lcr :: RPC API functions * \ingroup lcr * Module: \ref lcr */ #ifndef _LCR_RPC_H #define _LCR_RPC_H #ifndef NO_RPC_SUPPORT #define RPC_SUPPORT /* support SIP Router RPCs by default */ #endif #ifdef RPC_SUPPORT #include "../../rpc.h" extern rpc_export_t lcr_rpc[]; #endif /* RPC_SUPPORT */ #endif /* _LCR_RPC_H */
/*! \file * \brief log2comp.h - various base 2 log computation versions * * Asterisk -- An open source telephony toolkit. * * \author Alex Volkov <codepro@usa.net> * * Copyright (c) 2004 - 2005, Digium Inc. * * This program is free software, distributed under the terms of * the GNU General Public License * * Define WANT_ASM before including this file to use assembly * whenever possible */ #if defined(_MSC_VER) # define inline __inline #elif defined(__GNUC__) # define inline __inline__ #else # define inline #endif #if defined(WANT_ASM) && defined(_MSC_VER) && defined(_M_IX86) /* MS C Inline Asm */ # pragma warning( disable : 4035 ) static inline int ilog2(int val) { __asm { xor eax, eax dec eax bsr eax, val }} # pragma warning( default : 4035 ) #elif defined(WANT_ASM) && defined(__GNUC__) && (defined(__i386__) || defined(i386)) /* GNU Inline Asm */ static inline int ilog2(int val) { int a; __asm__ ("\ xorl %0, %0 ;\ decl %0 ;\ bsrl %1, %0 ;\ " : "=&r" (a) : "mr" (val) : "cc" ); return a; } #elif defined(WANT_ASM) && defined(__GNUC__) && defined(__powerpc__) static inline int ilog2(int val) { int a; __asm__ ("cntlzw %0,%1" : "=r" (a) : "r" (val) ); return 31-a; } #else /* no ASM for this compiler and/or platform */ /* rather slow base 2 log computation * Using looped shift. */ static inline int ilog2(int val) { int i; for (i = -1; val; ++i, val >>= 1) ; return (i); } #endif