Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Add convenience function to calculate the integer representation of the version
#pragma once #include <string> struct Version { public: Version(int major = 0, int minor = 0, int revision = 0) : _major(major), _minor(minor), _revision(revision) { } const int Major() { return _major; } const int Minor() { return _minor; } const int Revision() { return _revision; }...
#pragma once #include <string> struct Version { public: Version(int major = 0, int minor = 0, int revision = 0) : _major(major), _minor(minor), _revision(revision) { } const int Major() { return _major; } const int Minor() { return _minor; } const int Revision() { return _revision; }...
Change server port to the correct jet port.
#ifndef CJET_CONFIG_H #define CJET_CONFIG_H #define SERVER_PORT 7899 #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 128 /* Linux specific configs */ #define MAX_EPOLL_EVENTS 100 #endif
Fix linker error by changing init function names to represent module names
#include <uEye.h> #include "core.h" #if PY_MAJOR_VERSION >= 3 /* * This is only needed for Python3 * IDS module initialization * Based on https://docs.python.org/3/extending/extending.html#the-module-s-method-table-and-initialization-function */ static struct PyModuleDef idsModule = { PyModuleDef_HEAD_INIT, ...
#include <uEye.h> #include "core.h" #if PY_MAJOR_VERSION >= 3 /* * This is only needed for Python3 * IDS module initialization * Based on https://docs.python.org/3/extending/extending.html#the-module-s-method-table-and-initialization-function */ static struct PyModuleDef idsModule = { PyModuleDef_HEAD_INIT, ...
Add macros for setting Endpoint buffers length,
#ifndef USB_H #define USB_H void setup_usb(); void usb_interrupt_handler(); #endif
#ifndef USB_H #define USB_H #define PHYS_ADDR(VIRTUAL_ADDR) (unsigned int)(VIRTUAL_ADDR) #define EP0_BUFLEN 8 #define EP1_BUFLEN 8 #define USB_PID_SETUP 0x0d #define USB_REQ_GET_DESCRIPTOR 0x06 #define USB_GET_DEVICE_DESCRIPTOR 0x01 #define USB_GET_CONFIG_DESCRIPTOR 0x02 #def...
Remove static declaration of line diff
#ifndef DASHBOARD_H #define DASHBOARD_H #include <sys/types.h> #include "src/process/process.h" #include "src/system/sys_stats.h" typedef struct { int max_x; int max_y; int prev_x; int prev_y; char *fieldbar; sysaux *system; ps_node *process_list; Tree *process_tree; } Board; vo...
#ifndef DASHBOARD_H #define DASHBOARD_H #include <sys/types.h> #include "src/process/process.h" #include "src/system/sys_stats.h" typedef struct { int max_x; int max_y; int prev_x; int prev_y; char *fieldbar; sysaux *system; ps_node *process_list; Tree *process_tree; } Board; vo...
Fix for [MPLY-9800]. Doc string didn't link correctly. Buddy: Sam A.
#pragma once #import "WRLDRoutingQuery.h" #import "WRLDRoutingQueryOptions.h" NS_ASSUME_NONNULL_BEGIN /*! A service which allows you to find routes between locations. Created by the createRoutingService method of the WRLDMapView object. This is an Objective-c interface to the WRLD Routing REST API (https://githu...
#pragma once #import "WRLDRoutingQuery.h" #import "WRLDRoutingQueryOptions.h" NS_ASSUME_NONNULL_BEGIN /*! A service which allows you to find routes between locations. Created by the createRoutingService method of the WRLDMapView object. This is an Objective-c interface to the [WRLD Routing REST API](https://gith...
Add funcoes para converter graus <-> rad
#include "local.h" float soluc(float x, float y) { float r; r = sqrt(x * x + y * y); return r; } float radians_degrees(float degrees) { return degrees*180/PI; } float degrees_radians(float radians) { return radians*PI/180; }
Reorder mm_context_t to remove x86_64 alignment padding and thus shrink mm_struct
#ifndef _ASM_X86_MMU_H #define _ASM_X86_MMU_H #include <linux/spinlock.h> #include <linux/mutex.h> /* * The x86 doesn't have a mmu context, but * we put the segment information here. */ typedef struct { void *ldt; int size; struct mutex lock; void *vdso; #ifdef CONFIG_X86_64 /* True if mm supports a task run...
#ifndef _ASM_X86_MMU_H #define _ASM_X86_MMU_H #include <linux/spinlock.h> #include <linux/mutex.h> /* * The x86 doesn't have a mmu context, but * we put the segment information here. */ typedef struct { void *ldt; int size; #ifdef CONFIG_X86_64 /* True if mm supports a task running in 32 bit compatibility mode...
Add xcb headers to linux platform, needed for vulkan
/** ****************************************************************************** * Xenia : Xbox 360 Emulator Research Project * ****************************************************************************** * Copyright 2015 Ben Vanik. All rights reserved. ...
/** ****************************************************************************** * Xenia : Xbox 360 Emulator Research Project * ****************************************************************************** * Copyright 2015 Ben Vanik. All rights reserved. ...
Add Documentation for BufferLockManger, BufferRange and BufferLock.
#ifndef SRC_GRAPHICS_BUFFER_LOCK_MANAGER_H_ #define SRC_GRAPHICS_BUFFER_LOCK_MANAGER_H_ #include <vector> #include "./gl.h" namespace Graphics { struct BufferRange { size_t startOffset; size_t length; size_t endOffset() const { return startOffset + length; } bool overlaps(const BufferRange &other)...
#ifndef SRC_GRAPHICS_BUFFER_LOCK_MANAGER_H_ #define SRC_GRAPHICS_BUFFER_LOCK_MANAGER_H_ #include <vector> #include "./gl.h" namespace Graphics { /** * \brief Encapsulates a locked buffer range * * It stores the start offset in the buffer and the length of the range. * The end offset can be retrieved with #endOf...
Add fallback path for Foundation lookup
#include <objc/runtime.h> #include <objc/message.h> #include <stdio.h> #include <dlfcn.h> #include <string.h> static void pyobjc_internal_init() { static void *foundation = NULL; if ( foundation == NULL ) { foundation = dlopen( "/Groups/System/Library/Frameworks/Foundation.framework/Versions/...
#include <objc/runtime.h> #include <objc/message.h> #include <stdio.h> #include <dlfcn.h> #include <string.h> static void pyobjc_internal_init() { static void *foundation = NULL; if ( foundation == NULL ) { foundation = dlopen( "/System/Library/Frameworks/Foundation.framework/Versions/Current...
Refactor STMRecordingOverlayDelegate to inherit from CreateShoutDelegate
// // STMRecordingOverlayViewController.h // Pods // // Created by Tyler Clemens on 9/14/15. // // #import <UIKit/UIKit.h> #import "VoiceCmdView.h" @protocol STMRecordingOverlayDelegate; @interface STMRecordingOverlayViewController : UIViewController<VoiceCmdViewDelegate, SendShoutDelegate> @property (atomic) id<...
// // STMRecordingOverlayViewController.h // Pods // // Created by Tyler Clemens on 9/14/15. // // #import <UIKit/UIKit.h> #import "VoiceCmdView.h" @protocol STMRecordingOverlayDelegate <CreateShoutDelegate> -(void)overlayClosed:(BOOL)bDismissed; @end @interface STMRecordingOverlayViewController : UIViewControl...
Increase the asynchronous testing timeout
// // AsyncTesting.h // ContentfulSDK // // Created by Boris Bügling on 05/03/14. // // // Set the flag for a block completion handler #define StartBlock() __block BOOL waitingForBlock = YES // Set the flag to stop the loop #define EndBlock() waitingForBlock = NO // Wait and loop until flag is set #define WaitUnt...
// // AsyncTesting.h // ContentfulSDK // // Created by Boris Bügling on 05/03/14. // // // Set the flag for a block completion handler #define StartBlock() __block BOOL waitingForBlock = YES // Set the flag to stop the loop #define EndBlock() waitingForBlock = NO // Wait and loop until flag is set #define WaitUnt...
Fix clang's stupid warning to work around a bug in OS X headers...
#ifndef _OBJC_MESSAGE_H_ #define _OBJC_MESSAGE_H_ #if defined(__x86_64) || defined(__i386) || defined(__arm__) || \ defined(__mips_n64) || defined(__mips_n32) /** * Standard message sending function. This function must be cast to the * correct types for the function before use. The first argument is the * receiv...
Add flag byte to packet structure.
#ifndef RADIO_H_INCLUDED #define RADIO_H_INCLUDED #include <stdint.h> #define RADIO_PACKET_MAX_LEN 64 #define RADIO_PACKET_BUFFER_SIZE 1 typedef enum { PACKET_RECEIVED, } radio_evt_type_t; typedef struct { uint8_t len; uint8_t data[RADIO_PACKET_MAX_LEN]; } radio_packet_t; typedef struct { radio_evt_...
#ifndef RADIO_H_INCLUDED #define RADIO_H_INCLUDED #include <stdint.h> #define RADIO_PACKET_MAX_LEN 64 #define RADIO_PACKET_BUFFER_SIZE 1 typedef enum { PACKET_RECEIVED, } radio_evt_type_t; typedef struct { uint8_t len; struct __attribute__((packed)) { uint8_t padding : 7; uint8_t ack...
Change -ffp-contract=fast test to run on Aarch64
// RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=powerpc-apple-darwin10 -S -o - %s | FileCheck %s // REQUIRES: powerpc-registered-target float fma_test1(float a, float b, float c) { // CHECK: fmadds float x = a * b; float y = x + c; return y; }
// RUN: %clang_cc1 -O3 -ffp-contract=fast -triple=aarch64-apple-darwin -S -o - %s | FileCheck %s // REQUIRES: aarch64-registered-target float fma_test1(float a, float b, float c) { // CHECK: fmadd float x = a * b; float y = x + c; return y; }
Add a missing import to fix compilation of Fruit tests.
/* * Copyright 2014 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
/* * Copyright 2014 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
Test expsplit with multiple simultaneous splits
// PARAM: --set ana.activated[+] expsplit #include <stddef.h> #include <assert.h> #include <goblint.h> int main() { int r, r2; // rand int x, y, z; __goblint_split_begin(x); __goblint_split_begin(y); if (r) { x = 1; if (r2) { y = 1; z = 1; } else { y = 2; z = 2; }...
Remove first parameter of DBG()
/* See LICENSE file for copyright and license details. */ #include <sys/types.h> #ifndef NDEBUG extern int debug; #define DBG(fmt, ...) dbg(fmt, __VA_ARGS__) #define DBGON() (debug = 1) #else #define DBG(...) #define DBGON() #endif #ifndef PREFIX #define PREFIX "/usr/local/" #endif #define TINT long long #def...
/* See LICENSE file for copyright and license details. */ #include <sys/types.h> #ifndef NDEBUG extern int debug; #define DBG(...) dbg(__VA_ARGS__) #define DBGON() (debug = 1) #else #define DBG(...) #define DBGON() #endif #ifndef PREFIX #define PREFIX "/usr/local/" #endif #define TINT long long #define TUINT ...
Fix void * casting to char * warning
// cc dict_example.c dict.c #include <assert.h> #include <stdio.h> #include <string.h> #include "bool.h" #include "dict.h" int main(int argc, const char *argv[]) { /* allocate a new dict */ struct dict *dict = dict(); /* set key and values to dict */ char *key1 = "key1"; char *key2 = "key2"; c...
// cc dict_example.c dict.c md5.c #include <assert.h> #include <stdio.h> #include <string.h> #include "bool.h" #include "dict.h" int main(int argc, const char *argv[]) { /* allocate a new dict */ struct dict *dict = dict(); /* set key and values to dict */ char *key1 = "key1"; char *key2 = "key2";...
Update Skia milestone to 101
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 100 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 101 #endif
Add Bit Manipulation to find lonely integer by XOR trick
/* Problem Statement There are N integers in an array A. All but one integer occur in pairs. Your task is to find the number that occurs only once. Input Format The first line of the input contains an integer N, indicating the number of integers. The next line contains N space-separated integers that form the array ...
Add description to internal header
#ifndef BUGSNAG_PRIVATE_H #define BUGSNAG_PRIVATE_H #import "Bugsnag.h" #import "BugsnagBreadcrumb.h" @interface BugsnagBreadcrumbs () /** * Reads and return breadcrumb data currently stored on disk */ - (NSArray *_Nullable)cachedBreadcrumbs; @end @interface Bugsnag () /** Get the current Bugsnag configuration. ...
/** * Exposes non-public interfaces between the components of the library for * internal use */ #ifndef BUGSNAG_PRIVATE_H #define BUGSNAG_PRIVATE_H #import "Bugsnag.h" #import "BugsnagBreadcrumb.h" @interface BugsnagBreadcrumbs () /** * Reads and return breadcrumb data currently stored on disk */ - (NSArray *_Nu...
Fix compiler warning for unused function.
// // HLError.h // HLSpriteKit // // Created by Karl Voskuil on 6/6/14. // Copyright (c) 2014 Hilo Games. All rights reserved. // #import <Foundation/Foundation.h> /** The error level for logging non-critical errors using `HLError()`. */ typedef NS_ENUM(NSInteger, HLErrorLevel) { /** Errors. */ HLLevelE...
// // HLError.h // HLSpriteKit // // Created by Karl Voskuil on 6/6/14. // Copyright (c) 2014 Hilo Games. All rights reserved. // #import <Foundation/Foundation.h> /** The error level for logging non-critical errors using `HLError()`. */ typedef NS_ENUM(NSInteger, HLErrorLevel) { /** Errors. */ HLLevelE...
Tidy up the umbrella header.
// // Set.h // Set // // Created by Rob Rix on 2014-06-22. // Copyright (c) 2014 Rob Rix. All rights reserved. // #import <Cocoa/Cocoa.h> //! Project version number for Set. FOUNDATION_EXPORT double SetVersionNumber; //! Project version string for Set. FOUNDATION_EXPORT const unsigned char SetVersionString[]; /...
// Copyright (c) 2014 Rob Rix. All rights reserved. /// Project version number for Set. extern double SetVersionNumber; /// Project version string for Set. extern const unsigned char SetVersionString[];
Include zmq utils if necessary.
/* Copyright (c) 2017 Rolf Timmermans */ #pragma once #include <napi.h> #include <zmq.h> #include <node.h> #include <cassert> #include <iostream> #include "inline/arguments.h" #include "inline/error.h" #include "inline/util.h" #ifdef __MSVC__ #define force_inline inline __forceinline #else #define force_inline inlin...
/* Copyright (c) 2017 Rolf Timmermans */ #pragma once #include <napi.h> #include <zmq.h> #if ZMQ_VERSION < ZMQ_MAKE_VERSION(4,1,0) # include <zmq_utils.h> #endif #include <node.h> #include <cassert> #include "inline/arguments.h" #include "inline/error.h" #include "inline/util.h" #ifdef __MSVC__ #define force_inl...
Print function name at DBG
#ifndef __DEBUG_H__ #define __DEBUG_H__ #undef ENABLE_DEBUG #ifdef ENABLE_DEBUG #include <sstream> #define DBG(x...) \ do {\ std::cout<< "DBG " << x << std::endl;\ } while(0) #define DBGHEXTOSTRING(_b, _size) \ do { \ char *b = (char*)(_b);\ uint64_t size = (uint64_t) (...
#ifndef __DEBUG_H__ #define __DEBUG_H__ #undef ENABLE_DEBUG #ifdef ENABLE_DEBUG #include <sstream> #if __STDC_VERSION__ < 199901L # if __GNUC__ >= 2 # define __func__ __FUNCTION__ # else # define __func__ "<unknown>" # endif #endif #define DBG(x...) \ do {\ std::cout<< "DBG " << __func__ << "...
Add TD3 test where complex self-abort causes verify error
// SKIP PARAM: --set ana.activated[+] apron #include <pthread.h> #include <assert.h> int g = 1; int h = 1; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int x, y; // rand pthread_mutex_lock(&A); g = x; h = x; pthread_mutex_unlock(&A); pthread_mutex_lock(&A); pthread_mutex_unloc...
Add further simplification of 13/51
#include <pthread.h> #include <assert.h> int g = 0; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; void *worker(void *arg ) { while (1) { pthread_mutex_lock(&A); g = 1000; assert(g != 0); if (g > 0) { g--; } pthread_mutex_unlock(&A); ...
Add skstd version of std::exchange
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkExchange_DEFINED #define SkExchange_DEFINED #include <utility> namespace skstd { // std::exchange is in C++14 template<typename T, typename U = T> inline static T...
Move serialization interface into sub namespace
#pragma once #include <cstddef> namespace util { // The interface is tuned for reuse and avoids boilerplate length calculations. // Looking at implementation examples helps understand the decisions behind it. // Serialization functions should not throw. // Upon success, serialize functions shall return end of seri...
#pragma once namespace util { namespace serde { // The interface is tuned for reuse and avoids boilerplate length calculations. // Looking at implementation examples helps understand the decisions behind it. // Serialization functions should not throw. // Upon success, serialize functions shall return end of serial...
Add a file with common definitions to be used by all testcases.
//---------------------------- tests.h --------------------------- // $Id$ // Version: $Name$ // // Copyright (C) 2004 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer // to the file deal.II/doc/license.ht...
Add poll implementation for Muen
/* * Copyright (c) 2017 Contributors as noted in the AUTHORS file * * This file is part of Solo5, a unikernel base layer. * * Permission to use, copy, modify, and/or distribute this software * for any purpose with or without fee is hereby granted, provided * that the above copyright notice and this permission no...
Add [[noreturn]] to pure throwing method
#ifndef GENE_H #define GENE_H #include <map> #include <string> #include <iosfwd> class Board; class Piece_Strength_Gene; class Gene { public: Gene(); virtual ~Gene() = default; void read_from(std::istream& is); void mutate(); double evaluate(const Board& board) const; ...
#ifndef GENE_H #define GENE_H #include <map> #include <string> #include <iosfwd> class Board; class Piece_Strength_Gene; class Gene { public: Gene(); virtual ~Gene() = default; void read_from(std::istream& is); void mutate(); double evaluate(const Board& board) const; ...
Add shader structure for GLSL compile extension
/* IN DEVELOPMENT. DO NOT SHIP. */ #ifndef __XGLINTELEXT_H__ #define __XGLINTELEXT_H__ #include <xcb/xcb.h> #include <xcb/randr.h> #include "xgl.h" #ifdef __cplusplus extern "C" { #endif // __cplusplus typedef enum _XGL_INTEL_STRUCTURE_TYPE { XGL_INTEL_STRUCTURE_TYPE_SHADER_CREATE_INFO = 1000, } XG...
/* IN DEVELOPMENT. DO NOT SHIP. */ #ifndef __XGLINTELEXT_H__ #define __XGLINTELEXT_H__ #include <xcb/xcb.h> #include <xcb/randr.h> #include "xgl.h" #ifdef __cplusplus extern "C" { #endif // __cplusplus typedef enum _XGL_INTEL_STRUCTURE_TYPE { XGL_INTEL_STRUCTURE_TYPE_SHADER_CREATE_INFO = 1000, } XG...
Comment explaining what a valid NaPTAN code is.
// // LJSStop.h // LJSYourNextBus // // Created by Luke Stringer on 29/01/2014. // Copyright (c) 2014 Luke Stringer. All rights reserved. // #import <Foundation/Foundation.h> @interface LJSStop : NSObject <NSCopying> @property (nonatomic, copy, readonly) NSString *NaPTANCode; @property (nonatomic, copy, readonly...
// // LJSStop.h // LJSYourNextBus // // Created by Luke Stringer on 29/01/2014. // Copyright (c) 2014 Luke Stringer. All rights reserved. // #import <Foundation/Foundation.h> @interface LJSStop : NSObject <NSCopying> /** * An 8 digit stop number starting with e.g. 450 for West Yorkshire or 370 for South Yorksh...
Add shader structure for GLSL compile extension
/* IN DEVELOPMENT. DO NOT SHIP. */ #ifndef __XGLINTELEXT_H__ #define __XGLINTELEXT_H__ #include <xcb/xcb.h> #include <xcb/randr.h> #include "xgl.h" #ifdef __cplusplus extern "C" { #endif // __cplusplus typedef enum _XGL_INTEL_STRUCTURE_TYPE { XGL_INTEL_STRUCTURE_TYPE_SHADER_CREATE_INFO = 1000, } XG...
/* IN DEVELOPMENT. DO NOT SHIP. */ #ifndef __XGLINTELEXT_H__ #define __XGLINTELEXT_H__ #include <xcb/xcb.h> #include <xcb/randr.h> #include "xgl.h" #ifdef __cplusplus extern "C" { #endif // __cplusplus typedef enum _XGL_INTEL_STRUCTURE_TYPE { XGL_INTEL_STRUCTURE_TYPE_SHADER_CREATE_INFO = 1000, } XG...
Add missing newline at EOF after d1943e187f47
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MINI_CHROMIUM_BASE_METRICS_HISTOGRAM_FUNCTIONS_H_ #define MINI_CHROMIUM_BASE_METRICS_HISTOGRAM_FUNCTIONS_H_ #include <string> // These are no-op...
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MINI_CHROMIUM_BASE_METRICS_HISTOGRAM_FUNCTIONS_H_ #define MINI_CHROMIUM_BASE_METRICS_HISTOGRAM_FUNCTIONS_H_ #include <string> // These are no-op...
Add function for getting a variable's string representation
#ifndef MICROPYTHON_WRAP_UTIL_H #define MICROPYTHON_WRAP_UTIL_H #include "detail/micropython.h" namespace upywrap { inline std::string ExceptionToString( mp_obj_t ex ) { std::string exMessage; const mp_print_t mp_my_print{ &exMessage, [] ( void* data, const char* str, mp_uint_t len ) { ( (std::st...
#ifndef MICROPYTHON_WRAP_UTIL_H #define MICROPYTHON_WRAP_UTIL_H #include "detail/micropython.h" namespace upywrap { inline mp_print_t PrintToString( std::string& dest ) { return mp_print_t{ &dest, [] ( void* data, const char* str, mp_uint_t len ) { ( (std::string*) data )->append( str, len ); } }; ...
Add type 'clock_t' to minilibc.
#ifndef __TYPES_H__ #define __TYPES_H__ typedef long off_t; typedef unsigned long size_t; typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; type...
#ifndef __TYPES_H__ #define __TYPES_H__ typedef long off_t; typedef unsigned long size_t; typedef signed long ssize_t; /* Used for a count of bytes or an error indication. */ typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; type...
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 missing header file `stdint.h`
/** * Copyright (c) 2015, Chao Wang <hit9@icloud.com> * * md5 hash function. */ /* * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc. * MD5 Message-Digest Algorithm (RFC 1321). * * Homepage: http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 * * Author: A...
/** * Copyright (c) 2015, Chao Wang <hit9@icloud.com> * * md5 hash function. */ /* * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc. * MD5 Message-Digest Algorithm (RFC 1321). * * Homepage: http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 * * Author: A...
Move the QVideoFrame scope lock to a header file
#ifndef Q_VIDEO_FRAME_SCOPE_MAP #define Q_VIDEO_FRAME_SCOPE_MAP 1 // TODO: move to QVideoFrameScope struct QVideoFrameScopeMap { QVideoFrameScopeMap(QVideoFrame *frame, QAbstractVideoBuffer::MapMode mode) : frame(frame) { if(frame) { status = frame->map(mode); if (!stat...
Add feature letting you include one .c file which automatically selects the driver.
#if defined(WINDOWS) || defined(WIN32) || defined(WIN64) #include "CNFGWinDriver.c" #elif defined( __android__ ) #include "CNFGOGLEGLDriver.c" #else #include "CNFGXDriver.c" #endif
Remove old audio player header
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import "STKAudioPlayer.h"
// // Use this file to import your target's public headers that you would like to expose to Swift. //
Update a test case to work with old Darwin SDK's
// RUN: %clangxx_asan -std=c++11 -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=READ // RUN: not %run %t write 2>&1 | FileCheck %s --check-prefix=WRITE // REQUIRES: x86-target-arch #include <sys/mman.h> static volatile int sink; __attribute__((noinline)) void Read(int *ptr) { sink = *ptr; }...
// RUN: %clangxx_asan -std=c++11 -O0 %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=READ // RUN: not %run %t write 2>&1 | FileCheck %s --check-prefix=WRITE // REQUIRES: x86-target-arch #include <sys/mman.h> static volatile int sink; __attribute__((noinline)) void Read(int *ptr) { sink = *ptr; }...
Add a new line to satisfy clang.
#pragma once #include <string> #include <iostream> struct Customer { int id; std::string name; }; inline std::ostream& operator<<(std::ostream& os, const Customer& obj) { os << "Customer (id: " << obj.id << ", name: " << obj.name << ")"; return os; }
#pragma once #include <string> #include <iostream> struct Customer { int id; std::string name; }; inline std::ostream& operator<<(std::ostream& os, const Customer& obj) { os << "Customer (id: " << obj.id << ", name: " << obj.name << ")"; return os; }
Move unknown enum entry to top.
#import <WebKit/WebKit.h> typedef NS_ENUM (NSInteger, WMFWKScriptMessageType) { WMFWKScriptMessagePeek, WMFWKScriptMessageConsoleMessage, WMFWKScriptMessageClickLink, WMFWKScriptMessageClickImage, WMFWKScriptMessageClickReference, WMFWKScriptMessageClickEdit, WMFWKScriptMessageNonAnchorTouc...
#import <WebKit/WebKit.h> typedef NS_ENUM (NSInteger, WMFWKScriptMessageType) { WMFWKScriptMessageUnknown, WMFWKScriptMessagePeek, WMFWKScriptMessageConsoleMessage, WMFWKScriptMessageClickLink, WMFWKScriptMessageClickImage, WMFWKScriptMessageClickReference, WMFWKScriptMessageClickEdit, ...
Fix build warning with clang 10.0.1
#include <limits.h> #include "utils/random.h" // A simple psuedorandom number generator static struct random_t rand_state = { 1 }; void random_seed(struct random_t *r, uint32_t seed) { r->seed = seed; } uint32_t random_get_seed(struct random_t *r) { return r->seed; } uint32_t random_int(struct random_t *r,...
#include <limits.h> #include "utils/random.h" // A simple psuedorandom number generator static struct random_t rand_state = { 1 }; void random_seed(struct random_t *r, uint32_t seed) { r->seed = seed; } uint32_t random_get_seed(struct random_t *r) { return r->seed; } uint32_t random_int(struct random_t *r,...
Fix a typo in the argument type.
/* trace.h * Copyright: (When this is determined...it will go here) * CVS Info * $Id$ * Overview: * Tracing support for runops_cores.c. * Data Structure and Algorithms: * History: * Notes: * References: */ #ifndef PARROT_TRACE_H_GUARD #define PARROT_TRACE_H_GUARD #include "parrot/parrot.h" v...
/* trace.h * Copyright: (When this is determined...it will go here) * CVS Info * $Id$ * Overview: * Tracing support for runops_cores.c. * Data Structure and Algorithms: * History: * Notes: * References: */ #ifndef PARROT_TRACE_H_GUARD #define PARROT_TRACE_H_GUARD #include "parrot/parrot.h" v...
Add text output for integers.
#include "custom-type.h" #include "cmd.h" #include "common.h" #include <string.h> #include <hiredis/hiredis.h> #include <hiredis/async.h> void custom_type_reply(redisAsyncContext *c, void *r, void *privdata) { redisReply *reply = r; struct cmd *cmd = privdata; (void)c; if(reply == NULL) { evhttp_send_reply(cm...
#include "custom-type.h" #include "cmd.h" #include "common.h" #include <string.h> #include <hiredis/hiredis.h> #include <hiredis/async.h> void custom_type_reply(redisAsyncContext *c, void *r, void *privdata) { redisReply *reply = r; struct cmd *cmd = privdata; (void)c; char int_buffer[50]; int int_len; if(rep...
Add analysis stub for bsearch
#include <stddef.h> void qsort(void *ptr, size_t count, size_t size, int (*comp)(const void*, const void*)) { // call all possible compares first, before invalidating array elements for (size_t i = 0; i < count; i++) { for (size_t j = 0; j < count; j++) { comp(ptr + i * size, ptr + j * size); } } ...
#include <stddef.h> void qsort(void *ptr, size_t count, size_t size, int (*comp)(const void*, const void*)) { // call all possible compares first, before invalidating array elements for (size_t i = 0; i < count; i++) { for (size_t j = 0; j < count; j++) { comp(ptr + i * size, ptr + j * size); } } ...
Remove malicious semicolon from array constant
#include <check.h> /* * Include test files below */ typedef Suite* (*suite_creator_f)(void); int main(void) { int nfailed = 0; Suite* s; SRunner* sr; suite_creator_f iter; /* * Insert suite creator functions here */ suite_creator_f suite_funcs[] = { NULL; }; f...
#include <check.h> /* * Include test files below */ typedef Suite* (*suite_creator_f)(void); int main(void) { int nfailed = 0; Suite* s; SRunner* sr; suite_creator_f iter; /* * Insert suite creator functions here */ suite_creator_f suite_funcs[] = { NULL }; fo...
Update version number to 8.01.07-k7.
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2005 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.01.07-k6" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 1 #define QLA_DRIVER_PATCH_VER 7 #define...
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2005 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.01.07-k7" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 1 #define QLA_DRIVER_PATCH_VER 7 #define...
Include what you use fixes.
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
Add result set benchmark program without GLib
/* Copyright (C) 2015-2019 Sutou Kouhei <kou@clear-code.com> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be use...
Add test case that makes goblint crash
// Test case taken from sqlite3.c #include <string.h> typedef unsigned long u64; # define EXP754 (((u64)0x7ff)<<52) # define MAN754 ((((u64)1)<<52)-1) # define IsNaN(X) (((X)&EXP754)==EXP754 && ((X)&MAN754)!=0) static int sqlite3IsNaN(double x){ int rc; /* The value return */ u64 y; memcpy(&y,&x,sizeof(y))...
Add documentation to the headers
// // DAKeyboardControl.h // DAKeyboardControlExample // // Created by Daniel Amitay on 7/14/12. // Copyright (c) 2012 Daniel Amitay. All rights reserved. // #import <UIKit/UIKit.h> typedef void (^DAKeyboardDidMoveBlock)(CGRect keyboardFrameInView); @interface UIView (DAKeyboardControl) @property (nonatomic) CG...
// // DAKeyboardControl.h // DAKeyboardControlExample // // Created by Daniel Amitay on 7/14/12. // Copyright (c) 2012 Daniel Amitay. All rights reserved. // #import <UIKit/UIKit.h> typedef void (^DAKeyboardDidMoveBlock)(CGRect keyboardFrameInView); /** DAKeyboardControl allows you to easily add keyboard awarene...
Add program to create a lot of files in a directory
/* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be use...
Check if `size == 0` in `safe_malloc_function()`
#include "safe-memory.h" #include <stdio.h> #include <stdlib.h> #include <string.h> void* safe_malloc_function(size_t size, const char* calling_function) { void* memory = malloc(size); if (!memory) { fprintf(stderr, "Error: not enough memory for malloc in function: %s", calling_fun...
#include "safe-memory.h" #include <stdio.h> #include <stdlib.h> #include <string.h> void* safe_malloc_function(size_t size, const char* calling_function) { if (size == 0) { return NULL; } void* memory = malloc(size); if (!memory) { fprintf(stderr, "Error: not enough memory for...
Reduce the amount of process activity for incoming I/O read responses.
#ifndef IORESPONSEMUX_H #define IORESPONSEMUX_H #ifndef PROCESSOR_H #error This file should be included in Processor.h #endif class IOResponseMultiplexer : public Object { private: RegisterFile& m_regFile; struct IOResponse { IODeviceID device; IOData data; }; ...
#ifndef IORESPONSEMUX_H #define IORESPONSEMUX_H #ifndef PROCESSOR_H #error This file should be included in Processor.h #endif class IOResponseMultiplexer : public Object { private: RegisterFile& m_regFile; struct IOResponse { IODeviceID device; IOData data; }; ...
Add solution for problem 3
/* * he prime factors of 13195 are 5, 7, 13 and 29. * * What is the largest prime factor of the number 600851475143 ? */ #include <stdio.h> int main(int argc, char **argv) { long long int num = 600851475143; int x; for(x = 2; x < num; x++) { if(num % x == 0) { num /= x; ...
Add a solution for problem 9
#include <stdio.h> #include <stdint.h> #include "euler.h" #define PROBLEM 9 #define ANSWER 31875000 int main(int argc, char **argv) { int a, b, c, a2, b2, c2; int product = 0; for(a = 1; a < 1000; a++) { for(b = 1; b < 1000; b++) { a2 = a * a; b2 = b * b; for(c ...
Add super simple thread creation case
#include <stdio.h> #include <assert.h> #include "uv.h" static uv_thread_t thread; static void thread_cb(void* arg) { printf("hello thread!\n"); } int main() { int r = uv_thread_create(&thread, thread_cb, NULL); assert(r == 0); /* pause execution of this thread until the spawned thread has had * time t...
Add newline to end of file
#include <string> #include "Type.h" class VarStack; enum ArithmeticOperator { NEGATE = 0, SUM, DIFFERENCE, MULTIPLY, DIVIDE }; #define NUM_ARITHMETIC_OPERATORS 5 enum LogicOperator { LESS_THAN = 0, LESS_THAN_OR_EQUAL, EQUAL, GREATER_THAN_OR_EQUAL, GREATER_THAN }; #define NUM_LOGIC_OPERATORS 5 class Exp...
#include <string> #include "Type.h" class VarStack; enum ArithmeticOperator { NEGATE = 0, SUM, DIFFERENCE, MULTIPLY, DIVIDE }; #define NUM_ARITHMETIC_OPERATORS 5 enum LogicOperator { LESS_THAN = 0, LESS_THAN_OR_EQUAL, EQUAL, GREATER_THAN_OR_EQUAL, GREATER_THAN }; #define NUM_LOGIC_OPERATORS 5 class Exp...
Add a file for some ObjC class ABI constants.
//===--- Class.h - Compiler/runtime class-metadata values -------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swift.org/LI...
Add a simple server abstraction.
#ifndef IO_SOCKET_SIMPLE_SERVER_H #define IO_SOCKET_SIMPLE_SERVER_H #include <io/socket/socket.h> /* * XXX * This is just one level up from using macros. Would be nice to use abstract * base classes and something a bit tidier. */ template<typename A, typename C, typename L> class SimpleServer { LogHandle log_; ...
Implement a test that demonstrates the exponential blowup of our system
#include "rmc.h" extern int coin(void); // A test that should be really bad because exponents. // Only takes like a minute or so! void welp(int *p, int *q) { VEDGE(a, b); L(a, *p = 1); if (coin()){} if (coin()){} if (coin()){} if (coin()){} // 4 if (coin()){} if (coin()){} if...
Disable assert checks as default
#ifndef CTCONFIG_H #define CTCONFIG_H #define ENABLE_ASSERT_CHECKS //#define CT_NODE_DEBUG //#define ENABLE_INTEGRITY_CHECK //#define ENABLE_COUNTERS //#define ENABLE_PAGING #endif // CTCONFIG_H
#ifndef CTCONFIG_H #define CTCONFIG_H //#define ENABLE_ASSERT_CHECKS //#define CT_NODE_DEBUG //#define ENABLE_INTEGRITY_CHECK //#define ENABLE_COUNTERS //#define ENABLE_PAGING #endif // CTCONFIG_H
Remove readonly from member name and availability so we can create entries locally.
// // TSDKEventLinupEntry.h // TeamSnapSDK // // Created by Jason Rahaim on 4/10/18. // Copyright © 2018 teamsnap. All rights reserved. // #import <TeamSnapSDK/TeamSnapSDK.h> @interface TSDKEventLineupEntry : TSDKCollectionObject @property (nonatomic, weak) NSString *_Nullable eventLineupId; @property (nonatomic...
// // TSDKEventLinupEntry.h // TeamSnapSDK // // Created by Jason Rahaim on 4/10/18. // Copyright © 2018 teamsnap. All rights reserved. // #import <TeamSnapSDK/TeamSnapSDK.h> @interface TSDKEventLineupEntry : TSDKCollectionObject @property (nonatomic, weak) NSString *_Nullable eventLineupId; @property (nonatomic...
Add Gridcoin structs to forward file.
#pragma once // Block data structures. class CBlock; class CBlockIndex;
#pragma once // Block data structures. class CBlock; class CBlockIndex; // Gridcoin struct MiningCPID; struct StructCPID; struct StructCPIDCache;
Create a general interrupt handler
#include <rose/screen.h> #include <rose/descriptor-tables.h> extern void protected_mode_start(void); void kmain(void) { screen_clear(); gdt_init(); protected_mode_start(); screen_write_string_at("Hello from rOSe (in protected mode!)", 0, 0); }
#include <rose/screen.h> #include <rose/stdint.h> #include <rose/descriptor-tables.h> extern void protected_mode_start(void); struct registers { uint32_t ds; uint32_t edi; uint32_t esi; uint32_t ebp; uint32_t esp; uint32_t ebx; uint32_t edx; uint32_t ecx; uint32_t eax; uint32_t...
Convert tabs to spaces and indent
#define MODULE_NAME "fish" #include <irssi-config.h> #include <common.h> #include <core/servers.h> #include <core/settings.h> #include <core/levels.h> #include <core/signals.h> #include <core/commands.h> #include <core/queries.h> #include <core/channels.h> #include <core/recode.h> #include <core/servers.h> #include <...
#define MODULE_NAME "fish" #include <irssi-config.h> #include <common.h> #include <core/servers.h> #include <core/settings.h> #include <core/levels.h> #include <core/signals.h> #include <core/commands.h> #include <core/queries.h> #include <core/channels.h> #include <core/recode.h> #include <core/servers.h> #include <...
Fix undefined GLint in Mac builds
/* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkMesaGLContext_DEFINED #define SkMesaGLContext_DEFINED #include "SkGLContext.h" #if SK_MESA class SkMesaGLContext : public SkGLContext { private: typedef intpt...
/* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkMesaGLContext_DEFINED #define SkMesaGLContext_DEFINED #include "SkGLContext.h" #if SK_MESA class SkMesaGLContext : public SkGLContext { private: typedef intpt...
Add prototype to header file for compilation to succeed if no TFLM model included in Makefile
/* * Copyright 2021 The CFU-Playground Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable l...
/* * Copyright 2021 The CFU-Playground Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable l...
Copy a constant value to a variable and print it
/* * printconst - Read a constant and print it * * Written in 2012 by Prashant P Shah <pshah.mumbai@gmail.com> * * To the extent possible under law, the author(s) have dedicated * all copyright and related and neighboring rights to this software * to the public domain worldwide. This software is distributed * ...
Implement a hash table in the kernel.
/* Copyright (c) 2021 Dennis Wölfing * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAI...
Add basic test for incomplete structs
/* name: TEST034 description: Basic test for incomplete structures output: X3 S2 x F4 I E X5 F4 foo G6 F4 main { \ X7 S2 x r X7 'P #P0 !I } G5 F4 foo { \ X3 M9 .I #I0 :I r X3 M9 .I } */ extern struct X x; int foo(); int main() { extern struct X x; return &x != 0; } struct X {int v;}; int foo() { x.v = 0; re...
Fix this test to use -cc1.
// RUN: %clang -E %s | FileCheck %s #line 21 "" int foo() { return 42; } #line 4 "bug.c" int bar() { return 21; } // CHECK: # 21 "" // CHECK: int foo() { return 42; } // CHECK: # 4 "bug.c" // CHECK: int bar() { return 21; }
// RUN: %clang_cc1 -E %s | FileCheck %s #line 21 "" int foo() { return 42; } #line 4 "bug.c" int bar() { return 21; } // CHECK: # 21 "" // CHECK: int foo() { return 42; } // CHECK: # 4 "bug.c" // CHECK: int bar() { return 21; }
Remove error from Elektra struct
/** * @file * * @brief Private declarations. * * @copyright BSD License (see doc/LICENSE.md or http://www.libelektra.org) */ #ifndef ELEKTRAPRIVATE_H #define ELEKTRAPRIVATE_H #include "kdb.h" struct _ElektraError { int errorNr; const char * msg; }; struct _Elektra { KDB * kdb; KeySet * config;...
/** * @file * * @brief Private declarations. * * @copyright BSD License (see doc/LICENSE.md or http://www.libelektra.org) */ #ifndef ELEKTRAPRIVATE_H #define ELEKTRAPRIVATE_H #include "kdb.h" struct _ElektraError { int errorNr; const char * msg; }; struct _Elektra { KDB * kdb; KeySet * config;...
Use "" instead of <> for local includes
/*! NFmiDictionaryFunction.h * Tämä on Editorin käyttämä sana kirja funktio. * Kieli versiot stringeihin tulevat täältä. */ #ifndef NFMIDICTIONARYFUNCTION_H #define NFMIDICTIONARYFUNCTION_H #include <NFmiSettings.h> // HUOM! Tämä on kopio NFmiEditMapGeneralDataDoc-luokan metodista, kun en voinut antaa tänne // ...
/*! NFmiDictionaryFunction.h * Tämä on Editorin käyttämä sana kirja funktio. * Kieli versiot stringeihin tulevat täältä. */ #ifndef NFMIDICTIONARYFUNCTION_H #define NFMIDICTIONARYFUNCTION_H #include "NFmiSettings.h" // HUOM! Tämä on kopio NFmiEditMapGeneralDataDoc-luokan metodista, kun en voinut antaa tänne // ...
ADD : Class implementing an Event storing a pointer to a itk::ProcessObject and a string describing it.
/*========================================================================= Program: ORFEO Toolbox Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. See OTBCopyright.txt for details. This software is distributed WITHOUT ...
Make sure we include M_PI, and if the system does not define it for us, we'll give it our best shot.
/*** * @file mlpack_core.h * * Include all of the base components required to write MLPACK methods. */ #ifndef __MLPACK_CORE_H #define __MLPACK_CORE_H // First, standard includes. #include <stdlib.h> #include <stdio.h> #include <string.h> #include <ctype.h> #include <cmath> #include <math.h> #include <limits.h> #i...
/*** * @file mlpack_core.h * * Include all of the base components required to write MLPACK methods. */ #ifndef __MLPACK_CORE_H #define __MLPACK_CORE_H // First, standard includes. #include <stdlib.h> #include <stdio.h> #include <string.h> #include <ctype.h> #include <limits.h> #include <float.h> #include <stdint.h...
Add fields to the plugin struct
#if !defined(_INTELLIBOT_H) #define _INTELLIBOT_H #include <sys/types.h> #include <time.h> #include "queue.h" #include "sock.h" struct _intellibot; struct _server; struct _plugin; struct _plugin_ctx; struct _queue; #define SOCK_FLAG_DISCONNECTED 0 #define SOCK_FLAG_CONNECTED 1 #define SOCK_FLAG_REGISTERED 2 typede...
#if !defined(_INTELLIBOT_H) #define _INTELLIBOT_H #include <sys/types.h> #include <time.h> #include "queue.h" #include "sock.h" struct _intellibot; struct _server; struct _plugin; struct _plugin_ctx; struct _queue; #define SOCK_FLAG_DISCONNECTED 0 #define SOCK_FLAG_CONNECTED 1 #define SOCK_FLAG_REGISTERED 2 typede...
Modify sim-hab so that the digital inputs are accounted for.
#include "sim-hab.h" #include <stdlib.h> int poll_arduino() { char response[256]; uint32_t content; bionet_resource_t *res; bionet_node_t *node; node = bionet_hab_get_node_by_index(hab, 0); // send command 100. requests analog0's value // read value and set resource arduino_write(...
#include "sim-hab.h" #include <stdlib.h> int poll_arduino() { char response[256]; uint32_t content; bionet_resource_t *res; bionet_node_t *node; node = bionet_hab_get_node_by_index(hab, 0); // send command 100. requests analog0's value // read value and set resource arduino_write(...
Add static function to convert NPN strings to an enum.
// Copyright (c) 2006-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_SOCKET_SSL_CLIENT_SOCKET_H_ #define NET_SOCKET_SSL_CLIENT_SOCKET_H_ #include "net/socket/client_socket.h" namespace net { class SS...
// Copyright (c) 2006-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_SOCKET_SSL_CLIENT_SOCKET_H_ #define NET_SOCKET_SSL_CLIENT_SOCKET_H_ #include "net/socket/client_socket.h" namespace net { class SS...
Fix SDLProtocol delegate table being released too early
// SDLAbstractProtocol.h // @class SDLAbstractTransport; @class SDLRPCMessage; @class SDLRPCRequest; #import "SDLProtocolListener.h" #import "SDLTransportDelegate.h" @interface SDLAbstractProtocol : NSObject <SDLTransportDelegate> @property (strong) NSString *debugConsoleGroupName; @property (weak) SDLAbstractTra...
// SDLAbstractProtocol.h // @class SDLAbstractTransport; @class SDLRPCMessage; @class SDLRPCRequest; #import "SDLProtocolListener.h" #import "SDLTransportDelegate.h" @interface SDLAbstractProtocol : NSObject <SDLTransportDelegate> @property (strong) NSString *debugConsoleGroupName; @property (weak) SDLAbstractTra...
Solve Collectable Cards in c
#include <stdint.h> #include <stdio.h> int gcd(int a, int b) { int32_t x; while (b > 0) { x = b; b = a % b; a = x; } return a; } int main() { int32_t n, a, b; scanf("%d", &n); while (n--) { scanf("%d %d", &a, &b); printf("%d\n", gcd(a, b)); ...
Fix os_SUITE compilation issue on win32
#ifdef __WIN32__ #include <windows.h> int wmain(int argc, wchar_t **argv) { char* sep = ""; int len; /* * Echo all arguments separated with '::', so that we can check that * quotes are interpreted correctly. */ while (argc-- > 1) { char *utf8; len = WideCharToMultiByte(CP_UTF8, 0, ar...
#include <stdio.h> #ifdef __WIN32__ #include <windows.h> int wmain(int argc, wchar_t **argv) { char* sep = ""; int len; /* * Echo all arguments separated with '::', so that we can check that * quotes are interpreted correctly. */ while (argc-- > 1) { char *utf8; len = WideCharToMulti...
FIX duplicate includes of GraphicsHandler
#ifndef SSPAPPLICATION_COMPONENTHANDLER_H #define SSPAPPLICATION_COMPONENTHANDLER_H #include "../GraphicsDLL/GraphicsHandler.h" //#include "ComponentStructs.h" #include "../GraphicsDLL/GraphicsHandler.h" #include "../physicsDLL/PhysicsHandler.h" #include "../AIDLL/AIHandler.h" class ComponentHandler { private: Graph...
#ifndef SSPAPPLICATION_COMPONENTHANDLER_H #define SSPAPPLICATION_COMPONENTHANDLER_H //#include "ComponentStructs.h" #include "../GraphicsDLL/GraphicsHandler.h" #include "../physicsDLL/PhysicsHandler.h" #include "../AIDLL/AIHandler.h" class ComponentHandler { private: GraphicsHandler* m_graphicsHandler; PhysicsHandl...
Fix implicit conversion warning when building with floating point Lua
/** * \file string_hash.c * \brief Computes a hash value for a string. * \author Copyright (c) 2012-2014 Jason Perkins and the Premake project */ #include "premake.h" #include <string.h> int string_hash(lua_State* L) { const char* str = luaL_checkstring(L, 1); unsigned long seed = luaL_optint(L, 2, 0); lua...
/** * \file string_hash.c * \brief Computes a hash value for a string. * \author Copyright (c) 2012-2014 Jason Perkins and the Premake project */ #include "premake.h" #include <string.h> int string_hash(lua_State* L) { const char* str = luaL_checkstring(L, 1); unsigned long seed = luaL_optint(L, 2, 0); lua...
Add test case for PR 3675.
// RUN: clang -verify %s // // This example was reduced from actual code in Wine 1.1.13. GCC accepts this // code, while the correct behavior is to reject it. // typedef struct _IRP { union { struct { union {} u; // expected-note{{previous declaration is here}} struct { union {} u; // expect...
Use clang-cc in this test.
// RUN: clang -ccc-host-triple armv6-unknown-unknown -emit-llvm -S -o %t %s void test0(void) { asm volatile("mov r0, r0" :: ); } void test1(void) { asm volatile("mov r0, r0" ::: "cc", "memory" ); } void test2(void) { asm volatile("mov r0, r0" ::: "r0", "r1", "r2", "r3"); asm volatile("mov r0, r0" ::: ...
// RUN: clang-cc -triple armv6-unknown-unknown -emit-llvm -o %t %s void test0(void) { asm volatile("mov r0, r0" :: ); } void test1(void) { asm volatile("mov r0, r0" ::: "cc", "memory" ); } void test2(void) { asm volatile("mov r0, r0" ::: "r0", "r1", "r2", "r3"); asm volatile("mov r0, r0" ::: "r4", "...
Define ODP_THREAD_WORKER and ODP_THREAD_CONTROL for odp versions < 102.
/* Copyright (c) 2015, ENEA Software AB * Copyright (c) 2015, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #if ODP_VERSION < 105 typedef uint64_t odp_time_t; #endif /* ODP_VERSION < 105 */ #if ODP_VERSION < 104 && ODP_VERSION > 101 #define odp_cpumask_default_worker(cpumask, num_...
/* Copyright (c) 2015, ENEA Software AB * Copyright (c) 2015, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #if ODP_VERSION < 105 typedef uint64_t odp_time_t; #endif /* ODP_VERSION < 105 */ #if ODP_VERSION < 104 && ODP_VERSION > 101 #define odp_cpumask_default_worker(cpumask, num_...
Add "equal to" operator to Vector3
#pragma once template <typename T> class Vector3 { public: T x, y, z; Vector3(T x, T y, T z) { this->x = x; this->y = y; this->z = z; } Vector3() : Vector3(0, 0, 0) { } T &operator[](unsigned i) { return (&x)[i]; } }; static_assert(sizeof(Vector3<float>) == 12); template <typename T> class Vecto...
#pragma once template <typename T> class Vector3 { public: T x, y, z; Vector3(T x, T y, T z) { this->x = x; this->y = y; this->z = z; } Vector3() : Vector3(0, 0, 0) { } T &operator[](unsigned i) { return (&x)[i]; } bool operator==(const Vector3 &v) const { return x == v.x && y == v.y && z == ...
Add test of clone syscall with CLONE_THREAD
#define _GNU_SOURCE #include <stdio.h> #include <unistd.h> #include <sched.h> #include <stdlib.h> #define CHILD_STACK_SIZE 16384 int variable; int do_something() { printf("Running...\n"); variable = 1337; _exit(0); } int main(int argc, char *argv[]) { char *child_stack; char *child_stack_top; chi...
Add lazy property synthesis directives
// // SMRPreprocessor.h // MicroReasoner // // Created by Ivano Bilenchi on 05/05/16. // Copyright © 2016 SisInf Lab. All rights reserved. // #ifndef SMRPreprocessor_h #define SMRPreprocessor_h // Pseudo-abstract class convenience macros. #define ABSTRACT_METHOD {\ @throw [NSException exceptionWithName:NSInterna...
// // SMRPreprocessor.h // MicroReasoner // // Created by Ivano Bilenchi on 05/05/16. // Copyright © 2016 SisInf Lab. All rights reserved. // #ifndef SMRPreprocessor_h #define SMRPreprocessor_h /** * Use this directive to mark method implementations that should be overridden * by concrete subclasses. */ #defin...
Test case for r154451 (redefining system functions).
// RUN: %clang_cc1 -analyze -analyzer-checker=unix,core,experimental.security.taint -w -verify %s // Make sure we don't crash when someone redefines a system function we reason about. char memmove (); char malloc(); char system(); char stdin(); char memccpy(); char free(); char strdup(); char atoi(); int foo () { ...
Remove old UIContext class declaration
#pragma once #include <Windows.h> #include <unordered_map> #include "../Controls/Control.h" #include "../Controls/Controls.h" class UIContext; #define INIT_CONTROL(ctrlId, ctrlType, var) { \ var = ctrlType(ctrlId, _hWnd); \ _controlMap[ctrlId] = &var; \ } /// <summary> /// Abstract class that encapsulates ...
#pragma once #include <Windows.h> #include <unordered_map> #include "../Controls/Control.h" #include "../Controls/Controls.h" #define INIT_CONTROL(ctrlId, ctrlType, var) { \ var = ctrlType(ctrlId, _hWnd); \ _controlMap[ctrlId] = &var; \ } /// <summary> /// Abstract class that encapsulates functionality for ...
Add separate header for stream operators.
#pragma once #include "jwt.h" #include <ostream> namespace JWTXX { std::ostream& operator<<(std::ostream& stream, const Algorithm& alg) { stream << algToString(alg); return stream; } }