Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Add a missing -no-canonical-prefixes to test.
// A test for the propagation of the -mmcu option to -cc1 and -cc1as // RUN: %clang -### -target avr -mmcu=atmega328p -save-temps %s 2>&1 | FileCheck %s // CHECK: clang{{.*}} "-cc1" {{.*}} "-target-cpu" "atmega328p" // CHECK: clang{{.*}} "-cc1as" {{.*}} "-target-cpu" "atmega328p"
// A test for the propagation of the -mmcu option to -cc1 and -cc1as // RUN: %clang -### -target avr -no-canonical-prefixes -mmcu=atmega328p -save-temps %s 2>&1 | FileCheck %s // CHECK: clang{{.*}} "-cc1" {{.*}} "-target-cpu" "atmega328p" // CHECK: clang{{.*}} "-cc1as" {{.*}} "-target-cpu" "atmega328p"
Add BILaunchStartersFactory to interface file
// // BIObjCHelpers.h // BIObjCHelpersExample // // Created by Bogdan Iusco on 1/19/15. // Copyright (c) 2015 Bogdan Iusco. All rights reserved. // // Starters #import "BIStarterProtocol.h" #import "BILifecycle.h" #import "BIStartersFactory.h" #import "BIOperationQueue.h" // Views #import "BITableView.h" // Data...
// // BIObjCHelpers.h // BIObjCHelpersExample // // Created by Bogdan Iusco on 1/19/15. // Copyright (c) 2015 Bogdan Iusco. All rights reserved. // // Starters #import "BIStarterProtocol.h" #import "BILifecycle.h" #import "BIStartersFactory.h" #import "BIOperationQueue.h" #import "BILaunchStartersFactory.h" // Vi...
Add SIMPLEQ->STAILQ macros for freebsd.
#include <libutil.h> #ifndef TAILQ_END #define TAILQ_END(head) NULL #endif
#include <libutil.h> #ifndef TAILQ_END #define TAILQ_END(head) NULL #endif #ifndef SIMPLEQ_HEAD #define SIMPLEQ_HEAD STAILQ_HEAD #define SIMPLEQ_HEAD_INITIALIZER STAILQ_HEAD_INITIALIZER #define SIMPLEQ_ENTRY STAILQ_ENTRY #define SIMPLEQ_INIT STAILQ_INIT #define SIMPLEQ_INSERT_AFTER STAILQ_INSERT_AFTER #defin...
Add BSD 3-clause open source header
#ifndef _STACK_H_ #define _STACK_H_ /* * data stack for use with automaton infrastructure */ #include "dataStackEntry.h" typedef struct stack Stack; Stack *stack_create(int size); void stack_destroy(Stack *st); void reset(Stack *st); void push(Stack *st, DataStackEntry d); Da...
/* * Copyright (c) 2013, Court of the University of Glasgow * 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, * thi...
Fix arc4random_addrandom detection for -Werror=pointer-sign
/* ISC license. */ #undef _POSIX_C_SOURCE #undef _XOPEN_SOURCE #include <stdlib.h> int main (void) { arc4random_addrandom("", 1) ; return 0 ; }
/* ISC license. */ #undef _POSIX_C_SOURCE #undef _XOPEN_SOURCE #include <stdlib.h> int main (void) { unsigned char *blah = "" ; arc4random_addrandom(blah, 1) ; return 0 ; }
Use macro to check security of cookie
#include <stdio.h> #include "bincookie.h" int main(int argc, char *argv[]) { if (argc != 2) { printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]); printf("Example: %s Cookies.binarycookies\n", argv[0]); return 1; } binarycookies_t *bc = binarycookies_init(argv...
#include <stdio.h> #include "bincookie.h" int main(int argc, char *argv[]) { if (argc != 2) { printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]); printf("Example: %s Cookies.binarycookies\n", argv[0]); return 1; } binarycookies_t *bc = binarycookies_init(argv...
Fix a typo, that could cause a crash on mac.
// 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 NET_PROXY_PROXY_RESOLVER_MAC_H_ #define NET_PROXY_PROXY_RESOLVER_MAC_H_ #pragma once #include <string> #include "googleurl/src/gurl.h" #incl...
// 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 NET_PROXY_PROXY_RESOLVER_MAC_H_ #define NET_PROXY_PROXY_RESOLVER_MAC_H_ #pragma once #include <string> #include "googleurl/src/gurl.h" #incl...
Use __USER_LABEL_PREFIX__ so that we don't add a _ prefix on ELF.
/* ===-- assembly.h - compiler-rt assembler support macros -----------------=== * * The LLVM Compiler Infrastructure * * This file is distributed under the University of Illinois Open Source * License. See LICENSE.TXT for details. * * ===-------------------------------------------------------...
/* ===-- assembly.h - compiler-rt assembler support macros -----------------=== * * The LLVM Compiler Infrastructure * * This file is distributed under the University of Illinois Open Source * License. See LICENSE.TXT for details. * * ===-------------------------------------------------------...
Add parameter type `const char []` to the Card constructor
#ifndef PHEVALUATOR_CARD_H #define PHEVALUATOR_CARD_H #ifdef __cplusplus #include <unordered_map> #include <string> namespace phevaluator { class Card { public: Card() {} Card(int id) : id_(id) {} Card(std::string name) { const std::unordered_map<char, int> rankMap = { {'2', 0}, {'3', 1}, {'4', 2...
#ifndef PHEVALUATOR_CARD_H #define PHEVALUATOR_CARD_H #ifdef __cplusplus #include <unordered_map> #include <string> namespace phevaluator { class Card { public: Card() {} Card(int id) : id_(id) {} Card(std::string name) { const std::unordered_map<char, int> rankMap = { {'2', 0}, {'3', 1}, {'4', 2...
Add function parameter qualifier type tests
// RUN: %ucc -fsyntax-only %s typedef int array[3]; const array yo; // int const yo[3]; // ^~ no const here h(array); // int h(int [3]); i(const array); // int i(int const [3]); // ^~ no const here j(int[const]); // int j(int *const); _Static_assert(_Ge...
Fix compilation on OSX MAP_ANONYMOUS is MAP_ANON on OSX, so this will let the project compile.
#ifndef __BYTESTREAM__ #define __BYTESTREAM__ #include <stdint.h> #include <unistd.h> #define BS_RO 0 #define BS_RW 1 typedef struct _ByteStream { char* filename; size_t size; uint8_t* data; uint32_t offset; int exhausted; } ByteStream; ByteStream* bsalloc(unsigned int size); ByteStream* bsmap(char* fil...
#ifndef __BYTESTREAM__ #define __BYTESTREAM__ #include <stdint.h> #include <unistd.h> #define BS_RO 0 #define BS_RW 1 // MAP_ANONYMOUS is MAP_ANON on OSX, so this will let us compile #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif typedef struct _ByteStream { char* filename; size_t size; uint8_t*...
Remove DEBUG for performance testing.
#ifndef __LIB_DBG__ #define __LIB_DBG__ #define DEBUG #ifdef DEBUG # define printk(fmt, ...) \ ({ \ char ____fmt[] = fmt; \ trace_printk(____fmt, sizeof(____fmt), \ ##__VA_ARGS__); \ }) #else # define printk(fmt, ...) \ do { } while (0) #endif #endif /* __LIB_DBG__ */
#ifndef __LIB_DBG__ #define __LIB_DBG__ #ifdef DEBUG # define printk(fmt, ...) \ ({ \ char ____fmt[] = fmt; \ trace_printk(____fmt, sizeof(____fmt), \ ##__VA_ARGS__); \ }) #else # define printk(fmt, ...) \ do { } while (0) #endif #endif /* __LIB_DBG__ */
Add support for disabling blocks externally via preprocessor macro definitions at the project or target level
// // Licensed under the terms in License.txt // // Copyright 2010 Allen Ding. All rights reserved. // #import <Foundation/Foundation.h> #define KW_VERSION 0.5 // Blocks being unavailable cripples the usability of Kiwi, but is supported // because they are not available on anything less than a device running 3.2. #i...
// // Licensed under the terms in License.txt // // Copyright 2010 Allen Ding. All rights reserved. // #import <Foundation/Foundation.h> #define KW_VERSION 0.5 // Blocks being unavailable cripples the usability of Kiwi, but is supported // because they are not available on anything less than a device running 3.2. #i...
Add a resource strategy interface
#ifndef APIMOCK_RESOURCESTRATEGY_H #define APIMOCK_RESOURCESTRATEGY_H #include "requestdata.h" #include "responsedata.h" namespace ApiMock { class ResourceStrategy { public: virtual ~ResourceStrategy() {} virtual ResponseData CreateResponse(const RequestData& request) = 0; }; } #endif
Use compiler detection for Q_LIKELY, Q_UNLIKELY, Q_ASSUME, Q_UNREACHABLE
#ifndef QT4COMPAT_H #define QT4COMPAT_H #include <QtCore/QtGlobal> #ifndef Q_LIKELY # define Q_LIKELY(s) s #endif #ifndef Q_UNLIKELY # define Q_UNLIKELY(s) s #endif #ifndef Q_UNREACHABLE # define Q_UNREACHABLE() Q_ASSERT(false) #endif #ifndef Q_ASSUME # define Q_ASSUME(s) if (s) {} else { Q_UNREACHABLE(); } #endif...
#ifndef QT4COMPAT_H #define QT4COMPAT_H #include <QtCore/QtGlobal> #if !defined(Q_UNREACHABLE) && !defined(Q_ASSUME) # if defined(Q_CC_INTEL) || defined(Q_CC_MSVC) # define Q_UNREACHABLE() __assume(0) # define Q_ASSUME(s) __assume(s) # elif defined(Q_CC_CLANG) # define Q_UNREACHABLE() __builtin_unreachable() # eli...
Return one-based line/column numbers from StreamPos.
#ifndef ICAL_STREAMPOS_H #define ICAL_STREAMPOS_H namespace ical { /** * Represents a postion in the (source) stream. It is used for constructing * nice error messages. * * Note: only CRLF ("\r\n") is considered as a line ending in order to match * the definition of 'content line' from RFC 5545. */ class Strea...
#ifndef ICAL_STREAMPOS_H #define ICAL_STREAMPOS_H namespace ical { /** * Represents a postion in the (source) stream. It is used for constructing * nice error messages. * * Note: only CRLF ("\r\n") is considered as a line ending in order to match * the definition of 'content line' from RFC 5545. */ class Strea...
Add ICMPv4 dst unreachable -message definition
#ifndef ICMPV4_H #define ICMPV4_H #include "syshead.h" #include "netdev.h" #define ICMP_V4_REPLY 0x00 #define ICMP_V4_DST_UNREACHABLE 0x03 #define ICMP_V4_SRC_QUENCH 0x04 #define ICMP_V4_REDIRECT 0x05 #define ICMP_V4_ECHO 0x08 #define ICMP_V4_ROUTER_ADV 0x09 #define ICMP_V4_ROUTE...
#ifndef ICMPV4_H #define ICMPV4_H #include "syshead.h" #include "netdev.h" #define ICMP_V4_REPLY 0x00 #define ICMP_V4_DST_UNREACHABLE 0x03 #define ICMP_V4_SRC_QUENCH 0x04 #define ICMP_V4_REDIRECT 0x05 #define ICMP_V4_ECHO 0x08 #define ICMP_V4_ROUTER_ADV 0x09 #define ICMP_V4_ROUTE...
Define the INLINE_ASM_GCTXT() macro for aarch64. This was breaking the MEMLEAK source on arm.
#ifndef SPECIFIC_INLINE_ASM_GCTXT #define SPECIFIC_INLINE_ASM_GCTXT #endif
#ifndef SPECIFIC_INLINE_ASM_GCTXT #define SPECIFIC_INLINE_ASM_GCTXT #define INLINE_ASM_GCTXT(uc) getcontext(&uc) #endif
Change this test to reflect the state we are moving in. The Clang builtin headers are no longer going to receive the old 'implicit extern "C" block' semantics. This hint is actually ignored by both Clang and GCC at this point, and Clang's own builtin headers can simply be changed if there is any issue with this. Clang ...
// RUN: %clang -fno-ms-extensions %s -E | grep 'stddef.h.*3.*4' #include <stddef.h>
// RUN: %clang -fno-ms-extensions %s -E | grep 'stddef.h.*3' #include <stddef.h>
Fix alpha static chain register name
#ifdef __aarch64__ # define STATIC_CHAIN_REG "x18" #elif defined(__alpha__) # define STATIC_CHAIN_REG "r1" #elif defined(__arm__) # define STATIC_CHAIN_REG "ip" #elif defined(__sparc__) # if defined(__arch64__) || defined(__sparcv9) # define STATIC_CHAIN_REG "g5" # else # define STATIC_CHAIN_REG "g2" # endif #elif...
#ifdef __aarch64__ # define STATIC_CHAIN_REG "x18" #elif defined(__alpha__) # define STATIC_CHAIN_REG "$1" #elif defined(__arm__) # define STATIC_CHAIN_REG "ip" #elif defined(__sparc__) # if defined(__arch64__) || defined(__sparcv9) # define STATIC_CHAIN_REG "g5" # else # define STATIC_CHAIN_REG "g2" # endif #elif...
Make better use of precompiled header
// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. #pragma once // Internal build flag for namespace discrimination #define AUTOWIRING_IS_BEING_BUILT // Only include these headers in cases where a pch can be generated // Currently this is only supported on MSVC #ifdef _MSC_VER #include <thread> #if...
// Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. #pragma once // Internal build flag for namespace discrimination #define AUTOWIRING_IS_BEING_BUILT // Only include these headers in cases where a pch can be generated // Currently this is only supported on MSVC #ifdef _MSC_VER #ifndef NOMINMAX #d...
Add max length error check
/* metatag.c: Program for adding metadata to a file * By: Forrest Kerslager, Nick Noto, David Taylor, Kevin Yeap, * Connie Yu * * 2014/06/06 * */ #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char** argv){ char* buffer; int fd, i, len; if(argc < 3){ ...
/* metatag.c: Program for adding metadata to a file * By: Forrest Kerslager, Nick Noto, David Taylor, Kevin Yeap, * Connie Yu * * 2014/06/06 * */ #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_LEN 1024 int main(int argc, char** argv){ char* buffer; int fd, i, len; i...
Fix one more register addressing bug
// Offset of each register in the register map, // as it's saved by asm_entry_amd64.s #pragma once #define RAX 0x00 #define RBX 0x08 #define RCX 0x10 #define RDX 0x18 #define RSI 0x20 #define RDI 0x28 #define R8 0x30 #define R9 0x38 #define R10 0x40 #define R11 0x48 #define R12 0x50 #define R13 0x58 #define R14 0x6...
// Offset of each register in the register map, // as it's saved by asm_entry_amd64.s #pragma once #define RAX 0x00 #define RBX 0x08 #define RCX 0x10 #define RDX 0x18 #define RSI 0x20 #define RDI 0x28 #define R8 0x30 #define R9 0x38 #define R10 0x40 #define R11 0x48 #define R12 0x50 #define R13 0x58 #define R14 0x6...
Hide a static function to CINT. With this fix g4root compiles OK.
// @(#)root/base:$Name: $:$Id: TVersionCheck.h,v 1.2 2007/05/10 16:04:32 rdm Exp $ // Author: Fons Rademakers 9/5/2007 /************************************************************************* * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * * All rights reserved. ...
// @(#)root/base:$Name: $:$Id: TVersionCheck.h,v 1.3 2007/05/10 18:16:58 rdm Exp $ // Author: Fons Rademakers 9/5/2007 /************************************************************************* * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * * All rights reserved. ...
Fix braindamage: assertions were not enabled in debug builds.
#ifndef ERROR_H #define ERROR_H /* * Note that we include "fmt" in the variadic argument list, because C99 * apparently doesn't allow variadic macros to be invoked without any vargs * parameters. */ #define ERROR(...) var_error(__FILE__, __LINE__, __VA_ARGS__) #define FAIL() simple_error(__FILE__, __...
#ifndef ERROR_H #define ERROR_H /* * Note that we include "fmt" in the variadic argument list, because C99 * apparently doesn't allow variadic macros to be invoked without any vargs * parameters. */ #define ERROR(...) var_error(__FILE__, __LINE__, __VA_ARGS__) #define FAIL() simple_error(__FILE__, __...
Add nullptr check and return NULL for implicitor operator when object is not initialized
// Copyright 2010-2014 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #pragma once #include "Stdafx.h" #include "Internals\MCefRefPtr.h" #include "RequestContextSettings.h" #include "include\cef_request_context.h" us...
// Copyright 2010-2014 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #pragma once #include "Stdafx.h" #include "Internals\MCefRefPtr.h" #include "RequestContextSettings.h" #include "include\cef_request_context.h" us...
Add NULL_BYTE macro, rename others
/** * common.h * * Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com> */ #ifndef GIT_STASHD_COMMON_H #define GIT_STASHD_COMMON_H #include <errno.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #define _GNU_SOURCE #define NOOPT_FOUND_V -1 #define CLEAN...
/** * common.h * * Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com> */ #ifndef GIT_STASHD_COMMON_H #define GIT_STASHD_COMMON_H #include <errno.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #define _GNU_SOURCE #define NULL_BYTE 1 #define NOT_FOUND ...
Check xmain() return code in tests.
#ifndef __CMPTEST_H__ #define __CMPTEST_H__ #include <stdio.h> #include "sodium.h" #define TEST_NAME_RES TEST_NAME ".res" #define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp" #ifdef HAVE_ARC4RANDOM # undef rand # define rand(X) arc4random(X) #endif FILE *fp_res; int xmain(void); int main(void) { FILE *fp...
#ifndef __CMPTEST_H__ #define __CMPTEST_H__ #include <stdio.h> #include "sodium.h" #define TEST_NAME_RES TEST_NAME ".res" #define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp" #ifdef HAVE_ARC4RANDOM # undef rand # define rand(X) arc4random(X) #endif FILE *fp_res; int xmain(void); int main(void) { FILE *fp...
Remove quotes around env variable, NFC
// RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE="%t/" LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s int main(int argc, const char *argv[]) { if (argc < 2) return 1; return 0; } // CHECK: LLVM Profile: Failed to write file
// RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE=%t/ LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s int main(int argc, const char *argv[]) { if (argc < 2) return 1; return 0; } // CHECK: LLVM Profile: Failed to write file
Fix HLS being seen as input during init
#include "output_http.h" #include "output_ts_base.h" namespace Mist{ class OutHLS : public TSOutput{ public: OutHLS(Socket::Connection &conn); ~OutHLS(); static void init(Util::Config *cfg); void sendTS(const char *tsData, size_t len = 188); void sendNext(); void onHTTP(); bool isReadyF...
#include "output_http.h" #include "output_ts_base.h" namespace Mist{ class OutHLS : public TSOutput{ public: OutHLS(Socket::Connection &conn); ~OutHLS(); static void init(Util::Config *cfg); void sendTS(const char *tsData, size_t len = 188); void sendNext(); void onHTTP(); bool isReadyF...
Add Usb register controller header file dfine
/* * arch/arm/mach-w90x900/include/mach/regs-usb.h * * Copyright (c) 2008 Nuvoton technology corporation. * * Wan ZongShun <mcuos.com@gmail.com> * * 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 Fo...
Add NOSKILL skill type, remove from component
#ifndef SKILLCOMPONENT_H_ #define SKILLCOMPONENT_H_ /** * Enumeration for identifying different skills. */ enum skill_t { Melee, Swords, BastardSword, Maces, SpikedMace, FirstAid }; /** * Data structure to represent an Entity's skill. */ typedef struct { skill_t skill; ///< The type of skill int ranks; //...
#ifndef SKILLCOMPONENT_H_ #define SKILLCOMPONENT_H_ /** * Data structure to represent an Entity's skill. */ typedef struct { int ranks; ///< Current ranks in the skill int xp; ///< Amount of XP earned towards next rank } SkillComponent; /** * Enumeration for identifying different skills. */ enum skill_t { NOSK...
Add TMCVerbose to the list of mc classes
// @(#)root/mc:$Name: $:$Id: LinkDef.h,v 1.2 2002/04/26 08:46:10 brun Exp $ #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ global gMC; #pragma link C++ enum PDG_t; #pragma link C++ enum TMCProcess; #pragma link C++ class TVirtualMC+; ...
// @(#)root/mc:$Name: $:$Id: LinkDef.h,v 1.2 2002/04/26 09:25:02 brun Exp $ #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ global gMC; #pragma link C++ enum PDG_t; #pragma link C++ enum TMCProcess; #pragma link C++ class TVirtualMC+; ...
Set up IDT first to ensure exceptions are handled
#include <stdint.h> #include "ports.h" #include "pic.h" #include "gdt.h" #include "idt.h" #include "irq.h" #include "screen.h" void entry(void) { pic_remap(IRQ0, IRQ8); pic_set_masks(0, 0); gdt_init((struct GDT *)(0x500)); idt_init((struct IDT *)(0x500 + sizeof(struct GDT))); __asm__ __volatile__ ("sti"); scr...
#include <stdint.h> #include "ports.h" #include "pic.h" #include "gdt.h" #include "idt.h" #include "irq.h" #include "screen.h" void entry(void) { pic_remap(IRQ0, IRQ8); pic_set_masks(0, 0); idt_init((struct IDT *)(0x500)); gdt_init((struct GDT *)(0x500 + sizeof(struct IDT))); __asm__ __volatile__ ("sti"); scr...
Convert to `git branch` for performance
#include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <sys/wait.h> #define GITBUF 2048 int main(int argc, char **argv) { int pid, ret; int pipes[2]; char gitbuff[GITBUF]; size_t gitlen; char b; char *br; int childst; if(pipe(pipes) != 0) { perror("Error cre...
#include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <sys/wait.h> #define GITBUF 2048 int main(int argc, char **argv) { int pid, ret; int pipes[2]; char gitbuff[GITBUF]; size_t gitlen; char b; char *br; int childst; if(pipe(pipes) != 0) { perror("Error cre...
Format strings and more through test for stack floats
// RUN: %ucc -o %t %s // RUN: %ocheck 0 %t // RUN: %t | %output_check 'Hello 5 2.3' 'Hello 5 2.3' // should run without segfaulting main() { printf("Hello %d %.1f\n", 5, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3, 2.3); // this causes an infinite loop in glibc's printf() pr...
// RUN: %ucc -o %t %s // RUN: %ocheck 0 %t // RUN: %t | %output_check 'Hello 5 5.9' '7.3 8.7 10.1 11.5 12.9 14.3 15.7 17.1 18.5 19.9' 'Hello 5 15.7' '14.3 12.9 11.5 10.1 8.7 7.3 5.9 4.5 3.1 1.7 0.3' // should run without segfaulting main() { printf("Hello %d %.1f\n" "%.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %...
Fix differing parameter name clang tidy warning
/* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
/* * * Copyright 2018 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
Increase the minimum interval for timers on background tabs to reduce their CPU consumption.
// 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 WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ #define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ namespace webkit_glue { // Chromium sets the minimum interval timeou...
// 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 WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ #define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_ namespace webkit_glue { // Chromium sets the minimum interval timeou...
Remove defunct missing defs that interfere with CI build
/* * mswin32_config.h Hand made MSWin32 configuration file. * Copyright (c) 1996 Applied Logic Systems, Inc. * * Author: Chuck Houpt * Creation: 1/30/96 */ #include "dfltsys.h" #define MSWin32 1 #define OSStr "mswin32" #ifdef __GNUC__ #define EXTERNAL_STATE 1 #endif /* Temp. disable threading until thread...
/* * mswin32_config.h Hand made MSWin32 configuration file. * Copyright (c) 1996 Applied Logic Systems, Inc. * * Author: Chuck Houpt * Creation: 1/30/96 */ #include "dfltsys.h" #define MSWin32 1 #define OSStr "mswin32" #ifdef __GNUC__ #define EXTERNAL_STATE 1 #endif /* Temp. disable threading until thread...
Revert 80939 - Fix clang error TBR=jam@chromium.org
// 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 CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_ #define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_ #pragma once #include "content/browser/...
// 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 CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_ #define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_ #pragma once #include "content/browser/...
Add separate file for nx_ieee_eui64, since tinyos-main is unable to support it.
/** * Struct for IEEE EUI64 with network byte order and nx_structs. * * @author Raido Pahtma * @license MIT */ #ifndef NXIEEEEUI64_H #define NXIEEEEUI64_H #include "IeeeEui64.h" typedef nx_struct nx_ieee_eui64 { nx_uint8_t data[IEEE_EUI64_LENGTH]; } nx_ieee_eui64_t; #endif // NXIEEEEUI64_H
Add missing extern to variable in header
/* -*- c-basic-offset: 2 -*- */ /* Copyright(C) 2015 Brazil This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be usefu...
/* -*- c-basic-offset: 2 -*- */ /* Copyright(C) 2015 Brazil This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be usefu...
Add the thread specific class.
/** * \file thread_specific.h * * A thread specific type. * * \author eaburns * \date 2009-07-23 */ #if !defined(_THREAD_SPECIFIC_H_) #define _THREAD_SPECIFIC_H_ #include <vector> using namespace std; #include "thread.h" /* To attempt to prevent cache ping-ponging? */ #define PADDING 24 /* bytes */ templa...
Make gcc4 happy as well
/* vi: set sw=4 ts=4: */ /* * getgid() for uClibc * * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #include "syscalls.h" #include <unistd.h> #if defined __NR_getxgid # define __NR_getgid __NR_getxgid #endif _syscall0(g...
/* vi: set sw=4 ts=4: */ /* * getgid() for uClibc * * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #include "syscalls.h" #include <unistd.h> #if defined __NR_getxgid # define __NR_getgid __NR_getxgid #endif libc_hidden...
Define the method updateNotification in meetingbussiness
// // IMeetingDelegate.h // MeetingApp // // Created by Estefania Chavez Guardado on 2/27/16. // Copyright © 2016 Estefania Chavez Guardado. All rights reserved. // #import <UIKit/UIKit.h> #import "Meeting.h" @protocol IMeetingDelegate <NSObject> @optional - (void) update: (MutableMeeting *) newMeeting; - (vo...
// // IMeetingDelegate.h // MeetingApp // // Created by Estefania Chavez Guardado on 2/27/16. // Copyright © 2016 Estefania Chavez Guardado. All rights reserved. // #import <UIKit/UIKit.h> #import "Meeting.h" typedef enum NotificationType { NOTIFICATION_TYPE_EMAIL, NOTIFICATION_TYPE_CALENDAR } Notificat...
Add the printf format attribute to backend_exception's constructor
#ifndef ALEXCPT_H #define ALEXCPT_H #include <exception> #include <string> #include "AL/alc.h" namespace al { class backend_exception final : public std::exception { std::string mMessage; ALCenum mErrorCode; public: backend_exception(ALCenum code, const char *msg, ...); const char *what() const n...
#ifndef ALEXCPT_H #define ALEXCPT_H #include <exception> #include <string> #include "AL/alc.h" #ifdef __GNUC__ #define ALEXCPT_FORMAT(x, y, z) __attribute__((format(x, (y), (z)))) #else #define ALEXCPT_FORMAT(x, y, z) #endif namespace al { class backend_exception final : public std::exception { std::string m...
Add failing test case with max u long long
// PARAM: --conf=conf/svcomp21.json // from: ldv-linux-3.0/usb_urb-drivers-vhost-vhost_net.ko.cil.out.i typedef unsigned long long u64; int main( ) { u64 a ; unsigned long flag ; unsigned long roksum ; struct thread_info *tmp___7 ; int tmp___8 ; long tmp___9; void *log_base; unsigned long sz; u64 addr;...
Add a clang test for r257376 (Ensure -mcpu=xscale works for arm targets).
// RUN: %clang -target arm-freebsd -mcpu=xscale -### -c %s 2>&1 | FileCheck %s // CHECK-NOT: error: the clang compiler does not support '-mcpu=xscale' // CHECK: "-cc1"{{.*}} "-target-cpu" "xscale"{{.*}}
Update sync method docs in IssueSyncEngine
// // CDZIssueSyncEngine.h // thingshub // // Created by Chris Dzombak on 1/13/14. // Copyright (c) 2014 Chris Dzombak. All rights reserved. // #import <ReactiveCocoa/ReactiveCocoa.h> @class OCTClient; @class CDZThingsHubConfiguration; @protocol CDZIssueSyncDelegate; @interface CDZIssueSyncEngine : NSObject ///...
// // CDZIssueSyncEngine.h // thingshub // // Created by Chris Dzombak on 1/13/14. // Copyright (c) 2014 Chris Dzombak. All rights reserved. // #import <ReactiveCocoa/ReactiveCocoa.h> @class OCTClient; @class CDZThingsHubConfiguration; @protocol CDZIssueSyncDelegate; @interface CDZIssueSyncEngine : NSObject ///...
Fix large number of syntax errors (at least for gcc).
/* Auxiliary program: write the include file for determining PLplot's floating-point type */ #include <stdio> #include <stdlib> #include "plConfig.h" main(int argc, char *argv[] ) { FILE *outfile ; char *kind ; outfile = fopen( "plflt.inc", "w" ) ; #ifdef PL_DOUBLE kind = "1.0d0" #else kind = "1.0"...
/* Auxiliary program: write the include file for determining PLplot's floating-point type */ #include <stdio.h> #include <stdlib.h> #include "plConfig.h" main(int argc, char *argv[] ) { FILE *outfile; char *kind; outfile = fopen( "plflt.inc", "w" ) ; #ifdef PL_DOUBLE kind = "1.0d0"; #else kind = "1...
Add dummy static version of getcwd for Aibo.
#ifndef LIBPORT_UNISTD_H # define LIBPORT_UNISTD_H # include "detect_win32.h" # include "libport/config.h" // This is traditional Unix file. # ifdef LIBPORT_HAVE_UNISTD_H # include "unistd.h" # endif // This seems to be its WIN32 equivalent. // http://msdn2.microsoft.com/en-us/library/ms811896(d=printer).aspx#ucmg...
#ifndef LIBPORT_UNISTD_H # define LIBPORT_UNISTD_H # include "detect_win32.h" # include "libport/config.h" // This is traditional Unix file. # ifdef LIBPORT_HAVE_UNISTD_H # include "unistd.h" # endif // This seems to be its WIN32 equivalent. // http://msdn2.microsoft.com/en-us/library/ms811896(d=printer).aspx#ucmg...
Support running from the OSS fonts
#import "NSManagedObject+ActiveRecord.h" #import "NSString+StringBetweenStrings.h" #import <Artsy+UIColors/UIColor+ArtsyColors.h> #import "UIColor+FolioColours.h" #import <Artsy+UIFonts/UIFont+ArtsyFonts.h> #import "NSObject+Notifications.h" #import <UIView+BooleanAnimations/UIView+BooleanAnimations.h> #import "UIButto...
#import "NSManagedObject+ActiveRecord.h" #import "NSString+StringBetweenStrings.h" #import <Artsy+UIColors/UIColor+ArtsyColors.h> #import "UIColor+FolioColours.h" #if __has_include(<Artsy+UIFonts/UIFont+ArtsyFonts.h>) #import <Artsy+UIFonts/UIFont+ArtsyFonts.h> #endif #if __has_include(<Artsy+OSSUIFonts/UIFont+OSSArt...
Test commit merges feature to master
file4.c - r1 Test checkin in master1-updated - updated_by_master Test checkin in master2 Test checkin in master3 Test checkin in master4
Test checkin in master1-updated - updated_by_master Test checkin in master1-updated - updated2 Test checkin in master2 Test checkin in master3 Test checkin in master4
Add include for GreedyPatternRewriteDriver implementation.
// Copyright 2021 The IREE Authors // // Licensed under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "iree-dialects/Transforms/Listener.h" #include "mlir/IR/PatternMatch.h" #include "mlir/R...
// Copyright 2021 The IREE Authors // // Licensed under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include "iree-dialects/Transforms/Listener.h" #include "mlir/IR/PatternMatch.h" #include "mlir/R...
Change signatures of methods and fields of class
#ifndef VECTOR_3D_H #define VECTOR_3D_H #include <math.h> namespace classes { struct Point3D { double x, y, z; }; class Vector3D { struct Cheshire; Cheshire* smile; static const Point3D nullPoint = { 0.0, 0.0, 0.0 }; public: Vector3D(); Vector3D(Point3D point = nullPoint); Vector3D(double x ...
#ifndef VECTOR_3D_H #define VECTOR_3D_H #include <math.h> namespace classes { struct Point3D { double x, y, z; }; typedef const char* err; class Vector3D { struct Cheshire; Cheshire* smile; static const Point3D nullPoint; static unsigned int idCounter; public: Vector3D(Point3D point = nullPoin...
Add first example! (Hello World)
/** * Exemplo 01 - Hello World! * * Este é o exemplo mais simples da linguagem C. Consiste apenas em um programa que * imprime a mensagem "Hello World!" e termina sua execução. * Apesar de simples, é um bom programa para se basear na estrutura, além de testar * se o compilador está funcionando corretamente */ ...
Return answer when reading formula was finished
#include "calc.h" #include <ctype.h> #include <stdio.h> #include <stdlib.h> int calc(const char* p) { int i; int ans; ans = atoi(p); i = 0; while (p[i] != '\0'){ while (isdigit(p[i])){ i++; } switch (p[i]){ case '+': return (ans + ca...
#include "calc.h" #include <ctype.h> #include <stdio.h> #include <stdlib.h> int calc(const char* p) { int i; int ans; ans = atoi(p); i = 0; while (p[i] != '\0'){ while (isdigit(p[i])){ i++; } switch (p[i]){ case '+': return (ans + ca...
Support for system "power profiles". Currently we support two profiles; "economy" and "performance".
/*- * Copyright (c) 2001 Michael Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of condi...
Increment timer ticks for now
/* OSEKOS Implementation of an OSEK Scheduler * Copyright (C) 2015 Joakim Plate * * 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 op...
/* OSEKOS Implementation of an OSEK Scheduler * Copyright (C) 2015 Joakim Plate * * 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 op...
Work around a circular dependency between IR and MC introduced in r362735
//===- MCSymbolXCOFF.h - ----------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===--------------------------...
//===- MCSymbolXCOFF.h - ----------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===--------------------------...
Add a clang test for LLVM fix for PR23332
// RUN: %clang_cc1 -x c++ -g -emit-llvm -triple x86_64-linux-gnu -o - %s | FileCheck %s // PR23332 // CHECK: MDLocalVariable(tag: DW_TAG_arg_variable, arg: 255 // CHECK: MDLocalVariable(tag: DW_TAG_arg_variable, arg: 256 // CHECK: MDLocalVariable(tag: DW_TAG_arg_variable, arg: 257 void fn1(int, int, int, int, int, int...
Implement Linked List in C
#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct Node Node; struct Node { int value; Node *next; }; void addFirst(Node **head, int v) { Node *newNode = (Node * )malloc(sizeof(Node)); newNode->value = v; newNode->next = *head; *head = newNode; } void printList(Node *head) { Node *curr...
Move comment to the code it comments on
/** * Generic reservoir sampling. */ #ifndef _RS_H #define _RS_H /* print actions to the reservoir */ #ifndef PRINT_RS_TRACE #define PRINT_RS_TRACE 1 #endif struct reservoir; struct drand48_data; struct reservoir *init_reservoir(size_t sz, #if PRINT_RS_TRACE void (*print_fun)(void *it), #endif void *(*clone_f...
/** * Generic reservoir sampling. */ #ifndef _RS_H #define _RS_H /* print actions to the reservoir */ #ifndef PRINT_RS_TRACE #define PRINT_RS_TRACE 1 #endif struct reservoir; struct drand48_data; /* Notice one extra parameter when tracing the reservoir */ struct reservoir *init_reservoir(size_t sz, #if PRINT_RS_T...
Update Doxygen documentation with conventions
/***************************************************************************//** * \file domain.h * \author Krishnan, A. (anush@bu.edu) * \brief Definition of the class \c domain */ #pragma once #include "types.h" /** * \class domain * \brief Store the mesh grid information */ class domain { public: int nx, ///...
/***************************************************************************//** * \file domain.h * \author Anush Krishnan (anush@bu.edu) * \brief Definition of the class \c domain. */ #pragma once #include "types.h" /** * \class domain * \brief Stores information about the computational grid. */ class doma...
Fix linking in Objective–C++ tests.
/* * Copyright (c) 2014-2015 Erik Doernenburg and contributors * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use these files except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
/* * Copyright (c) 2014-2015 Erik Doernenburg and contributors * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use these files except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
Change "getmembyte" and "getmemword" to inline functions
/* * Copyright (c) 2012, Nadir Sampaoli * See the LICENSE for more information */ #include "memory.h" #include <stdlib.h> #include <stdio.h> static uint8_t *memory_area; void allocmemory(void) { while(!memory_area) { memory_area = malloc(MEM_SIZE * sizeof(uint8_t)); } } uint8_t getmembyte(uint16_...
/* * Copyright (c) 2012, Nadir Sampaoli * See the LICENSE for more information */ #include "memory.h" #include <stdlib.h> #include <stdio.h> static uint8_t *memory_area; void allocmemory(void) { while(!memory_area) { memory_area = malloc(MEM_SIZE * sizeof(uint8_t)); } } inline uint8_t getmembyte(...
Revert "Name these protocol method variables better"
// // GLGInputParserDelegate.h // TwIRCk // // Created by Tim Jarratt on 11/29/13. // Copyright (c) 2013 General Linear Group. All rights reserved. // #import <Foundation/Foundation.h> @protocol GLGInputParserDelegate <NSObject> - (void) didJoinChannel:(NSString *)channel rawCommand:(NSString *)rawC...
// // GLGInputParserDelegate.h // TwIRCk // // Created by Tim Jarratt on 11/29/13. // Copyright (c) 2013 General Linear Group. All rights reserved. // #import <Foundation/Foundation.h> @protocol GLGInputParserDelegate <NSObject> - (void) didJoinChannel:(NSString *)channel rawCommand:(NSString *)comm...
Cut space required for IDT in half
#ifndef IDT_H #define IDT_H #include <stdint.h> struct IDTEntry { uint16_t base_address_low; uint16_t selector; uint8_t reserved; uint8_t type : 4; uint8_t storage_segment : 1; uint8_t privilege : 2; uint8_t present : 1; uint16_t base_address_high; } __attribute__((packed)); struct IDTDescriptor { uint16_t ...
#ifndef IDT_H #define IDT_H #include <stdint.h> struct IDTEntry { uint16_t base_address_low; uint16_t selector; uint8_t reserved; uint8_t type : 4; uint8_t storage_segment : 1; uint8_t privilege : 2; uint8_t present : 1; uint16_t base_address_high; } __attribute__((packed)); struct IDTDescriptor { uint16_t ...
Change bool true/false to enum
/* * types.h * * Created on: Mar 11, 2014 * Author: Chase */ #ifndef TYPES_H_ #define TYPES_H_ #include <stdint.h> //Don't use stdbool.h, we have to make sure bool is only a byte in size! typedef uint8_t bool; #define true 1 #define false 0 #define TRUE 1 #define FALSE 0 typedef uint8_t char8_t; typedef ...
/* * types.h * * Created on: Mar 11, 2014 * Author: Chase */ #ifndef TYPES_H_ #define TYPES_H_ #include <stdint.h> //Don't use stdbool.h, we have to make sure bool is only a byte in size! typedef uint8_t bool; enum { true = 1, false = 0, TRUE = 1, FALSE = 0 }; typedef uint8_t char8_t; typedef uint16_...
Remove unnecessary rounding when allocating initial thread block
/* * Copyright (c) 2012 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include <unistd.h> #include "native_client/src/untrusted/nacl/nacl_irt.h" #include "native_client/src/untrusted/nacl/nacl_thread.h" #inc...
/* * Copyright (c) 2012 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include <unistd.h> #include "native_client/src/untrusted/nacl/nacl_irt.h" #include "native_client/src/untrusted/nacl/nacl_thread.h" #inc...
Make sure the buffer small read populates the buffer with multiple chunks.
#include <bert/buffer.h> #include <string.h> #include <stdio.h> #include "test.h" #define DATA_SIZE 4 int main() { unsigned char data[4]; bert_buffer_t buffer; bert_buffer_init(&buffer); memset(data,'A',DATA_SIZE); bert_buffer_write(&buffer,data,DATA_SIZE); bert_buffer_write(&buffer,data,DATA_SIZE); bert_...
#include <bert/buffer.h> #include <string.h> #include <stdio.h> #include "test.h" #define DATA_SIZE 4 int main() { unsigned char data[4]; bert_buffer_t buffer; bert_buffer_init(&buffer); memset(data,'A',DATA_SIZE); unsigned int i; for (i=0;i<((BERT_CHUNK_SIZE / DATA_SIZE) * 2);i++) { bert_buffer_write(...
Fix compatibility with all non-Microsoft compilers
/*****************************************************************************\ * * * Filename SysLib.h * * * * Description SysLib Library core definitions * * ...
/*****************************************************************************\ * * * Filename SysLib.h * * * * Description SysLib Library core definitions * * ...
Use the same size of lcrq.
#ifndef FIFO_H #define FIFO_H #include "align.h" #define FIFO_NODE_SIZE 510 struct _fifo_node_t; typedef struct DOUBLE_CACHE_ALIGNED { volatile size_t enq DOUBLE_CACHE_ALIGNED; volatile size_t deq DOUBLE_CACHE_ALIGNED; volatile struct { int index; struct _fifo_node_t * node; } head DOUBLE_CACHE_ALIG...
#ifndef FIFO_H #define FIFO_H #include "align.h" #define FIFO_NODE_SIZE (1 << 20 - 2) struct _fifo_node_t; typedef struct DOUBLE_CACHE_ALIGNED { volatile size_t enq DOUBLE_CACHE_ALIGNED; volatile size_t deq DOUBLE_CACHE_ALIGNED; volatile struct { size_t index; struct _fifo_node_t * node; } head DOUB...
Drop $Id$ and update copyright
/* * $Id$ * * Copyright (c) 2013, Juniper Networks, Inc. * All rights reserved. * This SOFTWARE is licensed under the LICENSE provided in the * ../Copyright file. By downloading, installing, copying, or otherwise * using the SOFTWARE, you agree to be bound by the terms of that * LICENSE. * * jsonwriter.h -- t...
/* * Copyright (c) 2013, Juniper Networks, Inc. * All rights reserved. * This SOFTWARE is licensed under the LICENSE provided in the * ../Copyright file. By downloading, installing, copying, or otherwise * using the SOFTWARE, you agree to be bound by the terms of that * LICENSE. * * jsonwriter.h -- turn json-or...
Add 'expected-warning' for braces around scalar initializer
// RUN: clang -checker-simple -verify %s int* f1() { int x = 0; return &x; // expected-warning{{Address of stack memory associated with local variable 'x' returned.}} expected-warning{{address of stack memory associated with local variable 'x' returned}} } int* f2(int y) { return &y; // expected-warning{{Addre...
// RUN: clang -checker-simple -verify %s int* f1() { int x = 0; return &x; // expected-warning{{Address of stack memory associated with local variable 'x' returned.}} expected-warning{{address of stack memory associated with local variable 'x' returned}} } int* f2(int y) { return &y; // expected-warning{{Addre...
Add structs used in the GDT
/*GDT stands for "Global Descriptor Table". It is a table available on i386 (ix86?) processors. The GDT is a list of 64 bit entries. GRUB (or our boot) loader will install the GDT for us. If we overwrite the GDT we will cause a 'triple fault' and the machine will be reset. Based on the tutorial, we will write a GDT w...
Clarify that LD_LIBRARY_PATH must be set when Gambit is build with shared libs
/* * Time stamp of last source code repository commit. */ #define ___STAMP_YMD 20131223 #define ___STAMP_HMS 145645
/* * Time stamp of last source code repository commit. */ #define ___STAMP_YMD 20131223 #define ___STAMP_HMS 172203
Fix broken compilation of Linux for the famous string.h header
#ifndef _H_SAMSON_QUEUE_TASK_MANAGER #define _H_SAMSON_QUEUE_TASK_MANAGER #include "au/list.h" // au::list namespace samson { namespace stream { class QueueTask; class QueueTaskManager { au::list< QueueTask > queueTasks; size_t id; ...
#ifndef _H_SAMSON_QUEUE_TASK_MANAGER #define _H_SAMSON_QUEUE_TASK_MANAGER #include "au/list.h" // au::list #include <string> // std::string namespace samson { namespace stream { class QueueTask; class QueueTaskManager { au::list< QueueTask > ...
Include Arduino.h to make sure we have types like "boolean"
#ifndef SwitecX25_h #define SwitecX25_h class SwitecX25 { public: static const unsigned char pinCount = 4; static const unsigned char stateCount = 6; unsigned char pins[pinCount]; unsigned char currentState; // 6 steps unsigned int currentStep; // step we are currently at unsigned int targe...
#ifndef SwitecX25_h #define SwitecX25_h #include <Arduino.h> class SwitecX25 { public: static const unsigned char pinCount = 4; static const unsigned char stateCount = 6; unsigned char pins[pinCount]; unsigned char currentState; // 6 steps unsigned int currentStep; // step we are currently at ...
Fix test in two ways: remove incorrect comment (the intrinsic generated now is of the llvm.sjlj.* flavore) and convert grep->FileCheck
/* RUN: %clang_cc1 %s -emit-llvm -o - | not grep __builtin_ * * __builtin_longjmp/setjmp should get transformed into llvm.setjmp/longjmp * just like explicit setjmp/longjmp calls are. */ void jumpaway(int *ptr) { __builtin_longjmp(ptr,1); } int main(void) { __builtin_setjmp(0); jumpaway(0); }
/* RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s * * __builtin_longjmp/setjmp should get transformed into intrinsics. */ // CHECK-NOT: builtin_longjmp void jumpaway(int *ptr) { __builtin_longjmp(ptr,1); } int main(void) { __builtin_setjmp(0); jumpaway(0); }
Remove falloc header from linux build
#define _GNU_SOURCE #define _FILE_OFFSET_BITS 64 #include <fcntl.h> #include <stdint.h> #include <linux/falloc.h> int native_fallocate(int fd, uint64_t len) { return fallocate(fd, 0, 0, (off_t)len); }
#define _GNU_SOURCE #define _FILE_OFFSET_BITS 64 #include <fcntl.h> #include <stdint.h> int native_fallocate(int fd, uint64_t len) { return fallocate(fd, 0, 0, (off_t)len); }
Fix symbol name of errno$UX$2003
/* * Copyright 2013 Mo McRoberts. * * 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 agr...
/* * Copyright 2013 Mo McRoberts. * * 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 agr...
Fix build of tutorials that require libpng under Visual Studio.
// A current_time function for use in the tests. Returns time in // milliseconds. #ifdef _WIN32 extern "C" bool QueryPerformanceCounter(uint64_t *); extern "C" bool QueryPerformanceFrequency(uint64_t *); double current_time() { uint64_t t, freq; QueryPerformanceCounter(&t); QueryPerformanceFrequency(&freq...
// A current_time function for use in the tests. Returns time in // milliseconds. #ifdef _WIN32 #include <Windows.h> double current_time() { LARGE_INTEGER freq, t; QueryPerformanceCounter(&t); QueryPerformanceFrequency(&freq); return (t.QuadPart * 1000.0) / freq.QuadPart; } // Gross, these come from W...
Change --version format to "<name> (Boreutils) <version>"
#ifndef BOREUTILS_H #define BOREUTILS_H #include <string.h> static const char *BOREUTILS_VERSION = "0.0.0b1"; int has_arg(int argc, char **argv, char *search); void bu_missing_argument(char *name); int bu_handle_version(int argc, char **argv); // FIXME: Having this in a header is definitely a hack. int has_arg(int...
#ifndef BOREUTILS_H #define BOREUTILS_H #include <string.h> static const char *BOREUTILS_VERSION = "0.0.0b1"; int has_arg(int argc, char **argv, char *search); void bu_missing_argument(char *name); int bu_handle_version(int argc, char **argv); // FIXME: Having this in a header is definitely a hack. int has_arg(int...
Move the include file around.
#ifndef _CHAMPLAIN_PERL_H_ #include <clutterperl.h> #include <champlain/champlain.h> #include "ppport.h" #include "champlain-autogen.h" #ifdef CHAMPLAINPERL_GTK #include <champlain-gtk/champlain-gtk.h> #endif #endif /* _CHAMPLAIN_PERL_H_ */
#ifndef _CHAMPLAIN_PERL_H_ #include <clutterperl.h> #include <champlain/champlain.h> #ifdef CHAMPLAINPERL_GTK #include <champlain-gtk/champlain-gtk.h> #endif #include "ppport.h" #include "champlain-autogen.h" #endif /* _CHAMPLAIN_PERL_H_ */
Define MR_NO_LOGGING to force no logging.
// // MagicalRecord for Core Data. // // Created by Saul Mora. // Copyright 2011 Magical Panda Software. All rights reserved. // // enable to use caches for the fetchedResultsControllers (iOS only) #if TARGET_OS_IPHONE #define STORE_USE_CACHE #endif #define kCreateNewCoordinatorOnBackgroundOperations 0 #define...
// // MagicalRecord for Core Data. // // Created by Saul Mora. // Copyright 2011 Magical Panda Software. All rights reserved. // // enable to use caches for the fetchedResultsControllers (iOS only) #if TARGET_OS_IPHONE #define STORE_USE_CACHE #endif #define kCreateNewCoordinatorOnBackgroundOperations 0 #ifdef...
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...
Fix problem reported by Soonho
/* Copyright (c) 2013 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #pragma once #include <iostream> #include <time.h> namespace lean { /** \brief Low tech timer for used for testing. */ class timeit { std::ostream &...
/* Copyright (c) 2013 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #pragma once #include <iostream> #include <time.h> namespace lean { /** \brief Low tech timer for used for testing. */ class timeit { std::ostream &...
Fix leak in calloc failure path.
/* -------------------------------------------------------------------------- * Name: create.c * Purpose: Associative array implemented as a hash * ----------------------------------------------------------------------- */ #include <stdlib.h> #include <string.h> #include "base/memento/memento.h" #include "base...
/* -------------------------------------------------------------------------- * Name: create.c * Purpose: Associative array implemented as a hash * ----------------------------------------------------------------------- */ #include <stdlib.h> #include <string.h> #include "base/memento/memento.h" #include "base...
Allow suppression of "deprecated header" warning
/*------------------------------------------------------------------------- * * FILE * pqxx/util.h * * DESCRIPTION * Various utility definitions for libpqxx * * Copyright (c) 2001-2004, Jeroen T. Vermeulen <jtv@xs4all.nl> * * See COPYING for copyright license. If you did not receive a file called *...
/*------------------------------------------------------------------------- * * FILE * pqxx/util.h * * DESCRIPTION * Various utility definitions for libpqxx * * Copyright (c) 2001-2004, Jeroen T. Vermeulen <jtv@xs4all.nl> * * See COPYING for copyright license. If you did not receive a file called *...
Make a watchdog timer blink a LED
#include <avr/io.h> int main (void) { //Set pin 3 as output to source current? PORTB = 1<<PORTB3; DDRB = 1<<DDB3; }
#include <avr/io.h> #include <avr/wdt.h> #include <avr/interrupt.h> int main ( void ) { //Disable interrupts and reset WDT timer cli(); wdt_reset(); //Reset MCU status register MCUSR &= ~(1<<WDRF); //Disable watchdog WDTCR |= (1<<WDCE) | (1<<WDE); WDTCR = 0; //Enable LED DDRB = 1<<DDB3; PORTB = 1<<PORT...
Exclude posix_l/strtonum fallback inclusion for newlib > 2.4
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------...
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------...
Add note about possible additional apostrophe.
#ifndef FTS_COMMON_H #define FTS_COMMON_H #define IS_NONASCII_APOSTROPHE(c) \ ((c) == 0x2019 || (c) == 0xFF07) #define IS_APOSTROPHE(c) \ ((c) == 0x0027 || IS_NONASCII_APOSTROPHE(c)) #endif
#ifndef FTS_COMMON_H #define FTS_COMMON_H /* Some might consider 0x02BB an apostrophe also. */ #define IS_NONASCII_APOSTROPHE(c) \ ((c) == 0x2019 || (c) == 0xFF07) #define IS_APOSTROPHE(c) \ ((c) == 0x0027 || IS_NONASCII_APOSTROPHE(c)) #endif
Add a snippet (lang C).
#include <stdlib.h> #include <stdio.h> typedef struct list { int data; struct list * next; } list; list * make_elem(void) { list * pe; if(NULL == (pe = malloc(sizeof(list)))) { fprintf(stderr, "Erreur d'allocation memoire\n"); exit(EXIT_FAILURE); } return pe; } int main() { ...
Add bitwise copy of struct to complex struct example.
#include <stdio.h> typedef struct { int *x; int **y; } inner ; typedef struct { int *g; inner in[3]; } outer; int *ep; int main(int argc, char *argv[]) { outer o; int z = 5; printf("%d\n" , z); ep = &z; o.in[2].x = ep; *o.in[2].x = 3; printf("%d\n" , z); outer o...
#include <stdio.h> typedef struct { int *x; int **y; } inner ; typedef struct { int *g; inner in[3]; } outer; int *ep; int main(int argc, char *argv[]) { outer o; int z = 5; int zzz; printf("%d\n" , z); ep = &z; o.in[2].x = ep; *o.in[2].x = 3; printf("%d\n" , z);...
Remove now irrelevant motivation section
#import <Foundation/Foundation.h> // Motivation: // JSON responses frequently contain 'null'. For our purposes, a JSON object with // a null property is equivalent to the same object with that property missing. // However, JSON parsers treat the former as `NSNull` and the latter as nil; // This leads to problems for t...
#import <Foundation/Foundation.h> @interface NSDictionary (TDTNullNormalization) /** @return NSDictionary created by removing all enteries whose @p value is an instance of @p NSNull. @see NSArray+TDTNullNormalization */ - (NSDictionary *)tdt_dictionaryByRemovingNulls; @end
Add new header file. (or: xcode is stupid)
// // BDSKSearchGroupViewController.h // Bibdesk // // Created by Christiaan Hofman on 1/2/07. /* This software is Copyright (c) 2007 Christiaan Hofman. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions ar...
Make things based on Asio `service_io` inherite from same base
// MIT License // Copyright (c) 2017 Zhuhao Wang // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, mer...
Check if two linked lists are identical or same.
#include "listHelper.h" int isIdentical(struct linkList *head1, struct linkList *head2) { /* list1 and list2 has to have same data and length * even if length or data mismatch , we return * list as non identical. */ while(head1 != NULL && head2 != NULL) { if(head1->data != head2->data) return 0; head1 ...
Change NSString property to copy
// // YSProcessTimer.h // YSProcessTimeExample // // Created by Yu Sugawara on 2014/02/21. // Copyright (c) 2014年 Yu Sugawara. All rights reserved. // #import <Foundation/Foundation.h> #ifndef DEBUG #define kYSProcessTimerInvalid 1 #endif @interface YSProcessTimer : NSObject + (instancetype)sharedInstance; ...
// // YSProcessTimer.h // YSProcessTimeExample // // Created by Yu Sugawara on 2014/02/21. // Copyright (c) 2014年 Yu Sugawara. All rights reserved. // #import <Foundation/Foundation.h> #ifndef DEBUG #define kYSProcessTimerInvalid 1 #endif @interface YSProcessTimer : NSObject + (instancetype)sharedInstance; ...