Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Use more common technical term
/** * @file * * @brief * * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) */ #include <kdb.h> #include <stdio.h> int main (void) { KeySet * config = ksNew (0, KS_END); Key * root = keyNew ("user/test", KEY_END); printf ("Open key database\n"); KDB * handle = kdbOpen (root); printf...
/** * @file * * @brief * * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) */ #include <kdb.h> #include <stdio.h> int main (void) { KeySet * config = ksNew (0, KS_END); Key * root = keyNew ("user/test", KEY_END); printf ("Open key database\n"); KDB * handle = kdbOpen (root); printf...
Add default values to VkAllocation
#ifndef VKALLOC_VKALLOC_H #define VKALLOC_VKALLOC_H #include <stdlib.h> #include <stdint.h> #include <vulkan/vulkan.h> #ifndef VKA_ALLOC_SIZE #define VKA_ALLOC_SIZE 1024*1024*4 #endif struct VkAllocation { VkDeviceMemory deviceMemory; uint64_t offset; uint64_t size; }; void vkaInit(VkPhysicalDevice phys...
#ifndef VKALLOC_VKALLOC_H #define VKALLOC_VKALLOC_H #include <stdlib.h> #include <stdint.h> #include <vulkan/vulkan.h> #ifndef VKA_ALLOC_SIZE #define VKA_ALLOC_SIZE 1024*1024*4 #endif struct VkAllocation { VkDeviceMemory deviceMemory = VK_NULL_HANDLE; uint64_t offset = 0; uint64_t size = 0; }; void vkaI...
Add test for incomplete struct pointer.
// RUN: clang -checker-simple -verify %s && // RUN: clang -checker-simple -analyzer-store-region -verify %s struct s { int data; int data_array[10]; }; typedef struct { int data; } STYPE; void g1(struct s* p); void f(void) { int a[10]; int (*p)[10]; p = &a; (*p)[3] = 1; struct s d; struct s *q;...
// RUN: clang -checker-simple -verify %s && // RUN: clang -checker-simple -analyzer-store-region -verify %s struct s { int data; int data_array[10]; }; typedef struct { int data; } STYPE; void g1(struct s* p); void f(void) { int a[10]; int (*p)[10]; p = &a; (*p)[3] = 1; struct s d; struct s *q;...
Add explicit triple to test to fix arm bots.
// RUN: %clang_cc1 -S -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s // CHECK: !DIGlobalVariable({{.*}} // CHECK-NOT: expr: static const __uint128_t ro = 18446744073709551615; void bar(__uint128_t); void foo() { bar(ro); }
// RUN: %clang_cc1 -triple x86_64-unknown-linux -S -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s // CHECK: !DIGlobalVariable({{.*}} // CHECK-NOT: expr: static const __uint128_t ro = 18446744073709551615; void bar(__uint128_t); void foo() { bar(ro); }
Fix test case, which has a control-reaches-end-of-non-void warning that was being masked by previous bug.
// RUN: clang-cc -fsyntax-only -verify %s int test() { void *vp; int *ip; char *cp; struct foo *fp; struct bar *bp; short sint = 7; if (ip < cp) {} // expected-warning {{comparison of distinct pointer types ('int *' and 'char *')}} if (cp < fp) {} // expected-warning {{comparison of distinct pointer t...
// RUN: clang-cc -fsyntax-only -verify %s void test() { void *vp; int *ip; char *cp; struct foo *fp; struct bar *bp; short sint = 7; if (ip < cp) {} // expected-warning {{comparison of distinct pointer types ('int *' and 'char *')}} if (cp < fp) {} // expected-warning {{comparison of distinct pointer ...
Make sure the memory is zero when initialising. This caused failing tests on Windows where mGLResource would already be populated with random stuff.
/* vim: set ts=4 sw=4 tw=79 et :*/ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef gfxShader_h__ #define gfxShader_h__ #include "GL/glew.h" class OpenGLS...
/* vim: set ts=4 sw=4 tw=79 et :*/ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef gfxShader_h__ #define gfxShader_h__ #include "GL/glew.h" class OpenGLS...
Fix test so that it XFAILs consistently.
// RUN: %clang_cc1 %s -m32 -emit-llvm -o - | grep {i32 32} | count 3 // XFAIL: * // XTARGET: powerpc // Every printf has 'i32 0' for the GEP of the string; no point counting those. typedef unsigned int Foo __attribute__((aligned(32))); typedef union{Foo:0;}a; typedef union{int x; Foo:0;}b; extern int printf(const char...
// RUN: %clang_cc1 %s -triple powerpc-pc-linux -emit-llvm -o - | grep {i32 32} | count 3 // XFAIL: * // Every printf has 'i32 0' for the GEP of the string; no point counting those. typedef unsigned int Foo __attribute__((aligned(32))); typedef union{Foo:0;}a; typedef union{int x; Foo:0;}b; extern int printf(const char...
Add missing includes for std::abs.
// // Copyright (c) 2012 Juan Palacios juan.palacios.puyana@gmail.com // This file is part of minimathlibs. // Subject to the BSD 2-Clause License // - see < http://opensource.org/licenses/BSD-2-Clause> // #ifndef MATH_UTILS_H__ #define MATH_UTILS_H__ namespace Math { template <typename T> struct CompareWithTole...
// // Copyright (c) 2012 Juan Palacios juan.palacios.puyana@gmail.com // This file is part of minimathlibs. // Subject to the BSD 2-Clause License // - see < http://opensource.org/licenses/BSD-2-Clause> // #ifndef MATH_UTILS_H_ #define MATH_UTILS_H_ #include <cstdlib> #include <cmath> namespace Math { template <...
Include Linux or FreeBSD symbols depending on OS we are compiling on.
/* Copyright 2019 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 2019 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...
Add either class for trivially constructable types
#ifndef UTIL_EITHER_H #define UTIL_EITHER_H #include <utility> namespace util { template <typename L, typename R> class Either { public: bool left(L& x) { if (isLeft) x = l; return isLeft; } bool right(R& x) { if (!isLeft) x = r; return !isLeft; } private: ...
Update for checkpoint66j and internal consistency
C $Header: /u/gcmpack/MITgcm/pkg/dic/DIC_ATMOS.h,v 1.4 2010/04/11 20:59:27 jmc Exp $ C $Name: $ COMMON /INTERACT_ATMOS_NEEDS/ & co2atmos, & total_atmos_carbon, total_ocean_carbon, & total_atmos_carbon_year, & total_ocean_carbon_year, ...
Add include guard to SkFontConfigInterface.h
/* * Copyright 2009-2015 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ #include "SkFontConfigInterface.h" #include <fontconfig/fontconfig.h> class SkFontConfigInterf...
/* * Copyright 2009-2015 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ #ifndef SKFONTCONFIGINTERFACE_DIRECT_H_ #define SKFONTCONFIGINTERFACE_DIRECT_H_ #include "SkFont...
Add a test for llvm-gcc svn 110632.
// RUN: %llvmgcc %s -S -O0 -o - | FileCheck %s // Radar 8288710: A small aggregate can be passed as an integer. Make sure // we don't get an error with "input constraint with a matching output // constraint of incompatible type!" struct wrapper { int i; }; // CHECK: xyz int test(int i) { struct wrapper w; w.i...
Fix typo in macro for tls access model
/* * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #ifndef _BITS_UCLIBC_ERRNO_H #define _BITS_UCLIBC_ERRNO_H 1 #ifdef IS_IN_rtld # undef errno # define errno _dl_errno extern int _dl_errno; // attribute_hidden; #elif defin...
/* * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #ifndef _BITS_UCLIBC_ERRNO_H #define _BITS_UCLIBC_ERRNO_H 1 #ifdef IS_IN_rtld # undef errno # define errno _dl_errno extern int _dl_errno; // attribute_hidden; #elif defin...
Fix alloca() redefinition warning on Windows
#if defined __clang__ #pragma clang push #pragma clang diagnostic ignored "-Wignored-attributes" #elif defined __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wattributes" #endif #include <amx/amx.h> #include <amx/amxaux.h> #include <amx/amxdbg.h> #if defined __clang_ #pragma clang pop #eli...
#if defined __clang__ #pragma clang push #pragma clang diagnostic ignored "-Wignored-attributes" #elif defined __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wattributes" #endif #ifdef _WIN32 #include <malloc.h> #endif #include <amx/amx.h> #include <amx/amxaux.h> #include <amx/amxdbg.h> #...
Add solution to Exercise 2-5.
/* * A solution to Exercise 2-5 in The C Programming Language (Second Edition). * * This file was written by Damien Dart, <damiendart@pobox.com>. This is free * and unencumbered software released into the public domain. For more * information, please refer to the accompanying "UNLICENCE" file. */ #include <stdin...
Update GPUImageFillModeType enum to use NS_ENUM
#import <UIKit/UIKit.h> #import "GPUImageContext.h" typedef enum { kGPUImageFillModeStretch, // Stretch to fill the full view, which may distort the image outside of its normal aspect ratio kGPUImageFillModePreserveAspectRatio, // Maintains the aspect ratio of the source image, ...
#import <UIKit/UIKit.h> #import "GPUImageContext.h" typedef NS_ENUM(NSUInteger, GPUImageFillModeType) { kGPUImageFillModeStretch, // Stretch to fill the full view, which may distort the image outside of its normal aspect ratio kGPUImageFillModePreserveAspectRatio, // Maintains t...
Include basictypes.h for DISALLOW macro.
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_AURA_EVENT_FILTER_H_ #define UI_AURA_EVENT_FILTER_H_ #pragma once #include "base/logging.h" #include "ui/gfx/point.h" namespace aura { c...
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_AURA_EVENT_FILTER_H_ #define UI_AURA_EVENT_FILTER_H_ #pragma once #include "base/basictypes.h" namespace aura { class Window; class Mous...
Set up basic processing framework
/*************************************************************************************** * MAIN.C * * Description: Converts raw ADC reads given via character device to time of flight * * (C) 2016 Visaoni * Licensed under the MIT License. ***************************************************************************...
/*************************************************************************************** * MAIN.C * * Description: Converts raw ADC reads given via character device to time of flight * * (C) 2016 Visaoni * Licensed under the MIT License. ***************************************************************************...
Add rows and cols assignment.
//----------------------------------------------------------------------------- // Assignments //----------------------------------------------------------------------------- template<class T> matrix<T>& matrix<T>::operator=( std::initializer_list<std::initializer_list<T>> init_list){ data_ = make_vector(init_li...
//----------------------------------------------------------------------------- // Assignments //----------------------------------------------------------------------------- template<class T> matrix<T>& matrix<T>::operator=( std::initializer_list<std::initializer_list<T>> init_list){ data_ = make_vector(init_li...
Add command to reboot help system
#include <kotaka/paths.h> #include <game/paths.h> inherit LIB_BIN; void main(string args) { object user; user = query_user(); if (user->query_class() < 3) { send_out("You do not have sufficient access rights to reboot the help system.\n"); return; } "~Help/initd"->full_reset(); }
Remove warning and only include needed stuff.
/* EINA - EFL data type library * Copyright (C) 2008 Cedric Bail * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later...
/* EINA - EFL data type library * Copyright (C) 2008 Cedric Bail * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later...
Add Linked List implementation of stack
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> /* This is Stack Implementation using a Linked list */ #define MAXSIZE 101 #define BOOL_PRINT(bool_expr) "%s\n", (bool_expr) ? "true" : "false" typedef struct node{ int data; struct node* link; } node; node* head; //global variable node* create_newnode(in...
Implement the hyperbolic sine function.
#include <pal.h> /** * * Calculates the hyperbolic sine of the vector 'a'. Angles are specified * in radians. * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vector. * * @return None * */ #include <math.h> void p_sinh_f32(const f...
#include <pal.h> /* * sinh z = (exp z - exp(-z)) / 2 */ static inline float _p_sinh(const float z) { float exp_z; p_exp_f32(&z, &exp_z, 1); return 0.5f * (exp_z - 1.f / exp_z); } /** * * Calculates the hyperbolic sine of the vector 'a'. Angles are specified * in radians. * * @param a Pointer to...
Add internal MD size getter
/** * Internal MD/hash functions - no crypto, just data. * This is used to avoid depending on MD_C just to query a length. * * Copyright The Mbed TLS Contributors * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in...
Add missing static for inline functions (GCC 5)
/** * Example of a typical library providing a C-interface */ #pragma once #include "ivi-main-loop-c.h" #ifdef __cplusplus extern "C" { #endif static IVIMainLoop_EventSource_ReportStatus callbackMyCLibrary(const void *data) { printf("callbackMyCLibrary\n"); return IVI_MAIN_LOOP_KEEP_ENABLED; } /** * Ini...
/** * Example of a typical library providing a C-interface */ #pragma once #include "ivi-main-loop-c.h" #ifdef __cplusplus extern "C" { #endif static IVIMainLoop_EventSource_ReportStatus callbackMyCLibrary(const void *data) { printf("callbackMyCLibrary\n"); return IVI_MAIN_LOOP_KEEP_ENABLED; } /** * Ini...
Test code for ws-eventing server side
#include <pthread.h> #include <time.h> #include "ws-eventing.h" #include "wsman-debug.h" static char g_event_source_url[] = "http://www.otc_event.com/event_source"; static EventingH g_event_handler; static void *publish_events(void *soap_handler); void start_event_source(SoapH soap) { pthread_t publiser_thread...
Add black drop-shadow outline to text
#pragma once #include "Sprite.h" #include "FontAsset.h" class Text : public Sprite { private: std::shared_ptr<FontAsset> asset; std::string str; public: Text(std::shared_ptr<FontAsset> asset, const std::string str, const Point2 pos = Point2(0), const Origin origin = Origin::BottomLeft, const Point4 color = Point...
#pragma once #include "Sprite.h" #include "FontAsset.h" class Text : public Sprite { private: std::shared_ptr<FontAsset> asset; std::string str; public: Text(std::shared_ptr<FontAsset> asset, const std::string str, const Point2 pos = Point2(0), const Origin origin = Origin::BottomLeft, const Point4 color = Point...
Add basic memory and io map.
/* 18 bits => 0x00000 - 0x3FFFF => 256kb */ #define ADDR_W 18 #define ZWC_CS_W 4 #define ZWC_WB_ADR_W ADDR_W - ZMC_CS_W - 3 #define ZWC_CS_SIZE ( (1<<ZWC_WB_ADR_W)-1 ) /* * 0x00000 - 0x1FFFF: RAM * 0x20000 - 0x2FFFF: phiIO * 0x30000 - 0x3FFFF: zwishbone * * */ #define IO_MASK (1<<(ADDR_W-1)) #define ...
Make the compare const void.
#ifndef lcthw_List_algos_h #define lcthw_List_algos_h #include <lcthw/list.h> typedef int (*List_compare)(void *a, void *b); int List_bubble_sort(List *list, List_compare cmp); List *List_merge_sort(List *list, List_compare cmp); #endif
#ifndef lcthw_List_algos_h #define lcthw_List_algos_h #include <lcthw/list.h> typedef int (*List_compare)(const void *a, const void *b); int List_bubble_sort(List *list, List_compare cmp); List *List_merge_sort(List *list, List_compare cmp); #endif
Make 'svn mergeinfo' and its underlying APIs error out when talking to a pre-1.5 repository.
/* * util.c: Repository access utility routines. * * ==================================================================== * Copyright (c) 2007 CollabNet. All rights reserved. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The term...
Add a definition for FD_SETSIZE.
/* * Copyright (C) 2014, Galois, Inc. * This sotware is distributed under a standard, three-clause BSD license. * Please see the file LICENSE, distributed with this software, for specific * terms and conditions. */ #ifndef MINLIBC_SYS_SELECT_H #define MINLIBC_SYS_SELECT_H #include <time.h> typedef struct {} fd_...
/* * Copyright (C) 2014, Galois, Inc. * This sotware is distributed under a standard, three-clause BSD license. * Please see the file LICENSE, distributed with this software, for specific * terms and conditions. */ #ifndef MINLIBC_SYS_SELECT_H #define MINLIBC_SYS_SELECT_H #include <time.h> typedef struct {} fd_...
Fix warning re: signed shift
#ifndef KERNEL_PORT_BITWHACK_H #define KERNEL_PORT_BITWHACK_H /* Helpers for bitwhacking. */ /** * Macros for constructing bit masks. * * When bitwise-anded with another value: * * MASK_LO(n) masks out the lowest n bits. * MASK_HI(n) masks out all but the lowest n bits. * MASK_RANGE(lo, hi) masks out all of th...
#ifndef KERNEL_PORT_BITWHACK_H #define KERNEL_PORT_BITWHACK_H /* Helpers for bitwhacking. */ /** * Macros for constructing bit masks. * * When bitwise-anded with another value: * * MASK_LO(n) masks out the lowest n bits. * MASK_HI(n) masks out all but the lowest n bits. * MASK_RANGE(lo, hi) masks out all of th...
Add a test for fmpz_vec_scalar_divexact_fmpz
/*============================================================================= This file is part of FLINT. FLINT is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, ...
Increment version number from 1.32 to 1.40
#pragma once // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. const float kCurrentVersion = 1.32f;
#pragma once // const float in a header file can lead to duplication of the storage // but I don't really care in this case. Just don't do it with a header // that is included hundreds of times. const float kCurrentVersion = 1.40f;
Add another autoload key for TDataFrameImpl'
/************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing...
/************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing...
Fix writing to wrong register
/* * Copyright (c) 2012-2016 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <mrkotfw@gmail.com> */ #include <vdp2/scrn.h> #include <assert.h> #include "vdp2-internal.h" void vdp2_scrn_reduction_set(uint8_t scrn, uint16_t horz_reduction) { #ifdef DEBUG /* Check if the background passed is ...
/* * Copyright (c) 2012-2016 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <mrkotfw@gmail.com> */ #include <vdp2/scrn.h> #include <assert.h> #include "vdp2-internal.h" void vdp2_scrn_reduction_set(uint8_t scrn, uint16_t horz_reduction) { #ifdef DEBUG /* Check if the background passed is ...
Move sample policy logic to be pre-sending request
/* * Copyright (c) 2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #pragma once...
FIX cleaned up header file to resemble FSM environment
#ifndef SSPAPPLICATION_AI_LEVELDIRECTOR_H #define SSPAPPLICATION_AI_LEVELDIRECTOR_H #include "Observer.h" #include <vector> class LevelDirector { private: // Variables /* TEMP STATE STRUCTURE */ static enum State { NONE = 0, START, DEFAULT, GOAL }; State m_currentState; State m_defaultState; //State m_go...
#ifndef SSPAPPLICATION_AI_LEVELDIRECTOR_H #define SSPAPPLICATION_AI_LEVELDIRECTOR_H #include "Observer.h" #include <vector> //#define NUMSTATES 3 namespace FSMEnvironment { #pragma region temp enum Hint { NONE = 0, EXAMPLE }; struct State { int stateID = -1; int timeDelay = -1; Hint hint = Hint::NONE; ...
Mark venprintf() as static explicitly, not just in the decl
/* See LICENSE file for copyright and license details. */ #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "../util.h" static void venprintf(int, const char *, va_list); void eprintf(const char *fmt, ...) { va_list ap; va_start(ap, fmt); venprintf(EXIT_FAILURE, fmt, ap); ...
/* See LICENSE file for copyright and license details. */ #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "../util.h" static void venprintf(int, const char *, va_list); void eprintf(const char *fmt, ...) { va_list ap; va_start(ap, fmt); venprintf(EXIT_FAILURE, fmt, ap); v...
Check system is big endian or little endian function added
#ifdef OS_WINDOWS #endif #ifdef LINUX #define SWAP(valX,valY) \ { \ typeof (valX) valZ; \ valZ = valX; \ valX = valY; ...
#ifdef OS_WINDOWS #endif #ifdef LINUX #define SWAP(valX,valY) \ { \ typeof (valX) valZ; \ valZ = valX; \ valX = valY; ...
Add new constant for button
// // Constants.h // Pods // // Created by Danil Tulin on 1/30/16. // // @import Foundation; #ifndef Constants_h #define Constants_h const static NSString *defaultPrimaryColor = @"1A1A1C"; const static NSString *darkPrimaryColor = @"121315"; const static NSInteger bottomToolbarHeight = 50; const static CGFloat ...
// // Constants.h // Pods // // Created by Danil Tulin on 1/30/16. // // @import Foundation; #ifndef Constants_h #define Constants_h const static NSString *defaultPrimaryColor = @"1A1A1C"; const static NSString *darkPrimaryColor = @"121315"; const static NSInteger bottomToolbarHeight = 50; const static CGFloat ...
Change 'if' style for null _callback check
// Copyright 2010-2015 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 "include\cef_callback.h" namespace CefSharp { public ref class CefCallbackWrapper : public ICallbac...
// Copyright 2010-2015 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 "include\cef_callback.h" namespace CefSharp { public ref class CefCallbackWrapper : public ICallbac...
Include platform.h instead of ifdef'ing
/* * Copyright 2013 Couchbase, Inc. * * 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...
/* * Copyright 2013 Couchbase, Inc. * * 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...
Fix hppa ldcw alignment issue.
/* $OpenBSD: spinlock.h,v 1.1 1999/01/08 08:25:34 d Exp $ */ #ifndef _MACHINE_SPINLOCK_H_ #define _MACHINE_SPINLOCK_H_ #define _SPINLOCK_UNLOCKED (1) #define _SPINLOCK_LOCKED (0) typedef int _spinlock_lock_t; #endif
/* $OpenBSD: spinlock.h,v 1.2 2005/12/19 21:30:10 marco Exp $ */ #ifndef _MACHINE_SPINLOCK_H_ #define _MACHINE_SPINLOCK_H_ #define _SPINLOCK_UNLOCKED (1) #define _SPINLOCK_LOCKED (0) typedef int _spinlock_lock_t __attribute__((__aligned__(16))); #endif
Synchronize the mailbox after expunging messages to actually get them expunged.
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */ #include "common.h" #include "commands.h" #include "imap-expunge.h" bool cmd_close(struct client_command_context *cmd) { struct client *client = cmd->client; struct mailbox *mailbox = client->mailbox; struct mail_storage *storage; if (!...
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */ #include "common.h" #include "commands.h" #include "imap-expunge.h" bool cmd_close(struct client_command_context *cmd) { struct client *client = cmd->client; struct mailbox *mailbox = client->mailbox; struct mail_storage *storage; if (!...
Add new header file. (or: xcode is stupid)
// // BDSKOAIGroupServer.h // Bibdesk // // Created by Christiaan Hofman on 1/1/07. // Copyright 2007 __MyCompanyName__. All rights reserved. // #import <Cocoa/Cocoa.h> #import "BDSKSearchGroup.h" @class BDSKServerInfo; @interface BDSKOAIGroupServer : NSObject <BDSKSearchGroupServer> { BDSKSearchGroup *group...
Make this test portable on Win32.
// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.global.annotations // RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.var.annotation | count 3 #include <stdio.h> /* Global variable with attribute */ int X __attribute__((annotate("GlobalValAnnotation"))); /* Function with attribute */ int foo(int y) __attribute__((a...
// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.global.annotations // RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.var.annotation | count 3 /* Global variable with attribute */ int X __attribute__((annotate("GlobalValAnnotation"))); /* Function with attribute */ int foo(int y) __attribute__((annotate("GlobalValAn...
Increase PSTR2 buffer (fix broken calibration)
#ifndef PSTR_HELPER_H #define PSTR_HELPER_H #include <avr/pgmspace.h> // Modified PSTR that pushes string into a char* buffer for easy use. // // There is only one buffer so this will cause problems if you need to pass two // strings to one function. #define PSTR2(x) PSTRtoBuffer_P(PSTR(x)) #define PSTR2_BU...
#ifndef PSTR_HELPER_H #define PSTR_HELPER_H #include <avr/pgmspace.h> // Modified PSTR that pushes string into a char* buffer for easy use. // // There is only one buffer so this will cause problems if you need to pass two // strings to one function. #define PSTR2(x) PSTRtoBuffer_P(PSTR(x)) #define PSTR2_BU...
Include "libunwind_i.h" instead of "internal.h".
/* * Copyright (C) 1998, 1999, 2002, 2003, 2005 Hewlett-Packard Co * David Mosberger-Tang <davidm@hpl.hp.com> * * Register stack engine related helper functions. This file may be * used in applications, so be careful about the name-space and give * some consideration to non-GNU C compilers (though __inline__ is ...
Add missed file in previous revision.
#ifndef THREAD_POSIX_H #define THREAD_POSIX_H struct ThreadState { pthread_t td_; static void start(pthread_key_t key, Thread *td) { pthread_t self = pthread_self(); td->state_->td_ = self; int rv = pthread_setspecific(key, td); if (rv == -1) { ERROR("/thread/state/start") << "Could not set thread-loc...
Include method to return pointer to object gameStateMachine
#ifndef __GAME__ #define __GAME__ #include<vector> #include<SDL2/SDL.h> #include"GameObject.h" #include"GameStateMachine.h" class Game { public: static Game *getInstance() { if (!instance) { instance = new Game(); } return instance; } ...
#ifndef __GAME__ #define __GAME__ #include<vector> #include<SDL2/SDL.h> #include"GameObject.h" #include"GameStateMachine.h" class Game { public: static Game *getInstance() { if (!instance) { instance = new Game(); } return instance; } ...
Revert D5012627: [FBCode] Switch various calls to folly::setThreadName to set the current thread's name
/* * Copyright (c) 2017, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #pragma onc...
/* * Copyright (c) 2017, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #pragma onc...
Remove import `UIKit` from header file
// // ImageLoader.h // ImageLoader // // Created by Hirohisa Kawasaki on 10/16/14. // Copyright (c) 2014 Hirohisa Kawasaki. All rights reserved. // #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> FOUNDATION_EXPORT double ImageLoaderVersionNumber; FOUNDATION_EXPORT const unsigned char ImageLoaderVersionS...
// // ImageLoader.h // ImageLoader // // Created by Hirohisa Kawasaki on 10/16/14. // Copyright (c) 2014 Hirohisa Kawasaki. All rights reserved. // #import <Foundation/Foundation.h> FOUNDATION_EXPORT double ImageLoaderVersionNumber; FOUNDATION_EXPORT const unsigned char ImageLoaderVersionString[];
Add a comment with a 'TODO: add DCHECKS' for class Mutex
// Copyright (c) 2010 Timur Iskhodzhanov. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_MUTEX_H_ #define BASE_MUTEX_H_ #include <pthread.h> #include "base/common.h" namespace threading { class Mutex { public: Mutex(); ~...
// Copyright (c) 2010 Timur Iskhodzhanov. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_MUTEX_H_ #define BASE_MUTEX_H_ #include <pthread.h> #include "base/common.h" namespace threading { // OS-independent wrapper for mutex/c...
Use constant time zero check function
/* * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. * Copyright 2016 Cryptography Research, Inc. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distributio...
/* * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. * Copyright 2016 Cryptography Research, Inc. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distributio...
Include stdlib.h or declare getenv
#include "Python.h" #include "osdefs.h" #ifndef PYTHONPATH #define PYTHONPATH ".:/usr/local/lib/python" #endif /* Return the initial python search path. This is called once from initsys() to initialize sys.path. The environment variable PYTHONPATH is fetched and the default path appended. The default pa...
#include "Python.h" #include "osdefs.h" #ifdef HAVE_STDLIB_H #include <stdlib.h> #else extern char *getenv Py_PROTO((const char *)); #endif #ifndef PYTHONPATH #define PYTHONPATH ".:/usr/local/lib/python" #endif /* Return the initial python search path. This is called once from initsys() to initialize sys.path....
Use forward declarations to speed up compilation
// // Created by david on 2019-03-18. // #pragma once #include <general/eigen_tensor_fwd_decl.h> class class_state_finite; class class_model_finite; class class_edges_finite; class class_tensors_finite; class class_algorithm_status; class class_tic_toc; enum class OptSpace; enum class OptType; enum class OptMode; en...
// // Created by david on 2019-03-18. // #pragma once #include <general/eigen_tensor_fwd_decl.h> class class_state_finite; class class_model_finite; class class_edges_finite; class class_tensors_finite; class class_algorithm_status; class class_tic_toc; namespace eig {class solver;} enum class OptSpace; enum class O...
Remove unneeded declarations and headers.
/* * antifreeze.h * StatusSpec project * * Copyright (c) 2014-2015 Forward Command Post * BSD 2-Clause License * http://opensource.org/licenses/BSD-2-Clause * */ #pragma once #include "cdll_int.h" #include "vgui/VGUI.h" #include "../modules.h" class ConCommand; class ConVar; class IConVar; class KeyV...
/* * antifreeze.h * StatusSpec project * * Copyright (c) 2014-2015 Forward Command Post * BSD 2-Clause License * http://opensource.org/licenses/BSD-2-Clause * */ #pragma once #include "../modules.h" class ConCommand; class ConVar; class IConVar; class AntiFreeze : public Module { public: AntiFreeze(...
Build number increased to 3.
/* Begin CVS Header $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/copasiversion.h,v $ $Revision: 1.3 $ $Name: $ $Author: shoops $ $Date: 2004/02/19 03:28:58 $ End CVS Header */ #ifndef COPASI_VERSION #define COPASI_VERSION #define COPASI_VERSION_MAJOR 4 #define COPASI_VERSION_MINOR 0 #...
/* Begin CVS Header $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/copasiversion.h,v $ $Revision: 1.4 $ $Name: $ $Author: shoops $ $Date: 2004/02/20 18:15:46 $ End CVS Header */ #ifndef COPASI_VERSION #define COPASI_VERSION #define COPASI_VERSION_MAJOR 4 #define COPASI_VERSION_MINOR 0 #...
Check dir have to be done
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* testpath.c :+: :+: :+: ...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* testpath.c :+: :+: :+: ...
Remove irrelevant comments borrowed from loongson.
/* $OpenBSD: param.h,v 1.2 2010/10/11 15:51:06 syuu Exp $ */ /* public domain */ #ifndef _MACHINE_PARAM_H_ #define _MACHINE_PARAM_H_ #define MACHINE "octeon" #define _MACHINE octeon #define MACHINE_ARCH "mips64" #define _MACHINE_ARCH mips64 /* not the canonical endianness */ #define MACHINE_CPU "mips64" #define _MAC...
/* $OpenBSD: param.h,v 1.3 2011/06/25 19:38:47 miod Exp $ */ /* public domain */ #ifndef _MACHINE_PARAM_H_ #define _MACHINE_PARAM_H_ #define MACHINE "octeon" #define _MACHINE octeon #define MACHINE_ARCH "mips64" #define _MACHINE_ARCH mips64 #define MID_MACHINE MID_MIPS64 #define PAGE_SHIFT 14 #include <mips64/par...
Add virtual to methods that get overridden.
/*===- ConfinementForce.h - libSimulation -===================================== * * DEMON * * This file is distributed under the BSD Open Source License. See LICENSE.TXT * for details. * *===-----------------------------------------------------------------------===*/ #ifndef CONFIN...
/*===- ConfinementForce.h - libSimulation -===================================== * * DEMON * * This file is distributed under the BSD Open Source License. See LICENSE.TXT * for details. * *===-----------------------------------------------------------------------===*/ #ifndef CONFIN...
Convert assembler to use getopt for arguments
// // main.c // d16-asm // // Created by Michael Nolan on 6/17/16. // Copyright © 2016 Michael Nolan. All rights reserved. // #include <stdio.h> #include <stdlib.h> #include "parser.h" #include "assembler.h" #include <string.h> #include "instruction.h" extern int yyparse (FILE* output_file); extern FILE* yyin; ex...
// // main.c // d16-asm // // Created by Michael Nolan on 6/17/16. // Copyright © 2016 Michael Nolan. All rights reserved. // #include <stdio.h> #include <stdlib.h> #include "parser.h" #include "assembler.h" #include <string.h> #include "instruction.h" #include <unistd.h> extern int yyparse (FILE* output_file); ex...
Disable SSE41 kernel on 32bit, we don't use intrinsics here anyway. Also disable it for Visual Studio < 2012, broken blendv instruction.
/* * Copyright 2011-2013 Blender Foundation * * 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 ag...
/* * Copyright 2011-2013 Blender Foundation * * 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 ag...
Add solution to Exercise 1-8.
/* Write a program to count blanks, tabs, and newlines. */ #include <stdint.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { uint32_t blank_count, tab_count, newline_count; int16_t character; blank_count = tab_count = newline_count = 0; while ((character = getchar()) != EOF) { s...
Fix bug in add, copy size.
#include "packet_queue.h" #include "error.h" #include "radio.h" #include <stdint.h> #include <stdlib.h> #include <string.h> uint32_t packet_queue_init(packet_queue_t * queue) { queue->head = 0; queue->tail = 0; return SUCCESS; } bool packet_queue_is_empty(packet_queue_t * queue) { return queue->he...
#include "packet_queue.h" #include "error.h" #include "radio.h" #include <stdint.h> #include <stdlib.h> #include <string.h> uint32_t packet_queue_init(packet_queue_t * queue) { queue->head = 0; queue->tail = 0; return SUCCESS; } bool packet_queue_is_empty(packet_queue_t * queue) { return queue->he...
Add ignored example from traces paper
// PARAM: --enable ana.int.interval --sets exp.solver.td3.side_widen cycle_self #include <pthread.h> #include <assert.h> int g = 6; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int x = 1; pthread_mutex_lock(&A); assert(g == 6); assert(x...
Clarify what types are used where
typedef enum json_type { JSON_HASH, JSON_ARRAY, JSON_NUMBER, JSON_STRING, JSON_TRUE, JSON_FALSE, JSON_NULL, JSON_COMMA, JSON_COLON, JSON_ITEM, JSON_KEY, JSON_VALUE, } json_type; typedef struct json_object { json_type type; struct json_object *parent; char *string; double number; struct json_object **array; s...
typedef enum json_type { // These types can be returned by json_parse() JSON_HASH, JSON_ARRAY, JSON_NUMBER, JSON_STRING, JSON_TRUE, JSON_FALSE, JSON_NULL, // These and JSON_HASH and JSON_ARRAY can be called back by json_parse_with_separators() JSON_COMMA, JSON_COLON, // These are only used internally as expectat...
Remove unnecessary state variable adr_ prefixes
#ifndef __ADR_MAIN_H__ #define __ADR_MAIN_H__ // Libraries // #include "craftable.h" #include "resource.h" #include "villager.h" #include "location.h" // Forward Declarations // struct adr_state { enum LOCATION adr_loc; enum FIRE_STATE adr_fire; enum ROOM_TEMP adr_temp; unsigned int adr_rs [ALIEN_ALLO...
#ifndef __ADR_MAIN_H__ #define __ADR_MAIN_H__ // Libraries // #include "craftable.h" #include "resource.h" #include "villager.h" #include "location.h" // Forward Declarations // struct adr_state { enum LOCATION loc; enum FIRE_STATE fire; enum ROOM_TEMP temp; unsigned int rs [ALIEN_ALLOY + 1]; unsi...
Make frontend floating-point commutivity test X86 specific to avoid cost-model related problems on arm-thumb and hexagon.
// RUN: %clang -O1 -fvectorize -Rpass-analysis=loop-vectorize -emit-llvm -S %s -o - 2>&1 | FileCheck %s // CHECK: {{.*}}:9:11: remark: loop not vectorized: vectorization requires changes in the order of operations, however IEEE 754 floating-point operations are not commutative; allow commutativity by specifying '#prag...
// RUN: %clang -O1 -fvectorize -target x86_64-unknown-unknown -Rpass-analysis=loop-vectorize -emit-llvm -S %s -o - 2>&1 | FileCheck %s // CHECK: {{.*}}:9:11: remark: loop not vectorized: vectorization requires changes in the order of operations, however IEEE 754 floating-point operations are not commutative; allow com...
Add printf __attribute__ to log function.
// Copyright 2015 Ben Trask // MIT licensed (see LICENSE for details) #include <stdarg.h> char *vaasprintf(char const *const fmt, va_list ap); char *aasprintf(char const *const fmt, ...) __attribute__((format(printf, 1, 2))); int time_iso8601(char *const out, size_t const max); void valogf(char const *const fmt, va...
// Copyright 2015 Ben Trask // MIT licensed (see LICENSE for details) #include <stdarg.h> char *vaasprintf(char const *const fmt, va_list ap); char *aasprintf(char const *const fmt, ...) __attribute__((format(printf, 1, 2))); int time_iso8601(char *const out, size_t const max); void valogf(char const *const fmt, va...
Add missing autocleanup for GInitiallyUnowned
/* * Copyright © 2015 Canonical 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 of the licence, or (at your option) any later version. * * This librar...
/* * Copyright © 2015 Canonical 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 of the licence, or (at your option) any later version. * * This librar...
Add prototype of non public API of MRI.
#ifndef RUBYSPEC_CAPI_MRI_H #define RUBYSPEC_CAPI_MRI_H /* #undef any HAVE_ defines that MRI does not have. */ #undef HAVE_RB_HASH_LOOKUP #undef HAVE_RB_HASH_SIZE #undef HAVE_RB_OBJ_FROZEN_P #undef HAVE_RB_STR_PTR #undef HAVE_RB_STR_PTR_READONLY #undef HAVE_THREAD_BLOCKING_REGION #ifdef RUBY_VERSION_IS_1_9 #undef ...
#ifndef RUBYSPEC_CAPI_MRI_H #define RUBYSPEC_CAPI_MRI_H /* #undef any HAVE_ defines that MRI does not have. */ #undef HAVE_RB_HASH_LOOKUP #undef HAVE_RB_HASH_SIZE #undef HAVE_RB_OBJ_FROZEN_P #undef HAVE_RB_STR_PTR #undef HAVE_RB_STR_PTR_READONLY #undef HAVE_THREAD_BLOCKING_REGION #ifdef RUBY_VERSION_IS_1_9 #undef ...
Add prototype to read .a files
//===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ----*- C++ -*--=// // // This functionality is implemented by the lib/Bytecode/Reader library. // This library is used to read VM bytecode files from an iostream. // // Note that performance of this library is _crucial_ for performance of the // JIT type app...
//===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ----*- C++ -*--=// // // This functionality is implemented by the lib/Bytecode/Reader library. // This library is used to read VM bytecode files from an iostream. // // Note that performance of this library is _crucial_ for performance of the // JIT type app...
Mark init as being unavailable.
// // SWXSLTransform.h // This file is part of the "SWXMLMapping" project, and is distributed under the MIT License. // // Created by Samuel Williams on 23/02/12. // Copyright (c) 2012 Samuel Williams. All rights reserved. // #import <Foundation/Foundation.h> @interface SWXSLTransform : NSObject { NSURL * _baseU...
// // SWXSLTransform.h // This file is part of the "SWXMLMapping" project, and is distributed under the MIT License. // // Created by Samuel Williams on 23/02/12. // Copyright (c) 2012 Samuel Williams. All rights reserved. // #import <Foundation/Foundation.h> @interface SWXSLTransform : NSObject { NSURL * _baseU...
Enable to treat with std::cout and std::cin
/*! * @brief Template C++-header file * * This is a template C++-header file * @author <+AUTHOR+> * @date <+DATE+> * @file <+FILE+> * @version 0.1 */ #ifndef <+FILE_CAPITAL+>_H #define <+FILE_CAPITAL+>_H /*! * @brief Template class */ class <+FILEBASE+> { private: public: <+FILEBASE+>() { <+CUR...
/*! * @brief Template C++-header file * * This is a template C++-header file * @author <+AUTHOR+> * @date <+DATE+> * @file <+FILE+> * @version 0.1 */ #ifndef <+FILE_CAPITAL+>_H #define <+FILE_CAPITAL+>_H #include <iostream> /*! * @brief Template class */ class <+FILE_PASCAL+> { private: public: <+...
Use snprintf() instead of sprintf()
/* * Copyright (c) 2012-2016 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <mrkotfw@gmail.com> */ #include <stdbool.h> #include <stdio.h> #include <stdint.h> #include "stack.h" char * stack_backtrace(void) { extern void *_text_start; extern void *_text_end; static char bu...
/* * Copyright (c) 2012-2016 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <mrkotfw@gmail.com> */ #include <stdbool.h> #include <stdio.h> #include <stdint.h> #include "stack.h" char * stack_backtrace(void) { extern void *_text_start; extern void *_text_end; static char bu...
Set MIDPOINT to 90 instead of 128 (servo lib goes from 0 to 180)
#ifndef __MOTORS_H_ #define __MOTORS_H_ #include <Servo.h> #define MIDPOINT 128 class Motors { private: Servo port, vertical, starbord; int port_pin, vertical_pin, starbord_pin; public: Motors(int p_pin, int v_pin, int s_pin); void reset(); void go(int p, int v, int s); void stop(...
#ifndef __MOTORS_H_ #define __MOTORS_H_ #include <Servo.h> #define MIDPOINT 90 class Motors { private: Servo port, vertical, starbord; int port_pin, vertical_pin, starbord_pin; public: Motors(int p_pin, int v_pin, int s_pin); void reset(); void go(int p, int v, int s); void stop()...
Make it even simpler for a script to replace.
#ifndef ROOT_ROOTCoreTeam #define ROOT_ROOTCoreTeam namespace ROOT { namespace ROOTX { //This string will be updated by external script, reading names from http://root.cern.ch/gitstats/authors.html. //The string has an internal linkage (it has a definition here, not in rootxx.cxx or rootx-cocoa.mm files. //So this he...
#ifndef ROOT_ROOTCoreTeam #define ROOT_ROOTCoreTeam namespace ROOT { namespace ROOTX { //This string will be updated by external script, reading names from http://root.cern.ch/gitstats/authors.html. //The names are sorted in alphabetical order. //The string has an internal linkage (it has a definition here, not in ro...
Add test for string pointer analysis
#include <assert.h> #include <stdlib.h> int main(){ char* str = "Hello"; char* str2 = "Hello"; char* str3 = "hi"; char* str4 = "other string"; // Unknown since the there may be multiple copies of the same string __goblint_check(str != str2); // UNKNOWN! __goblint_check(str == str); __...
Add proper return code to test software.
#include <stdio.h> int main() { printf("Hello, world!\n"); }
#include <stdio.h> int main() { printf("Hello, world!\n"); return 0; }
Add licenses to empty files. Change: 137204888
/* Copyright 2016 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...
Remove silly struct that's silly
#ifndef CALC_SCANNER_DEF_H_ #define CALC_SCANNER_DEF_H_ typedef union { int int_value; } YYSTYPE; typedef struct { int function; int result; YYSTYPE lhs; YYSTYPE rhs; } BinaryFunction; class ParserState { public: int result; int eval; ParserState() : result(0) { } }; #endif // CALC_SCANNER_D...
#ifndef CALC_SCANNER_DEF_H_ #define CALC_SCANNER_DEF_H_ typedef union { int int_value; } YYSTYPE; class ParserState { public: int result; int eval; ParserState() : result(0) { } }; #endif // CALC_SCANNER_DEF_H_
Add ability to extract a single basic block into a new function.
//===-- Transform/Utils/FunctionUtils.h - Function Utils --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===--------...
//===-- Transform/Utils/FunctionUtils.h - Function Utils --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===--------...
Fix rwsem constant bug leading to hangs.
/* rwsem-const.h: RW semaphore counter constants. */ #ifndef _SPARC64_RWSEM_CONST_H #define _SPARC64_RWSEM_CONST_H #define RWSEM_UNLOCKED_VALUE 0x00000000 #define RWSEM_ACTIVE_BIAS 0x00000001 #define RWSEM_ACTIVE_MASK 0x0000ffff #define RWSEM_WAITING_BIAS 0xffff0000 #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BI...
/* rwsem-const.h: RW semaphore counter constants. */ #ifndef _SPARC64_RWSEM_CONST_H #define _SPARC64_RWSEM_CONST_H #define RWSEM_UNLOCKED_VALUE 0x00000000 #define RWSEM_ACTIVE_BIAS 0x00000001 #define RWSEM_ACTIVE_MASK 0x0000ffff #define RWSEM_WAITING_BIAS (-0x00010000) #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE...
Add initial support for register and register class representation. Obviously this is not done.
//===- CodeGenRegisters.h - Register and RegisterClass Info -----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===--------...
Add third_party/ prefix to ppapi include for checkdeps.
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #include "ppapi/c/pp_var.h" #define PPB_PRIVATE_INTERFACE "PPB...
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #include "third_party/ppapi/c/pp_var.h" #define PPB_PRIVATE_IN...
Fix for downstream android webview
// 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 SANDBOX_LINUX_SERVICES_ANDROID_ARM_UCONTEXT_H_ #define SANDBOX_LINUX_SERVICES_ANDROID_ARM_UCONTEXT_H_ typedef long int greg_t; typedef unsigne...
// 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 SANDBOX_LINUX_SERVICES_ANDROID_ARM_UCONTEXT_H_ #define SANDBOX_LINUX_SERVICES_ANDROID_ARM_UCONTEXT_H_ #include <asm/sigcontext.h> typedef lo...
Document that meta doesn't work.
/* Narcissus * © 2015 David Given * This file is redistributable under the terms of the two-clause BSD license; * see COPYING in the distribution root for the full text. */ #ifndef DEVICES_H #define DEVICES_H #include <X11/Xlib.h> struct button { int keycode; uint32_t button; }; struct chord { uint32_t butto...
/* Narcissus * © 2015 David Given * This file is redistributable under the terms of the two-clause BSD license; * see COPYING in the distribution root for the full text. */ #ifndef DEVICES_H #define DEVICES_H #include <X11/Xlib.h> struct button { int keycode; uint32_t button; }; struct chord { uint32_t butto...
Add generic definitions for LEDs and switches
/* * Copyright (c) 2016, Texas Instruments Incorporated * * 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 appl...
/* * Copyright (c) 2016, Texas Instruments Incorporated * * 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 appl...
Add a thread-safe socket class.
// -*- mode: c++ -*- #ifndef _GET_DATA_CHUNK_SERVER_SOCKET_H_ #define _GET_DATA_CHUNK_SERVER_SOCKET_H_ #include <boost/shared_ptr.hpp> #include <boost/asio.hpp> class Socket { typedef boost::shared_ptr<boost::asio::ip::tcp::socket> SocketImplPtr; public: Socket(SocketImplPtr socket); virtual ~Socket(); ...
Fix typo in method signature
#include <stdio.h> /* Interface to JPEG code */ #include "jpeglib.h" #include <setjmp.h> struct error_mgr2 { struct jpeg_error_mgr pub; /* "public" fields */ jmp_buf setjmp_buffer; /* for return to caller */ }; typedef struct error_mgr2* error_ptr2; void error_exit (j_common_ptr cinfo); GLOBAL(void) jpeg_mem_sr...
#include <stdio.h> /* Interface to JPEG code */ #include "jpeglib.h" #include <setjmp.h> struct error_mgr2 { struct jpeg_error_mgr pub; /* "public" fields */ jmp_buf setjmp_buffer; /* for return to caller */ }; typedef struct error_mgr2* error_ptr2; void error_exit (j_common_ptr cinfo); GLOBAL(void) jpeg_mem_sr...
Add test for nested expansion in macros
/* name: TEST028 description: Test of reinterpretation in define output: F5 G6 F5 foo { \ r "6869 'P } */ #define M(x) x #define A(a,b) a(b) char * foo(void) { return A(M,"hi"); }
Fix random algo to evenly distribute.
#include <stdio.h> #include <stdint.h> #include "rand.h" static uint64_t sqrt64(uint64_t n) { uint64_t g = UINT64_C(1) << 31; for (uint64_t c = g; c; g |= c) { if (g * g > n) { g ^= c; } c >>= 1; } return g; } static uint64_t get_split(uint64_t len) { uint64_t rnd; rand_fill(&rnd, sizeof(rnd)...
#include <stdio.h> #include <stdint.h> #include "rand.h" static uint64_t get_split(uint64_t total_len, uint64_t remaining_len) { uint64_t rnd; rand_fill(&rnd, sizeof(rnd)); rnd %= total_len; return rnd > remaining_len ? remaining_len : rnd; } int main(int __attribute__ ((unused)) argc, char __attribute__ ((unuse...
Add basic test for integer constant folding
/* name: TEST019 description: Basic test of constant folding in integer arithmetic operations output: test019.c:13: warning: division by 0 test019.c:14: warning: division by 0 F1 G1 F1 main { - A2 I i A2 #I3 :I A2 #I1 :I A2 #I12 :I A2 #I2 :I A2 #I0 :I A2 A2 #I0 %I :I A2 A2 #I0 %I :I A2 #I8 :I A2 #I2 :I A2 #I...
Add test for preprocessor corner cases
/* name: TEST044 description: Test of corner cases in #if output: test044.c:14: warning: division by 0 test044.c:18: warning: division by 0 test044.c:22: warning: division by 0 test044.c:28: error: parameter of #if is not an integer constant expression test044.c:29: error: #error 3 != (1,2,3) */ /* These should be ac...
Fix macro replacement: removal of conflict with __name_pool
/** * @file * @brief Internal implementation of static slab allocator * * @date 07.03.2011 * @author Kirill Tyushev */ #ifndef SLAB_STATIC_H_ # error "Do not include this file directly, use <kernel/mm/slab_static.h> instead!" #endif /* SLAB_STATIC_H_ */ #include <util/binalign.h> /** cache descriptor */ struct...
/** * @file * @brief Internal implementation of static slab allocator * * @date 07.03.2011 * @author Kirill Tyushev */ #ifndef SLAB_STATIC_H_ # error "Do not include this file directly, use <kernel/mm/slab_static.h> instead!" #endif /* SLAB_STATIC_H_ */ #include <util/binalign.h> /** cache descriptor */ struct...
Fix doxygen comments for new header.
#ifndef _ECORE_STR_H # define _ECORE_STR_H #ifdef EAPI #undef EAPI #endif #ifdef WIN32 # ifdef BUILDING_DLL # define EAPI __declspec(dllexport) # else # define EAPI __declspec(dllimport) # endif #else # ifdef __GNUC__ # if __GNUC__ >= 4 # define EAPI __attribute__ ((visibility("default"))) # else # define EAPI...
#ifndef _ECORE_STR_H # define _ECORE_STR_H #ifdef EAPI #undef EAPI #endif #ifdef WIN32 # ifdef BUILDING_DLL # define EAPI __declspec(dllexport) # else # define EAPI __declspec(dllimport) # endif #else # ifdef __GNUC__ # if __GNUC__ >= 4 # define EAPI __attribute__ ((visibility("default"))) # else # define EAPI...
Remove unused variable (int i)
#include <stdlib.h> #include <string.h> #include "chip8.h" chip8_t * chip8_new(void) { int i; chip8_t * self = (chip8_t *) malloc(sizeof(chip8_t)); // The first 512 bytes are used by the interpreter. self->program_counter = 0x200; self->index_register = 0; self->stack_pointer = 0; self->opcode ...
#include <stdlib.h> #include <string.h> #include "chip8.h" chip8_t * chip8_new(void) { chip8_t * self = (chip8_t *) malloc(sizeof(chip8_t)); // The first 512 bytes are used by the interpreter. self->program_counter = 0x200; self->index_register = 0; self->stack_pointer = 0; self->opcode = 0; ...