Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Remove const modifier from LabelState members. | #ifndef SRC_FORCES_LABEL_STATE_H_
#define SRC_FORCES_LABEL_STATE_H_
#include <Eigen/Core>
#include <string>
#include <map>
namespace Forces
{
class Force;
/**
* \brief Encapsulates state for a label necessary for the simulation
*
* This consists of label and anchor positions in 2D and 3D, as well as
* the label... | #ifndef SRC_FORCES_LABEL_STATE_H_
#define SRC_FORCES_LABEL_STATE_H_
#include <Eigen/Core>
#include <string>
#include <map>
namespace Forces
{
class Force;
/**
* \brief Encapsulates state for a label necessary for the simulation
*
* This consists of label and anchor positions in 2D and 3D, as well as
* the label... |
Add alg to find repetead values in a matrix | /**
Having fun with multidimensinal arrays.
*/
#include <stdio.h>
/**
TODO: Dada uma matriz inteira Maxb, imprima o número de linhas e colunas
nulas (apenas com valores zerados, matematicamente falando)
da matriz.
*/
#define ROWS_QTT 4
#define COLS_QTT 5
int main(){
/*
Dada uma matriz Amxm, imprima quantas vez... | |
Revert 75430 because it's causing failures in dom_checker_tests. : Increase the minimum interval for timers on background tabs to reduce their CPU consumption. | // 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 WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
#define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
namespace webkit_glue {
// Chromium sets the minimum interval timeou... | // 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 WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
#define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_
namespace webkit_glue {
// Chromium sets the minimum interval timeou... |
Use option + for TAttParticle and TPrimary | /* @(#)root/eg:$Name: $:$Id: LinkDef.h,v 1.2 2000/09/06 15:15:18 brun Exp $ */
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* ... | /* @(#)root/eg:$Name: $:$Id: LinkDef.h,v 1.3 2000/09/08 16:42:12 brun Exp $ */
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* ... |
Add regression test for SV-COMP atomics soundness | // PARAM: --enable ana.sv-comp.functions
#include <pthread.h>
#include <assert.h>
extern void __VERIFIER_atomic_begin();
extern void __VERIFIER_atomic_end();
int myglobal = 5;
void *t_fun(void *arg) {
__VERIFIER_atomic_begin();
assert(myglobal == 5); // TODO
myglobal++;
assert(myglobal == 6); // TODO
__VER... | |
Add <stdlib.h> to GStreamer code | #ifndef SRTP_H
#define SRTP_H
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "srtp2/srtp.h"
typedef struct rtp_packet {
void *data;
int len;
} rtp_packet;
srtp_t *srtp_create_session(void *client_write_key, void *server_write_key, char *profile);
rtp_packet *srtp_decrypt_packet(srtp_t * sess,... | #ifndef SRTP_H
#define SRTP_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "srtp2/srtp.h"
typedef struct rtp_packet {
void *data;
int len;
} rtp_packet;
srtp_t *srtp_create_session(void *client_write_key, void *server_write_key, char *profile);
rtp_packet *srtp_decrypt_packet(srtp_t *sess... |
Kill unused DIE_PAGE_FAULT enum value. | #ifndef _SPARC64_KDEBUG_H
#define _SPARC64_KDEBUG_H
/* Nearly identical to x86_64/i386 code. */
#include <linux/notifier.h>
struct pt_regs;
/*
* These are only here because kprobes.c wants them to implement a
* blatant layering violation. Will hopefully go away soon once all
* architectures are updated.
*/
sta... | #ifndef _SPARC64_KDEBUG_H
#define _SPARC64_KDEBUG_H
/* Nearly identical to x86_64/i386 code. */
#include <linux/notifier.h>
struct pt_regs;
/*
* These are only here because kprobes.c wants them to implement a
* blatant layering violation. Will hopefully go away soon once all
* architectures are updated.
*/
sta... |
Add example for memory logging support | #define ZF_LOG_LEVEL ZF_LOG_INFO
#define ZF_LOG_TAG "MAIN"
#include <zf_log.h>
int main(int argc, char *argv[])
{
zf_log_set_tag_prefix("hello");
ZF_LOGI("You will see the number of arguments: %i", argc);
ZF_LOGD("You will NOT see the first argument: %s", *argv);
zf_log_set_output_level(ZF_LOG_WARN);
ZF_LOGW("Y... | #define ZF_LOG_LEVEL ZF_LOG_INFO
#define ZF_LOG_TAG "MAIN"
#include <zf_log.h>
int main(int argc, char *argv[])
{
zf_log_set_tag_prefix("hello");
ZF_LOGI("You will see the number of arguments: %i", argc);
ZF_LOGD("You will NOT see the first argument: %s", *argv);
zf_log_set_output_level(ZF_LOG_WARN);
ZF_LOGW("Y... |
Fix misspelling in execrise 2 in chapter 1 | /**
* Exercise 1-2
*
* Experiment to find out what happens when prints's argument string contains \c,
* where c is some character not listed above.
*
* The C Programming Language - the second edition
* by Brian Kernighan and Dennis Ritchie
*
* Author: Li Zhineng <lizhineng@gmail.com>
* URL: https://zhineng... | /**
* Exercise 1-2
*
* Experiment to find out what happens when printfs's argument string contains \c,
* where c is some character not listed above.
*
* The C Programming Language - the second edition
* by Brian Kernighan and Dennis Ritchie
*
* Author: Li Zhineng <lizhineng@gmail.com>
* URL: https://zhinen... |
Add in a bad user option. Exists in GConf but not on the server. | #ifndef __EAS_TEST_USER_H__
#define __EAS_TEST_USER_H__
#define TEST_ACCOUNT_ID ("good.user@cstylianou.com")
// Password: "G00dP@55w0rd"
#endif
| #ifndef __EAS_TEST_USER_H__
#define __EAS_TEST_USER_H__
#define TEST_ACCOUNT_ID ("good.user@cstylianou.com")
// Password: "G00dP@55w0rd"
// #define TEST_ACCOUNT_ID ("bad.user@cstylianou.com")
#endif
|
Add Fatorial Recursica em C | #include<stdio.h>
int fatorial(int n){
if(n==1) return 1;
return (n * fatorial(n-1));
}
int main(){
printf("%d\n", fatorial(5));
return 0;
}
| |
Convert from id to instancetype | #import "AFImageCacheOperation.h"
#pragma mark Type Definitions
// Block that transforms one image into another.
typedef AFImageCacheOperation *(^AFImageCacheOperationCreateBlock)(NSURL *url, AFImageTransform *transform,
NSCache *cache, BOOL refresh, AFImageCompletionBlock completionBlock);
#pragma mark Class Int... | #import "AFImageCacheOperation.h"
#pragma mark Type Definitions
// Block that transforms one image into another.
typedef AFImageCacheOperation *(^AFImageCacheOperationCreateBlock)(NSURL *url, AFImageTransform *transform,
NSCache *cache, BOOL refresh, AFImageCompletionBlock completionBlock);
#pragma mark Class Int... |
Fix test due to mempool internal change. | /* EINA - EFL data type library
* Copyright (C) 2008 Cedric Bail
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later... | /* EINA - EFL data type library
* Copyright (C) 2008 Cedric Bail
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later... |
Update version string for next RC | /*
Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
*************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
*... | /*
Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
*************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
*... |
Include PKCBaseAPI in umbrella header | //
// PodioKitCore.h
// PodioKitCore
//
// Created by Sebastian Rehnby on 12/02/15.
// Copyright (c) 2015 Citrix Systems, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "PKCMacros.h"
#import "PKCConstants.h"
#import "PKCClient.h"
#import "PKCRequest.h"
#import "PKCResponse.h"
#import "PKC... | //
// PodioKitCore.h
// PodioKitCore
//
// Created by Sebastian Rehnby on 12/02/15.
// Copyright (c) 2015 Citrix Systems, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "PKCMacros.h"
#import "PKCConstants.h"
#import "PKCClient.h"
#import "PKCRequest.h"
#import "PKCResponse.h"
#import "PKC... |
Test optional Armv8.5-A random number extension | // RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.4a+rng %s 2>&1 | FileCheck %s
// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.5a+rng %s 2>&1 | FileCheck %s
// CHECK: "-target-feature" "+rand"
// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.4a+norng %s 2>&1 | FileCheck %s... | |
Fix call convention for wglGetProcAddress on Windows-i686 | #ifndef _GLIMPL_H_
#define _GLIMPL_H_
#ifndef GLFUNC_MAGIC_START
#include "fptr_struct.h"
#endif
#define GET_GLIMPL_VARIABLE(_name_) \
(((struct glimpl *)DATA_PTR(obj))->_name_)
#define SET_GLIMPL_VARIABLE(_name_,_val_) \
((struct glimpl *)DATA_PTR(obj))->_name_ = (_val_)
/* at least GL_MAX_VERTEX_ATTRIBS - usu... | #ifndef _GLIMPL_H_
#define _GLIMPL_H_
#ifndef GLFUNC_MAGIC_START
#include "fptr_struct.h"
#endif
#define GET_GLIMPL_VARIABLE(_name_) \
(((struct glimpl *)DATA_PTR(obj))->_name_)
#define SET_GLIMPL_VARIABLE(_name_,_val_) \
((struct glimpl *)DATA_PTR(obj))->_name_ = (_val_)
/* at least GL_MAX_VERTEX_ATTRIBS - usu... |
Fix Android x86_64 build when using traditional headers | // Copyright 2017 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ... | |
Add comment for constant PARSE_SUCCESS | // Copyright 2016 Mitchell Kember. Subject to the MIT License.
#ifndef PARSE_H
#define PARSE_H
#include "expr.h"
#define PARSE_SUCCESS (-1)
// ParseResult contains the result of parsing text. The 'expr' field has a
// meaningful value if and only if 'err_type' is PARSE_SUCCESS.
struct ParseResult {
size_t chars_re... | // Copyright 2016 Mitchell Kember. Subject to the MIT License.
#ifndef PARSE_H
#define PARSE_H
#include "expr.h"
// Constant indicating that a parse was successful.
#define PARSE_SUCCESS (-1)
// ParseResult contains the result of parsing text. The 'expr' field has a
// meaningful value if and only if 'err_type' is ... |
Define _NETBSD_SOURCE macro to make 'strndup' declaration visible on NetBSD | //
// substr.c
// AnsiLove/C
//
// Copyright (C) 2011-2016 Stefan Vogt, Brian Cassidy, Frederic Cambus.
// All rights reserved.
//
// This source code is licensed under the BSD 3-Clause License.
// See the file LICENSE for details.
//
#define _XOPEN_SOURCE 700
#include <string.h>
char *substr(char *str, size_t ... | //
// substr.c
// AnsiLove/C
//
// Copyright (C) 2011-2016 Stefan Vogt, Brian Cassidy, Frederic Cambus.
// All rights reserved.
//
// This source code is licensed under the BSD 3-Clause License.
// See the file LICENSE for details.
//
#define _XOPEN_SOURCE 700
#define _NETBSD_SOURCE
#include <string.h>
char *su... |
Move operator| in details namespace | #pragma once
#include <utility>
#include <pipe/traits.h>
namespace pipe { namespace algorithm {
template <typename Generator, typename Algorithm, typename _ = std::enable_if<pipe::is_generator<Generator>::value>::type>
auto operator|(Generator& gen, Algorithm algorithm)
{
return algorithm(std::move(gen));
}
}} /... | #pragma once
#include <utility>
#include <pipe/traits.h>
namespace pipe { namespace algorithm { namespace details {
template <typename Generator, typename Algorithm, typename _ = std::enable_if<pipe::is_generator<Generator>::value>::type>
auto operator|(Generator& gen, Algorithm algorithm)
{
return algorithm(std:... |
Add a slight bit more functionality to the UART echo app so that it can blink some lights with numerical inputs. This can help determine whether or not the AVR is receiving the correct data, even though it is echoing it back anyway. | #include <avr/interrupt.h>
#include "uart.h"
int main (void) {
uart_enable(UM_Asynchronous);
sei();
unsigned char c = 0;
do {
c = uart_receive();
uart_transmit(c);
} while (c);
return 0;
}
| #include <avr/interrupt.h>
#include <util/delay.h>
#include "uart.h"
int main (void) {
uart_enable(UM_Asynchronous);
sei();
DDRB = 0xFF;
unsigned char c = 0;
do {
c = uart_receive();
// Do some blinking if we receive a number between 1 and 9.
if (c >= '1' && c <= '9') {
for (int i = 0; ... |
Add feature to on-demand reactify classes | //
// MTRReactiveEngine.h
// Reactor
//
// Created by Ty Cobb on 1/15/15.
// Copyright (c) 2015 cobb. All rights reserved.
//
@import Foundation;
@interface MTRReactiveEngine : NSObject
/**
@brief Adds reactivity to marked classes
Sweeps the class list for classes adopting @c MTRReactive, and swizzles their
... | //
// MTRReactiveEngine.h
// Reactor
//
// Created by Ty Cobb on 1/15/15.
// Copyright (c) 2015 cobb. All rights reserved.
//
@import Foundation;
@protocol MTRReactive;
@interface MTRReactiveEngine : NSObject
/**
@brief Adds reactivity to marked classes
Sweeps the class list for classes adopting @c MTRReacti... |
Update comment to reflect dictionary layout. | //
// PluginDelegate.h
// arc
//
// Created by Yong Michael on 6/4/13.
// Copyright (c) 2013 nus.cs3217. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ArcAttributedString.h"
#import "File.h"
typedef enum {
kMCQSettingType,
kRangeSettingType,
kBoolSettingType
} kSettingType;
@prot... | //
// PluginDelegate.h
// arc
//
// Created by Yong Michael on 6/4/13.
// Copyright (c) 2013 nus.cs3217. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ArcAttributedString.h"
#import "File.h"
typedef enum {
kMCQSettingType,
kRangeSettingType,
kBoolSettingType
} kSettingType;
@prot... |
Define a struct to represent 2d positions. | #include <stdlib.h>
/**
* @author: Hendrik Werner
*/
int main() {
return EXIT_SUCCESS;
}
| #include <stdlib.h>
/**
* @author: Hendrik Werner
*/
typedef struct Position {
int row;
int col;
} Position;
int main() {
return EXIT_SUCCESS;
}
|
Allow for building index on the outside. | // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "dense_tensor.h"
namespace vespalib::tensor {
/**
* Class for building a dense tensor by inserting cell values directly into underlying array of cells.
*/
class DirectDenseT... | // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "dense_tensor.h"
namespace vespalib::tensor {
/**
* Class for building a dense tensor by inserting cell values directly into underlying array of cells.
*/
class DirectDenseT... |
Fix terminal widget on Spark Core | /**
* @file WidgetTerminal.h
* @author Volodymyr Shymanskyy
* @license This project is released under the MIT License (MIT)
* @copyright Copyright (c) 2015 Volodymyr Shymanskyy
* @date Jan 2015
* @brief
*/
#ifndef WidgetTerminal_h
#define WidgetTerminal_h
#include <Print.h>
#include <Blynk/... | /**
* @file WidgetTerminal.h
* @author Volodymyr Shymanskyy
* @license This project is released under the MIT License (MIT)
* @copyright Copyright (c) 2015 Volodymyr Shymanskyy
* @date Jan 2015
* @brief
*/
#ifndef WidgetTerminal_h
#define WidgetTerminal_h
#include <Print.h>
#if !defined(SP... |
Add the necessary includes and forward declarations such that the class can be compiled independently. | // @(#)root/meta:$Name: $:$Id: TVirtualIsAProxy.h,v 1.1 2005/05/27 16:42:58 pcanal Exp $
// Author: Markus Frank 20/05/2005
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. ... | // @(#)root/meta:$Name: $:$Id: TVirtualIsAProxy.h,v 1.2 2005/06/08 18:51:36 rdm Exp $
// Author: Markus Frank 20/05/2005
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. ... |
Include URL in common includes | //
// KBSCloudApp.h
//
// Created by Keith Smiley
// Copyright (c) 2013 Keith Smiley. All rights reserved.
//
#ifndef _KBSCLOUDAPP_
#define _KBSCLOUDAPP_
#import "KBSCloudAppUser.h"
#import "KBSCloudAppAPI.h"
NS_ENUM(NSInteger, KBSCloudAppAPIErrorCode) {
KBSCloudAppNoUserOrPass,
KBSCloudAppAPIInvalidUser,
K... | //
// KBSCloudApp.h
//
// Created by Keith Smiley
// Copyright (c) 2013 Keith Smiley. All rights reserved.
//
#ifndef _KBSCLOUDAPP_
#define _KBSCLOUDAPP_
#import "KBSCloudAppUser.h"
#import "KBSCloudAppAPI.h"
#import "KBSCloudAppURL.h"
NS_ENUM(NSInteger, KBSCloudAppAPIErrorCode) {
KBSCloudAppNoUserOrPass,
KBS... |
Use the full UUID for the K20DX | /* CMSIS-DAP Interface Firmware
* Copyright (c) 2009-2013 ARM Limited
*
* 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 re... | /* CMSIS-DAP Interface Firmware
* Copyright (c) 2009-2013 ARM Limited
*
* 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 re... |
Add support for openbsd, test on openbsd 6.8 | #include <fcntl.h>
#include <kvm.h>
#include <sys/sysctl.h>
#include <unistd.h>
#include <stdio.h>
#include <time.h>
int main(int argc,char** args) {
kvm_t* kd;
// Get a handle to libkvm interface
kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "error: ");
pid_t pid;
pid = getpid();
struct kinfo_proc * kp;
i... | |
Fix speed of ultrasonic display | /*==============================================================================================*/
/*==============================================================================================*/
#include "QuadCopterConfig.h"
/* Connection methods of Ultrasonic */
#define ULT_USE_UART2 1
#define ULT_USE_PWM 0
Ultr... | /*==============================================================================================*/
/*==============================================================================================*/
#include "QuadCopterConfig.h"
/* Connection methods of Ultrasonic */
#define ULT_USE_UART2 1
#define ULT_USE_PWM 0
Ultr... |
Test for trim functions added. | #include <stdio.h>
#include <axis2_error_default.h>
#include <axis2_log.h>
#include <axis2_string.h>
void test_strltrim(const axis2_env_t *env)
{
axis2_char_t s[100]=" abcd efgh ";
axis2_char_t *trimmed;
trimmed = AXIS2_STRLTRIM(s, " \t\r\n");
if (0 == AXIS2_STRCMP(trimmed, "abcd efgh "))
printf("AXIS2_STRLTR... | |
Fix mouse position over an `S2D_FIXED` viewport | // input.c
#include "../include/simple2d.h"
/*
* Get the mouse coordinates relative to the viewport
*/
void S2D_GetMouseOnViewport(S2D_Window *window, int wx, int wy, int *x, int *y) {
double scale; // viewport scale factor
int w, h; // width and height of scaled viewport
switch (window->viewport... | // input.c
#include "../include/simple2d.h"
/*
* Get the mouse coordinates relative to the viewport
*/
void S2D_GetMouseOnViewport(S2D_Window *window, int wx, int wy, int *x, int *y) {
double scale; // viewport scale factor
int w, h; // width and height of scaled viewport
switch (window->viewport... |
Add Diagonal Diff for NxN matrix | /*
Input Format
The first line contains a single integer N. The next N lines contain N integers (each) describing the matrix.
Constraints
1≤N≤100
−100≤A[i]≤100
Output Format
Output a single integer equal to the absolute difference in the sums across the diagonals.
Sample Input
3
11 2 4
4 5 6
10 8 -12
Sample Outp... | |
Add standalone test for Vale SHA2-256 | #include "sha256_main_i.h"
int main()
{
uint8_t plaintext[3U] = { (uint8_t)0x61U, (uint8_t)0x62U, (uint8_t)0x63U };
uint32_t plaintext_len = (uint32_t)3U;
uint32_t output[8];
uint32_t output_len = (uint32_t)32U;
/*
// This is equivalent to what sha256_main_i_SHA256_Complete does:
uint32_t h[8];
uint... | |
Fix misleading dbl header include protection test. | /*
* Copyright 2003 James Bursa <bursa@users.sourceforge.net>
* Copyright 2004 John Tytgat <John.Tytgat@aaug.net>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
* Licenced under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
*/
#include <stdio.h>
#ifndef... | /*
* Copyright 2003 James Bursa <bursa@users.sourceforge.net>
* Copyright 2004 John Tytgat <John.Tytgat@aaug.net>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
* Licenced under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
*/
#include <stdio.h>
#ifndef... |
Fix regresscapi. This file wasn't checked in | #include <stdio.h>
#include "c_interface.h"
int main() {
VC vc = vc_createValidityChecker();
vc_setFlags(vc,'n');
vc_setFlags(vc,'d');
vc_setFlags(vc,'p');
vc_setFlags(vc,'m');
Expr q;
Expr asserts;
const char* s = "(benchmark fg.smt\n"
":logic QF_AUFBV\n"
":extrafuns ((x_32 BitVec[32]... | |
Convert BUG() to use unreachable() | #ifndef __ASM_BUG_H
#define __ASM_BUG_H
#include <linux/compiler.h>
#include <asm/sgidefs.h>
#ifdef CONFIG_BUG
#include <asm/break.h>
static inline void __noreturn BUG(void)
{
__asm__ __volatile__("break %0" : : "i" (BRK_BUG));
/* Fool GCC into thinking the function doesn't return. */
while (1)
;
}
#define HA... | #ifndef __ASM_BUG_H
#define __ASM_BUG_H
#include <linux/compiler.h>
#include <asm/sgidefs.h>
#ifdef CONFIG_BUG
#include <asm/break.h>
static inline void __noreturn BUG(void)
{
__asm__ __volatile__("break %0" : : "i" (BRK_BUG));
unreachable();
}
#define HAVE_ARCH_BUG
#if (_MIPS_ISA > _MIPS_ISA_MIPS1)
static inl... |
Check magic and output header fields | #include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "scp.h"
unsigned char scp_processheader(FILE *scpfile)
{
return 0;
}
void scp_processtrack(FILE *scpfile, const unsigned char track)
{
}
int main(int argc, char **argv)
{
unsigned char numtracks;
unsigned char track;
FILE *fp;
if (argc!=... | #include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "scp.h"
struct scp_header header;
unsigned char scp_processheader(FILE *scpfile)
{
fread(&header, 1, sizeof(header), scpfile);
if (strncmp((char *)&header.magic, SCP_MAGIC, strlen(SCP_MAGIC))!=0)
{
printf("Not an SCP f... |
Include UIKit to h file, because change pch to h for two files in main project and refactor all needed includes. | //
// MFSideMenuShadow.h
// MFSideMenuDemoSearchBar
//
// Created by Michael Frederick on 5/13/13.
// Copyright (c) 2013 Frederick Development. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MFSideMenuShadow : NSObject
@property (nonatomic, assign) BOOL enabled;
@property (nonatomic, assign... | //
// MFSideMenuShadow.h
// MFSideMenuDemoSearchBar
//
// Created by Michael Frederick on 5/13/13.
// Copyright (c) 2013 Frederick Development. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface MFSideMenuShadow : NSObject
@property (nonatomic, assign) BOOL enabled;
@pro... |
Add collection of basic BLE types shared accross all layers. | /* mbed Microcontroller Library
* Copyright (c) 2017-2017 ARM Limited
*
* 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 re... | |
Add tests for new Neon vector type attributes. | // RUN: %clang_cc1 %s -fsyntax-only -verify
typedef float float32_t;
typedef signed char poly8_t;
typedef short poly16_t;
typedef unsigned long long uint64_t;
// Define some valid Neon types.
typedef __attribute__((neon_vector_type(2))) int int32x2_t;
typedef __attribute__((neon_vector_type(4))) int int32x4_t;
typede... | |
Use `using` instead of `typedef` | // MIT License
// Copyright (c) 2017 Zhuhao Wang
// 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, mer... | // MIT License
// Copyright (c) 2017 Zhuhao Wang
// 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, mer... |
Rename Kernel setter methods arguments | /*
* kernel.h - base kernel class
* @author Vyacheslav Kompan kompan.vo@phystech.edu
* Copyright 2018 MIPT-MIPS
*/
#ifndef KERNEL_H
#define KERNEL_H
/* Simulator modules */
#include <memory/memory.h>
#include <simulator.h>
/* Generic C++ */
#include <memory>
class Kernel {
std::weak_ptr<Simulator> sim;
s... | /*
* kernel.h - base kernel class
* @author Vyacheslav Kompan kompan.vo@phystech.edu
* Copyright 2018 MIPT-MIPS
*/
#ifndef KERNEL_H
#define KERNEL_H
/* Simulator modules */
#include <memory/memory.h>
#include <simulator.h>
/* Generic C++ */
#include <memory>
class Kernel {
std::weak_ptr<Simulator> sim;
s... |
Move various multi-dispatch data structures into a header file, plus way that we'll be able to get at the dispatcher list, dispatcher info stash and so forth. | /* This is how a Code looks on the inside. Once again, C struct that should
* match what P6opaque computes for the Code class. */
typedef struct {
PMC *st; /* S-table, though we don't care about that here. */
PMC *sc; /* Serialization context, though we don't care about th... | |
Remove use of g_set_prgname in main(). | #include "config.h"
#include <glib.h>
#include <telepathy-glib/run.h>
#include <telepathy-glib/debug.h>
#include "salut-connection-manager.h"
#include "salut-avahi-discovery-client.h"
#include "debug.h"
static TpBaseConnectionManager *
salut_create_connection_manager (void)
{
return TP_BASE_CONNECTION_MANAGER (
... | #include "config.h"
#include <glib.h>
#include <telepathy-glib/run.h>
#include <telepathy-glib/debug.h>
#include "salut-connection-manager.h"
#include "salut-avahi-discovery-client.h"
#include "debug.h"
static TpBaseConnectionManager *
salut_create_connection_manager (void)
{
return TP_BASE_CONNECTION_MANAGER (
... |
Fix public/private members and doxygen comments | #ifndef PAWN_STRUCTURE_GENE_H
#define PAWN_STRUCTURE_GENE_H
#include <string>
#include <map>
#include "Genes/Gene.h"
#include "Game/Piece.h"
#include "Game/Color.h"
class Board;
class Pawn_Structure_Gene : public Clonable_Gene<Pawn_Structure_Gene>
{
public:
Pawn_Structure_Gene() noexcept;
std::s... | #ifndef PAWN_STRUCTURE_GENE_H
#define PAWN_STRUCTURE_GENE_H
#include <string>
#include <map>
#include "Genes/Gene.h"
#include "Game/Piece.h"
#include "Game/Color.h"
class Board;
//! \brief A gene to evaluate how well pawns are protected.
class Pawn_Structure_Gene : public Clonable_Gene<Pawn_Structure_Gene>
{
pu... |
Change name of parameter in bubbleSort | /* Author: Dan Wilder
*
* School: University of Missouri - St. Louis
* Semester: Fall 2015
* Class: CS 3130 - Design and Analysis of Algorithms
* Instructor: Galina N. Piatnitskaia
*/
#include "sort_algorithms.h"
void swap(int *x, int *y) {
int temp = *x;
*x = *y
*y = temp;
}
void bubbleS... | /* Author: Dan Wilder
*
* School: University of Missouri - St. Louis
* Semester: Fall 2015
* Class: CS 3130 - Design and Analysis of Algorithms
* Instructor: Galina N. Piatnitskaia
*/
#include "sort_algorithms.h"
void swap(int *x, int *y) {
int temp = *x;
*x = *y
*y = temp;
}
void bubbleS... |
Update type in SettingsService callback. | /*
Copyright 2012 Moblico Solutions LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this work except in compliance with the License.
You may obtain a copy of the License in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... | /*
Copyright 2012 Moblico Solutions LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this work except in compliance with the License.
You may obtain a copy of the License in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... |
Add getter for lua state | //
// Created by Dawid Drozd aka Gelldur on 08.10.17.
//
#pragma once
#include <map>
#include <string>
#include <vector>
#include <bee/Beehive.h>
namespace cocos2d
{
class CCNode;
}
namespace Bee
{
class Graph;
class Node;
class Cocos2dxBeehive
{
public:
Cocos2dxBeehive(const std::vector<std::string>& searchPath... | //
// Created by Dawid Drozd aka Gelldur on 08.10.17.
//
#pragma once
#include <map>
#include <string>
#include <vector>
#include <bee/Beehive.h>
namespace cocos2d
{
class CCNode;
}
namespace Bee
{
class Graph;
class Node;
class Cocos2dxBeehive
{
public:
Cocos2dxBeehive(const std::vector<std::string>& searchPath... |
Fix OnLoad signature and configure command parameters properly | #include "redismodule.h"
#include <stdlib.h>
int HelloworldRand_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
RedisModule_ReplyWithLongLong(ctx,rand());
return REDISMODULE_OK;
}
int RedisModule_OnLoad(RedisModuleCtx *ctx) {
if (RedisModule_Init(ctx,"testmodule",1,REDISMODULE_APIVER_... | #include "redismodule.h"
#include <stdlib.h>
int HelloworldRand_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
RedisModule_ReplyWithLongLong(ctx,rand());
return REDISMODULE_OK;
}
int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
if (RedisModule_Init(ct... |
Add skipped base union field pointer unsoundness test | // SKIP
// TODO: be sound and claim that assert may hold instead of must not hold
// assert passes when compiled
#include <assert.h>
union u {
int fst;
float snd;
};
int main() {
union u a;
void *p = &a.fst;
void *q = &a.snd;
assert(p == q);
return 0;
}
| |
Fix a typo in the VMOV implementation. | //
// arch/x86_64/rsp/vmov.c
//
// This file is subject to the terms and conditions defined in
// 'LICENSE', which is part of this source code package.
//
#include "common.h"
#include "rsp/cpu.h"
#include "rsp/rsp.h"
__m128i rsp_vmov(struct rsp *rsp,
unsigned src, unsigned e, unsigned dest, unsigned de) {
uint16_... | //
// arch/x86_64/rsp/vmov.c
//
// This file is subject to the terms and conditions defined in
// 'LICENSE', which is part of this source code package.
//
#include "common.h"
#include "rsp/cpu.h"
#include "rsp/rsp.h"
__m128i rsp_vmov(struct rsp *rsp,
unsigned src, unsigned e, unsigned dest, unsigned de) {
uint16_... |
Change the ilst content (2) | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_trmsignalhook.c :+: :+: :+: ... | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_trmsignalhook.c :+: :+: :+: ... |
Use QString() as default paramater for an empty string | /*
* Copyright (C) 2014 Matthias Klumpp <matthias@tenstral.net>
*
* Licensed under the GNU Lesser General Public License Version 2.1
*
* 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 Foundatio... | /*
* Copyright (C) 2014 Matthias Klumpp <matthias@tenstral.net>
*
* Licensed under the GNU Lesser General Public License Version 2.1
*
* 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 Foundatio... |
Fix stupid error for Linux build. | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_GPU_GPU_CONFIG_H_
#define CHROME_GPU_GPU_CONFIG_H_
// This file declares common preprocessor configuration for the GPU process.
#incl... | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_GPU_GPU_CONFIG_H_
#define CHROME_GPU_GPU_CONFIG_H_
// This file declares common preprocessor configuration for the GPU process.
#incl... |
Improve a macro to reference its parameter | #ifndef _AL_THUNK_H_
#define _AL_THUNK_H_
#include "config.h"
#include "AL/al.h"
#include "AL/alc.h"
#ifdef __cplusplus
extern "C" {
#endif
void alThunkInit(void);
void alThunkExit(void);
ALuint alThunkAddEntry(ALvoid * ptr);
void alThunkRemoveEntry(ALuint index);
ALvoid *alThunkLookupEntry(ALuint index);
#if (SIZ... | #ifndef _AL_THUNK_H_
#define _AL_THUNK_H_
#include "config.h"
#include "AL/al.h"
#include "AL/alc.h"
#ifdef __cplusplus
extern "C" {
#endif
void alThunkInit(void);
void alThunkExit(void);
ALuint alThunkAddEntry(ALvoid *ptr);
void alThunkRemoveEntry(ALuint index);
ALvoid *alThunkLookupEntry(ALuint index);
#if (SIZE... |
Allow for messages in HistFactory exceptions. | // @(#)root/roostats:$Id$
// Author: George Lewis, Kyle Cranmer
/*************************************************************************
* Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* ... | // @(#)root/roostats:$Id$
// Author: George Lewis, Kyle Cranmer
/*************************************************************************
* Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* ... |
Make draft compile with ZeroMQ 4.3.0 | #if ZMQ_VERSION_MINOR == 2
#ifdef ZMQ_BUILD_DRAFT_API
#define ZMQ42HASDRAFT
#endif
#endif
#ifndef ZMQ42HASDRAFT
#define ZMQ_SERVER -12
#define ZMQ_CLIENT -13
#define ZMQ_RADIO -14
#define ZMQ_DISH -15
#define ZMQ_GATHER -16
#define ZMQ_SCATTER -17
#define ZMQ_DGRAM -18
#endif
| #if ZMQ_VERSION_MINOR >= 2
#ifdef ZMQ_BUILD_DRAFT_API
#define ZMQ42HASDRAFT
#endif
#endif
#ifndef ZMQ42HASDRAFT
#define ZMQ_SERVER -12
#define ZMQ_CLIENT -13
#define ZMQ_RADIO -14
#define ZMQ_DISH -15
#define ZMQ_GATHER -16
#define ZMQ_SCATTER -17
#define ZMQ_DGRAM -18
#endif
|
Add some comments to explain why the DMA32 physseg is really 2**31 bytes long. Prompted by deraadt@ long ago. | /* $OpenBSD: vmparam.h,v 1.3 2009/05/08 18:42:04 miod Exp $ */
#ifndef _SGI_VMPARAM_H_
#define _SGI_VMPARAM_H_
#define VM_PHYSSEG_MAX 32 /* Max number of physical memory segments */
#define VM_NFREELIST 2
#define VM_FREELIST_DMA32 1 /* memory under 2GB suitable for DMA */
#include <mips64/vmparam.h>
#endif /* _SG... | /* $OpenBSD: vmparam.h,v 1.4 2009/10/14 20:18:26 miod Exp $ */
/* public domain */
#ifndef _SGI_VMPARAM_H_
#define _SGI_VMPARAM_H_
#define VM_PHYSSEG_MAX 32 /* Max number of physical memory segments */
/*
* On Origin and Octane families, DMA to 32-bit PCI devices is restricted.
*
* Systems with physical memory aft... |
Reduce nap time to 15 minutes as mentioned in docs | /* See LICENSE file for copyright and license details. */
/* Notification, remove DNOTIFY in config.mk if you don't want it */
static char *notifycmd = ""; /* Uses given command if not compiled by DNOTIFY */
static char *notifyext = ""; /* Notify with extra command (eg. play an alarm) */
/*
* This is the array which... | /* See LICENSE file for copyright and license details. */
/* Notification, remove DNOTIFY in config.mk if you don't want it */
static char *notifycmd = ""; /* Uses given command if not compiled by DNOTIFY */
static char *notifyext = ""; /* Notify with extra command (eg. play an alarm) */
/*
* This is the array which... |
Add a test to the previous commit. | // RUN: %clang_cc1 -triple thumbv7-eabi -target-cpu cortex-a8 -O3 -emit-llvm -o %t %s
void *f0()
{
return __builtin_thread_pointer();
}
| // RUN: %clang_cc1 -Wall -Werror -triple thumbv7-eabi -target-cpu cortex-a8 -O3 -emit-llvm -o - %s | FileCheck %s
void *f0()
{
return __builtin_thread_pointer();
}
void f1(char *a, char *b) {
__clear_cache(a,b);
}
// CHECK: call void @__clear_cache
|
Use new api for terminal tests | #include "test_parser_p.h"
void terminal_success(void **state) {
grammar_t *grammar = grammar_init(
non_terminal("HelloWorld"),
rule_init("HelloWorld",
terminal("hello world")
), 1
);
parse_t *result = parse("hello world", grammar);
assert_int_equal(result->length, 11);
assert_int_equal(re... | #include "test_parser_p.h"
void terminal_success(void **state) {
grammar_t *grammar = grammar_init(
non_terminal("HelloWorld"),
rule_init("HelloWorld",
terminal("hello world")
), 1
);
parse_result_t *result = parse("hello world", grammar);
assert_non_null(result);
assert_true(is_success(re... |
Print times in fixed columns. | #include <time.h>
clock_t calc_time0,calc_time1;
double calc_time;
#define TIME_ON calc_time0=clock();
#define TIME_OFF(msg) calc_time1=clock(); \
calc_time=(double)(calc_time1-calc_time0)/CLOCKS_PER_SEC; \
std::cout<<msg<<": iterations="<<i \
<<" CPU Time="<<std... | #include <time.h>
#include <sstream>
#include <iostream>
clock_t calc_time0,calc_time1;
double calc_time;
void printTime(const std::string& msg, long long iterations, double iterPerSec) {
std::stringstream ss;
ss << msg;
while (ss.tellp() < 30) {
ss << ' ';
}
ss << " iterations=" << iterat... |
Use correct variable for number of tests | #include <stdlib.h>
#include <stdio.h>
#include <check.h>
#include "check_check.h"
int main (void)
{
int n;
SRunner *sr;
fork_setup();
setup_fixture();
sr = srunner_create (make_master_suite());
srunner_add_suite(sr, make_list_suite());
srunner_add_suite(sr, make_msg_suite());
srunner_add_suite(sr, ma... | #include <stdlib.h>
#include <stdio.h>
#include <check.h>
#include "check_check.h"
int main (void)
{
int n;
SRunner *sr;
fork_setup();
setup_fixture();
sr = srunner_create (make_master_suite());
srunner_add_suite(sr, make_list_suite());
srunner_add_suite(sr, make_msg_suite());
srunner_add_suite(sr, ma... |
Upgrade version number to 0.2.0 | #ifndef _MAIN_H_
#define _MAIN_H_
#define PROGRAM_MAJOR_VERSION 0
#define PROGRAM_MINOR_VERSION 1
#define PROGRAM_PATCH_VERSION 1
extern int quit;
#endif /* _MAIN_H_ */
| #ifndef _MAIN_H_
#define _MAIN_H_
#define PROGRAM_MAJOR_VERSION 0
#define PROGRAM_MINOR_VERSION 2
#define PROGRAM_PATCH_VERSION 0
extern int quit;
#endif /* _MAIN_H_ */
|
Add mathextras.h to wtf to give win32 roundf/lroundf support. | /*
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of c... | |
Remove useless unit testing definitions. | /*
* minunit.h
*
* Source: http://www.jera.com/techinfo/jtns/jtn002.html
*/
#include <stdio.h>
extern int tests_run;
#define mu_assert(message, test) do { \
if (!(test)) { \
return message; \
} \
} while (0)
#define mu_run_test(test, name) do { \
test_head(name); \
char const * message = test(); \
tests_... | /*
* minunit.h
*
* Source: http://www.jera.com/techinfo/jtns/jtn002.html
*/
#include <stdio.h>
extern int tests_run;
#define mu_assert(message, test) do { \
if (!(test)) { \
return message; \
} \
} while (0)
#define mu_run_test(test, name) do { \
printf("Test %s... ", name); \
char const * message = test(... |
Add test for OpenCL vector initializer codegen | // RUN: clang-cc %s -emit-llvm -o - | not grep 'extractelement' &&
// RUN: clang-cc %s -emit-llvm -o - | not grep 'insertelement' &&
// RUN: clang-cc %s -emit-llvm -o - | grep 'shufflevector'
typedef __attribute__(( ext_vector_type(2) )) float float2;
typedef __attribute__(( ext_vector_type(4) )) float float4;
float2... | // RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'extractelement' &&
// RUN: clang-cc %s -x cl -emit-llvm -o - | not grep 'insertelement' &&
// RUN: clang-cc %s -x cl -emit-llvm -o - | grep 'shufflevector'
typedef __attribute__(( ext_vector_type(2) )) float float2;
typedef __attribute__(( ext_vector_type(4) )) flo... |
Remove a temporary fn that never got used | /*
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 law or agreed to in ... | /*
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 law or agreed to in ... |
Change version number to 8.1.0 | /*******************************************************************
* This file is part of the Emulex Linux Device Driver for *
* Fibre Channel Host Bus Adapters. *
* Copyright (C) 2004-2005 Emulex. All rights reserved. *
* EMULEX and SLI are trademarks of Emulex. ... | /*******************************************************************
* This file is part of the Emulex Linux Device Driver for *
* Fibre Channel Host Bus Adapters. *
* Copyright (C) 2004-2005 Emulex. All rights reserved. *
* EMULEX and SLI are trademarks of Emulex. ... |
Add function prototype for monitor clone set. | #ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
# define E_SMART_MONITOR_H
Evas_Object *e_smart_monitor_add(Evas *evas);
void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch);
void e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Ra... | #ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
# define E_SMART_MONITOR_H
Evas_Object *e_smart_monitor_add(Evas *evas);
void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch);
Ecore_X_Randr_Crtc e_smart_monitor_crtc_get(Evas_Object *obj... |
Fix missing stdint.h on py2.7 vc9 | #ifndef GUFUNC_SCHEDULER
#define GUFUNC_SCHEDULER
#include <stdint.h>
#ifndef __SIZEOF_POINTER__
/* MSVC doesn't define __SIZEOF_POINTER__ */
#if defined(_WIN64)
#define intp int64_t
#define uintp uint64_t
#elif defined(_WIN32)
#define intp int
#define uintp unsigned
... | #ifndef GUFUNC_SCHEDULER
#define GUFUNC_SCHEDULER
/* define int64_t and uint64_t for VC9 */
#ifdef _MSC_VER
#define int64_t signed __int64
#define uint64_t unsigned __int64
#else
#include <stdint.h>
#endif
#ifndef __SIZEOF_POINTER__
/* MSVC doesn't define __SIZEOF_POINTER__ */
#if defined(_WIN64)
... |
Fix mac bustage (more still). | // -*- c-basic-offset: 2 -*-
/*
* This file is part of the KDE libraries
* Copyright (C) 2006 George Staikos <staikos@kde.org>
*
* 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 Foundation... | // -*- c-basic-offset: 2 -*-
/*
* This file is part of the KDE libraries
* Copyright (C) 2006 George Staikos <staikos@kde.org>
*
* 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 Foundation... |
Clear existing divisor before setting it. | #include <kernel/x86/apic.h>
#include <kernel/port/mmio.h>
void apic_timer_init(uint8_t int_no, uint8_t divisor, uint8_t mode) {
/** set the divisor: **/
uint32_t reg = get32(DIVIDE_CONF);
reg &= ~0xf;
/* The representation of the divisor in the divide configuration
* register is... weird. We're normalizing it... | #include <kernel/x86/apic.h>
#include <kernel/port/mmio.h>
void apic_timer_init(uint8_t int_no, uint8_t divisor, uint8_t mode) {
/** set the divisor: **/
uint32_t reg = get32(DIVIDE_CONF);
reg &= ~0xf;
/* The representation of the divisor in the divide configuration
* register is... weird. We're normalizing it... |
Add reference for almost_equal function | #ifndef H_NUMERIC
#define H_NUMERIC
#include <cmath>
#include <limits>
template<class T>
typename std::enable_if<!std::numeric_limits<T>::is_integer, bool>::type
almost_equal(T x, T y, int ulp=2)
{
// the machine epsilon has to be scaled to the magnitude of the values used
// and multiplied by the desired... | #ifndef H_NUMERIC
#define H_NUMERIC
#include <cmath>
#include <limits>
/**
* @brief use of machine epsilon to compare floating-point values for equality
* http://en.cppreference.com/w/cpp/types/numeric_limits/epsilon
*/
template<class T>
typename std::enable_if<!std::numeric_limits<T>::is_integer, bool>::type
... |
Annotate RLMAssertThrows' block argument with noescape | ////////////////////////////////////////////////////////////////////////////
//
// Copyright 2015 Realm 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/li... | ////////////////////////////////////////////////////////////////////////////
//
// Copyright 2015 Realm 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/li... |
Add an unused interface for storing thumbnails. This is to replace the history system's thumbnail storage. | // Copyright (c) 2009 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_THUMBNAIL_STORE_H_
#define CHROME_BROWSER_THUMBNAIL_STORE_H_
#include <vector>
#include "base/file_path.h"
class GURL;
class... | |
Add <string> explicitly for Windows complaining without it | #ifndef _BIGINT_H_
#define _BIGINT_H_
#include <memory>
namespace Erpiko {
/**
* BigInt is the class of big integer representation.
*/
class BigInt {
public:
/**
* Constructor
*/
BigInt();
/**
* Constructor from long integer
* @param value to be initialized
*/
BigI... | #ifndef _BIGINT_H_
#define _BIGINT_H_
#include <string>
#include <memory>
namespace Erpiko {
/**
* BigInt is the class of big integer representation.
*/
class BigInt {
public:
/**
* Constructor
*/
BigInt();
/**
* Constructor from long integer
* @param value to be initialize... |
Replace custom IMAGEDIR_MAX with PATH_MAX, ala 13616d1 | #include "defs.h"
void locate_library_executable(int argc, char *argv[])
{
DWORD l;
char *endpath;
#ifdef DLL
HANDLE dll;
#endif
l = GetModuleFileName(NULL, executable_path, IMAGEDIR_MAX);
if (l == 0 || l >= IMAGEDIR_MAX) fatal_error(FE_INFND, 0);
#ifdef DLL
dll = GetModuleHandle(DLL_NAME);
... | #include "defs.h"
void locate_library_executable(int argc, char *argv[])
{
DWORD l;
char *endpath;
#ifdef DLL
HANDLE dll;
#endif
l = GetModuleFileName(NULL, executable_path, PATH_MAX);
if (l == 0 || l >= PATH_MAX) fatal_error(FE_INFND, 0);
#ifdef DLL
dll = GetModuleHandle(DLL_NAME);
if (... |
Set about dialog program name | #include <gtk/gtk.h>
GtkWidget *
gh_about_dialog_create ()
{
GtkWidget *dialog;
dialog = gtk_about_dialog_new ();
static gchar const *title = "About ghighlighter";
gtk_window_set_title (GTK_WINDOW (dialog), title);
return dialog;
}
| #include <gtk/gtk.h>
GtkWidget *
gh_about_dialog_create ()
{
GtkWidget *dialog;
dialog = gtk_about_dialog_new ();
static gchar const *title = "About ghighlighter";
static gchar const *program_name = "ghighlighter";
gtk_window_set_title (GTK_WINDOW (dialog), title);
gtk_about_dialog_set_program_name (GTK... |
Add new header file. (or: xcode is stupid) | //
// BDSKOAIGroupServer.h
// Bibdesk
//
// Created by Christiaan Hofman on 1/1/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "BDSKSearchGroup.h"
@class BDSKServerInfo;
@interface BDSKOAIGroupServer : NSObject <BDSKSearchGroupServer>
{
BDSKSearchGroup *group... | |
Change functions to handle idioma | #include <stdlib.h>
#include <string.h>
#include "config.h"
struct Config load_config(char *arquivo) {
}
struct Idioma load_idioma(char *idioma){
char *local_idioma;
int loaded;
strcpy(local_idioma, "local aqui");
strcat(local_idioma, idioma);
strcat(local_idioma, ".conf");
loaded = 1;
while(loaded) ... | #include <stdlib.h>
#include <string.h>
#include "config.h"
struct Config load_config(char *arquivo) {
}
void load_idioma(struct Idioma *idioma, char *key, char *content){
}
void clean_idioma(struct Idioma *idioma) {
free(idioma);
}
|
Make UInt safe on Transaction Params by not using pointer | //
// PSTCKTransactionParams.h
// Paystack
//
#import <Foundation/Foundation.h>
#import "PSTCKFormEncodable.h"
/**
* Representation of a user's credit card details. You can assemble these with information that your user enters and
* then create Paystack tokens with them using an PSTCKAPIClient. @see https://pays... | //
// PSTCKTransactionParams.h
// Paystack
//
#import <Foundation/Foundation.h>
#import "PSTCKFormEncodable.h"
/**
* Representation of a user's credit card details. You can assemble these with information that your user enters and
* then create Paystack tokens with them using an PSTCKAPIClient. @see https://pays... |
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 (!... |
Update Skia milestone to 88 | /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 87
#endif
| /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 88
#endif
|
Revert "[FIXED] not use allocator, for async draw" | #ifndef _GUM_GLYPH_STYLE_ID_H_
#define _GUM_GLYPH_STYLE_ID_H_
#include "gum/GlyphStyle.h"
#include <cu/cu_macro.h>
#include <cu/cu_stl.h>
namespace gum
{
class GlyphStyle;
class GlyphStyleID
{
public:
int Gen(const GlyphStyle& style);
private:
static int Hash(const GlyphStyle& style);
private:
static const in... | #ifndef _GUM_GLYPH_STYLE_ID_H_
#define _GUM_GLYPH_STYLE_ID_H_
#include "gum/GlyphStyle.h"
#include <cu/cu_macro.h>
#include <cu/cu_stl.h>
namespace gum
{
class GlyphStyle;
class GlyphStyleID
{
public:
int Gen(const GlyphStyle& style);
private:
static int Hash(const GlyphStyle& style);
private:
static const in... |
Use -fPIC -shared in a test instead of -dynamiclib | // Test __llvm_profile_get_filename when the on-line merging mode is enabled.
//
// RUN: %clang_pgogen -dynamiclib -o %t.dso %p/Inputs/instrprof-get-filename-dso.c
// RUN: %clang_pgogen -o %t %s %t.dso
// RUN: env LLVM_PROFILE_FILE="%t-%m.profraw" %run %t
#include <string.h>
const char *__llvm_profile_get_filename(vo... | // Test __llvm_profile_get_filename when the on-line merging mode is enabled.
//
// RUN: %clang_pgogen -fPIC -shared -o %t.dso %p/../Inputs/instrprof-get-filename-dso.c
// RUN: %clang_pgogen -o %t %s %t.dso
// RUN: env LLVM_PROFILE_FILE="%t-%m.profraw" %run %t
#include <string.h>
const char *__llvm_profile_get_filena... |
Check if two strings are permutations by checking their character counts | //
// main.c
// Check if two strings are permutations by checking if they have identical character counts.
//
// Created by Jack Zuban on 8/20/17.
// Copyright © 2017 Jack Zuban. All rights reserved.
//
#include <stdio.h>
#include <stdbool.h>
bool areStringsHaveSameLength(char *str1, char *str2)
{
while (*str... | |
Remove debug information from VMOV code | //
// arch/x86_64/rsp/vmov.c
//
// This file is subject to the terms and conditions defined in
// 'LICENSE', which is part of this source code package.
//
#include "common.h"
#include "rsp/cpu.h"
#include "rsp/rsp.h"
__m128i rsp_vmov(struct rsp *rsp,
unsigned src, unsigned e, unsigned dest, rsp_vect_t vt_shuffle) {... | //
// arch/x86_64/rsp/vmov.c
//
// This file is subject to the terms and conditions defined in
// 'LICENSE', which is part of this source code package.
//
#include "common.h"
#include "rsp/cpu.h"
#include "rsp/rsp.h"
__m128i rsp_vmov(struct rsp *rsp,
unsigned src, unsigned e, unsigned dest, rsp_vect_t vt_shuffle) {... |
Add a simple reference count API that is simply a thin wrapper API around atomic operations on ints. | /*-
* Copyright (c) 2005 John Baldwin <jhb@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, t... | |
Make AcpiInitializeTables to dynamically alloc tables | /* SPDX-License-Identifier: BSD-2-Clause */
#include <tilck/common/basic_defs.h>
#include <tilck/common/printk.h>
#include <tilck/kernel/sched.h>
#include "osl.h"
#include <3rd_party/acpi/acpi.h>
#include <3rd_party/acpi/acexcep.h>
static ACPI_TABLE_DESC acpi_tables[16];
void
early_init_acpi_module(void)
{
ACPI... | /* SPDX-License-Identifier: BSD-2-Clause */
#include <tilck/common/basic_defs.h>
#include <tilck/common/printk.h>
#include <tilck/kernel/sched.h>
#include "osl.h"
#include <3rd_party/acpi/acpi.h>
#include <3rd_party/acpi/acexcep.h>
void
early_init_acpi_module(void)
{
ACPI_STATUS rc;
rc = AcpiInitializeSubsys... |
Replace fizz server cert with leaf cert returned from verification | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <fizz/protocol/CertificateVerifier.h>
namespace quic::test {
class TestCertificateVerifier : public fizz... | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <fizz/protocol/CertificateVerifier.h>
namespace quic::test {
class TestCertificateVerifier : public fizz... |
Use correct syntax for windows DLL export | #ifdef _WIN32
#define LIB_FUNC __declspec(dllimport)
#else
#define LIB_FUNC
#endif
void LIB_FUNC printBuildType();
| #ifdef _WIN32
#define LIB_FUNC __declspec(dllexport)
#else
#define LIB_FUNC
#endif
void LIB_FUNC printBuildType();
|
Change forward declaration of HttpRequestInfo from class to struct to fix build breakage. | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_SPDY_SPDY_HTTP_UTILS_H_
#define NET_SPDY_SPDY_HTTP_UTILS_H_
#pragma once
#include "net/spdy/spdy_framer.h"
namespace net {
class HttpRe... | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_SPDY_SPDY_HTTP_UTILS_H_
#define NET_SPDY_SPDY_HTTP_UTILS_H_
#pragma once
#include "net/spdy/spdy_framer.h"
namespace net {
class HttpRe... |
Add example that needs Apron heterogeneous join strengthening | // SKIP PARAM: --set ana.activated[+] apron --set ana.path_sens[+] threadflag --set ana.activated[-] threadJoins --enable ana.apron.threshold_widening --set ana.apron.privatization protection --enable ana.apron.strengthening
// Fig 5a from Miné 2014
// Example for join strengthening
#include <pthread.h>
#include <stdio... | |
Create function to check if text_input is a valid number | #include <stdio.h>
#include <string.h>
// Declare functions
void get_input();
// Global variables
char text_input[32];
int running = 1;
// Main Section
int main() {
while (running == 1) {
if (strcmp(text_input, "q") == 0) {
running = 0;
printf("Goodbye!\n");
}
else {
get_input();
... | #include <stdio.h>
#include <string.h>
// Declare functions
void get_input();
int is_valid_number();
// Global variables
char text_input[32];
int running = 1;
// Main Section
int main() {
while (running == 1) {
if (strcmp(text_input, "q") == 0) {
running = 0;
printf("Goodbye!\n");
}
else {... |
Include io.h for mingw builds | /**
* @file utils.h
* @brief Storj utilities.
*
* Helper utilities
*/
#ifndef STORJ_UTILS_H
#define STORJ_UTILS_H
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <math.h>
#include <stdbool.h>
#ifdef _WIN32
#include <windows.h>
#inclu... | /**
* @file utils.h
* @brief Storj utilities.
*
* Helper utilities
*/
#ifndef STORJ_UTILS_H
#define STORJ_UTILS_H
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <math.h>
#include <stdbool.h>
#ifdef _WIN32
#include <windows.h>
#inclu... |
Allow passing RNG seed as program argument | /* headers */
#include <stdlib.h>
#include <time.h>
#include "lattice.h"
#include "clusters.h"
#include "io_helpers.h"
/* main body function */
int main(int argc, char ** argv)
{
int L; /* square lattice size */
double p; /* occupation probability of each lattice site */
int *lattice; /* lattice array */
... | /* headers */
#include <stdlib.h>
#include <time.h>
#include "lattice.h"
#include "clusters.h"
#include "io_helpers.h"
/* main body function */
int main(int argc, char ** argv)
{
int L; /* square lattice size */
double p; /* occupation probability of each lattice site */
int *lattice; /* lattice array */
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.