Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Update Skia milestone to 100
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 99 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 100 #endif
Tweak a minor alignment issue.
#pragma once #include "helpers.h" #include "nvidia_interface_datatypes.h" #include <vector> #include <memory> class NvidiaGPU; class NVLIB_EXPORTED NvidiaApi { public: NvidiaApi(); ~NvidiaApi(); int getGPUCount(); std::shared_ptr<NvidiaGPU> getGPU(int index); private: bool GPUloaded = false; s...
#pragma once #include "helpers.h" #include "nvidia_interface_datatypes.h" #include <vector> #include <memory> class NvidiaGPU; class NVLIB_EXPORTED NvidiaApi { public: NvidiaApi(); ~NvidiaApi(); int getGPUCount(); std::shared_ptr<NvidiaGPU> getGPU(int index); private: std::vector<std::shared_ptr<N...
Bump portable version to 0.2.6-pre
#define PORTABLE_VERSION_TEXT "0.2.5" #define PORTABLE_VERSION_MAJOR 0 #define PORTABLE_VERSION_MINOR 2 #define PORTABLE_VERSION_PATCH 5 /* 1 or 0 */ #define PORTABLE_VERSION_RELEASED 1
#define PORTABLE_VERSION_TEXT "0.2.6-pre" #define PORTABLE_VERSION_MAJOR 0 #define PORTABLE_VERSION_MINOR 2 #define PORTABLE_VERSION_PATCH 6 /* 1 or 0 */ #define PORTABLE_VERSION_RELEASED 0
Update portable version to unreleased
#define PORTABLE_VERSION_TEXT "0.2.4" #define PORTABLE_VERSION_MAJOR 0 #define PORTABLE_VERSION_MINOR 2 #define PORTABLE_VERSION_PATCH 4 /* 1 or 0 */ #define PORTABLE_VERSION_RELEASED 1
#define PORTABLE_VERSION_TEXT "0.2.5-pre" #define PORTABLE_VERSION_MAJOR 0 #define PORTABLE_VERSION_MINOR 2 #define PORTABLE_VERSION_PATCH 5 /* 1 or 0 */ #define PORTABLE_VERSION_RELEASED 0
Rewrite of odd/even number program for arbitrary number of inputs using switch statement
/* lab4.c: Read integers and print out the sum of all even and odd * numbers separately */ #include <stdio.h> int main() { int num = 0; int even_sum = 0; int odd_sum = 0; do { printf("Enter an integer: "); fflush(stdout); scanf("%d",&num); switch (num % 2) { c...
Handle Ctrl-Z to suspend the process.
#include <stdio.h> #include <stdlib.h> #include <termbox.h> #include "editor.h" #include "util.h" int main(int argc, char *argv[]) { debug_init(); editor_t editor; cursor_t cursor; editor_init(&editor, &cursor, argc > 1 ? argv[1] : NULL); int err = tb_init(); if (err) { fprintf(stderr, "tb_init() f...
#include <stdio.h> #include <stdlib.h> #include <signal.h> #include <termbox.h> #include "editor.h" #include "util.h" // termbox catches ctrl-z as a regular key event. To suspend the process as // normal, manually raise SIGTSTP. // // Not 100% sure why we need to shutdown termbox, but the terminal gets all // weird...
Use low end of supervisor heap
#ifndef MICROPY_INCLUDED_SHARED_MODULE_PROTOMATTER_ALLOCATOR_H #define MICROPY_INCLUDED_SHARED_MODULE_PROTOMATTER_ALLOCATOR_H #include <stdbool.h> #include "py/gc.h" #include "py/misc.h" #include "supervisor/memory.h" #define _PM_ALLOCATOR _PM_allocator_impl #define _PM_FREE(x) (_PM_free_impl((x)), (x)=NULL, (void)0)...
#ifndef MICROPY_INCLUDED_SHARED_MODULE_PROTOMATTER_ALLOCATOR_H #define MICROPY_INCLUDED_SHARED_MODULE_PROTOMATTER_ALLOCATOR_H #include <stdbool.h> #include "py/gc.h" #include "py/misc.h" #include "supervisor/memory.h" #define _PM_ALLOCATOR _PM_allocator_impl #define _PM_FREE(x) (_PM_free_impl((x)), (x)=NULL, (void)0)...
Fix a missed file in previous change.
// -*- C++ -*- #ifndef _writer_verilog_task_h_ #define _writer_verilog_task_h_ #include "writer/verilog/resource.h" namespace iroha { namespace writer { namespace verilog { class Task : public Resource { public: Task(const IResource &res, const Table &table); virtual void BuildResource(); virtual void BuildIns...
// -*- C++ -*- #ifndef _writer_verilog_task_h_ #define _writer_verilog_task_h_ #include "writer/verilog/resource.h" namespace iroha { namespace writer { namespace verilog { class Task : public Resource { public: Task(const IResource &res, const Table &table); virtual void BuildResource(); virtual void BuildIns...
Update GameStateManager to use new base class name
/* The Halfling Project - A Graphics Engine and Projects * * The Halfling Project is the legal property of Adrian Astley * Copyright Adrian Astley 2013 */ #ifndef CRATE_DEMO_GAME_STATE_MANAGER_H #define CRATE_DEMO_GAME_STATE_MANAGER_H #include "common/game_state_manager_interface.h" namespace CrateDemo { class...
/* The Halfling Project - A Graphics Engine and Projects * * The Halfling Project is the legal property of Adrian Astley * Copyright Adrian Astley 2013 */ #ifndef CRATE_DEMO_GAME_STATE_MANAGER_H #define CRATE_DEMO_GAME_STATE_MANAGER_H #include "common/game_state_manager_base.h" namespace CrateDemo { class Game...
Add Fibonacci algorithm in C
#include <stdio.h> int i, v, num1 = 0, num2 = 1, temp; int main() { // Enter here number of times fib number is calculated; scanf("%d", &v); printf("Fibonacci numbers:"); for (i; i <= v; i++) { // This prints fibonacci number; printf("%d, ", num1); // This calculates fibonacci number; temp =...
Make sure that for AIX 3.2 we get ushort defined when we need it, but not doubly defined...
#if defined(__cplusplus) && !defined(OSF1) /* GNU G++ */ # include "fix_gnu_fcntl.h" #elif defined(AIX32) /* AIX bsdcc */ typedef unsigned short ushort; # include <fcntl.h> #elif defined(HPUX9) /* HPUX 9 */ # define fcntl __condor_hide_fcntl # include <fcntl.h> # undef fcntl int fcntl( int fd, int req, int ...
#if defined(__cplusplus) && !defined(OSF1) /* GNU G++ */ # include "fix_gnu_fcntl.h" #elif defined(AIX32) /* AIX bsdcc */ # if !defined(_ALL_SOURCE) typedef ushort_t ushort; # endif # include <fcntl.h> #elif defined(HPUX9) /* HPUX 9 */ # define fcntl __condor_hide_fcntl # include <fcntl.h> # undef fcntl ...
Implement left and right macros
#ifndef TURING_H_ #define TURING_H_ #define TAPE_LEN 1024 #define turing_error(...) fprintf(stderr, __VA_ARGS__);\ return TURING_ERROR typedef int bool; typedef enum { TURING_OK, TURING_HALT, TURING_ERROR } turing_status_t; typedef struct Turing { bool *tape; bool *p; } Turing; Turing *ini...
#ifndef TURING_H_ #define TURING_H_ #define TAPE_LEN 1024 #define turing_error(...) fprintf(stderr, __VA_ARGS__);\ return TURING_ERROR #define move_head_left(t) move_head(t, 0) #define move_head_right(t) move_head(t, 1) typedef int bool; typedef enum { TURING_OK, TURING_HALT, TURING_ERROR } turing_s...
Update registration version for 100.3
// Copyright 2016 ESRI // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // You may freely redistribute and use this sample code, with or // without modification, provided you include the original copyright // notice and use restr...
// Copyright 2016 ESRI // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // You may freely redistribute and use this sample code, with or // without modification, provided you include the original copyright // notice and use restr...
Use the new log API
#include "Enesim.h" int main(int argc, char **argv) { Enesim_Renderer *r; Enesim_Surface *s; Enesim_Log *error = NULL; enesim_init(); r = enesim_renderer_rectangle_new(); enesim_renderer_shape_fill_color_set(r, 0xffffffff); /* we dont set any property to force the error */ s = enesim_surface_new(ENESIM_FORMA...
#include "Enesim.h" int main(int argc, char **argv) { Enesim_Renderer *r; Enesim_Surface *s; Enesim_Log *error = NULL; enesim_init(); r = enesim_renderer_rectangle_new(); enesim_renderer_shape_fill_color_set(r, 0xffffffff); /* we dont set any property to force the error */ s = enesim_surface_new(ENESIM_FORMA...
Add (prototype of) concurrent queue.
#include <mutex> #include <deque> #ifndef SRC_CONCURRENT_QUEUE_H #define SRC_CONCURRENT_QUEUE_H /* Concurrent queue * so far just make sure it is consisten, no performance optimizations * but interface should be general enought to replace queue with faster one */ template< typename T > struct ConcurrentQueue { ...
Fix lock-unlock copy-paste mistake in 04/37
#include <pthread.h> int g; int *g1; int *g2; pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&mutex); (*g1)++; // RACE! pthread_mutex_lock(&mutex); return NULL; } int main(void) { pthread_t id; int x; g1 = g2 = &g; pthread_create(&id, NULL, t_fun, NULL...
#include <pthread.h> int g; int *g1; int *g2; pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&mutex); (*g1)++; // RACE! pthread_mutex_unlock(&mutex); return NULL; } int main(void) { pthread_t id; int x; g1 = g2 = &g; pthread_create(&id, NULL, t_fun, NU...
Correct type, gcc-3.4.5 fails, thanks nitinkg for reporting/testing
/* vi: set sw=4 ts=4: */ /* * getrusage() for uClibc * * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org> * * GNU Library General Public License (LGPL) version 2 or later. */ #include "syscalls.h" #include <unistd.h> #include <wait.h> _syscall2(int, getrusage, int, who, struct rusage *, usage);
/* vi: set sw=4 ts=4: */ /* * getrusage() for uClibc * * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org> * * GNU Library General Public License (LGPL) version 2 or later. */ #include "syscalls.h" #include <unistd.h> #include <wait.h> _syscall2(int, getrusage, __rusage_who_t, who, struct rusage *...
Add backup implementation of std::make_unique.
// // pch.h // Header for standard system include files. // #ifndef _divida_precompiled_header_h_ #define _divida_precompiled_header_h_ #ifdef WINDOWS #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include <windows.h> #endif #include <algorithm> #include <iomanip> #include <string> #include <sstr...
// // pch.h // Header for standard system include files. // #ifndef _divida_precompiled_header_h_ #define _divida_precompiled_header_h_ #ifdef WINDOWS #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include <windows.h> #endif #include <algorithm> #include <iomanip> #include <memory> #include <stri...
Revert "Updating ambient light to 2.0 API."
#include "ambient_light.h" #include "tock.h" typedef struct { int intensity; bool fired; } ambient_light_data_t; // callback for synchronous reads static void ambient_light_cb(int intensity, __attribute__ ((unused)) int unused1, __attribute__ ((unused)) in...
#include "ambient_light.h" #include "tock.h" typedef struct { int intensity; bool fired; } ambient_light_data_t; // internal callback for faking synchronous reads static void ambient_light_cb(int intensity, __attribute__ ((unused)) int unused1, __attribute...
Remove declaration of unimplemented method
#ifndef ALIPHOSPREPROCESSOR_H #define ALIPHOSPREPROCESSOR_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ /////////////////////////////////////////////////////////////////////////////// // Class AliPH...
#ifndef ALIPHOSPREPROCESSOR_H #define ALIPHOSPREPROCESSOR_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ /////////////////////////////////////////////////////////////////////////////// // Class AliPH...
Add working bubble sort implementation
#ifndef SORTING_INCLUDE_BUBBLESORTS_BUBBLE_INL_H_ #define SORTING_INCLUDE_BUBBLESORTS_BUBBLE_INL_H_ namespace sorting { namespace bubble { template <class T> void BubbleSort(T * const array, const int N) /** * Bubble sort: Bubble sort * Scaling: * Best case: * Worst case: * Useful: * */ { } } // na...
#ifndef SORTING_INCLUDE_BUBBLESORTS_BUBBLE_INL_H_ #define SORTING_INCLUDE_BUBBLESORTS_BUBBLE_INL_H_ namespace sorting { namespace bubble { template <class T> void BubbleSort(T * const array, const int N) /** * Bubble sort: Bubble sort * Scaling: * Best case: * Worst case: * Useful: * */ { int pas...
Add Statistical Mode Finding Algorithm
// Patrick Yevsukov // 2013 CC BY-NC-SA 4.0 // Excerpt From github.com/PatrickYevsukov/Statistics-Calculator // I devised this algorithm to identify the statistical mode or // modes of a dataset. It requires one pass through the set to // identify the set's mode or mode's. // This algorithm works by keeping trac...
Rename function to the new version.
#ifndef UNITS_UNIT_H_ #define UNITS_UNIT_H_ #include <SFML/Graphics.hpp> #include "engine/instance.h" #include "base/aliases.h" class Unit : public Instance { public: Unit(); virtual ~Unit(); virtual void Step(sf::Time elapsed); void set_life(unsigned life) { life_ = life; } unsigned life() { ...
#ifndef UNITS_UNIT_H_ #define UNITS_UNIT_H_ #include <SFML/Graphics.hpp> #include "engine/instance.h" #include "base/aliases.h" class Unit : public Instance { public: Unit(); virtual ~Unit(); virtual void Step(sf::Time elapsed); void set_life(unsigned life) { life_ = life; } unsigned life() { ...
Add signatures for content retrieval methods.
// // FileSystem.h // arc // // Created by Jerome Cheng on 19/3/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> #import "Folder.h" @interface FileSystem : NSObject { @private Folder *_rootFolder; // The root folder. } // Returns the root folder of the entir...
// // FileSystem.h // arc // // Created by Jerome Cheng on 19/3/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> #import "Folder.h" @interface FileSystem : NSObject { @private Folder *_rootFolder; // The root folder. } // Returns the root folder of the entir...
Add utility functions for converting to and from AngleAxis
#ifndef CERBERUS_H #define CERBERUS_H #include <iostream> #include "ceres/ceres.h" using namespace std; using namespace ceres; class Cerberus { public: Cerberus(); Solver::Options options; LossFunction *loss; Problem problem; Solver::Summary summary; void solve(); }; #endif
#ifndef CERBERUS_H #define CERBERUS_H #include <iostream> #include "ceres/ceres.h" #include "ceres/rotation.h" using namespace std; using namespace ceres; class Cerberus { public: Cerberus(); Solver::Options options; LossFunction *loss; Problem problem; Solver::Summary summary; void solve(); }; // Rt ...
Fix typo in my last commit.
// RUN: not %clang_cc1 -E -dependency-file bla -MT %t/doesnotexist/bla.o -MP -o $t/doesnotexist/bla.o -x c /dev/null 2>&1 | FileCheck %s // CHECK: error: unable to open output file // rdar://9286457
// RUN: not %clang_cc1 -E -dependency-file bla -MT %t/doesnotexist/bla.o -MP -o %t/doesnotexist/bla.o -x c /dev/null 2>&1 | FileCheck %s // CHECK: error: unable to open output file // rdar://9286457
Update imports in umbrella header.
// // PublicHeaders.h // Insider // // Created by Alexandru Maimescu on 3/2/16. // Copyright © 2016 Alex Maimescu. All rights reserved. // #ifndef PublicHeaders_h #define PublicHeaders_h // GCDWebServer https://github.com/swisspol/GCDWebServer #import <Insider/GCDWebServer.h> #import <Insider/GCDWebServerURLEnco...
// // PublicHeaders.h // Insider // // Created by Alexandru Maimescu on 3/2/16. // Copyright © 2016 Alex Maimescu. All rights reserved. // #ifndef PublicHeaders_h #define PublicHeaders_h // GCDWebServer https://github.com/swisspol/GCDWebServer #import "GCDWebServer.h" #import "GCDWebServerURLEncodedFormRequest.h...
Disable ENV when disable DFS.
/* * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2017/10/15 bernard the first version */ #include <rtthread.h> #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <sys/time.h> #include...
/* * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2017/10/15 bernard the first version */ #include <rtthread.h> #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <sys/time.h> #include...
Use %s in test, not hard coded name.
// RUN: clang-cc -Eonly optimize.c -DOPT_O2 -O2 -verify && #ifdef OPT_O2 #ifndef __OPTIMIZE__ #error "__OPTIMIZE__ not defined" #endif #ifdef __OPTIMIZE_SIZE #error "__OPTIMIZE_SIZE__ defined" #endif #endif // RUN: clang-cc -Eonly optimize.c -DOPT_O0 -O0 -verify && #ifdef OPT_O0 #ifdef __OPTIMIZE__ ...
// RUN: clang-cc -Eonly %s -DOPT_O2 -O2 -verify && #ifdef OPT_O2 #ifndef __OPTIMIZE__ #error "__OPTIMIZE__ not defined" #endif #ifdef __OPTIMIZE_SIZE #error "__OPTIMIZE_SIZE__ defined" #endif #endif // RUN: clang-cc -Eonly %s -DOPT_O0 -O0 -verify && #ifdef OPT_O0 #ifdef __OPTIMIZE__ #error "__OPT...
Add Cytron Maker Zero SAMD21
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Softwar...
Replace include with forward declaration
/* * This file is part of libbdplus * Copyright (C) 2015 VideoLAN * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any la...
/* * This file is part of libbdplus * Copyright (C) 2015 VideoLAN * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any la...
Put new codecs in module codec header
#pragma once #include "AbsWrapperCodec.h" #include "AddWrapperCodec.h" #include "BillowWrapperCodec.h" #include "BlendWrapperCodec.h" #include "CacheWrapperCodec.h" #include "CheckerboardWrapperCodec.h" #include "ClampWrapperCodec.h" #include "ConstWrapperCodec.h" #include "CurveWrapperCodec.h" #include "CylindersWrap...
#pragma once #include "AbsWrapperCodec.h" #include "AddWrapperCodec.h" #include "BillowWrapperCodec.h" #include "BlendWrapperCodec.h" #include "CacheWrapperCodec.h" #include "CheckerboardWrapperCodec.h" #include "ClampWrapperCodec.h" #include "ConstWrapperCodec.h" #include "CornerCombinerBaseWrapperCodec.h" #include "...
Use if includes for fb/tiwtter
#import "ArtsyToken.h" #import "ArtsyAuthentication.h" #import "ArtsyAuthentication+Facebook.h" #import "ArtsyAuthentication+Twitter.h"
#import "ArtsyToken.h" #import "ArtsyAuthentication.h" #if __has_include("ArtsyAuthentication+Facebook.h") #import "ArtsyAuthentication+Facebook.h" #endif #if __has_include("ArtsyAuthentication+Twitter.h") #import "ArtsyAuthentication+Twitter.h" #endif
Print longer than 80 chars
#include <stdio.h> #define MAXLINE 81 #define MAXLENGTH 1000 int getline(char line[]); /* print line longer than 80 characters */ int main(void) { int len; char line[MAXLENGTH]; while ((len = getline(line)) > 0) if (len > MAXLINE) { printf("%s", line); } return 0; } int getlin...
Rename get(TaskId) to getAllTask (QueryEngine does not need it)
#pragma once #ifndef YOU_DATASTORE_DATASTORE_H_ #define YOU_DATASTORE_DATASTORE_H_ #include <deque> #include <functional> #include "boost/variant.hpp" #include "task_typedefs.h" #include "internal/operation.h" namespace You { namespace DataStore { namespace UnitTests {} class Transaction; class DataStore { friend cl...
#pragma once #ifndef YOU_DATASTORE_DATASTORE_H_ #define YOU_DATASTORE_DATASTORE_H_ #include <deque> #include <functional> #include "boost/variant.hpp" #include "task_typedefs.h" #include "internal/operation.h" namespace You { namespace DataStore { namespace UnitTests {} class Transaction; class DataStore { friend cl...
Make the codes in the order.
#include "libmypy.h" char hellofunc_docs[] = "Hello world description."; PyMethodDef helloworld_funcs[] = { { "hello", (PyCFunction)hello, METH_NOARGS, hellofunc_docs}, { NULL} }; struct PyModuleDef helloworld_mod = { PyModuleDef_HEAD_INIT, "helloworld", "This is hello world module.", -1, helloworld_fun...
#include "libmypy.h" char hellofunc_docs[] = "Hello world description."; PyMethodDef helloworld_funcs[] = { { "hello", (PyCFunction)hello, METH_NOARGS, hellofunc_docs}, { NULL} }; char helloworldmod_docs[] = "This is hello world module."; PyModuleDef helloworld_mod = { PyModuleDef_HEAD_INIT, "helloworld",...
Add a timeout for read
#include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <termios.h> #include <unistd.h> struct termios orig_termios; void disableRawMode() { tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios); } void enableRawMode() { tcgetattr(STDIN_FILENO, &orig_termios); atexit(disableRawMode); struct termios r...
#include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <termios.h> #include <unistd.h> struct termios orig_termios; void disableRawMode() { tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios); } void enableRawMode() { tcgetattr(STDIN_FILENO, &orig_termios); atexit(disableRawMode); struct termios r...
Reduce initial number of mutations
#ifndef MUTATION_RATE_GENE_H #define MUTATION_RATE_GENE_H #include "Gene.h" #include <string> #include <memory> #include <map> #include "Game/Color.h" //! The gene controls how much of the genome mutates per Genome::mutate() event. class Mutation_Rate_Gene : public Gene { public: std::string name() cons...
#ifndef MUTATION_RATE_GENE_H #define MUTATION_RATE_GENE_H #include "Gene.h" #include <string> #include <memory> #include <map> #include "Game/Color.h" //! The gene controls how much of the genome mutates per Genome::mutate() event. class Mutation_Rate_Gene : public Gene { public: std::string name() cons...
Fix to Use specified Font mosamosa.
// // Constants.h // yamiHikariGame // // Created by slightair on 2013/07/28. // // #ifndef yamiHikariGame_Constants_h #define yamiHikariGame_Constants_h #define SpriteSheetImageFileName "spriteSheet.pvr.ccz" #define DefaultFontName "mosamosa" #define DefaultFontSize 24 #define StaminaMax 1000 #define SEItemGet ...
// // Constants.h // yamiHikariGame // // Created by slightair on 2013/07/28. // // #ifndef yamiHikariGame_Constants_h #define yamiHikariGame_Constants_h #define SpriteSheetImageFileName "spriteSheet.pvr.ccz" #define DefaultFontName "mosamosa.ttf" #define DefaultFontSize 24 #define StaminaMax 1000 #define SEItem...
Add initial data structures for mapping
#ifndef GRAPH_H #define GRAPH_H #include <unordered_map> #include <unordered_set> template<typename T> class Graph { public: void connect(const T &a, const T &b); const std::unordered_set<T>& get_vertex_ids() const; inline const std::unordered_set<T>& get_neighbors(const T &vertex_id) const { re...
#ifndef GRAPH_H #define GRAPH_H #include <unordered_map> #include <unordered_set> template<typename T> class Graph { public: void connect(const T &a, const T &b); const std::unordered_set<T>& get_vertex_ids() const; inline const std::unordered_set<T>& get_neighbors(const T &vertex_id) const { re...
Add get_supported_rf_protocols() method to driver
/* mbed Microcontroller Library * Copyright (c) 2018 ARM Limited * * 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 require...
/* mbed Microcontroller Library * Copyright (c) 2018 ARM Limited * * 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 require...
Remove extern references for OC_*_QUANT_MIN.
/******************************************************************** * * * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENS...
/******************************************************************** * * * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENS...
Add ADC channel enumeration to chip
/* Copyright 2017 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. */ /* MCHP MEC specific ADC module for Chrome EC */ #ifndef __CROS_EC_ADC_CHIP_H #define __CROS_EC_ADC_CHIP_H /* Data structure to define ADC channe...
/* Copyright 2017 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. */ /* MCHP MEC specific ADC module for Chrome EC */ #ifndef __CROS_EC_ADC_CHIP_H #define __CROS_EC_ADC_CHIP_H /* Data structure to define ADC channe...
Add (deactivated) casting test for congruence domain
// PARAM: --disable ana.int.def_exc --enable ana.int.interval // Ensures that the cast_to function handles casting for congruences correctly. // TODO: Implement appropriate cast_to function, enable for congruences only and adjust test if necessary. #include <assert.h> #include <stdio.h> int main(){ int c = 128; fo...
Fix a __i386 bug in gcc
#ifndef _CONCAT_H_ #define _CONCAT_H_ /// Utitilies to make a unique variable name. #define CONCAT_LINE(x) CONCAT(x, __LINE__) #define CONCAT(a, b) CONCAT_INDIRECT(a, b) #define CONCAT_INDIRECT(a, b) a ## b #endif
#ifndef _CONCAT_H_ #define _CONCAT_H_ /// Utitilies to make a unique variable name. #define CONCAT_LINE(x) CONCAT(x ## _foreach__, __LINE__) #define CONCAT(a, b) CONCAT_INDIRECT(a, b) #define CONCAT_INDIRECT(a, b) a ## b #endif
Add class for retrieving system color scheme settings
#pragma once #include <Windows.h> #include "../Logger.h" #include <math.h> #include <algorithm> #include <dwmapi.h> #pragma comment(lib, "Dwmapi.lib") class SystemColors { struct DWMColorizationParams { UINT ColorizationColor; UINT ColorizationAfterglow; UINT ColorizationColorBalance; ...
Add a view for a packed array of C strings.
//This Source Code Form is subject to the terms of the Mozilla Public //License, v. 2.0. If a copy of the MPL was not distributed with this //file, You can obtain one at http://mozilla.org/MPL/2.0/. #pragma once #include <stddef.h> #include <string.h> #include "Common.h" namespace ej { //! Represents a view on a l...
Fix test failing on Linux
// Check that calling dispatch_once from a report callback works. // RUN: %clang_tsan %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s #include <dispatch/dispatch.h> #include <pthread.h> #include <stdio.h> long g = 0; long h = 0; void f() { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ g++;...
// Check that calling dispatch_once from a report callback works. // RUN: %clang_tsan %s -o %t // RUN: not %env_tsan_opts=ignore_noninstrumented_modules=0 %run %t 2>&1 | FileCheck %s #include <dispatch/dispatch.h> #include <pthread.h> #include <stdio.h> long g = 0; long h = 0; void f() { static dispatch_once_t on...
Fix the file name case problem for building code in Linux system
/* mbed Microcontroller Library * Copyright (c) 2015-2017 Nuvoton * * 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 requir...
/* mbed Microcontroller Library * Copyright (c) 2015-2017 Nuvoton * * 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 requir...
Change method-name to something more appropriate
#include "unity.h" #include "cpuid.h" void test_GetVendorName_should_ReturnGenuineIntel(void) { char expected[20] = "GenuineIntel"; char actual[20]; get_vendor_name(actual); TEST_ASSERT_EQUAL_STRING(expected, actual); } void test_GetVendorSignature_should_asdf(void) { uint32_t exp_ebx = 0x756e6547; // t...
#include "unity.h" #include "cpuid.h" void test_GetVendorName_should_ReturnGenuineIntel(void) { char expected[20] = "GenuineIntel"; char actual[20]; get_vendor_name(actual); TEST_ASSERT_EQUAL_STRING(expected, actual); } void test_GetVendorSignature_should_ReturnCorrectCpuIdValues(void) { uint32_t exp_eb...
Add probably useless _printf(x,y) macro
/* * print_helpers.h * * Created on: Nov 29, 2014 * Author: Konstantin Gredeskoul * Code: https://github.com/kigster * * (c) 2014 All rights reserved, MIT License. */ #ifndef printv #define printv(X,Y) (Serial.print(X) || Serial.println(Y)) #endif
/* * print_helpers.h * * Created on: Nov 29, 2014 * Author: Konstantin Gredeskoul * Code: https://github.com/kigster * * (c) 2014 All rights reserved, MIT License. */ #ifndef printv #define printv(X,Y) (Serial.print(X) || Serial.println(Y)) #endif #ifndef _printf #define _printf(X,Y) (Serial.pri...
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 (...
Add Code For nth Fibonacci Number in c
#include<stdio.h> long long int fibonacci(long long int n) { //Because first fibonacci number is 0 and second fibonacci number is 1. if(n==1 || n==2) { return (n-1); } else { //store last fibonacci number long long int a=1; //store second last fibonacci number long long int b=0; //store current fibo...
Hide the system's version of the prototype for select(). We define it in "condor_fdset.h".
#ifndef FIX_LIMITS_H #define FIX_LIMITS_H #if defined(HPUX9) # define select _hide_select #endif #include <limits.h> #if defined(HPUX9) # undef select #endif #endif
Remove fieldWithID:withIndexPath:inForms: from public header
@import Foundation; #import "HYPFormField.h" @interface HYPFormsManager : NSObject @property (nonatomic, strong) NSMutableArray *forms; @property (nonatomic, strong) NSMutableDictionary *hiddenFields; @property (nonatomic, strong) NSMutableDictionary *hiddenSections; @property (nonatomic, strong) NSArray *disabledFi...
@import Foundation; #import "HYPFormField.h" @interface HYPFormsManager : NSObject @property (nonatomic, strong) NSMutableArray *forms; @property (nonatomic, strong) NSMutableDictionary *hiddenFields; @property (nonatomic, strong) NSMutableDictionary *hiddenSections; @property (nonatomic, strong) NSArray *disabledFi...
Change the type of Customer::id to std::size_t
#ifndef VRPSOLVER_CUSTOMER_H #define VRPSOLVER_CUSTOMER_H namespace VrpSolver { class Customer { public: Customer(unsigned int id, std::size_t demand) : id_(id), demand_(demand) {} unsigned int id() const { return id_; } std::size_t demand() const { ...
#ifndef VRPSOLVER_CUSTOMER_H #define VRPSOLVER_CUSTOMER_H namespace VrpSolver { class Customer { public: Customer(std::size_t id, std::size_t demand) : id_(id), demand_(demand) {} std::size_t id() const { return id_; } std::size_t demand() const { ...
Add comments for header file
// // PBRequest.h // Pbind <https://github.com/wequick/Pbind> // // Created by galen on 15/2/12. // Copyright (c) 2015-present, Wequick.net. All rights reserved. // // This source code is licensed under the MIT-style license found in the // LICENSE file in the root directory of this source tree. // #import <Foun...
// // PBRequest.h // Pbind <https://github.com/wequick/Pbind> // // Created by galen on 15/2/12. // Copyright (c) 2015-present, Wequick.net. All rights reserved. // // This source code is licensed under the MIT-style license found in the // LICENSE file in the root directory of this source tree. // #import <Foun...
Update header + licence information
/* * rbcoremidi.c * rbcoremidi * * Created by cypher on 15.07.08. * Copyright 2008 Nuclear Squid. All rights reserved. * */ #include <ruby.h> VALUE crbCoreMidi; void Init_rbcoremidi (void) { // Add the initialization code of your module here. }
/* * Copyright 2008 Markus Prinz * Released unter an MIT licence * */ #include <ruby.h> VALUE crbCoreMidi; void Init_rbcoremidi (void) { // Add the initialization code of your module here. }
Update execvp error message on file not found
#include <assert.h> #include <errno.h> #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #include <stdlib.h> int main(int argc, char **argv) { pid_t pid; assert(argc > 0); if (argc < 2) { printf("usage: %s command [arguments...]\n", argv[0]); return 1; ...
#include <assert.h> #include <errno.h> #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #include <stdlib.h> int main(int argc, char **argv) { pid_t pid; assert(argc > 0); if (argc < 2) { printf("usage: %s command [arguments...]\n", argv[0]); return 1; ...
Add unittest to unittest group in doxygen
//===--------------------------------------------------------------------------------*- C++ -*-===// // _ // | | // __| | __ ___ ___ ___ // / _` |/ _` \ \ /\ / / '_ | // | (_| | (_| |\ V V /| | | | // ...
//===--------------------------------------------------------------------------------*- C++ -*-===// // _ // | | // __| | __ ___ ___ ___ // / _` |/ _` \ \ /\ / / '_ | // | (_| | (_| |\ V V /| | | | // ...
Include the component implementation include helper instead of the individual components in Components.h.
// THIS FILE IS AUTO GENERATED, EDIT AT YOUR OWN RISK //% L #ifndef COMPONENTS_ENTITIES_H_ #define COMPONENTS_ENTITIES_H_ //% L #include "Components.h" //% L {% for component in components %} #include "{{component.get_type_name()}}.h" {% endfor %} //% L // Entity definitions //% L {% for entity in entities ...
// THIS FILE IS AUTO GENERATED, EDIT AT YOUR OWN RISK //% L #ifndef COMPONENTS_ENTITIES_H_ #define COMPONENTS_ENTITIES_H_ //% L #include "Components.h" #include "ComponentImplementationInclude.h" //% L // Entity definitions //% L {% for entity in entities %} //% L // Definition of {{entity.get_type_name(...
Add a test case for microtask dispatch with many arguments
// RUN: %libomp-compile-and-run #include <stdio.h> int main() { int i1 = 0; int i2 = 1; int i3 = 2; int i4 = 3; int i5 = 4; int i6 = 6; int i7 = 7; int i8 = 8; int i9 = 9; int i10 = 10; int i11 = 11; int i12 = 12; int i13 = 13; int i14 = 14; int i15 = 15; int i16 = 16; int r = 0; ...
Make a test work if run by the super-user
// RUN: %clang_profgen -o %t -O3 %s // RUN: touch %t.profraw // RUN: chmod -w %t.profraw // RUN: env LLVM_PROFILE_FILE=%t.profraw LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s // RUN: chmod +w %t.profraw int main(int argc, const char *argv[]) { if (argc < 2) return 1; return 0; } // CHECK: LLVM P...
// RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE="/" LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s int main(int argc, const char *argv[]) { if (argc < 2) return 1; return 0; } // CHECK: LLVM Profile: Failed to write file
Update update and create block signatures.
#pragma mark Forward Declarations @class AFObjectProvider; #pragma mark Type Definitions typedef void (^AFObjectUpdateBlock)(AFObjectProvider *provider, id object, NSDictionary *values); typedef id (^AFObjectCreateBlock)(AFObjectProvider *provider, NSDictionary *values); #pragma mark - Class Interface @interf...
#pragma mark Forward Declarations @class AFObjectProvider; #pragma mark Type Definitions typedef void (^AFObjectUpdateBlock)(id provider, id object, NSDictionary *values); typedef id (^AFObjectCreateBlock)(id provider, NSDictionary *values); #pragma mark - Class Interface @interface AFObjectModel : NSObject ...
Correct fuzzy and fragile IRQ_RETVAL() definition
#ifndef _LINUX_IRQRETURN_H #define _LINUX_IRQRETURN_H /** * enum irqreturn * @IRQ_NONE interrupt was not from this device * @IRQ_HANDLED interrupt was handled by this device * @IRQ_WAKE_THREAD handler requests to wake the handler thread */ enum irqreturn { IRQ_NONE = (0 << 0), IRQ_HANDLED = (1 << 0), IRQ_W...
#ifndef _LINUX_IRQRETURN_H #define _LINUX_IRQRETURN_H /** * enum irqreturn * @IRQ_NONE interrupt was not from this device * @IRQ_HANDLED interrupt was handled by this device * @IRQ_WAKE_THREAD handler requests to wake the handler thread */ enum irqreturn { IRQ_NONE = (0 << 0), IRQ_HANDLED = (1 << 0), IRQ_W...
Define a few internal macros for easy use of run_once functions
/* * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/lice...
Allow use of inline keyword in c++/c99 mode
/* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ag...
/* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ag...
Fix compilation for case-sensitive file systems.
#ifndef __FILTERIMPORTEREXPORTER_H__ #define __FILTERIMPORTEREXPORTER_H__ #include <qvalueList.h> class KMFilter; class KConfig; namespace KMail { /** @short Utility class that provides persisting of filters to/from KConfig. @author Till Adam <till@kdab.net> */ class FilterImporterExporter { public: ...
#ifndef __FILTERIMPORTEREXPORTER_H__ #define __FILTERIMPORTEREXPORTER_H__ #include <qvaluelist.h> class KMFilter; class KConfig; namespace KMail { /** @short Utility class that provides persisting of filters to/from KConfig. @author Till Adam <till@kdab.net> */ class FilterImporterExporter { public: ...
Add client test program to measure speed of message handling.
#include <arpa/inet.h> #include <endian.h> #include <netinet/in.h> #include <netinet/tcp.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; ser...
Add UNLIKELY for compiler optimization
#ifndef LYNX_BASE_COMPILER_SPECIFIC_H_ #define LYNX_BASE_COMPILER_SPECIFIC_H_ #if !defined(UNLIKELY) #if defined(COMPILER_GCC) #define UNLIKELY(x) __builtin_expect(!!(x), 0) #else #define UNLIKELY(x) (x) #endif #endif #endif
Remove my copyright. This file includes simply i386's one now.
/*- * Copyright (C) 2005 TAKAHASHI Yoshihiro. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of c...
/*- * This file is in the public domain. */ /* $FreeBSD$ */ #include <i386/clock.h>
Add android main for sdl
#pragma once #include "onair/okui/config.h" #if SCRAPS_ANDROID #include <SDL2/SDL_main.h> #include <jni.h> extern "C" { /* Called before SDL_main() to initialize JNI bindings in SDL library */ extern void SDL_Android_Init(JNIEnv* env, jclass cls); /* Start up the SDL app */ JNIEXPORT int JNICALL Java_org_libsdl_...
Fix not yet corrected NAMESPACE macro
#pragma once #if !defined( NS_CONCAT_ ) #define NS_CONCAT_( A, B ) A##B #endif /* !defined( NS_CONCAT ) */ #if !defined( NS_CONCAT ) #define NS_CONCAT( A, B ) NS_CONCAT_( A, B ) #endif /* !defined( NS_CONCAT ) */ #if !defined( NAMESPACE ) #define NAMESPACE #endif /* !defined( NAMESPACE ) */ #if !define...
#pragma once #if !defined( NS_CONCAT_ ) #define NS_CONCAT_( A, B ) A##B #endif /* !defined( NS_CONCAT ) */ #if !defined( NS_CONCAT ) #define NS_CONCAT( A, B ) NS_CONCAT_( A, B ) #endif /* !defined( NS_CONCAT ) */ #if !defined( __NAMESPACE ) #define __NAMESPACE #endif /* !defined( __NAMESPACE ) */ #if !...
Change interface of IsPointQuery() in header file
//===----------------------------------------------------------------------===// // // Peloton // // index_util.h // // Identification: src/include/index/index_util.h // // Copyright (c) 2015-16, Carnegie Mellon University Database Group // //===--------------------------------------------------...
//===----------------------------------------------------------------------===// // // Peloton // // index_util.h // // Identification: src/include/index/index_util.h // // Copyright (c) 2015-16, Carnegie Mellon University Database Group // //===--------------------------------------------------...
Use <> import syntax for umbrella header
// // Motif.h // Motif // // Created by Eric Horacek on 3/29/15. // Copyright (c) 2015 Eric Horacek. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for Motif. FOUNDATION_EXPORT double MotifVersionNumber; //! Project version string for Motif. FOUNDATION_EXPORT const unsigned ...
// // Motif.h // Motif // // Created by Eric Horacek on 3/29/15. // Copyright (c) 2015 Eric Horacek. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for Motif. FOUNDATION_EXPORT double MotifVersionNumber; //! Project version string for Motif. FOUNDATION_EXPORT const unsigned ...
Rename the radio event handler.
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "radio.h" void radio_event_handler(radio_evt_t * evt) { } int main(void) { uint8_t i = 0; radio_packet_t packet; packet.len = 4; radio_init(radio_event_handler); ...
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "radio.h" void radio_evt_handler(radio_evt_t * evt) { } int main(void) { uint8_t i = 0; radio_packet_t packet; packet.len = 4; packet.flags.ack = 0; radio_init(rad...
Fix incorrect is_sorted implementation in the test suite
/* * Copyright (c) 2015-2018 Morwenn * SPDX-License-Identifier: MIT */ #ifndef CPPSORT_TESTSUITE_ALGORITHM_H_ #define CPPSORT_TESTSUITE_ALGORITHM_H_ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <functional> #include <it...
/* * Copyright (c) 2015-2021 Morwenn * SPDX-License-Identifier: MIT */ #ifndef CPPSORT_TESTSUITE_ALGORITHM_H_ #define CPPSORT_TESTSUITE_ALGORITHM_H_ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <functional> #include <cp...
Make assembly prologue match new memory map
#ifndef RAM_H_ #define RAM_H_ #define RAM_BASE (1ULL << 12) #define RAM_END ((1ULL << 16) - 1) #endif
#ifndef RAM_H_ #define RAM_H_ #define RAM_BASE (1ULL << 12) #define RAM_END ((1ULL << 14) - 1) #endif
Remove phys_to_abs() now all users have been removed
#ifndef _ASM_POWERPC_ABS_ADDR_H #define _ASM_POWERPC_ABS_ADDR_H #ifdef __KERNEL__ /* * c 2001 PPC 64 Team, IBM Corp * * 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 o...
#ifndef _ASM_POWERPC_ABS_ADDR_H #define _ASM_POWERPC_ABS_ADDR_H #ifdef __KERNEL__ /* * c 2001 PPC 64 Team, IBM Corp * * 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 o...
Add C to F program
#include <stdio.h> /* print Celsius to Fahrenheit table * for Fahrenheit 0, 20, ..., 300 */ int main() { float fahr; float cel; int lower; int upper; int step; lower = 0; /* lower bound for the table */ upper = 150; /* upper bound for the table */ step = 10; /* amount to step by */ ...
Reorder function definitions to match their order in the header file.
/** * Win32 UTF-8 wrapper * * ---- * * shlwapi.dll functions. */ #include <Shlwapi.h> #include "win32_utf8.h" BOOL STDAPICALLTYPE PathMatchSpecU( __in LPCSTR pszFile, __in LPCSTR pszSpec ) { BOOL ret; WCHAR_T_DEC(pszFile); WCHAR_T_DEC(pszSpec); WCHAR_T_CONV(pszFile); WCHAR_T_CONV(pszSpec); ret = P...
/** * Win32 UTF-8 wrapper * * ---- * * shlwapi.dll functions. */ #include <Shlwapi.h> #include "win32_utf8.h" BOOL STDAPICALLTYPE PathFileExistsU( __in LPCSTR pszPath ) { BOOL ret; WCHAR_T_DEC(pszPath); WCHAR_T_CONV_VLA(pszPath); ret = PathFileExistsW(pszPath_w); VLA_FREE(pszPath_w); return ret; } ...
Add a centralized dispatcher for softnet interrupts. This is so that we won't need to change every arch on a softnet change.
/* $NetBSD: netisr_dispatch.h,v 1.2 2000/07/02 04:40:47 cgd Exp $ */ /* * netisr_dispatch: This file is included by the * machine dependant softnet function. The * DONETISR macro should be set before including * this file. i.e.: * * softintr() { * ...do setup stuff... * #define DONETISR(bit, fn) do { ... } ...
Replace modulo by AND gatter
/* Copyright (c) 2012 Fritz Grimpen * * Permission is hereby granted, unalloc 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, publi...
/* Copyright (c) 2012 Fritz Grimpen * * Permission is hereby granted, unalloc 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, publi...
Revert accidental uncommenting of TYPE_ANIMATION
#pragma once // assume that visuals and code are the same here.... // and also assuming our screen is square :) #define VISUALS_WIDTH 504 #define VISUALS_HEIGHT 504 #define CODE_WIDTH VISUALS_WIDTH #define CODE_HEIGHT VISUALS_HEIGHT #define CODE_X_POS 520 // via the tech staff //if this is defined, we will w...
#pragma once // assume that visuals and code are the same here.... // and also assuming our screen is square :) #define VISUALS_WIDTH 504 #define VISUALS_HEIGHT 504 #define CODE_WIDTH VISUALS_WIDTH #define CODE_HEIGHT VISUALS_HEIGHT #define CODE_X_POS 520 // via the tech staff //if this is defined, we will w...
Add logging etc. to lock release code.
// -*- c++ -*- #ifndef LOCKS_H #define LOCKS_H #include <pthread.h> namespace locks { template <typename L> void unlocker(void* lock_ptr) { L* lock = (L*) lock_ptr; lock->unlock(); } template <typename L> void unlocker_checked(void* lock_ptr) { L& lock = *((L*) lock_ptr); if (lock) lock.unlo...
// -*- c++ -*- #ifndef LOCKS_H #define LOCKS_H #include <cstdio> #include <pthread.h> namespace locks { template <typename L> void unlocker(void* lock_ptr) { L* lock = (L*) lock_ptr; fprintf(stderr, "Releasing lock (unchecked) during cancellation!\n"); lock->unlock(); } template <typename L> void unlock...
Add missing macro from last commit.
#ifndef LIST_H #define LIST_H #define NEXT_NODE(node) node->next #define FINDTAILNODE(x) if(x)while(x->next)x=x->next; #define ADDNODEAFTER(x,t) if(x){t=x->next; x->next=malloc(sizeof(*t)); x->next->next=t;} #endif
#ifndef LIST_H #define LIST_H #define NEXT_NODE(node) node->next #define FINDTAILNODE(x) if(x)while(x->next)x=x->next; #define ADDNODE(x,t) if(x){t=x; x=malloc(sizeof(*x)); x->next=t;} #define ADDNODEAFTER(x,t) if(x){t=x->next; x->next=malloc(sizeof(*t)); x->next->next=t;} #endif
Fix possible divide by zero error
#ifndef UTIL_H #define UTIL_H #include <chrono> #include <numeric> #include <iterator> #include <array> #include <algorithm> namespace util { class Timer { public: Timer() = default; Timer(bool start_running); ~Timer() = default; void start(); void stop(); float stop_seconds(); float seconds(); pr...
#ifndef UTIL_H #define UTIL_H #include <chrono> #include <numeric> #include <iterator> #include <array> #include <algorithm> namespace util { class Timer { public: Timer() = default; Timer(bool start_running); ~Timer() = default; void start(); void stop(); float stop_seconds(); float seconds(); pr...
Fix narrowing conversion from double to float
#ifndef AL_MATH_DEFS_H #define AL_MATH_DEFS_H #include <math.h> #ifndef M_PI #define M_PI (3.14159265358979323846) #endif #define F_PI (3.14159265358979323846f) #define F_PI_2 (1.57079632679489661923f) #define F_TAU (6.28318530717958647692f) #define SQRTF_3 1.73205080756887719318f constexpr inline float Deg2...
#ifndef AL_MATH_DEFS_H #define AL_MATH_DEFS_H #include <math.h> #ifndef M_PI #define M_PI (3.14159265358979323846) #endif #define F_PI (3.14159265358979323846f) #define F_PI_2 (1.57079632679489661923f) #define F_TAU (6.28318530717958647692f) #define SQRTF_3 1.73205080756887719318f constexpr inline float Deg2...
Fix incorrect LED header bit order
#ifndef PLATFORM_HW_H__ #define PLATFORM_HW_H__ #include <stdbool.h> #include "color.h" #include "stm32f0xx_hal.h" #include "stm32f0xx_hal_gpio.h" #define LED_CHAIN_LENGTH 10 #define USER_BUTTON_PORT (GPIOA) #define USER_BUTTON_PIN (GPIO_PIN_0) #define LED_SPI_INSTANCE (SPI1) #pragma...
#ifndef PLATFORM_HW_H__ #define PLATFORM_HW_H__ #include <stdbool.h> #include "color.h" #include "stm32f0xx_hal.h" #include "stm32f0xx_hal_gpio.h" #define LED_CHAIN_LENGTH 10 #define USER_BUTTON_PORT (GPIOA) #define USER_BUTTON_PIN (GPIO_PIN_0) #define LED_SPI_INSTANCE (SPI1) #pragma...
Simplify string duplication function a bit.
#ifndef CJET_STRING_H #define CJET_STRING_H #include <stdlib.h> #include <string.h> static inline char *duplicate_string(const char *s) { size_t length = strlen(s); char *new_string = malloc(length + 1); if (unlikely(new_string == NULL)) { return NULL; } strncpy(new_string, s, length + 1); return new_string; ...
#ifndef CJET_STRING_H #define CJET_STRING_H #include <stdlib.h> #include <string.h> static inline char *duplicate_string(const char *s) { size_t length = strlen(s); char *new_string = malloc(length + 1); if (unlikely(new_string != NULL)) { strncpy(new_string, s, length + 1); } return new_string; } #endif
Revise license and add missing prototype
/* usart0s.h - C interface to routine written in assembler Compile the corresponding assembler file with #define C_COMPAT_ASM_CODE 1 Copyright (c) 2015 Igor Mikolic-Torreira. All right reserved. This program is free software: you can redistribute it and/or modify it under the terms of the...
/* usart0s.h - C interface to routine written in assembler The MIT License (MIT) Copyright (c) 2015 Igor Mikolic-Torreira 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 ...
Declare libunwind-entry-points as PROTECTED to ensure local uses get resolved within the library itself.
/* libunwind - a platform-independent unwind library Copyright (C) 2002 Hewlett-Packard Co Contributed by David Mosberger-Tang <davidm@hpl.hp.com> This file is part of libunwind. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "...
Add test for SCA region store.
// RUN: clang -checker-simple -verify %s void f(void) { void (*p)(void); p = f; p = &f; p(); (*p)(); }
// RUN: clang -checker-simple -verify %s void f(void) { void (*p)(void); p = f; p = &f; p(); (*p)(); } void g(void (*fp)(void)); void f2() { g(f); }
Remove requirement for a .csv suffix. Print warning if working with file that have suffix other than .csv
#ifndef QTCSVFILECHECKER_H #define QTCSVFILECHECKER_H #include <QString> #include <QFileInfo> namespace QtCSV { // Check if path to csv file is valid // @input: // - filePath - string with absolute path to csv-file // @output: // - bool - True if file is OK, else False inline bool CheckFile(co...
#ifndef QTCSVFILECHECKER_H #define QTCSVFILECHECKER_H #include <QString> #include <QFileInfo> #include <QDebug> namespace QtCSV { // Check if path to csv file is valid // @input: // - filePath - string with absolute path to csv-file // @output: // - bool - True if file is OK, else False inline...
Disable -Wimplicit-fallthrough when including tinyformat
#pragma once #define TINYFORMAT_USE_VARIADIC_TEMPLATES #include "dependencies/tinyformat/tinyformat.h" #include "library/strings.h" namespace OpenApoc { template <typename... Args> static UString format(const UString &fmt, Args &&... args) { return tfm::format(fmt.cStr(), std::forward<Args>(args)...); } UString tr(...
#pragma once #define TINYFORMAT_USE_VARIADIC_TEMPLATES #ifdef __GNUC__ // Tinyformat has a number of non-annotated switch fallthrough cases #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" #endif #include "dependencies/tinyformat/tinyformat.h" #ifdef __GNUC__ #pragma GCC diagnosti...
Remove trailing spaces in test case.
// PARAM: --enable ana.int.interval #include <stdlib.h> #include <assert.h> int main() { unsigned long ul; if (ul <= 0UL) { __goblint_check(ul == 0UL); } else { __goblint_check(ul != 0UL); } if (ul > 0UL) { __goblint_check(ul != 0UL); } else { __goblint_check(ul == 0UL); } if (! (ul ...
// PARAM: --enable ana.int.interval #include <stdlib.h> #include <assert.h> int main() { unsigned long ul; if (ul <= 0UL) { __goblint_check(ul == 0UL); } else { __goblint_check(ul != 0UL); } if (ul > 0UL) { __goblint_check(ul != 0UL); } else { __goblint_check(ul == 0UL); } if (! (ul ...
Increment version to 4.9.1 for new development work.
#ifndef WSGI_VERSION_H #define WSGI_VERSION_H /* ------------------------------------------------------------------------- */ /* * Copyright 2007-2021 GRAHAM DUMPLETON * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may ...
#ifndef WSGI_VERSION_H #define WSGI_VERSION_H /* ------------------------------------------------------------------------- */ /* * Copyright 2007-2021 GRAHAM DUMPLETON * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may ...
Update license in header file
/* * statistic_histogram.h * */ #ifndef STATISTIC_HISTOGRAM_H_ #define STATISTIC_HISTOGRAM_H_ #include <stdio.h> #include <vector> class Statistic_histogram { public: Statistic_histogram(std::string h_name, const ssize_t domain_start, const ssize_t domain_end, const size_t range_size); vo...
/* Copyright (c) 2015, Edward Haas 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, this list of conditions and the foll...
Solve To Carry or not to Carry in c
#include <stdio.h> int main() { unsigned int a, b; while (scanf("%u %u", &a, &b) != EOF) { printf("%u\n", a ^ b); } return 0; }
Add C++ and shared library stuff to header file
#ifndef FRAMEGRAB_H_ #define FRAMEGRAB_H_ #include <unistd.h> typedef void *fg_handle; /* fourcc constants */ #define FG_FORMAT_YUYV 0x56595559 #define FG_FORMAT_RGB24 0x33424752 struct fg_image { int width; int height; int format; }; fg_handle fg_init(char *, int); int fg_deinit(fg_handle); int fg_start(fg_han...
#ifndef FRAMEGRAB_H_ #define FRAMEGRAB_H_ #ifdef __cplusplus extern "C" { #endif #include <stdlib.h> #if defined(_WIN32) && !defined(__CYGWIN__) # ifdef BUILDING_DLL # define EXPORT __declspec(dllexport) # else # define EXPORT __declspec(dllimport) # endif #elif __GNUC__ >= 4 || defined(__HP_cc) # define EXPORT __...