text
stringlengths 4
6.14k
|
|---|
/* -----------------------------------------------------------------------------
*
* (c) The GHC Team, 1998-2005
*
* Statistics and timing-related functions.
*
* ---------------------------------------------------------------------------*/
#ifndef STATS_H
#define STATS_H
#include "GetTime.h"
#include "BeginPrivate.h"
#if defined(mingw32_HOST_OS)
/* On Win64, if we say "printf" then gcc thinks we are going to use
MS format specifiers like %I64d rather than %llu */
#define PRINTF gnu_printf
#else
/* However, on OS X, "gnu_printf" isn't recognised */
#define PRINTF printf
#endif
struct gc_thread_;
void stat_startInit(void);
void stat_endInit(void);
void stat_startGCSync(struct gc_thread_ *_gct);
void stat_startGC(Capability *cap, struct gc_thread_ *_gct);
void stat_endGC (Capability *cap, struct gc_thread_ *_gct, W_ live,
W_ copied, W_ slop, uint32_t gen, uint32_t n_gc_threads,
W_ par_max_copied, W_ par_tot_copied);
#ifdef PROFILING
void stat_startRP(void);
void stat_endRP(uint32_t,
#ifdef DEBUG_RETAINER
uint32_t, int,
#endif
double);
#endif /* PROFILING */
#if defined(PROFILING) || defined(DEBUG)
void stat_startHeapCensus(void);
void stat_endHeapCensus(void);
#endif
void stat_startExit(void);
void stat_endExit(void);
void stat_exit(void);
void stat_workerStop(void);
void initStats0(void);
void initStats1(void);
double mut_user_time_until(Time t);
double mut_user_time(void);
void statDescribeGens( void );
Time stat_getElapsedGCTime(void);
Time stat_getElapsedTime(void);
#include "EndPrivate.h"
#endif /* STATS_H */
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_
#define GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_
#include <string>
#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "gpu/gpu_export.h"
#if defined(ANGLE_DX11)
#include "third_party/angle_dx11/include/GLSLANG/ShaderLang.h"
#else
#include "third_party/angle/include/GLSLANG/ShaderLang.h"
#endif
namespace gpu {
namespace gles2 {
// Translates a GLSL ES 2.0 shader to desktop GLSL shader, or just
// validates GLSL ES 2.0 shaders on a true GLSL ES implementation.
class ShaderTranslatorInterface {
public:
enum GlslImplementationType {
kGlsl,
kGlslES
};
enum GlslBuiltInFunctionBehavior {
kGlslBuiltInFunctionOriginal,
kGlslBuiltInFunctionEmulated
};
struct VariableInfo {
VariableInfo()
: type(0),
size(0) {
}
VariableInfo(int _type, int _size, std::string _name)
: type(_type),
size(_size),
name(_name) {
}
bool operator==(
const ShaderTranslatorInterface::VariableInfo& other) const {
return type == other.type &&
size == other.size &&
strcmp(name.c_str(), other.name.c_str()) == 0;
}
int type;
int size;
std::string name; // name in the original shader source.
};
// Mapping between variable name and info.
typedef base::hash_map<std::string, VariableInfo> VariableMap;
// Mapping between hashed name and original name.
typedef base::hash_map<std::string, std::string> NameMap;
// Initializes the translator.
// Must be called once before using the translator object.
virtual bool Init(
ShShaderType shader_type,
ShShaderSpec shader_spec,
const ShBuiltInResources* resources,
GlslImplementationType glsl_implementation_type,
GlslBuiltInFunctionBehavior glsl_built_in_function_behavior) = 0;
// Translates the given shader source.
// Returns true if translation is successful, false otherwise.
virtual bool Translate(const char* shader) = 0;
// The following functions return results from the last translation.
// The results are NULL/empty if the translation was unsuccessful.
// A valid info-log is always returned irrespective of whether translation
// was successful or not.
virtual const char* translated_shader() const = 0;
virtual const char* info_log() const = 0;
virtual const VariableMap& attrib_map() const = 0;
virtual const VariableMap& uniform_map() const = 0;
virtual const NameMap& name_map() const = 0;
// Return a string that is unique for a specfic set of options that would
// possibly effect compilation.
virtual std::string GetStringForOptionsThatWouldEffectCompilation() const = 0;
protected:
virtual ~ShaderTranslatorInterface() {}
};
// Implementation of ShaderTranslatorInterface
class GPU_EXPORT ShaderTranslator
: public base::RefCounted<ShaderTranslator>,
NON_EXPORTED_BASE(public ShaderTranslatorInterface) {
public:
class DestructionObserver {
public:
DestructionObserver();
virtual ~DestructionObserver();
virtual void OnDestruct(ShaderTranslator* translator) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(DestructionObserver);
};
ShaderTranslator();
// Overridden from ShaderTranslatorInterface.
virtual bool Init(
ShShaderType shader_type,
ShShaderSpec shader_spec,
const ShBuiltInResources* resources,
GlslImplementationType glsl_implementation_type,
GlslBuiltInFunctionBehavior glsl_built_in_function_behavior) OVERRIDE;
// Overridden from ShaderTranslatorInterface.
virtual bool Translate(const char* shader) OVERRIDE;
// Overridden from ShaderTranslatorInterface.
virtual const char* translated_shader() const OVERRIDE;
virtual const char* info_log() const OVERRIDE;
// Overridden from ShaderTranslatorInterface.
virtual const VariableMap& attrib_map() const OVERRIDE;
virtual const VariableMap& uniform_map() const OVERRIDE;
virtual const NameMap& name_map() const OVERRIDE;
virtual std::string GetStringForOptionsThatWouldEffectCompilation() const
OVERRIDE;
void AddDestructionObserver(DestructionObserver* observer);
void RemoveDestructionObserver(DestructionObserver* observer);
private:
friend class base::RefCounted<ShaderTranslator>;
virtual ~ShaderTranslator();
void ClearResults();
int GetCompileOptions() const;
ShHandle compiler_;
ShBuiltInResources compiler_options_;
scoped_ptr<char[]> translated_shader_;
scoped_ptr<char[]> info_log_;
VariableMap attrib_map_;
VariableMap uniform_map_;
NameMap name_map_;
bool implementation_is_glsl_es_;
bool needs_built_in_function_emulation_;
ObserverList<DestructionObserver> destruction_observers_;
DISALLOW_COPY_AND_ASSIGN(ShaderTranslator);
};
} // namespace gles2
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_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 BLIMP_NET_INPUT_MESSAGE_GENERATOR_H_
#define BLIMP_NET_INPUT_MESSAGE_GENERATOR_H_
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "blimp/net/blimp_net_export.h"
#include "net/base/completion_callback.h"
namespace blink {
class WebInputEvent;
}
namespace blimp {
class BlimpMessage;
class BlimpMessageProcessor;
// Handles creating serialized InputMessage protos from a stream of
// WebInputEvents. This class may be stateful to optimize the size of the
// serialized transmission data. See InputMessageConverter for the deserialize
// code.
class BLIMP_NET_EXPORT InputMessageGenerator {
public:
InputMessageGenerator();
~InputMessageGenerator();
// Builds a BlimpMessage from |event| that has the basic input event fields
// populated. This might make use of state sent from previous
// BlimpMessage::INPUT messages. It is up to the caller to populate the
// non-input fields and to send the BlimpMessage.
scoped_ptr<BlimpMessage> GenerateMessage(const blink::WebInputEvent& event);
private:
DISALLOW_COPY_AND_ASSIGN(InputMessageGenerator);
};
} // namespace blimp
#endif // BLIMP_NET_INPUT_MESSAGE_GENERATOR_H_
|
// RUN: %clang_builtins %s %librt -o %t && %run %t
// REQUIRES: librt_has_absvdi2
//===-- absvdi2_test.c - Test __absvdi2 -----------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// This file tests __absvdi2 for the compiler_rt library.
//
//===----------------------------------------------------------------------===//
#include "int_lib.h"
#include <stdio.h>
#include <stdlib.h>
// Returns: absolute value
// Effects: aborts if abs(x) < 0
COMPILER_RT_ABI di_int __absvdi2(di_int a);
int test__absvdi2(di_int a)
{
di_int x = __absvdi2(a);
di_int expected = a;
if (expected < 0)
expected = -expected;
if (x != expected || expected < 0)
printf("error in __absvdi2(0x%llX) = %lld, expected positive %lld\n",
a, x, expected);
return x != expected;
}
int main()
{
// if (test__absvdi2(0x8000000000000000LL)) // should abort
// return 1;
if (test__absvdi2(0x0000000000000000LL))
return 1;
if (test__absvdi2(0x0000000000000001LL))
return 1;
if (test__absvdi2(0x0000000000000002LL))
return 1;
if (test__absvdi2(0x7FFFFFFFFFFFFFFELL))
return 1;
if (test__absvdi2(0x7FFFFFFFFFFFFFFFLL))
return 1;
if (test__absvdi2(0x8000000000000001LL))
return 1;
if (test__absvdi2(0x8000000000000002LL))
return 1;
if (test__absvdi2(0xFFFFFFFFFFFFFFFELL))
return 1;
if (test__absvdi2(0xFFFFFFFFFFFFFFFFLL))
return 1;
int i;
for (i = 0; i < 10000; ++i)
if (test__absvdi2(((di_int)rand() << 32) | rand()))
return 1;
return 0;
}
|
// 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.
#import <Cocoa/Cocoa.h>
#include "base/callback.h"
#include "remoting/host/disconnect_window.h"
namespace remoting {
class ChromotingHost;
}
// Controller for the disconnect window which allows the host user to
// quickly disconnect a session.
@interface DisconnectWindowController : NSWindowController {
@private
remoting::ChromotingHost* host_;
base::Closure disconnect_callback_;
NSString* username_;
IBOutlet NSTextField* connectedToField_;
IBOutlet NSButton* disconnectButton_;
}
- (id)initWithHost:(remoting::ChromotingHost*)host
callback:(const base::Closure&)disconnect_callback
username:(NSString*)username;
- (IBAction)stopSharing:(id)sender;
@end
// A floating window with a custom border. The custom border and background
// content is defined by DisconnectView. Declared here so that it can be
// instantiated via a xib.
@interface DisconnectWindow : NSWindow
@end
// The custom background/border for the DisconnectWindow. Declared here so that
// it can be instantiated via a xib.
@interface DisconnectView : NSView
@end
|
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_SERVICES_LIBASSISTANT_GRPC_UTILS_TIMER_UTILS_H_
#define CHROMEOS_SERVICES_LIBASSISTANT_GRPC_UTILS_TIMER_UTILS_H_
#include "chromeos/assistant/internal/libassistant/shared_headers.h"
#include "chromeos/services/libassistant/public/cpp/assistant_timer.h"
namespace assistant {
namespace api {
class OnAlarmTimerEventRequest;
namespace params {
enum class TimerStatus;
class Timer;
class TimerParams;
} // namespace params
} // namespace api
} // namespace assistant
namespace chromeos {
namespace libassistant {
::assistant::api::OnAlarmTimerEventRequest
CreateOnAlarmTimerEventRequestProtoForV1(
const std::vector<chromeos::assistant::AssistantTimer>& all_curr_timers);
// `timer_params` contains the information of all the current timers.
std::vector<assistant::AssistantTimer> ConstructAssistantTimersFromProto(
const ::assistant::api::params::TimerParams& timer_params);
void ConvertAssistantTimerToProtoTimer(const assistant::AssistantTimer& input,
::assistant::api::params::Timer* output);
void ConvertProtoTimerToAssistantTimer(
const ::assistant::api::params::Timer& input,
chromeos::assistant::AssistantTimer* output);
// Used both in |AssistantClientV1| and |FakeAssistantClient|.
std::vector<chromeos::assistant::AssistantTimer> GetAllCurrentTimersFromEvents(
const std::vector<assistant_client::AlarmTimerManager::Event>& events);
} // namespace libassistant
} // namespace chromeos
#endif // CHROMEOS_SERVICES_LIBASSISTANT_GRPC_UTILS_TIMER_UTILS_H_
|
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
//
// You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
// copy, modify, and distribute this software in source code or binary form for use
// in connection with the web services and APIs provided by Facebook.
//
// As with any software that integrates with the Facebook platform, your use of
// this software is subject to the Facebook Developer Principles and Policies
// [http://developers.facebook.com/policy/]. This copyright notice shall be
// included in all copies or substantial portions of the software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
AccountKit application settings.
*/
@interface AKFSettings : NSObject
/**
Get the Account Kit Client Token used by the SDK.
If not explicitly set, the default will be read from the application's plist (AccountKitClientToken).
*/
+ (NSString *)clientToken;
/**
Set the Account Kit Client Token used by the SDK.
- Parameter clientToken: The Account Kit Client Token to be used by the SDK.
*/
+ (void)setClientToken:(NSString *)clientToken;
@end
NS_ASSUME_NONNULL_END
|
#if !defined(__mips_soft_float) && __mips >= 2
#include <math.h>
float sqrtf(float x)
{
float r;
__asm__("sqrt.s %0,%1" : "=f"(r) : "f"(x));
return r;
}
#else
#include "../sqrtf.c"
#endif
|
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2019 Damien P. George
*
* 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 MICROPY_INCLUDED_STM32_SOFTTIMER_H
#define MICROPY_INCLUDED_STM32_SOFTTIMER_H
#include "py/pairheap.h"
#define SOFT_TIMER_MODE_ONE_SHOT (1)
#define SOFT_TIMER_MODE_PERIODIC (2)
typedef struct _soft_timer_entry_t {
mp_pairheap_t pairheap;
uint32_t mode;
uint32_t expiry_ms;
uint32_t delta_ms; // for periodic mode
mp_obj_t callback;
} soft_timer_entry_t;
extern volatile uint32_t soft_timer_next;
void soft_timer_deinit(void);
void soft_timer_handler(void);
void soft_timer_insert(soft_timer_entry_t *entry);
void soft_timer_remove(soft_timer_entry_t *entry);
#endif // MICROPY_INCLUDED_STM32_SOFTTIMER_H
|
/*
* Copyright (C) 2010 ENAC
*
* 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 modules/ins/xsens700.h
* Parser for the Xsens protocol.
*/
#ifndef XSENS700_H
#define XSENS700_H
#include "std.h"
#include "math/pprz_algebra_float.h"
#include "math/pprz_geodetic_float.h"
#include "math/pprz_geodetic_int.h"
#include "xsens_parser.h"
#if USE_GPS_XSENS
#include "subsystems/gps.h"
#endif
struct XsensTime {
int8_t hour;
int8_t min;
int8_t sec;
int32_t nanosec;
int16_t year;
int8_t month;
int8_t day;
};
struct Xsens {
struct XsensTime time;
uint16_t time_stamp;
struct FloatRates gyro;
struct FloatVect3 accel;
struct FloatVect3 mag;
struct LlaCoor_f lla_f;
struct FloatVect3 vel; ///< NED velocity in m/s
struct FloatQuat quat;
struct FloatEulers euler;
struct XsensParser parser;
volatile bool new_attitude;
bool gyro_available;
bool accel_available;
bool mag_available;
#if USE_GPS_XSENS
struct GpsState gps;
bool gps_available;
#endif
};
extern struct Xsens xsens700;
extern void xsens700_init(void);
extern void xsens700_periodic(void);
extern void parse_xsens700_msg(void);
#endif /* XSENS700_H */
|
/*
* Intel MID (Langwell/Penwell) USB OTG Transceiver driver
* Copyright (C) 2008 - 2010, Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope 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 __INTEL_MID_OTG_H
#define __INTEL_MID_OTG_H
#include <linux/pm.h>
#include <linux/usb/otg.h>
#include <linux/notifier.h>
#include <linux/wakelock.h>
struct intel_mid_otg_xceiv;
/* This is a common data structure for Intel MID platform to
* save values of the OTG state machine */
struct otg_hsm {
/* Input */
int a_bus_resume;
int a_bus_suspend;
int a_conn;
int a_sess_vld;
int a_srp_det;
int a_vbus_vld;
int b_bus_resume;
int b_bus_suspend;
int b_conn;
int b_se0_srp;
int b_ssend_srp;
int b_sess_end;
int b_sess_vld;
int id;
/* id values */
#define ID_B 0x05
#define ID_A 0x04
#define ID_ACA_C 0x03
#define ID_ACA_B 0x02
#define ID_ACA_A 0x01
int power_up;
int adp_change;
int test_device;
/* Internal variables */
int a_set_b_hnp_en;
int b_srp_done;
int b_hnp_enable;
int hnp_poll_enable;
/* Timeout indicator for timers */
int a_wait_vrise_tmout;
int a_wait_bcon_tmout;
int a_aidl_bdis_tmout;
int a_bidl_adis_tmout;
int a_bidl_adis_tmr;
int a_wait_vfall_tmout;
int b_ase0_brst_tmout;
int b_bus_suspend_tmout;
int b_srp_init_tmout;
int b_srp_fail_tmout;
int b_srp_fail_tmr;
int b_adp_sense_tmout;
int tst_maint_tmout;
int tst_noadp_tmout;
/* Informative variables */
int a_bus_drop;
int a_bus_req;
int a_clr_err;
int b_bus_req;
int a_suspend_req;
int b_bus_suspend_vld;
/* Output */
int drv_vbus;
int loc_conn;
int loc_sof;
/* Others */
int vbus_srp_up;
int ulpi_error;
int ulpi_polling;
/* Test Mode */
int otg_srp_reqd;
int otg_hnp_reqd;
int otg_vbus_off;
int in_test_mode;
};
/* must provide ULPI access function to read/write registers implemented in
* ULPI address space */
struct iotg_ulpi_access_ops {
int (*read)(struct intel_mid_otg_xceiv *iotg, u8 reg, u8 *val);
int (*write)(struct intel_mid_otg_xceiv *iotg, u8 reg, u8 val);
};
#define OTG_A_DEVICE 0x0
#define OTG_B_DEVICE 0x1
/*
* the Intel MID (Langwell/Penwell) otg transceiver driver needs to interact
* with device and host drivers to implement the USB OTG related feature. More
* function members are added based on usb_phy data structure for this
* purpose.
*/
struct intel_mid_otg_xceiv {
struct usb_phy otg;
struct otg_hsm hsm;
/* base address */
void __iomem *base;
/* ops to access ulpi */
struct iotg_ulpi_access_ops ulpi_ops;
/* atomic notifier for interrupt context */
struct atomic_notifier_head iotg_notifier;
/* hnp poll lock */
spinlock_t hnp_poll_lock;
#ifdef CONFIG_USB_SUSPEND
struct wake_lock wake_lock;
#endif
/* start/stop USB Host function */
int (*start_host)(struct intel_mid_otg_xceiv *iotg);
int (*stop_host)(struct intel_mid_otg_xceiv *iotg);
/* start/stop USB Peripheral function */
int (*start_peripheral)(struct intel_mid_otg_xceiv *iotg);
int (*stop_peripheral)(struct intel_mid_otg_xceiv *iotg);
/* start/stop ADP sense/probe function */
int (*set_adp_probe)(struct intel_mid_otg_xceiv *iotg,
bool enabled, int dev);
int (*set_adp_sense)(struct intel_mid_otg_xceiv *iotg,
bool enabled);
/* start/stop HNP Polling function */
int (*start_hnp_poll)(struct intel_mid_otg_xceiv *iotg);
int (*stop_hnp_poll)(struct intel_mid_otg_xceiv *iotg);
#ifdef CONFIG_PM
/* suspend/resume USB host function */
int (*suspend_host)(struct intel_mid_otg_xceiv *iotg);
int (*suspend_noirq_host)(struct intel_mid_otg_xceiv *iotg);
int (*resume_host)(struct intel_mid_otg_xceiv *iotg);
int (*resume_noirq_host)(struct intel_mid_otg_xceiv *iotg);
int (*suspend_peripheral)(struct intel_mid_otg_xceiv *iotg,
pm_message_t message);
int (*resume_peripheral)(struct intel_mid_otg_xceiv *iotg);
/* runtime suspend/resume */
int (*runtime_suspend_host)(struct intel_mid_otg_xceiv *iotg);
int (*runtime_resume_host)(struct intel_mid_otg_xceiv *iotg);
int (*runtime_suspend_peripheral)(struct intel_mid_otg_xceiv *iotg);
int (*runtime_resume_peripheral)(struct intel_mid_otg_xceiv *iotg);
#endif
};
static inline
struct intel_mid_otg_xceiv *otg_to_mid_xceiv(struct usb_phy *otg)
{
return container_of(otg, struct intel_mid_otg_xceiv, otg);
}
#define MID_OTG_NOTIFY_CONNECT 0x0001
#define MID_OTG_NOTIFY_DISCONN 0x0002
#define MID_OTG_NOTIFY_HSUSPEND 0x0003
#define MID_OTG_NOTIFY_HRESUME 0x0004
#define MID_OTG_NOTIFY_CSUSPEND 0x0005
#define MID_OTG_NOTIFY_CRESUME 0x0006
#define MID_OTG_NOTIFY_HOSTADD 0x0007
#define MID_OTG_NOTIFY_HOSTREMOVE 0x0008
#define MID_OTG_NOTIFY_CLIENTADD 0x0009
#define MID_OTG_NOTIFY_CLIENTREMOVE 0x000a
#define MID_OTG_NOTIFY_CRESET 0x000b
#define MID_OTG_NOTIFY_TEST_SRP_REQD 0x0101
#define MID_OTG_NOTIFY_TEST_VBUS_OFF 0x0102
#define MID_OTG_NOTIFY_TEST 0x0103
#define MID_OTG_NOTIFY_TEST_MODE_START 0x0104
#define MID_OTG_NOTIFY_TEST_MODE_STOP 0x0105
static inline int
intel_mid_otg_register_notifier(struct intel_mid_otg_xceiv *iotg,
struct notifier_block *nb)
{
return atomic_notifier_chain_register(&iotg->iotg_notifier, nb);
}
static inline void
intel_mid_otg_unregister_notifier(struct intel_mid_otg_xceiv *iotg,
struct notifier_block *nb)
{
atomic_notifier_chain_unregister(&iotg->iotg_notifier, nb);
}
#endif /* __INTEL_MID_OTG_H */
|
/*
This file is part of VK/KittenPHP-DB-Engine.
VK/KittenPHP-DB-Engine 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.
VK/KittenPHP-DB-Engine 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 VK/KittenPHP-DB-Engine. If not, see <http://www.gnu.org/licenses/>.
This program is released under the GPL with the additional exemption
that compiling, linking, and/or using OpenSSL is allowed.
You are free to remove this exemption from derived works.
Copyright 2013 Vkontakte Ltd
2013 Vitaliy Valtman
*/
#ifndef __SEARCH_TL_H__
#define __SEARCH_TL_H__
#include "TL/constants.h"
#define FLAG_SORT (1 << 1)
#define FLAG_SORT_DESC (1 << 2)
#define FLAG_RESTR (1 << 3)
#define FLAG_EXACT_HASH (1 << 4)
#define FLAG_GROUP_HASH (1 << 5)
#define FLAG_HASH_CHANGE (1 << 6)
#define FLAG_RELEVANCE (1 << 7)
#define FLAG_TITLE (1 << 8)
#define FLAG_OPTTAG (1 << 9)
#define FLAG_CUSTOM_RATE_WEIGHT (1 << 10)
#define FLAG_CUSTOM_PRIORITY_WEIGHT (1 << 11)
#define FLAG_DECAY (1 << 12)
#define FLAG_EXTENDED_MODE (1 << 13)
#define FLAG_OCCURANCE_COUNT (1 << 14)
#define FLAG_RAND (1 << 15)
#define FLAG_WEAK_SEARCH (1 << 16)
#define FLAG_SEARCHX (1 << 17)
#define FLAG_RETRY_SEARCH (1 << 30)
#endif
|
#ifndef _SYS_PARAM_H
#define _SYS_PARAM_H
#include <limits.h>
#define MAXPATHLEN PATH_MAX
#define MAXHOSTNAMELEN 64
#define NGROUPS 32
#define NOGROUP (-1)
#define NOFILE OPEN_MAX
#undef MIN
#undef MAX
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
#ifdef __alpha__
#define HZ 1024
#else
#define HZ 100
#endif
#ifndef howmany
# define howmany(x, y) (((x)+((y)-1))/(y))
#endif
#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
#define powerof2(x) ((((x)-1)&(x))==0)
#endif
|
/* Linux-dependent part of branch trace support for GDB, and GDBserver.
Copyright (C) 2013-2017 Free Software Foundation, Inc.
Contributed by Intel Corp. <markus.t.metzger@intel.com>
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef LINUX_BTRACE_H
#define LINUX_BTRACE_H
#include "btrace-common.h"
#include "vec.h"
#if HAVE_LINUX_PERF_EVENT_H
# include <linux/perf_event.h>
#endif
struct target_ops;
#if HAVE_LINUX_PERF_EVENT_H
/* A Linux perf event buffer. */
struct perf_event_buffer
{
/* The mapped memory. */
const uint8_t *mem;
/* The size of the mapped memory in bytes. */
size_t size;
/* A pointer to the data_head field for this buffer. */
volatile __u64 *data_head;
/* The data_head value from the last read. */
__u64 last_head;
};
/* Branch trace target information for BTS tracing. */
struct btrace_tinfo_bts
{
/* The Linux perf_event configuration for collecting the branch trace. */
struct perf_event_attr attr;
/* The perf event file. */
int file;
/* The perf event configuration page. */
volatile struct perf_event_mmap_page *header;
/* The BTS perf event buffer. */
struct perf_event_buffer bts;
};
/* Branch trace target information for Intel Processor Trace
tracing. */
struct btrace_tinfo_pt
{
/* The Linux perf_event configuration for collecting the branch trace. */
struct perf_event_attr attr;
/* The perf event file. */
int file;
/* The perf event configuration page. */
volatile struct perf_event_mmap_page *header;
/* The trace perf event buffer. */
struct perf_event_buffer pt;
};
#endif /* HAVE_LINUX_PERF_EVENT_H */
/* Branch trace target information per thread. */
struct btrace_target_info
{
/* The ptid of this thread. */
ptid_t ptid;
/* The obtained branch trace configuration. */
struct btrace_config conf;
#if HAVE_LINUX_PERF_EVENT_H
/* The branch tracing format specific information. */
union
{
/* CONF.FORMAT == BTRACE_FORMAT_BTS. */
struct btrace_tinfo_bts bts;
/* CONF.FORMAT == BTRACE_FORMAT_PT. */
struct btrace_tinfo_pt pt;
} variant;
#endif /* HAVE_LINUX_PERF_EVENT_H */
};
/* See to_supports_btrace in target.h. */
extern int linux_supports_btrace (struct target_ops *, enum btrace_format);
/* See to_enable_btrace in target.h. */
extern struct btrace_target_info *
linux_enable_btrace (ptid_t ptid, const struct btrace_config *conf);
/* See to_disable_btrace in target.h. */
extern enum btrace_error linux_disable_btrace (struct btrace_target_info *ti);
/* See to_read_btrace in target.h. */
extern enum btrace_error linux_read_btrace (struct btrace_data *btrace,
struct btrace_target_info *btinfo,
enum btrace_read_type type);
/* See to_btrace_conf in target.h. */
extern const struct btrace_config *
linux_btrace_conf (const struct btrace_target_info *);
#endif /* LINUX_BTRACE_H */
|
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2006-03-13 Bernard the first version
*/
#include <rtthread.h>
#include <sep4020.h>
/**
* @addtogroup S3C24X0
*/
/*@{*/
/**
* This function will initialize thread stack
*
* @param tentry the entry of thread
* @param parameter the parameter of entry
* @param stack_addr the beginning stack address
* @param texit the function will be called when thread exit
*
* @return stack address
*/
rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter,
rt_uint8_t *stack_addr, void *texit)
{
rt_uint32_t *stk;
stack_addr += sizeof(rt_uint32_t);
stack_addr = (rt_uint8_t *)RT_ALIGN_DOWN((rt_uint32_t)stack_addr, 8);
stk = (rt_uint32_t *)stack_addr;
*(--stk) = (rt_uint32_t)tentry; /* entry point */
*(--stk) = (rt_uint32_t)texit; /* lr */
*(--stk) = 0xdeadbeef; /* r12 */
*(--stk) = 0xdeadbeef; /* r11 */
*(--stk) = 0xdeadbeef; /* r10 */
*(--stk) = 0xdeadbeef; /* r9 */
*(--stk) = 0xdeadbeef; /* r8 */
*(--stk) = 0xdeadbeef; /* r7 */
*(--stk) = 0xdeadbeef; /* r6 */
*(--stk) = 0xdeadbeef; /* r5 */
*(--stk) = 0xdeadbeef; /* r4 */
*(--stk) = 0xdeadbeef; /* r3 */
*(--stk) = 0xdeadbeef; /* r2 */
*(--stk) = 0xdeadbeef; /* r1 */
*(--stk) = (rt_uint32_t)parameter; /* r0 : argument */
*(--stk) = Mode_SVC; /* cpsr */
*(--stk) = Mode_SVC; /* spsr */
/* return task's current stack address */
return (rt_uint8_t *)stk;
}
/*@}*/
|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#ifdef HAVE_SELINUX
#include <selinux/selinux.h>
#endif
#include "selinux-setup.h"
#include "selinux-util.h"
#include "label.h"
#include "mount-setup.h"
#include "macro.h"
#include "util.h"
#include "log.h"
#ifdef HAVE_SELINUX
static int null_log(int type, const char *fmt, ...) {
return 0;
}
#endif
int selinux_setup(bool *loaded_policy) {
#ifdef HAVE_SELINUX
int enforce = 0;
usec_t before_load, after_load;
security_context_t con;
int r;
union selinux_callback cb;
bool initialized = false;
assert(loaded_policy);
/* Turn off all of SELinux' own logging, we want to do that */
cb.func_log = null_log;
selinux_set_callback(SELINUX_CB_LOG, cb);
/* Don't load policy in the initrd if we don't appear to have
* it. For the real root, we check below if we've already
* loaded policy, and return gracefully.
*/
if (in_initrd() && access(selinux_path(), F_OK) < 0)
return 0;
/* Already initialized by somebody else? */
r = getcon_raw(&con);
if (r == 0) {
initialized = !streq(con, "kernel");
freecon(con);
}
/* Make sure we have no fds open while loading the policy and
* transitioning */
log_close();
/* Now load the policy */
before_load = now(CLOCK_MONOTONIC);
r = selinux_init_load_policy(&enforce);
if (r == 0) {
char timespan[FORMAT_TIMESPAN_MAX];
char *label;
retest_selinux();
/* Transition to the new context */
r = label_get_create_label_from_exe(SYSTEMD_BINARY_PATH, &label);
if (r < 0 || label == NULL) {
log_open();
log_error("Failed to compute init label, ignoring.");
} else {
r = setcon(label);
log_open();
if (r < 0)
log_error("Failed to transition into init label '%s', ignoring.", label);
label_free(label);
}
after_load = now(CLOCK_MONOTONIC);
log_info("Successfully loaded SELinux policy in %s.",
format_timespan(timespan, sizeof(timespan), after_load - before_load, 0));
*loaded_policy = true;
} else {
log_open();
if (enforce > 0) {
if (!initialized) {
log_error("Failed to load SELinux policy. Freezing.");
return -EIO;
}
log_warning("Failed to load new SELinux policy. Continuing with old policy.");
} else
log_debug("Unable to load SELinux policy. Ignoring.");
}
#endif
return 0;
}
|
/* This testcase is part of GDB, the GNU debugger.
Contributed by Intel Corp. <keven.boell@intel.com>
Copyright 2014-2017 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
int
func (int n)
{
int vla[n], i;
for (i = 0; i < n; i++)
vla[i] = i;
return n; /* vla-filled */
}
int
main (void)
{
func (5);
return 0;
}
|
#ifndef BASE_BATTERY_H
#define BASE_BATTERY_H
#include <omnetpp.h>
#include "MiXiMDefs.h"
#include "BaseModule.h"
#include "HostState.h"
/**
* @brief Defines the amount of power drawn by a device from
* a power source.
*
* Used as generic amount parameter for BaseBatteries "draw"-method.
*
* Can be either an instantaneous draw of a certain energy amount
* in mWs (type=ENERGY) or a draw of a certain current in mA over
* time (type=CURRENT).
*
* Can be sub-classed for more complex power draws.
*
* @ingroup baseModules
* @ingroup power
*/
class MIXIM_API DrawAmount {
public:
/** @brief The type of the amount to draw.*/
enum PowerType {
CURRENT, /** @brief Current in mA over time. */
ENERGY /** @brief Single fixed energy draw in mWs */
};
protected:
/** @brief Stores the type of the amount.*/
int type;
/** @brief Stores the actual amount.*/
double value;
public:
/** @brief Initializes with passed type and value.*/
DrawAmount(int type = CURRENT, double value = 0):
type(type),
value(value)
{}
virtual ~DrawAmount()
{}
/** @brief Returns the type of power drawn as PowerType. */
virtual int getType() const { return type; }
/** @brief Returns the actual amount of power drawn. */
virtual double getValue() const { return value; }
/** @brief Sets the type of power drawn. */
virtual void setType(int t) { type = t; }
/** @brief Sets the actual amount of power drawn. */
virtual void setValue(double v) { value = v; }
};
/**
* @brief Base class for any power source.
*
* See "SimpleBattery" for an example implementation.
*
* @ingroup baseModules
* @ingroup power
* @see SimpleBattery
*/
class MIXIM_API BaseBattery : public BaseModule {
private:
/** @brief Copy constructor is not allowed.
*/
BaseBattery(const BaseBattery&);
/** @brief Assignment operator is not allowed.
*/
BaseBattery& operator=(const BaseBattery&);
public:
BaseBattery() : BaseModule()
{}
BaseBattery(unsigned stacksize) : BaseModule(stacksize)
{}
/**
* @brief Registers a power draining device with this battery.
*
* Takes the name of the device as well as a number of accounts
* the devices draws power for (like rx, tx, idle for a radio device).
*
* Returns an ID by which the device can identify itself to the
* battery.
*
* Has to be implemented by actual battery implementations.
*/
virtual int registerDevice(const std::string& name, int numAccounts) = 0;
/**
* @brief Draws power from the battery.
*
* The actual amount and type of power drawn is defined by the passed
* DrawAmount parameter. Can be an fixed single amount or an amount
* drawn over time.
* The drainID identifies the device which drains the power.
* "Account" identifies the account the power is drawn from. It is
* used for statistical evaluation only to see which activity of a
* device has used how much power. It does not affect functionality.
*/
virtual void draw(int drainID, DrawAmount& amount, int account) = 0;
/**
* @name State-of-charge interface
*
* @brief Other host modules should use these interfaces to obtain
* the state-of-charge of the battery. Do NOT use BatteryState
* interfaces, which should be used only by Battery Stats modules.
*/
/*@{*/
/** @brief get voltage (future support for non-voltage regulated h/w */
virtual double getVoltage() const = 0;
/** @brief current state of charge of the battery, relative to its
* rated nominal capacity [0..1]
*/
virtual double estimateResidualRelative() const = 0;
/** @brief current state of charge of the battery (mW-s) */
virtual double estimateResidualAbs() const = 0;
/** @brief Current state of the battery. */
virtual HostState::States getState() const = 0;
/*@}*/
};
#endif
|
/*
* arch/x86/kernel/nmi-selftest.c
*
* Testsuite for NMI: IPIs
*
* Started by Don Zickus:
* (using lib/locking-selftest.c as a guide)
*
* Copyright (C) 2011 Red Hat, Inc., Don Zickus <dzickus@redhat.com>
*/
#include <linux/smp.h>
#include <linux/cpumask.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/percpu.h>
#include <asm/apic.h>
#include <asm/nmi.h>
#define SUCCESS 0
#define FAILURE 1
#define TIMEOUT 2
static int __initdata nmi_fail;
/* check to see if NMI IPIs work on this machine */
static DECLARE_BITMAP(nmi_ipi_mask, NR_CPUS) __initdata;
static int __initdata testcase_total;
static int __initdata testcase_successes;
static int __initdata expected_testcase_failures;
static int __initdata unexpected_testcase_failures;
static int __initdata unexpected_testcase_unknowns;
static int __init nmi_unk_cb(unsigned int val, struct pt_regs *regs)
{
unexpected_testcase_unknowns++;
return NMI_HANDLED;
}
static void __init init_nmi_testsuite(void)
{
/* trap all the unknown NMIs we may generate */
register_nmi_handler(NMI_UNKNOWN, nmi_unk_cb, 0, "nmi_selftest_unk");
}
static void __init cleanup_nmi_testsuite(void)
{
unregister_nmi_handler(NMI_UNKNOWN, "nmi_selftest_unk");
}
static int __init test_nmi_ipi_callback(unsigned int val, struct pt_regs *regs)
{
int cpu = raw_smp_processor_id();
if (cpumask_test_and_clear_cpu(cpu, to_cpumask(nmi_ipi_mask)))
return NMI_HANDLED;
return NMI_DONE;
}
static void __init test_nmi_ipi(struct cpumask *mask)
{
unsigned long timeout;
if (register_nmi_handler(NMI_LOCAL, test_nmi_ipi_callback,
NMI_FLAG_FIRST, "nmi_selftest")) {
nmi_fail = FAILURE;
return;
}
/* sync above data before sending NMI */
wmb();
apic->send_IPI_mask(mask, NMI_VECTOR);
/* Don't wait longer than a second */
timeout = USEC_PER_SEC;
while (!cpumask_empty(mask) && timeout--)
udelay(1);
/* What happens if we timeout, do we still unregister?? */
unregister_nmi_handler(NMI_LOCAL, "nmi_selftest");
if (!timeout)
nmi_fail = TIMEOUT;
return;
}
static void __init remote_ipi(void)
{
cpumask_copy(to_cpumask(nmi_ipi_mask), cpu_online_mask);
cpumask_clear_cpu(smp_processor_id(), to_cpumask(nmi_ipi_mask));
if (!cpumask_empty(to_cpumask(nmi_ipi_mask)))
test_nmi_ipi(to_cpumask(nmi_ipi_mask));
}
static void __init local_ipi(void)
{
cpumask_clear(to_cpumask(nmi_ipi_mask));
cpumask_set_cpu(smp_processor_id(), to_cpumask(nmi_ipi_mask));
test_nmi_ipi(to_cpumask(nmi_ipi_mask));
}
static void __init reset_nmi(void)
{
nmi_fail = 0;
}
static void __init dotest(void (*testcase_fn)(void), int expected)
{
testcase_fn();
/*
* Filter out expected failures:
*/
if (nmi_fail != expected) {
unexpected_testcase_failures++;
if (nmi_fail == FAILURE)
printk(KERN_CONT "FAILED |");
else if (nmi_fail == TIMEOUT)
printk(KERN_CONT "TIMEOUT|");
else
printk(KERN_CONT "ERROR |");
dump_stack();
} else {
testcase_successes++;
printk(KERN_CONT " ok |");
}
testcase_total++;
reset_nmi();
}
static inline void __init print_testname(const char *testname)
{
printk("%12s:", testname);
}
void __init nmi_selftest(void)
{
init_nmi_testsuite();
/*
* Run the testsuite:
*/
printk("----------------\n");
printk("| NMI testsuite:\n");
printk("--------------------\n");
print_testname("remote IPI");
dotest(remote_ipi, SUCCESS);
printk(KERN_CONT "\n");
print_testname("local IPI");
dotest(local_ipi, SUCCESS);
printk(KERN_CONT "\n");
cleanup_nmi_testsuite();
if (unexpected_testcase_failures) {
printk("--------------------\n");
printk("BUG: %3d unexpected failures (out of %3d) - debugging disabled! |\n",
unexpected_testcase_failures, testcase_total);
printk("-----------------------------------------------------------------\n");
} else if (expected_testcase_failures && testcase_successes) {
printk("--------------------\n");
printk("%3d out of %3d testcases failed, as expected. |\n",
expected_testcase_failures, testcase_total);
printk("----------------------------------------------------\n");
} else if (expected_testcase_failures && !testcase_successes) {
printk("--------------------\n");
printk("All %3d testcases failed, as expected. |\n",
expected_testcase_failures);
printk("----------------------------------------\n");
} else {
printk("--------------------\n");
printk("Good, all %3d testcases passed! |\n",
testcase_successes);
printk("---------------------------------\n");
}
}
|
#ifndef MTL_ORIEN_H
#define MTL_ORIEN_H
namespace mtl {
struct row_orien;
struct column_orien;
struct row_major;
struct column_major;
//: Row Orientation
// This is used in matrix_implementation and in the indexer objects
// to map (row,column) to (major,minor).
struct row_orien {
template <int MM, int NN> struct dims { enum { M = MM, N = NN }; };
typedef row_tag orientation;
typedef row_major constructor_tag;
typedef column_orien transpose_type;
template <class Dim>
static typename Dim::size_type row(Dim d) { return d.first(); }
template <class Dim>
static typename Dim::size_type column(Dim d){ return d.second();}
template <class Dim>
static Dim map(Dim d) { return d; }
};
//: Column Orientation
// This is used in matrix_implementation and in the indexer objects
// to map (row,column) to (minor,major).
struct column_orien {
template <int MM, int NN> struct dims { enum { M = NN, N = MM }; };
typedef column_tag orientation;
typedef row_orien transpose_type;
typedef column_major constructor_tag;
template <class Dim>
static typename Dim::size_type row(Dim d) { return d.second(); }
template <class Dim>
static typename Dim::size_type column(Dim d){ return d.first(); }
#if 0
/* the static dim has already been transposed in matrix.h
so no need to do it here */
template <class Dim>
static typename Dim::transpose_type map(Dim d) { return d.transpose(); }
#else
template <class Dim>
static Dim map(Dim d) { return Dim(d.second(), d.first()); }
#endif
};
} /* namespace mtl */
#endif /* MTL_ORIEN_H */
|
/*
* Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header IOPMKeys.h
IOPMKeys.h defines C strings for use accessing power management data.
Note that all of these C strings must be converted to CFStrings before use. You can wrap
them with the CFSTR() macro, or create a CFStringRef (that you must later CFRelease()) using CFStringCreateWithCString()
*/
#ifndef _IOPMKEYS_H_
#define _IOPMKEYS_H_
/*
* Types of power event
* These are potential arguments to IOPMSchedulePowerEvent().
* These are all potential values of the kIOPMPowerEventTypeKey in the CFDictionaries
* returned by IOPMCopyScheduledPowerEvents().
*/
/*!
@define kIOPMAutoWake
@abstract Value for scheduled wake from sleep.
*/
#define kIOPMAutoWake "wake"
/*!
@define kIOPMAutoPowerOn
@abstract Value for scheduled power on from off state.
*/
#define kIOPMAutoPowerOn "poweron"
/*!
@define kIOPMAutoWakeOrPowerOn
@abstract Value for scheduled wake from sleep, or power on. The system will either wake OR
power on, whichever is necessary.
*/
#define kIOPMAutoWakeOrPowerOn "wakepoweron"
/*!
@define kIOPMAutoSleep
@abstract Value for scheduled sleep.
*/
#define kIOPMAutoSleep "sleep"
/*!
@define kIOPMAutoShutdown
@abstract Value for scheduled shutdown.
*/
#define kIOPMAutoShutdown "shutdown"
/*!
@define kIOPMAutoRestart
@abstract Value for scheduled restart.
*/
#define kIOPMAutoRestart "restart"
/*
* Keys for evaluating the CFDictionaries returned by IOPMCopyScheduledPowerEvents()
*/
/*!
@define kIOPMPowerEventTimeKey
@abstract Key for the time of the scheduled power event. Value is a CFDateRef.
*/
#define kIOPMPowerEventTimeKey "time"
/*!
@define kIOPMPowerEventAppNameKey
@abstract Key for the CFBundleIdentifier of the app that scheduled the power event. Value is a CFStringRef.
*/
#define kIOPMPowerEventAppNameKey "scheduledby"
/*!
@define kIOPMPowerEventTypeKey
@abstract Key for the type of power event. Value is a CFStringRef, with the c-string value of one of the "kIOPMAuto" strings.
*/
#define kIOPMPowerEventTypeKey "eventtype"
#endif
|
/* keydb.h - Key database
* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
* GnuPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* GnuPG 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 GNUPG_KEYDB_H
#define GNUPG_KEYDB_H
#include <ksba.h>
#include "../kbx/keybox-search-desc.h"
typedef struct keydb_handle *KEYDB_HANDLE;
/* Flag value used with KEYBOX_FLAG_VALIDITY. */
#define VALIDITY_REVOKED (1<<5)
/*-- keydb.c --*/
int keydb_add_resource (const char *url, int force, int secret,
int *auto_created);
KEYDB_HANDLE keydb_new (int secret);
void keydb_release (KEYDB_HANDLE hd);
int keydb_set_ephemeral (KEYDB_HANDLE hd, int yes);
const char *keydb_get_resource_name (KEYDB_HANDLE hd);
gpg_error_t keydb_lock (KEYDB_HANDLE hd);
#if 0 /* pgp stuff */
int keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb);
int keydb_update_keyblock (KEYDB_HANDLE hd, KBNODE kb);
int keydb_insert_keyblock (KEYDB_HANDLE hd, KBNODE kb);
#endif
gpg_error_t keydb_get_flags (KEYDB_HANDLE hd, int which, int idx,
unsigned int *value);
gpg_error_t keydb_set_flags (KEYDB_HANDLE hd, int which, int idx,
unsigned int value);
int keydb_get_cert (KEYDB_HANDLE hd, ksba_cert_t *r_cert);
int keydb_insert_cert (KEYDB_HANDLE hd, ksba_cert_t cert);
int keydb_update_cert (KEYDB_HANDLE hd, ksba_cert_t cert);
int keydb_delete (KEYDB_HANDLE hd, int unlock);
int keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved);
void keydb_rebuild_caches (void);
int keydb_search_reset (KEYDB_HANDLE hd);
int keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, size_t ndesc);
int keydb_search_first (KEYDB_HANDLE hd);
int keydb_search_next (KEYDB_HANDLE hd);
int keydb_search_kid (KEYDB_HANDLE hd, u32 *kid);
int keydb_search_fpr (KEYDB_HANDLE hd, const byte *fpr);
int keydb_search_issuer (KEYDB_HANDLE hd, const char *issuer);
int keydb_search_issuer_sn (KEYDB_HANDLE hd,
const char *issuer, const unsigned char *serial);
int keydb_search_subject (KEYDB_HANDLE hd, const char *issuer);
int keydb_classify_name (const char *name, KEYDB_SEARCH_DESC *desc);
int keydb_store_cert (ksba_cert_t cert, int ephemeral, int *existed);
gpg_error_t keydb_set_cert_flags (ksba_cert_t cert, int ephemeral,
int which, int idx,
unsigned int mask, unsigned int value);
void keydb_clear_some_cert_flags (ctrl_t ctrl, strlist_t names);
#endif /*GNUPG_KEYDB_H*/
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <QtGlobal>
namespace QmlDesigner {
inline double round(double value, int digits)
{
double factor = digits * 10.;
return double(qRound64(value * factor)) / factor;
}
}
|
/* -*- C++ -*- */
/************************************************************************
*
* Copyright(c) 1995~2006 Masaharu Goto (root-cint@cern.ch)
*
* For the licensing terms see the file COPYING
*
************************************************************************/
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
#ifndef FMULTIMAP_H
#define FMULTIMAP_H
#ifdef MULTIMAP_H
#undef MULTIMAP_H
#undef TREE_H
#define __MULTIMAP_WAS_DEFINED
#endif
#define Allocator far_allocator
#define multimap far_multimap
#define rb_tree far_rb_tree
#include <faralloc.h>
#include <multimap.h>
#undef MULTIMAP_H
#undef TREE_H
#ifdef __MULTIMAP_WAS_DEFINED
#define MULTIMAP_H
#define TREE_H
#undef __MULTIMAP_WAS_DEFINED
#endif
#undef Allocator
#undef multimap
#undef rb_tree
#endif
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "H5Fmodule.h" /* This source code file is part of the H5F module */
/* Packages needed by this file... */
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* File access */
/* PRIVATE PROTOTYPES */
/*-------------------------------------------------------------------------
* Function: H5F_fake_alloc
*
* Purpose: Allocate a "fake" file structure, for various routines to
* use for encoding/decoding data structures using internal API
* routines that need a file structure, but don't ultimately
* depend on having a "real" file.
*
* Return: Success: Pointer to 'faked up' file structure
* Failure: NULL
*
* Programmer: Quincey Koziol
* Oct 2, 2006
*
*-------------------------------------------------------------------------
*/
H5F_t *
H5F_fake_alloc(uint8_t sizeof_size)
{
H5F_t *f = NULL; /* Pointer to fake file struct */
H5F_t *ret_value = NULL; /* Return value */
FUNC_ENTER_NOAPI(NULL)
/* Allocate faked file struct */
if (NULL == (f = H5FL_CALLOC(H5F_t)))
HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate top file structure")
if (NULL == (f->shared = H5FL_CALLOC(H5F_shared_t)))
HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate shared file structure")
/* Only set fields necessary for clients */
if (sizeof_size == 0)
f->shared->sizeof_size = H5F_OBJ_SIZE_SIZE;
else
f->shared->sizeof_size = sizeof_size;
/* Set return value */
ret_value = f;
done:
if (!ret_value)
H5F_fake_free(f);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_fake_alloc() */
/*-------------------------------------------------------------------------
* Function: H5F_fake_free
*
* Purpose: Free a "fake" file structure.
*
* Return: Success: non-negative
* Failure: negative
*
* Programmer: Quincey Koziol
* Oct 2, 2006
*
*-------------------------------------------------------------------------
*/
herr_t
H5F_fake_free(H5F_t *f)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Free faked file struct */
if (f) {
/* Destroy shared file struct */
if (f->shared)
f->shared = H5FL_FREE(H5F_shared_t, f->shared);
f = H5FL_FREE(H5F_t, f);
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5F_fake_free() */
|
/*
* httpconnect.h - HTTP "CONNECT" proxy
* Copyright (C) 2003 Justin Karneges
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef CS_HTTPCONNECT_H
#define CS_HTTPCONNECT_H
#include "bytestream.h"
// CS_NAMESPACE_BEGIN
class HttpConnect : public ByteStream
{
Q_OBJECT
public:
enum Error { ErrConnectionRefused = ErrCustom, ErrHostNotFound, ErrProxyConnect, ErrProxyNeg, ErrProxyAuth };
HttpConnect(QObject *parent=0);
~HttpConnect();
void setAuth(const QString &user, const QString &pass="");
void connectToHost(const QString &proxyHost, int proxyPort, const QString &host, int port);
// from ByteStream
void close();
qint64 bytesToWrite() const;
protected:
qint64 writeData(const char *data, qint64 maxSize);
signals:
void connected();
private slots:
void sock_connected();
void sock_connectionClosed();
void sock_delayedCloseFinished();
void sock_readyRead();
void sock_bytesWritten(qint64);
void sock_error(int);
private:
class Private;
Private *d;
void resetConnection(bool clear=false);
};
// CS_NAMESPACE_END
#endif
|
/*
* Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 "../AmazonServiceRequest.h"
#import "ElasticLoadBalancingRequest.h"
#import "ElasticLoadBalancingDescribeInstanceHealthRequest.h"
#import "ElasticLoadBalancingInstance.h"
/**
* Describe Instance Health Request Marshaller
*/
@interface ElasticLoadBalancingDescribeInstanceHealthRequestMarshaller:NSObject {
}
+(AmazonServiceRequest *)createRequest:(ElasticLoadBalancingDescribeInstanceHealthRequest *)describeInstanceHealthRequest;
@end
|
/*
This file is part of ALIZE which is an open-source tool for
speaker recognition.
ALIZE 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 any later version.
ALIZE 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 ALIZE.
If not, see <http://www.gnu.org/licenses/>.
ALIZE is a development project initiated by the ELISA consortium
[alize.univ-avignon.fr/] and funded by the French Research
Ministry in the framework of the TECHNOLANGUE program
[www.technolangue.net]
The ALIZE project team wants to highlight the limits of voice
authentication in a forensic context.
The "Person Authentification by Voice: A Need of Caution" paper
proposes a good overview of this point (cf. "Person
Authentification by Voice: A Need of Caution", Bonastre J.F.,
Bimbot F., Boe L.J., Campbell J.P., Douglas D.A., Magrin-
chagnolleau I., Eurospeech 2003, Genova].
The conclusion of the paper of the paper is proposed bellow:
[Currently, it is not possible to completely determine whether the
similarity between two recordings is due to the speaker or to other
factors, especially when: (a) the speaker does not cooperate, (b) there
is no control over recording equipment, (c) recording conditions are not
known, (d) one does not know whether the voice was disguised and, to a
lesser extent, (e) the linguistic content of the message is not
controlled. Caution and judgment must be exercised when applying speaker
recognition techniques, whether human or automatic, to account for these
uncontrolled factors. Under more constrained or calibrated situations,
or as an aid for investigative purposes, judicious application of these
techniques may be suitable, provided they are not considered as infallible.
At the present time, there is no scientific process that enables one to
uniquely characterize a person=92s voice or to identify with absolute
certainty an individual from his or her voice.]
Contact Jean-Francois Bonastre for more information about the licence or
the use of ALIZE
Copyright (C) 2003-2010
Laboratoire d'informatique d'Avignon [lia.univ-avignon.fr]
ALIZE admin [alize@univ-avignon.fr]
Jean-Francois Bonastre [jean-francois.bonastre@univ-avignon.fr]
*/
#if !defined(ALIZE_MixtureFileWriter_h)
#define ALIZE_MixtureFileWriter_h
#if defined(_WIN32)
#if defined(ALIZE_EXPORTS)
#define ALIZE_API __declspec(dllexport)
#else
#define ALIZE_API __declspec(dllimport)
#endif
#else
#define ALIZE_API
#endif
#include "FileWriter.h"
namespace alize
{
class Mixture;
class MixtureGD;
class Config;
class MixtureGF;
/// Convenient class used to save 1 mixture in a raw or xml file
///
/// @author Frederic Wils frederic.wils@lia.univ-avignon.fr
/// @version 1.0
/// @date 2003
class ALIZE_API MixtureFileWriter : public FileWriter
{
public :
/// Create a new MixtureFileWriter object to save a mixture
/// in a file
/// @param f the name of the file
/// @param c the configuration to use
///
explicit MixtureFileWriter(const FileName& f, const Config& c);
virtual ~MixtureFileWriter();
/// Write a mixture to the file
/// @param mixture the mixture to save
/// @exception IOException if an I/O error occurs
virtual void writeMixture(const Mixture& mixture);
virtual String getClassName() const;
private :
const Config& _config;
String getFullFileName(const Config&, const FileName&) const;
void writeMixtureGD_XML(const MixtureGD&);
void writeMixtureGD_RAW(const MixtureGD&);
void writeMixtureGD_ETAT(const MixtureGD&);
void writeMixtureGF_XML(const MixtureGF&);
void writeMixtureGF_RAW(const MixtureGF&);
MixtureFileWriter(const MixtureFileWriter&); /*!Not implemented*/
const MixtureFileWriter& operator=(
const MixtureFileWriter&); /*!Not implemented*/
bool operator==(const MixtureFileWriter&) const; /*!Not implemented*/
bool operator!=(const MixtureFileWriter&) const; /*!Not implemented*/
};
} // end namespace alize
#endif // !defined(ALIZE_MixtureFileWriter_h)
|
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_KERNELS_EIG_OP_IMPL_H_
#define TENSORFLOW_CORE_KERNELS_EIG_OP_IMPL_H_
// See docs in ../ops/linalg_ops.cc.
#include "third_party/eigen3/Eigen/Core"
#include "third_party/eigen3/Eigen/Eigenvalues"
#include "tensorflow/core/framework/kernel_def_builder.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/tensor_shape.h"
#include "tensorflow/core/kernels/linalg_ops_common.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/platform/denormal.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/types.h"
namespace tensorflow {
template <class InputScalar, class OutputScalar>
class EigOp : public LinearAlgebraOp<InputScalar, OutputScalar> {
public:
typedef LinearAlgebraOp<InputScalar, OutputScalar> Base;
explicit EigOp(OpKernelConstruction* context) : Base(context) {
OP_REQUIRES_OK(context, context->GetAttr("compute_v", &compute_v_));
}
using TensorShapes = typename Base::TensorShapes;
using InputMatrix = typename Base::InputMatrix;
using InputMatrixMaps = typename Base::InputMatrixMaps;
using InputConstMatrixMap = typename Base::InputConstMatrixMap;
using InputConstMatrixMaps = typename Base::InputConstMatrixMaps;
using OutputMatrix = typename Base::OutputMatrix;
using OutputMatrixMaps = typename Base::OutputMatrixMaps;
using OutputConstMatrixMap = typename Base::OutputConstMatrixMap;
using OutputConstMatrixMaps = typename Base::OutputConstMatrixMaps;
TensorShapes GetOutputMatrixShapes(
const TensorShapes& input_matrix_shapes) const final {
int64 n = input_matrix_shapes[0].dim_size(0);
if (compute_v_) {
return TensorShapes({TensorShape({n}), TensorShape({n, n})});
} else {
return TensorShapes({TensorShape({n})});
}
}
void ComputeMatrix(OpKernelContext* context,
const InputConstMatrixMaps& inputs,
OutputMatrixMaps* outputs) final {
const int64 rows = inputs[0].rows();
if (rows == 0) {
// If X is an empty matrix (0 rows, 0 col), X * X' == X.
// Therefore, we return X.
return;
}
// This algorithm relies on denormals, so switch them back on locally.
port::ScopedDontFlushDenormal dont_flush_denormals;
Eigen::ComplexEigenSolver<OutputMatrix> eig(
inputs[0],
compute_v_ ? Eigen::ComputeEigenvectors : Eigen::EigenvaluesOnly);
// TODO(rmlarsen): Output more detailed error info on failure.
OP_REQUIRES(
context, eig.info() == Eigen::Success,
errors::InvalidArgument("Eigen decomposition was not "
"successful. The input might not be valid."));
outputs->at(0) = eig.eigenvalues().template cast<OutputScalar>();
if (compute_v_) {
outputs->at(1) = eig.eigenvectors();
}
}
private:
bool compute_v_;
};
} // namespace tensorflow
#endif // TENSORFLOW_CORE_KERNELS_EIG_OP_IMPL_H_
|
#ifndef _INCLUDED_CAMPAIGN_FRAME_H
#define _INCLUDED_CAMPAIGN_FRAME_H
#ifdef _WIN32
#pragma once
#endif
#include <vgui_controls/Frame.h>
class CampaignPanel;
// frame used to hold the campaign screen panels
class CampaignFrame : public vgui::Frame
{
DECLARE_CLASS_SIMPLE( CampaignFrame, vgui::Frame );
CampaignFrame(Panel *parent, const char *panelName, bool showTaskbarIcon = true);
virtual ~CampaignFrame();
virtual void PerformLayout();
virtual void ApplySchemeSettings( vgui::IScheme *scheme );
CampaignPanel* m_pCampaignPanel;
};
#endif // _INCLUDED_CAMPAIGN_FRAME_H
|
#import "MWMButton.h"
#import "MWMCircularProgress.h"
@interface MWMCircularProgressView : UIView
@property(nonatomic, readonly) BOOL animating;
@property(nonatomic) MWMCircularProgressState state;
@property(nonatomic) BOOL isInvertColor;
- (nonnull instancetype)initWithFrame:(CGRect)frame
__attribute__((unavailable("initWithFrame is not available")));
- (nonnull instancetype)init __attribute__((unavailable("init is not available")));
- (void)setSpinnerColoring:(MWMImageColoring)coloring;
- (void)setSpinnerBackgroundColor:(nonnull UIColor *)backgroundColor;
- (void)setImageName:(nonnull NSString *)imageName forState:(MWMCircularProgressState)state;
- (void)setColor:(nonnull UIColor *)color forState:(MWMCircularProgressState)state;
- (void)setColoring:(MWMButtonColoring)coloring forState:(MWMCircularProgressState)state;
- (void)animateFromValue:(CGFloat)fromValue toValue:(CGFloat)toValue;
- (void)updatePath:(CGFloat)progress;
@end
|
/*
* Copyright (c) 2002 - 2005 NetGroup, Politecnico di Torino (Italy)
* Copyright (c) 2005 - 2009 CACE Technologies, Inc. Davis (California)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Politecnico di Torino 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.
*
* @(#) $Header: /tcpdump/master/libpcap/pcap-stdinc.h,v 1.10.2.1 2008-10-06 15:38:39 gianluca Exp $ (LBL)
*/
#define SIZEOF_CHAR 1
#define SIZEOF_SHORT 2
#define SIZEOF_INT 4
#ifndef _MSC_EXTENSIONS
#define SIZEOF_LONG_LONG 8
#endif
/*
* Avoids a compiler warning in case this was already defined
* (someone defined _WINSOCKAPI_ when including 'windows.h', in order
* to prevent it from including 'winsock.h')
*/
#ifdef _WINSOCKAPI_
#undef _WINSOCKAPI_
#endif
#include <winsock2.h>
#include <fcntl.h>
#include "bittypes.h"
#include <time.h>
#include <io.h>
#ifndef __MINGW32__
#include "IP6_misc.h"
#endif
#define caddr_t char*
#if _MSC_VER < 1500
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#define strdup _strdup
#endif
#define inline __inline
#ifdef __MINGW32__
#include <stdint.h>
#else /*__MINGW32__*/
/* MSVC compiler */
#ifndef _UINTPTR_T_DEFINED
#ifdef _WIN64
typedef unsigned __int64 uintptr_t;
#else
typedef _W64 unsigned int uintptr_t;
#endif
#define _UINTPTR_T_DEFINED
#endif
#ifndef _INTPTR_T_DEFINED
#ifdef _WIN64
typedef __int64 intptr_t;
#else
typedef _W64 int intptr_t;
#endif
#define _INTPTR_T_DEFINED
#endif
#endif /*__MINGW32__*/
|
// 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 COMPONENTS_EXO_TOUCH_H_
#define COMPONENTS_EXO_TOUCH_H_
#include "base/containers/flat_map.h"
#include "components/exo/surface_observer.h"
#include "ui/events/event_handler.h"
#include "ui/gfx/geometry/point_f.h"
namespace ui {
class LocatedEvent;
class TouchEvent;
}
namespace exo {
class Seat;
class TouchDelegate;
class TouchStylusDelegate;
// This class implements a client touch device that represents one or more
// touch devices.
class Touch : public ui::EventHandler, public SurfaceObserver {
public:
Touch(TouchDelegate* delegate, Seat* seat);
Touch(const Touch&) = delete;
Touch& operator=(const Touch&) = delete;
~Touch() override;
TouchDelegate* delegate() const { return delegate_; }
// Set delegate for stylus events.
void SetStylusDelegate(TouchStylusDelegate* delegate);
bool HasStylusDelegate() const;
// Overridden from ui::EventHandler:
void OnTouchEvent(ui::TouchEvent* event) override;
// Overridden from SurfaceObserver:
void OnSurfaceDestroying(Surface* surface) override;
private:
// Returns the effective target for |event|.
Surface* GetEffectiveTargetForEvent(ui::LocatedEvent* event) const;
// Cancels touches on all the surfaces.
void CancelAllTouches();
// The delegate instance that all events are dispatched to.
TouchDelegate* const delegate_;
Seat* const seat_;
// The delegate instance that all stylus related events are dispatched to.
TouchStylusDelegate* stylus_delegate_ = nullptr;
// Map of touch points to its focus surface.
base::flat_map<int, Surface*> touch_points_surface_map_;
// Map of a touched surface to the count of touch pointers on that surface.
base::flat_map<Surface*, int> surface_touch_count_map_;
};
} // namespace exo
#endif // COMPONENTS_EXO_TOUCH_H_
|
/*
* Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2007 Alp Toker <alp@atoker.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. 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 CanvasGradient_h
#define CanvasGradient_h
#include "bindings/core/v8/ScriptWrappable.h"
#include "platform/graphics/Gradient.h"
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
namespace blink {
class ExceptionState;
class CanvasGradient final : public RefCountedWillBeGarbageCollectedFinalized<CanvasGradient>, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
static PassRefPtrWillBeRawPtr<CanvasGradient> create(const FloatPoint& p0, const FloatPoint& p1)
{
return adoptRefWillBeNoop(new CanvasGradient(p0, p1));
}
static PassRefPtrWillBeRawPtr<CanvasGradient> create(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1)
{
return adoptRefWillBeNoop(new CanvasGradient(p0, r0, p1, r1));
}
Gradient* gradient() const { return m_gradient.get(); }
void addColorStop(float value, const String& color, ExceptionState&);
void trace(Visitor*) { }
private:
CanvasGradient(const FloatPoint& p0, const FloatPoint& p1);
CanvasGradient(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1);
RefPtr<Gradient> m_gradient;
};
} // namespace blink
#endif // CanvasGradient_h
|
/*
* Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. 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 TextCodec_h
#define TextCodec_h
#include "wtf/Forward.h"
#include "wtf/Noncopyable.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/text/WTFString.h"
#include "wtf/unicode/Unicode.h"
namespace WTF {
class TextEncoding;
// Specifies what will happen when a character is encountered that is
// not encodable in the character set.
enum UnencodableHandling {
// Substitutes the replacement character "?".
QuestionMarksForUnencodables,
// Encodes the character as an XML entity. For example, U+06DE
// would be "۞" (0x6DE = 1758 in octal).
EntitiesForUnencodables,
// Encodes the character as en entity as above, but escaped
// non-alphanumeric characters. This is used in URLs.
// For example, U+6DE would be "%26%231758%3B".
URLEncodedEntitiesForUnencodables
};
typedef char UnencodableReplacementArray[32];
enum FlushBehavior {
// More bytes are coming, don't flush the codec.
DoNotFlush = 0,
// A fetch has hit EOF. Some codecs handle fetches differently, for compat reasons.
FetchEOF,
// Do a full flush of the codec.
DataEOF
};
static_assert(!DoNotFlush, "DoNotFlush should be falsy");
static_assert(FetchEOF, "FetchEOF should be truthy");
static_assert(DataEOF, "DataEOF should be truthy");
class TextCodec {
WTF_MAKE_NONCOPYABLE(TextCodec); WTF_MAKE_FAST_ALLOCATED;
public:
TextCodec() { }
virtual ~TextCodec();
String decode(const char* str, size_t length, FlushBehavior flush = DoNotFlush)
{
bool ignored;
return decode(str, length, flush, false, ignored);
}
virtual String decode(const char*, size_t length, FlushBehavior, bool stopOnError, bool& sawError) = 0;
virtual CString encode(const UChar*, size_t length, UnencodableHandling) = 0;
virtual CString encode(const LChar*, size_t length, UnencodableHandling) = 0;
// Fills a null-terminated string representation of the given
// unencodable character into the given replacement buffer.
// The length of the string (not including the null) will be returned.
static int getUnencodableReplacement(unsigned codePoint, UnencodableHandling, UnencodableReplacementArray);
};
typedef void (*EncodingNameRegistrar)(const char* alias, const char* name);
typedef PassOwnPtr<TextCodec> (*NewTextCodecFunction)(const TextEncoding&, const void* additionalData);
typedef void (*TextCodecRegistrar)(const char* name, NewTextCodecFunction, const void* additionalData);
} // namespace WTF
using WTF::TextCodec;
#endif // TextCodec_h
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_
#define EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_
#include <string>
#include <vector>
#include "base/macros.h"
#include "base/memory/linked_ptr.h"
namespace gfx {
class Display;
class Screen;
}
namespace extensions {
namespace api {
namespace system_display {
struct DisplayProperties;
struct DisplayUnitInfo;
}
}
typedef std::vector<linked_ptr<api::system_display::DisplayUnitInfo>>
DisplayInfo;
class DisplayInfoProvider {
public:
virtual ~DisplayInfoProvider();
// Returns a pointer to DisplayInfoProvider or NULL if Create()
// or InitializeForTesting() or not called yet.
static DisplayInfoProvider* Get();
// This is for tests that run in its own process (e.g. browser_tests).
// Using this in other tests (e.g. unit_tests) will result in DCHECK failure.
static void InitializeForTesting(DisplayInfoProvider* display_info_provider);
// Updates the display with |display_id| according to |info|. Returns whether
// the display was successfully updated. On failure, no display parameters
// should be changed, and |error| should be set to the error string.
virtual bool SetInfo(const std::string& display_id,
const api::system_display::DisplayProperties& info,
std::string* error) = 0;
// Get the screen that is always active, which will be used for monitoring
// display changes events.
virtual gfx::Screen* GetActiveScreen() = 0;
// Enable the unified desktop feature.
virtual void EnableUnifiedDesktop(bool enable);
DisplayInfo GetAllDisplaysInfo();
protected:
DisplayInfoProvider();
private:
static DisplayInfoProvider* Create();
// Update the content of the |unit| obtained for |display| using
// platform specific method.
virtual void UpdateDisplayUnitInfoForPlatform(
const gfx::Display& display,
api::system_display::DisplayUnitInfo* unit) = 0;
DISALLOW_COPY_AND_ASSIGN(DisplayInfoProvider);
};
} // namespace extensions
#endif // EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_
|
/* Capstone Disassembly Engine */
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
#ifdef CAPSTONE_HAS_SPARC
#include "../../utils.h"
#include "../../MCRegisterInfo.h"
#include "SparcDisassembler.h"
#include "SparcInstPrinter.h"
#include "SparcMapping.h"
static cs_err init(cs_struct *ud)
{
MCRegisterInfo *mri;
// verify if requested mode is valid
if (ud->mode & ~(CS_MODE_BIG_ENDIAN | CS_MODE_V9))
return CS_ERR_MODE;
mri = cs_mem_malloc(sizeof(*mri));
Sparc_init(mri);
ud->printer = Sparc_printInst;
ud->printer_info = mri;
ud->getinsn_info = mri;
ud->disasm = Sparc_getInstruction;
ud->post_printer = Sparc_post_printer;
ud->reg_name = Sparc_reg_name;
ud->insn_id = Sparc_get_insn_id;
ud->insn_name = Sparc_insn_name;
ud->group_name = Sparc_group_name;
return CS_ERR_OK;
}
static cs_err option(cs_struct *handle, cs_opt_type type, size_t value)
{
if (type == CS_OPT_SYNTAX)
handle->syntax = (int) value;
return CS_ERR_OK;
}
void Sparc_enable(void)
{
arch_init[CS_ARCH_SPARC] = init;
arch_option[CS_ARCH_SPARC] = option;
// support this arch
all_arch |= (1 << CS_ARCH_SPARC);
}
#endif
|
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
*
* Copyright 2008-2016 Freescale Semiconductor Inc.
* Copyright 2016,2019 NXP
*/
#ifndef __RTA_STORE_CMD_H__
#define __RTA_STORE_CMD_H__
extern enum rta_sec_era rta_sec_era;
static const uint32_t store_src_table[][2] = {
/*1*/ { KEY1SZ, LDST_CLASS_1_CCB | LDST_SRCDST_WORD_KEYSZ_REG },
{ KEY2SZ, LDST_CLASS_2_CCB | LDST_SRCDST_WORD_KEYSZ_REG },
{ DJQDA, LDST_CLASS_DECO | LDST_SRCDST_WORD_DECO_JQDAR },
{ MODE1, LDST_CLASS_1_CCB | LDST_SRCDST_WORD_MODE_REG },
{ MODE2, LDST_CLASS_2_CCB | LDST_SRCDST_WORD_MODE_REG },
{ DJQCTRL, LDST_CLASS_DECO | LDST_SRCDST_WORD_DECO_JQCTRL },
{ DATA1SZ, LDST_CLASS_1_CCB | LDST_SRCDST_WORD_DATASZ_REG },
{ DATA2SZ, LDST_CLASS_2_CCB | LDST_SRCDST_WORD_DATASZ_REG },
{ DSTAT, LDST_CLASS_DECO | LDST_SRCDST_WORD_DECO_STAT },
{ ICV1SZ, LDST_CLASS_1_CCB | LDST_SRCDST_WORD_ICVSZ_REG },
{ ICV2SZ, LDST_CLASS_2_CCB | LDST_SRCDST_WORD_ICVSZ_REG },
{ DPID, LDST_CLASS_DECO | LDST_SRCDST_WORD_PID },
{ CCTRL, LDST_SRCDST_WORD_CHACTRL },
{ ICTRL, LDST_SRCDST_WORD_IRQCTRL },
{ CLRW, LDST_SRCDST_WORD_CLRW },
{ MATH0, LDST_CLASS_DECO | LDST_SRCDST_WORD_DECO_MATH0 },
{ CSTAT, LDST_SRCDST_WORD_STAT },
{ MATH1, LDST_CLASS_DECO | LDST_SRCDST_WORD_DECO_MATH1 },
{ MATH2, LDST_CLASS_DECO | LDST_SRCDST_WORD_DECO_MATH2 },
{ AAD1SZ, LDST_CLASS_1_CCB | LDST_SRCDST_WORD_DECO_AAD_SZ },
{ MATH3, LDST_CLASS_DECO | LDST_SRCDST_WORD_DECO_MATH3 },
{ IV1SZ, LDST_CLASS_1_CCB | LDST_SRCDST_WORD_CLASS1_IV_SZ },
{ PKASZ, LDST_CLASS_1_CCB | LDST_SRCDST_WORD_PKHA_A_SZ },
{ PKBSZ, LDST_CLASS_1_CCB | LDST_SRCDST_WORD_PKHA_B_SZ },
{ PKESZ, LDST_CLASS_1_CCB | LDST_SRCDST_WORD_PKHA_E_SZ },
{ PKNSZ, LDST_CLASS_1_CCB | LDST_SRCDST_WORD_PKHA_N_SZ },
{ CONTEXT1, LDST_CLASS_1_CCB | LDST_SRCDST_BYTE_CONTEXT },
{ CONTEXT2, LDST_CLASS_2_CCB | LDST_SRCDST_BYTE_CONTEXT },
{ DESCBUF, LDST_CLASS_DECO | LDST_SRCDST_WORD_DESCBUF },
/*30*/ { JOBDESCBUF, LDST_CLASS_DECO | LDST_SRCDST_WORD_DESCBUF_JOB },
{ SHAREDESCBUF, LDST_CLASS_DECO | LDST_SRCDST_WORD_DESCBUF_SHARED },
/*32*/ { JOBDESCBUF_EFF, LDST_CLASS_DECO |
LDST_SRCDST_WORD_DESCBUF_JOB_WE },
{ SHAREDESCBUF_EFF, LDST_CLASS_DECO |
LDST_SRCDST_WORD_DESCBUF_SHARED_WE },
/*34*/ { GTR, LDST_CLASS_DECO | LDST_SRCDST_WORD_GTR },
{ STR, LDST_CLASS_DECO | LDST_SRCDST_WORD_STR }
};
/*
* Allowed STORE sources for each SEC ERA.
* Values represent the number of entries from source_src_table[] that are
* supported.
*/
static const unsigned int store_src_table_sz[] = {29, 31, 33, 33,
33, 33, 35, 35,
35, 35};
static inline int
rta_store(struct program *program, uint64_t src,
uint16_t offset, uint64_t dst, uint32_t length,
uint32_t flags)
{
uint32_t opcode = 0, val;
int ret = -EINVAL;
unsigned int start_pc = program->current_pc;
if (flags & SEQ)
opcode = CMD_SEQ_STORE;
else
opcode = CMD_STORE;
/* parameters check */
if ((flags & IMMED) && (flags & SGF)) {
pr_err("STORE: Invalid flag. SEC PC: %d; Instr: %d\n",
program->current_pc, program->current_instruction);
goto err;
}
if ((flags & IMMED) && (offset != 0)) {
pr_err("STORE: Invalid flag. SEC PC: %d; Instr: %d\n",
program->current_pc, program->current_instruction);
goto err;
}
if ((flags & SEQ) && ((src == JOBDESCBUF) || (src == SHAREDESCBUF) ||
(src == JOBDESCBUF_EFF) ||
(src == SHAREDESCBUF_EFF))) {
pr_err("STORE: Invalid SRC type. SEC PC: %d; Instr: %d\n",
program->current_pc, program->current_instruction);
goto err;
}
if (flags & IMMED)
opcode |= LDST_IMM;
if ((flags & SGF) || (flags & VLF))
opcode |= LDST_VLF;
/*
* source for data to be stored can be specified as:
* - register location; set in src field[9-15];
* - if IMMED flag is set, data is set in value field [0-31];
* user can give this value as actual value or pointer to data
*/
if (!(flags & IMMED)) {
ret = __rta_map_opcode((uint32_t)src, store_src_table,
store_src_table_sz[rta_sec_era], &val);
if (ret < 0) {
pr_err("STORE: Invalid source. SEC PC: %d; Instr: %d\n",
program->current_pc,
program->current_instruction);
goto err;
}
opcode |= val;
}
/* DESC BUFFER: length / offset values are specified in 4-byte words */
if ((src == DESCBUF) || (src == JOBDESCBUF) || (src == SHAREDESCBUF) ||
(src == JOBDESCBUF_EFF) || (src == SHAREDESCBUF_EFF)) {
opcode |= (length >> 2);
opcode |= (uint32_t)((offset >> 2) << LDST_OFFSET_SHIFT);
} else {
opcode |= length;
opcode |= (uint32_t)(offset << LDST_OFFSET_SHIFT);
}
__rta_out32(program, opcode);
program->current_instruction++;
if ((src == JOBDESCBUF) || (src == SHAREDESCBUF) ||
(src == JOBDESCBUF_EFF) || (src == SHAREDESCBUF_EFF))
return (int)start_pc;
/* for STORE, a pointer to where the data will be stored if needed */
if (!(flags & SEQ))
__rta_out64(program, program->ps, dst);
/* for IMMED data, place the data here */
if (flags & IMMED)
__rta_inline_data(program, src, flags & __COPY_MASK, length);
return (int)start_pc;
err:
program->first_error_pc = start_pc;
program->current_instruction++;
return ret;
}
#endif /* __RTA_STORE_CMD_H__ */
|
/*
*/
#include <linux/init.h>
#include <linux/cache.h>
#include <linux/sched.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <asm/io.h>
#include "proto.h"
#include "irq_impl.h"
/* */
static unsigned int cached_irq_mask = 0xffff;
static DEFINE_SPINLOCK(i8259_irq_lock);
static inline void
i8259_update_irq_hw(unsigned int irq, unsigned long mask)
{
int port = 0x21;
if (irq & 8) mask >>= 8;
if (irq & 8) port = 0xA1;
outb(mask, port);
}
inline void
i8259a_enable_irq(struct irq_data *d)
{
spin_lock(&i8259_irq_lock);
i8259_update_irq_hw(d->irq, cached_irq_mask &= ~(1 << d->irq));
spin_unlock(&i8259_irq_lock);
}
static inline void
__i8259a_disable_irq(unsigned int irq)
{
i8259_update_irq_hw(irq, cached_irq_mask |= 1 << irq);
}
void
i8259a_disable_irq(struct irq_data *d)
{
spin_lock(&i8259_irq_lock);
__i8259a_disable_irq(d->irq);
spin_unlock(&i8259_irq_lock);
}
void
i8259a_mask_and_ack_irq(struct irq_data *d)
{
unsigned int irq = d->irq;
spin_lock(&i8259_irq_lock);
__i8259a_disable_irq(irq);
/* */
if (irq >= 8) {
outb(0xE0 | (irq - 8), 0xa0); /* */
irq = 2;
}
outb(0xE0 | irq, 0x20); /* */
spin_unlock(&i8259_irq_lock);
}
struct irq_chip i8259a_irq_type = {
.name = "XT-PIC",
.irq_unmask = i8259a_enable_irq,
.irq_mask = i8259a_disable_irq,
.irq_mask_ack = i8259a_mask_and_ack_irq,
};
void __init
init_i8259a_irqs(void)
{
static struct irqaction cascade = {
.handler = no_action,
.name = "cascade",
};
long i;
outb(0xff, 0x21); /* */
outb(0xff, 0xA1); /* */
for (i = 0; i < 16; i++) {
irq_set_chip_and_handler(i, &i8259a_irq_type, handle_level_irq);
}
setup_irq(2, &cascade);
}
#if defined(CONFIG_ALPHA_GENERIC)
# define IACK_SC alpha_mv.iack_sc
#elif defined(CONFIG_ALPHA_APECS)
# define IACK_SC APECS_IACK_SC
#elif defined(CONFIG_ALPHA_LCA)
# define IACK_SC LCA_IACK_SC
#elif defined(CONFIG_ALPHA_CIA)
# define IACK_SC CIA_IACK_SC
#elif defined(CONFIG_ALPHA_PYXIS)
# define IACK_SC PYXIS_IACK_SC
#elif defined(CONFIG_ALPHA_TITAN)
# define IACK_SC TITAN_IACK_SC
#elif defined(CONFIG_ALPHA_TSUNAMI)
# define IACK_SC TSUNAMI_IACK_SC
#elif defined(CONFIG_ALPHA_IRONGATE)
# define IACK_SC IRONGATE_IACK_SC
#endif
/*
*/
#if defined(IACK_SC)
void
isa_device_interrupt(unsigned long vector)
{
/*
*/
int j = *(vuip) IACK_SC;
j &= 0xff;
handle_irq(j);
}
#endif
#if defined(CONFIG_ALPHA_GENERIC) || !defined(IACK_SC)
void
isa_no_iack_sc_device_interrupt(unsigned long vector)
{
unsigned long pic;
/*
*/
/*
*/
pic = inb(0x20) | (inb(0xA0) << 8); /* */
pic &= 0xFFFB; /* */
while (pic) {
int j = ffz(~pic);
pic &= pic - 1;
handle_irq(j);
}
}
#endif
|
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(lj/charmm/coul/msm,PairLJCharmmCoulMSM)
#else
#ifndef LMP_PAIR_LJ_CHARMM_COUL_MSM_H
#define LMP_PAIR_LJ_CHARMM_COUL_MSM_H
#include "pair_lj_charmm_coul_long.h"
namespace LAMMPS_NS {
class PairLJCharmmCoulMSM : public PairLJCharmmCoulLong {
public:
PairLJCharmmCoulMSM(class LAMMPS *);
virtual ~PairLJCharmmCoulMSM(){};
virtual void compute(int, int);
virtual double single(int, int, int, int, double, double, double, double &);
virtual void compute_outer(int, int);
virtual void *extract(const char *, int &);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Incorrect args for pair coefficients
Self-explanatory. Check the input script or data file.
E: Pair style lj/charmm/coul/long requires atom attribute q
The atom style defined does not have these attributes.
E: Pair inner cutoff >= Pair outer cutoff
The specified cutoffs for the pair style are inconsistent.
E: Pair cutoff < Respa interior cutoff
One or more pairwise cutoffs are too short to use with the specified
rRESPA cutoffs.
E: Pair inner cutoff < Respa interior cutoff
One or more pairwise cutoffs are too short to use with the specified
rRESPA cutoffs.
E: Pair style is incompatible with KSpace style
If a pair style with a long-range Coulombic component is selected,
then a kspace style must also be used.
*/
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager -- Network link manager
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2011 Red Hat, Inc.
*/
#ifndef NM_FIREWALL_MANAGER_H
#define NM_FIREWALL_MANAGER_H
#include <glib-object.h>
#include <dbus/dbus-glib.h>
#define FIREWALL_DBUS_SERVICE "org.fedoraproject.FirewallD1"
#define FIREWALL_DBUS_PATH "/org/fedoraproject/FirewallD1"
#define FIREWALL_DBUS_INTERFACE "org.fedoraproject.FirewallD1"
#define FIREWALL_DBUS_INTERFACE_ZONE "org.fedoraproject.FirewallD1.zone"
G_BEGIN_DECLS
#define NM_TYPE_FIREWALL_MANAGER (nm_firewall_manager_get_type ())
#define NM_FIREWALL_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_FIREWALL_MANAGER, NMFirewallManager))
#define NM_FIREWALL_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_FIREWALL_MANAGER, NMFirewallManagerClass))
#define NM_IS_FIREWALL_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_FIREWALL_MANAGER))
#define NM_IS_FIREWALL_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_FIREWALL_MANAGER))
#define NM_FIREWALL_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_FIREWALL_MANAGER, NMFirewallManagerClass))
#define NM_FIREWALL_MANAGER_AVAILABLE "available"
typedef struct {
GObject parent;
} NMFirewallManager;
typedef struct {
GObjectClass parent;
/* Signals */
void (*started) (NMFirewallManager *manager);
} NMFirewallManagerClass;
GType nm_firewall_manager_get_type (void);
NMFirewallManager *nm_firewall_manager_get (void);
typedef void (*FwAddToZoneFunc) (GError *error, gpointer user_data);
gpointer nm_firewall_manager_add_or_change_zone (NMFirewallManager *mgr,
const char *iface,
const char *zone,
gboolean add,
FwAddToZoneFunc callback,
gpointer user_data);
gpointer nm_firewall_manager_remove_from_zone (NMFirewallManager *mgr,
const char *iface,
const char *zone);
void nm_firewall_manager_cancel_call (NMFirewallManager *mgr, gpointer fw_call);
#endif /* NM_FIREWALL_MANAGER_H */
|
#include <lwk/types.h>
long
sys_getgroups(int n, gid_t gids[])
{
return 0;
}
|
/*
$Id: sdt.h,v 1.5 2006/01/02 18:24:24 rasc Exp $
DVBSNOOP
a dvb sniffer and mpeg2 stream analyzer tool
http://dvbsnoop.sourceforge.net/
(c) 2001-2006 Rainer.Scherg@gmx.de (rasc)
*/
void section_SDT (u_char *b, int len);
|
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2008
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
#ifndef __MTK_WDT_H__
#define __MTK_WDT_H__
#define ENABLE_WDT_MODULE (1) // Module switch
#define LK_WDT_DISABLE (0)
#define MTK_WDT_BASE TOPRGU_BASE
#define MTK_WDT_MODE (MTK_WDT_BASE+0x0000)
#define MTK_WDT_LENGTH (MTK_WDT_BASE+0x0004)
#define MTK_WDT_RESTART (MTK_WDT_BASE+0x0008)
#define MTK_WDT_STATUS (MTK_WDT_BASE+0x000C)
#define MTK_WDT_INTERVAL (MTK_WDT_BASE+0x0010)
#define MTK_WDT_SWRST (MTK_WDT_BASE+0x0014)
#define MTK_WDT_SWSYSRST (MTK_WDT_BASE+0x0018)
#define MTK_WDT_NONRST_REG (MTK_WDT_BASE+0x0020)
#define MTK_WDT_NONRST_REG2 (MTK_WDT_BASE+0x0024)
#define MTK_WDT_REQ_MODE (MTK_WDT_BASE+0x0030)
#define MTK_WDT_REQ_IRQ_EN (MTK_WDT_BASE+0x0034)
#define MTK_WDT_DRAMC_CTL (MTK_WDT_BASE+0x0040)
/*WDT_MODE*/
#define MTK_WDT_MODE_KEYMASK (0xff00)
#define MTK_WDT_MODE_KEY (0x22000000)
#define MTK_WDT_MODE_DUAL_MODE (0x0040)
#define MTK_WDT_MODE_IN_DIS (0x0020) /* Reserved */
#define MTK_WDT_MODE_AUTO_RESTART (0x0010) /* Reserved */
#define MTK_WDT_MODE_IRQ (0x0008)
#define MTK_WDT_MODE_EXTEN (0x0004)
#define MTK_WDT_MODE_EXT_POL (0x0002)
#define MTK_WDT_MODE_ENABLE (0x0001)
/*WDT_LENGTH*/
#define MTK_WDT_LENGTH_TIME_OUT (0xffe0)
#define MTK_WDT_LENGTH_KEYMASK (0x001f)
#define MTK_WDT_LENGTH_KEY (0x0008)
/*WDT_RESTART*/
#define MTK_WDT_RESTART_KEY (0x1971)
/*WDT_STATUS*/
#define MTK_WDT_STATUS_HWWDT_RST (0x80000000)
#define MTK_WDT_STATUS_SWWDT_RST (0x40000000)
#define MTK_WDT_STATUS_IRQWDT_RST (0x20000000)
#define MTK_WDT_STATUS_DEBUGWDT_RST (0x00080000)
#define MTK_WDT_STATUS_SPMWDT_RST (0x0001)
/*WDT_INTERVAL*/
#define MTK_WDT_INTERVAL_MASK (0x0fff)
/*WDT_SWRST*/
#define MTK_WDT_SWRST_KEY (0x1209)
/*WDT_SWSYSRST*/
#define MTK_WDT_SWSYS_RST_PWRAP_SPI_CTL_RST (0x0800)
#define MTK_WDT_SWSYS_RST_APMIXED_RST (0x0400)
#define MTK_WDT_SWSYS_RST_MD_LITE_RST (0x0200)
#define MTK_WDT_SWSYS_RST_INFRA_AO_RST (0x0100)
#define MTK_WDT_SWSYS_RST_MD_RST (0x0080)
#define MTK_WDT_SWSYS_RST_DDRPHY_RST (0x0040)
#define MTK_WDT_SWSYS_RST_IMG_RST (0x0020)
#define MTK_WDT_SWSYS_RST_VDEC_RST (0x0010)
#define MTK_WDT_SWSYS_RST_VENC_RST (0x0008)
#define MTK_WDT_SWSYS_RST_MFG_RST (0x0004)
#define MTK_WDT_SWSYS_RST_DISP_RST (0x0002)
#define MTK_WDT_SWSYS_RST_INFRA_RST (0x0001)
//#define MTK_WDT_SWSYS_RST_KEY (0x1500)
#define MTK_WDT_SWSYS_RST_KEY (0x88000000)
/*MTK_WDT_REQ_IRQ*/
#define MTK_WDT_REQ_IRQ_KEY (0x44000000)
#define MTK_WDT_REQ_IRQ_DEBUG_EN (0x80000)
#define MTK_WDT_REQ_IRQ_SPM_THERMAL_EN (0x0001)
#define MTK_WDT_REQ_IRQ_SPM_SCPSYS_EN (0x0002)
#define MTK_WDT_REQ_IRQ_THERMAL_EN (1<<18)
/*MTK_WDT_REQ_MODE*/
#define MTK_WDT_REQ_MODE_KEY (0x33000000)
#define MTK_WDT_REQ_MODE_DEBUG_EN (0x80000)
#define MTK_WDT_REQ_MODE_SPM_THERMAL (0x0001)
#define MTK_WDT_REQ_MODE_SPM_SCPSYS (0x0002)
#define MTK_WDT_REQ_MODE_THERMAL (1<<18)
#define WDT_NORMAL_REBOOT (0x01)
#define WDT_BY_PASS_PWK_REBOOT (0x02)
#define WDT_NOT_WDT_REBOOT (0x00)
typedef enum wd_swsys_reset_type {
WD_MD_RST,
}WD_SYS_RST_TYPE;
extern void mtk_wdt_init(void);
//extern void mtk_wdt_reset(void);
//extern unsigned int mtk_wdt_check_status(void);
extern BOOL mtk_is_rgu_trigger_reset(void);
extern void mtk_arch_reset(char mode);
void rgu_swsys_reset(WD_SYS_RST_TYPE reset_type);
#endif /*__MTK_WDT_H__*/
|
/****************************************************************************
**
** This file is part of the Qt Extended Opensource Package.
**
** Copyright (C) 2009 Trolltech ASA.
**
** Contact: Qt Extended Information (info@qtextended.org)
**
** This file may be used under the terms of the GNU General Public License
** version 2.0 as published by the Free Software Foundation and appearing
** in the file LICENSE.GPL included in the packaging of this file.
**
** Please review the following information to ensure GNU General Public
** Licensing requirements will be met:
** http://www.fsf.org/licensing/licenses/info/GPLv2.html.
**
**
****************************************************************************/
#ifndef BSCIDRMCONTENTPLUGIN_H
#define BSCIDRMCONTENTPLUGIN_H
#include <QDrmContentPlugin>
#include "bscidrm.h"
#include <qtopiaglobal.h>
#include <QValueSpaceItem>
class BSciContentLicense : public QDrmContentLicense
{
Q_OBJECT
public:
BSciContentLicense( const QContent &content, QDrmRights::Permission permission, QDrmContent::LicenseOptions options, TFileHandle f, SBSciContentAccess *ops );
virtual ~BSciContentLicense();
virtual QContent content() const;
virtual QDrmRights::Permission permission() const;
virtual QDrmContent::RenderState renderState() const;
public slots:
virtual void renderStateChanged( const QContent &content, QDrmContent::RenderState state );
protected:
void startConstraintUpdates();
void pauseConstraintUpdates();
void stopConstraintUpdates();
void expireLicense();
void timerEvent( QTimerEvent * event );
private:
QContent m_content;
QDrmRights::Permission m_permission;
QDrmContent::RenderState m_renderState;
QDrmContent::LicenseOptions m_options;
TFileHandle file;
SBSciContentAccess *fileOps;
int timerId;
QDateTime lastUpdate;
};
class BSciPreviewLicense : public QDrmContentLicense
{
Q_OBJECT
public:
BSciPreviewLicense( const QContent &content );
virtual ~BSciPreviewLicense();
virtual QContent content() const;
virtual QDrmRights::Permission permission() const;
virtual QDrmContent::RenderState renderState() const;
public slots:
virtual void renderStateChanged( const QContent &content, QDrmContent::RenderState state );
private:
QContent m_content;
QDrmContent::RenderState m_renderState;
};
class BSciReadDevice : public QIODevice
{
Q_OBJECT
public:
BSciReadDevice( const QString &drmFile, QDrmRights::Permission permission );
~BSciReadDevice();
bool open( QIODevice::OpenMode mode );
void close();
bool seek( qint64 pos );
qint64 size() const;
protected:
qint64 readData( char * data, qint64 maxlen );
qint64 writeData( const char * data, qint64 len );
private:
const QByteArray fileName;
QDrmRights::Permission permission;
TFileHandle file;
SBSciContentAccess *fileOps;
};
class BSciDrmContentPlugin : public QDrmContentPlugin
{
Q_OBJECT
public:
BSciDrmContentPlugin( QObject *parent = 0 );
virtual ~BSciDrmContentPlugin();
virtual QStringList keys() const;
virtual QStringList types() const;
virtual QList< QPair< QString, QString > > httpHeaders() const;
virtual bool isProtected( const QString &filePath ) const;
virtual QDrmRights::Permissions permissions( const QString &filePath );
virtual bool activate( const QContent &content, QDrmRights::Permission permission, QWidget *focus );
virtual void activate( const QContent &content, QWidget *focus );
virtual void reactivate( const QContent &content, QDrmRights::Permission permission, QWidget *focus );
virtual QDrmRights getRights( const QString &filePath, QDrmRights::Permission permission );
virtual QDrmContentLicense *requestContentLicense( const QContent &content, QDrmRights::Permission permission, QDrmContent::LicenseOptions options );
virtual QIODevice *createDecoder( const QString &filePath, QDrmRights::Permission permission );
virtual bool canActivate( const QString &filePath );
virtual qint64 unencryptedSize( const QString &filePath );
virtual QAbstractFileEngine *create( const QString &fileName ) const;
virtual bool deleteFile( const QString &filePath );
virtual bool installContent( const QString &filePath, QContent *content );
virtual bool updateContent( QContent *content );
protected:
enum MetaData
{
ContentType,
ContentUrl,
ContentVersion,
Title,
Description,
Copyright,
Author,
IconUri,
InfoUrl,
RightsIssuerUrl
};
bool installMessageFile( const QString &filePath );
bool registerFile( const QString &filePath );
QMap< MetaData, QString > getMetaData( const QString &filePath );
private slots:
void transactionTrackingChanged();
private:
QValueSpaceItem m_transactionTracking;
};
#endif
|
/* Copyright (C) 2000-2006 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/* Check that heap-structure is ok */
#include "heapdef.h"
static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records,
ulong blength, my_bool print_status);
static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records,
my_bool print_status);
/*
Check if keys and rows are ok in a heap table
SYNOPSIS
heap_check_heap()
info Table handler
print_status Prints some extra status
NOTES
Doesn't change the state of the table handler
RETURN VALUES
0 ok
1 error
*/
int heap_check_heap(HP_INFO *info, my_bool print_status)
{
int error;
uint key;
ulong records=0, deleted=0, pos, next_block;
HP_SHARE *share=info->s;
HP_INFO save_info= *info; /* Needed because scan_init */
DBUG_ENTER("heap_check_heap");
for (error=key= 0 ; key < share->keys ; key++)
{
if (share->keydef[key].algorithm == HA_KEY_ALG_BTREE)
error|= check_one_rb_key(info, key, share->records, print_status);
else
error|= check_one_key(share->keydef + key, key, share->records,
share->blength, print_status);
}
/*
This is basicly the same code as in hp_scan, but we repeat it here to
get shorter DBUG log file.
*/
for (pos=next_block= 0 ; ; pos++)
{
if (pos < next_block)
{
info->current_ptr+= share->block.recbuffer;
}
else
{
next_block+= share->block.records_in_block;
if (next_block >= share->records+share->deleted)
{
next_block= share->records+share->deleted;
if (pos >= next_block)
break; /* End of file */
}
}
hp_find_record(info,pos);
if (!info->current_ptr[share->reclength])
deleted++;
else
records++;
}
if (records != share->records || deleted != share->deleted)
{
DBUG_PRINT("error",("Found rows: %lu (%lu) deleted %lu (%lu)",
records, (ulong) share->records,
deleted, (ulong) share->deleted));
error= 1;
}
*info= save_info;
DBUG_RETURN(error);
}
static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records,
ulong blength, my_bool print_status)
{
int error;
ulong i,found,max_links,seek,links;
ulong rec_link; /* Only used with debugging */
ulong hash_buckets_found;
HASH_INFO *hash_info;
error=0;
hash_buckets_found= 0;
for (i=found=max_links=seek=0 ; i < records ; i++)
{
hash_info=hp_find_hash(&keydef->block,i);
if (hash_info->hash_of_key != hp_rec_hashnr(keydef, hash_info->ptr_to_rec))
{
DBUG_PRINT("error",
("Found row with wrong hash_of_key at position %lu", i));
error= 1;
}
if (hp_mask(hash_info->hash_of_key, blength, records) == i)
{
found++;
seek++;
links=1;
while ((hash_info=hash_info->next_key) && found < records + 1)
{
seek+= ++links;
if ((rec_link= hp_mask(hash_info->hash_of_key, blength, records)) != i)
{
DBUG_PRINT("error",
("Record in wrong link: Link %lu Record: 0x%lx Record-link %lu",
i, (long) hash_info->ptr_to_rec, rec_link));
error=1;
}
else
found++;
}
if (links > max_links) max_links=links;
hash_buckets_found++;
}
}
if (found != records)
{
DBUG_PRINT("error",("Found %ld of %ld records", found, records));
error=1;
}
if (keydef->hash_buckets != hash_buckets_found)
{
DBUG_PRINT("error",("Found %ld buckets, stats shows %ld buckets",
hash_buckets_found, (long) keydef->hash_buckets));
error=1;
}
DBUG_PRINT("info",
("key: %u records: %ld seeks: %lu max links: %lu "
"hitrate: %.2f buckets: %lu",
keynr, records,seek,max_links,
(float) seek / (float) (records ? records : 1),
hash_buckets_found));
if (print_status)
printf("Key: %u records: %ld seeks: %lu max links: %lu "
"hitrate: %.2f buckets: %lu\n",
keynr, records, seek, max_links,
(float) seek / (float) (records ? records : 1),
hash_buckets_found);
return error;
}
static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records,
my_bool print_status)
{
HP_KEYDEF *keydef= info->s->keydef + keynr;
int error= 0;
ulong found= 0;
uchar *key, *recpos;
uint key_length;
uint not_used[2];
if ((key= tree_search_edge(&keydef->rb_tree, info->parents,
&info->last_pos, offsetof(TREE_ELEMENT, left))))
{
do
{
memcpy(&recpos, key + (*keydef->get_key_length)(keydef,key), sizeof(uchar*));
key_length= hp_rb_make_key(keydef, info->recbuf, recpos, 0);
if (ha_key_cmp(keydef->seg, (uchar*) info->recbuf, (uchar*) key,
key_length, SEARCH_FIND | SEARCH_SAME, not_used))
{
error= 1;
DBUG_PRINT("error",("Record in wrong link: key: %u Record: 0x%lx\n",
keynr, (long) recpos));
}
else
found++;
key= tree_search_next(&keydef->rb_tree, &info->last_pos,
offsetof(TREE_ELEMENT, left),
offsetof(TREE_ELEMENT, right));
} while (key);
}
if (found != records)
{
DBUG_PRINT("error",("Found %lu of %lu records", found, records));
error= 1;
}
if (print_status)
printf("Key: %d records: %ld\n", keynr, records);
return error;
}
|
/* Target-dependent code for GNU/Linux, architecture independent.
Copyright (C) 2009-2015 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef LINUX_TDEP_H
#define LINUX_TDEP_H
#include "bfd.h"
struct regcache;
typedef char *(*linux_collect_thread_registers_ftype) (const struct regcache *,
ptid_t,
bfd *, char *, int *,
enum gdb_signal);
struct type *linux_get_siginfo_type (struct gdbarch *);
extern enum gdb_signal linux_gdb_signal_from_target (struct gdbarch *gdbarch,
int signal);
extern int linux_gdb_signal_to_target (struct gdbarch *gdbarch,
enum gdb_signal signal);
/* Default GNU/Linux implementation of `displaced_step_location', as
defined in gdbarch.h. Determines the entry point from AT_ENTRY in
the target auxiliary vector. */
extern CORE_ADDR linux_displaced_step_location (struct gdbarch *gdbarch);
extern void linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch);
extern int linux_is_uclinux (void);
#endif /* linux-tdep.h */
|
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef MSM_IRIS_H
#define MSM_IRIS_H
#include <linux/i2c.h>
#include <linux/gpio.h>
#include <soc/qcom/camera2.h>
#include <media/v4l2-subdev.h>
#include <media/msmb_camera.h>
#include "msm_camera_i2c.h"
#include "msm_camera_dt_util.h"
#include "msm_camera_io_util.h"
#define DEFINE_MSM_MUTEX(mutexname) \
static struct mutex mutexname = __MUTEX_INITIALIZER(mutexname)
#define MSM_IRIS_MAX_VREGS (10)
struct msm_iris_ctrl_t;
enum msm_iris_state_t {
IRIS_ENABLE_STATE,
IRIS_OPS_ACTIVE,
IRIS_OPS_INACTIVE,
IRIS_DISABLE_STATE,
};
struct msm_iris_vreg {
struct camera_vreg_t *cam_vreg;
void *data[MSM_IRIS_MAX_VREGS];
int num_vreg;
};
struct msm_iris_ctrl_t {
struct i2c_driver *i2c_driver;
struct platform_driver *pdriver;
struct platform_device *pdev;
struct msm_camera_i2c_client i2c_client;
enum msm_camera_device_type_t iris_device_type;
struct msm_sd_subdev msm_sd;
struct mutex *iris_mutex;
enum msm_camera_i2c_data_type i2c_data_type;
struct v4l2_subdev sdev;
struct v4l2_subdev_ops *iris_v4l2_subdev_ops;
void *user_data;
uint16_t i2c_tbl_index;
enum cci_i2c_master_t cci_master;
uint32_t subdev_id;
enum msm_iris_state_t iris_state;
struct msm_iris_vreg vreg_cfg;
};
#endif
|
/*
* Copyright (C) 2008 Analog Devices Inc.
* Licensed under the GPL-2 or later.
*/
#ifndef _MACH_GPIO_H_
#define _MACH_GPIO_H_
#define MAX_BLACKFIN_GPIOS 48
#define GPIO_PF0 0
#define GPIO_PF1 1
#define GPIO_PF2 2
#define GPIO_PF3 3
#define GPIO_PF4 4
#define GPIO_PF5 5
#define GPIO_PF6 6
#define GPIO_PF7 7
#define GPIO_PF8 8
#define GPIO_PF9 9
#define GPIO_PF10 10
#define GPIO_PF11 11
#define GPIO_PF12 12
#define GPIO_PF13 13
#define GPIO_PF14 14
#define GPIO_PF15 15
#define GPIO_PF16 16
#define GPIO_PF17 17
#define GPIO_PF18 18
#define GPIO_PF19 19
#define GPIO_PF20 20
#define GPIO_PF21 21
#define GPIO_PF22 22
#define GPIO_PF23 23
#define GPIO_PF24 24
#define GPIO_PF25 25
#define GPIO_PF26 26
#define GPIO_PF27 27
#define GPIO_PF28 28
#define GPIO_PF29 29
#define GPIO_PF30 30
#define GPIO_PF31 31
#define GPIO_PF32 32
#define GPIO_PF33 33
#define GPIO_PF34 34
#define GPIO_PF35 35
#define GPIO_PF36 36
#define GPIO_PF37 37
#define GPIO_PF38 38
#define GPIO_PF39 39
#define GPIO_PF40 40
#define GPIO_PF41 41
#define GPIO_PF42 42
#define GPIO_PF43 43
#define GPIO_PF44 44
#define GPIO_PF45 45
#define GPIO_PF46 46
#define GPIO_PF47 47
#define PORT_FIO0 GPIO_PF0
#define PORT_FIO1 GPIO_PF16
#define PORT_FIO2 GPIO_PF32
#include <mach-common/ports-f.h>
#endif /* */
|
/* dsdefs.h
*
* This is a "dummy" version of stdio.h etc. for systems which lack one.
* Rename it is stdio.h if needed.
*
* Functions printf() and sprintf() are defined here, but neither
* of them do anything useful.
*
* Version 1.2 Dag Bruck
* 1.3 Dag Bruck Updated for DYMOLA_DSPACE.
*
* Copyright (C) 1997-2004 Dynasim AB.
* All rights reserved.
*
*/
#ifndef DSDEFS_H
#define DSDEFS_H
#if !defined(RTLAB) && !defined(LABCAR) && !defined(DYM2DS) && !defined(FMU_SOURCE_SINGLE_UNIT)
#if defined(NO_FILE) || ( defined(DYMOLA_DSPACE) && !defined(__STDIO_H) )
#define FILE int
#define fpos_t unsigned int
#if defined(DYMOLA_DSPACE)
#define __STDIO_H
#endif
#endif
#if defined(DYMOLA_DSPACE)
static int printf(const char* format, ...)
{ return 0; }
static int sprintf(char* s, const char* format, ...)
{ s[0] = '\0'; return 0; }
#endif
#endif
#if !defined(assert) && !defined(DYM2DS) && !defined(FMU_SOURCE_SINGLE_UNIT)
#define assert(test) (void)0
#endif
#endif
|
/* radare2 - LGPL - Copyright 2017 - condret */
#include <r_util.h>
#include <r_types.h>
ut32 get_msb(ut32 v) {
int i;
for (i = 31; i > (-1); i--) {
if (v & (0x1 << i)) {
return (v & (0x1 << i));
}
}
return 0;
}
R_API RIDPool* r_id_pool_new(ut32 start_id, ut32 last_id) {
RIDPool* pool = NULL;
if (start_id < last_id) {
pool = R_NEW0 (RIDPool);
if (!pool) {
return NULL;
}
pool->next_id = pool->start_id = start_id;
pool->last_id = last_id;
}
return pool;
}
R_API bool r_id_pool_grab_id(RIDPool* pool, ut32* grabber) {
if (!pool || !grabber) {
return false;
}
if (pool->freed_ids) {
ut32 grab = (ut32) (size_t)r_queue_dequeue (pool->freed_ids);
*grabber = (ut32) grab;
if (r_queue_is_empty (pool->freed_ids)) {
r_queue_free (pool->freed_ids);
pool->freed_ids = NULL;
}
return true;
}
if (pool->next_id < pool->last_id) {
*grabber = pool->next_id;
pool->next_id++;
return true;
}
return false;
}
R_API bool r_id_pool_kick_id(RIDPool* pool, ut32 kick) {
if (!pool || (kick < pool->start_id) || (pool->start_id == pool->next_id)) {
return false;
}
if (kick == (pool->next_id - 1)) {
pool->next_id--;
return true;
}
if (!pool->freed_ids) {
pool->freed_ids = r_queue_new (2);
}
r_queue_enqueue (pool->freed_ids, (void*) (size_t) kick);
return true;
}
R_API void r_id_pool_free(RIDPool* pool) {
if (pool && pool->freed_ids) {
r_queue_free (pool->freed_ids);
}
free (pool);
}
R_API RIDStorage* r_id_storage_new(ut32 start_id, ut32 last_id) {
RIDPool* pool;
RIDStorage* storage = NULL;
if ((start_id < 16) && (pool = r_id_pool_new (start_id, last_id))) {
storage = R_NEW0 (RIDStorage);
if (!storage) {
return NULL;
}
storage->pool = pool;
}
return storage;
}
static bool id_storage_reallocate(RIDStorage* storage, ut32 size) {
void* data;
if (!storage) {
return false;
}
if (storage->size == size) {
return true;
}
if (storage->size > size) {
storage->data = realloc (storage->data, size * sizeof(void*));
storage->size = size;
return true;
}
data = storage->data;
storage->data = R_NEWS0 (void*, size);
if (data) {
memcpy (storage->data, data, storage->size * sizeof(void*));
}
storage->size = size;
return true;
}
R_API bool r_id_storage_set(RIDStorage* storage, void* data, ut32 id) {
ut32 n;
if (!storage || !storage->pool || (id >= storage->pool->next_id)) {
return false;
}
n = get_msb (id + 1);
if (n > (storage->size - (storage->size / 4))) {
if (n < (storage->pool->last_id / 2)) {
if (!id_storage_reallocate (storage, n * 2)) {
return false;
}
} else if (n != (storage->pool->last_id)) {
if (!id_storage_reallocate (storage, storage->pool->last_id)) {
return false;
}
}
}
storage->data[id] = data;
if (id > storage->top_id) {
storage->top_id = id;
}
return true;
}
R_API bool r_id_storage_add(RIDStorage* storage, void* data, ut32* id) {
if (!storage || !r_id_pool_grab_id (storage->pool, id)) {
return false;
}
return r_id_storage_set (storage, data, *id);
}
R_API void* r_id_storage_get(RIDStorage* storage, ut32 id) {
if (!storage || !storage->data || (storage->size <= id)) {
return NULL;
}
return storage->data[id];
}
R_API void r_id_storage_delete(RIDStorage* storage, ut32 id) {
if (!storage || !storage->data || (storage->size <= id)) {
return;
}
storage->data[id] = NULL;
if (id == storage->top_id) {
while (storage->top_id && !storage->data[storage->top_id]) {
storage->top_id--;
}
if (!storage->top_id) {
if(storage->data[storage->top_id]) {
id_storage_reallocate (storage, 2);
} else {
RIDPool* pool = r_id_pool_new (storage->pool->start_id, storage->pool->last_id);
R_FREE (storage->data);
storage->size = 0;
r_id_pool_free (storage->pool);
storage->pool = pool;
return;
}
} else if ((storage->top_id + 1) < (storage->size / 4)) {
id_storage_reallocate (storage, storage->size / 2);
}
}
r_id_pool_kick_id (storage->pool, id);
}
R_API void* r_id_storage_take(RIDStorage* storage, ut32 id) {
void* ret = r_id_storage_get (storage, id);
r_id_storage_delete (storage, id);
return ret;
}
R_API bool r_id_storage_foreach(RIDStorage* storage, RIDStorageForeachCb cb, void* user) {
ut32 i;
if (!cb || !storage || !storage->data) {
return false;
}
for (i = 0; i < storage->top_id; i++) {
if (storage->data[i]) {
if (!cb (user, storage->data[i], i)) {
return false;
}
}
}
if (storage->data[i]) {
return cb (user, storage->data[i], i);
}
return true;
}
R_API void r_id_storage_free(RIDStorage* storage) {
if (storage) {
r_id_pool_free (storage->pool);
free (storage->data);
}
free (storage);
}
|
/**************************************************************************/
/* */
/* OCaml */
/* */
/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
/* */
/* Copyright 2001 Institut National de Recherche en Informatique et */
/* en Automatique. */
/* */
/* All rights reserved. This file is distributed under the terms of */
/* the GNU Lesser General Public License version 2.1, with the */
/* special exception on linking described in the file LICENSE. */
/* */
/**************************************************************************/
#define CAML_INTERNALS
/* Registration of global memory roots */
#include "caml/mlvalues.h"
#include "caml/roots.h"
#include "caml/globroots.h"
#include "caml/skiplist.h"
/* The three global root lists.
Each is represented by a skip list with the key being the address
of the root. (The associated data field is unused.) */
struct skiplist caml_global_roots = SKIPLIST_STATIC_INITIALIZER;
/* mutable roots, don't know whether old or young */
struct skiplist caml_global_roots_young = SKIPLIST_STATIC_INITIALIZER;
/* generational roots pointing to minor or major heap */
struct skiplist caml_global_roots_old = SKIPLIST_STATIC_INITIALIZER;
/* generational roots pointing to major heap */
/* The invariant of the generational roots is the following:
- If the global root contains a pointer to the minor heap, then the root is
in [caml_global_roots_young];
- If the global root contains a pointer to the major heap, then the root is
in [caml_global_roots_old] or in [caml_global_roots_young];
- Otherwise (the root contains a pointer outside of the heap or an integer),
then neither [caml_global_roots_young] nor [caml_global_roots_old] contain
it.
*/
/* Insertion and deletion */
Caml_inline void caml_insert_global_root(struct skiplist * list, value * r)
{
caml_skiplist_insert(list, (uintnat) r, 0);
}
Caml_inline void caml_delete_global_root(struct skiplist * list, value * r)
{
caml_skiplist_remove(list, (uintnat) r);
}
/* Iterate a GC scanning action over a global root list */
static void caml_iterate_global_roots(scanning_action f,
struct skiplist * rootlist)
{
FOREACH_SKIPLIST_ELEMENT(e, rootlist, {
value * r = (value *) (e->key);
f(*r, r);
})
}
/* Register a global C root of the mutable kind */
CAMLexport void caml_register_global_root(value *r)
{
CAMLassert (((intnat) r & 3) == 0); /* compact.c demands this (for now) */
caml_insert_global_root(&caml_global_roots, r);
}
/* Un-register a global C root of the mutable kind */
CAMLexport void caml_remove_global_root(value *r)
{
caml_delete_global_root(&caml_global_roots, r);
}
enum gc_root_class {
YOUNG,
OLD,
UNTRACKED
};
static enum gc_root_class classify_gc_root(value v)
{
if(!Is_block(v)) return UNTRACKED;
if(Is_young(v)) return YOUNG;
#ifndef NO_NAKED_POINTERS
if(!Is_in_heap(v)) return UNTRACKED;
#endif
return OLD;
}
/* Register a global C root of the generational kind */
CAMLexport void caml_register_generational_global_root(value *r)
{
CAMLassert (((intnat) r & 3) == 0); /* compact.c demands this (for now) */
switch(classify_gc_root(*r)) {
case YOUNG:
caml_insert_global_root(&caml_global_roots_young, r);
break;
case OLD:
caml_insert_global_root(&caml_global_roots_old, r);
break;
case UNTRACKED: break;
}
}
/* Un-register a global C root of the generational kind */
CAMLexport void caml_remove_generational_global_root(value *r)
{
switch(classify_gc_root(*r)) {
case OLD:
caml_delete_global_root(&caml_global_roots_old, r);
/* Fallthrough: the root can be in the young list while actually
being in the major heap. */
case YOUNG:
caml_delete_global_root(&caml_global_roots_young, r);
break;
case UNTRACKED: break;
}
}
/* Modify the value of a global C root of the generational kind */
CAMLexport void caml_modify_generational_global_root(value *r, value newval)
{
enum gc_root_class c;
/* See PRs #4704, #607 and #8656 */
switch(classify_gc_root(newval)) {
case YOUNG:
c = classify_gc_root(*r);
if(c == OLD)
caml_delete_global_root(&caml_global_roots_old, r);
if(c != YOUNG)
caml_insert_global_root(&caml_global_roots_young, r);
break;
case OLD:
/* If the old class is YOUNG, then we do not need to do
anything: It is OK to have a root in roots_young that
suddenly points to the old generation -- the next minor GC
will take care of that. */
if(classify_gc_root(*r) == UNTRACKED)
caml_insert_global_root(&caml_global_roots_old, r);
break;
case UNTRACKED:
caml_remove_generational_global_root(r);
break;
}
*r = newval;
}
/* Scan all global roots */
void caml_scan_global_roots(scanning_action f)
{
caml_iterate_global_roots(f, &caml_global_roots);
caml_iterate_global_roots(f, &caml_global_roots_young);
caml_iterate_global_roots(f, &caml_global_roots_old);
}
/* Scan global roots for a minor collection */
void caml_scan_global_young_roots(scanning_action f)
{
caml_iterate_global_roots(f, &caml_global_roots);
caml_iterate_global_roots(f, &caml_global_roots_young);
/* Move young roots to old roots */
FOREACH_SKIPLIST_ELEMENT(e, &caml_global_roots_young, {
value * r = (value *) (e->key);
caml_insert_global_root(&caml_global_roots_old, r);
});
caml_skiplist_empty(&caml_global_roots_young);
}
|
//
// ColdAddressListCell.h
// bither-ios
//
// Copyright 2014 http://Bither.net
//
// 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 <UIKit/UIKit.h>
#import <Bitheri/BTAddress.h>
@interface ColdAddressListCell : UITableViewCell
- (void)showAddress:(BTAddress *)address;
@end
|
/*!
* \~chinese
* @header EMOptions+PrivateDeploy.h
* @abstract SDK私有部署属性
* @author Hyphenate
* @version 3.0
*
* \~english
* @header EMOptions+PrivateDeploy.h
* @abstract SDK setting options of private deployment
* @author Hyphenate
* @version 3.0
*/
#import "EMOptions.h"
@interface EMOptions (PrivateDeploy)
/*!
* \~chinese
* 是否允许使用DNS, 默认为YES
*
* 只能在[EMClient initializeSDKWithOptions:]中设置,不能在程序运行过程中动态修改。
*
* \~english
* Whether allow to use DNS, default is YES
*
* Can only set when initialize SDK [EMClient initializeSDKWithOptions:], can't change it in runtime
*/
@property (nonatomic, assign) BOOL enableDnsConfig;
/*!
* \~chinese
* IM服务器端口
*
* enableDnsConfig为NO时有效。只能在[EMClient initializeSDKWithOptions:]中设置,不能在程序运行过程中动态修改
*
* \~english
* IM server port
*
* It's effective only when enableDnsConfig is NO. Can only set when initialize SDK [EMClient initializeSDKWithOptions:], can't change it in runtime
*/
@property (nonatomic, assign) int chatPort;
/*!
* \~chinese
* IM服务器地址
*
* enableDnsConfig为NO时生效。只能在[EMClient initializeSDKWithOptions:]中设置,不能在程序运行过程中动态修改
*
* \~english
* IM server
*
* It's effective only when enableDnsConfig is NO. Can only set when initialize SDK [EMClient initializeSDKWithOptions:], can't change it in runtime
*/
@property (nonatomic, strong) NSString *chatServer;
/*!
* \~chinese
* REST服务器地址
*
* enableDnsConfig为NO时生效。只能在[EMClient initializeSDKWithOptions:]中设置,不能在程序运行过程中动态修改
*
* \~english
* REST server
*
* It's effective only when enableDnsConfig is NO. Can only set when initialize SDK [EMClient initializeSDKWithOptions:], can't change it in runtime
*/
@property (nonatomic, strong) NSString *restServer;
@end
|
// Copyright 2019 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_UTIL_PROCESS_PROCESS_ID_H_
#define CRASHPAD_UTIL_PROCESS_PROCESS_ID_H_
#include <type_traits>
#include "base/format_macros.h"
#include "build/build_config.h"
#if BUILDFLAG(IS_POSIX)
#include <sys/types.h>
#elif BUILDFLAG(IS_WIN)
#include <windows.h>
#elif BUILDFLAG(IS_FUCHSIA)
#include <zircon/types.h>
#endif
namespace crashpad {
#if BUILDFLAG(IS_POSIX) || DOXYGEN
//! \brief Alias for platform-specific type to represent a process.
using ProcessID = pid_t;
constexpr ProcessID kInvalidProcessID = -1;
static_assert(std::is_same<ProcessID, int>::value, "Port.");
#define PRI_PROCESS_ID "d"
#elif BUILDFLAG(IS_WIN)
using ProcessID = DWORD;
constexpr ProcessID kInvalidProcessID = 0;
#define PRI_PROCESS_ID "lu"
#elif BUILDFLAG(IS_FUCHSIA)
using ProcessID = zx_koid_t;
constexpr ProcessID kInvalidProcessID = ZX_KOID_INVALID;
static_assert(std::is_same<ProcessID, int64_t>::value, "Port.");
#define PRI_PROCESS_ID PRId64
#else
#error Port.
#endif
} // namespace crashpad
#endif // CRASHPAD_UTIL_PROCESS_PROCESS_ID_H_
|
/**************************************************************************
*
* Copyright 2009 Younes Manton.
* Copyright 2011 Christian König.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, 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 NON-INFRINGEMENT.
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS 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 vl_decoder_h
#define vl_decoder_h
#include "pipe/p_video_codec.h"
/**
* check if a given profile is supported with shader based decoding
*/
bool
vl_profile_supported(struct pipe_screen *screen, enum pipe_video_profile profile,
enum pipe_video_entrypoint entrypoint);
/**
* get the maximum supported level for the given profile with shader based decoding
*/
int
vl_level_supported(struct pipe_screen *screen, enum pipe_video_profile profile);
/**
* standard implementation of pipe->create_video_codec
*/
struct pipe_video_codec *
vl_create_decoder(struct pipe_context *pipe,
const struct pipe_video_codec *templat);
#endif /* vl_decoder_h */
|
/*
* Copyright 2010-2016 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bx#license-bsd-2-clause
*/
#ifndef BX_FLOAT4X4_H_HEADER_GUARD
#define BX_FLOAT4X4_H_HEADER_GUARD
#include "simd_t.h"
namespace bx
{
BX_ALIGN_DECL_16(struct) float4x4_t
{
simd128_t col[4];
};
BX_SIMD_FORCE_INLINE simd128_t simd_mul_xyz1(simd128_t _a, const float4x4_t* _b)
{
const simd128_t xxxx = simd_swiz_xxxx(_a);
const simd128_t yyyy = simd_swiz_yyyy(_a);
const simd128_t zzzz = simd_swiz_zzzz(_a);
const simd128_t col0 = simd_mul(_b->col[0], xxxx);
const simd128_t col1 = simd_mul(_b->col[1], yyyy);
const simd128_t col2 = simd_madd(_b->col[2], zzzz, col0);
const simd128_t col3 = simd_add(_b->col[3], col1);
const simd128_t result = simd_add(col2, col3);
return result;
}
BX_SIMD_FORCE_INLINE simd128_t simd_mul(simd128_t _a, const float4x4_t* _b)
{
const simd128_t xxxx = simd_swiz_xxxx(_a);
const simd128_t yyyy = simd_swiz_yyyy(_a);
const simd128_t zzzz = simd_swiz_zzzz(_a);
const simd128_t wwww = simd_swiz_wwww(_a);
const simd128_t col0 = simd_mul(_b->col[0], xxxx);
const simd128_t col1 = simd_mul(_b->col[1], yyyy);
const simd128_t col2 = simd_madd(_b->col[2], zzzz, col0);
const simd128_t col3 = simd_madd(_b->col[3], wwww, col1);
const simd128_t result = simd_add(col2, col3);
return result;
}
BX_SIMD_INLINE void float4x4_mul(float4x4_t* __restrict _result, const float4x4_t* __restrict _a, const float4x4_t* __restrict _b)
{
_result->col[0] = simd_mul(_a->col[0], _b);
_result->col[1] = simd_mul(_a->col[1], _b);
_result->col[2] = simd_mul(_a->col[2], _b);
_result->col[3] = simd_mul(_a->col[3], _b);
}
BX_SIMD_FORCE_INLINE void float4x4_transpose(float4x4_t* __restrict _result, const float4x4_t* __restrict _mtx)
{
const simd128_t aibj = simd_shuf_xAyB(_mtx->col[0], _mtx->col[2]); // aibj
const simd128_t emfn = simd_shuf_xAyB(_mtx->col[1], _mtx->col[3]); // emfn
const simd128_t ckdl = simd_shuf_zCwD(_mtx->col[0], _mtx->col[2]); // ckdl
const simd128_t gohp = simd_shuf_zCwD(_mtx->col[1], _mtx->col[3]); // gohp
_result->col[0] = simd_shuf_xAyB(aibj, emfn); // aeim
_result->col[1] = simd_shuf_zCwD(aibj, emfn); // bfjn
_result->col[2] = simd_shuf_xAyB(ckdl, gohp); // cgko
_result->col[3] = simd_shuf_zCwD(ckdl, gohp); // dhlp
}
BX_SIMD_INLINE void float4x4_inverse(float4x4_t* __restrict _result, const float4x4_t* __restrict _a)
{
const simd128_t tmp0 = simd_shuf_xAzC(_a->col[0], _a->col[1]);
const simd128_t tmp1 = simd_shuf_xAzC(_a->col[2], _a->col[3]);
const simd128_t tmp2 = simd_shuf_yBwD(_a->col[0], _a->col[1]);
const simd128_t tmp3 = simd_shuf_yBwD(_a->col[2], _a->col[3]);
const simd128_t t0 = simd_shuf_xyAB(tmp0, tmp1);
const simd128_t t1 = simd_shuf_xyAB(tmp3, tmp2);
const simd128_t t2 = simd_shuf_zwCD(tmp0, tmp1);
const simd128_t t3 = simd_shuf_zwCD(tmp3, tmp2);
const simd128_t t23 = simd_mul(t2, t3);
const simd128_t t23_yxwz = simd_swiz_yxwz(t23);
const simd128_t t23_wzyx = simd_swiz_wzyx(t23);
simd128_t cof0, cof1, cof2, cof3;
const simd128_t zero = simd_zero();
cof0 = simd_nmsub(t1, t23_yxwz, zero);
cof0 = simd_madd(t1, t23_wzyx, cof0);
cof1 = simd_nmsub(t0, t23_yxwz, zero);
cof1 = simd_madd(t0, t23_wzyx, cof1);
cof1 = simd_swiz_zwxy(cof1);
const simd128_t t12 = simd_mul(t1, t2);
const simd128_t t12_yxwz = simd_swiz_yxwz(t12);
const simd128_t t12_wzyx = simd_swiz_wzyx(t12);
cof0 = simd_madd(t3, t12_yxwz, cof0);
cof0 = simd_nmsub(t3, t12_wzyx, cof0);
cof3 = simd_mul(t0, t12_yxwz);
cof3 = simd_nmsub(t0, t12_wzyx, cof3);
cof3 = simd_swiz_zwxy(cof3);
const simd128_t t1_zwxy = simd_swiz_zwxy(t1);
const simd128_t t2_zwxy = simd_swiz_zwxy(t2);
const simd128_t t13 = simd_mul(t1_zwxy, t3);
const simd128_t t13_yxwz = simd_swiz_yxwz(t13);
const simd128_t t13_wzyx = simd_swiz_wzyx(t13);
cof0 = simd_madd(t2_zwxy, t13_yxwz, cof0);
cof0 = simd_nmsub(t2_zwxy, t13_wzyx, cof0);
cof2 = simd_mul(t0, t13_yxwz);
cof2 = simd_nmsub(t0, t13_wzyx, cof2);
cof2 = simd_swiz_zwxy(cof2);
const simd128_t t01 = simd_mul(t0, t1);
const simd128_t t01_yxwz = simd_swiz_yxwz(t01);
const simd128_t t01_wzyx = simd_swiz_wzyx(t01);
cof2 = simd_nmsub(t3, t01_yxwz, cof2);
cof2 = simd_madd(t3, t01_wzyx, cof2);
cof3 = simd_madd(t2_zwxy, t01_yxwz, cof3);
cof3 = simd_nmsub(t2_zwxy, t01_wzyx, cof3);
const simd128_t t03 = simd_mul(t0, t3);
const simd128_t t03_yxwz = simd_swiz_yxwz(t03);
const simd128_t t03_wzyx = simd_swiz_wzyx(t03);
cof1 = simd_nmsub(t2_zwxy, t03_yxwz, cof1);
cof1 = simd_madd(t2_zwxy, t03_wzyx, cof1);
cof2 = simd_madd(t1, t03_yxwz, cof2);
cof2 = simd_nmsub(t1, t03_wzyx, cof2);
const simd128_t t02 = simd_mul(t0, t2_zwxy);
const simd128_t t02_yxwz = simd_swiz_yxwz(t02);
const simd128_t t02_wzyx = simd_swiz_wzyx(t02);
cof1 = simd_madd(t3, t02_yxwz, cof1);
cof1 = simd_nmsub(t3, t02_wzyx, cof1);
cof3 = simd_nmsub(t1, t02_yxwz, cof3);
cof3 = simd_madd(t1, t02_wzyx, cof3);
const simd128_t det = simd_dot(t0, cof0);
const simd128_t invdet = simd_rcp(det);
_result->col[0] = simd_mul(cof0, invdet);
_result->col[1] = simd_mul(cof1, invdet);
_result->col[2] = simd_mul(cof2, invdet);
_result->col[3] = simd_mul(cof3, invdet);
}
} // namespace bx
#endif // BX_FLOAT4X4_H_HEADER_GUARD
|
/****************************************************************************
* sched/pthread_condwait.c
*
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX 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.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <unistd.h>
#include <pthread.h>
#include <sched.h>
#include <errno.h>
#include <debug.h>
#include "pthread_internal.h"
/****************************************************************************
* Definitions
****************************************************************************/
/****************************************************************************
* Private Type Declarations
****************************************************************************/
/****************************************************************************
* Global Variables
****************************************************************************/
/****************************************************************************
* Private Variables
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: int pthread_cond_wait
*
* Description:
* A thread can wait for a condition variable to be signalled or broadcast.
*
* Parameters:
* None
*
* Return Value:
* None
*
* Assumptions:
*
****************************************************************************/
int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex)
{
int ret;
sdbg("cond=0x%p mutex=0x%p\n", cond, mutex);
/* Make sure that non-NULL references were provided. */
if (!cond || !mutex)
{
ret = EINVAL;
}
/* Make sure that the caller holds the mutex */
else if (mutex->pid != (int)getpid())
{
ret = EPERM;
}
else
{
/* Give up the mutex */
sdbg("Give up mutex / take cond\n");
sched_lock();
mutex->pid = 0;
ret = pthread_givesemaphore((sem_t*)&mutex->sem);
/* Take the semaphore */
ret |= pthread_takesemaphore((sem_t*)&cond->sem);
sched_unlock();
/* Reacquire the mutex */
sdbg("Reacquire mutex...\n");
ret |= pthread_takesemaphore((sem_t*)&mutex->sem);
if (!ret)
{
mutex->pid = getpid();;
}
}
sdbg("Returning %d\n", ret);
return ret;
}
|
/*
* Copyright (c) 2016-2020, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <assert.h>
#include <stdint.h>
#include <string.h>
#include <lib/mmio.h>
#include <lib/fconf/fconf.h>
#include <plat/arm/common/plat_arm.h>
#include <plat/arm/common/fconf_nv_cntr_getter.h>
#include <plat/common/platform.h>
#include <platform_def.h>
#include <tools_share/tbbr_oid.h>
/*
* Return the ROTPK hash in the following ASN.1 structure in DER format:
*
* AlgorithmIdentifier ::= SEQUENCE {
* algorithm OBJECT IDENTIFIER,
* parameters ANY DEFINED BY algorithm OPTIONAL
* }
*
* DigestInfo ::= SEQUENCE {
* digestAlgorithm AlgorithmIdentifier,
* digest OCTET STRING
* }
*/
int plat_get_rotpk_info(void *cookie, void **key_ptr, unsigned int *key_len,
unsigned int *flags)
{
return arm_get_rotpk_info(cookie, key_ptr, key_len, flags);
}
/*
* Store a new non-volatile counter value.
*
* On some FVP versions, the non-volatile counters are read-only so this
* function will always fail.
*
* Return: 0 = success, Otherwise = error
*/
int plat_set_nv_ctr(void *cookie, unsigned int nv_ctr)
{
const char *oid;
uintptr_t nv_ctr_addr;
assert(cookie != NULL);
oid = (const char *)cookie;
if (strcmp(oid, TRUSTED_FW_NVCOUNTER_OID) == 0) {
nv_ctr_addr = FCONF_GET_PROPERTY(cot, nv_cntr_addr,
TRUSTED_NV_CTR_ID);
} else if (strcmp(oid, NON_TRUSTED_FW_NVCOUNTER_OID) == 0) {
nv_ctr_addr = FCONF_GET_PROPERTY(cot, nv_cntr_addr,
NON_TRUSTED_NV_CTR_ID);
} else {
return 1;
}
mmio_write_32(nv_ctr_addr, nv_ctr);
/*
* If the FVP models a locked counter then its value cannot be updated
* and the above write operation has been silently ignored.
*/
return (mmio_read_32(nv_ctr_addr) == nv_ctr) ? 0 : 1;
}
|
//========================================================================
// GLFW 3.3 OSMesa - www.glfw.org
//------------------------------------------------------------------------
// Copyright (c) 2016 Google Inc.
// Copyright (c) 2006-2016 Camilla Löwy <elmindreda@glfw.org>
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would
// be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not
// be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
// distribution.
//
//========================================================================
#define OSMESA_RGBA 0x1908
#define OSMESA_FORMAT 0x22
#define OSMESA_DEPTH_BITS 0x30
#define OSMESA_STENCIL_BITS 0x31
#define OSMESA_ACCUM_BITS 0x32
#define OSMESA_PROFILE 0x33
#define OSMESA_CORE_PROFILE 0x34
#define OSMESA_COMPAT_PROFILE 0x35
#define OSMESA_CONTEXT_MAJOR_VERSION 0x36
#define OSMESA_CONTEXT_MINOR_VERSION 0x37
typedef void* OSMesaContext;
typedef void (*OSMESAproc)(void);
typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContextExt)(GLenum,GLint,GLint,GLint,OSMesaContext);
typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContextAttribs)(const int*,OSMesaContext);
typedef void (GLAPIENTRY * PFN_OSMesaDestroyContext)(OSMesaContext);
typedef int (GLAPIENTRY * PFN_OSMesaMakeCurrent)(OSMesaContext,void*,int,int,int);
typedef int (GLAPIENTRY * PFN_OSMesaGetColorBuffer)(OSMesaContext,int*,int*,int*,void**);
typedef int (GLAPIENTRY * PFN_OSMesaGetDepthBuffer)(OSMesaContext,int*,int*,int*,void**);
typedef GLFWglproc (GLAPIENTRY * PFN_OSMesaGetProcAddress)(const char*);
#define OSMesaCreateContextExt _glfw.osmesa.CreateContextExt
#define OSMesaCreateContextAttribs _glfw.osmesa.CreateContextAttribs
#define OSMesaDestroyContext _glfw.osmesa.DestroyContext
#define OSMesaMakeCurrent _glfw.osmesa.MakeCurrent
#define OSMesaGetColorBuffer _glfw.osmesa.GetColorBuffer
#define OSMesaGetDepthBuffer _glfw.osmesa.GetDepthBuffer
#define OSMesaGetProcAddress _glfw.osmesa.GetProcAddress
#define _GLFW_OSMESA_CONTEXT_STATE _GLFWcontextOSMesa osmesa
#define _GLFW_OSMESA_LIBRARY_CONTEXT_STATE _GLFWlibraryOSMesa osmesa
// OSMesa-specific per-context data
//
typedef struct _GLFWcontextOSMesa
{
OSMesaContext handle;
int width;
int height;
void* buffer;
} _GLFWcontextOSMesa;
// OSMesa-specific global data
//
typedef struct _GLFWlibraryOSMesa
{
void* handle;
PFN_OSMesaCreateContextExt CreateContextExt;
PFN_OSMesaCreateContextAttribs CreateContextAttribs;
PFN_OSMesaDestroyContext DestroyContext;
PFN_OSMesaMakeCurrent MakeCurrent;
PFN_OSMesaGetColorBuffer GetColorBuffer;
PFN_OSMesaGetDepthBuffer GetDepthBuffer;
PFN_OSMesaGetProcAddress GetProcAddress;
} _GLFWlibraryOSMesa;
GLFWbool _glfwInitOSMesa(void);
void _glfwTerminateOSMesa(void);
GLFWbool _glfwCreateContextOSMesa(_GLFWwindow* window,
const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig);
|
/*
Copyright (c) 2016. The YARA Authors. All Rights Reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef YR_MUTEX_H
#define YR_MUTEX_H
#if defined(_WIN32) || defined(__CYGWIN__)
#include <windows.h>
typedef DWORD YR_THREAD_ID;
typedef DWORD YR_THREAD_STORAGE_KEY;
typedef HANDLE YR_MUTEX;
#else
#include <pthread.h>
typedef pthread_t YR_THREAD_ID;
typedef pthread_key_t YR_THREAD_STORAGE_KEY;
typedef pthread_mutex_t YR_MUTEX;
#endif
YR_THREAD_ID yr_current_thread_id(void);
int yr_mutex_create(YR_MUTEX*);
int yr_mutex_destroy(YR_MUTEX*);
int yr_mutex_lock(YR_MUTEX*);
int yr_mutex_unlock(YR_MUTEX*);
int yr_thread_storage_create(YR_THREAD_STORAGE_KEY*);
int yr_thread_storage_destroy(YR_THREAD_STORAGE_KEY*);
int yr_thread_storage_set_value(YR_THREAD_STORAGE_KEY*, void*);
void* yr_thread_storage_get_value(YR_THREAD_STORAGE_KEY*);
#endif
|
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2014 Paul Sokolovsky
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <assert.h>
#include <string.h>
#include "py/nlr.h"
#include "py/runtime.h"
#if MICROPY_PY_UHASHLIB
#include "crypto-algorithms/sha256.h"
#if MICROPY_PY_UHASHLIB_SHA1
#include "lib/axtls/crypto/crypto.h"
#endif
typedef struct _mp_obj_hash_t {
mp_obj_base_t base;
char state[0];
} mp_obj_hash_t;
STATIC mp_obj_t hash_update(mp_obj_t self_in, mp_obj_t arg);
STATIC mp_obj_t hash_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 0, 1, false);
mp_obj_hash_t *o = m_new_obj_var(mp_obj_hash_t, char, sizeof(CRYAL_SHA256_CTX));
o->base.type = type;
sha256_init((CRYAL_SHA256_CTX*)o->state);
if (n_args == 1) {
hash_update(MP_OBJ_FROM_PTR(o), args[0]);
}
return MP_OBJ_FROM_PTR(o);
}
#if MICROPY_PY_UHASHLIB_SHA1
STATIC mp_obj_t sha1_update(mp_obj_t self_in, mp_obj_t arg);
STATIC mp_obj_t sha1_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 0, 1, false);
mp_obj_hash_t *o = m_new_obj_var(mp_obj_hash_t, char, sizeof(SHA1_CTX));
o->base.type = type;
SHA1_Init((SHA1_CTX*)o->state);
if (n_args == 1) {
sha1_update(MP_OBJ_FROM_PTR(o), args[0]);
}
return MP_OBJ_FROM_PTR(o);
}
#endif
STATIC mp_obj_t hash_update(mp_obj_t self_in, mp_obj_t arg) {
mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(arg, &bufinfo, MP_BUFFER_READ);
sha256_update((CRYAL_SHA256_CTX*)self->state, bufinfo.buf, bufinfo.len);
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_2(hash_update_obj, hash_update);
#if MICROPY_PY_UHASHLIB_SHA1
STATIC mp_obj_t sha1_update(mp_obj_t self_in, mp_obj_t arg) {
mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(arg, &bufinfo, MP_BUFFER_READ);
SHA1_Update((SHA1_CTX*)self->state, bufinfo.buf, bufinfo.len);
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_2(sha1_update_obj, sha1_update);
#endif
STATIC mp_obj_t hash_digest(mp_obj_t self_in) {
mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
vstr_t vstr;
vstr_init_len(&vstr, SHA256_BLOCK_SIZE);
sha256_final((CRYAL_SHA256_CTX*)self->state, (byte*)vstr.buf);
return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr);
}
MP_DEFINE_CONST_FUN_OBJ_1(hash_digest_obj, hash_digest);
#if MICROPY_PY_UHASHLIB_SHA1
STATIC mp_obj_t sha1_digest(mp_obj_t self_in) {
mp_obj_hash_t *self = MP_OBJ_TO_PTR(self_in);
vstr_t vstr;
vstr_init_len(&vstr, SHA1_SIZE);
SHA1_Final((byte*)vstr.buf, (SHA1_CTX*)self->state);
return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr);
}
MP_DEFINE_CONST_FUN_OBJ_1(sha1_digest_obj, sha1_digest);
#endif
STATIC const mp_rom_map_elem_t hash_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&hash_update_obj) },
{ MP_ROM_QSTR(MP_QSTR_digest), MP_ROM_PTR(&hash_digest_obj) },
};
STATIC MP_DEFINE_CONST_DICT(hash_locals_dict, hash_locals_dict_table);
STATIC const mp_obj_type_t sha256_type = {
{ &mp_type_type },
.name = MP_QSTR_sha256,
.make_new = hash_make_new,
.locals_dict = (void*)&hash_locals_dict,
};
#if MICROPY_PY_UHASHLIB_SHA1
STATIC const mp_rom_map_elem_t sha1_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&sha1_update_obj) },
{ MP_ROM_QSTR(MP_QSTR_digest), MP_ROM_PTR(&sha1_digest_obj) },
};
STATIC MP_DEFINE_CONST_DICT(sha1_locals_dict, sha1_locals_dict_table);
STATIC const mp_obj_type_t sha1_type = {
{ &mp_type_type },
.name = MP_QSTR_sha1,
.make_new = sha1_make_new,
.locals_dict = (void*)&sha1_locals_dict,
};
#endif
STATIC const mp_rom_map_elem_t mp_module_hashlib_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_uhashlib) },
{ MP_ROM_QSTR(MP_QSTR_sha256), MP_ROM_PTR(&sha256_type) },
#if MICROPY_PY_UHASHLIB_SHA1
{ MP_ROM_QSTR(MP_QSTR_sha1), MP_ROM_PTR(&sha1_type) },
#endif
};
STATIC MP_DEFINE_CONST_DICT(mp_module_hashlib_globals, mp_module_hashlib_globals_table);
const mp_obj_module_t mp_module_uhashlib = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&mp_module_hashlib_globals,
};
#include "crypto-algorithms/sha256.c"
#endif //MICROPY_PY_UHASHLIB
|
//
// NSString+XHLaunchAd.h
// XHLaunchAdExample
//
// Created by zhuxiaohui on 2016/6/26.
// Copyright © 2016年 it7090.com. All rights reserved.
// 代码地址:https://github.com/CoderZhuXH/XHLaunchAd
#import <Foundation/Foundation.h>
@interface NSString (XHLaunchAd)
@property(nonatomic,assign,readonly)BOOL xh_isURLString;
@property(nonatomic,copy,readonly,nonnull)NSString *xh_videoName;
@property(nonatomic,copy,readonly,nonnull)NSString *xh_md5String;
-(BOOL)xh_containsSubString:(nonnull NSString *)subString;
@end
|
/*
*
* Copyright (c) 2005
* Francois Dumont
*
* This material is provided "as is", with absolutely no warranty expressed
* or implied. Any use is at your own risk.
*
* Permission to use or copy this software for any purpose is hereby granted
* without fee, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*
*/
#ifndef _STLP_STLPORT_VERSION_H
#define _STLP_STLPORT_VERSION_H
/* The last SGI STL release we merged with */
#define __SGI_STL 0x330
/* STLport version */
#define _STLPORT_MAJOR 5
#define _STLPORT_MINOR 1
#define _STLPORT_PATCHLEVEL 5
#define _STLPORT_VERSION 0x515
#endif /* _STLP_STLPORT_VERSION_H */
|
/* PR target/95211 target/95256 */
/* { dg-do compile { target { ! ia32 } } } */
/* { dg-options "-O2 -ftree-slp-vectorize -march=skylake-avx512" } */
extern float f[4];
extern long long l[2];
extern long long ul[2];
void
fix_128 (void)
{
l[0] = f[0];
l[1] = f[1];
}
void
fixuns_128 (void)
{
ul[0] = f[0];
ul[1] = f[1];
}
void
float_128 (void)
{
f[0] = l[0];
f[1] = l[1];
}
void
floatuns_128 (void)
{
f[0] = ul[0];
f[1] = ul[1];
}
/* { dg-final { scan-assembler-times "vcvttps2qq" 2 } } */
/* { dg-final { scan-assembler-times "vcvtqq2ps" 2 } } */
|
/*
* \brief Regulator-session component
* \author Stefan Kalkowski
* \date 2013-06-13
*/
/*
* Copyright (C) 2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__REGULATOR__COMPONENT_H_
#define _INCLUDE__REGULATOR__COMPONENT_H_
#include <root/component.h>
#include <regulator_session/rpc_object.h>
#include <regulator/driver.h>
namespace Regulator {
class Session_component;
class Root;
}
class Regulator::Session_component : public Regulator::Session_rpc_object
{
private:
Driver_factory &_driver_factory;
Driver &_driver;
public:
/**
* Constructor
*/
Session_component(Regulator_id regulator_id,
Driver_factory &driver_factory)
: Session_rpc_object(regulator_id),
_driver_factory(driver_factory),
_driver(_driver_factory.create(regulator_id)) { }
/**
* Destructor
*/
~Session_component()
{
_driver.state(_id, false);
_driver_factory.destroy(_driver);
}
/***********************************
** Regulator session interface **
***********************************/
void level(unsigned long level) { _driver.level(_id, level); }
unsigned long level() { return _driver.level(_id); }
void state(bool enable) { _driver.state(_id, enable); }
bool state() { return _driver.state(_id); }
};
class Regulator::Root :
public Genode::Root_component<Regulator::Session_component>
{
private:
Driver_factory &_driver_factory;
Genode::Rpc_entrypoint &_ep;
protected:
Session_component *_create_session(const char *args)
{
using namespace Genode;
char reg_name[64];
Arg_string::find_arg(args, "regulator").string(reg_name,
sizeof(reg_name), 0);
size_t ram_quota =
Arg_string::find_arg(args, "ram_quota").ulong_value(0);
/* delete ram quota by the memory needed for the session */
size_t session_size = max((size_t)4096,
sizeof(Session_component));
if (ram_quota < session_size)
throw Root::Quota_exceeded();
if (!strlen(reg_name))
throw Root::Invalid_args();
return new (md_alloc())
Session_component(regulator_id_by_name(reg_name),
_driver_factory);
}
public:
Root(Genode::Rpc_entrypoint *session_ep,
Genode::Allocator *md_alloc,
Driver_factory &driver_factory)
: Genode::Root_component<Regulator::Session_component>(session_ep,
md_alloc),
_driver_factory(driver_factory), _ep(*session_ep) { }
};
#endif /* _INCLUDE__REGULATOR__COMPONENT_H_ */
|
/* testlib.c for c++ - test expectlib */
#include <stdio.h>
#include "expect.h"
extern "C" {
extern int write(...);
extern int strlen(...);
}
void
timedout()
{
fprintf(stderr,"timed out\n");
exit(-1);
}
char move[100];
void
read_first_move(int fd)
{
if (EXP_TIMEOUT == exp_expectl(fd,exp_glob,"first\r\n1.*\r\n",0,exp_end)) {
timedout();
}
sscanf(exp_match,"%*s 1. %s",move);
}
/* moves and counter-moves are printed out in different formats, sigh... */
void
read_counter_move(int fd)
{
switch (exp_expectl(fd,exp_glob,"*...*\r\n",0,exp_end)) {
case EXP_TIMEOUT: timedout();
case EXP_EOF: exit(-1);
}
sscanf(exp_match,"%*s %*s %*s %*s ... %s",move);
}
void
read_move(int fd)
{
switch (exp_expectl(fd,exp_glob,"*...*\r\n*.*\r\n",0,exp_end)) {
case EXP_TIMEOUT: timedout();
case EXP_EOF: exit(-1);
}
sscanf(exp_match,"%*s %*s ... %*s %*s %s",move);
}
void
send_move(int fd)
{
write(fd,move,strlen(move));
}
main(){
int fd1, fd2;
exp_loguser = 1;
exp_timeout = 3600;
if (-1 == (fd1 = exp_spawnl("chess","chess",(char *)0))) {
perror("chess");
exit(-1);
}
if (-1 == exp_expectl(fd1,exp_glob,"Chess\r\n",0,exp_end)) exit;
if (-1 == write(fd1,"first\r",6)) exit;
read_first_move(fd1);
fd2 = exp_spawnl("chess","chess",(char *)0);
if (-1 == exp_expectl(fd2,exp_glob,"Chess\r\n",0,exp_end)) exit;
for (;;) {
send_move(fd2);
read_counter_move(fd2);
send_move(fd1);
read_move(fd1);
}
}
|
// SPDX-License-Identifier: GPL-2.0
#ifndef SMRTK2SSRFC_WINDOW_H
#define SMRTK2SSRFC_WINDOW_H
#include <QMainWindow>
#include <QFileDialog>
#include <QFileInfo>
extern "C" void smartrak_import(const char *file, struct dive_table *divetable);
namespace Ui {
class Smrtk2ssrfcWindow;
}
class Smrtk2ssrfcWindow : public QMainWindow
{
Q_OBJECT
public:
explicit Smrtk2ssrfcWindow(QWidget *parent = 0);
~Smrtk2ssrfcWindow();
private:
Ui::Smrtk2ssrfcWindow *ui;
QString filter();
void updateLastUsedDir(const QString &s);
void closeCurrentFile();
private
slots:
void on_inputFilesButton_clicked();
void on_outputFileButton_clicked();
void on_importButton_clicked();
void on_exitButton_clicked();
void on_outputLine_textEdited();
void on_inputLine_textEdited();
};
#endif // SMRTK2SSRFC_WINDOW_H
|
/* lzw.c -- compress files in LZW format.
* This is a dummy version avoiding patent problems.
*/
#include <config.h>
#include "tailor.h"
#include "gzip.h"
#include "lzw.h"
static int msg_done = 0;
/* Compress in to out with lzw method. */
int lzw(in, out)
int in, out;
{
if (msg_done) return ERROR;
msg_done = 1;
fprintf(stderr,"output in compress .Z format not supported\n");
if (in != out) { /* avoid warnings on unused variables */
exit_code = ERROR;
}
return ERROR;
}
|
/* Bitset vectors.
Copyright (C) 2002, 2004, 2009-2013 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _BITSETV_H
#define _BITSETV_H
#include "bitset.h"
typedef bitset * bitsetv;
/* Create a vector of N_VECS bitsets, each of N_BITS, and of
type TYPE. */
extern bitsetv bitsetv_alloc (bitset_bindex, bitset_bindex, enum bitset_type);
/* Create a vector of N_VECS bitsets, each of N_BITS, and with
attribute hints specified by ATTR. */
extern bitsetv bitsetv_create (bitset_bindex, bitset_bindex, unsigned int);
/* Free vector of bitsets. */
extern void bitsetv_free (bitsetv);
/* Zero vector of bitsets. */
extern void bitsetv_zero (bitsetv);
/* Set vector of bitsets. */
extern void bitsetv_ones (bitsetv);
/* Given a vector BSETV of N bitsets of size N, modify its contents to
be the transitive closure of what was given. */
extern void bitsetv_transitive_closure (bitsetv);
/* Given a vector BSETV of N bitsets of size N, modify its contents to
be the reflexive transitive closure of what was given. This is
the same as transitive closure but with all bits on the diagonal
of the bit matrix set. */
extern void bitsetv_reflexive_transitive_closure (bitsetv);
/* Dump vector of bitsets. */
extern void bitsetv_dump (FILE *, const char *, const char *, bitsetv);
/* Function to debug vector of bitsets from debugger. */
extern void debug_bitsetv (bitsetv);
#endif /* _BITSETV_H */
|
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "MooseObjectAction.h"
/**
* Action that sets up BCs for porous flow module
*/
class PorousFlowAddBCAction : public MooseObjectAction
{
public:
static InputParameters validParams();
PorousFlowAddBCAction(const InputParameters & parameters);
virtual void act() override;
protected:
/**
* Setup a BC corresponding to hot/cold fluid injection
*/
void setupPorousFlowEnthalpySink();
};
|
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_PLATFORM_RETRYING_FILE_SYSTEM_H_
#define TENSORFLOW_CORE_PLATFORM_RETRYING_FILE_SYSTEM_H_
#include <string>
#include <vector>
#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/platform/file_system.h"
namespace tensorflow {
/// A wrapper to add retry logic to another file system.
class RetryingFileSystem : public FileSystem {
public:
RetryingFileSystem(std::unique_ptr<FileSystem> base_file_system,
int64 delay_microseconds = 1000000)
: base_file_system_(std::move(base_file_system)),
initial_delay_microseconds_(delay_microseconds) {}
Status NewRandomAccessFile(
const string& filename,
std::unique_ptr<RandomAccessFile>* result) override;
Status NewWritableFile(const string& fname,
std::unique_ptr<WritableFile>* result) override;
Status NewAppendableFile(const string& fname,
std::unique_ptr<WritableFile>* result) override;
Status NewReadOnlyMemoryRegionFromFile(
const string& filename,
std::unique_ptr<ReadOnlyMemoryRegion>* result) override;
Status FileExists(const string& fname) override;
Status GetChildren(const string& dir, std::vector<string>* result) override;
Status GetMatchingPaths(const string& dir,
std::vector<string>* result) override;
Status Stat(const string& fname, FileStatistics* stat) override;
Status DeleteFile(const string& fname) override;
Status CreateDir(const string& dirname) override;
Status DeleteDir(const string& dirname) override;
Status GetFileSize(const string& fname, uint64* file_size) override;
Status RenameFile(const string& src, const string& target) override;
Status IsDirectory(const string& dir) override;
Status DeleteRecursively(const string& dirname, int64* undeleted_files,
int64* undeleted_dirs) override;
void FlushCaches() override;
private:
std::unique_ptr<FileSystem> base_file_system_;
const int64 initial_delay_microseconds_;
TF_DISALLOW_COPY_AND_ASSIGN(RetryingFileSystem);
};
} // namespace tensorflow
#endif // TENSORFLOW_CORE_PLATFORM_RETRYING_FILE_SYSTEM_H_
|
/*-------------------------------------------------------------------------
*
* planner.h
* prototypes for planner.c.
*
*
* Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/planner.h
*
*-------------------------------------------------------------------------
*/
#ifndef PLANNER_H
#define PLANNER_H
#include "nodes/plannodes.h"
#include "nodes/relation.h"
/* Hook for plugins to get control in planner() */
typedef PlannedStmt *(*planner_hook_type) (Query *parse,
int cursorOptions,
ParamListInfo boundParams);
extern PGDLLIMPORT planner_hook_type planner_hook;
extern PlannedStmt *planner(Query *parse, int cursorOptions,
ParamListInfo boundParams);
extern PlannedStmt *standard_planner(Query *parse, int cursorOptions,
ParamListInfo boundParams);
extern Plan *subquery_planner(PlannerGlobal *glob, Query *parse,
PlannerInfo *parent_root,
bool hasRecursion, double tuple_fraction,
PlannerInfo **subroot);
extern Expr *expression_planner(Expr *expr);
extern bool plan_cluster_use_sort(Oid tableOid, Oid indexOid);
#endif /* PLANNER_H */
|
/*********************************************************************/
/* Copyright 2009, 2010 The University of Texas at Austin. */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or */
/* without modification, are permitted provided that the following */
/* conditions are met: */
/* */
/* 1. Redistributions of source code must retain the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer. */
/* */
/* 2. Redistributions in binary form must reproduce the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer in the documentation and/or other materials */
/* provided with the distribution. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */
/* AUSTIN ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, */
/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
/* DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT */
/* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
/* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */
/* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */
/* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
/* POSSIBILITY OF SUCH DAMAGE. */
/* */
/* The views and conclusions contained in the software and */
/* documentation are those of the authors and should not be */
/* interpreted as representing official policies, either expressed */
/* or implied, of The University of Texas at Austin. */
/*********************************************************************/
#ifndef COMMON_ALPHA
#define COMMON_ALPHA
#ifndef ASSEMBLER
#define MB asm("mb")
#define WMB asm("wmb")
static void __inline blas_lock(unsigned long *address){
#ifndef __DECC
unsigned long tmp1, tmp2;
asm volatile(
"1: ldq %1, %0\n"
" bne %1, 2f\n"
" ldq_l %1, %0\n"
" bne %1, 2f\n"
" or %1, 1, %2\n"
" stq_c %2, %0\n"
" beq %2, 2f\n"
" mb\n "
" br $31, 3f\n"
"2: br $31, 1b\n"
"3:\n" : "=m"(*address), "=&r"(tmp1), "=&r"(tmp2) : : "memory");
#else
asm (
"10:"
" ldq %t0, 0(%a0); "
" bne %t0, 20f; "
" ldq_l %t0, 0(%a0); "
" bne %t0, 20f; "
" or %t0, 1, %t1;"
" stq_c %t1, 0(%a0); "
" beq %t1, 20f; "
" mb; "
" br %r31,30f; "
"20: "
" br %r31,10b; "
"30:", address);
#endif
}
static __inline unsigned int rpcc(void){
unsigned int r0;
#ifndef __DECC
asm __volatile__("rpcc %0" : "=r"(r0) : : "memory");
#else
r0 = asm("rpcc %v0");
#endif
return r0;
}
#define HALT ldq $0, 0($0)
#ifndef __DECC
#define GET_IMAGE(res) asm __volatile__("fmov $f1, %0" : "=f"(res) : : "memory")
#else
#define GET_IMAGE(res) res = dasm("fmov $f1, %f0")
#endif
#ifdef SMP
#ifdef USE64BITINT
static __inline long blas_quickdivide(long x, long y){
return x/y;
}
#else
extern unsigned int blas_quick_divide_table[];
static __inline int blas_quickdivide(unsigned int x, unsigned int y){
if (y <= 1) return x;
return (int)((x * (unsigned long)blas_quick_divide_table[y]) >> 32);
}
#endif
#endif
#define BASE_ADDRESS ((0x1b0UL << 33) | (0x1c0UL << 23) | (0x000UL << 13))
#ifndef PAGESIZE
#define PAGESIZE ( 8UL << 10)
#define HUGE_PAGESIZE ( 4 << 20)
#endif
#define BUFFER_SIZE (32UL << 20)
#else
#ifndef F_INTERFACE
#define REALNAME ASMNAME
#else
#define REALNAME ASMFNAME
#endif
#define PROLOGUE \
.arch ev6; \
.set noat; \
.set noreorder; \
.text; \
.align 5; \
.globl REALNAME; \
.ent REALNAME; \
REALNAME:
#ifdef PROFILE
#define PROFCODE \
ldgp $gp, 0($27); \
lda $28, _mcount; \
jsr $28, ($28), _mcount; \
.prologue 1
#else
#define PROFCODE .prologue 0
#endif
#if defined(__linux__) && defined(__ELF__)
#define GNUSTACK .section .note.GNU-stack,"",@progbits
#else
#define GNUSTACK
#endif
#define EPILOGUE \
.end REALNAME; \
.ident VERSION; \
GNUSTACK
#endif
#ifdef DOUBLE
#define SXADDQ s8addq
#define SXSUBL s8subl
#define LD ldt
#define ST stt
#define STQ stq
#define ADD addt/su
#define SUB subt/su
#define MUL mult/su
#define DIV divt/su
#else
#define SXADDQ s4addq
#define SXSUBL s4subl
#define LD lds
#define ST sts
#define STQ stl
#define ADD adds/su
#define SUB subs/su
#define MUL muls/su
#define DIV divs/su
#endif
#endif
|
/*!
* \copy
* Copyright (c) 2009-2013, Cisco Systems
* 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.
*
* 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.
*
*
* \file expand_pic.h
*
* \brief Interface for expanding reconstructed picture to be used for reference
*
* \date 06/08/2009
*************************************************************************************
*/
#ifndef EXPAND_PICTURE_H
#define EXPAND_PICTURE_H
#include "typedefs.h"
#if defined(__cplusplus)
extern "C" {
#endif//__cplusplus
#define PADDING_LENGTH 32 // reference extension
#define CHROMA_PADDING_LENGTH 16 // chroma reference extension
#if defined(X86_ASM)
void ExpandPictureLuma_sse2 (uint8_t* pDst,
const int32_t kiStride,
const int32_t kiPicW,
const int32_t kiPicH);
void ExpandPictureChromaAlign_sse2 (uint8_t* pDst,
const int32_t kiStride,
const int32_t kiPicW,
const int32_t kiPicH);
void ExpandPictureChromaUnalign_sse2 (uint8_t* pDst,
const int32_t kiStride,
const int32_t kiPicW,
const int32_t kiPicH);
#endif//X86_ASM
#if defined(HAVE_NEON)
void ExpandPictureLuma_neon (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW, const int32_t kiPicH);
void ExpandPictureChroma_neon (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW, const int32_t kiPicH);
#endif
#if defined(HAVE_NEON_AARCH64)
void ExpandPictureLuma_AArch64_neon (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW, const int32_t kiPicH);
void ExpandPictureChroma_AArch64_neon (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW,
const int32_t kiPicH);
#endif
#if defined(HAVE_MMI)
void ExpandPictureLuma_mmi (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW,
const int32_t kiPicH);
void ExpandPictureChromaAlign_mmi (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW,
const int32_t kiPicH);
void ExpandPictureChromaUnalign_mmi (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW,
const int32_t kiPicH);
#endif//HAVE_MMI
typedef void (*PExpandPictureFunc) (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW, const int32_t kiPicH);
typedef struct TagExpandPicFunc {
PExpandPictureFunc pfExpandLumaPicture;
PExpandPictureFunc pfExpandChromaPicture[2];
} SExpandPicFunc;
void PadMBLuma_c (uint8_t*& pDst, const int32_t& kiStride, const int32_t& kiPicW, const int32_t& kiPicH,
const int32_t& kiMbX, const int32_t& kiMbY, const int32_t& kiMBWidth, const int32_t& kiMBHeight);
void PadMBChroma_c (uint8_t*& pDst, const int32_t& kiStride, const int32_t& kiPicW, const int32_t& kiPicH,
const int32_t& kiMbX, const int32_t& kiMbY, const int32_t& kiMBWidth, const int32_t& kiMBHeight);
void ExpandReferencingPicture (uint8_t* pData[3], int32_t iWidth, int32_t iHeight, int32_t iStride[3],
PExpandPictureFunc pExpLuma, PExpandPictureFunc pExpChrom[2]);
void InitExpandPictureFunc (SExpandPicFunc* pExpandPicFunc, const uint32_t kuiCPUFlags);
#if defined(__cplusplus)
}
#endif//__cplusplus
#endif
|
// 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 ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_
#define ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_
#include <set>
#include "ash/ash_export.h"
#include "ash/display/window_tree_host_manager.h"
#include "ash/wm/wm_types.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "ui/events/event_handler.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/wm/public/window_move_client.h"
namespace aura {
class Window;
}
namespace ui {
class LocatedEvent;
}
namespace ash {
class WindowResizer;
class ASH_EXPORT ToplevelWindowEventHandler
: public ui::EventHandler,
public aura::client::WindowMoveClient,
public WindowTreeHostManager::Observer {
public:
ToplevelWindowEventHandler();
~ToplevelWindowEventHandler() override;
// Overridden from ui::EventHandler:
void OnKeyEvent(ui::KeyEvent* event) override;
void OnMouseEvent(ui::MouseEvent* event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
// Overridden form aura::client::WindowMoveClient:
aura::client::WindowMoveResult RunMoveLoop(
aura::Window* source,
const gfx::Vector2d& drag_offset,
aura::client::WindowMoveSource move_source) override;
void EndMoveLoop() override;
// Overridden form ash::WindowTreeHostManager::Observer:
void OnDisplayConfigurationChanging() override;
private:
class ScopedWindowResizer;
enum DragCompletionStatus {
DRAG_COMPLETE,
DRAG_REVERT,
// To be used when WindowResizer::GetTarget() is destroyed. Neither
// completes nor reverts the drag because both access the WindowResizer's
// window.
DRAG_RESIZER_WINDOW_DESTROYED
};
// Attempts to start a drag if one is not already in progress. Returns true if
// successful.
bool AttemptToStartDrag(aura::Window* window,
const gfx::Point& point_in_parent,
int window_component,
aura::client::WindowMoveSource source);
// Completes or reverts the drag if one is in progress. Returns true if a
// drag was completed or reverted.
bool CompleteDrag(DragCompletionStatus status);
void HandleMousePressed(aura::Window* target, ui::MouseEvent* event);
void HandleMouseReleased(aura::Window* target, ui::MouseEvent* event);
// Called during a drag to resize/position the window.
void HandleDrag(aura::Window* target, ui::LocatedEvent* event);
// Called during mouse moves to update window resize shadows.
void HandleMouseMoved(aura::Window* target, ui::LocatedEvent* event);
// Called for mouse exits to hide window resize shadows.
void HandleMouseExited(aura::Window* target, ui::LocatedEvent* event);
// Called when mouse capture is lost.
void HandleCaptureLost(ui::LocatedEvent* event);
// Sets |window|'s state type to |new_state_type|. Called after the drag has
// been completed for fling gestures.
void SetWindowStateTypeFromGesture(aura::Window* window,
wm::WindowStateType new_state_type);
// Invoked from ScopedWindowResizer if the window is destroyed.
void ResizerWindowDestroyed();
// The hittest result for the first finger at the time that it initially
// touched the screen. |first_finger_hittest_| is one of ui/base/hit_test.h
int first_finger_hittest_;
// The window bounds when the drag was started. When a window is minimized,
// maximized or snapped via a swipe/fling gesture, the restore bounds should
// be set to the bounds of the window when the drag was started.
gfx::Rect pre_drag_window_bounds_;
// Are we running a nested message loop from RunMoveLoop().
bool in_move_loop_;
// Is a window move/resize in progress because of gesture events?
bool in_gesture_drag_;
// Whether the drag was reverted. Set by CompleteDrag().
bool drag_reverted_;
scoped_ptr<ScopedWindowResizer> window_resizer_;
base::Closure quit_closure_;
// Used to track if this object is deleted while running a nested message
// loop. If non-null the destructor sets this to true.
bool* destroyed_;
DISALLOW_COPY_AND_ASSIGN(ToplevelWindowEventHandler);
};
} // namespace aura
#endif // ASH_WM_TOPLEVEL_WINDOW_EVENT_HANDLER_H_
|
/* Copyright (c) 2006-2007 Christopher J. W. Lloyd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <Foundation/NSObject.h>
@class NSNotification;
@interface NSNotificationObserver : NSObject {
id _observer;
SEL _selector;
}
- initWithObserver:object selector:(SEL)selector;
- observer;
- (void)postNotification:(NSNotification *)note;
@end
|
/******************************************************************************
* Spine Runtimes Software License
* Version 2
*
* Copyright (c) 2013, Esoteric Software
* All rights reserved.
*
* You are granted a perpetual, non-exclusive, non-sublicensable and
* non-transferable license to install, execute and perform the Spine Runtimes
* Software (the "Software") solely for internal use. Without the written
* permission of Esoteric Software, you may not (a) modify, translate, adapt or
* otherwise create derivative works, improvements of the Software or develop
* new applications using the Software or (b) remove, delete, alter or obscure
* any trademarks or any copyright, trademark, patent or other intellectual
* property or proprietary rights notices on or in the Software, including
* any copy thereof. Redistributions in binary or source form must include
* this license and terms. THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE
* "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 ESOTERIC SOFTARE 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 <spine/EventData.h>
#include <spine/extension.h>
spEventData* spEventData_create (const char* name) {
spEventData* self = NEW(spEventData);
MALLOC_STR(self->name, name);
return self;
}
void spEventData_dispose (spEventData* self) {
FREE(self->stringValue);
FREE(self->name);
FREE(self);
}
|
// Created by Monte Hurd on 11/10/14.
// Copyright (c) 2014 Wikimedia Foundation. Provided under MIT-style license; please copy and modify!
#import <UIKit/UIKit.h>
@interface UIView (WMF_RoundCorners)
/**
* @warning Watch out for race conditions with auto layout when using these methods! Be sure to call them after layout,
* e.g. in @c viewDidLayoutSubviews.
*/
/// Round all corners of the receiver, making it circular.
- (void)wmf_makeCircular;
/**
* Round the given corners of the receiver.
* @param corners The corners to apply rounding to.
* @param radius The radius to apply to @c corners.
*/
- (void)wmf_roundCorners:(UIRectCorner)corners toRadius:(float)radius;
@end
|
/*
* $Id:$
*
* Copyright (C) 2012 Piotr Esden-Tempski <piotr@esden.net>
*
* 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.
*/
#include "mcu.h"
#include "mcu_periph/sys_time.h"
#include "led.h"
#include "subsystems/datalink/downlink.h"
#include "mcu_periph/uart.h"
#include "mcu_periph/can.h"
static inline void main_init( void );
static inline void main_periodic_task( void );
static inline void main_event_task( void );
void main_on_can_msg(uint32_t id, uint8_t *data, int len);
uint8_t tx_data[8];
uint8_t rx_data[8];
bool new_can_data = false;
int main(void) {
main_init();
tx_data[0] = 0;
tx_data[1] = 0;
tx_data[2] = 0;
tx_data[3] = 0;
tx_data[4] = 0;
tx_data[5] = 0;
tx_data[6] = 0;
tx_data[7] = 0;
new_can_data = false;
while(1) {
if (sys_time_check_and_ack_timer(0))
main_periodic_task();
main_event_task();
}
return 0;
}
static inline void main_init( void ) {
mcu_init();
sys_time_register_timer((0.5/PERIODIC_FREQUENCY), NULL);
ppz_can_init(main_on_can_msg);
}
static inline void main_periodic_task( void ) {
tx_data[0]+=1;
ppz_can_transmit(0, tx_data, 8);
LED_PERIODIC();
DOWNLINK_SEND_ALIVE(DefaultChannel, DefaultDevice, 16, MD5SUM);
}
static inline void main_event_task( void ) {
if (new_can_data) {
if (rx_data[0] & 0x10) {
LED_ON(2);
} else {
LED_OFF(2);
}
}
if (new_can_data) {
if (rx_data[0] & 0x20) {
LED_ON(3);
} else {
LED_OFF(3);
}
}
if (new_can_data) {
if (rx_data[0] & 0x40) {
LED_ON(4);
} else {
LED_OFF(4);
}
}
if (new_can_data) {
if (rx_data[0] & 0x80) {
LED_ON(5);
} else {
LED_OFF(5);
}
}
}
void main_on_can_msg(uint32_t id, uint8_t *data, int len)
{
for (int i = 0; i<8; i++) {
rx_data[i] = data[i];
}
new_can_data = true;
}
|
/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
#include "test_sve_acle.h"
/*
** qdmlalt_lane_0_s64_tied1:
** sqdmlalt z0\.d, z4\.s, z5\.s\[0\]
** ret
*/
TEST_DUAL_Z (qdmlalt_lane_0_s64_tied1, svint64_t, svint32_t,
z0 = svqdmlalt_lane_s64 (z0, z4, z5, 0),
z0 = svqdmlalt_lane (z0, z4, z5, 0))
/*
** qdmlalt_lane_0_s64_tied2:
** mov (z[0-9]+)\.d, z0\.d
** movprfx z0, z4
** sqdmlalt z0\.d, \1\.s, z1\.s\[0\]
** ret
*/
TEST_DUAL_Z_REV (qdmlalt_lane_0_s64_tied2, svint64_t, svint32_t,
z0_res = svqdmlalt_lane_s64 (z4, z0, z1, 0),
z0_res = svqdmlalt_lane (z4, z0, z1, 0))
/*
** qdmlalt_lane_0_s64_tied3:
** mov (z[0-9]+)\.d, z0\.d
** movprfx z0, z4
** sqdmlalt z0\.d, z1\.s, \1\.s\[0\]
** ret
*/
TEST_DUAL_Z_REV (qdmlalt_lane_0_s64_tied3, svint64_t, svint32_t,
z0_res = svqdmlalt_lane_s64 (z4, z1, z0, 0),
z0_res = svqdmlalt_lane (z4, z1, z0, 0))
/*
** qdmlalt_lane_0_s64_untied:
** movprfx z0, z1
** sqdmlalt z0\.d, z4\.s, z5\.s\[0\]
** ret
*/
TEST_DUAL_Z (qdmlalt_lane_0_s64_untied, svint64_t, svint32_t,
z0 = svqdmlalt_lane_s64 (z1, z4, z5, 0),
z0 = svqdmlalt_lane (z1, z4, z5, 0))
/*
** qdmlalt_lane_z15_s64:
** str d15, \[sp, -16\]!
** sqdmlalt z0\.d, z1\.s, z15\.s\[1\]
** ldr d15, \[sp\], 16
** ret
*/
TEST_DUAL_LANE_REG (qdmlalt_lane_z15_s64, svint64_t, svint32_t, z15,
z0 = svqdmlalt_lane_s64 (z0, z1, z15, 1),
z0 = svqdmlalt_lane (z0, z1, z15, 1))
/*
** qdmlalt_lane_z16_s64:
** mov (z[0-9]|z1[0-5])\.d, z16\.d
** sqdmlalt z0\.d, z1\.s, \1\.s\[1\]
** ret
*/
TEST_DUAL_LANE_REG (qdmlalt_lane_z16_s64, svint64_t, svint32_t, z16,
z0 = svqdmlalt_lane_s64 (z0, z1, z16, 1),
z0 = svqdmlalt_lane (z0, z1, z16, 1))
|
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// copyright : (C) 2008 by Eran Ifrah
// file name : depends_dlg.h
//
// -------------------------------------------------------------------------
// A
// _____ _ _ _ _
// / __ \ | | | | (_) |
// | / \/ ___ __| | ___| | _| |_ ___
// | | / _ \ / _ |/ _ \ | | | __/ _ )
// | \__/\ (_) | (_| | __/ |___| | || __/
// \____/\___/ \__,_|\___\_____/_|\__\___|
//
// F i l e
//
// 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 __depends_dlg__
#define __depends_dlg__
#include <wx/wx.h>
#include <wx/choicebk.h>
#include <wx/statline.h>
#include <wx/button.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DependenciesDlg
///////////////////////////////////////////////////////////////////////////////
class DependenciesDlg : public wxDialog
{
private:
protected:
wxChoicebook* m_book;
wxStaticLine* m_staticline1;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
wxString m_projectName;
void Init();
void DoSelectProject();
virtual void OnButtonOK(wxCommandEvent& event);
virtual void OnButtonCancel(wxCommandEvent& event);
public:
DependenciesDlg(wxWindow* parent,
const wxString& projectName,
int id = wxID_ANY,
wxString title = _("Build Order"),
wxPoint pos = wxDefaultPosition,
wxSize size = wxSize(700, 450),
int style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
virtual ~DependenciesDlg();
};
#endif //__depends_dlg__
|
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * 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.
*
* 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.
*/
#include <pthread.h>
struct user_desc {
unsigned int entry_number;
unsigned long base_addr;
unsigned int limit;
unsigned int seg_32bit:1;
unsigned int contents:2;
unsigned int read_exec_only:1;
unsigned int limit_in_pages:1;
unsigned int seg_not_present:1;
unsigned int useable:1;
unsigned int empty:25;
};
extern int __set_thread_area(struct user_desc *u_info);
/* the following can't be const, since the first call will
* update the 'entry_number' field
*/
static struct user_desc _tls_desc =
{
-1,
0,
0x1000,
1,
0,
0,
1,
0,
1,
0
};
static pthread_mutex_t _tls_desc_lock = PTHREAD_MUTEX_INITIALIZER;
struct _thread_area_head {
void *self;
};
/* we implement thread local storage through the gs: segment descriptor
* we create a segment descriptor for the tls
*/
int __set_tls(void *ptr)
{
int rc, segment;
pthread_mutex_lock(&_tls_desc_lock);
_tls_desc.base_addr = (unsigned long)ptr;
/* We also need to write the location of the tls to ptr[0] */
((struct _thread_area_head *)ptr)->self = ptr;
rc = __set_thread_area( &_tls_desc );
if (rc != 0)
{
/* could not set thread local area */
pthread_mutex_unlock(&_tls_desc_lock);
return -1;
}
/* this weird computation comes from GLibc */
segment = _tls_desc.entry_number*8 + 3;
asm __volatile__ (
" movw %w0, %%gs" :: "q"(segment)
);
pthread_mutex_unlock(&_tls_desc_lock);
return 0;
}
|
/* -*- c++ -*- */
/*
* Copyright 2002 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 _QA_INTERLEAVER_FIFO_H_
#define _QA_INTERLEAVER_FIFO_H_
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestCase.h>
#include <interleaver_fifo.h>
class qa_interleaver_fifo : public CppUnit::TestCase {
private:
interleaver_fifo<int> *fifo;
public:
void tearDown (){
delete fifo;
fifo = 0;
}
CPPUNIT_TEST_SUITE (qa_interleaver_fifo);
CPPUNIT_TEST (t0);
CPPUNIT_TEST (t1);
CPPUNIT_TEST (t2);
CPPUNIT_TEST_SUITE_END ();
private:
void t0 ();
void t1 ();
void t2 ();
};
#endif /* _QA_INTERLEAVER_FIFO_H_ */
|
/*
* Unix SMB/CIFS implementation.
* collected prototypes header
*
* frozen from "make proto" in May 2008
*
* Copyright (C) Michael Adam 2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _NTLM_AUTH_PROTO_H_
#define _NTLM_AUTH_PROTO_H_
/* The following definitions come from utils/ntlm_auth.c */
const char *get_winbind_domain(void);
const char *get_winbind_netbios_name(void);
DATA_BLOB get_challenge(void) ;
NTSTATUS contact_winbind_auth_crap(const char *username,
const char *domain,
const char *workstation,
const DATA_BLOB *challenge,
const DATA_BLOB *lm_response,
const DATA_BLOB *nt_response,
uint32_t flags,
uint32_t extra_logon_parameters,
uint8_t lm_key[8],
uint8_t user_session_key[16],
uint8_t *pauthoritative,
char **error_string,
char **unix_name);
/* The following definitions come from utils/ntlm_auth_diagnostics.c */
bool diagnose_ntlm_auth(void);
int get_pam_winbind_config(void);
#endif /* _NTLM_AUTH_PROTO_H_ */
|
/*
* Copyright (C) 2014 Loci Controls Inc.
* 2018 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.
*/
/**
* @defgroup cpu_cc2538_gptimer CC2538 General Purpose Timer
* @ingroup cpu_cc2538_regs
* @{
*
* @file
* @brief CC2538 General Purpose Timer (GPTIMER) driver
*
* @author Ian Martin <ian@locicontrols.com>
* @author Sebastian Meiling <s@mlng.net>
*/
#ifndef CC2538_GPTIMER_H
#define CC2538_GPTIMER_H
#include <stdint.h>
#include "cc2538.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Timer modes
*/
enum {
GPTIMER_ONE_SHOT_MODE = 1, /**< GPTIMER one-shot mode */
GPTIMER_PERIODIC_MODE = 2, /**< GPTIMER periodic mode */
GPTIMER_CAPTURE_MODE = 3, /**< GPTIMER capture mode */
};
/**
* @brief Timer width configuration
*/
enum {
GPTMCFG_32_BIT_TIMER = 0, /**< 32-bit timer configuration */
GPTMCFG_32_BIT_REAL_TIME_CLOCK = 1, /**< 32-bit real-time clock */
GPTMCFG_16_BIT_TIMER = 4, /**< 16-bit timer configuration */
};
/**
* @brief GPTIMER component registers
*/
typedef struct {
cc2538_reg_t CFG; /**< GPTIMER Configuration */
cc2538_reg_t TAMR; /**< GPTIMER Timer A mode */
cc2538_reg_t TBMR; /**< GPTIMER Timer B mode */
cc2538_reg_t CTL; /**< GPTIMER Control */
cc2538_reg_t SYNC; /**< GPTIMER Synchronize */
cc2538_reg_t RESERVED2; /**< Reserved word */
cc2538_reg_t IMR; /**< GPTIMER Interrupt Mask */
cc2538_reg_t RIS; /**< GPTIMER Raw Interrupt Status */
cc2538_reg_t MIS; /**< GPTIMER Masked Interrupt Status */
cc2538_reg_t ICR; /**< GPTIMER Interrupt Clear */
cc2538_reg_t TAILR; /**< GPTIMER Timer A Interval Load */
cc2538_reg_t TBILR; /**< GPTIMER Timer B Interval Load */
cc2538_reg_t TAMATCHR; /**< GPTIMER Timer A Match */
cc2538_reg_t TBMATCHR; /**< GPTIMER Timer B Match */
cc2538_reg_t TAPR; /**< GPTIMER Timer A Prescale Register */
cc2538_reg_t TBPR; /**< GPTIMER Timer B Prescale Register */
cc2538_reg_t TAPMR; /**< GPTIMER Timer A Prescale Match Register */
cc2538_reg_t TBPMR; /**< GPTIMER Timer B Prescale Match Register */
cc2538_reg_t TAR; /**< GPTIMER Timer A */
cc2538_reg_t TBR; /**< GPTIMER Timer B */
cc2538_reg_t TAV; /**< GPTIMER Timer A Value */
cc2538_reg_t TBV; /**< GPTIMER Timer B Value */
cc2538_reg_t RESERVED3; /**< Reserved word */
cc2538_reg_t TAPS; /**< GPTIMER Timer A Prescale Snapshot */
cc2538_reg_t TBPS; /**< GPTIMER Timer B Prescale Snapshot */
cc2538_reg_t TAPV; /**< GPTIMER Timer A Prescale Value */
cc2538_reg_t TBPV; /**< GPTIMER Timer B Prescale Value */
cc2538_reg_t RESERVED[981]; /**< Reserved */
cc2538_reg_t PP; /**< GPTIMER Peripheral Properties */
cc2538_reg_t RESERVED4[15]; /**< Reserved */
} cc2538_gptimer_t;
#ifdef __cplusplus
} /* end extern "C" */
#endif
#endif /* CC2538_GPTIMER_H */
/** @} */
|
/*
* Copyright (C) 2016 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @defgroup cpu_nrf52 Nordic nRF52 MCU
* @ingroup cpu
* @brief Nordic nRF52 family of CPUs
* @{
*
* @file
* @brief nRF52 specific CPU configuration
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
*/
#ifndef CPU_CONF_H
#define CPU_CONF_H
#include "cpu_conf_common.h"
#ifdef CPU_MODEL_NRF52832XXAA
#include "vendor/nrf52.h"
#include "vendor/nrf52_bitfields.h"
#elif defined(CPU_MODEL_NRF52840XXAA)
#include "vendor/nrf52840.h"
#include "vendor/nrf52840_bitfields.h"
#else
#error "The CPU_MODEL of your board is currently not supported"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name ARM Cortex-M specific CPU configuration
* @{
*/
#define CPU_DEFAULT_IRQ_PRIO (2U)
#define CPU_FLASH_BASE (0x00000000)
#ifdef CPU_MODEL_NRF52832XXAA
#define CPU_IRQ_NUMOF (38U)
#elif CPU_MODEL_NRF52840XXAA
#define CPU_IRQ_NUMOF (46U)
#endif
/** @} */
/**
* @brief Flash page configuration
* @{
*/
#define FLASHPAGE_SIZE (4096U)
#if defined(CPU_MODEL_NRF52832XXAA)
#define FLASHPAGE_NUMOF (128U)
#elif defined(CPU_MODEL_NRF52840XXAA)
#define FLASHPAGE_NUMOF (256U)
#endif
/* The minimum block size which can be written is 4B. However, the erase
* block is always FLASHPAGE_SIZE.
*/
#define FLASHPAGE_RAW_BLOCKSIZE (4U)
/* Writing should be always 4 bytes aligned */
#define FLASHPAGE_RAW_ALIGNMENT (4U)
/** @} */
/**
* @brief SoftDevice settings
* @{
*/
#ifdef SOFTDEVICE_PRESENT
#ifndef DONT_OVERRIDE_NVIC
#include "nrf_soc.h"
#undef NVIC_SetPriority
#define NVIC_SetPriority sd_nvic_SetPriority
#endif /* DONT_OVERRIDE_NVIC */
#endif /* SOFTDEVICE_PRESENT */
/** @} */
/**
* @brief Put the CPU in the low-power 'wait for event' state
*/
static inline void nrf52_sleep(void)
{
__SEV();
__WFE();
__asm("nop");
}
#ifdef __cplusplus
}
#endif
#endif /* CPU_CONF_H */
/** @} */
|
/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*-
*
* librsync -- the library for network deltas
* $Id: msg.c,v 1.15 2003/06/12 05:47:22 wayned Exp $
*
* Copyright (C) 2000, 2001 by Martin Pool <mbp@samba.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
| Welcome to Arco AM/PM Mini-Market. We
| would like to advise our customers
| that any individual who offers to
| pump gas, wash windows or solicit
| products is not employed by or
| associated with this facility. We
| discourage any contact with these
| individuals and ask that you report
| any problems to uniformed personal
| inside. Thankyou for shopping at
| Arco, and have a nice day.
*/
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include "librsync.h"
/*
* TODO: (Suggestion by tridge) Add a function which outputs a
* complete text description of a job, including only the fields
* relevant to the current encoding function.
*/
/** \brief Translate from rs_result to human-readable messages. */
char const *rs_strerror(rs_result r)
{
switch (r) {
case RS_DONE:
return "OK";
case RS_RUNNING:
return "still running";
case RS_BLOCKED:
return "blocked waiting for input or output buffers";
case RS_BAD_MAGIC:
return "bad magic number at start of stream";
case RS_INPUT_ENDED:
return "unexpected end of input";
case RS_CORRUPT:
return "stream corrupt";
case RS_UNIMPLEMENTED:
return "unimplemented case";
case RS_MEM_ERROR:
return "out of memory";
case RS_IO_ERROR:
return "IO error";
case RS_SYNTAX_ERROR:
return "bad command line syntax";
case RS_INTERNAL_ERROR:
return "library internal error";
default:
return "unexplained problem";
}
}
|
/*
* Version.h
*
* Created on: Mar 9, 2017
* Author: eski
*/
#ifndef INC_VERSION_H_
#define INC_VERSION_H_
#define SDK_VERSION "2.0"
#endif /* INC_VERSION_H_ */
|
/*
* Copyright 2011 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.
*/
// Author: morlovich@google.com (Maksim Orlovich)
//
// A wrapper around PthreadThreadSystem that takes care of some signal masking
// issues that arise in forking servers. We prefer pthreads to APR as APR
// mutex, etc., creation requires pools which are generally thread unsafe,
// introducing some additional risks.
#ifndef PAGESPEED_SYSTEM_SYSTEM_THREAD_SYSTEM_H_
#define PAGESPEED_SYSTEM_SYSTEM_THREAD_SYSTEM_H_
#include "pagespeed/kernel/base/basictypes.h"
#include "pagespeed/kernel/thread/pthread_thread_system.h"
namespace net_instaweb {
class SystemThreadSystem : public PthreadThreadSystem {
public:
SystemThreadSystem();
virtual ~SystemThreadSystem();
// It's not safe to start threads in a process that will later fork. In order
// to enforce this, call PermitThreadStarting() in the child process right
// after forking, and DCHECK-fail if something tries to start a thread before
// then.
void PermitThreadStarting();
protected:
virtual void BeforeThreadRunHook();
private:
bool may_start_threads_;
DISALLOW_COPY_AND_ASSIGN(SystemThreadSystem);
};
} // namespace net_instaweb
#endif // PAGESPEED_SYSTEM_SYSTEM_THREAD_SYSTEM_H_
|
/****** Form Header File *******/
#ifndef FORM_H
#define FORM_H
/***** Shared Definitions *****/
#include "form.d"
/***** Function Declarations *****/
PublicFnDecl FORM *FORM_read(char const *filename, int isBuffer);
PublicFnDecl PAGE_Action FORM_handler(
FORM *form, CUR_WINDOW *win, PAGE_Action action
);
PublicFnDecl void FORM_menuToForm();
PublicFnDecl void FORM_centerFormElts(FORM *fptr, int width);
#endif
/************************************************************************
form.h 2 replace /users/ees/interface
860730 15:33:11 ees
************************************************************************/
/************************************************************************
form.h 3 replace /users/lis/frontend/M2/sys
870811 17:04:30 m2 Curses, VAX conversion, and editor fixes/enhancements
************************************************************************/
/************************************************************************
form.h 4 replace /users/lis/frontend/M2/sys
880505 11:04:15 m2 Apollo and VAX port
************************************************************************/
|
// Copyright 2018 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 PPAPI_TESTS_TEST_TCP_SOCKET_PRIVATE_CRASH_H_
#define PPAPI_TESTS_TEST_TCP_SOCKET_PRIVATE_CRASH_H_
#include <string>
#include "ppapi/c/pp_stdint.h"
#include "ppapi/tests/test_case.h"
class TestTCPSocketPrivateCrash : public TestCase {
public:
explicit TestTCPSocketPrivateCrash(TestingInstance* instance);
// TestCase implementation.
virtual bool Init();
virtual void RunTests(const std::string& filter);
private:
std::string TestResolve();
};
#endif // PPAPI_TESTS_TEST_TCP_SOCKET_PRIVATE_CRASH_H_
|
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file fltRecord.h
* @author drose
* @date 2000-08-24
*/
#ifndef FLTRECORD_H
#define FLTRECORD_H
#include "pandatoolbase.h"
#include "fltOpcode.h"
#include "fltError.h"
#include "typedObject.h"
#include "typedReferenceCount.h"
#include "pointerTo.h"
class FltHeader;
class FltRecordReader;
class FltRecordWriter;
class DatagramIterator;
/**
* The base class for all kinds of records in a MultiGen OpenFlight file. A
* flt file consists of a hierarchy of "beads" of various kinds, each of which
* may be followed by n ancillary records, written sequentially to the file.
*/
class FltRecord : public TypedReferenceCount {
public:
FltRecord(FltHeader *header);
virtual ~FltRecord();
int get_num_children() const;
FltRecord *get_child(int n) const;
void clear_children();
void add_child(FltRecord *child);
int get_num_subfaces() const;
FltRecord *get_subface(int n) const;
void clear_subfaces();
void add_subface(FltRecord *subface);
int get_num_extensions() const;
FltRecord *get_extension(int n) const;
void clear_extensions();
void add_extension(FltRecord *extension);
int get_num_ancillary() const;
FltRecord *get_ancillary(int n) const;
void clear_ancillary();
void add_ancillary(FltRecord *ancillary);
bool has_comment() const;
const std::string &get_comment() const;
void clear_comment();
void set_comment(const std::string &comment);
void check_remaining_size(const DatagramIterator &di,
const std::string &name = std::string()) const;
virtual void apply_converted_filenames();
virtual void output(std::ostream &out) const;
virtual void write(std::ostream &out, int indent_level = 0) const;
protected:
void write_children(std::ostream &out, int indent_level) const;
static bool is_ancillary(FltOpcode opcode);
FltRecord *create_new_record(FltOpcode opcode) const;
FltError read_record_and_children(FltRecordReader &reader);
virtual bool extract_record(FltRecordReader &reader);
virtual bool extract_ancillary(FltRecordReader &reader);
virtual FltError write_record_and_children(FltRecordWriter &writer) const;
virtual bool build_record(FltRecordWriter &writer) const;
virtual FltError write_ancillary(FltRecordWriter &writer) const;
protected:
FltHeader *_header;
private:
typedef pvector<PT(FltRecord)> Records;
Records _children;
Records _subfaces;
Records _extensions;
Records _ancillary;
std::string _comment;
public:
virtual TypeHandle get_type() const {
return get_class_type();
}
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
static TypeHandle get_class_type() {
return _type_handle;
}
static void init_type() {
TypedReferenceCount::init_type();
register_type(_type_handle, "FltRecord",
TypedReferenceCount::get_class_type());
}
private:
static TypeHandle _type_handle;
};
INLINE std::ostream &operator << (std::ostream &out, const FltRecord &record);
#include "fltRecord.I"
#endif
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stdint.h>
#include <utility>
#include <vector>
#include "base/strings/string16.h"
#include "content/common/content_export.h"
#include "ipc/ipc_message_macros.h"
#undef IPC_MESSAGE_EXPORT
#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
#define IPC_MESSAGE_START DWriteFontProxyMsgStart
#ifndef CONTENT_COMMON_DWRITE_FONT_PROXY_MESSAGES_H_
#define CONTENT_COMMON_DWRITE_FONT_PROXY_MESSAGES_H_
// The macros can't handle a complex template declaration, so we typedef it.
typedef std::pair<base::string16, base::string16> DWriteStringPair;
#endif // CONTENT_COMMON_DWRITE_FONT_PROXY_MESSAGES_H_
// Locates the index of the specified font family within the system collection.
IPC_SYNC_MESSAGE_CONTROL1_1(DWriteFontProxyMsg_FindFamily,
base::string16 /* family_name */,
uint32_t /* out index */)
// Returns the number of font families in the system collection.
IPC_SYNC_MESSAGE_CONTROL0_1(DWriteFontProxyMsg_GetFamilyCount,
uint32_t /* out count */)
// Returns the list of locale and family name pairs for the font family at the
// specified index.
IPC_SYNC_MESSAGE_CONTROL1_1(
DWriteFontProxyMsg_GetFamilyNames,
uint32_t /* family_index */,
std::vector<DWriteStringPair> /* out family_names */)
// Returns the list of font file paths in the system font directory that contain
// font data for the font family at the specified index.
IPC_SYNC_MESSAGE_CONTROL1_1(DWriteFontProxyMsg_GetFontFiles,
uint32_t /* family_index */,
std::vector<base::string16> /* out file_paths */)
|
// 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_CHROME_PAGE_ZOOM_H_
#define CHROME_BROWSER_CHROME_PAGE_ZOOM_H_
#pragma once
#include <vector>
namespace chrome_page_zoom {
// Return a sorted vector of zoom factors. The vector will consist of preset
// values along with a custom value (if the custom value is not already
// represented.)
std::vector<double> PresetZoomFactors(double custom_factor);
// Return a sorted vector of zoom levels. The vector will consist of preset
// values along with a custom value (if the custom value is not already
// represented.)
std::vector<double> PresetZoomLevels(double custom_level);
} // namespace chrome_page_zoom
#endif // CHROME_BROWSER_CHROME_PAGE_ZOOM_H_
|
#pragma once
namespace graphic
{
class cCube
{
public:
cCube();
cCube(const Vector3 &vMin, const Vector3 &vMax );
void SetCube(const Vector3 &vMin, const Vector3 &vMax );
void SetTransform( const Matrix44 &tm );
void SetColor( DWORD color);
const Matrix44& GetTransform() const;
const Vector3& GetMin() const;
const Vector3& GetMax() const;
void Render(const Matrix44 &tm);
protected:
void InitCube();
private:
cVertexBuffer m_vtxBuff;
cIndexBuffer m_idxBuff;
Vector3 m_min;
Vector3 m_max;
Matrix44 m_tm;
};
inline void cCube::SetTransform( const Matrix44 &tm ) { m_tm = tm; }
inline const Matrix44& cCube::GetTransform() const { return m_tm; }
inline const Vector3& cCube::GetMin() const { return m_min; }
inline const Vector3& cCube::GetMax() const { return m_max; }
}
|
// ==========================================================================
// SeqAn - The Library for Sequence Analysis
// ==========================================================================
// Copyright (c) 2006-2013, Knut Reinert, FU Berlin
// 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 Knut Reinert or the FU Berlin 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 KNUT REINERT OR THE FU BERLIN 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.
//
// ==========================================================================
// Author: Manuel Holtgrewe <manuel.holtgrewe@fu-berlin.de>
// ==========================================================================
// Shuffling.
// ==========================================================================
#ifndef SEQAN_RANDOM_RANDOM_SHUFFLE_H_
#define SEQAN_RANDOM_RANDOM_SHUFFLE_H_
namespace seqan {
// ===========================================================================
// Forwards, Tags.
// ===========================================================================
// ===========================================================================
// Classes
// ===========================================================================
// ===========================================================================
// Metafunctions
// ===========================================================================
// ===========================================================================
// Functions
// ===========================================================================
/*!
* @fn shuffle
* @brief Shuffle the given container.
*
* @signature void shuffle(container, rng);
*
* @param[in,out] container The container to shuffle.
* @param[in,out] rng The random number generator to use.
*/
/**
.Function.shuffle
..summary:Shuffle the given container.
..cat:Random
..include:seqan/random.h
..signature:shuffle(container, rng)
..param.container:Container to shuffle elements of.
..param.rng:Random number generator to use.
...type:Class.Rng
..wiki:Tutorial/Randomness#Shuffling|Tutorial: Randomness
*/
template <typename TContainer, typename TRNG>
void shuffle(TContainer & container, TRNG & rng)
{
SEQAN_CHECKPOINT;
typedef typename Position<TContainer>::Type TPosition;
typedef typename Value<TContainer>::Type TValue;
TValue tmp;
for (TPosition i = 0, iend = length(container); i < iend; ++i) {
Pdf<Uniform<TPosition> > uniformDist(i, iend - 1);
TPosition j = pickRandomNumber(rng, uniformDist);
// swap
move(tmp, container[i]);
move(container[i], container[j]);
move(container[j], tmp);
}
}
} // namespace seqan
#endif // SEQAN_RANDOM_RANDOM_SHUFFLE_H_
|
/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
#if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED
# error "Never use <bmiintrin.h> directly; include <x86intrin.h> instead."
#endif
#ifndef _BMIINTRIN_H_INCLUDED
#define _BMIINTRIN_H_INCLUDED
#ifndef __BMI__
#pragma GCC push_options
#pragma GCC target("bmi")
#define __DISABLE_BMI__
#endif /* __BMI__ */
extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__tzcnt_u16 (unsigned short __X)
{
return __builtin_ia32_tzcnt_u16 (__X);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__andn_u32 (unsigned int __X, unsigned int __Y)
{
return ~__X & __Y;
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__bextr_u32 (unsigned int __X, unsigned int __Y)
{
return __builtin_ia32_bextr_u32 (__X, __Y);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_bextr_u32 (unsigned int __X, unsigned int __Y, unsigned __Z)
{
return __builtin_ia32_bextr_u32 (__X, ((__Y & 0xff) | ((__Z & 0xff) << 8)));
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blsi_u32 (unsigned int __X)
{
return __X & -__X;
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_blsi_u32 (unsigned int __X)
{
return __blsi_u32 (__X);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blsmsk_u32 (unsigned int __X)
{
return __X ^ (__X - 1);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_blsmsk_u32 (unsigned int __X)
{
return __blsmsk_u32 (__X);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blsr_u32 (unsigned int __X)
{
return __X & (__X - 1);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_blsr_u32 (unsigned int __X)
{
return __blsr_u32 (__X);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__tzcnt_u32 (unsigned int __X)
{
return __builtin_ia32_tzcnt_u32 (__X);
}
extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_tzcnt_u32 (unsigned int __X)
{
return __builtin_ia32_tzcnt_u32 (__X);
}
#ifdef __x86_64__
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__andn_u64 (unsigned long long __X, unsigned long long __Y)
{
return ~__X & __Y;
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__bextr_u64 (unsigned long long __X, unsigned long long __Y)
{
return __builtin_ia32_bextr_u64 (__X, __Y);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_bextr_u64 (unsigned long long __X, unsigned int __Y, unsigned int __Z)
{
return __builtin_ia32_bextr_u64 (__X, ((__Y & 0xff) | ((__Z & 0xff) << 8)));
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blsi_u64 (unsigned long long __X)
{
return __X & -__X;
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_blsi_u64 (unsigned long long __X)
{
return __blsi_u64 (__X);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blsmsk_u64 (unsigned long long __X)
{
return __X ^ (__X - 1);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_blsmsk_u64 (unsigned long long __X)
{
return __blsmsk_u64 (__X);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__blsr_u64 (unsigned long long __X)
{
return __X & (__X - 1);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_blsr_u64 (unsigned long long __X)
{
return __blsr_u64 (__X);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__tzcnt_u64 (unsigned long long __X)
{
return __builtin_ia32_tzcnt_u64 (__X);
}
extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_tzcnt_u64 (unsigned long long __X)
{
return __builtin_ia32_tzcnt_u64 (__X);
}
#endif /* __x86_64__ */
#ifdef __DISABLE_BMI__
#undef __DISABLE_BMI__
#pragma GCC pop_options
#endif /* __DISABLE_BMI__ */
#endif /* _BMIINTRIN_H_INCLUDED */
|
/*
* This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information
*
* 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 _MAPTREE_H
#define _MAPTREE_H
#include "Platform/Define.h"
#include "Utilities/UnorderedMapSet.h"
#include "BIH.h"
namespace VMAP
{
class ModelInstance;
class GroupModel;
class VMapManager2;
struct LocationInfo
{
LocationInfo(): hitInstance(0), hitModel(0), ground_Z(-G3D::inf()) {};
const ModelInstance* hitInstance;
const GroupModel* hitModel;
float ground_Z;
};
class StaticMapTree
{
typedef UNORDERED_MAP<uint32, bool> loadedTileMap;
typedef UNORDERED_MAP<uint32, uint32> loadedSpawnMap;
private:
uint32 iMapID;
bool iIsTiled;
BIH iTree;
ModelInstance* iTreeValues; // the tree entries
uint32 iNTreeValues;
// Store all the map tile idents that are loaded for that map
// some maps are not splitted into tiles and we have to make sure, not removing the map before all tiles are removed
// empty tiles have no tile file, hence map with bool instead of just a set (consistency check)
loadedTileMap iLoadedTiles;
// stores <tree_index, reference_count> to invalidate tree values, unload map, and to be able to report errors
loadedSpawnMap iLoadedSpawns;
std::string iBasePath;
private:
bool getIntersectionTime(const G3D::Ray& pRay, float& pMaxDist, bool pStopAtFirstHit, bool isLosCheck) const;
// bool containsLoadedMapTile(unsigned int pTileIdent) const { return(iLoadedMapTiles.containsKey(pTileIdent)); }
public:
static std::string getTileFileName(uint32 mapID, uint32 tileX, uint32 tileY);
static uint32 packTileID(uint32 tileX, uint32 tileY) { return tileX << 16 | tileY; }
static void unpackTileID(uint32 ID, uint32& tileX, uint32& tileY) { tileX = ID >> 16; tileY = ID & 0xFF; }
static bool CanLoadMap(const std::string& basePath, uint32 mapID, uint32 tileX, uint32 tileY);
StaticMapTree(uint32 mapID, const std::string& basePath);
~StaticMapTree();
bool isInLineOfSight(const G3D::Vector3& pos1, const G3D::Vector3& pos2) const;
ModelInstance* FindCollisionModel(const G3D::Vector3& pos1, const G3D::Vector3& pos2);
bool getObjectHitPos(const G3D::Vector3& pos1, const G3D::Vector3& pos2, G3D::Vector3& pResultHitPos, float pModifyDist) const;
float getHeight(const G3D::Vector3& pPos, float maxSearchDist) const;
bool getAreaInfo(G3D::Vector3& pos, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const;
bool isUnderModel(G3D::Vector3& pos, float* outDist = NULL, float* inDist = NULL) const;
bool GetLocationInfo(const Vector3& pos, LocationInfo& info) const;
bool InitMap(const std::string& fname, VMapManager2* vm);
void UnloadMap(VMapManager2* vm);
bool LoadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm);
void UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm);
bool isTiled() const { return iIsTiled; }
uint32 numLoadedTiles() const { return iLoadedTiles.size(); }
#ifdef MMAP_GENERATOR
public:
void getModelInstances(ModelInstance*& models, uint32& count);
#endif
};
struct AreaInfo
{
AreaInfo(): result(false), ground_Z(-G3D::inf()) {};
bool result;
float ground_Z;
uint32 flags;
int32 adtId;
int32 rootId;
int32 groupId;
};
} // VMAP
#endif // _MAPTREE_H
|
/* { dg-do compile } */
/* { dg-require-effective-target arm_dsp } */
/* Ensure the smlatb doesn't get generated when reading the Q flag
from ACLE. */
#include <arm_acle.h>
int
foo (int x, int in, int32_t c)
{
short a = in & 0xffff;
short b = (in & 0xffff0000) >> 16;
int res = x + b * a + __ssat (c, 24);
return res + __saturation_occurred ();
}
/* { dg-final { scan-assembler-not "smlatb\\t" } } */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.