Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Remove unneeded static member decls; mark c'tor, d'tor as deleted.
//--------------------------------------------------------------------*- C++ -*- // CLING - the C++ LLVM-based InterpreterG :) // author: Axel Naumann <axel@cern.ch> // // This file is dual-licensed: you can choose to license it under the University // of Illinois Open Source License or the GNU Lesser General Public L...
//--------------------------------------------------------------------*- C++ -*- // CLING - the C++ LLVM-based InterpreterG :) // author: Axel Naumann <axel@cern.ch> // // This file is dual-licensed: you can choose to license it under the University // of Illinois Open Source License or the GNU Lesser General Public L...
Remove duplicate members so this compiles again
// // GrowlBezelWindowView.h // Display Plugins // // Created by Jorge Salvador Caffarena on 09/09/04. // Copyright 2004 Jorge Salvador Caffarena. All rights reserved. // #import <Cocoa/Cocoa.h> #import "GrowlNotificationView.h" @interface GrowlBezelWindowView : GrowlNotificationView { NSImage *icon; NSString...
// // GrowlBezelWindowView.h // Display Plugins // // Created by Jorge Salvador Caffarena on 09/09/04. // Copyright 2004 Jorge Salvador Caffarena. All rights reserved. // #import <Cocoa/Cocoa.h> #import "GrowlNotificationView.h" @interface GrowlBezelWindowView : GrowlNotificationView { NSImage *icon; NSString...
Add more functions for bit manipulation
#pragma once #include <cstdint> inline uint16_t compose_bytes(const uint8_t low, const uint8_t high) { return (high << 8) + low; } inline bool check_bit(const uint8_t value, int bit) { return (value & (1 << bit)) != 0; } inline uint8_t set_bit(const uint8_t value, int bit) { return static_cast<uint8_t>(...
#pragma once #include "util/log.h" #include <cstdint> inline uint16_t compose_bytes(const uint8_t low, const uint8_t high) { return (high << 8) + low; } inline bool check_bit(const uint8_t value, const int bit) { return (value & (1 << bit)) != 0; } inline uint8_t set_bit(const uint8_t value, const int bit)...
Fix clang warning about implicit function declaration
#ifndef LEPTONICA__STDIO_H #define LEPTONICA__STDIO_H #ifndef BUILD_HOST #include <stdio.h> #include <stdint.h> typedef struct cookie_io_functions_t { ssize_t (*read)(void *cookie, char *buf, size_t n); ssize_t (*write)(void *cookie, const char *buf, size_t n); int (*seek)(void *cookie, off_t *pos, int when...
#ifndef LEPTONICA__STDIO_H #define LEPTONICA__STDIO_H #ifndef BUILD_HOST #include <stdio.h> #include <stdint.h> typedef struct cookie_io_functions_t { ssize_t (*read)(void *cookie, char *buf, size_t n); ssize_t (*write)(void *cookie, const char *buf, size_t n); int (*seek)(void *cookie, off_t *pos, int when...
Remove unused printf from nap
/** * signal.c * * Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com> */ #include "signals.h" /** * Run cleanup on SIGHUP or SIGINT. */ void on_signal (int signal) { switch (signal) { case SIGHUP: printf("Caught SIGHUP, hanging up...\n"); break; case SIGINT: printf("Caught SIGINT, terminati...
/** * signal.c * * Copyright (C) 2017 Nickolas Burr <nickolasburr@gmail.com> */ #include "signals.h" /** * Run cleanup on SIGHUP or SIGINT. */ void on_signal (int signal) { switch (signal) { case SIGHUP: printf("Caught SIGHUP, hanging up...\n"); break; case SIGINT: printf("Caught SIGINT, terminati...
Revert "Silence some unreachable code warnings on MSVC"
#ifndef ALEXCPT_H #define ALEXCPT_H #include <exception> #include <string> #include "AL/alc.h" #ifdef __GNUC__ #define ALEXCPT_FORMAT(x, y, z) __attribute__((format(x, (y), (z)))) #else #define ALEXCPT_FORMAT(x, y, z) #endif namespace al { class backend_exception final : public std::exception { std::string m...
#ifndef ALEXCPT_H #define ALEXCPT_H #include <exception> #include <string> #include "AL/alc.h" #ifdef __GNUC__ #define ALEXCPT_FORMAT(x, y, z) __attribute__((format(x, (y), (z)))) #else #define ALEXCPT_FORMAT(x, y, z) #endif namespace al { class backend_exception final : public std::exception { std::string m...
Add Task 02 for Homework 01
#include <stdio.h> #include <string.h> #define MAX_WORDS 3000 #define STOPPER "vsmisal" struct occurance_t { long hash; unsigned int count; }; long hash(char*); int index_of(char*, struct occurance_t*, int); int main() { int i = 0, temp; char word[200]; struct occurance_t most_common = { 0,...
Align macro definitions using spaces instead of tabs
// // BoxLog.h // BoxSDK // // Created on 2/21/13. // Copyright (c) 2013 Box. All rights reserved. // #ifndef BoxSDK_BoxLog_h #define BoxSDK_BoxLog_h #ifdef DEBUG #define BOXLogFunction() NSLog(@"%s", __FUNCTION__) #define BOXLog(...) NSLog(@"%s: %@", __FUNCTION__, [NSString stringWithFormat:__VA_ARGS__]) #el...
// // BoxLog.h // BoxSDK // // Created on 2/21/13. // Copyright (c) 2013 Box. All rights reserved. // #ifndef BoxSDK_BoxLog_h #define BoxSDK_BoxLog_h #ifdef DEBUG #define BOXLogFunction() NSLog(@"%s", __FUNCTION__) #define BOXLog(...) NSLog(@"%s: %@", __FUNCTION__, [NSString stringWithFormat:__...
Allow test app to recieve as many file inputs as possible. On branch master Your branch is up-to-date with 'github/master'.
/*! @file main.c @brief A simple test program for the C library code. */ #include "stdio.h" #include "verilog_parser.h" int main(int argc, char ** argv) { if(argc != 2) { printf("ERROR. Please supply exactly one file path argument.\n"); return 1; } else { // Load the file....
/*! @file main.c @brief A simple test program for the C library code. */ #include "stdio.h" #include "verilog_parser.h" int main(int argc, char ** argv) { if(argc < 2) { printf("ERROR. Please supply at least one file path argument.\n"); return 1; } else { int F = 0; ...
Rename HEADER_H_ marco -> PROT_H_
#ifndef HEADER_H_ #define HEADER_H_ #include <stdint.h> #include <stddef.h> // * Header * // // | 1 byte | // | 2 bytes ....... | // | 4 bytes ......................... | // // |--------|--------|--------|--------| // | Flags |Version |Padding | // |--------|--------|--------|--------| // | Frame size (incl...
#ifndef PROT_H_ #define PROT_H_ #include <stdint.h> #include <stddef.h> // * Header * // // | 1 byte | // | 2 bytes ....... | // | 4 bytes ......................... | // // |--------|--------|--------|--------| // | Flags |Version |Padding | // |--------|--------|--------|--------| // | Frame size (incl hea...
Add battery-backed RAM constants for npcx
/* Copyright 2021 The Chromium OS 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 ZEPHYR_SHIM_INCLUDE_BBRAM_H_ #define ZEPHYR_SHIM_INCLUDE_BBRAM_H_ /** * Layout of the battery-backed RAM region. * TODO (b:178807203) Mi...
Change reference from removed canvas::texture
#ifndef _SPRITE_H_ #define _SPRITE_H_ #include <memory> namespace canvas { class Texture; }; #include <glm/glm.hpp> class Sprite { public: Sprite(); virtual ~Sprite(); const std::shared_ptr<canvas::Texture> & getTexture() const { return texture; } void setTexture(const std::shared_ptr<canvas::Texture>...
#ifndef _SPRITE_H_ #define _SPRITE_H_ #include <memory> #include <Texture.h> #include <glm/glm.hpp> class Sprite { public: Sprite(); virtual ~Sprite(); const std::shared_ptr<Texture> & getTexture() const { return texture; } void setTexture(const std::shared_ptr<Texture> & _texture) { texture = _texture; ...
Add missing export specification for TextProgressBarCommand
/*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * h...
/*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * h...
Fix MPLY-8362: check watermark building id case insensitively.
// Copyright eeGeo Ltd (2012-2015), All Rights Reserved #pragma once #include "IWatermarkDataRepository.h" #include "Watermark.h" #include <map> #include <string> namespace ExampleApp { namespace Watermark { namespace View { class WatermarkDataRepository : public IWatermarkDataRe...
// Copyright eeGeo Ltd (2012-2015), All Rights Reserved #pragma once #include "IWatermarkDataRepository.h" #include "Watermark.h" #include <map> #include <string> namespace ExampleApp { namespace Watermark { namespace View { class WatermarkDataRepository : public IWatermarkDataRe...
Change session length to 3 minutes
/* * Copyright 2016 Adam Chyła, adam@chyla.org * All rights reserved. Distributed under the terms of the MIT License. */ #ifndef SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H #define SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H namespace apache { namespace analyzer { namespace detail { constexpr int SESSION_LENGTH...
/* * Copyright 2016 Adam Chyła, adam@chyla.org * All rights reserved. Distributed under the terms of the MIT License. */ #ifndef SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H #define SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H namespace apache { namespace analyzer { namespace detail { constexpr int SESSION_LENGTH...
Add Json schema error parse errors.
char *get_id(void)
#ifndef AINOD_METHODS_H #define AINOD_METHODS_H /** Invalid JSON was received by the server. **/ #define JSON_SCHEMA_ERROR_PARSE_ERROR -32700 /** The JSON sent is not a valid Request object. */ #define JSON_SCHEMA_ERROR_INVALID_REQUEST -32600 /** The method does not exist / is not available. **/ #define JSON_SCHEMA...
Add note about the order of archives returned by the archive manager.
// // RXArchiveManager.h // rivenx // // Created by Jean-Francois Roy on 02/02/2008. // Copyright 2005-2010 MacStorm. All rights reserved. // #import "Base/RXBase.h" #import <MHKKit/MHKKit.h> @interface RXArchiveManager : NSObject { NSString* patches_directory; MHKArchive* extras_archive; } + (RXArchive...
// // RXArchiveManager.h // rivenx // // Created by Jean-Francois Roy on 02/02/2008. // Copyright 2005-2010 MacStorm. All rights reserved. // #import "Base/RXBase.h" #import <MHKKit/MHKKit.h> @interface RXArchiveManager : NSObject { NSString* patches_directory; MHKArchive* extras_archive; } + (RXArchive...
Add nullability specifiers to type selector
// // CSSTypeSelector.h // HTMLKit // // Created by Iska on 13/05/15. // Copyright (c) 2015 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> #import "CSSSelector.h" #import "CSSSimpleSelector.h" @interface CSSTypeSelector : CSSSelector <CSSSimpleSelector> @property (nonatomic, copy) NSStrin...
// // CSSTypeSelector.h // HTMLKit // // Created by Iska on 13/05/15. // Copyright (c) 2015 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> #import "CSSSelector.h" #import "CSSSimpleSelector.h" @interface CSSTypeSelector : CSSSelector <CSSSimpleSelector> @property (nonatomic, copy) NSStrin...
Fix a couple of header issues.
#ifndef ANIMATION_H #define ANIMATION_H #include <vector> #include "Blittable.h" namespace hm { class Animation { public: Animation(); ~Animation(); void add(const Blittable& b); void remove(const Blittable& b); void removeAll(); virtual void animate() = 0; protected: std::vector<Blitta...
#ifndef ANIMATION_H #define ANIMATION_H #include <vector> #include "Blittable.h" #include "Logger.h" namespace hm { class Animation { public: Animation(); ~Animation(); void add(Blittable& b); void remove(Blittable& b); void removeAll(); virtual void animate() = 0; protected: std::vecto...
Convert data source adress type to void *
#ifndef FLASH_WRITER_H #define FLASH_WRITER_H #include <stdint.h> #include <stddef.h> #ifdef __cplusplus extern "C" { #endif /** Unlocks the flash for programming. */ void flash_writer_unlock(void); /** Locks the flash */ void flash_writer_lock(void); /** Erases the flash page at given address. */ void flash_write...
#ifndef FLASH_WRITER_H #define FLASH_WRITER_H #include <stdint.h> #include <stddef.h> #ifdef __cplusplus extern "C" { #endif /** Unlocks the flash for programming. */ void flash_writer_unlock(void); /** Locks the flash */ void flash_writer_lock(void); /** Erases the flash page at given address. */ void flash_write...
Fix include guard to match the current filename.
// Copyright 2018 Google 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 applicable law or agreed to in ...
// Copyright 2018 Google 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 applicable law or agreed to in ...
Add a small comment to tell what this is.
/* chardata.h * * */ #ifndef XML_CHARDATA_H #define XML_CHARDATA_H 1 #ifndef XML_VERSION #include "expat.h" /* need XML_Char */ #endif typedef struct { int count; /* # of chars, < 0 if not set */ XML_Char data[1024]; } CharData; void CharData_Init(CharData...
/* chardata.h Interface to some helper routines used to accumulate and check text and attribute content. */ #ifndef XML_CHARDATA_H #define XML_CHARDATA_H 1 #ifndef XML_VERSION #include "expat.h" /* need XML_Char */ #endif typedef struct { int count; /* # of c...
Add init DIF for EDN
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 #include "sw/device/lib/dif/dif_edn.h" #include "edn_regs.h" // Generated
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 #include "sw/device/lib/dif/dif_edn.h" #include "edn_regs.h" // Generated dif_result_t dif_edn_init(mmio_region_t base_addr, dif_edn_t *edn) { if (edn == NULL) { ...
Use new API in optional tests
#include "test_parser_p.h" void optional_some(void **state) { grammar_t *grammar = grammar_init( non_terminal("Option"), rule_init( "Option", optional( terminal("opt") ) ), 1 ); parse_t *result = parse("opt", grammar); assert_non_null(result); assert_int_equal(result->l...
#include "test_parser_p.h" void optional_some(void **state) { grammar_t *grammar = grammar_init( non_terminal("Option"), rule_init( "Option", optional( terminal("opt") ) ), 1 ); parse_result_t *result = parse("opt", grammar); assert_non_null(result); assert_true(is_succ...
Fix a minor bug in test
#include <stdint.h> #include <stdio.h> #include <stdlib.h> int __llvm_profile_runtime = 0; uint64_t __llvm_profile_get_size_for_buffer(void); int __llvm_profile_write_buffer(char *); void __llvm_profile_reset_counters(void); int __llvm_profile_check_compatibility(const char *, uint64_t); int gg = 0; void bar(char c) ...
#include <stdint.h> #include <stdio.h> #include <stdlib.h> int __llvm_profile_runtime = 0; uint64_t __llvm_profile_get_size_for_buffer(void); int __llvm_profile_write_buffer(char *); void __llvm_profile_reset_counters(void); int __llvm_profile_check_compatibility(const char *, uint64_t); int gg = 0; void bar(char c) ...
Add ability to specify CO2 emissions (dic_int1=4)
C $Header: /u/gcmpack/MITgcm/pkg/dic/DIC_ATMOS.h,v 1.4 2010/04/11 20:59:27 jmc Exp $ C $Name: $ COMMON /INTERACT_ATMOS_NEEDS/ & co2atmos, & total_atmos_carbon, total_ocean_carbon, & total_atmos_carbon_year, & total_ocean_carbon_year, ...
C $Header: /u/gcmpack/MITgcm/pkg/dic/DIC_ATMOS.h,v 1.4 2010/04/11 20:59:27 jmc Exp $ C $Name: $ COMMON /INTERACT_ATMOS_NEEDS/ & co2atmos, & total_atmos_carbon, total_ocean_carbon, & total_atmos_carbon_year, & total_ocean_carbon_year, ...
Add a test for the wrapped interval domain
// RUN: %crabllvm -O0 --crab-dom=w-int --crab-check=assert "%s" 2>&1 | OutputCheck %s // CHECK: ^1 Number of total safe checks$ // CHECK: ^0 Number of total error checks$ // CHECK: ^0 Number of total warning checks$ extern int nd(void); extern void process(char); extern void __CRAB_assert(int); int main() { char...
Add missed on_comparison_state_set() function to ComputerListenerMock
#pragma once #include <mix/computer_listener.h> #include <gmock/gmock.h> struct ComputerListenerMock : public mix::IComputerListener { MOCK_METHOD1(on_memory_set, void (int)); MOCK_METHOD0(on_ra_set, void ()); MOCK_METHOD0(on_rx_set, void ()); MOCK_METHOD1(on_ri_set, void (std::size_t)); MOCK_METHOD...
#pragma once #include <mix/computer_listener.h> #include <gmock/gmock.h> struct ComputerListenerMock : public mix::IComputerListener { MOCK_METHOD1(on_memory_set, void (int)); MOCK_METHOD0(on_ra_set, void ()); MOCK_METHOD0(on_rx_set, void ()); MOCK_METHOD1(on_ri_set, void (std::size_t)); MOCK_METHOD...
Make compression the default on writing.
//===-- llvm/Bytecode/Writer.h - Writer for VM bytecode files ---*- 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. // //===--------...
//===-- llvm/Bytecode/Writer.h - Writer for VM bytecode files ---*- 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. // //===--------...
Fix another broken sol include
#pragma once #include "3rdparty/sol2/sol/forward.hpp" namespace augs { template <class Archive, class Serialized> void write_lua(Archive&, const Serialized& from); template <class Archive, class Serialized> void read_lua(const Archive&, Serialized& into); template <class Archive, class Serialized> void write_l...
#pragma once #include <sol/forward.hpp> namespace augs { template <class Archive, class Serialized> void write_lua(Archive&, const Serialized& from); template <class Archive, class Serialized> void read_lua(const Archive&, Serialized& into); template <class Archive, class Serialized> void write_lua_no_overload...
Make legacy header reference old code.
#ifndef PYPOC_H #define PYPOC_H #include <Windows.h> #include "EmoStateDLL.h" #include "edk.h" #include "edkErrorCode.h" class EPOC { private: EmoEngineEventHandle eEvent; EmoStateHandle eState; DataHandle hData; int nChannels; EE_DataChannel_t *channels; unsigned int userId; double *samples; BOOL ready; BOO...
#ifndef PYPOC_H #define PYPOC_H #include <Windows.h> #include "EmoStateDLL.hpp" #include "edk.hpp" #include "edkErrorCode.hpp" class EPOC { private: EmoEngineEventHandle eEvent; EmoStateHandle eState; DataHandle hData; int nChannels; EE_DataChannel_t *channels; unsigned int userId; double *samples; BOOL ready...
Add header for FrameController to pch
#include <Ogre.h> #include <OgreMeshFileFormat.h> #include <OgreOptimisedUtil.h> #ifdef WIN32 #include <OgreD3D9RenderSystem.h> #include <OgreD3D9HLSLProgram.h> #endif #include <OgreGLRenderSystem.h> #include <OgreGLGpuProgram.h> #include <OgreGLSLGpuProgram.h> #include <OgreGLSLLinkProgramManager.h> #include <OgreG...
#include <Ogre.h> #include <OgreMeshFileFormat.h> #include <OgreOptimisedUtil.h> #include <OgrePredefinedControllers.h> #ifdef WIN32 #include <OgreD3D9RenderSystem.h> #include <OgreD3D9HLSLProgram.h> #endif #include <OgreGLRenderSystem.h> #include <OgreGLGpuProgram.h> #include <OgreGLSLGpuProgram.h> #include <OgreGLS...
Read from STDIN when no filename is given
#include <sys/types.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <fcntl.h> /* a re-implementation of cat(1), to learn the basic Unix syscalls. by tlehman at 1383415046 */ void usage(const char *progname) { printf("%s filename\n", progname); exit(EXIT_FAILURE); } void print_file_c...
#include <sys/types.h> #include <sys/select.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <fcntl.h> /* a re-implementation of cat(1), to learn the basic Unix syscalls. by tlehman at 1383415046 */ void usage(const char *progname) { printf("%s filename\n", progname); exit(EXIT_FAILUR...
Remove unnecessary include in spellcheck word trimmer
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_SPELLCHECKER_WORD_TRIMMER_H_ #define CHROME_BROWSER_SPELLCHECKER_WORD_TRIMMER_H_ #include "base/i18n/base_i18n_export.h" #incl...
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_SPELLCHECKER_WORD_TRIMMER_H_ #define CHROME_BROWSER_SPELLCHECKER_WORD_TRIMMER_H_ #include "base/string16.h" // Trims |text| t...
Update driver version to 5.02.00-k20
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2010 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k19"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2010 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k20"
Test parsing __attribute__ after a struct definition
// RUN: %ucc -fsyntax-only %s struct A { char i, j; } __attribute((aligned(8))); struct A a; _Static_assert(_Alignof(a) == 8, "misaligned/attr not picked up");
Fix VLA stack alignment test / path
// RUN: %ucc -o %t %s vla/check_align_asm.s // RUN: %t extern void check_align() __asm("check_align"); a() { int i = 1; short c[i]; c[0] = 0; check_align(c, i); } b() { int i = 3; char c[i]; c[0] = 0; c[1] = 0; c[2] = 0; check_align(c, i); } main() { a(); b(); return 0; }
// RUN: %ucc -o %t %s "$(dirname %s)"/check_align_asm.s // RUN: %t extern void check_align() __asm("check_align"); a() { int i = 1; short c[i]; c[0] = 0; check_align(c, i); } b() { int i = 3; char c[i]; c[0] = 0; c[1] = 0; c[2] = 0; check_align(c, i); } main() { a(); b(); return 0; }
Add code to read opcodes from file :P
#include "vm.h" int* read_from_file(FILE* file) { int *instructions, idx = 0, count = 0; while (fgetc(file) != EOF) count++; rewind(file); instructions = malloc(count * sizeof(int)); for (idx=0; idx < count; idx++) { instructions[idx] = fgetc(file); } return instructions; } i...
Add extra assert to 36/13
// PARAM: --sets ana.activated[+] octApron #include <pthread.h> #include <assert.h> int g = 1; int h = 1; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int x; // rand pthread_mutex_lock(&A); g = x; h = x; assert(g == h); pthread_mutex_unlock(&A); pthread_mutex_lock(&A); pthre...
// PARAM: --sets ana.activated[+] octApron #include <pthread.h> #include <assert.h> int g = 1; int h = 1; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int x; // rand pthread_mutex_lock(&A); g = x; h = x; assert(g == h); pthread_mutex_unlock(&A); pthread_mutex_lock(&A); pthre...
Add a simple voltage encode/decode c code
#include <stdio.h> #include <stdint.h> static inline uint8_t rev8(uint8_t d) { int i; uint8_t out = 0; /* (from left to right) */ for (i = 0; i < 8; i++) if (d & (1 << i)) out |= (1 << (7 - i)); return out; } /* http://www.onsemi.com/pub_link/Collateral/ADP3208D.PDF */ static...
Add BSD 3-clause open source header
/* * node.h - type definition for node in a table */ #ifndef _NODE_H_ #define _NODE_H_ #include "table.h" #include "timestamp.h" typedef struct node { struct node *next; /* link to next node in the table */ struct node *prev; /* link to previous node in the table */ struct node *younger; /* link to ne...
/* * Copyright (c) 2013, Court of the University of Glasgow * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * thi...
Add check for empty matrix in constructor.
//----------------------------------------------------------------------------- // Constructors //----------------------------------------------------------------------------- template<class T> matrix<T>::matrix():data_(),rows_(0),cols_(0){} template<class T> matrix<T>::matrix( std::size_t rows, std::size_t cols ): ...
//----------------------------------------------------------------------------- // Constructors //----------------------------------------------------------------------------- template<class T> matrix<T>::matrix(): data_(), rows_(0), cols_(0) {} template<class T> matrix<T>::matrix( std::size_t rows, std::...
Define x86 CPU state structure
#ifndef CPU_STATE_H #define CPU_STATE_H struct cpu_state { // Pushed by pusha uint32_t edi, esi, ebp, esp, ebx, edx, ecx, eax; uint32_t eip, cs, eflags, useresp, ss; }; #endif
Fix compile for debug on Android
// // Created by Dawid Drozd aka Gelldur on 03.02.16. // #pragma once #include <android/log.h> #ifdef DEBUG #define DLOG(...) __android_log_print(ANDROID_LOG_DEBUG,"JNI",__VA_ARGS__) #define ILOG(...) __android_log_print(ANDROID_LOG_INFO,"JNI",__VA_ARGS__) #define WLOG(...) __android_log_print(ANDROID_LOG_WAR...
// // Created by Dawid Drozd aka Gelldur on 03.02.16. // #pragma once #include <android/log.h> #ifndef NDEBUG #define DLOG(...) __android_log_print(ANDROID_LOG_DEBUG,"JNI",__VA_ARGS__) #define ILOG(...) __android_log_print(ANDROID_LOG_INFO,"JNI",__VA_ARGS__) #define WLOG(...) __android_log_print(ANDROID_LOG_W...
Add battery info kernel module.
#include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/power_supply.h> static int __init battery_status_init(void) { char name[] = "BAT0"; int result = 0; struct power_supply *psy = power_supply_get_by_name(name); union power_supply_propval chargenow, chargefull; result = psy-...
Fix module loc. Add missing final newline.
// @(#)root/thread:$Id$ // Author: Philippe Canal 09/30/2011 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
// @(#)root/base:$Id$ // Author: Philippe Canal 09/30/2011 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
Fix module loc. Add missing final newline.
// @(#)root/thread:$Id$ // Author: Philippe Canal 09/30/2011 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
// @(#)root/base:$Id$ // Author: Philippe Canal 09/30/2011 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
Change to config file struct
#ifndef CONFIGREADER_H #define CONFIGREADER_H /*forward declarations*/ extern FILE *configreaderin; struct config_ssid { char ssid_name[32]; char ssid_user[32]; char ssid_pass[32]; char ssid_bssid[25]; int ssid_8021x; struct config_ssid *next; }; struct config_interfaces { char if_name[32...
#ifndef CONFIGREADER_H #define CONFIGREADER_H /*forward declarations*/ extern FILE *configreaderin; struct config_ssid { char ssid_name[32]; char ssid_user[32]; char ssid_pass[32]; char ssid_bssid[20]; char ssid_auth[10]; struct config_ssid *next; }; struct config_interfaces { char if_nam...
Add test for surprising imprecision with ctx_insens base
// PARAM: --set ana.ctx_insens[+] base #include <stdlib.h> #include <assert.h> void foo(int cond) { assert(cond); // TODO to match assert } int main() { int *p = malloc(sizeof(int)); // blob is initially Bot while (1) { // blob joins Bot and 42 -> 42 // TODO: both should actually be UNKNOWN! to be sound ...
Update popt, and always use the gnome-libs version instead of any system
#ifndef __GNOME_POPT_H__ #define __GNOME_POPT_H__ 1 #include <popt.h> #include "gnome-defs.h" BEGIN_GNOME_DECLS void gnomelib_register_popt_table(const struct poptOption *options, const char *description); poptContext gnomelib_parse_args(int argc, char *argv[], int popt_flags); /* Some systems, like Red H...
#ifndef __GNOME_POPT_H__ #define __GNOME_POPT_H__ 1 #include <popt-gnome.h> #include "gnome-defs.h" BEGIN_GNOME_DECLS void gnomelib_register_popt_table(const struct poptOption *options, const char *description); poptContext gnomelib_parse_args(int argc, char *argv[], int popt_flags); /* Some systems, like...
Include GLFW/gl3w and add base graphics context
//// // __| | | _ _| __ / __| \ | // \__ \ __ | | / _| . | // ____/ _| _| ___| ____| ___| _|\_| // // Copyright (c) 2016 Jacob Hauberg Hansen // // This library is free software; you can redistribute and modify it // under the terms of the MIT license. See LICENSE for details. // #ifndef interna...
Add newline to end of file.
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_ #define VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_ namespace views { namespace interna...
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_ #define VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_ namespace views { namespace interna...
Enable ubluepy central by default if running nrf52/s132 bluetooth stack. Maturity of the module is pretty OK now.
#ifndef BLUETOOTH_CONF_H__ #define BLUETOOTH_CONF_H__ // SD specific configurations. #if (BLUETOOTH_SD == 110) #define MICROPY_PY_BLE (1) #define MICROPY_PY_BLE_NUS (0) #define BLUETOOTH_WEBBLUETOOTH_REPL (0) #define MICROPY_PY_UBLUEPY (1) #define MICROPY_PY_UBLUEPY_PER...
#ifndef BLUETOOTH_CONF_H__ #define BLUETOOTH_CONF_H__ // SD specific configurations. #if (BLUETOOTH_SD == 110) #define MICROPY_PY_BLE (1) #define MICROPY_PY_BLE_NUS (0) #define BLUETOOTH_WEBBLUETOOTH_REPL (0) #define MICROPY_PY_UBLUEPY (1) #define MICROPY_PY_UBLUEPY_PER...
Update the driver version to 8.05.00.03-k.
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.04.00.13-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 4 #define QLA_DRIVER_PATCH_VER 0 #defi...
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.05.00.03-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 5 #define QLA_DRIVER_PATCH_VER 0 #defi...
Fix host building in Linux (part 2/x).
// // Aspia Project // Copyright (C) 2016-2022 Dmitry Chapyshev <dmitry@aspia.ru> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) an...
// // Aspia Project // Copyright (C) 2016-2022 Dmitry Chapyshev <dmitry@aspia.ru> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) an...
Fix keyboard.isDown check for multiple keys
/** * Copyright (c) 2017 rxi * * This library is free software; you can redistribute it and/or modify it * under the terms of the MIT license. See LICENSE for details. */ #include "keyboard.h" #include "luaobj.h" int l_keyboard_setKeyRepeat(lua_State *L) { keyboard_setKeyRepeat( lua_toboolean(L, 1) ); retu...
/** * Copyright (c) 2017 rxi * * This library is free software; you can redistribute it and/or modify it * under the terms of the MIT license. See LICENSE for details. */ #include "keyboard.h" #include "luaobj.h" int l_keyboard_setKeyRepeat(lua_State *L) { keyboard_setKeyRepeat( lua_toboolean(L, 1) ); retu...
Add font name to context.
// // Copyright (c) 2013 Carson McDonald // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated // documentation files (the "Software"), to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publis...
// // Copyright (c) 2013 Carson McDonald // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated // documentation files (the "Software"), to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publis...
Fix STARTS_WITH macro comparing 1 less character than needed
#ifndef UTIL_H #define UTIL_H /*** Utility functions ***/ #define ALLOC(type) ((type*) xmalloc(sizeof(type))) void *xmalloc(size_t); #define STARTS_WITH(x, y) (strncmp((x), (y), sizeof(y) - 1) == 0) #endif /* UTIL_H */
#ifndef UTIL_H #define UTIL_H /*** Utility functions ***/ #define ALLOC(type) ((type*) xmalloc(sizeof(type))) void *xmalloc(size_t); #define STARTS_WITH(x, y) (strncmp((x), (y), strlen(y)) == 0) #endif /* UTIL_H */
Fix include path typo from merge conflicts
// Copyright 2019 Google 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in...
// Copyright 2019 Google 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in...
Add missing file from r286566
//===-- llvm/Bitcode/BitcodeWriter.h - Bitcode writers ----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------------...
Add missing file from r128851.
//===-- MCJITMemoryManager.h - Definition for the Memory Manager ---C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Fix definition for bitrate tracer type
/* GstShark - A Front End for GstTracer * Copyright (C) 2016-2017 RidgeRun Engineering <michael.gruner@ridgerun.com> * * This file is part of GstShark. * * 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...
/* GstShark - A Front End for GstTracer * Copyright (C) 2016-2017 RidgeRun Engineering <michael.gruner@ridgerun.com> * * This file is part of GstShark. * * 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...
Fix screwup in changing copyright notices
#ifdef XML_UNICODE #ifndef XML_UNICODE_WCHAR_T #error xmlwf requires a 16-bit Unicode-compatible wchar_t #endif #define T(x) L ## x #define ftprintf fwprintf #define tfopen _wfopen #define fputts fputws #define puttc putwc #define tcscmp wcscmp #define tcscpy wcscpy #define tcscat wcscat #define tcschr wcschr #define ...
Add a missing taint tester warning.
// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.security.taint,debug.TaintTest -verify %s int scanf(const char *restrict format, ...); int getchar(void); #define BUFSIZE 10 int Buffer[BUFSIZE]; void bufferScanfAssignment(int x) { int n; int *addr = &Buffer[0]; scanf("%d", &n); addr += n;// expect...
// RUN: %clang_cc1 -analyze -analyzer-checker=experimental.security.taint,debug.TaintTest -verify %s int scanf(const char *restrict format, ...); int getchar(void); #define BUFSIZE 10 int Buffer[BUFSIZE]; void bufferScanfAssignment(int x) { int n; int *addr = &Buffer[0]; scanf("%d", &n); addr += n;// expect...
Make the clang-cl test less restrictive.
// Note: %s must be preceded by --, otherwise it may be interpreted as a // command-line option, e.g. on Mac where %s is commonly under /Users. // RUN: %clang_cl -### -- %s 2>&1 | FileCheck %s --check-prefix=BUILTIN // BUILTIN: "-internal-isystem" "{{.*lib.*clang.*[0-9]\.[0-9].*include}}" // RUN: %clang_cl -nobuiltin...
// Note: %s must be preceded by --, otherwise it may be interpreted as a // command-line option, e.g. on Mac where %s is commonly under /Users. // RUN: %clang_cl -### -- %s 2>&1 | FileCheck %s --check-prefix=BUILTIN // BUILTIN: "-internal-isystem" "{{.*lib.*clang.*include}}" // RUN: %clang_cl -nobuiltininc -### -- %s...
Fix build break from bad merge
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Multiply-included file, hence no include guard. // Inclusion of all message files present in the system. Keep this file // up-to-date when adding ...
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Multiply-included file, hence no include guard. // Inclusion of all message files present in the system. Keep this file // up-to-date when adding ...
Make Body an opaque typedef of std::string
#ifndef CPR_BODY_H #define CPR_BODY_H #include <string> #include "defines.h" namespace cpr { class Body { public: template <typename TextType> Body(TextType&& p_text) : text{CPR_FWD(p_text)} {} std::string text; }; } // namespace cpr #endif
#ifndef CPR_BODY_H #define CPR_BODY_H #include <string> #include "defines.h" namespace cpr { class Body : public std::string { public: Body() = default; Body(const Body& rhs) = default; Body(Body&& rhs) = default; Body& operator=(const Body& rhs) = default; Body& operator=(Body&& rhs) = defaul...
Add calcFitted and calcResid definitions.
int wls(double* X, int n, int p, double* y, double* w, double* XTX, double *sqw, double* sqwX, double* sqwy, double* coef);
int wls(double* X, int n, int p, double* y, double* w, double* XTX, double *sqw, double* sqwX, double* sqwy, double* coef); int calcFitted(double* X, int n, int p, double* y, double* coef, double* fitted); int calcResid(double* X, int n, int p, double* y, double* coef, double* resid);...
Add test case for mingw -fuse-ld= support introduced in r242121.
// RUN: %clang -### -target i686-pc-windows-gnu --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_LD_32 %s // CHECK_LD_32: {{ld|ld.exe}}" // CHECK_LD_32: "i386pe" // CHECK_LD_32_NOT: "-flavor" "gnu" // RUN: %clang -### -target i686-pc-windows-gnu --sysroot=%S/Inputs/mingw_clang_tree/...
Add comments to confusing test
// PARAM: --enable ana.int.congruence void unsignedCase() { unsigned int top; unsigned int i = 0; if(top % 17 == 3) { assert(top%17 ==3); if(top %17 != 3) { i = 12; } else { } } assert(i ==0); if(top % 17 == 0) { assert(top%17 == 0); ...
// PARAM: --enable ana.int.congruence void unsignedCase() { unsigned int top; unsigned int i = 0; if(top % 17 == 3) { assert(top%17 ==3); if(top %17 != 3) { i = 12; } else { } } assert(i ==0); if(top % 17 == 0) { assert(top%17 == 0); ...
Fix build error when importing debug controller header
/* * 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...
Use static_cast in void* casting
// // Created by dar on 12/22/15. // #ifndef C003_CONTACTFILTER_H #define C003_CONTACTFILTER_H #include <Box2D/Dynamics/b2WorldCallbacks.h> #include <Box2D/Dynamics/b2Fixture.h> #include "../map/entity/Entity.h" class ContactFilter : public b2ContactFilter { bool doesCollide(void *a, void *b) { bool col...
// // Created by dar on 12/22/15. // #ifndef C003_CONTACTFILTER_H #define C003_CONTACTFILTER_H #include <Box2D/Dynamics/b2WorldCallbacks.h> #include <Box2D/Dynamics/b2Fixture.h> #include "../map/entity/Entity.h" class ContactFilter : public b2ContactFilter { bool doesCollide(void *a, void *b) { bool col...
Update docs on cdz_availableString NSFileHandle category method
// // NSFileHandle+CDZCLIStringReading.h // CDZCLIApplication // // Created by Chris Dzombak on 1/13/14. // Copyright (c) 2014 Chris Dzombak. All rights reserved. // @import Foundation; @interface NSFileHandle (CDZCLIStringReading) /// Read this handle's `-availableData` as a string, stripping any trailing newli...
// // NSFileHandle+CDZCLIStringReading.h // CDZCLIApplication // // Created by Chris Dzombak on 1/13/14. // Copyright (c) 2014 Chris Dzombak. All rights reserved. // @import Foundation; @interface NSFileHandle (CDZCLIStringReading) /// Read this handle's `-availableData` as a string, stripping a single trailing ...
Increase stack array size from 48 to 64
#ifndef BUFFER_H_ #define BUFFER_H_ #define BUFFER_SIZEOF_DESIRED 48 typedef struct Buffer { unsigned int pos; unsigned int size; char* data; char fixed[BUFFER_SIZEOF_DESIRED - 2*sizeof(unsigned int) - 1*sizeof(char*)]; } Buffer; Buffer* buffer_init(Buffer* buffer, unsigned int size); Buffer* buffer_...
#ifndef BUFFER_H_ #define BUFFER_H_ #define BUFFER_SIZEOF_DESIRED 64 typedef struct Buffer { unsigned int pos; unsigned int size; char* data; char fixed[BUFFER_SIZEOF_DESIRED - 2*sizeof(unsigned int) - 1*sizeof(char*)]; } Buffer; Buffer* buffer_init(Buffer* buffer, unsigned int size); Buffer* buffer_...
Add instance variables, remove callbacks
#pragma once #define WIN32_LEAN_AND_MEAN #include <Windows.h> #include <malloc.h> #include <memory.h> #include <prsht.h> #include <stdlib.h> #include <tchar.h> #include "../3RVX/3RVX.h" #include "resource.h" class SettingsUI : public Window { public: SettingsUI(HINSTANCE hInstance); INT_PTR LaunchProperty...
#pragma once #define WIN32_LEAN_AND_MEAN #include <Windows.h> #include <malloc.h> #include <memory.h> #include <prsht.h> #include <stdlib.h> #include <tchar.h> #include <vector> #include "../3RVX/3RVX.h" #include "resource.h" class About; class Display; class General; class Hotkeys; class OSD; class TabPage; class...
Add compile option for sqlite db upgrades.
/* Uncomment to compile with tcpd/libwrap support. */ //#define WITH_WRAP /* Compile with database upgrading support? If disabled, mosquitto won't * automatically upgrade old database versions. */ //#define WITH_DB_UPGRADE /* Compile with memory tracking support? If disabled, mosquitto won't track * heap memory usa...
/* Uncomment to compile with tcpd/libwrap support. */ //#define WITH_WRAP /* Compile with database upgrading support? If disabled, mosquitto won't * automatically upgrade old database versions. */ //#define WITH_DB_UPGRADE /* Compile with memory tracking support? If disabled, mosquitto won't track * heap memory usa...
Add newline between comments and includes
/** * @file * * @date Nov 12, 2013 * @author: Anton Bondarev */ #include <stddef.h> #include <kernel/task.h> #include <kernel/thread/thread_stack.h> #include <kernel/panic.h> struct task *task_alloc(struct task *task, size_t task_size) { void *addr; assert(task); assert(task->main_thread); addr = thread_sta...
/** * @file * * @date Nov 12, 2013 * @author: Anton Bondarev */ #include <stddef.h> #include <kernel/task.h> #include <kernel/thread/thread_stack.h> #include <kernel/panic.h> struct task *task_alloc(struct task *task, size_t task_size) { void *addr; assert(task); assert(task->main_thread); addr = thread_st...
Update return datatype function 'createRandomPopulation'.
#ifndef POPULATION_H #define POPULATION_H class POPULATION { public: int **initializePopulation(int individuals, int genes, bool FILL_ZERO = false); int **createRandomPopulation(int **population, int individuals, int genes); }; #endif
#ifndef POPULATION_H #define POPULATION_H class POPULATION { public: int **initializePopulation(int individuals, int genes, bool FILL_ZERO = false); int createRandomPopulation(int **population, int individuals, int genes); }; #endif
Add missing DLL export for log::SinkManager
#ifndef SINKMANAGER_H #define SINKMANAGER_H #include <dsnutil/singleton.h> #include <dsnutil/log/base.h> #include <map> #include <string> #include <boost/shared_ptr.hpp> #include <boost/log/sinks.hpp> namespace dsn { namespace log { class SinkManager : public dsn::Singleton<SinkManager>, public Base<SinkManager...
#ifndef SINKMANAGER_H #define SINKMANAGER_H #include <dsnutil/dsnutil_cpp_Export.h> #include <dsnutil/singleton.h> #include <dsnutil/log/base.h> #include <map> #include <string> #include <boost/shared_ptr.hpp> #include <boost/log/sinks.hpp> namespace dsn { namespace log { class dsnutil_cpp_EXPORT SinkManager : ...
Add new functions described in TODO comment
// CommonFunc.h -- header file /* * * Author: septimomend (Ivan Chapkailo) * * 30.06.2017 * */ #pragma once #include "stdafx.h" #include "AllControllers.h" #include "AdditionalBuffer.h" class Common : public AllControllers { public: Common(AllControllers* all); // cstr /* * draws */ void drawRows(A...
// CommonFunc.h -- header file /* * * Author: septimomend (Ivan Chapkailo) * * 30.06.2017 * */ #pragma once #include "stdafx.h" #include "AllControllers.h" #include "AdditionalBuffer.h" class Common : public AllControllers { public: Common(AllControllers* all); // cstr /* * draws */ void drawRows(A...
Remove a lingering ref to mapping.c
/* Include this file in your project * if you don't want to build libmypaint as a separate library * Note that still need to do -I./path/to/libmypaint/sources * for the includes here to succeed. */ #include "mapping.c" #include "helpers.c" #include "brushmodes.c" #include "fifo.c" #include "operationqueue.c" #inclu...
/* Include this file in your project * if you don't want to build libmypaint as a separate library * Note that still need to do -I./path/to/libmypaint/sources * for the includes here to succeed. */ #include "helpers.c" #include "brushmodes.c" #include "fifo.c" #include "operationqueue.c" #include "rng-double.c" #in...
Add test case for out-of-bound memory access checking.
// RUN: clang -checker-simple -analyzer-store-region -verify %s char f1() { char* s = "abcd"; return s[4]; // expected-warning{{Load or store into an out-of-bound memory position.}} }
Create the main program with print the coordinates of the first point of a newly generated polygon
#include <polygon.h> int main(int argc, char* argv[]) { Polygon lol; lol=createPolygon(); printf("\n\nx premier point : %f", lol->value.x); printf("\ny premier point : %f\n\n", lol->value.y); return EXIT_SUCCESS; }
Bump version to 1.13, matching blender 2.90 release cycle
/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
/* * Copyright 2011-2016 Blender Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
Check _MSC_VER is defined and less than 1900
#pragma once #if _MSC_VER < 1900 #define round(x) (x >= 0 ? (x + 0.5) : (x - 0.5)) #endif class WindowFeature { public: WindowFeature(); virtual ~WindowFeature(); virtual void apply(double *windowImage, double *descriptorVector) = 0; unsigned int descriptorLengthPerWindow; };
#pragma once #if defined(_MSC_VER) && _MSC_VER < 1900 #define round(x) (x >= 0 ? (x + 0.5) : (x - 0.5)) #endif class WindowFeature { public: WindowFeature(); virtual ~WindowFeature(); virtual void apply(double *windowImage, double *descriptorVector) = 0; unsigned int descriptorLengthPerWindow; };
Make C example more C, less asm
typedef union { unsigned char* ptr; unsigned short word[2]; } word_extract_t; void PokeBitplanePointers(unsigned short* copper, unsigned char* bitplanes, unsigned offset, unsigned numBitplanes, unsigned screenWidthBytes) { int i; copper += offset; for (i = 0; i < numBitplanes; i++) { word_extract_t ext...
typedef union { unsigned char* ptr; struct { unsigned short hi; unsigned short lo; } words; } word_extract_t; void PokeBitplanePointers(unsigned short* copper, unsigned char* bitplanes, unsigned offset, unsigned numBitplanes, unsigned screenWidthBytes) { int i; copper += offset; for (i = 0; i < n...
Add mfspr/mtspr inline macros to 4xx bootwrapper
#ifndef _PPC_BOOT_REG_H #define _PPC_BOOT_REG_H /* * Copyright 2007 Davud Gibson, IBM Corporation. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (...
#ifndef _PPC_BOOT_REG_H #define _PPC_BOOT_REG_H /* * Copyright 2007 Davud Gibson, IBM Corporation. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (...
Raise keyboard event stack size to 256
#ifndef H_KBD #define H_KBD #include <stddef.h> #include <stdbool.h> struct keyevent { int keycode; char character; bool release; bool shift; bool ctrl; } keybuffer[128]; void kbdinit(); bool kbdavail(); struct keyevent* kbdpoll(); void kbdregsig(bool* b); void kbdunregsig(bool* b); #endif
#ifndef H_KBD #define H_KBD #include <stddef.h> #include <stdbool.h> struct keyevent { int keycode; char character; bool release; bool shift; bool ctrl; } keybuffer[256]; void kbdinit(); bool kbdavail(); struct keyevent* kbdpoll(); void kbdregsig(bool* b); void kbdunregsig(bool* b); #endif
Make it easier to change stty constant if needed
#include <stdio.h> #include <stdlib.h> int main() { system("/bin/stty raw"); int i = 0; char str[] = "I AM AN IDIOT "; while(1){ for(i = 0; i<14; i++) { getchar(); printf("\b%c", str[i]); } system("/bin/stty cooked"); printf("\n"); system("/bin/stty raw"); } return 0; }
#include <stdio.h> #include <stdlib.h> #define STTY "/bin/stty " const char RAW[] = STTY "raw"; const char COOKED[] = STTY "cooked"; int main() { system(RAW); int i = 0; char str[] = "I AM AN IDIOT "; while(1){ for(i = 0; i<14; i++) { getchar(); printf("\b%c", str[i]); } system(COOKE...
Add BSD 3-clause open source header
/* * mb.h - publicly accessible entry points for the memory buffer */ #ifndef _MB_H_ #define _MB_H_ #include "tuple.h" #include "table.h" #include "timestamp.h" void mb_init(); int mb_insert(unsigned char *buf, long len, Table *table); tstamp_t mb_insert_tuple(int ncols, char *vals[], Table *table); tstamp_t hea...
/* * Copyright (c) 2013, Court of the University of Glasgow * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, * thi...
Add some basic test for message handling.
#include <arpa/inet.h> #include <netinet/in.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> #include <unistd.h> int main() { struct sockaddr_in serv_addr; memset(&serv_addr, 0, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = inet_addr("127.0.0.1...
Add BeIDE header required for building
//================================================================== // MTextAddOn.h // Copyright 1996 Metrowerks Corporation, All Rights Reserved. //================================================================== // This is a proxy class used by Editor add_ons. It does not inherit from BView // but provides an ab...
Split up VersionString, will be useful for WebUI
/* * Super Entity Game Server * http://segs.sf.net/ * Copyright (c) 2006 Super Entity Game Server Team (see AUTHORS.md) * This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md for details. * */ #define VersionString "segs v0.5.0 (The Unsilencer)"; #define CopyrightString "Super Entity G...
/* * Super Entity Game Server * http://segs.sf.net/ * Copyright (c) 2006 Super Entity Game Server Team (see AUTHORS.md) * This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md for details. * */ #define ProjectName "SEGS" #define VersionNumber "0.5.0" #define VersionName "The Unsilencer"...
Correct c++ exit status values
#ifndef BIOTOOL_EXIT_STATUS_H #define BIOTOOL_EXIT_STATUS_H typedef enum {Success=0, Error_command_line=1, Error_open_file=2, Error_parse_file=3} exit_status; #endif
#ifndef BIOTOOL_EXIT_STATUS_H #define BIOTOOL_EXIT_STATUS_H typedef enum {Success=0, Error_open_file=1, Error_command_line=2, Error_parse_file=3} exit_status; #endif
Make this test emit llvm IR rather than assembly.
// FIXME: Check IR rather than asm, then triple is not needed. // RUN: %clang_cc1 -mllvm -asm-verbose -triple %itanium_abi_triple -S -O2 -g %s -o - | FileCheck %s // Radar 8122864 // Code is not generated for function foo, but preserve type information of // local variable xyz. static void foo() { // CHECK: DW_TAG_str...
// FIXME: Check IR rather than asm, then triple is not needed. // RUN: %clang_cc1 -triple %itanium_abi_triple -O2 -g -emit-llvm %s -o - | FileCheck %s // Radar 8122864 // Code is not generated for function foo, but preserve type information of // local variable xyz. static void foo() { // CHECK: DW_TAG_structure_type ...
Make the single argument constructor to CompositorOptions explicit
// Copyright 2015 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 SKY_COMPOSITOR_COMPOSITOR_OPTIONS_H_ #define SKY_COMPOSITOR_COMPOSITOR_OPTIONS_H_ #include "base/macros.h" #include <vector> namespace sky { nam...
// Copyright 2015 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 SKY_COMPOSITOR_COMPOSITOR_OPTIONS_H_ #define SKY_COMPOSITOR_COMPOSITOR_OPTIONS_H_ #include "base/macros.h" #include <vector> namespace sky { nam...
Change this so it works. This may be tricky to work through when a lot of modules depend on a lot of other modules.
class AdminHook : public Module { public: virtual ~AdminHook(); virtual std::vector<std::vector<std::string> > adminCommands(); virtual void onAdminCommand(std::string server, std::string nick, std::string command, std::string message, bool dcc, bool master); }; class AdminMod : public Module { public: virtu...
class AdminHook : public Module { public: virtual ~AdminHook(); virtual std::vector<std::vector<std::string> > adminCommands(); virtual void onAdminCommand(std::string server, std::string nick, std::string command, std::string message, bool dcc, bool master); }; class AdminMod { public: virtual ~AdminMod(); ...
Use a bitfield to make the index 2/3 the size, to save some disk churn
#define VT_POINT 1 #define VT_LINE 2 #define VT_POLYGON 3 #define VT_END 0 #define VT_MOVETO 1 #define VT_LINETO 2 #define VT_CLOSEPATH 7 #define VT_STRING 1 #define VT_NUMBER 2 #define VT_BOOLEAN 7 struct pool; void deserialize_int(char **f, int *n); struct pool_val *deserialize_string(char **f, struct pool *p, in...
#define VT_POINT 1 #define VT_LINE 2 #define VT_POLYGON 3 #define VT_END 0 #define VT_MOVETO 1 #define VT_LINETO 2 #define VT_CLOSEPATH 7 #define VT_STRING 1 #define VT_NUMBER 2 #define VT_BOOLEAN 7 struct pool; void deserialize_int(char **f, int *n); struct pool_val *deserialize_string(char **f, struct pool *p, in...
Change headers from *.hpp to *.h, and add LeafBuilder.
#pragma once #include "BehaviorTree.hpp" #include "Blackboard.hpp" #include "Composite.hpp" #include "Decorator.hpp" #include "Leaf.hpp" #include "Node.hpp" // CompositeS #include "Composites/MemSelector.hpp" #include "Composites/MemSequence.hpp" #include "Composites/ParallelSequence.hpp" #include "Composites/Selecto...
#pragma once #include "BehaviorTree.h" #include "Blackboard.h" #include "Composite.h" #include "Decorator.h" #include "Leaf.h" #include "Node.h" // Composites #include "composites/MemSelector.h" #include "composites/MemSequence.h" #include "composites/ParallelSequence.h" #include "composites/Selector.h" #include "com...
Define TSEARCH_INLINE as static inline
// // GNETextSearchPrivate.h // GNETextSearch // // Created by Anthony Drendel on 11/14/15. // Copyright © 2015 Gone East LLC. All rights reserved. // #ifndef GNETextSearchPrivate_h #define GNETextSearchPrivate_h #ifdef __cplusplus extern "C" { #endif #ifndef TSEARCH_INLINE #if defined(_MSC_VER) && !defined(...
// // GNETextSearchPrivate.h // GNETextSearch // // Created by Anthony Drendel on 11/14/15. // Copyright © 2015 Gone East LLC. All rights reserved. // #ifndef GNETextSearchPrivate_h #define GNETextSearchPrivate_h #ifdef __cplusplus extern "C" { #endif #ifndef TSEARCH_INLINE #if defined(_MSC_VER) && !defined(...