text
stringlengths 4
6.14k
|
|---|
/* Public domain */
#ifndef _AGAR_CORE_PUBLIC_H_
#define _AGAR_CORE_PUBLIC_H_
#include <agar/core/core_begin.h>
#include <agar/core/core_init.h>
#include <agar/core/string.h>
#ifdef _USE_AGAR_STD
# include <agar/core/snprintf.h>
# include <agar/core/vsnprintf.h>
# include <agar/core/vasprintf.h>
# include <agar/core/asprintf.h>
#endif
#include <agar/core/data_source.h>
#include <agar/core/load_integral.h>
#include <agar/core/load_real.h>
#include <agar/core/load_string.h>
#include <agar/core/load_version.h>
#include <agar/core/version.h>
#include <agar/core/object.h>
#include <agar/core/list.h>
#include <agar/core/tree.h>
#include <agar/core/tbl.h>
#include <agar/core/config.h>
#include <agar/core/file.h>
#include <agar/core/dir.h>
#include <agar/core/dso.h>
#include <agar/core/db.h>
#include <agar/core/getopt.h>
#include <agar/core/exec.h>
#include <agar/core/user.h>
#include <agar/core/net.h>
#include <agar/core/core_close.h>
#endif
|
#ifndef HAL_CONFIG_H
#define HAL_CONFIG_H
#include "em_device.h"
#include "hal-config-types.h"
// This file is auto-generated by Hardware Configurator in Simplicity Studio.
// Any content between $[ and ]$ will be replaced whenever the file is regenerated.
// Content outside these regions will be preserved.
// $[ACMP0]
// [ACMP0]$
// $[ACMP1]
// [ACMP1]$
// $[ANTDIV]
// [ANTDIV]$
// $[BTL_BUTTON]
// [BTL_BUTTON]$
// $[BUTTON]
#define BSP_BUTTON_PRESENT (1)
#define BSP_BUTTON0_PIN (0U)
#define BSP_BUTTON0_PORT (gpioPortB)
#define BSP_BUTTON1_PIN (1U)
#define BSP_BUTTON1_PORT (gpioPortB)
#define BSP_BUTTON_COUNT (2U)
#define BSP_BUTTON_INIT \
{ \
{BSP_BUTTON0_PORT, BSP_BUTTON0_PIN}, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } \
}
#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW)
#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT)
#define HAL_BUTTON_COUNT (2U)
#define HAL_BUTTON_ENABLE \
{ \
0, 1 \
}
// [BUTTON]$
// $[CMU]
#define HAL_CLK_HFCLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFXO)
#define HAL_CLK_PLL_CONFIGURATION (HAL_CLK_PLL_CONFIGURATION_40MHZ)
#define HAL_CLK_EM01CLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFRCODPLL)
#define HAL_CLK_EM23CLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
#define HAL_CLK_EM4CLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
#define HAL_CLK_RTCCCLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
#define HAL_CLK_WDOGCLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
#define BSP_CLK_HFXO_PRESENT (1)
#define BSP_CLK_HFXO_FREQ (38400000UL)
#define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT
#define BSP_CLK_HFXO_CTUNE (129)
#define BSP_CLK_LFXO_PRESENT (1)
#define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT
#define BSP_CLK_LFXO_FREQ (32768U)
#define BSP_CLK_LFXO_CTUNE (37U)
#define HAL_CLK_LFXO_PRECISION (100UL)
// [CMU]$
// $[COEX]
// [COEX]$
// $[EMU]
// [EMU]$
// $[EXTFLASH]
// [EXTFLASH]$
// $[EZRADIOPRO]
// [EZRADIOPRO]$
// $[FEM]
// [FEM]$
// $[GPIO]
#define PORTIO_GPIO_SWV_PIN (3U)
#define PORTIO_GPIO_SWV_PORT (gpioPortA)
#define BSP_TRACE_SWO_PIN (3U)
#define BSP_TRACE_SWO_PORT (gpioPortA)
// [GPIO]$
// $[I2C0]
// [I2C0]$
// $[I2C1]
// [I2C1]$
// $[I2CSENSOR]
// [I2CSENSOR]$
// $[IADC0]
// [IADC0]$
// $[IOEXP]
// [IOEXP]$
// $[LED]
#define BSP_LED_PRESENT (1)
#define BSP_LED0_PIN (2U)
#define BSP_LED0_PORT (gpioPortD)
#define BSP_LED1_PIN (3U)
#define BSP_LED1_PORT (gpioPortD)
#define BSP_LED_COUNT (2U)
#define BSP_LED_INIT \
{ \
{BSP_LED0_PORT, BSP_LED0_PIN}, { BSP_LED1_PORT, BSP_LED1_PIN } \
}
#define HAL_LED_COUNT (2U)
#define HAL_LED_ENABLE \
{ \
0, 1 \
}
#define BSP_LED_POLARITY (1)
// [LED]$
// $[LETIMER0]
// [LETIMER0]$
// $[LFXO]
// [LFXO]$
// $[MODEM]
// [MODEM]$
// $[PA]
#define HAL_PA_ENABLE (1)
#define HAL_PA_CURVE_HEADER "pa_curves_efr32.h"
#define HAL_PA_POWER (252U)
#define HAL_PA_RAMP (10UL)
#define BSP_PA_VOLTAGE (3300U)
#define HAL_PA_SELECTION (HAL_PA_SELECTION_2P4_HP)
// [PA]$
// $[PORTIO]
// [PORTIO]$
// $[PRS]
// [PRS]$
// $[PTI]
#define PORTIO_PTI_DFRAME_PIN (5U)
#define PORTIO_PTI_DFRAME_PORT (gpioPortC)
#define PORTIO_PTI_DOUT_PIN (4U)
#define PORTIO_PTI_DOUT_PORT (gpioPortC)
#define HAL_PTI_ENABLE (1)
#define BSP_PTI_DFRAME_PIN (5U)
#define BSP_PTI_DFRAME_PORT (gpioPortC)
#define BSP_PTI_DOUT_PIN (4U)
#define BSP_PTI_DOUT_PORT (gpioPortC)
#define HAL_PTI_MODE (HAL_PTI_MODE_UART)
#define HAL_PTI_BAUD_RATE (1600000UL)
// [PTI]$
// $[SERIAL]
#define HAL_SERIAL_RXWAKE_ENABLE (0)
#define HAL_SERIAL_IDLE_WAKE_ENABLE (1)
#define HAL_SERIAL_USART0_ENABLE (0)
#define HAL_SERIAL_USART1_ENABLE (0)
#define HAL_SERIAL_USART2_ENABLE (0)
#define BSP_SERIAL_APP_TX_PIN (5U)
#define BSP_SERIAL_APP_TX_PORT (gpioPortA)
#define BSP_SERIAL_APP_RX_PIN (6U)
#define BSP_SERIAL_APP_RX_PORT (gpioPortA)
#define BSP_SERIAL_APP_CTS_PIN (4U)
#define BSP_SERIAL_APP_CTS_PORT (gpioPortA)
#define BSP_SERIAL_APP_RTS_PIN (1U)
#define BSP_SERIAL_APP_RTS_PORT (gpioPortC)
#define HAL_SERIAL_APP_BAUD_RATE (115200UL)
#define HAL_SERIAL_APP_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART)
#define HAL_SERIAL_APP_RXSTOP (16UL)
#define HAL_SERIAL_APP_RXSTART (16UL)
#define HAL_SERIAL_APP_TX_QUEUE_SIZE (128UL)
#define HAL_SERIAL_APP_RX_QUEUE_SIZE (128UL)
// [SERIAL]$
// $[SPIDISPLAY]
// [SPIDISPLAY]$
// $[SPINCP]
// [SPINCP]$
// $[TIMER0]
// [TIMER0]$
// $[TIMER1]
// [TIMER1]$
// $[TIMER2]
// [TIMER2]$
// $[TIMER3]
// [TIMER3]$
// $[UARTNCP]
// [UARTNCP]$
// $[USART0]
#define PORTIO_USART0_CTS_PIN (4U)
#define PORTIO_USART0_CTS_PORT (gpioPortA)
#define PORTIO_USART0_RTS_PIN (1U)
#define PORTIO_USART0_RTS_PORT (gpioPortC)
#define PORTIO_USART0_RX_PIN (6U)
#define PORTIO_USART0_RX_PORT (gpioPortA)
#define PORTIO_USART0_TX_PIN (5U)
#define PORTIO_USART0_TX_PORT (gpioPortA)
#define HAL_USART0_ENABLE (1)
#define BSP_USART0_TX_PIN (5U)
#define BSP_USART0_TX_PORT (gpioPortA)
#define BSP_USART0_RX_PIN (6U)
#define BSP_USART0_RX_PORT (gpioPortA)
#define BSP_USART0_CTS_PIN (4U)
#define BSP_USART0_CTS_PORT (gpioPortA)
#define BSP_USART0_RTS_PIN (1U)
#define BSP_USART0_RTS_PORT (gpioPortC)
#define HAL_USART0_BAUD_RATE (115200UL)
#define HAL_USART0_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_HWUART)
#define HAL_USART0_RXSTOP (16UL)
#define HAL_USART0_RXSTART (16UL)
#define HAL_USART0_TX_QUEUE_SIZE (128UL)
#define HAL_USART0_RX_QUEUE_SIZE (128UL)
// [USART0]$
// $[USART1]
// [USART1]$
// $[USART2]
// [USART2]$
// $[VCOM]
#define HAL_VCOM_ENABLE (1)
#define BSP_VCOM_ENABLE_PIN (4U)
#define BSP_VCOM_ENABLE_PORT (gpioPortD)
// [VCOM]$
// $[VUART]
// [VUART]$
// $[WDOG]
#define HAL_WDOG_ENABLE (0)
// [WDOG]$
#if defined(_SILICON_LABS_MODULE)
#include "sl_module.h"
#endif
#endif /* HAL_CONFIG_H */
|
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef StringUTF8Adaptor_h
#define StringUTF8Adaptor_h
#include "wtf/text/CString.h"
#include "wtf/text/WTFString.h"
namespace WTF {
// This class lets you get UTF-8 data out of a String without mallocing a
// separate buffer to hold the data if the String happens to be 8 bit and
// contain only ASCII characters.
class StringUTF8Adaptor {
public:
explicit StringUTF8Adaptor(const String& string)
: m_data(0)
, m_length(0)
{
if (string.isEmpty())
return;
// Unfortunately, 8 bit WTFStrings are encoded in Latin-1 and GURL uses UTF-8
// when processing 8 bit strings. If |relative| is entirely ASCII, we luck out
// and can avoid mallocing a new buffer to hold the UTF-8 data because UTF-8
// and Latin-1 use the same code units for ASCII code points.
if (string.is8Bit() && string.containsOnlyASCII()) {
m_data = reinterpret_cast<const char*>(string.characters8());
m_length = string.length();
} else {
m_utf8Buffer = string.utf8();
m_data = m_utf8Buffer.data();
m_length = m_utf8Buffer.length();
}
}
const char* data() const { return m_data; }
size_t length() const { return m_length; }
private:
CString m_utf8Buffer;
const char* m_data;
size_t m_length;
};
} // namespace WTF
using WTF::StringUTF8Adaptor;
#endif // StringUTF8Adaptor_h
|
/*
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _KERNEL_KHASH_H
#define _KERNEL_KHASH_H
struct hash_iterator {
void *ptr;
int bucket;
};
void *hash_init(unsigned int table_size, int next_ptr_offset,
int compare_func(void *a, const void *key),
unsigned int hash_func(void *a, const void *key, unsigned int range));
int hash_uninit(void *_hash_table);
int hash_insert(void *_hash_table, void *_elem);
int hash_remove(void *_hash_table, void *_elem);
void *hash_find(void *_hash_table, void *e);
void *hash_lookup(void *_hash_table, const void *key);
struct hash_iterator *hash_open(void *_hash_table, struct hash_iterator *i);
void hash_close(void *_hash_table, struct hash_iterator *i, bool free_iterator);
void *hash_next(void *_hash_table, struct hash_iterator *i);
void hash_rewind(void *_hash_table, struct hash_iterator *i);
void hash_dump(void *_hash_table);
/* function ptrs must look like this:
// hash function should calculate hash on either e or key,
// depending on which one is not NULL
unsigned int hash_func(void *e, const void *key, unsigned int range);
// compare function should compare the element with
// the key, returning 0 if equal, other if not
// NOTE: compare func can be null, in which case the hash
// code will compare the key pointer with the target
int compare_func(void *e, const void *key);
*/
unsigned int hash_hash_str( const char *str );
#endif
|
/*
** Copyright (C) 2016-2017, NumFOCUS Foundation.
**
** Licensed under a 3-clause BSD style license - see LICENSE
**
** This file is NOT derived from SOFA sources
*/
#ifndef _ERFA_EXTRA_H
#define _ERFA_EXTRA_H
#ifdef __cplusplus
extern "C" {
#endif
/*
** Returns the package version
** as defined in configure.ac
** in string format
*/
const char* eraVersion(void);
/*
** Returns the package major version
** as defined in configure.ac
** as integer
*/
int eraVersionMajor(void);
/*
** Returns the package minor version
** as defined in configure.ac
** as integer
*/
int eraVersionMinor(void);
/*
** Returns the package micro version
** as defined in configure.ac
** as integer
*/
int eraVersionMicro(void);
/*
** Returns the orresponding SOFA version
** as defined in configure.ac
** in string format
*/
const char* eraSofaVersion(void);
#ifdef __cplusplus
}
#endif
#endif /* _ERFA_EXTRA_H */
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_MATCHER_H_
#define CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_MATCHER_H_
#include <memory>
#include <string>
#include <vector>
#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "chrome/browser/android/data_usage/data_use_tab_model.h"
namespace base {
class TickClock;
}
namespace re2 {
class RE2;
}
class GURL;
namespace chrome {
namespace android {
class ExternalDataUseObserverBridge;
// DataUseMatcher stores the matching URL patterns and package names along with
// the labels. It also provides functionality to get the matching label for a
// given URL or package. DataUseMatcher is not thread safe.
class DataUseMatcher {
public:
DataUseMatcher(
const base::WeakPtr<DataUseTabModel>& data_use_tab_model,
const ExternalDataUseObserverBridge* external_data_use_observer_bridge,
const base::TimeDelta& default_matching_rule_expiration_duration);
~DataUseMatcher();
// Called by FetchMatchingRulesDoneOnIOThread to register multiple
// case-insensitive regular expressions. If the url of the data use request
// matches any of the regular expression, the observation is passed to the
// Java listener.
void RegisterURLRegexes(const std::vector<std::string>& app_package_names,
const std::vector<std::string>& domain_path_regexes,
const std::vector<std::string>& labels);
// Returns true if the |url| matches the registered regular expressions.
// |label| must not be null. If a match is found, the |label| is set to the
// matching rule's label.
bool MatchesURL(const GURL& url, std::string* label) const WARN_UNUSED_RESULT;
// Returns true if the |app_package_name| matches the registered package
// names. |label| must not be null. If a match is found, the |label| is set
// to the matching rule's label.
bool MatchesAppPackageName(const std::string& app_package_name,
std::string* label) const WARN_UNUSED_RESULT;
// Fetches the matching rules asynchronously from
// |external_data_use_observer_bridge_|.
void FetchMatchingRules();
// Returns true if there is any matching rule. HasRules may return true even
// if all rules are expired.
bool HasRules() const;
// Returns true if there is any valid matching rule with label |label|.
bool HasValidRuleWithLabel(const std::string& label) const;
private:
friend class DataUseMatcherTest;
FRIEND_TEST_ALL_PREFIXES(DataUseMatcherTest,
EncodeExpirationTimeInPackageName);
FRIEND_TEST_ALL_PREFIXES(DataUseMatcherTest,
EncodeJavaExpirationTimeInPackageName);
FRIEND_TEST_ALL_PREFIXES(DataUseMatcherTest, MatchesIgnoresExpiredRules);
FRIEND_TEST_ALL_PREFIXES(DataUseMatcherTest, ParsePackageField);
// Stores the matching rules.
class MatchingRule {
public:
MatchingRule(const std::string& app_package_name,
std::unique_ptr<re2::RE2> pattern,
const std::string& label,
const base::TimeTicks& expiration);
~MatchingRule();
const re2::RE2* pattern() const;
const std::string& app_package_name() const;
const std::string& label() const;
const base::TimeTicks& expiration() const;
private:
// Package name of the app that should be matched.
const std::string app_package_name_;
// RE2 pattern to match against URLs.
std::unique_ptr<re2::RE2> pattern_;
// Opaque label that uniquely identifies this matching rule.
const std::string label_;
// Expiration time of this matching rule.
const base::TimeTicks expiration_;
DISALLOW_COPY_AND_ASSIGN(MatchingRule);
};
// Parses the app package name and expiration time of the matching rule
// encoded in the format "app_package_name|milliseconds_since_epoch" in
// |app_package_name|. |new_app_package_name| and |expiration| should not be
// null. Parsed expiration time is set in |expiration| and app package name
// is set in |new_app_package_name|. If |app_package_name| is not in the
// expected format, |expiration| will be set to default expiration duration
// from now, and |new_app_package_name| will be set to the |app_package_name|.
void ParsePackageField(const std::string& app_package_name,
std::string* new_app_package_name,
base::TimeTicks* expiration) const;
base::ThreadChecker thread_checker_;
std::vector<std::unique_ptr<MatchingRule>> matching_rules_;
// |data_use_tab_model_| is notified if a label is removed from the set of
// matching labels.
base::WeakPtr<DataUseTabModel> data_use_tab_model_;
// Default expiration duration of a matching rule, if expiration is not
// specified in the rule.
const base::TimeDelta default_matching_rule_expiration_duration_;
// TickClock used for obtaining the current time.
std::unique_ptr<base::TickClock> tick_clock_;
// Pointer to the ExternalDataUseObserverBridge owned by
// ExternalDataUseObserver. DataUseTabModel (owner of |this|) and
// ExternalDataUseObserverBridge are owned by ExternalDataUseObserver, and are
// destroyed in that order. So |external_data_use_observer_bridge_| is
// guaranteed to be non-null.
const ExternalDataUseObserverBridge* external_data_use_observer_bridge_;
DISALLOW_COPY_AND_ASSIGN(DataUseMatcher);
};
} // namespace android
} // namespace chrome
#endif // CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_MATCHER_H_
|
/* -----------------------------------------------------------------------------
*
* (c) The GHC Team, 2001
* Author: Sungwoo Park
*
* Retainer profiling interface.
*
* ---------------------------------------------------------------------------*/
#ifndef RETAINERPROFILE_H
#define RETAINERPROFILE_H
#ifdef PROFILING
#include "RetainerSet.h"
#include "BeginPrivate.h"
void initRetainerProfiling ( void );
void endRetainerProfiling ( void );
void retainerProfile ( void );
void resetStaticObjectForRetainerProfiling( StgClosure *static_objects );
// flip is either 1 or 0, changed at the beginning of retainerProfile()
// It is used to tell whether a retainer set has been touched so far
// during this pass.
extern StgWord flip;
// extract the retainer set field from c
#define RSET(c) ((c)->header.prof.hp.rs)
#define isRetainerSetFieldValid(c) \
((((StgWord)(c)->header.prof.hp.rs & 1) ^ flip) == 0)
static inline RetainerSet *
retainerSetOf( StgClosure *c )
{
ASSERT( isRetainerSetFieldValid(c) );
// StgWord has the same size as pointers, so the following type
// casting is okay.
return (RetainerSet *)((StgWord)RSET(c) ^ flip);
}
// Used by Storage.c:memInventory()
#ifdef DEBUG
extern W_ retainerStackBlocks ( void );
#endif
#include "EndPrivate.h"
#endif /* PROFILING */
#endif /* RETAINERPROFILE_H */
// Local Variables:
// mode: C
// fill-column: 80
// indent-tabs-mode: nil
// c-basic-offset: 4
// buffer-file-coding-system: utf-8-unix
// End:
|
/* Copyright (c) 2017, Nordic Semiconductor ASA
* 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 Nordic Semiconductor ASA 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.
*
*/
/**
* @brief Front End Module control internal functions.
*
*/
#ifndef NRF_FEM_CONTROL_INTERNAL_H_
#define NRF_FEM_CONTROL_INTERNAL_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "nrf_fem_control_api.h"
#define TIMER_CC_FEM 3 /**< Compare channel used by the module. */
#define TIMER_CC_CAPTURE 2 /**< Compare channel used for time capture. */
/**@brief Start timer used by the module. */
void nrf_fem_control_timer_start(void);
/**@brief Stop timer used by the module. */
void nrf_fem_control_timer_stop(void);
/**@brief Set timer CC target value.
*
* @param[in] target Traget time.
*/
void nrf_fem_control_timer_set(uint32_t target);
/**@brief Get current time from the timer.
*
* @retval Current timer time.
*/
uint32_t nrf_fem_control_timer_time_get(void);
/**@brief Initialize timer. */
void nrf_fem_control_timer_init(void);
/**@brief De-initialize timer. */
void nrf_fem_control_timer_deinit(void);
/**@brief Get configuration specific irq entry delay.
*
* @retval Delay value.
*/
uint32_t nrf_fem_control_irq_delay_get(void);
#ifdef __cplusplus
}
#endif
#endif /* NRF_FEM_CONTROL_INTERNAL_H_ */
|
/**
* @file EdgeKinetics.h
*
* @ingroup chemkinetics
* @ingroup electrochem
*/
// Copyright 2001 California Institute of Technology
#ifndef CT_EDGEKINETICS_H
#define CT_EDGEKINETICS_H
#include "InterfaceKinetics.h"
namespace Cantera
{
/**
* Heterogeneous reactions at one-dimensional interfaces between
* multiple adjacent two-dimensional surfaces.
*/
class EdgeKinetics : public InterfaceKinetics
{
public:
//! Constructor
EdgeKinetics() : InterfaceKinetics() {}
EdgeKinetics(const EdgeKinetics& right) :
InterfaceKinetics(right) {
*this=right;
}
EdgeKinetics& operator=(const EdgeKinetics& right) {
if (this != &right) {
InterfaceKinetics::operator=(right);
}
return *this;
}
virtual Kinetics* duplMyselfAsKinetics(const std::vector<thermo_t*> & tpVector) const {
EdgeKinetics* iK = new EdgeKinetics(*this);
iK->assignShallowPointers(tpVector);
return iK;
}
virtual int type() const {
return cEdgeKinetics;
}
virtual void finalize();
};
}
#endif
|
/*
Copyright (C) 2014, The University of Texas at Austin
This file is part of libflame and is available under the 3-Clause
BSD license, which can be found in the LICENSE file at the top-level
directory, or at http://opensource.org/licenses/BSD-3-Clause
*/
#include "FLAME.h"
#ifdef FLA_ENABLE_NON_CRITICAL_CODE
FLA_Error FLA_Gemm_hn_unb_var6( FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C )
{
FLA_Obj AT, A0,
AB, a1t,
A2;
FLA_Obj BT, B0,
BB, b1t,
B2;
FLA_Scal_external( beta, C );
FLA_Part_2x1( A, &AT,
&AB, 0, FLA_BOTTOM );
FLA_Part_2x1( B, &BT,
&BB, 0, FLA_BOTTOM );
while ( FLA_Obj_length( AB ) < FLA_Obj_length( A ) ){
FLA_Repart_2x1_to_3x1( AT, &A0,
&a1t,
/* ** */ /* *** */
AB, &A2, 1, FLA_TOP );
FLA_Repart_2x1_to_3x1( BT, &B0,
&b1t,
/* ** */ /* *** */
BB, &B2, 1, FLA_TOP );
/*------------------------------------------------------------*/
/* C = a1t' * b1t + C */
FLA_Gerc_external( FLA_CONJUGATE, FLA_NO_CONJUGATE, alpha, a1t, b1t, C );
/*------------------------------------------------------------*/
FLA_Cont_with_3x1_to_2x1( &AT, A0,
/* ** */ /* *** */
a1t,
&AB, A2, FLA_BOTTOM );
FLA_Cont_with_3x1_to_2x1( &BT, B0,
/* ** */ /* *** */
b1t,
&BB, B2, FLA_BOTTOM );
}
return FLA_SUCCESS;
}
#endif
|
/*
Copyright (C) 2014, The University of Texas at Austin
This file is part of libflame and is available under the 3-Clause
BSD license, which can be found in the LICENSE file at the top-level
directory, or at http://opensource.org/licenses/BSD-3-Clause
*/
#include "FLAME.h"
#define FLA_ALG_REFERENCE 0
#define FLA_ALG_UNBLOCKED 1
#define FLA_ALG_BLOCKED 2
#define FLA_ALG_RECURSIVE 3
#define FLA_ALG_OPTIMIZED 4
void time_Gemm_pp_nn(
int variant, int type, int nrepeats, int n, int nb_alg,
FLA_Obj A, FLA_Obj B, FLA_Obj C, FLA_Obj Cref,
double *dtime, double *diff, double *mflops );
void time_Gemm_pp_nn(
int variant, int type, int nrepeats, int n, int nb_alg,
FLA_Obj A, FLA_Obj B, FLA_Obj C, FLA_Obj Cref,
double *dtime, double *diff, double *mflops )
{
int
irep,
info, lwork;
double
dtime_old,
d_minus_one = -1.0, d_one = 1.0;
FLA_Obj
Cold;
FLA_Obj_create_conf_to( FLA_NO_TRANSPOSE, C, &Cold );
FLA_Copy_external( C, Cold );
for ( irep = 0 ; irep < nrepeats; irep++ ){
FLA_Copy_external( Cold, C );
*dtime = FLA_Clock();
switch( variant ){
case 0:
// Time reference implementation
REF_Gemm( FLA_NO_TRANSPOSE, FLA_NO_TRANSPOSE,
ONE, A, B, FLA_ONE, C );
break;
case 1:{
// Time variant 1
switch( type ){
case FLA_ALG_UNBLOCKED:
FLA_Gemm_pp_nn_var1( FLA_ONE, A, B, C, nb_alg );
break;
case FLA_ALG_BLOCKED:
REF_Gemm( FLA_NO_TRANSPOSE, FLA_NO_TRANSPOSE,
ONE, A, B, FLA_ONE, C );
break;
default:
printf("trouble\n");
}
break;
}
}
if ( irep == 0 )
dtime_old = FLA_Clock() - *dtime;
else{
*dtime = FLA_Clock() - *dtime;
dtime_old = min( *dtime, dtime_old );
}
}
if ( variant == 0 ){
FLA_Copy_external( C, Cref );
*diff = 0.0;
}
else{
*diff = FLA_Max_elemwise_diff( C, Cref );
}
*mflops = 2.0 *
FLA_Obj_length( C ) *
FLA_Obj_width( C ) *
FLA_Obj_width( A ) /
dtime_old /
1000000;
*dtime = dtime_old;
FLA_Copy_external( Cold, C );
FLA_Obj_free( &Cold );
}
|
/*
** 2007 August 14
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains the C functions that implement mutexes.
**
** This file contains code that is common across all mutex implementations.
**
** $Id: mutex.c,v 1.31 2009/07/16 18:21:18 drh Exp $
*/
#include "sqliteInt.h"
#if defined(SQLITE_DEBUG) && !defined(SQLITE_MUTEX_OMIT)
/*
** For debugging purposes, record when the mutex subsystem is initialized
** and uninitialized so that we can assert() if there is an attempt to
** allocate a mutex while the system is uninitialized.
*/
static SQLITE_WSD int mutexIsInit = 0;
#endif /* SQLITE_DEBUG */
#ifndef SQLITE_MUTEX_OMIT
/*
** Initialize the mutex system.
*/
int sqlite3MutexInit(void){
int rc = SQLITE_OK;
if( sqlite3GlobalConfig.bCoreMutex ){
if( !sqlite3GlobalConfig.mutex.xMutexAlloc ){
/* If the xMutexAlloc method has not been set, then the user did not
** install a mutex implementation via sqlite3_config() prior to
** sqlite3_initialize() being called. This block copies pointers to
** the default implementation into the sqlite3GlobalConfig structure.
*/
sqlite3_mutex_methods *pFrom = sqlite3DefaultMutex();
sqlite3_mutex_methods *pTo = &sqlite3GlobalConfig.mutex;
memcpy(pTo, pFrom, offsetof(sqlite3_mutex_methods, xMutexAlloc));
memcpy(&pTo->xMutexFree, &pFrom->xMutexFree,
sizeof(*pTo) - offsetof(sqlite3_mutex_methods, xMutexFree));
pTo->xMutexAlloc = pFrom->xMutexAlloc;
}
rc = sqlite3GlobalConfig.mutex.xMutexInit();
}
#ifdef SQLITE_DEBUG
GLOBAL(int, mutexIsInit) = 1;
#endif
return rc;
}
/*
** Shutdown the mutex system. This call frees resources allocated by
** sqlite3MutexInit().
*/
int sqlite3MutexEnd(void){
int rc = SQLITE_OK;
if( sqlite3GlobalConfig.mutex.xMutexEnd ){
rc = sqlite3GlobalConfig.mutex.xMutexEnd();
}
#ifdef SQLITE_DEBUG
GLOBAL(int, mutexIsInit) = 0;
#endif
return rc;
}
/*
** Retrieve a pointer to a static mutex or allocate a new dynamic one.
*/
sqlite3_mutex *sqlite3_mutex_alloc(int id){
#ifndef SQLITE_OMIT_AUTOINIT
if( sqlite3_initialize() ) return 0;
#endif
return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
}
sqlite3_mutex *sqlite3MutexAlloc(int id){
if( !sqlite3GlobalConfig.bCoreMutex ){
return 0;
}
assert( GLOBAL(int, mutexIsInit) );
return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
}
/*
** Free a dynamic mutex.
*/
void sqlite3_mutex_free(sqlite3_mutex *p){
if( p ){
sqlite3GlobalConfig.mutex.xMutexFree(p);
}
}
/*
** Obtain the mutex p. If some other thread already has the mutex, block
** until it can be obtained.
*/
void sqlite3_mutex_enter(sqlite3_mutex *p){
if( p ){
sqlite3GlobalConfig.mutex.xMutexEnter(p);
}
}
/*
** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
*/
int sqlite3_mutex_try(sqlite3_mutex *p){
int rc = SQLITE_OK;
if( p ){
return sqlite3GlobalConfig.mutex.xMutexTry(p);
}
return rc;
}
/*
** The sqlite3_mutex_leave() routine exits a mutex that was previously
** entered by the same thread. The behavior is undefined if the mutex
** is not currently entered. If a NULL pointer is passed as an argument
** this function is a no-op.
*/
void sqlite3_mutex_leave(sqlite3_mutex *p){
if( p ){
sqlite3GlobalConfig.mutex.xMutexLeave(p);
}
}
#ifndef NDEBUG
/*
** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
** intended for use inside assert() statements.
*/
int sqlite3_mutex_held(sqlite3_mutex *p){
return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
}
int sqlite3_mutex_notheld(sqlite3_mutex *p){
return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
}
#endif
#endif /* SQLITE_OMIT_MUTEX */
|
/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "packer.h"
#include "cr_error.h"
void PACK_APIENTRY crPackChromiumParametervCR(GLenum target, GLenum type, GLsizei count, const GLvoid *values)
{
GET_PACKER_CONTEXT(pc);
unsigned int header_length = 2 * sizeof(int) + sizeof(target) + sizeof(type) + sizeof(count);
unsigned int packet_length;
unsigned int params_length = 0;
unsigned char *data_ptr;
int i, pos;
switch (type) {
case GL_BYTE:
case GL_UNSIGNED_BYTE:
params_length = sizeof(GLbyte) * count;
break;
case GL_SHORT:
case GL_UNSIGNED_SHORT:
params_length = sizeof(GLshort) * count;
break;
case GL_INT:
case GL_UNSIGNED_INT:
params_length = sizeof(GLint) * count;
break;
case GL_FLOAT:
params_length = sizeof(GLfloat) * count;
break;
#if 0
case GL_DOUBLE:
params_length = sizeof(GLdouble) * count;
break;
#endif
default:
__PackError( __LINE__, __FILE__, GL_INVALID_ENUM,
"crPackChromiumParametervCR(bad type)" );
return;
}
packet_length = header_length + params_length;
GET_BUFFERED_POINTER(pc, packet_length );
WRITE_DATA( 0, GLint, packet_length );
WRITE_DATA( 4, GLenum, CR_CHROMIUMPARAMETERVCR_EXTEND_OPCODE );
WRITE_DATA( 8, GLenum, target );
WRITE_DATA( 12, GLenum, type );
WRITE_DATA( 16, GLsizei, count );
WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
pos = header_length;
switch (type) {
case GL_BYTE:
case GL_UNSIGNED_BYTE:
for (i = 0; i < count; i++, pos += sizeof(GLbyte)) {
WRITE_DATA( pos, GLbyte, ((GLbyte *) values)[i]);
}
break;
case GL_SHORT:
case GL_UNSIGNED_SHORT:
for (i = 0; i < count; i++, pos += sizeof(GLshort)) {
WRITE_DATA( pos, GLshort, ((GLshort *) values)[i]);
}
break;
case GL_INT:
case GL_UNSIGNED_INT:
for (i = 0; i < count; i++, pos += sizeof(GLint)) {
WRITE_DATA( pos, GLint, ((GLint *) values)[i]);
}
break;
case GL_FLOAT:
for (i = 0; i < count; i++, pos += sizeof(GLfloat)) {
WRITE_DATA( pos, GLfloat, ((GLfloat *) values)[i]);
}
break;
#if 0
case GL_DOUBLE:
for (i = 0; i < count; i++) {
WRITE_foo_DATA( sizeof(int) + 12, GLdouble, ((GLdouble *) values)[i]);
}
break;
#endif
default:
__PackError( __LINE__, __FILE__, GL_INVALID_ENUM,
"crPackChromiumParametervCR(bad type)" );
return;
}
}
|
// 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_SYSTEM_LOCALE_TRAY_LOCALE_H_
#define ASH_SYSTEM_LOCALE_TRAY_LOCALE_H_
#include <string>
#include "ash/system/locale/locale_observer.h"
#include "ash/system/tray/system_tray_item.h"
namespace ash {
namespace internal {
namespace tray {
class LocaleNotificationView;
}
class TrayLocale : public SystemTrayItem,
public LocaleObserver {
public:
TrayLocale();
virtual ~TrayLocale();
private:
// Overridden from TrayImageItem.
virtual views::View* CreateNotificationView(
user::LoginStatus status) OVERRIDE;
virtual void DestroyNotificationView() OVERRIDE;
// Overridden from LocaleObserver.
virtual void OnLocaleChanged(LocaleObserver::Delegate* delegate,
const std::string& cur_locale,
const std::string& from_locale,
const std::string& to_locale) OVERRIDE;
tray::LocaleNotificationView* notification_;
LocaleObserver::Delegate* delegate_;
std::string cur_locale_;
std::string from_locale_;
std::string to_locale_;
DISALLOW_COPY_AND_ASSIGN(TrayLocale);
};
} // namespace internal
} // namespace ash
#endif // ASH_SYSTEM_LOCALE_TRAY_LOCALE_H_
|
//#####################################################################
// Copyright 2004, Frank Losasso.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
// Class TIMER
//#####################################################################
#ifndef __TIMER__
#define __TIMER__
#include <stdio.h>
double Get_Current_Time();
double Initialize_Timer();
namespace PhysBAM
{
class TIMER
{
private:
double resolution;
double* timer_start;
double* timer_elapsed;
int* free_timers;
int number_of_free_timers;
static TIMER* singleton_instance;
public:
TIMER()
{
const int number_of_timers = 512;
timer_start = new double[number_of_timers];
timer_elapsed = new double[number_of_timers];
free_timers = new int[number_of_timers];
resolution = Initialize_Timer();
timer_elapsed[0] = 0;
timer_start[0] = 0;
for (int i = 0; i < number_of_timers; i++) free_timers[i] = i;
number_of_free_timers = number_of_timers;
}
~TIMER()
{
delete timer_start;
delete timer_elapsed;
delete free_timers;
}
static inline TIMER* Singleton()
{
if (singleton_instance == 0) singleton_instance = new TIMER();
return singleton_instance;
}
//#####################################################################
double Get_Time();
int Register_Timer();
void Release_Timer (const int id);
double Get_Total_Time_Since_Registration (const int id);
double Peek_And_Reset_Time (const int id);
void Reset_Time (const int id);
double Peek_Time (const int id);
//#####################################################################
};
}
#endif
|
#ifndef org_apache_lucene_analysis_miscellaneous_LengthFilterFactory_H
#define org_apache_lucene_analysis_miscellaneous_LengthFilterFactory_H
#include "org/apache/lucene/analysis/util/TokenFilterFactory.h"
namespace org {
namespace apache {
namespace lucene {
namespace analysis {
class TokenStream;
namespace miscellaneous {
class LengthFilter;
}
}
}
}
}
namespace java {
namespace lang {
class String;
class Class;
}
namespace util {
class Map;
}
}
template<class T> class JArray;
namespace org {
namespace apache {
namespace lucene {
namespace analysis {
namespace miscellaneous {
class LengthFilterFactory : public ::org::apache::lucene::analysis::util::TokenFilterFactory {
public:
enum {
mid_init$_4c9e2b1c,
mid_create_c5f48534,
max_mid
};
static ::java::lang::Class *class$;
static jmethodID *mids$;
static bool live$;
static jclass initializeClass(bool);
explicit LengthFilterFactory(jobject obj) : ::org::apache::lucene::analysis::util::TokenFilterFactory(obj) {
if (obj != NULL)
env->getClass(initializeClass);
}
LengthFilterFactory(const LengthFilterFactory& obj) : ::org::apache::lucene::analysis::util::TokenFilterFactory(obj) {}
static ::java::lang::String *MAX_KEY;
static ::java::lang::String *MIN_KEY;
LengthFilterFactory(const ::java::util::Map &);
::org::apache::lucene::analysis::miscellaneous::LengthFilter create(const ::org::apache::lucene::analysis::TokenStream &) const;
};
}
}
}
}
}
#include <Python.h>
namespace org {
namespace apache {
namespace lucene {
namespace analysis {
namespace miscellaneous {
extern PyTypeObject PY_TYPE(LengthFilterFactory);
class t_LengthFilterFactory {
public:
PyObject_HEAD
LengthFilterFactory object;
static PyObject *wrap_Object(const LengthFilterFactory&);
static PyObject *wrap_jobject(const jobject&);
static void install(PyObject *module);
static void initialize(PyObject *module);
};
}
}
}
}
}
#endif
|
/*************************************************************************/
/* navigation_mesh_generator.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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 NAVIGATION_MESH_GENERATOR_H
#define NAVIGATION_MESH_GENERATOR_H
#include "core/os/thread.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "scene/3d/mesh_instance.h"
#include "scene/3d/navigation_mesh.h"
#include "scene/resources/shape.h"
#include <Recast.h>
class NavigationMeshGenerator {
protected:
static void _add_vertex(const Vector3 &p_vec3, Vector<float> &p_verticies);
static void _add_mesh(const Ref<Mesh> &p_mesh, const Transform &p_xform, Vector<float> &p_verticies, Vector<int> &p_indices);
static void _parse_geometry(const Transform &p_base_inverse, Node *p_node, Vector<float> &p_verticies, Vector<int> &p_indices);
static void _convert_detail_mesh_to_native_navigation_mesh(const rcPolyMeshDetail *p_detail_mesh, Ref<NavigationMesh> p_nav_mesh);
static void _build_recast_navigation_mesh(Ref<NavigationMesh> p_nav_mesh, EditorProgress *ep,
rcHeightfield *hf, rcCompactHeightfield *chf, rcContourSet *cset, rcPolyMesh *poly_mesh,
rcPolyMeshDetail *detail_mesh, Vector<float> &vertices, Vector<int> &indices);
public:
static void bake(Ref<NavigationMesh> p_nav_mesh, Node *p_node);
static void clear(Ref<NavigationMesh> p_nav_mesh);
};
#endif // NAVIGATION_MESH_GENERATOR_H
|
//
// UITableViewCell+SUIHelper.h
// SUIUtilsDemo
//
// Created by RandomSuio on 16/2/20.
// Copyright © 2016年 RandomSuio. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@protocol SUITableHelperProtocol <NSObject>
@optional
- (void)sui_cellWillDisplayWithModel:(id)cModel;
@end
@interface UITableViewCell (SUIHelper) <SUITableHelperProtocol>
@property (nullable,nonatomic,strong) NSIndexPath *sui_indexPath;
@end
NS_ASSUME_NONNULL_END
|
//
// This source file is part of appleseed.
// Visit https://appleseedhq.net/ for additional information and resources.
//
// This software is released under the MIT license.
//
// Copyright (c) 2015-2018 Francois Beaune, The appleseedhq Organization
//
// 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.
//
#pragma once
// appleseed.renderer headers.
#include "renderer/modeling/scene/visibilityflags.h"
// Standard headers.
#include <cassert>
namespace renderer
{
//
// All possible scattering modes.
//
class ScatteringMode
{
public:
enum ModeBitShift
{
DiffuseBitShift = 0,
GlossyBitShift = 1,
SpecularBitShift = 2,
VolumeBitShift = 3
};
enum Mode
{
None = 0,
Diffuse = 1UL << DiffuseBitShift,
Glossy = 1UL << GlossyBitShift,
Specular = 1UL << SpecularBitShift,
Volume = 1UL << VolumeBitShift,
All = Diffuse | Glossy | Specular | Volume
};
// Test for the presence of specific scattering modes.
static bool has_diffuse(const int modes);
static bool has_glossy(const int modes);
static bool has_specular(const int modes);
static bool has_volume(const int modes);
static bool has_diffuse_or_glossy_or_volume(const int modes);
static bool has_diffuse_and_glossy(const int modes);
static bool has_diffuse_or_volume(const int modes);
static bool has_glossy_or_specular(const int modes);
// Determine the appropriate visibility type for a given scattering mode.
static VisibilityFlags::Type get_vis_flags(const Mode mode);
};
//
// ScatteringMode class implementation.
//
inline bool ScatteringMode::has_diffuse(const int modes)
{
return (modes & Diffuse) != 0;
}
inline bool ScatteringMode::has_glossy(const int modes)
{
return (modes & Glossy) != 0;
}
inline bool ScatteringMode::has_specular(const int modes)
{
return (modes & Specular) != 0;
}
inline bool ScatteringMode::has_volume(const int modes)
{
return (modes & Volume) != 0;
}
inline bool ScatteringMode::has_diffuse_or_glossy_or_volume(const int modes)
{
return (modes & (Diffuse | Glossy | Volume)) != 0;
}
inline bool ScatteringMode::has_diffuse_and_glossy(const int modes)
{
return (modes & (Diffuse | Glossy)) == (Diffuse | Glossy);
}
inline bool ScatteringMode::has_diffuse_or_volume(const int modes)
{
return (modes & (Diffuse | Volume)) != 0;
}
inline bool ScatteringMode::has_glossy_or_specular(const int modes)
{
return (modes & (Glossy | Specular)) != 0;
}
inline VisibilityFlags::Type ScatteringMode::get_vis_flags(const Mode mode)
{
switch (mode)
{
case Diffuse:
return VisibilityFlags::DiffuseRay;
case Glossy:
return VisibilityFlags::GlossyRay;
case Specular:
return VisibilityFlags::SpecularRay;
default:
assert(!"Invalid scattering mode.");
return VisibilityFlags::DiffuseRay;
}
}
} // namespace renderer
|
/*
Copyright (c) 2013. 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_COMPILER_H
#define YR_COMPILER_H
#include <stdio.h>
#include <setjmp.h>
#include "ahocorasick.h"
#include "arena.h"
#include "hash.h"
#include "utils.h"
#define YARA_ERROR_LEVEL_ERROR 0
#define YARA_ERROR_LEVEL_WARNING 1
typedef void (*YR_COMPILER_CALLBACK_FUNC)(
int error_level,
const char* file_name,
int line_number,
const char* message,
void* user_data);
typedef struct _YR_FIXUP
{
int64_t* address;
struct _YR_FIXUP* next;
} YR_FIXUP;
typedef struct _YR_COMPILER
{
int errors;
int error_line;
int last_error;
int last_error_line;
int last_result;
jmp_buf error_recovery;
YR_ARENA* sz_arena;
YR_ARENA* rules_arena;
YR_ARENA* strings_arena;
YR_ARENA* code_arena;
YR_ARENA* re_code_arena;
YR_ARENA* compiled_rules_arena;
YR_ARENA* externals_arena;
YR_ARENA* namespaces_arena;
YR_ARENA* metas_arena;
YR_ARENA* matches_arena;
YR_ARENA* automaton_arena;
YR_AC_AUTOMATON* automaton;
YR_HASH_TABLE* rules_table;
YR_HASH_TABLE* objects_table;
YR_HASH_TABLE* strings_table;
YR_NAMESPACE* current_namespace;
YR_RULE* current_rule;
YR_FIXUP* fixup_stack_head;
int namespaces_count;
uint8_t* loop_address[MAX_LOOP_NESTING];
char* loop_identifier[MAX_LOOP_NESTING];
int loop_depth;
int loop_for_of_mem_offset;
int allow_includes;
char* file_name_stack[MAX_INCLUDE_DEPTH];
int file_name_stack_ptr;
FILE* file_stack[MAX_INCLUDE_DEPTH];
int file_stack_ptr;
char last_error_extra_info[MAX_COMPILER_ERROR_EXTRA_INFO];
char lex_buf[LEX_BUF_SIZE];
char* lex_buf_ptr;
unsigned short lex_buf_len;
char include_base_dir[MAX_PATH];
void* user_data;
YR_COMPILER_CALLBACK_FUNC callback;
} YR_COMPILER;
#define yr_compiler_set_error_extra_info(compiler, info) \
strlcpy( \
compiler->last_error_extra_info, \
info, \
sizeof(compiler->last_error_extra_info)); \
#define yr_compiler_set_error_extra_info_fmt(compiler, fmt, ...) \
snprintf( \
compiler->last_error_extra_info, \
sizeof(compiler->last_error_extra_info), \
fmt, __VA_ARGS__);
int _yr_compiler_push_file(
YR_COMPILER* compiler,
FILE* fh);
FILE* _yr_compiler_pop_file(
YR_COMPILER* compiler);
int _yr_compiler_push_file_name(
YR_COMPILER* compiler,
const char* file_name);
void _yr_compiler_pop_file_name(
YR_COMPILER* compiler);
YR_API int yr_compiler_create(
YR_COMPILER** compiler);
YR_API void yr_compiler_destroy(
YR_COMPILER* compiler);
YR_API void yr_compiler_set_callback(
YR_COMPILER* compiler,
YR_COMPILER_CALLBACK_FUNC callback,
void* user_data);
YR_API int yr_compiler_add_file(
YR_COMPILER* compiler,
FILE* rules_file,
const char* namespace_,
const char* file_name);
YR_API int yr_compiler_add_string(
YR_COMPILER* compiler,
const char* rules_string,
const char* namespace_);
YR_API char* yr_compiler_get_error_message(
YR_COMPILER* compiler,
char* buffer,
int buffer_size);
YR_API char* yr_compiler_get_current_file_name(
YR_COMPILER* context);
YR_API int yr_compiler_define_integer_variable(
YR_COMPILER* compiler,
const char* identifier,
int64_t value);
YR_API int yr_compiler_define_boolean_variable(
YR_COMPILER* compiler,
const char* identifier,
int value);
YR_API int yr_compiler_define_float_variable(
YR_COMPILER* compiler,
const char* identifier,
double value);
YR_API int yr_compiler_define_string_variable(
YR_COMPILER* compiler,
const char* identifier,
const char* value);
YR_API int yr_compiler_get_rules(
YR_COMPILER* compiler,
YR_RULES** rules);
#endif
|
/*
* Copyright (c) 2012 The Chromium OS Authors.
*
* SPDX-License-Identifier: GPL-2.0+
*/
/*
* IO space access commands.
*/
#include <common.h>
#include <command.h>
#include <asm/io.h>
/*
* IO Display
*
* Syntax:
* iod{.b, .w, .l} {addr}
*/
int do_io_iod(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
{
ulong addr;
int size;
if (argc != 2)
return CMD_RET_USAGE;
size = cmd_get_data_size(argv[0], 4);
if (size < 0)
return 1;
addr = simple_strtoul(argv[1], NULL, 16);
printf("%04x: ", (u16) addr);
if (size == 4)
printf("%08x\n", inl(addr));
else if (size == 2)
printf("%04x\n", inw(addr));
else
printf("%02x\n", inb(addr));
return 0;
}
int do_io_iow(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
{
ulong addr, val;
int size;
if (argc != 3)
return CMD_RET_USAGE;
size = cmd_get_data_size(argv[0], 4);
if (size < 0)
return 1;
addr = simple_strtoul(argv[1], NULL, 16);
val = simple_strtoul(argv[2], NULL, 16);
if (size == 4)
outl((u32) val, addr);
else if (size == 2)
outw((u16) val, addr);
else
outb((u8) val, addr);
return 0;
}
/**************************************************/
U_BOOT_CMD(iod, 2, 0, do_io_iod,
"IO space display", "[.b, .w, .l] address");
U_BOOT_CMD(iow, 3, 0, do_io_iow,
"IO space modify",
"[.b, .w, .l] address value");
|
#ifndef org_apache_lucene_analysis_ru_RussianLightStemmer_H
#define org_apache_lucene_analysis_ru_RussianLightStemmer_H
#include "java/lang/Object.h"
namespace java {
namespace lang {
class Class;
}
}
template<class T> class JArray;
namespace org {
namespace apache {
namespace lucene {
namespace analysis {
namespace ru {
class RussianLightStemmer : public ::java::lang::Object {
public:
enum {
mid_init$_54c6a166,
mid_stem_ec6430eb,
max_mid
};
static ::java::lang::Class *class$;
static jmethodID *mids$;
static bool live$;
static jclass initializeClass(bool);
explicit RussianLightStemmer(jobject obj) : ::java::lang::Object(obj) {
if (obj != NULL)
env->getClass(initializeClass);
}
RussianLightStemmer(const RussianLightStemmer& obj) : ::java::lang::Object(obj) {}
RussianLightStemmer();
jint stem(const JArray< jchar > &, jint) const;
};
}
}
}
}
}
#include <Python.h>
namespace org {
namespace apache {
namespace lucene {
namespace analysis {
namespace ru {
extern PyTypeObject PY_TYPE(RussianLightStemmer);
class t_RussianLightStemmer {
public:
PyObject_HEAD
RussianLightStemmer object;
static PyObject *wrap_Object(const RussianLightStemmer&);
static PyObject *wrap_jobject(const jobject&);
static void install(PyObject *module);
static void initialize(PyObject *module);
};
}
}
}
}
}
#endif
|
#ifndef org_apache_lucene_store_NRTCachingDirectory_H
#define org_apache_lucene_store_NRTCachingDirectory_H
#include "org/apache/lucene/store/Directory.h"
namespace org {
namespace apache {
namespace lucene {
namespace store {
class IndexOutput;
class Lock;
class LockFactory;
class IOContext;
class IndexInput;
}
}
}
}
namespace java {
namespace lang {
class String;
class Class;
}
namespace util {
class Collection;
}
namespace io {
class IOException;
}
}
template<class T> class JArray;
namespace org {
namespace apache {
namespace lucene {
namespace store {
class NRTCachingDirectory : public ::org::apache::lucene::store::Directory {
public:
enum {
mid_init$_a6a83a1c,
mid_cacheRamBytesUsed_54c6a17a,
mid_clearLock_5fdc3f48,
mid_close_54c6a166,
mid_createOutput_5ad5358d,
mid_deleteFile_5fdc3f48,
mid_fileExists_5fdc3f44,
mid_fileLength_5fdc3f54,
mid_getDelegate_1f3934bb,
mid_getLockFactory_e4e9c36d,
mid_getLockID_14c7b5c5,
mid_listAll_2e6d5245,
mid_listCachedFiles_2e6d5245,
mid_makeLock_f26bb9a8,
mid_openInput_3e1b5375,
mid_setLockFactory_9892eb8c,
mid_sync_9bfb370d,
mid_toString_14c7b5c5,
mid_doCacheWrite_501c6f10,
max_mid
};
static ::java::lang::Class *class$;
static jmethodID *mids$;
static bool live$;
static jclass initializeClass(bool);
explicit NRTCachingDirectory(jobject obj) : ::org::apache::lucene::store::Directory(obj) {
if (obj != NULL)
env->getClass(initializeClass);
}
NRTCachingDirectory(const NRTCachingDirectory& obj) : ::org::apache::lucene::store::Directory(obj) {}
NRTCachingDirectory(const ::org::apache::lucene::store::Directory &, jdouble, jdouble);
jlong cacheRamBytesUsed() const;
void clearLock(const ::java::lang::String &) const;
void close() const;
::org::apache::lucene::store::IndexOutput createOutput(const ::java::lang::String &, const ::org::apache::lucene::store::IOContext &) const;
void deleteFile(const ::java::lang::String &) const;
jboolean fileExists(const ::java::lang::String &) const;
jlong fileLength(const ::java::lang::String &) const;
::org::apache::lucene::store::Directory getDelegate() const;
::org::apache::lucene::store::LockFactory getLockFactory() const;
::java::lang::String getLockID() const;
JArray< ::java::lang::String > listAll() const;
JArray< ::java::lang::String > listCachedFiles() const;
::org::apache::lucene::store::Lock makeLock(const ::java::lang::String &) const;
::org::apache::lucene::store::IndexInput openInput(const ::java::lang::String &, const ::org::apache::lucene::store::IOContext &) const;
void setLockFactory(const ::org::apache::lucene::store::LockFactory &) const;
void sync(const ::java::util::Collection &) const;
::java::lang::String toString() const;
};
}
}
}
}
#include <Python.h>
namespace org {
namespace apache {
namespace lucene {
namespace store {
extern PyTypeObject PY_TYPE(NRTCachingDirectory);
class t_NRTCachingDirectory {
public:
PyObject_HEAD
NRTCachingDirectory object;
static PyObject *wrap_Object(const NRTCachingDirectory&);
static PyObject *wrap_jobject(const jobject&);
static void install(PyObject *module);
static void initialize(PyObject *module);
};
}
}
}
}
#endif
|
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
// Developed by Minigraph
//
// Author(s): Alex Nankervis
// James Stanard
//
#pragma once
//using namespace Graphics;
#include <cstdint>
class StructuredBuffer;
class ByteAddressBuffer;
class ColorBuffer;
class ShadowBuffer;
class GraphicsContext;
class IntVar;
namespace Math
{
class Vector3;
class Matrix4;
class Camera;
}
namespace Lighting
{
extern IntVar LightGridDim;
enum { MaxLights = 128 };
//LightData m_LightData[MaxLights];
extern StructuredBuffer m_LightBuffer;
extern ByteAddressBuffer m_LightGrid;
extern ByteAddressBuffer m_LightGridBitMask;
extern std::uint32_t m_FirstConeLight;
extern std::uint32_t m_FirstConeShadowedLight;
extern ColorBuffer m_LightShadowArray;
extern ShadowBuffer m_LightShadowTempBuffer;
extern Math::Matrix4 m_LightShadowMatrix[MaxLights];
void InitializeResources(void);
void CreateRandomLights(const Math::Vector3 minBound, const Math::Vector3 maxBound);
void FillLightGrid(GraphicsContext& gfxContext, const Math::Camera& camera);
void Shutdown(void);
}
|
/*
Copyright (c) 2013 Roger Light <roger@atchoo.org>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
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 mosquitto 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.
*/
#ifdef __APPLE__
#include <mach/mach.h>
#include <mach/mach_time.h>
#endif
#ifdef WIN32
# define _WIN32_WINNT _WIN32_WINNT_VISTA
# include <windows.h>
#else
# include <unistd.h>
#endif
#include <time.h>
#include "mosquitto.h"
#include "time_mosq.h"
#ifdef WIN32
static bool tick64 = false;
void _windows_time_version_check(void)
{
OSVERSIONINFO vi;
tick64 = false;
memset(&vi, 0, sizeof(OSVERSIONINFO));
vi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if(GetVersionEx(&vi)){
if(vi.dwMajorVersion > 5){
tick64 = true;
}
}
}
#endif
time_t mosquitto_time(void)
{
#ifdef WIN32
if(tick64){
return GetTickCount64()/1000;
}else{
return GetTickCount()/1000; /* FIXME - need to deal with overflow. */
}
#elif _POSIX_TIMERS>0 && defined(_POSIX_MONOTONIC_CLOCK)
struct timespec tp;
clock_gettime(CLOCK_MONOTONIC, &tp);
return tp.tv_sec;
#elif defined(__APPLE__)
static mach_timebase_info_data_t tb;
uint64_t ticks;
uint64_t sec;
ticks = mach_absolute_time();
if(tb.denom == 0){
mach_timebase_info(&tb);
}
sec = (ticks/1000000000)*(tb.numer/tb.denom);
return (time_t)sec;
#else
return time(NULL);
#endif
}
|
// CoreBitcoin by Oleg Andreev <oleganza@gmail.com>, WTFPL.
#import <Foundation/Foundation.h>
@class BTCScript;
@class BTCOutpoint;
@class BTCTransaction;
@class BTCTransactionOutput;
// Transaction input (aka "txin") represents a reference to another transaction's output.
// Reference is defined by tx hash + tx output index.
// Signature script is used to prove ownership of the corresponding tx output.
// Sequence is used to require different signatures when tx is updated. It is only relevant when tx lockTime > 0.
@interface BTCTransactionInput : NSObject <NSCopying>
// Hash of the previous transaction.
@property(nonatomic) NSData* previousHash;
// Transaction ID referenced by this input (reversed previousHash in hex).
@property(nonatomic) NSString* previousTransactionID;
// Index of the previous transaction's output.
@property(nonatomic) uint32_t previousIndex;
// Outpoint of this input (previous hash and output index). Corresponds to COutPoint class in bitcoind.
@property(nonatomic) BTCOutpoint* outpoint;
// Script that proves ownership of the previous transaction output.
// This property is nil for coinbase inputs. See `coinbaseData` for raw binary data.
@property(nonatomic) BTCScript* signatureScript;
// Raw coinbase data if this input is coinbase.
// If `coinbaseData` is not nil, then `signatureScript` is nil.
@property(nonatomic) NSData* coinbaseData;
// Input sequence. Default is maximum value 0xFFFFFFFF.
// Sequence is used to update a timelocked tx stored in memory of the nodes. It is only relevant when tx lockTime > 0.
// Currently, for DoS and security reasons, nodes do not store timelocked transactions making the sequence number meaningless.
@property(nonatomic) uint32_t sequence;
// Serialized binary representation of the txin.
@property(nonatomic, readonly) NSData* data;
// Informational properties
// ------------------------
// These are set by external APIs such as Chain.com.
// Set when input is added via [tx addInput:input]
@property(weak, nonatomic) BTCTransaction* transaction;
// Optional reference to a corresponding output, typically an unspent output in a context of building a new transaction.
@property(nonatomic) BTCTransactionOutput* transactionOutput;
// Value in the corresponding output.
// Default is transactionOutput.value or -1.
@property(nonatomic) BTCAmount value;
// Arbitrary information attached to this instance.
// The reference is copied when this instance is copied.
// Default is nil.
@property(nonatomic) NSDictionary* userInfo;
// Parses tx input from a data buffer.
- (id) initWithData:(NSData*)data;
// Read tx input from the stream.
- (id) initWithStream:(NSInputStream*)stream;
// Constructs transaction input from a dictionary representation
- (id) initWithDictionary:(NSDictionary*)dictionary;
// Returns a dictionary representation suitable for encoding in JSON or Plist.
@property(nonatomic, readonly) NSDictionary* dictionary;
// Returns YES if this txin generates new coins.
@property(nonatomic, readonly) BOOL isCoinbase;
- (NSDictionary*) dictionaryRepresentation DEPRECATED_ATTRIBUTE;
@end
|
/*
* mon_command.h - The VICE built-in monitor command table.
*
* Written by
* Andreas Boose <viceteam@t-online.de>
*
* This file is part of VICE, the Versatile Commodore Emulator.
* See README for copyright notice.
*
* 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 VICE_MON_COMMAND_H
#define VICE_MON_COMMAND_H
extern void mon_command_print_help(const char *cmd);
extern int mon_get_nth_command(int index, const char** full_name, const char **short_name, int *takes_filename_as_arg);
#endif
|
#ifndef _X86_64_USER_H
#define _X86_64_USER_H
#include <asm/types.h>
#include <asm/page.h>
/* Core file format: The core file is written in such a way that gdb
can understand it and provide useful information to the user.
There are quite a number of obstacles to being able to view the
contents of the floating point registers, and until these are
solved you will not be able to view the contents of them.
Actually, you can read in the core file and look at the contents of
the user struct to find out what the floating point registers
contain.
The actual file contents are as follows:
UPAGE: 1 page consisting of a user struct that tells gdb what is present
in the file. Directly after this is a copy of the task_struct, which
is currently not used by gdb, but it may come in useful at some point.
All of the registers are stored as part of the upage. The upage should
always be only one page.
DATA: The data area is stored. We use current->end_text to
current->brk to pick up all of the user variables, plus any memory
that may have been malloced. No attempt is made to determine if a page
is demand-zero or if a page is totally unused, we just cover the entire
range. All of the addresses are rounded in such a way that an integral
number of pages is written.
STACK: We need the stack information in order to get a meaningful
backtrace. We need to write the data from (esp) to
current->start_stack, so we round each of these off in order to be able
to write an integer number of pages.
The minimum core file size is 3 pages, or 12288 bytes. */
/*
* Pentium III FXSR, SSE support
* Gareth Hughes <gareth@valinux.com>, May 2000
*
* Provide support for the GDB 5.0+ PTRACE_{GET|SET}FPXREGS requests for
* interacting with the FXSR-format floating point environment. Floating
* point data can be accessed in the regular format in the usual manner,
* and both the standard and SIMD floating point data can be accessed via
* the new ptrace requests. In either case, changes to the FPU environment
* will be reflected in the task's state as expected.
*
* x86-64 support by Andi Kleen.
*/
/* This matches the 64bit FXSAVE format as defined by AMD. It is the same
as the 32bit format defined by Intel, except that the selector:offset pairs for
data and eip are replaced with flat 64bit pointers. */
struct user_i387_struct {
unsigned short cwd;
unsigned short swd;
unsigned short twd; /* Note this is not the same as the 32bit/x87/FSAVE twd */
unsigned short fop;
__u64 rip;
__u64 rdp;
__u32 mxcsr;
__u32 mxcsr_mask;
__u32 st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
__u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */
__u32 padding[24];
};
/*
* Segment register layout in coredumps.
*/
struct user_regs_struct {
unsigned long r15;
unsigned long r14;
unsigned long r13;
unsigned long r12;
unsigned long bp;
unsigned long bx;
unsigned long r11;
unsigned long r10;
unsigned long r9;
unsigned long r8;
unsigned long ax;
unsigned long cx;
unsigned long dx;
unsigned long si;
unsigned long di;
unsigned long orig_ax;
unsigned long ip;
unsigned long cs;
unsigned long flags;
unsigned long sp;
unsigned long ss;
unsigned long fs_base;
unsigned long gs_base;
unsigned long ds;
unsigned long es;
unsigned long fs;
unsigned long gs;
};
/* When the kernel dumps core, it starts by dumping the user struct -
this will be used by gdb to figure out where the data and stack segments
are within the file, and what virtual addresses to use. */
struct user{
/* We start with the registers, to mimic the way that "memory" is returned
from the ptrace(3,...) function. */
struct user_regs_struct regs; /* Where the registers are actually stored */
/* ptrace does not yet supply these. Someday.... */
int u_fpvalid; /* True if math co-processor being used. */
/* for this mess. Not yet used. */
int pad0;
struct user_i387_struct i387; /* Math Co-processor registers. */
/* The rest of this junk is to help gdb figure out what goes where */
unsigned long int u_tsize; /* Text segment size (pages). */
unsigned long int u_dsize; /* Data segment size (pages). */
unsigned long int u_ssize; /* Stack segment size (pages). */
unsigned long start_code; /* Starting virtual address of text. */
unsigned long start_stack; /* Starting virtual address of stack area.
This is actually the bottom of the stack,
the top of the stack is always found in the
esp register. */
long int signal; /* Signal that caused the core dump. */
int reserved; /* No longer used */
int pad1;
unsigned long u_ar0; /* Used by gdb to help find the values for */
/* the registers. */
struct user_i387_struct* u_fpstate; /* Math Co-processor pointer. */
unsigned long magic; /* To uniquely identify a core file */
char u_comm[32]; /* User command that was responsible */
unsigned long u_debugreg[8];
unsigned long error_code; /* CPU error code or 0 */
unsigned long fault_address; /* CR3 or 0 */
};
#define NBPG PAGE_SIZE
#define UPAGES 1
#define HOST_TEXT_START_ADDR (u.start_code)
#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
#endif /* _X86_64_USER_H */
|
/*
* GStreamer
* Copyright (c) 2005 INdT.
* @author Andre Moreira Magalhaes <andre.magalhaes@indt.org.br>
* @author Philippe Khalaf <burger@speedy.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_MIM_ENC_H__
#define __GST_MIM_ENC_H__
#include <glib.h>
#include <gst/gst.h>
#include <mimic.h>
G_BEGIN_DECLS
#define GST_TYPE_MIM_ENC \
(gst_mim_enc_get_type())
#define GST_MIM_ENC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MIM_ENC,GstMimEnc))
#define GST_MIM_ENC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MIM_ENC,GstMimEncClass))
#define GST_IS_MIM_ENC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MIM_ENC))
#define GST_IS_MIM_ENC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MIM_ENC))
typedef struct _GstMimEnc GstMimEnc;
typedef struct _GstMimEncClass GstMimEncClass;
struct _GstMimEnc
{
GstElement element;
GstPad *sinkpad, *srcpad;
/* Protected by the object lock */
MimCtx *enc;
MimicResEnum res;
gint buffer_size;
guint32 frames;
guint16 height, width;
gboolean paused_mode;
GstSegment segment;
GstClockTime last_buffer;
GstClockID clock_id;
gboolean stop_paused_mode;
};
struct _GstMimEncClass
{
GstElementClass parent_class;
};
GType gst_mim_enc_get_type (void);
G_END_DECLS
#endif /* __GST_MIM_ENC_H__ */
|
/* Software floating-point emulation.
c = (long double)(a)
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson (rth@cygnus.com) and
Jakub Jelinek (jj@ultra.linux.cz).
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include "soft-fp.h"
#include "single.h"
#include "quad.h"
long double _Q_stoq(const float a)
{
FP_DECL_EX;
FP_DECL_S(A);
FP_DECL_Q(C);
long double c;
FP_UNPACK_RAW_S(A, a);
#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
FP_EXTEND(Q,S,4,1,C,A);
#else
FP_EXTEND(Q,S,2,1,C,A);
#endif
FP_PACK_RAW_Q(c, C);
FP_HANDLE_EXCEPTIONS;
return c;
}
|
/*
* Copyright (C) 2005-2008 Team XBMC
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
#include <Python.h>
#include "GUIPythonWindow.h"
#include "GUIPythonWindowXML.h"
#include "GUIPythonWindowXMLDialog.h"
#include "GUIPythonWindowDialog.h"
#include "control.h"
#pragma once
#define Window_Check(op) PyObject_TypeCheck(op, &Window_Type)
#define Window_CheckExact(op) ((op)->ob_type == &Window_Type)
#define WindowXML_Check(op) PyObject_TypeCheck(op, &WindowXML_Type)
#define WindowXML_CheckExact(op) ((op)->ob_type == &WindowXML_Type)
#define WindowDialog_Check(op) PyObject_TypeCheck(op, &WindowDialog_Type)
#define WindowDialog_CheckExact(op) ((op)->ob_type == &WindowDialog_Type)
#define WindowXMLDialog_Check(op) PyObject_TypeCheck(op, &WindowXMLDialog_Type)
#define WindowXMLDialog_CheckExact(op) ((op)->ob_type == &WindowXMLDialog_Type)
#define PyObject_HEAD_XBMC_WINDOW \
PyObject_HEAD \
int iWindowId; \
int iOldWindowId; \
int iCurrentControlId; \
bool bIsPythonWindow; \
bool bModal; \
bool bUsingXML; \
std::string sXMLFileName; \
std::string sFallBackPath; \
CGUIWindow* pWindow; \
std::vector<Control*> vecControls;
#ifdef __cplusplus
extern "C" {
#endif
namespace PYXBMC
{
typedef struct {
PyObject_HEAD_XBMC_WINDOW
} Window;
extern PyMethodDef Window_methods[];
extern PyTypeObject Window_Type;
void initWindow_Type();
bool Window_CreateNewWindow(Window* pWindow, bool bAsDialog);
void Window_Dealloc(Window* self);
PyObject* Window_Close(Window *self, PyObject *args);
}
#ifdef __cplusplus
}
#endif
|
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (C) Stefano Babic <sbabic@denx.de>
*/
#ifndef __PCM058_CONFIG_H
#define __PCM058_CONFIG_H
#ifdef CONFIG_SPL
#include "imx6_spl.h"
#endif
#include "mx6_common.h"
#define PHYS_SDRAM_SIZE (1u * 1024 * 1024 * 1024)
/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN (8 * SZ_1M)
/* Enable NAND support */
#define CONFIG_SYS_MAX_NAND_DEVICE 1
/* Physical Memory Map */
#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
#define CONFIG_SYS_INIT_SP_OFFSET \
(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
#define CONFIG_SYS_INIT_SP_ADDR \
(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
/* Environment organization */
#define ENV_MMC \
"mmcdev=0\0" \
"mmcpart=2\0" \
"fitpart=1\0" \
"mmcrootfstype=ext4\0" \
"fitname=fitImage\0" \
"mmcloadfit=load mmc ${mmcdev}:${fitpart} ${loadaddr} ${fitname}\0" \
"mmcargs=setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcpart} " \
"rootfstype=${mmcrootfstype} ${optargs}\0" \
"mmcboot=run mmcloadfit;run mmcargs;bootm ${loadaddr}\0"
#define ENV_NAND \
"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
"nandroot=ubi0:root ubi.mtd=rootfs\0" \
"nandrootfstype=ubifs\0" \
"nandargs=setenv bootargs root=${nandroot} " \
"rootfstype=${nandrootfstype} ${mtdparts} ${optargs}\0" \
"nandloadfit=ubi part rootfs;ubi readvol ${loadaddr} fit\0" \
"nandboot=run nandloadfit;run nandargs;bootm ${loadaddr}\0"
#define CONFIG_EXTRA_ENV_SETTINGS \
"bootm_size=0x30000000\0" \
"optargs=rw rootwait\0" \
ENV_MMC \
ENV_NAND
#define CONFIG_BOOTCOMMAND "run mmcboot;run nandboot"
#endif
|
/* Read block from given position in file without changing file pointer.
POSIX version.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <unistd.h>
/* Note: This implementation of pread64 is not multithread-safe. */
ssize_t
__libc_pread64 (int fd, void *buf, size_t nbyte, off64_t offset)
{
/* Since we must not change the file pointer preserve the value so that
we can restore it later. */
int save_errno;
ssize_t result;
off64_t old_offset = __libc_lseek64 (fd, 0, SEEK_CUR);
if (old_offset == (off64_t) -1)
return -1;
/* Set to wanted position. */
if (__libc_lseek64 (fd, offset, SEEK_SET) == (off64_t) -1)
return -1;
/* Write out the data. */
result = __libc_read (fd, buf, nbyte);
/* Now we have to restore the position. If this fails we have to
return this as an error. But if the writing also failed we
return this error. */
save_errno = errno;
if (__libc_lseek64 (fd, old_offset, SEEK_SET) == (off64_t) -1)
{
if (result == -1)
__set_errno (save_errno);
return -1;
}
__set_errno (save_errno);
return result;
}
#ifndef __libc_pread64
weak_alias (__libc_pread64, __pread64)
weak_alias (__libc_pread64, pread64)
#endif
|
#ifndef __X86_TYPES_H__
#define __X86_TYPES_H__
#ifndef __ASSEMBLY__
#include <xen/config.h>
typedef __signed__ char __s8;
typedef unsigned char __u8;
typedef __signed__ short __s16;
typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
#if defined(__i386__)
typedef __signed__ long long __s64;
typedef unsigned long long __u64;
#elif defined(__x86_64__)
typedef __signed__ long __s64;
typedef unsigned long __u64;
#endif
#endif
typedef signed char s8;
typedef unsigned char u8;
typedef signed short s16;
typedef unsigned short u16;
typedef signed int s32;
typedef unsigned int u32;
#if defined(__i386__)
typedef signed long long s64;
typedef unsigned long long u64;
typedef u64 paddr_t;
#define INVALID_PADDR (~0ULL)
#define PRIpaddr "016llx"
#elif defined(__x86_64__)
typedef signed long s64;
typedef unsigned long u64;
typedef unsigned long paddr_t;
#define INVALID_PADDR (~0UL)
#define PRIpaddr "016lx"
#endif
#if defined(__SIZE_TYPE__)
typedef __SIZE_TYPE__ size_t;
#elif defined(__i386__)
typedef unsigned int size_t;
#else
typedef unsigned long size_t;
#endif
typedef char bool_t;
#define test_and_set_bool(b) xchg(&(b), 1)
#define test_and_clear_bool(b) xchg(&(b), 0)
#endif /* __ASSEMBLY__ */
#endif /* __X86_TYPES_H__ */
|
#include "../cfgdefault/CFG_UART_Config_Default.h"
#include "../cfgdefault/CFG_BT_Default.h"
#include "../cfgdefault/CFG_SIM_CONFIG_Default.h"
#include "../cfgdefault/CFG_ADC_Default.h"
#include "../cfgdefault/CFG_BWCS_Default.h"
#include "../cfgdefault/CFG_Audio_Default.h"
#include "../cfgdefault/CFG_OMADMUSB_Default.h"
#include "../cfgdefault/CFG_MDTYPE_Default.h"
#include "../cfgdefault/CFG_EXT_MDTYPE_Default.h"
#include "../cfgdefault/CFG_SDIO_Default.h"
#ifdef MTK_MD_SBP_CUSTOM_VALUE
#include "../cfgdefault/CFG_MD_SBP_Default.h"
#endif // MTK_MD_SBP_CUSTOM_VALUE
|
#include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <selinux/selinux.h>
int main(int argc, char **argv)
{
char *buf;
security_class_t tclass;
int ret;
if (argc != 4) {
fprintf(stderr, "usage: %s scontext tcontext tclass\n",
argv[0]);
exit(1);
}
tclass = string_to_security_class(argv[3]);
if (!tclass) {
fprintf(stderr, "Invalid class '%s'\n", argv[3]);
exit(2);
}
ret = security_compute_create(argv[1], argv[2], tclass, &buf);
if (ret < 0) {
fprintf(stderr, "%s: security_compute_create failed\n",
argv[0]);
exit(3);
}
printf("%s\n", buf);
freecon(buf);
exit(0);
}
|
/*
* Copyright (c) 2007 Cyrille Berger <cberger@cberger.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _KIS_TREE_VIEW_POPUP_H_
#define _KIS_TREE_VIEW_POPUP_H_
#include "widgets/kis_popup_button.h"
class QAbstractItemModel;
class QModelIndex;
/**
* This class is a workaround some limitation of QComboBox which doesn't
* allow to embed a QTreeView
* (see http://trolltech.com/developer/task-tracker/index_html?method=entry&id=87744
* and http://trolltech.com/developer/task-tracker/index_html?method=entry&id=109685).
* Once (if) those bugs are fixed, this class should be removed and should not be
* part of Krita's official API.
*/
class KisTreeViewPopup : public KisPopupButton
{
Q_OBJECT
public:
KisTreeViewPopup(QWidget* parent);
void setModel(QAbstractItemModel* model);
void setCurrentFilterId(const QString& id);
signals:
void currentItemChanged(const QModelIndex &);
public slots:
void setCurrentIndex(const QModelIndex &);
protected:
virtual void resizeEvent(QResizeEvent * event);
private:
struct Private;
Private* const d;
};
#endif
|
#pragma once
#include <Nena\Math.h>
namespace Demo
{
struct Transform
{
::Nena::Quaternion OrientationQ;
::Nena::Quaternion RotationQ;
::Nena::Vector3 Translation;
::Nena::Vector3 RotationEA;
::Nena::Matrix World;
void EvaluateWorld()
{
World = ::Nena::Matrix::CreateTranslation(Translation);
World *= ::Nena::Matrix::CreateFromQuaternion(RotationQ);
/*World = ::Nena::Matrix::CreateFromQuaternion(RotationQ);
World *= ::Nena::Matrix::CreateTranslation(Translation);*/
/*World = ::Nena::Matrix::CreateTranslation(Translation);
World *= ::Nena::Matrix::CreateRotationX(RotationEA.x);
World *= ::Nena::Matrix::CreateRotationY(RotationEA.y);
World *= ::Nena::Matrix::CreateRotationZ(RotationEA.z);*/
}
};
}
|
// ==============================
// File: TJITGeneric_DataProcessingPSRTransfer.h
// Project: Einstein
//
// Copyright 2003-2007 by Paul Guyot (pguyot@kallisys.net).
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// 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.
// ==============================
// $Id$
// ==============================
#ifndef _TJITGENERIC_DATAPROCESSINGPSRTRANSFER_H
#define _TJITGENERIC_DATAPROCESSINGPSRTRANSFER_H
#include <K/Defines/KDefinitions.h>
#include "JIT.h"
// Einstein
#include "TARMProcessor.h"
void
Translate_DataProcessingPSRTransfer(
JITPageClass* inPage,
KUInt16* ioUnitCrsr,
KUInt32 inInstruction,
KUInt32 inVAddr );
#endif
// _TJITGENERIC_DATAPROCESSINGPSRTRANSFER_H
// ================== //
// fortune: not found //
// ================== //
|
#ifndef _IOS_BALONG_H_
#define _IOS_BALONG_H_
#ifdef __cplusplus
extern "C"
{
#endif
void rf_reset_to_gpio_mux(void);
void gpio_to_rf_reset_mux(void);
#ifdef __cplusplus
}
#endif
#endif
|
#include <osm.h>
#include <gen_msg.h>
/*lint -save -e537*/
#include <DrvInterface.h>
/*lint -restore*/
#include <ftm.h>
#include <ftm_ct.h>
/*lint -save -e537*/
#include <msp_errno.h>
/*lint -restore*/
/***********************************************************************************
Prototype : TDS_PsAppSendMsg
Description : PSµ÷ÓÃAPPµÄ½Ó¿Ú£¬ÓÃÓÚ´ÓDSP½ÓÊÕTDSάÐÞÔÓï(ATʵÏÖ, PSµ÷ÓÃ)
Input : ulLen ÏûÏ¢³¤¶È (³¤¶ÈÊý¾Ý²»´óÓÚ48×Ö½Ú)
Output : None.
Return Value : ³É¹¦:0, ʧ°Ü:ÆäËûÖµ
History :
************************************************************************************/
VOS_UINT32 TDS_PsAtSendMsg(VOS_UINT32 ulLen, TDS_AT_PS_MSG_INFO_STRU *pstTdsAppPsMsg)
{
if((0 == ulLen) || (NULL == pstTdsAppPsMsg))
{
return ERR_MSP_INVALID_PARAMETER;
}
/* return l1a_CtCnf(&pstTdsAppPsMsg->ulMsgId, 12); */
return ERR_MSP_UNKNOWN;
}
|
/*
* * Copyright (C) 2006-2011 Anders Brander <anders@brander.dk>,
* * Anders Kvist <akv@lnxbx.dk> and Klaus Post <klauspost@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef fftdenoiseryuv_h__
#define fftdenoiseryuv_h__
#include "fftdenoiser.h"
namespace RawStudio {
namespace FFTFilter {
class FFTDenoiserYUV :
public FFTDenoiser
{
public:
FFTDenoiserYUV();
virtual ~FFTDenoiserYUV(void);
virtual void denoiseImage(RS_IMAGE16* image);
virtual void setParameters( FFTDenoiseInfo *info);
float betaChroma;
float sigmaLuma;
float sigmaChroma;
float sharpenChroma;
float sharpenCutoffChroma;
float sharpenMinSigmaChroma;
float sharpenMaxSigmaChroma;
float redCorrection;
float blueCorrection;
};
}} // namespace RawStudio::FFTFilter
#endif // fftdenoiseryuv_h__
|
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2010,2011,2012 TELEMATICS LAB, Politecnico di Bari
*
* This file is part of LTE-Sim
*
* LTE-Sim is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation;
*
* LTE-Sim 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 LTE-Sim; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Giuseppe Piro <g.piro@poliba.it>
*/
#ifndef AMSTATEVARIABLES_H_
#define AMSTATEVARIABLES_H_
/*
* This class implements all variables, constants and timers for the AM RLC
* see 3GPP TS 36.322 V9.3.0 (2010-09)
*/
class AmStateVariables {
public:
AmStateVariables();
virtual ~AmStateVariables();
void Print (void);
void PrintTxVariables (void);
void PrintRxVariables (void);
/*
* The transmitting side of each AM RLC entity
* shall maintain the following state variables:
*/
int m_vt_a;
int m_vt_ms;
int m_vt_s;
int m_poll_sn;
/*
* The transmitting side of each AM RLC entity
* shall maintain the following counters
*/
int m_pdu_without_poll_counter;
int m_byte_without_poll_counter;
int m_retx_counter;
/*
* The receiving side of each AM RLC entity
* shall maintain the following state variables
*/
int m_vr_r;
int m_vr_mr;
int m_vr_x;
int m_vr_ms;
int m_vr_h;
/*
* constants
*/
int m_am_window_size;
/*
* timers
*/
double m_t_poll_retransmit;
double m_t_reordering;
double m_t_status_prohibit;
/*
* Configurable parameters
*/
int m_max_retx_threshold;
int m_poll_PDU;
int m_poll_Byte;
};
#endif /* AMSTATEVARIABLES_H_ */
|
/**
******************************************************************************
*
* @file main.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
* @brief
* @see The GNU Public License (GPL) Version 3
* @defgroup
* @{
*
*****************************************************************************/
/*
* 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, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MAIN_H
#define MAIN_H
#include "myinterfaces.h"
#include "ui_main.h"
#include <aggregate.h>
#include <QtGui/QWidget>
class MyMain : public QWidget
{
Q_OBJECT
public:
MyMain(QWidget *parent = 0, Qt::WFlags flags = 0);
~MyMain();
void add(IComboEntry *obj);
private slots:
void select(int index);
private:
Ui::mainClass ui;
QList<IComboEntry *> m_entries;
};
#endif // MAIN_H
|
/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stdlib.h>
#include "pthreadP.h"
#include <atomic.h>
#include <shlib-compat.h>
#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2)
int
__pthread_cond_wait_2_0 (pthread_cond_2_0_t *cond, pthread_mutex_t *mutex)
{
if (cond->cond == NULL)
{
pthread_cond_t *newcond;
#if LLL_LOCK_INITIALIZER == 0
newcond = (pthread_cond_t *) calloc (sizeof (pthread_cond_t), 1);
if (newcond == NULL)
return ENOMEM;
#else
newcond = (pthread_cond_t *) malloc (sizeof (pthread_cond_t));
if (newcond == NULL)
return ENOMEM;
/* Initialize the condvar. */
(void) pthread_cond_init (newcond, NULL);
#endif
if (atomic_compare_and_exchange_bool_acq (&cond->cond, newcond, NULL))
/* Somebody else just initialized the condvar. */
free (newcond);
}
return __pthread_cond_wait (cond->cond, mutex);
}
compat_symbol (libpthread, __pthread_cond_wait_2_0, pthread_cond_wait,
GLIBC_2_0);
#endif
|
/*
* Copyright 2013 Sveriges Television AB http://casparcg.com/
*
* This file is part of CasparCG (www.casparcg.com).
*
* CasparCG 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.
*
* CasparCG 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 CasparCG. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Helge Norberg, helge.norberg@svt.se
*/
#pragma once
#include <string>
#include <cstdint>
#include <vector>
#include "memory.h"
#include <tbb/atomic.h>
#include <boost/thread/thread.hpp>
namespace caspar {
struct thread_info
{
std::string name;
std::int64_t native_id;
thread_info();
};
thread_info& get_thread_info();
std::vector<spl::shared_ptr<thread_info>> get_thread_infos();
}
|
/* Copyright 2015-2016, Eric Pernia.
* All rights reserved.
*
* This file is part sAPI library for microcontrollers.
*
* 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.
*
*/
/* Date: 2015-09-23 */
/*==================[inclusions]=============================================*/
#include "sapi_board.h"
#include "sapi_tick.h"
#include "sapi_gpio.h"
/*==================[macros and definitions]=================================*/
/*==================[internal data declaration]==============================*/
/*==================[internal functions declaration]=========================*/
/*==================[internal data definition]===============================*/
/*==================[external data definition]===============================*/
/*==================[internal functions definition]==========================*/
/*==================[external functions definition]==========================*/
/* Set up and initialize board hardware */
void boardConfig(void) {
/* Read clock settings and update SystemCoreClock variable */
SystemCoreClockUpdate();
Board_Init(); // From Board module (modules/lpc4337_m4/board)
/* Inicializar el conteo de Ticks con resolución de 1ms, sin tickHook */
tickConfig( 1, 0 );
/* Inicializar GPIOs */
gpioConfig( 0, GPIO_ENABLE );
/* Configuración de pines de entrada para Teclas de la EDU-CIAA-NXP */
gpioConfig( TEC1, GPIO_INPUT );
gpioConfig( TEC2, GPIO_INPUT );
gpioConfig( TEC3, GPIO_INPUT );
gpioConfig( TEC4, GPIO_INPUT );
/* Configuración de pines de salida para Leds de la EDU-CIAA-NXP */
gpioConfig( LEDR, GPIO_OUTPUT );
gpioConfig( LEDG, GPIO_OUTPUT );
gpioConfig( LEDB, GPIO_OUTPUT );
gpioConfig( LED1, GPIO_OUTPUT );
gpioConfig( LED2, GPIO_OUTPUT );
gpioConfig( LED3, GPIO_OUTPUT );
/* Configuración de pines de entrada de la CIAA-NXP */
gpioConfig( DI0, GPIO_INPUT );
gpioConfig( DI1, GPIO_INPUT );
gpioConfig( DI2, GPIO_INPUT );
gpioConfig( DI3, GPIO_INPUT );
gpioConfig( DI4, GPIO_INPUT );
gpioConfig( DI5, GPIO_INPUT );
gpioConfig( DI6, GPIO_INPUT );
gpioConfig( DI7, GPIO_INPUT );
/* Configuración de pines de salida de la CIAA-NXP */
gpioConfig( DO0, GPIO_OUTPUT );
gpioConfig( DO1, GPIO_OUTPUT );
gpioConfig( DO2, GPIO_OUTPUT );
gpioConfig( DO3, GPIO_OUTPUT );
gpioConfig( DO4, GPIO_OUTPUT );
gpioConfig( DO5, GPIO_OUTPUT );
gpioConfig( DO6, GPIO_OUTPUT );
gpioConfig( DO7, GPIO_OUTPUT );
}
/*==================[end of file]============================================*/
|
/*
This file is part of the WebKit open source project.
This file has been generated by generate-bindings.pl. DO NOT MODIFY!
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef JSHTMLHeadingElement_h
#define JSHTMLHeadingElement_h
#include "JSHTMLElement.h"
namespace WebCore {
class HTMLHeadingElement;
class JSHTMLHeadingElement : public JSHTMLElement {
typedef JSHTMLElement Base;
public:
JSHTMLHeadingElement(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<HTMLHeadingElement>);
static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
static const JSC::ClassInfo s_info;
static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
{
return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
}
static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
protected:
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
};
class JSHTMLHeadingElementPrototype : public JSC::JSObject {
typedef JSC::JSObject Base;
public:
static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
static const JSC::ClassInfo s_info;
static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
{
return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
}
JSHTMLHeadingElementPrototype(NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObject(structure) { }
protected:
static const unsigned StructureFlags = Base::StructureFlags;
};
// Attributes
JSC::JSValue jsHTMLHeadingElementAlign(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSHTMLHeadingElementAlign(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsHTMLHeadingElementConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
} // namespace WebCore
#endif
|
/*
* Copyright (C) 2018 Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup cpu_esp32
* @{
*
* @file
* @brief Implementation of required system calls
*
* @author Gunar Schorcht <gunar@schorcht.net>
*
* @}
*/
#ifndef SYSCALLS_H
#define SYSCALLS_H
#include "syscalls_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/** Time since boot in us (64bit version) */
int64_t system_get_time_64 (void);
/** initialize system watchdog timer and start it */
void system_wdt_init (void);
/** start the initialized system watchdog timer */
void system_wdt_start (void);
/** start the running system watchdog timer */
void system_wdt_stop (void);
/** reset the system watchdog timer */
void system_wdt_feed (void);
#ifdef __cplusplus
}
#endif
#endif /* SYSCALLS_H */
|
/*-
* Copyright (c) 1994, Garrett Wollman
*
* 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 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 REGENTS 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.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] = "$Id: getnetnamadr.c,v 1.1.1.1 2003/11/19 01:51:28 kyu3 Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <paths.h>
#include <string.h>
#include "Socklib_internals.h"
enum service_type {
SERVICE_NONE = 0,
SERVICE_BIND,
SERVICE_TABLE,
SERVICE_NIS };
#define SERVICE_MAX SERVICE_NIS
static struct {
const char *name;
enum service_type type;
} service_names[] = {
{ "hosts", SERVICE_TABLE },
{ _PATH_HOSTS, SERVICE_TABLE },
{ "hosttable", SERVICE_TABLE },
{ "htable", SERVICE_TABLE },
{ "bind", SERVICE_BIND },
{ "dns", SERVICE_BIND },
{ "domain", SERVICE_BIND },
{ "yp", SERVICE_NIS },
{ "yellowpages", SERVICE_NIS },
{ "nis", SERVICE_NIS },
{ 0, SERVICE_NONE }
};
static enum service_type service_order[SERVICE_MAX + 1];
static int service_done = 0;
static enum service_type
get_service_name(const char *name) {
int i;
for(i = 0; service_names[i].type != SERVICE_NONE; i++) {
if(!strcasecmp(name, service_names[i].name)) {
return service_names[i].type;
}
}
return SERVICE_NONE;
}
static void
init_services()
{
char *cp, *p, buf[BUFSIZ];
register int cc = 0;
FILE *fd;
if ((fd = (FILE *)fopen(_PATH_NETCONF, "r")) == NULL) {
/* make some assumptions */
service_order[0] = SERVICE_TABLE;
service_order[1] = SERVICE_NONE;
} else {
while (fgets(buf, BUFSIZ, fd) != NULL && cc < SERVICE_MAX) {
if(buf[0] == '#')
continue;
p = buf;
while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
;
if (cp == NULL)
continue;
do {
if (isalpha(cp[0])) {
service_order[cc] = get_service_name(cp);
if(service_order[cc] != SERVICE_NONE)
cc++;
}
while ((cp = strsep(&p, "\n \t,:;")) != NULL && *cp == '\0')
;
} while(cp != NULL && cc < SERVICE_MAX);
}
service_order[cc] = SERVICE_NONE;
fclose(fd);
}
service_done = 1;
}
struct netent *
getnetbyname(const char *name)
{
struct netent *hp = 0;
int nserv = 0;
if (!service_done)
init_services();
while (!hp) {
switch (service_order[nserv]) {
case SERVICE_NONE:
return NULL;
case SERVICE_TABLE:
hp = _getnetbyhtname(name);
break;
case SERVICE_BIND:
hp = _getnetbydnsname(name);
break;
case SERVICE_NIS:
hp = _getnetbynisname(name);
break;
}
nserv++;
}
return hp;
}
struct netent *
getnetbyaddr(uint32_t addr, int af)
{
struct netent *hp = 0;
int nserv = 0;
if (!service_done)
init_services();
while (!hp) {
switch (service_order[nserv]) {
case SERVICE_NONE:
return 0;
case SERVICE_TABLE:
hp = _getnetbyhtaddr(addr, af);
break;
case SERVICE_BIND:
hp = _getnetbydnsaddr(addr, af);
break;
case SERVICE_NIS:
hp = _getnetbynisaddr(addr, af);
break;
}
nserv++;
}
return hp;
}
void
setnetent(int stayopen)
{
_setnethtent(stayopen);
_setnetdnsent(stayopen);
}
void
endnetent()
{
_endnethtent();
_endnetdnsent();
}
|
/* Copyright (c) 2016 PaddlePaddle 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. */
#pragma once
#include "paddle/fluid/framework/eigen.h"
#include "paddle/fluid/framework/tensor.h"
#include "paddle/fluid/platform/hostdevice.h"
namespace paddle {
namespace operators {
namespace math {
template <typename T>
struct TolerableValue {
HOSTDEVICE T operator()(const T& x) const {
PADDLE_ASSERT(std::is_floating_point<T>::value);
const T kApproInf = 1e20;
if (x == INFINITY) return kApproInf;
if (x == -INFINITY) return -kApproInf;
return x;
}
};
template <typename DeviceContext, typename T>
class CrossEntropyFunctor {
public:
void operator()(const DeviceContext& context, framework::Tensor* out,
const framework::Tensor* prob,
const framework::Tensor* labels, const bool softLabel);
};
} // namespace math
} // namespace operators
} // namespace paddle
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef AXUTIL_CONFIG_H
#define AXUTIL_CONFIG_H
/* undef unwated cnfig macros to avoid conflicts with APR macros */
#undef PACKAGE
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef VERSION
#include <config.h>
/* undef unwated cnfig macros to avoid conflicts with APR macros */
#undef PACKAGE
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef VERSION
#endif /* AXIS2_UTILS_H */
|
//
// Created by ShareSDK.cn on 13-1-14.
// 官网地址:http://www.ShareSDK.cn
// 技术支持邮箱:support@sharesdk.cn
// 官方微信:ShareSDK (如果发布新版本的话,我们将会第一时间通过微信将版本更新内容推送给您。如果使用过程中有任何问题,也可以通过微信与我们取得联系,我们将会在24小时内给予回复)
// 商务QQ:4006852216
// Copyright (c) 2013年 ShareSDK.cn. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ISSCParameters.h"
/**
* @brief OAuth参数
*/
@protocol ISSCOAuthParameters <ISSCParameters>
/**
* @brief 获取消费者Key
*
* @return 消费者Key
*/
- (NSString *)consumerKey;
/**
* @brief 获取消费者密钥
*
* @return 消费者密钥
*/
- (NSString *)consumerSecret;
/**
* @brief 获取OAuthToken
*
* @return OAuthToken
*/
- (NSString *)oauthToken;
/**
* @brief 获取OAuth密钥
*
* @return OAuth密钥
*/
- (NSString *)oauthSecret;
/**
* @brief 添加OAuth参数,仅用于OAuth1.0版本
*
* @param name 参数名称
* @param value 参数值
*/
- (void)addOAuthParameter:(NSString *)name value:(id)value;
/**
* @brief 添加多个参数
*
* @param parameters 参数对象
*/
- (void)addOAuthParameters:(id<ISSCOAuthParameters>)parameters;
/**
* @brief 添加多个参数
*
* @param dictionary 参数字典
*/
- (void)addOAuthParametersWithDictionary:(NSDictionary *)dictionary;
/**
* @brief 获取OAuth参数值,仅用于OAuth1.0版本
*
* @param name 参数名称
*
* @return 参数值
*/
- (id)oauthParameterWithName:(NSString *)name;
/**
* @brief 获取OAuth参数数量,仅用于OAuth1.0版本
*
* @return 参数数量
*/
- (NSInteger)oauthParameterCount;
/**
* @brief 获取OAuth字典结构数据
*
* @return 字典数据
*/
- (NSDictionary *)oauthDictionaryValue;
@end
|
/*
* Copyright © 2012-2015 VMware, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the “License”); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an “AS IS” BASIS, without
* warranties or conditions of any kind, EITHER EXPRESS OR IMPLIED. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#include "includes.h"
VMAF_CFG_API_GLOBALS gVmAfCfgApiGlobals = {0};
PVMAF_CFG_API_GLOBALS gpVmAfCfgApiGlobals = &gVmAfCfgApiGlobals;
|
/* 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.
==============================================================================*/
// This is a standard TensorFlow Lite model file that has been converted into a
// C data array, so it can be easily compiled into a binary for devices that
// don't have a file system. It was created using the command:
// xxd -i sine_model.tflite > sine_model_data.cc
#ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_HELLO_WORLD_SINE_MODEL_DATA_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_HELLO_WORLD_SINE_MODEL_DATA_H_
extern const unsigned char g_sine_model_data[];
extern const int g_sine_model_data_len;
#endif // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_HELLO_WORLD_SINE_MODEL_DATA_H_
|
//**************************************************************************/
// Copyright (c) 1998-2005 Autodesk, Inc.
// All rights reserved.
//
// These coded instructions, statements, and computer programs contain
// unpublished proprietary information written by Autodesk, Inc., and are
// protected by Federal copyright law. They may not be disclosed to third
// parties or copied or duplicated in any form, in whole or in part, without
// the prior written consent of Autodesk, Inc.
//**************************************************************************/
// DESCRIPTION: Include this file before including any 3ds Max SDK files. It
// define the macros required to add linkable todo compile-time
// messages and lower the warning level to 3.
// AUTHOR: Jean-Francois Yelle - created Mar.20.2007
//***************************************************************************/
// useful for #pragma message
#define STRING2(x) #x
#define STRING(x) STRING2(x)
#define TODO(x) __FILE__ "(" STRING(__LINE__) "): TODO: "x
|
/*++
Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DeviceIo.c
Abstract:
Device IO protocol as defined in the EFI 1.0 specification.
Device IO is used to abstract hardware access to devices. It includes
memory mapped IO, IO, PCI Config space, and DMA.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (DeviceIo)
EFI_GUID gEfiDeviceIoProtocolGuid = EFI_DEVICE_IO_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiDeviceIoProtocolGuid, "DeviceIo Protocol", "EFI 1.0 Device IO Protocol");
|
//===-- ThreadMachCore.h ----------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_ThreadMachCore_h_
#define liblldb_ThreadMachCore_h_
#include <string>
#include "lldb/Target/Thread.h"
class ProcessMachCore;
class ThreadMachCore : public lldb_private::Thread {
public:
ThreadMachCore(lldb_private::Process &process, lldb::tid_t tid);
~ThreadMachCore() override;
void RefreshStateAfterStop() override;
const char *GetName() override;
lldb::RegisterContextSP GetRegisterContext() override;
lldb::RegisterContextSP
CreateRegisterContextForFrame(lldb_private::StackFrame *frame) override;
static bool ThreadIDIsValid(lldb::tid_t thread);
bool ShouldStop(bool &step_more);
const char *GetBasicInfoAsString();
void SetName(const char *name) override {
if (name && name[0])
m_thread_name.assign(name);
else
m_thread_name.clear();
}
lldb::addr_t GetThreadDispatchQAddr() { return m_thread_dispatch_qaddr; }
void SetThreadDispatchQAddr(lldb::addr_t thread_dispatch_qaddr) {
m_thread_dispatch_qaddr = thread_dispatch_qaddr;
}
protected:
friend class ProcessMachCore;
// Member variables.
std::string m_thread_name;
std::string m_dispatch_queue_name;
lldb::addr_t m_thread_dispatch_qaddr;
lldb::RegisterContextSP m_thread_reg_ctx_sp;
// Protected member functions.
bool CalculateStopInfo() override;
};
#endif // liblldb_ThreadMachCore_h_
|
/*
* Copyright (c) 2011-2019, Pelion and affiliates.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* \file sn_coap_builder.c
*
* \brief CoAP Message builder
*
* Functionality: Builds CoAP message
*
*/
/* * * * * * * * * * * * * * */
/* * * * INCLUDE FILES * * * */
/* * * * * * * * * * * * * * */
#include "ns_types.h"
#include "sn_coap_header.h"
#include "sn_coap_builder_stub.h"
sn_coap_builder_stub_def sn_coap_builder_stub;
sn_coap_hdr_s *sn_coap_build_response(struct coap_s *handle, const sn_coap_hdr_s *coap_packet_ptr, uint8_t msg_code)
{
return sn_coap_builder_stub.expectedHeader;
}
int16_t sn_coap_builder(uint8_t *dst_packet_data_ptr, const sn_coap_hdr_s *src_coap_msg_ptr)
{
return sn_coap_builder_stub.expectedInt16;
}
uint16_t sn_coap_builder_calc_needed_packet_data_size(const sn_coap_hdr_s *src_coap_msg_ptr)
{
return sn_coap_builder_stub.expectedUint16;
}
uint16_t sn_coap_builder_calc_needed_packet_data_size_2(const sn_coap_hdr_s *src_coap_msg_ptr, uint16_t blockwise_payload_size)
{
return sn_coap_builder_stub.expectedUint16;
}
int16_t sn_coap_builder_options_build_add_zero_length_option(uint8_t **dst_packet_data_pptr, uint8_t option_length, uint8_t option_exist, sn_coap_option_numbers_e option_number)
{
return sn_coap_builder_stub.expectedInt16;
}
|
/* -*-C++-*-
****************************************************************************
*
* File: ComTdbCommon.h
* Description:
*
* Created: 5/6/98
* Language: C++
*
*
// @@@ START COPYRIGHT @@@
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
// @@@ END COPYRIGHT @@@
*
*
****************************************************************************
*/
#ifndef COMTDBCOMMON_H
#define COMTDBCOMMON_H
// --------------------------------------------------------------------------
// This header file includes the common header files needed by the generator
// implementations of all TDB subclasses.
// --------------------------------------------------------------------------
// These headers are needed in all implementations of TDB::pack().
#include "exp_stdh.h" // rewrite PACK_CRI_DESC() to ex_cri_desc->pack()
#include "ExpCriDesc.h" // for ex_cri_desc->pack()
#endif
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
@class IDENavigableItem, NSArray, NSImage, NSString;
@interface IDEGeniusResultsGraphNode : NSObject
{
int _type;
NSString *_identifier;
NSImage *_image;
NSString *_name;
NSArray *_subitems;
NSString *_manualDomainIdentifier;
IDENavigableItem *_manualDomainRootNavigableItem;
id <DVTObservingToken> _manualDomainRootChildItemsObservingToken;
}
+ (id)_rootNodeForGeniusResults:(id)arg1 editorContext:(id)arg2 includeJumpToCounterpartCategory:(BOOL)arg3 includeManualCategory:(BOOL)arg4;
+ (id)_rootNodeForGeniusResultsWithJumpToCounterpartCategory:(id)arg1;
+ (id)_rootNodeForGeniusResultsWithManualCategory:(id)arg1 editorContext:(id)arg2;
- (id)description;
- (id)ideModelObjectTypeIdentifier;
@property(copy) NSString *identifier; // @synthesize identifier=_identifier;
@property(copy) NSImage *image; // @synthesize image=_image;
- (id)initWithType:(int)arg1 identifier:(id)arg2 image:(id)arg3 name:(id)arg4 subitems:(id)arg5;
@property(readonly) NSString *manualDomainIdentifier; // @synthesize manualDomainIdentifier=_manualDomainIdentifier;
@property(readonly) IDENavigableItem *manualDomainRootNavigableItem; // @synthesize manualDomainRootNavigableItem=_manualDomainRootNavigableItem;
@property(copy) NSString *name; // @synthesize name=_name;
- (id)nameWithSubitemCount;
- (id)navigableItem_contentDocumentLocation;
- (id)navigableItem_documentType;
- (id)navigableItem_fileReference;
- (id)navigableItem_identifierForRepresentedObjectAtIndex:(unsigned long long)arg1 inRelationshipKeyPath:(id)arg2;
- (id)navigableItem_image;
- (unsigned long long)navigableItem_indexOfRepresentedObjectForIdentifier:(id)arg1 inRelationshipKeyPath:(id)arg2;
- (id)navigableItem_name;
- (void)setChildrenToURL:(id)arg1;
- (void)setManualDomainIdentifier:(id)arg1 rootNavigableItem:(id)arg2;
@property(copy) NSArray *subitems; // @synthesize subitems=_subitems;
@property int type; // @synthesize type=_type;
@end
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_H_
#define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_H_
#include <list>
#include <string>
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/sequenced_task_runner_helpers.h"
#include "storage/common/quota/quota_types.h"
class BrowsingDataQuotaHelper;
class Profile;
struct BrowsingDataQuotaHelperDeleter {
static void Destruct(const BrowsingDataQuotaHelper* helper);
};
// This class is an interface class to bridge between Cookies Tree and Unified
// Quota System. This class provides a way to get usage and quota information
// through the instance.
//
// Call Create to create an instance for a profile and call StartFetching with
// a callback to fetch information asynchronously.
//
// Parallel fetching is not allowed, a fetching task should start after end of
// previous task. All method of this class should called from UI thread.
class BrowsingDataQuotaHelper
: public base::RefCountedThreadSafe<BrowsingDataQuotaHelper,
BrowsingDataQuotaHelperDeleter> {
public:
// QuotaInfo contains host-based quota and usage information for persistent
// and temporary storage.
struct QuotaInfo {
QuotaInfo();
explicit QuotaInfo(const std::string& host);
QuotaInfo(const std::string& host,
int64 temporary_usage,
int64 persistent_usage,
int64 syncable_usage);
~QuotaInfo();
// Certain versions of MSVC 2008 have bad implementations of ADL for nested
// classes so they require these operators to be declared here instead of in
// the global namespace.
bool operator <(const QuotaInfo& rhs) const;
bool operator ==(const QuotaInfo& rhs) const;
std::string host;
int64 temporary_usage = 0;
int64 persistent_usage = 0;
int64 syncable_usage = 0;
};
typedef std::list<QuotaInfo> QuotaInfoArray;
typedef base::Callback<void(const QuotaInfoArray&)> FetchResultCallback;
static BrowsingDataQuotaHelper* Create(Profile* profile);
virtual void StartFetching(const FetchResultCallback& callback) = 0;
virtual void RevokeHostQuota(const std::string& host) = 0;
protected:
BrowsingDataQuotaHelper();
virtual ~BrowsingDataQuotaHelper();
private:
friend class base::DeleteHelper<BrowsingDataQuotaHelper>;
friend struct BrowsingDataQuotaHelperDeleter;
DISALLOW_COPY_AND_ASSIGN(BrowsingDataQuotaHelper);
};
#endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_QUOTA_HELPER_H_
|
/*
* Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef HTMLDetailsElement_h
#define HTMLDetailsElement_h
#include "core/html/HTMLElement.h"
namespace blink {
template<typename T> class EventSender;
using DetailsEventSender = EventSender<HTMLDetailsElement>;
class HTMLDetailsElement final : public HTMLElement {
DEFINE_WRAPPERTYPEINFO();
public:
static HTMLDetailsElement* create(Document&);
void toggleOpen();
~HTMLDetailsElement() override;
void dispatchPendingEvent(DetailsEventSender*);
Element* findMainSummary() const;
private:
explicit HTMLDetailsElement(Document&);
LayoutObject* createLayoutObject(const ComputedStyle&) override;
void parseAttribute(const QualifiedName&, const AtomicString&, const AtomicString&) override;
void didAddUserAgentShadowRoot(ShadowRoot&) override;
bool isInteractiveContent() const override;
bool m_isOpen;
};
} // namespace blink
#endif // HTMLDetailsElement_h
|
#if !defined(AFX_ACCESSCTRL_H__E1A33187_E678_43E1_B703_7B3C3436D28F__INCLUDED_)
#define AFX_ACCESSCTRL_H__E1A33187_E678_43E1_B703_7B3C3436D28F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// AccessCtrl.h : header file
//
#include "InquisitorDoc.h"
/////////////////////////////////////////////////////////////////////////////
// CAccessCtrl dialog
class CAccessCtrl : public CDialog
{
// Construction
public:
CAccessCtrl(CInquisitorDoc* doc, WINI::INode* node, CWnd* pParent = NULL);
CWnd* m_pParent;
// Dialog Data
//{{AFX_DATA(CAccessCtrl)
enum { IDD = IDD_ACCESS_CTRL };
CButton m_OK;
CButton m_Recursive;
CListBox m_ListBox;
CComboBox m_AccessConstraint;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAccessCtrl)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
void Update();
protected:
// Generated message map functions
//{{AFX_MSG(CAccessCtrl)
afx_msg void OnAccessCtrlAdd();
afx_msg void OnAccessCtrlRemove();
virtual void OnOK();
afx_msg void OnSelchangeAccessCtrlConstraint();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
bool m_isUser;
CInquisitorDoc* m_doc;
WINI::IStringNode* m_constraints;
WINI::INode* m_node;
std::vector<int> m_nRedirector;
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ACCESSCTRL_H__E1A33187_E678_43E1_B703_7B3C3436D28F__INCLUDED_)
|
#include <stdlib.h>
#include <string.h>
#include "cpp.h"
extern int getopt(int, char *const *, const char *);
extern char *optarg;
extern int optind;
extern int verbose;
extern int Cplusplus;
Nlist *kwdefined;
#define NLSIZE 128
static Nlist *nlist[NLSIZE];
struct kwtab {
char *kw;
int val;
int flag;
} kwtab[] = {
{ "if", KIF, ISKW },
{ "ifdef", KIFDEF, ISKW },
{ "ifndef", KIFNDEF, ISKW },
{ "elif", KELIF, ISKW },
{ "else", KELSE, ISKW },
{ "endif", KENDIF, ISKW },
{ "include", KINCLUDE, ISKW },
{ "define", KDEFINE, ISKW },
{ "undef", KUNDEF, ISKW },
{ "line", KLINE, ISKW },
{ "error", KERROR, ISKW },
{ "pragma", KPRAGMA, ISKW },
{ "eval", KEVAL, ISKW },
{ "defined", KDEFINED, ISDEFINED+ISUNCHANGE },
{ "ident", KPRAGMA, ISKW }, /* treat like pragma (ignored) */
{ "__LINE__", KLINENO, ISMAC+ISUNCHANGE },
{ "__FILE__", KFILE, ISMAC+ISUNCHANGE },
{ "__DATE__", KDATE, ISMAC+ISUNCHANGE },
{ "__TIME__", KTIME, ISMAC+ISUNCHANGE },
{ "__STDC__", KSTDC, ISUNCHANGE },
{ NULL },
};
unsigned long namebit[077+1];
Nlist *np;
void
setup_kwtab(void)
{
struct kwtab *kp;
Nlist *np;
Token t;
static Token deftoken[1] = {{ NAME, 0, 0, 0, 7, (uchar*)"defined" }};
static Tokenrow deftr = { deftoken, deftoken, deftoken+1, 1 };
for (kp=kwtab; kp->kw; kp++) {
t.t = (uchar*)kp->kw;
t.len = strlen(kp->kw);
np = lookup(&t, 1);
np->flag = kp->flag;
np->val = kp->val;
if (np->val == KDEFINED) {
kwdefined = np;
np->val = NAME;
np->vp = &deftr;
np->ap = 0;
}
}
}
Nlist *
lookup(Token *tp, int install)
{
unsigned int h;
Nlist *np;
uchar *cp, *cpe;
h = 0;
for (cp=tp->t, cpe=cp+tp->len; cp<cpe; )
h += *cp++;
h %= NLSIZE;
np = nlist[h];
while (np) {
if (*tp->t==*np->name && tp->len==np->len
&& strncmp((char*)tp->t, (char*)np->name, tp->len)==0)
return np;
np = np->next;
}
if (install) {
np = new(Nlist);
np->vp = NULL;
np->ap = NULL;
np->flag = 0;
np->val = 0;
np->len = tp->len;
np->name = newstring(tp->t, tp->len, 0);
np->next = nlist[h];
nlist[h] = np;
quickset(tp->t[0], tp->len>1? tp->t[1]:0);
return np;
}
return NULL;
}
|
#include "../../src/corelib/io/qurl.h"
|
/* Generated automatically. DO NOT EDIT! */
#define SIMD_HEADER "simd-support/simd-altivec.h"
#include "../common/n2fv_8.c"
|
/*
DO NOT EDIT THIS FILE!
it has been automaticaly created by php7/scripts/credits from
the information found in the various php7/ext/.../CREDITS and
php7/sapi/.../CREDITS files
if you want to change an entry you have to edit the appropriate
CREDITS file instead
*/
CREDIT_LINE("Apache 2.0 Handler", "Ian Holsman, Justin Erenkrantz (based on Apache 2.0 Filter code)");
CREDIT_LINE("CGI / FastCGI", "Rasmus Lerdorf, Stig Bakken, Shane Caraveo, Dmitry Stogov");
CREDIT_LINE("CLI", "Edin Kadribasic, Marcus Boerger, Johannes Schlueter, Moriyoshi Koizumi, Xinchen Hui");
CREDIT_LINE("Embed", "Edin Kadribasic");
CREDIT_LINE("FastCGI Process Manager", "Andrei Nigmatulin, dreamcat4, Antony Dovgal, Jerome Loyet");
CREDIT_LINE("litespeed", "George Wang");
CREDIT_LINE("phpdbg", "Felipe Pena, Joe Watkins, Bob Weinand");
|
/*
* Copyright 2010-2013 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.
*/
/**
* Ebs
*/
@interface AutoScalingEbs:NSObject
{
NSString *snapshotId;
NSNumber *volumeSize;
}
/**
* Default constructor for a new object. Callers should use the
* property methods to initialize this object after creating it.
*/
-(id)init;
/**
* The snapshot ID.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 255<br/>
* <b>Pattern: </b>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*<br/>
*/
@property (nonatomic, retain) NSString *snapshotId;
/**
* The volume size, in gigabytes.
* <p>
* <b>Constraints:</b><br/>
* <b>Range: </b>1 - 1024<br/>
*/
@property (nonatomic, retain) NSNumber *volumeSize;
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*/
-(NSString *)description;
@end
|
//
// TDSingleLineCommentState.h
// TDParseKit
//
// Created by Todd Ditchendorf on 12/28/08.
// Copyright 2008 Todd Ditchendorf. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "TDTokenizerState.h"
@interface TDSingleLineCommentState : TDTokenizerState {
NSMutableArray *startSymbols;
NSString *currentStartSymbol;
}
@end
|
/* Generated automatically. DO NOT EDIT! */
#define SIMD_HEADER "simd-support/simd-neon.h"
#include "../common/t2bv_32.c"
|
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrRectanizer_DEFINED
#define GrRectanizer_DEFINED
#include "GrRect.h"
#include "GrTDArray.h"
class GrRectanizerPurgeListener {
public:
virtual ~GrRectanizerPurgeListener() {}
virtual void notifyPurgeStrip(void*, int yCoord) = 0;
};
class GrRectanizer {
public:
GrRectanizer(int width, int height) : fWidth(width), fHeight(height) {
GrAssert(width >= 0);
GrAssert(height >= 0);
}
virtual ~GrRectanizer() {}
int width() const { return fWidth; }
int height() const { return fHeight; }
virtual bool addRect(int width, int height, GrIPoint16* loc) = 0;
virtual float percentFull() const = 0;
// return the Y-coordinate of a strip that should be purged, given height
// i.e. return the oldest such strip, or some other criteria. Return -1
// if there is no candidate
virtual int stripToPurge(int height) const = 0;
virtual void purgeStripAtY(int yCoord) = 0;
/**
* Our factory, which returns the subclass du jour
*/
static GrRectanizer* Factory(int width, int height);
private:
int fWidth;
int fHeight;
};
#endif
|
/**********************************************************************
Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
***********************************************************************/
#ifndef FC__GUI_MAIN_H
#define FC__GUI_MAIN_H
void popup_quit_dialog();
#endif /* FC__GUI_MAIN_H */
|
#ifndef CHAIN_DEMO_H
#define CHAIN_DEMO_H
#include "LinearMath/btVector3.h"
#include "Bullet3AppSupport/Bullet2RigidBodyDemo.h"
class ChainDemo : public Bullet2RigidBodyDemo
{
public:
static BulletDemoInterface* MyCreateFunc(CommonGraphicsApp* app)
{
return new ChainDemo(app);
}
ChainDemo(CommonGraphicsApp* app);
virtual ~ChainDemo();
void createGround(int cubeShapeId);
virtual void initPhysics();
virtual void exitPhysics();
virtual void renderScene();
virtual void stepSimulation(float dt);
};
#endif //CHAIN_DEMO_H
|
//# Utilities.h: Bag of unrelated classes and groups for general use.
//# Copyright (C) 1995,1996,1997,2000,2001
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
//# $Id$
#ifndef CASA_UTILITIES_H
#define CASA_UTILITIES_H
#include <casacore/casa/aips.h>
#include <casacore/casa/Utilities/Assert.h>
#include <casacore/casa/Utilities/BinarySearch.h>
#include <casacore/casa/Utilities/BitVector.h>
#include <casacore/casa/Utilities/Compare.h>
#include <casacore/casa/Utilities/Copy.h>
#include <casacore/casa/Utilities/CountedPtr.h>
#include <casacore/casa/Utilities/DataType.h>
#include <casacore/casa/Utilities/DynBuffer.h>
#include <casacore/casa/Utilities/Fallible.h>
#include <casacore/casa/Utilities/GenSort.h>
#include <casacore/casa/Utilities/Notice.h>
#include <casacore/casa/Utilities/PtrHolder.h>
#include <casacore/casa/Utilities/RegSequence.h>
#include <casacore/casa/Utilities/Regex.h>
#include <casacore/casa/Utilities/Register.h>
#include <casacore/casa/Utilities/Sequence.h>
#include <casacore/casa/Utilities/Sort.h>
#include <casacore/casa/Utilities/SortError.h>
#include <casacore/casa/BasicSL/String.h>
#include <casacore/casa/Utilities/ValType.h>
#include <casacore/casa/Utilities/cregex.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
// <module>
//
// <summary> Classes and global functions for general use </summary>
// <reviewed reviewer="Friso Olnon" date="1995/03/20" demos="">
// </reviewed>
// <synopsis>
//
// This module is a bag of unrelated mini-modules, classes and
// global functions. The following functional groups can be recognized:
// <ul>
// <li> Object utilities:
// <ul>
// <li> <linkto class=ObjCompare>ObjCompare</linkto>
// objects with each other. A signature for comparison functions
// is defined (required for comparison functions used in the
// <linkto class=Sort>Sort</linkto>
// class), and one such function is provided.
// <li> <linkto group="Copy.h#copy">objcopy/objmove/objset</linkto>
// copies objects from one place to another.
// <li> <linkto class=Fallible>Mark</linkto>
// objects as valid or invalid.
// <li> <linkto class=Notice>Notices</linkto>
// provide basic support for shared access of data by various objects.
// <li> <linkto class=Sort>Sort</linkto>
// objects on one or more keys, in ascending or descending order.
// <linkto class=GenSort>Fast sorting</linkto>
// is provided for certain types of objects.
// <li> <linkto group="BinarySearch.h#binarysearch">Binary Search</linkto>
// templated functions for sorted containers (ascending or descending
// order) are available.
// <li> <linkto group="LinearSearch.h#linearsearch">Linear Search</linkto>
// templated functions for unsorted containers are available.
// </ul>
// <li> Logical utilities:
// <ul>
// <li> <linkto class=assert_>Assertion</linkto>
// lets you throw an error when a condition in not fullfilled.
// <li> <linkto class=BitVector>Bit vectors</linkto>
// are an efficient method to keep True/False information on a set of
// items or conditions.
// </ul>
// <li> Pointer utilities
// <ul>
// <li> <linkto class=CountedPtr>Counted pointers</linkto>
// provide support for reference counting.
// <li> <linkto class=PtrHolder>Pointer holders</linkto>
// can be used to hold allocated pointers which should be deleted
// when an exception is thrown.
// </ul>
// <li> Datatype utilities
// <ul>
// <li> <linkto group="DataType.h#DataType">DataType</linkto>
// enumerates the possible data types in the table system.
// <li> <linkto class=ValType>ValType</linkto>
// describes the data types and their undefined values.
// <li> <linkto group="Register.h#register">Register</linkto>
// provides runtime typing information.
// </ul>
// <li> Other utilities
// <ul>
// <li> <linkto class=DynBuffer>Dynamic buffers</linkto>
// are used to store data in dynamically allocated buffers.
// <li> <linkto class=Regex>Regular expressions</linkto>
// are supported by the class <linkto class=Regex>Regex</linkto> and
// the associated function library
// <a href="Utilities/cregex.html">cregex</a>.
// <li> <linkto class=Sequence>Sequences</linkto>
// of any datatype can be derived from the base class
// <linkto class=Sequence>Sequence</linkto>.
// One example is <linkto class=uIntSequence>uIntSequence</linkto>,
// provided for general use. Another is
// <linkto class=RegSequence>RegSequence</linkto>, exclusively used
// by the <linkto group="Register.h#register">Register</linkto> function.
// <li> <linkto class=String>Strings</linkto>.
// for the C++ preprocessor
// </ul>
// </ul>
//
// <note role=tip> You may want to look at the individual header files
// to see whether you might not prefer to include only the header
// files you really need; it may be more efficient to do so.
// </note>
//
// </synopsis>
//# <todo asof="1995/03/20">
//# <li>
//# </todo>
// </module>
} //# NAMESPACE CASACORE - END
#endif
|
/**
* $Id$
*
* Renderer test cases
*
* Copyright (c) 2006 Nathan Keynes.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <stdio.h>
#include "testdata.h"
#include "pvr.h"
#include "lib.h"
#include "asic.h"
#define OBJ_START 0x00010000
#define OBJ_LENGTH 0x00010000
#define TILE_START 0x00060000
#define TILE_LENGTH 0x00010000
#define TILEMAP_ADDR 0x050B2C8
#define RENDER_ADDR 0x00600000
struct ta_config default_ta_config = { 0x00111111, GRID_SIZE(640,480), OBJ_START,
OBJ_START+OBJ_LENGTH, TILE_START+TILE_LENGTH,
TILE_START, TILE_START+TILE_LENGTH };
struct render_config default_render_config = { OBJ_START, TILEMAP_ADDR, RENDER_ADDR, 640, 480,
0x00000009, 0.2, 1.0 };
int test_render( test_data_t test_case )
{
int i;
/* Check input */
test_data_block_t input = get_test_data(test_case, "input");
test_data_block_t event = get_test_data(test_case, "event");
test_data_block_t backplane = get_test_data(test_case, "backplane");
if( input == NULL ) {
fprintf( stderr, "Skipping test '%s' - no input\n", test_case->test_name );
return -1;
}
if( event == NULL ) {
fprintf( stderr, "Skipping test '%s' - no event list\n", test_case->test_name );
}
test_data_block_t tex = get_test_data(test_case, "textures");
if( tex != NULL ) {
uint32_t addr = 0xA4000000 + *(uint32_t *)tex->data;
memcpy( (char *)addr, tex->data+4, tex->length-4 );
fprintf( stderr, "Loaded %d bytes to %08X\n", tex->length-4, addr );
}
test_data_block_t config_data = get_test_data( test_case, "config" );
struct ta_config *config = &default_ta_config;
if( config_data != NULL ) {
if( config_data->length != sizeof(struct ta_config) ) {
fprintf( stderr, "Invalid config data length %d - aborting test %s\n",
config_data->length, test_case->test_name );
return -1;
}
config = (struct ta_config *)config_data->data;
}
/* Send TA data */
asic_clear();
pvr_init();
ta_init(config);
default_render_config.polybuf = config->obj_start & 0x00F00000;
if( pvr_dma_write( 0x10000000, input->data, input->length, 0 ) == -1 ) {
return -1;
}
/* Wait for events */
for( i=0; i<event->length; i++ ) {
if( asic_wait( event->data[i] ) == -1 ) {
fprintf( stderr, "Test %s: failed (Timeout waiting for event %d)\n",
test_case->test_name, event->data[i] );
asic_dump( stderr );
return -1;
}
}
/* Write backplane (if any) */
if( backplane != NULL ) {
uint32_t bgplane = pvr_get_objbuf_posn();
memcpy( (char *)(PVR_VRAM_BASE + bgplane), backplane->data+4, backplane->length-4 );
bgplane -= default_render_config.polybuf;
render_set_backplane( (bgplane << 1) | *(uint32_t *)backplane->data );
} else {
render_set_backplane( 0 );
}
/* Setup the tilemap */
pvr_build_tilemap1( TILEMAP_ADDR, config, 0x20000000 );
render_start( &default_render_config );
if( asic_wait( EVENT_PVR_RENDER_DONE ) == -1 ) {
fprintf( stderr, "Test %s: failed (timeout waiting for render)\n",
test_case->test_name );
asic_dump( stderr );
return -1;
}
asic_wait( EVENT_RETRACE );
display_render( &default_render_config );
return 0;
}
int main( int argc, char *argv[] )
{
int test_cases = 0;
int test_failures = 0;
test_data_t test_data = load_test_dataset(stdin);
test_data_t test_case = test_data;
asic_mask_all();
pvr_init();
while( test_case != NULL ) {
test_cases++;
int result = test_render(test_case);
if( result != 0 ) {
test_failures++;
}
test_case = test_case->next;
}
asic_clear();
asic_wait(EVENT_RETRACE);
asic_clear();
asic_wait(EVENT_RETRACE);
free_test_dataset(test_data);
if( test_failures != 0 ) {
fprintf( stderr, "%d/%d test failures!\n", test_failures, test_cases );
return 1;
} else {
fprintf( stderr, "%d tests OK\n", test_cases );
return 0;
}
}
|
/* timing machinery
* Copyright (C) 1998-2001 D. Hugh Redelmeier.
*
* 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. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* 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.
*/
extern time_t now(void); /* careful version of time(2) */
struct state; /* forward declaration */
struct event
{
time_t ev_time;
int ev_type; /* Event type */
struct state *ev_state; /* Pointer to relevant state (if any) */
struct event *ev_next; /* Pointer to next event */
};
extern void event_schedule(enum event_type type, time_t tm, struct state *st);
extern void handle_timer_event(void);
extern long next_event(void);
extern void delete_event(struct state *st);
extern void delete_dpd_event(struct state *st);
extern void daily_log_event(void);
extern void free_events(void);
extern bool init_secret(void);
|
#include "tommath.h"
#ifdef BN_MP_LSHD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
*
* LibTomMath is a library that provides multiple-precision
* integer arithmetic as well as number theoretic functionality.
*
* The library was designed directly after the MPI library by
* Michael Fromberger but has been written from scratch with
* additional optimizations in place.
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
/* shift left a certain amount of digits */
int mp_lshd (mp_int * a, int b)
{
int x, res;
/* if its less than zero return */
if (b <= 0) {
return MP_OKAY;
}
/* grow to fit the new digits */
if (a->alloc < a->used + b) {
if ((res = mp_grow (a, a->used + b)) != MP_OKAY) {
return res;
}
}
{
register mp_digit *top, *bottom;
/* increment the used by the shift amount then copy upwards */
a->used += b;
/* top */
top = a->dp + a->used - 1;
/* base */
bottom = a->dp + a->used - 1 - b;
/* much like mp_rshd this is implemented using a sliding window
* except the window goes the otherway around. Copying from
* the bottom to the top. see bn_mp_rshd.c for more info.
*/
for (x = a->used - 1; x >= b; x--) {
*top-- = *bottom--;
}
/* zero the lower digits */
top = a->dp;
for (x = 0; x < b; x++) {
*top++ = 0;
}
}
return MP_OKAY;
}
#endif
/* $Source: /cvs/libtom/libtommath/bn_mp_lshd.c, v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/12/28 01:25:13 $ */
|
// SPDX-License-Identifier: GPL-2.0+
/*
* Novena board support
*
* Copyright (C) 2014 Marek Vasut <marex@denx.de>
*/
#include <common.h>
#include <dm.h>
#include <eeprom.h>
#include <init.h>
#include <log.h>
#include <dm/device-internal.h>
#include <ahci.h>
#include <env.h>
#include <linux/errno.h>
#include <asm/gpio.h>
#include <asm/io.h>
#include <asm/arch/clock.h>
#include <asm/arch/crm_regs.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/iomux.h>
#include <asm/arch/mxc_hdmi.h>
#include <asm/arch/sys_proto.h>
#include <asm/mach-imx/boot_mode.h>
#include <asm/mach-imx/iomux-v3.h>
#include <asm/mach-imx/mxc_i2c.h>
#include <asm/mach-imx/sata.h>
#include <asm/mach-imx/video.h>
#include <dwc_ahsata.h>
#include <fsl_esdhc_imx.h>
#include <i2c.h>
#include <input.h>
#include <ipu_pixfmt.h>
#include <linux/fb.h>
#include <linux/input.h>
#include <malloc.h>
#include <mmc.h>
#include <netdev.h>
#include <power/pmic.h>
#include <power/pfuze100_pmic.h>
#include <stdio_dev.h>
#include <video_console.h>
#include "novena.h"
DECLARE_GLOBAL_DATA_PTR;
/*
* GPIO button
*/
#ifdef CONFIG_KEYBOARD
static struct input_config button_input;
static int novena_gpio_button_read_keys(struct input_config *input)
{
int key = KEY_ENTER;
if (gpio_get_value(NOVENA_BUTTON_GPIO))
return 0;
input_send_keycodes(&button_input, &key, 1);
return 1;
}
static int novena_gpio_button_getc(struct stdio_dev *dev)
{
return input_getc(&button_input);
}
static int novena_gpio_button_tstc(struct stdio_dev *dev)
{
return input_tstc(&button_input);
}
static int novena_gpio_button_init(struct stdio_dev *dev)
{
gpio_direction_input(NOVENA_BUTTON_GPIO);
input_set_delays(&button_input, 250, 250);
return 0;
}
int drv_keyboard_init(void)
{
int error;
struct stdio_dev dev = {
.name = "button",
.flags = DEV_FLAGS_INPUT,
.start = novena_gpio_button_init,
.getc = novena_gpio_button_getc,
.tstc = novena_gpio_button_tstc,
};
gpio_request(NOVENA_BUTTON_GPIO, "button");
error = input_init(&button_input, 0);
if (error) {
debug("%s: Cannot set up input\n", __func__);
return -1;
}
input_add_tables(&button_input, false);
button_input.read_keys = novena_gpio_button_read_keys;
error = input_stdio_register(&dev);
if (error)
return error;
return 0;
}
#endif
int board_early_init_f(void)
{
#if defined(CONFIG_VIDEO_IPUV3)
setup_display_clock();
#endif
return 0;
}
int board_init(void)
{
/* address of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
return 0;
}
int board_late_init(void)
{
#if defined(CONFIG_VIDEO_IPUV3)
struct udevice *con;
char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
int ret;
setup_display_lvds();
ret = uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con);
if (ret)
return ret;
display_options_get_banner(false, buf, sizeof(buf));
vidconsole_position_cursor(con, 0, 0);
vidconsole_put_string(con, buf);
#endif
return 0;
}
int checkboard(void)
{
puts("Board: Novena 4x\n");
return 0;
}
int dram_init(void)
{
gd->ram_size = imx_ddr_size();
return 0;
}
/* setup board specific PMIC */
int power_init_board(void)
{
struct pmic *p;
u32 reg;
int ret;
power_pfuze100_init(1);
p = pmic_get("PFUZE100");
if (!p)
return -EINVAL;
ret = pmic_probe(p);
if (ret)
return ret;
pmic_reg_read(p, PFUZE100_DEVICEID, ®);
printf("PMIC: PFUZE100 ID=0x%02x\n", reg);
/* Set SWBST to 5.0V and enable (for USB) */
pmic_reg_read(p, PFUZE100_SWBSTCON1, ®);
reg &= ~(SWBST_MODE_MASK | SWBST_VOL_MASK);
reg |= (SWBST_5_00V | (SWBST_MODE_AUTO << SWBST_MODE_SHIFT));
pmic_reg_write(p, PFUZE100_SWBSTCON1, reg);
return 0;
}
/* EEPROM configuration data */
struct novena_eeprom_data {
uint8_t signature[6];
uint8_t version;
uint8_t reserved;
uint32_t serial;
uint8_t mac[6];
uint16_t features;
};
int misc_init_r(void)
{
struct novena_eeprom_data data;
uchar *datap = (uchar *)&data;
const char *signature = "Novena";
int ret;
/* If 'ethaddr' is already set, do nothing. */
if (env_get("ethaddr"))
return 0;
/* EEPROM is at bus 2. */
ret = i2c_set_bus_num(2);
if (ret) {
puts("Cannot select EEPROM I2C bus.\n");
return 0;
}
/* EEPROM is at address 0x56. */
ret = eeprom_read(0x56, 0, datap, sizeof(data));
if (ret) {
puts("Cannot read I2C EEPROM.\n");
return 0;
}
/* Check EEPROM signature. */
if (memcmp(data.signature, signature, 6)) {
puts("Invalid I2C EEPROM signature.\n");
return 0;
}
/* Set ethernet address from EEPROM. */
eth_env_set_enetaddr("ethaddr", data.mac);
return ret;
}
|
/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
*/
#include "msm_fb.h"
struct platform_device *pdev_hdmi;
static int lcdc_panel_on(struct platform_device *pdev)
{
return 0;
}
static int lcdc_panel_off(struct platform_device *pdev)
{
return 0;
}
static int __ref lcdc_panel_probe(struct platform_device *pdev)
{
msm_fb_add_device(pdev);
pdev_hdmi = pdev;
return 0;
}
static struct platform_driver this_driver = {
.probe = lcdc_panel_probe,
.driver = {
.name = "lcdc_panel",
},
};
static struct msm_fb_panel_data lcdc_panel_data = {
.on = lcdc_panel_on,
.off = lcdc_panel_off,
};
static int lcdc_dev_id;
int lcdc_device_register(struct msm_panel_info *pinfo)
{
struct platform_device *pdev = NULL;
int ret;
pdev = platform_device_alloc("lcdc_panel", ++lcdc_dev_id);
if (!pdev)
return -ENOMEM;
lcdc_panel_data.panel_info = *pinfo;
ret = platform_device_add_data(pdev, &lcdc_panel_data,
sizeof(lcdc_panel_data));
if (ret) {
printk(KERN_ERR
"%s: platform_device_add_data failed!\n", __func__);
goto err_device_put;
}
ret = platform_device_add(pdev);
if (ret) {
printk(KERN_ERR
"%s: platform_device_register failed!\n", __func__);
goto err_device_put;
}
return 0;
err_device_put:
platform_device_put(pdev);
return ret;
}
static int __ref lcdc_panel_init(void)
{
return platform_driver_register(&this_driver);
}
module_init(lcdc_panel_init);
|
/* Copyright (C) 2008, 2009, 2010, 2011 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/>. */
#include "defs.h"
#include "windows-nat.h"
#include "i386-nat.h"
#include <windows.h>
#define context_offset(x) ((int)&(((CONTEXT *)NULL)->x))
static const int mappings[] =
{
context_offset (Eax),
context_offset (Ecx),
context_offset (Edx),
context_offset (Ebx),
context_offset (Esp),
context_offset (Ebp),
context_offset (Esi),
context_offset (Edi),
context_offset (Eip),
context_offset (EFlags),
context_offset (SegCs),
context_offset (SegSs),
context_offset (SegDs),
context_offset (SegEs),
context_offset (SegFs),
context_offset (SegGs),
context_offset (FloatSave.RegisterArea[0 * 10]),
context_offset (FloatSave.RegisterArea[1 * 10]),
context_offset (FloatSave.RegisterArea[2 * 10]),
context_offset (FloatSave.RegisterArea[3 * 10]),
context_offset (FloatSave.RegisterArea[4 * 10]),
context_offset (FloatSave.RegisterArea[5 * 10]),
context_offset (FloatSave.RegisterArea[6 * 10]),
context_offset (FloatSave.RegisterArea[7 * 10]),
context_offset (FloatSave.ControlWord),
context_offset (FloatSave.StatusWord),
context_offset (FloatSave.TagWord),
context_offset (FloatSave.ErrorSelector),
context_offset (FloatSave.ErrorOffset),
context_offset (FloatSave.DataSelector),
context_offset (FloatSave.DataOffset),
context_offset (FloatSave.ErrorSelector)
/* XMM0-7 */ ,
context_offset (ExtendedRegisters[10*16]),
context_offset (ExtendedRegisters[11*16]),
context_offset (ExtendedRegisters[12*16]),
context_offset (ExtendedRegisters[13*16]),
context_offset (ExtendedRegisters[14*16]),
context_offset (ExtendedRegisters[15*16]),
context_offset (ExtendedRegisters[16*16]),
context_offset (ExtendedRegisters[17*16]),
/* MXCSR */
context_offset (ExtendedRegisters[24])
};
#undef context_offset
void
_initialize_i386_windows_nat (void)
{
windows_set_context_register_offsets (mappings);
i386_set_debug_register_length (4);
}
|
/*
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBMDEC_H_
#define WEBMDEC_H_
#include "./tools_common.h"
#ifdef __cplusplus
extern "C" {
#endif
struct nestegg;
struct nestegg_packet;
struct VpxInputContext;
struct WebmInputContext {
uint32_t chunk;
uint32_t chunks;
uint32_t video_track;
struct nestegg *nestegg_ctx;
struct nestegg_packet *pkt;
};
int file_is_webm(struct WebmInputContext *webm_ctx,
struct VpxInputContext *vpx_ctx);
int webm_read_frame(struct WebmInputContext *webm_ctx,
uint8_t **buffer,
size_t *bytes_in_buffer,
size_t *buffer_size);
int webm_guess_framerate(struct WebmInputContext *webm_ctx,
struct VpxInputContext *vpx_ctx);
void webm_free(struct WebmInputContext *webm_ctx);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // WEBMDEC_H_
|
/*
* * Copyright (C) 2007 Ubiquiti Networks, Inc.
* *
* * This program is free software; you can redistribute it and/or
* * modify it under the terms of the GNU General Public License as
* * published by the Free Software Foundation; either version 2 of the
* * License, or (at your option) any later version.
* *
* * This program is distributed in the hope that it will be useful, but
* * WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* * General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program; if not, write to the Free Software
* * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* */
#ifndef FW_INCLUDED
#define FW_INCLUDED
#include <sys/types.h>
#define MAGIC_HEADER "OPEN"
#define MAGIC_PART "PART"
#define MAGIC_END "END."
#define MAGIC_ENDS "ENDS"
#define MAGIC_LENGTH 4
#define PART_NAME_LENGTH 16
typedef struct header {
char magic[MAGIC_LENGTH];
char version[256];
u_int32_t crc;
u_int32_t pad;
} __attribute__ ((packed)) header_t;
typedef struct part {
char magic[MAGIC_LENGTH];
char name[PART_NAME_LENGTH];
char pad[12];
u_int32_t memaddr;
u_int32_t index;
u_int32_t baseaddr;
u_int32_t entryaddr;
u_int32_t data_size;
u_int32_t part_size;
} __attribute__ ((packed)) part_t;
typedef struct part_crc {
u_int32_t crc;
u_int32_t pad;
} __attribute__ ((packed)) part_crc_t;
typedef struct signature {
char magic[MAGIC_LENGTH];
u_int32_t crc;
u_int32_t pad;
} __attribute__ ((packed)) signature_t;
typedef struct signature_rsa {
char magic[MAGIC_LENGTH];
// u_int32_t crc;
unsigned char rsa_signature[256];
u_int32_t pad;
} __attribute__ ((packed)) signature_rsa_t;
#define VERSION "1.2"
#define INFO(...) fprintf(stdout, __VA_ARGS__)
#define ERROR(...) fprintf(stderr, "ERROR: "__VA_ARGS__)
#define WARN(...) fprintf(stderr, "WARN: "__VA_ARGS__)
#define DEBUG(...) do {\
if (debug) \
fprintf(stdout, "DEBUG: "__VA_ARGS__); \
} while (0);
#endif
|
/* Copyright (C) 2001 Rainmeter Project Developers
*
* This Source Code Form is subject to the terms of the GNU General Public
* License; either version 2 of the License, or (at your option) any later
* version. If a copy of the GPL was not distributed with this file, You can
* obtain one at <https://www.gnu.org/licenses/gpl-2.0.html>. */
#ifndef __MEASUREDISKSPACE_H__
#define __MEASUREDISKSPACE_H__
#include "Measure.h"
class MeasureDiskSpace : public Measure
{
public:
MeasureDiskSpace(Skin* skin, const WCHAR* name);
virtual ~MeasureDiskSpace();
MeasureDiskSpace(const MeasureDiskSpace& other) = delete;
MeasureDiskSpace& operator=(MeasureDiskSpace other) = delete;
virtual UINT GetTypeID() { return TypeID<MeasureDiskSpace>(); }
virtual const WCHAR* GetStringValue();
protected:
virtual void ReadOptions(ConfigParser& parser, const WCHAR* section);
virtual void UpdateValue();
private:
std::wstring m_Drive;
std::wstring m_StringValue;
bool m_Type;
bool m_Total;
bool m_Label;
bool m_IgnoreRemovable;
bool m_DiskQuota;
ULONGLONG m_OldTotalBytes;
};
#endif
|
/*
* Copyright (C) 2007 HTC Incorporated
* Author: Jay Tu (jay_tu@htc.com)
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* 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 _HTC_BATTERY_H_
#define _HTC_BATTERY_H_
#include "htc_battery_common.h"
#include "htc_gauge.h"
#include "htc_charger.h"
#define ADC_REPLY_ARRAY_SIZE 5
#define HTC_BATT_IOCTL_MAGIC 0xba
#define DEBUG_LOG_LENGTH 1024
#define HTC_BATT_IOCTL_READ_SOURCE \
_IOR(HTC_BATT_IOCTL_MAGIC, 1, unsigned int)
#define HTC_BATT_IOCTL_SET_BATT_ALARM \
_IOW(HTC_BATT_IOCTL_MAGIC, 2, unsigned int)
#define HTC_BATT_IOCTL_GET_ADC_VREF \
_IOR(HTC_BATT_IOCTL_MAGIC, 3, unsigned int[ADC_REPLY_ARRAY_SIZE])
#define HTC_BATT_IOCTL_GET_ADC_ALL \
_IOR(HTC_BATT_IOCTL_MAGIC, 4, struct battery_adc_reply)
#define HTC_BATT_IOCTL_CHARGER_CONTROL \
_IOW(HTC_BATT_IOCTL_MAGIC, 5, unsigned int)
#define HTC_BATT_IOCTL_UPDATE_BATT_INFO \
_IOW(HTC_BATT_IOCTL_MAGIC, 6, struct battery_info_reply)
#define HTC_BATT_IOCTL_BATT_DEBUG_LOG \
_IOW(HTC_BATT_IOCTL_MAGIC, 7, char[DEBUG_LOG_LENGTH])
#define HTC_BATT_IOCTL_SET_VOLTAGE_ALARM \
_IOW(HTC_BATT_IOCTL_MAGIC, 8, struct battery_vol_alarm)
#define HTC_BATT_IOCTL_SET_ALARM_TIMER_FLAG \
_IOW(HTC_BATT_IOCTL_MAGIC, 9, unsigned int)
#define REGULAR_BATTERRY_TIMER "regular_timer"
#define CABLE_DETECTION "cable"
#define CHARGER_IC_INTERRUPT "charger_int"
#define XOADC_MPP 0
#define PM_MPP_AIN_AMUX 1
#define MBAT_IN_LOW_TRIGGER 0
#define MBAT_IN_HIGH_TRIGGER 1
extern int radio_set_cable_status(int charger_type);
struct battery_adc_reply {
u32 adc_voltage[ADC_REPLY_ARRAY_SIZE];
u32 adc_current[ADC_REPLY_ARRAY_SIZE];
u32 adc_temperature[ADC_REPLY_ARRAY_SIZE];
u32 adc_battid[ADC_REPLY_ARRAY_SIZE];
};
struct mpp_config_data {
u32 vol[2];
u32 curr[2];
u32 temp[2];
u32 battid[2];
};
struct battery_vol_alarm {
int lower_threshold;
int upper_threshold;
int enable;
};
extern unsigned int system_rev;
enum {
GUAGE_NONE,
GUAGE_MODEM,
GUAGE_DS2784,
GUAGE_DS2746,
GUAGE_BQ27510,
};
enum {
LINEAR_CHARGER,
SWITCH_CHARGER_TPS65200,
};
enum {
BATT_TIMER_WAKE_LOCK = 0,
BATT_IOCTL_WAKE_LOCK,
};
enum {
HTC_BATT_DEBUG_UEVT = 1U << 1,
HTC_BATT_DEBUG_USER_QUERY = 1U << 2,
HTC_BATT_DEBUG_USB_NOTIFY = 1U << 3,
HTC_BATT_DEBUG_FULL_LOG = 1U << 4,
};
struct htc_battery_platform_data {
int gpio_mbat_in;
int gpio_mbat_in_trigger_level;
int gpio_mchg_en_n;
int gpio_iset;
int gpio_adp_9v;
int guage_driver;
int charger;
struct mpp_config_data mpp_data;
int ibat_limit_active_mask;
int iusb_limit_active_mask;
#ifdef CONFIG_DUTY_CYCLE_LIMIT
int chg_limit_timer_sub_mask;
#endif
int critical_low_voltage_mv;
int *critical_alarm_vol_ptr;
int critical_alarm_vol_cols;
int force_shutdown_batt_vol;
int overload_vol_thr_mv;
int overload_curr_thr_ma;
bool usb_temp_monitor_enable;
int usb_overheat_threshold;
int smooth_chg_full_delay_min;
int decreased_batt_level_check;
struct htc_gauge igauge;
struct htc_charger icharger;
int (*notify_pnpmgr_charging_enabled)(int charging_enabled);
};
enum {
BATT_ALARM_DISABLE_MODE,
BATT_ALARM_NORMAL_MODE,
BATT_ALARM_CRITICAL_MODE,
};
#endif
|
/* { dg-require-effective-target size32plus } */
#define DEBUG 0
#if DEBUG
#include <stdio.h>
#endif
#define N 200
int a[N][N];
int b[N][N];
static int __attribute__((noinline))
foo (void)
{
int i, j;
int res = 0;
/* This loop nest should be blocked. */
for (j = 1; j < N; j++)
for (i = 0; i < N; i++)
a[i][j] = a[i][j-1] + b[i][j];
for (i = 0; i < N; i++)
res += a[i][i];
return res;
}
extern void abort ();
int
main (void)
{
int i, j, res;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
{
a[i][j] = i + j;
b[i][j] = i - j;
}
res = foo ();
#if DEBUG
fprintf (stderr, "res = %d \n", res);
#endif
if (res != 1333300)
abort ();
return 0;
}
/* { dg-final { scan-tree-dump-times "tiled by" 4 "graphite" } } */
|
/*
* Config file for Compulab CM-T335 board
*
* Copyright (C) 2013, Compulab Ltd - http://compulab.co.il/
*
* Author: Ilya Ledvich <ilya@compulab.co.il>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __CONFIG_CM_T335_H
#define __CONFIG_CM_T335_H
#define CONFIG_CM_T335
#define CONFIG_NAND
#include <configs/ti_am335x_common.h>
#undef CONFIG_BOARD_LATE_INIT
#undef CONFIG_SPI
#undef CONFIG_OMAP3_SPI
#undef CONFIG_CMD_SPI
#undef CONFIG_SPL_OS_BOOT
#undef CONFIG_BOOTCOUNT_LIMIT
#undef CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC
#undef CONFIG_MAX_RAM_BANK_SIZE
#define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* 512MB */
#define CONFIG_OMAP_COMMON
#define MACH_TYPE_CM_T335 4586 /* Until the next sync */
#define CONFIG_MACH_TYPE MACH_TYPE_CM_T335
/* Clock Defines */
#define V_OSCK 25000000 /* Clock output from T2 */
#define V_SCLK (V_OSCK)
#define CONFIG_ENV_SIZE (16 << 10) /* 16 KiB */
#ifndef CONFIG_SPL_BUILD
#define MMCARGS \
"mmcdev=0\0" \
"mmcroot=/dev/mmcblk0p2 rw rootwait\0" \
"mmcrootfstype=ext4\0" \
"mmcargs=setenv bootargs console=${console} " \
"root=${mmcroot} " \
"rootfstype=${mmcrootfstype}\0" \
"mmcboot=echo Booting from mmc ...; " \
"run mmcargs; " \
"bootm ${loadaddr}\0"
#define NANDARGS \
"mtdids=" MTDIDS_DEFAULT "\0" \
"mtdparts=" MTDPARTS_DEFAULT "\0" \
"nandroot=ubi0:rootfs rw\0" \
"nandrootfstype=ubifs\0" \
"nandargs=setenv bootargs console=${console} " \
"root=${nandroot} " \
"rootfstype=${nandrootfstype} " \
"ubi.mtd=${rootfs_name}\0" \
"nandboot=echo Booting from nand ...; " \
"run nandargs; " \
"nboot ${loadaddr} nand0 900000; " \
"bootm ${loadaddr}\0"
#define CONFIG_EXTRA_ENV_SETTINGS \
"loadaddr=82000000\0" \
"console=ttyO0,115200n8\0" \
"rootfs_name=rootfs\0" \
"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
"bootscript=echo Running bootscript from mmc ...; " \
"source ${loadaddr}\0" \
"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
MMCARGS \
NANDARGS
#define CONFIG_BOOTCOMMAND \
"mmc dev ${mmcdev}; if mmc rescan; then " \
"if run loadbootscript; then " \
"run bootscript; " \
"else " \
"if run loaduimage; then " \
"run mmcboot; " \
"else run nandboot; " \
"fi; " \
"fi; " \
"else run nandboot; fi"
#endif /* CONFIG_SPL_BUILD */
#define CONFIG_TIMESTAMP
#define CONFIG_SYS_AUTOLOAD "no"
/* Serial console configuration */
#define CONFIG_CONS_INDEX 1
#define CONFIG_SERIAL1 1 /* UART0 */
/* NS16550 Configuration */
#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
#define CONFIG_BAUDRATE 115200
/* I2C Configuration */
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
#define CONFIG_SYS_I2C_EEPROM_BUS 0
/* SPL */
#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds"
/* Network. */
#define CONFIG_PHY_GIGE
#define CONFIG_PHYLIB
#define CONFIG_PHY_ATHEROS
/* NAND support */
#define CONFIG_SYS_NAND_5_ADDR_CYCLE
#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
CONFIG_SYS_NAND_PAGE_SIZE)
#define CONFIG_SYS_NAND_PAGE_SIZE 2048
#define CONFIG_SYS_NAND_OOBSIZE 64
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
#define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
10, 11, 12, 13, 14, 15, 16, 17, \
18, 19, 20, 21, 22, 23, 24, 25, \
26, 27, 28, 29, 30, 31, 32, 33, \
34, 35, 36, 37, 38, 39, 40, 41, \
42, 43, 44, 45, 46, 47, 48, 49, \
50, 51, 52, 53, 54, 55, 56, 57, }
#define CONFIG_SYS_NAND_ECCSIZE 512
#define CONFIG_SYS_NAND_ECCBYTES 14
#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
#undef CONFIG_SYS_NAND_U_BOOT_OFFS
#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000
#define CONFIG_CMD_NAND
#define MTDIDS_DEFAULT "nand0=nand"
#define MTDPARTS_DEFAULT "mtdparts=nand:2m(spl)," \
"1m(u-boot),1m(u-boot-env)," \
"1m(dtb),4m(splash)," \
"6m(kernel),-(rootfs)"
#define CONFIG_ENV_IS_IN_NAND
#define CONFIG_ENV_OFFSET 0x300000 /* environment starts here */
#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
#define CONFIG_SYS_NAND_ONFI_DETECTION
#ifdef CONFIG_SPL_OS_BOOT
#define CONFIG_CMD_SPL_NAND_OFS 0x400000 /* un-assigned: (using dtb) */
#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x500000
#define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
#endif
/* GPIO pin + bank to pin ID mapping */
#define GPIO_PIN(_bank, _pin) ((_bank << 5) + _pin)
/* Status LED */
#define CONFIG_STATUS_LED
#define CONFIG_GPIO_LED
#define CONFIG_BOARD_SPECIFIC_LED
#define STATUS_LED_BIT GPIO_PIN(2, 0)
/* Status LED polarity is inversed, so init it in the "off" state */
#define STATUS_LED_STATE STATUS_LED_OFF
#define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
#define STATUS_LED_BOOT 0
#ifndef CONFIG_SPL_BUILD
/*
* Enable PCA9555 at I2C0-0x26.
* First select the I2C0 bus with "i2c dev 0", then use "pca953x" command.
*/
#define CONFIG_PCA953X
#define CONFIG_CMD_PCA953X
#define CONFIG_CMD_PCA953X_INFO
#define CONFIG_SYS_I2C_PCA953X_ADDR 0x26
#define CONFIG_SYS_I2C_PCA953X_WIDTH { {0x26, 16} }
#endif /* CONFIG_SPL_BUILD */
#endif /* __CONFIG_CM_T335_H */
|
/* Check whether section can be stripped.
Copyright (C) 2005, 2013 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
it under the terms of either
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at
your option) any later version
or
* the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at
your option) any later version
or both in parallel, as here.
elfutils is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <string.h>
#include "libeblP.h"
bool
ebl_section_strip_p (Ebl *ebl, const GElf_Ehdr *ehdr, const GElf_Shdr *shdr,
const char *name, bool remove_comment,
bool only_remove_debug)
{
/* If only debug information should be removed check the name. There
is unfortunately no other way. */
if (unlikely (only_remove_debug))
{
if (ebl_debugscn_p (ebl, name))
return true;
if (shdr->sh_type == SHT_RELA || shdr->sh_type == SHT_REL)
{
Elf_Scn *scn_l = elf_getscn (ebl->elf, (shdr)->sh_info);
GElf_Shdr shdr_mem_l;
GElf_Shdr *shdr_l = gelf_getshdr (scn_l, &shdr_mem_l);
if (shdr_l != NULL)
{
const char *s_l = elf_strptr (ebl->elf, ehdr->e_shstrndx,
shdr_l->sh_name);
if (s_l != NULL && ebl_debugscn_p (ebl, s_l))
return true;
}
}
return false;
}
return SECTION_STRIP_P (shdr, name, remove_comment);
}
|
/*
* Functions related to generic helpers functions
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/bio.h>
#include <linux/blkdev.h>
#include <linux/scatterlist.h>
#include <linux/gfp.h>
#include "blk.h"
struct bio_batch {
atomic_t done;
unsigned long flags;
struct completion *wait;
};
static void bio_batch_end_io(struct bio *bio, int err)
{
struct bio_batch *bb = bio->bi_private;
if (err && (err != -EOPNOTSUPP))
clear_bit(BIO_UPTODATE, &bb->flags);
if (atomic_dec_and_test(&bb->done))
complete(bb->wait);
bio_put(bio);
}
/**
* blkdev_issue_discard - queue a discard
* @bdev: blockdev to issue discard for
* @sector: start sector
* @nr_sects: number of sectors to discard
* @gfp_mask: memory allocation flags (for bio_alloc)
* @flags: BLKDEV_IFL_* flags to control behaviour
*
* Description:
* Issue a discard request for the sectors in question.
*/
int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
sector_t nr_sects, gfp_t gfp_mask, int flags)
{
DECLARE_COMPLETION_ONSTACK(wait);
struct request_queue *q = bdev_get_queue(bdev);
int type = (1 << BIO_RW) | (1 << BIO_RW_DISCARD);
unsigned int max_discard_sectors;
struct bio_batch bb;
struct bio *bio;
int ret = 0;
/*
* DEPRECATED support for DISCARD_FL_BARRIER which will
* fail with -EOPNOTSUPP (due to implicit BIO_RW_BARRIER)
*/
if (flags & DISCARD_FL_BARRIER)
type = DISCARD_BARRIER;
if (!q)
return -ENXIO;
if (!blk_queue_discard(q))
return -EOPNOTSUPP;
/*
* Ensure that max_discard_sectors is of the proper
* granularity
*/
max_discard_sectors = min(q->limits.max_discard_sectors, UINT_MAX >> 9);
if (unlikely(!max_discard_sectors)) {
/* Avoid infinite loop below. Being cautious never hurts. */
return -EOPNOTSUPP;
} else if (q->limits.discard_granularity) {
unsigned int disc_sects = q->limits.discard_granularity >> 9;
max_discard_sectors &= ~(disc_sects - 1);
}
atomic_set(&bb.done, 1);
bb.flags = 1 << BIO_UPTODATE;
bb.wait = &wait;
while (nr_sects) {
bio = bio_alloc(gfp_mask, 1);
if (!bio) {
ret = -ENOMEM;
break;
}
bio->bi_sector = sector;
bio->bi_end_io = bio_batch_end_io;
bio->bi_bdev = bdev;
bio->bi_private = &bb;
if (nr_sects > max_discard_sectors) {
bio->bi_size = max_discard_sectors << 9;
nr_sects -= max_discard_sectors;
sector += max_discard_sectors;
} else {
bio->bi_size = nr_sects << 9;
nr_sects = 0;
}
atomic_inc(&bb.done);
submit_bio(type, bio);
}
/* Wait for bios in-flight */
if (!atomic_dec_and_test(&bb.done))
wait_for_completion(&wait);
if (!test_bit(BIO_UPTODATE, &bb.flags))
ret = -EIO;
return ret;
}
EXPORT_SYMBOL(blkdev_issue_discard);
/**
* blkdev_issue_zeroout - generate number of zero filed write bios
* @bdev: blockdev to issue
* @sector: start sector
* @nr_sects: number of sectors to write
* @gfp_mask: memory allocation flags (for bio_alloc)
*
* Description:
* Generate and issue number of bios with zerofiled pages.
*/
int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
sector_t nr_sects, gfp_t gfp_mask)
{
int ret;
struct bio *bio;
struct bio_batch bb;
unsigned int sz;
DECLARE_COMPLETION_ONSTACK(wait);
atomic_set(&bb.done, 1);
bb.flags = 1 << BIO_UPTODATE;
bb.wait = &wait;
ret = 0;
while (nr_sects != 0) {
bio = bio_alloc(gfp_mask,
min(nr_sects, (sector_t)BIO_MAX_PAGES));
if (!bio) {
ret = -ENOMEM;
break;
}
bio->bi_sector = sector;
bio->bi_bdev = bdev;
bio->bi_end_io = bio_batch_end_io;
bio->bi_private = &bb;
while (nr_sects != 0) {
sz = min((sector_t) PAGE_SIZE >> 9 , nr_sects);
ret = bio_add_page(bio, ZERO_PAGE(0), sz << 9, 0);
nr_sects -= ret >> 9;
sector += ret >> 9;
if (ret < (sz << 9))
break;
}
ret = 0;
atomic_inc(&bb.done);
submit_bio(WRITE, bio);
}
/* Wait for bios in-flight */
if (!atomic_dec_and_test(&bb.done))
wait_for_completion(&wait);
if (!test_bit(BIO_UPTODATE, &bb.flags))
/* One of bios in the batch was completed with error.*/
ret = -EIO;
return ret;
}
EXPORT_SYMBOL(blkdev_issue_zeroout);
|
#include "testharness.h"
struct foo {
int x;
struct googoo * next;
} * g1;
struct googoo {
double d;
};
int main() {
SUCCESS;
}
|
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/module.h>
#include <mach/mt_reg_base.h>
#include "mach/sync_write.h"
#include <linux/earlysuspend.h> // for suspend/resume , to disable speculative fetch when resume
#define CTL_OVERRIDE (CCI400_BASE+0x0)
#define SPEC_CTL (CCI400_BASE+0x4)
struct mt_cci400_driver {
struct device_driver driver;
const struct platform_device_id *id_table;
};
static struct mt_cci400_driver mt_cci400_drv = {
.driver = {
.name = "cci400",
.bus = &platform_bus_type,
.owner = THIS_MODULE,
},
.id_table= NULL,
};
int cci400_spec_fetch_query(void)
{
unsigned int val_ctl_override;
unsigned int val_spec_ctl;
val_ctl_override = readl(IOMEM(CTL_OVERRIDE));
val_spec_ctl = readl(IOMEM(SPEC_CTL));
if (val_ctl_override & (0x1 << 2))
{
if ((val_spec_ctl & (0x7 << 0)) && (val_spec_ctl & (0x1F << 16)))
{
return 0; //disable spec_fetch feature
}
}
return 1; //enable spec_fetch feature
}
int cci400_spec_fetch_set(int enable)
{
unsigned int val;
switch(enable){
case 0:
val = readl(IOMEM(CTL_OVERRIDE));
val |= (0x1 << 2);
writel(val, IOMEM(CTL_OVERRIDE));
val = readl(IOMEM(SPEC_CTL));
val |= (0x7 << 0);
val |= (0x1F << 16);
writel(val, IOMEM(SPEC_CTL));
//printk("[CCI] Disable Speculative Fetch feature,0x%x,0x%x\n",readl(IOMEM(CTL_OVERRIDE)),readl(IOMEM(SPEC_CTL)));
break;
case 1:
val = readl(IOMEM(CTL_OVERRIDE));
val &= ~(0x1 << 2);
writel(val, IOMEM(CTL_OVERRIDE));
val = readl(IOMEM(SPEC_CTL));
val &= ~(0x7 << 0);
val &= ~(0x1F << 16);
writel(val, IOMEM(SPEC_CTL));
//printk("[CCI] Enable Speculative Fetch feature,0x%x,0x%x\n",readl(IOMEM(CTL_OVERRIDE)),readl(IOMEM(SPEC_CTL)));
break;
default:
break;
}
return 0;
}
/*
* enable_spec_fetch_show: To enable speculative fetch in CCI400.
*/
static ssize_t enable_spec_fetch_show(struct device_driver *driver, char *buf)
{
unsigned int val;
char *ptr = buf;
val = readl(IOMEM(CTL_OVERRIDE));
if (1 == cci400_spec_fetch_query())
ptr += sprintf(ptr, "[CCI] Enable speculative fetches\n");
else
ptr += sprintf(ptr, "[CCI] Disable speculative fetches\n");
if (val & (0x1 << 2))
ptr += sprintf(ptr, "[CCI] Disable speculative fetches in Control Override Register:0x%x\n",val);
else
ptr += sprintf(ptr, "[CCI] Enable speculative fetches in Control Override Register:0x%x\n",val);
val = readl(IOMEM(SPEC_CTL));
ptr += sprintf(ptr, "[CCI] Speculative fetches info in Speculation Control Register:0x%x\n",val);
ptr += sprintf(ptr, "M0[APB]:%s\n",(val & (1<<0))?"Disable":"Enable");
ptr += sprintf(ptr, "M1[?]:%s\n",(val & (1<<1))?"Disable":"Enable");
ptr += sprintf(ptr, "M2[EMI]:%s\n",(val & (1<<2))?"Disable":"Enable");
ptr += sprintf(ptr, "S0[?]:%s\n",(val & (1<<16))?"Disable":"Enable");
ptr += sprintf(ptr, "S1[?]:%s\n",(val & (1<<17))?"Disable":"Enable");
ptr += sprintf(ptr, "S2[?]:%s\n",(val & (1<<18))?"Disable":"Enable");
ptr += sprintf(ptr, "S3[CLUSTER1]:%s\n",(val & (1<<19))?"Disable":"Enable");
ptr += sprintf(ptr, "S4[CLUSTER0]:%s\n",(val & (1<<20))?"Disable":"Enable");
return strlen(buf);
}
void mcu_div(void)
{
unsigned int *mcu_div = (unsigned int *)(MCUSYS_CFGREG_BASE + 0x240);
*mcu_div = 0x14;
dsb();
*mcu_div = 0x12;
dsb();
}
/*
* enable_spec_fetch_store:
*/
static ssize_t enable_spec_fetch_store(struct device_driver *driver, const char *buf,
size_t count)
{
char *p = (char *)buf;
unsigned int num;
num = simple_strtoul(p, &p, 10);
cci400_spec_fetch_set(num);
return count;
}
//#ifdef CONFIG_HAS_EARLYSUSPEND
//static struct early_suspend mt_cci400_early_suspend_handler =
//{
// .level = EARLY_SUSPEND_LEVEL_DISABLE_FB + 200,
// .suspend = NULL,
// .resume = NULL,
//};
//
//static void mt_cci400_late_resume(struct early_suspend *h)
//{
// //to disable speculative fetch when resume from sleep
// cci400_spec_fetch_set(0);
//}
//#endif
DRIVER_ATTR(enable_spec_fetch, 0664, enable_spec_fetch_show, enable_spec_fetch_store);
int mt_cci400_init(void){
int ret;
ret = driver_register(&mt_cci400_drv.driver);
ret = driver_create_file(&mt_cci400_drv.driver, &driver_attr_enable_spec_fetch);
if (ret == 0)
printk("[CCI] CCI 400 driver init done.\n");
// /*disable speculative fetch*/
// cci400_spec_fetch_set(0);
//
//#ifdef CONFIG_HAS_EARLYSUSPEND
// mt_cci400_early_suspend_handler.resume = mt_cci400_late_resume;
// register_early_suspend(&mt_cci400_early_suspend_handler);
//#endif
return 0;
}
arch_initcall(mt_cci400_init);
|
/*
** Copyright 2003-2010, VisualOn, 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.
*/
/*--------------------------------------------------------------------------*
* Q_PULSE.H *
*--------------------------------------------------------------------------*
* Coding and decoding of algebraic codebook *
*--------------------------------------------------------------------------*/
#ifndef __Q_PULSE_H__
#define __Q_PULSE_H__
#include "typedef.h"
Word32 quant_1p_N1( /* (o) return (N+1) bits */
Word16 pos, /* (i) position of the pulse */
Word16 N); /* (i) number of bits for position */
Word32 quant_2p_2N1( /* (o) return (2*N)+1 bits */
Word16 pos1, /* (i) position of the pulse 1 */
Word16 pos2, /* (i) position of the pulse 2 */
Word16 N); /* (i) number of bits for position */
Word32 quant_3p_3N1( /* (o) return (3*N)+1 bits */
Word16 pos1, /* (i) position of the pulse 1 */
Word16 pos2, /* (i) position of the pulse 2 */
Word16 pos3, /* (i) position of the pulse 3 */
Word16 N); /* (i) number of bits for position */
Word32 quant_4p_4N1( /* (o) return (4*N)+1 bits */
Word16 pos1, /* (i) position of the pulse 1 */
Word16 pos2, /* (i) position of the pulse 2 */
Word16 pos3, /* (i) position of the pulse 3 */
Word16 pos4, /* (i) position of the pulse 4 */
Word16 N); /* (i) number of bits for position */
Word32 quant_4p_4N( /* (o) return 4*N bits */
Word16 pos[], /* (i) position of the pulse 1..4 */
Word16 N); /* (i) number of bits for position */
Word32 quant_5p_5N( /* (o) return 5*N bits */
Word16 pos[], /* (i) position of the pulse 1..5 */
Word16 N); /* (i) number of bits for position */
Word32 quant_6p_6N_2( /* (o) return (6*N)-2 bits */
Word16 pos[], /* (i) position of the pulse 1..6 */
Word16 N); /* (i) number of bits for position */
#endif //__Q_PULSE_H__
|
/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (testabilitydriver@nokia.com)
**
** This file is part of Testability Driver Qt Agent
**
** If you have questions regarding the use of this file, please contact
** Nokia at testabilitydriver@nokia.com .
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#ifndef VIEWITEMHANDLER_H
#define VIEWITEMHANDLER_H
#include <QApplication>
#include <QTreeWidget>
#include <QWidget>
#include "uicommandservice.h"
class ViewItemHandler : public InteractionHandler
{
public:
ViewItemHandler();
~ViewItemHandler();
virtual QString handlerName() { return QString("ViewItemHandler"); }
bool executeInteraction(TargetData data);
private:
void setCheckState(QTreeWidget* treeWidget, TasCommand& command);
QTreeWidgetItem* findTreeItem(QTreeWidget* treeWidget, const QString& itemId);
QTreeWidgetItem* findFromTreeItem(QTreeWidgetItem* parent, const QString& itemId);
};
#endif
|
/* radare2 - LGPL - Copyright 2015-2016 - pancake */
#include <r_asm.h>
#include <r_lib.h>
#include <capstone/capstone.h>
#ifdef CAPSTONE_M68K_H
#define CAPSTONE_HAS_M68K 1
#else
#define CAPSTONE_HAS_M68K 0
#warning Cannot find capstone-m68k support
#endif
#if CAPSTONE_HAS_M68K
static bool check_features(RAsm *a, cs_insn *insn);
static csh cd = 0;
#include "cs_mnemonics.c"
static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
static int omode = -1;
static int obits = 32;
cs_insn* insn = NULL;
int ret, n = 0;
cs_mode mode = a->big_endian? CS_MODE_BIG_ENDIAN: CS_MODE_LITTLE_ENDIAN;
if (mode != omode || a->bits != obits) {
cs_close (&cd);
cd = 0; // unnecessary
omode = mode;
obits = a->bits;
}
// replace this with the asm.features?
if (a->cpu && strstr (a->cpu, "68000"))
mode |= CS_MODE_M68K_000;
if (a->cpu && strstr (a->cpu, "68010"))
mode |= CS_MODE_M68K_010;
if (a->cpu && strstr (a->cpu, "68020"))
mode |= CS_MODE_M68K_020;
if (a->cpu && strstr (a->cpu, "68030"))
mode |= CS_MODE_M68K_030;
if (a->cpu && strstr (a->cpu, "68040"))
mode |= CS_MODE_M68K_040;
if (a->cpu && strstr (a->cpu, "68060"))
mode |= CS_MODE_M68K_060;
op->size = 4;
op->buf_asm[0] = 0;
if (cd == 0) {
ret = cs_open (CS_ARCH_M68K, mode, &cd);
if (ret) {
ret = -1;
goto beach;
}
}
if (a->features && *a->features) {
cs_option (cd, CS_OPT_DETAIL, CS_OPT_ON);
} else {
cs_option (cd, CS_OPT_DETAIL, CS_OPT_OFF);
}
n = cs_disasm (cd, buf, R_MIN (8, len),
a->pc, 1, &insn);
if (n<1) {
ret = -1;
goto beach;
}
op->size = 0;
if (insn->size<1) {
ret = -1;
goto beach;
}
if (a->features && *a->features) {
if (!check_features (a, insn)) {
op->size = insn->size;
strcpy (op->buf_asm, "illegal");
}
}
if (!op->size) {
op->size = insn->size;
snprintf (op->buf_asm, R_ASM_BUFSIZE, "%s%s%s",
insn->mnemonic,
insn->op_str[0]?" ":"",
insn->op_str);
}
{
char *p = r_str_replace (strdup (op->buf_asm),
"$", "0x", true);
if (p) {
strncpy (op->buf_asm, p, R_ASM_BUFSIZE-1);
free (p);
}
}
cs_free (insn, n);
beach:
//cs_close (&cd);
if (!strncmp (op->buf_asm, "dc.w", 4)) {
strcpy (op->buf_asm, "invalid");
}
r_str_rmch (op->buf_asm, '#');
return op->size;
}
RAsmPlugin r_asm_plugin_m68k_cs = {
.name = "m68k",
.desc = "Capstone M68K disassembler",
.cpus = "68000,68010,68020,68030,68040,68060",
.license = "BSD",
.arch = "m68k",
.bits = 32,
.endian = R_SYS_ENDIAN_LITTLE | R_SYS_ENDIAN_BIG,
.disassemble = &disassemble,
.mnemonics = &mnemonics,
};
static bool check_features(RAsm *a, cs_insn *insn) {
/* TODO: Implement support for m68k */
return true;
}
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_m68k_cs,
.version = R2_VERSION
};
#endif
#else
RAsmPlugin r_asm_plugin_m68k_cs = {
.name = "m68k.cs (unsupported)",
.desc = "Capstone M68K disassembler (unsupported)",
.license = "BSD",
.arch = "m68k",
.bits = 32,
.endian = R_SYS_ENDIAN_LITTLE | R_SYS_ENDIAN_BIG,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_m68k_cs,
.version = R2_VERSION
};
#endif
#endif
|
/* Copyright 2020 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_COMPILER_MLIR_TOSA_TFL_PASSES_H_
#define TENSORFLOW_COMPILER_MLIR_TOSA_TFL_PASSES_H_
#include "mlir/Pass/PassManager.h" // from @llvm-project
#include "mlir/Pass/PassOptions.h" // from @llvm-project
namespace mlir {
namespace tosa {
struct TOSATFLLegalizationPipelineOptions
: public PassPipelineOptions<TOSATFLLegalizationPipelineOptions> {};
// Legalizes TFL (TensorFlow lite) dialect(s) to Tosa.
void createTFLtoTOSALegalizationPipeline(
OpPassManager& pm, const TOSATFLLegalizationPipelineOptions& opts);
} // namespace tosa
} // namespace mlir
#endif // TENSORFLOW_COMPILER_MLIR_TOSA_TFL_PASSES_H_
|
/*
* Copyright (c) 2015, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __MBED_DIRHANDLE_H__
#define __MBED_DIRHANDLE_H__
#warning mbed/DirHandle.h is deprecated. Please use mbed-drivers/DirHandle.h instead.
#include "../mbed-drivers/DirHandle.h"
#endif // __MBED_DIRHANDLE_H__
|
/*
* Copyright (c) 2011, The Iconfactory. 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 Iconfactory 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 ICONFACTORY 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.
*/
#import "UIScrollView+UIPrivate.h"
@interface UIScrollViewAnimation : NSObject {
@package
UIScrollView *scrollView;
NSTimeInterval beginTime;
}
- (id)initWithScrollView:(UIScrollView *)sv;
- (BOOL)animate;
@end
extern CGFloat UILinearInterpolation(CGFloat t, CGFloat start, CGFloat end);
extern CGFloat UIQuadraticEaseOut(CGFloat t, CGFloat start, CGFloat end);
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef CBOR_CNT_WRITER_H
#define CBOR_CNT_WRITER_H
#include "cbor.h"
#ifdef __cplusplus
extern "C" {
#endif
/* use this count writer if you want to try out a cbor encoding to see
* how long it would be (before allocating memory). This replaced the
* code in tinycbor.h that would try to do this once the encoding failed
* in a buffer. Its much easier to understand this way (for me)
*/
struct CborCntWriter {
struct cbor_encoder_writer enc;
};
static inline int
cbor_cnt_writer(struct cbor_encoder_writer *arg, const char *data, int len) {
struct CborCntWriter *cb = (struct CborCntWriter *) arg;
cb->enc.bytes_written += len;
return CborNoError;
}
static inline void
cbor_cnt_writer_init(struct CborCntWriter *cb) {
cb->enc.bytes_written = 0;
cb->enc.write = &cbor_cnt_writer;
}
#ifdef __cplusplus
}
#endif
#endif /* CBOR_CNT_WRITER_H */
|
#ifndef INCLUDES_TARANTOOL_BOX_SCHEMA_H
#define INCLUDES_TARANTOOL_BOX_SCHEMA_H
/*
* Copyright 2010-2015, Tarantool AUTHORS, please see AUTHORS file.
*
* 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 <COPYRIGHT HOLDER> ``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
* <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.
*/
#include "error.h"
#include <stdio.h> /* snprintf */
/** \cond public */
enum {
/** Start of the reserved range of system spaces. */
BOX_SYSTEM_ID_MIN = 256,
/** Space id of _schema. */
BOX_SCHEMA_ID = 272,
/** Space id of _space. */
BOX_SPACE_ID = 280,
/** Space id of _vspace view. */
BOX_VSPACE_ID = 281,
/** Space id of _index. */
BOX_INDEX_ID = 288,
/** Space id of _vindex view. */
BOX_VINDEX_ID = 289,
/** Space id of _func. */
BOX_FUNC_ID = 296,
/** Space id of _vfunc view. */
BOX_VFUNC_ID = 297,
/** Space id of _user. */
BOX_USER_ID = 304,
/** Space id of _vuser view. */
BOX_VUSER_ID = 305,
/** Space id of _priv. */
BOX_PRIV_ID = 312,
/** Space id of _vpriv view. */
BOX_VPRIV_ID = 313,
/** Space id of _cluster. */
BOX_CLUSTER_ID = 320,
/** End of the reserved range of system spaces. */
BOX_SYSTEM_ID_MAX = 511,
BOX_ID_NIL = 2147483647
};
/** \endcond public */
extern int sc_version;
struct space;
/** Call a visitor function on every space in the space cache. */
void
space_foreach(void (*func)(struct space *sp, void *udata), void *udata);
/**
* Try to look up a space by space number in the space cache.
* FFI-friendly no-exception-thrown space lookup function.
*
* @return NULL if space not found, otherwise space object.
*/
extern "C" struct space *
space_by_id(uint32_t id);
/** No-throw conversion of space id to space name */
extern "C" const char *
space_name_by_id(uint32_t id);
static inline struct space *
space_cache_find(uint32_t id)
{
struct space *space = space_by_id(id);
if (space)
return space;
tnt_raise(ClientError, ER_NO_SUCH_SPACE, int2str(id));
}
/**
* Update contents of the space cache. Typically the new space is
* an altered version of the original space.
* Returns the old space, if any.
*/
struct space *
space_cache_replace(struct space *space);
/** Delete a space from the space cache. */
struct space *
space_cache_delete(uint32_t id);
bool
space_is_system(struct space *space);
void
schema_init();
void
schema_free();
struct space *schema_space(uint32_t id);
/*
* Find object id by object name.
*/
uint32_t
schema_find_id(uint32_t system_space_id, uint32_t index_id,
const char *name, uint32_t len);
void
func_cache_replace(struct func_def *def);
void
func_cache_delete(uint32_t fid);
struct func;
struct func *
func_by_id(uint32_t fid);
static inline struct func *
func_cache_find(uint32_t fid)
{
struct func *func = func_by_id(fid);
if (func == NULL)
tnt_raise(ClientError, ER_NO_SUCH_FUNCTION, int2str(fid));
return func;
}
struct func *
func_by_name(const char *name, uint32_t name_len);
/**
* Check whether or not an object has grants on it (restrict
* constraint in drop object).
* _priv space to look up by space id
* @retval true object has grants
* @retval false object has no grants
*/
bool
schema_find_grants(const char *type, uint32_t id);
#endif /* INCLUDES_TARANTOOL_BOX_SCHEMA_H */
|
/* CoffeeCatch, a tiny native signal handler/catcher for JNI code.
* (especially for Android/Dalvik)
*
* Copyright (c) 2013, Xavier Roche (http://www.httrack.com/)
* All rights reserved.
* See the "License" section below for the licensing terms.
*
* Description:
*
* Allows to "gracefully" recover from a signal (segv, sibus...) as if it was
* a Java exception. It will not gracefully recover from allocator/mutexes
* corruption etc., however, but at least "most" gentle crashes (null pointer
* dereferencing, integer division, stack overflow etc.) should be handled
* without too much troubles.
*
* The handler is thread-safe, but client must have exclusive control on the
* signal handlers (ie. the library is installing its own signal handlers on
* top of the existing ones).
*
* You must build all your libraries with `-funwind-tables', to get proper
* unwinding information on all binaries. On ARM, you may also use the
* `--no-merge-exidx-entries` linker switch, to solve certain issues with
* unwinding (the switch is possibly not needed anymore).
* On Android, this can be achieved by using this line in the Android.mk file
* in each library block:
* LOCAL_CFLAGS := -funwind-tables -Wl,--no-merge-exidx-entries
*
* Example:
* COFFEE_TRY_JNI(env, *retcode = call_dangerous_function(env, object));
*
* Implementation notes:
*
* Currently the library is installing both alternate stack and signal
* handlers for known signals (SIGABRT, SIGILL, SIGTRAP, SIGBUS, SIGFPE,
* SIGSEGV, SIGSTKFLT), and is using sigsetjmp()/siglongjmp() to return to
* "userland" (compared to signal handler context). As a security, an alarm
* is started as soon as a fatal signal is detected (ie. not something the
* JVM will handle) to kill the process after a grace period. Be sure your
* program will exit quickly after the error is caught, or call alarm(0)
* to cancel the pending time-bomb.
* The signal handlers had to be written with caution, because the virtual
* machine might be using signals (including SEGV) to handle JIT compiler,
* and some clever optimizations (such as NullPointerException handling)
* We are using several signal-unsafe functions, namely:
* - siglongjmp() to return to userland
* - pthread_getspecific() to get thread-specific setup
*
* License:
*
* Copyright (c) 2013, Xavier Roche (http://www.httrack.com/)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef COFFEECATCH_JNI_H
#define COFFEECATCH_JNI_H
#include <jni.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Setup crash handler to enter in a protected section. If a recognized signal
* is received in this section, an appropriate native Java Error will be
* raised.
*
* You can not exit the protected section block CODE_TO_BE_EXECUTED, using
* statements such as "return", because the cleanup code would not be
* executed.
*
* It is advised to enclose the complete CODE_TO_BE_EXECUTED block in a
* dedicated function declared extern or __attribute__ ((noinline)).
*
* You must build all your libraries with `-funwind-tables', to get proper
* unwinding information on all binaries. On Android, this can be achieved
* by using this line in the Android.mk file in each library block:
* LOCAL_CFLAGS := -funwind-tables
*
* Example:
*
* void my_native_function(JNIEnv* env, jobject object, jint *retcode) {
* COFFEE_TRY_JNI(env, *retcode = call_dangerous_function(env, object));
* }
*
* In addition, the following restrictions MUST be followed:
* - the function must be declared extern, or with the special attribute
* __attribute__ ((noinline)).
* - you must not use local variables before the COFFEE_TRY_JNI block,
* or define them as "volatile".
*
COFFEE_TRY_JNI(JNIEnv* env, CODE_TO_BE_EXECUTED)
*/
/** Internal functions & definitions, not to be used directly. **/
extern void coffeecatch_throw_exception(JNIEnv* env);
#define COFFEE_TRY_JNI(ENV, CODE) \
do { \
COFFEE_TRY() { \
CODE; \
} COFFEE_CATCH() { \
coffeecatch_throw_exception(ENV); \
} COFFEE_END(); \
} while(0)
/** End of internal functions & definitions. **/
#ifdef __cplusplus
}
#endif
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.