Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Update comment in test case.
// PARAM: --set trans.activated[+] "assert" // Running the assert transformation on this test yields in code that is not compilable by gcc struct s { int a; int b; }; union u { struct s str; int i; }; int main(){ union u un; struct s* ptr; un.str.a = 1; un.str.b = 2; ptr = &un...
// PARAM: --set trans.activated[+] "assert" // Running the assert transformation on this test used to yield code that cannot be compiled with gcc, due to superfluous offsets on a pointer struct s { int a; int b; }; union u { struct s str; int i; }; int main(){ union u un; struct s* ptr; ...
Allow for node address query by using 'N' command without parameters
#ifdef __USE_CMSIS #include "LPC8xx.h" #endif #include <cr_section_macros.h> #include <string.h> #include "parse_util.h" #include "cmd.h" #include "err.h" #include "frame_buffer.h" /** * Set node address * Args: <node-addr> */ extern frame_buffer_type tx_buffer; int cmd_set_node_addr (int argc, uint8_t **argv) {...
#ifdef __USE_CMSIS #include "LPC8xx.h" #endif #include <cr_section_macros.h> #include <string.h> #include "parse_util.h" #include "cmd.h" #include "err.h" #include "frame_buffer.h" /** * Set node address * Args: <node-addr> */ extern frame_buffer_type tx_buffer; int cmd_set_node_addr (int argc, uint8_t **argv) {...
Update TextInputFlags to include autocapitalize values.
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_BASE_IME_TEXT_INPUT_FLAGS_H_ #define UI_BASE_IME_TEXT_INPUT_FLAGS_H_ namespace ui { // Intentionally keep in sync with blink::WebTextInputFla...
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_BASE_IME_TEXT_INPUT_FLAGS_H_ #define UI_BASE_IME_TEXT_INPUT_FLAGS_H_ namespace ui { // Intentionally keep in sync with blink::WebTextInputFla...
Fix spelling error in the SVC handler
// The Mordax Microkernel // (c) Kristian Klomsten Skordal 2013 <kristian.skordal@gmail.com> // Report bugs and issues on <http://github.com/skordal/mordax/issues> #include "context.h" #include "debug.h" #include "svc.h" // Supervisor call (software interrupt) handler, called by target assembly // code: void svc_inte...
// The Mordax Microkernel // (c) Kristian Klomsten Skordal 2013 <kristian.skordal@gmail.com> // Report bugs and issues on <http://github.com/skordal/mordax/issues> #include "context.h" #include "debug.h" #include "svc.h" // Supervisor call (software interrupt) handler, called by target assembly // code: void svc_inte...
Change to org.bluez.MediaControl1 as interface name
/* * * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2006-2010 Nokia Corporation * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published b...
/* * * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2006-2010 Nokia Corporation * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published b...
Revert 88154 - Use scoped_ptr for Panel in PanelBrowserWindowGTK. Reason: PanelBrowserWindow dtor is now complex and cannot be inlined.
// 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_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ #include "chrome/browser/ui...
// 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_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ #include "chrome/browser/ui...
Add killer test case from the C99 specification.
#define x 3 #define f(a) f(x * (a)) #undef x #define x 2 #define g f #define z z[0] #define h g(~ #define m(a) a(w) #define w 0,1 #define t(a) a #define p() int #define q(x) x #define r(x,y) x ## y f(y+1) + f(f(z)) % t(t(g)(0) + t)(1); g(x +(3,4)-w) | h 5) & m ...
Set client release to false
#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 1 #define CLIENT_VERSION_MINOR 2 #define CLIENT_VERSION_REVISION 0 #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 1 #define CLIENT_VERSION_MINOR 2 #define CLIENT_VERSION_REVISION 0 #define CLIENT_VERSION_BUILD ...
Add sixth exercise from chapter 5.
/* The content of `example2.txt` will be "Gidday world" because the file offset for `fd3` will be at the beginning of the file. Only `fd1` and `fd2` share the same file offset, that's why when writing "HELLO," replaces "Hello," but the next write (with `fd3`) happens at beginning and then we are left with "Gidd...
Fix typos and remove unused includes
/* * Copyright (C) 2014 Freie Universität Berlin * Copyright (C) 2014 PHYTEC Messtechnik GmbH * Copyright (C) 2017 Eistec AB * * This file is subject to the terms and conditions of the GNU Lesser General * Public License v2.1. See the file LICENSE in the top level directory for more * details. */ /** * @ingro...
/* * Copyright (C) 2014 Freie Universität Berlin * Copyright (C) 2014 PHYTEC Messtechnik GmbH * Copyright (C) 2017 Eistec AB * * This file is subject to the terms and conditions of the GNU Lesser General * Public License v2.1. See the file LICENSE in the top level directory for more * details. */ /** * @ingro...
Replace hardref trick with strdup() for consistency.
#include <stdlib.h> #include <string.h> #include <assert.h> #include "options.h" struct Options *Options_parse(int argc, char *argv[]) { assert(argc > 1); Options *opts = malloc(sizeof(Options)); assert(opts != NULL); opts->outfile = NULL; opts->errfile = NULL; opts->target = NULL; opts->child_args = N...
#include <stdlib.h> #include <string.h> #include <assert.h> #include "options.h" struct Options *Options_parse(int argc, char *argv[]) { assert(argc > 1); Options *opts = malloc(sizeof(Options)); assert(opts != NULL); opts->outfile = NULL; opts->errfile = NULL; opts->target = NULL; opts->child_args = N...
Use more generic attribute if possible
/** * @file * * @brief Assertions macros. * * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) */ #include <kdbconfig.h> #ifdef __cplusplus extern "C" { #endif void elektraAbort (const char * expression, const char * function, const char * file, const int line, const char * msg, ...) #ifd...
/** * @file * * @brief Assertions macros. * * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) */ #include <kdbconfig.h> #ifdef __cplusplus extern "C" { #endif void elektraAbort (const char * expression, const char * function, const char * file, const int line, const char * msg, ...) #ifd...
Fix incorrect help message for UEFI
/* * Copyright (c) 2018, Intel Corporation. * SPDX-License-Identifier: BSD-3-Clause */ #include <CommandParser.h> #if defined(__LINUX__) || defined(__ESX__) #define EXE_NAME L"ipmctl" #elif defined(_MSC_VER) #define EXE_NAME L"ipmctl.exe" #else #define EXE_NAME L"ipmctl.ef...
/* * Copyright (c) 2018, Intel Corporation. * SPDX-License-Identifier: BSD-3-Clause */ #include <CommandParser.h> #if defined(__LINUX__) || defined(__ESX__) #define EXE_NAME L"ipmctl" #elif defined(_MSC_VER) && defined(OS_BUILD) #define EXE_NAME L"ipmctl.exe" #else #define EXE_NAME ...
Add docs for overridden methods
#pragma once #include "Control.h" #include <CommCtrl.h> /// <summary> /// Manages a 'spin control': a numeric edit box with a up/down 'buddy' to /// increment or decrement the current value of the box. /// </summary> class Spinner : public Control { public: Spinner() { } Spinner(int id, HWND parent) : ...
#pragma once #include "Control.h" #include <CommCtrl.h> /// <summary> /// Manages a 'spin control': a numeric edit box with a up/down 'buddy' to /// increment or decrement the current value of the box. /// </summary> class Spinner : public Control { public: Spinner() { } Spinner(int id, HWND parent) : ...
Add a virtual destructor to silence a GCC warning.
//===-- llvm/MC/MCObjectFormat.h - Object Format Info -----------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
//===-- llvm/MC/MCObjectFormat.h - Object Format Info -----------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Add SenTestingKit to test targets
// // WebHereTests.h // WebHereTests // // Created by Rui D Lopes on 25/03/13. // Copyright (c) 2013 Rui D Lopes. All rights reserved. // #import <Kiwi/Kiwi.h> #import <Nocilla/Nocilla.h> #import <OCLogTemplate/OCLogTemplate.h> #import <WebHere/WebHere.h> // Fixtures #import "WHPerson.h" #import "WHAdmin.h" #impo...
// // WebHereTests.h // WebHereTests // // Created by Rui D Lopes on 25/03/13. // Copyright (c) 2013 Rui D Lopes. All rights reserved. // #import <SenTestingKit/SenTestingKit.h> #import <Kiwi/Kiwi.h> #import <Nocilla/Nocilla.h> #import <OCLogTemplate/OCLogTemplate.h> #import <WebHere/WebHere.h> // Fixtures #impor...
Enable interrupts before initializing GDT
#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...
#include <stdint.h> #include "ports.h" #include "pic.h" #include "gdt.h" #include "idt.h" #include "irq.h" #include "screen.h" void entry(void) { struct IDT *idt = (struct IDT *)0x500; struct GDT *gdt = (struct GDT *)(0x500 + sizeof(struct GDT)); pic_remap(IRQ0, IRQ8); pic_set_masks(0, 0); idt_init(idt); __asm_...
Use FAIL_APR() rather than FAIL() in create_subpool().
#include <string.h> #include "c4-internal.h" void * ol_alloc(apr_size_t sz) { void *result = malloc(sz); if (result == NULL) FAIL(); return result; } void * ol_alloc0(apr_size_t sz) { void *result = ol_alloc(sz); memset(result, 0, sz); return result; } void * ol_realloc(void *ptr, ap...
#include <string.h> #include "c4-internal.h" void * ol_alloc(apr_size_t sz) { void *result = malloc(sz); if (result == NULL) FAIL(); return result; } void * ol_alloc0(apr_size_t sz) { void *result = ol_alloc(sz); memset(result, 0, sz); return result; } void * ol_realloc(void *ptr, ap...
Add test for simple partial structs.
struct s1 { int y; int z; }; struct s2 { struct s1 *p; }; int main() { struct s1 nested; struct s2 v; v.p = &nested; v.p->y = 1; v.p->z = 2; if (nested.y != 1) return 1; if (nested.z != 2) return 2; return 0; }
struct T; struct T { int x; }; int main() { struct T v; { struct T { int z; }; } v.x = 2; if(v.x != 2) return 1; return 0; }
Fix the third time test.
#include <stdio.h> #include <sys/types.h> #include <unistd.h> int64_t getTicks(); void sleepFor(int64_t); int main(int argc, char **argv) { int64_t a, b, c, delay; delay = microsecondsToTicks(500000); a = getTicks(); sleepFor(delay); b = getTicks(); sleepFor(delay); c = getTicks(); if(a + delay <= b...
#include <stdio.h> #include <sys/types.h> #include <unistd.h> int64_t getTicks(); void sleepFor(int64_t); int main(int argc, char **argv) { int64_t a, b, c, delay; delay = microsecondsToTicks(500000); a = getTicks(); sleepFor(delay); b = getTicks(); sleepFor(delay); c = getTicks(); if(a + delay <= b...
Delete duplicate (and incompatible) declaration of iRRAM_initialize().
#ifndef iRRAM_MPFR_EXTENSION_H #define iRRAM_MPFR_EXTENSION_H #ifndef GMP_RNDN #include <mpfr.h> #endif #ifdef __cplusplus extern "C" { #endif void mpfr_ext_exp (mpfr_ptr r, mpfr_srcptr u,int p); void mpfr_ext_log (mpfr_ptr r, mpfr_srcptr u,int p); void mpfr_ext_sin (mpfr_ptr r, mpfr_srcptr u,int p); void mpfr_ext...
#ifndef iRRAM_MPFR_EXTENSION_H #define iRRAM_MPFR_EXTENSION_H #ifndef GMP_RNDN #include <mpfr.h> #endif #ifdef __cplusplus extern "C" { #endif void mpfr_ext_exp (mpfr_ptr r, mpfr_srcptr u,int p); void mpfr_ext_log (mpfr_ptr r, mpfr_srcptr u,int p); void mpfr_ext_sin (mpfr_ptr r, mpfr_srcptr u,int p); void mpfr_ext...
Add assert after global write in 36/11
// PARAM: --sets ana.activated[+] octApron #include <pthread.h> #include <assert.h> int g = 1; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A); g = 2; // write something non-initial so base wouldn't find success pthread_mutex_unlock(&A); return NULL; } int main(...
// PARAM: --sets ana.activated[+] octApron #include <pthread.h> #include <assert.h> int g = 1; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A); g = 2; // write something non-initial so base wouldn't find success assert(g == 2); pthread_mutex_unlock(&A); return ...
Add example that only works with no overflow assumption
// PARAM: --sets sem.int.signed_overflow assume_none --enable ana.int.interval --disable ana.int.def_exc int main(void) { int x = 0; while(x != 42) { x++; assert(x >= 1); } }
Remove old DEFAULT_MAX_TIME static var
#ifndef UCI_H #define UCI_H #include "board.h" #include "cmove.h" #include <sstream> #include <fstream> class Uci { public: void start(); private: Board _board; static const int DEFAULT_DEPTH = 4; static const int DEFAULT_MAX_TIME = 5000; void _uciNewGame(); void _setPosition(std::istringstream&); voi...
#ifndef UCI_H #define UCI_H #include "board.h" #include "cmove.h" #include <sstream> #include <fstream> class Uci { public: void start(); private: Board _board; static const int DEFAULT_DEPTH = 4; void _uciNewGame(); void _setPosition(std::istringstream&); void _go(std::istringstream&); void _pickBest...
Add missing CONTENT_EXPORT to fix Linux shared build after r112415
// 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 CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_ #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_ #pragma once class TabContents;...
// 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 CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_ #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_ #pragma once class TabContents;...
Add include-what-you-use pragma so IWYU does not try to include these files again.
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
Fix missing %s in run string causing hang during tests.
// RUN: clang -fsyntax-only -verify // Test for absence of crash reported in PR 2923: // // http://llvm.org/bugs/show_bug.cgi?id=2923 // // Previously we had a crash when deallocating the FunctionDecl for 'bar' // because FunctionDecl::getNumParams() just used the type of foo to determine // the number of parameters ...
// RUN: clang -fsyntax-only -verify %s // Test for absence of crash reported in PR 2923: // // http://llvm.org/bugs/show_bug.cgi?id=2923 // // Previously we had a crash when deallocating the FunctionDecl for 'bar' // because FunctionDecl::getNumParams() just used the type of foo to determine // the number of paramete...
Update driver version to 5.02.00-k4
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2006 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k3"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2006 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k4"
Change 00/21 to make all loops live
int main() { f_empty_goto_loop(); f_empty_while_loop(); f_empty_goto_loop_suffix(); f_empty_while_loop_suffix(); f_nonempty_goto_loop(); f_nonempty_while_loop(); return 0; } void f_empty_goto_loop() { f_empty_goto_loop_label: goto f_empty_goto_loop_label; } void f_empty_while_loop() { while (1) {} ...
int main() { // non-deterministically make all variants live int r; switch (r) { case 0: f_empty_goto_loop(); break; case 1: f_empty_while_loop(); break; case 2: f_empty_goto_loop_suffix(); break; case 3: f_empty_while_loop_suffix(); break; cas...
Add defines for enum type and conversions
/** * @file * * @brief * * @copyright BSD License (see doc/LICENSE.md or https://www.libelektra.org) */ #compiler-settings directiveStartToken = @ cheetahVarStartToken = $ #end compiler-settings @from support.elektra_gen import * @set support = ElektraGenSupport() @for $key, $info in $parameters.iteritems() @if...
/** * @file * * @brief * * @copyright BSD License (see doc/LICENSE.md or https://www.libelektra.org) */ #compiler-settings directiveStartToken = @ cheetahVarStartToken = $ #end compiler-settings @from support.elektra_gen import * @set support = ElektraGenSupport() #include <stdlib.h> #include <elektra.h> #inclu...
Add file that is accidentally removed.
#ifndef PAGE_H #define PAGE_H #include <stddef.h> #define PAGE_SIZE 4096ULL #define PAGE_SIZE_MASK (PAGE_SIZE - 1) #define PAGE_ALIGN_DOWN(x) (\ (void *) ((size_t) (x) & ~PAGE_SIZE_MASK) \ ) #define PAGE_ALIGN_UP(x) (\ (void *) ((size_t) ((x) + PAGE_SIZE_MASK) & ~PAGE_SIZE_MASK) \ ) #define PAGE_ALIGN...
Add TODO about strongly typing variable
// Copyright 2010-2014 The CefSharp Project. 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 "include/cef_v8.h" using namespace CefSharp::Internals; namespace CefSharp { public ref class Javas...
// Copyright 2010-2014 The CefSharp Project. 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 "include/cef_v8.h" using namespace CefSharp::Internals; namespace CefSharp { public ref class Javas...
Add base class from fs scorers
/** fs_scorer_base.h --- * * Copyright (C) 2013 OpenCog Foundation * * Author: Nil Geisweiller * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License v3 as * published by the Free Software Foundation and including the exceptions *...
Fix WindowsClassHolder destructor doing nothing.
#pragma once class WindowClassHolder { private: ATOM m_WindowClass; public: WindowClassHolder() : m_WindowClass(0) { } WindowClassHolder(ATOM windowClass) : m_WindowClass(windowClass) { } WindowClassHolder& operator=(ATOM windowClass) { if (m_WindowClass != 0) UnregisterClassW(*this, GetModuleHand...
#pragma once class WindowClassHolder { private: ATOM m_WindowClass; public: WindowClassHolder() : m_WindowClass(0) { } WindowClassHolder(ATOM windowClass) : m_WindowClass(windowClass) { } ~WindowClassHolder() { if (m_WindowClass != 0) UnregisterClassW(*this, GetModuleHandleW(nullptr)); } Window...
Add missing mark for pure virtual method
// 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...
// 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...
Fix build on Linux where gcc apparently enforces character arrays as arrays for initialization purposes.
#ifndef MIAOW_SIAGEN_H #define MIAOW_SIAGEN_H #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <sys/types.h> #include "asm.h" #include "helper.h" #define MAX_INSTR 1000 #define MAX_OPS 50 #define INSTR_TYPES 4 #define SCALAR_ALU 0 #define VECTOR_ALU 1 #define SCALAR_MEM 2 #define VECTOR_MEM 3 ...
#ifndef MIAOW_SIAGEN_H #define MIAOW_SIAGEN_H #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <sys/types.h> #include <string> #include "asm.h" #include "helper.h" #define MAX_INSTR 1000 #define MAX_OPS 50 #define INSTR_TYPES 4 #define SCALAR_ALU 0 #define VECTOR_ALU 1 #define SCALAR_MEM 2 #def...
Fix compilation for gcc 4.7
#pragma once #include <glbinding/glbinding_api.h> #include <set> #include <vector> #include <functional> namespace glbinding { class AbstractFunction; class AbstractValue; struct GLBINDING_API FunctionCall { FunctionCall(const AbstractFunction * _function); ~FunctionCall(); FunctionCall & operator=(c...
#pragma once #include <glbinding/glbinding_api.h> #include <set> #include <vector> #include <functional> #include <string> namespace glbinding { class AbstractFunction; class AbstractValue; struct GLBINDING_API FunctionCall { FunctionCall(const AbstractFunction * _function); ~FunctionCall(); Function...
Add missing include needed to define uint16_t
/* * * Copyright 2017 Asylo 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 2017 Asylo 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...
Add minimized pfscan workers test
// SKIP PARAM: --set ana.activated[+] apron --set ana.path_sens[+] threadflag --set ana.apron.privatization mutex-meet --set sem.int.signed_overflow assume_none --enable ana.apron.strengthening // minimized pfscan with relational workers invariant // mutex-meet: needs strengthening even with path_sens threadflag // mut...
Remove space that was forgotten.`
// RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32( i32} | count 2 // RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32(i32} | count 1 unsigned t2(unsigned X) { return __builtin_clz(X); } int t1(int X) { return __builtin_clz(X); }
// RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32(i32} | count 2 // RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32(i32} | count 1 unsigned t2(unsigned X) { return __builtin_clz(X); } int t1(int X) { return __builtin_clz(X); }
Add stub file for pid probe. It's required although pid probe is not supported on MIPS yet
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * o...
Fix bug in ref counting
#ifndef NUCLEUS_MEMORY_REF_COUNTED_H_ #define NUCLEUS_MEMORY_REF_COUNTED_H_ #include <atomic> #include "nucleus/Macros.h" namespace nu { namespace detail { class RefCountedBase { public: bool hasOneRef() const { return m_refCount.load(std::memory_order_release) == 1; } void addRef() const { m_refCo...
#ifndef NUCLEUS_MEMORY_REF_COUNTED_H_ #define NUCLEUS_MEMORY_REF_COUNTED_H_ #include <atomic> #include "nucleus/Macros.h" namespace nu { namespace detail { class RefCountedBase { public: COPY_DELETE(RefCountedBase); MOVE_DELETE(RefCountedBase); bool hasOneRef() const { return m_refCount.load(std::memor...
Fix a bug from BlocksKit
// // BlocksKit+MessageUI // // The Objective-C block utilities you always wish you had. // // Copyright (c) 2011-2012, 2013-2014 Zachary Waldowski // Copyright (c) 2012-2013 Pandamonia LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated docume...
// // BlocksKit+MessageUI // // The Objective-C block utilities you always wish you had. // // Copyright (c) 2011-2012, 2013-2014 Zachary Waldowski // Copyright (c) 2012-2013 Pandamonia LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated docume...
Add current direction and speed variable. Should probably be moved somewhere else.
#pragma once #include <HgTypes.h> #ifdef __cplusplus extern "C" { #endif typedef struct HgCamera { point position; quaternion rotation; } HgCamera; vector3 ray_from_camera(HgCamera* c); #ifdef __cplusplus } #endif
#pragma once #include <HgTypes.h> #ifdef __cplusplus extern "C" { #endif typedef struct HgCamera { point position; quaternion rotation; vector3 direction; float speedMsec; } HgCamera; vector3 ray_from_camera(HgCamera* c); #ifdef __cplusplus } #endif
Add updated params to interval-congruence ref. reg test
// PARAM: --disable ana.int.def_exc --enable ana.int.interval --enable ana.int.congruence #include <assert.h> int main(){ int r = -103; for (int i = 0; i < 40; i++) { r = r + 5; } // At this point r in the congr. dom should be 2 + 5Z int k = r; if (k >= 3) { // After refinement ...
// PARAM: --disable ana.int.def_exc --enable ana.int.interval --enable ana.int.congruence --enable ana.int.congruence_no_overflow --enable ana.int.refinement #include <assert.h> int main(){ int r = -103; for (int i = 0; i < 40; i++) { r = r + 5; } // At this point r in the congr. dom should be...
Change enum to scoped enum
/** * @copyright Copyright 2018 The J-PET Framework Authors. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may find a copy of the License in the LICENCE file. * * Unless required by applicable la...
/** * @copyright Copyright 2021 The J-PET Framework Authors. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may find a copy of the License in the LICENCE file. * * Unless required by applicable la...
Change property reference to weak to match private reference
// // SDCAlertViewCoordinator.h // SDCAlertView // // Created by Scott Berrevoets on 1/25/14. // Copyright (c) 2014 Scotty Doesn't Code. All rights reserved. // #import <Foundation/Foundation.h> @class SDCAlertView; @interface SDCAlertViewCoordinator : NSObject @property (nonatomic, readonly) SDCAlertView *visi...
// // SDCAlertViewCoordinator.h // SDCAlertView // // Created by Scott Berrevoets on 1/25/14. // Copyright (c) 2014 Scotty Doesn't Code. All rights reserved. // #import <Foundation/Foundation.h> @class SDCAlertView; @interface SDCAlertViewCoordinator : NSObject @property (nonatomic, weak, readonly) SDCAlertView...
Test whether two function name is same but num_para not is legal
#include<stdlib.h> void test(int i){ printf("in test(%d)\n",i); } void test(){ printf("in test()\n"); } int main(){ test(); test(1); return 0; }
Add example LED blink task
/** * @file main.c * @brief Main. * */ #include "stm32f4xx_conf.h" #include "FreeRTOS.h" int main(void) { // TODO while(1); return 0; }
/** * @file main.c * @brief Main. * */ #include "stm32f4xx_conf.h" #include "stm32f4xx_gpio.h" #include "stm32f4xx_rcc.h" #include "FreeRTOS.h" #include "task.h" void hw_init(void) { GPIO_InitTypeDef gpio_led; GPIO_StructInit(&gpio_led); gpio_led.GPIO_Mode = GPIO_Mode_OUT; gpio_led.GPIO_Pin = ...
Fix TextVersion still being 5.6
/* Title: version.h Copyright (c) 2000-17 Cambridge University Technical Services Limited 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 o...
/* Title: version.h Copyright (c) 2000-17 Cambridge University Technical Services Limited 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 o...
Fix missing change in header
#ifndef PY_UTILS_H #define PY_UTILS_H #include <stdio.h> extern FILE *stdin_writer; void setupPython(const char* pythonProgramPath, const char* pythonLibs, const char* pythonHostLibs, const char* pythonHome, const char* pythonTemp, const char* xdgBasePath); void setupStdinEmulation(void); void readF...
#ifndef PY_UTILS_H #define PY_UTILS_H #include <stdio.h> extern FILE *stdin_writer; void setupPython(const char* pythonProgramPath, const char* pythonLibs, const char* pythonHostLibs, const char* pythonHome, const char* pythonTemp, const char* xdgBasePath, const char* dataDir); void...
Fix after review: perfect forwarding used for callable object
// // Copyright Renga Software LLC, 2017. All rights reserved. // // Renga Software LLC PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. // Renga Software LLC DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE // UNINTERRUPTED OR ERROR FREE. // #pragma once class BoolGuard { public: explicit BoolGuard(b...
// // Copyright Renga Software LLC, 2017. All rights reserved. // // Renga Software LLC PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. // Renga Software LLC DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE // UNINTERRUPTED OR ERROR FREE. // #pragma once class BoolGuard { public: explicit BoolGuard(b...
Fix pass by value error in SpeechRecognitionHypothesis constructor.
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_ #define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_ #pragma once #include <vector> ...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_ #define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_ #pragma once #include <vector> ...
Build number for OpenSSL bug fix
#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 99 #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 99 #define CLIENT_VERSION_BUILD...
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 SMP build with disabled CPU hotplugging.
#ifndef _OFFLINE_STATES_H_ #define _OFFLINE_STATES_H_ /* Cpu offline states go here */ enum cpu_state_vals { CPU_STATE_OFFLINE, CPU_STATE_INACTIVE, CPU_STATE_ONLINE, CPU_MAX_OFFLINE_STATES }; extern enum cpu_state_vals get_cpu_current_state(int cpu); extern void set_cpu_current_state(int cpu, enum cpu_state_vals ...
#ifndef _OFFLINE_STATES_H_ #define _OFFLINE_STATES_H_ /* Cpu offline states go here */ enum cpu_state_vals { CPU_STATE_OFFLINE, CPU_STATE_INACTIVE, CPU_STATE_ONLINE, CPU_MAX_OFFLINE_STATES }; #ifdef CONFIG_HOTPLUG_CPU extern enum cpu_state_vals get_cpu_current_state(int cpu); extern void set_cpu_current_state(int...
Add prefix file for ProjectBuilder samples
/* * The Apache Software License, Version 1.1 * * Copyright (c) 2001-2002 The Apache Software Foundation. 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 sou...
Fix import React/RCTBridgeModule.h, needed by RN 0.50
// // RCTSpotlightSearch.h // RCTSpotlightSearch // // Created by James (Home) on 21/06/2016. // Copyright © 2016 James Munro. All rights reserved. // #import <Foundation/Foundation.h> #import "RCTBridgeModule.h" @interface RCTSpotlightSearch : NSObject <RCTBridgeModule> + (void)handleContinueUserActivity:(NSUse...
// // RCTSpotlightSearch.h // RCTSpotlightSearch // // Created by James (Home) on 21/06/2016. // Copyright © 2016 James Munro. All rights reserved. // #import <Foundation/Foundation.h> #import <React/RCTBridgeModule.h> @interface RCTSpotlightSearch : NSObject <RCTBridgeModule> + (void)handleContinueUserActivity:...
Add override specifier for VectorBufferWriter destructor.
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/searchlib/util/bufferwriter.h> #include <vector> namespace search::test { class VectorBufferWriter : public BufferWriter { private: char tmp[1024]; public: std::vector<char> ...
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/searchlib/util/bufferwriter.h> #include <vector> namespace search::test { class VectorBufferWriter : public BufferWriter { private: char tmp[1024]; public: std::vector<char> ...
Add List Search function implementation
#include "list.h" struct ListNode { ListNode* prev; ListNode* next; void* k; }; struct List { ListNode* head; }; List* List_Create(void) { List* l = (List *)malloc(sizeof(List)); l->head = NULL; return l; } ListNode* ListNode_Create(void* k) { ListNode* n = (ListNode *)malloc(sizeof(ListNode)); n->prev = N...
#include "list.h" struct ListNode { ListNode* prev; ListNode* next; void* k; }; struct List { ListNode* head; }; List* List_Create(void) { List* l = (List *)malloc(sizeof(List)); l->head = NULL; return l; } ListNode* ListNode_Create(void* k) { ListNode* n = (ListNode *)malloc(sizeof(ListNode)); n->prev = N...
Allow extinguishing of objects with the same creator as yourself.
#include <status.h> #include <kotaka/paths.h> #include <kotaka/log.h> #include <kotaka/privilege.h> inherit SECOND_AUTO; void extinguish(string path) { ACCESS_CHECK(KADMIN()); call_out("purge", 0, path, status(ST_OTABSIZE)); } static void purge(string path, int quota) { int limit; limit = 200; if (quota % lim...
#include <status.h> #include <kotaka/paths.h> #include <kotaka/log.h> #include <kotaka/privilege.h> inherit SECOND_AUTO; void extinguish(string path) { if (!KADMIN()) { string opath; opath = object_name(previous_object()); ACCESS_CHECK(DRIVER->creator(opath)); ACCESS_CHECK(DRIVER->creator(opath) == DRIVER-...
Disable PROM access on init.
#include "drmP.h" #include "drm.h" #include "nouveau_drv.h" #include "nouveau_drm.h" int nv04_mc_init(struct drm_device *dev) { /* Power up everything, resetting each individual unit will * be done later if needed. */ nv_wr32(dev, NV03_PMC_ENABLE, 0xFFFFFFFF); return 0; } void nv04_mc_takedown(struct drm_devi...
#include "drmP.h" #include "drm.h" #include "nouveau_drv.h" #include "nouveau_drm.h" int nv04_mc_init(struct drm_device *dev) { /* Power up everything, resetting each individual unit will * be done later if needed. */ nv_wr32(dev, NV03_PMC_ENABLE, 0xFFFFFFFF); /* Disable PROM access. */ nv_wr32(dev, NV_PBUS_...
Add example of formatted C string for string in M_LET
#include <stdio.h> #include "m-array.h" #include "m-string.h" // Let's create an array of string_t and register it globaly ARRAY_DEF(vector_string, string_t) #define M_OPL_vector_string_t() ARRAY_OPLIST(vector_string, STRING_OPLIST) int main(void) { // Let's define a new string named str M_LET(str, string_t)...
#include <stdio.h> #include "m-array.h" #include "m-string.h" // Let's create an array of string_t and register it globaly ARRAY_DEF(vector_string, string_t) #define M_OPL_vector_string_t() ARRAY_OPLIST(vector_string, STRING_OPLIST) int main(void) { // Let's define a new string named str M_LET(str, string_t)...
Use correct module directory when making keyboard. Previous commit fixed compiler warnings also.
#include "e.h" #include "e_mod_main.h" #include "e_mod_config.h" #include "e_kbd_int.h" /* local variables */ static E_Kbd_Int *ki = NULL; EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Keyboard" }; EAPI void * e_modapi_init(E_Module *m) { if (!il_kbd_config_init(m)) return NULL; ki = e_kbd_int...
#include "e.h" #include "e_mod_main.h" #include "e_mod_config.h" #include "e_kbd_int.h" /* local variables */ static E_Kbd_Int *ki = NULL; EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Keyboard" }; EAPI void * e_modapi_init(E_Module *m) { if (!il_kbd_config_init(m)) return NULL; ki = e_kbd_int...
Throw a fatal pre-processor error if (n > UINT_MAX).
#ifndef _DOORS_H_ #define _DOORS_H_ #ifndef NUMBER_OF_DOORS #define NUMBER_OF_DOORS 3 #endif typedef struct { unsigned int has_prize : 1; unsigned int currently_selected: 1; unsigned int revealed : 1; } door; /* * game status updates */ extern void set_doors(void); extern vo...
#ifndef _DOORS_H_ #define _DOORS_H_ #ifndef NUMBER_OF_DOORS #define NUMBER_OF_DOORS 3 #endif #include <limits.h> #if (NUMBER_OF_DOORS > UINT_MAX) #error (n) doors exceeds storage allocation limit for `unsigned int'. #endif typedef struct { unsigned int has_prize : 1; unsigned int currently_s...
Add a convenience function to get an NSString from a CLLocationCoordinate2D object
#import <CoreLocation/CLLocation.h> #define DEGREES_PER_RADIAN 180.0 / M_PI #define RADIANS_PER_DEGREE M_PI / 180.0 #define DEFAULT_MAP_CENTER CLLocationCoordinate2DMake(42.35913,-71.09325) #define DEFAULT_MAP_SPAN MKCoordinateSpanMake(0.006, 0.006) // these are 1 and 2 miles respectively #define OUT_OF_BOUNDS_DISTA...
#import <CoreLocation/CLLocation.h> #import <CoreLocation/CoreLocation.h> #define DEGREES_PER_RADIAN 180.0 / M_PI #define RADIANS_PER_DEGREE M_PI / 180.0 #define DEFAULT_MAP_CENTER CLLocationCoordinate2DMake(42.35913,-71.09325) #define DEFAULT_MAP_SPAN MKCoordinateSpanMake(0.006, 0.006) // these are 1 and 2 miles re...
Add parameter passing example in c
/* * Author: Jhonatan Casale (jhc) * * Contact : jhonatan@jhonatancasale.com * : casale.jhon@gmail.com * : https://github.com/jhonatancasale * : https://twitter.com/jhonatancasale * : http://jhonatancasale.github.io/ * * Create date Sat 10 Dec 16:13:19 BRST 2016 * */ #include...
Use move semantics in Optional implementation.
#pragma once namespace me { template<class T> class Optional { T *m_object; public: Optional() : m_object(0) {} Optional(const T& other) : m_object(new T(other)) {} Optional& operator=(const T& other) { if (m_object != 0) { delete m_object; } m_object = new T(other); return...
#pragma once namespace me { // basic optional implementation. template<class T> class Optional { T *m_object; public: Optional() : m_object(0) { } // copy constructor Optional(const Optional<T>& other) : m_object(new T(*other)) { } // move constructor Optional(Optional<T>&& other) : m...
Mark ContiguousMemoryRange::size as const. am: f2c28cd765
/* * Copyright (C) 2017 The Android Open Source Project * * 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 app...
/* * Copyright (C) 2017 The Android Open Source Project * * 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 app...
Add infinite goto loop examples as SV-COMP tests
extern void __VERIFIER_error() __attribute__((__noreturn__)); int main() { f_empty_goto_loop(); f_empty_while_loop(); f_empty_goto_loop_suffix(); f_empty_while_loop_suffix(); f_nonempty_goto_loop(); f_nonempty_while_loop(); return 0; } void f_empty_goto_loop() { f_empty_goto_loop_label: goto f_empty_...
Add support for the Python Stdout Log
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. #pragma once #include "ModuleManager.h" DECLARE_LOG_CATEGORY_EXTERN(LogPython, Log, All); class UNREALENGINEPYTHON_API FUnrealEnginePythonModule : public IModuleInterface { public: bool PythonGILAcquire(); void PythonGILRelease(); virtual void Start...
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. #pragma once #include "ModuleManager.h" DECLARE_LOG_CATEGORY_EXTERN(LogPython, Log, All); class UNREALENGINEPYTHON_API FUnrealEnginePythonModule : public IModuleInterface { public: bool PythonGILAcquire(); void PythonGILRelease(); virtual void Start...
Fix forward declaration of BmStorageLinkContext.
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/storage/common/storage_chain_builder.h> namespace feedbm { class BmStorageLinkContext; /* * Storage chain builder that inserts a BmStorageLink right below the * communicat...
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/storage/common/storage_chain_builder.h> namespace feedbm { struct BmStorageLinkContext; /* * Storage chain builder that inserts a BmStorageLink right below the * communica...
Exclude skiplist string key tests from device
/******************************************************************************/ /** @file @author Kris Wallperington @brief Behaviour tests for the skip list implementation. @copyright Copyright 2016 The University of British Columbia, IonDB Project Contributors (see AUTHORS.md) @par Licensed under the Ap...
/******************************************************************************/ /** @file @author Kris Wallperington @brief Behaviour tests for the skip list implementation. @copyright Copyright 2016 The University of British Columbia, IonDB Project Contributors (see AUTHORS.md) @par Licensed under the Ap...
Test cleanup-attribute with const struct parameter
// RUN: %ocheck 0 %s struct store_out { int *local; int *ret; }; void store_out(const struct store_out *const so) { *so->ret = *so->local; } void f(int *p) { int i = *p; struct store_out so __attribute((cleanup(store_out))) = { .local = &i, .ret = p }; i = 5; } main() { int i = 3; f(&i); if(i != 5)...
Add Linux porting (for testing)
#if !defined(DUX_OPT_NO_TIMER) && defined(__linux__) #include "../dux_internal.h" #include <time.h> DUK_INTERNAL duk_uint_t dux_timer_current(void) { struct timespec tp; if (clock_gettime(CLOCK_MONOTONIC, &tp) != 0) { return 0; } return (duk_uint_t)(tp.tv_sec * 1000 + tp.tv_nsec / 1000000); } #endif /* !DUX_...
Introduce the macro `PATH_LITERAL` for helping construct `PathString`.
/* @ 0xCCCCCCCC */ #if defined(_MSC_VER) #pragma once #endif #ifndef KLOG_BASIC_TYPES_H_ #define KLOG_BASIC_TYPES_H_ #include <string> #include "klog/basic_macros.h" namespace klog { #if defined(OS_WIN) using PathChar = wchar_t; using PathString = std::wstring; #else using PathChar = char; using PathString = std...
/* @ 0xCCCCCCCC */ #if defined(_MSC_VER) #pragma once #endif #ifndef KLOG_BASIC_TYPES_H_ #define KLOG_BASIC_TYPES_H_ #include <string> #include "klog/basic_macros.h" namespace klog { #if defined(OS_WIN) using PathChar = wchar_t; using PathString = std::wstring; #define PATH_LITERAL(str) L##str #else using PathCh...
Change __nosave_XXX symbols to long
#ifndef __ASM_SH_SECTIONS_H #define __ASM_SH_SECTIONS_H #include <asm-generic/sections.h> extern void __nosave_begin, __nosave_end; extern long __machvec_start, __machvec_end; extern char __uncached_start, __uncached_end; extern char _ebss[]; extern char __start_eh_frame[], __stop_eh_frame[]; #endif /* __ASM_SH_SECT...
#ifndef __ASM_SH_SECTIONS_H #define __ASM_SH_SECTIONS_H #include <asm-generic/sections.h> extern long __nosave_begin, __nosave_end; extern long __machvec_start, __machvec_end; extern char __uncached_start, __uncached_end; extern char _ebss[]; extern char __start_eh_frame[], __stop_eh_frame[]; #endif /* __ASM_SH_SECT...
Remove deleted header declaration for SaveFrameToSkPicture
// Copyright 2015 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. #import <UIKit/UIKit.h> #import "sky/shell/shell_view.h" @interface SkySurface : UIView -(instancetype) initWithShellView:(sky::shell::ShellView *) shel...
// Copyright 2015 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. #import <UIKit/UIKit.h> #import "sky/shell/shell_view.h" @interface SkySurface : UIView -(instancetype) initWithShellView:(sky::shell::ShellView *) shel...
Change version to 0.1.0 to follow the PHP standard.
/* This module exposes to PHP the equivalent of: * // Creates a chdb file containing the key-value pairs specified in the * // array $data, or throws an exception in case of error. * function chdb_create($pathname, $data); * * // Represents a loaded chdb file. * class chdb * { * // Loads a...
/* This module exposes to PHP the equivalent of: * // Creates a chdb file containing the key-value pairs specified in the * // array $data, or throws an exception in case of error. * function chdb_create($pathname, $data); * * // Represents a loaded chdb file. * class chdb * { * // Loads a...
Add <cstddef> to use std::size_t.
#ifndef GLOBAL__H #define GLOBAL__H namespace qflex::global { // Default verbose level inline int verbose = 0; // Max allowed memory (default: 1GB) inline std::size_t memory_limit = 1L << 30; // Interval to track memory (default: 0) inline std::size_t track_memory_seconds = 0; } // namespace qflex::global #endif...
#ifndef GLOBAL__H #define GLOBAL__H #include <cstddef> namespace qflex::global { // Default verbose level inline int verbose = 0; // Max allowed memory (default: 1GB) inline std::size_t memory_limit = 1L << 30; // Interval to track memory (default: 0) inline std::size_t track_memory_seconds = 0; } // namespace q...
Use unsafe_unretained for delegates, to support OS X
// // RACDelegateProxy.h // ReactiveCocoa // // Created by Cody Krieger on 5/19/12. // Copyright (c) 2012 GitHub, Inc. All rights reserved. // #import <Foundation/Foundation.h> // A delegate object suitable for using -rac_signalForSelector:fromProtocol: // upon. @interface RACDelegateProxy : NSObject // The dele...
// // RACDelegateProxy.h // ReactiveCocoa // // Created by Cody Krieger on 5/19/12. // Copyright (c) 2012 GitHub, Inc. All rights reserved. // #import <Foundation/Foundation.h> // A delegate object suitable for using -rac_signalForSelector:fromProtocol: // upon. @interface RACDelegateProxy : NSObject // The dele...
Remove duplicate declarations of _stext[] and _etext[]
/* * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu> * Copyright (C) 2008-2009 PetaLogix * Copyright (C) 2006 Atmark Techno, Inc. * * 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) 2008-2009 Michal Simek <monstr@monstr.eu> * Copyright (C) 2008-2009 PetaLogix * Copyright (C) 2006 Atmark Techno, Inc. * * 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. */ ...
Fix macro in Chrome's GL config file
#ifndef GrGLConfig_chrome_DEFINED #define GrGLConfig_chrome_DEFINED #define GR_SUPPORT_GLES2 1 // gl2ext.h will define these extensions macros but Chrome doesn't provide // prototypes. #define GL_OES_mapbuffer 0 #define GR_GL_PLATFORM_HEADER <GLES2/gl2.h> #define GR_GL_PLATFORM_HEADER_E...
#ifndef GrGLConfig_chrome_DEFINED #define GrGLConfig_chrome_DEFINED #define GR_SUPPORT_GLES2 1 // gl2ext.h will define these extensions macros but Chrome doesn't provide // prototypes. #define GL_OES_mapbuffer 0 #define GR_GL_PLATFORM_HEADER <GLES2/gl2.h> #define GR_GL_PLATFORM_HEADER_E...
Add a tag (dummy) header file that will be updated whenever CINT's dictionaries need to be regenerated.
/*********************************************************************** * cint (C/C++ interpreter) ************************************************************************ * CINT header file cintdictversion.h ************************************************************************ * Description: * definition of...
Fix typo in the commit a5312c77.
#include <string.h> #include "ruby.h" #include "rubyspec.h" #ifdef __cplusplus extern "C" { #endif #ifdef HAVE_RB_PROC_NEW VALUE concat_func(VALUE args) { int i; char buffer[500] = {0}; if (TYPE(val) != T_ARRAY) return Qnil; for(i = 0; i < RARRAY_LEN(args); ++i) { VALUE v = RARRAY_PTR(args)[i]; strca...
#include <string.h> #include "ruby.h" #include "rubyspec.h" #ifdef __cplusplus extern "C" { #endif #ifdef HAVE_RB_PROC_NEW VALUE concat_func(VALUE args) { int i; char buffer[500] = {0}; if (TYPE(args) != T_ARRAY) return Qnil; for(i = 0; i < RARRAY_LEN(args); ++i) { VALUE v = RARRAY_PTR(args)[i]; strc...
Add automatic check to sanity/strict-loop-enter
//PARAM: --disable ana.int.def_exc --enable ana.int.interval --sets solver slr3tp int g = 0; int main() { int x; for(x=0; x < 50; x++){ g = 1; } // x = [50, 50] after narrow if(x>50){ // live after widen, but dead after narrow // node after Pos(x>50) is marked dead at the end // but the loop is...
//PARAM: --disable ana.int.def_exc --enable ana.int.interval --sets solver slr3tp --enable dbg.debug // dbg.debug manually enabled since update_suite only enables it when it sees normal assertion (without NOWARN) #include <assert.h> int g = 0; int main() { int x; for(x=0; x < 50; x++){ g = 1; } // x = [5...
Reduce spew when using system().
/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include <stdlib.h> #include "verbose.h" #include "utils.h" unsigned utils_execute_command(const char *cmd) { int result = system(cmd); ...
/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include <stdlib.h> #include "verbose.h" #include "utils.h" unsigned utils_execute_command(const char *cmd) { int result = system(cmd); ...
Fix playback slider initially acting as pressed
#ifndef WIDGETS_SLIDERDIRECTJUMP_H #define WIDGETS_SLIDERDIRECTJUMP_H #include <QSlider> class QMouseEvent; class SliderDirectJump : public QSlider { Q_OBJECT public: explicit SliderDirectJump(QWidget* parent = nullptr); explicit SliderDirectJump(Qt::Orientation orientation, QWidget* parent = nullptr); ~Sl...
#ifndef WIDGETS_SLIDERDIRECTJUMP_H #define WIDGETS_SLIDERDIRECTJUMP_H #include <QSlider> class QMouseEvent; class SliderDirectJump : public QSlider { Q_OBJECT public: explicit SliderDirectJump(QWidget* parent = nullptr); explicit SliderDirectJump(Qt::Orientation orientation, QWidget* parent = nullptr); ~Sl...
Fix typo in tab removal
#ifndef RADIOMULT_H #define RADIOMULT_H #include "NdbMF.h" /* ========= NdbRadioMult ============ */ class NdbRad ioMult : public NdbMF { protected: public: NdbRadioMult() : NdbMF(9, "Multiplicities for radioactive nuclide production") {} ~NdbRadioMult() {} ClassDef(NdbRadioMult,1) }; // NdbRadioMul...
#ifndef RADIOMULT_H #define RADIOMULT_H #include "NdbMF.h" /* ========= NdbRadioMult ============ */ class NdbRadioMult : public NdbMF { protected: public: NdbRadioMult() : NdbMF(9, "Multiplicities for radioactive nuclide production") {} ~NdbRadioMult() {} ClassDef(NdbRadioMult,1) }; // NdbRadioMult ...
Update the driver version to 8.06.00.08-k.
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.05.00.03-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 5 #define QLA_DRIVER_PATCH_VER 0 #defi...
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.06.00.08-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 6 #define QLA_DRIVER_PATCH_VER 0 #defi...
Make sh4 build works again adding a temporary work-around iby redefining __always_inline to inline until gcc 4.x.x will get fixed.
/* We can't use the real errno in ldso, since it has not yet * been dynamicly linked in yet. */ #include "sys/syscall.h" extern int _dl_errno; #undef __set_errno #define __set_errno(X) {(_dl_errno) = (X);} #warning !!! __always_inline redefined waiting for the fixed gcc #ifdef __always_inline #undef __always_inline #d...
/* We can't use the real errno in ldso, since it has not yet * been dynamicly linked in yet. */ #include "sys/syscall.h" extern int _dl_errno; #undef __set_errno #define __set_errno(X) {(_dl_errno) = (X);} #if __GNUC_PREREQ (4, 1) #warning !!! gcc 4.1 and later have problems with __always_inline so redefined as inlin...
Make the audio player a public property.
// // EPSPlayerViewModel.h // ReactiveAudioPlayer // // Created by Peter Stuart on 4/24/14. // Copyright (c) 2014 Electric Peel, LLC. All rights reserved. // #import <Foundation/Foundation.h> #import <ReactiveCocoa/ReactiveCocoa.h> @interface EPSPlayerViewModel : NSObject @property (nonatomic) NSURL *audioURL; ...
// // EPSPlayerViewModel.h // ReactiveAudioPlayer // // Created by Peter Stuart on 4/24/14. // Copyright (c) 2014 Electric Peel, LLC. All rights reserved. // #import <Foundation/Foundation.h> #import <ReactiveCocoa/ReactiveCocoa.h> #import <AVFoundation/AVFoundation.h> @interface EPSPlayerViewModel : NSObject @p...
Switch back to ALSA on Linux;
#define MINIAUDIO_IMPLEMENTATION #define MA_ENABLE_ONLY_SPECIFIC_BACKENDS #define MA_ENABLE_WASAPI #define MA_ENABLE_PULSEAUDIO #define MA_ENABLE_COREAUDIO #define MA_ENABLE_AAUDIO #define MA_ENABLE_WEBAUDIO #define MA_NO_DECODING #define MA_NO_ENCODING #define MA_NO_GENERATION #include "miniaudio.h"
#define MINIAUDIO_IMPLEMENTATION #define MA_ENABLE_ONLY_SPECIFIC_BACKENDS #define MA_ENABLE_WASAPI #define MA_ENABLE_ALSA #define MA_ENABLE_COREAUDIO #define MA_ENABLE_AAUDIO #define MA_ENABLE_WEBAUDIO #define MA_NO_DECODING #define MA_NO_ENCODING #define MA_NO_GENERATION #include "miniaudio.h"
Add int dummy; to empty struct TestConformSimpleFixture definition.
/* Stuff you put in here is setup once in main() and gets passed around to * all test functions and fixture setup/teardown functions in the data * argument */ typedef struct _TestConformSharedState { int *argc_addr; char ***argv_addr; } TestConformSharedState; /* This fixture structure is allocated by glib, a...
/* Stuff you put in here is setup once in main() and gets passed around to * all test functions and fixture setup/teardown functions in the data * argument */ typedef struct _TestConformSharedState { int *argc_addr; char ***argv_addr; } TestConformSharedState; /* This fixture structure is allocated by glib, a...
Include <chrono> needed for chrono::system_clock
#pragma once #include <array> #include <random> #include "jkqtplotter/jkqtplotter.h" #define NDATA 500 class SpeedTestPlot: public JKQtPlotter { Q_OBJECT protected: std::array<double, NDATA> X, Y, Y2; const double dx; double x0; std::chrono::system_clock::tim...
#pragma once #include <array> #include <random> #include <chrono> #include "jkqtplotter/jkqtplotter.h" #define NDATA 500 class SpeedTestPlot: public JKQtPlotter { Q_OBJECT protected: std::array<double, NDATA> X, Y, Y2; const double dx; double x0; std::chro...
Build fix for certain configurations.
/* * This is included by init/main.c to check for architecture-dependent bugs. * * Needs: * void check_bugs(void); */ #ifndef _ASM_BUGS_H #define _ASM_BUGS_H #include <linux/config.h> #include <asm/cpu.h> #include <asm/cpu-info.h> extern void check_bugs32(void); extern void check_bugs64(void); static inline voi...
/* * This is included by init/main.c to check for architecture-dependent bugs. * * Needs: * void check_bugs(void); */ #ifndef _ASM_BUGS_H #define _ASM_BUGS_H #include <linux/config.h> #include <linux/delay.h> #include <asm/cpu.h> #include <asm/cpu-info.h> extern void check_bugs32(void); extern void check_bugs64(...
Add skeleton for the splay tree implementation
#pragma once /* * Splay tree - a self-Adjusting binary search tree, * as first described by Daniel Dominic Sleator and Robert Endre Tarjan. * * https://www.cs.cmu.edu/~sleator/papers/self-adjusting.pdf */ templace<class T> class SplayTree { private: struct Node { Node* left; Node* right; ...
Fix mac bustage (more still).
// -*- c-basic-offset: 2 -*- /* * This file is part of the KDE libraries * Copyright (C) 2006 George Staikos <staikos@kde.org> * * 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...
// -*- c-basic-offset: 2 -*- /* * This file is part of the KDE libraries * Copyright (C) 2006 George Staikos <staikos@kde.org> * * 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...
Fix read_all and return content without segment fault
#include <cgreen/slurp.h> #include <stdlib.h> #include <stdio.h> static char *read_all(FILE *file, int gulp); char *slurp(const char *file_name, int gulp) { FILE *file = fopen(file_name, "r"); if (file == NULL) { return NULL; } char *content = read_all(file, gulp); fclose(file); return...
#include <cgreen/slurp.h> #include <stdlib.h> #include <stdio.h> #include <strings.h> static char *read_all(FILE *file, int gulp); char *slurp(const char *file_name, int gulp) { FILE *file = fopen(file_name, "r"); if (file == NULL) { return NULL; } char *content = read_all(file, gulp); fcl...
Copy the file path, just in case the string was mutable.
/** */ #import "SVGKSource.h" @interface SVGKSourceLocalFile : SVGKSource @property (nonatomic, retain) NSString* filePath; + (SVGKSource*)sourceFromFilename:(NSString*)p; @end
/** */ #import "SVGKSource.h" @interface SVGKSourceLocalFile : SVGKSource @property (nonatomic, copy) NSString* filePath; + (SVGKSource*)sourceFromFilename:(NSString*)p; @end