Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add types, allow for subroutines. | struct stack_node {
struct stack_node *cdr;
int data;
char type;
}
struct subroutine {
struct stack_node *nodes;
int num_nodes;
}
| #define T_INT 0
#define T_CHAR 1
#define T_SBRTN 2
struct stack_node {
struct stack_node *cdr;
union node_data data;
}
union node_data {
struct subroutine srtine;
int numval;
char type;
}
struct subroutine {
struct stack_node *nodes;
int num_nodes;
}
|
Use uint32_t for compilation unit index instead of uint16_t. | /*
* Copyright (C) 2011 The Android Open Source Project
*
* 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 app... | /*
* Copyright (C) 2011 The Android Open Source Project
*
* 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 app... |
Refactor to clean up isr written variable | #ifndef EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H
#define EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H
#include "rvalue.h"
namespace ehl
{
template<typename T>
class isr_written_variable
{
private:
mutable volatile bool modified;
volatile T value;
public:
isr_written_variable() = default;
isr_writte... | #ifndef EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H
#define EMBEDDEDHELPERLIBRARY_ISR_WRITTEN_VARIABLE_H
#include "rvalue.h"
namespace ehl
{
template<typename T>
class isr_written_variable
{
private:
mutable volatile bool modified;
volatile T value;
public:
isr_written_variable() = default;
isr_writte... |
Fix uchar vs. char in natnet_sender_t; add natnet_packet_t | #ifndef OPTITRACK_WIRE_H_
#define OPTITRACK_WIRE_H_
#include <stdint.h>
typedef enum {
NAT_PING = 0,
NAT_PINGRESPONSE = 1,
NAT_REQUEST = 2,
NAT_RESPONSE = 3,
NAT_REQUEST_MODELDEF = 4,
NAT_MODELDEF = 5,
NAT_REQUEST_FRAMEOFDATA = 6,
NAT_FRAMEOFDATA = 7,
NAT_MESSAGESTRING = 8,
NAT... | #ifndef OPTITRACK_WIRE_H_
#define OPTITRACK_WIRE_H_
#include <stdint.h>
typedef enum {
NAT_PING = 0,
NAT_PINGRESPONSE = 1,
NAT_REQUEST = 2,
NAT_RESPONSE = 3,
NAT_REQUEST_MODELDEF = 4,
NAT_MODELDEF = 5,
NAT_REQUEST_FRAMEOFDATA = 6,
NAT_FRAMEOFDATA = 7,
NAT_MESSAGESTRING = 8,
NAT... |
Add a "counted copying iterator". | #pragma once
#include <cstddef>
namespace scratch {
template<class T>
struct counted_copying_iterator {
using value_type = T;
using difference_type = ptrdiff_t;
using pointer = const T *;
using reference = const T&;
using iterator_category = random_access_iterator_tag;
explicit counted_copyi... | |
Add line endings for Mac OS. | #ifndef __COMMONS_H
#define __COMMONS_H
#ifdef __APPLE__
#define ENDLINE '\r'
#else
#define ENDLINE '\n'
#endif
#endif
| |
Make include guard name for color.h be compliant with our standard | #ifndef TRN_RGB_COLOR_H
#define TRN_RGB_COLOR_H
#include <stdbool.h>
typedef struct {
float red;
float green;
float blue;
} TrnColor;
extern TrnColor const TRN_WHITE;
extern TrnColor const TRN_RED;
extern TrnColor const TRN_GREEN;
extern TrnColor const TRN_BLUE;
extern TrnColor const TRN_YELLOW;
extern TrnColo... | #ifndef TRN_COLOR_H
#define TRN_COLOR_H
#include <stdbool.h>
typedef struct {
float red;
float green;
float blue;
} TrnColor;
extern TrnColor const TRN_WHITE;
extern TrnColor const TRN_RED;
extern TrnColor const TRN_GREEN;
extern TrnColor const TRN_BLUE;
extern TrnColor const TRN_YELLOW;
extern TrnColor const ... |
Remove AI_ADDRCONFIG, since the netlink socket is missing CLOEXEC and gets inherited by children. | #include <netdb.h>
#include "asyncaddrinfo.h"
#include "peer.h"
#include "resolve.h"
void resolve_init() {
asyncaddrinfo_init(2);
}
void resolve_cleanup() {
asyncaddrinfo_cleanup();
}
void resolve(struct peer *peer, const char *node, const char *service, int flags) {
struct addrinfo hints = {
.ai_flags = AI_V... | #include <netdb.h>
#include "asyncaddrinfo.h"
#include "peer.h"
#include "resolve.h"
void resolve_init() {
asyncaddrinfo_init(2);
}
void resolve_cleanup() {
asyncaddrinfo_cleanup();
}
void resolve(struct peer *peer, const char *node, const char *service, int flags) {
struct addrinfo hints = {
.ai_flags = AI_V... |
Add cabecalho para as funcoes (modularizando) | #include <stdlib.h>
#include <stdio.h>
#include <math.h>
#define PI 3.14
float soluc (float, float);
float radians_degrees (float);
float degrees_radians (float);
| |
Add command to check bulk sync stats | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2013 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... | |
Set the GTK+ backward compatibility check to 2.21.2. | #ifndef __GTK_COMPAT_H__
#define __GTK_COMPAT_H__
#include <gtk/gtk.h>
/* Provide a compatibility layer for accessor functions introduced
* in GTK+ 2.22 which we need to build with sealed GDK.
* That way it is still possible to build with GTK+ 2.20.
*/
#if !GTK_CHECK_VERSION(2, 21, 0)
#define gdk_drag_context_ge... | #ifndef __GTK_COMPAT_H__
#define __GTK_COMPAT_H__
#include <gtk/gtk.h>
/* Provide a compatibility layer for accessor functions introduced
* in GTK+ 2.22 which we need to build with sealed GDK.
* That way it is still possible to build with GTK+ 2.20.
*/
#if !GTK_CHECK_VERSION(2,21,2)
#define gdk_drag_context_get_... |
Make reply parser result optional | /*
Copyright 2019 The Matrix.org Foundation C.I.C
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... | /*
Copyright 2019 The Matrix.org Foundation C.I.C
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... |
Add imports to Bridging Header. | //
// Use this file to import your target's public headers that you would like to expose to Swift.
//
| //
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import <Parse/Parse.h>
#import <Bolts/Bolts.h>
#import <AWSiOSSDKv2/AWSCore.h>
#import <AWSiOSSDKv2/S3.h>
#import <AWSiOSSDKv2/DynamoDB.h>
#import <AWSiOSSDKv2/SQS.h>
#import <AWSiOSSDKv2/SNS.h> |
Fix for legacy QT compatibility | #ifndef MACDOCKICONHANDLER_H
#define MACDOCKICONHANDLER_H
#include <QtCore/QObject>
class QMenu;
class QIcon;
class QWidget;
class objc_object;
/** Macintosh-specific dock icon handler.
*/
class MacDockIconHandler : public QObject
{
Q_OBJECT
public:
~MacDockIconHandler();
QMenu *dockMenu();
void se... | #ifndef MACDOCKICONHANDLER_H
#define MACDOCKICONHANDLER_H
#include <QtCore/QObject>
class QMenu;
class QIcon;
class QWidget;
#ifdef __OBJC__
@class DockIconClickEventHandler;
#else
class DockIconClickEventHandler;
#endif
/** Macintosh-specific dock icon handler.
*/
class MacDockIconHandler : public QObject
{
Q... |
Make the alternative cmac optional | /*
* mbedtls_device.h
*
* Copyright (C) 2018, Arm Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*... | /*
* mbedtls_device.h
*
* Copyright (C) 2018-2019, Arm Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License a... |
Make use of mutex easier to see | #include <stdio.h>
#include <assert.h>
#include <unistd.h>
#include "uv.h"
static uv_mutex_t mutex;
static uv_thread_t thread;
static int crit_data = 0;
static void thread_cb(void* arg) {
uv_mutex_lock(&mutex);
printf("thread mutex start\n");
crit_data = 2;
printf("thread mutex end\n");
uv_mutex_unlock(&... | #include <stdio.h>
#include <assert.h>
#include <unistd.h>
#include "uv.h"
static uv_mutex_t mutex;
static uv_thread_t thread;
static void thread_cb(void* arg) {
printf("thread_cb\n");
uv_mutex_lock(&mutex);
printf("thread mutex\n");
uv_mutex_unlock(&mutex);
}
int main() {
assert(0 == uv_mutex_init(&mutex... |
Fix stub implementation (add missing sigaction decl) | /**
* @file
* @brief Stubs for standard signals.
*
* @date 07.10.2013
* @author Eldar Abusalimov
*/
#ifndef KERNEL_THREAD_SIGSTD_STUB_H_
#define KERNEL_THREAD_SIGSTD_STUB_H_
#include <errno.h>
#define SIGSTD_MIN 0
#define SIGSTD_MAX -1
struct sigstd_data { }; /* stub */
static inline struct sigstd_d... | /**
* @file
* @brief Stubs for standard signals.
*
* @date 07.10.2013
* @author Eldar Abusalimov
*/
#ifndef KERNEL_THREAD_SIGSTD_STUB_H_
#define KERNEL_THREAD_SIGSTD_STUB_H_
#include <errno.h>
#include <signal.h>
#define SIGSTD_MIN 0
#define SIGSTD_MAX -1
struct sigstd_data { }; /* stub */
static in... |
Add test based on getTable.c. | /* liblouis Braille Translation and Back-Translation Library
Copyright (C) 2012 James Teh <jamie@nvaccess.org>
Copyright (C) 2015 Davy Kager <mail@davykager.nl>
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notic... | |
Make FORCE_LONG_ENUM actually force a long instead of an int | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#ifndef __LIBSEL4_MACROS_H
#define __LIBSEL4_MACROS_H
#include <autoconf.h>
/*
* ... | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#ifndef __LIBSEL4_MACROS_H
#define __LIBSEL4_MACROS_H
#include <autoconf.h>
/*
* ... |
Add fuller definition of Stream<Byte> | #ifndef C_BYTESTREAM_H
#define C_BYTESTREAM_H
#include "ByteListener.h"
#include "ByteProducer.h"
#include "ByteSubscription.h"
typedef struct ByteStream {
void (*add_listener) (struct ByteStream *self, ByteListener *listener);
void (*remove_listener) (struct ByteStream *self, ByteListener *listener);
void *(*s... | #ifndef C_BYTESTREAM_H
#define C_BYTESTREAM_H
#include "ByteListener.h"
#include "ByteProducer.h"
#include "ByteSubscription.h"
#include "ByteListenerInternal.h"
#include "ByteProducerInternal.h"
#include "VariableLengthArray.h"
typedef uint8_t Boolean;
typedef Byte (*byte_steam_map_function) (Byte value);
typedef B... |
Fix off-by-one error in C code | #include "gradient_decent.h"
void decend_cpu(int len, double rate, double momentum, double regulariser,
const double* weights,
const double* gradient,
const double* last,
double* outputWeights, double* outputMomentum) {
for (int i = 0; i <= len; i++) {
outputMomentum[i] = momentum * last[i] - ... | #include "gradient_decent.h"
void decend_cpu(int len, double rate, double momentum, double regulariser,
const double* weights,
const double* gradient,
const double* last,
double* outputWeights, double* outputMomentum) {
for (int i = 0; i < len; i++) {
outputMomentum[i] = momentum * last[i] - r... |
Add devtools trace events for Timeline EmbedderCallback notification | // 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 ANDROID_WEBVIEW_COMMON_DEVTOOLS_INSTRUMENTATION_H_
#define ANDROID_WEBVIEW_COMMON_DEVTOOLS_INSTRUMENTATION_H_
#include "base/debug/trace_event.h"... | // 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 ANDROID_WEBVIEW_COMMON_DEVTOOLS_INSTRUMENTATION_H_
#define ANDROID_WEBVIEW_COMMON_DEVTOOLS_INSTRUMENTATION_H_
#include "base/debug/trace_event.h"... |
Increment version number, since the new AHRS would break setting loading | #ifndef QGC_CONFIGURATION_H
#define QGC_CONFIGURATION_H
#include <QString>
/** @brief Polling interval in ms */
#define SERIAL_POLL_INTERVAL 9
/** @brief Heartbeat emission rate, in Hertz (times per second) */
#define MAVLINK_HEARTBEAT_DEFAULT_RATE 1
#define WITH_TEXT_TO_SPEECH 1
#define QGC_APPLICATION_NAME "QGrou... | #ifndef QGC_CONFIGURATION_H
#define QGC_CONFIGURATION_H
#include <QString>
/** @brief Polling interval in ms */
#define SERIAL_POLL_INTERVAL 9
/** @brief Heartbeat emission rate, in Hertz (times per second) */
#define MAVLINK_HEARTBEAT_DEFAULT_RATE 1
#define WITH_TEXT_TO_SPEECH 1
#define QGC_APPLICATION_NAME "QGrou... |
Fix clash in cpp tokens | #ifndef EXPR_TOK_H
#define EXPR_TOK_H
extern expr_n tok_cur_num;
extern enum tok
{
tok_ident = -1,
tok_num = -2,
tok_eof = 0,
tok_lparen = '(',
tok_rparen = ')',
/* operators returned as char-value,
* except for double-char ops
*/
/* binary */
tok_multiply = '*',
tok_divide = '/',
tok_modulus ... | #ifndef EXPR_TOK_H
#define EXPR_TOK_H
extern expr_n tok_cur_num;
extern enum tok
{
tok_ident = -1,
tok_num = -2,
tok_eof = 0,
tok_lparen = '(',
tok_rparen = ')',
/* operators returned as char-value,
* except for double-char ops
*/
/* binary */
tok_multiply = '*',
tok_divide = '/',
tok_modulus ... |
Fix wrong MIDR_EL1 value for Neoverse E1 | /*
* Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef NEOVERSE_E1_H
#define NEOVERSE_E1_H
#include <lib/utils_def.h>
#define NEOVERSE_E1_MIDR U(0x410FD060)
/**************************************************************************... | /*
* Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef NEOVERSE_E1_H
#define NEOVERSE_E1_H
#include <lib/utils_def.h>
#define NEOVERSE_E1_MIDR U(0x410FD4A0)
/**************************************************************************... |
Fix a wrong filename mentioned in a comment | //===-- interception_linux.h ------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===-- interception_linux.h ------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Add unit test for big clipboard device message | #include <assert.h>
#include <string.h>
#include "device_msg.h"
#include <stdio.h>
static void test_deserialize_clipboard(void) {
const unsigned char input[] = {
DEVICE_MSG_TYPE_CLIPBOARD,
0x00, 0x03, // text length
0x41, 0x42, 0x43, // "ABC"
};
struct device_msg msg;
ssize_t ... | #include <assert.h>
#include <string.h>
#include "device_msg.h"
#include <stdio.h>
static void test_deserialize_clipboard(void) {
const unsigned char input[] = {
DEVICE_MSG_TYPE_CLIPBOARD,
0x00, 0x03, // text length
0x41, 0x42, 0x43, // "ABC"
};
struct device_msg msg;
ssize_t... |
Clean skel for guest tuple iterator tests | #ifndef TEST_GUEST_TUPLE_ITERATOR_H
#define TEST_GUEST_TUPLE_ITERATOR_H
#include <cxxtest/TestSuite.h>
#include <unordered_set>
#include <vector>
#include "teams.h"
#include "guest_tuple_iterator.h"
class TestSeenTable : public CxxTest::TestSuite
{
private:
std::vector<mue::Team> make_testteams(int num)
{
st... | #ifndef TEST_GUEST_TUPLE_ITERATOR_H
#define TEST_GUEST_TUPLE_ITERATOR_H
#include <cxxtest/TestSuite.h>
#include <unordered_set>
#include <vector>
#include "teams.h"
#include "guest_tuple_iterator.h"
class TestSeenTable : public CxxTest::TestSuite
{
public:
void testFooBar(void)
{
}
};
#endif
|
Fix include from last checkin. | #ifdef sgi
#include <sys/fpu.h>
/*
THE FOLLOWING FUNCTION
sets the special "flush zero" but (FS, bit 24) in the
Control Status Register of the FPU of R4k and beyond
so that the result of any underflowing operation will
be clamped to zero, and no exception of any kind will
be generated on the CPU. This has no effect o... | #ifdef sgi
#include <sys/fpu.h>
/*
THE FOLLOWING FUNCTION
sets the special "flush zero" but (FS, bit 24) in the
Control Status Register of the FPU of R4k and beyond
so that the result of any underflowing operation will
be clamped to zero, and no exception of any kind will
be generated on the CPU. This has no effect o... |
Add test for non macro alike functions with paranthesis | /*
name: TEST061
description: Test for macros without arguments but with parenthesis
error:
output:
G3 I F "main
{
\
h #I1
}
*/
#define X (2)
#define L (0)
#define H (1)
#define Q(x) x
int
main(void)
{
return X == L + H + Q(1);
}
| |
Determine initial properties and functions | //
// JTFadingInfoViewController.h
// JTFadingInfoViewController
//
// Created by DCL_JT on 2015/07/29.
// Copyright (c) 2015年 Junichi Tsurukawa. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface JTFadingInfoViewController : UIViewController
@end
| //
// JTFadingInfoViewController.h
// JTFadingInfoViewController
//
// Created by DCL_JT on 2015/07/29.
// Copyright (c) 2015年 Junichi Tsurukawa. All rights reserved.
//
#import <UIKit/UIKit.h>
#pragma mark - Fade in/out options
typedef enum {
FadeInFromAbove = 1,
FadeInFromBelow,
FadeInFromLeft,
FadeInFr... |
Use offsetof() to compute the memory block header size. | /*
* pmpa_internals.h
* Part of pmpa
* Copyright (c) 2014 Philip Wernersbach
*
* Dual-Licensed under the Public Domain and the Unlicense.
* Choose the one that you prefer.
*/
#ifndef HAVE_PMPA_INTERNALS_H
#include <stdbool.h>
#include <pmpa.h>
typedef struct {
pmpa_memory_int size;
bool allocated;
char dat... | /*
* pmpa_internals.h
* Part of pmpa
* Copyright (c) 2014 Philip Wernersbach
*
* Dual-Licensed under the Public Domain and the Unlicense.
* Choose the one that you prefer.
*/
#ifndef HAVE_PMPA_INTERNALS_H
#include <stddef.h>
#include <stdbool.h>
#include <pmpa.h>
typedef struct {
pmpa_memory_int size;
bool ... |
Add header for Bmp custom type | #ifndef RCR_LEVEL1PAYLOAD_BMP180_H_
#define RCR_LEVEL1PAYLOAD_BMP180_H_
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
namespace rcr {
namespace level1payload {
} // namespace level1_payload
} // namespace rcr
#endif // RCR_LEVEL1PAYLOAD_BMP180_H_
| |
Add the missing nullability annotation | //
// MagicalImportFunctions.h
// Magical Record
//
// Created by Saul Mora on 3/7/12.
// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <MagicalRecord/MagicalRecordXcode7CompatibilityMacros.h>
NSDateFormatter * __MR_nonnull MR_dateFormatterWithFor... | //
// MagicalImportFunctions.h
// Magical Record
//
// Created by Saul Mora on 3/7/12.
// Copyright (c) 2012 Magical Panda Software LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <MagicalRecord/MagicalRecordXcode7CompatibilityMacros.h>
NSDateFormatter * __MR_nonnull MR_dateFormatterWithFor... |
Speed up default blink to disambiguate from default program on Sparkfun board. | #include <stdio.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include "esp_wifi.h"
#include "esp_system.h"
void app_main(void)
{
gpio_set_direction(GPIO_NUM_5, GPIO_MODE_OUTPUT);
int level = 0;
while (true) {
printf("Hello, world.\n");
gpio_set_level(GPIO_NUM_5, level);
... | #include <stdio.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include "esp_wifi.h"
#include "esp_system.h"
void app_main(void)
{
gpio_set_direction(GPIO_NUM_5, GPIO_MODE_OUTPUT);
int level = 0;
while (true) {
printf("Hello, world.\n");
gpio_set_level(GPIO_NUM_5, level);
... |
Check that @ arguments that aren't files are handled | // Make sure that arguments that begin with @ are left as is in the argument
// stream, and also that @file arguments continue to be processed.
// RUN: echo "%s -D FOO" > %t.args
// RUN: %clang -rpath @executable_path/../lib @%t.args -### 2>&1 | FileCheck %s
// CHECK: "-D" "FOO"
// CHECK: "-rpath" "@executable_path/..... | |
Add tests for land, takeoff, position control funs | #pragma once
#include <aerial_autonomy/actions_guards/base_functors.h>
#include <aerial_autonomy/logic_states/base_state.h>
#include <aerial_autonomy/robot_systems/uav_system.h>
#include <aerial_autonomy/basic_events.h>
#include <aerial_autonomy/types/completed_event.h>
#include <parsernode/common.h>
using namespace b... | #pragma once
#include <aerial_autonomy/actions_guards/base_functors.h>
#include <aerial_autonomy/logic_states/base_state.h>
#include <aerial_autonomy/robot_systems/uav_system.h>
#include <aerial_autonomy/basic_events.h>
#include <aerial_autonomy/types/completed_event.h>
#include <parsernode/common.h>
using namespace b... |
Correct error on previous commit. | /**
* Copyright 2017 Comcast Cable Communications Management, LLC
*
* 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 requir... | /**
* Copyright 2017 Comcast Cable Communications Management, LLC
*
* 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 requir... |
Add an example for simple loops | // PARAM: --enable dbg.debug --enable ana.int.interval
int main() {
int t1 = 0, t2 = 0;
int i;
for (i = 0; i < 5; i++) {
t1++;
t2--;
}
assert(t1 == i); //SUCCESS!
t1 = 5;
t2 = 5;
for (i = 5; i > 0; i--) {
t1++;
t2--;
}
assert(t2 == i); //SUCCESS!... | |
Copy dragImageView from bibdesk to skim | //
// BDSKDragImageView.h
// Bibdesk
//
// Created by Christiaan Hofman on 28/11/05.
/*
This software is Copyright (c) 2005,2006,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
are... | |
Add problematic example, bot in invariant | int main ()
{
int tmp;
int p_9 = 60;
tmp = (p_9 +1) % 0;
if ((p_9 +1) % 0) {
tmp = 1;
}
return (0);
}
| |
Use clock_gettime if have (linux/bsd but not apple) | /**
* Copyright (c) 2015, Chao Wang <hit9@icloud.com>
*/
#include <time.h>
#include <sys/time.h>
/* Get timestamp (in milliseconds) for now. */
double
datetime_stamp_now(void)
{
struct timeval tv;
gettimeofday(&tv, NULL);
return (1000000 * tv.tv_sec + tv.tv_usec) / 1000.0;
}
| /**
* Copyright (c) 2015, Chao Wang <hit9@icloud.com>
*/
#include <assert.h>
#include <time.h>
#include <sys/time.h>
/* Get timestamp (in milliseconds) for now. */
double
datetime_stamp_now(void)
{
#if defined CLOCK_REALTIME
struct timespec ts;
int rc = clock_gettime(CLOCK_REALTIME, &ts);
assert(rc == 0... |
Add newline at end of file | // 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.
// Common IPC messages used for child processes.
// Multiply-included message file, hence no include guard.
#include "googleurl/src/gurl.h"
#include ... | // 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.
// Common IPC messages used for child processes.
// Multiply-included message file, hence no include guard.
#include "googleurl/src/gurl.h"
#include ... |
Add bulk sync daemon back again | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2013 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... | |
Add documentation that Xcode can find | //
// MMMarkdown.h
// MMMarkdown
//
// Copyright (c) 2012 Matt Diephouse.
//
// 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... | //
// MMMarkdown.h
// MMMarkdown
//
// Copyright (c) 2012 Matt Diephouse.
//
// 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... |
Rename the custom assert name to reflect the underlying method | #import <Foundation/Foundation.h>
/**
Custom asserts that provide better error messages when the assert fails.
*/
/**
Assert that @p array contains @p object
*/
#define TDTXCTAssertContains(array, object) \
XCTAssertTrue([(array) containsObject:(object)], @"Expected %@ to contain %@", (array), (object))
/**
Ass... | #import <Foundation/Foundation.h>
/**
Custom asserts that provide better error messages when the assert fails.
*/
/**
Assert that @p array contains @p object
*/
#define TDTXCTAssertContains(array, object) \
XCTAssertTrue([(array) containsObject:(object)], @"Expected %@ to contain %@", (array), (object))
/**
Ass... |
Use spaces instead of tabs | #include <pal.h>
/**
*
* Element wise inversion (reciprocal) of elements in 'a'.
*
* @param a Pointer to input vector
*
* @param c Pointer to output vector
*
* @param n Size of 'a' and 'c' vector.
*
* @param p Number of processor to use (task parallelism)
*
* @param team Team to work with ... | #include <pal.h>
/**
*
* Element wise inversion (reciprocal) of elements in 'a'.
*
* @param a Pointer to input vector
*
* @param c Pointer to output vector
*
* @param n Size of 'a' and 'c' vector.
*
* @param p Number of processor to use (task parallelism)
*
* @param team Team to work with ... |
Add header file for public interface | #ifndef ORVIBO_H
#define ORVIBO_H
#include <net/ethernet.h>
#include <stdbool.h>
enum orvibo_event {
ORVIBO_EVENT_DISCOVER,
ORVIBO_EVENT_SUBSCRIBE,
ORVIBO_EVENT_UNSUBSCRIBE,
ORVIBO_EVENT_OFF,
ORVIBO_EVENT_ON
};
enum orvibo_state {
ORVIBO_STATE_UNKNOWN,
ORVIBO_STATE_OFF,
ORVIBO_STATE_O... | |
Add license header to private file manager header | #import "SPTPersistentCacheFileManager.h"
#import <SPTPersistentCache/SPTPersistentCacheOptions.h>
NS_ASSUME_NONNULL_BEGIN
/// Private interface exposed for testability.
@interface SPTPersistentCacheFileManager ()
@property (nonatomic, copy, readonly) SPTPersistentCacheOptions *options;
@property (nonatomic, copy, r... | /*
* Copyright (c) 2016 Spotify AB.
*
* 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,... |
Add missing test case from D41171 commit | // RUN: %libomp-compile-and-run | FileCheck %s
// REQUIRES: ompt
#include "callback.h"
#include <omp.h>
int main()
{
#pragma omp parallel num_threads(1)
{
}
ompt_set_callback(ompt_callback_parallel_begin, NULL);
#pragma omp parallel num_threads(1)
{
}
// Check if libomp supports the callbacks for th... | |
Use DataTypes.h instead of stdint.h. | //===- llvm/System/Atomic.h - Atomic Operations -----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===- llvm/System/Atomic.h - Atomic Operations -----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Transform the fortran result of this executable to free form. | /* Auxiliary program: write the include file for determining
PLplot's floating-point type
*/
#include <stdio.h>
#include <stdlib.h>
#include "plConfig.h"
main(int argc, char *argv[] )
{
FILE *outfile;
char *kind;
outfile = fopen( "plflt.inc", "w" ) ;
#ifdef PL_DOUBLE
kind = "1.0d0";
#else
kind = "1... | /* Auxiliary program: write the include file for determining
PLplot's floating-point type
*/
#include <stdio.h>
#include <stdlib.h>
#include "plConfig.h"
main(int argc, char *argv[] )
{
FILE *outfile;
char *kind;
outfile = fopen( "plflt.inc", "w" ) ;
#ifdef PL_DOUBLE
kind = "1.0d0";
#else
kind = "1... |
Add Cytron Maker Zero SAMD21 | #define MICROPY_HW_BOARD_NAME "Cytron Maker Zero SAMD21"
#define MICROPY_HW_MCU_NAME "samd21g18"
#define MICROPY_HW_LED_TX &pin_PA27
#define MICROPY_HW_LED_RX &pin_PB03
#define DEFAULT_I2C_BUS_SCL (&pin_PA23)
#define DEFAULT_I2C_BUS_SDA (&pin_PA22)
#define DEFAULT_SPI_BUS_SCK (&pin_PB11)
#define DEFAULT_SPI_BUS_... | |
Test long size and timeval to long conversion | #include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
int main(int argc, char **argv) {
struct timeval tv;
struct timezone tz;
struct tm *tm;
gettimeofday(&tv, &tz);
tm = localtime(&tv.tv_sec);
char timestr[128];
size_... | #include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include "../../bluez-5.28/lib/bluetooth.h"
int main(int argc, char **argv) {
struct timeval tv;
struct timezone tz;
struct tm *tm;
gettimeofday(&tv, &tz);
tm = localtime(&t... |
Add comment to explicitly identify Chain of Responsibility | //
// OCHamcrest - HCReturnTypeHandler.h
// Copyright 2014 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//
#import <Foundation/Foundation.h>
@interface HCReturnTypeHandler : N... | //
// OCHamcrest - HCReturnTypeHandler.h
// Copyright 2014 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//
#import <Foundation/Foundation.h>
/**
Chain-of-responsibility for h... |
Move include within include guards. | /**
* For conditions of distribution and use, see copyright notice in license.txt
*
* @file WorldLogicInterface.h
* @brief
*/
#include "ServiceInterface.h"
#ifndef incl_Interfaces_WorldLogicInterface_h
#define incl_Interfaces_WorldLogicInterface_h
#include "ForwardDefines.h"
#include <QObject>
class QS... | /**
* For conditions of distribution and use, see copyright notice in license.txt
*
* @file WorldLogicInterface.h
* @brief
*/
#ifndef incl_Interfaces_WorldLogicInterface_h
#define incl_Interfaces_WorldLogicInterface_h
#include "ServiceInterface.h"
#include "ForwardDefines.h"
#include <QObject>
class QSt... |
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... |
Save value history as circular array, print function for debug | // stdio for file I/O
#include <stdio.h>
int main(int argc, char *argv[]) {
int status = 1;
float value;
while(status != EOF) {
status = fscanf(stdin, "%f\n", &value);
if(status == 1)
fprintf(stdout, "%f\n", value);
else
fprintf(stdout, "Error reading data (%d)\n", status);
}
}
| // stdio for file I/O
#include <stdio.h>
#define HISTORY_SIZE 5
void print_values(float *values, int current_i) {
// Print values to stdout, starting from one after newest (oldest) and
// circle around to newest
int i = current_i;
for(i = current_i; i < current_i + HISTORY_SIZE; i++) {
fprintf(stdout, "%.... |
Join is a safe filter. | /*
Copyright (c) 2009 Stephen Kelly <steveire@gmail.com>
*/
#ifndef JOINFILTER_H
#define JOINFILTER_H
#include "filter.h"
using namespace Grantlee;
class GRANTLEE_EXPORT JoinFilter : public Filter
{
Q_OBJECT
public:
JoinFilter(QObject *parent = 0);
Grantlee::SafeString doFilter(const QVariant &input, con... | /*
Copyright (c) 2009 Stephen Kelly <steveire@gmail.com>
*/
#ifndef JOINFILTER_H
#define JOINFILTER_H
#include "filter.h"
using namespace Grantlee;
class GRANTLEE_EXPORT JoinFilter : public Filter
{
Q_OBJECT
public:
JoinFilter(QObject *parent = 0);
Grantlee::SafeString doFilter(const QVariant &input, con... |
Adjust the comment on get_order() to describe the size==0 case | #ifndef __ASM_GENERIC_GETORDER_H
#define __ASM_GENERIC_GETORDER_H
#ifndef __ASSEMBLY__
#include <linux/compiler.h>
/* Pure 2^n version of get_order */
static inline __attribute_const__ int get_order(unsigned long size)
{
int order;
size = (size - 1) >> (PAGE_SHIFT - 1);
order = -1;
do {
size >>= 1;
order++;... | #ifndef __ASM_GENERIC_GETORDER_H
#define __ASM_GENERIC_GETORDER_H
#ifndef __ASSEMBLY__
#include <linux/compiler.h>
/**
* get_order - Determine the allocation order of a memory size
* @size: The size for which to get the order
*
* Determine the allocation order of a particular sized block of memory. This
* is o... |
Test commit in master4 branch | file4.c - r1
Test checkin in master1-updated
Test checkin in master2
| file4.c - r1
Test checkin in master1-updated - updated_by_master
Test checkin in master2
Test checkin in master3
Test checkin in master4
|
Disable board.SPI() for Challenger NB RP2040 WiFi | #define MICROPY_HW_BOARD_NAME "Challenger NB RP2040 WiFi"
#define MICROPY_HW_MCU_NAME "rp2040"
#define DEFAULT_UART_BUS_TX (&pin_GPIO16)
#define DEFAULT_UART_BUS_RX (&pin_GPIO17)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO0)
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO1)
#define DEFAULT_SPI_BUS_SCK (&pin_GPIO22)
#defin... | #define MICROPY_HW_BOARD_NAME "Challenger NB RP2040 WiFi"
#define MICROPY_HW_MCU_NAME "rp2040"
#define DEFAULT_UART_BUS_TX (&pin_GPIO16)
#define DEFAULT_UART_BUS_RX (&pin_GPIO17)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO0)
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO1)
|
Make it so that stdin/stdout/stderr will be set as line buffered (newlib has to think they're ttys if we have fcntl, which we do now). | /* KallistiOS ##version##
newlib_isatty.c
Copyright (C)2004 Dan Potter
*/
#include <sys/reent.h>
int isatty(int fd) {
return 0;
}
int _isatty_r(struct _reent *reent, int fd) {
return 0;
}
| /* KallistiOS ##version##
newlib_isatty.c
Copyright (C) 2004 Dan Potter
Copyright (C) 2012 Lawrence Sebald
*/
#include <sys/reent.h>
int isatty(int fd) {
/* Make sure that stdin, stdout, and stderr are shown as ttys, otherwise
they won't be set as line-buffered. */
if(fd >= 0 && fd <= 2) {
... |
Simplify a bit as special treatment is no longer needed for HPUX. | #ifndef TIMEVAL_H
#define TIMEVAL_H
#if defined(ULTRIX42) || defined(ULTRIX43) || defined(HPUX9)
#if !defined(_ALL_SOURCE)
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
};
struct itimerval {
struct timeval it_interval; /* timer interval */
struct timeval ... | #ifndef TIMEVAL_H
#define TIMEVAL_H
#if defined(ULTRIX43) && !defined(_ALL_SOURCE)
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
};
struct itimerval {
struct timeval it_interval; /* timer interval */
struct timeval it_value; /* current value */
};
#el... |
Add function prototype for setting current geometry. Rename function prototype for grid virtual size set. | #ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
# define E_SMART_MONITOR_H
Evas_Object *e_smart_monitor_add(Evas *evas);
void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch);
void e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Ra... | #ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
# define E_SMART_MONITOR_H
Evas_Object *e_smart_monitor_add(Evas *evas);
void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch);
void e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Ra... |
Fix ecommerce methods to take properties dictionary | //
// SEGEcommerce.h
// Analytics
//
// Created by Travis Jeffery on 7/17/14.
// Copyright (c) 2014 Segment.io. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol SEGEcommerce <NSObject>
- (void)viewedProduct;
- (void)removedProduct;
- (void)addedProduct;
- (void)completedOrder;
@end
| //
// SEGEcommerce.h
// Analytics
//
// Created by Travis Jeffery on 7/17/14.
// Copyright (c) 2014 Segment.io. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol SEGEcommerce <NSObject>
@optional
- (void)viewedProduct:(NSDictionary *)properties;
- (void)removedProduct:(NSDictionary *)properties;... |
Add NaN/Inf check for low-pass filter. | // Copyright (c) 2017 Franka Emika GmbH
// Use of this source code is governed by the Apache-2.0 license, see LICENSE
#pragma once
#include <cmath>
/**
* @file lowpass_filter.h
* Contains functions for filtering signals with a low-pass filter.
*/
namespace franka {
/**
* Maximum cutoff frequency
*/
constexpr do... | // Copyright (c) 2017 Franka Emika GmbH
// Use of this source code is governed by the Apache-2.0 license, see LICENSE
#pragma once
#include <cmath>
/**
* @file lowpass_filter.h
* Contains functions for filtering signals with a low-pass filter.
*/
namespace franka {
/**
* Maximum cutoff frequency
*/
constexpr do... |
Add xhtml-im and w3c xhtml namespace |
#define GIBBER_XMPP_NS_STREAM \
(const gchar *)"http://etherx.jabber.org/streams"
#define GIBBER_XMPP_NS_TLS \
(const gchar *)"urn:ietf:params:xml:ns:xmpp-tls"
#define GIBBER_XMPP_NS_SASL_AUTH \
(const gchar *)"urn:ietf:params:xml:ns:xmpp-sasl"
|
#define GIBBER_XMPP_NS_STREAM \
(const gchar *)"http://etherx.jabber.org/streams"
#define GIBBER_XMPP_NS_TLS \
(const gchar *)"urn:ietf:params:xml:ns:xmpp-tls"
#define GIBBER_XMPP_NS_SASL_AUTH \
(const gchar *)"urn:ietf:params:xml:ns:xmpp-sasl"
#define GIBBER_XMPP_NS_XHTML_IM \
(const gchar *)"http://jabber... |
Add test for octApron combine forgetting return assign in function | // SKIP PARAM: --sets ana.activated[+] octApron
#include <assert.h>
int f(int x) {
return x + 1;
}
int main(void) {
int y = 42;
y = f(y);
// combine should forget callee's y after substituting arg vars with args to avoid bottom in #ret substitute
assert(y);
return 0;
}
| |
Update files, Alura, Introdução a C - Parte 2, Aula 2.6 | #include <stdio.h>
#include <string.h>
int main() {
char palavrasecreta[20];
sprintf(palavrasecreta, "MELANCIA");
int acertou = 0;
int enforcou = 0;
char chutes[26];
int tentativas = 0;
do {
for(int i = 0; i < strlen(palavrasecreta); i++) {
int achou = 0;
for(int j = 0; j < tentati... | #include <stdio.h>
#include <string.h>
int main() {
char palavrasecreta[20];
sprintf(palavrasecreta, "MELANCIA");
int acertou = 0;
int enforcou = 0;
char chutes[26];
int tentativas = 0;
do {
for(int i = 0; i < strlen(palavrasecreta); i++) {
int achou = 0;
for(int j = 0; j < tentati... |
Change for new config system | /*===========================================================================*
| fpbasis.c
| Copyright (c) 1996-97 Applied Logic Systems, Inc.
|
| -- Floating point math abstractions
|
*===========================================================================*/
#include "defs.h"
#include ... | /*===========================================================================*
| fpbasis.c
| Copyright (c) 1996-97 Applied Logic Systems, Inc.
|
| -- Floating point math abstractions
|
*===========================================================================*/
#include "defs.h"
#include ... |
Add while loop examples, really | /*
* Author: Jhonatan Casale (jhc)
*
* Contact : jhonatan@jhonatancasale.com
* : casale.jhon@gmail.com
* : https://github.com/jhonatancasale
* : https://twitter.com/jhonatancasale
* : http://jhonatancasale.github.io/
*
* Create date Wed 1 Mar 01:51:51 BRT 2017
*
*/
#include ... | |
Make chrome use the static square vb when drawing rects. | #ifndef GrGLConfig_chrome_DEFINED
#define GrGLConfig_chrome_DEFINED
#define GR_SUPPORT_GLES2 1
// gl2ext.h will define these extensions macros but Chrome doesn't provide
// prototypes.
#define GL_OES_mapbuffer 0
#define GL_IMG_multisampled_render_to_texture 0
#include <GLES2/gl2.h>
#include <... | #ifndef GrGLConfig_chrome_DEFINED
#define GrGLConfig_chrome_DEFINED
#define GR_SUPPORT_GLES2 1
// gl2ext.h will define these extensions macros but Chrome doesn't provide
// prototypes.
#define GL_OES_mapbuffer 0
#define GL_IMG_multisampled_render_to_texture 0
#include <GLES2/gl2.h>
#include <... |
Add persistent history to shell | #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include "linenoise.h"
char* findPrompt();
void executeCommand(const char *text);
int main() {
int childPid;
int child_status;
char *line;
char *prompt;
prompt = findPrompt();
while((line = linenoise(prompt)) != NULL) {
i... | #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <sys/param.h>
#include "linenoise.h"
#define HISTORY_FILE ".beaksh_history"
char* findPrompt();
char* getHistoryPath();
void executeCommand(const char *text);
int main() {
int childPid;
int child_status;
char *line;
char ... |
Add a shooter program, and speed reader. | #pragma config(Sensor, dgtl4, LeftEncoder, sensorQuadEncoder)
#pragma config(Sensor, dgtl11, RightEncoder, sensorQuadEncoder)
#pragma config(Motor, port8, Shooter8, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port9, Shooter9, tmotorVex393_MC29, openLoop, reversed)
//*!!Code ... | |
Change type creation from define to typedef. | #ifndef __TOURH__
#define __TOURH__
#include <stdio.h>
#include <stdlib.h>
#define tour int*
#define city int
//initializes a new tour
tour create_tour(int ncities);
//returns true if the tour t is shorter than
//a distance indicated by dist
int is_shtr(tour t, int dist);
//defines the starter point of a tour
voi... | #ifndef __TOURH__
#define __TOURH__
#include <stdio.h>
#include <stdlib.h>
typedef int* tour;
typedef int city;
//inicializa um tour
tour create_tour(int ncities);
//popula um tour pre-definido com cidades
void populate_tour(tour t, int ncities);
//retorna true se a distancia total do
//tour t for menor que dist
i... |
Add prototypes for popen()/pclose() for OSF1 machines. | #ifndef FIX_STDIO_H
#define FIX_STDIO_H
#include <stdio.h>
/*
For some reason the stdio.h on Ultrix 4.3 fails to provide a prototype
for pclose() if _POSIX_SOURCE is defined - even though it does
provide a prototype for popen().
*/
#if defined(ULTRIX43)
#if defined(__cplusplus)
extern "C" {
#endif
#if define... | #ifndef FIX_STDIO_H
#define FIX_STDIO_H
#include <stdio.h>
#if defined(__cplusplus)
extern "C" {
#endif
/*
For some reason the stdio.h on OSF1 fails to provide prototypes
for popen() and pclose() if _POSIX_SOURCE is defined.
*/
#if defined(OSF1)
#if defined(__STDC__) || defined(__cplusplus)
FILE *popen( char ... |
Support wu-ftpd-like chrooting in /etc/passwd. If home directory ends with "/./", it's chrooted to. | /* Copyright (C) 2002-2003 Timo Sirainen */
#include "config.h"
#undef HAVE_CONFIG_H
#ifdef USERDB_PASSWD
#include "common.h"
#include "userdb.h"
#include <pwd.h>
static void passwd_lookup(const char *user, userdb_callback_t *callback,
void *context)
{
struct user_data data;
struct passwd *pw;
pw = getpwn... | /* Copyright (C) 2002-2003 Timo Sirainen */
#include "config.h"
#undef HAVE_CONFIG_H
#ifdef USERDB_PASSWD
#include "common.h"
#include "userdb.h"
#include <pwd.h>
static void passwd_lookup(const char *user, userdb_callback_t *callback,
void *context)
{
struct user_data data;
struct passwd *pw;
size_t len;
... |
Add exceptions parsing (not tested yet) | #include "master.h"
//Master configurations
MODBUSMasterStatus MODBUSMaster;
void MODBUSParseResponse( uint8_t *Frame, uint8_t FrameLength )
{
//This function parses response from master
//Calling it will lead to losing all data and exceptions stored in MODBUSMaster (space will be reallocated)
//Allocate memory f... | #include "master.h"
//Master configurations
MODBUSMasterStatus MODBUSMaster;
void MODBUSParseException( union MODBUSParser *Parser )
{
//Parse exception frame and write data to MODBUSMaster structure
//Allocate memory for exception parser
union MODBUSException *Exception = malloc( sizeof( union MODBUSException ) ... |
Use updated mavlink library v2 | //Move this directory to ~/sketchbook/libraries
// and clone https://github.com/mavlink/c_library.git inside
// git clone https://github.com/mavlink/c_library.git ~/sketchbook/libraries/MavlinkForArduino
#include "c_library/ardupilotmega/mavlink.h"
| //Move this directory to ~/sketchbook/libraries
// and clone https://github.com/mavlink/c_library_v2.git inside
// git clone https://github.com/mavlink/c_library_V2.git ~/Arduino/libraries/MavlinkForArduino/c_library_v2
#include "c_library_v2/ardupilotmega/mavlink.h"
|
Use the correct definition for memset. | // RUN: %clang_cc1 %s -emit-llvm -o - | grep llvm.memset | count 3
#ifndef memset
void *memset(void*, int, unsigned long);
#endif
#ifndef bzero
void bzero(void*, unsigned long);
#endif
void test(int* X, char *Y) {
// CHECK: call i8* llvm.memset
memset(X, 4, 1000);
// CHECK: call void bzero
bzero(Y, 100);
}
| // RUN: %clang_cc1 %s -emit-llvm -o - | grep llvm.memset | count 3
typedef __SIZE_TYPE__ size_t;
void *memset(void*, int, size_t);
void bzero(void*, size_t);
void test(int* X, char *Y) {
// CHECK: call i8* llvm.memset
memset(X, 4, 1000);
// CHECK: call void bzero
bzero(Y, 100);
}
|
Resolve q3 (pythonic way? so close) | #include <stdio.h>
int ssearch(int number, int target){
if (number == 0)
if (target == 0) return 1;
else return 0;
else
return ssearch(number/10, target) + (number % 10 == target);
}
int main(){
printf("%d\n", ssearch(762021192, 2));
return 0;
}
| |
Use quotes for local include | //
// VOKAlertHelper.h
// VOKUtilities
//
// Created by Rachel Hyman on 6/15/15.
// Copyright (c) 2015 Vokal. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <VOKAlertAction.h>
typedef void(^VOKAlertHelperActionBlock)(void);
NS_ASSUME_NONNULL_BEGIN
@interface VOKAlertHelper : NSObject
/**
* Displays... | //
// VOKAlertHelper.h
// VOKUtilities
//
// Created by Rachel Hyman on 6/15/15.
// Copyright (c) 2015 Vokal. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "VOKAlertAction.h"
typedef void(^VOKAlertHelperActionBlock)(void);
NS_ASSUME_NONNULL_BEGIN
@interface VOKAlertHelper : NSObject
/**
* Displays... |
Update disambiguation VC base class | #import "WMFArticleListTableViewController.h"
@interface WMFDisambiguationPagesViewController : WMFArticleListTableViewController
@property (nonatomic, strong, readonly) MWKArticle* article;
- (instancetype)initWithArticle:(MWKArticle*)article dataStore:(MWKDataStore*)dataStore;
@end
| #import "WMFArticleListDataSourceTableViewController.h"
@interface WMFDisambiguationPagesViewController : WMFArticleListDataSourceTableViewController
@property (nonatomic, strong, readonly) MWKArticle* article;
- (instancetype)initWithArticle:(MWKArticle*)article dataStore:(MWKDataStore*)dataStore;
@end
|
Use uint8_t and uint32_t in SHA-1 implementation. | /***************************************************************************/
/* sha.h */
/* */
/* SHA-1 code header file. */
/* Taken from the public domain implementation by Peter C. Gutmann */
/* on 2 Sep 1992, modified by Carl Ellison to be SHA-1. */
/***************************... | /***************************************************************************/
/* sha.h */
/* */
/* SHA-1 code header file. */
/* Taken from the public domain implementation by Peter C. Gutmann */
/* on 2 Sep 1992, modified by Carl Ellison to be SHA-1. */
/***************************... |
Use stdint.h instead of cstdint | #pragma once
#include <cstdint>
#include <string>
class SystemError
{
public:
SystemError(int errorno, const std::string& syscall, const std::string& message, const std::string& path)
: m_errorno(errorno), m_syscall(syscall), m_message(message), m_path(path)
{}
int errorno() const { return m_erro... | #pragma once
#include <stdint.h>
#include <string>
class SystemError
{
public:
SystemError(int errorno, const std::string& syscall, const std::string& message, const std::string& path)
: m_errorno(errorno), m_syscall(syscall), m_message(message), m_path(path)
{}
int errorno() const { return m_err... |
Include <assert.h> to prevent linking error (unknown symbol 'assert'). | #include <ucontext.h>
#include "x86-decoder.h"
#include "unwind.h"
void
unw_init_arch(void)
{
x86_family_decoder_init();
}
void
unw_init_cursor_arch(ucontext_t* context, unw_cursor_t *cursor)
{
mcontext_t * mctxt = &(context->uc_mcontext);
#ifdef __CRAYXT_CATAMOUNT_TARGET
cursor->pc = (void *) mctxt->sc_ri... | #include <ucontext.h>
#include <assert.h>
#include "x86-decoder.h"
#include "unwind.h"
void
unw_init_arch(void)
{
x86_family_decoder_init();
}
void
unw_init_cursor_arch(ucontext_t* context, unw_cursor_t *cursor)
{
mcontext_t * mctxt = &(context->uc_mcontext);
#ifdef __CRAYXT_CATAMOUNT_TARGET
cursor->pc = (v... |
Remove unused protocol conformance from sample | #import <UIKit/UIKit.h>
@interface ViewController : UIViewController <UIAlertViewDelegate, UIActionSheetDelegate>
@property (nonatomic, strong) Class alertControllerClass;
@property (nonatomic, strong) IBOutlet UIButton *showAlertButton;
@property (nonatomic, strong) IBOutlet UIButton *showActionSheetButton;
@propert... | #import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (nonatomic, strong) Class alertControllerClass;
@property (nonatomic, strong) IBOutlet UIButton *showAlertButton;
@property (nonatomic, strong) IBOutlet UIButton *showActionSheetButton;
@property (nonatomic, assign) BOOL alertDefaultAction... |
Use boost::move rather than std::move which seems to hate some versions ofr G++ | #ifndef FUTURE_H_INCLUDED
#define FUTURE_H_INCLUDED
#include <boost/thread/thread.hpp>
#include <boost/thread/future.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/utility/result_of.hpp>
namespace thread {
template<typename Func>
boost::shared_future<typename boost::result_of<Func()>::type> submit_task(Func ... | #ifndef FUTURE_H_INCLUDED
#define FUTURE_H_INCLUDED
#include <boost/thread/thread.hpp>
#include <boost/thread/future.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/utility/result_of.hpp>
namespace thread {
template<typename Func>
boost::shared_future<typename boost::result_of<Func()>::type> submit_t... |
Fix test case and convert fully to FileCheck. | // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
int g();
int foo(int i) {
return g(i);
}
int g(int i) {
return g(i);
}
// rdar://6110827
typedef void T(void);
void test3(T f) {
f();
}
int a(int);
int a() {return 1;}
// RUN: grep 'define void @f0()' %t
void f0() {}
void f1();
// RUN: grep 'call void @f... | // RUN: %clang_cc1 %s -emit-llvm -o - -verify | FileCheck %s
int g();
int foo(int i) {
return g(i);
}
int g(int i) {
return g(i);
}
// rdar://6110827
typedef void T(void);
void test3(T f) {
f();
}
int a(int);
int a() {return 1;}
void f0() {}
// CHECK: define void @f0()
void f1();
void f2(void) {
// CHECK: ... |
Fix error() if srcLoc.file is null or !srcLoc.isValid() | #pragma once
#include <fstream>
#include <llvm/ADT/StringRef.h>
inline std::ostream& operator<<(std::ostream& stream, llvm::StringRef string) {
return stream.write(string.data(), string.size());
}
template<typename... Args>
[[noreturn]] inline void error(SrcLoc srcLoc, Args&&... args) {
std::cout << srcLoc.f... | #pragma once
#include <fstream>
#include <llvm/ADT/StringRef.h>
inline std::ostream& operator<<(std::ostream& stream, llvm::StringRef string) {
return stream.write(string.data(), string.size());
}
template<typename... Args>
[[noreturn]] inline void error(SrcLoc srcLoc, Args&&... args) {
if (srcLoc.file) {
... |
Convert to pragma once in test functions | #ifndef MMSTESTFUNC_H
#define MMSTESTFUNC_H
#include "Function.h"
#include "FunctionInterface.h"
class MMSTestFunc;
template <>
InputParameters validParams<MMSTestFunc>();
/**
* Function of RHS for manufactured solution in spatial_constant_helmholtz test
*/
class MMSTestFunc : public Function, public FunctionInt... | #pragma once
#include "Function.h"
#include "FunctionInterface.h"
class MMSTestFunc;
template <>
InputParameters validParams<MMSTestFunc>();
/**
* Function of RHS for manufactured solution in spatial_constant_helmholtz test
*/
class MMSTestFunc : public Function, public FunctionInterface
{
public:
MMSTestFunc(... |
Make MinimumUsedBitsTracker thread safe for both reads and writes | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <algorithm>
#include <vespa/document/bucket/bucketid.h>
namespace storage {
/**
* Utility class for keeping track of the lowest used bits count seen
* across a set of buckets.
*
* Not th... | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/document/bucket/bucketid.h>
#include <atomic>
namespace storage {
/**
* Utility class for keeping track of the lowest used bits count seen
* across a set of buckets.
*
* Thread sa... |
Add step for each player on choose your cat scene |
#include "debug.h"
#include "input.h"
#include "scene.h"
#include "sound.h"
#include "controller.h"
#include "controllers/chooseyourcat.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
NEW_CONTROLLER(ChooseYourCat);
static void p1_confirm() {
Sound_playSE(FX_SELECT);
Scene_close();
Scene_l... |
#include "debug.h"
#include "input.h"
#include "scene.h"
#include "sound.h"
#include "controller.h"
#include "scenes/chooseyourcat.h"
#include "controllers/chooseyourcat.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
static int P1_HAS_CHOSEN = false;
/* false -> P1 escolhe o gato;
true -> P2 esc... |
Add c version of trackerstate example | /** @file
@brief Implementation
@date 2014
@author
Ryan Pavlik
<ryan@sensics.com>
<http://sensics.com>
*/
/*
// Copyright 2014 Sensics, Inc.
//
// All rights reserved.
//
// (Final version intended to be licensed under
// the Apache License, Version 2.0)
*/
/* Internal Includes */
#include <... | |
Add a testcase for svn r129964 (Neon load/store intrinsic alignments). | // RUN: %clang_cc1 -triple thumbv7-apple-darwin \
// RUN: -target-abi apcs-gnu \
// RUN: -target-cpu cortex-a8 \
// RUN: -mfloat-abi soft \
// RUN: -target-feature +soft-float-abi \
// RUN: -ffreestanding \
// RUN: -emit-llvm -w -o - %s | FileCheck %s
#include <arm_neon.h>
// Radar 9311427: Check that ali... | |
Declare PPB_Core as a struct, not a class. (Prevents Clang warning) | // Copyright 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 NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_CORE_H_
#define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_CORE_H_
#include "native_client/src/inclu... | // 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 NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_CORE_H_
#define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_CORE_H_
#include "native_client/src/i... |
Fix C solution for Problem039 | #include <stdio.h>
#define MAX 1000
int main() {
int i, j, k, maxP;
int ps[1001];
for(i = 1; i <= MAX; i++) {
for(j = i;j <= MAX; j++) {
for(k = j; (k * k) < (i * i + j * j); k++);
if((i * i + j * j) == (k * k) && (i + j + k) <= MAX) {
ps[i+j+k]++;
... | #include <stdio.h>
#define MAX 1000
int main() {
int i, j , k, maxP = 1;
int ps[1001];
for (i=0; i <= MAX; ps[++i] =0);
for(i = 1; i <= MAX; i++) {
for(j = i;j <= MAX; j++) {
for(k = j; (k * k) < (i * i + j * j); k++);
if((i * i + j * j) == (k * k) && (i + j + k) <= MA... |
Fix typo in step function comment | {% import "common_macros.inc.c" as util with context -%}
{% set stepfun = g.stepFunctions[targetStep] -%}
#include "{{g.name}}.h"
/**
* Step function defintion for "{{stepfun.collName}}"
*/
void {{util.qualified_step_name(stepfun)}}({{ util.print_tag(stepfun.tag, typed=True)
}}{{ util.print_bindings(stepfun... | {% import "common_macros.inc.c" as util with context -%}
{% set stepfun = g.stepFunctions[targetStep] -%}
#include "{{g.name}}.h"
/**
* Step function definition for "{{stepfun.collName}}"
*/
void {{util.qualified_step_name(stepfun)}}({{ util.print_tag(stepfun.tag, typed=True)
}}{{ util.print_bindings(stepfu... |
Mark _slave_entry to never return | /*
* Copyright (c) 2012-2016
* See LICENSE for details.
*
* Israel Jacquez <mrkotfw@gmail.com
*/
#include <sys/cdefs.h>
#include <smpc/smc.h>
#include <cpu/instructions.h>
#include <cpu/frt.h>
#include <cpu/intc.h>
#include <cpu/map.h>
#include <cpu/slave.h>
static void _slave_entry(void);
static void _default... | /*
* Copyright (c) 2012-2016
* See LICENSE for details.
*
* Israel Jacquez <mrkotfw@gmail.com
*/
#include <sys/cdefs.h>
#include <smpc/smc.h>
#include <cpu/instructions.h>
#include <cpu/frt.h>
#include <cpu/intc.h>
#include <cpu/map.h>
#include <cpu/slave.h>
static void _slave_entry(void);
static void _defaul... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.