Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Remove test for obsolete function stat64. | /*
* Copyright 2010 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can
* be found in the LICENSE file.
*/
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
#pragma GCC diagnostic ignored "-Wnonnull"
#define KNOWN_FIL... | /*
* Copyright 2010 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can
* be found in the LICENSE file.
*/
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
#pragma GCC diagnostic ignored "-Wnonnull"
#define KNOWN_FIL... |
Add cartesian_value_product template meta function | #ifndef LIB_MART_COMMON_GUARD_TMP_H
#define LIB_MART_COMMON_GUARD_TMP_H
/**
* tmp.h (mart-common)
*
* Copyright (C) 2015-2017: Michael Balszun <michael.balszun@mytum.de>
*
* This software may be modified and distributed under the terms
* of the MIT license. See either the LICENSE file in the library's root
* directory ... | |
Print something about "Secure Notes" while iterating | //
// main.c
// secure-notes-exporter
//
// Created by Greg Hurrell on 5/9/14.
// Copyright (c) 2014 Greg Hurrell. All rights reserved.
//
#include <CoreFoundation/CoreFoundation.h>
#include <Security/Security.h>
int main(int argc, const char * argv[])
{
// create query
CFStringRef keys[] = { kSecReturnAt... | //
// main.c
// secure-notes-exporter
//
// Created by Greg Hurrell on 5/9/14.
// Copyright (c) 2014 Greg Hurrell. All rights reserved.
//
#include <CoreFoundation/CoreFoundation.h>
#include <Security/Security.h>
void printItem(const void *value, void *context) {
CFDictionaryRef dictionary = value;
CFNumb... |
Add EOL at EOF to appease source utils like unifdef | //===- Mem2Reg.h - The -mem2reg pass, a wrapper around the Utils lib ------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===- Mem2Reg.h - The -mem2reg pass, a wrapper around the Utils lib ------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Add bug testcase for GH-337 | /*
* Bug in duk_is_primitive() prior to Duktape 1.3.0: returns 1 for invalid
* index.
*
* https://github.com/svaarala/duktape/issues/337
*/
/*===
*** test_1 (duk_safe_call)
0
final top: 0
==> rc=0, result='undefined'
*** test_2 (duk_safe_call)
0
final top: 0
==> rc=0, result='undefined'
*** test_3 (duk_safe_ca... | |
Modify test 02/86 so it fails if spurious warning is produced | #include<pthread.h>
#include<assert.h>
int counter = 0;
pthread_mutex_t lock1;
void* producer(void* param) {
pthread_mutex_lock(&lock1);
counter = 0;
pthread_mutex_unlock(&lock1);
}
void* consumer(void* param) {
pthread_mutex_lock(&lock1);
int bla = counter >= 0;
// This should not produce a w... | //PARAM: --disable warn.assert
#include<pthread.h>
#include<assert.h>
int counter = 0;
pthread_mutex_t lock1;
void* producer(void* param) {
pthread_mutex_lock(&lock1);
counter = 0;
pthread_mutex_unlock(&lock1);
}
void* consumer(void* param) {
pthread_mutex_lock(&lock1);
int bla = counter >= 0;
... |
Enable the nRF52 built-in DC/DC converter | /*
* Copyright (C) 2019 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_nrf52832-mdk
* @{
*
* @file
* @brief Peripheral configuration for the nRF... | /*
* Copyright (C) 2019 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_nrf52832-mdk
* @{
*
* @file
* @brief Peripheral configuration for the nRF... |
Change over to KostaKow's version of this | /****************************************************************************
* Simple definitions to aid platform portability
* Author: Bill Forster
* License: MIT license. Full text of license is in associated file LICENSE
* Copyright 2010-2014, Bill Forster <billforsternz at gmail dot com>
*****************... | /****************************************************************************
* Simple definitions to aid platform portability
* Author: Bill Forster
* License: MIT license. Full text of license is in associated file LICENSE
* Copyright 2010-2014, Bill Forster <billforsternz at gmail dot com>
*****************... |
Drop the default polling interval to 100ms | #ifndef POLLING_THREAD_H
#define POLLING_THREAD_H
#include <cstdint>
#include <chrono>
#include <map>
#include <uv.h>
#include "../thread.h"
#include "../status.h"
#include "../result.h"
#include "polled_root.h"
const std::chrono::milliseconds DEFAULT_POLL_INTERVAL = std::chrono::milliseconds(500);
const uint_fast64... | #ifndef POLLING_THREAD_H
#define POLLING_THREAD_H
#include <cstdint>
#include <chrono>
#include <map>
#include <uv.h>
#include "../thread.h"
#include "../status.h"
#include "../result.h"
#include "polled_root.h"
const std::chrono::milliseconds DEFAULT_POLL_INTERVAL = std::chrono::milliseconds(100);
const uint_fast64... |
Add a missing header include for assert.h | #ifndef __CORE_SET__
#define __CORE_SET__
#include <set>
class CoreSet : public std::set<int>
{
public:
int getPrevCore(int coreId) {
auto curr = this->find(coreId);
assert(curr != this->end());
curr--;
// This was the first element, start over
if (curr == this->end())
... | #ifndef __CORE_SET__
#define __CORE_SET__
#include "assert.h"
#include <set>
class CoreSet : public std::set<int>
{
public:
int getPrevCore(int coreId) {
auto curr = this->find(coreId);
assert(curr != this->end());
curr--;
// This was the first element, start over
if (curr ... |
Test reported by Axel, our FreeBSD user. This file is the postprocessed result from a FreeBSD machine. This command fails: | # 1 "wchar1.c"
# 1 "testharness.h" 1
extern int printf(const char *, ...);
extern void exit(int);
# 1 "wchar1.c" 2
# 1 "/usr/include/stddef.h" 1 3
# 1 "/usr/include/machine/ansi.h" 1 3
... | |
Document return value of FileUrlReader's reload() and write_config() | #ifndef NEWSBOAT_FILEURLREADER_H_
#define NEWSBOAT_FILEURLREADER_H_
#include <string>
#include "urlreader.h"
namespace newsboat {
class FileUrlReader : public UrlReader {
public:
explicit FileUrlReader(const std::string& file = "");
nonstd::optional<std::string> reload() override;
std::string get_source() overr... | #ifndef NEWSBOAT_FILEURLREADER_H_
#define NEWSBOAT_FILEURLREADER_H_
#include <string>
#include "urlreader.h"
namespace newsboat {
class FileUrlReader : public UrlReader {
public:
explicit FileUrlReader(const std::string& file = "");
/// \brief Load URLs from the urls file.
///
/// \return A non-value on succes... |
Fix unknown type name 'size_t' error | /*
// Copyright (c) 2019 Intel Corporation
//
// 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... | /*
// Copyright (c) 2019 Intel Corporation
//
// 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... |
Revise test case due to the change from CUDA 10+. | // REQUIRES: clang-driver
// REQUIRES: powerpc-registered-target
// REQUIRES: nvptx-registered-target
//
// Verify that CUDA device commands do not get OpenMP flags.
//
// RUN: %clang -no-canonical-prefixes -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp=libomp %s 2>&1 \
// RUN: | ... | // REQUIRES: clang-driver
// REQUIRES: powerpc-registered-target
// REQUIRES: nvptx-registered-target
//
// Verify that CUDA device commands do not get OpenMP flags.
//
// RUN: %clang -no-canonical-prefixes -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp=libomp %s 2>&1 \
// RUN: | ... |
Use deleted instead of private constructors | #ifndef LINUXFFBEFFECTFACTORY_H
#define LINUXFFBEFFECTFACTORY_H
#include "globals.h"
#include "linuxffbconditioneffect.h"
#include "linuxffbconstanteffect.h"
#include "ffbnulleffect.h"
#include "linuxffbperiodiceffect.h"
#include "linuxffbrampeffect.h"
#include "linuxffbrumbleeffect.h"
class LinuxFFBEffectFactory
{
p... | #ifndef LINUXFFBEFFECTFACTORY_H
#define LINUXFFBEFFECTFACTORY_H
#include "globals.h"
#include "linuxffbconditioneffect.h"
#include "linuxffbconstanteffect.h"
#include "ffbnulleffect.h"
#include "linuxffbperiodiceffect.h"
#include "linuxffbrampeffect.h"
#include "linuxffbrumbleeffect.h"
class LinuxFFBEffectFactory
{
p... |
Fix compiler error about undeclared type | @class TRTemperature;
@interface TRWeatherUpdate : NSObject
@property (nonatomic, copy, readonly) NSString *city;
@property (nonatomic, copy, readonly) NSString *state;
@property (nonatomic, copy, readonly) NSString *conditionsDescription;
@property (nonatomic, readonly) TRTemperature *currentTemperature;
@property (... | @class CLPlacemark;
@class TRTemperature;
@interface TRWeatherUpdate : NSObject
@property (nonatomic, copy, readonly) NSString *city;
@property (nonatomic, copy, readonly) NSString *state;
@property (nonatomic, copy, readonly) NSString *conditionsDescription;
@property (nonatomic, readonly) TRTemperature *currentTemp... |
Add a test for r228510. | /*-
* Copyright (c) 2010 Jilles Tjoelker
* 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 con... | |
Add insertOrAssign helper for maps | #ifndef TE_AUXILIARY_H
#define TE_AUXILIARY_H
struct SDL_Rect;
namespace te
{
struct Vector2i;
class Rectangle;
bool checkCollision(const SDL_Rect& a, const SDL_Rect& b);
bool checkCollision(const Rectangle& a, const Rectangle& b);
SDL_Rect getIntersection(const SDL_Rect& a, const SDL_Rect& b);... | #ifndef TE_AUXILIARY_H
#define TE_AUXILIARY_H
#include <map>
struct SDL_Rect;
namespace te
{
struct Vector2i;
class Rectangle;
bool checkCollision(const SDL_Rect& a, const SDL_Rect& b);
bool checkCollision(const Rectangle& a, const Rectangle& b);
SDL_Rect getIntersection(const SDL_Rect& a, con... |
Add a default constructor for FormData. There are too many places that create FormDatas, and we shouldn't need to initialize user_submitted for each call site. | // 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 WEBKIT_GLUE_FORM_DATA_H__
#define WEBKIT_GLUE_FORM_DATA_H__
#include <vector>
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
... | // 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 WEBKIT_GLUE_FORM_DATA_H__
#define WEBKIT_GLUE_FORM_DATA_H__
#include <vector>
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
... |
Remove apparently uneccessary extern C stuff | extern "C" {
#include <sys/types.h>
}
class Instrument {
public:
float start;
float dur;
int cursamp;
int chunksamps;
int endsamp;
int nsamps;
unsigned long chunkstart;
int sfile_on; // a soundfile is open (for closing later)
int fdIndex; // index into unix input file desc. table
int inputchans... | #include <sys/types.h>
class Instrument {
public:
float start;
float dur;
int cursamp;
int chunksamps;
int endsamp;
int nsamps;
unsigned long chunkstart;
int sfile_on; // a soundfile is open (for closing later)
int fdIndex; // index into unix input file desc. table
int inputchans;
double input... |
Include stdint.h instead of stdio.h. | // RUN: clang -checker-simple -verify %s
#include <stdlib.h>
int f1(int * p) {
// This branch should be infeasible
// because __imag__ p is 0.
if (!p && __imag__ (intptr_t) p)
*p = 1; // no-warning
// If p != 0 then this branch is feasible; otherwise it is not.
if (__real__ (intptr_t) p)
*p = 1;... | // RUN: clang -checker-simple -verify %s
#include <stdint.h>
int f1(int * p) {
// This branch should be infeasible
// because __imag__ p is 0.
if (!p && __imag__ (intptr_t) p)
*p = 1; // no-warning
// If p != 0 then this branch is feasible; otherwise it is not.
if (__real__ (intptr_t) p)
*p = 1;... |
Add compare function of quadruple precision | /* This file is part of Metallic, a C++ library for WebAssembly.
*
* Copyright (C) 2017 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.org... | |
Add BSD 3-clause open source header | /*
* The Homework Database
*
* Authors:
* Oliver Sharma and Joe Sventek
* {oliver, joe}@dcs.gla.ac.uk
*
* (c) 2009. All rights reserved.
*/
#ifndef OCLIB_UTIL_H
#define OCLIB_UTIL_H
#include "config.h"
#include "logdefs.h"
#include <stdio.h>
/* -------- [MESSAGE] -------- */
#ifdef NMSG
#define MSG (v... | /*
* Copyright (c) 2013, Court of the University of Glasgow
* 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 retain the above copyright notice,
* thi... |
Change return value of hrtime from seconds to nano seconds. | #include "couv-private.h"
static int couv_hrtime(lua_State *L) {
lua_pushnumber(L, uv_hrtime() / 1e9);
return 1;
}
static const struct luaL_Reg functions[] = {
{ "hrtime", couv_hrtime },
{ NULL, NULL }
};
int luaopen_couv_native(lua_State *L) {
lua_createtable(L, 0, ARRAY_SIZE(functions) - 1);
couvL_setf... | #include "couv-private.h"
static int couv_hrtime(lua_State *L) {
lua_pushnumber(L, uv_hrtime());
return 1;
}
static const struct luaL_Reg functions[] = {
{ "hrtime", couv_hrtime },
{ NULL, NULL }
};
int luaopen_couv_native(lua_State *L) {
lua_createtable(L, 0, ARRAY_SIZE(functions) - 1);
couvL_setfuncs(L... |
Disable divide by zero warning for VS6 to avoid modifying function implementation. | #include "v3p_f2c.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef KR_headers
integer pow_ii(ap, bp) integer *ap, *bp;
#else
integer pow_ii(integer *ap, integer *bp)
#endif
{
integer pow, x, n;
unsigned long u;
x = *ap;
n = *bp;
if (n <= 0) {
if (n == 0 || x ==... | #include "v3p_f2c.h"
#ifdef __cplusplus
extern "C" {
#endif
/* The divide by zero below appears to be perhaps on purpose to create
a numerical exception. */
#ifdef _MSC_VER
# pragma warning (disable: 4723) /* potential divide by 0 */
#endif
#ifdef KR_headers
integer pow_ii(ap, bp) integer *ap, *bp;
#else
integer ... |
Duplicate RCTMethodInfo while building iOS app | //
// OAuthManager.h
//
// Created by Ari Lerner on 5/31/16.
// Copyright © 2016 Facebook. All rights reserved.
//
#import <Foundation/Foundation.h>
#if __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"
#else
#import <React/RCTBridgeModule.h>
#endif
#if __has_include("RCTLinkingManager.h")
... | //
// OAuthManager.h
//
// Created by Ari Lerner on 5/31/16.
// Copyright © 2016 Facebook. All rights reserved.
//
#import <Foundation/Foundation.h>
#if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#else
#import "RCTBridgeModule.h"
#endif
#if __has_include(<React/RCTLinkingMa... |
Add "TA_String *name" to TA_AddDataSourceParamPriv | #ifndef TA_ADDDATASOURCEPARAM_PRIV_H
#define TA_ADDDATASOURCEPARAM_PRIV_H
/* The following is a private copy of the user provided
* parameters for a TA_AddDataSource call.
*
* Code is in 'ta_data_interface.c'
*/
typedef struct
{
TA_SourceId id;
TA_SourceFlag flags;
TA_Period period;
TA_String *locat... | #ifndef TA_ADDDATASOURCEPARAM_PRIV_H
#define TA_ADDDATASOURCEPARAM_PRIV_H
/* The following is a private copy of the user provided
* parameters for a TA_AddDataSource call.
*
* Code is in 'ta_data_interface.c'
*/
typedef struct
{
TA_SourceId id;
TA_SourceFlag flags;
TA_Period period;
TA_String *locat... |
Fix broken signal connection CVS_SILENT | //
// C++ Interface: getdetailstask
//
// Description:
//
//
// Author: SUSE AG <>, (C) 2004
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef GETDETAILSTASK_H
#define GETDETAILSTASK_H
#include "gwerror.h"
#include "requesttask.h"
/**
This task fetches the details for a set of user ID... | //
// C++ Interface: getdetailstask
//
// Description:
//
//
// Author: SUSE AG <>, (C) 2004
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef GETDETAILSTASK_H
#define GETDETAILSTASK_H
#include "gwerror.h"
#include "requesttask.h"
/**
This task fetches the details for a set of user ID... |
Add a default constructor for FormData. There are too many places that create FormDatas, and we shouldn't need to initialize user_submitted for each call site. | // 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 WEBKIT_GLUE_FORM_DATA_H__
#define WEBKIT_GLUE_FORM_DATA_H__
#include <vector>
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
... | // 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 WEBKIT_GLUE_FORM_DATA_H__
#define WEBKIT_GLUE_FORM_DATA_H__
#include <vector>
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
... |
Use forward declaration for MeterWnd | #pragma once
#include "MeterWnd.h"
class Animation {
public:
virtual bool Animate(MeterWnd *meterWnd) = 0;
virtual void Reset(MeterWnd *meterWnd) = 0;
}; | #pragma once
class MeterWnd;
class Animation {
public:
virtual bool Animate(MeterWnd *meterWnd) = 0;
virtual void Reset(MeterWnd *meterWnd) = 0;
}; |
Update barrier test to new api. | /****************************************************
* This is a test that will test barriers *
****************************************************/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <fcntl.h>
#include "carbon_user.h"
#include "capi.h"
#include "... | /****************************************************
* This is a test that will test barriers *
****************************************************/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <fcntl.h>
#include "carbon_user.h"
#include "capi.h"
#include "... |
Add path helpers which handle paths relative to project root. | #ifndef SRC_UTILS_PATH_HELPER_H_
#define SRC_UTILS_PATH_HELPER_H_
#include <QFile>
#include <QUrl>
#include <QDir>
#include <QCoreApplication>
#include <string>
inline QString absolutePathOfRelativeUrl(QUrl url)
{
return QDir(QCoreApplication::applicationDirPath())
.absoluteFilePath(url.toLocalFile());
}
in... | #ifndef SRC_UTILS_PATH_HELPER_H_
#define SRC_UTILS_PATH_HELPER_H_
#include <QFile>
#include <QUrl>
#include <QDir>
#include <QCoreApplication>
#include <string>
#include "./project_root.h"
inline QString relativeApplicationToProjectRootPath()
{
return QDir(QCoreApplication::applicationDirPath())
.relativeFil... |
Fix bug in SPYWAIT helpers | #ifndef NEOVIM_QT_TEST_COMMON
#define NEOVIM_QT_TEST_COMMON
// This is just a fix for QSignalSpy::wait
// http://stackoverflow.com/questions/22390208/google-test-mock-with-qt-signals
#define SPYWAIT(spy) (spy.count()>0||spy.wait())
#define SPYWAIT2(spy, time) (spy.count()>0||spy.wait(time))
#endif
| #ifndef NEOVIM_QT_TEST_COMMON
#define NEOVIM_QT_TEST_COMMON
// This is just a fix for QSignalSpy::wait
// http://stackoverflow.com/questions/22390208/google-test-mock-with-qt-signals
bool SPYWAIT(QSignalSpy &spy, int timeout=10000)
{
return spy.count()>0||spy.wait(timeout);
}
bool SPYWAIT2(QSignalSpy &spy, int timeo... |
Add a regression test for disabled client mode | /*
* Copyright 2014 Amazon.com, Inc. or its affiliates. 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 located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" ... | |
Adjust ISL enum to make it bss eligible | // Copyright 2020 The Pigweed Authors
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agre... | // Copyright 2020 The Pigweed Authors
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agre... |
Add content for test case setInvalid-1 | // Copyright 2018 Eotvos Lorand University, Budapest, Hungary
//
// 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... | |
Update documentation for pointer type change | #ifndef LACO_UTIL_H
#define LACO_UTIL_H
struct LacoState;
/**
* Load a line into the lua stack to be evaluated later
*
* param pointer to LacoState
*
* return -1 if there is no line input to load
*/
int laco_load_line(struct LacoState* laco);
/**
* Called after laco_load_line, this evaluated the line... | #ifndef LACO_UTIL_H
#define LACO_UTIL_H
struct LacoState;
/**
* Load a line into the lua stack to be evaluated later
*
* param pointer to LacoState
*
* return -1 if there is no line input to load
*/
int laco_load_line(struct LacoState* laco);
/**
* Called after laco_load_line, this evaluated the line... |
Add missing include for fd_set declaration | #pragma once
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <string.h>
#include <errno.h>
#define emsg(s, d) \
fprintf(stderr, "%s(%d): %s %s\n", __func__, __LINE__, s, strerror(d))
#define err(s) emsg(s, errn... | #pragma once
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <netdb.h>
#include <string.h>
#include <errno.h>
#define emsg(s, d) \
fprintf(stderr, "%s(%d): %s %s\n", __func__, __LINE__, s, strerror(d))
#de... |
Add constant formatting string for creating hexadecimal chunks. | #ifndef CONSTANTS_INCLUDED
#define WORDLENGTH 11
#define NUMWORDS 65536
#define WORDFILE "words.txt"
#define HEX_CHUNK_LENGTH 4
#define CONSTANTS_INCLUDED
#endif
| #ifndef CONSTANTS_INCLUDED
#define WORDLENGTH 11
#define NUMWORDS 65536
#define WORDFILE "words.txt"
#define HEX_CHUNK_LENGTH 4
#define HEX_CHUNK_FORMAT "%04X"
#define CONSTANTS_INCLUDED
#endif
|
Add documentation for GET_MAP command | #ifndef NET_H
#define NET_H
typedef enum Command {GET_STATE = 'S',
SHOOT = 'F', GET_MAP = 'M', ERROR = 'E'} Command;
#define PORTNUM 7979 /* Port Number */
#define MAXRCVLEN 128 /* Maximal Length of Received Value */
#endif /* NET_H */
| #ifndef NET_H
#define NET_H
/*
* command args reply
*
* GET_MAP none map_seed map_length map_height
*/
typedef enum Command {GET_STATE = 'S',
SHOOT = 'F', GET_MAP = 'M', ERROR = 'E'} Command;
#define PORTNUM 7979 /* Port Number */
#define MAXRCVLEN 128 /* Maximal Length of Received... |
Add new option to enable/disable compression | #ifndef CTCONFIG_H
#define CTCONFIG_H
//#define ENABLE_ASSERT_CHECKS
//#define CT_NODE_DEBUG
//#define ENABLE_INTEGRITY_CHECK
//#define ENABLE_COUNTERS
//#define ENABLE_PAGING
//#define SNAPPY_COMPRESSION
#endif // CTCONFIG_H
| #ifndef CTCONFIG_H
#define CTCONFIG_H
//#define ENABLE_ASSERT_CHECKS
//#define CT_NODE_DEBUG
//#define ENABLE_INTEGRITY_CHECK
//#define ENABLE_COUNTERS
//#define ENABLE_PAGING
#define ENABLE_COMPRESSION
//#define SNAPPY_COMPRESSION
#endif // CTCONFIG_H
|
Add conditional for BSS cleanup |
extern unsigned int __bss_start__,__bss_end__;
extern unsigned int ___ctors, ___ctors_end;
extern char __end__;
static char *start_brk = &__end__;
extern void _Z4loopv();
extern void _Z5setupv();
void ___clear_bss()
{
unsigned int *ptr = &__bss_start__;
while (ptr!=&__bss_end__) {
*ptr = 0;
ptr++;
}
}
void ... |
extern unsigned int __bss_start__,__bss_end__;
extern unsigned int ___ctors, ___ctors_end;
extern char __end__;
static char *start_brk = &__end__;
extern void _Z4loopv();
extern void _Z5setupv();
void ___clear_bss()
{
unsigned int *ptr = &__bss_start__;
while (ptr!=&__bss_end__) {
*ptr = 0;
ptr++;
}
}
void ... |
Replace empty arguments definition with void for compatibility | #ifndef _PARSER_H_
#define _PARSER_H_
#include <Python.h>
#include "circular_buffer.h"
typedef enum {
COMPLETE_DATA,
MISSING_DATA,
INVALID_DATA,
PARSE_FATAL_ERROR,
} parse_result;
typedef enum {
PART_CHOOSER,
PART_SINGLE_SIZED,
PART_COUNT,
PART_INLINE,
PART_SIZE,
PART_PYSTRING... | #ifndef _PARSER_H_
#define _PARSER_H_
#include <Python.h>
#include "circular_buffer.h"
typedef enum {
COMPLETE_DATA,
MISSING_DATA,
INVALID_DATA,
PARSE_FATAL_ERROR,
} parse_result;
typedef enum {
PART_CHOOSER,
PART_SINGLE_SIZED,
PART_COUNT,
PART_INLINE,
PART_SIZE,
PART_PYSTRING... |
Fix up the appinfo test | #include <stdlib.h>
#include <gio/gio.h>
int
main (int argc, char *argv[])
{
const gchar *envvar;
gint pid_from_env;
envvar = g_getenv ("GIO_LAUNCHED_DESKTOP_FILE_PID");
g_assert (envvar != NULL);
pid_from_env = atoi (envvar);
g_assert_cmpint (pid_from_env, ==, getpid ());
envvar = g_getenv ("GIO_LAUNC... | #include <stdlib.h>
#include <gio/gio.h>
int
main (int argc, char *argv[])
{
const gchar *envvar;
g_test_init (&argc, &argv, NULL);
envvar = g_getenv ("GIO_LAUNCHED_DESKTOP_FILE");
if (envvar != NULL)
{
gchar *expected;
gint pid_from_env;
expected = g_test_build_filename (G_TEST_DIST, ... |
Make the network mock play nice with stubCall (…) | //
// MCKNetworkMock.h
// mocka
//
// Created by Markus Gasser on 26.10.2013.
// Copyright (c) 2013 konoma GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>
@class MCKNetworkMock;
@class MCKNetworkRequestMatcher;
@class MCKMockingContext;
typedef MCKNetworkRequestMatcher*(^MCKNetworkActivity)(id u... | //
// MCKNetworkMock.h
// mocka
//
// Created by Markus Gasser on 26.10.2013.
// Copyright (c) 2013 konoma GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>
@class MCKNetworkMock;
@class MCKNetworkRequestMatcher;
@class MCKMockingContext;
typedef MCKNetworkRequestMatcher*(^MCKNetworkActivity)(id u... |
Add quiet fixture for commandline tests | /*
* Copyright (c) 2015 Samsung Electronics Co., Ltd 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
... | |
Use unsigned long long for uint64_t. Fixes part of the windows buildbot. | // RUN: %clang_cc1 -emit-llvm -o - %s
// PR1386
typedef unsigned long uint64_t;
struct X {
unsigned char pad : 4;
uint64_t a : 64;
} __attribute__((packed)) x;
uint64_t f(void)
{
return x.a;
}
| // RUN: %clang_cc1 -emit-llvm -o - %s
// PR1386
typedef unsigned long long uint64_t;
struct X {
unsigned char pad : 4;
uint64_t a : 64;
} __attribute__((packed)) x;
uint64_t f(void)
{
return x.a;
}
|
Make sure the colorizer is reset | #ifndef BANDIT_COLORED_REPORTER_H
#define BANDIT_COLORED_REPORTER_H
#include <ostream>
#include <bandit/reporters/colorizer.h>
#include <bandit/reporters/progress_reporter.h>
namespace bandit { namespace detail {
struct colored_reporter : public progress_reporter
{
colored_reporter(std::ostream& stm,
... | #ifndef BANDIT_COLORED_REPORTER_H
#define BANDIT_COLORED_REPORTER_H
#include <ostream>
#include <bandit/reporters/colorizer.h>
#include <bandit/reporters/progress_reporter.h>
namespace bandit { namespace detail {
struct colored_reporter : public progress_reporter
{
colored_reporter(std::ostream& stm,
... |
Address -Wsign-conversion in emscripten build | #include "os_common.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
FILE *os_fopen(const char *path, const char *mode)
{
FILE *f = NULL;
if (path[0] == '/' && strncmp(path, "/dev", 4)) {
// absolute path, needs to be construed relative to mountpoint
size_t need = 1 + snprintf(NU... | #include "os_common.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
FILE *os_fopen(const char *path, const char *mode)
{
FILE *f = NULL;
if (path[0] == '/' && strncmp(path, "/dev", 4)) {
// absolute path, needs to be construed relative to mountpoint
int need = 1 + snprintf(NULL,... |
Change SET_ERRNO to be inline function | /**
* @file
* @brief
*
* @author Anton Kozlov
* @date 25.06.2012
*/
#ifndef COMPAT_POSIX_POSIX_ERRNO_H_
#define COMPAT_POSIX_POSIX_ERRNO_H_
#include <kernel/task/resource/errno.h>
#define errno (*task_self_resource_errno())
#define SET_ERRNO(e) \
({ errno = e; -1; /* to let 'return SET_ERRNO(...)' */ })
... | /**
* @file
* @brief
*
* @author Anton Kozlov
* @date 25.06.2012
*/
#ifndef COMPAT_POSIX_POSIX_ERRNO_H_
#define COMPAT_POSIX_POSIX_ERRNO_H_
#include <kernel/task/resource/errno.h>
#include <compiler.h>
#define errno (*task_self_resource_errno())
static inline int SET_ERRNO(int err) {
errno = err;
return... |
Correct status printout for FI | #define _POSIX_C_SOURCE 1
#include <unistd.h>
#include <inttypes.h>
#include <stdio.h>
#define STATUS_FORMAT "\r\033[2K\t[%" PRId64 "%%] Packets(finished/total): %" PRId64 "/%" PRId64
#define STATUS_FORMAT_FI "\r\033[2K\t[%" PRId64 "%%] Rays(finished/total): %" PRId64 "/%" PRId64
static inline void
print_progress (c... | #define _POSIX_C_SOURCE 1
#include <unistd.h>
#include <inttypes.h>
#include <stdio.h>
#define STATUS_FORMAT "\r\033[2K\t[%" PRId64 "%%] Packets(finished/total): %" PRId64 "/%" PRId64
#define STATUS_FORMAT_FI "\r\033[2K\t[%" PRId64 "%%] Bins(finished/total): %" PRId64 "/%" PRId64
static inline void
print_progress (c... |
Revert "PTA: use bitvector-based points-to set representation" | #ifndef DG_POINTS_TO_SET_H_
#define DG_POINTS_TO_SET_H_
#include "dg/PointerAnalysis/PointsToSets/OffsetsSetPointsToSet.h"
#include "dg/PointerAnalysis/PointsToSets/SimplePointsToSet.h"
#include "dg/PointerAnalysis/PointsToSets/SeparateOffsetsPointsToSet.h"
#include "dg/PointerAnalysis/PointsToSets/PointerIdPointsToSe... | #ifndef DG_POINTS_TO_SET_H_
#define DG_POINTS_TO_SET_H_
#include "dg/PointerAnalysis/PointsToSets/OffsetsSetPointsToSet.h"
#include "dg/PointerAnalysis/PointsToSets/SimplePointsToSet.h"
#include "dg/PointerAnalysis/PointsToSets/SeparateOffsetsPointsToSet.h"
#include "dg/PointerAnalysis/PointsToSets/PointerIdPointsToSe... |
Fix compilation on non-windows, had not tested this before and was missinga platform include. |
/* Copyright 2013 Jonne Nauha / jonne@adminotech.com
*
* 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 applica... |
/* Copyright 2013 Jonne Nauha / jonne@adminotech.com
*
* 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 applica... |
Solve undefined symbol issue spelling the right class name in the linkdef. | /*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing... | /*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing... |
Fix the sep and esep attributes to allow additive margins in addition to scaled margins. | /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (... | /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (... |
Add missing new line character | #include <stdio.h>
int main(void)
{
printf("Hello world!");
return 0;
} | #include <stdio.h>
int main(void)
{
printf("Hello world!\n");
return 0;
} |
Swap two overloads to make g++ happy. | #ifndef PL_ZERO_UTIL_H
#define PL_ZERO_UTIL_H
#include <sstream>
namespace pl0 {
#if defined(_MSC_VER) || defined(__GNUC__)
namespace polyfill {
template <typename T, typename... Args>
void fold_write_stream(std::ostringstream &oss, T value, Args... args) {
oss << value;
fold_write_stream(oss, args...);
}
... | #ifndef PL_ZERO_UTIL_H
#define PL_ZERO_UTIL_H
#include <sstream>
namespace pl0 {
#if defined(_MSC_VER) || defined(__GNUC__)
namespace polyfill {
template <typename T>
void fold_write_stream(std::ostringstream &oss, T value) {
oss << value;
}
template <typename T, typename... Args>
void fold_write_stream(std::o... |
Add stub for LLA coordinates. | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2021 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundati... | |
Correct after list API changes. | #include "std/list.h"
#include "std/memory.h"
#include "std/stack.h"
struct Stack {
NodeT *list;
AtomPoolT *pool;
};
StackT *NewStack(AtomPoolT *pool) {
StackT *stack = NEW_S(StackT);
stack->list = NewList();
stack->pool = pool;
StackPushNew(stack);
return stack;
}
void DeleteStack(StackT *stack) {
... | #include "std/list.h"
#include "std/memory.h"
#include "std/stack.h"
struct Stack {
ListT *list;
AtomPoolT *pool;
};
StackT *NewStack(AtomPoolT *pool) {
StackT *stack = NEW_S(StackT);
stack->list = NewList();
stack->pool = pool;
StackPushNew(stack);
return stack;
}
void DeleteStack(StackT *stack) {
... |
Fix a type of return value | #pragma once
// #define private public // for tests
#include "common.h"
// associations of units
#define IVCO VCO
#define IVCF VCF
#define IVCA VCA
#define IEG EG
#define ILFO LFO
#define ISlewRateLimiter SlewRateLimiter
#define IVoice Voice
#de... | #pragma once
// #define private public // for tests
#include "common.h"
// associations of units
#define IVCO VCO
#define IVCF VCF
#define IVCA VCA
#define IEG EG
#define ILFO LFO
#define ISlewRateLimiter SlewRateLimiter
#define IVoice Voice
#de... |
Change votes to use double. | #ifndef PROPOSER_H
#define PROPOSER_H
#include <boost/shared_ptr.hpp>
#include <vector>
#include <map>
#include "proctor/detector.h"
#include "proctor/database_entry.h"
namespace pcl
{
namespace proctor
{
struct Candidate {
std::string id;
float votes;
};
class Proposer {
public:
... | #ifndef PROPOSER_H
#define PROPOSER_H
#include <boost/shared_ptr.hpp>
#include <vector>
#include <map>
#include "proctor/detector.h"
#include "proctor/database_entry.h"
namespace pcl
{
namespace proctor
{
struct Candidate {
std::string id;
double votes;
};
class Proposer {
public:... |
Mark ObjC magic as "internal use only" | #import <Foundation/Foundation.h>
void memorySafeExecuteSelector(Class klass, SEL selector);
| #import <Foundation/Foundation.h>
/**
Internal Fleet use only
*/
void memorySafeExecuteSelector(Class klass, SEL selector);
|
Fix nvic vectors number to 16 + 91 | /* mbed Microcontroller Library - cmsis_nvic
* Copyright (c) 2009-2011 ARM Limited. All rights reserved.
*
* CMSIS-style functionality to support dynamic vectors
*/
#ifndef MBED_CMSIS_NVIC_H
#define MBED_CMSIS_NVIC_H
#include <stdint.h>
#define NVIC_NUM_VECTORS (16 + 81) // CORE + MCU Peripherals
#define ... | /* mbed Microcontroller Library - cmsis_nvic
* Copyright (c) 2009-2011 ARM Limited. All rights reserved.
*
* CMSIS-style functionality to support dynamic vectors
*/
#ifndef MBED_CMSIS_NVIC_H
#define MBED_CMSIS_NVIC_H
#include <stdint.h>
#define NVIC_NUM_VECTORS (16 + 91) // CORE + MCU Peripherals
#define ... |
Add new optionnal constructor parameter to set Sample::primitiveId at construction time | #ifndef TYPES_H
#define TYPES_H
#include "primitive.h"
#include <vector>
#include "eigen3/Eigen/StdVector"
namespace InputGen{
namespace Application{
typedef double Scalar;
typedef typename InputGen::LinearPrimitive<InputGen::Application::Scalar> Primitive;
//! \brief sample storing a position and its assignment
s... | #ifndef TYPES_H
#define TYPES_H
#include "primitive.h"
#include <vector>
#include "eigen3/Eigen/StdVector"
namespace InputGen{
namespace Application{
typedef double Scalar;
typedef typename InputGen::LinearPrimitive<InputGen::Application::Scalar> Primitive;
//! \brief sample storing a position and its assignment
s... |
Update reference to IOperation to include Internal namespace | #pragma once
#ifndef YOU_DATASTORE_DATASTORE_H_
#define YOU_DATASTORE_DATASTORE_H_
#include <deque>
#include <functional>
#include "boost/variant.hpp"
#include "task_typedefs.h"
#include "internal/operation.h"
namespace You {
namespace DataStore {
namespace UnitTests {}
class Transaction;
class DataStore {
friend cl... | #pragma once
#ifndef YOU_DATASTORE_DATASTORE_H_
#define YOU_DATASTORE_DATASTORE_H_
#include <deque>
#include <functional>
#include "boost/variant.hpp"
#include "task_typedefs.h"
#include "internal/operation.h"
namespace You {
namespace DataStore {
namespace UnitTests {}
class Transaction;
class DataStore {
friend cl... |
Add 'explicit' keyword to single argument ctor | #ifndef PRIMARY_VIRTUALSECONDARY_H_
#define PRIMARY_VIRTUALSECONDARY_H_
#include <string>
#include "libaktualizr/types.h"
#include "managedsecondary.h"
namespace Primary {
class VirtualSecondaryConfig : public ManagedSecondaryConfig {
public:
VirtualSecondaryConfig() : ManagedSecondaryConfig(Type) {}
VirtualSe... | #ifndef PRIMARY_VIRTUALSECONDARY_H_
#define PRIMARY_VIRTUALSECONDARY_H_
#include <string>
#include "libaktualizr/types.h"
#include "managedsecondary.h"
namespace Primary {
class VirtualSecondaryConfig : public ManagedSecondaryConfig {
public:
VirtualSecondaryConfig() : ManagedSecondaryConfig(Type) {}
explicit ... |
Enable this test only for Darwin. | // RUN: %llvmgcc %s -S -O0 -o - | FileCheck %s
// REQUIRES: disabled
// Radar 9156771
typedef struct RGBColor {
unsigned short red;
unsigned short green;
unsigned short blue;
} RGBColor;
RGBColor func();
RGBColor X;
void foo() {
//CHECK: store i48
X = func();
}
| // RUN: %llvmgcc %s -S -O0 -o - | FileCheck %s
// XTARGET: x86_64-apple-darwin
// Radar 9156771
typedef struct RGBColor {
unsigned short red;
unsigned short green;
unsigned short blue;
} RGBColor;
RGBColor func();
RGBColor X;
void foo() {
//CHECK: store i48
X = func();
}
|
Test where the variables are stored in memory | /**
* How to run
* $ gcc -o show_stored_address show_stored_address.c
* $ ./show_stored_address
*/
#include <stdio.h>
#include <stdlib.h>
char global_str[] = "global string";
static char static_global_str[] = "static global string";
void show_stored_address()
{
char local_str[] = "local string";
static cha... | |
Fix grammar bug in example | /*
* Copyright 2011-2013 Gregory Banks
*
* 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 2011-2013 Gregory Banks
*
* 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... |
Add relational traces cluster-based example | // SKIP PARAM: --sets ana.activated[+] octApron --sets exp.solver.td3.side_widen cycle_self
// requires cycle_self to pass
#include <pthread.h>
#include <assert.h>
int g = 42;
int h = 42;
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
int x; //... | |
Correct case of include file to build on Linux. | #include "FreeRTOS.h"
#include "Semphr.h"
#include "task.h"
/* The interrupt entry point. */
void vEMAC_ISR_Wrapper( void ) __attribute__((naked));
/* The handler that does the actual work. */
void vEMAC_ISR_Handler( void );
extern xSemaphoreHandle xEMACSemaphore;
void vEMAC_ISR_Handler( void )
{
po... | #include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"
/* The interrupt entry point. */
void vEMAC_ISR_Wrapper( void ) __attribute__((naked));
/* The handler that does the actual work. */
void vEMAC_ISR_Handler( void );
extern xSemaphoreHandle xEMACSemaphore;
void vEMAC_ISR_Handler( void )
{
po... |
Increase max heap size to 15,000 ConsCells. | #ifndef MCLISP_ALLOC_H_
#define MCLISP_ALLOC_H_
#include <array>
#include <cstddef>
#include <list>
#include "cons.h"
namespace mclisp
{
class ConsAllocator
{
public:
typedef std::size_t size_type;
ConsAllocator();
ConsCell* Allocate();
std::list<ConsCell*> Allocate(size_type n);
void Deallocate(ConsCell... | #ifndef MCLISP_ALLOC_H_
#define MCLISP_ALLOC_H_
#include <array>
#include <cstddef>
#include <list>
#include "cons.h"
namespace mclisp
{
class ConsAllocator
{
public:
typedef std::size_t size_type;
ConsAllocator();
ConsCell* Allocate();
std::list<ConsCell*> Allocate(size_type n);
void Deallocate(ConsCell... |
Check it out with two items! | #include <stdio.h>
#include <stdlib.h>
#include "list.h"
typedef struct _hash_t {
int sum;
int len;
} hash_t;
hash_t hash(char word[]) {
hash_t ret = {0,0};
int i;
for (i = 0; word[i] != '\0'; i++) {
ret.sum += word[i];
}
ret.len = i;
return ret;
}
int eq(hash_t h1, hash_t h2) {
return (h1.s... | #include <stdio.h>
#include <stdlib.h>
#include "list.h"
typedef struct _hash_t {
int sum;
int len;
} hash_t;
hash_t hash(char word[]) {
hash_t ret = {0,0};
int i;
for (i = 0; word[i] != '\0'; i++) {
ret.sum += word[i];
}
ret.len = i;
return ret;
}
int eq(hash_t h1, hash_t h2) {
return (h1.s... |
Add insert node at nth position | /*
Input Format
You have to complete the Node* Insert(Node* head, int data, int position) method which takes three arguments - the head of the linked list, the integer to insert and the position at which the integer must be inserted. You should NOT read any input from stdin/console. position will always be between 0 a... | |
Return cdr for mark continuation. | /*
SMAL
Copyright (c) 2011 Kurt A. Stephens
*/
#include "smal/smal.h"
#include "smal/thread.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h> /* memset() */
#include <unistd.h> /* getpid() */
#include <assert.h>
typedef void *my_oop;
typedef struct my_cons {
my_oop car, cdr;
} my_cons;
static smal... | /*
SMAL
Copyright (c) 2011 Kurt A. Stephens
*/
#include "smal/smal.h"
#include "smal/thread.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h> /* memset() */
#include <unistd.h> /* getpid() */
#include <assert.h>
typedef void *my_oop;
typedef struct my_cons {
my_oop car, cdr;
} my_cons;
static smal... |
Update the versioning for macOS Big Sur | #include <sys/utsname.h>
#include <wchar.h>
#include <stdlib.h>
#define OS_VERSION_MAX_SIZE 128
wchar_t* getOS() {
struct utsname system_info;
if (uname(&system_info) != 0) return NULL;
wchar_t* os = malloc(sizeof(os) * OS_VERSION_MAX_SIZE);
#ifdef __APPLE__
int version = atoi(system_info.release);
// Si... | #include <sys/utsname.h>
#include <wchar.h>
#include <stdlib.h>
#define OS_VERSION_MAX_SIZE 128
wchar_t* getOS() {
struct utsname system_info;
if (uname(&system_info) != 0) return NULL;
wchar_t* os = malloc(sizeof(os) * OS_VERSION_MAX_SIZE);
#ifdef __APPLE__
int major_version = atoi(system_info.release);
... |
Convert to 'using' syntax for type aliases | #ifndef EMULATOR_REGISTER_H
#define EMULATOR_REGISTER_H
#include <cstdint>
template <typename T>
class Register {
public:
Register() {};
void set(const T new_value) { val = new_value; };
T value() const { return val; };
void increment() { val += 1; };
void decrement() { val -= 1; };
private:
... | #ifndef EMULATOR_REGISTER_H
#define EMULATOR_REGISTER_H
#include <cstdint>
template <typename T>
class Register {
public:
Register() {};
void set(const T new_value) { val = new_value; };
T value() const { return val; };
void increment() { val += 1; };
void decrement() { val -= 1; };
private:
... |
Add a small hack to satisfy build with gcc on smartos64 | /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#include "config.h"
#if !defined(HAVE_HTONLL) && !defined(WORDS_BIGENDIAN)
uint64_t couchstore_byteswap64(uint64_t val)
{
size_t ii;
uint64_t ret = 0;
for (ii = 0; ii < sizeof(uint64_t); ii++) {
ret <<= 8;
ret |= ... | /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#include "config.h"
#if !defined(HAVE_HTONLL) && !defined(WORDS_BIGENDIAN)
uint64_t couchstore_byteswap64(uint64_t val)
{
size_t ii;
uint64_t ret = 0;
for (ii = 0; ii < sizeof(uint64_t); ii++) {
ret <<= 8;
ret |= ... |
Make sure the rtcp BYE gets sent | /* *
* This file is part of Feng
*
* Copyright (C) 2007 by LScube team <team@streaming.polito.it>
* See AUTHORS for more details
*
* Feng 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 ... | /* *
* This file is part of Feng
*
* Copyright (C) 2007 by LScube team <team@streaming.polito.it>
* See AUTHORS for more details
*
* Feng 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 ... |
Add tests for enabling / disabling shouldRasterize | /* Copyright (c) 2014-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.
*/
#import <FBSna... | /* Copyright (c) 2014-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.
*/
#import <FBSna... |
Add missing include for the AT45DB flash driver | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | |
Redefine error codes as consts | // Copyright (c) 2015, Matthew Malensek.
// Distributed under the BSD 2-Clause License (see LICENSE.txt for details)
#pragma once
#include <string>
#include <unordered_map>
#define GENERR 0x100
#define SKINERR 0x200
#define SYSERR 0x400
#define GENERR_NOTFOUND GENERR + 1
#define GENERR_SETTINGSFILE ... | // Copyright (c) 2015, Matthew Malensek.
// Distributed under the BSD 2-Clause License (see LICENSE.txt for details)
#pragma once
#include <string>
#include <unordered_map>
class Error {
public:
static void ErrorMessage(unsigned int error, std::wstring detail = L"");
static void ErrorMessageDie(unsigned int ... |
Define PACK macro for structs and etc | #pragma once
#ifdef _MSC_VER
#define PACK(DECL) __pragma(pack(push, 1)) DECL __pragma(pack(pop))
#else
#define PACK(DECL) DECL __attribute__((__packed__))
#endif
| |
Add implementation of atomic ops with libatomic instead of gcc builtins | #ifndef ATOMIC_GCC_BUILTINS_INCLUDED
#define ATOMIC_GCC_BUILTINS_INCLUDED
/*Modified by David Lowes 2015 - Zend Technologies LTD. LICENSE??*/
#define make_atomic_add_body(S) \
v= __atomic_fetch_add(a, v, __ATOMIC_RELAXED);
#define make_atomic_fas_body(S) \
v= __sync_lock_tes... | |
Revert r352732: [libFuzzer] replace slow std::mt19937 with a much faster std::minstd_rand | //===- FuzzerRandom.h - Internal header for the Fuzzer ----------*- C++ -* ===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | //===- FuzzerRandom.h - Internal header for the Fuzzer ----------*- C++ -* ===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
Update vtable offsets for 2014-06-11 TF2 update. | /*
* hooks.h
* StatusSpec project
*
* Copyright (c) 2014 thesupremecommander
* BSD 2-Clause License
* http://opensource.org/licenses/BSD-2-Clause
*
*/
#pragma once
#include "stdafx.h"
#include <map>
#define CLIENT_DLL
#define GLOWS_ENABLE
#include "cdll_int.h"
#include "KeyValues.h"
#include "igamer... | /*
* hooks.h
* StatusSpec project
*
* Copyright (c) 2014 thesupremecommander
* BSD 2-Clause License
* http://opensource.org/licenses/BSD-2-Clause
*
*/
#pragma once
#include "stdafx.h"
#include <map>
#define CLIENT_DLL
#define GLOWS_ENABLE
#include "cdll_int.h"
#include "KeyValues.h"
#include "igamer... |
Patch from Bernardo Innocenti: Remove use of cast-as-l-value extension, removed in GCC 3.5. |
#include <errno.h>
#include <asm/ptrace.h>
#include <sys/syscall.h>
int
ptrace(int request, int pid, int addr, int data)
{
long ret;
long res;
if (request > 0 && request < 4) (long *)data = &ret;
__asm__ volatile ("movel %1,%/d0\n\t"
"movel %2,%/d1\n\t"
"movel %3,%/d2\n\t"
"movel %4,%/d3\n\t"
... |
#include <errno.h>
#include <asm/ptrace.h>
#include <sys/syscall.h>
int
ptrace(int request, int pid, int addr, int data)
{
long ret;
long res;
if (request > 0 && request < 4) data = (int)&ret;
__asm__ volatile ("movel %1,%/d0\n\t"
"movel %2,%/d1\n\t"
"movel %3,%/d2\n\t"
"movel %4,%/d3\n\t"
"... |
Add utility to check whether a point is inside a rect | /*
* rect_utils.h
*
* Author: Ming Tsang
* Copyright (c) 2014 Ming Tsang
* Refer to LICENSE for details
*/
#pragma once
#include <cstdint>
#include "libutils/type/coord.h"
#include "libutils/type/rect.h"
namespace utils
{
namespace type
{
class RectUtils
{
public:
/**
* Return whether @a point is rested i... | |
Fix formatting to match libdispatch coding style. | /*
* Copyright (c) 2013-2016 Apple Inc. All rights reserved.
*
* @APPLE_APACHE_LICENSE_HEADER_START@
*
* 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/lic... | /*
* Copyright (c) 2013-2016 Apple Inc. All rights reserved.
*
* @APPLE_APACHE_LICENSE_HEADER_START@
*
* 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/lic... |
Use '__x86_64__' instead of '__X86_64__' | #ifndef PSTOREJNI_H
#define PSTOREJNI_H
#include <inttypes.h>
#ifdef __i386__
#define LONG_TO_PTR(ptr) (void *) (uint32_t) ptr
#elif __X86_64__
#define LONG_TO_PTR(ptr) (void *) ptr
#endif
#define PTR_TO_LONG(ptr) (long) ptr
#endif
| #ifndef PSTOREJNI_H
#define PSTOREJNI_H
#include <inttypes.h>
#ifdef __i386__
#define LONG_TO_PTR(ptr) (void *) (uint32_t) ptr
#elif __x86_64__
#define LONG_TO_PTR(ptr) (void *) ptr
#endif
#define PTR_TO_LONG(ptr) (long) ptr
#endif
|
Revert "use old import syntax for HockeySDK" | #import <HockeySDK/HockeySDK.h>
@interface BITHockeyManager (WMFExtensions) <BITHockeyManagerDelegate>
/**
* Configure and startup in one line.
* This will call the methods below as part of the configuration process.
* This method will use the current bundle id of the app
*/
- (void)wmf_setupAndStart;
/**
* ... | @import HockeySDK;
@interface BITHockeyManager (WMFExtensions) <BITHockeyManagerDelegate>
/**
* Configure and startup in one line.
* This will call the methods below as part of the configuration process.
* This method will use the current bundle id of the app
*/
- (void)wmf_setupAndStart;
/**
* Configure th... |
Fix IPC BAR scom address | // IBM_PROLOG_BEGIN_TAG
// This is an automatically generated prolog.
//
// $Source: src/include/sys/interrupt.h $
//
// IBM CONFIDENTIAL
//
// COPYRIGHT International Business Machines Corp. 2011
//
// p1
//
// Object Code Only (OCO) source materials
// Licensed Internal Code Source Materials
// IBM HostBoot ... | // IBM_PROLOG_BEGIN_TAG
// This is an automatically generated prolog.
//
// $Source: src/include/sys/interrupt.h $
//
// IBM CONFIDENTIAL
//
// COPYRIGHT International Business Machines Corp. 2011
//
// p1
//
// Object Code Only (OCO) source materials
// Licensed Internal Code Source Materials
// IBM HostBoot ... |
Add regression test for exp.precious_globs | // PARAM: --set exp.earlyglobs true --set exp.precious_globs[+] "'g'"
int g = 10;
int main(void){
g = 100;
assert(g==100);
return 0;
} | |
Add constant test for congruence domain | // PARAM: --enable ana.int.congruence --disable ana.int.def_exc
// This test ensures that operations on constant congr. classes (i.e. classes of the form {k} : arbitrary integer k) yield concrete vals
int main() {
// basic arithmetic operators
int a = 1;
int b = 2;
int c = -1;
int d = -2;
asse... | |
Change the default VKVoteStatus value to VKVoteStatusNone This is necessary because unvoted items don't send a "voteValue" field so the voteStatusJSONTransformer is never called | //
// VKVotable.h
// VoatKit
//
// Created by Amar Ramachandran on 6/26/15.
// Copyright © 2015 AmarJayR. All rights reserved.
//
#import "VKCreated.h"
typedef NS_ENUM(NSUInteger, VKVoteStatus) {
VKVoteStatusUpvoted,
VKVoteStatusDownvoted,
VKVoteStatusNone
};
@interface VKVotable : VKCreated
/**
Th... | //
// VKVotable.h
// VoatKit
//
// Created by Amar Ramachandran on 6/26/15.
// Copyright © 2015 AmarJayR. All rights reserved.
//
#import "VKCreated.h"
typedef NS_ENUM(NSUInteger, VKVoteStatus) {
VKVoteStatusNone,
VKVoteStatusUpvoted,
VKVoteStatusDownvoted
};
@interface VKVotable : VKCreated
/**
Th... |
Fix comparison between properties (compare the ID) | /***************************************************************************
* Copyright (C) 2003 by Unai Garro *
* ugarro@users.sourceforge.net *
* *... | /***************************************************************************
* Copyright (C) 2003 by Unai Garro *
* ugarro@users.sourceforge.net *
* *... |
Split transform methods into to/from | #pragma once
class VolumeTransformation {
public:
virtual float Transform(float vol) = 0;
}; | #pragma once
class VolumeTransformation {
public:
/// <summary>
/// Transforms a given volume level to a new ("virtual") level based on a
/// formula or set of rules (e.g., a volume curve transformation).
/// </summary>
virtual float ToVirtual(float vol) = 0;
/// <summary>
/// Given a tran... |
Update for Arduino Due and refresh of files to make sure they are the latest |
/**
* FreeIMU calibration header. Automatically generated by octave AccMagnCalib.m.
* Do not edit manually unless you know what you are doing.
*/
/* // following example of calibration.h
#define CALIBRATION_H
const int acc_off_x = 205;
const int acc_off_y = -39;
const int acc_off_z = 1063;
const float acc_scale_x... |
/**
* FreeIMU calibration header. Automatically generated by FreeIMU_GUI.
* Do not edit manually unless you know what you are doing.
*/
#define CALIBRATION_H
const int acc_off_x = 163;
const int acc_off_y = 119;
const int acc_off_z = -622;
const float acc_scale_x = 16387.035965;
const float acc_scale_y = 16493.17... |
CREATE mailbox<hierarchy separator> failed always. | /* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "commands.h"
int cmd_create(Client *client)
{
const char *mailbox;
/* <mailbox> */
if (!client_read_string_args(client, 1, &mailbox))
return FALSE;
if (!client_verify_mailbox_name(client, mailbox, FALSE, TRUE))
return TRUE;
if (mailbox[st... | /* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "commands.h"
int cmd_create(Client *client)
{
const char *mailbox;
int ignore;
/* <mailbox> */
if (!client_read_string_args(client, 1, &mailbox))
return FALSE;
ignore = mailbox[strlen(mailbox)-1] == client->storage->hierarchy_sep;
if (ignor... |
Add a codec for Tile struct | #pragma once
#include <spotify/json.hpp>
#include "Tile.h"
using namespace spotify::json::codec;
namespace spotify
{
namespace json
{
template<>
struct default_codec_t<Tile>
{
static object_t<Tile> codec()
{
auto codec = object<Tile>();
codec.required("corners", &Tile::corners);
cod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.