Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add test case for single block | int main()
{
int b = 2, c = 3, d = 4;
int a = b + c;
b = a - d;
int e = b + c;
int f = a - d;
return 0;
}
| |
Add queuesize test with constant capacity | // SKIP PARAM: --set ana.activated[+] apron --set ana.apron.domain octagon --enable ana.apron.threshold_widening
// TODO: why needs threshold widening to succeed when queuesize doesn't?
#include <pthread.h>
#include <assert.h>
#define CAPACITY 1000
int used;
int free;
pthread_mutex_t Q = PTHREAD_MUTEX_INITIALIZER;
v... | |
Make `unsupported` actually be a bool... | #pragma once
#include "llvm/ADT/StringRef.h"
#include <set>
#include <map>
#include "Types.h"
// TODO: This shouldn't really be here. More restructuring needed...
struct hipCounter {
llvm::StringRef hipName;
ConvTypes countType;
ApiTypes countApiType;
int unsupported;
};
#define HIP_UNSUPPORTED -1
... | #pragma once
#include "llvm/ADT/StringRef.h"
#include <set>
#include <map>
#include "Types.h"
// TODO: This shouldn't really be here. More restructuring needed...
struct hipCounter {
llvm::StringRef hipName;
ConvTypes countType;
ApiTypes countApiType;
bool unsupported;
};
#define HIP_UNSUPPORTED tru... |
Change character encoding.(Shift_JIS -> UTF-8) | // Title: sleep
// Name: sleep.c
// Author: Matayoshi
// Date: 2010/06/20
// Ver: 1.0.0
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main(int argc, char* argv[]) {
// `FbN
if(argc < 2) {
fprintf(stdout, "Usage: %s msec\n", argv[0]);
exit(1);
} else {
char buf[16];
int wait = 0;
... | // Title: sleep
// Name: sleep.c
// Author: Matayoshi
// Date: 2010/06/20
// Ver: 1.0.0
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main(int argc, char* argv[]) {
// 引数チェック
if(argc < 2) {
fprintf(stdout, "Usage: %s msec\n", argv[0]);
exit(1);
} else {
char buf[16];
int wait = 0... |
Rephrase FORCE_READ into something safer. | /*
* Copyright 2016, NICTA
*
* 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.
*
* @TAG(NICTA_BSD)
*/
#pragma once
/* macros for forcing the compiler to leave in statments it would
* n... | /*
* Copyright 2016, NICTA
*
* 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.
*
* @TAG(NICTA_BSD)
*/
#pragma once
/* macros for forcing the compiler to leave in statments it would
* n... |
Use Daniel's trick for XFAIL'd tests | const char *s0 = m0;
int s1 = m1;
const char *s2 = m0;
// FIXME: This test fails inexplicably on Windows in a manner that makes it
// look like standard error isn't getting flushed properly.
// RUN: true
// RUNx: echo '#define m0 ""' > %t.h
// RUNx: %clang_cc1 -emit-pch -o %t.h.pch %t.h
// RUNx: echo '' > %t.h
// RU... | const char *s0 = m0;
int s1 = m1;
const char *s2 = m0;
// FIXME: This test fails inexplicably on Windows in a manner that makes it
// look like standard error isn't getting flushed properly.
// RUN: false
// XFAIL: *
// RUN: echo '#define m0 ""' > %t.h
// RUN: %clang_cc1 -emit-pch -o %t.h.pch %t.h
// RUN: echo '' >... |
Verify if two lists intersect at Y point. | #include "listHelper.h"
int intersectNode(struct linkList *l1, struct linkList *l2, int m, int n) {
/* l1
\ l2
\ /
\/
|
|
l1 is list1 with length m
l2 is list2 with length n
here, m is 5 and n is 4
so diff = abs(m-n) = 1
we need to hop 1 step on l1 to reach l2's length.
from here on... | |
Use using instead of typedef | #ifndef DRAUPNIR_H__
#define DRAUPNIR_H__
#include <cstdint>
#include "Sponge.h"
#include "CrcSponge.h"
#include "CrcSpongeBuilder.h"
#include "Constants.h"
namespace Draupnir {
// utility typedefs
typedef CrcSponge<std::uint64_t> CrcSponge64;
typedef CrcSponge<std::uint32_t> CrcSponge32;
typedef CrcSponge<... | #ifndef DRAUPNIR_H__
#define DRAUPNIR_H__
#include <cstdint>
#include "Sponge.h"
#include "CrcSponge.h"
#include "CrcSpongeBuilder.h"
#include "Constants.h"
namespace Draupnir {
// utility typedefs
using CrcSponge64 = CrcSponge<std::uint64_t>;
using CrcSponge32 = CrcSponge<std::uint32_t>;
using CrcSponge16 ... |
Fix missing thread analysis in 10/24 | // PARAM: --enable exp.partition-arrays.enabled
#include <pthread.h>
pthread_t t_ids[10000];
void *t_fun(void *arg) {
return NULL;
}
int main(void) {
for (int i = 0; i < 10000; i++)
pthread_create(&t_ids[i], NULL, t_fun, NULL);
for (int i = 0; i < 10000; i++)
pthread_join (t_ids[i], NULL);
return 0;... | // PARAM: --set ana.activated[+] thread --enable exp.partition-arrays.enabled
#include <pthread.h>
pthread_t t_ids[10000];
void *t_fun(void *arg) {
return NULL;
}
int main(void) {
for (int i = 0; i < 10000; i++)
pthread_create(&t_ids[i], NULL, t_fun, NULL);
for (int i = 0; i < 10000; i++)
pthread_join ... |
Include local header with quotes instead of angle brackets. | //===-- STLPostfixHeaderMap.h - hardcoded header map for STL ----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===-- STLPostfixHeaderMap.h - hardcoded header map for STL ----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Bump version for openssl security updates | #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 9
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD ... | #ifndef CLIENTVERSION_H
#define CLIENTVERSION_H
//
// client versioning and copyright year
//
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 9
#define CLIENT_VERSION_REVISION 1
#define CLIENT_VERSION_BUILD ... |
Make sure our iovec abstraction is compatible with Windows WSABUF | /*
* Copyright 2014 MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | /*
* Copyright 2014 MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... |
Document full requirements for the beacon mapper | //
// Created by Scott Stark on 6/12/15.
//
#ifndef NATIVESCANNER_BEACONMAPPER_H
#define NATIVESCANNER_BEACONMAPPER_H
#include <map>
#include <string>
using namespace std;
/**
* Map a beacon id to the registered user by querying the application registration rest api
*/
class BeaconMapper {
private:
map<int, s... | //
// Created by Scott Stark on 6/12/15.
//
#ifndef NATIVESCANNER_BEACONMAPPER_H
#define NATIVESCANNER_BEACONMAPPER_H
#include <map>
#include <string>
using namespace std;
/**
* Map a beacon id to the registered user by querying the application registration rest api
*
* Relies on:
* git clone https://github.com... |
Add missing event fixture file. | #ifndef VAST_TEST_UNIT_EVENT_FIXTURE_H
#define VAST_TEST_UNIT_EVENT_FIXTURE_H
#include <vector>
#include "vast/event.h"
struct event_fixture
{
event_fixture();
std::vector<vast::event> events;
};
#endif
| |
Support RN 0.40 headers while retaining backwards compatibility. | //
// RNSketchManager.m
// RNSketch
//
// Created by Jeremy Grancher on 28/04/2016.
// Copyright © 2016 Jeremy Grancher. All rights reserved.
//
#import "RCTViewManager.h"
#import "RNSketch.h"
@interface RNSketchManager : RCTViewManager
@property (strong) RNSketch *sketchView;
@end;
| //
// RNSketchManager.m
// RNSketch
//
// Created by Jeremy Grancher on 28/04/2016.
// Copyright © 2016 Jeremy Grancher. All rights reserved.
//
#if __has_include(<React/RCTViewManager.h>)
// React Native >= 0.40
#import <React/RCTViewManager.h>
#else
// React Native <= 0.39
#import "RCTViewManager.h"
#endif
#impo... |
Add a typedef for iterators. | // Copyright (c) 2014 Rob Rix. All rights reserved.
#import <Foundation/Foundation.h>
@protocol REDIterable <NSObject>
@property (readonly) id(^red_iterator)(void);
@end
| // Copyright (c) 2014 Rob Rix. All rights reserved.
#import <Foundation/Foundation.h>
/// A nullary block iterating the elements of a collection over successive calls.
///
/// \return The next object in the collection, or nil if it has iterated the entire collection.
typedef id (^REDIteratingBlock)(void);
/// A col... |
Correct case of STDC pragmas | // RUN: %check %s
#pragma STDC FENV_ACCESS on
_Pragma("STDC FENV_ACCESS on"); // CHECK: warning: unhandled STDC pragma
// CHECK: ^warning: extra ';' at global scope
#define LISTING(x) PRAGMA(listing on #x)
#define PRAGMA(x) _Pragma(#x)
LISTING(../listing) // CHECK: warning: unknown pragma 'listing on "../listing"'
... | // RUN: %check %s
#pragma STDC FENV_ACCESS ON
_Pragma("STDC FENV_ACCESS ON"); // CHECK: warning: unhandled STDC pragma
// CHECK: ^warning: extra ';' at global scope
#define LISTING(x) PRAGMA(listing on #x)
#define PRAGMA(x) _Pragma(#x)
LISTING(../listing) // CHECK: warning: unknown pragma 'listing on "../listing"'
... |
Correct import path to match RN 0.40 | #import "RCTBridgeModule.h"
@interface KCKeepAwake : NSObject <RCTBridgeModule>
@end
| #import <React/RCTBridgeModule.h>
@interface KCKeepAwake : NSObject <RCTBridgeModule>
@end
|
Fix solution to Exercise 1-12. | /*
* A solution to Exercise 1-12 in The C Programming Language (Second Edition).
*
* This file was written by Damien Dart <damiendart@pobox.com>. This is free
* and unencumbered software released into the public domain. For more
* information, please refer to the accompanying "UNLICENCE" file.
*/
#include <stdbo... | /*
* A solution to Exercise 1-12 in The C Programming Language (Second Edition).
*
* This file was written by Damien Dart <damiendart@pobox.com>. This is free
* and unencumbered software released into the public domain. For more
* information, please refer to the accompanying "UNLICENCE" file.
*/
#include <stdbo... |
Fix timezone data path for Unix and win32. | /*-------------------------------------------------------------------------
*
* pgtz.c
* Timezone Library Integration Functions
*
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.5 2004/05/01 01:38:53 momjian Exp $
*
*-... | /*-------------------------------------------------------------------------
*
* pgtz.c
* Timezone Library Integration Functions
*
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.6 2004/05/01 22:07:03 momjian Exp $
*
*-... |
Remove including <complex.h> in test case, and change to use _Complex instead. | // RUN: %clang -target aarch64-linux-gnuabi %s -O3 -S -emit-llvm -o - | FileCheck %s
#include <complex.h>
complex long double a, b, c, d;
void test_fp128_compound_assign(void) {
// CHECK: tail call { fp128, fp128 } @__multc3
a *= b;
// CHECK: tail call { fp128, fp128 } @__divtc3
c /= d;
}
| // RUN: %clang -target aarch64-linux-gnuabi %s -O3 -S -emit-llvm -o - | FileCheck %s
_Complex long double a, b, c, d;
void test_fp128_compound_assign(void) {
// CHECK: tail call { fp128, fp128 } @__multc3
a *= b;
// CHECK: tail call { fp128, fp128 } @__divtc3
c /= d;
}
|
Integrate mbed OS RTC with mbed TLS | /**
* Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* 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/l... | /**
* Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* 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/l... |
Remove 'explicit' on copy constructor | #ifndef CELL_H
#define CELL_H
#include <map>
#include <vector>
#include "number.h"
class Cell {
public:
Cell();
explicit Cell(const Cell &rhs);
explicit Cell(Cell *value);
explicit Cell(bool value);
explicit Cell(Number value);
explicit Cell(const std::string &value);
explicit Cell(const ... | #ifndef CELL_H
#define CELL_H
#include <map>
#include <vector>
#include "number.h"
class Cell {
public:
Cell();
Cell(const Cell &rhs);
explicit Cell(Cell *value);
explicit Cell(bool value);
explicit Cell(Number value);
explicit Cell(const std::string &value);
explicit Cell(const char *val... |
Remove getZip() which got there by mistake | #ifndef QUAZIP_TEST_QUAZIP_H
#define QUAZIP_TEST_QUAZIP_H
#include <QObject>
class TestQuaZip: public QObject {
Q_OBJECT
private slots:
void getFileList_data();
void getFileList();
void getZip();
};
#endif // QUAZIP_TEST_QUAZIP_H
| #ifndef QUAZIP_TEST_QUAZIP_H
#define QUAZIP_TEST_QUAZIP_H
#include <QObject>
class TestQuaZip: public QObject {
Q_OBJECT
private slots:
void getFileList_data();
void getFileList();
};
#endif // QUAZIP_TEST_QUAZIP_H
|
Use gint to store index | #ifndef _FAKE_LOCK_SCREEN_PATTERN_H_
#define _FAKE_LOCK_SCREEN_PATTERN_H_
#include <gtk/gtk.h>
#if !GTK_CHECK_VERSION(3, 0, 0)
typedef struct {
gdouble red;
gdouble green;
gdouble blue;
gdouble alpha;
} GdkRGBA;
#endif
typedef struct _FakeLockOption {
void *module;
gchar *real;
gchar *dummy;
} FakeLock... | #ifndef _FAKE_LOCK_SCREEN_PATTERN_H_
#define _FAKE_LOCK_SCREEN_PATTERN_H_
#include <gtk/gtk.h>
#if !GTK_CHECK_VERSION(3, 0, 0)
typedef struct {
gdouble red;
gdouble green;
gdouble blue;
gdouble alpha;
} GdkRGBA;
#endif
typedef struct _FakeLockOption {
void *module;
gchar *real;
gchar *dummy;
} FakeLock... |
Add file to handle executing commands from stdin | #ifndef _WISH_COMMANDER
#define _WISH_COMMANDER
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/wait.h>
char *exit_color;
int execute(char *path, char *arg_arr[]) {
int pid;
if (!(pid = fork())) {
execvp(path, arg_arr);
// This i... | |
Use a different way of handling no host commands | /* Copyright 2021 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#if !defined(__CROS_EC_HOST_COMMAND_H) || \
defined(__CROS_EC_ZEPHYR_HOST_COMMAND_H)
#error "This file must only be included from host_command.h. ... | /* Copyright 2021 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#if !defined(__CROS_EC_HOST_COMMAND_H) || \
defined(__CROS_EC_ZEPHYR_HOST_COMMAND_H)
#error "This file must only be included from host_command.h. ... |
Add header with structs representing basic display types | /* Copyright (c) 2013 Adam Dej
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, s... | |
Remove LTO dependency from test | // RUN: %clang_profgen -o %t -O3 -flto %s
// RUN: env LLVM_PROFILE_FILE=%t.profraw %t
// RUN: llvm-profdata merge -o %t.profdata %t.profraw
// RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s
int main(int argc, const char *argv[]) {
// CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !1... | // RUN: %clang_profgen -o %t -O3 %s
// RUN: env LLVM_PROFILE_FILE=%t.profraw %t
// RUN: llvm-profdata merge -o %t.profdata %t.profraw
// RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s
int main(int argc, const char *argv[]) {
// CHECK: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof !1
if (... |
Add missing import for UIControl+SAMAdditions.h | //
// SAMCategories.h
// SAMCategories
//
// Created by Sam Soffes on 7/17/13.
// Copyright 2013 Sam Soffes. All rights reserved.
//
// Foundation
#import "NSArray+SAMAdditions.h"
#import "NSData+SAMAdditions.h"
#import "NSDate+SAMAdditions.h"
#import "NSDictionary+SAMAdditions.h"
#import "NSNumber+SAMAdditions.h"... | //
// SAMCategories.h
// SAMCategories
//
// Created by Sam Soffes on 7/17/13.
// Copyright 2013 Sam Soffes. All rights reserved.
//
// Foundation
#import "NSArray+SAMAdditions.h"
#import "NSData+SAMAdditions.h"
#import "NSDate+SAMAdditions.h"
#import "NSDictionary+SAMAdditions.h"
#import "NSNumber+SAMAdditions.h"... |
Test non-finite soft float addition | #include "src/math/reinterpret.h"
#include <assert.h>
long double __addtf3(long double, long double);
static _Bool equivalent(long double x, long double y)
{
if (x != x)
return y != y;
return reinterpret(unsigned __int128, x) == reinterpret(unsigned __int128, y);
}
static _Bool run(long double x, lo... | #include "src/math/reinterpret.h"
#include <math.h>
#include <assert.h>
long double __addtf3(long double, long double);
static _Bool run(long double x, long double y)
{
return reinterpret(unsigned __int128, x + y) == reinterpret(unsigned __int128, __addtf3(x, y));
}
int main(void)
{
assert(isnan(__addtf3(NAN... |
Fix the build on Windows | #ifndef __CLAR_TEST_ATTR_EXPECT__
#define __CLAR_TEST_ATTR_EXPECT__
enum attr_expect_t {
EXPECT_FALSE,
EXPECT_TRUE,
EXPECT_UNDEFINED,
EXPECT_STRING
};
struct attr_expected {
const char *path;
const char *attr;
enum attr_expect_t expected;
const char *expected_str;
};
static inline void attr_check_expected(
... | #ifndef __CLAR_TEST_ATTR_EXPECT__
#define __CLAR_TEST_ATTR_EXPECT__
enum attr_expect_t {
EXPECT_FALSE,
EXPECT_TRUE,
EXPECT_UNDEFINED,
EXPECT_STRING
};
struct attr_expected {
const char *path;
const char *attr;
enum attr_expect_t expected;
const char *expected_str;
};
GIT_INLINE(void) attr_check_expected(
en... |
Bump the version number for development. | /*
* Copyright (C) 2011 by Nelson Elhage
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, pu... | /*
* Copyright (C) 2011 by Nelson Elhage
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, pu... |
Move method after property declaration | //
// EditPatientForm.h
// OpenMRS-iOS
//
// Created by Yousef Hamza on 7/5/15.
// Copyright (c) 2015 Erway Software. All rights reserved.
//
#import "XLForm.h"
#import "XLFormViewController.h"
#import "MRSPatient.h"
@interface EditPatientForm : XLFormViewController <UIAlertViewDelegate>
- (instancetype)initWith... | //
// EditPatientForm.h
// OpenMRS-iOS
//
// Created by Yousef Hamza on 7/5/15.
// Copyright (c) 2015 Erway Software. All rights reserved.
//
#import "XLForm.h"
#import "XLFormViewController.h"
#import "MRSPatient.h"
@interface EditPatientForm : XLFormViewController <UIAlertViewDelegate>
@property (nonatomic, st... |
Fix the *longjmp() behaviour - it is legal to reuse a jmp_buf several times. Gets us a working perl 5.8. | /* $OpenBSD: setjmp.h,v 1.6 2001/08/12 12:03:02 heko Exp $ */
/*
* machine/setjmp.h: machine dependent setjmp-related information.
*/
#ifndef __MACHINE_SETJMP_H__
#define __MACHINE_SETJMP_H__
#define _JBLEN 22 /* size, in longs, of a jmp_buf */
#endif /* __MACHINE_SETJMP_H__ */
| /* $OpenBSD: setjmp.h,v 1.7 2003/08/01 07:41:33 miod Exp $ */
/*
* machine/setjmp.h: machine dependent setjmp-related information.
*/
#ifndef __MACHINE_SETJMP_H__
#define __MACHINE_SETJMP_H__
#define _JBLEN 21 /* size, in longs, of a jmp_buf */
#endif /* __MACHINE_SETJMP_H__ */
|
Add the vpsc library for IPSEPCOLA features | /**
* \brief A block structure defined over the variables
*
* A block structure defined over the variables such that each block contains
* 1 or more variables, with the invariant that all constraints inside a block
* are satisfied by keeping the variables fixed relative to one another
*
* Authors:
* Tim Dwyer... | |
Fix build on FreeBSD after r196141 | //===-- lldb-python.h --------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------------... | //===-- lldb-python.h --------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------------... |
Initialize variable in the declaration | #include <pal.h>
/**
*
* Converts integer values in 'a' to floating point values.
*
* @param a Pointer to input vector
*
* @param c Pointer to output vector
*
* @param n Size of 'a' and 'c' vector.
*
* @param p Number of processor to use (task parallelism)
*
* @param team Team to work with... | #include <pal.h>
/**
*
* Converts integer values in 'a' to floating point values.
*
* @param a Pointer to input vector
*
* @param c Pointer to output vector
*
* @param n Size of 'a' and 'c' vector.
*
* @param p Number of processor to use (task parallelism)
*
* @param team Team to work with... |
Move AliD0toKpi* and AliBtoJPSI* from libPWG3base to libPWG3 (Andrea) | #ifdef __CINT__
#pragma link off all glols;
#pragma link off all classes;
#pragma link off all functions;
#endif
| #ifdef __CINT__
#pragma link off all glols;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class AliD0toKpi+;
#pragma link C++ class AliD0toKpiAnalysis+;
#pragma link C++ class AliBtoJPSItoEle+;
#pragma link C++ class AliBtoJPSItoEleAnalysis+;
#endif
|
Move run into new method | #include <stdio.h>
unsigned int x;
char in;
void input(void);
void main(void){
x = 0;
input();
}
void input(void){
printf(">> "); /* Bash-like input */
scanf("%c", &in); /* Get char input */
/* Boundary checks */
if(x == 256 || x == -1) x = 0;
/* Operators */
switch(in){
case 'i': case 'x':
... | #include <stdio.h>
unsigned int x;
char in;
void input(void);
void run(char c);
void main(void){
x = 0;
input();
}
void input(void){
printf(">> "); /* Bash-like input */
scanf("%c", &in); /* Get char input */
run(in);
input(); /* Loop */
}
void run(char c){
/* Boundary checks */
if(x == 256 || x == ... |
Convert lsapic to new irq_chip functions | /*
* LSAPIC Interrupt Controller
*
* This takes care of interrupts that are generated by the CPU's
* internal Streamlined Advanced Programmable Interrupt Controller
* (LSAPIC), such as the ITC and IPI interrupts.
*
* Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com... | /*
* LSAPIC Interrupt Controller
*
* This takes care of interrupts that are generated by the CPU's
* internal Streamlined Advanced Programmable Interrupt Controller
* (LSAPIC), such as the ITC and IPI interrupts.
*
* Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com... |
Change product Id to string | #ifndef _PURCHASEEVENT_H_
#define _PURCHASEEVENT_H_
#include <Event.h>
class PurchaseEvent : public Event {
public:
enum Type {
PURCHASE_STATUS
};
PurchaseEvent(double _timestamp, int _productId, Type _type, bool _newPurchase) : Event(_timestamp), type(_type), newPurchase(_newPurchase), productId(_productId)... | #ifndef _PURCHASEEVENT_H_
#define _PURCHASEEVENT_H_
#include <Event.h>
class PurchaseEvent : public Event {
public:
enum Type {
PURCHASE_STATUS
};
PurchaseEvent(double _timestamp, std::string _productId, Type _type, bool _newPurchase) : Event(_timestamp), type(_type), newPurchase(_newPurchase), productId(_pr... |
Add uobject stub to make the script generator plugin happy | #pragma once
#include <Engine.h>
#include "StubUObject.generated.h"
// This class is only here to make sure we're visible to UHT.
// We need to be visible to UHT so that UE4HaxeExternGenerator works correctly
// (as any script generator must return a module name that is visible to UHT)
// see IScriptGeneratorPluginInt... | |
Add x86 requirement to hopefully fix ppc bots. | // RUN: %clang_cc1 %s -verify -fasm-blocks
#define M __asm int 0x2c
#define M2 int
void t1(void) { M }
void t2(void) { __asm int 0x2c }
void t3(void) { __asm M2 0x2c }
void t4(void) { __asm mov eax, fs:[0x10] }
void t5() {
__asm {
int 0x2c ; } asm comments are fun! }{
}
__asm {}
}
int t6() {
__asm int 3 ;... | // REQUIRES: x86-64-registered-target
// RUN: %clang_cc1 %s -verify -fasm-blocks
#define M __asm int 0x2c
#define M2 int
void t1(void) { M }
void t2(void) { __asm int 0x2c }
void t3(void) { __asm M2 0x2c }
void t4(void) { __asm mov eax, fs:[0x10] }
void t5() {
__asm {
int 0x2c ; } asm comments are fun! }{
}
... |
Add stdbool to the datatype header | // The Mordax Microkernel
// (c) Kristian Klomsten Skordal 2013 <kristian.skordal@gmail.com>
// Report bugs and issues on <http://github.com/skordal/mordax/issues>
#ifndef MORDAX_TYPES_H
#define MORDAX_TYPES_H
#include <stdint.h>
/** Object size type. */
typedef uint32_t size_t;
/** Physical pointer type. */
typede... | // The Mordax Microkernel
// (c) Kristian Klomsten Skordal 2013 <kristian.skordal@gmail.com>
// Report bugs and issues on <http://github.com/skordal/mordax/issues>
#ifndef MORDAX_TYPES_H
#define MORDAX_TYPES_H
#include <stdbool.h>
#include <stdint.h>
/** Object size type. */
typedef uint32_t size_t;
/** Physical po... |
Tweak display of BIOS memory map | #include "bmmap.h"
#include "vty.h"
void bmmap_init() {
}
void bmmap_print() {
vty_puts("BIOS memory map:\n");
vty_printf("%d entries at %p\n",
*bios_memmap_entries_ptr,
bios_memmap_ptr);
vty_printf("ADDR LOW ADDR HI LEN LOW LEN HI ... | #include "bmmap.h"
#include "vty.h"
void bmmap_init() {
}
void bmmap_print() {
vty_puts("BIOS memory map:\n");
vty_printf("%d entries at %p\n",
*bios_memmap_entries_ptr,
bios_memmap_ptr);
vty_printf(" ADDR LEN TY... |
Revert 80939 - Fix clang error TBR=jam@chromium.org | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#pragma once
#include "content/browser/... | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
#pragma once
#include "content/browser/... |
Convert postprocessors to pragma once | #ifndef REFLECTIONCOEFFICIENT_H
#define REFLECTIONCOEFFICIENT_H
#include "SidePostprocessor.h"
#include "MooseVariableInterface.h"
class ReflectionCoefficient;
template <>
InputParameters validParams<ReflectionCoefficient>();
class ReflectionCoefficient : public SidePostprocessor, public MooseVariableInterface<Real... | #pragma once
#include "SidePostprocessor.h"
#include "MooseVariableInterface.h"
class ReflectionCoefficient;
template <>
InputParameters validParams<ReflectionCoefficient>();
class ReflectionCoefficient : public SidePostprocessor, public MooseVariableInterface<Real>
{
public:
ReflectionCoefficient(const InputPara... |
Use Python.h, not allobjects.h. Don't call initall() (Experimental incompatible change!!!!!!) | /*
Entry point for the Windows NT DLL.
About the only reason for having this, is so initall() can automatically
be called, removing that burden (and possible source of frustration if
forgotten) from the programmer.
*/
#include "windows.h"
/* NT and Python share these */
#undef INCREF
#undef DECREF
#include "config... | /*
Entry point for the Windows NT DLL.
About the only reason for having this, is so initall() can automatically
be called, removing that burden (and possible source of frustration if
forgotten) from the programmer.
*/
#include "windows.h"
/* NT and Python share these */
#include "config.h"
#include "Python.h"
HMO... |
Fix layout (delete empty string) | /*
* Copyright (C) 2014-2015 Pavel Dolgov
*
* See the LICENSE file for terms of use.
*/
#include <stdio.h>
#define TOWER1 1
#define TOWER2 3
void hanoi(int a, int n1, int n2) {
if (a == 1) { // end of recursion
printf("%d %d %d\n", a, n1, n2);
} else {
int x, na;
for (x = TOWER1... | /*
* Copyright (C) 2014-2015 Pavel Dolgov
*
* See the LICENSE file for terms of use.
*/
#include <stdio.h>
#define TOWER1 1
#define TOWER2 3
void hanoi(int a, int n1, int n2) {
if (a == 1) { // end of recursion
printf("%d %d %d\n", a, n1, n2);
} else {
int x, na;
for (x = TOWER1... |
Change styling convention of the variable names | #pragma once // This guarantees that the code is included only once in the game.
#include "SFML/Window.hpp"
#include "SFML/Graphics.hpp"
class Game {
public:
// Objects declared static are allocated storage in static storage area, and have scope till the end of the program.
static void Start();
... | #ifndef GAME_H // This guarentees that the code is included only once in the game.
#define GAME_H
#include "SFML/Graphics.hpp"
#include "SFML/Window.hpp"
class Game {
public:
// Objects declared static are allocated storage in static storage area, and have scope till the end of the program.
static... |
Update new files with SymmTensor changes | #ifndef ELASTIC_H
#define ELASTIC_H
#include "MaterialModel.h"
// Forward declarations
class ElasticityTensor;
class Elastic;
template<>
InputParameters validParams<Elastic>();
class Elastic : public MaterialModel
{
public:
Elastic( const std::string & name,
InputParameters parameters );
virtual ~Ela... | #ifndef ELASTIC_H
#define ELASTIC_H
#include "MaterialModel.h"
// Forward declarations
class ElasticityTensor;
class Elastic;
template<>
InputParameters validParams<Elastic>();
class Elastic : public MaterialModel
{
public:
Elastic( const std::string & name,
InputParameters parameters );
virtual ~Ela... |
Work around known GCC 3.4.x problem and use ANSI prototype for dremf(). | /*
* dremf() wrapper for remainderf().
*
* Written by J.T. Conklin, <jtc@wimsey.com>
* Placed into the Public Domain, 1994.
*/
#include "math.h"
#include "math_private.h"
float
dremf(x, y)
float x, y;
{
return remainderf(x, y);
}
| /*
* dremf() wrapper for remainderf().
*
* Written by J.T. Conklin, <jtc@wimsey.com>
* Placed into the Public Domain, 1994.
*/
/* $FreeBSD$ */
#include "math.h"
#include "math_private.h"
float
dremf(float x, float y)
{
return remainderf(x, y);
}
|
Add solution for exercise 16. | #include <stdio.h>
#define MAXLINE 10/*00*/ /* maximum input size */
int _getline(char line[], int maxline);
/* getline is a library function in POSIX; unfortunately on OS X the -ansi flag
doesn't help */
void copy(char to[], char from[]);
main() {
int len;
int max;
char line[MAXLINE];
char longe... | |
Add limits macros for TUINT and TINT | #include <stddef.h>
extern int debug;
#ifndef NDEBUG
#define DBG(...) dbg(__VA_ARGS__)
#define DBGON() (debug = 1)
#else
#define DBG(...)
#define DBGON()
#endif
#define TINT long long
#define TUINT unsigned long long
#define TFLOAT double
struct items {
char **s;
unsigned n;
};
typedef struct a... | #include <stddef.h>
extern int debug;
#ifndef NDEBUG
#define DBG(...) dbg(__VA_ARGS__)
#define DBGON() (debug = 1)
#else
#define DBG(...)
#define DBGON()
#endif
#define TINT long long
#define TUINT unsigned long long
#define TUINT_MAX ULLONG_MAX
#define TINT_MAX LLONG_MAX
#define TFLOAT double... |
Add test where octApron derives non-integer bounds | // SKIP PARAM: --sets ana.activated[+] octApron
#include <assert.h>
void main() {
int x;
if (x <= 10) {
assert((x / 3) <= 3);
}
}
| |
Fix warning for mixing declarations and code in ISO C90. | #include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "greatest.h"
TEST standalone_pass(void) {
PASS();
}
/* Add all the definitions that need to be in the test runner's main file. */
GREATEST_MAIN_DEFS();
int main(int argc, char **argv) {
(void)argc;
(void)argv;
/* Initialize gre... | #include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "greatest.h"
TEST standalone_pass(void) {
PASS();
}
/* Add all the definitions that need to be in the test runner's main file. */
GREATEST_MAIN_DEFS();
int main(int argc, char **argv) {
struct greatest_report_t report;
(void)argc;
(... |
Use <endian.h> for byte order helpers | #ifndef LIBTRADING_BYTE_ORDER_H
#define LIBTRADING_BYTE_ORDER_H
#include "libtrading/types.h"
#include <arpa/inet.h>
static inline be16 cpu_to_be16(u16 value)
{
return htons(value);
}
static inline be32 cpu_to_be32(u32 value)
{
return htonl(value);
}
static inline u16 be16_to_cpu(be16 value)
{
return ntohs(valu... | #ifndef LIBTRADING_BYTE_ORDER_H
#define LIBTRADING_BYTE_ORDER_H
#include <endian.h>
/*
* Little Endian
*/
static inline le16 cpu_to_le16(u16 value)
{
return htole16(value);
}
static inline le32 cpu_to_le32(u32 value)
{
return htole32(value);
}
static inline le64 cpu_to_le64(u64 value)
{
return htole64(value);... |
Add copyright and license header. | #import <Cocoa/Cocoa.h>
@interface WildcardPattern : NSObject {
NSString* pattern_;
}
- (id) initWithString: (NSString*) s;
- (BOOL) isMatch: (NSString*) s;
@end
| /*
* Copyright (c) 2006 KATO Kazuyoshi <kzys@8-p.info>
* This source code is released under the MIT license.
*/
#import <Cocoa/Cocoa.h>
@interface WildcardPattern : NSObject {
NSString* pattern_;
}
- (id) initWithString: (NSString*) s;
- (BOOL) isMatch: (NSString*) s;
@end
|
Change lua_State pointer to LacoState | #ifndef LACO_UTIL_H
#define LACO_UTIL_H
struct LacoState;
struct lua_State;
/**
* Load a line into the lua stack to be evaluated later
*
* param pointer to LacoState
*
* return -1 if there is no line input to load
*/
int laco_load_line(struct LacoState* laco);
/**
* Called after laco_load_line, this ... | #ifndef LACO_UTIL_H
#define LACO_UTIL_H
struct LacoState;
/**
* Load a line into the lua stack to be evaluated later
*
* param pointer to LacoState
*
* return -1 if there is no line input to load
*/
int laco_load_line(struct LacoState* laco);
/**
* Called after laco_load_line, this evaluated the line... |
Return failure if the unexitable loop ever exits ;) | /*
Copyright 2019 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 law or agreed to in ... | /*
Copyright 2019 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 law or agreed to in ... |
Test case for historical reasons | /**
* magical invsqrt function from Quake III code
* see: http://www.codemaestro.com/reviews/9
*/
float InvSqrt(float x)
{
float xhalf = 0.5f*x;
int i = *(int*)&x;
i = 0x5f3759df - (i>>1);
x = *(float*)&i;
x = x*(1.5f-xhalf*x*x);
return x;
}
int main(void) {
int result = InvSqrt(0.00056);
printf("Result: %... | |
Add missing field for breakpoints | #ifndef DEBUGGER_H
#define DEBUGGER_H
enum DebuggerState {
DEBUGGER_PAUSED,
DEBUGGER_RUNNING,
DEBUGGER_EXITING
};
struct ARMDebugger {
enum DebuggerState state;
struct ARMCore* cpu;
char* lastCommand;
};
void ARMDebuggerInit(struct ARMDebugger*, struct ARMCore*);
void ARMDebuggerRun(struct ARMDebugger*);
void... | #ifndef DEBUGGER_H
#define DEBUGGER_H
enum DebuggerState {
DEBUGGER_PAUSED,
DEBUGGER_RUNNING,
DEBUGGER_EXITING
};
struct ARMDebugger {
enum DebuggerState state;
struct ARMCore* cpu;
char* lastCommand;
struct DebugBreakpoint* breakpoints;
};
void ARMDebuggerInit(struct ARMDebugger*, struct ARMCore*);
void ARM... |
Check args count in test i2c terminal command | #include <stdint.h>
#include <string.h>
#include "obc.h"
#include "system.h"
#include "terminal.h"
void I2CTestCommandHandler(uint16_t argc, char* argv[])
{
UNREFERENCED_PARAMETER(argc);
I2CBus* bus;
if (strcmp(argv[0], "system") == 0)
{
bus = Main.I2C.System;
}
else if (strcmp(argv[... | #include <stdint.h>
#include <string.h>
#include "obc.h"
#include "system.h"
#include "terminal.h"
void I2CTestCommandHandler(uint16_t argc, char* argv[])
{
UNREFERENCED_PARAMETER(argc);
if (argc != 3)
{
TerminalPuts("i2c <system|payload> <device> <data>\n");
return;
}
I2CBus* bu... |
Fix HTMLReader include when using dynamic frameworks | /*
Copyright (c) 2012 Curtis Hard - GeekyGoodness
*/
/*
Modified by Denis Zamataev. 2014
*/
#import <Foundation/Foundation.h>
#import <HTMLReader.h>
#import "DZReadability_constants.h"
typedef void (^GGReadabilityParserCompletionHandler)( NSString * content );
typedef void (^GGReadabilityParserErrorHandler)( N... | /*
Copyright (c) 2012 Curtis Hard - GeekyGoodness
*/
/*
Modified by Denis Zamataev. 2014
*/
#import <Foundation/Foundation.h>
#import "HTMLReader.h"
#import "DZReadability_constants.h"
typedef void (^GGReadabilityParserCompletionHandler)( NSString * content );
typedef void (^GGReadabilityParserErrorHandler)( N... |
Add virtual destructor to game state | //
// Created by Borin Ouch on 2016-03-22.
//
#ifndef SFML_TEST_GAME_STATE_H
#define SFML_TEST_GAME_STATE_H
#include "game.h"
class GameState {
public:
Game* game;
virtual void draw(const float dt) = 0;
virtual void update(const float dt) = 0;
virtual void handleInput() = 0;
};
#endif //SFML_TE... | //
// Created by Borin Ouch on 2016-03-22.
//
#ifndef SFML_TEST_GAME_STATE_H
#define SFML_TEST_GAME_STATE_H
#include "game.h"
class GameState {
public:
Game* game;
virtual void draw(const float dt) = 0;
virtual void update(const float dt) = 0;
virtual void handleInput() = 0;
virtual ~GameSta... |
Add ensure for runtime assertion checking | #ifndef __SH_COMMON_H__
#define __SH_COMMON_H__
#include <stdio.h>
#include <stdlib.h>
// ensure is kinda like assert but it is always executed
#define ensure(p, msg) \
do { \
if (!(p)) { ... | |
Increase the efficiency of multithreading. This should slightly slightly increase frame rate. | // This is a queue that can be accessed from multiple threads safely.
//
// It's not well optimized, and requires obtaining a lock every time you check for a new value.
#pragma once
#include <condition_variable>
#include <mutex>
#include <optional>
#include <queue>
template <class T>
class SynchronizedQueue {
st... | // This is a queue that can be accessed from multiple threads safely.
//
// It's not well optimized, and requires obtaining a lock every time you check for a new value.
#pragma once
#include <condition_variable>
#include <mutex>
#include <optional>
#include <queue>
template <class T>
class SynchronizedQueue {
st... |
Work around sudden disappearance of GdkRegion in GTK+ 2.90.5. | #ifndef __GTK_COMPAT_H__
#define __GTK_COMPAT_H__
#include <gtk/gtk.h>
/* Provide a compatibility layer for accessor functions introduced
* in GTK+ 2.21.1 which we need to build with sealed GDK.
* That way it is still possible to build with GTK+ 2.20.
*/
#if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION < 21) \
|... | #ifndef __GTK_COMPAT_H__
#define __GTK_COMPAT_H__
#include <gtk/gtk.h>
/* Provide a compatibility layer for accessor functions introduced
* in GTK+ 2.21.1 which we need to build with sealed GDK.
* That way it is still possible to build with GTK+ 2.20.
*/
#if (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION < 21) \
|... |
Increase time tolerance to reduce flakiness on slow systems | #include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "wclock.h"
#ifdef _WIN32
# include <windows.h>
static unsigned int sleep(unsigned int x) { Sleep(x * 1000); return 0; }
#else
# include <unistd.h>
#endif
int main(void)
{
double res, t1, t2;
wclock clock;
if (wclock_init... | #include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "wclock.h"
#ifdef _WIN32
# include <windows.h>
static unsigned int sleep(unsigned int x) { Sleep(x * 1000); return 0; }
#else
# include <unistd.h>
#endif
int main(void)
{
double res, t1, t2;
wclock clock;
if (wclock_init... |
Add inline docs for asserts | #include <setjmp.h>
#include <stdarg.h>
#include <stddef.h>
#include <cmocka.h>
#include "cbor.h"
#ifndef ASSERTIONS_H_
#define ASSERTIONS_H_
void assert_uint8(cbor_item_t* item, uint8_t num);
void assert_uint16(cbor_item_t* item, uint16_t num);
void assert_uint32(cbor_item_t* item, uint32_t num);
void assert_uint6... | #include <setjmp.h>
#include <stdarg.h>
#include <stddef.h>
#include <cmocka.h>
#include "cbor.h"
#ifndef ASSERTIONS_H_
#define ASSERTIONS_H_
void assert_uint8(cbor_item_t* item, uint8_t num);
void assert_uint16(cbor_item_t* item, uint16_t num);
void assert_uint32(cbor_item_t* item, uint32_t num);
void assert_uint6... |
Add or replace user extended attributes on a file. | /* setfattr.c - sets user extended attributes for a file.
*
* This program can be viewed as a much simpler version of setfattr(1) utility,
* used to set, remove and list a file's extended attributes. All this program
* can do, however, is to set user EAs.
*
* Usage
*
* $ ./setfattr <name> <value> <file>
*
... | |
Use typedef of useconds_t in unistd | #include <sys/types.h>
#include <pthread.h>
#include "vendor/simclist.h"
#ifndef BUZZLOCK_H_
#define BUZZLOCK_H_
#define BZZ_BLACK 1
#define BZZ_GOLD 0
typedef int useconds_t;
typedef struct {
pid_t id;
int color;
double waiting_since;
} bzz_thread_t;
typedef struct {
pthread_mutex_t mutex;
pthread_cond_t c... | #include <sys/types.h>
#include <unistd.h>
#include <pthread.h>
#include "vendor/simclist.h"
#ifndef BUZZLOCK_H_
#define BUZZLOCK_H_
#define BZZ_BLACK 1
#define BZZ_GOLD 0
typedef struct {
pid_t id;
int color;
double waiting_since;
} bzz_thread_t;
typedef struct {
pthread_mutex_t mutex;
pthread_cond_t cond;
... |
Remove the declaration of DumpBacktrace. | // Copyright 2011 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 2011 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... |
Add category headers to global header. | //
// UIKitCategory.h
// WWCategory
//
// Created by ww on 2016. 1. 10..
// Copyright © 2016년 Won Woo Choi. All rights reserved.
//
#import "UIApplication+Keyboard.h"
#import "UIBezierPath+Drawing.h"
#import "UIColor+CreateColor.h"
#import "UIImage+CreateImage.h"
#import "UIImage+ImageProcessing.h"
#import "UIImag... | //
// UIKitCategory.h
// WWCategory
//
// Created by ww on 2016. 1. 10..
// Copyright © 2016년 Won Woo Choi. All rights reserved.
//
#import "UIApplication+Keyboard.h"
#import "UIApplication+TopmostViewController.h"
#import "UIBarButtonItem+Block.h"
#import "UIBezierPath+Drawing.h"
#import "UIButton+Align.h"
#impor... |
Add unified state of the game | /*
* Copyright (C) 2015 Luke San Antonio
* All rights reserved.
*/
#pragma once
#include "../common/id_map.hpp"
#include "boat.h"
#include "../collisionlib/motion.h"
namespace redc { namespace sail
{
struct Player
{
std::string name;
bool spawned;
Hull_Desc boat_config;
collis::Motion boat_motio... | |
Drop dmalloc.h, not needed. Drop dmalloc.h, not needed. Use strncpy for portability, we do not want this function to rely on mastring. | /**
* \file inet_ntop
* inet_ntop emulation based on inet_ntoa.
* \author Matthias Andree
*
*/
#include "config.h"
#ifndef HAVE_INET_NTOP
#include "leafnode.h"
#include "mastring.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#ifdef WITH_DMALLO... | /**
* \file inet_ntop
* inet_ntop emulation based on inet_ntoa.
* \author Matthias Andree
*
*/
#include "config.h"
#if !HAVE_INET_NTOP
#include "leafnode.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <string.h>
const char *
inet_ntop... |
Add program for testing large openslide_read_region() calls | /* Test program to make a single openslide_read_region() call and write the
result as a PPM. */
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <assert.h>
#include <openslide.h>
int main(int argc, char **argv) {
if (argc != 7) {
printf("Arguments: slide out.ppm x y w... | |
Test case for B0 -> mu | #ifndef ALI_DECAYER__H
#define ALI_DECAYER__H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
#include "RVersion.h"
#include "TVirtualMCDecayer.h"
typedef TVirtualMCDecayer AliDecayer;
#if ROOT_VERSIO... | #ifndef ALI_DECAYER__H
#define ALI_DECAYER__H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
#include "RVersion.h"
#include "TVirtualMCDecayer.h"
typedef TVirtualMCDecayer AliDecayer;
#if ROOT_VERSIO... |
Delete unneeded pt_regs forward declaration. | /**
* @file arch/alpha/oprofile/op_impl.h
*
* @remark Copyright 2002 OProfile authors
* @remark Read the file COPYING
*
* @author Richard Henderson <rth@twiddle.net>
*/
#ifndef OP_IMPL_H
#define OP_IMPL_H 1
struct pt_regs;
extern int null_perf_irq(void);
extern int (*perf_irq)(void);
/* Per-counter configura... | /**
* @file arch/alpha/oprofile/op_impl.h
*
* @remark Copyright 2002 OProfile authors
* @remark Read the file COPYING
*
* @author Richard Henderson <rth@twiddle.net>
*/
#ifndef OP_IMPL_H
#define OP_IMPL_H 1
extern int null_perf_irq(void);
extern int (*perf_irq)(void);
/* Per-counter configuration as set via o... |
Add a missing "REQUIRES: system-windows" to a Windows-only test. | // Test coverage flag.
//
// RUN: %clang_cl -### -coverage %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CLANG-CL-COVERAGE %s
// CLANG-CL-COVERAGE-NOT: error:
// CLANG-CL-COVERAGE-NOT: warning:
// CLANG-CL-COVERAGE-NOT: argument unused
// CLANG-CL-COVERAGE-NOT: unknown argument
| // Test coverage flag.
// REQUIRES: system-windows
//
// RUN: %clang_cl -### -coverage %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CLANG-CL-COVERAGE %s
// CLANG-CL-COVERAGE-NOT: error:
// CLANG-CL-COVERAGE-NOT: warning:
// CLANG-CL-COVERAGE-NOT: argument unused
// CLANG-CL-COVERAGE-NOT: unknown argument
|
Add passing of request frame to parsing functions | //Basic master parser
extern uint8_t MODBUSParseResponseBasic( union MODBUSParser * );
| //Basic master parser
extern uint8_t MODBUSParseResponseBasic( union MODBUSParser *, union MODBUSParser * );
|
Change the solver handling of arrays. Previously we were calling compat on the pointers underneath matching arrays. However, this led to problems: union { char a[8]; int b[2]; } This is in fact fine, but we'd end up with compat edges between a node pointing to char and a node pointing to int and they wouldn't be congru... | #include "../small1/testharness.h"
// NUMERRORS 1
struct foo {
int a[8];
int *b;
} gfoo;
struct bar {
int a[8];
int *b;
};
int main() {
int * __INDEX p = & gfoo.a[2]; // Force gfoo.a to have a length
// This should be Ok, but pbar->b is gfoo.a[7]
struct bar *pbar = (struct bar*)&gfoo;
gfoo.a[7] = ... | #include "../small1/testharness.h"
#include "../small1/testkinds.h"
// NUMERRORS 3
struct foo {
int a[8];
int *b;
} gfoo;
struct bar {
int a[8];
int *b;
};
#if ERROR == 2
struct s1 {
int a[8];
int *b;
} * s1;
struct s2 {
int *c;
int d[8];
} * s2;
#endif
#if ERROR == 3
struct s_with_index {
int ... |
Update files, Alura, Introdução a C - Parte 2, Aula 4.3 | #include <stdio.h>
void abertura(int m) {
printf("Tabuada do %d\n", m);
}
int main() {
int multiplicador = 2;
abertura(multiplicador);
for(int i = 1; i <= 10; i++) {
printf("%d x %d = %d\n", multiplicador, i, multiplicador * i);
}
}
| |
Test for parsing assignment in a ?:'s rhs | // RUN: %check -e %s
f(int a, int b, int dir)
{
struct
{
int x, y;
} c = { };
a & b ? c.x += dir : c.y += dir; // CHECK: error: assignment to int/if - not an lvalue
}
| |
Add an empty header that will contain defines concerning the document structure | /* libvisio
* Copyright (C) 2011 Fridrich Strba <fridrich.strba@bluewin.ch>
* Copyright (C) 2011 Eilidh McAdam <tibbylickle@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundat... | |
Add getters for width/height of renderer | #pragma once
#include <boost/container/vector.hpp>
#include "System.h"
class Renderer : public System {
protected:
uint16_t width = 1280;
uint16_t height = 720;
Decimal fovPlus = glm::radians(10.0f);
Decimal zNear = 0.05f;
Decimal zFar = 48.0f;
Decimal pixelDistanceFromScreen = 1000.0f;
public:
bool showFPS = ... | #pragma once
#include <boost/container/vector.hpp>
#include "System.h"
class Renderer : public System {
protected:
uint16_t width = 1280;
uint16_t height = 720;
Decimal fovPlus = glm::radians(10.0f);
Decimal zNear = 0.05f;
Decimal zFar = 48.0f;
Decimal pixelDistanceFromScreen = 1000.0f;
public:
bool showFPS = ... |
Add test case for casting addresses to function pointers | void abort();
int add(int a, int b) { return a + b; }
int sub(int a, int b) { return a - b; }
int mul(int a, int b) { return a * b; }
int div(int a, int b) { return a / b; }
int rem(int a, int b) { return a % b; }
long *arr[5] = {(long *)&add, (long *)&sub, (long *)&mul, (long *)&div, (long *)&rem };
int main() {
... | |
Add a note about FrameAccessor | //
// UIView+Sizing.h
// aaah
//
// Created by Stanislaw Pankevich on 5/10/13.
// Copyright (c) 2013 IProjecting. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (Sizing)
@property CGPoint origin;
@property CGSize size;
@property CGFloat x;
@property CGFloat y;
@property CGFloat height;
@prope... | // Inspired by FrameAccessor
// https://github.com/AlexDenisov/FrameAccessor/
#import <UIKit/UIKit.h>
@interface UIView (Sizing)
@property CGPoint origin;
@property CGSize size;
@property CGFloat x;
@property CGFloat y;
@property CGFloat height;
@property CGFloat width;
@property CGFloat centerX;
@property CGFloat... |
Fix a WinAPI VirtualFree bug. | //
// os/winapi/alloc.h: Low-level WinAPI-based allocators.
//
// CEN64: Cycle-Accurate Nintendo 64 Simulator.
// Copyright (C) 2014, Tyler J. Stachecki.
//
// This file is subject to the terms and conditions defined in
// 'LICENSE', which is part of this source code package.
//
#include "common.h"
#include "os/common... | //
// os/winapi/alloc.h: Low-level WinAPI-based allocators.
//
// CEN64: Cycle-Accurate Nintendo 64 Simulator.
// Copyright (C) 2014, Tyler J. Stachecki.
//
// This file is subject to the terms and conditions defined in
// 'LICENSE', which is part of this source code package.
//
#include "common.h"
#include "os/common... |
Add header to extend server for arduinojson | // ESPasyncJson.h
/*
Async Response to use with arduinoJson and asyncwebserver
Written by Andrew Melvin (SticilFace) with help from me-no-dev and BBlanchon.
example of callback in use
server.on("/json", HTTP_ANY, [](AsyncWebServerRequest * request) {
AsyncJsonResponse * response = new AsyncJsonResponse(... | |
Update includes with stuff I'll need | #pragma once
#include <unistd.h>
#include <algorithm>
#include <exception>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
const std::string BotVersion ("3.0.0-devel"... | #pragma once
#include <unistd.h>
#include <algorithm>
#include <cstdarg>
#include <exception>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <thread>
#include <tuple>
#include <unordered_map>
#incl... |
Move functions in correct sectors in game class. | /*
* Game.h
*
* Created on: 30.12.2016
* Author: Stefan
*/
#include "Deck.h"
#include "Dealer.h"
#include <memory>
#include "GlobalDeclarations.h"
#include "PlayerStrategy.h"
#ifndef GAME_H_
#define GAME_H_
// Class game is the glue code which binds all other classes together.
// It guides the game.
class... | /*
* Game.h
*
* Created on: 30.12.2016
* Author: Stefan
*/
#include "Deck.h"
#include "Dealer.h"
#include <memory>
#include "GlobalDeclarations.h"
#include "PlayerStrategy.h"
#ifndef GAME_H_
#define GAME_H_
// Class game is the glue code which binds all other classes together.
// It guides the game.
class... |
Add StreamRedirector class to handle stream resetting with RAII. | #include <libmesh/libmesh.h>
/**
* This class uses RAII to control redirecting the libMesh::err stream
* to NULL and restoring it around some operation where we do not want
* to see output to the screen.
*/
class StreamRedirector
{
public:
/**
* Constructor; saves the original libMesh::err streambuf.
*/
... | |
Allow specifying number of blocks to test | #include <stdio.h>
#include "aes.h"
int
main(int argc, char **argv)
{
aes_init();
return 0;
}
| #include <stdio.h>
#include <stdlib.h>
#include "aes.h"
int
main(int argc, char **argv)
{
long blocks;
char *nptr;
aes_init();
blocks = 10;
if (argc > 1)
{
long b = strtol(argv[1], &nptr, 10);
if (argv[1] != nptr)
{
blocks = b;
}
}
return 0;
}
|
Remove unused text format constants. | /*
* Copyright 2010 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkTextFormatParams_DEFINES
#define SkTextFormatParams_DEFINES
#include "include/core/SkScalar.h"
#include "include/core/SkTypes.h"
// Fraction o... | /*
* Copyright 2010 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkTextFormatParams_DEFINES
#define SkTextFormatParams_DEFINES
#include "include/core/SkScalar.h"
#include "include/core/SkTypes.h"
// The fracti... |
Fix fatal typo in code guard | // @(#)root/sqlite:$Id$
// Author: o.freyermuth <o.f@cern.ch>, 01/06/2013
/*************************************************************************
* Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* ... | // @(#)root/sqlite:
// Author: o.freyermuth <o.f@cern.ch>, 01/06/2013
/*************************************************************************
* Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* ... |
Replace 'REQUIRES: nozlib' with '!zlib' because we don't need two ways to say the same thing. | // REQUIRES: nozlib
// RUN: %clang -### -fintegrated-as -gz -c %s 2>&1 | FileCheck %s -check-prefix CHECK-WARN
// RUN: %clang -### -fintegrated-as -gz=none -c %s 2>&1 | FileCheck -allow-empty -check-prefix CHECK-NOWARN %s
// CHECK-WARN: warning: cannot compress debug sections (zlib not installed)
// CHECK-NOWARN-NOT:... | // REQUIRES: !zlib
// RUN: %clang -### -fintegrated-as -gz -c %s 2>&1 | FileCheck %s -check-prefix CHECK-WARN
// RUN: %clang -### -fintegrated-as -gz=none -c %s 2>&1 | FileCheck -allow-empty -check-prefix CHECK-NOWARN %s
// CHECK-WARN: warning: cannot compress debug sections (zlib not installed)
// CHECK-NOWARN-NOT: ... |
Use macro in example code | #include <stdio.h>
#include "bincookie.h"
int main(int argc, char *argv[]) {
if (argc != 2) {
printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]);
printf("Example: %s Cookies.binarycookies\n", argv[0]);
return 1;
}
binarycookies_t *bc = binarycookies_init(argv... | #include <stdio.h>
#include "bincookie.h"
int main(int argc, char *argv[]) {
if (argc != 2) {
printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]);
printf("Example: %s Cookies.binarycookies\n", argv[0]);
return 1;
}
binarycookies_t *bc = binarycookies_init(argv... |
Fix C issue in NativeCall tests. | #include <stdio.h>
#include <string.h>
#ifdef WIN32
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT extern
#endif
DLLEXPORT void * ReturnSomePointer()
{
char *x = "Got passed back the pointer I returned";
return x;
}
DLLEXPORT int CompareSomePointer(void *ptr)
{
int x = strcmp("Got passed... | #include <stdio.h>
#include <string.h>
#ifdef WIN32
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT extern
#endif
DLLEXPORT void * ReturnSomePointer()
{
return strdup("Got passed back the pointer I returned");
}
DLLEXPORT int CompareSomePointer(void *ptr)
{
int x = strcmp("Got passed back the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.