text
stringlengths
4
6.14k
#include <stdbool.h> extern bool __VERIFIER_nondet_bool(); extern int __VERIFIER_nondet_int(); extern int __VERIFIER_nondet_int8_t(); extern void* __VERIFIER_nondet_pointer(); extern float __VERIFIER_nondet_float(); extern long __VERIFIER_nondet_long(); extern int nondet_int(); int main() { int a = __VERIFIER_nondet_int(); bool b = __VERIFIER_nondet_bool(); void* pointer = __VERIFIER_nondet_pointer(); int c = __VERIFIER_nondet_int8_t(); long d = __VERIFIER_nondet_long(); float e = __VERIFIER_nondet_float(); int f = nondet_int(); }
/* * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ #ifndef _SOLARIS_JLONG_MD_H_ #define _SOLARIS_JLONG_MD_H_ /* Make sure ptrdiff_t is defined */ #include <stddef.h> #include "typedefs.h" #define jlong_high(a) ((jint)((a)>>32)) #define jlong_low(a) ((jint)(a)) #define jlong_add(a, b) ((a) + (b)) #define jlong_and(a, b) ((a) & (b)) #define jlong_div(a, b) ((a) / (b)) #define jlong_mul(a, b) ((a) * (b)) #define jlong_neg(a) (-(a)) #define jlong_not(a) (~(a)) #define jlong_or(a, b) ((a) | (b)) #define jlong_shl(a, n) ((a) << (n)) #define jlong_shr(a, n) ((a) >> (n)) #define jlong_sub(a, b) ((a) - (b)) #define jlong_xor(a, b) ((a) ^ (b)) #define jlong_rem(a,b) ((a) % (b)) /* comparison operators */ #define jlong_ltz(ll) ((ll)<0) #define jlong_gez(ll) ((ll)>=0) #define jlong_gtz(ll) ((ll)>0) #define jlong_eqz(a) ((a) == 0) #define jlong_eq(a, b) ((a) == (b)) #define jlong_ne(a,b) ((a) != (b)) #define jlong_ge(a,b) ((a) >= (b)) #define jlong_le(a,b) ((a) <= (b)) #define jlong_lt(a,b) ((a) < (b)) #define jlong_gt(a,b) ((a) > (b)) #define jlong_zero ((jlong) 0) #define jlong_one ((jlong) 1) #define jlong_minus_one ((jlong) -1) /* For static variables initialized to zero */ #define jlong_zero_init ((jlong) 0L) #ifdef _LP64 #define jlong_to_ptr(a) ((void*)(a)) #define ptr_to_jlong(a) ((jlong)(a)) #else #define jlong_to_ptr(a) ((void*)(int)(a)) #define ptr_to_jlong(a) ((jlong)(int)(a)) #endif #define jint_to_jlong(a) ((jlong)(a)) #define jlong_to_jint(a) ((jint)(a)) /* Useful on machines where jlong and jdouble have different endianness. */ #define jlong_to_jdouble_bits(a) #define jdouble_to_jlong_bits(a) #define jlong_to_int(a) ((int)(a)) #define int_to_jlong(a) ((jlong)(a)) #define jlong_to_uint(a) ((unsigned int)(a)) #define uint_to_jlong(a) ((jlong)(a)) #define jlong_to_ptrdiff(a) ((ptrdiff_t)(a)) #define ptrdiff_to_jlong(a) ((jlong)(a)) #define jlong_to_size(a) ((size_t)(a)) #define size_to_jlong(a) ((jlong)(a)) #define long_to_jlong(a) ((jlong)(a)) #endif /* !_SOLARIS_JLONG_MD_H_ */
/* * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * __ieee754_scalb(x, fn) is provide for * passing various standard test suite. One * should use scalbn() instead. */ #include "fdlibm.h" #ifdef _SCALB_INT #ifdef __STDC__ double __ieee754_scalb(double x, int fn) #else double __ieee754_scalb(x,fn) double x; int fn; #endif #else #ifdef __STDC__ double __ieee754_scalb(double x, double fn) #else double __ieee754_scalb(x,fn) double x, fn; #endif #endif { #ifdef _SCALB_INT return scalbn(x,fn); #else if (isnan(x)||isnan(fn)) return x*fn; if (!finite(fn)) { if(fn>0.0) return x*fn; else return x/(-fn); } if (rint(fn)!=fn) return (fn-fn)/(fn-fn); if ( fn > 65000.0) return scalbn(x, 65000); if (-fn > 65000.0) return scalbn(x,-65000); return scalbn(x,(int)fn); #endif }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #pragma once #include <arrow-glib/arrow-glib.h> #include <arrow-dataset-glib/dataset-factory.h> #include <arrow-dataset-glib/dataset.h> #include <arrow-dataset-glib/enums.h> #include <arrow-dataset-glib/file-format.h> #include <arrow-dataset-glib/fragment.h> #include <arrow-dataset-glib/partitioning.h> #include <arrow-dataset-glib/scanner.h>
/* * Copyright (C) 2018 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef VK_VIRTUAL_SWAPCHAIN_PLATFORM_H_ #define VK_VIRTUAL_SWAPCHAIN_PLATFORM_H_ #include "vulkan/vulkan.h" #include "layer.h" namespace swapchain { void CreateSurface(const InstanceData* functions, VkInstance instance, const void* data, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); } #endif // VK_VIRTUAL_SWAPCHAIN_PLATFORM_H_
/** * WinPR: Windows Portable Runtime * Serial Communication API * * Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com> * Copyright 2014 Hewlett-Packard Development Company, L.P. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef WINPR_COMM_PRIVATE_H #define WINPR_COMM_PRIVATE_H #if defined __linux__ && !defined ANDROID #include <linux/serial.h> #include <sys/eventfd.h> #include <winpr/comm.h> #include "../handle/handle.h" #include "config.h" struct winpr_comm { WINPR_HANDLE_DEF(); int fd; int fd_read; int fd_read_event; /* as of today, only used by _purge() */ CRITICAL_SECTION ReadLock; int fd_write; int fd_write_event; /* as of today, only used by _purge() */ CRITICAL_SECTION WriteLock; /* permissive mode on errors. If TRUE (default is FALSE) * CommDeviceIoControl always return TRUE. * * Not all features are supported yet and an error is then returned when * an application turns them on (e.g: i/o buffers > 4096). It appeared * though that devices and applications can be still functional on such * errors. * * see also: comm_ioctl.c * * FIXME: getting rid of this flag once all features supported. */ BOOL permissive; SERIAL_DRIVER_ID serverSerialDriverId; COMMTIMEOUTS timeouts; CRITICAL_SECTION EventsLock; /* protects counters, WaitEventMask and PendingEvents */ struct serial_icounter_struct counters; ULONG WaitEventMask; ULONG PendingEvents; /* NB: CloseHandle() has to free resources */ }; typedef struct winpr_comm WINPR_COMM; #define SERIAL_EV_RXCHAR 0x0001 #define SERIAL_EV_RXFLAG 0x0002 #define SERIAL_EV_TXEMPTY 0x0004 #define SERIAL_EV_CTS 0x0008 #define SERIAL_EV_DSR 0x0010 #define SERIAL_EV_RLSD 0x0020 #define SERIAL_EV_BREAK 0x0040 #define SERIAL_EV_ERR 0x0080 #define SERIAL_EV_RING 0x0100 #define SERIAL_EV_PERR 0x0200 #define SERIAL_EV_RX80FULL 0x0400 #define SERIAL_EV_EVENT1 0x0800 #define SERIAL_EV_EVENT2 0x1000 #define SERIAL_EV_FREERDP_WAITING 0x4000 /* bit today unused by other SERIAL_EV_* */ #define SERIAL_EV_FREERDP_STOP 0x8000 /* bit today unused by other SERIAL_EV_* */ #define FREERDP_PURGE_TXABORT 0x00000001 /* abort pending transmission */ #define FREERDP_PURGE_RXABORT 0x00000002 /* abort pending reception */ void CommLog_Print(int wlog_level, ...); BOOL CommIsHandled(HANDLE handle); BOOL CommCloseHandle(HANDLE handle); #ifndef WITH_EVENTFD_READ_WRITE int eventfd_read(int fd, eventfd_t* value); int eventfd_write(int fd, eventfd_t value); #endif #endif /* __linux__ */ #endif /* WINPR_COMM_PRIVATE_H */
/* * Copyright (c) 2017 Jean-Paul Etienne <fractalclone@gmail.com> * * SPDX-License-Identifier: Apache-2.0 */ /** * @file configuration macros for riscv SOCs supporting the riscv * privileged architecture specification */ #ifndef __SOC_COMMON_H_ #define __SOC_COMMON_H_ /* IRQ numbers */ #define RISCV_MACHINE_SOFT_IRQ 3 /* Machine Software Interrupt */ #define RISCV_MACHINE_TIMER_IRQ 7 /* Machine Timer Interrupt */ #define RISCV_MACHINE_EXT_IRQ 11 /* Machine External Interrupt */ /* ECALL Exception numbers */ #define SOC_MCAUSE_ECALL_EXP 11 /* Machine ECALL instruction */ #define SOC_MCAUSE_USER_ECALL_EXP 8 /* User ECALL instruction */ /* SOC-specific MCAUSE bitfields */ #ifdef CONFIG_64BIT /* Interrupt Mask */ #define SOC_MCAUSE_IRQ_MASK (1 << 63) /* Exception code Mask */ #define SOC_MCAUSE_EXP_MASK 0x7FFFFFFFFFFFFFFF #else /* Interrupt Mask */ #define SOC_MCAUSE_IRQ_MASK (1 << 31) /* Exception code Mask */ #define SOC_MCAUSE_EXP_MASK 0x7FFFFFFF #endif /* SOC-Specific EXIT ISR command */ #define SOC_ERET mret #ifndef _ASMLANGUAGE #if defined(CONFIG_RISCV_SOC_INTERRUPT_INIT) void soc_interrupt_init(void); #endif #if defined(CONFIG_RISCV_HAS_PLIC) void riscv_plic_irq_enable(uint32_t irq); void riscv_plic_irq_disable(uint32_t irq); int riscv_plic_irq_is_enabled(uint32_t irq); void riscv_plic_set_priority(uint32_t irq, uint32_t priority); int riscv_plic_get_irq(void); #endif #endif /* !_ASMLANGUAGE */ #endif /* __SOC_COMMON_H_ */
#ifndef _IPXE_GUESTRPC_H #define _IPXE_GUESTRPC_H /** @file * * VMware GuestRPC mechanism * */ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <stdint.h> #include <ipxe/vmware.h> /** GuestRPC magic number */ #define GUESTRPC_MAGIC 0x49435052 /* "RPCI" */ /** Open RPC channel */ #define GUESTRPC_OPEN 0x00 /** Open RPC channel success status */ #define GUESTRPC_OPEN_SUCCESS 0x00010000 /** Send RPC command length */ #define GUESTRPC_COMMAND_LEN 0x01 /** Send RPC command length success status */ #define GUESTRPC_COMMAND_LEN_SUCCESS 0x00810000 /** Send RPC command data */ #define GUESTRPC_COMMAND_DATA 0x02 /** Send RPC command data success status */ #define GUESTRPC_COMMAND_DATA_SUCCESS 0x00010000 /** Receive RPC reply length */ #define GUESTRPC_REPLY_LEN 0x03 /** Receive RPC reply length success status */ #define GUESTRPC_REPLY_LEN_SUCCESS 0x00830000 /** Receive RPC reply data */ #define GUESTRPC_REPLY_DATA 0x04 /** Receive RPC reply data success status */ #define GUESTRPC_REPLY_DATA_SUCCESS 0x00010000 /** Finish receiving RPC reply */ #define GUESTRPC_REPLY_FINISH 0x05 /** Finish receiving RPC reply success status */ #define GUESTRPC_REPLY_FINISH_SUCCESS 0x00010000 /** Close RPC channel */ #define GUESTRPC_CLOSE 0x06 /** Close RPC channel success status */ #define GUESTRPC_CLOSE_SUCCESS 0x00010000 /** RPC command success status */ #define GUESTRPC_SUCCESS 0x2031 /* "1 " */ extern int guestrpc_open ( void ); extern void guestrpc_close ( int channel ); extern int guestrpc_command ( int channel, const char *command, char *reply, size_t reply_len ); #endif /* _IPXE_GUESTRPC_H */
// Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. #ifndef STORAGE_LEVELDB_DB_MEMTABLE_H_ #define STORAGE_LEVELDB_DB_MEMTABLE_H_ #include <string> #include "leveldb/db.h" #include "db/dbformat.h" #include "db/skiplist.h" #include "util/arena.h" namespace leveldb { class InternalKeyComparator; class MemTableIterator; class MemTable { public: // MemTables are reference counted. The initial reference count // is zero and the caller must call Ref() at least once. explicit MemTable(const InternalKeyComparator& comparator); // Increase reference count. void Ref() { ++refs_; } // Drop reference count. Delete if no more references exist. void Unref() { --refs_; assert(refs_ >= 0); if (refs_ <= 0) { delete this; } } // Returns an estimate of the number of bytes of data in use by this // data structure. It is safe to call when MemTable is being modified. size_t ApproximateMemoryUsage(); // Return an iterator that yields the contents of the memtable. // // The caller must ensure that the underlying MemTable remains live // while the returned iterator is live. The keys returned by this // iterator are internal keys encoded by AppendInternalKey in the // db/format.{h,cc} module. Iterator* NewIterator(); // Add an entry into memtable that maps key to value at the // specified sequence number and with the specified type. // Typically value will be empty if type==kTypeDeletion. void Add(SequenceNumber seq, ValueType type, const Slice& key, const Slice& value); // If memtable contains a value for key, store it in *value and return true. // If memtable contains a deletion for key, store a NotFound() error // in *status and return true. // Else, return false. bool Get(const LookupKey& key, std::string* value, Status* s); private: ~MemTable(); // Private since only Unref() should be used to delete it struct KeyComparator { const InternalKeyComparator comparator; explicit KeyComparator(const InternalKeyComparator& c) : comparator(c) { } int operator()(const char* a, const char* b) const; }; friend class MemTableIterator; friend class MemTableBackwardIterator; typedef SkipList<const char*, KeyComparator> Table; KeyComparator comparator_; int refs_; Arena arena_; Table table_; // No copying allowed MemTable(const MemTable&); void operator=(const MemTable&); }; } // namespace leveldb #endif // STORAGE_LEVELDB_DB_MEMTABLE_H_
#ifndef APPEARANCEPAGE_H #define APPEARANCEPAGE_H #include "tabpage.h" namespace Ui { class AppearancePage; class PreviewForm; } class QStyle; class QAction; class AppearancePage : public TabPage{ Q_OBJECT public: explicit AppearancePage(QWidget *parent = 0); ~AppearancePage(); void writeSettings(); private slots: void on_styleComboBox_activated(const QString &text); void on_colorSchemeComboBox_activated(int); void createColorScheme(); void changeColorScheme(); void removeColorScheme(); void copyColorScheme(); void renameColorScheme(); void updatePalette(); void setPreviewPalette(const QPalette &p); void updateActions(); private: void readSettings(); void setStyle(QWidget *w, QStyle *s); void setPalette(QWidget *w, QPalette p); void findColorSchemes(QStringList paths); QPalette loadColorScheme(const QString &filePath); void createColorScheme(const QString &name, const QPalette &palette); Ui::AppearancePage *m_ui; QStyle *m_selectedStyle = nullptr; QPalette m_customPalette; QWidget *m_previewWidget; QAction *m_changeColorSchemeAction, *m_renameColorSchemeAction, *m_removeColorSchemeAction; Ui::PreviewForm *m_previewUi; }; #endif // APPEARANCEPAGE_H
// gst-plugin/gst-online-decode-faster.h // Copyright 2013 Tanel Alumae, Tallinn University of Technology // See ../../COPYING for clarification regarding multiple authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, // MERCHANTABLITY OR NON-INFRINGEMENT. // See the Apache 2 License for the specific language governing permissions and // limitations under the License. #ifndef KALDI_GST_PLUGIN_GST_ONLINE_GMM_DECODE_FASTER_H_ #define KALDI_GST_PLUGIN_GST_ONLINE_GMM_DECODE_FASTER_H_ #include <vector> #include <gst/gst.h> #include "feat/feature-mfcc.h" #include "online/online-audio-source.h" #include "online/online-feat-input.h" #include "online/online-decodable.h" #include "online/online-faster-decoder.h" #include "online/onlinebin-util.h" #include "util/simple-options.h" #include "gst-plugin/gst-audio-source.h" namespace kaldi { typedef OnlineFeInput<Mfcc> FeInput; G_BEGIN_DECLS /* #defines don't like whitespacey bits */ #define GST_TYPE_ONLINEGMMDECODEFASTER (gst_online_gmm_decode_faster_get_type()) #define GST_ONLINEGMMDECODEFASTER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_ONLINEGMMDECODEFASTER, \ GstOnlineGmmDecodeFaster)) #define GST_ONLINEGMMDECODEFASTER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_ONLINEGMMDECODEFASTER, \ GstOnlineGmmDecodeFasterClass)) #define GST_IS_ONLINEGMMDECODEFASTER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_ONLINEGMMDECODEFASTER)) #define GST_IS_ONLINEGMMDECODEFASTER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_ONLINEGMMDECODEFASTER)) typedef struct _GstOnlineGmmDecodeFaster GstOnlineGmmDecodeFaster; typedef struct _GstOnlineGmmDecodeFasterClass GstOnlineGmmDecodeFasterClass; uint32 kSampleFreq = 16000; struct _GstOnlineGmmDecodeFaster { GstElement element; GstPad *sinkpad_, *srcpad_; bool silent_; OnlineFasterDecoder *decoder_; Matrix<BaseFloat> *lda_transform_; TransitionModel *trans_model_; AmDiagGmm *am_gmm_; fst::Fst<fst::StdArc> *decode_fst_; fst::SymbolTable *word_syms_; fst::VectorFst<LatticeArc> *out_fst_; GstBufferSource *au_src_; gchar *model_rspecifier_; gchar *fst_rspecifier_; gchar *word_syms_filename_; gchar *lda_mat_rspecifier_; std::vector<int32> *silence_phones_; BaseFloat acoustic_scale_; int32 cmn_window_; int32 min_cmn_window_; int32 right_context_, left_context_; OnlineFasterDecoderOpts *decoder_opts_; OnlineFeatureMatrixOptions *feature_reading_opts_; SimpleOptions *simple_options_; }; struct _GstOnlineGmmDecodeFasterClass { GstElementClass parent_class; void (*hyp_word)(GstElement *element, const gchar *hyp_str); }; GType gst_online_gmm_decode_faster_get_type(void); G_END_DECLS } #endif // KALDI_GST_PLUGIN_GST_ONLINE_GMM_DECODE_FASTER_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_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_EVENT_ROUTER_H_ #define CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_EVENT_ROUTER_H_ #include <vector> #include "base/memory/singleton.h" #include "chrome/common/extensions/api/automation_internal.h" #include "content/public/browser/ax_event_notification_details.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "extensions/common/extension.h" class Profile; namespace content { class BrowserContext; } // namespace content struct ExtensionMsg_AccessibilityEventParams; namespace extensions { struct AutomationListener; class AutomationEventRouter : public content::NotificationObserver { public: static AutomationEventRouter* GetInstance(); // Indicates that the listener at |listener_process_id|, |listener_routing_id| // wants to receive automation events from the accessibility tree indicated // by |source_ax_tree_id|. Automation events are forwarded from now on // until the listener process dies. void RegisterListenerForOneTree(const ExtensionId& extension_id, int listener_process_id, int listener_routing_id, int source_ax_tree_id); // Indicates that the listener at |listener_process_id|, |listener_routing_id| // wants to receive automation events from all accessibility trees because // it has Desktop permission. void RegisterListenerWithDesktopPermission(const ExtensionId& extension_id, int listener_process_id, int listener_routing_id); void DispatchAccessibilityEvent( const ExtensionMsg_AccessibilityEventParams& params); // Notify all automation extensions that an accessibility tree was // destroyed. If |browser_context| is null, void DispatchTreeDestroyedEvent( int tree_id, content::BrowserContext* browser_context); private: struct AutomationListener { AutomationListener(); ~AutomationListener(); ExtensionId extension_id; int routing_id; int process_id; bool desktop; std::set<int> tree_ids; bool is_active_profile; }; AutomationEventRouter(); ~AutomationEventRouter() override; void Register( const ExtensionId& extension_id, int listener_process_id, int listener_routing_id, int source_ax_tree_id, bool desktop); // content::NotificationObserver interface. void Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) override; // Called when the user switches profiles or when a listener is added // or removed. The purpose is to ensure that multiple instances of the // same extension running in different profiles don't interfere with one // another, so in that case only the one associated with the active profile // is marked as active. // // This is needed on Chrome OS because ChromeVox loads into the login profile // in addition to the active profile. If a similar fix is needed on other // platforms, we'd need an equivalent of SessionStateObserver that works // everywhere. void UpdateActiveProfile(); content::NotificationRegistrar registrar_; std::vector<AutomationListener> listeners_; Profile* active_profile_; friend struct base::DefaultSingletonTraits<AutomationEventRouter>; DISALLOW_COPY_AND_ASSIGN(AutomationEventRouter); }; } // namespace extensions #endif // CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_EVENT_ROUTER_H_
// Copyright (c) 2015 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. // // --------------------------------------------------------------------------- // // This file was generated by the CEF translator tool. If making changes by // hand only do so within the body of existing method and function // implementations. See the translator.README.txt file in the tools directory // for more information. // #ifndef CEF_LIBCEF_DLL_CPPTOC_V8VALUE_CPPTOC_H_ #define CEF_LIBCEF_DLL_CPPTOC_V8VALUE_CPPTOC_H_ #pragma once #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED #include "include/cef_v8.h" #include "include/capi/cef_v8_capi.h" #include "libcef_dll/cpptoc/cpptoc.h" // Wrap a C++ class with a C structure. // This class may be instantiated and accessed DLL-side only. class CefV8ValueCppToC : public CefCppToC<CefV8ValueCppToC, CefV8Value, cef_v8value_t> { public: explicit CefV8ValueCppToC(CefV8Value* cls); }; #endif // BUILDING_CEF_SHARED #endif // CEF_LIBCEF_DLL_CPPTOC_V8VALUE_CPPTOC_H_
/* * Copyright © 2013-2014 Collabora, Ltd. * * 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 (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #ifndef SCALER_CLIENT_PROTOCOL_H #define SCALER_CLIENT_PROTOCOL_H #ifdef __cplusplus extern "C" { #endif #include <stdint.h> #include <stddef.h> #include "wayland-client.h" struct wl_client; struct wl_resource; struct wl_scaler; struct wl_surface; struct wl_viewport; extern const struct wl_interface wl_scaler_interface; extern const struct wl_interface wl_viewport_interface; #ifndef WL_SCALER_ERROR_ENUM #define WL_SCALER_ERROR_ENUM enum wl_scaler_error { WL_SCALER_ERROR_VIEWPORT_EXISTS = 0, }; #endif /* WL_SCALER_ERROR_ENUM */ #define WL_SCALER_DESTROY 0 #define WL_SCALER_GET_VIEWPORT 1 #define WL_SCALER_DESTROY_SINCE_VERSION 1 #define WL_SCALER_GET_VIEWPORT_SINCE_VERSION 1 static inline void wl_scaler_set_user_data(struct wl_scaler *wl_scaler, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_scaler, user_data); } static inline void * wl_scaler_get_user_data(struct wl_scaler *wl_scaler) { return wl_proxy_get_user_data((struct wl_proxy *) wl_scaler); } static inline uint32_t wl_scaler_get_version(struct wl_scaler *wl_scaler) { return wl_proxy_get_version((struct wl_proxy *) wl_scaler); } static inline void wl_scaler_destroy(struct wl_scaler *wl_scaler) { wl_proxy_marshal((struct wl_proxy *) wl_scaler, WL_SCALER_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_scaler); } static inline struct wl_viewport * wl_scaler_get_viewport(struct wl_scaler *wl_scaler, struct wl_surface *surface) { struct wl_proxy *id; id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_scaler, WL_SCALER_GET_VIEWPORT, &wl_viewport_interface, NULL, surface); return (struct wl_viewport *) id; } #ifndef WL_VIEWPORT_ERROR_ENUM #define WL_VIEWPORT_ERROR_ENUM enum wl_viewport_error { WL_VIEWPORT_ERROR_BAD_VALUE = 0, }; #endif /* WL_VIEWPORT_ERROR_ENUM */ #define WL_VIEWPORT_DESTROY 0 #define WL_VIEWPORT_SET 1 #define WL_VIEWPORT_SET_SOURCE 2 #define WL_VIEWPORT_SET_DESTINATION 3 #define WL_VIEWPORT_DESTROY_SINCE_VERSION 1 #define WL_VIEWPORT_SET_SINCE_VERSION 1 #define WL_VIEWPORT_SET_SOURCE_SINCE_VERSION 2 #define WL_VIEWPORT_SET_DESTINATION_SINCE_VERSION 2 static inline void wl_viewport_set_user_data(struct wl_viewport *wl_viewport, void *user_data) { wl_proxy_set_user_data((struct wl_proxy *) wl_viewport, user_data); } static inline void * wl_viewport_get_user_data(struct wl_viewport *wl_viewport) { return wl_proxy_get_user_data((struct wl_proxy *) wl_viewport); } static inline uint32_t wl_viewport_get_version(struct wl_viewport *wl_viewport) { return wl_proxy_get_version((struct wl_proxy *) wl_viewport); } static inline void wl_viewport_destroy(struct wl_viewport *wl_viewport) { wl_proxy_marshal((struct wl_proxy *) wl_viewport, WL_VIEWPORT_DESTROY); wl_proxy_destroy((struct wl_proxy *) wl_viewport); } static inline void wl_viewport_set(struct wl_viewport *wl_viewport, wl_fixed_t src_x, wl_fixed_t src_y, wl_fixed_t src_width, wl_fixed_t src_height, int32_t dst_width, int32_t dst_height) { wl_proxy_marshal((struct wl_proxy *) wl_viewport, WL_VIEWPORT_SET, src_x, src_y, src_width, src_height, dst_width, dst_height); } static inline void wl_viewport_set_source(struct wl_viewport *wl_viewport, wl_fixed_t x, wl_fixed_t y, wl_fixed_t width, wl_fixed_t height) { wl_proxy_marshal((struct wl_proxy *) wl_viewport, WL_VIEWPORT_SET_SOURCE, x, y, width, height); } static inline void wl_viewport_set_destination(struct wl_viewport *wl_viewport, int32_t width, int32_t height) { wl_proxy_marshal((struct wl_proxy *) wl_viewport, WL_VIEWPORT_SET_DESTINATION, width, height); } #ifdef __cplusplus } #endif #endif
#define REDIS_GIT_SHA1 "00000000" #define REDIS_GIT_DIRTY "0"
/***************************************************************************** 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 high-level C interface to LAPACK function cppcon * Author: Intel Corporation * Generated November 2015 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_cppcon( int matrix_layout, char uplo, lapack_int n, const lapack_complex_float* ap, float anorm, float* rcond ) { lapack_int info = 0; float* rwork = NULL; lapack_complex_float* work = NULL; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_cppcon", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_s_nancheck( 1, &anorm, 1 ) ) { return -5; } if( LAPACKE_cpp_nancheck( n, ap ) ) { return -4; } } #endif /* Allocate memory for working array(s) */ rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) ); if( rwork == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } work = (lapack_complex_float*) LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,2*n) ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_1; } /* Call middle-level interface */ info = LAPACKE_cppcon_work( matrix_layout, uplo, n, ap, anorm, rcond, work, rwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_1: LAPACKE_free( rwork ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_cppcon", info ); } return info; }
// Copyright (c) 2017 Marshall A. Greenblatt. 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 name Chromium Embedded // Framework 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. // // --------------------------------------------------------------------------- // // This file was generated by the CEF translator tool and should not edited // by hand. See the translator.README.txt file in the tools directory for // more information. // // $hash=a8fdbd327fff7769353b0aba47c74cba61333144$ // #ifndef CEF_INCLUDE_CAPI_CEF_WAITABLE_EVENT_CAPI_H_ #define CEF_INCLUDE_CAPI_CEF_WAITABLE_EVENT_CAPI_H_ #pragma once #include "include/capi/cef_base_capi.h" #ifdef __cplusplus extern "C" { #endif /// // WaitableEvent is a thread synchronization tool that allows one thread to wait // for another thread to finish some work. This is equivalent to using a // Lock+ConditionVariable to protect a simple boolean value. However, using // WaitableEvent in conjunction with a Lock to wait for a more complex state // change (e.g., for an item to be added to a queue) is not recommended. In that // case consider using a ConditionVariable instead of a WaitableEvent. It is // safe to create and/or signal a WaitableEvent from any thread. Blocking on a // WaitableEvent by calling the *wait() functions is not allowed on the browser // process UI or IO threads. /// typedef struct _cef_waitable_event_t { /// // Base structure. /// cef_base_ref_counted_t base; /// // Put the event in the un-signaled state. /// void(CEF_CALLBACK* reset)(struct _cef_waitable_event_t* self); /// // Put the event in the signaled state. This causes any thread blocked on Wait // to be woken up. /// void(CEF_CALLBACK* signal)(struct _cef_waitable_event_t* self); /// // Returns true (1) if the event is in the signaled state, else false (0). If // the event was created with |automatic_reset| set to true (1) then calling // this function will also cause a reset. /// int(CEF_CALLBACK* is_signaled)(struct _cef_waitable_event_t* self); /// // Wait indefinitely for the event to be signaled. This function will not // return until after the call to signal() has completed. This function cannot // be called on the browser process UI or IO threads. /// void(CEF_CALLBACK* wait)(struct _cef_waitable_event_t* self); /// // Wait up to |max_ms| milliseconds for the event to be signaled. Returns true // (1) if the event was signaled. A return value of false (0) does not // necessarily mean that |max_ms| was exceeded. This function will not return // until after the call to signal() has completed. This function cannot be // called on the browser process UI or IO threads. /// int(CEF_CALLBACK* timed_wait)(struct _cef_waitable_event_t* self, int64 max_ms); } cef_waitable_event_t; /// // Create a new waitable event. If |automatic_reset| is true (1) then the event // state is automatically reset to un-signaled after a single waiting thread has // been released; otherwise, the state remains signaled until reset() is called // manually. If |initially_signaled| is true (1) then the event will start in // the signaled state. /// CEF_EXPORT cef_waitable_event_t* cef_waitable_event_create( int automatic_reset, int initially_signaled); #ifdef __cplusplus } #endif #endif // CEF_INCLUDE_CAPI_CEF_WAITABLE_EVENT_CAPI_H_
#ifndef CRYPTO_H #define CRYPTO_H #include <string.h> #include <stdio.h> #include <stdlib.h> #include <ntp_fp.h> #include <ntp.h> #include <ntp_stdlib.h> #include <ntp_md5.h> /* provides OpenSSL digest API */ #include "utilities.h" #include "sntp-opts.h" #define LEN_PKT_MAC LEN_PKT_NOMAC + sizeof(u_int32) /* #include "sntp-opts.h" */ struct key { struct key * next; int key_id; int key_len; char type[10]; char key_seq[64]; }; extern int auth_init(const char *keyfile, struct key **keys); extern void get_key(int key_id, struct key **d_key); extern int make_mac(const void *pkt_data, int pkt_size, int mac_size, const struct key *cmp_key, void *digest); extern int auth_md5(const void *pkt_data, int pkt_size, int mac_size, const struct key *cmp_key); #endif
#import <UIKit/UIKit.h> @interface NTLNConfiguration : NSObject { BOOL useSafari; BOOL darkColorTheme; BOOL autoScroll; int refreshIntervalSeconds; BOOL showMoreTweetMode; int fetchCount; BOOL shakeToFullscreen; BOOL lefthand; } @property (readonly) BOOL useSafari; @property (readonly) BOOL darkColorTheme; @property (readonly) BOOL autoScroll; @property (readonly) BOOL showMoreTweetMode; @property (readonly) BOOL shakeToFullscreen; @property (readonly) BOOL lefthand; + (id) instance; - (void)reload; - (int)refreshIntervalSeconds; - (int)fetchCount; @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_UI_WEBUI_CRASHES_UI_H_ #define CHROME_BROWSER_UI_WEBUI_CRASHES_UI_H_ #pragma once #include "content/public/browser/web_ui_controller.h" namespace base { class RefCountedMemory; } class CrashesUI : public content::WebUIController { public: explicit CrashesUI(content::WebUI* web_ui); static base::RefCountedMemory* GetFaviconResourceBytes(); // Whether crash reporting has been enabled. static bool CrashReportingEnabled(); private: DISALLOW_COPY_AND_ASSIGN(CrashesUI); }; #endif // CHROME_BROWSER_UI_WEBUI_CRASHES_UI_H_
// Copyright 2011 Google Inc. All Rights Reserved. // // This code is licensed under the same terms as WebM: // Software License Agreement: http://www.webmproject.org/license/software/ // Additional IP Rights Grant: http://www.webmproject.org/license/additional/ // ----------------------------------------------------------------------------- // // Alpha-plane decompression. // // Author: Skal (pascal.massimino@gmail.com) #include <stdlib.h> #include "./vp8i.h" #include "./vp8li.h" #include "../utils/filters.h" #include "../utils/quant_levels_dec.h" #include "webp/format_constants.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif // TODO(skal): move to dsp/ ? static void CopyPlane(const uint8_t* src, int src_stride, uint8_t* dst, int dst_stride, int width, int height) { while (height-- > 0) { memcpy(dst, src, width); src += src_stride; dst += dst_stride; } } //------------------------------------------------------------------------------ // Decodes the compressed data 'data' of size 'data_size' into the 'output'. // The 'output' buffer should be pre-allocated and must be of the same // dimension 'height'x'stride', as that of the image. // // Returns 1 on successfully decoding the compressed alpha and // 0 if either: // error in bit-stream header (invalid compression mode or filter), or // error returned by appropriate compression method. static int DecodeAlpha(const uint8_t* data, size_t data_size, int width, int height, int stride, uint8_t* output) { uint8_t* decoded_data = NULL; const size_t decoded_size = height * width; uint8_t* unfiltered_data = NULL; WEBP_FILTER_TYPE filter; int pre_processing; int rsrv; int ok = 0; int method; assert(width > 0 && height > 0 && stride >= width); assert(data != NULL && output != NULL); if (data_size <= ALPHA_HEADER_LEN) { return 0; } method = (data[0] >> 0) & 0x03; filter = (data[0] >> 2) & 0x03; pre_processing = (data[0] >> 4) & 0x03; rsrv = (data[0] >> 6) & 0x03; if (method < ALPHA_NO_COMPRESSION || method > ALPHA_LOSSLESS_COMPRESSION || filter >= WEBP_FILTER_LAST || pre_processing > ALPHA_PREPROCESSED_LEVELS || rsrv != 0) { return 0; } if (method == ALPHA_NO_COMPRESSION) { ok = (data_size >= decoded_size); decoded_data = (uint8_t*)data + ALPHA_HEADER_LEN; } else { decoded_data = (uint8_t*)malloc(decoded_size); if (decoded_data == NULL) return 0; ok = VP8LDecodeAlphaImageStream(width, height, data + ALPHA_HEADER_LEN, data_size - ALPHA_HEADER_LEN, decoded_data); } if (ok) { WebPFilterFunc unfilter_func = WebPUnfilters[filter]; if (unfilter_func != NULL) { unfiltered_data = (uint8_t*)malloc(decoded_size); if (unfiltered_data == NULL) { ok = 0; goto Error; } // TODO(vikas): Implement on-the-fly decoding & filter mechanism to decode // and apply filter per image-row. unfilter_func(decoded_data, width, height, 1, width, unfiltered_data); // Construct raw_data (height x stride) from alpha data (height x width). CopyPlane(unfiltered_data, width, output, stride, width, height); free(unfiltered_data); } else { // Construct raw_data (height x stride) from alpha data (height x width). CopyPlane(decoded_data, width, output, stride, width, height); } if (pre_processing == ALPHA_PREPROCESSED_LEVELS) { ok = DequantizeLevels(decoded_data, width, height); } } Error: if (method != ALPHA_NO_COMPRESSION) { free(decoded_data); } return ok; } //------------------------------------------------------------------------------ const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec, int row, int num_rows) { const int stride = dec->pic_hdr_.width_; if (row < 0 || num_rows < 0 || row + num_rows > dec->pic_hdr_.height_) { return NULL; // sanity check. } if (row == 0) { // Decode everything during the first call. if (!DecodeAlpha(dec->alpha_data_, (size_t)dec->alpha_data_size_, dec->pic_hdr_.width_, dec->pic_hdr_.height_, stride, dec->alpha_plane_)) { // TODO(urvang): Add a test where DecodeAlpha fails to test this. return NULL; // Error. } } // Return a pointer to the current decoded row. return dec->alpha_plane_ + row * stride; } #if defined(__cplusplus) || defined(c_plusplus) } // extern "C" #endif
/*- * This program is in the public domain * * $FreeBSD$ */ #include <stdio.h> #include <string.h> int main(int argc, char **argv) { int i; if (argc > 1 && !strcmp(argv[1], "189284")) { fputs("ABCDEFGH", stdout); for (i = 0; i < 8; i++) putchar(0); } else { for (i = 0; i < 256; i++) putchar(i); } return (0); }
#ifndef SQ_WIN32_PREFS_H #define SQ_WIN32_PREFS_H #define ID_PREF_FIRST 0x0010 #define ID_ABOUT 0x0010 #define ID_DEFERUPDATES 0x0020 #define ID_SHOWCONSOLE 0x0030 #define ID_DBGPRINTSOCKET 0x0040 #define ID_DYNAMICCONSOLE 0x0050 #define ID_REDUCECPUUSAGE 0x0060 #define ID_3BUTTONMOUSE 0x0070 #define ID_DEFAULTPRINTER 0x0080 #define ID_SHOWALLOCATIONS 0x0090 #define ID_REDUCEBACKGROUNDCPU 0x00A0 #define ID_1BUTTONMOUSE 0x00B0 #define ID_DIRECTSOUND 0x00C0 #define ID_FILEACCESS 0x00D0 #define ID_IMAGEWRITE 0x00E0 #define ID_SOCKETACCESS 0x00F0 #define ID_DBGPRINTSTACK 0x0100 #define ID_PRIORITYBOOST 0x0110 #define ID_USEOPENGL 0x0120 #define ID_CASEFILES 0x0130 #define ID_PRINTALLSTACKS 0x0140 #define ID_DUMPPRIMLOG 0x0150 #define ID_PREF_LAST 0x0150 void TrackPrefsMenu(void); void CreatePrefsMenu(void); void HandlePrefsMenu(int); void LoadPreferences(void); int prefsEnableAltF4Quit(void); int prefsEnableF2Menu(void); #if COGVM # define NICKNAME "Cog" #elif STACKVM # define NICKNAME "Stack" #else # define NICKNAME "Interpreter" #endif #if SPURVM # define NICKNAME_EXTRA " Spur VM " #else # define NICKNAME_EXTRA " VM " #endif #define VM_VERSION_TEXT TEXT(NICKNAME) TEXT(NICKNAME_EXTRA) TEXT(VM_VERSION) \ TEXT(" (release) from ") TEXT(__DATE__) TEXT("\n") \ TEXT("Compiler: ") TEXT(COMPILER) TEXT(VERSION) #endif
/** * \file camellia.h * * Copyright (C) 2009 Paul Bakker <polarssl_maintainer at polarssl dot org> * * 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 names of PolarSSL or XySSL 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 TROPICSSL_CAMELLIA_H #define TROPICSSL_CAMELLIA_H #define CAMELLIA_ENCRYPT 1 #define CAMELLIA_DECRYPT 0 /** * \brief CAMELLIA context structure */ typedef struct { int nr; /*!< number of rounds */ unsigned long rk[68]; /*!< CAMELLIA round keys */ } camellia_context; #ifdef __cplusplus extern "C" { #endif /** * \brief CAMELLIA key schedule (encryption) * * \param ctx CAMELLIA context to be initialized * \param key encryption key * \param keysize must be 128, 192 or 256 */ void camellia_setkey_enc(camellia_context * ctx, unsigned char *key, int keysize); /** * \brief CAMELLIA key schedule (decryption) * * \param ctx CAMELLIA context to be initialized * \param key decryption key * \param keysize must be 128, 192 or 256 */ void camellia_setkey_dec(camellia_context * ctx, unsigned char *key, int keysize); /** * \brief CAMELLIA-ECB block encryption/decryption * * \param ctx CAMELLIA context * \param mode CAMELLIA_ENCRYPT or CAMELLIA_DECRYPT * \param input 16-byte input block * \param output 16-byte output block */ void camellia_crypt_ecb(camellia_context * ctx, int mode, unsigned char input[16], unsigned char output[16]); /** * \brief CAMELLIA-CBC buffer encryption/decryption * * \param ctx CAMELLIA context * \param mode CAMELLIA_ENCRYPT or CAMELLIA_DECRYPT * \param length length of the input data * \param iv initialization vector (updated after use) * \param input buffer holding the input data * \param output buffer holding the output data */ void camellia_crypt_cbc(camellia_context * ctx, int mode, int length, unsigned char iv[16], unsigned char *input, unsigned char *output); /** * \brief CAMELLIA-CFB128 buffer encryption/decryption * * \param ctx CAMELLIA context * \param mode CAMELLIA_ENCRYPT or CAMELLIA_DECRYPT * \param length length of the input data * \param iv_off offset in IV (updated after use) * \param iv initialization vector (updated after use) * \param input buffer holding the input data * \param output buffer holding the output data */ void camellia_crypt_cfb128(camellia_context * ctx, int mode, int length, int *iv_off, unsigned char iv[16], unsigned char *input, unsigned char *output); /** * \brief Checkup routine * * \return 0 if successful, or 1 if the test failed */ int camellia_self_test(int verbose); #ifdef __cplusplus } #endif #endif /* camellia.h */
/*! @file @author Albert Semenov @date 08/2008 */ #ifndef DEMO_KEEPER_H_ #define DEMO_KEEPER_H_ #include "Base/BaseDemoManager.h" namespace demo { class DemoKeeper : public base::BaseDemoManager { public: DemoKeeper(); virtual void createScene(); virtual void destroyScene(); virtual void setupResources(); private: void createDefaultScene(); void notifyFrameStart(float _time); private: #ifdef MYGUI_OGRE_PLATFORM Ogre::SceneNode* mNode; #endif // MYGUI_OGRE_PLATFORM }; } // namespace demo #endif // DEMO_KEEPER_H_
const uint8_t _pattern16x16[512] = { 0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0x92,0x48, 0x89,0xE6,0xF8,0x00,0xF8,0x00,0x83,0x49,0x5B,0x29,0xF8,0x00,0xF8,0x00,0xF8,0x00, 0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0x89,0xE6,0xFD,0xD6, 0xFE,0x37,0x92,0x47,0xF8,0x00,0x72,0xC7,0xEF,0xDC,0x63,0x6B,0xF8,0x00,0xF8,0x00, 0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0x89,0x48,0xFD,0x93,0xFA,0xA8, 0xD9,0x83,0xFD,0xB3,0x91,0x68,0xAA,0x2B,0xF7,0x1F,0x72,0xF0,0xF8,0x00,0xF8,0x00, 0xF8,0x00,0xF8,0x00,0xF8,0x00,0xF8,0x00,0xAA,0x2B,0xFD,0xFA,0xE1,0xC4,0xD1,0x21, 0xD9,0x83,0xE1,0xC4,0xFE,0x3B,0x99,0xCA,0xD5,0xFC,0x83,0x93,0xF8,0x00,0xF8,0x00, 0xF8,0x00,0xF8,0x00,0xF8,0x00,0xC1,0xE7,0xFD,0x56,0xEA,0x29,0xAA,0x88,0x68,0x80, 0x79,0x02,0xA2,0x47,0xC9,0x25,0xFD,0xF8,0xC2,0x07,0xB9,0xC7,0xF8,0x00,0xF8,0x00, 0xF8,0x00,0xF8,0x00,0xA1,0x04,0xFD,0xD6,0xE2,0x08,0xD9,0xC7,0x58,0x00,0xFD,0x33, 0xF4,0xB1,0x70,0xA0,0xD9,0xC7,0xC9,0x66,0xFE,0x17,0x98,0xE3,0xF8,0x00,0xF8,0x00, 0xF8,0x00,0x82,0x03,0xFD,0x31,0xE2,0x05,0xC2,0x07,0x78,0x00,0xB6,0x37,0xF7,0xFF, 0xF7,0xFF,0xB6,0x37,0x80,0x00,0xB1,0xA5,0xD9,0xC4,0xFE,0x15,0x69,0x60,0xF8,0x00, 0x92,0x64,0xFD,0xB1,0xEA,0x66,0xD9,0xA4,0x78,0x00,0xFC,0xD1,0xEF,0xDE,0xF7,0xFF, 0xF7,0xFF,0xE7,0xBD,0xFC,0xF2,0x88,0x80,0xD9,0xC4,0xD9,0xC4,0xFE,0xB5,0x8A,0x23, 0x48,0xE4,0x51,0x05,0x40,0x66,0x40,0x66,0xCD,0x58,0xFF,0x5F,0xFF,0xFE,0xFF,0x9C, 0xFF,0xFE,0xFF,0x7C,0xFF,0x7F,0xDD,0xDA,0x38,0x25,0x48,0x87,0x51,0x25,0x48,0xE4, 0xA3,0xAF,0xE5,0xB7,0xED,0xBB,0xFE,0x5E,0xFF,0x3F,0x6A,0x4D,0x62,0xC9,0x62,0xCA, 0x62,0xEA,0x62,0xEA,0x72,0x8D,0xFE,0xFF,0xFE,0x3D,0xED,0xBB,0xE5,0x97,0xAB,0xF0, 0x73,0xCC,0xFF,0xFD,0xEF,0xDE,0xE7,0x9D,0xFF,0xFF,0x94,0xD4,0xFF,0xFF,0xEF,0x9F, 0xB5,0x97,0xFF,0xFF,0x94,0xD4,0xFF,0xFF,0xF7,0xFF,0xF7,0xFE,0xFF,0xFD,0x6B,0xAC, 0x6B,0x8B,0xFF,0xFD,0xF7,0xFE,0xFF,0xFF,0xFF,0xFF,0x4A,0x6A,0xB5,0xB8,0xC6,0x5A, 0xC6,0x3A,0xEF,0x9F,0x5B,0x0D,0xF7,0xBF,0xFF,0xFF,0xF7,0xDE,0xFF,0xFD,0x73,0xCC, 0x6B,0xE7,0xFF,0xF9,0xFF,0xF7,0xFF,0x95,0xFF,0xFB,0xAD,0x50,0xDF,0xFF,0xDF,0xFF, 0xA6,0x9B,0xCF,0xBF,0x9C,0xAE,0xFF,0xFB,0xFF,0xF6,0xFF,0xF7,0xFF,0xF9,0x6B,0xE7, 0x63,0xA6,0xA5,0xAE,0xCD,0xEE,0xCD,0xEE,0xCE,0x34,0x63,0x07,0x33,0x0D,0x32,0xCC, 0x4B,0x8F,0x43,0x4E,0x63,0x07,0xCE,0x54,0xC5,0xAD,0xBD,0x8D,0xAD,0xEF,0x6B,0xE7, 0x73,0x28,0xD6,0x14,0xFF,0x5C,0xEE,0xB9,0xEE,0xD9,0xF7,0x1A,0xFF,0xDA,0xEF,0x58, 0xE6,0xF7,0xEF,0x58,0xF7,0x3B,0xEF,0x1A,0xEE,0xD9,0xFF,0x7C,0xCD,0xF3,0x73,0x08, 0x5A,0x65,0x49,0xC3,0x31,0x03,0x49,0xC6,0x49,0xC6,0x39,0x64,0x39,0x81,0x42,0x03, 0x41,0xE2,0x39,0xA2,0x49,0xC6,0x41,0xA5,0x49,0xC6,0x41,0x64,0x41,0x81,0x6A,0xC7 };
/* * Copyright © 2011 Intel Corporation * * 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. * * Author: Chris Wilson <chris@chris-wilson.co.uk> */ #include "cairo-test.h" #define LINE_WIDTH 10. #define SIZE (8 * LINE_WIDTH) #define PAD (1 * LINE_WIDTH) static void make_path (cairo_t *cr) { cairo_move_to (cr, 0, 0); cairo_rel_curve_to (cr, SIZE, 0, 0, SIZE, SIZE, SIZE); cairo_rel_line_to (cr, -SIZE, 0); cairo_rel_curve_to (cr, SIZE, 0, 0, -SIZE, SIZE, -SIZE); cairo_close_path (cr); } static void draw_joins (cairo_t *cr) { cairo_save (cr); cairo_translate (cr, PAD, PAD); make_path (cr); cairo_set_line_join (cr, CAIRO_LINE_JOIN_BEVEL); cairo_stroke (cr); cairo_translate (cr, SIZE + PAD, 0.); make_path (cr); cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND); cairo_stroke (cr); cairo_translate (cr, SIZE + PAD, 0.); make_path (cr); cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER); cairo_stroke (cr); cairo_translate (cr, SIZE + PAD, 0.); cairo_restore (cr); } static cairo_test_status_t draw (cairo_t *cr, int width, int height) { cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); cairo_paint (cr); cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); cairo_set_line_width (cr, LINE_WIDTH); draw_joins (cr); /* and reflect to generate the opposite vertex ordering */ cairo_translate (cr, 0, height); cairo_scale (cr, 1, -1); draw_joins (cr); return CAIRO_TEST_SUCCESS; } CAIRO_TEST (joins_loop, "A loopy concave shape", "stroke", /* keywords */ NULL, /* requirements */ 3*(SIZE+PAD)+PAD, 2*(SIZE+PAD)+2*PAD, NULL, draw)
// // TSUrl.h // TwitterStreams // // Created by Stuart Hall on 7/03/12. // Copyright (c) 2012 Stuart Hall. All rights reserved. // #import "TSModel.h" @interface TSUrl : TSModel - (NSString*)url; - (NSString*)displayUrl; - (NSString*)expandedUrl; - (NSArray*)indicies; @end
/* Copyright 2005-2014 Intel Corporation. All Rights Reserved. This file is part of Threading Building Blocks. Threading Building Blocks 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. Threading Building Blocks 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 Threading Building Blocks; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA As a special exception, you may use this file as part of a free software library without restriction. Specifically, if other files instantiate templates or use macros or inline functions from this file, or you compile this file and link it with other files to produce an executable, this file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ #if !defined(__TBB_machine_H) || defined(__TBB_machine_windows_ia32_H) #error Do not #include this internal file directly; use public TBB headers instead. #endif #define __TBB_machine_windows_ia32_H #include "msvc_ia32_common.h" #define __TBB_WORDSIZE 4 #define __TBB_ENDIANNESS __TBB_ENDIAN_LITTLE #if __INTEL_COMPILER && (__INTEL_COMPILER < 1100) #define __TBB_compiler_fence() __asm { __asm nop } #define __TBB_full_memory_fence() __asm { __asm mfence } #elif _MSC_VER >= 1300 || __INTEL_COMPILER #pragma intrinsic(_ReadWriteBarrier) #pragma intrinsic(_mm_mfence) #define __TBB_compiler_fence() _ReadWriteBarrier() #define __TBB_full_memory_fence() _mm_mfence() #else #error Unsupported compiler - need to define __TBB_{control,acquire,release}_consistency_helper to support it #endif #define __TBB_control_consistency_helper() __TBB_compiler_fence() #define __TBB_acquire_consistency_helper() __TBB_compiler_fence() #define __TBB_release_consistency_helper() __TBB_compiler_fence() #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) // Workaround for overzealous compiler warnings in /Wp64 mode #pragma warning (push) #pragma warning (disable: 4244 4267) #endif extern "C" { __int64 __TBB_EXPORTED_FUNC __TBB_machine_cmpswp8 (volatile void *ptr, __int64 value, __int64 comparand ); __int64 __TBB_EXPORTED_FUNC __TBB_machine_fetchadd8 (volatile void *ptr, __int64 addend ); __int64 __TBB_EXPORTED_FUNC __TBB_machine_fetchstore8 (volatile void *ptr, __int64 value ); void __TBB_EXPORTED_FUNC __TBB_machine_store8 (volatile void *ptr, __int64 value ); __int64 __TBB_EXPORTED_FUNC __TBB_machine_load8 (const volatile void *ptr); } //TODO: use _InterlockedXXX intrinsics as they available since VC 2005 #define __TBB_MACHINE_DEFINE_ATOMICS(S,T,U,A,C) \ static inline T __TBB_machine_cmpswp##S ( volatile void * ptr, U value, U comparand ) { \ T result; \ volatile T *p = (T *)ptr; \ __asm \ { \ __asm mov edx, p \ __asm mov C , value \ __asm mov A , comparand \ __asm lock cmpxchg [edx], C \ __asm mov result, A \ } \ return result; \ } \ \ static inline T __TBB_machine_fetchadd##S ( volatile void * ptr, U addend ) { \ T result; \ volatile T *p = (T *)ptr; \ __asm \ { \ __asm mov edx, p \ __asm mov A, addend \ __asm lock xadd [edx], A \ __asm mov result, A \ } \ return result; \ }\ \ static inline T __TBB_machine_fetchstore##S ( volatile void * ptr, U value ) { \ T result; \ volatile T *p = (T *)ptr; \ __asm \ { \ __asm mov edx, p \ __asm mov A, value \ __asm lock xchg [edx], A \ __asm mov result, A \ } \ return result; \ } __TBB_MACHINE_DEFINE_ATOMICS(1, __int8, __int8, al, cl) __TBB_MACHINE_DEFINE_ATOMICS(2, __int16, __int16, ax, cx) __TBB_MACHINE_DEFINE_ATOMICS(4, ptrdiff_t, ptrdiff_t, eax, ecx) #undef __TBB_MACHINE_DEFINE_ATOMICS static inline void __TBB_machine_OR( volatile void *operand, __int32 addend ) { __asm { mov eax, addend mov edx, [operand] lock or [edx], eax } } static inline void __TBB_machine_AND( volatile void *operand, __int32 addend ) { __asm { mov eax, addend mov edx, [operand] lock and [edx], eax } } #define __TBB_AtomicOR(P,V) __TBB_machine_OR(P,V) #define __TBB_AtomicAND(P,V) __TBB_machine_AND(P,V) //TODO: Check if it possible and profitable for IA-32 architecture on (Linux and Windows) //to use of 64-bit load/store via floating point registers together with full fence //for sequentially consistent load/store, instead of CAS. #define __TBB_USE_FETCHSTORE_AS_FULL_FENCED_STORE 1 #define __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1 #define __TBB_USE_GENERIC_RELAXED_LOAD_STORE 1 #define __TBB_USE_GENERIC_SEQUENTIAL_CONSISTENCY_LOAD_STORE 1 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) #pragma warning (pop) #endif // warnings 4244, 4267 are back
/* * Copyright 2011-2015 Samy Al Bahra. * Copyright 2011 David Joseph. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include <errno.h> #include <inttypes.h> #include <pthread.h> #include <math.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <strings.h> #include <unistd.h> #include <sys/time.h> #include <ck_pr.h> #include <ck_barrier.h> #include "../../common.h" #ifndef ITERATE #define ITERATE 5000000 #endif #ifndef ENTRIES #define ENTRIES 512 #endif static struct affinity a; static int nthr; static int counters[ENTRIES]; static int barrier_wait; static void * thread(void *b) { ck_barrier_mcs_t *barrier = b; ck_barrier_mcs_state_t state; int j, counter; int i = 0; aff_iterate(&a); ck_barrier_mcs_subscribe(barrier, &state); ck_pr_inc_int(&barrier_wait); while (ck_pr_load_int(&barrier_wait) != nthr) ck_pr_stall(); for (j = 0; j < ITERATE; j++) { i = j++ & (ENTRIES - 1); ck_pr_inc_int(&counters[i]); ck_barrier_mcs(barrier, &state); counter = ck_pr_load_int(&counters[i]); if (counter != nthr * (j / ENTRIES + 1)) { ck_error("FAILED [%d:%d]: %d != %d\n", i, j - 1, counter, nthr); } } return (NULL); } int main(int argc, char *argv[]) { pthread_t *threads; ck_barrier_mcs_t *barrier; int i; if (argc < 3) { ck_error("Usage: correct <number of threads> <affinity delta>\n"); } nthr = atoi(argv[1]); if (nthr <= 0) { ck_error("ERROR: Number of threads must be greater than 0\n"); } threads = malloc(sizeof(pthread_t) * nthr); if (threads == NULL) { ck_error("ERROR: Could not allocate thread structures\n"); } barrier = malloc(sizeof(ck_barrier_mcs_t) * nthr); if (barrier == NULL) { ck_error("ERROR: Could not allocate barrier structures\n"); } ck_barrier_mcs_init(barrier, nthr); a.delta = atoi(argv[2]); fprintf(stderr, "Creating threads (barrier)..."); for (i = 0; i < nthr; i++) { if (pthread_create(&threads[i], NULL, thread, barrier)) { ck_error("ERROR: Could not create thread %d\n", i); } } fprintf(stderr, "done\n"); fprintf(stderr, "Waiting for threads to finish correctness regression..."); for (i = 0; i < nthr; i++) pthread_join(threads[i], NULL); fprintf(stderr, "done (passed)\n"); return (0); }
/* * Support for HTC Magician PDA phones: * i-mate JAM, O2 Xda mini, Orange SPV M500, Qtek s100, Qtek s110 * and T-Mobile MDA Compact. * * Copyright (c) 2006-2007 Philipp Zabel * * Based on hx4700.c, spitz.c and others. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/gpio_keys.h> #include <linux/input.h> #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/physmap.h> #include <asm/gpio.h> #include <asm/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/arch/magician.h> #include <asm/arch/pxa-regs.h> #include <asm/arch/pxafb.h> #include <asm/arch/irda.h> #include <asm/arch/ohci.h> #include "generic.h" /* * IRDA */ static void magician_irda_transceiver_mode(struct device *dev, int mode) { gpio_set_value(GPIO83_MAGICIAN_nIR_EN, mode & IR_OFF); } static struct pxaficp_platform_data magician_ficp_info = { .transceiver_cap = IR_SIRMODE | IR_OFF, .transceiver_mode = magician_irda_transceiver_mode, }; /* * GPIO Keys */ static struct gpio_keys_button magician_button_table[] = { {KEY_POWER, GPIO0_MAGICIAN_KEY_POWER, 0, "Power button"}, {KEY_ESC, GPIO37_MAGICIAN_KEY_HANGUP, 0, "Hangup button"}, {KEY_F10, GPIO38_MAGICIAN_KEY_CONTACTS, 0, "Contacts button"}, {KEY_CALENDAR, GPIO90_MAGICIAN_KEY_CALENDAR, 0, "Calendar button"}, {KEY_CAMERA, GPIO91_MAGICIAN_KEY_CAMERA, 0, "Camera button"}, {KEY_UP, GPIO93_MAGICIAN_KEY_UP, 0, "Up button"}, {KEY_DOWN, GPIO94_MAGICIAN_KEY_DOWN, 0, "Down button"}, {KEY_LEFT, GPIO95_MAGICIAN_KEY_LEFT, 0, "Left button"}, {KEY_RIGHT, GPIO96_MAGICIAN_KEY_RIGHT, 0, "Right button"}, {KEY_KPENTER, GPIO97_MAGICIAN_KEY_ENTER, 0, "Action button"}, {KEY_RECORD, GPIO98_MAGICIAN_KEY_RECORD, 0, "Record button"}, {KEY_VOLUMEUP, GPIO100_MAGICIAN_KEY_VOL_UP, 0, "Volume up"}, {KEY_VOLUMEDOWN, GPIO101_MAGICIAN_KEY_VOL_DOWN, 0, "Volume down"}, {KEY_PHONE, GPIO102_MAGICIAN_KEY_PHONE, 0, "Phone button"}, {KEY_PLAY, GPIO99_MAGICIAN_HEADPHONE_IN, 0, "Headset button"}, }; static struct gpio_keys_platform_data gpio_keys_data = { .buttons = magician_button_table, .nbuttons = ARRAY_SIZE(magician_button_table), }; static struct platform_device gpio_keys = { .name = "gpio-keys", .dev = { .platform_data = &gpio_keys_data, }, .id = -1, }; /* * LCD - Toppoly TD028STEB1 */ static struct pxafb_mode_info toppoly_modes[] = { { .pixclock = 96153, .bpp = 16, .xres = 240, .yres = 320, .hsync_len = 11, .vsync_len = 3, .left_margin = 19, .upper_margin = 2, .right_margin = 10, .lower_margin = 2, .sync = 0, }, }; static struct pxafb_mach_info toppoly_info = { .modes = toppoly_modes, .num_modes = 1, .fixed_modes = 1, .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, .lccr3 = LCCR3_PixRsEdg, }; /* * Backlight */ static void magician_set_bl_intensity(int intensity) { if (intensity) { PWM_CTRL0 = 1; PWM_PERVAL0 = 0xc8; PWM_PWDUTY0 = intensity; pxa_set_cken(CKEN_PWM0, 1); } else { pxa_set_cken(CKEN_PWM0, 0); } } static struct generic_bl_info backlight_info = { .default_intensity = 0x64, .limit_mask = 0x0b, .max_intensity = 0xc7, .set_bl_intensity = magician_set_bl_intensity, }; static struct platform_device backlight = { .name = "corgi-bl", .dev = { .platform_data = &backlight_info, }, .id = -1, }; /* * USB OHCI */ static int magician_ohci_init(struct device *dev) { UHCHR = (UHCHR | UHCHR_SSEP2 | UHCHR_PCPL | UHCHR_CGR) & ~(UHCHR_SSEP1 | UHCHR_SSEP3 | UHCHR_SSE); return 0; } static struct pxaohci_platform_data magician_ohci_info = { .port_mode = PMM_PERPORT_MODE, .init = magician_ohci_init, .power_budget = 0, }; /* * StrataFlash */ #define PXA_CS_SIZE 0x04000000 static struct resource strataflash_resource = { .start = PXA_CS0_PHYS, .end = PXA_CS0_PHYS + PXA_CS_SIZE - 1, .flags = IORESOURCE_MEM, }; static struct physmap_flash_data strataflash_data = { .width = 4, }; static struct platform_device strataflash = { .name = "physmap-flash", .id = -1, .num_resources = 1, .resource = &strataflash_resource, .dev = { .platform_data = &strataflash_data, }, }; /* * Platform devices */ static struct platform_device *devices[] __initdata = { &gpio_keys, &backlight, &strataflash, }; static void __init magician_init(void) { platform_add_devices(devices, ARRAY_SIZE(devices)); pxa_set_ohci_info(&magician_ohci_info); pxa_set_ficp_info(&magician_ficp_info); set_pxa_fb_info(&toppoly_info); } MACHINE_START(MAGICIAN, "HTC Magician") .phys_io = 0x40000000, .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .boot_params = 0xa0000100, .map_io = pxa_map_io, .init_irq = pxa27x_init_irq, .init_machine = magician_init, .timer = &pxa_timer, MACHINE_END
/* * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef TRINITY_GUARDAI_H #define TRINITY_GUARDAI_H #include "CreatureAI.h" #include "Timer.h" class Creature; class GuardAI : public CreatureAI { enum GuardState { STATE_NORMAL = 1, STATE_LOOK_AT_VICTIM = 2 }; public: explicit GuardAI(Creature *c); void MoveInLineOfSight(Unit *); void EnterEvadeMode(); void JustDied(Unit *); bool IsVisible(Unit *) const; void UpdateAI(const uint32); static int Permissible(const Creature *); private: uint64 i_victimGuid; GuardState i_state; TimeTracker i_tracker; }; #endif
/* * lib/bust_spinlocks.c * * Provides a minimal bust_spinlocks for architectures which don't have one of their own. * * bust_spinlocks() clears any spinlocks which would prevent oops, die(), BUG() * and panic() information from reaching the user. */ #include <linux/kernel.h> #include <linux/spinlock.h> #include <linux/tty.h> #include <linux/wait.h> #include <linux/vt_kern.h> #include <linux/console.h> #include <linux/ipipe_trace.h> void __attribute__((weak)) bust_spinlocks(int yes) { if (yes) { ++oops_in_progress; } else { #ifdef CONFIG_VT unblank_screen(); #endif console_unblank(); ipipe_trace_panic_dump(); if (--oops_in_progress == 0) wake_up_klogd(); } }
/* Copyright (C) 2013 Webyog Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ #ifndef __VERIFY__ #define __VERIFY__ #ifdef _WIN32 #include <crtdbg.h> #endif #ifdef _DEBUG #define VERIFY(f) _ASSERT(f) #else #define VERIFY(f) ((void)(f)) #endif #endif
/* ----------------------------------------------------------------------------- * input.c * * Copyright (c) 2004, 2005, 2006, Vivek Mohan <vivek@sig9.com> * All rights reserved. See LICENSE * ----------------------------------------------------------------------------- */ #include "extern.h" #include "types.h" #include "input.h" /* ----------------------------------------------------------------------------- * inp_buff_hook() - Hook for buffered inputs. * ----------------------------------------------------------------------------- */ static int inp_buff_hook( struct ud* u ) { if ( u->inp_buff < u->inp_buff_end ) return *u->inp_buff++; else return -1; } #ifndef __UD_STANDALONE__ /* ----------------------------------------------------------------------------- * inp_file_hook() - Hook for FILE inputs. * ----------------------------------------------------------------------------- */ static int inp_file_hook( struct ud* u ) { return fgetc( u->inp_file ); } #endif /* __UD_STANDALONE__*/ /* ============================================================================= * ud_inp_set_hook() - Sets input hook. * ============================================================================= */ extern void ud_set_input_hook( register struct ud* u, int( *hook )(struct ud*) ) { u->inp_hook = hook; inp_init( u ); } /* ============================================================================= * ud_inp_set_buffer() - Set buffer as input. * ============================================================================= */ extern void ud_set_input_buffer( register struct ud* u, uint8_t* buf, size_t len ) { u->inp_hook = inp_buff_hook; u->inp_buff = buf; u->inp_buff_end = buf + len; inp_init( u ); } #ifndef __UD_STANDALONE__ /* ============================================================================= * ud_input_set_file() - Set buffer as input. * ============================================================================= */ extern void ud_set_input_file( register struct ud* u, FILE* f ) { u->inp_hook = inp_file_hook; u->inp_file = f; inp_init( u ); } #endif /* __UD_STANDALONE__ */ /* ============================================================================= * ud_input_skip() - Skip n input bytes. * ============================================================================= */ extern void ud_input_skip( struct ud* u, size_t n ) { while ( n-- ) { u->inp_hook( u ); } } /* ============================================================================= * ud_input_end() - Test for end of input. * ============================================================================= */ extern int ud_input_end( struct ud* u ) { return (u->inp_curr == u->inp_fill) && u->inp_end; } /* ----------------------------------------------------------------------------- * inp_next() - Loads and returns the next byte from input. * * inp_curr and inp_fill are pointers to the cache. The program is written based * on the property that they are 8-bits in size, and will eventually wrap around * forming a circular buffer. So, the size of the cache is 256 in size, kind of * unnecessary yet optimized. * * A buffer inp_sess stores the bytes disassembled for a single session. * ----------------------------------------------------------------------------- */ extern uint8_t inp_next( struct ud* u ) { int c = -1; /* if current pointer is not upto the fill point in the * input cache. */ if ( u->inp_curr != u->inp_fill ) { c = u->inp_cache[++u->inp_curr]; /* if !end-of-input, call the input hook and get a byte */ } else if ( u->inp_end || (c = u->inp_hook( u )) == -1 ) { /* end-of-input, mark it as an error, since the decoder, * expected a byte more. */ u->error = 1; /* flag end of input */ u->inp_end = 1; return 0; } else { /* increment pointers, we have a new byte. */ u->inp_curr = ++u->inp_fill; /* add the byte to the cache */ u->inp_cache[u->inp_fill] = c; } /* record bytes input per decode-session. */ u->inp_sess[u->inp_ctr++] = c; /* return byte */ return (uint8_t)c; } /* ----------------------------------------------------------------------------- * inp_back() - Move back a single byte in the stream. * ----------------------------------------------------------------------------- */ extern void inp_back( struct ud* u ) { if ( u->inp_ctr > 0 ) { --u->inp_curr; --u->inp_ctr; } } /* ----------------------------------------------------------------------------- * inp_peek() - Peek into the next byte in source. * ----------------------------------------------------------------------------- */ extern uint8_t inp_peek( struct ud* u ) { uint8_t r = inp_next( u ); if ( !u->error ) inp_back( u ); /* Don't backup if there was an error */ return r; } /* ----------------------------------------------------------------------------- * inp_move() - Move ahead n input bytes. * ----------------------------------------------------------------------------- */ extern void inp_move( struct ud* u, size_t n ) { while ( n-- ) inp_next( u ); } /*------------------------------------------------------------------------------ * inp_uintN() - return uintN from source. *------------------------------------------------------------------------------ */ extern uint8_t inp_uint8( struct ud* u ) { return inp_next( u ); } extern uint16_t inp_uint16( struct ud* u ) { uint16_t r, ret; ret = inp_next( u ); r = inp_next( u ); return ret | (r << 8); } extern uint32_t inp_uint32( struct ud* u ) { uint32_t r, ret; ret = inp_next( u ); r = inp_next( u ); ret = ret | (r << 8); r = inp_next( u ); ret = ret | (r << 16); r = inp_next( u ); return ret | (r << 24); } extern uint64_t inp_uint64( struct ud* u ) { uint64_t r, ret; ret = inp_next( u ); r = inp_next( u ); ret = ret | (r << 8); r = inp_next( u ); ret = ret | (r << 16); r = inp_next( u ); ret = ret | (r << 24); r = inp_next( u ); ret = ret | (r << 32); r = inp_next( u ); ret = ret | (r << 40); r = inp_next( u ); ret = ret | (r << 48); r = inp_next( u ); return ret | (r << 56); }
extern int Check_for_data(); extern int init_serv_socket(); extern int init_socket(); extern int read_msg(); extern int write_msg(); extern int broadcast_msg(); extern int close_join(); extern int close_serv(); extern int leave();
/* Copyright (C) 1995-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <utime.h> #include <sys/time.h> #include <errno.h> #include <stddef.h> /* Change the access time of FILE to TVP[0] and the modification time of FILE to TVP[1]. */ int __utimes (const char *file, const struct timeval tvp[2]) { struct utimbuf buf, *times; if (tvp) { times = &buf; buf.actime = tvp[0].tv_sec + tvp[0].tv_usec / 1000000; buf.modtime = tvp[1].tv_sec + tvp[1].tv_usec / 1000000; } else times = NULL; return utime (file, times); } weak_alias (__utimes, utimes)
/* Public domain. * Originally written by Akira Kakuto <kakuto@fuk.kindai.ac.jp> * * WIN32 wrapper program replacing Unix symlinks such as, * e.g., ofm2opl -> omfonts. * * EXEPROG must be defined in the Makefile as, * e.g., -DEXEPROG=\"omfonts.exe\". */ #include <stdio.h> #include <stdlib.h> #include <process.h> #include <string.h> #include <malloc.h> static int is_include_space(char *s) { char *p; p = strchr(s, ' '); if(p) return 1; p = strchr(s, '\t'); if(p) return 1; return 0; } int main(int argc, char *argv[]) { int i; char *p; for(i = 0; i < argc; i++) { if(is_include_space(argv[i])) { p = (char *)malloc(strlen(argv[i])+3); strcpy(p, "\""); strcat(p, argv[i]); strcat(p, "\""); free(argv[i]); argv[i] = p; } } argv[argc] = NULL; return _spawnvp(_P_WAIT, EXEPROG, (const char * const *)argv); }
/* * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) * Licensed under the GPL */ #include <stdio.h> #include <unistd.h> #include <signal.h> #include <sched.h> #include <errno.h> #include <stdarg.h> #include <stdlib.h> #include <setjmp.h> #include <sys/time.h> #include <sys/ptrace.h> #include <linux/ptrace.h> #include <sys/wait.h> #include <sys/mman.h> #include <asm/ptrace.h> #include <asm/unistd.h> #include <asm/page.h> #include "user_util.h" #include "kern_util.h" #include "user.h" #include "signal_kern.h" #include "signal_user.h" #include "sysdep/ptrace.h" #include "sysdep/sigcontext.h" #include "irq_user.h" #include "ptrace_user.h" #include "time_user.h" #include "init.h" #include "os.h" #include "uml-config.h" #include "choose-mode.h" #include "mode.h" #include "tempfile.h" int protect_memory(unsigned long addr, unsigned long len, int r, int w, int x, int must_succeed) { int err; err = os_protect_memory((void *) addr, len, r, w, x); if(err < 0){ if(must_succeed) panic("protect failed, err = %d", -err); else return(err); } return(0); } /* *------------------------- * only for tt mode (will be deleted in future...) *------------------------- */ struct tramp { int (*tramp)(void *); void *tramp_data; unsigned long temp_stack; int flags; int pid; }; /* See above for why sigkill is here */ int sigkill = SIGKILL; int outer_tramp(void *arg) { struct tramp *t; int sig = sigkill; t = arg; t->pid = clone(t->tramp, (void *) t->temp_stack + page_size()/2, t->flags, t->tramp_data); if(t->pid > 0) wait_for_stop(t->pid, SIGSTOP, PTRACE_CONT, NULL); kill(os_getpid(), sig); _exit(0); } int start_fork_tramp(void *thread_arg, unsigned long temp_stack, int clone_flags, int (*tramp)(void *)) { struct tramp arg; unsigned long sp; int new_pid, status, err; /* The trampoline will run on the temporary stack */ sp = stack_sp(temp_stack); clone_flags |= CLONE_FILES | SIGCHLD; arg.tramp = tramp; arg.tramp_data = thread_arg; arg.temp_stack = temp_stack; arg.flags = clone_flags; /* Start the process and wait for it to kill itself */ new_pid = clone(outer_tramp, (void *) sp, clone_flags, &arg); if(new_pid < 0) return(new_pid); CATCH_EINTR(err = waitpid(new_pid, &status, 0)); if(err < 0) panic("Waiting for outer trampoline failed - errno = %d", errno); if(!WIFSIGNALED(status) || (WTERMSIG(status) != SIGKILL)) panic("outer trampoline didn't exit with SIGKILL, " "status = %d", status); return(arg.pid); } void forward_pending_sigio(int target) { sigset_t sigs; if(sigpending(&sigs)) panic("forward_pending_sigio : sigpending failed"); if(sigismember(&sigs, SIGIO)) kill(target, SIGIO); }
/*********************************************************************** GLEXTTextureCubeMap - OpenGL extension class for the GL_EXT_texture_cube_map extension. Copyright (c) 2007 Oliver Kreylos This file is part of the OpenGL Support Library (GLSupport). The OpenGL Support Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The OpenGL Support Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the OpenGL Support Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***********************************************************************/ #ifndef GLEXTENSIONS_GLEXTTEXTURECUBEMAP_INCLUDED #define GLEXTENSIONS_GLEXTTEXTURECUBEMAP_INCLUDED #include <GL/gl.h> #include <GL/TLSHelper.h> #include <GL/Extensions/GLExtension.h> /******************************** Extension-specific parts of gl.h: ********************************/ #ifndef GL_EXT_texture_cube_map #define GL_EXT_texture_cube_map 1 /* Extension-specific constants: */ #define GL_NORMAL_MAP_EXT 0x8511 #define GL_REFLECTION_MAP_EXT 0x8512 #define GL_TEXTURE_CUBE_MAP_EXT 0x8513 #define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A #define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B #define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C #endif class GLEXTTextureCubeMap:public GLExtension { /* Elements: */ private: static GL_THREAD_LOCAL(GLEXTTextureCubeMap*) current; // Pointer to extension object for current OpenGL context /* Constructors and destructors: */ private: GLEXTTextureCubeMap(void); public: virtual ~GLEXTTextureCubeMap(void); /* Methods: */ public: virtual const char* getExtensionName(void) const; virtual void activate(void); virtual void deactivate(void); static bool isSupported(void); // Returns true if the extension is supported in the current OpenGL context static void initExtension(void); // Initializes the extension in the current OpenGL context /* Extension entry points: */ }; /******************************* Extension-specific entry points: *******************************/ #endif
/* * This file is part of the coreboot project. * * Copyright (C) 2015-2016 Patrick Rudolph * Copyright (C) 2015 Timothy Pearson <tpearson@raptorengineeringinc.com>, Raptor Engineering * * 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. */ #include <types.h> #include <string.h> #include <option.h> #include <device/device.h> #include <device/pci_def.h> #include <device/pci_ops.h> #include <device/pci_ids.h> #include <device/pci.h> #include <console/console.h> #include <southbridge/intel/common/gpio.h> /* Hybrid graphics allows to connect LVDS interface to either iGPU * or dGPU depending on GPIO level. * Nvidia is calling this functionality "muxed Optimus". * Some devices, like T430s, only support "muxless Optimus" where the * Intel GPU is always connected to the panel. * As it is only linked on lenovo and only executed if the GPU exists * we know for sure that the dGPU is there and connected to first PEG slot. * * Note: Once native gfx init is done for AMD or Nvida graphic * cards, merge this code. */ #define HYBRID_GRAPHICS_INTEGRATED 0 #define HYBRID_GRAPHICS_DISCRETE 1 static void hybrid_graphics_disable_peg(struct device *dev) { struct device *peg_dev; /* connect LVDS interface to iGPU */ set_gpio(CONFIG_HYBRID_GRAPHICS_GPIO_NUM, GPIO_LEVEL_HIGH); printk(BIOS_DEBUG, "Hybrid graphics: Switching panel to integrated GPU.\n"); dev->enabled = 0; /* Disable PEG10 */ peg_dev = dev_find_slot(0, PCI_DEVFN(1, 0)); if (peg_dev) peg_dev->enabled = 0; printk(BIOS_DEBUG, "Hybrid graphics: Disabled PEG10.\n"); } /* Called before VGA enable bits are set and only if dGPU * is present. Enable/disable VGA devices here. */ static void hybrid_graphics_enable_peg(struct device *dev) { u8 hybrid_graphics_mode; hybrid_graphics_mode = HYBRID_GRAPHICS_INTEGRATED; get_option(&hybrid_graphics_mode, "hybrid_graphics_mode"); if (hybrid_graphics_mode == HYBRID_GRAPHICS_DISCRETE) { /* connect LVDS interface to dGPU */ set_gpio(CONFIG_HYBRID_GRAPHICS_GPIO_NUM, GPIO_LEVEL_LOW); printk(BIOS_DEBUG, "Hybrid graphics: Switching panel to discrete GPU.\n"); dev->enabled = 1; /* Disable IGD */ dev = dev_find_slot(0, PCI_DEVFN(2, 0)); if (dev && dev->ops->disable) dev->ops->disable(dev); dev->enabled = 0; printk(BIOS_DEBUG, "Hybrid graphics: Disabled IGD.\n"); } else hybrid_graphics_disable_peg(dev); } static struct pci_operations pci_dev_ops_pci = { .set_subsystem = pci_dev_set_subsystem, }; struct device_operations hybrid_graphics_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = pci_dev_init, .scan_bus = 0, .enable = hybrid_graphics_enable_peg, .disable = hybrid_graphics_disable_peg, .ops_pci = &pci_dev_ops_pci, }; static const unsigned short pci_device_ids_nvidia[] = { 0x0ffc, /* Nvidia NVS Quadro K1000m Lenovo W530 */ 0x0def, /* NVidia NVS 5400m Lenovo T430/T530 */ 0x0dfc, /* NVidia NVS 5200m Lenovo T430s */ 0x1056, /* NVidia NVS 4200m Lenovo T420/T520 */ 0x1057, /* NVidia NVS 4200m Lenovo T420/T520 */ 0x0a6c, /* NVidia NVS 3100m Lenovo T410/T510 */ 0 }; static const struct pci_driver hybrid_peg_nvidia __pci_driver = { .ops = &hybrid_graphics_ops, .vendor = PCI_VENDOR_ID_NVIDIA, .devices = pci_device_ids_nvidia, }; static const unsigned short pci_device_ids_amd[] = { 0x9591, /* ATI Mobility Radeon HD 3650 Lenovo T500/W500 */ 0x95c4, /* ATI Mobility Radeon HD 3470 Lenovo T400/R400 */ 0 }; static const struct pci_driver hybrid_peg_amd __pci_driver = { .ops = &hybrid_graphics_ops, .vendor = PCI_VENDOR_ID_ATI, .devices = pci_device_ids_amd, };
/* * Copyright (C) 2009 Vassilis Varveropoulos * Copyright (C) 2010 The Paparazzi Team * * This file is part of paparazzi. * * paparazzi 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. * * paparazzi 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 paparazzi; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ /** * @file baro_ets.c * * Driver for the EagleTree Systems Altitude Sensor. * Has only been tested with V3 of the sensor hardware. * * Notes: * Connect directly to TWOG/Tiny I2C port. Multiple sensors can be chained together. * Sensor should be in the proprietary mode (default) and not in 3rd party mode. * Pitch gains may need to be updated. * * * Sensor module wire assignments: * Red wire: 5V * White wire: Ground * Yellow wire: SDA * Brown wire: SCL */ #include "sensors/baro_ets.h" #include "mcu_periph/i2c.h" #include "state.h" #include "subsystems/abi.h" #include <math.h> #include "mcu_periph/sys_time.h" #include "firmwares/fixedwing/nav.h" #ifdef BARO_ETS_SYNC_SEND #include "mcu_periph/uart.h" #include "messages.h" #include "subsystems/datalink/downlink.h" #endif //BARO_ETS_SYNC_SEND #define BARO_ETS_ADDR 0xE8 #define BARO_ETS_REG 0x07 #define BARO_ETS_OFFSET_MAX 30000 #define BARO_ETS_OFFSET_MIN 10 #define BARO_ETS_OFFSET_NBSAMPLES_INIT 20 #define BARO_ETS_OFFSET_NBSAMPLES_AVRG 40 #define BARO_ETS_R 0.5 #define BARO_ETS_SIGMA2 0.1 /** scale factor to convert raw ADC measurement to pressure in Pascal. * @todo check value * At low altitudes pressure change is ~1.2 kPa for every 100 meters. * So with a scale ADC->meters of 0.32 we get: * 12 Pascal = 0.32 * ADC * -> SCALE = ~ 12 / 0.32 = 37.5 */ #ifndef BARO_ETS_SCALE #define BARO_ETS_SCALE 37.5 #endif /** scale factor to convert raw ADC measurement to altitude change in meters */ #ifndef BARO_ETS_ALT_SCALE #define BARO_ETS_ALT_SCALE 0.32 #endif /** Pressure offset in Pascal when converting raw adc to real pressure (@todo find real value) */ #ifndef BARO_ETS_PRESSURE_OFFSET #define BARO_ETS_PRESSURE_OFFSET 101325.0 #endif #ifndef BARO_ETS_I2C_DEV #define BARO_ETS_I2C_DEV i2c0 #endif PRINT_CONFIG_VAR(BARO_ETS_I2C_DEV) PRINT_CONFIG_VAR(BARO_ETS_SENDER_ID) /** delay in seconds until sensor is read after startup */ #ifndef BARO_ETS_START_DELAY #define BARO_ETS_START_DELAY 0.2 #endif PRINT_CONFIG_VAR(BARO_ETS_START_DELAY) // Global variables uint16_t baro_ets_adc; uint16_t baro_ets_offset; bool_t baro_ets_valid; float baro_ets_altitude; bool_t baro_ets_enabled; float baro_ets_r; float baro_ets_sigma2; struct i2c_transaction baro_ets_i2c_trans; // Local variables bool_t baro_ets_offset_init; uint32_t baro_ets_offset_tmp; uint16_t baro_ets_cnt; uint32_t baro_ets_delay_time; bool_t baro_ets_delay_done; void baro_ets_init(void) { baro_ets_adc = 0; baro_ets_altitude = 0.0; baro_ets_offset = 0; baro_ets_offset_tmp = 0; baro_ets_valid = FALSE; baro_ets_offset_init = FALSE; baro_ets_enabled = TRUE; baro_ets_cnt = BARO_ETS_OFFSET_NBSAMPLES_INIT + BARO_ETS_OFFSET_NBSAMPLES_AVRG; baro_ets_r = BARO_ETS_R; baro_ets_sigma2 = BARO_ETS_SIGMA2; baro_ets_i2c_trans.status = I2CTransDone; baro_ets_delay_done = FALSE; SysTimeTimerStart(baro_ets_delay_time); } void baro_ets_read_periodic(void) { // Initiate next read if (!baro_ets_delay_done) { if (SysTimeTimer(baro_ets_delay_time) < USEC_OF_SEC(BARO_ETS_START_DELAY)) { return; } else { baro_ets_delay_done = TRUE; } } if (baro_ets_i2c_trans.status == I2CTransDone) { i2c_receive(&BARO_ETS_I2C_DEV, &baro_ets_i2c_trans, BARO_ETS_ADDR, 2); } } void baro_ets_read_event(void) { // Get raw altimeter from buffer baro_ets_adc = ((uint16_t)(baro_ets_i2c_trans.buf[1]) << 8) | (uint16_t)(baro_ets_i2c_trans.buf[0]); // Check if this is valid altimeter if (baro_ets_adc == 0) { baro_ets_valid = FALSE; } else { baro_ets_valid = TRUE; } // Continue only if a new altimeter value was received if (baro_ets_valid) { // Calculate offset average if not done already if (!baro_ets_offset_init) { --baro_ets_cnt; // Check if averaging completed if (baro_ets_cnt == 0) { // Calculate average baro_ets_offset = (uint16_t)(baro_ets_offset_tmp / BARO_ETS_OFFSET_NBSAMPLES_AVRG); // Limit offset if (baro_ets_offset < BARO_ETS_OFFSET_MIN) { baro_ets_offset = BARO_ETS_OFFSET_MIN; } if (baro_ets_offset > BARO_ETS_OFFSET_MAX) { baro_ets_offset = BARO_ETS_OFFSET_MAX; } baro_ets_offset_init = TRUE; } // Check if averaging needs to continue else if (baro_ets_cnt <= BARO_ETS_OFFSET_NBSAMPLES_AVRG) { baro_ets_offset_tmp += baro_ets_adc; } } // Convert raw to m/s if (baro_ets_offset_init) { baro_ets_altitude = ground_alt + BARO_ETS_ALT_SCALE * (float)(baro_ets_offset - baro_ets_adc); // New value available float pressure = BARO_ETS_SCALE * (float) baro_ets_adc + BARO_ETS_PRESSURE_OFFSET; AbiSendMsgBARO_ABS(BARO_ETS_SENDER_ID, &pressure); #ifdef BARO_ETS_SYNC_SEND DOWNLINK_SEND_BARO_ETS(DefaultChannel, DefaultDevice, &baro_ets_adc, &baro_ets_offset, &baro_ets_altitude); #endif } else { baro_ets_altitude = 0.0; } } else { baro_ets_altitude = 0.0; } // Transaction has been read baro_ets_i2c_trans.status = I2CTransDone; }
/* * YAFFS: Yet Another Flash File System. A NAND-flash specific file system. * * Copyright (C) 2002-2010 Aleph One Ltd. * for Toby Churchill Ltd and Brightstar Engineering * * Created by Charles Manning <charles@aleph1.co.uk> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ /* * This provides a YAFFS nand emulation on a file. * This is only intended as test code to test persistence etc. */ const char *yaffs_flashif_c_version = "$Id: yaffs_fileem.c,v 1.7 2010-02-18 01:18:04 charles Exp $"; #include "yportenv.h" #include "yaffs_trace.h" #include "yaffs_flashif.h" #include "yaffs_guts.h" #include "devextras.h" #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #define SIZE_IN_MB 16 #define BLOCK_SIZE (32 * 528) #define BLOCKS_PER_MEG ((1024*1024)/(32 * 512)) typedef struct { __u8 data[528]; // Data + spare } yflash_Page; typedef struct { yflash_Page page[32]; // The pages in the block } yflash_Block; typedef struct { int handle; int nBlocks; } yflash_Device; static yflash_Device filedisk; static int CheckInit(yaffs_Device *dev) { static int initialised = 0; int i; int fSize; int written; yflash_Page p; if(initialised) { return YAFFS_OK; } initialised = 1; filedisk.nBlocks = (SIZE_IN_MB * 1024 * 1024)/(16 * 1024); filedisk.handle = open("emfile-512-0", O_RDWR | O_CREAT, S_IREAD | S_IWRITE); if(filedisk.handle < 0) { perror("Failed to open yaffs emulation file"); return YAFFS_FAIL; } fSize = lseek(filedisk.handle,0,SEEK_END); if(fSize < SIZE_IN_MB * 1024 * 1024) { printf("Creating yaffs emulation file\n"); lseek(filedisk.handle,0,SEEK_SET); memset(&p,0xff,sizeof(yflash_Page)); for(i = 0; i < SIZE_IN_MB * 1024 * 1024; i+= 512) { written = write(filedisk.handle,&p,sizeof(yflash_Page)); if(written != sizeof(yflash_Page)) { printf("Write failed\n"); return YAFFS_FAIL; } } } return 1; } int yflash_WriteChunkToNAND(yaffs_Device *dev,int chunkInNAND,const __u8 *data, const yaffs_Spare *spare) { int written; CheckInit(dev); if(data) { lseek(filedisk.handle,chunkInNAND * 528,SEEK_SET); written = write(filedisk.handle,data,512); if(written != 512) return YAFFS_FAIL; } if(spare) { lseek(filedisk.handle,chunkInNAND * 528 + 512,SEEK_SET); written = write(filedisk.handle,spare,16); if(written != 16) return YAFFS_FAIL; } return YAFFS_OK; } int yflash_ReadChunkFromNAND(yaffs_Device *dev,int chunkInNAND, __u8 *data, yaffs_Spare *spare) { int nread; CheckInit(dev); if(data) { lseek(filedisk.handle,chunkInNAND * 528,SEEK_SET); nread = read(filedisk.handle,data,512); if(nread != 512) return YAFFS_FAIL; } if(spare) { lseek(filedisk.handle,chunkInNAND * 528 + 512,SEEK_SET); nread= read(filedisk.handle,spare,16); if(nread != 16) return YAFFS_FAIL; } return YAFFS_OK; } int yflash_EraseBlockInNAND(yaffs_Device *dev, int blockNumber) { int i; CheckInit(dev); if(blockNumber < 0 || blockNumber >= filedisk.nBlocks) { T(YAFFS_TRACE_ALWAYS,("Attempt to erase non-existant block %d\n",blockNumber)); return YAFFS_FAIL; } else { yflash_Page pg; memset(&pg,0xff,sizeof(yflash_Page)); lseek(filedisk.handle, blockNumber * 32 * 528, SEEK_SET); for(i = 0; i < 32; i++) { write(filedisk.handle,&pg,528); } return YAFFS_OK; } } int yflash_InitialiseNAND(yaffs_Device *dev) { return YAFFS_OK; }
/* * deref.c * compile command: gcc -g -o deref deref.c * execute command: deref filename.texi > newfile.texi * To: bob@gnu.ai.mit.edu * Subject: another tool * Date: 18 Dec 91 16:03:13 EST (Wed) * From: gatech!skeeve!arnold@eddie.mit.edu (Arnold D. Robbins) * * Here is deref.c. It turns texinfo cross references back into the * one argument form. It has the same limitations as fixref; one xref per * line and can't cross lines. You can use it to find references that do * cross a line boundary this way: * * deref < manual > /dev/null 2>errs * * (This assumes bash or /bin/sh.) The file errs will have list of lines * where deref could not find matching braces. * * A gawk manual processed by deref goes through makeinfo without complaint. * Compile with gcc and you should be set. * * Enjoy, * * Arnold * ----------- */ /* * deref.c * * Make all texinfo references into the one argument form. * * Arnold Robbins * arnold@skeeve.atl.ga.us * December, 1991 * * Copyright, 1991, Arnold Robbins */ /* * LIMITATIONS: * One texinfo cross reference per line. * Cross references may not cross newlines. * Use of fgets for input (to be fixed). */ #include <stdio.h> #include <ctype.h> #include <errno.h> /* for gcc on the 3B1, delete if this gives you grief */ extern int fclose (FILE * fp); extern int fprintf (FILE * fp, const char *str,...); extern char *strerror (int errno); extern char *strchr (char *cp, int ch); extern int strncmp (const char *s1, const char *s2, int count); extern int errno; void process (FILE * fp); void repair (char *line, char *ref, int toffset); int Errs = 0; char *Name = "stdin"; int Line = 0; char *Me; /* main --- handle arguments, global vars for errors */ int main (int argc, char **argv) { FILE *fp; Me = argv[0]; if (argc == 1) process (stdin); else for (argc--, argv++; *argv != NULL; argc--, argv++) { if (argv[0][0] == '-' && argv[0][1] == '\0') { Name = "stdin"; Line = 0; process (stdin); } else if ((fp = fopen (*argv, "r")) != NULL) { Name = *argv; Line = 0; process (fp); fclose (fp); } else { fprintf (stderr, "%s: can not open: %s\n", *argv, strerror (errno)); Errs++; } } return Errs != 0; } /* isref --- decide if we've seen a texinfo cross reference */ int isref (char *cp) { if (strncmp (cp, "@ref{", 5) == 0) return 5; if (strncmp (cp, "@xref{", 6) == 0) return 6; if (strncmp (cp, "@pxref{", 7) == 0) return 7; return 0; } /* process --- read files, look for references, fix them up */ void process (FILE * fp) { char buf[BUFSIZ]; char *cp; int count; while (fgets (buf, sizeof buf, fp) != NULL) { Line++; cp = strchr (buf, '@'); if (cp == NULL) { fputs (buf, stdout); continue; } do { count = isref (cp); if (count == 0) { cp++; cp = strchr (cp, '@'); if (cp == NULL) { fputs (buf, stdout); goto next; } continue; } /* got one */ repair (buf, cp, count); break; } while (cp != NULL); next:; } } /* repair --- turn all texinfo cross references into the one argument form */ void repair (char *line, char *ref, int toffset) { int braces = 1; /* have seen first left brace */ char *cp; ref += toffset; /* output line up to and including left brace in reference */ for (cp = line; cp <= ref; cp++) putchar (*cp); /* output node name */ for (; *cp && *cp != '}' && *cp != ',' && *cp != '\n'; cp++) putchar (*cp); if (*cp != '}') { /* could have been one arg xref */ /* skip to matching right brace */ for (; braces > 0; cp++) { switch (*cp) { case '@': cp++; /* blindly skip next character */ break; case '{': braces++; break; case '}': braces--; break; case '\n': case '\0': Errs++; fprintf (stderr, "%s: %s: %d: mismatched braces\n", Me, Name, Line); goto out; default: break; } } out: ; } putchar ('}'); if (*cp == '}') cp++; /* now the rest of the line */ for (; *cp; cp++) putchar (*cp); return; } /* strerror --- return error string, delete if in your library */ char * strerror (int errno) { static char buf[100]; extern int sys_nerr; extern char *sys_errlist[]; if (errno < sys_nerr && errno >= 0) return sys_errlist[errno]; sprintf (buf, "unknown error %d", errno); return buf; }
f () { int i; for (i--) /* { dg-error "parse" } */ ; }
/*********************************************************************** Label - Class for (text) labels. Copyright (c) 2001-2010 Oliver Kreylos This file is part of the GLMotif Widget Library (GLMotif). The GLMotif Widget Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GLMotif Widget Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GLMotif Widget Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ***********************************************************************/ #ifndef GLMOTIF_LABEL_INCLUDED #define GLMOTIF_LABEL_INCLUDED #include <GL/gl.h> #include <GL/GLFont.h> #include <GL/GLLabel.h> #include <GLMotif/Widget.h> namespace GLMotif { class Label:public Widget { /* Elements: */ protected: GLfloat marginWidth; // Width of margin around label string GLfloat leftInset,rightInset; // Additional inset spacing to the left and the right of the label GLLabel label; // The label string GLFont::HAlignment hAlignment; // Horizontal alignment of label string in widget GLFont::VAlignment vAlignment; // Vertical alignment of label string in widget /* Protected methods: */ void positionLabel(void); // Positions the label inside the widget void setInsets(GLfloat newLeftInset,GLfloat newRightInset); // Sets the inset values /* Constructors and destructors: */ public: Label(const char* sName,Container* sParent,const char* sLabel,const GLFont* sFont,bool manageChild =true); // Deprecated Label(const char* sName,Container* sParent,const char* sLabel,bool manageChild =true); Label(const char* sName,Container* sParent,const char* sLabelBegin,const char* sLabelEnd,bool manageChild =true); /* Methods inherited from Widget: */ virtual Vector calcNaturalSize(void) const; virtual void resize(const Box& newExterior); virtual void setBackgroundColor(const Color& newBackgroundColor); virtual void setForegroundColor(const Color& newForegroundColor); virtual void draw(GLContextData& contextData) const; /* New methods: */ GLfloat getMarginWidth(void) const // Returns the label's margin width { return marginWidth; } void setMarginWidth(GLfloat newMarginWidth); // Changes the margin width void setHAlignment(GLFont::HAlignment newHAlignment); // Changes the horizontal alignment void setVAlignment(GLFont::VAlignment newVAlignment); // Changes the vertical alignment const GLLabel& getLabel(void) const // Returns the label object { return label; } int getLabelLength(void) const // Returns the length of the current label text { return label.getLength(); } const char* getString(void) const // Returns the current label text { return label.getString(); } virtual void setString(const char* newLabelBegin,const char* newLabelEnd); // Changes the label text void setString(const char* newLabel); // Convenience version of above for C-style strings }; } #endif
// SPDX-License-Identifier: GPL-2.0-or-later /* * * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2010 GSyC/LibreSoft, Universidad Rey Juan Carlos. * */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdbool.h> #include "lib/sdp.h" #include "lib/sdp_lib.h" #include "lib/uuid.h" #include "btio/btio.h" #include "src/adapter.h" #include "src/device.h" #include "src/profile.h" #include "src/service.h" #include "src/uuid-helper.h" #include "src/log.h" #include "hdp_types.h" #include "hdp_manager.h" #include "hdp.h" static int hdp_adapter_probe(struct btd_profile *p, struct btd_adapter *adapter) { return hdp_adapter_register(adapter); } static void hdp_adapter_remove(struct btd_profile *p, struct btd_adapter *adapter) { hdp_adapter_unregister(adapter); } static int hdp_driver_probe(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); return hdp_device_register(device); } static void hdp_driver_remove(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); hdp_device_unregister(device); } static struct btd_profile hdp_source_profile = { .name = "hdp-source", .remote_uuid = HDP_SOURCE_UUID, .device_probe = hdp_driver_probe, .device_remove = hdp_driver_remove, .adapter_probe = hdp_adapter_probe, .adapter_remove = hdp_adapter_remove, }; static struct btd_profile hdp_sink_profile = { .name = "hdp-sink", .remote_uuid = HDP_SINK_UUID, .device_probe = hdp_driver_probe, .device_remove = hdp_driver_remove, }; int hdp_manager_init(void) { if (hdp_manager_start() < 0) return -1; btd_profile_register(&hdp_source_profile); btd_profile_register(&hdp_sink_profile); return 0; } void hdp_manager_exit(void) { btd_profile_unregister(&hdp_sink_profile); btd_profile_unregister(&hdp_source_profile); hdp_manager_stop(); }
/* * Copyright (C) 2017-2018 Team Kodi * This file is part of Kodi - https://kodi.tv * * SPDX-License-Identifier: GPL-2.0-or-later * See LICENSES/README.md for more information. */ #pragma once #include "cores/VideoPlayer/Process/VideoBuffer.h" extern "C" { #include <libavutil/frame.h> #include <libavutil/hwcontext_drm.h> } // Color enums is copied from linux include/drm/drm_color_mgmt.h (strangely not part of uapi) enum drm_color_encoding { DRM_COLOR_YCBCR_BT601, DRM_COLOR_YCBCR_BT709, DRM_COLOR_YCBCR_BT2020, }; enum drm_color_range { DRM_COLOR_YCBCR_LIMITED_RANGE, DRM_COLOR_YCBCR_FULL_RANGE, }; class IVideoBufferDRMPRIME : public CVideoBuffer { public: IVideoBufferDRMPRIME() = delete; virtual ~IVideoBufferDRMPRIME() = default; virtual AVDRMFrameDescriptor* GetDescriptor() const = 0; virtual uint32_t GetWidth() const = 0; virtual uint32_t GetHeight() const = 0; virtual int GetColorEncoding() const { return DRM_COLOR_YCBCR_BT709; }; virtual int GetColorRange() const { return DRM_COLOR_YCBCR_LIMITED_RANGE; }; virtual bool IsValid() const { return true; }; virtual bool Map() { return true; }; virtual void Unmap() {}; uint32_t m_fb_id = 0; uint32_t m_handles[AV_DRM_MAX_PLANES] = {}; protected: explicit IVideoBufferDRMPRIME(int id); }; class CVideoBufferDRMPRIME : public IVideoBufferDRMPRIME { public: CVideoBufferDRMPRIME(IVideoBufferPool& pool, int id); ~CVideoBufferDRMPRIME(); void SetRef(AVFrame* frame); void Unref(); AVDRMFrameDescriptor* GetDescriptor() const override { return reinterpret_cast<AVDRMFrameDescriptor*>(m_pFrame->data[0]); } uint32_t GetWidth() const override { return m_pFrame->width; } uint32_t GetHeight() const override { return m_pFrame->height; } int GetColorEncoding() const override; int GetColorRange() const override; bool IsValid() const override; protected: AVFrame* m_pFrame = nullptr; }; class CVideoBufferPoolDRMPRIME : public IVideoBufferPool { public: ~CVideoBufferPoolDRMPRIME(); void Return(int id) override; CVideoBuffer* Get() override; protected: CCriticalSection m_critSection; std::vector<CVideoBufferDRMPRIME*> m_all; std::deque<int> m_used; std::deque<int> m_free; };
// // ActionConfigurator.h // Dasher // // Created by Alan Lawrence on 24/11/2010. // Copyright 2010 Cavendish Laboratory. All rights reserved. // #import "Actions.h" @interface ActionConfigurator : UITableViewController { ActionButton *button; UIView *headers[3]; } -(id)init; @end
/*************************************************************************** qgswmsgetcapabilities.h ------------------------- begin : December 20 , 2016 copyright : (C) 2007 by Marco Hugentobler (original code) (C) 2014 by Alessandro Pasotti (original code) (C) 2016 by David Marteau email : marco dot hugentobler at karto dot baug dot ethz dot ch a dot pasotti at itopen dot it david dot marteau at 3liz dot com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSWMSGETCAPABILITIES_H #define QGSWMSGETCAPABILITIES_H #include "qgslayertreenode.h" #include "qgslayertreegroup.h" #include "qgslayertreelayer.h" #include "qgslayertree.h" namespace QgsWms { /** * Create element for get capabilities document */ QDomElement getLayersAndStylesCapabilitiesElement( QDomDocument &doc, QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request, bool projectSettings ); /** * Create WFSLayers element for get capabilities document */ QDomElement getWFSLayersElement( QDomDocument &doc, const QgsProject *project ); /** * Create ComposerTemplates element for get capabilities document */ QDomElement getComposerTemplatesElement( QDomDocument &doc, const QgsProject *project ); /** * Create InspireCapabilities element for get capabilities document */ QDomElement getInspireCapabilitiesElement( QDomDocument &doc, const QgsProject *project ); /** * Create Capability element for get capabilities document */ QDomElement getCapabilityElement( QDomDocument &doc, const QgsProject *project, const QString &version, const QgsServerRequest &request, bool projectSettings, QgsServerInterface *serverIface ); /** * Create Service element for get capabilities document */ QDomElement getServiceElement( QDomDocument &doc, const QgsProject *project, const QString &version, const QgsServerRequest &request ); /** * Output GetCapabilities response */ void writeGetCapabilities( QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request, QgsServerResponse &response, bool projectSettings = false ); /** * Creates the WMS GetCapabilities XML document. * \param serverIface Interface for plugins * \param project Project * \param version WMS version * \param request WMS request * \param projectSettings If TRUE, adds extended project information (does not validate against WMS schema) * \returns GetCapabilities XML document */ QDomDocument getCapabilities( QgsServerInterface *serverIface, const QgsProject *project, const QString &version, const QgsServerRequest &request, bool projectSettings ); bool hasQueryableChildren( const QgsLayerTreeNode *childNode, const QStringList &wmsRestrictedLayers ); } // namespace QgsWms #endif
#define FUNC __ieee754_asin #include <e_acos.c>
#ifndef __PMIC_HI6551_H__ #define __PMIC_HI6551_H__ #include <balongv7r2/types.h> #include <bsp_pmu.h> /**/ #define PMU_HI6551_POWER_KEY_MASK (1<<5) /* Bit 5 for Power key */ #define PMU_HI6551_USB_STATE_MASK (1<<5) #define PMU_HI6551_HRESET_STATE_MASK (1<<1) #define HI6551_OTMP_125_OFFSET 0 #define HI6551_OTMP_150_OFFSET 7 #define HI6551_VSYS_UNDER_2P5_OFFSET 2 #define HI6551_VSYS_UNDER_2P7_OFFSET 3 #define HI6551_VSYS_OVER_6P0_OFFSET 4 #define HI6551_POWER_KEY_4S_PRESS_OFFSET 5 #define HI6551_POWER_KEY_20MS_RELEASE_OFFSET 6 #define HI6551_POWER_KEY_20MS_PRESS_OFFSET 7 /*º¯ÊýÉùÃ÷*/ /***************************************************************************** º¯ Êý Ãû : pmu_hi6551_init ¹¦ÄÜÃèÊö : pmu hi6551Ä£¿é³õʼ»¯ ÊäÈë²ÎÊý : ÎÞ Êä³ö²ÎÊý : ÎÞ ·µ »Ø Öµ : ÎÞ µ÷Óú¯Êý : fastbootÖÐpmuÄ£¿éÊÊÅä²ã ±»µ÷º¯Êý : *****************************************************************************/ void pmu_hi6551_init(void); /***************************************************************************** º¯ Êý Ãû : hi6551_power_key_state_get ¹¦ÄÜÃèÊö : »ñÈ¡power¼üÊÇ·ñ°´Ï ÊäÈë²ÎÊý : void Êä³ö²ÎÊý : ÎÞ ·µ »Ø Öµ : power¼üÊÇ·ñ°´Ï£º1:°´Ï£»0:δ°´ÏÂ) µ÷Óú¯Êý : fastbootÖÐpmuÄ£¿éÊÊÅä²ã ±»µ÷º¯Êý : *****************************************************************************/ bool hi6551_power_key_state_get(void); /***************************************************************************** º¯ Êý Ãû : bsp_hi6551_usb_state_get ¹¦ÄÜÃèÊö : »ñÈ¡usbÊÇ·ñ²å°Î״̬ ÊäÈë²ÎÊý : void Êä³ö²ÎÊý : ÎÞ ·µ »Ø Öµ : usb²åÈë»ò°Î³ö(1:²åÈ룻0:°Î³ö) µ÷Óú¯Êý : fastbootÖÐpmuÄ£¿éÊÊÅä²ã ±»µ÷º¯Êý : *****************************************************************************/ bool hi6551_usb_state_get(void); /***************************************************************************** º¯ Êý Ãû : hi6551_hreset_state_get ¹¦ÄÜÃèÊö : ÅжÏpmuÊÇ·ñΪÈÈÆô¶¯ ÊäÈë²ÎÊý : void Êä³ö²ÎÊý : ÎÞ ·µ »Ø Öµ : pmuÊÇÈÈÆô¶¯»òÀäÆô¶¯(1:ÈÈÆô¶¯£»0:ÀäÆô¶¯) µ÷Óú¯Êý : fastbootÖÐpmuÄ£¿éÊÊÅä²ã ±»µ÷º¯Êý : *****************************************************************************/ bool hi6551_hreset_state_get(void); /***************************************************************************** º¯ Êý Ãû : hi6551_hreset_state_clear ¹¦ÄÜÃèÊö : Çå³ýpmuÊÇ·ñΪÈÈÆô¶¯±êÖ¾ ÊäÈë²ÎÊý : void Êä³ö²ÎÊý : ÎÞ ·µ »Ø Öµ : ÎÞ µ÷Óú¯Êý : fastbootÖÐpmuÄ£¿éÊÊÅä²ã ±»µ÷º¯Êý : *****************************************************************************/ void hi6551_hreset_state_clear(void); /***************************************************************************** º¯ Êý Ãû : hi6551_lvs4_switch ¹¦ÄÜÃèÊö : ¿ª¹Ølvs04µçÔ´ ÊäÈë²ÎÊý : void Êä³ö²ÎÊý : ÎÞ ·µ »Ø Öµ : µ÷Óú¯Êý : ±»µ÷º¯Êý : lcdÄ£¿éµ÷Óà *****************************************************************************/ int hi6551_lvs4_switch(power_switch_e sw); /***************************************************************************** º¯ Êý Ãû : hi6551_ldo14_switch ¹¦ÄÜÃèÊö : ¿ª¹Øldo14µçÔ´ ÊäÈë²ÎÊý : void Êä³ö²ÎÊý : ÎÞ ·µ »Ø Öµ : µ÷Óú¯Êý : ±»µ÷º¯Êý : lcdÄ£¿éµ÷Óà *****************************************************************************/ int hi6551_ldo14_switch(power_switch_e sw); /***************************************************************************** º¯ Êý Ãû : hi6551_ldo14_volt_set ¹¦ÄÜÃèÊö : ÉèÖÃldo14µçÔ´µçѹ ÊäÈë²ÎÊý : void Êä³ö²ÎÊý : ÎÞ ·µ »Ø Öµ : µ÷Óú¯Êý : ±»µ÷º¯Êý : lcdÄ£¿éµ÷Óà *****************************************************************************/ int hi6551_ldo14_volt_set(int voltage); /***************************************************************************** º¯ Êý Ãû : hi6551_ldo23_switch ¹¦ÄÜÃèÊö : ¿ª¹Øldo23µçÔ´ ÊäÈë²ÎÊý : void Êä³ö²ÎÊý : ÎÞ ·µ »Ø Öµ : µ÷Óú¯Êý : ±»µ÷º¯Êý : efuseÄ£¿éµ÷Óà *****************************************************************************/ int hi6551_ldo23_switch(power_switch_e sw); /***************************************************************************** º¯ Êý Ãû : hi6551_ldo23_volt_set ¹¦ÄÜÃèÊö : ÉèÖÃldo23µçÔ´µçѹ ÊäÈë²ÎÊý : void Êä³ö²ÎÊý : ÎÞ ·µ »Ø Öµ : µ÷Óú¯Êý : ±»µ÷º¯Êý : efuseÄ£¿éµ÷Óà *****************************************************************************/ int hi6551_ldo23_volt_set(int voltage); /***************************************************************************** º¯ Êý Ãû : hi6551_version_get ¹¦ÄÜÃèÊö : »ñÈ¡pmuµÄ°æ±¾ºÅ ÊäÈë²ÎÊý : void Êä³ö²ÎÊý : ÎÞ ·µ »Ø Öµ : pmu°æ±¾ºÅ µ÷Óú¯Êý : ±»µ÷º¯Êý : HSO¼¯³É,MSPµ÷Óà *****************************************************************************/ u8 hi6551_version_get(void); int hi6551_get_boot_state(void); /***************************************************************************** º¯ Êý Ãû : hi6551_set_by_nv ¹¦ÄÜÃèÊö : ¸ù¾ÝnvÏîÉèÖýøÐÐĬÈÏÉèÖà ÊäÈë²ÎÊý : void Êä³ö²ÎÊý : ÎÞ ·µ »Ø Öµ : pmuĬÈÏÉèÖÃ(Ö÷ÒªÖ¸Óë²úÆ·ÐÎ̬Ïà¹ØµÄ) µ÷Óú¯Êý : ±»µ÷º¯Êý : *****************************************************************************/ void hi6551_set_by_nv(void); #endif
/* * Generated by MTK SP DrvGen Version 10.03.0 for MT6589_NP. Copyright MediaTek Inc. (C) 2012. * Tue Jul 09 16:27:05 2013 * Do Not Modify the File. */ #ifndef __CUST_AUXADC_TOOL_H #define __CUST_AUXADC_TOOL_H #define AUXADC_TEMPERATURE_CHANNEL 3 #endif //_CUST_AUXADC_TOOL_H
/* Copyright (C) 2002 Free Software Foundation. Test -minline-all-stringops memset with various combinations of pointer alignments and lengths to make sure builtin optimizations are correct. PR target/6456. Written by Michael Meissner, March 9, 2002. Target by Roger Sayle, April 25, 2002. */ /* { dg-do run { target "i?86-*-*" } } */ /* { dg-options "-O2 -minline-all-stringops" } */ #ifndef MAX_OFFSET #define MAX_OFFSET (sizeof (long long)) #endif #ifndef MAX_COPY #define MAX_COPY (8 * sizeof (long long)) #endif #ifndef MAX_EXTRA #define MAX_EXTRA (sizeof (long long)) #endif #define MAX_LENGTH (MAX_OFFSET + MAX_COPY + MAX_EXTRA) static union { char buf[MAX_LENGTH]; long long align_int; long double align_fp; } u; char A = 'A'; main () { int off, len, i; char *p, *q; for (off = 0; off < MAX_OFFSET; off++) for (len = 1; len < MAX_COPY; len++) { for (i = 0; i < MAX_LENGTH; i++) u.buf[i] = 'a'; p = memset (u.buf + off, '\0', len); if (p != u.buf + off) abort (); q = u.buf; for (i = 0; i < off; i++, q++) if (*q != 'a') abort (); for (i = 0; i < len; i++, q++) if (*q != '\0') abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); p = memset (u.buf + off, A, len); if (p != u.buf + off) abort (); q = u.buf; for (i = 0; i < off; i++, q++) if (*q != 'a') abort (); for (i = 0; i < len; i++, q++) if (*q != 'A') abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); p = memset (u.buf + off, 'B', len); if (p != u.buf + off) abort (); q = u.buf; for (i = 0; i < off; i++, q++) if (*q != 'a') abort (); for (i = 0; i < len; i++, q++) if (*q != 'B') abort (); for (i = 0; i < MAX_EXTRA; i++, q++) if (*q != 'a') abort (); } exit(0); }
/******************************************************************** Copyright (c) 2013-2015 - Mogara This file is part of QSanguosha-Hegemony. This game 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.0 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. See the LICENSE file for more details. Mogara *********************************************************************/ #ifndef _CHAT_WIDGET_H #define _CHAT_WIDGET_H #include <QObject> #include <QIcon> #include <QPixmap> #include <QGraphicsObject> #include <QPushButton> #include <QGraphicsProxyWidget> #include <QGraphicsPixmapItem> class MyPixmapItem : public QObject, public QGraphicsPixmapItem { Q_OBJECT public: MyPixmapItem(const QPixmap &pixmap, QGraphicsItem *parentItem = 0); ~MyPixmapItem(); public: QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); void setSize(int x, int y); QString itemName; private: virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event); void initFaceBoardPos(); void initEasyTextPos(); int mouseCanClick(int x, int y); int mouseOnIcon(int x, int y); int mouseOnText(int x, int y); int sizex; int sizey; QList <QRect> faceboardPos; QList <QRect> easytextPos; QList <QString> easytext; signals: void my_pixmap_item_msg(QString); }; class ChatWidget : public QGraphicsObject { Q_OBJECT public: ChatWidget(); ~ChatWidget(); virtual QRectF boundingRect() const; protected: virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); private: QPixmap base_pixmap; QPushButton *returnButton; QPushButton *chatfaceButton; QPushButton *easytextButton; MyPixmapItem *chat_face_board, *easy_text_board; QGraphicsRectItem *base; QGraphicsProxyWidget *addWidget(QWidget *widget, int x); QPushButton *addButton(const QString &name, int x); QPushButton *createButton(const QString &name); private slots: void showEasyTextBoard(); void showFaceBoard(); void sendText(); signals: void chat_widget_msg(QString); void return_button_click(); }; #endif
// Copyright 2015 Olivier Gillet. // // Author: Olivier Gillet (ol.gillet@gmail.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // // See http://creativecommons.org/licenses/MIT/ for more information. // // ----------------------------------------------------------------------------- // // Resources definitions. // // Automatically generated with: // make resources #ifndef RINGS_RESOURCES_H_ #define RINGS_RESOURCES_H_ #include "stmlib/stmlib.h" #include "../mutable_resources.h" using namespace mutable_resources; namespace rings { typedef uint8_t ResourceId; extern const int16_t* lookup_table_int16_table[]; extern const uint32_t* lookup_table_uint32_table[]; extern const float* lookup_table_table[]; const int LUT_SINE = 0; const int LUT_SINE_SIZE = 5121; const int LUT_4_DECADES = 1; const int LUT_4_DECADES_SIZE = 257; const int LUT_SVF_SHIFT = 2; const int LUT_SVF_SHIFT_SIZE = 257; const int LUT_STIFFNESS = 3; const int LUT_STIFFNESS_SIZE = 257; const int LUT_FM_FREQUENCY_QUANTIZER = 4; const int LUT_FM_FREQUENCY_QUANTIZER_SIZE = 129; } // namespace rings #endif // RINGS_RESOURCES_H_
/* classes: h_files */ #ifndef SCM_EXTENSIONS_H #define SCM_EXTENSIONS_H /* Copyright (C) 2001, 2006, 2008 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 3 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA */ #include "libguile/__scm.h" typedef void (*scm_t_extension_init_func)(void*); SCM_API void scm_c_register_extension (const char *lib, const char *init, void (*func) (void *), void *data); SCM_API void scm_c_load_extension (const char *lib, const char *init); SCM_API SCM scm_load_extension (SCM lib, SCM init); SCM_INTERNAL void scm_init_extensions (void); #endif /* SCM_EXTENSIONS_H */ /* Local Variables: c-file-style: "gnu" End: */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: set ts=8 sts=4 et sw=4 tw=99: * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef jspropertytree_h #define jspropertytree_h #include "jsalloc.h" #include "js/HashTable.h" #include "js/RootingAPI.h" namespace js { class Shape; struct StackShape; struct ShapeHasher { typedef Shape *Key; typedef StackShape Lookup; static inline HashNumber hash(const Lookup &l); static inline bool match(Key k, const Lookup &l); }; typedef HashSet<Shape *, ShapeHasher, SystemAllocPolicy> KidsHash; class KidsPointer { private: enum { SHAPE = 0, HASH = 1, TAG = 1 }; uintptr_t w; public: bool isNull() const { return !w; } void setNull() { w = 0; } bool isShape() const { return (w & TAG) == SHAPE && !isNull(); } Shape *toShape() const { JS_ASSERT(isShape()); return reinterpret_cast<Shape *>(w & ~uintptr_t(TAG)); } void setShape(Shape *shape) { JS_ASSERT(shape); JS_ASSERT((reinterpret_cast<uintptr_t>(static_cast<Shape *>(shape)) & TAG) == 0); w = reinterpret_cast<uintptr_t>(static_cast<Shape *>(shape)) | SHAPE; } bool isHash() const { return (w & TAG) == HASH; } KidsHash *toHash() const { JS_ASSERT(isHash()); return reinterpret_cast<KidsHash *>(w & ~uintptr_t(TAG)); } void setHash(KidsHash *hash) { JS_ASSERT(hash); JS_ASSERT((reinterpret_cast<uintptr_t>(hash) & TAG) == 0); w = reinterpret_cast<uintptr_t>(hash) | HASH; } #ifdef DEBUG void checkConsistency(Shape *aKid) const; #endif }; class PropertyTree { friend class ::JSFunction; JSCompartment *compartment; bool insertChild(JSContext *cx, Shape *parent, Shape *child); PropertyTree(); public: /* * Use a lower limit for objects that are accessed using SETELEM (o[x] = y). * These objects are likely used as hashmaps and dictionary mode is more * efficient in this case. */ enum { MAX_HEIGHT = 512, MAX_HEIGHT_WITH_ELEMENTS_ACCESS = 128 }; PropertyTree(JSCompartment *comp) : compartment(comp) { } Shape *newShape(JSContext *cx); Shape *getChild(JSContext *cx, Shape *parent, uint32_t nfixed, const StackShape &child); #ifdef DEBUG static void dumpShapes(JSRuntime *rt); #endif }; } /* namespace js */ #endif /* jspropertytree_h */
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "EUTRA-RRC-Definitions" * found in "36331-c10.asn" * `asn1c -S /usr/local/share/asn1c -fcompound-names -fskeletons-copy -gen-PER` */ #include "P-Max.h" int P_Max_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= -30 && value <= 33)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void P_Max_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->check_constraints = asn_DEF_NativeInteger.check_constraints; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void P_Max_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { P_Max_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int P_Max_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { P_Max_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t P_Max_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { P_Max_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t P_Max_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { P_Max_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t P_Max_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { P_Max_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t P_Max_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { P_Max_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t P_Max_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { P_Max_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t P_Max_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { P_Max_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } static asn_per_constraints_t asn_PER_type_P_Max_constr_1 GCC_NOTUSED = { { APC_CONSTRAINED, 6, 6, -30, 33 } /* (-30..33) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static ber_tlv_tag_t asn_DEF_P_Max_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_P_Max = { "P-Max", "P-Max", P_Max_free, P_Max_print, P_Max_constraint, P_Max_decode_ber, P_Max_encode_der, P_Max_decode_xer, P_Max_encode_xer, P_Max_decode_uper, P_Max_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_P_Max_tags_1, sizeof(asn_DEF_P_Max_tags_1) /sizeof(asn_DEF_P_Max_tags_1[0]), /* 1 */ asn_DEF_P_Max_tags_1, /* Same as above */ sizeof(asn_DEF_P_Max_tags_1) /sizeof(asn_DEF_P_Max_tags_1[0]), /* 1 */ &asn_PER_type_P_Max_constr_1, 0, 0, /* No members */ 0 /* No specifics */ };
/* * Copyright (C) 2015 Nick van IJzendoorn <nijzendoorn@engineering-spirit.nl> * 2017 HAW Hamburg * * 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 Thread test application * * @author Nick van IJzendoorn <nijzendoorn@engineering-spirit.nl> * @author Sebastian Meiling <s@mlng.net> * * @} */ #include <stdio.h> #include <inttypes.h> #include "log.h" #include "msg.h" #define MSG_QUEUE_LENGTH (8) msg_t msg_queue[MSG_QUEUE_LENGTH]; int main(void) { msg_t msges[MSG_QUEUE_LENGTH]; msg_init_queue(msg_queue, MSG_QUEUE_LENGTH); puts("[START]"); /* add message to own queue */ for (unsigned idx = 0; idx < MSG_QUEUE_LENGTH; ++idx) { msges[idx].type = idx; msg_send_to_self(msges + idx); LOG_INFO("+ add msg: %d\n", idx); if (msg_avail() != (idx) + 1) { puts("[FAILED]"); return 1; } } /* receive available messages in queue */ for (unsigned idx = msg_avail(); idx > 0; --idx) { msg_t msg; msg_receive(&msg); LOG_INFO("- got msg: %d\n", (MSG_QUEUE_LENGTH - idx)); if (msg.type != (MSG_QUEUE_LENGTH - idx) || msg_avail() != idx - 1) { puts("[FAILED]"); return 1; } } puts("[SUCCESS]"); return 0; }
/* * Copyright (C) 2016 MUTEX NZ Ltd * * 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 auto_init_gnrc_netif * @{ * * @file * @brief Auto initialization for the cc2538 network interface * * @author Aaron Sowry <aaron@mutex.nz> */ #ifdef MODULE_CC2538_RF #include "log.h" #ifdef MODULE_GNRC_NETIF2 #include "net/gnrc/netif2/ieee802154.h" #else #include "net/gnrc/netdev.h" #include "net/gnrc/netdev/ieee802154.h" #endif #include "cc2538_rf.h" /** * @brief Define stack parameters for the MAC layer thread * @{ */ #define CC2538_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT) #ifndef CC2538_MAC_PRIO #ifdef MODULE_GNRC_NETIF2 #define CC2538_MAC_PRIO (GNRC_NETIF2_PRIO) #else #define CC2538_MAC_PRIO (GNRC_NETDEV_MAC_PRIO) #endif #endif static cc2538_rf_t cc2538_rf_dev; #ifndef MODULE_GNRC_NETIF2 static gnrc_netdev_t gnrc_adpt; #endif static char _cc2538_rf_stack[CC2538_MAC_STACKSIZE]; void auto_init_cc2538_rf(void) { LOG_DEBUG("[auto_init_netif] initializing cc2538 radio\n"); cc2538_setup(&cc2538_rf_dev); #ifdef MODULE_GNRC_NETIF2 if (!gnrc_netif2_ieee802154_create(_cc2538_rf_stack, CC2538_MAC_STACKSIZE, CC2538_MAC_PRIO, "cc2538_rf", (netdev_t *)&cc2538_rf_dev)) { LOG_ERROR("[auto_init_netif] error initializing cc2538 radio\n"); } #else int res = gnrc_netdev_ieee802154_init(&gnrc_adpt, (netdev_ieee802154_t *)&cc2538_rf_dev); if (res < 0) { LOG_ERROR("[auto_init_netif] error initializing cc2538 radio\n"); } else { gnrc_netdev_init(_cc2538_rf_stack, CC2538_MAC_STACKSIZE, CC2538_MAC_PRIO, "cc2538_rf", &gnrc_adpt); } #endif } #else typedef int dont_be_pedantic; #endif /* MODULE_CC2538_RF */ /** @} */
/* ex: set tabstop=2 expandtab: -*- Mode: C; tab-width: 2; indent-tabs-mode nil -*- */ /** * @file core_actions.h * @author Sandro Rigo * Marcus Bartholomeu * Alexandro Baldassin * Thiago Sigrist * Marilia Chiozo * * @author The ArchC Team * http://www.archc.org/ * * Computer Systems Laboratory (LSC) * IC-UNICAMP * http://www.lsc.ic.unicamp.br/ * * @version 1.0 * @date Fri, 02 Jun 2006 10:59:18 -0300 * * @brief Core language semantic actions * * This file contain the semantic actions and variables called/used * by the main parser module \ref bison_group * * @attention Copyright (C) 2002-2006 --- The ArchC Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ /** @defgroup coreact_group Core semantic actions * @ingroup bison_group * * Exported variables are filled by the parser and then can be used by * the generator tools. The interface functions are used by the parser * to deal with the data structures. * In the future each variable should be changed by an interface * function, hence avoiding global ones. * * @{ */ #ifndef _CORE_ACTIONS_H_ #define _CORE_ACTIONS_H_ #include <stdio.h> #include <string.h> #include "ac_decoder.h" #include "ac_tools_common.h" /** Size of the acpp symbol table. */ #define ST_IDX_SIZE 9 /** Enumeration type for the symbol classes in the symbol table. */ typedef enum _ac_parser_type {INSTR, INSTR_FMT, REG_FMT, INSTR_GRP, GEN_ID} ac_parser_type; /** Struct to hold symbol table information. */ typedef struct _symbol_table_entry { char* name; //!< The name of the entry. ac_parser_type type; //!< The symbol class of the entry. void* info; //!< Pointer to the parser structure with information on the symbol. struct _symbol_table_entry* next; //!< Pointer to the next entry (for hash clashes). } symbol_table_entry; //extern symbol_table_entry* symbol_table[1 << ST_IDX_SIZE]; // I decided to make this local to core_actions.c. --Marilia extern ac_dec_format* format_ins_list; //!< Format List for instructions. extern ac_dec_format* format_ins_list_tail; extern ac_dec_field* common_instr_field_list; //!< List containing all the fields common to all instructions. extern ac_dec_field* common_instr_field_list_tail; extern ac_dec_format* format_reg_list; //!< Format List for registers. extern ac_dec_format* format_reg_list_tail; extern ac_dec_instr* instr_list; //!< Instruction List. extern ac_dec_instr* instr_list_tail; extern ac_grp_list* group_list; //!< List of instruction groups. extern ac_grp_list* group_list_tail; extern ac_pipe_list* pipe_list; //!< Pipe list extern ac_stg_list* stage_list; //!< old 'ac_stages' list for pipe stages extern ac_sto_list* storage_list; //!< Storage list extern ac_sto_list* storage_list_tail; extern ac_sto_list* tlm_intr_port_list; //!< List of TLM Interrupt ports extern ac_sto_list* tlm_intr_port_list_tail; /** Boolean flag passed to the SystemC simulator generator */ extern int HaveFormattedRegs, HaveMultiCycleIns, HaveMemHier, HaveCycleRange; extern int ControlInstrInfoLevel; extern int HaveTLMPorts; extern int HaveTLMIntrPorts; extern int HaveTLM2Ports; extern int HaveTLM2NBPorts; extern int HaveTLM2IntrPorts; extern int instr_num; //!< Number of Instructions extern int declist_num; //!< Number of Decodification lists extern int format_num; //!< Number of Formats extern int group_num; //!< Number of Groups extern int const_count; //!< Number of Constants extern int stage_num; //!< Number of Stages extern int pipe_num; //!< Number of Pipelines extern int reg_width; //!< Bit width of registers in a regbank. extern int largest_format_size; extern ac_sto_list* fetch_device; //!< Indicates the device used for fetching instructions. /* functions used in the semantic actions */ extern void init_core_actions(); extern symbol_table_entry* find_symbol(char* name, ac_parser_type type); extern int add_symbol(char* name, ac_parser_type type, void* info); extern ac_dec_instr* find_instr(char* name); extern ac_dec_format* find_format(char* name); extern ac_sto_list *find_storage(char* name); extern ac_dec_field* find_field(ac_dec_format* pformat, char* name); extern int add_format(ac_dec_format** head, ac_dec_format** tail, char* name, char* str, char* error_msg, int is_instr); extern int add_instr(char* name, char *typestr, ac_dec_instr** pinstr, char* error_msg); extern ac_grp_list* add_group(char* name); extern int add_instr_ref(char* name, ac_instr_ref_list** instr_refs, char* error_msg); extern ac_pipe_list* add_pipe(char* name); extern ac_stg_list* add_stage(char* name, ac_stg_list** listp); extern int add_storage(char* name, unsigned size, ac_sto_types type, char* typestr, char* error_msg); extern int add_dec_list(ac_dec_instr* pinstr, char* name, int value, char* error_msg); extern ac_control_flow* get_control_flow_struct(ac_dec_instr* pinstr); extern void add_parms(char* name, int value); extern void str_upper(char* str); /*@}*/ #endif /* _CORE_ACTIONS_H_ */
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- * * Copyright (C) 2011 Colin Walters <walters@verbum.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General * Public License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. * */ #pragma once #ifndef __GI_SCANNER__ #include <gio/gio.h> G_BEGIN_DECLS #define OSTREE_TYPE_CHAIN_INPUT_STREAM (ostree_chain_input_stream_get_type ()) #define OSTREE_CHAIN_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), OSTREE_TYPE_CHAIN_INPUT_STREAM, OstreeChainInputStream)) #define OSTREE_CHAIN_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), OSTREE_TYPE_CHAIN_INPUT_STREAM, OstreeChainInputStreamClass)) #define OSTREE_IS_CHAIN_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), OSTREE_TYPE_CHAIN_INPUT_STREAM)) #define OSTREE_IS_CHAIN_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), OSTREE_TYPE_CHAIN_INPUT_STREAM)) #define OSTREE_CHAIN_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), OSTREE_TYPE_CHAIN_INPUT_STREAM, OstreeChainInputStreamClass)) typedef struct _OstreeChainInputStream OstreeChainInputStream; typedef struct _OstreeChainInputStreamClass OstreeChainInputStreamClass; typedef struct _OstreeChainInputStreamPrivate OstreeChainInputStreamPrivate; struct _OstreeChainInputStream { GInputStream parent_instance; /*< private >*/ OstreeChainInputStreamPrivate *priv; }; struct _OstreeChainInputStreamClass { GInputStreamClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_g_reserved1) (void); void (*_g_reserved2) (void); void (*_g_reserved3) (void); void (*_g_reserved4) (void); void (*_g_reserved5) (void); }; GType ostree_chain_input_stream_get_type (void) G_GNUC_CONST; OstreeChainInputStream * ostree_chain_input_stream_new (GPtrArray *streams); G_END_DECLS #endif
/* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class nitf_BlockingInfo_Destructor */ #ifndef _Included_nitf_BlockingInfo_Destructor #define _Included_nitf_BlockingInfo_Destructor #ifdef __cplusplus extern "C" { #endif /* * Class: nitf_BlockingInfo_Destructor * Method: destructMemory * Signature: (J)Z */ JNIEXPORT jboolean JNICALL Java_nitf_BlockingInfo_00024Destructor_destructMemory (JNIEnv *, jobject, jlong); #ifdef __cplusplus } #endif #endif
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef APACHE_HTRACE_HTABLE_H #define APACHE_HTRACE_HTABLE_H /** * @file htable.h * * Interfaces for a hash table that uses probing. * * This is an internal header, not intended for external use. */ #include <inttypes.h> #include <stdio.h> #include <stdint.h> #define HTABLE_MIN_SIZE 4 struct htable; /** * An HTable hash function. * * @param key The key. * @param capacity The total capacity. * * @return The hash slot. Must be less than the capacity. */ typedef uint32_t (*htable_hash_fn_t)(const void *key, uint32_t capacity); /** * An HTable equality function. Compares two keys. * * @param a First key. * @param b Second key. * * @return nonzero if the keys are equal. */ typedef int (*htable_eq_fn_t)(const void *a, const void *b); /** * Allocate a new hash table. * * @param capacity The minimum suggested starting capacity. * @param hash_fun The hash function to use in this hash table. * @param eq_fun The equals function to use in this hash table. * * @return The new hash table on success; NULL on OOM. */ struct htable *htable_alloc(uint32_t capacity, htable_hash_fn_t hash_fun, htable_eq_fn_t eq_fun); typedef void (*visitor_fn_t)(void *ctx, void *key, void *val); /** * Visit all of the entries in the hash table. * * @param htable The hash table. * @param fun The callback function to invoke on each key and value. * @param ctx Context pointer to pass to the callback. */ void htable_visit(struct htable *htable, visitor_fn_t fun, void *ctx); /** * Free the hash table. * * It is up the calling code to ensure that the keys and values inside the * table are de-allocated, if that is necessary. * * @param htable The hash table. */ void htable_free(struct htable *htable); /** * Add an entry to the hash table. * * @param htable The hash table. * @param key The key to add. This cannot be NULL. * @param fun The value to add. This cannot be NULL. * * @return 0 on success; * EINVAL if we're trying to insert a NULL key or value. * ENOMEM if there is not enough memory to add the element. * EFBIG if the hash table has too many entries to fit in 32 * bits. */ int htable_put(struct htable *htable, void *key, void *val); /** * Get an entry from the hash table. * * @param htable The hash table. * @param key The key to find. * * @return NULL if there is no such entry; the entry otherwise. */ void *htable_get(const struct htable *htable, const void *key); /** * Get an entry from the hash table and remove it. * * @param htable The hash table. * @param key The key for the entry find and remove. * @param found_key (out param) NULL if the entry was not found; the found key * otherwise. * @param found_val (out param) NULL if the entry was not found; the found * value otherwise. */ void htable_pop(struct htable *htable, const void *key, void **found_key, void **found_val); /** * Get the number of entries used in the hash table. * * @param htable The hash table. * * @return The number of entries used in the hash table. */ uint32_t htable_used(const struct htable *htable); /** * Get the capacity of the hash table. * * @param htable The hash table. * * @return The capacity of the hash table. */ uint32_t htable_capacity(const struct htable *htable); /** * Hash a string. * * @param str The string. * @param max Maximum hash value * * @return A number less than max. */ uint32_t ht_hash_string(const void *str, uint32_t max); /** * Compare two strings. * * @param a The first string. * @param b The second string. * * @return 1 if the strings are identical; 0 otherwise. */ int ht_compare_string(const void *a, const void *b); #endif // vim: ts=4:sw=4:tw=79:et
/* Copyright (c) 2016 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #import <Foundation/Foundation.h> #import "GMUGeometry.h" #import "GMUStyle.h" NS_ASSUME_NONNULL_BEGIN /** * Defines a generic geometry container. */ @protocol GMUGeometryContainer<NSObject> /** * The geometry object in the container. */ @property(nonatomic, readonly) id<GMUGeometry> geometry; /** * Style information that should be applied to the contained geometry object. */ @property(nonatomic, nullable) GMUStyle *style; @end NS_ASSUME_NONNULL_END
/*====================================================================* - Copyright (C) 2001 Leptonica. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE 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 ANY - 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. *====================================================================*/ /* * edgetest.c */ #include "allheaders.h" main(int argc, char **argv) { l_int32 i, w, h, d; l_float32 time; PIX *pixs, *pixf, *pixd; PIXA *pixa; char *filein, *fileout; static char mainName[] = "edgetest"; if (argc != 3) exit(ERROR_INT(" Syntax: edgetest filein fileout", mainName, 1)); filein = argv[1]; fileout = argv[2]; if ((pixs = pixRead(filein)) == NULL) exit(ERROR_INT("pix not made", mainName, 1)); pixGetDimensions(pixs, &w, &h, &d); if (d != 8) exit(ERROR_INT("pix not 8 bpp", mainName, 1)); /* Speed: about 12 Mpix/GHz/sec */ startTimer(); pixf = pixSobelEdgeFilter(pixs, L_HORIZONTAL_EDGES); pixd = pixThresholdToBinary(pixf, 60); pixInvert(pixd, pixd); time = stopTimer(); fprintf(stderr, "Time = %7.3f sec\n", time); fprintf(stderr, "MPix/sec: %7.3f\n", 0.000001 * w * h / time); pixDisplay(pixs, 0, 0); pixInvert(pixf, pixf); pixDisplay(pixf, 480, 0); pixDisplay(pixd, 960, 0); pixWrite(fileout, pixf, IFF_PNG); pixDestroy(&pixd); /* Threshold at different values */ pixInvert(pixf, pixf); for (i = 10; i <= 120; i += 10) { pixd = pixThresholdToBinary(pixf, i); pixInvert(pixd, pixd); pixDisplayWrite(pixd, 1); pixDestroy(&pixd); } pixDestroy(&pixf); /* Display tiled */ pixa = pixaReadFiles("/tmp", "junk_write_display"); pixd = pixaDisplayTiledAndScaled(pixa, 8, 400, 3, 0, 25, 2); pixWrite("/tmp/junktiles.jpg", pixd, IFF_JFIF_JPEG); pixDestroy(&pixd); pixaDestroy(&pixa); pixDestroy(&pixs); return 0; }
#ifndef PARAM_FUNCTIONS_H #define PARAM_FUNCTIONS_H typedef char* (*PARAM_FUNC)(const char*); typedef int (*PARAM_BOOL_INT_FUNC)(const char *, int); typedef char* (*PARAM_WO_DEFAULT_FUNC)(const char*); typedef int (*PARAM_INT_FUNC)(const char*, int, int, int, bool); //typedef bool (*PARAM_BOOL_CRUFT_FUNC)(const char *, bool); #include <stdlib.h> class param_functions { public: param_functions() : m_param_func(NULL), m_param_bool_int_func(NULL), m_param_wo_default_func(NULL), m_param_int_func(NULL) {} char * param(const char *name); int param_boolean_int(const char *name, int default_value); char * param_without_default(const char *name); int param_integer( const char *name, int default_value = 0, int min_value = INT_MIN, int max_value = INT_MAX, bool use_param_table = true ); void set_param_func(PARAM_FUNC pf) { m_param_func = pf; } void set_param_bool_int_func(PARAM_BOOL_INT_FUNC pbif) { m_param_bool_int_func = pbif; } void set_param_wo_default_func(PARAM_WO_DEFAULT_FUNC pwodf) { m_param_wo_default_func = pwodf; } void set_param_int_func(PARAM_INT_FUNC pi) { m_param_int_func = pi; } PARAM_FUNC get_param_func() { return m_param_func; } PARAM_BOOL_INT_FUNC get_param_bool_int_func() { return m_param_bool_int_func; } PARAM_WO_DEFAULT_FUNC get_param_wo_default_func() { return m_param_wo_default_func; } PARAM_INT_FUNC get_param_int_func() { return m_param_int_func; } private: PARAM_FUNC m_param_func; PARAM_BOOL_INT_FUNC m_param_bool_int_func; PARAM_WO_DEFAULT_FUNC m_param_wo_default_func; PARAM_INT_FUNC m_param_int_func; }; #endif
/*------------------------------------------------------------------------- * * dict_ispell.c * Ispell dictionary interface * * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * * * IDENTIFICATION * $PostgreSQL: pgsql/src/backend/tsearch/dict_ispell.c,v 1.8 2009/01/01 17:23:48 momjian Exp $ * *------------------------------------------------------------------------- */ #include "postgres.h" #include "commands/defrem.h" #include "tsearch/dicts/spell.h" #include "tsearch/ts_locale.h" #include "tsearch/ts_public.h" #include "tsearch/ts_utils.h" #include "utils/builtins.h" #include "utils/memutils.h" typedef struct { StopList stoplist; IspellDict obj; } DictISpell; Datum dispell_init(PG_FUNCTION_ARGS) { List *dictoptions = (List *) PG_GETARG_POINTER(0); DictISpell *d; bool affloaded = false, dictloaded = false, stoploaded = false; ListCell *l; d = (DictISpell *) palloc0(sizeof(DictISpell)); foreach(l, dictoptions) { DefElem *defel = (DefElem *) lfirst(l); if (pg_strcasecmp(defel->defname, "DictFile") == 0) { if (dictloaded) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("multiple DictFile parameters"))); NIImportDictionary(&(d->obj), get_tsearch_config_filename(defGetString(defel), "dict")); dictloaded = true; } else if (pg_strcasecmp(defel->defname, "AffFile") == 0) { if (affloaded) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("multiple AffFile parameters"))); NIImportAffixes(&(d->obj), get_tsearch_config_filename(defGetString(defel), "affix")); affloaded = true; } else if (pg_strcasecmp(defel->defname, "StopWords") == 0) { if (stoploaded) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("multiple StopWords parameters"))); readstoplist(defGetString(defel), &(d->stoplist), lowerstr); stoploaded = true; } else { ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("unrecognized Ispell parameter: \"%s\"", defel->defname))); } } if (affloaded && dictloaded) { NISortDictionary(&(d->obj)); NISortAffixes(&(d->obj)); } else if (!affloaded) { ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("missing AffFile parameter"))); } else { ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("missing DictFile parameter"))); } MemoryContextDeleteChildren(CurrentMemoryContext); PG_RETURN_POINTER(d); } Datum dispell_lexize(PG_FUNCTION_ARGS) { DictISpell *d = (DictISpell *) PG_GETARG_POINTER(0); char *in = (char *) PG_GETARG_POINTER(1); int32 len = PG_GETARG_INT32(2); char *txt; TSLexeme *res; TSLexeme *ptr, *cptr; if (len <= 0) PG_RETURN_POINTER(NULL); txt = lowerstr_with_len(in, len); res = NINormalizeWord(&(d->obj), txt); if (res == NULL) PG_RETURN_POINTER(NULL); ptr = cptr = res; while (ptr->lexeme) { if (searchstoplist(&(d->stoplist), ptr->lexeme)) { pfree(ptr->lexeme); ptr->lexeme = NULL; ptr++; } else { memcpy(cptr, ptr, sizeof(TSLexeme)); cptr++; ptr++; } } cptr->lexeme = NULL; PG_RETURN_POINTER(res); }
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2011, Image Engine Design 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 Image Engine Design nor the names of any // other contributors to this software 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 IECORE_DATACONVERTOP_H #define IECORE_DATACONVERTOP_H #include "IECore/Export.h" #include "IECore/NumericParameter.h" #include "IECore/Op.h" #include "IECore/TypedObjectParameter.h" namespace IECore { /// The DataConvertOp converts between different vector data types /// using the ScaledDataConversion class. This distinguishes it from /// the DataCastOp which simply casts the elements from one type to /// another without scaling. /// \ingroup coreGroup /// \see DataCastOp, DataPromoteOp class IECORE_API DataConvertOp : public Op { public : IE_CORE_DECLARERUNTIMETYPED( DataConvertOp, Op ); DataConvertOp(); ~DataConvertOp() override; /// The data to be interleaved. This is specified /// as an ObjectVector containing Data objects of /// identical type and length. ObjectParameter *dataParameter(); const ObjectParameter *dataParameter() const; /// The typeId for the type of Data to be returned /// as the result; IntParameter *targetTypeParameter(); const IntParameter *targetTypeParameter() const; protected : ObjectPtr doOperation( const CompoundObject *operands ) override; private : struct ConvertFnStage1; template<class FromBaseType> struct ConvertFnStage2; static InternedString g_dataName; static InternedString g_targetTypeName; }; IE_CORE_DECLAREPTR( DataConvertOp ); } // namespace IECore #endif // IECORE_DATACONVERTOP_H
#include "../../src/widgets/util/qundostack.h"
/***************************************************************************** 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 high-level C interface to LAPACK function zhetrf_rook * Author: Intel Corporation * Generated November, 2011 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_zhetrf_rook( int matrix_layout, char uplo, lapack_int n, lapack_complex_double* a, lapack_int lda, lapack_int* ipiv ) { lapack_int info = 0; lapack_int lwork = -1; lapack_complex_double* work = NULL; lapack_complex_double work_query; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_zhetrf_rook", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_zhe_nancheck( matrix_layout, uplo, n, a, lda ) ) { return -4; } #endif /* Query optimal working array(s) size */ info = LAPACKE_zhetrf_rook_work( matrix_layout, uplo, n, a, lda, ipiv, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = LAPACK_Z2INT( work_query ); /* Allocate memory for work arrays */ work = (lapack_complex_double*) LAPACKE_malloc( sizeof(lapack_complex_double) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_zhetrf_rook_work( matrix_layout, uplo, n, a, lda, ipiv, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_zhetrf_rook", info ); } return info; }
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_INVALIDATION_IMPL_INVALIDATION_SERVICE_ANDROID_H_ #define COMPONENTS_INVALIDATION_IMPL_INVALIDATION_SERVICE_ANDROID_H_ #include <jni.h> #include <stdint.h> #include <map> #include "base/android/jni_android.h" #include "base/android/scoped_java_ref.h" #include "base/compiler_specific.h" #include "base/macros.h" #include "base/threading/non_thread_safe.h" #include "components/invalidation/impl/invalidation_logger.h" #include "components/invalidation/impl/invalidator_registrar.h" #include "components/invalidation/public/invalidation_service.h" #include "components/keyed_service/core/keyed_service.h" namespace invalidation { class InvalidationLogger; // This InvalidationService is used to deliver invalidations on Android. The // Android operating system has its own mechanisms for delivering invalidations. class InvalidationServiceAndroid : public base::NonThreadSafe, public InvalidationService { public: explicit InvalidationServiceAndroid(jobject context); ~InvalidationServiceAndroid() override; // InvalidationService implementation. // // Note that this implementation does not properly support Ack-tracking, // fetching the invalidator state, or querying the client's ID. Support for // exposing the client ID should be available soon; see crbug.com/172391. void RegisterInvalidationHandler( syncer::InvalidationHandler* handler) override; bool UpdateRegisteredInvalidationIds(syncer::InvalidationHandler* handler, const syncer::ObjectIdSet& ids) override; void UnregisterInvalidationHandler( syncer::InvalidationHandler* handler) override; syncer::InvalidatorState GetInvalidatorState() const override; std::string GetInvalidatorClientId() const override; InvalidationLogger* GetInvalidationLogger() override; void RequestDetailedStatus( base::Callback<void(const base::DictionaryValue&)> caller) const override; IdentityProvider* GetIdentityProvider() override; void Invalidate(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, jint object_source, const base::android::JavaParamRef<jstring>& object_id, jlong version, const base::android::JavaParamRef<jstring>& state); // The InvalidationServiceAndroid always reports that it is enabled. // This is used only by unit tests. void TriggerStateChangeForTest(syncer::InvalidatorState state); static bool RegisterJni(JNIEnv* env); private: typedef std::map<invalidation::ObjectId, int64_t, syncer::ObjectIdLessThan> ObjectIdVersionMap; // Friend class so that InvalidationServiceFactoryAndroid has access to // private member object java_ref_. friend class InvalidationServiceFactoryAndroid; // Points to a Java instance of InvalidationService. base::android::ScopedJavaGlobalRef<jobject> java_ref_; syncer::InvalidatorRegistrar invalidator_registrar_; syncer::InvalidatorState invalidator_state_; // The invalidation API spec allows for the possibility of redundant // invalidations, so keep track of the max versions and drop // invalidations with old versions. ObjectIdVersionMap max_invalidation_versions_; // The invalidation logger object we use to record state changes // and invalidations. InvalidationLogger logger_; DISALLOW_COPY_AND_ASSIGN(InvalidationServiceAndroid); }; } // namespace invalidation #endif // COMPONENTS_INVALIDATION_IMPL_INVALIDATION_SERVICE_ANDROID_H_
//===-- HexagonISelDAGToDAG.h -----------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // Hexagon specific code to select Hexagon machine instructions for // SelectionDAG operations. //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONISELDAGTODAG_H #define LLVM_LIB_TARGET_HEXAGON_HEXAGONISELDAGTODAG_H #include "HexagonSubtarget.h" #include "HexagonTargetMachine.h" #include "llvm/ADT/StringRef.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/Support/CodeGen.h" #include <vector> namespace llvm { class MachineFunction; class HexagonInstrInfo; class HexagonRegisterInfo; class HexagonTargetLowering; class HexagonDAGToDAGISel : public SelectionDAGISel { const HexagonSubtarget *HST; const HexagonInstrInfo *HII; const HexagonRegisterInfo *HRI; public: explicit HexagonDAGToDAGISel(HexagonTargetMachine &tm, CodeGenOpt::Level OptLevel) : SelectionDAGISel(tm, OptLevel), HST(nullptr), HII(nullptr), HRI(nullptr) {} bool runOnMachineFunction(MachineFunction &MF) override { // Reset the subtarget each time through. HST = &MF.getSubtarget<HexagonSubtarget>(); HII = HST->getInstrInfo(); HRI = HST->getRegisterInfo(); SelectionDAGISel::runOnMachineFunction(MF); updateAligna(); return true; } bool ComplexPatternFuncMutatesDAG() const override { return true; } void PreprocessISelDAG() override; void EmitFunctionEntryCode() override; void Select(SDNode *N) override; // Complex Pattern Selectors. inline bool SelectAddrGA(SDValue &N, SDValue &R); inline bool SelectAddrGP(SDValue &N, SDValue &R); inline bool SelectAnyImm(SDValue &N, SDValue &R); inline bool SelectAnyInt(SDValue &N, SDValue &R); bool SelectAnyImmediate(SDValue &N, SDValue &R, uint32_t LogAlign); bool SelectGlobalAddress(SDValue &N, SDValue &R, bool UseGP, uint32_t LogAlign); bool SelectAddrFI(SDValue &N, SDValue &R); bool DetectUseSxtw(SDValue &N, SDValue &R); inline bool SelectAnyImm0(SDValue &N, SDValue &R); inline bool SelectAnyImm1(SDValue &N, SDValue &R); inline bool SelectAnyImm2(SDValue &N, SDValue &R); inline bool SelectAnyImm3(SDValue &N, SDValue &R); StringRef getPassName() const override { return "Hexagon DAG->DAG Pattern Instruction Selection"; } // Generate a machine instruction node corresponding to the circ/brev // load intrinsic. MachineSDNode *LoadInstrForLoadIntrinsic(SDNode *IntN); // Given the circ/brev load intrinsic and the already generated machine // instruction, generate the appropriate store (that is a part of the // intrinsic's functionality). SDNode *StoreInstrForLoadIntrinsic(MachineSDNode *LoadN, SDNode *IntN); void SelectFrameIndex(SDNode *N); /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for /// inline asm expressions. bool SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID, std::vector<SDValue> &OutOps) override; bool tryLoadOfLoadIntrinsic(LoadSDNode *N); bool SelectBrevLdIntrinsic(SDNode *IntN); bool SelectNewCircIntrinsic(SDNode *IntN); void SelectLoad(SDNode *N); void SelectIndexedLoad(LoadSDNode *LD, const SDLoc &dl); void SelectIndexedStore(StoreSDNode *ST, const SDLoc &dl); void SelectStore(SDNode *N); void SelectSHL(SDNode *N); void SelectZeroExtend(SDNode *N); void SelectIntrinsicWChain(SDNode *N); void SelectIntrinsicWOChain(SDNode *N); void SelectConstant(SDNode *N); void SelectConstantFP(SDNode *N); void SelectV65Gather(SDNode *N); void SelectV65GatherPred(SDNode *N); void SelectHVXDualOutput(SDNode *N); void SelectAddSubCarry(SDNode *N); void SelectVAlign(SDNode *N); void SelectVAlignAddr(SDNode *N); void SelectTypecast(SDNode *N); void SelectP2D(SDNode *N); void SelectD2P(SDNode *N); void SelectQ2V(SDNode *N); void SelectV2Q(SDNode *N); // Include the declarations autogenerated from the selection patterns. #define GET_DAGISEL_DECL #include "HexagonGenDAGISel.inc" private: // This is really only to get access to ReplaceNode (which is a protected // member). Any other members used by HvxSelector can be moved around to // make them accessible). friend struct HvxSelector; SDValue selectUndef(const SDLoc &dl, MVT ResTy) { SDNode *U = CurDAG->getMachineNode(TargetOpcode::IMPLICIT_DEF, dl, ResTy); return SDValue(U, 0); } void SelectHvxShuffle(SDNode *N); void SelectHvxRor(SDNode *N); void SelectHvxVAlign(SDNode *N); bool keepsLowBits(const SDValue &Val, unsigned NumBits, SDValue &Src); bool isAlignedMemNode(const MemSDNode *N) const; bool isSmallStackStore(const StoreSDNode *N) const; bool isPositiveHalfWord(const SDNode *N) const; bool hasOneUse(const SDNode *N) const; // DAG preprocessing functions. void ppSimplifyOrSelect0(std::vector<SDNode*> &&Nodes); void ppAddrReorderAddShl(std::vector<SDNode*> &&Nodes); void ppAddrRewriteAndSrl(std::vector<SDNode*> &&Nodes); void ppHoistZextI1(std::vector<SDNode*> &&Nodes); // Function postprocessing. void updateAligna(); SmallDenseMap<SDNode *,int> RootWeights; SmallDenseMap<SDNode *,int> RootHeights; SmallDenseMap<const Value *,int> GAUsesInFunction; int getWeight(SDNode *N); int getHeight(SDNode *N); SDValue getMultiplierForSHL(SDNode *N); SDValue factorOutPowerOf2(SDValue V, unsigned Power); unsigned getUsesInFunction(const Value *V); SDValue balanceSubTree(SDNode *N, bool Factorize = false); void rebalanceAddressTrees(); }; // end HexagonDAGToDAGISel } #endif // LLVM_LIB_TARGET_HEXAGON_HEXAGONISELDAGTODAG_H
/** * \file * * Copyright (c) 2012 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * 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 * EXPRESSLY AND SPECIFICALLY 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. * * \asf_license_stop * */ #ifndef _SAM3U_SUPC_INSTANCE_ #define _SAM3U_SUPC_INSTANCE_ /* ========== Register definition for SUPC peripheral ========== */ #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) #define REG_SUPC_CR (0x400E1210U) /**< \brief (SUPC) Supply Controller Control Register */ #define REG_SUPC_SMMR (0x400E1214U) /**< \brief (SUPC) Supply Controller Supply Monitor Mode Register */ #define REG_SUPC_MR (0x400E1218U) /**< \brief (SUPC) Supply Controller Mode Register */ #define REG_SUPC_WUMR (0x400E121CU) /**< \brief (SUPC) Supply Controller Wake Up Mode Register */ #define REG_SUPC_WUIR (0x400E1220U) /**< \brief (SUPC) Supply Controller Wake Up Inputs Register */ #define REG_SUPC_SR (0x400E1224U) /**< \brief (SUPC) Supply Controller Status Register */ #else #define REG_SUPC_CR (*(WoReg*)0x400E1210U) /**< \brief (SUPC) Supply Controller Control Register */ #define REG_SUPC_SMMR (*(RwReg*)0x400E1214U) /**< \brief (SUPC) Supply Controller Supply Monitor Mode Register */ #define REG_SUPC_MR (*(RwReg*)0x400E1218U) /**< \brief (SUPC) Supply Controller Mode Register */ #define REG_SUPC_WUMR (*(RwReg*)0x400E121CU) /**< \brief (SUPC) Supply Controller Wake Up Mode Register */ #define REG_SUPC_WUIR (*(RwReg*)0x400E1220U) /**< \brief (SUPC) Supply Controller Wake Up Inputs Register */ #define REG_SUPC_SR (*(RoReg*)0x400E1224U) /**< \brief (SUPC) Supply Controller Status Register */ #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #endif /* _SAM3U_SUPC_INSTANCE_ */
// 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 CONTENT_PUBLIC_TEST_FAKE_FRAME_WIDGET_H_ #define CONTENT_PUBLIC_TEST_FAKE_FRAME_WIDGET_H_ #include "base/i18n/rtl.h" #include "build/build_config.h" #include "mojo/public/cpp/bindings/associated_receiver.h" #include "mojo/public/cpp/bindings/pending_associated_receiver.h" #include "third_party/blink/public/mojom/drag/drag.mojom.h" #include "third_party/blink/public/mojom/frame/viewport_intersection_state.mojom.h" #include "third_party/blink/public/mojom/page/widget.mojom.h" #include "ui/base/ui_base_types.h" #if BUILDFLAG(IS_MAC) #include "ui/base/mojom/attributed_string.mojom.h" #endif namespace content { class FakeFrameWidget : public blink::mojom::FrameWidget { public: explicit FakeFrameWidget( mojo::PendingAssociatedReceiver<blink::mojom::FrameWidget> frame_widget); ~FakeFrameWidget() override; FakeFrameWidget(const FakeFrameWidget&) = delete; void operator=(const FakeFrameWidget&) = delete; base::i18n::TextDirection GetTextDirection() const; const blink::mojom::ViewportIntersectionStatePtr& GetIntersectionState() const; absl::optional<bool> GetActive() const; private: void DragTargetDragEnter( blink::mojom::DragDataPtr drag_data, const gfx::PointF& point_in_viewport, const gfx::PointF& screen_point, blink::DragOperationsMask operations_allowed, uint32_t key_modifiers, base::OnceCallback<void(ui::mojom::DragOperation)> callback) override {} void DragTargetDragOver(const gfx::PointF& point_in_viewport, const gfx::PointF& screen_point, blink::DragOperationsMask operations_allowed, uint32_t modifiers, DragTargetDragOverCallback callback) override {} void DragTargetDragLeave(const gfx::PointF& point_in_viewport, const gfx::PointF& screen_point) override {} void DragTargetDrop(blink::mojom::DragDataPtr drag_data, const gfx::PointF& point_in_viewport, const gfx::PointF& screen_point, uint32_t key_modifiers, base::OnceClosure callback) override {} void DragSourceEndedAt(const gfx::PointF& client_point, const gfx::PointF& screen_point, ui::mojom::DragOperation operation, base::OnceClosure callback) override {} void DragSourceSystemDragEnded() override {} void SetBackgroundOpaque(bool value) override {} void SetTextDirection(base::i18n::TextDirection direction) override; void SetActive(bool active) override; void SetInheritedEffectiveTouchActionForSubFrame( const cc::TouchAction touch_action) override {} void UpdateRenderThrottlingStatusForSubFrame(bool is_throttled, bool subtree_throttled, bool display_locked) override {} void SetIsInertForSubFrame(bool inert) override {} #if BUILDFLAG(IS_MAC) void GetStringAtPoint(const gfx::Point& point_in_local_root, GetStringAtPointCallback callback) override; #endif void ShowContextMenu(ui::MenuSourceType source_type, const gfx::Point& location) override {} void EnableDeviceEmulation( const blink::DeviceEmulationParams& parameters) override {} void DisableDeviceEmulation() override {} void BindWidgetCompositor( mojo::PendingReceiver<blink::mojom::WidgetCompositor> receiver) override { } void BindInputTargetClient( mojo::PendingReceiver<viz::mojom::InputTargetClient> receiver) override {} void SetViewportIntersection( blink::mojom::ViewportIntersectionStatePtr intersection_state, const absl::optional<blink::VisualProperties>& visual_properties) override; mojo::AssociatedReceiver<blink::mojom::FrameWidget> receiver_; base::i18n::TextDirection text_direction_ = base::i18n::TextDirection::UNKNOWN_DIRECTION; absl::optional<bool> active_; blink::mojom::ViewportIntersectionStatePtr intersection_state_; }; } // namespace content #endif // CONTENT_PUBLIC_TEST_FAKE_FRAME_WIDGET_H_
/* BLIS An object-based framework for developing high-performance BLAS-like libraries. Copyright (C) 2014, The University of Texas at Austin 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 University of Texas at Austin 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. */ void libblis_test_symm( test_params_t* params, test_op_t* op );
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #include <sys/zfs_context.h> #include <sys/zio.h> #ifdef _KERNEL #include <crypto/sha2/sha2.h> #else #include <sha256.h> #endif void zio_checksum_SHA256(const void *buf, uint64_t size, zio_cksum_t *zcp) { SHA256_CTX ctx; zio_cksum_t tmp; SHA256_Init(&ctx); SHA256_Update(&ctx, buf, size); SHA256_Final((unsigned char *)&tmp, &ctx); /* * A prior implementation of this function had a * private SHA256 implementation always wrote things out in * Big Endian and there wasn't a byteswap variant of it. * To preseve on disk compatibility we need to force that * behaviour. */ zcp->zc_word[0] = BE_64(tmp.zc_word[0]); zcp->zc_word[1] = BE_64(tmp.zc_word[1]); zcp->zc_word[2] = BE_64(tmp.zc_word[2]); zcp->zc_word[3] = BE_64(tmp.zc_word[3]); }
/* Need to concatenate this file with something that defines: LPTSTR path_dirs[]; LPTSTR progDll; LPTSTR rtsDll; int rtsOpts; */ #include <stdarg.h> #include <stdio.h> #include <windows.h> #include <shlwapi.h> #include "Rts.h" void die(char *fmt, ...) { va_list argp; fprintf(stderr, "error: "); va_start(argp, fmt); vfprintf(stderr, fmt, argp); va_end(argp); fprintf(stderr, "\n"); exit(1); } LPTSTR getModuleFileName(void) { HMODULE hExe; LPTSTR exePath; DWORD exePathSize; DWORD res; hExe = GetModuleHandle(NULL); if (hExe == NULL) { die("GetModuleHandle failed"); } // 300 chars ought to be enough, but there are various cases where // it might not be (e.g. unicode paths, or \\server\foo\... paths. // So we start off with 300 and grow if necessary. exePathSize = 300; exePath = malloc(exePathSize); if (exePath == NULL) { die("Mallocing %d for GetModuleFileName failed", exePathSize); } while ((res = GetModuleFileName(hExe, exePath, exePathSize)) && (GetLastError() == ERROR_INSUFFICIENT_BUFFER)) { exePathSize *= 2; exePath = realloc(exePath, exePathSize); if (exePath == NULL) { die("Reallocing %d for GetModuleFileName failed", exePathSize); } } if (!res) { die("GetModuleFileName failed"); } return exePath; } void setPath(void) { LPTSTR *dir; LPTSTR path; int n; int len = 0; LPTSTR exePath, s; exePath = getModuleFileName(); for(s = exePath; *s != '\0'; s++) { if (*s == '\\') { *s = '/'; } } s = StrRChr(exePath, NULL, '/'); if (s == NULL) { die("No directory separator in executable path: %s", exePath); } s[0] = '\0'; n = s - exePath; for (dir = path_dirs; *dir != NULL; dir++) { len += n + lstrlen(*dir) + 1/* semicolon */; } len++; // NUL path = malloc(len); if (path == NULL) { die("Mallocing %d for PATH failed", len); } s = path; for (dir = path_dirs; *dir != NULL; dir++) { StrCpy(s, exePath); s += n; StrCpy(s, *dir); s += lstrlen(*dir); s[0] = ';'; s++; } s[0] = '\0'; free(exePath); if (! SetEnvironmentVariable(TEXT("PATH"), path)) { printf("SetEnvironmentVariable failed (%d)\n", GetLastError()); } free(path); } HINSTANCE loadDll(LPTSTR dll) { HINSTANCE h; DWORD dw; LPVOID lpMsgBuf; h = LoadLibrary(dll); if (h == NULL) { dw = GetLastError(); FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); die("loadDll %s failed: %d: %s\n", dll, dw, lpMsgBuf); } return h; } void *GetNonNullProcAddress(HINSTANCE h, char *sym) { void *p; p = GetProcAddress(h, sym); if (p == NULL) { die("Failed to find address for %s", sym); } return p; } HINSTANCE GetNonNullModuleHandle(LPTSTR dll) { HINSTANCE h; h = GetModuleHandle(dll); if (h == NULL) { die("Failed to get module handle for %s", dll); } return h; } typedef int (*hs_main_t)(int , char **, StgClosure *, RtsConfig); int main(int argc, char *argv[]) { HINSTANCE hRtsDll, hProgDll; LPTSTR oldPath; StgClosure *main_p; RtsConfig rts_config; hs_main_t hs_main_p; // MSDN says: An environment variable has a maximum size limit of // 32,767 characters, including the null-terminating character. oldPath = malloc(32767); if (oldPath == NULL) { die("Mallocing 32767 for oldPath failed"); } if (!GetEnvironmentVariable(TEXT("PATH"), oldPath, 32767)) { if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) { oldPath[0] = '\0'; } else { die("Looking up PATH env var failed"); } } setPath(); hProgDll = loadDll(progDll); if (! SetEnvironmentVariable(TEXT("PATH"), oldPath)) { printf("SetEnvironmentVariable failed (%d)\n", GetLastError()); } free(oldPath); hRtsDll = GetNonNullModuleHandle(rtsDll); hs_main_p = GetNonNullProcAddress(hRtsDll, "hs_main"); main_p = GetNonNullProcAddress(hProgDll, "ZCMain_main_closure"); rts_config.rts_opts_enabled = rtsOpts; rts_config.rts_opts = NULL; return hs_main_p(argc, argv, main_p, rts_config); }
// 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 CONTENT_BROWSER_WEBUI_WEB_UI_MAIN_FRAME_OBSERVER_H_ #define CONTENT_BROWSER_WEBUI_WEB_UI_MAIN_FRAME_OBSERVER_H_ #include <stdint.h> #include <string> #include "base/memory/raw_ptr.h" #include "build/build_config.h" #include "content/common/content_export.h" #include "content/public/browser/web_contents_observer.h" namespace blink { namespace mojom { enum class ConsoleMessageLevel; } } // namespace blink namespace content { class NavigationHandle; class RenderFrameHost; class WebContents; class WebUIImpl; // The WebContentObserver for WebUIImpl. Each WebUIImpl has exactly one // WebUIMainFrameObserver to watch for notifications from the associated // WebContents object. class CONTENT_EXPORT WebUIMainFrameObserver : public WebContentsObserver { public: WebUIMainFrameObserver(WebUIImpl* web_ui, WebContents* contents); ~WebUIMainFrameObserver() override; WebUIMainFrameObserver(const WebUIMainFrameObserver& rhs) = delete; WebUIMainFrameObserver& operator=(const WebUIMainFrameObserver& rhs) = delete; protected: friend class WebUIMainFrameObserverTest; // Override from WebContentsObserver void DidFinishNavigation(NavigationHandle* navigation_handle) override; void PrimaryPageChanged(Page& page) override; // TODO(crbug.com/1129544) This is currently disabled due to Windows DLL // thunking issues. Fix & re-enable. #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) // On official Google builds, capture and report JavaScript error messages on // WebUI surfaces back to Google. This allows us to fix JavaScript errors and // exceptions. void OnDidAddMessageToConsole( RenderFrameHost* source_frame, blink::mojom::ConsoleMessageLevel log_level, const std::u16string& message, int32_t line_no, const std::u16string& source_id, const absl::optional<std::u16string>& untrusted_stack_trace) override; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override; private: #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) void MaybeEnableWebUIJavaScriptErrorReporting( NavigationHandle* navigation_handle); // Do we report JavaScript errors ? bool error_reporting_enabled_ = false; #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) raw_ptr<WebUIImpl> web_ui_; }; } // namespace content #endif // CONTENT_BROWSER_WEBUI_WEB_UI_MAIN_FRAME_OBSERVER_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_COCOA_APPLESCRIPT_WINDOW_APPLESCRIPT_H_ #define CHROME_BROWSER_UI_COCOA_APPLESCRIPT_WINDOW_APPLESCRIPT_H_ #import <Cocoa/Cocoa.h> #import "chrome/browser/ui/cocoa/applescript/element_applescript.h" class Browser; class Profile; @class TabAppleScript; // Represents a window class. @interface WindowAppleScript : ElementAppleScript { @private Browser* _browser; // weak. } // Creates a new window, returns nil if there is an error. - (instancetype)init; // Creates a new window with a particular profile. - (instancetype)initWithProfile:(Profile*)aProfile; // Does not create a new window but uses an existing one. - (instancetype)initWithBrowser:(Browser*)aBrowser; // Sets and gets the index of the currently selected tab. - (NSNumber*)activeTabIndex; - (void)setActiveTabIndex:(NSNumber*)anActiveTabIndex; // Sets and get the given name of a window. - (NSString*)givenName; - (void)setGivenName:(NSString*)name; // Mode refers to whether a window is a normal window or an incognito window // it can be set only once while creating the window. - (NSString*)mode; - (void)setMode:(NSString*)theMode; // Returns the currently selected tab. - (TabAppleScript*)activeTab; // Tab manipulation functions. // The tabs inside the window. // Returns |TabAppleScript*| of all the tabs contained // within this particular folder. - (NSArray*)tabs; // Insert a tab at the end. - (void)insertInTabs:(TabAppleScript*)aTab; // Insert a tab at some position in the list. // Called by applescript which takes care of bounds checking, make sure of it // before calling directly. - (void)insertInTabs:(TabAppleScript*)aTab atIndex:(int)index; // Remove a window from the list. // Called by applescript which takes care of bounds checking, make sure of it // before calling directly. - (void)removeFromTabsAtIndex:(int)index; // The index of the window, windows are ordered front to back. - (NSNumber*)orderedIndex; - (void)setOrderedIndex:(NSNumber*)anIndex; // Used to sort windows by index. - (NSComparisonResult)windowComparator:(WindowAppleScript*)otherWindow; // For standard window functions like zoomable, bounds etc, we dont handle it // but instead pass it onto the NSWindow associated with the window. - (id)valueForUndefinedKey:(NSString*)key; - (void)setValue:(id)value forUndefinedKey:(NSString*)key; // Used to close window. - (void)handlesCloseScriptCommand:(NSCloseCommand*)command; @end #endif // CHROME_BROWSER_UI_COCOA_APPLESCRIPT_WINDOW_APPLESCRIPT_H_
//===-- SparcFrameLowering.h - Define frame lowering for Sparc --*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // // //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_TARGET_SPARC_SPARCFRAMELOWERING_H #define LLVM_LIB_TARGET_SPARC_SPARCFRAMELOWERING_H #include "Sparc.h" #include "llvm/CodeGen/TargetFrameLowering.h" namespace llvm { class SparcSubtarget; class SparcFrameLowering : public TargetFrameLowering { public: explicit SparcFrameLowering(const SparcSubtarget &ST); /// emitProlog/emitEpilog - These methods insert prolog and epilog code into /// the function. void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override; void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override; MachineBasicBlock::iterator eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const override; bool hasReservedCallFrame(const MachineFunction &MF) const override; bool hasFP(const MachineFunction &MF) const override; void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS = nullptr) const override; int getFrameIndexReference(const MachineFunction &MF, int FI, Register &FrameReg) const override; /// targetHandlesStackFrameRounding - Returns true if the target is /// responsible for rounding up the stack frame (probably at emitPrologue /// time). bool targetHandlesStackFrameRounding() const override { return true; } private: // Remap input registers to output registers for leaf procedure. void remapRegsForLeafProc(MachineFunction &MF) const; // Returns true if MF is a leaf procedure. bool isLeafProc(MachineFunction &MF) const; // Emits code for adjusting SP in function prologue/epilogue. void emitSPAdjustment(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, int NumBytes, unsigned ADDrr, unsigned ADDri) const; }; } // End llvm namespace #endif
/* Copyright (C) 2009-2011, Stefan Hacker 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 Mumble Developers 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 FOUNDATION 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 BONJOURCLIENT_H_ #define BONJOURCLIENT_H_ #include <QtCore/QObject> class BonjourServiceBrowser; class BonjourServiceResolver; class BonjourClient : public QObject { private: Q_OBJECT Q_DISABLE_COPY(BonjourClient) public: BonjourClient(); ~BonjourClient(); BonjourServiceBrowser *bsbBrowser; BonjourServiceResolver *bsrResolver; }; #endif
/*************************************************************************/ /* vset.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef VSET_H #define VSET_H #include "typedefs.h" #include "vector.h" template<class T> class VSet { Vector<T> _data; _FORCE_INLINE_ int _find(const T& p_val,bool &r_exact) const { r_exact=false; if (_data.empty()) return 0; int low = 0; int high = _data.size() -1; int middle; const T *a=&_data[0]; while( low <= high ) { middle = ( low + high ) / 2; if( p_val < a[ middle] ) { high = middle - 1; //search low end of array } else if ( a[middle] < p_val) { low = middle + 1; //search high end of array } else { r_exact=true; return middle; } } //return the position where this would be inserted if (a[middle]<p_val) middle++; return middle; } _FORCE_INLINE_ int _find_exact(const T& p_val) const { if (_data.empty()) return -1; int low = 0; int high = _data.size() -1; int middle; const T *a=&_data[0]; while( low <= high ) { middle = ( low + high ) / 2; if( p_val < a[ middle] ) { high = middle - 1; //search low end of array } else if ( a[middle] < p_val) { low = middle + 1; //search high end of array } else { return middle; } } return -1; } public: void insert(const T& p_val) { bool exact; int pos = _find(p_val,exact); if (exact) return; _data.insert(pos,p_val); } bool has(const T& p_val) const { return _find_exact(p_val)!=-1; } void erase(const T& p_val) { int pos = _find_exact(p_val); if (pos<0) return; _data.remove(pos); } int find(const T& p_val) const { return _find_exact(p_val); } _FORCE_INLINE_ bool empty() const { return _data.empty(); } _FORCE_INLINE_ int size() const { return _data.size(); } inline T& operator[](int p_index) { return _data[p_index]; } inline const T& operator[](int p_index) const { return _data[p_index]; } }; #endif // VSET_H
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.com 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. Experimental Buoyancy fluid demo written by John McCutchan */ #ifndef HFFLUID_DEMO_H #define HFFLUID_DEMO_H #include "GlutDemoApplication.h" #include "LinearMath/btAlignedObjectArray.h" #include "BulletHfFluid/btHfFluid.h" class btBroadphaseInterface; class btCollisionShape; class btOverlappingPairCache; class btCollisionDispatcher; class btConstraintSolver; struct btCollisionAlgorithmCreateFunc; class btDefaultCollisionConfiguration; class btHfFluidRigidDynamicsWorld; ///collisions between a btSoftBody and a btRigidBody class btFluidRididCollisionAlgorithm; ///experimental buyancy fluid demo ///CcdPhysicsDemo shows basic stacking using Bullet physics, and allows toggle of Ccd (using key '1') class HfFluidDemo : public GlutDemoApplication { public: btAlignedObjectArray<btFluidRididCollisionAlgorithm*> m_FluidRigidCollisionAlgorithms; bool m_autocam; bool m_cutting; bool m_raycast; btScalar m_animtime; btClock m_clock; int m_lastmousepos[2]; btVector3 m_impact; btVector3 m_goal; bool m_drag; //keep the collision shapes, for deletion/cleanup btAlignedObjectArray<btCollisionShape*> m_collisionShapes; btBroadphaseInterface* m_broadphase; btCollisionDispatcher* m_dispatcher; btConstraintSolver* m_solver; btCollisionAlgorithmCreateFunc* m_boxBoxCF; btDefaultCollisionConfiguration* m_collisionConfiguration; public: void initPhysics(); void exitPhysics(); HfFluidDemo (); virtual ~HfFluidDemo() { exitPhysics(); } virtual void setDrawClusters(bool drawClusters) { } virtual void setShootBoxShape (); virtual void clientMoveAndDisplay(); virtual void displayCallback(); void createStack( btCollisionShape* boxShape, float halfCubeSize, int size, float zPos ); static DemoApplication* Create() { HfFluidDemo* demo = new HfFluidDemo; demo->myinit(); demo->initPhysics(); return demo; } virtual const btHfFluidRigidDynamicsWorld* getHfFluidDynamicsWorld() const { ///just make it a btSoftRigidDynamicsWorld please ///or we will add type checking return (btHfFluidRigidDynamicsWorld*) m_dynamicsWorld; } virtual btHfFluidRigidDynamicsWorld* getHfFluidDynamicsWorld() { ///just make it a btSoftRigidDynamicsWorld please ///or we will add type checking return (btHfFluidRigidDynamicsWorld*) m_dynamicsWorld; } // void clientResetScene(); void renderme(); void keyboardCallback(unsigned char key, int x, int y); void mouseFunc(int button, int state, int x, int y); void mouseMotionFunc(int x,int y); }; #define MACRO_SOFT_DEMO(a) class HfFluidDemo##a : public HfFluidDemo\ {\ public:\ static DemoApplication* Create()\ {\ HfFluidDemo* demo = new HfFluidDemo##a;\ extern unsigned int current_demo;\ current_demo=a;\ demo->myinit();\ demo->initPhysics();\ return demo;\ }\ }; MACRO_SOFT_DEMO(0) //Init_Drops MACRO_SOFT_DEMO(1) //Init_Wave MACRO_SOFT_DEMO(2) //Init_RandomDrops MACRO_SOFT_DEMO(3) #endif //CCD_PHYSICS_DEMO_H
/* Generated automatically. DO NOT EDIT! */ #define SIMD_HEADER "simd-support/simd-altivec.h" #include "../common/n2fv_6.c"
#ifndef STACK_H #define STACK_H 1 #include "TREE.h" typedef tnode stackItem; void STACKinit(void); int STACKcount(void); void STACKpush(stackItem); stackItem STACKpop(void); #endif
#include<stdio.h> int main(){ int counter = 0; for(counter = 0; counter <= 255; counter++) { printf("%d --> %c\n", counter, counter); } return 0; }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #pragma once #include "pal_types.h" #include <curl/curl.h> enum PAL_CURLMcode : int32_t { PAL_CURLM_CALL_MULTI_PERFORM = -1, PAL_CURLM_OK = 0, PAL_CURLM_BAD_HANDLE = 1, PAL_CURLM_BAD_EASY_HANDLE = 2, PAL_CURLM_OUT_OF_MEMORY = 3, PAL_CURLM_INTERNAL_ERROR = 4, PAL_CURLM_BAD_SOCKET = 5, PAL_CURLM_UNKNOWN_OPTION = 6, PAL_CURLM_ADDED_ALREADY = 7, // Added in libcurl 7.32.1 }; enum PAL_CURLMoption : int32_t { PAL_CURLMOPT_PIPELINING = 3, }; enum PAL_CurlPipe : int32_t { PAL_CURLPIPE_MULTIPLEX = 2, }; enum PAL_CURLMSG : int32_t { PAL_CURLMSG_DONE = 1, }; /* Creates a new CURLM instance. Returns the new CURLM instance or nullptr if something went wrong. */ extern "C" CURLM* HttpNative_MultiCreate(); /* Cleans up and removes a whole multi stack. Returns CURLM_OK on success, otherwise an error code. */ extern "C" int32_t HttpNative_MultiDestroy(CURLM* multiHandle); /* Shims the curl_multi_add_handle function. Returns CURLM_OK on success, otherwise an error code. */ extern "C" int32_t HttpNative_MultiAddHandle(CURLM* multiHandle, CURL* easyHandle); /* Shims the curl_multi_remove_handle function. Returns CURLM_OK on success, otherwise an error code. */ extern "C" int32_t HttpNative_MultiRemoveHandle(CURLM* multiHandle, CURL* easyHandle); /* Shims the curl_multi_wait function. Returns CURLM_OK on success, otherwise an error code. isExtraFileDescriptorActive is set to a value indicating whether extraFileDescriptor has new data received. isTimeout is set to a value indicating whether a timeout was encountered before any file descriptors had events occur. */ extern "C" int32_t HttpNative_MultiWait(CURLM* multiHandle, intptr_t extraFileDescriptor, int32_t* isExtraFileDescriptorActive, int32_t* isTimeout); /* Reads/writes available data from each easy handle. Shims the curl_multi_perform function. Returns CURLM_OK on success, otherwise an error code. */ extern "C" int32_t HttpNative_MultiPerform(CURLM* multiHandle); /* Ask the multi handle if there are any messages/informationals from the individual transfers. Shims the curl_multi_info_read function. Returns 1 if a CURLMsg was retrieved and the out variables are set, otherwise 0 when there are no more messages to retrieve. */ extern "C" int32_t HttpNative_MultiInfoRead(CURLM* multiHandle, int32_t* message, CURL** easyHandle, int32_t* result); /* Returns a string describing the CURLMcode error code. */ extern "C" const char* HttpNative_MultiGetErrorString(PAL_CURLMcode code); /* Shims the curl_multi_setopt function */ extern "C" int32_t HttpNative_MultiSetOptionLong(CURLM* handle, PAL_CURLMoption option, int64_t value);
/* * Copyright (C) the libgit2 contributors. All rights reserved. * * This file is part of libgit2, distributed under the GNU GPL v2 with * a Linking Exception. For full terms see the included COPYING file. */ #include "common.h" #include "git2/credential_helpers.h" int git_credential_userpass( git_credential **cred, const char *url, const char *user_from_url, unsigned int allowed_types, void *payload) { git_credential_userpass_payload *userpass = (git_credential_userpass_payload*)payload; const char *effective_username = NULL; GIT_UNUSED(url); if (!userpass || !userpass->password) return -1; /* Username resolution: a username can be passed with the URL, the * credentials payload, or both. Here's what we do. Note that if we get * this far, we know that any password the url may contain has already * failed at least once, so we ignore it. * * | Payload | URL | Used | * +-------------+----------+-----------+ * | yes | no | payload | * | yes | yes | payload | * | no | yes | url | * | no | no | FAIL | */ if (userpass->username) effective_username = userpass->username; else if (user_from_url) effective_username = user_from_url; else return -1; if (GIT_CREDENTIAL_USERNAME & allowed_types) return git_credential_username_new(cred, effective_username); if ((GIT_CREDENTIAL_USERPASS_PLAINTEXT & allowed_types) == 0 || git_credential_userpass_plaintext_new(cred, effective_username, userpass->password) < 0) return -1; return 0; } /* Deprecated credential functions */ #ifndef GIT_DEPRECATE_HARD int git_cred_userpass( git_credential **out, const char *url, const char *user_from_url, unsigned int allowed_types, void *payload) { return git_credential_userpass(out, url, user_from_url, allowed_types, payload); } #endif
/* Copyright (C) 2015-2020 Sergey V. Mikayev * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef SRCTOOLS_LINEAR_RESAMPLER_H #define SRCTOOLS_LINEAR_RESAMPLER_H #include "ResamplerStage.h" namespace SRCTools { static const unsigned int LINEAR_RESAMPER_CHANNEL_COUNT = 2; class LinearResampler : public ResamplerStage { public: LinearResampler(double sourceSampleRate, double targetSampleRate); ~LinearResampler() {} unsigned int estimateInLength(const unsigned int outLength) const; void process(const FloatSample *&inSamples, unsigned int &inLength, FloatSample *&outSamples, unsigned int &outLength); private: const double inputToOutputRatio; double position; FloatSample lastInputSamples[LINEAR_RESAMPER_CHANNEL_COUNT]; }; } // namespace SRCTools #endif // SRCTOOLS_LINEAR_RESAMPLER_H
/* * 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. * * Code to handle x86 style IRQs plus some generic interrupt stuff. * * Copyright (C) 1992 Linus Torvalds * Copyright (C) 1994 - 2000 Ralf Baechle */ #include <linux/config.h> #include <linux/kernel.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/kernel_stat.h> #include <linux/module.h> #include <linux/proc_fs.h> #include <linux/slab.h> #include <linux/mm.h> #include <linux/random.h> #include <linux/sched.h> #include <linux/seq_file.h> #include <linux/kallsyms.h> #include <asm/atomic.h> #include <asm/system.h> #include <asm/uaccess.h> /* * 'what should we do if we get a hw irq event on an illegal vector'. * each architecture has to answer this themselves. */ void ack_bad_irq(unsigned int irq) { printk("unexpected IRQ # %d\n", irq); } atomic_t irq_err_count; #undef do_IRQ /* * do_IRQ handles all normal device IRQ's (the special * SMP cross-CPU interrupts have their own specific * handlers). */ asmlinkage unsigned int do_IRQ(unsigned int irq, struct pt_regs *regs) { irq_enter(); __do_IRQ(irq, regs); irq_exit(); return 1; } /* * Generic, controller-independent functions: */ int show_interrupts(struct seq_file *p, void *v) { int i = *(loff_t *) v, j; struct irqaction * action; unsigned long flags; if (i == 0) { seq_printf(p, " "); for (j=0; j<NR_CPUS; j++) if (cpu_online(j)) seq_printf(p, "CPU%d ",j); seq_putc(p, '\n'); } if (i < NR_IRQS) { spin_lock_irqsave(&irq_desc[i].lock, flags); action = irq_desc[i].action; if (!action) goto skip; seq_printf(p, "%3d: ",i); #ifndef CONFIG_SMP seq_printf(p, "%10u ", kstat_irqs(i)); #else for (j = 0; j < NR_CPUS; j++) if (cpu_online(j)) seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); #endif seq_printf(p, " %14s", irq_desc[i].handler->typename); seq_printf(p, " %s", action->name); for (action=action->next; action; action = action->next) seq_printf(p, ", %s", action->name); seq_putc(p, '\n'); skip: spin_unlock_irqrestore(&irq_desc[i].lock, flags); } else if (i == NR_IRQS) { seq_putc(p, '\n'); seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); } return 0; } #ifdef CONFIG_KGDB extern void breakpoint(void); extern void set_debug_traps(void); static int kgdb_flag = 1; static int __init nokgdb(char *str) { kgdb_flag = 0; return 1; } __setup("nokgdb", nokgdb); #endif void __init init_IRQ(void) { int i; for (i = 0; i < NR_IRQS; i++) { irq_desc[i].status = IRQ_DISABLED; irq_desc[i].action = NULL; irq_desc[i].depth = 1; irq_desc[i].handler = &no_irq_type; spin_lock_init(&irq_desc[i].lock); } arch_init_irq(); #ifdef CONFIG_KGDB if (kgdb_flag) { printk("Wait for gdb client connection ...\n"); set_debug_traps(); breakpoint(); } #endif }
/**************************************************************************** This file is part of the GLC-lib library. Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net) http://glc-lib.sourceforge.net GLC-lib 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 3 of the License, or (at your option) any later version. GLC-lib 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 GLC-lib; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *****************************************************************************/ //! \file glc_trackballmover.h Interface for the GLC_TrackBallMover class. #ifndef GLC_TRACKBALLMOVER_H_ #define GLC_TRACKBALLMOVER_H_ #include "glc_mover.h" #include "../glc_config.h" ////////////////////////////////////////////////////////////////////// //! \class GLC_TrackBallMover /*! \brief GLC_TrackBallMover : Track ball interactive manipulation */ ////////////////////////////////////////////////////////////////////// class GLC_LIB_EXPORT GLC_TrackBallMover : public GLC_Mover { ////////////////////////////////////////////////////////////////////// /*! @name Constructor / Destructor */ //@{ ////////////////////////////////////////////////////////////////////// public: //! Default constructor GLC_TrackBallMover(GLC_Viewport*, const QList<GLC_RepMover*>& repsList= QList<GLC_RepMover*>()); //! Copy constructor GLC_TrackBallMover(const GLC_TrackBallMover&); //! Destructor virtual ~GLC_TrackBallMover(); //@} ////////////////////////////////////////////////////////////////////// /*! \name Get Functions*/ //@{ ////////////////////////////////////////////////////////////////////// public: //! Return a clone of the mover virtual GLC_Mover* clone() const; //@} ////////////////////////////////////////////////////////////////////// /*! \name Set Functions*/ //@{ ////////////////////////////////////////////////////////////////////// public: //! Initialized the mover virtual void init(const GLC_UserInput& userInput); //! Move the camera virtual bool move(const GLC_UserInput& userInput); //! Set this mover screen ratio void setRatio(double ratio); //@} ///////////////////////////////////////////////////////////////////// // Private services Functions ////////////////////////////////////////////////////////////////////// private: //! Convert mouse View coordinate to tracking coordinate (Centred and betwen (-1,-1) and (1,1)) GLC_Vector3d mapForTracking( double , double) const; ////////////////////////////////////////////////////////////////////// // Private Members ////////////////////////////////////////////////////////////////////// private: //! The ratio of the trackball size double m_Ratio; }; #endif /* GLC_TRACKBALLMOVER_H_ */
/* * (C) Copyright 2010,2011 * NVIDIA Corporation <www.nvidia.com> * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ #include <common.h> #include <ns16550.h> #include <linux/compiler.h> #include <asm/io.h> #include <asm/arch/tegra2.h> #include <asm/arch/sys_proto.h> #include <asm/arch/board.h> #include <asm/arch/clk_rst.h> #include <asm/arch/clock.h> #include <asm/arch/emc.h> #include <asm/arch/pinmux.h> #include <asm/arch/pmc.h> #include <asm/arch/pmu.h> #include <asm/arch/uart.h> #include <asm/arch/warmboot.h> #include <spi.h> #include <asm/arch/usb.h> #include <i2c.h> #include "board.h" #include "emc.h" DECLARE_GLOBAL_DATA_PTR; const struct tegra2_sysinfo sysinfo = { CONFIG_TEGRA2_BOARD_STRING }; /* * Routine: timer_init * Description: init the timestamp and lastinc value */ int timer_init(void) { return 0; } void __pin_mux_usb(void) { } void pin_mux_usb(void) __attribute__((weak, alias("__pin_mux_usb"))); void __pin_mux_spi(void) { } void pin_mux_spi(void) __attribute__((weak, alias("__pin_mux_spi"))); /* * Routine: power_det_init * Description: turn off power detects */ static void power_det_init(void) { #if defined(CONFIG_TEGRA2) struct pmc_ctlr *const pmc = (struct pmc_ctlr *)TEGRA2_PMC_BASE; /* turn off power detects */ writel(0, &pmc->pmc_pwr_det_latch); writel(0, &pmc->pmc_pwr_det); #endif } /* * Routine: board_init * Description: Early hardware init. */ int board_init(void) { __maybe_unused int err; /* Do clocks and UART first so that printf() works */ clock_init(); clock_verify(); #ifdef CONFIG_SPI_UART_SWITCH gpio_config_uart(); #endif #ifdef CONFIG_TEGRA_SPI pin_mux_spi(); spi_init(); #endif /* boot param addr */ gd->bd->bi_boot_params = (NV_PA_SDRAM_BASE + 0x100); power_det_init(); #ifdef CONFIG_TEGRA_I2C #ifndef CONFIG_SYS_I2C_INIT_BOARD #error "You must define CONFIG_SYS_I2C_INIT_BOARD to use i2c on Nvidia boards" #endif i2c_init_board(); # ifdef CONFIG_TEGRA_PMU if (pmu_set_nominal()) debug("Failed to select nominal voltages\n"); # ifdef CONFIG_TEGRA_CLOCK_SCALING err = board_emc_init(); if (err) debug("Memory controller init failed: %d\n", err); # endif # endif /* CONFIG_TEGRA_PMU */ #endif /* CONFIG_TEGRA_I2C */ #ifdef CONFIG_USB_EHCI_TEGRA pin_mux_usb(); board_usb_init(gd->fdt_blob); #endif #ifdef CONFIG_TEGRA2_LP0 /* prepare the WB code to LP0 location */ warmboot_prepare_code(TEGRA_LP0_ADDR, TEGRA_LP0_SIZE); #endif return 0; } #ifdef CONFIG_BOARD_EARLY_INIT_F static void __gpio_early_init(void) { } void gpio_early_init(void) __attribute__((weak, alias("__gpio_early_init"))); int board_early_init_f(void) { board_init_uart_f(); /* Initialize periph GPIOs */ gpio_early_init(); #ifdef CONFIG_SPI_UART_SWITCH gpio_early_init_uart(); #else gpio_config_uart(); #endif return 0; } #endif /* EARLY_INIT */
/* Copyright (c) 2018 Percona LLC 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 SYSTEM_KEYS_CONTAINER_INCLUDED #define SYSTEM_KEYS_CONTAINER_INCLUDED #include <my_global.h> #include <boost/move/unique_ptr.hpp> #include <map> #include "i_system_keys_container.h" #include "system_key_adapter.h" #include "logger.h" namespace keyring { /** System_keys_container stores system keys together with links to their latest versions. Latest version of a key itself is stored somewhere else (presumably in keys_container). For instance system_keys_container maps percona_binlog to its latest version percona_binlog:12, the key percona_binlog:12 itself is stored in keys_container. System_key_container only maps system key percona_binlog to its latest version, i.e. percona_binlog:12, it does not know about other versions of the key. The keys returned by System_keys_container are encapsulated in System_key_adapter which allows to retrieve information like key's version. */ class System_keys_container : public ISystem_keys_container { public: System_keys_container(ILogger *logger) : logger(logger) {} ~System_keys_container(); /** Returns key with latest version when called with plain system key (ex. percona_binlog) For instance - when key's (argument key) id is system_key and latest version of system_key is x it will return key with id system_key:x @return latest key version on success and NULL on failure */ virtual IKey* get_latest_key_if_system_key_without_version(IKey *key); /** Only system keys with already assigned version can be stored inside system_keys_container for instance : percona_binlog:0 */ virtual void store_or_update_if_system_key_with_version(IKey *key); /** Pass key with system_key id (for instance percona_binlog) to get next version of the system_key, for instance : System_keys_container already has percona_binlog key with version 12 : percona_binlog:12 Calling this function will assing percona_binlog:13 as key_id to key passed as argument */ virtual bool rotate_key_id_if_system_key_without_version(IKey *key); /** Returns true if key id of key argument is either system_key or system_key:x For instance percona_binlog or percona_binlog:12 */ virtual bool is_system_key(IKey *key); private: static bool parse_system_key_id_with_version(std::string &key_id, std::string &system_key_id, uint &key_version); void update_system_key(IKey* key, const std::string &system_key_id, uint key_version); bool is_system_key_with_version(IKey *key, std::string &system_key_id, uint &key_version); bool is_system_key_without_version(IKey *key); typedef std::map<std::string, System_key_adapter*> System_key_id_to_system_key; System_key_id_to_system_key system_key_id_to_system_key; static const std::string system_key_prefix; ILogger *logger; }; } //namespace keyring #endif //SYSTEM_KEYS_CONTAINER_INCLUDED
/***************************************************************************** * * PROJECT: Multi Theft Auto v1.0 * LICENSE: See LICENSE in the top level directory * FILE: sdk/core/CCommandsInterface.h * PURPOSE: Dynamic command manager interface * * Multi Theft Auto is available from http://www.multitheftauto.com/ * *****************************************************************************/ #ifndef __CCOMMANDSINTERFACE_H #define __CCOMMANDSINTERFACE_H #include <list> typedef void (*PFNCOMMANDHANDLER) ( const char* ); typedef bool (*pfnExecuteCommandHandler) ( const char*, const char*, bool, bool ); typedef void (*PFNCOMMAND) ( const char * ); #define MAX_COMMAND_NAME_LENGTH 128 #define MAX_COMMAND_DESCRIPTION_LENGTH 128 typedef struct tagCOMMANDENTRY { char szCommandName[MAX_COMMAND_NAME_LENGTH]; char szDescription[MAX_COMMAND_DESCRIPTION_LENGTH]; PFNCOMMAND pfnCmdFunc; bool bModCommand; bool bEnabled; } COMMANDENTRY; class CCommandsInterface { public: virtual void Add ( const char* szCommand, const char* szDescription, PFNCOMMANDHANDLER pfnHandler, bool bModCommand = false ) = 0; virtual unsigned int Count ( void ) = 0; virtual bool Exists ( const char* szCommand ) = 0; virtual bool Execute ( const char* szCommandLine ) = 0; virtual bool Execute ( const char* szCommand, const char* szParameters, bool bHandleRemotely = false ) = 0; virtual void Delete ( const char* szCommand ) = 0; virtual void DeleteAll ( void ) = 0; virtual void SetExecuteHandler ( pfnExecuteCommandHandler pfnHandler ) = 0; virtual COMMANDENTRY* Get ( const char* szCommand, bool bCheckIfMod = false, bool bModCommand = false ) = 0; virtual std::list < COMMANDENTRY* > ::iterator IterBegin ( void ) = 0; virtual std::list < COMMANDENTRY* > ::iterator IterEnd ( void ) = 0; }; #endif
/************************************************************************ filename: IrrlichtRendererDef.h created: 20/7/2004 author: Thomas Suter changes: - Irrlicht patching not needed anymore - using the irrlicht filesystem to load config files etc. *************************************************************************/ /************************************************************************* Crazy Eddie's GUI System (http://www.cegui.org.uk) Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *************************************************************************/ /* Beginning from version 0.7 Irrlicht does NOT need any changes for the GUI-renderer. Thanks to Nikolaus Gebhardt for including the missing methods in the renderer. */ #ifndef IRRLICHTRENDERERDEF_H_INCLUDED #define IRRLICHTRENDERERDEF_H_INCLUDED #if defined( __WIN32__ ) || defined( _WIN32 ) || defined (WIN32) # ifdef IRRRENDERER_EXPORTS # define IRRLICHT_GUIRENDERER_API __declspec(dllexport) # else # define IRRLICHT_GUIRENDERER_API __declspec(dllimport) # endif #else # define IRRLICHT_GUIRENDERER_API #endif #endif
/* -*- c++ -*- */ /* * Copyright 2006 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_ATSC_VITERBI_DECODER_H #define INCLUDED_ATSC_VITERBI_DECODER_H #include <atsc_api.h> #include <gr_sync_block.h> #include <atsci_viterbi_decoder.h> class atsc_viterbi_decoder; typedef boost::shared_ptr<atsc_viterbi_decoder> atsc_viterbi_decoder_sptr; ATSC_API atsc_viterbi_decoder_sptr atsc_make_viterbi_decoder(); /*! * \brief ATSC 12-way interleaved viterbi decoder (atsc_soft_data_segment --> atsc_mpeg_packet_rs_encoded) * \ingroup atsc * * input: atsc_soft_data_segment; output: atsc_mpeg_packet_rs_encoded */ class ATSC_API atsc_viterbi_decoder : public gr_sync_block { friend ATSC_API atsc_viterbi_decoder_sptr atsc_make_viterbi_decoder(); atsci_viterbi_decoder d_viterbi_decoder; atsc_viterbi_decoder(); public: int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); void reset() { /* nop */ } protected: int last_start; }; #endif /* INCLUDED_ATSC_VITERBI_DECODER_H */
/* * netlink/netfilter/queue_msg.h Netfilter Queue Messages * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation version 2.1 * of the License. * * Copyright (c) 2007, 2008 Patrick McHardy <kaber@trash.net> */ #ifndef NETLINK_QUEUE_MSG_H_ #define NETLINK_QUEUE_MSG_H_ #include <netlink/netlink.h> #ifdef __cplusplus extern "C" { #endif struct nl_sock; struct nlmsghdr; struct nfnl_queue_msg; extern struct nl_object_ops queue_msg_obj_ops; /* General */ extern struct nfnl_queue_msg * nfnl_queue_msg_alloc(void); extern int nfnlmsg_queue_msg_parse(struct nlmsghdr *, struct nfnl_queue_msg **); extern void nfnl_queue_msg_get(struct nfnl_queue_msg *); extern void nfnl_queue_msg_put(struct nfnl_queue_msg *); extern void nfnl_queue_msg_set_group(struct nfnl_queue_msg *, uint16_t); extern int nfnl_queue_msg_test_group(const struct nfnl_queue_msg *); extern uint16_t nfnl_queue_msg_get_group(const struct nfnl_queue_msg *); extern void nfnl_queue_msg_set_family(struct nfnl_queue_msg *, uint8_t); extern int nfnl_queue_msg_test_family(const struct nfnl_queue_msg *); extern uint8_t nfnl_queue_msg_get_family(const struct nfnl_queue_msg *); extern void nfnl_queue_msg_set_packetid(struct nfnl_queue_msg *, uint32_t); extern int nfnl_queue_msg_test_packetid(const struct nfnl_queue_msg *); extern uint32_t nfnl_queue_msg_get_packetid(const struct nfnl_queue_msg *); extern void nfnl_queue_msg_set_hwproto(struct nfnl_queue_msg *, uint16_t); extern int nfnl_queue_msg_test_hwproto(const struct nfnl_queue_msg *); extern uint16_t nfnl_queue_msg_get_hwproto(const struct nfnl_queue_msg *); extern void nfnl_queue_msg_set_hook(struct nfnl_queue_msg *, uint8_t); extern int nfnl_queue_msg_test_hook(const struct nfnl_queue_msg *); extern uint8_t nfnl_queue_msg_get_hook(const struct nfnl_queue_msg *); extern void nfnl_queue_msg_set_mark(struct nfnl_queue_msg *, uint32_t); extern int nfnl_queue_msg_test_mark(const struct nfnl_queue_msg *); extern uint32_t nfnl_queue_msg_get_mark(const struct nfnl_queue_msg *); extern void nfnl_queue_msg_set_timestamp(struct nfnl_queue_msg *, struct timeval *); extern int nfnl_queue_msg_test_timestamp(const struct nfnl_queue_msg *); extern const struct timeval * nfnl_queue_msg_get_timestamp(const struct nfnl_queue_msg *); extern void nfnl_queue_msg_set_indev(struct nfnl_queue_msg *, uint32_t); extern int nfnl_queue_msg_test_indev(const struct nfnl_queue_msg *); extern uint32_t nfnl_queue_msg_get_indev(const struct nfnl_queue_msg *); extern void nfnl_queue_msg_set_outdev(struct nfnl_queue_msg *, uint32_t); extern int nfnl_queue_msg_test_outdev(const struct nfnl_queue_msg *); extern uint32_t nfnl_queue_msg_get_outdev(const struct nfnl_queue_msg *); extern void nfnl_queue_msg_set_physindev(struct nfnl_queue_msg *, uint32_t); extern int nfnl_queue_msg_test_physindev(const struct nfnl_queue_msg *); extern uint32_t nfnl_queue_msg_get_physindev(const struct nfnl_queue_msg *); extern void nfnl_queue_msg_set_physoutdev(struct nfnl_queue_msg *, uint32_t); extern int nfnl_queue_msg_test_physoutdev(const struct nfnl_queue_msg *); extern uint32_t nfnl_queue_msg_get_physoutdev(const struct nfnl_queue_msg *); extern void nfnl_queue_msg_set_hwaddr(struct nfnl_queue_msg *, uint8_t *, int); extern int nfnl_queue_msg_test_hwaddr(const struct nfnl_queue_msg *); extern const uint8_t * nfnl_queue_msg_get_hwaddr(const struct nfnl_queue_msg *, int *); extern int nfnl_queue_msg_set_payload(struct nfnl_queue_msg *, uint8_t *, int); extern int nfnl_queue_msg_test_payload(const struct nfnl_queue_msg *); extern const void * nfnl_queue_msg_get_payload(const struct nfnl_queue_msg *, int *); extern void nfnl_queue_msg_set_verdict(struct nfnl_queue_msg *, unsigned int); extern int nfnl_queue_msg_test_verdict(const struct nfnl_queue_msg *); extern unsigned int nfnl_queue_msg_get_verdict(const struct nfnl_queue_msg *); extern struct nl_msg * nfnl_queue_msg_build_verdict(const struct nfnl_queue_msg *); extern int nfnl_queue_msg_send_verdict(struct nl_sock *, const struct nfnl_queue_msg *); extern struct nl_msg * nfnl_queue_msg_build_verdict_batch(const struct nfnl_queue_msg *msg); extern int nfnl_queue_msg_send_verdict_batch(struct nl_sock *, const struct nfnl_queue_msg *); extern int nfnl_queue_msg_send_verdict_payload(struct nl_sock *, const struct nfnl_queue_msg *, const void *, unsigned ); #ifdef __cplusplus } #endif #endif
/***************************************************************************//** * @file * @brief EFR32MG1P_ROMTABLE register and bit field definitions * @version 5.7.0 ******************************************************************************* * # License * <b>Copyright 2018 Silicon Laboratories Inc. www.silabs.com</b> ******************************************************************************* * * SPDX-License-Identifier: Zlib * * The licensor of this software is Silicon Laboratories Inc. * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * ******************************************************************************/ #ifdef __cplusplus extern "C" { #endif #if defined(__ICCARM__) #pragma system_include /* Treat file as system include file. */ #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) #pragma clang system_header /* Treat file as system include file. */ #endif /***************************************************************************//** * @addtogroup Parts * @{ ******************************************************************************/ /***************************************************************************//** * @defgroup EFR32MG1P_ROMTABLE ROM Table, Chip Revision Information * @{ * @brief Chip Information, Revision numbers ******************************************************************************/ /** ROMTABLE Register Declaration */ typedef struct { __IM uint32_t PID4; /**< JEP_106_BANK */ __IM uint32_t PID5; /**< Unused */ __IM uint32_t PID6; /**< Unused */ __IM uint32_t PID7; /**< Unused */ __IM uint32_t PID0; /**< Chip family LSB, chip major revision */ __IM uint32_t PID1; /**< JEP_106_NO, Chip family MSB */ __IM uint32_t PID2; /**< Chip minor rev MSB, JEP_106_PRESENT, JEP_106_NO */ __IM uint32_t PID3; /**< Chip minor rev LSB */ __IM uint32_t CID0; /**< Unused */ } ROMTABLE_TypeDef; /** @} */ /***************************************************************************//** * @addtogroup EFR32MG1P_ROMTABLE * @{ * @defgroup EFR32MG1P_ROMTABLE_BitFields ROM Table Bit Field definitions * @{ ******************************************************************************/ /* Bit fields for EFR32MG1P_ROMTABLE */ #define _ROMTABLE_PID0_FAMILYLSB_MASK 0x000000C0UL /**< Least Significant Bits [1:0] of CHIP FAMILY, mask */ #define _ROMTABLE_PID0_FAMILYLSB_SHIFT 6 /**< Least Significant Bits [1:0] of CHIP FAMILY, shift */ #define _ROMTABLE_PID0_REVMAJOR_MASK 0x0000003FUL /**< CHIP MAJOR Revison, mask */ #define _ROMTABLE_PID0_REVMAJOR_SHIFT 0 /**< CHIP MAJOR Revison, shift */ #define _ROMTABLE_PID1_FAMILYMSB_MASK 0x0000000FUL /**< Most Significant Bits [5:2] of CHIP FAMILY, mask */ #define _ROMTABLE_PID1_FAMILYMSB_SHIFT 0 /**< Most Significant Bits [5:2] of CHIP FAMILY, shift */ #define _ROMTABLE_PID2_REVMINORMSB_MASK 0x000000F0UL /**< Most Significant Bits [7:4] of CHIP MINOR revision, mask */ #define _ROMTABLE_PID2_REVMINORMSB_SHIFT 4 /**< Most Significant Bits [7:4] of CHIP MINOR revision, mask */ #define _ROMTABLE_PID3_REVMINORLSB_MASK 0x000000F0UL /**< Least Significant Bits [3:0] of CHIP MINOR revision, mask */ #define _ROMTABLE_PID3_REVMINORLSB_SHIFT 4 /**< Least Significant Bits [3:0] of CHIP MINOR revision, shift */ /** @} */ /** @} End of group EFR32MG1P_ROMTABLE */ /** @} End of group Parts */ #ifdef __cplusplus } #endif