Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Fix clang's stupid warning to work around a bug in OS X headers... | #ifndef _OBJC_MESSAGE_H_
#define _OBJC_MESSAGE_H_
#if defined(__x86_64) || defined(__i386) || defined(__arm__) || \
defined(__mips_n64) || defined(__mips_n32)
/**
* Standard message sending function. This function must be cast to the
* correct types for the function before use. The first argument is the
* receiv... | |
Fix compilation against wlroots without X11 backend | #include <wlr/backend/multi.h>
#include <wlr/backend/wayland.h>
#include <wlr/backend/x11.h>
#include "sway/commands.h"
#include "sway/server.h"
#include "log.h"
static void create_output(struct wlr_backend *backend, void *data) {
bool *done = data;
if (*done) {
return;
}
if (wlr_backend_is_wl(backend)) {
wlr... | #include <wlr/config.h>
#include <wlr/backend/multi.h>
#include <wlr/backend/wayland.h>
#ifdef WLR_HAS_X11_BACKEND
#include <wlr/backend/x11.h>
#endif
#include "sway/commands.h"
#include "sway/server.h"
#include "log.h"
static void create_output(struct wlr_backend *backend, void *data) {
bool *done = data;
if (*done... |
Add systemFile declaration to helper library | #ifndef HELPER_H
#define HELPER_H
/*Helper function for calculating ABSOLUTE maximum of two floats
Will return maximum absolute value (ignores sign) */
float helpFindMaxAbsFloat(float a, float b) {
float aAbs = abs(a);
float bAbs = abs(b);
if (aAbs > bAbs) {
return aAbs;
} else {
return bAbs;
}
}
//Helper ... | #ifndef HELPER_H
#define HELPER_H
#pragma systemFile
/*Helper function for calculating ABSOLUTE maximum of two floats
Will return maximum absolute value (ignores sign) */
float helpFindMaxAbsFloat(float a, float b) {
float aAbs = abs(a);
float bAbs = abs(b);
if (aAbs > bAbs) {
return aAbs;
} else {
return bA... |
Remove over specific header file. | /** @file
The file contain all library function for Ifr Operations.
Copyright (c) 2007 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The ful... | /** @file
The file contain all library function for Ifr Operations.
Copyright (c) 2007 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The ful... |
Fix error for short names | // Start of tuning.h.
static char* load_tuning_file(const char *fname,
void *cfg,
int (*set_size)(void*, const char*, size_t)) {
const int max_line_len = 1024;
char* line = (char*) malloc(max_line_len);
FILE *f = fopen(fname, "r");
if (f == NULL) {
... | // Start of tuning.h.
static char* load_tuning_file(const char *fname,
void *cfg,
int (*set_size)(void*, const char*, size_t)) {
const int max_line_len = 1024;
char* line = (char*) malloc(max_line_len);
FILE *f = fopen(fname, "r");
if (f == NULL) {
... |
Remove "static inline" from C code. | // +build cortexm3 cortexm4 cortexm4f
static inline
uint bits$leadingZeros32(uint32 u) {
uint n;
asm volatile ("clz %0, %1" : "=r" (n) : "r" (u));
return n;
}
static inline
uint bits$leadingZerosPtr(uintptr u) {
uint n;
asm volatile ("clz %0, %1" : "=r" (n) : "r" (u));
return n;
}
static inline
uint bits$leadi... | // +build cortexm3 cortexm4 cortexm4f
uint
bits$leadingZeros32(uint32 u) {
uint n;
asm volatile ("clz %0, %1":"=r" (n):"r"(u));
return n;
}
uint
bits$leadingZerosPtr(uintptr u) {
uint n;
asm volatile ("clz %0, %1":"=r" (n):"r"(u));
return n;
}
uint
bits$leadingZeros64(uint64 u) {
uint n;
asm volatile ("clz %... |
Use memset instead of bzero | /* Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the Licen... | /* Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the Licen... |
Add track_* flags to analysis options to let caller strip it down. | #ifndef CC_ANALYSIS_ANALYSIS_OPTIONS_H_
#define CC_ANALYSIS_ANALYSIS_OPTIONS_H_
#include <cstddef>
struct AnalysisOptions {
AnalysisOptions() :
destutter_max_consecutive(3),
replace_html_entities(true)
{}
// Preprocessing.
size_t destutter_max_consecutive;
// Tokenization.
bo... | #ifndef CC_ANALYSIS_ANALYSIS_OPTIONS_H_
#define CC_ANALYSIS_ANALYSIS_OPTIONS_H_
#include <cstddef>
struct AnalysisOptions {
AnalysisOptions() :
track_index_translation(true),
destutter_max_consecutive(3),
track_chr2drop(true),
replace_html_entities(true)
{}
// General flag... |
Fix iconv warnings on MinGW | #include <iconv.h>
#ifdef WIN32
typedef const char ** readstat_iconv_inbuf_t;
#else
typedef char ** readstat_iconv_inbuf_t;
#endif
typedef struct readstat_charset_entry_s {
int code;
char name[32];
} readstat_charset_entry_t;
| #include <iconv.h>
#ifdef WINICONV_CONST
typedef const char ** readstat_iconv_inbuf_t;
#else
typedef char ** readstat_iconv_inbuf_t;
#endif
typedef struct readstat_charset_entry_s {
int code;
char name[32];
} readstat_charset_entry_t;
|
Add hiredis libuv adapter support. | // Author: Hong Jen-Yee (PCMan) (pcman.hong@appier.com)
#ifndef __libredisCluster_adapters_libuvadapter_h__
#define __libredisCluster_adapters_libuvadapter_h__
#include "adapter.h" // for Adapter
extern "C"
{
#include <hiredis/adapters/libuv.h> // for redisLibeventAttach()
}
namespace RedisCluster
{
// Wrap h... | |
Add support for fast peripheral clock in mcux sim driver | /*
* Copyright (c) 2017, NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_
#define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_
#define KINETIS_SIM_CORESYS_CLK 0
#define KINETIS_SIM_PLATFORM_CLK 1
#define KINETIS_SIM_BUS_CLK 2
#define KINETIS_SIM_LPO_CLK ... | /*
* Copyright (c) 2017, NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_
#define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_KINETIS_SIM_H_
#define KINETIS_SIM_CORESYS_CLK 0
#define KINETIS_SIM_PLATFORM_CLK 1
#define KINETIS_SIM_BUS_CLK 2
#define KINETIS_SIM_FAST_PERI... |
Fix HOST_NAME_MAX not found error on Mac OSX. POSIX compliance pls. | #ifndef _WISH_PROMPT
#define _WISH_PROMPT
/*
* The wish shell prompt has its own format characters, much like how bash,
* zsh, fish, and ksh all have their own formatting characters.
*
* %u - The username of the current user
* %h - The hostname
* %d~n - The top n levels of the working directory. ... | #ifndef _WISH_PROMPT
#define _WISH_PROMPT
/*
* The wish shell prompt has its own format characters, much like how bash,
* zsh, fish, and ksh all have their own formatting characters.
*
* %u - The username of the current user
* %h - The hostname
* %d~n - The top n levels of the working directory. ... |
Remove functions that are private. | #ifndef HAL2_H
#define HAL2_H
// Mechanical constants
extern int const MAIN_MOTOR_PWM_TOP = 255;
extern int const MAIN_MOTOR_BRAKE_SPEED = 120;
extern int const MAIN_MOTOR_MIN_SPEED = 150;
extern int const MAIN_MOTOR_MED_SPEED = 254;
extern int const MAIN_MOTOR_MAX_SPEED = 255;
extern int const MAGNET_OPEN_WAIT = 5; ... | #ifndef HAL2_H
#define HAL2_H
// Mechanical constants
extern int const MAIN_MOTOR_PWM_TOP = 255;
extern int const MAIN_MOTOR_BRAKE_SPEED = 120;
extern int const MAIN_MOTOR_MIN_SPEED = 150;
extern int const MAIN_MOTOR_MED_SPEED = 254;
extern int const MAIN_MOTOR_MAX_SPEED = 255;
extern int const MAGNET_OPEN_WAIT = 5; ... |
Tweak for benchmark. fib(0-91) 1987925/second | #include <stdio.h>
#include <assert.h>
#include "api.h"
#include "lib/math.c"
#include "lib/test.c"
static jack_state_t* state;
static intptr_t jack_fib(intptr_t n) {
jack_new_integer(state, n);
jack_function_call(state, 1, 1);
return jack_get_integer(state, -1);
}
int main() {
for (int j = 0; j < 0x1; ++j)... | #include <stdio.h>
#include <assert.h>
#include "api.h"
#include "lib/math.c"
#include "lib/test.c"
static jack_state_t* state;
static intptr_t jack_fib(intptr_t n) {
jack_new_integer(state, n);
jack_function_call(state, 1, 1);
return jack_get_integer(state, -1);
}
int main() {
state = jack_new_state(20);
... |
Fix gyro measurement noise variance | #include <systemlib/param/param.h>
/*PARAM_DEFINE_FLOAT(NAME,0.0f);*/
PARAM_DEFINE_FLOAT(KF_V_GYRO, 1.0f);
PARAM_DEFINE_FLOAT(KF_V_ACCEL, 1.0f);
PARAM_DEFINE_FLOAT(KF_R_MAG, 1.0f);
PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f);
PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 5.0f);
PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 5.0f);
PARAM_DEFINE_FLOAT... | #include <systemlib/param/param.h>
/*PARAM_DEFINE_FLOAT(NAME,0.0f);*/
PARAM_DEFINE_FLOAT(KF_V_GYRO, 0.008f);
PARAM_DEFINE_FLOAT(KF_V_ACCEL, 1.0f);
PARAM_DEFINE_FLOAT(KF_R_MAG, 1.0f);
PARAM_DEFINE_FLOAT(KF_R_GPS_VEL, 1.0f);
PARAM_DEFINE_FLOAT(KF_R_GPS_POS, 5.0f);
PARAM_DEFINE_FLOAT(KF_R_GPS_ALT, 5.0f);
PARAM_DEFINE_FLO... |
Implement a simple ASCII text image dumper. | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <arpa/inet.h>
#include "idx.h"
int main(int argc, char **argv){
if(argc<2){
printf("Usage: \n");
printf("readlabels t10k-labels-idx1-ubyte \n");
exit(1);
}
char *slabelfname = argv[1];
IDX1_DATA idxdata;
if(!fr... | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <arpa/inet.h>
#include "idx.h"
int main(int argc, char **argv){
if(argc<2){
printf("Usage: \n");
printf("readimages t10k-images-idx3-ubyte \n");
exit(1);
}
char *slabelfname = argv[1];
IDX3_DATA idxdata;
if(!fr... |
Make closure inclusion test visible (to be used from the priced zone part). | #ifndef UDBM_STUBS_H_
#define UDBM_STUBS_H_
#include <vector>
typedef std::vector<int> carray_t;
#define get_cvector(x) ((carray_t*)Data_custom_val(x))
#define get_dbm_ptr(x) static_cast<dbm_t*>(Data_custom_val(x))
#endif // UDBM_STUBS_H_
| #ifndef UDBM_STUBS_H_
#define UDBM_STUBS_H_
#include <vector>
typedef std::vector<int> carray_t;
#define get_cvector(x) ((carray_t*)Data_custom_val(x))
#define get_dbm_ptr(x) static_cast<dbm_t*>(Data_custom_val(x))
bool
dbm_closure_leq(const raw_t * const dr1, const raw_t * const dr2, cindex_t dim,
... |
Add a generic driver model. | // =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of th... | |
Switch to runtime library choice instead of compile time. | #include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#include "firebase.h"
#include "serial.h"
#include "gpio.h"
#define _USE_SERIAL_
#ifdef _USE_SERIAL_
void (*send_command)(bool, int) = send_command_serial;
void (*init_sender)() = init_sender_serial;
#else
void (*send_command)(bool, ... | #include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#include "firebase.h"
#include "serial.h"
#include "gpio.h"
bool useSerial = true;
void init_sender() {
if (useSerial) {
init_sender_serial();
} else {
init_sender_gpio();
}
}
void send_command(bool isOn, int device) {
i... |
Update driver version to 5.02.00-k5 | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2010 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.02.00-k4"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2010 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.02.00-k5"
|
Remove unused st_le*() and ld_le* functions | /*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#ifndef _ASM_POWERPC_SWAB_H
#define _ASM_POWERPC_SWAB_H
#inc... | /*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#ifndef _ASM_POWERPC_SWAB_H
#define _ASM_POWERPC_SWAB_H
#inc... |
Fix error result handling in os.rmdir() | /**
* \file os_rmdir.c
* \brief Remove a subdirectory.
* \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
*/
#include <stdlib.h>
#include "premake.h"
int os_rmdir(lua_State* L)
{
int z;
const char* path = luaL_checkstring(L, 1);
#if PLATFORM_WINDOWS
z = RemoveDirectory(path);
#else
z... | /**
* \file os_rmdir.c
* \brief Remove a subdirectory.
* \author Copyright (c) 2002-2013 Jason Perkins and the Premake project
*/
#include <stdlib.h>
#include "premake.h"
int os_rmdir(lua_State* L)
{
int z;
const char* path = luaL_checkstring(L, 1);
#if PLATFORM_WINDOWS
z = RemoveDirectory(path);
#else
z... |
Add a function return status enum | #ifndef SAXBOPHONE_RISKY_RISKY_H
#define SAXBOPHONE_RISKY_RISKY_H
#include <stdint.h>
#ifdef __cplusplus
extern "C"{
#endif
typedef struct version_t {
uint8_t major;
uint8_t minor;
uint8_t patch;
} version_t;
extern const version_t VERSION;
#ifdef __cplusplus
} // extern "C"
#endif
// end of header f... | #ifndef SAXBOPHONE_RISKY_RISKY_H
#define SAXBOPHONE_RISKY_RISKY_H
#include <stdint.h>
#ifdef __cplusplus
extern "C"{
#endif
// struct for representing version of RISKY
typedef struct version_t {
uint8_t major;
uint8_t minor;
uint8_t patch;
} version_t;
// enum for storing information about the error st... |
Add a missing 'nonatomic' keyword in a property declaration. | //
// KPTableSection.h
// KSPFetchedResultsController
//
// Created by Konstantin Pavlikhin on 05.09.14.
// Copyright (c) 2015 Konstantin Pavlikhin. All rights reserved.
//
#import <Foundation/Foundation.h>
// * * *.
@class NSManagedObject;
// * * *.
@interface KSPTableSection : NSObject
- (nullable instancet... | //
// KPTableSection.h
// KSPFetchedResultsController
//
// Created by Konstantin Pavlikhin on 05.09.14.
// Copyright (c) 2015 Konstantin Pavlikhin. All rights reserved.
//
#import <Foundation/Foundation.h>
// * * *.
@class NSManagedObject;
// * * *.
@interface KSPTableSection : NSObject
- (nullable instancet... |
Add Objective-C headers to umbrella header to make project compile | #import <Foundation/Foundation.h>
FOUNDATION_EXPORT double NimbleVersionNumber;
FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
| #import <Foundation/Foundation.h>
FOUNDATION_EXPORT double NimbleVersionNumber;
FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
#import "DSL.h"
#import "NMBExceptionCapture.h"
|
Remove unused declaration of BuildAppListModel() function. | // 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 ASH_SHELL_EXAMPLE_FACTORY_H_
#define ASH_SHELL_EXAMPLE_FACTORY_H_
#pragma once
namespace app_list {
class AppListModel;
class AppListViewDele... | // 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 ASH_SHELL_EXAMPLE_FACTORY_H_
#define ASH_SHELL_EXAMPLE_FACTORY_H_
#pragma once
namespace app_list {
class AppListViewDelegate;
}
namespace v... |
Make create_branch() return errors if the branch target is too large | /*
* Copyright 2008 Michael Ellerman, IBM 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 later version.
*/
... | /*
* Copyright 2008 Michael Ellerman, IBM 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 later version.
*/
... |
Add asm/mtrr.h include for some builds | /*
* arch/x86_64/kernel/bugs.c
*
* Copyright (C) 1994 Linus Torvalds
* Copyright (C) 2000 SuSE
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <asm/alternative.h>
#include <asm/processor.h>
void __init check_bugs(void)
{
identify_cpu(&boot_cpu_data);
mtrr_bp_init();
#if !defined(CONFIG_SMP)
... | /*
* arch/x86_64/kernel/bugs.c
*
* Copyright (C) 1994 Linus Torvalds
* Copyright (C) 2000 SuSE
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <asm/alternative.h>
#include <asm/processor.h>
#include <asm/mtrr.h>
void __init check_bugs(void)
{
identify_cpu(&boot_cpu_data);
mtrr_bp_init();
#if... |
Update driver version to 5.03.00-k8 | /*
* 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-k7"
| /*
* 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-k8"
|
Bring in the TinyGettext header file. | /* Copyright (c) 2013 Wildfire Games
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish... | |
Fix number of hidden rows in Neurons struct | #include <stdio.h>
#define INPUTS 3
#define HIDDEN 5
#define OUTPUTS 2
#define ROWS 5
typedef struct {
double input[HIDDEN][INPUTS];
double hidden[ROWS - 3][HIDDEN][HIDDEN];
double output[OUTPUTS][HIDDEN];
} Links;
typedef struct {
int input[INPUTS];
int hidden[ROWS - 3][HIDDEN];
int output[O... | #include <stdio.h>
#define INPUTS 3
#define HIDDEN 5
#define OUTPUTS 2
#define ROWS 5
typedef struct {
double input[HIDDEN][INPUTS];
double hidden[ROWS - 3][HIDDEN][HIDDEN];
double output[OUTPUTS][HIDDEN];
} Links;
typedef struct {
int input[INPUTS];
int hidden[ROWS - 2][HIDDEN];
int output[O... |
Make emit explicit inherit for now | /*
* 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... | /*
* 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... |
Remove unused method from header. | //
// LGHTTPRequest.h
// AutoPkgr
//
// Created by Eldon Ahrold on 8/9/14.
// Copyright 2014-2015 The Linde Group, 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
//
// h... | //
// LGHTTPRequest.h
// AutoPkgr
//
// Created by Eldon Ahrold on 8/9/14.
// Copyright 2014-2015 The Linde Group, 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
//
// h... |
Fix stub message having a wrong name | /* Swfdec
* Copyright (C) 2007 Pekka Lampila <pekka.lampila@iki.fi>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any la... | /* Swfdec
* Copyright (C) 2007 Pekka Lampila <pekka.lampila@iki.fi>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any la... |
Fix declarations for file-by-file compile. | /*
* tré – Copyright (c) 2005–2007,2009,2012 Sven Michael Klose <pixel@copei.de>
*/
#ifndef TRE_APPLY_H
#define TRE_APPLY_H
extern treptr function_arguments (treptr);
extern treptr trefuncall (treptr func, treptr args);
extern treptr trebuiltin_call_compiled (void * fun, treptr args);
extern bool trebuiltin_is_... | /*
* tré – Copyright (c) 2005–2007,2009,2012 Sven Michael Klose <pixel@copei.de>
*/
#ifndef TRE_APPLY_H
#define TRE_APPLY_H
extern treptr function_arguments (treptr);
extern treptr trefuncall (treptr func, treptr args);
extern treptr trebuiltin_call_compiled (void * fun, treptr args);
extern bool trebuiltin_is_... |
Include request data and status codes | #ifndef APIMOCK_H
#define APIMOCK_H
#include "core/server.h"
#include "core/exceptions.h"
#include "http/requestdata.h"
#endif | #ifndef APIMOCK_H
#define APIMOCK_H
#include "core/server.h"
#include "core/exceptions.h"
#include "http/requestdata.h"
#include "http/requestdata.h"
#include "http/statuscodes.h"
#endif |
Make the TemplateLoader constructor private for the Singleton pattern. | /*
Copyright (c) 2009 Stephen Kelly <steveire@gmail.com>
*/
#ifndef TEMPLATE_H
#define TEMPLATE_H
#include "context.h"
#include "node.h"
#include "grantlee_export.h"
class GRANTLEE_EXPORT Template //: public QObject
{
// Q_OBJECT
public:
Template(const QString &templateString, QStringList dirs );
QStrin... | /*
Copyright (c) 2009 Stephen Kelly <steveire@gmail.com>
*/
#ifndef TEMPLATE_H
#define TEMPLATE_H
#include "context.h"
#include "node.h"
#include "grantlee_export.h"
class GRANTLEE_EXPORT Template //: public QObject
{
// Q_OBJECT
public:
Template(const QString &templateString, QStringList dirs );
QStrin... |
Fix the test added in r240710. | // REQUIRES: x86-registered-target
// REQUIRES: arm-registered-target
// RUN: %clang -target i386-apple-darwin10 -miphonesimulator-version-min=7.0 -arch i386 -S -o - %s | FileCheck %s
// RUN: %clang -target i386-apple-darwin10 -miphoneos-version-min=7.0 -arch armv7s -S -o - %s | FileCheck %s
int main() { return 0; }
/... | // REQUIRES: x86-registered-target
// REQUIRES: arm-registered-target
// RUN: %clang -target i386-apple-darwin10 -miphonesimulator-version-min=7.0 -arch i386 -S -o - %s | FileCheck %s
// RUN: %clang -target armv7s-apple-darwin10 -miphoneos-version-min=7.0 -arch armv7s -S -o - %s | FileCheck %s
int main() { return 0; }... |
Make test subsystem load itself properly | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012 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... | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012 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... |
Remove nonstandard enum forward decl. | /*
For more information, please see: http://software.sci.utah.edu
The MIT License
Copyright (c) 2012 Scientific Computing and Imaging Institute,
University of Utah.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software")... | /*
For more information, please see: http://software.sci.utah.edu
The MIT License
Copyright (c) 2012 Scientific Computing and Imaging Institute,
University of Utah.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software")... |
Add new example for algorithm | #include "m-dict.h"
#include "m-array.h"
#include "m-algo.h"
#include "m-string.h"
DICT_DEF2(dict, string_t, int)
#define M_OPL_dict_t() DICT_OPLIST(dict, STRING_OPLIST, M_DEFAULT_OPLIST)
ARRAY_DEF(vector_int, int)
#define M_OPL_vector_int_t() ARRAY_OPLIST(vector_int)
#define start_with(pattern, item) ... | |
Create a type to cast Ruby's C functions to a thing C++ is happy with. | extern "C" {
#include "ruby.h"
}
void Define_Document();
void Define_Page();
void Define_PageSet();
| #ifndef __PDFIUM_RUBY_H__
#define __PDFIUM_RUBY_H__
extern "C" {
#include "ruby.h"
}
// Inspired by https://github.com/jasonroelofs/rice/blob/1740a6d12c99fce8c21eda3c5385738318ab9172/rice/detail/ruby.hpp#L33-L37
// Casts C functions into a type that C++ is happy calling
extern "C" typedef VALUE (*CPP_RUBY_METHOD_FU... |
Add another case to qualifier-removal test | // RUN: %check %s
struct A
{
int i;
};
int f(const void *p)
{
struct A *a = p; // CHECK: warning: implicit cast removes qualifiers (const)
struct A *b = (struct A *)p; // CHECK: !/warning:.*cast removes qualifiers/
(void)a;
(void)b;
}
| // RUN: %check %s
struct A
{
int i;
};
void take(void *);
int f(const void *p)
{
struct A *a = p; // CHECK: warning: implicit cast removes qualifiers (const)
struct A *b = (struct A *)p; // CHECK: !/warning:.*cast removes qualifiers/
(void)a;
(void)b;
const char c = 5;
take(&c); // CHECK: warning: implicit ... |
Move a non portable test to FileCheck, from Jonathan Gray! | // RUN: %clang -S -v -o %t %s 2>&1 | not grep -w -- -g
// RUN: %clang -S -v -o %t %s -g 2>&1 | grep -w -- -g
// RUN: %clang -S -v -o %t %s -g0 2>&1 | not grep -w -- -g
// RUN: %clang -S -v -o %t %s -g -g0 2>&1 | not grep -w -- -g
// RUN: %clang -S -v -o %t %s -g0 -g 2>&1 | grep -w -- -g
| // RUN: %clang -S -v -o %t %s 2>&1 | FileCheck %s
// CHECK-NOT: -g
// RUN: %clang -S -v -o %t %s -g 2>&1 | FileCheck %s
// CHECK: -g
// RUN: %clang -S -v -o %t %s -g0 2>&1 | FileCheck %s
// CHECK-NOT: -g
// RUN: %clang -S -v -o %t %s -g -g0 2>&1 | FileCheck %s
// CHECK-NOT: -g
// RUN: %clang -S -v -o ... |
Add command to use it | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2012 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... | |
Work around more GCC nonsense | //------------------------------------------------------------------------------
// Enum.h
// Various enum utilities.
//
// File is under the MIT license; see LICENSE for details.
//------------------------------------------------------------------------------
#pragma once
#define UTIL_ENUM_ELEMENT(x) x,
#define UTIL_... | //------------------------------------------------------------------------------
// Enum.h
// Various enum utilities.
//
// File is under the MIT license; see LICENSE for details.
//------------------------------------------------------------------------------
#pragma once
#define UTIL_ENUM_ELEMENT(x) x,
#define UTIL_... |
Fix undefined GLint in Mac builds |
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkMesaGLContext_DEFINED
#define SkMesaGLContext_DEFINED
#include "SkGLContext.h"
#if SK_MESA
class SkMesaGLContext : public SkGLContext {
private:
typedef intpt... |
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkMesaGLContext_DEFINED
#define SkMesaGLContext_DEFINED
#include "SkGLContext.h"
#if SK_MESA
class SkMesaGLContext : public SkGLContext {
private:
typedef intpt... |
Make static member method private | #ifndef CPR_ERROR_H
#define CPR_ERROR_H
#include <string>
#include "cprtypes.h"
#include "defines.h"
namespace cpr {
enum class ErrorCode {
OK = 0,
CONNECTION_FAILURE,
EMPTY_RESPONSE,
HOST_RESOLUTION_FAILURE,
INTERNAL_ERROR,
INVALID_URL_FORMAT,
NETWORK_RECEIVE_ERROR,
NETWORK_SEND_FAI... | #ifndef CPR_ERROR_H
#define CPR_ERROR_H
#include <string>
#include "cprtypes.h"
#include "defines.h"
namespace cpr {
enum class ErrorCode {
OK = 0,
CONNECTION_FAILURE,
EMPTY_RESPONSE,
HOST_RESOLUTION_FAILURE,
INTERNAL_ERROR,
INVALID_URL_FORMAT,
NETWORK_RECEIVE_ERROR,
NETWORK_SEND_FAI... |
Update import style to add RN 40.0+ compatibility | //
// RNInstabugSDK.h
// RNInstabugSDK
//
// Created by Mark Miyashita on 10/11/16.
// Copyright © 2016 Mark Miyashita. All rights reserved.
//
#import "RCTBridgeModule.h"
#import "RCTConvert.h"
#import "RCTUtils.h"
@interface RNInstabugSDK : NSObject <RCTBridgeModule>
@end
| //
// RNInstabugSDK.h
// RNInstabugSDK
//
// Created by Mark Miyashita on 10/11/16.
// Copyright © 2016 Mark Miyashita. All rights reserved.
//
#if __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"
#import "RCTConvert.h"
#import "RCTUtils.h"
#else
#import "React/RCTBridgeModule.h"
#import "... |
Fix issue in options index. | #include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "cmd.h"
void sh_exit() {
exit(0);
}
void sh_pid() {
printf("%d\n", getpid());
}
void sh_ppid() {
printf("%d\n", getppid());
}
void sh_cd(cmd_args_t args) {
char* dir;
if (args.size == 1) {
dir ... | #include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "cmd.h"
void sh_exit() {
exit(0);
}
void sh_pid() {
printf("%d\n", getpid());
}
void sh_ppid() {
printf("%d\n", getppid());
}
void sh_cd(cmd_args_t args) {
char* dir;
if (args.size == 1) {
dir ... |
Fix erro cb return value | /*
* Copyright 2016 Red Hat Inc., Durham, North Carolina.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your ... | /*
* Copyright 2016 Red Hat Inc., Durham, North Carolina.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your ... |
Update get_dir, get_file decls, add get_pipe decl | /**
* utils.h
*
* Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com>
*/
#ifndef GIT_STASHD_UTILS_H
#define GIT_STASHD_UTILS_H
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "common.h"
#include "signals.h"
#ifdef __APPLE__
#include <limits.h>
#else
#include <linux/limits.h>
#endi... | /**
* utils.h
*
* Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com>
*/
#ifndef GIT_STASHD_UTILS_H
#define GIT_STASHD_UTILS_H
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "common.h"
#include "signals.h"
#ifdef __APPLE__
#include <limits.h>
#else
#include <linux/limits.h>
#endi... |
Fix up definition of off_t for DecAlpha OSF/1 v1.3. | #ifndef FIX_TYPES_H
#define FIX_TYPES_H
#include <sys/types.h>
/*
The system include file defines this in terms of bzero(), but ANSI says
we should use memset().
*/
#if defined(OSF1)
#undef FD_ZERO
#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
#endif
/*
Various non-POSIX conforming files which depend o... | #ifndef FIX_TYPES_H
#define FIX_TYPES_H
// OSF/1 has this as an "unsigned long", but this is incorrect. It
// is used by lseek(), and must be able to hold negative values.
#if defined(OSF1)
#define off_t _hide_off_t
#endif
#include <sys/types.h>
#if defined(OSF1)
#undef off_t
typedef long off_t;
#endif
/*
The sy... |
Update testcase to show that we don't emit an error for sizes <= 32-bits. | // RUN: %clang_cc1 -triple i386-apple-darwin9 -verify %s
// <rdar://problem/12415959>
typedef unsigned int u_int32_t;
typedef u_int32_t uint32_t;
typedef unsigned long long u_int64_t;
typedef u_int64_t uint64_t;
int main () {
uint32_t msr = 0x8b;
uint64_t val = 0;
__asm__ volatile("wrmsr"
:
... | // RUN: %clang_cc1 -triple i386-apple-darwin9 -verify %s
// <rdar://problem/12415959>
typedef unsigned int u_int32_t;
typedef u_int32_t uint32_t;
typedef unsigned long long u_int64_t;
typedef u_int64_t uint64_t;
int main () {
// Error out if size is > 32-bits.
uint32_t msr = 0x8b;
uint64_t val = 0;
__asm__ v... |
Add header file for ap_hook_post_read_request to suppress compiler warnings | #include <uuid/uuid.h>
#include "httpd.h"
#include "http_config.h"
static int generate_uuid(request_rec *r)
{
char *uuid_str;
uuid_t uuid;
uuid_generate_random(uuid);
uuid_str = (char *)apr_palloc(r->pool, sizeof(char)*37);
uuid_unparse_lower(uuid, uuid_str);
apr_table_setn(r->subprocess_env, "UUID", uuid... | #include <uuid/uuid.h>
#include "httpd.h"
#include "http_config.h"
#include "http_protocol.h"
static int generate_uuid(request_rec *r)
{
char *uuid_str;
uuid_t uuid;
uuid_generate_random(uuid);
uuid_str = (char *)apr_palloc(r->pool, sizeof(char)*37);
uuid_unparse_lower(uuid, uuid_str);
apr_table_setn(r->s... |
Print error messages to stderr. | #include <stdio.h>
#include "libsass/sass_interface.h"
int main(int argc, char** argv)
{
int ret;
if (argc < 2) {
printf("Usage: sassc [INPUT FILE]\n");
return 0;
}
struct sass_file_context* ctx = sass_new_file_context();
ctx->options.include_paths = "";
ctx->options.image_path = "images";
ctx->options.ou... | #include <stdio.h>
#include "libsass/sass_interface.h"
int main(int argc, char** argv)
{
int ret;
if (argc < 2) {
printf("Usage: sassc [INPUT FILE]\n");
return 0;
}
struct sass_file_context* ctx = sass_new_file_context();
ctx->options.include_paths = "";
ctx->options.image_path = "images";
ctx->options.ou... |
Add an enum_to_string util function | /*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2021 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free ... | |
Patch from Fabio Massimo Di Nitto: Fix includes | #include <sys/types.h>
#include <linux/unistd.h>
#include <gettid.h>
#include <errno.h>
/* Patch from Adam Conrad / Ubuntu: Don't use _syscall macro */
#ifdef __NR_gettid
pid_t gettid (void)
{
return syscall(__NR_gettid);
}
#else
#warn "gettid not available -- substituting with pthread_self()"
#include <pthread.h>... | #include <sys/types.h>
#include <sys/syscall.h>
#include <linux/unistd.h>
#include <gettid.h>
#include <errno.h>
#include <unistd.h>
/* Patch from Adam Conrad / Ubuntu: Don't use _syscall macro */
#ifdef __NR_gettid
pid_t gettid (void)
{
return syscall(__NR_gettid);
}
#else
#warn "gettid not available -- substituti... |
Fix test added in 6fe29dd | typedef int myint;
myint x = (myint)1;
| typedef int myint;
myint x = (myint)1;
int
main(void)
{
return x-1;
}
|
Change any tabs to spaces | #ifndef SIMULATOR_H
#define SIMULATOR_H
#include "ros/ros.h"
#include "dynamics.h"
#include "sensor_msgs/Imu.h"
#include "sensor_msgs/FluidPressure.h"
#include "nav_msgs/Odometry.h"
#include "geometry_msgs/Wrench.h"
#include "geometry_msgs/Pose.h"
#include "vortex_msgs/Float64ArrayStamped.h"
#include </usr/include/arm... | #ifndef SIMULATOR_H
#define SIMULATOR_H
#include "ros/ros.h"
#include "dynamics.h"
#include "sensor_msgs/Imu.h"
#include "sensor_msgs/FluidPressure.h"
#include "nav_msgs/Odometry.h"
#include "geometry_msgs/Wrench.h"
#include "geometry_msgs/Pose.h"
#include "vortex_msgs/Float64ArrayStamped.h"
#include </usr/include/arm... |
Add the begginning of lab1 | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int port;
char *directory;
// Command Line Arguments //
if (argc < 3) {
printf("usage: %s <port> <dir>\n", argv[0]);
return 1;
}
port = atoi(argv[1]);
directory = argv[2];
if (port <= 0) {
... | |
Fix a path in the translation loop test | /* liblouis Braille Translation and Back-Translation Library
Copyright (C) 2014 Mesar Hameed <mesar.hameed@gmail.com>
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is... | /* liblouis Braille Translation and Back-Translation Library
Copyright (C) 2014 Mesar Hameed <mesar.hameed@gmail.com>
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is... |
Fix for last commit: adding new test file forgotten. | // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
// expected-no-diagnostics
int foo(int a, int b) {
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b; b -= a;
a += b... | |
Use ds_linked_list_length() instead of the size struct member. | #include <stdio.h>
#include <datastructs.h>
int main(){
typedef struct user_data {
char name[100];
char email[100];
} user_data;
user_data a = {"John Doe", "john.doe@mail_server.com"};
user_data b = {"Jack Smith", "jack.smith@mail_server.com"};
user_data c = {"Jane Plain", "ja... | #include <stdio.h>
#include <datastructs.h>
int main(){
typedef struct user_data {
char name[100];
char email[100];
} user_data;
user_data a = {"John Doe", "john.doe@mail_server.com"};
user_data b = {"Jack Smith", "jack.smith@mail_server.com"};
user_data c = {"Jane Plain", "ja... |
Add Roman Numerals to homework | #include <stdio.h>
#include <string.h>
int getRomanValue(char number);
int checkRomanValue(char romanNumber[20]);
int main()
{
char romanNumber[20];
int i, curNum;
while(1)
{
curNum=0;
printf("Input roman number: ");
scanf("%s", romanNumber);
if(checkRomanN(romanNumber)==0)
{
printf("Input a valid roma... | |
Fix static linking problem with LuaJIT | #ifndef COMPAT_H
#define COMPAT_H
#include "lua.h"
#include "lauxlib.h"
#if LUA_VERSION_NUM==501
void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
void *luaL_testudata ( lua_State *L, int arg, const char *tname);
#endif
#endif
| #ifndef COMPAT_H
#define COMPAT_H
#include "lua.h"
#include "lauxlib.h"
#if LUA_VERSION_NUM==501
#define luaL_setfuncs socket_setfuncs
#define luaL_testudata socket_testudata
void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
void *luaL_testudata ( lua_State *L, int arg, const char *tname);
#endif
#endif... |
Solve Average 2 in c | #include <stdio.h>
int main() {
float a, b, c;
scanf("%f", &a);
scanf("%f", &b);
scanf("%f", &c);
printf("MEDIA = %.1f\n", (a * 2.0 + b * 3.0 + c * 5.0) / 10.0);
return 0;
}
| |
Use PLClang.h in umbrella header | /*
* Author: Landon Fuller <landonf@plausible.coop>
*
* Copyright (c) 2013 Plausible Labs Cooperative, Inc.
* All rights reserved.
*
* 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 wi... | /*
* Author: Landon Fuller <landonf@plausible.coop>
*
* Copyright (c) 2013 Plausible Labs Cooperative, Inc.
* All rights reserved.
*
* 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 wi... |
Include <string> to fix a compile issue in 4.12 and 4.13. | // Copyright (C) 2011 Carl Rogers
// Released under MIT License
// Simplied by Weichao Qiu (qiuwch@gmail.com) from https://github.com/rogersce/cnpy
#pragma once
#include <vector>
namespace cnpy {
template<typename T>
std::vector<char> create_npy_header(const T* data, const std::vector<int> shape);
template<typena... | // Copyright (C) 2011 Carl Rogers
// Released under MIT License
// Simplied by Weichao Qiu (qiuwch@gmail.com) from https://github.com/rogersce/cnpy
#pragma once
#include <vector>
#include <string>
namespace cnpy {
template<typename T>
std::vector<char> create_npy_header(const T* data, const std::vector<int> shape);... |
Update driver version to 5.04.00-k6 | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2013 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.04.00-k5"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2013 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.04.00-k6"
|
Add documentation comments for method | //
// NAPlaybackIndicatorView.h
// PlaybackIndicator
//
// Created by Yuji Nakayama on 1/27/14.
// Copyright (c) 2014 Yuji Nakayama. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface NAPlaybackIndicatorView : UIView
- (void)startAnimating;
- (void)stopAnimating;
@property (nonatomic, readonly, getter=i... | //
// NAPlaybackIndicatorView.h
// PlaybackIndicator
//
// Created by Yuji Nakayama on 1/27/14.
// Copyright (c) 2014 Yuji Nakayama. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface NAPlaybackIndicatorView : UIView
/**
Starts the oscillating animation of the bars.
*/
- (void)startAnimating;
/**
Sto... |
Fix the constants so it will work correctly. Also add the possibility of a different Product ID so the dongles can be set to a mode that Windows machines with the CSR drivers won't switch them to HCI mode. | #include <stdio.h>
#include <libusb-1.0/libusb.h>
int main (int argc, char ** argv) {
char data[] = { 0x01, 0x05, 0, 0, 0, 0, 0, 0, 0 };
libusb_init(NULL);
libusb_device_handle* h = libusb_open_device_with_vid_pid(NULL, 0x0a12, 0x100b);
if (!h) {
printf("No device in HID mode found\n");
} else {
libu... | #include <stdio.h>
#include <libusb-1.0/libusb.h>
int main (int argc, char ** argv) {
char data[] = { 0x01, 0x05, 0, 0, 0, 0, 0, 0, 0 };
libusb_init(NULL);
/* using the default pskeys, devices from the factory are a12:100d in HID mode */
libusb_device_handle* h = libusb_open_device_with_vid_pid(NULL, 0x0a12, 0... |
Add missing file in previous commit. | //===-- llvm/CodeGen/GlobalISel/CallLowering.h - Call lowering --*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | |
Move JSON parser into libslax | /*
* $Id$
*
* Copyright (c) 2013, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
* using the SOFTWARE, you agree to be bound by the terms of that
* LICENSE.
*
* jsonwriter.h -- t... | |
Make c bindings compile on strict compilers | /*
** Author(s):
** - Cedric GESTES <gestes@aldebaran-robotics.com>
**
** Copyright (C) 2010 Aldebaran Robotics
*/
#include <qi/qi.h>
#include <stdio.h>
int main(int argc, char **argv)
{
qi_client_t *client = qi_client_create("simplecli", argv[1]);
qi_message_t *message = qi_message_create();
qi_message_t *re... | /*
** Author(s):
** - Cedric GESTES <gestes@aldebaran-robotics.com>
**
** Copyright (C) 2010 Aldebaran Robotics
*/
#include <qi/qi.h>
#include <stdio.h>
int main(int argc, char **argv)
{
char *result;
qi_client_t *client = qi_client_create("simplecli", argv[1]);
qi_message_t *message = qi_message_create();
... |
Change the ssw_navigationBarShadowImage to the @optional | //
// SloppySwiperViewControllerProtocol.h
// Pods
//
// Created by Yu Sugawara on 7/8/15.
//
//
#import <UIKit/UIKit.h>
@protocol SloppySwiperViewControllerProtocol <NSObject>
- (UIBarStyle)ssw_navigationBarStyle;
- (UIColor *)ssw_navigationBarColor;
- (UIColor *)ssw_navigationBarItemColor;
- (UIImage *)ssw_navi... | //
// SloppySwiperViewControllerProtocol.h
// Pods
//
// Created by Yu Sugawara on 7/8/15.
//
//
#import <UIKit/UIKit.h>
@protocol SloppySwiperViewControllerProtocol <NSObject>
- (UIBarStyle)ssw_navigationBarStyle;
- (UIColor *)ssw_navigationBarColor;
- (UIColor *)ssw_navigationBarItemColor;
@optional
- (UIImage... |
Update master branch version to 1.3 | //-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//---------------------------------------------------------... | //-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//---------------------------------------------------------... |
Add stub for XYZ coordinates. | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2021 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundati... | |
Return const & from getters | #ifndef SUBSCRIPTION_H
#define SUBSCRIPTION_H
#include <memory>
#include <sstream>
#include <string>
#include "../../message.h"
#include "../../result.h"
class WindowsWorkerPlatform;
class Subscription
{
public:
Subscription(ChannelID channel,
HANDLE root,
const std::wstring &path,
bool recursive,
... | #ifndef SUBSCRIPTION_H
#define SUBSCRIPTION_H
#include <memory>
#include <sstream>
#include <string>
#include "../../message.h"
#include "../../result.h"
class WindowsWorkerPlatform;
class Subscription
{
public:
Subscription(ChannelID channel,
HANDLE root,
const std::wstring &path,
bool recursive,
... |
Use version with replaced \177 | #define L for(char*c=a[1],y;*c;)printf("%c%c%c%c",(y="w$]m.k{%\177o"[*c++-48])&u/4?33:32,y&u?95:32,y&u/2?33:32,*c?32:10);u*=8;
main(int u,char**a){u=1;L;L;L} | #define L for(char*c=a[1],y;*c;)printf("%c%c%c%c",(y="w$]m.k{%o"[*c++-48])&u/4?33:32,y&u?95:32,y&u/2?33:32,*c?32:10);u*=8;
main(int u,char**a){u=1;L;L;L} |
Add solution for problem 6 | #include <stdio.h>
#include <math.h>
#include "euler.h"
#define PROBLEM 6
#define ANSWER 25164150
int
main(int argc, char **argv)
{
double sum = 0, square = 0;
for(double x = 0; x <= 100; x++) {
sum += pow(x, 2.0);
square += x;
}
square = pow(square, 2.0);
double result = square -... | |
Add a new test case | // RUN: rm -fr %t.prof
// RUN: %clang_pgogen=%t.prof/ -o %t.gen.cs -O2 %s
// RUN: %t.gen.cs
// RUN: llvm-profdata merge -o %t.cs.profdata %t.prof/
// Check context sensitive profile
// RUN: %clang_profuse=%t.cs.profdata -O2 -emit-llvm -S %s -o - | FileCheck %s --check-prefix=CS
//
// RUN: %clang_profgen=%t.profraw -o ... | |
Move nullable to the property attributes | //
// RZFReleaseNotes.h
// FreshAir
//
// Created by Brian King on 1/26/16.
// Copyright © 2016 Raizlabs. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class RZFRelease, RZFFeature;
@interface RZFReleaseNotes : NSObject
+ (instancetype)releaseNotesWithURL:(NSURL *)URL error... | //
// RZFReleaseNotes.h
// FreshAir
//
// Created by Brian King on 1/26/16.
// Copyright © 2016 Raizlabs. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class RZFRelease, RZFFeature;
@interface RZFReleaseNotes : NSObject
+ (instancetype)releaseNotesWithURL:(NSURL *)URL error... |
Change to a more standard errno in pt_strerror_r() |
#include <assert.h>
#include <string.h>
#include <errno.h>
#include "pt_error.h"
static struct {
const enum pt_error err;
const char* const str;
} pt_error_map[PT_LAST] = {
{ PT_SUCCESS, "Success" },
};
static char* pt_strncpy(char* dst, const char* src, size_t n)
{
if(n > 0) {
int len = strnlen(src, n);
(... |
#include <assert.h>
#include <string.h>
#include <errno.h>
#include "pt_error.h"
static struct {
const enum pt_error err;
const char* const str;
} pt_error_map[PT_LAST] = {
{ PT_SUCCESS, "Success" },
};
static char*
pt_strncpy(char* dst, const char* src, size_t n)
{
if(n > 0) {
int len = strnlen(src, n);
(... |
Test commit in feature branch | file4.c - r1
Test checkin in master1-updated
Test checkin in master2
| file4.c - r1
Test checkin in master1-updated - updated2
Test checkin in master2
Test checkin in master3
|
Add test case for hidden alias | #include <stdlib.h>
volatile int func() {
return 4;
}
volatile int func2() __attribute__ ((visibility ("hidden"), alias ("func")));
int main() {
if (func2() != 4) {
abort();
}
}
| |
Add unicode to supported type codes | #pragma once
namespace turbodbc {
/**
* This enumeration assigns integer values to certain database types
*/
enum class type_code : int {
boolean = 0, ///< boolean type
integer = 10, ///< integer types
floating_point = 20, ///< floating point types
string = 30, ///< string types
timestamp = 40, ///< ti... | #pragma once
namespace turbodbc {
/**
* This enumeration assigns integer values to certain database types
*/
enum class type_code : int {
boolean = 0, ///< boolean type
integer = 10, ///< integer types
floating_point = 20, ///< floating point types
string = 30, ///< string typ... |
Convert this test to FileCheck instead of grepping LLVM IR. | // RUN: %clang_cc1 -emit-llvm < %s | grep 'fastcallcc' | count 6
// RUN: %clang_cc1 -emit-llvm < %s | grep 'stdcallcc' | count 6
void __attribute__((fastcall)) f1(void);
void __attribute__((stdcall)) f2(void);
void __attribute__((fastcall)) f3(void) {
f1();
}
void __attribute__((stdcall)) f4(void) {
f2();
}
// PR... | // RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s
void __attribute__((fastcall)) f1(void);
void __attribute__((stdcall)) f2(void);
void __attribute__((fastcall)) f3(void) {
// CHECK: define x86_fastcallcc void @f3()
f1();
// CHECK: call x86_fastcallcc void @f1()
}
void __attribute__((stdcall)) f4(void) {
// CHECK: d... |
Fix client crash from changing item to nothing | #include "server/client.h"
#include "server/packet.h"
#include "blocks/items.h"
void packet_send_entity_equipment(struct client *client, struct client *c, uint16_t slot, struct item *item, uint16_t damage)
{
bedrock_packet packet;
struct item_stack stack;
stack.id = item->id;
stack.count = 1;
stack.metadata = da... | #include "server/client.h"
#include "server/packet.h"
#include "blocks/items.h"
void packet_send_entity_equipment(struct client *client, struct client *c, uint16_t slot, struct item *item, uint16_t damage)
{
bedrock_packet packet;
struct item_stack stack;
stack.id = item->id ? item->id : -1;
stack.count = 1;
sta... |
Use placement new to initalise objects |
#pragma once
template<class T, size_t BufferSize, class StarvationCallbacks>
class AllocationPool {
public:
~AllocationPool()
{
while (!m_FreeList.empty())
{
delete m_FreeList.front();
m_FreeList.pop_front();
}
}
T* Allocate()
{
if (m_FreeList.Size() <= BufferSize)
{
try
... |
#pragma once
template<class T, size_t BufferSize, class StarvationCallbacks>
class AllocationPool {
public:
~AllocationPool()
{
while (!m_FreeList.empty())
{
delete m_FreeList.front();
m_FreeList.pop_front();
}
}
T* Allocate()
{
if (m_FreeList.Size() <= BufferSize)
{
try
... |
Write more brief function descriptions. | #ifndef CORRCHECK_H
#define CORRCHECK_H
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <dirent.h>
#include <iostream>
#include <map>
#include <openssl/ssl.h>
#include <string>
#include <sys/stat.h>
#include <vector>
#include "corrcheck_defines.h"
#include "File.h"
int create_database(const std::str... | #ifndef CORRCHECK_H
#define CORRCHECK_H
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <dirent.h>
#include <iostream>
#include <map>
#include <openssl/ssl.h>
#include <string>
#include <sys/stat.h>
#include <vector>
#include "corrcheck_defines.h"
#include "File.h"
/*
Create a .corrcheckdb of the ... |
Expand web::BrowserState to add GetPath() method | // Copyright 2013 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 IOS_WEB_PUBLIC_BROWSER_STATE_H_
#define IOS_WEB_PUBLIC_BROWSER_STATE_H_
#include "base/supports_user_data.h"
namespace net {
class URLRequestCon... | // Copyright 2013 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 IOS_WEB_PUBLIC_BROWSER_STATE_H_
#define IOS_WEB_PUBLIC_BROWSER_STATE_H_
#include "base/supports_user_data.h"
namespace base {
class FilePath;
}
... |
Add level field in playercontroller | #ifndef SCORE_H_INCLUDED
#define SCORE_H_INCLUDED
#define FOOD1_SCORE 15 //Titik
#define FOOD2_SCORE 100 //Sedap Malam
#define FOOD3_SCORE 300 //Menyan
#define FOOD4_SCORE 500 //Melati
#define FOOD5_SCORE 700 //Kopi Hitam
typedef struct{
char *name;
int score;
int lives;
int foodCount;
pacmanController peciman;
... | #ifndef SCORE_H_INCLUDED
#define SCORE_H_INCLUDED
#define FOOD1_SCORE 15 //Titik
#define FOOD2_SCORE 100 //Sedap Malam
#define FOOD3_SCORE 300 //Menyan
#define FOOD4_SCORE 500 //Melati
#define FOOD5_SCORE 700 //Kopi Hitam
typedef struct{
char *name;
int score;
int lives;
int foodCount;
int level;
pacmanControll... |
Remove extraneous ; on function definition | #pragma once
#include <cstdint>
inline uint16_t compose_bytes(const uint8_t low, const uint8_t high) {
return (high << 8) + low;
};
inline bool check_bit(const uint8_t value, int bit) {
return (value & (1 << bit)) != 0;
};
inline uint8_t set_bit(const uint8_t value, int bit) {
return static_cast<uint8_t... | #pragma once
#include <cstdint>
inline uint16_t compose_bytes(const uint8_t low, const uint8_t high) {
return (high << 8) + low;
}
inline bool check_bit(const uint8_t value, int bit) {
return (value & (1 << bit)) != 0;
}
inline uint8_t set_bit(const uint8_t value, int bit) {
return static_cast<uint8_t>(... |
Add support for MS 'EVEN' directive | // RUN: %clang_cc1 %s -triple i386-unknown-unknown -fasm-blocks -emit-llvm -o - | FileCheck %s
// CHECK: .byte 64
// CHECK: .byte 64
// CHECK: .byte 64
// CHECK: .even
void t1() {
__asm {
.byte 64
.byte 64
.byte 64
EVEN
mov eax, ebx
}
}
| // REQUIRES: x86-registered-target
// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fasm-blocks -emit-llvm -o - | FileCheck %s
// CHECK: .byte 64
// CHECK: .byte 64
// CHECK: .byte 64
// CHECK: .even
void t1() {
__asm {
.byte 64
.byte 64
.byte 64
EVEN
mov eax, ebx
}
}
|
Add Chapter 27, exercise 14 | /* Chapter 27, exercise 14: write a function that takes an array of int as input
and finds the smallest and the largest elements as well as the median and
mean; return the result in a struct holding the values */
#include<stddef.h>
#include<string.h>
#include<stdlib.h>
#include<assert.h>
#include<stdio.h>
struc... | |
Add two more check to x.chk_env a) make sure host name have at least one dot b) add a http test | #include <stdio.h>
#ifdef WIN32
#include <io.h>
#include <fcntl.h>
#endif
int
gethost_main()
{
extern char *sccs_gethost();
char *host;
#ifdef WIN32
setmode(1, _O_BINARY);
#endif
host = sccs_gethost();
if ((host == NULL) || (*host == '\0')) return (1);
printf("%s\n", host);
return (0);
}
| #include <stdio.h>
#ifdef WIN32
#include <io.h>
#include <fcntl.h>
#endif
int
gethost_main()
{
extern char *sccs_gethost();
char *host;
#ifdef WIN32
setmode(1, _O_BINARY);
#endif
host = sccs_gethost();
if ((host == NULL) || (*host == '\0')) return (1);
printf("%s\n", host);
/* make isure we have a good domain... |
Refactor render method to make it simpler | #ifndef RASTERIZER_H
#define RASTERIZER_H
#include <string>
#include "Renderer.h"
class Rasterizer : public Renderer {
private:
const float k_a = 0.1;
const RGBColor AMBIENT_COLOR = RGBColor(1.0f, 1.0f, 1.0f);
public:
Rasterizer();
Rasterizer(World* world, const uint16_t image_width, const uint16_t image_hei... | #ifndef RASTERIZER_H
#define RASTERIZER_H
#include <string>
#include "Renderer.h"
class Rasterizer : public Renderer {
private:
const float k_a = 0.1;
const RGBColor AMBIENT_COLOR = RGBColor(1.0f, 1.0f, 1.0f);
public:
Rasterizer();
Rasterizer(World* world, const uint16_t image_width, const uint16_t image_hei... |
Print welcome message with application name and newline. | /* shadowVIC – Copyright (c) 2015 Sven Michael Klose <pixel@hugbox.org> */
#include <stdio.h>
#include "types.h"
#include "config.h"
#include "6502.h"
#include "shadowvic.h"
#include "joystick.h"
#include "video.h"
#include "sync.h"
#define FALSE 0
#define TRUE 1
int
main (int argc, char * argv[])
{
struct... | /* shadowVIC – Copyright (c) 2015 Sven Michael Klose <pixel@hugbox.org> */
#include <stdio.h>
#include "types.h"
#include "config.h"
#include "6502.h"
#include "shadowvic.h"
#include "joystick.h"
#include "video.h"
#include "sync.h"
#define FALSE 0
#define TRUE 1
int
main (int argc, char * argv[])
{
struct... |
Send '0x5A' across UART continuously. |
#include "main.h"
#include <msp430.h>
#include "led_driver.h"
int main(void)
{
WDTCTL = WDTPW + WDTHOLD;
led_initialize((led_addresses_s*)P1IN_);
P1DIR = 0x04;
P1SEL = 0x06;
UCA0CTL0 = 0x00;
UCA0CTL1 = UCSSEL_3;
UCA0BR0 = 104;
UCA0BR1 = 0x00;
UCA0MCTL = 0x03 << 4;
set_led_color(LED_GREEN);
while(... |
#include "main.h"
#include <msp430.h>
#include "led_driver.h"
void main(void)
{
WDTCTL = WDTPW + WDTHOLD;
//Set clock to 1MHz
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
led_initialize((led_addresses_s*)P1IN_);
P1DIR |= 0x04;
P1SEL |= 0x06;
P1SEL2 |= 0x06;
UCA0CTL0 |= 0x00;
UCA0CTL1 |= UCSSEL_2;
U... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.