Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Remove process_may_block since it's no longer used except in xwindows.cpp. | /*
Title: Basic IO.
Copyright (c) 2000 David C. J. Matthews
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)... | /*
Title: Basic IO.
Copyright (c) 2000 David C. J. Matthews
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)... |
Fix for compiler error in r4154 | /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkStippleMaskFilter_DEFINED
#define SkStippleMaskFilter_DEFINED
#include "SkMaskFilter.h"
/**
* Simple MaskFilter that creates a screen door stipple pattern
*/
cla... | /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkStippleMaskFilter_DEFINED
#define SkStippleMaskFilter_DEFINED
#include "SkMaskFilter.h"
/**
* Simple MaskFilter that creates a screen door stipple pattern
*/
cla... |
Fix build issue for Linux | #ifndef QCMAINTHREADRUNNER_H
#define QCMAINTHREADRUNNER_H
#include <QObject>
#include <QVariant>
#include <QEVent>
#include <QCoreApplication>
class QCMainThreadRunner
{
public:
/// Run a function on main thread. If it is already in main thread, it will be executed in next tick.
template <typename F>
st... | #ifndef QCMAINTHREADRUNNER_H
#define QCMAINTHREADRUNNER_H
#include <QObject>
#include <QCoreApplication>
class QCMainThreadRunner
{
public:
/// Run a function on main thread. If it is already in main thread, it will be executed in next tick.
template <typename F>
static void start(F func) {
QObj... |
Add a missing header from one of the tests | #ifndef TEST_COLLISIONS_H
#define TEST_COLLISIONS_H
#include <kaztest/kaztest.h>
#include "spindash/spindash.h"
#include "spindash/collision/collide.h"
#include "spindash/collision/ray_box.h"
const SDVec2 box_points[] = {
{ -5, -5 },
{ 5, -5 },
{ 5, 0 },
{ -5, 0 }
};
class CollisionGeomTest : public... | #ifndef TEST_COLLISIONS_H
#define TEST_COLLISIONS_H
#include <kaztest/kaztest.h>
#include "spindash/spindash.h"
#include "spindash/collision/collide.h"
#include "spindash/collision/ray_box.h"
#include "spindash/collision/box.h"
const SDVec2 box_points[] = {
{ -5, -5 },
{ 5, -5 },
{ 5, 0 },
{ -5, 0 }
... |
Remove TODO. Tested common credentials, didn't work. | #pragma once
#include "initiation/sipmessageprocessor.h"
#include "initiation/siptypes.h"
/* This class handles the authentication for this connection
* should we receive a challenge */
class SIPAuthentication : public SIPMessageProcessor
{
Q_OBJECT
public:
SIPAuthentication();
public slots:
// add credent... | #pragma once
#include "initiation/sipmessageprocessor.h"
#include "initiation/siptypes.h"
/* This class handles the authentication for this connection
* should we receive a challenge */
class SIPAuthentication : public SIPMessageProcessor
{
Q_OBJECT
public:
SIPAuthentication();
public slots:
// add credent... |
Set up GDT and load 32-Bit Segments | /*
* ASXSoft Nuke - Operating System
* Copyright (C) 2009 Patrick Pokatilo
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your op... | |
Add WARN annotations and explanations to test, expand it with one case. | #include <fcntl.h>
#include <unistd.h>
typedef void (*fnct_ptr)(void);
typedef int (*open_t)(const char*,int,int);
typedef int (*ftruncate_t)(int,off_t);
// Goblint used to crash on this example because the number of supplied arguments for myopen is bigger than
// than the expected number of arguments for the library... | #include <fcntl.h>
#include <unistd.h>
typedef void (*fnct_ptr)(void);
typedef int (*open_t)(const char*,int,...);
typedef int (*ftruncate_t)(int,off_t);
// Goblint used to crash on this example because the number of supplied arguments for myopen is bigger than
// than the expected number of arguments for the library... |
Add divider constructor with interval default argument | #ifndef CONSOLE_H
#define CONSOLE_H
#include <Cart.h>
#include <Controller.h>
#include <CPU.h>
#include <PPU.h>
#include <APU.h>
class Divider {
public:
void setInterval(int interval) {
this->interval = interval;
clockCounter = interval - 1;
}
void tick() {
clockCounter++;
if (clockCounter == interval... | #ifndef CONSOLE_H
#define CONSOLE_H
#include <Cart.h>
#include <Controller.h>
#include <CPU.h>
#include <PPU.h>
#include <APU.h>
class Divider {
public:
Divider(int interval = 1) {
setInterval(interval);
}
void setInterval(int interval) {
this->interval = interval;
clockCounter = interval - 1;
}
... |
Fix implicit declaration of function ‘time’ | /**
* @file utils.h
* @brief Storj utilities.
*
* Helper utilities
*/
#ifndef STORJ_UTILS_H
#define STORJ_UTILS_H
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <sys/time.h>
#endif
int hex2str... | /**
* @file utils.h
* @brief Storj utilities.
*
* Helper utilities
*/
#ifndef STORJ_UTILS_H
#define STORJ_UTILS_H
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#ifdef _WIN32
#include <windows.h>
#include <time.h>
#else
#include <sys/time.h>
#... |
Make conversions between integer sizes explicit | #pragma once
#include "definitions.h"
#include "util/log.h"
inline u16 compose_bytes(const u8 high, const u8 low) {
return (high << 8) + low;
}
inline bool check_bit(const u8 value, const int bit) {
return (value & (1 << bit)) != 0;
}
inline u8 set_bit(const u8 value, const int bit) {
return value | (1 ... | #pragma once
#include "definitions.h"
#include "util/log.h"
inline u16 compose_bytes(const u8 high, const u8 low) {
return static_cast<u16>((high << 8) + low);
}
inline bool check_bit(const u8 value, const u8 bit) {
return (value & (1 << bit)) != 0;
}
inline u8 set_bit(const u8 value, const u8 bit) {
au... |
Fix this test case for CMake builds after r126502, which sneakily changed the actual executable name to clang-<version>. | // RUN: %clang -ccc-echo -o %t %s 2> %t.log
// Make sure we used clang.
// RUN: grep 'clang" -cc1 .*hello.c' %t.log
// RUN: %t > %t.out
// RUN: grep "I'm a little driver, short and stout." %t.out
// FIXME: We don't have a usable assembler on Windows, so we can't build real
// apps yet.
// XFAIL: win32
#include <std... | // RUN: %clang -ccc-echo -o %t %s 2> %t.log
// Make sure we used clang.
// RUN: grep 'clang\(-[0-9.]\+\)\?" -cc1 .*hello.c' %t.log
// RUN: %t > %t.out
// RUN: grep "I'm a little driver, short and stout." %t.out
// FIXME: We don't have a usable assembler on Windows, so we can't build real
// apps yet.
// XFAIL: win32... |
Remove types left over from header split | #ifndef KISS_TEMPLATES_KISTE_H
#define KISS_TEMPLATES_KISTE_H
#include <kiste/terminal.h>
#include <kiste/raw.h>
namespace kiste
{
struct terminal_t
{
};
constexpr auto terminal = terminal_t{};
struct raw
{
std::ostream& _os;
template <typename T>
auto operator()(T&& t) const -> void
{
... | #ifndef KISS_TEMPLATES_KISTE_H
#define KISS_TEMPLATES_KISTE_H
#include <kiste/terminal.h>
#include <kiste/raw.h>
#endif
|
Revert 88957. This file uses CodeGenOpt, which is defined in TargetMachine.h. | //===-- MachineFunctionAnalysis.h - Owner of MachineFunctions ----*-C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===-- MachineFunctionAnalysis.h - Owner of MachineFunctions ----*-C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Update driver version to 5.04.00-k1 | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2013 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.04.00-k0"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2013 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.04.00-k1"
|
Remove extraneous method in Problem 15 | //===-- problems/Problem15.h ------------------------------------*- C++ -*-===//
//
// ProjectEuler.net solutions by Will Mitchell
//
// This file is distributed under the MIT License. See LICENSE for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief P... | //===-- problems/Problem15.h ------------------------------------*- C++ -*-===//
//
// ProjectEuler.net solutions by Will Mitchell
//
// This file is distributed under the MIT License. See LICENSE for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief P... |
Add name method to custom tools | #ifndef QMLDESIGNER_ABSTRACTSINGLESELECTIONTOOL_H
#define QMLDESIGNER_ABSTRACTSINGLESELECTIONTOOL_H
#include "abstractformeditortool.h"
namespace QmlDesigner {
class QMLDESIGNERCORE_EXPORT AbstractCustomTool : public QmlDesigner::AbstractFormEditorTool
{
public:
AbstractCustomTool();
void selectedItemsChang... | #ifndef QMLDESIGNER_ABSTRACTSINGLESELECTIONTOOL_H
#define QMLDESIGNER_ABSTRACTSINGLESELECTIONTOOL_H
#include "abstractformeditortool.h"
namespace QmlDesigner {
class QMLDESIGNERCORE_EXPORT AbstractCustomTool : public QmlDesigner::AbstractFormEditorTool
{
public:
AbstractCustomTool();
void selectedItemsChang... |
Fix to compile on VS2008. | //===-- llvm/CodeGen/Spiller.h - Spiller -*- C++ -*------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===-- llvm/CodeGen/Spiller.h - Spiller -*- C++ -*------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Add a (public) header to set cpu endianness when numpy headers are included instead of setting them at build time. | #ifndef _NPY_ENDIAN_H_
#define _NPY_ENDIAN_H_
/* NPY_BYTE_ORDER is set to the same value as BYTE_ORDER set by glibc in
* endian.h */
#ifdef NPY_HAVE_ENDIAN_H
/* Use endian.h if available */
#include <endian.h>
#define NPY_BYTE_ODER __BYTE_ORDER
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
... | |
Remove SK_LEGACY_HEIF_API to enable animation in SkHeifCodec | /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT ... | /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT ... |
Stop SkyShell from crashing on startup | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SKY_SHELL_PLATFORM_VIEW_ANDROID_H_
#define SKY_SHELL_PLATFORM_VIEW_ANDROID_H_
#include "sky/shell/platform_view.h"
struct ANativeWindow;
namesp... | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SKY_SHELL_PLATFORM_VIEW_ANDROID_H_
#define SKY_SHELL_PLATFORM_VIEW_ANDROID_H_
#include "sky/shell/platform_view.h"
struct ANativeWindow;
namesp... |
Add the vpsc library for IPSEPCOLA features | /**
* \brief Solve an instance of the "Variable Placement with Separation
* Constraints" problem.
*
* Authors:
* Tim Dwyer <tgdwyer@gmail.com>
*
* Copyright (C) 2005 Authors
*
* This version is released under the CPL (Common Public License) with
* the Graphviz distribution.
* A version is also available u... | |
Add a missing include guard | #include "ruby.h"
#include <osl/move.h>
extern VALUE cMove;
using namespace osl;
void rb_move_free(Move* ptr);
static VALUE rb_move_s_new(VALUE self);
void Init_move(void);
| #ifndef RBOSL_MOVE_H
#define RBOSL_MOVE_H
#include "ruby.h"
#include <osl/move.h>
extern VALUE cMove;
using namespace osl;
void rb_move_free(Move* ptr);
static VALUE rb_move_s_new(VALUE self);
void Init_move(void);
#endif /* RBOSL_MOVE_H */
|
Add OSF/1 to a pre-existing conditional compilation switch. | #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...
*/
#if defined(ULTRIX43)
#if defined(__cplusplus)
extern "C" {
#endif
#if defined(__STDC__) || defined(__cplusplus)
... | #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... |
Add constant test for congruence domain | // PARAM: --enable ana.int.congruence --disable ana.int.def_exc
// This test ensures that operations on constant congr. classes (i.e. classes of the form {k} : arbitrary integer k) yield concrete vals
int main() {
// basic arithmetic operators
int a = 1;
int b = 2;
int c = -1;
int d = -2;
asse... | |
Use numeric_limits<double>::lowest instead of numeric_limits<double>::min | // Copyright (c) 2020 The Orbit 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 ORBIT_GL_GRAPH_TRACK_H
#define ORBIT_GL_GRAPH_TRACK_H
#include <limits>
#include "ScopeTimer.h"
#include "Track.h"
class TimeGraph;
class Gra... | // Copyright (c) 2020 The Orbit 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 ORBIT_GL_GRAPH_TRACK_H
#define ORBIT_GL_GRAPH_TRACK_H
#include <limits>
#include "ScopeTimer.h"
#include "Track.h"
class TimeGraph;
class Gra... |
Update QT Py flash size | #define MICROPY_HW_BOARD_NAME "Adafruit QTPy RP2040"
#define MICROPY_HW_MCU_NAME "rp2040"
#define MICROPY_HW_NEOPIXEL (&pin_GPIO12)
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO25)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO24)
#define DEFAULT_SPI_BUS_SCK (&pin_GPIO6)
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO3)
#define DEFAULT_SP... | #define MICROPY_HW_BOARD_NAME "Adafruit QTPy RP2040"
#define MICROPY_HW_MCU_NAME "rp2040"
#define MICROPY_HW_NEOPIXEL (&pin_GPIO12)
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO25)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO24)
#define DEFAULT_SPI_BUS_SCK (&pin_GPIO6)
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO3)
#define DEFAULT_SP... |
Fix imgui include path in GLES renderer | // ImGui SDL2 binding with OpenGL ES 2
// You can copy and use unmodified imgui_impl_* files in your project.
// If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and
// ImGui_ImplXXXX_Shutdown().
// See main.cpp for an example of using this.
// h... | // ImGui SDL2 binding with OpenGL ES 2
// You can copy and use unmodified imgui_impl_* files in your project.
// If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and
// ImGui_ImplXXXX_Shutdown().
// See main.cpp for an example of using this.
// h... |
Remove an invalid copyright notice | // Copyright © 2015 Outware Mobile. All rights reserved.
#import <Foundation/Foundation.h>
FOUNDATION_EXPORT double RegexVersionNumber;
FOUNDATION_EXPORT const unsigned char RegexVersionString[];
| #import <Foundation/Foundation.h>
FOUNDATION_EXPORT double RegexVersionNumber;
FOUNDATION_EXPORT const unsigned char RegexVersionString[];
|
Update Resource with latest changes to FPLBase. | // Copyright 2015 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable... | // Copyright 2015 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable... |
Fix test added in r321992 failing on some buildbots. | // RUN: %clang_cc1 -triple x86_64-unknown %s -S -o - | FileCheck %s --check-prefix=CHECK-ABSENT
// CHECK-ABSENT-NOT: section .stack_sizes
// RUN: %clang_cc1 -triple x86_64-unknown -fstack-size-section %s -S -o - | FileCheck %s --check-prefix=CHECK-PRESENT
// CHECK-PRESENT: section .stack_sizes
int foo() { return 42; ... | // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -S -o - | FileCheck %s --check-prefix=CHECK-ABSENT
// CHECK-ABSENT-NOT: section .stack_sizes
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fstack-size-section %s -S -o - | FileCheck %s --check-prefix=CHECK-PRESENT
// CHECK-PRESENT: section .stack_sizes
int foo... |
Add IWYU tags to headers TF is re-exporting. | /* Copyright 2015 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 2015 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... |
Reimplement no-op version of DLOG to avoid C++ compiler warning | #pragma once
#include <iostream>
// The same as assert, but expression is always evaluated and result returned
#define CHECK(expr) (assert(expr), expr)
#if !defined(NDEBUG) // Debug
namespace dev
{
namespace evmjit
{
std::ostream& getLogStream(char const* _channel);
}
}
#define DLOG(CHANNEL) ::dev::evmjit::getLo... | #pragma once
#include <iostream>
// The same as assert, but expression is always evaluated and result returned
#define CHECK(expr) (assert(expr), expr)
#if !defined(NDEBUG) // Debug
namespace dev
{
namespace evmjit
{
std::ostream& getLogStream(char const* _channel);
}
}
#define DLOG(CHANNEL) ::dev::evmjit::getLo... |
Bring other get_pointer instances into the scope | /*ckwg +5
* Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
* KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
* Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
*/
#ifndef VISTK_PYTHON_HELPERS_PYTHON_WRAP_CONST_SHARED_PTR_H
#define VISTK_PYTHON_HELPERS_PYTH... | /*ckwg +5
* Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
* KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
* Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
*/
#ifndef VISTK_PYTHON_HELPERS_PYTHON_WRAP_CONST_SHARED_PTR_H
#define VISTK_PYTHON_HELPERS_PYTH... |
Fix missing string in namespace std compiler error | #ifndef WINDOW_H
#define WINDOW_H
#include <ncurses.h>
#include <array>
#include "../game.h"
// Used to define a datatype for calls to wborder
struct Border {
chtype ls, rs, ts, bs;
chtype tl, tr, bl, br;
};
class Window {
public:
Window(rect dim); // ctor
~Window(); // dtor
... | #ifndef WINDOW_H
#define WINDOW_H
#include <ncurses.h>
#include <string>
#include <array>
#include "../game.h"
// Used to define a datatype for calls to wborder
struct Border {
chtype ls, rs, ts, bs;
chtype tl, tr, bl, br;
};
class Window {
public:
Window(rect dim); // ctor
~Window(); ... |
Add test that by default signed overflow results in top | #include<stdio.h>
#include<assert.h>
int main() {
int i,k,j;
if (k == 5) {
assert(k == 5);
return 0;
}
assert(k != 5);
// Signed overflows might occur in some of the following operations (e.g. the first assignment k could be MAX_INT).
// Signed overflows are undefined behavior, so by default we g... | |
Declare the class TPython instead of the static functions. With this change, make map will add TPython in system.rootmap and it is possible to do directly root > TPython::Prompt() | #ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ function TPython::Exec;
#pragma link C++ function TPython::Eval;
#pragma link C++ function TPython::Bind;
#pragma link C++ function TPython::Prompt;
#endif
| #ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class TPython;
#endif
|
Add spinlock model for DEC C compiler | /*
* Copyright (C) 2016 Alexander Saprykin <xelfium@gmail.com>
*
* 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 License, or
* (at your option) any later ver... | |
Fix missing parenthesis in abs() | #ifndef __STDLIB_H__
#define __STDLIB_H__
#include <types.h>
#define abs(ival) (ival < 0? -ival : ival)
void *malloc(size_t size);
void free(void *addr);
struct task;
void __free(void *addr, struct task *task);
void *memcpy(void *dst, const void *src, size_t len);
void *memset(void *src, int c, size_t len);
#endi... | #ifndef __STDLIB_H__
#define __STDLIB_H__
#include <types.h>
#define abs(ival) ((ival) < 0? -(ival) : (ival))
void *malloc(size_t size);
void free(void *addr);
struct task;
void __free(void *addr, struct task *task);
void *memcpy(void *dst, const void *src, size_t len);
void *memset(void *src, int c, size_t len);
... |
Fix an error on linux | #ifndef LOG_H
#define LOG_H
enum log_level {
LOG_LEVEL_DEBUG = 10,
LOG_LEVEL_MSG = 20,
LOG_LEVEL_WARN = 30,
LOG_LEVEL_ERR = 40
};
void set_log_level(enum log_level threshold);
void log_debug(const char *fmt, ...);
void log_msg(const char *fmt, ...);
void log_warn(const char *fmt, ...);
void log_... | #ifndef LOG_H
#define LOG_H
#include <stdarg.h>
enum log_level {
LOG_LEVEL_DEBUG = 10,
LOG_LEVEL_MSG = 20,
LOG_LEVEL_WARN = 30,
LOG_LEVEL_ERR = 40
};
void set_log_level(enum log_level threshold);
void log_debug(const char *fmt, ...);
void log_msg(const char *fmt, ...);
void log_warn(const char ... |
Fix the sep and esep attributes to allow additive margins in addition to scaled margins. | /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (... | /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (... |
Disable FASTCALL on Windows since it turned out not to be as effective as hoped. Leaving the definition in the file so we'll know what it was that didn't work, and hopefully find something better in the future. | /* internal.h
Internal definitions used by Expat. This is not needed to compile
client code.
The following definitions are made:
FASTCALL -- Used for most internal functions to specify that the
fastest possible calling convention be used.
inline -- Used for selected internal functio... | /* internal.h
Internal definitions used by Expat. This is not needed to compile
client code.
The following definitions are made:
FASTCALL -- Used for most internal functions to specify that the
fastest possible calling convention be used.
inline -- Used for selected internal functio... |
Add example from website as skipped test | // SKIP PARAM: --sets ana.activated[+] var_eq --sets ana.activated[+] region --sets ana.activated[+] var_eq --enable exp.region-offsets
#include <pthread.h>
int data[10];
pthread_mutex_t mutexes[10];
void safe_inc(int i) {
pthread_mutex_lock(&mutexes[i]);
data[i]++; // RACE
pthread_mutex_unlock(&mutexes[i]);
}... | |
Test program for duplicating sockets in windows | #include <winsock2.h>
#include <assert.h>
#define sassert assert
void dump() {
int err;
LPTSTR buf;
err = WSAGetLastError();
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, &buf, 0, NULL);
printf("%d %s\n", err, buf);
LocalFree(buf);
}
int main() {
SOCKET s1, s2, s1d, ... | |
Use fpl_null instead of NULL in console demo | /*
-------------------------------------------------------------------------------
Name:
FPL-Demo | Console
Description:
A Hello-World Console Application testing Console Output/Input
Requirements:
No requirements
Author:
Torsten Spaete
Changelog:
## 2018-04-23:
- Initial creation of this description block
- Cha... | /*
-------------------------------------------------------------------------------
Name:
FPL-Demo | Console
Description:
A Hello-World Console Application testing Console Output/Input
Requirements:
No requirements
Author:
Torsten Spaete
Changelog:
## 2018-04-23:
- Initial creation of this description block
- Cha... |
Use the -emit-llvm switch to generate LLVM assembly that can be parsed by the test case. | // RUN: %llvmgcc %s -S -o - | llvm-as | llvm-dis | grep llvm.used | grep foo | grep X
int X __attribute__((used));
int Y;
void foo() __attribute__((used));
void foo() {}
| // RUN: %llvmgcc %s -S -emit-llvm -o - | llvm-as | llvm-dis | grep llvm.used | grep foo | grep X
int X __attribute__((used));
int Y;
void foo() __attribute__((used));
void foo() {}
|
Fix for impicit conversions from double to int and vise versa. | #ifndef FIBONACCI_H
#define FIBONACCI_H
#include "../function.h"
namespace BuiltIn {
namespace Optimization {
// Class for finding minimum of function with Fibonacci method
class Fibonacci : public Function
{
public:
Fibonacci();
Rpn::Operand calculate(FunctionCalculator *calculator, QList<Rpn::Operand> actualArg... | #ifndef FIBONACCI_H
#define FIBONACCI_H
#include "../function.h"
namespace BuiltIn {
namespace Optimization {
// Class for finding minimum of function with Fibonacci method
class Fibonacci : public Function
{
public:
Fibonacci();
Rpn::Operand calculate(FunctionCalculator *calculator, QList<Rpn::Operand> actualArg... |
Update client version number and set false for prerelease | #ifndef CLIENTVERSION_H
#define CLIENTVERSION_H
//
// client versioning and copyright year
//
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 8
#define CLIENT_VERSION_REVISION 7
#define CLIENT_VERSION_BUILD ... | #ifndef CLIENTVERSION_H
#define CLIENTVERSION_H
//
// client versioning and copyright year
//
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 0
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD ... |
Add a file that was required for building jansson from CMake. | /*
* Copyright (c) 2010-2012 Petri Lehtinen <petri@digip.org>
*
* Jansson is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*
*
* This file specifies a part of the site-specific configuration for
* Jansson, namely those things that affect t... | |
Move include within include guards. | /**
* For conditions of distribution and use, see copyright notice in license.txt
*
* @file WorldLogicInterface.h
* @brief
*/
#include "ServiceInterface.h"
#ifndef incl_Interfaces_WorldLogicInterface_h
#define incl_Interfaces_WorldLogicInterface_h
#include "ForwardDefines.h"
#include <QObject>
class QS... | /**
* For conditions of distribution and use, see copyright notice in license.txt
*
* @file WorldLogicInterface.h
* @brief
*/
#ifndef incl_Interfaces_WorldLogicInterface_h
#define incl_Interfaces_WorldLogicInterface_h
#include "ServiceInterface.h"
#include "ForwardDefines.h"
#include <QObject>
class QSt... |
Change macro to let user choose output stream | #ifndef lilthumb
#define lilthumb
#include <ctime>
namespace lilthumb{
std::string timeString()
{
time_t rawtime;
struct tm * timeinfo;
char buffer[80];
time (&rawtime);
timeinfo = localtime(&rawtime);
strftime(buffer,80,"%d-%m-%Y %I:%M:%S",timeinfo);
std::string str(buffer);
return str;
}
}
#defin... | #ifndef lilthumb
#define lilthumb
#include <ctime>
namespace lilthumb{
std::string timeString()
{
time_t rawtime;
struct tm * timeinfo;
char buffer[80];
time (&rawtime);
timeinfo = localtime(&rawtime);
strftime(buffer,80,"%d-%m-%Y %I:%M:%S",timeinfo);
std::string str(buffer);
return str;
}
}
#defi... |
Break lines properly on serial console. | #include <proto/dos.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <exec/execbase.h>
#include <graphics/gfxbase.h>
#include "system/check.h"
bool SystemCheck() {
bool kickv40 = SysBase->LibNode.lib_Version >= 40;
bool chipaga = GfxBase->ChipRevBits0 & (GFXF_AA_ALICE|GFXF_AA_LISA);
bool cpu68040... | #include <proto/dos.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <exec/execbase.h>
#include <graphics/gfxbase.h>
#include "system/check.h"
bool SystemCheck() {
bool kickv40 = SysBase->LibNode.lib_Version >= 40;
bool chipaga = GfxBase->ChipRevBits0 & (GFXF_AA_ALICE|GFXF_AA_LISA);
bool cpu68040... |
Use aligned alloc for test allocation. | #pragma once
#include "Jitter.h"
#define TEST_VERIFY(a) if(!(a)) { int* p = 0; (*p) = 0; }
class CTest
{
public:
virtual ~CTest() {}
virtual void Run() = 0;
virtual void Compile(Jitter::CJitter&) = 0;
#ifdef _MSC_VER
//Overload operator new and delete to make sure we get proper 16-byte ... | #pragma once
#include "AlignedAlloc.h"
#include "Jitter.h"
#define TEST_VERIFY(a) if(!(a)) { int* p = 0; (*p) = 0; }
class CTest
{
public:
virtual ~CTest() {}
virtual void Run() = 0;
virtual void Compile(Jitter::CJitter&) = 0;
void* operator new(size_t allocSize)
{
return framework_a... |
Exit when input line is empty | #include <stdio.h>
#include <string.h>
#include <math.h>
#include "calc.h"
#include "input.h"
int main(void)
{
while (1){
char input[65536];
double ans;
read_line(input);
if (strcmp(input, "exit") == 0 || strcmp(input, "quit") == 0){
break;
}
ans = calc... | #include <stdio.h>
#include <string.h>
#include <math.h>
#include "calc.h"
#include "input.h"
int main(void)
{
while (1){
char input[65536];
double ans;
read_line(input);
if (strlen(input) == 0 || strcmp(input, "exit") == 0 || strcmp(input, "quit") == 0){
break;
... |
Disable floating point exceptions on Borland compiler | #include <stdio.h>
#include <float.h>
int
main(int argc, char *argv[])
{
char *me;
float qnan, zero;
int i;
me = argv[0];
if (sizeof(float) != sizeof(int))
{
fprintf(stderr, "%s: MADNESS: sizeof(float)=%d != sizeof(int)=%d\n",
me, (int)sizeof(float), (int)sizeof(int));
return -1;
... | #include <stdio.h>
#include <float.h>
#if defined(__BORLANDC__)
# include <math.h>
# include <float.h>
#endif
int
main(int argc, char *argv[])
{
#if defined(__BORLANDC__)
// Disable floating point exceptions in Borland
_control87(MCW_EM, MCW_EM);
#endif // defined(__BORLANDC__)
char *me;
float qnan, zero;
... |
Use die and return instead of exiting. | #include <ugens.h>
#include <stdio.h>
/* these 3 defined in makegen.c */
extern double *farrays[];
extern int sizeof_farray[];
extern int f_goto[];
int
fsize(int genno)
/* returns the size of function number genno */
{
if(!sizeof_farray[f_goto[genno]]) {
fprintf(stderr,"fsize: You haven't allocated functi... | #include <ugens.h>
#include <stdio.h>
/* these 3 defined in makegen.c */
extern double *farrays[];
extern int sizeof_farray[];
extern int f_goto[];
/* returns the size of function number genno */
int
fsize(int genno)
{
if (!sizeof_farray[f_goto[genno]]) {
die("fsize", "You haven't allocated function %d yet!", g... |
Add LICENSE and source headers to any-sketch repo. | #ifndef SRC_MAIN_CC_ANY_SKETCH_UTIL_MACROS_H_
#define SRC_MAIN_CC_ANY_SKETCH_UTIL_MACROS_H_
#define RETURN_IF_ERROR(status) \
do { \
Status _status = (status); \
if (!_status.ok()) return _status; \
} while (0)
#endif // SRC_MAIN_CC_ANY_SKETCH_UTIL_MACROS_H_... | /*
* Copyright 2020 The Any Sketch Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law o... |
Modify the SHMT version to 1.0.1dev | #ifndef PHP_SHMT_H
#define PHP_SHMT_H
#define PHP_SHMT_EXTNAME "SHMT"
#define PHP_SHMT_EXTVER "1.0"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
extern zend_module_entry shmt_module_entry;
#define phpext_shmt_ptr &shmt_module_entry;
#endif /* PHP_SHMT_H */
| #ifndef PHP_SHMT_H
#define PHP_SHMT_H
#define PHP_SHMT_EXTNAME "SHMT"
#define PHP_SHMT_EXTVER "1.0.1dev"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
extern zend_module_entry shmt_module_entry;
#define phpext_shmt_ptr &shmt_module_entry;
#endif /* PHP_SHMT_H */
|
Change methods in DataStore to non-static anymore (it is alr a singleton) | #pragma once
#ifndef YOU_DATASTORE_DATASTORE_H_
#define YOU_DATASTORE_DATASTORE_H_
#include <deque>
#include <functional>
#include "boost/variant.hpp"
#include "task_typedefs.h"
#include "internal/operation.h"
#include "transaction.h"
namespace You {
namespace DataStore {
namespace UnitTests {}
class DataStore {
fr... | #pragma once
#ifndef YOU_DATASTORE_DATASTORE_H_
#define YOU_DATASTORE_DATASTORE_H_
#include <deque>
#include <functional>
#include "boost/variant.hpp"
#include "task_typedefs.h"
#include "internal/operation.h"
#include "transaction.h"
namespace You {
namespace DataStore {
namespace UnitTests {}
class DataStore {
fr... |
Add internal representation of a BuxtonKey | /*
* This file is part of buxton.
*
* Copyright (C) 2013 Intel Corporation
*
* buxton 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... | |
Add a more elaborate example of acc computation. | #include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv) {
const int sample = 10000;
size_t size = sample * sizeof(int);
int *restrict a1, *restrict a2, *restrict a3;
a1 = (int*) malloc(size);
a2 = (int*) malloc(size);
a3 = (int*) malloc(size);
int sum = 0;
int i;
#pragma acc data creat... | |
Use testing API instead of duplicating it | #include <gtk/gtk.h>
static void
test_type (GType t)
{
GtkWidget *w;
AtkObject *a;
if (g_type_is_a (t, GTK_TYPE_WIDGET))
{
w = (GtkWidget *)g_object_new (t, NULL);
a = gtk_widget_get_accessible (w);
g_assert (GTK_IS_ACCESSIBLE (a));
g_assert (gtk_accessible_get_widget (GTK_ACCESSIBL... | #include <gtk/gtk.h>
static void
test_type (GType t)
{
GtkWidget *w;
AtkObject *a;
if (g_type_is_a (t, GTK_TYPE_WIDGET))
{
w = (GtkWidget *)g_object_new (t, NULL);
a = gtk_widget_get_accessible (w);
g_assert (GTK_IS_ACCESSIBLE (a));
g_assert (gtk_accessible_get_widget (GTK_ACCESSIBL... |
Add global access to test subsystem | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundati... | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundati... |
Change IBOutlet attributes from readonly to weak | //
// SMViewController.h
// SMPageControl
//
// Created by Jerry Jones on 10/13/12.
// Copyright (c) 2012 Spaceman Labs. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "SMPageControl.h"
@interface SMViewController : UIViewController
@property (nonatomic, readonly) IBOutlet UIScrollView *scrollview;
@pro... | //
// SMViewController.h
// SMPageControl
//
// Created by Jerry Jones on 10/13/12.
// Copyright (c) 2012 Spaceman Labs. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "SMPageControl.h"
@interface SMViewController : UIViewController
@property (nonatomic, weak) IBOutlet UIScrollView *scrollview;
@propert... |
Update Copyright. Delete erroneous "Module Name" line. | /** @file
Header file that supports Framework extension to UEFI/PI for DXE modules.
This header file must include Framework extension definitions common to DXE
modules.
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made avai... | /** @file
Header file that supports Framework extension to UEFI/PI for DXE modules.
This header file must include Framework extension definitions common to DXE
modules.
Copyright (c) 2007-2009, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made availab... |
Remove simpleLanguageCode (unused and not implemented). | //
// This file is part of the Marble Desktop Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2006-2007 Torsten Rahn <tackat@kde.org>
// Copyright 2007 Inge Wallin <ingwa@kde.o... | //
// This file is part of the Marble Desktop Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2006-2007 Torsten Rahn <tackat@kde.org>
// Copyright 2007 Inge Wallin <ingwa@kde.o... |
Add empty dummy implementation of ifd handler | #include <ifdhandler.h>
| #include <ifdhandler.h>
#include <stdio.h>
RESPONSECODE IFDHCreateChannelByName(DWORD Lun, LPSTR DeviceName)
{
return IFD_NO_SUCH_DEVICE;
}
RESPONSECODE IFDHCreateChannel(DWORD Lun, DWORD Channel)
{
char buf[40];
snprintf(buf, sizeof(buf), "/dev/o2scr%d", Channel);
return IFDHCreateChannelByName(Lun, buf);
}
RE... |
Save program path before doing setprocname(). | #include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include "common.h"
static void reap(char *argv[]);
static pid_t spawn(char *argv[]);
extern void init(char *argv[]);
int main(int argc, char *argv[])
{
const char *name = getenv("PROCNAME");
if (name && *name)
setpro... | #include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include "common.h"
static void reap(char *argv[]);
static pid_t spawn(char *argv[]);
extern void init(char *argv[]);
const char *path;
int main(int argc, char *argv[])
{
path = strdup(argv[0]);
const ch... |
Add a little bit of c++ awareness to the main header | #include "generic.h"
#include "dict.h"
#include "vector.h"
#include "list.h"
#include "htbl.h"
#include "dsu.h"
#include "heap.h"
#include "bst.h"
#include "sort.h"
#include "heap.h"
#include "queue.h"
#include "mem.h"
#include "bitmap.h"
#include "string_utils.h"
#include "file_utils.h"
| #if defined(__cplusplus)
extern "C" {
#endif
#include "generic.h"
#include "dict.h"
#include "vector.h"
#include "list.h"
#include "htbl.h"
#include "dsu.h"
#include "heap.h"
#include "bst.h"
#include "sort.h"
#include "heap.h"
#include "queue.h"
#include "mem.h"
#include "bitmap.h"
#include "string_utils.h"
#include ... |
Make search results storable in database as metadata | #import <Foundation/Foundation.h>
@class MWKSearchResult;
@interface WMFRelatedSearchResults : NSObject
@property (nonatomic, strong, readonly) NSURL *siteURL;
@property (nonatomic, strong, readonly) NSArray<MWKSearchResult *> *results;
- (instancetype)initWithURL:(NSURL *)URL results:(NSArray *)results;
@end
| #import <Mantle/Mantle.h>
@class MWKSearchResult;
@interface WMFRelatedSearchResults : MTLModel
@property (nonatomic, strong, readonly) NSURL *siteURL;
@property (nonatomic, strong, readonly) NSArray<MWKSearchResult *> *results;
- (instancetype)initWithURL:(NSURL *)URL results:(NSArray *)results;
@end
|
Change indent to 4 spaces. | /*
* Copyright 2015, Wink Saville
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*/
#include <sel4/printf.h>
/**
* No parameters are passed to main, the return
* value is ignored a... | /*
* Copyright 2015, Wink Saville
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*/
#include <sel4/printf.h>
/**
* No parameters are passed to main, the return
* value is ignored a... |
Include the OS X specific header to use OS specific macros. | // Copyright 2013 by Tetsuo Kiso
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to ... | // Copyright 2013 by Tetsuo Kiso
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to ... |
Add BST Tree Root function declaration | #include <stdlib.h>
#ifndef __BST_H__
#define __BST_H__
struct BSTNode;
struct BST;
typedef struct BSTNode BSTNode;
typedef struct BST BST;
BST* BST_Create(void);
BSTNode* BSTNode_Create(void* k);
void BST_Inorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Preorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Postor... | #include <stdlib.h>
#ifndef __BST_H__
#define __BST_H__
struct BSTNode;
struct BST;
typedef struct BSTNode BSTNode;
typedef struct BST BST;
BST* BST_Create(void);
BSTNode* BSTNode_Create(void* k);
void BST_Inorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Preorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Postor... |
Add common header for library functions | #include "generic.h"
#include "dict.h"
#include "vector.h"
#include "list.h"
#include "htbl.h"
#include "dsu.h"
#include "bst.h"
#include "sort.h"
#include "heap.h"
#include "queue.h"
#include "mem.h"
#include "string_utils.h"
#include "file_utils.h"
| |
Update header include paths to support React Native 0.40 | #import "RCTBridgeModule.h"
@interface RNFlurryAnalytics : NSObject <RCTBridgeModule>
@end
| #import <React/RCTBridgeModule.h>
@interface RNFlurryAnalytics : NSObject <RCTBridgeModule>
@end
|
Install GDT and remove division by 0 | #include <stddef.h>
#include <stdint.h>
#include "./arch/x86/idt.h"
#include <terminal.h>
#include <kabort.h>
#include <kassert.h>
void kernel_main()
{
term_initialize();
idt_install();
kputs("Interrupt?");
int i = 0;
int b = 128;
int d = 1;
d = b / i;
while (1)
;
}
| #include <stddef.h>
#include <stdint.h>
#include "./arch/x86/gdt.h"
#include "./arch/x86/idt.h"
#include <terminal.h>
#include <kabort.h>
#include <kassert.h>
void kernel_main()
{
term_initialize();
gdt_install();
idt_install();
kputs("Hello kernel!");
while (1) {
};
}
|
Update for pragma syntax - Only unsupported on older versions of GCC | //
// TGGeoPoint.h
// tangram
//
// Created by Karim Naaji on 10/27/16.
//
//
#ifndef TGGeoPoint_h
#define TGGeoPoint_h
struct TGGeoPoint {
double longitude;
double latitude;
};
typedef struct TGGeoPoint TGGeoPoint;
static inline TGGeoPoint TGGeoPointMake(double lat, double lon)
{
TGGeoPoint p;
p... | //
// TGGeoPoint.h
// tangram
//
// Created by Karim Naaji on 10/27/16.
//
//
#pragma once
struct TGGeoPoint {
double longitude;
double latitude;
};
typedef struct TGGeoPoint TGGeoPoint;
static inline TGGeoPoint TGGeoPointMake(double lat, double lon)
{
TGGeoPoint p;
p.latitude = lat;
p.longit... |
Fix typo dmx_out instead of dmx_in | #include "usbdmx.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char ** argv) {
int result;
int set_value;
int count = 0;
TDMXArray dmx_out;
TDMXArray dmx_in;
// Open Interface in Mode 6 (PC Out -> DMX Out & DMX In -> PC In)
// See head of this file for ... | #include "usbdmx.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char ** argv) {
int result;
int set_value;
int count = 0;
TDMXArray dmx_out;
TDMXArray dmx_in;
// Open Interface in Mode 6 (PC Out -> DMX Out & DMX In -> PC In)
// See head of this file for ... |
Add macro MODE and MODE_DEV, MODE_TESTFLIGHT, MODE_DISTRIBUTION | #if defined TESTFLIGHT
#define TESTFLIGHT YES
#define DISTRIBUTION NO
#elif defined DEBUG
#define TESTFLIGHT NO
#define DISTRIBUTION NO
#else
#define TESTFLIGHT NO
#define DISTRIBUTION YES
#endif
#define CLIP(X,min,max) MIN(MAX(X, min), max)
#define white [UIColor whiteColor]
#define yellow [UIColor yellowColor]
#def... | #define MODE_DEV 1
#define MODE_TESTFLIGHT 2
#define MODE_DISTRIBUTION 3
#if defined TESTFLIGHT
#define MODE MODE_TESTFLIGHT
#elif defined DEBUG
#define MODE MODE_DEV
#else
#define MODE MODE_DISTRIBUTION
#endif
#define IS_DISTRIBUTION (MODE == MODE_DISTRIBUTION)
#define CLIP(X,min,max) MIN(MAX(X, min), ma... |
Fix wrong result caused by newline character. | #include <X11/Xft/Xft.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>
#include <fontconfig/fontconfig.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char** argv) {
if (argc < 3) {
printf("xftwidth font string\n");
return 1;
}
Display *dpy;
XftFont *fn;
... | #include <X11/Xft/Xft.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>
#include <fontconfig/fontconfig.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char** argv) {
if (argc < 3) {
printf("xftwidth font string\n");
return 1;
}
Display *dpy;
XftFont *fn;
... |
Add comment describing semantics of return value from SlimeFillerFilter::get_filter(). | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/stllike/hash_map.h>
#include <optional>
namespace search::docsummary {
/*
* Class filtering which fields to render in a struct fi... | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/stllike/hash_map.h>
#include <optional>
namespace search::docsummary {
/*
* Class filtering which fields to render in a struct fi... |
Add missing math.h include for M_PHI definition | #ifndef LAGER_COMMON_SPHERICAL_COORDINATES_H
#define LAGER_COMMON_SPHERICAL_COORDINATES_H
/*
* Code based on:
* http://stackoverflow.com/questions/17016175/c-unordered-map-using-a-custom-class-type-as-the-key
*/
struct SphericalCoordinates {
int phi;
int theta;
bool operator==(const SphericalCoordinates &other)... | #ifndef LAGER_COMMON_SPHERICAL_COORDINATES_H
#define LAGER_COMMON_SPHERICAL_COORDINATES_H
#include <math.h>
/*
* Code based on:
* http://stackoverflow.com/questions/17016175/c-unordered-map-using-a-custom-class-type-as-the-key
*/
struct SphericalCoordinates {
int phi;
int theta;
bool operator==(const Spherical... |
Include what you need as gcc 6 provides less. | // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/document/annotation/span.h>
#include <vespa/document/serialization/util.h>
namespace vespalib {
class nbostream;
}
namespace document {
class AlternateSpanList;
class An... | // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/document/annotation/span.h>
#include <vespa/document/serialization/util.h>
#include <vector>
namespace vespalib {
class nbostream;
}
namespace document {
class Alternate... |
Add a Debug shmemlog tag. | /*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(Request)
SLTM(URL)
SLTM(Protocol)
SLTM(HD_Unknown)
SLTM(HD_Lost)
#define HTTPH(a, b, c, d, e, f, g) SL... | /*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(Debug)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(Request)
SLTM(URL)
SLTM(Protocol)
SLTM(HD_Unknown)
SLTM(HD_Lost)
#define HTTPH(a, b, c, d,... |
Fix build under node.js 0.10.0 | #ifndef __COMMON_H__
#define __COMMON_H__
#if NODE_VERSION_AT_LEAST(0,11,0)
#define __NODE_V0_11__
#endif
#endif
| #ifndef __COMMON_H__
#define __COMMON_H__
#ifdef NODE_VERSION_AT_LEAST
#if NODE_VERSION_AT_LEAST(0,11,0)
#define __NODE_V0_11__
#endif
#endif
#endif
|
Add thread safe queue class | // Copyright (c) 2017 Shift Devices AG
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef LIBDBB_SAFEQUEUE_H
#define LIBDBB_SAFEQUEUE_H
#include <stdint.h>
#include <stdlib.h>
#include <atomic>
#include <queue>
#include <... | |
Remove unnecessarily public method from interface | //
// NSManagedObject+JSONHelpers.h
//
// Created by Saul Mora on 6/28/11.
// Copyright 2011 Magical Panda Software LLC. All rights reserved.
//
#import <CoreData/CoreData.h>
extern NSString * const kMagicalRecordImportCustomDateFormatKey;
extern NSString * const kMagicalRecordImportDefaultDateFormatString;
extern... | //
// NSManagedObject+JSONHelpers.h
//
// Created by Saul Mora on 6/28/11.
// Copyright 2011 Magical Panda Software LLC. All rights reserved.
//
#import <CoreData/CoreData.h>
extern NSString * const kMagicalRecordImportCustomDateFormatKey;
extern NSString * const kMagicalRecordImportDefaultDateFormatString;
extern... |
Replace strchr() condition with TrimSuffixC(). | #include <h/mh.h>
const char *
read_line(void)
{
char *cp;
static char line[BUFSIZ];
fflush(stdout);
if (fgets(line, sizeof(line), stdin) == NULL)
return NULL;
if ((cp = strchr(line, '\n')))
*cp = 0;
return line;
}
| #include <h/mh.h>
#include <h/utils.h>
const char *
read_line(void)
{
static char line[BUFSIZ];
fflush(stdout);
if (fgets(line, sizeof(line), stdin) == NULL)
return NULL;
TrimSuffixC(line, '\n');
return line; /* May not be a complete line. */
}
|
Fix compilation issue on arm64 with Debian's glibc 2.19 | // Copyright 2018 The Crashpad 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 ... | // Copyright 2018 The Crashpad 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 ... |
Add test case on struct initialization and assignment | /* From Listing 3 in "Test-Case Reduction for C Compiler Bugs" paper, avaiable
* at http://www.cs.utah.edu/~regehr/papers/pldi12-preprint.pdf.
*/
int printf (const char *, ...);
struct {
int f0;
int f1;
int f2;
} a, b = { 0, 0, 1 };
void fn1 () {
a = b;
a = a;
}
int main () {
fn1 ();
printf ("%d\n", a.f2);
... | |
Add IR sensor debugging program, using robotc API | #pragma config(Sensor, S1, ir, sensorHiTechnicIRSeeker600)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main() {
while (true) {
nxtDisplayTextLine(0, "S:%d", SensorValue[ir]);
nxtDisplayTextLine(1, "R:%d", SensorRaw[ir]);
}
}
| |
Add a noop for upgrade so we don't get the warning. | #include <erl_nif.h>
static ERL_NIF_TERM kinit(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
return enif_make_atom(env, "true");
}
static ErlNifFunc nif_funcs[] = {
{"kinit", 2, kinit}
};
ERL_NIF_INIT(kinit, nif_funcs, NULL, NULL, NULL, NULL)
| #include <erl_nif.h>
static ERL_NIF_TERM kinit(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) {
return enif_make_atom(env, "true");
}
int noop(ErlNifEnv* env, void** priv_data, void** old_priv_data, ERL_NIF_TERM load_info) {
return 0;
}
static ErlNifFunc nif_funcs[] = {
{"kinit", 2, kinit}
};
ERL_... |
Move some globals to globals.h. | #include <stdio.h>
extern int print_is_on;
double m_open(float *, short, double *);
double
m_input(float *p,short n_args,double *pp)
{
p[1] = (n_args > 1) ? p[1] : 0.;
p[2] = 0;
n_args = 3;
if(print_is_on)
fprintf(stderr,"Opening input file as unit %d\n",(int)p[1]);
return m_open(p,n_args,pp);
}
double
m_outp... | #include <globals.h>
#include <stdio.h>
extern double m_open(float *, short, double *);
double
m_input(float *p,short n_args,double *pp)
{
p[1] = (n_args > 1) ? p[1] : 0.;
p[2] = 0;
n_args = 3;
if(print_is_on)
fprintf(stderr,"Opening input file as unit %d\n",(int)p[1]);
return m_open(p,n_args,pp);
}
double
m_... |
Add Qadeer record init example | typedef struct list {
struct list *next;
struct list *prev;
} list_t;
typedef struct record {
int data1;
list_t node;
int data2;
} record_t;
#define container(p) ((record_t*)((int*)(p) - 1))
void init_record(list_t *p) {
record_t *r = container(p);
r->data2 = 42;
}
void init_all... | |
Add a space to the terminating array entry | #include "flags.h"
#include <stdio.h>
#include "laco.h"
#include "util.h"
static const char* version_matches[] = {"-v", "--version", NULL};
static const char* help_matches[] = {"-h", "-?", "--help", NULL};
/* Print off the current version of laco */
static void handle_version(LacoState* laco, const char** argume... | #include "flags.h"
#include <stdio.h>
#include "laco.h"
#include "util.h"
static const char* version_matches[] = {"-v", "--version", NULL};
static const char* help_matches[] = {"-h", "-?", "--help", NULL};
/* Print off the current version of laco */
static void handle_version(LacoState* laco, const char** argume... |
Make serr and sout mutable to use them in const methods | /**
* log.h - Header of log class
* includes 2 methods to show warrnings and errors
* @author Pavel Kryukov
* Copyright 2017 MIPT-MIPS team
*/
#ifndef LOG_H
#define LOG_H
#include <iostream>
#include <ostream>
class LogOstream
{
const bool enable;
std::ostream& stream;
public:
struct Critical { };
... | /**
* log.h - Header of log class
* includes 2 methods to show warrnings and errors
* @author Pavel Kryukov
* Copyright 2017 MIPT-MIPS team
*/
#ifndef LOG_H
#define LOG_H
#include <iostream>
#include <ostream>
class LogOstream
{
const bool enable;
std::ostream& stream;
public:
struct Critical { };
... |
Add hello world C example | /*******************************************************************************
* File : hw.c
* Author : Sandeep Koranne
*
* Purpose : Hello, World in C
*
******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello, Wo... | |
Switch to importing framework header | //
// MRHexKeyboard.h
//
// Created by Mikk Rätsep on 02/10/13.
// Copyright (c) 2013 Mikk Rätsep. All rights reserved.
//
@import UIKit;
@interface MRHexKeyboard : UIView <UITextFieldDelegate>
@property(nonatomic, assign) CGFloat height;
@property(nonatomic, assign) BOOL display0xButton;
@property(nonatomic, a... | //
// MRHexKeyboard.h
//
// Created by Mikk Rätsep on 02/10/13.
// Copyright (c) 2013 Mikk Rätsep. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MRHexKeyboard : UIView <UITextFieldDelegate>
@property(nonatomic, assign) CGFloat height;
@property(nonatomic, assign) BOOL display0xButton;
@property(non... |
Revert "util: Always specify default visibility on exports." | //
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// util_export.h : Defines ANGLE_UTIL_EXPORT, a macro for exporting symbols.
#ifndef UTIL_EXPORT_H_
#define UTIL_EXPORT_H_
#if !defined(ANGLE_... | //
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// util_export.h : Defines ANGLE_UTIL_EXPORT, a macro for exporting symbols.
#ifndef UTIL_EXPORT_H_
#define UTIL_EXPORT_H_
#if !defined(ANGLE_... |
Add some sceAVConfig volume functions | /**
* \usergroup{SceAVConfig}
* \usage{psp2/avconfig.h,SceAVConfig_stub}
*/
#ifndef _PSP2_AVCONFIG_H_
#define _PSP2_AVCONFIG_H_
#include <psp2/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/***
* Get the maximum brightness.
*
* @param[out] maxBrightness - Maximum brightness.
*
* @return 0 on success, < 0... | /**
* \usergroup{SceAVConfig}
* \usage{psp2/avconfig.h,SceAVConfig_stub}
*/
#ifndef _PSP2_AVCONFIG_H_
#define _PSP2_AVCONFIG_H_
#include <psp2/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/***
* Get the maximum brightness.
*
* @param[out] maxBrightness - Maximum brightness.
*
* @return 0 on success, < 0... |
Fix typo phsyical => physical | //===--- CallingConvention.h - Calling conventions --------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LI... | //===--- CallingConvention.h - Calling conventions --------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.