Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Revert "Indicate the location of sqlite failures." | #ifndef _PKG_ERROR_H
#define _PKG_ERROR_H
#ifdef DEBUG
# define pkg_error_set(code, fmt, ...) \
_pkg_error_set(code, fmt " [at %s:%d]", ##__VA_ARGS__, __FILE__, __LINE__)
#else
# define pkg_error_set _pkg_error_set
#endif
#define ERROR_BAD_ARG(name) \
pkg_error_set(EPKG_FATAL, "Bad argument `%s` in %s", name, __FU... | #ifndef _PKG_ERROR_H
#define _PKG_ERROR_H
#ifdef DEBUG
# define pkg_error_set(code, fmt, ...) \
_pkg_error_set(code, fmt " [at %s:%d]", ##__VA_ARGS__, __FILE__, __LINE__)
#else
# define pkg_error_set _pkg_error_set
#endif
#define ERROR_BAD_ARG(name) \
pkg_error_set(EPKG_FATAL, "Bad argument `%s` in %s", name, __FU... |
Add a test for big-endian NEON on ARM64. | // RUN: %clang_cc1 -triple arm64-apple-darwin -target-feature +neon -fsyntax-only -ffreestanding -verify %s
#include <arm_neon.h>
// rdar://13527900
void vcopy_reject(float32x4_t vOut0, float32x4_t vAlpha, int t) {
vcopyq_laneq_f32(vOut0, 1, vAlpha, t); // expected-error {{argument to '__builtin_neon_vgetq_lane_f32... | // RUN: %clang_cc1 -triple arm64-apple-darwin -target-feature +neon -fsyntax-only -ffreestanding -verify %s
// RUN: %clang_cc1 -triple arm64_be-none-linux-gnu -target-feature +neon -fsyntax-only -ffreestanding -verify %s
#include <arm_neon.h>
// rdar://13527900
void vcopy_reject(float32x4_t vOut0, float32x4_t vAlpha,... |
Document the usb protocol (ish) | #ifndef USB_COMMANDS_H
#define USB_COMMANDS_H
#define CMD_ACK 0xAF
#define CMD_RESP 0xBF
#define CMD_BL_ON 0x10
#define CMD_BL_OFF 0x11
#define CMD_BL_LEVEL 0x12
#define CMD_BL_UP 0x13
#define CMD_BL_DOWN 0x14
#define CMD_BL_GET_STATE 0x1F
#define CMD_RGB_SET 0x20
#... | /* USB commands use the first byte as the 'type' variable.
* Subsequent bytes are generally the 'arguments'.
* So host->device usb packets usually look like:
* [command, arg1, arg2, 0, 0, ... , 0, 0]
* to which the device will respond with
* [CMD_ACK, command, 0, 0, 0 ..., 0, 0]
*
* The exception to this, are th... |
Test class to check for ambiguities in the dictionary source code in case of non virtual diamonds | #ifndef DICT2_CLASSN_H
#define DICT2_CLASSN_H
#include "ClassI.h"
#include "ClassL.h"
class ClassN: /* public ClassI, */ public ClassL {
public:
ClassN() : fN('n') {}
virtual ~ClassN() {}
int n() { return fN; }
void setN(int v) { fN = v; }
private:
int fN;
};
#endif // DICT2_CLASSN_H
| |
Use Intel byte order for floating point | #define CODE_EXPANDER
#include <system.h>
#include "back.h"
#include "mach.h"
#ifdef DEBUG
arg_error( s, arg)
char *s;
int arg;
{
fprint( STDERR, "arg_error %s %d\n", s, arg);
}
#endif
int push_waiting = FALSE;
int fit_byte( val)
int val;
{
return( val >= -128 && val <= 127);
}
#include <con_float>
| #define CODE_EXPANDER
#include <system.h>
#include "back.h"
#include "mach.h"
#ifdef DEBUG
arg_error( s, arg)
char *s;
int arg;
{
fprint( STDERR, "arg_error %s %d\n", s, arg);
}
#endif
int push_waiting = FALSE;
int fit_byte( val)
int val;
{
return( val >= -128 && val <= 127);
}
#define IEEEFLOAT
#define FL_MSL_AT... |
Fix windows build issue for node v0.12 | #ifndef SECURITY_BUFFER_DESCRIPTOR_H
#define SECURITY_BUFFER_DESCRIPTOR_H
#include <node.h>
#include <node_object_wrap.h>
#include <v8.h>
#include <windows.h>
#include <sspi.h>
#include "nan.h"
using namespace v8;
using namespace node;
class SecurityBufferDescriptor : public ObjectWrap {
public:
Local<A... | #ifndef SECURITY_BUFFER_DESCRIPTOR_H
#define SECURITY_BUFFER_DESCRIPTOR_H
#include <node.h>
#include <node_object_wrap.h>
#include <v8.h>
#include <WinSock2.h>
#include <windows.h>
#include <sspi.h>
#include "nan.h"
using namespace v8;
using namespace node;
class SecurityBufferDescriptor : public ObjectWrap {
p... |
Support access to individual Hurd consoles. (st) | /*
* BRLTTY - A background process providing access to the console screen (when in
* text mode) for a blind person using a refreshable braille display.
*
* Copyright (C) 1995-2005 by The BRLTTY Team. All rights reserved.
*
* BRLTTY comes with ABSOLUTELY NO WARRANTY.
*
* This is free software, placed un... | /*
* BRLTTY - A background process providing access to the console screen (when in
* text mode) for a blind person using a refreshable braille display.
*
* Copyright (C) 1995-2005 by The BRLTTY Team. All rights reserved.
*
* BRLTTY comes with ABSOLUTELY NO WARRANTY.
*
* This is free software, placed un... |
Initialize some vars so we don't register for a timer when there's not a call oustanding | #ifndef __MORDOR_TIMEOUT_STREAM__
#define __MORDOR_TIMEOUT_STREAM__
// Copyright (c) 2010 - Mozy, Inc.
#include "filter.h"
#include "scheduler.h"
namespace Mordor {
class TimerManager;
class Timer;
class TimeoutStream : public FilterStream
{
public:
typedef boost::shared_ptr<TimeoutStream> ptr;
public:
Tim... | #ifndef __MORDOR_TIMEOUT_STREAM__
#define __MORDOR_TIMEOUT_STREAM__
// Copyright (c) 2010 - Mozy, Inc.
#include "filter.h"
#include "scheduler.h"
namespace Mordor {
class TimerManager;
class Timer;
class TimeoutStream : public FilterStream
{
public:
typedef boost::shared_ptr<TimeoutStream> ptr;
public:
Tim... |
Make sure that we allocate something at our pointer and assign our init’d pool to the pointers value. | #include <connection_pool.h>
static void deallocate(ConnectionPool_T *pool)
{
ConnectionPool_stop(*pool);
ConnectionPool_free(pool);
}
/*
* Wrap libzdb's connection pool in a ruby object
*/
static VALUE allocate(VALUE klass)
{
ConnectionPool_T *pool;
return Data_Wrap_Struct(klass, NULL, deallocate, pool);
}... | #include <connection_pool.h>
static void deallocate(ConnectionPool_T *pool)
{
ConnectionPool_stop(*pool);
ConnectionPool_free(pool);
}
static VALUE allocate(VALUE klass)
{
ConnectionPool_T *pool = malloc(sizeof(ConnectionPool_T));
return Data_Wrap_Struct(klass, NULL, deallocate, pool);
}
static VALUE initial... |
Add method to get const article collection in walker | //! \file Walker.h
#ifndef _WALKER_H
#define _WALKER_H
#include "ArticleCollection.h"
//! Base class for article analyzers
class Walker
{
protected:
//! article collection, used as cache, for walked articles
ArticleCollection articleSet;
};
#endif // _WALKER_H
| //! \file Walker.h
#ifndef _WALKER_H
#define _WALKER_H
#include "ArticleCollection.h"
//! Base class for article analyzers
class Walker
{
public:
const ArticleCollection& getCollection() const
{
return articleSet;
}
protected:
//! article collection, used as cache, for walked articles
Ar... |
Work around ppc64 compiler bug | /* Never include this file directly. Include <linux/compiler.h> instead. */
/*
* Common definitions for all gcc versions go here.
*/
/* Optimization barrier */
/* The "volatile" is due to gcc bugs */
#define barrier() __asm__ __volatile__("": : :"memory")
/* This macro obfuscates arithmetic on a variable addres... | /* Never include this file directly. Include <linux/compiler.h> instead. */
/*
* Common definitions for all gcc versions go here.
*/
/* Optimization barrier */
/* The "volatile" is due to gcc bugs */
#define barrier() __asm__ __volatile__("": : :"memory")
/* This macro obfuscates arithmetic on a variable addres... |
Add (deactivated) refinement test for interval/congruence domain | // PARAM: --disable ana.int.def_exc --enable ana.int.interval --enable ana.int.congruence
#include <assert.h>
int main(){
int r = -103;
for (int i = 0; i < 40; i++) {
r = r + 5;
}
// At this point r in the congr. dom should be 2 + 5Z
int k = r;
if (k >= 3) {
// After refinement ... | |
Add connection and response to cursors. | /**
* @author Adam Grandquist
*/
#include "ReQL-ast.h"
#ifndef _REQL_H
#define _REQL_H
struct _ReQL_Conn_s {
int socket;
int error;
char *buf;
unsigned int max_token;
struct _ReQL_Cur_s **cursor;
};
typedef struct _ReQL_Conn_s _ReQL_Conn_t;
struct _ReQL_Cur_s {
};
typedef struct _ReQL_Cur_s _ReQL_Cur_t;... | /**
* @author Adam Grandquist
*/
#include "ReQL-ast.h"
#ifndef _REQL_H
#define _REQL_H
struct _ReQL_Conn_s {
int socket;
int error;
char *buf;
unsigned int max_token;
struct _ReQL_Cur_s **cursor;
};
typedef struct _ReQL_Conn_s _ReQL_Conn_t;
struct _ReQL_Cur_s {
_ReQL_Conn_t *conn;
unsigned int idx;
... |
Fix compilation fo the test runner on Windows | #include <string>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/fcntl.h>
using namespace std;
inline string copyFile(const string &filename, const string &ext)
{
string newname = string(tempnam(NULL, NULL)) + ext;
string oldname = string("data/") + filename + ext;
char buffer[4096];
... | #ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#include <fcntl.h>
#include <sys/fcntl.h>
#endif
#include <stdio.h>
#include <string>
using namespace std;
inline string copyFile(const string &filename, const string &ext)
{
string newname = string(tempnam(NULL, NULL)) + ext;
string oldname = string("d... |
Update GPUImageFillModeType enum to use NS_ENUM | #import <UIKit/UIKit.h>
#import "GPUImageContext.h"
typedef enum {
kGPUImageFillModeStretch, // Stretch to fill the full view, which may distort the image outside of its normal aspect ratio
kGPUImageFillModePreserveAspectRatio, // Maintains the aspect ratio of the source image, ... | #import <UIKit/UIKit.h>
#import "GPUImageContext.h"
typedef NS_ENUM(NSUInteger, GPUImageFillModeType) {
kGPUImageFillModeStretch, // Stretch to fill the full view, which may distort the image outside of its normal aspect ratio
kGPUImageFillModePreserveAspectRatio, // Maintains t... |
Add some hashing utility functions | #ifndef HASH_H
#define HASH_H
#include <unordered_map>
#include <unordered_set>
template <typename K, typename V>
using HashMap = std::unordered_map<K, V>;
template <typename T>
using HashSet = std::unordered_set<T>;
#endif // HASH_H
| #ifndef HASH_H
#define HASH_H
#include <cstdint>
#include <unordered_map>
#include <unordered_set>
template <typename K, typename V>
using HashMap = std::unordered_map<K, V>;
template <typename T>
using HashSet = std::unordered_set<T>;
// These come from boost
// Copyright 2005-2014 Daniel James.
// Distribu... |
Add `heap_len` and `heap_cap` to example | // cc heap_example.c heap.c
#include <assert.h>
#include <stdio.h>
#include "bool.h"
#include "heap.h"
/* heap data comparator: return true if a < b */
bool
cmp(void *a, void *b)
{
return *(int *)a < *(int *)b;
}
int main(int argc, const char *argv[])
{
/* allocate empty heap with comparator */
struct he... | // cc heap_example.c heap.c
#include <assert.h>
#include <stdio.h>
#include "bool.h"
#include "heap.h"
/* heap data comparator: return true if a < b */
bool
cmp(void *a, void *b)
{
return *(int *)a < *(int *)b;
}
int main(int argc, const char *argv[])
{
/* allocate empty heap with comparator */
struct he... |
Fix license in comment header. | /**
* config.h - Convenience header file for all mlt++ objects
* Copyright (C) 2004-2005 Charles Yates
* Author: Charles Yates <charles.yates@pandora.be>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Fr... | /**
* config.h - Convenience header file for all mlt++ objects
* Copyright (C) 2004-2005 Charles Yates
* Author: Charles Yates <charles.yates@pandora.be>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Fr... |
Fix potential data corruption bug |
#include <stdlib.h>
#include "logging.h"
char out[512];
debug_mask_t debug_mask = 0;
static int debug_init = 0;
char *print_hex(uint8_t *buf, int count)
{
memset(out, 0, count);
int zz;
for(zz = 0; zz < count; zz++) {
sprintf(out + (zz * 2), "%02X", buf[zz]);
}
return out;
}
void deb... |
#include <stdlib.h>
#include "logging.h"
char out[512];
debug_mask_t debug_mask = 0;
static int debug_init = 0;
char *print_hex(uint8_t *buf, int count)
{
memset(out, 0, sizeof(out));
int zz;
for(zz = 0; zz < count; zz++) {
sprintf(out + (zz * 2), "%02X", buf[zz]);
}
return out;
}
vo... |
Update the test to listen for brightness changed. | #include <dalston/dalston-brightness-manager.h>
static void
_manager_num_levels_changed_cb (DalstonBrightnessManager *manager,
gint num_levels)
{
g_debug (G_STRLOC ": Num levels changed: %d",
num_levels);
}
int
main (int argc,
char **argv)
{
... | #include <dalston/dalston-brightness-manager.h>
static void
_manager_num_levels_changed_cb (DalstonBrightnessManager *manager,
gint num_levels)
{
g_debug (G_STRLOC ": Num levels changed: %d",
num_levels);
}
static void
_brightness_changed_cb (DalstonBr... |
Test for lvalue-argument function inlinling | // RUN: %ocheck 3 %s
__attribute((always_inline))
inline f(int x)
{
int i = x;
&x;
i++;
return i;
}
main()
{
int added = 5;
added = f(2);
return added;
}
| |
Test for queue using array | #include <check.h>
#include "../src/queue_using_array/queue.h"
queue q;
void setup() {
init( &q );
}
void teardown() {
}
START_TEST( test_normal_ops )
{
enqueue( &q, 10 );
enqueue( &q, 12 );
ck_assert_int_eq( dequeue( &q ), 10 );
ck_assert_int_eq( dequeue( &q ), 12 );
}
END_TEST
START_TEST( te... | |
Add normal information to terrain. | // =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of th... | // =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of th... |
Support nullable Item sourceView in Swift. | //
// KSPhotoItem.h
// KSPhotoBrowser
//
// Created by Kyle Sun on 12/25/16.
// Copyright © 2016 Kyle Sun. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface KSPhotoItem : NSObject
@property (nonatomic, strong, readonly) UIView *sourceView;
@property (nonatomic, strong, readonly)... | //
// KSPhotoItem.h
// KSPhotoBrowser
//
// Created by Kyle Sun on 12/25/16.
// Copyright © 2016 Kyle Sun. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface KSPhotoItem : NSObject
@property (nonatomic, strong, readonly, nullable) UIView *sourceView;
@property (nonatomic, strong, readonly, nullable) UIIm... |
Update for some -current quirks, and some other things taken from the *bsd bind-8 ports. (our setpwent() was changed to return void, but our setgrent() returns int still!) | #define CAN_RECONNECT
#define USE_POSIX
#define POSIX_SIGNALS
#define USE_UTIME
#define USE_WAITPID
#define HAVE_GETRUSAGE
#define HAVE_FCHMOD
#define NEED_PSELECT
#define HAVE_SA_LEN
#define USE_LOG_CONS
#define HAVE_CHROOT
#define CAN_CHANGE_ID
#define _TIMEZONE timezone
#define PORT_NONBLOCK O_NONBLOCK
#define POR... | #define CAN_RECONNECT
#define USE_POSIX
#define POSIX_SIGNALS
#define USE_UTIME
#define USE_WAITPID
#define HAVE_GETRUSAGE
#define HAVE_FCHMOD
#define NEED_PSELECT
#define HAVE_SA_LEN
#define SETPWENT_VOID
#define RLIMIT_TYPE rlim_t
#define RLIMIT_LONGLONG
#define RLIMIT_FILE_INFINITY
#define HAVE_CHROOT
#define CAN_CH... |
Define interface for data reader and writer objects | #ifndef READ_AND_WRITE_DATA_H
#define READ_AND_WRITE_DATA_H
#include <objects.h>
using namespace std;
class FileReader {
protected:
string inputFile;
public:
FileReader(const string &inputFile) : inputFile(inputFile) {}
virtual bool hasNextLine() = 0;
virtual void readNextLine(DataInstance &instance) = 0... | |
Set empty texture default to transparent | // Copyright 2016 Zheng Xian Qiu
//
#pragma once
#include "Seeker.h"
#ifndef _TEXTURE_H
#define _TEXTURE_H
using std::string;
namespace Seeker {
class Texture : public IResource {
public:
Texture(string path);
Texture(int width, int height, bool alpha = false);
~Texture();
int Width ... | // Copyright 2016 Zheng Xian Qiu
//
#pragma once
#include "Seeker.h"
#ifndef _TEXTURE_H
#define _TEXTURE_H
using std::string;
namespace Seeker {
class Texture : public IResource {
public:
Texture(string path);
Texture(int width, int height, bool alpha = true);
~Texture();
int Width =... |
Remove the dll export flag | #include "sqldatabasestorage.h"
CWF_BEGIN_NAMESPACE
namespace DbStorage {
CPPWEBFRAMEWORKSHARED_EXPORT static CWF::SqlDatabaseStorage _storage;
CPPWEBFRAMEWORKSHARED_EXPORT static QString _secret;
}
CWF_END_NAMESPACE
| #include "sqldatabasestorage.h"
CWF_BEGIN_NAMESPACE
namespace DbStorage {
static CWF::SqlDatabaseStorage _storage;
static QString _secret;
}
CWF_END_NAMESPACE
|
Check for C++14 and Lua version properly | /* Luwra
* Minimal-overhead Lua wrapper for C++
*
* Copyright (C) 2015, Ole Krüger <ole@vprsm.de>
*/
#ifndef LUWRA_COMMON_H_
#define LUWRA_COMMON_H_
#include <lua.hpp>
// Check for proper Lua version
#if defined(LUA_VERSION_NUM)
#if LUA_VERSION_NUM < 503 || LUA_VERSION >= 600
#warning "Luwra has not been test... | /* Luwra
* Minimal-overhead Lua wrapper for C++
*
* Copyright (C) 2015, Ole Krüger <ole@vprsm.de>
*/
#ifndef LUWRA_COMMON_H_
#define LUWRA_COMMON_H_
// Check C++ version
#if !defined(__cplusplus) || __cplusplus < 201402L
#error "You need a C++14 compliant compiler"
#endif
#include <lua.hpp>
// Check for proper... |
Check for gtk version below 2.21.1 for comptability with gseal changes | #ifndef __GTK_COMPAT_H__
#define __GTK_COMPAT_H__
#include <gtk/gtk.h>
/* Provide a compatibility layer for accessor functions introduced
* in GTK+ 2.22 which we need to build with sealed GDK.
* That way it is still possible to build with GTK+ 2.20.
*/
#if !GTK_CHECK_VERSION(2,21,2)
#define gdk_drag_context_get_... | #ifndef __GTK_COMPAT_H__
#define __GTK_COMPAT_H__
#include <gtk/gtk.h>
/* Provide a compatibility layer for accessor functions introduced
* in GTK+ 2.21.1 which we need to build with sealed GDK.
* That way it is still possible to build with GTK+ 2.20.
*/
#if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION < 21) \
|... |
Update the version a tick so that we can tell who has the recently committed critical fixes. | // KMail Version Information
//
#ifndef kmversion_h
#define kmversion_h
#define KMAIL_VERSION "1.6.50"
#endif /*kmversion_h*/
| // KMail Version Information
//
#ifndef kmversion_h
#define kmversion_h
#define KMAIL_VERSION "1.6.51"
#endif /*kmversion_h*/
|
Fix warning from gcc4 (Laurent) | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
// $Id$
// $MpId: AliMpStationType.h,v 1.5 2005/10/28 15:05:04 ivana Exp $
/// \ingroup basic
/// \enum AliMpStationType
/// Enumeration for refering to a MUON stati... | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
// $Id$
// $MpId: AliMpStationType.h,v 1.5 2005/10/28 15:05:04 ivana Exp $
/// \ingroup basic
/// \enum AliMpStationType
/// Enumeration for refering to a MUON stati... |
Increase version number of merge into master | //
// MKVersion.h
// MKCommons
//
// Created by Michael Kuck on 9/27/13.
// Copyright (c) 2013 Michael Kuck. All rights reserved.
//
extern NSString *const MKApplicationVersion(void);
static NSUInteger const MAJOR = 1;
static NSUInteger const MINOR = 10;
static NSUInteger const PATCH = 4;
| //
// MKVersion.h
// MKCommons
//
// Created by Michael Kuck on 9/27/13.
// Copyright (c) 2013 Michael Kuck. All rights reserved.
//
extern NSString *const MKApplicationVersion(void);
static NSUInteger const MAJOR = 1;
static NSUInteger const MINOR = 11;
static NSUInteger const PATCH = 0;
|
Remove the templated copyright statement | //
// FacilitiesRoom.h
// MIT Mobile
//
// Created by Blake Skinner on 5/11/11.
// Copyright (c) 2011 MIT. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@class FacilitiesLocation;
@interface FacilitiesRoom : NSManagedObject {
@private
}
@property (nonatomic, retain) NSSt... | #import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@class FacilitiesLocation;
@interface FacilitiesRoom : NSManagedObject {
@private
}
@property (nonatomic, retain) NSString * floor;
@property (nonatomic, retain) NSString * number;
@property (nonatomic, retain) NSString * building;
- (NSString*)displayS... |
Make cardinal directions rely on VoxelUtils. | #ifndef CARDINAL_DIRECTION_H
#define CARDINAL_DIRECTION_H
#include <string>
#include "../Math/Vector2.h"
#include "../World/VoxelUtils.h"
// North, northeast, southwest, etc..
enum class CardinalDirectionName;
namespace CardinalDirection
{
// Cardinal directions in the XZ plane (bird's eye view).
... | #ifndef CARDINAL_DIRECTION_H
#define CARDINAL_DIRECTION_H
#include <string>
#include "../Math/Vector2.h"
#include "../World/VoxelUtils.h"
// North, northeast, southwest, etc..
enum class CardinalDirectionName;
namespace CardinalDirection
{
// Cardinal directions in the XZ plane (bird's eye view).
... |
Add printf module into libocl | #ifndef __OCL_PRINTF_H__
#define __OCL_PRINTF_H__
#include "ocl_types.h"
/* The printf function. */
/* From LLVM 3.4, c string are all in constant address space */
#if 100*__clang_major__ + __clang_minor__ < 304
int __gen_ocl_printf_stub(const char * format, ...);
#else
int __gen_ocl_printf_stub(constant char * forma... | |
Add a test for PR22531 | // RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -emit-llvm -o - %s | FileCheck %s
// Since foo is never emitted, there should not be a profile name for it.
// CHECK-NOT: @__llvm_profile_name_foo =
// CHECK: @__llvm_profile_name_bar =
// CHECK-NOT: @__llvm_profile_name_foo =
#ifdef IS_SYSHEADER
#pragm... | // RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -emit-llvm -main-file-name unused_names.c -o - %s > %t
// RUN: FileCheck -input-file %t %s
// RUN: FileCheck -check-prefix=SYSHEADER -input-file %t %s
// Since foo is never emitted, there should not be a profile name for it.
// CHECK-DAG: @__llvm_profile_... |
Fix to windows build errors | #ifndef RBRIDGE_H
#define RBRIDGE_H
#include <RInside.h>
#include <Rcpp.h>
#include <string>
#include <map>
#include <boost/function.hpp>
#include "../JASP-Common/dataset.h"
#ifdef __WIN32__
#undef Realloc
#undef Free
#endif
//typedef int (*RCallback)(std::string value);
typedef boost::function<int(const std:... | #ifndef RBRIDGE_H
#define RBRIDGE_H
#include <RInside.h>
#include <Rcpp.h>
#ifdef __WIN32__
#undef Realloc
#undef Free
#endif
#include <string>
#include <map>
#include <boost/function.hpp>
#include "../JASP-Common/dataset.h"
//typedef int (*RCallback)(std::string value);
typedef boost::function<int(const std::... |
Add important DCC functions to DCC header for interaction | class dccChat : public Module {
public:
virtual ~dccChat();
virtual void onDCCReceive(std::string dccid, std::string message);
virtual void onDCCEnd(std::string dccid);
};
class dccSender : public Module {
public:
virtual ~dccSender();
virtual void dccSend(std::string dccid, std::string message);
virtual... | class dccChat : public Module {
public:
virtual ~dccChat();
virtual void onDCCReceive(std::string dccid, std::string message);
virtual void onDCCEnd(std::string dccid);
};
class dccSender : public Module {
public:
virtual ~dccSender();
virtual void dccSend(std::string dccid, std::string message);
virtual... |
Add sample headers as a macro | #include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "httpserv.h"
#include "request.h"
#define PORT 5556
#define BACKLOG 5
int main(int argc, char* argv[]) {
setup_openssl();
req* r = init_request();
char* res = request_kahoot_token(r, "6573712");
printf("%s\n", res);
return 0;
}; | #include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "httpserv.h"
#include "request.h"
#include "kahoot.h"
#define PORT 5556
#define BACKLOG 5
#define HEADERS "HTTP/1.1 200 OK\
Server: openresty/1.11.2.2\
Date: Tue, 28 Mar 2017 14:55:03 GMT\
Content-Type: application/json\
Transfer-Encoding: chunked\
Co... |
Change proc() to task() and put overloaded config types. | /*
ModbusIP.h - Header for Modbus IP Library
Copyright (C) 2015 Andr Sarmento Barbosa
*/
#include <Arduino.h>
#include <Modbus.h>
#include <SPI.h>
#include <Ethernet.h>
#ifndef MODBUSIP_H
#define MODBUSIP_H
#define MODBUSIP_PORT 502
#define MODBUSIP_MAXFRAME 200
class ModbusIP : public Modbus {
privat... | /*
ModbusIP.h - Header for Modbus IP Library
Copyright (C) 2015 Andr Sarmento Barbosa
*/
#include <Arduino.h>
#include <Modbus.h>
#include <SPI.h>
#include <Ethernet.h>
#ifndef MODBUSIP_H
#define MODBUSIP_H
#define MODBUSIP_PORT 502
#define MODBUSIP_MAXFRAME 200
class ModbusIP : public Modbus {
privat... |
Move DisposalDeleter out of bindings namespace. | #ifndef SAUCE_SAUCE_INTERNAL_DISPOSAL_DELETER_H_
#define SAUCE_SAUCE_INTERNAL_DISPOSAL_DELETER_H_
#include <sauce/memory.h>
namespace sauce {
namespace internal {
namespace bindings {
template<typename Dependency, typename Scope>
class NakedBinding;
/**
* A smart pointer deleter that diposes with a given binding.
... | #ifndef SAUCE_SAUCE_INTERNAL_DISPOSAL_DELETER_H_
#define SAUCE_SAUCE_INTERNAL_DISPOSAL_DELETER_H_
#include <sauce/memory.h>
namespace sauce {
namespace internal {
namespace bindings {
template<typename Dependency, typename Scope>
class NakedBinding;
}
namespace b = ::sauce::internal::bindings;
/**
* A smart point... |
Add some of these cast examples as test for congruences | // PARAM: --enable ana.int.congruence --enable ana.int.congruence_no_overflow
// from https://github.com/sosy-lab/sv-benchmarks/blob/master/c/bitvector-regression/implicitunsignedconversion-1.c
int main() {
unsigned int plus_one = 1;
int minus_one = -1;
int v = 0;
if(plus_one < minus_one) {
v = 1;
asse... | |
Add a testcase for the vla and stack realignment warning. | // RUN: %llvmgcc -std=gnu99 %s -S |& grep {error: "is greater than the stack alignment" }
int foo(int a)
{
int var[a] __attribute__((__aligned__(32)));
return 4;
}
| |
Fix missing header error in some boards | #ifndef TELEMETRY_TRANSPORT_HPP_
#define TELEMETRY_TRANSPORT_HPP_
#include "HardwareSerial.h"
int32_t read(uint8_t * buf, uint32_t sizeToRead)
{
return Serial.readBytes((char*)(buf), sizeToRead);
}
int32_t write(uint8_t * buf, uint32_t sizeToWrite)
{
Serial.write((char*)(buf),sizeToWrite);
return 0;
}
i... | #ifndef TELEMETRY_TRANSPORT_HPP_
#define TELEMETRY_TRANSPORT_HPP_
#include "HardwareSerial.h"
#include "Arduino.h"
int32_t read(uint8_t * buf, uint32_t sizeToRead)
{
return Serial.readBytes((char*)(buf), sizeToRead);
}
int32_t write(uint8_t * buf, uint32_t sizeToWrite)
{
Serial.write((char*)(buf),sizeToWrite... |
Add initial lua integration concept | #include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
int main(int argc, char *argv[])
{
lua_State *ls;
int status;
ls = luaL_newstate();
if(argc > 1) {
status = luaL_loadfile(ls, argv[1]);
if(status) {
printf("ERROR: %s\n", lua_tostring(ls, -1));
}
}
... | |
Fix warning given by Clang |
#ifndef __CLOCK_SERVER_H__
#define __CLOCK_SERVER_H__
#include <std.h>
#include <scheduler.h>
extern int clock_server_tid;
typedef enum {
CLOCK_NOTIFY = 1,
CLOCK_DELAY = 2,
CLOCK_TIME = 3,
CLOCK_DELAY_UNTIL = 4
} clock_req_type;
typedef struct {
clock_req_type type;
uint ticks;
} clock_req;... |
#ifndef __CLOCK_SERVER_H__
#define __CLOCK_SERVER_H__
#include <std.h>
#include <scheduler.h>
extern int clock_server_tid;
typedef enum {
CLOCK_NOTIFY = 1,
CLOCK_DELAY = 2,
CLOCK_TIME = 3,
CLOCK_DELAY_UNTIL = 4
} clock_req_type;
typedef struct {
clock_req_type type;
uint ticks;
} clock_req;... |
Make jonable methods to return vectors via reference | #ifndef JOINABLE_IMPL
#define JOINABLE_IMPL
#include "joinable_types.h"
#include "types/MediaObjectImpl.h"
using ::com::kurento::kms::api::Joinable;
using ::com::kurento::kms::api::Direction;
using ::com::kurento::kms::api::StreamType;
using ::com::kurento::kms::api::MediaSession;
namespace com { namespace kurento {... | #ifndef JOINABLE_IMPL
#define JOINABLE_IMPL
#include "joinable_types.h"
#include "types/MediaObjectImpl.h"
using ::com::kurento::kms::api::Joinable;
using ::com::kurento::kms::api::Direction;
using ::com::kurento::kms::api::StreamType;
using ::com::kurento::kms::api::MediaSession;
namespace com { namespace kurento {... |
Remove line so file doesn't show in diff | #import <UIKit/UIKit.h>
@interface NVSceneController : UIViewController
@property (nonatomic, copy) void (^boundsDidChangeBlock)(NVSceneController *controller);
@property (nonatomic, assign) UIStatusBarStyle statusBarStyle;
@property (nonatomic, assign) BOOL statusBarHidden;
- (id)initWithScene:(UIView *)view;
@end... | #import <UIKit/UIKit.h>
@interface NVSceneController : UIViewController
@property (nonatomic, copy) void (^boundsDidChangeBlock)(NVSceneController *controller);
@property (nonatomic, assign) UIStatusBarStyle statusBarStyle;
@property (nonatomic, assign) BOOL statusBarHidden;
- (id)initWithScene:(UIView *)view;
@end... |
Allow custom shutdown check cycles by exposing private functions | #ifndef QAK_SHUTDOWN_CHECK_H
#define QAK_SHUTDOWN_CHECK_H
#include <QDebug>
#include <QObject>
#include <QStandardPaths>
#include <QFile>
#include <QFileInfo>
#include <QDateTime>
class ShutdownCheck : public QObject
{
Q_OBJECT
public:
enum Status
{
OK,
FAILED,
Error
};
Q_... | #ifndef QAK_SHUTDOWN_CHECK_H
#define QAK_SHUTDOWN_CHECK_H
#include <QDebug>
#include <QObject>
#include <QStandardPaths>
#include <QFile>
#include <QFileInfo>
#include <QDateTime>
class ShutdownCheck : public QObject
{
Q_OBJECT
public:
enum Status
{
OK,
FAILED,
Error
};
Q_... |
Use some paranthesis around macro parameters. | #ifndef CJET_CONFIG_H
#define CJET_CONFIG_H
#define SERVER_PORT 11122
#define LISTEN_BACKLOG 40
/*
* It is somehow beneficial if this size is 32 bit aligned.
*/
#define MAX_MESSAGE_SIZE 512
#define WRITE_BUFFER_CHUNK 512
#define MAX_WRITE_BUFFER_SIZE 10 * WRITE_BUFFER_CHUNK
/* Linux specific configs */
#define MAX_... | #ifndef CJET_CONFIG_H
#define CJET_CONFIG_H
#define SERVER_PORT 11122
#define LISTEN_BACKLOG 40
/*
* It is somehow beneficial if this size is 32 bit aligned.
*/
#define MAX_MESSAGE_SIZE 512
#define WRITE_BUFFER_CHUNK 512
#define MAX_WRITE_BUFFER_SIZE (10 * (WRITE_BUFFER_CHUNK))
/* Linux specific configs */
#define ... |
Fix potential memory leak - freeing the newly created OSyncList was missing | #include <opensync/opensync.h>
#include <opensync/opensync-group.h>
int main(int argc, char *argv[]) {
OSyncList *groups, *g;
int i = 0;
osync_bool couldloadgroups;
OSyncGroup *group = NULL;
OSyncGroupEnv *groupenv = NULL;
groupenv = osync_group_env_new(NULL);
/* load groups from default dir */
couldlo... | #include <opensync/opensync.h>
#include <opensync/opensync-group.h>
int main(int argc, char *argv[]) {
OSyncList *groups, *g;
int i = 0;
osync_bool couldloadgroups;
OSyncGroup *group = NULL;
OSyncGroupEnv *groupenv = NULL;
groupenv = osync_group_env_new(NULL);
/* load groups from default dir */
couldlo... |
Rename variable to be more .net like | // Copyright 2010-2015 The CefSharp Project. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "../CefSharp.Core/Internals/Messaging/ProcessMessageDelegate.h"
namespace CefSharp
{
class CefAppUnmanagedWrappe... | // Copyright 2010-2015 The CefSharp Project. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "../CefSharp.Core/Internals/Messaging/ProcessMessageDelegate.h"
namespace CefSharp
{
class CefAppUnmanagedWrappe... |
Add comment to test case for documentation. | // 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
}
| // 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) // The true branch is infeasible.
g(a); // no-warning
}
|
Fix some printf format warnings | /*
* Let's make sure we always have a sane definition for ntohl()/htonl().
* Some libraries define those as a function call, just to perform byte
* shifting, bringing significant overhead to what should be a simple
* operation.
*/
/*
* Default version that the compiler ought to optimize properly with
* constant... | /*
* Let's make sure we always have a sane definition for ntohl()/htonl().
* Some libraries define those as a function call, just to perform byte
* shifting, bringing significant overhead to what should be a simple
* operation.
*/
/*
* Default version that the compiler ought to optimize properly with
* constant... |
Prepare for LLVM 7.0 migrating some utility passes | #define _GNU_SOURCE
#define __STDC_CONSTANT_MACROS
#define __STDC_FORMAT_MACROS
#define __STDC_LIMIT_MACROS
#include <llvm-c/Analysis.h>
#include <llvm-c/BitReader.h>
#include <llvm-c/BitWriter.h>
#include <llvm-c/Core.h>
#include <llvm-c/DebugInfo.h>
#include <llvm-c/Disassembler.h>
#include <llvm-c/ErrorHandling.h>
... | #define _GNU_SOURCE
#define __STDC_CONSTANT_MACROS
#define __STDC_FORMAT_MACROS
#define __STDC_LIMIT_MACROS
#include <llvm-c/Analysis.h>
#include <llvm-c/BitReader.h>
#include <llvm-c/BitWriter.h>
#include <llvm-c/Core.h>
#include <llvm-c/DebugInfo.h>
#include <llvm-c/Disassembler.h>
#include <llvm-c/ErrorHandling.h>
... |
Add two more test cases for attribute 'noreturn'. | // RUN: clang-cc %s -fsyntax-only -verify -fblocks -Wmissing-noreturn
int j;
void test1() { // expected-warning {{function could be attribute 'noreturn'}}
^ (void) { while (1) { } }(); // expected-warning {{block could be attribute 'noreturn'}}
^ (void) { if (j) while (1) { } }();
while (1) { }
}
void test2() {... | // RUN: clang-cc %s -fsyntax-only -verify -fblocks -Wmissing-noreturn
int j;
void test1() { // expected-warning {{function could be attribute 'noreturn'}}
^ (void) { while (1) { } }(); // expected-warning {{block could be attribute 'noreturn'}}
^ (void) { if (j) while (1) { } }();
while (1) { }
}
void test2() {... |
Add documentation and ensure parameters are unsigned | #pragma once
#include <map>
#include <vector>
class HotkeyInfo {
public:
enum HotkeyActions {
IncreaseVolume,
DecreaseVolume,
SetVolume,
Mute,
VolumeSlider,
EjectDrive,
EjectLatestDrive,
MediaKey,
RunApp,
Settings,
Exit,
}... | #pragma once
#include <map>
#include <vector>
class HotkeyInfo {
public:
enum HotkeyActions {
IncreaseVolume,
DecreaseVolume,
SetVolume,
Mute,
VolumeSlider,
EjectDrive,
EjectLatestDrive,
MediaKey,
RunApp,
Settings,
Exit,
}... |
Use the new function names for the codec discovery tests |
#include <gst/gst.h>
#include <gst/farsight/fs-codec.h>
#include "fs-rtp-discover-codecs.h"
int main (int argc, char **argv)
{
GList *elements = NULL;
GError *error = NULL;
gst_init (&argc, &argv);
g_debug ("AUDIO STARTING!!");
elements = load_codecs (FS_MEDIA_TYPE_AUDIO, &error);
if (error)
g_... |
#include <gst/gst.h>
#include <gst/farsight/fs-codec.h>
#include "fs-rtp-discover-codecs.h"
int main (int argc, char **argv)
{
GList *elements = NULL;
GError *error = NULL;
gst_init (&argc, &argv);
g_debug ("AUDIO STARTING!!");
elements = fs_rtp_blueprints_get (FS_MEDIA_TYPE_AUDIO, &error);
if (err... |
Remove dot from exception message | #ifndef INCLUDE_PATLMS_EXCEPTION_DETAIL_DATE_PARSE_EXCEPTION_H
#define INCLUDE_PATLMS_EXCEPTION_DETAIL_DATE_PARSE_EXCEPTION_H
#include <patlms/type/exception/exception.h>
namespace type
{
namespace exception
{
namespace detail
{
class DateParseException : public interface::Exception {
inline char const* what() c... | #ifndef INCLUDE_PATLMS_EXCEPTION_DETAIL_DATE_PARSE_EXCEPTION_H
#define INCLUDE_PATLMS_EXCEPTION_DETAIL_DATE_PARSE_EXCEPTION_H
#include <patlms/type/exception/exception.h>
namespace type
{
namespace exception
{
namespace detail
{
class DateParseException : public interface::Exception {
inline char const* what() c... |
Add Opus RTP payload format header | /*
* RTP Payload Format for the Opus Speech and Audio Codec
*/
#ifndef __BITSTREAM_IETF_RTP7587_H__
# define __BITSTREAM_IETF_RTP7587_H__
#define RTP_7587_CLOCKRATE 48000
#endif /* !__BITSTREAM_IETF_RTP7587_H__ */
| |
Add relational traces write vs mutex-meet example | // SKIP PARAM: --sets ana.activated[+] octApron
#include <pthread.h>
#include <assert.h>
int g = 0;
int h = 0;
int i = 0;
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; // h <= g
pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; // h == g
pthread_mutex_t C = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
int x, y... | |
Change dump power to 127 | void dc_dump() {
static int prev_l = 0, prev_r = 0;
if (!prev_l && vexRT[Btn7L])
dump_set(-80);
if (!prev_r && vexRT[Btn7R])
dump_set(80);
if ((prev_l && !vexRT[Btn7L]) || (prev_r && !vexRT[Btn7R]))
dump_set(0);
prev_l = vexRT[Btn7L];
prev_r = vexRT[Btn7R];
}
| void dc_dump() {
// TODO: Check direction and change to U and D
static int prev_l = 0, prev_r = 0;
if (!prev_l && vexRT[Btn7L])
dump_set(-127);
if (!prev_r && vexRT[Btn7R])
dump_set(127);
if ((prev_l && !vexRT[Btn7L]) || (prev_r && !vexRT[Btn7R]))
dump_set(0);
prev_l = v... |
Introduce header for doing socket setup (useful for multicast). | /*
* sockcreate.h
* Copyright (C) 2009 Palo Alto Research Center, Inc. All rights reserved.
*/
struct sockaddr_storage;
struct sockaddr;
/**
* Holds a pair of socket file descriptors.
*
* Some platfoms/modes of operations require separate sockets for sending
* and receiving, so we accomodate that with this pai... | |
Add delegate for main view controller. | //
// ViewController.h
// PlayPlan
//
// Created by Zeacone on 15/10/25.
// Copyright © 2015年 Zeacone. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Accelerate/Accelerate.h>
#import "PlayPlan.h"
#import "SideMenu.h"
@interface MainViewController : UIViewController <UITableViewDelegate, UITableViewDataS... | //
// ViewController.h
// PlayPlan
//
// Created by Zeacone on 15/10/25.
// Copyright © 2015年 Zeacone. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Accelerate/Accelerate.h>
#import "PlayPlan.h"
#import "SideMenu.h"
@class MainViewController;
@protocol MainDelegate <NSObject>
- (void)dismissViewContr... |
Add static helper to extract X509 from cert | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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 applic... | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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 applic... |
Modify to work with dynamic class loader class. | #ifndef TEST_CASE_H
#define TEST_CASE_H
namespace fs_testing {
class test_case {
public:
virtual ~test_case() {};
virtual int setup() = 0;
virtual int run() = 0;
virtual int check_test() = 0;
};
typedef test_case* create_t();
typedef void destroy_t(test_case*);
} // namespace fs_testing
#endif
| #ifndef TEST_CASE_H
#define TEST_CASE_H
namespace fs_testing {
class test_case {
public:
virtual ~test_case() {};
virtual int setup() = 0;
virtual int run() = 0;
virtual int check_test() = 0;
};
typedef test_case* test_create_t();
typedef void test_destroy_t(test_case*);
} // namespace fs_testing
#endif
|
Add new member in MODBUSMasterStatus | //Declarations for master types
typedef enum
{
Register = 0
} MODBUSDataType; //MODBUS data types enum (coil, register, input, etc.)
typedef struct
{
uint8_t Address; //Device address
uint8_t Function; //Function called, in which exception occured
uint8_t Code; //Exception code
} MODBUSExceptionLog; //Parsed exce... | //Declarations for master types
typedef enum
{
Register = 0
} MODBUSDataType; //MODBUS data types enum (coil, register, input, etc.)
typedef struct
{
uint8_t Address; //Device address
uint8_t Function; //Function called, in which exception occured
uint8_t Code; //Exception code
} MODBUSExceptionLog; //Parsed exce... |
Update method name in documentation | #import <Foundation/Foundation.h>
@interface NSProcessInfo (TDTEnvironmentDetection)
/**
Determine if the current process is running inside a unit test context.
Use case:
When running unit tests on iOS, it is not necessary to fully initialize the
application. The following check can be used to return early in th... | #import <Foundation/Foundation.h>
@interface NSProcessInfo (TDTEnvironmentDetection)
/**
Determine if the current process is running inside a unit test context.
Use case:
When running unit tests on iOS, it is not necessary to fully initialize the
application. The following check can be used to return early in th... |
Update RingOpenGL - Add Function (Source Code) : void glActiveTexture(GLenum texture) | #include "ring.h"
/*
OpenGL 2.1 Extension
Copyright (c) 2017 Mahmoud Fayed <msfclipper@yahoo.com>
*/
#include <GL/glew.h>
#include <GL/glut.h>
RING_FUNC(ring_glAccum)
{
if ( RING_API_PARACOUNT != 2 ) {
RING_API_ERROR(RING_API_MISS2PARA);
return ;
}
if ( ! RING_API_ISNUMBER(1) ) {
RING_API_ERROR(RING_AP... | #include "ring.h"
/*
OpenGL 2.1 Extension
Copyright (c) 2017 Mahmoud Fayed <msfclipper@yahoo.com>
*/
#include <GL/glew.h>
#include <GL/glut.h>
RING_FUNC(ring_glAccum)
{
if ( RING_API_PARACOUNT != 2 ) {
RING_API_ERROR(RING_API_MISS2PARA);
return ;
}
if ( ! RING_API_ISNUMBER(1) ) {
RING_API_ERROR(RING_AP... |
Add reading of geometrical parts. | /*! \file GeometricData.h Geometric data for robots when available.
Copyright (c) 2010
@author Olivier Stasse
JRL-Japan, CNRS/AIST
All rights reserved.
Please see License.txt for more informations on the license related to this software.
*/
#ifndef _DYNAMICS_JRL_JAPAN_GEOMETRIC_DATA_H_
#define _... | |
Fix compilation error with improved Optional. | #pragma once
#include <nucleus/optional.h>
#include "canvas/renderer/pipeline.h"
#include "canvas/renderer/vertex_definition.h"
#include "canvas/utils/shader_source.h"
namespace ca {
class Renderer;
class PipelineBuilder {
public:
explicit PipelineBuilder(Renderer* renderer);
PipelineBuilder& attribute(nu::St... | #pragma once
#include <nucleus/optional.hpp>
#include "canvas/renderer/pipeline.h"
#include "canvas/renderer/vertex_definition.h"
#include "canvas/utils/shader_source.h"
namespace ca {
class Renderer;
class PipelineBuilder {
public:
explicit PipelineBuilder(Renderer* renderer);
PipelineBuilder& attribute(nu::... |
Fix asm label testcase flaw | // RUN: %clang_cc1 -emit-llvm -o %t %s
// RUN: not grep "@pipe()" %t
// RUN: grep '_thisIsNotAPipe' %t | count 3
// RUN: not grep 'g0' %t
// RUN: grep '_renamed' %t | count 2
// RUN: %clang_cc1 -DUSE_DEF -emit-llvm -o %t %s
// RUN: not grep "@pipe()" %t
// RUN: grep '_thisIsNotAPipe' %t | count 3
// <rdr://6116729>
vo... | // RUN: %clang_cc1 -emit-llvm -o %t %s
// RUN: not grep "@pipe()" %t
// RUN: grep '_thisIsNotAPipe' %t | count 3
// RUN: not grep '@g0' %t
// RUN: grep '_renamed' %t | count 2
// RUN: %clang_cc1 -DUSE_DEF -emit-llvm -o %t %s
// RUN: not grep "@pipe()" %t
// RUN: grep '_thisIsNotAPipe' %t | count 3
// <rdr://6116729>
v... |
Add sample code to get efivar |
#include <efivar.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
efi_guid_t guid = EFI_GLOBAL_GUID;
const char* name = "BootCurrent";
uint8_t *data;
size_t data_size;
uint32_t attr;
int res = efi_get_variable(guid, name, &data, &data_size, &attr);
if (res < 0) {
perror("efi_get_variable");... | |
Add example containing infinite loop with assert | // PARAM: --sets solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.activated "['base']"
// This is a pattern we saw in some examples for SVCOMP, where instead of the assert(0) there was a call to verifier error.
// Because of the demand-driven nature of our solvers, we never looked at the code in... | |
Modify the instance getter of DataStore to public | #pragma once
#ifndef YOU_DATASTORE_DATASTORE_H_
#define YOU_DATASTORE_DATASTORE_H_
#include <memory>
#include "task_typedefs.h"
#include "transaction.h"
namespace You {
namespace DataStore {
namespace UnitTests {}
class DataStore {
public:
Transaction && begin();
// Modifying methods
void post(TaskId, Serialized... | #pragma once
#ifndef YOU_DATASTORE_DATASTORE_H_
#define YOU_DATASTORE_DATASTORE_H_
#include <memory>
#include "task_typedefs.h"
#include "transaction.h"
namespace You {
namespace DataStore {
namespace UnitTests {}
class DataStore {
public:
Transaction && begin();
static DataStore& get();
// Modifying methods
v... |
Change the way execution results are collected. | #pragma once
#include <libevm/VMFace.h>
#include <evmjit/libevmjit/ExecutionEngine.h>
namespace dev
{
namespace eth
{
class JitVM: public VMFace
{
public:
virtual bytesConstRef execImpl(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final;
private:
jit::Runtime... | #pragma once
#include <libevm/VMFace.h>
#include <evmjit/libevmjit/ExecutionEngine.h>
namespace dev
{
namespace eth
{
class JitVM: public VMFace
{
public:
virtual bytesConstRef execImpl(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) override final;
private:
jit::RuntimeData m_data;
jit::E... |
Add headers for setting and getting continuous rendering state | #pragma once
#ifdef PLATFORM_ANDROID
struct _JNIEnv;
typedef _JNIEnv JNIEnv;
class _jobject;
typedef _jobject* jobject;
void jniInit(JNIEnv* _jniEnv, jobject obj, jobject _assetManager);
#endif
#if (defined PLATFORM_IOS) && (defined __OBJC__)
#import "ViewController.h"
void setViewController(ViewController* _controll... | #pragma once
#ifdef PLATFORM_ANDROID
struct _JNIEnv;
typedef _JNIEnv JNIEnv;
class _jobject;
typedef _jobject* jobject;
void jniInit(JNIEnv* _jniEnv, jobject obj, jobject _assetManager);
#endif
#if (defined PLATFORM_IOS) && (defined __OBJC__)
#import "ViewController.h"
void setViewController(ViewController* _controll... |
Include logger.h later to prevent using SystemLog before definition | /*
* system_log.h
*
* Author: Ming Tsang
* Copyright (c) 2014 Ming Tsang
* Refer to LICENSE for details
*/
#pragma once
#include "libutils/io/logger.h"
#include "libutils/misc/singleton.h"
namespace libutils
{
namespace io
{
/**
* The default system logger
*/
template<typename CharT>
class SystemLog : publi... | /*
* system_log.h
*
* Author: Ming Tsang
* Copyright (c) 2014 Ming Tsang
* Refer to LICENSE for details
*/
#pragma once
#include "libutils/misc/singleton.h"
namespace libutils
{
namespace io
{
template<typename T> class Logger;
}
}
namespace libutils
{
namespace io
{
/**
* The default system logger
*/
te... |
Add GTMKeychain.h to umbrella header | /*! @file GTMAppAuth.h
@brief GTMAppAuth SDK
@copyright
Copyright 2016 Google Inc.
@copydetails
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
ht... | /*! @file GTMAppAuth.h
@brief GTMAppAuth SDK
@copyright
Copyright 2016 Google Inc.
@copydetails
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
ht... |
Fix compilation for MinGW, remove redundant class name on inline member | //===-- NativeRegisterContextWindows.h --------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | //===-- NativeRegisterContextWindows.h --------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
Add a debug statement so accesses to bad register numbers can be seen with debugging enabled. | /* libunwind - a platform-independent unwind library
Copyright (C) 2002 Hewlett-Packard Co
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"... | |
Fix signed vs unsigned issue | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_FLIP_FLIP_BITMASKS_H_
#define NET_FLIP_FLIP_BITMASKS_H_
namespace flip {
const int kStreamIdMask = 0x7fffffff; // StreamId mask from th... | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_FLIP_FLIP_BITMASKS_H_
#define NET_FLIP_FLIP_BITMASKS_H_
namespace flip {
const unsigned int kStreamIdMask = 0x7fffffff; // StreamId mas... |
Simplify docs for nilValue / notNilValue | //
// OCHamcrest - HCIsNil.h
// Copyright 2011 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid
//
#import <OCHamcrest/HCBaseMatcher.h>
/**
Is the value @c nil?
@b Factory: @ref nilValue, @ref notNilValue
@ingroup object_matchers
*/
@interface HCIsNil : HCBaseMatcher
+ (id)isNil;
@end
#pr... | //
// OCHamcrest - HCIsNil.h
// Copyright 2011 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid
//
#import <OCHamcrest/HCBaseMatcher.h>
@interface HCIsNil : HCBaseMatcher
+ (id)isNil;
@end
OBJC_EXPORT id<HCMatcher> HC_nilValue();
/**
Matches if the value is @c nil.
In the event of a name cla... |
Extend the packet ringbuffer to have address stamps | #ifndef _PACKETQUEUE_H
#define _PACKETQUEUE_H 1
#include <libsvc/thread.h>
#include <libsvc/transport.h>
#include <pthread.h>
#include <stdlib.h>
#include <stdint.h>
typedef struct pktbuf_s {
uint8_t pkt[4096];
} pktbuf;
typedef struct packetqueue_s {
thread super;
pthread_mutexattr_t matt... | #ifndef _PACKETQUEUE_H
#define _PACKETQUEUE_H 1
#include <libsvc/thread.h>
#include <libsvc/transport.h>
#include <pthread.h>
#include <stdlib.h>
#include <stdint.h>
typedef struct pktbuf_s {
uint8_t pkt[4096];
struct sockaddr_storage addr;
} pktbuf;
typedef struct packetqueue_s {
threa... |
Add smart pointer for COM interfaces | /*
MIT License
Copyright (c) 2017 Eren Okka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, dist... | /*
MIT License
Copyright (c) 2017 Eren Okka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, dist... |
Increment version number from 1.50b to 1.51 | #pragma once
// const float in a header file can lead to duplication of the storage
// but I don't really care in this case. Just don't do it with a header
// that is included hundreds of times.
const float kCurrentVersion = 1.50f;
// Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version
// incr... | #pragma once
// const float in a header file can lead to duplication of the storage
// but I don't really care in this case. Just don't do it with a header
// that is included hundreds of times.
const float kCurrentVersion = 1.51f;
// Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version
// incr... |
Revert "Remove public headers from umbrella header" | #import <Foundation/Foundation.h>
FOUNDATION_EXPORT double NimbleVersionNumber;
FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
| #import <Foundation/Foundation.h>
#import <Nimble/NMBExceptionCapture.h>
#import <Nimble/DSL.h>
FOUNDATION_EXPORT double NimbleVersionNumber;
FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
|
Remove obsolete includes in TKernel precompiled | #pragma once
#include <string>
#include <iostream>
#include <math.h>
#include "Standard.hxx"
#include "Standard_PrimitiveTypes.hxx"
#include "Standard_Stream.hxx"
#include "Standard_Failure.hxx"
#include "Standard_Transient.hxx"
#ifdef USE_STL_STREAM
#include <sstream>
#else /* USE_STL_STREAM */
#ifdef WNT
#include ... | #pragma once
#include <string>
#include <iostream>
#include <math.h>
#include "Standard.hxx"
#include "Standard_PrimitiveTypes.hxx"
#include "Standard_Stream.hxx"
#include "Standard_Failure.hxx"
#include "Standard_Transient.hxx"
|
Fix import of removed file | //
// OCATransformer.h
// Objective-Chain
//
// Created by Martin Kiss on 31.12.13.
// Copyright © 2014 Martin Kiss. All rights reserved.
//
#import "OCATransformer+Base.h"
#import "OCATransformer+Nil.h"
#import "OCATransformer+Predefined.h"
| //
// OCATransformer.h
// Objective-Chain
//
// Created by Martin Kiss on 31.12.13.
// Copyright © 2014 Martin Kiss. All rights reserved.
//
#import "OCATransformer+Base.h"
#import "OCATransformer+Predefined.h"
|
Move KHEAP macros into memlayout.h | #ifndef KMEM_H
#define KMEM_H
#include <stdbool.h>
#include <stdint.h>
#include <arch/x86/paging.h>
#include <libk/kabort.h>
#define KHEAP_PHYS_ROOT ((void*)0x100000)
//#define KHEAP_PHYS_END ((void*)0xc1000000)
#define KHEAP_END_SENTINEL (NULL)
#define KHEAP_BLOCK_SLOP 32
struct kheap_metadata {
size_t size;
... | #ifndef KMEM_H
#define KMEM_H
#include <stdbool.h>
#include <stdint.h>
#include <arch/x86/paging.h>
#include <arch/x86/memlayout.h>
#include <libk/kabort.h>
// KHEAP_PHYS_ROOT is defined in memlayout.h because it is architecture
// specific.
#define KHEAP_END_SENTINEL (NULL)
#define KHEAP_BLOCK_SLOP 32
struct khea... |
Rename LOread() and LOwrite() to be lower case to allow use in case-insensitive SQL. Define LOread() and LOwrite() as macros to avoid having to update calls everywhere. | /*-------------------------------------------------------------------------
*
* be-fsstubs.h--
*
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: be-fsstubs.h,v 1.1 1996/08/28 07:22:56 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
... | /*-------------------------------------------------------------------------
*
* be-fsstubs.h--
*
*
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: be-fsstubs.h,v 1.2 1997/05/06 07:14:34 thomas Exp $
*
*-------------------------------------------------------------------------
*/
#... |
Add checks to regression tests that unknown pointers and string pointers may be equal | #include <assert.h>
#include <stdlib.h>
int main(){
char* str = "Hello";
char* str2 = "Hello";
char* str3 = "hi";
char* str4 = "other string";
// Unknown since the there may be multiple copies of the same string
__goblint_check(str != str2); // UNKNOWN!
__goblint_check(str == str);
__... | #include <assert.h>
#include <stdlib.h>
int main(){
char* str = "Hello";
char* str2 = "Hello";
char* str3 = "hi";
char* str4 = "other string";
// Unknown since the there may be multiple copies of the same string
__goblint_check(str != str2); // UNKNOWN!
__goblint_check(str == str);
__... |
Remove Eigen/Dense include in type header | #pragma once
#include <Eigen/Dense>
namespace model {
#if BICYCLE_USE_DOUBLE_PRECISION_REAL
using real_t = double;
#else
using real_t = float;
#endif
} // namespace model
| #pragma once
namespace model {
#if BICYCLE_USE_DOUBLE_PRECISION_REAL
using real_t = double;
#else
using real_t = float;
#endif
} // namespace model
|
Make unpack_trees_options bit flags actual bitfields | #ifndef UNPACK_TREES_H
#define UNPACK_TREES_H
#define MAX_UNPACK_TREES 8
struct unpack_trees_options;
typedef int (*merge_fn_t)(struct cache_entry **src,
struct unpack_trees_options *options);
struct unpack_trees_options {
int reset;
int merge;
int update;
int index_only;
int nontrivial_merge;
int trivial_m... | #ifndef UNPACK_TREES_H
#define UNPACK_TREES_H
#define MAX_UNPACK_TREES 8
struct unpack_trees_options;
typedef int (*merge_fn_t)(struct cache_entry **src,
struct unpack_trees_options *options);
struct unpack_trees_options {
unsigned int reset:1,
merge:1,
update:1,
index_only:1,
nontriv... |
Add slash = / to warning message | reference(citation): URLcheck
If [ $$stopFileNameCheck = 1 ]
Exit Script [ ]
End If
If [ Filter ( reference::fileName ; "?" ) = "?" or
Filter ( reference::fileName ; "#" ) = "#" or
Filter ( reference::fileName ; ";" ) = ";" or
Filter ( reference::fileName ; ":" ) = ":" ]
Show Custom Dialog [ Message: "These special charact... | reference(citation): URLcheck
If [ $$stopFileNameCheck = 1 ]
Exit Script [ ]
End If
If [ Filter ( reference::fileName ; "?" ) = "?" or
Filter ( reference::fileName ; "#" ) = "#" or
Filter ( reference::fileName ; ";" ) = ";" or
Filter ( reference::fileName ; "/" ) = "/" or
Filter ( reference::fileName ; ":" ) = ":" ]
Show Cu... |
Update name of null state to match Android | //
// ApptentiveConversationMetadataItem.h
// Apptentive
//
// Created by Frank Schmitt on 2/20/17.
// Copyright © 2017 Apptentive, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, ApptentiveConversationState) {
ApptentiveConversationStateNone = 0,
ApptentiveConversation... | //
// ApptentiveConversationMetadataItem.h
// Apptentive
//
// Created by Frank Schmitt on 2/20/17.
// Copyright © 2017 Apptentive, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, ApptentiveConversationState) {
ApptentiveConversationStateUndefined = 0,
ApptentiveConvers... |
Remove HAVE_USAGE because it is no longer used. | # define USE_POSIX_TIME
# define USE_POSIX_SIGNALS
# define NO_EMPTY_STMTS
# define SYSV_DIRENT
# define HAS_TEST_AND_SET
typedef unsigned char slock_t;
#include <sys/isa_defs.h>
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
#endif
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN 1234
#endif
#ifndef PDP_ENDIAN
... | # define USE_POSIX_TIME
# define USE_POSIX_SIGNALS
# define NO_EMPTY_STMTS
# define SYSV_DIRENT
# define HAS_TEST_AND_SET
typedef unsigned char slock_t;
#include <sys/isa_defs.h>
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
#endif
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN 1234
#endif
#ifndef PDP_ENDIAN
... |
Enable C++ support for socket debug transport | #if !defined(DUK_TRANS_SOCKET_H_INCLUDED)
#define DUK_TRANS_SOCKET_H_INCLUDED
#include "duktape.h"
void duk_trans_socket_init(void);
void duk_trans_socket_finish(void);
void duk_trans_socket_waitconn(void);
duk_size_t duk_trans_socket_read_cb(void *udata, char *buffer, duk_size_t length);
duk_size_t duk_trans_socket_... | #if !defined(DUK_TRANS_SOCKET_H_INCLUDED)
#define DUK_TRANS_SOCKET_H_INCLUDED
#include "duktape.h"
#if defined(__cplusplus)
extern "C" {
#endif
void duk_trans_socket_init(void);
void duk_trans_socket_finish(void);
void duk_trans_socket_waitconn(void);
duk_size_t duk_trans_socket_read_cb(void *udata, char *buffer, du... |
Add a programatic interface to intrinsic names. | //===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- 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.
//
//===----------... | //===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- 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.
//
//===----------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.