Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Fix the Vale build onx 64 Linux by definining empty calling convention keywords
#ifndef __GCC_COMPAT_H #define __GCC_COMPAT_H #ifdef __GNUC__ // gcc does not support the __cdecl, __stdcall or __fastcall notation // except on Windows #ifndef _WIN32 #define __cdecl __attribute__((cdecl)) #define __stdcall __attribute__((stdcall)) #define __fastcall __attribute__((fastcall)) #endif // ! _WIN32 #endi...
#ifndef __GCC_COMPAT_H #define __GCC_COMPAT_H #ifdef __GNUC__ // gcc does not support the __cdecl, __stdcall or __fastcall notation // except on Windows #ifdef _WIN32 #define __cdecl __attribute__((cdecl)) #define __stdcall __attribute__((stdcall)) #define __fastcall __attribute__((fastcall)) #else #define __cdecl #de...
Add SVC function IDs for Management Mode.
/** @file * * Copyright (c) 2012-2017, ARM Limited. All rights reserved. * * This program and the accompanying materials * are licensed and made available under the terms and conditions of the BSD License * which accompanies this distribution. The full text of the license may be found at * http://opensourc...
Modify old-style derived GFE_BUG macros to have IDs.
// Copyright (c) 2019 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 QUICHE_SPDY_PLATFORM_API_SPDY_BUG_TRACKER_H_ #define QUICHE_SPDY_PLATFORM_API_SPDY_BUG_TRACKER_H_ #include "net/spdy/platform/impl/spdy_bug_t...
// Copyright (c) 2019 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 QUICHE_SPDY_PLATFORM_API_SPDY_BUG_TRACKER_H_ #define QUICHE_SPDY_PLATFORM_API_SPDY_BUG_TRACKER_H_ #include "net/spdy/platform/impl/spdy_bug_t...
Update 1012 (Fix a typo)
/* https://www.urionlinejudge.com.br/judge/en/problems/view/1012 */ #include <stdio.h> int main(){ const double PI = 3.14159; double a, b, c; scanf("%lf %lf %lf", &a, &b, &c); /* the area of the rectangled triangle that has base A and height C A = (base * height) / 2 */ printf("TRIANGU...
/* https://www.urionlinejudge.com.br/judge/en/problems/view/1012 */ #include <stdio.h> int main(){ const double PI = 3.14159; double a, b, c; scanf("%lf %lf %lf", &a, &b, &c); /* the area of the rectangled triangle that has base A and height C A = (base * height) / 2 */ printf("TRIANGU...
Add source code documentation for the RocksDB Plain Table Options class
// // RocksDBPlainTableOptions.h // ObjectiveRocks // // Created by Iska on 04/01/15. // Copyright (c) 2015 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> typedef NS_ENUM(char, PlainTableEncodingType) { PlainTableEncodingPlain, PlainTableEncodingPrefix }; @interface RocksDBPlainTableOpt...
// // RocksDBPlainTableOptions.h // ObjectiveRocks // // Created by Iska on 04/01/15. // Copyright (c) 2015 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> typedef NS_ENUM(char, PlainTableEncodingType) { PlainTableEncodingPlain, PlainTableEncodingPrefix }; @interface RocksDBPlainTableOpt...
Add -fsyntax-only to fix failure in read-only directories.
// REQUIRES: x86-registered-target // RUN: %clang -target i386-pc-elfiamcu -c -v %s 2>&1 | FileCheck %s // CHECK-NOT: /usr/include // CHECK-NOT: /usr/local/include
// REQUIRES: x86-registered-target // RUN: %clang -target i386-pc-elfiamcu -c -v -fsyntax-only %s 2>&1 | FileCheck %s // CHECK-NOT: /usr/include // CHECK-NOT: /usr/local/include
Return an adress of Window object.
// mruby libraries #include "mruby.h" #include "mruby/array.h" #include "mruby/data.h" #include "mruby/string.h" #include <X11/Xlib.h> mrb_value x11_simple_test(mrb_state* mrb, mrb_value self) { Display *dpy = XOpenDisplay(NULL); Window win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 256, 256, 0, 0, ...
// mruby libraries #include "mruby.h" #include "mruby/array.h" #include "mruby/data.h" #include "mruby/string.h" #include <X11/Xlib.h> mrb_value x11_simple_test(mrb_state* mrb, mrb_value self) { Display* dpy = XOpenDisplay(NULL); Window* win = mrb_malloc(mrb, sizeof(Window)); *win = XCreateSimpleWindow(dpy, Def...
Fix compilation with namespaced Qt.
#ifndef QMLWARNINGDIALOG_H #define QMLWARNINGDIALOG_H #include <QDialog> namespace Ui { class QmlWarningDialog; } namespace QmlDesigner { namespace Internal { class QmlWarningDialog : public QDialog { Q_OBJECT public: explicit QmlWarningDialog(QWidget *parent, const QStringList &warnings); ~QmlWar...
#ifndef QMLWARNINGDIALOG_H #define QMLWARNINGDIALOG_H #include <QDialog> QT_BEGIN_NAMESPACE namespace Ui { class QmlWarningDialog; } QT_END_NAMESPACE namespace QmlDesigner { namespace Internal { class QmlWarningDialog : public QDialog { Q_OBJECT public: explicit QmlWarningDialog(QWidget *parent, const...
Add a convenience template for private pointers.
/* * This file is part of the Gluon Development Platform * Copyright (c) 2014 Arjen Hiemstra <ahiemstra@heimr.nl> * * 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...
Build skeleton for nRF frames
#include <systick.h> #include <protocol_hk310.h> #define FRAME_TIME 5 // 1 frame every 5 ms // **************************************************************************** static void protocol_frame_callback(void) { systick_set_callback(protocol_frame_callback, FRAME_TIME); } // ************************...
#include <systick.h> #include <protocol_hk310.h> #define FRAME_TIME 5 // One frame every 5 ms typedef enum { SEND_STICK1 = 0, SEND_STICK2, SEND_BIND_INFO, SEND_PROGRAMBOX } frame_state_t; static frame_state_t frame_state; // ******************************************************************...
Use noexcept insead of throw() for what()
#ifndef _WALKEREXCEPTION_H #define _WALKEREXCEPTION_H #include <string> //! (base) class for exceptions in uvok/WikiWalker class WalkerException : public std::exception { public: /*! Create a Walker exception with a message. * * Message might be shown on exception occurring, depending on * the comp...
#ifndef _WALKEREXCEPTION_H #define _WALKEREXCEPTION_H #include <string> //! (base) class for exceptions in uvok/WikiWalker class WalkerException : public std::exception { public: /*! Create a Walker exception with a message. * * Message might be shown on exception occurring, depending on * the comp...
Fix the build by updating FRIEND_TEST line.
// 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 CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_ #define CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_ #include "base/basictypes.h" #include "t...
// 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 CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_ #define CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_ #include "base/basictypes.h" #include "t...
Solve Time Conversion in c
#include <stdio.h> int main() { int t, h = 0, m = 0; while (scanf("%d", &t) != EOF) { if (t >= 60 * 60) { h = t / (60 * 60); t %= (60 * 60); } if (t >= 60) { m = t / 60; t %= 60; } printf("%d:%d:%d\n", h, m, t); h...
Add std:: namespace to int types
// Raster Library // Copyright (C) 2015 David Capello #ifndef RASTER_BUFFER_VIEW_INCLUDED_H #define RASTER_BUFFER_VIEW_INCLUDED_H #pragma once #include <cassert> #include <cstdint> #include <vector> #include "raster/image_spec.h" namespace raster { // Wrapper for an array of bytes. It doesn't own the data. cla...
// Raster Library // Copyright (C) 2015-2016 David Capello #ifndef RASTER_BUFFER_VIEW_INCLUDED_H #define RASTER_BUFFER_VIEW_INCLUDED_H #pragma once #include <cassert> #include <cstddef> #include <cstdint> #include <vector> #include "raster/image_spec.h" namespace raster { // Wrapper for an array of bytes. It doe...
Add logic to this behavior
/* * GoBackward.h * * Created on: Mar 25, 2014 * Author: user */ #ifndef GOBACKWARD_H_ #define GOBACKWARD_H_ #include "Behavior.h" #include "../Robot.h" class GoBackward: public Behavior { public: GoBackward(Robot* robot); bool startCondition(); bool stopCondition(); void action(); virtual ~GoBackward...
/* * GoBackward.h * * Created on: Mar 25, 2014 * Author: user */ #ifndef GOBACKWARD_H_ #define GOBACKWARD_H_ #include "Behavior.h" #include "../Robot.h" class GoBackward: public Behavior { public: GoBackward(Robot* robot); bool startCondition(); bool stopCondition(); void action(); virtual ~GoBackwa...
Remove them. Deal with them later if perf is actually an issue here.
#ifndef CC_ANALYSIS_ANALYSIS_OPTIONS_H_ #define CC_ANALYSIS_ANALYSIS_OPTIONS_H_ #include <cstddef> struct AnalysisOptions { AnalysisOptions() : track_index_translation(true), destutter_max_consecutive(3), track_chr2drop(true), replace_html_entities(true) {} // General flag...
#ifndef CC_ANALYSIS_ANALYSIS_OPTIONS_H_ #define CC_ANALYSIS_ANALYSIS_OPTIONS_H_ #include <cstddef> struct AnalysisOptions { AnalysisOptions() : destutter_max_consecutive(3), replace_html_entities(true) {} // Preprocessing flags: // * Maximum number of consecutive code points before we...
Improve error test for void parameter
int foo(void, int x) { return 0; } int main() { return foo(); }
int a(void, int i) { return 0; } int b(int i, void) { return 0; } int c(void, void) { return 0; } int d(void, ...) { return 0; } int main() { return 0; }
Change default khs to 4
#ifndef THERMALCONFIG_H #define THERMALCONFIG_H #ifndef M_PI const double M_PI = 3.141592653; #endif const double T0 = 273.15; // [C] const double R_TSV = 5e-6; // [m] /* Thermal conductance */ const double Ksi = 148.0; // Silicon const double Kcu = 401.0; // Copper const double Kin = 1.5; // insulator const...
#ifndef THERMALCONFIG_H #define THERMALCONFIG_H #ifndef M_PI const double M_PI = 3.141592653; #endif const double T0 = 273.15; // [C] const double R_TSV = 5e-6; // [m] /* Thermal conductance */ const double Ksi = 148.0; // Silicon const double Kcu = 401.0; // Copper const double Kin = 1.5; // insulator const...
Add tests for weak functions
// RUN: %clang_cc1 -verify -fsyntax-only %s extern int g0 __attribute__((weak)); extern int g1 __attribute__((weak_import)); int g2 __attribute__((weak)); int g3 __attribute__((weak_import)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}} int __attribute__((weak_import)) g4(void); ...
// RUN: %clang_cc1 -verify -fsyntax-only %s extern int f0() __attribute__((weak)); extern int g0 __attribute__((weak)); extern int g1 __attribute__((weak_import)); int f2() __attribute__((weak)); int g2 __attribute__((weak)); int g3 __attribute__((weak_import)); // expected-warning {{'weak_import' attribute cannot be ...
Change declaration express test macros
/** * \file express_tests.h * \date Jul 4, 2009 * \author anton * \details */ #ifndef EXPRESS_TESTS_H_ #define EXPRESS_TESTS_H_ typedef struct _EXPRESS_TEST_DESCRIPTOR { const char *name; int (*exec)(); } EXPRESS_TEST_DESCRIPTOR; #define REGISTER_EXPRESS_TEST(descr) static void _register_express_test(){ \ ...
/** * \file express_tests.h * \date Jul 4, 2009 * \author anton * \details */ #ifndef EXPRESS_TESTS_H_ #define EXPRESS_TESTS_H_ typedef struct _EXPRESS_TEST_DESCRIPTOR { const char *name; int (*exec)(); } EXPRESS_TEST_DESCRIPTOR; /* #define REGISTER_EXPRESS_TEST(descr) static void _register_express_test(){ \ ...
Revert "Clean up in buildbot directories."
// RUN: rm -f %S/statements.ll // RUN: %clang_cc1 -Wreturn-type %s -emit-llvm-only void test1(int x) { switch (x) { case 111111111111111111111111111111111111111: bar(); } } // Mismatched type between return and function result. int test2() { return; } void test3() { return 4; } void test4() { bar: baz: blong: bing:...
// RUN: %clang_cc1 -Wreturn-type %s -emit-llvm-only void test1(int x) { switch (x) { case 111111111111111111111111111111111111111: bar(); } } // Mismatched type between return and function result. int test2() { return; } void test3() { return 4; } void test4() { bar: baz: blong: bing: ; // PR5131 static long x = ...
Add missing header from previous commit
/* * This file is part of meego-im-framework * * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * Contact: Nokia Corporation (directui@nokia.com) * * If you have questions regarding the use of this file, please contact * Nokia at directui@nokia.com. * * This library ...
Change sbrk() prototype to sensible version with void * and ssize_t.
#ifndef FIX_UNISTD_H #define FIX_UNISTD_H #include <unistd.h> /* For some reason the g++ include files on Ultrix 4.3 fail to provide these prototypes, even though the Ultrix 4.2 versions did... Once again, OSF1 also chokes, unless _AES_SOURCE(?) is defined JCP */ #if defined(ULTRIX43) || defined(OSF1) #if def...
#ifndef FIX_UNISTD_H #define FIX_UNISTD_H #include <unistd.h> /* For some reason the g++ include files on Ultrix 4.3 fail to provide these prototypes, even though the Ultrix 4.2 versions did... Once again, OSF1 also chokes, unless _AES_SOURCE(?) is defined JCP */ #if defined(ULTRIX43) || defined(OSF1) #if def...
Test for llvm-gcc patch 78762.
// RUN: %llvmgcc %s -fasm-blocks -S -o - | grep {\\\*1192} // Complicated expression as jump target // XFAIL: * // XTARGET: darwin asm void Method3() { mov eax,[esp+4] jmp [eax+(299-1)*4] }
Copy code from vim to check stack grow direction.
// from vim(os_unix.c) /* * Find out if the stack grows upwards or downwards. * "p" points to a variable on the stack of the caller. */ static void check_stack_growth(p) char *p; { int i; stack_grows_downwards = (p > (char *)&i); }
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 (!...
Fix ‘strncpy’ was not declared in this scope
#ifndef HELPERS_H #define HELPERS_H #include <stdlib.h> #include <netdb.h> #include <arpa/inet.h> #include <errno.h> #include <string> #define RCV_SIZE 2 char * get_ip_str(const struct sockaddr *sa, char *s, size_t maxlen); char * addrinfo_to_ip(const addrinfo info, char * ip); void *get_in_addr(const sockaddr *...
#ifndef HELPERS_H #define HELPERS_H #include <stdlib.h> #include <netdb.h> #include <arpa/inet.h> #include <errno.h> #include <cstring> #include <string> #define RCV_SIZE 2 char * get_ip_str(const struct sockaddr *sa, char *s, size_t maxlen); char * addrinfo_to_ip(const addrinfo info, char * ip); void *get_in_ad...
Make ReadDataFromGlobal() and FoldReinterpretLoadFromConstPtr() Big-endian-aware.
// RUN: %clang -target i686-unknown-unknown -O3 -emit-llvm -S -o - %s | FileCheck %s long long f0(void) { struct { unsigned f0 : 32; } x = { 18 }; return (long long) (x.f0 - (int) 22); } // CHECK: @f0() // CHECK: ret i64 4294967292 long long f1(void) { struct { unsigned f0 : 31; } x = { 18 }; return (long long) (...
// RUN: %clang -O3 -emit-llvm -S -o - %s | FileCheck %s long long f0(void) { struct { unsigned f0 : 32; } x = { 18 }; return (long long) (x.f0 - (int) 22); } // CHECK: @f0() // CHECK: ret i64 4294967292 long long f1(void) { struct { unsigned f0 : 31; } x = { 18 }; return (long long) (x.f0 - (int) 22); } // CHECK:...
Add header file for RISCV_EFI_BOOT_PROTOCOL
/** @file Copyright (c) 2022, Ventana Micro Systems Inc. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource...
Make EvdevBitIsSet return a bool
// 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_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_ #define UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_ #include <limits.h> namespace ui { #define EVDEV_...
// 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_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_ #define UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_ #include <limits.h> namespace ui { #define EVDEV_...
Add slip-radio interface module for cooja-radio
/* * Copyright (c) 2011, Swedish Institute of Computer Science * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * no...
Fix order of property attributes
// // Copyright (c) 2015 Google 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 law or agre...
// // Copyright (c) 2015 Google 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 law or agre...
Include port number in col_log() output.
#include <stdarg.h> #include "col-internal.h" struct ColLogger { ColInstance *col; /* This is reset on each call to col_log() */ apr_pool_t *tmp_pool; }; ColLogger * logger_make(ColInstance *col) { ColLogger *logger; logger = apr_pcalloc(col->pool, sizeof(*logger)); logger->tmp_pool = make_s...
#include <stdarg.h> #include "col-internal.h" struct ColLogger { ColInstance *col; /* This is reset on each call to col_log() */ apr_pool_t *tmp_pool; }; ColLogger * logger_make(ColInstance *col) { ColLogger *logger; logger = apr_pcalloc(col->pool, sizeof(*logger)); logger->tmp_pool = make_s...
Use option + for TAttParticle and TPrimary
/* @(#)root/eg:$Name: $:$Id: LinkDef.h,v 1.2 2000/09/06 15:15:18 brun Exp $ */ /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
/* @(#)root/eg:$Name: $:$Id: LinkDef.h,v 1.3 2000/09/08 16:42:12 brun Exp $ */ /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
Include sqlite3 in bridging header.
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import "SQLPackRat.h"
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import "SQLPackRat.h" #import <sqlite3.h>
Call free_irq() only if request_irq() was successful
/* * Copyright IBM Corp. 2001,2008 * * This file contains the IRQ specific code for hvc_console * */ #include <linux/interrupt.h> #include "hvc_console.h" static irqreturn_t hvc_handle_interrupt(int irq, void *dev_instance) { /* if hvc_poll request a repoll, then kick the hvcd thread */ if (hvc_poll(dev_insta...
/* * Copyright IBM Corp. 2001,2008 * * This file contains the IRQ specific code for hvc_console * */ #include <linux/interrupt.h> #include "hvc_console.h" static irqreturn_t hvc_handle_interrupt(int irq, void *dev_instance) { /* if hvc_poll request a repoll, then kick the hvcd thread */ if (hvc_poll(dev_insta...
Make method_generate a static method
#include <ruby.h> #include <uuid/uuid.h> // Define our module constant VALUE CUUID = Qnil; // Prototype this void Init_cuuid(); // Prototype CUUID.generate VALUE method_generate(); // Define CUUID and the fact it has a class method called generate void Init_cuuid() { int arg_count = 0; CUUID = rb_define_module(...
#include <ruby.h> #include <uuid/uuid.h> // Define our module constant VALUE CUUID = Qnil; // Prototype this void Init_cuuid(); // Prototype CUUID.generate VALUE method_generate(); // Define CUUID and the fact it has a class method called generate void Init_cuuid() { int arg_count = 0; CUUID = rb_define_module(...
Work around byteswap bug in gcc < 4.2
/* * AVR32 endian-conversion functions. */ #ifndef __ASM_AVR32_BYTEORDER_H #define __ASM_AVR32_BYTEORDER_H #include <asm/types.h> #include <linux/compiler.h> #ifdef __CHECKER__ extern unsigned long __builtin_bswap_32(unsigned long x); extern unsigned short __builtin_bswap_16(unsigned short x); #endif #define __arc...
/* * AVR32 endian-conversion functions. */ #ifndef __ASM_AVR32_BYTEORDER_H #define __ASM_AVR32_BYTEORDER_H #include <asm/types.h> #include <linux/compiler.h> #ifdef __CHECKER__ extern unsigned long __builtin_bswap_32(unsigned long x); extern unsigned short __builtin_bswap_16(unsigned short x); #endif /* * avr32-l...
Fix build break from the future.
// 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_RENDERER_WEBVIEW_COLOR_OVERLAY_H_ #define CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_ #pragma once #include "base/basictypes.h" #include ...
// 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_RENDERER_WEBVIEW_COLOR_OVERLAY_H_ #define CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_ #pragma once #include "base/basictypes.h" #include ...
Add symb_locks test with irrelevant index access
// PARAM: --disable ana.mutex.disjoint_types --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'" // copy of 06/02 with additional index accesses #include<pthread.h> #include<stdio.h> struct cache_entry { int refs; pthread_mutex_t refs_mutex; } cache[10]; void cache_entry_addref(struct cache_e...
Make totally unnecessary AttributeChange class namespace instead keeping syntax intact.
/** For conditions of distribution and use, see copyright notice in LICENSE @file AttributeChangeType.h @brief Dummy class containing enumeration of attribute/component change types for replication. This is done in separate file in order to overcome cyclic inclusion dependency be...
/** For conditions of distribution and use, see copyright notice in LICENSE @file AttributeChangeType.h @brief Enumeration of attribute/component change types for replication. This is done in separate file in order to overcome cyclic inclusion dependency between IAttribute and IC...
Add missing protocol header file.
/** @file Utility functions which helps in opcode creation, HII configuration string manipulations, pop up window creations, setup browser persistence data set and get. Copyright (c) 2007 - 2008, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under t...
/** @file Utility functions which helps in opcode creation, HII configuration string manipulations, pop up window creations, setup browser persistence data set and get. Copyright (c) 2007 - 2008, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under t...
Update initWithBaseURL to take a URL
// // AVEHTTPRequestOperationBuilder.h // Avenue // // Created by MediaHound on 10/31/14. // // #import <Foundation/Foundation.h> #import <AFNetworking/AFNetworking.h> #import "AVERequestBuilder.h" /** * A simple AVERequestBuilder that can be configured with a baseURL, request/response serializers, * and a sec...
// // AVEHTTPRequestOperationBuilder.h // Avenue // // Created by MediaHound on 10/31/14. // // #import <Foundation/Foundation.h> #import <AFNetworking/AFNetworking.h> #import "AVERequestBuilder.h" /** * A simple AVERequestBuilder that can be configured with a baseURL, request/response serializers, * and a sec...
Remove a stale forward declaration.
//===- PromoteMemToReg.h - Promote Allocas to Scalars -----------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
//===- PromoteMemToReg.h - Promote Allocas to Scalars -----------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Add tagname attribute for HTML Element
// // HTMLElement.h // HTMLKit // // Created by Iska on 05/10/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> @interface HTMLElement : NSObject @end
// // HTMLElement.h // HTMLKit // // Created by Iska on 05/10/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> @interface HTMLElement : NSObject @property (nonatomic, strong, readonly) NSString *tagName; @end
Add missing hal_rng config used by random mod.
#ifndef NRF52_HAL_CONF_H__ #define NRF52_HAL_CONF_H__ #define HAL_UART_MODULE_ENABLED #define HAL_SPI_MODULE_ENABLED #define HAL_TIME_MODULE_ENABLED #define HAL_PWM_MODULE_ENABLED #define HAL_RTC_MODULE_ENABLED #define HAL_TIMER_MODULE_ENABLED #define HAL_TWI_MODULE_ENABLED #define HAL_ADCE_MODULE_ENABLED #define HAL_...
#ifndef NRF52_HAL_CONF_H__ #define NRF52_HAL_CONF_H__ #define HAL_UART_MODULE_ENABLED #define HAL_SPI_MODULE_ENABLED #define HAL_TIME_MODULE_ENABLED #define HAL_PWM_MODULE_ENABLED #define HAL_RTC_MODULE_ENABLED #define HAL_TIMER_MODULE_ENABLED #define HAL_TWI_MODULE_ENABLED #define HAL_ADCE_MODULE_ENABLED #define HAL_...
Add failing test case due to buggy Enums.leq
//PARAM: --sets ana.int.refinement once --enable ana.int.enums int main() { int x; _Bool c; if(c) { x--;} else { x--;} // The veryfier claimed that the fixed-point was not reached here due to a bug in Enums.leq // The leq wrongly returned false for the Enums {0} and not{}[0,1] return 0; }
Fix error in plugin description
/* * (C) Copyright 2013 Kurento (http://kurento.org/) * * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser General Public License * (LGPL) version 2.1 which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl-...
/* * (C) Copyright 2013 Kurento (http://kurento.org/) * * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser General Public License * (LGPL) version 2.1 which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl-...
Document all the public properties and methods
// // PBWebViewController.h // Pinbrowser // // Created by Mikael Konutgan on 11/02/2013. // Copyright (c) 2013 Mikael Konutgan. All rights reserved. // #import <UIKit/UIKit.h> @interface PBWebViewController : UIViewController <UIWebViewDelegate> @property (strong, nonatomic) NSURL *URL; @property (strong, nona...
// // PBWebViewController.h // Pinbrowser // // Created by Mikael Konutgan on 11/02/2013. // Copyright (c) 2013 Mikael Konutgan. All rights reserved. // #import <UIKit/UIKit.h> @interface PBWebViewController : UIViewController <UIWebViewDelegate> /** * The URL that will be loaded by the web view controller. * ...
Fix legal comment build error
// [WriteFile Name=SetInitialMapLocation, Category=Maps] // [Legal] // Copyright 2015 Esri. // 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 //...
// [WriteFile Name=SetInitialMapLocation, Category=Maps] // [Legal] // Copyright 2015 Esri. // 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 //...
Make explicit the casts and floor division in pow_elem function
#include<2D_element_arithmetic.h> matrix * elem_matrix_operation(elem (*fp)(elem, float), matrix * m, float param) { int i, j = 0; for(i = 0; i < m->rows; i++) { for(j =0; j < m->columns; j++) { set_matrix_member(m, i+1, j+1, (*fp)(m->arr[i*m->columns +j], para...
#include<2D_element_arithmetic.h> matrix * elem_matrix_operation(elem (*fp)(elem, float), matrix * m, float param) { int i, j = 0; for(i = 0; i < m->rows; i++) { for(j =0; j < m->columns; j++) { set_matrix_member(m, i+1, j+1, (*fp)(m->arr[i*m->columns +j], para...
Enhance compound literal test case.
// RUN: clang -checker-simple -verify %s int* f1() { int x = 0; return &x; // expected-warning{{Address of stack memory associated with local variable 'x' returned.}} expected-warning{{address of stack memory associated with local variable 'x' returned}} } int* f2(int y) { return &y; // expected-warning{{Addre...
// RUN: clang -checker-simple -verify %s int* f1() { int x = 0; return &x; // expected-warning{{Address of stack memory associated with local variable 'x' returned.}} expected-warning{{address of stack memory associated with local variable 'x' returned}} } int* f2(int y) { return &y; // expected-warning{{Addre...
Add a newline at the end of the file.
/*===---- varargs.h - Variable argument handling -------------------------------------=== * * 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 t...
/*===---- varargs.h - Variable argument handling -------------------------------------=== * * 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 t...
Update to use DOS format
/** @file Implement a utility function named R8_EfiLibCompareLanguage. Copyright (c) 2007 - 2008, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full ...
/** @file Implement a utility function named R8_EfiLibCompareLanguage. Copyright (c) 2007 - 2008, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. Th...
Make language by code public.
// // LKManager.h // // Created by Vlad Gorbenko on 4/21/15. // Copyright (c) 2015 Vlad Gorbenko. All rights reserved. // #import <Foundation/Foundation.h> #import "LKLanguage.h" extern NSString *const LKLanguageDidChangeNotification; extern NSString *const LKSourceDefault; extern NSString *const LKSourcePlist; ...
// // LKManager.h // // Created by Vlad Gorbenko on 4/21/15. // Copyright (c) 2015 Vlad Gorbenko. All rights reserved. // #import <Foundation/Foundation.h> #import "LKLanguage.h" extern NSString *const LKLanguageDidChangeNotification; extern NSString *const LKSourceDefault; extern NSString *const LKSourcePlist; ...
Add matrix multiplication code in C
#include <stdio.h> #include <mpi.h> int main(int argc, char *argv[]) { int numprocs, rank, namelen; char processor_name[MPI_MAX_PROCESSOR_NAME]; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &numprocs); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Get_processor_name(processor_name, &namelen); // T...
// mat_x num of rows equals to // mat_a num of rows #define A_ROWS 3 #define X_ROWS 3 // mat_x num of cols equals to // mat_b num of cols #define B_COLS 3 #define X_COLS 3 // mat_a num of cols should be equals to // mat_b num of rows #define A_COLS 2 #define B_ROWS 2 #include <stdio.h> // #include <mpi.h> void print_...
Remove a redifinition of type 'bytes'
/* This file was auto-generated by KreMLin! */ #ifndef __Random_H #define __Random_H #include "kremlib.h" #include "config.h" #include "drng.h" #include "cpuid.h" typedef uint8_t u8; typedef uint32_t u32; typedef uint64_t u64; typedef uint8_t *bytes; uint32_t random_uint32(); uint64_t random_uint64(); void ran...
/* This file was auto-generated by KreMLin! */ #ifndef __Random_H #define __Random_H #include "kremlib.h" #include "config.h" #include "drng.h" #include "cpuid.h" typedef uint8_t u8; typedef uint32_t u32; typedef uint64_t u64; uint32_t random_uint32(); uint64_t random_uint64(); void random_bytes(uint8_t *rand, ...
Add web page link to the main doxygen page
/** @mainpage M-Stack @section Intro This is M-Stack, a free USB Device Stack for PIC Microcontrollers. For more information, see the <a href="group__public__api.html">Public API Page.</a> */
/** @mainpage M-Stack @section Intro This is M-Stack, a free USB Device Stack for PIC Microcontrollers. For more information, see the <a href="http://www.signal11.us/oss/m-stack">main web page.</a> For API documentation, see the <a href="group__public__api.html">Public API Page.</a> */
Add function returning Species object
/// @file /// @brief Defines SpeciedDialog class. #ifndef SPECIES_DIALOG_H #define SPECIES_DIALOG_H namespace fish_detector { class SpeciesDialog : public QDialog { Q_OBJECT #ifndef NO_TESTING friend class TestSpeciesDialog; #endif public: /// @brief Constructor. /// /// @param parent Parent widget. expl...
/// @file /// @brief Defines SpeciesDialog class. #ifndef SPECIES_DIALOG_H #define SPECIES_DIALOG_H #include <memory> #include <QWidget> #include <QDialog> #include "fish_detector/common/species.h" namespace Ui { class SpeciesDialog; } namespace fish_detector { class SpeciesDialog : public QDialog { Q_OBJECT...
Add missing unversioned interface-name macro for PPP_Pdf.
// 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 WEBKIT_PLUGINS_PPAPI_PPP_PDF_H_ #define WEBKIT_PLUGINS_PPAPI_PPP_PDF_H_ #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_point.h" #inclu...
// 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 WEBKIT_PLUGINS_PPAPI_PPP_PDF_H_ #define WEBKIT_PLUGINS_PPAPI_PPP_PDF_H_ #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_point.h" #inclu...
Add ugly hack for waiting that ARP cache gets populated
#include "syshead.h" #include "dst.h" #include "ip.h" #include "arp.h" int dst_neigh_output(struct sk_buff *skb) { struct iphdr *iphdr = ip_hdr(skb); struct netdev *netdev = skb->netdev; uint8_t *dmac = arp_get_hwaddr(iphdr->daddr); int rc; if (dmac) { return netdev_transmit(skb, dmac, ETH...
#include "syshead.h" #include "dst.h" #include "ip.h" #include "arp.h" int dst_neigh_output(struct sk_buff *skb) { struct iphdr *iphdr = ip_hdr(skb); struct netdev *netdev = skb->netdev; uint8_t *dmac = arp_get_hwaddr(iphdr->daddr); int rc; if (dmac) { return netdev_transmit(skb, dmac, ETH...
Fix DB_STRINGIFY to indirectly convert arg to a string.
/* * Copyright (c) 2008 Digital Bazaar, Inc. All rights reserved. */ #ifndef db_util_Macros_H #define db_util_Macros_H /** * Miscellaneous general use macros. */ /** * Macro statement wrapper. Adapted from glib. * Use: * if(x) DB_STMT_START { ... } DB_STMT_END; else ... */ #define DB_STMT_START do #define D...
/* * Copyright (c) 2008 Digital Bazaar, Inc. All rights reserved. */ #ifndef db_util_Macros_H #define db_util_Macros_H /** * Miscellaneous general use macros. */ /** * Macro statement wrapper. Adapted from glib. * Use: * if(x) DB_STMT_START { ... } DB_STMT_END; else ... */ #define DB_STMT_START do #define D...
Make this test actually test something
// RUN: %clang_cc1 -verify -fsyntax-only -Wformat -Wno-format-y2k // rdar://9504680 void foo(const char *, ...) __attribute__((__format__ (__printf__, 1, 2))); void bar(unsigned int a) { foo("%s", a); // expected-warning {{format specifies type 'char *' but the argument has type 'unsigned int'}} }
// RUN: %clang_cc1 -verify -fsyntax-only -Wformat -Wno-format-y2k %s // rdar://9504680 void foo(const char *, ...) __attribute__((__format__ (__printf__, 1, 2))); void bar(unsigned int a) { foo("%s", a); // expected-warning {{format specifies type 'char *' but the argument has type 'unsigned int'}} }
Set the id for the trace message
#include "clacks_common.h" #include "id_client.h" #include "TraceMessage.pb-c.h" #include "../transport-client/cl_transport_domsock_client.h" #include <stdio.h> #include "clacks.h" /* API Back-End */ void _clacks_trace_string_id(char *str, char *id) { int ret; TraceMessage t_msg = TRACE_MESSAGE__INIT; t_msg.ac...
#include "clacks_common.h" #include "id_client.h" #include "TraceMessage.pb-c.h" #include "../transport-client/cl_transport_domsock_client.h" #include <stdio.h> #include "clacks.h" /* API Back-End */ void _clacks_trace_string_id(char *str, char *id) { int ret; TraceMessage t_msg = TRACE_MESSAGE__INIT; t_msg.ac...
Add forgotten source file cl_test.c
/** * @file cl_trees.c * @author Rastislav Szabo <raszabo@cisco.com>, Lukas Macko <lmacko@cisco.com>, * Milan Lenco <milan.lenco@pantheon.tech> * @brief Iterative tree loading using internal sysrepo requests. * * @copyright * Copyright 2016 Cisco Systems, Inc. * * Licensed under the Apache License, Ver...
Make this explictly signed. Fixes PR1571.
// RUN: %llvmgcc %s -o - -S -emit-llvm -O3 | grep {i8 signext} // PR1513 struct s{ long a; long b; }; void f(struct s a, char *b, char C) { }
// RUN: %llvmgcc %s -o - -S -emit-llvm -O3 | grep {i8 signext} // PR1513 struct s{ long a; long b; }; void f(struct s a, char *b, signed char C) { }
FIX warnings: newline at end of file
#ifndef _mitk_Video_Source_h_ #define _mitk_Video_Source_h_ #include "mitkCommon.h" #include <itkObject.h> #include "itkObjectFactory.h" namespace mitk { /** * Simple base class for acquiring video data. */ class VideoSource //: public itk::Object { public: //mitkClassMacro( VideoSource, itk::Obj...
#ifndef _mitk_Video_Source_h_ #define _mitk_Video_Source_h_ #include "mitkCommon.h" #include <itkObject.h> #include "itkObjectFactory.h" namespace mitk { /** * Simple base class for acquiring video data. */ class VideoSource //: public itk::Object { public: //mitkClassMacro( VideoSource, itk::Obj...
Add missing include, found by modules build.
//===--- OptSpecifier.h - Option Specifiers ---------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
//===--- OptSpecifier.h - Option Specifiers ---------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Add GPIO hal for simulator.
/** * Copyright (c) 2015 Runtime 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 law or agreed...
Disable boost's include_next functionality, fixes compatibility with Sirikata.
/* * LibCassandra * Copyright (C) 2010-2011 Padraig O'Sullivan, Ewen Cheslack-Postava * All rights reserved. * * Use and distribution licensed under the BSD license. See * the COPYING file in the parent directory for full text. */ #ifndef __LIBCASSANDRA_UTIL_PLATFORM_H #define __LIBCASSANDRA_UTIL_PLATFORM_H #i...
/* * LibCassandra * Copyright (C) 2010-2011 Padraig O'Sullivan, Ewen Cheslack-Postava * All rights reserved. * * Use and distribution licensed under the BSD license. See * the COPYING file in the parent directory for full text. */ #ifndef __LIBCASSANDRA_UTIL_PLATFORM_H #define __LIBCASSANDRA_UTIL_PLATFORM_H #i...
Change integral_constant<bool> to true_type and false_type.
#include <type_traits> template<typename T> struct is_config_type:std::integral_constant<bool,false>{}; template<> struct is_config_type <bool>: std::integral_constant<bool,true>{}; template<> struct is_config_type <int>: std::integral_constant<bool,true>{}; template<> struct is_config_t...
#include <type_traits> template<typename T> struct is_config_type: std::false_type{}; template<> struct is_config_type <bool>: std::true_type{}; template<> struct is_config_type <int>: std::true_type{}; template<> struct is_config_type <long>: std::true_type{}; template<> s...
Update Skia milestone to 96
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 95 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 96 #endif
Update Skia milestone to 67
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 66 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 67 #endif
Remove support for Sun Studio compiler
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * 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 * * ht...
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * 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 * * ht...
Use type casts from void
#include "resourceManager.h" #include "kernelHeap.h" //allocates frames MemoryResource *create_memoryResource(unsigned int size) { MemoryResource *memRes; memRes = kmalloc(sizeof(MemoryResource)); return memRes; }
#include "resourceManager.h" #include "kernelHeap.h" //allocates frames MemoryResource *create_memoryResource(unsigned int size) { MemoryResource *memRes; memRes = (MemoryResource*)kmalloc(sizeof(MemoryResource)); return memRes; }
Add functions for linear interpolation of creep function parameters.
#include "matrix.h" #include <stdio.h> enum datacols { _M = 1, _J0 = 2, _J1 = 3, _J2 = 5, _TAU1 = 4, _TAU2 = 6 }; double CreepLookup(char *file, double T, double M, int param) { int i = 0; double M0, M1, y0, y1; matrix *data; data = mtxloadcsv(file, 1); while(val(data, i,...
Fix typo in function name
/* stacks.h * Copyright: (When this is determined...it will go here) * CVS Info * $Id$ * Overview: * Stack handling routines for Parrot * Data Structure and Algorithms: * History: * Notes: * References: */ #if !defined(PARROT_STACKS_H_GUARD) #define PARROT_STACKS_H_GUARD #include "parrot/parr...
/* stacks.h * Copyright: (When this is determined...it will go here) * CVS Info * $Id$ * Overview: * Stack handling routines for Parrot * Data Structure and Algorithms: * History: * Notes: * References: */ #if !defined(PARROT_STACKS_H_GUARD) #define PARROT_STACKS_H_GUARD #include "parrot/parr...
Include mysql_com.h has been here for ages but was superfluous
#ifndef MYSQL2_EXT #define MYSQL2_EXT void Init_mysql2(void); /* tell rbx not to use it's caching compat layer by doing this we're making a promise to RBX that we'll never modify the pointers we get back from RSTRING_PTR */ #define RSTRING_NOT_MODIFIED #include <ruby.h> #ifdef HAVE_MYSQL_H #include <mysql.h> #...
#ifndef MYSQL2_EXT #define MYSQL2_EXT void Init_mysql2(void); /* tell rbx not to use it's caching compat layer by doing this we're making a promise to RBX that we'll never modify the pointers we get back from RSTRING_PTR */ #define RSTRING_NOT_MODIFIED #include <ruby.h> #ifdef HAVE_MYSQL_H #include <mysql.h> #...
Check result of write (thans to Alexander Kapshuk <alexander.kapshuk@gmail)
#include "types.h" #include "stat.h" #include "user.h" char buf[512]; void cat(int fd) { int n; while((n = read(fd, buf, sizeof(buf))) > 0) write(1, buf, n); if(n < 0){ printf(1, "cat: read error\n"); exit(); } } int main(int argc, char *argv[]) { int fd, i; if(argc <= 1){ cat(0); e...
#include "types.h" #include "stat.h" #include "user.h" char buf[512]; void cat(int fd) { int n; while((n = read(fd, buf, sizeof(buf))) > 0) { if (write(1, buf, n) != n) { printf(1, "cat: write error\n"); exit(); } } if(n < 0){ printf(1, "cat: read error\n"); exit(); } } int mai...
Fix to literal data types in the macros
#define WORD (8 * sizeof(ulong)) #define clz(x) __builtin_clzl(x) #define fls(x) (WORD - clz(x)) #define ffs(x) (__builtin_ctzl(x)) #define get(x, i) ((x) & (1 << (i))) #define set(x, i) (x = (x) | (1 << (i))) #define unset(x, i) (x = (x) & ~(1 << (i)))
#define WORD (8 * sizeof(ulong)) #define clz(x) __builtin_clzl(x) #define fls(x) (WORD - clz(x)) #define ffs(x) (__builtin_ctzl(x)) #define get(x, i) ((x) & (1L << (i))) #define set(x, i) (x = (x) | (1L << (i))) #define unset(x, i) (x = (x) & ~(1L << (i)))
Add SAFE_RZCALL to wrap calls that returns zero.
#ifndef SAFE_H #define SAFE_H #include "debug.h" #ifndef DISABLE_SAFE #define SAFE_STRINGIFY(x) #x #define SAFE_TOSTRING(x) SAFE_STRINGIFY(x) #define SAFE_AT __FILE__ ":" SAFE_TOSTRING(__LINE__) ": " #define SAFE_ASSERT(cond) do { \ if (!(cond)) { \ DEBUG_DUMP(0, "error: " SAFE_AT "%m"); \ DEBUG_BREAK(!(c...
#ifndef SAFE_H #define SAFE_H #include "debug.h" #ifndef DISABLE_SAFE #define SAFE_STRINGIFY(x) #x #define SAFE_TOSTRING(x) SAFE_STRINGIFY(x) #define SAFE_AT __FILE__ ":" SAFE_TOSTRING(__LINE__) ": " #define SAFE_ASSERT(cond) do { \ if (!(cond)) { \ DEBUG_DUMP(0, "error: " SAFE_AT "%m"); \ DEBUG_BREAK(!(c...
Add proof-of-concept Kernel protocol header.
/** @file Copyright (C) 2016 CupertinoNet. All rights reserved.<BR> 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 a...
Add deadlock non-concurrency example from Kroenig et al ASE16
// PARAM: --set ana.activated[+] deadlock --set ana.activated[+] threadJoins // From https://arxiv.org/abs/1607.06927 #include <pthread.h> int x; pthread_mutex_t m1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t m2 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t m3 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t m4 = PTHREAD_...
Add BOTAN_DLL macro to Default_IF_Op
/************************************************* * IF Operations Header File * * (C) 1999-2008 Jack Lloyd * *************************************************/ #ifndef BOTAN_IF_OP_H__ #define BOTAN_IF_OP_H__ #include <botan/bigint.h> #include <botan/pow_mod.h> #include <bot...
/************************************************* * IF Operations Header File * * (C) 1999-2008 Jack Lloyd * *************************************************/ #ifndef BOTAN_IF_OP_H__ #define BOTAN_IF_OP_H__ #include <botan/bigint.h> #include <botan/pow_mod.h> #include <bot...
Remove the last reminints of NBlocks from Projection.
/* -*- mode:linux -*- */ /** * \file projection.h * * * * \author Ethan Burns * \date 2008-10-15 */ #if !defined(_PROJECTION_H_) #define _PROJECTION_H_ #include <vector> #include "../state.h" using namespace std; /** * An abstract projection function class. */ class Projection { public: virtual ~Projecti...
/* -*- mode:linux -*- */ /** * \file projection.h * * * * \author Ethan Burns * \date 2008-10-15 */ #if !defined(_PROJECTION_H_) #define _PROJECTION_H_ #include <vector> #include "../state.h" using namespace std; /** * An abstract projection function class. */ class Projection { public: virtual ~Projecti...
Kill off duplicate kzalloc() definition.
#ifndef __LINUX_SLOB_DEF_H #define __LINUX_SLOB_DEF_H void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); static inline void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags) { return kmem_cache_alloc_node(cachep, flags, -1); } void *__kmalloc_node(size_t size, gfp_t flags, int node); ...
#ifndef __LINUX_SLOB_DEF_H #define __LINUX_SLOB_DEF_H void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); static inline void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags) { return kmem_cache_alloc_node(cachep, flags, -1); } void *__kmalloc_node(size_t size, gfp_t flags, int node); ...
Add carousel to carousel test =P
#include <Elementary.h> #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif #ifndef ELM_LIB_QUICKLAUNCH void test_carousel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *win, *bg; win = elm_win_add(NULL, "carousel", ELM_WIN_BASIC); elm_win_title_set(win...
#include <Elementary.h> #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif #ifndef ELM_LIB_QUICKLAUNCH void test_carousel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { Evas_Object *win, *bg, *car; win = elm_win_add(NULL, "carousel", ELM_WIN_BASIC); elm_win_title_s...
Test case update for D40873
// RUN: %clang_pgogen -O2 -o %t %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: llvm-profdata show -function main -counts %t.profraw| FileCheck %s void exit(int); int g; __attribute__((noinline)) void foo() { g++; if (g==1000) exit(0); } int main() { while (1) { foo(); } } // CHECK:...
// RUN: %clang_pgogen -O2 -o %t %s // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t // RUN: llvm-profdata show -function main -counts %t.profraw| FileCheck %s void exit(int); int g; __attribute__((noinline)) void foo() { g++; if (g==1000) exit(0); } int main() { while (1) { foo(); } } // CHECK:...
Add the thunk test to the suite.
#ifndef end_to_end_tests_remote_h_incl #define end_to_end_tests_remote_h_incl #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include "end_to_end_tests_base.h" class EndToEndTestsRemote : public EndToEndTestsBase { static bool is_receiver; CPPUNIT_TEST_SUITE(EndToEndTestsRemo...
#ifndef end_to_end_tests_remote_h_incl #define end_to_end_tests_remote_h_incl #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> #include "end_to_end_tests_base.h" class EndToEndTestsRemote : public EndToEndTestsBase { static bool is_receiver; CPPUNIT_TEST_SUITE(EndToEndTestsRemo...
Remove unnecessary rounding when allocating initial thread block
/* * Copyright (c) 2012 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include <unistd.h> #include "native_client/src/untrusted/nacl/nacl_irt.h" #include "native_client/src/untrusted/nacl/nacl_thread.h" #inc...
/* * Copyright (c) 2012 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include <unistd.h> #include "native_client/src/untrusted/nacl/nacl_irt.h" #include "native_client/src/untrusted/nacl/nacl_thread.h" #inc...
Add private TOC data type
/* toc_private.h - Private optical disc table of contents (TOC) API * * Copyright (c) 2011 Ian Jacobi <pipian@pipian.com> * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * r...
Fix syntax error for linux build.
// For conditions of distribution and use, see copyright notice in license.txt #ifndef incl_KristalliProtocolModuleApi_h #define incl_KristalliProtocolModuleApi_h #if defined (_WINDOWS) #if defined(KRISTALLIPROTOCOL_MODULE_EXPORTS) #define KRISTALLIPROTOCOL_MODULE_API __declspec(dllexport) #else #define KRISTALLIPRO...
// For conditions of distribution and use, see copyright notice in license.txt #ifndef incl_KristalliProtocolModuleApi_h #define incl_KristalliProtocolModuleApi_h #if defined (_WINDOWS) #if defined(KRISTALLIPROTOCOL_MODULE_EXPORTS) #define KRISTALLIPROTOCOL_MODULE_API __declspec(dllexport) #else #define KRISTALLIPRO...
Fix the Chrome OS build.
// 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 CHROME_BROWSER_CHROMEOS_CROS_MOCK_UPDATE_LIBRARY_H_ #define CHROME_BROWSER_CHROMEOS_CROS_MOCK_UPDATE_LIBRARY_H_ #pragma once #include "base/o...
// 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 CHROME_BROWSER_CHROMEOS_CROS_MOCK_UPDATE_LIBRARY_H_ #define CHROME_BROWSER_CHROMEOS_CROS_MOCK_UPDATE_LIBRARY_H_ #pragma once #include "base/o...
Change malloc_usable_size for Linux with the __linux__ macro
#ifndef PECTOR_MALLOC_ALLOCATOR_COMPAT_H #define PECTOR_MALLOC_ALLOCATOR_COMPAT_H #ifdef __APPLE__ #include <malloc/malloc.h> #else #include <malloc.h> #endif #if defined __GNUC__ || defined _WIN32 || defined __APPLE__ || defined __FreeBSD__ #define PT_SIZE_AWARE_COMPAT #if defined _WIN32 #define PT_MALLOC_USABLE_S...
#ifndef PECTOR_MALLOC_ALLOCATOR_COMPAT_H #define PECTOR_MALLOC_ALLOCATOR_COMPAT_H #ifdef __APPLE__ #include <malloc/malloc.h> #else #include <malloc.h> #endif #if defined __linux__ || defined __gnu_hurd__ || defined _WIN32 || defined __APPLE__ || defined __FreeBSD__ #define PT_SIZE_AWARE_COMPAT #if defined _WIN32 #...
Add comment about stack probing and remove unused ifdefs
/* This file is part of ethash. ethash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ethash is distributed in the hope that i...
/* This file is part of ethash. ethash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ethash is distributed in the hope that i...
Switch to more common timing functions
int test_performance() { asic_t *device = asic_init(TI83p); struct timespec start, stop; unsigned long long t; int i; clock_gettime(CLOCK_MONOTONIC_RAW, &start); for (i = 0; i < 1000000; i++) { i -= cpu_execute(device->cpu, 1); } clock_gettime(CLOCK_MONOTONIC_RAW, &stop); t ...
int test_performance() { asic_t *device = asic_init(TI83p); clock_t start, stop; int i; start = clock(); for (i = 0; i < 1000000; i++) { i -= cpu_execute(device->cpu, 1); } stop = clock(); double time = (double)(stop - start) / (CLOCKS_PER_SEC / 1000); double mHz = 1000.0 / ...
Add aarch64 jit compiler stub
#include <string.h> #include <math.h> #include <sys/mman.h> #include "expreval_internal.h" static void *create_executable_code_aarch64_linux(const char *machine_code, int size); void *compile_function_internal(compiler c, token first_token, int *size) { unsigned char code[MAX_CODE_LEN]; unsigned char tmp[] =...
Fix for LLVM API change to SpecialCaseList::create
//===--- SanitizerBlacklist.h - Blacklist for sanitizers --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
//===--- SanitizerBlacklist.h - Blacklist for sanitizers --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Revert "win32: include windef.h instead of windows.h"
/* * This file is part of gspell, a spell-checking library. * * Copyright 2016 - Ignacio Casal Quinteiro <icq@gnome.org> * Copyright 2016 - Sébastien Wilmet <swilmet@gnome.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * Licens...
/* * This file is part of gspell, a spell-checking library. * * Copyright 2016 - Ignacio Casal Quinteiro <icq@gnome.org> * Copyright 2016 - Sébastien Wilmet <swilmet@gnome.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * Licens...
Remove old tracked point fields
#ifndef TRACKEDPOINT_H #define TRACKEDPOINT_H #include <opencv2/core/affine.hpp> #include "TrackingData.h" namespace sensekit { namespace plugins { namespace hand { struct TrackedPoint { public: cv::Point m_position; cv::Point3f m_worldPosition; cv::Point3f m_steadyWorldPosition; ...
#ifndef TRACKEDPOINT_H #define TRACKEDPOINT_H #include <opencv2/core/affine.hpp> #include "TrackingData.h" namespace sensekit { namespace plugins { namespace hand { struct TrackedPoint { public: cv::Point m_position; cv::Point3f m_worldPosition; cv::Point3f m_worldDeltaPosition; ...