Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Comment a wacky test case | // RUN: %clang_cc1 -triple i386-unknown-unknown %s -O3 -emit-llvm -o - | grep 'ret i32 6'
// RUN: %clang_cc1 -triple i386-unknown-unknown -x c++ %s -O3 -emit-llvm -o - | grep 'ret i32 7'
static enum { foo, bar = 1U } z;
int main (void)
{
int r = 0;
if (bar - 2 < 0)
r += 4;
if (foo - 1 < 0)
r += 2;
if... | // RUN: %clang_cc1 -triple i386-unknown-unknown %s -O3 -emit-llvm -o - | grep 'ret i32 6'
// RUN: %clang_cc1 -triple i386-unknown-unknown -x c++ %s -O3 -emit-llvm -o - | grep 'ret i32 7'
// This test case illustrates a peculiarity of the promotion of
// enumeration types in C and C++. In particular, the enumeration ty... |
Fix compile error with -Werror | /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2013 Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* ht... | /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2013 Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* ht... |
Remove useless forward declaration of FunctionInfo | // AMX profiler for SA-MP server: http://sa-mp.com
//
// Copyright (C) 2011-2012 Sergey Zolotarev
//
// 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/l... | // AMX profiler for SA-MP server: http://sa-mp.com
//
// Copyright (C) 2011-2012 Sergey Zolotarev
//
// 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/l... |
Include fstream for file reading and such. | #pragma once
#include <unistd.h>
#include <iostream>
#include <list>
#include <map>
#include <mutex>
#include <unordered_map>
#include <queue>
#include <sstream>
#include <set>
#include <thread>
#include <tuple>
#include <vector> | #pragma once
#include <unistd.h>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <mutex>
#include <unordered_map>
#include <queue>
#include <sstream>
#include <set>
#include <thread>
#include <tuple>
#include <vector> |
Remove unused ioctls and unused structure | /*
* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
* Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU General Public Licen... | /*
* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
* Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU General Public Licen... |
Check if osKernelStart() is called from ISR | /*
* Copyright (c) 2018 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <kernel_structs.h>
#include <cmsis_os.h>
#include <ksched.h>
extern const k_tid_t _main_thread;
/**
* @brief Get the RTOS kernel system timer counter
*/
uint32_t osKernelSysTick(void)
{
return k_cycle_get_32();
}
/*... | /*
* Copyright (c) 2018 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <kernel_structs.h>
#include <cmsis_os.h>
#include <ksched.h>
extern const k_tid_t _main_thread;
/**
* @brief Get the RTOS kernel system timer counter
*/
uint32_t osKernelSysTick(void)
{
return k_cycle_get_32();
}
/*... |
Add MIN and MAX macros. | #ifndef UTILS_H
#define UTILS_H
#include <curses.h>
#include <stdint.h>
void color_str(WINDOW *, uint32_t, uint32_t, int16_t, int16_t, const char *);
void init_seed_srand(void);
#endif /* UTILS_H */
| #ifndef UTILS_H
#define UTILS_H
#include <curses.h>
#include <stdint.h>
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
void color_str(WINDOW *, uint32_t, uint32_t, int16_t, int16_t, const char *);
void init_seed_srand(void);
#endif /* UTILS_H */
|
Fix alt function number calculation | // stm32f4xx_prefix.c becomes the initial portion of the generated pins file.
#include <stdio.h>
#include "py/obj.h"
#include "pin.h"
#include MICROPY_HAL_H
#define AF(af_idx, af_fn, af_unit, af_type, af_ptr) \
{ \
{ &pin_af_type }, \
.name = MP_QSTR_AF ## af_idx ## _ ## af_fn ## af_unit, \
.idx = (af_id... | // stm32f4xx_prefix.c becomes the initial portion of the generated pins file.
#include <stdio.h>
#include "py/obj.h"
#include "pin.h"
#include MICROPY_HAL_H
#define AF(af_idx, af_fn, af_unit, af_type, af_ptr) \
{ \
{ &pin_af_type }, \
.name = MP_QSTR_AF ## af_idx ## _ ## af_fn ## af_unit, \
.idx = (af_id... |
Work around Win/Clang eval order bug | /*
* Copyright 2013 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrProxyMove_DEFINED
#define GrProxyMove_DEFINED
// In a few places below we rely on braced initialization order being defined by the C++ spec (left
// to right). We u... | /*
* Copyright 2013 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrProxyMove_DEFINED
#define GrProxyMove_DEFINED
// In a few places below we rely on braced initialization order being defined by the C++ spec (left
// to right). We u... |
Fix mistype in color structure |
typedef struct {
long double r;
long double b;
long double g;
long double a;
} cgColor;
unsigned int framebuffer_h;
unsigned int framebuffer_v;
cgColor ** framebuffer;
void init_framebuffer(unsigned int h, unsigned int v);
|
typedef struct {
long double r;
long double g;
long double b;
long double a;
} cgColor;
unsigned int framebuffer_h;
unsigned int framebuffer_v;
cgColor ** framebuffer;
void init_framebuffer(unsigned int h, unsigned int v);
|
Define bool type together with true/false | #ifndef TYPES_H
#define TYPES_H
// Explicitly-sized versions of integer types
typedef __signed char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned int uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
// size... | #ifndef TYPES_H
#define TYPES_H
// Explicitly-sized versions of integer types
typedef __signed char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned int uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
typedef... |
Add a simple way to add memory locations of format | //===-- X86InstrBuilder.h - Functions to aid building x86 insts -*- C++ -*-===//
//
// This file exposes functions that may be used with BuildMI from the
// MachineInstrBuilder.h file to handle X86'isms in a clean way.
//
// The BuildMem function may be used with the BuildMI function to add entire
// memory references ... | //===-- X86InstrBuilder.h - Functions to aid building x86 insts -*- C++ -*-===//
//
// This file exposes functions that may be used with BuildMI from the
// MachineInstrBuilder.h file to handle X86'isms in a clean way.
//
// The BuildMem function may be used with the BuildMI function to add entire
// memory references ... |
Test all functions from tour.h. | #include "tour.h"
#define NCITIES 5
int main() {
tour t = create_tour(NCITIES);
int i;
for (i = 0; i < NCITIES; i++)
{
printf("%d\n", t[i]);
}
printf("Hello!");
return 0;
} | #include "tour.h"
#define NCITIES 5
#define STARTPOINT 2
int main() {
tour t = create_tour(NCITIES);
populate_tour(t, NCITIES);
start_point(t, STARTPOINT);
swap_cities(t, 3, 4);
int i;
for (i = 0; i < NCITIES; i++)
{
printf("%d\n", t[i]);
}
printf("Hello!\n");
return 0;
} |
Update tiledb version to 1.8.0 for dev | /*
* @file version.h
*
* @section LICENSE
*
* The MIT License
*
* @copyright Copyright (c) 2017-2020 TileDB, Inc.
*
* 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 restri... | /*
* @file version.h
*
* @section LICENSE
*
* The MIT License
*
* @copyright Copyright (c) 2017-2020 TileDB, Inc.
*
* 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 restri... |
Add VPS target seeking code. | #include <joyos.h>
#include "platform.h"
#include "navigation.h"
extern volatile uint8_t robot_id;
int usetup (void) {
robot_id = 7;
platform_init();
nav_init();
return 0;
}
int umain (void) {
printf("Hello, world!\n");
nav_start();
printf("Nav started, setting coords\n");
... | #include <joyos.h>
#include "platform.h"
#include "navigation.h"
extern volatile uint8_t robot_id;
int usetup(void) {
robot_id = 7;
platform_init();
nav_init();
return 0;
}
int umain(void) {
printf("Hello, world!\n");
nav_start();
printf("Nav started, setting coords\n");
... |
Make spacing depend on font size | #ifndef GAME_H
#define GAME_H
#include <stdint.h>
#define SPACING 5
#define FONT "cairo:monospace"
#define FONT_SIZE 12
#define TILE_SIZE (FONT_SIZE * 4)
#define GRID_WIDTH 4
#define GRID_HEIGHT 4
#define GRID_SIZE (GRID_WIDTH * GRID_HEIGHT)
#define BOARD_WIDTH (SPACING + TILE_SIZE * GRID_WIDTH + SPACIN... | #ifndef GAME_H
#define GAME_H
#include <stdint.h>
#define FONT "cairo:monospace"
#define FONT_SIZE 20
#define SPACING (FONT_SIZE * 0.4)
#define TILE_SIZE (FONT_SIZE * 4)
#define GRID_WIDTH 4
#define GRID_HEIGHT 4
#define GRID_SIZE (GRID_WIDTH * GRID_HEIGHT)
#define BOARD_WIDTH (SPACING + TILE_SIZE * GRID_... |
Remove declaration of obsolete arch_init_clk_ops() | #ifndef __ASM_MIPS_CLOCK_H
#define __ASM_MIPS_CLOCK_H
#include <linux/kref.h>
#include <linux/list.h>
#include <linux/seq_file.h>
#include <linux/clk.h>
struct clk;
struct clk_ops {
void (*init) (struct clk *clk);
void (*enable) (struct clk *clk);
void (*disable) (struct clk *clk);
void (*recalc) (struct clk *cl... | #ifndef __ASM_MIPS_CLOCK_H
#define __ASM_MIPS_CLOCK_H
#include <linux/kref.h>
#include <linux/list.h>
#include <linux/seq_file.h>
#include <linux/clk.h>
struct clk;
struct clk_ops {
void (*init) (struct clk *clk);
void (*enable) (struct clk *clk);
void (*disable) (struct clk *clk);
void (*recalc) (struct clk *cl... |
Add readinto and readlines to qstrs. | // qstrs specific to this port
Q(pyb)
Q(millis)
Q(elapsed_millis)
Q(delay)
Q(LED)
Q(on)
Q(off)
Q(toggle)
Q(Switch)
Q(value)
Q(readall)
Q(readline)
Q(FileIO)
| // qstrs specific to this port
Q(pyb)
Q(millis)
Q(elapsed_millis)
Q(delay)
Q(LED)
Q(on)
Q(off)
Q(toggle)
Q(Switch)
Q(value)
Q(readall)
Q(readinto)
Q(readline)
Q(readlines)
Q(FileIO)
|
Fix iOS nightly release breakage. | /* Copyright 2022 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 2022 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 barrier, fadd, and load. | #ifndef ATOMIC_H
#define ATOMIC_H
#include "fibrili.h"
#define atomic_fence() fibrili_fence()
#define atomic_lock(lock) fibrili_lock(lock)
#define atomic_unlock(lock) fibrili_unlock(lock)
#endif /* end of include guard: ATOMIC_H */
| #ifndef ATOMIC_H
#define ATOMIC_H
#include "fibrili.h"
#define atomic_fence() fibrili_fence()
#define atomic_lock(lock) fibrili_lock(lock)
#define atomic_unlock(lock) fibrili_unlock(lock)
#define atomic_load(val) __atomic_load_n(&(val), __ATOMIC_ACQUIRE)
#define atomic_fadd(val, n) __atomic_fetch_add(&(val), n, __ATO... |
Add functionality to bootstrap header | #import <CoreData/CoreData.h>
#import <FactoryGentleman/FactoryGentleman.h>
#import "CFGFactoryDefiner.h"
#import "CFGObjectBuilder.h"
| #import <CoreData/CoreData.h>
#import <FactoryGentleman/FactoryGentleman.h>
#import "CFGCoreFactoryGentleman.h"
#import "CFGFactoryDefiner.h"
#import "CFGObjectBuilder.h"
|
Include assert.h explicitly to fix windows build | // Copyright 2013 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law... | // Copyright 2013 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law... |
Make an empty struct nonempty. | // This is the last-resort version of this file. It will be used only
// if the comm layer implementation does not supply one.
#ifndef _chpl_comm_task_decls_h
#define _chpl_comm_task_decls_h
// Define the type of a n.b. communications handle.
typedef void* chpl_comm_nb_handle_t;
typedef struct {
} chpl_comm_taskPrv... | // This is the last-resort version of this file. It will be used only
// if the comm layer implementation does not supply one.
#ifndef _chpl_comm_task_decls_h
#define _chpl_comm_task_decls_h
// Define the type of a n.b. communications handle.
typedef void* chpl_comm_nb_handle_t;
typedef struct {
int dummy; // ... |
Allow printing of status after step | #pragma once
#include <string>
namespace smurff {
struct StatusItem
{
std::string phase;
int iter;
int phase_iter;
std::vector<double> model_norms;
double rmse_avg;
double rmse_1sample;
double train_rmse;
double auc_1sample;
double auc_avg;
double elapsed_iter;
double ... | |
Use MAP_ANON if MAP_ANONYMOUS is not defined. | #include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include "iobuf.h"
unsigned iobuf_bufsize = 8192;
int iobuf_init(iobuf* io, int fd, unsigned bufsize, char* buffer, unsigned flags)
{
memset(io, 0, sizeof *io);
if (!bufsize) bufsize = iobuf_bufsize;
if (!buffer) {
if ((buffer = mmap(0, bufsize, ... | #include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include "iobuf.h"
unsigned iobuf_bufsize = 8192;
#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
#endif
int iobuf_init(iobuf* io, int fd, unsigned bufsize, char* buffer, unsigned flags)
{
memset(io, 0, sizeof *io);
if (!bu... |
Support SuRF on-board DS1825 in ds18b20 demo | /* Use a crystal if one is installed. Much more accurate timing
* results. */
#define BSP430_PLATFORM_BOOT_CONFIGURE_LFXT1 1
/* Application does output: support spin-for-jumper */
#ifndef configBSP430_PLATFORM_SPIN_FOR_JUMPER
#define configBSP430_PLATFORM_SPIN_FOR_JUMPER 1
#endif /* configBSP430_PLATFORM_SPIN_FOR_JU... | /* Use a crystal if one is installed. Much more accurate timing
* results. */
#define BSP430_PLATFORM_BOOT_CONFIGURE_LFXT1 1
/* Application does output: support spin-for-jumper */
#ifndef configBSP430_PLATFORM_SPIN_FOR_JUMPER
#define configBSP430_PLATFORM_SPIN_FOR_JUMPER 1
#endif /* configBSP430_PLATFORM_SPIN_FOR_JU... |
Disable SPI hal from pca10001 board. | #ifndef NRF51_HAL_CONF_H__
#define NRF51_HAL_CONF_H__
#define HAL_UART_MODULE_ENABLED
#define HAL_SPI_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
#endif // NRF51_HAL_CONF_H__
| #ifndef NRF51_HAL_CONF_H__
#define NRF51_HAL_CONF_H__
#define HAL_UART_MODULE_ENABLED
// #define HAL_SPI_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
#endif // NRF51_HAL_CONF_H__
|
Add a new trac redirect plugin | /*
* This file is part of the beirdobot package
* Copyright (C) 2012 Raymond Wagner
*
* This plugin uses code gratuitously stolen from the 'fart' plugin.
* See that for any real licensing information.
*/
/*HEADER---------------------------------------------------
* $Id$
*
* Copyright 2012 Raymond Wagner
* ... | |
Change AndroidPlatform variables to FWPlatformBase, switch include | /*
* Copyright (C) Sometrik oy 2015
*
*/
#include <FWContextBase.h>
#include <AndroidPlatform.h>
class Example1 : public FWContextBase {
public:
Example1(AndroidPlatform * _platform) : FWContextBase(_platform), platform(_platform) { }
bool Init();
void onDraw();
void onShutdown();
private:
AndroidPla... | /*
* Copyright (C) Sometrik oy 2015
*
*/
#include <FWContextBase.h>
#include <FWPlatformBase.h>
class Example1 : public FWContextBase {
public:
Example1(FWPlatformBase * _platform) : FWContextBase(_platform), platform(_platform) { }
bool Init();
void onDraw();
void onShutdown();
private:
FWPlatformBa... |
Patch from Bernardo Innocenti: Remove use of cast-as-l-value extension, removed in GCC 3.5. |
#include <errno.h>
#include <asm/ptrace.h>
#include <sys/syscall.h>
int
ptrace(int request, int pid, int addr, int data)
{
long ret;
long res;
if (request > 0 && request < 4) (long *)data = &ret;
__asm__ volatile ("movel %1,%/d0\n\t"
"movel %2,%/d1\n\t"
"movel %3,%/d2\n\t"
"movel %4,%/d3\n\t"
... |
#include <errno.h>
#include <asm/ptrace.h>
#include <sys/syscall.h>
int
ptrace(int request, int pid, int addr, int data)
{
long ret;
long res;
if (request > 0 && request < 4) data = (int)&ret;
__asm__ volatile ("movel %1,%/d0\n\t"
"movel %2,%/d1\n\t"
"movel %3,%/d2\n\t"
"movel %4,%/d3\n\t"
"... |
Clean up smyrna files: remove unnecessary globals modify libraries not to rely on code in cmd/smyrna remove static declarations from .h files remove unnecessary libraries mark unused code and clean up warnings | #include "topviewsettings.h"
#include "gui.h"
void on_settingsOKBtn_clicked (GtkWidget *widget,gpointer user_data)
{
}
void on_settingsCancelBtn_clicked (GtkWidget *widget,gpointer user_data)
{
}
int load_settings_from_graph(Agraph_t *g)
{
return 1;
}
int update_graph_from_settings(Agraph_t *g)
{
return 1;
}
... | /* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (c) 1994-2004 AT&T Corp... |
Reset default settings to stock kit configuration |
#ifndef __SETTINGS_H_
#define __SETTINGS_H_
#include <Arduino.h>
#include "Device.h"
// This section is for devices and their configuration
//Kit:
#define HAS_STD_LIGHTS (1)
#define LIGHTS_PIN 5
#define HAS_STD_CAPE (1)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_PILOT (1)
#define HAS_STD_CAMERAMOUNT (1)
#defin... |
#ifndef __SETTINGS_H_
#define __SETTINGS_H_
#include <Arduino.h>
#include "Device.h"
// This section is for devices and their configuration
//Kit:
#define HAS_STD_LIGHTS (1)
#define LIGHTS_PIN 5
#define HAS_STD_CAPE (1)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_PILOT (1)
#define HAS_STD_CAMERAMOUNT (1)
#defin... |
Change print symbol from O to +. | #include <string.h>
#include "window.h"
#include "grid.h"
#include "utils.h"
extern window_settings_t win_set;
void print_grid(WINDOW *win)
{
getmaxyx(win, win_set.maxGridHeight, win_set.maxGridWidth);
// If the grid is larger than the maximum height
// or width, then set it to max height or width
if... | #include <string.h>
#include "window.h"
#include "grid.h"
#include "utils.h"
extern window_settings_t win_set;
void print_grid(WINDOW *win)
{
getmaxyx(win, win_set.maxGridHeight, win_set.maxGridWidth);
// If the grid is larger than the maximum height
// or width, then set it to max height or width
if... |
Add tracker backend stump for MAP | /*
*
* OBEX Server
*
* Copyright (C) 2010-2011 Nokia Corporation
*
*
* 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 l... | |
Improve loop (avg. from ~0.15 to ~0.07) | #include "euler_util.h"
#include <string.h>
#define MAX 7
int main(int argc, char *argv[])
{
float start = timeit();
char *forward = calloc(sizeof(char), sizeof(char) * MAX);
char *backward = calloc(sizeof(char), sizeof(char) * MAX);
size_t int_len;
int high = 0;
for (int x=100; x < 10... | #include "euler_util.h"
#include <string.h>
#define MAX 7
int main(int argc, char *argv[])
{
float start = timeit();
char product[MAX] = { '\0' };
int high = 0;
for (int x=100; x < 1000; x++) {
for (int y=x; y < 1000; y++) {
int canidate = x * y;
size_t int_len = ... |
Use new NanoTime location header, oops. | #ifndef TIMEOUT_QUEUE_H
#define TIMEOUT_QUEUE_H
#include <map>
class TimeoutQueue {
typedef std::map<NanoTime, CallbackQueue> timeout_map_t;
LogHandle log_;
timeout_map_t timeout_queue_;
public:
TimeoutQueue(void)
: log_("/event/timeout/queue"),
timeout_queue_()
{ }
~TimeoutQueue()
{ }
bool empty(void)... | #ifndef TIMEOUT_QUEUE_H
#define TIMEOUT_QUEUE_H
#include <map>
#include <common/time/time.h>
class TimeoutQueue {
typedef std::map<NanoTime, CallbackQueue> timeout_map_t;
LogHandle log_;
timeout_map_t timeout_queue_;
public:
TimeoutQueue(void)
: log_("/event/timeout/queue"),
timeout_queue_()
{ }
~Timeout... |
Use fgets(3) instead of getline(3) because whilst getline(3) is POSIX, it is not in the C89 or later standards | #ifndef READLINE_FALLBACK_H
#define READLINE_FALLBACK_H
#include <stdio.h>
#include <string.h>
char* readline(const char * prompt) {
char *result = malloc(1);
size_t n = 0;
printf("%s", prompt);
getline(&result, &n, stdin);
result[strlen(result)-1] = 0;
return result;
}
#endif /* READLINE_FAL... | #ifndef READLINE_FALLBACK_H
#define READLINE_FALLBACK_H
#include <stdio.h>
#include <string.h>
char* readline(const char * prompt) {
char *result = malloc(1024);
printf("%s", prompt);
fgets(result, 1023, stdin);
result[strlen(result)-1] = 0;
return result;
}
#endif /* READLINE_FALLBACK_H */
|
Choose only gcc to execute a specific portion of code | #include "fmt.h"
size_t fmt_escapecharxml(char* dest,uint32_t ch) {
char a[FMT_LONG], b[FMT_XLONG];
const char* s;
size_t i,j;
switch (ch) {
case '&': s="&"; goto string;
case '<': s="<"; goto string;
case '>': s=">"; goto string;
case '\'': s="'"; goto string;
case '"': s="""; go... | #include "fmt.h"
size_t fmt_escapecharxml(char* dest,uint32_t ch) {
char a[FMT_LONG], b[FMT_XLONG];
const char* s;
size_t i,j;
switch (ch) {
case '&': s="&"; goto string;
case '<': s="<"; goto string;
case '>': s=">"; goto string;
case '\'': s="'"; goto string;
case '"': s="""; go... |
Boost now supports std::unique_ptr/std::shared_ptr for python | // This file is part of SWGANH which is released under the MIT license.
// See file LICENSE or go to http://swganh.com/LICENSE
#pragma once
#include <memory>
namespace boost {
template<class T> const T* get_pointer(const std::shared_ptr<T>& ptr)
{
return ptr.get();
}
template<class T> T* get_... | // This file is part of SWGANH which is released under the MIT license.
// See file LICENSE or go to http://swganh.com/LICENSE
#pragma once
#include <memory>
//namespace boost {
// template<class T> const T* get_pointer(const std::shared_ptr<T>& ptr)
// {
// return ptr.get();
// }
//
// template<cl... |
Use new API and expose optional host argument | /* The contents of this file is in the public domain. */
#include <ipify.h>
#include <string.h>
#include <sys/socket.h>
int main(int argc, char *argv[])
{
int family = AF_UNSPEC;
char addr[256];
int i, sd;
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-h")) {
printf("ipify [-46h]\n");
return 0;
}
... | /* The contents of this file is in the public domain. */
#include <ipify.h>
#include <string.h>
#include <sys/socket.h>
int main(int argc, char *argv[])
{
int family = AF_UNSPEC;
char addr[256];
char *host;
int i, sd;
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-h")) {
printf("ipify [-46h] [HOST]\n")... |
Remove a Windows line-ending that was accidentally included | #if defined(_WIN32)
# define __LITTLE_ENDIAN__ 1
# ifdef _M_IX86
# define __i386__ 1
# endif
# ifdef _M_X64
# define __x86_64__ 1
# endif
# if defined(_MSC_VER)
# define snprintf _snprintf
# define strtoull _strtoui64
# define __func__ __FUNCT... | #if defined(_WIN32)
# define __LITTLE_ENDIAN__ 1
# ifdef _M_IX86
# define __i386__ 1
# endif
# ifdef _M_X64
# define __x86_64__ 1
# endif
# if defined(_MSC_VER)
# define snprintf _snprintf
# define strtoull _strtoui64
# define __func__ __FUNCTI... |
Destroy main window on Ctrl+q | #include <gtk/gtk.h>
GtkWidget *
main_window_create()
{
GtkWidget *window;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "ghighlighter");
g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
return window;
}
| #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <glib.h>
static void
main_window_destroy(GtkAccelGroup *group, GObject *acceleratable,
guint keyval, GdkModifierType modifier, gpointer user_data)
{
gtk_widget_destroy(GTK_WIDGET(user_data));
}
void
main_window_bind_keys(GtkWidget *window)
{
GtkAccelGr... |
Add _s custom literal for durations | //Copyright (c) 2018 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
#ifndef DURATION_H
#define DURATION_H
namespace cura
{
/*
* \brief Represents a duration in seconds.
*
* This is a facade. It behaves like a double, only it can't be negative.
*/
struct Duration
{
/*
* ... | //Copyright (c) 2018 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
#ifndef DURATION_H
#define DURATION_H
namespace cura
{
/*
* \brief Represents a duration in seconds.
*
* This is a facade. It behaves like a double, only it can't be negative.
*/
struct Duration
{
/*
* ... |
Create next fit algorithm in c | #include <stdio.h>
#include <stdlib.h>
void next_fit(int blockSize[],int processSize[],int n,int m){
int allocation[m];
int i=0,j=0;
for (i=0;i<m;i++)
allocation[i]=-1;
for (i=0;i<m;i++) {
while (j<n) {
if (blockSize[j]>=processSize[i])
{
allocat... | |
Add test cases for AArch64 hints codegen | // RUN: %clang_cc1 -triple arm64-apple-ios -O3 -emit-llvm -o - %s | FileCheck %s
void f0(void *a, void *b) {
__clear_cache(a,b);
// CHECK: call {{.*}} @__clear_cache
}
// CHECK: call {{.*}} @llvm.aarch64.rbit.i32(i32 %a)
unsigned rbit(unsigned a) {
return __builtin_arm_rbit(a);
}
// CHECK: call {{.*}} @llvm.aarch... | // RUN: %clang_cc1 -triple arm64-apple-ios -O3 -emit-llvm -o - %s | FileCheck %s
void f0(void *a, void *b) {
__clear_cache(a,b);
// CHECK: call {{.*}} @__clear_cache
}
// CHECK: call {{.*}} @llvm.aarch64.rbit.i32(i32 %a)
unsigned rbit(unsigned a) {
return __builtin_arm_rbit(a);
}
// CHECK: call {{.*}} @llvm.aarch... |
Fix header out of sync | #import <Foundation/Foundation.h>
extern NSString *kCTCFeedCheckerErrorDomain;
typedef void (^CTCFeedCheckCompletionHandler)(NSArray *downloadedFeedFiles,
NSError *error);
typedef void (^CTCFeedCheckDownloadCompletionHandler)(NSError *error);
@protocol CTCFeedCheck
- (... | #import <Foundation/Foundation.h>
extern NSString *kCTCFeedCheckerErrorDomain;
typedef void (^CTCFeedCheckCompletionHandler)(NSArray *downloadedFeedFiles,
NSError *error);
typedef void (^CTCFeedCheckDownloadCompletionHandler)(NSError *error);
@protocol CTCFeedCheck
- (... |
Add test for multi-line commenting | // RUN: %ucc -fsyntax-only %s
int main()
{
/* comment with stray handling *\
/
/* this is a valid *\/ comment */
/* this is a valid comment *\*/
// this is a valid\
comment
return 0;
}
| |
Add missing header method declarations. | //--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author: Vassil Vassilev <vasil.georgiev.vasilev@cern.ch>
//------------------------------------------------------------------------------
#ifndef CLING_RUNTIME_EXCEPTIONS_... | //--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author: Vassil Vassilev <vasil.georgiev.vasilev@cern.ch>
//------------------------------------------------------------------------------
#ifndef CLING_RUNTIME_EXCEPTIONS_... |
Make more usable for production | //
// FDTakeController.h
// FDTakeExample
//
// Created by Will Entriken on 8/9/12.
// Copyright (c) 2012 William Entriken. All rights reserved.
//
#import <Foundation/Foundation.h>
@class FDTakeController;
@protocol FDTakeDelegate <NSObject>
- (void)takeController:(FDTakeController *)controller gotPhoto:(UIIma... | //
// FDTakeController.h
// FDTakeExample
//
// Created by Will Entriken on 8/9/12.
// Copyright (c) 2012 William Entriken. All rights reserved.
//
#import <Foundation/Foundation.h>
@class FDTakeController;
@protocol FDTakeDelegate <NSObject>
@optional
- (void)takeController:(FDTakeController *)controller didCa... |
Add tree demo to input - needed for subobjects | #include <memory>
#include <random>
static std::mt19937 mt;
static std::uniform_int_distribution<int> d(1,10);
static auto gen = []{return d(mt);};
class Tree
{
int data_;
std::shared_ptr<Tree> left_;
std::shared_ptr<Tree> right_;
public:
Tree(int levels=0)
{
data_ = gen();
if ( levels <= 0 ) re... | |
Update Skia milestone to 65 | /*
* 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 64
#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 65
#endif
|
Make sure primitive type enum starts at 0 | #pragma once
//------------------------------------------------------------------------------
/**
@class Oryol::Render::PrimitiveType
@brief primitive type enum (triangle strips, lists, etc...)
*/
#include "Core/Types.h"
namespace Oryol {
namespace Render {
class PrimitiveType {
public:
/... | #pragma once
//------------------------------------------------------------------------------
/**
@class Oryol::Render::PrimitiveType
@brief primitive type enum (triangle strips, lists, etc...)
*/
#include "Core/Types.h"
namespace Oryol {
namespace Render {
class PrimitiveType {
public:
/... |
Make sure gen loc is in range. | #include "../H/ugens.h"
#include <stdio.h>
/* these 3 defined in makegen.c */
extern float *farrays[];
extern int sizeof_farray[];
extern int f_goto[];
/* Returns the address of function number genno, or NULL if the
function array doesn't exist.
NOTE: It's the responsiblity of instruments to deal with a
mis... | #include <stdio.h>
#include <ugens.h>
/* these 3 defined in makegen.c */
extern float *farrays[];
extern int sizeof_farray[];
extern int f_goto[];
/* Returns the address of function number genno, or NULL if the
function array doesn't exist.
NOTE: It's the responsiblity of instruments to deal with a
missing ... |
Make a proper case to U32 to avoid a warning | /* Copyright 2002-2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | /* Copyright 2002-2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... |
Add sections for PIL (Fred Lundh). | /* appinit.c -- Tcl and Tk application initialization. */
#include <tcl.h>
#include <tk.h>
int
Tcl_AppInit (interp)
Tcl_Interp *interp;
{
Tk_Window main;
main = Tk_MainWindow(interp);
if (Tcl_Init (interp) == TCL_ERROR)
return TCL_ERROR;
if (Tk_Init (interp) == TCL_ERROR)
return TCL_ERROR;
#ifdef WITH_MOR... | /* appinit.c -- Tcl and Tk application initialization. */
#include <tcl.h>
#include <tk.h>
int
Tcl_AppInit (interp)
Tcl_Interp *interp;
{
Tk_Window main;
main = Tk_MainWindow(interp);
if (Tcl_Init (interp) == TCL_ERROR)
return TCL_ERROR;
if (Tk_Init (interp) == TCL_ERROR)
return TCL_ERROR;
#ifdef WITH_MOR... |
Set initialized=1 when everything has actually been initialized |
#include <stdbool.h>
#include "core.h"
#include "crypto_onetimeauth.h"
static bool initialized;
int
sodium_init(void)
{
if (initialized != 0) {
return 1;
}
initialized = 1;
if (crypto_onetimeauth_pick_best_implementation() == NULL) {
return -1;
}
return 0;
}
|
#include <stdbool.h>
#include "core.h"
#include "crypto_onetimeauth.h"
static bool initialized;
int
sodium_init(void)
{
if (initialized != 0) {
return 1;
}
if (crypto_onetimeauth_pick_best_implementation() == NULL) {
return -1;
}
initialized = 1;
return 0;
}
|
Add a sphere light stub. | /*
* An area light with a sphere geometry.
*
* TODO(dinow): Extract a middle class called GeometryLight which contains the
* intersect code and the geometry pointer.
* Author: Dino Wernli
*/
#ifndef SPHERE_LIGHT_H_
#define SPHERE_LIGHT_H_
#include "scene/geometry/sphere.h"
#include "util/random.h"
class Sphere... | |
Add AC_XSTR and AC_STR macros. | /*
* Copyright 2016 Wink Saville
*
* 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... | |
Remove declaration of non-existent method | // 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_NACL_NACL_BROKER_LISTENER_H_
#define CHROME_NACL_NACL_BROKER_LISTENER_H_
#pragma once
#include "base/memory/scoped_ptr.h"
#include "ba... | // 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 CHROME_NACL_NACL_BROKER_LISTENER_H_
#define CHROME_NACL_NACL_BROKER_LISTENER_H_
#pragma once
#include "base/memory/scoped_ptr.h"
#include "ba... |
Fix dirty scheduler tc on windows | #include <unistd.h>
#include "erl_nif.h"
static int
load(ErlNifEnv* env, void** priv, ERL_NIF_TERM info)
{
ErlNifSysInfo sys_info;
enif_system_info(&sys_info, sizeof(ErlNifSysInfo));
if (!sys_info.smp_support || !sys_info.dirty_scheduler_support)
return 1;
return 0;
}
static ERL_NIF_TERM
dirty... | #ifndef __WIN32__
#include <unistd.h>
#endif
#include "erl_nif.h"
static int
load(ErlNifEnv* env, void** priv, ERL_NIF_TERM info)
{
ErlNifSysInfo sys_info;
enif_system_info(&sys_info, sizeof(ErlNifSysInfo));
if (!sys_info.smp_support || !sys_info.dirty_scheduler_support)
return 1;
return 0;
}
... |
Fix unnderlying issue with Stream class being private | /*
* MbedHardware
*
* Created on: Aug 17, 2011
* Author: nucho
*/
#ifndef ROS_MBED_HARDWARE_H_
#define ROS_MBED_HARDWARE_H_
#include "mbed.h"
#include "MODSERIAL.h"
#define ROSSERIAL_BAUDRATE 57600
class MbedHardware {
public:
MbedHardware(MODSERIAL* io , long baud= ROSSERIAL_BAUDRATE)
:iost... | /*
* MbedHardware
*
* Created on: Aug 17, 2011
* Author: nucho
*/
#ifndef ROS_MBED_HARDWARE_H_
#define ROS_MBED_HARDWARE_H_
#include "mbed.h"
#include "MODSERIAL.h"
class MbedHardware {
public:
MbedHardware(PinName tx, PinName rx, long baud = 57600)
:iostream(tx, rx){
baud_ = baud;
... |
Add method to save a single component float image. | #ifndef SRC_UTILS_IMAGE_PERSISTER_H_
#define SRC_UTILS_IMAGE_PERSISTER_H_
#include <string>
#include <vector>
#include <Magick++.h>
#include <Eigen/Core>
/**
* \brief Provides static functions to load and save images
*
*/
class ImagePersister
{
public:
template <class T>
static void saveRGBA32F(T *data, int ... | #ifndef SRC_UTILS_IMAGE_PERSISTER_H_
#define SRC_UTILS_IMAGE_PERSISTER_H_
#include <string>
#include <vector>
#include <Magick++.h>
#include <Eigen/Core>
/**
* \brief Provides static functions to load and save images
*
*/
class ImagePersister
{
public:
template <class T>
static void saveRGBA32F(T *data, int ... |
Add an utility function (CastJSObject) | /** @file Utils.h
@author Philip Abbet
Declaration of some utilities related to scripting
*/
#ifndef _ATHENA_SCRIPTING_UTILS_H_
#define _ATHENA_SCRIPTING_UTILS_H_
#include <Athena-Scripting/Prerequisites.h>
#include <v8.h>
namespace Athena {
namespace Scripting {
//------------------------------------------... | |
Update driver version to 5.03.00-k11 | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.03.00-k10"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.03.00-k11"
|
Add blinking led example for TI Kit | #include <inc/hw_types.h>
#include <driverlib/sysctl.h>
#include <stdio.h>
#include <string.h>
#include <inc/hw_memmap.h>
#include <inc/hw_sysctl.h>
#include <driverlib/gpio.h>
#include <driverlib/debug.h>
int UP=0;
int i;
int main(){
SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8... | |
Create window closing script with halt command. | sharedMainLayoutScripts: closeWindowHaltScript
Close Window [ Current Window ]
Halt Script
February 9, 平成26 10:24:51 Imagination Quality Management.fp7 - closeWindowHaltScript -1- | |
Fix initial case for header documentation sentences | #import <Foundation/Foundation.h>
@interface NSString (TDTAdditions)
/**
@return a string representing a newly generated version 4 random UUID
*/
+ (instancetype)randomUUID;
/**
@return The SHA1 of the receiver
*/
- (NSString *)sha1Digest;
/**
@return a new string by trimming non alphanumeric characters from ... | #import <Foundation/Foundation.h>
@interface NSString (TDTAdditions)
/**
@return A string representing a newly generated version 4 random UUID
*/
+ (instancetype)randomUUID;
/**
@return The SHA1 of the receiver
*/
- (NSString *)sha1Digest;
/**
@return A new string by trimming non alphanumeric characters from ... |
Create define for asserting with a message | /* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef COMMON_HALFLING_SYS_H
#define COMMON_HALFLING_SYS_H
#include "common/typedefs.h"
// Only include the base windows libraries
#define WIN32_LEAN_AND_MEA... | /* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef COMMON_HALFLING_SYS_H
#define COMMON_HALFLING_SYS_H
#include "common/typedefs.h"
// Only include the base windows libraries
#define WIN32_LEAN_AND_MEA... |
Fix comment at top of file to match file name. | /* File: connection.h
*
* Description: See "md.h"
*
* Comments: See "notice.txt" for copyright and license information.
*
*/
#ifndef __MD5_H__
#define __MD5_H__
#include "psqlodbc.h"
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
#define MD5_ODBC
#define FRONTEND
#endif
#define MD5_PASSWD_LEN 35
/*... | /* File: md5.h
*
* Description: See "md5.c"
*
* Comments: See "notice.txt" for copyright and license information.
*
*/
#ifndef __MD5_H__
#define __MD5_H__
#include "psqlodbc.h"
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
#define MD5_ODBC
#define FRONTEND
#endif
#define MD5_PASSWD_LEN 35
/* From ... |
Improve tests for boolean operators | int main() {
struct A {} a;
// error: '&&' operator requires scalar operands
a && a;
// error: '||' operator requires scalar operands
a || a;
// error: '!' operator requires scalar operand
!a;
}
| int main() {
struct A {} a;
// error: '&&' operator requires scalar operands
a && a;
// error: '||' operator requires scalar operands
1 || a;
// error: '||' operator requires scalar operands
a || 1;
// error: '!' operator requires scalar operand
!a;
}
|
Clean up sysconf() test to address a TODO that depended on a toolchain roll | /*
* Copyright (c) 2012 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <stdio.h>
#if defined(__GLIBC__)
#include <unistd.h>
#else
/*
* TODO(bsy): remove when newlib toolchain catches up
* http://co... | /*
* Copyright (c) 2012 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <stdio.h>
#include <unistd.h>
int main(void) {
long rv = sysconf(_SC_PAGESIZE);
printf("%ld\n", rv);
return rv != (1<<16);... |
Put ImageBuffer into separate header | #ifndef NME_NME_API_H
#define NME_NME_API_H
#include "Pixel.h"
namespace nme
{
enum { NME_API_VERSION = 100 };
class NmeApi
{
public:
virtual int getApiVersion() { return NME_API_VERSION; }
virtual bool getC0IsRed() { return gC0IsRed; }
};
extern NmeApi gNmeApi;
} // end namespace nme... | |
Duplicate definition of NAME_MAX macro | /*
* Copyright (c) 2007, 2008, 2009, ETH Zurich.
* All rights reserved.
*
* This file is distributed under the terms in the attached LICENSE file.
* If you do not find this file, copies can be found by writing to:
* ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
*/
#ifndef DIRENT_H_
#... | /*
* Copyright (c) 2007, 2008, 2009, ETH Zurich.
* All rights reserved.
*
* This file is distributed under the terms in the attached LICENSE file.
* If you do not find this file, copies can be found by writing to:
* ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
*/
#ifndef DIRENT_H_
#... |
Allow to set custom DTB/OS_CALL addresses | #ifndef CONFIG_H
#define CONFIG_H
//#define QEMU
#define SIM
#define OS_CALL 0xC0000000
#define DTB 0xC3000000
#endif
| #ifndef CONFIG_H
#define CONFIG_H
//#define QEMU
#define SIM
#ifndef OS_CALL
#define OS_CALL 0xC0000000
#endif
#ifndef DTB
#define DTB 0xC3000000
#endif
#endif
|
Add missing test case, provided by Steven Watanabe. | // RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s
void __fastcall f1(void);
void __stdcall f2(void);
void __thiscall f3(void);
void __fastcall f4(void) {
// CHECK: define x86_fastcallcc void @f4()
f1();
// CHECK: call x86_fastcallcc void @f1()
}
void __stdcall f5(void) {
// CHECK: define x86_stdcallcc void @f5()
f... | |
Add missing explicit include of net/url_request/url_request_context.h | // Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef BROWSER_NET_LOG_H_
#define BROWSER_NET_LOG_H_
#include "base/files/scoped_file.h"
#include "net/log/net_log.h"
#include "net/log/file_net_log_observer.h"
namespace brightray ... | // Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef BROWSER_NET_LOG_H_
#define BROWSER_NET_LOG_H_
#include "base/files/scoped_file.h"
#include "net/log/net_log.h"
#include "net/log/file_net_log_observer.h"
#include "net/url_req... |
Fix compilation error of RestrictionMacro.h in sf1 if COBRA_RESTRICT is not defined. | #ifndef RESTRICTMACRO_H_
#define RESTRICTMACRO_H_
#ifdef COBRA_RESTRICT
#define COBRA_RESTRICT_BREAK \
break; \
#define COBRA_RESTRICT_EXCEED_N_BREAK( EXP, NUM ) \
if (EXP > NUM) \
break; \
#define COBRA_RESTRICT_EXCEED_N_RETURN_FALSE( EXP, NUM ) \
if ( EXP > NUM ) \
return false; \
#else
#defin... | #ifndef RESTRICTMACRO_H_
#define RESTRICTMACRO_H_
#ifdef COBRA_RESTRICT
#define COBRA_RESTRICT_BREAK \
break; \
#define COBRA_RESTRICT_EXCEED_N_BREAK( EXP, NUM ) \
if (EXP > NUM) \
break; \
#define COBRA_RESTRICT_EXCEED_N_RETURN_FALSE( EXP, NUM ) \
if ( EXP > NUM ) \
return false; \
#else
#defin... |
Fix no-return warning in loader, also change the internal variable names. | #include "vk_default_loader.h"
#include "vulkan/vulkan.h"
#if defined(_WIN32)
#elif defined(unix) || defined(__unix__) || defined(__unix)
#include <dlfcn.h>
static void* (*loadSym)(void* lib, const char* procname);
static void* loadSymWrap(VkInstance instance, const char* vkproc) {
return (*loadSym)(instance, vkproc)... | #include "vk_default_loader.h"
#include "vulkan/vulkan.h"
#if defined(_WIN32)
#elif defined(unix) || defined(__unix__) || defined(__unix)
#include <dlfcn.h>
static void* (*symLoader)(void* lib, const char* procname);
static void* loaderWrap(VkInstance instance, const char* vkproc) {
return (*symLoa... |
Add clear color to render target | // Copyright (C) 2016 Elviss Strazdins
// This file is part of the Ouzel engine.
#pragma once
#include <algorithm>
#include <memory>
#include "Types.h"
#include "Noncopyable.h"
#include "Size2.h"
namespace ouzel
{
namespace graphics
{
class Renderer;
class Texture;
class RenderTarget... | // Copyright (C) 2016 Elviss Strazdins
// This file is part of the Ouzel engine.
#pragma once
#include <algorithm>
#include <memory>
#include "Types.h"
#include "Noncopyable.h"
#include "Size2.h"
#include "Color.h"
namespace ouzel
{
namespace graphics
{
class Renderer;
class Texture;
... |
Fix warning with nonnull member for SuggetionView | //
// ImojiSDKUI
//
// Created by Nima Khoshini
// Copyright (C) 2015 Imoji
//
// 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
/... | //
// ImojiSDKUI
//
// Created by Nima Khoshini
// Copyright (C) 2015 Imoji
//
// 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
/... |
Update the driver version to 8.04.00.08-k. | /*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.04.00.07-k"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 4
#define QLA_DRIVER_PATCH_VER 0
#defi... | /*
* QLogic Fibre Channel HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla2xxx for copyright and licensing details.
*/
/*
* Driver version
*/
#define QLA2XXX_VERSION "8.04.00.08-k"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 4
#define QLA_DRIVER_PATCH_VER 0
#defi... |
Fix memory corruption, trailing & in member variable type. | #pragma once
#include "ProcessPlatform.h"
namespace ugly
{
namespace process
{
class ProcessNative : public ProcessPlatform
{
public:
ProcessNative(const std::string& path, const std::string& arguments);
const std::string& GetFullCommandLine() const override { r... | #pragma once
#include "ProcessPlatform.h"
namespace ugly
{
namespace process
{
class ProcessNative : public ProcessPlatform
{
public:
ProcessNative(const std::string& path, const std::string& arguments);
const std::string& GetFullCommandLine() const override { r... |
Define a vector to hold user defined functions | /*****************************************************************************
* PROGRAM NAME: CUDFunctionDB.h
* PROGRAMMER: Wei Sun wsun@vt.edu
* PURPOSE: Define the user defined function DB object to hold all the user
* defined function
*************************************************************************... | |
Adjust test case for lexical block pruning. Follow-on to r104842 and Radar 7424645. | // RUN: %llvmgcc -S -O0 -g %s -o - | grep DW_TAG_lexical_block | count 3
int foo(int i) {
if (i) {
int j = 2;
}
else {
int j = 3;
}
return i;
}
| // RUN: %llvmgcc -S -O0 -g %s -o - | grep DW_TAG_lexical_block | count 2
int foo(int i) {
if (i) {
int j = 2;
}
else {
int j = 3;
}
return i;
}
|
Test that local variables are aligned as the user requested. | // RUN: %llvmgcc -S %s -o - | grep {align 16}
extern p(int *);
int q(void) {
int x __attribute__ ((aligned (16)));
p(&x);
return x;
}
| |
Fix offsets to VDP1 registers | /*
* Copyright (c) 2012-2014 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <mrkotfw@gmail.com>
*/
#ifndef _VDP1_MAP_H_
#define _VDP1_MAP_H_
#include <scu-internal.h>
/* Macros specific for processor */
#define VDP1(x) (0x25D00000 + (x))
/* Helpers specific to this processor */
#define T... | /*
* Copyright (c) 2012-2014 Israel Jacquez
* See LICENSE for details.
*
* Israel Jacquez <mrkotfw@gmail.com>
*/
#ifndef _VDP1_MAP_H_
#define _VDP1_MAP_H_
#include <scu-internal.h>
/* Macros specific for processor */
#define VDP1(x) (0x25D00000 + (x))
/* Helpers specific to this processor */
#define T... |
Fix KT-43502 testcase on windows | #include "libinterop_kt43502_api.h"
int main() {
libinterop_kt43502_symbols()->kotlin.root.printExternPtr();
} | #include "testlib_api.h"
int main() {
testlib_symbols()->kotlin.root.printExternPtr();
} |
Add beforeShutdown signal to mock object | /****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Raine Makelainen <raine.makelainen@jolla.com>
**
****************************************************************************/
/* This Source Code Form is subject to the terms of the Mozilla Pu... | /****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Raine Makelainen <raine.makelainen@jolla.com>
**
****************************************************************************/
/* This Source Code Form is subject to the terms of the Mozilla Pu... |
Update the useragent a bit | //
// xkcdAppDelegate.h
// xkcd
//
// Created by Joshua Bleecher Snyder on 8/25/09.
// Copyright Treeline Labs 2009. All rights reserved.
//
#define GENERATE_DEFAULT_PNG 0
#define AppDelegate ((xkcdAppDelegate *)[UIApplication sharedApplication].delegate)
#define kUseragent @"xkcd iPhone app (xkcdapp@treelinelabs... | //
// xkcdAppDelegate.h
// xkcd
//
// Created by Joshua Bleecher Snyder on 8/25/09.
// Copyright Treeline Labs 2009. All rights reserved.
//
#define GENERATE_DEFAULT_PNG 0
#define AppDelegate ((xkcdAppDelegate *)[UIApplication sharedApplication].delegate)
#define kUseragent @"xkcd iPhone app (josh@treelinelabs.co... |
Add solution to Exercise 1-20. | /* Exercise 1-20: Write a program "detab" that replaces tabs in the input with
* the proper number of blanks to space to the next tab stop. Assume a fixed
* set of tab stops, say every "n" columns. Should "n" be a variable or a
* symbolic parameter? */
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int... | |
Make public some attributes of Expanduino | #pragma once
#include "expanduino-subdevice.h"
#include "classes/meta.h"
#define EXPANDUINO_MAX_RESPONSE_SIZE 128
class ExpanduinoInterruption {
public:
ExpanduinoSubdevice* source;
ExpanduinoInterruption* next;
};
class Expanduino {
MetaExpanduinoSubdevice metaSubdevice;
const char* vendorName;
const ch... | #pragma once
#include "expanduino-subdevice.h"
#include "classes/meta.h"
#define EXPANDUINO_MAX_RESPONSE_SIZE 128
class ExpanduinoInterruption {
public:
ExpanduinoSubdevice* source;
ExpanduinoInterruption* next;
};
class Expanduino {
protected:
MetaExpanduinoSubdevice metaSubdevice;
ExpanduinoInterruption*... |
Fix some warnings (redefined macro definitions) | #import <Foundation/Foundation.h>
#import <CocoaLumberjack/CocoaLumberjack.h>
extern DDLogLevel magDebugKitLogLevel;
extern BOOL magDebugKitAsyncLogs;
#define LOG_ASYNC_ENABLED magDebugKitAsyncLogs
#define LOG_LEVEL_DEF magDebugKitLogLevel
@interface MAGLogging : NSObject
+ (instancetype)sharedInstance;
@property... | #import <Foundation/Foundation.h>
#import <CocoaLumberjack/CocoaLumberjack.h>
extern DDLogLevel magDebugKitLogLevel;
extern BOOL magDebugKitAsyncLogs;
#ifdef LOG_ASYNC_ENABLED
#undef LOG_ASYNC_ENABLED
#endif
#define LOG_ASYNC_ENABLED magDebugKitAsyncLogs
#ifdef LOG_LEVEL_DEF
#undef LOG_LEVEL_DEF
#endif
#define LO... |
Improve windows min max macro for MFC |
#ifndef LUMINO_MATH_H
#define LUMINO_MATH_H
#include "Lumino/Math/MathUtils.h"
#include "Lumino/Math/Vector2.h"
#include "Lumino/Math/Vector3.h"
#include "Lumino/Math/Vector4.h"
#include "Lumino/Math/Matrix.h"
#include "Lumino/Math/Quaternion.h"
#include "Lumino/Math/AttitudeTransform.h"
#include "Lumino/Math/Geometr... |
#ifndef LUMINO_MATH_H
#define LUMINO_MATH_H
#pragma push_macro("min")
#pragma push_macro("max")
#undef min
#undef max
#include "Lumino/Math/MathUtils.h"
#include "Lumino/Math/Vector2.h"
#include "Lumino/Math/Vector3.h"
#include "Lumino/Math/Vector4.h"
#include "Lumino/Math/Matrix.h"
#include "Lumino/Math/Quaternion.... |
Update test to match 95961. | // Test the -fwritable-strings option.
// RUN: %llvmgcc -O3 -S -o - -emit-llvm -fwritable-strings %s | \
// RUN: grep {private global}
// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep {private constant}
char *X = "foo";
| // Test the -fwritable-strings option.
// RUN: %llvmgcc -O3 -S -o - -emit-llvm -fwritable-strings %s | \
// RUN: grep {internal global}
// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep {private constant}
char *X = "foo";
|
Add a test for unterminated /* comments. | // RUN: c-index-test -test-load-source all %s | FileCheck %s
// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=ERR %s
// CHECK: annotate-comments-unterminated.c:9:5: VarDecl=x:{{.*}} RawComment=[/** Aaa. */]{{.*}} BriefComment=[ Aaa. \n]
// CHECK: annotate-comments-unterminated.c:11:5: VarDecl=y:{{.*}... | |
Check for warnings about inappropriate weak_imports. Darwin-specific; marked XFAIL for others. | // RUN: $llvmgcc $test -c -o /dev/null |& \
// RUN: egrep {(14|15|22): warning:} | \
// RUN: wc -l | grep --quiet 3
// TARGET: *-*-darwin
// XFAIL: alpha|ia64|sparc
// END.
// Insist upon warnings for inappropriate weak attributes.
// Note the line numbers (14|15|22) embedded in the check.
// O.K.
extern int ext_weak_... | |
Add symb_locks test for access in function | // PARAM: --set ana.activated[+] "'var_eq'" --set ana.activated[+] "'symb_locks'"
#include <stdlib.h>
#include <pthread.h>
typedef struct { int myint; pthread_mutex_t mymutex; } mystruct;
void acc(mystruct *s) { s->myint=s->myint+1; } // NORACE
void *foo(void *arg) {
mystruct *s = (mystruct *) arg;
pthread_mut... | |
Allow scenarios inheritance for scenarios::scenario template | #pragma once
#include <vector>
#include <memory>
#include <boost/noncopyable.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/iterator/transform_iterator.hpp>
#include "../factory.h"
#include "../visualisation.h"
#include "../agents.h"
namespace scenarios {
class base... | #pragma once
#include <vector>
#include <memory>
#include <boost/noncopyable.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/iterator/transform_iterator.hpp>
#include "../factory.h"
#include "../visualisation.h"
#include "../agents.h"
namespace scenarios {
class base... |
Fix test to actually check the FixIt-applied code | // RUN: cp %s %t
// RUN: %clang_cc1 -pedantic -fixit %t
// RUN: echo %clang_cc1 -pedantic -Werror -x c %t
/* This is a test of the various code modification hints that are
provided as part of warning or extension diagnostics. All of the
warnings will be fixed by -fixit, and the resulting file should
compile c... | // RUN: cp %s %t
// RUN: %clang_cc1 -pedantic -fixit %t
// RUN: %clang_cc1 -pedantic -Werror -x c %t
/* This is a test of the various code modification hints that are
provided as part of warning or extension diagnostics. All of the
warnings will be fixed by -fixit, and the resulting file should
compile cleanl... |
Add test for large integers | int main() {
// Issue: 3: error: integer literal too large to be represented by any integer type
1000000000000000000000000000;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.