Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Switch off CRT-effect off by default (until fixed) | #pragma once
//------------------------------------------------------------------------------
/**
@class UI
@brief imgui-based debugger UI
*/
#include "yakc/KC85Oryol.h"
#include "ui/WindowBase.h"
#include "ui/FileLoader.h"
#include "Time/TimePoint.h"
#include "Core/Containers/Array.h"
#include "IMUI/IMUI.h"
c... | #pragma once
//------------------------------------------------------------------------------
/**
@class UI
@brief imgui-based debugger UI
*/
#include "yakc/KC85Oryol.h"
#include "ui/WindowBase.h"
#include "ui/FileLoader.h"
#include "Time/TimePoint.h"
#include "Core/Containers/Array.h"
#include "IMUI/IMUI.h"
c... |
Add static header file for fiels struct |
typedef struct TrailDBMultiTrailFields {
long timestamp;
long num_items;
long items;
long db;
long multi_cur;
long cursor_idx;
} TrailDBMultiTrailFields;
typedef struct TrailDBTrailFields {
long timestamp;
long num_items;
long items;
long db;
long cur;
} TrailDBTrailFields;
| |
Add 'kai' to core name | #ifndef LRPARAMS_
#define LRPARAMS_
#include "np2ver.h"
#define LR_SCREENWIDTH 640
#define LR_SCREENHEIGHT 480
#define LR_SCREENASPECT 4.0 / 3.0
#define LR_SCREENFPS 56.4
#define LR_SOUNDRATE 44100.0
//#define SNDSZ 735 //44100Hz/60fps=735 (sample/flame)
#define SNDSZ 782 //44100Hz/56.4fps=781.9 (sample/flame... | #ifndef LRPARAMS_
#define LRPARAMS_
#include "np2ver.h"
#define LR_SCREENWIDTH 640
#define LR_SCREENHEIGHT 480
#define LR_SCREENASPECT 4.0 / 3.0
#define LR_SCREENFPS 56.4
#define LR_SOUNDRATE 44100.0
//#define SNDSZ 735 //44100Hz/60fps=735 (sample/flame)
#define SNDSZ 782 //44100Hz/56.4fps=781.9 (sample/flame... |
Add unit test class declaration and friend class it in DataStore | #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 {
pub... | #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 DataStoreApiTest;... |
Use a mock for class ZSearch | /*
* Copyright 2015 Samuel Ghineț
*
* 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 i... | /*
* Copyright 2015 Samuel Ghineț
*
* 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 i... |
Include SWIFT struct definitions directly from SWIFT. | /*! \file SwiftParticle.h
* \brief header file for the SWIFT particle type.
*/
#ifndef SWIFT_PARTICLE_H
#define SWIFT_PARTICLE_H
#define SWIFT_STRUCT_ALIGNMENT 32
#define SWIFT_STRUCT_ALIGN __attribute__((aligned(SWIFT_STRUCT_ALIGNMENT)))
namespace Swift
{
/* The different types of particles a #gpart can li... | /*! \file SwiftParticle.h
* \brief header file for the SWIFT particle type.
*/
#ifndef SWIFT_PARTICLE_H
#define SWIFT_PARTICLE_H
namespace Swift
{
/* Include some struct definitions from SWIFT. */
extern "C" {
#include "align.h"
#include "timeline.h"
#include "part_type.h"
#... |
Add prefix file for ProjectBuilder samples | /*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of sou... | |
Remove __restrict when not supported -Erik |
#ifndef __FEATURES_H
#define __FEATURES_H
/* Major and minor version number of the uCLibc library package. Use
these macros to test for features in specific releases. */
#define __UCLIBC__ 0
#define __UCLIBC_MAJOR__ 9
#define __UCLIBC_MINOR__ 1
#ifdef __STDC__
#define __P(x) x
#define __const const
/* Almo... |
#ifndef __FEATURES_H
#define __FEATURES_H
/* Major and minor version number of the uCLibc library package. Use
these macros to test for features in specific releases. */
#define __UCLIBC__ 0
#define __UCLIBC_MAJOR__ 9
#define __UCLIBC_MINOR__ 1
/* __restrict is known in EGCS 1.2 and above. */
#if !defined __G... |
Add linear equations system class template | #pragma once
#include "polynomial.h"
template <typename Polytype>
class linear_equation_system : public std::vector<Polytype> {
std::vector<Polytype> rows;
linear_equation_system reduced_echelon_form() const {
std::vector<Polytype> nrows(*this);
/* make sure rows are sorted with the left-most elements a... | |
Add a fuzzy comparison macro | #include <glib.h>
#if !GLIB_CHECK_VERSION (2, 40, 0)
# define g_assert_true(expr) g_assert ((expr))
# define g_assert_false(expr) g_assert (!(expr))
# define g_assert_null(expr) g_assert ((expr) == NULL)
# define g_assert_nonnull(expr) g_assert ((expr) != NULL)
#endif
| #include <glib.h>
#if !GLIB_CHECK_VERSION (2, 40, 0)
# define g_assert_true(expr) g_assert ((expr))
# define g_assert_false(expr) g_assert (!(expr))
# define g_assert_null(expr) g_assert ((expr) == NULL)
# define g_assert_nonnull(expr) g_assert ((expr) != NULL)
#endif
#define g... |
Add newline to make compiler happy. | #include "tclMatrix.h"
int Matrix_Init (Tcl_Interp*);
int Matrix_Init( Tcl_Interp *interp ) {
/* matrix -- matrix support command */
Tcl_CreateCommand(interp, "matrix", Tcl_MatrixCmd,
(ClientData) NULL, (void (*)(ClientData)) NULL);
Tcl_PkgProvide(interp, "Matrix", "0.1");
return TCL_OK;
} | #include "tclMatrix.h"
int Matrix_Init (Tcl_Interp*);
int Matrix_Init( Tcl_Interp *interp ) {
/* matrix -- matrix support command */
Tcl_CreateCommand(interp, "matrix", Tcl_MatrixCmd,
(ClientData) NULL, (void (*)(ClientData)) NULL);
Tcl_PkgProvide(interp, "Matrix", "0.1");
return TCL_OK;
}
|
Add BaseClusterInfo for base implementation | /*
* nextpnr -- Next Generation Place and Route
*
* Copyright (C) 2021 gatecat <gatecat@ds0.me>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all c... | |
Add a test case for reduction of 2D grids. | /*
* TEST: Grid reduction OP=PS_SUM
* DIM: 2
* PRIORITY: 1
*/
#include <stdio.h>
#include <stdlib.h>
#include "physis/physis.h"
#define N 4
#define REAL double
#define PSGrid2D PSGrid2DDouble
#define PSGrid2DNew PSGrid2DDoubleNew
REAL reduce(REAL *g) {
REAL v = 0.0;
int i;
for (i = 0; i < N*N; ++i) {
v... | |
Allow to override SSL_LIB during build | /*
* Copyright (c) 2004-2007 Sergey Lyubka <valenok@gmail.com>
* All rights reserved
*
* "THE BEER-WARE LICENSE" (Revision 42):
* Sergey Lyubka wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can ... | /*
* Copyright (c) 2004-2007 Sergey Lyubka <valenok@gmail.com>
* All rights reserved
*
* "THE BEER-WARE LICENSE" (Revision 42):
* Sergey Lyubka wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can ... |
Make this work with the ICC compiler, contributed by Bjørn Wennberg | //===- llvm/System/Unix/Unix.h - Common Unix Include File -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by Reid Spencer and is distributed under the
// University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===------------------... | //===- llvm/System/Unix/Unix.h - Common Unix Include File -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by Reid Spencer and is distributed under the
// University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===------------------... |
Include some additional header files. Fix the banner length. | //===- llvm/System/Unix/Unix.h - Common Unix Include File -----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by Reid Spencer and is distributed under the
// University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===--------------------... | //===- llvm/System/Unix/Unix.h - Common Unix Include File -------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by Reid Spencer and is distributed under the
// University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===------------------... |
Use a dummy target so the test passes when default target is for a toolchain implements useIntegratedAs() -> true | // RUN: %clang -### -c -save-temps -integrated-as %s 2>&1 | FileCheck %s
// CHECK: cc1as
// CHECK: -mrelax-all
// RUN: %clang -### -fintegrated-as -c -save-temps %s 2>&1 | FileCheck %s -check-prefix FIAS
// FIAS: cc1as
// RUN: %clang -### -fno-integrated-as -S %s 2>&1 \
// RUN: | FileCheck %s -check-prefix NOFI... | // RUN: %clang -### -c -save-temps -integrated-as %s 2>&1 | FileCheck %s
// CHECK: cc1as
// CHECK: -mrelax-all
// RUN: %clang -### -fintegrated-as -c -save-temps %s 2>&1 | FileCheck %s -check-prefix FIAS
// FIAS: cc1as
// RUN: %clang -target none -### -fno-integrated-as -S %s 2>&1 \
// RUN: | FileCheck %s -chec... |
Fix a SIMD instruction mistake that regarding integer rounding. |
#ifndef __EFFEKSEER_SIMD_BRIDGE_SSE_H__
#define __EFFEKSEER_SIMD_BRIDGE_SSE_H__
#include "Float4_SSE.h"
#include "Int4_SSE.h"
#include "Base.h"
#if defined(EFK_SIMD_SSE2)
namespace Effekseer
{
namespace SIMD
{
inline Int4 Float4::Convert4i() const { return _mm_cvtps_epi32(s); }
inline Int4 Float4::Cast4i() con... |
#ifndef __EFFEKSEER_SIMD_BRIDGE_SSE_H__
#define __EFFEKSEER_SIMD_BRIDGE_SSE_H__
#include "Float4_SSE.h"
#include "Int4_SSE.h"
#include "Base.h"
#if defined(EFK_SIMD_SSE2)
namespace Effekseer
{
namespace SIMD
{
inline Int4 Float4::Convert4i() const { return _mm_cvttps_epi32(s); }
inline Int4 Float4::Cast4i() co... |
Add the spidermonkey prototype We need to generate the bindings dynamically at least for the properties until ender have support for real functions. On spidermonkey the objects are created using a class and a prototype, we need to figure out how to match an idl interface with such scheme. Then wrapping ender properties... | /* Esvg - SVG
* Copyright (C) 2012 Jorge Luis Zapata
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*... | |
Fix for AC Name type adherence to rfc1123 | #pragma once
#include <regex>
#include "appc/schema/common.h"
namespace appc {
namespace schema {
const unsigned int max_ac_name_length = 512;
template<typename T>
struct ACName : StringType<T> {
explicit ACName<T>(const std::string& name)
: StringType<T>(name) {}
virtual Status validate() const {
if... | #pragma once
#include <regex>
#include "appc/schema/common.h"
namespace appc {
namespace schema {
const unsigned int max_ac_name_length = 512;
template<typename T>
struct ACName : StringType<T> {
explicit ACName<T>(const std::string& name)
: StringType<T>(name) {}
virtual Status validate() const {
if... |
Use march=pentium3 to use if-conv |
int f(int a, int b) {
return a && b ? 11 : 42;
}
int x = 2, y = 3;
int main(void) {
int ret = 23 < f(x,y);
printf("%d\n", ret);
return ret;
}
| /*$ -march=pentium3 $*/
int f(int a, int b) {
return a && b ? 11 : 42;
}
int x = 2, y = 3;
int main(void) {
int ret = 23 < f(x,y);
printf("%d\n", ret);
return ret;
}
|
Use a function_ref now that it works (r221753). | //===- Linker.h - Module Linker Interface -----------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===- Linker.h - Module Linker Interface -----------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Remove header declared but not defined | /*
*
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either vers... | /*
*
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either vers... |
Make the linker happy about these functions | // Copyright 2015-present 650 Industries. All rights reserved.
#import "RCTLog.h"
RCTLogFunction EXDefaultRCTLogFunction;
// EXFrame will use this when the manifest indicates we should enable developer debugging
// Kernel will use this when (DEBUG == 1)
RCTLogFunction EXDeveloperRCTLogFunction;
RCTLogFunction EXGet... | // Copyright 2015-present 650 Industries. All rights reserved.
#import "RCTLog.h"
extern RCTLogFunction EXDefaultRCTLogFunction;
// EXFrame will use this when the manifest indicates we should enable developer debugging
// Kernel will use this when (DEBUG == 1)
extern RCTLogFunction EXDeveloperRCTLogFunction;
extern... |
Remove lily_deref_list_val_by. This is a relic from the circle_buster era. | #ifndef LILY_VALUE_H
# define LILY_VALUE_H
# include "lily_syminfo.h"
lily_method_val *lily_try_new_method_val();
lily_object_val *lily_try_new_object_val();
lily_hash_val *lily_try_new_hash_val();
lily_hash_elem *lily_try_new_hash_elem();
void lily_deref_method_val(lily_method_val *);
void lily_deref_str_val(lily_s... | #ifndef LILY_VALUE_H
# define LILY_VALUE_H
# include "lily_syminfo.h"
lily_method_val *lily_try_new_method_val();
lily_object_val *lily_try_new_object_val();
lily_hash_val *lily_try_new_hash_val();
lily_hash_elem *lily_try_new_hash_elem();
void lily_deref_method_val(lily_method_val *);
void lily_deref_str_val(lily_s... |
Set removed item's prev/next pointers to NULL. | #ifndef LLIST_H
#define LLIST_H
/* Doubly linked list */
#define DLLIST_PREPEND(list, item) STMT_START { \
(item)->prev = NULL; \
(item)->next = *(list); \
if (*(list) != NULL) (*(list))->prev = (item); \
*(list) = (item); \
} STMT_END
#define DLLIST_REMOVE(list, item) STMT_START { \
if ((item)->prev == NULL) \... | #ifndef LLIST_H
#define LLIST_H
/* Doubly linked list */
#define DLLIST_PREPEND(list, item) STMT_START { \
(item)->prev = NULL; \
(item)->next = *(list); \
if (*(list) != NULL) (*(list))->prev = (item); \
*(list) = (item); \
} STMT_END
#define DLLIST_REMOVE(list, item) STMT_START { \
if ((item)->prev == NULL) \... |
Add clarifying test about addition by concatenation | #include <stdlib.h>
#include <check.h>
#include "../src/roman_calculator.h"
void verify_addition(const char *left, const char *right, const char *expected_result) {
char *actual_result = roman_calculator_add(left, right);
ck_assert_msg(
strcmp(expected_result, actual_result) == 0,
"%s + %s: expected %s, but w... | #include <stdlib.h>
#include <check.h>
#include "../src/roman_calculator.h"
void verify_addition(const char *left, const char *right, const char *expected_result) {
char *actual_result = roman_calculator_add(left, right);
ck_assert_msg(
strcmp(expected_result, actual_result) == 0,
"%s + %s: expected %s, but w... |
Allow objects to be tagged with canaries that can be destructed globally | #include <kotaka/privilege.h>
#include <kotaka/paths.h>
#include <kotaka/log.h>
#include <trace.h>
#include <type.h>
#include <status.h>
inherit "call_guard";
inherit "callout_guard";
inherit "touch";
inherit "object";
object objd_canary;
/**********/
/* status */
/**********/
nomask void _F_dummy()
{
}
| #include <kotaka/privilege.h>
#include <kotaka/paths.h>
#include <kotaka/log.h>
#include <trace.h>
#include <type.h>
#include <status.h>
inherit "call_guard";
inherit "callout_guard";
inherit "touch";
inherit "object";
object canary;
/**********/
/* status */
/**********/
void set_canary(object new_canary)
{
ACCE... |
Use static for inline methods in headers | #ifndef BUFFER_H
#define BUFFER_H
#include <stdio.h>
struct Buffer {
char *buffer;
size_t size;
size_t head;
size_t len;
};
struct Buffer *new_buffer();
void free_buffer(struct Buffer *);
ssize_t buffer_recv(struct Buffer *, int, int);
ssize_t buffer_send(struct Buffer *, int, int);
ssize_t buffer_... | #ifndef BUFFER_H
#define BUFFER_H
#include <stdio.h>
struct Buffer {
char *buffer;
size_t size;
size_t head;
size_t len;
};
struct Buffer *new_buffer();
void free_buffer(struct Buffer *);
ssize_t buffer_recv(struct Buffer *, int, int);
ssize_t buffer_send(struct Buffer *, int, int);
ssize_t buffer_... |
Fix Cognito BigInteger import for versioning | #if __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"
#else
#import <React/RCTBridgeModule.h>
#endif
#if __has_include("RCTLog.h")
#import "RCTLog.h"
#else
#import <React/RCTLog.h>
#endif
#if __has_include("RCTUtils.h")
#import "RCTUtils.h"
#else
#import <React/RCTUtils.h>
#endif
#import "JKBigInteger.h... | #if __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"
#else
#import <React/RCTBridgeModule.h>
#endif
#if __has_include("RCTLog.h")
#import "RCTLog.h"
#else
#import <React/RCTLog.h>
#endif
#if __has_include("RCTUtils.h")
#import "RCTUtils.h"
#else
#import <React/RCTUtils.h>
#endif
#import <JKBigInteger.h... |
Add Event-Shape-Engineering code for Femtoscopy | #pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class AliAnalysisTaskFemtoESE+;
#pragma link C++ class AliFemtoESEBasicParticle+;
| |
Add rempa_file_pages function by Will Newton <will.newton@imgtec.com> | /*
* remap_file_pages() for uClibc
*
* Copyright (C) 2008 Will Newton <will.newton@imgtec.com>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <sys/syscall.h>
#ifdef __NR_remap_file_pages
_syscall5(int, remap_file_pages, unsigned long, start, unsigned long, size,
unsi... | |
Remove obsolete *_foreach function completely (Function declarations were still there). | #ifndef XMMSCLIENTPP_SUPERLIST_H
#define XMMSCLIENTPP_SUPERLIST_H
#include <xmmsclient/xmmsclient.h>
namespace Xmms
{
namespace Detail
{
class SuperList
{
public:
SuperList( xmmsc_result_t* result );
SuperList( const SuperList& list );
virtual SuperList& operator=( const SuperList& list );
... | #ifndef XMMSCLIENTPP_SUPERLIST_H
#define XMMSCLIENTPP_SUPERLIST_H
#include <xmmsclient/xmmsclient.h>
namespace Xmms
{
namespace Detail
{
class SuperList
{
public:
SuperList( xmmsc_result_t* result );
SuperList( const SuperList& list );
virtual SuperList& operator=( const SuperList& list );
... |
Update test to check call instruction. | // RUN: %llvmgcc -c -emit-llvm %s -o - | llvm-dis | grep llvm.noinline
static int bar(int x, int y) __attribute__((noinline));
static int bar(int x, int y)
{
return x + y;
}
int foo(int a, int b) {
return bar(b, a);
}
| // RUN: %llvmgcc -O2 -c -emit-llvm %s -o - | llvm-dis | grep call
static int bar(int x, int y) __attribute__((noinline));
static int bar(int x, int y)
{
return x + y;
}
int foo(int a, int b) {
return bar(b, a);
}
|
Add test with very large arrays where partitioned array is unsound | // PARAM: --enable ana.int.interval --enable exp.partition-arrays.enabled
#include <assert.h>
#include <stdlib.h>
#include <limits.h>
#include <stdio.h>
#include <stddef.h>
// Test to check whether partitioned arrays can have an index expression evaluating to values largers than the max value of int64
#define LENGTH ... | |
Remove copyright from new file | //
// SDLDebugToolConsole.h
// SmartDeviceLink-iOS
//
// Created by Joel Fischer on 3/12/15.
// Copyright (c) 2015 smartdevicelink. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol SDLDebugToolConsole <NSObject>
@required
- (void)logInfo:(NSString *)info;
@end
| //
// SDLDebugToolConsole.h
// SmartDeviceLink-iOS
#import <Foundation/Foundation.h>
@protocol SDLDebugToolConsole <NSObject>
@required
- (void)logInfo:(NSString *)info;
@end
|
Use : as separator between "GM" and slide name in SampleApp. This makes it easier to jump to a GM slide using command line args on windows. |
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GMSampleView_DEFINED
#define GMSampleView_DEFINED
#include "SampleCode.h"
#include "gm.h"
class GMSampleView : public SampleView {
private:
typedef skiagm::GM ... |
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GMSampleView_DEFINED
#define GMSampleView_DEFINED
#include "SampleCode.h"
#include "gm.h"
class GMSampleView : public SampleView {
private:
typedef skiagm::GM ... |
Use urbit types instead of size_t | /* j/3/xeb.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qc_xeb(u3_atom a)
{
mpz_t a_mp;
if ( __(u3a_is_dog(a)) ) {
u3r_mp(a_mp, a);
size_t log = mpz_sizeinbase(a_mp, 2);
mpz_t b_mp;
mpz_init_set_ui(b_mp, log);
return u3i_mp(b_mp);
}
else {
mpz_init_set_... | /* j/3/xeb.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qc_xeb(u3_atom a)
{
mpz_t a_mp;
if ( __(u3a_is_dog(a)) ) {
u3r_mp(a_mp, a);
c3_d x = mpz_sizeinbase(a_mp, 2);
mpz_t b_mp;
mpz_init_set_ui(b_mp, x);
return u3i_mp(b_mp);
}
else {
mpz_init_set_ui(a_m... |
Solve Bhaskara's Formula in c | #include <math.h>
#include <stdio.h>
int main() {
double a, b, c, delta;
scanf("%lf %lf %lf", &a, &b, &c);
delta = (b * b) - 4 * a * c;
if (delta >= 0 && a != 0) {
printf("R1 = %.5lf\n", ((b * -1) + sqrt(delta)) / (2 * a));
printf("R2 = %.5lf\n", ((b * -1) - sqrt(delta)) / (2 * a));
... | |
Add compact allocation on BioU. | #ifdef GUADALUPE_SPREAD
int cpumap(int i, int nprocs)
{
return (i / 36) * 36 + (i % 2) * 18 + (i % 36 / 2);
}
#elif GUADALUPE_MIC_COMPACT
int cpumap(int i, int nprocs)
{
return (i + 1) % 228;
}
#else
int cpumap(int id, int nprocs)
{
return id % nprocs;
}
#endif
| #ifdef GUADALUPE_SPREAD
int cpumap(int i, int nprocs)
{
return (i / 36) * 36 + (i % 2) * 18 + (i % 36 / 2);
}
#elif GUADALUPE_MIC_COMPACT
int cpumap(int i, int nprocs)
{
return (i + 1) % 228;
}
#elif BIOU_COMPACT
int cpumap(int i, int nprocs)
{
return (i % 4) * 32 + i / 4;
}
#else
int cpumap(int id, int np... |
Fix stupid led toggle bug | #include <stdint.h>
#include "stm8s208s.h"
void main(void)
{
MEMLOC(CLK_CKDIVR) = 0x00; /* Set the frequency to 16 MHz */
BITSET(CLK_PCKENR1, 7); /* Enable clk to TIM1 */
// Configure timer
// 250 ticks per second
MEMLOC(TIM1_PSCRH) = (64000>>8);
MEMLOC(TIM1_PSCRL) = (uint8_t)(64000 & 0xff);
... | #include <stdint.h>
#include "stm8s208s.h"
void main(void)
{
MEMLOC(CLK_CKDIVR) = 0x00; /* Set the frequency to 16 MHz */
BITSET(CLK_PCKENR1, 7); /* Enable clk to TIM1 */
// Configure timer
// 250 ticks per second
MEMLOC(TIM1_PSCRH) = (64000>>8);
MEMLOC(TIM1_PSCRL) = (uint8_t)(64000 & 0xff);
... |
Add platform check preprocessor conditions | //
// TypedKey.h
// TypedKey
//
// Created by 전수열 on 1/28/16.
// Copyright © 2016 Suyeol Jeon. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for TypedKey.
FOUNDATION_EXPORT double TypedKeyVersionNumber;
//! Project version string for TypedKey.
FOUNDATION_EXPORT const unsigned char Ty... | // The MIT License (MIT)
//
// Copyright (c) 2016 Suyeol Jeon (xoul.kr)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// t... |
Allow registering builtin dict drivers multiple times. | /* Copyright (c) 2013-2015 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "dict-private.h"
void dict_drivers_register_builtin(void)
{
dict_driver_register(&dict_driver_client);
dict_driver_register(&dict_driver_file);
dict_driver_register(&dict_driver_fs);
dict_driver_register(&dict_d... | /* Copyright (c) 2013-2015 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "dict-private.h"
static int refcount = 0;
void dict_drivers_register_builtin(void)
{
if (refcount++ > 0)
return;
dict_driver_register(&dict_driver_client);
dict_driver_register(&dict_driver_file);
dict_driver... |
Fix a warning when compiling on Windows | /*
* Copyright (C) 2016 Richard Hughes <richard@hughsie.com>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#pragma once
#include "fwupd-client.h"
#ifdef HAVE_GIO_UNIX
#include <gio/gunixinputstream.h>
#endif
#ifdef HAVE_GIO_UNIX
void fwupd_client_get_details_stream_async (FwupdClient *self,
GUnixInputStre... | /*
* Copyright (C) 2016 Richard Hughes <richard@hughsie.com>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#pragma once
#include "fwupd-client.h"
#ifdef HAVE_GIO_UNIX
#include <gio/gunixinputstream.h>
#endif
void fwupd_client_download_bytes2_async (FwupdClient *self,
GPtrArray *urls,
FwupdClientDo... |
Add some simple mime types | #ifndef APIMOCK_MIMETYPES_H
#define APIMOCK_MIMETYPES_H
#include <unordered_map>
namespace ApiMock {
class Mime {
public:
std::string GetMimeByFileName(const std::string& filename) {
static const std::unordered_map<std::string, std::string> MIME_TYPES{
{ ".css", "text/css" },
{ ".html", "text/html" ... | |
Add accessible check to sum read | #include "health.h"
static bool s_health_available;
static void health_handler(HealthEventType event, void *context) {
main_window_update_ui();
}
void health_init() {
s_health_available = health_service_events_subscribe(health_handler, NULL);
if(!s_health_available) {
APP_LOG(APP_LOG_LEVEL_ERROR, "Health n... | #include "health.h"
static bool s_health_available;
static void health_handler(HealthEventType event, void *context) {
main_window_update_ui();
}
void health_init() {
s_health_available = health_service_events_subscribe(health_handler, NULL);
if(!s_health_available) {
APP_LOG(APP_LOG_LEVEL_ERROR, "Health n... |
Add missing test source file. | /*
* build-tests/__builtin_expect.c
*
* test if the compiler has __builtin_expect().
*/
int main(void) {
return __builtin_expect(1, 1) ? 1 : 0;
}
| |
Add externs for the functions used | #ifndef _HARDWARE_H_
#define _HARDWARE_H_
#include <stdint.h>
// For disk/drive status
#define HW_NODRIVE 0
#define HW_NODISK 1
#define HW_HAVEDISK 2
// Drive geometry
#define HW_MAXHEADS 2
#define HW_MAXTRACKS 80
#define HW_NORMALSTEPPING 1
#define HW_DOUBLESTEPPING 2
extern int hw_currenttrack;
extern int hw_cur... | #ifndef _HARDWARE_H_
#define _HARDWARE_H_
#include <stdint.h>
// For disk/drive status
#define HW_NODRIVE 0
#define HW_NODISK 1
#define HW_HAVEDISK 2
// Drive geometry
#define HW_MAXHEADS 2
#define HW_MAXTRACKS 80
#define HW_NORMALSTEPPING 1
#define HW_DOUBLESTEPPING 2
extern int hw_currenttrack;
extern int hw_cur... |
Add test case for multiplication in conditions with Interval32. | // PARAM: --enable ana.int.interval --disable ana.int.def_exc --disable ana.int.enums
#include <assert.h>
#include <stdio.h>
int main(){
unsigned int i = 3;
// 3 * 2^30 == 3221225472u is outside of the range that Intervall32 can represent
// Therefore, when trying to refine i, Base.invariant meets i -> [3... | |
Use GCC's builtins to implement va_list on sparc64 for now | /* $Id$ */
/* Copyright (c) 2007 The DeforaOS Project */
#ifndef LIBC_STDARG_H
# define LIBC_STDARG_H
/* types */
# ifndef va_list
# define va_list va_list
typedef void * va_list;
# endif
/* macros */
# if defined(__i386__)
# define va_start(ap, arg) (ap) = ((char*)&arg) + 4
# define va_arg(ap, type) ((ap) +=... | /* $Id$ */
/* Copyright (c) 2007 The DeforaOS Project */
#ifndef LIBC_STDARG_H
# define LIBC_STDARG_H
/* types */
# ifndef va_list
# define va_list va_list
typedef void * va_list;
# endif
/* macros */
# if defined(__i386__)
# define va_start(ap, arg) (ap) = ((char*)&arg) + 4
# define va_arg(ap, type) ((ap) +=... |
Fix build error (maybe-uninitialized variable) | /**
* @file
*
* @brief
*
* @date 16.05.2012
* @author Anton Bondarev
*/
#include <types.h>
uint64_t __udivdi3(uint64_t num, uint64_t den) {
uint64_t result = 0;
int steps;
int i;
if (0 == den) {
return 0;
}
while (0x8000000000000000 != (den & 0x8000000000000000)) {
den <<= 1;
steps++;
}
for (i =... | /**
* @file
* @brief
*
* @date 16.05.2012
* @author Anton Bondarev
*/
#include <types.h>
uint64_t __udivdi3(uint64_t num, uint64_t den) {
uint64_t result = 0;
int steps = 0;
int i;
if (0 == den) {
return 0;
}
while (0x8000000000000000 != (den & 0x8000000000000000)) {
den <<= 1;
steps++;
}
for (i... |
Fix some GCC initialization warnings | #pragma once
#include <vector>
#include <boost/multiprecision/cpp_int.hpp>
namespace dev
{
namespace eth
{
namespace jit
{
using byte = uint8_t;
using bytes = std::vector<byte>;
using u256 = boost::multiprecision::uint256_t;
using bigint = boost::multiprecision::cpp_int;
struct NoteChannel {}; // FIXME: Use some lo... | #pragma once
#include <vector>
#include <boost/multiprecision/cpp_int.hpp>
namespace dev
{
namespace eth
{
namespace jit
{
using byte = uint8_t;
using bytes = std::vector<byte>;
using u256 = boost::multiprecision::uint256_t;
using bigint = boost::multiprecision::cpp_int;
struct NoteChannel {}; // FIXME: Use some lo... |
Use _WIN32 macro instead of WIN32 | /*
* krypt-core API - C version
*
* Copyright (C) 2011
* Hiroshi Nakamura <nahi@ruby-lang.org>
* Martin Bosslet <martin.bosslet@googlemail.com>
* All rights reserved.
*
* This software is distributed under the same license as Ruby.
* See the file 'LICENSE' for further details.
*/
#if !defined(_KRYPT_OS_H_)
#define _KR... | /*
* krypt-core API - C version
*
* Copyright (C) 2011
* Hiroshi Nakamura <nahi@ruby-lang.org>
* Martin Bosslet <martin.bosslet@googlemail.com>
* All rights reserved.
*
* This software is distributed under the same license as Ruby.
* See the file 'LICENSE' for further details.
*/
#if !defined(_KRYPT_OS_H_)
#define _KR... |
Add example of JSON serialization on string | // Based on https://github.com/nanopb/nanopb/blob/master/examples/simple/simple.c
#include <stdio.h>
#include "m-serial-json.h"
#include "m-tuple.h"
#include "m-string.h"
// Define a structure with one field
TUPLE_DEF2(SimpleMessage,
(lucky_number, int))
int main(void)
{
string_t buffer;
m_serial_retu... | |
Add new macro to detect iOS7. | //
// PKMacros.h
// PKToolBox
//
// Created by Pavel Kunc on 17/07/2013.
// Copyright (c) 2013 PKToolBox. All rights reserved.
//
#define PK_NIL_IF_NULL(obj) ((obj == [NSNull null]) ? nil : obj)
#define PK_NULL_IF_NIL(obj) ((obj == nil) ? [NSNull null] : obj)
#define PK_BOOL_TO_LOCALIZED_STRING(val) ((val == YES)... | //
// PKMacros.h
// PKToolBox
//
// Created by Pavel Kunc on 17/07/2013.
// Copyright (c) 2013 PKToolBox. All rights reserved.
//
#define PK_NIL_IF_NULL(obj) ((obj == [NSNull null]) ? nil : obj)
#define PK_NULL_IF_NIL(obj) ((obj == nil) ? [NSNull null] : obj)
#define PK_BOOL_TO_LOCALIZED_STRING(val) ((val == YES)... |
Add a simple test for sphia_count |
#include <stdlib.h>
#include "sphia-test.h"
#define EXPECTED_TEST_KEYS 1234
static void
test_count() {
for (int i = 0; i < EXPECTED_TEST_KEYS; i++) {
char *key = malloc(16);
if (NULL == key) {
fprintf(stderr, "Malloc error\n");
exit(1);
}
sprintf(key, "key%03d", i);
assert(0 == sphi... | |
Remove unknown from completed assert in 31/13 | //PARAM: --enable ana.int.interval --disable ana.int.def_exc --disable ana.int.enums --set ana.octapron.no_signed_overflow false
#include <assert.h>
int main(){
int a = 0;
// maximum value for ulonglong
unsigned long long x = 18446744073709551615ull;
if(x > 18446744073709551612ull){
a = 1;
... | //PARAM: --enable ana.int.interval --disable ana.int.def_exc --disable ana.int.enums --set ana.octapron.no_signed_overflow false
#include <assert.h>
int main(){
int a = 0;
// maximum value for ulonglong
unsigned long long x = 18446744073709551615ull;
if(x > 18446744073709551612ull){
a = 1;
... |
Add (deactivated) refinement test for interval/congruence domain | // PARAM: --disable ana.int.def_exc --enable ana.int.interval --enable ana.int.congruence
#include <assert.h>
int main(){
int r = -103;
for (int i = 0; i < 40; i++) {
r = r + 5;
}
// At this point r in the congr. dom should be 2 + 5Z
int k = r;
if (k >= 3) {
// After refinement ... | |
Add isl29035 to Imix board | #include <isl29035.h>
#include <stdio.h>
#include <stdbool.h>
#include <timer.h>
#include <tmp006.h>
void print_intensity(int intensity) {
printf("Intensity: %d\n", intensity);
}
void intensity_cb(int intensity, int unused1, int unused2, void* ud) {
print_intensity(intensity);
}
void temp_callback(int temp_value... | #include <isl29035.h>
#include <stdio.h>
#include <stdbool.h>
#include <timer.h>
#include <tmp006.h>
void print_intensity(int intensity) {
printf("Intensity: %d\n", intensity);
}
void intensity_cb(int intensity, int unused1, int unused2, void* ud) {
print_intensity(intensity);
}
void temp_callback(int temp_value... |
Fix to install with MariDB on Windows | #ifndef MYSQL2_EXT
#define MYSQL2_EXT
#include <ruby.h>
#include <fcntl.h>
#ifdef HAVE_MYSQL_H
#include <mysql.h>
#include <mysql_com.h>
#include <errmsg.h>
#include <mysqld_error.h>
#else
#include <mysql/mysql.h>
#include <mysql/mysql_com.h>
#include <mysql/errmsg.h>
#include <mysql/mysqld_error.h>
#endif
#ifdef HA... | #ifndef MYSQL2_EXT
#define MYSQL2_EXT
#include <ruby.h>
#include <fcntl.h>
#ifndef HAVE_UINT
#define HAVE_UINT
typedef unsigned short ushort;
typedef unsigned int uint;
#endif
#ifdef HAVE_MYSQL_H
#include <mysql.h>
#include <mysql_com.h>
#include <errmsg.h>
#include <mysqld_error.h>
#else
#include <mysql/mysql... |
Add generic definition to identifier array. | //
// AFNetworkingWebApiClient.h
// WebApiClient
//
// Created by Matt on 12/08/15.
// Copyright (c) 2015 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0.
//
#import "WebApiClientSupport.h"
NS_ASSUME_NONNULL_BEGIN
@protocol AFURLResponseSerialization;
/**
Implementation of @c WebA... | //
// AFNetworkingWebApiClient.h
// WebApiClient
//
// Created by Matt on 12/08/15.
// Copyright (c) 2015 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0.
//
#import "WebApiClientSupport.h"
NS_ASSUME_NONNULL_BEGIN
@protocol AFURLResponseSerialization;
/**
Implementation of @c WebA... |
Test level 6 with a variable instead of a constant | // Copyright (c) 2016 LEGOAnimal22
#include <stdio.h>
#include <inttypes.h>
#include "electron.h"
int main() {
printf("Periodic Table by LEGOAnimal22\n");
electron_config carbon = create_electron_config(6);
printf("%d, %d, %d, %d\n", carbon.atomic_number, carbon.highest_energy_level, carbon.valence_electrons, ... | // Copyright (c) 2016 LEGOAnimal22
#include <stdio.h>
#include <inttypes.h>
#include "electron.h"
int main() {
printf("Periodic Table by LEGOAnimal22\n");
electron_config carbon = create_electron_config(6);
printf("%d, %d, %d, %d\n", carbon.atomic_number, carbon.highest_energy_level, carbon.valence_electrons, ... |
Add a test case for Chris lvalue alignment fixes. | // RUN: %llvmgcc -S %s -o - | grep load | grep "4 x float" | not grep "align 4"
// RUN: %llvmgcc -S %s -o - | grep load | grep "4 x float" | grep "align 16"
// PR3432
// rdar://6536377
typedef float __m128 __attribute__ ((__vector_size__ (16)));
typedef union
{
int i[4];
float f[4];
__m128 v;
} u_t;
__m128 t(u... | |
Add command to separately reset the clone manager | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012, 2013, 2014 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 Softw... | |
Fix typo in the Print_compare_and_display function | #include "stdint.h"
#include "stdio.h"
#include "Spec_Lib_Print.h"
void Spec_Lib_Print_print_bytes(uint32_t len, uint8_t* buffer) {
for (int i = 0; i < len; i++){
printf("%02x ", buffer[i]);
}
printf("\n");
}
void Spec_Lib_Print_print_compare(uint32_t len, uint8_t* buffer1, uint8_t* buffer2) {
for (int i ... | #include "stdint.h"
#include "stdio.h"
#include "Spec_Lib_Print.h"
void Spec_Lib_Print_print_bytes(uint32_t len, uint8_t* buffer) {
for (int i = 0; i < len; i++){
printf("%02x ", buffer[i]);
}
printf("\n");
}
void Spec_Lib_Print_print_compare(uint32_t len, uint8_t* buffer1, uint8_t* buffer2) {
for (int i ... |
Change client id and client secret default value | //
// SecretConstant.example.h
// PHPHub
//
// Created by Aufree on 9/30/15.
// Copyright (c) 2015 ESTGroup. All rights reserved.
//
#define Client_id @"Get the client id from server"
#define Client_secret @"Get the client secret from server"
#define UMENG_APPKEY @"Set up UMEng App Key"
#define UMENG_QQ... | //
// SecretConstant.example.h
// PHPHub
//
// Created by Aufree on 9/30/15.
// Copyright (c) 2015 ESTGroup. All rights reserved.
//
#define Client_id @"kHOugsx4dmcXwvVbmLkd"
#define Client_secret @"PuuFCrF94MloSbSkxpwS"
#define UMENG_APPKEY @"Set up UMEng App Key"
#define UMENG_QQ_ID @"Set up qq id... |
Make this file a bit prettier. | // __COMPDB_ENTRY: The contents of this compilation database entry.
// Should be a string literal.
// __COMPDB_SYMNAME: ATM I can't think of a way to generate a unique symbol
// name, so just force the TU to provide it.
__attribute__((section(".llvm.compdb")))
extern const char __COMPDB_SYMNAME[] = "<<<COMPDB:" __COMPD... | // The following macros should be defined on entry to this file:
// __COMPDB_ENTRY:
// The contents of this compilation database entry. Should be a string
// literal.
// __COMPDB_SYMNAME:
// ATM I can't think of a way to generate a unique symbol name, so just
// force it to be passed in.
__attribute__((section... |
Fix a typo in a kernel name | #pragma once
#include "chainerx/array.h"
#include "chainerx/kernel.h"
namespace chainerx {
class SinhKernel : public Kernel {
public:
static const char* name() { return "Sinh"; }
virtual void Call(const Array& x, const Array& out) = 0;
};
class CoshKernel : public Kernel {
public:
static const char* na... | #pragma once
#include "chainerx/array.h"
#include "chainerx/kernel.h"
namespace chainerx {
class SinhKernel : public Kernel {
public:
static const char* name() { return "Sinh"; }
virtual void Call(const Array& x, const Array& out) = 0;
};
class CoshKernel : public Kernel {
public:
static const char* na... |
Initialize the inter and intra-op thread pool pointers in ThreadPoolOptions to nullptr. Otherwise, they may have arbitrary values. | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
Update testcase for r283948 (NFC) | // Make sure instrumentation data from available_externally functions doesn't
// get thrown out and are emitted with the expected linkage.
// RUN: %clang_cc1 -O2 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage-available_externally.c %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s
// CHECK: @__pr... | // Make sure instrumentation data from available_externally functions doesn't
// get thrown out and are emitted with the expected linkage.
// RUN: %clang_cc1 -O2 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage-available_externally.c %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s
// CHECK: @__pr... |
Remove extraneous line in the test that was mistakenly copied. | // rdar://10588825
// Test this without pch.
// RUN: %clang_cc1 %s -include %s -verify -fsyntax-only
// Test with pch.
// RUN: %clang_cc1 %s -emit-pch -o %t
// RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only
#ifndef HEADER
#define HEADER
#define SKATA
#define __stdcall
#define STDCALL __stdcall
void STDC... | // rdar://10588825
// Test this without pch.
// RUN: %clang_cc1 %s -include %s -verify -fsyntax-only
// Test with pch.
// RUN: %clang_cc1 %s -emit-pch -o %t
// RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only
#ifndef HEADER
#define HEADER
#define __stdcall
#define STDCALL __stdcall
void STDCALL Foo(void);
... |
Add a programming contest template for C | #include <stdio.h>
#include <stdlib.h>
#define LINE_BUF_SIZE 1024
#define LENGTH(array) (sizeof(array) / sizeof((array)[0]))
int
main(void)
{
static char line[LINE_BUF_SIZE];
while (fgets(line, sizeof(line), stdin) != NULL) {
int a, b;
if (sscanf(line, "%d %d", &a, &b) != 2) {
fputs("sscanf: Con... | |
Improve crash reporting test coverage. | // RUN: %clang -fsyntax-only %s 2>&1 | FileCheck %s
// REQUIRES: crash-recovery
// XFAIL: mingw32,win32
#pragma clang __debug parser_crash
// CHECK: Preprocessed source(s) and associated run script(s) are located at:
// CHECK-NEXT: {{.*}}: note: diagnostic msg: {{.*}}.c
| // RUN: rm %T/crash-report-*.c %T/crash-report-*.sh
// RUN: TMP=%T %clang -fsyntax-only %s -DFOO=BAR 2>&1 | FileCheck %s
// RUN: FileCheck --check-prefix=CHECKSRC %s < %T/crash-report-*.c
// RUN: FileCheck --check-prefix=CHECKSH %s < %T/crash-report-*.sh
// REQUIRES: crash-recovery
// XFAIL: mingw32,win32
#pragma clan... |
Add -fno-experimental-pass-manager to make clear which pass manager we're running and to make flipping the default not regress testing. | // RUN: %clang -O1 -fexperimental-new-pass-manager -fno-unroll-loops -S -o - %s -emit-llvm | FileCheck %s
// RUN: %clang -O1 -fno-unroll-loops -S -o - %s -emit-llvm | FileCheck %s
extern int a[16];
int b = 0;
int foo(void) {
#pragma unroll
for (int i = 0; i < 16; ++i)
a[i] = b += 2;
return b;
}
// CHECK-NOT: br... | // RUN: %clang -O1 -fexperimental-new-pass-manager -fno-unroll-loops -S -o - %s -emit-llvm | FileCheck %s
// RUN: %clang -O1 -fno-experimental-new-pass-manager -fno-unroll-loops -S -o - %s -emit-llvm | FileCheck %s
extern int a[16];
int b = 0;
int foo(void) {
#pragma unroll
for (int i = 0; i < 16; ++i)
a[i] = b +... |
Add release notes for 3.γ | Release notes for i3 v3.γ
-----------------------------
This is the third version (3.γ, transcribed 3.c) of i3. It is considered stable.
This release contains many small improvements like using keysymbols in the
configuration file, named workspaces, borderless windows, an IPC interface
etc. (see below for a complete ... | |
Make environment_variables test ignore LD_LIBRARY_PATH for glibc | /*
* Copyright 2010 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 <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char **argv, char **en... | /*
* Copyright 2010 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 <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
/*
* In the glibc dy... |
Make ScatterExpander methods 'protected' to enable overriding them in a subclass. | /* Copyright 2018 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 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
Fix crash when shutting down | // Copyright (c) 2013 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef XWALK_APPLICATION_BROWSER_APPLICATION_SYSTEM_LINUX_H_
#define XWALK_APPLICATION_BROWSER_APPLICATION_SYSTEM_LINUX_H_
#include "xwalk/application/... | // Copyright (c) 2013 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef XWALK_APPLICATION_BROWSER_APPLICATION_SYSTEM_LINUX_H_
#define XWALK_APPLICATION_BROWSER_APPLICATION_SYSTEM_LINUX_H_
#include "xwalk/application/... |
Change _forwardToDelegate to weak reference | //
// _RXDelegateProxy.h
// RxCocoa
//
// Created by Krunoslav Zaher on 7/4/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface _RXDelegateProxy : NSObject
@property (nonatomic, assign, readonly) id _forwardToDelegate;
-(void)_setForwardToDelegate:(id)fo... | //
// _RXDelegateProxy.h
// RxCocoa
//
// Created by Krunoslav Zaher on 7/4/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface _RXDelegateProxy : NSObject
@property (nonatomic, weak, readonly) id _forwardToDelegate;
-(void)_setForwardToDelegate:(id)forw... |
Fix precompiled headers, Image.hxx has been removed from OCCT 6.7.0 | #pragma once
#include "../TKernel/Precompiled.h"
#include "../TKMath/Precompiled.h"
#include "Standard.hxx"
#include "Aspect.hxx"
#include "Aspect_Handle.hxx"
#include "Image.hxx"
#include "SelectBasics.hxx"
| #pragma once
#include "../TKernel/Precompiled.h"
#include "../TKMath/Precompiled.h"
#include "Standard.hxx"
#include "Aspect.hxx"
#include "Aspect_Handle.hxx"
#include "SelectBasics.hxx"
|
Add solution for exercise 19. | /** Exercise 1.19
* Write a function reverse(s) that reverses the character string s. Use it to
* write a program that reverses its input a line at a time.
*/
#include <stdio.h>
#define BUFSIZE 1024
int _getline(char[], int);
void reverse(char[], int);
main() {
char line[BUFSIZE];
int length;
while (... | |
Use "" imports instead of <> in main fmwk header | //
// Hauth.h
// Hauth
//
// Created by Rizwan Sattar on 11/7/15.
// Copyright © 2015 Rizwan Sattar. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for Hauth.
FOUNDATION_EXPORT double HauthVersionNumber;
//! Project version string for Hauth.
FOUNDATION_EXPORT const unsigned ... | //
// Hauth.h
// Hauth
//
// Created by Rizwan Sattar on 11/7/15.
// Copyright © 2015 Rizwan Sattar. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for Hauth.
FOUNDATION_EXPORT double HauthVersionNumber;
//! Project version string for Hauth.
FOUNDATION_EXPORT const unsigned ... |
Document goop and have both Linux and Mac OS X define setresuid et al. | #ifdef __linux__
# define _GNU_SOURCE
# include <bsd/stdlib.h>
# include <grp.h>
int setresgid(gid_t, gid_t, gid_t);
int setresuid(gid_t, gid_t, gid_t);
#endif
#ifdef __FreeBSD__
#include <sys/socket.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <resolv.h>
#endif
| /*
* Require libbsd's stdlib.h for arc4random() etc.
* Require <grp.h> for setgroups().
*/
#ifdef __linux__
# define _GNU_SOURCE
# include <bsd/stdlib.h>
# include <grp.h>
#endif
/*
* Neither Linux nor Apple have this.
*/
#if defined(__linux__) || defined(__APPLE__)
# include <unistd.h>
int setresgid(gid_t, gid_t... |
Add placement3d node auxiliary functions |
//
// This source file is part of appleseed.
// Visit http://appleseedhq.net/ for additional information and resources.
//
// This software is released under the MIT license.
//
// Copyright (c) 2016 Luis Barrancos, The appleseedhq Organization
//
// Permission is hereby granted, free of charge, to any person obtainin... | |
Convert from tabs -> spaces |
class ThreadPoolThread;
class ThreadPool {
public:
ThreadPool();
ThreadPool(int nthread);
ThreadPool(int nthread, size_t maxqueue);
~ThreadPool();
void Add(std::function<void()> func);
void Flush();
void Execute();
size_t GetCount();
size_t GetHWCount();
protected:
void Init(int nthread, s... |
class ThreadPoolThread;
class ThreadPool {
public:
ThreadPool();
ThreadPool(int nthread);
ThreadPool(int nthread, size_t maxqueue);
~ThreadPool();
void Add(std::function<void()> func);
void Flush();
void Execute();
size_t GetCount();
size_... |
Set log level in tests. | /***************************************************************************//**
@file main.c
@author Stephen Brennan
@date Created Thursday, 12 September 2013
@brief Run tests on the libstephen library.
@copyright Copyright (c) 2013-2015, Stephen Brennan. Released under ... | /***************************************************************************//**
@file main.c
@author Stephen Brennan
@date Created Thursday, 12 September 2013
@brief Run tests on the libstephen library.
@copyright Copyright (c) 2013-2015, Stephen Brennan. Released under ... |
Fix build problem on W2008 in /xp /x86 /release mode | /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#ifndef CONFIG_H
#define CONFIG_H 1
#ifdef WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#else
#if !defined(__cplusplus) && !defined(linux) && !defined(__GNUC__)
typedef unsigned long long uint64_t;
typedef long lo... | /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#ifndef CONFIG_H
#define CONFIG_H 1
#ifdef WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#else
#if !defined(__cplusplus) && !defined(linux) && !defined(__GNUC__)
typedef unsigned long long uint64_t;
typedef long lo... |
Test constant-folding of weak identifiers | // RUN: %check --only -e %s -Wno-incompatible-pointer-types '-DERROR(...)=__VA_ARGS__'
// RUN: %ucc -fsyntax-only %s '-DERROR(...)=' -Wno-incompatible-pointer-types -Wno-arith-funcptr
enum { false };
__attribute((weak)) void w();
void f();
ERROR(int shortcircuit_weak_1 = w && 1;) // CHECK: error: global scalar initi... | |
Fix typo in header guard | // Virvo - Virtual Reality Volume Rendering
// Copyright (C) 1999-2003 University of Stuttgart, 2004-2005 Brown University
// Contact: Jurgen P. Schulze, jschulze@ucsd.edu
//
// This file is part of Virvo.
//
// Virvo is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser Genera... | // Virvo - Virtual Reality Volume Rendering
// Copyright (C) 1999-2003 University of Stuttgart, 2004-2005 Brown University
// Contact: Jurgen P. Schulze, jschulze@ucsd.edu
//
// This file is part of Virvo.
//
// Virvo is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser Genera... |
Update include to header file 'population.h' | #ifndef EVOLUTION_H
#define EVOLUTION_H
#include "fitness.h"
#define POPULATION_SIZE 50
#define TOURNAMENT_SIZE 5
// Evolution
class EVOLUTION
{
public:
int crossover(int **newPop,
int **pop,
int index,
int tournament1,
int tournament2,
... | #ifndef EVOLUTION_H
#define EVOLUTION_H
#include "fitness.h"
#include "population.h"
#define POPULATION_SIZE 50
#define TOURNAMENT_SIZE 5
// Evolution
class EVOLUTION
{
public:
int crossover(int **newPop,
int **pop,
int index,
int tournament1,
... |
Structure member should be function pointer | // 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 PPAPI_C_PPB_FIND_H_
#define PPAPI_C_PPB_FIND_H_
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_stdint.h"
#define PPB_FIND_INTERFACE "... | // 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 PPAPI_C_PPB_FIND_H_
#define PPAPI_C_PPB_FIND_H_
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_stdint.h"
#define PPB_FIND_INTERFACE "... |
Revert 167593 - Add an OVERRIDE keyword This change adds an OVERRIDE keyword to the BaseFormatView::ButtonPressed function to fix a build break on the "Linux ChromiumOS (Clang dbg)" bot. | // 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 UI_MESSAGE_CENTER_BASE_FORMAT_VIEW_H_
#define UI_MESSAGE_CENTER_BASE_FORMAT_VIEW_H_
#include "ui/message_center/message_view.h"
#include "ui/... | // 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 UI_MESSAGE_CENTER_BASE_FORMAT_VIEW_H_
#define UI_MESSAGE_CENTER_BASE_FORMAT_VIEW_H_
#include "ui/message_center/message_view.h"
#include "ui/... |
Replace include <> with "" | /// \file
/// \brief This header contains functionality needed for serializing and deserealizing to/from a stream
#pragma once
#include <ISerializable.h>
#include <IStorage.h>
#include <iostream>
/// Contains all the functionality provided by the library.
namespace simpson
{
/// Serialize object to ostream
std::ost... | /// \file
/// \brief This header contains functionality needed for serializing and deserealizing to/from a stream
#pragma once
#include "ISerializable.h"
#include "IStorage.h"
#include <iostream>
/// Contains all the functionality provided by the library.
namespace simpson
{
/// Serialize object to ostream
std::ost... |
Fix randDouble() bug on windows | #ifndef CONST_H
#define CONST_H
#include <cmath>
#include <cstdlib>
typedef unsigned long long uint64;
namespace Const
{
constexpr int HASH_BASE = 31415927;
constexpr double EPS = 1e-6;
constexpr double PI = M_PI;
inline int randUInt()
{
#ifdef _WIN32
return (rand() << 15) | rand();
#else
return rand();
#e... | #ifndef CONST_H
#define CONST_H
#include <cmath>
#include <cstdlib>
typedef unsigned long long uint64;
namespace Const
{
constexpr int HASH_BASE = 31415927;
constexpr double EPS = 1e-6;
constexpr double PI = M_PI;
inline int randUInt()
{
#ifdef _WIN32
return (rand() << 15) | rand();
#else
return rand();
#e... |
Make sure we don't increment data array past it's length when parsing payload | // Copyright (c) 2016 Brian Barto
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the MIT License. See LICENSE for more details.
#include <string.h>
#include "config.h"
// Static Variables
static char payload[PAYLOAD_SIZE + 1];
void inputpayload_init(void) {
memse... | // Copyright (c) 2016 Brian Barto
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the MIT License. See LICENSE for more details.
#include <string.h>
#include "config.h"
// Static Variables
static char payload[PAYLOAD_SIZE + 1];
void inputpayload_init(void) {
memse... |
Simplify return of ram_enable value | #include "gameboy.h"
#include "memory.h"
u8 select_rom_bank(u8 value)
{
u8 ret = value & 0x1F;
switch (mode) {
case ROM:
break;
case MBC1:
switch (ret) {
case 0:
case 0x20:
case 0x40:
case 0x60:
break;
default:
ret -= 1;
}
}
return ret;
}
u8 select_ram_bank(u8 value)
{
return (value & 0x... | #include "gameboy.h"
#include "memory.h"
u8 select_rom_bank(u8 value)
{
u8 ret = value & 0x1F;
switch (mode) {
case ROM:
break;
case MBC1:
switch (ret) {
case 0:
case 0x20:
case 0x40:
case 0x60:
break;
default:
ret -= 1;
}
}
return ret;
}
u8 select_ram_bank(u8 value)
{
return (value & 0x... |
Update metadata id number in string compare check. | // RUN: env RC_DEBUG_OPTIONS=1 %clang -ccc-host-triple i386-apple-darwin9 -g -Os %s -emit-llvm -S -o - | FileCheck %s
// <rdar://problem/7256886>
// CHECK: !1 = metadata !{
// CHECK: -g -Os
// CHECK: -mmacosx-version-min=10.5.0
// CHECK: [ DW_TAG_compile_unit ]
int x;
| // RUN: env RC_DEBUG_OPTIONS=1 %clang -ccc-host-triple i386-apple-darwin9 -g -Os %s -emit-llvm -S -o - | FileCheck %s
// <rdar://problem/7256886>
// CHECK: !0 = metadata !{
// CHECK: -g -Os
// CHECK: -mmacosx-version-min=10.5.0
// CHECK: [ DW_TAG_compile_unit ]
int x;
|
Patch from Jonathan Stowe to prototype Parrot_Array_class_init | /* global_setup.h
* Copyright: (When this is determined...it will go here)
* CVS Info
* $Id$
* Overview:
* Contains declarations of global data and the functions
* that initialize that data.
* Data Structure and Algorithms:
* History:
* Notes:
* References:
*/
#if !defined(PARROT_GLOBAL... | /* global_setup.h
* Copyright: (When this is determined...it will go here)
* CVS Info
* $Id$
* Overview:
* Contains declarations of global data and the functions
* that initialize that data.
* Data Structure and Algorithms:
* History:
* Notes:
* References:
*/
#if !defined(PARROT_GLOBAL... |
Patch from Jonathan Stowe to prototype Parrot_Array_class_init | /* global_setup.h
* Copyright: (When this is determined...it will go here)
* CVS Info
* $Id$
* Overview:
* Contains declarations of global data and the functions
* that initialize that data.
* Data Structure and Algorithms:
* History:
* Notes:
* References:
*/
#if !defined(PARROT_GLOBAL... | /* global_setup.h
* Copyright: (When this is determined...it will go here)
* CVS Info
* $Id$
* Overview:
* Contains declarations of global data and the functions
* that initialize that data.
* Data Structure and Algorithms:
* History:
* Notes:
* References:
*/
#if !defined(PARROT_GLOBAL... |
Fix typo in a comment: it's base58, not base48. | #ifndef BITCOINADDRESSVALIDATOR_H
#define BITCOINADDRESSVALIDATOR_H
#include <QValidator>
/** Base48 entry widget validator.
Corrects near-miss characters and refuses characters that are no part of base48.
*/
class BitcoinAddressValidator : public QValidator
{
Q_OBJECT
public:
explicit BitcoinAddressVali... | #ifndef BITCOINADDRESSVALIDATOR_H
#define BITCOINADDRESSVALIDATOR_H
#include <QValidator>
/** Base58 entry widget validator.
Corrects near-miss characters and refuses characters that are not part of base58.
*/
class BitcoinAddressValidator : public QValidator
{
Q_OBJECT
public:
explicit BitcoinAddressVal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.