Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Allow logging to be configured at compilation time.
// // lelib.h // lelib // // Created by Petr on 27.10.13. // Copyright (c) 2013 JLizard. All rights reserved. // #define LE_DEBUG_LOGS 1 #if LE_DEBUG_LOGS #define LE_DEBUG(...) NSLog(__VA_ARGS__) #else #define LE_DEBUG(...) #endif #import "LELog.h" #import "lecore.h"
// // lelib.h // lelib // // Created by Petr on 27.10.13. // Copyright (c) 2013 JLizard. All rights reserved. // #ifndef LE_DEBUG_LOGS #ifdef DEBUG #define LE_DEBUG_LOGS 1 #else #define LE_DEBUG_LOGS 0 #endif #endif #if LE_DEBUG_LOGS #define LE_DEBUG(...) NSLog(__VA_ARGS__) #el...
Include file for GCC compiler.
/* VString library header file for GCC */ #include <exec/types.h> APTR AllocVecPooled(__reg("a0") APTR pool, __reg("d0") ULONG size); APTR CloneMem(__reg("a0") const APTR src, __reg("d0") ULONG size); APTR CloneMemPooled(__reg("a0") APTR pool, __reg("a1") const APTR src, __reg("d0") ULONG size); void FreeVecPooled(__...
Remove prototypes for removed functions.
#ifndef INTERRUPTS_H #define INTERRUPTS_H #include "types.h" namespace interrupts { // Enable interrupts on the CPU. inline void enable() { asm volatile("sti"); } // Enable interrupts on the CPU. inline void disable() { asm volatile("cli"); } struct Registers { u32 gs, fs, es, ds; // ...
#ifndef INTERRUPTS_H #define INTERRUPTS_H #include "types.h" namespace interrupts { // Enable interrupts on the CPU. inline void enable() { asm volatile("sti"); } // Enable interrupts on the CPU. inline void disable() { asm volatile("cli"); } struct Registers { u32 gs, fs, es, ds; // ...
Write rough interface for a map class template
template <class Key, class T> struct map { using size_type = std::size_t; map(size_type bucket_count = /* some default */); using value_type = std::pair<const Key, T>; iterator begin(); const_iterator begin() const; iterator end(); const_iterator end() const; // Args are arguments to...
Use a non-blocking select to determine which reads and writes would block
/* * Test case for appio * Author: Tushar Mohan * tusharmohan@gmail.com * * Description: This test case reads from standard linux /etc/group * and writes the output to stdout. * Statistics are printed at the end of the run., */ #include <papi.h> #include <errno.h> #include <...
Support for dynamic memory information added for Alpha
#include "papi.h" int get_memory_info( PAPI_mem_info_t * mem_info ){ int retval = 0; return PAPI_OK; } long _papi_hwd_get_dmem_info(int option){ }
#include "papi.h" #include <sys/procfs.h> #include <stdio.h> #include <fcntl.h> int get_memory_info( PAPI_mem_info_t * mem_info ){ int retval = 0; return PAPI_OK; } long _papi_hwd_get_dmem_info(int option){ pid_t pid = getpid(); prpsinfo_t info; char pfile[256]; int fd; sprintf(pfile, "/proc/%05...
Debug level 1 now only shows error messages (and no backgrounding in gmetad).
/** * @file debug_msg.c Debug Message function */ /* $Id$ */ #include "gangliaconf.h" int debug_level = 0; /** * @fn void debug_msg(const char *format, ...) * Prints the message to STDERR if DEBUG is #defined * @param format The format of the msg (see printf manpage) * @param ... Optional arguments */ void deb...
/** * @file debug_msg.c Debug Message function */ /* $Id$ */ #include "gangliaconf.h" int debug_level = 0; /** * @fn void debug_msg(const char *format, ...) * Prints the message to STDERR if DEBUG is #defined * @param format The format of the msg (see printf manpage) * @param ... Optional arguments */ void deb...
Make sure CONFIG is static and only imported once.
#include "can/canutil.h" namespace openxc { namespace config { typedef struct { int messageSetIndex; } Configuration; Configuration CONFIG; } // namespace config } // namespace openxc
#ifndef _CONFIG_H_ #define _CONFIG_H_ #include "can/canutil.h" namespace openxc { namespace config { typedef struct { int messageSetIndex; } Configuration; static Configuration CONFIG; } // namespace config } // namespace openxc #endif // _CONFIG_H_
Make the testcase even more insane
struct sometimes { short offset; short bit; short live_length; short calls_crossed; } Y; int main() { struct sometimes { int X, Y; } S; S.X = 1; return Y.offset; }
#include <stdio.h> struct sometimes { short offset; short bit; short live_length; short calls_crossed; } Y; int main() { int X; { struct sometimes { int X, Y; } S; S.X = 1; X = S.X; } { struct sometimes { char X; } S; S.X = -1; X += S.X; } X += Y.offset; printf("Result is %...
Delete junk that snuck into r166498.
// RUN: %clang -Wmissing-variable-declarations -fsyntax-only -Xclang -verify %s int vbad1; // expected-warning{{no previous extern declaration for non-static variable 'vbad1'}} int vbad2; int vbad2 = 10; // expected-warning{{no previous extern declaration for non-static variable 'vbad2'}} struct { int mgood1; } vb...
// RUN: %clang -Wmissing-variable-declarations -fsyntax-only -Xclang -verify %s int vbad1; // expected-warning{{no previous extern declaration for non-static variable 'vbad1'}} int vbad2; int vbad2 = 10; // expected-warning{{no previous extern declaration for non-static variable 'vbad2'}} struct { int mgood1; } vb...
Change time type from double to time_t
#ifndef _BINCOOKIE_H #define _BINCOOKIE_H #if defined(_MSC_VER) #define uint32_t DWORD #else #include <stdint.h> #endif #define binarycookies_is_secure(cookie_ptr) (cookie_ptr->flags & secure) #define binarycookies_domain_access_full(cookie_ptr) (cookie_ptr->domain[0] == '.') typedef enum { secure = 1, http_...
#ifndef _BINCOOKIE_H #define _BINCOOKIE_H #if defined(_MSC_VER) #define uint32_t DWORD #else #include <stdint.h> #endif #include <time.h> #define binarycookies_is_secure(cookie_ptr) (cookie_ptr->flags & secure) #define binarycookies_domain_access_full(cookie_ptr) (cookie_ptr->domain[0] == '.') typedef enum { se...
Add hello world file which can be used to establish that the I/O routines are working
#include <stdio.h> // This test program is provided to enable a quick test of PDCLib's console I/O // functions int main(int argc, char** argv) { printf("Hello world\n"); }
Add source for posix timing
#define _POSIX_C_SOURCE 199309L #include <unistd.h> #include <time.h> #include <stdio.h> #ifdef _POSIX_TIMERS static clockid_t clock_type; #endif /** Checks whether we have support for POSIX timers on this system. Sets the clock type and queries the resolution (in seconds). Returns 1 if POSIX timers are supported an...
Disable LE's own debug log spam
// // lelib.h // lelib // // Created by Petr on 27.10.13. // Copyright (c) 2013,2014 Logentries. All rights reserved. // #ifndef LE_DEBUG_LOGS #ifdef DEBUG #define LE_DEBUG_LOGS 1 #else #define LE_DEBUG_LOGS 0 #endif #endif #if LE_DEBUG_LOGS #define LE_DEBUG(...) NSLog(__VA_ARG...
// // lelib.h // lelib // // Created by Petr on 27.10.13. // Copyright (c) 2013,2014 Logentries. All rights reserved. // #ifndef LE_DEBUG_LOGS // #ifdef DEBUG // #define LE_DEBUG_LOGS 1 // #else #define LE_DEBUG_LOGS 0 // #endif #endif #if LE_DEBUG_LOGS #define LE_DEBUG(...) NSLog(...
Include stddef.h always to make NULL expand correctly in Solaris.
#ifndef __LIB_H #define __LIB_H /* default lib includes */ #ifdef HAVE_CONFIG_H # include "config.h" #endif /* default system includes - keep these at minimum.. */ #include <string.h> /* strcmp() etc. */ #ifdef HAVE_STRINGS_H # include <strings.h> /* strcasecmp() etc. */ #endif #include <stdarg.h> /* va_list is use...
#ifndef __LIB_H #define __LIB_H /* default lib includes */ #ifdef HAVE_CONFIG_H # include "config.h" #endif /* default system includes - keep these at minimum.. */ #include <stddef.h> /* Solaris defines NULL wrong unless this is used */ #include <string.h> /* strcmp() etc. */ #ifdef HAVE_STRINGS_H # include <string...
Add a member to Map for the pending structure
/* * Copyright (C) 2015 Luke San Antonio * All rights reserved. */ #pragma once #include "../common/vec.h" #include "structure.h" #include "../gfx/immediate_renderer.h" namespace game { using pos_t = Vec<float>; struct Structure_Instance { Structure_Instance(Structure const&, pos_t pos) noexcept; ~St...
/* * Copyright (C) 2015 Luke San Antonio * All rights reserved. */ #pragma once #include "../common/vec.h" #include "structure.h" #include "../gfx/immediate_renderer.h" namespace game { using pos_t = Vec<float>; struct Structure_Instance { Structure_Instance(Structure const&, pos_t pos) noexcept; ~St...
Fix export header and windows export macros
#ifndef GPGMEPP_EXPORT_H #define GPGMEPP_EXPORT_H #ifdef GPGMEPP_STATIC_DEFINE # define GPGMEPP_EXPORT # define GPGMEPP_NO_EXPORT #else # ifndef GPGMEPP_EXPORT # ifdef KF5Gpgmepp_EXPORTS /* We are building this library */ # define GPGMEPP_EXPORT __attribute__((visibility("default"))) # else ...
#ifndef GPGMEPP_EXPORT_H #define GPGMEPP_EXPORT_H #ifdef GPGMEPP_STATIC_DEFINE # define GPGMEPP_EXPORT # define GPGMEPP_NO_EXPORT #else # ifndef GPGMEPP_EXPORT # ifdef BUILDING_GPGMEPP /* We are building this library */ # ifdef WIN32 # define GPGMEPP_EXPORT __declspec(dllexport) # else #...
Add inOrder_iter() signature to header
#ifndef __STACK__ #define __STACK__ struct btreeNode { int data; struct btreeNode * left; struct btreeNode * right; }; typedef struct btreeNode * btreeNode_t; typedef struct { btreeNode_t root; }btree; typedef btree * btree_t; btree_t newTree(void); int addNode(btree_t, int); void inOrder(btree_t...
#ifndef __STACK__ #define __STACK__ struct btreeNode { int data; struct btreeNode * left; struct btreeNode * right; }; typedef struct btreeNode * btreeNode_t; typedef struct { btreeNode_t root; }btree; typedef btree * btree_t; btree_t newTree(void); int addNode(btree_t, int); void inOrder(btree_t...
Integrate topfish and sfdp into main tree, using GTS for triangulation; remove duplicated code
/* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (c) 1994-2004 AT&T Corp...
Fix warnings about major and minor macros
/* * Copyright (C) 2015 Muhammad Tayyab Akram * * 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 la...
/* * Copyright (C) 2015 Muhammad Tayyab Akram * * 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 la...
Add comment explaining memset in ArithmeticFPInputs
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkArithmeticImageFilter_DEFINED #define SkArithmeticImageFilter_DEFINED #include "include/core/SkImageFilter.h" struct ArithmeticFPInputs { ArithmeticFPInputs(fl...
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkArithmeticImageFilter_DEFINED #define SkArithmeticImageFilter_DEFINED #include "include/core/SkImageFilter.h" struct ArithmeticFPInputs { ArithmeticFPInputs(fl...
Make HAL logging wrapper print to stderr instead of stdout
/* * Copyright (C) 2013 Intel Corporation * * 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...
/* * Copyright (C) 2013 Intel Corporation * * 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...
Add an include of gtest-printers.h to appease the buildbots.
//===- Testing/Support/SupportHelpers.h -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
//===- Testing/Support/SupportHelpers.h -----------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Add readint and writeint call.
int fibonacci(int n) { if(n == 1) return 1; if(n == 2) return 1; int x = fibonacci(n - 1); int y = fibonacci(n - 2); return x + y; } void main() { return; }
int fibonacci(int n) { if(n == 1) return 1; if(n == 2) return 1; int x = fibonacci(n - 1); int y = fibonacci(n - 2); return x + y; } void main() { int n = readint(); writeint(fibonacci(n)); return; }
Make static some functions that should be static
#ifndef TIMER_DISPLAY_H #define TIMER_DISPLAY_H #include <SevenSegmentExtended.h> class TimerDisplay : public SevenSegmentExtended { public: TimerDisplay(uint8_t pin_clk, uint8_t pin_dio); void on(); void off(); void start(); void stop(); void refresh(); private: unsigned long start_millis; bool is_ru...
#ifndef TIMER_DISPLAY_H #define TIMER_DISPLAY_H #include <SevenSegmentExtended.h> class TimerDisplay : public SevenSegmentExtended { public: TimerDisplay(uint8_t pin_clk, uint8_t pin_dio); void on(); void off(); void start(); void stop(); void refresh(); private: unsigned long start_millis; bool is_ru...
Use gcc attribute for clang too.
#ifdef __GNUC__ #define DLL_PUBLIC __attribute__ ((dllexport)) #else #define DLL_PUBLIC __declspec(dllexport) // Note: actually gcc seems to also supports this syntax. #endif DLL_PUBLIC int libtest_main() { return 0; }
#if defined(__GNUC__) || defined(__clang__) # define DLL_PUBLIC __attribute__ ((dllexport)) #else # define DLL_PUBLIC __declspec(dllexport) #endif DLL_PUBLIC int libtest_main() { return 0; }
Add example with hack to delay without timer
#include <inc/hw_types.h> #include <driverlib/sysctl.h> #include <stdio.h> #include <string.h> #include <inc/hw_memmap.h> #include <inc/hw_sysctl.h> #include <driverlib/gpio.h> #include <driverlib/debug.h> #define DEFAULT_STRENGTH GPIO_STRENGTH_2MA #define DEFAULT_PULL_TYPE GPIO_PIN_TYPE_STD_WPU #define PORT_E GPIO_PO...
Add decl. for new mapping info pass factory method.
//===- lib/Target/SparcV9/MappingInfo.h -------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===--------...
//===- lib/Target/SparcV9/MappingInfo.h -------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===--------...
Resolve build break for rtl8721csm/security_hal_test config.
#ifndef _SECLINK_DRV_H__ #define _SECLINK_DRV_H__ #include <stdint.h> struct sec_lowerhalf_s; struct sec_upperhalf_s { struct sec_lowerhalf_s *lower; char *path; int32_t refcnt; sem_t su_lock; }; struct sec_ops_s; struct sec_lowerhalf_s { struct sec_ops_s *ops; struct sec_upperhalf_s *parent; }; int se_regist...
#ifndef _SECLINK_DRV_H__ #define _SECLINK_DRV_H__ #include <stdint.h> #include <semaphore.h> struct sec_lowerhalf_s; struct sec_upperhalf_s { struct sec_lowerhalf_s *lower; char *path; int32_t refcnt; sem_t su_lock; }; struct sec_ops_s; struct sec_lowerhalf_s { struct sec_ops_s *ops; struct sec_upperhalf_s *pa...
Add BlockingOpCanceled and use im_zstr
#ifndef LIB_MART_COMMON_GUARD_EXPERIMENTAL_NW_EXCEPTIONS_H #define LIB_MART_COMMON_GUARD_EXPERIMENTAL_NW_EXCEPTIONS_H #include <exception> #include "ConstString.h" namespace mart { class RuntimeError : public std::exception { mart::ConstString _msg; public: RuntimeError( mart::ConstString message ) : _msg( std...
#ifndef LIB_MART_COMMON_GUARD_EXPERIMENTAL_NW_EXCEPTIONS_H #define LIB_MART_COMMON_GUARD_EXPERIMENTAL_NW_EXCEPTIONS_H #include <exception> #include "ConstString.h" namespace mart { class RuntimeError : public std::exception { mba::im_zstr _msg; public: RuntimeError( mba::im_zstr message ) noexcept : _msg( std:...
Fix build with enable final
#ifndef GPXMLHANDLER_H #define GPXMLHANDlER_H #include <QtXml/QXmlDefaultHandler> #include <QtCore/QDebug> class PlaceContainer; class PlaceMark; class KAtlasXmlHandler : public QXmlDefaultHandler { public: KAtlasXmlHandler(); KAtlasXmlHandler( PlaceContainer* ); bool startDocument(); bool stopDocument(); boo...
#ifndef GPXMLHANDLER_H #define GPXMLHANDLER_H #include <QtXml/QXmlDefaultHandler> #include <QtCore/QDebug> class PlaceContainer; class PlaceMark; class KAtlasXmlHandler : public QXmlDefaultHandler { public: KAtlasXmlHandler(); KAtlasXmlHandler( PlaceContainer* ); bool startDocument(); bool stopDocument(); boo...
Use _mm_pause rather than __builtin_ia32_pause.
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "config.h" #include <stddef.h> #include <sys/types.h> #include <sys/time.h> #include <sched.h> #include <unistd.h> #ifdef HAVE_SYS_SELECT_H #include ...
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "config.h" #include <stddef.h> #include <sys/types.h> #include <sys/time.h> #include <sched.h> #include <unistd.h> #ifdef HAVE_SYS_SELECT_H #include ...
Make block size a protected member of a block channel.
#ifndef BLOCK_CHANNEL_H #define BLOCK_CHANNEL_H class Action; class Buffer; class BlockChannel { protected: BlockChannel(void) { } public: virtual ~BlockChannel() { } virtual Action *close(EventCallback *) = 0; virtual Action *read(off_t, EventCallback *) = 0; virtual Action *write(off_t, Buffer *, EventCall...
#ifndef BLOCK_CHANNEL_H #define BLOCK_CHANNEL_H class Action; class Buffer; class BlockChannel { protected: size_t bsize_; BlockChannel(size_t bsize) : bsize_(bsize) { } public: virtual ~BlockChannel() { } virtual Action *close(EventCallback *) = 0; virtual Action *read(off_t, EventCallback *) = 0; virtua...
Fix uninitialised gnu output for "-ansi" flag
#include <string.h> #include "std.h" int std_from_str(const char *std, enum c_std *penu, int *gnu) { if(!strcmp(std, "-ansi")) goto std_c90; if(strncmp(std, "-std=", 5)) return 1; std += 5; if(!strncmp(std, "gnu", 3)){ if(gnu) *gnu = 1; std += 3; }else if(*std == 'c'){ if(gnu) *gnu = 0; std++...
#include <string.h> #include "std.h" int std_from_str(const char *std, enum c_std *penu, int *gnu) { if(!strcmp(std, "-ansi")){ if(gnu) *gnu = 0; goto std_c90; } if(strncmp(std, "-std=", 5)) return 1; std += 5; if(!strncmp(std, "gnu", 3)){ if(gnu) *gnu = 1; std += 3; }else if(*std == 'c'){ i...
Fix for recursive template (which somehow builds on Apple LLVM version 7.3.0 (clang-703.0.31)
// -*- Mode: C++ -*- #include "mapbox_variant/variant.hpp" #include <cstdint> #include <string> #include <vector> #include <unordered_map> // Variant value types for span tags and log payloads. #ifndef __LIGHTSTEP_VALUE_H__ #define __LIGHTSTEP_VALUE_H__ namespace lightstep { class Value; typedef std::unordered_...
// -*- Mode: C++ -*- #include "mapbox_variant/variant.hpp" #include <cstdint> #include <string> #include <vector> #include <unordered_map> // Variant value types for span tags and log payloads. #ifndef __LIGHTSTEP_VALUE_H__ #define __LIGHTSTEP_VALUE_H__ namespace lightstep { class Value; typedef std::unordered_...
Make it print something on session open/close
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <security/pam_appl.h> #include <security/pam_modules.h> PAM_EXTERN int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv) { return PAM_SUCCESS; } PAM_EXTERN int pam_sm_close_session(pam_handle_t *pamh, int flags, int...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <security/pam_appl.h> #include <security/pam_modules.h> PAM_EXTERN int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv) { printf("pam_unshare pam_sm_open_session\n"); return PAM_SUCCESS; } PAM_EXTERN int pam_sm...
Add BST Predecessor/Successor func declaration
#include <stdlib.h> #ifndef __BST_H__ #define __BST_H__ struct BSTNode; struct BST; typedef struct BSTNode BSTNode; typedef struct BST BST; BST* BST_Create(void); BSTNode* BSTNode_Create(void* k); void BST_Inorder_Tree_Walk(BST* T, void (f)(void*)); void BST_Preorder_Tree_Walk(BST* T, void (f)(void*)); void BST_Postor...
#include <stdlib.h> #ifndef __BST_H__ #define __BST_H__ struct BSTNode; struct BST; typedef struct BSTNode BSTNode; typedef struct BST BST; BST* BST_Create(void); BSTNode* BSTNode_Create(void* k); void BST_Inorder_Tree_Walk(BST* T, void (f)(void*)); void BST_Preorder_Tree_Walk(BST* T, void (f)(void*)); void BST_Postor...
Undo commit: "Made all blocks sensors"
// // Created by dar on 11/25/15. // #ifndef C003_SIMPLEBLOCK_H #define C003_SIMPLEBLOCK_H #pragma once #include "Block.h" class SimpleBlock : public Block { public: SimpleBlock(Map *map, int texPos, int x, int y) : Block(map, x, y), texPos(texPos) { shape.SetAsBox(0.5, 0.5); b2FixtureDef fixDef...
// // Created by dar on 11/25/15. // #ifndef C003_SIMPLEBLOCK_H #define C003_SIMPLEBLOCK_H #pragma once #include "Block.h" class SimpleBlock : public Block { public: SimpleBlock(Map *map, int texPos, int x, int y) : Block(map, x, y), texPos(texPos) { shape.SetAsBox(0.5, 0.5); b2FixtureDef fixDef...
Add protected persistable property to Node base class.
#ifndef SRC_NODE_H_ #define SRC_NODE_H_ #include <boost/serialization/serialization.hpp> #include <boost/serialization/access.hpp> #include <boost/serialization/nvp.hpp> #include <memory> #include "./render_data.h" #include "./math/obb.h" class Gl; /** * \brief Base class for nodes which are managed by the * Node...
#ifndef SRC_NODE_H_ #define SRC_NODE_H_ #include <boost/serialization/serialization.hpp> #include <boost/serialization/access.hpp> #include <boost/serialization/nvp.hpp> #include <memory> #include "./render_data.h" #include "./math/obb.h" class Gl; /** * \brief Base class for nodes which are managed by the * Node...
Fix calling by reference in entity
#ifndef __ENTITY_H__ #define __ENTITY_H__ #include "ModuleCollision.h" class Entity { public: Entity() : Parent(nullptr) {} Entity(Entity* parent) : Parent(parent) {} virtual ~Entity() {} // Entity lifecycle methods virtual bool Start() { return true; } virtual bool Start(bool active) { this->_acti...
#ifndef __ENTITY_H__ #define __ENTITY_H__ #include "ModuleCollision.h" #include "Point3.h" class Entity { public: Entity() : Parent(nullptr) {} Entity(Entity* parent) : Parent(parent) {} virtual ~Entity() {} // Entity lifecycle methods virtual bool Start() { return true; } bool Enable() { if (!_act...
Add DEFINE_X macros, for ref counters, readers and session readers
#ifndef UTIL_H #define UTIL_H /*** Utility functions ***/ #define true 1 #define false 0 #define ALLOC(type) ALLOC_N(type, 1) #define ALLOC_N(type, n) ((type*) xmalloc(sizeof(type) * (n))) #define MEMCPY(dst, src, type) MEMCPY_N(dst, src, type, 1) #define MEMCPY_N(dst, src, type, n) (memcpy((dst), (src), sizeof(type...
#ifndef UTIL_H #define UTIL_H /*** Utility functions ***/ #define true 1 #define false 0 #define ALLOC(type) ALLOC_N(type, 1) #define ALLOC_N(type, n) ((type*) xmalloc(sizeof(type) * (n))) #define MEMCPY(dst, src, type) MEMCPY_N(dst, src, type, 1) #define MEMCPY_N(dst, src, type, n) (memcpy((dst), (src), sizeof(type...
Add missing code for command to string conversion.
#include <mqtt3.h> const char *mqtt_command_to_string(uint8_t command) { switch(command){ case CONNACK: return "CONNACK"; case CONNECT: return "CONNECT"; case DISCONNECT: return "DISCONNECT"; case PINGREQ: return "PINGREQ"; case PINGRESP: return "PINGRESP"; case PUBACK: return "PUBACK"; ...
Update with new lefty, fixing many bugs and supporting new features
/* $Id$ $Revision$ */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (...
/* $Id$ $Revision$ */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (...
Define the BMP180 container class
#ifndef RCR_LEVEL1PAYLOAD_BMP180_H_ #define RCR_LEVEL1PAYLOAD_BMP180_H_ #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif namespace rcr { namespace level1payload { } // namespace level1_payload } // namespace rcr #endif // RCR_LEVEL1PAYLOAD_BMP180_H_
#ifndef RCR_LEVEL1PAYLOAD_BMP180_H_ #define RCR_LEVEL1PAYLOAD_BMP180_H_ #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif #include <Adafruit_BMP085_Library\Adafruit_BMP085.h> namespace rcr { namespace level1payload { // Encapsulates a BMP180 sensor and providing select...
Include config.h before checking HAVE_X11
/* * AT-SPI - Assistive Technology Service Provider Interface * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) * * Copyright 2009 Nokia. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published...
/* * AT-SPI - Assistive Technology Service Provider Interface * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) * * Copyright 2009 Nokia. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published...
Change filecheck line for map 6
int f(int); int main(void) { int *x, *y; // CHECK: Found // CHECK: line [[@LINE+1]] for(int i = 0; i < 100; i++) { x[9] = 45; x[i] = f(y[i]); } }
int f(int); int main(void) { int *x, *y; // CHECK: Near miss for(int i = 0; i < 100; i++) { x[9] = 45; x[i] = f(y[i]); } }
Define a type alias to represent boards.
#include <stdlib.h> /** * @author: Hendrik Werner */ #define BOARD_HEIGHT 50 #define BOARD_WIDTH 50 typedef struct Position { int row; int col; } Position; typedef enum Cell { EMPTY ,SNAKE ,FOOD } Cell; int main() { return EXIT_SUCCESS; }
#include <stdlib.h> /** * @author: Hendrik Werner */ #define BOARD_HEIGHT 50 #define BOARD_WIDTH 50 typedef struct Position { int row; int col; } Position; typedef enum Cell { EMPTY ,SNAKE ,FOOD } Cell; typedef Cell Board[BOARD_HEIGHT][BOARD_WIDTH]; int main() { return EXIT_SUCCESS; }
Add source for main executable
#include <stdio.h> #include "dbg.h" #include "stats.h" int main(int argc, char *argv[]) { dataset *ds = read_data_file(argv[1]); if (!ds) return 1; printf("count %zu\n", ds->n); printf("min %.5g\n", min(ds)); printf("Q1 %.5g\n", first_quartile(ds)); printf("mean %...
Add List Delete function declaration
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; List* List_Create(void); void List_Destroy(List* l); ListNode* ListNode_Create(void *); void ListNode_Destroy(ListNode* n); ListNode* List_Search(List* l, void* k, int (f)...
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; List* List_Create(void); void List_Destroy(List* l); ListNode* ListNode_Create(void *); void ListNode_Destroy(ListNode* n); ListNode* List_Search(List* l, void* k, int (f)...
Remove our customed `get_unique_file_info` on Windows platform.
/* ---------------------------------------------------------------------------- (c) The University of Glasgow 2006 Useful Win32 bits ------------------------------------------------------------------------- */ #if defined(_WIN32) #include "HsBase.h" int get_unique_file_info(int fd, HsWord64 *dev, HsWord...
/* ---------------------------------------------------------------------------- (c) The University of Glasgow 2006 Useful Win32 bits ------------------------------------------------------------------------- */ #if defined(_WIN32) #include "HsBase.h" #endif
Remove comment which is impossible :(
#pragma once #include "config.h" #define BOOST_LOG_DYN_LINK #include <boost/log/sources/severity_logger.hpp> #include <boost/log/trivial.hpp> int main(int argc, char **argv); boost::log::sources::severity_logger<boost::log::trivial::severity_level> &get_global_logger(void); // TOOD: Make const
#pragma once #include "config.h" #define BOOST_LOG_DYN_LINK #include <boost/log/sources/severity_logger.hpp> #include <boost/log/trivial.hpp> int main(int argc, char **argv); boost::log::sources::severity_logger<boost::log::trivial::severity_level> &get_global_logger(void);
Add motor loop tester to see once and for all if possible
#pragma config(Hubs, S1, HTMotor, none, none, none) #pragma config(Sensor, S1, , sensorI2CMuxController) #pragma config(Motor, mtr_S1_C1_1, leftMotor, tmotorTetrix, openLoop) #pragma config(Motor, mtr_S1_C1_2, rightMotor, tmotorTetrix, openLoop) //*!!Code automatically g...
#pragma config(Hubs, S1, HTMotor, none, none, none) #pragma config(Sensor, S1, , sensorI2CMuxController) #pragma config(Motor, mtr_S1_C1_1, Michelangelo_FR, tmotorTetrix, PIDControl, reversed, encoder) #pragma config(Motor, mtr_S1_C1_2, Donatello_FL, tmotorTetrix, PIDControl, enco...
Add in UIKit import into header.
// // RMUniversalAlert.h // RMUniversalAlert // // Created by Ryan Maxwell on 19/11/14. // Copyright (c) 2014 Ryan Maxwell. All rights reserved. // @class RMUniversalAlert; typedef void(^RMUniversalAlertCompletionBlock)(RMUniversalAlert *alert, NSInteger buttonIndex); @interface RMUniversalAlert : NSObject + (i...
// // RMUniversalAlert.h // RMUniversalAlert // // Created by Ryan Maxwell on 19/11/14. // Copyright (c) 2014 Ryan Maxwell. All rights reserved. // #import <UIKit/UIKit.h> @class RMUniversalAlert; typedef void(^RMUniversalAlertCompletionBlock)(RMUniversalAlert *alert, NSInteger buttonIndex); @interface RMUniver...
Make QUICHE export use new-style default impl.
// Copyright 2019 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 THIRD_PARTY_QUICHE_PLATFORM_API_QUICHE_EXPORT_H_ #define THIRD_PARTY_QUICHE_PLATFORM_API_QUICHE_EXPORT_H_ #include "net/quiche/common/platform/im...
// Copyright 2019 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 THIRD_PARTY_QUICHE_PLATFORM_API_QUICHE_EXPORT_H_ #define THIRD_PARTY_QUICHE_PLATFORM_API_QUICHE_EXPORT_H_ #include "quiche_platform_impl/quiche_e...
Fix declarations for IsSynced and SyncPercentage
#include "main.h" #include "addrman.h" #include "alert.h" #include "base58.h" #include "init.h" #include "noui.h" #include "rpcserver.h" #include "txdb.h" #include <boost/thread.hpp> #include <boost/filesystem.hpp> #include "nan.h" #include "scheduler.h" #include "core_io.h" #include "script/bitcoinconsensus.h" #includ...
#include "main.h" #include "addrman.h" #include "alert.h" #include "base58.h" #include "init.h" #include "noui.h" #include "rpcserver.h" #include "txdb.h" #include <boost/thread.hpp> #include <boost/filesystem.hpp> #include "nan.h" #include "scheduler.h" #include "core_io.h" #include "script/bitcoinconsensus.h" #includ...
Fix SFINAE default arg and add array overload.
#ifndef BF_WRAP_H #define BF_WRAP_H #include <type_traits> #include "object.h" namespace bf { template < typename T, typename std::enable_if<std::is_integral<T>::value>::type > object wrap(T const& x) { return {&x, sizeof(T)}; } template <typename Sequence> object wrap(Sequence const& s) { return {s.data(),...
#ifndef BF_WRAP_H #define BF_WRAP_H #include <type_traits> #include <vector> #include "object.h" namespace bf { template < typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type > object wrap(T const& x) { return {&x, sizeof(T)}; } template < typename T, size_t N, typename = ...
Create Interface for RTP Streamers
#pragma once #include "media/processing/filter.h" #include <QHostAddress> class IRTPStreamer { public: virtual ~IRTPStreamer(); virtual void init(StatisticsInterface *stats) = 0; virtual void uninit() = 0; virtual void run() = 0; virtual void stop() = 0; // init a session with sessionID to use with add/...
Add coding to query the screen to KEYP.c
#! /usr/bin/tcc -run /* a simple keypress decoder */ #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <termios.h> #include <unistd.h> #include <string.h> struct termios orig_termios; void disableRawMode() { tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios); } void enableRawMode() { tcgetattr...
Fix comparison return values and implement Integer truncation
#include <stdio.h> void putStr(const char *str) { fputs(str, stdout); }
#include <stdio.h> #include <gmp.h> void putStr(const char *str) { fputs(str, stdout); } void mpz_set_ull(mpz_t n, unsigned long long ull) { mpz_set_ui(n, (unsigned int)(ull >> 32)); /* n = (unsigned int)(ull >> 32) */ mpz_mul_2exp(n, n, 32); /* n <<= 32 */ mpz_add_ui(n, n, (unsigned i...
Fix include headers after refactor
#pragma once #include <string_view> namespace tid { enum level : int { parent = -1, normal = 0, detail = 1, pedant = 2, }; constexpr std::string_view level2sv(level l) noexcept { switch(l) { case normal: return "normal"; case detail: return "...
#pragma once #include <exception> #include <string_view> namespace tid { enum level : int { parent = -1, normal = 0, detail = 1, pedant = 2, }; constexpr std::string_view level2sv(level l) noexcept { switch(l) { case normal: return "normal"; ...
Add canMove, isInside and validCommand
#include <stdlib.h> #include "blobsBack.h" int requestCmd(int player, typeCommand* command) { command = NULL; //if() return 1; }
#include <stdlib.h> #include "blobsBack.h" int canMove(int player, typeBoard* board) { int i, j; for(i = 0; i < board->h; i++) { for(j = 0; j < board->w; j++) { if(board->get[i][j].owner == player && board->get[i][j].canMove) { return 1; } } } return 0; } char* getCommand(typeComm...
Add tests for singleton lifetime
#ifndef TESTCASESINGLETON_H #define TESTCASESINGLETON_H #include "CppDiFactory.h" class IEngine { public: virtual double getVolume() const = 0; virtual ~IEngine() = default; }; class Engine : public IEngine { public: virtual double getVolume() const override { return 10.5; } }; TEST_CASE( "Singleton Test", ...
#ifndef TESTCASESINGLETON_H #define TESTCASESINGLETON_H #include "CppDiFactory.h" namespace testCaseSingleton { class IEngine { public: virtual double getVolume() const = 0; virtual ~IEngine() = default; }; class Engine : public IEngine { private: static bool _valid; public: Engine() { _valid = true; } ...
Use enum for flag check
#include <stdio.h> #include "bincookie.h" int main(int argc, char *argv[]) { if (argc != 2) { printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]); printf("Example: %s Cookies.binarycookies\n", argv[0]); return 1; } binarycookies_t *bc = binarycookies_init(argv...
#include <stdio.h> #include "bincookie.h" int main(int argc, char *argv[]) { if (argc != 2) { printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]); printf("Example: %s Cookies.binarycookies\n", argv[0]); return 1; } binarycookies_t *bc = binarycookies_init(argv...
Print irq_num during assert in static irq_attach
/** * @file * @brief * * @date Mar 12, 2014 * @author: Anton Bondarev */ #include <assert.h> #include <kernel/irq.h> extern char __static_irq_table_start; extern char __static_irq_table_end; #define STATIC_IRQ_TABLE_SIZE \ (((int) &__static_irq_table_end - (int) &__static_irq_table_start) / 4) int irq_attach...
/** * @file * @brief * * @date Mar 12, 2014 * @author: Anton Bondarev */ #include <assert.h> #include <kernel/irq.h> extern char __static_irq_table_start; extern char __static_irq_table_end; #define STATIC_IRQ_TABLE_SIZE \ (((int) &__static_irq_table_end - (int) &__static_irq_table_start) / 4) int irq_attach...
Add 1st part of encoding algorithm
/* * fibonacci_coding.c * Author: Duc Thanh Tran */ #include <math.h> /* * Calculates i-th fibonacci-number (based on Moivre-Binet) * where we start with 1 and ignore the duplicate 1 at the beginning, i.e. * the fibonacci sequence is: 1, 2, 3, 5, 8, ... */ unsigned int fibonacciNumber(int n) { if(n <= 2) ...
/* * fibonacci_coding.c * Author: Duc Thanh Tran */ #include <math.h> /* * Calculates i-th fibonacci-number (based on Moivre-Binet) * where we start with 1 and ignore the duplicate 1 at the beginning, i.e. * the fibonacci sequence is: 1, 2, 3, 5, 8, ... */ unsigned int fibonacciNumber(int n) { if(n <= 2) ...
Add one more check to the micromips attribute test case. NFC
// RUN: %clang_cc1 -triple mips-linux-gnu -fsyntax-only -verify %s __attribute__((nomicromips(0))) void foo1(); // expected-error {{'nomicromips' attribute takes no arguments}} __attribute__((micromips(1))) void foo2(); // expected-error {{'micromips' attribute takes no arguments}} __attribute((nomicromips)) int ...
// RUN: %clang_cc1 -triple mips-linux-gnu -fsyntax-only -verify %s __attribute__((nomicromips(0))) void foo1(); // expected-error {{'nomicromips' attribute takes no arguments}} __attribute__((micromips(1))) void foo2(); // expected-error {{'micromips' attribute takes no arguments}} __attribute((nomicromips)) int ...
Fix krzy issue for "endswithnewline"
#ifndef QREALPROPERTYWIDGETITEM_H #define QREALPROPERTYWIDGETITEM_H #include "widgets/propertywidgetitem.h" class QDoubleSpinBox; namespace GluonCreator { class QRealPropertyWidgetItem : public PropertyWidgetItem { Q_OBJECT public: explicit QRealPropertyWidgetItem(QWidget* parent = 0, Qt:...
#ifndef QREALPROPERTYWIDGETITEM_H #define QREALPROPERTYWIDGETITEM_H #include "widgets/propertywidgetitem.h" class QDoubleSpinBox; namespace GluonCreator { class QRealPropertyWidgetItem : public PropertyWidgetItem { Q_OBJECT public: explicit QRealPropertyWidgetItem(QWidget* parent = 0, Qt:...
Modify methods according to new names in implementation file
// // AddressGeocoderFactory.h // bikepath // // Created by Farheen Malik on 8/19/14. // Copyright (c) 2014 Bike Path. All rights reserved. // #import <Foundation/Foundation.h> #import "SPGooglePlacesAutocomplete.h" #import <UIKit/UIKit.h> #import "GeocodeItem.h" @interface AddressGeocoderFactory : NSObject //+ ...
// // AddressGeocoderFactory.h // bikepath // // Created by Farheen Malik on 8/19/14. // Copyright (c) 2014 Bike Path. All rights reserved. // #import <Foundation/Foundation.h> #import "SPGooglePlacesAutocomplete.h" #import <UIKit/UIKit.h> #import "GeocodeItem.h" @interface AddressGeocoderFactory : NSObject //+ ...
Change test now %ebx is callee-save
// RUN: %ucc -DFIRST -S -o- %s | grep -F 'movl (%%rax), %%eax' // RUN: %ucc -DSECOND -S -o- %s | grep -F 'movl 4(%%rbx), %%ebx' #ifdef FIRST f(int *p) { return *p; // should see that p isn't used after/.retains==1 and not create a new reg, // but re-use the current } #elif defined(SECOND) struct A { int i, j; ...
// RUN: %ucc -DFIRST -S -o- %s | grep -F 'movl (%%rax), %%eax' // RUN: %ucc -DSECOND -S -o- %s | grep -F 'movl 4(%%rcx), %%ecx' #ifdef FIRST f(int *p) { return *p; // should see that p isn't used after/.retains==1 and not create a new reg, // but re-use the current } #elif defined(SECOND) struct A { int i, j; ...
Add imports that are necessary for clang to parse header files after compilation.
// // ASAbsoluteLayoutElement.h // AsyncDisplayKit // // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the ...
// // ASAbsoluteLayoutElement.h // AsyncDisplayKit // // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the ...
Fix fuzzer to compile in C++ mode
/* How to fuzz: clang main.c -O2 -g -fsanitize=address,fuzzer -o fuzz cp -r data temp ./fuzz temp/ -dict=gltf.dict -jobs=12 -workers=12 */ #define CGLTF_IMPLEMENTATION #include "../cgltf.h" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { cgltf_options options = {0}; cgltf_data* data = NULL; cgltf_r...
/* How to fuzz: clang main.c -O2 -g -fsanitize=address,fuzzer -o fuzz cp -r data temp ./fuzz temp/ -dict=gltf.dict -jobs=12 -workers=12 */ #define CGLTF_IMPLEMENTATION #include "../cgltf.h" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { cgltf_options options = {cgltf_file_type_invalid}; cgltf_data*...
Add adding and subtracting operators
//Copyright (c) 2018 Ultimaker B.V. //CuraEngine is released under the terms of the AGPLv3 or higher. #ifndef LAYERINDEX_H #define LAYERINDEX_H namespace cura { /* * Struct behaving like a layer number. * * This is a facade. It behaves exactly like an integer but is used to indicate * that it is a layer number. ...
//Copyright (c) 2018 Ultimaker B.V. //CuraEngine is released under the terms of the AGPLv3 or higher. #ifndef LAYERINDEX_H #define LAYERINDEX_H namespace cura { /* * Struct behaving like a layer number. * * This is a facade. It behaves exactly like an integer but is used to indicate * that it is a layer number. ...
Fix invalid null precedence value
#ifndef TOKEN_H_ #define TOKEN_H_ #include <iostream> #include <string> #include <vector> enum class TokenType { NUMBER, ADD, SUBTRACT, MULTIPLY, DIVIDE, EXPONENT, }; enum class OperatorType { NONE, UNARY, BINARY, EITHER, }; class Token { public: ...
#ifndef TOKEN_H_ #define TOKEN_H_ #include <iostream> #include <string> #include <vector> enum class TokenType { NUMBER, ADD, SUBTRACT, MULTIPLY, DIVIDE, EXPONENT, }; enum class OperatorType { NONE, UNARY, BINARY, EITHER, }; class Token { public: ...
Increase version for the 4.1 release
// KMail Version Information // #ifndef kmversion_h #define kmversion_h #define KMAIL_VERSION "1.9.52" #endif /*kmversion_h*/
// KMail Version Information // #ifndef kmversion_h #define kmversion_h #define KMAIL_VERSION "1.10.0" #endif /*kmversion_h*/
Use a EStatusBits 'enum' instead of a 'constexpr static int' (allowing automatic checking for overlaps)
// @(#)root/thread:$Id$ // Author: Bertrand Bellenot 20/10/2004 /************************************************************************* * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
// @(#)root/thread:$Id$ // Author: Bertrand Bellenot 20/10/2004 /************************************************************************* * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
Change the order of the strings
#include <err.h> #include <stdio.h> #include <stdlib.h> #include "libspell.h" #include "websters.c" int main(int argc, char **argv) { size_t i; char *soundex_code; FILE *out = fopen("dict/soundex.txt", "w"); if (out == NULL) err(EXIT_FAILURE, "Failed to open soundex"); for (i = 0; i < sizeof(dict) / sizeof(di...
#include <err.h> #include <stdio.h> #include <stdlib.h> #include "libspell.h" #include "websters.c" int main(int argc, char **argv) { size_t i; char *soundex_code; FILE *out = fopen("dict/soundex.txt", "w"); if (out == NULL) err(EXIT_FAILURE, "Failed to open soundex"); for (i = 0; i < sizeof(dict) / sizeof(di...
Add a tool similar to hexdump, but for text files.
/* strdump.c -- similar to hexdump but with ascii strings */ #include <stdio.h> #include <string.h> int strdump(FILE *fo, FILE *fi) { int c, n; n = 0; fputs("\"", fo); c = fgetc(fi); while (c != -1) { if (c == '\n' || c == '\r') fputs("\\n\"\n\"", fo); else putc(c, fo); c = fgetc...
Revert "Revert "remove unused api on xfermodeimagefilter""
/* * Copyright 2013 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkXfermodeImageFilter_DEFINED #define SkXfermodeImageFilter_DEFINED #include "SkArithmeticImageFilter.h" #include "SkBlendMode.h" #include "SkImag...
/* * Copyright 2013 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkXfermodeImageFilter_DEFINED #define SkXfermodeImageFilter_DEFINED #include "SkArithmeticImageFilter.h" #include "SkBlendMode.h" #include "SkImag...
Add missing declaration for init_libdtoolutil()
/** * PANDA 3D SOFTWARE * Copyright (c) Carnegie Mellon University. All rights reserved. * * All use of this software is subject to the terms of the revised BSD * license. You should have received a copy of this license along * with this source code in a file named "LICENSE." * * @file config_dtoolutil.h * @...
/** * PANDA 3D SOFTWARE * Copyright (c) Carnegie Mellon University. All rights reserved. * * All use of this software is subject to the terms of the revised BSD * license. You should have received a copy of this license along * with this source code in a file named "LICENSE." * * @file config_dtoolutil.h * @...
Adjust for new paramter to printStackTrace().
/* * java.lang.Throwable.c * * Copyright (c) 1996, 1997 * Transvirtual Technologies, Inc. All rights reserved. * * See the file "license.terms" for information on usage and redistribution * of this file. */ #include "config.h" #include "config-io.h" #include <assert.h> #include <native.h> #include "java_io_...
/* * java.lang.Throwable.c * * Copyright (c) 1996, 1997 * Transvirtual Technologies, Inc. All rights reserved. * * See the file "license.terms" for information on usage and redistribution * of this file. */ #include "config.h" #include "config-io.h" #include <assert.h> #include <native.h> #include "java_io_...
Add dot product (scalar product)
/** Produto escalar de dois vetores de N posições. A.B = axbx + ayby + ... + anbn. */ #include <stdio.h> int produtoEscalar(int sizes, int *v1, int *v2){ int i; int escalar = 0; for (i = 0; i < sizes; i++){ escalar += v1[i] * v2[i]; } return escalar; } int main(){ int n; printf("Dimensão dos vetores: ")...
Remove ldXa and stXa defines, unused.
/* asmmacro.h: Assembler macros. * * Copyright (C) 1996 David S. Miller (davem@caipfs.rutgers.edu) */ #ifndef _SPARC_ASMMACRO_H #define _SPARC_ASMMACRO_H #include <asm/btfixup.h> #include <asm/asi.h> #define GET_PROCESSOR4M_ID(reg) \ rd %tbr, %reg; \ srl %reg, 12, %reg; \ and %reg, 3, %reg; #define GET_PROCES...
/* asmmacro.h: Assembler macros. * * Copyright (C) 1996 David S. Miller (davem@caipfs.rutgers.edu) */ #ifndef _SPARC_ASMMACRO_H #define _SPARC_ASMMACRO_H #include <asm/btfixup.h> #include <asm/asi.h> #define GET_PROCESSOR4M_ID(reg) \ rd %tbr, %reg; \ srl %reg, 12, %reg; \ and %reg, 3, %reg; #define GET_PROCES...
Change type of view passed to hit test hooks
/* * Copyright (c) 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #im...
/* * Copyright (c) 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #im...
Fix check against nullptr in checkandconvert
// This file is a part of the OpenSurgSim project. // Copyright 2013, SimQuest Solutions 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/LICE...
// This file is a part of the OpenSurgSim project. // Copyright 2013, SimQuest Solutions 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/LICE...
Make sure layer class is destructed first
#ifndef LAYER_H_ #define LAYER_H_ class Layer { public: virtual void render()=0; virtual void update()=0; protected: virtual ~Layer(); }; #endif
#ifndef LAYER_H_ #define LAYER_H_ //Abstract layer class class Layer { public: virtual void render()=0; virtual void update()=0; protected: virtual ~Layer() {} }; #endif
Allow to compile with non-GCC compiler.
/* $FreeBSD$ */ #warning "<gnuregex.h> has been replaced by <gnu/regex.h>" #include <gnu/regex.h>
/*- * Copyright (c) 2004 David E. O'Brien * Copyright (c) 2004 Andrey A. Chernov * 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...
Add defines for OSK event ids
#ifndef __LV2_SYSUTIL_H__ #define __LV2_SYSUTIL_H__ #include <ppu-types.h> #define SYSUTIL_EVENT_SLOT0 0 #define SYSUTIL_EVENT_SLOT1 1 #define SYSUTIL_EVENT_SLOT2 2 #define SYSUTIL_EVENT_SLOT3 3 #define SYSUTIL_EXIT_GAME 0x0101 #define SYSUTIL_DRAW_BEGIN 0x0121 #define SYSUTIL_DRAW_END 0x0122 #define S...
#ifndef __LV2_SYSUTIL_H__ #define __LV2_SYSUTIL_H__ #include <ppu-types.h> #define SYSUTIL_EVENT_SLOT0 0 #define SYSUTIL_EVENT_SLOT1 1 #define SYSUTIL_EVENT_SLOT2 2 #define SYSUTIL_EVENT_SLOT3 3 #define SYSUTIL_EXIT_GAME 0x0101 #define SYSUTIL_DRAW_BEGIN 0x0121 #define SYSUTIL_DRAW_END 0x0122 #define S...
Split macro into multiple lines.
/* http://www.jera.com/techinfo/jtns/jtn002.html */ #define mu_assert(message, test) do { if (!(test)) return message; } while (0) #define mu_run_test(testname, test) \ do { \ char *message = test(); tests_run++; \ if (message) return message; \ else printf("OK: %s\n", testname); \ } while (0) extern int test...
/* http://www.jera.com/techinfo/jtns/jtn002.html */ #define mu_assert(message, test) \ do { \ if (!(test)) \ return message; \ } while (0) #define mu_run_test(testname, test) \ do { \ char *message = test(); tests_run++; \ if (message) return message; \ else printf("OK: %s\n", testname); \ } while (0) ...
Clean up what looks like a direct class-dump header.
#import "PSControlTableCell.h" @class UIActivityIndicatorView; @interface PSSwitchTableCell : PSControlTableCell { UIActivityIndicatorView *_activityIndicator; } @property BOOL loading; - (BOOL)loading; - (void)setLoading:(BOOL)loading; - (id)controlValue; - (id)newControl; - (void)setCellEnabled:(BOOL)enabled...
#import "PSControlTableCell.h" @class UIActivityIndicatorView; @interface PSSwitchTableCell : PSControlTableCell { UIActivityIndicatorView *_activityIndicator; } @property (nonatomic) BOOL loading; @end
Add turn and interested fields per level
/* * Raphael Kubo da Costa - RA 072201 * * MC514 - Lab2 */ #ifndef __THREAD_TREE_H #define __THREAD_TREE_H typedef struct { size_t n_elem; pthread_t *list; } ThreadLevel; typedef struct { size_t height; ThreadLevel **tree; } ThreadTree; ThreadTree *thread_tree_new(size_t numthreads); void thread_tree_f...
/* * Raphael Kubo da Costa - RA 072201 * * MC514 - Lab2 */ #ifndef __THREAD_TREE_H #define __THREAD_TREE_H typedef struct { size_t *interested; pthread_t *list; size_t n_elem; size_t turn; } ThreadLevel; typedef struct { size_t height; ThreadLevel **tree; } ThreadTree; ThreadTree *thread_tree_new(si...
Add new sections for post details
typedef NS_ENUM(NSInteger, StatsSection) { StatsSectionGraph, StatsSectionPeriodHeader, StatsSectionEvents, StatsSectionPosts, StatsSectionReferrers, StatsSectionClicks, StatsSectionCountry, StatsSectionVideos, StatsSectionAuthors, StatsSectionSearchTerms, StatsSectionComment...
typedef NS_ENUM(NSInteger, StatsSection) { StatsSectionGraph, StatsSectionPeriodHeader, StatsSectionEvents, StatsSectionPosts, StatsSectionReferrers, StatsSectionClicks, StatsSectionCountry, StatsSectionVideos, StatsSectionAuthors, StatsSectionSearchTerms, StatsSectionComment...
Add thread member for offloading disk info ops
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once #include <Windows.h> #include "OSD.h" class NotifyIcon; class EjectOSD : public OSD { public: EjectOSD(); virtual void Hide(); virtual void ProcessHotkeys(HotkeyInfo &hki);...
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once #include <Windows.h> #include <thread> #include "OSD.h" class NotifyIcon; class EjectOSD : public OSD { public: EjectOSD(); virtual void Hide(); virtual void ProcessHotkey...
Add regexString and inputText properties
// // CAFMatchedTextViewController.h // Curiosity // // Created by Matthew Thomas on 8/26/12. // Copyright (c) 2012 Matthew Thomas. All rights reserved. // #import <UIKit/UIKit.h> @interface CAFMatchedTextViewController : UIViewController @end
// // CAFMatchedTextViewController.h // Curiosity // // Created by Matthew Thomas on 8/26/12. // Copyright (c) 2012 Matthew Thomas. All rights reserved. // #import <UIKit/UIKit.h> @interface CAFMatchedTextViewController : UIViewController @property (copy, nonatomic) NSString *regexString; @property (copy, nonatom...
Add C implementation of concomp with fork
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/stat.h> #define BUF_SIZE 1024 #define CHILD 0 typedef struct { char filename[BUF_SIZE]; off_t size; } SizeMessage; int main(int argc, const char ** argv) { /* fork process id */ pid_t pid = -1; /* Start ...
Add header file for generic link address
/* * Copyright (c) 2016 Intel Corporation. * * 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...
Create a Linked list from user input string
/* last written on 13/08/2017 22:06:14 owner ise2017001 */ #include <stdio.h> #include <stdlib.h> #include <string.h> struct node { int data; struct node *next; }; struct node *createNode (int value) { struct node *newNode = (struct node *) malloc (sizeof (struct node)); newNode -> data ...
Add missing declaration to header.
/* * Copyright (c) 2013 by Kyle Isom <kyle@tyrfingr.is>. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ...
/* * Copyright (c) 2013 by Kyle Isom <kyle@tyrfingr.is>. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ...
Make objectModel protocol method static.
#pragma mark Class Interface @interface AFObjectModel : NSObject #pragma mark - Properties @property (nonatomic, strong, readonly) NSArray *key; @property (nonatomic, strong, readonly) NSDictionary *mappings; @property (nonatomic, strong, readonly) NSDictionary *transformers; #pragma mark - Constructors - (id)...
#pragma mark Class Interface @interface AFObjectModel : NSObject #pragma mark - Properties @property (nonatomic, strong, readonly) NSArray *key; @property (nonatomic, strong, readonly) NSDictionary *mappings; @property (nonatomic, strong, readonly) NSDictionary *transformers; #pragma mark - Constructors - (id)...
Add one example file for func forward declarations.
/* Func call with various arg numbers. And func forward declarations. */ void aX(void); int a1(int param1); int a2(int param1, param2); void a3(); void a3(void); int f(int arg1, char arg2) { a1(arg1); a2(arg1, arg2); a3(); }
Add a new widget template for all the toolbar buttons in Lumina - still needs testing
//=========================================== // Lumina-DE source code // Copyright (c) 2013, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== #ifndef _LUMINA_TOOLBAR_WIDGET_H #define _LUMINA_TOOLBAR_WIDGET_H #include <QAbs...