Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Fix memory error due to missing return statement in speech trimmer constructor. | #include "noyes.h"
#undef TRUE
#define TRUE 1
#undef FALSE
#define FALSE 0
SpeechTrimmer * new_speech_trimmer() {
SpeechTrimmer *self = malloc(sizeof(SpeechTrimmer));
self->leader = 5;
self->trailer = 5;
self->speech_started = FALSE;
self->bcm = new_bent_cent_marker();
self->false_count = 0;
self->true_c... | #include "noyes.h"
#undef TRUE
#define TRUE 1
#undef FALSE
#define FALSE 0
SpeechTrimmer * new_speech_trimmer() {
SpeechTrimmer *self = malloc(sizeof(SpeechTrimmer));
self->leader = 5;
self->trailer = 5;
self->speech_started = FALSE;
self->bcm = new_bent_cent_marker();
self->false_count = 0;
self->true_c... |
Revert 262696 "Revert 262685 "Fix a forward declaration of Passw..." | // Copyright 2014 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 COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_BROWSER_SAVE_PASSWORD_PROGRESS_LOGGER_H_
#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_BROWSER_SAVE_PA... | // Copyright 2014 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 COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_BROWSER_SAVE_PASSWORD_PROGRESS_LOGGER_H_
#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_BROWSER_SAVE_PA... |
Revert "Fix typo in the commit a5312c77." | #include <string.h>
#include "ruby.h"
#include "rubyspec.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef HAVE_RB_PROC_NEW
VALUE concat_func(VALUE args) {
int i;
char buffer[500] = {0};
if (TYPE(args) != T_ARRAY) return Qnil;
for(i = 0; i < RARRAY_LEN(args); ++i) {
VALUE v = RARRAY_PTR(args)[i];
strc... | #include <string.h>
#include "ruby.h"
#include "rubyspec.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef HAVE_RB_PROC_NEW
VALUE concat_func(VALUE args) {
int i;
char buffer[500] = {0};
if (TYPE(val) != T_ARRAY) return Qnil;
for(i = 0; i < RARRAY_LEN(args); ++i) {
VALUE v = RARRAY_PTR(args)[i];
strca... |
Revert 155836 - Fix static build. | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_VIEWS_WIDGET_DESKTOP_CAPTURE_CLIENT_H_
#define UI_VIEWS_WIDGET_DESKTOP_CAPTURE_CLIENT_H_
#include "base/basictypes.h"
#include "base/compi... | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_VIEWS_WIDGET_DESKTOP_CAPTURE_CLIENT_H_
#define UI_VIEWS_WIDGET_DESKTOP_CAPTURE_CLIENT_H_
#include "base/basictypes.h"
#include "base/compi... |
Switch header order to ensure local gets used before system one. | /* libtinynotify
* (c) 2011 Michał Górny
* 2-clause BSD-licensed
*/
#include "config.h"
#include "tinynotify-cli.h"
#include "tinynotify.h"
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
Notification notification_new_from_cmdline(int argc, char *argv[]) {
int opterr_backup = opterr;
int arg;
cons... | /* libtinynotify
* (c) 2011 Michał Górny
* 2-clause BSD-licensed
*/
#include "config.h"
#include "tinynotify.h"
#include "tinynotify-cli.h"
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
Notification notification_new_from_cmdline(int argc, char *argv[]) {
int opterr_backup = opterr;
int arg;
cons... |
Move EXPECT_EQ macro magic from quic/platform to quiche/platform. | // Copyright (c) 2017 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 QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_
#define QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_
#include "quic/platform/api/quic_logging.h"
#include "net... | // Copyright (c) 2017 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 QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_
#define QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_
#include "quic/platform/api/quic_logging.h"
#include "net... |
Add a file to the module include. | #include "../main.h"
class ConfigReader;
class ModuleInterface; // forward-declare so it can be used in modules and server
#include "../connection.h" // declare other classes that use it
#include "../modules.h"
#include "../config.cpp"
#include "../modinterface.cpp" | #include "../main.h"
class ConfigReader;
class ModuleInterface; // forward-declare so it can be used in modules and server
#include "../connection.h" // declare other classes that use it
#include "../modules.h"
#include "../config.cpp"
#include "../modules.cpp"
#include "../modinterface.cpp" |
Align format with `hexdump -C` | /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
#include "ua_util.h"
#include <ctype.h>
#include <stdio.h>
void UA_dump_hex_pkg(UA_Byte* buffer, size_t bufferLen) {
printf("--------------- HEX Package... | /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information. */
#include "ua_util.h"
#include <ctype.h>
#include <stdio.h>
void UA_dump_hex_pkg(UA_Byte* buffer, size_t bufferLen) {
printf("--------------- HEX Package... |
Add license to localization header | //
// TWTValidationLocalization.h
// TWTValidation
//
// Created by Prachi Gauriar on 4/3/2014.
// Copyright (c) 2014 Two Toasters, LLC. All rights reserved.
//
#define TWTLocalizedString(key) \
[[NSBundle bundleForClass:[self class]] localizedStringForKey:(key) value:@"" table:@"TWTValidation"]
| //
// TWTValidationLocalization.h
// TWTValidation
//
// Created by Prachi Gauriar on 4/3/2014.
// Copyright (c) 2014 Two Toasters, LLC.
//
// 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 So... |
Add new header file. (or: xcode is stupid) | //
// BDSKSearchGroupViewController.h
// Bibdesk
//
// Created by Christiaan Hofman on 1/2/07.
/*
This software is Copyright (c) 2007
Christiaan Hofman. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
ar... | |
Revert 88154 - Use scoped_ptr for Panel in PanelBrowserWindowGTK. Reason: PanelBrowserWindow dtor is now complex and cannot be inlined. | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_
#define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_
#include "chrome/browser/ui... | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_
#define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_
#include "chrome/browser/ui... |
Add the definition of the default hook function to the FT_DEFINE_HOOK_FUNCTION macro. | /*
** Hook functions for integration with the Floating Temple distributed
** interpreter
*/
#include <stddef.h>
#define floating_temple_c
#define LUA_CORE
#include "lua.h"
#include "floating_temple.h"
#include "lobject.h"
#include "luaconf.h"
static int ft_defaultnewstringhook (lua_State *L, StkId obj, const ch... | /*
** Hook functions for integration with the Floating Temple distributed
** interpreter
*/
#include <stddef.h>
#define floating_temple_c
#define LUA_CORE
#include "lua.h"
#include "floating_temple.h"
#include "lobject.h"
#include "luaconf.h"
#define FT_DEFINE_HOOK_FUNC(install_func, hook_type, hook_var, hook_p... |
Fix clang build that have been broken by 81364. | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_
#define CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_
#include "base/basictyp... | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_
#define CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_
#include "base/basictyp... |
Add some stubs for idec_table | /**
* @file
*
* @brief
*
* @date 09.11.2013
* @author Anton Bondarev
*/
union idesc_table_entry {
unsigned int flags;
struct idesc *idesc;
};
struct idesc_table {
union idesc_table_entry idesc_entry[TASKS_RES_QUANTITY];
struct indexator indexator;
};
int idesc_table_add(struct idesc *idesc, int cloexec) ... | |
Add InstructionVisitor class for visitor pattern | #ifndef INSTRUCTION_VISITOR_H_
#define INSTRUCTION_VISITOR_H_
#include "vm/instruction.h"
#include "vm/instructions.h"
namespace grok {
namespace vm {
class InstructionVisitor {
public:
#define DECLARE_VIRTUAL_METHOD(Instr, Class) \
virtual void Visit(Class##Instruction *instr) = 0;
INSTRUCTION_LIST_FOR_EACH(... | |
Add definition for M_PI_F v3 | #define FLT_DIG 6
#define FLT_MANT_DIG 24
#define FLT_MAX_10_EXP +38
#define FLT_MAX_EXP +128
#define FLT_MIN_10_EXP -37
#define FLT_MIN_EXP -125
#define FLT_RADIX 2
#define FLT_MAX 0x1.fffffep127f
#define FLT_MIN 0x1.0p-126f
#define FLT_EPSILON 0x1.0p-23f
#ifdef cl_khr_fp64
#define DBL_DIG 15
#define DBL_... | #define FLT_DIG 6
#define FLT_MANT_DIG 24
#define FLT_MAX_10_EXP +38
#define FLT_MAX_EXP +128
#define FLT_MIN_10_EXP -37
#define FLT_MIN_EXP -125
#define FLT_RADIX 2
#define FLT_MAX 0x1.fffffep127f
#define FLT_MIN 0x1.0p-126f
#define FLT_EPSILON 0x1.0p-23f
#define M_PI_F 0x1.921fb6p+1
#ifdef cl_khr_fp64
#d... |
Make test not fail on hosts where the default omp library is gomp. | // REQUIRES: clang-driver
// REQUIRES: powerpc-registered-target
// REQUIRES: nvptx-registered-target
//
// Verify that CUDA device commands do not get OpenMP flags.
//
// RUN: %clang -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp %s 2>&1 \
// RUN: | FileCheck %s --check-prefix NO... | // REQUIRES: clang-driver
// REQUIRES: powerpc-registered-target
// REQUIRES: nvptx-registered-target
//
// Verify that CUDA device commands do not get OpenMP flags.
//
// RUN: %clang -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp=libomp %s 2>&1 \
// RUN: | FileCheck %s --check-pr... |
Define convenient FATAL_ERROR() and FATAL_ERROR_IF() macros | /*
* Copyright 2006 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing ... | /*
* Copyright 2006 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing ... |
Switch solver for 13-privatized/17-priv_internal.c to td3 to make test case pass | // PARAM: --set ana.int.interval true --set solver "'new'"
#include<pthread.h>
#include<assert.h>
int glob1 = 5;
pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
int t;
pthread_mutex_lock(&mutex1);
t = glob1;
assert(t == 5);
glo... | // PARAM: --set ana.int.interval true --set solver "'td3'"
#include<pthread.h>
#include<assert.h>
int glob1 = 5;
pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
int t;
pthread_mutex_lock(&mutex1);
t = glob1;
assert(t == 5);
glo... |
Change definition of tensorflow::int64 to std::int64_t. | /* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | /* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
Add a command to check bigstruct owners, used to check for leaks | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012, 2013, 2014 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Softw... | |
Add minimized testcase from both apron branches dead without threadflag | // SKIP PARAM: --set ana.activated[+] apron --set ana.activated[-] threadflag
// Minimized from sv-benchmarks/c/systemc/pipeline.cil-1.c
#include <assert.h>
int main_clk_pos_edge;
int main_in1_req_up;
int main()
{
// main_clk_pos_edge = 2; // TODO: uncomment to unskip apron test
if (main_in1_req_up == 1) // TODO:... | |
Fix import of foundation - no need for uikit | //
// TRVSDictionaryWithCaseInsensitivity.h
// TRVSDictionaryWithCaseInsensitivity
//
// Created by Travis Jeffery on 7/24/14.
// Copyright (c) 2014 Travis Jeffery. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for TRVSDictionaryWithCaseInsensitivity.
FOUNDATION_EXPORT double TRVSDict... | //
// TRVSDictionaryWithCaseInsensitivity.h
// TRVSDictionaryWithCaseInsensitivity
//
// Created by Travis Jeffery on 7/24/14.
// Copyright (c) 2014 Travis Jeffery. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for TRVSDictionaryWithCaseInsensitivity.
FOUNDATION_EXPORT doubl... |
Fix failed import in podspec | //
// SDLImageField+ScreenManagerExtensions.h
// SmartDeviceLink
//
// Created by Joel Fischer on 5/20/20.
// Copyright © 2020 smartdevicelink. All rights reserved.
//
#import <SmartDeviceLink/SmartDeviceLink.h>
NS_ASSUME_NONNULL_BEGIN
@interface SDLImageField (ScreenManagerExtensions)
+ (NSArray<SDLImageField ... | //
// SDLImageField+ScreenManagerExtensions.h
// SmartDeviceLink
//
// Created by Joel Fischer on 5/20/20.
// Copyright © 2020 smartdevicelink. All rights reserved.
//
#import "SDLImageField.h"
NS_ASSUME_NONNULL_BEGIN
@interface SDLImageField (ScreenManagerExtensions)
+ (NSArray<SDLImageField *> *)allImageField... |
Use FIX2INT rather than NUM2INT in Cap2.getpcaps | #include <ruby.h>
#include <errno.h>
#include <sys/capability.h>
static VALUE cap2_getpcaps(VALUE self, VALUE pid) {
cap_t cap_d;
ssize_t length;
char *caps;
VALUE result;
Check_Type(pid, T_FIXNUM);
cap_d = cap_get_pid(NUM2INT(pid));
if (cap_d == NULL) {
rb_raise(
rb_eRuntimeError,
"Fa... | #include <ruby.h>
#include <errno.h>
#include <sys/capability.h>
static VALUE cap2_getpcaps(VALUE self, VALUE pid) {
cap_t cap_d;
ssize_t length;
char *caps;
VALUE result;
Check_Type(pid, T_FIXNUM);
cap_d = cap_get_pid(FIX2INT(pid));
if (cap_d == NULL) {
rb_raise(
rb_eRuntimeError,
"Fa... |
Add a template type alias `scratch::nth_t<I, Ts...>` for the nth element of a pack. | #pragma once
#include <cstddef>
namespace scratch {
template<size_t Index, typename T, typename... Rest> struct nth : nth<Index-1, Rest...> {};
template<typename T, typename... Rest> struct nth<0, T, Rest...> { using type = T; };
template<size_t Index, typename... Ts> using nth_t = typename nth<Index, Ts...>::type;... | |
Use a correct include guard | /*
Copyright (c) 2009 Stephen Kelly <steveire@gmail.com>
*/
#ifndef FILTER_H
#define FILTER_H
#include "variable.h"
#include "grantlee_export.h"
namespace Grantlee
{
class Parser;
}
class Token;
namespace Grantlee
{
class GRANTLEE_EXPORT FilterExpression
{
public:
enum Reversed
{
IsNotReversed,
I... | /*
Copyright (c) 2009 Stephen Kelly <steveire@gmail.com>
*/
#ifndef FILTEREXPRESSION_H
#define FILTEREXPRESSION_H
#include "variable.h"
#include "grantlee_export.h"
namespace Grantlee
{
class Parser;
}
class Token;
namespace Grantlee
{
class GRANTLEE_EXPORT FilterExpression
{
public:
enum Reversed
{
... |
Add one more memory include | /**
\file
Particle property interface
\author Lukas Nellen
\version $Id$
\date 03 Apr 2004
*/
#pragma once
#include <string>
namespace corsika
{
/**
\class VParticleProperties VParticleProperties.h "corsika/VParticleProperties.h"
\brief Internal interface for particle properties. This is... | /**
\file
Particle property interface
\author Lukas Nellen
\version $Id$
\date 03 Apr 2004
*/
#pragma once
#include <string>
#include <memory.h>
namespace corsika
{
/**
\class VParticleProperties VParticleProperties.h "corsika/VParticleProperties.h"
\brief Internal interface for particle... |
Move new method on interface further down to avoid messing with vtable compatibility | #pragma once
#include <memory>
#include <vector>
#include "halley/core/game/main_loop.h"
#ifdef _WIN32
#define HALLEY_STDCALL __stdcall
#else
#define HALLEY_STDCALL
#endif
namespace Halley
{
class Game;
class Core;
class HalleyStatics;
constexpr static uint32_t HALLEY_DLL_API_VERSION = 23;
class IHalleyEntry... | #pragma once
#include <memory>
#include <vector>
#include "halley/core/game/main_loop.h"
#ifdef _WIN32
#define HALLEY_STDCALL __stdcall
#else
#define HALLEY_STDCALL
#endif
namespace Halley
{
class Game;
class Core;
class HalleyStatics;
constexpr static uint32_t HALLEY_DLL_API_VERSION = 24;
class IHalleyEntry... |
Remove unused and not implement ApolloniusLabelsArranger destructor. | #ifndef SRC_PLACEMENT_APOLLONIUS_LABELS_ARRANGER_H_
#define SRC_PLACEMENT_APOLLONIUS_LABELS_ARRANGER_H_
#include <Eigen/Core>
#include <memory>
#include <vector>
#include "./labels_arranger.h"
class CudaArrayProvider;
namespace Placement
{
/**
* \brief Returns the labels in an order defined by the apollonius grap... | #ifndef SRC_PLACEMENT_APOLLONIUS_LABELS_ARRANGER_H_
#define SRC_PLACEMENT_APOLLONIUS_LABELS_ARRANGER_H_
#include <Eigen/Core>
#include <memory>
#include <vector>
#include "./labels_arranger.h"
class CudaArrayProvider;
namespace Placement
{
/**
* \brief Returns the labels in an order defined by the apollonius grap... |
Fix build issue from prev. merge. | // Copyright 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
using namespace CefSharp;
namespace CefSharp
{
namespace Internals
{
public ref class CefRequest... | // Copyright 2010-2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
using namespace CefSharp;
namespace CefSharp
{
namespace Internals
{
public ref class CefRequest... |
Change linssys_sdi consumer to just "sdi" | /*
* factory.c for Linsys SDI consumer
*/
#include <framework/mlt.h>
#include <string.h>
extern mlt_consumer consumer_SDIstream_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
MLT_REPOSITORY
{
MLT_REGISTER( consumer_type, "linsys_sdi", consumer_SDIstream_init );
}
| /*
* factory.c for Linsys SDI consumer
*/
#include <framework/mlt.h>
#include <string.h>
extern mlt_consumer consumer_SDIstream_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
MLT_REPOSITORY
{
MLT_REGISTER( consumer_type, "sdi", consumer_SDIstream_init );
}
|
Fix ARC warning and avoid having to bridge id objects | #import "Expecta.h"
EXPMatcherInterface(beIdenticalTo, (void *expected));
| #import "Expecta.h"
EXPMatcherInterface(_beIdenticalTo, (void *expected));
#if __has_feature(objc_arc)
#define beIdenticalTo(expected) _beIdenticalTo((__bridge void*)expected)
#else
#define beIdenticalTo _beIdenticalTo
#endif
|
Fix copy-and-pasteo a little more completely. | /*-------------------------------------------------------------------------
*
* copydir.h
* Header for src/port/copydir.c compatibility functions.
*
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/st... | /*-------------------------------------------------------------------------
*
* copydir.h
* Copy a directory.
*
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/copydir.h
*
*----------------... |
Add a simple IB test program | #include <stdio.h>
#include <stdlib.h>
#include <vl/ib.h>
int main()
{
vl_node nrows = 30;
vl_node ncols = 3;
vl_prob * Pic = malloc(sizeof(vl_prob)*nrows*ncols);
int r,c;
printf("Pic = [");
for(r=0; r<nrows; r++)
{
for(c=0; c<ncols; c++)
{
Pic[r*ncols+c] = rand(... | |
Add a test for the llvm-gcc commit in r90200. | // RUN: not %llvmgcc -mssse3 -S -o /dev/null %s |& grep "error: mask must be an immediate"
// XFAIL: *
// XTARGET: x86,i386,i686
#include <tmmintrin.h>
extern int i;
int main ()
{
#if defined( __SSSE3__ )
typedef int16_t vSInt16 __attribute__ ((__vector_size__ (16)));
short dtbl[] = {1,2,3,4,5,6,... | |
Add solution for problem 2 | /* Each new term in the Fibonacci sequence is generated by adding the previous
* two terms. By starting with 1 and 2, the first 10 terms will be:
*
* 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
*
* By considering the terms in the Fibonacci sequence whose values do not
* exceed four million, find the sum of the even-va... | |
Mark remaining APIs unsafe in extensions | /*
* 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.
*
*/
#im... | /*
* 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.
*
*/
#im... |
Add pretty (color) printing macros. Unused currently. | #define KNRM "\x1B[0m"
#define KRED "\x1B[31m"
#define KGRN "\x1B[32m"
#define KYEL "\x1B[33m"
#define KBLU "\x1B[34m"
#define KMAG "\x1B[35m"
#define KCYN "\x1B[36m"
#define KWHT "\x1B[37m"
#define PRINT_RED(...) \
printf("%s", KRED); \
printf(__VA_ARGS__); \
printf("%s", KNRM); \
#define PRINT_GREEN(.... | |
Remove needless comma after last enumeration value | /*
* Medical Image Registration ToolKit (MIRTK)
*
* Copyright 2013-2015 Imperial College London
* Copyright 2013-2015 Andreas Schuh
*
* 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
*
... | /*
* Medical Image Registration ToolKit (MIRTK)
*
* Copyright 2013-2015 Imperial College London
* Copyright 2013-2015 Andreas Schuh
*
* 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
*
... |
Add missing file from previous commit. | /*
* libopensync - A synchronization framework
* Copyright (C) 2008 Daniel Gollub <dgollub@suse.de>
*
* 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 ... | |
Adjust entity class to naming conventions | #ifndef __ENTITY_H__
#define __ENTITY_H__
#include "ModuleCollision.h"
class Entity
{
public:
Entity() : parent(nullptr) {}
Entity(Entity* parent) : parent(parent) {}
virtual ~Entity() {}
// Entity lifecycle methods
virtual bool Start()
{
return true;
}
virtual bool Start(bool active)
{
this->activ... | #ifndef __ENTITY_H__
#define __ENTITY_H__
#include "ModuleCollision.h"
class Entity
{
public:
Entity() : Parent(nullptr) {}
Entity(Entity* parent) : Parent(parent) {}
virtual ~Entity() {}
// Entity lifecycle methods
virtual bool Start()
{
return true;
}
virtual bool Start(bool active)
{
this->_acti... |
Print out the size of time_t and tm.tm_year for debugging porpuses. | #include <stdio.h>
#include <time.h>
#include <stdlib.h>
int check_date(struct tm *date, time_t time, char *name) {
if( date == NULL ) {
printf("%s(%lld) returned null\n", name, (long long)time);
return 1;
}
else {
printf("%s(%lld): %s\n", name, (long long)time, asctime(date));
... | #include <stdio.h>
#include <time.h>
#include <stdlib.h>
int check_date(struct tm *date, time_t time, char *name) {
if( date == NULL ) {
printf("%s(%lld) returned null\n", name, (long long)time);
return 1;
}
else {
printf("%s(%lld): %s\n", name, (long long)time, asctime(date));
... |
Add additional protocols for tracking context, content type, and analytics name | #import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@protocol WMFAnalyticsLogging <NSObject>
- (NSString*)analyticsName;
@end
NS_ASSUME_NONNULL_END | #import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@protocol WMFAnalyticsContextProviding <NSObject>
- (NSString*)analyticsContext;
@end
@protocol WMFAnalyticsContentTypeProviding <NSObject>
- (NSString*)analyticsContentType;
@end
@protocol WMFAnalyticsViewNameProviding <NSObject>
- (NSString*)analytics... |
Add threadJoins test where recreated threads should be removed from must-join set | //PARAM: --set ana.activated[+] threadJoins --disable ana.thread.include-node --set ana.thread.domain plain
#include <pthread.h>
#include <assert.h>
int g = 0;
void *t_fun(void *arg) {
g++; // RACE!
return NULL;
}
int main() {
pthread_t id;
pthread_create(&id, NULL, t_fun, NULL);
__goblint_assume_join(id)... | |
Add a test to check clang produces accelerator tables. | // Test that clang produces the __apple accelerator tables,
// e.g., __apple_types, correctly.
// RUN: %clang %s -target x86_64-apple-macosx10.13.0 -c -g -o %t-ex
// RUN: llvm-objdump -section-headers %t-ex | FileCheck %s
int main (int argc, char const *argv[]) { return argc; }
// CHECK: __debug_str
// CHECK-NEXT: __... | |
Add adc settings and a function to calculate the conversion | #ifndef __BOARD_H
#define __BOARD_H
#ifdef __cplusplus
extern "C" {
#endif
#define F_OSC0 12000000UL
#define F_OSC1 0UL
#define F_CPU 66000000UL
#define HSBMASK_DEFAULT 0xFFFFFFFF
#define PBAMASK_DEFAULT 0xFFFFFFFF
#define PBBMASK_DEFAULT 0xFFFFFFFF
void init_board(void);
#ifdef __cplusplus
}
#endif
#endif
| #ifndef __BOARD_H
#define __BOARD_H
#ifdef __cplusplus
extern "C" {
#endif
#define ADC_VREF 3.0
#define ADC_BITS 10
#define F_CPU 66000000UL
#define F_OSC0 12000000UL
#define F_OSC1 0UL
#define HSBMASK_DEFAULT 0xFFFFFFFF
#define PBAMASK_DEFAULT 0xFFFFFFFF
#define PBBMASK_DEFAULT 0xFFFFFFFF
void init_board(void);
... |
Add missing return after Queue creation | #include "queue.h"
struct Queue
{
size_t head;
size_t tail;
size_t size;
void** e;
};
Queue* Queue_Create(size_t n)
{
Queue* q = (Queue *)malloc(sizeof(Queue));
q->size = n;
q->head = q->tail = 1;
q->e = (void **)malloc(sizeof(void*) * (n + 1));
} | #include "queue.h"
struct Queue
{
size_t head;
size_t tail;
size_t size;
void** e;
};
Queue* Queue_Create(size_t n)
{
Queue* q = (Queue *)malloc(sizeof(Queue));
q->size = n;
q->head = q->tail = 1;
q->e = (void **)malloc(sizeof(void*) * (n + 1));
return q;
} |
Correct type, gcc-3.4.5 fails, thanks nitinkg for reporting/testing | /* vi: set sw=4 ts=4: */
/*
* getrusage() for uClibc
*
* Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
*
* GNU Library General Public License (LGPL) version 2 or later.
*/
#include "syscalls.h"
#include <unistd.h>
#include <wait.h>
_syscall2(int, getrusage, int, who, struct rusage *, usage);
| /* vi: set sw=4 ts=4: */
/*
* getrusage() for uClibc
*
* Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
*
* GNU Library General Public License (LGPL) version 2 or later.
*/
#include "syscalls.h"
#include <unistd.h>
#include <wait.h>
_syscall2(int, getrusage, __rusage_who_t, who, struct rusage *... |
Fix declarations of pthread functions, missed in recent commit. | #ifndef __PTHREAD_H
#define __PTHREAD_H
typedef ULONG pthread_key_t;
typedef HANDLE pthread_mutex_t;
typedef int pthread_once_t;
DWORD pthread_self(void);
void pthread_setspecific(pthread_key_t, void *);
void *pthread_getspecific(pthread_key_t);
void pthread_mutex_init(pthread_mutex_t *, void *attr);
void pt... | #ifndef __PTHREAD_H
#define __PTHREAD_H
typedef ULONG pthread_key_t;
typedef HANDLE pthread_mutex_t;
typedef int pthread_once_t;
DWORD pthread_self(void);
void pthread_setspecific(pthread_key_t, void *);
void *pthread_getspecific(pthread_key_t);
int pthread_mutex_init(pthread_mutex_t *, void *attr);
int pt... |
Fix bug in XPORT byteswapping | #include <stdint.h>
#include "readstat_xport.h"
#include "../readstat_bits.h"
char _xport_months[12][4] = {
"JAN", "FEB", "MAR", "APR", "MAY", "JUN",
"JUL", "AUG", "SEP", "OCT", "NOV", "DEC" };
void xport_namestr_bswap(xport_namestr_t *namestr) {
if (!machine_is_little_endian())
return;
name... | #include <stdint.h>
#include "readstat_xport.h"
#include "../readstat_bits.h"
char _xport_months[12][4] = {
"JAN", "FEB", "MAR", "APR", "MAY", "JUN",
"JUL", "AUG", "SEP", "OCT", "NOV", "DEC" };
void xport_namestr_bswap(xport_namestr_t *namestr) {
if (!machine_is_little_endian())
return;
name... |
Add skeleton of test program | #include <unistd.h>
#include <stdlib.h>
#include <sys/socket.h>
int main(void) {
char const *server_path = "/tmp/unix_server_listener"
int listener = socket(PF_UNIX, SOCK_STREAM, 0);
unlink(server_path);
int err = bind(listener, address);
err = listen(listener, 2048);
set listener close-on-fork
int ... | |
Put skey support to ftpd Reviewed by: Submitted by: guido | /* Author: Wietse Venema, Eindhoven University of Technology. */
#include <stdio.h>
#include <pwd.h>
#include <skey.h>
/* skey_challenge - additional password prompt stuff */
char *skey_challenge(name, pwd, pwok)
char *name;
struct passwd *pwd;
int pwok;
{
static char buf[128];
struct skey skey;
... | |
Add a few result codes. | // Public domain. See "unlicense" statement at the end of this file.
#define TA_ERROR_FAILED_TO_PARSE_CMDLINE -1
#define TA_ERROR_FAILED_TO_CREATE_GAME_CONTEXT -2
#define TA_ERROR_INVALID_ARGS -3
| // Public domain. See "unlicense" statement at the end of this file.
typedef int ta_result;
#define TA_SUCCESS 0
#define TA_ERRORS -1
#define TA_INVALID_ARGS -2
#define TA_OUT_OF_MEMORY -3
#define TA_ERROR_FAILED_TO_PARSE_CMDLINE -1
#define TA_ERROR_FAILED_TO_CREATE_GAME_CONTEXT -2
... |
Document why `ImportNumpy ` exists and when it should be used. | // Copyright 2019 DeepMind Technologies 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 required by applicable l... | // Copyright 2019 DeepMind Technologies 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 required by applicable l... |
Fix serious bug. Should be RTLD_NOW... RTLD_LAZY does not work for getting a girlfriend. | /*
** Copyright 2002, Manuel J. Petit. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#include <stdio.h>
#include <dlfcn.h>
extern int fib(int);
extern void shared_hello(void);
int
main()
{
void *freston;
void *girlfriend;
shared_hello();
printf("%d %d %d %d %d %d\n", fib(0), fib(1... | /*
** Copyright 2002, Manuel J. Petit. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#include <stdio.h>
#include <dlfcn.h>
extern int fib(int);
extern void shared_hello(void);
int
main()
{
void *freston;
void *girlfriend;
shared_hello();
printf("%d %d %d %d %d %d\n", fib(0), fib(1... |
Add official API header file | /* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* APIs between calling firmware and vboot_reference
*
* DO NOT INCLUDE THE HEADERS BELOW DIRECTLY! ONLY INCLUDE THIS FILE!
*/
#ifndef VBO... | |
Make KirinGwtServiceStub use KirinSynchronousExecute protocol | //
// NewDatabasesImpl.h
// KirinKit
//
// Created by Douglas Hoskins on 04/10/2013.
// Copyright (c) 2013 Future Platforms. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "NSObject+Kirin.h"
#import "KirinGwtServiceStub.h"
#import "NewTransactionService.h"
#import <toNative/DatabaseAccessService... | //
// NewDatabasesImpl.h
// KirinKit
//
// Created by Douglas Hoskins on 04/10/2013.
// Copyright (c) 2013 Future Platforms. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "NSObject+Kirin.h"
#import "KirinGwtServiceStub.h"
#import "NewTransactionService.h"
#import <toNative/DatabaseAccessService... |
Add global state annotation definitions | /// @file
/// @brief Defines global state annotation class.
#ifndef GLOBAL_STATE_ANNOTATION_H
#define GLOBAL_STATE_ANNOTATION_H
namespace fish_annotator {
/// Defines global state information for one image/frame.
struct GlobalStateAnnotation : public Serialization {
/// Constructor.
///
/// @param states Globa... | |
Add minimal creduced case where TD3 abort fails its verify | // PARAM: --set ana.activated[+] var_eq --set ana.activated[+] symb_locks --set ana.activated[+] region --enable ana.sv-comp.enabled --set ana.specification "CHECK( init(main()), LTL(G ! call(reach_error())) )"
// creduced from ldv-linux-4.2-rc1/linux-4.2-rc1.tar.xz-43_2a-drivers--scsi--qla4xxx--qla4xxx.ko-entry_point... | |
Solve Simple Calculate in c | #include <math.h>
#include <stdio.h>
int main() {
int a, b;
float c, s = 0.0;
while (scanf("%d %d %f", &a, &b, &c) != EOF) {
s += c * b;
}
printf("VALOR A PAGAR: R$ %.2f\n", s);
}
| |
Fix build problem under FreeBSD. | /*
* config-mem.h
*
* Copyright (c) 1996, 1997
* Transvirtual Technologies, Inc. All rights reserved.
*
* See the file "license.terms" for information on usage and redistribution
* of this file.
*/
#ifndef __config_mem_h
#define __config_mem_h
#if defined(HAVE_STRING_H)
#include <string.h>
#endif
#if defin... | /*
* config-mem.h
*
* Copyright (c) 1996, 1997
* Transvirtual Technologies, Inc. All rights reserved.
*
* See the file "license.terms" for information on usage and redistribution
* of this file.
*/
#ifndef __config_mem_h
#define __config_mem_h
#if defined(HAVE_STRING_H)
#include <string.h>
#endif
#if defin... |
Make AsyncIoInterface a pure interface | // 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... |
Make ReferenceFresnelTest th config dependent | #ifndef KLETCH_MATH_PREFIX_H
#define KLETCH_MATH_PREFIX_H
#include <utility>
#include <tuple>
#include <iostream>
#include <limits>
#include "special_functions.h"
namespace kletch {
#ifdef KLETCH_USE_DOUBLES
typedef double real;
#else
typedef float real;
#endif
template <typename T>
inline constexpr real rl... | #ifndef KLETCH_MATH_PREFIX_H
#define KLETCH_MATH_PREFIX_H
#include <utility>
#include <tuple>
#include <iostream>
#include <limits>
#include "special_functions.h"
namespace kletch {
#ifdef KLETCH_WITH_DOUBLE
typedef double real;
#else
typedef float real;
#endif
template <typename T>
inline constexpr real rl... |
Add a comment explaining how to drop an error on the ground | // Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#ifndef OPENTITAN_SW_DEVICE_LIB_DIF_DIF_WARN_UNUSED_RESULT_H_
#define OPENTITAN_SW_DEVICE_LIB_DIF_DIF_WARN_UNUSED_RESULT_H_
/**
* @file
* @brief Unused Result Warning... | // Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#ifndef OPENTITAN_SW_DEVICE_LIB_DIF_DIF_WARN_UNUSED_RESULT_H_
#define OPENTITAN_SW_DEVICE_LIB_DIF_DIF_WARN_UNUSED_RESULT_H_
/**
* @file
* @brief Unused Result Warning... |
Use variable size input buffer in uncompress fuzzer. | /* Derived from zlib fuzzers at http://github.com/google/oss-fuzz/tree/master/projects/zlib,
* see ossfuzz.sh for full license text.
*/
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "miniz.h"
static unsigned char buffer[256 * 1024] = { 0 };
int LLVMFuzzerTestOneInput(const uint8_t* data, siz... | /* Derived from zlib fuzzers at http://github.com/google/oss-fuzz/tree/master/projects/zlib,
* see ossfuzz.sh for full license text.
*/
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "miniz.h"
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
unsigned long int buffer_length = ... |
Mark the comment in a proper C style | // PARAM: --set ana.int.interval true --enable exp.partition-arrays.enabled
#include<stdlib.h>
#include<assert.h>
int main(void) {
int *r = malloc(5 * sizeof(int));
r[3] = 2;
assert(r[4] == 2);
(* Here we only test our implementation. Concretely, accessing the uninitialised r[4] is undefined behavio... | // PARAM: --set ana.int.interval true --enable exp.partition-arrays.enabled
#include<stdlib.h>
#include<assert.h>
int main(void) {
int *r = malloc(5 * sizeof(int));
r[3] = 2;
assert(r[4] == 2);
/* Here we only test our implementation. Concretely, accessing the uninitialised r[4] is undefined behavio... |
Add comment regarding ISR in callback. | #ifndef BROTHERKH930_H_
#define BROTHERKH930_H_
#import "position.h"
/** Pins unsed for interfacing with the BrotherKH930. */
struct PinSetup {
int encoderV1;
int encoderV2;
int encoderBP; // belt-phase
};
/** Pin setup as used by the KniticV2 PCB. */
PinSetup kniticV2Pins();
/**
* Interfact to a brother kni... | #ifndef BROTHERKH930_H_
#define BROTHERKH930_H_
#import "position.h"
/** Pins unsed for interfacing with the BrotherKH930. */
struct PinSetup {
int encoderV1;
int encoderV2;
int encoderBP; // belt-phase
};
/** Pin setup as used by the KniticV2 PCB. */
PinSetup kniticV2Pins();
/**
* Interfact to a brother kni... |
Add checker test case: warn about returning an uninitialized value to the caller. | // RUN: clang -checker-simple -verify %s &&
// RUN: clang -checker-simple -analyzer-store-region -verify %s
struct FPRec {
void (*my_func)(int * x);
};
int bar(int x);
int f1_a(struct FPRec* foo) {
int x;
(*foo->my_func)(&x);
return bar(x)+1; // no-warning
}
int f1_b() {
int x;
return bar(x)+1; // ex... | // RUN: clang -checker-simple -verify %s &&
// RUN: clang -checker-simple -analyzer-store-region -verify %s
struct FPRec {
void (*my_func)(int * x);
};
int bar(int x);
int f1_a(struct FPRec* foo) {
int x;
(*foo->my_func)(&x);
return bar(x)+1; // no-warning
}
int f1_b() {
int x;
return bar(x)+1; // ex... |
Convert to sRGB based on the appropriate formulas instead of an approximiate 2.2 gamma correction. | #define GAMMA 2.2
vec4 toLinear(vec4 colour)
{
return vec4(pow(colour.rgb, vec3(GAMMA)), colour.a);
}
vec4 toSRGB(vec4 colour)
{
return vec4(pow(colour.rgb, vec3(1.0 / GAMMA)), colour.a);
} | #define GAMMA 2.4
float toLinear(float color)
{
return color <= 0.04045 ? (color / 12.92) : pow((color + 0.055) / 1.055, GAMMA);
}
vec4 toLinear(vec4 colour)
{
return vec4(toLinear(colour.r), toLinear(colour.g), toLinear(colour.b), colour.a);
}
float toSRGB(float color)
{
return color < 0.0031308 ?... |
Fix endian test for big-endian hosts | //===-- Endian.h ------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===-- Endian.h ------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Change int to long long | /**
* @copyright Copyright 2016 The J-PET Framework 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 find a copy of the License in the LICENCE file.
*
* Unless required by applicable la... | /**
* @copyright Copyright 2016 The J-PET Framework 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 find a copy of the License in the LICENCE file.
*
* Unless required by applicable la... |
Remove the unecessary macro N_COINS to sizeof-way | /*
* =====================================================================================
*
* Copyright 2015 Manoel Vilela
*
*
* Filename: solution_1.c
*
* Description: Solution for Problem031 of ProjectEuler
*
* Author: Manoel Vilela
* Contact: manoel_vilela@eng... | /*
* =====================================================================================
*
* Copyright 2015 Manoel Vilela
*
*
* Filename: solution_1.c
*
* Description: Solution for Problem031 of ProjectEuler
*
* Author: Manoel Vilela
* Contact: manoel_vilela@eng... |
Add a test case where the tarval module generates an unexpected result. | /* The tarval module fails to negate the constant and returns TV_OVERFLOW_BAD
* when optimising the comparison (-x < 0 -> x > 0). It is not expected that
* the negation fails and an assertion while constructing the negated constant
* is triggered */
int f(double x)
{
return -x < 0;
}
int main(void)
{
return 0... | |
Add base factory to produce moveAbleElem | #pragma once
#include "cocos2d.h"
#include "MoveAbleElem.h"
class MoveAbleElemBaseFactory :public cocos2d::Ref
{
protected:
MoveAbleElemBaseFactory() { ; }
public:
virtual ~MoveAbleElemBaseFactory()
{
}
virtual bool init()
{
return true;
}
static MoveAbleElemBaseFactory * create()
{
return nullptr;
}... | |
Include route configuration file in main header | #ifndef APIMOCK_H
#define APIMOCK_H
#include "core/exceptions.h"
#include "http/httpserver.h"
#include "http/requestdata.h"
#include "http/requestdata.h"
#include "http/statuscodes.h"
#include "routing/routedresourcestrategy.h"
#endif | #ifndef APIMOCK_H
#define APIMOCK_H
#include "core/exceptions.h"
#include "http/httpserver.h"
#include "http/requestdata.h"
#include "http/requestdata.h"
#include "http/statuscodes.h"
#include "routing/config.h"
#include "routing/routedresourcestrategy.h"
#endif |
Define PGTABLE_LEVELS to 32bit VDSO | #define BUILD_VDSO32
#ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
#undef CONFIG_OPTIMIZE_INLINING
#endif
#undef CONFIG_X86_PPRO_FENCE
#ifdef CONFIG_X86_64
/*
* in case of a 32 bit VDSO for a 64 bit kernel fake a 32 bit kernel
* configuration
*/
#undef CONFIG_64BIT
#undef CONFIG_X86_64
#undef CONFIG_ILLEGAL_POINTER_VALUE
... | #define BUILD_VDSO32
#ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
#undef CONFIG_OPTIMIZE_INLINING
#endif
#undef CONFIG_X86_PPRO_FENCE
#ifdef CONFIG_X86_64
/*
* in case of a 32 bit VDSO for a 64 bit kernel fake a 32 bit kernel
* configuration
*/
#undef CONFIG_64BIT
#undef CONFIG_X86_64
#undef CONFIG_PGTABLE_LEVELS
#undef ... |
Add declaration of struct _node, for scoping reasons. | /***********************************************************
Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The
Netherlands.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,... | /***********************************************************
Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The
Netherlands.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,... |
Add some UCL-related definitions to be shared by the RTPP code. | /*
* Copyright (c) 2018 Sippy Software, Inc., http://www.sippysoft.com
* 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
... | |
Document why position can be nil. | //
// OCTCommitComment.h
// OctoKit
//
// Created by Justin Spahr-Summers on 2012-10-02.
// Copyright (c) 2012 GitHub. All rights reserved.
//
#import "OCTObject.h"
// A single comment on a commit.
@interface OCTCommitComment : OCTObject
// The webpage URL for this comment.
@property (nonatomic, copy, readonly) ... | //
// OCTCommitComment.h
// OctoKit
//
// Created by Justin Spahr-Summers on 2012-10-02.
// Copyright (c) 2012 GitHub. All rights reserved.
//
#import "OCTObject.h"
// A single comment on a commit.
@interface OCTCommitComment : OCTObject
// The webpage URL for this comment.
@property (nonatomic, copy, readonly) ... |
Fix compilation error for pic32mz platform. | /*
Copyright (c) 2016, prpl Foundation
Permission to use, copy, modify, and/or distribute this software for any purpose with or without
fee is hereby granted, provided that the above copyright notice and this permission notice appear
in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRA... | /*
Copyright (c) 2016, prpl Foundation
Permission to use, copy, modify, and/or distribute this software for any purpose with or without
fee is hereby granted, provided that the above copyright notice and this permission notice appear
in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRA... |
Fix typo in Skillz bridging header | //Skillz dependencies.
#import <MobileCoreServices/MobileCoreServices.h>
#import <PassKit/PassKit.h>
#import <MediaPlayer/MediaPlayer.h>
#import <MessageUI/MessageUI.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <Social/Social.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import <StoreKit/StoreKit.h>
#im... | //Skillz dependencies.
#import <MobileCoreServices/MobileCoreServices.h>
#import <PassKit/PassKit.h>
#import <MediaPlayer/MediaPlayer.h>
#import <MessageUI/MessageUI.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <Social/Social.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import <StoreKit/StoreKit.h>
#im... |
Fix compilation of eventloop with probes |
//Eventloop->post (with delay = 0)
TRACEPOINT_EVENT(qi_qi, eventloop_post,
TP_ARGS(unsigned int, taskId,
const char*, typeName),
TP_FIELDS(ctf_integer(int, taskId, taskId)
ctf_string(typeName, typeName)
)
)
//Eventloop->async && post with delay
TRAC... |
//Eventloop->post (with delay = 0)
TRACEPOINT_EVENT(qi_qi, eventloop_post,
TP_ARGS(unsigned int, taskId,
const char*, typeName),
TP_FIELDS(ctf_integer(int, taskId, taskId)
ctf_string(typeName, typeName)
)
)
//Eventloop->async && post with delay
TRAC... |
Add test with immediate int arg read access | #include <pthread.h>
#include <stdio.h>
#include <string.h>
int g;
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
g++; // RACE!
return NULL;
}
int main(void) {
int x;
pthread_t id;
pthread_create(&id, NULL, t_fun, NULL);
memset(&x, g, sizeof(int)); // RACE!
pthread_join (i... | |
Add Chapter 27, exercise 1 | /* Chapter 27, exercise 1: implement versions of strlen(), strcmp() and strcpy()
*/
#include<stddef.h>
#include<stdio.h>
size_t strlen(const char* s)
{
size_t len = 0;
while (*s++) ++len;
return len;
}
int strcmp(const char* s1, const char* s2)
{
const char* p1 = s1;
const char* p2 = s2;
whil... | |
Put delete instead of free | #ifndef UTILITIES_HLT
#define UTILITIES_HLT
#include <deal.II/base/utilities.h>
#include <deal.II/base/smartpointer.h>
#include <typeinfo>
#include <cxxabi.h>
using namespace dealii;
/**
* SmartPointers are usually not used to point to objects created with
* new. However, sometimes this is useful. The distruction... | #ifndef UTILITIES_HLT
#define UTILITIES_HLT
#include <deal.II/base/utilities.h>
#include <deal.II/base/smartpointer.h>
#include <typeinfo>
#include <cxxabi.h>
using namespace dealii;
/**
* SmartPointers are usually not used to point to objects created with
* new. However, sometimes this is useful. The distruction... |
Add ObjectID to RenderTargetType enum | /******************************************************************************\
* gloperate
*
* Copyright (C) 2014 Computer Graphics Systems Group at the
* Hasso-Plattner-Institut (HPI), Potsdam, Germany.
\******************************************************************************/
#pragma once
#include <glo... | /******************************************************************************\
* gloperate
*
* Copyright (C) 2014 Computer Graphics Systems Group at the
* Hasso-Plattner-Institut (HPI), Potsdam, Germany.
\******************************************************************************/
#pragma once
#include <glo... |
Use the default stack size | /**
* @file platform-local.h
*
*/
#ifndef _ARM_QEMU_PLATFORM_LOCAL_H
#define _ARM_QEMU_PLATFORM_LOCAL_H
/*
* The fluke-arm platform has so little memory that the global default
* of 64k for INITSTK is too big. Try something more conservativer.
*/
#define INITSTK (1337)
#endif /* _ARM_QEMU_PLATFORM_LOCAL_H */
| /**
* @file platform-local.h
*
*/
#ifndef _ARM_QEMU_PLATFORM_LOCAL_H
#define _ARM_QEMU_PLATFORM_LOCAL_H
#endif /* _ARM_QEMU_PLATFORM_LOCAL_H */
|
Add option to print as bytecode instead of assembly. | //===- llvm/Transforms/PrintModulePass.h - Printing Pass ---------*- C++ -*--=//
//
// This file defines a simple pass to print out methods of a module as they are
// processed.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TRANSFORMS_PRINTMODULE_H
#define LLVM_TRANSF... | //===- llvm/Transforms/PrintModulePass.h - Printing Pass ---------*- C++ -*--=//
//
// This file defines a simple pass to print out methods of a module as they are
// processed.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TRANSFORMS_PRINTMODULE_H
#define LLVM_TRANSF... |
Use proper uppercase at start of comment. | // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "i_hw_info.h"
namespace vespalib {
/*
* class describing some hardware on the machine.
*/
class HwInfo : public IHwInfo
{
bool _spinningDisk;
public:
HwInfo();
virtua... | // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "i_hw_info.h"
namespace vespalib {
/*
* Class describing some hardware on the machine.
*/
class HwInfo : public IHwInfo
{
bool _spinningDisk;
public:
HwInfo();
virtua... |
Add missing --rust-target flags on test case. | // bindgen-flags: --default-enum-style rust_non_exhaustive --raw-line '#![cfg(feature = "nightly")]' --raw-line '#![feature(non_exhaustive)]'
enum Planet {
earth,
mars
};
| // bindgen-flags: --default-enum-style rust_non_exhaustive --rust-target nightly --raw-line '#![cfg(feature = "nightly")]' --raw-line '#![feature(non_exhaustive)]'
enum Planet {
earth,
mars
};
|
Fix build of the Linux kernel module on ARM. | /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be use... | /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be use... |
Add forward declarations for all proxies | //=================================================================================================
/*!
// \file blaze/math/proxy/Forward.h
// \brief Header file for all forward declarations for proxies
//
// Copyright (C) 2013 Klaus Iglberger - All Rights Reserved
//
// This file is part of the Blaze library. You ... | |
Fix error in external IP widget | #include "widgets.h"
#include "external_ip.h"
static int
widget_external_ip_send_update () {
char *external_ip = wkline_curl_request(wkline_widget_external_ip_address);
json_t *json_data_object = json_object();
char *json_payload;
json_object_set_new(json_data_object, "ip", json_string("ip"));
json_payload = j... | #include "widgets.h"
#include "external_ip.h"
static int
widget_external_ip_send_update () {
char *external_ip = wkline_curl_request(wkline_widget_external_ip_address);
json_t *json_data_object = json_object();
char *json_payload;
json_object_set_new(json_data_object, "ip", json_string(external_ip));
json_payl... |
Add one slot for changed value | #pragma once
#include <QtWidgets>
#include <QMediaPlayer>
class MediaControls : public QWidget
{
Q_OBJECT
public:
MediaControls(QWidget *parent = 0);
QMediaPlayer::State state() const;
int volume() const;
bool isMuted();
public slots:
void setState(QMediaPlayer::State state);
void setVo... | #pragma once
#include <QtWidgets>
#include <QMediaPlayer>
class MediaControls : public QWidget
{
Q_OBJECT
public:
MediaControls(QWidget *parent = 0);
QMediaPlayer::State state() const;
int volume() const;
bool isMuted();
public slots:
void setState(QMediaPlayer::State state);
void setVo... |
Read file and save data to array | #include<stdio.h>
#include<stdlib.h>
int main (int argc, char *argv[]){
if(argc != 3){
printf("Number of parameters should be 2 (filename, cardinality).");
exit(1);
}
//open file and get file length
FILE *file;
file = fopen(argv[1],"r");
if(file == NULL){
printf("File c... | |
Add a collision margin to each shape Margins are one way to improve stability of contacts. Only the GJK solver will use these initially | #ifndef CHC_NARROWPHASE_H
#define CHC_NARROWPHASE_H
#include "chrono_parallel/ChParallelDefines.h"
#include "chrono_parallel/ChDataManager.h"
namespace chrono {
namespace collision {
struct ConvexShape {
shape_type type; //type of shape
real3 A; //location
real3 B; //dimensions
real3 C; //extra
qu... | #ifndef CHC_NARROWPHASE_H
#define CHC_NARROWPHASE_H
#include "chrono_parallel/ChParallelDefines.h"
#include "chrono_parallel/ChDataManager.h"
namespace chrono {
namespace collision {
struct ConvexShape {
shape_type type; //type of shape
real3 A; //location
real3 B; //dimensions
real3 C; //extra
qu... |
Add a version of the bytecode writer pass that has a default ctor | //===- llvm/Bytecode/WriteBytecodePass.h - Bytecode Writer Pass --*- C++ -*--=//
//
// This file defines a simple pass to write the working module to a file after
// pass processing is completed.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_BYTECODE_WRITEBYTECODEPASS... | //===- llvm/Bytecode/WriteBytecodePass.h - Bytecode Writer Pass --*- C++ -*--=//
//
// This file defines a simple pass to write the working module to a file after
// pass processing is completed.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_BYTECODE_WRITEBYTECODEPASS... |
Update Skia milestone to 69 | /*
* 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 68
#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 69
#endif
|
Add a circular dependency exception. | #ifndef SAUCE_SAUCE_EXCEPTIONS_H_
#define SAUCE_SAUCE_EXCEPTIONS_H_
#include <stdexcept>
namespace sauce {
/**
* Raised when no binding can be found for a given interface.
*
* TODO sure would be nice to know who..
*/
struct UnboundException:
public std::runtime_error {
UnboundException():
std::runtime_er... | #ifndef SAUCE_SAUCE_EXCEPTIONS_H_
#define SAUCE_SAUCE_EXCEPTIONS_H_
#include <string>
#include <stdexcept>
namespace sauce {
/**
* Base class for all sauce exceptions.
*/
struct Exception: std::runtime_error {
Exception(std::string message):
std::runtime_error(message) {}
};
/**
* Raised when no binding ca... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.