Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add solution for exercise 17. | /** Exercise 1.17
* Write a program to print all input lines that are longer than 80 characters.
*/
#include <stdio.h>
#define MINLINE 80
main() {
int i, buffer_printed;
char buffer[MINLINE + 1];
char c;
i = buffer_printed = 0;
buffer[MINLINE] = '\0';
while ((c = getchar()) != EOF) {
... | |
Update Clang to reflect the new home of IRBuilder.h as of r159421. | //===-- CGBuilder.h - Choose IRBuilder implementation ----------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===-- CGBuilder.h - Choose IRBuilder implementation ----------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Add configure result checks on odbc, per Peter E. | /* 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: 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
/*... |
Fix test (it was incorrectly succeeding). | // RUN: clang -emit-llvm < %s
void* a(unsigned x) {
return __builtin_return_address(0);
}
void* c(unsigned x) {
return __builtin_frame_address(0);
}
// RUN: clang -emit-llvm < %s
void* a(unsigned x) {
return __builtin_return_address(0);
}
void* c(unsigned x) {
return __builtin_frame_address(0);
}
| // RUN: clang -emit-llvm < %s | grep "llvm.returnaddress"
// RUN: clang -emit-llvm < %s | grep "llvm.frameaddress"
void* a(unsigned x) {
return __builtin_return_address(0);
}
void* c(unsigned x) {
return __builtin_frame_address(0);
}
|
Implement internal representation of Color. This will help represent the component values of colors with respect to their colorspace | //******************************************************************************
//
// Copyright (c) Microsoft. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARR... | |
Use triple /s replace double /s. | //
// OCTClient+Issues.h
// OctoKit
//
// Created by leichunfeng on 15/3/7.
// Copyright (c) 2015年 GitHub. All rights reserved.
//
#import <OctoKit/OctoKit.h>
@interface OCTClient (Issues)
// Creates an issue.
//
// title - The title of the issue. This must not be nil.
// body - The contents of the is... | //
// OCTClient+Issues.h
// OctoKit
//
// Created by leichunfeng on 15/3/7.
// Copyright (c) 2015年 GitHub. All rights reserved.
//
#import <OctoKit/OctoKit.h>
@interface OCTClient (Issues)
/// Creates an issue.
///
/// title - The title of the issue. This must not be nil.
/// body - The contents of th... |
UPDATE Door.h initialize standard values | #ifndef SSPAPPLICATION_ENTITIES_DOORENTITY_H
#define SSPAPPLICATION_ENTITIES_DOORENTITY_H
#include "Entity.h"
class DoorEntity :
public Entity
{
private:
bool m_isOpened;
float m_minRotation;
float m_maxRotation;
float m_rotateTime;
float m_rotatePerSec;
public:
DoorEntity();
virtual ~DoorEntity();
int Ini... | #ifndef SSPAPPLICATION_ENTITIES_DOORENTITY_H
#define SSPAPPLICATION_ENTITIES_DOORENTITY_H
#include "Entity.h"
class DoorEntity :
public Entity
{
private:
bool m_isOpened;
float m_minRotation;
float m_maxRotation;
float m_rotateTime;
float m_rotatePerSec;
public:
DoorEntity();
virtual ~DoorEntity();
int Ini... |
Use the typedef read_function_t for readability | #ifndef LIBCWAP_H
#define LIBCWAP_H
#include <stddef.h>
#include <inttypes.h>
typedef uint32_t time_t;
typedef size_t (*read_function_t)(char *, size_t);
#define CWAP_TIME_REQUEST '\t'
#define CWAP_TIME_SET 'T'
#define CWAP_SET_ALARM_TIMESTAMP 'O'
struct libcwap_functions {
void (*time_request_function)(void);... | #ifndef LIBCWAP_H
#define LIBCWAP_H
#include <stddef.h>
#include <inttypes.h>
typedef uint32_t time_t;
typedef size_t (*read_function_t)(char *, size_t);
#define CWAP_TIME_REQUEST '\t'
#define CWAP_TIME_SET 'T'
#define CWAP_SET_ALARM_TIMESTAMP 'O'
struct libcwap_functions {
void (*time_request_function)(void);... |
Make a 32bit union for receiving data rather than shady casting | #include <stdlib.h>
#include "libcwap.h"
struct libcwap_functions * registered_functions = NULL;
void libcwap_action(size_t (*read_function)(char *, size_t)) {
char action;
if (!read_function(&action, 1))
return;
// Remember to increase the buffer if we want to receive larger packets.
char d... | #include <stdlib.h>
#include "libcwap.h"
struct libcwap_functions * registered_functions = NULL;
typedef union {
char chars[4];
uint32_t uinteger;
int32_t integer;
} data32_t;
void libcwap_action(size_t (*read_function)(char *, size_t)) {
char action;
if (!read_function(&action, 1))
retu... |
Update name of compiler-rt routine for setting filename | // Check that the -fprofile-instr-generate= form works.
// RUN: %clang_cc1 -main-file-name c-generate.c %s -o - -emit-llvm -fprofile-instr-generate=c-generate-test.profraw | FileCheck %s
// CHECK: private constant [24 x i8] c"c-generate-test.profraw\00"
// CHECK: call void @__llvm_profile_set_filename_env_override(i8*... | // Check that the -fprofile-instr-generate= form works.
// RUN: %clang_cc1 -main-file-name c-generate.c %s -o - -emit-llvm -fprofile-instr-generate=c-generate-test.profraw | FileCheck %s
// CHECK: private constant [24 x i8] c"c-generate-test.profraw\00"
// CHECK: call void @__llvm_profile_override_default_filename(i8*... |
Simplify code to use get_at method with its get & create semantic | #include "../common.c"
#include "m-dict.h"
static inline bool oor_equal_p(unsigned int k, unsigned char n)
{
return k == (unsigned int)n;
}
static inline void oor_set(unsigned int *k, unsigned char n)
{
*k = (unsigned int)n;
}
DICT_OA_DEF2(dict_oa_uint,
unsigned int, M_OPEXTEND(M_DEFAULT_OPLIST, OOR_EQUAL(o... | #include "../common.c"
#include "m-dict.h"
static inline bool oor_equal_p(unsigned int k, unsigned char n)
{
return k == (unsigned int)n;
}
static inline void oor_set(unsigned int *k, unsigned char n)
{
*k = (unsigned int)n;
}
DICT_OA_DEF2(dict_oa_uint,
unsigned int, M_OPEXTEND(M_DEFAULT_OPLIST, OOR_EQUAL(o... |
Fix file include bug (cocos Vector<T>) | #pragma once
class StageInformation;
class Collider;
class Bullet;
class Sling;
class ColliderManager
{
public:
ColliderManager() {}
~ColliderManager() {}
void InitBullets(StageInformation* si);
void ResetBullets();
Bullet* GetBulletToShot(Sling* sling);
Vector<Collider*>& GetColliders(){ return colliders; }
... | #pragma once
#include "Collider.h"
class StageInformation;
class Bullet;
class Sling;
class ColliderManager
{
public:
ColliderManager() {}
~ColliderManager() {}
void InitBullets(StageInformation* si);
void ResetBullets();
Bullet* GetBulletToShot(Sling* sling);
Vector<Collider*>& GetColliders(){ return collider... |
Change on_key term event to on_key_press | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* libft_trm.h :+: :+: :+: ... | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* libft_trm.h :+: :+: :+: ... |
Reorganize macros related to memory layout | #ifndef MEMLAYOUT_H
#define MEMLAYOUT_H
#include <stdint.h>
#define KERNEL_START ((uint32_t)&kernel_start)
#define KERNEL_END ((uint32_t)&kernel_end)
#define KERNEL_SIZE (KERNEL_START - KERNEL_END)
#define VIDEO_MEMORY_BEGIN 0xB8000
#define VIDEO_MEMORY_SIZE (80 * 24)
#define VIRTUAL_TO_PHYSICAL(addr) ((uint32_t)(a... | #ifndef MEMLAYOUT_H
#define MEMLAYOUT_H
#include <stdint.h>
// These two variables are defined by the linker. They are located where you
// would expect based on the names.
extern uint32_t kernel_start;
extern uint32_t kernel_end;
#define KERNEL_END ((uint32_t)&kernel_end)
#define KERNEL_START ((uint32_t)&kernel_sta... |
Use stop_tone() if velocity set to 0 | #ifndef F_CPU
#define F_CPU F_OSC
#endif
#include <avr/io.h>
#include <avr/interrupt.h>
#include <ctype.h>
#include <math.h>
#include <stdint.h>
#include <util/delay.h>
#include "config.h"
#include "nco.h"
#include "uart.h"
static void handle_midi(void);
int main(void);
__attribute__((optimize("unroll-loops")))
stat... | #ifndef F_CPU
#define F_CPU F_OSC
#endif
#include <avr/io.h>
#include <avr/interrupt.h>
#include <ctype.h>
#include <math.h>
#include <stdint.h>
#include <util/delay.h>
#include "config.h"
#include "nco.h"
#include "uart.h"
static void handle_midi(void);
int main(void);
__attribute__((optimize("unroll-loops")))
stat... |
Fix itype int -> error. | /* --------------------------------------------------------------------------
* Name: walk.c
* Purpose: Associative array implemented as a hash
* ----------------------------------------------------------------------- */
#include <stdlib.h>
#include "base/memento/memento.h"
#include "base/errors.h"
#include "... | /* --------------------------------------------------------------------------
* Name: walk.c
* Purpose: Associative array implemented as a hash
* ----------------------------------------------------------------------- */
#include <stdlib.h>
#include "base/memento/memento.h"
#include "base/errors.h"
#include "... |
Add test case checking that memcpy into an array invalidates it. |
// Test case taken from sqlite3.c
#include <string.h>
typedef unsigned long u64;
# define EXP754 (((u64)0x7ff)<<52)
# define MAN754 ((((u64)1)<<52)-1)
# define IsNaN(X) (((X)&EXP754)==EXP754 && ((X)&MAN754)!=0)
static int sqlite3IsNaN(double x){
int rc; /* The value return */
u64 y;
memcpy(&y,&x,sizeof(y))... |
// Test case taken from sqlite3.c
#include <string.h>
typedef unsigned long u64;
# define EXP754 (((u64)0x7ff)<<52)
# define MAN754 ((((u64)1)<<52)-1)
# define IsNaN(X) (((X)&EXP754)==EXP754 && ((X)&MAN754)!=0)
static int sqlite3IsNaN(double x){
int rc; /* The value return */
u64 y;
memcpy(&y,&x,sizeof(y))... |
Add escape sequences to make characters italic or bold | #include "stdio.h"
__attribute__((constructor)) static void PrintReference() {
printf(" ----------------------------------------------------------------------------\n"
"| Welcome to ROBAST https://robast.github.io/ |\n"
"| ... | #include "stdio.h"
__attribute__((constructor)) static void PrintReference() {
printf(" ----------------------------------------------------------------------------\n"
"| Welcome to ROBAST https://robast.github.io/ |\n"
"| ... |
Add missing file from previous commit | /*
* libvirt-gconfig-domain-chardev-source-private.h: libvirt domain chardev configuration
*
* Copyright (C) 2013 Red Hat, Inc.
*
* 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; ei... | |
Enable disabling warnings using pragmas only on MSVC++ | #ifndef INICPP_DLL_H
#define INICPP_DLL_H
#ifdef INICPP_DLL
#ifdef INICPP_EXPORT
#define INICPP_API __declspec(dllexport)
#else
#define INICPP_API __declspec(dllimport)
#endif
#else
#define INICPP_API
#endif
// Disable unwanted and not necessary MSVC++ warnings
#pragma warning(disable:4800)
#pragma warning(disable:... | #ifndef INICPP_DLL_H
#define INICPP_DLL_H
#ifdef INICPP_DLL
#ifdef INICPP_EXPORT
#define INICPP_API __declspec(dllexport)
#else
#define INICPP_API __declspec(dllimport)
#endif
#else
#define INICPP_API
#endif
// Disable unwanted and not necessary MSVC++ warnings
#ifdef _MSC_VER
#pragma warning(disable:4800)
#pragma ... |
Disable canonical mode in terminal | #include <stdlib.h>
#include <termios.h>
#include <unistd.h>
struct termios orig_termios;
void disableRawMode() {
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios);
}
void enableRawMode() {
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disableRawMode);
struct termios raw = orig_termios;
raw.c_lflag &= ~(... | #include <stdlib.h>
#include <termios.h>
#include <unistd.h>
struct termios orig_termios;
void disableRawMode() {
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios);
}
void enableRawMode() {
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disableRawMode);
struct termios raw = orig_termios;
raw.c_lflag &= ~(... |
Add payload field to IPv4 header | #ifndef IPV4_H
#define IPV4_H
#include "syshead.h"
#include "netdev.h"
#define IPV4 0x04
#define ICMPV4 0x01
struct iphdr {
uint8_t ihl : 4; /* TODO: Support Big Endian hosts */
uint8_t version : 4;
uint8_t tos;
uint16_t len;
uint16_t id;
uint16_t flags : 3;
uint16_t frag_offset : 13;
... | #ifndef IPV4_H
#define IPV4_H
#include "syshead.h"
#include "netdev.h"
#define IPV4 0x04
#define ICMPV4 0x01
struct iphdr {
uint8_t ihl : 4; /* TODO: Support Big Endian hosts */
uint8_t version : 4;
uint8_t tos;
uint16_t len;
uint16_t id;
uint16_t flags : 3;
uint16_t frag_offset : 13;
... |
Use _exit() instead of exit() in child process | #include "../command.h"
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
pid_t cmd_execute(const char *path, const char *const argv[]) {
pid_t pid = fork();
if (pid == -1) {
perror("fork");
return -1;
}
if (pid == 0) {
execvp(path, (char *con... | #include "../command.h"
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
pid_t cmd_execute(const char *path, const char *const argv[]) {
pid_t pid = fork();
if (pid == -1) {
perror("fork");
return -1;
}
if (pid == 0) {
execvp(path, (char *con... |
Check for error when calling open() | #include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include "bmp.h"
#define SIGNATURE_LENGTH 2
const char usage[] = "Usage: %s <filenname>\n";
int main(int argc, char *argv[])
{
if (argc != 2) {
printf(usage, argv[0]);
return 1;
}
int fd = open(argv[1], O_RDONLY);
char buf[SIGNATU... | #include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include "bmp.h"
#define SIGNATURE_LENGTH 2
const char usage[] = "Usage: %s <filenname>\n";
int main(int argc, char *argv[])
{
if (argc != 2) {
printf(usage, argv[0]);
return 1;
}
int fd = open(argv[1], O_RDONLY);
if (fd == -1) {
... |
Add length as a parameter in command line. | #include <stdlib.h>
#include <stdio.h>
int main(int argc, char*argv[])
{
int length = 8;
for (int i = 0;i<length;i++)
{
for (int j = 0;j<=i;j++)
{
printf("*");
}
printf("\n");
}
return 0;
}
| /*Build: gcc -std=c99 -o xmas3 xmas3.c*/
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char*argv[])
{
if (argc != 2)
{
printf("USAGE: %s [length]\n", argv[0]);
exit(-1);
}
int length = atoi(argv[1]);
for (int i = 0;i<length;i++)
{
for (int j = 0;j<=i;j++)
... |
Add general tree optimizations for jumps and labels |
#include "arch.h"
#include "cc2.h"
Node *
optm(Node *np)
{
Node *dst;
switch (np->op) {
case OJMP:
case OBRANCH:
dst = np->u.sym->u.stmt;
if (dst->op == OJMP)
np->u.sym = dst->u.sym;
break;
}
return np;
}
|
#include <stddef.h>
#include "arch.h"
#include "cc2.h"
Node *
optm(Node *np)
{
Node *p, *dst, *next = np->next;
Symbol *sym, *osym;
switch (np->op) {
case ONOP:
if (next && next->op == ONOP) {
sym = np->u.sym;
osym = next->u.sym;
osym->id = sym->id;
osym->numid = sym->id;
osym->u.stmt = sym->u.... |
Add simple function to test domain cpp:func |
//! Function which takes two int arguments
void f(int, int);
//! Function which takes two double arguments
void f(double, double);
namespace test {
//! Another function which takes two int arguments
void g(int, int);
//! Another function which takes two double arguments
void g(double, double);
}
class MyType {};... |
//! Non overloaded function
void simplefunc();
//! Function which takes two int arguments
void f(int, int);
//! Function which takes two double arguments
void f(double, double);
namespace test {
//! Another function which takes two int arguments
void g(int, int);
//! Another function which takes two double argume... |
Fix a compiler warning on FreeBSD | #include "sys/socket.h"
#include "sys/uio.h"
#define SIZE_OF_T(TYPE) \
do { \
if (0 == strcmp(type, #TYPE)) { \
return sizeof(TYPE); \
} \
} while (0)
#define SIZE_OF_S(TYPE) ... | #include <sys/socket.h>
#include <sys/uio.h>
#include <string.h>
#define SIZE_OF_T(TYPE) \
do { \
if (0 == strcmp(type, #TYPE)) { \
return sizeof(TYPE); \
} \
} while (0)
#define SIZE_OF_... |
Make RAM 128KB - big enough for any game | #pragma once
#include <istream>
#include <memory>
#include <vector>
#include "types.h"
#include "mbc.h"
class Cartridge
{
const static size_t max_rom_size = 0x400000; // 4 MB
std::vector<u8> rom;
std::vector<u8> ram;
std::unique_ptr<MemoryBankController> mbc;
public:
Cartridge() : rom(max_rom_size), ram(0x... | #pragma once
#include <istream>
#include <memory>
#include <vector>
#include "types.h"
#include "mbc.h"
class Cartridge
{
const static size_t max_rom_size = 0x400000; // 4 MB
std::vector<u8> rom;
std::vector<u8> ram;
std::unique_ptr<MemoryBankController> mbc;
public:
Cartridge() : rom(max_rom_size), ram(0x... |
Add virtio 1.0 PCI ID to driver map | CHIPSET(0x0010, VIRTGL, VIRTGL)
| CHIPSET(0x0010, VIRTGL, VIRTGL)
CHIPSET(0x1050, VIRTGL, VIRTGL)
|
Update umbrella header with public interface | //
// TangramMap.h
// TangramMap
//
// Created by Matt Smollinger on 7/8/16.
//
//
#import <UIKit/UIKit.h>
/// Project version number for TangramMap.
FOUNDATION_EXPORT double TangramMapVersionNumber;
/// Project version string for TangramMap.
FOUNDATION_EXPORT const unsigned char TangramMapVersionString[];
// In... | //
// TangramMap.h
// TangramMap
//
// Created by Matt Smollinger on 7/8/16.
// Updated by Karim Naaji on 2/28/17.
// Copyright (c) 2017 Mapzen. All rights reserved.
//
#import <UIKit/UIKit.h>
/// Project version number for TangramMap.
FOUNDATION_EXPORT double TangramMapVersionNumber;
/// Project version string... |
Add namespace and enum for signaling auto-disposing | /* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef COMMON_TYPEDEFS_H
#define COMMON_TYPEDEFS_H
typedef unsigned char byte;
typedef unsigned char uint8;
typedef signed char int8;
typedef unsigned short ... | /* The Halfling Project - A Graphics Engine and Projects
*
* The Halfling Project is the legal property of Adrian Astley
* Copyright Adrian Astley 2013
*/
#ifndef COMMON_TYPEDEFS_H
#define COMMON_TYPEDEFS_H
typedef unsigned char byte;
typedef unsigned char uint8;
typedef signed char int8;
typedef unsigned short ... |
Set project_config back to defaults | // project-specific definitions for otaa sensor
//#define CFG_eu868 1
//#define CFG_us915 1
//#define CFG_au921 1
#define CFG_as923 1
#define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP
//#define CFG_in866 1
#define CFG_sx1276_radio 1
//#define LMIC_USE_INTERRUPTS
#define LMIC_DEBUG_LEVEL 2
#define LMIC_DEBUG_PRINTF_FN lm... | // project-specific definitions for otaa sensor
//#define CFG_eu868 1
#define CFG_us915 1
//#define CFG_au921 1
//#define CFG_as923 1
//#define CFG_in866 1
#define CFG_sx1276_radio 1
//#define LMIC_USE_INTERRUPTS
|
Add InAppMessage event to iOS | #if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>
#import <React/RCTConvert.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTUtils.h>
#elif __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"
#import "RCTEventEmitter.h"
#import "RCTConve... | #if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>
#import <React/RCTConvert.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTUtils.h>
#elif __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"
#import "RCTEventEmitter.h"
#import "RCTConve... |
Document the format of the TAQ file. | // Copyright 2017 Google 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... | // Copyright 2017 Google 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
Add a tag (dummy) header file that will be updated whenever CINT's dictionaries need to be regenerated. | /***********************************************************************
* cint (C/C++ interpreter)
************************************************************************
* CINT header file cintdictversion.h
************************************************************************
* Description:
* definition of... | |
Define WIN32 for MSVC compilers | /*
Swephelp
Copyright 2007-2014 Stanislas Marquis <smarquis@astrorigin.ch>
Swephelp 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) an... | /*
Swephelp
Copyright 2007-2014 Stanislas Marquis <smarquis@astrorigin.ch>
Swephelp 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) an... |
Use else in comparison chain | /*ckwg +5
* Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
* KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
* Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
*/
#ifndef VISTK_PROCESSES_HELPER_IMAGE_MACROS_H
#define VISTK_PROCESSES_HELPER_IMAGE_MACROS_H
... | /*ckwg +5
* Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
* KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
* Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
*/
#ifndef VISTK_PROCESSES_HELPER_IMAGE_MACROS_H
#define VISTK_PROCESSES_HELPER_IMAGE_MACROS_H
... |
Add function parameter qualifier type tests | // RUN: %ucc -fsyntax-only %s
typedef int array[3];
const array yo; // int const yo[3];
// ^~ no const here
h(array); // int h(int [3]);
i(const array); // int i(int const [3]);
// ^~ no const here
j(int[const]); // int j(int *const);
_Static_assert(_Ge... | |
Reduce the AsyncEvent struct size | #ifndef AL_EVENT_H
#define AL_EVENT_H
#include "AL/al.h"
#include "AL/alc.h"
struct EffectState;
enum {
/* End event thread processing. */
EventType_KillThread = 0,
/* User event types. */
EventType_SourceStateChange = 1<<0,
EventType_BufferCompleted = 1<<1,
EventType_Error = ... | #ifndef AL_EVENT_H
#define AL_EVENT_H
#include "AL/al.h"
#include "AL/alc.h"
struct EffectState;
enum {
/* End event thread processing. */
EventType_KillThread = 0,
/* User event types. */
EventType_SourceStateChange = 1<<0,
EventType_BufferCompleted = 1<<1,
EventType_Error = ... |
Disable error that forbids builds with gcc 4.2 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Various compiler checks. */
#i... | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Various compiler checks. */
#i... |
Fix bug in TextInlineViews when using a deep nested hierarchy of Text and Images | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <limits>
#include <react/components/text/BaseTextShadowNode.h>
#include <react/components/text/TextProps.h>... | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <limits>
#include <react/components/text/BaseTextShadowNode.h>
#include <react/components/text/TextProps.h>... |
Add some color for console output |
#ifndef KAI_PLATFORM_GAME_CONTROLLER_H
#define KAI_PLATFORM_GAME_CONTROLLER_H
#include KAI_PLATFORM_INCLUDE(GameController.h)
#endif // SHATTER_PLATFORM_GAME_CONTROLLER_H
//EOF
|
#ifndef KAI_PLATFORM_GAME_CONTROLLER_H
#define KAI_PLATFORM_GAME_CONTROLLER_H
#include KAI_PLATFORM_INCLUDE(GameController.h)
#endif
//EOF
|
Update instance variables, add getters | #pragma once
#include <string>
struct Version {
public:
const int major;
const int minor;
const int revision;
Version(int major, int minor = 0, int revision = 0) :
major(major),
minor(minor),
revision(revision) {
}
std::wstring ToString() {
return std::to_wstring(major)
... | #pragma once
#include <string>
struct Version {
public:
Version(int major = 0, int minor = 0, int revision = 0) :
_major(major),
_minor(minor),
_revision(revision) {
}
const int Major() { return _major; }
const int Minor() { return _minor; }
const int Revision() { return _revision; }... |
Add empty test to prevent build system complaining. | /*
Copyright (C) 2016 William Hart
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) a... | |
Add a test for llvm-gcc svn r104726. | // RUN: %llvmgcc %s -S -emit-llvm -o - | FileCheck %s
// Radar 8026855
int test (void *src) {
register int w0 asm ("0");
// CHECK: call i32 asm sideeffect
asm ("ldr %0, [%1]": "=r" (w0): "r" (src));
// The asm to read the value of w0 has a sideeffect for a different reason
// (see 2010-05-18-asmsched.c) but ... | |
Correct *TST? callback in header file | #ifndef __SCPI_DEF_H_
#define __SCPI_DEF_H_
#include "scpi/scpi.h"
extern scpi_t scpi_context;
size_t SCPI_Write(scpi_t * context, const char * data, size_t len);
int SCPI_Error(scpi_t * context, int_fast16_t err);
scpi_result_t SCPI_Control(scpi_t * context, scpi_ctrl_name_t ctrl, scpi_reg_val_t val);
scpi_result_t... | #ifndef __SCPI_DEF_H_
#define __SCPI_DEF_H_
#include "scpi/scpi.h"
extern scpi_t scpi_context;
size_t SCPI_Write(scpi_t * context, const char * data, size_t len);
int SCPI_Error(scpi_t * context, int_fast16_t err);
scpi_result_t SCPI_Control(scpi_t * context, scpi_ctrl_name_t ctrl, scpi_reg_val_t val);
scpi_result_t... |
Use Lua for creating main window | #include <Arika/Arika.h>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main(int argc, char** argv)
{
ARFuncs* arFuncs = ar_init("t2-output/macosx-clang-debug-default/libarika-qt.dylib");
if (!arFuncs)
return 0;
arFuncs->window_create... | #include <Arika/Arika.h>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main(int argc, char** argv)
{
ARFuncs* arFuncs = ar_init("t2-output/macosx-clang-debug-default/libarika-qt.dylib");
if (!arFuncs)
return 0;
if (!arFuncs->ui_load(... |
Make TransactionData member vars private | /*
* the continuation data assigned to each request along side with the functions
* to manipulate them
*
* Vmon: June 2013
*/
#ifndef BANJAX_CONTINUATION_H
#define BANJAX_CONTINUATION_H
#include "banjax.h"
#include "banjax_filter.h"
#include "transaction_muncher.h"
class Banjax;
class TransactionData{
public:
... | /*
* the continuation data assigned to each request along side with the functions
* to manipulate them
*
* Vmon: June 2013
*/
#ifndef BANJAX_CONTINUATION_H
#define BANJAX_CONTINUATION_H
#include "banjax.h"
#include "banjax_filter.h"
#include "transaction_muncher.h"
class Banjax;
class TransactionData{
public:
... |
Use the inline inverse sine function. | #include <math.h>
#include <pal.h>
static const float pi_2 = (float) M_PI / 2.f;
/**
*
* Computes the inverse cosine (arc cosine) of the input vector 'a'. Input
* values to acos must be in the range -1 to 1. The result values are in the
* range 0 to pi. The function does not check for illegal input values.
*
* ... | #include <pal.h>
#include "p_asin.h"
/**
*
* Computes the inverse cosine (arc cosine) of the input vector 'a'. Input
* values to acos must be in the range -1 to 1. The result values are in the
* range 0 to pi. The function does not check for illegal input values.
*
* @param a Pointer to input vector
*
* @... |
Add a simple untested example how to use the basics of the serial port class | /*-
* Copyright (c) 2008 Benjamin Close <Benjamin.Close@clearchain.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright... | |
Add inclusion of "syscall.aix32.h" or <syscall.h> depending on whether we are on an AIX machine where there is no <syscall.h>. | #ifndef _CONDOR_SYSCALLS_H
#define _CONDOR_SYSCALLS_H
typedef int BOOL;
static const int SYS_LOCAL = 1;
static const int SYS_REMOTE = 0;
static const int SYS_RECORDED = 2;
static const int SYS_MAPPED = 2;
static const int SYS_UNRECORDED = 0;
static const int SYS_UNMAPPED = 0;
#if defined(__cplusplus)
extern "C" ... | #ifndef _CONDOR_SYSCALLS_H
#define _CONDOR_SYSCALLS_H
#if defined( AIX32)
# include "syscall.aix32.h"
#else
# include <syscall.h>
#endif
typedef int BOOL;
static const int SYS_LOCAL = 1;
static const int SYS_REMOTE = 0;
static const int SYS_RECORDED = 2;
static const int SYS_MAPPED = 2;
static const int SYS_UNRE... |
Remove unused flags field from request | #ifndef HTTP_H
#define HTTP_H
#include <stddef.h>
#define HTTP_GET 1
#define HTTP_HEAD 2
#define HTTP_POST 3
#define HTTP_PUT 4
#define HTTP_DELETE 5
#define FIELD_HOST 1
#define FIELD_LENGTH 2
#define FIELD_TYPE 3
#define ERR_BAD_REQ 0
#define ERR_NOT_FOUND 1
#define ERR_METHOD 2
#define ERR_FORBIDDEN 3
#define ER... | #ifndef HTTP_H
#define HTTP_H
#include <stddef.h>
#define HTTP_GET 1
#define HTTP_HEAD 2
#define HTTP_POST 3
#define HTTP_PUT 4
#define HTTP_DELETE 5
#define FIELD_HOST 1
#define FIELD_LENGTH 2
#define FIELD_TYPE 3
#define ERR_BAD_REQ 0
#define ERR_NOT_FOUND 1
#define ERR_METHOD 2
#define ERR_FORBIDDEN 3
#define ER... |
Correct DIM service is DAQ_SOR_PHYSICS. In this case we get the trigger config from the logbook. | /**************************************************************************
* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice *
**************************************************************************/
#ifndef SORNOTI... | /**************************************************************************
* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice *
**************************************************************************/
#ifndef SORNOTI... |
Remove bogus NO_IRQ = -1 define | /* irq.h: FRV IRQ definitions
*
* Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*
* 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; ... | /* irq.h: FRV IRQ definitions
*
* Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*
* 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; ... |
Add a link to an SO answer about platform detection | #include <stdio.h>
#include <stdlib.h>
/* I am intentionally not doing the Windows portability stuff here
since I am doing this for the language-implementation aspect,
rather than the portability aspect. If it turns out the portability
stuff is a big deal, I will come back and add in that code. -MAW */
#include <e... | #include <stdio.h>
#include <stdlib.h>
/* I am intentionally not doing the Windows portability stuff here
since I am doing this for the language-implementation aspect,
rather than the portability aspect. If it turns out the portability
stuff is a big deal, I will come back and add in that code. -MAW */
/* Fun SO l... |
Fix a new Visual Studio unused variable build warning | /**
* \file os_isfile.c
* \brief Returns true if the given file exists on the file system.
* \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
*/
#include <sys/stat.h>
#include "premake.h"
int os_isfile(lua_State* L)
{
const char* filename = luaL_checkstring(L, 1);
lua_pushboolean(L, do_... | /**
* \file os_isfile.c
* \brief Returns true if the given file exists on the file system.
* \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
*/
#include <sys/stat.h>
#include "premake.h"
int os_isfile(lua_State* L)
{
const char* filename = luaL_checkstring(L, 1);
lua_pushboolean(L, do_... |
Synchronize the mailbox after expunging messages to actually get them expunged. | /* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "commands.h"
#include "imap-expunge.h"
bool cmd_close(struct client_command_context *cmd)
{
struct client *client = cmd->client;
struct mailbox *mailbox = client->mailbox;
struct mail_storage *storage;
if (!... | /* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "commands.h"
#include "imap-expunge.h"
bool cmd_close(struct client_command_context *cmd)
{
struct client *client = cmd->client;
struct mailbox *mailbox = client->mailbox;
struct mail_storage *storage;
if (!... |
Add some comments in the header file for understanding | #ifndef GPIOLIB_H
#define GPIOLIB_H
#define FORWARD 1
#define BACKWARD 0
namespace GPIO
{
int init();
int controlLeft(int direction,int speed);
int controlRight(int direction,int speed);
int stopLeft();
int stopRight();
int resetCounter();
void getCounter(int *countLeft,int *countRight);
int turnTo(int an... | #ifndef GPIOLIB_H
#define GPIOLIB_H
#define FORWARD 1
#define BACKWARD 0
namespace GPIO
{
int init();
//direction is either FORWARD or BACKWARD. speed can be an integer ranging from 0 to 100.
int controlLeft(int direction,int speed);
int controlRight(int direction,int speed);
int stopLeft();
int stopRight();
... |
Add a hash_combine function for mixing hash values. | /*
* Utilities for working with hash values.
*
* Portions Copyright (c) 2017, PostgreSQL Global Development Group
*/
#ifndef HASHUTILS_H
#define HASHUTILS_H
/*
* Combine two hash values, resulting in another hash value, with decent bit
* mixing.
*
* Similar to boost's hash_combine().
*/
static inline uint32
... | |
Fix obsolete cross-reference (this file isn't called alpha.c anymore) | /* Dummy file used for nothing at this point
*
* see alpha.h
* $PostgreSQL: pgsql/src/backend/port/dynloader/osf.c,v 1.2 2006/03/11 04:38:31 momjian Exp $
*/
| /*
* $PostgreSQL: pgsql/src/backend/port/dynloader/osf.c,v 1.3 2009/04/21 21:05:25 tgl Exp $
*
* Dummy file used for nothing at this point
*
* see osf.h
*/
|
Make text in LabelState public. | #ifndef SRC_FORCES_LABEL_STATE_H_
#define SRC_FORCES_LABEL_STATE_H_
#include <Eigen/Core>
#include <string>
namespace Forces
{
/**
* \brief
*
*
*/
class LabelState
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
LabelState(int id, std::string text, Eigen::Vector3f anchorPosition);
const int id;
const Eigen:... | #ifndef SRC_FORCES_LABEL_STATE_H_
#define SRC_FORCES_LABEL_STATE_H_
#include <Eigen/Core>
#include <string>
namespace Forces
{
/**
* \brief
*
*
*/
class LabelState
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
LabelState(int id, std::string text, Eigen::Vector3f anchorPosition);
const int id;
const Eigen:... |
Use puts again in a better position, save one byte (143) | main(int u,char**a){for(char*c,y;y=u;u*=8)for(c=a[1];*c;)printf("%c%c%c%c",(y="$ֶ<&"[*c++-48])&u/2?33:32,y&u?95:32,y&u/4?33:32,*c?32:10);} | main(int u,char**a){for(char*c,y;y=u;u*=8,puts(""))for(c=a[1];*c;)printf("%c%c%c ",(y="$ֶ<&"[*c++-48])&u/2?33:32,y&u?95:32,y&u/4?33:32);} |
Test class to check for ambiguities in the dictionary source code in case of non virtual diamonds | #ifndef DICT2_CLASSN_H
#define DICT2_CLASSN_H
#include "ClassI.h"
#include "ClassL.h"
class ClassN: /* public ClassI, */ public ClassL {
public:
ClassN() : fN('n') {}
virtual ~ClassN() {}
int n() { return fN; }
void setN(int v) { fN = v; }
private:
int fN;
};
#endif // DICT2_CLASSN_H
| |
Add missing close for file descriptor | /* Exercise 5-3 */
#include <unistd.h>
#include <fcntl.h>
#include "tlpi_hdr.h"
int main (int argc, char *argv[]) {
if (argc < 3 || argc > 4) {
usageErr("%s filename num-bytes [x]", argv[0]);
}
long n = getLong(argv[2], GN_NONNEG | GN_ANY_BASE, "num-bytes");
Boolean x = argc == 4 && strcmp(argv[3], "x") ... | /* Exercise 5-3 */
#include <unistd.h>
#include <fcntl.h>
#include "tlpi_hdr.h"
int main (int argc, char *argv[]) {
if (argc < 3 || argc > 4) {
usageErr("%s filename num-bytes [x]", argv[0]);
}
long n = getLong(argv[2], GN_NONNEG | GN_ANY_BASE, "num-bytes");
Boolean x = argc == 4 && strcmp(argv[3], "x") ... |
Add virtual destructor to class with virtual functions but non-virtual destructor | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*/
#if FB_SONARKIT_ENABLED
#pragma once
#import <dispatch/dispatch.h>
namespace facebook {
namespace flipper {
class DispatchQ... | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*/
#if FB_SONARKIT_ENABLED
#pragma once
#import <dispatch/dispatch.h>
namespace facebook {
namespace flipper {
class DispatchQ... |
Remove __UNUSED__ as it doesn't make sense here. | /*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#else
#ifndef E_INT_CONFIG_MODULES_H
#define E_INT_CONFIG_MODULES_H
EAPI E_Config_Dialog *e_int_config_modules(E_Container *con, const char *params __UNUSED__);
#endif
#endif
| /*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifdef E_TYPEDEFS
#else
#ifndef E_INT_CONFIG_MODULES_H
#define E_INT_CONFIG_MODULES_H
EAPI E_Config_Dialog *e_int_config_modules(E_Container *con, const char *params);
#endif
#endif
|
Fix bug in ivory wrapper. |
#include "freertos_task_wrapper.h"
#include <FreeRTOS.h>
#include <task.h>
void ivory_freertos_task_create(void (*tsk)(void),
uint32_t stacksize, uint8_t priority)
{
xTaskCreate((void (*)(void*)) tsk, /* this cast is undefined behavior */
NULL, stacksize, NULL, priority, NULL);
}
void ivory_... |
#include "freertos_task_wrapper.h"
#include <FreeRTOS.h>
#include <task.h>
void ivory_freertos_task_create(void (*tsk)(void),
uint32_t stacksize, uint8_t priority)
{
xTaskCreate((void (*)(void*)) tsk, /* this cast is undefined behavior */
NULL, stacksize, NULL, priority, NULL);
}
void ivory_... |
Update files, Alura, Introdução a C, Aula 2.7 | #include <stdio.h>
int main() {
// imprime o cabecalho do nosso jogo
printf("******************************************\n");
printf("* Bem vindo ao nosso jogo de adivinhação *\n");
printf("******************************************\n");
int numerosecreto = 42;
int chute;
for(int i = 1; i <= 3; i++) {... | #include <stdio.h>
#define NUMERO_DE_TENTATIVAS 5
int main() {
// imprime o cabecalho do nosso jogo
printf("******************************************\n");
printf("* Bem vindo ao nosso jogo de adivinhação *\n");
printf("******************************************\n");
int numerosecreto = 42;
int chute;
... |
Define an empty SODIUM_EXPORT if SODIUM_STATIC is defined. |
#ifndef __SODIUM_EXPORT_H__
#define __SODIUM_EXPORT_H__
#ifndef __GNUC__
# ifdef __attribute__
# undef __attribute__
# endif
# define __attribute__(a)
#endif
#ifndef SODIUM_STATIC
# if defined(_MSC_VER)
# ifdef DLL_EXPORT
# define SODIUM_EXPORT __declspec(dllexport)
# else
# define SODIUM_EXPORT __declspec(dl... |
#ifndef __SODIUM_EXPORT_H__
#define __SODIUM_EXPORT_H__
#ifndef __GNUC__
# ifdef __attribute__
# undef __attribute__
# endif
# define __attribute__(a)
#endif
#ifdef SODIUM_STATIC
# define SODIUM_EXPORT
#else
# if defined(_MSC_VER)
# ifdef DLL_EXPORT
# define SODIUM_EXPORT __declspec(dllexport)
# else
# define... |
Remove leftover method in protocol | //
// FTMutableDataSource.h
// Fountain
//
// Created by Tobias Kraentzer on 15.09.15.
// Copyright © 2015 Tobias Kräntzer. All rights reserved.
//
#import "FTDataSource.h"
@protocol FTMutableDataSource <FTDataSource>
#pragma mark Insertion
- (BOOL)canInsertItem:(id)item;
- (NSIndexPath *)insertItem:(id)item atP... | //
// FTMutableDataSource.h
// Fountain
//
// Created by Tobias Kraentzer on 15.09.15.
// Copyright © 2015 Tobias Kräntzer. All rights reserved.
//
#import "FTDataSource.h"
@protocol FTMutableDataSource <FTDataSource>
#pragma mark Insertion
- (BOOL)canInsertItem:(id)item;
- (NSIndexPath *)insertItem:(id)item atP... |
Support for locating of debug items in frames. | //===-- llvm/CodeGen/MachineLocation.h --------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by James M. Laskey and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===------------------... | |
Revert change that broke the build. | //===--- TargetBuiltins.h - Target specific builtin IDs -------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by Anders Carlsson and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===------------------... | //===--- TargetBuiltins.h - Target specific builtin IDs -------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by Anders Carlsson and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===------------------... |
Make the char * parameter as const char * | #ifndef LOG_H
#define LOG_H
#include <time.h>
typedef struct data_struct {
time_t time;
char *string;
} data_t;
int addmsg(data_t data);
void clearlog(void);
char *getlog(void);
int savelog(char *filename);
#endif
| #ifndef LOG_H
#define LOG_H
#include <time.h>
typedef struct data_struct {
time_t time;
char *string;
} data_t;
int addmsg(data_t data);
void clearlog(void);
char *getlog(void);
int savelog(const char *filename);
#endif
|
Add lock to runq struct | /**
* @file
* @brief
*
* @date 06.03.2013
* @author Anton Bulychev
*/
#ifndef KERNEL_THREAD_SCHED_STRATEGY_H_
#define KERNEL_THREAD_SCHED_STRATEGY_H_
#include <kernel/sched/affinity.h>
#include <kernel/sched/runq.h>
#include <kernel/sched/sched_timing.h>
#include <kernel/sched/sched_priority.h>
struct runq {
... | /**
* @file
* @brief
*
* @date 06.03.2013
* @author Anton Bulychev
*/
#ifndef KERNEL_THREAD_SCHED_STRATEGY_H_
#define KERNEL_THREAD_SCHED_STRATEGY_H_
#include <kernel/spinlock.h>
#include <kernel/sched/affinity.h>
#include <kernel/sched/runq.h>
#include <kernel/sched/sched_timing.h>
#include <kernel/sched/sched... |
Comment out per-error logging, now only needed for logging | using StackExchange.Elastic;
namespace StackExchange.Opserver
{
public class OpserverCore
{
// Initializes various bits in OpserverCore like exception logging and such so that projects using the core need not load up all references to do so.
public static void Init()
{
try
... | using StackExchange.Elastic;
namespace StackExchange.Opserver
{
public class OpserverCore
{
// Initializes various bits in OpserverCore like exception logging and such so that projects using the core need not load up all references to do so.
public static void Init()
{
try
... |
Change Columns static method to return IReadOnlyList. | /*
Copyright 2014 David Bordoley
Copyright 2014 Zumero, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by a... | /*
Copyright 2014 David Bordoley
Copyright 2014 Zumero, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by a... |
Add upload property to file | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Contentful.Core.Models
{
/// <summary>
/// Represents information about the actual binary file of an <see cref="Asset"/>.
/// </summary>
public class File
{
/// <summary>
/// ... | using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Contentful.Core.Models
{
/// <summary>
/// Represents information about the actual binary file of an <see cref="Asset"/>.
/// </summary>
public class File
{
///... |
Use same namespace for serializers | using System;
using System.Collections.Generic;
using ArcGIS.ServiceModel;
using ArcGIS.ServiceModel.Operation;
namespace ArcGIS.Test
{
public class JsonDotNetSerializer : ISerializer
{
static ISerializer _serializer = null;
public static void Init()
{
_serializer = new Js... | using System;
using System.Collections.Generic;
using ArcGIS.ServiceModel;
using ArcGIS.ServiceModel.Operation;
namespace ArcGIS.ServiceModel.Serializers
{
public class JsonDotNetSerializer : ISerializer
{
static ISerializer _serializer = null;
public static void Init()
{
... |
Use correct casing on public static field. | namespace XSerializer.Encryption
{
/// <summary>
/// Provides a mechanism for an application to specify an instance of
/// <see cref="IEncryptionMechanism"/> to be used by XSerializer when
/// encrypting or decrypting data.
/// </summary>
public static class EncryptionMechanism
{
//... | namespace XSerializer.Encryption
{
/// <summary>
/// Provides a mechanism for an application to specify an instance of
/// <see cref="IEncryptionMechanism"/> to be used by XSerializer when
/// encrypting or decrypting data.
/// </summary>
public static class EncryptionMechanism
{
//... |
Rename some more nested classes | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.IO;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
using osuTK;
namespace osu.Framework.Graphics.UserInterface
{
public class Bas... | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.IO;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
using osuTK;
namespace osu.Framework.Graphics.UserInterface
{
public class Bas... |
Comment and fix on namespace | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KGP.Curves
{
public class ThresholdLinearCurve : ICurve
{
private float threshold;
public float Threshold
{
get { return this.threshold; }
... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KGP
{
/// <summary>
/// Linear threshold curve, clamp while absolute value is within threshold
/// </summary>
public class ThresholdLinearCurve : ICurve
{
private f... |
Add quotes and length of JSON packets being sent. | namespace Server
{
using System;
using System.IO;
using System.Text;
internal partial class Program
{
class Dup : Stream
{
string _name;
private Dup() { }
public Dup(string name) { _name = name; }
public override bool CanRead { get... | namespace Server
{
using System;
using System.IO;
using System.Text;
internal partial class Program
{
class Dup : Stream
{
string _name;
private Dup() { }
public Dup(string name) { _name = name; }
public override bool CanRead { get... |
Update documentation now that we can point to a concrete method | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel
{
interface ICodeModelInstanceFactory
{
/// <summary>
/// Requests the project system to create a <see ... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel
{
interface ICodeModelInstanceFactory
{
/// <summary>
/// Requests the project system to create a <see ... |
Test case renamed to be more accurate | using System;
using Shouldly;
using Spk.Common.Helpers.Service;
using Xunit;
namespace Spk.Common.Tests.Helpers.Service
{
public class ServiceResultTests
{
[Theory]
[InlineData("test")]
[InlineData("")]
[InlineData(null)]
public void SetData_SuccessShouldBeTrue(string va... | using System;
using Shouldly;
using Spk.Common.Helpers.Service;
using Xunit;
namespace Spk.Common.Tests.Helpers.Service
{
public class ServiceResultTests
{
[Theory]
[InlineData("test")]
[InlineData("")]
[InlineData(null)]
public void Success_ShouldBeTrue_WhenDataIsSet(st... |
Remove unused usings and make the target class internal | using System.Collections.Concurrent;
using System.IO;
using NLog;
using NLog.Config;
using NLog.Targets;
namespace Microsoft.Azure.Commands.DataLakeStore.Models
{
/// <summary>
/// NLog is used by the ADLS dataplane sdk to log debug messages. We can create a custom target
/// which basically queues the de... | using System.Collections.Concurrent;
using NLog;
using NLog.Targets;
namespace Microsoft.Azure.Commands.DataLakeStore.Models
{
/// <summary>
/// NLog is used by the ADLS dataplane sdk to log debug messages. We can create a custom target
/// which basically queues the debug data to the ConcurrentQueue for ... |
Return the given RemindOn date | using Simpler;
using System;
using Schedules.API.Models;
using Schedules.API.Tasks.Reminders;
namespace Schedules.API.Tasks.Sending
{
public class PostRemindersEmailSend : InOutTask<PostRemindersEmailSend.Input, PostRemindersEmailSend.Output>
{
public class Input
{
public Send Send { get; set; }
... | using Simpler;
using System;
using Schedules.API.Models;
using Schedules.API.Tasks.Reminders;
namespace Schedules.API.Tasks.Sending
{
public class PostRemindersEmailSend : InOutTask<PostRemindersEmailSend.Input, PostRemindersEmailSend.Output>
{
public class Input
{
public Send Send { get; set; }
... |
Store ContentId against the LinkedResource | using System;
using System.Diagnostics.Contracts;
using System.Globalization;
using System.Net.Mail;
using System.Net.Mime;
using RazorEngine.Text;
namespace Essential.Templating.Razor.Email.Helpers
{
public static class ResourceTemplateHelperExtensions
{
public static IEncodedString Link(this Resourc... | using System;
using System.Diagnostics.Contracts;
using System.Globalization;
using System.Net.Mail;
using System.Net.Mime;
using RazorEngine.Text;
namespace Essential.Templating.Razor.Email.Helpers
{
public static class ResourceTemplateHelperExtensions
{
public static IEncodedString Link(this Resourc... |
Update with slider body changes | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Object... | // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Object... |
Add reply mode and a shortcut for getting admins | using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace AlertRoster.Web.Models
{
public class Group
{
[Key]
public int Id { get; private set; }
[Required, StringLength(25)]
public String DisplayName { get; set; }
[StringL... | using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
namespace AlertRoster.Web.Models
{
public class Group
{
[Key]
public int Id { get; private set; }
[Required, StringLength(25)]
public String DisplayName { get; set; ... |
Fix for native extension method name (not Android!) | // MvxColorExtensions.cs
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.UI;
using MonoTouch.UI... | // MvxColorExtensions.cs
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.UI;
using MonoTouch.UI... |
Update user info on opportunity. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace PS.Mothership.Core.Common.Dto.Merchant
{
[DataContract]
public class OpportunityDto
{
[DataMember]
public Guid OpportunityGuid {... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace PS.Mothership.Core.Common.Dto.Merchant
{
[DataContract]
public class OpportunityDto
{
[DataMember]
public Guid OpportunityGuid {... |
Split Pascal cased property names into words | @using Piranha.Extend;
@using Piranha.Manager.Manager;
@model Block
@foreach(var name in Model.GetFieldNames())
{
<div class="form-group">
<label>@name</label>
@Html.Editor(name)
</div>
} | @using Piranha.Extend;
@using Piranha.Manager.Manager;
@using System.Text.RegularExpressions;
@model Block
@foreach(var name in Model.GetFieldNames())
{
var label = Regex.Replace(name, "(\\B[A-Z])", " $1");
<div class="form-group">
<label>@label</label>
@Html.Editor(name)
</div>
... |
Fix spelling mistake in error message | using System;
using System.Collections.Generic;
using System.Linq;
using HandlebarsDotNet.Compiler.Lexer;
using System.Linq.Expressions;
namespace HandlebarsDotNet.Compiler
{
internal class ExpressionScopeConverter : TokenConverter
{
public static IEnumerable<object> Convert(IEnumerable<object> sequen... | using System;
using System.Collections.Generic;
using System.Linq;
using HandlebarsDotNet.Compiler.Lexer;
using System.Linq.Expressions;
namespace HandlebarsDotNet.Compiler
{
internal class ExpressionScopeConverter : TokenConverter
{
public static IEnumerable<object> Convert(IEnumerable<object> sequen... |
Replace first TestObjectBuilderBuilder unit test with two tests to make the tests less brittle. | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using TestObjectBuilder;
namespace TestObjectBuilderTests.Tests
{
public class TestObjectBuilderBuilderTests
{
[TestFixture]
public class CreateNewObject
{
[Test]
... | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using TestObjectBuilder;
namespace TestObjectBuilderTests.Tests
{
public class TestObjectBuilderBuilderTests
{
[TestFixture]
public class CreateNewObject
{
[Test]
... |
Fix incorrect namespace for UI component. | using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoGameUtils.Diagnostics;
namespace PCGame.GameComponents
{
public class UIFPSCounter : DrawableGameComponent
{
private FPSCounter _fpsCounter = new FPSCounter();
private SpriteBatch _spriteBatch;
private Spr... | using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoGameUtils.Diagnostics;
namespace MonoGameUtils.UI.GameComponents
{
public class UIFPSCounter : DrawableGameComponent
{
private FPSCounter _fpsCounter = new FPSCounter();
private SpriteBatch _spriteBatch;
p... |
Add additional hole punch logging | using Microsoft.EntityFrameworkCore;
using System;
using System.Linq;
using System.Net.Sockets;
using System.Threading.Tasks;
namespace RebirthTracker.PacketHandlers
{
/// <summary>
/// Request a game host try a hole punch
/// </summary>
[Opcode(26)]
public class HolePunchPacketHandler : IPacketHa... | using Microsoft.EntityFrameworkCore;
using System;
using System.Linq;
using System.Net.Sockets;
using System.Threading.Tasks;
namespace RebirthTracker.PacketHandlers
{
/// <summary>
/// Request a game host try a hole punch
/// </summary>
[Opcode(26)]
public class HolePunchPacketHandler : IPacketHa... |
Make sure that authorization of TraktCalendarAllDVDMoviesRequest is not required | namespace TraktApiSharp.Tests.Experimental.Requests.Calendars
{
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TraktApiSharp.Experimental.Requests.Calendars;
using TraktApiSharp.Objects.Get.Calendars;
[TestClass]
public class TraktCalendarAllDVDMoviesRequestT... | namespace TraktApiSharp.Tests.Experimental.Requests.Calendars
{
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TraktApiSharp.Experimental.Requests.Calendars;
using TraktApiSharp.Objects.Get.Calendars;
using TraktApiSharp.Requests;
[TestClass]
public class... |
Add user photo to users list | @using ForumModels;
@{
string usersFile = Server.MapPath("~/App_Data/users.json");
var userList = new UserList(usersFile);
}
<table class="table">
<thead>
<tr class="lead">
<th></th>
<th>Name</th>
<th>MSDN Name</th>
<th>StackOverflow ID</th>
... | @using ForumModels;
@{
string usersFile = Server.MapPath("~/App_Data/users.json");
var userList = new UserList(usersFile);
}
<table class="table">
<thead>
<tr class="lead">
<th></th>
<th></th>
<th>Name</th>
<th>MSDN Name</th>
<th>StackO... |
Disable playlist start button when attempts have been exhausted | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Online.Rooms;
using osu.Game... | // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Online.Rooms;
using osu.Game... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.