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
|
---|---|---|---|---|---|---|---|---|---|
5fffb9f49cd7b1237a0bfed0faebf16ef5cdeec1 | lib/sanitizer_common/sanitizer_platform_interceptors.h | lib/sanitizer_common/sanitizer_platform_interceptors.h | //===-- sanitizer_platform_interceptors.h -----------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines macro telling whether sanitizer tools can/should intercept
// given library functions on a given platform.
//
//===----------------------------------------------------------------------===//
#include "sanitizer_internal_defs.h"
#if !defined(_WIN32)
# define SI_NOT_WINDOWS 1
#else
# define SI_NOT_WINDOWS 0
#endif
#if defined(__linux__) && !defined(ANDROID)
# define SI_LINUX_NOT_ANDROID 1
#else
# define SI_LINUX_NOT_ANDROID 0
#endif
# define SANITIZER_INTERCEPT_READ SI_NOT_WINDOWS
# define SANITIZER_INTERCEPT_PREAD SI_NOT_WINDOWS
# define SANITIZER_INTERCEPT_WRITE SI_NOT_WINDOWS
# define SANITIZER_INTERCEPT_PWRITE SI_NOT_WINDOWS
# define SANITIZER_INTERCEPT_PREAD64 SI_LINUX_NOT_ANDROID
# define SANITIZER_INTERCEPT_PWRITE64 SI_LINUX_NOT_ANDROID
# define SANITIZER_INTERCEPT_PRCTL SI_LINUX_NOT_ANDROID
# define SANITIZER_INTERCEPT_SCANF 1
| //===-- sanitizer_platform_interceptors.h -----------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines macro telling whether sanitizer tools can/should intercept
// given library functions on a given platform.
//
//===----------------------------------------------------------------------===//
#include "sanitizer_internal_defs.h"
#if !defined(_WIN32)
# define SI_NOT_WINDOWS 1
#else
# define SI_NOT_WINDOWS 0
#endif
#if defined(__linux__) && !defined(ANDROID)
# define SI_LINUX_NOT_ANDROID 1
#else
# define SI_LINUX_NOT_ANDROID 0
#endif
# define SANITIZER_INTERCEPT_READ SI_NOT_WINDOWS
# define SANITIZER_INTERCEPT_PREAD SI_NOT_WINDOWS
# define SANITIZER_INTERCEPT_WRITE SI_NOT_WINDOWS
# define SANITIZER_INTERCEPT_PWRITE SI_NOT_WINDOWS
# define SANITIZER_INTERCEPT_PREAD64 SI_LINUX_NOT_ANDROID
# define SANITIZER_INTERCEPT_PWRITE64 SI_LINUX_NOT_ANDROID
# define SANITIZER_INTERCEPT_PRCTL SI_LINUX_NOT_ANDROID
# define SANITIZER_INTERCEPT_SCANF SI_NOT_WINDOWS
| Disable scanf interceptor on windows. | [sanitizer] Disable scanf interceptor on windows.
git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@173037 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt |
06b2610307b76c594aa544e8366b291571b4e3e8 | Classes/model/NearbyObjectProtocol.h | Classes/model/NearbyObjectProtocol.h | //
// NearbyObjectProtocol.h
// ARIS
//
// Created by Brian Deith on 5/15/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
enum {
NearbyObjectNPC = 1,
NearbyObjectItem = 2,
NearbyObjectNode = 3
};
typedef UInt32 nearbyObjectKind;
@protocol NearbyObjectProtocol
- (NSString *)name;
- (nearbyObjectKind)kind;
- (BOOL)forcedDisplay;
- (void)display;
@end
| Include nearby object protocol file | Include nearby object protocol file
| C | mit | ARISGames/iOSClient,ARISGames/iOSClient,ARISGames/iOSClient,ARISGames/iOSClient,ARISGames/iOSClient |
|
9acecbbff3b0eca30b2a0f0767dad196b93d1225 | 3RVX/Settings.h | 3RVX/Settings.h | #pragma once
#include <unordered_map>
#include <string>
#include "TinyXml2\tinyxml2.h"
class Skin;
#define SETTINGS_APP L"SettingsUI.exe"
class Settings {
public:
static Settings *Instance();
static std::wstring AppDir();
static std::wstring SettingsApp();
std::wstring LanguagesDir();
std::wstring LanguageName();
Skin *CurrentSkin();
std::wstring SkinName();
std::wstring SkinXML();
std::wstring SkinXML(std::wstring skinName);
bool HasSetting(std::string elementName);
bool IsEnabled(std::string elementName);
std::wstring GetText(std::string elementName);
int GetInt(std::string elementName);
bool NotifyIconEnabled();
bool SoundEffectsEnabled();
std::unordered_map<int, int> Hotkeys();
void Reload();
private:
static Settings *instance;
static std::wstring _appDir;
std::wstring _file;
tinyxml2::XMLDocument _xml;
tinyxml2::XMLElement *_root;
Skin *_skin;
Settings();
}; | #pragma once
#include <unordered_map>
#include <string>
#include "TinyXml2\tinyxml2.h"
class Skin;
#define SETTINGS_APP L"SettingsUI.exe"
class Settings {
public:
static Settings *Instance();
void Reload();
static std::wstring AppDir();
static std::wstring SettingsApp();
std::wstring LanguagesDir();
std::wstring LanguageName();
Skin *CurrentSkin();
std::wstring SkinName();
std::wstring SkinXML();
std::wstring SkinXML(std::wstring skinName);
bool NotifyIconEnabled();
bool SoundEffectsEnabled();
std::unordered_map<int, int> Hotkeys();
private:
Settings();
static Settings *instance;
static std::wstring _appDir;
std::wstring _file;
tinyxml2::XMLDocument _xml;
tinyxml2::XMLElement *_root;
Skin *_skin;
bool HasSetting(std::string elementName);
bool IsEnabled(std::string elementName);
std::wstring GetText(std::string elementName);
int GetInt(std::string elementName);
}; | Reorganize and reduce visibility for raw XML access methods | Reorganize and reduce visibility for raw XML access methods
These should be performed by public methods that abstract away the XML elements
| C | bsd-2-clause | malensek/3RVX,Soulflare3/3RVX,Soulflare3/3RVX,Soulflare3/3RVX,malensek/3RVX,malensek/3RVX |
9e016003aac70a33c442a81cd1eb7c51c3fa52b6 | deps/test/openblas/test_install.c | deps/test/openblas/test_install.c | #include <cblas.h>
#include <stdio.h>
void main()
{
double A[ 6 ] = { 1.0, 2.0, 1.0, -3.0, 4.0, -1.0 };
double B[ 6 ] = { 1.0, 2.0, 1.0, -3.0, 4.0, -1.0 };
double C[ 9 ] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 };
int i = 0;
cblas_dgemm( CblasColMajor, CblasNoTrans, CblasTrans, 3, 3, 2, 1, A, 3, B, 3, 2, C, 3 );
for( i = 0; i < 9; i++ ) {
printf( "%lf ", C[ i ] );
}
printf( "\n" );
}
| Add script to test install | Add script to test install
| C | apache-2.0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib |
|
e891c048cd3bd65cd80ef15097a7b092b41d9449 | tests/regression/36-octapron/14-traces-unprot.c | tests/regression/36-octapron/14-traces-unprot.c | // PARAM: --sets ana.activated[+] octApron
#include <pthread.h>
#include <assert.h>
int g = 1;
void *t_fun(void *arg) {
g = 2; // write something non-initial so base wouldn't find success
return NULL;
}
int main(void) {
int x, y;
pthread_t id;
pthread_create(&id, NULL, t_fun, NULL);
x = g;
y = g;
// unlock(m_g)-s must forget relation with unprotected
assert(x == y); // UNKNOWN!
return 0;
}
| Add regression test where unprotected read must forget relation | Add regression test where unprotected read must forget relation
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
74ce9a97e81b913f26f0353dc0d3e988af99cb5c | uranus_dp/include/uranus_dp/eigen_helper.h | uranus_dp/include/uranus_dp/eigen_helper.h | #ifndef EIGEN_HELPER_H
#define EIGEN_HELPER_H
#include <Eigen/Dense>
template<typename Derived>
inline bool isFucked(const Eigen::MatrixBase<Derived>& x)
{
return !((x.array() == x.array())).all() && !( (x - x).array() == (x - x).array()).all();
}
#endif
| #ifndef EIGEN_HELPER_H
#define EIGEN_HELPER_H
#include "ros/ros.h"
#include <Eigen/Dense>
template<typename Derived>
inline bool isFucked(const Eigen::MatrixBase<Derived>& x)
{
return !((x.array() == x.array())).all() && !( (x - x).array() == (x - x).array()).all();
}
inline Eigen::MatrixXd getMatrixParam(ros::NodeHandle nh, std::string name)
{
XmlRpc::XmlRpcValue matrix;
nh.getParam(name, matrix);
try
{
const int rows = matrix.size();
const int cols = matrix[0].size();
Eigen::MatrixXd X(rows,cols);
for (int i = 0; i < rows; ++i)
for (int j = 0; j < cols; ++j)
X(i,j) = matrix[i][j];
return X;
}
catch(...)
{
ROS_ERROR("Error in getMatrixParam. Returning 1-by-1 zero matrix.");
return Eigen::MatrixXd::Zero(1,1);
}
}
inline void printEigen(std::string name, const Eigen::MatrixXd &x)
{
std::stringstream ss;
ss << name << " = " << std::endl << x;
ROS_INFO_STREAM(ss.str());
}
inline Eigen::MatrixXd pinv(const Eigen::MatrixXd &X)
{
Eigen::MatrixXd X_pinv = X.transpose() * ( X*X.transpose() ).inverse();
if (isFucked(X_pinv))
{
ROS_WARN("Could not compute pseudoinverse. Returning transpose.");
return X.transpose();
}
return X_pinv;
}
#endif
| Move more stuff to eigen helper header | Move more stuff to eigen helper header
| C | mit | vortexntnu/rov-control,vortexntnu/rov-control,vortexntnu/rov-control |
3881c6907e3a18dca7878e06ef915e64021156b0 | test/Analysis/taint-generic.c | test/Analysis/taint-generic.c | // RUN: %clang_cc1 -analyze -analyzer-checker=experimental.security.taint,experimental.security.ArrayBoundV2 -verify %s
int scanf(const char *restrict format, ...);
int getchar(void);
#define BUFSIZE 10
int Buffer[BUFSIZE];
void bufferFoo1(void)
{
int n;
scanf("%d", &n);
Buffer[n] = 1; // expected-warning {{Out of bound memory access }}
}
void bufferScanfArithmetic1(int x) {
int n;
scanf("%d", &n);
int m = (n - 3);
Buffer[m] = 1; // expected-warning {{Out of bound memory access }}
}
void bufferScanfArithmetic2(int x) {
int n;
scanf("%d", &n);
int m = (n + 3) * x;
Buffer[m] = 1; // expected-warning {{Out of bound memory access }}
}
void scanfArg() {
int t;
scanf("%d", t); // expected-warning {{Pointer argument is expected}}
}
| // RUN: %clang_cc1 -analyze -analyzer-checker=experimental.security.taint,experimental.security.ArrayBoundV2 -verify %s
int scanf(const char *restrict format, ...);
int getchar(void);
#define BUFSIZE 10
int Buffer[BUFSIZE];
void bufferScanfDirect(void)
{
int n;
scanf("%d", &n);
Buffer[n] = 1; // expected-warning {{Out of bound memory access }}
}
void bufferScanfArithmetic1(int x) {
int n;
scanf("%d", &n);
int m = (n - 3);
Buffer[m] = 1; // expected-warning {{Out of bound memory access }}
}
void bufferScanfArithmetic2(int x) {
int n;
scanf("%d", &n);
int m = 100 / (n + 3) * x;
Buffer[m] = 1; // expected-warning {{Out of bound memory access }}
}
void bufferScanfAssignment(int x) {
int n;
scanf("%d", &n);
int m;
if (x > 0) {
m = n;
Buffer[m] = 1; // expected-warning {{Out of bound memory access }}
}
}
void scanfArg() {
int t;
scanf("%d", t); // expected-warning {{Pointer argument is expected}}
}
void bufferGetchar(int x) {
int m = getchar();
Buffer[m] = 1; //expected-warning {{Out of bound memory access }}
}
| Add more simple taint tests. | [analyzer] Add more simple taint tests.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@145275 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | 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,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang |
ad5e1f815335f65c20b07ed10cdac2885202a47c | include/llvm/CodeGen/ValueTypes.h | include/llvm/CodeGen/ValueTypes.h | //===- CodeGen/ValueTypes.h - Low-Level Target independ. types --*- C++ -*-===//
//
// This file defines the set of low-level target independent types which various
// values in the code generator are. This allows the target specific behavior
// of instructions to be described to target independent passes.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CODEGEN_VALUETYPES_H
#define LLVM_CODEGEN_VALUETYPES_H
/// MVT namespace - This namespace defines the ValueType enum, which contains
/// the various low-level value types.
///
namespace MVT { // MRF = Machine Register Flags
enum ValueType {
Other = 0 << 0, // This is a non-standard value
i1 = 1 << 0, // This is a 1 bit integer value
i8 = 1 << 1, // This is an 8 bit integer value
i16 = 1 << 2, // This is a 16 bit integer value
i32 = 1 << 3, // This is a 32 bit integer value
i64 = 1 << 4, // This is a 64 bit integer value
i128 = 1 << 5, // This is a 128 bit integer value
f32 = 1 << 6, // This is a 32 bit floating point value
f64 = 1 << 7, // This is a 64 bit floating point value
f80 = 1 << 8, // This is a 80 bit floating point value
f128 = 1 << 9, // This is a 128 bit floating point value
};
};
#endif
| Define target value types in a form usable by target-independent code | Define target value types in a form usable by target-independent code
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@7375 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap |
|
6346f9be0ecd911c67e523d8eb765bf84cd1dea6 | src/common.h | src/common.h | // Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved.
// Please see the AUTHORS file for details. Use of this source code is governed
// by a BSD license that can be found in the LICENSE file.
#ifndef SCALLOC_COMMON_H_
#define SCALLOC_COMMON_H_
#define UNLIKELY(x) __builtin_expect((x), 0)
#define LIKELY(x) __builtin_expect((x), 1)
#define cache_aligned __attribute__((aligned(64)))
#define always_inline inline __attribute__((always_inline))
#define no_inline __attribute__((noinline))
const size_t kSystemPageSize = 4096;
always_inline size_t PadSize(size_t size, size_t multiple) {
return (size + multiple - 1) / multiple * multiple;
}
#endif // SCALLOC_COMMON_H_
| // Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved.
// Please see the AUTHORS file for details. Use of this source code is governed
// by a BSD license that can be found in the LICENSE file.
#ifndef SCALLOC_COMMON_H_
#define SCALLOC_COMMON_H_
#define UNLIKELY(x) __builtin_expect((x), 0)
#define LIKELY(x) __builtin_expect((x), 1)
#define cache_aligned __attribute__((aligned(64)))
#define always_inline inline __attribute__((always_inline))
#define no_inline __attribute__((noinline))
const size_t kSystemPageSize = 4096;
// Prohibit reordering of instructions by the compiler.
inline void CompilerBarrier() {
__asm__ __volatile__("" : : : "memory");
}
// Full memory fence on x86-64
inline void MemoryBarrier() {
__asm__ __volatile__("mfence" : : : "memory");
}
always_inline size_t PadSize(size_t size, size_t multiple) {
return (size + multiple - 1) / multiple * multiple;
}
#endif // SCALLOC_COMMON_H_
| Add CompilerBarrier() and MemoryBarrier() functions. | Add CompilerBarrier() and MemoryBarrier() functions.
Signed-off-by: Michael Lippautz <[email protected]>
| C | bsd-2-clause | cksystemsgroup/scalloc,cksystemsgroup/scalloc,cksystemsgroup/scalloc |
9fb5888c9c8de8c942f5524c3857f8186c2edc6d | input.c | input.c | #include "input.h"
#include <ctype.h>
#include <stdio.h>
#include <string.h>
void read_line(char *p)
{
if (fgets(p, MAX_SIZE, stdin) == NULL){
p[0] = '\0';
return;
}
remove_space(p);
}
int is_exit(const char* p)
{
const char* exit_words[] = {
"exit",
"quit",
"bye",
};
int len = (int)(sizeof(exit_words) / sizeof(char*));
int i;
if (strlen(p) == 0){
return (1);
}
for (i = 0; i < len; i++){
if (strcmp(p, exit_words[i]) == 0){
return (1);
}
}
return (0);
}
void remove_space(char* p)
{
int i, j;
i = j = 0;
while (p[i] != '\0'){
while (isspace(p[j])){
j++;
}
while (!isspace(p[j])){
p[i] = p[j];
if (p[i] == '\0'){
break;
}
else {
i++;
j++;
}
}
}
}
| #include "input.h"
#include <ctype.h>
#include <stdio.h>
#include <string.h>
void read_line(char *p)
{
if (fgets(p, MAX_SIZE, stdin) == NULL){
p[0] = '\0';
return;
}
remove_space(p);
}
int is_exit(const char* p)
{
const char* exit_words[] = {
"",
"exit",
"quit",
"bye",
};
int len = (int)(sizeof(exit_words) / sizeof(char*));
int i;
if (strlen(p) == 0){
return (1);
}
for (i = 0; i < len; i++){
if (strcmp(p, exit_words[i]) == 0){
return (1);
}
}
return (0);
}
void remove_space(char* p)
{
int i, j;
i = j = 0;
while (p[i] != '\0'){
while (isspace(p[j])){
j++;
}
while (!isspace(p[j])){
p[i] = p[j];
if (p[i] == '\0'){
break;
}
else {
i++;
j++;
}
}
}
}
| Add empty string to exit words | Add empty string to exit words
| C | mit | Roadagain/Calculator,Roadagain/Calculator |
48f0a31143545af70b16b4ff079cc255acdf9419 | alura/c/forca.c | alura/c/forca.c | #include <stdio.h>
int main() {
int notas[10];
notas[0] = 10;
notas[2] = 9;
notas[3] = 8;
notas[9] = 4;
printf("%d %d %d\n", notas[0], notas[2], notas[9]);
} | #include <stdio.h>
int main() {
char palavrasecreta[20];
sprintf(palavrasecreta, "MELANCIA");
printf("%s\n", palavrasecreta);
/*
palavrasecreta[0] = 'M';
palavrasecreta[1] = 'E';
palavrasecreta[2] = 'L';
palavrasecreta[3] = 'A';
palavrasecreta[4] = 'N';
palavrasecreta[5] = 'C';
palavrasecreta[6] = 'I';
palavrasecreta[7] = 'A';
printf("%c%c%c%c%c%c%c%c\n", palavrasecreta[0], palavrasecreta[1], palavrasecreta[2], palavrasecreta[3], palavrasecreta[4], palavrasecreta[5], palavrasecreta[6], palavrasecreta[7]);
*/
}
| Update files, Alura, Introdução a C - Parte 2, Aula 2.2 | Update files, Alura, Introdução a C - Parte 2, Aula 2.2
| C | mit | fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs |
a7f3d5712d54ae80ca6a2a747522f8ae65c0ed98 | webkit/glue/form_data.h | webkit/glue/form_data.h | // Copyright (c) 2010 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 WEBKIT_GLUE_FORM_DATA_H__
#define WEBKIT_GLUE_FORM_DATA_H__
#include <vector>
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
#include "webkit/glue/form_field.h"
namespace webkit_glue {
// Holds information about a form to be filled and/or submitted.
struct FormData {
// The name of the form.
string16 name;
// GET or POST.
string16 method;
// The URL (minus query parameters) containing the form.
GURL origin;
// The action target of the form.
GURL action;
// true if this form was submitted by a user gesture and not javascript.
bool user_submitted;
// A vector of all the input fields in the form.
std::vector<FormField> fields;
// Used by FormStructureTest.
inline bool operator==(const FormData& form) const {
return (name == form.name &&
StringToLowerASCII(method) == StringToLowerASCII(form.method) &&
origin == form.origin &&
action == form.action &&
user_submitted == form.user_submitted &&
fields == form.fields);
}
};
} // namespace webkit_glue
#endif // WEBKIT_GLUE_FORM_DATA_H__
| // Copyright (c) 2010 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 WEBKIT_GLUE_FORM_DATA_H__
#define WEBKIT_GLUE_FORM_DATA_H__
#include <vector>
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
#include "webkit/glue/form_field.h"
namespace webkit_glue {
// Holds information about a form to be filled and/or submitted.
struct FormData {
// The name of the form.
string16 name;
// GET or POST.
string16 method;
// The URL (minus query parameters) containing the form.
GURL origin;
// The action target of the form.
GURL action;
// true if this form was submitted by a user gesture and not javascript.
bool user_submitted;
// A vector of all the input fields in the form.
std::vector<FormField> fields;
FormData() : user_submitted(false) {}
// Used by FormStructureTest.
inline bool operator==(const FormData& form) const {
return (name == form.name &&
StringToLowerASCII(method) == StringToLowerASCII(form.method) &&
origin == form.origin &&
action == form.action &&
user_submitted == form.user_submitted &&
fields == form.fields);
}
};
} // namespace webkit_glue
#endif // WEBKIT_GLUE_FORM_DATA_H__
| Add a default constructor for FormData. There are too many places that create FormDatas, and we shouldn't need to initialize user_submitted for each call site. | AutoFill: Add a default constructor for FormData. There are too many places
that create FormDatas, and we shouldn't need to initialize user_submitted for
each call site.
BUG=50423
TEST=none
Review URL: http://codereview.chromium.org/3074023
git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@54641 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
| C | bsd-3-clause | wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser |
c840bf5d4905d023d6495550759bc9cf08bb3aa3 | test/main.c | test/main.c |
#define CGLTF_IMPLEMENTATION
#include "../cgltf.h"
#include <stdio.h>
int main(int argc, char** argv)
{
if (argc < 2)
{
printf("err\n");
return -1;
}
FILE* f = fopen(argv[1], "rb");
if (!f)
{
return -2;
}
fseek(f, 0, SEEK_END);
long size = ftell(f);
fseek(f, 0, SEEK_SET);
void* buf = malloc(size);
fread(buf, size, 1, f);
fclose(f);
cgltf_options options = {0};
cgltf_data* data = NULL;
cgltf_result result = cgltf_parse(&options, buf, size, &data);
printf("Result: %d\n", result);
if (result == cgltf_result_success)
{
printf("Type: %u\n", data->file_type);
printf("Meshes: %lu\n", data->meshes_count);
}
free(buf);
cgltf_free(data);
return result;
}
|
#define CGLTF_IMPLEMENTATION
#include "../cgltf.h"
#include <stdio.h>
int main(int argc, char** argv)
{
if (argc < 2)
{
printf("err\n");
return -1;
}
cgltf_options options = {0};
cgltf_data* data = NULL;
cgltf_result result = cgltf_parse_file(&options, argv[1], &data);
if (result == cgltf_result_success)
result = cgltf_load_buffers(&options, data, argv[1]);
printf("Result: %d\n", result);
if (result == cgltf_result_success)
{
printf("Type: %u\n", data->file_type);
printf("Meshes: %lu\n", data->meshes_count);
}
cgltf_free(data);
return result;
}
| Add cgltf_parse_file and cgltf_load_buffers to test program | Add cgltf_parse_file and cgltf_load_buffers to test program
With this CI tests will run almost all of the code on glTF sample models
- this will validate that the code that loads external buffers and
parses Base64 data URIs is correct.
| C | mit | jkuhlmann/cgltf,jkuhlmann/cgltf,jkuhlmann/cgltf |
1c284ac5ec72c86b9ed787b3f4e1a6978c919370 | lib/Target/PowerPC/PPCTargetMachine.h | lib/Target/PowerPC/PPCTargetMachine.h | //===-- PPC32TargetMachine.h - PowerPC/Darwin TargetMachine ---*- C++ -*-=//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares the PowerPC/Darwin specific subclass of TargetMachine.
//
//===----------------------------------------------------------------------===//
#ifndef POWERPC_DARWIN_TARGETMACHINE_H
#define POWERPC_DARWIN_TARGETMACHINE_H
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetFrameInfo.h"
#include "llvm/PassManager.h"
#include "PowerPCTargetMachine.h"
#include <set>
namespace llvm {
class GlobalValue;
class IntrinsicLowering;
class PPC32TargetMachine : public PowerPCTargetMachine {
public:
PPC32TargetMachine(const Module &M, IntrinsicLowering *IL);
/// addPassesToEmitMachineCode - Add passes to the specified pass manager to
/// get machine code emitted. This uses a MachineCodeEmitter object to handle
/// actually outputting the machine code and resolving things like the address
/// of functions. This method should returns true if machine code emission is
/// not supported.
///
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
MachineCodeEmitter &MCE);
static unsigned getModuleMatchQuality(const Module &M);
};
} // end namespace llvm
#endif
| //===-- PPC32TargetMachine.h - PowerPC/Darwin TargetMachine ---*- C++ -*-=//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares the PowerPC/Darwin specific subclass of TargetMachine.
//
//===----------------------------------------------------------------------===//
#ifndef POWERPC_DARWIN_TARGETMACHINE_H
#define POWERPC_DARWIN_TARGETMACHINE_H
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetFrameInfo.h"
#include "llvm/PassManager.h"
#include "PowerPCTargetMachine.h"
namespace llvm {
class IntrinsicLowering;
class PPC32TargetMachine : public PowerPCTargetMachine {
public:
PPC32TargetMachine(const Module &M, IntrinsicLowering *IL);
/// addPassesToEmitMachineCode - Add passes to the specified pass manager to
/// get machine code emitted. This uses a MachineCodeEmitter object to handle
/// actually outputting the machine code and resolving things like the address
/// of functions. This method should returns true if machine code emission is
/// not supported.
///
virtual bool addPassesToEmitMachineCode(FunctionPassManager &PM,
MachineCodeEmitter &MCE);
static unsigned getModuleMatchQuality(const Module &M);
};
} // end namespace llvm
#endif
| Remove an unneeded header and forward declaration | Remove an unneeded header and forward declaration
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@15722 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap |
27206db97255a92a96619810727c8bb03e7907e0 | Globals.h | Globals.h | /*
Mace - http://www.macehq.cx
Copyright 1999-2004
See the file README for more information
*/
#ifndef GLOBALS_H
#define GLOBALS_H
#ifndef _MaceTypes
#define _MaceTypes
typedef unsigned char U8;
typedef char S8;
typedef unsigned short U16;
typedef signed short S16;
//Note: on 64-bit machines, replace "long" with "int"
typedef unsigned long U32;
typedef signed long S32;
#endif
void App_Exit(void);
//Same as App_Exit2(), except that this calls setdis()
void App_Exit2(void);
U16 FlipW(U16 a);
U32 FlipL(U32 a);
void HexW (U16 n, char * String);
void HexL (U32 n, char * String);
#endif //GLOBALS_H
| /*
Mace - http://www.macehq.cx
Copyright 1999-2004
See the file README for more information
*/
#ifndef GLOBALS_H
#define GLOBALS_H
#ifndef _MaceTypes
#define _MaceTypes
typedef unsigned char U8;
typedef signed char S8;
typedef unsigned short U16;
typedef signed short S16;
//Note: on 64-bit machines, replace "long" with "int"
#if __LP64__
typedef unsigned int U32;
typedef signed int S32;
#else
typedef unsigned long U32;
typedef signed long S32;
#endif
#endif
void App_Exit(void);
//Same as App_Exit2(), except that this calls setdis()
void App_Exit2(void);
U16 FlipW(U16 a);
U32 FlipL(U32 a);
void HexW (U16 n, char * String);
void HexL (U32 n, char * String);
#endif //GLOBALS_H
| Fix U32 and S32 on LP64 architectures. | Fix U32 and S32 on LP64 architectures.
| C | lgpl-2.1 | MaddTheSane/Mace,MaddTheSane/Mace |
3b78d640bae703c1c5c88c8e87f313d30f58249b | tests/regression/31-ikind-aware-ints/09-signed-negate.c | tests/regression/31-ikind-aware-ints/09-signed-negate.c | //PARAM: --disable ana.int.interval --enable ana.int.wrap_on_signed_overflow
#include <assert.h>
int main(){
int a = 0;
// maximum value for long long
signed long long s = 9223372036854775807;
assert(s > 9223372036854775806);
signed long long t = s + 2;
// Signed overflow - The following assertion only works with ana.int.wrap_on_signed_overflow enabled
assert(t == -9223372036854775807);
return 0;
}
| Add test for signed wrap-around with ana.int.wrap_on_signed_overflow | Add test for signed wrap-around with ana.int.wrap_on_signed_overflow
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
219edae4202ef451a3d084a4678c0cf861ccff0a | testsuite/breakdancer/disable_optimize.h | testsuite/breakdancer/disable_optimize.h | /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#ifndef DISABLE_OPTIMIZE_H
#define DISABLE_OPTIMIZE_H 1
/* avoid wasting time trying to optimize those countless test functions */
#if defined(__clang__)
/*
* Works for Alk since clang-3.5.
* Unfortunately it looks like Apple have their own versioning scheme for
* clang, because mine (Trond) reports itself as 5.1 and does not have
* the pragma.
*/
#if ((__clang_major__ * 0x100 + __clang_minor) >= 0x305) && !defined(__APPLE__)
#pragma clang optimize off
#endif
#elif defined(__GNUC__)
/*
* gcc docs indicate that pragma optimize is supported since 4.4. Earlier
* versions will emit harmless warning.
*/
#if ((__GNUC__ * 0x100 + __GNUC_MINOR__) >= 0x0404)
#pragma GCC optimize ("O0")
#endif
#endif /* __GNUC__ */
#endif
| /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#ifndef DISABLE_OPTIMIZE_H
#define DISABLE_OPTIMIZE_H 1
/* According to MB-11846 we have some misconfigured vm's unable to
* compile the source code without enabling optimization. Add a workaround
* for those vm's until they're fixed
*/
#ifndef COUCHBASE_OPTIMIZE_BREAKDANCER_TEST
/* avoid wasting time trying to optimize those countless test functions */
#if defined(__clang__)
/*
* Works for Alk since clang-3.5.
* Unfortunately it looks like Apple have their own versioning scheme for
* clang, because mine (Trond) reports itself as 5.1 and does not have
* the pragma.
*/
#if ((__clang_major__ * 0x100 + __clang_minor) >= 0x305) && !defined(__APPLE__)
#pragma clang optimize off
#endif
#elif defined(__GNUC__)
/*
* gcc docs indicate that pragma optimize is supported since 4.4. Earlier
* versions will emit harmless warning.
*/
#if ((__GNUC__ * 0x100 + __GNUC_MINOR__) >= 0x0404)
#pragma GCC optimize ("O0")
#endif
#endif /* __GNUC__ */
#endif /* COUCHBASE_OPTIMIZE_BREAKDANCER_TEST */
#endif
| Add workaround for broken builders | MB-11846: Add workaround for broken builders
According to MB-11846 we have some misconfigured vm's unable to
compile the source code without enabling optimization. This
patch introduce a workaround to enable the optimization of the
breakdancer tests until the vm's is fixed. To use the workaround
define COUCHBASE_OPTIMIZE_BREAKDANCER_TEST during compilation.
Add -D CMAKE_C_FLAGS=-DCOUCHBASE_OPTIMIZE_BREAKDANCER_TEST to
the command line when invoking cmake.
Change-Id: I067548b39be9f52951afed0c30221e1d77926b93
Reviewed-on: http://review.couchbase.org/40165
Reviewed-by: Trond Norbye <[email protected]>
Tested-by: Trond Norbye <[email protected]>
| C | bsd-3-clause | jimwwalker/memcached,daverigby/kv_engine,couchbase/memcached,cloudrain21/memcached-1,cloudrain21/memcached-1,daverigby/kv_engine,couchbase/memcached,cloudrain21/memcached-1,daverigby/kv_engine,cloudrain21/memcached-1,mrkwse/memcached,daverigby/memcached,daverigby/memcached,owendCB/memcached,owendCB/memcached,daverigby/memcached,jimwwalker/memcached,owendCB/memcached,daverigby/kv_engine,couchbase/memcached,mrkwse/memcached,mrkwse/memcached,couchbase/memcached,owendCB/memcached,jimwwalker/memcached,mrkwse/memcached,daverigby/memcached |
d8462d5c45ef1ae42d19bb0ade365b8017282228 | cpp/module_impl.h | cpp/module_impl.h | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_CPP_MODULE_IMPL_H_
#define PPAPI_CPP_MODULE_IMPL_H_
#include "ppapi/cpp/module.h"
namespace {
template <typename T> class DeviceFuncs {
public:
explicit DeviceFuncs(const char* ifname) : ifname_(ifname) {}
operator T const*() {
if (!funcs_) {
funcs_ = reinterpret_cast<T const*>(
pp::Module::Get()->GetBrowserInterface(ifname_));
}
return funcs_;
}
// This version doesn't check for existence of the function object. It is
// used so that, for DeviceFuncs f, the expression:
// if (f) f->doSomething();
// checks the existence only once.
T const* operator->() const { return funcs_; }
private:
DeviceFuncs(const DeviceFuncs&other);
DeviceFuncs &operator=(const DeviceFuncs &other);
const char* ifname_;
T const* funcs_;
};
} // namespace
#endif // PPAPI_CPP_MODULE_IMPL_H_
| // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_CPP_MODULE_IMPL_H_
#define PPAPI_CPP_MODULE_IMPL_H_
#include "ppapi/cpp/module.h"
namespace {
template <typename T> class DeviceFuncs {
public:
explicit DeviceFuncs(const char* ifname) : ifname_(ifname), funcs_(NULL) {}
operator T const*() {
if (!funcs_) {
funcs_ = reinterpret_cast<T const*>(
pp::Module::Get()->GetBrowserInterface(ifname_));
}
return funcs_;
}
// This version doesn't check for existence of the function object. It is
// used so that, for DeviceFuncs f, the expression:
// if (f) f->doSomething();
// checks the existence only once.
T const* operator->() const { return funcs_; }
private:
DeviceFuncs(const DeviceFuncs&other);
DeviceFuncs &operator=(const DeviceFuncs &other);
const char* ifname_;
T const* funcs_;
};
} // namespace
#endif // PPAPI_CPP_MODULE_IMPL_H_
| Initialize DeviceFuncs::ifuncs_ to zero in constructor | Initialize DeviceFuncs::ifuncs_ to zero in constructor
| C | bsd-3-clause | humanai/ppapi,LinRaise/ppapi,Iwan12/ppapi,lio972/ppapi,macressler/ppapi,iofcas/ppapi,kaijajan/ppapi,Iwan12/ppapi,LinRaise/ppapi,thecocce/ppapi,jmnjmn/ppapi,melchi45/ppapi,johnnnylm/ppapi,melchi45/ppapi,johnnnylm/ppapi,melchi45/ppapi,Iwan12/ppapi,macressler/ppapi,Iwan12/ppapi,johnnnylm/ppapi,lio972/ppapi,kaijajan/ppapi,lio972/ppapi,Iwan12/ppapi,melchi45/ppapi,macressler/ppapi,johnnnylm/ppapi,jmnjmn/ppapi,jmnjmn/ppapi,humanai/ppapi,Gitzk/ppapi,iofcas/ppapi,Gitzk/ppapi,lio972/ppapi,lio972/ppapi,thecocce/ppapi,macressler/ppapi,iofcas/ppapi,humanai/ppapi,humanai/ppapi,thecocce/ppapi,macressler/ppapi,LinRaise/ppapi,kaijajan/ppapi,kaijajan/ppapi,johnnnylm/ppapi,thecocce/ppapi,LinRaise/ppapi,melchi45/ppapi,Gitzk/ppapi,jmnjmn/ppapi,iofcas/ppapi,thecocce/ppapi,LinRaise/ppapi,kaijajan/ppapi,jmnjmn/ppapi,iofcas/ppapi,Gitzk/ppapi,humanai/ppapi,Gitzk/ppapi |
cfc80a8794b405ccc2127fe6fa52100fe5cfcdfd | wocky/wocky-namespaces.h | wocky/wocky-namespaces.h |
#define WOCKY_XMPP_NS_STREAM \
(const gchar *)"http://etherx.jabber.org/streams"
#define WOCKY_XMPP_NS_TLS \
(const gchar *)"urn:ietf:params:xml:ns:xmpp-tls"
#define WOCKY_XMPP_NS_SASL_AUTH \
(const gchar *)"urn:ietf:params:xml:ns:xmpp-sasl"
|
#define WOCKY_XMPP_NS_STREAM \
(const gchar *)"http://etherx.jabber.org/streams"
#define WOCKY_XMPP_NS_TLS \
(const gchar *)"urn:ietf:params:xml:ns:xmpp-tls"
#define WOCKY_XMPP_NS_SASL_AUTH \
(const gchar *)"urn:ietf:params:xml:ns:xmpp-sasl"
#define WOCKY_XMPP_NS_XHTML_IM \
(const gchar *)"http://jabber.org/protocol/xhtml-im"
#define WOCKY_W3C_NS_XHTML \
(const gchar *)"http://www.w3.org/1999/xhtml"
| Add xhtml-im and w3c xhtml namespace | Add xhtml-im and w3c xhtml namespace
20070316212630-93b9a-bcdbd042585561b0f20076b5e7f5f1c41c1e2867.gz
| C | lgpl-2.1 | freedesktop-unofficial-mirror/wocky,noonien-d/wocky,freedesktop-unofficial-mirror/wocky,freedesktop-unofficial-mirror/wocky,noonien-d/wocky,noonien-d/wocky |
e09a55881f98ea0796fe591e6e3f9b8ea0c791ac | Sources/Docs/GPDocsSync.h | Sources/Docs/GPDocsSync.h | //
// Copyright (c) 2008 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import <Foundation/Foundation.h>
#import <GData/GData.h>
#import "GPSyncProtocol.h"
// Source for documents, spreadsheets, and presentations in Google Docs.
// Note: presentations currently won't have content data.
@interface GPDocsSync : NSObject <GPSyncSource> {
id<GPSyncManager> manager_; // weak reference
GDataServiceGoogleDocs* docService_;
GDataServiceGoogleSpreadsheet* spreadsheetService_;
NSMutableArray* docsToInflate_;
}
@end
| //
// Copyright (c) 2008 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import <Foundation/Foundation.h>
#import <GData/GData.h>
#import "GPSyncProtocol.h"
// Source for documents, spreadsheets, presentations, and PDFs in Google Docs.
// Note: PDFs currently won't have content data.
@interface GPDocsSync : NSObject <GPSyncSource> {
id<GPSyncManager> manager_; // weak reference
GDataServiceGoogleDocs* docService_;
GDataServiceGoogleSpreadsheet* spreadsheetService_;
NSMutableArray* docsToInflate_;
}
@end
| Update header comment to reflect the current state of the source. | Update header comment to reflect the current state of the source.
git-svn-id: c46e06cb57945f24bc44ee3ee8f795d5b6e634f5@64 c4e13eb7-e550-0410-89ee-d7df1d48aa01
| C | apache-2.0 | nagyistoce/precipitate,ericmckean/precipitate |
39ccb98b27cdb3a3e49af6866c781aa419ed55be | test/FrontendC/2010-07-08-DeclDebugLineNo.c | test/FrontendC/2010-07-08-DeclDebugLineNo.c | // RUN: %llvmgcc -S -O0 -g %s -o - | FileCheck %s
// Insure that dbg.declare lines for locals refer to correct line number records.
// Radar 8152866.
void foo() {
int l = 0; // line #4: CHECK: {{call.*llvm.dbg.declare.*%l.*\!dbg }}[[variable_l:![0-9]+]]
int p = 0; // line #5: CHECK: {{call.*llvm.dbg.declare.*%p.*\!dbg }}[[variable_p:![0-9]+]]
}
// Now match the line number records:
// CHECK: {{^}}[[variable_l]]{{ = metadata ![{]i32 5,}}
// CHECK: {{^}}[[variable_p]]{{ = metadata ![{]i32 6,}}
| Test case for r107843. Radar 8152866. | Test case for r107843. Radar 8152866.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@107907 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm |
|
42f61a65bf3d78263b54e74a70d52badbab53638 | include/login.h | include/login.h | /**
* The login information to access a server
*
* This class combines login, password and vhost
*
* @copyright 2014 Copernica BV
*/
/**
* Set up namespace
*/
namespace AMQP {
/**
* Class definition
*/
class Login
{
private:
/**
* The username
* @var string
*/
std::string _user;
/**
* The password
* @var string
*/
std::string _password;
public:
/**
* Constructor
* @param user
* @param password
*/
Login(const std::string &user, const std::string &password) :
_user(user), _password(password) {}
/**
* Constructor
*/
Login() :
_user("guest"), _password("guest") {}
/**
* Destructor
*/
virtual ~Login() {}
/**
* String representation in SASL PLAIN mode
* @return string
*/
std::string saslPlain()
{
// we need an initial string
std::string result("\0", 1);
// append other elements
return result.append(_user).append("\0",1).append(_password);
}
};
/**
* End of namespace
*/
}
| /**
* The login information to access a server
*
* This class combines login, password and vhost
*
* @copyright 2014 Copernica BV
*/
/**
* Set up namespace
*/
namespace AMQP {
/**
* Class definition
*/
class Login
{
private:
/**
* The username
* @var string
*/
std::string _user;
/**
* The password
* @var string
*/
std::string _password;
public:
/**
* Constructor
* @param user
* @param password
*/
Login(const std::string &user, const std::string &password) :
_user(user), _password(password) {}
/**
* Copy constructor
* @param login
*/
Login(const Login &login) :
_user(login._user), _password(login._password) {}
/**
* Constructor
*/
Login() :
_user("guest"), _password("guest") {}
/**
* Destructor
*/
virtual ~Login() {}
/**
* String representation in SASL PLAIN mode
* @return string
*/
std::string saslPlain()
{
// we need an initial string
std::string result("\0", 1);
// append other elements
return result.append(_user).append("\0",1).append(_password);
}
};
/**
* End of namespace
*/
}
| Copy constructor added to Login class | Copy constructor added to Login class | C | apache-2.0 | fantastory/AMQP-CPP,tangkingchun/AMQP-CPP,antoniomonty/AMQP-CPP,antoniomonty/AMQP-CPP,toolking/AMQP-CPP,fantastory/AMQP-CPP,tm604/AMQP-CPP,CopernicaMarketingSoftware/AMQP-CPP,CopernicaMarketingSoftware/AMQP-CPP,tangkingchun/AMQP-CPP,tm604/AMQP-CPP,toolking/AMQP-CPP,Kojoley/AMQP-CPP,Kojoley/AMQP-CPP |
6b272ab78968323483602717e140d60ad4ea93eb | core/base/inc/TVersionCheck.h | core/base/inc/TVersionCheck.h | // @(#)root/base:$Id$
// Author: Fons Rademakers 9/5/2007
/*************************************************************************
* Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TVersionCheck
#define ROOT_TVersionCheck
//////////////////////////////////////////////////////////////////////////
// //
// TVersionCheck //
// //
// Used to check if the shared library or plugin is compatible with //
// the current version of ROOT. //
// //
//////////////////////////////////////////////////////////////////////////
#ifdef R__CXXMODULES
#ifndef ROOT_TObject
#error "Building with modules currently requires this file to be #included through TObject.h"
#endif
#endif // R__CXXMODULES
#include "RVersion.h"
class TVersionCheck {
public:
TVersionCheck(int versionCode); // implemented in TSystem.cxx
};
// FIXME: Due to a modules bug: https://llvm.org/bugs/show_bug.cgi?id=31056
// our .o files get polluted with the gVersionCheck symbol despite it was not
// visible in this TU.
#ifndef R__CXXMODULES
#ifndef __CINT__
namespace ROOT {
static TVersionCheck gVersionCheck(ROOT_VERSION_CODE);
}
#endif
#endif
#endif
| // @(#)root/base:$Id$
// Author: Fons Rademakers 9/5/2007
/*************************************************************************
* Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TVersionCheck
#define ROOT_TVersionCheck
//////////////////////////////////////////////////////////////////////////
// //
// TVersionCheck //
// //
// Used to check if the shared library or plugin is compatible with //
// the current version of ROOT. //
// //
//////////////////////////////////////////////////////////////////////////
#include "RVersion.h"
class TVersionCheck {
public:
TVersionCheck(int versionCode); // implemented in TSystem.cxx
};
namespace ROOT {
static TVersionCheck gVersionCheck(ROOT_VERSION_CODE);
}
#endif
| Remove special cxxmodules case now that gVersionCheck is on ROOT::. | [core] Remove special cxxmodules case now that gVersionCheck is on ROOT::.
| C | lgpl-2.1 | olifre/root,olifre/root,root-mirror/root,olifre/root,root-mirror/root,root-mirror/root,root-mirror/root,karies/root,karies/root,karies/root,olifre/root,karies/root,karies/root,root-mirror/root,root-mirror/root,root-mirror/root,olifre/root,olifre/root,olifre/root,olifre/root,karies/root,root-mirror/root,olifre/root,karies/root,olifre/root,root-mirror/root,root-mirror/root,olifre/root,karies/root,karies/root,karies/root,root-mirror/root,karies/root |
78a22a1dd7608accc960623f8e59c997c75602ea | RNUnifiedContacts/RNUnifiedContacts-Bridging-Header.h | RNUnifiedContacts/RNUnifiedContacts-Bridging-Header.h | //
// RNUnifiedContacts.h
// RNUnifiedContacts
//
// Created by Joshua Pinter on 2016-03-23.
// Copyright © 2016 Joshua Pinter. All rights reserved.
//
#ifndef RNUnifiedContacts_Bridging_Header_h
#define RNUnifiedContacts_Bridging_Header_h
#import <React/RCTBridgeModule.h>
#endif /* RNUnifiedContacts_Bridging_Header_h */
| //
// RNUnifiedContacts.h
// RNUnifiedContacts
//
// Created by Joshua Pinter on 2016-03-23.
// Copyright © 2016 Joshua Pinter. All rights reserved.
//
#ifndef RNUnifiedContacts_Bridging_Header_h
#define RNUnifiedContacts_Bridging_Header_h
#if __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"
#else
#import <React/RCTBridgeModule.h>
#endif
#endif /* RNUnifiedContacts_Bridging_Header_h */
| Support Pre 0.40 and Post 0.40 React Native. | Support Pre 0.40 and Post 0.40 React Native.
Handle if else for importing `React/RCTBridgeModule.h`. | C | mit | joshuapinter/react-native-unified-contacts,joshuapinter/react-native-unified-contacts,joshuapinter/react-native-unified-contacts,joshuapinter/react-native-unified-contacts |
e6f7f05225eab16f2a63fa32e5952f6c6adedc23 | You-DataStore/operation.h | You-DataStore/operation.h | #pragma once
#ifndef YOU_DATASTORE_OPERATION_H_
#define YOU_DATASTORE_OPERATION_H_
#include <unordered_map>
#include "datastore.h"
namespace You {
namespace DataStore {
/// A pure virtual class of operations to be put into transaction stack
class IOperation {
public:
IOperation() = default;
~IOperation() = default;
/// Executes the operation
virtual void run(DataStore::STask) = 0;
};
} // namespace DataStore
} // namespace You
#endif // YOU_DATASTORE_OPERATION_H_
| #pragma once
#ifndef YOU_DATASTORE_OPERATION_H_
#define YOU_DATASTORE_OPERATION_H_
#include <unordered_map>
#include "datastore.h"
namespace You {
namespace DataStore {
/// A pure virtual class of operations to be put into transaction stack
class IOperation {
public:
IOperation();
virtual ~IOperation();
/// Executes the operation
virtual void run(DataStore::STask) = 0;
};
} // namespace DataStore
} // namespace You
#endif // YOU_DATASTORE_OPERATION_H_
| Make IOperation destructor virtual, remove redundant default | Make IOperation destructor virtual, remove redundant default
| C | mit | cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main |
08b2bc83dbf7db69f59cc3b7ce0a23c735eee7a6 | src/untrusted/irt/irt_ppapi.h | src/untrusted/irt/irt_ppapi.h | /*
* Copyright (c) 2011 The Native Client 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 NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_PPAPI_H_
#define NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_PPAPI_H_ 1
#include <stddef.h>
#include "ppapi/c/ppp.h"
struct PP_StartFunctions {
int32_t (*PPP_InitializeModule)(PP_Module module_id,
PPB_GetInterface get_browser_interface);
void (*PPP_ShutdownModule)();
const void *(*PPP_GetInterface)(const char *interface_name);
};
struct PP_ThreadFunctions {
/*
* This is a cut-down version of pthread_create()/pthread_join().
* We omit thread creation attributes and the thread's return value.
*
* We use uintptr_t as the thread ID type because pthread_t is not
* part of the stable ABI; a user thread library might choose an
* arbitrary size for its own pthread_t.
*/
int (*thread_create)(uintptr_t *tid,
void (*func)(void *thread_argument),
void *thread_argument);
int (*thread_join)(uintptr_t tid);
};
typedef void (*PP_StartFunc)(const struct PP_StartFunctions *funcs);
typedef void (*PP_RegisterThreadFuncs)(const struct PP_ThreadFunctions *funcs);
#endif
| /*
* Copyright (c) 2011 The Native Client 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 NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_PPAPI_H_
#define NATIVE_CLIENT_SRC_UNTRUSTED_IRT_IRT_PPAPI_H_ 1
#include <stddef.h>
#include "ppapi/c/ppp.h"
struct PP_StartFunctions {
int32_t (*PPP_InitializeModule)(PP_Module module_id,
PPB_GetInterface get_browser_interface);
void (*PPP_ShutdownModule)();
const void *(*PPP_GetInterface)(const char *interface_name);
};
struct PP_ThreadFunctions {
/*
* This is a cut-down version of pthread_create()/pthread_join().
* We omit thread creation attributes and the thread's return value.
*
* We use uintptr_t as the thread ID type because pthread_t is not
* part of the stable ABI; a user thread library might choose an
* arbitrary size for its own pthread_t.
*/
int (*thread_create)(uintptr_t *tid,
void (*func)(void *thread_argument),
void *thread_argument);
int (*thread_join)(uintptr_t tid);
};
#endif
| Remove two unused PPAPI-related typedefs | Remove two unused PPAPI-related typedefs
These typedefs are left over from an earlier iteration of the IRT
interface (prior to the interface being stabilised) which was removed
in r5108.
BUG=none
TEST=build
Review URL: https://codereview.chromium.org/11016034
git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@9913 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
| C | bsd-3-clause | sbc100/native_client,nacl-webkit/native_client,sbc100/native_client,nacl-webkit/native_client,nacl-webkit/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,nacl-webkit/native_client,nacl-webkit/native_client |
756875db5caa3eb90a02309d3fed22dd33a10999 | include/lldb/Host/HostGetOpt.h | include/lldb/Host/HostGetOpt.h | //===-- GetOpt.h ------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#pragma once
#ifndef _MSC_VER
#include <unistd.h>
#include <getopt.h>
#else
#include <lldb/Host/windows/GetOptInc.h>
#endif | //===-- GetOpt.h ------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#pragma once
#ifndef _MSC_VER
#include <unistd.h>
#include <getopt.h>
#else
#include <lldb/Host/windows/GetOptInc.h>
#endif
| Add newline at end of file, clang compiler warning. | Add newline at end of file, clang compiler warning.
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@201743 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb |
91a0c9a9633a1d795934091fec5abd053730758c | hist/inc/TH1I.h | hist/inc/TH1I.h | // @(#)root/hist:$Name: $:$Id: TH1I.h,v 1.1 2002/05/18 11:02:49 brun Exp $
// Author: Rene Brun 08/09/2003
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TH1I
#define ROOT_TH1I
//////////////////////////////////////////////////////////////////////////
// //
// TH1I //
// //
// 1-Dim histogram with a 4 bits integer per channel //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TH1
#include "TH1.h"
#endif
#endif
| // @(#)root/hist:$Name: $:$Id: TH1I.h,v 1.1 2003/09/08 12:50:23 brun Exp $
// Author: Rene Brun 08/09/2003
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TH1I
#define ROOT_TH1I
//////////////////////////////////////////////////////////////////////////
// //
// TH1I //
// //
// 1-Dim histogram with a 32 bits integer per channel //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TH1
#include "TH1.h"
#endif
#endif
| Fix a typo (thanks to Robert Hatcher) | Fix a typo (thanks to Robert Hatcher)
git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@10919 27541ba8-7e3a-0410-8455-c3a389f83636
| C | lgpl-2.1 | omazapa/root-old,arch1tect0r/root,perovic/root,nilqed/root,CristinaCristescu/root,esakellari/my_root_for_test,simonpf/root,abhinavmoudgil95/root,simonpf/root,mattkretz/root,Y--/root,tc3t/qoot,veprbl/root,0x0all/ROOT,buuck/root,sbinet/cxx-root,omazapa/root,smarinac/root,simonpf/root,bbockelm/root,beniz/root,vukasinmilosevic/root,buuck/root,nilqed/root,ffurano/root5,omazapa/root,olifre/root,dfunke/root,Duraznos/root,krafczyk/root,omazapa/root-old,ffurano/root5,CristinaCristescu/root,perovic/root,georgtroska/root,smarinac/root,davidlt/root,satyarth934/root,0x0all/ROOT,mkret2/root,gganis/root,simonpf/root,evgeny-boger/root,Duraznos/root,abhinavmoudgil95/root,BerserkerTroll/root,arch1tect0r/root,omazapa/root,mkret2/root,esakellari/my_root_for_test,Y--/root,mattkretz/root,CristinaCristescu/root,lgiommi/root,beniz/root,sbinet/cxx-root,veprbl/root,pspe/root,nilqed/root,simonpf/root,karies/root,beniz/root,bbockelm/root,CristinaCristescu/root,lgiommi/root,BerserkerTroll/root,zzxuanyuan/root-compressor-dummy,pspe/root,bbockelm/root,gbitzes/root,0x0all/ROOT,agarciamontoro/root,vukasinmilosevic/root,zzxuanyuan/root-compressor-dummy,strykejern/TTreeReader,agarciamontoro/root,arch1tect0r/root,root-mirror/root,olifre/root,abhinavmoudgil95/root,perovic/root,satyarth934/root,satyarth934/root,strykejern/TTreeReader,esakellari/root,Y--/root,BerserkerTroll/root,evgeny-boger/root,sirinath/root,davidlt/root,bbockelm/root,evgeny-boger/root,veprbl/root,mattkretz/root,perovic/root,abhinavmoudgil95/root,zzxuanyuan/root,vukasinmilosevic/root,mattkretz/root,Duraznos/root,bbockelm/root,alexschlueter/cern-root,buuck/root,omazapa/root-old,mhuwiler/rootauto,sawenzel/root,davidlt/root,zzxuanyuan/root,sbinet/cxx-root,perovic/root,olifre/root,lgiommi/root,zzxuanyuan/root-compressor-dummy,lgiommi/root,CristinaCristescu/root,omazapa/root-old,zzxuanyuan/root-compressor-dummy,mkret2/root,zzxuanyuan/root-compressor-dummy,bbockelm/root,simonpf/root,dfunke/root,tc3t/qoot,strykejern/TTreeReader,dfunke/root,arch1tect0r/root,sirinath/root,evgeny-boger/root,mattkretz/root,Dr15Jones/root,jrtomps/root,smarinac/root,davidlt/root,sbinet/cxx-root,davidlt/root,arch1tect0r/root,satyarth934/root,dfunke/root,beniz/root,jrtomps/root,alexschlueter/cern-root,vukasinmilosevic/root,jrtomps/root,thomaskeck/root,zzxuanyuan/root,krafczyk/root,arch1tect0r/root,dfunke/root,Y--/root,arch1tect0r/root,zzxuanyuan/root-compressor-dummy,veprbl/root,sirinath/root,georgtroska/root,smarinac/root,nilqed/root,karies/root,davidlt/root,esakellari/my_root_for_test,cxx-hep/root-cern,vukasinmilosevic/root,satyarth934/root,esakellari/root,pspe/root,esakellari/my_root_for_test,gganis/root,kirbyherm/root-r-tools,sawenzel/root,krafczyk/root,pspe/root,sirinath/root,evgeny-boger/root,Dr15Jones/root,veprbl/root,veprbl/root,nilqed/root,vukasinmilosevic/root,gbitzes/root,beniz/root,tc3t/qoot,mkret2/root,BerserkerTroll/root,gganis/root,0x0all/ROOT,esakellari/root,esakellari/root,karies/root,agarciamontoro/root,bbockelm/root,agarciamontoro/root,arch1tect0r/root,arch1tect0r/root,sbinet/cxx-root,ffurano/root5,mhuwiler/rootauto,jrtomps/root,karies/root,abhinavmoudgil95/root,tc3t/qoot,thomaskeck/root,mkret2/root,olifre/root,kirbyherm/root-r-tools,mattkretz/root,zzxuanyuan/root-compressor-dummy,sirinath/root,esakellari/root,root-mirror/root,davidlt/root,tc3t/qoot,satyarth934/root,Duraznos/root,georgtroska/root,mhuwiler/rootauto,BerserkerTroll/root,nilqed/root,zzxuanyuan/root-compressor-dummy,tc3t/qoot,agarciamontoro/root,pspe/root,thomaskeck/root,smarinac/root,olifre/root,pspe/root,kirbyherm/root-r-tools,Y--/root,tc3t/qoot,0x0all/ROOT,olifre/root,beniz/root,sbinet/cxx-root,sawenzel/root,sawenzel/root,georgtroska/root,smarinac/root,Duraznos/root,esakellari/root,esakellari/root,root-mirror/root,gganis/root,ffurano/root5,zzxuanyuan/root-compressor-dummy,omazapa/root,bbockelm/root,sbinet/cxx-root,mhuwiler/rootauto,pspe/root,sirinath/root,krafczyk/root,abhinavmoudgil95/root,karies/root,tc3t/qoot,0x0all/ROOT,omazapa/root-old,arch1tect0r/root,mkret2/root,cxx-hep/root-cern,georgtroska/root,evgeny-boger/root,davidlt/root,jrtomps/root,esakellari/my_root_for_test,mhuwiler/rootauto,karies/root,alexschlueter/cern-root,mhuwiler/rootauto,0x0all/ROOT,sawenzel/root,bbockelm/root,agarciamontoro/root,Duraznos/root,tc3t/qoot,gganis/root,zzxuanyuan/root-compressor-dummy,davidlt/root,lgiommi/root,gbitzes/root,Duraznos/root,zzxuanyuan/root,krafczyk/root,olifre/root,vukasinmilosevic/root,BerserkerTroll/root,tc3t/qoot,mattkretz/root,kirbyherm/root-r-tools,thomaskeck/root,Duraznos/root,mkret2/root,omazapa/root,Y--/root,sawenzel/root,root-mirror/root,thomaskeck/root,zzxuanyuan/root,olifre/root,georgtroska/root,veprbl/root,simonpf/root,karies/root,arch1tect0r/root,gbitzes/root,esakellari/my_root_for_test,buuck/root,buuck/root,gganis/root,abhinavmoudgil95/root,jrtomps/root,olifre/root,0x0all/ROOT,Dr15Jones/root,Dr15Jones/root,georgtroska/root,georgtroska/root,veprbl/root,esakellari/root,lgiommi/root,krafczyk/root,0x0all/ROOT,mattkretz/root,krafczyk/root,smarinac/root,evgeny-boger/root,dfunke/root,BerserkerTroll/root,karies/root,cxx-hep/root-cern,jrtomps/root,CristinaCristescu/root,perovic/root,root-mirror/root,root-mirror/root,sawenzel/root,perovic/root,satyarth934/root,beniz/root,omazapa/root,jrtomps/root,lgiommi/root,gbitzes/root,Y--/root,thomaskeck/root,thomaskeck/root,mattkretz/root,nilqed/root,perovic/root,evgeny-boger/root,sirinath/root,satyarth934/root,agarciamontoro/root,omazapa/root-old,alexschlueter/cern-root,beniz/root,BerserkerTroll/root,omazapa/root,kirbyherm/root-r-tools,sirinath/root,vukasinmilosevic/root,smarinac/root,lgiommi/root,satyarth934/root,satyarth934/root,abhinavmoudgil95/root,mhuwiler/rootauto,sirinath/root,omazapa/root-old,georgtroska/root,evgeny-boger/root,karies/root,evgeny-boger/root,esakellari/root,mkret2/root,gbitzes/root,strykejern/TTreeReader,jrtomps/root,buuck/root,davidlt/root,gbitzes/root,gbitzes/root,agarciamontoro/root,smarinac/root,dfunke/root,thomaskeck/root,agarciamontoro/root,omazapa/root,gbitzes/root,krafczyk/root,vukasinmilosevic/root,gbitzes/root,perovic/root,zzxuanyuan/root,buuck/root,root-mirror/root,sawenzel/root,CristinaCristescu/root,beniz/root,ffurano/root5,omazapa/root-old,ffurano/root5,esakellari/my_root_for_test,abhinavmoudgil95/root,buuck/root,mhuwiler/rootauto,zzxuanyuan/root,mattkretz/root,mhuwiler/rootauto,simonpf/root,sbinet/cxx-root,perovic/root,abhinavmoudgil95/root,BerserkerTroll/root,buuck/root,mattkretz/root,krafczyk/root,sbinet/cxx-root,lgiommi/root,mkret2/root,olifre/root,Y--/root,Duraznos/root,cxx-hep/root-cern,lgiommi/root,smarinac/root,pspe/root,kirbyherm/root-r-tools,pspe/root,dfunke/root,gganis/root,mkret2/root,beniz/root,alexschlueter/cern-root,zzxuanyuan/root,vukasinmilosevic/root,gganis/root,sbinet/cxx-root,vukasinmilosevic/root,cxx-hep/root-cern,pspe/root,cxx-hep/root-cern,cxx-hep/root-cern,CristinaCristescu/root,sirinath/root,strykejern/TTreeReader,satyarth934/root,veprbl/root,simonpf/root,sawenzel/root,CristinaCristescu/root,georgtroska/root,simonpf/root,perovic/root,veprbl/root,gganis/root,lgiommi/root,zzxuanyuan/root,jrtomps/root,gganis/root,gbitzes/root,buuck/root,omazapa/root-old,krafczyk/root,buuck/root,alexschlueter/cern-root,omazapa/root,simonpf/root,Y--/root,pspe/root,esakellari/root,BerserkerTroll/root,Dr15Jones/root,jrtomps/root,karies/root,zzxuanyuan/root,zzxuanyuan/root,abhinavmoudgil95/root,olifre/root,agarciamontoro/root,esakellari/my_root_for_test,thomaskeck/root,Y--/root,bbockelm/root,veprbl/root,Duraznos/root,nilqed/root,root-mirror/root,alexschlueter/cern-root,Duraznos/root,sawenzel/root,zzxuanyuan/root-compressor-dummy,dfunke/root,mkret2/root,davidlt/root,beniz/root,sawenzel/root,strykejern/TTreeReader,sbinet/cxx-root,dfunke/root,omazapa/root,evgeny-boger/root,gganis/root,ffurano/root5,root-mirror/root,thomaskeck/root,agarciamontoro/root,nilqed/root,krafczyk/root,esakellari/root,georgtroska/root,omazapa/root-old,Dr15Jones/root,mhuwiler/rootauto,sirinath/root,omazapa/root-old,nilqed/root,root-mirror/root,esakellari/my_root_for_test,cxx-hep/root-cern,dfunke/root,omazapa/root,nilqed/root,CristinaCristescu/root,root-mirror/root,Y--/root,CristinaCristescu/root,mhuwiler/rootauto,bbockelm/root,esakellari/my_root_for_test,zzxuanyuan/root,BerserkerTroll/root,strykejern/TTreeReader,kirbyherm/root-r-tools,karies/root,Dr15Jones/root |
aebaf3931443eadaba8519dc96a25026e03eaf27 | FastEasyMapping/Source/Core/Store/FEMManagedObjectStore.h | FastEasyMapping/Source/Core/Store/FEMManagedObjectStore.h | // For License please refer to LICENSE file in the root of FastEasyMapping project
#import "FEMObjectStore.h"
@class NSManagedObjectContext;
@interface FEMManagedObjectStore : FEMObjectStore
- (nonnull instancetype)initWithContext:(nonnull NSManagedObjectContext *)context NS_DESIGNATED_INITIALIZER;
@property (nonatomic, strong, readonly, nonnull) NSManagedObjectContext *context;
@property (nonatomic) BOOL saveContextOnCommit;
@end | // For License please refer to LICENSE file in the root of FastEasyMapping project
#import "FEMObjectStore.h"
NS_ASSUME_NONNULL_BEGIN
@class NSManagedObjectContext;
@interface FEMManagedObjectStore : FEMObjectStore
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithContext:(NSManagedObjectContext *)context NS_DESIGNATED_INITIALIZER;
@property (nonatomic, strong, readonly) NSManagedObjectContext *context;
@property (nonatomic) BOOL saveContextOnCommit;
@end
NS_ASSUME_NONNULL_END | Mark init as unavailable for ObjectStore | Mark init as unavailable for ObjectStore
| C | mit | k06a/FastEasyMapping |
16d5bae3963950082447dad230f827a134f0cc68 | webrtc/system_wrappers/include/critical_section_wrapper.h | webrtc/system_wrappers/include/critical_section_wrapper.h | /*
* Copyright 2017 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CRITICAL_SECTION_WRAPPER_H_
#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CRITICAL_SECTION_WRAPPER_H_
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CRITICAL_SECTION_WRAPPER_H_
| Add empty header to fix internal project. | Add empty header to fix internal project.
BUG=None
[email protected]
Review-Url: https://codereview.webrtc.org/2790493006
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#17492}
| C | bsd-3-clause | TimothyGu/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc,TimothyGu/libilbc,ShiftMediaProject/libilbc |
|
431a554ee2e450eae7eaceaf3c5d9c055b746ef8 | Pod/Classes/SEEngineProtocol.h | Pod/Classes/SEEngineProtocol.h | //
// SEEngineProtocol.h
// Pods
//
// Created by Danil Tulin on 3/14/16.
//
//
#import <Foundation/Foundation.h>
@protocol EngineProtocol <NSObject>
@required
- (void)feedBGRAImageData:(u_int8_t *)data
width:(NSUInteger)width
height:(NSUInteger)height;
@property (nonatomic) float progress;
@property (nonatomic) BOOL isAbleToProcess;
@end
| //
// SEEngineProtocol.h
// Pods
//
// Created by Danil Tulin on 3/14/16.
//
//
#import <Foundation/Foundation.h>
@protocol EngineProtocol <NSObject>
@required
- (void)feedBGRAImageData:(u_int8_t *)data
width:(NSUInteger)width
height:(NSUInteger)height;
@property (nonatomic) float progress;
@property (nonatomic) BOOL isAbleToProcess;
- (void)startSession;
- (void)stopSession;
@end
| Add start / stop session methods | Add start / stop session methods
| C | mit | tulindanil/SEUIKit |
7377733e9bce6e5e38b913414f9173395b7d6448 | src/base/defs.h | src/base/defs.h | /* Various definitions needed for compatibility with various
compilers (MSC) and platforms (Windows). */
#ifndef BASE_DEFS_H
#define BASE_DEFS_H
#ifdef _MSC_VER
#if !defined(__cplusplus)
#define inline __inline
#endif
#define __attribute__(x)
#endif
#ifdef _WIN32
/* Target Windows XP */
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#endif
#endif
| Add macros for targeting Windows XP | Add macros for targeting Windows XP
| C | bsd-2-clause | depp/sglib,depp/sglib |
|
e3e83ed7cbf0a8bdca905ecacf29a57a99ebe01a | Source/Objects/GTLBatchQuery.h | Source/Objects/GTLBatchQuery.h | /* Copyright (c) 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// GTLBatchQuery.h
//
#import "GTLQuery.h"
@interface GTLBatchQuery : NSObject <GTLQueryProtocol> {
@private
NSMutableArray *queries_;
NSMutableDictionary *requestIDMap_;
BOOL skipAuthorization_;
}
// Queries included in this batch. Each query should have a unique requestID.
@property (retain) NSArray *queries;
// Clients may set this to NO to disallow authorization. Defaults to YES.
@property (assign) BOOL shouldSkipAuthorization;
+ (id)batchQuery;
+ (id)batchQueryWithQueries:(NSArray *)array;
- (void)addQuery:(GTLQuery *)query;
- (GTLQuery *)queryForRequestID:(NSString *)requestID;
@end
| /* Copyright (c) 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// GTLBatchQuery.h
//
#import "GTLQuery.h"
@interface GTLBatchQuery : NSObject <GTLQueryProtocol> {
@private
NSMutableArray *queries_;
NSMutableDictionary *requestIDMap_;
BOOL skipAuthorization_;
}
// Queries included in this batch. Each query should have a unique requestID.
@property (retain) NSArray *queries;
// Clients may set this to YES to disallow authorization. Defaults to NO.
@property (assign) BOOL shouldSkipAuthorization;
+ (id)batchQuery;
+ (id)batchQueryWithQueries:(NSArray *)array;
- (void)addQuery:(GTLQuery *)query;
- (GTLQuery *)queryForRequestID:(NSString *)requestID;
@end
| Fix comment on shouldSkipAuthorization property | Fix comment on shouldSkipAuthorization property | C | apache-2.0 | creationst/google-api-objectivec-client |
cb0996871bc25a7f4687130bcd7ca706c15d1474 | test/tools/know_btye_sequences.c | test/tools/know_btye_sequences.c | //Compile this program with -O0
#include <stdlib.h>
#include <unistd.h>
int main(void) {
char *in_data_segment[] = "0xC0xA0xF0xE";
char in_stack[] = {0xd, 0xe, 0xa, 0xd, 0xb, 0xe, 0xe, 0xf};
char *in_heap = malloc(7 * sizeof(char));
in_heap[0] = 0xb;
in_heap[1] = 0xe;
in_heap[2] = 0xb;
in_heap[3] = 0xe;
in_heap[4] = 0xf;
in_heap[5] = 0xe;
in_heap[6] = 0x0;
for (;;) sleep(1);
return 0;
}
| Add a sample program for testing memory search. | Add a sample program for testing memory search.
This program places known bytes sequences in the process' stack, heap
and data segment.
NOTE: This is not exhaustive.
| C | mpl-2.0 | mozilla/masche,mozilla/masche |
|
b18e2d7842de719b60e2902f201d745897749c4b | mt.h | mt.h | #ifndef _MATH_MT_H_
#define _MATH_MT_H_
//#if defined(_MSC_VER) && (_MSC_VER <= 1600) // sufficient
#if defined(_MSC_VER) // better?
typedef unsigned __int32 uint32_t;
#elif defined(__linux__) || defined(__GLIBC__) || defined(__WIN32__) || defined(__APPLE__)
#include <stdint.h>
#elif defined(__osf__)
#include <inttypes.h>
#else
#include <sys/types.h>
#endif
enum { N = 624, M = 397 };
struct mt {
uint32_t mt[N];
int mti;
uint32_t seed;
};
struct mt *mt_init(void);
void mt_free(struct mt *self);
uint32_t mt_get_seed(struct mt *self);
void mt_init_seed(struct mt *self, uint32_t seed);
void mt_setup_array(struct mt *self, uint32_t *array, int n);
double mt_genrand(struct mt *self);
#endif
| #ifndef _MATH_MT_H_
#define _MATH_MT_H_
#if defined(_MSC_VER) && (_MSC_VER < 1600) // for MS Visual Studio prior to 2010
typedef unsigned __int32 uint32_t;
#elif defined(__linux__) || defined(__GLIBC__) || defined(__WIN32__) || defined(_MSC_VER) || defined(__APPLE__)
#include <stdint.h>
#elif defined(__osf__)
#include <inttypes.h>
#else
#include <sys/types.h>
#endif
enum { N = 624, M = 397 };
struct mt {
uint32_t mt[N];
int mti;
uint32_t seed;
};
struct mt *mt_init(void);
void mt_free(struct mt *self);
uint32_t mt_get_seed(struct mt *self);
void mt_init_seed(struct mt *self, uint32_t seed);
void mt_setup_array(struct mt *self, uint32_t *array, int n);
double mt_genrand(struct mt *self);
#endif
| Include <stdint.h> for MS Visual Studio 2010 and above | Include <stdint.h> for MS Visual Studio 2010 and above
| C | bsd-3-clause | amenonsen/Math-Random-MT,amenonsen/Math-Random-MT |
9ae21777a3dfd8aecc37dd13e24cf8c47b657503 | preproc_if_check_example_success.c | preproc_if_check_example_success.c | /**
* Copyright (c) 2015, Trellis-Logic
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* The datasheet specifies this location should be on a dword boundary
*/
#define HARDWARE_WIDGET_BASE_REGISTER_LOCATION 0x1000
struct hardware_widget
{
void *base_register_location;
};
struct hardware_widget g_hardware_widget;
/**
* Initializes structure with parameters for access of the hardware widget
* @param hardware_widget The structure to initialize
*/
#if ((HARDWARE_WIDGET_BASE_REGISTER_LOCATION & 0x3) != 0 )
#error "Hardware widget datatsheet specifies the base register should be at a DWORD boundary!"
#endif
static void init_hardware(struct hardware_widget *widget)
{
widget->base_register_location=(void *)HARDWARE_WIDGET_BASE_REGISTER_LOCATION;
}
int main(void)
{
init_hardware(&g_hardware_widget);
}
| Add preprocessor if check example | Add preprocessor if check example
| C | bsd-2-clause | Trellis-Logic/CPreprocessorTricks |
|
caa860cede791d4787e773624a7627ef963fbeed | src/QGCConfig.h | src/QGCConfig.h | #ifndef QGC_CONFIGURATION_H
#define QGC_CONFIGURATION_H
#include <QString>
/** @brief Polling interval in ms */
#define SERIAL_POLL_INTERVAL 4
/** @brief Heartbeat emission rate, in Hertz (times per second) */
#define MAVLINK_HEARTBEAT_DEFAULT_RATE 1
#define WITH_TEXT_TO_SPEECH 1
#define QGC_APPLICATION_NAME "QGroundControl"
#define QGC_APPLICATION_VERSION "v. 2.0.3 (beta)"
namespace QGC
{
const QString APPNAME = "QGROUNDCONTROL";
const QString ORG_NAME = "QGROUNDCONTROL.ORG"; //can be customized by forks to e.g. mycompany.com to maintain separate Settings for customized apps
const QString ORG_DOMAIN = "org.qgroundcontrol";//can be customized by forks
const int APPLICATIONVERSION = 203; // 2.0.3
}
#endif // QGC_CONFIGURATION_H
| #ifndef QGC_CONFIGURATION_H
#define QGC_CONFIGURATION_H
#include <QString>
/** @brief Polling interval in ms */
#define SERIAL_POLL_INTERVAL 4
/** @brief Heartbeat emission rate, in Hertz (times per second) */
#define MAVLINK_HEARTBEAT_DEFAULT_RATE 1
#define WITH_TEXT_TO_SPEECH 1
#define QGC_APPLICATION_NAME "QGroundControl"
#define QGC_APPLICATION_VERSION_BASE "v2.0.3"
#define QGC_APPLICATION_VERSION_SUFFIX ".234 (Daily Build)"
#ifdef QGC_APPLICATION_VERSION_SUFFIX
#define QGC_APPLICATION_VERSION QGC_APPLICATION_VERSION_BASE QGC_APPLICATION_VERSION_SUFFIX
#else
#define QGC_APPLICATION_VERSION QGC_APPLICATION_VERSION_BASE " (Developer Build)"
#endif
namespace QGC
{
const QString APPNAME = "QGROUNDCONTROL";
const QString ORG_NAME = "QGROUNDCONTROL.ORG"; //can be customized by forks to e.g. mycompany.com to maintain separate Settings for customized apps
const QString ORG_DOMAIN = "org.qgroundcontrol";//can be customized by forks
const int APPLICATIONVERSION = 203; // 2.0.3
}
#endif // QGC_CONFIGURATION_H
| Allow version suffix from command line | Allow version suffix from command line
| C | agpl-3.0 | hejunbok/qgroundcontrol,caoxiongkun/qgroundcontrol,catch-twenty-two/qgroundcontrol,iidioter/qgroundcontrol,RedoXyde/PX4_qGCS,iidioter/qgroundcontrol,Hunter522/qgroundcontrol,TheIronBorn/qgroundcontrol,jy723/qgroundcontrol,ethz-asl/qgc_asl,LIKAIMO/qgroundcontrol,catch-twenty-two/qgroundcontrol,UAVenture/qgroundcontrol,dagoodma/qgroundcontrol,scott-eddy/qgroundcontrol,iidioter/qgroundcontrol,fizzaly/qgroundcontrol,remspoor/qgroundcontrol,RedoXyde/PX4_qGCS,ethz-asl/qgc_asl,scott-eddy/qgroundcontrol,scott-eddy/qgroundcontrol,greenoaktree/qgroundcontrol,LIKAIMO/qgroundcontrol,devbharat/qgroundcontrol,greenoaktree/qgroundcontrol,hejunbok/qgroundcontrol,catch-twenty-two/qgroundcontrol,kd0aij/qgroundcontrol,jy723/qgroundcontrol,CornerOfSkyline/qgroundcontrol,Hunter522/qgroundcontrol,TheIronBorn/qgroundcontrol,jy723/qgroundcontrol,lis-epfl/qgroundcontrol,CornerOfSkyline/qgroundcontrol,catch-twenty-two/qgroundcontrol,devbharat/qgroundcontrol,cfelipesouza/qgroundcontrol,iidioter/qgroundcontrol,LIKAIMO/qgroundcontrol,ethz-asl/qgc_asl,fizzaly/qgroundcontrol,iidioter/qgroundcontrol,fizzaly/qgroundcontrol,dagoodma/qgroundcontrol,scott-eddy/qgroundcontrol,TheIronBorn/qgroundcontrol,fizzaly/qgroundcontrol,kd0aij/qgroundcontrol,BMP-TECH/qgroundcontrol,TheIronBorn/qgroundcontrol,ethz-asl/qgc_asl,fizzaly/qgroundcontrol,nado1688/qgroundcontrol,greenoaktree/qgroundcontrol,caoxiongkun/qgroundcontrol,nado1688/qgroundcontrol,BMP-TECH/qgroundcontrol,greenoaktree/qgroundcontrol,caoxiongkun/qgroundcontrol,fizzaly/qgroundcontrol,UAVenture/qgroundcontrol,caoxiongkun/qgroundcontrol,RedoXyde/PX4_qGCS,UAVenture/qgroundcontrol,iidioter/qgroundcontrol,kd0aij/qgroundcontrol,BMP-TECH/qgroundcontrol,TheIronBorn/qgroundcontrol,jy723/qgroundcontrol,hejunbok/qgroundcontrol,catch-twenty-two/qgroundcontrol,scott-eddy/qgroundcontrol,lis-epfl/qgroundcontrol,hejunbok/qgroundcontrol,dagoodma/qgroundcontrol,remspoor/qgroundcontrol,cfelipesouza/qgroundcontrol,cfelipesouza/qgroundcontrol,mihadyuk/qgroundcontrol,CornerOfSkyline/qgroundcontrol,CornerOfSkyline/qgroundcontrol,nado1688/qgroundcontrol,lis-epfl/qgroundcontrol,dagoodma/qgroundcontrol,UAVenture/qgroundcontrol,UAVenture/qgroundcontrol,remspoor/qgroundcontrol,kd0aij/qgroundcontrol,mihadyuk/qgroundcontrol,kd0aij/qgroundcontrol,lis-epfl/qgroundcontrol,remspoor/qgroundcontrol,ethz-asl/qgc_asl,devbharat/qgroundcontrol,nado1688/qgroundcontrol,kd0aij/qgroundcontrol,mihadyuk/qgroundcontrol,caoxiongkun/qgroundcontrol,RedoXyde/PX4_qGCS,lis-epfl/qgroundcontrol,mihadyuk/qgroundcontrol,devbharat/qgroundcontrol,jy723/qgroundcontrol,LIKAIMO/qgroundcontrol,Hunter522/qgroundcontrol,cfelipesouza/qgroundcontrol,cfelipesouza/qgroundcontrol,caoxiongkun/qgroundcontrol,mihadyuk/qgroundcontrol,scott-eddy/qgroundcontrol,LIKAIMO/qgroundcontrol,CornerOfSkyline/qgroundcontrol,hejunbok/qgroundcontrol,remspoor/qgroundcontrol,remspoor/qgroundcontrol,greenoaktree/qgroundcontrol,UAVenture/qgroundcontrol,jy723/qgroundcontrol,BMP-TECH/qgroundcontrol,CornerOfSkyline/qgroundcontrol,nado1688/qgroundcontrol,nado1688/qgroundcontrol,Hunter522/qgroundcontrol,BMP-TECH/qgroundcontrol,LIKAIMO/qgroundcontrol,RedoXyde/PX4_qGCS,catch-twenty-two/qgroundcontrol,hejunbok/qgroundcontrol,devbharat/qgroundcontrol,TheIronBorn/qgroundcontrol,RedoXyde/PX4_qGCS,dagoodma/qgroundcontrol,Hunter522/qgroundcontrol,greenoaktree/qgroundcontrol,dagoodma/qgroundcontrol,mihadyuk/qgroundcontrol,Hunter522/qgroundcontrol,BMP-TECH/qgroundcontrol,cfelipesouza/qgroundcontrol,devbharat/qgroundcontrol |
0a77cedc5dd384cead701b6c9b58d67da4971757 | fetch.h | fetch.h | #ifndef CJET_FETCH_H
#define CJET_FETCH_H
#include "json/cJSON.h"
#include "list.h"
#include "peer.h"
typedef int (*match_func)(const char *fetch_path, const char *state_path);
struct path_matcher {
char *fetch_path;
match_func match_function;
};
struct fetch {
char *fetch_id;
const struct peer *peer;
struct list_head next_fetch;
struct path_matcher matcher[12];
};
cJSON *add_fetch_to_peer(struct peer *p, cJSON *params);
void remove_all_fetchers_from_peer(struct peer *p);
#endif
| #ifndef CJET_FETCH_H
#define CJET_FETCH_H
#include "json/cJSON.h"
#include "list.h"
#include "peer.h"
typedef int (*match_func)(const char *fetch_path, const char *state_path);
struct path_matcher {
char *fetch_path;
match_func match_function;
uintptr_t cookie;
};
struct fetch {
char *fetch_id;
const struct peer *peer;
struct list_head next_fetch;
struct path_matcher matcher[12];
};
cJSON *add_fetch_to_peer(struct peer *p, cJSON *params);
void remove_all_fetchers_from_peer(struct peer *p);
#endif
| Add cookie entry for auxilary match data. | Add cookie entry for auxilary match data.
| C | mit | gatzka/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,mloy/cjet,mloy/cjet,gatzka/cjet |
bf55c4043cb6f4fab23e42e62cbd911c333c82f8 | libs/samson/stream/QueuesManager.h | libs/samson/stream/QueuesManager.h |
#ifndef _H_STREAM_QUEUE_MANAGER
#define _H_STREAM_QUEUE_MANAGER
/* ****************************************************************************
*
* FILE QueuesManager.h
*
* AUTHOR Andreu Urruela Planas
*
* All the queues contained in the system
*
*/
#include "au/map.h" // au::map
namespace samson {
namespace stream
{
class Queue;
class Block;
class QueuesManager
{
au::map< std::string , Queue > queues; // Map with the current queues
public:
QueuesManager();
std::string getStatus();
void addBlock( std::string queue , Block *b);
};
}
}
#endif |
#ifndef _H_STREAM_QUEUE_MANAGER
#define _H_STREAM_QUEUE_MANAGER
/* ****************************************************************************
*
* FILE QueuesManager.h
*
* AUTHOR Andreu Urruela Planas
*
* All the queues contained in the system
*
*/
#include "au/map.h" // au::map
#include <string>
namespace samson {
namespace stream
{
class Queue;
class Block;
class QueuesManager
{
au::map< std::string , Queue > queues; // Map with the current queues
public:
QueuesManager();
std::string getStatus();
void addBlock( std::string queue , Block *b);
};
}
}
#endif
| Fix compilation broken for linux | Fix compilation broken for linux
git-svn-id: 9714148d14941aebeae8d7f7841217f5ffc02bc5@1242 4143565c-f3ec-42ea-b729-f8ce0cf5cbc3
| C | apache-2.0 | telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform,telefonicaid/fiware-cosmos-platform |
996c8b178b365009726f0d9fd5540439aafe7e9b | inc/ow_solver_container.h | inc/ow_solver_container.h | #ifndef OW_SOLVER_CONTAINER
#define OW_SOLVER_CONTAINER
#include "ow_isolver.h"
#include "ow_cl_const.h"
#include <string>
#include <vector>
namespace x_engine
{
namespace solver
{
enum SOLVER_TYPE
{
OCL = 1,
CUDA,
SINGLE,
PARALLEL
};
enum DEVICE
{
CPU = 0,
GPU = 1,
ALL = 2
};
struct device
{
DEVICE type;
std::string name;
bool is_buisy;
};
class solver_container
{
public:
solver_container(size_t devices_number = 1, SOLVER_TYPE s_t = OCL);
~solver_container() {}
private:
std::vector<std::shared_ptr<i_solver>> _solvers;
std::vector<std::shared_ptr<device>> devices;
};
}
}
#endif | #ifndef OW_SOLVER_CONTAINER
#define OW_SOLVER_CONTAINER
#include "ow_isolver.h"
#include "ow_cl_const.h"
#include <string>
#include <vector>
namespace x_engine
{
namespace solver
{
enum SOLVER_TYPE
{
OCL = 1,
CUDA,
SINGLE,
PARALLEL
};
enum DEVICE
{
CPU = 0,
GPU = 1,
ALL = 2
};
struct device
{
DEVICE type;
std::string name;
bool is_buisy;
};
class solver_container
{
public:
solver_container(const solver_container &) = delete;
solver_container &operator=(const solver_container &) = delete;
/** Classic Maer's singleton
*/
static solver_container &instance(size_t devices_number = 1, SOLVER_TYPE s_t = OCL)
{
static solver_container s(size_t devices_number, SOLVER_TYPE s_t);
return s;
}
private:
solver_container(size_t devices_number = 1, SOLVER_TYPE s_t = OCL);
~solver_container() {}
std::vector<std::shared_ptr<i_solver>> _solvers;
std::vector<std::shared_ptr<device>> devices;
};
}
}
#endif | Change solver_container is singleton now. | Change solver_container is singleton now.
| C | mit | skhayrulin/x_engine,skhayrulin/x_engine,skhayrulin/x_engine |
21adcf3b5f4c748fbda7f276f75a33121cee6df1 | test/Index/Inputs/reparse-instantiate.h | test/Index/Inputs/reparse-instantiate.h | template <typename T> struct S;
template<typename T> void c(T)
{
}
template <> struct S <int>
{
void a()
{
c(&S<int>::b);
}
void b() {}
};
| Add missing part of test | Add missing part of test
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@143985 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | 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,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang |
|
981c98937d40a196cc09530504012a792a7b5348 | Source/Core/HCSelfDescribing.h | Source/Core/HCSelfDescribing.h | //
// OCHamcrest - HCSelfDescribing.h
// Copyright 2013 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//
#import <Foundation/Foundation.h>
@protocol HCDescription;
/**
The ability of an object to describe itself.
@ingroup core
*/
@protocol HCSelfDescribing <NSObject>
/**
Generates a description of the object.
The description may be part of a description of a larger object of which this is just a
component, so it should be worded appropriately.
@param description The description to be built or appended to.
*/
- (void)describeTo:(id<HCDescription>)description;
@end
| //
// OCHamcrest - HCSelfDescribing.h
// Copyright 2013 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//
#import <Foundation/Foundation.h>
#import "HCDescription.h"
/**
The ability of an object to describe itself.
@ingroup core
*/
@protocol HCSelfDescribing <NSObject>
/**
Generates a description of the object.
The description may be part of a description of a larger object of which this is just a
component, so it should be worded appropriately.
@param description The description to be built or appended to.
*/
- (void)describeTo:(id<HCDescription>)description;
@end
| Change forward declaration to import for convenience. | Change forward declaration to import for convenience.
https://github.com/hamcrest/OCHamcrest/issues/31
| C | bsd-2-clause | nschum/OCHamcrest,hamcrest/OCHamcrest,hamcrest/OCHamcrest,klundberg/OCHamcrest,nschum/OCHamcrest,nschum/OCHamcrest,hamcrest/OCHamcrest,klundberg/OCHamcrest |
e64358edc12b9a2fcbf57ecb2ce17ca609df8d43 | Core/Assembler.h | Core/Assembler.h | #pragma once
#include "../Util/FileClasses.h"
#include "../Util/Util.h"
#include "FileManager.h"
#define ARMIPS_VERSION_MAJOR 0
#define ARMIPS_VERSION_MINOR 10
#define ARMIPS_VERSION_REVISION 0
enum class ArmipsMode { FILE, MEMORY };
struct LabelDefinition
{
std::wstring name;
int64_t value;
};
struct EquationDefinition
{
std::wstring name;
std::wstring value;
};
struct ArmipsArguments
{
// common
ArmipsMode mode;
int symFileVersion;
bool errorOnWarning;
bool silent;
StringList* errorsResult;
std::vector<EquationDefinition> equList;
std::vector<LabelDefinition> labels;
// file mode
std::wstring inputFileName;
std::wstring tempFileName;
std::wstring symFileName;
bool useAbsoluteFileNames;
// memory mode
std::shared_ptr<AssemblerFile> memoryFile;
std::wstring content;
ArmipsArguments()
{
mode = ArmipsMode::FILE;
errorOnWarning = false;
silent = false;
errorsResult = nullptr;
useAbsoluteFileNames = true;
}
};
bool runArmips(ArmipsArguments& arguments);
| #pragma once
#include "../Util/FileClasses.h"
#include "../Util/Util.h"
#include "FileManager.h"
#define ARMIPS_VERSION_MAJOR 0
#define ARMIPS_VERSION_MINOR 10
#define ARMIPS_VERSION_REVISION 0
enum class ArmipsMode { FILE, MEMORY };
struct LabelDefinition
{
std::wstring name;
int64_t value;
};
struct EquationDefinition
{
std::wstring name;
std::wstring value;
};
struct ArmipsArguments
{
// common
ArmipsMode mode;
int symFileVersion;
bool errorOnWarning;
bool silent;
StringList* errorsResult;
std::vector<EquationDefinition> equList;
std::vector<LabelDefinition> labels;
// file mode
std::wstring inputFileName;
std::wstring tempFileName;
std::wstring symFileName;
bool useAbsoluteFileNames;
// memory mode
std::shared_ptr<AssemblerFile> memoryFile;
std::wstring content;
ArmipsArguments()
{
mode = ArmipsMode::FILE;
symFileVersion = 0;
errorOnWarning = false;
silent = false;
errorsResult = nullptr;
useAbsoluteFileNames = true;
}
};
bool runArmips(ArmipsArguments& arguments);
| Fix symFileVersion not being initialized in ArmipsArguments constructor | Fix symFileVersion not being initialized in ArmipsArguments constructor
| C | mit | Kingcom/armips,Kingcom/armips,sp1187/armips,sp1187/armips,Kingcom/armips,sp1187/armips |
48e9fb19e370828f69a2a449c9cdfd32b01d88f5 | compiler.h | compiler.h | /* Copyright 2014-2015 Drew Thoreson
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef _COMPILER_H
#define _COMPILER_H
#if __STDC_VERSION__ < 201112L
#define _Static_assert(cond, msg) \
extern char navi_static_assert_fail[1/(cond)]
#define _Noreturn
#define _Alignas(n) __attribute__((aligned(n)))
#endif
/*
* GCC 2.96 or compatible required
*/
#if defined(__GNUC__)
#if __GNUC__ > 3
#undef offsetof
#define offsetof(type, member) __builtin_offsetof(type, member)
#endif
/* Optimization: Condition @x is likely */
#define likely(x) __builtin_expect(!!(x), 1)
/* Optimization: Condition @x is unlikely */
#define unlikely(x) __builtin_expect(!!(x), 0)
#define __used __attribute__((used))
#define __unused __attribute__((unused))
#else
#define likely(x) (x)
#define unlikely(x) (x)
#define __used
#define __unused
#endif /* defined(__GNUC__) */
#endif /* _COMPILER_H */
| /* Copyright 2014-2015 Drew Thoreson
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef _COMPILER_H
#define _COMPILER_H
#if __STDC_VERSION__ < 201112L
#define _Static_assert(cond, msg) \
extern char navi_static_assert_fail[1/(cond)]
#ifdef __GNUC__
#define _Noreturn __attribute__((noreturn))
#define _Alignas(n) __attribute__((aligned(n)))
#else
#define _Noreturn
#define _Alignas(n)
#pragma message "*** WARNING: _Alignas defined as NOP ***"
#endif
#endif
/*
* GCC 2.96 or compatible required
*/
#if defined(__GNUC__)
/* Optimization: Condition @x is likely */
#define likely(x) __builtin_expect(!!(x), 1)
/* Optimization: Condition @x is unlikely */
#define unlikely(x) __builtin_expect(!!(x), 0)
#define __used __attribute__((used))
#define __unused __attribute__((unused))
#else
#define likely(x) (x)
#define unlikely(x) (x)
#define __used
#define __unused
#endif /* defined(__GNUC__) */
#endif /* _COMPILER_H */
| Use __attribute__s if __GNUC__ defined | Use __attribute__s if __GNUC__ defined
Otherwise, define _Noreturn and _Alignas as NOPs, and issue a warning
message.
| C | mpl-2.0 | drewt/navi-scheme,drewt/navi-scheme,drewt/navi-scheme |
13dbcc3abd024bd5fbd47cc9b1094f5ade9d6f14 | tests/regression/56-witness/05-prec-problem.c | tests/regression/56-witness/05-prec-problem.c | //PARAM: --enable witness.yaml.enabled --enable ana.int.interval
#include <stdlib.h>
int foo(int* ptr1, int* ptr2){
int result;
if(ptr1 == ptr2){
result = 0;
} else {
result = 1;
}
// Look at the generated witness.yml to check whether there contradictory precondition_loop_invariant[s]
return result;
}
int main(){
int five = 5;
int five2 = 5;
int y = foo(&five, &five);
int z = foo(&five, &five2);
assert(y != z);
return 0;
}
| //PARAM: --enable witness.yaml.enabled --enable ana.int.interval
#include <stdlib.h>
int foo(int* ptr1, int* ptr2){
int result;
if(ptr1 == ptr2){
result = 0;
} else {
result = 1;
}
// Look at the generated witness.yml to check whether there are contradictory precondition_loop_invariant[s]
return result;
}
int main(){
int five = 5;
int five2 = 5;
int y = foo(&five, &five);
int z = foo(&five, &five2);
assert(y != z);
return 0;
}
| Add missing word in comment | Add missing word in comment
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
6f132875296595c4f26f9eee940666b1a4ca8135 | c_fs_monitor/test_fs_monitor.c | c_fs_monitor/test_fs_monitor.c | /*
This is a simple C program which is a stub for the FS monitor.
It takes one argument which would be a directory to monitor. In this case,
the filename is discarded after argument validation.
Every minute the
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main (int argc, char **argv) {
if (argc != 2) {
fprintf(stderr, "Not enough arguments");
exit(EXIT_FAILURE);
}
while (1) {
fprintf(stdout, "{ \"key\": \"value\" }\n");
fflush(stdout);
fprintf(stderr, "tick\n");
sleep(1);
}
}
| /*
This is a simple C program which is a stub for the FS monitor.
It takes one argument which would be a directory to monitor. In this case,
the filename is discarded after argument validation.
Every minute the
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main (int argc, char **argv) {
if (argc < 2) {
fprintf(stderr, "Not enough arguments");
exit(EXIT_FAILURE);
}
while (1) {
fprintf(stdout, "{ \"key\": \"value\" }\n");
fflush(stdout);
fprintf(stderr, "tick\n");
sleep(1);
}
}
| Fix arguments count check in test inotify program | Fix arguments count check in test inotify program
| C | mit | iankronquist/senior-project-experiment,iankronquist/senior-project-experiment,iankronquist/senior-project-experiment,iankronquist/beeswax,iankronquist/beeswax,iankronquist/beeswax,iankronquist/senior-project-experiment,iankronquist/beeswax |
2557222f7a6ae5d2ae93c56f7d655cf9374c17dd | src/backends/usda_unit_data.h | src/backends/usda_unit_data.h | /***************************************************************************
* Copyright (C) 2006 *
* *
* Jason Kivlighn ([email protected]) *
* *
* 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 USDA_UNIT_DATA_H
#define USDA_UNIT_DATA_H
#include <klocale.h>
#include <qstring.h>
struct unit_data {
const char *name;
const char *plural;
};
static unit_data unit_data_list[] = {
{"bag","bags"},
{"block","blocks"},
{"bottle","bottles"},
{"box","boxes"},
{"bunch","bunches"},
{"can","cans"},
{"cone","cones"},
{"container","containers"},
{"cube","cubes"},
{"cup","cups"},
{"fl oz","fl oz"},
{"glass","glasses"},
{"item","items"},
{"loaf","loaves"},
{"large","large"},
{"lb","lbs"},
{"junior","junior"},
{"leaf","leaves"},
{"medium","medium"},
{"oz","oz"},
{"pack","packs"},
{"package","packages"},
{"packet","packets"},
{"piece","pieces"},
{"pouch","pouches"},
{"quart","quarts"},
{"scoop","scoops"},
{"sheet","sheets"},
{"slice","slices"},
{"small","small"},
{"spear","spears"},
{"sprout","spouts"},
{"sprig","sprigs"},
{"square","squares"},
{"stalk","stalks"},
{"stem","stems"},
{"strip","strips"},
{"tablespoon","tablespoons"},
{"tbsp","tbsp"},
{"teaspoon","teaspoons"},
{"tsp","tsp"},
{"tube","tubes"},
{"unit","units"},
{0,0}
};
static const char * prep_data_list[] = {
"chopped",
"diced",
"sliced",
"crumbled",
"crushed",
"ground",
"grated",
"mashed",
"melted",
"packed",
"pureed",
"quartered",
"thawed",
"shredded",
"sifted",
"pared",
"flaked",
"unpacked",
"unsifted",
"unthawed",
"pitted",
"peeled",
"cooked",
"hulled",
"shelled",
"raw",
"whipped",
0
};
bool parseUSDAUnitAndPrep( const QString &string, QString &unit, QString &prep );
#endif //USDA_UNIT_DATA_H
| Add a missing file... fix that compile error. | Add a missing file... fix that compile error.
svn path=/trunk/extragear/utils/krecipes/; revision=570474
| C | lgpl-2.1 | eliovir/krecipes,eliovir/krecipes,eliovir/krecipes,eliovir/krecipes |
|
2fd5b54b5907142e54bd88edf9d7cc7c9b1da702 | tests/regression/27-inv_invariants/11-indirect-addresses.c | tests/regression/27-inv_invariants/11-indirect-addresses.c | // modified from 27/09
#include <assert.h>
int main() {
int a = 1;
int b = 1;
int *x;
int rnd;
if (rnd)
x = &a;
else
x = &b;
assert(*x == 1);
b = 2;
assert(a == 1);
if (*x > 1) { // invariant rules out x == &a
assert(x == &b); // TODO
assert(*x == 2); // TODO
}
return 0;
} | Add TODO test where ambiguous pointer invariant could refine pointer | Add TODO test where ambiguous pointer invariant could refine pointer
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
a629c9dade4fae3915b632184427aec5e807bbe4 | app/hwif.c | app/hwif.c | /*
* Part of Jari Komppa's zx spectrum suite
* https://github.com/jarikomppa/speccy
* released under the unlicense, see http://unlicense.org
* (practically public domain)
*/
// xxxsmbbb
// where b = border color, m is mic, s is speaker
void port254(const unsigned char color) __z88dk_fastcall
{
color; // color is in l
// Direct border color setting
__asm
ld a,l
ld hl, #_port254tonebit
or a, (hl)
out (254),a
__endasm;
}
// practically waits for retrace
void do_halt()
{
__asm
halt
__endasm;
}
| /*
* Part of Jari Komppa's zx spectrum suite
* https://github.com/jarikomppa/speccy
* released under the unlicense, see http://unlicense.org
* (practically public domain)
*/
// xxxsmbbb
// where b = border color, m is mic, s is speaker
void port254(const unsigned char color) __z88dk_fastcall
{
color; // color is in l
// Direct border color setting
__asm
ld a,l
ld hl, #_port254tonebit
or a, (hl)
out (254),a
__endasm;
}
// practically waits for retrace
void do_halt()
{
__asm
ei
halt
__endasm;
}
| Make sure we've enabled interrupts before calling halt.. | Make sure we've enabled interrupts before calling halt..
| C | unlicense | jarikomppa/speccy,jarikomppa/speccy,jarikomppa/speccy |
8c8d940e07c6ce48a8b342baaafb290e3f9abfac | SGCachePromise.h | SGCachePromise.h | //
// SGCachePromise.h
// Pods
//
// Created by James Van-As on 13/05/15.
//
//
#import "Promise.h"
#import "MGEvents.h"
typedef void(^SGCacheFetchCompletion)(id obj);
typedef void(^SGCacheFetchFail)(NSError *error, BOOL wasFatal);
typedef void(^SGCacheFetchOnRetry)();
@interface SGCachePromise : PMKPromise
@property (nonatomic, copy) SGCacheFetchOnRetry onRetry;
@property (nonatomic, copy) SGCacheFetchFail onFail;
@end
| //
// SGCachePromise.h
// Pods
//
// Created by James Van-As on 13/05/15.
//
//
#import <PromiseKit/Promise.h>
#import <MGEvents/MGEvents.h>
typedef void(^SGCacheFetchCompletion)(id obj);
typedef void(^SGCacheFetchFail)(NSError *error, BOOL wasFatal);
typedef void(^SGCacheFetchOnRetry)();
@interface SGCachePromise : PMKPromise
@property (nonatomic, copy) SGCacheFetchOnRetry onRetry;
@property (nonatomic, copy) SGCacheFetchFail onFail;
@end
| Use Framework style import statements for pod Framework compatibility | Use Framework style import statements for pod Framework compatibility
| C | bsd-2-clause | seatgeek/SGImageCache |
879678338f7a4aeff364d7eb3aecfc22360c50fa | test/CFrontend/2003-08-29-BitFieldStruct.c | test/CFrontend/2003-08-29-BitFieldStruct.c | typedef enum { FALSE, TRUE } flagT;
struct Word
{
short bar;
short baz;
flagT final:1;
short quux;
} *word_limit;
void foo ()
{
word_limit->final = (word_limit->final && word_limit->final);
}
| Test case distilled from sed. | Test case distilled from sed.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@8224 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm |
|
e4f1a58860b19753d4c887c3e5086b6232cb49ae | src/net/instaweb/util/public/re2.h | src/net/instaweb/util/public/re2.h | /*
* Copyright 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Author: [email protected] (Gagan Singh)
#ifndef NET_INSTAWEB_UTIL_PUBLIC_RE2_H_
#define NET_INSTAWEB_UTIL_PUBLIC_RE2_H_
#include "net/instaweb/util/public/string_util.h"
#include "third_party/re2/src/re2/re2.h"
using re2::RE2;
// Converts a Google StringPiece into an RE2 StringPiece. These are of course
// the same basic thing but are declared in distinct namespaces and as far as
// C++ type-checking is concerned they are incompatible.
//
// TODO(jmarantz): In the re2 code itself there are no references to
// re2::StringPiece, always just plain StringPiece, so if we can
// arrange to get the right definition #included we should be all set.
// We could somehow rewrite '#include "re2/stringpiece.h"' to
// #include Chromium's stringpiece then everything would just work.
inline re2::StringPiece StringPieceToRe2(StringPiece sp) {
return re2::StringPiece(sp.data(), sp.size());
}
#endif // NET_INSTAWEB_UTIL_PUBLIC_RE2_H_
| /*
* Copyright 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Author: [email protected] (Gagan Singh)
#ifndef NET_INSTAWEB_UTIL_PUBLIC_RE2_H_
#define NET_INSTAWEB_UTIL_PUBLIC_RE2_H_
// TODO(morlovich): Remove this forwarding header and change all references.
#include "pagespeed/kernel/util/re2.h"
#endif // NET_INSTAWEB_UTIL_PUBLIC_RE2_H_
| Make this a proper forwarding header rather than a duplication what's under pagespeed/util/ | Make this a proper forwarding header rather than
a duplication what's under pagespeed/util/
| C | apache-2.0 | crowell/modpagespeed_tmp,crowell/modpagespeed_tmp,crowell/modpagespeed_tmp,crowell/modpagespeed_tmp,crowell/modpagespeed_tmp,crowell/modpagespeed_tmp,crowell/modpagespeed_tmp |
a926488619cbe3aa5b5cf367486f6e4b08d70e98 | extensions/ringopengl/opengl11/ring_opengl11.c | extensions/ringopengl/opengl11/ring_opengl11.c | #include "ring.h"
/*
OpenGL 1.1 Extension
Copyright (c) 2017 Mahmoud Fayed <[email protected]>
*/
#include <GL/glew.h>
#include <GL/glut.h>
RING_FUNC(ring_get_gl_zero)
{
RING_API_RETNUMBER(GL_ZERO);
}
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("get_gl_zero",ring_get_gl_zero);
}
| #include "ring.h"
/*
OpenGL 1.1 Extension
Copyright (c) 2017 Mahmoud Fayed <[email protected]>
*/
#include <GL/glew.h>
#include <GL/glut.h>
RING_FUNC(ring_get_gl_zero)
{
RING_API_RETNUMBER(GL_ZERO);
}
RING_FUNC(ring_get_gl_false)
{
RING_API_RETNUMBER(GL_FALSE);
}
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("get_gl_zero",ring_get_gl_zero);
ring_vm_funcregister("get_gl_false",ring_get_gl_false);
}
| Update RingOpenGL 1.1 - Add Constant (Source Code) : GL_FALSE | Update RingOpenGL 1.1 - Add Constant (Source Code) : GL_FALSE
| C | mit | ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring |
8f1e899485677eb8accfdc999fbd1e7e12187302 | Classes/WeakUniqueCollection.h | Classes/WeakUniqueCollection.h | //
// WeakUniqueCollection.h
// book-shelf
//
// Created by Artem Gladkov on 28.06.16.
// Copyright © 2016 Sibext Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface WeakUniqueCollection<ObjectType> : NSObject
@property(readonly)NSUInteger count;
- (void)addObject:(ObjectType)object;
- (void)removeObject:(ObjectType)object;
- (void)removeAllObjects;
- (ObjectType)anyObject;
- (NSArray <ObjectType> *)allObjects;
- (BOOL)member:(ObjectType)object;
@end
| //
// WeakUniqueCollection.h
// book-shelf
//
// Created by Artem Gladkov on 28.06.16.
// Copyright © 2016 Sibext Ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
WeakUniqueCollection keeps weak references to the objects and maintains uniqueness.
It's public API is fully thread safe.
WeakUniqueCollection is not optimized for working with large amount of objects.
*/
@interface WeakUniqueCollection<ObjectType> : NSObject
@property(readonly)NSUInteger count;
/**
Adds object to the collection
@param object ObjectType to be added to the collection
*/
- (void)addObject:(ObjectType)object;
/**
Removes object from the collection (if collection contains it).
@param object ObjectType to be removed from the collection
*/
- (void)removeObject:(ObjectType)object;
/**
Removes all objects from the collection.
*/
- (void)removeAllObjects;
/**
Returns any object from the collection.
@return ObjectType or nil (if the collection is empty).
*/
- (nullable ObjectType)anyObject;
/**
Returns array with all objects from the collection.
@return NSArray with objects (cound be empty if the collection is empty).
*/
- (NSArray <ObjectType> *)allObjects;
/**
Determines if the object is already contained in the collection.
@param object ObjectType to be verified
@return YES if object is in the collection
NO if object is not in the collection
*/
- (BOOL)member:(ObjectType)object;
@end
NS_ASSUME_NONNULL_END
| Add documentation for public API and nullability specification. | Add documentation for public API and nullability specification.
| C | mit | sibext/WeakUniqueCollection,sibext/WeakUniqueCollection |
db4a05949ff8e56fc4334f5b3776ee0f2aa1c8a8 | stack.c | stack.c | #include "stack.h"
struct Stack
{
size_t size;
size_t top;
void** e;
}
Stack* Stack_Create(size_t n)
{
Stack* s = (Stack *)malloc(sizeof(Stack));
s->size = n;
s->top = 0;
s->e = (void**)malloc(sizeof(void*) * (n + 1));
return s;
}
int Stack_Empty(Stack* s)
{
if (s->top == 0)
{
return 1;
} else {
return 0;
}
}
void Stack_Push(Stack* s, void* e)
{
if (s == NULL) return;
if (s->top == s->size) return;
s->top = s->top + 1;
s->e[s->top] = e;
}
void* Stack_Pop(Stack* s)
{
if (Stack_Empty(s)) return;
s->top = s->top - 1;
return s->e[s->top];
}
void Stack_Destroy(Stack* s)
{
if (s == NULL) return;
free(s->e);
free(s);
} | #include "stack.h"
struct Stack
{
size_t size;
size_t top;
void** e;
}
Stack* Stack_Create(size_t n)
{
Stack* s = (Stack *)malloc(sizeof(Stack));
s->size = n;
s->top = 0;
s->e = (void**)malloc(sizeof(void*) * (n + 1));
return s;
}
int Stack_Empty(Stack* s)
{
if (s->top == 0)
{
return 1;
} else {
return 0;
}
}
void Stack_Push(Stack* s, void* e)
{
if (s == NULL) return;
if (s->top == s->size) return;
s->top = s->top + 1;
s->e[s->top] = e;
}
void* Stack_Pop(Stack* s)
{
if (Stack_Empty(s)) return;
s->top = s->top - 1;
return s->e[s->top+1];
}
void Stack_Destroy(Stack* s)
{
if (s == NULL) return;
free(s->e);
free(s);
} | Fix incorrect return in pop operation | Fix incorrect return in pop operation
| C | mit | MaxLikelihood/CADT |
0031954ff9ac9a1c6f080ceb3f9fcec3d3c9a0fd | ParticleSwarmOptimization/CppUtils/CppUtils.h | ParticleSwarmOptimization/CppUtils/CppUtils.h | // CppUtils.h
#pragma once
#include <algorithm>
#include <functional>
#include <vector>
#include <random>
using namespace System;
namespace CppUtils {
public ref class Random
{
public:
double Random::random_double()
{
return Random::random_in_range(0.0, 1.0);
}
double Random::random_in_range(double min, double max)
{
std::uniform_real_distribution<float> distribution(min, max);
std::random_device rd;
std::default_random_engine e(rd());
return distribution(e);
}
std::vector<double> Random::random_vector(double len, double min, double max)
{
auto result = std::vector<double>();
std::uniform_real_distribution<float> distribution(min, max);
std::mt19937 engine;
auto generator = bind(distribution, engine);
generate(result.begin(), result.end(), generator);
return result;
}
};
}
| // CppUtils.h
#pragma once
#ifdef DEBUG
#define SEED(x) 100
#else
#define SEED(x) x
#endif
#include <algorithm>
#include <functional>
#include <vector>
#include <random>
using namespace System;
namespace CppUtils {
public ref class Random
{
public:
double Random::random_double()
{
return Random::random_in_range(0.0, 1.0);
}
double Random::random_in_range(double min, double max)
{
std::uniform_real_distribution<float> distribution(min, max);
std::random_device rd;
std::default_random_engine e(SEED(rd()));
return distribution(e);
}
std::vector<double> Random::random_vector(double len, double min, double max)
{
auto result = std::vector<double>();
std::uniform_real_distribution<float> distribution(min, max);
std::random_device rd;
std::default_random_engine engine(SEED(rd()));
auto generator = bind(distribution, engine);
std::generate(result.begin(), result.end(), generator);
return result;
}
};
}
| Debug macro for seeding random generator. | Debug macro for seeding random generator.
| C | mit | trojkac/effective_pso,trojkac/effective_pso |
d480f70369ecb66d318357fb5dca71708bb1b91e | test/Preprocessor/headermap-rel2.c | test/Preprocessor/headermap-rel2.c | // This uses a headermap with this entry:
// someheader.h -> Product/someheader.h
// RUN: %clang_cc1 -fsyntax-only %s -iquote %S/Inputs/headermap-rel2/project-headers.hmap -isysroot %S/Inputs/headermap-rel2/system -I %S/Inputs/headermap-rel2 -H 2> %t.out
// RUN: FileCheck %s -input-file %t.out
// CHECK: Product/someheader.h
// CHECK: system/usr/include/someheader.h
// CHECK: system/usr/include/someheader.h
#include "someheader.h"
#include <someheader.h>
#include <someheader.h>
| // This uses a headermap with this entry:
// someheader.h -> Product/someheader.h
// RUN: %clang_cc1 -v -fsyntax-only %s -iquote %S/Inputs/headermap-rel2/project-headers.hmap -isysroot %S/Inputs/headermap-rel2/system -I %S/Inputs/headermap-rel2 -H
// RUN: %clang_cc1 -fsyntax-only %s -iquote %S/Inputs/headermap-rel2/project-headers.hmap -isysroot %S/Inputs/headermap-rel2/system -I %S/Inputs/headermap-rel2 -H 2> %t.out
// RUN: FileCheck %s -input-file %t.out
// CHECK: Product/someheader.h
// CHECK: system/usr/include/someheader.h
// CHECK: system/usr/include/someheader.h
#include "someheader.h"
#include <someheader.h>
#include <someheader.h>
| Add a RUN line to get a hint on why the test is failing at the buildbots. | [test] Add a RUN line to get a hint on why the test is failing at the buildbots.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@205072 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-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,llvm-mirror/clang,llvm-mirror/clang |
6dec686bbe20f6c89b067d27f75eba3ac4cc3727 | pose/src/pose_estimator_demo.c | pose/src/pose_estimator_demo.c | #include "estimator.h"
#include <stdio.h>
int main(int argc, char** argv) {
void* estimator = create_estimator(argv[1]);
candidates_t* candidates = estimate(estimator, argv[2]);
for(unsigned int i = 0; i < candidates->candidates[0]->size; i++) {
printf("x: %4lu y: %4lu confidence: %.4f \n",
candidates->candidates[0]->parts[i]->x,
candidates->candidates[0]->parts[i]->y,
candidates->candidates[0]->confidence[i]);
}
printf("\n");
destroy_estimator(estimator);
free_candidates(candidates);
}
| #include <stdio.h>
#include <stdlib.h>
#include "estimator.h"
int main(int argc, char** argv) {
//test();
if(argc < 3) {
printf("Usage: PartsBasedDetector1 model_file image_file\n");
exit(0);
}
void* estimator = create_estimator(argv[1]);
candidates_t* candidates = estimate(estimator, argv[2]);
print_candidate(candidates->candidates[0]);
destroy_estimator(estimator);
free_candidates(candidates);
}
| Delete printing, show usage if arguments are not enough | Delete printing, show usage if arguments are not enough
| C | mit | IshitaTakeshi/VirtualFitting,IshitaTakeshi/VirtualFitting |
42c64152f63753877008fe6b9c432794c7fce1e3 | libpthread/nptl/sysdeps/sh/pthread_spin_lock.c | libpthread/nptl/sysdeps/sh/pthread_spin_lock.c | /* Copyright (C) 2003 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 "pthreadP.h"
int
pthread_spin_lock (lock)
pthread_spinlock_t *lock;
{
unsigned int val;
do
__asm__ volatile ("tas.b @%1; movt %0"
: "=&r" (val)
: "r" (lock)
: "memory");
while (val == 0);
return 0;
}
| /* Copyright (C) 2003 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 "pthreadP.h"
int
pthread_spin_lock (pthread_spinlock_t *lock)
{
unsigned int val;
do
__asm__ volatile ("tas.b @%1; movt %0"
: "=&r" (val)
: "r" (lock)
: "memory");
while (val == 0);
return 0;
}
| Remove compiler warning due to old-style function definition | nptl: Remove compiler warning due to old-style function definition
Signed-off-by: Carmelo Amoroso <[email protected]>
| C | lgpl-2.1 | joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc |
0d16482be8d92f611a2cac5aa259f68398f9573f | boot/zephyr/include/config-kw.h | boot/zephyr/include/config-kw.h | /*
* Minimal configuration for using TLS in the bootloader
*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
* Copyright (C) 2016, Linaro Ltd
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of mbed TLS (https://tls.mbed.org)
*/
/*
* Minimal configuration for using TLS in the bootloader
*
* - RSA or ECDSA signature verification
*/
#ifndef MCUBOOT_MBEDTLS_CONFIG_KW
#define MCUBOOT_MBEDTLS_CONFIG_KW
#ifdef CONFIG_MCUBOOT_SERIAL
/* Mcuboot uses mbedts-base64 for serial protocol encoding. */
#define MBEDTLS_BASE64_C
#endif
/* System support */
#define MBEDTLS_PLATFORM_C
#define MBEDTLS_PLATFORM_MEMORY
#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
#define MBEDTLS_PLATFORM_EXIT_ALT
#define MBEDTLS_NO_PLATFORM_ENTROPY
#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
#define MBEDTLS_PLATFORM_PRINTF_ALT
#if !defined(CONFIG_ARM)
#define MBEDTLS_HAVE_ASM
#endif
#define MBEDTLS_SHA256_C
#define MBEDTLS_AES_C
#define MBEDTLS_CIPHER_C
#define MBEDTLS_NIST_KW_C
#include "mbedtls/check_config.h"
#endif /* MCUBOOT_MBEDTLS_CONFIG_KW */
| Add mbedtls config with nist_kw enabled | Add mbedtls config with nist_kw enabled
This adds a mbedtls config that will enable the simulator to run tests
for the kw based encrypted images.
Signed-off-by: Fabio Utzig <[email protected]>
| C | apache-2.0 | utzig/mcuboot,runtimeco/mcuboot,ATmobica/mcuboot,utzig/mcuboot,runtimeco/mcuboot,ATmobica/mcuboot,tamban01/mcuboot,tamban01/mcuboot,runtimeco/mcuboot,utzig/mcuboot,ATmobica/mcuboot,ATmobica/mcuboot,ATmobica/mcuboot,tamban01/mcuboot,tamban01/mcuboot,utzig/mcuboot,runtimeco/mcuboot,utzig/mcuboot,tamban01/mcuboot,runtimeco/mcuboot |
|
103296e919020e156925eb6d57d1da7aad0551bf | config.h | config.h | #ifndef CJET_CONFIG_H
#define CJET_CONFIG_H
#define SERVER_PORT 11122
#define LISTEN_BACKLOG 40
#define MAX_MESSAGE_SIZE 128
/* Linux specific configs */
#define MAX_EPOLL_EVENTS 100
#endif
| #ifndef CJET_CONFIG_H
#define CJET_CONFIG_H
#define SERVER_PORT 11122
#define LISTEN_BACKLOG 40
#define MAX_MESSAGE_SIZE 250
/* Linux specific configs */
#define MAX_EPOLL_EVENTS 100
#endif
| Increase the size of the read buffer fpo testing. | Increase the size of the read buffer fpo testing.
| C | mit | mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,mloy/cjet,gatzka/cjet,mloy/cjet,gatzka/cjet |
b1ddc60b6ead5220a101b1dd37479a8a990cc5ac | Include/atlstd.h | Include/atlstd.h | /*
* atlstd.h
*
* Created: 3/31/2017 12:29:59 AM
* Author: Vadim Zabavnov
*/
#ifndef ATLSTD_H_
#define ATLSTD_H_
#include <atlport.h>
namespace atl {
namespace std {
using namespace atl;
// standard ports
#ifdef PORTA
const Port PortA = Port(_SFR_IO_ADDR(PORTA), _SFR_IO_ADDR(DDRA), _SFR_IO_ADDR(PINA));
#endif
#ifdef PORTB
const Port PortB = Port(_SFR_IO_ADDR(PORTB), _SFR_IO_ADDR(DDRB), _SFR_IO_ADDR(PINB));
#endif
#ifdef PORTC
const Port PortC = Port(_SFR_IO_ADDR(PORTC), _SFR_IO_ADDR(DDRC), _SFR_IO_ADDR(PINC));
#endif
#ifdef PORTD
const Port PortD = Port(_SFR_IO_ADDR(PORTD), _SFR_IO_ADDR(DDRD), _SFR_IO_ADDR(PIND));
#endif
}
}
#endif /* ATLSTD_H_ */ | /*
* atlstd.h
*
* Created: 3/31/2017 12:29:59 AM
* Author: Vadim Zabavnov
*/
#ifndef ATLSTD_H_
#define ATLSTD_H_
#include <atlport.h>
namespace atl {
namespace std {
using namespace atl;
// standard ports
#ifdef PORTA
constexpr Port PortA = Port(_SFR_IO_ADDR(PORTA), _SFR_IO_ADDR(DDRA), _SFR_IO_ADDR(PINA));
#endif
#ifdef PORTB
constexpr Port PortB = Port(_SFR_IO_ADDR(PORTB), _SFR_IO_ADDR(DDRB), _SFR_IO_ADDR(PINB));
#endif
#ifdef PORTC
constexpr Port PortC = Port(_SFR_IO_ADDR(PORTC), _SFR_IO_ADDR(DDRC), _SFR_IO_ADDR(PINC));
#endif
#ifdef PORTD
constexpr Port PortD = Port(_SFR_IO_ADDR(PORTD), _SFR_IO_ADDR(DDRD), _SFR_IO_ADDR(PIND));
#endif
}
}
#endif /* ATLSTD_H_ */ | Make ports constexpr to further reduce binary size | Make ports constexpr to further reduce binary size
| C | apache-2.0 | vzabavnov/AVRTL,vzabavnov/AVRTL |
58e3fdf77ae8adcb89ea5af6fc50a1b2859a485b | src/log_example.c | src/log_example.c | // cc log_example.c log.c
#include "log.h"
int main(int argc, const char *argv[])
{
log_open("example", NULL, 0);
/* set log level to info, also the default level */
log_setlevel(LOG_INFO);
/* debug mesage won't be seen */
log_debug("debug message");
/* but info and warn message can be seen */
log_info("info message");
log_warn("warn message");
return 0;
}
| // cc log_example.c log.c
#include "log.h"
int main(int argc, const char *argv[])
{
/* open global logger to stderr (by setting filename to NULL) */
log_open("example", NULL, 0);
/* set log level to info, also the default level */
log_setlevel(LOG_INFO);
/* debug mesage won't be seen */
log_debug("debug message");
/* but info and warn message can be seen */
log_info("info message");
log_warn("warn message");
return 0;
}
| Add minor comment for log_open | Add minor comment for log_open
| C | bsd-2-clause | hit9/C-Snip,hit9/C-Snip |
2485a7bb9de55290ece1edef973b40bae82f55be | src/main.c | src/main.c | #include <stdio.h>
#include <stdlib.h>
#include "apricosterm.h"
#include "screen.h"
int main(int argc, char** argv) {
SDL_Event event;
initScreen("Potato", SCREEN_WIDTH, SCREEN_HEIGHT);
char done = 0;
while(!done) {
while(SDL_PollEvent(&event)) {
switch(event.key.keysym.sym) {
case SDLK_ESCAPE:
done = 1;
break;
}
}
SDL_Delay(100);
updateWindow();
}
destroyScreen();
return EXIT_SUCCESS;
}
| #include <stdio.h>
#include <stdlib.h>
#include "apricosterm.h"
#include "screen.h"
#include "terminalrenderer.h"
#include "managedtextures.h"
int main(int argc, char** argv) {
SDL_Event event;
initScreen("Potato", SCREEN_WIDTH, SCREEN_HEIGHT);
char done = 0;
termRendererInit();
SDL_StartTextInput();
while(!done) {
while(SDL_PollEvent(&event)) {
switch(event.type) {
case SDL_KEYDOWN:
switch(event.key.keysym.sym) {
case SDLK_ESCAPE:
done = 1;
break;
case SDLK_RETURN:
terminalNewLine(1, 1);
break;
case SDLK_BACKSPACE:
terminalBackspace(1);
break;
default:
break;
}
break;
case SDL_TEXTINPUT:
terminalPutStr(event.text.text);
break;
case SDL_QUIT:
done = 1;
break;
default:
break;
}
}
SDL_Delay(10);
terminalRefresh();
}
SDL_StopTextInput();
destroyAllTextures();
destroyScreen();
return EXIT_SUCCESS;
}
| Integrate terminal renderer for testing | Integrate terminal renderer for testing
| C | mit | drdanick/apricosterm |
17d53a1d40b1d15f08a80f9f03dd3922156d9fb6 | src/repo.c | src/repo.c | /**
* repo.c
*
* Copyright (C) 2017 Nickolas Burr <[email protected]>
*/
#include "repo.h"
/**
* Get all stashes for a repository.
*/
struct stash *get_stashes (struct repo *r) {
return r->stashes;
}
/**
* Set a copy of all stashes for a repository in memory.
*/
void set_stashes (struct repo *r) {
// @todo: Build this function out.
char *cmd;
FILE *fp;
printf("set_stashes -> r->path -> %s\n", r->path);
sprintf(cmd, "/usr/bin/git -C %s -- stash list", r->path);
fp = popen(cmd, "r");
if (!fp) {
printf("Could not open pipe!\n");
exit(EXIT_FAILURE);
}
while (fgets(r->stashes->entries, (sizeof(r->stashes->entries) - 1), fp) != NULL) {
printf("%s\n", r->stashes->entries);
}
pclose(fp);
}
/**
* Check if the worktree has changed since our last check.
*/
int has_worktree_changed (struct repo *r) {
return 1;
}
| /**
* repo.c
*
* Copyright (C) 2017 Nickolas Burr <[email protected]>
*/
#include "repo.h"
/**
* Get all stash entries for a repository.
*/
struct stash *get_stash (struct repo *r) {
return r->stash;
}
/**
* Set a copy of all stash entries for a repository.
*/
void set_stash (struct repo *r) {
char *cmd;
FILE *fp;
// Allocate space for command string
cmd = ALLOC(sizeof(char) * (strlen(r->path) + 100));
sprintf(cmd, "/usr/bin/git -C %s stash list", r->path);
printf("set_stashes -> cmd -> %s\n", cmd);
fp = popen(cmd, "r");
if (!fp) {
printf("Could not open pipe!\n");
exit(EXIT_FAILURE);
}
while (fgets(r->stash->entries, (sizeof(r->stash->entries) - 1), fp) != NULL) {
printf("%s\n", r->stash->entries);
}
// Free space allocated for commnad string
FREE(cmd);
pclose(fp);
}
/**
* Check if the worktree has changed since the last check.
*/
int has_worktree_changed (struct repo *r) {
return 1;
}
| Work on stash retrieval, memory allocation | Work on stash retrieval, memory allocation
| C | mit | nickolasburr/git-stashd,nickolasburr/git-stashd,nickolasburr/git-stashd |
ca1f8cba176ba3dbbbed7ebee2e0399f94c548a1 | src/user.c | src/user.c | task usercontrol(){
int DY, DT;
bool armsLocked = false;
while(true){
//Driving
DY = threshold(PAIRED_CH2, 15);
DT = threshold(PAIRED_CH1, 15);
drive(DY, DT);
//Pistons (toggle)
if(PAIRED_BTN7R){
pistons(!PISTON_POS);
waitUntil(!PAIRED_BTN7R);
}
//Arms
if(PAIRED_BTN7L){
armsLocked = !armsLocked;
waitUntil(!PAIRED_BTN7L);
}
if(armsLocked){
arms(ARM_LOCK);
} else {
arms((PAIRED_BTN6U - PAIRED_BTN6D) * MAX_POWER);
}
//Lift
lift((PAIRED_BTN7U - PAIRED_BTN7D) * MAX_POWER);
//Intake
intake((PAIRED_BTN5U - PAIRED_BTN5D) * MAX_POWER);
}
}
| task usercontrol(){
int DY, DT;
bool armsLocked = false;
while(true){
//Driving
DY = threshold(PAIRED_CH2, 15) + (PAIRED_BTN8U * MAX_POWER) - (PAIRED_BTN8D * MAX_POWER);
DT = threshold(PAIRED_CH1, 15) + (PAIRED_BTN8R * MAX_POWER) - (PAIRED_BTN8L * MAX_POWER);
drive(DY, DT);
//Pistons (toggle)
if(PAIRED_BTN7R){
pistons(!PISTON_POS);
waitUntil(!PAIRED_BTN7R);
}
//Arms
if(PAIRED_BTN7L){
armsLocked = !armsLocked;
waitUntil(!PAIRED_BTN7L);
}
if(armsLocked){
arms(ARM_LOCK);
} else {
arms(threshold(PAIRED_CH3, 15) + ((PAIRED_BTN5U - PAIRED_BTN5D) * MAX_POWER));
}
//Lift
lift((PAIRED_BTN7U - PAIRED_BTN7D) * MAX_POWER);
//Intake
intake((PAIRED_BTN6U - PAIRED_BTN6D) * MAX_POWER);
}
}
| Add buttons for driving, and swap intake and arm buttons | Add buttons for driving, and swap intake and arm buttons
| C | mit | 18moorei/code-red-in-the-zone |
d19c36737dd3d2111911c411b19f1a270415b079 | SMLTextViewPrivate.h | SMLTextViewPrivate.h | //
// SMLTextViewPrivate.h
// Fragaria
//
// Created by Daniele Cattaneo on 26/02/15.
//
//
#import <Cocoa/Cocoa.h>
#import "SMLTextView.h"
#import "SMLAutoCompleteDelegate.h"
@interface SMLTextView ()
/** The autocomplete delegate for this text view. This property is private
* because it is set to an internal object when MGSFragaria's autocomplete
* delegate is set to nil. */
@property id<SMLAutoCompleteDelegate> autocompleteDelegate;
/** The controller which manages the accessory user interface for this text
* view. */
@property (readonly) MGSExtraInterfaceController *interfaceController;
/** Instances of this class will perform syntax highlighting in text views. */
@property (readonly) SMLSyntaxColouring *syntaxColouring;
@end
| //
// SMLTextViewPrivate.h
// Fragaria
//
// Created by Daniele Cattaneo on 26/02/15.
//
//
#import <Cocoa/Cocoa.h>
#import "SMLTextView.h"
#import "SMLAutoCompleteDelegate.h"
@interface SMLTextView ()
/** The autocomplete delegate for this text view. This property is private
* because it is set to an internal object when MGSFragaria's autocomplete
* delegate is set to nil. */
@property (weak) id<SMLAutoCompleteDelegate> autocompleteDelegate;
/** The controller which manages the accessory user interface for this text
* view. */
@property (readonly) MGSExtraInterfaceController *interfaceController;
/** Instances of this class will perform syntax highlighting in text views. */
@property (readonly) SMLSyntaxColouring *syntaxColouring;
@end
| Use weak attribute for the autocompleteDelegate property of SMLTextView. | Use weak attribute for the autocompleteDelegate property of SMLTextView.
| C | apache-2.0 | shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,vakoc/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,bitstadium/Fragaria,shysaur/Fragaria,bitstadium/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,shysaur/Fragaria,vakoc/Fragaria,shysaur/Fragaria |
0d91ee8a0d9b26e4847ce5724a08a0d5160b38e8 | app/src/main/jni/scavenger.c | app/src/main/jni/scavenger.c | #include <jni.h>
#include <android/log.h>
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved)
{
__android_log_print(ANDROID_LOG_VERBOSE, "Scavenger Jni", "JNI_OnLoad is called");
} | #include <jni.h>
#include <signal.h>
#include <android/log.h>
#define CATCHSIG(X) sigaction(X, &handler, &old_sa[X])
static struct sigaction old_sa[NSIG];
void android_sigaction(int signal, siginfo_t *info, void *reserved) {
// TODO invoke java method
}
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved)
{
__android_log_print(ANDROID_LOG_VERBOSE, "Scavenger Jni", "JNI_OnLoad is called");
struct sigaction handler;
memset(&handler, 0, sizeof(sigaction));
handler.sa_sigaction = android_sigaction;
handler.sa_flags = SA_RESETHAND;
CATCHSIG(SIGILL);
CATCHSIG(SIGABRT);
CATCHSIG(SIGBUS);
CATCHSIG(SIGFPE);
CATCHSIG(SIGSEGV);
CATCHSIG(SIGPIPE);
return JNI_VERSION_1_4;
} | Add jni code to catch crash signal | Add jni code to catch crash signal
| C | apache-2.0 | Shunix/Scavenger,Shunix/Scavenger |
fce8f063e38d86725b6b4d81c1ff42a82194146b | test/acm_random.h | test/acm_random.h | /*
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef LIBVPX_TEST_ACM_RANDOM_H_
#define LIBVPX_TEST_ACM_RANDOM_H_
#include <stdint.h>
#include <stdlib.h>
namespace libvpx_test {
class ACMRandom {
public:
explicit ACMRandom(int seed) {
Reset(seed);
}
void Reset(int seed) {
srand(seed);
}
uint8_t Rand8(void) {
return (rand() >> 8) & 0xff;
}
int PseudoUniform(int range) {
return (rand() >> 8) % range;
}
int operator()(int n) {
return PseudoUniform(n);
}
static int DeterministicSeed(void) {
return 0xbaba;
}
};
} // namespace libvpx_test
#endif // LIBVPX_TEST_ACM_RANDOM_H_
| /*
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef LIBVPX_TEST_ACM_RANDOM_H_
#define LIBVPX_TEST_ACM_RANDOM_H_
#include <stdlib.h>
#include "vpx/vpx_integer.h"
namespace libvpx_test {
class ACMRandom {
public:
explicit ACMRandom(int seed) {
Reset(seed);
}
void Reset(int seed) {
srand(seed);
}
uint8_t Rand8(void) {
return (rand() >> 8) & 0xff;
}
int PseudoUniform(int range) {
return (rand() >> 8) % range;
}
int operator()(int n) {
return PseudoUniform(n);
}
static int DeterministicSeed(void) {
return 0xbaba;
}
};
} // namespace libvpx_test
#endif // LIBVPX_TEST_ACM_RANDOM_H_
| Use vpx_integer.h instead of stdint.h | Use vpx_integer.h instead of stdint.h
vpx_integer accounts for win32, which does not have stdint.h
Change-Id: I0ecf243ba56ed2e920e1293a6876c2e1ef1af99e
| C | bsd-3-clause | gshORTON/webm.libvpx,jmvalin/aom,liqianggao/libvpx,iniwf/webm.libvpx,Acidburn0zzz/webm.libvpx,kalli123/webm.libvpx,ittiamvpx/libvpx-1,pcwalton/libvpx,turbulenz/libvpx,ShiftMediaProject/libvpx,kleopatra999/webm.libvpx,mwgoldsmith/vpx,mwgoldsmith/vpx,shareefalis/libvpx,goodleixiao/vpx,charup/https---github.com-webmproject-libvpx-,Laknot/libvpx,felipebetancur/libvpx,GrokImageCompression/aom,vasilvv/esvp8,luctrudeau/aom,thdav/aom,jdm/libvpx,pcwalton/libvpx,mbebenita/aom,webmproject/libvpx,n4t/libvpx,hsueceumd/test_hui,vasilvv/esvp8,iniwf/webm.libvpx,matanbs/webm.libvpx,VTCSecureLLC/libvpx,mwgoldsmith/vpx,Suvarna1488/webm.libvpx,goodleixiao/vpx,luctrudeau/aom,shareefalis/libvpx,ittiamvpx/libvpx,shyamalschandra/libvpx,running770/libvpx,jmvalin/aom,hsueceumd/test_hui,ShiftMediaProject/libvpx,shareefalis/libvpx,Topopiccione/libvpx,stewnorriss/libvpx,shyamalschandra/libvpx,ittiamvpx/libvpx-1,GrokImageCompression/aom,shyamalschandra/libvpx,ittiamvpx/libvpx-1,luctrudeau/aom,Distrotech/libvpx,running770/libvpx,n4t/libvpx,mbebenita/aom,kalli123/webm.libvpx,reimaginemedia/webm.libvpx,jacklicn/webm.libvpx,iniwf/webm.libvpx,shareefalis/libvpx,matanbs/webm.libvpx,ittiamvpx/libvpx-1,WebRTC-Labs/libvpx,reimaginemedia/webm.libvpx,Maria1099/webm.libvpx,kim42083/webm.libvpx,openpeer/libvpx_new,zofuthan/libvpx,running770/libvpx,kalli123/webm.libvpx,matanbs/webm.libvpx,n4t/libvpx,cinema6/libvpx,altogother/webm.libvpx,kim42083/webm.libvpx,jmvalin/aom,mwgoldsmith/vpx,goodleixiao/vpx,thdav/aom,hsueceumd/test_hui,cinema6/libvpx,Distrotech/libvpx,ittiamvpx/libvpx,goodleixiao/vpx,iniwf/webm.libvpx,lyx2014/libvpx_c,matanbs/webm.libvpx,shareefalis/libvpx,turbulenz/libvpx,kim42083/webm.libvpx,felipebetancur/libvpx,matanbs/vp982,matanbs/webm.libvpx,zofuthan/libvpx,jdm/libvpx,shacklettbp/aom,Topopiccione/libvpx,mbebenita/aom,mbebenita/aom,hsueceumd/test_hui,liqianggao/libvpx,openpeer/libvpx_new,lyx2014/libvpx_c,Laknot/libvpx,gshORTON/webm.libvpx,kleopatra999/webm.libvpx,reimaginemedia/webm.libvpx,Suvarna1488/webm.libvpx,zofuthan/libvpx,cinema6/libvpx,smarter/aom,stewnorriss/libvpx,vasilvv/esvp8,WebRTC-Labs/libvpx,stewnorriss/libvpx,zofuthan/libvpx,shacklettbp/aom,shyamalschandra/libvpx,gshORTON/webm.libvpx,turbulenz/libvpx,smarter/aom,ShiftMediaProject/libvpx,Maria1099/webm.libvpx,ittiamvpx/libvpx-1,Acidburn0zzz/webm.libvpx,turbulenz/libvpx,thdav/aom,Topopiccione/libvpx,VTCSecureLLC/libvpx,GrokImageCompression/aom,mwgoldsmith/vpx,shyamalschandra/libvpx,abwiz0086/webm.libvpx,Distrotech/libvpx,ShiftMediaProject/libvpx,liqianggao/libvpx,Suvarna1488/webm.libvpx,stewnorriss/libvpx,jacklicn/webm.libvpx,kleopatra999/webm.libvpx,lyx2014/libvpx_c,kalli123/webm.libvpx,lyx2014/libvpx_c,VTCSecureLLC/libvpx,smarter/aom,luctrudeau/aom,smarter/aom,zofuthan/libvpx,kalli123/webm.libvpx,webmproject/libvpx,ittiamvpx/libvpx-1,Distrotech/libvpx,mbebenita/aom,pcwalton/libvpx,ShiftMediaProject/libvpx,VTCSecureLLC/libvpx,turbulenz/libvpx,stewnorriss/libvpx,VTCSecureLLC/libvpx,mwgoldsmith/libvpx,charup/https---github.com-webmproject-libvpx-,running770/libvpx,hsueceumd/test_hui,pcwalton/libvpx,kim42083/webm.libvpx,gshORTON/webm.libvpx,mwgoldsmith/libvpx,running770/libvpx,turbulenz/libvpx,GrokImageCompression/aom,Suvarna1488/webm.libvpx,vasilvv/esvp8,charup/https---github.com-webmproject-libvpx-,Topopiccione/libvpx,Laknot/libvpx,vasilvv/esvp8,WebRTC-Labs/libvpx,WebRTC-Labs/libvpx,shacklettbp/aom,iniwf/webm.libvpx,charup/https---github.com-webmproject-libvpx-,Maria1099/webm.libvpx,altogother/webm.libvpx,sanyaade-teachings/libvpx,mwgoldsmith/libvpx,Distrotech/libvpx,jdm/libvpx,cinema6/libvpx,thdav/aom,jacklicn/webm.libvpx,jacklicn/webm.libvpx,cinema6/libvpx,webmproject/libvpx,felipebetancur/libvpx,matanbs/vp982,turbulenz/libvpx,ittiamvpx/libvpx,shacklettbp/aom,matanbs/vp982,mbebenita/aom,kleopatra999/webm.libvpx,Acidburn0zzz/webm.libvpx,mbebenita/aom,gshORTON/webm.libvpx,felipebetancur/libvpx,abwiz0086/webm.libvpx,sanyaade-teachings/libvpx,VTCSecureLLC/libvpx,sanyaade-teachings/libvpx,Topopiccione/libvpx,Maria1099/webm.libvpx,openpeer/libvpx_new,thdav/aom,webmproject/libvpx,shyamalschandra/libvpx,jmvalin/aom,running770/libvpx,mbebenita/aom,felipebetancur/libvpx,liqianggao/libvpx,goodleixiao/vpx,smarter/aom,Distrotech/libvpx,goodleixiao/vpx,ittiamvpx/libvpx,Acidburn0zzz/webm.libvpx,gshORTON/webm.libvpx,altogother/webm.libvpx,altogother/webm.libvpx,mwgoldsmith/libvpx,turbulenz/libvpx,altogother/webm.libvpx,pcwalton/libvpx,hsueceumd/test_hui,reimaginemedia/webm.libvpx,openpeer/libvpx_new,matanbs/vp982,mwgoldsmith/libvpx,n4t/libvpx,vasilvv/esvp8,zofuthan/libvpx,luctrudeau/aom,Suvarna1488/webm.libvpx,matanbs/vp982,shacklettbp/aom,felipebetancur/libvpx,kim42083/webm.libvpx,webmproject/libvpx,jdm/libvpx,mbebenita/aom,kim42083/webm.libvpx,abwiz0086/webm.libvpx,reimaginemedia/webm.libvpx,webmproject/libvpx,iniwf/webm.libvpx,jmvalin/aom,GrokImageCompression/aom,charup/https---github.com-webmproject-libvpx-,Acidburn0zzz/webm.libvpx,cinema6/libvpx,openpeer/libvpx_new,kleopatra999/webm.libvpx,abwiz0086/webm.libvpx,jacklicn/webm.libvpx,mwgoldsmith/libvpx,pcwalton/libvpx,turbulenz/libvpx,Laknot/libvpx,kleopatra999/webm.libvpx,Maria1099/webm.libvpx,stewnorriss/libvpx,ittiamvpx/libvpx,WebRTC-Labs/libvpx,openpeer/libvpx_new,abwiz0086/webm.libvpx,Laknot/libvpx,Maria1099/webm.libvpx,jdm/libvpx,vasilvv/esvp8,shareefalis/libvpx,matanbs/vp982,luctrudeau/aom,kalli123/webm.libvpx,lyx2014/libvpx_c,sanyaade-teachings/libvpx,altogother/webm.libvpx,jacklicn/webm.libvpx,lyx2014/libvpx_c,shacklettbp/aom,matanbs/vp982,Laknot/libvpx,Acidburn0zzz/webm.libvpx,GrokImageCompression/aom,charup/https---github.com-webmproject-libvpx-,smarter/aom,liqianggao/libvpx,mwgoldsmith/vpx,thdav/aom,ittiamvpx/libvpx,abwiz0086/webm.libvpx,matanbs/webm.libvpx,n4t/libvpx,Suvarna1488/webm.libvpx,jmvalin/aom,jdm/libvpx,Topopiccione/libvpx,cinema6/libvpx,liqianggao/libvpx,reimaginemedia/webm.libvpx,sanyaade-teachings/libvpx |
1f3121d2ba227c0d3e7987b1297f00dfb83d7871 | src/command_line_flags.h | src/command_line_flags.h | #ifndef COMMAND_LINE_FLAGS_H_
#define COMMAND_LINE_FLAGS_H_
#include "kinetic/kinetic.h"
#include "gflags/gflags.h"
DEFINE_string(host, "localhost", "Kinetic Host");
DEFINE_uint64(port, 8123, "Kinetic Port");
DEFINE_uint64(timeout, 30, "Timeout");
void parse_flags(int *argc, char*** argv, std::unique_ptr<kinetic::ConnectionHandle>& connection) {
google::ParseCommandLineFlags(argc, argv, true);
kinetic::ConnectionOptions options;
options.host = FLAGS_host;
options.port = FLAGS_port;
options.user_id = 1;
options.hmac_key = "asdfasdf";
kinetic::KineticConnectionFactory kinetic_connection_factory = kinetic::NewKineticConnectionFactory();
if (!kinetic_connection_factory.NewConnection(options, FLAGS_timeout, connection).ok()) {
printf("Unable to connect\n");
exit(1);
}
}
#endif // COMMAND_LINE_FLAGS_H_
| #ifndef COMMAND_LINE_FLAGS_H_
#define COMMAND_LINE_FLAGS_H_
#include "kinetic/kinetic.h"
#include "gflags/gflags.h"
DEFINE_string(host, "localhost", "Kinetic Host");
DEFINE_uint64(port, 8123, "Kinetic Port");
DEFINE_uint64(timeout, 30, "Timeout");
DEFINE_uint64(user_id, 1, "Kinetic User ID");
DEFINE_string(hmac_key, "asdfasdf", "Kinetic User HMAC key");
void parse_flags(int *argc, char*** argv, std::unique_ptr<kinetic::ConnectionHandle>& connection) {
google::ParseCommandLineFlags(argc, argv, true);
kinetic::ConnectionOptions options;
options.host = FLAGS_host;
options.port = FLAGS_port;
options.user_id = FLAGS_user_id;
options.hmac_key = FLAGS_hmac_key;
kinetic::KineticConnectionFactory kinetic_connection_factory = kinetic::NewKineticConnectionFactory();
if (!kinetic_connection_factory.NewConnection(options, FLAGS_timeout, connection).ok()) {
printf("Unable to connect\n");
exit(1);
}
}
#endif // COMMAND_LINE_FLAGS_H_
| Allow setting user id/hmac key via command line params for setpin | Allow setting user id/hmac key via command line params for setpin
| C | unknown | Kinetic/kinetic-cpp-examples,Seagate/kinetic-cpp-examples,chenchongli/kinetic-cpp-examples,chenchongli/kinetic-cpp-examples,daasbank/daasbank-kinetic-c-,Seagate/kinetic-cpp-examples,Kinetic/kinetic-cpp-examples,daasbank/daasbank-kinetic-c- |
0cf700533c55cf0343622d130c2645ea2c08d9fd | src/org/objectweb/proactive/examples/mpi/cpi.c | src/org/objectweb/proactive/examples/mpi/cpi.c |
#include <stdlib.h>
#include <stdio.h>
#include <mpi.h>
main(int argc, char **argv)
{
register double width;
double sum = 0, lsum;
register int intervals, i;
int nproc, iproc;
MPI_Win sum_win;
if (MPI_Init(&argc, &argv) != MPI_SUCCESS) exit(1);
MPI_Comm_size(MPI_COMM_WORLD, &nproc);
MPI_Comm_rank(MPI_COMM_WORLD, &iproc);
MPI_Win_create(&sum, sizeof(sum), sizeof(sum),
0, MPI_COMM_WORLD, &sum_win);
MPI_Win_fence(0, sum_win);
intervals = atoi(argv[1]);
width = 1.0 / intervals;
lsum = 0;
for (i=iproc; i<intervals; i+=nproc) {
register double x = (i + 0.5) * width;
lsum += 4.0 / (1.0 + x * x);
}
lsum *= width;
MPI_Accumulate(&lsum, 1, MPI_DOUBLE, 0, 0,
1, MPI_DOUBLE, MPI_SUM, sum_win);
MPI_Win_fence(0, sum_win);
if (iproc == 0) {
printf("Estimation of pi is %f\n", sum);
}
MPI_Finalize();
return(0);
}
| Replace MPI source code instead of executive binary file. User will compile the source with its own mpi implementation. | Replace MPI source code instead of executive binary file.
User will compile the source with its own mpi implementation.
git-svn-id: 9146c88ff6d39b48099bf954d15d68f687b3fa69@3133 28e8926c-6b08-0410-baaa-805c5e19b8d6
| C | agpl-3.0 | ow2-proactive/programming,mnip91/programming-multiactivities,lpellegr/programming,jrochas/scale-proactive,acontes/scheduling,mnip91/proactive-component-monitoring,PaulKh/scale-proactive,fviale/programming,acontes/scheduling,acontes/programming,lpellegr/programming,mnip91/proactive-component-monitoring,ow2-proactive/programming,fviale/programming,PaulKh/scale-proactive,acontes/programming,paraita/programming,lpellegr/programming,acontes/programming,mnip91/programming-multiactivities,PaulKh/scale-proactive,mnip91/programming-multiactivities,PaulKh/scale-proactive,ow2-proactive/programming,acontes/scheduling,paraita/programming,jrochas/scale-proactive,fviale/programming,paraita/programming,ow2-proactive/programming,paraita/programming,ow2-proactive/programming,mnip91/programming-multiactivities,jrochas/scale-proactive,acontes/programming,fviale/programming,acontes/scheduling,paraita/programming,jrochas/scale-proactive,mnip91/proactive-component-monitoring,PaulKh/scale-proactive,jrochas/scale-proactive,mnip91/programming-multiactivities,acontes/programming,acontes/programming,acontes/scheduling,acontes/scheduling,lpellegr/programming,acontes/programming,ow2-proactive/programming,fviale/programming,mnip91/proactive-component-monitoring,PaulKh/scale-proactive,jrochas/scale-proactive,mnip91/proactive-component-monitoring,acontes/scheduling,jrochas/scale-proactive,lpellegr/programming,PaulKh/scale-proactive,fviale/programming,lpellegr/programming,mnip91/programming-multiactivities,paraita/programming,mnip91/proactive-component-monitoring |
|
070a960b3f83eaaf5f64dfdd9dd467d1949082ce | src/prodbg/AmigaUAE/AmigaUAE.h | src/prodbg/AmigaUAE/AmigaUAE.h | #pragma once
#include <QObject>
#include <QProcess>
#include <QString>
#include "Config/AmigaUAEConfig.h"
class QTemporaryDir;
namespace prodbg {
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class AmigaUAE : public QObject
{
Q_OBJECT
public:
AmigaUAE(QObject* parent);
~AmigaUAE();
bool openFile();
void runExecutable(const QString& filename);
bool validateSettings();
void launchUAE();
void killProcess();
// TODO: Structure this better
QProcess* m_uaeProcess;
uint16_t m_setFileId;
uint16_t m_setHddPathId;
QString m_uaeExe;
QString m_config;
QString m_cmdLineArgs;
QString m_dh0Path;
QString m_fileToRun;
QString m_localExeToRun;
QString m_romPath;
bool m_copyFiles;
bool m_skipUAELaunch;
AmigaUAEConfig::ConfigMode m_configMode;
private:
Q_SLOT void started();
Q_SLOT void errorOccurred(QProcess::ProcessError error);
QTemporaryDir* m_tempDir;
void readSettings();
bool m_running = false;
};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
| #pragma once
#include <QObject>
#include <QProcess>
#include <QString>
#include "Config/AmigaUAEConfig.h"
class QTemporaryDir;
namespace prodbg {
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class AmigaUAE : public QObject
{
Q_OBJECT
public:
AmigaUAE(QObject* parent);
~AmigaUAE();
bool openFile();
void runExecutable(const QString& filename);
bool validateSettings();
void launchUAE();
void killProcess();
// TODO: Structure this better
QProcess* m_uaeProcess;
uint16_t m_setFileId;
uint16_t m_setHddPathId;
QString m_uaeExe;
QString m_config;
QString m_cmdLineArgs;
QString m_dh0Path;
QString m_fileToRun;
QString m_localExeToRun;
QString m_romPath;
bool m_copyFiles;
bool m_skipUAELaunch;
AmigaUAEConfig::ConfigMode m_configMode;
private:
Q_SLOT void started();
Q_SLOT void errorOccurred(QProcess::ProcessError error);
QTemporaryDir* m_tempDir = nullptr;
void readSettings();
bool m_running = false;
};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
| Set tempdir to null by default | Set tempdir to null by default
| C | mit | emoon/ProDBG,emoon/ProDBG,emoon/ProDBG,emoon/ProDBG,emoon/ProDBG,emoon/ProDBG |
aee358642015f5453dcca6831bc3f3a6c6df22e7 | atom/browser/api/atom_api_menu_views.h | atom/browser/api/atom_api_menu_views.h | // Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
#define ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
#include <map>
#include <memory>
#include "atom/browser/api/atom_api_menu.h"
#include "base/memory/weak_ptr.h"
#include "ui/display/screen.h"
#include "ui/views/controls/menu/menu_runner.h"
namespace atom {
namespace api {
class MenuViews : public Menu {
public:
MenuViews(v8::Isolate* isolate, v8::Local<v8::Object> wrapper);
protected:
void PopupAt(
Window* window, int x, int y, int positioning_item) override;
void ClosePopupAt(int32_t window_id) override;
private:
// window ID -> open context menu
std::map<int32_t, std::unique_ptr<views::MenuRunner>> menu_runners_;
base::WeakPtrFactory<MenuViews> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(MenuViews);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
| // Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
#define ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
#include <map>
#include <memory>
#include "atom/browser/api/atom_api_menu.h"
#include "base/memory/weak_ptr.h"
#include "ui/display/screen.h"
#include "ui/views/controls/menu/menu_runner.h"
namespace atom {
namespace api {
class MenuViews : public Menu {
public:
MenuViews(v8::Isolate* isolate, v8::Local<v8::Object> wrapper);
protected:
void PopupAt(
Window* window, int x, int y, int positioning_item,
CloseCallback callback) override;
void ClosePopupAt(int32_t window_id) override;
private:
// window ID -> open context menu
std::map<int32_t, std::unique_ptr<views::MenuRunner>> menu_runners_;
base::WeakPtrFactory<MenuViews> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(MenuViews);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
| Fix missing PopupAt overrides on windows/linux | Fix missing PopupAt overrides on windows/linux
Auditors: 47e4a4954d6a66edd1210b9b46e0a144c1078e87@bsclifton
| C | mit | brave/electron,brave/muon,brave/electron,brave/electron,brave/electron,brave/muon,brave/muon,brave/muon,brave/electron,brave/muon,brave/muon,brave/electron |
44d689bc6ec53db0ec8572cc3bcd89e2a03a24da | benchmark/parse_records_benchmark.h | benchmark/parse_records_benchmark.h | #pragma once
template<typename B, typename R> static void ParseRecordsBenchmark(benchmark::State &state, const simdjson::padded_string &json) {
// Warmup and equality check (make sure the data is right!)
B bench;
bench.SetUp();
if (!bench.Run(json)) { state.SkipWithError("warmup tweet reading failed"); return; }
{
R reference;
reference.SetUp();
if (!reference.Run(json)) { state.SkipWithError("reference tweet reading failed"); return; }
// assert(bench.Records() == reference.Records());
reference.TearDown();
}
// Run the benchmark
event_collector<true> events;
events.start();
for (SIMDJSON_UNUSED auto _ : state) {
if (!bench.Run(json)) { state.SkipWithError("tweet reading failed"); return; }
}
state.SetBytesProcessed(json.size() * state.iterations());
state.SetItemsProcessed(bench.Records().size() * state.iterations());
auto counts = events.end();
if (events.has_events()) {
state.counters["Instructions"] = counts.instructions();
state.counters["Cycles"] = counts.cycles();
state.counters["Branch Misses"] = counts.branch_misses();
state.counters["Cache References"] = counts.cache_references();
state.counters["Cache Misses"] = counts.cache_misses();
}
}
| #pragma once
template<typename B, typename R> static void ParseRecordsBenchmark(benchmark::State &state, const simdjson::padded_string &json) {
// Warmup and equality check (make sure the data is right!)
B bench;
bench.SetUp();
if (!bench.Run(json)) { state.SkipWithError("warmup tweet reading failed"); return; }
{
R reference;
reference.SetUp();
if (!reference.Run(json)) { state.SkipWithError("reference tweet reading failed"); return; }
// assert(bench.Records() == reference.Records());
reference.TearDown();
}
// Run the benchmark
event_collector<true> events;
events.start();
for (SIMDJSON_UNUSED auto _ : state) {
if (!bench.Run(json)) { state.SkipWithError("tweet reading failed"); return; }
}
auto bytes = json.size() * state.iterations();
state.SetBytesProcessed(bytes);
state.SetItemsProcessed(bench.Records().size() * state.iterations());
auto counts = events.end();
if (events.has_events()) {
state.counters["Ins./Byte"] = double(counts.instructions()) / double(bytes);
state.counters["Ins./Cycle"] = double(counts.instructions()) / double(counts.cycles());
state.counters["Cycles/Byte"] = double(counts.cycles()) / double(bytes);
state.counters["BranchMiss"] = benchmark::Counter(counts.branch_misses(), benchmark::Counter::kAvgIterations);
state.counters["CacheMiss"] = benchmark::Counter(counts.cache_misses(), benchmark::Counter::kAvgIterations);
state.counters["CacheRef"] = benchmark::Counter(counts.cache_references(), benchmark::Counter::kAvgIterations);
}
}
| Make instructions / cycle counters more useful | Make instructions / cycle counters more useful
| C | apache-2.0 | lemire/simdjson,lemire/simdjson,lemire/simdjson,lemire/simdjson,lemire/simdjson,lemire/simdjson |
0c84db950784ba4dd56f92220419490faff1f915 | include/swift/Basic/Algorithm.h | include/swift/Basic/Algorithm.h | //===--- Algorithm.h - ------------------------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file defines helper algorithms, some of which are ported from C++14,
// which may not be available on all platforms yet.
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_BASIC_ALGORITHM_H
#define SWIFT_BASIC_ALGORITHM_H
namespace swift {
/// Returns the minimum of `a` and `b`, or `a` if they are equivalent.
template <typename T>
constexpr const T& min(const T &a, const T &b) {
return !(b < a) ? a : b;
}
/// Returns the maximum of `a` and `b`, or `a` if they are equivalent.
template <typename T>
constexpr const T& max(const T &a, const T &b) {
return (a < b) ? b : a;
}
} // end namespace swift
#endif /* SWIFT_BASIC_ALGORITHM_H */
| //===--- Algorithm.h - ------------------------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file defines helper algorithms, some of which are ported from C++14,
// which may not be available on all platforms yet.
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_BASIC_ALGORITHM_H
#define SWIFT_BASIC_ALGORITHM_H
namespace swift {
/// Returns the minimum of `a` and `b`, or `a` if they are equivalent.
template <typename T>
constexpr const T &min(const T &a, const T &b) {
return !(b < a) ? a : b;
}
/// Returns the maximum of `a` and `b`, or `a` if they are equivalent.
template <typename T>
constexpr const T &max(const T &a, const T &b) {
return (a < b) ? b : a;
}
} // end namespace swift
#endif /* SWIFT_BASIC_ALGORITHM_H */
| Fix methods return type ampersand location (NFC) | Fix methods return type ampersand location (NFC) | C | apache-2.0 | hughbe/swift,ken0nek/swift,SwiftAndroid/swift,glessard/swift,djwbrown/swift,swiftix/swift,tjw/swift,austinzheng/swift,manavgabhawala/swift,allevato/swift,therealbnut/swift,xedin/swift,arvedviehweger/swift,aschwaighofer/swift,shajrawi/swift,zisko/swift,ahoppen/swift,OscarSwanros/swift,JaSpa/swift,parkera/swift,swiftix/swift,frootloops/swift,alblue/swift,ahoppen/swift,jmgc/swift,OscarSwanros/swift,danielmartin/swift,CodaFi/swift,kperryua/swift,modocache/swift,IngmarStein/swift,stephentyrone/swift,danielmartin/swift,gregomni/swift,kperryua/swift,practicalswift/swift,therealbnut/swift,johnno1962d/swift,kstaring/swift,jckarter/swift,gmilos/swift,calebd/swift,allevato/swift,tardieu/swift,swiftix/swift,sschiau/swift,JGiola/swift,glessard/swift,jmgc/swift,kperryua/swift,arvedviehweger/swift,modocache/swift,manavgabhawala/swift,johnno1962d/swift,russbishop/swift,amraboelela/swift,codestergit/swift,IngmarStein/swift,sschiau/swift,johnno1962d/swift,felix91gr/swift,jtbandes/swift,apple/swift,ben-ng/swift,return/swift,tardieu/swift,huonw/swift,xedin/swift,gribozavr/swift,lorentey/swift,calebd/swift,JaSpa/swift,gregomni/swift,tjw/swift,hooman/swift,gottesmm/swift,harlanhaskins/swift,apple/swift,milseman/swift,xedin/swift,ken0nek/swift,ben-ng/swift,jtbandes/swift,SwiftAndroid/swift,danielmartin/swift,modocache/swift,ken0nek/swift,shajrawi/swift,airspeedswift/swift,aschwaighofer/swift,return/swift,parkera/swift,harlanhaskins/swift,lorentey/swift,atrick/swift,frootloops/swift,jmgc/swift,natecook1000/swift,roambotics/swift,practicalswift/swift,sschiau/swift,allevato/swift,xwu/swift,jtbandes/swift,jmgc/swift,codestergit/swift,OscarSwanros/swift,lorentey/swift,milseman/swift,huonw/swift,jopamer/swift,Jnosh/swift,IngmarStein/swift,apple/swift,tkremenek/swift,tardieu/swift,return/swift,amraboelela/swift,jckarter/swift,karwa/swift,KrishMunot/swift,KrishMunot/swift,tkremenek/swift,shajrawi/swift,IngmarStein/swift,tinysun212/swift-windows,harlanhaskins/swift,austinzheng/swift,ahoppen/swift,frootloops/swift,tardieu/swift,bitjammer/swift,xedin/swift,amraboelela/swift,xwu/swift,karwa/swift,kstaring/swift,djwbrown/swift,bitjammer/swift,CodaFi/swift,return/swift,jopamer/swift,xwu/swift,johnno1962d/swift,hughbe/swift,aschwaighofer/swift,harlanhaskins/swift,modocache/swift,therealbnut/swift,aschwaighofer/swift,lorentey/swift,roambotics/swift,calebd/swift,russbishop/swift,shajrawi/swift,ken0nek/swift,ken0nek/swift,IngmarStein/swift,manavgabhawala/swift,felix91gr/swift,gribozavr/swift,therealbnut/swift,rudkx/swift,gmilos/swift,allevato/swift,shahmishal/swift,roambotics/swift,ahoppen/swift,kstaring/swift,milseman/swift,Jnosh/swift,brentdax/swift,aschwaighofer/swift,brentdax/swift,calebd/swift,CodaFi/swift,nathawes/swift,brentdax/swift,parkera/swift,deyton/swift,glessard/swift,rudkx/swift,ben-ng/swift,deyton/swift,shajrawi/swift,therealbnut/swift,therealbnut/swift,tkremenek/swift,kperryua/swift,dreamsxin/swift,djwbrown/swift,gregomni/swift,alblue/swift,austinzheng/swift,JGiola/swift,gmilos/swift,djwbrown/swift,benlangmuir/swift,huonw/swift,brentdax/swift,ahoppen/swift,austinzheng/swift,IngmarStein/swift,djwbrown/swift,bitjammer/swift,johnno1962d/swift,tinysun212/swift-windows,russbishop/swift,russbishop/swift,hughbe/swift,JGiola/swift,allevato/swift,natecook1000/swift,xwu/swift,natecook1000/swift,manavgabhawala/swift,nathawes/swift,amraboelela/swift,djwbrown/swift,arvedviehweger/swift,jmgc/swift,harlanhaskins/swift,shajrawi/swift,kstaring/swift,atrick/swift,alblue/swift,hughbe/swift,JaSpa/swift,benlangmuir/swift,danielmartin/swift,felix91gr/swift,uasys/swift,lorentey/swift,rudkx/swift,benlangmuir/swift,stephentyrone/swift,deyton/swift,gregomni/swift,ahoppen/swift,practicalswift/swift,roambotics/swift,kperryua/swift,devincoughlin/swift,xwu/swift,KrishMunot/swift,parkera/swift,huonw/swift,shahmishal/swift,shajrawi/swift,allevato/swift,frootloops/swift,karwa/swift,tjw/swift,karwa/swift,jmgc/swift,modocache/swift,gribozavr/swift,tjw/swift,OscarSwanros/swift,jtbandes/swift,arvedviehweger/swift,KrishMunot/swift,xedin/swift,hughbe/swift,codestergit/swift,sschiau/swift,atrick/swift,calebd/swift,KrishMunot/swift,austinzheng/swift,codestergit/swift,glessard/swift,tardieu/swift,kperryua/swift,JGiola/swift,airspeedswift/swift,JGiola/swift,jckarter/swift,shahmishal/swift,sschiau/swift,ken0nek/swift,amraboelela/swift,kstaring/swift,stephentyrone/swift,jopamer/swift,arvedviehweger/swift,stephentyrone/swift,uasys/swift,brentdax/swift,IngmarStein/swift,tjw/swift,manavgabhawala/swift,harlanhaskins/swift,manavgabhawala/swift,huonw/swift,modocache/swift,practicalswift/swift,arvedviehweger/swift,zisko/swift,jckarter/swift,brentdax/swift,parkera/swift,ben-ng/swift,milseman/swift,airspeedswift/swift,frootloops/swift,nathawes/swift,gmilos/swift,uasys/swift,tinysun212/swift-windows,aschwaighofer/swift,xedin/swift,felix91gr/swift,swiftix/swift,deyton/swift,calebd/swift,frootloops/swift,hooman/swift,hughbe/swift,Jnosh/swift,apple/swift,rudkx/swift,lorentey/swift,jtbandes/swift,rudkx/swift,nathawes/swift,karwa/swift,deyton/swift,SwiftAndroid/swift,gribozavr/swift,xwu/swift,amraboelela/swift,tkremenek/swift,swiftix/swift,tkremenek/swift,CodaFi/swift,nathawes/swift,modocache/swift,shahmishal/swift,allevato/swift,karwa/swift,milseman/swift,tkremenek/swift,JaSpa/swift,jckarter/swift,huonw/swift,gmilos/swift,benlangmuir/swift,xedin/swift,bitjammer/swift,practicalswift/swift,johnno1962d/swift,CodaFi/swift,danielmartin/swift,uasys/swift,zisko/swift,shahmishal/swift,bitjammer/swift,felix91gr/swift,practicalswift/swift,karwa/swift,hooman/swift,JGiola/swift,jtbandes/swift,tinysun212/swift-windows,swiftix/swift,stephentyrone/swift,felix91gr/swift,devincoughlin/swift,karwa/swift,atrick/swift,amraboelela/swift,shahmishal/swift,tardieu/swift,tinysun212/swift-windows,return/swift,kstaring/swift,kperryua/swift,alblue/swift,alblue/swift,jopamer/swift,atrick/swift,gottesmm/swift,milseman/swift,codestergit/swift,airspeedswift/swift,uasys/swift,OscarSwanros/swift,uasys/swift,russbishop/swift,ken0nek/swift,sschiau/swift,atrick/swift,danielmartin/swift,apple/swift,practicalswift/swift,gregomni/swift,dreamsxin/swift,gribozavr/swift,russbishop/swift,gribozavr/swift,austinzheng/swift,tinysun212/swift-windows,ben-ng/swift,devincoughlin/swift,arvedviehweger/swift,natecook1000/swift,xwu/swift,Jnosh/swift,jckarter/swift,therealbnut/swift,JaSpa/swift,shahmishal/swift,OscarSwanros/swift,gmilos/swift,danielmartin/swift,JaSpa/swift,ben-ng/swift,benlangmuir/swift,tjw/swift,swiftix/swift,gmilos/swift,tjw/swift,hooman/swift,glessard/swift,calebd/swift,OscarSwanros/swift,shajrawi/swift,parkera/swift,jopamer/swift,return/swift,glessard/swift,bitjammer/swift,gottesmm/swift,CodaFi/swift,roambotics/swift,gribozavr/swift,apple/swift,deyton/swift,devincoughlin/swift,russbishop/swift,gottesmm/swift,alblue/swift,lorentey/swift,natecook1000/swift,manavgabhawala/swift,jmgc/swift,parkera/swift,deyton/swift,CodaFi/swift,rudkx/swift,practicalswift/swift,return/swift,Jnosh/swift,KrishMunot/swift,djwbrown/swift,codestergit/swift,milseman/swift,natecook1000/swift,sschiau/swift,uasys/swift,jtbandes/swift,nathawes/swift,felix91gr/swift,gottesmm/swift,brentdax/swift,KrishMunot/swift,tkremenek/swift,stephentyrone/swift,codestergit/swift,airspeedswift/swift,gottesmm/swift,kstaring/swift,SwiftAndroid/swift,SwiftAndroid/swift,benlangmuir/swift,gribozavr/swift,hooman/swift,natecook1000/swift,xedin/swift,zisko/swift,Jnosh/swift,jckarter/swift,hooman/swift,aschwaighofer/swift,johnno1962d/swift,shahmishal/swift,jopamer/swift,SwiftAndroid/swift,jopamer/swift,sschiau/swift,devincoughlin/swift,gottesmm/swift,frootloops/swift,airspeedswift/swift,devincoughlin/swift,zisko/swift,stephentyrone/swift,alblue/swift,parkera/swift,Jnosh/swift,zisko/swift,huonw/swift,JaSpa/swift,nathawes/swift,zisko/swift,gregomni/swift,hooman/swift,devincoughlin/swift,ben-ng/swift,bitjammer/swift,harlanhaskins/swift,roambotics/swift,tardieu/swift,lorentey/swift,tinysun212/swift-windows,airspeedswift/swift,austinzheng/swift,devincoughlin/swift,SwiftAndroid/swift,hughbe/swift |
89e8a07af3e24ae0f843b80906422d711f73de0a | test/Analysis/uninit-vals-ps.c | test/Analysis/uninit-vals-ps.c | // RUN: clang -checker-simple -verify %s
struct FPRec {
void (*my_func)(int * x);
};
int bar(int x);
int f1_a(struct FPRec* foo) {
int x;
(*foo->my_func)(&x);
return bar(x)+1; // no-warning
}
int f1_b() {
int x;
return bar(x)+1; // expected-warning{{Pass-by-value argument in function is undefined.}}
}
int f2() {
int x;
if (x+1) // expected-warning{{Branch}}
return 1;
return 2;
}
int f2_b() {
int x;
return ((x+1)+2+((x))) + 1 ? 1 : 2; // expected-warning{{Branch}}
}
int f3(void) {
int i;
int *p = &i;
if (*p > 0) // expected-warning{{Branch condition evaluates to an uninitialized value}}
return 0;
else
return 1;
}
| // RUN: clang -checker-simple -verify %s
struct FPRec {
void (*my_func)(int * x);
};
int bar(int x);
int f1_a(struct FPRec* foo) {
int x;
(*foo->my_func)(&x);
return bar(x)+1; // no-warning
}
int f1_b() {
int x;
return bar(x)+1; // expected-warning{{Pass-by-value argument in function is undefined.}}
}
int f2() {
int x;
if (x+1) // expected-warning{{Branch}}
return 1;
return 2;
}
int f2_b() {
int x;
return ((x+1)+2+((x))) + 1 ? 1 : 2; // expected-warning{{Branch}}
}
int f3(void) {
int i;
int *p = &i;
if (*p > 0) // expected-warning{{Branch condition evaluates to an uninitialized value}}
return 0;
else
return 1;
}
// RUN: clang -checker-simple -analyzer-store-region -verify %s
struct s {
int data;
};
struct s global;
void g(int);
void f4() {
int a;
if (global.data == 0)
a = 3;
if (global.data == 0)
g(a); // no-warning
}
| Add test for path-sensitive uninit-val detection involving struct field. | Add test for path-sensitive uninit-val detection involving struct field.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@59620 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | 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,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang |
6d6fdef0cbc741e8f10ed1003a2e7fe5551b0227 | collatz/c.c | collatz/c.c | #include <stdio.h>
static
int r( int n )
{
printf("%d\n", n);
if (n <= 1)
return n;
if (n%2)
return r((n*3)+1);
return r(n/2);
}
int main ( void )
{
puts("Basic collatz fun - recursive C function");
r(15);
return 0;
}
| #include <stdio.h>
#include <stdlib.h>
static
long r( long n )
{
printf("%ld\n", n);
if (n <= 1)
return n;
if (n%2)
return r((n*3)+1);
return r(n/2);
}
int main (int argc, char **argv)
{
long n = 15;
if (argc > 1)
n = strtol(argv[1], NULL, 10);
puts("Basic collatz fun - recursive C function");
r(n);
return 0;
}
| Allow passing ints as arg | Allow passing ints as arg
| C | mit | EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts,EVODelavega/gp-scripts |
c6db019f4816249ea029648a1ca22127ee0e7480 | module.c | module.c | #include <linux/module.h>
#include <linux/string.h>
#include <linux/fs.h>
#include <adm/uaccess.h>
// Module Stuff
MODULE_LICENCE("Apache"); // Change this to "GPL" if you get annoyed about
// the kernal playing a crying fit about non GPL stuff
MODULE_DESCRIPTION("A Markov device driver.");
MODULE_AUTHOR("Ben Cartwright-Cox");
static int dev_open(struct inode *, struct file *);
static int dev_rls(struct inode *, struct file *);
static ssize_t dev_read(strict file *, char *, size_t, loff_t *);
static ssize_t dev_write(strict file *, const char *, size_t, loff_t *);
| #include <linux/module.h>
#include <linux/string.h>
#include <linux/fs.h>
#include <adm/uaccess.h>
// Module Stuff
MODULE_LICENCE("Apache"); // Change this to "GPL" if you get annoyed about
// the kernal playing a crying fit about non GPL stuff
MODULE_DESCRIPTION("A Markov device driver.");
MODULE_AUTHOR("Ben Cartwright-Cox");
static int dev_open(struct inode *, struct file *);
static int dev_rls(struct inode *, struct file *);
static ssize_t dev_read(strict file *, char *, size_t, loff_t *);
static ssize_t dev_write(strict file *, const char *, size_t, loff_t *);
| Change tabs to spaces, Lets nip this one in the bud. | Change tabs to spaces, Lets nip this one in the bud.
| C | apache-2.0 | benjojo/dev_markov,benjojo/dev_markov |
f2ffa408d7ed974fd830c1804ea345955476ec87 | engines/default_engine/assoc.h | engines/default_engine/assoc.h | #ifndef ASSOC_H
#define ASSOC_H
struct assoc {
/* how many powers of 2's worth of buckets we use */
unsigned int hashpower;
/* Main hash table. This is where we look except during expansion. */
hash_item** primary_hashtable;
/*
* Previous hash table. During expansion, we look here for keys that haven't
* been moved over to the primary yet.
*/
hash_item** old_hashtable;
/* Number of items in the hash table. */
unsigned int hash_items;
/* Flag: Are we in the middle of expanding now? */
bool expanding;
/*
* During expansion we migrate values with bucket granularity; this is how
* far we've gotten so far. Ranges from 0 .. hashsize(hashpower - 1) - 1.
*/
unsigned int expand_bucket;
/*
* serialise access to the hashtable
*/
cb_mutex_t lock;
};
/* associative array */
ENGINE_ERROR_CODE assoc_init(struct default_engine *engine);
void assoc_destroy(void);
hash_item *assoc_find(struct default_engine *engine, uint32_t hash,
const hash_key* key);
int assoc_insert(struct default_engine *engine, uint32_t hash,
hash_item *item);
void assoc_delete(struct default_engine *engine, uint32_t hash,
const hash_key* key);
int start_assoc_maintenance_thread(struct default_engine *engine);
void stop_assoc_maintenance_thread(struct default_engine *engine);
#endif
| #ifndef ASSOC_H
#define ASSOC_H
struct assoc {
/* how many powers of 2's worth of buckets we use */
unsigned int hashpower;
/* Main hash table. This is where we look except during expansion. */
hash_item** primary_hashtable;
/*
* Previous hash table. During expansion, we look here for keys that haven't
* been moved over to the primary yet.
*/
hash_item** old_hashtable;
/* Number of items in the hash table. */
unsigned int hash_items;
/* Flag: Are we in the middle of expanding now? */
bool expanding;
/*
* During expansion we migrate values with bucket granularity; this is how
* far we've gotten so far. Ranges from 0 .. hashsize(hashpower - 1) - 1.
*/
unsigned int expand_bucket;
/*
* serialise access to the hashtable
*/
cb_mutex_t lock;
};
/* associative array */
ENGINE_ERROR_CODE assoc_init(struct default_engine *engine);
void assoc_destroy(void);
hash_item *assoc_find(struct default_engine *engine, uint32_t hash,
const hash_key* key);
int assoc_insert(struct default_engine *engine, uint32_t hash,
hash_item *item);
void assoc_delete(struct default_engine *engine, uint32_t hash,
const hash_key* key);
#endif
| Remove prototypes for nonexistent functions | Remove prototypes for nonexistent functions
Change-Id: Ife8b66f32aa78159ea3cfdec17cbc5148d954f8d
Reviewed-on: http://review.couchbase.org/80561
Tested-by: Build Bot <[email protected]>
Reviewed-by: Jim Walker <[email protected]>
| C | bsd-3-clause | daverigby/kv_engine,daverigby/kv_engine,daverigby/kv_engine,daverigby/kv_engine |
b1014743b93468028fd578264d93896ac85932ee | test/FrontendC/2009-05-17-AlwaysInline.c | test/FrontendC/2009-05-17-AlwaysInline.c | // RUN: %llvmgcc -S %s -O0 -o - -mllvm --disable-llvm-optzns | grep bar
// Check that the gcc inliner is turned off.
#include <stdio.h>
static __inline__ __attribute__ ((always_inline))
int bar (int x)
{
return 4;
}
void
foo ()
{
long long b = 1;
int Y = bar (4);
printf ("%d\n", Y);
}
| Check that the gcc front-end is not doing inlining when not doing unit-at-a-time. | Check that the gcc front-end is not doing inlining
when not doing unit-at-a-time.
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@71986 91177308-0d34-0410-b5e6-96231b3b80d8
| C | bsd-2-clause | dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,chubbymaggie/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,chubbymaggie/asap |
|
8d942517ca5d635a6510d1ebba97917b03eebb23 | src/header/NovelProcessTool.h | src/header/NovelProcessTool.h | /*
* NovelProcessTool.h
*
* Created on: 2015年2月19日
* Author: nemo
*/
#ifndef SRC_NOVELPROCESSTOOL_H_
#define SRC_NOVELPROCESSTOOL_H_
#include <string>
#include <fstream>
#include <vector>
using namespace std;
class NovelProcessTool {
public:
NovelProcessTool();
virtual ~NovelProcessTool();
protected:
/// Check the work directory.
void checkWorkingDirectory();
/// Open in and out file.
int fileOpen(string novelName);
/// Close in and out files.
void fileClosed();
/// Analysis the temp folder.
void analysisFile();
fstream _fileInStream; ///< The file input stream.
fstream _fileOutStream; ///< The file out stream.
string _tempDir; ///< The temp folder directory path.
string _resultDir; ///< The result folder directory path.
vector<string> _inputNovel; ///< The input file name.
};
#endif /* SRC_NOVELPROCESSTOOL_H_ */
| /*
* NovelProcessTool.h
*
* Created on: 2015年2月19日
* Author: nemo
*/
#ifndef SRC_NOVELPROCESSTOOL_H_
#define SRC_NOVELPROCESSTOOL_H_
#include <string>
#include <fstream>
#include <vector>
using namespace std;
class NovelProcessTool {
public:
NovelProcessTool();
virtual ~NovelProcessTool();
protected:
/// Check the work directory.
void checkWorkingDirectory();
/// Open in and out file.
int fileOpen(string novelName);
/// Close in and out files.
void fileClosed();
/// Analysis the temp folder.
void analysisFile();
/// Novel tool action, implement in sub class.
virtual void parseContents() = 0;
fstream _fileInStream; ///< The file input stream.
fstream _fileOutStream; ///< The file out stream.
string _tempDir; ///< The temp folder directory path.
string _resultDir; ///< The result folder directory path.
vector<string> _inputNovel; ///< The input file name.
};
#endif /* SRC_NOVELPROCESSTOOL_H_ */
| Modify void parseContents(0) as pure virtual function. | Modify void parseContents(0) as pure virtual function.
| C | apache-2.0 | NemoChenTW/NovelProcessTools,NemoChenTW/NovelProcessTools,NemoChenTW/NovelProcessTools |
1b32d0316ad790fdd178bca02f1af71c0ce15ef8 | platforms/arm/mxrt1062/fastled_arm_mxrt1062.h | platforms/arm/mxrt1062/fastled_arm_mxrt1062.h | #ifndef __INC_FASTLED_ARM_MXRT1062_H
#define __INC_FASTLED_ARM_MXRT1062_H
#include "fastpin_arm_mxrt1062.h"
#include "fastspi_arm_mxrt1062.h"
#include "clockless_arm_mxrt1062.h"
#include "block_clockless_arm_mxrt1062.h"
#endif
| #ifndef __INC_FASTLED_ARM_MXRT1062_H
#define __INC_FASTLED_ARM_MXRT1062_H
#include "fastpin_arm_mxrt1062.h"
#include "fastspi_arm_mxrt1062.h"
#include "../k20/octows2811_controller.h"
#include "../k20/ws2812serial_controller.h"
#include "../k20/smartmatrix_t3.h"
#include "clockless_arm_mxrt1062.h"
#include "block_clockless_arm_mxrt1062.h"
#endif
| Support WS2812Serial Library on Teensy T4 | Support WS2812Serial Library on Teensy T4
Recently there was reported that the WS2812Serial library (github.com/PaulStoffregen/WS2812Serial) was not ported over to work on the new Teensy T4, so I thought I would take a look.
I added the T4 support, which is now pending in a Pull Request. During that I also found that there were errors in one of the core header files for the T4, which I also fixed, which is now pending in another Pull Request (github.com/PaulStoffregen/Cores)
After that was working, it was pointed out that the FastLED sample in the WS2812Serial librry did not compile. So...
More details in the forum Thread:
https://forum.pjrc.com/threads/58442-Non-Blocking-WS2812-LED-Library-and-Teensy-4-0
| C | mit | FastLED/FastLED,PaulStoffregen/FastLED,PaulStoffregen/FastLED,FastLED/FastLED,FastLED/FastLED,FastLED/FastLED,PaulStoffregen/FastLED |
c539b7d9bb3e40f7ac69d44771f56476c953629d | Pod/Classes/Foundation/runtime/NSObject+ASPropertyAttributes.h | Pod/Classes/Foundation/runtime/NSObject+ASPropertyAttributes.h | //
// NSObject+ASPropertyAttributes.h
// AppScaffold Cocoa Category
//
// Created by Whirlwind on 15/4/3.
// Copyright (c) 2015年 AppScaffold. All rights reserved.
//
#import <Foundation/Foundation.h>
#if __has_include("EXTRuntimeExtensions.h")
// This category need pod 'libextobjc'
#import "EXTRuntimeExtensions.h"
@interface NSObject (PropertyAttributes)
+ (ext_propertyAttributes *)copyPropertyAttributesByName:(NSString *)name;
@end
#endif
| //
// NSObject+ASPropertyAttributes.h
// AppScaffold Cocoa Category
//
// Created by Whirlwind on 15/4/3.
// Copyright (c) 2015年 AppScaffold. All rights reserved.
//
#import <Foundation/Foundation.h>
#if __has_include(<libextobjc/EXTRuntimeExtensions.h>)
// This category need pod 'libextobjc'
#import <libextobjc/EXTRuntimeExtensions.h>
@interface NSObject (PropertyAttributes)
+ (ext_propertyAttributes *)copyPropertyAttributesByName:(NSString *)name;
@end
#endif
| Fix check the libextobjc when it is framework | Fix check the libextobjc when it is framework
| C | mit | AppScaffold/ASCocoaCategory,AppScaffold/ASCocoaCategory,Whirlwind/ASCocoaCategory,Whirlwind/ASCocoaCategory,Whirlwind/ASCocoaCategory,AppScaffold/ASCocoaCategory |
6e96905b97bbb3c154a15e90b3dc3d118db7c96e | src/OI.h | src/OI.h | #ifndef OI_H
#define OI_H
#include "WPILib.h"
#include "RobotMap.h"
#include <math.h>
class OI
{
private:
Joystick joystick;
public:
OI();
inline float GetXplusY(){
float val;
val = FractionOmitted(joystick.GetY() + joystick.GetX());
if(val > 1.2) val = 1.2;
if(val < -1.2) val = -1.2;
return val;
}
inline float GetXminusY(){
float val;
val = FractionOmitted(joystick.GetY() - joystick.GetX());
if(val > 1.2) val = 1.2;
if(val < -1.2) val = -1.2;
return val;
}
inline float GetStickX(){ return FractionOmitted(joystick.GetX()); }
inline float GetStickY(){ return FractionOmitted(joystick.GetY()); }
inline float GetStickTwist(){ return FractionOmitted(joystick.GetTwist()); }
inline float GetStickThrottle(){ return FractionOmitted(joystick.GetThrottle()); }
inline float FractionOmitted(float original){
if(fabsf(original) < 0.01 ){
original = 0;
}
return original;
}
};
#endif
| #ifndef OI_H
#define OI_H
#include "WPILib.h"
#include "RobotMap.h"
#include <math.h>
class OI
{
private:
Joystick joystick;
public:
OI();
inline float GetXplusY(){
float val;
val = FractionOmitted(joystick.GetY() + joystick.GetX());
if(val > 1.2) val = 1.2;
if(val < -1.2) val = -1.2;
return val;
}
inline float GetXminusY(){
float val;
val = FractionOmitted(joystick.GetY() - joystick.GetX());
if(val > 1.2) val = 1.2;
if(val < -1.2) val = -1.2;
return val;
}
inline float GetStickX(){ return FractionOmitted(joystick.GetX()); }
inline float GetStickY(){ return FractionOmitted(joystick.GetY()); }
inline float GetStickTwist(){ return FractionOmitted(joystick.GetTwist()); }
inline float GetStickThrottle(){ return FractionOmitted(joystick.GetThrottle()); }
inline float GetStickRightX(){ return FractionOmitted(joystick.GetRawAxis(5)); }
inline float GetStcikRightY(){ return FractionOmitted(joystick.GetRawAxis(6)); }
inline float FractionOmitted(float original){
if(fabsf(original) < 0.01 ){
original = 0;
}
return original;
}
};
#endif
| Create RightStick X and Y value get Function | Create RightStick X and Y value get Function | C | epl-1.0 | tokyotechnicalsamurai/shougun |
30fa9d8675adbc9f0bb147949a77016f6e9ce11b | src/platform/sdl/sdl-events.h | src/platform/sdl/sdl-events.h | #ifndef SDL_EVENTS_H
#define SDL_EVENTS_H
#include "common.h"
#include "gba-thread.h"
#include <SDL.h>
#define SDL_BINDING_KEY 0x53444C4B
#define SDL_BINDING_BUTTON 0x53444C42
struct GBAVideoSoftwareRenderer;
struct GBASDLEvents {
struct GBAInputMap* bindings;
SDL_Joystick* joystick;
#if SDL_VERSION_ATLEAST(2, 0, 0)
SDL_Window* window;
int fullscreen;
int windowUpdated;
#endif
};
bool GBASDLInitEvents(struct GBASDLEvents*);
void GBASDLDeinitEvents(struct GBASDLEvents*);
void GBASDLHandleEvent(struct GBAThread* context, struct GBASDLEvents* sdlContext, const union SDL_Event* event);
enum GBAKey GBASDLMapButtonToKey(int button);
#endif
| #ifndef SDL_EVENTS_H
#define SDL_EVENTS_H
#include "common.h"
#include "gba-thread.h"
#include <SDL.h>
#define SDL_BINDING_KEY 0x53444C4B
#define SDL_BINDING_BUTTON 0x53444C42
struct GBAVideoSoftwareRenderer;
struct GBASDLEvents {
struct GBAInputMap* bindings;
SDL_Joystick* joystick;
#if SDL_VERSION_ATLEAST(2, 0, 0)
SDL_Window* window;
int fullscreen;
int windowUpdated;
#endif
};
bool GBASDLInitEvents(struct GBASDLEvents*);
void GBASDLDeinitEvents(struct GBASDLEvents*);
void GBASDLHandleEvent(struct GBAThread* context, struct GBASDLEvents* sdlContext, const union SDL_Event* event);
#endif
| Remove prototype for removed function | Remove prototype for removed function
| C | mpl-2.0 | Anty-Lemon/mgba,Anty-Lemon/mgba,sergiobenrocha2/mgba,iracigt/mgba,iracigt/mgba,sergiobenrocha2/mgba,bentley/mgba,jeremyherbert/mgba,jeremyherbert/mgba,libretro/mgba,fr500/mgba,sergiobenrocha2/mgba,iracigt/mgba,MerryMage/mgba,Iniquitatis/mgba,Anty-Lemon/mgba,mgba-emu/mgba,jeremyherbert/mgba,matthewbauer/mgba,mgba-emu/mgba,Touched/mgba,askotx/mgba,bentley/mgba,libretro/mgba,MerryMage/mgba,AdmiralCurtiss/mgba,mgba-emu/mgba,fr500/mgba,nattthebear/mgba,AdmiralCurtiss/mgba,askotx/mgba,Iniquitatis/mgba,Iniquitatis/mgba,cassos/mgba,cassos/mgba,zerofalcon/mgba,zerofalcon/mgba,sergiobenrocha2/mgba,askotx/mgba,matthewbauer/mgba,libretro/mgba,libretro/mgba,fr500/mgba,iracigt/mgba,askotx/mgba,libretro/mgba,zerofalcon/mgba,Touched/mgba,Anty-Lemon/mgba,mgba-emu/mgba,AdmiralCurtiss/mgba,nattthebear/mgba,jeremyherbert/mgba,Iniquitatis/mgba,cassos/mgba,fr500/mgba,sergiobenrocha2/mgba,Touched/mgba,MerryMage/mgba |
53f7a342568c675b686f817f2a11392e486d2e8d | test/CodeGen/builtins-arm64.c | test/CodeGen/builtins-arm64.c | // RUN: %clang_cc1 -triple arm64-apple-ios -O3 -emit-llvm -o - %s | FileCheck %s
void f0(void *a, void *b) {
__clear_cache(a,b);
// CHECK: call {{.*}} @__clear_cache
}
// CHECK: call {{.*}} @llvm.aarch64.rbit.i32(i32 %a)
void rbit(unsigned a) {
__builtin_arm_rbit(a);
}
// CHECK: call {{.*}} @llvm.aarch64.rbit.i64(i64 %a)
void rbit64(unsigned long long a) {
__builtin_arm_rbit64(a);
}
| // RUN: %clang_cc1 -triple arm64-apple-ios -O3 -emit-llvm -o - %s | FileCheck %s
void f0(void *a, void *b) {
__clear_cache(a,b);
// CHECK: call {{.*}} @__clear_cache
}
// CHECK: call {{.*}} @llvm.aarch64.rbit.i32(i32 %a)
unsigned rbit(unsigned a) {
return __builtin_arm_rbit(a);
}
// CHECK: call {{.*}} @llvm.aarch64.rbit.i64(i64 %a)
unsigned long long rbit64(unsigned long long a) {
return __builtin_arm_rbit64(a);
}
| Fix silly think-o in tests. | AArch64: Fix silly think-o in tests.
rdar://9283021
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@211064 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/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,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang |
58b154cf4aca7c4ad12f066496dade85fe58cbec | exec/cnex/util.h | exec/cnex/util.h | #ifndef UTIL_H
#define UTIL_H
#define estr(x) #x
#define ENUM(x) estr(x)
void exec_error(const char *msg, ...);
void fatal_error(const char *msg, ...);
typedef enum { FALSE, TRUE } BOOL;
#endif
| #ifndef UTIL_H
#define UTIL_H
#define estr(x) #x
#define ENUM(x) estr(x)
void exec_error(const char *msg, ...);
#ifdef _MSC_VER
__declspec(noreturn)
#endif
void fatal_error(const char *msg, ...)
#ifdef __GNUC__
__attribute__((noreturn))
#endif
;
typedef enum { FALSE, TRUE } BOOL;
#endif
| Add noreturn attribute to fatal_error | Add noreturn attribute to fatal_error
| C | mit | gitlarryf/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,ghewgill/neon-lang,gitlarryf/neon-lang,gitlarryf/neon-lang,gitlarryf/neon-lang |
ad7c868c0515e2e8f67cb56c610a6341a258299d | Ch4-Linked-Lists/linked-lists.c | Ch4-Linked-Lists/linked-lists.c | /*
* PROBLEM
* Discuss the stack data structure. Implement a stack in C using either a linked list or a dynamic array, and justify your decision.
* Design the interface to your stack to be complete, consistent, and easy to use.
*/
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
typedef struct Element {
struct Element *next;
void *data;
} Element;
bool push (Element **stack, void *data){
Element *elem = malloc(sizeof(Element));
if (!elem) return false;
elem->data = data;
elem->next = *stack;
*stack = elem;
return true;
}
bool pop( Element **stack, void **data ) {
Element *elem;
if (!(elem=*stack)) return false;
*data = elem->data;
*stack = elem->next;
free(elem);
return true;
}
bool createStack( Element **stack ) {
*stack = NULL;
return true;
}
bool deleteStack ( Element **stack ){
Element *next;
while ( *stack ) {
next = (*stack)->next;
free (*stack);
*stack = next;
}
return true;
}
void main() {
}
| #include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
typedef struct Element {
struct Element *next;
void *data;
} Element;
/*
* PROBLEM
* Discuss the stack data structure. Implement a stack in C using either a linked list or a dynamic array, and justify your decision.
* Design the interface to your stack to be complete, consistent, and easy to use.
*
* The solution contains the following push, pop, createStack, and deleteStack functions.
*/
bool push (Element **stack, void *data){
Element *elem = malloc(sizeof(Element));
if (!elem) return false;
elem->data = data;
elem->next = *stack;
*stack = elem;
return true;
}
bool pop( Element **stack, void **data ) {
Element *elem;
if (!(elem=*stack)) return false;
*data = elem->data;
*stack = elem->next;
free(elem);
return true;
}
bool createStack( Element **stack ) {
*stack = NULL;
return true;
}
bool deleteStack ( Element **stack ){
Element *next;
while ( *stack ) {
next = (*stack)->next;
free (*stack);
*stack = next;
}
return true;
}
/*
* PROBLEM
* Find and fix the bugs in the following C function that is supposed to remove the head element from a singly linked list:
* void removeHead (ListElement *head) {
* free(head); // Line 1
* head = head->next; // Line 2
* }
*/
void removeHead (Element **head) {
Element *temp;
if (head && *head) {
temp = (*head)->next;
free (*head);
*head = temp;
}
}
void main() {
}
| Add the problem of 'Bugs in removeHead'. | Add the problem of 'Bugs in removeHead'. | C | unlicense | Conan1985/Programming-Interviews-Exposed,Conan1985/Programming-Interviews-Exposed,Conan1985/Programming-Interviews-Exposed |
acc3cc239e62e1eb084cdc48cac8dd524a446abd | MCGraylog/MCGraylog/MCGraylog.h | MCGraylog/MCGraylog/MCGraylog.h | //
// MCGraylog.h
// MCGraylog
//
// Created by Jordan on 2013-05-06.
// Copyright (c) 2013 Marketcircle. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef enum {
GraylogLogLevelEmergency = 0,
GraylogLogLevelAlert = 1,
GraylogLogLevelCritical = 2,
GraylogLogLevelError = 3,
GraylogLogLevelWarning = 4,
GraylogLogLevelNotice = 5,
GraylogLogLevelInformational = 6,
GraylogLogLevelDebug = 7
} GraylogLogLevel;
/**
* Perform some up front work needed for all future log messages
*
* @return 0 on success, otherwise -1.
*/
int graylog_init(const char* address, const char* port);
void graylog_log(GraylogLogLevel lvl,
const char* facility,
const char* msg,
NSDictionary *data);
| //
// MCGraylog.h
// MCGraylog
//
// Created by Jordan on 2013-05-06.
// Copyright (c) 2013 Marketcircle. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef enum {
GraylogLogLevelEmergency = 0,
GraylogLogLevelAlert = 1,
GraylogLogLevelCritical = 2,
GraylogLogLevelError = 3,
GraylogLogLevelWarning = 4,
GraylogLogLevelNotice = 5,
GraylogLogLevelInformational = 6,
GraylogLogLevelDebug = 7
} GraylogLogLevel;
/**
* Perform some up front work needed for all future log messages
*
* @return 0 on success, otherwise -1.
*/
int graylog_init(const char* address, const char* port);
/**
* Log a message to the Graylog server (or some other compatible service).
*
* @param lvl Log level, the severity of the message
* @param facility Arbitrary string indicating the subsystem the message came
* from (i.e. sync, persistence, etc.)
* @param msg The actual log message
* @param data Any additional information that might be useful that is JSON
* serializable (e.g. numbers, strings, arrays, dictionaries)
*/
void graylog_log(GraylogLogLevel lvl,
const char* facility,
const char* msg,
NSDictionary* data);
| Add some basic documentation for graylog_log | Add some basic documentation for graylog_log | C | bsd-3-clause | Marketcircle/MCGraylog |
bccbfb90b9680854a0656054582ced13683f3abd | VirtIO/osdep.h | VirtIO/osdep.h | //////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2007 Qumranet All Rights Reserved
//
// Module Name:
// osdep.h
//
// Abstract:
// Windows OS dependent definitions of data types
//
// Author:
// Yan Vugenfirer - February 2007.
//
//////////////////////////////////////////////////////////////////////////////////////////
#if defined(IGNORE_VIRTIO_OSDEP_H)
// to make simulation environment easy
#include "external_os_dep.h"
#else
#ifndef __OS_DEP_H
#define __OS_DEP_H
#include <ntddk.h>
#define ktime_t ULONGLONG
#define ktime_get() KeQueryPerformanceCounter(NULL).QuadPart
#define likely(x) x
#define unlikely(x) x
#define ENOSPC 1
#define BUG_ON(a) ASSERT(!(a))
#define WARN_ON(a)
#define BUG() ASSERT(0)
#if !defined(__cplusplus) && !defined(bool)
#define bool int
#define false FALSE
#define true TRUE
#endif
#define inline __forceinline
#ifdef DBG
#define DEBUG
#endif
#define mb() KeMemoryBarrier()
#define rmb() KeMemoryBarrier()
#define wmb() KeMemoryBarrier()
#define SMP_CACHE_BYTES 64
#endif
#endif
| //////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2007 Qumranet All Rights Reserved
//
// Module Name:
// osdep.h
//
// Abstract:
// Windows OS dependent definitions of data types
//
// Author:
// Yan Vugenfirer - February 2007.
//
//////////////////////////////////////////////////////////////////////////////////////////
#if defined(IGNORE_VIRTIO_OSDEP_H)
// to make simulation environment easy
#include "external_os_dep.h"
#else
#ifndef __OS_DEP_H
#define __OS_DEP_H
#include <ntddk.h>
#define ktime_t ULONGLONG
#define ktime_get() KeQueryPerformanceCounter(NULL).QuadPart
#define likely(x) x
#define unlikely(x) x
#define ENOSPC 1
#define BUG_ON(a) ASSERT(!(a))
#define WARN_ON(a)
#define BUG() ASSERT(0)
#if !defined(__cplusplus) && !defined(bool)
// Important note: in MSFT C++ bool length is 1 bytes
// C++ does not define length of bool
// inconsistent definition of 'bool' may create compatibility problems
#define bool u8
#define false FALSE
#define true TRUE
#endif
#define inline __forceinline
#ifdef DBG
#define DEBUG
#endif
#define mb() KeMemoryBarrier()
#define rmb() KeMemoryBarrier()
#define wmb() KeMemoryBarrier()
#define SMP_CACHE_BYTES 64
#endif
#endif
| Fix wrong bool definition in VirtIO library interface | Fix wrong bool definition in VirtIO library interface
BZ#1389445: VirtIO definition of bool as int used by all drivers
that use VirtIO library, except (currently) netkvm which is C++
and uses bool as fundamental C++ type.
Microsoft-specific implementationdefines bool size as 1 byte.
Different definition of bool in library interface creates
compatibility problem.
Example: when calling virtio_device_initialize(...)
bool parameter msix_used passed incorrectly.
Signed-off-by: Yuri Benditovich <[email protected]>
| C | bsd-3-clause | YanVugenfirer/kvm-guest-drivers-windows,daynix/kvm-guest-drivers-windows,vrozenfe/kvm-guest-drivers-windows,gnif/kvm-guest-drivers-windows,vrozenfe/kvm-guest-drivers-windows,YanVugenfirer/kvm-guest-drivers-windows,virtio-win/kvm-guest-drivers-windows,virtio-win/kvm-guest-drivers-windows,daynix/kvm-guest-drivers-windows,YanVugenfirer/virtio-win-arm,ladipro/kvm-guest-drivers-windows,virtio-win/kvm-guest-drivers-windows,daynix/kvm-guest-drivers-windows,virtio-win/kvm-guest-drivers-windows,virtio-win/kvm-guest-drivers-windows,gnif/kvm-guest-drivers-windows,gnif/kvm-guest-drivers-windows,ladipro/kvm-guest-drivers-windows,vrozenfe/kvm-guest-drivers-windows,vrozenfe/kvm-guest-drivers-windows,daynix/kvm-guest-drivers-windows,YanVugenfirer/kvm-guest-drivers-windows,YanVugenfirer/virtio-win-arm,ladipro/kvm-guest-drivers-windows,gnif/kvm-guest-drivers-windows,ladipro/kvm-guest-drivers-windows,daynix/kvm-guest-drivers-windows,YanVugenfirer/virtio-win-arm,YanVugenfirer/kvm-guest-drivers-windows,YanVugenfirer/virtio-win-arm,vrozenfe/kvm-guest-drivers-windows,YanVugenfirer/kvm-guest-drivers-windows |
f84df9f076038ad16e1ee412162c328cd091bc59 | include/clang/Frontend/CodeGenAction.h | include/clang/Frontend/CodeGenAction.h | //===--- CodeGenAction.h - LLVM Code Generation Frontend Action -*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "clang/Frontend/FrontendAction.h"
#include "llvm/ADT/OwningPtr.h"
namespace llvm {
class Module;
}
namespace clang {
class CodeGenAction : public ASTFrontendAction {
private:
unsigned Act;
llvm::OwningPtr<llvm::Module> TheModule;
protected:
CodeGenAction(unsigned _Act);
~CodeGenAction();
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
llvm::StringRef InFile);
virtual void EndSourceFileAction();
public:
/// takeModule - Take the generated LLVM module, for use after the action has
/// been run. The result may be null on failure.
llvm::Module *takeModule();
};
class EmitAssemblyAction : public CodeGenAction {
public:
EmitAssemblyAction();
};
class EmitBCAction : public CodeGenAction {
public:
EmitBCAction();
};
class EmitLLVMAction : public CodeGenAction {
public:
EmitLLVMAction();
};
class EmitLLVMOnlyAction : public CodeGenAction {
public:
EmitLLVMOnlyAction();
};
class EmitObjAction : public CodeGenAction {
public:
EmitObjAction();
};
}
| //===--- CodeGenAction.h - LLVM Code Generation Frontend Action -*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "clang/Frontend/FrontendAction.h"
#include "llvm/ADT/OwningPtr.h"
namespace llvm {
class Module;
}
namespace clang {
class CodeGenAction : public ASTFrontendAction {
private:
unsigned Act;
llvm::OwningPtr<llvm::Module> TheModule;
protected:
CodeGenAction(unsigned _Act);
virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
llvm::StringRef InFile);
virtual void EndSourceFileAction();
public:
~CodeGenAction();
/// takeModule - Take the generated LLVM module, for use after the action has
/// been run. The result may be null on failure.
llvm::Module *takeModule();
};
class EmitAssemblyAction : public CodeGenAction {
public:
EmitAssemblyAction();
};
class EmitBCAction : public CodeGenAction {
public:
EmitBCAction();
};
class EmitLLVMAction : public CodeGenAction {
public:
EmitLLVMAction();
};
class EmitLLVMOnlyAction : public CodeGenAction {
public:
EmitLLVMOnlyAction();
};
class EmitObjAction : public CodeGenAction {
public:
EmitObjAction();
};
}
| Make the destructor public. ddunbar, lemme know if you'd prefer a different fix, just trying to get the build bots happy again. | Make the destructor public. ddunbar, lemme know if you'd prefer a different
fix, just trying to get the build bots happy again.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@97223 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | apple/swift-clang,llvm-mirror/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,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 |
bb3bd956e8c53ccaba3a95940987a1e0133daf00 | libgo/runtime/go-traceback.c | libgo/runtime/go-traceback.c | /* go-traceback.c -- stack backtrace for Go.
Copyright 2012 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file. */
#include "config.h"
#include "runtime.h"
#include "go-string.h"
/* Print a stack trace for the current goroutine. */
void
runtime_traceback ()
{
uintptr pcbuf[100];
int32 c;
c = runtime_callers (1, pcbuf, sizeof pcbuf / sizeof pcbuf[0]);
runtime_printtrace (pcbuf, c);
}
void
runtime_printtrace (uintptr *pcbuf, int32 c)
{
int32 i;
for (i = 0; i < c; ++i)
{
struct __go_string fn;
struct __go_string file;
int line;
if (__go_file_line (pcbuf[i], &fn, &file, &line)
&& runtime_showframe (fn.__data))
{
runtime_printf ("%s\n", fn.__data);
runtime_printf ("\t%s:%d\n", file.__data, line);
}
}
}
| /* go-traceback.c -- stack backtrace for Go.
Copyright 2012 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file. */
#include "config.h"
#include "runtime.h"
#include "go-string.h"
/* Print a stack trace for the current goroutine. */
void
runtime_traceback ()
{
uintptr pcbuf[100];
int32 c;
c = runtime_callers (1, pcbuf, sizeof pcbuf / sizeof pcbuf[0]);
runtime_printtrace (pcbuf, c);
}
void
runtime_printtrace (uintptr *pcbuf, int32 c)
{
int32 i;
for (i = 0; i < c; ++i)
{
struct __go_string fn;
struct __go_string file;
int line;
if (__go_file_line (pcbuf[i], &fn, &file, &line)
&& runtime_showframe (fn.__data))
{
runtime_printf ("%S\n", fn);
runtime_printf ("\t%S:%d\n", file, line);
}
}
}
| Fix printing of names in stack dumps. | runtime: Fix printing of names in stack dumps.
R=iant
CC=gofrontend-dev
https://golang.org/cl/6305062
| C | bsd-3-clause | golang/gofrontend,anlhord/gofrontend,golang/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,anlhord/gofrontend,golang/gofrontend,qskycolor/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,anlhord/gofrontend,qskycolor/gofrontend,qskycolor/gofrontend,golang/gofrontend,qskycolor/gofrontend,anlhord/gofrontend |
fe8b37bf3b859434de2bead4cd4fb00bda48f5c9 | src/condor_includes/condor_common.h | src/condor_includes/condor_common.h | #include "_condor_fix_types.h"
#include "condor_fix_stdio.h"
#include <stdlib.h>
#include "condor_fix_unistd.h"
#include "condor_fix_limits.h"
#include "condor_fix_string.h"
#include <ctype.h>
#include <fcntl.h>
#include <errno.h>
#if !defined(SUNOS41)
#include <signal.h>
#endif
| #if defined(WIN32)
#define NOGDI
#define NOUSER
#define NOSOUND
#include <winsock2.h>
#include <windows.h>
#include "_condor_fix_nt.h"
#include <stdlib.h>
#else
#include "_condor_fix_types.h"
#include "condor_fix_stdio.h"
#include <stdlib.h>
#include "condor_fix_unistd.h"
#include "condor_fix_limits.h"
#include "condor_fix_string.h"
#include <ctype.h>
#include <fcntl.h>
#include <errno.h>
#include "condor_fix_signal.h"
#if defined(Solaris)
# define BSD_COMP
#endif
#include <sys/ioctl.h>
#if defined(Solaris)
# undef BSD_COMP
#endif
#endif // defined(WIN32)
| Use condor_fix_signal.h, not <signal.h>, and include <sys/ioctl.h> properly. Also, NT specific changes committed to main trunk. | Use condor_fix_signal.h, not <signal.h>, and include <sys/ioctl.h>
properly. Also, NT specific changes committed to main trunk.
| C | apache-2.0 | djw8605/condor,bbockelm/condor-network-accounting,neurodebian/htcondor,htcondor/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,neurodebian/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,djw8605/condor,htcondor/htcondor,djw8605/condor,zhangzhehust/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,neurodebian/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,clalancette/condor-dcloud,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,htcondor/htcondor,mambelli/osg-bosco-marco,neurodebian/htcondor,neurodebian/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,djw8605/htcondor,djw8605/condor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,htcondor/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,clalancette/condor-dcloud,zhangzhehust/htcondor,htcondor/htcondor,zhangzhehust/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,djw8605/condor,htcondor/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,htcondor/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,zhangzhehust/htcondor,clalancette/condor-dcloud,htcondor/htcondor,djw8605/htcondor,djw8605/condor,neurodebian/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,djw8605/condor,djw8605/condor,djw8605/htcondor,djw8605/htcondor |
74feaa2154590685a8702b9bab6aa2a4c2e58382 | src/condor_includes/condor_common.h | src/condor_includes/condor_common.h | #include "condor_fix_stdio.h"
#include <stdlib.h>
#include "condor_fix_unistd.h"
#include <limits.h>
#include <string.h>
#include <ctype.h>
#include <fcntl.h>
#include "_condor_fix_types.h"
#include <errno.h>
| #include "condor_fix_stdio.h"
#include <stdlib.h>
#include "condor_fix_unistd.h"
#include <limits.h>
#include <string.h>
#include <ctype.h>
#include "_condor_fix_types.h"
#include <fcntl.h>
#include <errno.h>
| Add <fcntl.h> to list of commonly included files. | Add <fcntl.h> to list of commonly included files.
| C | apache-2.0 | htcondor/htcondor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,clalancette/condor-dcloud,clalancette/condor-dcloud,clalancette/condor-dcloud,djw8605/condor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,htcondor/htcondor,djw8605/condor,neurodebian/htcondor,neurodebian/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,zhangzhehust/htcondor,djw8605/condor,htcondor/htcondor,zhangzhehust/htcondor,htcondor/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,clalancette/condor-dcloud,htcondor/htcondor,djw8605/condor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,zhangzhehust/htcondor,neurodebian/htcondor,bbockelm/condor-network-accounting,zhangzhehust/htcondor,htcondor/htcondor,djw8605/htcondor,djw8605/condor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,zhangzhehust/htcondor,djw8605/condor,htcondor/htcondor,djw8605/htcondor,djw8605/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,djw8605/htcondor,djw8605/condor,neurodebian/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,djw8605/htcondor,zhangzhehust/htcondor,djw8605/condor,bbockelm/condor-network-accounting,neurodebian/htcondor,djw8605/htcondor,neurodebian/htcondor |
e259496d6faec673557dc4b9b5bc2e86487e27a4 | tests/regression/31-ikind-aware-ints/04-ptrdiff.c | tests/regression/31-ikind-aware-ints/04-ptrdiff.c | // PARAM: --enable ana.int.interval --enable exp.partition-arrays.enabled --set ana.activated "['base', 'mallocWrapper', 'expRelation', 'var_eq']"
int *tmp;
int main ()
{
int pathbuf[2];
int *bound = pathbuf + sizeof(pathbuf)/sizeof(*pathbuf) - 1;
int *p = pathbuf;
while (p <= bound) {
*p = 1;
p++;
}
return 0;
}
| // PARAM: --enable ana.int.interval --enable exp.partition-arrays.enabled --set ana.activated "['base', 'mallocWrapper', 'escape', 'expRelation', 'var_eq']"
int *tmp;
int main ()
{
int pathbuf[2];
int *bound = pathbuf + sizeof(pathbuf)/sizeof(*pathbuf) - 1;
int *p = pathbuf;
while (p <= bound) {
*p = 1;
p++;
}
return 0;
}
| Enable escape in 31/04 for global-history to pass | Enable escape in 31/04 for global-history to pass
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
94ed26dc4ff9046f31edcf99d428a95c5df28b05 | tests/regression/53-races-mhp/03-not-created_rc.c | tests/regression/53-races-mhp/03-not-created_rc.c | #include <pthread.h>
#include <stdio.h>
int myglobal;
pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
return NULL;
}
void *t_fun2(void *arg) {
pthread_mutex_lock(&mutex1);
myglobal=myglobal+1; // RACE!
pthread_mutex_unlock(&mutex1);
return NULL;
}
int main(void) {
pthread_t id, id2;
pthread_create(&id, NULL, t_fun, NULL); // enter multithreaded
myglobal = 5; // NORACE
pthread_create(&id2, NULL, t_fun2, NULL);
pthread_mutex_lock(&mutex2);
myglobal=myglobal+1; // RACE!
pthread_mutex_unlock(&mutex2);
return 0;
}
| Add race test where all accesses don't race | Add race test where all accesses don't race
| C | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer |
|
c4dc456cdfc6fe4a67f41d2aa02f30bde9968d4c | set/test.c | set/test.c |
int asserter_is_false(int);
int set_empty(void);
int set_size(int);
int set_add(int, int);
int main(void)
{
// set_empty tests
if (asserter_is_false(set_empty() == 0)) return __LINE__;
// set_add tests
if (asserter_is_false(set_add(set_empty(), 0) != set_empty())) return __LINE__;
if (asserter_is_false(set_add(set_empty(), 1) != set_add(set_empty(), 2))) return __LINE__;
if (asserter_is_false(set_add(set_add(set_empty(), 1), 2) != set_add(set_empty(), 2))) return __LINE__;
if (asserter_is_false(set_add(set_add(set_empty(), 1), 1) == set_add(set_empty(), 1))) return __LINE__;
// set_size tests
if (asserter_is_false(set_size(set_empty()) == 0)) return __LINE__;
if (asserter_is_false(set_size(set_add(set_empty(), 1)) == 1)) return __LINE__;
if (asserter_is_false(set_size(set_add(set_add(set_empty(), 1), 2)) == 2)) return __LINE__;
return 0;
}
|
int asserter_is_false(int);
int set_empty(void);
int set_size(int);
int set_add(int, int);
int main(void)
{
// set_empty tests
if (asserter_is_false(set_empty() == 0)) return __LINE__;
// set_add tests
if (asserter_is_false(set_add(set_empty(), 0) != set_empty())) return __LINE__;
if (asserter_is_false(set_add(set_empty(), 1) != set_add(set_empty(), 2))) return __LINE__;
if (asserter_is_false(set_add(set_add(set_empty(), 1), 2) != set_add(set_empty(), 2))) return __LINE__;
if (asserter_is_false(set_add(set_add(set_empty(), 1), 1) == set_add(set_empty(), 1))) return __LINE__;
// TODO: add bigger than sizeof(int) * 8 elements
// set_size tests
if (asserter_is_false(set_size(set_empty()) == 0)) return __LINE__;
if (asserter_is_false(set_size(set_add(set_empty(), 1)) == 1)) return __LINE__;
if (asserter_is_false(set_size(set_add(set_add(set_empty(), 1), 2)) == 2)) return __LINE__;
// TODO: add more than sizeof(int) * 8 elements
return 0;
}
| Add TODOs for future work | [SET] REFACTOR: Add TODOs for future work
| C | mit | w3ln4/open |
c9d3145843ebb8a4fbd78484771dc0aa7fee4caf | include/cr-service.h | include/cr-service.h | #ifndef __CR_SERVICE_H__
#define __CR_SERVICE_H__
#include "protobuf/rpc.pb-c.h"
#define CR_DEFAULT_SERVICE_ADDRESS "/tmp/criu_service.socket"
#define MAX_MSG_SIZE 1024
int cr_service(bool deamon_mode);
int send_criu_dump_resp(int socket_fd, bool success, bool restored);
extern struct _cr_service_client *cr_service_client;
extern unsigned int service_sk_ino;
#endif
| #ifndef __CR_SERVICE_H__
#define __CR_SERVICE_H__
#include "protobuf/rpc.pb-c.h"
#define CR_DEFAULT_SERVICE_ADDRESS "/var/run/criu_service.socket"
#define MAX_MSG_SIZE 1024
int cr_service(bool deamon_mode);
int send_criu_dump_resp(int socket_fd, bool success, bool restored);
extern struct _cr_service_client *cr_service_client;
extern unsigned int service_sk_ino;
#endif
| Change default socket path to /var/run/ | service: Change default socket path to /var/run/
This is where such stuff is typically placed.
Signed-off-by: Pavel Emelyanov <[email protected]>
| C | lgpl-2.1 | fbocharov/criu,gonkulator/criu,ldu4/criu,KKoukiou/criu-remote,biddyweb/criu,efiop/criu,eabatalov/criu,efiop/criu,AuthenticEshkinKot/criu,KKoukiou/criu-remote,tych0/criu,gonkulator/criu,ldu4/criu,AuthenticEshkinKot/criu,LK4D4/criu,eabatalov/criu,gonkulator/criu,kawamuray/criu,sdgdsffdsfff/criu,svloyso/criu,LK4D4/criu,wtf42/criu,sdgdsffdsfff/criu,ldu4/criu,tych0/criu,LK4D4/criu,gablg1/criu,gonkulator/criu,kawamuray/criu,rentzsch/criu,eabatalov/criu,marcosnils/criu,svloyso/criu,KKoukiou/criu-remote,KKoukiou/criu-remote,marcosnils/criu,kawamuray/criu,efiop/criu,marcosnils/criu,gablg1/criu,AuthenticEshkinKot/criu,tych0/criu,svloyso/criu,kawamuray/criu,wtf42/criu,LK4D4/criu,sdgdsffdsfff/criu,gablg1/criu,wtf42/criu,wtf42/criu,svloyso/criu,rentzsch/criu,efiop/criu,ldu4/criu,fbocharov/criu,rentzsch/criu,sdgdsffdsfff/criu,kawamuray/criu,ldu4/criu,gonkulator/criu,rentzsch/criu,marcosnils/criu,rentzsch/criu,AuthenticEshkinKot/criu,KKoukiou/criu-remote,wtf42/criu,fbocharov/criu,gonkulator/criu,AuthenticEshkinKot/criu,biddyweb/criu,svloyso/criu,tych0/criu,tych0/criu,sdgdsffdsfff/criu,fbocharov/criu,KKoukiou/criu-remote,rentzsch/criu,LK4D4/criu,svloyso/criu,sdgdsffdsfff/criu,fbocharov/criu,ldu4/criu,efiop/criu,efiop/criu,biddyweb/criu,LK4D4/criu,eabatalov/criu,wtf42/criu,tych0/criu,kawamuray/criu,biddyweb/criu,biddyweb/criu,AuthenticEshkinKot/criu,eabatalov/criu,gablg1/criu,marcosnils/criu,fbocharov/criu,eabatalov/criu,marcosnils/criu,biddyweb/criu,gablg1/criu,gablg1/criu |
ee6d21258db24ac2640a410bc27ea1b552b36ca1 | stmt.c | stmt.c |
#include <stddef.h>
#include <stdint.h>
#include "cc1.h"
Symbol *curfun;
extern Node *convert(Node *np, Type *tp1, char iscast);
static void
Return(void)
{
Node *np;
Type *tp = curfun->type->type;
expect(RETURN);
np = expr();
if (np->type != tp) {
if ((np = convert(np, tp, 0)) == NULL)
error("incorrect type in return");
}
emitret(tp);
emitexp(np);
}
void
compound(void)
{
expect('{');
while (!accept('}')) {
switch (yytoken) {
case TYPE: case SCLASS: case TQUALIFIER:
decl();
break;
case RETURN:
Return();
break;
default:
emitexp(expr());
}
expect(';');
}
}
|
#include <stddef.h>
#include <stdint.h>
#include "cc1.h"
Symbol *curfun;
extern Node *convert(Node *np, Type *tp1, char iscast);
static void
Return(void)
{
Node *np;
Type *tp = curfun->type->type;
expect(RETURN);
np = expr();
if (np->type != tp) {
if (tp == voidtype)
warn(1, "function returning void returns a value");
else if ((np = convert(np, tp, 0)) == NULL)
error("incorrect type in return");
}
emitret(tp);
emitexp(np);
}
void
compound(void)
{
expect('{');
while (!accept('}')) {
switch (yytoken) {
case TYPE: case SCLASS: case TQUALIFIER:
decl();
break;
case RETURN:
Return();
break;
default:
emitexp(expr());
}
expect(';');
}
}
| Check that void function can return a value | Check that void function can return a value
| C | isc | k0gaMSX/scc,k0gaMSX/kcc,k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/kcc,8l/scc,8l/scc,8l/scc |
54925adacd0d75de68b955d6197b0b02da97f161 | test/CodeGen/c-unicode.c | test/CodeGen/c-unicode.c | // RUN: %clang -S %s -o - | FileCheck %s -check-prefix=ALLOWED
// RUN: not %clang -std=c89 -S %s -o - 2>&1 | FileCheck %s -check-prefix=DENIED
int \uaccess = 0;
// ALLOWED: "곎ss":
// ALLOWED-NOT: "\uaccess":
// DENIED: warning: universal character names are only valid in C99 or C++; treating as '\' followed by identifier [-Wunicode]
// DENIED: error: expected identifier or '('
| // RUN: %clang --target=x86_64--linux-gnu -S %s -o - | FileCheck %s -check-prefix=ALLOWED
// RUN: not %clang --target=x86_64--linux-gnu -std=c89 -S %s -o - 2>&1 | FileCheck %s -check-prefix=DENIED
int \uaccess = 0;
// ALLOWED: "곎ss":
// ALLOWED-NOT: "\uaccess":
// DENIED: warning: universal character names are only valid in C99 or C++; treating as '\' followed by identifier [-Wunicode]
// DENIED: error: expected identifier or '('
| Fix testcase when building on darwin | Fix testcase when building on darwin
Explicitely specify a target to avoid "_" prefixes on the names.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@253741 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,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,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.