Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Use correct flags for this test.
// RUN: %clang -O0 -S -mno-red-zone -fprofile-arcs -ftest-coverage -emit-llvm %s -o - | FileCheck %s // <rdar://problem/12843084> int test1(int a) { switch (a % 2) { case 0: ++a; case 1: a /= 2; } return a; } // Check tha the `-mno-red-zone' flag is set here on the generated functions. // CHECK: vo...
// RUN: %clang_cc1 -O0 -emit-llvm -disable-red-zone -femit-coverage-notes -femit-coverage-data %s -o - | FileCheck %s // <rdar://problem/12843084> int test1(int a) { switch (a % 2) { case 0: ++a; case 1: a /= 2; } return a; } // Check tha the `-mno-red-zone' flag is set here on the generated functi...
Add the atSymbols to this so the getTimeOfDay function was usable outside of the windows dll.
#ifndef AT_TIME_H #define AT_TIME_H // Under Windows, define the gettimeofday() function with corresponding types #ifdef _MSC_VER #include <windows.h> #include <time.h> // TYPES struct timezone { int tz_minuteswest; int tz_dsttime; }; // FUNCTIONS int gettimeofda...
#ifndef AT_TIME_H #define AT_TIME_H // Under Windows, define the gettimeofday() function with corresponding types #ifdef _MSC_VER #include <windows.h> #include <time.h> #include "atSymbols.h" // TYPES struct timezone { int tz_minuteswest; int tz_dsttime; }; // FU...
Use a sliderwnd instance to implement the volume slider
#pragma once #include "OSD\OSD.h" #include "MeterWnd\MeterWnd.h" class VolumeSlider : public OSD { public: VolumeSlider(HINSTANCE hInstance, Settings &settings); void Hide(); private: MeterWnd _mWnd; };
#pragma once #include "OSD\OSD.h" #include "SliderWnd.h" class VolumeSlider : public OSD { public: VolumeSlider(HINSTANCE hInstance, Settings &settings); void Hide(); private: SliderWnd _sWnd; };
Rename DB_PLIO to DB_IO, indicate general IO Debugging
#ifndef __DEBUG_H__ #define __DEBUG_H__ // Not using extern, define your own static dbflags in each file // extern unsigned int dbflags; /* * Bit flags for DEBUG() */ #define DB_PLIO 0x001 #define DB_TIMER 0x002 #define DB_USER_INPUT 0x004 #define DB_TRAIN_CTRL 0x008 // #define DB_THREADS 0x010 /...
#ifndef __DEBUG_H__ #define __DEBUG_H__ // Not using extern, define your own static dbflags in each file // extern unsigned int dbflags; /* * Bit flags for DEBUG() */ #define DB_IO 0x001 #define DB_TIMER 0x002 #define DB_USER_INPUT 0x004 #define DB_TRAIN_CTRL 0x008 // #define DB_THREADS 0x010 // ...
Add RNG to running away.
/*------------------------------------------------------------------------------ | NuCTex | math.c | Author | Benjamin A - Nullsrc | Created | 30 December, 2015 | Changed | 31 December, 2015 |------------------------------------------------------------------------------- | Overview | Implementation of various mathemati...
/*------------------------------------------------------------------------------ | NuCTex | math.c | Author | Benjamin A - Nullsrc | Created | 30 December, 2015 | Changed | 31 December, 2015 |------------------------------------------------------------------------------- | Overview | Implementation of various mathemati...
Clean up and simplify sample
#define _GNU_SOURCE #include <sched.h> #include <sys/syscall.h> #include <sys/wait.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> static int child_func(void* arg) { char* buf = (char*)arg; strcpy(buf, "hello"); return 0; } int main(int argc, char** argv) { // Stack for child...
// We have to define the _GNU_SOURCE to get access to clone(2) and the CLONE_* // flags from sched.h #define _GNU_SOURCE #include <sched.h> #include <sys/syscall.h> #include <sys/wait.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> static int child_func(void* arg) { char* buf = (cha...
Define wmain() in addition to main().
/** * Win32 UTF-8 wrapper * * ---- * * main() entry point. * Compile or #include this file as part of your sources * if your program runs in the console subsystem. */ #include "src/entry.h" #undef main int __cdecl main(void) { return win32_utf8_entry(win32_utf8_main); }
/** * Win32 UTF-8 wrapper * * ---- * * main() entry point. * Compile or #include this file as part of your sources * if your program runs in the console subsystem. */ #include "src/entry.h" #undef main int __cdecl wmain(void) { return win32_utf8_entry(win32_utf8_main); } // If both main() and wmain(...
Use sd_journal_print() instead of send.
#include <Python.h> #include <systemd/sd-journal.h> #ifndef journaldpython #define journaldpython static PyObject * journald_send(PyObject *self, PyObject *args) { //const char *command; //int sts; //if (!PyArg_ParseTuple(args, "s", &command)) // return NULL; //sts = system(command); //ret...
#include <Python.h> #include <systemd/sd-journal.h> #ifndef journaldpython #define journaldpython static PyObject * journald_send(PyObject *self, PyObject *args) { //const char *command; //int sts; //if (!PyArg_ParseTuple(args, "s", &command)) // return NULL; //sts = system(command); //ret...
Add new verb to reset the kernel library resource limits for an owner
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2017 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundati...
CREATE ns_prefix/box/ didn't work right when namespace prefix existed.
/* Copyright (C) 2002 Timo Sirainen */ #include "common.h" #include "mail-namespace.h" #include "commands.h" bool cmd_create(struct client_command_context *cmd) { struct mail_namespace *ns; const char *mailbox, *full_mailbox; bool directory; size_t len; /* <mailbox> */ if (!client_read_string_args(cmd, 1, &mai...
/* Copyright (C) 2002 Timo Sirainen */ #include "common.h" #include "mail-namespace.h" #include "commands.h" bool cmd_create(struct client_command_context *cmd) { struct mail_namespace *ns; const char *mailbox, *full_mailbox; bool directory; size_t len; /* <mailbox> */ if (!client_read_string_args(cmd, 1, &mai...
Remove unused alias for Directory (AttributeSubscriptionDirectory)
/* * #%L * %% * Copyright (C) 2011 - 2013 BMW Car IT GmbH * %% * 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 requir...
/* * #%L * %% * Copyright (C) 2011 - 2013 BMW Car IT GmbH * %% * 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 requir...
Add back scope_name used by a few contracts
/** * @file * @copyright defined in eos/LICENSE.txt */ #pragma once #include <stdint.h> #include <wchar.h> #ifdef __cplusplus extern "C" { #endif /** * @defgroup types Builtin Types * @ingroup contractdev * @brief Specifies typedefs and aliases * * @{ */ typedef uint64_t account_name; typedef uint64_...
/** * @file * @copyright defined in eos/LICENSE.txt */ #pragma once #include <stdint.h> #include <wchar.h> #ifdef __cplusplus extern "C" { #endif /** * @defgroup types Builtin Types * @ingroup contractdev * @brief Specifies typedefs and aliases * * @{ */ typedef uint64_t account_name; typedef uint64_...
Add a simple program to kill all processes in a process group.
/* * $Id$ * * Kills all processes belonging to the supplied process group id. * * In the normal case, this allows you to kill a process and any of its * children. */ #include <sys/types.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> void usage() { fprintf(stderr, "Usage: killpgrp <pgid>\n");...
Add a new http client example based on the new style
/* * TCP connection sample program * explaining the way to use planetfs */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> void die(const char *prefix) { perror(prefix); exit(EXIT_FAILURE); } int main(int arg...
Use the new designed library
#ifndef BYTECODE_H #define BYTECODE_H #include <iostream> #include <iomanip> using namespace std; enum ByteCode { PUSH = 0, PRINT = 1, END = 2 }; void writeOneOperandCall(ofstream* outStream, ByteCode bytecode, string litteral); void writeSimpleCall(ofstream* outStream, ByteCode bytecode); void writeEnd(ofstream...
#ifndef BYTECODE_H #define BYTECODE_H #include <iostream> #include <iomanip> using namespace std; enum ByteCode { PUSH = 0, PRINT = 1, END = 2 }; /* Write operations */ void writeOneOperandCall(ofstream* outStream, ByteCode bytecode, string litteral); void writeSimpleCall(ofstream* outStream, ByteCode bytecode)...
Make pump happy. Add in this header. -Erik
/* Definitions for use with Linux AF_PACKET sockets. Copyright (C) 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the F...
Add nullable flag to ApptentiveDictionaryGetArray and -String
// // ApptentiveSafeCollections.h // Apptentive // // Created by Alex Lementuev on 3/20/17. // Copyright © 2017 Apptentive, Inc. All rights reserved. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN /** Returns non-nil value or NSNull */ id ApptentiveCollectionValue(id value); /** Safely adds key...
// // ApptentiveSafeCollections.h // Apptentive // // Created by Alex Lementuev on 3/20/17. // Copyright © 2017 Apptentive, Inc. All rights reserved. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN /** Returns non-nil value or NSNull */ id ApptentiveCollectionValue(id value); /** Safely adds key...
Use : as separator between "GM" and slide name in SampleApp. This makes it easier to jump to a GM slide using command line args on windows.
/* * 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 GMSampleView_DEFINED #define GMSampleView_DEFINED #include "SampleCode.h" #include "gm.h" class GMSampleView : public SampleView { private: typedef skiagm::GM ...
/* * 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 GMSampleView_DEFINED #define GMSampleView_DEFINED #include "SampleCode.h" #include "gm.h" class GMSampleView : public SampleView { private: typedef skiagm::GM ...
Add missing ecpg prototype for newly added functions.
#ifndef PGTYPES_TIMESTAMP #define PGTYPES_TIMESTAMP #include <pgtypes_interval.h> #ifdef HAVE_INT64_TIMESTAMP typedef int64 timestamp; typedef int64 TimestampTz; #else typedef double timestamp; typedef double TimestampTz; #endif #ifdef __cplusplus extern "C" { #endif extern timestamp PGTYPEStimestamp_from_asc(cha...
#ifndef PGTYPES_TIMESTAMP #define PGTYPES_TIMESTAMP #include <pgtypes_interval.h> #ifdef HAVE_INT64_TIMESTAMP typedef int64 timestamp; typedef int64 TimestampTz; #else typedef double timestamp; typedef double TimestampTz; #endif #ifdef __cplusplus extern "C" { #endif extern timestamp PGTYPEStimestamp_from_asc(cha...
Unify Platform specific defines for PSCI module
/* * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef BOARD_DEF_H #define BOARD_DEF_H #include <lib/utils_def.h> /* The ports must be in order and contiguous */ #define K3_CLUSTER0_CORE_COUNT 2 #define K3_CLUSTER1_CORE_COUNT 2 #def...
/* * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef BOARD_DEF_H #define BOARD_DEF_H #include <lib/utils_def.h> /* The ports must be in order and contiguous */ #define K3_CLUSTER0_CORE_COUNT U(2) #define K3_CLUSTER1_CORE_COUNT U(2...
Fix iSeries bug in VMALLOCBASE/VMALLOC_START consolidation
/* * Copyright (C) 2005 Stephen Rothwell IBM Corp. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #includ...
/* * Copyright (C) 2005 Stephen Rothwell IBM Corp. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #includ...
Include vtk_hdf5.h rather than hdf5.h
/* This source file is part of the Tomviz project, https://tomviz.org/. It is released under the 3-Clause BSD License, see "LICENSE". */ #ifndef tomvizH5CAPI_h #define tomvizH5CAPI_h extern "C" { #include <hdf5.h> } #endif // tomvizH5CAPI_h
/* This source file is part of the Tomviz project, https://tomviz.org/. It is released under the 3-Clause BSD License, see "LICENSE". */ #ifndef tomvizH5CAPI_h #define tomvizH5CAPI_h extern "C" { #include <vtk_hdf5.h> } #endif // tomvizH5CAPI_h
Move ConfigReader::GetOption()'s implementation outside of class definition
#include <map> #include <sstream> #include <string> class ConfigReader { public: ConfigReader(); ConfigReader(const std::string &filename); bool LoadFile(const std::string &filename); template<typename T> T GetOption(const std::string &name, const T &defaultValue) const { std::map<std::string, std::string>::c...
#include <map> #include <sstream> #include <string> class ConfigReader { public: ConfigReader(); ConfigReader(const std::string &filename); bool LoadFile(const std::string &filename); template<typename T> T GetOption(const std::string &name, const T &defaultValue) const; bool IsLoaded() const { return loaded_...
Add a counter for client cert verification mismatches
/* * Copyright (c) 2017, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #pragma once...
/* * Copyright (c) 2017, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #pragma once...
Change default wksize for opencl config
#ifndef ENGINE_PARALLELL_CLPARALLELL_H_ #define ENGINE_PARALLELL_CLPARALLELL_H_ /* OpenCL 1.2 */ #define CL_HPP_MINIMUM_OPENCL_VERSION 120 #define CL_HPP_TARGET_OPENCL_VERSION 120 #define CL_HPP_ENABLE_EXCEPTIONS #include <vector> #include <tbb/mutex.h> #ifdef __APPLE__ #include <OpenCL/cl2.hpp> #else #incl...
#ifndef ENGINE_PARALLELL_CLPARALLELL_H_ #define ENGINE_PARALLELL_CLPARALLELL_H_ /* OpenCL 1.2 */ #define CL_HPP_MINIMUM_OPENCL_VERSION 120 #define CL_HPP_TARGET_OPENCL_VERSION 120 #define CL_HPP_ENABLE_EXCEPTIONS #include <vector> #include <tbb/mutex.h> #ifdef __APPLE__ #include <OpenCL/cl2.hpp> #else #incl...
Fix coding style and improve readability
#include "StatusCode.h" HttpseCode httpse_check_status_code(const HttpseTData *tdata) { long cp = 0, cs = 0; curl_easy_getinfo(tdata->rp->curl, CURLINFO_RESPONSE_CODE, &cp); curl_easy_getinfo(tdata->rs->curl, CURLINFO_RESPONSE_CODE, &cs); if(cs && cp) { if(cs != cp) { return HTTPSE_STATUS_CODE_MISMATCH; ...
#include "StatusCode.h" HttpseCode httpse_check_status_code(const HttpseTData *tdata) { long cp = 0; long cs = 0; curl_easy_getinfo(tdata->rp->curl, CURLINFO_RESPONSE_CODE, &cp); curl_easy_getinfo(tdata->rs->curl, CURLINFO_RESPONSE_CODE, &cs); if(cs == cp) { switch(cp/ 100) { /* Remark: unable to recie...
Define DEBUG as 1 instead of as nothing so that it doesn't conflict with -DDEBUG in libresolv/Makefile.
#define DEBUG /* enable debugging code (needed for dig) */ #undef ALLOW_T_UNSPEC /* enable the "unspec" RR type for old athena */ #define RESOLVSORT /* allow sorting of addresses in gethostbyname */ #undef RFC1535 /* comply with RFC1535 */ #undef ALLOW_UPDATES /* destroy your system security */ #undef USELOOPBACK /* ...
#define DEBUG 1 /* enable debugging code (needed for dig) */ #undef ALLOW_T_UNSPEC /* enable the "unspec" RR type for old athena */ #define RESOLVSORT /* allow sorting of addresses in gethostbyname */ #undef RFC1535 /* comply with RFC1535 */ #undef ALLOW_UPDATES /* destroy your system security */ #undef USELOOPBACK /*...
Move PeiPeCoffLoader from /Protocol to /Guid.
/*++ Copyright (c) 2006, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribut...
/*++ Copyright (c) 2006, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribut...
Remove unnecessary using directive. This sclences a warning when compiling with clang++.
/*===- TimeVaryingDragForce.h - libSimulation -================================= * * DEMON * * This file is distributed under the BSD Open Source License. See LICENSE.TXT * for details. * *===-----------------------------------------------------------------------===*/ #ifndef TIME...
/*===- TimeVaryingDragForce.h - libSimulation -================================= * * DEMON * * This file is distributed under the BSD Open Source License. See LICENSE.TXT * for details. * *===-----------------------------------------------------------------------===*/ #ifndef TIME...
Change a missed instance of 'HPM'
#pragma once /* 11pm.h - functions and data types related * to the operation of HPM itself */ // install.c - functions related to symlinking // (installing) already faked packages int xipm_symlink(char *from, char *to);
#pragma once /* 11pm.h - functions and data types related * to the operation of 11pm itself */ // install.c - functions related to symlinking // (installing) already faked packages int xipm_symlink(char *from, char *to);
Test 13/19: Add ! to UNKNOWN
// PARAM: --set ana.int.interval true --set solver "'td3'" #include<pthread.h> #include<assert.h> int glob1 = 0; pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int t; pthread_mutex_lock(&mutex1); pthread_mutex_lock(&mutex2); glo...
// PARAM: --set ana.int.interval true --set solver "'td3'" #include<pthread.h> #include<assert.h> int glob1 = 0; pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int t; pthread_mutex_lock(&mutex1); pthread_mutex_lock(&mutex2); glo...
Add test that's unsound because of __goblint_assume_join(...)
//PARAM: --set ana.activated[+] apron --set ana.path_sens[+] threadflag --set ana.activated[+] threadJoins --sets ana.apron.privatization mutex-meet-tid #include <pthread.h> #include <assert.h> int g = 10; int h = 10; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { return NULL; } void *t_be...
Fix incorrect header size macros
#ifndef __REGIS_H__ #define __REGIS_H__ #include "postgres.h" typedef struct RegisNode { uint32 type:2, len:16, unused:14; struct RegisNode *next; unsigned char data[1]; } RegisNode; #define RNHDRSZ (sizeof(uint32)+sizeof(void*)) #define RSF_ONEOF 1 #define RSF_NONEOF 2 typedef struct Regis { Regi...
#ifndef __REGIS_H__ #define __REGIS_H__ #include "postgres.h" typedef struct RegisNode { uint32 type:2, len:16, unused:14; struct RegisNode *next; unsigned char data[1]; } RegisNode; #define RNHDRSZ (offsetof(RegisNode,data)) #define RSF_ONEOF 1 #define RSF_NONEOF 2 typedef struct Regis { RegisNod...
Add some common utils for arrays and alignment
/* * Copyright (c) 2016 Lech Kulina * * This file is part of the Realms Of Steel. * For conditions of distribution and use, see copyright details in the LICENSE file. */ #ifndef ROS_COMMON_H #define ROS_COMMON_H #include <cstddef> #include <cstdlib> #include <cstdio> #include <cstdarg> #include <cstring> #include...
Set the SHELL environment variable
/* Copyright 2010 Curtis McEnroe <programble@gmail.com> * * This file is part of BSH. * * BSH 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)...
/* Copyright 2010 Curtis McEnroe <programble@gmail.com> * * This file is part of BSH. * * BSH 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)...
Make all the state variables static (still subject to significant change)
#ifndef __ADR_MAIN_H__ #define __ADR_MAIN_H__ // Libraries // #include "craftable.h" #include "resource.h" #include "villager.h" #include "location.h" // Forward Declarations // enum LOCATION adr_loc; enum FIRE_STATE adr_fire; enum ROOM_TEMP adr_temp; unsigned int adr_rs [ALIEN_ALLOY + 1]; unsigned short adr_cs [RIFL...
#ifndef __ADR_MAIN_H__ #define __ADR_MAIN_H__ // Libraries // #include "craftable.h" #include "resource.h" #include "villager.h" #include "location.h" // Forward Declarations // static enum LOCATION adr_loc; static enum FIRE_STATE adr_fire; static enum ROOM_TEMP adr_temp; static unsigned int adr_rs [ALIEN_ALLOY + 1];...
Reformat the code with clang-format
//===- lld/ReaderWriter/ELF/Mips/MipsRelocationHandler.h ------------------===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------...
//===- lld/ReaderWriter/ELF/Mips/MipsRelocationHandler.h ------------------===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------...
Update Skia milestone to 80
/* * 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 79 #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 80 #endif
Add dll hijack proxy example
// i686-w64-mingw32-g++ dll.c -lws2_32 -o wtsapi32.dll -shared #include <windows.h> #include <string> #include <stdio.h> #include <Lmcons.h> BOOL IsElevated() { BOOL fRet = FALSE; HANDLE hToken = NULL; if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)) { TOKEN_ELEVATION Elevation; DWORD cbSize = si...
Add program options to bridgeofp.
#ifndef OFP_IPV6ENDPOINT_H #define OFP_IPV6ENDPOINT_H #include "ofp/ipv6address.h" namespace ofp { // <namespace ofp> class IPv6Endpoint { public: IPv6Endpoint() = default; IPv6Endpoint(const IPv6Address &addr, UInt16 port) : addr_{addr}, port_{port} {} IPv6Endpoint(const std::string &addr, UInt16 port) : addr_{a...
#ifndef OFP_IPV6ENDPOINT_H #define OFP_IPV6ENDPOINT_H #include "ofp/ipv6address.h" #include <istream> #include "ofp/log.h" namespace ofp { // <namespace ofp> class IPv6Endpoint { public: IPv6Endpoint() = default; IPv6Endpoint(const IPv6Address &addr, UInt16 port) : addr_{addr}, port_{port} {} IPv6Endpoint(const s...
Add Locale.cpp to sync and minimal deps
/* * 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. */ #ifndef _FB_UTIL_REIMPLEMENTATION #define _FB_UTIL_REIMPLEMENTATION #include <algorithm> #include <sstream> #include <string> #i...
Add witness lifter fixpoint not reached test from sv-benchmarks
// PARAM: --enable ana.sv-comp.enabled --enable ana.sv-comp.functions --set ana.specification 'CHECK( init(main()), LTL(G ! call(reach_error())) )' --enable ana.int.interval // previously fixpoint not reached // extracted from sv-benchmarks loops-crafted-1/loopv2 int SIZE = 50000001; int __VERIFIER_nondet_int(); int ma...
Fix prefix in header import
// // Fingertips.h // Fingertips // // Copyright © 2016 Mapbox. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for Fingertips. FOUNDATION_EXPORT double FingertipsVersionNumber; //! Project version string for Fingertips. FOUNDATION_EXPORT const unsigned char FingertipsVersionString[]; ...
// // Fingertips.h // Fingertips // // Copyright © 2016 Mapbox. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for Fingertips. FOUNDATION_EXPORT double FingertipsVersionNumber; //! Project version string for Fingertips. FOUNDATION_EXPORT const unsigned char FingertipsVersionString[]; ...
Add a test that ensures we get the basic multilib '-L' flags to 'ld' invocations on Linux.
// General tests that ld invocations on Linux targets sane. // // RUN: %clang -no-canonical-prefixes -ccc-host-triple i386-unknown-linux %s -### -o %t.o 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s // CHECK-LD-32: "{{.*}}/ld" {{.*}} "-L/lib/../lib32" "-L/usr/lib/../lib32" // // RUN: %clang -no-canonical-p...
Remove dict2 interface -- it's now static.
/* Dictionary object type -- mapping from char * to object. NB: the key is given as a char *, not as a stringobject. These functions set errno for errors. Functions dictremove() and dictinsert() return nonzero for errors, getdictsize() returns -1, the others NULL. A successful call to dictinsert() calls INCREF() for ...
/* Dictionary object type -- mapping from char * to object. NB: the key is given as a char *, not as a stringobject. These functions set errno for errors. Functions dictremove() and dictinsert() return nonzero for errors, getdictsize() returns -1, the others NULL. A successful call to dictinsert() calls INCREF() for ...
Make the constants easier to understand
#include <stdio.h> #include <stdlib.h> #include <string.h> const char RAW[] = "/bin/stty raw"; const char default_str[] = "I AM AN IDIOT "; int main(int argc, char **argv) { const char *str; if ( argc == 2 ) str = argv[1]; else str = default_str; size_t len = strlen(str); system(RAW); while ( ...
#include <stdio.h> #include <stdlib.h> #include <string.h> const char RAW[] = "/bin/stty raw"; #define CLEAR_LINE "\x1b[2K" #define GOTO_START "\r" #define GOTO_NEXT_LINE "\n" const char default_str[] = "I AM AN IDIOT "; int main(int argc, char **argv) { const char *str; if ( argc == 2 ) str = argv[1...
Add classic Wirth problem on numbers 1-100.
/* Copyright 2012 Dennis Decker Jensen http://programmingpraxis.com/2012/12/07/wirth-problem-15-12/ In his 1973 book "Systematic Programming: An Introduction", Niklaus Wirth gives the following problem as exercise 15.12: Develop a program that generates in ascending order the least 100 numbers of the set M, where M ...
Change stubs for VDP1 cons driver
/* * Copyright (c) 2012 Israel Jacques * See LICENSE for details. * * Israel Jacques <mrko@eecs.berkeley.edu> */ #include "cons.h" typedef struct { } cons_vdp1_t; static struct cons_vdp1_t *cons_vdp1_new(void); static void cons_vdp1_write(struct cons *, int, uint8_t, uint8_t); void cons_vdp1_init(struct cons *...
/* * Copyright (c) 2012 Israel Jacques * See LICENSE for details. * * Israel Jacques <mrko@eecs.berkeley.edu> */ #include <inttypes.h> #include <stdbool.h> #include <ctype.h> #include <string.h> #include "cons.h" typedef struct { } cons_vdp1_t; static cons_vdp1_t *cons_vdp1_new(void); static void cons_vdp1_res...
Read on stdin for is_utf8 -
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "is_utf8.h" int main(int ac, char **av) { if (ac != 2) { fprintf(stderr, "USAGE: %s string\n", av[0]); return EXIT_FAILURE; } return is_utf8((unsigned char*)av[1], strlen(av[1])); }
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include "is_utf8.h" #define BUFSIZE 4096 int main(int ac, char **av) { char buffer[BUFSIZE]; int read_retval; if (ac != 2) { fprintf(stderr, "USAGE: %s STRING or - for stdin.\n", av[0]); return EXIT_FAILU...
Add dummy test for (fT).
#include <err.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include "pt.h" #define EPSILON 1.0e-8 int main(int argc, char **argv) { double e_ft, e_ref, *f_ov, *d_ov, *l1, *t2, *l2, *i_oovv; double *i2_oovo, *i3_ovvv, *i6_oovo, *i7_ovvv; size_t o, v; #ifdef WITH_MPI MPI_Init(&argc, &argv); #endif ...
Fix for different build configurations.
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s extern void abort() __attribute__((noreturn)); void f1() { abort(); } // CHECK-LABEL: define void @f1() // CHECK-NEXT: entry: // CHECK-NEXT: call void @abort() // CHECK-NEXT: unreachable // CHECK-NEXT: } void *f2() { abort(); return 0; } // CHECK-LABEL: ...
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s extern void abort() __attribute__((noreturn)); void f1() { abort(); } // CHECK-LABEL: define {{.*}}void @f1() // CHECK-NEXT: entry: // CHECK-NEXT: call void @abort() // CHECK-NEXT: unreachable // CHECK-NEXT: } void *f2() { abort(); return 0; } // CHECK-L...
Tweak test run line for readability
// RUN: not %clang %s -verify 2>&1 | FileCheck %s // RUN: %clang -cc1 -verify %s // expected-no-diagnostics // Test that -verify is strictly rejected as unknown by the driver. // CHECK: unknown argument: '-verify'
// RUN: not %clang -verify %s 2>&1 | FileCheck %s // RUN: %clang -cc1 -verify %s // expected-no-diagnostics // Test that -verify is strictly rejected as unknown by the driver. // CHECK: unknown argument: '-verify'
Simplify importing Foundation while still compatible with C++
// // KeepLayout.h // Keep Layout // // Created by Martin Kiss on 28.1.13. // Copyright (c) 2013 Triceratops. All rights reserved. // #ifdef __cplusplus #import <Foundation/Foundation.h> #else @import Foundation; #endif FOUNDATION_EXPORT double KeepLayoutVersionNumber; FOUNDATION_EXPORT const unsigned char ...
// // KeepLayout.h // Keep Layout // // Created by Martin Kiss on 28.1.13. // Copyright (c) 2013 Triceratops. All rights reserved. // #import <Foundation/Foundation.h> FOUNDATION_EXPORT double KeepLayoutVersionNumber; FOUNDATION_EXPORT const unsigned char KeepLayoutVersionString[]; #import "KeepTypes.h" #imp...
Add 06-symbeq/14-list_entry_rc version where alloc unrolling gives enough precision
// PARAM: --disable ana.mutex.disjoint_types --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" --set ana.malloc.unique_address_count 1 // Copied from 06-symbeq/14-list_entry_rc, proven safe thanks to unique address #include<pthread.h> #include<stdlib.h> #include<stdio.h> #define list_entry(ptr, ...
Update Skia milestone to 60
/* * 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 59 #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 60 #endif
Add missing header file guards
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the GNU General Public License version 2. Note that NO WARRANTY is provided. * See "LICENSE_GPLv2.txt" for details. * * @TAG(NICTA_GPL) */ #include <platsupport/io.h> /** * This function initialises the h...
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the GNU General Public License version 2. Note that NO WARRANTY is provided. * See "LICENSE_GPLv2.txt" for details. * * @TAG(NICTA_GPL) */ #ifndef ETHIF_INTEL_H #define ETHIF_INTEL_H #include <platsupport/...
Add alternative implementation of memory.h
#include <cstddef> #include <memory> #include <type_traits> #include <utility> #if (!defined(__clang__) && !defined(_MSC_VER) && __GNUC__ == 4 && __GNUC_MINOR__ < 9) namespace std { template <class T> struct _Unique_if { typedef unique_ptr<T> _Single_object; }; template <class T> struct _Unique_if<T[]> { typedef...
Remove a needless using namespace
#ifndef RBOSL_MOVE_H #define RBOSL_MOVE_H #include "ruby.h" #include <osl/move.h> extern VALUE cMove; using namespace osl; #ifdef __cplusplus extern "C" { #endif extern void Init_move(VALUE mOsl); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* RBOSL_MOVE_H */
#ifndef RBOSL_MOVE_H #define RBOSL_MOVE_H #include "ruby.h" #include <osl/move.h> extern VALUE cMove; #ifdef __cplusplus extern "C" { #endif extern void Init_move(VALUE mOsl); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* RBOSL_MOVE_H */
Add basic packet handling code
#include <stdio.h> #include <string.h> #include <math.h> struct Packet { unsigned int status: 1; unsigned int group: 2; unsigned int plug: 2; }; unsigned int packet_to_binary(struct Packet packet) { unsigned int binary = (packet.status << 7); binary |= ((packet.group & 0x3) << 2); binary |= (p...
Add test exhibiting problematic issue
// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy extern int __VERIFIER_nondet_int(); void change(int *p) { (*p)++; } int g; int main() { int c = __VERIFIER_nondet_int(); g = ...
// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy extern int __VERIFIER_nondet_int(); void change(int *p) { (*p)++; } int g; int main() { int c = __VERIFIER_nondet_int(); g = ...
Correct define for this file. Fix function declarations.
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #ifdef E_TYPEDEFS #else #ifndef E_WIDGET_BUTTON_H #define E_WIDGET_BUTTON_H EAPI Evas_Object *e_widget_iconsel_add(Evas *evas, Evas_Object *icon, Evas_Coord minw, Evas_Coord minh, void (*func) (void *data, void *data2), void *data, void *data2); EAPI Evas_Obj...
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #ifdef E_TYPEDEFS #else #ifndef E_WIDGET_ICONSEL_H #define E_WIDGET_ICONSEL_H EAPI Evas_Object *e_widget_iconsel_add(Evas *evas, Evas_Object *icon, Evas_Coord minw, Evas_Coord minh, char **file); EAPI Evas_Object *e_widget_iconsel_add_from_file(Evas *evas, ch...
Remove explicit from zero-parameter constructor
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_ #define CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_ #include "base/memory/sin...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_ #define CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_ #include "base/memory/sin...
Remove the use of PATH_MAX from the Windows implementation of getProgramPath(). (dm)
/* * BRLTTY - A background process providing access to the Linux console (when in * text mode) for a blind person using a refreshable braille display. * * Copyright (C) 1995-2004 by The BRLTTY Team. All rights reserved. * * BRLTTY comes with ABSOLUTELY NO WARRANTY. * * This is free software, placed und...
/* * BRLTTY - A background process providing access to the Linux console (when in * text mode) for a blind person using a refreshable braille display. * * Copyright (C) 1995-2004 by The BRLTTY Team. All rights reserved. * * BRLTTY comes with ABSOLUTELY NO WARRANTY. * * This is free software, placed und...
Add intersected query to data.
/* * Contains the information about an intersection. * Author: Dino Wernli */ #ifndef INTERSECTIONDATA_H_ #define INTERSECTIONDATA_H_ #include "scene/element.h" #include "scene/material.h" #include "util/point3.h" #include "util/ray.h" struct IntersectionData { // Builds a new struct for this specific ray. The ...
/* * Contains the information about an intersection. * Author: Dino Wernli */ #ifndef INTERSECTIONDATA_H_ #define INTERSECTIONDATA_H_ #include "scene/element.h" #include "scene/material.h" #include "util/point3.h" #include "util/ray.h" struct IntersectionData { // Builds a new struct for this specific ray. The ...
Fix hardcoded address length (IPv6 address are > 16 in length)
/// // // LibSourcey // Copyright (c) 2005, Sourcey <https://sourcey.com> // // SPDX-License-Identifier: LGPL-2.1+ // /// @addtogroup net /// @{ #ifndef SCY_Net_DNS_H #define SCY_Net_DNS_H #include "scy/net/net.h" #include "scy/net/address.h" #include "scy/request.h" #include "scy/logger.h" #include "scy/util.h" ...
/// // // LibSourcey // Copyright (c) 2005, Sourcey <https://sourcey.com> // // SPDX-License-Identifier: LGPL-2.1+ // /// @addtogroup net /// @{ #ifndef SCY_Net_DNS_H #define SCY_Net_DNS_H #include "scy/net/net.h" #include "scy/net/address.h" #include "scy/request.h" #include "scy/logger.h" #include "scy/util.h" ...
Update test case to be compatible with auto-migration to new getelementptr syntax coming in the near future
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s char buffer[32] = "This is a largely unused buffer"; // __builtin___clear_cache always maps to @llvm.clear_cache, but what // each back-end produces is different, and this is tested in LLVM int main() { __builtin___clear_cache(buffer, buffer+32); // CHECK: @llvm...
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s char buffer[32] = "This is a largely unused buffer"; // __builtin___clear_cache always maps to @llvm.clear_cache, but what // each back-end produces is different, and this is tested in LLVM int main() { __builtin___clear_cache(buffer, buffer+32); // CHECK: @llvm...
Add safe string macro checking
/*********************************** LICENSE **********************************\ * Copyright 2017 Morphux * * * * Licensed under the Apache License, Version 2.0 (the "License"); ...
/*********************************** LICENSE **********************************\ * Copyright 2017 Morphux * * * * Licensed under the Apache License, Version 2.0 (the "License"); ...
Work around Mac not having `pthread_spinlock`
#include <pthread.h> #include <stdio.h> int myglobal; pthread_spinlock_t spinlock1; pthread_spinlock_t spinlock2; void *t_fun(void *arg) { pthread_spin_lock(&spinlock1); myglobal=myglobal+1; // NORACE pthread_spin_unlock(&spinlock1); return NULL; } int main(void) { pthread_t id; pthread_create(&id, NULL,...
#include <pthread.h> #include <stdio.h> #ifdef __APPLE__ int main(void) { // OS X has no spin_lock int x =5; //NORACE } #else int myglobal; pthread_spinlock_t spinlock1; pthread_spinlock_t spinlock2; void *t_fun(void *arg) { pthread_spin_lock(&spinlock1); myglobal=myglobal+1; // NORACE ...
Use of_get_next_parent to simplify code
/** * mpc5xxx_get_bus_frequency - Find the bus frequency for a device * @node: device node * * Returns bus frequency (IPS on MPC512x, IPB on MPC52xx), * or 0 if the bus frequency cannot be found. */ #include <linux/kernel.h> #include <linux/of_platform.h> #include <linux/export.h> #include <asm/mpc5xxx.h> u...
/** * mpc5xxx_get_bus_frequency - Find the bus frequency for a device * @node: device node * * Returns bus frequency (IPS on MPC512x, IPB on MPC52xx), * or 0 if the bus frequency cannot be found. */ #include <linux/kernel.h> #include <linux/of_platform.h> #include <linux/export.h> #include <asm/mpc5xxx.h> u...
Make this test actually pass, in addition to the previous patch which made it work.
// RUN: clang %s -emit-llvm -o - > %t1 // RUN: grep "shl i32 %tmp, 19" %t1 && // RUN: grep "ashr i32 %tmp1, 19" %t1 && // RUN: grep "shl i16 %tmp4, 1" %t1 && // RUN: grep "lshr i16 %tmp5, 9" %t1 && // RUN: grep "and i32 %tmp, -8192" %t1 && // RUN: grep "and i16 %tmp5, -32513" %t1 && // RUN: grep "getelementptr (i32\* b...
// RUN: clang %s -emit-llvm -o - > %t1 // RUN: grep "shl i32 .*, 19" %t1 && // RUN: grep "ashr i32 .*, 19" %t1 && // RUN: grep "shl i16 .*, 1" %t1 && // RUN: grep "lshr i16 .*, 9" %t1 && // RUN: grep "and i32 .*, -8192" %t1 && // RUN: grep "and i16 .*, -32513" %t1 && // RUN: grep "getelementptr (i32\* bitcast (.struct....
Remove usage of deprecated glib stuff.
#ifndef TESTGP11HELPERS_H_ #define TESTGP11HELPERS_H_ #include "gp11.h" #define FAIL_RES(res, e) do { \ g_assert ((res) ? FALSE : TRUE); \ g_assert ((e) && (e)->message && "error should be set"); \ g_clear_error (&e); \ } while (0) #define SUCCESS_RES(res, err) do { \ if (!(res)) g_printerr ("error: %s\n", err ...
#ifndef TESTGP11HELPERS_H_ #define TESTGP11HELPERS_H_ #include "gp11.h" #define FAIL_RES(res, e) do { \ g_assert ((res) ? FALSE : TRUE); \ g_assert ((e) && (e)->message && "error should be set"); \ g_clear_error (&e); \ } while (0) #define SUCCESS_RES(res, err) do { \ if (!(res)) g_printerr ("error: %s\n", err ...
Add a common kernel entry point
/* * Common kernel entry point. */ #include <multiboot.h> #include <types.h> /* * This function is called by the architecture-specific boot proceedure, and * defines the entry to the euclid kernel. */ int k_main(struct multiboot *mboot, u32 stack); int k_main(struct multiboot *mboot, u32 stack) { /* For now le...
Fix depracted boost asio types
#ifndef SESSION_CLIENT_H #define SESSION_CLIENT_H /// PROJECT #include <csapex/io/session.h> /// SYSTEM #include <boost/asio.hpp> namespace csapex { class SessionClient : public Session { public: SessionClient(const std::string& ip, int port); ~SessionClient() override; std::string getDescription() cons...
#ifndef SESSION_CLIENT_H #define SESSION_CLIENT_H /// PROJECT #include <csapex/io/session.h> /// SYSTEM #include <boost/asio.hpp> #include <boost/version.hpp> namespace csapex { class SessionClient : public Session { public: SessionClient(const std::string& ip, int port); ~SessionClient() override; std:...
Replace implementation of is_detected with one that works with gcc
#pragma once #include <type_traits> namespace Halley { // is_detected_v is based on https://en.cppreference.com/w/cpp/experimental/is_detected namespace detail { template<template<class...> class Expr, class... Args> std::false_type is_detected_impl(...); template<template<class...> class Expr, cla...
#pragma once #include <type_traits> namespace Halley { // is_detected_v is based on https://en.cppreference.com/w/cpp/experimental/is_detected struct nonesuch { ~nonesuch() = delete; nonesuch(nonesuch const&) = delete; void operator=(nonesuch const&) = delete; }; namespace detail { template <cl...
Update client version to 0.9.5
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning and copyright year // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 9 #define CLIENT_VERSION_REVISION 3 #define CLIENT_VERSION_BUILD ...
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning and copyright year // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 9 #define CLIENT_VERSION_REVISION 5 #define CLIENT_VERSION_BUILD ...
Add relational protection-based litmus test
// PARAM: --sets ana.activated[+] octApron #include <pthread.h> #include <assert.h> int g = 42; // matches write in t_fun pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A); pthread_mutex_lock(&B); g = 42; pthread_mutex...
Call into the discovery function and wait for someone to say hi
#include <syslog.h> #include "cl_discovery.h" #include "cl_discovery_thread.h" void * start_discovery(void * args) { syslog(LOG_INFO, "started discovery thread"); for (;;) { continue; } }
#include <stdlib.h> #include <syslog.h> #include "cl_discovery.h" #include "cl_discovery_thread.h" void * start_discovery(void * args) { syslog(LOG_INFO, "started discovery thread"); for (;;) { struct CL_Discovery_Transport *discovered_transport = malloc(sizeof(struct CL_Discovery_Transport)); wait_for_t...
ADD Local Gardient (really high pass)
/*========================================================================= 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 ...
Fix warning about struct/class mismatch
#ifndef SEARCHRESULTCOLOR_H #define SEARCHRESULTCOLOR_H #include <QColor> namespace Find { namespace Internal { struct SearchResultColor{ QColor textBackground; QColor textForeground; QColor highlightBackground; QColor highlightForeground; }; } // namespace Internal } // namespace Find #endif // SE...
#ifndef SEARCHRESULTCOLOR_H #define SEARCHRESULTCOLOR_H #include <QColor> namespace Find { namespace Internal { class SearchResultColor{ public: QColor textBackground; QColor textForeground; QColor highlightBackground; QColor highlightForeground; }; } // namespace Internal } // namespace Find #endi...
Fix sw build error by using TESS_API for global variable log_level
/********************************************************************** * File: tprintf.h * Description: Trace version of printf - portable between UX and NT * Author: Phil Cheatle * * (C) Copyright 1995, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); ** you m...
/********************************************************************** * File: tprintf.h * Description: Trace version of printf - portable between UX and NT * Author: Phil Cheatle * * (C) Copyright 1995, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); ** you m...
Add a CountDownLatch class like Java's
// Copyright (c) 2013, Cloudera, inc. // // This is a C++ implementation of the Java CountDownLatch // class. // See http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/CountDownLatch.html #ifndef KUDU_UTIL_COUNTDOWN_LATCH_H #define KUDU_UTIL_COUNTDOWN_LATCH_H #include <boost/noncopyable.hpp> #include <boost...
Make a new GenericBinaryInst class, instead of providing lots of silly little classes.
//===-- llvm/iBinary.h - Binary Operator node definitions --------*- C++ -*--=// // // This file contains the declarations of all of the Binary Operator classes. // //===----------------------------------------------------------------------===// #ifndef LLVM_IBINARY_H #define LLVM_IBINARY_H #include "llvm/InstrTypes....
//===-- llvm/iBinary.h - Binary Operator node definitions --------*- C++ -*--=// // // This file contains the declarations of all of the Binary Operator classes. // //===----------------------------------------------------------------------===// #ifndef LLVM_IBINARY_H #define LLVM_IBINARY_H #include "llvm/InstrTypes....
Revert "[PATCH] LOG2: Alter get_order() so that it can make use of ilog2() on a constant"
#ifndef _ASM_GENERIC_PAGE_H #define _ASM_GENERIC_PAGE_H #ifdef __KERNEL__ #ifndef __ASSEMBLY__ #include <linux/log2.h> /* * non-const pure 2^n version of get_order * - the arch may override these in asm/bitops.h if they can be implemented * more efficiently than using the arch log2 routines * - we use the non-...
#ifndef _ASM_GENERIC_PAGE_H #define _ASM_GENERIC_PAGE_H #ifdef __KERNEL__ #ifndef __ASSEMBLY__ #include <linux/compiler.h> /* Pure 2^n version of get_order */ static __inline__ __attribute_const__ int get_order(unsigned long size) { int order; size = (size - 1) >> (PAGE_SHIFT - 1); order = -1; do { size >>= 1...
Add skipped regression test that exposes unsoundness when comparing addresses with integer and field offset.
// SKIP #include <assert.h> struct str{ int a; char c; }; int main(){ struct str a; char* ca = (char*) &a; void *ptr = &ca[4]; void *ptr2 = &a.c; int z = 1; // Alginment of struct fields, and thus result of the equality check here is implementation defined. if(ptr == ptr2){ ...
Add method to retrieve object using an URI
@import CoreData; @interface NSManagedObject (HYPURI) - (NSString *)hyp_URI; @end
@import CoreData; @interface NSManagedObject (HYPURI) - (NSString *)hyp_URI; + (NSManagedObject *)managedObjectWithURI:(NSString *)URI inContext:(NSManagedObjectContext *)context; @end
Add missing file. Oops :(
// Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this // source code is governed by a BSD-style license that can be found in the // LICENSE file. #ifndef WEBKIT_GLUE_SCREEN_INFO_H_ #define WEBKIT_GLUE_SCREEN_INFO_H_ #include "base/gfx/rect.h" namespace webkit_glue { struct ScreenInfo { int...
Revert "Revert "Add support for the Python Stdout Log""
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. #pragma once #include "ModuleManager.h" DECLARE_LOG_CATEGORY_EXTERN(LogPython, Log, All); class UNREALENGINEPYTHON_API FUnrealEnginePythonModule : public IModuleInterface { public: bool PythonGILAcquire(); void PythonGILRelease(); virtual void Start...
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. #pragma once #include "ModuleManager.h" DECLARE_LOG_CATEGORY_EXTERN(LogPython, Log, All); class UNREALENGINEPYTHON_API FUnrealEnginePythonModule : public IModuleInterface { public: bool PythonGILAcquire(); void PythonGILRelease(); virtual void Start...
Add source code documentation for the Merge Operator class
// // RocksDBMergeOperator.h // ObjectiveRocks // // Created by Iska on 07/12/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> @interface RocksDBMergeOperator : NSObject + (instancetype)operatorWithName:(NSString *)name andBlock:(id (^)(id key, id existingVal...
// // RocksDBMergeOperator.h // ObjectiveRocks // // Created by Iska on 07/12/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> /** A Merge operator is an atomic Read-Modify-Write operation in RocksDB. */ @interface RocksDBMergeOperator : NSObject /** Initialize...
Disable a method in adapter
// // AKTableViewCellAdapter.h // AppKit // // Created by Zijiao Liu on 12/20/15. // Copyright © 2015 Zijiao Liu. All rights reserved. // #import "AKTableViewConfiguration.h" #import "AKTableViewCell.h" @interface AKTableViewCellAdapter : NSObject <AKTableViewConfiguration> - (CGFloat)dataViewController:(nonnull...
// // AKTableViewCellAdapter.h // AppKit // // Created by Zijiao Liu on 12/20/15. // Copyright © 2015 Zijiao Liu. All rights reserved. // #import "AKTableViewConfiguration.h" #import "AKTableViewCell.h" @interface AKTableViewCellAdapter : NSObject <AKTableViewConfiguration> - (CGFloat)dataViewController:(nonnull...
Change to use inline function instead of macro.
// // STPLocalizedStringUtils.h // Stripe // // Created by Brian Dorfman on 8/11/16. // Copyright © 2016 Stripe, Inc. All rights reserved. // #import <Foundation/Foundation.h> #define STPLocalizedString(key, comment) \ [STPLocalizationUtils localizedStripeStringForKey:(key)] @interface STPLocalizationUtils : NSO...
// // STPLocalizationUtils.h // Stripe // // Created by Brian Dorfman on 8/11/16. // Copyright © 2016 Stripe, Inc. All rights reserved. // #import <Foundation/Foundation.h> @interface STPLocalizationUtils : NSObject /** Acts like NSLocalizedString but tries to find the string in the Stripe bundle first if poss...
Fix includes to just what is needed.
// // BRScrollerUtilities.c // BRScroller // // Created by Matt on 7/11/13. // Copyright (c) 2013 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0. // #include "BRScrollerUtilities.h" #if !defined(MIN) #define MIN(A,B) ((A) < (B) ? (A) : (B)) #endif inline bool BRFloatsAreEqual(CGFl...
// // BRScrollerUtilities.c // BRScroller // // Created by Matt on 7/11/13. // Copyright (c) 2013 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0. // #include "BRScrollerUtilities.h" #include <math.h> #include <sys/param.h> inline bool BRFloatsAreEqual(CGFloat a, CGFloat b) { const...
Use Foundation in the umbrella header
// // RxHyperdrive.h // RxHyperdrive // // Created by Kyle Fuller on 13/09/2015. // Copyright © 2015 Cocode. All rights reserved. // #import <Cocoa/Cocoa.h> //! Project version number for RxHyperdrive. FOUNDATION_EXPORT double RxHyperdriveVersionNumber; //! Project version string for RxHyperdrive. FOUNDATION_EXP...
// // RxHyperdrive.h // RxHyperdrive // // Created by Kyle Fuller on 13/09/2015. // Copyright © 2015 Cocode. All rights reserved. // @import Foundation; //! Project version number for RxHyperdrive. FOUNDATION_EXPORT double RxHyperdriveVersionNumber; //! Project version string for RxHyperdrive. FOUNDATION_EXPORT ...
Add missing file from last commit
//===- ASTSerializationListener.h - Decl/Type PCH Write Events -*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===--------------------------------------------------------...
Add a simple test to play with libgcrypt
/* * test_gcrypt - Copyright 2009 Slide, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * *...
Rework solo5_yield to support multiple devices
/* * Copyright (c) 2017 Contributors as noted in the AUTHORS file * * This file is part of Solo5, a sandboxed execution environment. * * 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 pe...
/* * Copyright (c) 2017 Contributors as noted in the AUTHORS file * * This file is part of Solo5, a sandboxed execution environment. * * 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 pe...
Add definition for item structs
/*------------------------------------------------------------------------------ | NuCTex | items.h | Author | Benjamin A - Nullsrc | Created | 17 January, 2016 | Changed | 17 January, 2016 |------------------------------------------------------------------------------- | Overview | Declare item structures used in the ...
Add template overload for begin() arguments
#ifndef RCR_LEVEL1PAYLOAD_SETUP_H_ #define RCR_LEVEL1PAYLOAD_SETUP_H_ #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif namespace rcr { namespace level1payload { // Setup the object. Swallow any errors. template<typename T> inline void setup_object(T& obj, const char* e...
#ifndef RCR_LEVEL1PAYLOAD_SETUP_H_ #define RCR_LEVEL1PAYLOAD_SETUP_H_ #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif namespace rcr { namespace level1payload { // Setup the object. Swallow any errors. template<typename T, typename TArg> inline void setup_object(T& obj...
Add VIEWS_EXPORT to autoscroll constants.
// 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 VIEWS_VIEW_CONSTANTS_H_ #define VIEWS_VIEW_CONSTANTS_H_ #pragma once #include "views/views_export.h" namespace views { // Size (width or he...
// 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 VIEWS_VIEW_CONSTANTS_H_ #define VIEWS_VIEW_CONSTANTS_H_ #pragma once #include "views/views_export.h" namespace views { // Size (width or he...
Update clear test to use keys longer than 8 chars
#include "sphia-test.h" // See #51 static void test_clear_similar_keys() { sphia_set(sphia, "key-1", "hello world"); sphia_set(sphia, "key-10", "hello world"); assert(2 == sphia_count(sphia)); assert(0 == sphia_clear(sphia)); assert(0 == sphia_count(sphia)); } TEST(test_clear_similar_keys);
#include "sphia-test.h" // See #51 static void test_clear_similar_keys() { sphia_set(sphia, "key-1", "hello world"); sphia_set(sphia, "key-10", "hello world"); sphia_set(sphia, "00000000", "hello world"); sphia_set(sphia, "000000000", "hello world"); assert(4 == sphia_count(sphia)); assert(0 == sphia_clea...
Add missing return to 13/67
#include<pthread.h> #include<stdio.h> #include<unistd.h> #include <assert.h> int g; pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t cond = PTHREAD_COND_INITIALIZER; void* f1(void* ptr) { pthread_mutex_lock(&mut); g = 1; pthread_cond_wait(&cond,&mut); assert(g == 0); // TODO (no cond-f...
#include<pthread.h> #include<stdio.h> #include<unistd.h> #include <assert.h> int g; pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t cond = PTHREAD_COND_INITIALIZER; void* f1(void* ptr) { pthread_mutex_lock(&mut); g = 1; pthread_cond_wait(&cond,&mut); assert(g == 0); // TODO (no cond-f...