Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Reduce the number of windows specific includes in AVFS
#include "assertive.h" #include <VSScript.h> #include <VapourSynth.h> #include <VSHelper.h> #include <climits> #include <cstdint> #include <cstdarg> #include <cstring> #include <cstdlib> #include <wchar.h> #include <cstdio> #include <algorithm> #include <new> #include <codecvt> #include <string> #include <fstream> #inc...
#include "assertive.h" #include <VSScript.h> #include <VapourSynth.h> #include <VSHelper.h> #include <climits> #include <cstdint> #include <cstdarg> #include <cstring> #include <cstdlib> #include <wchar.h> #include <cstdio> #include <algorithm> #include <new> #include <codecvt> #include <string> #include <fstream> #inc...
Allow run_command to be accessed from other files
#ifndef UTIL_H #define UTIL_H void set_verbose_on(); void set_debug_on(); void error(const char * fmt, ...); void verbose(const char * fmt, ...); void debug(const char * fmt, ...); #endif
#ifndef UTIL_H #define UTIL_H void set_verbose_on(); void set_debug_on(); void error(const char * fmt, ...); void verbose(const char * fmt, ...); void debug(const char * fmt, ...); void run_command(char * const argv[]); #endif
Merge two sorted lists - recursive
#include <stdio.h> #include <stdlib.h> #include <string.h> struct node { int data; struct node *next; }; struct node *createNode (int value) { struct node *newNode = (struct node *) malloc (sizeof (struct node)); newNode -> data = value; newNode -> next = NULL; return new...
Add specific headers for used symbols in Body
#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...
#ifndef CPR_BODY_H #define CPR_BODY_H #include <cstring> #include <initializer_list> #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) = d...
Add description to QSJsonListModel in source file.
#pragma once #include <QObject> #include <QQmlParserStatus> #include "qslistmodel.h" class QSJsonListModel : public QSListModel, public QQmlParserStatus { Q_OBJECT Q_PROPERTY(QString keyField READ keyField WRITE setKeyField NOTIFY keyFieldChanged) Q_PROPERTY(QVariantList source READ source WRITE setSource...
#pragma once #include <QObject> #include <QQmlParserStatus> #include "qslistmodel.h" /* QSJsonListModel is a data model that combine QSListModel and QSDiffRunner * into a single class. It may take a Javascript array object as source input, * it will compare with previous input then update the model according to * ...
Add missing header (for SCSP)
/* * Copyright (c) 2012-2014 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <mrkotfw@gmail.com> */ #ifndef _LIBYAUL_H_ #define _LIBYAUL_H_ /* CPU */ #include <cpu.h> /* SCU */ #include <scu.h> /* CS0 */ #include <arp.h> #include <dram-cartridge.h> #include <usb-cartridge.h> /* CS2 */ #include <c...
/* * Copyright (c) 2012-2014 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <mrkotfw@gmail.com> */ #ifndef _LIBYAUL_H_ #define _LIBYAUL_H_ /* CPU-bus CPU */ #include <cpu.h> /* CPU-bus SMPC */ #include <smpc.h> /* SCU */ #include <scu.h> /* CS0 */ #include <arp.h> #include <dram-cartridge.h> #in...
Add header guard to prevent multiple inclusion errors
#include <iostream> // An IPv4 address has the following form: // "A.B.C.D", where A, B, C and D are bytes class IPAddress { public: IPAddress (unsigned char a = 0, unsigned char b = 0, unsigned char c = 0, unsigned char d = 0); IPAddress operator& (const IPAddress& addr) const; IPAddress operator| (c...
#ifndef _IP_ADDRESS_H_ #define _IP_ADDRESS_H_ #include <iostream> // An IPv4 address has the following form: // "A.B.C.D", where A, B, C and D are bytes class IPAddress { public: IPAddress (unsigned char a = 0, unsigned char b = 0, unsigned char c = 0, unsigned char d = 0); IPAddress operator& (const IPAd...
Use of linear probing and the same hash function as other libraries
#include "../common.c" #include "m-dict.h" static inline bool oor_equal_p(unsigned int k, unsigned char n) { return k == (unsigned int)n; } static inline void oor_set(unsigned int *k, unsigned char n) { *k = (unsigned int)n; } DICT_OA_DEF2(dict_oa_uint, unsigned int, M_OPEXTEND(M_DEFAULT_OPLIST, OOR_EQUAL(o...
#include "../common.c" #define DICTI_OA_PROBING(s) 1 #include "m-dict.h" static inline bool oor_equal_p(unsigned int k, unsigned char n) { return k == (unsigned int)n; } static inline void oor_set(unsigned int *k, unsigned char n) { *k = (unsigned int)n; } DICT_OA_DEF2(dict_oa_uint, unsigned int, M_OPEXTEND...
Fix formatting. (Really ??? 3 lines for something that can fit on one ?)
#include "e.h" /* local subsystem functions */ /* local subsystem globals */ /* externally accessible functions */ EAPI void e_error_message_show_internal(char *txt) { /* FIXME: maybe log these to a file and display them at some point */ printf("<<<< Enlightenment Error >>>>\n" "%s\n", txt); } /* local ...
#include "e.h" /* local subsystem functions */ /* local subsystem globals */ /* externally accessible functions */ EAPI void e_error_message_show_internal(char *txt) { /* FIXME: maybe log these to a file and display them at some point */ printf("<<<< Enlightenment Error >>>>\n%s\n", txt); } /* local subsystem...
Change BOOL to BOOL_T to avoid confilct with "condor_expr.h".
#ifndef CONSTANTS_H #define CONSTANTS_H #if !defined(__STDC__) && !defined(__cplusplus) #define const #endif /* Set up a boolean variable type. Since this definition could conflict with other reasonable definition of BOOLEAN, i.e. using an enumeration, it is conditional. */ #ifndef BOOLEAN_TYPE_DEFINED typedef i...
#ifndef CONSTANTS_H #define CONSTANTS_H #if !defined(__STDC__) && !defined(__cplusplus) #define const #endif /* Set up a boolean variable type. Since this definition could conflict with other reasonable definition of BOOLEAN, i.e. using an enumeration, it is conditional. */ #ifndef BOOLEAN_TYPE_DEFINED typedef i...
Fix build error with old kernel headers
#include <alsa/sound/uapi/asound.h>
/* workaround for building with old glibc / kernel headers */ #ifdef __linux__ #include <linux/types.h> #else #include <sys/types.h> #endif #ifndef __kernel_long_t #define __kernel_long_t long #endif #include <alsa/sound/uapi/asound.h>
UPDATE default start without menu
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #define SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #include "GameState.h" #include "StartState.h" #include "LevelSelectState.h" #include <vector> //#define START_WITHOUT_MENU class GameStateHandler { private: std::vector<GameState*> m_stateStack; std::vector<Ga...
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #define SSPAPPLICATION_GAMESTATES_GAMESTATEHANDLER_H #include "GameState.h" #include "StartState.h" #include "LevelSelectState.h" #include <vector> #define START_WITHOUT_MENU class GameStateHandler { private: std::vector<GameState*> m_stateStack; std::vector<Game...
Change our PATH_START to 11000
// 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 BROWSER_BRIGHTRAY_PATHS_H_ #define BROWSER_BRIGHTRAY_PATHS_H_ #include "base/compiler_specific.h" #if defined(OS_WIN) #include "base/base_paths_...
// 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 BROWSER_BRIGHTRAY_PATHS_H_ #define BROWSER_BRIGHTRAY_PATHS_H_ #include "base/compiler_specific.h" #if defined(OS_WIN) #include "base/base_paths_...
Add todo because comment is wrong.
/* * A sphere which can be added * Author: Dino Wernli */ #ifndef SPHERE_H_ #define SPHERE_H_ #include "scene/element.h" #include "util/point3.h" #include "util/random.h" class Material; class Sphere : public Element { public: // Does not take ownership of material. Sphere(const Point3& center, Scalar radiu...
/* * A sphere which can be added * Author: Dino Wernli */ #ifndef SPHERE_H_ #define SPHERE_H_ #include "scene/element.h" #include "util/point3.h" #include "util/random.h" class Material; class Sphere : public Element { public: // Does not take ownership of material. Sphere(const Point3& center, Scalar radiu...
Add binary sample (add missing file)
#include <stdio.h> #include <stdlib.h> int main(int argc, char * argv[]) { unsigned int i; unsigned int a; unsigned int l; if (argc != 2) { printf("Usage: %s <iterations>\n", argv[0]); exit(-1); } l = (unsigned int) atoi(argv[1]); for (i = 0; i < l; i++) { a++; ...
Add macros for page aligning
/* * Copyright (c) 2012 Rob Hoelz <rob at hoelz.ro> * * 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...
/* * Copyright (c) 2012 Rob Hoelz <rob at hoelz.ro> * * 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...
Add PipePairSimple which allows a user to simply construct a single object which implements a PipePair.
#ifndef IO_PIPE_PAIR_SIMPLE_H #define IO_PIPE_PAIR_SIMPLE_H #include <io/pipe_simple.h> #include <io/pipe_simple_wrapper.h> class PipePairSimple : public PipePair { PipeSimpleWrapper<PipePairSimple> *incoming_pipe_; PipeSimpleWrapper<PipePairSimple> *outgoing_pipe_; protected: PipePairSimple(void) : incoming_pipe...
Fix the new buffer macros by ensuring macro arguments are evaluated first.
// // RXBufferMacros.h // rivenx // #if !defined(RX_BUFFER_MACROS_H) #define RX_BUFFER_MACROS_H #define BUFFER_OFFSET(buffer, bytes) (__typeof__(buffer))((uintptr_t)buffer + (bytes)) #define BUFFER_NOFFSET(buffer, bytes) (__typeof__(buffer))((uintptr_t)buffer - (bytes)) #define BUFFER_ADD_OFFSET(buffer, bytes) (buf...
// // RXBufferMacros.h // rivenx // #if !defined(RX_BUFFER_MACROS_H) #define RX_BUFFER_MACROS_H #define BUFFER_OFFSET(buffer, bytes) (__typeof__(buffer))((uintptr_t)(buffer) + (bytes)) #define BUFFER_NOFFSET(buffer, bytes) (__typeof__(buffer))((uintptr_t)(buffer) - (bytes)) #define BUFFER_ADD_OFFSET(buffer, bytes) ...
Add command to reload property configuration
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2012 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundati...
Fix build break on WIN32
//----------------------------------------------------------------------------- // MurmurHash3 was written by Austin Appleby, and is placed in the public // domain. The author hereby disclaims copyright to this source code. #ifndef _MURMURHASH3_H_ #define _MURMURHASH3_H_ //--------------------------------------------...
//----------------------------------------------------------------------------- // MurmurHash3 was written by Austin Appleby, and is placed in the public // domain. The author hereby disclaims copyright to this source code. #ifndef _MURMURHASH3_H_ #define _MURMURHASH3_H_ //--------------------------------------------...
Add alignment for 'vfork' task resource
/** * @file res_vfork.c * @brief Task resource for vfork * @date May 16, 2014 * @author Anton Bondarev */ #include <stddef.h> #include <setjmp.h> #include <kernel/task.h> #include <kernel/task/resource.h> #include <kernel/task/resource/task_vfork.h> TASK_RESOURCE_DEF(task_vfork_desc, struct task_vfork...
/** * @file res_vfork.c * @brief Task resource for vfork * @date May 16, 2014 * @author Anton Bondarev */ #include <stddef.h> #include <setjmp.h> #include <util/binalign.h> #include <kernel/task.h> #include <kernel/task/resource.h> #include <kernel/task/resource/task_vfork.h> TASK_RESOURCE_DEF(task_v...
Fix expected warning after r313945.
// RUN: %clang_cc1 %s -fblocks -verify -fsyntax-only #if !__has_attribute(noescape) # error "missing noescape attribute" #endif int *global_var __attribute((noescape)); // expected-warning{{'noescape' attribute only applies to parameters}} void foo(__attribute__((noescape)) int *int_ptr, __attribute__((noe...
// RUN: %clang_cc1 %s -fblocks -verify -fsyntax-only #if !__has_attribute(noescape) # error "missing noescape attribute" #endif int *global_var __attribute((noescape)); // expected-warning{{'noescape' attribute only applies to parameters}} void foo(__attribute__((noescape)) int *int_ptr, __attribute__((noe...
Remove unused imports from the swift bridging header
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import "UIViewController+FullScreenLoading.h" #import "ArtsyAPI+Sales.h" #import "ARScrollNavigationChief.h" #import "ARWhitespaceGobbler.h" #import "ARCountdownView.h" #import "UIView+HitTestExpansion.h" #import "...
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import "UIViewController+FullScreenLoading.h" #import "ArtsyAPI+Sales.h" #import "ARScrollNavigationChief.h" #import "ARWhitespaceGobbler.h" #import "ARCountdownView.h" #import "UIView+HitTestExpansion.h" #import "...
Remove selection of preprocessor macros as globals in the linkdef
#ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class TLDAPServer; #pragma link C++ class TLDAPResult; #pragma link C++ class TLDAPEntry; #pragma link C++ class TLDAPAttribute; #pragma link C++ global LDAP_PORT; #pragma link C++ global LDAP...
#ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class TLDAPServer; #pragma link C++ class TLDAPResult; #pragma link C++ class TLDAPEntry; #pragma link C++ class TLDAPAttribute; // These constants are preprocessor statements // in ldap.h and...
Make version string work with CONFIG_NEWLIB_LIBC
/* * Copyright (c) 2018-2021 mcumgr authors * * SPDX-License-Identifier: Apache-2.0 */ #include <stdio.h> #include <string.h> #include "img_mgmt/image.h" #include "img_mgmt/img_mgmt.h" int img_mgmt_ver_str(const struct image_version *ver, char *dst) { int rc = 0; int rc1 = 0; rc = snprintf(dst, IMG_MGMT_VER_...
/* * Copyright (c) 2018-2021 mcumgr authors * * SPDX-License-Identifier: Apache-2.0 */ #include <stdio.h> #include <string.h> #include "img_mgmt/image.h" #include "img_mgmt/img_mgmt.h" int img_mgmt_ver_str(const struct image_version *ver, char *dst) { int rc = 0; int rc1 = 0; rc = snprintf(dst, IMG_MGMT_VER_...
Define M_PI instead of CAL_PI
#ifndef G_EBKLRON9896QUFJSD3FNA40IITV3F #define G_EBKLRON9896QUFJSD3FNA40IITV3F #ifdef __cplusplus extern "C" { #endif /*@self.public()*/ static const double CAL_PI = 3.141592653589793238462643383279502884197169399375; #ifdef __cplusplus } #endif #endif
#ifndef G_EBKLRON9896QUFJSD3FNA40IITV3F #define G_EBKLRON9896QUFJSD3FNA40IITV3F #ifdef __cplusplus extern "C" { #endif /*@self.public()*/ #ifndef M_PI #define M_PI 3.141592653589793238462643383279502884197169399375 #endif #ifdef __cplusplus } #endif #endif
Add basic riot_run function definition
#include "riot_arduino_uno.h" #include "utils.h" riot_arduino_uno_sinks* riot_arduino_uno_sinks_create() { riot_arduino_uno_sinks *sinks = xmalloc(sizeof(riot_arduino_uno_sinks)); return sinks; } riot_arduino_uno_sources* riot_arduino_uno_sources_create() { riot_arduino_uno_sources *sources = xmalloc(sizeof(rio...
#include "riot_arduino_uno.h" #include "utils.h" riot_arduino_uno_sinks* riot_arduino_uno_sinks_create() { riot_arduino_uno_sinks *sinks = xmalloc(sizeof(riot_arduino_uno_sinks)); return sinks; } riot_arduino_uno_sources* riot_arduino_uno_sources_create() { riot_arduino_uno_sources *sources = xmalloc(sizeof(rio...
Fix for references with more than 32k sequences.
#ifndef __SEQUENCELOCATION_H__ #define __SEQUENCELOCATION_H__ #include "Types.h" #include "IRefProvider.h" //#pragma pack(push) //#pragma pack(2) struct SequenceLocation { uint m_Location; short m_RefId; bool used() { return m_Location != 0; } bool operator< (SequenceLocation const & rhs) ...
#ifndef __SEQUENCELOCATION_H__ #define __SEQUENCELOCATION_H__ #include "Types.h" #include "IRefProvider.h" //#pragma pack(push) //#pragma pack(2) struct SequenceLocation { uint m_Location; int m_RefId; bool used() { return m_Location != 0; } bool operator< (SequenceLocation const & rhs) co...
Use a single call only (warning x86 only) Move the y assignment to another point in code
/* 1 4 5 2 6 7 3 */ #include <stdio.h> void line(char** a, int u, int v) { char *c = a[1]; while(*c) { int y = ("|O6VYNnX~^")[*c++-48]+1; printf("%c%c%c%c", y & u ? '|' : 32, y & v ? '_' : 32, y & u*2 ? '|' : 32, c[0] ? ' ' : '\n'); } } int main(int y, char **a) { line(a...
/* 1 4 5 2 6 7 3 */ #include <stdio.h> #define L(u,v) \ for(char *c = a[1];*c;) { \ printf("%c%c%c%c", \ y & u ? '|' : 32, \ y & v ? '_' : 32, \ (y = ("|O6VYNnX~^")[*c++-48]+1) & u*2 ? '|' : 32, \ c[1] ? ' ' : '\n'); \ }; int main(int y, char **a) { L(0, 1); L(8, 2); L(32, 4); return ...
Add error output for crash()
// // Created by admarkov on 22.04.17. // #ifndef FUNC_COMPOSER_FRAME_H #define FUNC_COMPOSER_FRAME_H #include <string> typedef unsigned int index; void crash(char info[]="") { puts("Fatal error."); exit(0); } #endif //FUNC_COMPOSER_FRAME_H
// // Created by admarkov on 22.04.17. // #ifndef FUNC_COMPOSER_FRAME_H #define FUNC_COMPOSER_FRAME_H #include <string> using namespace std; typedef unsigned int index; void crash(string info="No information.") { puts("Fatal error: "+info); exit(0); } #endif //FUNC_COMPOSER_FRAME_H
Update Skia milestone to 110
/* * 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 109 #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 110 #endif
Add listing disks and partitions program
/* * disklist - List of disk and partitions using parted library * * Written in 2013 by Prashant P Shah <pshah.mumbai@gmail.com> * * To the extent possible under law, the author(s) have dedicated * all copyright and related and neighboring rights to this software * to the public domain worldwide. This software i...
Make the macro play nice with clang
///////////////////////////////////////////////////////////////////////////////////////// /// /// \file CudaLE.h /// /// __Description__: Main include file for the CudaLE lib /// /// __Version__: 1.0\n /// __Author__: Alex Chen, fizban007@gmail.com\n /// __Organization__: Columbia Uni...
///////////////////////////////////////////////////////////////////////////////////////// /// /// \file CudaLE.h /// /// __Description__: Main include file for the CudaLE lib /// /// __Version__: 1.0\n /// __Author__: Alex Chen, fizban007@gmail.com\n /// __Organization__: Columbia Uni...
Remove useless interface of toreprtab
/* * Copyright 2020 Andrey Terekhov, Maxim Menshikov * * 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...
/* * Copyright 2020 Andrey Terekhov, Maxim Menshikov * * 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...
Define NS_EXTENSIBLE_STRING_ENUM if not defined
#import <Foundation/Foundation.h> /// Macro that marks an initializer as designated, and also makes the default Foundation initializers unavailable #define HUB_DESIGNATED_INITIALIZER NS_DESIGNATED_INITIALIZER; \ /** Unavailable. Use the designated initializer instead */ \ + (instancetype)new NS_UNAVAILABLE; \ ...
#import <Foundation/Foundation.h> /// Macro that marks an initializer as designated, and also makes the default Foundation initializers unavailable #define HUB_DESIGNATED_INITIALIZER NS_DESIGNATED_INITIALIZER; \ /** Unavailable. Use the designated initializer instead */ \ + (instancetype)new NS_UNAVAILABLE; \ ...
Add header file for cross-gateway subscription data store
#ifndef SUBSCRIPTION_DATA_STORE_H #define SUBSCRIPTION_DATA_STORE_H #include <list> #include <string> class SubscriptionDataStore { public: SubscriptionDataStore(); std::list<std::string> getHandlersForType(const std::string &typeName); void subscribe(const std::string &typeName, const std::string &handlerNa...
Remove TMPDIR from glibc's commented list
/* * Environment variable to be removed for SUID programs. The names are all * stuffed in a single string which means they have to be terminated with a * '\0' explicitly. */ #define UNSECURE_ENVVARS \ "LD_PRELOAD\0" \ "LD_LIBRARY_PATH\0" \ "LD_DEBUG\0" \ "LD_DEBUG_OUTPUT\0" \ "LD_TRACE_LOADED_OBJECTS\0" \ ...
/* * Environment variable to be removed for SUID programs. The names are all * stuffed in a single string which means they have to be terminated with a * '\0' explicitly. */ #define UNSECURE_ENVVARS \ "LD_PRELOAD\0" \ "LD_LIBRARY_PATH\0" \ "LD_DEBUG\0" \ "LD_DEBUG_OUTPUT\0" \ "LD_TRACE_LOADED_OBJECTS\0" \ ...
Set log limit back to 3.5 megabytes
#include "logging.h" void error_log(const char *format, ...){ FILE *flog; //If the log file is over 3.5 megabytes, empty it and start again struct stat st; if (!stat(log_filename, &st) && st.st_size >= 36700160) //1048576 per megabyte flog = fopen(log_filename, "w+"); else flog = fopen(log_filename, "a+"); //W...
#include "logging.h" void error_log(const char *format, ...){ FILE *flog; //If the log file is over 3.5 megabytes, empty it and start again struct stat st; if (!stat(log_filename, &st) && st.st_size >= 3670016) //1048576 per megabyte flog = fopen(log_filename, "w+"); else flog = fopen(log_filename, "a+"); //Wr...
Fix a regression for EMR devices
/* * Copyright (C) 2018-2019 Richard Hughes <richard@hughsie.com> * * SPDX-License-Identifier: LGPL-2.1+ */ #pragma once #include "fu-wacom-device.h" #define FU_TYPE_WACOM_EMR_DEVICE (fu_wacom_emr_device_get_type ()) G_DECLARE_FINAL_TYPE (FuWacomEmrDevice, fu_wacom_emr_device, FU, WACOM_EMR_DEVICE, FuUdevDevice)...
/* * Copyright (C) 2018-2019 Richard Hughes <richard@hughsie.com> * * SPDX-License-Identifier: LGPL-2.1+ */ #pragma once #include "fu-wacom-device.h" #define FU_TYPE_WACOM_EMR_DEVICE (fu_wacom_emr_device_get_type ()) G_DECLARE_FINAL_TYPE (FuWacomEmrDevice, fu_wacom_emr_device, FU, WACOM_EMR_DEVICE, FuWacomDevice...
Add a test program: sending AT command to the drone
/*Lien du tuto d'où provient le code http://www.upsilonaudio.com/ar-drone-envoyer-des-commandes-at-paquets-udp/ lien vers un listing des commandes AT http://www.upsilonaudio.com/ar-drone-recapitulatif-des-commandes-at/ */ #include <arpa/inet.h> #include <netinet/in.h> #include <stdio.h> #include <sys/types.h> #include...
Fix the previous, remarkable error.
#include <stdio.h> int main(void) { printf("hello, world\n") return 0; }
#include <stdio.h> int main(void) { printf("hello, world\n"); return 0; }
Add test where memory is not invalidated correctly.
#include <stdlib.h> #include <stdio.h> typedef struct list { int val; struct list *next; } list_t; // void mutate_list(list_t n){ // list_t *next = n.next; // next->val = 42; // } int main(){ list_t first; list_t second; first.next = &second; first.val = 1; second.next = NULL; ...
Update hat-trie C library. Fix GH-11.
/* * This file is part of hat-trie. * * Copyright (c) 2011 by Daniel C. Jones <dcjones@cs.washington.edu> * * * Common typedefs, etc. * */ #ifndef HATTRIE_COMMON_H #define HATTRIE_COMMON_H typedef unsigned long value_t; #endif
/* * This file is part of hat-trie. * * Copyright (c) 2011 by Daniel C. Jones <dcjones@cs.washington.edu> * * * Common typedefs, etc. * */ #ifndef HATTRIE_COMMON_H #define HATTRIE_COMMON_H #include "pstdint.h" typedef uintptr_t value_t; #endif
Implement PID, fix forking in C
#include <stdlib.h> #include <stdio.h> #include <dirent.h> #include <sys/time.h> int main(int argc, char ** argv){ printf("Test %d\n", argc); int i; for(i = 0; i < argc; i++){ printf("%d: %s\n", i, argv[i]); } struct timeval tv; if(gettimeofday(&tv, NULL) == 0){ printf("Gettimeo...
#include <stdlib.h> #include <stdio.h> #include <dirent.h> #include <sys/time.h> int main(int argc, char ** argv){ printf("Test %d\n", argc); int i; for(i = 0; i < argc; i++){ printf("%d: %s\n", i, argv[i]); } struct timespec tp; if(clock_gettime(CLOCK_REALTIME, &tp) == 0){ prin...
Increase initial buffer to 8192 bytes
/* * Copyright 2016 Chris Marshall * * 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 ...
/* * Copyright 2016 Chris Marshall * * 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 ...
Correct the comment (the existing text was referring to a different file).
/* KindlePDFViewer: buffer for blitting muPDF data to framebuffer (blitbuffer) Copyright (C) 2011 Hans-Werner Hilse <hilse@web.de> 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, ...
/* KindlePDFViewer: miscellaneous utility functions for Lua Copyright (C) 2011 Hans-Werner Hilse <hilse@web.de> 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...
Add explicit header for size_t
#ifndef STUD_String_H #define STUD_String_H #include <initializer_list> #include <string> namespace stud { class string : public std::string { public: string() = default; string(const string& rhs) = default; string(string&& rhs) = default; string& operator=(const string& rhs) = default; string...
#ifndef STUD_String_H #define STUD_String_H #include <cstring> #include <initializer_list> #include <string> namespace stud { class string : public std::string { public: string() = default; string(const string& rhs) = default; string(string&& rhs) = default; string& operator=(const string& rhs) =...
Fix test in -Asserts build.
// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s #define FASTCALL __attribute__((regparm(2))) typedef struct { int aaa; double bbbb; int ccc[200]; } foo; typedef void (*FType)(int, int) __attribute ((regparm (3), stdcall)); FType bar; static void FASTCALL reduced(char b, ...
// RUN: %clang_cc1 -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s #define FASTCALL __attribute__((regparm(2))) typedef struct { int aaa; double bbbb; int ccc[200]; } foo; typedef void (*FType)(int, int) __attribute ((regparm (3), stdcall)); FType bar; static void FASTCALL reduced(char b, ...
Use arc4random() in tests if available.
#ifndef __CMPTEST_H__ #define __CMPTEST_H__ #include <stdio.h> #include "sodium.h" #define TEST_NAME_RES TEST_NAME ".res" #define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp" FILE *fp_res; int xmain(void); int main(void) { FILE *fp_out; int c; if ((fp_res = fopen(TEST_NAME_RES, "w+")) == NULL) ...
#ifndef __CMPTEST_H__ #define __CMPTEST_H__ #include <stdio.h> #include "sodium.h" #define TEST_NAME_RES TEST_NAME ".res" #define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp" #ifdef HAVE_ARC4RANDOM # undef rand # define rand(X) arc4random(X) #endif FILE *fp_res; int xmain(void); int main(void) { FILE *fp...
Add virtual destructor to base class.
// Copyright 2014 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...
// Copyright 2014 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...
Introduce the explicit Shell reader which makes polydata from moab.
#ifndef __smoab_ExtractShell_h #define __smoab_ExtractShell_h #include "SimpleMoab.h" #include "detail/LoadGeometry.h" #include "detail/ReadMaterialTag.h" #include <vtkUnstructuredGrid.h> #include <vtkPolyData.h> #include <algorithm> namespace smoab{ //we presume that we are extract the shell of a 3d volume, wher...
Use escape sequence to clear screen
#include <stdio.h> #include <stdlib.h> #include "system.h" void SystemPause() { puts("\nPress Enter to continue..."); while (getchar() != '\n') {} } void SystemClear() { system("clear"); }
#include <stdio.h> #include <stdlib.h> #include "system.h" void SystemPause() { puts("\nPress Enter to continue..."); while (getchar() != '\n') {} } void SystemClear() { fputs("\033[2J\033[H", stdout); }
Mark +[RLMSchema sharedSchema] as nullable.
//////////////////////////////////////////////////////////////////////////// // // Copyright 2014 Realm Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/li...
//////////////////////////////////////////////////////////////////////////// // // Copyright 2014 Realm Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/li...
Add file missed from r244409.
#ifndef STRESS1_MERGE_NO_REEXPORT_H #define STRESS1_MERGE_NO_REEXPORT_H #include "m00.h" #include "m01.h" #include "m02.h" #include "m03.h" #endif
Use of base::StringPairs appropriately in server
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_ #define NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_ #include <string> #include <utility> #include <vector> #...
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_ #define NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_ #include <string> #include <utility> #include "base/stri...
Clean up some inconsistencies in the section helper header
#import <Foundation/Foundation.h> @class MITCollectionViewNewsGridLayout; @interface MITCollectionViewGridLayoutSection : NSObject @property (nonatomic,readonly,weak) MITCollectionViewNewsGridLayout *layout; @property (nonatomic,readonly) NSInteger section; @property (nonatomic) CGPoint origin; @property (nonatomic)...
#import <Foundation/Foundation.h> @class MITCollectionViewNewsGridLayout; @interface MITCollectionViewGridLayoutSection : NSObject @property (nonatomic,readonly,weak) MITCollectionViewNewsGridLayout *layout; @property (nonatomic,readonly) NSInteger section; @property (nonatomic) CGPoint origin; @property (nonatomic)...
Use a proper Out parameter.
// Copyright 2010-2013 The CefSharp Project. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #pragma once #include "Stdafx.h" #include "IRequestResponse.h" using namespace System; using namespace System::Net; namespace CefSharp { publ...
// Copyright 2010-2013 The CefSharp Project. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #pragma once #include "Stdafx.h" #include "IRequestResponse.h" using namespace System; using namespace System::Net; using namespace System::Runtim...
Fix type bool for C
#ifndef _MY_EDATA #define _MY_EDATA #ifdef __cplusplus #define EXTERNC extern "C" #else #define EXTERNC #endif /** @brief struct that carries all information about experimental data */ typedef struct edata { /** observed data */ double *am_my; /** standard deviation of observed data */ double *am_ysi...
#ifndef _MY_EDATA #define _MY_EDATA #ifdef __cplusplus #define EXTERNC extern "C" #else #define EXTERNC #include <stdbool.h> #endif /** @brief struct that carries all information about experimental data */ typedef struct edata { /** observed data */ double *am_my; /** standard deviation of observed data ...
Remove explicit instantiation of empty message
#ifndef CPR_ERROR_H #define CPR_ERROR_H #include <string> #include "cprtypes.h" #include "defines.h" namespace cpr { enum class ErrorCode { OK = 0, CONNECTION_FAILURE, EMPTY_RESPONSE, HOST_RESOLUTION_FAILURE, INTERNAL_ERROR, INVALID_URL_FORMAT, NETWORK_RECEIVE_ERROR, NETWORK_SEND_FAI...
#ifndef CPR_ERROR_H #define CPR_ERROR_H #include <string> #include "cprtypes.h" #include "defines.h" namespace cpr { enum class ErrorCode { OK = 0, CONNECTION_FAILURE, EMPTY_RESPONSE, HOST_RESOLUTION_FAILURE, INTERNAL_ERROR, INVALID_URL_FORMAT, NETWORK_RECEIVE_ERROR, NETWORK_SEND_FAI...
Remove prototype for deleted function qemu_handle_int
#include <linux/init.h> #include <linux/linkage.h> #include <asm/i8259.h> #include <asm/mipsregs.h> #include <asm/qemu.h> #include <asm/system.h> #include <asm/time.h> extern asmlinkage void qemu_handle_int(void); asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_status() & read_c0_cause(); ...
#include <linux/init.h> #include <linux/linkage.h> #include <asm/i8259.h> #include <asm/mipsregs.h> #include <asm/qemu.h> #include <asm/system.h> #include <asm/time.h> asmlinkage void plat_irq_dispatch(void) { unsigned int pending = read_c0_status() & read_c0_cause(); if (pending & 0x8000) { ll_timer_interrupt(Q...
Test error reporting by writing to a temp directory
// 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
// RUN: %clang_profgen -o %t -O3 %s // RUN: env LLVM_PROFILE_FILE="%t/" 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
Add capstone dissasembly C example.
#include <stdio.h> #include <inttypes.h> #include <capstone/capstone.h> #define X86_CODE \ "\x55\x48\x8b\x05\xb8\x13\x00\x00\xe9\x14\x9e\x08\x00\x45\x31\xe4" int main(int argc, char* argv[]) { csh handle; cs_insn *insn; size_t count; int rc = 0; if (cs_open(CS_ARCH_X86, CS_MODE_64, &handle) != CS_ERR_OK) { ...
Add missing TClass creation for vector<Long64_t> and vector<ULong64_t>
#include <string> #include <vector> #ifndef __hpux using namespace std; #endif #pragma create TClass vector<bool>; #pragma create TClass vector<char>; #pragma create TClass vector<short>; #pragma create TClass vector<long>; #pragma create TClass vector<unsigned char>; #pragma create TClass vector<unsigned short>; #pra...
#include <string> #include <vector> #ifndef __hpux using namespace std; #endif #pragma create TClass vector<bool>; #pragma create TClass vector<char>; #pragma create TClass vector<short>; #pragma create TClass vector<long>; #pragma create TClass vector<unsigned char>; #pragma create TClass vector<unsigned short>; #pra...
Make the XFAIL line actually match x86-32 targets.
// RUN: $llvmgcc -m64 -fomit-frame-pointer -O2 %s -S -o - > %t // RUN: not grep subq %t // RUN: not grep addq %t // RUN: grep {\\-4(%%rsp)} %t | count 2 // RUN: $llvmgcc -m64 -fomit-frame-pointer -O2 %s -S -o - -mno-red-zone > %t // RUN: grep subq %t | count 1 // RUN: grep addq %t | count 1 // This is a test for x86-64...
// RUN: $llvmgcc -m64 -fomit-frame-pointer -O2 %s -S -o - > %t // RUN: not grep subq %t // RUN: not grep addq %t // RUN: grep {\\-4(%%rsp)} %t | count 2 // RUN: $llvmgcc -m64 -fomit-frame-pointer -O2 %s -S -o - -mno-red-zone > %t // RUN: grep subq %t | count 1 // RUN: grep addq %t | count 1 // This is a test for x86-64...
Add subroutine daemon for Game
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2012 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundati...
Add a macro UNREFED_VAR to silence unused variables warning.
/* @ 0xCCCCCCCC */ #if defined(_MSC_VER) #pragma once #endif #ifndef KBASE_BASIC_MACROS_H_ #define KBASE_BASIC_MACROS_H_ #define DISALLOW_COPY(CLASSNAME) \ CLASSNAME(const CLASSNAME&) = delete; \ CLASSNAME& operator=(const CLASSNAME&) = delete #define DISALLOW_MOVE(CLAS...
/* @ 0xCCCCCCCC */ #if defined(_MSC_VER) #pragma once #endif #ifndef KBASE_BASIC_MACROS_H_ #define KBASE_BASIC_MACROS_H_ #define DISALLOW_COPY(CLASSNAME) \ CLASSNAME(const CLASSNAME&) = delete; \ CLASSNAME& operator=(const CLASSNAME&) = delete #define DISALLOW_MOVE(CLAS...
Make token notifier method instance method
#import <Foundation/Foundation.h> @protocol TGSessionTokenNotifier <NSObject> +(void)sessionTokenSet:(NSString*)token; @end
#import <Foundation/Foundation.h> @protocol TGSessionTokenNotifier <NSObject> -(void)sessionTokenSet:(NSString*)token; @end
Revert "for each input path.2"
/* * SearchCubePruning.h * * Created on: 16 Nov 2015 * Author: hieu */ #pragma once #include <vector> #include <boost/unordered_map.hpp> #include "Search.h" class Bitmap; class SearchCubePruning : public Search { public: SearchCubePruning(Manager &mgr, Stacks &stacks); virtual ~SearchCubePruning(); vo...
/* * SearchCubePruning.h * * Created on: 16 Nov 2015 * Author: hieu */ #ifndef SEARCH_SEARCHCUBEPRUNING_H_ #define SEARCH_SEARCHCUBEPRUNING_H_ #include "Search.h" class SearchCubePruning : public Search { public: SearchCubePruning(Manager &mgr, Stacks &stacks); virtual ~SearchCubePruning(); void Decod...
Stop the headers of debugging perls to generate gcc brace groups.
#ifndef PERL_MONGO #define PERL_MONGO #include <mongo/client/dbclient.h> extern "C" { #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #define PERL_MONGO_CALL_BOOT(name) perl_mongo_call_xs (aTHX_ name, cv, mark) void perl_mongo_call_xs (pTHX_ void (*subaddr) (pTHX_ CV *cv), CV *cv, SV **mark); SV *perl_mon...
#ifndef PERL_MONGO #define PERL_MONGO #include <mongo/client/dbclient.h> extern "C" { #define PERL_GCC_BRACE_GROUPS_FORBIDDEN #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #define PERL_MONGO_CALL_BOOT(name) perl_mongo_call_xs (aTHX_ name, cv, mark) void perl_mongo_call_xs (pTHX_ void (*subaddr) (pTHX_ ...
Add high-level write and read functions
// Derived from blog post at http://www.ermicro.com/blog/?p=1239 #ifndef __I2C_UTILS_H__ #define __I2C_UTILS_H__ #define I2C_MAX_TRIES 50 // Connection attempts (0 < tries < 255) #define I2C_START 0 #define I2C_DATA 1 #define I2C_DATA_ACK 2 #define I2C_STOP 3 void i2c_init(void); unsigned char i2c_transmit(unsig...
// Derived from blog post at http://www.ermicro.com/blog/?p=1239 #ifndef __I2C_UTILS_H__ #define __I2C_UTILS_H__ #include <compat/twi.h> #define I2C_MAX_TRIES 50 // Connection attempts (0 < tries < 255) #define I2C_START 0 #define I2C_DATA 1 #define I2C_DATA_ACK 2 #define I2C_STOP 3 #define I2C_SCL 100000L ...
Fix standard-nonconst vla test commands
// RUN: %ocheck 1 '-DNULL=(void *)0' // RUN: %ocheck 0 '-DNULL=0' int null_is_ptr_type() { char s[1][1+(int)NULL]; int i = 0; sizeof s[i++]; return i; } main() { return null_is_ptr_type(); }
// RUN: %ocheck 1 %s '-DNULL=(void *)0' // RUN: %ocheck 0 %s '-DNULL=0' int null_is_ptr_type() { char s[1][1+(int)NULL]; int i = 0; sizeof s[i++]; return i; } main() { return null_is_ptr_type(); }
Fix a linking issue found by lint
// // Messages.h // Pods // // Created by Tyler Clemens on 6/2/16. // // #import <Foundation/Foundation.h> #import "STMMessage.h" @protocol MessagesDelegate <NSObject> @optional - (void)MessagesResults:(NSArray *_Nullable)arrayMessages; - (void)UnreadMessageResults:(NSNumber *_Nullable)count; @end @interface M...
// // Messages.h // Pods // // Created by Tyler Clemens on 6/2/16. // // #import <Foundation/Foundation.h> #import "STMMessage.h" #import "STMNetworking.h" @protocol MessagesDelegate <NSObject> @optional - (void)MessagesResults:(NSArray *_Nullable)arrayMessages; - (void)UnreadMessageResults:(NSNumber *_Nullable)...
Change this comment to helpfully explain why it's there.
#include <Sub/Types.h> // Private
#include <Sub/Types.h> // This comment ensures that this file is not identical to // HasSubModules.framework/Frameworks/Sub.framework/Headers/Sub.h
Prepare RELAP-7 for MooseVariable::sln() const update.
#ifndef ONEDMASSFLUX_H #define ONEDMASSFLUX_H #include "Kernel.h" class OneDMassFlux; template<> InputParameters validParams<OneDMassFlux>(); /** * Mass flux */ class OneDMassFlux : public Kernel { public: OneDMassFlux(const InputParameters & parameters); virtual ~OneDMassFlux(); protected: virtual Real co...
#ifndef ONEDMASSFLUX_H #define ONEDMASSFLUX_H #include "Kernel.h" class OneDMassFlux; template<> InputParameters validParams<OneDMassFlux>(); /** * Mass flux */ class OneDMassFlux : public Kernel { public: OneDMassFlux(const InputParameters & parameters); virtual ~OneDMassFlux(); protected: virtual Real co...
Remove use of using-directive for std
#include <string> using namespace std; /* Obtained from http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html */ void tokenizeString(const string& str, vector<string>& tokens, const string& delimiters) { // Skip delimiters at beginning. string::size_type lastPos = str.find_first_not_of...
#include <string> /* Obtained from http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html */ void tokenizeString(const std::string& str, std::vector<std::string>& tokens, const std::string& delimiters) { // Skip delimiters at beginning. std::string::size_type lastPos = str.find_first_not...
Test defexc with large integers
//PARAM: --enable ana.int.interval --disable exp.lower-constants #include <assert.h> int main(){ int a = 0; // maximum value for ulonglong unsigned long long x = 18446744073709551615ull; if(x > 18446744073709551612ull){ a = 1; } assert(a); unsigned long long y = x + 4; // Unsi...
//PARAM: --disable ana.int.interval #include <assert.h> int main(){ int a = 0; // maximum value for ulonglong unsigned long long x = 18446744073709551615ull; if(x > 18446744073709551612ull){ a = 1; } assert(a); unsigned long long y = x + 4; // Unsigned overflow -- The followin...
Reduce size of neighbour and interface table.
#define BUF_SIZE 4096 #define MAXINTERFACES 10 #define MAXNEIGHBOURS 20 #define MESSAGE_PAD1 0 #define MESSAGE_PADN 1 #define MESSAGE_ACK_REQ 2 #define MESSAGE_ACK 3 #define MESSAGE_HELLO 4 #define MESSAGE_IHU 5 #define MESSAGE_ROUTER_ID 6 #define MESSAGE_NH 7 #define MESSAGE_UPDATE 8 #define MESSAGE_REQUEST 9 #defi...
#define BUF_SIZE 4096 #define MAXINTERFACES 5 #define MAXNEIGHBOURS 10 #define MESSAGE_PAD1 0 #define MESSAGE_PADN 1 #define MESSAGE_ACK_REQ 2 #define MESSAGE_ACK 3 #define MESSAGE_HELLO 4 #define MESSAGE_IHU 5 #define MESSAGE_ROUTER_ID 6 #define MESSAGE_NH 7 #define MESSAGE_UPDATE 8 #define MESSAGE_REQUEST 9 #defin...
FIx build of G.726 codec wrapper with older versions of SpanDSP.
// // Copyright (C) 2007 SIPez LLC. // Licensed to SIPfoundry under a Contributor Agreement. // // Copyright (C) 2007 SIPfoundry Inc. // Licensed by SIPfoundry under the LGPL license. // // $$ /////////////////////////////////////////////////////////////////////////////// // Author: Sergey Kostanbaev <Sergey DOT K...
// // Copyright (C) 2007 SIPez LLC. // Licensed to SIPfoundry under a Contributor Agreement. // // Copyright (C) 2007 SIPfoundry Inc. // Licensed by SIPfoundry under the LGPL license. // // $$ /////////////////////////////////////////////////////////////////////////////// // Author: Sergey Kostanbaev <Sergey DOT K...
Remove use of reserved keyboard in public header
//////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2013, Typhoon Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement a...
//////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2013, Typhoon Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement a...
Add function that checks if a given number is multiple of three.
#include <stdio.h> #include <stdlib.h> int is_multiple_of_three(int n) { int odd_bits_cnt = 0; int even_bits_cnt = 0; if (n < 0) n = -n; if (n == 0) return 1; if (n == 1) return 0; while (n) { if (n & 0x1) { odd_bits_cnt++; } n >>= 1; if (n & 0x1) { even_bits_cnt++; } n >>= 1; } return ...
Remove rb_thread_blocking_region when SDL_Delay is called.
/* Ruby/SDL Ruby extension library for SDL Copyright (C) 2001-2007 Ohbayashi Ippei 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 yo...
/* Ruby/SDL Ruby extension library for SDL Copyright (C) 2001-2007 Ohbayashi Ippei 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 yo...
Revise test and see if it passes with a release-built clang.
// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s // rdar://10033986 typedef void (^BLOCK)(void); int main () { _Complex double c; BLOCK b = ^() { _Complex double z; z = z + c; }; b(); } // CHECK: define internal void @__main_block_invoke_0 // CHE...
// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s // rdar://10033986 typedef void (^BLOCK)(void); int main () { _Complex double c; BLOCK b = ^() { _Complex double z; z = z + c; }; b(); } // CHECK: define internal void @__main_block_invoke_0 // CHE...
Update skia milestone to next
/* * 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 53 #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 54 #endif
Add a very simple finalizer implementation
// Written by Arthur O'Dwyer #pragma once template <class Lambda> class AtScopeExit { Lambda& m_lambda; public: AtScopeExit(Lambda& action) : m_lambda(action) {} ~AtScopeExit() { m_lambda(); } }; #define Auto_INTERNAL2(lname, aname, ...) \ auto lname = [&]() { __VA_ARGS__; }; \ AtScopeExit<decltype(ln...
Fix build - remove relative import path
/** * Copyright (c) 2015-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. */ #import <U...
/** * Copyright (c) 2015-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. */ #import <U...
Add macros for defining event fields & formats
#ifndef LINUX_POWERPC_PERF_HV_COMMON_H_ #define LINUX_POWERPC_PERF_HV_COMMON_H_ #include <linux/types.h> struct hv_perf_caps { u16 version; u16 collect_privileged:1, ga:1, expanded:1, lab:1, unused:12; }; unsigned long hv_perf_caps_get(struct hv_perf_caps *caps); #endif
#ifndef LINUX_POWERPC_PERF_HV_COMMON_H_ #define LINUX_POWERPC_PERF_HV_COMMON_H_ #include <linux/perf_event.h> #include <linux/types.h> struct hv_perf_caps { u16 version; u16 collect_privileged:1, ga:1, expanded:1, lab:1, unused:12; }; unsigned long hv_perf_caps_get(struct hv_perf_caps *caps); ...
Print the size of the polygon
#include <polygon.h> int main(int argc, char* argv[]) { Polygon lol; lol=createPolygon(); lol=addPoint(lol, createPoint(12.6,-5.3)); lol=addPoint(lol, createPoint(-4.1,456.123)); printf("\n\nx premier point : %f", lol->value.x); printf("\ny premier point : %f\n\n", lol->value.y); printf("\n\nx 2eme point :...
#include <polygon.h> int main(int argc, char* argv[]) { Polygon lol; lol=createPolygon(); lol=addPoint(lol, createPoint(12.6,-5.3)); lol=addPoint(lol, createPoint(-4.1,456.123)); printf("\n\ntaille : %d", lol.size); printf("\n\nx premier point : %f", lol.head->value.x); printf("\ny premier point : %f\n\n",...
Use Apple recommended format for error domain string
#import <Foundation/Foundation.h> #ifndef CMHErrors_h #define CMHErrors_h static NSString *const CMHErrorDomain = @"CMHErrorDomain"; typedef NS_ENUM(NSUInteger, CMHError) { CMHErrorUserMissingConsent = 700, CMHErrorUserMissingSignature = 701, CMHErrorUserDidNotConsent = 702, CMHErrorUse...
#import <Foundation/Foundation.h> #ifndef CMHErrors_h #define CMHErrors_h static NSString *const CMHErrorDomain = @"me.cloudmine.CMHealth.ErrorDomain"; typedef NS_ENUM(NSUInteger, CMHError) { CMHErrorUserMissingConsent = 700, CMHErrorUserMissingSignature = 701, CMHErrorUserDidNotConsent = 7...
Fix interrogate understanding of PY_VERSION_HEX
// Filename: Python.h // Created by: drose (12May00) // //////////////////////////////////////////////////////////////////// // // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // // All use of this software is subject to the terms of the revised BSD // license. You should have ...
// Filename: Python.h // Created by: drose (12May00) // //////////////////////////////////////////////////////////////////// // // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // // All use of this software is subject to the terms of the revised BSD // license. You should have ...
Change example_iwdg to use printf instead of usb_transmit
#include <stdint.h> #include <stdbool.h> #include <stdio.h> #include <stm32f4xx_hal.h> #include <board_driver/usb/usb.h> #include <board_driver/iwdg.h> int main(void) { usb_init(); HAL_Delay(1000); setup_IWDG(); init_IWDG(); char start[] = "Starting\r\n"; usb_transmit(start, sizeof(start)/sizeo...
#include <stdint.h> #include <stdbool.h> #include <stdio.h> #include <stm32f4xx_hal.h> #include <board_driver/usb/usb.h> #include <board_driver/iwdg.h> int main(void) { usb_init(); HAL_Delay(1000); setup_IWDG(); init_IWDG(); printf("Starting\r\n"); while (1) { printf("Hello usb\r\n"); ...
Add a function to remove whole directorys on fatal signal. Doxygenify function comments.
//===- llvm/System/Signals.h - Signal Handling support ----------*- 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/System/Signals.h - Signal Handling support ----------*- 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 outdated function reference in Cairo documentation
/* Copyright 2012-2020 David Robillard <d@drobilla.net> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THIS SOFTWARE IS PROVIDED "AS IS" AND THE ...
/* Copyright 2012-2020 David Robillard <d@drobilla.net> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THIS SOFTWARE IS PROVIDED "AS IS" AND THE ...
Add jack types to dt-bindings
#ifndef __AUDIO_JACK_EVENTS_H #define __AUDIO_JACK_EVENTS_H #define JACK_HEADPHONE 1 #define JACK_MICROPHONE 2 #define JACK_LINEOUT 3 #define JACK_LINEIN 4 #endif /* __AUDIO_JACK_EVENTS_H */
Send simulated keystrokes as a single atomic event
#pragma once #include <Windows.h> class FakeKeyboard { public: static void SimulateKeypress(unsigned short vk) { INPUT input = { 0 }; input.type = INPUT_KEYBOARD; input.ki.wVk = vk; input.ki.wScan = 0; input.ki.dwFlags = 0; input.ki.time = 0; input.ki.dwExtr...
#pragma once #include <Windows.h> class FakeKeyboard { public: static void SimulateKeypress(unsigned short vk) { unsigned int scan = MapVirtualKey(vk, MAPVK_VK_TO_VSC); INPUT input[2]; input[0] = { 0 }; input[0].type = INPUT_KEYBOARD; input[0].ki.wVk = vk; input[0...
Rework idle thread a little
/** * @file * * @date Jul 18, 2013 * @author: Anton Bondarev */ #include <kernel/task.h> #include <kernel/thread.h> #include <kernel/thread/thread_alloc.h> #include <hal/arch.h> /*only for arch_idle */ #include <hal/cpu.h> #include <kernel/cpu/cpu.h> /* * Function, which does nothing. For idle_thread. */ sta...
/** * @file * * @date Jul 18, 2013 * @author: Anton Bondarev */ #include <kernel/task.h> #include <kernel/thread.h> #include <err.h> #include <kernel/thread/thread_alloc.h> #include <hal/arch.h> /*only for arch_idle */ #include <hal/cpu.h> #include <kernel/cpu/cpu.h> /* * Function, which does nothing. For idl...
Allow for loop delays up to 2^4 ms. Allow for baud rates up to 2^32.
#include "ArduinoHeader.h" #include <EEPROMex.h> #include <Logging.h> // Configuration version to determine data integrity. #define CONFIG_VERSION "000" // Size of the configuration block memory pool. #define CONFIG_MEMORY_SIZE 32 // EEPROM size. Bad things will happen if this isn't set correctly. #define CONFIG_EEP...
#include "ArduinoHeader.h" #include <EEPROMex.h> #include <Logging.h> // Configuration version to determine data integrity. #define CONFIG_VERSION "001" // Size of the configuration block memory pool. #define CONFIG_MEMORY_SIZE 32 // EEPROM size. Bad things will happen if this isn't set correctly. #define CONFIG_EEP...
Build structure for contribified Linux-PAM, plus some home-grown modules for FreeBSD's standard authentication methods. Although the Linux-PAM modules are present in the contrib tree, we don't use any of them.
/*- * Copyright 1998 Juniper Networks, Inc. * 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 ...
Set default database to i1
#ifndef CONFIG_H_INCLUDED #define CONFIG_H_INCLUDED #define DBVERSION "0.0.5" #define IDXVERSION "0.0.5" #endif // CONFIG_H_INCLUDED
#ifndef CONFIG_H_INCLUDED #define CONFIG_H_INCLUDED #define DBVERSION "0.0.5" #define IDXVERSION "0.0.5" #define INITDB "i1" #endif // CONFIG_H_INCLUDED
Correct signedness to prevent some warnings.
static inline uint32_t hash_func_string(const char* key) { uint32_t hash = 0; int c; while ((c = *key++) != 0) hash = c + (hash << 6) + (hash << 16) - hash; return hash; }
static inline uint32_t hash_func_string(const char* key) { uint32_t hash = 0; uint32_t c; while ((c = (uint32_t)*key++) != 0) hash = c + (hash << 6u) + (hash << 16u) - hash; return hash; }
Fix typo in a comment: it's base58, not base48.
#ifndef BITCOINADDRESSVALIDATOR_H #define BITCOINADDRESSVALIDATOR_H #include <QValidator> /** Base48 entry widget validator. Corrects near-miss characters and refuses characters that are no part of base48. */ class BitcoinAddressValidator : public QValidator { Q_OBJECT public: explicit BitcoinAddressVali...
#ifndef BITCOINADDRESSVALIDATOR_H #define BITCOINADDRESSVALIDATOR_H #include <QValidator> /** Base58 entry widget validator. Corrects near-miss characters and refuses characters that are not part of base58. */ class BitcoinAddressValidator : public QValidator { Q_OBJECT public: explicit BitcoinAddressVal...