Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add header and footer comments | #if !defined(PARROT_ENUMS_H_GUARD)
#define PARROT_ENUMS_H_GUARD
typedef enum {
NO_STACK_ENTRY_TYPE = 0,
STACK_ENTRY_INT = 1,
STACK_ENTRY_FLOAT = 2,
STACK_ENTRY_STRING = 3,
STACK_ENTRY_PMC = 4,
STACK_ENTRY_POINTER = 5,
STACK_ENTRY_DESTINATION = 6
} Stack_en... | /* enums.h
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* Overview:
* enums shared by much of the stack-handling code
* Data Structure and Algorithms:
* History:
* Notes:
* References:
*/
#if !defined(PARROT_ENUMS_H_GUARD)
#define PARROT_ENUMS_H_GUARD
typedef enum {
NO_STAC... |
Make cart and apu members private | #ifndef CONSOLE_H
#define CONSOLE_H
#include <string>
#include <Cart.h>
#include <Controller.h>
#include <CPU.h>
#include <PPU.h>
#include <APU.h>
class Divider {
public:
Divider(int interval = 1) {
setInterval(interval);
}
void setInterval(int interval) {
this->interval = interval;
clockCounter = int... | #ifndef CONSOLE_H
#define CONSOLE_H
#include <string>
#include <Cart.h>
#include <Controller.h>
#include <CPU.h>
#include <PPU.h>
#include <APU.h>
class Divider {
public:
Divider(int interval = 1) {
setInterval(interval);
}
void setInterval(int interval) {
this->interval = interval;
clockCounter = int... |
Fix some wording for unit tests. | #include <stdio.h>
#include <stdlib.h>
#include "../libcpsl.h"
#include <signal.h>
#define RUNTEST(x) ((CurrentTest = #x), x(), printf("Test \"%s\" passed.\n", #x))
static const char *CurrentTest = NULL;
static void SigHandler(const int Signal);
static inline void InitTestUnit(void)
{
CPSL_Configure(malloc, free, ... | #include <stdio.h>
#include <stdlib.h>
#include "../libcpsl.h"
#include <signal.h>
#define RUNTEST(x) ((CurrentTest = #x), x(), printf("Subtest \"%s\" passed.\n", #x))
static const char *CurrentTest = NULL;
static void SigHandler(const int Signal);
static inline void InitTestUnit(void)
{
CPSL_Configure(malloc, fre... |
Return answer when multiple or divide | #include "calc.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
int calc(const char* p, int mul_div_flag)
{
int i;
int ans;
ans = atoi(p);
i = 0;
while (p[i] != '\0'){
while (isdigit(p[i])){
i++;
}
switch (p[i]){
case '+':
... | #include "calc.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
int calc(const char* p, int mul_div_flag)
{
int i;
int ans;
ans = atoi(p);
if (p[0] != '(' && mul_div_flag == 1){
return (ans);
}
i = 0;
while (p[i] != '\0'){
while (isdigit(p[i])){
i++... |
Add solution for problem 80 | #include <stdio.h>
#include <math.h>
#include <gmp.h>
int is_perfect_sq(int n)
{
int s = sqrt(n);
return s * s == n;
}
int main(void)
{
// 10^100 ~< 2^400
mpf_set_default_prec(512);
mpf_t a;
mpf_init(a);
int total_sum = 0;
// Count through 100 irrational roots
for (int i = 2; i <... | |
Add back virtual dtor for IOperation | #pragma once
#ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_
#define YOU_DATASTORE_INTERNAL_OPERATION_H_
#include <unordered_map>
#include "../task_typedefs.h"
namespace You {
namespace DataStore {
/// A pure virtual class of operations to be put into transaction stack
class IOperation {
public:
/// Executes the operat... | #pragma once
#ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_
#define YOU_DATASTORE_INTERNAL_OPERATION_H_
#include <unordered_map>
#include "../task_typedefs.h"
namespace You {
namespace DataStore {
/// A pure virtual class of operations to be put into transaction stack
class IOperation {
public:
virtual ~IOperation();
... |
Fix typo in macro guard HTCONDOR-390 | /***************************************************************
*
* Copyright (C) 1990-2021, Condor Team, Computer Sciences Department,
* University of Wisconsin-Madison, WI.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in compliance with the License. You may... | /***************************************************************
*
* Copyright (C) 1990-2021, Condor Team, Computer Sciences Department,
* University of Wisconsin-Madison, WI.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in compliance with the License. You may... |
Define UIBackgroundTaskIdentifier if on OS X | //
// TMCacheBackgroundTaskManager.h
// TMCache
//
// Created by Bryan Irace on 4/24/15.
// Copyright (c) 2015 Tumblr. All rights reserved.
//
@import UIKit;
/**
A protocol that classes who can begin and end background tasks can conform to. This protocol provides an abstraction in
order to avoid referencing `+ ... | //
// TMCacheBackgroundTaskManager.h
// TMCache
//
// Created by Bryan Irace on 4/24/15.
// Copyright (c) 2015 Tumblr. All rights reserved.
//
@import UIKit;
#ifndef __IPHONE_OS_VERSION_MIN_REQUIRED
typedef NSUInteger UIBackgroundTaskIdentifier;
#endif
/**
A protocol that classes who can begin and end backgroun... |
Fix compiler warning in IAR | #pragma once
namespace TupleManipulation {
template<int... Integers>
struct sequence { };
template<int N, int... Integers>
struct gen_sequence : public gen_sequence<N - 1, N - 1, Integers...> { };
template<int... Integers>
struct gen_sequence<0, Integers...> : public sequence<Integers...> { };
... | #pragma once
namespace TupleManipulation {
template<int... Integers>
struct sequence { };
template<int N, int... Integers>
struct gen_sequence : public gen_sequence<N - 1, N - 1, Integers...> { };
template<int... Integers>
struct gen_sequence<0, Integers...> : public sequence<Integers...> { };
... |
Fix building error on Linux | #ifndef windowManager_H
#define windowManager_H
#include <iostream>
// GLEW
#define GLEW_STATIC
#include <GL/glew.h>
// GLFW
#include <GLFW/glfw3.h>
class windowManager
{
public:
void init();
void windowManager::getScreenSize();
//Functions to return dimensions of window
int getWindowHeight();
int getWindow... | #ifndef windowManager_H
#define windowManager_H
#include <iostream>
// GLEW
#define GLEW_STATIC
#include <GL/glew.h>
// GLFW
#include <GLFW/glfw3.h>
class windowManager
{
public:
void init();
void getScreenSize();
//Functions to return dimensions of window
int getWindowHeight();
int getWindowWidth();
GLFWw... |
Allow parsing firmware with fwupdtool | /*
* Copyright (C) 2019 Richard Hughes <richard@hughsie.com>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#include "config.h"
#include "fu-plugin-vfuncs.h"
#include "fu-solokey-device.h"
void
fu_plugin_init (FuPlugin *plugin)
{
fu_plugin_set_build_hash (plugin, FU_BUILD_HASH);
fu_plugin_add_rule (plugin, FU_PLUG... | /*
* Copyright (C) 2019 Richard Hughes <richard@hughsie.com>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#include "config.h"
#include "fu-plugin-vfuncs.h"
#include "fu-solokey-device.h"
#include "fu-solokey-firmware.h"
void
fu_plugin_init (FuPlugin *plugin)
{
fu_plugin_set_build_hash (plugin, FU_BUILD_HASH);
fu... |
Rename GuidedSectionExtraction.h to Crc32GuidedSectonExtraction.h to avoid naming collision with that in MdePkg. Remove the duplicate definition. | /** @file
This file declares GUIDed section extraction protocol.
This interface provides a means of decoding a GUID defined encapsulation
section. There may be multiple different GUIDs associated with the GUIDed
section extraction protocol. That is, all instances of the GUIDed section
extraction proto... | |
Add link to the library | #pragma once
#include <YunMQTTClient.h>
class ShiftrConnector {
public :
void sendCounter(int counter);
void init();
void loop();
//default constructor
ShiftrConnector() {};
private :
YunMQTTClient client;
void connect();
};
| #pragma once
//https://github.com/256dpi/arduino-mqtt
#include <YunMQTTClient.h>
class ShiftrConnector {
public :
void sendCounter(int counter);
void init();
void loop();
//default constructor
ShiftrConnector() {};
private :
YunMQTTClient client;
void connect();
};
|
Remove exposed function from AEAD Chacha20 Poly1305 code | #include "Chacha20.h"
#include "Poly1305_64.h"
void blit(uint8_t* src, uint32_t len, uint8_t* dest, uint32_t pos);
void poly1305_key_gen(uint8_t* otk, uint8_t* key, uint8_t* nonce);
uint32_t hacl_aead_chacha20_poly1305_encrypt(uint8_t *plaintext, uint32_t plaintext_len,
... | #include "Chacha20.h"
#include "Poly1305_64.h"
void poly1305_key_gen(uint8_t* otk, uint8_t* key, uint8_t* nonce);
uint32_t hacl_aead_chacha20_poly1305_encrypt(uint8_t *plaintext, uint32_t plaintext_len,
uint8_t *aad, uint32_t aad_len,
... |
Change rand cache to a struct since everything is public. Add comment. | /*===- RandomNumbers.h - libSimulation -========================================
*
* DEMON
*
* This file is distributed under the BSD Open Source License. See LICENSE.TXT
* for details.
*
*===-----------------------------------------------------------------------===*/
#ifndef RANDOMNU... | /*===- RandomNumbers.h - libSimulation -========================================
*
* DEMON
*
* This file is distributed under the BSD Open Source License. See LICENSE.TXT
* for details.
*
*===-----------------------------------------------------------------------===*/
#ifndef RANDOMNU... |
Make plugins's init() function external C | #ifndef IFACE_H_INCLUDED
#define IFACE_H_INCLUDED
#include <fcntl.h>
typedef struct funcs_t {
unsigned char *(*get_mem_buf_hash)(unsigned char *mem_buf, unsigned long int mem_size);
unsigned char *(*hash_to_str)(unsigned char *mem_hash);
int (*is_mem_buf_dumped)(unsigned char *mem_hash);
void (*dump_mem_buf)(unsi... | #ifndef IFACE_H_INCLUDED
#define IFACE_H_INCLUDED
#include <fcntl.h>
typedef struct plugin_t {
void *hndl;
char *name;
char *description;
struct plugin_t *next;
} plugin_t;
#ifdef __cplusplus
extern "C" plugin_t *init();
#endif
#endif |
Update manual Fix CDROM script to handle non-existant files | /* */
#undef VERSION
#define VERSION "1.35.2"
#define BDATE "28 August 2004"
#define LSMDATE "28Aug04"
/* Debug flags */
#undef DEBUG
#define DEBUG 1
#define TRACEBACK 1
#define SMCHECK
#define TRACE_FILE 1
/* Debug flags not normally turned on */
/* #define TRACE_JCR_CHAIN 1 */
/* #define TRACE_RES 1 */... | /* */
#undef VERSION
#define VERSION "1.35.2"
#define BDATE "30 August 2004"
#define LSMDATE "30Aug04"
/* Debug flags */
#undef DEBUG
#define DEBUG 1
#define TRACEBACK 1
#define SMCHECK
#define TRACE_FILE 1
/* Debug flags not normally turned on */
/* #define TRACE_JCR_CHAIN 1 */
/* #define TRACE_RES 1 */... |
Add unfinished loop to encode message | #include <stdio.h>
#include <cs50.h>
int main(int argc, char *argv[]) {
// check entered key
if (argc != 2 || atoi(argv[1]) < 0) {
printf("Usage: ./caesar k\nWhere k is a non negative integer.\n");
return 1;
}
int key = atoi(argv[1]);
return 0;
}
| #include <stdio.h>
#include <cs50.h>
#include <string.h>
#define ALPHA_NUM 26
int main(int argc, char *argv[]) {
// check argument number and argument key to be greater than -1
if (argc != 2 || atoi(argv[1]) < 0) {
printf("Usage (k >= 0):\n./caesar k \n");
return 1;
}
int key = atoi(a... |
Update min/max global SGIDs values to match Schema Transformer | /*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
#ifndef SRC_BGP_SECURITY_GROUP_SECURITY_GROUP_H_
#define SRC_BGP_SECURITY_GROUP_SECURITY_GROUP_H_
#include <boost/array.hpp>
#include <boost/system/error_code.hpp>
#include <string>
#include "base/parse_object.h"
#include "bgp/bgp_common.h"
c... | /*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
#ifndef SRC_BGP_SECURITY_GROUP_SECURITY_GROUP_H_
#define SRC_BGP_SECURITY_GROUP_SECURITY_GROUP_H_
#include <boost/array.hpp>
#include <boost/system/error_code.hpp>
#include <string>
#include "base/parse_object.h"
#include "bgp/bgp_common.h"
c... |
Add file that SVN somehow missed. | /*
This file is part of the kblog library.
Copyright (c) 2006-2007 Christian Weilbach <christian_weilbach@web.de>
Copyright (c) 2007 Mike Arthur <mike@mikearthur.co.uk>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as publ... | |
Add task with points for October | #include <stdio.h>
void increase_coordinates();
typedef struct {
int x;
int y;
int z;
} Point;
Point pt;
int main () {
printf("x = ");scanf("%d",&pt.x);
printf("y = ");scanf("%d",&pt.y);
printf("z = ");scanf("%d",&pt.z);
increase_coordinates();
printf("\nx = %d", pt.x);
printf("\ny = %d", pt.y);
prin... | |
Add comment on why ana.int.wrap_on_signed_overflow needs to enabled for test case | //PARAM: --enable ana.int.wrap_on_signed_overflow
#include<stdio.h>
#include<assert.h>
int main() {
int i,k,j;
if (k == 5) {
assert(k == 5);
return 0;
}
assert(k != 5);
// simple arithmetic
i = k + 1;
assert(i != 6);
i = k - 1;
assert(i != 4);
i = k * 3; // multiplication with odd n... | //PARAM: --enable ana.int.wrap_on_signed_overflow
// Enabling ana.int.wrap_on_signed_overflow here, to retain precision for cases when a signed overflow might occcur
#include<stdio.h>
#include<assert.h>
int main() {
int i,k,j;
if (k == 5) {
assert(k == 5);
return 0;
}
assert(k != 5);
// Signed over... |
Use quoted includes in umbrella header | //
// KVODelegate.h
// KVODelegate
//
// Created by Ian Gregory on 15-03-2017.
// Copyright © 2017 ThatsJustCheesy. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <KVODelegate/KVOObservationDelegate.h>
#import <KVODelegate/KVONotificationDelegate.h>
| //
// KVODelegate.h
// KVODelegate
//
// Created by Ian Gregory on 15-03-2017.
// Copyright © 2017 ThatsJustCheesy. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "KVOObservationDelegate.h"
#import "KVONotificationDelegate.h"
|
Add antibiotic concentration artificial minimum floor | #include <math.h>
#include "abBlood.h"
void updateAB(simBac *sim)
{
sim->c_b = sim->c_b_peak * \
exp( -1 * sim->param.k_a * \
( sim->t - sim->param.doses_t[sim->dose_num-1] ) \
/ sim->param.v_w );
// Exponential decay from last time spike
// ( 1.0 - sim->param.t_s * sim->par... | #include <math.h>
#include "abBlood.h"
void updateAB(simBac *sim)
{
sim->c_b = sim->c_b_peak * \
exp( -1 * sim->param.k_a * \
( sim->t - sim->param.doses_t[sim->dose_num-1] ) \
/ sim->param.v_w );
// Exponential decay from last time spike
// ( 1.0 - sim->param.t_s * sim->par... |
Fix compilation error when debugfs is disabled | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the... | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the... |
Fix test to not force triple, and also to not need stdint.h. | // RUN: %clang_cc1 -triple i386-pc-linux-gnu -fsyntax-only -verify %s
#include <stdint.h>
static int f = 10;
static int b = f; // expected-error {{initializer element is not a compile-time constant}}
float r = (float) (intptr_t) &r; // expected-error {{initializer element is not a compile-time constant}}
intptr_t s... | // RUN: %clang_cc1 -fsyntax-only -verify %s
typedef __typeof((int*) 0 - (int*) 0) intptr_t;
static int f = 10;
static int b = f; // expected-error {{initializer element is not a compile-time constant}}
float r = (float) (intptr_t) &r; // expected-error {{initializer element is not a compile-time constant}}
intptr_t... |
Add a blank line at the end | /*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-09-05 Meco Man fix bugs
* 2020-12-16 Meco Man add useconds_t
*/
#ifndef __SYS_TYPES_H__
#define __SYS_TYPES_H__
#include <stdint.h>
#incl... | /*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2020-09-05 Meco Man fix bugs
* 2020-12-16 Meco Man add useconds_t
*/
#ifndef __SYS_TYPES_H__
#define __SYS_TYPES_H__
#include <stdint.h>
#incl... |
Increase version number for KDE 3.5.10. | // KMail Version Information
//
#ifndef kmversion_h
#define kmversion_h
#define KMAIL_VERSION "1.9.9"
#endif /*kmversion_h*/
| // KMail Version Information
//
#ifndef kmversion_h
#define kmversion_h
#define KMAIL_VERSION "1.9.10"
#endif /*kmversion_h*/
|
Add a function of ParseItem which returns a c-style string directly. | /*
* parser item
* (c) Copyright 2015 Micooz
*
* Released under the Apache License.
* See the LICENSE file or
* http://www.apache.org/licenses/LICENSE-2.0.txt for more information.
*/
#ifndef PARSER_ITEM_H_
#define PARSER_ITEM_H_
#include <sstream>
namespace program_options {
class ParseItem {
public:
ParseItem(c... | /*
* parser item
* (c) Copyright 2015 Micooz
*
* Released under the Apache License.
* See the LICENSE file or
* http://www.apache.org/licenses/LICENSE-2.0.txt for more information.
*/
#ifndef PARSER_ITEM_H_
#define PARSER_ITEM_H_
#include <sstream>
namespace program_options {
class ParseItem {
public:
ParseItem(c... |
Add THEMIS Secure Record interface | /**
* @file
*
* (c) CossackLabs
*/
#ifndef _SECURE_RECORD_H_
#define _SECURE_RECORD_H_
typedef struct themis_secure_record_type themis_secure_record_t;
themis_secure_record_t* themis_secure_record_create(const uint8_t* master_key, const size_t master_key_length);
themis_status_t themis_secure_record_encrypt_1(t... | |
Add the ctor for MEGAHandleList (Obj-C) | /**
* @file MEGAHandleList+init
* @brief Private functions of MEGAHandleList
*
* (c) 2013-2017 by Mega Limited, Auckland, New Zealand
*
* This file is part of the MEGA SDK - Client Access Engine.
*
* Applications using the MEGA API must present a valid application key
* and comply with the the rules set forth ... | /**
* @file MEGAHandleList+init
* @brief Private functions of MEGAHandleList
*
* (c) 2013-2017 by Mega Limited, Auckland, New Zealand
*
* This file is part of the MEGA SDK - Client Access Engine.
*
* Applications using the MEGA API must present a valid application key
* and comply with the the rules set forth ... |
Add command-line option for SSBS | // RUN: %clang -### -target aarch64-none-none-eabi -march=armv8a+ssbs %s 2>&1 | FileCheck %s
// CHECK: "-target-feature" "+ssbs"
// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8a+nossbs %s 2>&1 | FileCheck %s --check-prefix=NOSSBS
// NOSSBS: "-target-feature" "-ssbs"
// RUN: %clang -### -target aarch... | |
Fix enviroment variable getter on windows | /*
* Copyright (C) 2015 BMW Car IT GmbH
*
* 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 (C) 2015 BMW Car IT GmbH
*
* 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 : is real for number object. | //
// NSNumber+Fix.h
// LYCategory
//
// Created by Rick Luo on 11/25/13.
// Copyright (c) 2013 Luo Yu. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSNumber (Fix)
- (id)objectAtIndex:(NSUInteger)index;
- (id)objectForKey:(id)aKey;
- (BOOL)isEqualToString:(NSString *)aString;
- (NSUInt... | //
// NSNumber+Fix.h
// LYCategory
//
// Created by Rick Luo on 11/25/13.
// Copyright (c) 2013 Luo Yu. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSNumber (Fix)
- (id)objectAtIndex:(NSUInteger)index;
- (id)objectForKey:(id)aKey;
- (BOOL)isEqualToString:(NSString *)aString;
- (NSUInt... |
Switch to fputs stderr to try to fix output buffering issues | // RUN: %clang_asan -O2 %s -o %t
// RUN: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// FIXME: sprintf is not intercepted on Windows yet.
// XFAIL: win32
#include <stdio.h>
int main() {
volatile char c = '0';
... | // RUN: %clang_asan -O2 %s -o %t
// RUN: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// FIXME: sprintf is not intercepted on Windows yet.
// XFAIL: win32
#include <stdio.h>
int main() {
volatile char c = '0';
... |
Use a static_assert instead of using the old array of size -1 trick. | //===--- AllDiagnostics.h - Aggregate Diagnostic headers --------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===--- AllDiagnostics.h - Aggregate Diagnostic headers --------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Fix bug if timer executed with 0 ms | #include <stddef.h>
#include <time.h>
#include <pthread.h>
#include <stdlib.h>
#include "timers.h"
struct timer_data_t {
long millis;
timer_callback_t timer_callback;
void* data;
};
void *timer_thread(void *data) {
struct timer_data_t *timer_data = data;
struct timespec t;
t.tv_sec = timer_d... | #include <stddef.h>
#include <time.h>
#include <pthread.h>
#include <stdlib.h>
#include "timers.h"
struct timer_data_t {
long millis;
timer_callback_t timer_callback;
void* data;
};
void *timer_thread(void *data) {
struct timer_data_t *timer_data = data;
struct timespec t;
t.tv_sec = timer_d... |
Fix header guard, add impossible return value, add default name | #ifndef _NEWSPAPER_H_
#define _NEWSPAPER_H_
#include <string>
#include "advertenum.h"
using namespace std;
class Newspaper {
string name;
int textPrice, imagePrice, textImagePrice;
public:
Newspaper(const string& name): name(name) {}
int getPriceFor(AdvertType type) const {
switch(type) {
... | #ifndef NEWSPAPER_H
#define NEWSPAPER_H
#include <string>
#include "advertenum.h"
using namespace std;
class Newspaper {
string name;
int textPrice, imagePrice, textImagePrice;
public:
Newspaper(): name("") {}
Newspaper(const string& name): name(name) {}
int getPriceFor(AdvertType type) const {
... |
Add BSD header on top of all files (forgot some files) | #ifndef WEBWIDGET_H
#define WEBWIDGET_H
#include "webpage.h"
#include <QtWebKit>
#include <QStringList>
class WebWidget : public QWebView
{
Q_OBJECT
public:
WebWidget(QWidget * parent=0);
virtual void wheelEvent(QWheelEvent *);
public slots:
void changeFor(WebPage::UserAgents... | /* Mobile On Desktop - A Smartphone emulator on desktop
* Copyright (c) 2012 Régis FLORET
*
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retai... |
Move to iOS and Mac targets only. | /*! @file GTMAppAuth.h
@brief GTMAppAuth SDK
@copyright
Copyright 2016 Google Inc.
@copydetails
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
ht... | /*! @file GTMAppAuth.h
@brief GTMAppAuth SDK
@copyright
Copyright 2016 Google Inc.
@copydetails
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
ht... |
Convert defines to enums. Named percentage category enum. Documented values. | // batwarn - (C) 2015-2016 Jeffrey E. Bedard
#ifndef CONFIG_H
#define CONFIG_H
#define GAMMA_NORMAL 1.0
#define GAMMA_WARNING 5.0
enum {
CRIT_PERCENT=5
,LOW_PERCENT=10
,FULL_PERCENT=90
};
#ifndef DEBUG
#define WAIT 60
#else//DEBUG
#define WAIT 1
#endif//!DEBUG
#define BATSYSFILE "/sys/class/power_supply/BA... | // batwarn - (C) 2015-2016 Jeffrey E. Bedard
#ifndef BW_CONFIG_H
#define BW_CONFIG_H
#define GAMMA_NORMAL 1.0
#define GAMMA_WARNING 5.0
enum PercentCat {
CRIT_PERCENT=5,
LOW_PERCENT=10,
FULL_PERCENT=90
};
// Delay for checking system files:
#ifndef DEBUG
enum { WAIT = 60 };
#else//DEBUG
enum { WAIT = 1 };
#... |
Fix warning on printing value of type size_t. | /* Copyright (c) 2012 Francis Russell <francis@unchartedbackwaters.co.uk>
*
* 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... | /* Copyright (c) 2012 Francis Russell <francis@unchartedbackwaters.co.uk>
*
* 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... |
Add nullability specifiers to attribute selector | //
// CSSAttributeSelector.h
// HTMLKit
//
// Created by Iska on 14/05/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "CSSSelector.h"
#import "CSSSimpleSelector.h"
typedef NS_ENUM(NSUInteger, CSSAttributeSelectorType)
{
CSSAttributeSelectorExists,
CSSAtt... | //
// CSSAttributeSelector.h
// HTMLKit
//
// Created by Iska on 14/05/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "CSSSelector.h"
#import "CSSSimpleSelector.h"
typedef NS_ENUM(NSUInteger, CSSAttributeSelectorType)
{
CSSAttributeSelectorExists,
CSSAtt... |
Clarify strange syntax for itk::MetaEvent | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... |
Use override (pacify clang++ warning) | // ======================================================================
/*!
* \brief A Meb Maps Service Layer data structure for query data layer
*
* Characteristics:
*
* -
* -
*/
// ======================================================================
#pragma once
#include "WMSConfig.h"
namespace SmartM... | // ======================================================================
/*!
* \brief A Meb Maps Service Layer data structure for query data layer
*
* Characteristics:
*
* -
* -
*/
// ======================================================================
#pragma once
#include "WMSConfig.h"
namespace SmartM... |
Remove no longer valid comment | #ifndef CLIENTMODEL_H
#define CLIENTMODEL_H
#include <QObject>
class OptionsModel;
class AddressTableModel;
class TransactionTableModel;
class CWallet;
QT_BEGIN_NAMESPACE
class QDateTime;
QT_END_NAMESPACE
// Interface to Bitcoin network client
class ClientModel : public QObject
{
Q_OBJECT
public:
// The onl... | #ifndef CLIENTMODEL_H
#define CLIENTMODEL_H
#include <QObject>
class OptionsModel;
class AddressTableModel;
class TransactionTableModel;
class CWallet;
QT_BEGIN_NAMESPACE
class QDateTime;
QT_END_NAMESPACE
// Interface to Bitcoin network client
class ClientModel : public QObject
{
Q_OBJECT
public:
explicit C... |
Set default log level to info | //
// SFBLELogging.h
// SFBluetoothLowEnergyDevice
//
// Created by Thomas Billicsich on 2014-04-04.
// Copyright (c) 2014 Thomas Billicsich. All rights reserved.
#import <CocoaLumberjack/CocoaLumberjack.h>
// To define a different local (per file) log level
// put the following line _before_ the import of SFBLE... | //
// SFBLELogging.h
// SFBluetoothLowEnergyDevice
//
// Created by Thomas Billicsich on 2014-04-04.
// Copyright (c) 2014 Thomas Billicsich. All rights reserved.
#import <CocoaLumberjack/CocoaLumberjack.h>
// To define a different local (per file) log level
// put the following line _before_ the import of SFBLE... |
Test whether removing a cast still hurts performance. | /*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | /*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... |
Allow data to contain also lowercase hex characters. | /* Copyright (c) 2005-2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "hex-dec.h"
void dec2hex(unsigned char *hexstr, uintmax_t dec, unsigned int hexstr_size)
{
unsigned int i;
for (i = 0; i < hexstr_size; i++) {
unsigned int value = dec & 0x0f;
if (value < 10)
hexstr[hexstr... | /* Copyright (c) 2005-2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "hex-dec.h"
void dec2hex(unsigned char *hexstr, uintmax_t dec, unsigned int hexstr_size)
{
unsigned int i;
for (i = 0; i < hexstr_size; i++) {
unsigned int value = dec & 0x0f;
if (value < 10)
hexstr[hexstr... |
Add regression test for infinite loop combinations CFG connectedness | int main()
{
// non-deterministically make all variants live
int r;
switch (r)
{
case 0:
single();
break;
case 1:
sequential_last();
break;
case 2:
sequential_both();
break;
case 3:
branch_one();
break;
case 4:
branch_both();
break;... | |
Fix partitioned array option in additional test | // SKIP PARAM: --enable ana.int.interval --set solver td3 --enable ana.base.partition-arrays.enabled --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy --set sem.int.signed_overflow assume_none
// This is pa... | // SKIP PARAM: --enable ana.int.interval --set solver td3 --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy --set sem.int.signed_overflow assume_none
// This is part... |
Add test for nested macro expansion |
/*
name: TEST029
description: Test of nested expansion and refusing macro without arguments
comments: f(2) will expand to 2*g, which will expand to 2*f, and in this
moment f will not be expanded because the macro definition is
a function alike macro, and in this case there is no arguments.
output:
... | |
Add "escaping" via recursion example | // SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization dummy
int rec(int i,int* ptr) {
int top;
int x = 17;
if(i == 0) {
rec(5,&x);
// Recursive call may have mod... | |
Add arrays example in C | /*
* Author: Jhonatan Casale (jhc)
*
* Contact : jhonatan@jhonatancasale.com
* : casale.jhon@gmail.com
* : https://github.com/jhonatancasale
* : https://twitter.com/jhonatancasale
* : http://jhonatancasale.github.io/
*
* Create date Sat 10 Dec 16:28:22 BRST 2016
*
*/
#include... | |
Fix some build issues in the open source code. | /*
* Copyright (c) 2004-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pra... | /*
* Copyright (c) 2004-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pra... |
Use EditDefaultsOnly insted of EditAnywhere | // Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "GameFramework/Pawn.h"
#include "Tank.generated.h" // Put new includes above
class UTankBarrel; // Do a class forward declaration
class UTurret;
class UTankAimingComponent;
class AProjectile;
UCLASS()
class DEV_API... | // Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "GameFramework/Pawn.h"
#include "Tank.generated.h" // Put new includes above
class UTankBarrel; // Do a class forward declaration
class UTurret;
class UTankAimingComponent;
class AProjectile;
UCLASS()
class DEV_API... |
Stop pending watchers during shutdown. | #include "qnd.h"
/* Global context for server */
qnd_context ctx;
int main(int argc, char **argv)
{
struct ev_signal signal_watcher;
struct ev_io w_accept;
struct ev_loop *loop = ev_default_loop(0);
qnd_context_init(&ctx);
if (qnd_context_listen(&ctx, DEFAULT_PORT) == -1)
exit(1);
ev_signal_init(&si... | #include "qnd.h"
/* Global context for server */
qnd_context ctx;
int main(int argc, char **argv)
{
struct ev_signal signal_watcher;
struct ev_io w_accept;
struct ev_loop *loop = ev_default_loop(0);
qnd_context_init(&ctx);
if (qnd_context_listen(&ctx, DEFAULT_PORT) == -1)
exit(1);
ev_signal_init(&si... |
Mark NativeCursor::Cursors as not needed in switch/cases | // LAF OS Library
// Copyright (C) 2021 Igara Studio S.A.
// Copyright (C) 2012-2014 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef OS_NATIVE_CURSOR_H_INCLUDED
#define OS_NATIVE_CURSOR_H_INCLUDED
#pragma once
#include "gfx/fwd.h"
name... | // LAF OS Library
// Copyright (C) 2021-2022 Igara Studio S.A.
// Copyright (C) 2012-2014 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef OS_NATIVE_CURSOR_H_INCLUDED
#define OS_NATIVE_CURSOR_H_INCLUDED
#pragma once
#include "gfx/fwd.h"
... |
Fix clang build that have been broken by 81364. | // 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 CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_
#define CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_
#include "base/basictyp... | // 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 CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_
#define CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_
#include "base/basictyp... |
Synchronize the mailbox after expunging messages to actually get them expunged. | /* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "commands.h"
#include "imap-expunge.h"
bool cmd_close(struct client_command_context *cmd)
{
struct client *client = cmd->client;
struct mailbox *mailbox = client->mailbox;
struct mail_storage *storage;
if (!... | /* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "commands.h"
#include "imap-expunge.h"
bool cmd_close(struct client_command_context *cmd)
{
struct client *client = cmd->client;
struct mailbox *mailbox = client->mailbox;
struct mail_storage *storage;
if (!... |
Fix valgrind 'invalid read of size 1' bug. | #pragma once
#include <cmath>
#include <vector>
#include <murmur3/MurmurHash3.h>
#include <libcount/hll.h>
#include "type/value.h"
#include "common/macros.h"
#include "common/logger.h"
namespace peloton {
namespace optimizer {
/*
* A wrapper for libcount::HLL with murmurhash3
*/
class HLL {
public:
HLL(const... | #pragma once
#include <cmath>
#include <vector>
#include <murmur3/MurmurHash3.h>
#include <libcount/hll.h>
#include "type/value.h"
#include "common/macros.h"
#include "common/logger.h"
namespace peloton {
namespace optimizer {
/*
* A wrapper for libcount::HLL with murmurhash3
*/
class HLL {
public:
HLL(const... |
Test whether removing a cast still hurts performance. | /*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | /*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... |
Add in Ps2keyboard.inf and Ps2Mouse.inf to IntelFrameworkModuelPkg | /*++
Copyright (c) 2006, Intel Corporation. All rights reserved.
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
rep... | |
Include database reader in main library header | //
// SQLiteDatabaseHelper
// Include/SQLiteDatabaseHelper.h
//
#ifndef __SQLITEDATABASEHELPER_H__
#define __SQLITEDATABASEHELPER_H__
#include <stdio.h>
#include <sqlite3.h>
#endif | //
// SQLiteDatabaseHelper
// Include/SQLiteDatabaseHelper.h
//
#ifndef __SQLITEDATABASEHELPER_H__
#define __SQLITEDATABASEHELPER_H__
#include <SQLiteDatabaseHelper/Operations/Read/DatabaseReader.h>
#endif |
Add clear() and delete constructor with initializer_list | #pragma once
// This file is part of 'Atoms' library - https://github.com/yaqwsx/atoms
// Author: Jan 'yaqwsx' Mrzek
#include <array>
#include <initializer_list>
#include <algorithm>
namespace atoms {
template <class T, size_t SIZE>
class RollingAverage {
public:
RollingAverage() : sum(0), index(0)
{
... | #pragma once
// This file is part of 'Atoms' library - https://github.com/yaqwsx/atoms
// Author: Jan 'yaqwsx' Mrázek
#include <array>
#include <initializer_list>
#include <algorithm>
namespace atoms {
template <class T, size_t SIZE>
class RollingAverage {
public:
RollingAverage() : sum(0), index(0)
{
... |
Add (deactivated) casting test for congruence domain | // PARAM: --disable ana.int.def_exc --enable ana.int.interval
// Ensures that the cast_to function handles casting for congruences correctly.
// TODO: Implement appropriate cast_to function, enable for congruences only and adjust test if necessary.
#include <assert.h>
#include <stdio.h>
int main(){
int c = 128;
fo... | |
Revert "Force being outside speex." | #define OUTSIDE_SPEEX
#define RANDOM_PREFIX cubeb
#define FLOATING_POINT
#include <speex/speex_resampler.h>
| #include <speex/speex_resampler.h>
|
Fix windows build by requiring stdint.h | /*
* *****************************************************************************
* Copyright 2014 Spectra Logic Corporation. 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. A copy of the License
* is... | /*
* *****************************************************************************
* Copyright 2014 Spectra Logic Corporation. 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. A copy of the License
* is... |
Add another uninitialized values test case illustrating that the CFG correctly handles declarations with multiple variables. | // RUN: clang-cc -analyze -warn-uninit-values -verify %s
int f1() {
int x;
return x; // expected-warning {{use of uninitialized variable}}
}
int f2(int x) {
int y;
int z = x + y; // expected-warning {{use of uninitialized variable}}
return z;
}
int f3(int x) {
int y;
return x ? 1 : y; // expected-warn... | // RUN: clang-cc -analyze -warn-uninit-values -verify %s
int f1() {
int x;
return x; // expected-warning {{use of uninitialized variable}}
}
int f2(int x) {
int y;
int z = x + y; // expected-warning {{use of uninitialized variable}}
return z;
}
int f3(int x) {
int y;
return x ? 1 : y; // expected-warn... |
Update driver version to 5.02.00-k6 | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2010 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.02.00-k5"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2010 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.02.00-k6"
|
Update driver version to 5.02.00-k18 | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2010 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.02.00-k17"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2010 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.02.00-k18"
|
Remove preference change handler declaration. | //
// Tomighty - http://www.tomighty.org
//
// This software is licensed under the Apache License Version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0.txt
//
#import <Foundation/Foundation.h>
@protocol TYAppUI <NSObject>
- (void)switchToIdleState;
- (void)switchToPomodoroState;
- (void)switchToShortBreakSta... | //
// Tomighty - http://www.tomighty.org
//
// This software is licensed under the Apache License Version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0.txt
//
#import <Foundation/Foundation.h>
@protocol TYAppUI <NSObject>
- (void)switchToIdleState;
- (void)switchToPomodoroState;
- (void)switchToShortBreakSta... |
Use PSP for all threads | /**
* @file
* @brief
*
* @author Anton Kozlov
* @date 25.10.2012
*/
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <assert.h>
#include <hal/context.h>
#include <asm/modes.h>
#include <arm/fpu.h>
/* In the RVCT v2.0 and above, all generated code and C library code
* will maintain eig... | /**
* @file
* @brief
*
* @author Anton Kozlov
* @date 25.10.2012
*/
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <assert.h>
#include <hal/context.h>
#include <asm/modes.h>
#include <arm/fpu.h>
/* In the RVCT v2.0 and above, all generated code and C library code
* will maintain eig... |
Fix a typo which causes infinite recursion | /* This file is part of Metallic, a runtime library for WebAssembly.
*
* Copyright (C) 2018 Chen-Pang He <chen.pang.he@jdh8.org>
*
* This Source Code Form is subject to the terms of the Mozilla
* Public License v. 2.0. If a copy of the MPL was not distributed
* with this file, You can obtain one at http://mozilla... | /* This file is part of Metallic, a runtime library for WebAssembly.
*
* Copyright (C) 2018 Chen-Pang He <chen.pang.he@jdh8.org>
*
* This Source Code Form is subject to the terms of the Mozilla
* Public License v. 2.0. If a copy of the MPL was not distributed
* with this file, You can obtain one at http://mozilla... |
Set the NSString property to copy mode | //
// CWSCore.h
// yafacwesConsole
//
// Created by Matthias Lamoureux on 13/07/2015.
// Copyright (c) 2015 pinguzaph. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface CWSCore : NSObject
@property (nonatomic, strong) NSString * name;
@end
| //
// CWSCore.h
// yafacwesConsole
//
// Created by Matthias Lamoureux on 13/07/2015.
// Copyright (c) 2015 pinguzaph. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface CWSCore : NSObject
@property (nonatomic, copy) NSString * name;
@end
|
Clean up shared lib header code | #ifndef LIB_TEMPLATE_CMAKE_H
#define LIB_TEMPLATE_CMAKE_H
namespace LibTemplateCMake {
/**
* \class LibTemplateCMake::aClass
* \headerfile template-lib.h <TemplateLib/templatelib.h>
*
* \brief A class from LibTemplateCMake namespace.
*
* This class that does a summation.
*/
class summationClass
{
public:
/**
... | #ifndef LIB_TEMPLATE_CMAKE_H
#define LIB_TEMPLATE_CMAKE_H
namespace LibTemplateCMake {
/**
* \class LibTemplateCMake::aClass
* \headerfile template-lib.h <TemplateLib/templatelib.h>
*
* \brief A class from LibTemplateCMake namespace.
*
* This class that does a summation.
*/
class summationClass
{
public:
/... |
Correct type of `pthread_once` argument | //PARAM: --disable sem.unknown_function.spawn
#include <pthread.h>
#include <assert.h>
int g;
pthread_once_t once = PTHREAD_ONCE_INIT;
void *t_fun(void *arg) {
assert(1); // reachable!
return NULL;
}
int main() {
pthread_once(&once,t_fun);
return 0;
}
| //PARAM: --disable sem.unknown_function.spawn
#include <pthread.h>
#include <assert.h>
int g;
pthread_once_t once = PTHREAD_ONCE_INIT;
void t_fun() {
assert(1); // reachable!
return NULL;
}
int main() {
pthread_once(&once,t_fun);
return 0;
}
|
Add solution to Exercise 1-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 <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
uint32_t reverse(char *s);
int main(int argc, char **argv)
{
char *buf... | |
Enable history pruning at depth 4 | #ifndef _CONFIG_H
#define _CONFIG_H
#define ENABLE_COUNTERMOVE_HISTORY 0
#define ENABLE_HISTORY_PRUNE_DEPTH 0
#define ENABLE_NNUE 0
#define ENABLE_NNUE_SIMD 0
#endif
| #ifndef _CONFIG_H
#define _CONFIG_H
#define ENABLE_COUNTERMOVE_HISTORY 0
#define ENABLE_HISTORY_PRUNE_DEPTH 4
#define ENABLE_NNUE 0
#define ENABLE_NNUE_SIMD 0
#endif
|
Fix naming of rand_rangef name | #ifndef DW_RANDOM_H
#define DW_RANDOM_H
int rand_rangei(int min, int max);
float rand_rangei(float min, float max);
#define rand_bool() rand_rangei(0, 2)
#endif
| #ifndef DW_RANDOM_H
#define DW_RANDOM_H
int rand_rangei(int min, int max);
float rand_rangef(float min, float max);
#define rand_bool() rand_rangei(0, 2)
#endif
|
Fix a typo in a comment | /*
* Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2016 Cryptography Research, Inc.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distributio... | /*
* Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2016 Cryptography Research, Inc.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distributio... |
Fix compilation on MacOSX (common symbols not allowed with MH_DYLIB output format) | #ifdef _WIN32
#define DL_EXPORT __declspec( dllexport )
#else
#define DL_EXPORT
#endif
DL_EXPORT int TestDynamicLoaderData;
DL_EXPORT void TestDynamicLoaderFunction()
{
}
| #ifdef _WIN32
#define DL_EXPORT __declspec( dllexport )
#else
#define DL_EXPORT
#endif
DL_EXPORT int TestDynamicLoaderData = 0;
DL_EXPORT void TestDynamicLoaderFunction()
{
}
|
Remove the previously added comment. Probabilly me is the only one who didn't know userland and kerneland sizes were mismatching. | /*-
* Copyright (c) 2008, Jeffrey Roberson <jeff@freebsd.org>
* All rights reserved.
*
* Copyright (c) 2008 Nokia Corporation
* 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. Redis... | |
Add branching test for congruence domain | // PARAM: --sets solver td3 --enable ana.int.congruence --disable ana.int.def_exc
int main(){
// A refinement of a congruence class should only take place for the == and != operator.
int i;
if (i==0){
assert(i==0);
} else {
assert(i!=0); //UNKNOWN!
}
int j;
if (j != 0){
as... | |
Change to 3D active read | C $Header$
C $Name$
CBOP
C !ROUTINE: OPENAD_OPTIONS.h
C !INTERFACE:
C #include "OPENAD_OPTIONS.h"
C !DESCRIPTION:
C *==================================================================*
C | CPP options file for OpenAD (openad) package:
C | Control which optional features to compile in this package code.
C *===========... | |
Add basic example with multiple contexts | extern void __VERIFIER_error() __attribute__ ((__noreturn__));
extern int __VERIFIER_nondet_int();
void __VERIFIER_assert(int cond) {
if (!(cond)) {
ERROR: __VERIFIER_error();
}
return;
}
void foo(int x)
{
__VERIFIER_assert(x - 1 < x);
}
int main()
{
foo(1);
foo(2);
return 0;
} | |
Replace %02hhx with %02x in UUID format | /* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
Copyright (C) 2010 Red Hat, Inc.
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 Lic... | /* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
Copyright (C) 2010 Red Hat, Inc.
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 Lic... |
Test cleanup-attribute with const struct parameter | // RUN: %ocheck 0 %s
struct store_out
{
int *local;
int *ret;
};
void store_out(const struct store_out *const so)
{
*so->ret = *so->local;
}
void f(int *p)
{
int i = *p;
struct store_out so __attribute((cleanup(store_out))) = {
.local = &i,
.ret = p
};
i = 5;
}
main()
{
int i = 3;
f(&i);
if(i != 5)... | |
Add c_list to standard lib header file. | /*
* cynapses libc functions
*
* Copyright (c) 2008 by Andreas Schneider <mail@cynapses.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 version 2
* of the License, or ... | /*
* cynapses libc functions
*
* Copyright (c) 2008 by Andreas Schneider <mail@cynapses.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 version 2
* of the License, or ... |
Make sample app a little more clear | /*
* Copyright 2014 SimpleThings, 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 agr... | /*
* Copyright 2014 SimpleThings, 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 agr... |
Store ID for source template. | //
// Encounter.h
// ProeliaKit
//
// Created by Paul Schifferer on 3/5/15.
// Copyright (c) 2015 Pilgrimage Software. All rights reserved.
//
@import Foundation;
#import "EncounterConstants.h"
#import "GameSystem.h"
#import "AbstractEncounter.h"
@class EncounterMap;
@class EncounterParticipant;
@class Encounter... | //
// Encounter.h
// ProeliaKit
//
// Created by Paul Schifferer on 3/5/15.
// Copyright (c) 2015 Pilgrimage Software. All rights reserved.
//
@import Foundation;
#import "EncounterConstants.h"
#import "GameSystem.h"
#import "AbstractEncounter.h"
@class EncounterMap;
@class EncounterParticipant;
@class Encounter... |
Add insert node at tail fn | /*
Input Format
You have to complete the Node* Insert(Node* head, int data) method which takes two arguments - the head of the linked list and the integer to insert. You should NOT read any input from stdin/console.
Output Format
Insert the new node at the tail and just return the head of the updated linked list. Do... | |
Test exported symbol set against RTUBsan | // Check that the ubsan and ubsan-minimal runtimes have the same symbols,
// making exceptions as necessary.
//
// REQUIRES: x86_64-darwin
// RUN: nm -jgU `%clangxx -fsanitize-minimal-runtime -fsanitize=undefined %s -o %t '-###' 2>&1 | grep "libclang_rt.ubsan_minimal_osx_dynamic.dylib" | sed -e 's/.*"\(.*libclang_rt.u... | |
Fix GE0/GE1 init on ix2-200 as GE0 has no PHY | /*
* arch/arm/mach-kirkwood/board-iomega_ix2_200.c
*
* Iomega StorCenter ix2-200
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#include <linux/kernel.h>
#include <linu... | /*
* arch/arm/mach-kirkwood/board-iomega_ix2_200.c
*
* Iomega StorCenter ix2-200
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#include <linux/kernel.h>
#include <linu... |
Add provisional version, to be finished at home later today. | //-------------------------------------------------------------------------
// $Id$
// Version: $Name$
//
// Copyright (C) 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// to the file deal.II/doc/lic... | |
Fix fwd decl for windows. | //--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author: Timur Pocheptsov <Timur.Pocheptsov@cern.ch>
//------------------------------------------------------------------------------
#ifndef CLING_DISPLAY_H
#define CLING_... | //--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author: Timur Pocheptsov <Timur.Pocheptsov@cern.ch>
//------------------------------------------------------------------------------
#ifndef CLING_DISPLAY_H
#define CLING_... |
Revert r125642. This broke the build? It should be a no-op. | //===--- ClangSACheckers.h - Registration functions for Checkers *- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===--- ClangSACheckers.h - Registration functions for Checkers *- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Add facilities to define classes with arithmetic semantics | //----------------------------------------------------------------------------
//
// "Copyright Centre National d'Etudes Spatiales"
//
// License: LGPL-2
//
// See LICENSE.txt file in the top level directory for more details.
//
//----------------------------------------------------------------------------
// $Id$
#i... | |
Add guards for GAME_VERSION for command line customization | /**
* WarfaceBot, a blind XMPP client for Warface (FPS)
* Copyright (C) 2015 Levak Borok <levak92@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the Licen... | /**
* WarfaceBot, a blind XMPP client for Warface (FPS)
* Copyright (C) 2015 Levak Borok <levak92@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the Licen... |
Fix fwd decl for windows. | //--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author: Timur Pocheptsov <Timur.Pocheptsov@cern.ch>
//------------------------------------------------------------------------------
#ifndef CLING_DISPLAY_H
#define CLING_... | //--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author: Timur Pocheptsov <Timur.Pocheptsov@cern.ch>
//------------------------------------------------------------------------------
#ifndef CLING_DISPLAY_H
#define CLING_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.