Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Add support for i386 in cc1
#define TINT long long #define TUINT unsigned long long #define TFLOAT double #define L_SCHAR L_INT8 #define L_UCHAR L_UINT8 #define L_CHAR L_INT8 #define L_SHORT L_INT16 #define L_USHORT L_UINT16 #define L_INT L_INT32 #define L_UINT L_UINT32 #define L_LONG L_INT3...
Fix error in example code
#include <cgreen/cgreen.h> #include <cgreen/mocks.h> void convert_to_uppercase(char *converted_string, const char *original_string) { mock(converted_string, original_string); } Ensure(setting_content_of_out_parameter) { expect(convert_to_uppercase, when(original_string, is_equal_to_string("upper ca...
#include <cgreen/cgreen.h> #include <cgreen/mocks.h> void convert_to_uppercase(char *converted_string, const char *original_string) { mock(converted_string, original_string); } Ensure(setting_content_of_out_parameter) { expect(convert_to_uppercase, when(original_string, is_equal_to_string("upper ca...
Add DLL export attribute to |hir::InstructionVisitor| to use it in compiler.
// Copyright 2014-2015 Project Vogue. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ELANG_HIR_INSTRUCTION_VISITOR_H_ #define ELANG_HIR_INSTRUCTION_VISITOR_H_ #include "base/macros.h" #include "elang/hir/instructions_forward.h" nam...
// Copyright 2014-2015 Project Vogue. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ELANG_HIR_INSTRUCTION_VISITOR_H_ #define ELANG_HIR_INSTRUCTION_VISITOR_H_ #include "base/macros.h" #include "elang/hir/hir_export.h" #include "elan...
Fix GCC_WARN_ABOUT_MISSING_NEWLINE in header file
// C SUGAR #define unless(condition) if(!(condition)) // OBJC SUGAR #import "NSNumber+ObjectiveSugar.h" #import "NSArray+ObjectiveSugar.h" #import "NSMutableArray+ObjectiveSugar.h" #import "NSDictionary+ObjectiveSugar.h" #import "NSSet+ObjectiveSugar.h" #import "NSString+ObjectiveSugar.h"
// C SUGAR #define unless(condition) if(!(condition)) // OBJC SUGAR #import "NSNumber+ObjectiveSugar.h" #import "NSArray+ObjectiveSugar.h" #import "NSMutableArray+ObjectiveSugar.h" #import "NSDictionary+ObjectiveSugar.h" #import "NSSet+ObjectiveSugar.h" #import "NSString+ObjectiveSugar.h"
Fix 30/03 by adding threadid and threadflag analyses
// PARAM: --sets solver td3 --enable ana.int.interval --enable exp.partition-arrays.enabled --enable exp.fast_global_inits --set ana.activated "['base','expRelation','mallocWrapper']" // Without fast_global_inits this takes >150s, when it is enabled < 0.1s int global_array[50][500][20]; int main(void) { for(int i ...
// PARAM: --sets solver td3 --enable ana.int.interval --enable exp.partition-arrays.enabled --enable exp.fast_global_inits --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper']" // Without fast_global_inits this takes >150s, when it is enabled < 0.1s int global_array[50][500][20]; int m...
Remove absolute path form include test.
// RUN: %clang_cc1 -verify -E -frewrite-includes %s -o - | FileCheck -strict-whitespace %s #include "foobar.h" // expected-error {{'foobar.h' file not found}} // CHECK: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}} // CHECK-NEXT: {{^}}#include "foobar.h" // CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-inclu...
// RUN: %clang_cc1 -verify -E -frewrite-includes %s -o - | FileCheck -strict-whitespace %s #include "foobar.h" // expected-error {{'foobar.h' file not found}} // CHECK: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}} // CHECK-NEXT: {{^}}#include "foobar.h" // CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-inclu...
Add documentation to the SessionContext
#ifndef __MESSAGES__MESSAGE_CONTEXT_H__ #define __MESSAGES__MESSAGE_CONTEXT_H__ #include "request_message.h" #include "reply_message.h" #include "backend.h" namespace traffic { class SessionContext : public RequestVisitor { private: std::unique_ptr<ReplyMessage> _message; DataProvider::ptr_t _data_provider; prot...
#ifndef __MESSAGES__MESSAGE_CONTEXT_H__ #define __MESSAGES__MESSAGE_CONTEXT_H__ #include "request_message.h" #include "reply_message.h" #include "backend.h" namespace traffic { /** * \brief This is the context for a request/reply session. * * This context is allocated for each request to process the data. It rep...
Fix term_print_dec Would print a leading 0 if number wasn't a power of 10
// Print formatted output to the VGA terminal #include "vga.h" #include <stdarg.h> void term_print_dec(int x) { int divisor = 1; for (; divisor < x; divisor *= 10) ; for (; divisor > 0; divisor /= 10) term_putchar(((x / divisor) % 10) + '0'); } void term_printf(const char *fmt, ...) { va_list arg...
// Print formatted output to the VGA terminal #include "vga.h" #include <stdarg.h> static void term_print_dec(int x) { int divisor = 1; for (; divisor <= x; divisor *= 10) ; divisor /= 10; for (; divisor > 0; divisor /= 10) term_putchar(((x / divisor) % 10) + '0'); } void term_printf(const char ...
Fix compile breakage for IBM/AMCC 4xx arch/ppc platforms
#include <linux/module.h> #include <asm/ocp.h> struct ocp_sys_info_data ocp_sys_info = { .opb_bus_freq = 50000000, /* OPB Bus Frequency (Hz) */ .ebc_bus_freq = 33333333, /* EBC Bus Frequency (Hz) */ }; EXPORT_SYMBOL(ocp_sys_info);
#include <linux/module.h> #include <asm/ibm4xx.h> #include <asm/ocp.h> struct ocp_sys_info_data ocp_sys_info = { .opb_bus_freq = 50000000, /* OPB Bus Frequency (Hz) */ .ebc_bus_freq = 33333333, /* EBC Bus Frequency (Hz) */ }; EXPORT_SYMBOL(ocp_sys_info);
Fix a problem with the RUN line of one of the PCH tests
// Test this without pch. // RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include %S/va_arg.h %s -emit-llvm -o - && // Test with pch. // RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -o %t %S/va_arg.h && // RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include-pch %t %s -emit-llvm -o - char *g0(char** argv, ...
// Test this without pch. // RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include %S/va_arg.h %s -emit-llvm -o - && // Test with pch. // RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -emit-pch -o %t %S/va_arg.h && // RUN: clang-cc -triple=x86_64-unknown-freebsd7.0 -include-pch %t %s -emit-llvm -o - char *g0(cha...
Fix header file usage so that NULL is defined. NULL is needed by unicodedata_db.h.
/* ------------------------------------------------------------------------ unicodedatabase -- The Unicode 3.0 data base. Data was extracted from the Unicode 3.0 UnicodeData.txt file. Written by Marc-Andre Lemburg (mal@lemburg.com). Rewritten for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com) C...
/* ------------------------------------------------------------------------ unicodedatabase -- The Unicode 3.0 data base. Data was extracted from the Unicode 3.0 UnicodeData.txt file. Written by Marc-Andre Lemburg (mal@lemburg.com). Rewritten for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com) C...
Fix up cpu to node mapping in sysfs.
#include <linux/cpu.h> #include <linux/cpumask.h> #include <linux/init.h> #include <linux/percpu.h> #include <linux/node.h> #include <linux/nodemask.h> static DEFINE_PER_CPU(struct cpu, cpu_devices); static int __init topology_init(void) { int i, ret; #ifdef CONFIG_NEED_MULTIPLE_NODES for_each_online_node(i) reg...
/* * arch/sh/kernel/topology.c * * Copyright (C) 2007 Paul Mundt * * 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. */ #include <linux/cpu.h> #include <linux/cpumask.h> #include <linux/init...
Remove obsolete defines from Android CDM file.
// Copyright (c) 2013 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 WIDEVINE_CDM_VERSION_H_ #define WIDEVINE_CDM_VERSION_H_ #include "third_party/widevine/cdm/widevine_cdm_common.h" // Indicates that the Wide...
// Copyright (c) 2013 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 WIDEVINE_CDM_VERSION_H_ #define WIDEVINE_CDM_VERSION_H_ #include "third_party/widevine/cdm/widevine_cdm_common.h" // Indicates that the Wide...
Add a consumer that just counts samples.
// --------------------------------------------------------------------- // // Copyright (C) 2019 by the SampleFlow authors. // // This file is part of the SampleFlow library. // // The deal.II library is free software; you can use it, redistribute // it, and/or modify it under the terms of the GNU Lesser General // Pu...
Add documentation for the Job class
/****************************************************************************** This source file is part of the MoleQueue project. Copyright 2011 Kitware, Inc. This source code is released under the New BSD License, (the "License"). Unless required by applicable law or agreed to in writing, software distr...
/****************************************************************************** This source file is part of the MoleQueue project. Copyright 2011 Kitware, Inc. This source code is released under the New BSD License, (the "License"). Unless required by applicable law or agreed to in writing, software distr...
Fix componene debug build failure in chromium
/* * Copyright 2015 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ // This file is not part of the public Skia API. #ifndef SkSpinlock_DEFINED #define SkSpinlock_DEFINED #include "SkAtomics.h" #define SK_DECLARE_STATIC_SPINLOCK(name) names...
/* * Copyright 2015 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ // This file is not part of the public Skia API. #ifndef SkSpinlock_DEFINED #define SkSpinlock_DEFINED #include "SkAtomics.h" #define SK_DECLARE_STATIC_SPINLOCK(name) names...
Add intermediate TextureVideoFrame typedef for Chromium
/* * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contribut...
Declare struct Center's member variables
#ifndef STRUCTURE_H #define STRUCTURE_H #include <vector> #include "Math/Vector2.h" enum class BiomeType { Snow, Tundra, Mountain, Taiga, Shrubland, TemprateDesert, TemprateRainForest, TemprateDeciduousForest, Grassland, TropicalRainForest, TropicalSeasonalForest, SubtropicalDesert, Ocean, Lake, Beach...
#ifndef STRUCTURE_H #define STRUCTURE_H #include <vector> #include "Math/Vector2.h" enum class BiomeType { Snow, Tundra, Mountain, Taiga, Shrubland, TemprateDesert, TemprateRainForest, TemprateDeciduousForest, Grassland, TropicalRainForest, TropicalSeasonalForest, SubtropicalDesert, Ocean, Lake, Beach...
Fix Lth_Assert not using stderr
//----------------------------------------------------------------------------- // // Copyright © 2016 Project Golan // // See "LICENSE" for more information. // //----------------------------------------------------------------------------- // // Assertions. // //-------------------------------------------------------...
//----------------------------------------------------------------------------- // // Copyright © 2016 Project Golan // // See "LICENSE" for more information. // //----------------------------------------------------------------------------- // // Assertions. // //-------------------------------------------------------...
Update version number to 8.03.01-k9.
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.03.01-k8" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 3 #define QLA_DRIVER_PATCH_VER 1 #define...
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2008 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.03.01-k9" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 3 #define QLA_DRIVER_PATCH_VER 1 #define...
Add fontBoundingDescent and Ascent and add constructor with them
#ifndef _TEXTMETRICS_H_ #define _TEXTMETRICS_H_ namespace canvas { class TextMetrics { public: TextMetrics() : width(0) { } TextMetrics(float _width) : width(_width) { } float width; #if 0 float ideographicBaseline; float alphabeticBaseline; float hangingBaseline; float emHeightDescen...
#ifndef _TEXTMETRICS_H_ #define _TEXTMETRICS_H_ namespace canvas { class TextMetrics { public: TextMetrics() : width(0) { } TextMetrics(float _width) : width(_width) { } TextMetrics(float _width, float fontBoundingBoxDescent, float _fontBoundingBoxAscent) : width(_width) fontBoundingBoxDescent(_fontBoundi...
Add CR_ prefix to header defines
#ifndef IPC_NS_H_ #define IPC_NS_H_ #include "crtools.h" extern void show_ipc_ns(int fd); extern int dump_ipc_ns(int ns_pid, struct cr_fdset *fdset); extern int prepare_ipc_ns(int pid); #endif /* IPC_NS_H_ */
#ifndef CR_IPC_NS_H_ #define CR_IPC_NS_H_ #include "crtools.h" extern void show_ipc_ns(int fd); extern int dump_ipc_ns(int ns_pid, struct cr_fdset *fdset); extern int prepare_ipc_ns(int pid); #endif /* CR_IPC_NS_H_ */
Fix path in tails_files C wrapper
#include <unistd.h> int main(int argc, char* argv) { setuid(0); // Use absolute path to the Python binary and execl to avoid $PATH or symlink trickery execl("/usr/bin/python2.7", "python2.7", "/home/vagrant/tails_files/test.py", (char*)NULL); return 0; }
#include <unistd.h> int main(int argc, char* argv) { setuid(0); // Use absolute path to the Python binary and execl to avoid $PATH or symlink trickery execl("/usr/bin/python2.7", "python2.7", "/home/amnesia/Persistent/.securedrop/securedrop_init.py", (char*)NULL); return 0; }
Fix types in CRC16 function
#include "modlib.h" uint16_t MODBUSSwapEndian( uint16_t Data ) { //Change big-endian to little-endian and vice versa uint8_t Swap; //Create 2 bytes long union union Conversion { uint16_t Data; uint8_t Bytes[2]; } Conversion; //Swap bytes Conversion.Data = Data; Swap = C...
#include "modlib.h" uint16_t MODBUSSwapEndian( uint16_t Data ) { //Change big-endian to little-endian and vice versa uint8_t Swap; //Create 2 bytes long union union Conversion { uint16_t Data; uint8_t Bytes[2]; } Conversion; //Swap bytes Conversion.Data = Data; Swap = C...
Exit with error on missing behavior.
#ifndef VAST_ACTOR_H #define VAST_ACTOR_H #include <cppa/event_based_actor.hpp> #include "vast/logger.h" namespace vast { namespace exit { constexpr uint32_t done = cppa::exit_reason::user_defined; constexpr uint32_t stop = cppa::exit_reason::user_defined + 1; constexpr uint32_t error = cppa::exit_reason::user...
#ifndef VAST_ACTOR_H #define VAST_ACTOR_H #include <cppa/event_based_actor.hpp> #include "vast/logger.h" namespace vast { namespace exit { constexpr uint32_t done = cppa::exit_reason::user_defined; constexpr uint32_t stop = cppa::exit_reason::user_defined + 1; constexpr uint32_t error = cppa::exit_reason::user...
Add function to read peek rss usage.
#ifdef ENABLE_STATS #include <stdio.h> #include <sys/resource.h> static size_t stats_peek_rss() { struct rusage rusage; getrusage( RUSAGE_SELF, &rusage ); return (size_t) (rusage.ru_maxrss * 1024L); } __attribute__((destructor)) void _print_stats(void) { size_t rss = stats_peek_rss(); printf("Maximum RSS: ...
Add WiFiNINA, Arduino MKR WiFi 1010 support
/** * @file BlynkSimpleWiFiNINA.h * @author Volodymyr Shymanskyy * @license This project is released under the MIT License (MIT) * @copyright Copyright (c) 2018 Volodymyr Shymanskyy * @date Sep 2018 * @brief * */ #ifndef BlynkSimpleWiFiNINA_h #define BlynkSimpleWiFiNINA_h #ifndef BLYNK_INF...
Add third_party/ prefix to ppapi include for checkdeps.
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #include "ppapi/c/pp_var.h" #define PPB_PRIVATE_INTERFACE "PPB...
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #include "third_party/ppapi/c/pp_var.h" #define PPB_PRIVATE_IN...
Fix bad fileformat (was DOS without a final line terminator)
#ifndef QXTFILTERDIALOG_P_H_INCLUDED #define QXTFILTERDIALOG_P_H_INCLUDED #include <QObject> #include <QModelIndex> #include <QRegExp> #include <QPointer> #include "qxtpimpl.h" class QxtFilterDialog; class QAbstractItemModel; class QTreeView; class QSortFilterProxyModel; class QLineEdit; class QCheckBox...
#ifndef QXTFILTERDIALOG_P_H_INCLUDED #define QXTFILTERDIALOG_P_H_INCLUDED #include <QObject> #include <QModelIndex> #include <QRegExp> #include <QPointer> #include "qxtpimpl.h" class QxtFilterDialog; class QAbstractItemModel; class QTreeView; class QSortFilterProxyModel; class QLineEdit; class QCheckBox; class QCombo...
Increase corpus buffer to 16MB
//#define DEBUG_INDEXER #define MAX_CORPUS_FILE_SZ (1024 * 8)
//#define DEBUG_INDEXER #define MAX_CORPUS_FILE_SZ (1024 * 1024 * 16)
Initialize fNPDGcodes to 0 to prevent sigsegv (Christian)
#ifndef ROOT_TMevSimConverter #define ROOT_TMevSimConverter /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ #include "TObject.h" class TMevSimConverter : public TObject { enum {kMaxParticles = 35...
#ifndef ROOT_TMevSimConverter #define ROOT_TMevSimConverter /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ #include "TObject.h" class TMevSimConverter : public TObject { enum {kMaxParticles = 35...
Move assert test of EOF to after testing if a filter is done.
#include "fitz_base.h" #include "fitz_stream.h" fz_error fz_process(fz_filter *f, fz_buffer *in, fz_buffer *out) { fz_error reason; unsigned char *oldrp; unsigned char *oldwp; assert(!out->eof); oldrp = in->rp; oldwp = out->wp; if (f->done) return fz_iodone; reason = f->process(f, in, out); assert(i...
#include "fitz_base.h" #include "fitz_stream.h" fz_error fz_process(fz_filter *f, fz_buffer *in, fz_buffer *out) { fz_error reason; unsigned char *oldrp; unsigned char *oldwp; oldrp = in->rp; oldwp = out->wp; if (f->done) return fz_iodone; assert(!out->eof); reason = f->process(f, in, out); assert(i...
Define MPI_Session for compatibility with current mpi4py main branch
/* Author: Lisandro Dalcin */ /* Contact: dalcinl@gmail.com */ #ifndef MPI_COMPAT_H #define MPI_COMPAT_H #include <mpi.h> #if (MPI_VERSION < 3) && !defined(PyMPI_HAVE_MPI_Message) typedef void *PyMPI_MPI_Message; #define MPI_Message PyMPI_MPI_Message #endif #endif/*MPI_COMPAT_H*/
/* Author: Lisandro Dalcin */ /* Contact: dalcinl@gmail.com */ #ifndef MPI_COMPAT_H #define MPI_COMPAT_H #include <mpi.h> #if (MPI_VERSION < 3) && !defined(PyMPI_HAVE_MPI_Message) typedef void *PyMPI_MPI_Message; #define MPI_Message PyMPI_MPI_Message #endif #if (MPI_VERSION < 4) && !defined(PyMPI_HAVE_MPI_Sessio...
Mark Mine init privatization test TODO to make others pass
#include <pthread.h> #include <assert.h> int g; void *t_fun(void *arg) { return NULL; } void main() { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); g = 1; assert(g); // Mine's analysis would succeed, our mine-W doesn't }
#include <pthread.h> #include <assert.h> int g; void *t_fun(void *arg) { return NULL; } void main() { pthread_t id; pthread_create(&id, NULL, t_fun, NULL); g = 1; assert(g); // TODO (Mine's analysis would succeed, our mine-W doesn't) }
Add more zero-width fields to bitfield padding test
// RUN: %layout_check %s struct A { int : 0; int a; int : 0; int b; int : 0; }; struct A a = { 1, 2 };
// RUN: %layout_check %s struct A { int : 0; int a; int : 0; int : 0; int : 0; int : 0; int b; int : 0; }; struct A a = { 1, 2 };
Fix a test case broken by my previous commit.
// RUN: %clang_cc1 -fsyntax-only -std=c99 -Wno-nullability-declspec -pedantic %s -verify _Nonnull int *ptr; // expected-warning{{type nullability specifier '_Nonnull' is a Clang extension}} #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wnullability-extension" _Nonnull int *ptr2; // no-warning #prag...
// RUN: %clang_cc1 -fsyntax-only -std=c99 -Wno-nullability-declspec -pedantic %s -verify _Nonnull int *ptr; // expected-warning{{type nullability specifier '_Nonnull' is a Clang extension}} #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wnullability-extension" _Nonnull int *ptr2; // no-warning #prag...
Fix CPP issue on OS X
/* * Copyright (C) 2009 Cjacker Huang <jzhuang@redflag-linux.com>. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any late...
/* * Copyright (C) 2009 Cjacker Huang <jzhuang@redflag-linux.com>. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any late...
Fix function prototype in airplay plugin.
#ifndef _NET_UTILS_H #define _NET_UTILS_H #include <string.h> #include <unistd.h> #include <errno.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include <fcntl.h> char *get_local_addr(int fd); int set_sock_nonblock(int sockfd); int tcp_open(); ...
#ifndef _NET_UTILS_H #define _NET_UTILS_H #include <string.h> #include <unistd.h> #include <errno.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include <fcntl.h> char *get_local_addr(int fd); int set_sock_nonblock(int sockfd); int tcp_open(void...
Allow mog to track shadows
#pragma once #include "types/process_filter.h" namespace TooManyPeeps { class BackgroundExtractor : public ProcessFilter { private: static const bool TRACK_SHADOWS = false; private: cv::Ptr<cv::BackgroundSubtractor> backgroundExtractor; public: BackgroundExtractor(const cv::Mat& or...
#pragma once #include "types/process_filter.h" namespace TooManyPeeps { class BackgroundExtractor : public ProcessFilter { private: static const bool TRACK_SHADOWS = true; private: cv::Ptr<cv::BackgroundSubtractor> backgroundExtractor; public: BackgroundExtractor(const cv::Mat& ori...
Remove a "Created by" comment line
// // kjchess.h // kjchess // // Created by Kristopher Johnson on 3/11/17. // Copyright © 2017 Kristopher Johnson. All rights reserved. // #import <Cocoa/Cocoa.h> //! Project version number for kjchess. FOUNDATION_EXPORT double kjchessVersionNumber; //! Project version string for kjchess. FOUNDATION_EXPORT const...
// // kjchess.h // kjchess // // Copyright © 2017 Kristopher Johnson. All rights reserved. // #import <Cocoa/Cocoa.h> //! Project version number for kjchess. FOUNDATION_EXPORT double kjchessVersionNumber; //! Project version string for kjchess. FOUNDATION_EXPORT const unsigned char kjchessVersionString[]; // In ...
Add run_in_mode prototype to util header
void osx_cf_run_loop_run();
void osx_cf_run_loop_run(); CFRunLoopRunResult osx_cf_run_loop_run_in_mode (CFStringRef mode, CFTimeInterval seconds, Boolean returnAfterSourceHandled);
Use ftello/fseeko instead of ftell/fseek
/***************************************************************************** * internal.h: ***************************************************************************** * Copyright (C) 2010-2012 L-SMASH project * * Authors: Takashi Hirata <silverfilain@gmail.com> * * Permission to use, copy, modify, and/or di...
/***************************************************************************** * internal.h: ***************************************************************************** * Copyright (C) 2010-2012 L-SMASH project * * Authors: Takashi Hirata <silverfilain@gmail.com> * * Permission to use, copy, modify, and/or di...
Convert to Linux kernel style
#include <stdio.h> #include "main.h" int main(int argc, char *argv[]) { usage(argv[0]); } void usage(char *utilname) { printf("Usage: %s <input_file> <output_file> [options]\n", utilname); printf("WARNING: UTILITY IS NOT FULLY FUNCTIONAL YET\n"); printf("Options:\n"); //TODO: add optional arguments for each filt...
#include <stdio.h> #include "main.h" int main(int argc, char *argv[]) { usage(argv[0]); } void usage(char *utilname) { printf("Usage: %s <input_file> <output_file> [options]\n", utilname); printf("WARNING: UTILITY IS NOT FULLY FUNCTIONAL YET\n"); printf("Options:\n"); /* TODO: add optional arguments for each fil...
Fix compile on some systems
#ifndef MAIN_H #define MAIN_H #include <cstdlib> #include <iostream> #include <tr1/unordered_map> #include <vector> #include <list> #include <set> #include <pthread.h> #endif
#ifndef MAIN_H #define MAIN_H #include <unistd.h> #include <cstdlib> #include <iostream> #include <tr1/unordered_map> #include <vector> #include <list> #include <set> #include <pthread.h> #endif
Add C-API bindings with initial methods. It can verify a blueprint and parse it into json or yaml.
#include <Python.h> #include <drafter/drafter.h> static PyObject *drafterpy_parse_blueprint_to(PyObject *self, PyObject *args){ char *blueprint; char *format; char *result = NULL; drafter_options options; options.sourcemap = true; if(!PyArg_ParseTuple(args, "ss", &blueprint, &format)) ...
Fix a bunch of warnings due to missing inline keywords.
/* * 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. * * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org> * */ #ifndef __ASM_MACH_GENERIC_DMA_COHERENCE_H #define __ASM_MACH_GENERIC_DMA_CO...
/* * 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. * * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org> * */ #ifndef __ASM_MACH_GENERIC_DMA_COHERENCE_H #define __ASM_MACH_GENERIC_DMA_CO...
Add matrix routines for multi-qubit gates. Add required file.
// Copyright 2019 Google LLC. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicabl...
Remove sqlite3 * parameter from the spell function's declaration.
#ifndef LIBSPELL_H #define LIBSPELL_H char *spell(sqlite3*, char *); char *get_suggestions(char *); #endif
#ifndef LIBSPELL_H #define LIBSPELL_H char *spell(char *); char *get_suggestions(char *); #endif
Add missing '-no-canonical-prefixes' in test.
// REQUIRES: clang-driver // REQUIRES: powerpc-registered-target // REQUIRES: nvptx-registered-target // // Verify that CUDA device commands do not get OpenMP flags. // // RUN: %clang -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp=libomp %s 2>&1 \ // RUN: | FileCheck %s --check-pr...
// REQUIRES: clang-driver // REQUIRES: powerpc-registered-target // REQUIRES: nvptx-registered-target // // Verify that CUDA device commands do not get OpenMP flags. // // RUN: %clang -no-canonical-prefixes -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp=libomp %s 2>&1 \ // RUN: | ...
Add ability for Array to take ownership of its data
#pragma once #include <cassert> namespace Utilities { namespace Array { template <class T, class Size = unsigned int> class Array { public: Array(T* data, Size capacity) : data_(data), capacity_(capacity) { assert(data_); assert(capacity_ > 0); } T& operator[](Size index) { assert(index < capacity...
#pragma once #include <cassert> #include <functional> namespace Utilities { namespace Array { template <class T, class Size = unsigned int> class Array { public: Array(T*&& data, Size capacity, std::function<void(T**)>&& deleteData) : data_(std::move(data)), capacity_(capacity), deleteData_(s...
Fix build failure by adding virtual keyword.
/* * Represents an element which can be rendered as part of a scene. * Author: Dino Wernli */ #ifndef ELEMENT_H_ #define ELEMENT_H_ #include <cstddef> class IntersectionData; class Ray; class Element { public: virtual ~Element(); bool Intersect(const Ray& ray, IntersectionData* data = NULL) = 0; }; #endif ...
/* * Represents an element which can be rendered as part of a scene. * Author: Dino Wernli */ #ifndef ELEMENT_H_ #define ELEMENT_H_ #include <cstddef> class IntersectionData; class Ray; class Element { public: virtual ~Element(); virtual bool Intersect(const Ray& ray, IntersectionData* data = NULL) = 0; }; ...
Mark the AFJSON* functions as 'extern'.
// AFJSONUtilities.h // // Copyright (c) 2011 Gowalla (http://gowalla.com/) // // 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...
// AFJSONUtilities.h // // Copyright (c) 2011 Gowalla (http://gowalla.com/) // // 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...
Fix buildbot failure from r373217 (don't match metadata id exactly)
// RUN: cat %s | %clang -emit-llvm -g -S \ // RUN: -Xclang -main-file-name -Xclang test/foo.c -x c - -o - | FileCheck %s // CHECK: ; ModuleID = 'test/foo.c' // CHECK: source_filename = "test/foo.c" // CHECK: !1 = !DIFile(filename: "test/foo.c" int main() {}
// RUN: cat %s | %clang -emit-llvm -g -S \ // RUN: -Xclang -main-file-name -Xclang test/foo.c -x c - -o - | FileCheck %s // CHECK: ; ModuleID = 'test/foo.c' // CHECK: source_filename = "test/foo.c" // CHECK: !DIFile(filename: "test/foo.c" int main() {}
Declare PPB_Core as a struct, not a class. (Prevents Clang warning)
// Copyright 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 NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_CORE_H_ #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_CORE_H_ #include "native_client/src/inclu...
// 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 NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_CORE_H_ #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_CORE_H_ #include "native_client/src/i...
Rename Render component to Sprite
#ifndef COMPONENTMANAGER_H_ #define COMPONENTMANAGER_H_ #include "entity/Entity.h" /** * Enumeration for each of our types of components */ enum component_t { Position, Render }; /** * Base class for all Component Managers. */ class ComponentManager { public: /** * Check if the given Entity has this mana...
#ifndef COMPONENTMANAGER_H_ #define COMPONENTMANAGER_H_ #include "entity/Entity.h" /** * Enumeration for each of our types of components */ enum component_t { Position, Sprite }; /** * Base class for all Component Managers. */ class ComponentManager { public: /** * Check if the given Entity has this mana...
Use "extern inline" in declarations (I think).
#ifndef INCLUDE_POD_NODE_H #define INCLUDE_POD_NODE_H #include <stddef.h> // A node is a place on a list. It simplifies doubly linked lists because the // header is just another node. Everything in Pod is a node, potentially a // part of a list or map. Header nodes should be initialized to point to // themselves...
#ifndef INCLUDE_POD_NODE_H #define INCLUDE_POD_NODE_H #include <stddef.h> // A node is a place on a list. It simplifies doubly linked lists because the // header is just another node. Everything in Pod is a node, potentially a // part of a list or map. Header nodes should be initialized to point to // themselves...
Add a Python-like range macro for sequences.
/*! * This file defines a Python-like range function for sequences. * * @author Louis Dionne */ #ifndef JOY_INTERNAL_SEQRANGE_H #define JOY_INTERNAL_SEQRANGE_H #include <chaos/preprocessor/recursion/expr.h> #include <chaos/preprocessor/repetition/repeat_from_to.h> #define JOY_SEQRANGE(from, to) \ JOY_SEQRAN...
Add missing includes to fix Clang build.
#pragma once #include <functional> #include <boost/asio.hpp> // This class abstracts the boost::asio timer in order to provide a generic // facility for timeouts. Once constructed, this class will wait a certain // amount of time and then call the function. The timeout must be canceled // with cancel() before you inva...
#pragma once #include <functional> #include <atomic> #include <memory> #include <boost/asio.hpp> // This class abstracts the boost::asio timer in order to provide a generic // facility for timeouts. Once constructed, this class will wait a certain // amount of time and then call the function. The timeout must be cance...
Add doxygen comment to IsRBFOptIn
// Copyright (c) 2016-2019 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef SYSCOIN_POLICY_RBF_H #define SYSCOIN_POLICY_RBF_H #include <txmempool.h> enum class RBFTransactionState { UNKNO...
// Copyright (c) 2016-2019 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef SYSCOIN_POLICY_RBF_H #define SYSCOIN_POLICY_RBF_H #include <txmempool.h> /** The rbf state of unconfirmed transacti...
Allow user to pick render settings
#pragma once #if PLATFORM_WINDOWS #include "AllowWindowsPlatformTypes.h" #endif #include "include/cef_client.h" #include "include/cef_app.h" #if PLATFORM_WINDOWS #include "HideWindowsPlatformTypes.h" #endif class BLU_API BluManager : public CefApp { public: BluManager(); static void doBluMessageLoop(); stat...
#pragma once #if PLATFORM_WINDOWS #include "AllowWindowsPlatformTypes.h" #endif #include "include/cef_client.h" #include "include/cef_app.h" #if PLATFORM_WINDOWS #include "HideWindowsPlatformTypes.h" #endif class BLU_API BluManager : public CefApp { public: BluManager(); static void doBluMessageLoop(); stat...
Update Skia milestone to 75
/* * 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 74 #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 75 #endif
Fix 13/32 to fail Mine even with thread ID partitioning
#include <pthread.h> #include <assert.h> int g = 0; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t C = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A); pthread_mutex_lock(&C); pthread_mutex_lock(&B); g = 5; pthread_mut...
#include <pthread.h> #include <assert.h> int g = 0; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t C = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A); pthread_mutex_lock(&C); pthread_mutex_lock(&B); g = 5; pthread_mut...
Allow choice of D2D on compiler command line.
// Scintilla source code edit control /** @file PlatWin.h ** Implementation of platform facilities on Windows. **/ // Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org> // The License.txt file describes the conditions under which this software may be distributed. extern bool IsNT(); extern void Platform_Initi...
// Scintilla source code edit control /** @file PlatWin.h ** Implementation of platform facilities on Windows. **/ // Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org> // The License.txt file describes the conditions under which this software may be distributed. extern bool IsNT(); extern void Platform_Initi...
Add constructor for addition to opt program
//===-- UnifyMethodExitNodes.h - Ensure methods have one return --*- C++ -*--=// // // This pass is used to ensure that methods have at most one return instruction // in them. It also holds onto the return instruction of the last unified // method. // //===--------------------------------------------------------------...
//===-- UnifyMethodExitNodes.h - Ensure methods have one return --*- C++ -*--=// // // This pass is used to ensure that methods have at most one return instruction // in them. It also holds onto the return instruction of the last unified // method. // //===--------------------------------------------------------------...
Check that we can output to /dev/fd filesystem.
// Check that we can operate on files from /dev/fd. // REQUIRES: dev-fd-fs // Check reading from named pipes. We cat the input here instead of redirecting // it to ensure that /dev/fd/0 is a named pipe, not just a redirected file. // // RUN: cat %s | %clang -x c /dev/fd/0 -E > %t // RUN: FileCheck --check-prefix DEV-...
// Check that we can operate on files from /dev/fd. // REQUIRES: dev-fd-fs // Check reading from named pipes. We cat the input here instead of redirecting // it to ensure that /dev/fd/0 is a named pipe, not just a redirected file. // // RUN: cat %s | %clang -x c /dev/fd/0 -E > %t // RUN: FileCheck --check-prefix DEV-...
Fix sort of second half
// -*- mode: c++ -*- // Copyright (c) 2014 Olaf Dietsche #ifndef __quick_sort_h_included__ #define __quick_sort_h_included__ #include <functional> #include <iterator> #include <utility> template<typename I, typename T, typename C> I quicksort_partition(I first, I last, C cmp) { --last; T pivot = *last; while (fir...
// -*- mode: c++ -*- // Copyright (c) 2014 Olaf Dietsche #ifndef __quick_sort_h_included__ #define __quick_sort_h_included__ #include <functional> #include <iterator> #include <utility> template<typename I, typename T, typename C> I quicksort_partition(I first, I last, C cmp) { --last; T pivot = *last; while (fir...
Add a genlist to the panel test.
#include <Elementary.h> #ifndef ELM_LIB_QUICKLAUNCH void test_panel(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *panel; win = elm_win_add(NULL, "panel", ELM_WIN_BASIC); elm_win_title_set(win, "Panel"); elm_win_autodel_set(win, 1); bg = elm_bg_add(win); elm_win_resize_...
#include <Elementary.h> #ifndef ELM_LIB_QUICKLAUNCH void test_panel(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *panel; Evas_Object *list; win = elm_win_add(NULL, "panel", ELM_WIN_BASIC); elm_win_title_set(win, "Panel"); elm_win_autodel_set(win, 1); bg = elm_bg_add(wi...
Declare an enum for git_delta_t
// // GTDiff.h // ObjectiveGitFramework // // Created by Danny Greg on 29/11/2012. // Copyright (c) 2012 GitHub, Inc. All rights reserved. // #import "git2.h" @class GTTree; @interface GTDiff : NSObject @property (nonatomic, readonly, assign) git_diff_list *git_diff_list; + (GTDiff *)diffOldTree:(GTTree *)oldT...
// // GTDiff.h // ObjectiveGitFramework // // Created by Danny Greg on 29/11/2012. // Copyright (c) 2012 GitHub, Inc. All rights reserved. // #import "git2.h" @class GTTree; typedef enum : git_delta_t { GTDiffFileDeltaUnmodified = GIT_DELTA_UNMODIFIED, GTDiffFileDeltaAdded = GIT_DELTA_ADDED, GTDiffFileDeltaDe...
Return an error if CompositeImage fails
#include "composite.h" Image * compositeImage(Image *canvas, void *data, ExceptionInfo *ex) { CompositeData *d = data; if (!CompositeImage(canvas, d->composite, d->draw, d->x, d->y)) { } return canvas; }
#include "composite.h" Image * compositeImage(Image *canvas, void *data, ExceptionInfo *ex) { CompositeData *d = data; if (!CompositeImage(canvas, d->composite, d->draw, d->x, d->y)) { ex->severity = DrawError; return NULL; } return canvas; }
Fix build issue on Windows.
// This file is part of nbind, copyright (C) 2014-2016 BusFaster Ltd. // Released under the MIT license, see LICENSE. #pragma once #define NBIND_MULTIMETHOD(name, args, ...) definer.overloaded args ().method(name, ## __VA_ARGS__) #include "noconflict.h" #define function NBIND_FUNCTION #define multifunction NBIND_MU...
// This file is part of nbind, copyright (C) 2014-2016 BusFaster Ltd. // Released under the MIT license, see LICENSE. #pragma once #define NBIND_MULTIMETHOD(name, args, ...) definer.overloaded args ().method(name, ## __VA_ARGS__) #include "noconflict.h" #define function NBIND_FUNCTION #define multifunction NBIND_MU...
Fix newline at end of file
/* * * Copyright 2015, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of condi...
/* * * Copyright 2015, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of condi...
Add a missing "once" in .h
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). namespace rocksdb { // The helper function to assert the ...
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). #pragma once namespace rocksdb { // The helper function ...
Address the non-portability of the PRINTF macro
#ifndef _HELPERS_H #define _HELPERS_H #include <stdarg.h> #include <stdio.h> #include <stdint.h> #define LENGTH(x) (sizeof(x) / sizeof(*x)) #define MAX(A, B) ((A) > (B) ? (A) : (B)) #define MIN(A, B) ((A) < (B) ? (A) : (B)) #define BOOLSTR(A) ((A) ? "true" : "false") #define MAXLEN 25...
#ifndef _HELPERS_H #define _HELPERS_H #include <stdarg.h> #include <stdio.h> #include <stdint.h> #define LENGTH(x) (sizeof(x) / sizeof(*x)) #define MAX(A, B) ((A) > (B) ? (A) : (B)) #define MIN(A, B) ((A) < (B) ? (A) : (B)) #define BOOLSTR(A) ((A) ? "true" : "false") #define MAXLEN 25...
Add new example based on set and word counts.
#include <stdio.h> #include "m-string.h" #include "m-dict.h" /* program that reads text from standard-input, and prints the total number of distinct words found in the text. */ DICT_SET_DEF2(str, string_t, STRING_OPLIST) int main(void) { M_LET(word, STRING_OPLIST) M_LET(wordcount, DICT_SET_OPLIST(str, STRI...
Use C99 stdint types, update prototypes.
#ifndef _RMD160_H_ #define _RMD160_H_ typedef struct { unsigned int rmd[5]; unsigned char buf[64]; unsigned int nbuf; } rmd160_context; void rmd160_init(rmd160_context *ctx); void rmd160_update(rmd160_context *ctx, const void *data, unsigned len); void rmd160_final(rmd160_context *ctx, void *digest); void rmd160_h...
#ifndef _RMD160_H_ #define _RMD160_H_ #include <stdint.h> typedef struct { uint64_t len; uint32_t rmd[5]; uint8_t buf[64]; uint32_t nbuf; } rmd160_context; void rmd160_init(rmd160_context *ctx); void rmd160_update(rmd160_context *ctx, const void *data, unsigned nbytes); void rmd160_final(rmd160_context *ctx, un...
Remove unused (and deprecated) declaration.
#ifndef E_MOD_MAIN_H #define E_MOD_MAIN_H typedef struct _Status Status; typedef struct _Config Config; struct _Status { Evas_List *frequencies; Evas_List *governors; int cur_frequency; int can_set_frequency; char *cur_governor; unsigned char activ...
#ifndef E_MOD_MAIN_H #define E_MOD_MAIN_H typedef struct _Status Status; typedef struct _Config Config; struct _Status { Evas_List *frequencies; Evas_List *governors; int cur_frequency; int can_set_frequency; char *cur_governor; unsigned char activ...
Fix C program - Leds were not toggling anymore
#include "nrf_delay.h" #include "nrf_gpio.h" int main(void){ nrf_gpio_range_cfg_output(21,22); while(1){ nrf_gpio_pin_write(21,1); nrf_gpio_pin_write(22,1); nrf_delay_ms(80); nrf_gpio_pin_write(21, 1); nrf_gpio_pin_write(22, 1); nrf_delay_ms(80); }...
#include "nrf_delay.h" #include "nrf_gpio.h" int main(void){ nrf_gpio_range_cfg_output(21,22); while(1){ nrf_gpio_pin_write(21,1); nrf_gpio_pin_write(22,0); nrf_delay_ms(80); nrf_gpio_pin_write(21, 0); nrf_gpio_pin_write(22, 1); nrf_delay_ms(80); }...
Add stub for legal notice.
#include "common.h" #include "arguments.h" TCHAR *get_version(void) { return _T("HostKit Agent PREALPHA\nCompiled at ") __TIME__ _T(" on ") __DATE__ _T("\n"); } int _tmain(int argc, TCHAR *argv[]) { int result; initialize_arguments(); if(parse_arguments(argv) != ARGS_OK || arguments.error) { _tprintf(_T("%s"...
#include "common.h" #include "arguments.h" TCHAR *get_version(void) { return _T("HostKit Agent PREALPHA\nCompiled at ") __TIME__ _T(" on ") __DATE__ _T("\n"); } TCHAR *get_copyright(void) { return _T(""); } int _tmain(int argc, TCHAR *argv[]) { int result; initialize_arguments(); if(parse_arguments(argv) != ...
Reorder UART transmission. Instead of waiting for cache to be empty and then sending the value, we first add the value to cache and then wait for transmission. This way no characters are lost during transmission
#include "uart.h" void uart_putchar(char c, FILE *stream) { if( c == '\n' ) uart_putchar( '\r', stream ); UDR0 = c; loop_until_bit_is_set(UCSR0A, TXC0); } static FILE uart_out = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE); void uart_init(void) { UBRR0L = BAUDRATE&0xFF; UBRR0H...
#include "uart.h" void uart_putchar(char c, FILE *stream) { if( c == '\n' ) uart_putchar('\r', stream); loop_until_bit_is_set(UCSR0A, UDRE0); UDR0 = c; } static FILE uart_out = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE); void uart_init(void) { UBRR0L = BAUDRATE&0xFF; UBRR0H ...
Fix memory leak on regexp module load
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <haka/error.h> #include <haka/regexp_module.h> struct regexp_module *regexp_module_load(const char *modu...
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <haka/error.h> #include <haka/regexp_module.h> struct regexp_module *regexp_module_load(const char *modu...
Fix the declaration of Cursor on Linux
// Copyright (C) 2017 Elviss Strazdins // This file is part of the Ouzel engine. #pragma once #include <X11/keysym.h> #include <X11/XKBlib.h> #include <X11/cursorfont.h> #include <X11/X.h> #include "input/Input.h" namespace ouzel { class Engine; namespace input { class InputLinux: public Input ...
// Copyright (C) 2017 Elviss Strazdins // This file is part of the Ouzel engine. #pragma once #include <X11/keysym.h> #include <X11/XKBlib.h> #include <X11/cursorfont.h> #include <X11/X.h> #include "input/Input.h" namespace ouzel { class Engine; namespace input { class InputLinux: public Input ...
Fix signed vs unsigned issue
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_FLIP_FLIP_BITMASKS_H_ #define NET_FLIP_FLIP_BITMASKS_H_ namespace flip { const int kStreamIdMask = 0x7fffffff; // StreamId mask from th...
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_FLIP_FLIP_BITMASKS_H_ #define NET_FLIP_FLIP_BITMASKS_H_ namespace flip { const unsigned int kStreamIdMask = 0x7fffffff; // StreamId mas...
Mark Devcoin release version 0.8.7.0.
#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 8 #define CLIENT_VERSION_REVISION 6 #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 8 #define CLIENT_VERSION_REVISION 7 #define CLIENT_VERSION_BUILD ...
Fix filesmodes multiple-inc and backslash-eof
#define FILEMODES \ X(preproc, "c", 'i') \ X(compile, "cpp-output", 's') \ X(assemb, "assembler", 'o') \ ALIAS(assemb, "asm") \ X(assemb_with_cpp, "assembler-with-cpp", 'o') \ ALIAS(assemb_with_cpp, "asm-with-cpp") \
#ifndef FILEMODES_H #define FILEMODES_H #define FILEMODES \ X(preproc, "c", 'i') \ X(compile, "cpp-output", 's') \ X(assemb, "assembler", 'o') \ ALIAS(assemb, "asm") \ X(assemb_with_cpp, "assembler-with-cpp", 'o') \ ALIAS(assemb_with_cpp, "asm-with-cpp") #endif
Fix class name spelling in class rule
// Author: Jakob Blomer CERN 10/2018 /************************************************************************* * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
// Author: Jakob Blomer CERN 10/2018 /************************************************************************* * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
Debug failing test on PPC bot
// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s #include "test.h" int var; void *Thread(void *x) { pthread_exit(&var); return 0; } int main() { pthread_t t; pthread_create(&t, 0, Thread, 0); void *retval = 0; pthread_join(t, &retval); if (retval != &var) { fprintf(stderr, "Unexpecte...
// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 // | FileCheck %s #include "test.h" int var; void *Thread(void *x) { fprintf(stderr, "Thread\n"); pthread_exit(&var); return 0; } int main() { fprintf(stderr, "MAIN\n"); pthread_t t; pthread_create(&t, 0, Thread, 0); void *retval = 0; fprintf(stderr, "...
Add solution to Exercise 1-17.
/* Exercise 1-17: Write a program to print all input lines that are longer * than 80 characters. */ #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #define LINE_LIMIT 80 int main(int argc, char **argv) { uint32_t current_line_length = 0; int32_t buffer[LINE_LIMIT] = { 0 }; bool...
Fix for short file names
/* Copyright (c) 2008-2019 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Covered Software is provided under this License on an "a...
/* Copyright (c) 2008-2019 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Covered Software is provided under this License on an "a...
Fix incorrect const pointer marking.
#pragma once #include "ffmpeg.h" #include <stddef.h> #include <stdint.h> struct Meta { char const* title; char const* artist; }; struct Meta retrieve_meta(AVFormatContext* ctx);
#pragma once #include "ffmpeg.h" #include <stddef.h> #include <stdint.h> struct Meta { const char const* title; const char const* artist; }; struct Meta retrieve_meta(AVFormatContext* ctx);
Remove wrong override for wantHandleItem
#ifndef QMLDESIGNER_ABSTRACTSINGLESELECTIONTOOL_H #define QMLDESIGNER_ABSTRACTSINGLESELECTIONTOOL_H #include "abstractformeditortool.h" namespace QmlDesigner { class QMLDESIGNERCORE_EXPORT AbstractCustomTool : public QmlDesigner::AbstractFormEditorTool { public: AbstractCustomTool(); void selectedItemsChang...
#ifndef QMLDESIGNER_ABSTRACTSINGLESELECTIONTOOL_H #define QMLDESIGNER_ABSTRACTSINGLESELECTIONTOOL_H #include "abstractformeditortool.h" namespace QmlDesigner { class QMLDESIGNERCORE_EXPORT AbstractCustomTool : public QmlDesigner::AbstractFormEditorTool { public: AbstractCustomTool(); void selectedItemsChang...
Fix this regex to match what llvmgcc4 produces also
// RUN: %llvmgcc -xc %s -S -o - | grep 'ctor_.* constant ' // The synthetic global made by the CFE for big initializer should be marked // constant. void bar(); void foo() { char Blah[] = "asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd"; bar(Blah); }
// RUN: %llvmgcc -xc %s -S -o - | grep 'internal constant ' // The synthetic global made by the CFE for big initializer should be marked // constant. void bar(); void foo() { char Blah[] = "asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd"; bar(Blah); }
Fix build breakage from a typo. Change: 111528530
q /* Copyright 2015 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
/* Copyright 2015 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
Add printing of distribution to catch.hpp integration
#pragma once #include <rapidcheck.h> #include <sstream> namespace rc { /// For use with `catch.hpp`. Use this function wherever you would use a /// `SECTION` for convenient checking of properties. /// /// @param description A description of the property. /// @param testable The object that implements the prope...
#pragma once #include <rapidcheck.h> #include <sstream> namespace rc { /// For use with `catch.hpp`. Use this function wherever you would use a /// `SECTION` for convenient checking of properties. /// /// @param description A description of the property. /// @param testable The object that implements the prope...
Fix my stupid error :/
#ifndef FIRMLAUNCH_H #define FIRMLAUNCH_H #include "types.h" int firm_setup(u32* FIRM, void* N3DSKey1, void* N3DSKey2); void firmlaunch(u32* FIRM); int patch(u32* FIRM, u32* search_size, u8* pattern, u8* patch_data, u32 pattern_size, u32 patch_size); #endif
#ifndef FIRMLAUNCH_H #define FIRMLAUNCH_H #include "types.h" int firm_setup(u32* FIRM, void* N3DSKey1, void* N3DSKey2); void firmlaunch(u32* FIRM); int patch(u32* FIRM, u32 search_size, u8* pattern, u8* patch_data, u32 pattern_size, u32 patch_size); #endif
Implement the inverse cosine function.
#include <pal.h> /** * * Computes the inverse cosine (arc cosine) of the input vector 'a'. Input * values to acos must be in the range -1 to 1. The result values are in the * range 0 to pi. The function does not check for illegal input values. * * @param a Pointer to input vector * * @param c Pointer t...
#include <math.h> #include <pal.h> static const float pi_2 = (float) M_PI / 2.f; /** * * Computes the inverse cosine (arc cosine) of the input vector 'a'. Input * values to acos must be in the range -1 to 1. The result values are in the * range 0 to pi. The function does not check for illegal input values. * * ...
Add const modifier to post and put method of DataStore
#pragma once #ifndef YOU_DATASTORE_DATASTORE_H_ #define YOU_DATASTORE_DATASTORE_H_ #include <stack> #include <memory> #include "task_typedefs.h" #include "transaction.h" namespace You { namespace DataStore { namespace UnitTests {} class DataStore { public: Transaction && begin(); static DataStore& get(); // Mod...
#pragma once #ifndef YOU_DATASTORE_DATASTORE_H_ #define YOU_DATASTORE_DATASTORE_H_ #include <stack> #include <memory> #include "task_typedefs.h" #include "transaction.h" namespace You { namespace DataStore { namespace UnitTests {} class DataStore { public: Transaction && begin(); static DataStore& get(); // Mod...
Correct the project for the move
#import <Foundation/Foundation.h> #import "OCDSpec/Protocols/DescriptionRunner.h" #import "OCDSpec/OCDSpecDescription.h" #import "OCDSpec/OCDSpecSharedResults.h" #import "OCDSpec/AbstractDescriptionRunner.h" @interface OCDSpecDescriptionRunner : NSObject { Class *classes; int classCount; id ...
#import <Foundation/Foundation.h> #import "OCDSpec/Protocols/DescriptionRunner.h" #import "OCDSpec/OCDSpecDescription.h" #import "OCDSpec/OCDSpecSharedResults.h" #import "OCDSpec/Abstract/AbstractDescriptionRunner.h" @interface OCDSpecDescriptionRunner : NSObject { Class *classes; int classCount...
Fix Py_Logger to raise instances of Exception instead of strings
#ifndef PYLOGGER_H #define PYLOGGER_H #include "Python.h" #include <string> #include "cantera/base/logger.h" namespace Cantera { /// Logger for Python. /// @ingroup textlogs class Py_Logger : public Logger { public: Py_Logger() { PyRun_SimpleString("import sys"); } virtual ~Py_Logger() {} vi...
#ifndef PYLOGGER_H #define PYLOGGER_H #include "Python.h" #include <string> #include "cantera/base/logger.h" namespace Cantera { /// Logger for Python. /// @ingroup textlogs class Py_Logger : public Logger { public: Py_Logger() { PyRun_SimpleString("import sys"); } virtual ~Py_Logger() {} vi...
Add custom data role MidiValues
#ifndef ENUMS_H #define ENUMS_H #include <QtCore> enum MidiDataRole { MidiValueType = Qt::UserRole + 1, MidiValueMin, MidiValueMax }; enum MidiType { DefaultType, NoteType, ToggleType, StringType, ChannelType }; #endif
#ifndef ENUMS_H #define ENUMS_H #include <QtCore> enum MidiDataRole { MidiValueType = Qt::UserRole + 1, MidiValueMin, MidiValueMax, MidiValues }; enum MidiType { DefaultType, NoteType, ToggleType, StringType, ChannelType }; #endif
Convert from MPI_Send/Recv, to MPI_ISend/IRecv
#include <stdio.h> #include <mpi.h> #include "hello_mpi.h" int hello_mpi(void) { int numprocs, rank, namelen; char processor_name[MPI_MAX_PROCESSOR_NAME]; MPI_Init(NULL, NULL); MPI_Comm_size(MPI_COMM_WORLD, &numprocs); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Get_processor_name(processor_nam...
#include <stdio.h> #include <mpi.h> #include <unistd.h> #include "hello_mpi.h" int hello_mpi(void) { int numprocs, rank, namelen; char processor_name[MPI_MAX_PROCESSOR_NAME]; MPI_Init(NULL, NULL); MPI_Comm_size(MPI_COMM_WORLD, &numprocs); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Get_processo...