commit
stringlengths 40
40
| old_file
stringlengths 4
112
| new_file
stringlengths 4
112
| old_contents
stringlengths 0
2.05k
| new_contents
stringlengths 28
3.9k
| subject
stringlengths 17
736
| message
stringlengths 18
4.78k
| lang
stringclasses 1
value | license
stringclasses 13
values | repos
stringlengths 7
111k
|
---|---|---|---|---|---|---|---|---|---|
30a6e87310245b6602c959b9e7b2280fb22caad6 | solutions/uri/1028/1028.c | solutions/uri/1028/1028.c | #include <stdint.h>
#include <stdio.h>
int gcd(int a, int b) {
int32_t x;
while (b > 0) {
x = b;
b = a % b;
a = x;
}
return a;
}
int main() {
int32_t n, a, b;
scanf("%d", &n);
while (n--) {
scanf("%d %d", &a, &b);
printf("%d\n", gcd(a, b));
}
return 0;
}
| Solve Collectable Cards in c | Solve Collectable Cards in c
| C | mit | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground |
|
77e2e9b890807560b3db5f1e277c7445cc5d74dd | lib/kernel/test/os_SUITE_data/my_echo.c | lib/kernel/test/os_SUITE_data/my_echo.c | #ifdef __WIN32__
#include <windows.h>
int wmain(int argc, wchar_t **argv)
{
char* sep = "";
int len;
/*
* Echo all arguments separated with '::', so that we can check that
* quotes are interpreted correctly.
*/
while (argc-- > 1) {
char *utf8;
len = WideCharToMultiByte(CP_UTF8, 0, argv[1], -1, NULL, 0, NULL, NULL);
utf8 = malloc(len*sizeof(char));
WideCharToMultiByte(CP_UTF8, 0, argv++[1], -1, utf8, len, NULL, NULL);
printf("%s%s", sep, utf8);
free(utf8);
sep = "::";
}
putchar('\n');
return 0;
}
#else
#include <stdio.h>
int
main(int argc, char** argv)
{
char* sep = "";
/*
* Echo all arguments separated with '::', so that we can check that
* quotes are interpreted correctly.
*/
while (argc-- > 1) {
printf("%s%s", sep, argv++[1]);
sep = "::";
}
putchar('\n');
return 0;
}
#endif
| #include <stdio.h>
#ifdef __WIN32__
#include <windows.h>
int wmain(int argc, wchar_t **argv)
{
char* sep = "";
int len;
/*
* Echo all arguments separated with '::', so that we can check that
* quotes are interpreted correctly.
*/
while (argc-- > 1) {
char *utf8;
len = WideCharToMultiByte(CP_UTF8, 0, argv[1], -1, NULL, 0, NULL, NULL);
utf8 = malloc(len*sizeof(char));
WideCharToMultiByte(CP_UTF8, 0, argv++[1], -1, utf8, len, NULL, NULL);
printf("%s%s", sep, utf8);
free(utf8);
sep = "::";
}
putchar('\n');
return 0;
}
#else
int
main(int argc, char** argv)
{
char* sep = "";
/*
* Echo all arguments separated with '::', so that we can check that
* quotes are interpreted correctly.
*/
while (argc-- > 1) {
printf("%s%s", sep, argv++[1]);
sep = "::";
}
putchar('\n');
return 0;
}
#endif
| Fix os_SUITE compilation issue on win32 | kernel: Fix os_SUITE compilation issue on win32
| C | apache-2.0 | rlipscombe/otp,bjorng/otp,dgud/otp,isvilen/otp,emacsmirror/erlang,bjorng/otp,g-andrade/otp,getong/otp,dgud/otp,isvilen/otp,potatosalad/otp,vinoski/otp,g-andrade/otp,jj1bdx/otp,emacsmirror/erlang,mikpe/otp,erlang/otp,lrascao/otp,erlang/otp,potatosalad/otp,getong/otp,rlipscombe/otp,emacsmirror/erlang,vinoski/otp,uabboli/otp,erlang/otp,rlipscombe/otp,mikpe/otp,ferd/otp,getong/otp,dumbbell/otp,vinoski/otp,dgud/otp,bjorng/otp,getong/otp,isvilen/otp,ferd/otp,potatosalad/otp,lrascao/otp,lrascao/otp,uabboli/otp,potatosalad/otp,potatosalad/otp,isvilen/otp,jj1bdx/otp,ferd/otp,mikpe/otp,dumbbell/otp,erlang/otp,rlipscombe/otp,jj1bdx/otp,ferd/otp,dumbbell/otp,mikpe/otp,g-andrade/otp,lrascao/otp,uabboli/otp,isvilen/otp,uabboli/otp,getong/otp,rlipscombe/otp,lrascao/otp,lrascao/otp,isvilen/otp,dgud/otp,potatosalad/otp,emacsmirror/erlang,dgud/otp,rlipscombe/otp,vinoski/otp,potatosalad/otp,lrascao/otp,getong/otp,bjorng/otp,dumbbell/otp,vinoski/otp,dgud/otp,dumbbell/otp,bjorng/otp,erlang/otp,mikpe/otp,g-andrade/otp,emacsmirror/erlang,rlipscombe/otp,isvilen/otp,mikpe/otp,g-andrade/otp,potatosalad/otp,dgud/otp,rlipscombe/otp,isvilen/otp,vinoski/otp,mikpe/otp,dgud/otp,uabboli/otp,vinoski/otp,vinoski/otp,jj1bdx/otp,g-andrade/otp,g-andrade/otp,uabboli/otp,dumbbell/otp,emacsmirror/erlang,bjorng/otp,ferd/otp,emacsmirror/erlang,uabboli/otp,dgud/otp,ferd/otp,mikpe/otp,uabboli/otp,g-andrade/otp,mikpe/otp,bjorng/otp,dumbbell/otp,dumbbell/otp,vinoski/otp,jj1bdx/otp,rlipscombe/otp,bjorng/otp,lrascao/otp,jj1bdx/otp,jj1bdx/otp,g-andrade/otp,emacsmirror/erlang,isvilen/otp,getong/otp,isvilen/otp,lrascao/otp,dumbbell/otp,erlang/otp,erlang/otp,bjorng/otp,jj1bdx/otp,ferd/otp,uabboli/otp,emacsmirror/erlang,jj1bdx/otp,getong/otp,potatosalad/otp,erlang/otp,potatosalad/otp,erlang/otp,mikpe/otp,vinoski/otp,getong/otp,bjorng/otp,ferd/otp,dgud/otp,erlang/otp,emacsmirror/erlang,g-andrade/otp,rlipscombe/otp,getong/otp,ferd/otp,dumbbell/otp,jj1bdx/otp |
48a000c2d136e1571a0732006b2bec2538a117a2 | SSPSolution/SSPSolution/ComponentHandler.h | SSPSolution/SSPSolution/ComponentHandler.h | #ifndef SSPAPPLICATION_COMPONENTHANDLER_H
#define SSPAPPLICATION_COMPONENTHANDLER_H
#include "../GraphicsDLL/GraphicsHandler.h"
//#include "ComponentStructs.h"
#include "../GraphicsDLL/GraphicsHandler.h"
#include "../physicsDLL/PhysicsHandler.h"
#include "../AIDLL/AIHandler.h"
class ComponentHandler
{
private:
GraphicsHandler* m_graphicsHandler;
PhysicsHandler* m_physicsHandler;
AIHandler* m_aiHandler;
public:
ComponentHandler();
~ComponentHandler();
//Returns 0 if the graphicsHandler or physicshandler is a nullptr
int Initialize(GraphicsHandler* graphicsHandler, PhysicsHandler* physicsHandler, AIHandler* aiHandler);
GraphicsComponent* GetGraphicsComponent();
PhysicsComponent* GetPhysicsComponent();
void UpdateGraphicsComponents();
void SetGraphicsComponentListSize(int gCompSize);
//temporary function
PhysicsHandler* GetPhysicsHandler() const;
};
#endif | #ifndef SSPAPPLICATION_COMPONENTHANDLER_H
#define SSPAPPLICATION_COMPONENTHANDLER_H
//#include "ComponentStructs.h"
#include "../GraphicsDLL/GraphicsHandler.h"
#include "../physicsDLL/PhysicsHandler.h"
#include "../AIDLL/AIHandler.h"
class ComponentHandler
{
private:
GraphicsHandler* m_graphicsHandler;
PhysicsHandler* m_physicsHandler;
AIHandler* m_aiHandler;
public:
ComponentHandler();
~ComponentHandler();
//Returns 0 if the graphicsHandler or physicshandler is a nullptr
int Initialize(GraphicsHandler* graphicsHandler, PhysicsHandler* physicsHandler, AIHandler* aiHandler);
GraphicsComponent* GetGraphicsComponent();
PhysicsComponent* GetPhysicsComponent();
void UpdateGraphicsComponents();
void SetGraphicsComponentListSize(int gCompSize);
//temporary function
PhysicsHandler* GetPhysicsHandler() const;
};
#endif | FIX duplicate includes of GraphicsHandler | FIX duplicate includes of GraphicsHandler
| C | apache-2.0 | Chringo/SSP,Chringo/SSP |
ef460ae7e5836154d5e8e811af87491126de5487 | src/host/string_hash.c | src/host/string_hash.c | /**
* \file string_hash.c
* \brief Computes a hash value for a string.
* \author Copyright (c) 2012-2014 Jason Perkins and the Premake project
*/
#include "premake.h"
#include <string.h>
int string_hash(lua_State* L)
{
const char* str = luaL_checkstring(L, 1);
unsigned long seed = luaL_optint(L, 2, 0);
lua_pushnumber(L, do_hash(str, seed));
return 1;
}
unsigned long do_hash(const char* str, int seed)
{
/* DJB2 hashing; see http://www.cse.yorku.ca/~oz/hash.html */
unsigned long hash = 5381;
if (seed != 0) {
hash = hash * 33 + seed;
}
while (*str) {
hash = hash * 33 + (*str);
str++;
}
return hash;
}
| /**
* \file string_hash.c
* \brief Computes a hash value for a string.
* \author Copyright (c) 2012-2014 Jason Perkins and the Premake project
*/
#include "premake.h"
#include <string.h>
int string_hash(lua_State* L)
{
const char* str = luaL_checkstring(L, 1);
unsigned long seed = luaL_optint(L, 2, 0);
lua_pushnumber(L, (lua_Number)do_hash(str, seed));
return 1;
}
unsigned long do_hash(const char* str, int seed)
{
/* DJB2 hashing; see http://www.cse.yorku.ca/~oz/hash.html */
unsigned long hash = 5381;
if (seed != 0) {
hash = hash * 33 + seed;
}
while (*str) {
hash = hash * 33 + (*str);
str++;
}
return hash;
}
| Fix implicit conversion warning when building with floating point Lua | Fix implicit conversion warning when building with floating point Lua
| C | bsd-3-clause | bravnsgaard/premake-core,noresources/premake-core,starkos/premake-core,noresources/premake-core,premake/premake-core,tvandijck/premake-core,Yhgenomics/premake-core,felipeprov/premake-core,jstewart-amd/premake-core,Meoo/premake-core,TurkeyMan/premake-core,martin-traverse/premake-core,jstewart-amd/premake-core,jstewart-amd/premake-core,noresources/premake-core,grbd/premake-core,felipeprov/premake-core,dcourtois/premake-core,Zefiros-Software/premake-core,TurkeyMan/premake-core,CodeAnxiety/premake-core,jsfdez/premake-core,kankaristo/premake-core,mandersan/premake-core,PlexChat/premake-core,xriss/premake-core,aleksijuvani/premake-core,sleepingwit/premake-core,Zefiros-Software/premake-core,prapin/premake-core,noresources/premake-core,dcourtois/premake-core,mendsley/premake-core,kankaristo/premake-core,xriss/premake-core,lizh06/premake-core,Blizzard/premake-core,starkos/premake-core,Blizzard/premake-core,saberhawk/premake-core,resetnow/premake-core,felipeprov/premake-core,premake/premake-core,noresources/premake-core,LORgames/premake-core,soundsrc/premake-core,felipeprov/premake-core,martin-traverse/premake-core,Meoo/premake-core,jstewart-amd/premake-core,martin-traverse/premake-core,Blizzard/premake-core,dcourtois/premake-core,martin-traverse/premake-core,lizh06/premake-core,Yhgenomics/premake-core,TurkeyMan/premake-core,PlexChat/premake-core,aleksijuvani/premake-core,Tiger66639/premake-core,starkos/premake-core,tritao/premake-core,resetnow/premake-core,premake/premake-core,alarouche/premake-core,jstewart-amd/premake-core,Meoo/premake-core,tritao/premake-core,LORgames/premake-core,xriss/premake-core,tvandijck/premake-core,alarouche/premake-core,akaStiX/premake-core,tritao/premake-core,soundsrc/premake-core,Tiger66639/premake-core,sleepingwit/premake-core,saberhawk/premake-core,akaStiX/premake-core,alarouche/premake-core,aleksijuvani/premake-core,grbd/premake-core,starkos/premake-core,LORgames/premake-core,LORgames/premake-core,sleepingwit/premake-core,mendsley/premake-core,xriss/premake-core,premake/premake-core,aleksijuvani/premake-core,lizh06/premake-core,akaStiX/premake-core,resetnow/premake-core,lizh06/premake-core,Tiger66639/premake-core,tritao/premake-core,CodeAnxiety/premake-core,mendsley/premake-core,bravnsgaard/premake-core,CodeAnxiety/premake-core,kankaristo/premake-core,tvandijck/premake-core,Blizzard/premake-core,dcourtois/premake-core,mandersan/premake-core,Yhgenomics/premake-core,PlexChat/premake-core,prapin/premake-core,CodeAnxiety/premake-core,bravnsgaard/premake-core,grbd/premake-core,noresources/premake-core,prapin/premake-core,LORgames/premake-core,premake/premake-core,tvandijck/premake-core,mandersan/premake-core,premake/premake-core,CodeAnxiety/premake-core,saberhawk/premake-core,jsfdez/premake-core,Zefiros-Software/premake-core,akaStiX/premake-core,noresources/premake-core,saberhawk/premake-core,dcourtois/premake-core,soundsrc/premake-core,soundsrc/premake-core,starkos/premake-core,Blizzard/premake-core,dcourtois/premake-core,aleksijuvani/premake-core,grbd/premake-core,soundsrc/premake-core,tvandijck/premake-core,PlexChat/premake-core,resetnow/premake-core,Blizzard/premake-core,TurkeyMan/premake-core,Meoo/premake-core,premake/premake-core,prapin/premake-core,alarouche/premake-core,Zefiros-Software/premake-core,TurkeyMan/premake-core,xriss/premake-core,mandersan/premake-core,starkos/premake-core,starkos/premake-core,sleepingwit/premake-core,bravnsgaard/premake-core,dcourtois/premake-core,resetnow/premake-core,Zefiros-Software/premake-core,bravnsgaard/premake-core,kankaristo/premake-core,sleepingwit/premake-core,mendsley/premake-core,mandersan/premake-core,jsfdez/premake-core,Tiger66639/premake-core,jsfdez/premake-core,Yhgenomics/premake-core,mendsley/premake-core |
beba7f47d873abe0a532753556511d0dabbb41fa | test/Sema/PR3675.c | test/Sema/PR3675.c | // RUN: clang -verify %s
//
// This example was reduced from actual code in Wine 1.1.13. GCC accepts this
// code, while the correct behavior is to reject it.
//
typedef struct _IRP {
union {
struct {
union {} u; // expected-note{{previous declaration is here}}
struct {
union {} u; // expected-error{{error: member of anonymous struct redeclares 'u'}}
};
} Overlay;
} Tail;
} IRP;
| Add test case for PR 3675. | Add test case for PR 3675.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@65635 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
|
972adb833389607a84e879e2df565e37451d4c60 | test/CodeGen/arm_asm_clobber.c | test/CodeGen/arm_asm_clobber.c | // RUN: clang -ccc-host-triple armv6-unknown-unknown -emit-llvm -S -o %t %s
void test0(void) {
asm volatile("mov r0, r0" :: );
}
void test1(void) {
asm volatile("mov r0, r0" :::
"cc", "memory" );
}
void test2(void) {
asm volatile("mov r0, r0" :::
"r0", "r1", "r2", "r3");
asm volatile("mov r0, r0" :::
"r4", "r5", "r6", "r8");
}
void test3(void) {
asm volatile("mov r0, r0" :::
"a1", "a2", "a3", "a4");
asm volatile("mov r0, r0" :::
"v1", "v2", "v3", "v5");
}
| // RUN: clang-cc -triple armv6-unknown-unknown -emit-llvm -o %t %s
void test0(void) {
asm volatile("mov r0, r0" :: );
}
void test1(void) {
asm volatile("mov r0, r0" :::
"cc", "memory" );
}
void test2(void) {
asm volatile("mov r0, r0" :::
"r0", "r1", "r2", "r3");
asm volatile("mov r0, r0" :::
"r4", "r5", "r6", "r8");
}
void test3(void) {
asm volatile("mov r0, r0" :::
"a1", "a2", "a3", "a4");
asm volatile("mov r0, r0" :::
"v1", "v2", "v3", "v5");
}
| Use clang-cc in this test. | Use clang-cc in this test.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@90872 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
d9e9a0a7122b881fd97b190ed615daf572731a2b | test/CodeGen/pragma-pack-1.c | test/CodeGen/pragma-pack-1.c | // RUN: %clang_cc1 -emit-llvm -o - %s
// PR4610
#pragma pack(4)
struct ref {
struct ref *next;
} refs;
| // RUN: %clang_cc1 -triple x86_64-apple-macosx10.7.0 -emit-llvm -o - %s | FileCheck %s
// PR4610
#pragma pack(4)
struct ref {
struct ref *next;
} refs;
// PR13580
struct S
{
char a[3];
#pragma pack(1)
struct T
{
char b;
int c;
} d;
#pragma pack()
struct T2
{
char b;
int c;
} d2;
} ss;
// CHECK: [[struct_ref:%[a-zA-Z0-9_.]+]] = type <{ [[struct_ref]]* }>
// CHECK: [[struct_S:%[a-zA-Z0-9_.]+]] = type { [3 x i8], [[struct_T:%[a-zA-Z0-9_.]+]], [[struct_T2:%[a-zA-Z0-9_.]+]] }
// CHECK: [[struct_T]] = type <{ i8, i32 }>
// CHECK: [[struct_T2]] = type { i8, i32 }
// CHECK: @refs = common global [[struct_ref]]
// CHECK: @ss = common global [[struct_S]]
| Add IRGen test case for r179743. | Add IRGen test case for r179743.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@179777 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang |
e695b928e43435d62ac2e4bc3133cbe6eae44bbe | include/api/ofp_odp_compat.h | include/api/ofp_odp_compat.h | /* Copyright (c) 2015, ENEA Software AB
* Copyright (c) 2015, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#if ODP_VERSION < 105
typedef uint64_t odp_time_t;
#endif /* ODP_VERSION < 105 */
#if ODP_VERSION < 104 && ODP_VERSION > 101
#define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_def_worker(cpumask, num_workers)
#elif ODP_VERSION < 102
#define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_count(cpumask)
#endif
| /* Copyright (c) 2015, ENEA Software AB
* Copyright (c) 2015, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#if ODP_VERSION < 105
typedef uint64_t odp_time_t;
#endif /* ODP_VERSION < 105 */
#if ODP_VERSION < 104 && ODP_VERSION > 101
#define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_def_worker(cpumask, num_workers)
#elif ODP_VERSION < 102
#define odp_cpumask_default_worker(cpumask, num_workers) odp_cpumask_count(cpumask)
#define ODP_THREAD_WORKER
#define ODP_THREAD_CONTROL
#endif
| Define ODP_THREAD_WORKER and ODP_THREAD_CONTROL for odp versions < 102. | Define ODP_THREAD_WORKER and ODP_THREAD_CONTROL for odp versions < 102.
Signed-off-by: José Pekkarinen <[email protected]>
Reviewed-and-tested-by: Sorin Vultureanu <[email protected]>
| C | bsd-3-clause | TolikH/ofp,OpenFastPath/ofp,TolikH/ofp,TolikH/ofp,OpenFastPath/ofp,OpenFastPath/ofp,OpenFastPath/ofp |
d37719c942a0eaa9b50d3b6e8e2fa4e8a852eecc | nwn2mdk-lib/cgmath.h | nwn2mdk-lib/cgmath.h | #pragma once
template <typename T>
class Vector3 {
public:
T x, y, z;
Vector3(T x, T y, T z)
{
this->x = x;
this->y = y;
this->z = z;
}
Vector3() : Vector3(0, 0, 0)
{
}
T &operator[](unsigned i)
{
return (&x)[i];
}
};
static_assert(sizeof(Vector3<float>) == 12);
template <typename T>
class Vector4 {
public:
T x, y, z, w;
Vector4() {}
Vector4(T x, T y, T z, T w)
{
this->x = x;
this->y = y;
this->z = z;
this->w = w;
}
T &operator[](unsigned i)
{
return (&x)[i];
}
};
| #pragma once
template <typename T>
class Vector3 {
public:
T x, y, z;
Vector3(T x, T y, T z)
{
this->x = x;
this->y = y;
this->z = z;
}
Vector3() : Vector3(0, 0, 0)
{
}
T &operator[](unsigned i)
{
return (&x)[i];
}
bool operator==(const Vector3 &v) const
{
return x == v.x && y == v.y && z == v.z;
}
};
static_assert(sizeof(Vector3<float>) == 12);
template <typename T>
class Vector4 {
public:
T x, y, z, w;
Vector4() {}
Vector4(T x, T y, T z, T w)
{
this->x = x;
this->y = y;
this->z = z;
this->w = w;
}
T &operator[](unsigned i)
{
return (&x)[i];
}
};
| Add "equal to" operator to Vector3 | Add "equal to" operator to Vector3
| C | apache-2.0 | Arbos/nwn2mdk,Arbos/nwn2mdk,Arbos/nwn2mdk |
7ba252b469a2ebe78210b2791241f4709aef9cd4 | misc/threadinfo/parasite.c | misc/threadinfo/parasite.c | #define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include <sched.h>
#include <stdlib.h>
#define CHILD_STACK_SIZE 16384
int variable;
int do_something() {
printf("Running...\n");
variable = 1337;
_exit(0);
}
int main(int argc, char *argv[]) {
char *child_stack;
char *child_stack_top;
child_stack = malloc(CHILD_STACK_SIZE);
child_stack_top = child_stack + CHILD_STACK_SIZE;
variable = 42;
printf("The variable was %d\n", variable);
clone(do_something, child_stack_top, CLONE_THREAD, NULL);
sleep(10);
printf("The variable is now %d\n", variable);
return 0;
}
| Add test of clone syscall with CLONE_THREAD | Add test of clone syscall with CLONE_THREAD
| C | mit | WesleyAC/toybox,WesleyAC/toybox,WesleyAC/toybox,WesleyAC/toybox,WesleyAC/toybox |
|
4aa666a35dc30b7b912ece51249e011a46feddd9 | MicroReasoner/SMRPreprocessor.h | MicroReasoner/SMRPreprocessor.h | //
// SMRPreprocessor.h
// MicroReasoner
//
// Created by Ivano Bilenchi on 05/05/16.
// Copyright © 2016 SisInf Lab. All rights reserved.
//
#ifndef SMRPreprocessor_h
#define SMRPreprocessor_h
// Pseudo-abstract class convenience macros.
#define ABSTRACT_METHOD {\
@throw [NSException exceptionWithName:NSInternalInconsistencyException \
reason:@"This method should be overridden in a subclass." \
userInfo:nil]; \
}
#endif /* SMRPreprocessor_h */
| //
// SMRPreprocessor.h
// MicroReasoner
//
// Created by Ivano Bilenchi on 05/05/16.
// Copyright © 2016 SisInf Lab. All rights reserved.
//
#ifndef SMRPreprocessor_h
#define SMRPreprocessor_h
/**
* Use this directive to mark method implementations that should be overridden
* by concrete subclasses.
*/
#define ABSTRACT_METHOD {\
@throw [NSException exceptionWithName:NSInternalInconsistencyException \
reason:@"This method should be overridden in a subclass." \
userInfo:nil]; \
}
/**
* Use this directive in place of @synthesize to automatically create a
* lazy getter for the specified property. Example syntax:
*
* SYNTHESIZE_LAZY(NSMutableString, myMutableString) {
* return [NSMutableString stringWithString:@"my mutable string"];
* }
*
* @param type The type of the property.
* @param name The name of the property.
*/
#define SYNTHESIZE_LAZY(type, name) \
@synthesize name = _##name; \
- (type *)name { \
if (_##name == nil) { _##name = [self __##name##LazyInit]; } \
return _##name; \
} \
- (type *)__##name##LazyInit
/**
* Use this directive in place of @synthesize to automatically create a
* lazy getter for the specified property. The getter calls the default
* 'init' constructor.
*
* @param type The type of the property.
* @param name The name of the property.
*/
#define SYNTHESIZE_LAZY_INIT(type, name) \
@synthesize name = _##name; \
- (type *)name { \
if (_##name == nil) { _##name = [[type alloc] init]; } \
return _##name; \
}
#endif /* SMRPreprocessor_h */
| Add lazy property synthesis directives | Add lazy property synthesis directives
| C | epl-1.0 | sisinflab-swot/OWL-API-for-iOS,sisinflab-swot/OWL-API-for-iOS,sisinflab-swot/OWL-API-for-iOS |
273ed9870aa064992fb3c25a1f4d8973b10ad36e | test/Analysis/redefined_system.c | test/Analysis/redefined_system.c | // RUN: %clang_cc1 -analyze -analyzer-checker=unix,core,experimental.security.taint -w -verify %s
// Make sure we don't crash when someone redefines a system function we reason about.
char memmove ();
char malloc();
char system();
char stdin();
char memccpy();
char free();
char strdup();
char atoi();
int foo () {
return memmove() + malloc() + system + stdin() + memccpy() + free() + strdup() + atoi();
}
| Test case for r154451 (redefining system functions). | [analyzer] Test case for r154451 (redefining system functions).
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@154624 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
|
36db197d9cc6af1062902a1678caa6825eaa2e9f | Settings/Tabs/Tab.h | Settings/Tabs/Tab.h | #pragma once
#include <Windows.h>
#include <unordered_map>
#include "../Controls/Control.h"
#include "../Controls/Controls.h"
class UIContext;
#define INIT_CONTROL(ctrlId, ctrlType, var) { \
var = ctrlType(ctrlId, _hWnd); \
_controlMap[ctrlId] = &var; \
}
/// <summary>
/// Abstract class that encapsulates functionality for dealing with
/// property sheet pages (tabs).
/// </summary>
class Tab {
public:
Tab();
~Tab();
/// <summary>Processes messages sent to the tab page.</summary>
virtual DLGPROC TabProc(
HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
/// <summary>Persists changes made on the tab page</summary>
virtual void SaveSettings() = 0;
protected:
/// <summary>Window handle of this tab.</summary>
HWND _hWnd;
/// <summary>Maps control IDs to their respective instances.</summary>
std::unordered_map<int, Control *> _controlMap;
/// <summary>
/// Performs intitialization for the tab page, similar to a constructor.
/// Since tab page windows are created on demand, this method could be
/// called much later than the constructor for the tab.
/// </summary>
virtual void Initialize() = 0;
/// <summary>Applies the current settings state to the tab page.</summary>
virtual void LoadSettings() = 0;
}; | #pragma once
#include <Windows.h>
#include <unordered_map>
#include "../Controls/Control.h"
#include "../Controls/Controls.h"
#define INIT_CONTROL(ctrlId, ctrlType, var) { \
var = ctrlType(ctrlId, _hWnd); \
_controlMap[ctrlId] = &var; \
}
/// <summary>
/// Abstract class that encapsulates functionality for dealing with
/// property sheet pages (tabs).
/// </summary>
class Tab {
public:
Tab();
~Tab();
/// <summary>Processes messages sent to the tab page.</summary>
virtual DLGPROC TabProc(
HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
/// <summary>Persists changes made on the tab page</summary>
virtual void SaveSettings() = 0;
protected:
/// <summary>Window handle of this tab.</summary>
HWND _hWnd;
/// <summary>Maps control IDs to their respective instances.</summary>
std::unordered_map<int, Control *> _controlMap;
/// <summary>
/// Performs intitialization for the tab page, similar to a constructor.
/// Since tab page windows are created on demand, this method could be
/// called much later than the constructor for the tab.
/// </summary>
virtual void Initialize() = 0;
/// <summary>Applies the current settings state to the tab page.</summary>
virtual void LoadSettings() = 0;
}; | Remove old UIContext class declaration | Remove old UIContext class declaration
| C | bsd-2-clause | malensek/3RVX,malensek/3RVX,malensek/3RVX |
6dd934fccccc45354cdae8feb50f89e4f8abac8f | include/jwtxx/ios.h | include/jwtxx/ios.h | #pragma once
#include "jwt.h"
#include <ostream>
namespace JWTXX
{
std::ostream& operator<<(std::ostream& stream, const Algorithm& alg)
{
stream << algToString(alg);
return stream;
}
}
| Add separate header for stream operators. | Add separate header for stream operators.
| C | mit | RealImage/jwtxx,RealImage/jwtxx,madf/jwtxx,madf/jwtxx |
|
323c8ec8b6a8c6795ebe02d4d7d470567bf93981 | objc/message.h | objc/message.h | #ifndef _OBJC_MESSAGE_H_
#define _OBJC_MESSAGE_H_
#if defined(__x86_64) || defined(__i386) || defined(__arm__) || \
defined(__mips_n64) || defined(__mips_n32)
/**
* Standard message sending function. This function must be cast to the
* correct types for the function before use. The first argument is the
* receiver and the second the selector.
*
* Note that this function is not available on all architectures. For a more
* portable solution to sending arbitrary messages, consider using
* objc_msg_lookup_sender() and then calling the returned IMP directly.
*
* This version of the function is used for all messages that return either an
* integer, a pointer, or a small structure value that is returned in
* registers. Be aware that calling conventions differ between operating
* systems even within the same architecture, so take great care if using this
* function for small (two integer) structures.
*/
id objc_msgSend(id self, SEL _cmd, ...);
/**
* Standard message sending function. This function must be cast to the
* correct types for the function before use. The first argument is the
* receiver and the second the selector.
*
* Note that this function is not available on all architectures. For a more
* portable solution to sending arbitrary messages, consider using
* objc_msg_lookup_sender() and then calling the returned IMP directly.
*
* This version of the function is used for all messages that return a
* structure that is not returned in registers. Be aware that calling
* conventions differ between operating systems even within the same
* architecture, so take great care if using this function for small (two
* integer) structures.
*/
#ifdef __cplusplus
id objc_msgSend_stret(id self, SEL _cmd, ...);
#else
void objc_msgSend_stret(id self, SEL _cmd, ...);
#endif
/**
* Standard message sending function. This function must be cast to the
* correct types for the function before use. The first argument is the
* receiver and the second the selector.
*
* Note that this function is not available on all architectures. For a more
* portable solution to sending arbitrary messages, consider using
* objc_msg_lookup_sender() and then calling the returned IMP directly.
*
* This version of the function is used for all messages that return floating
* point values.
*/
long double objc_msgSend_fpret(id self, SEL _cmd, ...);
#endif
#endif //_OBJC_MESSAGE_H_
| Fix clang's stupid warning to work around a bug in OS X headers... | Fix clang's stupid warning to work around a bug in OS X headers...
git-svn-id: a68838e7bd575144b7122a20f5a950e65beaf589@35962 72102866-910b-0410-8b05-ffd578937521
| C | mit | itumashyk/ndk-objc-gs-libobjc2,itumashyk/ndk-objc-gs-libobjc2 |
|
37e51a20cc9f3ff9afebdabdcd3a82b9a08d3302 | sway/commands/create_output.c | sway/commands/create_output.c | #include <wlr/backend/multi.h>
#include <wlr/backend/wayland.h>
#include <wlr/backend/x11.h>
#include "sway/commands.h"
#include "sway/server.h"
#include "log.h"
static void create_output(struct wlr_backend *backend, void *data) {
bool *done = data;
if (*done) {
return;
}
if (wlr_backend_is_wl(backend)) {
wlr_wl_output_create(backend);
*done = true;
} else if (wlr_backend_is_x11(backend)) {
wlr_x11_output_create(backend);
*done = true;
}
}
/**
* This command is intended for developer use only.
*/
struct cmd_results *cmd_create_output(int argc, char **argv) {
sway_assert(wlr_backend_is_multi(server.backend),
"Expected a multi backend");
bool done = false;
wlr_multi_for_each_backend(server.backend, create_output, &done);
if (!done) {
return cmd_results_new(CMD_INVALID, "create_output",
"Can only create outputs for Wayland or X11 backends");
}
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
| #include <wlr/config.h>
#include <wlr/backend/multi.h>
#include <wlr/backend/wayland.h>
#ifdef WLR_HAS_X11_BACKEND
#include <wlr/backend/x11.h>
#endif
#include "sway/commands.h"
#include "sway/server.h"
#include "log.h"
static void create_output(struct wlr_backend *backend, void *data) {
bool *done = data;
if (*done) {
return;
}
if (wlr_backend_is_wl(backend)) {
wlr_wl_output_create(backend);
*done = true;
}
#ifdef WLR_HAS_X11_BACKEND
else if (wlr_backend_is_x11(backend)) {
wlr_x11_output_create(backend);
*done = true;
}
#endif
}
/**
* This command is intended for developer use only.
*/
struct cmd_results *cmd_create_output(int argc, char **argv) {
sway_assert(wlr_backend_is_multi(server.backend),
"Expected a multi backend");
bool done = false;
wlr_multi_for_each_backend(server.backend, create_output, &done);
if (!done) {
return cmd_results_new(CMD_INVALID, "create_output",
"Can only create outputs for Wayland or X11 backends");
}
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
| Fix compilation against wlroots without X11 backend | Fix compilation against wlroots without X11 backend
| C | mit | ascent12/sway,1ace/sway,SirCmpwn/sway,ascent12/sway,1ace/sway,ascent12/sway,1ace/sway |
003bca2cb254ad4712d4aad3bcf14ed62b48be19 | RobotC/Headers/Helper.h | RobotC/Headers/Helper.h | #ifndef HELPER_H
#define HELPER_H
/*Helper function for calculating ABSOLUTE maximum of two floats
Will return maximum absolute value (ignores sign) */
float helpFindMaxAbsFloat(float a, float b) {
float aAbs = abs(a);
float bAbs = abs(b);
if (aAbs > bAbs) {
return aAbs;
} else {
return bAbs;
}
}
//Helper function for calculating ABSOLUTE minimum of two floats
//Will return minimum absolute value (ignores sign)
float helpFindMinAbsFloat(float a, float b) {
float aAbs = abs(a);
float bAbs = abs(b);
if (aAbs < bAbs) {
return aAbs;
} else {
return bAbs;
}
}
//Helper function for calculating contraints of a float
float constrain(float x, float lowerBound, float upperBound){
if(x<lowerBound){
return lowerBound;
}else if(x>upperBound){
return upperBound;
}else{
return x;
}
}
#endif
| #ifndef HELPER_H
#define HELPER_H
#pragma systemFile
/*Helper function for calculating ABSOLUTE maximum of two floats
Will return maximum absolute value (ignores sign) */
float helpFindMaxAbsFloat(float a, float b) {
float aAbs = abs(a);
float bAbs = abs(b);
if (aAbs > bAbs) {
return aAbs;
} else {
return bAbs;
}
}
//Helper function for calculating ABSOLUTE minimum of two floats
//Will return minimum absolute value (ignores sign)
float helpFindMinAbsFloat(float a, float b) {
float aAbs = abs(a);
float bAbs = abs(b);
if (aAbs < bAbs) {
return aAbs;
} else {
return bAbs;
}
}
//Helper function for calculating contraints of a float
float constrain(float x, float lowerBound, float upperBound){
if(x<lowerBound){
return lowerBound;
}else if(x>upperBound){
return upperBound;
}else{
return x;
}
}
#endif
| Add systemFile declaration to helper library | Add systemFile declaration to helper library
| C | mit | RMRobotics/FTC_5421_2014-2015,RMRobotics/FTC_5421_2014-2015 |
4220192f474cce95ed3a83f7dd79692fb5ca1432 | MdeModulePkg/Library/ExtendedIfrSupportLib/LibraryInternal.h | MdeModulePkg/Library/ExtendedIfrSupportLib/LibraryInternal.h | /** @file
The file contain all library function for Ifr Operations.
Copyright (c) 2007 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _IFRLIBRARY_INTERNAL_H_
#define _IFRLIBRARY_INTERNAL_H_
#include <Uefi.h>
#include <Guid/GlobalVariable.h>
#include <Protocol/DevicePath.h>
#include <Protocol/HiiDatabase.h>
#include <Protocol/HiiString.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/BaseLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/IfrSupportLib.h>
#include <Library/PcdLib.h>
#include <MdeModuleHii.h>
extern EFI_GUID mIfrVendorGuid;
#endif
| /** @file
The file contain all library function for Ifr Operations.
Copyright (c) 2007 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _IFRLIBRARY_INTERNAL_H_
#define _IFRLIBRARY_INTERNAL_H_
#include <Uefi.h>
#include <Protocol/DevicePath.h>
#include <Protocol/HiiDatabase.h>
#include <Protocol/HiiString.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/BaseLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/IfrSupportLib.h>
#include <Library/PcdLib.h>
#include <MdeModuleHii.h>
extern EFI_GUID mIfrVendorGuid;
#endif
| Remove over specific header file. | Remove over specific header file.
git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@6393 6f19259b-4bc3-4df7-8a09-765794883524
| C | bsd-2-clause | MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2 |
0397724420b14c35c7cd88dc6580bf780c2509e4 | rts/c/tuning.h | rts/c/tuning.h | // Start of tuning.h.
static char* load_tuning_file(const char *fname,
void *cfg,
int (*set_size)(void*, const char*, size_t)) {
const int max_line_len = 1024;
char* line = (char*) malloc(max_line_len);
FILE *f = fopen(fname, "r");
if (f == NULL) {
snprintf(line, max_line_len, "Cannot open file: %s", strerror(errno));
return line;
}
int lineno = 0;
while (fgets(line, max_line_len, f) != NULL) {
lineno++;
char *eql = strstr(line, "=");
if (eql) {
*eql = 0;
int value = atoi(eql+1);
if (set_size(cfg, line, value) != 0) {
strncpy(eql+1, line, max_line_len-strlen(line)-1);
snprintf(line, max_line_len, "Unknown name '%s' on line %d.", eql+1, lineno);
return line;
}
} else {
snprintf(line, max_line_len, "Invalid line %d (must be of form 'name=int').",
lineno);
return line;
}
}
free(line);
return NULL;
}
// End of tuning.h.
| // Start of tuning.h.
static char* load_tuning_file(const char *fname,
void *cfg,
int (*set_size)(void*, const char*, size_t)) {
const int max_line_len = 1024;
char* line = (char*) malloc(max_line_len);
FILE *f = fopen(fname, "r");
if (f == NULL) {
snprintf(line, max_line_len, "Cannot open file: %s", strerror(errno));
return line;
}
int lineno = 0;
while (fgets(line, max_line_len, f) != NULL) {
lineno++;
char *eql = strstr(line, "=");
if (eql) {
*eql = 0;
int value = atoi(eql+1);
if (set_size(cfg, line, value) != 0) {
char* err = (char*) malloc(max_line_len + 50);
snprintf(err, max_line_len + 50, "Unknown name '%s' on line %d.", line, lineno);
free(line);
return err;
}
} else {
snprintf(line, max_line_len, "Invalid line %d (must be of form 'name=int').",
lineno);
return line;
}
}
free(line);
return NULL;
}
// End of tuning.h.
| Fix error for short names | Fix error for short names
| C | isc | diku-dk/futhark,HIPERFIT/futhark,diku-dk/futhark,diku-dk/futhark,HIPERFIT/futhark,HIPERFIT/futhark,diku-dk/futhark,diku-dk/futhark |
2638a56fd95710ec7f68131dfefa233a7bdab94f | egroot/src/bits/leadingzeros-cortexm+.h | egroot/src/bits/leadingzeros-cortexm+.h | // +build cortexm3 cortexm4 cortexm4f
static inline
uint bits$leadingZeros32(uint32 u) {
uint n;
asm volatile ("clz %0, %1" : "=r" (n) : "r" (u));
return n;
}
static inline
uint bits$leadingZerosPtr(uintptr u) {
uint n;
asm volatile ("clz %0, %1" : "=r" (n) : "r" (u));
return n;
}
static inline
uint bits$leadingZeros64(uint64 u) {
uint n;
asm volatile (
"clz %0, %R1\n\t"
"cmp %0, 32\n\t"
"itt eq\n\t"
"clzeq %0, %Q1\n\t"
"addeq %0, 32\n\t"
: "=&r" (n)
: "r" (u)
: "cc"
);
return n;
} | // +build cortexm3 cortexm4 cortexm4f
uint
bits$leadingZeros32(uint32 u) {
uint n;
asm volatile ("clz %0, %1":"=r" (n):"r"(u));
return n;
}
uint
bits$leadingZerosPtr(uintptr u) {
uint n;
asm volatile ("clz %0, %1":"=r" (n):"r"(u));
return n;
}
uint
bits$leadingZeros64(uint64 u) {
uint n;
asm volatile ("clz %0, %R1\n\t"
"cmp %0, 32\n\t"
"itt eq\n\t"
"clzeq %0, %Q1\n\t"
"addeq %0, 32\n\t"
:"=&r" (n)
:"r"(u)
:"cc");
return n;
}
| Remove "static inline" from C code. | bits: Remove "static inline" from C code.
| C | bsd-3-clause | ziutek/emgo,ziutek/emgo,ziutek/emgo,ziutek/emgo |
c1c1a4f9cd97d81cca1306ebb6c3099313fd9ea2 | libc/sysdeps/linux/arm/aeabi_memclr.c | libc/sysdeps/linux/arm/aeabi_memclr.c | /* Copyright (C) 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.
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, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <string.h>
libc_hidden_proto(bzero)
/* Clear memory. Can't alias to bzero because it's not defined in the
same translation unit. */
void
__aeabi_memclr (void *dest, size_t n)
{
bzero (dest, n);
}
/* Versions of the above which may assume memory alignment. */
strong_alias (__aeabi_memclr, __aeabi_memclr4)
strong_alias (__aeabi_memclr, __aeabi_memclr8)
| /* Copyright (C) 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.
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, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <string.h>
libc_hidden_proto(memset)
/* Clear memory. Can't alias to bzero because it's not defined in the
same translation unit. */
void
__aeabi_memclr (void *dest, size_t n)
{
memset (dest, 0, n);
}
/* Versions of the above which may assume memory alignment. */
strong_alias (__aeabi_memclr, __aeabi_memclr4)
strong_alias (__aeabi_memclr, __aeabi_memclr8)
| Use memset instead of bzero | Use memset instead of bzero
| C | lgpl-2.1 | foss-for-synopsys-dwc-arc-processors/uClibc,majek/uclibc-vx32,m-labs/uclibc-lm32,ysat0/uClibc,waweber/uclibc-clang,hjl-tools/uClibc,atgreen/uClibc-moxie,wbx-github/uclibc-ng,brgl/uclibc-ng,ffainelli/uClibc,kraj/uClibc,klee/klee-uclibc,foss-xtensa/uClibc,mephi42/uClibc,gittup/uClibc,brgl/uclibc-ng,mephi42/uClibc,czankel/xtensa-uclibc,ffainelli/uClibc,OpenInkpot-archive/iplinux-uclibc,majek/uclibc-vx32,hjl-tools/uClibc,OpenInkpot-archive/iplinux-uclibc,hwoarang/uClibc,czankel/xtensa-uclibc,OpenInkpot-archive/iplinux-uclibc,groundwater/uClibc,groundwater/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,ffainelli/uClibc,ddcc/klee-uclibc-0.9.33.2,groundwater/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,kraj/uclibc-ng,skristiansson/uClibc-or1k,kraj/uclibc-ng,czankel/xtensa-uclibc,ysat0/uClibc,ChickenRunjyd/klee-uclibc,klee/klee-uclibc,m-labs/uclibc-lm32,kraj/uClibc,kraj/uClibc,brgl/uclibc-ng,waweber/uclibc-clang,hjl-tools/uClibc,mephi42/uClibc,ChickenRunjyd/klee-uclibc,m-labs/uclibc-lm32,groundwater/uClibc,wbx-github/uclibc-ng,ysat0/uClibc,ChickenRunjyd/klee-uclibc,ffainelli/uClibc,skristiansson/uClibc-or1k,foss-xtensa/uClibc,kraj/uclibc-ng,foss-for-synopsys-dwc-arc-processors/uClibc,skristiansson/uClibc-or1k,hwoarang/uClibc,majek/uclibc-vx32,m-labs/uclibc-lm32,gittup/uClibc,waweber/uclibc-clang,ndmsystems/uClibc,foss-xtensa/uClibc,ddcc/klee-uclibc-0.9.33.2,majek/uclibc-vx32,mephi42/uClibc,hjl-tools/uClibc,skristiansson/uClibc-or1k,brgl/uclibc-ng,klee/klee-uclibc,ffainelli/uClibc,kraj/uclibc-ng,klee/klee-uclibc,ChickenRunjyd/klee-uclibc,gittup/uClibc,waweber/uclibc-clang,ndmsystems/uClibc,atgreen/uClibc-moxie,atgreen/uClibc-moxie,ddcc/klee-uclibc-0.9.33.2,kraj/uClibc,groundwater/uClibc,hwoarang/uClibc,ndmsystems/uClibc,hjl-tools/uClibc,gittup/uClibc,wbx-github/uclibc-ng,czankel/xtensa-uclibc,ndmsystems/uClibc,hwoarang/uClibc,atgreen/uClibc-moxie,OpenInkpot-archive/iplinux-uclibc,wbx-github/uclibc-ng,ddcc/klee-uclibc-0.9.33.2,foss-xtensa/uClibc,ysat0/uClibc |
965d247d41bffde43572c81575a0915f53fa9b04 | phraser/cc/analysis/analysis_options.h | phraser/cc/analysis/analysis_options.h | #ifndef CC_ANALYSIS_ANALYSIS_OPTIONS_H_
#define CC_ANALYSIS_ANALYSIS_OPTIONS_H_
#include <cstddef>
struct AnalysisOptions {
AnalysisOptions() :
destutter_max_consecutive(3),
replace_html_entities(true)
{}
// Preprocessing.
size_t destutter_max_consecutive;
// Tokenization.
bool replace_html_entities;
};
#endif // CC_ANALYSIS_ANALYSIS_OPTIONS_H_
| #ifndef CC_ANALYSIS_ANALYSIS_OPTIONS_H_
#define CC_ANALYSIS_ANALYSIS_OPTIONS_H_
#include <cstddef>
struct AnalysisOptions {
AnalysisOptions() :
track_index_translation(true),
destutter_max_consecutive(3),
track_chr2drop(true),
replace_html_entities(true)
{}
// General flags:
// * Map tokens to spans in the original text.
bool track_index_translations;
// Preprocessing flags:
// * Maximum number of consecutive code points before we start dropping them.
// * Whether to keep track of code point drop counts from destuttering.
size_t destutter_max_consecutive;
bool track_chr2drop;
// Tokenization flags:
// * Whether to replace HTML entities in the text with their Unicode
// equivalents.
bool replace_html_entities;
};
#endif // CC_ANALYSIS_ANALYSIS_OPTIONS_H_
| Add track_* flags to analysis options to let caller strip it down. | Add track_* flags to analysis options to let caller strip it down.
| C | mit | knighton/phraser,escherba/phraser,knighton/phraser,escherba/phraser,knighton/phraser,escherba/phraser,knighton/phraser,escherba/phraser |
ff6f5a4817adb4e2f2220a65478e50a89d4090b1 | src/readstat_iconv.h | src/readstat_iconv.h | #include <iconv.h>
#ifdef WIN32
typedef const char ** readstat_iconv_inbuf_t;
#else
typedef char ** readstat_iconv_inbuf_t;
#endif
typedef struct readstat_charset_entry_s {
int code;
char name[32];
} readstat_charset_entry_t;
| #include <iconv.h>
#ifdef WINICONV_CONST
typedef const char ** readstat_iconv_inbuf_t;
#else
typedef char ** readstat_iconv_inbuf_t;
#endif
typedef struct readstat_charset_entry_s {
int code;
char name[32];
} readstat_charset_entry_t;
| Fix iconv warnings on MinGW | Fix iconv warnings on MinGW
| C | mit | WizardMac/ReadStat,ivarref/ReadStat,ivarref/ReadStat,WizardMac/ReadStat |
54b6878579d2244eead688151cc0b5418fd512dd | include/adapters/libuvadapter.h | include/adapters/libuvadapter.h | // Author: Hong Jen-Yee (PCMan) ([email protected])
#ifndef __libredisCluster_adapters_libuvadapter_h__
#define __libredisCluster_adapters_libuvadapter_h__
#include "adapter.h" // for Adapter
extern "C"
{
#include <hiredis/adapters/libuv.h> // for redisLibeventAttach()
}
namespace RedisCluster
{
// Wrap hiredis libuv adapter.
class LibUvAdapter : public Adapter
{
public:
explicit LibUvAdapter( uv_loop_t* loop = uv_default_loop() ) : loop_( loop ) {}
virtual ~LibUvAdapter() {}
public:
virtual int attachContext( redisAsyncContext &ac ) override
{
return redisLibuvAttach( &ac, loop_ );
}
private:
uv_loop_t* loop_;
}; // class Adapter
} // namespace RedisCluster
#endif // __libredisCluster_adapters_libuvadapter_h__
| Add hiredis libuv adapter support. | Add hiredis libuv adapter support.
| C | bsd-3-clause | shinberg/cpp-hiredis-cluster |
|
c07827f2d82d7eaa18ab5945b6fe44589650bbc9 | include/dt-bindings/clock/kinetis_sim.h | include/dt-bindings/clock/kinetis_sim.h | /*
* Copyright (c) 2017, NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_
#define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_
#define KINETIS_SIM_CORESYS_CLK 0
#define KINETIS_SIM_PLATFORM_CLK 1
#define KINETIS_SIM_BUS_CLK 2
#define KINETIS_SIM_LPO_CLK 19
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_ */
| /*
* Copyright (c) 2017, NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_
#define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_
#define KINETIS_SIM_CORESYS_CLK 0
#define KINETIS_SIM_PLATFORM_CLK 1
#define KINETIS_SIM_BUS_CLK 2
#define KINETIS_SIM_FAST_PERIPHERAL_CLK 5
#define KINETIS_SIM_LPO_CLK 19
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_ */
| Add support for fast peripheral clock in mcux sim driver | clock_control: Add support for fast peripheral clock in mcux sim driver
Adds support for getting the fast peripheral clock frequency in the mcux
sim driver.
Signed-off-by: Filip Brozovic <[email protected]>
| C | apache-2.0 | Vudentz/zephyr,galak/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,Vudentz/zephyr,nashif/zephyr,nashif/zephyr,galak/zephyr,finikorg/zephyr,galak/zephyr,galak/zephyr,Vudentz/zephyr,nashif/zephyr,finikorg/zephyr,finikorg/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,galak/zephyr |
3da1a1dde53b3efeb54ab1c68fba7d85dac4ac20 | utils/prompt.h | utils/prompt.h | #ifndef _WISH_PROMPT
#define _WISH_PROMPT
/*
* The wish shell prompt has its own format characters, much like how bash,
* zsh, fish, and ksh all have their own formatting characters.
*
* %u - The username of the current user
* %h - The hostname
* %d~n - The top n levels of the working directory. If n is not provided
* then the entire working directory is displayed. (i.e. %d, %d~2)
* This assumes that 0 <= n <= 9.
* %t - The time in 24 hour format
* %T - The time in 12 hour (AM/PM) format
* %% - The percent symbol
*
*
* NOTES:
*
* If there is a % at the end of the prompt, it will be implied that it is %%.
* An unrecognized formatting character will be interpretted literally.
*/
char *PROMPT;
char *get_format_substitution(char *prompt_var);
void load_prompt_defaults();
void load_prompt_config();
void prompt(char *current_working_dir);
#endif
| #ifndef _WISH_PROMPT
#define _WISH_PROMPT
/*
* The wish shell prompt has its own format characters, much like how bash,
* zsh, fish, and ksh all have their own formatting characters.
*
* %u - The username of the current user
* %h - The hostname
* %d~n - The top n levels of the working directory. If n is not provided
* then the entire working directory is displayed. (i.e. %d, %d~2)
* This assumes that 0 <= n <= 9.
* %t - The time in 24 hour format
* %T - The time in 12 hour (AM/PM) format
* %% - The percent symbol
*
*
* NOTES:
*
* If there is a % at the end of the prompt, it will be implied that it is %%.
* An unrecognized formatting character will be interpretted literally.
*/
char *PROMPT;
char *get_format_substitution(char *prompt_var);
void load_prompt_defaults();
void load_prompt_config();
void prompt(char *current_working_dir);
#endif
#ifndef HOST_NAME_MAX
#define HOST_NAME_MAX 255
#endif
| Fix HOST_NAME_MAX not found error on Mac OSX. POSIX compliance pls. | Fix HOST_NAME_MAX not found error on Mac OSX. POSIX compliance pls.
| C | mit | elc1798/wish |
b491a3e6156e450810e3d9a8c2d59365606dd208 | hal2.h | hal2.h | #ifndef HAL2_H
#define HAL2_H
// Mechanical constants
extern int const MAIN_MOTOR_PWM_TOP = 255;
extern int const MAIN_MOTOR_BRAKE_SPEED = 120;
extern int const MAIN_MOTOR_MIN_SPEED = 150;
extern int const MAIN_MOTOR_MED_SPEED = 254;
extern int const MAIN_MOTOR_MAX_SPEED = 255;
extern int const MAGNET_OPEN_WAIT = 5; // 10ths of a second
void init(void);
void main_motor_stop();
void main_motor_cw_open(uint8_t speed);
void main_motor_ccw_close(uint8_t speed);
void set_main_motor_speed(int speed);
int get_main_motor_speed();
void aux_motor_stop();
void aux_motor_cw_close();
void aux_motor_ccw_open();
void magnet_off();
void magnet_on();
bool door_nearly_open();
bool door_fully_open();
bool door_fully_closed();
bool sensor_proximity();
bool button_openclose();
bool button_stop();
bool main_encoder();
bool aux_outdoor_limit();
bool aux_indoor_limit();
bool door_nearly_closed();
bool aux_encoder();
#endif
| #ifndef HAL2_H
#define HAL2_H
// Mechanical constants
extern int const MAIN_MOTOR_PWM_TOP = 255;
extern int const MAIN_MOTOR_BRAKE_SPEED = 120;
extern int const MAIN_MOTOR_MIN_SPEED = 150;
extern int const MAIN_MOTOR_MED_SPEED = 254;
extern int const MAIN_MOTOR_MAX_SPEED = 255;
extern int const MAGNET_OPEN_WAIT = 5; // 10ths of a second
void init(void);
void main_motor_stop();
void main_motor_cw_open(uint8_t speed);
void main_motor_ccw_close(uint8_t speed);
void aux_motor_stop();
void aux_motor_cw_close();
void aux_motor_ccw_open();
void magnet_off();
void magnet_on();
bool door_nearly_open();
bool door_fully_open();
bool door_fully_closed();
bool sensor_proximity();
bool button_openclose();
bool button_stop();
bool main_encoder();
bool aux_outdoor_limit();
bool aux_indoor_limit();
bool door_nearly_closed();
bool aux_encoder();
#endif
| Remove functions that are private. | Remove functions that are private.
| C | unlicense | plzz/ovisysteemi,plzz/ovisysteemi |
637d0f278459aa1130ab96c063fcaf0611507e47 | main.c | main.c | #include <stdio.h>
#include <assert.h>
#include "api.h"
#include "lib/math.c"
#include "lib/test.c"
static jack_state_t* state;
static intptr_t jack_fib(intptr_t n) {
jack_new_integer(state, n);
jack_function_call(state, 1, 1);
return jack_get_integer(state, -1);
}
int main() {
for (int j = 0; j < 0x1; ++j) {
state = jack_new_state(15);
jack_call(state, jack_math, 0);
jack_map_get_symbol(state, -1, "fib");
jack_new_list(state);
// 1 - fib
// 2 - list
for (intptr_t i = 0; i <= 91; ++i) {
printf("fib(%ld) = %ld\n", i, jack_fib(i));
jack_list_push(state, 2);
}
jack_dump_state(state);
jack_free_state(state);
}
return 0;
}
| #include <stdio.h>
#include <assert.h>
#include "api.h"
#include "lib/math.c"
#include "lib/test.c"
static jack_state_t* state;
static intptr_t jack_fib(intptr_t n) {
jack_new_integer(state, n);
jack_function_call(state, 1, 1);
return jack_get_integer(state, -1);
}
int main() {
state = jack_new_state(20);
jack_call(state, jack_math, 0);
jack_map_get_symbol(state, -1, "fib");
jack_new_list(state);
// 1 - fib
// 2 - list
for (int j = 0; j < 0x10000; ++j) {
printf("Generation %d\n", j);
for (intptr_t i = 0; i <= 91; ++i) {
jack_fib(i);
// printf("fib(%ld) = %ld\n", i, jack_fib(i));
jack_pop(state);
// jack_list_push(state, 2);
}
}
jack_dump_state(state);
jack_free_state(state);
return 0;
}
| Tweak for benchmark. fib(0-91) 1987925/second | Tweak for benchmark. fib(0-91) 1987925/second
| C | mit | creationix/jack-lang,creationix/jack-lang |
6eba7a9e41ca3e5fac9c3b5feb74af9f37774987 | apps/examples/kalman_demo/params.c | apps/examples/kalman_demo/params.c | #include <systemlib/param/param.h>
/*PARAM_DEFINE_FLOAT(NAME,0.0f);*/
PARAM_DEFINE_FLOAT(KF_V_GYRO, 1.0f);
PARAM_DEFINE_FLOAT(KF_V_ACCEL, 1.0f);
PARAM_DEFINE_FLOAT(KF_R_MAG, 1.0f);
PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f);
PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 5.0f);
PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 5.0f);
PARAM_DEFINE_FLOAT(KF_R_PRESS_ALT, 0.1f);
PARAM_DEFINE_FLOAT(KF_R_ACCEL, 1.0f);
PARAM_DEFINE_FLOAT(KF_FAULT_POS, 10.0f);
PARAM_DEFINE_FLOAT(KF_FAULT_ATT, 10.0f);
PARAM_DEFINE_FLOAT(KF_ENV_G, 9.765f);
PARAM_DEFINE_FLOAT(KF_ENV_MAG_DIP, 60.0f);
PARAM_DEFINE_FLOAT(KF_ENV_MAG_DEC, 0.0f);
| #include <systemlib/param/param.h>
/*PARAM_DEFINE_FLOAT(NAME,0.0f);*/
PARAM_DEFINE_FLOAT(KF_V_GYRO, 0.008f);
PARAM_DEFINE_FLOAT(KF_V_ACCEL, 1.0f);
PARAM_DEFINE_FLOAT(KF_R_MAG, 1.0f);
PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f);
PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 5.0f);
PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 5.0f);
PARAM_DEFINE_FLOAT(KF_R_PRESS_ALT, 0.1f);
PARAM_DEFINE_FLOAT(KF_R_ACCEL, 1.0f);
PARAM_DEFINE_FLOAT(KF_FAULT_POS, 10.0f);
PARAM_DEFINE_FLOAT(KF_FAULT_ATT, 10.0f);
PARAM_DEFINE_FLOAT(KF_ENV_G, 9.765f);
PARAM_DEFINE_FLOAT(KF_ENV_MAG_DIP, 60.0f);
PARAM_DEFINE_FLOAT(KF_ENV_MAG_DEC, 0.0f);
| Fix gyro measurement noise variance | Fix gyro measurement noise variance
| C | bsd-3-clause | mcgill-robotics/Firmware,Aerotenna/Firmware,darknight-007/Firmware,dagar/Firmware,krbeverx/Firmware,PX4/Firmware,mcgill-robotics/Firmware,PX4/Firmware,jlecoeur/Firmware,mje-nz/PX4-Firmware,PX4/Firmware,PX4/Firmware,jlecoeur/Firmware,Aerotenna/Firmware,acfloria/Firmware,krbeverx/Firmware,acfloria/Firmware,krbeverx/Firmware,PX4/Firmware,jlecoeur/Firmware,krbeverx/Firmware,Aerotenna/Firmware,jlecoeur/Firmware,jlecoeur/Firmware,jlecoeur/Firmware,dagar/Firmware,Aerotenna/Firmware,acfloria/Firmware,mje-nz/PX4-Firmware,acfloria/Firmware,mcgill-robotics/Firmware,mcgill-robotics/Firmware,dagar/Firmware,krbeverx/Firmware,krbeverx/Firmware,mcgill-robotics/Firmware,acfloria/Firmware,mcgill-robotics/Firmware,Aerotenna/Firmware,mje-nz/PX4-Firmware,mje-nz/PX4-Firmware,PX4/Firmware,mje-nz/PX4-Firmware,jlecoeur/Firmware,dagar/Firmware,Aerotenna/Firmware,PX4/Firmware,Aerotenna/Firmware,darknight-007/Firmware,darknight-007/Firmware,mcgill-robotics/Firmware,darknight-007/Firmware,krbeverx/Firmware,dagar/Firmware,mje-nz/PX4-Firmware,acfloria/Firmware,acfloria/Firmware,dagar/Firmware,darknight-007/Firmware,jlecoeur/Firmware,dagar/Firmware,mje-nz/PX4-Firmware |
8114b3e7e5438de48b5cf1c1e2454debb6cf96cc | src/readimages.c | src/readimages.c | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <arpa/inet.h>
#include "idx.h"
int main(int argc, char **argv){
if(argc<2){
printf("Usage: \n");
printf("readlabels t10k-labels-idx1-ubyte \n");
exit(1);
}
char *slabelfname = argv[1];
IDX1_DATA idxdata;
if(!fread_idx1_file( slabelfname, &idxdata)){
printf("The datafile '%s' is not a valid IDX_1 file.\n", slabelfname);
exit(2);
}
//printf("Length: %d\n", idxdata.length);
int i;
for(i=0;i<idxdata.length;i++){
// printf("DATA[%05d] = %02d\n", i, idxdata.data[i]);
printf("%d\n", idxdata.data[i]);
}
return 0;
}
| #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <arpa/inet.h>
#include "idx.h"
int main(int argc, char **argv){
if(argc<2){
printf("Usage: \n");
printf("readimages t10k-images-idx3-ubyte \n");
exit(1);
}
char *slabelfname = argv[1];
IDX3_DATA idxdata;
if(!fread_idx3_file( slabelfname, &idxdata)){
printf("The datafile '%s' is not a valid IDX3 file.\n", slabelfname);
exit(2);
}
//printf("Length: %d\n", idxdata.length);
int i;
int x;
int y;
int ibase;
int rbase;
unsigned char pxl;
for(i=0;i<idxdata.nimages;i++){
ibase = i * idxdata.nrows * idxdata.ncols;
printf("Image %05d ( %010d ):\n", i + 1, ibase);
for(y=0;y<idxdata.nrows;y++){
rbase = ibase + y*idxdata.ncols;
for(x=0;x<idxdata.ncols;x++){
// printf("DATA[%05d] = %02d\n", i, idxdata.data[i]);
pxl = idxdata.data[ rbase + x ];
if(pxl){
printf("%02X", pxl);
}else{
printf(" ");
}
}
printf("\n");
}
printf("========================================================\n");
}
return 0;
}
| Implement a simple ASCII text image dumper. | Implement a simple ASCII text image dumper.
| C | mit | spytheman/MNIST-idx1-and-idx3-file-readers |
8422e5d1b414ee3a5ca6813e064fb55ea7a8c5bd | src/udbm_stubs.h | src/udbm_stubs.h | #ifndef UDBM_STUBS_H_
#define UDBM_STUBS_H_
#include <vector>
typedef std::vector<int> carray_t;
#define get_cvector(x) ((carray_t*)Data_custom_val(x))
#define get_dbm_ptr(x) static_cast<dbm_t*>(Data_custom_val(x))
#endif // UDBM_STUBS_H_
| #ifndef UDBM_STUBS_H_
#define UDBM_STUBS_H_
#include <vector>
typedef std::vector<int> carray_t;
#define get_cvector(x) ((carray_t*)Data_custom_val(x))
#define get_dbm_ptr(x) static_cast<dbm_t*>(Data_custom_val(x))
bool
dbm_closure_leq(const raw_t * const dr1, const raw_t * const dr2, cindex_t dim,
const std::vector<int> &lbounds, const std::vector<int> &ubounds);
#endif // UDBM_STUBS_H_
| Make closure inclusion test visible (to be used from the priced zone part). | Make closure inclusion test visible (to be used from the priced zone part).
| C | agpl-3.0 | osankur/udbml,osankur/udbml,osankur/udbml |
59501bf64fd51722d70cc3c7682ef30efe057e36 | models/generic/Generic_FuncDriver.h | models/generic/Generic_FuncDriver.h | // =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: Radu Serban
// =============================================================================
//
//
// =============================================================================
#ifndef GENERIC_FUNCDRIVER_H
#define GENERIC_FUNCDRIVER_H
#include "subsys/ChDriver.h"
class Generic_FuncDriver : public chrono::ChDriver
{
public:
Generic_FuncDriver() {}
~Generic_FuncDriver() {}
virtual void Update(double time)
{
if (time < 0.5)
m_throttle = 0;
else if (time < 1.5)
m_throttle = 0.4 * (time - 0.5);
else
m_throttle = 0.4;
if (time < 4)
m_steering = 0;
else if (time < 6)
m_steering = 0.25 * (time - 4);
else if (time < 10)
m_steering = -0.25 * (time - 6) + 0.5;
else
m_steering = -0.5;
}
};
#endif
| Add a generic driver model. | Add a generic driver model.
| C | bsd-3-clause | hsu/chrono-vehicle,hsu/chrono-vehicle,hsu/chrono-vehicle |
|
0938cfe3dc0a498bbf3ce26dfe6c47d4d68025b5 | libtock/internal/nonvolatile_storage.h | libtock/internal/nonvolatile_storage.h | #pragma once
#include "tock.h"
#ifdef __cplusplus
extern "C" {
#endif
#define DRIVER_NUM_NONVOLATILE_STORAGE 0x1b
int nonvolatile_storage_internal_read_done_subscribe(subscribe_cb cb, void *userdata);
int nonvolatile_storage_internal_write_done_subscribe(subscribe_cb cb, void *userdata);
int nonvolatile_storage_internal_read_buffer(uint8_t* buffer, uint32_t len);
int nonvolatile_storage_internal_write_buffer(uint8_t* buffer, uint32_t len);
int nonvolatile_storage_internal_get_number_bytes(void);
int nonvolatile_storage_internal_read(uint32_t offset, uint32_t length);
int nonvolatile_storage_internal_write(uint32_t offset, uint32_t length);
#ifdef __cplusplus
}
#endif
| #pragma once
#include "tock.h"
#define DRIVER_NUM_NONVOLATILE_STORAGE 0x50001
#ifdef __cplusplus
extern "C" {
#endif
int nonvolatile_storage_internal_read_done_subscribe(subscribe_cb cb, void *userdata);
int nonvolatile_storage_internal_write_done_subscribe(subscribe_cb cb, void *userdata);
int nonvolatile_storage_internal_read_buffer(uint8_t* buffer, uint32_t len);
int nonvolatile_storage_internal_write_buffer(uint8_t* buffer, uint32_t len);
int nonvolatile_storage_internal_get_number_bytes(void);
int nonvolatile_storage_internal_read(uint32_t offset, uint32_t length);
int nonvolatile_storage_internal_write(uint32_t offset, uint32_t length);
#ifdef __cplusplus
}
#endif
| Revert "weird issue where flash only works when DRIVER_NUM set to 27, hardcoded somewhere?" | Revert "weird issue where flash only works when DRIVER_NUM set to 27, hardcoded somewhere?"
This reverts commit 3431f4ed857afb9376a120334e1521aa9a71d483.
| C | apache-2.0 | tock/libtock-c,tock/libtock-c,tock/libtock-c |
d3fabf05ee40f4a75d71aa7496819b75171d4c95 | src/command1.c | src/command1.c | #include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#include "firebase.h"
#include "serial.h"
#include "gpio.h"
#define _USE_SERIAL_
#ifdef _USE_SERIAL_
void (*send_command)(bool, int) = send_command_serial;
void (*init_sender)() = init_sender_serial;
#else
void (*send_command)(bool, int) = send_command_gpio;
void (*init_sender)() = init_sender_gpio;
#endif
void parse_event_string(char* event) {
bool isOn = (strncmp(event, "on", 2) == 0);
send_command(isOn, event[strlen(event)-1] - '0');
}
int main(int argc, char *argv[]) {
init_sender();
if(argc > 1) {
printf("Commanding remote\n\n");
bool isOn = strcmp(argv[1], "on") == 0 ? true : false;
send_command(isOn, argv[2][0] - '0');
} else {
firebase_set_url("https://test.firebaseio.com/me.json");
firebase_set_callback("/event", parse_event_string);
sleep(10);
while (true) {
firebase_subscribe();
sleep(30);
}
}
return 0;
}
| #include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#include "firebase.h"
#include "serial.h"
#include "gpio.h"
bool useSerial = true;
void init_sender() {
if (useSerial) {
init_sender_serial();
} else {
init_sender_gpio();
}
}
void send_command(bool isOn, int device) {
if (useSerial) {
send_command_serial(isOn, device);
} else {
send_command_gpio(isOn, device);
}
}
void parse_event_string(char* event) {
bool isOn = (strncmp(event, "on", 2) == 0);
send_command(isOn, event[strlen(event)-1] - '0');
}
int main(int argc, char *argv[]) {
init_sender();
if(argc > 1) {
printf("Commanding remote\n\n");
bool isOn = strcmp(argv[1], "on") == 0 ? true : false;
send_command(isOn, argv[2][0] - '0');
} else {
firebase_set_url("https://test.firebaseio.com/me.json");
firebase_set_callback("/event", parse_event_string);
sleep(10);
while (true) {
firebase_subscribe();
sleep(30);
}
}
return 0;
}
| Switch to runtime library choice instead of compile time. | Switch to runtime library choice instead of compile time.
| C | mit | maciel310/command1-openwrt,maciel310/command1-openwrt |
f536368be8729154db369cc785fd5477e42c950e | test/FrontendC/wchar-const.c | test/FrontendC/wchar-const.c | // RUN: %llvmgcc -S %s -o - | grep {constant \\\[18 x} | grep { 84, }
// This should pass for any endianness combination of host and target.
#include <ctype.h>
extern void foo(const wchar_t* p);
int main (int argc, const char * argv[])
{
foo(L"This is some text");
return 0;
}
| // RUN: %llvmgcc -S %s -o - | grep {constant \\\[18 x} | grep { 84, }
// This should pass for any endianness combination of host and target.
#include <wchar.h>
extern void foo(const wchar_t* p);
int main (int argc, const char * argv[])
{
foo(L"This is some text");
return 0;
}
| Use wchar.h to get wchar_t, not ctype.h. | Use wchar.h to get wchar_t, not ctype.h.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@78703 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm |
6b57b159709dcb4d53e64738f2d1f73b36e41601 | drivers/scsi/qla4xxx/ql4_version.h | drivers/scsi/qla4xxx/ql4_version.h | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2010 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.02.00-k4"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2010 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.02.00-k5"
| Update driver version to 5.02.00-k5 | [SCSI] qla4xxx: Update driver version to 5.02.00-k5
Signed-off-by: Vikas Chaudhary <[email protected]>
Signed-off-by: Ravi Anand <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
| C | mit | KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs |
0eebf9b5d2da61f84cddd0ec2bb41be93f8fc82b | arch/powerpc/include/asm/swab.h | arch/powerpc/include/asm/swab.h | /*
* 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 _ASM_POWERPC_SWAB_H
#define _ASM_POWERPC_SWAB_H
#include <uapi/asm/swab.h>
static __inline__ __u16 ld_le16(const volatile __u16 *addr)
{
__u16 val;
__asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr));
return val;
}
static __inline__ void st_le16(volatile __u16 *addr, const __u16 val)
{
__asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
}
static __inline__ __u32 ld_le32(const volatile __u32 *addr)
{
__u32 val;
__asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr));
return val;
}
static __inline__ void st_le32(volatile __u32 *addr, const __u32 val)
{
__asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
}
#endif /* _ASM_POWERPC_SWAB_H */
| /*
* 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 _ASM_POWERPC_SWAB_H
#define _ASM_POWERPC_SWAB_H
#include <uapi/asm/swab.h>
#endif /* _ASM_POWERPC_SWAB_H */
| Remove unused st_le*() and ld_le* functions | powerpc: Remove unused st_le*() and ld_le* functions
The powerpc specific st_le*() and ld_le*() functions in
arch/powerpc/asm/swab.h no longer have any users. They are also
misleadingly named, since they always byteswap, even on a little-endian
host.
This patch removes them.
Signed-off-by: David Gibson <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
| C | mit | KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs |
20fd5a0c28f49618218d3c8d43c742fbab68edf0 | src/host/os_rmdir.c | src/host/os_rmdir.c | /**
* \file os_rmdir.c
* \brief Remove a subdirectory.
* \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
*/
#include <stdlib.h>
#include "premake.h"
int os_rmdir(lua_State* L)
{
int z;
const char* path = luaL_checkstring(L, 1);
#if PLATFORM_WINDOWS
z = RemoveDirectory(path);
#else
z = rmdir(path);
#endif
if (!z)
{
lua_pushnil(L);
lua_pushfstring(L, "unable to remove directory '%s'", path);
return 2;
}
else
{
lua_pushboolean(L, 1);
return 1;
}
}
| /**
* \file os_rmdir.c
* \brief Remove a subdirectory.
* \author Copyright (c) 2002-2013 Jason Perkins and the Premake project
*/
#include <stdlib.h>
#include "premake.h"
int os_rmdir(lua_State* L)
{
int z;
const char* path = luaL_checkstring(L, 1);
#if PLATFORM_WINDOWS
z = RemoveDirectory(path);
#else
z = (0 == rmdir(path));
#endif
if (!z)
{
lua_pushnil(L);
lua_pushfstring(L, "unable to remove directory '%s'", path);
return 2;
}
else
{
lua_pushboolean(L, 1);
return 1;
}
}
| Fix error result handling in os.rmdir() | Fix error result handling in os.rmdir()
| C | bsd-3-clause | premake/premake-4.x,soundsrc/premake-stable,ryanjmulder/premake-4.x,lizh06/premake-4.x,ryanjmulder/premake-4.x,soundsrc/premake-stable,premake/premake-4.x,lizh06/premake-4.x,premake/premake-4.x,soundsrc/premake-stable,ryanjmulder/premake-4.x,premake/premake-4.x,soundsrc/premake-stable,lizh06/premake-4.x,lizh06/premake-4.x,ryanjmulder/premake-4.x |
98997692a6a8bf1ae6bbe15dd18ec4e27e0e6fcf | risky/risky.h | risky/risky.h | #ifndef SAXBOPHONE_RISKY_RISKY_H
#define SAXBOPHONE_RISKY_RISKY_H
#include <stdint.h>
#ifdef __cplusplus
extern "C"{
#endif
typedef struct version_t {
uint8_t major;
uint8_t minor;
uint8_t patch;
} version_t;
extern const version_t VERSION;
#ifdef __cplusplus
} // extern "C"
#endif
// end of header file
#endif
| #ifndef SAXBOPHONE_RISKY_RISKY_H
#define SAXBOPHONE_RISKY_RISKY_H
#include <stdint.h>
#ifdef __cplusplus
extern "C"{
#endif
// struct for representing version of RISKY
typedef struct version_t {
uint8_t major;
uint8_t minor;
uint8_t patch;
} version_t;
// enum for storing information about the error status of a function
typedef enum status_t {
UNKNOWN = 0,
MALLOC_REFUSED,
IMPOSSIBLE_CONDITION,
SUCCESS,
} status_t;
extern const version_t VERSION;
#ifdef __cplusplus
} // extern "C"
#endif
// end of header file
#endif
| Add a function return status enum | Add a function return status enum
| C | mpl-2.0 | saxbophone/risky |
ceb069acb461dd7da080303e29b2e8d916487cb8 | cc1/tests/test018.c | cc1/tests/test018.c | /*
name: TEST018
description: Basic test for arrays
output:
F1
G1 F1 main
{
-
V2 M #4
V3 V2 #2
A4 V3 arr
A6 P p
A8 P q
V9 I #4
A10 V9 v
A6 A4 'P :P
A8 A4 'P #P4 +P #P3 +P :P
A4 'P #P4 +P #P3 +P @M #M2 :M
A10 'P @I #I2 :I
j L12 A4 'P #P4 +P #P3 +P @M MI #I2 =I
yI #I1
L12
j L13 A6 #P4 +P #P3 +P @M MI #I2 =I
yI #I1
L13
j L14 A8 @M MI #I2 =I
yI #I1
L14
j L15 A10 @I #I2 =I
yI #I1
L15
yI #I0
}
*/
#line 1
int
main()
{
char arr[2][4], (*p)[4], *q;
int v[4];
p = arr;
q = &arr[1][3];
arr[1][3] = 2;
v[0] = 2;
if (arr[1][3] != 2)
return 1;
if (p[1][3] != 2)
return 1;
if (*q != 2)
return 1;
if (*v != 2)
return 1;
return 0;
}
| Add basic test for arrays | Add basic test for arrays
| C | mit | 8l/scc,k0gaMSX/kcc,k0gaMSX/scc,8l/scc,k0gaMSX/scc,k0gaMSX/kcc,k0gaMSX/scc,8l/scc |
|
ed9f4938ae6215f20ff31d4b44545a8c0efe859f | KSPTableSection.h | KSPTableSection.h | //
// KPTableSection.h
// KSPFetchedResultsController
//
// Created by Konstantin Pavlikhin on 05.09.14.
// Copyright (c) 2015 Konstantin Pavlikhin. All rights reserved.
//
#import <Foundation/Foundation.h>
// * * *.
@class NSManagedObject;
// * * *.
@interface KSPTableSection : NSObject
- (nullable instancetype) initWithSectionName: (nonnull NSObject*) sectionName nestedObjects: (nullable NSArray<NSManagedObject*>*) nestedObjects;
@property(readwrite, copy, nonatomic, nonnull) NSObject* sectionName;
// Collection KVO-compatible property.
@property(readonly, nullable) NSArray<__kindof NSManagedObject*>* nestedObjects;
- (void) insertObject: (nonnull NSManagedObject*) object inNestedObjectsAtIndex: (NSUInteger) index;
@end
| //
// KPTableSection.h
// KSPFetchedResultsController
//
// Created by Konstantin Pavlikhin on 05.09.14.
// Copyright (c) 2015 Konstantin Pavlikhin. All rights reserved.
//
#import <Foundation/Foundation.h>
// * * *.
@class NSManagedObject;
// * * *.
@interface KSPTableSection : NSObject
- (nullable instancetype) initWithSectionName: (nonnull NSObject*) sectionName nestedObjects: (nullable NSArray<NSManagedObject*>*) nestedObjects;
@property(readwrite, copy, nonatomic, nonnull) NSObject* sectionName;
// Collection KVO-compatible property.
@property(readonly, nonatomic, nullable) NSArray<__kindof NSManagedObject*>* nestedObjects;
- (void) insertObject: (nonnull NSManagedObject*) object inNestedObjectsAtIndex: (NSUInteger) index;
@end
| Add a missing 'nonatomic' keyword in a property declaration. | Add a missing 'nonatomic' keyword in a property declaration.
| C | mit | konstantinpavlikhin/KSPFetchedResultsController |
bd0737eb713fae5ca536488b0b6c327f71cf6cf0 | You-DataStore/datastore.h | You-DataStore/datastore.h | #pragma once
#ifndef YOU_DATASTORE_DATASTORE_H_
#define YOU_DATASTORE_DATASTORE_H_
#include <memory>
#include "task_typedefs.h"
#include "transaction.h"
namespace You {
namespace DataStore {
namespace UnitTests {}
class DataStore {
public:
Transaction && begin();
static DataStore& get();
// Modifying methods
void post(TaskId, SerializedTask&);
void put(TaskId, SerializedTask&);
void erase(TaskId);
std::vector<SerializedTask> getAllTask();
void notify();
private:
bool isServing = false;
std::unique_ptr<Transaction> activeTransaction;
};
} // namespace DataStore
} // namespace You
#endif // YOU_DATASTORE_DATASTORE_H_
| #pragma once
#ifndef YOU_DATASTORE_DATASTORE_H_
#define YOU_DATASTORE_DATASTORE_H_
#include <stack>
#include <memory>
#include "task_typedefs.h"
#include "transaction.h"
namespace You {
namespace DataStore {
namespace UnitTests {}
class DataStore {
public:
Transaction && begin();
static DataStore& get();
// Modifying methods
void post(TaskId, SerializedTask&);
void put(TaskId, SerializedTask&);
void erase(TaskId);
std::vector<SerializedTask> getAllTask();
void notify();
private:
bool isServing = false;
std::shared_ptr<Transaction> activeTransaction;
std::stack<std::shared_ptr<Transaction> > transactionStack;
};
} // namespace DataStore
} // namespace You
#endif // YOU_DATASTORE_DATASTORE_H_
| Add member variable: transaction stack | Add member variable: transaction stack
| C | mit | cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main |
54fb750d8389febff3fa254c4dd5d815b7a60f69 | Nimble/Nimble.h | Nimble/Nimble.h | #import <Foundation/Foundation.h>
FOUNDATION_EXPORT double NimbleVersionNumber;
FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
| #import <Foundation/Foundation.h>
FOUNDATION_EXPORT double NimbleVersionNumber;
FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
#import "DSL.h"
#import "NMBExceptionCapture.h"
| Add Objective-C headers to umbrella header to make project compile | Add Objective-C headers to umbrella header to make project compile
| C | apache-2.0 | DanielAsher/Nimble,AnthonyMDev/Nimble,abbeycode/Nimble,AnthonyMDev/Nimble,twobitlabs/Nimble,twobitlabs/Nimble,abbeycode/Nimble,feinstruktur/Nimble,phatblat/Nimble,AnthonyMDev/Nimble,Quick/Nimble,ashfurrow/Nimble,DanielAsher/Nimble,feinstruktur/Nimble,DanielAsher/Nimble,ashfurrow/Nimble,jeffh/Nimble,abbeycode/Nimble,mishimay/Nimble,dgdosen/Nimble,phatblat/Nimble,feinstruktur/Nimble,phatblat/Nimble,dgdosen/Nimble,Quick/Nimble,abbeycode/Nimble,jeffh/Nimble,mishimay/Nimble,dgdosen/Nimble,mishimay/Nimble,twobitlabs/Nimble,ashfurrow/Nimble,jeffh/Nimble,dgdosen/Nimble,Quick/Nimble,jeffh/Nimble |
19b1e3ebe513855cae870da9a2133f99e1bb14b8 | src/includepriv/xmmspriv/xmms_collsync.h | src/includepriv/xmmspriv/xmms_collsync.h | /* XMMS2 - X Music Multiplexer System
* Copyright (C) 2003-2009 XMMS2 Team
*
* PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!!
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
#ifndef __XMMS_COLLSYNC_H__
#define __XMMS_COLLSYNC_H__
#include "xmmspriv/xmms_collection.h"
void xmms_coll_sync_init (xmms_coll_dag_t *dag);
void xmms_coll_sync_shutdown ();
void xmms_coll_sync_schedule_sync ();
#endif
| /* XMMS2 - X Music Multiplexer System
* Copyright (C) 2003-2009 XMMS2 Team
*
* PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!!
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
#ifndef __XMMS_COLLSYNC_H__
#define __XMMS_COLLSYNC_H__
#include "xmmspriv/xmms_collection.h"
void xmms_coll_sync_init (xmms_coll_dag_t *dag);
void xmms_coll_sync_shutdown (void);
void xmms_coll_sync_schedule_sync (void);
#endif
| Make function declarations proper prototypes in collsync.h | OTHER: Make function declarations proper prototypes in collsync.h
| C | lgpl-2.1 | theefer/xmms2,six600110/xmms2,six600110/xmms2,mantaraya36/xmms2-mantaraya36,mantaraya36/xmms2-mantaraya36,chrippa/xmms2,dreamerc/xmms2,six600110/xmms2,dreamerc/xmms2,theefer/xmms2,chrippa/xmms2,krad-radio/xmms2-krad,xmms2/xmms2-stable,krad-radio/xmms2-krad,dreamerc/xmms2,six600110/xmms2,xmms2/xmms2-stable,dreamerc/xmms2,oneman/xmms2-oneman,oneman/xmms2-oneman,krad-radio/xmms2-krad,theefer/xmms2,xmms2/xmms2-stable,theefer/xmms2,oneman/xmms2-oneman-old,theeternalsw0rd/xmms2,krad-radio/xmms2-krad,mantaraya36/xmms2-mantaraya36,xmms2/xmms2-stable,oneman/xmms2-oneman,oneman/xmms2-oneman,theeternalsw0rd/xmms2,dreamerc/xmms2,mantaraya36/xmms2-mantaraya36,krad-radio/xmms2-krad,theefer/xmms2,oneman/xmms2-oneman,theeternalsw0rd/xmms2,theefer/xmms2,chrippa/xmms2,chrippa/xmms2,xmms2/xmms2-stable,theeternalsw0rd/xmms2,oneman/xmms2-oneman-old,mantaraya36/xmms2-mantaraya36,oneman/xmms2-oneman,six600110/xmms2,theeternalsw0rd/xmms2,oneman/xmms2-oneman-old,six600110/xmms2,oneman/xmms2-oneman-old,chrippa/xmms2,oneman/xmms2-oneman-old,mantaraya36/xmms2-mantaraya36,mantaraya36/xmms2-mantaraya36,chrippa/xmms2,xmms2/xmms2-stable,krad-radio/xmms2-krad,theefer/xmms2,oneman/xmms2-oneman,theeternalsw0rd/xmms2 |
a615df7468af8315894a91bd5758699abbfcc97c | src/Mapper1.h | src/Mapper1.h | #ifndef MAPPER_1_H
#define MAPPER_1_H
#include <Mapper.h>
enum PrgMode {
PRG_32KB,
FIX_FIRST_16KB,
FIX_LAST_16KB,
};
enum ChrMode {
CHR_8KB,
CHR_4KB,
};
class Mapper1: public Mapper {
public:
uint8_t readPrg(uint16_t addr);
void writePrg(uint16_t addr, uint8_t value);
uint8_t readChr(uint16_t addr);
void writeChr(uint16_t addr, uint8_t value);
private:
void loadRegister(uint16_t addr, uint8_t value);
void updateBankAddresses();
int decodePrgRomAddress(uint16_t addr);
int decodeChrRomAddress(uint16_t addr);
int shiftRegister = 0x10;
int prgRomBank = 0;
bool prgRamDisable = false;
int chrRomBank0 = 0;
int chrRomBank1 = 0;
PrgMode prgMode = PrgMode::PRG_32KB;
ChrMode chrMode = ChrMode::CHR_8KB;
int prg16kBankAddresses[2];
int chr4kBankAddresses[2];
};
#endif
| #ifndef MAPPER_1_H
#define MAPPER_1_H
#include <Mapper.h>
enum PrgMode {
PRG_32KB,
FIX_FIRST_16KB,
FIX_LAST_16KB,
};
enum ChrMode {
CHR_8KB,
CHR_4KB,
};
class Mapper1: public Mapper {
public:
uint8_t readPrg(uint16_t addr);
void writePrg(uint16_t addr, uint8_t value);
uint8_t readChr(uint16_t addr);
void writeChr(uint16_t addr, uint8_t value);
private:
void loadRegister(uint16_t addr, uint8_t value);
void updateBankAddresses();
int decodePrgRomAddress(uint16_t addr);
int decodeChrRomAddress(uint16_t addr);
int shiftRegister = 0x10;
int prgRomBank = 0;
bool prgRamDisable = false;
int chrRomBank0 = 0;
int chrRomBank1 = 0;
PrgMode prgMode = PrgMode::FIX_LAST_16KB;
ChrMode chrMode = ChrMode::CHR_8KB;
int prg16kBankAddresses[2];
int chr4kBankAddresses[2];
};
#endif
| Update mapper 1 default mapping on boot | Update mapper 1 default mapping on boot
| C | mit | scottjcrouch/ScootNES,scottjcrouch/ScootNES,scottjcrouch/ScootNES |
63b675bb73dc94a45c6049795cebd34ae0c66185 | ash/shell/example_factory.h | ash/shell/example_factory.h | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_SHELL_EXAMPLE_FACTORY_H_
#define ASH_SHELL_EXAMPLE_FACTORY_H_
#pragma once
namespace app_list {
class AppListModel;
class AppListViewDelegate;
}
namespace views {
class View;
}
namespace ash {
namespace shell {
void CreatePointyBubble(views::View* anchor_view);
void CreateLockScreen();
// Creates a window showing samples of commonly used widgets.
void CreateWidgetsWindow();
void BuildAppListModel(app_list::AppListModel* model);
app_list::AppListViewDelegate* CreateAppListViewDelegate();
} // namespace shell
} // namespace ash
#endif // ASH_SHELL_EXAMPLE_FACTORY_H_
| // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_SHELL_EXAMPLE_FACTORY_H_
#define ASH_SHELL_EXAMPLE_FACTORY_H_
#pragma once
namespace app_list {
class AppListViewDelegate;
}
namespace views {
class View;
}
namespace ash {
namespace shell {
void CreatePointyBubble(views::View* anchor_view);
void CreateLockScreen();
// Creates a window showing samples of commonly used widgets.
void CreateWidgetsWindow();
app_list::AppListViewDelegate* CreateAppListViewDelegate();
} // namespace shell
} // namespace ash
#endif // ASH_SHELL_EXAMPLE_FACTORY_H_
| Remove unused declaration of BuildAppListModel() function. | ash: Remove unused declaration of BuildAppListModel() function.
[email protected]
[email protected]
Review URL: https://chromiumcodereview.appspot.com/10377097
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@136437 0039d316-1c4b-4281-b951-d872f2087c98
| C | bsd-3-clause | Jonekee/chromium.src,chuan9/chromium-crosswalk,ondra-novak/chromium.src,mogoweb/chromium-crosswalk,ChromiumWebApps/chromium,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,M4sse/chromium.src,junmin-zhu/chromium-rivertrail,dednal/chromium.src,anirudhSK/chromium,Jonekee/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,robclark/chromium,nacl-webkit/chrome_deps,hujiajie/pa-chromium,mogoweb/chromium-crosswalk,littlstar/chromium.src,dushu1203/chromium.src,axinging/chromium-crosswalk,anirudhSK/chromium,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,Jonekee/chromium.src,dushu1203/chromium.src,timopulkkinen/BubbleFish,bright-sparks/chromium-spacewalk,timopulkkinen/BubbleFish,keishi/chromium,keishi/chromium,anirudhSK/chromium,Jonekee/chromium.src,timopulkkinen/BubbleFish,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,jaruba/chromium.src,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,nacl-webkit/chrome_deps,nacl-webkit/chrome_deps,anirudhSK/chromium,littlstar/chromium.src,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,patrickm/chromium.src,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,patrickm/chromium.src,Chilledheart/chromium,timopulkkinen/BubbleFish,zcbenz/cefode-chromium,axinging/chromium-crosswalk,timopulkkinen/BubbleFish,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,robclark/chromium,hujiajie/pa-chromium,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,fujunwei/chromium-crosswalk,keishi/chromium,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,ltilve/chromium,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,robclark/chromium,hujiajie/pa-chromium,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,dednal/chromium.src,markYoungH/chromium.src,ChromiumWebApps/chromium,keishi/chromium,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,timopulkkinen/BubbleFish,markYoungH/chromium.src,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,robclark/chromium,ChromiumWebApps/chromium,axinging/chromium-crosswalk,Just-D/chromium-1,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,anirudhSK/chromium,krieger-od/nwjs_chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk,ltilve/chromium,zcbenz/cefode-chromium,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,junmin-zhu/chromium-rivertrail,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,keishi/chromium,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,ChromiumWebApps/chromium,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,chuan9/chromium-crosswalk,dednal/chromium.src,Pluto-tv/chromium-crosswalk,robclark/chromium,M4sse/chromium.src,dednal/chromium.src,littlstar/chromium.src,littlstar/chromium.src,hgl888/chromium-crosswalk,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,Jonekee/chromium.src,markYoungH/chromium.src,keishi/chromium,Pluto-tv/chromium-crosswalk,nacl-webkit/chrome_deps,Just-D/chromium-1,littlstar/chromium.src,bright-sparks/chromium-spacewalk,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,dednal/chromium.src,anirudhSK/chromium,M4sse/chromium.src,keishi/chromium,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,zcbenz/cefode-chromium,dushu1203/chromium.src,Chilledheart/chromium,zcbenz/cefode-chromium,robclark/chromium,hujiajie/pa-chromium,M4sse/chromium.src,dushu1203/chromium.src,robclark/chromium,M4sse/chromium.src,nacl-webkit/chrome_deps,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,axinging/chromium-crosswalk,keishi/chromium,littlstar/chromium.src,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,robclark/chromium,jaruba/chromium.src,M4sse/chromium.src,junmin-zhu/chromium-rivertrail,dednal/chromium.src,dushu1203/chromium.src,mogoweb/chromium-crosswalk,ChromiumWebApps/chromium,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,jaruba/chromium.src,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,Just-D/chromium-1,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,mogoweb/chromium-crosswalk,ltilve/chromium,littlstar/chromium.src,zcbenz/cefode-chromium,M4sse/chromium.src,nacl-webkit/chrome_deps,nacl-webkit/chrome_deps,chuan9/chromium-crosswalk,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,anirudhSK/chromium,chuan9/chromium-crosswalk,ondra-novak/chromium.src,Chilledheart/chromium,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,chuan9/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,ondra-novak/chromium.src,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,junmin-zhu/chromium-rivertrail,mogoweb/chromium-crosswalk,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,markYoungH/chromium.src,bright-sparks/chromium-spacewalk,M4sse/chromium.src,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,hujiajie/pa-chromium,krieger-od/nwjs_chromium.src,robclark/chromium,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,littlstar/chromium.src,ltilve/chromium,hujiajie/pa-chromium,ltilve/chromium,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,patrickm/chromium.src,keishi/chromium,dednal/chromium.src,Chilledheart/chromium,keishi/chromium,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,Just-D/chromium-1,ltilve/chromium,timopulkkinen/BubbleFish,Chilledheart/chromium,Fireblend/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,axinging/chromium-crosswalk,anirudhSK/chromium,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,dednal/chromium.src,patrickm/chromium.src,anirudhSK/chromium,keishi/chromium,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,Chilledheart/chromium,bright-sparks/chromium-spacewalk,robclark/chromium,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,zcbenz/cefode-chromium,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,junmin-zhu/chromium-rivertrail,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,Chilledheart/chromium,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,junmin-zhu/chromium-rivertrail,dednal/chromium.src,Just-D/chromium-1,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,Jonekee/chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,zcbenz/cefode-chromium,axinging/chromium-crosswalk,hujiajie/pa-chromium,ChromiumWebApps/chromium,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,ltilve/chromium,jaruba/chromium.src,ondra-novak/chromium.src,patrickm/chromium.src,patrickm/chromium.src,patrickm/chromium.src,patrickm/chromium.src,dushu1203/chromium.src,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,junmin-zhu/chromium-rivertrail,bright-sparks/chromium-spacewalk,timopulkkinen/BubbleFish,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,ltilve/chromium,Fireblend/chromium-crosswalk,jaruba/chromium.src,hgl888/chromium-crosswalk,anirudhSK/chromium,mogoweb/chromium-crosswalk |
053a858efa46c9ab86363b271374ec02ad2af753 | arch/powerpc/lib/code-patching.c | arch/powerpc/lib/code-patching.c | /*
* Copyright 2008 Michael Ellerman, IBM Corporation.
*
* 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.
*/
#include <linux/kernel.h>
#include <asm/code-patching.h>
void patch_instruction(unsigned int *addr, unsigned int instr)
{
*addr = instr;
asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr));
}
void patch_branch(unsigned int *addr, unsigned long target, int flags)
{
patch_instruction(addr, create_branch(addr, target, flags));
}
unsigned int create_branch(const unsigned int *addr,
unsigned long target, int flags)
{
unsigned int instruction;
if (! (flags & BRANCH_ABSOLUTE))
target = target - (unsigned long)addr;
/* Mask out the flags and target, so they don't step on each other. */
instruction = 0x48000000 | (flags & 0x3) | (target & 0x03FFFFFC);
return instruction;
}
| /*
* Copyright 2008 Michael Ellerman, IBM Corporation.
*
* 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.
*/
#include <linux/kernel.h>
#include <asm/code-patching.h>
void patch_instruction(unsigned int *addr, unsigned int instr)
{
*addr = instr;
asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr));
}
void patch_branch(unsigned int *addr, unsigned long target, int flags)
{
patch_instruction(addr, create_branch(addr, target, flags));
}
unsigned int create_branch(const unsigned int *addr,
unsigned long target, int flags)
{
unsigned int instruction;
long offset;
offset = target;
if (! (flags & BRANCH_ABSOLUTE))
offset = offset - (unsigned long)addr;
/* Check we can represent the target in the instruction format */
if (offset < -0x2000000 || offset > 0x1fffffc || offset & 0x3)
return 0;
/* Mask out the flags and target, so they don't step on each other. */
instruction = 0x48000000 | (flags & 0x3) | (offset & 0x03FFFFFC);
return instruction;
}
| Make create_branch() return errors if the branch target is too large | powerpc: Make create_branch() return errors if the branch target is too large
If you pass a target value to create_branch() which is more than 32MB - 4,
or - 32MB away from the branch site, then it's impossible to create an
immediate branch. The current code doesn't check, which will lead to us
creating a branch to somewhere else - which is bad.
For code that cares to check we return 0, which is easy to check for, and
for code that doesn't at least we'll be creating an illegal instruction,
rather than a branch to some random address.
Signed-off-by: Michael Ellerman <[email protected]>
Acked-by: Kumar Gala <[email protected]>
Signed-off-by: Paul Mackerras <[email protected]>
| C | mit | KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs |
0a203a4ce1787acb49db6df8f5c064e9243db130 | arch/x86_64/kernel/bugs.c | arch/x86_64/kernel/bugs.c | /*
* arch/x86_64/kernel/bugs.c
*
* Copyright (C) 1994 Linus Torvalds
* Copyright (C) 2000 SuSE
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <asm/alternative.h>
#include <asm/processor.h>
void __init check_bugs(void)
{
identify_cpu(&boot_cpu_data);
mtrr_bp_init();
#if !defined(CONFIG_SMP)
printk("CPU: ");
print_cpu_info(&boot_cpu_data);
#endif
alternative_instructions();
}
| /*
* arch/x86_64/kernel/bugs.c
*
* Copyright (C) 1994 Linus Torvalds
* Copyright (C) 2000 SuSE
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <asm/alternative.h>
#include <asm/processor.h>
#include <asm/mtrr.h>
void __init check_bugs(void)
{
identify_cpu(&boot_cpu_data);
mtrr_bp_init();
#if !defined(CONFIG_SMP)
printk("CPU: ");
print_cpu_info(&boot_cpu_data);
#endif
alternative_instructions();
}
| Add asm/mtrr.h include for some builds | x86_64: Add asm/mtrr.h include for some builds
The earlier change to call the bp mtrr init from bugs.c broke
on some configurations due to missing includes. Noticed
by "Avuton Olrich" <[email protected]>
Signed-off-by: Andi Kleen <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
| C | apache-2.0 | TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs |
5f28897d2827a924b746c4d85e35cf85810b8951 | drivers/scsi/qla4xxx/ql4_version.h | drivers/scsi/qla4xxx/ql4_version.h | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.03.00-k7"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.03.00-k8"
| Update driver version to 5.03.00-k8 | [SCSI] qla4xxx: Update driver version to 5.03.00-k8
Signed-off-by: Vikas Chaudhary <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
| C | apache-2.0 | TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs |
faa2113220ccdab128891374df1cb50fb778be21 | fpsgame/gui/external_libraries/tinygettext.h | fpsgame/gui/external_libraries/tinygettext.h | /* Copyright (c) 2013 Wildfire Games
*
* 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.
*/
/*
* Bring in the TinyGettext header file.
*/
#ifndef INCLUDED_TINYGETTEXT
#define INCLUDED_TINYGETTEXT
#if MSC_VERSION
# pragma warning(push)
# pragma warning(disable:4251) // "class X needs to have dll-interface to be used by clients of class Y"
# pragma warning(disable:4800) // "forcing value to bool 'true' or 'false' (performance warning)"
#endif
#include <tinygettext/tinygettext.hpp>
#include <tinygettext/po_parser.hpp>
#include <tinygettext/log.hpp>
#if MSC_VERSION
# pragma warning(pop)
#endif
#endif // INCLUDED_TINYGETTEXT
| Bring in the TinyGettext header file. | Bring in the TinyGettext header file.
| C | mit | mrlitong/Game-Engine-Development-Usage,mrlitong/fpsgame,mrlitong/fpsgame,mrlitong/fpsgame |
|
5524470b2cc0a73bb3422b3bcb0749df8653f210 | ann.c | ann.c | #include <stdio.h>
#define INPUTS 3
#define HIDDEN 5
#define OUTPUTS 2
#define ROWS 5
typedef struct {
double input[HIDDEN][INPUTS];
double hidden[ROWS - 3][HIDDEN][HIDDEN];
double output[OUTPUTS][HIDDEN];
} Links;
typedef struct {
int input[INPUTS];
int hidden[ROWS - 3][HIDDEN];
int output[OUTPUTS];
} Neurons;
typedef struct {
Links weights;
Neurons values;
} ANN;
int main(void)
{
return 0;
}
| #include <stdio.h>
#define INPUTS 3
#define HIDDEN 5
#define OUTPUTS 2
#define ROWS 5
typedef struct {
double input[HIDDEN][INPUTS];
double hidden[ROWS - 3][HIDDEN][HIDDEN];
double output[OUTPUTS][HIDDEN];
} Links;
typedef struct {
int input[INPUTS];
int hidden[ROWS - 2][HIDDEN];
int output[OUTPUTS];
} Neurons;
typedef struct {
Links weights;
Neurons values;
} ANN;
int main(void)
{
return 0;
}
| Fix number of hidden rows in Neurons struct | Fix number of hidden rows in Neurons struct
| C | mit | tysonzero/c-ann |
24e67da465596d90e2af1865631fc2736c385e14 | mudlib/mud/home/Game/lib/action.c | mudlib/mud/home/Game/lib/action.c | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2013 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <kotaka/log.h>
#include <kotaka/paths.h>
#include <text/paths.h>
#include <thing/paths.h>
#include <type.h>
inherit "emit";
| /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2013 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <kotaka/log.h>
#include <kotaka/paths.h>
#include <text/paths.h>
#include <thing/paths.h>
#include <type.h>
| Make emit explicit inherit for now | Make emit explicit inherit for now
| C | agpl-3.0 | shentino/kotaka,shentino/kotaka,shentino/kotaka |
1ab47cc1ffa4acaf69f8f7e0ddb104874f74aaec | AutoPkgr/Utility/LGHTTPRequest.h | AutoPkgr/Utility/LGHTTPRequest.h | //
// LGHTTPRequest.h
// AutoPkgr
//
// Created by Eldon Ahrold on 8/9/14.
// Copyright 2014-2015 The Linde Group, 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>
@class LGHTTPCredential;
@interface LGHTTPRequest : NSObject
- (void)retrieveDistributionPoints:(LGHTTPCredential *)credential
reply:(void (^)(NSDictionary *distributionPoints, NSError *error))reply;
- (void)retrieveDistributionPoints:(LGHTTPCredential *)credential
redirect:(void (^)(NSString *redirect))redirect
reply:(void (^)(NSDictionary *distributionPoints, NSError *error))reply;
- (void)retrieveDistributionPoints2:(LGHTTPCredential *)credential
reply:(void (^)(NSDictionary *distributionPoints, NSError *error))reply;
@end
| //
// LGHTTPRequest.h
// AutoPkgr
//
// Created by Eldon Ahrold on 8/9/14.
// Copyright 2014-2015 The Linde Group, 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>
@class LGHTTPCredential;
@interface LGHTTPRequest : NSObject
- (void)retrieveDistributionPoints:(LGHTTPCredential *)credential
reply:(void (^)(NSDictionary *distributionPoints, NSError *error))reply;
- (void)retrieveDistributionPoints2:(LGHTTPCredential *)credential
reply:(void (^)(NSDictionary *distributionPoints, NSError *error))reply;
@end
| Remove unused method from header. | Remove unused method from header.
| C | apache-2.0 | ftiff/autopkgr,ftiff/autopkgr,lindegroup/autopkgr,lindegroup/autopkgr,ftiff/autopkgr,HyppHere/autopkgr,lindegroup/autopkgr,HyppHere/autopkgr,lindegroup/autopkgr,HyppHere/autopkgr,lindegroup/autopkgr |
43d3a4627e2db021b0195c101f69d2f61836313a | libswfdec/swfdec_file_reference_list.c | libswfdec/swfdec_file_reference_list.c | /* Swfdec
* Copyright (C) 2007 Pekka Lampila <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "swfdec_as_internal.h"
#include "swfdec_debug.h"
SWFDEC_AS_NATIVE (2205, 0, swfdec_file_reference_list_browse)
void
swfdec_file_reference_list_browse (SwfdecAsContext *cx, SwfdecAsObject *object,
guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
{
SWFDEC_STUB ("FileReference.browse");
}
| /* Swfdec
* Copyright (C) 2007 Pekka Lampila <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "swfdec_as_internal.h"
#include "swfdec_debug.h"
SWFDEC_AS_NATIVE (2205, 0, swfdec_file_reference_list_browse)
void
swfdec_file_reference_list_browse (SwfdecAsContext *cx, SwfdecAsObject *object,
guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
{
SWFDEC_STUB ("FileReferenceList.browse");
}
| Fix stub message having a wrong name | Fix stub message having a wrong name
| C | lgpl-2.1 | freedesktop-unofficial-mirror/swfdec__swfdec,freedesktop-unofficial-mirror/swfdec__swfdec,freedesktop-unofficial-mirror/swfdec__swfdec,mltframework/swfdec,mltframework/swfdec |
07d9b6ad059cc77b1e892cc6d992f9556a451362 | interpreter/apply.h | interpreter/apply.h | /*
* tré – Copyright (c) 2005–2007,2009,2012 Sven Michael Klose <[email protected]>
*/
#ifndef TRE_APPLY_H
#define TRE_APPLY_H
extern treptr function_arguments (treptr);
extern treptr trefuncall (treptr func, treptr args);
extern treptr trebuiltin_call_compiled (void * fun, treptr args);
extern bool trebuiltin_is_compiled_funcall (treptr);
extern treptr trefuncall_compiled (treptr func, treptr args, bool do_eval);
void treapply_init ();
#endif /* #ifndef TRE_APPLY_H */
| /*
* tré – Copyright (c) 2005–2007,2009,2012 Sven Michael Klose <[email protected]>
*/
#ifndef TRE_APPLY_H
#define TRE_APPLY_H
extern treptr function_arguments (treptr);
extern treptr trefuncall (treptr func, treptr args);
extern treptr trebuiltin_call_compiled (void * fun, treptr args);
extern bool trebuiltin_is_compiled_funcall (treptr);
extern bool trebuiltin_is_compiled_closure (treptr);
extern treptr trefuncall_compiled (treptr func, treptr args, bool do_eval);
void treapply_init ();
#endif /* #ifndef TRE_APPLY_H */
| Fix declarations for file-by-file compile. | Fix declarations for file-by-file compile.
| C | mit | SvenMichaelKlose/tre,SvenMichaelKlose/tre,SvenMichaelKlose/tre |
e63d952e927f0da8a29984f47a3c8d828f43d393 | src/api-mock.h | src/api-mock.h | #ifndef APIMOCK_H
#define APIMOCK_H
#include "core/server.h"
#include "core/exceptions.h"
#include "http/requestdata.h"
#endif | #ifndef APIMOCK_H
#define APIMOCK_H
#include "core/server.h"
#include "core/exceptions.h"
#include "http/requestdata.h"
#include "http/requestdata.h"
#include "http/statuscodes.h"
#endif | Include request data and status codes | Include request data and status codes
| C | mit | Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock |
c218da07d8d0178d66620c0778d846f439b85755 | cvrp/customer.h | cvrp/customer.h | #ifndef VRPSOLVER_CUSTOMER_H
#define VRPSOLVER_CUSTOMER_H
#include <utility>
namespace VrpSolver {
class Customer {
public:
Customer(std::size_t id, std::size_t demand)
: id_(id), demand_(demand), vertex_(std::make_pair(0, 0))
{ }
Customer(std::size_t id, std::size_t demand, std::pair<int, int> vertex)
: id_(id), demand_(demand), vertex_(vertex)
{ }
Customer(std::size_t id, std::size_t demand, int x, int y)
: id_(id), demand_(demand), vertex_(std::make_pair(x, y))
{ }
std::size_t id() const {
return id_;
}
std::size_t demand() const {
return demand_;
}
void demand(std::size_t demand) {
demand_ = demand;
}
int x() const {
return vertex_.first;
}
void x(int x) {
vertex_.first = x;
}
int y() const {
return vertex_.second;
}
void y(int y) {
vertex_.second = y;
}
private:
std::size_t id_;
std::size_t demand_;
std::pair<int, int> vertex_;
};
} // namespace VrpSolver
#endif // VRPSOLVER_CUSTOMER_H
| #ifndef VRPSOLVER_CUSTOMER_H
#define VRPSOLVER_CUSTOMER_H
#include <utility>
namespace VrpSolver {
class Customer {
public:
Customer(std::size_t id, std::size_t demand)
: id_(id), demand_(demand), vertex_(std::make_pair(0, 0))
{ }
Customer(std::size_t id, std::size_t demand, std::pair<int, int> vertex)
: id_(id), demand_(demand), vertex_(vertex)
{ }
Customer(std::size_t id, std::size_t demand, int x, int y)
: id_(id), demand_(demand), vertex_(std::make_pair(x, y))
{ }
std::size_t id() const {
return id_;
}
std::size_t demand() const {
return demand_;
}
void demand(std::size_t demand) {
demand_ = demand;
}
int x() const {
return vertex_.first;
}
void x(int x) {
vertex_.first = x;
}
int y() const {
return vertex_.second;
}
void y(int y) {
vertex_.second = y;
}
bool operator==(const Customer &c) const {
return id_ == c.id_;
}
bool operator!=(const Customer &c) const {
return !(*this == c);
}
private:
std::size_t id_;
std::size_t demand_;
std::pair<int, int> vertex_;
};
} // namespace VrpSolver
#endif // VRPSOLVER_CUSTOMER_H
| Add operator== and != to Customer class | Add operator== and != to Customer class
顧客の同値性は顧客番号のみに依存するようにした
顧客番号は同じだが、需要や座標が異なる顧客は存在しないと
考えたからである.
| C | mit | U-MA/cvrp,U-MA/cvrp |
2ae3a03e0b8085434177658c7b880f2aa58e0368 | grantlee_core_library/template.h | grantlee_core_library/template.h | /*
Copyright (c) 2009 Stephen Kelly <[email protected]>
*/
#ifndef TEMPLATE_H
#define TEMPLATE_H
#include "context.h"
#include "node.h"
#include "grantlee_export.h"
class GRANTLEE_EXPORT Template //: public QObject
{
// Q_OBJECT
public:
Template(const QString &templateString, QStringList dirs );
QString render( Context *c );
NodeList nodeList();
// TODO: Remove this. ??
void setNodeList(const NodeList &list);
private:
void parse();
NodeList compileString(const QString &str);
QStringList m_pluginDirs;
NodeList m_nodelist;
};
class GRANTLEE_EXPORT TemplateLoader
{
public:
static TemplateLoader* instance();
void setTemplateDirs(const QStringList &dirs);
void setPluginDirs(const QStringList &dirs);
void setTheme(const QString &themeName);
void injectTemplate(const QString &name, const QString &content);
Template loadFromString(const QString &content);
Template loadByName(const QString &name);
TemplateLoader();
private:
Template loadFromFile(const QString &fileName);
QString m_themeName;
QStringList m_templateDirs;
QStringList m_pluginDirs;
static TemplateLoader* m_instance;
QHash<QString, QString> m_namedTemplates;
};
#endif
| /*
Copyright (c) 2009 Stephen Kelly <[email protected]>
*/
#ifndef TEMPLATE_H
#define TEMPLATE_H
#include "context.h"
#include "node.h"
#include "grantlee_export.h"
class GRANTLEE_EXPORT Template //: public QObject
{
// Q_OBJECT
public:
Template(const QString &templateString, QStringList dirs );
QString render( Context *c );
NodeList nodeList();
// TODO: Remove this. ??
void setNodeList(const NodeList &list);
private:
void parse();
NodeList compileString(const QString &str);
QStringList m_pluginDirs;
NodeList m_nodelist;
};
class GRANTLEE_EXPORT TemplateLoader
{
public:
static TemplateLoader* instance();
void setTemplateDirs(const QStringList &dirs);
void setPluginDirs(const QStringList &dirs);
void setTheme(const QString &themeName);
void injectTemplate(const QString &name, const QString &content);
Template loadFromString(const QString &content);
Template loadByName(const QString &name);
private:
TemplateLoader();
Template loadFromFile(const QString &fileName);
QString m_themeName;
QStringList m_templateDirs;
QStringList m_pluginDirs;
static TemplateLoader* m_instance;
QHash<QString, QString> m_namedTemplates;
};
#endif
| Make the TemplateLoader constructor private for the Singleton pattern. | Make the TemplateLoader constructor private for the Singleton pattern.
| C | lgpl-2.1 | simonwagner/grantlee,simonwagner/grantlee,simonwagner/grantlee,simonwagner/grantlee,cutelyst/grantlee,cutelyst/grantlee,cutelyst/grantlee,cutelyst/grantlee,simonwagner/grantlee,cutelyst/grantlee,simonwagner/grantlee |
a506cf5cc7fe032824c0f52fde755a497749f9aa | test/Driver/ios-version-min.c | test/Driver/ios-version-min.c | // REQUIRES: x86-registered-target
// REQUIRES: arm-registered-target
// RUN: %clang -target i386-apple-darwin10 -miphonesimulator-version-min=7.0 -arch i386 -S -o - %s | FileCheck %s
// RUN: %clang -target i386-apple-darwin10 -miphoneos-version-min=7.0 -arch armv7s -S -o - %s | FileCheck %s
int main() { return 0; }
// CHECK: .ios_version_min 7, 0
| // REQUIRES: x86-registered-target
// REQUIRES: arm-registered-target
// RUN: %clang -target i386-apple-darwin10 -miphonesimulator-version-min=7.0 -arch i386 -S -o - %s | FileCheck %s
// RUN: %clang -target armv7s-apple-darwin10 -miphoneos-version-min=7.0 -arch armv7s -S -o - %s | FileCheck %s
int main() { return 0; }
// CHECK: .ios_version_min 7, 0
| Fix the test added in r240710. | Fix the test added in r240710.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@240718 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
f1dc24d53e9e91cf795f05751eeb7e220c7c15e1 | include/asm-arm/arch-ebsa110/uncompress.h | include/asm-arm/arch-ebsa110/uncompress.h | /*
* linux/include/asm-arm/arch-ebsa110/uncompress.h
*
* Copyright (C) 1996,1997,1998 Russell King
*
* 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/serial_reg.h>
#define SERIAL_BASE ((unsigned char *)0xfe000be0)
/*
* This does not append a newline
*/
static inline void putc(int c)
{
unsigned char v, *base = SERIAL_BASE;
do {
v = base[UART_LSR << 2];
barrier();
} while (!(v & UART_LSR_THRE));
base[UART_TX << 2] = c;
}
static inline void flush(void)
{
unsigned char v, *base = SERIAL_BASE;
do {
v = base[UART_LSR << 2];
barrier();
} while ((v & (UART_LSR_TEMT|UART_LSR_THRE)) !=
(UART_LSR_TEMT|UART_LSR_THRE));
}
/*
* nothing to do
*/
#define arch_decomp_setup()
#define arch_decomp_wdog()
| /*
* linux/include/asm-arm/arch-ebsa110/uncompress.h
*
* Copyright (C) 1996,1997,1998 Russell King
*
* 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/serial_reg.h>
#define SERIAL_BASE ((unsigned char *)0xf0000be0)
/*
* This does not append a newline
*/
static inline void putc(int c)
{
unsigned char v, *base = SERIAL_BASE;
do {
v = base[UART_LSR << 2];
barrier();
} while (!(v & UART_LSR_THRE));
base[UART_TX << 2] = c;
}
static inline void flush(void)
{
unsigned char v, *base = SERIAL_BASE;
do {
v = base[UART_LSR << 2];
barrier();
} while ((v & (UART_LSR_TEMT|UART_LSR_THRE)) !=
(UART_LSR_TEMT|UART_LSR_THRE));
}
/*
* nothing to do
*/
#define arch_decomp_setup()
#define arch_decomp_wdog()
| Fix incorrect serial port address | [ARM] ebsa110: Fix incorrect serial port address
Signed-off-by: Russell King <[email protected]>
| C | mit | KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs |
fe82904d985794cb4e3b2704ffe472fe503c6ea4 | testmud/mud/home/Test/initd.c | testmud/mud/home/Test/initd.c | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <kotaka/log.h>
#include <kotaka/paths.h>
inherit LIB_INITD;
static void create()
{
LOGD->post_message("test", LOG_DEBUG, "Test subsystem loaded");
}
| /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <kotaka/log.h>
#include <kotaka/paths.h>
inherit LIB_INITD;
inherit UTILITY_COMPILE;
static void create()
{
LOGD->post_message("test", LOG_DEBUG, "Test subsystem loading...");
load_dir("obj", 1);
load_dir("sys", 1);
LOGD->post_message("test", LOG_DEBUG, "Test subsystem loaded");
}
| Make test subsystem load itself properly | Make test subsystem load itself properly
| C | agpl-3.0 | shentino/kotaka,shentino/kotaka,shentino/kotaka |
36d330152027f18e2bca73c5ad74d2e5a2c2b7a3 | test2/bitfields/anon_struct.c | test2/bitfields/anon_struct.c | // RUN: %ocheck 0 %s
struct bit
{
int bit : 1;
};
struct bits
{
struct bit; // `second' is not packed into this
unsigned second : 1;
};
main()
{
struct bits bs;
bs.bit = 1;
bs.second = 1;
if(0[(int *)&bs] != 1)
return 1;
if(1[(int *)&bs] != 1) // ensure it's packed to an int spacing
return 1;
return 0;
}
| Test for bitfields separated by an anonymous struct | Test for bitfields separated by an anonymous struct
| C | mit | 8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler,8l/ucc-c-compiler |
|
a17484601e97ba856c8130d2d98a7055c0fd5f8c | src/Core/Command/CommandFactory.h | src/Core/Command/CommandFactory.h | /*
For more information, please see: http://software.sci.utah.edu
The MIT License
Copyright (c) 2012 Scientific Computing and Imaging Institute,
University of Utah.
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 CORE_COMMAND_COMMANDFACTORY_H
#define CORE_COMMAND_COMMANDFACTORY_H
#include <Core/Command/Share.h>
namespace SCIRun
{
namespace Core
{
namespace GlobalCommands
{
class GlobalCommand;
enum Commands;
class SCISHARE CommandFactory
{
public:
virtual ~CommandFactory();
virtual GlobalCommand* create(Commands command) = 0;
};
}
}
}
#endif
| /*
For more information, please see: http://software.sci.utah.edu
The MIT License
Copyright (c) 2012 Scientific Computing and Imaging Institute,
University of Utah.
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 CORE_COMMAND_COMMANDFACTORY_H
#define CORE_COMMAND_COMMANDFACTORY_H
#include <Core/Command/Command.h>
#include <Core/Command/Share.h>
namespace SCIRun
{
namespace Core
{
namespace GlobalCommands
{
class GlobalCommand;
class SCISHARE CommandFactory
{
public:
virtual ~CommandFactory();
virtual GlobalCommand* create(Commands command) = 0;
};
}
}
}
#endif
| Remove nonstandard enum forward decl. | Remove nonstandard enum forward decl.
| C | mit | moritzdannhauer/SCIRunGUIPrototype,jcollfont/SCIRun,collint8/SCIRun,ajanson/SCIRun,jessdtate/SCIRun,collint8/SCIRun,jcollfont/SCIRun,jcollfont/SCIRun,collint8/SCIRun,ajanson/SCIRun,jessdtate/SCIRun,jessdtate/SCIRun,jcollfont/SCIRun,jcollfont/SCIRun,moritzdannhauer/SCIRunGUIPrototype,moritzdannhauer/SCIRunGUIPrototype,collint8/SCIRun,collint8/SCIRun,moritzdannhauer/SCIRunGUIPrototype,ajanson/SCIRun,ajanson/SCIRun,jessdtate/SCIRun,ajanson/SCIRun,ajanson/SCIRun,jessdtate/SCIRun,collint8/SCIRun,jessdtate/SCIRun,moritzdannhauer/SCIRunGUIPrototype,collint8/SCIRun,jessdtate/SCIRun,jcollfont/SCIRun,moritzdannhauer/SCIRunGUIPrototype,jcollfont/SCIRun,moritzdannhauer/SCIRunGUIPrototype,ajanson/SCIRun,collint8/SCIRun,jessdtate/SCIRun |
c5238e0a4c6751f7c0965cea1e17fa3e1437402d | example/ex-algo03.c | example/ex-algo03.c | #include "m-dict.h"
#include "m-array.h"
#include "m-algo.h"
#include "m-string.h"
DICT_DEF2(dict, string_t, int)
#define M_OPL_dict_t() DICT_OPLIST(dict, STRING_OPLIST, M_DEFAULT_OPLIST)
ARRAY_DEF(vector_int, int)
#define M_OPL_vector_int_t() ARRAY_OPLIST(vector_int)
#define start_with(pattern, item) \
string_start_with_str_p((item).key, (pattern))
#define get_value(out, item) ((out) = (item).value)
int main(void)
{
int s;
M_LET(keys, vector_int_t)
M_LET( (m, (STRING_CTE("foo"), 1), (STRING_CTE("bar"), 42), (STRING_CTE("bluez"), 7), (STRING_CTE("stop"), 789) ), tmp, dict_t) {
/* Extract all elements of 'm' that starts with 'b' */
ALGO_EXTRACT(tmp, dict_t, m, dict_t, start_with, "b");
/* Extract the values of theses elements */
ALGO_TRANSFORM(keys, vector_int_t, tmp, dict_t, get_value);
/* Sum theses values */
ALGO_REDUCE(s, keys, vector_int_t, sum);
printf("Sum of elements starting with 'b' is: %d\n", s);
}
return 0;
}
| Add new example for algorithm | Add new example for algorithm
| C | bsd-2-clause | P-p-H-d/mlib,P-p-H-d/mlib |
|
f57b70c85808c0946e63d87f7947fb12d60fe23a | ext/pdfium_ruby/pdfium_ruby.h | ext/pdfium_ruby/pdfium_ruby.h | extern "C" {
#include "ruby.h"
}
void Define_Document();
void Define_Page();
void Define_PageSet();
| #ifndef __PDFIUM_RUBY_H__
#define __PDFIUM_RUBY_H__
extern "C" {
#include "ruby.h"
}
// Inspired by https://github.com/jasonroelofs/rice/blob/1740a6d12c99fce8c21eda3c5385738318ab9172/rice/detail/ruby.hpp#L33-L37
// Casts C functions into a type that C++ is happy calling
extern "C" typedef VALUE (*CPP_RUBY_METHOD_FUNC)(ANYARGS);
void Define_Document();
void Define_Page();
void Define_PageSet();
#endif | Create a type to cast Ruby's C functions to a thing C++ is happy with. | Create a type to cast Ruby's C functions to a thing C++ is happy with. | C | mit | documentcloud/pdfshaver,documentcloud/pdfshaver,documentcloud/pdfshaver |
9d0b2a96595333aef5c4dd7ab0f15d9c663aee2a | test2/casts/rm_qual.c | test2/casts/rm_qual.c | // RUN: %check %s
struct A
{
int i;
};
int f(const void *p)
{
struct A *a = p; // CHECK: warning: implicit cast removes qualifiers (const)
struct A *b = (struct A *)p; // CHECK: !/warning:.*cast removes qualifiers/
(void)a;
(void)b;
}
| // RUN: %check %s
struct A
{
int i;
};
void take(void *);
int f(const void *p)
{
struct A *a = p; // CHECK: warning: implicit cast removes qualifiers (const)
struct A *b = (struct A *)p; // CHECK: !/warning:.*cast removes qualifiers/
(void)a;
(void)b;
const char c = 5;
take(&c); // CHECK: warning: implicit cast removes qualifiers (const)
}
| Add another case to qualifier-removal test | Add another case to qualifier-removal test
| C | mit | bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler |
1de801a7120e0e8a2c7614265880452a20a38a29 | test/Driver/clang-g-opts.c | test/Driver/clang-g-opts.c | // RUN: %clang -S -v -o %t %s 2>&1 | not grep -w -- -g
// RUN: %clang -S -v -o %t %s -g 2>&1 | grep -w -- -g
// RUN: %clang -S -v -o %t %s -g0 2>&1 | not grep -w -- -g
// RUN: %clang -S -v -o %t %s -g -g0 2>&1 | not grep -w -- -g
// RUN: %clang -S -v -o %t %s -g0 -g 2>&1 | grep -w -- -g
| // RUN: %clang -S -v -o %t %s 2>&1 | FileCheck %s
// CHECK-NOT: -g
// RUN: %clang -S -v -o %t %s -g 2>&1 | FileCheck %s
// CHECK: -g
// RUN: %clang -S -v -o %t %s -g0 2>&1 | FileCheck %s
// CHECK-NOT: -g
// RUN: %clang -S -v -o %t %s -g -g0 2>&1 | FileCheck %s
// CHECK-NOT: -g
// RUN: %clang -S -v -o %t %s -g0 -g 2>&1 | FileCheck %s
// CHECK: -g
| Move a non portable test to FileCheck, from Jonathan Gray! | Move a non portable test to FileCheck, from Jonathan Gray!
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@155874 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang |
db7023ad3ced3ca487f1b197c01d67341fa3de95 | mudlib/mud/home/Game/sys/verb/ooc/dgd.c | mudlib/mud/home/Game/sys/verb/ooc/dgd.c | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <kotaka/paths.h>
#include <account/paths.h>
#include <game/paths.h>
#include <text/paths.h>
#include <text/parse.h>
inherit LIB_RAWVERB;
void main(object actor, string args)
{
string name;
if (query_user()->query_class() < 2) {
send_out("You have insufficient access to post on the DGD channel.\n");
return;
}
name = query_user()->query_name();
CHANNELD->post_message("dgd", name, args);
}
| Add command to use it | Add command to use it
| C | agpl-3.0 | shentino/kotaka,shentino/kotaka,shentino/kotaka |
|
183498dc7eee80c5bc80262588e7675959400a26 | include/slang/util/Enum.h | include/slang/util/Enum.h | //------------------------------------------------------------------------------
// Enum.h
// Various enum utilities.
//
// File is under the MIT license; see LICENSE for details.
//------------------------------------------------------------------------------
#pragma once
#define UTIL_ENUM_ELEMENT(x) x,
#define UTIL_ENUM_STRING(x) #x,
#define ENUM(name, elements) \
enum class name { elements(UTIL_ENUM_ELEMENT) }; \
inline string_view toString(name e) { \
static const char* strings[] = { elements(UTIL_ENUM_STRING) }; \
return strings[static_cast<std::underlying_type_t<name>>(e)]; \
} \
inline std::ostream& operator<<(std::ostream& os, name e) { return os << toString(e); }
#define ENUM_MEMBER(name, elements) \
enum name { elements(UTIL_ENUM_ELEMENT) }; \
friend string_view toString(name e) { \
static const char* strings[] = { elements(UTIL_ENUM_STRING) }; \
return strings[static_cast<std::underlying_type_t<name>>(e)]; \
} | //------------------------------------------------------------------------------
// Enum.h
// Various enum utilities.
//
// File is under the MIT license; see LICENSE for details.
//------------------------------------------------------------------------------
#pragma once
#define UTIL_ENUM_ELEMENT(x) x,
#define UTIL_ENUM_STRING(x) #x,
#define ENUM(name, elements) \
enum class name { elements(UTIL_ENUM_ELEMENT) }; \
inline string_view toString(name e) { \
static const char* strings[] = { elements(UTIL_ENUM_STRING) }; \
return strings[static_cast<std::underlying_type_t<name>>(e)]; \
} \
inline std::ostream& operator<<(std::ostream& os, name e) { return os << toString(e); }
#define ENUM_MEMBER(name, elements) \
enum name { elements(UTIL_ENUM_ELEMENT) }; \
friend string_view toString(name e) { \
static const char* strings[] = { elements(UTIL_ENUM_STRING) }; \
return strings[static_cast<std::underlying_type_t<name>>(e)]; \
}
| Work around more GCC nonsense | Work around more GCC nonsense
| C | mit | MikePopoloski/slang,MikePopoloski/slang |
281bb6d66dd267368ce2bcb235b8aae24dfc17df | include/gpu/gl/SkMesaGLContext.h | include/gpu/gl/SkMesaGLContext.h |
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkMesaGLContext_DEFINED
#define SkMesaGLContext_DEFINED
#include "SkGLContext.h"
#if SK_MESA
class SkMesaGLContext : public SkGLContext {
private:
typedef intptr_t Context;
public:
SkMesaGLContext();
virtual ~SkMesaGLContext();
virtual void makeCurrent() const SK_OVERRIDE;
class AutoContextRestore {
public:
AutoContextRestore();
~AutoContextRestore();
private:
Context fOldContext;
GLint fOldWidth;
GLint fOldHeight;
GLint fOldFormat;
void* fOldImage;
};
protected:
virtual const GrGLInterface* createGLContext() SK_OVERRIDE;
virtual void destroyGLContext() SK_OVERRIDE;
private:
Context fContext;
GrGLubyte *fImage;
};
#endif
#endif
|
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkMesaGLContext_DEFINED
#define SkMesaGLContext_DEFINED
#include "SkGLContext.h"
#if SK_MESA
class SkMesaGLContext : public SkGLContext {
private:
typedef intptr_t Context;
public:
SkMesaGLContext();
virtual ~SkMesaGLContext();
virtual void makeCurrent() const SK_OVERRIDE;
class AutoContextRestore {
public:
AutoContextRestore();
~AutoContextRestore();
private:
Context fOldContext;
GrGLint fOldWidth;
GrGLint fOldHeight;
GrGLint fOldFormat;
void* fOldImage;
};
protected:
virtual const GrGLInterface* createGLContext() SK_OVERRIDE;
virtual void destroyGLContext() SK_OVERRIDE;
private:
Context fContext;
GrGLubyte *fImage;
};
#endif
#endif
| Fix undefined GLint in Mac builds | Fix undefined GLint in Mac builds
git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@3736 2bbb7eff-a529-9590-31e7-b0007b416f81
| C | bsd-3-clause | metajack/skia,Cue/skia,Cue/skia,Cue/skia,Cue/skia,metajack/skia,mrobinson/skia,metajack/skia,metajack/skia,mrobinson/skia,mrobinson/skia,mrobinson/skia,mrobinson/skia |
d2a0f73278eca431ec8af9e28ebf3f534c325b8e | include/error.h | include/error.h | #ifndef CPR_ERROR_H
#define CPR_ERROR_H
#include <string>
#include "cprtypes.h"
#include "defines.h"
namespace cpr {
enum class ErrorCode {
OK = 0,
CONNECTION_FAILURE,
EMPTY_RESPONSE,
HOST_RESOLUTION_FAILURE,
INTERNAL_ERROR,
INVALID_URL_FORMAT,
NETWORK_RECEIVE_ERROR,
NETWORK_SEND_FAILURE,
OPERATION_TIMEDOUT,
PROXY_RESOLUTION_FAILURE,
SSL_CONNECT_ERROR,
SSL_LOCAL_CERTIFICATE_ERROR,
SSL_REMOTE_CERTIFICATE_ERROR,
SSL_CACERT_ERROR,
GENERIC_SSL_ERROR,
UNSUPPORTED_PROTOCOL,
UNKNOWN_ERROR = 1000,
};
class Error {
public:
Error() : code{ErrorCode::OK} {}
template <typename TextType>
Error(const ErrorCode& p_error_code, TextType&& p_error_message)
: code{p_error_code}, message{CPR_FWD(p_error_message)} {}
explicit operator bool() const {
return code != ErrorCode::OK;
}
ErrorCode code;
std::string message;
static ErrorCode getErrorCodeForCurlError(int curl_code);
};
} // namespace cpr
#endif
| #ifndef CPR_ERROR_H
#define CPR_ERROR_H
#include <string>
#include "cprtypes.h"
#include "defines.h"
namespace cpr {
enum class ErrorCode {
OK = 0,
CONNECTION_FAILURE,
EMPTY_RESPONSE,
HOST_RESOLUTION_FAILURE,
INTERNAL_ERROR,
INVALID_URL_FORMAT,
NETWORK_RECEIVE_ERROR,
NETWORK_SEND_FAILURE,
OPERATION_TIMEDOUT,
PROXY_RESOLUTION_FAILURE,
SSL_CONNECT_ERROR,
SSL_LOCAL_CERTIFICATE_ERROR,
SSL_REMOTE_CERTIFICATE_ERROR,
SSL_CACERT_ERROR,
GENERIC_SSL_ERROR,
UNSUPPORTED_PROTOCOL,
UNKNOWN_ERROR = 1000,
};
class Error {
public:
Error() : code{ErrorCode::OK} {}
template <typename TextType>
Error(const ErrorCode& p_error_code, TextType&& p_error_message)
: code{p_error_code}, message{CPR_FWD(p_error_message)} {}
explicit operator bool() const {
return code != ErrorCode::OK;
}
ErrorCode code;
std::string message;
private:
static ErrorCode getErrorCodeForCurlError(int curl_code);
};
} // namespace cpr
#endif
| Make static member method private | Make static member method private
| C | mit | msuvajac/cpr,whoshuu/cpr,whoshuu/cpr,msuvajac/cpr,SuperV1234/cpr,SuperV1234/cpr,msuvajac/cpr,whoshuu/cpr,SuperV1234/cpr |
35568f5347922fbd26b25b9a3c13b4a1dbfda1f5 | ios/RNInstabugSDK.h | ios/RNInstabugSDK.h | //
// RNInstabugSDK.h
// RNInstabugSDK
//
// Created by Mark Miyashita on 10/11/16.
// Copyright © 2016 Mark Miyashita. All rights reserved.
//
#import "RCTBridgeModule.h"
#import "RCTConvert.h"
#import "RCTUtils.h"
@interface RNInstabugSDK : NSObject <RCTBridgeModule>
@end
| //
// RNInstabugSDK.h
// RNInstabugSDK
//
// Created by Mark Miyashita on 10/11/16.
// Copyright © 2016 Mark Miyashita. All rights reserved.
//
#if __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"
#import "RCTConvert.h"
#import "RCTUtils.h"
#else
#import "React/RCTBridgeModule.h"
#import "React/RCTConvert.h"
#import "React/RCTUtils.h"
#endif
@interface RNInstabugSDK : NSObject <RCTBridgeModule>
@end
| Update import style to add RN 40.0+ compatibility | Update import style to add RN 40.0+ compatibility
| C | mit | negativetwelve/react-native-instabug-sdk,negativetwelve/react-native-instabug-sdk,negativetwelve/react-native-instabug-sdk |
402993af266c289f2003b2c02f74a25a9375d48b | cmd/built_in.c | cmd/built_in.c | #include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "cmd.h"
void sh_exit() {
exit(0);
}
void sh_pid() {
printf("%d\n", getpid());
}
void sh_ppid() {
printf("%d\n", getppid());
}
void sh_cd(cmd_args_t args) {
char* dir;
if (args.size == 1) {
dir = getenv("HOME");
} else {
dir = args.args[1];
}
chdir(dir);
}
void sh_pwd() {
char* cwd = getcwd(NULL, 0);
printf("%s\n", cwd);
free(cwd);
}
void sh_set(cmd_args_t args) {
setenv(args.args[0], args.args[1], true);
}
void sh_get(cmd_args_t args) {
char* val = getenv(args.args[0]);
if (val == NULL) {
printf("(NULL)\n");
} else {
printf("%s\n", val);
}
}
| #include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "cmd.h"
void sh_exit() {
exit(0);
}
void sh_pid() {
printf("%d\n", getpid());
}
void sh_ppid() {
printf("%d\n", getppid());
}
void sh_cd(cmd_args_t args) {
char* dir;
if (args.size == 1) {
dir = getenv("HOME");
} else {
dir = args.args[1];
}
chdir(dir);
}
void sh_pwd() {
char* cwd = getcwd(NULL, 0);
printf("%s\n", cwd);
free(cwd);
}
void sh_set(cmd_args_t args) {
setenv(args.args[1], args.args[2], true);
}
void sh_get(cmd_args_t args) {
char* val = getenv(args.args[1]);
if (val == NULL) {
printf("(NULL)\n");
} else {
printf("%s\n", val);
}
}
| Fix issue in options index. | Fix issue in options index.
| C | mit | dgriffen/308-shell |
e2ca3c802f97b5ee52f1d15d0e43097a5bef6187 | src/OVAL/probes/unix/linux/rpm-helper.c | src/OVAL/probes/unix/linux/rpm-helper.c | /*
* Copyright 2016 Red Hat Inc., Durham, North Carolina.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "rpm-helper.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
int rpmErrorCb (rpmlogRec rec, rpmlogCallbackData data)
{
dE("RPM: %s", rpmlogRecMessage(rec));
return RPMLOG_EXIT; // don't perform default logging
void rpmLibsPreload()
{
rpmReadConfigFiles(NULL, NULL);
}
| /*
* Copyright 2016 Red Hat Inc., Durham, North Carolina.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "rpm-helper.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
int rpmErrorCb (rpmlogRec rec, rpmlogCallbackData data)
{
dE("RPM: %s", rpmlogRecMessage(rec));
return RPMLOG_DEFAULT;
}
void rpmLibsPreload()
{
rpmReadConfigFiles(NULL, NULL);
}
| Fix erro cb return value | probes/rpm: Fix erro cb return value
We have to use RPMLOG_DEFAULT, because RPMLOG_EXIT
cause exit of whole probe.
| C | lgpl-2.1 | redhatrises/openscap,OpenSCAP/openscap,mpreisler/openscap,jan-cerny/openscap,mpreisler/openscap,jan-cerny/openscap,ybznek/openscap,jan-cerny/openscap,ybznek/openscap,jan-cerny/openscap,OpenSCAP/openscap,Hexadorsimal/openscap,jan-cerny/openscap,OpenSCAP/openscap,ybznek/openscap,jan-cerny/openscap,Hexadorsimal/openscap,mpreisler/openscap,OpenSCAP/openscap,mpreisler/openscap,mpreisler/openscap,redhatrises/openscap,OpenSCAP/openscap,Hexadorsimal/openscap,Hexadorsimal/openscap,ybznek/openscap,Hexadorsimal/openscap,redhatrises/openscap,redhatrises/openscap,ybznek/openscap,OpenSCAP/openscap,Hexadorsimal/openscap,redhatrises/openscap,mpreisler/openscap,redhatrises/openscap,ybznek/openscap |
1f32a4a1cc5942bcc8d99f006ee20e54ca67e220 | include/utils.h | include/utils.h | /**
* utils.h
*
* Copyright (C) 2017 Nickolas Burr <[email protected]>
*/
#ifndef GIT_STASHD_UTILS_H
#define GIT_STASHD_UTILS_H
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "common.h"
#include "signals.h"
#ifdef __APPLE__
#include <limits.h>
#else
#include <linux/limits.h>
#endif
/**
* String utilities
*/
int compare(char *one, char *two);
char *concat(char *buf, char *str);
char *copy(char *buf, char *str);
/**
* Filesystem utilities
*/
DIR *get_dir(const char *path);
FILE *get_file(const char *filename, const char *filemode);
int is_dir(const char *path);
int is_file(const char *path);
int is_link(const char *path);
int is_sock(const char *path);
int is_fifo(const char *path);
int is_block(const char *path);
int is_char(const char *path);
/**
* Type utilities
*/
int is_null(void *ptr);
#endif /* GIT_STASHD_UTILS_H */
| /**
* utils.h
*
* Copyright (C) 2017 Nickolas Burr <[email protected]>
*/
#ifndef GIT_STASHD_UTILS_H
#define GIT_STASHD_UTILS_H
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "common.h"
#include "signals.h"
#ifdef __APPLE__
#include <limits.h>
#else
#include <linux/limits.h>
#endif
/**
* String utilities
*/
int compare(char *one, char *two);
char *concat(char *buf, char *str);
char *copy(char *buf, char *str);
/**
* Filesystem utilities
*/
DIR *get_dir(const char *path, int *error);
FILE *get_file(const char *filename, const char *filemode, int *error);
FILE *get_pipe(char *command, char *mode, int *error);
int is_dir(const char *path);
int is_file(const char *path);
int is_link(const char *path);
int is_sock(const char *path);
int is_fifo(const char *path);
int is_block(const char *path);
int is_char(const char *path);
/**
* Type utilities
*/
int is_null(void *ptr);
#endif /* GIT_STASHD_UTILS_H */
| Update get_dir, get_file decls, add get_pipe decl | Update get_dir, get_file decls, add get_pipe decl
| C | mit | nickolasburr/git-stashd,nickolasburr/git-stashd,nickolasburr/git-stashd |
fdf89bc553c5fe5f9900658e8526cd398165d2f3 | src/condor_includes/_condor_fix_types.h | src/condor_includes/_condor_fix_types.h | #ifndef FIX_TYPES_H
#define FIX_TYPES_H
#include <sys/types.h>
/*
The system include file defines this in terms of bzero(), but ANSI says
we should use memset().
*/
#if defined(OSF1)
#undef FD_ZERO
#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
#endif
/*
Various non-POSIX conforming files which depend on sys/types.h will
need these extra definitions...
*/
typedef unsigned int u_int;
#if defined(AIX32)
typedef unsigned short ushort;
#endif
#if defined(ULTRIX42) || defined(ULTRIX43)
typedef char * caddr_t;
#endif
#if defined(AIX32)
typedef unsigned long rlim_t;
#endif
#endif
| #ifndef FIX_TYPES_H
#define FIX_TYPES_H
// OSF/1 has this as an "unsigned long", but this is incorrect. It
// is used by lseek(), and must be able to hold negative values.
#if defined(OSF1)
#define off_t _hide_off_t
#endif
#include <sys/types.h>
#if defined(OSF1)
#undef off_t
typedef long off_t;
#endif
/*
The system include file defines this in terms of bzero(), but ANSI says
we should use memset().
*/
#if defined(OSF1)
#undef FD_ZERO
#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
#endif
/*
Various non-POSIX conforming files which depend on sys/types.h will
need these extra definitions...
*/
typedef unsigned int u_int;
#if defined(AIX32)
typedef unsigned short ushort;
#endif
#if defined(ULTRIX42) || defined(ULTRIX43)
typedef char * caddr_t;
#endif
#if defined(AIX32)
typedef unsigned long rlim_t;
#endif
#endif
| Fix up definition of off_t for DecAlpha OSF/1 v1.3. | Fix up definition of off_t for DecAlpha OSF/1 v1.3.
| C | apache-2.0 | bbockelm/condor-network-accounting,htcondor/htcondor,zhangzhehust/htcondor,djw8605/condor,htcondor/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,mambelli/osg-bosco-marco,djw8605/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,djw8605/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,djw8605/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,zhangzhehust/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,djw8605/condor,clalancette/condor-dcloud,neurodebian/htcondor,htcondor/htcondor,htcondor/htcondor,djw8605/condor,htcondor/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,neurodebian/htcondor,htcondor/htcondor,djw8605/condor,djw8605/condor,zhangzhehust/htcondor,htcondor/htcondor,neurodebian/htcondor,djw8605/htcondor,neurodebian/htcondor,htcondor/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,zhangzhehust/htcondor,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,djw8605/htcondor,djw8605/htcondor,djw8605/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,djw8605/condor,djw8605/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,djw8605/condor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/condor,djw8605/htcondor,zhangzhehust/htcondor |
ba541d36f6891892efc3f17773ff2395bb97df44 | test/CodeGen/x86_32-inline-asm.c | test/CodeGen/x86_32-inline-asm.c | // RUN: %clang_cc1 -triple i386-apple-darwin9 -verify %s
// <rdar://problem/12415959>
typedef unsigned int u_int32_t;
typedef u_int32_t uint32_t;
typedef unsigned long long u_int64_t;
typedef u_int64_t uint64_t;
int main () {
uint32_t msr = 0x8b;
uint64_t val = 0;
__asm__ volatile("wrmsr"
:
: "c" (msr),
"a" ((val & 0xFFFFFFFFUL)), // expected-error {{invalid input size for constraint 'a'}}
"d" (((val >> 32) & 0xFFFFFFFFUL)));
}
| // RUN: %clang_cc1 -triple i386-apple-darwin9 -verify %s
// <rdar://problem/12415959>
typedef unsigned int u_int32_t;
typedef u_int32_t uint32_t;
typedef unsigned long long u_int64_t;
typedef u_int64_t uint64_t;
int main () {
// Error out if size is > 32-bits.
uint32_t msr = 0x8b;
uint64_t val = 0;
__asm__ volatile("wrmsr"
:
: "c" (msr),
"a" ((val & 0xFFFFFFFFUL)), // expected-error {{invalid input size for constraint 'a'}}
"d" (((val >> 32) & 0xFFFFFFFFUL)));
// Don't error out if the size of the destination is <= 32 bits.
unsigned char data;
unsigned int port;
__asm__ volatile("outb %0, %w1" : : "a" (data), "Nd" (port)); // No error expected.
}
| Update testcase to show that we don't emit an error for sizes <= 32-bits. | Update testcase to show that we don't emit an error for sizes <= 32-bits.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@167748 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang |
3c62ef3d6cd198b345da0d0381b1145dfdb05cf1 | mod_uuid.c | mod_uuid.c | #include <uuid/uuid.h>
#include "httpd.h"
#include "http_config.h"
static int generate_uuid(request_rec *r)
{
char *uuid_str;
uuid_t uuid;
uuid_generate_random(uuid);
uuid_str = (char *)apr_palloc(r->pool, sizeof(char)*37);
uuid_unparse_lower(uuid, uuid_str);
apr_table_setn(r->subprocess_env, "UUID", uuid_str);
return DECLINED;
}
static void register_hooks(apr_pool_t *p)
{
ap_hook_post_read_request(generate_uuid, NULL, NULL, APR_HOOK_MIDDLE);
}
module AP_MODULE_DECLARE_DATA uuid_module = {
STANDARD20_MODULE_STUFF,
NULL, /* dir config creater */
NULL, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server configs */
NULL, /* command apr_table_t */
register_hooks /* register hooks */
};
| #include <uuid/uuid.h>
#include "httpd.h"
#include "http_config.h"
#include "http_protocol.h"
static int generate_uuid(request_rec *r)
{
char *uuid_str;
uuid_t uuid;
uuid_generate_random(uuid);
uuid_str = (char *)apr_palloc(r->pool, sizeof(char)*37);
uuid_unparse_lower(uuid, uuid_str);
apr_table_setn(r->subprocess_env, "UUID", uuid_str);
return DECLINED;
}
static void register_hooks(apr_pool_t *p)
{
ap_hook_post_read_request(generate_uuid, NULL, NULL, APR_HOOK_MIDDLE);
}
module AP_MODULE_DECLARE_DATA uuid_module = {
STANDARD20_MODULE_STUFF,
NULL, /* dir config creater */
NULL, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server configs */
NULL, /* command apr_table_t */
register_hooks /* register hooks */
};
| Add header file for ap_hook_post_read_request to suppress compiler warnings | Add header file for ap_hook_post_read_request to suppress compiler warnings
| C | apache-2.0 | tomg/mod_uuid |
8348847ba77a85167f591e7c97db6d205b0a3f62 | sassc.c | sassc.c | #include <stdio.h>
#include "libsass/sass_interface.h"
int main(int argc, char** argv)
{
int ret;
if (argc < 2) {
printf("Usage: sassc [INPUT FILE]\n");
return 0;
}
struct sass_file_context* ctx = sass_new_file_context();
ctx->options.include_paths = "";
ctx->options.image_path = "images";
ctx->options.output_style = SASS_STYLE_NESTED;
ctx->input_path = argv[1];
sass_compile_file(ctx);
if (ctx->error_status) {
if (ctx->error_message)
printf("%s", ctx->error_message);
else
printf("An error occured; no error message available.\n");
ret = 1;
}
else if (ctx->output_string) {
printf("%s", ctx->output_string);
ret = 0;
}
else {
printf("Unknown internal error.\n");
ret = 2;
}
sass_free_file_context(ctx);
return ret;
}
| #include <stdio.h>
#include "libsass/sass_interface.h"
int main(int argc, char** argv)
{
int ret;
if (argc < 2) {
printf("Usage: sassc [INPUT FILE]\n");
return 0;
}
struct sass_file_context* ctx = sass_new_file_context();
ctx->options.include_paths = "";
ctx->options.image_path = "images";
ctx->options.output_style = SASS_STYLE_NESTED;
ctx->input_path = argv[1];
sass_compile_file(ctx);
if (ctx->error_status) {
if (ctx->error_message)
fprintf(stderr, "%s", ctx->error_message);
else
fprintf(stderr, "An error occured; no error message available.\n");
ret = 1;
}
else if (ctx->output_string) {
printf("%s", ctx->output_string);
ret = 0;
}
else {
fprintf(stderr, "Unknown internal error.\n");
ret = 2;
}
sass_free_file_context(ctx);
return ret;
}
| Print error messages to stderr. | Print error messages to stderr.
| C | mit | saper/sassc,am11/sassc,am11/sassc,djam90/sassc,rightisleft/sassc,saper/sassc,am11/sassc,saper/sassc,rightisleft/sassc,djam90/sassc,rightisleft/sassc,djam90/sassc |
27c91635d7f66040a801f46ff0a31852aefe9bf9 | src/utils/Enums.h | src/utils/Enums.h | /*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2021 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#pragma once
#include <type_traits>
#include <string>
namespace medialibrary
{
namespace utils
{
template <typename T>
std::string enum_to_string( T value )
{
static_assert( std::is_enum<T>::value, "This must be used with enum types" );
return std::to_string( static_cast<std::underlying_type_t<T>>( value ) );
}
}
}
| Add an enum_to_string util function | utils: Add an enum_to_string util function
In order to avoid sprinkling 2+ line std::to_string invocations each
time we need to convert an enum value to a string in a SQL request
| C | lgpl-2.1 | chouquette/medialibrary,chouquette/medialibrary,chouquette/medialibrary,chouquette/medialibrary |
|
8a886e7b508f52754ef1dcd49208903ba9e54040 | rgmanager/src/clulib/gettid.c | rgmanager/src/clulib/gettid.c | #include <sys/types.h>
#include <linux/unistd.h>
#include <gettid.h>
#include <errno.h>
/* Patch from Adam Conrad / Ubuntu: Don't use _syscall macro */
#ifdef __NR_gettid
pid_t gettid (void)
{
return syscall(__NR_gettid);
}
#else
#warn "gettid not available -- substituting with pthread_self()"
#include <pthread.h>
pid_t gettid (void)
{
return (pid_t)pthread_self();
}
#endif
| #include <sys/types.h>
#include <sys/syscall.h>
#include <linux/unistd.h>
#include <gettid.h>
#include <errno.h>
#include <unistd.h>
/* Patch from Adam Conrad / Ubuntu: Don't use _syscall macro */
#ifdef __NR_gettid
pid_t gettid (void)
{
return syscall(__NR_gettid);
}
#else
#warn "gettid not available -- substituting with pthread_self()"
#include <pthread.h>
pid_t gettid (void)
{
return (pid_t)pthread_self();
}
#endif
| Patch from Fabio Massimo Di Nitto: Fix includes | Patch from Fabio Massimo Di Nitto: Fix includes
| C | lgpl-2.1 | stevenraspudic/resource-agents,asp24/resource-agents,stevenraspudic/resource-agents,asp24/resource-agents,asp24/resource-agents,stevenraspudic/resource-agents |
661bc252516e229e3f3769956b1b16c8d40a95eb | tests/execute/0110-typedefcast.c | tests/execute/0110-typedefcast.c | typedef int myint;
myint x = (myint)1;
| typedef int myint;
myint x = (myint)1;
int
main(void)
{
return x-1;
}
| Fix test added in 6fe29dd | [tests] Fix test added in 6fe29dd
Tests must have a main function which returns 0.
| C | isc | k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/scc |
250473c59441260055fa47fb04a2f2dd911d7cf6 | rov_simulator/src/simulator.h | rov_simulator/src/simulator.h | #ifndef SIMULATOR_H
#define SIMULATOR_H
#include "ros/ros.h"
#include "dynamics.h"
#include "sensor_msgs/Imu.h"
#include "sensor_msgs/FluidPressure.h"
#include "nav_msgs/Odometry.h"
#include "geometry_msgs/Wrench.h"
#include "geometry_msgs/Pose.h"
#include "vortex_msgs/Float64ArrayStamped.h"
#include </usr/include/armadillo>
typedef std::vector<double> stdvec;
class Simulator {
public:
Simulator(unsigned int f,
ros::NodeHandle nh);
void thrustCallback(const vortex_msgs::Float64ArrayStamped &msg);
void spin();
private:
void poseArmaToMsg(const arma::vec &e,
geometry_msgs::Pose &m);
void twistArmaToMsg(const arma::vec &e,
geometry_msgs::Twist &m);
unsigned int frequency;
ros::NodeHandle nh;
ros::Subscriber wrenchSub;
ros::Publisher posePub;
ros::Publisher twistPub;
ros::Publisher imuPub;
ros::Publisher pressurePub;
Dynamics *dynamics;
arma::vec u;
};
#endif
| #ifndef SIMULATOR_H
#define SIMULATOR_H
#include "ros/ros.h"
#include "dynamics.h"
#include "sensor_msgs/Imu.h"
#include "sensor_msgs/FluidPressure.h"
#include "nav_msgs/Odometry.h"
#include "geometry_msgs/Wrench.h"
#include "geometry_msgs/Pose.h"
#include "vortex_msgs/Float64ArrayStamped.h"
#include </usr/include/armadillo>
typedef std::vector<double> stdvec;
class Simulator {
public:
Simulator(unsigned int f,
ros::NodeHandle nh);
void thrustCallback(const vortex_msgs::Float64ArrayStamped &msg);
void spin();
private:
void poseArmaToMsg(const arma::vec &e,
geometry_msgs::Pose &m);
void twistArmaToMsg(const arma::vec &e,
geometry_msgs::Twist &m);
unsigned int frequency;
ros::NodeHandle nh;
ros::Subscriber wrenchSub;
ros::Publisher posePub;
ros::Publisher twistPub;
ros::Publisher imuPub;
ros::Publisher pressurePub;
Dynamics *dynamics;
arma::vec u;
};
#endif
| Change any tabs to spaces | Change any tabs to spaces
| C | mit | vortexntnu/simulator |
ffaf170e85b189831681c13d99e6670054d3f0dd | lab2/server.c | lab2/server.c | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int port;
char *directory;
// Command Line Arguments //
if (argc < 3) {
printf("usage: %s <port> <dir>\n", argv[0]);
return 1;
}
port = atoi(argv[1]);
directory = argv[2];
if (port <= 0) {
printf("Invalid port provided.\n");
return 1;
}
// TODO server
return 0;
} | Add the begginning of lab1 | Add the begginning of lab1
| C | mit | chocklymon/CS360,chocklymon/CS360,chocklymon/CS360,chocklymon/CS360 |
|
047fa49e35d9dda7a987468b86d60ec8bca4b33a | tests/infiniteTranslationLoop.c | tests/infiniteTranslationLoop.c | /* liblouis Braille Translation and Back-Translation Library
Copyright (C) 2014 Mesar Hameed <[email protected]>
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without any warranty. */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "liblouis.h"
#include "brl_checks.h"
/* Demonstrates infinite translation loop.
* Originally reported at: http://www.freelists.org/post/liblouis-liblouisxml/Translating-com-with-UEBCg2ctb-causes-infinite-loop
*/
int main(int argc, char **argv)
{
int result = 0;
const char *text = "---.com";
const char *expected = "";
result |= check_translation("UEBC-g2.ctb", text, NULL, expected);
lou_free();
return result;
}
| /* liblouis Braille Translation and Back-Translation Library
Copyright (C) 2014 Mesar Hameed <[email protected]>
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without any warranty. */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "liblouis.h"
#include "brl_checks.h"
/* Demonstrates infinite translation loop.
* Originally reported at: http://www.freelists.org/post/liblouis-liblouisxml/Translating-com-with-UEBCg2ctb-causes-infinite-loop
*/
int main(int argc, char **argv)
{
int result = 0;
const char *text = "---.com";
const char *expected = "";
result |= check_translation("tables/UEBC-g2.ctb", text, NULL, expected);
lou_free();
return result;
}
| Fix a path in the translation loop test | Fix a path in the translation loop test
| C | lgpl-2.1 | vsmontalvao/liblouis,vsmontalvao/liblouis,hammera/liblouis,liblouis/liblouis,hammera/liblouis,BueVest/liblouis,BueVest/liblouis,BueVest/liblouis,hammera/liblouis,IndexBraille/liblouis,IndexBraille/liblouis,liblouis/liblouis,IndexBraille/liblouis,BueVest/liblouis,hammera/liblouis,BueVest/liblouis,vsmontalvao/liblouis,liblouis/liblouis,IndexBraille/liblouis,liblouis/liblouis,liblouis/liblouis,hammera/liblouis,hammera/liblouis,BueVest/liblouis,liblouis/liblouis,vsmontalvao/liblouis,vsmontalvao/liblouis,IndexBraille/liblouis |
f2c1a12c18bda617e32a79ac1c2adcc0cf2e883e | test/Analysis/PR38208.c | test/Analysis/PR38208.c | // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
// expected-no-diagnostics
int foo(int a, int b) {
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
return a + b;
}
| Fix for last commit: adding new test file forgotten. | Fix for last commit: adding new test file forgotten.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@337679 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang |
|
7dbdf1bce8b4948d979a847315b8b9308c943e4c | examples/example_01.c | examples/example_01.c | #include <stdio.h>
#include <datastructs.h>
int main(){
typedef struct user_data {
char name[100];
char email[100];
} user_data;
user_data a = {"John Doe", "john.doe@mail_server.com"};
user_data b = {"Jack Smith", "jack.smith@mail_server.com"};
user_data c = {"Jane Plain", "jane.plain@mail_server.com"};
user_data d = {"Mary Merry", "mary.merry@mail_server.com"};
user_data* data = NULL;
// list creation:
ds_linked_list* list = ds_linked_list_create();
ds_linked_list_insert_at(list, &a, 0);
ds_linked_list_add(list, &b);
ds_linked_list_add(list, &c);
ds_linked_list_add(list, &d);
int i;
for (i = 0; i < list->size; i ++){
data = ds_linked_list_get(list, i);
printf("Name: %s, Email: %s\n", data->name, data->email );
}
ds_linked_list_delete(&list);
}
| #include <stdio.h>
#include <datastructs.h>
int main(){
typedef struct user_data {
char name[100];
char email[100];
} user_data;
user_data a = {"John Doe", "john.doe@mail_server.com"};
user_data b = {"Jack Smith", "jack.smith@mail_server.com"};
user_data c = {"Jane Plain", "jane.plain@mail_server.com"};
user_data d = {"Mary Merry", "mary.merry@mail_server.com"};
user_data* data = NULL;
// list creation:
ds_linked_list* list = ds_linked_list_create();
ds_linked_list_insert_at(list, &a, 0);
ds_linked_list_add(list, &b);
ds_linked_list_add(list, &c);
ds_linked_list_add(list, &d);
int i;
for (i = 0; i < ds_linked_list_length(list); i ++){
data = ds_linked_list_get(list, i);
printf("Name: %s, Email: %s\n", data->name, data->email );
}
ds_linked_list_delete(&list);
}
| Use ds_linked_list_length() instead of the size struct member. | Examples: Use ds_linked_list_length() instead of the size struct member.
| C | bsd-3-clause | cyberpython/datastructs,cyberpython/datastructs |
437d7aadc7f40d2862539fa54c03c271d94b64cc | 2015-2016/A/15/03/romanNumerals.c | 2015-2016/A/15/03/romanNumerals.c | #include <stdio.h>
#include <string.h>
int getRomanValue(char number);
int checkRomanValue(char romanNumber[20]);
int main()
{
char romanNumber[20];
int i, curNum;
while(1)
{
curNum=0;
printf("Input roman number: ");
scanf("%s", romanNumber);
if(checkRomanN(romanNumber)==0)
{
printf("Input a valid roman number\n");
continue;
}
for(i=0; i<strlen(romanNumber); i++)
{
if(getRomanValue(romanNumber[i])<getRomanValue(romanNumber[i+1]))
{
curNum+=getRomanValue(romanNumber[i+1]) - getRomanValue(romanNumber[i]);
i++;
}
else
curNum+=getRomanValue(romanNumber[i]);
}
if(curNum>256)
{
printf("Number is larger than 256\n");
continue;
}
else
{
printf("Roman number in decimal is: %d\n", curNum);
break;
}
}
return 1;
}
int getRomanValue(char number)
{
int value;
switch(number){
case 'I':
value=1;
break;
case 'V':
value=5;
break;
case 'X':
value=10;
break;
case 'L':
value=50;
break;
case 'C':
value=100;
break;
}
return value;
}
int checkRomanN(char romanNumber[20]) //Function to check if inputted string is valid with roman numerals rules
{
int numerals[5]={0}, correct=1, i; // 0 - I 1 - V 2 - X 3 - L 4 - C XIX
for(i=0;i<strlen(romanNumber);i++)
{
if(romanNumber[i]!='I' && romanNumber[i]!='V' && romanNumber[i]!='X' && romanNumber[i]!='L' && romanNumber[i]!='C')
{
switch(romanNumber[i]){
case 'I':
numerals[0]++;
break;
case 'V':
numerals[1]++;
break;
case 'X':
numerals[2]++;
break;
case 'L':
numerals[3]++;
break;
case 'C':
numerals[4]++;
break;
}
}
}
for(i=0;i<5;i++)
{
if(numerals[i]>3)
return 0;
}
return 1;
}
| Add Roman Numerals to homework | Add Roman Numerals to homework
| C | mit | AlexAndreev/po-homework,ivanmilevtues/po-homework,vincho7012/po-homework,karakonjel/po-homework,VVurbanov/po-homework |
|
59c8aaac3425108e3137677863cc8cee6c84e20b | src/compat.h | src/compat.h | #ifndef COMPAT_H
#define COMPAT_H
#include "lua.h"
#include "lauxlib.h"
#if LUA_VERSION_NUM==501
void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
void *luaL_testudata ( lua_State *L, int arg, const char *tname);
#endif
#endif
| #ifndef COMPAT_H
#define COMPAT_H
#include "lua.h"
#include "lauxlib.h"
#if LUA_VERSION_NUM==501
#define luaL_setfuncs socket_setfuncs
#define luaL_testudata socket_testudata
void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
void *luaL_testudata ( lua_State *L, int arg, const char *tname);
#endif
#endif
| Fix static linking problem with LuaJIT | Fix static linking problem with LuaJIT
LuaJIT and LuaSocket both define new Lua APIs from Lua 5.2 (in
particular `luaL_setfuncs` and `luaL_testudata`). When linking both
statically, the one definition rule strikes and linking fails. This
commit fixes the issue by renaming the LuaSocket versions of those
functions behind the scenes using the C preprocessor.
Closes #214
| C | mit | diegonehab/LuaSocket,diegonehab/LuaSocket,diegonehab/LuaSocket |
3f6405a7ebcb804e88aba4be5a68c767690c4a72 | test/test_app.c | test/test_app.c | #include "test.h"
#include "app.h"
TEST(app_new) {
app_t * app = app_new();
assert(app->running == 0);
assert(app->io == 0);
app_free(app);
}
TEST(current_app_set_to) {
app_t * app = app_new();
assert(current_app == 0);
current_app_set_to(app);
assert(current_app == app);
app_free(app);
current_app_set_to(0);
}
static test_t app_test_suite[] = {
TEST_REF(app_new),
0
};
| #include <string.h>
#include "test.h"
#include "io.h"
#include "app.h"
TEST(app_new) {
app_t * app = app_new();
assert(app->running == 0);
assert(app->io == 0);
app_free(app);
}
TEST(current_app_set_to) {
app_t * app = app_new();
assert(current_app == 0);
current_app_set_to(app);
assert(current_app == app);
app_free(app);
current_app_set_to(0);
}
TEST(app_parse_command_line) {
app_t * app = app_new();
int argc = 3;
char * argv[] = {"chip8", "--io", "terminal"};
app_parse_command_line(app, argc, argv);
assert(app->io && strcmp(app->io->name, "terminal") == 0);
app_free(app);
}
static test_t app_test_suite[] = {
TEST_REF(app_new),
TEST_REF(app_parse_command_line),
0
};
| Add a failing test for app_parse_command_line | Add a failing test for app_parse_command_line
| C | mit | gsamokovarov/chip8.c,gsamokovarov/chip8.c |
bf8777dc307e2938a7d7e02ff761580b9917f529 | src/core/lib/gprpp/optional.h | src/core/lib/gprpp/optional.h | /*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPC_CORE_LIB_GPRPP_OPTIONAL_H
#define GRPC_CORE_LIB_GPRPP_OPTIONAL_H
namespace grpc_core {
/* A make-shift alternative for absl::Optional. This can be removed in favor of
* that once absl dependencies can be introduced. */
template <typename T>
class Optional {
public:
void set(const T& val) {
value_ = val;
set_ = true;
}
bool has_value() { return set_; }
void reset() { set_ = false; }
T value() { return value_; }
private:
T value_;
bool set_ = false;
};
} /* namespace grpc_core */
#endif /* GRPC_CORE_LIB_GPRPP_OPTIONAL_H */
| /*
*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPC_CORE_LIB_GPRPP_OPTIONAL_H
#define GRPC_CORE_LIB_GPRPP_OPTIONAL_H
namespace grpc_core {
/* A make-shift alternative for absl::Optional. This can be removed in favor of
* that once absl dependencies can be introduced. */
template <typename T>
class Optional {
public:
void set(const T& val) {
value_ = val;
set_ = true;
}
bool has_value() const { return set_; }
void reset() { set_ = false; }
T value() const { return value_; }
private:
T value_;
bool set_ = false;
};
} /* namespace grpc_core */
#endif /* GRPC_CORE_LIB_GPRPP_OPTIONAL_H */
| Add const qualifiers to member methods in Optional | Add const qualifiers to member methods in Optional
| C | apache-2.0 | jboeuf/grpc,ejona86/grpc,stanley-cheung/grpc,ctiller/grpc,sreecha/grpc,ctiller/grpc,nicolasnoble/grpc,sreecha/grpc,ctiller/grpc,donnadionne/grpc,donnadionne/grpc,sreecha/grpc,ctiller/grpc,ctiller/grpc,pszemus/grpc,muxi/grpc,jtattermusch/grpc,vjpai/grpc,jboeuf/grpc,vjpai/grpc,grpc/grpc,firebase/grpc,sreecha/grpc,jtattermusch/grpc,firebase/grpc,ctiller/grpc,ejona86/grpc,sreecha/grpc,firebase/grpc,muxi/grpc,grpc/grpc,jboeuf/grpc,firebase/grpc,carl-mastrangelo/grpc,grpc/grpc,donnadionne/grpc,vjpai/grpc,sreecha/grpc,ejona86/grpc,muxi/grpc,carl-mastrangelo/grpc,sreecha/grpc,jtattermusch/grpc,ctiller/grpc,firebase/grpc,stanley-cheung/grpc,muxi/grpc,muxi/grpc,muxi/grpc,firebase/grpc,jtattermusch/grpc,ejona86/grpc,pszemus/grpc,stanley-cheung/grpc,donnadionne/grpc,vjpai/grpc,firebase/grpc,jtattermusch/grpc,nicolasnoble/grpc,jboeuf/grpc,stanley-cheung/grpc,jtattermusch/grpc,donnadionne/grpc,ejona86/grpc,stanley-cheung/grpc,carl-mastrangelo/grpc,muxi/grpc,carl-mastrangelo/grpc,vjpai/grpc,ejona86/grpc,vjpai/grpc,pszemus/grpc,carl-mastrangelo/grpc,ctiller/grpc,pszemus/grpc,muxi/grpc,jboeuf/grpc,jtattermusch/grpc,sreecha/grpc,nicolasnoble/grpc,ejona86/grpc,vjpai/grpc,grpc/grpc,nicolasnoble/grpc,jboeuf/grpc,nicolasnoble/grpc,vjpai/grpc,ctiller/grpc,muxi/grpc,pszemus/grpc,grpc/grpc,donnadionne/grpc,donnadionne/grpc,ctiller/grpc,sreecha/grpc,grpc/grpc,nicolasnoble/grpc,firebase/grpc,stanley-cheung/grpc,jboeuf/grpc,stanley-cheung/grpc,carl-mastrangelo/grpc,nicolasnoble/grpc,pszemus/grpc,pszemus/grpc,vjpai/grpc,donnadionne/grpc,donnadionne/grpc,firebase/grpc,ejona86/grpc,ctiller/grpc,carl-mastrangelo/grpc,stanley-cheung/grpc,jtattermusch/grpc,firebase/grpc,grpc/grpc,jboeuf/grpc,stanley-cheung/grpc,nicolasnoble/grpc,nicolasnoble/grpc,donnadionne/grpc,ejona86/grpc,jboeuf/grpc,vjpai/grpc,pszemus/grpc,nicolasnoble/grpc,ejona86/grpc,stanley-cheung/grpc,firebase/grpc,stanley-cheung/grpc,grpc/grpc,vjpai/grpc,sreecha/grpc,carl-mastrangelo/grpc,jtattermusch/grpc,sreecha/grpc,stanley-cheung/grpc,nicolasnoble/grpc,jtattermusch/grpc,muxi/grpc,nicolasnoble/grpc,pszemus/grpc,vjpai/grpc,jboeuf/grpc,pszemus/grpc,carl-mastrangelo/grpc,muxi/grpc,carl-mastrangelo/grpc,pszemus/grpc,carl-mastrangelo/grpc,grpc/grpc,ejona86/grpc,grpc/grpc,grpc/grpc,jboeuf/grpc,jtattermusch/grpc,muxi/grpc,jtattermusch/grpc,donnadionne/grpc,grpc/grpc,jboeuf/grpc,donnadionne/grpc,carl-mastrangelo/grpc,firebase/grpc,sreecha/grpc,ctiller/grpc,pszemus/grpc,ejona86/grpc |
669ec93efe7eafc246bccb0b0768ad0952b3b8c4 | include/myr/compiler.h | include/myr/compiler.h | /*
* Myr C Utils library
*
* Written 2015 by Rickard Närström <[email protected]>
*
* To the extent possible under law, the author(s) have dedicated all copyright
* and related and neighboring rights to this software to the public domain worldwide.
* This software is distributed without any warranty.
*
* You should have received a copy of the CC0 Public Domain Dedication along
* with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
#ifndef MYR_COMPILER_H
#define MYR_COMPILER_H
#ifndef __has_attribute
# define __has_attribute(x) 0
#endif
#if defined(__GNUC__) || __has_attribute(noreturn)
# define NORETURN __attribute__((noreturn))
#else
# define NORETURN
#endif
#if defined(__GNUC__) || __has_attribute(format)
# define FORMAT(archtype, string_index, first_to_check) __attribute__((format(archtype, string_index, first_to_check)))
#else
# define FORMAT(archtype, string_index, first_to_check)
#endif
#endif
| /*
* Myr C Utils library
*
* Written 2015 by Rickard Närström <[email protected]>
*
* To the extent possible under law, the author(s) have dedicated all copyright
* and related and neighboring rights to this software to the public domain worldwide.
* This software is distributed without any warranty.
*
* You should have received a copy of the CC0 Public Domain Dedication along
* with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
#ifndef MYR_COMPILER_H
#define MYR_COMPILER_H
#ifndef __has_attribute
# define __has_attribute(x) 0
#endif
#if __STDC_VERSION__ >= 201112L
# include <stdnoreturn.h>
# define NORETURN noreturn
#elif defined(__GNUC__) || __has_attribute(noreturn)
# define NORETURN __attribute__((noreturn))
#else
# define NORETURN
#endif
#if defined(__GNUC__) || __has_attribute(format)
# define FORMAT(archtype, string_index, first_to_check) __attribute__((format(archtype, string_index, first_to_check)))
#else
# define FORMAT(archtype, string_index, first_to_check)
#endif
#endif
| Use standard C11 noreturn if avaiable. | Use standard C11 noreturn if avaiable.
| C | unlicense | riccetn/myr-cutils |
8f944706b21598c2bc1f9f9dfc5d36bb4ddba395 | solutions/uri/1006/1006.c | solutions/uri/1006/1006.c | #include <stdio.h>
int main() {
float a, b, c;
scanf("%f", &a);
scanf("%f", &b);
scanf("%f", &c);
printf("MEDIA = %.1f\n", (a * 2.0 + b * 3.0 + c * 5.0) / 10.0);
return 0;
}
| Solve Average 2 in c | Solve Average 2 in c
| C | mit | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground |
|
5e6b1eab679452b24578e6f6c9594ac3b88b3b64 | ObjectDoc/ObjectDoc.h | ObjectDoc/ObjectDoc.h | /*
* Author: Landon Fuller <[email protected]>
*
* Copyright (c) 2013 Plausible Labs Cooperative, Inc.
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#import <Foundation/Foundation.h>
#import "PLClangSourceIndex.h"
#import "PLClangTranslationUnit.h" | /*
* Author: Landon Fuller <[email protected]>
*
* Copyright (c) 2013 Plausible Labs Cooperative, Inc.
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#import <Foundation/Foundation.h>
#import "PLClang.h"
| Use PLClang.h in umbrella header | Use PLClang.h in umbrella header
This includes the error codes and error domain.
| C | mit | landonf/objectdoc,landonf/objectdoc |
48eda9d8410404db35d51a3807ae8ac8a52d7261 | Source/UnrealCV/Private/libs/cnpy.h | Source/UnrealCV/Private/libs/cnpy.h | // Copyright (C) 2011 Carl Rogers
// Released under MIT License
// Simplied by Weichao Qiu ([email protected]) from https://github.com/rogersce/cnpy
#pragma once
#include <vector>
namespace cnpy {
template<typename T>
std::vector<char> create_npy_header(const T* data, const std::vector<int> shape);
template<typename T>
std::vector<char>& operator+=(std::vector<char>& lhs, const T rhs) {
//write in little endian
for (char byte = 0; byte < sizeof(T); byte++) {
char val = *((char*)&rhs + byte);
lhs.push_back(val);
}
return lhs;
}
template<>
std::vector<char>& operator+=(std::vector<char>& lhs, const std::string rhs);
template<>
std::vector<char>& operator+=(std::vector<char>& lhs, const char* rhs);
}
| // Copyright (C) 2011 Carl Rogers
// Released under MIT License
// Simplied by Weichao Qiu ([email protected]) from https://github.com/rogersce/cnpy
#pragma once
#include <vector>
#include <string>
namespace cnpy {
template<typename T>
std::vector<char> create_npy_header(const T* data, const std::vector<int> shape);
template<typename T>
std::vector<char>& operator+=(std::vector<char>& lhs, const T rhs) {
//write in little endian
for (char byte = 0; byte < sizeof(T); byte++) {
char val = *((char*)&rhs + byte);
lhs.push_back(val);
}
return lhs;
}
template<>
std::vector<char>& operator+=(std::vector<char>& lhs, const std::string rhs);
template<>
std::vector<char>& operator+=(std::vector<char>& lhs, const char* rhs);
}
| Include <string> to fix a compile issue in 4.12 and 4.13. | Include <string> to fix a compile issue in 4.12 and 4.13.
| C | mit | unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv |
248c9fb0418e071786b2b91992b5fe711d79f021 | drivers/scsi/qla4xxx/ql4_version.h | drivers/scsi/qla4xxx/ql4_version.h | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2013 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.04.00-k5"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2013 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.04.00-k6"
| Update driver version to 5.04.00-k6 | qla4xxx: Update driver version to 5.04.00-k6
Signed-off-by: Vikas Chaudhary <[email protected]>
Reviewed-by: Mike Christie <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
| C | mit | KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs |
e36d31edd6020989bdb39f82dea54ef0e747e994 | test/Driver/systemz-march.c | test/Driver/systemz-march.c | // Check that -march works for all supported targets.
// RUN: not %clang -target s390x -S -emit-llvm -march=z9 %s -o - 2>&1 | FileCheck --check-prefix=CHECK-Z9 %s
// RUN: %clang -target s390x -S -emit-llvm -march=z10 %s
// RUN: %clang -target s390x -S -emit-llvm -march=z196 %s
// RUN: %clang -target s390x -S -emit-llvm -march=zEC12 %s
// CHECK-Z9: error: unknown target CPU 'z9'
// CHECK-Z10: "-target-cpu" "z10"
// CHECK-Z196: "-target-cpu" "z196"
// CHECK-ZEC12: "-target-cpu" "zEC12"
int x;
| // Check that -march works for all supported targets.
// RUN: not %clang -target s390x -S -emit-llvm -march=z9 %s -o - 2>&1 | FileCheck --check-prefix=CHECK-Z9 %s
// RUN: %clang -target s390x -### -S -emit-llvm -march=z10 %s 2>&1 | FileCheck --check-prefix=CHECK-Z10 %s
// RUN: %clang -target s390x -### -S -emit-llvm -march=z196 %s 2>&1 | FileCheck --check-prefix=CHECK-Z196 %s
// RUN: %clang -target s390x -### -S -emit-llvm -march=zEC12 %s 2>&1 | FileCheck --check-prefix=CHECK-ZEC12 %s
// CHECK-Z9: error: unknown target CPU 'z9'
// CHECK-Z10: "-target-cpu" "z10"
// CHECK-Z196: "-target-cpu" "z196"
// CHECK-ZEC12: "-target-cpu" "zEC12"
int x;
| Fix test to actually check things. | Fix test to actually check things.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@186701 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang |
659d917acd2f5da137e506784acc3862225e7dad | Classes/NAPlaybackIndicatorView.h | Classes/NAPlaybackIndicatorView.h | //
// NAPlaybackIndicatorView.h
// PlaybackIndicator
//
// Created by Yuji Nakayama on 1/27/14.
// Copyright (c) 2014 Yuji Nakayama. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface NAPlaybackIndicatorView : UIView
- (void)startAnimating;
- (void)stopAnimating;
@property (nonatomic, readonly, getter=isAnimating) BOOL animating;
@end
| //
// NAPlaybackIndicatorView.h
// PlaybackIndicator
//
// Created by Yuji Nakayama on 1/27/14.
// Copyright (c) 2014 Yuji Nakayama. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface NAPlaybackIndicatorView : UIView
/**
Starts the oscillating animation of the bars.
*/
- (void)startAnimating;
/**
Stop the oscillating animation of the bars.
*/
- (void)stopAnimating;
/**
Whether the receiver is animating.
*/
@property (nonatomic, readonly, getter=isAnimating) BOOL animating;
@end
| Add documentation comments for method | Add documentation comments for method
| C | mit | yujinakayama/NAKPlaybackIndicatorView |
ddb5650f2820329f818cc57859610db1ccc45434 | src/hid2hci.c | src/hid2hci.c | #include <stdio.h>
#include <libusb-1.0/libusb.h>
int main (int argc, char ** argv) {
char data[] = { 0x01, 0x05, 0, 0, 0, 0, 0, 0, 0 };
libusb_init(NULL);
libusb_device_handle* h = libusb_open_device_with_vid_pid(NULL, 0x0a12, 0x100b);
if (!h) {
printf("No device in HID mode found\n");
} else {
libusb_detach_kernel_driver(h, 0);
printf("%d\n", libusb_claim_interface(h, 0));
libusb_control_transfer(h, LIBUSB_ENDPOINT_OUT|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE, LIBUSB_REQUEST_GET_CONFIGURATION, 0x0301, 0, data, 9, 10000);
libusb_release_interface(h, 0);
libusb_close(h);
}
libusb_exit(NULL);
return 0;
}
| #include <stdio.h>
#include <libusb-1.0/libusb.h>
int main (int argc, char ** argv) {
char data[] = { 0x01, 0x05, 0, 0, 0, 0, 0, 0, 0 };
libusb_init(NULL);
/* using the default pskeys, devices from the factory are a12:100d in HID mode */
libusb_device_handle* h = libusb_open_device_with_vid_pid(NULL, 0x0a12, 0x100b);
if (!h)
/* Alternatively, a12:100c can be set by the dongler to prevent CSR's software
stack from auto-switching to HCI mode */
h = libusb_open_device_with_vid_pid(NULL, 0x0a12, 0x100c);
if (!h) {
printf("No device in HID mode found\n");
} else {
libusb_detach_kernel_driver(h, 0);
printf("This should say 0: %d\n", libusb_claim_interface(h, 0));
libusb_control_transfer(h, LIBUSB_ENDPOINT_OUT|LIBUSB_REQUEST_TYPE_CLASS|LIBUSB_RECIPIENT_INTERFACE, LIBUSB_REQUEST_SET_CONFIGURATION, 0x0301, 0, data, 9, 10000);
libusb_release_interface(h, 0);
libusb_close(h);
}
libusb_exit(NULL);
return 0;
}
| Fix the constants so it will work correctly. Also add the possibility of a different Product ID so the dongles can be set to a mode that Windows machines with the CSR drivers won't switch them to HCI mode. | Fix the constants so it will work correctly. Also add the possibility of a different Product ID so
the dongles can be set to a mode that Windows machines with the CSR drivers won't switch them to HCI mode.
| C | mit | wmertens/textblade-dongler,wmertens/textblade-dongler |
849184df828508bccc40cf609497b571ce95831d | include/llvm/CodeGen/GlobalISel/CallLowering.h | include/llvm/CodeGen/GlobalISel/CallLowering.h | //===-- llvm/CodeGen/GlobalISel/CallLowering.h - Call lowering --*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// This file describes how to lower LLVM calls to machine code calls.
///
//===----------------------------------------------------------------------===//
#ifndef LLVM_CODEGEN_GLOBALISEL_CALLLOWERING_H
#define LLVM_CODEGEN_GLOBALISEL_CALLLOWERING_H
#include "llvm/ADT/SmallVector.h"
#include "llvm/IR/Function.h"
namespace llvm {
// Forward declarations.
class MachineIRBuilder;
class TargetLowering;
class Value;
class CallLowering {
const TargetLowering *TLI;
protected:
/// Getter for generic TargetLowering class.
const TargetLowering *getTLI() const {
return TLI;
}
/// Getter for target specific TargetLowering class.
template <class XXXTargetLowering>
const XXXTargetLowering *getTLI() const {
return static_cast<const XXXTargetLowering *>(TLI);
}
public:
CallLowering(const TargetLowering *TLI) : TLI(TLI) {}
virtual ~CallLowering() {}
/// This hook must be implemented to lower outgoing return values, described
/// by \p Val, into the specified virtual register \p VReg.
/// This hook is used by GlobalISel.
///
/// \return True if the lowering succeeds, false otherwise.
virtual bool LowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val,
unsigned VReg) const {
return false;
}
/// This hook must be implemented to lower the incoming (formal)
/// arguments, described by \p Args, for GlobalISel. Each argument
/// must end up in the related virtual register described by VRegs.
/// In other words, the first argument should end up in VRegs[0],
/// the second in VRegs[1], and so on.
/// \p MIRBuilder is set to the proper insertion for the argument
/// lowering.
///
/// \return True if the lowering succeeded, false otherwise.
virtual bool
LowerFormalArguments(MachineIRBuilder &MIRBuilder,
const Function::ArgumentListType &Args,
const SmallVectorImpl<unsigned> &VRegs) const {
return false;
}
};
} // End namespace llvm.
#endif
| Add missing file in previous commit. | [GlobalISel] Add missing file in previous commit.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@260923 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.