Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Tweak test to at least use a standard arch, to ensure we try to invoke Clang.
// Check that --sysroot= also applies to header search paths. // RUN: %clang -ccc-host-triple unknown --sysroot=/FOO -### -E %s 2> %t1 // RUN: FileCheck --check-prefix=CHECK-SYSROOTEQ < %t1 %s // CHECK-SYSROOTEQ: "-cc1"{{.*}} "-isysroot" "/FOO" // Apple Darwin uses -isysroot as the syslib root, too. // RUN: touch %t2....
// Check that --sysroot= also applies to header search paths. // RUN: %clang -ccc-host-triple i386-unk-unk --sysroot=/FOO -### -E %s 2> %t1 // RUN: FileCheck --check-prefix=CHECK-SYSROOTEQ < %t1 %s // CHECK-SYSROOTEQ: "-cc1"{{.*}} "-isysroot" "/FOO" // Apple Darwin uses -isysroot as the syslib root, too. // RUN: touch...
Add more typedef in 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...
Fix compiler warning in Xcode 9
/* OLEContainerScrollView Copyright (c) 2014 Ole Begemann. https://github.com/ole/OLEContainerScrollView */ void swizzleUICollectionViewLayoutFinalizeCollectionViewUpdates(); void swizzleUITableView();
/* OLEContainerScrollView Copyright (c) 2014 Ole Begemann. https://github.com/ole/OLEContainerScrollView */ void swizzleUICollectionViewLayoutFinalizeCollectionViewUpdates(void); void swizzleUITableView(void);
Remove function declarations from header
// // INVector3.h // DominantColor // // Created by Indragie on 12/21/14. // Copyright (c) 2014 Indragie Karunaratne. All rights reserved. // #import <GLKit/GLKit.h> // Wrapping GLKVector3 values in a struct so that it can be used from Swift. typedef struct { float x; float y; float z; } INVector3; ...
// // INVector3.h // DominantColor // // Created by Indragie on 12/21/14. // Copyright (c) 2014 Indragie Karunaratne. All rights reserved. // #import <GLKit/GLKit.h> // Wrapping GLKVector3 values in a struct so that it can be used from Swift. typedef struct { float x; float y; float z; } INVector3; ...
Add surface server side implementation for tests
/* * This file is part of meego-im-framework * * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * Contact: Nokia Corporation (directui@nokia.com) * * If you have questions regarding the use of this file, please contact * Nokia at directui@nokia.com. * * This library ...
/* * This file is part of meego-im-framework * * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * Contact: Nokia Corporation (directui@nokia.com) * * If you have questions regarding the use of this file, please contact * Nokia at directui@nokia.com. * * This library ...
Set correct name for boost IPC
#ifndef QTIPCSERVER_H #define QTIPCSERVER_H // Define Bitcoin-Qt message queue name #define BITCOINURI_QUEUE_NAME "BitcoinURI" void ipcScanRelay(int argc, char *argv[]); void ipcInit(int argc, char *argv[]); #endif // QTIPCSERVER_H
#ifndef QTIPCSERVER_H #define QTIPCSERVER_H // Define Bitcoin-Qt message queue name #define BITCOINURI_QUEUE_NAME "NovaCoinURI" void ipcScanRelay(int argc, char *argv[]); void ipcInit(int argc, char *argv[]); #endif // QTIPCSERVER_H
Clean up the sample include orderings, not that it really matters...
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "sample.h" int main (int argc, char ** argv) { printf ("%d\n", compute_sample (5)); exit (0); }
#include "sample.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main (int argc, char ** argv) { printf ("%d\n", compute_sample (5)); exit (0); }
Fix testcase for 64-bit systems.
// RUN: clang -emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis | grep "ret i32 1" | count 3 // <rdr://6115726> int f0() { int x; unsigned short n = 1; int *a = &x; int *b = &x; a = a - n; b -= n; return a == b; } int f1(int *a) { int b = a - (int*) 1; a -= (int*) 1; return b == (int) a; } ...
// RUN: clang -emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis | grep "ret i32 1" | count 3 // <rdr://6115726> int f0() { int x; unsigned short n = 1; int *a = &x; int *b = &x; a = a - n; b -= n; return a == b; } int f1(int *a) { long b = a - (int*) 1; a -= (int*) 1; return b == (long) a; ...
Add a basic interface for calcterm
typedef CI_Config void*; CI_Result CI_submit(char const* input);
/* * C Interface between calcterm and a calculator. * A shared library must implement this interface * to be loadable by calcterm. */ extern "C" { struct CI_Config { int flag; }; struct CI_Result { char* one_line; char** grid; int y; }; void CI_init( CI_Config* config ); CI_Result* ...
Remove dependency on npcx specific registers
/* Copyright 2020 The Chromium OS 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 __ZEPHYR_CHROME_I2C_MAP_H #define __ZEPHYR_CHROME_I2C_MAP_H #include <devicetree.h> #include "config.h" /* We need registers.h to get th...
/* Copyright 2020 The Chromium OS 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 __ZEPHYR_CHROME_I2C_MAP_H #define __ZEPHYR_CHROME_I2C_MAP_H #include <devicetree.h> #include "config.h" /* We need registers.h to get th...
Add RDA5981x D_SRAM for heap usage, test program also attached
#include <tinyara/config.h> #include <tinyara/kmalloc.h> /**************************************************************************** * Name: up_addregion * * Description: * Memory may be added in non-contiguous chunks. Additional chunks are * added by calling this function. * ****************************...
UPDATE defined start without menu
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #define SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #include "GameState.h" #include "StartState.h" #include "LevelSelectState.h" #include <vector> //#define START_WITHOUT_MENU class GameStateHandler { private: std::vector<GameState*> m_stateStack; std::vector<Ga...
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #define SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #include "GameState.h" #include "StartState.h" #include "LevelSelectState.h" #include <vector> #define START_WITHOUT_MENU class GameStateHandler { private: std::vector<GameState*> m_stateStack; std::vector<Game...
Fix exit issue on Vista/Win7Atom
/* * Copyright 2011 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can * be found in the LICENSE file. */ #include <stdlib.h> #include "native_client/src/include/portability.h" #include "native_client/src/shared/platform/nacl_exit.h" #include "nat...
/* * Copyright 2011 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can * be found in the LICENSE file. */ #include <stdlib.h> #include <stdio.h> #include "native_client/src/include/portability.h" #include "native_client/src/shared/platform/nacl_ex...
Change the type of callId property
#import <Foundation/Foundation.h> /** STWServiceCall is the domain model class which represents the Straw Service Call from Browser. */ @interface STWServiceCall : NSObject /** Service name to call */ @property (nonatomic, retain) NSString *service; /** Service Method name to call */ @property (nonatomic, retai...
#import <Foundation/Foundation.h> /** STWServiceCall is the domain model class which represents the Straw Service Call from Browser. */ @interface STWServiceCall : NSObject /** Service name to call */ @property (nonatomic, retain) NSString *service; /** Service Method name to call */ @property (nonatomic, retai...
Update Skia milestone to 76
/* * 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 75 #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 76 #endif
Fix wrong header for sourceOfSendToCallbacksForKey
// // BFTaskCenter.h // Pods // // Created by Superbil on 2015/8/22. // // #import <Foundation/Foundation.h> #import "Bolts.h" @interface BFTaskCenter : NSObject + (nonnull instancetype)defaultCenter; - (nullable id)addTaskBlockToCallbacks:(nonnull BFContinuationBlock)taskBlock forKey:(nonnull NSString *)key; - ...
// // BFTaskCenter.h // Pods // // Created by Superbil on 2015/8/22. // // #import "Bolts.h" @interface BFTaskCenter : NSObject + (nonnull instancetype)defaultCenter; - (nullable id)addTaskBlockToCallbacks:(nonnull BFContinuationBlock)taskBlock forKey:(nonnull NSString *)key; - (void)removeTaskBlock:(nonnull id)...
Fix lint error, whitespace around &&
#pragma once #ifndef YOU_DATASTORE_DATASTORE_H_ #define YOU_DATASTORE_DATASTORE_H_ #include <deque> #include <functional> #include "boost/variant.hpp" #include "task_typedefs.h" #include "internal/operation.h" #include "transaction.h" namespace You { namespace DataStore { namespace UnitTests {} class DataStore { pub...
#pragma once #ifndef YOU_DATASTORE_DATASTORE_H_ #define YOU_DATASTORE_DATASTORE_H_ #include <deque> #include <functional> #include "boost/variant.hpp" #include "task_typedefs.h" #include "internal/operation.h" #include "transaction.h" namespace You { namespace DataStore { namespace UnitTests {} class DataStore { pub...
Add unify combine substitute stubs
#pragma once #include <boost/variant.hpp> #include <atomic> #include <vector> namespace grml { enum class BasicType { INT, BOOL, REAL }; struct TypeVariable { int64_t id; TypeVariable() : id(counter++) {} TypeVariable(int64_t i) : id(i) {} ...
#pragma once #include <boost/variant.hpp> #include <atomic> #include <vector> #include <unordered_map> namespace grml { enum class BasicType { INT, BOOL, REAL }; struct TypeVariable { int64_t id; TypeVariable() : id(counter++) {} TypeVariable(int64...
Add the class 'CMDLINE'. So the user is able to change default setting.
#ifndef CMDLINE_H #define CMDLINE_H typedef struct cmdOptions{ int populationSize; int geneSize; }cmdoptions_t; class CMDLINE { int argc; char *argv[]; public: CMDLINE (int, char**); // Constructor int parseCommandLine(cmdoptions_t *CMDoptions); private: // Function like help and version int help(...
Exit with a code in debug builds
#include <arch/x64/port.h> #include <truth/panic.h> #define TEST_RESULT_PORT_NUMBER 0xf4 void test_shutdown_status(enum status status) { logf(Log_Debug, "Test shutting down with status %s (%d)\n", status_message(status), status); write_port(status, TEST_RESULT_PORT_NUMBER); halt(); assert(Not_Reached)...
#include <arch/x64/port.h> #include <truth/panic.h> #define Test_Result_Port_Number 0xf4 void test_shutdown_status(enum status status) { logf(Log_Debug, "Test shutting down with status %s (%d)\n", status_message(status), status); write_port(status, Test_Result_Port_Number); }
Clean up some debugging cruft.
#include <errno.h> #include <signal.h> #include <string.h> #include <unistd.h> #include <stdbool.h> #include <arpa/inet.h> #include <netinet/in.h> #include <sys/socket.h> #include <sys/types.h> #include <glib.h> #include "td-radio.h" #include "td-radio-scan.h" /* * Send the RESPONDER message to the radio. */ in...
#include <errno.h> #include <signal.h> #include <string.h> #include <unistd.h> #include <stdbool.h> #include <arpa/inet.h> #include <netinet/in.h> #include <sys/socket.h> #include <sys/types.h> #include <glib.h> #include "td-radio.h" #include "td-radio-scan.h" /* * Send the RESPONDER message to the radio. */ in...
Make everything work on linux again
#define ASSERT(x) \ do{ \ if(!(x)){ \ printf("failed assert (%d): %s\n", __LINE__, #x); \ exit(1); \ }\ }while(0) #define INIT_SOCKETS_FOR_WINDOWS \ { \ WSADATA out; \ WSAStartup(MAKEWORD(2,2), &out); \ }
#include <stdlib.h> #define ASSERT(x) \ do{ \ if(!(x)){ \ printf("failed assert (%d): %s\n", __LINE__, #x); \ exit(1); \ }\ }while(0) #ifdef _WIN32 #define INIT_SOCKETS_FOR_WINDOWS \ do{ \ WSADATA out; \ WSAStartup(MAKEWORD(2,2), &out)...
Set the header protection to end with _H.
#ifndef RANDOM_HAO #define RANDOM_HAO #define SIMPLE_SPRNG #ifdef MPI_HAO #include <mpi.h> #define USE_MPI #endif #include "sprng.h" void random_hao_init(int seed=985456376, int gtype=1); double uniform_hao(); double gaussian_hao(); #endif
#ifndef RANDOM_HAO_H #define RANDOM_HAO_H #define SIMPLE_SPRNG #ifdef MPI_HAO #include <mpi.h> #define USE_MPI #endif #include "sprng.h" void random_hao_init(int seed=985456376, int gtype=1); double uniform_hao(); double gaussian_hao(); #endif
Fix PROV_RC5_CTX's original structure name
/* * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/l...
/* * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/l...
Add a JsonNode copy test unit
#include <glib/gtestutils.h> #include <json-glib/json-types.h> #include <string.h> static void test_null (void) { JsonNode *node = json_node_new (JSON_NODE_NULL); g_assert_cmpint (node->type, ==, JSON_NODE_NULL); g_assert_cmpint (json_node_get_value_type (node), ==, G_TYPE_INVALID); g_assert_cmpstr (json_node...
#include <glib/gtestutils.h> #include <json-glib/json-types.h> #include <string.h> static void test_copy (void) { JsonNode *node = json_node_new (JSON_NODE_NULL); JsonNode *copy = json_node_copy (node); g_assert_cmpint (node->type, ==, copy->type); g_assert_cmpint (json_node_get_value_type (node), ==, json_no...
Fix build of libc.so after r232620. This caused a duplicate definition of __getCurrentRuneLocale().
#include <sys/cdefs.h> __FBSDID("$FreeBSD$"); /* * Tell <ctype.h> to generate extern versions of all its inline * functions. The extern versions get called if the system doesn't * support inlines or the user defines _DONT_USE_CTYPE_INLINE_ * before including <ctype.h>. */ #define _EXTERNALIZE_CTYPE_INLINES_ #in...
#include <sys/cdefs.h> __FBSDID("$FreeBSD$"); /* * Tell <ctype.h> to generate extern versions of all its inline * functions. The extern versions get called if the system doesn't * support inlines or the user defines _DONT_USE_CTYPE_INLINE_ * before including <ctype.h>. */ #define _EXTERNALIZE_CTYPE_INLINES_ /* ...
Add vh_json_get in the API
/* * GeeXboX Valhalla: tiny media scanner API. * Copyright (C) 2016 Mathieu Schroeter <mathieu@schroetersa.ch> * * This file is part of libvalhalla. * * libvalhalla is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free So...
/* * GeeXboX Valhalla: tiny media scanner API. * Copyright (C) 2016 Mathieu Schroeter <mathieu@schroetersa.ch> * * This file is part of libvalhalla. * * libvalhalla is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free So...
Add flags success and willRetry to ResponseData
// // AIResponseData.h // AdjustIo // // Created by Christian Wellenbrock on 07.02.14. // Copyright (c) 2014 adeven. All rights reserved. // typedef enum { AIActivityKindUnknown = 0, AIActivityKindSession = 1, AIActivityKindEvent = 2, AIActivityKindRevenue = 3, // only possible when server c...
// // AIResponseData.h // AdjustIo // // Created by Christian Wellenbrock on 07.02.14. // Copyright (c) 2014 adeven. All rights reserved. // typedef enum { AIActivityKindUnknown = 0, AIActivityKindSession = 1, AIActivityKindEvent = 2, AIActivityKindRevenue = 3, // only possible when server c...
Add testcase that illustrates the problem from r69699 regarding tentative definitions of statics
// RUN: clang-cc -emit-llvm -o %t %s && // RUN: grep '@r = common global \[1 x .*\] zeroinitializer' %t && int r[]; int (*a)[] = &r; struct s0; struct s0 x; // RUN: grep '@x = common global .struct.s0 zeroinitializer' %t && struct s0 y; // RUN: grep '@y = common global .struct.s0 zeroinitializer' %t && struct s0 *f...
// RUN: clang-cc -emit-llvm -o %t %s && // RUN: grep '@r = common global \[1 x .*\] zeroinitializer' %t && int r[]; int (*a)[] = &r; struct s0; struct s0 x; // RUN: grep '@x = common global .struct.s0 zeroinitializer' %t && struct s0 y; // RUN: grep '@y = common global .struct.s0 zeroinitializer' %t && struct s0 *f...
Increment version number for 3.5 beta2.
/* resource.h KNode, the KDE newsreader Copyright (c) 1999-2005 the KNode authors. See file AUTHORS for details 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 ver...
/* resource.h KNode, the KDE newsreader Copyright (c) 1999-2005 the KNode authors. See file AUTHORS for details 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 ver...
Add SIT151 C PC3 Ex1
#include <stdio.h> typedef struct { char last_name[20]; char first_name[15]; int age; } Person; int ask() { printf("1. Add user\n"); printf("2. Quit\n"); return getchar() - 48; } Person createPerson() { Person p; printf("Last name: "); scanf("%s", p.last_name); printf("First name: "); scanf...
Add nullability specifiers to FEMMapBlock
// For License please refer to LICENSE file in the root of FastEasyMapping project #import <Foundation/Foundation.h> typedef __nullable id (^FEMMapBlock)(id value __nonnull);
// For License please refer to LICENSE file in the root of FastEasyMapping project #import <Foundation/Foundation.h> typedef __nullable id (^FEMMapBlock)(__nonnull id value);
Declare initWithDefaultValues in private category
//////////////////////////////////////////////////////////////////////////// // // TIGHTDB CONFIDENTIAL // __________________ // // [2011] - [2014] TightDB Inc // All Rights Reserved. // // NOTICE: All information contained herein is, and remains // the property of TightDB Incorporated and its suppliers, // if any. ...
//////////////////////////////////////////////////////////////////////////// // // TIGHTDB CONFIDENTIAL // __________________ // // [2011] - [2014] TightDB Inc // All Rights Reserved. // // NOTICE: All information contained herein is, and remains // the property of TightDB Incorporated and its suppliers, // if any. ...
Fix incorrect indentation in TExtensionModule struct
#ifndef SUPPORT_H #define SUPPORT_H #include <stdio.h> struct tagTModule; typedef struct tagTExtensionModule { char *module; void *handle; } TExtensionModule; typedef struct tagTExtensions { TExtensionModule *modules; size_t size; } TExtenstions; void path_initPaths(const char *source_path)...
#ifndef SUPPORT_H #define SUPPORT_H #include <stdio.h> struct tagTModule; typedef struct tagTExtensionModule { char *module; void *handle; } TExtensionModule; typedef struct tagTExtensions { TExtensionModule *modules; size_t size; } TExtenstions; void path_initPaths(const char *source_path); void p...
Fix compile error on Windows
#include "pycall_internal.h" #if defined(PYCALL_THREAD_WIN32) int pycall_tls_create(pycall_tls_key *tls_key) { *tls_key = TlsAlloc(); return *tls_key == TLS_OUT_OF_INDEXES; } void *pycall_tls_get(pycall_tls_key tls_key) { return TlsGetValue(tls_key); } int pycall_tls_set(pycall_tls_key tls_key, void *ptr) { ...
#include "pycall_internal.h" #if defined(PYCALL_THREAD_WIN32) int pycall_tls_create(pycall_tls_key *tls_key) { *tls_key = TlsAlloc(); return *tls_key == TLS_OUT_OF_INDEXES; } void *pycall_tls_get(pycall_tls_key tls_key) { return TlsGetValue(tls_key); } int pycall_tls_set(pycall_tls_key tls_key, void *ptr) { ...
Add tests for alternative timing method
#include "lib/timing.h" task main() { writeDebugStreamLine("Waiting 1 second"); resetTimeDelta(); getTimeDelta(); wait1Msec(1000); writeDebugStreamLine("delta: %d", getTimeDelta()); writeDebugStreamLine("Waiting 5 seconds"); resetTimeDelta(); getTimeDelta(); wait1Msec(5000); writeDebugStreamLine("delta: %d"...
#include "lib/timing.h" task main() { // getTimeDelta() writeDebugStreamLine("Testing getTimeDelta()"); writeDebugStreamLine("Waiting 1 second"); resetTimeDelta(); getTimeDelta(); wait1Msec(1000); writeDebugStreamLine("delta: %d", getTimeDelta()); writeDebugStreamLine("Waiting 5 seconds"); resetTimeDelta(); ...
Synchronize decl and impl of notify(…)
#import <Foundation/Foundation.h> #import <React/RCTBridgeModule.h> #if __has_include(<React/RCTBridge.h>) // React Native >= 0.40 #import <React/RCTBridge.h> #else // React Native <= 0.39 #import "RCTBridge.h" #endif @class BugsnagConfiguration; @interface BugsnagReactNative: NSObject <RCTBridgeModule> /** * Ini...
#import <Foundation/Foundation.h> #import <React/RCTBridgeModule.h> #if __has_include(<React/RCTBridge.h>) // React Native >= 0.40 #import <React/RCTBridge.h> #else // React Native <= 0.39 #import "RCTBridge.h" #endif @class BugsnagConfiguration; @interface BugsnagReactNative: NSObject <RCTBridgeModule> /** * Ini...
Fix warning during dictionary generation in no-imt builds
#ifdef __CLING__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; // Only for the autoload, autoparse. No IO of these classes is foreseen! #pragma link C++ class ROOT::Internal::TPoolManager-; #pragma link C++ class ROOT::TThreadExecutor-; #pragma link C++ class ROOT::Experi...
#ifdef __CLING__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; // Only for the autoload, autoparse. No IO of these classes is foreseen! // Exclude in case ROOT does not have IMT support #ifdef R__USE_IMT #pragma link C++ class ROOT::Internal::TPoolManager-; #pragma link C...
Adjust default max tip age
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Copyright (c) 2014-2017 The Dash Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_VALIDATION_H ...
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Copyright (c) 2014-2017 The Dash Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_VALIDATION_H ...
Add comment about thread safety.
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "isequencedtaskexecutor.h" #include <vector> namespace vespalib { struct ExecutorStats; class SyncableThreadExecutor; } namespace search { /** * Class to run multiple...
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "isequencedtaskexecutor.h" #include <vector> namespace vespalib { struct ExecutorStats; class SyncableThreadExecutor; } namespace search { /** * Class to run multiple...
Check return value of pclose()
/* See LICENSE file for copyright and license details. */ #include <errno.h> #include <stdio.h> #include <string.h> #include "../util.h" const char * run_command(const char *cmd) { char *p; FILE *fp; if (!(fp = popen(cmd, "r"))) { warn("popen '%s':", cmd); return NULL; } p = fgets(buf, sizeof(buf) - 1, fp);...
/* See LICENSE file for copyright and license details. */ #include <errno.h> #include <stdio.h> #include <string.h> #include "../util.h" const char * run_command(const char *cmd) { char *p; FILE *fp; if (!(fp = popen(cmd, "r"))) { warn("popen '%s':", cmd); return NULL; } p = fgets(buf, sizeof(buf) - 1, fp);...
Add comment explaining impact of option in test case
// PARAM: --enable annotation.int.enabled #include <stdlib.h> #include <goblint.h> struct slotvec { size_t size ; char *val ; }; static char slot0[256] ; static struct slotvec slotvec0 = {sizeof(slot0), slot0}; static void install_signal_handlers(void) { { if(!(slotvec0.val == & slot0[0LL])) { reach_error(); ...
// PARAM: --enable annotation.int.enabled // This option enables ALL int domains for globals #include <stdlib.h> #include <goblint.h> struct slotvec { size_t size ; char *val ; }; static char slot0[256] ; static struct slotvec slotvec0 = {sizeof(slot0), slot0}; static void install_signal_handlers(void) { { if(...
Implement faster natural log function
#include <pal.h> /** * * Calculates the natural logarithm of 'a', (where the base is 'e'=2.71828) * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @param p Number of processor to use (task parallelism) * * @param team T...
#include <pal.h> /** * * Calculates the natural logarithm of 'a', (where the base is 'e'=2.71828) * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @param p Number of processor to use (task parallelism) * * @param team T...
Remove unused fprintf arg; add comment on _wtoi
#include <stdlib.h> #include <stdio.h> #include <errno.h> #include <windows.h> #define URL "https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505\ (v=vs.85).aspx" #define VERSION "0.1.0" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR lpCmdLine, int nShowCmd) { ...
#include <stdlib.h> #include <stdio.h> #include <errno.h> #include <windows.h> #define URL "https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505\ (v=vs.85).aspx" #define VERSION "0.1.0" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR lpCmdLine, int nShowCmd) { ...
Support comparing Datums against Atoms.
#ifndef DATUM_H #define DATUM_H #include "hexutil/basics/atom.h" // The variant must be wrapped like this, otherwise the compiler will get confused about which overload to use struct Datum { Datum(): value(0) { } Datum(int x): value(x) { } boost::variant<Atom, int, float, std::string> value; Datum&...
#ifndef DATUM_H #define DATUM_H #include "hexutil/basics/atom.h" // The variant must be wrapped like this, otherwise the compiler will get confused about which overload to use struct Datum { Datum(): value(0) { } Datum(int x): value(x) { } Datum(const std::string& x): value(x) { } boost::variant<Ato...
Create IR adaptor for sparta interprocedural facilities
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include "Analyzer.h" #include "CallGraph.h" #include "DexClass.h" #include "MonotonicFixpointIterator.h" namespace ...
Add in check to ensure all elements are included.
#include <stdio.h> #include "main.h" int main() { printf("Test goes here.\n"); }
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include "rtree.h" #include "minunit.h" #include "main.h" int tests_run = 0; static char *test_all_kept() { for (int count = 0; count < 1000; count++) { rtree_t *rt = rtree_create(); for (uintptr_t i = 0; i < count; i++) { rtree_add(rt, (void ...
Change STOv1 fee per recipient to 0.00001000 OMNI
#ifndef OMNICORE_STO_H #define OMNICORE_STO_H #include <stdint.h> #include <set> #include <string> #include <utility> namespace mastercore { //! Comparator for owner/receiver entries struct SendToOwners_compare { bool operator()(const std::pair<int64_t, std::string>& p1, const std::pair<int64_t, std::string>& p2)...
#ifndef OMNICORE_STO_H #define OMNICORE_STO_H #include <stdint.h> #include <set> #include <string> #include <utility> namespace mastercore { //! Comparator for owner/receiver entries struct SendToOwners_compare { bool operator()(const std::pair<int64_t, std::string>& p1, const std::pair<int64_t, std::string>& p2)...
Use Id instead of Header.
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* hack.version.c - version 1.0.3 */ /* $Header: hack.version.c,v 1.5 85/05/09 00:40:41 aeb Exp $ */ #include "date.h" doversion(){ pline("%s 1.0.3 - last edit %s.", ( #ifdef QUEST "Quest" #else "Hack" #endif QUEST ), datestring); return(0);...
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* hack.version.c - version 1.0.3 */ /* $Id$ */ #include "date.h" doversion(){ pline("%s 1.0.3 - last edit %s.", ( #ifdef QUEST "Quest" #else "Hack" #endif QUEST ), datestring); return(0); }
Adjust this test for recent llvm-gcc changes.
// RUN: %llvmgcc -S %s -o - | grep {getelementptr i32} extern void f(int *); int e(int m, int n) { int x[n]; f(x); return x[m]; }
// RUN: %llvmgcc -S %s -o - | grep {getelementptr \\\[0 x i32\\\]} extern void f(int *); int e(int m, int n) { int x[n]; f(x); return x[m]; }
Include nearby object protocol file
// // NearbyObjectProtocol.h // ARIS // // Created by Brian Deith on 5/15/09. // Copyright 2009 __MyCompanyName__. All rights reserved. // enum { NearbyObjectNPC = 1, NearbyObjectItem = 2, NearbyObjectNode = 3 }; typedef UInt32 nearbyObjectKind; @protocol NearbyObjectProtocol - (NSString *)name; - (nearb...
Add functions to buld X86 specific constructs
//===-- X86InstrBuilder.h - Functions to aid building x86 insts -*- C++ -*-===// // // This file exposes functions that may be used with BuildMI from the // MachineInstrBuilder.h file to handle X86'isms in a clean way. // // The BuildMem function may be used with the BuildMI function to add entire // memory references ...
Check for control garbage before http garbage, httpd isn't detecting control garbage because it has http whitelisted
#include <kernel/kernel.h> #include <kotaka/paths/account.h> static int is_control_garbage(string input) { if (strlen(input) >= 1 && input[0] < ' ') { return 1; } return 0; } static int is_http_garbage(string input) { if (strlen(input) >= 4 && input[0 .. 3] == "GET ") { return 1; } return 0; } static str...
#include <kernel/kernel.h> #include <kotaka/paths/account.h> static int is_control_garbage(string input) { if (strlen(input) >= 1 && input[0] < ' ') { return 1; } return 0; } static int is_http_garbage(string input) { if (strlen(input) >= 4 && input[0 .. 3] == "GET ") { return 1; } return 0; } static str...
Add first parameter to get_cpuid definition.
#pragma once #include <stdint.h> #include <cpuid.h> #define cpu_equals(name) __builtin_cpu_is(name) #define cpu_supports(feature) __builtin_cpu_supports(feature) #define get_cpuid(a, b, c, d) __get_cpuid(0, a, b, c, d) typedef struct regs { uint32_t gs, fs, es, ds; uint32_t edi, esi, ebp, esp, ebx, edx, ecx,...
#pragma once #include <stdint.h> #include <cpuid.h> #define cpu_equals(name) __builtin_cpu_is(name) #define cpu_supports(feature) __builtin_cpu_supports(feature) #define get_cpuid(in, a, b, c, d) __get_cpuid(in, a, b, c, d) typedef struct regs { uint32_t gs, fs, es, ds; uint32_t edi, esi, ebp, esp, ebx, edx,...
Update RingRayLib - raylib.c - Add Function : bool WindowShouldClose(void)
/* Copyright (c) 2019 Mahmoud Fayed <msfclipper@yahoo.com> */ #define RING_EXTENSION // Don't call : windows.h (Avoid conflict with raylib.h) #include <ring.h> #include <raylib.h> RING_FUNC(ring_InitWindow) { if ( RING_API_PARACOUNT != 3 ) { RING_API_ERROR(RING_API_MISS3PARA); return ; } if ( ! RING_API_ISNU...
/* Copyright (c) 2019 Mahmoud Fayed <msfclipper@yahoo.com> */ #define RING_EXTENSION // Don't call : windows.h (Avoid conflict with raylib.h) #include <ring.h> #include <raylib.h> RING_FUNC(ring_InitWindow) { if ( RING_API_PARACOUNT != 3 ) { RING_API_ERROR(RING_API_MISS3PARA); return ; } if ( ! RING_API_ISNU...
Add tiny rng for volume control
uint32_t _rng_state = millis() void init_rng() { _rng_state = 75380540 - millis() for (int i=0; i<100; i++) tiny_prng() } uint32_t tiny_prng() { uint32_t x = _rng_state; x ^= x << 13; x ^= x >> 17; x ^= x << 5; _rng_state = x; return x; }
Add functions, headers & description
/* MIT License Copyright (c) 2017 ZeroUnix 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, pu...
Create Vertex struct to hold vertex info
/* The Halfling Project - A Graphics Engine and Projects * * The Halfling Project is the legal property of Adrian Astley * Copyright Adrian Astley 2013 */ #ifndef CRATE_DEMO_GRAPHICS_MANAGER_H #define CRATE_DEMO_GRAPHICS_MANAGER_H #include "common/graphics_manager_base.h" #include <d3d11.h> namespace CrateDemo ...
/* The Halfling Project - A Graphics Engine and Projects * * The Halfling Project is the legal property of Adrian Astley * Copyright Adrian Astley 2013 */ #ifndef CRATE_DEMO_GRAPHICS_MANAGER_H #define CRATE_DEMO_GRAPHICS_MANAGER_H #include "common/graphics_manager_base.h" #include <d3d11.h> #include "DirectXMath...
Add a virtual destructor to SimpleWebMimeRegistryImpl so that child class destructors get called correctly.
// 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 WEBMIMEREGISTRY_IMPL_H_ #define WEBMIMEREGISTRY_IMPL_H_ #include "third_party/WebKit/WebKit/chromium/public/WebMimeRegistry.h" namespace we...
// 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 WEBMIMEREGISTRY_IMPL_H_ #define WEBMIMEREGISTRY_IMPL_H_ #include "third_party/WebKit/WebKit/chromium/public/WebMimeRegistry.h" namespace we...
Clarify that the terminal sends a value upon subscription
// // NSUserDefaults+RACSupport.h // ReactiveCocoa // // Created by Matt Diephouse on 12/19/13. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // #import <Foundation/Foundation.h> @class RACChannelTerminal; @interface NSUserDefaults (RACSupport) // Creates and returns a terminal for binding the user de...
// // NSUserDefaults+RACSupport.h // ReactiveCocoa // // Created by Matt Diephouse on 12/19/13. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // #import <Foundation/Foundation.h> @class RACChannelTerminal; @interface NSUserDefaults (RACSupport) // Creates and returns a terminal for binding the user de...
Drop definitions of unused object attributes
/* * The OpenDiamond Platform for Interactive Search * Version 4 * * Copyright (c) 2002-2005 Intel Corporation * All rights reserved. * * This software is distributed under the terms of the Eclipse Public * License, Version 1.0 which can be found in the file named LICENSE. * ANY USE, REPRODUCTION OR DIS...
/* * The OpenDiamond Platform for Interactive Search * Version 4 * * Copyright (c) 2002-2005 Intel Corporation * All rights reserved. * * This software is distributed under the terms of the Eclipse Public * License, Version 1.0 which can be found in the file named LICENSE. * ANY USE, REPRODUCTION OR DIS...
Allow GPIO chips to register IRQ mappings.
/* * include/asm-sh/gpio.h * * Generic GPIO API and pinmux table support for SuperH. * * Copyright (c) 2008 Magnus Damm * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #ifndef __ASM_...
/* * include/asm-sh/gpio.h * * Generic GPIO API and pinmux table support for SuperH. * * Copyright (c) 2008 Magnus Damm * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #ifndef __ASM_...
Remove private keyword that is not needed
/*************************************************/ /* DO NOT MODIFY THIS HEADER */ /* */ /* MASTODON */ /* */ /* (c) 2015 Battelle Energy Alliance, LLC */ /* ...
/*************************************************/ /* DO NOT MODIFY THIS HEADER */ /* */ /* MASTODON */ /* */ /* (c) 2015 Battelle Energy Alliance, LLC */ /* ...
Fix a possible crash if a file fails to be closed
// Copyright 2014 Google Inc. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd #ifndef MEDIA_FILE_FILE_CLOSER_H_ #define MEDIA_FILE_FILE_CLOSER_H_ #include "packager/base/loggi...
// Copyright 2014 Google Inc. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd #ifndef MEDIA_FILE_FILE_CLOSER_H_ #define MEDIA_FILE_FILE_CLOSER_H_ #include "packager/base/loggi...
Set VK_NO_PROTOTYPES for vulkan backend
/* * 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 GrVkDefines_DEFINED #define GrVkDefines_DEFINED #ifdef SK_VULKAN #if defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_FOR_WIN32) # if !defined(VK_USE_PLATFORM_WIN32_...
/* * 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 GrVkDefines_DEFINED #define GrVkDefines_DEFINED #ifdef SK_VULKAN #if defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_FOR_WIN32) # if !defined(VK_USE_PLATFORM_WIN32_...
Add a constant for detecting whether we are in debug mode.
// // Constants.h // hashtag-warrior // // Created by Daniel Wood on 20/04/2013. // Copyright (c) 2013 Ossum Games. All rights reserved. // #ifndef hashtag_warrior_Constants_h #define hashtag_warrior_Constants_h // UI & appearance #define kHWBackgroundColor ccc4(142, 193, 218, 255) #define kHWTextColor ccc3(8, 90...
// // Constants.h // hashtag-warrior // // Created by Daniel Wood on 20/04/2013. // Copyright (c) 2013 Ossum Games. All rights reserved. // #ifndef hashtag_warrior_Constants_h #define hashtag_warrior_Constants_h // UI & appearance #define kHWBackgroundColor ccc4(142, 193, 218, 255) #define kHWTextColor ccc3(8, 90...
Structure member should be function pointer
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef PPAPI_C_PPB_FIND_H_ #define PPAPI_C_PPB_FIND_H_ #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_stdint.h" #define PPB_FIND_INTERFACE "...
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef PPAPI_C_PPB_FIND_H_ #define PPAPI_C_PPB_FIND_H_ #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_stdint.h" #define PPB_FIND_INTERFACE "...
Add a dummy subtarget to the CPP backend target machine. This will allow us to forward all of the standard TargetMachine calls to the subtarget and still return null as we were before.
//===-- CPPTargetMachine.h - TargetMachine for the C++ backend --*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
//===-- CPPTargetMachine.h - TargetMachine for the C++ backend --*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Include HTTP responses in server
// framework.h #ifndef HEADER_FRAMEWORK #define HEADER_FRAMEWORK // forward declaration typedef struct wookie_framework wookie_framework; /* Send an HTTP request back to the framework */ void *wookie_framework_request(void*); #include "../http_parser/parser.h" #include "../server.h" #include "framework.c" /* Create...
// framework.h #ifndef HEADER_FRAMEWORK #define HEADER_FRAMEWORK // forward declaration typedef struct wookie_framework wookie_framework; /* Send an HTTP request back to the framework */ void *wookie_framework_request(void*); #include "../http_parser/parser.h" #include "../http_parser/http_response.h" #include "../s...
Replace tab w/ 4-space indent
#include <sys/inotify.h> #include <unistd.h> #include <sys/wait.h> #include <limits.h> #define BUF_LEN ( sizeof(struct inotify_event) + NAME_MAX + 1 ) int main(int argc, char *argv[]) { int notify; char buf[BUF_LEN]; struct inotify_event *event; const char *watchpath = "/home/ian/.PRINT"; notify = inotify_init(...
#include <sys/inotify.h> #include <unistd.h> #include <sys/wait.h> #include <limits.h> #define BUF_LEN ( sizeof(struct inotify_event) + NAME_MAX + 1 ) int main(int argc, char *argv[]) { int notify; char buf[BUF_LEN]; struct inotify_event *event; const char *watchpath = "/home/ian/.PRINT"; notify ...
Move variable declarations to while loop
#include <sys/inotify.h> #include <unistd.h> #include <limits.h> #include <cups/cups.h> #define BUF_LEN ( sizeof(struct inotify_event) + NAME_MAX + 1 ) int main(int argc, char *argv[]) { int notify; char buf[BUF_LEN]; struct inotify_event *event; cups_dest_t *dest; char *printer; char *filenam...
#include <sys/inotify.h> #include <unistd.h> #include <limits.h> #include <cups/cups.h> #define BUF_LEN ( sizeof(struct inotify_event) + NAME_MAX + 1 ) int main(int argc, char *argv[]) { int notify; cups_dest_t *dest; char *printer; const char *watchpath = "/home/ian/.PRINT"; notify = inotify_ini...
Document possibility of sum overflow in MovingAverage
#pragma once #include <array> namespace filter { template <typename T, size_t N> class MovingAverage { public: MovingAverage(T initial_value=static_cast<T>(0)); T output() const; // return average of data in buffer T output(T input); // add new value to buffer and return average priva...
#pragma once #include <array> namespace filter { /* * Warning: This class does not protect against sum overflow. It is possible * that the sum of values exceeds the maximum value T can store. */ template <typename T, size_t N> class MovingAverage { public: MovingAverage(T initial_value=static_cast<T>(...
FIX physicsDLL include path FOR DLL to work
#ifndef SSPAPPLICATION_CORE_SYSTEM_H #define SSPAPPLICATION_CORE_SYSTEM_H #include <SDL.h> #include <SDL_syswm.h> #include <iostream> #include "../GraphicsDLL/GraphicsHandler.h" #include "../GraphicsDLL/Camera.h" #include "InputHandler.h" #include "../physicsDLL/physicsDLL/PhysicsHandler.h" #pragma comment (lib, "../De...
#ifndef SSPAPPLICATION_CORE_SYSTEM_H #define SSPAPPLICATION_CORE_SYSTEM_H #include <SDL.h> #include <SDL_syswm.h> #include <iostream> #include "../GraphicsDLL/GraphicsHandler.h" #include "../GraphicsDLL/Camera.h" #include "InputHandler.h" #include "../physicsDLL/PhysicsHandler.h" #pragma comment (lib, "../Debug/Physics...
Make delegate method optional (cancellation is handled automatically when using UINavigationController)
#import <UIKit/UIKit.h> @protocol NBNPhotoChooserViewControllerDelegate; @interface NBNPhotoChooserViewController : UIViewController - (instancetype)initWithDelegate:(id<NBNPhotoChooserViewControllerDelegate>)delegate; - (instancetype)initWithDelegate:(id<NBNPhotoChooserViewControllerDelegate>)delegate ...
#import <UIKit/UIKit.h> @protocol NBNPhotoChooserViewControllerDelegate; @interface NBNPhotoChooserViewController : UIViewController - (instancetype)initWithDelegate:(id<NBNPhotoChooserViewControllerDelegate>)delegate; - (instancetype)initWithDelegate:(id<NBNPhotoChooserViewControllerDelegate>)delegate ...
Add the vpsc library for IPSEPCOLA features
/** * * Authors: * Tim Dwyer <tgdwyer@gmail.com> * * Copyright (C) 2005 Authors * * This version is released under the CPL (Common Public License) with * the Graphviz distribution. * A version is also available under the LGPL as part of the Adaptagrams * project: http://sourceforge.net/projects/adaptagrams....
Add appledoc header comments to the 'OCKCarePlanEvent' class
#import <CareKit/CareKit.h> typedef void(^CMHCareSaveCompletion)(NSString *_Nullable uploadStatus, NSError *_Nullable error); @interface OCKCarePlanEvent (CMHealth) @property (nonatomic, nonnull, readonly) NSString *cmh_objectId; - (void)cmh_saveWithCompletion:(_Nullable CMHCareSaveCompletion)block; @end
#import <CareKit/CareKit.h> typedef void(^CMHCareSaveCompletion)(NSString *_Nullable uploadStatus, NSError *_Nullable error); /** * This category adds properties and methods to the `OCKCarePlanEvent` class which * allow instances to be identified uniquely and saved to CloudMine's * HIPAA compliant Connected Hea...
Add Win32 specific code for CroquetPlugin.
#include <windows.h> #include "CroquetPlugin.h" static int loaded = 0; static HMODULE hAdvApi32 = NULL; static BOOLEAN (*RtlGenRandom)(PVOID, ULONG) = NULL; int ioGatherEntropy(char *bufPtr, int bufSize) { if(!loaded) { loaded = 1; hAdvApi32 = LoadLibrary("advapi32.dll"); (void*)RtlGenRandom ...
Fix debug logging-only compilation error
/* * linux/fs/ext3/bitmap.c * * Copyright (C) 1992, 1993, 1994, 1995 * Remy Card (card@masi.ibp.fr) * Laboratoire MASI - Institut Blaise Pascal * Universite Pierre et Marie Curie (Paris VI) */ #ifdef EXT3FS_DEBUG #include <linux/buffer_head.h> #include "ext3_fs.h" static int nibblemap[] = {4, 3, 3, 2, 3, 2,...
/* * linux/fs/ext3/bitmap.c * * Copyright (C) 1992, 1993, 1994, 1995 * Remy Card (card@masi.ibp.fr) * Laboratoire MASI - Institut Blaise Pascal * Universite Pierre et Marie Curie (Paris VI) */ #include <linux/buffer_head.h> #include <linux/jbd.h> #include <linux/ext3_fs.h> #ifdef EXT3FS_DEBUG static int nibb...
Fix Linux shared build by adding missing UI_EXPORT annotations.
// Copyright (c) 2011 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 UI_GFX_FAVICON_SIZE_H_ #define UI_GFX_FAVICON_SIZE_H_ #pragma once namespace gfx { // Size (along each axis) of the favicon. extern const in...
// Copyright (c) 2011 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 UI_GFX_FAVICON_SIZE_H_ #define UI_GFX_FAVICON_SIZE_H_ #pragma once #include "ui/base/ui_export.h" namespace gfx { // Size (along each axis)...
Use CLOCK_MONOTONIC instead of CLOCK_MONOTONIC_RAW.
#ifndef TIMER_H #define TIMER_H struct timespec t0, t1; /* Start/end time for timer */ /* Timer macros */ #define TIMER_START() clock_gettime(CLOCK_MONOTONIC_RAW, &t0) #define TIMER_STOP() clock_gettime(CLOCK_MONOTONIC_RAW, &t1) #define TIMER_ELAPSED_NS() \ (t1.tv_sec * 1000000000 + t1.tv_nsec) - \ (t0.tv_sec...
#ifndef TIMER_H #define TIMER_H struct timespec t0, t1; /* Start/end time for timer */ /* Timer macros */ #define TIMER_START() clock_gettime(CLOCK_MONOTONIC, &t0) #define TIMER_STOP() clock_gettime(CLOCK_MONOTONIC, &t1) #define TIMER_ELAPSED_NS() \ (t1.tv_sec * 1000000000 + t1.tv_nsec) - \ (t0.tv_sec * 10000...
Add pure virtual isComplete() function.
#ifndef ANIMATION_H #define ANIMATION_H #include <vector> #include "Blittable.h" #include "Logger.h" namespace hm { class Animation { public: Animation(); ~Animation(); void add(Blittable& b); void remove(Blittable& b); void removeAll(); int getUnits(); void setUnits(const int units); u...
#ifndef ANIMATION_H #define ANIMATION_H #include <vector> #include "Blittable.h" #include "Logger.h" namespace hm { class Animation { public: Animation(); ~Animation(); void add(Blittable& b); void remove(Blittable& b); void removeAll(); int getUnits(); void setUnits(const int units); u...
Add header file with prototypes that bomalloc needs from the surrounding enviroment
#ifndef __BOMALLOC_SYSTEM #define __BOMALLOC_SYSTEM #include <stdbool.h> #include <stdlib.h> #include <unistd.h> bool speculating(void); void record_allocation(void * p, size_t t); int getuniqueid(void); #endif
Add some inline functions for configuring gpio.
#include "stm8s003_reg.h" typedef enum { PORT_A = PA_ODR, PORT_B = PB_ODR, PORT_C = PB_, PORT_D, PORT_E, PORT_F } port_t; void toggle_port_a_pin(uint8_t pin); void set_high_port_a_pin(uint8_t pin); void set_low_port_a_pin(uint8_t pin); void set
#include "stm8s003_reg.h" #include <stdint.h> struct input_pin_config { bool pull_up_enable; bool interrupt_enable; }; struct output_pin_config { bool open_drain_enable; bool fast_mode_enable; }; inline void set_port_a(uint8_t value) { PA_ODR = value; } inline void toggle_port_a_pin(uint8_t pi...
Fix compilation error on FreeBSD
/* * $FreeBSD$ * * Smoke test for `ls` utility */ #include <getopt.h> #include <stdio.h> #include <stdlib.h> #include "functional_test.h" int main(int argc, char *argv[]) { while ((opt = getopt_long(argc, argv, short_options, long_options, &option_index)) != -1) { switch(opt) { case ...
/* * $FreeBSD$ * * Smoke test for `ls` utility */ #include <getopt.h> #include <stdio.h> #include <stdlib.h> #include <sys/wait.h> #include "functional_test.h" int main(int argc, char *argv[]) { while ((opt = getopt_long(argc, argv, short_options, long_options, &option_index)) != -1) { swi...
Update implementation to hook calls to dlopen.
#include <dlfcn.h> int main(int argc, char* argv[]) { dlopen("1//libcoreclr.so", RTLD_NOW | RTLD_GLOBAL); dlopen("2//libcoreclrtraceptprovider.so", RTLD_LAZY); dlopen("2//libcoreclr.so", RTLD_NOW | RTLD_GLOBAL); return 0; }
//#define _GNU_SOURCE #include <dlfcn.h> #include <stdio.h> #include <string.h> void *dlopen(const char *filename, int flag) { static void* (*dlopenImpl)(const char *filename, int flag) = 0; if(!dlopenImpl) { dlopenImpl = dlsym(RTLD_NEXT, "dlopen"); } if(strcmp(filename, "2//libcoreclrtrac...
Remove deprecated instance() method from Singleton
/// \file /// \brief Singleton design pattern /// /// \author Peter 'png' Hille <peter@das-system-networks.de> #ifndef SINGLETON_HH #define SINGLETON_HH 1 #include <dsnutil/compiler_features.h> namespace dsn { /// \brief Template for singleton classes /// /// This template can be used to implement the "singleton" des...
/// \file /// \brief Singleton design pattern /// /// \author Peter 'png' Hille <peter@das-system-networks.de> #ifndef SINGLETON_HH #define SINGLETON_HH 1 namespace dsn { /// \brief Template for singleton classes /// /// This template can be used to implement the "singleton" design pattern /// on any class. template <...
Fix typo in macro for tls access model
/* * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #ifndef _BITS_UCLIBC_ERRNO_H #define _BITS_UCLIBC_ERRNO_H 1 #ifdef IS_IN_rtld # undef errno # define errno _dl_errno extern int _dl_errno; // attribute_hidden; #elif defin...
/* * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #ifndef _BITS_UCLIBC_ERRNO_H #define _BITS_UCLIBC_ERRNO_H 1 #ifdef IS_IN_rtld # undef errno # define errno _dl_errno extern int _dl_errno; // attribute_hidden; #elif defin...
Fix warning about "comparison between signed and unsigned" in example and make it fully C89 compatible.
#include "C_func_file.h" void multiply_by_10_in_C(double arr[], unsigned int n) { for (int i = 0; i < n; i++) { arr[i] *= 10; } }
#include "C_func_file.h" void multiply_by_10_in_C(double arr[], unsigned int n) { unsigned int i; for (i = 0; i < n; i++) { arr[i] *= 10; } }
Add regression test for TD3 wpoint restart soundness
// PARAM: --enable ana.int.interval #include <pthread.h> #include <assert.h> int g = 0; void *worker(void *arg ) { return NULL; } int main(int argc , char **argv ) { pthread_t tid; pthread_create(& tid, NULL, & worker, NULL); while (g >= 10) { } assert(1); // reachable g++; assert(1); // reachable ...
Update missing iOS header changes
// // FirestackDatabase.h // Firestack // // Created by Ari Lerner on 8/23/16. // Copyright © 2016 Facebook. All rights reserved. // #ifndef FirestackDatabase_h #define FirestackDatabase_h #import "Firebase.h" #import "RCTEventEmitter.h" #import "RCTBridgeModule.h" @interface FirestackDatabase : RCTEventEmitter ...
// // FirestackDatabase.h // Firestack // // Created by Ari Lerner on 8/23/16. // Copyright © 2016 Facebook. All rights reserved. // #ifndef FirestackDatabase_h #define FirestackDatabase_h #import "Firebase.h" #import "RCTEventEmitter.h" #import "RCTBridgeModule.h" @interface FirestackDatabase : RCTEventEmitter ...
Kill off more names to fix this test
// RUN: %clang_cc1 -mrtd -triple i386-unknown-freebsd9.0 -emit-llvm -o - %s | FileCheck %s void baz(int arg); // CHECK: define x86_stdcallcc void @foo(i32 %arg) nounwind void foo(int arg) { // CHECK: call x86_stdcallcc i32 (...)* @bar(i32 %tmp) bar(arg); // CHECK: call x86_stdcallcc void @baz(i32 %tmp1) baz(arg);...
// RUN: %clang_cc1 -mrtd -triple i386-unknown-freebsd9.0 -emit-llvm -o - %s | FileCheck %s void baz(int arg); // CHECK: define x86_stdcallcc void @foo(i32 %arg) nounwind void foo(int arg) { // CHECK: call x86_stdcallcc i32 (...)* @bar(i32 bar(arg); // CHECK: call x86_stdcallcc void @baz(i32 baz(arg); } // CHECK:...
Add bs_config for hide bs_cfg_p::Instance () usage
#ifndef BS_CONFIG_PARSER_H #define BS_CONFIG_PARSER_H #include "bs_common.h" #include <map> #include <string> #include <vector> namespace blue_sky { struct wcfg; class BS_API bs_cfg_p { public: friend struct wcfg; typedef std::vector<std::string> vstr_t; typedef std::map<std::string,vstr_t> map_t; ...
#ifndef BS_CONFIG_PARSER_H #define BS_CONFIG_PARSER_H #include "bs_common.h" #include <map> #include <string> #include <vector> namespace blue_sky { struct wcfg; class BS_API bs_cfg_p { public: friend struct wcfg; typedef std::vector<std::string> vstr_t; typedef std::map<std::string,vstr_t> map_t; ...
Fix stupid error for Linux build.
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_GPU_GPU_CONFIG_H_ #define CHROME_GPU_GPU_CONFIG_H_ // This file declares common preprocessor configuration for the GPU process. #incl...
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_GPU_GPU_CONFIG_H_ #define CHROME_GPU_GPU_CONFIG_H_ // This file declares common preprocessor configuration for the GPU process. #incl...
Use the address of the variable instead of the value itself for the CPUID
/* * Copyright (C) 2014 FU Berlin * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @addtogroup driver_periph * @{ * * @file * @brief Low-level CPUID driver implementation ...
/* * Copyright (C) 2014 FU Berlin * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @addtogroup driver_periph * @{ * * @file * @brief Low-level CPUID driver implementation ...
Add __FILE__, __LINE__ to Lua
/* * proxy.c * lexer proxy for Lua parser -- implements __FILE__ and __LINE__ * Luiz Henrique de Figueiredo * This code is hereby placed in the public domain. * Add <<#include "proxy.c">> just before the definition of luaX_next in llex.c */ #include <string.h> static int nexttoken(LexState *ls, SemInfo *seminfo) { ...
/* * proxy.c * lexer proxy for Lua parser -- implements __FILE__ and __LINE__ * Luiz Henrique de Figueiredo * This code is hereby placed in the public domain. * Add <<#include "proxy.c">> just before the definition of luaX_next in llex.c */ /* * Luiz's code changed, per his suggestion, to include some polishing * th...
Add an incoming request object
#ifndef APIMOCK_INCOMING_REQUEST #define APIMOCK_INCOMING_REQUEST #include <string> namespace ApiMock { class IncomingRequest { public: virtual ~IncomingRequest() {} virtual std::string getRequestAsString() = 0; virtual void sendResponse(const std::string& responseAsString) = 0; }; } #endif
Add rudimentary test for fq_default_poly.
/* Copyright (C) 2021 William Hart This file is part of FLINT. FLINT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) a...
Revert D34351084: Migrate from googletest 1.8 to googletest 1.10
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <gmock/gmock.h> #include <react/renderer/scheduler/SurfaceHandler.h> namespace facebook { namespace reac...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <gmock/gmock.h> #include <react/renderer/scheduler/SurfaceHandler.h> namespace facebook { namespace reac...
Add board support for preliminary testing with Arduino Mega again
// Keyglove controller source code - Special hardware setup file // 7/17/2011 by Jeff Rowberg <jeff@rowberg.net> /* ============================================ Controller code is placed under the MIT license Copyright (c) 2011 Jeff Rowberg Permission is hereby granted, free of charge, to any person obtaining a copy ...
Fix __libc_sigaction redefinition with static links
/* * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com) * * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. */ #include <../../../../../../../libc/sysdeps/linux/arc/sigaction.c>
/* * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com) * * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. */ /* * ARC syscall ABI only has __NR_rt_sigaction, thus vanilla sigaction does * some SA_RESTORER tricks before calling __syscall_rt_sigaction. * However including that...