text
stringlengths 4
6.14k
|
|---|
/*
* This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MODEL_H
#define MODEL_H
#include "loadlib/loadlib.h"
#include "vec3d.h"
//#include "mpq.h"
#include "modelheaders.h"
#include <vector>
#include "vmapexport.h"
class WMOInstance;
class MPQFile;
Vec3D fixCoordSystem(Vec3D v);
class Model
{
public:
ModelHeader header;
// nVertices = header.nBoundingVertices;
Vec3D* vertices;
uint16* indices;
size_t nIndices;
bool open(StringSet& failedPaths);
bool ConvertToVMAPModel(const char* outfilename);
bool ok;
void ScaleRotateTranslate(float scale, Vec3D rot, float w, Vec3D pos);
Model(std::string& filename);
~Model() {_unload();}
private:
void _unload()
{
delete[] vertices;
delete[] indices;
vertices = NULL;
indices = NULL;
}
std::string filename;
char outfilename;
};
class ModelInstance
{
public:
Model* model;
uint32 id;
Vec3D pos, rot;
unsigned int d1, scale;
float w, sc;
ModelInstance() {}
ModelInstance(MPQFile& f, const char* ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile);
};
#endif
|
/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* fixincludes should not add extern "C" to this file */
/*
* Rpc additions to <sys/types.h>
*/
#ifndef _RPC_TYPES_H
#define _RPC_TYPES_H 1
#if defined(WIN32) || defined(WIN64)
#include "sys/missing_sys_types.h"
#endif
typedef int bool_t;
typedef int enum_t;
/* This needs to be changed to uint32_t in the future */
typedef unsigned long rpcprog_t;
typedef unsigned long rpcvers_t;
typedef unsigned long rpcproc_t;
typedef unsigned long rpcprot_t;
typedef unsigned long rpcport_t;
#define __dontcare__ -1
#ifndef FALSE
# define FALSE (0)
#endif
#ifndef TRUE
# define TRUE (1)
#endif
#ifndef NULL
# define NULL 0
#endif
#include <stdlib.h> /* For malloc decl. */
#define mem_alloc(bsize) malloc(bsize)
/*
* XXX: This must not use the second argument, or code in xdr_array.c needs
* to be modified.
*/
#define mem_free(ptr, bsize) free(ptr)
#ifndef makedev /* ie, we haven't already included it */
#include <sys/types.h>
#endif
#ifndef __u_char_defined
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
# define __u_char_defined
#endif
#ifndef __daddr_t_defined
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
# define __daddr_t_defined
#endif
#include <sys/time.h>
#if !defined(WIN32) && !defined(WIN64)
#include <sys/param.h>
#include <netinet/in.h>
#endif
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK (u_long)0x7F000001
#endif
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64
#endif
#endif /* rpc/types.h */
|
/* SPDX-License-Identifier: MIT */
#ifndef __NV50_DISP_H__
#define __NV50_DISP_H__
#define nv50_disp(p) container_of((p), struct nv50_disp, base)
#include "priv.h"
struct nvkm_head;
#include <core/enum.h>
struct nv50_disp {
const struct nv50_disp_func *func;
struct nvkm_disp base;
struct workqueue_struct *wq;
struct work_struct supervisor;
u32 super;
struct nvkm_event uevent;
struct {
unsigned long mask;
int nr;
} wndw, head, dac;
struct {
unsigned long mask;
int nr;
u32 lvdsconf;
} sor;
struct {
unsigned long mask;
int nr;
u8 type[3];
} pior;
struct nvkm_gpuobj *inst;
struct nvkm_ramht *ramht;
struct nv50_disp_chan *chan[81];
};
void nv50_disp_super_1(struct nv50_disp *);
void nv50_disp_super_1_0(struct nv50_disp *, struct nvkm_head *);
void nv50_disp_super_2_0(struct nv50_disp *, struct nvkm_head *);
void nv50_disp_super_2_1(struct nv50_disp *, struct nvkm_head *);
void nv50_disp_super_2_2(struct nv50_disp *, struct nvkm_head *);
void nv50_disp_super_3_0(struct nv50_disp *, struct nvkm_head *);
int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
int index, struct nvkm_disp **);
struct nv50_disp_func {
int (*init)(struct nv50_disp *);
void (*fini)(struct nv50_disp *);
void (*intr)(struct nv50_disp *);
void (*intr_error)(struct nv50_disp *, int chid);
const struct nvkm_event_func *uevent;
void (*super)(struct work_struct *);
const struct nvkm_disp_oclass *root;
struct {
int (*cnt)(struct nvkm_disp *, unsigned long *mask);
int (*new)(struct nvkm_disp *, int id);
} wndw, head, dac, sor, pior;
u16 ramht_size;
};
int nv50_disp_init(struct nv50_disp *);
void nv50_disp_fini(struct nv50_disp *);
void nv50_disp_intr(struct nv50_disp *);
void nv50_disp_super(struct work_struct *);
extern const struct nvkm_enum nv50_disp_intr_error_type[];
int gf119_disp_init(struct nv50_disp *);
void gf119_disp_fini(struct nv50_disp *);
void gf119_disp_intr(struct nv50_disp *);
void gf119_disp_super(struct work_struct *);
void gf119_disp_intr_error(struct nv50_disp *, int);
void gv100_disp_fini(struct nv50_disp *);
void gv100_disp_intr(struct nv50_disp *);
void gv100_disp_super(struct work_struct *);
int gv100_disp_wndw_cnt(struct nvkm_disp *, unsigned long *);
int tu102_disp_init(struct nv50_disp *);
void nv50_disp_dptmds_war_2(struct nv50_disp *, struct dcb_output *);
void nv50_disp_dptmds_war_3(struct nv50_disp *, struct dcb_output *);
void nv50_disp_update_sppll1(struct nv50_disp *);
extern const struct nvkm_event_func nv50_disp_chan_uevent;
int nv50_disp_chan_uevent_ctor(struct nvkm_object *, void *, u32,
struct nvkm_notify *);
void nv50_disp_chan_uevent_send(struct nv50_disp *, int);
extern const struct nvkm_event_func gf119_disp_chan_uevent;
extern const struct nvkm_event_func gv100_disp_chan_uevent;
#endif
|
/* Verify that overloaded built-ins for __builtin_vec_xl with short
inputs produce the right code. */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-mvsx -O2" } */
#include <altivec.h>
#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM)\
RETTYPE \
TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \
{ \
return __builtin_vec_xl (offset, loadfrom); \
}
#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \
RETTYPE \
TESTNAME1 ## _cst (LOADFROM * loadfrom) \
{ \
return __builtin_vec_xl (CST_OFFSET, loadfrom); \
}
BUILD_VAR_TEST( test1, vector signed short, signed long long, signed short);
BUILD_VAR_TEST( test2, vector signed short, signed int, signed short);
BUILD_CST_TEST( test3, vector signed short, 12, signed short);
BUILD_VAR_TEST( test4, vector unsigned short, signed long long, unsigned short);
BUILD_VAR_TEST( test5, vector unsigned short, signed int, unsigned short);
BUILD_CST_TEST( test6, vector unsigned short, 12, unsigned short);
BUILD_VAR_TEST( test7, vector signed short, signed long long, vector signed short);
BUILD_VAR_TEST( test8, vector signed short, signed int, vector signed short);
BUILD_CST_TEST( test9, vector signed short, 12, vector signed short);
BUILD_VAR_TEST( test10, vector unsigned short, signed long long, vector unsigned short);
BUILD_VAR_TEST( test11, vector unsigned short, signed int, vector unsigned short);
BUILD_CST_TEST( test12, vector unsigned short, 12, vector unsigned short);
/* { dg-final { scan-assembler-times {\mlxvw4x\M|\mlxvd2x\M|\mlxvx\M|\mlvx\M} 12 } } */
|
/***************************************************************************
qgswcsserver.h
-------------------
begin : December 9, 2013
copyright : (C) 2013 by René-Luc D'Hont
email : rldhont at 3liz dot com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSWCSSERVER_H
#define QGSWCSSERVER_H
#include <QDomDocument>
#include <QMap>
#include <QString>
#include <map>
#include "qgis.h"
#include "qgsowsserver.h"
class QgsWCSProjectParser;
class QgsRequestHandler;
/** This class handles all the wcs server requests. The parameters and values have to be passed in the form of
a map<QString, QString>. This map is usually generated by a subclass of QgsWMSRequestHandler, which makes QgsWCSServer
independent from any server side technology*/
class QgsWCSServer: public QgsOWSServer
{
public:
/** Constructor. Takes parameter map and a pointer to a renderer object (does not take ownership)*/
QgsWCSServer(
const QString& configFilePath
, QMap<QString, QString>& parameters
, QgsWCSProjectParser* pp
, QgsRequestHandler* rh
#ifdef HAVE_SERVER_PYTHON_PLUGINS
, const QgsAccessControl* accessControl
#endif
);
~QgsWCSServer();
void executeRequest() override;
/** Returns an XML file with the capabilities description (as described in the WFS specs)*/
QDomDocument getCapabilities();
/** Returns an XML file with the describe Coverage (as described in the WCS specs)*/
QDomDocument describeCoverage();
/** Creates a file which is the result of the getCoverage request.*/
QByteArray* getCoverage();
/** Sets configuration parser for administration settings. Does not take ownership*/
void setAdminConfigParser( QgsWCSProjectParser* parser ) { mConfigParser = parser; }
private:
/** Don't use the default constructor*/
QgsWCSServer();
/** Get service address from REQUEST_URI if not specified in the configuration*/
QString serviceUrl() const;
QgsWCSProjectParser* mConfigParser;
};
#endif
|
/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
#include "test_sve_acle.h"
/*
** cmple_wide_s8_tied:
** cmple p0\.b, p0/z, z0\.b, z1\.d
** ret
*/
TEST_COMPARE_DUAL_Z (cmple_wide_s8_tied, svint8_t, svint64_t,
p0 = svcmple_wide_s8 (p0, z0, z1),
p0 = svcmple_wide (p0, z0, z1))
/*
** cmple_wide_s8_untied:
** cmple p0\.b, p1/z, z0\.b, z1\.d
** ret
*/
TEST_COMPARE_DUAL_Z (cmple_wide_s8_untied, svint8_t, svint64_t,
p0 = svcmple_wide_s8 (p1, z0, z1),
p0 = svcmple_wide (p1, z0, z1))
/*
** cmple_wide_x0_s8:
** mov (z[0-9]+\.d), x0
** cmple p0\.b, p1/z, z0\.b, \1
** ret
*/
TEST_COMPARE_ZX (cmple_wide_x0_s8, svint8_t, int64_t,
p0 = svcmple_wide_n_s8 (p1, z0, x0),
p0 = svcmple_wide (p1, z0, x0))
/*
** cmple_wide_0_s8:
** cmple p0\.b, p1/z, z0\.b, #0
** ret
*/
TEST_COMPARE_Z (cmple_wide_0_s8, svint8_t,
p0 = svcmple_wide_n_s8 (p1, z0, 0),
p0 = svcmple_wide (p1, z0, 0))
/*
** cmple_wide_1_s8:
** cmple p0\.b, p1/z, z0\.b, #1
** ret
*/
TEST_COMPARE_Z (cmple_wide_1_s8, svint8_t,
p0 = svcmple_wide_n_s8 (p1, z0, 1),
p0 = svcmple_wide (p1, z0, 1))
/*
** cmple_wide_15_s8:
** cmple p0\.b, p1/z, z0\.b, #15
** ret
*/
TEST_COMPARE_Z (cmple_wide_15_s8, svint8_t,
p0 = svcmple_wide_n_s8 (p1, z0, 15),
p0 = svcmple_wide (p1, z0, 15))
/*
** cmple_wide_16_s8:
** mov (z[0-9]+\.d), #16
** cmple p0\.b, p1/z, z0\.b, \1
** ret
*/
TEST_COMPARE_Z (cmple_wide_16_s8, svint8_t,
p0 = svcmple_wide_n_s8 (p1, z0, 16),
p0 = svcmple_wide (p1, z0, 16))
/*
** cmple_wide_m1_s8:
** cmple p0\.b, p1/z, z0\.b, #-1
** ret
*/
TEST_COMPARE_Z (cmple_wide_m1_s8, svint8_t,
p0 = svcmple_wide_n_s8 (p1, z0, -1),
p0 = svcmple_wide (p1, z0, -1))
/*
** cmple_wide_m16_s8:
** cmple p0\.b, p1/z, z0\.b, #-16
** ret
*/
TEST_COMPARE_Z (cmple_wide_m16_s8, svint8_t,
p0 = svcmple_wide_n_s8 (p1, z0, -16),
p0 = svcmple_wide (p1, z0, -16))
/*
** cmple_wide_m17_s8:
** mov (z[0-9]+\.d), #-17
** cmple p0\.b, p1/z, z0\.b, \1
** ret
*/
TEST_COMPARE_Z (cmple_wide_m17_s8, svint8_t,
p0 = svcmple_wide_n_s8 (p1, z0, -17),
p0 = svcmple_wide (p1, z0, -17))
|
// Check -B driver option.
//
// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \
// RUN: -B %S/Inputs/B_opt_tree/dir1 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-B-OPT-TRIPLE %s
// CHECK-B-OPT-TRIPLE: "{{.*}}/Inputs/B_opt_tree/dir1{{/|\\\\}}i386-unknown-linux-ld"
//
// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \
// RUN: -B %S/Inputs/B_opt_tree/dir2 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-B-OPT-DIR %s
// CHECK-B-OPT-DIR: "{{.*}}/Inputs/B_opt_tree/dir2{{/|\\\\}}ld"
//
// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \
// RUN: -B %S/Inputs/B_opt_tree/dir3/prefix- 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-B-OPT-PREFIX %s
// CHECK-B-OPT-PREFIX: "{{.*}}/Inputs/B_opt_tree/dir3{{/|\\\\}}prefix-ld"
//
// RUN: %clang %s -### -o %t.o -target i386-unknown-linux \
// RUN: -B %S/Inputs/B_opt_tree/dir3/prefix- \
// RUN: -B %S/Inputs/B_opt_tree/dir2 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-B-OPT-MULT %s
// CHECK-B-OPT-MULT: "{{.*}}/Inputs/B_opt_tree/dir3{{/|\\\\}}prefix-ld"
|
#include "clar_libgit2.h"
#include "git2/odb_backend.h"
#include "pack_data_one.h"
#include "pack.h"
static git_odb *_odb;
void test_odb_packed_one__initialize(void)
{
git_odb_backend *backend = NULL;
cl_git_pass(git_odb_new(&_odb));
cl_git_pass(git_odb_backend_one_pack(&backend, cl_fixture("testrepo.git/objects/pack/pack-a81e489679b7d3418f9ab594bda8ceb37dd4c695.idx")));
cl_git_pass(git_odb_add_backend(_odb, backend, 1));
}
void test_odb_packed_one__cleanup(void)
{
git_odb_free(_odb);
_odb = NULL;
}
void test_odb_packed_one__mass_read(void)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(packed_objects_one); ++i) {
git_oid id;
git_odb_object *obj;
cl_git_pass(git_oid_fromstr(&id, packed_objects_one[i]));
cl_assert(git_odb_exists(_odb, &id) == 1);
cl_git_pass(git_odb_read(&obj, _odb, &id));
git_odb_object_free(obj);
}
}
void test_odb_packed_one__read_header_0(void)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(packed_objects_one); ++i) {
git_oid id;
git_odb_object *obj;
size_t len;
git_object_t type;
cl_git_pass(git_oid_fromstr(&id, packed_objects_one[i]));
cl_git_pass(git_odb_read(&obj, _odb, &id));
cl_git_pass(git_odb_read_header(&len, &type, _odb, &id));
cl_assert(obj->cached.size == len);
cl_assert(obj->cached.type == type);
git_odb_object_free(obj);
}
}
|
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_KERNEL_XAM_ORDINALS_H_
#define XENIA_KERNEL_XAM_ORDINALS_H_
#include "xenia/cpu/export_resolver.h"
// Build an ordinal enum to make it easy to lookup ordinals.
#include "xenia/kernel/util/ordinal_table_pre.inc"
namespace ordinals {
enum {
#include "xenia/kernel/xam_table.inc"
};
} // namespace ordinals
#include "xenia/kernel/util/ordinal_table_post.inc"
#endif // XENIA_KERNEL_XAM_ORDINALS_H_
|
/*
*
* Copyright 2015, 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 GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H
#define GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H
#include <memory>
#include <grpc++/config.h>
#include <grpc++/credentials.h>
namespace grpc {
class ChannelInterface;
std::shared_ptr<ChannelInterface> CreateTestChannel(const grpc::string& server,
bool enable_ssl);
std::shared_ptr<ChannelInterface> CreateTestChannel(
const grpc::string& server, const grpc::string& override_hostname,
bool enable_ssl, bool use_prod_roots);
std::shared_ptr<ChannelInterface> CreateTestChannel(
const grpc::string& server, const grpc::string& override_hostname,
bool enable_ssl, bool use_prod_roots,
const std::shared_ptr<Credentials>& creds);
} // namespace grpc
#endif // GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H
|
/* camellia-invert-key.c
Inverting a key means reversing order of subkeys.
Copyright (C) 2010 Niels Möller
This file is part of GNU Nettle.
GNU Nettle 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.
GNU Nettle 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/.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "camellia-internal.h"
#define SWAP(a, b) \
do { uint64_t t_swap = (a); (a) = (b); (b) = t_swap; } while(0)
void
_camellia_invert_key(unsigned nkeys,
uint64_t *dst, const uint64_t *src)
{
unsigned i;
if (dst == src)
for (i = 0; i < nkeys - 1 - i; i++)
SWAP (dst[i], dst[nkeys - 1- i]);
else
for (i = 0; i < nkeys; i++)
dst[i] = src[nkeys - 1 - i];
}
|
#ifndef MMAP_UTIL_H
#define MMAP_UTIL_H
#include <unistd.h>
#ifdef HAVE_LINUX_MREMAP
# define __USE_GNU /* for MREMAP_MAYMOVE */
#endif
#include <sys/mman.h>
#undef __USE_GNU
#if !defined (MREMAP_MAYMOVE) && !defined (HAVE_LINUX_MREMAP)
# define MREMAP_MAYMOVE 1
#endif
#ifndef HAVE_MADVISE
# define madvise my_madvise
int my_madvise(void *start, size_t length, int advice);
# ifndef MADV_NORMAL
# define MADV_NORMAL 0
# define MADV_RANDOM 0
# define MADV_SEQUENTIAL 0
# define MADV_WILLNEED 0
# define MADV_DONTNEED 0
# endif
#endif
void *mmap_file(int fd, size_t *length, int prot);
void *mmap_ro_file(int fd, size_t *length);
void *mmap_rw_file(int fd, size_t *length);
/* for allocating anonymous mmap()s, with portable mremap(). these must not
be mixed with any standard mmap calls. */
void *mmap_anon(size_t length);
void *mremap_anon(void *old_address, size_t old_size, size_t new_size,
unsigned long flags);
int munmap_anon(void *start, size_t length);
size_t mmap_get_page_size(void) ATTR_CONST;
#endif
|
#ifndef CODE_H_
#define CODE_H_
#include <node.h>
#include <node_object_wrap.h>
#include <v8.h>
using namespace v8;
using namespace node;
class Code : public ObjectWrap {
public:
char *code;
Persistent<Object> scope_object;
Code(char *code, Persistent<Object> scope_object);
~Code();
// Has instance check
static inline bool HasInstance(Handle<Value> val) {
if (!val->IsObject()) return false;
Local<Object> obj = val->ToObject();
return constructor_template->HasInstance(obj);
}
// Functions available from V8
static void Initialize(Handle<Object> target);
static Handle<Value> ToString(const Arguments &args);
static Handle<Value> Inspect(const Arguments &args);
// Constructor used for creating new Long objects from C++
static Persistent<FunctionTemplate> constructor_template;
// Setters and Getters for internal properties
static Handle<Value> CodeGetter(Local<String> property, const AccessorInfo& info);
static void CodeSetter(Local<String> property, Local<Value> value, const AccessorInfo& info);
static Handle<Value> ScopeGetter(Local<String> property, const AccessorInfo& info);
static void ScopeSetter(Local<String> property, Local<Value> value, const AccessorInfo& info);
private:
static Handle<Value> New(const Arguments &args);
};
#endif // CODE_H_
|
/* Header file for routines that straddle the border between GIMPLE and
SSA in gimple.
Copyright (C) 2009-2015 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef GCC_GIMPLE_SSA_H
#define GCC_GIMPLE_SSA_H
#include "tree-ssa-operands.h"
/* This structure is used to map a gimple statement to a label,
or list of labels to represent transaction restart. */
struct GTY((for_user)) tm_restart_node {
gimple stmt;
tree label_or_list;
};
/* Hasher for tm_restart_node. */
struct tm_restart_hasher : ggc_ptr_hash<tm_restart_node>
{
static hashval_t hash (tm_restart_node *n) { return htab_hash_pointer (n); }
static bool
equal (tm_restart_node *a, tm_restart_node *b)
{
return a == b;
}
};
struct ssa_name_hasher : ggc_ptr_hash<tree_node>
{
/* Hash a tree in a uid_decl_map. */
static hashval_t
hash (tree item)
{
return item->ssa_name.var->decl_minimal.uid;
}
/* Return true if the DECL_UID in both trees are equal. */
static bool
equal (tree a, tree b)
{
return (a->ssa_name.var->decl_minimal.uid == b->ssa_name.var->decl_minimal.uid);
}
};
/* Gimple dataflow datastructure. All publicly available fields shall have
gimple_ accessor defined, all publicly modifiable fields should have
gimple_set accessor. */
struct GTY(()) gimple_df {
/* A vector of all the noreturn calls passed to modify_stmt.
cleanup_control_flow uses it to detect cases where a mid-block
indirect call has been turned into a noreturn call. When this
happens, all the instructions after the call are no longer
reachable and must be deleted as dead. */
vec<gimple, va_gc> *modified_noreturn_calls;
/* Array of all SSA_NAMEs used in the function. */
vec<tree, va_gc> *ssa_names;
/* Artificial variable used for the virtual operand FUD chain. */
tree vop;
/* The PTA solution for the ESCAPED artificial variable. */
struct pt_solution escaped;
/* A map of decls to artificial ssa-names that point to the partition
of the decl. */
hash_map<tree, tree> * GTY((skip(""))) decls_to_pointers;
/* Free list of SSA_NAMEs. */
vec<tree, va_gc> *free_ssanames;
/* Hashtable holding definition for symbol. If this field is not NULL, it
means that the first reference to this variable in the function is a
USE or a VUSE. In those cases, the SSA renamer creates an SSA name
for this variable with an empty defining statement. */
hash_table<ssa_name_hasher> *default_defs;
/* True if there are any symbols that need to be renamed. */
unsigned int ssa_renaming_needed : 1;
/* True if all virtual operands need to be renamed. */
unsigned int rename_vops : 1;
/* True if the code is in ssa form. */
unsigned int in_ssa_p : 1;
/* True if IPA points-to information was computed for this function. */
unsigned int ipa_pta : 1;
struct ssa_operands ssa_operands;
/* Map gimple stmt to tree label (or list of labels) for transaction
restart and abort. */
hash_table<tm_restart_hasher> *tm_restart;
};
/* Return true when gimple SSA form was built.
gimple_in_ssa_p is queried by gimplifier in various early stages before SSA
infrastructure is initialized. Check for presence of the datastructures
at first place. */
static inline bool
gimple_in_ssa_p (const struct function *fun)
{
return fun && fun->gimple_df && fun->gimple_df->in_ssa_p;
}
/* Artificial variable used for the virtual operand FUD chain. */
static inline tree
gimple_vop (const struct function *fun)
{
gcc_checking_assert (fun && fun->gimple_df);
return fun->gimple_df->vop;
}
/* Return the set of VUSE operand for statement G. */
static inline use_operand_p
gimple_vuse_op (const_gimple g)
{
struct use_optype_d *ops;
const gimple_statement_with_memory_ops *mem_ops_stmt =
dyn_cast <const gimple_statement_with_memory_ops *> (g);
if (!mem_ops_stmt)
return NULL_USE_OPERAND_P;
ops = mem_ops_stmt->use_ops;
if (ops
&& USE_OP_PTR (ops)->use == &mem_ops_stmt->vuse)
return USE_OP_PTR (ops);
return NULL_USE_OPERAND_P;
}
/* Return the set of VDEF operand for statement G. */
static inline def_operand_p
gimple_vdef_op (gimple g)
{
gimple_statement_with_memory_ops *mem_ops_stmt =
dyn_cast <gimple_statement_with_memory_ops *> (g);
if (!mem_ops_stmt)
return NULL_DEF_OPERAND_P;
if (mem_ops_stmt->vdef)
return &mem_ops_stmt->vdef;
return NULL_DEF_OPERAND_P;
}
/* Mark statement S as modified, and update it. */
static inline void
update_stmt (gimple s)
{
if (gimple_has_ops (s))
{
gimple_set_modified (s, true);
update_stmt_operands (cfun, s);
}
}
/* Update statement S if it has been optimized. */
static inline void
update_stmt_if_modified (gimple s)
{
if (gimple_modified_p (s))
update_stmt_operands (cfun, s);
}
/* Mark statement S as modified, and update it. */
static inline void
update_stmt_fn (struct function *fn, gimple s)
{
if (gimple_has_ops (s))
{
gimple_set_modified (s, true);
update_stmt_operands (fn, s);
}
}
#endif /* GCC_GIMPLE_SSA_H */
|
/*
* include/linux/writeback.h
*/
#ifndef WRITEBACK_H
#define WRITEBACK_H
#include <linux/sched.h>
#include <linux/fs.h>
struct backing_dev_info;
extern spinlock_t inode_lock;
extern struct list_head inode_in_use;
extern struct list_head inode_unused;
/*
* Yes, writeback.h requires sched.h
* No, sched.h is not included from here.
*/
static inline int task_is_pdflush(struct task_struct *task)
{
return task->flags & PF_FLUSHER;
}
#define current_is_pdflush() task_is_pdflush(current)
/*
* fs/fs-writeback.c
*/
enum writeback_sync_modes {
WB_SYNC_NONE, /* Don't wait on anything */
WB_SYNC_ALL, /* Wait on every mapping */
WB_SYNC_HOLD, /* Hold the inode on sb_dirty for sys_sync() */
};
/*
* A control structure which tells the writeback code what to do. These are
* always on the stack, and hence need no locking. They are always initialised
* in a manner such that unspecified fields are set to zero.
*/
struct writeback_control {
struct backing_dev_info *bdi; /* If !NULL, only write back this
queue */
enum writeback_sync_modes sync_mode;
unsigned long *older_than_this; /* If !NULL, only write back inodes
older than this */
long nr_to_write; /* Write this many pages, and decrement
this for each page written */
long pages_skipped; /* Pages which were not written */
/*
* For a_ops->writepages(): is start or end are non-zero then this is
* a hint that the filesystem need only write out the pages inside that
* byterange. The byte at `end' is included in the writeout request.
*/
loff_t range_start;
loff_t range_end;
unsigned nonblocking:1; /* Don't get stuck on request queues */
unsigned encountered_congestion:1; /* An output: a queue is full */
unsigned for_kupdate:1; /* A kupdate writeback */
unsigned for_reclaim:1; /* Invoked from the page allocator */
unsigned for_writepages:1; /* This is a writepages() call */
unsigned range_cyclic:1; /* range_start is cyclic */
unsigned more_io:1; /* more io to be dispatched */
unsigned range_cont:1;
};
/*
* fs/fs-writeback.c
*/
void writeback_inodes(struct writeback_control *wbc);
int inode_wait(void *);
void sync_inodes_sb(struct super_block *, int wait);
void sync_inodes(int wait);
/* writeback.h requires fs.h; it, too, is not included from here. */
static inline void wait_on_inode(struct inode *inode)
{
might_sleep();
wait_on_bit(&inode->i_state, __I_LOCK, inode_wait,
TASK_UNINTERRUPTIBLE);
}
static inline void inode_sync_wait(struct inode *inode)
{
might_sleep();
wait_on_bit(&inode->i_state, __I_SYNC, inode_wait,
TASK_UNINTERRUPTIBLE);
}
/*
* mm/page-writeback.c
*/
int wakeup_pdflush(long nr_pages);
void laptop_io_completion(void);
void laptop_sync_completion(void);
void throttle_vm_writeout(gfp_t gfp_mask);
/* These are exported to sysctl. */
extern int dirty_background_ratio;
extern int vm_dirty_ratio;
extern int dirty_writeback_interval;
extern int dirty_expire_interval;
extern int vm_highmem_is_dirtyable;
extern int block_dump;
extern int laptop_mode;
extern unsigned long determine_dirtyable_memory(void);
extern int dirty_ratio_handler(struct ctl_table *table, int write,
struct file *filp, void __user *buffer, size_t *lenp,
loff_t *ppos);
struct ctl_table;
struct file;
int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *,
void __user *, size_t *, loff_t *);
void get_dirty_limits(long *pbackground, long *pdirty, long *pbdi_dirty,
struct backing_dev_info *bdi);
void page_writeback_init(void);
void balance_dirty_pages_ratelimited_nr(struct address_space *mapping,
unsigned long nr_pages_dirtied);
static inline void
balance_dirty_pages_ratelimited(struct address_space *mapping)
{
balance_dirty_pages_ratelimited_nr(mapping, 1);
}
typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc,
void *data);
int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0);
int generic_writepages(struct address_space *mapping,
struct writeback_control *wbc);
int write_cache_pages(struct address_space *mapping,
struct writeback_control *wbc, writepage_t writepage,
void *data);
int do_writepages(struct address_space *mapping, struct writeback_control *wbc);
int sync_page_range(struct inode *inode, struct address_space *mapping,
loff_t pos, loff_t count);
int sync_page_range_nolock(struct inode *inode, struct address_space *mapping,
loff_t pos, loff_t count);
void set_page_dirty_balance(struct page *page, int page_mkwrite);
void writeback_set_ratelimit(void);
/* pdflush.c */
extern int nr_pdflush_threads; /* Global so it can be exported to sysctl
read-only. */
#endif /* WRITEBACK_H */
|
/***************************************************************************
* Copyright (C) 2005 by Tarek Saidi *
* tarek@linux *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef SETTINGSDLG_H
#define SETTINGSDLG_H
#include "ui_SettingsDlg.h"
#include "lib/AutoType.h"
class CSettingsDlg : public QDialog, private Ui_SettingsDialog
{
Q_OBJECT
public:
CSettingsDlg(QWidget* parent);
~CSettingsDlg();
private slots:
virtual void OnCancel();
virtual void OnOK();
virtual void OnTextColor();
virtual void OnColor2();
virtual void OnColor1();
void OnOtherButton(QAbstractButton*);
/*void OnIntPluginNone();
void OnIntPluginGnome();
void OnIntPluginKde();*/
void OnMountDirBrowse();
void OnBrowserCmdBrowse();
void OnCustomizeEntryDetails();
void OnInactivityLockChange(bool checked);
void OnAutoSaveToggle(bool checked);
void OnAutoSaveChangeToggle(bool checked);
void OnBackupDeleteChange();
void OnSelectLanguage(int index);
#ifdef GLOBAL_AUTOTYPE
private slots:
void resetGlobalShortcut();
#endif
private:
virtual void paintEvent(QPaintEvent*);
virtual void resizeEvent(QResizeEvent*);
void initLanguageList();
void apply();
QColor color1,color2,textcolor;
QPixmap BannerPixmap;
QList<Translation> translations;
#ifdef GLOBAL_AUTOTYPE
Shortcut pShortcut;
#endif
//static bool PluginsModified;
};
#endif
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef TITANIC_CALL_PELLERATOR_H
#define TITANIC_CALL_PELLERATOR_H
#include "titanic/core/game_object.h"
#include "titanic/messages/pet_messages.h"
namespace Titanic {
class CCallPellerator : public CGameObject {
DECLARE_MESSAGE_MAP;
bool EnterViewMsg(CEnterViewMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
bool PETActivateMsg(CPETActivateMsg *msg);
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
bool TimerMsg(CTimerMsg *msg);
private:
/**
* Switches to the PET Remote tab, and selects the 'Call Pellerator'
* glyph by default
*/
void showCallPellerator();
public:
CLASSDEF;
/**
* Save the data for the class to file
*/
virtual void save(SimpleFile *file, int indent);
/**
* Load the data for the class from file
*/
virtual void load(SimpleFile *file);
};
} // End of namespace Titanic
#endif /* TITANIC_CALL_PELLERATOR_H */
|
/* packet-dpvreq.c
* Routines for DOCSIS 3.0 DOCSIS Path Verify Response Message dissection.
* Copyright 2010, Guido Reismueller <g.reismueller[AT]avm.de>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
void proto_register_docsis_dpvreq(void);
void proto_reg_handoff_docsis_dpvreq(void);
/* Initialize the protocol and registered fields */
static int proto_docsis_dpvreq = -1;
static int hf_docsis_dpvreq_tranid = -1;
static int hf_docsis_dpvreq_dschan = -1;
static int hf_docsis_dpvreq_flags = -1;
static int hf_docsis_dpvreq_us_sf = -1;
static int hf_docsis_dpvreq_n = -1;
static int hf_docsis_dpvreq_start = -1;
static int hf_docsis_dpvreq_end = -1;
static int hf_docsis_dpvreq_ts_start = -1;
static int hf_docsis_dpvreq_ts_end = -1;
/* Initialize the subtree pointers */
static gint ett_docsis_dpvreq = -1;
/* Dissection */
static int
dissect_dpvreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_item *it;
proto_tree *dpvreq_tree = NULL;
guint16 transid;
guint8 dschan;
transid = tvb_get_ntohs (tvb, 0);
dschan = tvb_get_guint8 (tvb, 2);
col_add_fstr (pinfo->cinfo, COL_INFO,
"DOCSIS Path Verify Request: Transaction-Id = %u DS-Ch %d",
transid, dschan);
if (tree)
{
it =
proto_tree_add_protocol_format (tree, proto_docsis_dpvreq, tvb, 0, -1,
"DPV Request");
dpvreq_tree = proto_item_add_subtree (it, ett_docsis_dpvreq);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_tranid, tvb,
0, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_dschan, tvb,
2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_flags, tvb,
3, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_us_sf, tvb,
4, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_n, tvb,
8, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_start, tvb,
10, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_end, tvb,
11, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_ts_start, tvb,
12, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (dpvreq_tree, hf_docsis_dpvreq_ts_end, tvb,
16, 4, ENC_BIG_ENDIAN);
}
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
void
proto_register_docsis_dpvreq (void)
{
static hf_register_info hf[] = {
{&hf_docsis_dpvreq_tranid,
{"Transaction Id", "docsis_dpvreq.tranid",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_dschan,
{"Downstream Channel ID", "docsis_dpvreq.dschan",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_flags,
{"Flags", "docsis_dpvreq.flags",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_us_sf,
{"Upstream Service Flow ID", "docsis_dpvreq.us_sf",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_n,
{"N (Measurement avaraging factor)", "docsis_dpvreq.n",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_start,
{"Start Reference Point", "docsis_dpvreq.start",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_end,
{"End Reference Point", "docsis_dpvreq.end",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_ts_start,
{"Timestamp Start", "docsis_dpvreq.ts_start",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{&hf_docsis_dpvreq_ts_end,
{"Timestamp End", "docsis_dpvreq.ts_end",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
};
static gint *ett[] = {
&ett_docsis_dpvreq,
};
proto_docsis_dpvreq =
proto_register_protocol ("DOCSIS Path Verify Request",
"DOCSIS DPV-REQ", "docsis_dpvreq");
proto_register_field_array (proto_docsis_dpvreq, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
register_dissector ("docsis_dpvreq", dissect_dpvreq, proto_docsis_dpvreq);
}
void
proto_reg_handoff_docsis_dpvreq (void)
{
dissector_handle_t docsis_dpvreq_handle;
docsis_dpvreq_handle = find_dissector ("docsis_dpvreq");
dissector_add_uint ("docsis_mgmt", 0x27, docsis_dpvreq_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkAnnotationLayers.h
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkAnnotationLayers - Stores a ordered collection of annotation sets
//
// .SECTION Description
// vtkAnnotationLayers stores a vector of annotation layers. Each layer
// may contain any number of vtkAnnotation objects. The ordering of the
// layers introduces a prioritization of annotations. Annotations in
// higher layers may obscure annotations in lower layers.
#ifndef vtkAnnotationLayers_h
#define vtkAnnotationLayers_h
#include "vtkCommonDataModelModule.h" // For export macro
#include "vtkDataObject.h"
class vtkAnnotation;
class vtkSelection;
class VTKCOMMONDATAMODEL_EXPORT vtkAnnotationLayers : public vtkDataObject
{
public:
vtkTypeMacro(vtkAnnotationLayers, vtkDataObject);
void PrintSelf(ostream& os, vtkIndent indent);
static vtkAnnotationLayers* New();
// Description:
// The current annotation associated with this annotation link.
virtual void SetCurrentAnnotation(vtkAnnotation* ann);
vtkGetObjectMacro(CurrentAnnotation, vtkAnnotation);
// Description:
// The current selection associated with this annotation link.
// This is simply the selection contained in the current annotation.
virtual void SetCurrentSelection(vtkSelection* sel);
virtual vtkSelection* GetCurrentSelection();
// Description:
// The number of annotations in a specific layer.
unsigned int GetNumberOfAnnotations();
// Description:
// Retrieve an annotation from a layer.
vtkAnnotation* GetAnnotation(unsigned int idx);
// Description:
// Add an annotation to a layer.
void AddAnnotation(vtkAnnotation* ann);
// Description:
// Remove an annotation from a layer.
void RemoveAnnotation(vtkAnnotation* ann);
// Description:
// Initialize the data structure to an empty state.
virtual void Initialize();
// Description:
// Copy data from another data object into this one
// which references the same member annotations.
virtual void ShallowCopy(vtkDataObject* other);
// Description:
// Copy data from another data object into this one,
// performing a deep copy of member annotations.
virtual void DeepCopy(vtkDataObject* other);
// Description:
// Retrieve a vtkAnnotationLayers stored inside an information object.
static vtkAnnotationLayers* GetData(vtkInformation* info);
static vtkAnnotationLayers* GetData(vtkInformationVector* v, int i=0);
// Description:
// The modified time for this object.
virtual unsigned long GetMTime();
//BTX
protected:
vtkAnnotationLayers();
~vtkAnnotationLayers();
class Internals;
Internals* Implementation;
vtkAnnotation* CurrentAnnotation;
private:
vtkAnnotationLayers(const vtkAnnotationLayers&); // Not implemented.
void operator=(const vtkAnnotationLayers&); // Not implemented.
//ETX
};
#endif
|
/*
* Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
* Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License v.2.1.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _LVM_REPORT_H
#define _LVM_REPORT_H
#include "metadata-exported.h"
typedef enum {
LVS = 1,
PVS = 2,
VGS = 4,
SEGS = 8,
PVSEGS = 16,
LABEL = 32
} report_type_t;
struct field;
struct report_handle;
typedef int (*field_report_fn) (struct report_handle * dh, struct field * field,
const void *data);
void *report_init(struct cmd_context *cmd, const char *format, const char *keys,
report_type_t *report_type, const char *separator,
int aligned, int buffered, int headings, int field_prefixes,
int quoted, int columns_as_rows);
void report_free(void *handle);
int report_object(void *handle, struct volume_group *vg,
struct logical_volume *lv, struct physical_volume *pv,
struct lv_segment *seg, struct pv_segment *pvseg);
int report_output(void *handle);
#endif
|
// -*- C++ -*-
//=============================================================================
/**
* @file Refcountable_T.h
*
* @author Doug Schmidt
* @author Johnny Willemsen
*/
//=============================================================================
#ifndef ACE_REFCOUNTABLE_T_H
#define ACE_REFCOUNTABLE_T_H
#include /**/ "ace/pre.h"
#include /**/ "ace/ACE_export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/Atomic_Op.h"
#include "ace/Synch_Traits.h"
#include "ace/Null_Mutex.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
template <class ACE_LOCK>
class ACE_Refcountable_T
{
public:
/// Destructor.
virtual ~ACE_Refcountable_T (void);
/// Increment refcount
long increment (void);
/// Decrement refcount
long decrement (void);
/// Returns the current refcount.
long refcount (void) const;
protected:
/// Protected constructor.
ACE_Refcountable_T (long refcount);
/// Current refcount.
ACE_Atomic_Op <ACE_LOCK, long> refcount_;
};
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
#include "ace/Refcountable_T.inl"
#endif /* __ACE_INLINE__ */
#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
#include "ace/Refcountable_T.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
#pragma implementation ("Refcountable_T.cpp")
#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
#include /**/ "ace/post.h"
#endif /*ACE_REFCOUNTABLE_T_H*/
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_QUIC_CRYPTO_PROOF_VERIFIER_H_
#define NET_QUIC_CRYPTO_PROOF_VERIFIER_H_
#include <string>
#include <vector>
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/quic/quic_types.h"
namespace net {
// ProofVerifyDetails is an abstract class that acts as a container for any
// implementation specific details that a ProofVerifier wishes to return. These
// details are saved in the CachedState for the origin in question.
class NET_EXPORT_PRIVATE ProofVerifyDetails {
public:
virtual ~ProofVerifyDetails() {}
// Returns an new ProofVerifyDetails object with the same contents
// as this one.
virtual ProofVerifyDetails* Clone() const = 0;
};
// ProofVerifyContext is an abstract class that acts as a container for any
// implementation specific context that a ProofVerifier needs.
class NET_EXPORT_PRIVATE ProofVerifyContext {
public:
virtual ~ProofVerifyContext() {}
};
// ProofVerifierCallback provides a generic mechanism for a ProofVerifier to
// call back after an asynchronous verification.
class NET_EXPORT_PRIVATE ProofVerifierCallback {
public:
virtual ~ProofVerifierCallback() {}
// Run is called on the original thread to mark the completion of an
// asynchonous verification. If |ok| is true then the certificate is valid
// and |error_details| is unused. Otherwise, |error_details| contains a
// description of the error. |details| contains implementation-specific
// details of the verification. |Run| may take ownership of |details| by
// calling |release| on it.
virtual void Run(bool ok,
const std::string& error_details,
scoped_ptr<ProofVerifyDetails>* details) = 0;
};
// A ProofVerifier checks the signature on a server config, and the certificate
// chain that backs the public key.
class NET_EXPORT_PRIVATE ProofVerifier {
public:
virtual ~ProofVerifier() {}
// VerifyProof checks that |signature| is a valid signature of
// |server_config| by the public key in the leaf certificate of |certs|, and
// that |certs| is a valid chain for |hostname|. On success, it returns
// QUIC_SUCCESS. On failure, it returns QUIC_FAILURE and sets |*error_details|
// to a description of the problem. In either case it may set |*details|,
// which the caller takes ownership of.
//
// |context| specifies an implementation specific struct (which may be nullptr
// for some implementations) that provides useful information for the
// verifier, e.g. logging handles.
//
// This function may also return QUIC_PENDING, in which case the ProofVerifier
// will call back, on the original thread, via |callback| when complete.
// In this case, the ProofVerifier will take ownership of |callback|.
//
// The signature uses SHA-256 as the hash function and PSS padding in the
// case of RSA.
virtual QuicAsyncStatus VerifyProof(const std::string& hostname,
const std::string& server_config,
const std::vector<std::string>& certs,
const std::string& cert_sct,
const std::string& signature,
const ProofVerifyContext* context,
std::string* error_details,
scoped_ptr<ProofVerifyDetails>* details,
ProofVerifierCallback* callback) = 0;
};
} // namespace net
#endif // NET_QUIC_CRYPTO_PROOF_VERIFIER_H_
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MEDIA_CAST_LOGGING_LOGGING_IMPL_H_
#define MEDIA_CAST_LOGGING_LOGGING_IMPL_H_
// Generic class that handles event logging for the cast library.
// Logging has three possible optional forms:
// 1. Raw data and stats accessible by the application.
// 2. Tracing of raw events.
#include "base/memory/ref_counted.h"
#include "base/threading/thread_checker.h"
#include "media/cast/cast_config.h"
#include "media/cast/logging/logging_defines.h"
#include "media/cast/logging/logging_raw.h"
namespace media {
namespace cast {
class LoggingImpl {
public:
LoggingImpl();
~LoggingImpl();
// Note: All methods below should be called from the same thread.
void InsertFrameEvent(const base::TimeTicks& time_of_event,
CastLoggingEvent event, EventMediaType event_media_type,
uint32 rtp_timestamp, uint32 frame_id);
void InsertCapturedVideoFrameEvent(const base::TimeTicks& time_of_event,
uint32 rtp_timestamp,
int width,
int height);
void InsertEncodedFrameEvent(const base::TimeTicks& time_of_event,
CastLoggingEvent event,
EventMediaType event_media_type,
uint32 rtp_timestamp,
uint32 frame_id,
int encoded_size,
bool key_frame,
int target_bitrate,
double encoder_cpu_utilization,
double idealized_bitrate_utilization);
void InsertFrameEventWithDelay(const base::TimeTicks& time_of_event,
CastLoggingEvent event,
EventMediaType event_media_type,
uint32 rtp_timestamp, uint32 frame_id,
base::TimeDelta delay);
void InsertSinglePacketEvent(const base::TimeTicks& time_of_event,
CastLoggingEvent event,
EventMediaType event_media_type,
const Packet& packet);
void InsertPacketListEvent(const base::TimeTicks& time_of_event,
CastLoggingEvent event,
EventMediaType event_media_type,
const PacketList& packets);
void InsertPacketEvent(const base::TimeTicks& time_of_event,
CastLoggingEvent event,
EventMediaType event_media_type, uint32 rtp_timestamp,
uint32 frame_id, uint16 packet_id,
uint16 max_packet_id, size_t size);
// Delegates to |LoggingRaw::AddRawEventSubscriber()|.
void AddRawEventSubscriber(RawEventSubscriber* subscriber);
// Delegates to |LoggingRaw::RemoveRawEventSubscriber()|.
void RemoveRawEventSubscriber(RawEventSubscriber* subscriber);
private:
base::ThreadChecker thread_checker_;
LoggingRaw raw_;
DISALLOW_COPY_AND_ASSIGN(LoggingImpl);
};
} // namespace cast
} // namespace media
#endif // MEDIA_CAST_LOGGING_LOGGING_IMPL_H_
|
/*
* Copyright (c) 2004 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* 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 Institute 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 INSTITUTE 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 INSTITUTE 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 <config.h>
#include "roken.h"
#include "parse_time.h"
#include "test-mem.h"
#include "err.h"
static struct testcase {
size_t size;
int val;
char *str;
} tests[] = {
{ 8, 1, "1 second" },
{ 17, 61, "1 minute 1 second" },
{ 18, 62, "1 minute 2 seconds" },
{ 8, 60, "1 minute" },
{ 6, 3600, "1 hour" },
{ 15, 3601, "1 hour 1 second" },
{ 16, 3602, "1 hour 2 seconds" }
};
int
main(int argc, char **argv)
{
size_t sz;
size_t buf_sz;
int i, j;
for (i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) {
char *buf;
sz = unparse_time(tests[i].val, NULL, 0);
if (sz != tests[i].size)
errx(1, "sz (%lu) != tests[%d].size (%lu)",
(unsigned long)sz, i, (unsigned long)tests[i].size);
for (buf_sz = 0; buf_sz < tests[i].size + 2; buf_sz++) {
buf = rk_test_mem_alloc(RK_TM_OVERRUN, "overrun",
NULL, buf_sz);
sz = unparse_time(tests[i].val, buf, buf_sz);
if (sz != tests[i].size)
errx(1, "sz (%lu) != tests[%d].size (%lu) with in size %lu",
(unsigned long)sz, i,
(unsigned long)tests[i].size,
(unsigned long)buf_sz);
if (buf_sz > 0 && memcmp(buf, tests[i].str, buf_sz - 1) != 0)
errx(1, "test %i wrong result %s vs %s", i, buf, tests[i].str);
if (buf_sz > 0 && buf[buf_sz - 1] != '\0')
errx(1, "test %i not zero terminated", i);
rk_test_mem_free("overrun");
buf = rk_test_mem_alloc(RK_TM_UNDERRUN, "underrun",
NULL, tests[i].size);
sz = unparse_time(tests[i].val, buf, min(buf_sz, tests[i].size));
if (sz != tests[i].size)
errx(1, "sz (%lu) != tests[%d].size (%lu) with insize %lu",
(unsigned long)sz, i,
(unsigned long)tests[i].size,
(unsigned long)buf_sz);
if (buf_sz > 0 && strncmp(buf, tests[i].str, min(buf_sz, tests[i].size) - 1) != 0)
errx(1, "test %i wrong result %s vs %s", i, buf, tests[i].str);
if (buf_sz > 0 && buf[min(buf_sz, tests[i].size) - 1] != '\0')
errx(1, "test %i not zero terminated", i);
rk_test_mem_free("underrun");
}
buf = rk_test_mem_alloc(RK_TM_OVERRUN, "overrun",
tests[i].str, tests[i].size + 1);
j = parse_time(buf, "s");
if (j != tests[i].val)
errx(1, "parse_time failed for test %d", i);
rk_test_mem_free("overrun");
buf = rk_test_mem_alloc(RK_TM_UNDERRUN, "underrun",
tests[i].str, tests[i].size + 1);
j = parse_time(buf, "s");
if (j != tests[i].val)
errx(1, "parse_time failed for test %d", i);
rk_test_mem_free("underrun");
}
return 0;
}
|
#ifndef UI_PATCH_H
#define UI_PATCH_H
extern void cgit_print_patch(const char *new_rev, const char *old_rev,
const char *prefix);
#endif /* UI_PATCH_H */
|
/* misc.c --- miscellaneous utility functions for RX simulator.
Copyright (C) 2005-2016 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of the GNU simulators.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "config.h"
#include <stdio.h>
#include "cpu.h"
#include "misc.h"
int
bcd2int (int bcd, int w)
{
int v = 0, m = 1, i;
for (i = 0; i < (w ? 4 : 2); i++)
{
v += (bcd % 16) * m;
m *= 10;
bcd /= 16;
}
return v;
}
int
int2bcd (int v, int w)
{
int bcd = 0, m = 1, i;
for (i = 0; i < (w ? 4 : 2); i++)
{
bcd += (v % 10) * m;
m *= 16;
v /= 10;
}
return bcd;
}
char *
comma (unsigned int u)
{
static char buf[5][20];
static int bi = 0;
int comma = 0;
char *bp;
bi = (bi + 1) % 5;
bp = buf[bi] + 19;
*--bp = 0;
do
{
if (comma == 3)
{
*--bp = ',';
comma = 0;
}
comma++;
*--bp = '0' + (u % 10);
u /= 10;
}
while (u);
return bp;
}
|
/** @file
Implementation of 64-bit swap bytes
Copyright (c) 2006 - 2008, 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.
**/
/**
Switches the endianess of a 64-bit integer.
This function swaps the bytes in a 64-bit unsigned value to switch the value
from little endian to big endian or vice versa. The byte swapped value is
returned.
@param Operand A 64-bit unsigned value.
@return The byte swaped Operand.
**/
UINT64
EFIAPI
InternalMathSwapBytes64 (
IN UINT64 Operand
)
{
_asm {
mov eax, dword ptr [Operand + 4]
mov edx, dword ptr [Operand + 0]
bswap eax
bswap edx
}
}
|
/*
* (C) Copyright 2011
* Emcraft Systems, <www.emcraft.com>
* Alexander Potashev <aspotashev@emcraft.com>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <linux/kernel.h>
#include <asm/hardware/cortexm3.h>
#include <mach/eth.h>
/*
* Perform the low-level reboot.
*/
void lpc178x_reboot(void)
{
#ifdef CONFIG_LPC178X_ETHER
/*
* We have to reset the PHY immediately before doing a software SoC
* reset, because otherwise the Ethernet block of the SoC will hang
* after reset.
*/
lpc178x_phy_final_reset();
#endif
/*
* Perform the software reset (SYSRESET)
*/
cortex_m3_reboot();
}
|
#ifndef _SRC_CLUCENE_CLUCENE_CONFIG_H
#define _SRC_CLUCENE_CLUCENE_CONFIG_H 1
/* src/shared/CLucene/clucene-config.h.
* Normally generated automatically at end of cmake,
* but here in LibreOffice this actually is a copy of
* clucene/configs/clucene-config-generic.h.
*/
/* CMake will look for these headers: */
#define _CL_HAVE_STRING_H 1
#define _CL_HAVE_MEMORY_H 1
#define _CL_HAVE_UNISTD_H 1
/* #undef _CL_HAVE_IO_H */
/* #undef _CL_HAVE_DIRECT_H */
#define _CL_HAVE_DIRENT_H 1
#define _CL_HAVE_SYS_DIR_H
/* #undef _CL_HAVE_SYS_NDIR_H */
#define _CL_HAVE_ERRNO_H 1
#define _CL_HAVE_WCHAR_H 1
#define _CL_HAVE_WCTYPE_H
#define _CL_HAVE_CTYPE_H 1
/* #undef _CL_HAVE_WINDOWS_H */
/* #undef _CL_HAVE_WINDEF_H */
#define _CL_HAVE_SYS_TYPES_H 1
/* #undef _CL_HAVE_DLFCN_H */
#define _CL_HAVE_EXT_HASH_MAP 1
/* #undef _CL_HAVE_EXT_HASH_SET */
#define _CL_HAVE_TR1_UNORDERED_MAP 1
#define _CL_HAVE_TR1_UNORDERED_SET 1
#define _CL_HAVE_HASH_MAP
#define _CL_HAVE_HASH_SET
/* #undef _CL_HAVE_NDIR_H */
#define _CL_HAVE_SYS_STAT_H 1
#define _CL_HAVE_SYS_TIMEB_H 1
#define _CL_HAVE_SYS_TIME_H 1
/* #undef _CL_HAVE_TCHAR_H */
#define _CL_HAVE_SYS_MMAN_H 1
/* #undef _CL_HAVE_WINERROR_H */
#define _CL_HAVE_STDINT_H 1
// our needed types
/* undef int8_t int8_t */
/* undef uint8_t uint8_t */
/* undef int16_t int16_t */
/* undef uint16_t uint16_t */
/* undef int32_t int32_t */
/* undef uint32_t uint32_t */
/* undef int64_t int64_t */
/* undef uint64_t uint64_t */
/* undef float_t*/
/* undef size_t size_t */
/* tchar & _T definitions... */
typedef wchar_t TCHAR;
#define _T(x) L ## x
/* CMake will determine these specifics. Things like bugs, etc */
/* if we can't support the map/set hashing */
/* #undef LUCENE_DISABLE_HASHING */
/* Define if you have POSIX threads libraries and header files. */
#define _CL_HAVE_PTHREAD 1
/* Define if you have Win32 threads libraries and header files. */
/* #undef _CL_HAVE_WIN32_THREADS */
/* Define if we have gcc atomic functions */
/* #undef _CL_HAVE_GCC_ATOMIC_FUNCTIONS */
/* Define what eval method is required for float_t to be defined (for GCC). */
/* #undef _FLT_EVAL_METHOD */
/* If we use hashmaps, which namespace do we use: */
#define CL_NS_HASHING(func) std::tr1::func
/* If we use hashmaps, which classes do we use: */
#define _CL_HASH_MAP unordered_map
#define _CL_HASH_SET unordered_set
/* define if the compiler implements namespaces */
#define _CL_HAVE_NAMESPACES
/* Defined if the snprintf overflow test fails */
/* #undef _CL_HAVE_SNPRINTF_BUG */
/* Defined if the swprintf test fails */
/* #undef _CL_HAVE_SNWPRINTF_BUG */
/* How to define a static const in a class */
#define LUCENE_STATIC_CONSTANT(type, assignment) static const type assignment
/* Define to the necessary symbol if this constant uses a non-standard name on
your system. */
//todo: not checked
/* #undef _CL_PTHREAD_CREATE_JOINABLE */
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
//todo: not being checked for...
/* #undef _CL_STAT_MACROS_BROKEN */
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
//not actually used for anything...
//#define _CL_TIME_WITH_SYS_TIME 1
/* Define that we will be using -fvisibility=hidden, and
* make public classes visible using __attribute__ ((visibility("default")))
*/
#define _CL_HAVE_GCCVISIBILITYPATCH 1
/* Versions, etc */
/* Name of package */
#define _CL_PACKAGE "clucene-core"
/* Version number of package */
#define _CL_VERSION "2.3.3.4"
/* So-Version number of package */
#define _CL_SOVERSION "1"
/* A comparable version number */
#define _CL_INT_VERSION 2030304
/* Configured options (from command line) */
/* Forces into Ascii mode */
/* #undef _ASCII */
/* Conditional Debugging */
/* #undef _CL__CND_DEBUG */
/* debuging option */
/* #undef _DEBUG */
/* Disable multithreading */
/* #undef _CL_DISABLE_MULTITHREADING */
#ifdef __BORLANDC__ //borland compiler
//todo: bcc incorrectly detects this... fix this in cmake
#undef LUCENE_STATIC_CONSTANT
#define LUCENE_STATIC_CONSTANT(type, assignment) enum { assignment }
#endif
#endif
|
/*
MCU tables for STM32G4
*/
#if defined(STM32G4)
#define STM32_UNKNOWN 0
mcu_des_t mcu_descriptions[] = {
{ STM32_UNKNOWN, "STM32G4??", '?'},
};
const mcu_rev_t silicon_revs[] = {
};
#endif // STM32G4
|
/*
LUFA Library
Copyright (C) Dean Camera, 2011.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \file
* \brief Endpoint data stream transmission and reception management.
* \copydetails Group_EndpointStreamRW
*
* \note This file should not be included directly. It is automatically included as needed by the USB driver
* dispatch header located in LUFA/Drivers/USB/USB.h.
*/
/** \ingroup Group_EndpointRW
* \defgroup Group_EndpointStreamRW Read/Write of Multi-Byte Streams
* \brief Endpoint data stream transmission and reception management.
*
* Functions, macros, variables, enums and types related to data reading and writing of data streams from
* and to endpoints.
*
* @{
*/
#ifndef __ENDPOINT_STREAM_H__
#define __ENDPOINT_STREAM_H__
/* Includes: */
#include "../../../Common/Common.h"
#include "USBMode.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
/* Public Interface - May be used in end-application: */
/* Enums: */
/** Enum for the possible error return codes of the \c Endpoint_*_Stream_* functions. */
enum Endpoint_Stream_RW_ErrorCodes_t
{
ENDPOINT_RWSTREAM_NoError = 0, /**< Command completed successfully, no error. */
ENDPOINT_RWSTREAM_EndpointStalled = 1, /**< The endpoint was stalled during the stream
* transfer by the host or device.
*/
ENDPOINT_RWSTREAM_DeviceDisconnected = 2, /**< Device was disconnected from the host during
* the transfer.
*/
ENDPOINT_RWSTREAM_BusSuspended = 3, /**< The USB bus has been suspended by the host and
* no USB endpoint traffic can occur until the bus
* has resumed.
*/
ENDPOINT_RWSTREAM_Timeout = 4, /**< The host failed to accept or send the next packet
* within the software timeout period set by the
* \ref USB_STREAM_TIMEOUT_MS macro.
*/
ENDPOINT_RWSTREAM_IncompleteTransfer = 5, /**< Indicates that the endpoint bank became full or empty before
* the complete contents of the current stream could be
* transferred. The endpoint stream function should be called
* again to process the next chunk of data in the transfer.
*/
};
/** Enum for the possible error return codes of the \c Endpoint_*_Control_Stream_* functions. */
enum Endpoint_ControlStream_RW_ErrorCodes_t
{
ENDPOINT_RWCSTREAM_NoError = 0, /**< Command completed successfully, no error. */
ENDPOINT_RWCSTREAM_HostAborted = 1, /**< The aborted the transfer prematurely. */
ENDPOINT_RWCSTREAM_DeviceDisconnected = 2, /**< Device was disconnected from the host during
* the transfer.
*/
ENDPOINT_RWCSTREAM_BusSuspended = 3, /**< The USB bus has been suspended by the host and
* no USB endpoint traffic can occur until the bus
* has resumed.
*/
};
/* Architecture Includes: */
#if (ARCH == ARCH_AVR8)
#include "AVR8/EndpointStream_AVR8.h"
#elif (ARCH == ARCH_UC3)
#include "UC3/EndpointStream_UC3.h"
#elif (ARCH == ARCH_XMEGA)
#include "XMEGA/EndpointStream_XMEGA.h"
#endif
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
/** @} */
|
/*
* Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
*/
#ifndef vnsw_agent_pkt_packet_buffer_hpp
#define vnsw_agent_pkt_packet_buffer_hpp
#include <string>
#include <stdint.h>
#include <boost/shared_ptr.hpp>
#include <boost/shared_array.hpp>
#include <base/util.h>
class PacketBuffer;
class PacketBufferManager;
class AgentHdr;
class PktHandler;
class PktModule;
typedef boost::shared_ptr<PacketBuffer> PacketBufferPtr;
class PacketBuffer {
public:
static const uint32_t kDefaultBufferLen = 1024;
virtual ~PacketBuffer();
uint8_t *buffer() const { return buffer_.get(); }
uint16_t buffer_len() const { return buffer_len_; }
uint8_t *data() const;
uint16_t data_len() const;
uint32_t module() const { return module_; }
void set_module(uint32_t module) { module_ = module; }
void set_len(uint32_t len);
bool SetOffset(uint16_t offset);
private:
friend class PacketBufferManager;
PacketBuffer(PacketBufferManager *mgr, uint32_t module, uint16_t len,
uint32_t mdata);
// Create PacketBuffer from existing memory
PacketBuffer(PacketBufferManager *mgr, uint32_t module, uint8_t *buff,
uint16_t len, uint16_t data_offset, uint16_t data_len,
uint32_t mdata);
boost::shared_array<uint8_t> buffer_;
uint16_t buffer_len_;
uint8_t *data_;
uint16_t data_len_;
uint32_t module_;
uint32_t mdata_;
PacketBufferManager *mgr_;
DISALLOW_COPY_AND_ASSIGN(PacketBuffer);
};
class PacketBufferManager {
public:
PacketBufferManager(PktModule *pkt_module);
virtual ~PacketBufferManager();
PacketBufferPtr Allocate(uint32_t module, uint16_t len, uint32_t mdata);
PacketBufferPtr Allocate(uint32_t module, uint8_t *buff, uint16_t len,
uint16_t data_offset, uint16_t data_len,
uint32_t mdata);
private:
friend class PacketBuffer;
void FreeIndication(PacketBuffer *);
uint64_t alloc_;
uint64_t free_;
PktModule *pkt_module_;
DISALLOW_COPY_AND_ASSIGN(PacketBufferManager);
};
#endif // vnsw_agent_pkt_packet_buffer_hpp
|
/*----------------------------------------------------------------------------
* File: ooaofooa_S_DIS_class.h
*
* Class: Datatype In Suppression (S_DIS)
* Component: ooaofooa
*
* your copyright statement can go here (from te_copyright.body)
*--------------------------------------------------------------------------*/
#ifndef OOAOFOOA_S_DIS_CLASS_H
#define OOAOFOOA_S_DIS_CLASS_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Structural representation of application analysis class:
* Datatype In Suppression (S_DIS)
*/
struct ooaofooa_S_DIS {
/* application analysis class attributes */
Escher_UniqueID_t Dom_ID;
Escher_UniqueID_t DT_ID;
/* relationship storage */
ooaofooa_S_DOM * S_DOM_R47_is_suppressed_in;
ooaofooa_S_DT * S_DT_R47_contains_suppressed;
};
void ooaofooa_S_DIS_instancedumper( Escher_iHandle_t );
Escher_iHandle_t ooaofooa_S_DIS_instanceloader( Escher_iHandle_t, const c_t * [] );
void ooaofooa_S_DIS_batch_relate( Escher_iHandle_t );
void ooaofooa_S_DIS_R47_Link( ooaofooa_S_DOM *, ooaofooa_S_DT *, ooaofooa_S_DIS * );
void ooaofooa_S_DIS_R47_Unlink( ooaofooa_S_DOM *, ooaofooa_S_DT *, ooaofooa_S_DIS * );
#define ooaofooa_S_DIS_MAX_EXTENT_SIZE 10
extern Escher_Extent_t pG_ooaofooa_S_DIS_extent;
#ifdef __cplusplus
}
#endif
#endif /* OOAOFOOA_S_DIS_CLASS_H */
|
#include <asm/syscall.h>
|
/* -*- buffer-read-only: t -*- vi: set ro: */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Tests of mkdir.
Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Eric Blake <ebb9@byu.net>, 2009. */
#include <config.h>
#include <sys/stat.h>
#include "signature.h"
SIGNATURE_CHECK (mkdir, int, (char const *, mode_t));
#include <fcntl.h>
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "ignore-value.h"
#include "macros.h"
#define BASE "test-mkdir.t"
#include "test-mkdir.h"
int
main (void)
{
/* Clean up any trash from prior testsuite runs. */
ignore_value (system ("rm -rf " BASE "*"));
return test_mkdir (mkdir, true);
}
|
extern
#ifdef __cplusplus
"C"
#endif
void abort (void);
#pragma omp declare reduction (foo: int: omp_out += omp_in - 1) initializer (omp_priv = 1)
int
main ()
{
int i, v = 0;
unsigned long long j;
volatile unsigned long long sixtyfour = 64;
int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0;
#pragma omp parallel
{
#define P(str) _Pragma (#str)
#define ONE_ORDERED_LOOP(var, i, max, n, clauses...) \
P (omp for ordered(1) reduction (task, foo: var) clauses) \
for (i = 1; i <= max; i++) \
{ \
P (omp task in_reduction (foo: var)) \
var++; \
P (omp ordered depend(sink: i - 1)) \
if (v++ != i + n - 1) \
abort (); \
_Pragma ("omp ordered depend(source)") \
var++; \
} \
if (var != 128 || v != 64 + n) \
abort (); \
_Pragma ("omp barrier")
ONE_ORDERED_LOOP (a, i, 64, 0, )
ONE_ORDERED_LOOP (b, i, 64, 64, schedule (monotonic: static))
ONE_ORDERED_LOOP (c, i, 64, 128, schedule (static, 1))
ONE_ORDERED_LOOP (d, i, 64, 192, schedule (monotonic: runtime))
ONE_ORDERED_LOOP (e, i, 64, 256, schedule (dynamic, 2))
ONE_ORDERED_LOOP (f, i, 64, 320, schedule (monotonic: guided, 3))
ONE_ORDERED_LOOP (g, i, 64, 384, schedule (auto))
#pragma omp single
{ v = 0; a = 0; b = 0; c = 0; d = 0; e = 0; f = 0; g = 0; }
ONE_ORDERED_LOOP (a, j, sixtyfour, 0, )
ONE_ORDERED_LOOP (b, j, sixtyfour, 64, schedule (static))
ONE_ORDERED_LOOP (c, j, sixtyfour, 128, schedule (monotonic: static, 1))
ONE_ORDERED_LOOP (d, j, sixtyfour, 192, schedule (runtime))
ONE_ORDERED_LOOP (e, j, sixtyfour, 256, schedule (monotonic: dynamic, 2))
ONE_ORDERED_LOOP (f, j, sixtyfour, 320, schedule (guided, 3))
ONE_ORDERED_LOOP (g, j, sixtyfour, 384, schedule (monotonic: auto))
}
return 0;
}
|
/* Test duplicating file descriptors.
Copyright (C) 2009-2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Eric Blake <ebb9@byu.net>, 2009. */
#include <config.h>
#include <unistd.h>
#include "signature.h"
SIGNATURE_CHECK (dup2, int, (int, int));
#include <errno.h>
#include <fcntl.h>
#if HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
#include "binary-io.h"
#if GNULIB_TEST_CLOEXEC
# include "cloexec.h"
#endif
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
/* Get _get_osfhandle. */
# include "msvc-nothrow.h"
#endif
#include "macros.h"
/* Return non-zero if FD is open. */
static int
is_open (int fd)
{
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* On native Windows, the initial state of unassigned standard file
descriptors is that they are open but point to an
INVALID_HANDLE_VALUE, and there is no fcntl. */
return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE;
#else
# ifndef F_GETFL
# error Please port fcntl to your platform
# endif
return 0 <= fcntl (fd, F_GETFL);
#endif
}
#if GNULIB_TEST_CLOEXEC
/* Return non-zero if FD is open and inheritable across exec/spawn. */
static int
is_inheritable (int fd)
{
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
/* On native Windows, the initial state of unassigned standard file
descriptors is that they are open but point to an
INVALID_HANDLE_VALUE, and there is no fcntl. */
HANDLE h = (HANDLE) _get_osfhandle (fd);
DWORD flags;
if (h == INVALID_HANDLE_VALUE || GetHandleInformation (h, &flags) == 0)
return 0;
return (flags & HANDLE_FLAG_INHERIT) != 0;
# else
# ifndef F_GETFD
# error Please port fcntl to your platform
# endif
int i = fcntl (fd, F_GETFD);
return 0 <= i && (i & FD_CLOEXEC) == 0;
# endif
}
#endif /* GNULIB_TEST_CLOEXEC */
#if !O_BINARY
# define setmode(f,m) zero ()
static int zero (void) { return 0; }
#endif
/* Return non-zero if FD is open in the given MODE, which is either
O_TEXT or O_BINARY. */
static int
is_mode (int fd, int mode)
{
int value = setmode (fd, O_BINARY);
setmode (fd, value);
return mode == value;
}
int
main (void)
{
const char *file = "test-dup2.tmp";
char buffer[1];
int bad_fd = getdtablesize ();
int fd = open (file, O_CREAT | O_TRUNC | O_RDWR, 0600);
/* Assume std descriptors were provided by invoker. */
ASSERT (STDERR_FILENO < fd);
ASSERT (is_open (fd));
/* Ignore any other fd's leaked into this process. */
close (fd + 1);
close (fd + 2);
ASSERT (!is_open (fd + 1));
ASSERT (!is_open (fd + 2));
/* Assigning to self must be a no-op. */
ASSERT (dup2 (fd, fd) == fd);
ASSERT (is_open (fd));
/* The source must be valid. */
errno = 0;
ASSERT (dup2 (-1, fd) == -1);
ASSERT (errno == EBADF);
close (99);
errno = 0;
ASSERT (dup2 (99, fd) == -1);
ASSERT (errno == EBADF);
errno = 0;
ASSERT (dup2 (AT_FDCWD, fd) == -1);
ASSERT (errno == EBADF);
ASSERT (is_open (fd));
/* If the source is not open, then the destination is unaffected. */
errno = 0;
ASSERT (dup2 (fd + 1, fd + 1) == -1);
ASSERT (errno == EBADF);
ASSERT (!is_open (fd + 1));
errno = 0;
ASSERT (dup2 (fd + 1, fd) == -1);
ASSERT (errno == EBADF);
ASSERT (is_open (fd));
/* The destination must be valid. */
errno = 0;
ASSERT (dup2 (fd, -2) == -1);
ASSERT (errno == EBADF);
if (bad_fd > 256)
{
ASSERT (dup2 (fd, 255) == 255);
ASSERT (dup2 (fd, 256) == 256);
ASSERT (close (255) == 0);
ASSERT (close (256) == 0);
}
ASSERT (dup2 (fd, bad_fd - 1) == bad_fd - 1);
ASSERT (close (bad_fd - 1) == 0);
errno = 0;
ASSERT (dup2 (fd, bad_fd) == -1);
ASSERT (errno == EBADF);
/* Using dup2 can skip fds. */
ASSERT (dup2 (fd, fd + 2) == fd + 2);
ASSERT (is_open (fd));
ASSERT (!is_open (fd + 1));
ASSERT (is_open (fd + 2));
/* Verify that dup2 closes the previous occupant of a fd. */
ASSERT (open ("/dev/null", O_WRONLY, 0600) == fd + 1);
ASSERT (dup2 (fd + 1, fd) == fd);
ASSERT (close (fd + 1) == 0);
ASSERT (write (fd, "1", 1) == 1);
ASSERT (dup2 (fd + 2, fd) == fd);
ASSERT (lseek (fd, 0, SEEK_END) == 0);
ASSERT (write (fd + 2, "2", 1) == 1);
ASSERT (lseek (fd, 0, SEEK_SET) == 0);
ASSERT (read (fd, buffer, 1) == 1);
ASSERT (*buffer == '2');
#if GNULIB_TEST_CLOEXEC
/* Any new fd created by dup2 must not be cloexec. */
ASSERT (close (fd + 2) == 0);
ASSERT (dup_cloexec (fd) == fd + 1);
ASSERT (!is_inheritable (fd + 1));
ASSERT (dup2 (fd + 1, fd + 1) == fd + 1);
ASSERT (!is_inheritable (fd + 1));
ASSERT (dup2 (fd + 1, fd + 2) == fd + 2);
ASSERT (!is_inheritable (fd + 1));
ASSERT (is_inheritable (fd + 2));
errno = 0;
ASSERT (dup2 (fd + 1, -1) == -1);
ASSERT (errno == EBADF);
ASSERT (!is_inheritable (fd + 1));
#endif
/* On systems that distinguish between text and binary mode, dup2
reuses the mode of the source. */
setmode (fd, O_BINARY);
ASSERT (is_mode (fd, O_BINARY));
ASSERT (dup2 (fd, fd + 1) == fd + 1);
ASSERT (is_mode (fd + 1, O_BINARY));
setmode (fd, O_TEXT);
ASSERT (is_mode (fd, O_TEXT));
ASSERT (dup2 (fd, fd + 1) == fd + 1);
ASSERT (is_mode (fd + 1, O_TEXT));
/* Clean up. */
ASSERT (close (fd + 2) == 0);
ASSERT (close (fd + 1) == 0);
ASSERT (close (fd) == 0);
ASSERT (unlink (file) == 0);
return 0;
}
|
/*
* File : toplevel.c
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rt-thread.org/license/LICENSE
*
* Change Logs:
* Date Author Notes
* 2009-10-16 Bernard first version
*/
#include <rtgui/rtgui_system.h>
#include <rtgui/widgets/toplevel.h>
#include <rtgui/widgets/window.h>
#include <rtgui/widgets/title.h>
static void _rtgui_toplevel_constructor(rtgui_toplevel_t *toplevel)
{
/* set event handler */
rtgui_object_set_event_handler(RTGUI_OBJECT(toplevel), rtgui_toplevel_event_handler);
/* set toplevel to self */
if (RTGUI_IS_WINTITLE(toplevel))
RTGUI_WIDGET(toplevel)->toplevel = (struct rtgui_win*)toplevel;
else
RTGUI_WIDGET(toplevel)->toplevel = RTGUI_WIN(toplevel);
/* init toplevel property */
toplevel->drawing = 0;
/* hide toplevel default */
RTGUI_WIDGET_HIDE(RTGUI_WIDGET(toplevel));
}
static void _rtgui_toplevel_destructor(rtgui_toplevel_t* toplevel)
{
/* release external clip info */
toplevel->drawing = 0;
}
DEFINE_CLASS_TYPE(toplevel, "toplevel",
RTGUI_CONTAINER_TYPE,
_rtgui_toplevel_constructor,
_rtgui_toplevel_destructor,
sizeof(struct rtgui_toplevel));
rt_bool_t rtgui_toplevel_event_handler(struct rtgui_object* object, rtgui_event_t* event)
{
struct rtgui_toplevel* toplevel;
RT_ASSERT(object != RT_NULL);
RT_ASSERT(event != RT_NULL);
toplevel = RTGUI_TOPLEVEL(object);
switch (event->type)
{
case RTGUI_EVENT_CLIP_INFO:
/* update toplevel clip */
rtgui_toplevel_update_clip(toplevel);
break;
case RTGUI_EVENT_COMMAND:
if (rtgui_container_dispatch_event(RTGUI_CONTAINER(object), event) != RT_TRUE)
{
#ifndef RTGUI_USING_SMALL_SIZE
if (RTGUI_WIDGET(object)->on_command != RT_NULL)
{
RTGUI_WIDGET(object)->on_command(object, event);
}
#endif
}
else return RT_TRUE;
break;
default :
return rtgui_container_event_handler(object, event);
}
return RT_FALSE;
}
void rtgui_toplevel_update_clip(rtgui_toplevel_t* top)
{
rtgui_container_t* view;
struct rtgui_list_node* node;
if (top == RT_NULL)
return;
/* update the clip info of each child */
view = RTGUI_CONTAINER(top);
rtgui_list_foreach(node, &(view->children))
{
rtgui_widget_t* child = rtgui_list_entry(node, rtgui_widget_t, sibling);
rtgui_widget_update_clip(child);
}
}
|
// @(#)root/roostats:$Id$
// Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke
/*************************************************************************
* Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOSTATS_TestStatistic
#define ROOSTATS_TestStatistic
#include "Rtypes.h"
class RooArgSet;
class RooAbsData;
namespace RooStats {
/** \class RooStats::TestStatistic
\ingroup Roostats
TestStatistic is an interface class to provide a facility for construction test statistics
distributions to the NeymanConstruction class. All the actual samplers inherit from this class.
*/
class TestStatistic {
public:
//TestStatistic();
virtual ~TestStatistic() {
}
/// Main interface to evaluate the test statistic on a dataset given the
/// values for the Null Parameters Of Interest.
virtual Double_t Evaluate(RooAbsData& data, RooArgSet& nullPOI) = 0;
virtual const TString GetVarName() const = 0;
/// Defines the sign convention of the test statistic. Overwrite function if necessary.
virtual bool PValueIsRightTail(void) const { return true; }
/// return detailed output: for fits this can be pulls, processing time, ... The returned pointer will not loose validity until another call to Evaluate.
virtual const RooArgSet* GetDetailedOutput() const { return NULL; }
protected:
ClassDef(TestStatistic,1) /// Interface for a TestStatistic
};
} // end namespace RooStats
#endif
|
/* Mersenne Twister pseudo-random number generator functions.
Copyright 2002, 2003, 2013, 2014 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library 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.
The GNU MP Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received copies of the GNU General Public License and the
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
#include "gmp-impl.h"
#include "randmt.h"
/* Calculate (b^e) mod (2^n-k) for e=1074888996, n=19937 and k=20023,
needed by the seeding function below. */
static void
mangle_seed (mpz_ptr r)
{
mpz_t t, b;
unsigned long e = 0x40118124;
unsigned long bit = 0x20000000;
mpz_init2 (t, 19937L);
mpz_init_set (b, r);
do
{
mpz_mul (r, r, r);
reduce:
for (;;)
{
mpz_tdiv_q_2exp (t, r, 19937L);
if (SIZ (t) == 0)
break;
mpz_tdiv_r_2exp (r, r, 19937L);
mpz_addmul_ui (r, t, 20023L);
}
if ((e & bit) != 0)
{
e ^= bit;
mpz_mul (r, r, b);
goto reduce;
}
bit >>= 1;
}
while (bit != 0);
mpz_clear (t);
mpz_clear (b);
}
/* Seeding function. Uses powering modulo a non-Mersenne prime to obtain
a permutation of the input seed space. The modulus is 2^19937-20023,
which is probably prime. The power is 1074888996. In order to avoid
seeds 0 and 1 generating invalid or strange output, the input seed is
first manipulated as follows:
seed1 = seed mod (2^19937-20027) + 2
so that seed1 lies between 2 and 2^19937-20026 inclusive. Then the
powering is performed as follows:
seed2 = (seed1^1074888996) mod (2^19937-20023)
and then seed2 is used to bootstrap the buffer.
This method aims to give guarantees that:
a) seed2 will never be zero,
b) seed2 will very seldom have a very low population of ones in its
binary representation, and
c) every seed between 0 and 2^19937-20028 (inclusive) will yield a
different sequence.
CAVEATS:
The period of the seeding function is 2^19937-20027. This means that
with seeds 2^19937-20027, 2^19937-20026, ... the exact same sequences
are obtained as with seeds 0, 1, etc.; it also means that seed -1
produces the same sequence as seed 2^19937-20028, etc.
*/
static void
randseed_mt (gmp_randstate_t rstate, mpz_srcptr seed)
{
int i;
size_t cnt;
gmp_rand_mt_struct *p;
mpz_t mod; /* Modulus. */
mpz_t seed1; /* Intermediate result. */
p = (gmp_rand_mt_struct *) RNG_STATE (rstate);
mpz_init2 (mod, 19938L);
mpz_init2 (seed1, 19937L);
mpz_setbit (mod, 19937L);
mpz_sub_ui (mod, mod, 20027L);
mpz_mod (seed1, seed, mod); /* Reduce `seed' modulo `mod'. */
mpz_clear (mod);
mpz_add_ui (seed1, seed1, 2L); /* seed1 is now ready. */
mangle_seed (seed1); /* Perform the mangling by powering. */
/* Copy the last bit into bit 31 of mt[0] and clear it. */
p->mt[0] = (mpz_tstbit (seed1, 19936L) != 0) ? 0x80000000 : 0;
mpz_clrbit (seed1, 19936L);
/* Split seed1 into N-1 32-bit chunks. */
mpz_export (&p->mt[1], &cnt, -1, sizeof (p->mt[1]), 0,
8 * sizeof (p->mt[1]) - 32, seed1);
mpz_clear (seed1);
cnt++;
ASSERT (cnt <= N);
while (cnt < N)
p->mt[cnt++] = 0;
/* Warm the generator up if necessary. */
if (WARM_UP != 0)
for (i = 0; i < WARM_UP / N; i++)
__gmp_mt_recalc_buffer (p->mt);
p->mti = WARM_UP % N;
}
static const gmp_randfnptr_t Mersenne_Twister_Generator = {
randseed_mt,
__gmp_randget_mt,
__gmp_randclear_mt,
__gmp_randiset_mt
};
/* Initialize MT-specific data. */
void
gmp_randinit_mt (gmp_randstate_t rstate)
{
__gmp_randinit_mt_noseed (rstate);
RNG_FNPTR (rstate) = (void *) &Mersenne_Twister_Generator;
}
|
/**************************************************
*
* This is a template for early application low-level initialization.
*
* Copyright 1996-2010 IAR Systems AB.
*
* $Revision: 5993 $
*
**************************************************/
/*
* The function __low_level_init it called by the start-up code before
* "main" is called, and before data segment initialization is
* performed.
*
* This is a template file, modify to perform any initialization that
* should take place early.
*
* The return value of this function controls if data segment
* initialization should take place. If 0 is returned, it is bypassed.
*
* For the MSP430 microcontroller family, please consider disabling
* the watchdog timer here, as it could time-out during the data
* segment initialization.
*/
/*
* To disable the watchdog timer, include a suitable device header
* file (or "msp430.h") and add the following line to the function
* below:
*
* WDTCTL = WDTPW+WDTHOLD;
*
*/
#include <intrinsics.h>
#include "msp430.h"
int __low_level_init(void)
{
/* Insert your low-level initializations here */
_DINT();
WDTCTL = WDTPW+WDTHOLD;
/*
* Return value:
*
* 1 - Perform data segment initialization.
* 0 - Skip data segment initialization.
*/
return 1;
}
|
/*
* Summary: regular expressions handling
* Description: basic API for libxml regular expressions handling used
* for XML Schemas and validation.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_REGEXP_H__
#define __XML_REGEXP_H__
#include "xmlversion.h"
#ifdef LIBXML_REGEXP_ENABLED
#ifdef __cplusplus
extern "C" {
#endif
/**
* xmlRegexpPtr:
*
* A libxml regular expression, they can actually be far more complex
* thank the POSIX regex expressions.
*/
typedef struct _xmlRegexp xmlRegexp;
typedef xmlRegexp *xmlRegexpPtr;
/**
* xmlRegExecCtxtPtr:
*
* A libxml progressive regular expression evaluation context
*/
typedef struct _xmlRegExecCtxt xmlRegExecCtxt;
typedef xmlRegExecCtxt *xmlRegExecCtxtPtr;
#ifdef __cplusplus
}
#endif
#include "tree.h"
#include "dict.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* The POSIX like API
*/
XMLPUBFUN xmlRegexpPtr XMLCALL
xmlRegexpCompile (const xmlChar *regexp);
XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp);
XMLPUBFUN int XMLCALL
xmlRegexpExec (xmlRegexpPtr comp,
const xmlChar *value);
XMLPUBFUN void XMLCALL
xmlRegexpPrint (FILE *output,
xmlRegexpPtr regexp);
XMLPUBFUN int XMLCALL
xmlRegexpIsDeterminist(xmlRegexpPtr comp);
/**
* xmlRegExecCallbacks:
* @exec: the regular expression context
* @token: the current token string
* @transdata: transition data
* @inputdata: input data
*
* Callback function when doing a transition in the automata
*/
typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
const xmlChar *token,
void *transdata,
void *inputdata);
/*
* The progressive API
*/
XMLPUBFUN xmlRegExecCtxtPtr XMLCALL
xmlRegNewExecCtxt (xmlRegexpPtr comp,
xmlRegExecCallbacks callback,
void *data);
XMLPUBFUN void XMLCALL
xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
XMLPUBFUN int XMLCALL
xmlRegExecPushString(xmlRegExecCtxtPtr exec,
const xmlChar *value,
void *data);
XMLPUBFUN int XMLCALL
xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
const xmlChar *value,
const xmlChar *value2,
void *data);
XMLPUBFUN int XMLCALL
xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
int *nbval,
int *nbneg,
xmlChar **values,
int *terminal);
XMLPUBFUN int XMLCALL
xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
const xmlChar **string,
int *nbval,
int *nbneg,
xmlChar **values,
int *terminal);
#ifdef LIBXML_EXPR_ENABLED
/*
* Formal regular expression handling
* Its goal is to do some formal work on content models
*/
/* expressions are used within a context */
typedef struct _xmlExpCtxt xmlExpCtxt;
typedef xmlExpCtxt *xmlExpCtxtPtr;
XMLPUBFUN void XMLCALL
xmlExpFreeCtxt (xmlExpCtxtPtr ctxt);
XMLPUBFUN xmlExpCtxtPtr XMLCALL
xmlExpNewCtxt (int maxNodes,
xmlDictPtr dict);
XMLPUBFUN int XMLCALL
xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
XMLPUBFUN int XMLCALL
xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
/* Expressions are trees but the tree is opaque */
typedef struct _xmlExpNode xmlExpNode;
typedef xmlExpNode *xmlExpNodePtr;
typedef enum {
XML_EXP_EMPTY = 0,
XML_EXP_FORBID = 1,
XML_EXP_ATOM = 2,
XML_EXP_SEQ = 3,
XML_EXP_OR = 4,
XML_EXP_COUNT = 5
} xmlExpNodeType;
/*
* 2 core expressions shared by all for the empty language set
* and for the set with just the empty token
*/
XMLPUBVAR xmlExpNodePtr forbiddenExp;
XMLPUBVAR xmlExpNodePtr emptyExp;
/*
* Expressions are reference counted internally
*/
XMLPUBFUN void XMLCALL
xmlExpFree (xmlExpCtxtPtr ctxt,
xmlExpNodePtr expr);
XMLPUBFUN void XMLCALL
xmlExpRef (xmlExpNodePtr expr);
/*
* constructors can be either manual or from a string
*/
XMLPUBFUN xmlExpNodePtr XMLCALL
xmlExpParse (xmlExpCtxtPtr ctxt,
const char *expr);
XMLPUBFUN xmlExpNodePtr XMLCALL
xmlExpNewAtom (xmlExpCtxtPtr ctxt,
const xmlChar *name,
int len);
XMLPUBFUN xmlExpNodePtr XMLCALL
xmlExpNewOr (xmlExpCtxtPtr ctxt,
xmlExpNodePtr left,
xmlExpNodePtr right);
XMLPUBFUN xmlExpNodePtr XMLCALL
xmlExpNewSeq (xmlExpCtxtPtr ctxt,
xmlExpNodePtr left,
xmlExpNodePtr right);
XMLPUBFUN xmlExpNodePtr XMLCALL
xmlExpNewRange (xmlExpCtxtPtr ctxt,
xmlExpNodePtr subset,
int min,
int max);
/*
* The really interesting APIs
*/
XMLPUBFUN int XMLCALL
xmlExpIsNillable(xmlExpNodePtr expr);
XMLPUBFUN int XMLCALL
xmlExpMaxToken (xmlExpNodePtr expr);
XMLPUBFUN int XMLCALL
xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
xmlExpNodePtr expr,
const xmlChar**langList,
int len);
XMLPUBFUN int XMLCALL
xmlExpGetStart (xmlExpCtxtPtr ctxt,
xmlExpNodePtr expr,
const xmlChar**tokList,
int len);
XMLPUBFUN xmlExpNodePtr XMLCALL
xmlExpStringDerive(xmlExpCtxtPtr ctxt,
xmlExpNodePtr expr,
const xmlChar *str,
int len);
XMLPUBFUN xmlExpNodePtr XMLCALL
xmlExpExpDerive (xmlExpCtxtPtr ctxt,
xmlExpNodePtr expr,
xmlExpNodePtr sub);
XMLPUBFUN int XMLCALL
xmlExpSubsume (xmlExpCtxtPtr ctxt,
xmlExpNodePtr expr,
xmlExpNodePtr sub);
XMLPUBFUN void XMLCALL
xmlExpDump (xmlBufferPtr buf,
xmlExpNodePtr expr);
#endif /* LIBXML_EXPR_ENABLED */
#ifdef __cplusplus
}
#endif
#endif /* LIBXML_REGEXP_ENABLED */
#endif /*__XML_REGEXP_H__ */
|
// Copyright 2006-2008 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 MINI_CHROMIUM_BASE_MAC_SCOPED_NSOBJECT_H_
#define MINI_CHROMIUM_BASE_MAC_SCOPED_NSOBJECT_H_
#import <Foundation/Foundation.h>
#include <type_traits>
#include "base/compiler_specific.h"
#include "base/mac/scoped_typeref.h"
namespace base {
namespace internal {
template <typename NST>
struct ScopedNSProtocolTraits {
static NST InvalidValue() { return nil; }
static NST Retain(NST nst) { return [nst retain]; }
static void Release(NST nst) { [nst release]; }
};
} // namespace internal
template <typename NST>
class scoped_nsprotocol
: public ScopedTypeRef<NST, internal::ScopedNSProtocolTraits<NST>> {
public:
using ScopedTypeRef<NST,
internal::ScopedNSProtocolTraits<NST>>::ScopedTypeRef;
NST autorelease() { return [this->release() autorelease]; }
};
template <class C>
void swap(scoped_nsprotocol<C>& p1, scoped_nsprotocol<C>& p2) {
p1.swap(p2);
}
template <class C>
bool operator==(C p1, const scoped_nsprotocol<C>& p2) {
return p1 == p2.get();
}
template <class C>
bool operator!=(C p1, const scoped_nsprotocol<C>& p2) {
return p1 != p2.get();
}
template <typename NST>
class scoped_nsobject : public scoped_nsprotocol<NST*> {
public:
using scoped_nsprotocol<NST*>::scoped_nsprotocol;
static_assert(std::is_same<NST, NSAutoreleasePool>::value == false,
"Use ScopedNSAutoreleasePool instead");
};
template<>
class scoped_nsobject<id> : public scoped_nsprotocol<id> {
public:
using scoped_nsprotocol<id>::scoped_nsprotocol;
};
} // namespace base
#endif // MINI_CHROMIUM_BASE_MAC_SCOPED_NSOBJECT_H_
|
/*
* (C) Copyright 2003
* Texas Instruments.
* Kshitij Gupta <kshitij@ti.com>
* Configuation settings for the TI OMAP Innovator board.
*
* (C) Copyright 2004
* ARM Ltd.
* Philippe Robin, <philippe.robin@arm.com>
* Configuration for Integrator AP board.
*.
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#ifndef __CONFIG_H
#define __CONFIG_H
#define CONFIG_INTEGRATOR
#define CONFIG_ARCH_INTEGRATOR
/*
* High Level Configuration Options
* (easy to change)
*/
#define CONFIG_SYS_TEXT_BASE 0x01000000
#define CONFIG_SYS_MEMTEST_START 0x100000
#define CONFIG_SYS_MEMTEST_END 0x10000000
#define CONFIG_SYS_HZ 1000
#define CONFIG_SYS_HZ_CLOCK 24000000 /* Timer 1 is clocked at 24Mhz */
#define CONFIG_SYS_TIMERBASE 0x13000100 /* Timer1 */
#define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */
#define CONFIG_SETUP_MEMORY_TAGS 1
#define CONFIG_MISC_INIT_R 1 /* call misc_init_r during start up */
#define CONFIG_SKIP_LOWLEVEL_INIT
#define CONFIG_CM_INIT 1
#define CONFIG_CM_REMAP 1
#define CONFIG_CM_SPD_DETECT
/*
* Size of malloc() pool
*/
#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024)
/*
* PL010 Configuration
*/
#define CONFIG_PL010_SERIAL
#define CONFIG_CONS_INDEX 0
#define CONFIG_BAUDRATE 38400
#define CONFIG_PL01x_PORTS { (void *) (CONFIG_SYS_SERIAL0), (void *) (CONFIG_SYS_SERIAL1) }
#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
#define CONFIG_SYS_SERIAL0 0x16000000
#define CONFIG_SYS_SERIAL1 0x17000000
/*
* BOOTP options
*/
#define CONFIG_BOOTP_BOOTFILESIZE
#define CONFIG_BOOTP_BOOTPATH
#define CONFIG_BOOTP_GATEWAY
#define CONFIG_BOOTP_HOSTNAME
/*
* Command line configuration.
*/
#include <config_cmd_default.h>
#define CONFIG_BOOTDELAY 2
#define CONFIG_BOOTARGS "root=/dev/mtdblock0 console=ttyAM0 console=tty"
#define CONFIG_BOOTCOMMAND ""
/*
* Miscellaneous configurable options
*/
#define CONFIG_SYS_LONGHELP /* undef to save memory */
#define CONFIG_SYS_HUSH_PARSER
#define CONFIG_SYS_PROMPT "Integrator-AP # " /* Monitor Command Prompt */
#define CONFIG_SYS_PROMPT_HUSH_PS2 "# "
#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
/* Print Buffer Size */
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
#define CONFIG_SYS_LOAD_ADDR 0x7fc0 /* default load address */
/*-----------------------------------------------------------------------
* Stack sizes
*
* The stack sizes are set up in start.S using the settings below
*/
#define CONFIG_STACKSIZE (128*1024) /* regular stack */
#ifdef CONFIG_USE_IRQ
#define CONFIG_STACKSIZE_IRQ (4*1024) /* IRQ stack */
#define CONFIG_STACKSIZE_FIQ (4*1024) /* FIQ stack */
#endif
/*-----------------------------------------------------------------------
* Physical Memory Map
*/
#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
#define PHYS_SDRAM_1 0x00000000 /* SDRAM Bank #1 */
#define PHYS_SDRAM_1_SIZE 0x02000000 /* 32 MB */
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
#define CONFIG_SYS_INIT_RAM_SIZE PHYS_SDRAM_1_SIZE
#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_SDRAM_BASE + \
CONFIG_SYS_INIT_RAM_SIZE - \
GENERATED_GBL_DATA_SIZE)
#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_GBL_DATA_OFFSET
#define CONFIG_SYS_FLASH_BASE 0x24000000
/*-----------------------------------------------------------------------
* FLASH and environment organization
*/
#define CONFIG_SYS_FLASH_CFI 1
#define CONFIG_FLASH_CFI_DRIVER 1
#define CONFIG_ENV_IS_NOWHERE
#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max number of memory banks */
/* timeout values are in ticks */
#define CONFIG_SYS_FLASH_ERASE_TOUT (2*CONFIG_SYS_HZ) /* Timeout for Flash Erase */
#define CONFIG_SYS_FLASH_WRITE_TOUT (2*CONFIG_SYS_HZ) /* Timeout for Flash Write */
#define CONFIG_SYS_MAX_FLASH_SECT 128
#define CONFIG_ENV_SIZE 32768
/*-----------------------------------------------------------------------
* PCI definitions
*/
#define CONFIG_PCI
#define CONFIG_CMD_PCI
#define CONFIG_PCI_PNP
#define CONFIG_NET_MULTI
#define CONFIG_TULIP
#define CONFIG_EEPRO100
#define CONFIG_SYS_RX_ETH_BUFFER 8 /* use 8 rx buffer on eepro100 */
/*-----------------------------------------------------------------------
* There are various dependencies on the core module (CM) fitted
* Users should refer to their CM user guide
* - when porting adjust u-boot/Makefile accordingly
* to define the necessary CONFIG_ s for the CM involved
* see e.g. integratorcp_CM926EJ-S_config
*/
#include "armcoremodule.h"
#endif /* __CONFIG_H */
|
/************************************************************************************
* configs/qemu-i486/include/board.h
* include/arch/board/board.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
#ifndef _CONFIGS_QEMU_I486_INCLUDE_BOARD_H
#define _CONFIGS_QEMU_I486_INCLUDE_BOARD_H
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
/************************************************************************************
* Definitions
************************************************************************************/
/* Clocking *************************************************************************/
/* Programmable interval timer (PIT) */
#define PIT_CLOCK 1041816 /* PIT input clock */
/* LED definitions ******************************************************************/
/* Button definitions ***************************************************************/
/* Alternate pin selections *********************************************************/
/************************************************************************************
* Public Types
************************************************************************************/
#ifndef __ASSEMBLY__
/************************************************************************************
* Public Data
************************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
#else
#define EXTERN extern
#endif
/************************************************************************************
* Public Function Prototypes
************************************************************************************/
/************************************************************************************
* Name: up_boardinitialize
*
* Description:
* All x86 architectures must provide the following entry point. This entry point
* is called early in the intitialization -- after all memory has been configured
* and mapped but before any devices have been initialized.
*
************************************************************************************/
EXTERN void up_boardinitialize(void);
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* _CONFIGS_QEMU_I486_INCLUDE_BOARD_H */
|
/*
* Copyright (c) 2011-2014, Intel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 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.
*/
#pragma once
#define SYNC_WORD 0xBABE
enum RemoteProtocolMsgType
{
ECommandRequest,
ESuccessAnswer,
EFailureAnswer
};
|
/*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas at Austin
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas at Austin nor the names
of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
void bli_packm_unb_var1
(
obj_t* c,
obj_t* p,
cntx_t* cntx,
cntl_t* cntl,
thrinfo_t* thread
);
#undef GENTPROT
#define GENTPROT( ctype, ch, varname ) \
\
void PASTEMAC(ch,varname) \
( \
struc_t strucc, \
doff_t diagoffc, \
diag_t diagc, \
uplo_t uploc, \
trans_t transc, \
dim_t m, \
dim_t n, \
dim_t m_max, \
dim_t n_max, \
void* kappa, \
void* c, inc_t rs_c, inc_t cs_c, \
void* p, inc_t rs_p, inc_t cs_p, \
cntx_t* cntx \
);
INSERT_GENTPROT_BASIC( packm_unb_var1 )
|
#include <stdlib.h>
#include <malloc.h>
#include <loader/elfloader-arch-otf.h>
#if 0
#include <stdio.h>
#define PRINTF(...) printf(__VA_ARGS__)
#else
#define PRINTF(...) do {} while (0)
#endif
#define ELF32_R_TYPE(info) ((unsigned char)(info))
/* Supported relocations */
#define R_ARM_ABS32 2
#define R_ARM_THM_CALL 10
/* Adapted from elfloader-avr.c */
int
elfloader_arch_relocate(int input_fd,
struct elfloader_output *output,
unsigned int sectionoffset,
char *sectionaddr,
struct elf32_rela *rela, char *addr)
{
unsigned int type;
type = ELF32_R_TYPE(rela->r_info);
cfs_seek(input_fd, sectionoffset + rela->r_offset, CFS_SEEK_SET);
/* PRINTF("elfloader_arch_relocate: type %d\n", type); */
/* PRINTF("Addr: %p, Addend: %ld\n", addr, rela->r_addend); */
switch(type) {
case R_ARM_ABS32:
{
int32_t addend;
cfs_read(input_fd, (char*)&addend, 4);
addr += addend;
elfloader_output_write_segment(output,(char*) &addr, 4);
PRINTF("%p: addr: %p\n", sectionaddr +rela->r_offset,
addr);
}
break;
case R_ARM_THM_CALL:
{
uint16_t instr[2];
int32_t offset;
char *base;
cfs_read(input_fd, (char*)instr, 4);
/* Ignore the addend since it will be zero for calls to symbols,
and I can't think of a case when doing a relative call to
a non-symbol position */
base = sectionaddr + (rela->r_offset + 4);
if (((instr[1]) & 0xe800) == 0xe800) {
/* BL or BLX */
if (((uint32_t)addr) & 0x1) {
/* BL */
instr[1] |= 0x1800;
} else {
#if defined(__ARM_ARCH_4T__)
return ELFLOADER_UNHANDLED_RELOC;
#else
/* BLX */
instr[1] &= ~0x1800;
instr[1] |= 0x0800;
#endif
}
}
/* Adjust address for BLX */
if ((instr[1] & 0x1800) == 0x0800) {
addr = (char*)((((uint32_t)addr) & 0xfffffffd)
| (((uint32_t)base) & 0x00000002));
}
offset = addr - (sectionaddr + (rela->r_offset + 4));
if (offset < -(1<<22) || offset >= (1<<22)) {
PRINTF("elfloader-arm.c: offset %d too large for relative call\n",
(int)offset);
}
/* PRINTF("%p: %04x %04x offset: %d addr: %p\n", sectionaddr +rela->r_offset, instr[0], instr[1], (int)offset, addr); */
instr[0] = (instr[0] & 0xf800) | ((offset>>12)&0x07ff);
instr[1] = (instr[1] & 0xf800) | ((offset>>1)&0x07ff);
elfloader_output_write_segment(output, (char*)instr, 4);
/* PRINTF("cfs_write: %04x %04x\n",instr[0], instr[1]); */
}
break;
default:
PRINTF("elfloader-arm.c: unsupported relocation type %d\n", type);
return ELFLOADER_UNHANDLED_RELOC;
}
return ELFLOADER_OK;
}
|
/* Define and initialize the `__libc_enable_secure' flag. Hurd version.
Copyright (C) 1998-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
/* There is no need for this file in the Hurd; it is just a placeholder
to prevent inclusion of the sysdeps/generic version.
In the shared library, the `__libc_enable_secure' variable is defined
by the dynamic linker in dl-sysdep.c and set there.
In the static library, it is defined in init-first.c and set there. */
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef TOLTECS_H
#define TOLTECS_H
#include "common/scummsys.h"
#include "common/endian.h"
#include "common/events.h"
#include "common/file.h"
#include "common/keyboard.h"
#include "common/random.h"
#include "common/textconsole.h"
#include "engines/engine.h"
#include "graphics/surface.h"
#include "gui/debugger.h"
#include "toltecs/console.h"
namespace Toltecs {
struct ToltecsGameDescription;
class AnimationPlayer;
class ArchiveReader;
class Input;
class MenuSystem;
class MoviePlayer;
class Music;
class Palette;
class ResourceCache;
class ScriptInterpreter;
class Screen;
class SegmentMap;
class Sound;
enum SysString {
kStrLoadingPleaseWait,
kStrWhatCanIDoForYou,
kStrLoad,
kStrSave,
kStrTextOn,
kStrTextOff,
kStrVoicesOn,
kStrVoicesOff,
kStrVolume,
kStrPlay,
kStrQuit,
kStrLoadGame,
kStrSaveGame,
kStrAdjustVolume,
kStrMaster,
kStrVoices,
kStrMusic,
kStrSoundFx,
kStrBackground,
kStrCancel,
kStrDone,
kStrAreYouSure,
kStrYes,
kStrNo,
kSysStrCount
};
enum MenuID {
kMenuIdNone,
kMenuIdMain,
kMenuIdSave,
kMenuIdLoad,
kMenuIdVolumes
};
class ToltecsEngine : public ::Engine {
Common::KeyState _keyPressed;
protected:
Common::Error run();
// void shutdown();
public:
ToltecsEngine(OSystem *syst, const ToltecsGameDescription *gameDesc);
virtual ~ToltecsEngine();
virtual bool hasFeature(EngineFeature f) const;
Common::RandomSource *_rnd;
const ToltecsGameDescription *_gameDescription;
uint32 getFeatures() const;
Common::Language getLanguage() const;
const Common::String& getTargetName() const { return _targetName; }
void syncSoundSettings();
GUI::Debugger *getDebugger() { return _console; }
void setupSysStrings();
void requestSavegame(int slotNum, Common::String &description);
void requestLoadgame(int slotNum);
void loadScene(uint resIndex);
void updateScreen();
void drawScreen();
void updateInput();
void setGuiHeight(int16 guiHeight);
void setCamera(int16 x, int16 y);
bool getCameraChanged();
void scrollCameraUp(int16 delta);
void scrollCameraDown(int16 delta);
void scrollCameraLeft(int16 delta);
void scrollCameraRight(int16 delta);
void updateCamera();
void showMenu(MenuID menuId);
void talk(int16 slotIndex, int16 slotOffset);
void walk(byte *walkData);
int16 findRectAtPoint(byte *rectData, int16 x, int16 y, int16 index, int16 itemSize,
byte *rectDataEnd);
int _cfgVoicesVolume, _cfgMusicVolume, _cfgSoundFXVolume;
bool _cfgText, _cfgVoices;
public:
AnimationPlayer *_anim;
ArchiveReader *_arc;
Console *_console;
Input *_input;
MenuSystem *_menuSystem;
MoviePlayer *_moviePlayer;
Music *_music;
Palette *_palette;
ResourceCache *_res;
ScriptInterpreter *_script;
Screen *_screen;
SegmentMap *_segmap;
Sound *_sound;
Common::String _sysStrings[kSysStrCount];
int _saveLoadRequested;
int _saveLoadSlot;
Common::String _saveLoadDescription;
uint _sceneResIndex;
int16 _sceneWidth, _sceneHeight;
int _counter01, _counter02;
bool _movieSceneFlag;
byte _flag01;
int16 _cameraX, _cameraY;
int16 _newCameraX, _newCameraY;
int16 _cameraHeight;
int16 _guiHeight;
bool _doSpeech, _doText;
int16 _walkSpeedY, _walkSpeedX;
Common::KeyState _keyState;
int16 _mouseX, _mouseY;
int16 _mouseDblClickTicks;
bool _mouseWaitForRelease;
byte _mouseButton;
int16 _mouseDisabled;
bool _leftButtonDown, _rightButtonDown;
const char *getSysString(int index) const { return _sysStrings[index].c_str(); }
/* Save/load */
enum kReadSaveHeaderError {
kRSHENoError = 0,
kRSHEInvalidType = 1,
kRSHEInvalidVersion = 2,
kRSHEIoError = 3
};
struct SaveHeader {
Common::String description;
uint32 version;
byte gameID;
uint32 flags;
uint32 saveDate;
uint32 saveTime;
uint32 playTime;
Graphics::Surface *thumbnail;
};
bool _isSaveAllowed;
bool canLoadGameStateCurrently() { return _isSaveAllowed; }
bool canSaveGameStateCurrently() { return _isSaveAllowed; }
Common::Error loadGameState(int slot);
Common::Error saveGameState(int slot, const Common::String &description);
void savegame(const char *filename, const char *description);
void loadgame(const char *filename);
const char *getSavegameFilename(int num);
static Common::String getSavegameFilename(const Common::String &target, int num);
static kReadSaveHeaderError readSaveHeader(Common::SeekableReadStream *in, bool loadThumbnail, SaveHeader &header);
};
} // End of namespace Toltecs
#endif /* TOLTECS_H */
|
/*
* Copyright (C) 2007 Google, Inc.
* Author: Brian Swetland <swetland@google.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 __LINUX_USB_GADGET_MSM72K_UDC_H__
#define __LINUX_USB_GADGET_MSM72K_UDC_H__
#define USB_AHBBURST (MSM_USB_BASE + 0x0090)
#define USB_AHBMODE (MSM_USB_BASE + 0x0098)
#define USB_CAPLENGTH (MSM_USB_BASE + 0x0100) /* 8 bit */
#define USB_USBCMD (MSM_USB_BASE + 0x0140)
#define USB_USBSTS (MSM_USB_BASE + 0x0144)
#define USB_PORTSC (MSM_USB_BASE + 0x0184)
#define USB_OTGSC (MSM_USB_BASE + 0x01A4)
#define USB_USBMODE (MSM_USB_BASE + 0x01A8)
#define USB_PHY_CTRL (MSM_USB_BASE + 0x0240)
#define USBCMD_RESET 2
#define USB_USBINTR (MSM_USB_BASE + 0x0148)
#define PORTSC_PHCD (1 << 23) /* phy suspend mode */
#define PORTSC_PTS_MASK (3 << 30)
#define PORTSC_PTS_ULPI (3 << 30)
#define PORTSC_CSC (1 << 1)
#define PORTSC_CCS (1 << 0)
#define USB_ULPI_VIEWPORT (MSM_USB_BASE + 0x0170)
#define ULPI_RUN (1 << 30)
#define ULPI_WRITE (1 << 29)
#define ULPI_READ (0 << 29)
#define ULPI_SYNC_STATE (1 << 27)
#define ULPI_ADDR(n) (((n) & 255) << 16)
#define ULPI_DATA(n) ((n) & 255)
#define ULPI_DATA_READ(n) (((n) >> 8) & 255)
/* synopsys 28nm phy registers */
#define ULPI_PWR_CLK_MNG_REG 0x88
#define OTG_COMP_DISABLE BIT(0)
#define PHY_ALT_INT (1 << 28) /* PHY alternate interrupt */
#define ASYNC_INTR_CTRL (1 << 29) /* Enable async interrupt */
#define ULPI_STP_CTRL (1 << 30) /* Block communication with PHY */
#define PHY_RETEN (1 << 1) /* PHY retention enable/disable */
#define PHY_IDHV_INTEN (1 << 8) /* PHY ID HV interrupt */
#define PHY_OTGSESSVLDHV_INTEN (1 << 9) /* PHY Session Valid HV int. */
#define STS_PCI (1 << 2) /* R/WC - Port Change Detect */
#define STS_URI (1 << 6) /* R/WC - RESET recv'd */
#define STS_SLI (1 << 8) /* R/WC - suspend state entered */
/* OTG definitions */
#define OTGSC_INTSTS_MASK (0x7f << 16)
#define OTGSC_IDPU (1 << 5)
#define OTGSC_INTR_MASK (0x7f << 24)
#define OTGSC_HADP (1 << 6)
#define OTGSC_ID (1 << 8)
#define OTGSC_BSV (1 << 11)
#define OTGSC_IDIS (1 << 16)
#define OTGSC_BSVIS (1 << 19)
#define OTGSC_IDIE (1 << 24)
#define OTGSC_BSVIE (1 << 27)
#define OTGSC_DPIE (1 << 30)
#define OTGSC_DPIS (1 << 22)
/* OTG interrupt status mask */
#define OTG_USBSTS_MASK (STS_PCI | STS_URI | STS_SLI | PHY_ALT_INT)
#define OTG_OTGSTS_MASK (OTGSC_IDIS | OTGSC_BSVIS | OTGSC_DPIS)
#endif /* __LINUX_USB_GADGET_MSM72K_UDC_H__ */
|
/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <bits/libc-lock.h>
#include <gshadow.h>
#include <stdio.h>
#include <stdlib.h>
/* A reasonable size for a buffer to start with. */
#define BUFLEN_SPWD 1024
/* We need to protect the dynamic buffer handling. */
__libc_lock_define_initialized (static, lock);
libc_freeres_ptr (static char *buffer);
/* Read one shadow entry from the given stream. */
struct sgrp *
fgetsgent (FILE *stream)
{
static size_t buffer_size;
static struct sgrp resbuf;
fpos_t pos;
struct sgrp *result;
int save;
if (fgetpos (stream, &pos) != 0)
return NULL;
/* Get lock. */
__libc_lock_lock (lock);
/* Allocate buffer if not yet available. */
if (buffer == NULL)
{
buffer_size = BUFLEN_SPWD;
buffer = malloc (buffer_size);
}
while (buffer != NULL
&& (__fgetsgent_r (stream, &resbuf, buffer, buffer_size, &result)
== ERANGE))
{
char *new_buf;
buffer_size += BUFLEN_SPWD;
new_buf = realloc (buffer, buffer_size);
if (new_buf == NULL)
{
/* We are out of memory. Free the current buffer so that the
process gets a chance for a normal termination. */
save = errno;
free (buffer);
__set_errno (save);
}
buffer = new_buf;
/* Reset the stream. */
if (fsetpos (stream, &pos) != 0)
buffer = NULL;
}
if (buffer == NULL)
result = NULL;
/* Release lock. Preserve error value. */
save = errno;
__libc_lock_unlock (lock);
__set_errno (save);
return result;
}
|
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// TextInputController is bound to window.textInputController in Javascript
// when DRT is running. Layout tests use it to exercise various corners of
// text input.
#ifndef TextInputController_h
#define TextInputController_h
#include "CppBoundClass.h"
class TestShell;
namespace WebKit {
class WebFrame;
}
class TextInputController : public CppBoundClass {
public:
TextInputController(TestShell*);
void insertText(const CppArgumentList&, CppVariant*);
void doCommand(const CppArgumentList&, CppVariant*);
void setMarkedText(const CppArgumentList&, CppVariant*);
void unmarkText(const CppArgumentList&, CppVariant*);
void hasMarkedText(const CppArgumentList&, CppVariant*);
void conversationIdentifier(const CppArgumentList&, CppVariant*);
void substringFromRange(const CppArgumentList&, CppVariant*);
void attributedSubstringFromRange(const CppArgumentList&, CppVariant*);
void markedRange(const CppArgumentList&, CppVariant*);
void selectedRange(const CppArgumentList&, CppVariant*);
void firstRectForCharacterRange(const CppArgumentList&, CppVariant*);
void characterIndexForPoint(const CppArgumentList&, CppVariant*);
void validAttributesForMarkedText(const CppArgumentList&, CppVariant*);
void makeAttributedString(const CppArgumentList&, CppVariant*);
void setComposition(const CppArgumentList&, CppVariant*);
private:
// Returns the test shell's main WebFrame.
static WebKit::WebFrame* getMainFrame();
// Non-owning pointer. The TextInputController is owned by the TestShell.
static TestShell* testShell;
};
#endif // TextInputController_h
|
/* gmpstat.h */
/*
Copyright 1999 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP 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 MP 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 MP 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.
*/
/* This file requires the following header files: mpir.h */
#ifndef __GMPSTAT_H__
#define __GMPSTAT_H__
/* Global debug flag. FIXME: Remove. */
extern int g_debug;
#define DEBUG_1 0
#define DEBUG_2 1
/* Max number of dimensions in spectral test. FIXME: Makw dynamic. */
#define GMP_SPECT_MAXT 10
void
mpf_freqt (mpf_t Kp,
mpf_t Km,
mpf_t X[],
const unsigned long int n);
unsigned long int
mpz_freqt (mpf_t V,
mpz_t X[],
unsigned int imax,
const unsigned long int n);
/* Low level functions. */
void
ks (mpf_t Kp,
mpf_t Km,
mpf_t X[],
void (P) (mpf_t, mpf_t),
const unsigned long int n);
void
ks_table (mpf_t p, mpf_t val, const unsigned int n);
void
x2_table (double t[],
unsigned int v);
void
spectral_test (mpf_t rop[], unsigned int T, mpz_t a, mpz_t m);
void
vz_dot (mpz_t rop, mpz_t V1[], mpz_t V2[], unsigned int n);
void
f_floor (mpf_t rop, mpf_t op);
void
merit (mpf_t rop, unsigned int t, mpf_t v, mpz_t m);
double
merit_u (unsigned int t, mpf_t v, mpz_t m);
/* From separate source files: */
void zdiv_round (mpz_t rop, mpz_t n, mpz_t d);
#endif /* !__GMPSTAT_H__ */
|
/* 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_XLA_CLIENT_LIB_LU_DECOMPOSITION_H_
#define TENSORFLOW_COMPILER_XLA_CLIENT_LIB_LU_DECOMPOSITION_H_
#include "tensorflow/compiler/xla/client/xla_builder.h"
#include "tensorflow/compiler/xla/xla_data.pb.h"
namespace xla {
// Computes the LU decomposition with partial pivoting of a batch of matrices.
//
// Given a (batched) matrix a with shape [..., m, n], computes the matrix
// decomposition A = P @ L @ U where P is a permutation matrix, L is a
// lower-triangular matrix with unit diagonal entries, and U is an
// upper-triangular matrix.
//
// L and U are returned as a single matrix [..., m, n] containing both L and U
// packed in the same array. The unit diagonal of L is not represented
// explicitly.
//
// The permutation matrix P is returned in two forms, both as `pivots`, which is
// an s32[..., min(m, n)] array that describes a sequence of row-swaps in the
// style of LAPACK's xGETRF API, and `permutation`, which is a s32[..., m] array
// which gives the permutation to apply to the rows. We return both
// representations because they are each useful for different purposes; `pivots`
// is useful for computing the sign of a determinant, whereas `permutation` can
// be used via a Gather operation to permute the rows of a matrix.
//
// This method is only implemented on TPU at the moment.
// TODO(b/168208200): the implementation only supports F32 arrays. Handle the
// complex case.
struct LuDecompositionResult {
// The LU decomposition, with both L and U packed into an array with shape
// [..., m, n].
XlaOp lu;
// An array of shape s32[..., min(m, n)] containing the pivot rows.
XlaOp pivots;
// An array of shape s32[..., m], containing an another representation of the
// pivots as a permutation.
XlaOp permutation;
};
LuDecompositionResult LuDecomposition(XlaOp a);
} // namespace xla
#endif // TENSORFLOW_COMPILER_XLA_CLIENT_LIB_LU_DECOMPOSITION_H_
|
// Copyright 2013 Google 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.
//
// File IO helpers.
#ifndef WOFF2_FILE_H_
#define WOFF2_FILE_H_
#include <fstream>
#include <iterator>
namespace woff2 {
using std::string;
inline string GetFileContent(string filename) {
std::ifstream ifs(filename.c_str(), std::ios::binary);
return string(
std::istreambuf_iterator<char>(ifs.rdbuf()),
std::istreambuf_iterator<char>());
}
inline void SetFileContents(string filename, string::iterator start,
string::iterator end) {
std::ofstream ofs(filename.c_str(), std::ios::binary);
std::copy(start, end, std::ostream_iterator<char>(ofs));
}
} // namespace woff2
#endif // WOFF2_FILE_H_
|
//******************************************************************************
//
// Copyright (c) 2016 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//******************************************************************************
#pragma once
#ifndef MAPKIT_IMPEXP
#define MAPKIT_IMPEXP __declspec(dllimport)
#endif
#ifndef MAPKIT_EXPORT
#ifdef __cplusplus
#define MAPKIT_EXPORT MAPKIT_IMPEXP extern "C"
#define MAPKIT_EXPORT_CLASS MAPKIT_IMPEXP
#else
#define MAPKIT_EXPORT MAPKIT_IMPEXP extern
#define MAPKIT_EXPORT_CLASS MAPKIT_IMPEXP
#endif
#endif
#ifndef MAPKIT_EXTERNC_BEGIN
#if defined(__cplusplus)
#define MAPKIT_EXTERNC_BEGIN extern "C" {
#define MAPKIT_EXTERNC_END }
#else
#define MAPKIT_EXTERNC_BEGIN
#define MAPKIT_EXTERNC_END
#endif
#endif
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef TITANIC_SGT_UPPER_DOORS_SOUND_H
#define TITANIC_SGT_UPPER_DOORS_SOUND_H
#include "titanic/core/click_responder.h"
namespace Titanic {
class CSGTUpperDoorsSound : public CClickResponder {
public:
CLASSDEF;
CSGTUpperDoorsSound();
/**
* Save the data for the class to file
*/
virtual void save(SimpleFile *file, int indent);
/**
* Load the data for the class from file
*/
virtual void load(SimpleFile *file);
};
} // End of namespace Titanic
#endif /* TITANIC_SGT_UPPER_DOORS_SOUND_H */
|
/* Portions of this file are subject to the following copyright(s). See
* the Net-SNMP's COPYING file for more details and other copyrights
* that may apply:
*/
/*
* Portions of this file are copyrighted by:
* Copyright (C) 2007 Apple, Inc. All rights reserved.
* Use is subject to license terms specified in the COPYING file
* distributed with the Net-SNMP package.
*/
#ifndef NETSNMP_CACHE_HANDLER_H
#define NETSNMP_CACHE_HANDLER_H
/*
* This caching helper provides a generalised (SNMP-manageable) caching
* mechanism. Individual SNMP table and scalar/scalar group MIB
* implementations can use data caching in a consistent manner, without
* needing to handle the generic caching details themselves.
*/
#include <net-snmp/library/tools.h>
#ifdef __cplusplus
extern "C" {
#endif
#define CACHE_NAME "cache_info"
typedef struct netsnmp_cache_s netsnmp_cache;
typedef int (NetsnmpCacheLoad)(netsnmp_cache *, void*);
typedef void (NetsnmpCacheFree)(netsnmp_cache *, void*);
struct netsnmp_cache_s {
/** Number of handlers whose myvoid member points at this structure. */
int refcnt;
/*
* For operation of the data caches
*/
int flags;
int enabled;
int valid;
char expired;
int timeout; /* Length of time the cache is valid (in s) */
marker_t timestampM; /* When the cache was last loaded */
u_long timer_id; /* periodic timer id */
NetsnmpCacheLoad *load_cache;
NetsnmpCacheFree *free_cache;
/*
* void pointer for the user that created the cache.
* You never know when it might not come in useful ....
*/
void *magic;
/*
* hint from the cache helper. contains the standard
* handler arguments.
*/
netsnmp_handler_args *cache_hint;
/*
* For SNMP-management of the data caches
*/
netsnmp_cache *next, *prev;
oid *rootoid;
int rootoid_len;
};
void netsnmp_cache_reqinfo_insert(netsnmp_cache* cache,
netsnmp_agent_request_info * reqinfo,
const char *name);
netsnmp_cache *
netsnmp_cache_reqinfo_extract(netsnmp_agent_request_info * reqinfo,
const char *name);
netsnmp_cache* netsnmp_extract_cache_info(netsnmp_agent_request_info *);
int netsnmp_cache_check_and_reload(netsnmp_cache * cache);
int netsnmp_cache_check_expired(netsnmp_cache *cache);
int netsnmp_cache_is_valid( netsnmp_agent_request_info *,
const char *name);
/** for backwards compat */
int netsnmp_is_cache_valid( netsnmp_agent_request_info *);
netsnmp_mib_handler *netsnmp_get_cache_handler(int, NetsnmpCacheLoad *,
NetsnmpCacheFree *,
const oid*, int);
int netsnmp_register_cache_handler(netsnmp_handler_registration *reginfo,
int, NetsnmpCacheLoad *,
NetsnmpCacheFree *);
Netsnmp_Node_Handler netsnmp_cache_helper_handler;
netsnmp_cache *
netsnmp_cache_create(int timeout, NetsnmpCacheLoad * load_hook,
NetsnmpCacheFree * free_hook,
const oid * rootoid, int rootoid_len);
int netsnmp_cache_remove(netsnmp_cache *cache);
int netsnmp_cache_free(netsnmp_cache *cache);
netsnmp_mib_handler *
netsnmp_cache_handler_get(netsnmp_cache* cache);
void netsnmp_cache_handler_owns_cache(netsnmp_mib_handler *handler);
netsnmp_cache * netsnmp_cache_find_by_oid(const oid * rootoid,
int rootoid_len);
unsigned int netsnmp_cache_timer_start(netsnmp_cache *cache);
void netsnmp_cache_timer_stop(netsnmp_cache *cache);
/*
* Flags affecting cache handler operation
*/
#define NETSNMP_CACHE_DONT_INVALIDATE_ON_SET 0x0001
#define NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD 0x0002
#define NETSNMP_CACHE_DONT_FREE_EXPIRED 0x0004
#define NETSNMP_CACHE_DONT_AUTO_RELEASE 0x0008
#define NETSNMP_CACHE_PRELOAD 0x0010
#define NETSNMP_CACHE_AUTO_RELOAD 0x0020
#define NETSNMP_CACHE_RESET_TIMER_ON_USE 0x0040
#define NETSNMP_CACHE_HINT_HANDLER_ARGS 0x1000
#ifdef __cplusplus
}
#endif
#endif /* NETSNMP_CACHE_HANDLER_H */
|
#ifndef __esection_h
#define __esection_h
#include <lib/dvb/idemux.h>
#include <set>
#define TABLE_eDebug(x...) do { if (m_debug) eDebug(x); } while(0)
#define TABLE_eDebugNoNewLineStart(x...) do { if (m_debug) eDebugNoNewLineStart(x); } while(0)
#define TABLE_eDebugNoNewLine(x...) do { if (m_debug) eDebugNoNewLine(x); } while(0)
class eGTable: public iObject, public sigc::trackable
{
DECLARE_REF(eGTable);
ePtr<iDVBSectionReader> m_reader;
eDVBTableSpec m_table;
unsigned int m_tries;
ePtr<eTimer> m_timeout;
void sectionRead(const uint8_t *data);
void timeout();
ePtr<eConnection> m_sectionRead_conn;
protected:
static const bool m_debug = false;
virtual int createTable(unsigned int nr, const uint8_t *data, unsigned int max)=0;
virtual unsigned int totalSections(unsigned int max) { return max + 1; }
public:
sigc::signal1<void, int> tableReady;
eGTable();
RESULT start(iDVBSectionReader *reader, const eDVBTableSpec &table);
RESULT start(iDVBDemux *reader, const eDVBTableSpec &table);
RESULT getSpec(eDVBTableSpec &spec) { spec = m_table; return 0; }
virtual ~eGTable();
int error;
int ready;
};
template <class Section>
class eTable: public eGTable
{
private:
std::vector<Section*> sections;
std::set<int> avail;
protected:
int createTable(unsigned int nr, const uint8_t *data, unsigned int max)
{
unsigned int ssize = sections.size();
if (max < ssize || nr >= max)
{
TABLE_eDebug("[eTable] bounds error: max(%d) < ssize(%d) || nr(%d) >= max(%d)",
max, ssize, nr, max);
return 0;
}
if (avail.find(nr) != avail.end())
delete sections[nr];
sections.resize(max);
sections[nr] = new Section(data);
avail.insert(nr);
TABLE_eDebugNoNewLineStart("[eTable] ");
for (unsigned int i = 0; i < max; ++i)
if (avail.find(i) != avail.end())
TABLE_eDebugNoNewLine("+");
else
TABLE_eDebugNoNewLine("-");
TABLE_eDebugNoNewLine(" %zd/%d TID %02x\n", avail.size(), max, data[0]);
if (avail.size() == max)
{
TABLE_eDebug("[eTable] done!");
return 1;
} else
return 0;
}
public:
std::vector<Section*> &getSections() { return sections; }
~eTable()
{
for (std::set<int>::iterator i(avail.begin()); i != avail.end(); ++i)
delete sections[*i];
}
};
class eAUGTable: public sigc::trackable
{
protected:
void slotTableReady(int);
public:
virtual ~eAUGTable(){};
sigc::signal1<void, int> tableReady;
virtual void getNext(int err)=0;
};
template <class Table>
class eAUTable: public eAUGTable
{
ePtr<Table> current, next; // current is READY AND ERRORFREE, next is not yet ready
int first;
ePtr<iDVBDemux> m_demux;
ePtr<iDVBSectionReader> m_reader;
eMainloop *ml;
/* needed to detect broken table version handling (seen on some m2ts files) */
struct timespec m_prev_table_update;
int m_table_cnt;
void begin(eMainloop *m)
{
m_table_cnt = 0;
ml = m;
first= 1;
current = 0;
next = new Table();
CONNECT(next->tableReady, eAUTable::slotTableReady);
}
public:
void stop()
{
current = next = 0;
m_demux = 0;
m_reader = 0;
}
int begin(eMainloop *m, const eDVBTableSpec &spec, ePtr<iDVBDemux> demux)
{
begin(m);
m_demux = demux;
m_reader = 0;
next->start(demux, spec);
return 0;
}
int begin(eMainloop *m, const eDVBTableSpec &spec, ePtr<iDVBSectionReader> reader)
{
begin(m);
m_demux = 0;
m_reader = reader;
next->start(reader, spec);
return 0;
}
int get()
{
if (current)
{
/*emit*/ tableReady(0);
return 0;
} else if (!next)
{
/*emit*/ tableReady(-1);
return 0;
} else
return 1;
}
RESULT getCurrent(ePtr<Table> &ptr)
{
if (!current)
return -1;
ptr = current;
return 0;
}
#if 0
void abort()
{
eDebug("[eAUTable] aborted!");
if (next)
next->abort();
delete next;
next=0;
}
#endif
int ready()
{
return !!current;
}
void inject(Table *t)
{
next=t;
getNext(0);
}
void getNext(int error)
{
current = 0;
if (error)
{
next=0;
if (first)
/*emit*/ tableReady(error);
first=0;
return;
} else
current=next;
next=0;
first=0;
ASSERT(current->ready);
/*emit*/ tableReady(0);
eDVBTableSpec spec;
if (current && (!current->getSpec(spec)))
{
/* detect broken table version handling (seen on some m2ts files) */
if (m_table_cnt)
{
if (abs(timeout_usec(m_prev_table_update)) > 500000)
m_table_cnt = -1;
else if (m_table_cnt > 1) // two pmt update within one second
{
eDebug("[eAUTable] Seen two consecutive table version changes within 500ms. "
"This seems broken, so auto update for pid %04x, table %02x is now disabled!!",
spec.pid, spec.tid);
m_table_cnt = 0;
return;
}
}
++m_table_cnt;
clock_gettime(CLOCK_MONOTONIC, &m_prev_table_update);
next = new Table();
CONNECT(next->tableReady, eAUTable::slotTableReady);
spec.flags &= ~(eDVBTableSpec::tfAnyVersion|eDVBTableSpec::tfThisVersion|eDVBTableSpec::tfHaveTimeout);
if (m_demux)
{
next->eGTable::start(m_demux, spec);
}
else if (m_reader)
{
next->eGTable::start(m_reader, spec);
}
}
}
};
#endif
|
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2011 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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.
QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file QGCXPlaneLink.h
* @brief X-Plane simulation link
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#ifndef QGCXPLANESIMULATIONLINK_H
#define QGCXPLANESIMULATIONLINK_H
#include <QString>
#include <QList>
#include <QMap>
#include <QMutex>
#include <QUdpSocket>
#include <QTimer>
#include <QProcess>
#include <LinkInterface.h>
#include "QGCConfig.h"
#include "UASInterface.h"
#include "QGCHilLink.h"
class QGCXPlaneLink : public QGCHilLink
{
Q_OBJECT
//Q_INTERFACES(QGCXPlaneLinkInterface:LinkInterface)
public:
QGCXPlaneLink(UASInterface* mav, QString remoteHost=QString("127.0.0.1:49000"), QHostAddress localHost = QHostAddress::Any, quint16 localPort = 49005);
~QGCXPlaneLink();
/**
* @brief Load X-Plane HIL settings
*/
void loadSettings();
/**
* @brief Store X-Plane HIL settings
*/
void storeSettings();
bool isConnected();
qint64 bytesAvailable();
int getPort() const {
return localPort;
}
/**
* @brief The human readable port name
*/
QString getName();
void run();
/**
* @brief Get remote host and port
* @return string in format <host>:<port>
*/
QString getRemoteHost();
enum AIRFRAME
{
AIRFRAME_UNKNOWN = 0,
AIRFRAME_QUAD_DJI_F450_PWM,
AIRFRAME_QUAD_X_MK_10INCH_I2C,
AIRFRAME_QUAD_X_ARDRONE,
AIRFRAME_FIXED_WING_BIXLER_II,
AIRFRAME_FIXED_WING_BIXLER_II_AILERONS
};
QString getVersion()
{
return QString("X-Plane %1").arg(xPlaneVersion);
}
int getAirFrameIndex()
{
return (int)airframeID;
}
bool sensorHilEnabled() {
return _sensorHilEnabled;
}
public slots:
// void setAddress(QString address);
void setPort(int port);
/** @brief Add a new host to broadcast messages to */
void setRemoteHost(const QString& host);
/** @brief Send new control states to the simulation */
void updateControls(quint64 time, float rollAilerons, float pitchElevator, float yawRudder, float throttle, quint8 systemMode, quint8 navMode);
/** @brief Send new motor control states to the simulation */
void updateActuators(quint64 time, float act1, float act2, float act3, float act4, float act5, float act6, float act7, float act8);
/** @brief Set the simulator version as text string */
void setVersion(const QString& version);
/** @brief Set the simulator version as integer */
void setVersion(unsigned int version);
void enableSensorHIL(bool enable) {
if (enable != _sensorHilEnabled)
_sensorHilEnabled = enable;
emit sensorHilChanged(enable);
}
void processError(QProcess::ProcessError err);
void readBytes();
/**
* @brief Write a number of bytes to the interface.
*
* @param data Pointer to the data byte array
* @param size The size of the bytes array
**/
void writeBytes(const char* data, qint64 length);
bool connectSimulation();
bool disconnectSimulation();
/**
* @brief Select airplane model
* @param plane the name of the airplane
*/
void selectAirframe(const QString& airframe);
/**
* @brief Set the airplane position and attitude
* @param lat
* @param lon
* @param alt
* @param roll
* @param pitch
* @param yaw
*/
void setPositionAttitude(double lat, double lon, double alt, double roll, double pitch, double yaw);
/**
* @brief Set a random position
*/
void setRandomPosition();
/**
* @brief Set a random attitude
*/
void setRandomAttitude();
protected:
UASInterface* mav;
QString name;
QHostAddress localHost;
quint16 localPort;
QHostAddress remoteHost;
quint16 remotePort;
int id;
QUdpSocket* socket;
bool connectState;
quint64 bitsSentTotal;
quint64 bitsSentCurrent;
quint64 bitsSentMax;
quint64 bitsReceivedTotal;
quint64 bitsReceivedCurrent;
quint64 bitsReceivedMax;
quint64 connectionStartTime;
QMutex statisticsMutex;
QMutex dataMutex;
QTimer refreshTimer;
QProcess* process;
QProcess* terraSync;
bool gpsReceived;
bool attitudeReceived;
float roll, pitch, yaw, rollspeed, pitchspeed, yawspeed;
double lat, lon, alt, alt_agl;
float vx, vy, vz, xacc, yacc, zacc;
float ind_airspeed;
float true_airspeed;
float groundspeed;
float xmag, ymag, zmag, abs_pressure, diff_pressure, pressure_alt, temperature;
float barometerOffsetkPa;
float man_roll, man_pitch, man_yaw;
QString airframeName;
enum AIRFRAME airframeID;
bool xPlaneConnected;
unsigned int xPlaneVersion;
quint64 simUpdateLast;
quint64 simUpdateFirst;
quint64 simUpdateLastText;
quint64 simUpdateLastGroundTruth;
float simUpdateHz;
bool _sensorHilEnabled;
bool _should_exit;
void setName(QString name);
};
#endif // QGCXPLANESIMULATIONLINK_H
|
/**************************************************************************
*
* Copyright 2010 Christian König
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef vl_vertex_buffers_h
#define vl_vertex_buffers_h
#include "pipe/p_state.h"
#include "pipe/p_video_state.h"
#include "vl_defines.h"
#include "vl_types.h"
/* vertex buffers act as a todo list
* uploading all the usefull informations to video ram
* so a vertex shader can work with them
*/
/* inputs to the vertex shaders */
enum VS_INPUT
{
VS_I_RECT = 0,
VS_I_VPOS = 1,
VS_I_BLOCK_NUM = 2,
VS_I_MV_TOP = 2,
VS_I_MV_BOTTOM = 3,
NUM_VS_INPUTS = 4
};
enum vl_mv_weight
{
PIPE_VIDEO_MV_WEIGHT_MIN = 0,
PIPE_VIDEO_MV_WEIGHT_HALF = 128,
PIPE_VIDEO_MV_WEIGHT_MAX = 256
};
enum vl_field_select
{
PIPE_VIDEO_FRAME = 0,
PIPE_VIDEO_TOP_FIELD = 1,
PIPE_VIDEO_BOTTOM_FIELD = 3,
/* TODO
PIPE_VIDEO_DUALPRIME
PIPE_VIDEO_16x8
*/
};
struct vl_motionvector
{
struct {
int16_t x, y;
int16_t field_select; /**< enum pipe_video_field_select */
int16_t weight; /**< enum pipe_video_mv_weight */
} top, bottom;
};
struct vl_ycbcr_block
{
uint8_t x, y;
uint8_t intra;
uint8_t coding;
float block_num;
};
struct vl_vertex_buffer
{
unsigned width, height;
struct {
struct pipe_resource *resource;
struct pipe_transfer *transfer;
struct vl_ycbcr_block *vertex_stream;
} ycbcr[VL_NUM_COMPONENTS];
struct {
struct pipe_resource *resource;
struct pipe_transfer *transfer;
struct vl_motionvector *vertex_stream;
} mv[VL_MAX_REF_FRAMES];
};
struct pipe_vertex_buffer vl_vb_upload_quads(struct pipe_context *pipe);
struct pipe_vertex_buffer vl_vb_upload_pos(struct pipe_context *pipe, unsigned width, unsigned height);
void *vl_vb_get_ves_ycbcr(struct pipe_context *pipe);
void *vl_vb_get_ves_mv(struct pipe_context *pipe);
bool vl_vb_init(struct vl_vertex_buffer *buffer,
struct pipe_context *pipe,
unsigned width, unsigned height);
unsigned vl_vb_attributes_per_plock(struct vl_vertex_buffer *buffer);
void vl_vb_map(struct vl_vertex_buffer *buffer, struct pipe_context *pipe);
struct pipe_vertex_buffer vl_vb_get_ycbcr(struct vl_vertex_buffer *buffer, int component);
struct vl_ycbcr_block *vl_vb_get_ycbcr_stream(struct vl_vertex_buffer *buffer, int component);
struct pipe_vertex_buffer vl_vb_get_mv(struct vl_vertex_buffer *buffer, int ref_frame);
unsigned vl_vb_get_mv_stream_stride(struct vl_vertex_buffer *buffer);
struct vl_motionvector *vl_vb_get_mv_stream(struct vl_vertex_buffer *buffer, int ref_frame);
void vl_vb_unmap(struct vl_vertex_buffer *buffer, struct pipe_context *pipe);
void vl_vb_cleanup(struct vl_vertex_buffer *buffer);
#endif /* vl_vertex_buffers_h */
|
#ifndef __AP_HAL_UTIL_H__
#define __AP_HAL_UTIL_H__
#include <stdarg.h>
#include "AP_HAL_Namespace.h"
#include <AP_Progmem.h>
class AP_HAL::Util {
public:
virtual int snprintf(char* str, size_t size,
const char *format, ...) = 0;
virtual int snprintf_P(char* str, size_t size,
const prog_char_t *format, ...) = 0;
virtual int vsnprintf(char* str, size_t size,
const char *format, va_list ap) = 0;
virtual int vsnprintf_P(char* str, size_t size,
const prog_char_t *format, va_list ap) = 0;
};
#endif // __AP_HAL_UTIL_H__
|
#ifndef __LINUX_LCD_NOTIFY_H
#define __LINUX_LCD_NOTIFY_H
#include <linux/notifier.h>
/* the display on process started */
#define LCD_EVENT_ON_START 0x01
/* the display on process end */
#define LCD_EVENT_ON_END 0x02
/* the display off process started */
#define LCD_EVENT_OFF_START 0x03
/* the display off process end */
#define LCD_EVENT_OFF_END 0x04
struct lcd_event {
void *data;
};
#ifdef CONFIG_FB_MSM_MDSS
int lcd_register_client(struct notifier_block *nb);
int lcd_unregister_client(struct notifier_block *nb);
int lcd_notifier_call_chain(unsigned long val, void *v);
#else
static int inline lcd_register_client(struct notifier_block *nb)
{
return -ENOENT;
}
static int inline lcd_unregister_client(struct notifier_block *nb)
{
return -ENOENT;
}
static int inline lcd_notifier_call_chain(unsigned long val, void *v)
{
return -ENOENT;
}
#endif
#endif /* _LINUX_LCD_NOTIFY_H */
|
#define meyerscal_N 16
#define meyerscal_P 3
#define meyerscal_NTRIES 1
static double meyerscal_x0[meyerscal_P] = { 8.85, 4.0, 2.5 };
static double meyerscal_epsrel = 1.0e-8;
static double meyerscal_Y[meyerscal_N] = {
34780., 28610., 23650., 19630., 16370., 13720., 11540.,
9744., 8261., 7030., 6005., 5147., 4427., 3820.,
3307., 2872.
};
static void
meyerscal_checksol(const double x[], const double sumsq,
const double epsrel, const char *sname,
const char *pname)
{
size_t i;
const double sumsq_exact = 8.794585517003888e-05;
const double meyerscal_x[meyerscal_P] = { 2.481778312286695e+00,
6.181346341853554e+00,
3.452236344749865e+00 };
gsl_test_rel(sumsq, sumsq_exact, epsrel, "%s/%s sumsq",
sname, pname);
for (i = 0; i < meyerscal_P; ++i)
{
gsl_test_rel(x[i], meyerscal_x[i], epsrel, "%s/%s i=%zu",
sname, pname, i);
}
}
static int
meyerscal_f (const gsl_vector * x, void *params, gsl_vector * f)
{
double x1 = gsl_vector_get(x, 0);
double x2 = gsl_vector_get(x, 1);
double x3 = gsl_vector_get(x, 2);
size_t i;
for (i = 0; i < meyerscal_N; ++i)
{
double ti = 0.45 + 0.05*(i + 1.0);
double yi = meyerscal_Y[i];
double fi = x1 * exp(10.0*x2 / (ti + x3) - 13.0) - 1.0e-3*yi;
gsl_vector_set(f, i, fi);
}
return GSL_SUCCESS;
}
static int
meyerscal_df (const gsl_vector * x, void *params, gsl_matrix * J)
{
double x1 = gsl_vector_get(x, 0);
double x2 = gsl_vector_get(x, 1);
double x3 = gsl_vector_get(x, 2);
size_t i;
for (i = 0; i < meyerscal_N; ++i)
{
double ti = 0.45 + 0.05*(i + 1.0);
double term1 = ti + x3;
double term2 = exp(10.0*x2/term1 - 13.0);
gsl_matrix_set(J, i, 0, term2);
gsl_matrix_set(J, i, 1, 10.0*x1*term2/term1);
gsl_matrix_set(J, i, 2, -10.0*x1*x2*term2/(term1*term1));
}
return GSL_SUCCESS;
}
static gsl_multifit_function_fdf meyerscal_func =
{
&meyerscal_f,
&meyerscal_df,
NULL,
meyerscal_N,
meyerscal_P,
NULL,
0,
0
};
static test_fdf_problem meyerscal_problem =
{
"meyerscal",
meyerscal_x0,
NULL,
&meyerscal_epsrel,
meyerscal_NTRIES,
&meyerscal_checksol,
&meyerscal_func
};
|
// This file is part of SVO - Semi-direct Visual Odometry.
//
// Copyright (C) 2014 Christian Forster <forster at ifi dot uzh dot ch>
// (Robotics and Perception Group, University of Zurich, Switzerland).
//
// SVO 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 any later version.
//
// SVO is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef SVO_MATCHER_H_
#define SVO_MATCHER_H_
#include <svo/global.h>
namespace vk {
class AbstractCamera;
namespace patch_score {
template<int HALF_PATCH_SIZE> class ZMSSD;
}
}
namespace svo {
class Point;
class Frame;
class Feature;
/// Warp a patch from the reference view to the current view.
namespace warp {
void getWarpMatrixAffine(
const vk::AbstractCamera& cam_ref,
const vk::AbstractCamera& cam_cur,
const Vector2d& px_ref,
const Vector3d& f_ref,
const double depth_ref,
const SE3& T_cur_ref,
const int level_ref,
Matrix2d& A_cur_ref);
int getBestSearchLevel(
const Matrix2d& A_cur_ref,
const int max_level);
void warpAffine(
const Matrix2d& A_cur_ref,
const cv::Mat& img_ref,
const Vector2d& px_ref,
const int level_ref,
const int level_cur,
const int halfpatch_size,
uint8_t* patch);
} // namespace warp
/// Patch-matcher for reprojection-matching and epipolar search in triangulation.
class Matcher
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
static const int halfpatch_size_ = 4;
static const int patch_size_ = 8;
typedef vk::patch_score::ZMSSD<halfpatch_size_> PatchScore;
struct Options
{
bool align_1d; //!< in epipolar search: align patch 1D along epipolar line
int align_max_iter; //!< number of iterations for aligning the feature patches in gauss newton
double max_epi_length_optim;//!< max length of epipolar line to skip epipolar search and directly go to img align
size_t max_epi_search_steps;//!< max number of evaluations along epipolar line
bool subpix_refinement; //!< do gauss newton feature patch alignment after epipolar search
bool epi_search_edgelet_filtering;
double epi_search_edgelet_max_angle;
Options() :
align_1d(false),
align_max_iter(10),
max_epi_length_optim(2.0),
max_epi_search_steps(1000),
subpix_refinement(true),
epi_search_edgelet_filtering(true),
epi_search_edgelet_max_angle(0.7)
{}
} options_;
uint8_t patch_[patch_size_*patch_size_] __attribute__ ((aligned (16)));
uint8_t patch_with_border_[(patch_size_+2)*(patch_size_+2)] __attribute__ ((aligned (16)));
Matrix2d A_cur_ref_; //!< affine warp matrix
Vector2d epi_dir_;
double epi_length_; //!< length of epipolar line segment in pixels (only used for epipolar search)
double h_inv_; //!< hessian of 1d image alignment along epipolar line
int search_level_;
bool reject_;
Feature* ref_ftr_;
Vector2d px_cur_;
Matcher() = default;
~Matcher() = default;
/// Find a match by directly applying subpix refinement.
/// IMPORTANT! This function assumes that px_cur is already set to an estimate that is within ~2-3 pixel of the final result!
bool findMatchDirect(
const Point& pt,
const Frame& frame,
Vector2d& px_cur);
/// Find a match by searching along the epipolar line without using any features.
bool findEpipolarMatchDirect(
const Frame& ref_frame,
const Frame& cur_frame,
const Feature& ref_ftr,
const double d_estimate,
const double d_min,
const double d_max,
double& depth);
void createPatchFromPatchWithBorder();
};
} // namespace svo
#endif // SVO_MATCHER_H_
|
/* @(#)s_log1p.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
#if defined(LIBM_SCCS) && !defined(lint)
static char rcsid[] = "$NetBSD: s_log1p.c,v 1.8 1995/05/10 20:47:46 jtc Exp $";
#endif
/* double log1p(double x)
*
* Method :
* 1. Argument Reduction: find k and f such that
* 1+x = 2^k * (1+f),
* where sqrt(2)/2 < 1+f < sqrt(2) .
*
* Note. If k=0, then f=x is exact. However, if k!=0, then f
* may not be representable exactly. In that case, a correction
* term is need. Let u=1+x rounded. Let c = (1+x)-u, then
* log(1+x) - log(u) ~ c/u. Thus, we proceed to compute log(u),
* and add back the correction term c/u.
* (Note: when x > 2**53, one can simply return log(x))
*
* 2. Approximation of log1p(f).
* Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
* = 2s + 2/3 s**3 + 2/5 s**5 + .....,
* = 2s + s*R
* We use a special Reme algorithm on [0,0.1716] to generate
* a polynomial of degree 14 to approximate R The maximum error
* of this polynomial approximation is bounded by 2**-58.45. In
* other words,
* 2 4 6 8 10 12 14
* R(z) ~ Lp1*s +Lp2*s +Lp3*s +Lp4*s +Lp5*s +Lp6*s +Lp7*s
* (the values of Lp1 to Lp7 are listed in the program)
* and
* | 2 14 | -58.45
* | Lp1*s +...+Lp7*s - R(z) | <= 2
* | |
* Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
* In order to guarantee error in log below 1ulp, we compute log
* by
* log1p(f) = f - (hfsq - s*(hfsq+R)).
*
* 3. Finally, log1p(x) = k*ln2 + log1p(f).
* = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
* Here ln2 is split into two floating point number:
* ln2_hi + ln2_lo,
* where n*ln2_hi is always exact for |n| < 2000.
*
* Special cases:
* log1p(x) is NaN with signal if x < -1 (including -INF) ;
* log1p(+INF) is +INF; log1p(-1) is -INF with signal;
* log1p(NaN) is that NaN with no signal.
*
* Accuracy:
* according to an error analysis, the error is always less than
* 1 ulp (unit in the last place).
*
* Constants:
* The hexadecimal values are the intended ones for the following
* constants. The decimal values may be used, provided that the
* compiler will convert from decimal to binary accurately enough
* to produce the hexadecimal values shown.
*
* Note: Assuming log() return accurate answer, the following
* algorithm can be used to compute log1p(x) to within a few ULP:
*
* u = 1+x;
* if(u==1.0) return x ; else
* return log(u)*(x/(u-1.0));
*
* See HP-15C Advanced Functions Handbook, p.193.
*/
#include "rtapi_math.h"
#include "mathP.h"
#ifdef __STDC__
static const double
#else
static double
#endif
ln2_hi = 6.93147180369123816490e-01, /* 3fe62e42 fee00000 */
ln2_lo = 1.90821492927058770002e-10, /* 3dea39ef 35793c76 */
two54 = 1.80143985094819840000e+16, /* 43500000 00000000 */
Lp1 = 6.666666666666735130e-01, /* 3FE55555 55555593 */
Lp2 = 3.999999999940941908e-01, /* 3FD99999 9997FA04 */
Lp3 = 2.857142874366239149e-01, /* 3FD24924 94229359 */
Lp4 = 2.222219843214978396e-01, /* 3FCC71C5 1D8E78AF */
Lp5 = 1.818357216161805012e-01, /* 3FC74664 96CB03DE */
Lp6 = 1.531383769920937332e-01, /* 3FC39A09 D078C69F */
Lp7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */
#ifdef __STDC__
static const double zero = 0.0;
#else
static double zero = 0.0;
#endif
#ifdef __STDC__
double rtapi_log1p(double x)
#else
double rtapi_log1p(x)
double x;
#endif
{
double hfsq,f=0.0,c=0.0,s,z,R,u;
int32_t k,hx,hu=0,ax;
GET_HIGH_WORD(hx,x);
ax = hx&0x7fffffff;
k = 1;
if (hx < 0x3FDA827A) { /* x < 0.41422 */
if(ax>=0x3ff00000) { /* x <= -1.0 */
if(x==-1.0) return -two54/zero; /* log1p(-1)=+inf */
else return (x-x)/(x-x); /* log1p(x<-1)=NaN */
}
if(ax<0x3e200000) { /* |x| < 2**-29 */
if(two54+x>zero /* raise inexact */
&&ax<0x3c900000) /* |x| < 2**-54 */
return x;
else
return x - x*x*0.5;
}
if(hx>0||hx<=((int32_t)0xbfd2bec3)) {
k=0;f=x;hu=1;} /* -0.2929<x<0.41422 */
}
if (hx >= 0x7ff00000) return x+x;
if(k!=0) {
if(hx<0x43400000) {
u = 1.0+x;
GET_HIGH_WORD(hu,u);
k = (hu>>20)-1023;
c = (k>0)? 1.0-(u-x):x-(u-1.0);/* correction term */
c /= u;
} else {
u = x;
GET_HIGH_WORD(hu,u);
k = (hu>>20)-1023;
c = 0;
}
hu &= 0x000fffff;
if(hu<0x6a09e) {
SET_HIGH_WORD(u,hu|0x3ff00000); /* normalize u */
} else {
k += 1;
SET_HIGH_WORD(u,hu|0x3fe00000); /* normalize u/2 */
hu = (0x00100000-hu)>>2;
}
f = u-1.0;
}
hfsq=0.5*f*f;
if(hu==0) { /* |f| < 2**-20 */
if(f==zero) {if(k==0) return zero;
else {c += k*ln2_lo; return k*ln2_hi+c;}
}
R = hfsq*(1.0-0.66666666666666666*f);
if(k==0) return f-R; else
return k*ln2_hi-((R-(k*ln2_lo+c))-f);
}
s = f/(2.0+f);
z = s*s;
R = z*(Lp1+z*(Lp2+z*(Lp3+z*(Lp4+z*(Lp5+z*(Lp6+z*Lp7))))));
if(k==0) return f-(hfsq-s*(hfsq+R)); else
return k*ln2_hi-((hfsq-(s*(hfsq+R)+(k*ln2_lo+c)))-f);
}
|
/*=========================================================================
Library: CTK
Copyright (c) Kitware 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.txt
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 __ctkFileDialogEventPlayer_h
#define __ctkFileDialogEventPlayer_h
// QtTesting includes
#include <pqNativeFileDialogEventPlayer.h>
// CTK includes
#include <ctkPimpl.h>
#include "ctkWidgetsExport.h"
/// Concrete implementation of pqWidgetEventPlayer that translates
/// high-level events into low-level Qt events.
class CTK_WIDGETS_EXPORT ctkFileDialogEventPlayer :
public pqNativeFileDialogEventPlayer
{
Q_OBJECT
public:
typedef pqNativeFileDialogEventPlayer Superclass;
ctkFileDialogEventPlayer(pqTestUtility* util, QObject* parent = 0);
bool playEvent(QObject *Object, const QString &Command, const QString &Arguments, bool &Error);
private:
Q_DISABLE_COPY(ctkFileDialogEventPlayer);
};
#endif
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This defines helpful methods for dealing with Callbacks. Because Callbacks
// are implemented using templates, with a class per callback signature, adding
// methods to Callback<> itself is unattractive (lots of extra code gets
// generated). Instead, consider adding methods here.
//
// ResetAndReturn(&cb) is like cb.Reset() but allows executing a callback (via a
// copy) after the original callback is Reset(). This can be handy if Run()
// reads/writes the variable holding the Callback.
#ifndef BASE_CALLBACK_HELPERS_H_
#define BASE_CALLBACK_HELPERS_H_
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
namespace base {
template <typename Sig>
base::Callback<Sig> ResetAndReturn(base::Callback<Sig>* cb) {
base::Callback<Sig> ret(*cb);
cb->Reset();
return ret;
}
// ScopedClosureRunner is akin to scoped_ptr for Closures. It ensures that the
// Closure is executed and deleted no matter how the current scope exits.
class BASE_EXPORT ScopedClosureRunner {
public:
ScopedClosureRunner();
explicit ScopedClosureRunner(const Closure& closure);
~ScopedClosureRunner();
void Reset();
void Reset(const Closure& closure);
Closure Release() WARN_UNUSED_RESULT;
private:
Closure closure_;
DISALLOW_COPY_AND_ASSIGN(ScopedClosureRunner);
};
} // namespace base
#endif // BASE_CALLBACK_HELPERS_H_
|
/*-------------------------------------------------------------------------
*
* svr4.h
* port-specific prototypes for Intel x86/Intel SVR4
*
*
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/port/dynloader/svr4.h,v 1.20 2008/01/01 19:45:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H
#include <dlfcn.h>
#include "utils/dynamic_loader.h"
/*
* Dynamic Loader on Intel x86/Intel SVR4.
*
* this dynamic loader uses the system dynamic loading interface for shared
* libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared
* library as the file to be dynamically loaded.
*/
/*
* In some older systems, the RTLD_NOW flag isn't defined and the mode
* argument to dlopen must always be 1. The RTLD_GLOBAL flag is wanted
* if available, but it doesn't exist everywhere.
* If it doesn't exist, set it to 0 so it has no effect.
*/
#ifndef RTLD_NOW
#define RTLD_NOW 1
#endif
#ifndef RTLD_GLOBAL
#define RTLD_GLOBAL 0
#endif
#define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL)
#define pg_dlsym dlsym
#define pg_dlclose dlclose
#define pg_dlerror dlerror
#endif /* PORT_PROTOS_H */
|
#define SHMLBA 4096
struct shmid_ds {
struct ipc_perm shm_perm;
size_t shm_segsz;
time_t shm_atime;
time_t shm_dtime;
time_t shm_ctime;
pid_t shm_cpid;
pid_t shm_lpid;
unsigned long shm_nattch;
unsigned long __pad1;
unsigned long __pad2;
};
struct shminfo {
unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
};
struct shm_info {
int __used_ids;
unsigned long shm_tot, shm_rss, shm_swp;
unsigned long __swap_attempts, __swap_successes;
};
|
/*****************************************************************************
Copyright (c) 2011, Intel Corp.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************
* Contents: Native middle-level C interface to LAPACK function dlagge
* Author: Intel Corporation
* Generated November, 2011
*****************************************************************************/
#include "lapacke_utils.h"
lapack_int LAPACKE_dlagge_work( int matrix_order, lapack_int m, lapack_int n,
lapack_int kl, lapack_int ku, const double* d,
double* a, lapack_int lda, lapack_int* iseed,
double* work )
{
lapack_int info = 0;
if( matrix_order == LAPACK_COL_MAJOR ) {
/* Call LAPACK function and adjust info */
LAPACK_dlagge( &m, &n, &kl, &ku, d, a, &lda, iseed, work, &info );
if( info < 0 ) {
info = info - 1;
}
} else if( matrix_order == LAPACK_ROW_MAJOR ) {
lapack_int lda_t = MAX(1,m);
double* a_t = NULL;
/* Check leading dimension(s) */
if( lda < n ) {
info = -8;
LAPACKE_xerbla( "LAPACKE_dlagge_work", info );
return info;
}
/* Allocate memory for temporary array(s) */
a_t = (double*)LAPACKE_malloc( sizeof(double) * lda_t * MAX(1,n) );
if( a_t == NULL ) {
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
goto exit_level_0;
}
/* Call LAPACK function and adjust info */
LAPACK_dlagge( &m, &n, &kl, &ku, d, a_t, &lda_t, iseed, work, &info );
if( info < 0 ) {
info = info - 1;
}
/* Transpose output matrices */
LAPACKE_dge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
/* Release memory and exit */
LAPACKE_free( a_t );
exit_level_0:
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
LAPACKE_xerbla( "LAPACKE_dlagge_work", info );
}
} else {
info = -1;
LAPACKE_xerbla( "LAPACKE_dlagge_work", info );
}
return info;
}
|
//=================================================================================================
/*!
// \file blaze/util/Constraints.h
// \brief Header file for compile time constraints
//
// Copyright (C) 2013 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. Redistribution and use in source and binary
// forms, with or without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// 3. Neither the names of the Blaze development group 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 _BLAZE_UTIL_CONSTRAINTS_H_
#define _BLAZE_UTIL_CONSTRAINTS_H_
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <blaze/util/constraints/Arithmetic.h>
#include <blaze/util/constraints/Array.h>
#include <blaze/util/constraints/BaseOf.h>
#include <blaze/util/constraints/Boolean.h>
#include <blaze/util/constraints/Builtin.h>
#include <blaze/util/constraints/Class.h>
#include <blaze/util/constraints/Comparable.h>
#include <blaze/util/constraints/Complex.h>
#include <blaze/util/constraints/Const.h>
#include <blaze/util/constraints/Convertible.h>
#include <blaze/util/constraints/DerivedFrom.h>
#include <blaze/util/constraints/Double.h>
#include <blaze/util/constraints/Empty.h>
#include <blaze/util/constraints/Float.h>
#include <blaze/util/constraints/FloatingPoint.h>
#include <blaze/util/constraints/Integral.h>
#include <blaze/util/constraints/LongDouble.h>
#include <blaze/util/constraints/Numeric.h>
#include <blaze/util/constraints/Object.h>
#include <blaze/util/constraints/Pod.h>
#include <blaze/util/constraints/Pointer.h>
#include <blaze/util/constraints/Rank.h>
#include <blaze/util/constraints/Reference.h>
#include <blaze/util/constraints/SameSize.h>
#include <blaze/util/constraints/SameType.h>
#include <blaze/util/constraints/Signed.h>
#include <blaze/util/constraints/Size.h>
#include <blaze/util/constraints/Subscriptable.h>
#include <blaze/util/constraints/TypeRestriction.h>
#include <blaze/util/constraints/Union.h>
#include <blaze/util/constraints/Unsigned.h>
#include <blaze/util/constraints/Vectorizable.h>
#include <blaze/util/constraints/Void.h>
#include <blaze/util/constraints/Volatile.h>
#endif
|
//
// HCDConcreteVisitor1.h
// 23访问者模式
//
// Created by 黄成都 on 15/8/27.
// Copyright (c) 2015年 黄成都. All rights reserved.
//
#import "HCDVisitors.h"
@interface HCDConcreteVisitor1 : HCDVisitors
@end
|
/** @file FIRAuthErrors.h
@brief Firebase Auth SDK
@copyright Copyright 2015 Google Inc.
@remarks Use of this SDK is subject to the Google APIs Terms of Service:
https://developers.google.com/terms/
*/
#import <Foundation/Foundation.h>
/** @var FIRAuthErrorDomain
@brief The Firebase Auth error domain.
*/
extern NSString *const FIRAuthErrorDomain;
/** @var FIRAuthErrorNameKey
@brief The name of the key for the "error_name" string in the NSError userinfo dictionary.
*/
extern NSString *const FIRAuthErrorNameKey;
/** @var FIRAuthErrorCode
@brief Error codes used by Firebase Auth.
*/
typedef NS_ENUM(NSInteger, FIRAuthErrorCode) {
/** @var FIRAuthErrorCodeInvalidCustomToken
@brief Indicates a validation error with the custom token.
*/
FIRAuthErrorCodeInvalidCustomToken = 17000,
/** @var FIRAuthErrorCodeCustomTokenMismatch
@brief Indicates the service account and the API key belong to different projects.
*/
FIRAuthErrorCodeCustomTokenMismatch = 17002,
/** @var FIRAuthErrorCodeInvalidCredential
@brief Indicates the IDP token or requestUri is invalid.
*/
FIRAuthErrorCodeInvalidCredential = 17004,
/** @var FIRAuthErrorCodeUserDisabled
@brief Indicates the user's account is disabled on the server side.
*/
FIRAuthErrorCodeUserDisabled = 17005,
/** @var FIRAuthErrorCodeOperationNotAllowed
@brief Indicates the administrator disabled sign in with the specified identity provider.
*/
FIRAuthErrorCodeOperationNotAllowed = 17006,
/** @var FIRAuthErrorCodeEmailAlreadyInUse
@brief Indicates the email used to attempt a sign up already exists.
*/
FIRAuthErrorCodeEmailAlreadyInUse = 17007,
/** @var FIRAuthErrorCodeInvalidEmail
@brief Indicates the email is invalid.
*/
FIRAuthErrorCodeInvalidEmail = 17008,
/** @var FIRAuthErrorCodeWrongPassword
@brief Indicates the user attempted sign in with a wrong password.
*/
FIRAuthErrorCodeWrongPassword = 17009,
/** @var FIRAuthErrorCodeTooManyRequests
@brief Indicates that too many requests were made to a serve method.
*/
FIRAuthErrorCodeTooManyRequests = 17010,
/** @var FIRAuthErrorCodeUserNotFound
@brief Indicates the user account was been found.
*/
FIRAuthErrorCodeUserNotFound = 17011,
/** @var FIRAuthErrrorCodeAccountExistsWithDifferentCredential
@brief Indicates account linking is needed.
*/
FIRAuthErrrorCodeAccountExistsWithDifferentCredential = 17012,
/** @var FIRAuthErrorCodeRequiresRecentLogin
@brief Indicates the user has attemped to change email or password more than 5 minutes after
signing in.
*/
FIRAuthErrorCodeRequiresRecentLogin = 17014,
/** @var FIRAuthErrorCodeProviderAlreadyLinked
@brief Indicates an attempt to link a provider to which we are already linked.
*/
FIRAuthErrorCodeProviderAlreadyLinked = 17015,
/** @var FIRAuthErrorCodeNoSuchProvider
@brief Indicates an attempt to unlink a provider that is not linked.
*/
FIRAuthErrorCodeNoSuchProvider = 17016,
/** @var FIRAuthErrorCodeInvalidUserToken
@brief Indicates user's saved auth credential is invalid, the user needs to sign in again.
*/
FIRAuthErrorCodeInvalidUserToken = 17017,
/** @var FIRAuthErrorCodeNetworkError
@brief Indicates a network error occurred (such as a timeout, interrupted connection, or
unreachable host.)
@remarks These types of errors are often recoverable with a retry.
The @c NSUnderlyingError field in the @c NSError.userInfo dictionary will contain the
error encountered.
*/
FIRAuthErrorCodeNetworkError = 17020,
/** @var FIRAuthErrorCodeUserTokenExpired
@brief Indicates the saved token has expired, for example, the user may have changed account
password on another device. The user needs to sign in again on this device.
*/
FIRAuthErrorCodeUserTokenExpired = 17021,
/** @var FIRAuthErrorCodeInvalidAPIKey
@brief Indicates an invalid API key was supplied in the request.
*/
FIRAuthErrorCodeInvalidAPIKey = 17023,
/** @var FIRAuthErrorCodeUserMismatch
@brief Indicates that user attempted to reauthenticate with a user other than the current
user.
*/
FIRAuthErrorCodeUserMismatch = 17024,
/** @var FIRAuthErrorCodeCredentialAlreadyInUse
@brief Indicates an attempt to link with a credential that has already been linked with a
different Firebase account.
*/
FIRAuthErrorCodeCredentialAlreadyInUse = 17025,
/** @var FIRAuthErrorCodeWeakPassword
@brief Indicates an attempt to set a password that is considered too weak.
@remarks The @c NSLocalizedFailureReasonErrorKey field in the @c NSError.userInfo dictionary
will contain more detailed explanation that can be shown to the user.
*/
FIRAuthErrorCodeWeakPassword = 17026,
/** @var FIRAuthErrorCodeAppNotAuthorized
@brief Indicates the App is not authorized to use Firebase Authentication with the
provided API Key.
*/
FIRAuthErrorCodeAppNotAuthorized = 17028,
/** @var FIRAuthErrorCodeKeychainError
@brief Indicated an error occurred for accessing the keychain.
@remarks The @c NSLocalizedFailureReasonErrorKey field in the @c NSError.userInfo dictionary
will contain more information about the error encountered.
*/
FIRAuthErrorCodeKeychainError = 17995,
/** @var FIRAuthErrorCodeInternalError
@brief Indicates an internal error occurred.
@remarks The @c NSUnderlyingError field in the @c NSError.userInfo dictionary will contain the
error encountered.
*/
FIRAuthErrorCodeInternalError = 17999,
};
|
/*
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2012, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
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 OBJ_FILE_IMPORTER_H_INC
#define OBJ_FILE_IMPORTER_H_INC
#include "BaseImporter.h"
#include <vector>
struct aiMesh;
struct aiNode;
namespace Assimp
{
namespace ObjFile
{
struct Object;
struct Model;
}
// ------------------------------------------------------------------------------------------------
/// \class ObjFileImporter
/// \brief Imports a waveform obj file
// ------------------------------------------------------------------------------------------------
class ObjFileImporter : public BaseImporter
{
public:
/// \brief Default constructor
ObjFileImporter();
/// \brief Destructor
~ObjFileImporter();
public:
/// \brief Returns whether the class can handle the format of the given file.
/// \remark See BaseImporter::CanRead() for details.
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
private:
//! \brief Appends the supported extention.
const aiImporterDesc* GetInfo () const;
//! \brief File import implementation.
void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
//! \brief Create the data from imported content.
void CreateDataFromImport(const ObjFile::Model* pModel, aiScene* pScene);
//! \brief Creates all nodes stored in imported content.
aiNode *createNodes(const ObjFile::Model* pModel, const ObjFile::Object* pData, unsigned int uiMeshIndex,
aiNode *pParent, aiScene* pScene, std::vector<aiMesh*> &MeshArray);
//! \brief Creates topology data like faces and meshes for the geometry.
void createTopology(const ObjFile::Model* pModel, const ObjFile::Object* pData,
unsigned int uiMeshIndex, aiMesh* pMesh);
//! \brief Creates vertices from model.
void createVertexArray(const ObjFile::Model* pModel, const ObjFile::Object* pCurrentObject,
unsigned int uiMeshIndex, aiMesh* pMesh,unsigned int uiIdxCount);
//! \brief Object counter helper method.
void countObjects(const std::vector<ObjFile::Object*> &rObjects, int &iNumMeshes);
//! \brief Material creation.
void createMaterials(const ObjFile::Model* pModel, aiScene* pScene);
//! \brief Appends a child node to a parentnode and updates the datastructures.
void appendChildToParentNode(aiNode *pParent, aiNode *pChild);
//! \brief TODO!
void createAnimations();
private:
//! Data buffer
std::vector<char> m_Buffer;
//! Pointer to root object instance
ObjFile::Object *m_pRootObject;
//! Absolute pathname of model in filesystem
std::string m_strAbsPath;
};
// ------------------------------------------------------------------------------------------------
} // Namespace Assimp
#endif
|
//
// Util.h
//
// $Id: //poco/1.3/Util/include/Poco/Util/Util.h#2 $
//
// Library: Util
// Package: Util
// Module: Util
//
// Basic definitions for the Poco Util library.
// This file must be the first file included by every other Util
// header file.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
#ifndef Util_Util_INCLUDED
#define Util_Util_INCLUDED
#include "Poco/Foundation.h"
//
// The following block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the Util_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// Util_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
//
#if defined(_WIN32) && defined(POCO_DLL)
#if defined(Util_EXPORTS)
#define Util_API __declspec(dllexport)
#else
#define Util_API __declspec(dllimport)
#endif
#endif
#if !defined(Util_API)
#define Util_API
#endif
//
// Automatically link Util library.
//
#if defined(_MSC_VER)
#if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Util_EXPORTS)
#if defined(POCO_DLL)
#if defined(_DEBUG)
#pragma comment(lib, "PocoUtild.lib")
#else
#pragma comment(lib, "PocoUtil.lib")
#endif
#else
#if defined(_DEBUG)
#pragma comment(lib, "PocoUtilmtd.lib")
#else
#pragma comment(lib, "PocoUtilmt.lib")
#endif
#endif
#endif
#endif
#endif // Util_Util_INCLUDED
|
//
// OCToolBar.h
// Owncloud iOs Client
//
// Created by Gonzalo Gonzalez on 08/10/13.
//
/*
Copyright (C) 2014, ownCloud, Inc.
This code is covered by the GNU Public License Version 3.
For distribution utilizing Apple mechanisms please see https://owncloud.org/contribute/iOS-license-exception/
You should have received a copy of this license
along with this program. If not, see <http://www.gnu.org/licenses/gpl-3.0.en.html>.
*/
#import <UIKit/UIKit.h>
#import "PassthroughView.h"
@interface OCToolBar : UIToolbar{
PassthroughView *_backgroundView;
}
///-----------------------------------
/// @name Manage Background View
///-----------------------------------
/**
* This method add or hide the background view into nav bar
*
* @param isShow -> Indicate if the nav bar is show or not
*/
- (void)manageBackgroundView:(BOOL)isShow;
@end
|
/*
* linux/arch/arm/plat-omap/sram.c
*
* OMAP SRAM detection and management
*
* Copyright (C) 2005 Nokia Corporation
* Written by Tony Lindgren <tony@atomide.com>
*
* Copyright (C) 2009-2012 Texas Instruments
* Added OMAP4/5 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#undef DEBUG
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/io.h>
#include <asm/fncpy.h>
#include <asm/tlb.h>
#include <asm/cacheflush.h>
#include <asm/mach/map.h>
#include <plat/sram.h>
#define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1)))
static void __iomem *omap_sram_base;
static unsigned long omap_sram_skip;
static unsigned long omap_sram_size;
static void __iomem *omap_sram_ceil;
/*
* Memory allocator for SRAM: calculates the new ceiling address
* for pushing a function using the fncpy API.
*
* Note that fncpy requires the returned address to be aligned
* to an 8-byte boundary.
*/
void *omap_sram_push_address(unsigned long size)
{
unsigned long available, new_ceil = (unsigned long)omap_sram_ceil;
available = omap_sram_ceil - (omap_sram_base + omap_sram_skip);
if (size > available) {
pr_err("Not enough space in SRAM\n");
return NULL;
}
new_ceil -= size;
new_ceil = ROUND_DOWN(new_ceil, 1 << ARCH_FNCPY_ALIGN);
omap_sram_ceil = IOMEM(new_ceil);
return (void *)omap_sram_ceil;
}
/*
* The SRAM context is lost during off-idle and stack
* needs to be reset.
*/
void omap_sram_reset(void)
{
omap_sram_ceil = omap_sram_base + omap_sram_size;
}
/*
* Note that we cannot use ioremap for SRAM, as clock init needs SRAM early.
*/
void __init omap_map_sram(unsigned long start, unsigned long size,
unsigned long skip, int cached)
{
if (size == 0)
return;
start = ROUND_DOWN(start, PAGE_SIZE);
omap_sram_size = size;
omap_sram_skip = skip;
omap_sram_base = __arm_ioremap_exec(start, size, cached);
if (!omap_sram_base) {
pr_err("SRAM: Could not map\n");
return;
}
omap_sram_reset();
/*
* Looks like we need to preserve some bootloader code at the
* beginning of SRAM for jumping to flash for reboot to work...
*/
memset_io(omap_sram_base + omap_sram_skip, 0,
omap_sram_size - omap_sram_skip);
}
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_DOMAIN_RELIABILITY_SCHEDULER_H_
#define COMPONENTS_DOMAIN_RELIABILITY_SCHEDULER_H_
#include <vector>
#include "base/callback.h"
#include "base/memory/scoped_vector.h"
#include "base/time/time.h"
#include "components/domain_reliability/domain_reliability_export.h"
#include "components/domain_reliability/uploader.h"
#include "net/base/backoff_entry.h"
namespace base {
class Value;
} // namespace base
namespace domain_reliability {
class DomainReliabilityConfig;
class MockableTime;
// Determines when an upload should be scheduled. A domain's config will
// specify minimum and maximum upload delays; the minimum upload delay ensures
// that Chrome will not send too many upload requests to a site by waiting at
// least that long after the first beacon, while the maximum upload delay makes
// sure the server receives the reports while they are still fresh.
//
// When everything is working fine, the scheduler will return precisely that
// interval. If all uploaders have failed, then the beginning or ending points
// of the interval may be pushed later to accomodate the retry with exponential
// backoff.
//
// See dispatcher.h for an explanation of what happens with the scheduled
// interval.
class DOMAIN_RELIABILITY_EXPORT DomainReliabilityScheduler {
public:
typedef base::Callback<void(base::TimeDelta, base::TimeDelta)>
ScheduleUploadCallback;
struct Params {
public:
base::TimeDelta minimum_upload_delay;
base::TimeDelta maximum_upload_delay;
base::TimeDelta upload_retry_interval;
static Params GetFromFieldTrialsOrDefaults();
};
DomainReliabilityScheduler(MockableTime* time,
size_t num_collectors,
const Params& params,
const ScheduleUploadCallback& callback);
~DomainReliabilityScheduler();
// If there is no upload pending, schedules an upload based on the provided
// parameters (some time between the minimum and maximum delay from now).
// May call the ScheduleUploadCallback.
void OnBeaconAdded();
// Returns which collector to use for an upload that is about to start. Must
// be called exactly once during or after the ScheduleUploadCallback but
// before OnUploadComplete is called. (Also records the upload start time for
// future retries, if the upload ends up failing.)
size_t OnUploadStart();
// Updates the scheduler state based on the result of an upload. Must be
// called exactly once after |OnUploadStart|. |result| should be the result
// passed to the upload callback by the Uploader.
void OnUploadComplete(const DomainReliabilityUploader::UploadResult& result);
scoped_ptr<base::Value> GetWebUIData() const;
// Disables jitter in BackoffEntries to make scheduling deterministic for
// unit tests.
void MakeDeterministicForTesting();
// Gets the time of the first beacon that has not yet been successfully
// uploaded.
base::TimeTicks first_beacon_time() const { return first_beacon_time_; }
// Gets the time until the next upload attempt on the last collector used.
// This will be 0 if the upload was a success; it does not take into account
// minimum_upload_delay and maximum_upload_delay.
base::TimeDelta last_collector_retry_delay() const {
return last_collector_retry_delay_;
}
private:
void MaybeScheduleUpload();
void GetNextUploadTimeAndCollector(base::TimeTicks now,
base::TimeTicks* upload_time_out,
size_t* collector_index_out);
MockableTime* time_;
Params params_;
ScheduleUploadCallback callback_;
net::BackoffEntry::Policy backoff_policy_;
ScopedVector<net::BackoffEntry> collectors_;
// Whether there are beacons that have not yet been uploaded. Set when a
// beacon arrives or an upload fails, and cleared when an upload starts.
bool upload_pending_;
// Whether the scheduler has called the ScheduleUploadCallback to schedule
// the next upload. Set when an upload is scheduled and cleared when the
// upload starts.
bool upload_scheduled_;
// Whether the last scheduled upload is in progress. Set when the upload
// starts and cleared when the upload completes (successfully or not).
bool upload_running_;
// Index of the collector selected for the next upload. (Set in
// |OnUploadStart| and cleared in |OnUploadComplete|.)
size_t collector_index_;
// Time of the first beacon that was not included in the last successful
// upload.
base::TimeTicks first_beacon_time_;
// first_beacon_time_ saved during uploads. Restored if upload fails.
base::TimeTicks old_first_beacon_time_;
// Time until the next upload attempt on the last collector used. (Saved for
// histograms in Context.)
base::TimeDelta last_collector_retry_delay_;
// Extra bits to return in GetWebUIData.
base::TimeTicks scheduled_min_time_;
base::TimeTicks scheduled_max_time_;
// Whether the other last_upload_* fields are populated.
bool last_upload_finished_;
base::TimeTicks last_upload_start_time_;
base::TimeTicks last_upload_end_time_;
size_t last_upload_collector_index_;
bool last_upload_success_;
};
} // namespace domain_reliability
#endif // COMPONENTS_DOMAIN_RELIABILITY_SCHEDULER_H_
|
//
// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Device.h: Implements the egl::Device class, representing the abstract
// device. Implements EGLDevice.
#ifndef LIBANGLE_DEVICE_H_
#define LIBANGLE_DEVICE_H_
#include "common/angleutils.h"
#include "libANGLE/Error.h"
#include "libANGLE/Display.h"
namespace rx
{
class DeviceImpl;
}
namespace egl
{
class Device final : angle::NonCopyable
{
public:
Device(Display *display, rx::DeviceImpl *impl);
virtual ~Device();
Error getDevice(EGLAttrib *value);
Display *getDisplay() { return mDisplay; };
EGLint getType();
const DeviceExtensions &getExtensions() const;
const std::string &getExtensionString() const;
rx::DeviceImpl *getImplementation() { return mImplementation; }
private:
void initDeviceExtensions();
Display *mDisplay;
rx::DeviceImpl *mImplementation;
DeviceExtensions mDeviceExtensions;
std::string mDeviceExtensionString;
};
}
#endif // LIBANGLE_DEVICE_H_
|
//=================================================================================================
/*!
// \file blazemark/flens/TDVecTDMatMult.h
// \brief Header file for the FLENS transpose dense vector/transpose dense matrix multiplication kernel
//
// Copyright (C) 2013 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You can redistribute it and/or modify it under
// the terms of the New (Revised) BSD License. Redistribution and use in source and binary
// forms, with or without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// 3. Neither the names of the Blaze development group 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 _BLAZEMARK_FLENS_TDVECTDMATMULT_H_
#define _BLAZEMARK_FLENS_TDVECTDMATMULT_H_
//*************************************************************************************************
// Includes
//*************************************************************************************************
#include <blazemark/system/Types.h>
namespace blazemark {
namespace flens {
//=================================================================================================
//
// KERNEL FUNCTIONS
//
//=================================================================================================
//*************************************************************************************************
/*!\name FLENS kernel functions */
//@{
double tdvectdmatmult( size_t N, size_t steps );
//@}
//*************************************************************************************************
} // namespace flens
} // namespace blazemark
#endif
|
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
*/
#ifndef __FRAME_KERN_H_
#define __FRAME_KERN_H_
extern int setup_signal_stack_sc(unsigned long stack_top, struct ksignal *ksig,
struct pt_regs *regs, sigset_t *mask);
extern int setup_signal_stack_si(unsigned long stack_top, struct ksignal *ksig,
struct pt_regs *regs, sigset_t *mask);
#endif
|
/* Parsing of Suboptions Example
Copyright (C) 1991-2015 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 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, if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int do_all;
const char *type;
int read_size;
int write_size;
int read_only;
enum
{
RO_OPTION = 0,
RW_OPTION,
READ_SIZE_OPTION,
WRITE_SIZE_OPTION,
THE_END
};
const char *mount_opts[] =
{
[RO_OPTION] = "ro",
[RW_OPTION] = "rw",
[READ_SIZE_OPTION] = "rsize",
[WRITE_SIZE_OPTION] = "wsize",
[THE_END] = NULL
};
int
main (int argc, char **argv)
{
char *subopts, *value;
int opt;
while ((opt = getopt (argc, argv, "at:o:")) != -1)
switch (opt)
{
case 'a':
do_all = 1;
break;
case 't':
type = optarg;
break;
case 'o':
subopts = optarg;
while (*subopts != '\0')
switch (getsubopt (&subopts, mount_opts, &value))
{
case RO_OPTION:
read_only = 1;
break;
case RW_OPTION:
read_only = 0;
break;
case READ_SIZE_OPTION:
if (value == NULL)
abort ();
read_size = atoi (value);
break;
case WRITE_SIZE_OPTION:
if (value == NULL)
abort ();
write_size = atoi (value);
break;
default:
/* Unknown suboption. */
printf ("Unknown suboption `%s'\n", value);
break;
}
break;
default:
abort ();
}
/* Do the real work. */
return 0;
}
|
/* { dg-do run } */
#include <stdlib.h>
extern int foo(void);
int main(void) {
if (foo())
exit(0);
else
abort();
}
|
/*
* cli_cu_common.h
*
* Copyright(c) 1998 - 2010 Texas Instruments. All rights reserved.
* 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 Texas Instruments 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 common_h
#define common_h
#include "tidef.h"
#ifdef _WINDOWS
#define DRV_NAME "\\\\.\\tiwlnpci"
#endif
#ifndef TIWLAN_DRV_NAME
#define TIWLAN_DRV_NAME DRV_NAME
#endif
#define IN /* input parameter */
#define OUT /* output parameter */
#define INOUT /* input & output parameter */
#ifndef TI_TRUE
#define TI_TRUE 1
#endif
#ifndef TI_FALSE
#define TI_FALSE 0
#endif
#ifndef TI_PENDING
#define TI_PENDING 2
#endif
#ifndef NULL
# define NULL 0L
#endif
#ifndef TI_VOIDCAST
#define TI_VOIDCAST(p) ((void)p)
#endif
#ifdef __LINUX__
#ifndef print
# define print(fmt, arg...) fprintf(stdout, fmt, ##arg)
#endif
#ifndef print_err
# define print_err(fmt, arg...) fprintf(stderr, fmt, ##arg)
#endif
#ifndef print_deb
# ifdef DEBUG_MESSAGES
# define print_deb(fmt, arg...) fprintf(stdout, fmt, ##arg)
# else
# define print_deb(fmt, arg...)
# endif /* DEBUG_MESSAGES */
#endif /* print_deb */
#endif /* __LINUX__ */
#ifndef SIZE_ARR
# define SIZE_ARR(a) (sizeof(a)/sizeof(a[0]) )
#endif
#ifndef min
# define min(a, b) (((a)<(b)) ? (a) : (b))
#endif
#ifndef max
# define max(a, b) (((a)>(b)) ? (a) : (b))
#endif
typedef struct {
TI_UINT32 value;
char *name;
} named_value_t;
#define print_available_values(arr) \
{ int i; for(i=0; i<SIZE_ARR(arr); i++) \
print("%d - %s%s", arr[i].value, arr[i].name, (i>=SIZE_ARR(arr)-1) ? "\n" : ", " ); \
}
void print_memory_dump(char *addr, int size );
#endif /* common_h */
|
/*
* Implement the manual drop-all-pagecache function
*/
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/writeback.h>
#include <linux/sysctl.h>
#include <linux/gfp.h>
/* A global variable is a bit ugly, but it keeps the code simple */
int sysctl_drop_caches;
static void drop_pagecache_sb(struct super_block *sb)
{
struct inode *inode, *toput_inode = NULL;
spin_lock(&inode_lock);
list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW))
continue;
if (inode->i_mapping->nrpages == 0)
continue;
__iget(inode);
spin_unlock(&inode_lock);
invalidate_mapping_pages(inode->i_mapping, 0, -1);
iput(toput_inode);
toput_inode = inode;
spin_lock(&inode_lock);
}
spin_unlock(&inode_lock);
iput(toput_inode);
}
static void drop_pagecache(void)
{
struct super_block *sb;
spin_lock(&sb_lock);
restart:
list_for_each_entry(sb, &super_blocks, s_list) {
sb->s_count++;
spin_unlock(&sb_lock);
down_read(&sb->s_umount);
if (sb->s_root)
drop_pagecache_sb(sb);
up_read(&sb->s_umount);
spin_lock(&sb_lock);
if (__put_super_and_need_restart(sb))
goto restart;
}
spin_unlock(&sb_lock);
}
static void drop_slab(void)
{
int nr_objects;
do {
nr_objects = shrink_slab(1000, GFP_KERNEL, 1000);
} while (nr_objects > 10);
}
int drop_caches_sysctl_handler(ctl_table *table, int write,
struct file *file, void __user *buffer, size_t *length, loff_t *ppos)
{
proc_dointvec_minmax(table, write, file, buffer, length, ppos);
if (write) {
if (sysctl_drop_caches & 1)
drop_pagecache();
if (sysctl_drop_caches & 2)
drop_slab();
}
return 0;
}
|
// Copyright 2018-present the Material Components for iOS 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.
#import <UIKit/UIKit.h>
#import "MDCAlertActionManager.h"
#import "MaterialButtons.h"
@interface MDCAlertControllerView ()
@property(nonatomic, nonnull, strong) UILabel *titleLabel;
@property(nonatomic, nonnull, strong) UILabel *messageLabel;
@property(nonatomic, nullable, strong) UIImageView *titleIconImageView;
@property(nonatomic, nullable, weak) MDCAlertActionManager *actionManager;
- (void)addActionButton:(nonnull MDCButton *)button;
+ (void)styleAsTextButton:(nonnull MDCButton *)button;
- (CGSize)calculatePreferredContentSizeForBounds:(CGSize)boundsSize;
- (void)updateFonts;
@end
|
#ifndef TEST_INTEROP_C_FUNCTION_INPUTS_EMIT_CALLED_INLINE_FUNCTION_H
#define TEST_INTEROP_C_FUNCTION_INPUTS_EMIT_CALLED_INLINE_FUNCTION_H
#ifdef __cplusplus
#define INLINE inline
#else
// When compiling as C, make the functions `static inline`. This is the flavor
// of inline functions for which we require the behavior checked by this test.
// Non-static C inline functions don't require Swift to emit LLVM IR for them
// because the idea is that there will we one `.c` file that declares them
// `extern inline`, causing an out-of-line definition to be emitted to the
// corresponding .o file.
#define INLINE static inline
#endif
INLINE int notCalled() {
return 42;
}
INLINE int calledTransitively() {
return 42;
}
#ifdef __cplusplus
class C {
public:
int memberFunctionCalledTransitively() {
return 42;
}
};
inline int calledTransitivelyFromVarInit() {
return 42;
}
inline int varUsedFromSwift = calledTransitivelyFromVarInit();
#else
// C only allows constant initializers for variables with static storage
// duration, so there's no way to initialize this with the result of a call to
// an inline method. Just provide _some_ definition of `varImportedToSwift` so
// we can import it in the test.
static int varUsedFromSwift = 42;
#endif
INLINE int calledFromSwift() {
#ifdef __cplusplus
C c;
return calledTransitively() + c.memberFunctionCalledTransitively();
#else
return calledTransitively();
#endif
}
#endif
|
/* sparc-specific implementation of profiling support.
Copyright (C) 2008-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David S. Miller <davem@davemloft.net>, 2008
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 <sysdep.h>
/* We must not pollute the global namespace. */
#define mcount_internal __mcount_internal
extern void mcount_internal (u_long frompc, u_long selfpc) internal_function;
#define _MCOUNT_DECL(frompc, selfpc) \
void internal_function mcount_internal (u_long frompc, u_long selfpc)
/* Define MCOUNT as empty since we have the implementation in another
file. */
#define MCOUNT
|
// license:BSD-3-Clause
// copyright-holders:smf, windyfairy
/*
* Konami 573 Memory Card Reader
*
*/
#ifndef MAME_MACHINE_K573_MCR_H
#define MAME_MACHINE_K573_MCR_H
#pragma once
#include "bus/psx/ctlrport.h"
#include "machine/jvsdev.h"
#include "machine/timer.h"
class k573mcr_device : public jvs_device
{
public:
template <typename T>
k573mcr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&jvs_host_tag)
: k573mcr_device(mconfig, tag, owner, clock)
{
host.set_tag(std::forward<T>(jvs_host_tag));
}
k573mcr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ioport_constructor device_input_ports() const override;
DECLARE_WRITE_LINE_MEMBER(write_rxd);
protected:
template <uint8_t First> void set_port_tags() { }
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
// JVS device overrides
virtual const char *device_id() override;
virtual uint8_t command_format_version() override;
virtual uint8_t jvs_standard_version() override;
virtual uint8_t comm_method_version() override;
virtual int handle_message(const uint8_t *send_buffer, uint32_t send_size, uint8_t *&recv_buffer) override;
private:
enum {
MEMCARD_UNINITIALIZED = 0x0000, // Default value, also used after writing?
MEMCARD_ERROR = 0x0002,
MEMCARD_UNAVAILABLE = 0x0008, // Card is not inserted
MEMCARD_READING = 0x0200, // Read request is executing
MEMCARD_WRITING = 0x0400, // Write request is executing
MEMCARD_AVAILABLE = 0x8000 // Can be combined with MEMCARD_READING and MEMCARD_WRITING for busy state
};
enum {
RAM_SIZE = 0x400000,
MEMCARD_BLOCK_SIZE = 128
};
void controller_set_port(uint32_t port_no);
uint8_t controller_port_send_byte(uint8_t data);
bool pad_read(uint32_t port_no, uint8_t *output);
bool memcard_read(uint32_t port_no, uint16_t block_addr, uint8_t *output);
bool memcard_write(uint32_t port_no, uint16_t block_addr, uint8_t *input);
std::unique_ptr<uint8_t[]> m_ram;
uint16_t m_status;
bool m_is_memcard_initialized;
uint8_t m_psx_rx_data, m_psx_rx_bit;
bool m_psx_clock;
required_device<psxcontrollerports_device> m_controllers;
required_ioport m_meta;
};
DECLARE_DEVICE_TYPE(KONAMI_573_MEMORY_CARD_READER, k573mcr_device)
#endif // MAME_MACHINE_K573_MCR_H
|
/***************************************************************************
qgswcsdataitems.h
---------------------
begin : 2 July, 2012
copyright : (C) 2012 by Radim Blazek
email : radim dot blazek at 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. *
* *
***************************************************************************/
#ifndef QGSWCSDATAITEMS_H
#define QGSWCSDATAITEMS_H
#include "qgsdataitem.h"
#include "qgsdatasourceuri.h"
#include "qgswcscapabilities.h"
class QgsWCSConnectionItem : public QgsDataCollectionItem
{
Q_OBJECT
public:
QgsWCSConnectionItem( QgsDataItem* parent, QString name, QString path, QString uri );
~QgsWCSConnectionItem();
QVector<QgsDataItem*> createChildren() override;
virtual bool equal( const QgsDataItem *other ) override;
virtual QList<QAction*> actions() override;
QgsWcsCapabilities mCapabilities;
QVector<QgsWcsCoverageSummary> mLayerProperties;
public slots:
void editConnection();
void deleteConnection();
private:
QString mUri;
};
// WCS Layers may be nested, so that they may be both QgsDataCollectionItem and QgsLayerItem
// We have to use QgsDataCollectionItem and support layer methods if necessary
class QgsWCSLayerItem : public QgsLayerItem
{
Q_OBJECT
public:
QgsWCSLayerItem( QgsDataItem* parent, QString name, QString path,
const QgsWcsCapabilitiesProperty& capabilitiesProperty, QgsDataSourceURI dataSourceUri, const QgsWcsCoverageSummary& coverageSummary );
~QgsWCSLayerItem();
QString createUri();
QgsWcsCapabilitiesProperty mCapabilities;
QgsDataSourceURI mDataSourceUri;
QgsWcsCoverageSummary mCoverageSummary;
};
class QgsWCSRootItem : public QgsDataCollectionItem
{
Q_OBJECT
public:
QgsWCSRootItem( QgsDataItem* parent, QString name, QString path );
~QgsWCSRootItem();
QVector<QgsDataItem*> createChildren() override;
virtual QList<QAction*> actions() override;
virtual QWidget * paramWidget() override;
public slots:
void connectionsChanged();
void newConnection();
};
#endif // QGSWCSDATAITEMS_H
|
/* { dg-do compile } */
/* { dg-require-effective-target label_values } */
void foo (void);
void bar (void *);
extern int t;
static void kmalloc_large (int size, int flags)
{
(void) size;
(void) flags;
foo ();
bar (({__here:&&__here;}));
}
static void kmalloc (int size, int flags)
{
if (size)
{
if ((unsigned long) size > 0x1000)
kmalloc_large (size, flags);
if (flags)
bar (({__here:&&__here;}));
}
}
void compress_file_range (int i, int j, int k)
{
int nr_pages = ({j < k;});
if (i || t)
kmalloc (0x1000UL * nr_pages, 0x40UL);
}
|
/* Install given floating-point environment and raise exceptions.
Copyright (C) 1997-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
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 <fenv.h>
int
__feupdateenv (const fenv_t *envp)
{
fexcept_t fpsr;
/* Save current exceptions. */
__asm__ ("fmove%.l %/fpsr,%0" : "=dm" (fpsr));
fpsr &= FE_ALL_EXCEPT;
/* Install new environment. */
__fesetenv (envp);
/* Raise the saved exception. Incidently for us the implementation
defined format of the values in objects of type fexcept_t is the
same as the ones specified using the FE_* constants. */
__feraiseexcept ((int) fpsr);
/* Success. */
return 0;
}
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
libm_hidden_def (__feupdateenv)
libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
|
// license:BSD-3-Clause
// copyright-holders:Aaron Giles, Phil Bennett
/*************************************************************************
Atari Cyberstorm hardware
*************************************************************************/
#ifndef MAME_INCLUDES_CYBSTORM_H
#define MAME_INCLUDES_CYBSTORM_H
#pragma once
#include "audio/atarijsa.h"
#include "machine/bankdev.h"
#include "video/atarivad.h"
#include "screen.h"
#include "tilemap.h"
class cybstorm_state : public driver_device
{
public:
cybstorm_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_jsa(*this, "jsa")
, m_vad(*this, "vad")
, m_vadbank(*this, "vadbank")
, m_screen(*this, "screen")
, m_gfxdecode(*this, "gfxdecode")
{ }
void init_cybstorm();
void cybstorm(machine_config &config);
protected:
virtual void machine_start() override;
virtual void video_start() override;
uint32_t special_port1_r();
void latch_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
TILE_GET_INFO_MEMBER(get_alpha_tile_info);
TILE_GET_INFO_MEMBER(get_playfield_tile_info);
TILE_GET_INFO_MEMBER(get_playfield2_tile_info);
TILEMAP_MAPPER_MEMBER(playfield_scan);
uint32_t screen_update_cybstorm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void round2(machine_config &config);
void main_map(address_map &map);
void vadbank_map(address_map &map);
private:
required_device<cpu_device> m_maincpu;
optional_device<atari_jsa_iiis_device> m_jsa;
required_device<atari_vad_device> m_vad;
required_device<address_map_bank_device> m_vadbank;
required_device<screen_device> m_screen;
required_device<gfxdecode_device> m_gfxdecode;
uint32_t m_latch_data;
uint8_t m_alpha_tile_bank;
static const atari_motion_objects_config s_mob_config;
};
#endif // MAME_INCLUDES_CYBSTORM_H
|
//////////////////////////////////////////////////////////////////////////////
//
// Philips LPC2129 ARM7TDMI LED/Switch Example
//
// This example demonstrates writing to and reading from
// the GPIO port.
// (1) flash the LED 10 times
// (2) wait for key-press, turn off LED if key is pressed
//
// WinARM example by Martin THOMAS, Kaiserslautern, Germany
// (eversmith@heizung-thomas.de)
// http://www.siwawi.arubi.uni-kl.de/avr_projects
//////////////////////////////////////////////////////////////////////////////
#include "lpc21xx.h"
#include "lpc2138.h"
#include "dev_board.h"
static void delay(void )
{
volatile int i,j;
for (i=0;i<100;i++)
for (j=0;j<1000;j++);
}
int main(void)
{
int i;
MAMCR = 2; // MAM functions fully enabled
LED_INIT();
YELLOW_LED_OFF();
GREEN_LED_OFF();
BUTTON_INIT();
i=0;
while (i<10) {
YELLOW_LED_ON();
GREEN_LED_OFF();
delay();
YELLOW_LED_OFF();
GREEN_LED_ON();
delay();
i++;
}
while (1)
{
if (BUTTTON1_OFF()) {
YELLOW_LED_ON();
}
else {
YELLOW_LED_OFF();
}
if (BUTTTON2_OFF()) {
GREEN_LED_ON();
}
else {
GREEN_LED_OFF();
}
}
return 0; // never reached
}
|
/* Blackfin Ethernet Media Access Controller (EMAC) model.
Copyright (C) 2010-2012 Free Software Foundation, Inc.
Contributed by Analog Devices, Inc.
This file is part of simulators.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef DV_BFIN_EMAC_H
#define DV_BFIN_EMAC_H
/* EMAC_OPMODE Masks */
#define RE (1 << 0)
#define ASTP (1 << 1)
#define PR (1 << 7)
#define TE (1 << 16)
/* EMAC_STAADD Masks */
#define STABUSY (1 << 0)
#define STAOP (1 << 1)
#define STADISPRE (1 << 2)
#define STAIE (1 << 3)
#define REGAD_SHIFT 6
#define REGAD_MASK (0x1f << REGAD_SHIFT)
#define REGAD(val) (((val) & REGAD_MASK) >> REGAD_SHIFT)
#define PHYAD_SHIFT 11
#define PHYAD_MASK (0x1f << PHYAD_SHIFT)
#define PHYAD(val) (((val) & PHYAD_MASK) >> PHYAD_SHIFT)
/* EMAC_SYSCTL Masks */
#define PHYIE (1 << 0)
#define RXDWA (1 << 1)
#define RXCKS (1 << 2)
#define TXDWA (1 << 4)
/* EMAC_RX_STAT Masks */
#define RX_FRLEN 0x7ff
#define RX_COMP (1 << 12)
#define RX_OK (1 << 13)
#define RX_ACCEPT (1 << 31)
/* EMAC_TX_STAT Masks */
#define TX_COMP (1 << 0)
#define TX_OK (1 << 1)
#endif
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_ACCEPT_LANGUAGES_FACTORY_H_
#define CHROME_BROWSER_TRANSLATE_TRANSLATE_ACCEPT_LANGUAGES_FACTORY_H_
#include "base/macros.h"
#include "base/memory/singleton.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
namespace translate {
class TranslateAcceptLanguages;
}
// TranslateAcceptLanguagesFactory is a way to associate a
// TranslateAcceptLanguages instance to a BrowserContext.
class TranslateAcceptLanguagesFactory
: public BrowserContextKeyedServiceFactory {
public:
static translate::TranslateAcceptLanguages* GetForBrowserContext(
content::BrowserContext* browser_context);
static TranslateAcceptLanguagesFactory* GetInstance();
private:
friend struct base::DefaultSingletonTraits<TranslateAcceptLanguagesFactory>;
TranslateAcceptLanguagesFactory();
~TranslateAcceptLanguagesFactory() override;
// BrowserContextKeyedServiceFactory:
KeyedService* BuildServiceInstanceFor(
content::BrowserContext* profile) const override;
content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override;
DISALLOW_COPY_AND_ASSIGN(TranslateAcceptLanguagesFactory);
};
#endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_ACCEPT_LANGUAGES_FACTORY_H_
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_OZONE_H_
#define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_OZONE_H_
#include "base/macros.h"
#include "chrome/browser/extensions/global_shortcut_listener.h"
namespace extensions {
// Ozone-specific implementation of the GlobalShortcutListener class that
// listens for global shortcuts. Handles basic keyboard intercepting and
// forwards its output to the base class for processing.
class GlobalShortcutListenerOzone : public GlobalShortcutListener {
public:
GlobalShortcutListenerOzone();
~GlobalShortcutListenerOzone() override;
private:
// GlobalShortcutListener implementation.
void StartListening() override;
void StopListening() override;
bool RegisterAcceleratorImpl(const ui::Accelerator& accelerator) override;
void UnregisterAcceleratorImpl(const ui::Accelerator& accelerator) override;
// Whether this object is listening for global shortcuts.
bool is_listening_;
DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerOzone);
};
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_OZONE_H_
|
/*
* Copyright (C) 2012, 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:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*/
#ifndef DOMWindowFileSystem_h
#define DOMWindowFileSystem_h
#include "platform/heap/Handle.h"
#include "wtf/text/WTFString.h"
namespace blink {
class DOMWindow;
class EntryCallback;
class ErrorCallback;
class FileSystemCallback;
class DOMWindowFileSystem {
public:
static void webkitRequestFileSystem(DOMWindow&, int type, long long size, FileSystemCallback*, ErrorCallback*);
static void webkitResolveLocalFileSystemURL(DOMWindow&, const String&, EntryCallback*, ErrorCallback*);
// They are placed here and in all capital letters so they can be checked against the constants in the
// IDL at compile time.
enum {
TEMPORARY,
PERSISTENT,
};
private:
DOMWindowFileSystem();
~DOMWindowFileSystem();
};
} // namespace blink
#endif // DOMWindowFileSystem_h
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.