Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Indent better than Videl :)
#include <stdio.h> #include <stdlib.h> #ifndef METADATA_H #define METADATA_H typedef struct Metadata { /** * File's name. */ char md_name[255]; /** * File's extension. */ char md_extension[10]; /** * List of keywords to describe the file. */ char md_keywords[255]; /** * Hash of the content. We use SHA-1 which generates a * 160-bit hash value rendered as 40 digits long in * hexadecimal. */ char md_hash[41]; } Metadata; Metadata *new_metadata(char name[], char extension[], char keywords[], char hash[]); void free_metadata(Metadata *md); Metadata *create_metadata_from_path(char pathFile[1000]); #endif /* METADATA_H */
#include <stdio.h> #include <stdlib.h> #ifndef METADATA_H #define METADATA_H typedef struct Metadata { /** * File's name. */ char md_name[255]; /** * File's extension. */ char md_extension[10]; /** * List of keywords to describe the file. */ char md_keywords[255]; /** * Hash of the content. We use SHA-1 which generates a * 160-bit hash value rendered as 40 digits long in * hexadecimal. */ char md_hash[41]; } Metadata; Metadata *new_metadata(char name[], char extension[], char keywords[], char hash[]); void free_metadata(Metadata *md); Metadata *create_metadata_from_path(char pathFile[1000]); #endif /* METADATA_H */
Move the import controls into a formal protocol
// // NSManagedObject+JSONHelpers.h // // Created by Saul Mora on 6/28/11. // Copyright 2011 Magical Panda Software LLC. All rights reserved. // #import <CoreData/CoreData.h> extern NSString * const kMagicalRecordImportCustomDateFormatKey; extern NSString * const kMagicalRecordImportDefaultDateFormatString; extern NSString * const kMagicalRecordImportUnixTimeString; extern NSString * const kMagicalRecordImportAttributeKeyMapKey; extern NSString * const kMagicalRecordImportAttributeValueClassNameKey; extern NSString * const kMagicalRecordImportRelationshipMapKey; extern NSString * const kMagicalRecordImportRelationshipLinkedByKey; extern NSString * const kMagicalRecordImportRelationshipTypeKey; @interface NSManagedObject (MagicalRecord_DataImport) + (instancetype) MR_importFromObject:(id)data; + (instancetype) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context; @end @interface NSManagedObject (MagicalRecord_DataImportControls) - (BOOL) shouldImport:(id)data; - (void) willImport:(id)data; - (void) didImport:(id)data; @end
// // NSManagedObject+JSONHelpers.h // // Created by Saul Mora on 6/28/11. // Copyright 2011 Magical Panda Software LLC. All rights reserved. // #import <CoreData/CoreData.h> extern NSString * const kMagicalRecordImportCustomDateFormatKey; extern NSString * const kMagicalRecordImportDefaultDateFormatString; extern NSString * const kMagicalRecordImportUnixTimeString; extern NSString * const kMagicalRecordImportAttributeKeyMapKey; extern NSString * const kMagicalRecordImportAttributeValueClassNameKey; extern NSString * const kMagicalRecordImportRelationshipMapKey; extern NSString * const kMagicalRecordImportRelationshipLinkedByKey; extern NSString * const kMagicalRecordImportRelationshipTypeKey; @protocol MagicalRecordDataImportProtocol <NSObject> @optional - (BOOL) shouldImport:(id)data; - (void) willImport:(id)data; - (void) didImport:(id)data; @end @interface NSManagedObject (MagicalRecord_DataImport) <MagicalRecordDataImportProtocol> + (instancetype) MR_importFromObject:(id)data; + (instancetype) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData; + (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context; @end
Add ACPI CPU Data include file
/** @file Definitions for CPU S3 data. Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef _ACPI_CPU_DATA_H_ #define _ACPI_CPU_DATA_H_ // // Register types in register table // typedef enum _REGISTER_TYPE { Msr, ControlRegister, MemoryMapped, CacheControl } REGISTER_TYPE; // // Element of register table entry // typedef struct { REGISTER_TYPE RegisterType; UINT32 Index; UINT8 ValidBitStart; UINT8 ValidBitLength; UINT64 Value; } CPU_REGISTER_TABLE_ENTRY; // // Register table definition, including current table length, // allocated size of this table, and pointer to the list of table entries. // typedef struct { UINT32 TableLength; UINT32 NumberBeforeReset; UINT32 AllocatedSize; UINT32 InitialApicId; CPU_REGISTER_TABLE_ENTRY *RegisterTableEntry; } CPU_REGISTER_TABLE; typedef struct { EFI_PHYSICAL_ADDRESS StartupVector; EFI_PHYSICAL_ADDRESS GdtrProfile; EFI_PHYSICAL_ADDRESS IdtrProfile; EFI_PHYSICAL_ADDRESS StackAddress; UINT32 StackSize; UINT32 NumberOfCpus; EFI_PHYSICAL_ADDRESS MtrrTable; // // Physical address of a CPU_REGISTER_TABLE structure // EFI_PHYSICAL_ADDRESS PreSmmInitRegisterTable; // // Physical address of a CPU_REGISTER_TABLE structure // EFI_PHYSICAL_ADDRESS RegisterTable; EFI_PHYSICAL_ADDRESS ApMachineCheckHandlerBase; UINT32 ApMachineCheckHandlerSize; } ACPI_CPU_DATA; #endif
Fix a warning about implicit function declaration.
/// /// \file cleanup.h /// \brief Functions to clean up memory /// \defgroup cleanup Memory Cleanup /// \brief Frees memory before loading /// @{ /// #ifndef UVL_CLEANUP #define UVL_CLEANUP #include "types.h" int uvl_cleanup_memory (); int uvl_unload_all_modules (); #endif /// @}
/// /// \file cleanup.h /// \brief Functions to clean up memory /// \defgroup cleanup Memory Cleanup /// \brief Frees memory before loading /// @{ /// #ifndef UVL_CLEANUP #define UVL_CLEANUP #include "types.h" int uvl_cleanup_memory (); int uvl_unload_all_modules(); void uvl_pre_clean(); #endif /// @}
Reimplement no-op version of DLOG to avoid C++ compiler warning
#pragma once #include <iostream> // The same as assert, but expression is always evaluated and result returned #define CHECK(expr) (assert(expr), expr) #if !defined(NDEBUG) // Debug namespace dev { namespace evmjit { std::ostream& getLogStream(char const* _channel); } } #define DLOG(CHANNEL) ::dev::evmjit::getLogStream(#CHANNEL) #else // Release #define DLOG(CHANNEL) true ? std::cerr : std::cerr #endif
#pragma once #include <iostream> // The same as assert, but expression is always evaluated and result returned #define CHECK(expr) (assert(expr), expr) #if !defined(NDEBUG) // Debug namespace dev { namespace evmjit { std::ostream& getLogStream(char const* _channel); } } #define DLOG(CHANNEL) ::dev::evmjit::getLogStream(#CHANNEL) #else // Release namespace dev { namespace evmjit { struct Voider { void operator=(std::ostream const&) {} }; } } #define DLOG(CHANNEL) true ? (void)0 : ::dev::evmjit::Voider{} = std::cerr #endif
Add simple test (proof of working) for double linked list api.
//tests for linked lists tasks from the "Cracking The Coding Interview". #include <assert.h> #include <stdbool.h> int main() { assert(false && "First unit test"); return 0; }
//tests for linked lists tasks from the "Cracking The Coding Interview". #include <assert.h> #include <stdbool.h> #include "../../c_double_linked_list/double_linked_list.h" int main() { struct Node* h = initHeadNode(0); printList(h); clear(h); return 0; }
Add forgotten PBE epsilon header.
#ifndef PBEC_EPS_H #define PBEC_EPS_H #include "functional.h" #include "constants.h" #include "pw92eps.h" #include "vwn.h" namespace pbec_eps { template<class num, class T> static num A(const num &eps, const T &u3) { using xc_constants::param_beta_gamma; using xc_constants::param_gamma; return param_beta_gamma/expm1(-eps/(param_gamma*u3)); } template<class num, class T> static num H(const num &d2, const num &eps, const T &u3) { num d2A = d2*A(eps,u3); using xc_constants::param_gamma; using xc_constants::param_beta_gamma; return param_gamma*u3* log(1+param_beta_gamma*d2*(1 + d2A)/(1+d2A*(1+d2A))); } // This is [(1+zeta)^(2/3) + (1-zeta)^(2/3)]/2, reorganized. template<class num> static num phi(const densvars<num> &d) { return pow(2.0,-1.0/3.0)*d.n_m13*d.n_m13*(sqrt(d.a_43)+sqrt(d.b_43)); } template<class num> static num pbec_eps(const densvars<num> &d) { num eps = pw92eps::pw92eps(d); num u = phi(d); // Avoiding the square root of d.gnn here num d2 = pow(1.0/12*pow(3,5.0/6.0)/pow(M_PI,-1.0/6),2)* d.gnn/(u*u*pow(d.n,7.0/3.0)); return (eps + H(d2,eps,pow3(u))); } template<class num> static num pbec_eps_polarized(const num &a, const num &gaa) { num eps = pw92eps::pw92eps_polarized(a); parameter u = pow(2.0,-1.0/3.0); //phi(d) for alpha or beta density =0 // Avoiding the square root of d.gnn here num d2 = pow(1.0/12*pow(3,5.0/6.0)/pow(M_PI,-1.0/6),2)* gaa/(u*u*pow(a,7.0/3.0)); return (eps + H(d2,eps,pow3(u))); } } #endif
Update driver version to 5.04.00-k4
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.04.00-k3"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.04.00-k4"
Add common header - just has branch prediction hint macros for now
#pragma once // Branch prediction hints #define LIKELY(condition) __builtin_expect(static_cast<bool>(condition), 1) #define UNLIKELY(condition) __builtin_expect(static_cast<bool>(condition), 0)
Solve Fuel Spent in c
#include <math.h> #include <stdio.h> int main() { float h, s; scanf("%f", &h); scanf("%f", &s); printf("%.3f\n", h * s / 12.0); }
Modify the adapter version number.
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #import <Foundation/Foundation.h> /// Mintegral mediation adapter version. static NSString *const GADMAdapterMintegralVersion = @"7.2.1.0"; /// Mintegral mediation adapter Mintegral App ID parameter key. static NSString *const GADMAdapterMintegralAppID = @"app_id"; /// Mintegral mediation adapter Mintegral App Key parameter key. static NSString *const GADMAdapterMintegralAppKey = @"app_key"; /// Mintegral mediation adapter Ad Unit ID parameter key. static NSString *const GADMAdapterMintegralAdUnitID = @"ad_unit_id"; /// Mintegral mediation adapter Ad Placement ID parameter key. static NSString *const GADMAdapterMintegralPlacementID = @"placement_id"; /// Mintegral adapter error domain. static NSString *const GADMAdapterMintegralErrorDomain = @"com.google.mediation.mintegral";
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #import <Foundation/Foundation.h> /// Mintegral mediation adapter version. static NSString *const GADMAdapterMintegralVersion = @"7.2.4.0"; /// Mintegral mediation adapter Mintegral App ID parameter key. static NSString *const GADMAdapterMintegralAppID = @"app_id"; /// Mintegral mediation adapter Mintegral App Key parameter key. static NSString *const GADMAdapterMintegralAppKey = @"app_key"; /// Mintegral mediation adapter Ad Unit ID parameter key. static NSString *const GADMAdapterMintegralAdUnitID = @"ad_unit_id"; /// Mintegral mediation adapter Ad Placement ID parameter key. static NSString *const GADMAdapterMintegralPlacementID = @"placement_id"; /// Mintegral adapter error domain. static NSString *const GADMAdapterMintegralErrorDomain = @"com.google.mediation.mintegral";
Include device in the LDM headers
/* * This file is part of linux-driver-management. * * Copyright © 2016-2017 Ikey Doherty * * linux-driver-management 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 later version. */ #pragma once #include <manager.h> /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=8 tabstop=8 expandtab: * :indentSize=8:tabSize=8:noTabs=true: */
/* * This file is part of linux-driver-management. * * Copyright © 2016-2017 Ikey Doherty * * linux-driver-management 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 later version. */ #pragma once #include <device.h> #include <manager.h> /* * Editor modelines - https://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 8 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=8 tabstop=8 expandtab: * :indentSize=8:tabSize=8:noTabs=true: */
Sort headers in alphabetical order
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Header file containing strided array macros. */ #ifndef STDLIB_STRIDED_MACROS_H #define STDLIB_STRIDED_MACROS_H #include "strided_nullary_macros.h" #include "strided_unary_macros.h" #include "strided_binary_macros.h" #include "strided_ternary_macros.h" #include "strided_quaternary_macros.h" #include "strided_quinary_macros.h" #endif // !STDLIB_STRIDED_MACROS_H
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Header file containing strided array macros. */ #ifndef STDLIB_STRIDED_MACROS_H #define STDLIB_STRIDED_MACROS_H // Note: keep in alphabetical order... #include "strided_binary_macros.h" #include "strided_nullary_macros.h" #include "strided_quaternary_macros.h" #include "strided_quinary_macros.h" #include "strided_ternary_macros.h" #include "strided_unary_macros.h" #endif // !STDLIB_STRIDED_MACROS_H
Fix build on non-OSX due to missing parameter name.
/* * consumer_sdl_osx.m -- An OS X compatibility shim for SDL * Copyright (C) 2010 Ushodaya Enterprises Limited * Author: Dan Dennedy * * 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 later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _CONSUMER_SDL_OSX_H_ #define _CONSUMER_SDL_OSX_H_ #ifdef __DARWIN__ void* mlt_cocoa_autorelease_init(); void mlt_cocoa_autorelease_close( void* ); #else static inline void *mlt_cocoa_autorelease_init() { return NULL; } static inline void mlt_cocoa_autorelease_close(void*) { } #endif #endif
/* * consumer_sdl_osx.m -- An OS X compatibility shim for SDL * Copyright (C) 2010 Ushodaya Enterprises Limited * Author: Dan Dennedy * * 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 later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _CONSUMER_SDL_OSX_H_ #define _CONSUMER_SDL_OSX_H_ #ifdef __DARWIN__ void* mlt_cocoa_autorelease_init(); void mlt_cocoa_autorelease_close( void* ); #else static inline void *mlt_cocoa_autorelease_init() { return NULL; } static inline void mlt_cocoa_autorelease_close(void* p) { } #endif #endif
Fix issues pointed out in review
#ifndef CROWN_PLATFORM_GOVERNANCE_H #define CROWN_PLATFORM_GOVERNANCE_H #include "primitives/transaction.h" #include "uint256.h" #include <boost/function.hpp> #include <vector> namespace Platform { class Vote { public: enum Value { abstain = 0, yes, no }; CTxIn voterId; int64_t electionCode; uint256 candidate; Value value; std::vector<unsigned char> signature; }; class VotingRound { public: virtual void RegisterCandidate(uint256 id) = 0; virtual void AcceptVote(const Vote& vote) = 0; virtual std::vector<uint256> CalculateResult() const = 0; virtual void NotifyResultChange( boost::function<void(uint256)> onElected, boost::function<void(uint256)> onDismissed ) = 0; }; VotingRound& AgentsVoting(); } #endif //CROWN_PLATFORM_GOVERNANCE_H
#ifndef CROWN_PLATFORM_GOVERNANCE_H #define CROWN_PLATFORM_GOVERNANCE_H #include "primitives/transaction.h" #include "uint256.h" #include <boost/function.hpp> #include <vector> namespace Platform { class Vote { public: enum Value { abstain = 0, yes, no }; CTxIn voterId; int64_t electionCode; uint256 candidate; Value value; std::vector<unsigned char> signature; }; class VotingRound { public: virtual ~VotingRound() = default; virtual void RegisterCandidate(uint256 id) = 0; virtual void AcceptVote(const Vote& vote) = 0; virtual std::vector<uint256> CalculateResult() const = 0; virtual void NotifyResultChange( boost::function<void(uint256)> onElected, boost::function<void(uint256)> onDismissed ) = 0; }; VotingRound& AgentsVoting(); } #endif //CROWN_PLATFORM_GOVERNANCE_H
Adjust testcase for recent DWARF printer changes.
// RUN: %clang -ccc-host-triple i386-apple-darwin10 -S -g -dA %s -o - | FileCheck %s int global; // CHECK: asciz "global" ## DW_AT_name int main() { return 0;}
// RUN: %clang -ccc-host-triple i386-apple-darwin10 -S -g -dA %s -o - | FileCheck %s int global; // CHECK: asciz "global" ## External Name int main() { return 0;}
Add example for warning ranking.
// PARAM: --set ana.activated[+] "'region'" #include<pthread.h> #include<stdlib.h> #include<stdio.h> struct s { int datum; struct s *next; } *A, *B; struct s *new(int x) { struct s *p = malloc(sizeof(struct s)); p->datum = x; p->next = NULL; return p; } pthread_mutex_t A_mutex = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t B_mutex = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&A_mutex); A->datum++; // RACE <-- this line is also relevant. pthread_mutex_unlock(&A_mutex); pthread_mutex_lock(&B_mutex); B->datum++; // <-- this is not relevant at all. pthread_mutex_unlock(&B_mutex); return NULL; } int main () { pthread_t t1; A = new(3); B = new(5); pthread_create(&t1, NULL, t_fun, NULL); int *data; pthread_mutex_lock(&A_mutex); data = &A->datum; // NORACE pthread_mutex_unlock(&A_mutex); *data = 42; // RACE <-- this is the real bug! return 0; }
Change unsigned int to uint32_t.
static inline unsigned int hash_func_string(const char* key) { unsigned int 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; int c; while ((c = *key++) != 0) hash = c + (hash << 6) + (hash << 16) - hash; return hash; }
Fix 'unused variable' warning on fast build
#include <stdio.h> #include "../slice.h" #include "../assert.h" #include "../nelem.h" int main( void ) { int const xs[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; printf( "Testing subset slice...\n" ); int const ws[] = { SLICE( xs, 3, 4 ) }; ASSERT( NELEM( ws ) == 4, ws[ 0 ] == xs[ 3 ], ws[ 1 ] == xs[ 4 ], ws[ 2 ] == xs[ 5 ], ws[ 3 ] == xs[ 6 ] ); printf( "Testing total slice...\n" ); int const ys[] = { SLICE( xs, 0, 6 ) }; ASSERT( NELEM( ys ) == 6, ys[ 0 ] == xs[ 0 ], ys[ 1 ] == xs[ 1 ], ys[ 2 ] == xs[ 2 ], ys[ 3 ] == xs[ 3 ], ys[ 4 ] == xs[ 4 ], ys[ 5 ] == xs[ 5 ] ); printf( "Testing empty slice...\n" ); int const zs[] = { 0, SLICE( xs, 2, 0 ) }; ASSERT( NELEM( zs ) == 1 ); printf( "SLICE() tests passed.\n" ); }
#include <stdio.h> #include "../slice.h" #include "../assert.h" #include "../nelem.h" int main( void ) { int const xs[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; printf( "Testing subset slice...\n" ); int const ws[] = { SLICE( xs, 3, 4 ) }; ASSERT( NELEM( ws ) == 4, ws[ 0 ] == xs[ 3 ], ws[ 1 ] == xs[ 4 ], ws[ 2 ] == xs[ 5 ], ws[ 3 ] == xs[ 6 ] ); ( void ) ws; printf( "Testing total slice...\n" ); int const ys[] = { SLICE( xs, 0, 6 ) }; ASSERT( NELEM( ys ) == 6, ys[ 0 ] == xs[ 0 ], ys[ 1 ] == xs[ 1 ], ys[ 2 ] == xs[ 2 ], ys[ 3 ] == xs[ 3 ], ys[ 4 ] == xs[ 4 ], ys[ 5 ] == xs[ 5 ] ); ( void ) ys; printf( "Testing empty slice...\n" ); int const zs[] = { 0, SLICE( xs, 2, 0 ) }; ASSERT( NELEM( zs ) == 1 ); ( void ) zs; printf( "SLICE() tests passed.\n" ); }
Fix include path for ofp_config.h
/* Copyright (c) 2015, ENEA Software AB * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef _OFPI_CONFIG_H_ #define _OFPI_CONFIG_H_ #include "ofp_config.h" #define ARP_SANITY_CHECK 1 #endif
/* Copyright (c) 2015, ENEA Software AB * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef _OFPI_CONFIG_H_ #define _OFPI_CONFIG_H_ #include "api/ofp_config.h" #define ARP_SANITY_CHECK 1 #endif
Fix python link in release build.
#ifndef SOFAPYTHON_PYTHON_H #define SOFAPYTHON_PYTHON_H // This header simply includes Python.h, taking care of platform-specific stuff // It should be included before any standard headers: // "Since Python may define some pre-processor definitions which affect the // standard headers on some systems, you must include Python.h before any // standard headers are included." #if defined(_WIN32) # define MS_NO_COREDLL // deactivate pragma linking on Win32 done in Python.h #endif #if defined(_MSC_VER) && defined(_DEBUG) // undefine _DEBUG since we want to always link agains the release version of // python and pyconfig.h automatically links debug version if _DEBUG is defined. // ocarre: no we don't, in debug on Windows we cannot link with python release, if we want to build SofaPython in debug we have to compile python in debug //# undef _DEBUG # include <Python.h> //# define _DEBUG #elif defined(__APPLE__) && defined(__MACH__) # include <Python/Python.h> #else # include <Python.h> #endif #endif
#ifndef SOFAPYTHON_PYTHON_H #define SOFAPYTHON_PYTHON_H // This header simply includes Python.h, taking care of platform-specific stuff // It should be included before any standard headers: // "Since Python may define some pre-processor definitions which affect the // standard headers on some systems, you must include Python.h before any // standard headers are included." #if defined(_WIN32) # define MS_NO_COREDLL // deactivate pragma linking on Win32 done in Python.h # define Py_ENABLE_SHARED 1 // this flag ensure to use dll's version (needed because of MS_NO_COREDLL define). #endif #if defined(_MSC_VER) && defined(_DEBUG) // if you use Python on windows in debug build, be sure to provide a compiled version because // installation package doesn't come with debug libs. # include <Python.h> #elif defined(__APPLE__) && defined(__MACH__) # include <Python/Python.h> #else # include <Python.h> #endif #endif
Use boost::atomic if C++ compiler older than 201103.
/* ******************************************************************************* * * Purpose: Utils. Atomic types helper. * ******************************************************************************* * Copyright Monstrenyatko 2014. * * Distributed under the MIT License. * (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT) ******************************************************************************* */ #ifndef UTILS_ATOMIC_H_ #define UTILS_ATOMIC_H_ #ifndef __has_feature #define __has_feature(__x) 0 #endif #if __has_feature(cxx_atomic) #include <atomic> #else #include <boost/atomic.hpp> #define UTILS_USE_BOOST_ATOMIC #endif namespace Utils { #ifdef UTILS_USE_BOOST_ATOMIC typedef boost::atomic_bool atomic_bool; typedef boost::atomic_uint32_t atomic_uint32_t; #else typedef std::atomic_bool atomic_bool; typedef std::atomic<uint32_t> atomic_uint32_t; #endif } /* namespace Utils */ #endif /* UTILS_ATOMIC_H_ */
/* ******************************************************************************* * * Purpose: Utils. Atomic types helper. * ******************************************************************************* * Copyright Monstrenyatko 2014. * * Distributed under the MIT License. * (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT) ******************************************************************************* */ #ifndef UTILS_ATOMIC_H_ #define UTILS_ATOMIC_H_ #ifndef __has_feature #define __has_feature(__x) 0 #endif #if __cplusplus < 201103L #include <boost/atomic.hpp> #define UTILS_USE_BOOST_ATOMIC #else #include <atomic> #endif namespace Utils { #ifdef UTILS_USE_BOOST_ATOMIC typedef boost::atomic_bool atomic_bool; typedef boost::atomic_uint32_t atomic_uint32_t; #else typedef std::atomic_bool atomic_bool; typedef std::atomic<uint32_t> atomic_uint32_t; #endif } /* namespace Utils */ #endif /* UTILS_ATOMIC_H_ */
Fix mismatched delete due to missing virtual destructor
//===-- RemarkParserImpl.h - Implementation details -------------*- C++/-*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file provides implementation details for the remark parser. // //===----------------------------------------------------------------------===// #ifndef LLVM_REMARKS_REMARK_PARSER_IMPL_H #define LLVM_REMARKS_REMARK_PARSER_IMPL_H namespace llvm { namespace remarks { /// This is used as a base for any parser implementation. struct ParserImpl { enum class Kind { YAML }; // The parser kind. This is used as a tag to safely cast between // implementations. Kind ParserKind; }; } // end namespace remarks } // end namespace llvm #endif /* LLVM_REMARKS_REMARK_PARSER_IMPL_H */
//===-- RemarkParserImpl.h - Implementation details -------------*- C++/-*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file provides implementation details for the remark parser. // //===----------------------------------------------------------------------===// #ifndef LLVM_REMARKS_REMARK_PARSER_IMPL_H #define LLVM_REMARKS_REMARK_PARSER_IMPL_H namespace llvm { namespace remarks { /// This is used as a base for any parser implementation. struct ParserImpl { enum class Kind { YAML }; explicit ParserImpl(Kind TheParserKind) : ParserKind(TheParserKind) {} // Virtual destructor prevents mismatched deletes virtual ~ParserImpl() {} // The parser kind. This is used as a tag to safely cast between // implementations. Kind ParserKind; }; } // end namespace remarks } // end namespace llvm #endif /* LLVM_REMARKS_REMARK_PARSER_IMPL_H */
Handle initialization of change detection variables in a more sane way. No more false positives of changes on startup.
#pragma once #include <chrono> #include <string> enum class ref_src_t { FILE, AIRCRAFT, PLUGIN, USER_MSG, BLACKLIST, }; /// Superclass defining some common interface items for dataref and commandref. class RefRecord { protected: std::string name; ref_src_t source; std::chrono::system_clock::time_point last_updated; std::chrono::system_clock::time_point last_updated_big; RefRecord(const std::string & name, ref_src_t source) : name(name), source(source), last_updated(std::chrono::system_clock::now()) {} public: virtual ~RefRecord() {} const std::string & getName() const { return name; } ref_src_t getSource() const { return source; } virtual std::string getDisplayString(size_t display_length) const = 0; bool isBlacklisted() const { return ref_src_t::BLACKLIST == source; } const std::chrono::system_clock::time_point & getLastUpdateTime() const { return last_updated; } const std::chrono::system_clock::time_point & getLastBigUpdateTime() const { return last_updated_big; } };
#pragma once #include <chrono> #include <string> enum class ref_src_t { FILE, AIRCRAFT, PLUGIN, USER_MSG, BLACKLIST, }; /// Superclass defining some common interface items for dataref and commandref. class RefRecord { protected: std::string name; ref_src_t source; std::chrono::system_clock::time_point last_updated; std::chrono::system_clock::time_point last_updated_big; RefRecord(const std::string & name, ref_src_t source) : name(name), source(source), last_updated(std::chrono::system_clock::from_time_t(0)), last_updated_big(std::chrono::system_clock::from_time_t(0)) {} public: virtual ~RefRecord() {} const std::string & getName() const { return name; } ref_src_t getSource() const { return source; } virtual std::string getDisplayString(size_t display_length) const = 0; bool isBlacklisted() const { return ref_src_t::BLACKLIST == source; } const std::chrono::system_clock::time_point & getLastUpdateTime() const { return last_updated; } const std::chrono::system_clock::time_point & getLastBigUpdateTime() const { return last_updated_big; } };
Add in the missing header.
/**************************************************************************** * * Copyright (C) 2013 PX4 Development Team. 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 conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name PX4 nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ /** * @file Airspeed driver interface. */ #ifndef _DRV_AIRSPEED_H #define _DRV_AIRSPEED_H #include <stdint.h> #include <sys/ioctl.h> #include "drv_sensor.h" #include "drv_orb_dev.h" #define AIRSPEED_DEVICE_PATH "/dev/airspeed" /** * Airspeed report structure. Reads from the device must be in multiples of this * structure. */ struct airspeed_report { uint64_t timestamp; uint8_t speed; /** in meters/sec */ }; /* * ObjDev tag for raw range finder data. */ ORB_DECLARE(sensor_differential_pressure); /* * ioctl() definitions * * Airspeed drivers also implement the generic sensor driver * interfaces from drv_sensor.h */ #define _AIRSPEEDIOCBASE (0x7700) #define __AIRSPEEDIOC(_n) (_IOC(_AIRSPEEDIOCBASE, _n)) #endif /* _DRV_AIRSPEED_H */
Add the backend class/functions for using GIT within lumina-fm.
//=========================================== // Lumina-DE source code // Copyright (c) 2016, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== // This is the backend classe for interacting with the "git" utility //=========================================== #ifdef _LUMINA_FM_GIT_COMPAT_H #define _LUMINA_FM_GIT_COMPAT_H #include <QProcess> #include <QString> #include <QProcessEnvironment> #include <LuminaUtils.h> class GIT{ public: //Check if the git utility is installed and available static bool isAvailable(){ QString bin = "git" return isValidBinary(bin); } //Return if the current directory is a git repository static bool isRepo(QString dir){ QProcess P; P.setProcessEnvironment(QProcessEnvironment::systemEnvironment()); P.setWorkingDirectory(dir); P.exec("git",QStringList() <<"status" << "--porcelain" ); return (0==P.exitCode()); } //Return the current status of the repository static QString status(QString dir){ QProcess P; P.setProcessEnvironment(QProcessEnvironment::systemEnvironment()); P.setWorkingDirectory(dir); P.setProcessChannelMode(QProcess::MergedChannels); P.exec("git",QStringList() <<"status" ); return P.readAllStandardOutput(); } //Setup a process for running the clone operation (so the calling process can hook up any watchers and start it when ready) static QProcess setupClone(QString indir, QString url, QString branch = "", int depth = -1){ QProcess P; P.setProcessEnvironment( QProcessEnvironment::systemEnvironment() ); P.setWorkingDirectory(indir); P.setProgram("git"); QStringList args; args << "clone"; if(!branch.isEmpty()){ args << "-b" << branch; } if(depth>0){ args << "--depth" << QString::number(depth); } args << url; P.setArguments(args); return P; } }; #endif
Add testcase for incomplete call/return types for calls.
// RUN: clang -fsyntax-only -verify %s struct foo; // expected-note 3 {{forward declaration of 'struct foo'}} struct foo a(); void b(struct foo); void c(); void func() { a(); // expected-error{{return type of called function ('struct foo') is incomplete}} b(*(struct foo*)0); // expected-error{{argument type 'struct foo' is incomplete}} c(*(struct foo*)0); // expected-error{{argument type 'struct foo' is incomplete}} }
Include every single file in the vulkan update.
/* * * Copyright (c) 2016 The Khronos Group Inc. * Copyright (c) 2016 Valve Corporation * Copyright (c) 2016 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Author: Mark Lobodzinski <mark@lunarg.com> * */ #pragma once // Linked list node for tree of debug callback functions typedef struct VkLayerDbgFunctionNode_ { VkDebugReportCallbackEXT msgCallback; PFN_vkDebugReportCallbackEXT pfnMsgCallback; VkFlags msgFlags; void *pUserData; struct VkLayerDbgFunctionNode_ *pNext; } VkLayerDbgFunctionNode;
Convert BUG() to use unreachable()
#ifndef _ALPHA_BUG_H #define _ALPHA_BUG_H #include <linux/linkage.h> #ifdef CONFIG_BUG #include <asm/pal.h> /* ??? Would be nice to use .gprel32 here, but we can't be sure that the function loaded the GP, so this could fail in modules. */ #define BUG() do { \ __asm__ __volatile__( \ "call_pal %0 # bugchk\n\t" \ ".long %1\n\t.8byte %2" \ : : "i"(PAL_bugchk), "i"(__LINE__), "i"(__FILE__)); \ for ( ; ; ); } while (0) #define HAVE_ARCH_BUG #endif #include <asm-generic/bug.h> #endif
#ifndef _ALPHA_BUG_H #define _ALPHA_BUG_H #include <linux/linkage.h> #ifdef CONFIG_BUG #include <asm/pal.h> /* ??? Would be nice to use .gprel32 here, but we can't be sure that the function loaded the GP, so this could fail in modules. */ #define BUG() do { \ __asm__ __volatile__( \ "call_pal %0 # bugchk\n\t" \ ".long %1\n\t.8byte %2" \ : : "i"(PAL_bugchk), "i"(__LINE__), "i"(__FILE__)); \ unreachable(); \ } while (0) #define HAVE_ARCH_BUG #endif #include <asm-generic/bug.h> #endif
Update platforms/* with Eliot's fixes for 64-bit clean AsyncPlugin.
/* Header file for AsynchFile plugin */ /* module initialization/shutdown */ int asyncFileInit(void); int asyncFileShutdown(void); /*** Experimental Asynchronous File I/O ***/ typedef struct { int sessionID; void *state; } AsyncFile; int asyncFileClose(AsyncFile *f); int asyncFileOpen(AsyncFile *f, long fileNamePtr, int fileNameSize, int writeFlag, int semaIndex); int asyncFileRecordSize(); int asyncFileReadResult(AsyncFile *f, long bufferPtr, int bufferSize); int asyncFileReadStart(AsyncFile *f, int fPosition, int count); int asyncFileWriteResult(AsyncFile *f); int asyncFileWriteStart(AsyncFile *f, int fPosition, long bufferPtr, int bufferSize);
/* Header file for AsynchFile plugin */ /* module initialization/shutdown */ int asyncFileInit(void); int asyncFileShutdown(void); /*** Experimental Asynchronous File I/O ***/ typedef struct { int sessionID; void *state; } AsyncFile; int asyncFileClose(AsyncFile *f); int asyncFileOpen(AsyncFile *f, char *fileNamePtr, int fileNameSize, int writeFlag, int semaIndex); int asyncFileRecordSize(); int asyncFileReadResult(AsyncFile *f, void *bufferPtr, int bufferSize); int asyncFileReadStart(AsyncFile *f, int fPosition, int count); int asyncFileWriteResult(AsyncFile *f); int asyncFileWriteStart(AsyncFile *f, int fPosition, void *bufferPtr, int bufferSize);
Initialize the world state to zero
#include <badgewars.h> #include <stdio.h> /* Initialize the BadgeWars world */ void bw_init(struct bw_world *world) { puts("bw_init requested"); } /* Run the BadgeWars world for a single instruction */ int bw_run(struct bw_world *world) { puts("bw_run requested"); return 0; } /* Receive a BadgeWars command from the outside world */ void bw_receive(struct bw_world *world, OPCODE command, void *addr, void(*send_response)(int, void *)) { printf("bw_receive got op: %d\n", command.op); } /* Peek into the core state */ CELL bw_peek(struct bw_world *world, CELLPTR addr) { printf("bw_peek(%d) called\n", addr); return 0; }
#include <badgewars.h> #include <string.h> /* Initialize the BadgeWars world */ void bw_init(struct bw_world *world) { memset(&world->core, 0, sizeof(world->core)); world->queue_head = world->queue_tail = 0; } /* Run the BadgeWars world for a single instruction */ int bw_run(struct bw_world *world) { return 0; } /* Receive a BadgeWars command from the outside world */ void bw_receive(struct bw_world *world, OPCODE command, void *addr, void(*send_response)(int, void *)) { } /* Peek into the core state */ CELL bw_peek(struct bw_world *world, CELLPTR addr) { return world->core[addr]; }
Add third_party/ prefix to ppapi include for checkdeps.
// Copyright (c) 2010 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 WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #include "ppapi/c/pp_var.h" #define PPB_PRIVATE_INTERFACE "PPB_Private;1" typedef enum _ppb_ResourceString { PPB_RESOURCE_STRING_PDF_GET_PASSWORD = 0, } PP_ResourceString; typedef struct _ppb_Private { // Returns a localized string. PP_Var (*GetLocalizedString)(PP_ResourceString string_id); } PPB_Private; #endif // WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
// Copyright (c) 2010 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 WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #define WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_ #include "third_party/ppapi/c/pp_var.h" #define PPB_PRIVATE_INTERFACE "PPB_Private;1" typedef enum _ppb_ResourceString { PPB_RESOURCE_STRING_PDF_GET_PASSWORD = 0, } PP_ResourceString; typedef struct _ppb_Private { // Returns a localized string. PP_Var (*GetLocalizedString)(PP_ResourceString string_id); } PPB_Private; #endif // WEBKIT_GLUE_PLUGINS_PPB_PRIVATE_H_
Add TODO to replace ratpoison.
/* Copyright (c) 2013 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. * * Maps and raises the specified window id (integer). */ #include <X11/Xlib.h> #include <stdlib.h> int main(int argc, char** argv) { if (argc != 2) return 2; Display* display = XOpenDisplay(NULL); if (!display) return 1; XMapRaised(display, atoi(argv[1])); XCloseDisplay(display); return 0; }
/* Copyright (c) 2013 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. * * Maps and raises the specified window id (integer). */ /* TODO: use XResizeWindow to do the +1 width ratpoison hack. * And at this point, we might as well use XMoveResizeWindow, rename this to * wmtool and unmap the previously-mapped window, and perhaps call the * equivalent of XRefresh, eliminating the need for ratpoison entirely (!!). */ #include <X11/Xlib.h> #include <stdlib.h> int main(int argc, char** argv) { if (argc != 2) return 2; Display* display = XOpenDisplay(NULL); if (!display) return 1; XMapRaised(display, atoi(argv[1])); XCloseDisplay(display); return 0; }
Remove debug print hook function
#include <zephyr.h> #include <init.h> #include <posix/time.h> #include <csp/csp_debug.h> #include <logging/log.h> LOG_MODULE_REGISTER(libcsp); static void hook_func(csp_debug_level_t level, const char * format, va_list args) { uint32_t args_num = log_count_args(format); switch (level) { case CSP_ERROR: Z_LOG_VA(LOG_LEVEL_ERR, format, args, args_num, LOG_STRDUP_EXEC); break; case CSP_WARN: Z_LOG_VA(LOG_LEVEL_WRN, format, args, args_num, LOG_STRDUP_EXEC); break; default: Z_LOG_VA(LOG_LEVEL_INF, format, args, args_num, LOG_STRDUP_EXEC); break; } } static int libcsp_zephyr_init(const struct device * unused) { csp_debug_hook_set(hook_func); struct timespec ts = { .tv_sec = 946652400, .tv_nsec = 0, }; clock_settime(CLOCK_REALTIME, &ts); return 0; } SYS_INIT(libcsp_zephyr_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);
#include <zephyr.h> #include <init.h> #include <posix/time.h> #include <csp/csp_debug.h> #include <logging/log.h> LOG_MODULE_REGISTER(libcsp); } static int libcsp_zephyr_init(const struct device * unused) { struct timespec ts = { .tv_sec = 946652400, .tv_nsec = 0, }; clock_settime(CLOCK_REALTIME, &ts); return 0; } SYS_INIT(libcsp_zephyr_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);
Make the run loop and queue @public until we enhance the scheduler API
// // AFNetworkEnvironment.h // CoreNetworking // // Created by Keith Duncan on 05/01/2013. // Copyright (c) 2013 Keith Duncan. All rights reserved. // #import <Foundation/Foundation.h> #import "CoreNetworking/AFNetwork-Macros.h" /*! \brief Schedule environment for run loop and dispatch */ @interface AFNetworkSchedule : NSObject { @package NSRunLoop *_runLoop; NSString *_runLoopMode; void *_dispatchQueue; } - (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode; - (void)scheduleInQueue:(dispatch_queue_t)queue; @end
// // AFNetworkEnvironment.h // CoreNetworking // // Created by Keith Duncan on 05/01/2013. // Copyright (c) 2013 Keith Duncan. All rights reserved. // #import <Foundation/Foundation.h> #import "CoreNetworking/AFNetwork-Macros.h" /*! \brief Schedule environment for run loop and dispatch */ @interface AFNetworkSchedule : NSObject { @public NSRunLoop *_runLoop; NSString *_runLoopMode; void *_dispatchQueue; } - (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode; - (void)scheduleInQueue:(dispatch_queue_t)queue; @end
Add detection for whatever silly protector new malware was using.
/* * Header file for the definitions of packers/protectors * * Tim "diff" Strazzere <strazz@gmail.com> */ typedef struct { char* name; char* description; char* filter; char* marker; } packer; static packer packers[] = { // APKProtect { "APKProtect v1->5", "APKProtect generialized detection", // This is actually the filter APKProtect uses itself for finding it's own odex to modify ".apk@", "/libAPKProtect" }, // LIAPP { "LIAPP 'Egg' (v1->?)", "LockIn APP (lockincomp.com)", "LIAPPEgg.dex", "/LIAPPEgg" }, // Qihoo 'Monster' { "Qihoo 'Monster' (v1->?)", "Qihoo unknown version, code named 'monster'", "monster.dex", "/libprotectClass" } };
/* * Header file for the definitions of packers/protectors * * Tim "diff" Strazzere <strazz@gmail.com> */ typedef struct { char* name; char* description; char* filter; char* marker; } packer; static packer packers[] = { // APKProtect { "APKProtect v1->5", "APKProtect generialized detection", // This is actually the filter APKProtect uses itself for finding it's own odex to modify ".apk@", "/libAPKProtect" }, // Bangcle (??) or something equally silly { "Bangcle (??) silly version", "Something silly used by malware", "classes.dex", "/app_lib/" }, // LIAPP { "LIAPP 'Egg' (v1->?)", "LockIn APP (lockincomp.com)", "LIAPPEgg.dex", "/LIAPPEgg" }, // Qihoo 'Monster' { "Qihoo 'Monster' (v1->?)", "Qihoo unknown version, code named 'monster'", "monster.dex", "/libprotectClass" } };
Merge in types and items from type servers (/Zi)
//===- GUID.h ---------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_DEBUGINFO_CODEVIEW_GUID_H #define LLVM_DEBUGINFO_CODEVIEW_GUID_H #include <cstdint> #include <cstring> namespace llvm { class raw_ostream; namespace codeview { /// This represents the 'GUID' type from windows.h. struct GUID { uint8_t Guid[16]; }; inline bool operator==(const GUID &LHS, const GUID &RHS) { return 0 == ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)); } raw_ostream &operator<<(raw_ostream &OS, const GUID &Guid); } // namespace codeview } // namespace llvm #endif
//===- GUID.h ---------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_DEBUGINFO_CODEVIEW_GUID_H #define LLVM_DEBUGINFO_CODEVIEW_GUID_H #include <cstdint> #include <cstring> namespace llvm { class raw_ostream; namespace codeview { /// This represents the 'GUID' type from windows.h. struct GUID { uint8_t Guid[16]; }; inline bool operator==(const GUID &LHS, const GUID &RHS) { return 0 == ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)); } inline bool operator<(const GUID &LHS, const GUID &RHS) { return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) < 0; } inline bool operator<=(const GUID &LHS, const GUID &RHS) { return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) <= 0; } inline bool operator>(const GUID &LHS, const GUID &RHS) { return !(LHS <= RHS); } inline bool operator>=(const GUID &LHS, const GUID &RHS) { return !(LHS < RHS); } inline bool operator!=(const GUID &LHS, const GUID &RHS) { return !(LHS == RHS); } raw_ostream &operator<<(raw_ostream &OS, const GUID &Guid); } // namespace codeview } // namespace llvm #endif
Fix small but critical typo ...
#ifndef RELFILENODE_H #define RELFILENODE_H /* * This is all what we need to know to find relation file. * tblNode is identificator of tablespace and because of * currently our tablespaces are equal to databases this is * database OID. relNode is currently relation OID on creation * but may be changed later if required. relNode is stored in * pg_class.relfilenode. */ typedef struct RelFileNode { Oid tblNode; /* tablespace */ Oid relNode; /* relation */ } RelFileNode; #define RelFileNodeEquals(node1, node2) \ ((node1).relNode == (node2).relNode && \ (node2).tblNode == (node2).tblNode) #endif /* RELFILENODE_H */
#ifndef RELFILENODE_H #define RELFILENODE_H /* * This is all what we need to know to find relation file. * tblNode is identificator of tablespace and because of * currently our tablespaces are equal to databases this is * database OID. relNode is currently relation OID on creation * but may be changed later if required. relNode is stored in * pg_class.relfilenode. */ typedef struct RelFileNode { Oid tblNode; /* tablespace */ Oid relNode; /* relation */ } RelFileNode; #define RelFileNodeEquals(node1, node2) \ ((node1).relNode == (node2).relNode && \ (node1).tblNode == (node2).tblNode) #endif /* RELFILENODE_H */
Add override keyword to overridden methods.
/*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_CreateMultiLabelSegmentation_H #define QMITK_CreateMultiLabelSegmentation_H #include "mitkIContextMenuAction.h" #include "org_mitk_gui_qt_multilabelsegmentation_Export.h" #include "vector" #include "mitkDataNode.h" class MITK_QT_SEGMENTATION QmitkCreateMultiLabelSegmentationAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkCreateMultiLabelSegmentationAction(); virtual ~QmitkCreateMultiLabelSegmentationAction(); //interface methods virtual void Run( const QList<mitk::DataNode::Pointer>& selectedNodes ); virtual void SetDataStorage(mitk::DataStorage* dataStorage); virtual void SetFunctionality(berry::QtViewPart* functionality); virtual void SetSmoothed(bool smoothed); virtual void SetDecimated(bool decimated); private: typedef QList<mitk::DataNode::Pointer> NodeList; mitk::DataStorage::Pointer m_DataStorage; }; #endif // QMITK_CreateMultiLabelSegmentation_H
/*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_CreateMultiLabelSegmentation_H #define QMITK_CreateMultiLabelSegmentation_H #include "mitkIContextMenuAction.h" #include "org_mitk_gui_qt_multilabelsegmentation_Export.h" #include "vector" #include "mitkDataNode.h" class MITK_QT_SEGMENTATION QmitkCreateMultiLabelSegmentationAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkCreateMultiLabelSegmentationAction(); virtual ~QmitkCreateMultiLabelSegmentationAction(); //interface methods virtual void Run( const QList<mitk::DataNode::Pointer>& selectedNodes ) override; virtual void SetDataStorage(mitk::DataStorage* dataStorage) override; virtual void SetFunctionality(berry::QtViewPart* functionality) override; virtual void SetSmoothed(bool smoothed) override; virtual void SetDecimated(bool decimated) override; private: typedef QList<mitk::DataNode::Pointer> NodeList; mitk::DataStorage::Pointer m_DataStorage; }; #endif // QMITK_CreateMultiLabelSegmentation_H
Add square bracket opertator access.
//----------------------------------------------------------------------------- // Element Access //----------------------------------------------------------------------------- template<class T> T& matrix<T>::at( std::size_t row, std::size_t col ){ // TODO throw if out of bounds return data_.at(row*cols_+col); } template<class T> const T& matrix<T>::at( std::size_t row, std::size_t col ) const{ // TODO throw if out of bounds return data_.at(row*cols_+col); } template<class T> typename matrix<T>::matrix_row matrix<T>::operator[]( std::size_t row ){ return 0; } template<class T> const typename matrix<T>::matrix_row matrix<T>::operator[]( std::size_t row ) const{ return 0; }
//----------------------------------------------------------------------------- // Element Access //----------------------------------------------------------------------------- template<class T> T& matrix<T>::at( std::size_t row, std::size_t col ){ // TODO throw if out of bounds return data_.at(row*cols_+col); } template<class T> const T& matrix<T>::at( std::size_t row, std::size_t col ) const{ // TODO throw if out of bounds return data_.at(row*cols_+col); } template<class T> typename matrix<T>::matrix_row matrix<T>::operator[]( std::size_t row ){ return matrix_row(this,row); } template<class T> const typename matrix<T>::matrix_row matrix<T>::operator[]( std::size_t row ) const{ return matrix_row(this,row); } //----------------------------------------------------------------------------- // Row class element Access //----------------------------------------------------------------------------- template<class T> T& matrix<T>::matrix_row::operator[](std::size_t col){ return matrix_->data_[row_*matrix_->cols_+col]; } template<class T> const T& matrix<T>::matrix_row::operator[](std::size_t col) const{ return matrix_->data_[row_*matrix_->cols_+col]; }
FIX Interface parameter for Entities
#ifndef SSPAPPLICATION_ENTITIES_STATICENTITY_H #define SSPAPPLICATION_ENTITIES_STATICENTITY_H #include "Entity.h" class StaticEntity : public Entity { private: //Variables public: StaticEntity(); ~StaticEntity(); int Initialize(int entityID, PhysicsComponent* pComp, GraphicsComponent* gComp, AIComponent* aiComp); int Update(float dT, InputHandler* inputHandler); int React(int entityID, EVENT reactEvent); private: //Functions }; #endif
#ifndef SSPAPPLICATION_ENTITIES_STATICENTITY_H #define SSPAPPLICATION_ENTITIES_STATICENTITY_H #include "Entity.h" class StaticEntity : public Entity { private: //Variables public: StaticEntity(); ~StaticEntity(); int Initialize(int entityID, PhysicsComponent* pComp, GraphicsComponent* gComp, AIComponent* aiComp = nullptr); int Update(float dT, InputHandler* inputHandler); int React(int entityID, EVENT reactEvent); private: //Functions }; #endif
Fix STARTS_WITH macro comparing 1 less character than needed
#ifndef UTIL_H #define UTIL_H /*** Utility functions ***/ #define ALLOC(type) ((type*) xmalloc(sizeof(type))) void *xmalloc(size_t); #define STARTS_WITH(x, y) (strncmp((x), (y), sizeof(y) - 1) == 0) #endif /* UTIL_H */
#ifndef UTIL_H #define UTIL_H /*** Utility functions ***/ #define ALLOC(type) ((type*) xmalloc(sizeof(type))) void *xmalloc(size_t); #define STARTS_WITH(x, y) (strncmp((x), (y), strlen(y)) == 0) #endif /* UTIL_H */
Add source code documentation for the Comparator class
// // RocksDBComparator.h // ObjectiveRocks // // Created by Iska on 22/11/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> typedef NS_ENUM(NSUInteger, RocksDBComparatorType) { RocksDBComparatorBytewiseAscending, RocksDBComparatorBytewiseDescending, RocksDBComparatorStringCompareAscending, RocksDBComparatorStringCompareDescending, RocksDBComparatorNumberAscending, RocksDBComparatorNumberDescending }; @interface RocksDBComparator : NSObject + (instancetype)comaparatorWithType:(RocksDBComparatorType)type; - (instancetype)initWithName:(NSString *)name andBlock:(int (^)(id key1, id key2))block; @end
// // RocksDBComparator.h // ObjectiveRocks // // Created by Iska on 22/11/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> /** An enum defining the built-in Comparators. */ typedef NS_ENUM(NSUInteger, RocksDBComparatorType) { /** @brief Orders the keys lexicographically in ascending order. */ RocksDBComparatorBytewiseAscending, /** @brief Orders the keys lexicographically in descending order. */ RocksDBComparatorBytewiseDescending, /** @brief Orders NSString keys in ascending order via the compare selector. */ RocksDBComparatorStringCompareAscending, /** @brief Orders NSString keys in descending order via the compare selector. */ RocksDBComparatorStringCompareDescending, /** @brief Orders NSNumber keys in ascending order via the compare selector.*/ RocksDBComparatorNumberAscending, /** @brief Orders NSNumber keys in descending order via the compare selector. */ RocksDBComparatorNumberDescending }; /** The keys are ordered within the key-value store according to a specified comparator function. The default ordering function for keys orders the bytes lexicographically. This behavior can be changed by supplying a custom Comparator when opening a database using the `RocksDBComparator`. */ @interface RocksDBComparator : NSObject /** Intializes a new Comparator instance for the given built-in type. @param type The comparator type. @return a newly-initialized instance of a keys comparator. */ + (instancetype)comaparatorWithType:(RocksDBComparatorType)type; /** Intializes a new Comparator instance with the given name and comparison block. @param name The name of the comparator. @param block The comparator block to apply on the keys in order to specify their order. @return a newly-initialized instance of a keys comparator. */ - (instancetype)initWithName:(NSString *)name andBlock:(int (^)(id key1, id key2))block; @end
Add interface for a hash table implementation required for the next stages of the spell checker implementation.
#ifndef SPELLUTIL_H #define SPELLUTIL_H typedef struct spell_list_node { struct spell_list_node *next; void *data; } spell_list_node; spell_list_node *spell_list_init(void *); int spell_list_add(spell_list_node **, void *); void spell_list_free(spell_list_node **, void (*) (void *)); #endif
#ifndef SPELLUTIL_H #define SPELLUTIL_H typedef struct spell_list_node { struct spell_list_node *next; void *data; } spell_list_node; typedef struct spell_hashtable { char *key; spell_list_node *val; } spell_hashtable; spell_list_node *spell_list_init(void *); int spell_list_add(spell_list_node **, void *); void spell_list_remove(spell_list_node **, spell_list_node *); void spell_list_free(spell_list_node **, void (*) (void *)); spell_hashtable *spell_hashtable_init(size_t); void spell_hashtable_add(spell_hashtable *, char *, void *); void spell_hashtable_remove(spell_hashtable *, char *); void spell_hashtable_get(spell_hashtable *, char *); void spell_hashtable_free(spell_hashtable *, void (*) (void *)); #endif
Remove `-?` to display help
#include "flags.h" #include <stdio.h> #include "laco.h" #include "util.h" static const char* version_matches[] = {"-v", "--version", NULL}; static const char* help_matches[] = {"-h", "-?", "--help", NULL}; /* Print off the current version of laco */ static void handle_version(LacoState* laco, const char** arguments) { const char* version = laco_get_laco_version(laco); printf("laco version %s\n", version); laco_kill(laco, 0, NULL); } /* Print off the help screen */ static void handle_help(LacoState* laco, const char** arguments) { puts("A better REPL for Lua.\n"); puts("Usage: laco [options]\n"); puts("-h | -? | --help \tPrint this help screen"); puts("-v | --version \tPrint current version"); laco_kill(laco, 0, NULL); } static const LacoCommand flag_commands[] = { { version_matches, handle_version }, { help_matches, handle_help }, { NULL, NULL } }; /* External API */ void laco_handle_flag(LacoState* laco) { const char* command = laco_get_laco_args(laco)[1]; laco_dispatch(flag_commands, laco, command, NULL); }
#include "flags.h" #include <stdio.h> #include "laco.h" #include "util.h" static const char* version_matches[] = {"-v", "--version", NULL}; static const char* help_matches[] = {"-h", "--help", NULL}; /* Print off the current version of laco */ static void handle_version(LacoState* laco, const char** arguments) { const char* version = laco_get_laco_version(laco); printf("laco version %s\n", version); laco_kill(laco, 0, NULL); } /* Print off the help screen */ static void handle_help(LacoState* laco, const char** arguments) { puts("A better REPL for Lua.\n"); puts("Usage: laco [options]\n"); puts("-h | --help \tPrint this help screen"); puts("-v | --version \tPrint current version"); laco_kill(laco, 0, NULL); } static const LacoCommand flag_commands[] = { { version_matches, handle_version }, { help_matches, handle_help }, { NULL, NULL } }; /* External API */ void laco_handle_flag(LacoState* laco) { const char* command = laco_get_laco_args(laco)[1]; laco_dispatch(flag_commands, laco, command, NULL); }
Use division here, not modulo
#include <stdlib.h> #include "ht.h" #include "util/macros.h" struct ht* ht_init( struct ht* ht, size_t n ) { if (ht) { ht->buckets = calloc(n, sizeof(*ht->buckets)); ht->nbuckets = n; } return ht; } void ht_destroy( struct ht* ht ) { if (ht) { for (; ht->nbuckets > 0; ht->nbuckets--) { avl_destroy(&ht->buckets[ht->nbuckets - 1].avl); } free(ht->buckets); free(ht); } } struct ht_bucket* ht_find( struct ht* ht, rs_hash hash ) { if (!ht) { return NULL; } return &ht->buckets[hash % (CONSTPOW_TWO(BITCOUNT(hash)) / ht->nbuckets)]; }
#include <stdlib.h> #include "ht.h" #include "util/macros.h" struct ht* ht_init( struct ht* ht, size_t n ) { if (ht) { ht->buckets = calloc(n, sizeof(*ht->buckets)); ht->nbuckets = n; } return ht; } void ht_destroy( struct ht* ht ) { if (ht) { for (; ht->nbuckets > 0; ht->nbuckets--) { avl_destroy(&ht->buckets[ht->nbuckets - 1].avl); } free(ht->buckets); free(ht); } } struct ht_bucket* ht_find( struct ht* ht, rs_hash hash ) { if (!ht) { return NULL; } return &ht->buckets[hash / ((CONSTPOW_TWO(BITCOUNT(hash)) / ht->nbuckets))]; }
Add portability for windows OS
#include <stdio.h> #include <stdlib.h> #include <editline/readline.h> #include <editline/history.h> int main(int argc, char** argv) { puts("zuzeelik [version: v0.0.0-0.0.2]"); puts("Press Ctrl+C to Exit \n"); /* Starting REPL */ while(1){ /* output from the prompt*/ char* input = readline("zuzeelik> "); /*Add input to history */ add_history(input); /* Echo the input back to the user */ printf("Got Input: %s \n", input); free(input); } return 0; }
#include <stdio.h> #include <stdlib.h> /* if compiling in windows, compiling with this functions */ #ifdef _WIN32 #include <string.h> static char buffer[2048]; /* fake readline functions */ char* readline(char* prompt) { fputs(prompt, stdout); fputs(buffer, 2048, stdin); fgets(buffer, 2048, stdin); char* copy = malloc(strlen(buffer)+1); strcpy(copy, buffer); copy[strlen(copy) - 1] = '\0'; return copy; } /* fake add_history function */ void add_history(char* not_used) {} /* or include thesse editline header */ #else #include <editline/readline.h> #include <editline/history.h> #endif int main(int argc, char** argv) { puts("zuzeelik [version: v0.0.0-0.0.3]"); puts("Press Ctrl+C to Exit \n"); /* Starting REPL */ while(1){ /* output from the prompt*/ char* input = readline("zuzeelik> "); /*Add input to history */ add_history(input); /* Echo the input back to the user */ printf("Got Input: %s \n", input); /*free retrieved input */ free(input); } return 0; }
Add options for yearly sst data, move some other stuff around a bit
C $Header$ C $Name$ c Ocean Exports c ------------------- common /ocean_exports/ sst, sice, ksst, kice _RL sst(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nsx,Nsy) _RL sice(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nsx,Nsy) integer ksst, kice
C $Header$ C $Name$ c Ocean Parameters c ------------------- common /ocean_params/sstclim,sstfreq,siceclim,sicefreq,ksst,kice logical sstclim,sstfreq,siceclim,sicefreq integer ksst, kice c Ocean Exports c ------------------- common /ocean_exports/ sst, sice _RL sst(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nsx,Nsy) _RL sice(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nsx,Nsy)
Fix header includes to use local paths.
// // sigen.h: global header file for user includes // ----------------------------------- #pragma once #include <sigen/types.h> #include <sigen/dvb_defs.h> #include <sigen/version.h> #include <sigen/tstream.h> #include <sigen/packetizer.h> #include <sigen/utc.h> #include <sigen/util.h> #include <sigen/dump.h> #include <sigen/table.h> #include <sigen/nit.h> #include <sigen/bat.h> #include <sigen/sdt.h> #include <sigen/pat.h> #include <sigen/pmt.h> #include <sigen/cat.h> #include <sigen/eit.h> #include <sigen/tdt.h> #include <sigen/tot.h> #include <sigen/other_tables.h> #include <sigen/descriptor.h> #include <sigen/dvb_desc.h> #include <sigen/stream_desc.h> #include <sigen/nit_desc.h> #include <sigen/linkage_desc.h> #include <sigen/sdt_desc.h> #include <sigen/pmt_desc.h> #include <sigen/ssu_desc.h> #include <sigen/eit_desc.h>
// // sigen.h: global header file for user includes // ----------------------------------- #pragma once #include "types.h" #include "dvb_defs.h" #include "version.h" #include "tstream.h" #include "packetizer.h" #include "utc.h" #include "util.h" #include "dump.h" #include "table.h" #include "nit.h" #include "bat.h" #include "sdt.h" #include "pat.h" #include "pmt.h" #include "cat.h" #include "eit.h" #include "tdt.h" #include "tot.h" #include "other_tables.h" #include "descriptor.h" #include "dvb_desc.h" #include "stream_desc.h" #include "nit_desc.h" #include "linkage_desc.h" #include "sdt_desc.h" #include "pmt_desc.h" #include "ssu_desc.h" #include "eit_desc.h"
Fix interval recalculation in the event that usleep is interrupted
#include <stdio.h> #include <unistd.h> #include <sys/time.h> #include <stdint.h> int wait_a_while (useconds_t interval) { int num_times = 0; int return_value = 1; struct timeval start_time; gettimeofday(&start_time, NULL); uint64_t target = start_time.tv_sec * 1000000 + start_time.tv_usec + interval; while (1) { num_times++; return_value = usleep (interval); if (return_value != 0) { struct timeval now; gettimeofday(&now, NULL); interval = target - now.tv_sec * 1000000 + now.tv_usec; } else break; } return num_times; } int main (int argc, char **argv) { printf ("stop here in main.\n"); int num_times = wait_a_while (argc * 1000); printf ("Done, took %d times.\n", num_times); return 0; }
#include <stdio.h> #include <unistd.h> #include <sys/time.h> #include <stdint.h> int wait_a_while (useconds_t interval) { int num_times = 0; int return_value = 1; struct timeval start_time; gettimeofday(&start_time, NULL); uint64_t target = start_time.tv_sec * 1000000 + start_time.tv_usec + interval; while (1) { num_times++; return_value = usleep (interval); if (return_value != 0) { struct timeval now; gettimeofday(&now, NULL); interval = target - (now.tv_sec * 1000000 + now.tv_usec); } else break; } return num_times; } int main (int argc, char **argv) { printf ("stop here in main.\n"); int num_times = wait_a_while (argc * 1000); printf ("Done, took %d times.\n", num_times); return 0; }
Add collatz C snippet that keeps track of highest value + total steps taken
#include <stdio.h> #include <stdlib.h> struct step_count { long start; long max; size_t steps; }; static long r(long n, struct step_count* cnt) { printf("%ld\n", n); //do not count last step, we're counting the initial call //causing 63,728,127 to count 950 steps instead of expected 949 if (n <= 1) return n; ++cnt->steps; if (cnt->max < n) { cnt->max = n; } if (n%2) return r(n*3+1, cnt); return r(n/2, cnt); } int main (int argc, char **argv) { long n = 15; if (argc > 1) n = strtol(argv[1], NULL, 10); struct step_count cnt = {n, n, 0}; puts("Basic collatz fun - recursive C function"); r(n, &cnt); printf( "Started with %ld. Reached end after %zu steps\nHighest value was %ld\n", cnt.start, cnt.steps, cnt.max ); return 0; }
Add ablity to look through named tables
#include "debugger.h" #include <stdio.h> #include <lua.h> #include "laco.h" void laco_print_debug_info(struct LacoState* laco, const char* function_name) { lua_State* L = laco_get_laco_lua_state(laco); lua_Debug debug_info = {0}; lua_getfield(L, LUA_GLOBALSINDEX, function_name); lua_getinfo(L, ">Sl", &debug_info); printf( "What: \t%s\n" "Source file: \t%s\n" "Line defined on: \t%d\n" "Current line: \t%d\n", debug_info.what, debug_info.source, debug_info.linedefined, debug_info.currentline); }
#include "debugger.h" #include <lua.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "laco.h" #include "util.h" void laco_print_debug_info(struct LacoState* laco, const char* function_name) { int i; char* namespace; lua_State* L = laco_get_laco_lua_state(laco); size_t index = LUA_GLOBALSINDEX; lua_Debug debug_info = {0}; char* name = strdup(function_name); char** namespaces = laco_split_by(".", name, 0); /* Walk down the namespace if there is something to go down */ for(i = 0; (namespace = namespaces[i]); i++) { lua_getfield(L, index, namespace); index = lua_gettop(L); } lua_getinfo(L, ">Sl", &debug_info); printf( "What: \t%s\n" "Source file: \t%s\n" "Line defined on: \t%d\n" "Current line: \t%d\n", debug_info.what, debug_info.source, debug_info.linedefined, debug_info.currentline); /* Pop off the extra fields from the top of the stack */ if(i > 1) { lua_pop(L, i - 1); } free(name); free(namespaces); }
Add library for github workflow
// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef MUTATOR_H_ #define MUTATOR_H_ #include <vector> namespace fido2_tests { // Mutates the given data by applying combined basic mutation operations. class Mutator { public: enum MutationOperation { kEraseByte, kInsertByte, kShuffleBytes, }; Mutator(int max_mutation_degree = 10, int seed = time(NULL)); bool EraseByte(std::vector<uint8_t> &data, size_t max_size); bool InsertByte(std::vector<uint8_t> &data, size_t max_size); bool ShuffleBytes(std::vector<uint8_t> &data, size_t max_size); bool Mutate(std::vector<uint8_t> &data, size_t max_size); private: int max_mutation_degree_; }; } // namespace fido2_tests #endif // MUTATOR_H_
// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #ifndef MUTATOR_H_ #define MUTATOR_H_ #include <stdint.h> #include <ctime> #include <vector> namespace fido2_tests { // Mutates the given data by applying combined basic mutation operations. class Mutator { public: enum MutationOperation { kEraseByte, kInsertByte, kShuffleBytes, }; Mutator(int max_mutation_degree = 10, int seed = time(NULL)); bool EraseByte(std::vector<uint8_t> &data, size_t max_size); bool InsertByte(std::vector<uint8_t> &data, size_t max_size); bool ShuffleBytes(std::vector<uint8_t> &data, size_t max_size); bool Mutate(std::vector<uint8_t> &data, size_t max_size); private: int max_mutation_degree_; }; } // namespace fido2_tests #endif // MUTATOR_H_
Fix typo which used a mask for a logical-and
/* * This file is part of GreatFET */ #include "usb_api_dac.h" #include "usb.h" #include "usb_queue.h" #include "usb_endpoint.h" #include <stddef.h> #include <greatfet_core.h> #include <dac.h> #include <pins.h> usb_request_status_t usb_vendor_request_dac_set( usb_endpoint_t* const endpoint, const usb_transfer_stage_t stage) { usb_endpoint_init(&usb0_endpoint_bulk_in); if (stage == USB_TRANSFER_STAGE_SETUP) { // set J2_P5 up as a DAC pin scu_pinmux(SCU_PINMUX_GPIO2_3, SCU_GPIO_FAST | SCU_GPIO_PUP | SCU_CONF_FUNCTION0); static struct gpio_t dac_pin = GPIO(2, 3); gpio_input(&dac_pin); DAC_CR = DAC_CR_VALUE(endpoint->setup.value) && DAC_CR_VALUE_MASK; DAC_CTRL = DAC_CTRL_DMA_ENA; usb_transfer_schedule_ack(endpoint->in); } return USB_REQUEST_STATUS_OK; }
/* * This file is part of GreatFET */ #include "usb_api_dac.h" #include "usb.h" #include "usb_queue.h" #include "usb_endpoint.h" #include <stddef.h> #include <greatfet_core.h> #include <dac.h> #include <pins.h> usb_request_status_t usb_vendor_request_dac_set( usb_endpoint_t* const endpoint, const usb_transfer_stage_t stage) { usb_endpoint_init(&usb0_endpoint_bulk_in); if (stage == USB_TRANSFER_STAGE_SETUP) { // set J2_P5 up as a DAC pin scu_pinmux(SCU_PINMUX_GPIO2_3, SCU_GPIO_FAST | SCU_GPIO_PUP | SCU_CONF_FUNCTION0); static struct gpio_t dac_pin = GPIO(2, 3); gpio_input(&dac_pin); DAC_CR = DAC_CR_VALUE(endpoint->setup.value) & DAC_CR_VALUE_MASK; DAC_CTRL = DAC_CTRL_DMA_ENA; usb_transfer_schedule_ack(endpoint->in); } return USB_REQUEST_STATUS_OK; }
Define CPP macro BOOLAN_TYPE_DEFINED when we define types BOOLEAN and BOOL_T, to avoid doing it twice.
#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 int BOOLEAN; typedef int BOOL_T; #endif #if defined(TRUE) # undef TRUE # undef FALSE #endif static const int TRUE = 1; static const int FALSE = 0; /* Useful constants for turning seconds into larger units of time. Since these constants may have already been defined elsewhere, they are conditional. */ #ifndef TIME_CONSTANTS_DEFINED static const int MINUTE = 60; static const int HOUR = 60 * 60; static const int DAY = 24 * 60 * 60; #endif /* This is for use with strcmp() and related functions which will return 0 upon a match. */ #ifndef MATCH static const int MATCH = 0; #endif /* These are the well known file descriptors used for remote system call and logging functions. */ #ifndef CLIENT_LOG static const int CLIENT_LOG = 18; static const int RSC_SOCK = 17; #endif static const int REQ_SOCK = 16; static const int RPL_SOCK = 17; #endif
#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 int BOOLEAN; typedef int BOOL_T; #define BOOLAN_TYPE_DEFINED #endif #if defined(TRUE) # undef TRUE # undef FALSE #endif static const int TRUE = 1; static const int FALSE = 0; /* Useful constants for turning seconds into larger units of time. Since these constants may have already been defined elsewhere, they are conditional. */ #ifndef TIME_CONSTANTS_DEFINED static const int MINUTE = 60; static const int HOUR = 60 * 60; static const int DAY = 24 * 60 * 60; #endif /* This is for use with strcmp() and related functions which will return 0 upon a match. */ #ifndef MATCH static const int MATCH = 0; #endif /* These are the well known file descriptors used for remote system call and logging functions. */ #ifndef CLIENT_LOG static const int CLIENT_LOG = 18; static const int RSC_SOCK = 17; #endif static const int REQ_SOCK = 16; static const int RPL_SOCK = 17; #endif
Fix compilation on OpenBSD (from Bernhard Leiner)
#ifndef XMMSC_SOCKETS_H #define XMMSC_SOCKETS_H #include <xmmsc/xmmsc_stdbool.h> /* Windows */ #ifdef _MSC_VER #include <Winsock2.h> #include <Ws2tcpip.h> typedef SOCKET xmms_socket_t; typedef int socklen_t; #define XMMS_EINTR WSAEINTR #define XMMS_EAGAIN WSAEWOULDBLOCK /* UNIX */ #else #define SOCKET_ERROR (-1) #define XMMS_EINTR EINTR #define XMMS_EAGAIN EWOULDBLOCK #include <sys/socket.h> #include <sys/select.h> #include <sys/types.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <arpa/inet.h> #include <netdb.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> typedef int xmms_socket_t; #endif int xmms_sockets_initialize(); int xmms_socket_set_nonblock(xmms_socket_t socket); int xmms_socket_valid(xmms_socket_t socket); void xmms_socket_close(xmms_socket_t socket); int xmms_socket_errno(); bool xmms_socket_error_recoverable(); #endif
#ifndef XMMSC_SOCKETS_H #define XMMSC_SOCKETS_H #include <xmmsc/xmmsc_stdbool.h> /* Windows */ #ifdef _MSC_VER #include <Winsock2.h> #include <Ws2tcpip.h> typedef SOCKET xmms_socket_t; typedef int socklen_t; #define XMMS_EINTR WSAEINTR #define XMMS_EAGAIN WSAEWOULDBLOCK /* UNIX */ #else #define SOCKET_ERROR (-1) #define XMMS_EINTR EINTR #define XMMS_EAGAIN EWOULDBLOCK #include <sys/types.h> #include <sys/socket.h> #include <sys/select.h> #include <netinet/in.h> #include <netinet/tcp.h> #include <arpa/inet.h> #include <netdb.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> typedef int xmms_socket_t; #endif int xmms_sockets_initialize(); int xmms_socket_set_nonblock(xmms_socket_t socket); int xmms_socket_valid(xmms_socket_t socket); void xmms_socket_close(xmms_socket_t socket); int xmms_socket_errno(); bool xmms_socket_error_recoverable(); #endif
Fix build error on Ubuntu 11.10, if systemtap is installed.
/* Copyright (c) 2008 Sun Microsystems, Inc. Use is subject to license terms. 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; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef PROBES_MYSQL_H #define PROBES_MYSQL_H #include <my_global.h> #if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE) #include "probes_mysql_dtrace.h" #else #include "probes_mysql_nodtrace.h" #endif #endif /* PROBES_MYSQL_H */
/* Copyright (c) 2008 Sun Microsystems, Inc. Use is subject to license terms. 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; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef PROBES_MYSQL_H #define PROBES_MYSQL_H #if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE) #ifdef __linux__ /* On Linux, generated probes header may include C++ header <limits> which conflicts with min and max macros from my_global.h . To fix, temporarily undefine the macros. */ #pragma push_macro("min") #pragma push_macro("max") #undef min #undef max #endif #include "probes_mysql_dtrace.h" #ifdef __linux__ #pragma pop_macro("min") #pragma pop_macro("max") #endif #else /* no dtrace */ #include "probes_mysql_nodtrace.h" #endif #endif /* PROBES_MYSQL_H */
Add verify.h to top-level include-all header.
/****************************************************************************** * * Copyright 2017 Xaptum, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License * *****************************************************************************/ #ifndef XAPTUM_ECDAA_XAPTUM_ECDAA_H #define XAPTUM_ECDAA_XAPTUM_ECDAA_H #pragma once #include "xaptum-ecdaa/sign.h" #include "xaptum-ecdaa/join_member.h" #include "xaptum-ecdaa/context.h" #endif
/****************************************************************************** * * Copyright 2017 Xaptum, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License * *****************************************************************************/ #ifndef XAPTUM_ECDAA_XAPTUM_ECDAA_H #define XAPTUM_ECDAA_XAPTUM_ECDAA_H #pragma once #include "xaptum-ecdaa/sign.h" #include "xaptum-ecdaa/join_member.h" #include "xaptum-ecdaa/context.h" #include "xaptum-ecdaa/verify.h" #endif
Check for newer popt, and include it in the needed libs. Give correct
#ifndef __GNOME_POPT_H__ #define __GNOME_POPT_H__ 1 #include "gnome-defs.h" BEGIN_GNOME_DECLS /* This is here because it does not have its own #ifdef __cplusplus */ #include <popt-gnome.h> void gnomelib_register_popt_table(const struct poptOption *options, const char *description); poptContext gnomelib_parse_args(int argc, char *argv[], int popt_flags); /* Some systems, like Red Hat 4.0, define these but don't declare them. Hopefully it is safe to always declare them here. */ extern char *program_invocation_short_name; extern char *program_invocation_name; END_GNOME_DECLS #endif /* __GNOME_HELP_H__ */
#ifndef __GNOME_POPT_H__ #define __GNOME_POPT_H__ 1 #include "gnome-defs.h" BEGIN_GNOME_DECLS /* This is here because it does not have its own #ifdef __cplusplus */ #include <popt.h> void gnomelib_register_popt_table(const struct poptOption *options, const char *description); poptContext gnomelib_parse_args(int argc, char *argv[], int popt_flags); /* Some systems, like Red Hat 4.0, define these but don't declare them. Hopefully it is safe to always declare them here. */ extern char *program_invocation_short_name; extern char *program_invocation_name; END_GNOME_DECLS #endif /* __GNOME_HELP_H__ */
Fix a typo, that could cause a crash on mac.
// Copyright (c) 2008 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_PROXY_PROXY_RESOLVER_MAC_H_ #define NET_PROXY_PROXY_RESOLVER_MAC_H_ #pragma once #include <string> #include "googleurl/src/gurl.h" #include "net/base/net_errors.h" #include "net/proxy/proxy_resolver.h" namespace net { // Implementation of ProxyResolver that uses the Mac CFProxySupport to implement // proxies. class ProxyResolverMac : public ProxyResolver { public: ProxyResolverMac() : ProxyResolver(false /*expects_pac_bytes*/) {} // ProxyResolver methods: virtual int GetProxyForURL(const GURL& url, ProxyInfo* results, CompletionCallback* callback, RequestHandle* request, const BoundNetLog& net_log); virtual void CancelRequest(RequestHandle request) { NOTREACHED(); } virtual int SetPacScript( const scoped_refptr<ProxyResolverScriptData>& script_data, CompletionCallback* /*callback*/) { script_data_ = script_data_; return OK; } private: scoped_refptr<ProxyResolverScriptData> script_data_; }; } // namespace net #endif // NET_PROXY_PROXY_RESOLVER_MAC_H_
// Copyright (c) 2008 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_PROXY_PROXY_RESOLVER_MAC_H_ #define NET_PROXY_PROXY_RESOLVER_MAC_H_ #pragma once #include <string> #include "googleurl/src/gurl.h" #include "net/base/net_errors.h" #include "net/proxy/proxy_resolver.h" namespace net { // Implementation of ProxyResolver that uses the Mac CFProxySupport to implement // proxies. class ProxyResolverMac : public ProxyResolver { public: ProxyResolverMac() : ProxyResolver(false /*expects_pac_bytes*/) {} // ProxyResolver methods: virtual int GetProxyForURL(const GURL& url, ProxyInfo* results, CompletionCallback* callback, RequestHandle* request, const BoundNetLog& net_log); virtual void CancelRequest(RequestHandle request) { NOTREACHED(); } virtual int SetPacScript( const scoped_refptr<ProxyResolverScriptData>& script_data, CompletionCallback* /*callback*/) { script_data_ = script_data; return OK; } private: scoped_refptr<ProxyResolverScriptData> script_data_; }; } // namespace net #endif // NET_PROXY_PROXY_RESOLVER_MAC_H_
Fix build for unit test
#include "clar_libgit2.h" #include "git2/clone.h" static git_repository *g_repo; #if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT) void test_online_badssl__expired(void) { cl_git_fail_with(GIT_ECERTIFICATE, git_clone(&g_repo, "https://expired.badssl.com/fake.git", "./fake", NULL)); } void test_online_badssl__wrong_host(void) { cl_git_fail_with(GIT_ECERTIFICATE, git_clone(&g_repo, "https://wrong.host.badssl.com/fake.git", "./fake", NULL)); } void test_online_badssl__self_signed(void) { cl_git_fail_with(GIT_ECERTIFICATE, git_clone(&g_repo, "https://self-signed.badssl.com/fake.git", "./fake", NULL)); } #endif
#include "clar_libgit2.h" #include "git2/clone.h" static git_repository *g_repo; #if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT) static bool g_has_ssl = true; #else static bool g_has_ssl = false; #endif void test_online_badssl__expired(void) { if (!g_has_ssl) cl_skip(); cl_git_fail_with(GIT_ECERTIFICATE, git_clone(&g_repo, "https://expired.badssl.com/fake.git", "./fake", NULL)); } void test_online_badssl__wrong_host(void) { if (!g_has_ssl) cl_skip(); cl_git_fail_with(GIT_ECERTIFICATE, git_clone(&g_repo, "https://wrong.host.badssl.com/fake.git", "./fake", NULL)); } void test_online_badssl__self_signed(void) { if (!g_has_ssl) cl_skip(); cl_git_fail_with(GIT_ECERTIFICATE, git_clone(&g_repo, "https://self-signed.badssl.com/fake.git", "./fake", NULL)); }
Use !NDEBUG to detect Debug variant of build
// // ogles_gpgpu project - GPGPU for mobile devices and embedded systems using OpenGL ES 2.0 // // Author: Markus Konrad <post@mkonrad.net>, Winter 2014/2015 // http://www.mkonrad.net // // See LICENSE file in project repository root for the license. // #ifndef OGLES_GPGPU_COMMON_MACROS #define OGLES_GPGPU_COMMON_MACROS #define OG_TO_STR_(x) #x #define OG_TO_STR(x) OG_TO_STR_(x) #ifdef DEBUG #define OG_LOGINF(class, args...) fprintf(stdout, "ogles_gpgpu::%s - %s - ", class, __FUNCTION__); fprintf(stdout, args); fprintf(stdout, "\n") #else #define OG_LOGINF(class, args...) #endif #define OG_LOGERR(class, args...) fprintf(stderr, "ogles_gpgpu::%s - %s - ", class, __FUNCTION__); fprintf(stderr, args); fprintf(stderr, "\n") #endif
// // ogles_gpgpu project - GPGPU for mobile devices and embedded systems using OpenGL ES 2.0 // // Author: Markus Konrad <post@mkonrad.net>, Winter 2014/2015 // http://www.mkonrad.net // // See LICENSE file in project repository root for the license. // #ifndef OGLES_GPGPU_COMMON_MACROS #define OGLES_GPGPU_COMMON_MACROS #define OG_TO_STR_(x) #x #define OG_TO_STR(x) OG_TO_STR_(x) #if !defined(NDEBUG) #define OG_LOGINF(class, args...) fprintf(stdout, "ogles_gpgpu::%s - %s - ", class, __FUNCTION__); fprintf(stdout, args); fprintf(stdout, "\n") #else #define OG_LOGINF(class, args...) #endif #define OG_LOGERR(class, args...) fprintf(stderr, "ogles_gpgpu::%s - %s - ", class, __FUNCTION__); fprintf(stderr, args); fprintf(stderr, "\n") #endif
Remove unnecessary checking of size_t >= 0
#ifndef INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_ #define INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_ #include "DLLDefines.h" #include <vector> #include <stddef.h> /* This algorithm "Quick Union With Path Compression" solves the dynamic connectivity problem. Starting from an empty data structure, any sequence of M union-find ops on N objects makes ≤ c ( N + M lg* N ) array accesses. In reality log * function can be considered to be at the most 5. Thus in theory, this algorithm is not quite linear but in practice it is. */ namespace algorithms { class QuickUnionWithPathCompression { public: MYLIB_EXPORT QuickUnionWithPathCompression(size_t no_of_elements); MYLIB_EXPORT ~QuickUnionWithPathCompression() = default; MYLIB_EXPORT void Union(size_t elementA, size_t elementB); MYLIB_EXPORT bool Connected(size_t elementA, size_t elementB); private: size_t GetRoot(size_t element); inline bool IsIdInBounds(size_t element) { return element >= 0 && element < id_.size(); } private: std::vector<size_t> id_; std::vector<size_t> size_; }; } #endif //INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_
#ifndef INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_ #define INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_ #include "DLLDefines.h" #include <vector> #include <stddef.h> /* This algorithm "Quick Union With Path Compression" solves the dynamic connectivity problem. Starting from an empty data structure, any sequence of M union-find ops on N objects makes ≤ c ( N + M lg* N ) array accesses. In reality log * function can be considered to be at the most 5. Thus in theory, this algorithm is not quite linear but in practice it is. */ namespace algorithms { class QuickUnionWithPathCompression { public: MYLIB_EXPORT QuickUnionWithPathCompression(size_t no_of_elements); MYLIB_EXPORT ~QuickUnionWithPathCompression() = default; MYLIB_EXPORT void Union(size_t elementA, size_t elementB); MYLIB_EXPORT bool Connected(size_t elementA, size_t elementB); private: size_t GetRoot(size_t element); inline bool IsIdInBounds(size_t element) { return element < id_.size(); } private: std::vector<size_t> id_; std::vector<size_t> size_; }; } #endif //INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_
Change maximum dimension of hepevt from 2000 to 4000 to be consistent between Pythia5 and 6. Note that this change implies a recompilation of jetset.f
/* @(#)root/eg:$Name$:$Id$ */ /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_HepEvt #define ROOT_HepEvt extern "C" { #ifndef __CFORTRAN_LOADED #include "cfortran.h" #endif typedef struct { Int_t nevhep; Int_t nhep; Int_t isthep[2000]; Int_t idhep[2000]; Int_t jmohep[2000][2]; Int_t jdahep[2000][2]; Double_t phep[2000][5]; Double_t vhep[2000][4]; } HEPEVT_DEF; #define HEPEVT COMMON_BLOCK(HEPEVT,hepevt) COMMON_BLOCK_DEF(HEPEVT_DEF,HEPEVT); HEPEVT_DEF HEPEVT; } #endif
/* @(#)root/eg:$Name: $:$Id: Hepevt.h,v 1.1.1.1 2000/05/16 17:00:47 rdm Exp $ */ /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_HepEvt #define ROOT_HepEvt extern "C" { #ifndef __CFORTRAN_LOADED #include "cfortran.h" #endif typedef struct { Int_t nevhep; Int_t nhep; Int_t isthep[4000]; Int_t idhep[4000]; Int_t jmohep[4000][2]; Int_t jdahep[4000][2]; Double_t phep[4000][5]; Double_t vhep[4000][4]; } HEPEVT_DEF; #define HEPEVT COMMON_BLOCK(HEPEVT,hepevt) COMMON_BLOCK_DEF(HEPEVT_DEF,HEPEVT); HEPEVT_DEF HEPEVT; } #endif
Add List Insert function declaration
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; List* List_Create(void); void List_Destroy(List* l); ListNode* ListNode_Create(void *); void ListNode_Destroy(ListNode* n); ListNode* List_Search(List* l, void* k, int (f)(void*, void*)); #endif
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; List* List_Create(void); void List_Destroy(List* l); ListNode* ListNode_Create(void *); void ListNode_Destroy(ListNode* n); ListNode* List_Search(List* l, void* k, int (f)(void*, void*)); void List_Insert(List* l, ListNode* n); #endif
Add Random to general header
#ifndef FMRCXX_FMRCXX_H_ #define FMRCXX_FMRCXX_H_ #include <fmrcxx/Iterator.h> #include <fmrcxx/Range.h> #include <fmrcxx/internal/StdMapIterator.h> #include <fmrcxx/internal/StdContainerIterator.h> namespace fmrcxx { template <typename T, template <typename...> class Container, typename... TTs> StdContainerIterator<T, typename Container<T, TTs...>::iterator> iterateOver(Container<T, TTs...>& container); template <typename T, template <typename... Others> class Container, typename... TTs> StdContainerIterator<T, typename Container<T>::iterator> reverseIterateOver(Container<T>& container); template <typename Key, typename Value, template <typename...> class MapContainer, typename... TTs> StdMapIterator<Key, Value, typename MapContainer<Key, Value, TTs...>::iterator> iterateOverMap(MapContainer<Key, Value, TTs...>& container); template <typename Key, typename Value, template <typename...> class MapContainer, typename... TTs> StdMapIterator<Key, Value, typename MapContainer<Key, Value, TTs...>::iterator> reverseIterateOverMap(MapContainer<Key, Value, TTs...>& container); } #include <fmrcxx/impl/fmrcxx.hpp> #endif
#ifndef FMRCXX_FMRCXX_H_ #define FMRCXX_FMRCXX_H_ #include <fmrcxx/Iterator.h> #include <fmrcxx/Range.h> #include <fmrcxx/Random.h> #include <fmrcxx/internal/StdMapIterator.h> #include <fmrcxx/internal/StdContainerIterator.h> namespace fmrcxx { template <typename T, template <typename...> class Container, typename... TTs> StdContainerIterator<T, typename Container<T, TTs...>::iterator> iterateOver(Container<T, TTs...>& container); template <typename T, template <typename... Others> class Container, typename... TTs> StdContainerIterator<T, typename Container<T>::iterator> reverseIterateOver(Container<T>& container); template <typename Key, typename Value, template <typename...> class MapContainer, typename... TTs> StdMapIterator<Key, Value, typename MapContainer<Key, Value, TTs...>::iterator> iterateOverMap(MapContainer<Key, Value, TTs...>& container); template <typename Key, typename Value, template <typename...> class MapContainer, typename... TTs> StdMapIterator<Key, Value, typename MapContainer<Key, Value, TTs...>::iterator> reverseIterateOverMap(MapContainer<Key, Value, TTs...>& container); } #include <fmrcxx/impl/fmrcxx.hpp> #endif
Include condor_fix_string.h rather than just string.h
#include "_condor_fix_types.h" #include "condor_fix_stdio.h" #include <stdlib.h> #include "condor_fix_unistd.h" #include "condor_fix_limits.h" #include <string.h> #include <ctype.h> #include <fcntl.h> #include <errno.h>
#include "_condor_fix_types.h" #include "condor_fix_stdio.h" #include <stdlib.h> #include "condor_fix_unistd.h" #include "condor_fix_limits.h" #include "condor_fix_string.h" #include <ctype.h> #include <fcntl.h> #include <errno.h>
Update Skia milestone to 107
/* * 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 106 #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 107 #endif
Add new functor that inherits from base and has custom sigs.
#ifndef __extendFunctor_ #define __extendFunctor_ template<class Functor, typename CSig, typename ESig> struct ExtendedFunctor : public Functor { public: typedef typename CSig::type ControlSignature; typedef typename ESig::type ExecutionSignature; }; #endif
Include unincluded necessary header file.
#ifndef ROBOBO_H #define ROBOBO_H #include "main.h" #include <string.h> // C strings to handle args #include <sstream> #endif
#ifndef ROBOBO_H #define ROBOBO_H #include "main.h" #include "base.h" #include <string.h> // C strings to handle args #include <sstream> #endif
Change about the author url
// // APIConstant.h // PHPHub // // Created by Aufree on 9/30/15. // Copyright (c) 2015 ESTGroup. All rights reserved. // #define APIAccessTokenURL [NSString stringWithFormat:@"%@%@", APIBaseURL, @"/oauth/access_token"] #define QiniuUploadTokenIdentifier @"QiniuUploadTokenIdentifier" #if DEBUG #define APIBaseURL @"https://staging_api.phphub.org/v1" #else #define APIBaseURL @"https://api.phphub.org/v1" #endif #define PHPHubHost @"phphub.org" #define PHPHubUrl @"https://phphub.org/" #define GitHubURL @"https://github.com/" #define TwitterURL @"https://twitter.com/" #define ProjectURL @"https://github.com/aufree/phphub-ios" #define AboutPageURL @"https://phphub.org/about" #define ESTGroupURL @"http://est-group.org" #define AboutTheAuthorURL @"weibo.com/jinfali" #define PHPHubGuide @"http://7xnqwn.com1.z0.glb.clouddn.com/index.html" #define PHPHubTopicURL @"https://phphub.org/topics/" #define SinaRedirectURL @"http://sns.whalecloud.com/sina2/callback" #define UpdateNoticeCount @"UpdateNoticeCount"
// // APIConstant.h // PHPHub // // Created by Aufree on 9/30/15. // Copyright (c) 2015 ESTGroup. All rights reserved. // #define APIAccessTokenURL [NSString stringWithFormat:@"%@%@", APIBaseURL, @"/oauth/access_token"] #define QiniuUploadTokenIdentifier @"QiniuUploadTokenIdentifier" #if DEBUG #define APIBaseURL @"https://staging_api.phphub.org/v1" #else #define APIBaseURL @"https://api.phphub.org/v1" #endif #define PHPHubHost @"phphub.org" #define PHPHubUrl @"https://phphub.org/" #define GitHubURL @"https://github.com/" #define TwitterURL @"https://twitter.com/" #define ProjectURL @"https://github.com/aufree/phphub-ios" #define AboutPageURL @"https://phphub.org/about" #define ESTGroupURL @"http://est-group.org" #define AboutTheAuthorURL @"https://github.com/aufree" #define PHPHubGuide @"http://7xnqwn.com1.z0.glb.clouddn.com/index.html" #define PHPHubTopicURL @"https://phphub.org/topics/" #define SinaRedirectURL @"http://sns.whalecloud.com/sina2/callback" #define UpdateNoticeCount @"UpdateNoticeCount"
Set view property to strong for UIObjects.
#import "CLPBaseObject.h" @interface CLPUIObject : CLPBaseObject @property (nonatomic, readwrite) IBOutlet UIView *view; - (instancetype)remove; @end
#import "CLPBaseObject.h" @interface CLPUIObject : CLPBaseObject @property (nonatomic, strong, readwrite) IBOutlet UIView *view; - (instancetype)remove; @end
Add the default source concept to NoteRepository
/* This file is part of Zanshin Copyright 2014 Kevin Ottens <ervin@kde.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DOMAIN_NOTEREPOSITORY_H #define DOMAIN_NOTEREPOSITORY_H #include "note.h" class KJob; namespace Domain { class NoteRepository { public: NoteRepository(); virtual ~NoteRepository(); virtual KJob *save(Note::Ptr note) = 0; virtual KJob *remove(Note::Ptr note) = 0; }; } #endif // DOMAIN_NOTEREPOSITORY_H
/* This file is part of Zanshin Copyright 2014 Kevin Ottens <ervin@kde.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DOMAIN_NOTEREPOSITORY_H #define DOMAIN_NOTEREPOSITORY_H #include "datasource.h" #include "note.h" class KJob; namespace Domain { class NoteRepository { public: NoteRepository(); virtual ~NoteRepository(); virtual bool isDefaultSource(DataSource::Ptr source) const = 0; virtual void setDefaultSource(DataSource::Ptr source) = 0; virtual KJob *save(Note::Ptr note) = 0; virtual KJob *remove(Note::Ptr note) = 0; }; } #endif // DOMAIN_NOTEREPOSITORY_H
Remove no longer used SkipEncodingUnusedStreams.
/* * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef WEBRTC_EXPERIMENTS_H_ #define WEBRTC_EXPERIMENTS_H_ #include "webrtc/typedefs.h" namespace webrtc { struct RemoteBitrateEstimatorMinRate { RemoteBitrateEstimatorMinRate() : min_rate(30000) {} RemoteBitrateEstimatorMinRate(uint32_t min_rate) : min_rate(min_rate) {} uint32_t min_rate; }; struct SkipEncodingUnusedStreams { SkipEncodingUnusedStreams() : enabled(false) {} explicit SkipEncodingUnusedStreams(bool set_enabled) : enabled(set_enabled) {} virtual ~SkipEncodingUnusedStreams() {} const bool enabled; }; struct AimdRemoteRateControl { AimdRemoteRateControl() : enabled(false) {} explicit AimdRemoteRateControl(bool set_enabled) : enabled(set_enabled) {} virtual ~AimdRemoteRateControl() {} const bool enabled; }; } // namespace webrtc #endif // WEBRTC_EXPERIMENTS_H_
/* * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef WEBRTC_EXPERIMENTS_H_ #define WEBRTC_EXPERIMENTS_H_ #include "webrtc/typedefs.h" namespace webrtc { struct RemoteBitrateEstimatorMinRate { RemoteBitrateEstimatorMinRate() : min_rate(30000) {} RemoteBitrateEstimatorMinRate(uint32_t min_rate) : min_rate(min_rate) {} uint32_t min_rate; }; struct AimdRemoteRateControl { AimdRemoteRateControl() : enabled(false) {} explicit AimdRemoteRateControl(bool set_enabled) : enabled(set_enabled) {} virtual ~AimdRemoteRateControl() {} const bool enabled; }; } // namespace webrtc #endif // WEBRTC_EXPERIMENTS_H_
Change repository urls to proper for this version
// Copyright (c) 2016-2020 The Karbowanec developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef UPDATE_H #define UPDATE_H #include <QObject> #include <QNetworkAccessManager> #include <QNetworkRequest> #include <QNetworkReply> #include <QUrl> const static QString KARBO_UPDATE_URL = "https://api.github.com/repos/Karbovanets/karbowanecwallet/tags"; const static QString KARBO_DOWNLOAD_URL = "https://github.com/Karbovanets/karbowanecwallet/releases/"; class Updater : public QObject { Q_OBJECT public: explicit Updater(QObject *parent = 0); ~Updater() { delete manager; } void checkForUpdate(); signals: public slots: void replyFinished (QNetworkReply *reply); private: QNetworkAccessManager *manager; }; #endif // UPDATE_H
// Copyright (c) 2016-2020 The Karbowanec developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef UPDATE_H #define UPDATE_H #include <QObject> #include <QNetworkAccessManager> #include <QNetworkRequest> #include <QNetworkReply> #include <QUrl> const static QString KARBO_UPDATE_URL = "https://api.github.com/repos/seredat/karbowanecwallet/tags"; const static QString KARBO_DOWNLOAD_URL = "https://github.com/seredat/karbowanecwallet/releases/"; class Updater : public QObject { Q_OBJECT public: explicit Updater(QObject *parent = 0); ~Updater() { delete manager; } void checkForUpdate(); signals: public slots: void replyFinished (QNetworkReply *reply); private: QNetworkAccessManager *manager; }; #endif // UPDATE_H
Remove annoying "unreferenced function" warnings
#define BASE_SPEED_FULL 127 void base_set(int fr, int br, int bl, int fl); void base_set(int power); void dump_set(int x); void lift_set(int x); #define LCD_BUTTON_LEFT 1 #define LCD_BUTTON_CENTER 2 #define LCD_BUTTON_RIGHT 4 #define LCD_BUTTON_NONE 0 #define LCD_LINE_TOP 0 #define LCD_LINE_BOTTOM 1 void lcd_voltage(void); void lcd_clear(void);
#define BASE_SPEED_FULL 127 void base_set(int fr, int br, int bl, int fl); void base_set(int power); void dump_set(int x); void lift_set(int x); #define LCD_BUTTON_LEFT 1 #define LCD_BUTTON_CENTER 2 #define LCD_BUTTON_RIGHT 4 #define LCD_BUTTON_NONE 0 #define LCD_LINE_TOP 0 #define LCD_LINE_BOTTOM 1 void lcd_voltage(void); void lcd_clear(void); // Get rid of annoying "unreferenced function" warnings static void DO_NOT_CALL_THIS_FUNCTION(void) { DO_NOT_CALL_THIS_FUNCTION(); UserControlCodePlaceholderForTesting(); AutonomousCodePlaceholderForTesting(); }
Change "unsigned int" -> "uint" for better GLSL compatibility
#define ATTR_POS 0 #define ATTR_UV 1 #define ATTR_COLOR 2 #define TEXUNIT_TEMP 0 #define TEXUNIT_COLOR 1 #define TEXUNIT_AREATEX 2 #define TEXUNIT_SEARCHTEX 3 #define TEXUNIT_EDGES 4 #define TEXUNIT_BLEND 5 #ifdef __cplusplus struct Globals #else // __cplusplus layout(binding = 0, std140) uniform Globals #endif // __cplusplus { vec4 screenSize; mat4 viewProj; mat4 guiOrtho; }; struct Cube { vec4 rotation; vec3 position; unsigned int color; };
#define ATTR_POS 0 #define ATTR_UV 1 #define ATTR_COLOR 2 #define TEXUNIT_TEMP 0 #define TEXUNIT_COLOR 1 #define TEXUNIT_AREATEX 2 #define TEXUNIT_SEARCHTEX 3 #define TEXUNIT_EDGES 4 #define TEXUNIT_BLEND 5 #ifdef __cplusplus struct Globals #else // __cplusplus layout(binding = 0, std140) uniform Globals #endif // __cplusplus { vec4 screenSize; mat4 viewProj; mat4 guiOrtho; }; struct Cube { vec4 rotation; vec3 position; uint color; };
Remove exception specifier from RandomNumberGenerator::randomize
/************************************************* * RandomNumberGenerator Header File * * (C) 1999-2008 Jack Lloyd * *************************************************/ #ifndef BOTAN_RANDOM_NUMBER_GENERATOR__ #define BOTAN_RANDOM_NUMBER_GENERATOR__ #include <botan/exceptn.h> namespace Botan { /************************************************* * Entropy Source * *************************************************/ class BOTAN_DLL EntropySource { public: virtual u32bit slow_poll(byte[], u32bit) = 0; virtual u32bit fast_poll(byte[], u32bit); virtual ~EntropySource() {} }; /************************************************* * Random Number Generator * *************************************************/ class BOTAN_DLL RandomNumberGenerator { public: virtual void randomize(byte[], u32bit) throw(PRNG_Unseeded) = 0; virtual bool is_seeded() const = 0; virtual void clear() throw() {}; byte next_byte(); void add_entropy(const byte[], u32bit); u32bit add_entropy(EntropySource&, bool = true); virtual ~RandomNumberGenerator() {} private: virtual void add_randomness(const byte[], u32bit) = 0; }; } #endif
/************************************************* * RandomNumberGenerator Header File * * (C) 1999-2008 Jack Lloyd * *************************************************/ #ifndef BOTAN_RANDOM_NUMBER_GENERATOR__ #define BOTAN_RANDOM_NUMBER_GENERATOR__ #include <botan/exceptn.h> namespace Botan { /************************************************* * Entropy Source * *************************************************/ class BOTAN_DLL EntropySource { public: virtual u32bit slow_poll(byte[], u32bit) = 0; virtual u32bit fast_poll(byte[], u32bit); virtual ~EntropySource() {} }; /************************************************* * Random Number Generator * *************************************************/ class BOTAN_DLL RandomNumberGenerator { public: virtual void randomize(byte[], u32bit) = 0; virtual bool is_seeded() const = 0; virtual void clear() throw() {}; byte next_byte(); void add_entropy(const byte[], u32bit); u32bit add_entropy(EntropySource&, bool = true); virtual ~RandomNumberGenerator() {} private: virtual void add_randomness(const byte[], u32bit) = 0; }; } #endif
Set database encoding to UTF8.
#include "pg_query.h" #include "pg_query_internal.h" const char* progname = "pg_query"; void pg_query_init(void) { MemoryContextInit(); }
#include "pg_query.h" #include "pg_query_internal.h" #include <mb/pg_wchar.h> const char* progname = "pg_query"; void pg_query_init(void) { MemoryContextInit(); SetDatabaseEncoding(PG_UTF8); }
Add test for special characters in macro definition
/* name: TEST032 description: test special characters @ and $ in macro definitions output: F3 I G4 F3 main { \ A6 P p A6 "54686973206973206120737472696E672024206F722023206F72202323616E64206974206973206F6B2021 'P :P r A6 #P0 !I } */ #define M1(x) "This is a string $ or # or ##" ## #x int main(void) { char *p = M1(and it is ok!); return p != 0; }
Set removed item's prev/next pointers to NULL.
#ifndef LLIST_H #define LLIST_H /* Doubly linked list */ #define DLLIST_PREPEND(list, item) STMT_START { \ (item)->prev = NULL; \ (item)->next = *(list); \ if (*(list) != NULL) (*(list))->prev = (item); \ *(list) = (item); \ } STMT_END #define DLLIST_REMOVE(list, item) STMT_START { \ if ((item)->prev == NULL) \ *(list) = (item)->next; \ else \ (item)->prev->next = (item)->next; \ if ((item)->next != NULL) \ (item)->next->prev = (item)->prev; \ } STMT_END #endif
#ifndef LLIST_H #define LLIST_H /* Doubly linked list */ #define DLLIST_PREPEND(list, item) STMT_START { \ (item)->prev = NULL; \ (item)->next = *(list); \ if (*(list) != NULL) (*(list))->prev = (item); \ *(list) = (item); \ } STMT_END #define DLLIST_REMOVE(list, item) STMT_START { \ if ((item)->prev == NULL) \ *(list) = (item)->next; \ else \ (item)->prev->next = (item)->next; \ if ((item)->next != NULL) { \ (item)->next->prev = (item)->prev; \ (item)->next = NULL; \ } \ (item)->prev = NULL; \ } STMT_END #endif
Define EIGEN_USE_THREADS only if it is not defined yet
/* Copyright 2019 The TensorFlow Authors. 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 agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_ #define TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_ #define EIGEN_USE_THREADS #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { namespace thread { class ThreadPoolInterface : public Eigen::ThreadPoolInterface {}; } // namespace thread } // namespace tensorflow #endif // TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_
/* Copyright 2019 The TensorFlow Authors. 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 agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_ #define TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_ #ifndef EIGEN_USE_THREADS #define EIGEN_USE_THREADS #endif #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" namespace tensorflow { namespace thread { class ThreadPoolInterface : public Eigen::ThreadPoolInterface {}; } // namespace thread } // namespace tensorflow #endif // TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_
Create separate Solver Analyzer class
// // Sudoku 9by9 Solver and Analyzer // #include "Sudoku9by9Board.h" class Sudoku9by9SolverAnalyzer { private: Sudoku9by9Board *board_ptr; int number_of_solutions; public: Sudoku9by9SolverAnalyzer(); Sudoku9by9SolverAnalyzer(Sudoku9by9Board *board_ptr); bool NextTryOrBackTrack(int i, int j, bool backtrack); void Solve(void); bool Check_Conflicts(int p, int i, int j); int get_number_of_solutions(void); ~Sudoku9by9SolverAnalyzer(); };
Add depth hold mode to enum
#ifndef CONTROL_MODE_ENUM_H #define CONTROL_MODE_ENUM_H namespace ControlModes { enum ControlMode { OPEN_LOOP = 0, SIXDOF = 1, RPY_DEPTH = 2 }; } typedef ControlModes::ControlMode ControlMode; #endif
#ifndef CONTROL_MODE_ENUM_H #define CONTROL_MODE_ENUM_H namespace ControlModes { enum ControlMode { OPEN_LOOP = 0, SIXDOF = 1, RPY_DEPTH = 2, DEPTH_HOLD = 3 }; } typedef ControlModes::ControlMode ControlMode; #endif
Create fidnArgs to replace CombinatorArgs
#include <type_traits> namespace WSTM { //!{ /** * Finds the given type in the given pack of arguments. This is useful for having variadic * argument lists for functions. To have variadic arguments in a function just make the function * a template and take a parameter pack of arguments. Then use findArg to find any given type in * the parameter pack (each argument you want to be able to find needs to have a unique type, * which is easy to arrange by using the FIND_ARG__MAKE_ARG_TYPE macro). findArg will return the * argument of the given type or a default constructed object of the given type if there was no * object of the given type in the argument pack. */ template <typename Wanted_t, typename A_t, typename ... As_t> std::enable_if_t<std::is_same<Wanted_t, A_t>::value, Wanted_t> findArg (const A_t& a, const As_t&...) { return a; } template <typename Wanted_t, typename A_t, typename ... As_t> std::enable_if_t<!std::is_same<Wanted_t, A_t>::value, Wanted_t> findArg (const A_t&, const As_t&... as) { return findArg<Wanted_t> (as...); } template <typename Wanted_t, typename A_t> std::enable_if_t<std::is_same<Wanted_t, A_t>::value, Wanted_t> findArg (const A_t& a) { return a; } template <typename Wanted_t, typename A_t> std::enable_if_t<!std::is_same<Wanted_t, A_t>::value, Wanted_t> findArg (const A_t&) { return Wanted_t (); } template <typename Wanted_t> typename Wanted_t findArg () { return Wanted_t (); } //!} /** * Creates a type for use with findArg. The created type will have a "m_value" member that * contains the actual value for the argument. * * @param type The type for m_value. * @param name The name that shoudl be given to the create type. * @param def The default value for m_value. */ #define MAKE_ARG_TYPE(type, name, def) \ struct name \ { \ type m_value; \ name () : m_value (def) {} \ name (const type value) : m_value (value) {} \ };// }
Set the default bit width to 32.
/* Configuration for the mruby-bignum gem */ #ifndef MRB_BIGNUM_CONF_H #define MRB_BIGNUM_CONF_H /* Size of a Bignum digit: 16, 32 or 64 */ /* If not defined, this is the same size as a Fixnum */ /* To use MRB_BIGNUM_BIT == 64, the compiler must support unsigned __int128 */ #define MRB_BIGNUM_BIT 64 /* Define to enable recursive algorithms for multiplication, division, squaring, and conversion to and from strings */ #define MRB_BIGNUM_ENABLE_RECURSION /* Cutoffs for recursive multiplication, squaring and division */ #define MRB_BIGNUM_MUL_RECURSION_CUTOFF 32 #define MRB_BIGNUM_SQR_RECURSION_CUTOFF 64 #define MRB_BIGNUM_DIV_RECURSION_CUTOFF 32 #endif
/* Configuration for the mruby-bignum gem */ #ifndef MRB_BIGNUM_CONF_H #define MRB_BIGNUM_CONF_H /* Size of a Bignum digit: 16, 32 or 64 */ /* If not defined, this is the same size as a Fixnum */ /* To use MRB_BIGNUM_BIT == 64, the compiler must support unsigned __int128 */ #define MRB_BIGNUM_BIT 32 /* Define to enable recursive algorithms for multiplication, division, squaring, and conversion to and from strings */ #define MRB_BIGNUM_ENABLE_RECURSION /* Cutoffs for recursive multiplication, squaring and division */ #define MRB_BIGNUM_MUL_RECURSION_CUTOFF 32 #define MRB_BIGNUM_SQR_RECURSION_CUTOFF 64 #define MRB_BIGNUM_DIV_RECURSION_CUTOFF 32 #endif
Fix compilation of the ABI test on 64 bit architectures
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include <orc/orc.h> #include <stdio.h> int main (int argc, char *argv[]) { int offset; int expected_offset; int error = 0; offset = ((int) ((unsigned char *) &((OrcProgram*) 0)->code_exec)); if (sizeof(void *) == 4) { expected_offset = 8360; } else { expected_offset = 9688; } if (offset != expected_offset) { printf("ABI bug: OrcProgram->code_exec should be at offset %d instead of %d\n", offset, expected_offset); error = 1; } return error; }
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include <orc/orc.h> #include <stdio.h> int main (int argc, char *argv[]) { long offset; int expected_offset; int error = 0; offset = ((long) ((unsigned char *) &((OrcProgram*) 0)->code_exec)); if (sizeof(void *) == 4) { expected_offset = 8360; } else { expected_offset = 9688; } if (offset != expected_offset) { printf("ABI bug: OrcProgram->code_exec should be at offset %ld instead of %d\n", offset, expected_offset); error = 1; } return error; }
Use stdint.h for unsigned integer typedefs
#ifndef _ARDUINO_COMPAT_H #define _ARDUINO_COMPAT_H #include <stdio.h> #include <stdlib.h> //#include <sys/types.h> //#include <sys/stat.h> #include <fcntl.h> #include <ctype.h> #include <string.h> typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint32_t; typedef bool boolean; //#define uint8_t unsigned char #define FILE_READ O_RDONLY #define FILE_WRITE (O_RDWR | O_CREAT) #endif
#ifndef _ARDUINO_COMPAT_H #define _ARDUINO_COMPAT_H #include <stdio.h> #include <stdlib.h> #include <stdint.h> //#include <sys/types.h> //#include <sys/stat.h> #include <fcntl.h> #include <ctype.h> #include <string.h> typedef bool boolean; //#define uint8_t unsigned char #define FILE_READ O_RDONLY #define FILE_WRITE (O_RDWR | O_CREAT) #endif
Add moduleid and instance id
/* Copyright (C) 2015 Joakim Plate * * 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 later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef SOAD_H_ #define SOAD_H_ #include "TcpIp.h" typedef struct { uint8 dummy; } SoAd_SocketConnection; typedef struct { uint32 headerid; } SoAd_SocketRoute; typedef struct { uint8 dummy; } SoAd_ConfigType; void SoAd_Init(const SoAd_ConfigType* config); void SoAd_MainFunction(void); #endif
/* Copyright (C) 2015 Joakim Plate * * 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 later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef SOAD_H_ #define SOAD_H_ #include "TcpIp.h" #define SOAD_MODULEID 56u #define SOAD_INSTANCEID 0u typedef struct { uint8 dummy; } SoAd_SocketConnection; typedef struct { uint32 headerid; } SoAd_SocketRoute; typedef struct { uint8 dummy; } SoAd_ConfigType; void SoAd_Init(const SoAd_ConfigType* config); void SoAd_MainFunction(void); #endif
Fix test on PS4 which defaults to gnu99 which does not emit the expected warnings.
// RUN: %clang_analyze_cc1 %s -verify \ // RUN: -analyzer-checker=security.insecureAPI void builtin_function_call_crash_fixes(char *c) { __builtin_strncpy(c, "", 6); // expected-warning{{Call to function 'strncpy' is insecure as it does not provide security checks introduced in the C11 standard.}} __builtin_memset(c, '\0', (0)); // expected-warning{{Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard.}} __builtin_memcpy(c, c, 0); // expected-warning{{Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard.}} }
// RUN: %clang_analyze_cc1 %s -verify \ // RUN: -analyzer-checker=security.insecureAPI // RUN: %clang_analyze_cc1 %s -verify -std=gnu11 \ // RUN: -analyzer-checker=security.insecureAPI // RUN: %clang_analyze_cc1 %s -verify -std=gnu99 \ // RUN: -analyzer-checker=security.insecureAPI void builtin_function_call_crash_fixes(char *c) { __builtin_strncpy(c, "", 6); __builtin_memset(c, '\0', (0)); __builtin_memcpy(c, c, 0); #if __STDC_VERSION__ > 199901 // expected-warning@-5{{Call to function 'strncpy' is insecure as it does not provide security checks introduced in the C11 standard.}} // expected-warning@-5{{Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard.}} // expected-warning@-5{{Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard.}} #else // expected-no-diagnostics #endif }
Enable all test suites except the manual folder hierarchy one
#include <stdlib.h> #include <check.h> Suite* eas_daemon_suite (void); Suite* eas_autodiscover_suite (void); Suite* eas_libeasmail_suite (void); Suite* eas_libeascal_suite (void); Suite* eas_libeassync_suite (void); Suite* eas_libeascon_suite (void); Suite* eas_folderhierarchy_suite (void); int main (void) { int number_failed; SRunner* sr = srunner_create (eas_daemon_suite()); // Only to be used manually, updating the sync key to see manual // changes on the server reflected to the client // srunner_add_suite (sr, eas_folderhierarchy_suite()); srunner_add_suite (sr, eas_autodiscover_suite()); srunner_add_suite (sr, eas_libeasmail_suite()); srunner_add_suite (sr, eas_libeascal_suite()); // srunner_add_suite (sr, eas_libeassync_suite()); srunner_add_suite (sr, eas_libeascon_suite()); srunner_set_xml (sr, "eas-daemon_test.xml"); srunner_set_log (sr, "eas-daemon_test.log"); srunner_run_all (sr, CK_NORMAL); number_failed = srunner_ntests_failed (sr); srunner_free (sr); return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
#include <stdlib.h> #include <check.h> Suite* eas_daemon_suite (void); Suite* eas_autodiscover_suite (void); Suite* eas_libeasmail_suite (void); Suite* eas_libeascal_suite (void); Suite* eas_libeassync_suite (void); Suite* eas_libeascon_suite (void); Suite* eas_folderhierarchy_suite (void); int main (void) { int number_failed; SRunner* sr = srunner_create (eas_daemon_suite()); /** Only to be used manually, updating the sync key to see manual * changes on the server reflected to the client */ // srunner_add_suite (sr, eas_folderhierarchy_suite()); srunner_add_suite (sr, eas_autodiscover_suite()); srunner_add_suite (sr, eas_libeasmail_suite()); srunner_add_suite (sr, eas_libeascal_suite()); srunner_add_suite (sr, eas_libeassync_suite()); srunner_add_suite (sr, eas_libeascon_suite()); srunner_set_xml (sr, "eas-daemon_test.xml"); srunner_set_log (sr, "eas-daemon_test.log"); srunner_run_all (sr, CK_NORMAL); number_failed = srunner_ntests_failed (sr); srunner_free (sr); return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; }
Set the MAX_RECURSION macro to 99 instead of 1
#ifndef _SELECTIVE_H #define _SELECTIVE_H #include "psyco.h" #include "codemanager.h" #define FUN_BOUND -1 #define MAX_RECURSION 1 EXTERNVAR PyObject* funcs; EXTERNVAR int ticks; EXTERNFN int do_selective(void *, PyFrameObject *, int, PyObject *); #endif
#ifndef _SELECTIVE_H #define _SELECTIVE_H #include "psyco.h" #include "codemanager.h" #define FUN_BOUND -1 #define MAX_RECURSION 99 EXTERNVAR PyObject* funcs; EXTERNVAR int ticks; EXTERNFN int do_selective(void *, PyFrameObject *, int, PyObject *); #endif
Add missing include (mostly for good practice as it's currently included transitively anyway)
/** * Energy reading for an ODROID with INA231 power sensors, using ioctl on * device files instead of sysfs. * * @author Connor Imes * @date 2015-10-14 */ #ifndef _ENERGYMON_ODROID_IOCTL_H_ #define _ENERGYMON_ODROID_IOCTL_H_ #ifdef __cplusplus extern "C" { #endif #include <stddef.h> #include "energymon.h" int energymon_init_odroid_ioctl(energymon* em); uint64_t energymon_read_total_odroid_ioctl(const energymon* em); int energymon_finish_odroid_ioctl(energymon* em); char* energymon_get_source_odroid_ioctl(char* buffer, size_t n); uint64_t energymon_get_interval_odroid_ioctl(const energymon* em); uint64_t energymon_get_precision_odroid_ioctl(const energymon* em); int energymon_is_exclusive_odroid_ioctl(); int energymon_get_odroid_ioctl(energymon* em); #ifdef __cplusplus } #endif #endif
/** * Energy reading for an ODROID with INA231 power sensors, using ioctl on * device files instead of sysfs. * * @author Connor Imes * @date 2015-10-14 */ #ifndef _ENERGYMON_ODROID_IOCTL_H_ #define _ENERGYMON_ODROID_IOCTL_H_ #ifdef __cplusplus extern "C" { #endif #include <inttypes.h> #include <stddef.h> #include "energymon.h" int energymon_init_odroid_ioctl(energymon* em); uint64_t energymon_read_total_odroid_ioctl(const energymon* em); int energymon_finish_odroid_ioctl(energymon* em); char* energymon_get_source_odroid_ioctl(char* buffer, size_t n); uint64_t energymon_get_interval_odroid_ioctl(const energymon* em); uint64_t energymon_get_precision_odroid_ioctl(const energymon* em); int energymon_is_exclusive_odroid_ioctl(); int energymon_get_odroid_ioctl(energymon* em); #ifdef __cplusplus } #endif #endif
Set about dialog title through static const variable
#include <gtk/gtk.h> GtkWidget * gh_about_dialog_create () { GtkWidget *dialog; dialog = gtk_about_dialog_new (); return dialog; }
#include <gtk/gtk.h> GtkWidget * gh_about_dialog_create () { GtkWidget *dialog; dialog = gtk_about_dialog_new (); static gchar const *title = "About ghighlighter"; gtk_window_set_title (GTK_WINDOW (dialog), title); return dialog; }
Add removed TCE type definitions back.
typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint; #define __EMBEDDED_PROFILE__ 1 #undef cles_khr_int64 #define cl_khr_fp16 #undef cl_khr_fp64 typedef uint size_t; typedef int ptrdiff_t; typedef int intptr_t; typedef uint uintptr_t;
Add proper import for NIOperations
// // Copyright 2011-2014 NimbusKit // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // @interface NIOperation() @property (strong) NSError* lastError; @end
// // Copyright 2011-2014 NimbusKit // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #import "NIOperations.h" @interface NIOperation() @property (strong) NSError* lastError; @end
Remove test scrolling code from idle_process
#include <logging.h> #include <cedille/pmm.h> #include <cedille/heap.h> extern uint32_t _kernel_start,_kernel_end; void vmm_init(); void kprocess_init(); void timing_system_engine_reportstatustoconsole(); void kernel_doperiodic(int force, int tick); int kernel_idle_process() { int i = 0; for(;;) { // Attempt to reschedule other processes unless things need to be done // So, check if theres anything that needs to be done (like kernel state verification) // Execute that, make sure everything is preemptable // Then, attempt to reschedule processes if there isn't anything. // Otherwise cpu time is wasted. if(i != 500) { printf("test%d\n",i++); } } return 0; } int kmain() { low_printname(); init_early_malloc(&_kernel_end); init_pmm(); vmm_init(); heap_init(); timing_system_engine_reportstatustoconsole(); kernel_doperiodic(1,0); // Force stuff to happen once at the end of initialisation kernel_idle_process(); return 0; }
#include <logging.h> #include <cedille/pmm.h> #include <cedille/heap.h> extern uint32_t _kernel_start,_kernel_end; void vmm_init(); void kprocess_init(); void timing_system_engine_reportstatustoconsole(); void kernel_doperiodic(int force, int tick); int kernel_idle_process() { for(;;) { // Attempt to reschedule other processes unless things need to be done // So, check if theres anything that needs to be done (like kernel state verification) // Execute that, make sure everything is preemptable // Then, attempt to reschedule processes if there isn't anything. // Otherwise cpu time is wasted. } return 0; } int kmain() { low_printname(); init_early_malloc(&_kernel_end); init_pmm(); vmm_init(); heap_init(); timing_system_engine_reportstatustoconsole(); kernel_doperiodic(1,0); // Force stuff to happen once at the end of initialisation kernel_idle_process(); return 0; }
Simplify error handling for missing/unknown numerals
#include <string.h> #include "roman_convert_to_int.h" int roman_convert_to_int(const char *numeral) { if (!numeral) { return -1; } const char first_letter = *numeral; switch (first_letter) { case 'I': return 1; case 'V': return 5; case 'X': return 10; case 'L': return 50; case 'C': return 100; case 'D': return 500; case 'M': return 1000; default: return -1; } }
#include <string.h> #include "roman_convert_to_int.h" int roman_convert_to_int(const char *numeral) { const char first_letter = numeral ? *numeral : '?'; switch (first_letter) { case 'I': return 1; case 'V': return 5; case 'X': return 10; case 'L': return 50; case 'C': return 100; case 'D': return 500; case 'M': return 1000; default: return -1; } }
Add failing test without threadescape
// PARAM: --set ana.activated "['base','mallocWrapper','threadflag']" #include <pthread.h> int g = 10; void* t(void *v) { int* p = (int*) v; *p = 4711; } int main(void){ int l = 42; pthread_t tid; pthread_create(&tid, NULL, t, (void *)&l); pthread_join(tid, NULL); assert(l==42); //UNKNOWN! return 0; }
Update fields checksum (no changes, order only)
/* Copyright (C) 2021 The Falco Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // The version of rules/filter fields/etc supported by this Falco // engine. #define FALCO_ENGINE_VERSION (11) // This is the result of running "falco --list -N | sha256sum" and // represents the fields supported by this version of Falco. It's used // at build time to detect a changed set of fields. #define FALCO_FIELDS_CHECKSUM "9822482ceda8c4ee3475e698ba35a74c5e7abf971deb4e989e26415434bbd89b"
/* Copyright (C) 2021 The Falco Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // The version of rules/filter fields/etc supported by this Falco // engine. #define FALCO_ENGINE_VERSION (11) // This is the result of running "falco --list -N | sha256sum" and // represents the fields supported by this version of Falco. It's used // at build time to detect a changed set of fields. #define FALCO_FIELDS_CHECKSUM "4de812495f8529ac20bda2b9774462b15911a51df293d59fe9ccb6b922fdeb9d"