text stringlengths 4 6.14k |
|---|
#undef CONFIG_RUNLEVEL
|
/* Copyright (C) 2004, 2005 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.
In addition to the permissions in the GNU Lesser General Public
License, the Free Software Foundation gives you unlimited
permission to link the compiled version of this file with other
programs, and to distribute those programs without any restriction
coming from the use of this file. (The GNU Lesser General Public
License restrictions do apply in other respects; for example, they
cover modification of the file, and distribution when not linked
into another program.)
Note that people who make modified versions of this file are not
obligated to grant this special exception for their modified
versions; it is their choice whether to do so. The GNU Lesser
General Public License gives permission to release a modified
version without this exception; this exception also makes it
possible to release a modified version which carries forward this
exception.
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 <math.h>
const double __aeabi_HUGE_VAL attribute_hidden = HUGE_VAL;
const long double __aeabi_HUGE_VALL attribute_hidden = HUGE_VALL;
const float __aeabi_HUGE_VALF attribute_hidden = HUGE_VALF;
const float __aeabi_INFINITY attribute_hidden = INFINITY;
const float __aeabi_NAN attribute_hidden = NAN;
|
/* Pthreads test program.
Copyright 1996-2014 Free Software Foundation, Inc.
Written by Fred Fish of Cygnus Support
Contributed by Cygnus Support
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
/* Under HPUX 10, the second arg of pthread_create
is prototyped to be just a "pthread_attr_t", while under Solaris it
is a "pthread_attr_t *". Arg! */
#if defined (__hpux__)
#define PTHREAD_CREATE_ARG2(arg) arg
#define PTHREAD_CREATE_NULL_ARG2 null_attr
static pthread_attr_t null_attr;
#else
#define PTHREAD_CREATE_ARG2(arg) &arg
#define PTHREAD_CREATE_NULL_ARG2 NULL
#endif
static int verbose = 0;
static void
common_routine (arg)
int arg;
{
static int from_thread1;
static int from_thread2;
static int from_main;
static int hits;
static int full_coverage;
if (verbose) printf("common_routine (%d)\n", arg);
hits++;
switch (arg)
{
case 0:
from_main++;
break;
case 1:
from_thread1++;
break;
case 2:
from_thread2++;
break;
}
if (from_main && from_thread1 && from_thread2)
full_coverage = 1;
}
static void *
thread1 (void *arg)
{
int i;
int z = 0;
if (verbose) printf ("thread1 (%0lx) ; pid = %d\n", (long) arg, getpid ());
for (i=1; i <= 10000000; i++)
{
if (verbose) printf("thread1 %ld\n", (long) pthread_self ());
z += i;
common_routine (1);
sleep(1);
}
return (void *) 0;
}
static void *
thread2 (void * arg)
{
int i;
int k = 0;
if (verbose) printf ("thread2 (%0lx) ; pid = %d\n", (long) arg, getpid ());
for (i=1; i <= 10000000; i++)
{
if (verbose) printf("thread2 %ld\n", (long) pthread_self ());
k += i;
common_routine (2);
sleep(1);
}
sleep(100);
return (void *) 0;
}
void
foo (a, b, c)
int a, b, c;
{
int d, e, f;
if (verbose) printf("a=%d\n", a);
}
main(argc, argv)
int argc;
char **argv;
{
pthread_t tid1, tid2;
int j;
int t = 0;
void (*xxx) ();
pthread_attr_t attr;
if (verbose) printf ("pid = %d\n", getpid());
foo (1, 2, 3);
if (pthread_attr_init (&attr))
{
perror ("pthread_attr_init 1");
exit (1);
}
#ifdef PTHREAD_SCOPE_SYSTEM
if (pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM))
{
perror ("pthread_attr_setscope 1");
exit (1);
}
#endif
if (pthread_create (&tid1, PTHREAD_CREATE_ARG2(attr), thread1, (void *) 0xfeedface))
{
perror ("pthread_create 1");
exit (1);
}
if (verbose) printf ("Made thread %ld\n", (long) tid1);
sleep (1);
if (pthread_create (&tid2, PTHREAD_CREATE_NULL_ARG2, thread2, (void *) 0xdeadbeef))
{
perror ("pthread_create 2");
exit (1);
}
if (verbose) printf("Made thread %ld\n", (long) tid2);
sleep (1);
for (j = 1; j <= 10000000; j++)
{
if (verbose) printf("top %ld\n", (long) pthread_self ());
common_routine (0);
sleep(1);
t += j;
}
exit(0);
}
|
/**********************************************************************
Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
***********************************************************************/
#ifndef FC__BITVECTOR_H
#define FC__BITVECTOR_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include <stdlib.h> /* size_t */
#include <string.h> /* memset */
/* utility */
#include "log.h"
#include "support.h" /* bool, fc__attribute */
/* Yields TRUE iff the bit bit_no is set in val. */
#define TEST_BIT(val, bit_no) \
(((val) & (1u << (bit_no))) == (1u << (bit_no)))
/* Dynamic bitvectors */
struct dbv {
int bits;
unsigned char *vec;
};
void dbv_init(struct dbv *pdbv, int bits);
void dbv_resize(struct dbv *pdbv, int bits);
void dbv_free(struct dbv *pdbv);
int dbv_bits(struct dbv *pdbv);
bool dbv_isset(const struct dbv *pdbv, int bit);
bool dbv_isset_any(const struct dbv *pdbv);
void dbv_set(struct dbv *pdbv, int bit);
void dbv_set_all(struct dbv *pdbv);
void dbv_clr(struct dbv *pdbv, int bit);
void dbv_clr_all(struct dbv *pdbv);
bool dbv_are_equal(const struct dbv *pdbv1, const struct dbv *pdbv2);
void dbv_debug(struct dbv *pdbv);
/* Maximal size of a dynamic bitvector.
Use a large value to be on the safe side (4Mbits = 512kbytes). */
#define MAX_DBV_LENGTH (4 * 1024 * 1024)
/* Static bitvectors. */
#define _BV_BYTES(bits) ((((bits) - 1) / 8) + 1)
#define _BV_BYTE_INDEX(bits) ((bits) / 8)
#define _BV_BITMASK(bit) (1u << ((bit) & 0x7))
#ifdef DEBUG
# define _BV_ASSERT(bv, bit) fc_assert((bit) >= 0 \
&& (bit) < (signed int) sizeof((bv).vec) * 8)
#else
# define _BV_ASSERT(bv, bit) (void)0
#endif
#define BV_ISSET(bv, bit) \
(_BV_ASSERT(bv, bit), \
((bv).vec[_BV_BYTE_INDEX(bit)] & _BV_BITMASK(bit)) != 0)
#define BV_SET(bv, bit) \
do { \
_BV_ASSERT(bv, bit); \
(bv).vec[_BV_BYTE_INDEX(bit)] |= _BV_BITMASK(bit); \
} while(FALSE)
#define BV_CLR(bv, bit) \
do { \
_BV_ASSERT(bv, bit); \
(bv).vec[_BV_BYTE_INDEX(bit)] &= ~_BV_BITMASK(bit); \
} while(FALSE)
#define BV_CLR_ALL(bv) \
do { \
memset((bv).vec, 0, sizeof((bv).vec)); \
} while(FALSE)
#define BV_SET_ALL(bv) \
do { \
memset((bv).vec, 0xff, sizeof((bv).vec)); \
} while(FALSE)
bool bv_check_mask(const unsigned char *vec1, const unsigned char *vec2,
size_t size1, size_t size2);
#define BV_CHECK_MASK(vec1, vec2) \
bv_check_mask((vec1).vec, (vec2).vec, sizeof((vec1).vec), \
sizeof((vec2).vec))
#define BV_ISSET_ANY(vec) BV_CHECK_MASK(vec, vec)
bool bv_are_equal(const unsigned char *vec1, const unsigned char *vec2,
size_t size1, size_t size2);
#define BV_ARE_EQUAL(vec1, vec2) \
bv_are_equal((vec1).vec, (vec2).vec, sizeof((vec1).vec), \
sizeof((vec2).vec))
/* Used to make a BV typedef. Such types are usually called "bv_foo". */
#define BV_DEFINE(name, bits) \
typedef struct { unsigned char vec[_BV_BYTES(bits)]; } name
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* FC__BITVECTOR_H */
|
/*
* lowlevel/init.c - Calls initialization code for configured drivers.
*/
#include <linux/config.h>
#ifdef CONFIG_LOWLEVEL_SOUND
extern int attach_aci(void);
extern void unload_aci(void);
void
sound_init_lowlevel_drivers(void)
{
#ifdef CONFIG_ACI_MIXER
attach_aci();
#endif
}
void
sound_unload_lowlevel_drivers(void)
{
#ifdef CONFIG_ACI_MIXER
unload_aci();
#endif
}
#endif
|
/*
ReactOS Sound System
Device type IDs and macros
Author:
Andrew Greenwood (silverblade@reactos.org)
History:
14 Feb 2009 - Split from ntddsnd.h
These are enhancements to the original NT4 DDK audio device header
files.
*/
#ifndef SNDTYPES_H
#define SNDTYPES_H
/*
Device types
Based on the values stored into the registry by the NT4 sndblst
driver.
*/
typedef enum
{
// The sound device types
WAVE_IN_DEVICE_TYPE = 1,
WAVE_OUT_DEVICE_TYPE = 2,
MIDI_IN_DEVICE_TYPE = 3,
MIDI_OUT_DEVICE_TYPE = 4,
AUX_DEVICE_TYPE = 5,
MIXER_DEVICE_TYPE = 6,
// Range of valid device type IDs
MIN_SOUND_DEVICE_TYPE = 1,
MAX_SOUND_DEVICE_TYPE = 6,
// Number of sound device types
SOUND_DEVICE_TYPES = 6
} SOUND_DEVICE_TYPE;
#define IS_VALID_SOUND_DEVICE_TYPE(x) \
( ( x >= MIN_SOUND_DEVICE_TYPE ) && ( x <= MAX_SOUND_DEVICE_TYPE ) )
#define IS_WAVE_DEVICE_TYPE(x) \
( ( x == WAVE_IN_DEVICE_TYPE ) || ( x == WAVE_OUT_DEVICE_TYPE ) )
#define IS_MIDI_DEVICE_TYPE(x) \
( ( x == MIDI_IN_DEVICE_TYPE ) || ( x == MIDI_OUT_DEVICE_TYPE ) )
#define IS_AUX_DEVICE_TYPE(x) \
( x == AUX_DEVICE_TYPE )
#define IS_MIXER_DEVICE_TYPE(x) \
( x == MIXER_DEVICE_TYPE )
#endif
|
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef ATOM_CLASS
AtomStyle(tri,AtomVecTri)
#else
#ifndef LMP_ATOM_VEC_TRI_H
#define LMP_ATOM_VEC_TRI_H
#include "atom_vec.h"
namespace LAMMPS_NS {
class AtomVecTri : public AtomVec {
public:
struct Bonus {
double quat[4];
double c1[3],c2[3],c3[3];
double inertia[3];
int ilocal;
};
struct Bonus *bonus;
AtomVecTri(class LAMMPS *);
~AtomVecTri();
void init();
void grow(int);
void grow_reset();
void copy(int, int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);
int pack_comm_hybrid(int, int *, double *);
void unpack_comm(int, int, double *);
void unpack_comm_vel(int, int, double *);
int unpack_comm_hybrid(int, int, double *);
int pack_reverse(int, int, double *);
int pack_reverse_hybrid(int, int, double *);
void unpack_reverse(int, int *, double *);
int unpack_reverse_hybrid(int, int *, double *);
int pack_border(int, int *, double *, int, int *);
int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
void unpack_border(int, int, double *);
void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, int, double *);
int pack_exchange(int, double *);
int unpack_exchange(double *);
int size_restart();
int pack_restart(int, double *);
int unpack_restart(double *);
void create_atom(int, double *);
void data_atom(double *, imageint, char **);
int data_atom_hybrid(int, char **);
void data_vel(int, char **);
int data_vel_hybrid(int, char **);
void pack_data(double **);
int pack_data_hybrid(int, double *);
void write_data(FILE *, int, double **);
int write_data_hybrid(FILE *, double *);
void pack_vel(double **);
int pack_vel_hybrid(int, double *);
void write_vel(FILE *, int, double **);
int write_vel_hybrid(FILE *, double *);
bigint memory_usage();
// manipulate Bonus data structure for extra atom info
void clear_bonus();
void data_atom_bonus(int, char **);
// unique to AtomVecTri
void set_equilateral(int, double);
private:
tagint *tag;
int *type,*mask;
imageint *image;
double **x,**v,**f;
tagint *molecule;
double *rmass,*radius;
double **omega,**angmom,**torque;
int *tri;
int nlocal_bonus,nghost_bonus,nmax_bonus;
void grow_bonus();
void copy_bonus(int, int);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Atom_style tri can only be used in 3d simulations
Self-explanatory.
E: Per-processor system is too big
The number of owned atoms plus ghost atoms on a single
processor must fit in 32-bit integer.
E: Invalid atom type in Atoms section of data file
Atom types must range from 1 to specified # of types.
E: Invalid density in Atoms section of data file
Density value cannot be <= 0.0.
E: Assigning tri parameters to non-tri atom
Self-explanatory.
E: Invalid shape in Triangles section of data file
Two or more of the triangle corners are duplicate points.
E: Inconsistent triangle in data file
The centroid of the triangle as defined by the corner points is not
the atom coordinate.
E: Insufficient Jacobi rotations for triangle
The calculation of the intertia tensor of the triangle failed. This
should not happen if it is a reasonably shaped triangle.
*/
|
/* 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 XEEN_WORLDOFXEEN_WORLDOFXEEN_H
#define XEEN_WORLDOFXEEN_WORLDOFXEEN_H
#include "xeen/xeen.h"
#include "xeen/worldofxeen/clouds_cutscenes.h"
#include "xeen/worldofxeen/darkside_cutscenes.h"
namespace Xeen {
namespace WorldOfXeen {
enum WOXGameAction {
WOX_QUIT, WOX_CLOUDS_INTRO, WOX_CLOUDS_ENDING, WOX_DARKSIDE_INTRO,
WOX_DARKSIDE_ENDING, WOX_WORLD_ENDING, WOX_MENU, WOX_PLAY_GAME
};
/**
* Implements a descendant of the base Xeen engine to handle
* Clouds of Xeen, Dark Side of Xeen, and Worlds of Xeen specific
* game code
*/
class WorldOfXeenEngine: public XeenEngine, public CloudsCutscenes,
public DarkSideCutscenes {
protected:
/**
* Outer gameplay loop responsible for dispatching control to game-specific
* intros, main menus, or to play the actual game
*/
virtual void outerGameLoop();
public:
bool _seenDarkSideIntro;
WOXGameAction _pendingAction;
public:
WorldOfXeenEngine(OSystem *syst, const XeenGameDescription *gameDesc);
virtual ~WorldOfXeenEngine() {}
/**
* Set the next overall game action to do
*/
void setPendingAction(WOXGameAction action) { _pendingAction = action; }
};
} // End of namespace WorldOfXeen
} // End of namespace Xeen
#endif /* XEEN_WORLDOFXEEN_WORLDOFXEEN_H */
|
//////////////////////////////////////////////////////////////////////////////////
// nvme_main.c for Cosmos+ OpenSSD
// Copyright (c) 2016 Hanyang University ENC Lab.
// Contributed by Yong Ho Song <yhsong@enc.hanyang.ac.kr>
// Youngjin Jo <yjjo@enc.hanyang.ac.kr>
// Sangjin Lee <sjlee@enc.hanyang.ac.kr>
// Jaewook Kwak <jwkwak@enc.hanyang.ac.kr>
// Kibin Park <kbpark@enc.hanyang.ac.kr>
//
// This file is part of Cosmos+ OpenSSD.
//
// Cosmos+ OpenSSD 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.
//
// Cosmos+ OpenSSD 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 Cosmos+ OpenSSD; see the file COPYING.
// If not, see <http://www.gnu.org/licenses/>.
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
// Company: ENC Lab. <http://enc.hanyang.ac.kr>
// Engineer: Sangjin Lee <sjlee@enc.hanyang.ac.kr>
// Jaewook Kwak <jwkwak@enc.hanyang.ac.kr>
// Kibin Park <kbpark@enc.hanyang.ac.kr>
//
// Project Name: Cosmos+ OpenSSD
// Design Name: Cosmos+ Firmware
// Module Name: NVMe Main
// File Name: nvme_main.c
//
// Version: v1.2.0
//
// Description:
// - initializes FTL and NAND
// - handles NVMe controller
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
// Revision History:
//
// * v1.2.0
// - header file for buffer is changed from "ia_lru_buffer.h" to "lru_buffer.h"
// - Low level scheduler execution is allowed when there is no i/o command
//
// * v1.1.0
// - DMA status initialization is added
//
// * v1.0.0
// - First draft
//////////////////////////////////////////////////////////////////////////////////
#include "string.h"
#include "xil_printf.h"
#include "debug.h"
#include "io_access.h"
#include "nvme.h"
#include "host_lld.h"
#include "nvme_main.h"
#include "nvme_admin_cmd.h"
#include "nvme_io_cmd.h"
#include "../lru_buffer.h"
#include "../low_level_scheduler.h"
volatile NVME_CONTEXT g_nvmeTask;
void nvme_main()
{
unsigned int exeLlr;
g_nvmeTask.status = NVME_TASK_IDLE;
g_nvmeTask.cacheEn = 0;
g_hostDmaStatus.fifoTail.autoDmaRx = 0;
g_hostDmaStatus.autoDmaRxCnt = 0;
g_hostDmaStatus.fifoTail.autoDmaTx = 0;
g_hostDmaStatus.autoDmaTxCnt = 0;
g_hostDmaAssistStatus.autoDmaRxOverFlowCnt = 0;
g_hostDmaAssistStatus.autoDmaTxOverFlowCnt = 0;
xil_printf("!!! Wait until FTL reset complete !!! \r\n");
LRUBufInit();
InitChCtlReg();
InitDieReqQueue();
InitDieStatusTable();
InitNandReset();
EmptyLowLevelQ(SUB_REQ_QUEUE);
InitFtlMapTable();
xil_printf("\r\nFTL reset complete!!! \r\n");
xil_printf("Turn on the host PC \r\n");
while(1)
{
exeLlr = 1;
if(g_nvmeTask.status == NVME_TASK_WAIT_CC_EN)
{
unsigned int ccEn;
ccEn = check_nvme_cc_en();
if(ccEn == 1)
{
set_nvme_admin_queue(1, 1, 1);
set_nvme_csts_rdy(1);
g_nvmeTask.status = NVME_TASK_RUNNING;
xil_printf("\r\nNVMe ready!!!\r\n");
}
}
else if(g_nvmeTask.status == NVME_TASK_RUNNING)
{
NVME_COMMAND nvmeCmd;
unsigned int cmdValid;
cmdValid = get_nvme_cmd(&nvmeCmd.qID, &nvmeCmd.cmdSlotTag, &nvmeCmd.cmdSeqNum, nvmeCmd.cmdDword);
if(cmdValid == 1)
{
if(nvmeCmd.qID == 0)
{
handle_nvme_admin_cmd(&nvmeCmd);
}
else
{
handle_nvme_io_cmd(&nvmeCmd);
exeLlr = 0;
}
}
}
else if(g_nvmeTask.status == NVME_TASK_SHUTDOWN)
{
NVME_STATUS_REG nvmeReg;
nvmeReg.dword = IO_READ32(NVME_STATUS_REG_ADDR);
if(nvmeReg.ccShn != 0)
{
unsigned int qID;
set_nvme_csts_shst(1);
for(qID = 0; qID < 8; qID++)
{
set_io_cq(qID, 0, 0, 0, 0, 0, 0);
set_io_sq(qID, 0, 0, 0, 0, 0);
}
set_nvme_admin_queue(0, 0, 0);
g_nvmeTask.cacheEn = 0;
set_nvme_csts_shst(2);
g_nvmeTask.status = NVME_TASK_WAIT_RESET;
xil_printf("\r\nNVMe shutdown!!!\r\n");
}
}
else if(g_nvmeTask.status == NVME_TASK_WAIT_RESET)
{
unsigned int ccEn;
ccEn = check_nvme_cc_en();
if(ccEn == 0)
{
g_nvmeTask.cacheEn = 0;
set_nvme_csts_shst(0);
set_nvme_csts_rdy(0);
g_nvmeTask.status = NVME_TASK_IDLE;
xil_printf("\r\nNVMe disable!!!\r\n");
}
}
else if(g_nvmeTask.status == NVME_TASK_RESET)
{
unsigned int qID;
for(qID = 0; qID < 8; qID++)
{
set_io_cq(qID, 0, 0, 0, 0, 0, 0);
set_io_sq(qID, 0, 0, 0, 0, 0);
}
g_nvmeTask.cacheEn = 0;
set_nvme_admin_queue(0, 0, 0);
set_nvme_csts_shst(0);
set_nvme_csts_rdy(0);
g_nvmeTask.status = NVME_TASK_IDLE;
xil_printf("\r\nNVMe reset!!!\r\n");
}
if(exeLlr && reservedReq)
ExeLowLevelReq(SUB_REQ_QUEUE);
}
}
|
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef O2_TRD_GEOMETRYFLAT_H
#define O2_TRD_GEOMETRYFLAT_H
#ifndef GPUCA_GPUCODE_DEVICE
#include <cstring>
#endif
#include "FlatObject.h"
#include "GPUCommonDef.h"
#include "GPUCommonTransform3D.h"
#include "TRDBase/GeometryBase.h"
#include "TRDBase/PadPlane.h"
#include "DataFormatsTRD/Constants.h"
namespace o2
{
namespace trd
{
class Geometry;
//Reduced flat version of TRD geometry class.
//Contains all entries required for tracking on GPUs.
class GeometryFlat : public o2::gpu::FlatObject, public GeometryBase
{
public:
#ifndef GPUCA_GPUCODE_DEVICE
GeometryFlat() = default;
GeometryFlat(const GeometryFlat& v) : FlatObject(), GeometryBase()
{
memcpy((void*)this, (void*)&v, sizeof(*this));
}
GeometryFlat(const Geometry& geo);
~GeometryFlat() = default;
#endif
GPUd() const o2::gpu::Transform3D* getMatrixT2L(int det) const
{
if (mMatrixIndirection[det] == -1) {
return nullptr;
}
return &mMatrixCache[mMatrixIndirection[det]];
;
}
GPUd() bool chamberInGeometry(int det) const
{
return (mMatrixIndirection[det] >= 0);
}
private:
o2::gpu::Transform3D mMatrixCache[constants::NCHAMBER];
short mMatrixIndirection[constants::MAXCHAMBER];
};
} // namespace trd
} // namespace o2
#endif
|
/*
* This file is part of HiKoB Openlab.
*
* HiKoB Openlab is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, version 3.
*
* HiKoB Openlab 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 HiKoB Openlab. If not, see
* <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2011 HiKoB.
*/
/*
* gpio.c
*
* Created on: Jul 6, 2011
* Author: Clément Burin des Roziers <clement.burin-des-roziers.at.hikob.com>
*/
#include "gpio.h"
#include "gpio_.h"
#include "gpio_registers.h"
#include "rcc.h"
void gpio_enable(gpio_t gpio)
{
const _gpio_t *_gpio = gpio;
// Set the GPIOx_EN bit in the AHB clock enable register
rcc_ahb_enable(_gpio->ahb_bit);
}
void gpio_disable(gpio_t gpio)
{
const _gpio_t *_gpio = gpio;
// Clear the GPIOx_EN bit in the AHB clock enable register
rcc_ahb_disable(_gpio->ahb_bit);
}
void gpio_set_output(gpio_t gpio, gpio_pin_t pin)
{
// Get the MODER value
uint32_t moder = *gpio_get_MODER(gpio);
// Clear the mode and alternate function bits
moder &= ~(0x3 << (pin * 2));
// Set the desired mode
moder |= GPIO_MODE_OUTPUT << (pin * 2);
// Apply
*gpio_get_MODER(gpio) = moder;
}
void gpio_set_input(gpio_t gpio, gpio_pin_t pin)
{
// Get the MODER value
uint32_t moder = *gpio_get_MODER(gpio);
// Clear the mode and alternate function bits
moder &= ~(0x3 << (pin * 2));
// Set the desired mode
moder |= GPIO_MODE_INPUT << (pin * 2);
// Apply
*gpio_get_MODER(gpio) = moder;
}
void gpio_set_analog(gpio_t gpio, gpio_pin_t pin)
{
// Get the MODER value
uint32_t moder = *gpio_get_MODER(gpio);
// Clear the mode and alternate function bits
moder &= ~(0x3 << (pin * 2));
// Set the desired mode
moder |= GPIO_MODE_ANALOG << (pin * 2);
// Apply
*gpio_get_MODER(gpio) = moder;
}
void gpio_set_alternate_function(const _gpio_t *_gpio, gpio_pin_t pin, gpio_af_t af)
{
// Get the MODER value
uint32_t moder = *gpio_get_MODER(_gpio);
// Clear the mode and alternate function bits
moder &= ~(0x3 << (pin * 2));
// Set the desired mode
moder |= GPIO_MODE_ALTERNATE << (pin * 2);
// Apply
*gpio_get_MODER(_gpio) = moder;
// Set the desired alternate function
if (pin <= GPIO_PIN_7)
{
// Clear corresponding 4bits
*gpio_get_AFRL(_gpio) &= ~(0xF << (pin * 4));
// Set function
*gpio_get_AFRL(_gpio) |= af << (pin * 4);
}
else
{
// Clear corresponding 4bits
*gpio_get_AFRH(_gpio) &= ~(0xF << ((pin - 8) * 4));
// Set function
*gpio_get_AFRH(_gpio) |= af << ((pin - 8) * 4);
}
}
void gpio_set_speed(const _gpio_t *_gpio, gpio_pin_t pin, gpio_speed_t speed)
{
// Clear OSPEED value
*gpio_get_OSPEEDR(_gpio) &= ~(0x3 << (pin * 2));
// Write new OSPEED value
*gpio_get_OSPEEDR(_gpio) |= (speed << (pin * 2));
}
void gpio_config_output_type(gpio_t gpio, gpio_pin_t pin, gpio_type_t type)
{
// Set OTYPE value
if (type)
{
*gpio_get_OTYPER(gpio) |= 1 << pin;
}
else
{
*gpio_get_OTYPER(gpio) &= ~(1 << pin);
}
}
void gpio_config_pull_up_down(gpio_t gpio, gpio_pin_t pin,
gpio_pull_up_down_t mode)
{
// Clear PUPD value
*gpio_get_PUPDR(gpio) &= ~(0x3 << (pin * 2));
// Write new PUPD value
*gpio_get_PUPDR(gpio) |= (mode << (pin * 2));
}
void gpio_pin_set(gpio_t gpio, gpio_pin_t pin)
{
// To set a pin, write 1 to BSy in GPIOxBSRR
*gpio_get_BSRR(gpio) = BV(pin);
}
void gpio_pin_clear(gpio_t gpio, gpio_pin_t pin)
{
// To reset a pin, write 1 to BRy in GPIOxBSRR
*gpio_get_BSRR(gpio) = BV(pin + 16);
}
void gpio_pin_toggle(gpio_t gpio, gpio_pin_t pin)
{
// Toggle the pin in the ODR register
*gpio_get_ODR(gpio) ^= BV(pin);
}
uint32_t gpio_pin_read(gpio_t gpio, gpio_pin_t pin)
{
// Read the pin value in IDR
return *gpio_get_IDR(gpio) & BV(pin);
}
void gpio_set_spi_clk(gpio_t gpio, gpio_pin_t pin)
{
// Set SPI alternate function
gpio_set_alternate_function(gpio, pin, GPIO_AF_5);
// Set output speed
gpio_set_speed(gpio, pin, GPIO_SPEED_LOW);
}
void gpio_set_spi_miso(gpio_t gpio, gpio_pin_t pin)
{
// Same as SPI CLK
gpio_set_spi_clk(gpio, pin);
// Set pull down
gpio_config_pull_up_down(gpio, pin, GPIO_PULL_DOWN);
}
void gpio_set_spi_mosi(gpio_t gpio, gpio_pin_t pin)
{
// Same as SPI CLK
gpio_set_spi_clk(gpio, pin);
}
void gpio_set_uart_rx(gpio_t gpio, gpio_pin_t pin)
{
// Set UART alternate function
gpio_set_alternate_function(gpio, pin, GPIO_AF_7);
// Configure pull up
gpio_config_pull_up_down(gpio, pin, GPIO_PULL_UP);
// Set output speed
gpio_set_speed(gpio, pin, GPIO_SPEED_LOW);
}
void gpio_set_uart_tx(gpio_t gpio, gpio_pin_t pin)
{
// Same as UART RX
gpio_set_uart_rx(gpio, pin);
}
void gpio_set_i2c_sda(gpio_t gpio, gpio_pin_t pin)
{
// Set output speed
gpio_set_speed(gpio, pin, GPIO_SPEED_LOW);
gpio_config_output_type(gpio, pin, GPIO_TYPE_OPEN_DRAIN);
gpio_config_pull_up_down(gpio, pin, GPIO_PULL_UP);
// Set I2C alternate function
gpio_set_alternate_function(gpio, pin, GPIO_AF_4);
}
void gpio_set_i2c_scl(gpio_t gpio, gpio_pin_t pin)
{
// Same as I2C SDA
gpio_set_i2c_sda(gpio, pin);
}
void gpio_set_timer_output(gpio_t gpio, gpio_pin_t pin, uint32_t alternate)
{
// Set alternate function
gpio_set_alternate_function(gpio, pin, alternate);
}
|
/*
* Copyright (c) 1999-2009 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*
* Useful macros and other stuff for generic lookups
* Copyright (C) 1989 by NeXT, Inc.
*/
#ifndef _LU_UTILS_H_
#define _LU_UTILS_H_
typedef struct { char x[128]; } socket_data_t;
#include <stdarg.h>
void *LI_ils_create(char *fmt, ...);
#endif /* ! _LU_UTILS_H_ */
|
/* xoreos - A reimplementation of BioWare's Aurora engine
*
* xoreos is the legal property of its developers, whose names
* can be found in the AUTHORS file distributed with this source
* distribution.
*
* xoreos 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.
*
* xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file
* Nitro Basic File Screen, a simple raw Nintendo DS image.
*/
#ifndef GRAPHICS_IMAGES_NBFS_H
#define GRAPHICS_IMAGES_NBFS_H
#include "src/graphics/images/decoder.h"
namespace Common {
class SeekableReadStream;
}
namespace Graphics {
class NBFS : public ImageDecoder {
public:
/** NBFS are raw paletted images and need a palette, width and height. */
NBFS(Common::SeekableReadStream &nbfs, Common::SeekableReadStream &nbfp, uint32 width, uint32 height);
~NBFS();
private:
void load(Common::SeekableReadStream &nbfs, Common::SeekableReadStream &nbfp, uint32 width, uint32 height);
const byte *readPalette(Common::SeekableReadStream &nbfp);
void readImage(Common::SeekableReadStream &nbfs, const byte *palette, uint32 width, uint32 height);
};
} // End of namespace Graphics
#endif // GRAPHICS_IMAGES_NBFS_H
|
/* -*-C++-*-
"$Id: Fl_Combobox.H,v 1.4 2000/02/13 04:43:56 dhfreese Exp $"
Copyright 1999-2000 by the Dave Freese.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
Please report all bugs and problems to "flek-devel@sourceforge.net".
*/
#ifndef _FL_COMBOBOX_H
#define _FL_COMBOBOX_H
#include <FL/Fl_Window.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Select_Browser.H>
#include <FL/Fl_Input.H>
#define FL_COMBO_UNIQUE 1
#define FL_COMBO_UNIQUE_NOCASE 2
#define FL_COMBO_LIST_INCR 100
class Fl_ComboBox;
struct datambr {
char *s;
void *d;
};
struct retvals {
// Fl_Output * Inp;
Fl_Input *Inp;
void * retval;
int * idx;};
class Fl_PopBrowser : public Fl_Window {
friend void popbrwsr_cb(Fl_Widget *, long);
protected:
Fl_Select_Browser *popbrwsr;
retvals Rvals;
int hRow;
int wRow;
public:
Fl_PopBrowser (int x, int y, int w, int h, retvals R);
~Fl_PopBrowser ();
void popshow (int, int);
void pophide ();
void popbrwsr_cb_i (Fl_Widget *, long);
void add (char *s, void *d = 0);
void clear ();
void sort ();
int handle (int);
Fl_ComboBox *parent;
};
class Fl_ComboBox : public Fl_Group {
friend int DataCompare (const void *, const void *);
friend class Fl_PopBrowser;
protected:
Fl_Button *Btn;
// Fl_Output *Output;
Fl_Input *Output;
Fl_PopBrowser *Brwsr;
datambr **datalist;
int listsize;
int maxsize;
int listtype;
private:
int width;
int height;
void *retdata;
int idx;
retvals R;
public:
Fl_ComboBox (int x, int y, int w, int h, const char * = 0);
~Fl_ComboBox();
const char *value ();
void value (const char *);
void put_value( const char *);
void fl_popbrwsr(Fl_Widget *);
void type (int = 0);
void add (const char *s, void *d = 0);
void clear ();
void sort ();
int index ();
void index (int i);
void *data ();
void textfont (int);
void textsize (uchar);
void readonly();
int size();
};
#endif
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include "php_aws_crt.h"
PHP_FUNCTION(aws_crt_http_message_new_from_blob) {
const char *blob = NULL;
size_t blob_len = 0;
aws_php_parse_parameters("s", &blob, &blob_len);
aws_crt_http_message *message = aws_crt_http_message_new_from_blob((uint8_t *)blob, blob_len);
RETURN_LONG((zend_ulong)message);
}
PHP_FUNCTION(aws_crt_http_message_to_blob) {
zend_ulong php_msg = 0;
aws_php_parse_parameters("l", &php_msg);
aws_crt_http_message *message = (void *)php_msg;
aws_crt_buf blob;
aws_crt_http_message_to_blob(message, &blob);
XRETURN_STRINGL((const char *)blob.blob, blob.length);
}
PHP_FUNCTION(aws_crt_http_message_release) {
zend_ulong php_msg = 0;
aws_php_parse_parameters("l", &php_msg);
aws_crt_http_message *message = (void *)php_msg;
aws_crt_http_message_release(message);
}
|
//===-- MipsAsmBackend.h - Mips Asm Backend ------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the MipsAsmBackend class.
//
//===----------------------------------------------------------------------===//
//
#ifndef LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSASMBACKEND_H
#define LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSASMBACKEND_H
#include "MCTargetDesc/MipsFixupKinds.h"
#include "llvm/ADT/Triple.h"
#include "llvm/MC/MCAsmBackend.h"
namespace llvm {
class MCAssembler;
struct MCFixupKindInfo;
class Target;
class MCObjectWriter;
class MipsAsmBackend : public MCAsmBackend {
Triple::OSType OSType;
bool IsLittle; // Big or little endian
bool Is64Bit; // 32 or 64 bit words
public:
MipsAsmBackend(const Target &T, Triple::OSType OSType, bool IsLittle,
bool Is64Bit)
: MCAsmBackend(), OSType(OSType), IsLittle(IsLittle), Is64Bit(Is64Bit) {}
MCObjectWriter *createObjectWriter(raw_pwrite_stream &OS) const override;
void applyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize,
uint64_t Value, bool IsPCRel, MCContext &Ctx) const override;
Optional<MCFixupKind> getFixupKind(StringRef Name) const override;
const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const override;
unsigned getNumFixupKinds() const override {
return Mips::NumTargetFixupKinds;
}
/// @name Target Relaxation Interfaces
/// @{
/// MayNeedRelaxation - Check whether the given instruction may need
/// relaxation.
///
/// \param Inst - The instruction to test.
bool mayNeedRelaxation(const MCInst &Inst) const override {
return false;
}
/// fixupNeedsRelaxation - Target specific predicate for whether a given
/// fixup requires the associated instruction to be relaxed.
bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,
const MCRelaxableFragment *DF,
const MCAsmLayout &Layout) const override {
// FIXME.
llvm_unreachable("RelaxInstruction() unimplemented");
return false;
}
/// RelaxInstruction - Relax the instruction in the given fragment
/// to the next wider instruction.
///
/// \param Inst - The instruction to relax, which may be the same
/// as the output.
/// \param [out] Res On return, the relaxed instruction.
void relaxInstruction(const MCInst &Inst, const MCSubtargetInfo &STI,
MCInst &Res) const override {}
/// @}
bool writeNopData(uint64_t Count, MCObjectWriter *OW) const override;
}; // class MipsAsmBackend
} // namespace
#endif
|
/****************************************************************/
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* All contents are licensed under LGPL V2.1 */
/* See LICENSE for full restrictions */
/****************************************************************/
#ifndef RICHARDSDENSITYVDW_H
#define RICHARDSDENSITYVDW_H
#include "RichardsDensity.h"
class RichardsDensityVDW;
template<>
InputParameters validParams<RichardsDensityVDW>();
/**
* Density of a gas according to the van der Waals expression
* (P + n^2 a/V^2)(V - nb) = nRT
* How density is calculated: given P, (1/V) is calculated for n=1
* and rho = molar_mass*(1/V).
* The density is actually modified from this rho in the following ways:
* (1) density = rho - rho(P=0). This is so that density(P=0)=0, which is
* physically correct, but the wan der Waals expression does not hold
* close to a vacuum. However, it can be vital that density(P=0)=0
* numerically, otherwise fluid can be withdrawn from a node where there
* shouldn't be any fluid at P=0. This is a miniscule correction, of
* many orders of magnitude below the precision of a, b, R or T
* (2) For P<0 we enter an unphysical region, but this may be sampled
* by the Newton process as the algorithm iterates towards the solution.
* Therefore i set density = infinity_ratio*molar_mass*(exp(-c*P) - 1) in this region
* where c is chosen so the derivatives match at P=0
*/
class RichardsDensityVDW : public RichardsDensity
{
public:
RichardsDensityVDW(const std::string & name, InputParameters parameters);
/**
* fluid density as a function of porepressure
* @param p porepressure
*/
Real density(Real p) const;
/**
* derivative of fluid density wrt porepressure
* @param p porepressure
*/
Real ddensity(Real p) const;
/**
* second derivative of fluid density wrt porepressure
* @param p porepressure
*/
Real d2density(Real p) const;
protected:
/// van der Waals a
Real _a;
/// van der Waals b
Real _b;
/// R*T (gas constant * temperature)
Real _rt;
/// molar mass of gas
Real _molar_mass;
/// density at P=-infinity is _infinity_ratio*_molar_mass
Real _infinity_ratio;
/// R*T*b/a
Real _rhs;
/// b^2/a
Real _b2oa;
/// density at P=0 according to the van der Waals expression
Real _vdw0;
/// (1/_molar_mass)*d(density)/dP at P=0
Real _slope0;
/**
* Density according to the van der Waals expression
* This is modified to yield density(p) as noted above
* @param p porepressure
*/
Real densityVDW(Real p) const;
};
#endif // RICHARDSDENSITYVDW_H
|
//
// MBDocumentCaptureOverlaySettings.h
// MicroblinkDev
//
// Created by Jura Skrlec on 13/01/2020.
//
#import "MBBaseOverlaySettings.h"
NS_ASSUME_NONNULL_BEGIN
/**
* Settings class containing parameters for Document Capture UI
*/
MB_CLASS_AVAILABLE_IOS(8.0)
@interface MBIDocumentCaptureOverlaySettings : MBIBaseOverlaySettings
/**
* Designated initializer. Initializes the object with default settings.
*
* @return object initialized with default values.
*/
- (instancetype)init NS_DESIGNATED_INITIALIZER;
/**
* Background color of document capture detection view
* Default: UIColor red:.282 green:.698 blue:.91
*/
@property (nonatomic, strong) UIColor *backgroundColor;
/**
* Border color of document capture detection view
* Default: UIColor red:.282 green:.698 blue:.91
*/
@property (nonatomic, strong) UIColor *borderColor;
/**
* Opacity of document capture detection view
* Default: 0.35
*/
@property (nonatomic, assign) CGFloat alphaOpacity;
@end
NS_ASSUME_NONNULL_END
|
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file trueClock.h
* @author drose
* @date 2000-07-04
*/
#ifndef TRUECLOCK_H
#define TRUECLOCK_H
#include "pandabase.h"
#include "typedef.h"
#include "pdeque.h"
#include "mutexImpl.h"
#include "config_express.h"
/**
* An interface to whatever real-time clock we might have available in the
* current environment. There is only one TrueClock in existence, and it
* constructs itself.
*
* The TrueClock returns elapsed real time in seconds since some undefined
* epoch. Since it is not defined at what time precisely the clock indicates
* zero, this value can only be meaningfully used to measure elapsed time, by
* sampling it at two different times and subtracting.
*/
class EXPCL_PANDA_EXPRESS TrueClock {
PUBLISHED:
// get_long_time() returns the most accurate timer we have over a long
// interval. It may not be very precise for measuring short intervals, but
// it should not drift substantially over the long haul.
double get_long_time();
MAKE_PROPERTY(long_time, get_long_time);
// get_short_time() returns the most precise timer we have over a short
// interval. It may tend to drift over the long haul, but it should have
// lots of digits to measure short intervals very precisely.
INLINE double get_short_time();
MAKE_PROPERTY(short_time, get_short_time);
// get_short_raw_time() is like get_short_time(), but does not apply any
// corrections (e.g. paranoid-clock) to the result returned by the OS.
double get_short_raw_time();
MAKE_PROPERTY(short_raw_time, get_short_raw_time);
INLINE int get_error_count() const;
MAKE_PROPERTY(error_count, get_error_count);
INLINE static TrueClock *get_global_ptr();
bool set_cpu_affinity(uint32_t mask) const;
protected:
TrueClock();
INLINE ~TrueClock();
int _error_count;
static TrueClock *_global_ptr;
#ifdef WIN32
double correct_time(double time);
void set_time_scale(double time, double new_time_scale);
bool _has_high_res;
int64_t _init_count;
double _frequency, _recip_frequency;
int _init_tc;
uint64_t _init_tod;
// The rest of the data structures in this block are strictly for
// implementing paranoid_clock: they are designed to allow us to cross-check
// the high-resolution clock against the time-of-day clock, and smoothly
// correct for deviations.
class Timestamp {
public:
Timestamp(double time, double tod) : _time(time), _tod(tod) { }
double _time;
double _tod;
};
typedef pdeque<Timestamp> Timestamps;
Timestamps _timestamps;
double _time_scale;
double _time_offset;
double _tod_offset;
int _num_jump_errors;
bool _time_scale_changed;
double _last_reported_time_scale;
double _report_time_scale_time;
enum ChaseClock {
CC_slow_down,
CC_keep_even,
CC_speed_up,
};
ChaseClock _chase_clock;
MutexImpl _lock;
#endif // WIN32
};
#include "trueClock.I"
#endif
|
#ifndef NETWORKACCESSMANAGERFACTORY_H
#define NETWORKACCESSMANAGERFACTORY_H
#include <QtNetwork>
#include <QQmlNetworkAccessManagerFactory>
#include "customnetworkaccessmanager.h"
class NetworkAccessManagerFactory : public QQmlNetworkAccessManagerFactory
{
public:
explicit NetworkAccessManagerFactory();
QNetworkAccessManager* create(QObject* parent)
{
CustomNetworkAccessManager* manager = new CustomNetworkAccessManager(parent);
return manager;
}
};
#endif // NETWORKACCESSMANAGERFACTORY_H
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SKIA_EXT_SKIA_MEMORY_DUMP_PROVIDER_H_
#define SKIA_EXT_SKIA_MEMORY_DUMP_PROVIDER_H_
#include "base/memory/singleton.h"
#include "base/trace_event/memory_dump_provider.h"
#include "third_party/skia/include/core/SkTypes.h"
namespace skia {
class SK_API SkiaMemoryDumpProvider
: public base::trace_event::MemoryDumpProvider {
public:
static SkiaMemoryDumpProvider* GetInstance();
SkiaMemoryDumpProvider(const SkiaMemoryDumpProvider&) = delete;
SkiaMemoryDumpProvider& operator=(const SkiaMemoryDumpProvider&) = delete;
// base::trace_event::MemoryDumpProvider implementation:
bool OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* process_memory_dump) override;
private:
friend struct base::DefaultSingletonTraits<SkiaMemoryDumpProvider>;
SkiaMemoryDumpProvider();
~SkiaMemoryDumpProvider() override;
};
} // namespace skia
#endif // SKIA_EXT_SKIA_MEMORY_DUMP_PROVIDER_H_
|
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file config_particlesystem.h
* @author charles
* @date 2000-07-05
*/
#ifndef CONFIG_PARTICLESYSTEM_H
#define CONFIG_PARTICLESYSTEM_H
#include "pandabase.h"
#include "notifyCategoryProxy.h"
#include "dconfig.h"
ConfigureDecl(config_particlesystem, EXPCL_PANDA_PARTICLESYSTEM, EXPTP_PANDA_PARTICLESYSTEM);
NotifyCategoryDecl(particlesystem, EXPCL_PANDA_PARTICLESYSTEM, EXPTP_PANDA_PARTICLESYSTEM);
extern EXPCL_PANDA_PARTICLESYSTEM void init_libparticlesystem();
#ifndef NDEBUG //[
// Non-release build:
#define PARTICLE_SYSTEM_DEBUG
#else //][
// Release build:
#undef PARTICLE_SYSTEM_DEBUG
#endif //]
#endif // CONFIG_PARTICLESYSTEM_H
|
#ifndef TRANSACTIONTABLEMODEL_H
#define TRANSACTIONTABLEMODEL_H
#include <QAbstractTableModel>
#include <QStringList>
class CWallet;
class TransactionTablePriv;
class TransactionRecord;
class WalletModel;
/** UI model for the transaction table of a wallet.
*/
class TransactionTableModel : public QAbstractTableModel
{
Q_OBJECT
public:
explicit TransactionTableModel(CWallet* wallet, WalletModel *parent = 0);
~TransactionTableModel();
enum ColumnIndex {
Status = 0,
Date = 1,
Type = 2,
ToAddress = 3,
Amount = 4
};
/** Roles to get specific information from a transaction row.
These are independent of column.
*/
enum RoleIndex {
/** Type of transaction */
TypeRole = Qt::UserRole,
/** Date and time this transaction was created */
DateRole,
/** Long description (HTML format) */
LongDescriptionRole,
/** Address of transaction */
AddressRole,
/** Label of address related to transaction */
LabelRole,
/** Net amount of transaction */
AmountRole,
/** Unique identifier */
TxIDRole,
/** Is transaction confirmed? */
ConfirmedRole,
/** Formatted amount, without brackets when unconfirmed */
FormattedAmountRole
};
int rowCount(const QModelIndex &parent) const;
int columnCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const;
void refresh();
private:
CWallet* wallet;
WalletModel *walletModel;
QStringList columns;
TransactionTablePriv *priv;
int cachedNumBlocks;
QString lookupAddress(const std::string &address, bool tooltip) const;
QVariant addressColor(const TransactionRecord *wtx) const;
QString formatTxStatus(const TransactionRecord *wtx) const;
QString formatTxDate(const TransactionRecord *wtx) const;
QString formatTxType(const TransactionRecord *wtx) const;
QString formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const;
QString formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed=true) const;
QString formatTooltip(const TransactionRecord *rec) const;
QVariant txStatusDecoration(const TransactionRecord *wtx) const;
QVariant txAddressDecoration(const TransactionRecord *wtx) const;
public slots:
void updateTransaction(const QString &hash, int status);
void updateConfirmations();
void updateDisplayUnit();
friend class TransactionTablePriv;
};
#endif
|
/*************************************************************************/
/* upnp_device.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_UPNP_DEVICE_H
#define GODOT_UPNP_DEVICE_H
#include "core/object/ref_counted.h"
class UPNPDevice : public RefCounted {
GDCLASS(UPNPDevice, RefCounted);
public:
enum IGDStatus {
IGD_STATUS_OK,
IGD_STATUS_HTTP_ERROR,
IGD_STATUS_HTTP_EMPTY,
IGD_STATUS_NO_URLS,
IGD_STATUS_NO_IGD,
IGD_STATUS_DISCONNECTED,
IGD_STATUS_UNKNOWN_DEVICE,
IGD_STATUS_INVALID_CONTROL,
IGD_STATUS_MALLOC_ERROR,
IGD_STATUS_UNKNOWN_ERROR,
};
void set_description_url(const String &url);
String get_description_url() const;
void set_service_type(const String &type);
String get_service_type() const;
void set_igd_control_url(const String &url);
String get_igd_control_url() const;
void set_igd_service_type(const String &type);
String get_igd_service_type() const;
void set_igd_our_addr(const String &addr);
String get_igd_our_addr() const;
void set_igd_status(IGDStatus status);
IGDStatus get_igd_status() const;
bool is_valid_gateway() const;
String query_external_address() const;
int add_port_mapping(int port, int port_internal = 0, String desc = "", String proto = "UDP", int duration = 0) const;
int delete_port_mapping(int port, String proto = "UDP") const;
UPNPDevice();
~UPNPDevice();
protected:
static void _bind_methods();
private:
String description_url;
String service_type;
String igd_control_url;
String igd_service_type;
String igd_our_addr;
IGDStatus igd_status;
};
VARIANT_ENUM_CAST(UPNPDevice::IGDStatus)
#endif // GODOT_UPNP_DEVICE_H
|
//
// AppDelegate.h
// work1
//
// Created by yxq on 15/10/14.
// Copyright © 2015年 yxq. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
#pragma once
#include <string>
std::string getHomePath();
int runShutdownCommand(); // shut down the system (returns 0 if successful)
int runRestartCommand(); // restart the system (returns 0 if successful)
int runSystemCommand(const std::string& cmd_utf8); // run a utf-8 encoded in the shell (requires wstring conversion on Windows)
|
/* 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 ZVISION_ZORK_RAW_H
#define ZVISION_ZORK_RAW_H
#include "audio/audiostream.h"
namespace Common {
class SeekableReadStream;
}
namespace ZVision {
class ZVision;
struct SoundParams {
char identifier;
uint32 rate;
bool stereo;
bool packed;
bool bits16;
};
/**
* This is a ADPCM stream-reader, this class holds context for multi-chunk reading and no buffers.
*/
class RawChunkStream {
public:
RawChunkStream(bool stereo);
~RawChunkStream() {
}
private:
uint _stereo;
/**
* Holds the frequency and index from the last sample
* 0 holds the left channel, 1 holds the right channel
*/
struct {
int32 sample;
int16 index;
} _lastSample[2];
static const int16 _stepAdjustmentTable[8];
static const int32 _amplitudeLookupTable[89];
public:
struct RawChunk {
int16 *data;
uint32 size;
};
void init();
//Read next audio portion in new stream (needed for avi), return structure with buffer
RawChunk readNextChunk(Common::SeekableReadStream *stream);
//Read numSamples from stream to buffer
int readBuffer(int16 *buffer, Common::SeekableReadStream *stream, const int numSamples);
};
/**
* This is a stream, which allows for playing raw ADPCM data from a stream.
*/
class RawZorkStream : public Audio::RewindableAudioStream {
public:
RawZorkStream(uint32 rate, bool stereo, DisposeAfterUse::Flag disposeStream, Common::SeekableReadStream *stream);
~RawZorkStream() override {
}
public:
static const SoundParams _zNemSoundParamLookupTable[32];
static const SoundParams _zgiSoundParamLookupTable[24];
private:
const int _rate; // Sample rate of stream
Audio::Timestamp _playtime; // Calculated total play time
Common::DisposablePtr<Common::SeekableReadStream> _stream; // Stream to read data from
bool _endOfData; // Whether the stream end has been reached
uint _stereo;
RawChunkStream _streamReader;
public:
int readBuffer(int16 *buffer, const int numSamples) override;
bool isStereo() const override {
return _stereo;
}
bool endOfData() const override {
return _endOfData;
}
int getRate() const override {
return _rate;
}
Audio::Timestamp getLength() const {
return _playtime;
}
bool rewind() override;
};
/**
* Creates an audio stream, which plays from the given stream.
*
* @param stream Stream object to play from.
* @param rate Rate of the sound data.
* @param dispose AfterUse Whether to delete the stream after use.
* @return The new SeekableAudioStream (or 0 on failure).
*/
Audio::RewindableAudioStream *makeRawZorkStream(Common::SeekableReadStream *stream,
int rate,
bool stereo,
DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES);
Audio::RewindableAudioStream *makeRawZorkStream(const Common::String &filePath, ZVision *engine);
} // End of namespace ZVision
#endif
|
/* Release any resource associated with given conversion descriptor.
Copyright (C) 1997-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <iconv.h>
#include <gconv_int.h>
int
iconv_close (iconv_t cd)
{
if (__builtin_expect (cd == (iconv_t *) -1L, 0))
{
__set_errno (EBADF);
return -1;
}
return __gconv_close ((__gconv_t) cd) ? -1 : 0;
}
|
/*
* ldiscard.c
* al_ldiscard()
*/
/*
This file is part of Atclib.
Atclib is Copyright © 1995-1999 André Majorel.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307, USA.
*/
#include <stddef.h>
#include <stdlib.h>
#include <memory.h>
#define AL_AILLEGAL_ACCESS
#include "atclib.h"
int al_ldiscard ( al_llist_t *l )
{
al_lelt_t *cur, *next;
al_lcheckmagic (l);
for (cur = l->first; cur != NULL; cur = next)
{
next = cur->next;
/* zeroing l->magic protects us anyway but deux precautions
valent mieux qu'une. */
cur->next = AL_AINVALIDPOINTER;
free ( cur );
}
l->magic = 0; /* so that stale pointers can't fool us later */
free (l);
return 0;
}
|
#include <linux/module.h>
#include <linux/device.h>
#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/uaccess.h>
#include <linux/mm.h>
#include <linux/kfifo.h>
#include <linux/firmware.h>
#include <linux/syscalls.h>
#include <linux/uaccess.h>
#include <linux/platform_device.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/of.h>
#ifdef CONFIG_OF
#include <linux/of_fdt.h>
#endif
#include <asm/setup.h>
#include <linux/atomic.h>
#include <mach/mt_boot_common.h>
#include <mach/mt_ccci_common.h>
static wait_queue_head_t time_update_notify_queue_head;
static spinlock_t wait_count_lock;
static volatile unsigned int wait_count;
static volatile unsigned int get_update;
static volatile unsigned int api_ready;
void ccci_timer_for_md_init(void)
{
init_waitqueue_head(&time_update_notify_queue_head);
spin_lock_init(&wait_count_lock);
wait_count = 0;
get_update = 0;
mb();
api_ready = 1;
}
int wait_time_update_notify(void)
{ /* Only support one wait currently */
int ret = -1;
unsigned long flags;
if (api_ready) {
/* Update wait count ++ */
spin_lock_irqsave(&wait_count_lock, flags);
wait_count++;
spin_unlock_irqrestore(&wait_count_lock, flags);
ret = wait_event_interruptible(time_update_notify_queue_head, get_update);
if (ret != -ERESTARTSYS)
get_update = 0;
/* Update wait count -- */
spin_lock_irqsave(&wait_count_lock, flags);
wait_count--;
spin_unlock_irqrestore(&wait_count_lock, flags);
}
return ret;
}
void notify_time_update(void)
{
unsigned long flags;
if (!api_ready)
return; /* API not ready */
get_update = 1;
spin_lock_irqsave(&wait_count_lock, flags);
if (wait_count)
wake_up_all(&time_update_notify_queue_head);
spin_unlock_irqrestore(&wait_count_lock, flags);
}
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#include "SDL_assert.h"
#include "SDL_poll.h"
#ifdef HAVE_POLL
#include <poll.h>
#else
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#endif
#include <errno.h>
int
SDL_IOReady(int fd, SDL_bool forWrite, int timeoutMS)
{
int result;
/* Note: We don't bother to account for elapsed time if we get EINTR */
do
{
#ifdef HAVE_POLL
struct pollfd info;
info.fd = fd;
if (forWrite) {
info.events = POLLOUT;
} else {
info.events = POLLIN | POLLPRI;
}
result = poll(&info, 1, timeoutMS);
#else
fd_set rfdset, *rfdp = NULL;
fd_set wfdset, *wfdp = NULL;
struct timeval tv, *tvp = NULL;
/* If this assert triggers we'll corrupt memory here */
SDL_assert(fd >= 0 && fd < FD_SETSIZE);
if (forWrite) {
FD_ZERO(&wfdset);
FD_SET(fd, &wfdset);
wfdp = &wfdset;
} else {
FD_ZERO(&rfdset);
FD_SET(fd, &rfdset);
rfdp = &rfdset;
}
if (timeoutMS >= 0) {
tv.tv_sec = timeoutMS / 1000;
tv.tv_usec = (timeoutMS % 1000) * 1000;
tvp = &tv;
}
result = select(fd + 1, rfdp, wfdp, NULL, tvp);
#endif /* HAVE_POLL */
} while ( result < 0 && errno == EINTR );
return result;
}
/* vi: set ts=4 sw=4 expandtab: */
|
#pragma once
#include "Emu/Memory/vm_ptr.h"
// Return Codes
enum CellScreenShotError : u32
{
CELL_SCREENSHOT_ERROR_INTERNAL = 0x8002d101,
CELL_SCREENSHOT_ERROR_PARAM = 0x8002d102,
CELL_SCREENSHOT_ERROR_DECODE = 0x8002d103,
CELL_SCREENSHOT_ERROR_NOSPACE = 0x8002d104,
CELL_SCREENSHOT_ERROR_UNSUPPORTED_COLOR_FORMAT = 0x8002d105,
};
enum CellScreenShotParamSize
{
CELL_SCREENSHOT_PHOTO_TITLE_MAX_LENGTH = 64,
CELL_SCREENSHOT_GAME_TITLE_MAX_LENGTH = 64,
CELL_SCREENSHOT_GAME_COMMENT_MAX_SIZE = 1024,
};
struct CellScreenShotSetParam
{
vm::bcptr<char> photo_title;
vm::bcptr<char> game_title;
vm::bcptr<char> game_comment;
vm::bptr<void> reserved;
};
struct screenshot_info
{
bool is_enabled{false};
std::string photo_title;
std::string game_title;
std::string game_comment;
s32 overlay_offset_x{0};
s32 overlay_offset_y{0};
std::string overlay_dir_name;
std::string overlay_file_name;
std::string get_overlay_path() const;
std::string get_photo_title() const;
std::string get_game_title() const;
std::string get_game_comment() const;
std::string get_screenshot_path(const std::string& date_path) const;
};
struct screenshot_manager : public screenshot_info
{
shared_mutex mutex;
};
|
/* mul_lldp_debug.c: Mul lldp debug functions
* Copyright (C) 2012, Dipyoti Saikia <dipjyoti.saikia@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "mul_tr.h"
/* converts MAC address into readable format */
void conv_hwaddr(uint8_t *hwaddr, void *string_buffer)
{
sprintf(string_buffer,"%02X-%02X-%02X-%02X-%02X-%02X",hwaddr[0],hwaddr[1],hwaddr[2],hwaddr[3],hwaddr[4],hwaddr[5]);
}
/* display information of switch */
void dump_switch(lldp_switch_t *this_switch)
{
c_log_debug("switch 0x%llx: ", (unsigned long long)this_switch->dpid);
g_hash_table_foreach(this_switch->ports,dump_port,&this_switch->dpid);
}
/* display information of port */
void dump_port(void *key UNUSED, void *value, void *user_data)
{
char hwaddr_str[LLDP_HWADDR_DEBUG_STRING_LEN];
lldp_port_t *this_port = (lldp_port_t *) value;
uint64_t dpid = *(uint64_t *)user_data;
conv_hwaddr(this_port->hw_addr,hwaddr_str);
c_log_debug("switch 0x%llx port %hu: hwaddr=%s config=%d state=%d port_status=%d", (unsigned long long)dpid, this_port->port_no, hwaddr_str, this_port->config, this_port->state, this_port->status);
}
|
/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/usb/msm_hsusb_hw.h>
#include <linux/usb/ulpi.h>
#include "ci13xxx_udc.c"
#define MSM_USB_BASE (udc->regs)
static irqreturn_t msm_udc_irq(int irq, void *data)
{
return udc_irq();
}
static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned event)
{
struct device *dev = udc->gadget.dev.parent;
switch (event) {
case CI13XXX_CONTROLLER_RESET_EVENT:
dev_dbg(dev, "CI13XXX_CONTROLLER_RESET_EVENT received\n");
writel(0, USB_AHBBURST);
writel_relaxed(0x08, USB_AHBMODE);
break;
default:
dev_dbg(dev, "unknown ci13xxx_udc event\n");
break;
}
}
static struct ci13xxx_udc_driver ci13xxx_msm_udc_driver = {
.name = "ci13xxx_msm",
.flags = CI13XXX_REGS_SHARED |
CI13XXX_REQUIRE_TRANSCEIVER |
CI13XXX_PULLUP_ON_VBUS |
CI13XXX_DISABLE_STREAMING |
CI13XXX_ZERO_ITC,
.notify_event = ci13xxx_msm_notify_event,
};
static int ci13xxx_msm_probe(struct platform_device *pdev)
{
struct resource *res;
void __iomem *regs;
int irq;
int ret;
dev_dbg(&pdev->dev, "ci13xxx_msm_probe\n");
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "failed to get platform resource mem\n");
return -ENXIO;
}
regs = ioremap(res->start, resource_size(res));
if (!regs) {
dev_err(&pdev->dev, "ioremap failed\n");
return -ENOMEM;
}
ret = udc_probe(&ci13xxx_msm_udc_driver, &pdev->dev, regs);
if (ret < 0) {
dev_err(&pdev->dev, "udc_probe failed\n");
goto iounmap;
}
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "IRQ not found\n");
ret = -ENXIO;
goto udc_remove;
}
ret = request_irq(irq, msm_udc_irq, IRQF_SHARED, pdev->name, pdev);
if (ret < 0) {
dev_err(&pdev->dev, "request_irq failed\n");
goto udc_remove;
}
pm_runtime_no_callbacks(&pdev->dev);
pm_runtime_enable(&pdev->dev);
return 0;
udc_remove:
udc_remove();
iounmap:
iounmap(regs);
return ret;
}
static struct platform_driver ci13xxx_msm_driver = {
.probe = ci13xxx_msm_probe,
.driver = { .name = "msm_hsusb", },
};
static int __init ci13xxx_msm_init(void)
{
return platform_driver_register(&ci13xxx_msm_driver);
}
module_init(ci13xxx_msm_init);
|
/*
* Copyright (C) ST-Ericsson SA 2011
*
* License Terms: GNU General Public License v2
* Author: Kumar Sanghvi <kumar.sanghvi@stericsson.com>
*
* Heavily adapted from Regulator framework
*/
#ifndef __MODEM_CLIENT_H__
#define __MODEM_CLIENT_H__
#include <linux/device.h>
struct modem;
#ifdef CONFIG_MODEM
struct modem *modem_get(struct device *dev, const char *id);
void modem_put(struct modem *modem);
int modem_request(struct modem *modem);
void modem_release(struct modem *modem);
int modem_is_requested(struct modem *modem);
int modem_get_usage(struct modem *modem);
#else
static inline struct modem *modem_get(struct device *dev, const char *id)
{
return NULL;
}
static inline void modem_put(struct modem *modem)
{
}
static inline int modem_request(struct modem *modem)
{
return 0;
}
static inline void modem_release(struct modem *modem)
{
}
static inline int modem_is_requested(struct modem *modem)
{
return 0;
}
static inline int modem_get_usage(struct modem *modem)
{
return 0;
}
#endif
#endif /* __MODEM_CLIENT_H__ */
|
/*****************************************************************************
1 ÆäËûÍ·Îļþ°üº¬
*****************************************************************************/
#ifndef __REGULATOR_MTCMOS_DESC_H__
#define __REGULATOR_MTCMOS_DESC_H__
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
/*****************************************************************************
2 ºê¶¨Òå
*****************************************************************************/
/*****************************************************************************
3 ö¾Ù¶¨Òå
*****************************************************************************/
/*****************************************************************************
4 ÏûϢͷ¶¨Òå
*****************************************************************************/
/*****************************************************************************
5 ÏûÏ¢¶¨Òå
*****************************************************************************/
/*****************************************************************************
6 STRUCT¶¨Òå
*****************************************************************************/
/*****************************************************************************
7 UNION¶¨Òå
*****************************************************************************/
/*****************************************************************************
8 OTHERS¶¨Òå
*****************************************************************************/
/*****************************************************************************
9 È«¾Ö±äÁ¿ÉùÃ÷
*****************************************************************************/
struct regulator_desc regulators[] = {
/*MTCMOS Begin*/
[MTCMOS1_ID] = {
.name = MTCMOS1_NAME,
.id = MTCMOS1_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS1_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS2_ID] = {
.name = MTCMOS2_NAME,
.id = MTCMOS2_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS2_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS3_ID] = {
.name = MTCMOS3_NAME,
.id = MTCMOS3_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS3_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS4_ID] = {
.name = MTCMOS4_NAME,
.id = MTCMOS4_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS4_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS5_ID] = {
.name = MTCMOS5_NAME,
.id = MTCMOS5_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS5_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS6_ID] = {
.name = MTCMOS6_NAME,
.id = MTCMOS6_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS6_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS7_ID] = {
.name = MTCMOS7_NAME,
.id = MTCMOS7_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS7_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS8_ID] = {
.name = MTCMOS8_NAME,
.id = MTCMOS8_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS8_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS9_ID] = {
.name = MTCMOS9_NAME,
.id = MTCMOS9_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS9_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS10_ID] = {
.name = MTCMOS10_NAME,
.id = MTCMOS10_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS10_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS11_ID] = {
.name = MTCMOS11_NAME,
.id = MTCMOS11_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS11_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS12_ID] = {
.name = MTCMOS12_NAME,
.id = MTCMOS12_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS12_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS13_ID] = {
.name = MTCMOS13_NAME,
.id = MTCMOS13_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS13_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS14_ID] = {
.name = MTCMOS14_NAME,
.id = MTCMOS14_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS14_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS15_ID] = {
.name = MTCMOS15_NAME,
.id = MTCMOS15_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS15_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS16_ID] = {
.name = MTCMOS16_NAME,
.id = MTCMOS16_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS16_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS17_ID] = {
.name = MTCMOS17_NAME,
.id = MTCMOS17_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS17_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS18_ID] = {
.name = MTCMOS18_NAME,
.id = MTCMOS18_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS18_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS19_ID] = {
.name = MTCMOS19_NAME,
.id = MTCMOS19_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS19_TYPE,
.owner = THIS_MODULE,
},
[MTCMOS20_ID] = {
.name = MTCMOS20_NAME,
.id = MTCMOS20_ID,
.ops = ®ulator_mtcmos_ops,
.type = MTCMOS20_TYPE,
.owner = THIS_MODULE,
},
}
/*****************************************************************************
10 º¯ÊýÉùÃ÷
*****************************************************************************/
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif /* end of regulator_mtcmos_desc.h */
|
/***************************************************************************
qgs3dmapconfigwidget.h
--------------------------------------
Date : July 2017
Copyright : (C) 2017 by Martin Dobias
Email : wonder dot sk at gmail 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 QGS3DMAPCONFIGWIDGET_H
#define QGS3DMAPCONFIGWIDGET_H
#include <QWidget>
#include <ui_map3dconfigwidget.h>
class Qgs3DMapSettings;
class QgsMapCanvas;
class QgsMesh3dSymbolWidget;
class Qgs3DMapConfigWidget : public QWidget, private Ui::Map3DConfigWidget
{
Q_OBJECT
public:
//! construct widget. does not take ownership of the passed map.
explicit Qgs3DMapConfigWidget( Qgs3DMapSettings *map, QgsMapCanvas *mainCanvas, QWidget *parent = nullptr );
void apply();
signals:
private slots:
void onTerrainTypeChanged();
void onTerrainLayerChanged();
void updateMaxZoomLevel();
private:
Qgs3DMapSettings *mMap = nullptr;
QgsMapCanvas *mMainCanvas = nullptr;
QgsMesh3dSymbolWidget *mMeshSymbolWidget;
};
#endif // QGS3DMAPCONFIGWIDGET_H
|
/*
* Copyright (C) 2010-2014 by Jonathan Naylor, G4KLX
*
* 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.
*/
#ifndef Version_H
#define Version_H
#include <wx/wx.h>
const wxString VENDOR_NAME = wxT("G4KLX");
const wxString SVNREV = wxT("$Revision: 736 $ on $Date: 2014-06-03 20:40:51 +0100 (Tue, 03 Jun 2014) $");
#if defined(__WXDEBUG__)
const wxString VERSION = wxT("20140603 - DEBUG");
#else
const wxString VERSION = wxT("20140603");
#endif
#endif
|
/*
* virtio ccw crypto implementation
*
* Copyright 2012, 2015 IBM Corp.
*
* This work is licensed under the terms of the GNU GPL, version 2 or (at
* your option) any later version. See the COPYING file in the top-level
* directory.
*/
#include "qemu/osdep.h"
#include "hw/virtio/virtio.h"
#include "qapi/error.h"
#include "virtio-ccw.h"
static void virtio_ccw_crypto_realize(VirtioCcwDevice *ccw_dev, Error **errp)
{
VirtIOCryptoCcw *dev = VIRTIO_CRYPTO_CCW(ccw_dev);
DeviceState *vdev = DEVICE(&dev->vdev);
Error *err = NULL;
qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus));
object_property_set_bool(OBJECT(vdev), true, "realized", &err);
if (err) {
error_propagate(errp, err);
return;
}
object_property_set_link(OBJECT(vdev),
OBJECT(dev->vdev.conf.cryptodev), "cryptodev",
NULL);
}
static void virtio_ccw_crypto_instance_init(Object *obj)
{
VirtIOCryptoCcw *dev = VIRTIO_CRYPTO_CCW(obj);
VirtioCcwDevice *ccw_dev = VIRTIO_CCW_DEVICE(obj);
ccw_dev->force_revision_1 = true;
virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
TYPE_VIRTIO_CRYPTO);
}
static Property virtio_ccw_crypto_properties[] = {
DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags,
VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true),
DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev,
VIRTIO_CCW_MAX_REV),
DEFINE_PROP_END_OF_LIST(),
};
static void virtio_ccw_crypto_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
k->realize = virtio_ccw_crypto_realize;
dc->props = virtio_ccw_crypto_properties;
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
}
static const TypeInfo virtio_ccw_crypto = {
.name = TYPE_VIRTIO_CRYPTO_CCW,
.parent = TYPE_VIRTIO_CCW_DEVICE,
.instance_size = sizeof(VirtIOCryptoCcw),
.instance_init = virtio_ccw_crypto_instance_init,
.class_init = virtio_ccw_crypto_class_init,
};
static void virtio_ccw_crypto_register(void)
{
type_register_static(&virtio_ccw_crypto);
}
type_init(virtio_ccw_crypto_register)
|
/****************************************************************************
*
* Copyright (c) DiBcom SA. All rights reserved.
*
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
* KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
* PURPOSE.
*
****************************************************************************/
#include "DibDriverConfig.h" /* Must be first include of all SDK files - Defines compilation options */
#if (mSDK==0)
/**************************************************************************************************
* @file "DibDriverDragonflyTest.h"
* @brief Dragonfly specific debugging functions.
*
***************************************************************************************************/
#ifndef DIB_DRIVER_DRAGONFLY_TEST_H_
#define DIB_DRIVER_DRAGONFLY_TEST_H_
#include "DibDriverTargetTypes.h"
#include "DibDriverCommon.h"
#include "DibDriverRegisterIf.h"
#include "DibDriverMessages.h"
#include "DibDriver.h"
#include "DibDriverDowncalls.h"
#include "DibBoardSelection.h"
#include "DibDriverCtx.h"
#define TEST_MDMA 1
#define TEST_API 2
#define NO_TEST 3
#define TEST_ACCESS 4
#define CURRENT_TEST NO_TEST
/* BELOW : only for New Api Test */
struct Ch
{
uint32_t freq;
uint8_t prio;
uint8_t MaxDemod;
uint8_t MinDemod;
uint8_t Type;
uint8_t bdwth;
uint8_t adapter;
uint8_t idx;
};
struct Filt
{
uint8_t ParentCh;
uint8_t FiltType;
uint8_t idx;
};
struct It
{
uint8_t ParentFilt;
uint8_t idx;
union DibFilters ConfigInfo;
};
uint8_t DibDriverDragonflyIntTest(struct DibDriverContext *pContext, uint32_t TestStep);
#if CURRENT_TEST == TEST_API
#define NB_CH_MAX 4
#define NB_FILT_MAX 4
#define NB_ITEM_MAX 4
extern uint8_t gCurr;
extern struct Ch ch[NB_CH_MAX];
extern struct Filt f[NB_FILT_MAX];
extern struct It item[NB_ITEM_MAX];
void InitTest(void);
#endif
void DibDriverDragonflyMDMA(struct DibDriverContext *pContext, uint32_t src, uint32_t dst, uint32_t xsize, uint32_t fillsize, uint32_t fillvalue, uint32_t test_step);
void DibDriverDragonflyTestAccess(struct DibDriverContext *pContext);
#endif /*DIB_DRIVER_DRAGONFLY_TEST_H_*/
#endif
|
/*************************************************************************
* *
* Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. *
* All rights reserved. Email: russ@q12.org Web: www.q12.org *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of EITHER: *
* (1) 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 text of the GNU Lesser *
* General Public License is included with this library in the *
* file LICENSE.TXT. *
* (2) The BSD-style license that is included with this library in *
* the file LICENSE-BSD.TXT. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
* LICENSE.TXT and LICENSE-BSD.TXT for more details. *
* *
*************************************************************************/
#ifndef _ODE_JOINT_PISTON_H_
#define _ODE_JOINT_PISTON_H_
#include "joint.h"
////////////////////////////////////////////////////////////////////////////////
/// Component of a Piston joint
/// <PRE>
/// |- Anchor point
/// Body_1 | Body_2
/// +---------------+ V +------------------+
/// / /| / /|
/// / / + |-- ______ / / +
/// / x /./........x.......(_____()..../ x /.......> axis
/// +---------------+ / |-- +------------------+ /
/// | |/ | |/
/// +---------------+ +------------------+
/// | |
/// | |
/// |------------------> <----------------------------|
/// anchor1 anchor2
///
///
/// </PRE>
///
/// When the prismatic joint as been elongated (i.e. dJointGetPistonPosition)
/// return a value > 0
/// <PRE>
/// |- Anchor point
/// Body_1 | Body_2
/// +---------------+ V +------------------+
/// / /| / /|
/// / / + |-- ______ / / +
/// / x /./........_____x.......(_____()..../ x /.......> axis
/// +---------------+ / |-- +------------------+ /
/// | |/ | |/
/// +---------------+ +------------------+
/// | |
/// | |
/// |------------------> <----------------------------|
/// anchor1 |----| anchor2
/// ^
/// |-- This is what dJointGetPistonPosition will
/// return
/// </PRE>
////////////////////////////////////////////////////////////////////////////////
struct dxJointPiston : public dxJoint
{
dVector3 axis1; ///< Axis of the prismatic and rotoide w.r.t first body
dVector3 axis2; ///< Axis of the prismatic and rotoide w.r.t second body
dQuaternion qrel; ///< Initial relative rotation body1 -> body2
/// Anchor w.r.t first body.
/// This is the same as the offset for the Slider joint
/// @note To find the position of the anchor when the body 1 has moved
/// you must add the position of the prismatic joint
/// i.e anchor = R1 * anchor1 + dJointGetPistonPosition() * (R1 * axis1)
dVector3 anchor1;
dVector3 anchor2; //< anchor w.r.t second body
/// limit and motor information for the prismatic
/// part of the joint
dxJointLimitMotor limotP;
/// limit and motor information for the rotoide
/// part of the joint
dxJointLimitMotor limotR;
dxJointPiston( dxWorld *w );
virtual void getInfo1( Info1* info );
virtual void getInfo2( Info2* info );
virtual dJointType type() const;
virtual size_t size() const;
virtual void setRelativeValues();
void computeInitialRelativeRotation();
};
#endif
|
#ifndef UZBL_COMMANDS_H
#define UZBL_COMMANDS_H
#include <glib.h>
struct _UzblCommand;
typedef struct _UzblCommand UzblCommand;
GArray *
uzbl_commands_args_new ();
void
uzbl_commands_args_append (GArray *argv, const gchar *arg);
void
uzbl_commands_args_free (GArray *argv);
const UzblCommand *
uzbl_commands_parse (const gchar *cmd, GArray *argv);
void
uzbl_commands_run_parsed (const UzblCommand *info, GArray *argv, GString *result);
void
uzbl_commands_run_argv (const gchar *cmd, GArray *argv, GString *result);
void
uzbl_commands_run (const gchar *cmd, GString *result);
void
uzbl_commands_load_file (const gchar *path);
#endif
|
/*====================================================================*
- Copyright (C) 2001 Leptonica. All rights reserved.
- This software is distributed in the hope that it will be
- useful, but with NO WARRANTY OF ANY KIND.
- No author or distributor accepts responsibility to anyone for the
- consequences of using this software, or for whether it serves any
- particular purpose or works at all, unless he or she says so in
- writing. Everyone is granted permission to copy, modify and
- redistribute this source code, for commercial or non-commercial
- purposes, with the following restrictions: (1) the origin of this
- source code must not be misrepresented; (2) modified versions must
- be plainly marked as such; and (3) this notice may not be removed
- or altered from any source or modified source distribution.
*====================================================================*/
/*
* heap_reg.c
*
* Tests the heap utility.
*/
#include "allheaders.h"
struct HeapElement {
l_float32 distance;
l_int32 x;
l_int32 y;
};
typedef struct HeapElement HEAPEL;
static const l_int32 NELEM = 50;
main(int argc,
char **argv)
{
l_int32 i;
l_float32 frand, fval;
HEAPEL *item;
NUMA *na;
L_HEAP *lh;
static char mainName[] = "heap_reg";
if (argc != 1)
exit(ERROR_INT(" Syntax: heap_reg", mainName, 1));
/* make a numa of random numbers */
na = numaCreate(5);
for (i = 0; i < NELEM; i++) {
frand = (l_float32)rand() / (l_float32)RAND_MAX;
numaAddNumber(na, frand);
}
/* make an array of HEAPELs with the same numbers */
lh = lheapCreate(5, L_SORT_INCREASING);
for (i = 0; i < NELEM; i++) {
numaGetFValue(na, i, &fval);
item = (HEAPEL *)lept_calloc(1, sizeof(HEAPEL));
item->distance = fval;
lheapAdd(lh, item);
}
lheapPrint(stderr, lh);
/* switch the direction and resort into a heap */
lh->direction = L_SORT_DECREASING;
lheapSort(lh);
lheapPrint(stderr, lh);
/* resort for strict order */
lheapSortStrictOrder(lh);
lheapPrint(stderr, lh);
/* switch the direction again and resort into a heap */
lh->direction = L_SORT_INCREASING;
lheapSort(lh);
lheapPrint(stderr, lh);
/* remove the elements, one at a time */
for (i = 0; lheapGetCount(lh) > 0; i++) {
item = (HEAPEL *)lheapRemove(lh);
fprintf(stderr, "item %d: %f\n", i, item->distance);
lept_free(item);
}
lheapDestroy(&lh, 1);
numaDestroy(&na);
return 0;
}
|
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2017-5-30 Bernard the first version
*/
#ifndef DRV_UART_H__
#define DRV_UART_H__
/*
* Auxiliary
*/
#define AUX_IRQ(BASE) HWREG32(BASE + 0x00) /* Auxiliary Interrupt status 3 */
#define AUX_ENABLES(BASE) HWREG32(BASE + 0x04) /* Auxiliary enables 3bit */
#define AUX_MU_IO_REG(BASE) HWREG32(BASE + 0x40) /* Mini Uart I/O Data 8bit */
#define AUX_MU_IER_REG(BASE) HWREG32(BASE + 0x44) /* Mini Uart Interrupt Enable 8bit */
#define AUX_MU_IIR_REG(BASE) HWREG32(BASE + 0x48) /* Mini Uart Interrupt Identify 8bit */
#define AUX_MU_LCR_REG(BASE) HWREG32(BASE + 0x4C) /* Mini Uart Line Control 8bit */
#define AUX_MU_MCR_REG(BASE) HWREG32(BASE + 0x50) /* Mini Uart Modem Control 8bit */
#define AUX_MU_LSR_REG(BASE) HWREG32(BASE + 0x54) /* Mini Uart Line Status 8bit */
#define AUX_MU_MSR_REG(BASE) HWREG32(BASE + 0x58) /* Mini Uart Modem Status 8bit */
#define AUX_MU_SCRATCH(BASE) HWREG32(BASE + 0x5C) /* Mini Uart Scratch 8bit */
#define AUX_MU_CNTL_REG(BASE) HWREG32(BASE + 0x60) /* Mini Uart Extra Control 8bit */
#define AUX_MU_STAT_REG(BASE) HWREG32(BASE + 0x64) /* Mini Uart Extra Status 32bit */
#define AUX_MU_BAUD_REG(BASE) HWREG32(BASE + 0x68) /* Mini Uart Baudrate 16bit */
#define AUX_SPI0_CNTL0_REG(BASE) HWREG32(BASE + 0x80) /* SPI 1 Control register 0 32bit */
#define AUX_SPI0_CNTL1_REG(BASE) HWREG32(BASE + 0x84) /* SPI 1 Control register 1 8bit */
#define AUX_SPI0_STAT_REG(BASE) HWREG32(BASE + 0x88) /* SPI 1 Status 32bit */
#define AUX_SPI0_IO_REG(BASE) HWREG32(BASE + 0x90) /* SPI 1 Data 32bit */
#define AUX_SPI0_PEEK_REG(BASE) HWREG32(BASE + 0x94) /* SPI 1 Peek 16bit */
#define AUX_SPI1_CNTL0_REG(BASE) HWREG32(BASE + 0xC0) /* SPI 2 Control register 0 32bit */
#define AUX_SPI1_CNTL1_REG(BASE) HWREG32(BASE + 0xC4) /* SPI 2 Control register 1 8bit */
int rt_hw_uart_init(void);
#endif /* DRV_UART_H__ */
|
#undef I3__FILE__
#define I3__FILE__ "output.c"
/*
* vim:ts=4:sw=4:expandtab
*
* i3 - an improved dynamic tiling window manager
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
*
* output.c: Output (monitor) related functions.
*
*/
#include "all.h"
/*
* Returns the output container below the given output container.
*
*/
Con *output_get_content(Con *output) {
Con *child;
TAILQ_FOREACH(child, &(output->nodes_head), nodes)
if (child->type == CT_CON)
return child;
return NULL;
}
/*
* Returns an 'output' corresponding to one of left/right/down/up or a specific
* output name.
*
*/
Output *get_output_from_string(Output *current_output, const char *output_str) {
Output *output;
if (strcasecmp(output_str, "left") == 0)
output = get_output_next_wrap(D_LEFT, current_output);
else if (strcasecmp(output_str, "right") == 0)
output = get_output_next_wrap(D_RIGHT, current_output);
else if (strcasecmp(output_str, "up") == 0)
output = get_output_next_wrap(D_UP, current_output);
else if (strcasecmp(output_str, "down") == 0)
output = get_output_next_wrap(D_DOWN, current_output);
else
output = get_output_by_name(output_str);
return output;
}
/*
* Iterates over all outputs and pushes sticky windows to the currently visible
* workspace on that output.
*
*/
void output_push_sticky_windows(Con *to_focus) {
Con *output;
TAILQ_FOREACH(output, &(croot->focus_head), focused) {
Con *workspace, *visible_ws = NULL;
GREP_FIRST(visible_ws, output_get_content(output), workspace_is_visible(child));
/* We use this loop instead of TAILQ_FOREACH to avoid problems if the
* sticky window was the last window on that workspace as moving it in
* this case will close the workspace. */
for (workspace = TAILQ_FIRST(&(output_get_content(output)->focus_head));
workspace != TAILQ_END(&(output_get_content(output)->focus_head));) {
Con *current_ws = workspace;
workspace = TAILQ_NEXT(workspace, focused);
/* Since moving the windows actually removes them from the list of
* floating windows on this workspace, here too we need to use
* another loop than TAILQ_FOREACH. */
Con *child;
for (child = TAILQ_FIRST(&(current_ws->focus_head));
child != TAILQ_END(&(current_ws->focus_head));) {
Con *current = child;
child = TAILQ_NEXT(child, focused);
if (current->type != CT_FLOATING_CON)
continue;
if (con_is_sticky(current)) {
con_move_to_workspace(current, visible_ws, true, false, current != to_focus->parent);
}
}
}
}
}
|
#include <espressif/esp_common.h>
#include <esp/uart.h>
#include <FreeRTOS.h>
#include <task.h>
#include <queue.h>
#include <timers.h>
#include <string.h>
#include <ssd1306/ssd1306.h>
#define LOAD_ICON_X 54
#define LOAD_ICON_Y 42
#define LOAD_ICON_SIZE 20
#define CIRCLE_COUNT_ICON_X 100
#define CIRCLE_COUNT_ICON_Y 52
/* Remove this line if your display connected by SPI */
#define I2C_CONNECTION
#ifdef I2C_CONNECTION
#include <i2c/i2c.h>
#endif
#include "fonts/fonts.h"
/* Change this according to you schematics and display size */
#define DISPLAY_WIDTH 128
#define DISPLAY_HEIGHT 64
#ifdef I2C_CONNECTION
#define PROTOCOL SSD1306_PROTO_I2C
#define ADDR SSD1306_I2C_ADDR_0
#define I2C_BUS 0
#define SCL_PIN 5
#define SDA_PIN 4
#else
#define PROTOCOL SSD1306_PROTO_SPI4
#define CS_PIN 5
#define DC_PIN 4
#endif
#define DEFAULT_FONT FONT_FACE_TERMINUS_6X12_ISO8859_1
/* Declare device descriptor */
static const ssd1306_t dev = {
.protocol = PROTOCOL,
#ifdef I2C_CONNECTION
.i2c_dev.bus = I2C_BUS,
.i2c_dev.addr = ADDR,
#else
.cs_pin = CS_PIN,
.dc_pin = DC_PIN,
#endif
.width = DISPLAY_WIDTH,
.height = DISPLAY_HEIGHT
};
/* Local frame buffer */
static uint8_t buffer[DISPLAY_WIDTH * DISPLAY_HEIGHT / 8];
TimerHandle_t fps_timer_handle = NULL; // Timer handler
TimerHandle_t font_timer_handle = NULL;
uint8_t frame_done = 0; // number of frame send.
uint8_t fps = 0; // image per second.
const font_info_t *font = NULL; // current font
font_face_t font_face = 0;
#define SECOND (1000 / portTICK_PERIOD_MS)
static void ssd1306_task(void *pvParameters)
{
printf("%s: Started user interface task\n", __FUNCTION__);
vTaskDelay(SECOND);
ssd1306_set_whole_display_lighting(&dev, false);
char text[20];
uint8_t x0 = LOAD_ICON_X;
uint8_t y0 = LOAD_ICON_Y;
uint8_t x1 = LOAD_ICON_X + LOAD_ICON_SIZE;
uint8_t y1 = LOAD_ICON_Y + LOAD_ICON_SIZE;
uint16_t count = 0;
while (1) {
ssd1306_fill_rectangle(&dev, buffer, 0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT/2, OLED_COLOR_BLACK);
ssd1306_draw_string(&dev, buffer, font, 0, 0, "Hello, esp-open-rtos!", OLED_COLOR_WHITE, OLED_COLOR_BLACK);
sprintf(text, "FPS: %u ", fps);
ssd1306_draw_string(&dev, buffer, font_builtin_fonts[DEFAULT_FONT], 0, 45, text, OLED_COLOR_WHITE, OLED_COLOR_BLACK);
// generate loading icon
ssd1306_draw_line(&dev, buffer, x0, y0, x1, y1, OLED_COLOR_BLACK);
if (x0 < (LOAD_ICON_X + LOAD_ICON_SIZE)) {
x0++;
x1--;
}
else if (y0 < (LOAD_ICON_Y + LOAD_ICON_SIZE)) {
y0++;
y1--;
}
else {
x0 = LOAD_ICON_X;
y0 = LOAD_ICON_Y;
x1 = LOAD_ICON_X + LOAD_ICON_SIZE;
y1 = LOAD_ICON_Y + LOAD_ICON_SIZE;
}
ssd1306_draw_line(&dev, buffer, x0, y0, x1, y1, OLED_COLOR_WHITE);
ssd1306_draw_rectangle(&dev, buffer, LOAD_ICON_X, LOAD_ICON_Y,
LOAD_ICON_SIZE + 1, LOAD_ICON_SIZE + 1, OLED_COLOR_WHITE);
// generate circle counting
for (uint8_t i = 0; i < 10; i++) {
if ((count >> i) & 0x01)
ssd1306_draw_circle(&dev, buffer, CIRCLE_COUNT_ICON_X, CIRCLE_COUNT_ICON_Y, i, OLED_COLOR_BLACK);
}
count = count == 0x03FF ? 0 : count + 1;
for (uint8_t i = 0; i < 10; i++) {
if ((count>>i) & 0x01)
ssd1306_draw_circle(&dev,buffer, CIRCLE_COUNT_ICON_X, CIRCLE_COUNT_ICON_Y, i, OLED_COLOR_WHITE);
}
if (ssd1306_load_frame_buffer(&dev, buffer))
goto error_loop;
frame_done++;
}
error_loop:
printf("%s: error while loading framebuffer into SSD1306\n", __func__);
for (;;) {
vTaskDelay(2 * SECOND);
printf("%s: error loop\n", __FUNCTION__);
}
}
void fps_timer(TimerHandle_t h)
{
fps = frame_done; // Save number of frame already send to screen
frame_done = 0;
}
void font_timer(TimerHandle_t h)
{
do {
if (++font_face >= font_builtin_fonts_count)
font_face = 0;
font = font_builtin_fonts[font_face];
} while (!font);
printf("Selected builtin font %d\n", font_face);
}
void user_init(void)
{
//uncomment to test with CPU overclocked
//sdk_system_update_cpu_freq(160);
// Setup HW
uart_set_baud(0, 115200);
printf("SDK version:%s\n", sdk_system_get_sdk_version());
#ifdef I2C_CONNECTION
i2c_init(I2C_BUS, SCL_PIN, SDA_PIN, I2C_FREQ_400K);
#endif
while (ssd1306_init(&dev) != 0) {
printf("%s: failed to init SSD1306 lcd\n", __func__);
vTaskDelay(SECOND);
}
ssd1306_set_whole_display_lighting(&dev, true);
vTaskDelay(SECOND);
font = font_builtin_fonts[font_face];
// Create user interface task
xTaskCreate(ssd1306_task, "ssd1306_task", 256, NULL, 2, NULL);
fps_timer_handle = xTimerCreate("fps_timer", SECOND, pdTRUE, NULL, fps_timer);
xTimerStart(fps_timer_handle, 0);
font_timer_handle = xTimerCreate("font_timer", 5 * SECOND, pdTRUE, NULL, font_timer);
xTimerStart(font_timer_handle, 0);
}
|
// 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 THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASTREAM_MEDIA_STREAM_RENDERER_FACTORY_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASTREAM_MEDIA_STREAM_RENDERER_FACTORY_H_
#include "base/memory/scoped_refptr.h"
#include "third_party/blink/public/platform/modules/mediastream/web_media_stream_audio_renderer.h"
#include "third_party/blink/public/platform/modules/mediastream/web_media_stream_video_renderer.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/renderer/modules/modules_export.h"
namespace base {
class SingleThreadTaskRunner;
} // namespace base
namespace blink {
class WebMediaStream;
class WebLocalFrame;
// MediaStreamRendererFactory is used by WebMediaPlayerMS to create audio
// and video feeds from a MediaStream provided an URL. The factory methods are
// virtual in order for Blink web tests to be able to override them.
class MODULES_EXPORT MediaStreamRendererFactory {
public:
MediaStreamRendererFactory();
MediaStreamRendererFactory(const MediaStreamRendererFactory&) = delete;
MediaStreamRendererFactory& operator=(const MediaStreamRendererFactory&) =
delete;
virtual ~MediaStreamRendererFactory();
virtual scoped_refptr<WebMediaStreamVideoRenderer> GetVideoRenderer(
const WebMediaStream& web_stream,
const WebMediaStreamVideoRenderer::RepaintCB& repaint_cb,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> main_render_task_runner);
virtual scoped_refptr<WebMediaStreamAudioRenderer> GetAudioRenderer(
const WebMediaStream& web_stream,
WebLocalFrame* web_frame,
const WebString& device_id,
base::RepeatingCallback<void()> on_render_error_callback);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASTREAM_MEDIA_STREAM_RENDERER_FACTORY_H_
|
//
// Copyright (c) 2008-2018 the Urho3D project.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#pragma once
#include "Sample.h"
namespace Urho3D
{
class Node;
class Scene;
}
/// Animating 3D scene example.
/// This sample demonstrates:
/// - Creating a 3D scene and using a custom component to animate the objects
/// - Controlling scene ambience with the Zone component
/// - Attaching a light to an object (the camera)
class AnimatingScene : public Sample
{
URHO3D_OBJECT(AnimatingScene, Sample);
public:
/// Construct.
explicit AnimatingScene(Context* context);
/// Setup after engine initialization and before running the main loop.
void Start() override;
private:
/// Construct the scene content.
void CreateScene();
/// Construct an instruction text to the UI.
void CreateInstructions();
/// Set up a viewport for displaying the scene.
void SetupViewport();
/// Subscribe to application-wide logic update events.
void SubscribeToEvents();
/// Read input and moves the camera.
void MoveCamera(float timeStep);
/// Handle the logic update event.
void HandleUpdate(StringHash eventType, VariantMap& eventData);
};
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_TXDB_LEVELDB_H
#define BITCOIN_TXDB_LEVELDB_H
#include "leveldbwrapper.h"
#include "main.h"
#include <map>
#include <string>
#include <utility>
#include <vector>
class CBigNum;
class CCoins;
class uint256;
// -dbcache default (MiB)
static const int64_t nDefaultDbCache = 100;
// max. -dbcache in (MiB)
static const int64_t nMaxDbCache = sizeof(void*) > 4 ? 4096 : 1024;
// min. -dbcache in (MiB)
static const int64_t nMinDbCache = 4;
/** CCoinsView backed by the LevelDB coin database (chainstate/) */
class CCoinsViewDB : public CCoinsView
{
protected:
CLevelDBWrapper db;
public:
CCoinsViewDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false);
bool GetCoins(const uint256 &txid, CCoins &coins);
bool SetCoins(const uint256 &txid, const CCoins &coins);
bool HaveCoins(const uint256 &txid);
uint256 GetBestBlock();
bool SetBestBlock(const uint256 &hashBlock);
bool BatchWrite(const std::map<uint256, CCoins> &mapCoins, const uint256 &hashBlock);
bool GetStats(CCoinsStats &stats);
};
/** Access to the block database (blocks/index/) */
class CBlockTreeDB : public CLevelDBWrapper
{
public:
CBlockTreeDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false);
private:
CBlockTreeDB(const CBlockTreeDB&);
void operator=(const CBlockTreeDB&);
public:
bool WriteBlockIndex(const CDiskBlockIndex& blockindex);
bool WriteBestInvalidWork(const CBigNum& bnBestInvalidWork);
bool ReadBlockFileInfo(int nFile, CBlockFileInfo &fileinfo);
bool WriteBlockFileInfo(int nFile, const CBlockFileInfo &fileinfo);
bool ReadLastBlockFile(int &nFile);
bool WriteLastBlockFile(int nFile);
bool WriteReindexing(bool fReindex);
bool ReadReindexing(bool &fReindex);
bool ReadTxIndex(const uint256 &txid, CDiskTxPos &pos);
bool WriteTxIndex(const std::vector<std::pair<uint256, CDiskTxPos> > &list);
bool WriteFlag(const std::string &name, bool fValue);
bool ReadFlag(const std::string &name, bool &fValue);
// ppcoin sync checkpoint related data
bool ReadSyncCheckpoint(uint256& hashCheckpoint);
bool WriteSyncCheckpoint(uint256 hashCheckpoint);
bool ReadCheckpointPubKey(std::string& strPubKey);
bool WriteCheckpointPubKey(const std::string& strPubKey);
bool LoadBlockIndexGuts();
};
#endif // BITCOIN_TXDB_LEVELDB_H
|
/*
* Copyright 2004 Freescale Semiconductor.
* Jeff Brown
* Srikanth Srinivasan (srikanth.srinivasan@freescale.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
*/
/*
* cpu_init.c - low level cpu init
*/
#include <common.h>
#include <mpc86xx.h>
#include <asm/fsl_law.h>
DECLARE_GLOBAL_DATA_PTR;
/*
* Breathe some life into the CPU...
*
* Set up the memory map
* initialize a bunch of registers
*/
void cpu_init_f(void)
{
volatile immap_t *immap = (immap_t *)CFG_IMMR;
volatile ccsr_lbc_t *memctl = &immap->im_lbc;
/* Pointer is writable since we allocated a register for it */
gd = (gd_t *) (CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET);
/* Clear initial global data */
memset ((void *) gd, 0, sizeof (gd_t));
#ifdef CONFIG_FSL_LAW
init_laws();
#endif
/* Map banks 0 and 1 to the FLASH banks 0 and 1 at preliminary
* addresses - these have to be modified later when FLASH size
* has been determined
*/
#if defined(CFG_OR0_REMAP)
memctl->or0 = CFG_OR0_REMAP;
#endif
#if defined(CFG_OR1_REMAP)
memctl->or1 = CFG_OR1_REMAP;
#endif
/* now restrict to preliminary range */
#if defined(CFG_BR0_PRELIM) && defined(CFG_OR0_PRELIM)
memctl->br0 = CFG_BR0_PRELIM;
memctl->or0 = CFG_OR0_PRELIM;
#endif
#if defined(CFG_BR1_PRELIM) && defined(CFG_OR1_PRELIM)
memctl->or1 = CFG_OR1_PRELIM;
memctl->br1 = CFG_BR1_PRELIM;
#endif
#if defined(CFG_BR2_PRELIM) && defined(CFG_OR2_PRELIM)
memctl->or2 = CFG_OR2_PRELIM;
memctl->br2 = CFG_BR2_PRELIM;
#endif
#if defined(CFG_BR3_PRELIM) && defined(CFG_OR3_PRELIM)
memctl->or3 = CFG_OR3_PRELIM;
memctl->br3 = CFG_BR3_PRELIM;
#endif
#if defined(CFG_BR4_PRELIM) && defined(CFG_OR4_PRELIM)
memctl->or4 = CFG_OR4_PRELIM;
memctl->br4 = CFG_BR4_PRELIM;
#endif
#if defined(CFG_BR5_PRELIM) && defined(CFG_OR5_PRELIM)
memctl->or5 = CFG_OR5_PRELIM;
memctl->br5 = CFG_BR5_PRELIM;
#endif
#if defined(CFG_BR6_PRELIM) && defined(CFG_OR6_PRELIM)
memctl->or6 = CFG_OR6_PRELIM;
memctl->br6 = CFG_BR6_PRELIM;
#endif
#if defined(CFG_BR7_PRELIM) && defined(CFG_OR7_PRELIM)
memctl->or7 = CFG_OR7_PRELIM;
memctl->br7 = CFG_BR7_PRELIM;
#endif
/* enable the timebase bit in HID0 */
set_hid0(get_hid0() | 0x4000000);
/* enable EMCP, SYNCBE | ABE bits in HID1 */
set_hid1(get_hid1() | 0x80000C00);
}
/*
* initialize higher level parts of CPU like timers
*/
int cpu_init_r(void)
{
#ifdef CONFIG_FSL_LAW
disable_law(0);
#endif
return 0;
}
|
/*
*
Copyright (c) Eicon Networks, 2002.
*
This source file is supplied for the use with
Eicon Networks range of DIVA Server Adapters.
*
Eicon File Revision : 2.1
*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
*
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
*
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
struct pr_ram {
word NextReq; /* */
word NextRc; /* */
word NextInd; /* */
byte ReqInput; /* */
byte ReqOutput; /* */
byte ReqReserved; /* */
byte Int; /* */
byte XLock; /* */
byte RcOutput; /* */
byte IndOutput; /* */
byte IMask; /* */
byte Reserved1[2]; /* */
byte ReadyInt; /* */
byte Reserved2[12]; /* */
byte InterfaceType; /* */
word Signature; /* */
byte B[1]; /* */
};
typedef struct {
word next;
byte Req;
byte ReqId;
byte ReqCh;
byte Reserved1;
word Reference;
byte Reserved[8];
PBUFFER XBuffer;
} REQ;
typedef struct {
word next;
byte Rc;
byte RcId;
byte RcCh;
byte Reserved1;
word Reference;
byte Reserved2[8];
} RC;
typedef struct {
word next;
byte Ind;
byte IndId;
byte IndCh;
byte MInd;
word MLength;
word Reference;
byte RNR;
byte Reserved;
dword Ack;
PBUFFER RBuffer;
} IND;
|
/* { dg-options "-std=gnu99 -O0" } */
/* C99 6.5.8 Relational operators.
C99 6.5.9 Equality operators.
Compare decimal float special values at runtime. */
#define WIDTH 64
#include "compare-special.h"
int
main ()
{
test_compares ();
return 0;
}
|
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(mscg,FixMSCG)
#else
#ifndef LMP_FIX_MSCG_H
#define LMP_FIX_MSCG_H
#include "fix.h"
namespace LAMMPS_NS {
class FixMSCG : public Fix {
public:
FixMSCG(class LAMMPS *, int, char **);
~FixMSCG();
int setmask();
void post_constructor();
void init();
void end_of_step();
void post_run();
private:
int range_flag,name_flag,me,nprocs;
int nframes,n_frames,block_size,n_cg_sites,n_cg_types,*cg_site_types;
int max_partners_bond,max_partners_angle,max_partners_dihedral;
unsigned *n_partners_bond,*n_partners_angle,*n_partners_dihedral;
unsigned **partners_bond,**partners_angle,**partners_dihedral;
double *x1d,*f1d,**f;
double box_half_lengths[3];
char **type_names;
void *mscg_struct;
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Fix mscg does not yet support mpi
Self-explanatory.
E: Fix mscg does not yet support triclinic geometries
Self-explanatory.
E: Bond/Angle/Dihedral list overflow, boost fix_mscg max
A site has more bond/angle/dihedral partners that the maximum and
has overflowed the bond/angle/dihedral partners list. Increase the
corresponding fix_mscg max arg.
W: Fix mscg n_frames is inconsistent with control.in
The control.in file read by the MSCG lib has a parameter n_frames
that should be equal to the number of frames processed by the
fix mscg command. If not equal, the fix will still run, but the
calculated residuals may be normalized incorrectly.
W: Fix mscg n_frames is not divisible by block_size in control.in
The control.in file read by the MSCG lib has a parameter block_size
that should be a divisor of the number of frames processed by the
fix mscg command. If not, the fix will still run, but some frames may
not be included in the MSCG calculations.
*/
|
/*
* ntfy.h
*
* DSP-BIOS Bridge driver support functions for TI OMAP processors.
*
* Manage lists of notification events.
*
* Copyright (C) 2005-2006 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef NTFY_
#define NTFY_
#include <dspbridge/host_os.h>
#include <dspbridge/dbdefs.h>
#include <dspbridge/sync.h>
/*
*/
struct ntfy_object {
struct raw_notifier_head head;/* */
spinlock_t ntfy_lock; /* */
};
/*
*/
struct ntfy_event {
struct notifier_block noti_block;
u32 event; /* */
u32 type; /* */
struct sync_object sync_obj;
};
/*
*/
int dsp_notifier_event(struct notifier_block *this, unsigned long event,
void *data);
/*
*/
static inline void ntfy_init(struct ntfy_object *no)
{
spin_lock_init(&no->ntfy_lock);
RAW_INIT_NOTIFIER_HEAD(&no->head);
}
/*
*/
static inline void ntfy_delete(struct ntfy_object *ntfy_obj)
{
struct ntfy_event *ne;
struct notifier_block *nb;
spin_lock_bh(&ntfy_obj->ntfy_lock);
nb = ntfy_obj->head.head;
while (nb) {
ne = container_of(nb, struct ntfy_event, noti_block);
nb = nb->next;
kfree(ne);
}
spin_unlock_bh(&ntfy_obj->ntfy_lock);
}
/*
*/
static inline void ntfy_notify(struct ntfy_object *ntfy_obj, u32 event)
{
spin_lock_bh(&ntfy_obj->ntfy_lock);
raw_notifier_call_chain(&ntfy_obj->head, event, NULL);
spin_unlock_bh(&ntfy_obj->ntfy_lock);
}
/*
*/
static inline struct ntfy_event *ntfy_event_create(u32 event, u32 type)
{
struct ntfy_event *ne;
ne = kmalloc(sizeof(struct ntfy_event), GFP_KERNEL);
if (ne) {
sync_init_event(&ne->sync_obj);
ne->noti_block.notifier_call = dsp_notifier_event;
ne->event = event;
ne->type = type;
}
return ne;
}
/*
*/
static inline int ntfy_register(struct ntfy_object *ntfy_obj,
struct dsp_notification *noti,
u32 event, u32 type)
{
struct ntfy_event *ne;
int status = 0;
if (!noti || !ntfy_obj) {
status = -EFAULT;
goto func_end;
}
if (!event) {
status = -EINVAL;
goto func_end;
}
ne = ntfy_event_create(event, type);
if (!ne) {
status = -ENOMEM;
goto func_end;
}
noti->handle = &ne->sync_obj;
spin_lock_bh(&ntfy_obj->ntfy_lock);
raw_notifier_chain_register(&ntfy_obj->head, &ne->noti_block);
spin_unlock_bh(&ntfy_obj->ntfy_lock);
func_end:
return status;
}
/*
*/
static inline int ntfy_unregister(struct ntfy_object *ntfy_obj,
struct dsp_notification *noti)
{
int status = 0;
struct ntfy_event *ne;
if (!noti || !ntfy_obj) {
status = -EFAULT;
goto func_end;
}
ne = container_of((struct sync_object *)noti, struct ntfy_event,
sync_obj);
spin_lock_bh(&ntfy_obj->ntfy_lock);
raw_notifier_chain_unregister(&ntfy_obj->head,
&ne->noti_block);
kfree(ne);
spin_unlock_bh(&ntfy_obj->ntfy_lock);
func_end:
return status;
}
#endif /* */
|
/* Set floating-point environment exception handling.
Copyright (C) 1997,99,2000,01, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <fenv.h>
#include <math.h>
#include <bp-sym.h>
#include <unistd.h>
#include <ldsodefs.h>
#include <dl-procinfo.h>
int
__fesetexceptflag (const fexcept_t *flagp, int excepts)
{
fenv_t temp;
/* Get the current environment. We have to do this since we cannot
separately set the status word. */
__asm__ ("fnstenv %0" : "=m" (*&temp));
temp.__status_word &= ~(excepts & FE_ALL_EXCEPT);
temp.__status_word |= *flagp & excepts & FE_ALL_EXCEPT;
/* Store the new status word (along with the rest of the environment.
Possibly new exceptions are set but they won't get executed unless
the next floating-point instruction. */
__asm__ ("fldenv %0" : : "m" (*&temp));
/* If the CPU supports SSE, we set the MXCSR as well. */
if ((GLRO(dl_hwcap) & HWCAP_I386_XMM) != 0)
{
unsigned int xnew_exc;
/* Get the current MXCSR. */
__asm__ ("stmxcsr %0" : "=m" (*&xnew_exc));
/* Set the relevant bits. */
xnew_exc &= ~(excepts & FE_ALL_EXCEPT);
xnew_exc |= *flagp & excepts & FE_ALL_EXCEPT;
/* Put the new data in effect. */
__asm__ ("ldmxcsr %0" : : "m" (*&xnew_exc));
}
/* Success. */
return 0;
}
#include <shlib-compat.h>
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fesetexceptflag, __old_fesetexceptflag)
compat_symbol (libm, BP_SYM (__old_fesetexceptflag), BP_SYM (fesetexceptflag), GLIBC_2_1);
#endif
versioned_symbol (libm, BP_SYM (__fesetexceptflag), BP_SYM (fesetexceptflag), GLIBC_2_2);
|
/*
* Cobalt button interface driver.
*
* Copyright (C) 2007-2008 Yoichi Yuasa <yuasa@linux-mips.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <linux/init.h>
#include <linux/input-polldev.h>
#include <linux/ioport.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#define BUTTONS_POLL_INTERVAL 30 /* */
#define BUTTONS_COUNT_THRESHOLD 3
#define BUTTONS_STATUS_MASK 0xfe000000
static const unsigned short cobalt_map[] = {
KEY_RESERVED,
KEY_RESTART,
KEY_LEFT,
KEY_UP,
KEY_DOWN,
KEY_RIGHT,
KEY_ENTER,
KEY_SELECT
};
struct buttons_dev {
struct input_polled_dev *poll_dev;
unsigned short keymap[ARRAY_SIZE(cobalt_map)];
int count[ARRAY_SIZE(cobalt_map)];
void __iomem *reg;
};
static void handle_buttons(struct input_polled_dev *dev)
{
struct buttons_dev *bdev = dev->private;
struct input_dev *input = dev->input;
uint32_t status;
int i;
status = ~readl(bdev->reg) >> 24;
for (i = 0; i < ARRAY_SIZE(bdev->keymap); i++) {
if (status & (1U << i)) {
if (++bdev->count[i] == BUTTONS_COUNT_THRESHOLD) {
input_event(input, EV_MSC, MSC_SCAN, i);
input_report_key(input, bdev->keymap[i], 1);
input_sync(input);
}
} else {
if (bdev->count[i] >= BUTTONS_COUNT_THRESHOLD) {
input_event(input, EV_MSC, MSC_SCAN, i);
input_report_key(input, bdev->keymap[i], 0);
input_sync(input);
}
bdev->count[i] = 0;
}
}
}
static int __devinit cobalt_buttons_probe(struct platform_device *pdev)
{
struct buttons_dev *bdev;
struct input_polled_dev *poll_dev;
struct input_dev *input;
struct resource *res;
int error, i;
bdev = kzalloc(sizeof(struct buttons_dev), GFP_KERNEL);
poll_dev = input_allocate_polled_device();
if (!bdev || !poll_dev) {
error = -ENOMEM;
goto err_free_mem;
}
memcpy(bdev->keymap, cobalt_map, sizeof(bdev->keymap));
poll_dev->private = bdev;
poll_dev->poll = handle_buttons;
poll_dev->poll_interval = BUTTONS_POLL_INTERVAL;
input = poll_dev->input;
input->name = "Cobalt buttons";
input->phys = "cobalt/input0";
input->id.bustype = BUS_HOST;
input->dev.parent = &pdev->dev;
input->keycode = bdev->keymap;
input->keycodemax = ARRAY_SIZE(bdev->keymap);
input->keycodesize = sizeof(unsigned short);
input_set_capability(input, EV_MSC, MSC_SCAN);
__set_bit(EV_KEY, input->evbit);
for (i = 0; i < ARRAY_SIZE(cobalt_map); i++)
__set_bit(bdev->keymap[i], input->keybit);
__clear_bit(KEY_RESERVED, input->keybit);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
error = -EBUSY;
goto err_free_mem;
}
bdev->poll_dev = poll_dev;
bdev->reg = ioremap(res->start, resource_size(res));
dev_set_drvdata(&pdev->dev, bdev);
error = input_register_polled_device(poll_dev);
if (error)
goto err_iounmap;
return 0;
err_iounmap:
iounmap(bdev->reg);
err_free_mem:
input_free_polled_device(poll_dev);
kfree(bdev);
dev_set_drvdata(&pdev->dev, NULL);
return error;
}
static int __devexit cobalt_buttons_remove(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct buttons_dev *bdev = dev_get_drvdata(dev);
input_unregister_polled_device(bdev->poll_dev);
input_free_polled_device(bdev->poll_dev);
iounmap(bdev->reg);
kfree(bdev);
dev_set_drvdata(dev, NULL);
return 0;
}
MODULE_AUTHOR("Yoichi Yuasa <yuasa@linux-mips.org>");
MODULE_DESCRIPTION("Cobalt button interface driver");
MODULE_LICENSE("GPL");
/* */
MODULE_ALIAS("platform:Cobalt buttons");
static struct platform_driver cobalt_buttons_driver = {
.probe = cobalt_buttons_probe,
.remove = __devexit_p(cobalt_buttons_remove),
.driver = {
.name = "Cobalt buttons",
.owner = THIS_MODULE,
},
};
module_platform_driver(cobalt_buttons_driver);
|
#include <linux/ptrace.h>
/*
*/
int regs_query_register_offset(const char *name)
{
const struct pt_regs_offset *roff;
for (roff = regoffset_table; roff->name != NULL; roff++)
if (!strcmp(roff->name, name))
return roff->offset;
return -EINVAL;
}
/*
*/
const char *regs_query_register_name(unsigned int offset)
{
const struct pt_regs_offset *roff;
for (roff = regoffset_table; roff->name != NULL; roff++)
if (roff->offset == offset)
return roff->name;
return NULL;
}
|
#ifndef CppLexerAPI_H__
#define CppLexerAPI_H__
#include <string>
#include <vector>
#include <wx/filename.h>
#include "codelite_exports.h"
#include "PHPScannerTokens.h"
enum eLexerOptions {
kPhpLexerOpt_None = 0x00000000,
kPhpLexerOpt_ReturnComments = 0x00000001,
kPhpLexerOpt_ReturnWhitespace = 0x00000002,
kPhpLexerOpt_ReturnAllNonPhp = 0x00000004,
};
struct WXDLLIMPEXP_CL phpLexerToken
{
int type;
std::string text;
int lineNumber;
int endLineNumber; // Usually, this is the same as lineNumber. Unless a multiple line token is found (heredoc,
// c-style comment etc)
phpLexerToken()
: type(-1)
, lineNumber(-1)
, endLineNumber(-1)
{
}
bool IsNull() const { return type == -1; }
/**
* @brief is the current token a comment? (c++ or c comment)
*/
bool IsAnyComment() const { return type == kPHP_T_C_COMMENT || type == kPHP_T_CXX_COMMENT; }
/**
* @brief is the current token a PHP Doc comment?
*/
bool IsDocComment() const { return type == kPHP_T_C_COMMENT; }
typedef std::vector<phpLexerToken> Vet_t;
};
/**
* @class phpLexerUserData
*/
struct WXDLLIMPEXP_CL phpLexerUserData
{
private:
size_t m_flags;
std::string m_comment;
std::string m_rawStringLabel;
std::string m_string;
int m_commentStartLine;
int m_commentEndLine;
bool m_insidePhp;
FILE* m_fp;
public:
void Clear()
{
if(m_fp) {
::fclose(m_fp);
}
m_fp = NULL;
m_insidePhp = false;
ClearComment();
m_rawStringLabel.clear();
m_string.clear();
}
phpLexerUserData(size_t options)
: m_flags(options)
, m_commentStartLine(wxNOT_FOUND)
, m_commentEndLine(wxNOT_FOUND)
, m_insidePhp(false)
, m_fp(NULL)
{
}
~phpLexerUserData() { Clear(); }
void SetFp(FILE* fp) { this->m_fp = fp; }
/**
* @brief do we collect comments?
*/
bool IsCollectingComments() const { return m_flags & kPhpLexerOpt_ReturnComments; }
bool IsCollectingWhitespace() const { return m_flags & kPhpLexerOpt_ReturnWhitespace; }
bool IsCollectingAllNonPhp() const { return m_flags & kPhpLexerOpt_ReturnAllNonPhp; }
void SetCollectingWhitespace(bool b)
{
if(b) {
m_flags |= kPhpLexerOpt_ReturnWhitespace;
} else {
m_flags &= ~kPhpLexerOpt_ReturnWhitespace;
}
}
void SetInsidePhp(bool insidePhp) { this->m_insidePhp = insidePhp; }
bool IsInsidePhp() const { return m_insidePhp; }
void SetString(const std::string& string) { this->m_string = string; }
std::string& GetString() { return m_string; }
void SetRawStringLabel(const std::string& rawStringLabel) { this->m_rawStringLabel = rawStringLabel; }
const std::string& GetRawStringLabel() const { return m_rawStringLabel; }
//==--------------------
// Comment management
//==--------------------
void AppendToComment(const std::string& str) { m_comment.append(str); }
void AppendToComment(char c) { m_comment.append(std::string(1, c)); }
void SetCommentEndLine(int commentEndLine) { this->m_commentEndLine = commentEndLine; }
void SetCommentStartLine(int commentStartLine) { this->m_commentStartLine = commentStartLine; }
int GetCommentEndLine() const { return m_commentEndLine; }
int GetCommentStartLine() const { return m_commentStartLine; }
const std::string& GetComment() const { return m_comment; }
bool HasComment() const { return !m_comment.empty(); }
/**
* @brief clear all info collected for the last comment
*/
void ClearComment()
{
m_comment.clear();
m_commentEndLine = wxNOT_FOUND;
m_commentEndLine = wxNOT_FOUND;
}
};
typedef void* PHPScanner_t;
/**
* @brief create a new Lexer for a given file name
*/
WXDLLIMPEXP_CL PHPScanner_t phpLexerNew(const wxFileName& filename, size_t options = kPhpLexerOpt_None);
/**
* @brief return the user data associated with this scanner
*/
WXDLLIMPEXP_CL phpLexerUserData* phpLexerGetUserData(PHPScanner_t scanner);
/**
* @brief create a new Lexer for a given file content
*/
WXDLLIMPEXP_CL PHPScanner_t phpLexerNew(const wxString& content, size_t options = kPhpLexerOpt_None);
/**
* @brief destroy the current lexer and perform cleanup
*/
WXDLLIMPEXP_CL void phpLexerDestroy(PHPScanner_t* scanner);
/**
* @brief return the next token, its type, line number and columns
*/
WXDLLIMPEXP_CL bool phpLexerNext(PHPScanner_t scanner, phpLexerToken& token);
/**
* @brief return true if we are currently inside a PHP block
*/
WXDLLIMPEXP_CL bool phpLexerIsPHPCode(PHPScanner_t scanner);
/**
* @brief peek at the next token
*/
WXDLLIMPEXP_CL void phpLexerUnget(PHPScanner_t scanner);
/**
* @class PHPScannerLocker
* @brief a wrapper around the C API for PHPScanner
*/
struct WXDLLIMPEXP_CL PHPScannerLocker
{
PHPScanner_t scanner;
PHPScannerLocker(const wxString& content, size_t options = kPhpLexerOpt_None)
{
scanner = ::phpLexerNew(content, options);
}
PHPScannerLocker(const wxFileName& filename, size_t options = kPhpLexerOpt_None)
{
scanner = ::phpLexerNew(filename, options);
}
PHPScannerLocker(PHPScanner_t phpScanner)
: scanner(phpScanner)
{
}
~PHPScannerLocker()
{
if(scanner) {
::phpLexerDestroy(&scanner);
}
}
};
#endif
|
#ifndef __ASM_SH_SYSCALL_32_H
#define __ASM_SH_SYSCALL_32_H
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/err.h>
#include <asm/ptrace.h>
/* */
static inline long syscall_get_nr(struct task_struct *task,
struct pt_regs *regs)
{
return (regs->tra >= 0) ? regs->regs[3] : -1L;
}
static inline void syscall_rollback(struct task_struct *task,
struct pt_regs *regs)
{
/*
*/
}
static inline long syscall_get_error(struct task_struct *task,
struct pt_regs *regs)
{
return IS_ERR_VALUE(regs->regs[0]) ? regs->regs[0] : 0;
}
static inline long syscall_get_return_value(struct task_struct *task,
struct pt_regs *regs)
{
return regs->regs[0];
}
static inline void syscall_set_return_value(struct task_struct *task,
struct pt_regs *regs,
int error, long val)
{
if (error)
regs->regs[0] = -error;
else
regs->regs[0] = val;
}
static inline void syscall_get_arguments(struct task_struct *task,
struct pt_regs *regs,
unsigned int i, unsigned int n,
unsigned long *args)
{
/*
*/
BUG_ON(i);
/* */
switch (n) {
case 6: args[5] = regs->regs[1];
case 5: args[4] = regs->regs[0];
case 4: args[3] = regs->regs[7];
case 3: args[2] = regs->regs[6];
case 2: args[1] = regs->regs[5];
case 1: args[0] = regs->regs[4];
case 0:
break;
default:
BUG();
}
}
static inline void syscall_set_arguments(struct task_struct *task,
struct pt_regs *regs,
unsigned int i, unsigned int n,
const unsigned long *args)
{
/* */
BUG_ON(i);
switch (n) {
case 6: regs->regs[1] = args[5];
case 5: regs->regs[0] = args[4];
case 4: regs->regs[7] = args[3];
case 3: regs->regs[6] = args[2];
case 2: regs->regs[5] = args[1];
case 1: regs->regs[4] = args[0];
break;
default:
BUG();
}
}
#endif /* */
|
/*
* Hisilicon K3 soc camera ISP driver header file
*
* CopyRight (C) Hisilicon Co., Ltd.
*
* 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 __K3_ISP_IO_COMM_H__
#define __K3_ISP_IO_COMM_H__
#endif /*__K3_ISP_IO_H__ */
/********************** END **********************/
|
/*
* Samsung's Exynos4210 flattened device tree enabled machine
*
* Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
* http://www.samsung.com
* Copyright (c) 2010-2011 Linaro Ltd.
* www.linaro.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/of_platform.h>
#include <linux/serial_core.h>
#include <asm/mach/arch.h>
#include <asm/hardware/gic.h>
#include <mach/map.h>
#include <plat/cpu.h>
#include <plat/regs-serial.h>
#include "common.h"
/*
*/
static const struct of_dev_auxdata exynos4210_auxdata_lookup[] __initconst = {
OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART0,
"exynos4210-uart.0", NULL),
OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART1,
"exynos4210-uart.1", NULL),
OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART2,
"exynos4210-uart.2", NULL),
OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS4_PA_UART3,
"exynos4210-uart.3", NULL),
OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(0),
"exynos4-sdhci.0", NULL),
OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(1),
"exynos4-sdhci.1", NULL),
OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(2),
"exynos4-sdhci.2", NULL),
OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(3),
"exynos4-sdhci.3", NULL),
OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(0),
"s3c2440-i2c.0", NULL),
OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA0, "dma-pl330.0", NULL),
OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA1, "dma-pl330.1", NULL),
{},
};
static void __init exynos4210_dt_map_io(void)
{
exynos_init_io(NULL, 0);
s3c24xx_init_clocks(24000000);
}
static void __init exynos4210_dt_machine_init(void)
{
of_platform_populate(NULL, of_default_bus_match_table,
exynos4210_auxdata_lookup, NULL);
}
static char const *exynos4210_dt_compat[] __initdata = {
"samsung,exynos4210",
NULL
};
DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
/* */
.init_irq = exynos4_init_irq,
.map_io = exynos4210_dt_map_io,
.handle_irq = gic_handle_irq,
.init_machine = exynos4210_dt_machine_init,
.timer = &exynos4_timer,
.dt_compat = exynos4210_dt_compat,
.restart = exynos4_restart,
MACHINE_END
|
/* { dg-do run { target { lp64 && p9vector_hw } } } */
/* { dg-options "-mdejagnu-cpu=power9 -O2 -ftree-vectorize -fno-vect-cost-model -ffast-math" } */
/* { dg-additional-options "--param=vect-partial-vector-usage=1" } */
/* Check whether it runs successfully if we only vectorize the epilogue
with vector access with length. */
#include "p9-vec-length-run-7.h"
|
//
// MGCMonthPlannerViewDayCell.h
// Graphical Calendars Library for iOS
//
// Distributed under the MIT License
// Get the latest version from here:
//
// https://github.com/jumartin/Calendar
//
// Copyright (c) 2014-2015 Julien Martin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
#import <UIKit/UIKit.h>
@interface MGCMonthPlannerViewDayCell : UICollectionViewCell
@property (nonatomic) CGFloat headerHeight;
@property (nonatomic) UILabel *dayLabel;
@property (nonatomic) BOOL showsDot;
@property (nonatomic) UIColor *dotColor;
@end
|
/*
* U-boot - Configuration file for BR4 Appliance
*
* based on bf537-stamp.h
* Copyright (c) Switchfin Org. <dpn@switchfin.org>
*/
#ifndef __CONFIG_BR4_H__
#define __CONFIG_BR4_H__
#include <asm/config-pre.h>
/*
* Processor Settings
*/
#define CONFIG_BFIN_CPU bf537-0.3
#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER
/*
* Clock Settings
* CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
* SCLK = (CLKIN * VCO_MULT) / SCLK_DIV
*/
/* CONFIG_CLKIN_HZ is any value in Hz */
#define CONFIG_CLKIN_HZ 25000000
/* CLKIN_HALF controls the DF bit in PLL_CTL 0 = CLKIN */
/* 1 = CLKIN / 2 */
#define CONFIG_CLKIN_HALF 0
/* PLL_BYPASS controls the BYPASS bit in PLL_CTL 0 = do not bypass */
/* 1 = bypass PLL */
#define CONFIG_PLL_BYPASS 0
/* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL */
/* Values can range from 0-63 (where 0 means 64) */
#define CONFIG_VCO_MULT 24
/* CCLK_DIV controls the core clock divider */
/* Values can be 1, 2, 4, or 8 ONLY */
#define CONFIG_CCLK_DIV 1
/* SCLK_DIV controls the system clock divider */
/* Values can range from 1-15 */
#define CONFIG_SCLK_DIV 5
/*
* Memory Settings
*/
#define CONFIG_MEM_ADD_WDTH 10
#define CONFIG_MEM_SIZE 64
#define CONFIG_EBIU_SDRRC_VAL 0x306
#define CONFIG_EBIU_SDGCTL_VAL 0x8091998d
#define CONFIG_EBIU_AMGCTL_VAL 0xFF
#define CONFIG_EBIU_AMBCTL0_VAL 0x7BB07BB0
#define CONFIG_EBIU_AMBCTL1_VAL 0xFFC27BB0
#define CONFIG_SYS_MONITOR_LEN (512 * 1024)
#define CONFIG_SYS_MALLOC_LEN (384 * 1024)
/*
* Network Settings
*/
#ifndef __ADSPBF534__
#define ADI_CMDS_NETWORK 1
#define CONFIG_BFIN_MAC
#define CONFIG_NETCONSOLE
#endif
#define CONFIG_HOSTNAME br4
#define CONFIG_TFTP_BLOCKSIZE 4404
/* Uncomment next line to use fixed MAC address */
/* #define CONFIG_ETHADDR 5c:38:1a:80:a7:00 */
/*
* Flash Settings
*/
#define CONFIG_SYS_NO_FLASH /* We have no parallel FLASH */
/*
* SPI Settings
*/
#define CONFIG_BFIN_SPI
#define CONFIG_ENV_SPI_MAX_HZ 30000000
#define CONFIG_SF_DEFAULT_SPEED 30000000
#define CONFIG_SPI_FLASH
#define CONFIG_SPI_FLASH_STMICRO
/*
* Env Storage Settings
*/
#define CONFIG_ENV_IS_IN_SPI_FLASH
#define CONFIG_ENV_OFFSET 0x10000
#define CONFIG_ENV_SIZE 0x2000
#define CONFIG_ENV_SECT_SIZE 0x10000
#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
/*
* I2C Settings
*/
#define CONFIG_SYS_I2C
#define CONFIG_SYS_I2C_ADI
/*
* NAND Settings
*/
#define CONFIG_NAND_PLAT
#define CONFIG_SYS_NAND_BASE 0x20000000
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define BFIN_NAND_CLE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 2))
#define BFIN_NAND_ALE(chip) ((unsigned long)(chip)->IO_ADDR_W | (1 << 1))
#define BFIN_NAND_WRITE(addr, cmd) \
do { \
bfin_write8(addr, cmd); \
SSYNC(); \
} while (0)
#define NAND_PLAT_WRITE_CMD(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_CLE(chip), cmd)
#define NAND_PLAT_WRITE_ADR(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_ALE(chip), cmd)
#define NAND_PLAT_GPIO_DEV_READY GPIO_PF9
/*
* Misc Settings
*/
#define CONFIG_BAUDRATE 115200
#define CONFIG_RTC_BFIN
#define CONFIG_UART_CONSOLE 0
#define CONFIG_SYS_PROMPT "br4>"
#define CONFIG_BOOTCOMMAND "run nandboot"
#define CONFIG_BOOTDELAY 2
#define CONFIG_LOADADDR 0x2000000
/*
* Pull in common ADI header for remaining command/environment setup
*/
#include <configs/bfin_adi_common.h>
/*
* Overwrite some settings defined in bfin_adi_common.h
*/
#undef NAND_ENV_SETTINGS
#define NAND_ENV_SETTINGS \
"nandargs=set bootargs " CONFIG_BOOTARGS "\0" \
"nandboot=" \
"nand read $(loadaddr) 0x0 0x900000;" \
"run nandargs;" \
"bootm" \
"\0"
#endif
|
/* GLIB - Library of useful routines for C programming
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GLib Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GLib Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GLib at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __G_ARRAY_H__
#define __G_ARRAY_H__
#include <g_types.h>
G_BEGIN_DECLS
typedef struct _GArray GArray;
typedef struct _GByteArray GByteArray;
typedef struct _GPtrArray GPtrArray;
struct _GArray
{
gchar *data;
guint len;
};
struct _GByteArray
{
guint8 *data;
guint len;
};
struct _GPtrArray
{
gpointer *pdata;
guint len;
};
/* Resizable arrays, remove fills any cleared spot and shortens the
* array, while preserving the order. remove_fast will distort the
* order by moving the last element to the position of the removed
*/
#define g_array_append_val(a,v) g_array_append_vals (a, &v, 1)
#define g_array_prepend_val(a,v) g_array_prepend_vals (a, &v, 1)
#define g_array_insert_val(a,i,v) g_array_insert_vals (a, i, &v, 1)
#define g_array_index(a,t,i) (((t*) (a)->data) [(i)])
GArray* g_array_new (gboolean zero_terminated,
gboolean clear,
guint element_size);
GArray* g_array_sized_new (gboolean zero_terminated,
gboolean clear,
guint element_size,
guint reserved_size);
gchar* g_array_free (GArray *array,
gboolean free_segment);
GArray* g_array_append_vals (GArray *array,
gconstpointer data,
guint len);
GArray* g_array_prepend_vals (GArray *array,
gconstpointer data,
guint len);
GArray* g_array_insert_vals (GArray *array,
guint index,
gconstpointer data,
guint len);
GArray* g_array_set_size (GArray *array,
guint length);
GArray* g_array_remove_index (GArray *array,
guint index);
GArray* g_array_remove_index_fast (GArray *array,
guint index);
void g_array_sort (GArray *array,
GCompareFunc compare_func);
void g_array_sort_with_data (GArray *array,
GCompareFuncData compare_func,
gpointer user_data);
/* Resizable pointer array. This interface is much less complicated
* than the above. Add appends appends a pointer. Remove fills any
* cleared spot and shortens the array. remove_fast will again distort
* order.
*/
#define g_ptr_array_index(array,index) (array->pdata)[index]
GPtrArray* g_ptr_array_new (void);
GPtrArray* g_ptr_array_sized_new (guint reserved_size);
gpointer* g_ptr_array_free (GPtrArray *array,
gboolean free_seg);
void g_ptr_array_set_size (GPtrArray *array,
gint length);
gpointer g_ptr_array_remove_index (GPtrArray *array,
guint index);
gpointer g_ptr_array_remove_index_fast (GPtrArray *array,
guint index);
gboolean g_ptr_array_remove (GPtrArray *array,
gpointer data);
gboolean g_ptr_array_remove_fast (GPtrArray *array,
gpointer data);
void g_ptr_array_add (GPtrArray *array,
gpointer data);
void g_ptr_array_sort (GPtrArray *array,
GCompareFunc compare_func);
void g_ptr_array_sort_with_data (GPtrArray *array,
GCompareFuncData compare_func,
gpointer user_data);
/* Byte arrays, an array of guint8. Implemented as a GArray,
* but type-safe.
*/
GByteArray* g_byte_array_new (void);
GByteArray* g_byte_array_sized_new (guint reserved_size);
guint8* g_byte_array_free (GByteArray *array,
gboolean free_segment);
GByteArray* g_byte_array_append (GByteArray *array,
const guint8 *data,
guint len);
GByteArray* g_byte_array_prepend (GByteArray *array,
const guint8 *data,
guint len);
GByteArray* g_byte_array_set_size (GByteArray *array,
guint length);
GByteArray* g_byte_array_remove_index (GByteArray *array,
guint index);
GByteArray* g_byte_array_remove_index_fast (GByteArray *array,
guint index);
void g_byte_array_sort (GByteArray *array,
GCompareFunc compare_func);
void g_byte_array_sort_with_data (GByteArray *array,
GCompareFuncData compare_func,
gpointer user_data);
G_END_DECLS
#endif /* __G_ARRAY_H__ */
|
/*
* Copyright (C) 2008, Robert Oostenveld
* F.C. Donders Centre for Cognitive Neuroimaging, Radboud University Nijmegen,
* Kapittelweg 29, 6525 EN Nijmegen, The Netherlands
*
*/
#include <stdlib.h>
#include <stdio.h>
#include "buffer.h"
/* this is used for debugging */
int verbose = 0;
void cleanup_socket(int *arg) {
if (verbose>0) fprintf(stderr, "cleanup_socket: s = %d\n", *arg);
if ((*arg)>0) {
close_connection(*arg);
}
*arg = 0;
return;
}
void cleanup_message(void **arg) {
message_t *message = (message_t *)*arg;
if (verbose>0) fprintf(stderr, "cleanup_message()\n");
if (message) {
FREE(message->def);
FREE(message->buf);
FREE(message);
}
return;
}
void cleanup_header(void **arg) {
header_t *header = (header_t *)*arg;
if (verbose>0) fprintf(stderr, "cleanup_header()\n");
if (header) {
FREE(header->def);
FREE(header->buf);
FREE(header);
}
return;
}
void cleanup_data(void **arg) {
data_t *data = (data_t *)*arg;
if (verbose>0) fprintf(stderr, "cleanup_data()\n");
if (data) {
FREE(data->def);
FREE(data->buf);
FREE(data);
}
return;
}
void cleanup_event(void **arg) {
event_t *event = (event_t *)*arg;
if (verbose>0) fprintf(stderr, "cleanup_event()\n");
if (event) {
FREE(event->def);
FREE(event->buf);
FREE(event);
}
return;
}
void cleanup_buf(void **arg) {
if (verbose>0) fprintf(stderr, "cleanup_buf()\n");
if (*arg) {
FREE(*arg);
}
return;
}
|
/* Test file for mpfr_const_pi.
Copyright 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
Contributed by the AriC and Caramel projects, INRIA.
This file is part of the GNU MPFR Library.
The GNU MPFR Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
The GNU MPFR 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 MPFR Library; see the file COPYING.LESSER. If not, see
http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
#include <stdio.h>
#include <stdlib.h>
#include "mpfr-test.h"
/* tconst_pi [prec] [rnd] [0 = no print] */
static void
check_large (void)
{
mpfr_t x, y, z;
mpfr_init2 (x, 20000);
mpfr_init2 (y, 21000);
mpfr_init2 (z, 11791);
/* The algo failed to round for p=11791. */
(mpfr_const_pi) (z, MPFR_RNDU);
mpfr_const_pi (x, MPFR_RNDN); /* First one ! */
mpfr_const_pi (y, MPFR_RNDN); /* Then the other - cache - */
mpfr_prec_round (y, 20000, MPFR_RNDN);
if (mpfr_cmp (x, y)) {
printf ("const_pi: error for large prec (%d)\n", 1);
exit (1);
}
mpfr_prec_round (y, 11791, MPFR_RNDU);
if (mpfr_cmp (z, y)) {
printf ("const_pi: error for large prec (%d)\n", 2);
exit (1);
}
/* a worst-case to exercise recomputation */
if (MPFR_PREC_MAX > 33440) {
mpfr_set_prec (x, 33440);
mpfr_const_pi (x, MPFR_RNDZ);
}
mpfr_clears (x, y, z, (mpfr_ptr) 0);
}
/* Wrapper for tgeneric */
static int
my_const_pi (mpfr_ptr x, mpfr_srcptr y, mpfr_rnd_t r)
{
return mpfr_const_pi (x, r);
}
#define RAND_FUNCTION(x) mpfr_set_ui ((x), 0, MPFR_RNDN)
#define TEST_FUNCTION my_const_pi
#include "tgeneric.c"
static void
bug20091030 (void)
{
mpfr_t x, x_ref;
int inex, inex_ref;
mpfr_prec_t p;
int r;
mpfr_free_cache ();
mpfr_init2 (x, MPFR_PREC_MIN);
for (p = MPFR_PREC_MIN; p <= 100; p++)
{
mpfr_set_prec (x, p);
inex = mpfr_const_pi (x, MPFR_RNDU);
if (inex < 0)
{
printf ("Error, inex < 0 for RNDU (prec=%lu)\n",
(unsigned long) p);
exit (1);
}
inex = mpfr_const_pi (x, MPFR_RNDD);
if (inex > 0)
{
printf ("Error, inex > 0 for RNDD (prec=%lu)\n",
(unsigned long) p);
exit (1);
}
}
mpfr_free_cache ();
mpfr_init2 (x_ref, MPFR_PREC_MIN);
for (p = MPFR_PREC_MIN; p <= 100; p++)
{
mpfr_set_prec (x, p + 10);
mpfr_const_pi (x, MPFR_RNDN);
mpfr_set_prec (x, p);
mpfr_set_prec (x_ref, p);
for (r = 0; r < MPFR_RND_MAX; r++)
{
inex = mpfr_const_pi (x, (mpfr_rnd_t) r);
inex_ref = mpfr_const_pi_internal (x_ref, (mpfr_rnd_t) r);
if (inex != inex_ref || mpfr_cmp (x, x_ref) != 0)
{
printf ("mpfr_const_pi and mpfr_const_pi_internal disagree\n");
printf ("mpfr_const_pi gives ");
mpfr_dump (x);
printf ("mpfr_const_pi_internal gives ");
mpfr_dump (x_ref);
printf ("inex=%d inex_ref=%d\n", inex, inex_ref);
exit (1);
}
}
}
mpfr_clear (x);
mpfr_clear (x_ref);
}
int
main (int argc, char *argv[])
{
mpfr_t x;
mpfr_prec_t p;
mpfr_rnd_t rnd;
tests_start_mpfr ();
p = 53;
if (argc > 1)
{
long a = atol (argv[1]);
if (a >= MPFR_PREC_MIN && a <= MPFR_PREC_MAX)
p = a;
}
rnd = (argc > 2) ? (mpfr_rnd_t) atoi(argv[2]) : MPFR_RNDZ;
mpfr_init2 (x, p);
mpfr_const_pi (x, rnd);
if (argc >= 2)
{
if (argc < 4 || atoi (argv[3]) != 0)
{
printf ("Pi=");
mpfr_out_str (stdout, 10, 0, x, rnd);
puts ("");
}
}
else if (mpfr_cmp_str1 (x, "3.141592653589793116") )
{
printf ("mpfr_const_pi failed for prec=53\n");
mpfr_out_str (stdout, 10, 0, x, MPFR_RNDN); putchar('\n');
exit (1);
}
mpfr_set_prec (x, 32);
mpfr_const_pi (x, MPFR_RNDN);
if (mpfr_cmp_str1 (x, "3.141592653468251") )
{
printf ("mpfr_const_pi failed for prec=32\n");
exit (1);
}
mpfr_clear (x);
bug20091030 ();
check_large ();
test_generic (2, 200, 1);
tests_end_mpfr ();
return 0;
}
|
#ifndef QUEUE_H
#define QUEUE_H
int uw_dequeue();
void uw_enqueue(int);
#endif
|
/*******************************************************/
/* "C" Language Integrated Production System */
/* */
/* CLIPS Version 6.30 08/16/14 */
/* */
/* SORT FUNCTIONS HEADER MODULE */
/*******************************************************/
/*************************************************************/
/* Purpose: Contains the code for sorting functions. */
/* */
/* Principal Programmer(s): */
/* Gary D. Riley */
/* */
/* Contributing Programmer(s): */
/* */
/* Revision History: */
/* */
/* 6.23: Correction for FalseSymbol/TrueSymbol. DR0859 */
/* */
/* 6.24: The sort function leaks memory when called */
/* with a multifield value of length zero. */
/* DR0864 */
/* */
/* 6.30: Added environment cleanup call function */
/* DeallocateSortFunctionData. */
/* */
/*************************************************************/
#ifndef _H_sortfun
#define _H_sortfun
#ifdef LOCALE
#undef LOCALE
#endif
#ifdef _SORTFUN_SOURCE_
#define LOCALE
#else
#define LOCALE extern
#endif
LOCALE void SortFunctionDefinitions(void *);
LOCALE void MergeSort(void *,unsigned long,DATA_OBJECT *,
int (*)(void *,DATA_OBJECT *,DATA_OBJECT *));
LOCALE void SortFunction(void *,DATA_OBJECT *);
#endif /* _H_sortfun */
|
/*************************************************************************/
/* vector3.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_VECTOR3_H
#define GODOT_VECTOR3_H
#ifdef __cplusplus
extern "C" {
#endif
#include <gdnative/math_defs.h>
#define GODOT_VECTOR3_SIZE (sizeof(godot_real_t) * 3)
#ifndef GODOT_CORE_API_GODOT_VECTOR3_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_VECTOR3_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_VECTOR3_SIZE];
} godot_vector3;
#endif
#define GODOT_VECTOR3I_SIZE (sizeof(int32_t) * 3)
#ifndef GODOT_CORE_API_GODOT_VECTOR3I_TYPE_DEFINED
#define GODOT_CORE_API_GODOT_VECTOR3I_TYPE_DEFINED
typedef struct {
uint8_t _dont_touch_that[GODOT_VECTOR3I_SIZE];
} godot_vector3i;
#endif
#include <gdnative/gdnative.h>
void GDAPI godot_vector3_new(godot_vector3 *p_self);
void GDAPI godot_vector3_new_copy(godot_vector3 *r_dest, const godot_vector3 *p_src);
void GDAPI godot_vector3i_new(godot_vector3i *p_self);
void GDAPI godot_vector3i_new_copy(godot_vector3i *r_dest, const godot_vector3i *p_src);
godot_real_t GDAPI *godot_vector3_operator_index(godot_vector3 *p_self, godot_int p_index);
const godot_real_t GDAPI *godot_vector3_operator_index_const(const godot_vector3 *p_self, godot_int p_index);
int32_t GDAPI *godot_vector3i_operator_index(godot_vector3i *p_self, godot_int p_index);
const int32_t GDAPI *godot_vector3i_operator_index_const(const godot_vector3i *p_self, godot_int p_index);
#ifdef __cplusplus
}
#endif
#endif // GODOT_VECTOR3_H
|
/**
Wrapper code for malloc on the VxWorks platform
*/
#include <memLib.h>
|
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebCommon_h
#define WebCommon_h
// -----------------------------------------------------------------------------
// Default configuration
#if !defined(WEBKIT_IMPLEMENTATION)
#define WEBKIT_IMPLEMENTATION 0
#endif
#if !defined(WEBKIT_USING_SKIA)
#if !defined(__APPLE__) || defined(USE_SKIA)
#define WEBKIT_USING_SKIA 1
#else
#define WEBKIT_USING_SKIA 0
#endif
#endif
#if !defined(WEBKIT_USING_CG)
#if defined(__APPLE__) && !WEBKIT_USING_SKIA
#define WEBKIT_USING_CG 1
#else
#define WEBKIT_USING_CG 0
#endif
#endif
#if !defined(WEBKIT_USING_V8)
#define WEBKIT_USING_V8 1
#endif
#if !defined(WEBKIT_USING_JSC)
#define WEBKIT_USING_JSC 0
#endif
// -----------------------------------------------------------------------------
// Exported symbols need to be annotated with WEBKIT_EXPORT
#if defined(WEBKIT_DLL)
#if defined(WIN32)
#if WEBKIT_IMPLEMENTATION
#define WEBKIT_EXPORT __declspec(dllexport)
#else
#define WEBKIT_EXPORT __declspec(dllimport)
#endif
#else
#define WEBKIT_EXPORT __attribute__((visibility("default")))
#endif
#else
#define WEBKIT_EXPORT
#endif
// -----------------------------------------------------------------------------
// Basic types
#include <stddef.h> // For size_t
#if defined(WIN32)
// Visual Studio doesn't have stdint.h.
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned int uint32_t;
#endif
//namespace WebKit {
// UTF-16 character type
#if defined(WIN32)
typedef wchar_t WebUChar;
#else
typedef unsigned short WebUChar;
#endif
// -----------------------------------------------------------------------------
// Assertions
WEBKIT_EXPORT void failedAssertion(const char* file, int line, const char* function, const char* assertion);
//} // namespace WebKit
// Ideally, only use inside the public directory but outside of WEBKIT_IMPLEMENTATION blocks. (Otherwise use WTF's ASSERT.)
#if defined(NDEBUG)
#define WEBKIT_ASSERT(assertion) ((void)0)
#else
#define WEBKIT_ASSERT(assertion) do { \
if (!(assertion)) \
failedAssertion(__FILE__, __LINE__, __FUNCTION__, #assertion); \
} while (0)
#endif
#define WEBKIT_ASSERT_NOT_REACHED() WEBKIT_ASSERT(0)
#endif
|
/**
*
* \file
*
* \brief Usart Serial driver for AVR UC3.
*
* This file defines a useful set of functions for the Serial interface on AVR
* UC3 devices.
*
* Copyright (c) 2009-2012 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
#ifndef _USART_SERIAL_H_
#define _USART_SERIAL_H_
#include "compiler.h"
#include "sysclk.h"
#include "status_codes.h"
#include "usart.h"
/*! \name Serial Management Configuration
*/
//! @{
#include "conf_usart_serial.h"
//! Default Usart Mode
#ifndef CONFIG_USART_SERIAL_MODE
#define CONFIG_USART_SERIAL_MODE USART_NORMAL_CHMODE
#endif
//! @}
typedef usart_options_t usart_serial_options_t;
typedef volatile avr32_usart_t *usart_if;
/*! \brief Initializes the Usart in master mode.
*
* \param usart Base address of the USART instance.
* \param opt Options needed to set up RS232 communication (see
* \ref usart_options_t).
* \retval true if the initialization was successful
* \retval false if initialization failed (error in baud rate calculation)
*/
static inline bool usart_serial_init(volatile avr32_usart_t *usart,
usart_serial_options_t *opt)
{
// USART options.
opt->channelmode = CONFIG_USART_SERIAL_MODE;
sysclk_enable_peripheral_clock(usart);
if (usart_init_rs232(usart, opt, sysclk_get_peripheral_bus_hz(usart))) {
return true;
}
else {
return false;
}
}
/*! \brief Sends a character with the USART.
*
* \param usart Base address of the USART instance.
* \param c Character to write.
*
* \return Status.
* \retval 1 The character was written.
* \retval 0 The function timed out before the USART transmitter became
* ready to send.
*/
static inline int usart_serial_putchar(usart_if usart, uint8_t c)
{
while (usart_write_char(usart, c)!=USART_SUCCESS);
return 1;
}
/*! \brief Waits until a character is received, and returns it.
*
* \param usart Base address of the USART instance.
* \param data Data to read
*
*/
static inline void usart_serial_getchar(usart_if usart, uint8_t *data)
{
*data = usart_getchar(usart);
}
/**
* \brief Send a sequence of bytes to a USART device
*
* \param usart Base address of the USART instance.
* \param data data buffer to write
* \param len Length of data
*
*/
status_code_t usart_serial_write_packet(usart_if usart, const uint8_t *data,
size_t len);
/**
* \brief Receive a sequence of bytes to a USART device
*
* \param usart Base address of the USART instance.
* \param data data buffer to write
* \param len Length of data
*
*/
status_code_t usart_serial_read_packet(usart_if usart, uint8_t *data,
size_t len);
#endif // _USART_SERIAL_H_
|
/* { dg-do compile } */
/* { dg-options "-O2" } */
unsigned int foo(unsigned int x)
{
return __builtin_popcount(x);
}
/* { dg-final { scan-assembler-times "popc.b32" 1 } } */
|
/*
* Copyright (C) 2009,2014 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef DummyRepeaterMessageEvent_H
#define DummyRepeaterMessageEvent_H
#include <wx/wx.h>
#include "MessageData.h"
class CDummyRepeaterMessageEvent : public wxEvent {
public:
CDummyRepeaterMessageEvent(CMessageData* message, wxEventType type, int id = 0);
virtual ~CDummyRepeaterMessageEvent();
virtual CMessageData* getMessageData() const;
virtual wxEvent* Clone() const;
protected:
CDummyRepeaterMessageEvent(const CDummyRepeaterMessageEvent& event);
private:
CMessageData* m_message;
};
#endif
|
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// Copyright : (C) 2015 Eran Ifrah
// File name : WSImporter.h
//
// -------------------------------------------------------------------------
// A
// _____ _ _ _ _
// / __ \ | | | | (_) |
// | / \/ ___ __| | ___| | _| |_ ___
// | | / _ \ / _ |/ _ \ | | | __/ _ )
// | \__/\ (_) | (_| | __/ |___| | || __/
// \____/\___/ \__,_|\___\_____/_|\__\___|
//
// F i l e
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#ifndef WSIMPORTER_H
#define WSIMPORTER_H
#include <wx/string.h>
#include <vector>
#include <set>
#include <memory>
#include "GenericImporter.h"
#include "codelite_exports.h"
class WXDLLIMPEXP_SDK WSImporter
{
public:
WSImporter();
~WSImporter();
void Load(const wxString& filename, const wxString& defaultCompiler);
bool Import(wxString& errMsg);
protected:
void AddImporter(std::shared_ptr<GenericImporter> importer);
private:
bool ContainsEnvVar(std::vector<wxString> elems);
std::set<wxString> GetListEnvVarName(std::vector<wxString> elems);
wxString GetVPath(const wxString& filename, const wxString& virtualPath);
wxString filename, defaultCompiler;
std::vector<std::shared_ptr<GenericImporter> > importers;
};
#endif // WSIMPORTER_H
|
#include "cache.h"
#include "builtin.h"
#include "parse-options.h"
static const char * const update_server_info_usage[] = {
"git update-server-info [--force]",
NULL
};
int cmd_update_server_info(int argc, const char **argv, const char *prefix)
{
int force = 0;
struct option options[] = {
OPT_BOOLEAN('f', "force", &force,
"update the info files from scratch"),
OPT_END()
};
argc = parse_options(argc, argv, prefix, options,
update_server_info_usage, 0);
if (argc > 0)
usage_with_options(update_server_info_usage, options);
return !!update_server_info(force);
}
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "primpl.h"
void _MD_EarlyInit(void)
{
}
PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
{
#ifndef _PR_PTHREADS
if (isCurrent) {
(void) setjmp(CONTEXT(t));
}
*np = sizeof(CONTEXT(t)) / sizeof(PRWord);
return (PRWord *) CONTEXT(t);
#else
*np = 0;
return NULL;
#endif
}
#ifdef _PR_PTHREADS
extern void _MD_unix_terminate_waitpid_daemon(void);
void _MD_CleanupBeforeExit(void)
{
_MD_unix_terminate_waitpid_daemon();
}
#else /* ! _PR_PTHREADS */
void
_MD_SET_PRIORITY(_MDThread *thread, PRUintn newPri)
{
return;
}
PRStatus
_MD_InitializeThread(PRThread *thread)
{
/*
* set the pointers to the stack-pointer and frame-pointer words in the
* context structure; this is for debugging use.
*/
thread->md.sp = _MD_GET_SP_PTR(thread);
thread->md.fp = _MD_GET_FP_PTR(thread);
return PR_SUCCESS;
}
PRStatus
_MD_WAIT(PRThread *thread, PRIntervalTime ticks)
{
PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
_PR_MD_SWITCH_CONTEXT(thread);
return PR_SUCCESS;
}
PRStatus
_MD_WAKEUP_WAITER(PRThread *thread)
{
if (thread) {
PR_ASSERT(!(thread->flags & _PR_GLOBAL_SCOPE));
}
return PR_SUCCESS;
}
/* These functions should not be called for Linux */
void
_MD_YIELD(void)
{
PR_NOT_REACHED("_MD_YIELD has not yet been implemented on L4.");
}
PRStatus
_MD_CREATE_THREAD(
PRThread *thread,
void (*start) (void *),
PRThreadPriority priority,
PRThreadScope scope,
PRThreadState state,
PRUint32 stackSize)
{
PR_NOT_REACHED("_MD_CREATE_THREAD has not yet been implemented on L4.");
return PR_FAILURE;
}
#endif /* ! _PR_PTHREADS */
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtTest module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QXMLTESTLOGGER_P_H
#define QXMLTESTLOGGER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtTest/private/qabstracttestlogger_p.h>
#include <QtCore/qelapsedtimer.h>
QT_BEGIN_NAMESPACE
class QXmlTestLogger : public QAbstractTestLogger
{
public:
enum XmlMode { Complete = 0, Light };
QXmlTestLogger(XmlMode mode, const char *filename);
~QXmlTestLogger();
void startLogging();
void stopLogging();
void enterTestFunction(const char *function);
void leaveTestFunction();
void addIncident(IncidentTypes type, const char *description,
const char *file = 0, int line = 0);
void addBenchmarkResult(const QBenchmarkResult &result);
void addMessage(MessageTypes type, const QString &message,
const char *file = 0, int line = 0);
static int xmlCdata(QTestCharBuffer *dest, char const* src);
static int xmlQuote(QTestCharBuffer *dest, char const* src);
static int xmlCdata(QTestCharBuffer *dest, char const* src, size_t n);
static int xmlQuote(QTestCharBuffer *dest, char const* src, size_t n);
private:
XmlMode xmlmode;
QElapsedTimer m_functionTime;
QElapsedTimer m_totalTime;
};
QT_END_NAMESPACE
#endif
|
//
// UUAVAudioPlayer.h
// BloodSugarForDoc
//
// Created by shake on 14-9-1.
// Copyright (c) 2014年 shake. All rights reserved.
//
#import <AVFoundation/AVFoundation.h>
@protocol UUAVAudioPlayerDelegate <NSObject>
- (void)UUAVAudioPlayerBeiginLoadVoice;
- (void)UUAVAudioPlayerBeiginPlay;
- (void)UUAVAudioPlayerDidFinishPlay;
@end
@interface UUAVAudioPlayer : NSObject
@property (nonatomic, assign)id <UUAVAudioPlayerDelegate>delegate;
+ (UUAVAudioPlayer *)sharedInstance;
-(void)playSongWithUrl:(NSString *)songUrl;
-(void)playSongWithData:(NSData *)songData;
- (void)stopSound;
@end
|
/*
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/cloudfront/CloudFront_EXPORTS.h>
#include <aws/cloudfront/model/StreamingDistribution.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Xml
{
class XmlDocument;
} // namespace Xml
} // namespace Utils
namespace CloudFront
{
namespace Model
{
/*
The returned result of the corresponding request.
*/
class AWS_CLOUDFRONT_API CreateStreamingDistribution2015_04_17Result
{
public:
CreateStreamingDistribution2015_04_17Result();
CreateStreamingDistribution2015_04_17Result(const AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);
CreateStreamingDistribution2015_04_17Result& operator=(const AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);
/*
The streaming distribution's information.
*/
inline const StreamingDistribution& GetStreamingDistribution() const{ return m_streamingDistribution; }
/*
The streaming distribution's information.
*/
inline void SetStreamingDistribution(const StreamingDistribution& value) { m_streamingDistribution = value; }
/*
The streaming distribution's information.
*/
inline void SetStreamingDistribution(StreamingDistribution&& value) { m_streamingDistribution = value; }
/*
The streaming distribution's information.
*/
inline CreateStreamingDistribution2015_04_17Result& WithStreamingDistribution(const StreamingDistribution& value) { SetStreamingDistribution(value); return *this;}
/*
The streaming distribution's information.
*/
inline CreateStreamingDistribution2015_04_17Result& WithStreamingDistribution(StreamingDistribution&& value) { SetStreamingDistribution(value); return *this;}
/*
The fully qualified URI of the new streaming distribution resource just created. For example: https://cloudfront.amazonaws.com/2010-11-01/streaming-distribution/EGTXBD79H29TRA8.
*/
inline const Aws::String& GetLocation() const{ return m_location; }
/*
The fully qualified URI of the new streaming distribution resource just created. For example: https://cloudfront.amazonaws.com/2010-11-01/streaming-distribution/EGTXBD79H29TRA8.
*/
inline void SetLocation(const Aws::String& value) { m_location = value; }
/*
The fully qualified URI of the new streaming distribution resource just created. For example: https://cloudfront.amazonaws.com/2010-11-01/streaming-distribution/EGTXBD79H29TRA8.
*/
inline void SetLocation(Aws::String&& value) { m_location = value; }
/*
The fully qualified URI of the new streaming distribution resource just created. For example: https://cloudfront.amazonaws.com/2010-11-01/streaming-distribution/EGTXBD79H29TRA8.
*/
inline void SetLocation(const char* value) { m_location.assign(value); }
/*
The fully qualified URI of the new streaming distribution resource just created. For example: https://cloudfront.amazonaws.com/2010-11-01/streaming-distribution/EGTXBD79H29TRA8.
*/
inline CreateStreamingDistribution2015_04_17Result& WithLocation(const Aws::String& value) { SetLocation(value); return *this;}
/*
The fully qualified URI of the new streaming distribution resource just created. For example: https://cloudfront.amazonaws.com/2010-11-01/streaming-distribution/EGTXBD79H29TRA8.
*/
inline CreateStreamingDistribution2015_04_17Result& WithLocation(Aws::String&& value) { SetLocation(value); return *this;}
/*
The fully qualified URI of the new streaming distribution resource just created. For example: https://cloudfront.amazonaws.com/2010-11-01/streaming-distribution/EGTXBD79H29TRA8.
*/
inline CreateStreamingDistribution2015_04_17Result& WithLocation(const char* value) { SetLocation(value); return *this;}
/*
The current version of the streaming distribution created.
*/
inline const Aws::String& GetETag() const{ return m_eTag; }
/*
The current version of the streaming distribution created.
*/
inline void SetETag(const Aws::String& value) { m_eTag = value; }
/*
The current version of the streaming distribution created.
*/
inline void SetETag(Aws::String&& value) { m_eTag = value; }
/*
The current version of the streaming distribution created.
*/
inline void SetETag(const char* value) { m_eTag.assign(value); }
/*
The current version of the streaming distribution created.
*/
inline CreateStreamingDistribution2015_04_17Result& WithETag(const Aws::String& value) { SetETag(value); return *this;}
/*
The current version of the streaming distribution created.
*/
inline CreateStreamingDistribution2015_04_17Result& WithETag(Aws::String&& value) { SetETag(value); return *this;}
/*
The current version of the streaming distribution created.
*/
inline CreateStreamingDistribution2015_04_17Result& WithETag(const char* value) { SetETag(value); return *this;}
private:
StreamingDistribution m_streamingDistribution;
Aws::String m_location;
Aws::String m_eTag;
};
} // namespace Model
} // namespace CloudFront
} // namespace Aws |
/*
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/cloudformation/CloudFormation_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace CloudFormation
{
namespace Model
{
enum class ResourceSignalStatus
{
NOT_SET,
SUCCESS,
FAILURE
};
namespace ResourceSignalStatusMapper
{
AWS_CLOUDFORMATION_API ResourceSignalStatus GetResourceSignalStatusForName(const Aws::String& name);
AWS_CLOUDFORMATION_API Aws::String GetNameForResourceSignalStatus(ResourceSignalStatus value);
} // namespace ResourceSignalStatusMapper
} // namespace Model
} // namespace CloudFormation
} // namespace Aws
|
/* Copyright (C) 2000, 2002 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 <stdio_ext.h>
size_t
__fpending (FILE *fp)
{
if (fp->_mode > 0)
return fp->_wide_data->_IO_write_ptr - fp->_wide_data->_IO_write_base;
else
return fp->_IO_write_ptr - fp->_IO_write_base;
}
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ANDROID_BOOKMARKS_PARTNER_BOOKMARKS_READER_H_
#define CHROME_BROWSER_ANDROID_BOOKMARKS_PARTNER_BOOKMARKS_READER_H_
#include <stdint.h>
#include "base/android/jni_weak_ref.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "components/bookmarks/browser/bookmark_model.h"
class PartnerBookmarksShim;
class Profile;
// Generates a partner bookmark hierarchy and handles submitting the results to
// the global PartnerBookmarksShim.
class PartnerBookmarksReader {
public:
PartnerBookmarksReader(PartnerBookmarksShim* partner_bookmarks_shim,
Profile* profile);
~PartnerBookmarksReader();
// JNI methods
void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
void Reset(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
jlong AddPartnerBookmark(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
const base::android::JavaParamRef<jstring>& jurl,
const base::android::JavaParamRef<jstring>& jtitle,
jboolean is_folder,
jlong parent_id,
const base::android::JavaParamRef<jbyteArray>& favicon,
const base::android::JavaParamRef<jbyteArray>& touchicon);
void PartnerBookmarksCreationComplete(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
// JNI registration
static bool RegisterPartnerBookmarksReader(JNIEnv* env);
private:
PartnerBookmarksShim* partner_bookmarks_shim_;
Profile* profile_;
// JNI
scoped_ptr<bookmarks::BookmarkNode> wip_partner_bookmarks_root_;
int64_t wip_next_available_id_;
DISALLOW_COPY_AND_ASSIGN(PartnerBookmarksReader);
};
#endif // CHROME_BROWSER_ANDROID_BOOKMARKS_PARTNER_BOOKMARKS_READER_H_
|
#include "../src/tmodelutil.h"
|
// Copyright 2013 The Flutter 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 FLUTTER_LIB_UI_TEXT_FONT_COLLECTION_H_
#define FLUTTER_LIB_UI_TEXT_FONT_COLLECTION_H_
#include <memory>
#include <vector>
#include "flutter/assets/asset_manager.h"
#include "flutter/fml/macros.h"
#include "flutter/fml/memory/ref_ptr.h"
#include "txt/font_collection.h"
namespace tonic {
class DartLibraryNatives;
} // namespace tonic
namespace flutter {
class FontCollection {
public:
FontCollection();
~FontCollection();
static void RegisterNatives(tonic::DartLibraryNatives* natives);
std::shared_ptr<txt::FontCollection> GetFontCollection() const;
void SetupDefaultFontManager();
void RegisterFonts(std::shared_ptr<AssetManager> asset_manager);
void RegisterTestFonts();
void LoadFontFromList(const uint8_t* font_data,
int length,
std::string family_name);
private:
std::shared_ptr<txt::FontCollection> collection_;
sk_sp<txt::DynamicFontManager> dynamic_font_manager_;
FML_DISALLOW_COPY_AND_ASSIGN(FontCollection);
};
} // namespace flutter
#endif // FLUTTER_LIB_UI_TEXT_FONT_COLLECTION_H_
|
/*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2001 Peter Kelly (pmk@post.com)
* (C) 2001 Dirk Mueller (mueller@kde.org)
* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
* reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_DOM_ATTR_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_ATTR_H_
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/dom/node.h"
#include "third_party/blink/renderer/core/dom/qualified_name.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
namespace blink {
class CORE_EXPORT Attr final : public Node {
DEFINE_WRAPPERTYPEINFO();
public:
Attr(Element&, const QualifiedName&);
Attr(Document&, const QualifiedName&, const AtomicString& value);
~Attr() override;
String name() const { return name_.ToString(); }
bool specified() const { return true; }
Element* ownerElement() const { return element_; }
const AtomicString& value() const;
void setValue(const AtomicString&, ExceptionState&);
const QualifiedName GetQualifiedName() const;
void AttachToElement(Element*, const AtomicString&);
void DetachFromElementWithValue(const AtomicString&);
const AtomicString& localName() const { return name_.LocalName(); }
const AtomicString& namespaceURI() const { return name_.NamespaceURI(); }
const AtomicString& prefix() const { return name_.Prefix(); }
void Trace(Visitor*) const override;
private:
bool IsElementNode() const =
delete; // This will catch anyone doing an unnecessary check.
String nodeName() const override { return name(); }
NodeType getNodeType() const override { return kAttributeNode; }
String nodeValue() const override { return value(); }
void setNodeValue(const String&) override;
Node* Clone(Document&, CloneChildrenFlag) const override;
bool IsAttributeNode() const override { return true; }
// Attr wraps either an element/name, or a name/value pair (when it's a
// standalone Node.)
// Note that name_ is always set, but element_ /
// standalone_value_or_attached_local_name_ may be null.
Member<Element> element_;
QualifiedName name_;
// Holds the value if it is a standalone Node, or the local name of the
// attribute it is attached to on an Element. The latter may (letter case)
// differ from name_'s local name. As these two modes are non-overlapping,
// use a single field.
AtomicString standalone_value_or_attached_local_name_;
};
template <>
struct DowncastTraits<Attr> {
static bool AllowFrom(const Node& node) { return node.IsAttributeNode(); }
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_DOM_ATTR_H_
|
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __NETNS_XFRM_H
#define __NETNS_XFRM_H
#include <linux/list.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
#include <linux/rhashtable-types.h>
#include <linux/xfrm.h>
#include <net/dst_ops.h>
struct ctl_table_header;
struct xfrm_policy_hash {
struct hlist_head __rcu *table;
unsigned int hmask;
u8 dbits4;
u8 sbits4;
u8 dbits6;
u8 sbits6;
};
struct xfrm_policy_hthresh {
struct work_struct work;
seqlock_t lock;
u8 lbits4;
u8 rbits4;
u8 lbits6;
u8 rbits6;
};
struct netns_xfrm {
struct list_head state_all;
/*
* Hash table to find appropriate SA towards given target (endpoint of
* tunnel or destination of transport mode) allowed by selector.
*
* Main use is finding SA after policy selected tunnel or transport
* mode. Also, it can be used by ah/esp icmp error handler to find
* offending SA.
*/
struct hlist_head __rcu *state_bydst;
struct hlist_head __rcu *state_bysrc;
struct hlist_head __rcu *state_byspi;
unsigned int state_hmask;
unsigned int state_num;
struct work_struct state_hash_work;
struct list_head policy_all;
struct hlist_head *policy_byidx;
unsigned int policy_idx_hmask;
struct hlist_head policy_inexact[XFRM_POLICY_MAX];
struct xfrm_policy_hash policy_bydst[XFRM_POLICY_MAX];
unsigned int policy_count[XFRM_POLICY_MAX * 2];
struct work_struct policy_hash_work;
struct xfrm_policy_hthresh policy_hthresh;
struct list_head inexact_bins;
struct sock *nlsk;
struct sock *nlsk_stash;
u32 sysctl_aevent_etime;
u32 sysctl_aevent_rseqth;
int sysctl_larval_drop;
u32 sysctl_acq_expires;
#ifdef CONFIG_SYSCTL
struct ctl_table_header *sysctl_hdr;
#endif
struct dst_ops xfrm4_dst_ops;
#if IS_ENABLED(CONFIG_IPV6)
struct dst_ops xfrm6_dst_ops;
#endif
spinlock_t xfrm_state_lock;
spinlock_t xfrm_policy_lock;
struct mutex xfrm_cfg_mutex;
};
#endif
|
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2016 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface UIColor (Realm)
+ (NSDictionary<NSString *, UIColor*> *)realmColors;
@end
|
/*!
@file
@author Albert Semenov
@date 01/2009
@module
*/
#pragma once
#include "Align.h"
#include "Colour.h"
#include "IntSize.h"
#include "IntPoint.h"
#include "IntCoord.h"
#include "IntRect.h"
#include "FloatSize.h"
#include "FloatPoint.h"
#include "FloatCoord.h"
#include "FloatRect.h"
#include "KeyCode.h"
#include "MouseButton.h"
#include "WidgetStyle.h"
#include "MenuItemType.h"
#include "ResizingPolicy.h"
#include "FlowDirection.h"
#include "LogLevel.h"
#include "DropItemState.h"
#include "DropWidgetState.h"
#include "ItemDropInfo.h"
#include "NotifyItemData.h"
#include "ItemInfo.h"
#include "ToolTipInfo.h"
#include "NativePtrHolder.h"
|
//
// ______ _ _ _ _____ _____ _ __
// | ____| | | (_) | | / ____| __ \| |/ /
// | |__ ___| |_ _ _ __ ___ ___ | |_ ___ | (___ | | | | ' /
// | __| / __| __| | '_ ` _ \ / _ \| __/ _ \ \___ \| | | | <
// | |____\__ \ |_| | | | | | | (_) | || __/ ____) | |__| | . \
// |______|___/\__|_|_| |_| |_|\___/ \__\___| |_____/|_____/|_|\_\
//
//
// Copyright (c) 2015 Estimote. All rights reserved.
#import <Foundation/Foundation.h>
#import "ESTDevice.h"
#import "ESTDefinitions.h"
#import "ESTDeviceSettingProtocol.h"
#import "ESTCloudSettingProtocol.h"
#import "ESTNotificationSettingProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@class ESTDeviceConnectable;
@protocol ESTDeviceConnectableDelegate <NSObject>
@optional
- (void)estDeviceConnectionDidSucceed:(ESTDeviceConnectable *)device;
- (void)estDevice:(ESTDeviceConnectable *)device didDisconnectWithError:(NSError * _Nullable)error;
- (void)estDevice:(ESTDeviceConnectable *)device didFailConnectionWithError:(NSError *)error;
@end
@interface ESTDeviceConnectable : ESTDevice
@property (nonatomic, weak) id <ESTDeviceConnectableDelegate> _Nullable delegate;
@property (nonatomic, assign, readonly) ESTConnectionStatus connectionStatus;
/*
* Perform connection to the device.
*/
- (void)connect;
/*
* Cancel connection to the device.
*/
- (void)disconnect;
/*
* Read single setting.
*/
- (void)readSetting:(id <ESTSettingProtocol>)setting;
/*
* Reads array of settings defined by objects implementing <ESTSettingProtocol> protocol.
*/
- (void)readSettings:(NSArray *)settings;
/*
* Write single setting.
*/
- (void)writeSetting:(id <ESTSettingProtocol>)setting;
/*
* Writes array of settings defined by objects implementing <ESTSettingProtocol> protocol.
*/
- (void)writeSettings:(NSArray *)settings;
/*
* Allows to register for setting with notification type, implementing <ESTNotificationSettingProtocol> protocol.
*/
- (void)registerForNotificationSetting:(id <ESTNotificationSettingProtocol>)setting;
/*
* Allows to register for settings with notification type, implementing <ESTNotificationSettingProtocol> protocol.
*/
- (void)registerForNotificationSettings:(NSArray *)settings;
@end
NS_ASSUME_NONNULL_END
|
/*************************************************************************/
/* editor_sectioned_inspector.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef EDITOR_SECTIONED_INSPECTOR_H
#define EDITOR_SECTIONED_INSPECTOR_H
#include "editor/editor_inspector.h"
#include "scene/gui/split_container.h"
#include "scene/gui/tree.h"
class SectionedInspectorFilter;
class SectionedInspector : public HSplitContainer {
GDCLASS(SectionedInspector, HSplitContainer);
ObjectID obj;
Tree *sections;
SectionedInspectorFilter *filter;
Map<String, TreeItem *> section_map;
EditorInspector *inspector;
LineEdit *search_box = nullptr;
String selected_category;
bool restrict_to_basic = false;
static void _bind_methods();
void _section_selected();
void _search_changed(const String &p_what);
public:
void register_search_box(LineEdit *p_box);
EditorInspector *get_inspector();
void edit(Object *p_object);
String get_full_item_path(const String &p_item);
void set_current_section(const String &p_section);
String get_current_section() const;
void set_restrict_to_basic_settings(bool p_restrict);
void update_category_list();
SectionedInspector();
~SectionedInspector();
};
#endif // EDITOR_SECTIONED_INSPECTOR_H
|
/* $Id: bootstrap_widget.h 23600 2011-12-19 20:46:17Z truebrain $ */
/*
* This file is part of OpenTTD.
* OpenTTD 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.
* OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file bootstrap_widget.h Types related to the bootstrap widgets. */
#ifndef WIDGETS_BOOTSTRAP_WIDGET_H
#define WIDGETS_BOOTSTRAP_WIDGET_H
/** Widgets of the #BootstrapBackground class. */
enum BootstrapBackgroundWidgets {
WID_BB_BACKGROUND, ///< Background of the window.
};
/** Widgets of the #BootstrapContentDownloadStatusWindow class. */
enum BootstrapAskForDownloadWidgets {
WID_BAFD_QUESTION, ///< The question whether to download.
WID_BAFD_YES, ///< An affirmative answer to the question.
WID_BAFD_NO, ///< An negative answer to the question.
};
#endif /* WIDGETS_BOOTSTRAP_WIDGET_H */
|
/*
Copyright (c) 1998-2001 by Juliusz Chroboczek
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/* $XFree86$ */
/* Binary compatibility entry points. */
/* This file includes code to make modules compiled for earlier
versions of the fontenc interfaces link with this one. It does
*not* provide source compatibility, as many of the data structures
now have different names. */
extern char *font_encoding_from_xlfd(const char*, int);
extern unsigned font_encoding_recode(unsigned, FontEncPtr, FontMapPtr);
extern FontEncPtr font_encoding_find(const char*, const char*);
extern char *font_encoding_name(unsigned, FontEncPtr, FontMapPtr);
extern char **identifyEncodingFile(const char *fileName);
|
/* linux/arch/arm/mach-msm/board-saga.h
* Copyright (C) 2007-2009 HTC Corporation.
*
* 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 __ARCH_ARM_MACH_MSM_BOARD_SAGA_H
#define __ARCH_ARM_MACH_MSM_BOARD_SAGA_H
#include <mach/board.h>
#define MSM_LINUX_BASE1 0x04400000
#define MSM_LINUX_SIZE1 0x0BC00000
#define MSM_LINUX_BASE2 0x20000000
#define MSM_LINUX_SIZE2 0x0A400000
#define MSM_MEM_256MB_OFFSET 0x10000000
#define MSM_GPU_MEM_BASE 0x00100000
#define MSM_GPU_MEM_SIZE 0x00300000
#define MSM_RAM_CONSOLE_BASE 0x00500000
#define MSM_RAM_CONSOLE_SIZE 0x00100000
#define MSM_PMEM_ADSP_BASE 0x2A400000
#define MSM_PMEM_ADSP_SIZE 0x03200000
#define PMEM_KERNEL_EBI1_BASE 0x2D600000
#define PMEM_KERNEL_EBI1_SIZE 0x00700000
#define MSM_PMEM_CAMERA_BASE 0x2DD00000
#define MSM_PMEM_CAMERA_SIZE 0x00000000
#define MSM_PMEM_MDP_BASE 0x2DD00000
#define MSM_PMEM_MDP_SIZE 0x02000000
#define MSM_FB_BASE 0x2FD00000
#define MSM_FB_SIZE 0x00300000
#define SAGA_GPIO_WIFI_IRQ 147
#define SAGA_GPIO_WIFI_SHUTDOWN_N 39
#define SAGA_GPIO_UART2_RX 51
#define SAGA_GPIO_UART2_TX 52
#define SAGA_GPIO_KEYPAD_POWER_KEY 46
/* Macros assume PMIC GPIOs start at 0 */
#define PM8058_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio + NR_GPIO_IRQS)
#define PM8058_GPIO_SYS_TO_PM(sys_gpio) (sys_gpio - NR_GPIO_IRQS)
/* Proximity */
#define SAGA_GPIO_PROXIMITY_INT_N 18
#define SAGA_GPIO_COMPASS_INT 42
#define SAGA_GPIO_GSENSOR_INT_N 180
#define SAGA_LAYOUTS_XA_XB { \
{ { 0, 1, 0}, { 1, 0, 0}, {0, 0, -1} }, \
{ { 0, -1, 0}, { 1, 0, 0}, {0, 0, -1} }, \
{ { 1, 0, 0}, { 0, -1, 0}, {0, 0, -1} }, \
{ {-1, 0, 0}, { 0, 0, -1}, {0, 1, 0} } \
}
#define SAGA_LAYOUTS_XC { \
{ { 0, 1, 0}, {-1, 0, 0}, {0, 0, 1} }, \
{ { 0, -1, 0}, { 1, 0, 0}, {0, 0, -1} }, \
{ {-1, 0, 0}, { 0, -1, 0}, {0, 0, 1} }, \
{ {-1, 0, 0}, { 0, 0, -1}, {0, 1, 0} } \
}
#define SAGA_PMIC_GPIO_INT (27)
#define SAGA_GPIO_UP_INT_N (142)
#define SAGA_GPIO_PS_HOLD (29)
#define SAGA_MDDI_RSTz (162)
#define SAGA_LCD_ID0 (124)
#define SAGA_LCD_RSTz_ID1 (126)
#define SAGA_LCD_PCLK_1 (90)
#define SAGA_LCD_DE (91)
#define SAGA_LCD_VSYNC (92)
#define SAGA_LCD_HSYNC (93)
#define SAGA_LCD_G0 (94)
#define SAGA_LCD_G1 (95)
#define SAGA_LCD_G2 (96)
#define SAGA_LCD_G3 (97)
#define SAGA_LCD_G4 (98)
#define SAGA_LCD_G5 (99)
#define SAGA_LCD_B0 (22)
#define SAGA_LCD_B1 (100)
#define SAGA_LCD_B2 (101)
#define SAGA_LCD_B3 (102)
#define SAGA_LCD_B4 (103)
#define SAGA_LCD_B5 (104)
#define SAGA_LCD_R0 (25)
#define SAGA_LCD_R1 (105)
#define SAGA_LCD_R2 (106)
#define SAGA_LCD_R3 (107)
#define SAGA_LCD_R4 (108)
#define SAGA_LCD_R5 (109)
#define SAGA_LCD_SPI_CSz (87)
/* Audio */
#define SAGA_AUD_SPI_CSz (89)
#define SAGA_AUD_MICPATH_SEL_XA (121)
/* Flashlight */
#define SAGA_GPIO_FLASHLIGHT_FLASH 128
#define SAGA_GPIO_FLASHLIGHT_TORCH 129
/* BT */
#define SAGA_GPIO_BT_UART1_RTS (134)
#define SAGA_GPIO_BT_UART1_CTS (135)
#define SAGA_GPIO_BT_UART1_RX (136)
#define SAGA_GPIO_BT_UART1_TX (137)
#define SAGA_GPIO_BT_PCM_OUT (138)
#define SAGA_GPIO_BT_PCM_IN (139)
#define SAGA_GPIO_BT_PCM_SYNC (140)
#define SAGA_GPIO_BT_PCM_CLK (141)
#define SAGA_GPIO_BT_RESET_N (41)
#define SAGA_GPIO_BT_HOST_WAKE (26)
#define SAGA_GPIO_BT_CHIP_WAKE (50)
#define SAGA_GPIO_BT_SHUTDOWN_N (38)
#define SAGA_GPIO_USB_ID_PIN (145)
#define SAGA_VCM_PD (34)
#define SAGA_CAM1_PD (31)
#define SAGA_CLK_SEL (23) /* camera select pin */
#define SAGA_CAM2_PD (24)
#define SAGA_CAM2_RSTz (21)
#define SAGA_CODEC_3V_EN (36)
#define SAGA_GPIO_TP_ATT_N (20)
/* PMIC 8058 GPIO */
#define PMGPIO(x) (x-1)
#define SAGA_AUD_MICPATH_SEL_XB PMGPIO(10)
#define SAGA_AUD_EP_EN PMGPIO(13)
#define SAGA_VOL_UP PMGPIO(14)
#define SAGA_VOL_DN PMGPIO(15)
#define SAGA_GPIO_CHG_INT PMGPIO(16)
#define SAGA_AUD_HP_DETz PMGPIO(17)
#define SAGA_AUD_SPK_EN PMGPIO(18)
#define SAGA_AUD_HP_EN PMGPIO(19)
#define SAGA_PS_SHDN PMGPIO(20)
#define SAGA_TP_RSTz PMGPIO(21)
#define SAGA_LED_3V3_EN PMGPIO(22)
#define SAGA_SDMC_CD_N PMGPIO(23)
#define SAGA_GREEN_LED PMGPIO(24)
#define SAGA_AMBER_LED PMGPIO(25)
#define SAGA_AUD_A3254_RSTz PMGPIO(36)
#define SAGA_WIFI_SLOW_CLK PMGPIO(38)
#define SAGA_SLEEP_CLK2 PMGPIO(39)
unsigned int saga_get_engineerid(void);
int saga_init_mmc(unsigned int sys_rev);
void __init saga_audio_init(void);
int saga_init_keypad(void);
int __init saga_wifi_init(void);
int __init saga_init_panel(void);
int __init saga_rfkill_init(void);
#endif /* __ARCH_ARM_MACH_MSM_BOARD_SAGA_H */
|
/* { dg-do compile } */
/* APPLE LOCAL -fnested-functions */
/* { dg-options "-O2 -fno-inline -fnested-functions" } */
int f(int *a)
{
int __attribute__((nonnull(1))) g(int *b)
{
int **c = &a;
if (b)
return *a + **c;
return *b;
}
if (a)
return g(a);
return 1;
}
|
/* { dg-require-effective-target arm_v8_1m_mve_ok } */
/* { dg-add-options arm_v8_1m_mve } */
/* { dg-additional-options "-O2" } */
#include "arm_mve.h"
int16x8_t
foo (int16x8_t a, mve_pred16_t p)
{
return vnegq_x_s16 (a, p);
}
/* { dg-final { scan-assembler "vpst" } } */
/* { dg-final { scan-assembler "vnegt.s16" } } */
int16x8_t
foo1 (int16x8_t a, mve_pred16_t p)
{
return vnegq_x (a, p);
}
/* { dg-final { scan-assembler "vpst" } } */
|
/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" } } */
#include "test_sve_acle.h"
/*
** sri_1_u16_tied1:
** sri z0\.h, z1\.h, #1
** ret
*/
TEST_UNIFORM_Z (sri_1_u16_tied1, svuint16_t,
z0 = svsri_n_u16 (z0, z1, 1),
z0 = svsri (z0, z1, 1))
/* Bad RA choice: no preferred output sequence. */
TEST_UNIFORM_Z (sri_1_u16_tied2, svuint16_t,
z0 = svsri_n_u16 (z1, z0, 1),
z0 = svsri (z1, z0, 1))
/*
** sri_1_u16_untied:
** mov z0\.d, z1\.d
** sri z0\.h, z2\.h, #1
** ret
*/
TEST_UNIFORM_Z (sri_1_u16_untied, svuint16_t,
z0 = svsri_n_u16 (z1, z2, 1),
z0 = svsri (z1, z2, 1))
/*
** sri_2_u16_tied1:
** sri z0\.h, z1\.h, #2
** ret
*/
TEST_UNIFORM_Z (sri_2_u16_tied1, svuint16_t,
z0 = svsri_n_u16 (z0, z1, 2),
z0 = svsri (z0, z1, 2))
/* Bad RA choice: no preferred output sequence. */
TEST_UNIFORM_Z (sri_2_u16_tied2, svuint16_t,
z0 = svsri_n_u16 (z1, z0, 2),
z0 = svsri (z1, z0, 2))
/*
** sri_2_u16_untied:
** mov z0\.d, z1\.d
** sri z0\.h, z2\.h, #2
** ret
*/
TEST_UNIFORM_Z (sri_2_u16_untied, svuint16_t,
z0 = svsri_n_u16 (z1, z2, 2),
z0 = svsri (z1, z2, 2))
/*
** sri_16_u16_tied1:
** sri z0\.h, z1\.h, #16
** ret
*/
TEST_UNIFORM_Z (sri_16_u16_tied1, svuint16_t,
z0 = svsri_n_u16 (z0, z1, 16),
z0 = svsri (z0, z1, 16))
/* Bad RA choice: no preferred output sequence. */
TEST_UNIFORM_Z (sri_16_u16_tied2, svuint16_t,
z0 = svsri_n_u16 (z1, z0, 16),
z0 = svsri (z1, z0, 16))
/*
** sri_16_u16_untied:
** mov z0\.d, z1\.d
** sri z0\.h, z2\.h, #16
** ret
*/
TEST_UNIFORM_Z (sri_16_u16_untied, svuint16_t,
z0 = svsri_n_u16 (z1, z2, 16),
z0 = svsri (z1, z2, 16))
|
/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* LICENSE: See LICENSE in the top level directory
* FILE: sdk/game/CPickups.h
* PURPOSE: Pickup entity manager interface
*
* Multi Theft Auto is available from http://www.multitheftauto.com/
*
*****************************************************************************/
#ifndef __CGAME_PICKCUPS
#define __CGAME_PICKCUPS
#include "Common.h"
#include "CPickup.h"
#include <CVector.h>
#include <windows.h>
class CPickups
{
public:
virtual CPickup * CreatePickup(CVector * position, DWORD ModelIndex, ePickupType Type = PICKUP_ONCE, DWORD dwMonetaryValue = 0, DWORD dwMoneyPerDay = 0, BYTE bPingOutOfPlayer = 0)=0;
virtual void DisablePickupProcessing ( bool bDisabled )=0;
};
#endif |
/*
AngelCode Scripting Library
Copyright (c) 2003-2015 Andreas Jonsson
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
The original version of this library can be located at:
http://www.angelcode.com/angelscript/
Andreas Jonsson
andreas@angelcode.com
*/
//
// as_bytecode.h
//
// A class for constructing the final byte code
//
#ifndef AS_BYTECODE_H
#define AS_BYTECODE_H
#include "as_config.h"
#ifndef AS_NO_COMPILER
#include "as_array.h"
BEGIN_AS_NAMESPACE
#define BYTECODE_SIZE 4
#define MAX_DATA_SIZE 8
#define MAX_INSTR_SIZE (BYTECODE_SIZE+MAX_DATA_SIZE)
class asCScriptEngine;
class asCScriptFunction;
class asCByteInstruction;
class asCByteCode
{
public:
asCByteCode(asCScriptEngine *engine);
~asCByteCode();
void ClearAll();
int GetSize();
void Finalize(const asCArray<int> &tempVariableOffsets);
void Optimize();
void OptimizeLocally(const asCArray<int> &tempVariableOffsets);
void ExtractLineNumbers();
void ExtractObjectVariableInfo(asCScriptFunction *outFunc);
int ResolveJumpAddresses();
int FindLabel(int label, asCByteInstruction *from, asCByteInstruction **dest, int *positionDelta);
void AddPath(asCArray<asCByteInstruction *> &paths, asCByteInstruction *instr, int stackSize);
void Output(asDWORD *array);
void AddCode(asCByteCode *bc);
void PostProcess();
#ifdef AS_DEBUG
void DebugOutput(const char *name, asCScriptEngine *engine, asCScriptFunction *func);
#endif
int GetLastInstr();
int RemoveLastInstr();
asDWORD GetLastInstrValueDW();
void InsertIfNotExists(asCArray<int> &vars, int var);
void GetVarsUsed(asCArray<int> &vars);
bool IsVarUsed(int offset);
void ExchangeVar(int oldOffset, int newOffset);
bool IsSimpleExpression();
void Label(short label);
void Line(int line, int column, int scriptIdx);
void ObjInfo(int offset, int info);
void Block(bool start);
void VarDecl(int varDeclIdx);
void Call(asEBCInstr bc, int funcID, int pop);
void CallPtr(asEBCInstr bc, int funcPtrVar, int pop);
void Alloc(asEBCInstr bc, void *objID, int funcID, int pop);
void Ret(int pop);
void JmpP(int var, asDWORD max);
int InsertFirstInstrDWORD(asEBCInstr bc, asDWORD param);
int InsertFirstInstrQWORD(asEBCInstr bc, asQWORD param);
int Instr(asEBCInstr bc);
int InstrQWORD(asEBCInstr bc, asQWORD param);
int InstrDOUBLE(asEBCInstr bc, double param);
int InstrPTR(asEBCInstr bc, void *param);
int InstrDWORD(asEBCInstr bc, asDWORD param);
int InstrWORD(asEBCInstr bc, asWORD param);
int InstrSHORT(asEBCInstr bc, short param);
int InstrFLOAT(asEBCInstr bc, float param);
int InstrINT(asEBCInstr bc, int param);
int InstrW_W_W(asEBCInstr bc, int a, int b, int c);
int InstrSHORT_B(asEBCInstr bc, short a, asBYTE b);
int InstrSHORT_W(asEBCInstr bc, short a, asWORD b);
int InstrSHORT_DW(asEBCInstr bc, short a, asDWORD b);
int InstrSHORT_QW(asEBCInstr bc, short a, asQWORD b);
int InstrW_DW(asEBCInstr bc, asWORD a, asDWORD b);
int InstrW_QW(asEBCInstr bc, asWORD a, asQWORD b);
int InstrW_PTR(asEBCInstr bc, short a, void *param);
int InstrW_FLOAT(asEBCInstr bc, asWORD a, float b);
int InstrW_W(asEBCInstr bc, int w, int b);
int InstrSHORT_DW_DW(asEBCInstr bc, short a, asDWORD b, asDWORD c);
asCScriptEngine *GetEngine() const { return engine; };
asCArray<int> lineNumbers;
asCArray<int> sectionIdxs;
int largestStackUsed;
protected:
// Assignments are not allowed
void operator=(const asCByteCode &) {}
// Helpers for Optimize
bool CanBeSwapped(asCByteInstruction *curr);
asCByteInstruction *ChangeFirstDeleteNext(asCByteInstruction *curr, asEBCInstr bc);
asCByteInstruction *DeleteFirstChangeNext(asCByteInstruction *curr, asEBCInstr bc);
asCByteInstruction *DeleteInstruction(asCByteInstruction *instr);
void RemoveInstruction(asCByteInstruction *instr);
asCByteInstruction *GoBack(asCByteInstruction *curr);
asCByteInstruction *GoForward(asCByteInstruction *curr);
void InsertBefore(asCByteInstruction *before, asCByteInstruction *instr);
bool RemoveUnusedValue(asCByteInstruction *curr, asCByteInstruction **next);
bool IsTemporary(int offset);
bool IsTempRegUsed(asCByteInstruction *curr);
bool IsTempVarRead(asCByteInstruction *curr, int offset);
bool PostponeInitOfTemp(asCByteInstruction *curr, asCByteInstruction **next);
bool IsTempVarReadByInstr(asCByteInstruction *curr, int var);
bool IsTempVarOverwrittenByInstr(asCByteInstruction *curr, int var);
bool IsInstrJmpOrLabel(asCByteInstruction *curr);
int AddInstruction();
int AddInstructionFirst();
asCByteInstruction *first;
asCByteInstruction *last;
const asCArray<int> *temporaryVariables;
asCScriptEngine *engine;
};
class asCByteInstruction
{
public:
asCByteInstruction();
void AddAfter(asCByteInstruction *nextCode);
void AddBefore(asCByteInstruction *nextCode);
void Remove();
int GetSize();
int GetStackIncrease();
asCByteInstruction *next;
asCByteInstruction *prev;
asEBCInstr op;
asQWORD arg;
short wArg[3];
int size;
int stackInc;
// Testing
bool marked;
int stackSize;
};
END_AS_NAMESPACE
#endif // AS_NO_COMPILER
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.