commit
stringlengths
40
40
old_file
stringlengths
4
112
new_file
stringlengths
4
112
old_contents
stringlengths
0
2.05k
new_contents
stringlengths
28
3.9k
subject
stringlengths
17
736
message
stringlengths
18
4.78k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
7
111k
0164cb003172e6e3224498eb77bbf14ca5ece039
mfmod.c
mfmod.c
#include <linux/module.h> #include <linux/kernel.h> #include <linux/netfilter.h> #include <linux/netfilter_ipv4.h> static struct nf_hook_ops nfho; unsigned int hook_func(unsigned int hooknum, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { return NF_DROP; } int init_module() { nfho.hook = hook_func; nfho.hooknum = NF_INET_PRE_ROUTING; nfho.pf = PF_INET; nfho.priority = NF_IP_PRI_FIRST; nf_register_hook(&nfho); return 0; } void cleanup_module() { nf_unregister_hook(&nfho); }
#include <linux/module.h> #include <linux/kernel.h> #include <linux/netfilter.h> #include <linux/netfilter_ipv4.h> static struct nf_hook_ops nfho; unsigned int hook_func(unsigned int hooknum, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *)) { socket_buff = skb; if (!socket_buff) { return NF_ACCEPT; } else { ip_header = (stuct iphdr *)skb_network_header(socket_buff); // Network header // Drop all ICMP packets if (ip_header->protocol == IPPROTO_ICMP) { return NF_DROP; } } } int init_module() { nfho.hook = hook_func; nfho.hooknum = NF_INET_PRE_ROUTING; nfho.pf = PF_INET; nfho.priority = NF_IP_PRI_FIRST; nf_register_hook(&nfho); return 0; } void cleanup_module() { nf_unregister_hook(&nfho); }
Set hook to block all ICMP packets
Set hook to block all ICMP packets
C
mit
Muhlenberg/mfw
7fb4952ef5c9814ac18e6211ac5dbb70530d559b
inc/ArgParse/ArgObject.h
inc/ArgParse/ArgObject.h
#ifndef ARGPARSE_ArgObject_HDR #define ARGPARSE_ArgObject_HDR #include <string> namespace ArgParse { class ArgObject { public: typedef int Accept_t; static const Accept_t No; static const Accept_t WithArg; static const Accept_t WithoutArg; ArgObject(); virtual ~ArgObject(); virtual Accept_t AcceptsArgument(std::string arg) = 0; virtual int PassArgument(std::string arg, std::string opt, bool with_opt) = 0; virtual bool IsReady() = 0; virtual std::string GetHelpText() = 0; }; } #endif
#ifndef ARGPARSE_ArgObject_HDR #define ARGPARSE_ArgObject_HDR #include <string> namespace ArgParse { class ArgObject { public: typedef int Accept_t; static const Accept_t No; static const Accept_t WithArg; static const Accept_t WithoutArg; ArgObject(); virtual ~ArgObject(); virtual Accept_t AcceptsArgument(std::string arg) __attribute__((warn_unused_result)) = 0; virtual int PassArgument(std::string arg, std::string opt, bool with_opt) __attribute__((warn_unused_result)) = 0; virtual bool IsReady() __attribute__((warn_unused_result)) = 0; virtual std::string GetHelpText() = 0; }; } #endif
Add warn_unused_result to the ArgParse functions
Add warn_unused_result to the ArgParse functions Which return a value.
C
mit
krafczyk/ArgParse,krafczyk/ArgParse
efb9ca08b5a2374b29938cdcab417ce4feb14b54
include/asm-mips/timex.h
include/asm-mips/timex.h
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1998, 1999, 2003 by Ralf Baechle */ #ifndef _ASM_TIMEX_H #define _ASM_TIMEX_H #ifdef __KERNEL__ #include <asm/mipsregs.h> /* * This is the clock rate of the i8253 PIT. A MIPS system may not have * a PIT by the symbol is used all over the kernel including some APIs. * So keeping it defined to the number for the PIT is the only sane thing * for now. */ #define CLOCK_TICK_RATE 1193182 /* * Standard way to access the cycle counter. * Currently only used on SMP for scheduling. * * Only the low 32 bits are available as a continuously counting entity. * But this only means we'll force a reschedule every 8 seconds or so, * which isn't an evil thing. * * We know that all SMP capable CPUs have cycle counters. */ typedef unsigned int cycles_t; static inline cycles_t get_cycles(void) { return read_c0_count(); } #endif /* __KERNEL__ */ #endif /* _ASM_TIMEX_H */
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1998, 1999, 2003 by Ralf Baechle */ #ifndef _ASM_TIMEX_H #define _ASM_TIMEX_H #ifdef __KERNEL__ #include <asm/mipsregs.h> /* * This is the clock rate of the i8253 PIT. A MIPS system may not have * a PIT by the symbol is used all over the kernel including some APIs. * So keeping it defined to the number for the PIT is the only sane thing * for now. */ #define CLOCK_TICK_RATE 1193182 /* * Standard way to access the cycle counter. * Currently only used on SMP for scheduling. * * Only the low 32 bits are available as a continuously counting entity. * But this only means we'll force a reschedule every 8 seconds or so, * which isn't an evil thing. * * We know that all SMP capable CPUs have cycle counters. */ typedef unsigned int cycles_t; static inline cycles_t get_cycles(void) { return 0; } #endif /* __KERNEL__ */ #endif /* _ASM_TIMEX_H */
Change get_cycles to always return 0.
[MIPS] Change get_cycles to always return 0. This avoids us executing an mfc0 c0_count instruction on processors which don't have but also on certain R4000 and R4400 versions where reading from the count register just in the very moment when its value equals c0_compare will result in the timer interrupt getting lost. There is still a number of users of get_cycles remaining outside the arch code: crypto/tcrypt.c: start = get_cycles(); crypto/tcrypt.c: end = get_cycles(); crypto/tcrypt.c: start = get_cycles(); crypto/tcrypt.c: end = get_cycles(); crypto/tcrypt.c: start = get_cycles(); crypto/tcrypt.c: end = get_cycles(); drivers/char/hangcheck-timer.c: return get_cycles(); drivers/char/hangcheck-timer.c: printk("Hangcheck: Using get_cycles().\n"); drivers/char/random.c: sample.cycles = get_cycles(); drivers/input/joystick/analog.c:#define GET_TIME(x) do { x = get_cycles(); } include/linux/arcdevice.h: _x = get_cycles(); \ include/linux/arcdevice.h: _y = get_cycles(); \ mm/slub.c: if (!s->defrag_ratio || get_cycles() % 1024 > s->defrag_ratio) mm/slub.c: p += 64 + (get_cycles() & 0xff) * sizeof(void *); Signed-off-by: Ralf Baechle <[email protected]>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
2abcf136b51489096ea00b605e820668bd005945
tests/regression/34-localization/05-nested.w.counter.c
tests/regression/34-localization/05-nested.w.counter.c
// Variant of nested.c with a counter. void main() { int z = 0; for (int i=0; i<10 ; i++) { z = z+1; for (int j = 0; j < 10 ; j++) ; z = z+1; } return ; }
// Variant of nested.c with a counter. void main() { int z = 0; for (int i=0; i<10 ; i++) { z = z+1; for (int j = 0; j < 10 ; j++) ; z = z+1; // was this intended to be inner loop? } return ; }
Indent file; maybe delete it?
Indent file; maybe delete it?
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
c8bb04566667228539a35ab38c1538882c77e063
Libs/XNAT/Core/ctkXnatListModel.h
Libs/XNAT/Core/ctkXnatListModel.h
/*============================================================================= Library: XNAT/Core Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics 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 CTKXNATLISTMODEL_H #define CTKXNATLISTMODEL_H #include "QAbstractListModel" #include "ctkXNATCoreExport.h" class ctkXnatObject; /** * @ingroup XNAT_Core */ class CTK_XNAT_CORE_EXPORT ctkXnatListModel : public QAbstractListModel { Q_OBJECT public: ctkXnatListModel(); void setRootObject(ctkXnatObject* root); ctkXnatObject* rootObject(); int rowCount(const QModelIndex &parent) const; QVariant data(const QModelIndex &index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const; private: ctkXnatObject* RootObject; }; #endif // CTKXNATLISTMODEL_H
/*============================================================================= Library: XNAT/Core Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics 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 CTKXNATLISTMODEL_H #define CTKXNATLISTMODEL_H #include "QAbstractListModel" #include "ctkXNATCoreExport.h" class ctkXnatObject; /** * @ingroup XNAT_Core */ class CTK_XNAT_CORE_EXPORT ctkXnatListModel : public QAbstractListModel { Q_OBJECT public: ctkXnatListModel(); void setRootObject(ctkXnatObject* root); ctkXnatObject* rootObject(); int rowCount(const QModelIndex &parent) const; QVariant data(const QModelIndex &index, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const; protected: ctkXnatObject* RootObject; }; #endif // CTKXNATLISTMODEL_H
Make root object protected to allow access to the root object from within subclasses.
Make root object protected to allow access to the root object from within subclasses.
C
apache-2.0
msmolens/CTK,CJGoch/CTK,commontk/CTK,msmolens/CTK,151706061/CTK,sankhesh/CTK,SINTEFMedtek/CTK,SINTEFMedtek/CTK,151706061/CTK,SINTEFMedtek/CTK,Heather/CTK,jcfr/CTK,commontk/CTK,CJGoch/CTK,151706061/CTK,ddao/CTK,SINTEFMedtek/CTK,laurennlam/CTK,CJGoch/CTK,Sardge/CTK,naucoin/CTK,fedorov/CTK,danielknorr/CTK,sankhesh/CTK,151706061/CTK,naucoin/CTK,AndreasFetzer/CTK,jcfr/CTK,danielknorr/CTK,commontk/CTK,SINTEFMedtek/CTK,CJGoch/CTK,AndreasFetzer/CTK,Heather/CTK,commontk/CTK,ddao/CTK,msmolens/CTK,ddao/CTK,fedorov/CTK,laurennlam/CTK,danielknorr/CTK,Sardge/CTK,sankhesh/CTK,rkhlebnikov/CTK,fedorov/CTK,jcfr/CTK,CJGoch/CTK,sankhesh/CTK,Sardge/CTK,mehrtash/CTK,danielknorr/CTK,AndreasFetzer/CTK,fedorov/CTK,mehrtash/CTK,mehrtash/CTK,AndreasFetzer/CTK,151706061/CTK,naucoin/CTK,rkhlebnikov/CTK,rkhlebnikov/CTK,Heather/CTK,jcfr/CTK,laurennlam/CTK,rkhlebnikov/CTK,naucoin/CTK,laurennlam/CTK,mehrtash/CTK,Sardge/CTK,jcfr/CTK,ddao/CTK,Heather/CTK,msmolens/CTK
0137d0eec37a833a2ba575d25aeef8400cc459c7
RZCollectionList/RZCollectionList.h
RZCollectionList/RZCollectionList.h
// // RZCollectionList.h // RZCollectionList // // Created by Nick Donaldson on 6/21/13. // Copyright (c) 2013 Raizlabs. All rights reserved. // /************************************************************ * * Include this file to get all the collection lists you need! * ************************************************************/ #import "RZCollectionListProtocol.h" #import "RZArrayCollectionList.h" #import "RZFetchedCollectionList.h" #import "RZFilteredCollectionList.h" #import "RZSortedCollectionList.h" #import "RZCompositeCollectionList.h" #import "RZCollectionListTableViewDataSource.h" #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0) #import "RZcollectionListCollectionViewDataSource.h" #endif // Category for helping construct fetch requests #import "NSFetchRequest+RZCreationHelpers.h"
// // RZCollectionList.h // RZCollectionList // // Created by Nick Donaldson on 6/21/13. // Copyright (c) 2013 Raizlabs. All rights reserved. // /************************************************************ * * Include this file to get all the collection lists at once * ************************************************************/ #import "RZArrayCollectionList.h" #import "RZFetchedCollectionList.h" #import "RZFilteredCollectionList.h" #import "RZSortedCollectionList.h" #import "RZCompositeCollectionList.h" #import "RZCollectionListTableViewDataSource.h" #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0) #import "RZcollectionListCollectionViewDataSource.h" #endif // Category for helping construct fetch requests #import "NSFetchRequest+RZCreationHelpers.h"
Remove protocol from umbrella header
Remove protocol from umbrella header
C
mit
Raizlabs/RZCollectionList
720d566d03e23418b7bb3cff2f74ef7d95c6a459
json_inttypes.h
json_inttypes.h
#ifndef _json_inttypes_h_ #define _json_inttypes_h_ #include "json_config.h" #if defined(_MSC_VER) && _MSC_VER <= 1700 /* Anything less than Visual Studio C++ 10 is missing stdint.h and inttypes.h */ typedef __int32 int32_t; #define INT32_MIN ((int32_t)_I32_MIN) #define INT32_MAX ((int32_t)_I32_MAX) typedef __int64 int64_t; #define INT64_MIN ((int64_t)_I64_MIN) #define INT64_MAX ((int64_t)_I64_MAX) #define PRId64 "I64d" #define SCNd64 "I64d" #else #ifdef JSON_C_HAVE_INTTYPES_H #include <inttypes.h> #endif /* inttypes.h includes stdint.h */ #endif #endif
#ifndef _json_inttypes_h_ #define _json_inttypes_h_ #include "json_config.h" #ifdef JSON_C_HAVE_INTTYPES_H /* inttypes.h includes stdint.h */ #include <inttypes.h> #else #include <stdint.h> #define PRId64 "I64d" #define SCNd64 "I64d" #endif #endif
Define macros from inttypes.h when not available
Define macros from inttypes.h when not available
C
mit
cubieb/json-c,PureSwift/json-c,Nzbuu/json-c,PureSwift/json-c,haoranzeus/json-c,Amineahd/json-c,rgerhards/json-c,cubieb/json-c,alagoutte/json-c,rgerhards/json-c,cubieb/json-c,Nzbuu/json-c,chenha0/json-c,colemancda/json-c,alagoutte/json-c,haoranzeus/json-c,rgerhards/json-c,colemancda/json-c,chenha0/json-c,Nzbuu/json-c,PureSwift/json-c,haoranzeus/json-c,colemancda/json-c,PureSwift/json-c,Amineahd/json-c,chenha0/json-c,Nzbuu/json-c,Amineahd/json-c,alagoutte/json-c
3ef9314bab0e371027d8538f061211fe6fda4d17
src/ft_vdprintf.c
src/ft_vdprintf.c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_vdprintf.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: jlagneau <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/04/17 18:58:30 by jlagneau #+# #+# */ /* Updated: 2017/04/22 14:18:29 by jlagneau ### ########.fr */ /* */ /* ************************************************************************** */ #include <libft.h> #include <ft_printf.h> int ft_vdprintf(int fd, const char *format, va_list ap) { int ret; char str[FT_PRINTF_MAX_LEN]; ft_bzero(str, FT_PRINTF_MAX_LEN); if (ft_strlen(format) > FT_PRINTF_MAX_LEN - 1) { ft_putstr_fd(str, fd); return (-1); } ret = ft_vsprintf(str, format, ap); ft_putstr_fd(str, fd); return (ret); }
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_vdprintf.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: jlagneau <[email protected]> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/04/17 18:58:30 by jlagneau #+# #+# */ /* Updated: 2017/04/22 14:22:04 by jlagneau ### ########.fr */ /* */ /* ************************************************************************** */ #include <libft.h> #include <ft_printf.h> int ft_vdprintf(int fd, const char *format, va_list ap) { int ret; char str[FT_PRINTF_MAX_LEN]; ft_bzero(str, FT_PRINTF_MAX_LEN); if (ft_strlen(format) > FT_PRINTF_MAX_LEN - 1) { ft_putstr_fd(format, fd); return (-1); } ret = ft_vsprintf(str, format, ap); ft_putstr_fd(str, fd); return (ret); }
Print format if the length is longer than printf max length
Print format if the length is longer than printf max length
C
mit
jlagneau/libftprintf,jlagneau/libftprintf
44acf7ff36b39e2af95bb8db453189b70b39d39a
arch/x86/kernel/bt.c
arch/x86/kernel/bt.c
#include <kernel/panic.h> #include <macros.h> #include <stdio.h> #include <types.h> #define MAX_STACK_FRAME 10000 /* * Walk up the stack and print the locations of each stack frame base. */ void bt(void) { u32 *ebp, *eip; unsigned int sf = 0; /* Start form the current stack base */ asm volatile("mov %%ebp, %0" : "=r" (ebp)); /* Continue until you reach a zeroed stack base pointer. The initial ebp * value is zeroed at boot, but note that this could be corrupted in the * case of serious memory corruption. To protect against this, we keep * track of the frame number and break if it exceeds a reasonable * maximum value. */ while (ebp) { eip = ebp + 1; printf("#%d [0x%x]\n", sf, *eip); ebp = (u32*)*ebp; sf++; /* break if exceeded maximum */ if (sf > MAX_STACK_FRAME) break; } }
#include <kernel/panic.h> #include <elf.h> #include <macros.h> #include <stdio.h> #include <types.h> #define MAX_STACK_FRAME 10000 /* * Walk up the stack and print the locations of each stack frame base. */ void bt(void) { u32 *ebp, *eip; unsigned int sf = 0; /* Start form the current stack base */ asm volatile("mov %%ebp, %0" : "=r" (ebp)); /* Continue until you reach a zeroed stack base pointer. The initial ebp * value is zeroed at boot, but note that this could be corrupted in the * case of serious memory corruption. To protect against this, we keep * track of the frame number and break if it exceeds a reasonable * maximum value. */ while (ebp) { eip = ebp + 1; printf("#%d [0x%x] %s\n", sf, *eip, symbol_from_elf(&kelf, *eip)); ebp = (u32*)*ebp; sf++; /* break if exceeded maximum */ if (sf > MAX_STACK_FRAME) break; } }
Print symbol names in backtrace
arch/x86: Print symbol names in backtrace This transforms: #0 [0x1018C7] #1 [0x101636] #2 [0x100231] into: #0 [0x1018C7] panic #1 [0x101636] k_main #2 [0x100231] start
C
mit
ChrisCummins/euclid,ChrisCummins/euclid,ChrisCummins/euclid
1ca1f8f6b3aaf6d7f93262594578dfad404bd94e
arch/mips/include/asm/types.h
arch/mips/include/asm/types.h
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle * Copyright (C) 2008 Wind River Systems, * written by Ralf Baechle * Copyright (C) 1999 Silicon Graphics, Inc. */ #ifndef _ASM_TYPES_H #define _ASM_TYPES_H #include <asm-generic/int-ll64.h> #include <uapi/asm/types.h> /* * These aren't exported outside the kernel to avoid name space clashes */ #ifndef __ASSEMBLY__ /* * Don't use phys_addr_t. You've been warned. */ #ifdef CONFIG_PHYS_ADDR_T_64BIT typedef unsigned long long phys_addr_t; #else typedef unsigned long phys_addr_t; #endif #endif /* __ASSEMBLY__ */ #endif /* _ASM_TYPES_H */
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle * Copyright (C) 2008 Wind River Systems, * written by Ralf Baechle * Copyright (C) 1999 Silicon Graphics, Inc. */ #ifndef _ASM_TYPES_H #define _ASM_TYPES_H #include <asm-generic/int-ll64.h> #include <uapi/asm/types.h> #endif /* _ASM_TYPES_H */
Remove now unused definition of phys_t.
MIPS: Remove now unused definition of phys_t. Signed-off-by: Ralf Baechle <[email protected]>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
77cd208abac5095c288ff103709a8ddd4d4e8b3d
Sources/OCAObject.h
Sources/OCAObject.h
// // OCAObject.h // Objective-Chain // // Created by Martin Kiss on 30.12.13. // Copyright © 2014 Martin Kiss. All rights reserved. // #import <Foundation/Foundation.h> #define OCA_atomic atomic #define OCALazyGetter(TYPE, PROPERTY) \ @synthesize PROPERTY = _##PROPERTY; \ - (TYPE)PROPERTY { \ if ( ! self->_##PROPERTY) { \ self->_##PROPERTY = [self oca_lazyGetter_##PROPERTY]; \ } \ return self->_##PROPERTY; \ } \ - (TYPE)oca_lazyGetter_##PROPERTY \ #if !defined(NS_BLOCK_ASSERTIONS) #define OCAAssert(CONDITION, MESSAGE, ...) \ if ( ! (CONDITION) && (( [[NSAssertionHandler currentHandler] \ handleFailureInFunction: [NSString stringWithUTF8String:__PRETTY_FUNCTION__] \ file: [NSString stringWithUTF8String:__FILE__] \ lineNumber: __LINE__ \ description: (MESSAGE), ##__VA_ARGS__], YES)) ) // Will NOT execute appended code, if exception is thrown. #else #define OCAAssert(CONDITION, MESSAGE, ...)\ if ( ! (CONDITION) && (( NSLog(@"*** Assertion failure in %s, %s:%d, Condition not satisfied: %s, reason: '" MESSAGE "'", __PRETTY_FUNCTION__, __FILE__, __LINE__, #CONDITION, ##__VA_ARGS__), YES)) ) // Will execute appended code. #endif @interface OCAObject : NSObject @end
// // OCAObject.h // Objective-Chain // // Created by Martin Kiss on 30.12.13. // Copyright © 2014 Martin Kiss. All rights reserved. // #import <Foundation/Foundation.h> #define OCA_atomic atomic #define OCALazyGetter(TYPE, PROPERTY) \ @synthesize PROPERTY = _##PROPERTY; \ - (TYPE)PROPERTY { \ if ( ! self->_##PROPERTY) { \ self->_##PROPERTY = [self oca_lazyGetter_##PROPERTY]; \ } \ return self->_##PROPERTY; \ } \ - (TYPE)oca_lazyGetter_##PROPERTY \ #if !defined(NS_BLOCK_ASSERTIONS) #define OCAAssert(CONDITION, MESSAGE, ...) \ if ( ! (CONDITION) && (( [[NSAssertionHandler currentHandler] \ handleFailureInFunction: [NSString stringWithUTF8String:__PRETTY_FUNCTION__] \ file: [NSString stringWithUTF8String:__FILE__] \ lineNumber: __LINE__ \ description: (MESSAGE), ##__VA_ARGS__], YES)) ) // Will NOT execute appended code, if exception is thrown. #else #define OCAAssert(CONDITION, MESSAGE, ...)\ if ( ! (CONDITION) && (( NSLog(@"*** Assertion failure in %s, %s:%d, Condition not satisfied: %s, reason: '" MESSAGE "'", __PRETTY_FUNCTION__, __FILE__, __LINE__, #CONDITION, ##__VA_ARGS__), YES)) ) // Will execute appended code. #endif @interface OCAObject : NSObject @end
Fix indentation of Assert macros
Fix indentation of Assert macros
C
mit
Tricertops/Objective-Chain,iMartinKiss/Objective-Chain
c91692c18f236014fb058fabb517eb19949f1cae
src/dukbind_std.h
src/dukbind_std.h
#pragma once #ifndef DUKTAPE_H_INCLUDED #error Duktape.h should be included before this header #endif #include <vector> namespace dukbind { template< typename _Type_ > void Push( duk_context * ctx, const std::vector<_Type_> & table ) { size_t index, end = table.size(); duk_idx_t arr_idx = duk_push_array( ctx ); for( index = 0; index < end; ++index ) { Push( ctx, table[ index ], (_Type_*)0 ); duk_put_prop_index( ctx, arr_idx, index ); } } std::string Get( duk_context * ctx, const int index, const std::string * ); void Push( duk_context * ctx, const std::string & value ); }
#pragma once #ifndef DUKTAPE_H_INCLUDED #error Duktape.h should be included before this header #endif #include <vector> namespace dukbind { template< typename _Type_ > void Push( duk_context * ctx, const std::vector<_Type_> & table ) { size_t index, end = table.size(); duk_idx_t arr_idx = duk_push_array( ctx ); for( index = 0; index < end; ++index ) { Push( ctx, table[ index ] ); duk_put_prop_index( ctx, arr_idx, index ); } } std::string Get( duk_context * ctx, const int index, const std::string * ); void Push( duk_context * ctx, const std::string & value ); }
Fix for new Push signature
Fix for new Push signature
C
mit
crazyjul/dukbind,crazyjul/dukbind
d579fd0a3cea2f4a04096e2116794daba6bf6eec
src/rcimmixcons.h
src/rcimmixcons.h
// Copyright (c) <2015> <lummax> // Licensed under MIT (http://opensource.org/licenses/MIT) #ifndef RCIMMIXCONS_H #define RCIMMIXCONS_H #include <stdint.h> #include <stdlib.h> typedef struct { size_t reference_count; uint8_t spans_lines; uint8_t forwarded; uint8_t logged; uint8_t marked; uint8_t new; } GCHeader; typedef struct { size_t object_size; size_t num_members; } GCRTTI; typedef struct { GCHeader header; GCRTTI* rtti; } GCObject; typedef struct {} RCImmixCons; RCImmixCons* rcx_create(); GCObject* rcx_allocate(RCImmixCons* collector, GCRTTI* rtti); void rcx_collect(RCImmixCons* collector, uint8_t evacuation, uint8_t cycle_collect); void rcx_write_barrier(RCImmixCons* collector, GCObject* object); void rcx_destroy(RCImmixCons* collector); #endif
// Copyright (c) <2015> <lummax> // Licensed under MIT (http://opensource.org/licenses/MIT) #ifndef RCIMMIXCONS_H #define RCIMMIXCONS_H #include <stdint.h> #include <stdlib.h> typedef struct { size_t reference_count; uint8_t spans_lines; uint8_t forwarded; uint8_t logged; uint8_t marked; uint8_t pinned; uint8_t new; } GCHeader; typedef struct { size_t object_size; size_t num_members; } GCRTTI; typedef struct { GCHeader header; GCRTTI* rtti; } GCObject; typedef struct {} RCImmixCons; RCImmixCons* rcx_create(); GCObject* rcx_allocate(RCImmixCons* collector, GCRTTI* rtti); void rcx_collect(RCImmixCons* collector, uint8_t evacuation, uint8_t cycle_collect); void rcx_write_barrier(RCImmixCons* collector, GCObject* object); void rcx_destroy(RCImmixCons* collector); #endif
Fix C-FFI: added pinned mark
Fix C-FFI: added pinned mark
C
mit
lummax/librcimmixcons,lummax/librcimmixcons,lummax/librcimmixcons,lummax/librcimmixcons
abc838f5e263c42082c324d84c1dcf47074656bc
src/Logger.h
src/Logger.h
// Copyright eeGeo Ltd (2012-2014), All Rights Reserved #pragma once #include "Types.h" #if defined(EEGEO_DROID) #include <android/log.h> #define EXAMPLE_LOG(...) __android_log_print(ANDROID_LOG_INFO,"Eegeo_Examples",__VA_ARGS__) #else #define EXAMPLE_LOG(...) printf(__VA_ARGS__) #endif
// Copyright eeGeo Ltd (2012-2014), All Rights Reserved #pragma once #define EXAMPLE_LOG(...) printf(__VA_ARGS__)
Remove references to Android from iOS API logger.
Remove references to Android from iOS API logger.
C
bsd-2-clause
wrld3d/ios-api,wrld3d/ios-api,wrld3d/ios-api,wrld3d/ios-api
d352a1145f833ee804dff6576b4c0d5ee04cb099
quickdialog/QImageElement.h
quickdialog/QImageElement.h
// // Copyright 2012 Ludovic Landry - http://about.me/ludoviclandry // // 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> #import <UIKit/UIKit.h> #import "QRootElement.h" @interface QImageElement : QEntryElement @property (nonatomic, strong) UIImage *imageValue; @property (nonatomic, strong) NSString *imageValueNamed; @property (nonatomic, assign) float imageMaxLength; @property(nonatomic) enum UIImagePickerControllerSourceType source; - (QImageElement *)initWithTitle:(NSString *)title detailImage:(UIImage *)image; @end
// // Copyright 2012 Ludovic Landry - http://about.me/ludoviclandry // // 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> #import <UIKit/UIKit.h> #import "QRootElement.h" @interface QImageElement : QEntryElement @property (nonatomic, strong) UIImage *imageValue; @property (nonatomic, strong) NSString *imageValueNamed; @property (nonatomic, assign) float imageMaxLength; @property(nonatomic) UIImagePickerControllerSourceType source; - (QImageElement *)initWithTitle:(NSString *)title detailImage:(UIImage *)image; @end
Fix bug that was causing error building pod in RubyMotion project
Fix bug that was causing error building pod in RubyMotion project
C
mit
raiffeisennet/QuickDialog
ad5914fb29c4e32b2979bb4445a8a65eee90d625
main.c
main.c
#pragma config(Motor, port2, shooterleft, tmotorVex393_MC29, openLoop, reversed) #pragma config(Motor, port3, shooterright, tmotorVex393_MC29, openLoop) #pragma config(Motor, port4, spinnyintakeofdoomnumber1, tmotorVex393_MC29, openLoop) #pragma config(Motor, port5, garry, tmotorVex393_MC29, openLoop) #pragma config(Motor, port6, therollmodel, tmotorVex393_MC29, openLoop) #include "controller.h" #include "drive.h" #include "drive.c" task main() { while(1) { motor[shooterleft] = motor[shooterright] = 127; motor[spinnyintakeofdoomnumber1] = motor[garry] = motor[therollmodel] = 127; } }
#pragma config(Motor, port2, shooterleft, tmotorVex393_MC29, openLoop, reversed) #pragma config(Motor, port3, shooterright, tmotorVex393_MC29, openLoop) #pragma config(Motor, port4, spinnyintakeofdoomnumber1, tmotorVex393_MC29, openLoop) #pragma config(Motor, port5, garry, tmotorVex393_MC29, openLoop) #pragma config(Motor, port6, therollmodel, tmotorVex393_MC29, openLoop) #include "controller.h" #include "drive.h" /* "Link" with other files */ #include "drive.c" task main() { while(1) { motor[shooterleft] = motor[shooterright] = 127; motor[spinnyintakeofdoomnumber1] = motor[garry] = motor[therollmodel] = 127; } }
Add comment about ROBOTC "linking"
Add comment about ROBOTC "linking"
C
apache-2.0
IceAxeWarriors143A/NothingButNet2015,IceAxeWarriors143A/NothingButNet2015
bc686c34cb64bb3bfa636643367903f572fe8ece
src/kernel.c
src/kernel.c
#include "terminal.h" #include "multiboot.h" #include "pic.h" #include "keyboard.h" #include "frame_allocator.h" #include "paging.h" #include "assert.h" //Calling convention on x86-64 System V ABI //rdi, rsi, rdx, rcx for ints void kernel_main(uintptr_t pmultiboot) { init_terminal(); pic_init(0x20, 0x28); pic_enable_interrupts(); keyboard_init(); add_interrupt_handler(0x21, keyboard_interrupt); init_multiboot_data(pmultiboot); init_allocator(&data); //test(); while(1) { // struct frame f; // allocate_frame(&f); // print_text("Alloc frame num: "); // print_hex_number(f.number); // print_newline(); int foo = 10; int bar = 0xdeadbeef; size_t baz = 0xcafebabecafebabe; //terminal_printf("\ntest\ntest2\ntest3\n%x\n%3X\n%#x\n%X\n%zx", foo, foo, bar, bar, baz); for(int k = 0; k < 50000000; ++k) {} } }
#include "terminal.h" #include "multiboot.h" #include "pic.h" #include "keyboard.h" #include "frame_allocator.h" #include "paging.h" #include "assert.h" //Calling convention on x86-64 System V ABI //rdi, rsi, rdx, rcx for ints void page_fault(void) { terminal_printf("Fault"); assert(0!=0); } void kernel_main(uintptr_t pmultiboot) { init_terminal(); pic_init(0x20, 0x28); pic_enable_interrupts(); keyboard_init(); add_interrupt_handler(0x21, keyboard_interrupt); add_interrupt_handler(0x0e, page_fault); init_multiboot_data(pmultiboot); init_allocator(&data); remap_kernel(); //test(); while(1) { // struct frame f; // allocate_frame(&f); // print_text("Alloc frame num: "); // print_hex_number(f.number); // print_newline(); int foo = 10; int bar = 0xdeadbeef; size_t baz = 0xcafebabecafebabe; //terminal_printf("\ntest\ntest2\ntest3\n%x\n%3X\n%#x\n%X\n%zx", foo, foo, bar, bar, baz); for(int k = 0; k < 50000000; ++k) {} } }
Add page fault handler to abort on page fault.
Add page fault handler to abort on page fault.
C
apache-2.0
RichardHScott/os_c
07e3a43edbaf84f04359d333013b423dde057d3b
pi_code/countbits.c
pi_code/countbits.c
#include <stdint.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> int main (int argc, char *argv[]) { char buf[4096]; int fd = open("inputcap", O_RDONLY); memset(buf, 0, 4096); int ret = read(fd, buf, 4000); if (ret < 0) exit(0); int i; int count; for (i = 0; i < 4000; ++i) { char byte = buf[i]; int mask = 0x80; while (mask) { if (mask & byte) ++count; mask >>= 1; } } printf("Distance = %6d us, %6.2f inches\n", count, (float)count / 148.0f); }
#include <stdint.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> int main (int argc, char *argv[]) { char buf[4096]; int fd = open("inputcap", O_RDONLY); memset(buf, 0, 4096); int ret = read(fd, buf, 4000); if (ret < 0) exit(0); int i; int count; for (i = 0; i < 4000; ++i) { char byte = buf[i]; int mask = 0x80; while (mask) { if (mask & byte) ++count; mask >>= 1; } } printf("Distance = %6d us, %6.2f inches\n", count, (float)count / 148.0f); return 0; }
Fix warning for lack of return from main.
Fix warning for lack of return from main.
C
apache-2.0
rlstrand/ultrasonic,rlstrand/ultrasonic,nord0296/ultrasonic,nord0296/ultrasonic
06031732b6e87edfe67e65ce1daa1cc3cba5fb2f
Wangscape/noise/module/codecs/ForwardWrapperCodec.h
Wangscape/noise/module/codecs/ForwardWrapperCodec.h
#pragma once #include <spotify/json.hpp> #include <noise/noise.h> #include "noise/module/Wrapper.h" namespace spotify { namespace json { template<> struct default_codec_t<noise::module::Wrapper<noise::module::Forward>> { using ForwardWrapper = noise::module::Wrapper<noise::module::Forward>; static codec::object_t<ForwardWrapper> codec() { auto codec = codec::object<ForwardWrapper>(); codec.required("type", codec::eq<std::string>("Forward")); codec.required("SourceModule", codec::ignore_t<int>()); return codec; } }; } }
#pragma once #include <spotify/json.hpp> #include <noise/noise.h> #include "noise/module/Wrapper.h" #include "noise/module/Forward.h" namespace spotify { namespace json { template<> struct default_codec_t<noise::module::Wrapper<noise::module::Forward>> { using ForwardWrapper = noise::module::Wrapper<noise::module::Forward>; static codec::object_t<ForwardWrapper> codec() { auto codec = codec::object<ForwardWrapper>(); codec.required("type", codec::eq<std::string>("Forward")); codec.required("SourceModule", codec::ignore_t<int>()); return codec; } }; } }
Add missing header to Forward codec
Add missing header to Forward codec
C
mit
serin-delaunay/Wangscape,Wangscape/Wangscape,Wangscape/Wangscape,Wangscape/Wangscape,serin-delaunay/Wangscape
255a42b67118fc7ee69a5a1a139a87a9de1da98d
include/relay-exp.h
include/relay-exp.h
#ifndef _RELAY_EXP_H_ #define _RELAY_EXP_H_ #include <stdlib.h> #include <stdio.h> #include <math.h> #include <unistd.h> #include <onion-mcp23008-driver.h> #define RELAY_EXP_ADDR_SWITCH_NUM 3 #define RELAY_EXP_ADDR_SWITCH_DEFAULT_VAL "000" // type definitions typedef enum e_RelayDriverChannels { RELAY_EXP_CHANNEL0 = 0, RELAY_EXP_CHANNEL1, RELAY_EXP_NUM_CHANNELS, } ePwmDriverAddr; int relayDriverInit (int addr); int relayCheckInit (int addr, int *bInitialized); int relaySetChannel (int addr, int channel, int state); int relaySetAllChannels (int addr, int state); #endif // _RELAY_EXP_H_
#ifndef _RELAY_EXP_H_ #define _RELAY_EXP_H_ #include <stdlib.h> #include <stdio.h> #include <math.h> #include <unistd.h> #include <onion-mcp23008-driver.h> #define RELAY_EXP_ADDR_SWITCH_NUM 3 #define RELAY_EXP_ADDR_SWITCH_DEFAULT_VAL "000" // type definitions typedef enum e_RelayDriverChannels { RELAY_EXP_CHANNEL0 = 0, RELAY_EXP_CHANNEL1, RELAY_EXP_NUM_CHANNELS, } eRelayDriverChannels; int relayDriverInit (int addr); int relayCheckInit (int addr, int *bInitialized); int relaySetChannel (int addr, int channel, int state); int relaySetAllChannels (int addr, int state); #endif // _RELAY_EXP_H_
Fix typo on e_RelayDriverChannels declaration
Fix typo on e_RelayDriverChannels declaration
C
agpl-3.0
OnionIoT/i2c-exp-driver,OnionIoT/i2c-exp-driver,OnionIoT/i2c-exp-driver,OnionIoT/i2c-exp-driver,OnionIoT/i2c-exp-driver
5b6bfd2202b9ad7a3eafd0585ce5c37dd6f5d91f
tests/test_queue.c
tests/test_queue.c
#include "mbb/test.h" #include "mbb/queue.h" #include "mbb/debug.h" char *test_enqueue_dequeue() { int i; MQUE_DEFINE_STRUCT(int, 5) queue; MQUE_INITIALISE(&queue); MUNT_ASSERT(MQUE_IS_EMPTY(&queue)); for (i = 1; i <= 5; i++) { MUNT_ASSERT(!MQUE_IS_FULL(&queue)); MQUE_ENQUEUE(&queue, i); } for (i = 1; i <= 5; i++) { int head; MUNT_ASSERT(!MQUE_IS_EMPTY(&queue)); head = MQUE_HEAD(&queue); MQUE_DEQUEUE(&queue);; } MUNT_ASSERT(MQUE_IS_EMPTY(&queue)); return 0; }
#include "mbb/test.h" #include "mbb/queue.h" #include "mbb/debug.h" char *test_enqueue_dequeue() { int i; MQUE_DEFINE_STRUCT(int, 5) queue; MQUE_INITIALISE(&queue); MUNT_ASSERT(MQUE_IS_EMPTY(&queue)); for (i = 1; i <= 5; i++) { MUNT_ASSERT(!MQUE_IS_FULL(&queue)); MQUE_ENQUEUE(&queue, i); } for (i = 1; i <= 5; i++) { int head; MUNT_ASSERT(!MQUE_IS_EMPTY(&queue)); head = MQUE_HEAD(&queue); MQUE_DEQUEUE(&queue);; MUNT_ASSERT(head == i); } MUNT_ASSERT(MQUE_IS_EMPTY(&queue)); return 0; }
Check enqueued values in unit test
Check enqueued values in unit test
C
mit
jawebada/libmbb,jawebada/libmbb,jawebada/libmbb,jawebada/libmbb
623e78434cda7df52e88fd27521626dd5182021f
src/config.h
src/config.h
#pragma once #include <pebble.h> #define BG_COLOR GColorWhite #ifdef PBL_ROUND #define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 12) #else #define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 2) #endif #define BPM_DEFAULT_BPM_T 1200 #define BPM_FONT FONT_KEY_BITHAM_42_BOLD #define BPM_FONT_HEIGHT 42 #define BPM_TEXT_INVALID "---" #define BPM_TEXT_BUFFER_SIZE 10 #define BPM_HINT_FONT FONT_KEY_GOTHIC_24_BOLD #define BPM_HINT_FONT_HEIGHT 24 #define BPM_HINT_TEXT "Current BPM:" #define METRONOME_HINT_FONT FONT_KEY_GOTHIC_18_BOLD #define METRONOME_HINT_FONT_HEIGHT 18 #define METRONOME_HINT_TEXT "Metronome BPM:" #define METRONOME_VIBE_DURATION_MS 50 #define METRONOME_EDIT_TAP_REPEAT_MS 30 #define TAP_TIMEOUT_SECONDS 2
#pragma once #include <pebble.h> #define BG_COLOR GColorWhite #ifdef PBL_ROUND #define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 12) #else #define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 2) #endif #define BPM_DEFAULT_BPM_T 1200 #define BPM_FONT FONT_KEY_BITHAM_42_BOLD #define BPM_FONT_HEIGHT 42 #define BPM_TEXT_INVALID "---" #define BPM_TEXT_BUFFER_SIZE 10 #define BPM_HINT_FONT FONT_KEY_GOTHIC_24_BOLD #define BPM_HINT_FONT_HEIGHT 24 #define BPM_HINT_TEXT "Current BPM:" #ifdef PBL_ROUND #define METRONOME_HINT_FONT FONT_KEY_GOTHIC_18_BOLD #define METRONOME_HINT_FONT_HEIGHT 18 #else #define METRONOME_HINT_FONT FONT_KEY_GOTHIC_14_BOLD #define METRONOME_HINT_FONT_HEIGHT 14 #endif #define METRONOME_HINT_TEXT "Metronome BPM:" #define METRONOME_VIBE_DURATION_MS 50 #define METRONOME_EDIT_TAP_REPEAT_MS 30 #define TAP_TIMEOUT_SECONDS 2
Fix font size on rectangular watches
Fix font size on rectangular watches
C
mit
aarmea/bpm-pebble,aarmea/bpm-pebble,aarmea/bpm-pebble
9930b7c47f8c4cac765be76436a69de4ba5664f7
src/config.h
src/config.h
#ifndef _CONFIG_H #define _CONFIG_H #define ENABLE_COUNTERMOVE_HISTORY 0 #define ENABLE_LMP_MIN_MOVES 0 #define ENABLE_HISTORY_PRUNE_DEPTH 4 #define ENABLE_NNUE 0 #define ENABLE_NNUE_SIMD 0 #endif
#ifndef _CONFIG_H #define _CONFIG_H #define ENABLE_COUNTERMOVE_HISTORY 0 #define ENABLE_LMP_MIN_MOVES 4 #define ENABLE_HISTORY_PRUNE_DEPTH 4 #define ENABLE_NNUE 0 #define ENABLE_NNUE_SIMD 0 #endif
Enable late move pruning at min 4
Enable late move pruning at min 4
C
bsd-3-clause
jwatzman/nameless-chessbot,jwatzman/nameless-chessbot
bc31fde05187299456c0b71bb89d8a6898420e47
src/motion.c
src/motion.c
#include "motion.h" //Utilities int threshold(int value, int threshold); void reset_I2C_sensors(void); //Driving void drive(int y, int t = 0){ //y - Forwards/Backwards //t - Turning (optional parameter) motor[driveLeftFront] = y+t; motor[driveRightFront] = y-t; } //Mogo (mobile goal lift) void mogo(int power){ motor[mobilegoal] = power; } //Lift void lift(int power){ motor[liftLeftSplit] = power; } //Utilities int threshold(int value, int threshold){ return abs(value) > threshold ? value : 0; } void reset_I2C_sensors(void){ SensorValue[I2C_1] = SensorValue[I2C_2] = SensorValue[I2C_3] = SensorValue[I2C_4] = 0; }
#include "motion.h" //Utilities int threshold(int value, int threshold); void reset_I2C_sensors(void); //Driving void drive(int y, int t = 0){ //y - Forwards/Backwards //t - Turning (optional parameter) motor[driveLeftFront] = y+t; motor[driveRightFront] = y-t; } //Mogo (mobile goal lift) void mogo(int power){ motor[mobilegoal] = power; } //Lift void lift(int power){ motor[liftLeftSplit] = power; } //Utilities int threshold(int value, int threshold){ return abs(value) > abs(threshold) ? value : 0; } void reset_I2C_sensors(void){ SensorValue[I2C_1] = SensorValue[I2C_2] = SensorValue[I2C_3] = SensorValue[I2C_4] = 0; }
Make threshold function use absolute value of threshold value
Make threshold function use absolute value of threshold value
C
mit
18moorei/code-red-in-the-zone
d22e80d0afb0433637234a9bcc1f40387e53a252
firmware/digital_led_strip_gnu/inc/hal.h
firmware/digital_led_strip_gnu/inc/hal.h
#include <stdint.h> #define STRIP_BLACK 0x8000 #define STRIP_PIXELS 50 #define USART_BAUD_RATE 115200 extern uint16_t* const strip_data; void init(); void set_led(uint8_t state); uint8_t get_button(); uint16_t get_voltage(); uint16_t get_current(); void strip_flush(); uint16_t pack_RGB(uint8_t red, uint8_t green, uint8_t blue); void strip_refresh(); void strip_refresh_nowait(); void send_str(uint8_t* mem,uint16_t cnt); int16_t get_char();
#include <stdint.h> #define STRIP_BLACK 0x8000 #define STRIP_PIXELS 50 //#define USART_BAUD_RATE 115200 #define USART_BAUD_RATE 3000000 extern uint16_t* const strip_data; void init(); void set_led(uint8_t state); uint8_t get_button(); uint16_t get_voltage(); uint16_t get_current(); void strip_flush(); uint16_t pack_RGB(uint8_t red, uint8_t green, uint8_t blue); void strip_refresh(); void strip_refresh_nowait(); void send_str(uint8_t* mem,uint16_t cnt); int16_t get_char();
Change baud rate to 3mbps
Change baud rate to 3mbps
C
mit
zbanks/aurora,zbanks/aurora,zbanks/aurora,zbanks/aurora,zbanks/aurora,zbanks/aurora,zbanks/aurora
12d24d16af71b1d0ff397f70648ed72d63d2c5d1
Includes/libARSAL/ARSAL.h
Includes/libARSAL/ARSAL.h
/** * @file libARSAL/ARSAL.h * @brief Library global header for libARSAL * @date 04/12/2013 * @author [email protected] */ #ifndef _ARSAL_H_ #define _ARSAL_H_ #include <libARSAL/ARSAL_Endianness.h> #include <libARSAL/ARSAL_Ftw.h> #include <libARSAL/ARSAL_Mutex.h> #include <libARSAL/ARSAL_Print.h> #include <libARSAL/ARSAL_Sem.h> #include <libARSAL/ARSAL_Socket.h> #include <libARSAL/ARSAL_Thread.h> #include <libARSAL/ARSAL_Time.h> #endif /* _ARSAL_H_ */
/** * @file libARSAL/ARSAL.h * @brief Library global header for libARSAL * @date 04/12/2013 * @author [email protected] */ #ifndef _ARSAL_H_ #define _ARSAL_H_ #include <libARSAL/ARSAL_Endianness.h> //#include <libARSAL/ARSAL_Ftw.h> #include <libARSAL/ARSAL_Mutex.h> #include <libARSAL/ARSAL_Print.h> #include <libARSAL/ARSAL_Sem.h> #include <libARSAL/ARSAL_Socket.h> #include <libARSAL/ARSAL_Thread.h> #include <libARSAL/ARSAL_Time.h> #endif /* _ARSAL_H_ */
Comment file for the moment.
Comment file for the moment.
C
bsd-3-clause
kradhub/libARSAL,kradhub/libARSAL,niavok/libARSAL,kradhub/libARSAL,Parrot-Developers/libARSAL,Parrot-Developers/libARSAL,niavok/libARSAL,kradhub/libARSAL,niavok/libARSAL,Parrot-Developers/libARSAL,niavok/libARSAL
48220cfd521da329e20ffad5699d030d29313f71
tests/sv-comp/observer/path_nofun_true-unreach-call.c
tests/sv-comp/observer/path_nofun_true-unreach-call.c
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); extern int __VERIFIER_nondet_int(); int main() { int x, y; if (__VERIFIER_nondet_int()) { x = 0; y = 1; } else { x = 1; y = 0; } // if (!(x + y == 1)) if (x + y != 1) __VERIFIER_error(); return 0; } // ./goblint --enable ana.sv-comp --enable ana.wp --enable exp.uncilwitness --disable ana.int.def_exc --enable ana.int.interval --set ana.activated '["base"]' --set phases '[{}, {"ana": {"activated": ["base", "observer"], "path_sens": ["observer"]}}]' --html tests/sv-comp/observer/path_nofun_true-unreach-call.c // /goblint --enable ana.sv-comp --enable ana.wp --enable exp.uncilwitness --disable ana.int.def_exc --enable ana.int.interval --set ana.activated '["base"]' --html tests/sv-comp/observer/path_nofun_true-unreach-call.c
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); extern int __VERIFIER_nondet_int(); int main() { int x, y; if (__VERIFIER_nondet_int()) { x = 0; y = 1; } else { x = 1; y = 0; } // if (!(x + y == 1)) if (x + y != 1) __VERIFIER_error(); return 0; } // ./goblint --enable ana.sv-comp --enable ana.wp --enable exp.uncilwitness --disable ana.int.def_exc --enable ana.int.interval --set ana.activated '["base"]' --set phases '[{}, {"ana": {"activated": ["base", "observer"], "path_sens": ["observer"]}}]' --html tests/sv-comp/observer/path_nofun_true-unreach-call.c // ./goblint --enable ana.sv-comp --enable ana.wp --enable exp.uncilwitness --disable ana.int.def_exc --enable ana.int.interval --set ana.activated '["base"]' --html tests/sv-comp/observer/path_nofun_true-unreach-call.c
Fix command in path_nofun SV-COMP example
Fix command in path_nofun SV-COMP example
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
56259f7f61084eabd4dc2d3d6cb3ea4cc161320f
ios/RNI18n.h
ios/RNI18n.h
#import <React/RCTBridgeModule.h> @interface RNI18n : NSObject <RCTBridgeModule> @end
#if __has_include("RCTBridgeModule.h") #import "RCTBridgeModule.h" #else #import <React/RCTBridgeModule.h> #endif @interface RNI18n : NSObject <RCTBridgeModule> @end
Add support for react-native < 0.40
Add support for react-native < 0.40
C
mit
AlexanderZaytsev/react-native-i18n,AlexanderZaytsev/react-native-i18n,AlexanderZaytsev/react-native-i18n,AlexanderZaytsev/react-native-i18n
637ba7dd055c6185c4e428b9328299b3e96de833
asylo/platform/posix/include/sys/wait.h
asylo/platform/posix/include/sys/wait.h
/* * * Copyright 2018 Asylo 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. * */ #include_next <sys/wait.h> #ifndef ASYLO_PLATFORM_POSIX_INCLUDE_SYS_WAIT_H_ #define ASYLO_PLATFORM_POSIX_INCLUDE_SYS_WAIT_H_ #ifdef __cplusplus extern "C" { #endif #define WNOHANG 1 pid_t wait3(int *wstatus, int options, struct rusage *rusage); #ifdef __cplusplus } // extern "C" #endif #endif // ASYLO_PLATFORM_POSIX_INCLUDE_SYS_WAIT_H_
/* * * Copyright 2018 Asylo 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. * */ #include_next <sys/wait.h> #ifndef ASYLO_PLATFORM_POSIX_INCLUDE_SYS_WAIT_H_ #define ASYLO_PLATFORM_POSIX_INCLUDE_SYS_WAIT_H_ #include <sys/resource.h> #ifdef __cplusplus extern "C" { #endif #define WNOHANG 1 pid_t wait3(int *wstatus, int options, struct rusage *rusage); #ifdef __cplusplus } // extern "C" #endif #endif // ASYLO_PLATFORM_POSIX_INCLUDE_SYS_WAIT_H_
Include sys/resource.h for struct rusage
Include sys/resource.h for struct rusage Used in wait3 signature. PiperOrigin-RevId: 269667008 Change-Id: Ie6e3a9b334861c78722bbae806352216d57ac437
C
apache-2.0
google/asylo,google/asylo,google/asylo,google/asylo,google/asylo,google/asylo
b0afcb7cebb7b64f8e8c378ff3c5d117a2abb4cc
include/jive/arch/registers.h
include/jive/arch/registers.h
#ifndef JIVE_ARCH_REGISTERS_H #define JIVE_ARCH_REGISTERS_H typedef struct jive_cpureg jive_cpureg; typedef struct jive_regcls jive_regcls; struct jive_cpureg { const char name[32]; }; #endif
#ifndef JIVE_ARCH_REGISTERS_H #define JIVE_ARCH_REGISTERS_H typedef struct jive_cpureg jive_cpureg; typedef struct jive_regcls jive_regcls; struct jive_cpureg { const jive_regcls * regcls; const char name[32]; }; #endif
Add reference to register class to cpureg
Add reference to register class to cpureg Arch support is still incomplete, but this bit is required for other target-independent code.
C
lgpl-2.1
phate/jive,phate/jive,phate/jive
a758e727e602b5e05058271c990063baeeea3ccd
test/Driver/crash-diagnostics-dir.c
test/Driver/crash-diagnostics-dir.c
// RUN: rm -rf %t // RUN: mkdir -p %t // RUN: not %clang -fcrash-diagnostics-dir=%t -c %s 2>&1 | FileCheck %s #pragma clang __debug parser_crash // CHECK: Preprocessed source(s) and associated run script(s) are located at: // CHECK: diagnostic msg: {{.*}}Output{{/|\\}}crash-diagnostics-dir.c.tmp{{(/|\\).*}}.c
// RUN: rm -rf %t // RUN: mkdir -p %t // RUN: not %clang -fcrash-diagnostics-dir=%t -c %s -o - 2>&1 | FileCheck %s #pragma clang __debug parser_crash // CHECK: Preprocessed source(s) and associated run script(s) are located at: // CHECK: diagnostic msg: {{.*}}{{/|\\}}crash-diagnostics-dir.c.tmp{{(/|\\).*}}.c
Update crash diagnostics test to avoid attempting to write into various directories if possible and to not require %t to have "Output" in the name.
Update crash diagnostics test to avoid attempting to write into various directories if possible and to not require %t to have "Output" in the name. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@336630 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
cd8df932d894f3128c884e3ae1b2b484540513db
drivers/scsi/qla4xxx/ql4_version.h
drivers/scsi/qla4xxx/ql4_version.h
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2010 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k14"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2010 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k15"
Update driver version to 5.02.00-k15
[SCSI] qla4xxx: Update driver version to 5.02.00-k15 Signed-off-by: Vikas Chaudhary <[email protected]> Signed-off-by: James Bottomley <[email protected]>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs
9e469bb71d97fb04c425c0955e27174841fe4ba8
include/utils/builtin.h
include/utils/builtin.h
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef _UTILS_BUILTIN_H #define _UTILS_BUILTIN_H /* macros for accessing compiler builtins */ #include <assert.h> #define CTZ(x) __builtin_ctz(x) #define CLZ(x) __builtin_clz(x) #define OFFSETOF(type, member) __builtin_offsetof(type, member) #define TYPES_COMPATIBLE(t1, t2) __builtin_types_compatible_p(t1, t2) #define CHOOSE_EXPR(cond, x, y) __builtin_choose_expr(cond, x, y) #define IS_CONSTANT(expr) __builtin_constant_p(expr) #define POPCOUNT(x) __builtin_popcount(x) #define UNREACHABLE() \ do { \ assert(!"unreachable"); \ __builtin_unreachable(); \ } while (0) #endif /* _UTILS_BUILTIN_H */
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef _UTILS_BUILTIN_H #define _UTILS_BUILTIN_H /* macros for accessing compiler builtins */ #include <assert.h> #define CTZ(x) __builtin_ctz(x) #define CLZ(x) __builtin_clz(x) #define OFFSETOF(type, member) __builtin_offsetof(type, member) #define TYPES_COMPATIBLE(t1, t2) __builtin_types_compatible_p(t1, t2) #define CHOOSE_EXPR(cond, x, y) __builtin_choose_expr(cond, x, y) #define IS_CONSTANT(expr) __builtin_constant_p(expr) #define POPCOUNT(x) __builtin_popcount(x) #define UNREACHABLE() \ do { \ assert(!"unreachable"); \ __builtin_unreachable(); \ } while (0) /* Borrowed from linux/include/linux/compiler.h */ #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #endif /* _UTILS_BUILTIN_H */
Add likely and unlikely macros.
Add likely and unlikely macros.
C
bsd-2-clause
agacek/util_libs,winksaville/libutils,agacek/util_libs,agacek/util_libs,seL4/libutils,agacek/util_libs
55ad50b520fe4cd2a944ceabfd6508bd05b26813
code/code/obj/obj_appliedsub.h
code/code/obj/obj_appliedsub.h
#ifndef __OBJ_APPLIED_SUB_H #define __OBJ_APPLIED_SUB_H #include "obj.h" // stub object relating to ranger herbalism class TASubstance : public TObj { public: virtual void assignFourValues(int, int, int, int) { } virtual void getFourValues(int *a, int *b, int *c, int *d) const { *a = *b = *c = *d = 0; } virtual sstring statObjInfo() const { return sstring(""); } virtual itemTypeT itemType() const {return ITEM_APPLIED_SUB; } TASubstance() { } TASubstance(const TASubstance &a) { } TASubstance & operator=(const TASubstance &a) { if (this == &a) return *this; TObj::operator=(a); return *this; } virtual ~TASubstance() { } }; #endif
#ifndef __OBJ_APPLIED_SUB_H #define __OBJ_APPLIED_SUB_H #include "obj.h" // stub object relating to ranger herbalism class TASubstance : public TObj { public: virtual void assignFourValues(int, int, int, int) { } virtual void getFourValues(int *a, int *b, int *c, int *d) const { *a = *b = *c = *d = 0; } virtual sstring statObjInfo() const { return sstring(""); } virtual itemTypeT itemType() const {return ITEM_APPLIED_SUB; } }; #endif
Remove empty constructors etc from TASubstance
Remove empty constructors etc from TASubstance
C
agpl-3.0
sneezymud/sneezymud,sneezymud/sneezymud,sneezymud/sneezymud,sneezymud/sneezymud,sneezymud/sneezymud,sneezymud/sneezymud,sneezymud/sneezymud
6a18b24d29cd6b0d03bd3fbdf839ff6aaf6cd84c
bacula/src/version.h
bacula/src/version.h
/* */ #undef VERSION #define VERSION "1.37.17" #define BDATE "06 May 2005" #define LSMDATE "06May05" /* Debug flags */ #undef DEBUG #define DEBUG 1 #define TRACEBACK 1 #define SMCHECK #define TRACE_FILE 1 /* If this is set stdout will not be closed on startup */ #define DEVELOPER 1 /* Debug flags not normally turned on */ /* #define TRACE_JCR_CHAIN 1 */ /* #define TRACE_RES 1 */ /* #define DEBUG_MEMSET 1 */ /* #define DEBUG_MUTEX 1 */ /* Check if header of tape block is zero before writing */ #define DEBUG_BLOCK_ZEROING 1 /* #define FULL_DEBUG 1 */ /* normally on for testing only */ /* Turn this on ONLY if you want all Dmsg() to append to the * trace file. Implemented mainly for Win32 ... */ /* #define SEND_DMSG_TO_FILE 1 */ /* The following are turned on for performance testing */ /* #define NO_ATTRIBUTES_TEST 1 */ /* #define NO_TAPE_WRITE_TEST 1 */ /* #define FD_NO_SEND TEST 1 */
/* */ #undef VERSION #define VERSION "1.37.17" #define BDATE "07 May 2005" #define LSMDATE "07May05" /* Debug flags */ #undef DEBUG #define DEBUG 1 #define TRACEBACK 1 #define SMCHECK #define TRACE_FILE 1 /* If this is set stdout will not be closed on startup */ #define DEVELOPER 1 /* Debug flags not normally turned on */ /* #define TRACE_JCR_CHAIN 1 */ /* #define TRACE_RES 1 */ /* #define DEBUG_MEMSET 1 */ /* #define DEBUG_MUTEX 1 */ /* Check if header of tape block is zero before writing */ #define DEBUG_BLOCK_ZEROING 1 /* #define FULL_DEBUG 1 */ /* normally on for testing only */ /* Turn this on ONLY if you want all Dmsg() to append to the * trace file. Implemented mainly for Win32 ... */ /* #define SEND_DMSG_TO_FILE 1 */ /* The following are turned on for performance testing */ /* #define NO_ATTRIBUTES_TEST 1 */ /* #define NO_TAPE_WRITE_TEST 1 */ /* #define FD_NO_SEND TEST 1 */
Fix Win32 build for TLS
Fix Win32 build for TLS git-svn-id: bb0627f6f70d46b61088c62c6186faa4b96a9496@2001 91ce42f0-d328-0410-95d8-f526ca767f89
C
agpl-3.0
rkorzeniewski/bacula,rkorzeniewski/bacula,rkorzeniewski/bacula,rkorzeniewski/bacula,rkorzeniewski/bacula,rkorzeniewski/bacula,rkorzeniewski/bacula,rkorzeniewski/bacula
1761d9ffe718f5b9d7535ede67380a20187f9d90
tests/regression/36-octapron/23-traces-write-centered-problem.c
tests/regression/36-octapron/23-traces-write-centered-problem.c
// SKIP PARAM: --sets ana.activated[+] octApron --sets exp.solver.td3.side_widen cycle_self // requires cycle_self to pass with protection #include <pthread.h> #include <assert.h> int g = 25; // matches write in main int h = 12; // matches write in main pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int x; // rand pthread_mutex_lock(&A); g = x; h = x - 12; pthread_mutex_unlock(&A); return NULL; } int main(void) { int x, y; pthread_t id; pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&A); g = 25; h = 12; pthread_mutex_unlock(&A); pthread_mutex_lock(&A); x = g; y = h; assert(x >= y); // write would fail this due to disjunctive reading from local and global pthread_mutex_unlock(&A); return 0; }
Add relational traces example where write would fail
Add relational traces example where write would fail
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
29c7759d400dd2c46ef4ab02199fbba2d508a4d5
kernel/libk/klog.c
kernel/libk/klog.c
#include <libk/klog.h> void initialize_klog() { initialize_serial_port(COM1); kputs("initing"); write_serial_string(COM1, "Logger initialized\n"); kputs("inited"); } void klog(char *message) { write_serial_string(COM1, message); }
#include <libk/klog.h> void initialize_klog() { initialize_serial_port(COM1); write_serial_string(COM1, "Logger initialized!\n"); } void klog(char *message) { write_serial_string(COM1, message); }
Remove debugging lines from kernel logger
Remove debugging lines from kernel logger
C
mit
Herbstein/kernel-of-truth,awensaunders/kernel-of-truth,Herbstein/kernel-of-truth,iankronquist/kernel-of-truth,Herbstein/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,iankronquist/kernel-of-truth,awensaunders/kernel-of-truth,awensaunders/kernel-of-truth,iankronquist/kernel-of-truth
af88a4da720094eb576f50664fa61d449eb005dd
include/rapidcheck/detail/Traits.h
include/rapidcheck/detail/Traits.h
#pragma once #include <type_traits> #include <iostream> namespace rc { namespace detail { namespace sfinae { template<typename T, typename = decltype(std::declval<T>() == std::declval<T>())> std::true_type isEqualityComparable(const T &); std::false_type isEqualityComparable(...); template<typename T, typename = decltype(std::cout << std::declval<T>())> std::true_type isStreamInsertible(const T &); std::false_type isStreamInsertible(...); } // namespace sfinae template<typename T> using IsEqualityComparable = decltype( sfinae::isEqualityComparable(std::declval<T>())); template<typename T> using IsStreamInsertible = decltype( sfinae::isStreamInsertible(std::declval<T>())); } // namespace detail } // namespace rc
#pragma once #include <type_traits> #include <iostream> namespace rc { namespace detail { #define RC_SFINAE_TRAIT(Name, expression) \ namespace sfinae { \ template<typename T, typename = expression> \ std::true_type test##Name(const T &); \ std::false_type test##Name(...); \ } \ \ template<typename T> \ using Name = decltype(sfinae::test##Name(std::declval<T>())); RC_SFINAE_TRAIT(IsEqualityComparable, decltype(std::declval<T>() == std::declval<T>())) RC_SFINAE_TRAIT(IsStreamInsertible, decltype(std::cout << std::declval<T>())) } // namespace detail } // namespace rc
Add macro to declare SFINAE based traits
Add macro to declare SFINAE based traits
C
bsd-2-clause
unapiedra/rapidfuzz,whoshuu/rapidcheck,unapiedra/rapidfuzz,whoshuu/rapidcheck,tm604/rapidcheck,emil-e/rapidcheck,tm604/rapidcheck,whoshuu/rapidcheck,emil-e/rapidcheck,emil-e/rapidcheck,tm604/rapidcheck,unapiedra/rapidfuzz
4e16a115a9941f1a9f99a5a135414f8eb59da7c2
mtp/backend/darwin/usb/call.h
mtp/backend/darwin/usb/call.h
/* This file is part of Android File Transfer For Linux. Copyright (C) 2015 Vladimir Menshakov Android File Transfer For Linux is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Android File Transfer For Linux 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 Android File Transfer For Linux. If not, see <http://www.gnu.org/licenses/>. */ #ifndef USB_USB_H #define USB_USB_H #include <usb/Exception.h> #include <usb/usb.h> #define USB_CALL(...) do { int _r_ = (__VA_ARGS__); if (_r_ != kIOReturnSuccess) throw mtp::usb::Exception(#__VA_ARGS__, _r_) ; } while(false) #endif
/* This file is part of Android File Transfer For Linux. Copyright (C) 2015 Vladimir Menshakov Android File Transfer For Linux is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Android File Transfer For Linux 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 Android File Transfer For Linux. If not, see <http://www.gnu.org/licenses/>. */ #ifndef USB_USB_H #define USB_USB_H #include <usb/Exception.h> #include <usb/usb.h> #include <mtp/usb/DeviceNotFoundException.h> #define USB_CALL(...) \ do { int _r_ = (__VA_ARGS__); \ switch(_r_) { \ case kIOReturnSuccess : break; \ case kIOReturnNoDevice : throw mtp::usb::DeviceNotFoundException(); \ default: throw mtp::usb::Exception(#__VA_ARGS__, _r_) ; \ } \ } while(false) #endif
Add DeviceNotFoundException throw on mac
Add DeviceNotFoundException throw on mac
C
lgpl-2.1
whoozle/android-file-transfer-linux,whoozle/android-file-transfer-linux,whoozle/android-file-transfer-linux,whoozle/android-file-transfer-linux
09123fbb1e5deb2724ae7b41e567814d251ea98a
libphodav/phodav-path.h
libphodav/phodav-path.h
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ /* * Copyright (C) 2014 Red Hat, Inc. * * 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, see <http://www.gnu.org/licenses/>. */ #ifndef __PHODAV_PATH_H__ #define __PHODAV_PATH_H__ #include "phodav-priv.h" G_BEGIN_DECLS struct _Path { gchar *path; GList *locks; guint32 refs; }; Path * path_ref (Path *path); void path_unref (Path *path); void path_remove_lock (Path *path, DAVLock *lock); void path_add_lock (Path *path, DAVLock *lock); G_END_DECLS #endif /* __PHODAV_LOCK_H__ */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2; -*- */ /* * Copyright (C) 2014 Red Hat, Inc. * * 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, see <http://www.gnu.org/licenses/>. */ #ifndef __PHODAV_PATH_H__ #define __PHODAV_PATH_H__ #include "phodav-priv.h" G_BEGIN_DECLS struct _Path { gchar *path; GList *locks; guint32 refs; }; Path * path_ref (Path *path); void path_unref (Path *path); void path_remove_lock (Path *path, DAVLock *lock); void path_add_lock (Path *path, DAVLock *lock); G_END_DECLS #endif /* __PHODAV_PATH_H__ */
Fix the wrong comment on the header guard
libphodav: Fix the wrong comment on the header guard
C
lgpl-2.1
GNOME/phodav,GNOME/phodav
9c5c5b5cecbff8a89b7813175e46e89696f06fd8
src/exercise201.c
src/exercise201.c
/* A solution to Exercise 2-1 in The C Programming Language (Second Edition). */ #include <float.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> int main(void) { puts("Using macros from standard headers:"); printf(" Range of \"char\": %d to %d\n", SCHAR_MIN, SCHAR_MAX); printf(" Range of \"unsigned char\": %d to %u\n", 0, UCHAR_MAX); printf(" Range of \"short\": %d to %d\n", SHRT_MIN, SHRT_MAX); printf(" Range of \"unsigned short\": %d to %u\n", 0, USHRT_MAX); printf(" Range of \"int\": %d to %d\n", INT_MIN, INT_MAX); printf(" Range of \"unsigned int\": %d to %u\n", 0, UINT_MAX); printf(" Range of \"long\": %ld to %ld\n", LONG_MIN, LONG_MAX); printf(" Range of \"unsigned long\": %d to %lu\n", 0, ULONG_MAX); printf(" Range of \"float\": %e to %e\n", FLT_MIN, FLT_MAX); printf(" Range of \"double\": %e to %e\n", DBL_MIN, DBL_MAX); printf(" Range of \"long double\": %Le to %Le\n", LDBL_MIN, LDBL_MAX); /* TODO: Compute ranges. */ return EXIT_SUCCESS; }
Add solution to Exercise 2-1.
Add solution to Exercise 2-1.
C
unlicense
damiendart/knr-solutions,damiendart/knr-solutions,damiendart/knr-solutions
2e7c8aee37e5a269e97e20ea8ebbc3a632c8c0eb
src/voxrnd/local-loop.c
src/voxrnd/local-loop.c
#include "local-loop.h" #include "../voxtrees/search.h" void vox_local_loop (struct vox_node *tree, int n, void (*action) (vox_rnd_context*), \ void (*inc) (vox_rnd_context*), vox_rnd_context *ctx) { int i, state, pn; int depth = 1; vox_tree_path path; pn = vox_ray_tree_intersection (tree, ctx->origin, ctx->dir, ctx->inter, 1, path); state = pn; if (state) action (ctx); inc (ctx); for (i=0; i<n; i++) { if (state) { depth = vox_local_rays_tree_intersection (path, ctx->origin, ctx->dir, ctx->inter, depth, pn); state = depth; } if (!(state)) depth = vox_ray_tree_intersection (tree, ctx->origin, ctx->dir, ctx->inter, 1, path); if (depth) action (ctx); inc (ctx); } }
#include "local-loop.h" #include "../voxtrees/search.h" void vox_local_loop (struct vox_node *tree, int n, void (*action) (vox_rnd_context*), \ void (*inc) (vox_rnd_context*), vox_rnd_context *ctx) { int i, state, pn; int depth = 1; vox_tree_path path; pn = vox_ray_tree_intersection (tree, ctx->origin, ctx->dir, ctx->inter, 1, path); state = pn; if (state) action (ctx); inc (ctx); for (i=1; i<n; i++) { if (state) { depth = vox_local_rays_tree_intersection (path, ctx->origin, ctx->dir, ctx->inter, depth, pn); state = depth; } if (!(state)) depth = vox_ray_tree_intersection (tree, ctx->origin, ctx->dir, ctx->inter, 1, path); if (depth) action (ctx); inc (ctx); } }
Make renderer to work properly
Make renderer to work properly
C
bsd-2-clause
shamazmazum/voxvision,shamazmazum/voxvision
e6077cd5fe8c9bab610f6fb3fe2437967f71f607
build/sigfw.c
build/sigfw.c
/* * This program handles SIGINT and forwards it to another process. * It is intended to be run as PID 1. * * Docker starts processes with "docker run" as PID 1. * On Linux, the default signal handler for PID 1 ignores any signals. * Therefore Ctrl-C aka SIGINT is ignored per default. */ #include <signal.h> #include <sys/types.h> #include <sys/wait.h> int pid = 0; void handle_sigint (int signum) { if(pid) kill(pid, SIGINT); } int main(int argc, char *argv[]){ struct sigaction new_action; int status = -1; /* Set up the structure to specify the new action. */ new_action.sa_handler = handle_sigint; sigemptyset (&new_action.sa_mask); new_action.sa_flags = 0; sigaction (SIGINT, &new_action, (void*)0); pid = fork(); if(pid){ wait(&status); return WEXITSTATUS(status); }else{ status = execvp(argv[1], &argv[1]); perror("exec"); return status; } }
/* * This program handles SIGINT and forwards it to another process. * It is intended to be run as PID 1. * * Docker starts processes with "docker run" as PID 1. * On Linux, the default signal handler for PID 1 ignores any signals. * Therefore Ctrl-C aka SIGINT is ignored per default. */ #include <unistd.h> #include <stdio.h> #include <signal.h> #include <sys/types.h> #include <sys/wait.h> int pid = 0; void handle_sigint (int signum) { if(pid) kill(pid, SIGINT); } int main(int argc, char *argv[]){ struct sigaction new_action; int status = -1; /* Set up the structure to specify the new action. */ new_action.sa_handler = handle_sigint; sigemptyset (&new_action.sa_mask); new_action.sa_flags = 0; sigaction (SIGINT, &new_action, (void*)0); pid = fork(); if(pid){ wait(&status); return WEXITSTATUS(status); }else{ status = execvp(argv[1], &argv[1]); perror("exec"); return status; } }
Add missing includes for fork() and perror()
Add missing includes for fork() and perror()
C
mit
larskanis/rake-compiler-dock,rake-compiler/rake-compiler-dock,rake-compiler/rake-compiler-dock,larskanis/rake-compiler-dock,larskanis/rake-compiler-dock,rake-compiler/rake-compiler-dock,rake-compiler/rake-compiler-dock,rake-compiler/rake-compiler-dock
59409c9a9eca18531d314a42d802a610617f4f1b
Src/Utils.c
Src/Utils.c
/********************************************************************** * * PROJECT: Platform library * FILE: Utils.c * LICENCE: See Licence.txt * PURPOSE: Various platform independent utility functions. * * (c) Tuomo Jauhiainen 2013 * **********************************************************************/ #include "Platform/Utils.h" #ifdef _WIN32 ////////////////////////////////////////////////////////////////////////// // Win32 implementation ////////////////////////////////////////////////////////////////////////// #include <direct.h> char* get_working_directory( char* buffer, size_t len ) { return _getcwd( buffer, (int)len ); } void exit_app_with_error( const char_t* errormsg ) { if ( errormsg && *errormsg ) { MessageBox( 0, errormsg, "Error", MB_OK ); } SetForegroundWindow( HWND_DESKTOP ); ExitProcess( 1 ); } #else ////////////////////////////////////////////////////////////////////////// // POSIX implementation ////////////////////////////////////////////////////////////////////////// #include <unistd.h> #include <stdlib.h> char* get_working_directory( char* buffer, size_t len ) { return getcwd( buffer, len ); } void exit_app_with_error( const char_t* errormsg ) { exit( EXIT_FAILURE ); } #endif
/********************************************************************** * * PROJECT: Platform library * FILE: Utils.c * LICENCE: See Licence.txt * PURPOSE: Various platform independent utility functions. * * (c) Tuomo Jauhiainen 2013 * **********************************************************************/ #include "Platform/Utils.h" #ifdef _WIN32 ////////////////////////////////////////////////////////////////////////// // Win32 implementation ////////////////////////////////////////////////////////////////////////// #include <direct.h> char* get_working_directory( char* buffer, size_t len ) { return _getcwd( buffer, (int)len ); } void exit_app_with_error( const char_t* errormsg ) { if ( errormsg && *errormsg ) { MessageBox( 0, errormsg, "Error", MB_OK ); } ExitProcess( 1 ); } #else ////////////////////////////////////////////////////////////////////////// // POSIX implementation ////////////////////////////////////////////////////////////////////////// #include <unistd.h> #include <stdlib.h> char* get_working_directory( char* buffer, size_t len ) { return getcwd( buffer, len ); } void exit_app_with_error( const char_t* errormsg ) { exit( EXIT_FAILURE ); } #endif
Fix warnings and errors brought up by VS2012 code analyzer.
Fix warnings and errors brought up by VS2012 code analyzer.
C
mit
teejii88/platform,teejii88/platform
bfa9ab6178e8ca11ff9db88f750f7b8ab2dd1bf6
UIViewControllerTest/UIViewControllerTest/ViewController.h
UIViewControllerTest/UIViewControllerTest/ViewController.h
/************************************************************************************************** * File name : ViewController.h * Description : Define the ViewController class. * Creator : Frederick Hsu * Creation date: Thu. 23 Feb. 2017 * Copyright(C 2017 All rights reserved. * **************************************************************************************************/ #import <UIKit/UIKit.h> @interface ViewController : UIViewController + (void)initialize; - (instancetype)init; - (instancetype)initWithCoder:(NSCoder *)coder; - (void)awakeFromNib; - (void)loadView; - (void)viewDidLoad; - (void)viewWillLayoutSubviews; - (void)viewDidLayoutSubviews; - (void)didReceiveMemoryWarning; - (void)viewDidAppear:(BOOL)animated; - (void)viewWillAppear:(BOOL)animated; - (void)viewWillDisappear:(BOOL)animated; - (void)viewDidDisappear:(BOOL)animated; - (void)dealloc; - (void)changeColor; @end
/************************************************************************************************** * File name : ViewController.h * Description : Define the ViewController class. * Creator : Frederick Hsu * Creation date: Thu. 23 Feb. 2017 * Copyright(C 2017 All rights reserved. * **************************************************************************************************/ #import <UIKit/UIKit.h> @interface ViewController : UIViewController @property (atomic, readwrite) UILabel *switchOnLabel; @property (atomic, readwrite) UILabel *switchOffLabel; + (void)initialize; - (instancetype)init; - (instancetype)initWithCoder:(NSCoder *)coder; - (void)awakeFromNib; - (void)loadView; - (void)viewDidLoad; - (void)viewWillLayoutSubviews; - (void)viewDidLayoutSubviews; - (void)didReceiveMemoryWarning; - (void)viewDidAppear:(BOOL)animated; - (void)viewWillAppear:(BOOL)animated; - (void)viewWillDisappear:(BOOL)animated; - (void)viewDidDisappear:(BOOL)animated; - (void)dealloc; - (void)changeColor; - (void)changeHint:(UISwitch *)userSwitch; @end
Insert 2 UILabel as property : *switchOnLabel, *switchOffLabel, allow the action function - (void)changeHint:(UISwitch *)userSwitch; to access them.
Insert 2 UILabel as property : *switchOnLabel, *switchOffLabel, allow the action function - (void)changeHint:(UISwitch *)userSwitch; to access them.
C
apache-2.0
Frederick-Hsu/iOS_Objective_C_Development,Frederick-Hsu/iOS_Objective_C_Development
4c73133037265abea9f8c6706197fbed6326630b
Utilities/gdcm/Utilities/gdcm_zlib.h
Utilities/gdcm/Utilities/gdcm_zlib.h
/*========================================================================= Program: GDCM (Grassroots DICOM). A DICOM library Module: $URL$ Copyright (c) 2006-2010 Mathieu Malaterre All rights reserved. See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #ifndef GDCM_ZLIB_H #define GDCM_ZLIB_H /* Use the zlib library configured for gdcm. */ #include "gdcmTypes.h" #ifdef GDCM_USE_SYSTEM_ZLIB // $ dpkg -S /usr/include/zlib.h // zlib1g-dev: /usr/include/zlib.h # include <zlib.h> #else # include <gdcmzlib/zlib.h> #endif #endif
/*========================================================================= Program: GDCM (Grassroots DICOM). A DICOM library Module: $URL$ Copyright (c) 2006-2010 Mathieu Malaterre All rights reserved. See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ #ifndef GDCM_ZLIB_H #define GDCM_ZLIB_H /* Use the zlib library configured for gdcm. */ #include "gdcmTypes.h" #ifdef GDCM_USE_SYSTEM_ZLIB // $ dpkg -S /usr/include/zlib.h // zlib1g-dev: /usr/include/zlib.h # include <itk_zlib.h> #else # include <gdcmzlib/zlib.h> #endif #endif
Make sure to use proper name mangling
Make sure to use proper name mangling
C
apache-2.0
ajjl/ITK,vfonov/ITK,hinerm/ITK,richardbeare/ITK,LucHermitte/ITK,fedral/ITK,LucHermitte/ITK,atsnyder/ITK,spinicist/ITK,LucHermitte/ITK,blowekamp/ITK,rhgong/itk-with-dom,spinicist/ITK,LucasGandel/ITK,fuentesdt/InsightToolkit-dev,daviddoria/itkHoughTransform,heimdali/ITK,eile/ITK,jcfr/ITK,CapeDrew/DCMTK-ITK,fuentesdt/InsightToolkit-dev,hendradarwin/ITK,hinerm/ITK,CapeDrew/DCMTK-ITK,fbudin69500/ITK,PlutoniumHeart/ITK,zachary-williamson/ITK,zachary-williamson/ITK,atsnyder/ITK,BlueBrain/ITK,blowekamp/ITK,fbudin69500/ITK,hjmjohnson/ITK,richardbeare/ITK,paulnovo/ITK,hjmjohnson/ITK,msmolens/ITK,richardbeare/ITK,hjmjohnson/ITK,malaterre/ITK,atsnyder/ITK,stnava/ITK,ajjl/ITK,BRAINSia/ITK,BRAINSia/ITK,cpatrick/ITK-RemoteIO,stnava/ITK,ajjl/ITK,hinerm/ITK,fuentesdt/InsightToolkit-dev,jcfr/ITK,BRAINSia/ITK,daviddoria/itkHoughTransform,thewtex/ITK,CapeDrew/DITK,CapeDrew/DITK,CapeDrew/DITK,zachary-williamson/ITK,msmolens/ITK,spinicist/ITK,hjmjohnson/ITK,spinicist/ITK,fbudin69500/ITK,vfonov/ITK,daviddoria/itkHoughTransform,eile/ITK,richardbeare/ITK,CapeDrew/DCMTK-ITK,vfonov/ITK,BlueBrain/ITK,daviddoria/itkHoughTransform,BlueBrain/ITK,hinerm/ITK,blowekamp/ITK,LucasGandel/ITK,PlutoniumHeart/ITK,InsightSoftwareConsortium/ITK,itkvideo/ITK,fedral/ITK,LucHermitte/ITK,thewtex/ITK,GEHC-Surgery/ITK,GEHC-Surgery/ITK,hinerm/ITK,fuentesdt/InsightToolkit-dev,atsnyder/ITK,itkvideo/ITK,fbudin69500/ITK,paulnovo/ITK,eile/ITK,msmolens/ITK,jcfr/ITK,CapeDrew/DCMTK-ITK,PlutoniumHeart/ITK,fedral/ITK,CapeDrew/DITK,fuentesdt/InsightToolkit-dev,CapeDrew/DITK,GEHC-Surgery/ITK,PlutoniumHeart/ITK,heimdali/ITK,richardbeare/ITK,msmolens/ITK,jmerkow/ITK,PlutoniumHeart/ITK,malaterre/ITK,jmerkow/ITK,BlueBrain/ITK,hjmjohnson/ITK,cpatrick/ITK-RemoteIO,CapeDrew/DITK,itkvideo/ITK,itkvideo/ITK,LucHermitte/ITK,wkjeong/ITK,hjmjohnson/ITK,msmolens/ITK,jcfr/ITK,hendradarwin/ITK,vfonov/ITK,GEHC-Surgery/ITK,ajjl/ITK,richardbeare/ITK,jcfr/ITK,cpatrick/ITK-RemoteIO,rhgong/itk-with-dom,spinicist/ITK,hendradarwin/ITK,zachary-williamson/ITK,jmerkow/ITK,thewtex/ITK,stnava/ITK,fuentesdt/InsightToolkit-dev,atsnyder/ITK,spinicist/ITK,blowekamp/ITK,eile/ITK,thewtex/ITK,fedral/ITK,malaterre/ITK,msmolens/ITK,InsightSoftwareConsortium/ITK,daviddoria/itkHoughTransform,LucasGandel/ITK,hinerm/ITK,BRAINSia/ITK,heimdali/ITK,jmerkow/ITK,atsnyder/ITK,daviddoria/itkHoughTransform,heimdali/ITK,hinerm/ITK,InsightSoftwareConsortium/ITK,zachary-williamson/ITK,LucHermitte/ITK,stnava/ITK,msmolens/ITK,daviddoria/itkHoughTransform,fedral/ITK,CapeDrew/DITK,biotrump/ITK,stnava/ITK,GEHC-Surgery/ITK,ajjl/ITK,Kitware/ITK,LucHermitte/ITK,BlueBrain/ITK,InsightSoftwareConsortium/ITK,biotrump/ITK,thewtex/ITK,BlueBrain/ITK,jmerkow/ITK,GEHC-Surgery/ITK,cpatrick/ITK-RemoteIO,InsightSoftwareConsortium/ITK,InsightSoftwareConsortium/ITK,thewtex/ITK,rhgong/itk-with-dom,zachary-williamson/ITK,blowekamp/ITK,BRAINSia/ITK,itkvideo/ITK,atsnyder/ITK,CapeDrew/DCMTK-ITK,wkjeong/ITK,ajjl/ITK,cpatrick/ITK-RemoteIO,eile/ITK,malaterre/ITK,BRAINSia/ITK,paulnovo/ITK,cpatrick/ITK-RemoteIO,paulnovo/ITK,itkvideo/ITK,GEHC-Surgery/ITK,fedral/ITK,fedral/ITK,rhgong/itk-with-dom,vfonov/ITK,eile/ITK,spinicist/ITK,zachary-williamson/ITK,eile/ITK,richardbeare/ITK,jcfr/ITK,blowekamp/ITK,LucHermitte/ITK,hendradarwin/ITK,Kitware/ITK,fuentesdt/InsightToolkit-dev,malaterre/ITK,GEHC-Surgery/ITK,fuentesdt/InsightToolkit-dev,rhgong/itk-with-dom,jmerkow/ITK,atsnyder/ITK,BlueBrain/ITK,wkjeong/ITK,CapeDrew/DCMTK-ITK,wkjeong/ITK,spinicist/ITK,daviddoria/itkHoughTransform,blowekamp/ITK,fbudin69500/ITK,rhgong/itk-with-dom,itkvideo/ITK,paulnovo/ITK,fedral/ITK,Kitware/ITK,heimdali/ITK,biotrump/ITK,eile/ITK,thewtex/ITK,biotrump/ITK,cpatrick/ITK-RemoteIO,stnava/ITK,paulnovo/ITK,ajjl/ITK,LucasGandel/ITK,biotrump/ITK,fbudin69500/ITK,InsightSoftwareConsortium/ITK,LucasGandel/ITK,CapeDrew/DCMTK-ITK,hjmjohnson/ITK,BlueBrain/ITK,zachary-williamson/ITK,wkjeong/ITK,biotrump/ITK,jmerkow/ITK,zachary-williamson/ITK,heimdali/ITK,wkjeong/ITK,hinerm/ITK,rhgong/itk-with-dom,ajjl/ITK,Kitware/ITK,malaterre/ITK,fuentesdt/InsightToolkit-dev,hendradarwin/ITK,wkjeong/ITK,Kitware/ITK,malaterre/ITK,malaterre/ITK,vfonov/ITK,heimdali/ITK,biotrump/ITK,hendradarwin/ITK,msmolens/ITK,paulnovo/ITK,Kitware/ITK,vfonov/ITK,BRAINSia/ITK,atsnyder/ITK,jcfr/ITK,wkjeong/ITK,hendradarwin/ITK,CapeDrew/DCMTK-ITK,PlutoniumHeart/ITK,biotrump/ITK,daviddoria/itkHoughTransform,rhgong/itk-with-dom,eile/ITK,CapeDrew/DCMTK-ITK,jmerkow/ITK,hendradarwin/ITK,fbudin69500/ITK,LucasGandel/ITK,LucasGandel/ITK,malaterre/ITK,itkvideo/ITK,fbudin69500/ITK,hinerm/ITK,spinicist/ITK,LucasGandel/ITK,Kitware/ITK,CapeDrew/DITK,PlutoniumHeart/ITK,jcfr/ITK,itkvideo/ITK,paulnovo/ITK,cpatrick/ITK-RemoteIO,blowekamp/ITK,stnava/ITK,CapeDrew/DITK,heimdali/ITK,stnava/ITK,stnava/ITK,vfonov/ITK,PlutoniumHeart/ITK,vfonov/ITK
d1b620337221a069e3d13123cbb2fe891130101e
src/clientversion.h
src/clientversion.h
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MINOR 2 #define CLIENT_VERSION_REVISION 0 #define CLIENT_VERSION_BUILD 0 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X #endif // CLIENTVERSION_H
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MINOR 2 #define CLIENT_VERSION_REVISION 0 #define CLIENT_VERSION_BUILD 1 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true // Converts the parameter X to a string after macro replacement on X has been performed. // Don't merge these into one macro! #define STRINGIZE(X) DO_STRINGIZE(X) #define DO_STRINGIZE(X) #X #endif // CLIENTVERSION_H
Update Client Version for New Code Base
Update Client Version for New Code Base
C
mit
summitcoindev/summitcoin,summitcoindev/summitcoin,summitcoin/summitcoin,summitcoin/summitcoin,summitcoin/summitcoin,summitcoindev/summitcoin,summitcoin/summitcoin,summitcoindev/summitcoin,summitcoindev/summitcoin,summitcoin/summitcoin
7afe444fe1c4b1af6035f9d6b72276043eac35ab
3RVX/OSD/OSD.h
3RVX/OSD/OSD.h
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once #include <Windows.h> #include "../HotkeyProcessor.h" #include "../MeterWnd/MeterWnd.h" #include "../Settings.h" #include "../Window.h" #include "OSDType.h" class Monitor; class OSD : HotkeyProcessor, protected Window { public: OSD(LPCWSTR className, HINSTANCE hInstance = NULL); virtual void Hide() = 0; virtual void ProcessHotkeys(HotkeyInfo &hki); bool Enabled(); void Enabled(bool enabled); protected: HWND _masterWnd; Settings *_settings; void HideOthers(OSDType except); void InitMeterWnd(MeterWnd &mWnd); std::vector<Monitor> ActiveMonitors(); void PositionWindow(Monitor monitor, LayeredWnd &lWnd); void CenterWindowX(Monitor monitor, LayeredWnd &lWnd); void CenterWindowY(Monitor monitor, LayeredWnd &lWnd); virtual LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); private: bool _enabled; };
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once #include <Windows.h> #include "../HotkeyProcessor.h" #include "../MeterWnd/MeterWnd.h" #include "../Settings.h" #include "../Window.h" #include "OSDType.h" class Monitor; class OSD : HotkeyProcessor, protected Window { public: OSD(LPCWSTR className, HINSTANCE hInstance = NULL); virtual void Hide() = 0; virtual void ProcessHotkeys(HotkeyInfo &hki); bool Enabled(); void Enabled(bool enabled); /// <summary> /// This method is called when the system display configuration has changed, /// which includes monitors being removed or plugged in. /// </summary> virtual void OnDisplayChange() = 0; protected: HWND _masterWnd; Settings *_settings; void HideOthers(OSDType except); void InitMeterWnd(MeterWnd &mWnd); std::vector<Monitor> ActiveMonitors(); void PositionWindow(Monitor monitor, LayeredWnd &lWnd); void CenterWindowX(Monitor monitor, LayeredWnd &lWnd); void CenterWindowY(Monitor monitor, LayeredWnd &lWnd); virtual LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); private: bool _enabled; };
Add the interface method for OnDisplayChange
Add the interface method for OnDisplayChange
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX
5d35cd534b02e5eee6d579a2af3b3cdc86b8de94
common/user/capi.h
common/user/capi.h
// Harshad Kasture // // This file declares the user level message passing functions used in multithreaded applications // for the multicore simulator. #ifndef CAPI_H #define CAPI_H typedef int CAPI_return_t; typedef int CAPI_endpoint_t; // externed so the names don't get name-mangled //extern "C" { CAPI_return_t CAPI_Initialize(int *rank); CAPI_return_t CAPI_rank(int * rank); CAPI_return_t CAPI_message_send_w(CAPI_endpoint_t send_endpoint, CAPI_endpoint_t receive_endpoint, char * buffer, int size); CAPI_return_t CAPI_message_receive_w(CAPI_endpoint_t send_endpoint, CAPI_endpoint_t receive_endpoint, char * buffer, int size); //} #endif
// Harshad Kasture // // This file declares the user level message passing functions used in multithreaded applications // for the multicore simulator. #ifndef CAPI_H #define CAPI_H typedef int CAPI_return_t; typedef int CAPI_endpoint_t; #ifdef __cplusplus // externed so the names don't get name-mangled extern "C" { #endif CAPI_return_t CAPI_Initialize(int *rank); CAPI_return_t CAPI_rank(int * rank); CAPI_return_t CAPI_message_send_w(CAPI_endpoint_t send_endpoint, CAPI_endpoint_t receive_endpoint, char * buffer, int size); CAPI_return_t CAPI_message_receive_w(CAPI_endpoint_t send_endpoint, CAPI_endpoint_t receive_endpoint, char * buffer, int size); #ifdef __cplusplus } #endif #endif
Add guarded 'extern "C"' attributes so that this header files can be used from both C and C++ programs.
Add guarded 'extern "C"' attributes so that this header files can be used from both C and C++ programs.
C
mit
victorisildur/Graphite,mit-carbon/Graphite-Cycle-Level,fhijaz/Graphite,8l/Graphite,mit-carbon/Graphite,mit-carbon/Graphite,victorisildur/Graphite,8l/Graphite,fhijaz/Graphite,mit-carbon/Graphite-Cycle-Level,victorisildur/Graphite,nkawahara/Graphite,nkawahara/Graphite,mit-carbon/Graphite,nkawahara/Graphite,nkawahara/Graphite,8l/Graphite,fhijaz/Graphite,8l/Graphite,mit-carbon/Graphite-Cycle-Level,mit-carbon/Graphite,mit-carbon/Graphite-Cycle-Level,victorisildur/Graphite,fhijaz/Graphite
5686bec1d4979f9c75b05bd65d9db2f24c621245
client/loop.c
client/loop.c
#include <stdio.h> #include <sys/select.h> /* pselect loop test */ int main(int argc, char *argv[]) { struct timespec timeout; fd_set readfds; int fdcount; while(1){ FD_ZERO(&readfds); FD_SET(0, &readfds); timeout.tv_sec = 1; timeout.tv_nsec = 0; fdcount = pselect(1, &readfds, NULL, NULL, &timeout, NULL); printf("loop %d\n", fdcount); } return 0; }
#include <stdio.h> #include <sys/select.h> /* pselect loop test */ int main(int argc, char *argv[]) { struct timespec timeout; fd_set readfds; int fdcount; char buf[1024]; while(1){ FD_ZERO(&readfds); FD_SET(0, &readfds); timeout.tv_sec = 1; timeout.tv_nsec = 0; fdcount = pselect(1, &readfds, NULL, NULL, &timeout, NULL); printf("loop %d\n", fdcount); if(FD_ISSET(0, &readfds)){ read(0, buf, 1024); printf("buf: %s\n", buf); } } return 0; }
Watch for input from stdin and print it.
Watch for input from stdin and print it.
C
bsd-3-clause
tempbottle/mosquitto,tempbottle/mosquitto,tempbottle/mosquitto,zlargon/mosquitto,tempbottle/mosquitto,zlargon/mosquitto,zlargon/mosquitto,tempbottle/mosquitto,zlargon/mosquitto,zlargon/mosquitto
619709fe771f9da087c2423331b0195f8e2bee91
event/event_system.h
event/event_system.h
#ifndef EVENT_SYSTEM_H #define EVENT_SYSTEM_H #include <event/event_thread.h> /* * XXX * This is kind of an awful shim while we move * towards something thread-oriented. */ class EventSystem { EventThread td_; private: EventSystem(void) : td_() { } ~EventSystem() { } public: Action *poll(const EventPoll::Type& type, int fd, EventCallback *cb) { return (td_.poll(type, fd, cb)); } Action *register_interest(const EventInterest& interest, Callback *cb) { return (td_.register_interest(interest, cb)); } Action *schedule(Callback *cb) { return (td_.schedule(cb)); } Action *timeout(unsigned ms, Callback *cb) { return (td_.timeout(ms, cb)); } void start(void) { td_.start(); td_.join(); } static EventSystem *instance(void) { static EventSystem *instance; if (instance == NULL) instance = new EventSystem(); return (instance); } }; #endif /* !EVENT_SYSTEM_H */
Add EventSystem shim missed in r588.
Add EventSystem shim missed in r588. git-svn-id: 9e2532540f1574e817ce42f20b9d0fb64899e451@589 4068ffdb-0463-0410-8185-8cc71e3bd399
C
bsd-2-clause
diegows/wanproxy,splbio/wanproxy,splbio/wanproxy,splbio/wanproxy,diegows/wanproxy,diegows/wanproxy
cd8ae2c486ec2e12f46a5009ff0cebb603093457
iree/tools/init_translations.h
iree/tools/init_translations.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 // // https://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. // This file defines a helper to trigger the registration of all translations // in and out of MLIR to the system. // // Based on MLIR's InitAllTranslations but without translations we don't care // about. #ifndef IREE_TOOLS_INIT_TRANSLATIONS_H_ #define IREE_TOOLS_INIT_TRANSLATIONS_H_ namespace mlir { void registerFromLLVMIRTranslation(); void registerToLLVMIRTranslation(); void registerToSPIRVTranslation(); // This function should be called before creating any MLIRContext if one // expects all the possible translations to be made available to the context // automatically. inline void registerMlirTranslations() { static bool init_once = []() { registerFromLLVMIRTranslation(); registerToLLVMIRTranslation(); registerToSPIRVTranslation(); return true; }(); (void)init_once; } } // namespace mlir #endif // IREE_TOOLS_INIT_TRANSLATIONS_H_
Implement forked registerAllTranslations() as registerMlirTranslations()
Implement forked registerAllTranslations() as registerMlirTranslations() With https://reviews.llvm.org/D77515, the need for static global ctors is removed from `mlir-translate` and thus can be also removed from `iree-translate`. This already forks the header file `mlir/include/mlir/InitAllTranslations.h` and removes translations not used so far within IREE. Closes https://github.com/google/iree/pull/1395 COPYBARA_INTEGRATE_REVIEW=https://github.com/google/iree/pull/1395 from iml130:init_translations b7688209ed86e78ef1ac19fde17eb1d5e172a21c PiperOrigin-RevId: 305148353
C
apache-2.0
google/iree,google/iree,iree-org/iree,google/iree,iree-org/iree,google/iree,iree-org/iree,iree-org/iree,google/iree,iree-org/iree,iree-org/iree,iree-org/iree,google/iree,google/iree
2bbfb4564380f9e14b2056ad6cc3224927456430
stack_linked.c
stack_linked.c
#include <stdio.h> #include <stdlib.h> typedef struct Node{ int val; struct Node *next; }Node; Node* Push(Node *p, int val){ Node *temp = (struct Node*)malloc(sizeof(struct Node)); temp->val = val; temp->next = p; p = temp; return p; } void Pop(Node *p){ if(p == NULL) return; printf("%p\n",p); Node *temp = p; p = p->next; printf("%p\n",p); free(temp); printf("%p\n",temp); } void PRINT(Node *p){ Node *temp = p; while(temp != NULL){ printf("%d ",temp->val); temp = temp->next; } printf("\n"); } int main(){ Node *head = NULL; head = Push(head,3); head = Push(head,6); head = Push(head,2); head = Push(head,1); head = Push(head,9); PRINT(head); head = Pop(head); head = Pop(head); head = Pop(head); PRINT(head); }
#include <stdio.h> #include <stdlib.h> typedef struct Node{ int val; struct Node *next; }Node; Node* Push(Node *p, int val){ Node *temp = (struct Node*)malloc(sizeof(struct Node)); temp->val = val; temp->next = p; p = temp; return p; } Node* Pop(Node *p){ if(p == NULL) return; Node *temp = p; p = p->next; free(temp); return p; } void PRINT(Node *p){ Node *temp = p; while(temp != NULL){ printf("%d ",temp->val); temp = temp->next; } printf("\n"); } int main(){ Node *head = NULL; head = Push(head,3); head = Push(head,6); head = Push(head,2); head = Push(head,1); head = Push(head,9); PRINT(head); head = Pop(head); head = Pop(head); head = Pop(head); PRINT(head); }
Implement stack with single linked list
Implement stack with single linked list
C
apache-2.0
kmongo/practice
e2f862b2402a270b00334165521a7f838daf9ed1
Classes/MBImageRequest.h
Classes/MBImageRequest.h
// // MBImageRequest.h // MBRequest // // Created by Sebastian Celis on 3/6/12. // Copyright (c) 2012 Mobiata, LLC. All rights reserved. // #if __IPHONE_OS_VERSION_MIN_REQUIRED #import <UIKit/UIKit.h> #elif __MAC_OS_X_VERSION_MIN_REQUIRED #import <Cocoa/Cocoa.h> #endif #import "MBHTTPRequest.h" #if __IPHONE_OS_VERSION_MIN_REQUIRED typedef void (^MBRequestImageCompletionHandler)(UIImage *image, NSError *error); #elif __MAC_OS_X_VERSION_MIN_REQUIRED typedef void (^MBRequestImageCompletionHandler)(NSImage *image, NSError *error); #endif @interface MBImageRequest : MBHTTPRequest // The image returned in the response. @property (atomic, retain, readonly) UIImage *responseImage; // Performs a basic request and notifies the caller with any data downloaded. - (void)performImageRequest:(NSURLRequest *)request completionHandler:(MBRequestImageCompletionHandler)completionHandler; // The callback for image requests. @property (nonatomic, copy, readonly) MBRequestImageCompletionHandler imageCompletionHandler; @end
// // MBImageRequest.h // MBRequest // // Created by Sebastian Celis on 3/6/12. // Copyright (c) 2012 Mobiata, LLC. All rights reserved. // #if __IPHONE_OS_VERSION_MIN_REQUIRED #import <UIKit/UIKit.h> #elif __MAC_OS_X_VERSION_MIN_REQUIRED #import <Cocoa/Cocoa.h> #endif #import "MBHTTPRequest.h" #if __IPHONE_OS_VERSION_MIN_REQUIRED typedef void (^MBRequestImageCompletionHandler)(UIImage *image, NSError *error); #elif __MAC_OS_X_VERSION_MIN_REQUIRED typedef void (^MBRequestImageCompletionHandler)(NSImage *image, NSError *error); #endif @interface MBImageRequest : MBHTTPRequest // The image returned in the response. #if __IPHONE_OS_VERSION_MIN_REQUIRED @property (atomic, retain, readonly) UIImage *responseImage; #elif __MAC_OS_X_VERSION_MIN_REQUIRED @property (atomic, retain, readonly) NSImage *responseImage; #endif // Performs a basic request and notifies the caller with any data downloaded. - (void)performImageRequest:(NSURLRequest *)request completionHandler:(MBRequestImageCompletionHandler)completionHandler; // The callback for image requests. @property (nonatomic, copy, readonly) MBRequestImageCompletionHandler imageCompletionHandler; @end
Fix reference to UIImage when compiled for OS X.
Fix reference to UIImage when compiled for OS X.
C
bsd-3-clause
mobiata/MBRequest,gaurav1981/MBRequest
c68e3206862f647117a46a73af76764d750c05bd
arch/sh/include/asm/ftrace.h
arch/sh/include/asm/ftrace.h
#ifndef __ASM_SH_FTRACE_H #define __ASM_SH_FTRACE_H #ifdef CONFIG_FUNCTION_TRACER #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ #define FTRACE_SYSCALL_MAX (NR_syscalls - 1) #ifndef __ASSEMBLY__ extern void mcount(void); #define MCOUNT_ADDR ((long)(mcount)) #ifdef CONFIG_DYNAMIC_FTRACE #define CALL_ADDR ((long)(ftrace_call)) #define STUB_ADDR ((long)(ftrace_stub)) #define GRAPH_ADDR ((long)(ftrace_graph_call)) #define CALLER_ADDR ((long)(ftrace_caller)) #define MCOUNT_INSN_OFFSET ((STUB_ADDR - CALL_ADDR) - 4) #define GRAPH_INSN_OFFSET ((CALLER_ADDR - GRAPH_ADDR) - 4) struct dyn_arch_ftrace { /* No extra data needed on sh */ }; #endif /* CONFIG_DYNAMIC_FTRACE */ static inline unsigned long ftrace_call_adjust(unsigned long addr) { /* 'addr' is the memory table address. */ return addr; } #endif /* __ASSEMBLY__ */ #endif /* CONFIG_FUNCTION_TRACER */ #endif /* __ASM_SH_FTRACE_H */
#ifndef __ASM_SH_FTRACE_H #define __ASM_SH_FTRACE_H #ifdef CONFIG_FUNCTION_TRACER #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ #define FTRACE_SYSCALL_MAX NR_syscalls #ifndef __ASSEMBLY__ extern void mcount(void); #define MCOUNT_ADDR ((long)(mcount)) #ifdef CONFIG_DYNAMIC_FTRACE #define CALL_ADDR ((long)(ftrace_call)) #define STUB_ADDR ((long)(ftrace_stub)) #define GRAPH_ADDR ((long)(ftrace_graph_call)) #define CALLER_ADDR ((long)(ftrace_caller)) #define MCOUNT_INSN_OFFSET ((STUB_ADDR - CALL_ADDR) - 4) #define GRAPH_INSN_OFFSET ((CALLER_ADDR - GRAPH_ADDR) - 4) struct dyn_arch_ftrace { /* No extra data needed on sh */ }; #endif /* CONFIG_DYNAMIC_FTRACE */ static inline unsigned long ftrace_call_adjust(unsigned long addr) { /* 'addr' is the memory table address. */ return addr; } #endif /* __ASSEMBLY__ */ #endif /* CONFIG_FUNCTION_TRACER */ #endif /* __ASM_SH_FTRACE_H */
Fix an off-by-1 in FTRACE_SYSCALL_MAX.
sh: Fix an off-by-1 in FTRACE_SYSCALL_MAX. This is supposed to be the equivalent of __NR_syscalls, not __NR_syscalls -1. The x86 code this was based on had simply fallen out of sync at the time this was implemented. Fix it up now. As a result, tracing of __NR_perf_counter_open works as advertised. Signed-off-by: Paul Mundt <[email protected]>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs
20871640ea94ce3e1c1237d3d266c622624c5319
LolayHttpClientGlobals.h
LolayHttpClientGlobals.h
// // LolayHttpClientGlobals.h // LolayHttpClientGlobals // // Created by Bruce Johnson on 5/9/14. // Copyright (c) 2014 Lolay. All rights reserved. // #if DEBUG # define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) # define NSLog(...) NSLog(__VA_ARGS__) #else # define DLog(fmt, ...) {} # define NSLog(...) {} #endif
// // LolayHttpClientGlobals.h // LolayHttpClientGlobals // // Created by Bruce Johnson on 5/9/14. // Copyright (c) 2014 Lolay. All rights reserved. // #ifndef DLog #if DEBUG # define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) # define NSLog(...) NSLog(__VA_ARGS__) #else # define DLog(fmt, ...) {} # define NSLog(...) {} #endif #endif
Add a check to see if DLog is already defined.
Add a check to see if DLog is already defined.
C
mit
lolay/http-client,lolay/http-client
7951b508e2f09bc5f1d886f45c83e751798ce824
NumberTheory/GCD.c
NumberTheory/GCD.c
#include<stdio.h> /* CALC GREATEST COMMON DIVISOR BY EUCLIDES ALGORITHM * r -> remainder * q -> quotient */ int calc_gcd(int n1, int n2, int r, int q){ if (r == 0) return n2; return calc_gcd(n2,r,n2 % r, n2 / r); } /* FIRE UP THE FUNCTION GCD */ int gcd(int n1, int n2){ if ( n1 > n2 ) return calc_gcd(n1, n2, n1 % n2, n1 / n2); return calc_gcd(n2, n1, n2 % n1, n2 / n1); } int main(){ int n1=2366, n2=273; printf("gcd= %d ",gcd(n1,n2)); return 0; }
#include<stdio.h> /* CALC GREATEST COMMON DIVISOR BY EUCLIDES ALGORITHM * r -> remainder * q -> quotient */ int calc_gcd(int n1, int n2, int r, int q){ if (r == 0) return n2; return calc_gcd(n2,r,n2 % r, n2 / r); } /* FIRE UP THE FUNCTION GCD */ int gcd(int n1, int n2){ if ( n1 > n2 ) return calc_gcd(n1, n2, n1 % n2, n1 / n2); return calc_gcd(n2, n1, n2 % n1, n2 / n1); } /* int main(){ int n1=2366, n2=273; printf("gcd= %d ",gcd(n1,n2)); return 0; } */
Comment the main for import as a library in the function of the least common divisor (LCD)
Comment the main for import as a library in the function of the least common divisor (LCD)
C
mit
xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book,xdanielsb/Marathon-book
ad32b2d00cfcd0fea8547270b0f7c98ea86cb0fb
tests/test_common.h
tests/test_common.h
/*ckwg +5 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. */ #ifndef VISTK_TEST_TEST_COMMON_H #define VISTK_TEST_TEST_COMMON_H #define EXPECT_EXCEPTION(exc, code, action) \ do \ { \ bool got_exception = false; \ \ try \ { \ code; \ } \ catch (exc& e) \ { \ got_exception = true; \ \ (void)e.what(); \ } \ catch (std::exception& e) \ { \ std::cerr << "Error: Unexpected exception: " \ << e.what() << std::endl; \ \ got_exception = true; \ } \ \ if (!got_exception) \ { \ std::cerr << "Error: Did not get " \ "expected exception when " \ << action << std::endl; \ } \ } while (false) #endif // VISTK_TEST_TEST_COMMON_H
/*ckwg +5 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. */ #ifndef VISTK_TEST_TEST_COMMON_H #define VISTK_TEST_TEST_COMMON_H #define TEST_ERROR(msg) \ do \ { \ std::cerr << "Error: " << msg << std::endl; \ } while (false) #define EXPECT_EXCEPTION(ex, code, action) \ do \ { \ bool got_exception = false; \ \ try \ { \ code; \ } \ catch (ex& e) \ { \ got_exception = true; \ \ (void)e.what(); \ } \ catch (std::exception& e) \ { \ TEST_ERROR("Unexpected exception: " \ << e.what()); \ \ got_exception = true; \ } \ \ if (!got_exception) \ { \ TEST_ERROR("Did not get " \ "expected exception when " \ << action); \ } \ } while (false) #endif // VISTK_TEST_TEST_COMMON_H
Add macro for errors in tests
Add macro for errors in tests
C
bsd-3-clause
mathstuf/sprokit,mathstuf/sprokit,linus-sherrill/sprokit,linus-sherrill/sprokit,mathstuf/sprokit,linus-sherrill/sprokit,Kitware/sprokit,Kitware/sprokit,Kitware/sprokit,Kitware/sprokit,linus-sherrill/sprokit,mathstuf/sprokit
ec6236a16d88eae7f079448946cb91b1484f92e5
inc/JsonSerializer.h
inc/JsonSerializer.h
//! \file #ifndef JSONSERIALIZER_H #define JSONSERIALIZER_H #include <iostream> #include "ArticleCollection.h" namespace WikiWalker { /*! Serialize AricleCollection from and to a custom JSON format */ class JsonSerializer { public: /*! Serialize ArticleCollection to JSON in an output stream * \param a pointer to article to be output * \param os out stream to putput to. * YOU are responsible for opening and closing the stream */ void serialize(const ArticleCollection& collection, std::ostream& outstream); }; } #endif // JSONSERIALIZER_H
//! \file #ifndef WIKIWALKER_JSONSERIALIZER_H #define WIKIWALKER_JSONSERIALIZER_H #include <iostream> #include "ArticleCollection.h" namespace WikiWalker { /*! Serialize AricleCollection from and to a custom JSON format */ class JsonSerializer { public: /*! Serialize ArticleCollection to JSON in an output stream * \param a pointer to article to be output * \param os out stream to putput to. * YOU are responsible for opening and closing the stream */ void serialize(const ArticleCollection& collection, std::ostream& outstream); }; } #endif // WIKIWALKER_JSONSERIALIZER_H
Apply prefix to include guard
Apply prefix to include guard
C
mit
dueringa/WikiWalker
b16e10bf8987b6e4278c17bedb552f49bf7e9461
inc/math_container.h
inc/math_container.h
#ifndef MATH_CONTAINER #define MATH_CONTAINER #include <iostream> #include <vector> #include <complex> #include <algorithm> #include <cmath> /********************************/ /*Find the index during the sort*/ /********************************/ template<typename T> class CompareIndicesByAnotherVectorValues { const std::vector<T>* values; public: CompareIndicesByAnotherVectorValues(const std::vector<T>* val) : values(val) {} bool operator() (const size_t & a, const size_t & b) const { return (*values)[a] < (*values)[b]; } }; template <typename T> std::vector<size_t> sort_indexes(const std::vector<T> &v) { // initialize original index locations std::vector<size_t> idx(v.size()); for (size_t i = 0; i != idx.size(); ++i) idx[i] = i; CompareIndicesByAnotherVectorValues<T> idex_comp(&v); // sort indexes based on comparing values in v std::sort(idx.begin(), idx.end(), idex_comp); return idx; } /******************************************************/ /*solve the equation cosh(x)=exp(y), input y, return x*/ /******************************************************/ std::complex<double> coshx_eq_expy(double y); #endif
#ifndef MATH_CONTAINER_H #define MATH_CONTAINER_H #include <iostream> #include <vector> #include <complex> #include <algorithm> #include <cmath> /********************************/ /*Find the index during the sort*/ /********************************/ template<typename T> class CompareIndicesByAnotherVectorValues { const std::vector<T>* values; public: CompareIndicesByAnotherVectorValues(const std::vector<T>* val) : values(val) {} bool operator() (const size_t & a, const size_t & b) const { return (*values)[a] < (*values)[b]; } }; template <typename T> std::vector<size_t> sort_indexes(const std::vector<T> &v) { // initialize original index locations std::vector<size_t> idx(v.size()); for (size_t i = 0; i != idx.size(); ++i) idx[i] = i; CompareIndicesByAnotherVectorValues<T> idex_comp(&v); // sort indexes based on comparing values in v std::sort(idx.begin(), idx.end(), idex_comp); return idx; } /******************************************************/ /*solve the equation cosh(x)=exp(y), input y, return x*/ /******************************************************/ std::complex<double> coshx_eq_expy(double y); #endif
Set the header protection to end with _H.
Set the header protection to end with _H.
C
mit
hshi/math_lib_hao,hshi/math_lib_hao
5cef25695718f2bbb2505ff63f1d2557d9429fcf
SchemeBasicTypes.h
SchemeBasicTypes.h
#ifndef SCHEME_BASIC_TYPES_H #define SCHEME_BASIC_TYPES_H #include "SchemeType.h" extern const SchemeType SchemeBool; extern const SchemeCons *const SchemeBoolTrue; extern const SchemeCons *const SchemeBoolFalse; extern const SchemeType SchemeTuple; extern const SchemeCons *const SchemeTupleTuple; extern const SchemeType SchemeList; extern const SchemeCons *const SchemeListCons; extern const SchemeCons *const SchemeListEmpty; extern const SchemeType SchemeOption; extern const SchemeCons *const SchemeOptionNone; extern const SchemeCons *const SchemeOptionSome; extern const SchemeType SchemeEither; #endif /* !SCHEME_BASIC_TYPES_H */
#ifndef SCHEME_BASIC_TYPES_H #define SCHEME_BASIC_TYPES_H #include "SchemeType.h" extern const SchemeType SchemeBool; extern const SchemeCons *const SchemeBoolTrue; extern const SchemeCons *const SchemeBoolFalse; extern const SchemeType SchemeTuple; extern const SchemeCons *const SchemeTupleTuple; extern const SchemeType SchemeList; extern const SchemeCons *const SchemeListCons; extern const SchemeCons *const SchemeListEmpty; extern const SchemeType SchemeOption; extern const SchemeCons *const SchemeOptionNone; extern const SchemeCons *const SchemeOptionSome; extern const SchemeType SchemeEither; static void SchemeMarshalBool(Scheme *context, bool value) { SchemeObj *val = &context->value; val->hdr.kind = SCHEME_KIND_VAL; val->hdr.variant = value ? SchemeBoolTrue->hdr.variant : SchemeBoolFalse->hdr.variant; val->hdr.size = 0; val->word.type = &SchemeBool; } #endif /* !SCHEME_BASIC_TYPES_H */
Add function for marshaling C booleans into Scheme.
Add function for marshaling C booleans into Scheme.
C
mit
bassettmb/scheme
84db8f7ea5126ae880a4dc73686a95bc66766020
LRImageManager/LRImageOperation+Private.h
LRImageManager/LRImageOperation+Private.h
// // LRImageOperation+Private.h // iShows // // Created by Luis Recuenco on 19/05/13. // Copyright (c) 2013 Luis Recuenco. All rights reserved. // #import "LRImageOperation.h" @interface LRImageOperation (Private) // Inputs @property (nonatomic, strong, readonly) NSURL *url; @property (nonatomic, assign, readonly) CGSize size; @property (nonatomic, assign, readonly) BOOL diskCache; @property (nonatomic, assign, readonly) LRCacheStorageOptions storageOptions; @property (nonatomic, strong, readonly) NSMutableArray *completionHandlers; // Outputs @property (nonatomic, strong, readonly) UIImage *image; @property (nonatomic, strong, readonly) NSError *error; @end
Move LRImageOperation inputs and outputs to an appropriate category
Move LRImageOperation inputs and outputs to an appropriate category
C
mit
toto/LRImageManager,vhoto-dev/LRImageManager,vhoto-dev/LRImageManager,vhoto-dev/LRImageManager,luisrecuenco/LRImageManager,Wallapop/LRImageManager,luisrecuenco/LRImageManager,luisrecuenco/LRImageManager,toto/LRImageManager,toto/LRImageManager
690c2e22d48c37fa590e9e93595fc5c5ee0d1eab
include/clang/CodeGen/ModuleBuilder.h
include/clang/CodeGen/ModuleBuilder.h
//===--- CodeGen/ModuleBuilder.h - Build LLVM from ASTs ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the ModuleBuilder interface. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_CODEGEN_MODULEBUILDER_H #define LLVM_CLANG_CODEGEN_MODULEBUILDER_H #include "clang/AST/ASTConsumer.h" #include <string> namespace llvm { class LLVMContext; class Module; } namespace clang { class Diagnostic; class LangOptions; class CodeGenOptions; class CodeGenerator : public ASTConsumer { public: virtual llvm::Module* GetModule() = 0; virtual llvm::Module* ReleaseModule() = 0; }; CodeGenerator *CreateLLVMCodeGen(Diagnostic &Diags, const std::string &ModuleName, const CodeGenOptions &CGO, llvm::LLVMContext& C); } #endif
//===--- CodeGen/ModuleBuilder.h - Build LLVM from ASTs ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the ModuleBuilder interface. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_CODEGEN_MODULEBUILDER_H #define LLVM_CLANG_CODEGEN_MODULEBUILDER_H #include "clang/AST/ASTConsumer.h" #include <string> namespace llvm { class LLVMContext; class Module; } namespace clang { class Diagnostic; class LangOptions; class CodeGenOptions; class CodeGenerator : public ASTConsumer { public: virtual llvm::Module* GetModule() = 0; virtual llvm::Module* ReleaseModule() = 0; }; /// CreateLLVMCodeGen - Create a CodeGenerator instance. /// It is the responsibility of the caller to call delete on /// the allocated CodeGenerator instance. CodeGenerator *CreateLLVMCodeGen(Diagnostic &Diags, const std::string &ModuleName, const CodeGenOptions &CGO, llvm::LLVMContext& C); } #endif
Add a comment to mention the memory ownership situation.
Add a comment to mention the memory ownership situation. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@104886 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
9e5acfd583ee88d53cb77691f0d0a882c0fc2473
MdePkg/Library/BaseLib/CpuDeadLoop.c
MdePkg/Library/BaseLib/CpuDeadLoop.c
/** @file Base Library CPU Functions for all architectures. Copyright (c) 2006 - 2008, Intel Corporation<BR> All rights reserved. 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. **/ #include <Base.h> #include <Library/BaseLib.h> /** Executes an infinite loop. Forces the CPU to execute an infinite loop. A debugger may be used to skip past the loop and the code that follows the loop must execute properly. This implies that the infinite loop must not cause the code that follow it to be optimized away. **/ VOID EFIAPI CpuDeadLoop ( VOID ) { volatile UINTN Index; for (Index = 0; 0 == Index;); }
/** @file Base Library CPU Functions for all architectures. Copyright (c) 2006 - 2008, Intel Corporation<BR> All rights reserved. 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. **/ #include <Base.h> #include <Library/BaseLib.h> /** Executes an infinite loop. Forces the CPU to execute an infinite loop. A debugger may be used to skip past the loop and the code that follows the loop must execute properly. This implies that the infinite loop must not cause the code that follow it to be optimized away. **/ VOID EFIAPI CpuDeadLoop ( VOID ) { volatile UINTN Index; for (Index = 0; Index == 0;); }
Change style 0 == Index to Index == 0
Change style 0 == Index to Index == 0 git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@7493 6f19259b-4bc3-4df7-8a09-765794883524
C
bsd-2-clause
MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2
2c2367e6c537aaf7a1f79c196aea98efdd6418c2
src/svr/all.h
src/svr/all.h
#ifndef TLSCA_SVR__ALL_H_ #define TLSCA_SVR__ALL_H_ #include <stdlib.h> #include <stdio.h> #include <pthread.h> #include <ft.h> #include <tlsca.h> #include <seacatcc.h> struct sca_app; extern struct sca_app sca_app; #include "config.h" #include "app.h" #include "reactor.h" #include "cntl.h" #endif //TLSCA_SVR__ALL_H_
#ifndef TLSCA_SVR__ALL_H_ #define TLSCA_SVR__ALL_H_ #include <stdlib.h> #include <stdio.h> #include <pthread.h> #include <ft.h> #include <tlsca.h> #include <seacatcc.h> struct sca_app; extern struct sca_app sca_app; #include "config.h" #include "app.h" #include "reactor.h" #include "cntl.h" enum sca_frame_type { FT_FRAME_TYPE_SEACATCC_WRITE = 0xFFFFF001, FT_FRAME_TYPE_SEACATCC_READ = 0xFFFFF002, }; #endif //TLSCA_SVR__ALL_H_
Add a new frame types.
Add a new frame types.
C
bsd-3-clause
TeskaLabs/SeaCat.io-Agent,TeskaLabs/SeaCat.io-Agent
4b1d156a39827af50072cf16abffc11dc822ade9
Foundation/NSSortDescriptor+Essentials.h
Foundation/NSSortDescriptor+Essentials.h
// // NSSortDescriptor+Essentials.h // Essentials // // Created by Martin Kiss on 11.4.14. // Copyright (c) 2014 iAdverti. All rights reserved. // #import <Foundation/Foundation.h> typedef enum : BOOL { ESSSortDescending = NO, ESSSortAscending = YES, } ESSSort; @interface NSSortDescriptor (Essentials) + (instancetype)sortAscending:(BOOL)ascending; + (instancetype)sortAscending:(BOOL)ascending selector:(SEL)selector; + (instancetype)randomSortDescriptor; + (instancetype)sortDescriptorForViewOriginX; + (instancetype)sortDescriptorForViewOriginY; @end #define ESSSort(Class, keyPath, ascend) \ (NSSortDescriptor *)({ \ [NSSortDescriptor sortDescriptorWithKey:@#keyPath ascending:ESSSort##ascend]; \ }) #define ESSSortUsing(Class, keyPath, ascend, compareSelector) \ (NSSortDescriptor *)({ \ if (NO) { \ Class *object = nil; \ __unused NSComparisonResult r = [object.keyPath compareSelector object.keyPath]; \ } \ SEL selector = NSSelectorFromString(@#compareSelector); \ [NSSortDescriptor sortDescriptorWithKey:@#keyPath ascending:ESSSort##ascend selector:selector]; \ })
// // NSSortDescriptor+Essentials.h // Essentials // // Created by Martin Kiss on 11.4.14. // Copyright (c) 2014 iAdverti. All rights reserved. // #import <Foundation/Foundation.h> typedef enum : BOOL { ESSSortDescending = NO, ESSSortAscending = YES, } ESSSort; @interface NSSortDescriptor (Essentials) + (instancetype)sortAscending:(BOOL)ascending; + (instancetype)sortAscending:(BOOL)ascending selector:(SEL)selector; + (instancetype)randomSortDescriptor; + (instancetype)sortDescriptorForViewOriginX; + (instancetype)sortDescriptorForViewOriginY; @end #define ESSSort(Class, keyPath, ascend) \ (NSSortDescriptor *)({ \ if (NO) { \ Class *object = nil; \ (void)object.keyPath; \ } \ [NSSortDescriptor sortDescriptorWithKey:@#keyPath ascending:ESSSort##ascend]; \ }) #define ESSSortUsing(Class, keyPath, ascend, compareSelector) \ (NSSortDescriptor *)({ \ if (NO) { \ Class *object = nil; \ (void)object.keyPath; \ } \ SEL selector = NSSelectorFromString(@#compareSelector); \ [NSSortDescriptor sortDescriptorWithKey:@#keyPath ascending:ESSSort##ascend selector:selector]; \ })
Fix ESSSort to work with non-object properties
Fix ESSSort to work with non-object properties
C
mit
Tricertops/Essentials,Tricertops/Essentials
4e9639ecf891d6443a1a0fde3d14661106ccb2e8
src/matchers/EXPMatchers+equal.h
src/matchers/EXPMatchers+equal.h
#import "Expecta.h" EXPMatcherInterface(_equal, (id expected)); EXPMatcherInterface(equal, (id expected)); // to aid code completion #define equal(expected) _equal(EXPObjectify((expected)))
#import "Expecta.h" EXPMatcherInterface(_equal, (id expected)); EXPMatcherInterface(equal, (id expected)); // to aid code completion #define equal(...) _equal(EXPObjectify((__VA_ARGS__)))
Make usage of NSArray literals a little bit simpler in equal()
Make usage of NSArray literals a little bit simpler in equal() This allows to write something like expect(array).to.equal(@[ @"a", @"b", @"c" ]) without additional parentheses around the array literal.
C
mit
jmoody/expecta,iosdev-republicofapps/expecta,modocache/expecta,jmburges/expecta,tonyarnold/expecta,ashfurrow/expecta,tonyarnold/expecta,suxinde2009/expecta,modocache/expecta,PatrykKaczmarek/expecta,Bogon/expecta,suxinde2009/expecta,specta/expecta,iguchunhui/expecta,tonyarnold/expecta,PatrykKaczmarek/expecta,PatrykKaczmarek/expecta,wessmith/expecta,jmburges/expecta,tonyarnold/expecta,PatrykKaczmarek/expecta,Bogon/expecta,jmoody/expecta,ashfurrow/expecta,wessmith/expecta,jmburges/expecta,jmoody/expecta,Lightricks/expecta,ashfurrow/expecta,udemy/expecta,jmburges/expecta,iguchunhui/expecta,jmoody/expecta,udemy/expecta,Lightricks/expecta,iosdev-republicofapps/expecta,modocache/expecta,iosdev-republicofapps/expecta,ashfurrow/expecta,modocache/expecta,iosdev-republicofapps/expecta
1d62dd3d309d009ffa3f9a71cf141ab7689e1138
Maze/src/maze/proceduralmaze.h
Maze/src/maze/proceduralmaze.h
#ifndef __PROCEDURALMAZE_H__ #define __PROCEDURALMAZE_H__ #include "maze.h" #include <map> class ProceduralMaze { private: int width; int height; public: std::map<std::tuple<int, int>, int> grid; ProceduralMaze(int width, int height); void generate(); void clearGrid(); std::vector<std::tuple<int, int>> getAdjCells(std::tuple<int, int> center, Tile tile_state); }; #endif
#ifndef __PROCEDURALMAZE_H__ #define __PROCEDURALMAZE_H__ #include "maze.h" #include <map> class ProceduralMaze { private: int width; int height; std::map<std::tuple<int, int>, int> grid; void clearGrid(); std::vector<std::tuple<int, int>> getAdjCells(std::tuple<int, int> center, Tile tile_state); public: ProceduralMaze(int width, int height); void generate(); void print(); std::map<std::tuple<int, int>, int> getGrid() { return grid; } }; #endif
Move some ProceduralMaze public methods to private
Move some ProceduralMaze public methods to private
C
mit
gfceccon/Maze,gfceccon/Maze
95a836693fb9b0e33427e75d0f96441daa15ed84
c/challenges/30daysofcode/day-00.c
c/challenges/30daysofcode/day-00.c
#include <stdio.h> int main() { // Declare a variable named 'input_string' to hold our input. char input_string[105]; // Read a full line of input from stdin and save it to our variable, input_string. scanf("%[^\n]", input_string); // Print a string literal saying "Hello, World." to stdout using printf. printf("Hello, World.\n"); // TODO: Write a line of code here that prints the contents of input_string to stdout. printf("%s", input_string); return 0; }
Add 30 Days of Code Day 0 in C.
Add 30 Days of Code Day 0 in C.
C
mit
KoderDojo/hackerrank,KoderDojo/hackerrank
cad39e196f1663c40c054441fe0c56bb5a225cab
copasi/output/CNodeO.h
copasi/output/CNodeO.h
/***************************************************************************** * PROGRAM NAME: CNodeO.h * PROGRAMMER: Wei Sun [email protected] * PURPOSE: Define the node object in user defined function *****************************************************************************/ #ifndef COPASI_CNodeO #define COPASI_CNodeO #include <string> #include <vector> #include "copasi.h" #include "model/model.h" #include "utilities/utilities.h" #include "function/function.h" class CNodeO: public CNodeK { private: /** * Title of the node. */ string mTitle; /** * Type of the node's Datum. */ C_INT32 mDatumType; /** * I String of the node */ string mI; /** * J String of the node */ string mJ; public: /** * Default constructor */ CNodeO(); /** * Constructor for operator * @param "const string" title * @param "const C_INT32" type * @param "const string" i_str * @param "const string" j_str */ CNodeO(string title, C_INT32 type, string i_str, string j_str); /** * Destructor */ ~CNodeO(); /** * Delete */ void cleanup(); /** * Loads an object with data coming from a CReadConfig object. * (CReadConfig object reads an input stream) * @param pconfigbuffer reference to a CReadConfig object. * @return Fail */ C_INT32 load(CReadConfig & configbuffer); /** * Saves the contents of the object to a CWriteConfig object. * (Which usually has a file attached but may also have socket) * @param pconfigbuffer reference to a CWriteConfig object. * @return Fail */ C_INT32 save(CWriteConfig & configbuffer) const; /** * Retrieving the Title of a node * @return string */ string getTitle() const; /** * Retrieving I String of a node * @return string */ string getIString() const; /** * Retrieving J String of a node * @return string */ string getJString() const; /** * Setting Title of the node * @param "const string" &title */ void setTitle(const string& title); /** * Setting I String of the node * @param "const string" &i_string */ void setIString(const string & i_string); /** * Setting I String of the node * @param "const string" &j_string */ void setJString(const string & j_string); /** * Get the node's Datum type */ C_INT32 getDatumType() const; /** * Set the node's Datum Type */ void setDatumType(const C_INT32 datumType); }; #endif
Save each node in User Defined Functions
Save each node in User Defined Functions
C
artistic-2.0
jonasfoe/COPASI,copasi/COPASI,jonasfoe/COPASI,copasi/COPASI,copasi/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,copasi/COPASI,copasi/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,jonasfoe/COPASI,copasi/COPASI,jonasfoe/COPASI,copasi/COPASI,copasi/COPASI,copasi/COPASI
26134a1b596b9763a6975f15bf296a580b141114
test/Analysis/array-struct.c
test/Analysis/array-struct.c
// RUN: clang -checker-simple -verify %s && // RUN: clang -checker-simple -analyzer-store-region -verify %s struct s { int data; int data_array[10]; }; typedef struct { int data; } STYPE; void g1(struct s* p); void f(void) { int a[10]; int (*p)[10]; p = &a; (*p)[3] = 1; struct s d; struct s *q; q = &d; q->data = 3; d.data_array[9] = 17; } void f2() { char *p = "/usr/local"; char (*q)[4]; q = &"abc"; } void f3() { STYPE s; } void f4() { int a[] = { 1, 2, 3}; int b[3] = { 1, 2 }; } void f5() { struct s data; g1(&data); } void f6() { char *p; p = __builtin_alloca(10); p[1] = 'a'; } struct s2; void g2(struct s2 *p); void f7() { struct s2 *p = __builtin_alloca(10); g2(p); }
// RUN: clang -checker-simple -verify %s && // RUN: clang -checker-simple -analyzer-store-region -verify %s struct s { int data; int data_array[10]; }; typedef struct { int data; } STYPE; void g1(struct s* p); void f(void) { int a[10]; int (*p)[10]; p = &a; (*p)[3] = 1; struct s d; struct s *q; q = &d; q->data = 3; d.data_array[9] = 17; } void f2() { char *p = "/usr/local"; char (*q)[4]; q = &"abc"; } void f3() { STYPE s; } void f4() { int a[] = { 1, 2, 3}; int b[3] = { 1, 2 }; } void f5() { struct s data; g1(&data); } void f6() { char *p; p = __builtin_alloca(10); p[1] = 'a'; } struct s2; void g2(struct s2 *p); void f7() { struct s2 *p = __builtin_alloca(10); g2(p); } void f8() { int a[10]; a[sizeof(a) - 1] = 1; }
Add test for unsigned array index.
Add test for unsigned array index. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@59239 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang
2dea6e6b3e25adf606db5d4085f5080f2e5057a1
media/rx/video-rx.h
media/rx/video-rx.h
#ifndef __VIDEO_RX_H__ #define __VIDEO_RX_H__ #include "libavformat/avformat.h" typedef struct DecodedFrame { AVFrame* pFrameRGB; uint8_t *buffer; } DecodedFrame; typedef struct FrameManager { enum PixelFormat pix_fmt; void (*put_video_frame_rx)(uint8_t *data, int with, int height, int nframe); DecodedFrame* (*get_decoded_frame_buffer)(int width, int height); void (*release_decoded_frame_buffer)(void); } FrameManager; int start_video_rx(const char* sdp, int maxDelay, FrameManager *frame_manager); int stop_video_rx(); #endif /* __VIDEO_RX_H__ */
#ifndef __VIDEO_RX_H__ #define __VIDEO_RX_H__ #include "libavformat/avformat.h" typedef struct DecodedFrame { AVFrame* pFrameRGB; uint8_t *buffer; } DecodedFrame; typedef struct FrameManager { enum PixelFormat pix_fmt; void (*put_video_frame_rx)(uint8_t *data, int width, int height, int nframe); DecodedFrame* (*get_decoded_frame_buffer)(int width, int height); void (*release_decoded_frame_buffer)(void); } FrameManager; int start_video_rx(const char* sdp, int maxDelay, FrameManager *frame_manager); int stop_video_rx(); #endif /* __VIDEO_RX_H__ */
Fix width param name in put_video_frame_rx function pointer.
Fix width param name in put_video_frame_rx function pointer.
C
lgpl-2.1
shelsonjava/kc-media-native,Kurento/kc-media-native,shelsonjava/kc-media-native,Kurento/kc-media-native
70d22f24048fde4c1eada353a666240b89f00ae7
tests/test_bitblasting.c
tests/test_bitblasting.c
/* Unit tests for functions that implement aspects of bitblasting. * * SCL; 2016 */ #define _POSIX_C_SOURCE 200809L #include <stdlib.h> #include "ptree.h" #include "tests_common.h" int main( int argc, char **argv ) { ptree_t *head = NULL; head = var_to_bool( "x", 2 ); if (head == NULL) { ERRPRINT( "var_to_bool() unexpectedly returned NULL (error)." ); abort(); } delete_tree( head ); head = NULL; return 0; }
/* Unit tests for functions that implement aspects of bitblasting. * * SCL; 2016 */ #define _POSIX_C_SOURCE 200809L #include <stdlib.h> #include <string.h> #include "ptree.h" #include "tests_common.h" int main( int argc, char **argv ) { ptree_t *head = NULL; head = var_to_bool( "x", 2 ); if (head == NULL) { ERRPRINT( "var_to_bool() unexpectedly returned NULL (error)." ); abort(); } if (tree_size( head ) != 2) { ERRPRINT1( "var_to_bool() returned list of %d variables, " "rather than list of length 2.", tree_size( head ) ); abort(); } if (strncmp( "x0", (get_list_item( head, 0 ))->name, 2 ) || strncmp( "x1", (get_list_item( head, 1 ))->name, 2 )) { ERRPRINT( "unexpected bit-index variable name from var_to_bool()" ); abort(); } delete_tree( head ); head = NULL; return 0; }
Test more aspects of return value from var_to_bool
TEST: Test more aspects of return value from var_to_bool
C
bsd-3-clause
slivingston/gr1c,slivingston/gr1c,slivingston/gr1c
1e4a7ff20be308688e8b33cbd52c865e74ddd96d
linux/epoll/peer_testing.h
linux/epoll/peer_testing.h
#ifndef CJET_PEER_TESTING_H #define CJET_PEER_TESTING_H #ifdef TESTING #ifdef __cplusplus extern "C" { #endif int fake_read(int fd, void *buf, size_t count); int fake_send(int fd, void *buf, size_t count, int flags); #ifdef __cplusplus } #endif #define READ fake_read #define SEND fake_send #define WRITEV fake_writev #else #define READ read #define SEND send #define WRITEV writev #endif #endif
#ifndef CJET_PEER_TESTING_H #define CJET_PEER_TESTING_H #ifdef TESTING #ifdef __cplusplus extern "C" { #endif int fake_read(int fd, void *buf, size_t count); int fake_send(int fd, void *buf, size_t count, int flags); int fake_writev(int fd, const struct iovec *iov, int iovcnt); #ifdef __cplusplus } #endif #define READ fake_read #define SEND fake_send #define WRITEV fake_writev #else #define READ read #define SEND send #define WRITEV writev #endif #endif
Add missing prototype for fake_writev().
Add missing prototype for fake_writev().
C
mit
mloy/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,gatzka/cjet,gatzka/cjet,mloy/cjet,mloy/cjet
60dca868c576bf5e683a4173fec0ef710634570f
transmission_interface/include/transmission_interface/robot_transmissions.h
transmission_interface/include/transmission_interface/robot_transmissions.h
/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2013, PAL Robotics S.L. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * 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. // * Neither the name of hiDOF, Inc. 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. ////////////////////////////////////////////////////////////////////////////// /// \author Adolfo Rodriguez Tsouroukdissian #ifndef TRANSMISSION_INTERFACE_ROBOT_TRANSMISSIONS_H #define TRANSMISSION_INTERFACE_ROBOT_TRANSMISSIONS_H #include <hardware_interface/internal/interface_manager.h> #include <hardware_interface/robot_hw.h> namespace transmission_interface { /** * \brief Robot transmissions interface. * * This class provides a standardized interface to a set of robot transmission interfaces that allow to map between * actuator and joint spaces. It is meant to be used as a building block for robot hardware abstractions. * * This class implements a 1-to-1 map between the names of transmission interface types and instances of those * interface types. */ class RobotTransmissions : public hardware_interface::InterfaceManager {}; } // namespace #endif // header guard
Add class for holding transmission interfaces.
Add class for holding transmission interfaces. - Mirrors hardware_interface::RobotHW, but for transmissions.
C
bsd-3-clause
ros-controls/ros_control,ros-controls/ros_control
d7d28c5f55d6022fbcbdb4005251303b8fd44c25
spire_scirun/namespaces.h
spire_scirun/namespaces.h
/* For more information, please see: http://software.sci.utah.edu The MIT License Copyright (c) 2013 Scientific Computing and Imaging Institute, University of Utah. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /// \author James Hughes /// \date October 2013 #ifndef NAMESPACES_H #define NAMESPACES_H // 'Forward declaration' of namespaces. namespace CPM_SPIRE_NS {} namespace CPM_SPIRE_SCIRUN_NS { // Renaming namespaces in our top level. namespace spire = CPM_SPIRE_NS; } // namespace CPM_SPIRE_SCIRUN_NS #endif
/* For more information, please see: http://software.sci.utah.edu The MIT License Copyright (c) 2013 Scientific Computing and Imaging Institute, University of Utah. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /// \author James Hughes /// \date October 2013 #ifndef MODULE_SPIRE_SCIRUN_NAMESPACES_H #define MODULE_SPIRE_SCIRUN_NAMESPACES_H // 'Forward declaration' of namespaces. namespace CPM_SPIRE_NS {} namespace CPM_SPIRE_SCIRUN_NS { namespace spire = CPM_SPIRE_NS; } // namespace CPM_SPIRE_SCIRUN_NS #endif
Make include guard more specific.
Make include guard more specific.
C
mit
iauns/spire-scirun,iauns/spire-scirun
10e4ffc630f528a703eca019e0bd69cfe076480f
Sources/BraintreeVenmo/Public/BraintreeVenmo/BTVenmoAccountNonce.h
Sources/BraintreeVenmo/Public/BraintreeVenmo/BTVenmoAccountNonce.h
#if __has_include(<Braintree/BraintreeVenmo.h>) #import <Braintree/BraintreeCore.h> #else #import <BraintreeCore/BraintreeCore.h> #endif /** Contains information about a Venmo Account payment method */ @interface BTVenmoAccountNonce : BTPaymentMethodNonce /** The email associated with the Venmo account */ @property (nonatomic, nullable, readonly, copy) NSString *email; /** The external ID associated with the Venmo account */ @property (nonatomic, nullable, readonly, copy) NSString *externalId; /** The first name associated with the Venmo account */ @property (nonatomic, nullable, readonly, copy) NSString *firstName; /** The last name associated with the Venmo account */ @property (nonatomic, nullable, readonly, copy) NSString *lastName; /** The phone number associated with the Venmo account */ @property (nonatomic, nullable, readonly, copy) NSString *phoneNumber; /** The username associated with the Venmo account */ @property (nonatomic, nullable, readonly, copy) NSString *username; @end
#if __has_include(<Braintree/BraintreeVenmo.h>) #import <Braintree/BraintreeCore.h> #else #import <BraintreeCore/BraintreeCore.h> #endif /** Contains information about a Venmo Account payment method */ @interface BTVenmoAccountNonce : BTPaymentMethodNonce /** :nodoc: The email associated with the Venmo account */ @property (nonatomic, nullable, readonly, copy) NSString *email; /** :nodoc: The external ID associated with the Venmo account */ @property (nonatomic, nullable, readonly, copy) NSString *externalId; /** :nodoc: The first name associated with the Venmo account */ @property (nonatomic, nullable, readonly, copy) NSString *firstName; /** :nodoc: The last name associated with the Venmo account */ @property (nonatomic, nullable, readonly, copy) NSString *lastName; /** :nodoc: The phone number associated with the Venmo account */ @property (nonatomic, nullable, readonly, copy) NSString *phoneNumber; /** The username associated with the Venmo account */ @property (nonatomic, nullable, readonly, copy) NSString *username; @end
Add nodoc for beta fields.
Add nodoc for beta fields.
C
mit
braintree/braintree_ios,braintree/braintree_ios,braintree/braintree_ios,braintree/braintree_ios
3f0dab82391600448b36b3d2daaf92933ff5f785
src/http/requestdata.h
src/http/requestdata.h
#ifndef APIMOCK_REQUESTDATA_H #define APIMOCK_REQUESTDATA_H #include <string> namespace ApiMock { struct RequestData { enum HTTP_VERSION { HTTP_1_1, } httpVersion; enum METHOD { GET, POST, PUT, DELETE, } method; std::string requestUri; }; } #endif
#ifndef APIMOCK_REQUESTDATA_H #define APIMOCK_REQUESTDATA_H #include <string> #include <unordered_map> namespace ApiMock { struct RequestData { enum HTTP_VERSION { HTTP_1_1, } httpVersion; enum METHOD { GET, POST, PUT, DELETE, } method; std::string requestUri; std::unordered_map<std::string, std::string> headers; }; } #endif
Add headers to request data
Add headers to request data
C
mit
Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock,Lavesson/api-mock
9766b5a197f355679321312e89819e41fa9bed81
src/numbbo_c_runtime.c
src/numbbo_c_runtime.c
/* * Generic NUMBBO runtime implementation. * * Other language interfaces might want to replace this so that memory * allocation and error handling goes through the respective language * runtime. */ #include <stdio.h> #include <stdlib.h> #include "numbbo.h" void numbbo_error(const char *message) { fprintf(stderr, "FATAL ERROR: %s\n", message); exit(EXIT_FAILURE); } void numbbo_warning(const char *message) { fprintf(stderr, "WARNING: %s\n", message); } void *numbbo_allocate_memory(size_t size) { void *data = malloc(size); if (data == NULL) numbbo_error("numbbo_allocate_memory() failed."); return data; } void numbbo_free_memory(void *data) { free(data); }
/* * Generic NUMBBO runtime implementation. * * Other language interfaces might want to replace this so that memory * allocation and error handling go through the respective language * runtime. */ #include <stdio.h> #include <stdlib.h> #include "numbbo.h" void numbbo_error(const char *message) { fprintf(stderr, "FATAL ERROR: %s\n", message); exit(EXIT_FAILURE); } void numbbo_warning(const char *message) { fprintf(stderr, "WARNING: %s\n", message); } void *numbbo_allocate_memory(size_t size) { void *data = malloc(size); if (data == NULL) numbbo_error("numbbo_allocate_memory() failed."); return data; } void numbbo_free_memory(void *data) { free(data); }
Fix grammar mistake in comment.
Fix grammar mistake in comment.
C
bsd-3-clause
NDManh/numbbo,oaelhara/numbbo,oaelhara/numbbo,dtusar/coco,oaelhara/numbbo,NDManh/numbbo,oaelhara/numbbo,dtusar/coco,NDManh/numbbo,NDManh/numbbo,oaelhara/numbbo,dtusar/coco,oaelhara/numbbo,dtusar/coco,dtusar/coco,NDManh/numbbo,dtusar/coco,oaelhara/numbbo,NDManh/numbbo,dtusar/coco,NDManh/numbbo,dtusar/coco,NDManh/numbbo,NDManh/numbbo,oaelhara/numbbo,dtusar/coco,oaelhara/numbbo
9e6ecae83a72982c5b1c611d5f95ce62fb3fc10b
exercise105.c
exercise105.c
/* Modify the temperature conversion program to print the table in reverse * order, that is, from 300 degrees to 0. */ #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { printf("F\tC\n=============\n"); float i; for (i = 300; i >= 0; i -= 20) { printf("%3.0f\t%5.1f\n", i, (5.0 / 9.0) * (i - 32.0)); } return EXIT_SUCCESS; }
Add solution to Exercise 1-5.
Add solution to Exercise 1-5.
C
unlicense
damiendart/knr-solutions,damiendart/knr-solutions,damiendart/knr-solutions
52aecbec6fb24f9cf0491563674906a9a43170da
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * 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 105 #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 106 #endif
Update Skia milestone to 106
Update Skia milestone to 106 Change-Id: I079e17240d30e9e0be2417920d64e5e9ac22f5c0 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/561676 Reviewed-by: Rakshit Sharma <[email protected]> Commit-Queue: Heather Miller <[email protected]>
C
bsd-3-clause
google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia,google/skia
c9367d33dcb5d7a3387cbe64d1834da50b412cba
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * 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 70 #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 71 #endif
Update Skia milestone to 71
Update Skia milestone to 71 TBR:[email protected] NOTRY=true Bug: skia: Change-Id: Ic3a9b2511fed9a731867200e4f298f8f54eaf85b Reviewed-on: https://skia-review.googlesource.com/150580 Reviewed-by: Heather Miller <[email protected]>
C
bsd-3-clause
HalCanary/skia-hc,HalCanary/skia-hc,HalCanary/skia-hc,rubenvb/skia,google/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,google/skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,google/skia,aosp-mirror/platform_external_skia,rubenvb/skia,rubenvb/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,rubenvb/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,google/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,rubenvb/skia,google/skia,Hikari-no-Tenshi/android_external_skia,google/skia,HalCanary/skia-hc,rubenvb/skia,google/skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,google/skia,HalCanary/skia-hc,HalCanary/skia-hc,rubenvb/skia,google/skia,rubenvb/skia
9d2de4a05fa7e978d16dd6e35a12d432ee845c3c
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * 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 62 #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 63 #endif
Update Skia milestone to 63
Update Skia milestone to 63 TBR: reed Change-Id: I0ae2640539d640227ede9b818793f220f2328832 Reviewed-on: https://skia-review.googlesource.com/41361 Reviewed-by: Heather Miller <[email protected]> Commit-Queue: Heather Miller <[email protected]>
C
bsd-3-clause
Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,google/skia,google/skia,HalCanary/skia-hc,google/skia,aosp-mirror/platform_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,rubenvb/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,rubenvb/skia,rubenvb/skia,google/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,google/skia,google/skia,google/skia,HalCanary/skia-hc
caac0899b528102b88a7d49d3324d7b39d2ae88d
test/Analysis/casts.c
test/Analysis/casts.c
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region --verify %s // Test if the 'storage' region gets properly initialized after it is cast to // 'struct sockaddr *'. #include <sys/types.h> #include <sys/socket.h> void f(int sock) { struct sockaddr_storage storage; struct sockaddr* sockaddr = (struct sockaddr*)&storage; socklen_t addrlen = sizeof(storage); getsockname(sock, sockaddr, &addrlen); switch (sockaddr->sa_family) { // no-warning default: ; } } struct s { struct s *value; }; void f1(struct s **pval) { int *tbool = ((void*)0); struct s *t = *pval; pval = &(t->value); tbool = (int *)pval; // Should record the cast-to type here. char c = (unsigned char) *tbool; // Should use cast-to type to create symbol. if (*tbool == -1) (void)3; } void f2(const char *str) { unsigned char ch, cl, *p; p = (unsigned char *)str; ch = *p++; // use cast-to type 'unsigned char' to create element region. cl = *p++; if(!cl) cl = 'a'; }
// RUN: clang-cc -triple x86_64-apple-darwin9 -analyze -checker-cfref -analyzer-store=region --verify %s // Test if the 'storage' region gets properly initialized after it is cast to // 'struct sockaddr *'. typedef unsigned char __uint8_t; typedef unsigned int __uint32_t; typedef __uint32_t __darwin_socklen_t; typedef __uint8_t sa_family_t; typedef __darwin_socklen_t socklen_t; struct sockaddr { sa_family_t sa_family; }; struct sockaddr_storage {}; void f(int sock) { struct sockaddr_storage storage; struct sockaddr* sockaddr = (struct sockaddr*)&storage; socklen_t addrlen = sizeof(storage); getsockname(sock, sockaddr, &addrlen); switch (sockaddr->sa_family) { // no-warning default: ; } } struct s { struct s *value; }; void f1(struct s **pval) { int *tbool = ((void*)0); struct s *t = *pval; pval = &(t->value); tbool = (int *)pval; // Should record the cast-to type here. char c = (unsigned char) *tbool; // Should use cast-to type to create symbol. if (*tbool == -1) (void)3; } void f2(const char *str) { unsigned char ch, cl, *p; p = (unsigned char *)str; ch = *p++; // use cast-to type 'unsigned char' to create element region. cl = *p++; if(!cl) cl = 'a'; }
Make this test case more portable by removing its dependency on system header files.
Make this test case more portable by removing its dependency on system header files. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@79511 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
5adfa9687fc3a70ad00918004f013e056f8d14b0
test/Driver/noexecstack.c
test/Driver/noexecstack.c
// RUN: %clang -### %s -c -o tmp.o -triple i686-pc-linux-gnu -integrated-as -Wa,--noexecstack 2>&1 | grep "mnoexecstack"
// RUN: %clang -### %s -c -o tmp.o -target i686-pc-linux-gnu -integrated-as -Wa,--noexecstack 2>&1 | FileCheck %s // CHECK: "-cc1" {{.*}} "-mnoexecstack"
Use -target instead of triple and use FileCheck.
Use -target instead of triple and use FileCheck. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@193502 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
65b96896c1a63ec40f21732e4b1777b0053d63c1
test/Driver/aarch64-mte.c
test/Driver/aarch64-mte.c
// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.4a+memtag %s 2>&1 | FileCheck %s // RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.5a+memtag %s 2>&1 | FileCheck %s // CHECK: "-target-feature" "+mte" // RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.4a+nomemtag %s 2>&1 | FileCheck %s --check-prefix=NOMTE // RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.5a+nomemtag %s 2>&1 | FileCheck %s --check-prefix=NOMTE // NOMTE: "-target-feature" "-mte" // RUN: %clang -### -target aarch64-none-none-eabi %s 2>&1 | FileCheck %s --check-prefix=ABSENTMTE // RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.4a %s 2>&1 | FileCheck %s --check-prefix=ABSENTMTE // RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.5a %s 2>&1 | FileCheck %s --check-prefix=ABSENTMTE // ABSENTMTE-NOT: "-target-feature" "+mte" // ABSENTMTE-NOT: "-target-feature" "-mte"
Test clang option for the Memory Tagging Extension
[AArch64][v8.5A] Test clang option for the Memory Tagging Extension The implementation of this is in TargetParser, so we only need to add a test for it in clang. Patch by Pablo Barrio! Differential revision: https://reviews.llvm.org/D52493 git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@343566 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
c1290ad36b0aff4ab1661233eae6e043858c2813
libkoshka_mm.h
libkoshka_mm.h
typedef struct { unsigned long long int width,height; long long int handle_x,handle_y; GLuint texture; SDL_Surface *surface; GLuint mask; } Image; void bb_fatal_error(char *msg);
typedef struct { long long int width,height; long long int width_frames,height_frames; long long int handle_x,handle_y; GLuint *textures; SDL_Surface *surface; GLuint mask_color; unsigned long long int **masks; unsigned long long int mask_width; unsigned long long int mask_height; } Image; void bb_fatal_error(char *msg);
Change definition of Image struct so all width/height fields are signed integers. Add fields to Image struct that deal with collision masking.
Change definition of Image struct so all width/height fields are signed integers. Add fields to Image struct that deal with collision masking.
C
bsd-2-clause
clockworkdevstudio/Idlewild-Lang,clockworkdevstudio/Idlewild-Lang,clockworkdevstudio/Idlewild-Lang
f269793b3350ed21c83d7c7ac456aa7743f5c9e9
mount_slash/fuse_listener.h
mount_slash/fuse_listener.h
/* $Id$ */ /* * %PSC_START_COPYRIGHT% * ----------------------------------------------------------------------------- * Copyright (c) 2006-2010, Pittsburgh Supercomputing Center (PSC). * * Permission to use, copy, and modify this software and its documentation * without fee for personal use or non-commercial use within your organization * is hereby granted, provided that the above copyright notice is preserved in * all copies and that the copyright and this permission notice appear in * supporting documentation. Permission to redistribute this software to other * organizations or individuals is not permitted without the written permission * of the Pittsburgh Supercomputing Center. PSC makes no representations about * the suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * ----------------------------------------------------------------------------- * %PSC_END_COPYRIGHT% */ #ifndef _FUSE_LISTENER_H_ #define _FUSE_LISTENER_H_ #include <fuse_lowlevel.h> #define FUSE_OPTIONS "allow_other,max_write=134217728,big_writes" void slash2fuse_listener_exit(void); int slash2fuse_listener_init(void); int slash2fuse_listener_start(void); int slash2fuse_newfs(const char *, struct fuse_chan *); extern int exit_fuse_listener; #endif /* _FUSE_LISTENER_H_ */
/* $Id$ */ /* * %PSC_START_COPYRIGHT% * ----------------------------------------------------------------------------- * Copyright (c) 2006-2010, Pittsburgh Supercomputing Center (PSC). * * Permission to use, copy, and modify this software and its documentation * without fee for personal use or non-commercial use within your organization * is hereby granted, provided that the above copyright notice is preserved in * all copies and that the copyright and this permission notice appear in * supporting documentation. Permission to redistribute this software to other * organizations or individuals is not permitted without the written permission * of the Pittsburgh Supercomputing Center. PSC makes no representations about * the suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * ----------------------------------------------------------------------------- * %PSC_END_COPYRIGHT% */ #ifndef _FUSE_LISTENER_H_ #define _FUSE_LISTENER_H_ #include <fuse_lowlevel.h> /* The following options are explained in FUSE README file */ #define FUSE_OPTIONS "use_ino,allow_other,max_write=134217728,big_writes" void slash2fuse_listener_exit(void); int slash2fuse_listener_init(void); int slash2fuse_listener_start(void); int slash2fuse_newfs(const char *, struct fuse_chan *); extern int exit_fuse_listener; #endif /* _FUSE_LISTENER_H_ */
Add use_ino to see if it helps our rename replay bug.
Add use_ino to see if it helps our rename replay bug. git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@11960 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda
C
isc
pscedu/slash2-stable,pscedu/slash2-stable,pscedu/slash2-stable,pscedu/slash2-stable,pscedu/slash2-stable,pscedu/slash2-stable,pscedu/slash2-stable
c00b719326a4055f203fa22b228452311d00d5f0
Library/Pusher.h
Library/Pusher.h
// // libPusher.h // Pods // // Created by Alexander Schuch on 08/04/13. // // #import <Pusher/PTPusher.h> #import <Pusher/PTPusherServerBasedAuthorization.h> #import <Pusher/PTPusherChannel.h> #import <Pusher/PTPusherEvent.h> #import <Pusher/PTPusherAPI.h> #import <Pusher/PTPusherEventDispatcher.h>
// // libPusher.h // Pods // // Created by Alexander Schuch on 08/04/13. // // #import "PTPusher.h" #import "PTPusherChannelServerBasedAuthorization.h" #import "PTPusherChannel.h" #import "PTPusherEvent.h" #import "PTPusherAPI.h"
Use quoted paths in global header.
Use quoted paths in global header.
C
mit
hamchapman/libPusher,hamchapman/libPusher,lukeredpath/libPusher,hamchapman/libPusher,hamchapman/libPusher,lukeredpath/libPusher,lukeredpath/libPusher,lukeredpath/libPusher
ba84947c6085e4851198dc21b4e7abb477b7f20f
os/atNetwork.h
os/atNetwork.h
#ifndef AT_NETWORK_H #define AT_NETWORK_H // Under Windows, define stuff that we need #ifdef _MSC_VER #include <winsock.h> #define MAXHOSTNAMELEN 64 #define EWOULDBLOCK WSAEWOULDBLOCK #define EINPROGRESS WSAEINPROGRESS #define MSG_WAITALL 0 typedef SOCKET Socket; typedef int socklen_t; typedef char SocketOptionFlag; #else #include <unistd.h> #include <string.h> #include <netdb.h> #include <fcntl.h> #include <errno.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/param.h> #include <sys/select.h> #include <netinet/in.h> #include <netinet/tcp.h> typedef int Socket; typedef int SocketOptionFlag; #endif void initNetwork(); void cleanupNetwork(); Socket openSocket(int domain, int type, int protocol); void closeSocket(Socket socket); void setBlockingFlag(Socket socket, bool block); bool getBlockingFlag(Socket socket); #endif
#ifndef AT_NETWORK_H #define AT_NETWORK_H // Under Windows, define stuff that we need #ifdef _MSC_VER #include <winsock.h> #define MAXHOSTNAMELEN 64 #define EWOULDBLOCK WSAEWOULDBLOCK #define EINPROGRESS WSAEINPROGRESS #define MSG_WAITALL 0 typedef SOCKET Socket; typedef int socklen_t; typedef char SocketOptionFlag; typedef int SocketOptionValue; #else #include <unistd.h> #include <string.h> #include <netdb.h> #include <fcntl.h> #include <errno.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/param.h> #include <sys/select.h> #include <netinet/in.h> #include <netinet/tcp.h> typedef int Socket; typedef int SocketOptionFlag; typedef int SocketOptionValue; #endif void initNetwork(); void cleanupNetwork(); Socket openSocket(int domain, int type, int protocol); void closeSocket(Socket socket); void setBlockingFlag(Socket socket, bool block); bool getBlockingFlag(Socket socket); #endif
Add new typedef for values sent to setsockopt().
Add new typedef for values sent to setsockopt().
C
apache-2.0
ucfistirl/atlas,ucfistirl/atlas
ee1bd4be9c2f599bde27de707b61b2e19b1cc2b8
src/mapraised.c
src/mapraised.c
/* 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; }
Add TODO to replace ratpoison.
Add TODO to replace ratpoison.
C
bsd-3-clause
tedm/crouton,mkasick/crouton,twmccart/crouton,tedm/crouton,fxcebx/crouton,fxcebx/crouton,tedm/crouton,taterbase/crouton,fxcebx/crouton,taterbase/crouton,rperce/chroagh,arbuztw/crouton,mkasick/crouton,stephen-soltesz/crouton,mkasick/crouton,DanDanBu/crouton,jamgregory/crouton,jamgregory/crouton,tonyxue/cruise,twmccart/crouton,Timvrakas/crouton,rperce/chroagh,rperce/chroagh,DanDanBu/crouton,jamgregory/crouton,djmrr/crouton,zofuthan/crouton,fxcebx/crouton,zofuthan/crouton,VandeurenGlenn/crouton,mkasick/crouton,stephen-soltesz/crouton,rperce/chroagh,dragon788/chroagh,armgong/chroagh,tonyxue/cruise,ikaritw/crouton,marriop/newCrouton,twmccart/crouton,twmccart/crouton,ikaritw/crouton,JDGBOLT/chroagh,tedm/crouton,dnschneid/crouton,fxcebx/crouton,elkangaroo/chroagh,arbuztw/crouton,dnschneid/crouton,stephen-soltesz/crouton,elkangaroo/chroagh,arbuztw/crouton,dragon788/chroagh,armgong/chroagh,DanDanBu/crouton,VandeurenGlenn/crouton,nromsdahl/crouton,tonyxue/cruise,tonyxue/cruise,jamgregory/crouton,arbuztw/crouton,ikaritw/crouton,elkangaroo/chroagh,tonyxue/cruise,nromsdahl/crouton,elkangaroo/chroagh,Timvrakas/crouton,twmccart/crouton,taterbase/crouton,dragon788/chroagh,stephen-soltesz/crouton,stephen-soltesz/crouton,JDGBOLT/chroagh,armgong/chroagh,JDGBOLT/chroagh,nromsdahl/crouton,ikaritw/crouton,dnschneid/crouton,zofuthan/crouton,StrawnPoint04/crouton,JDGBOLT/chroagh,VandeurenGlenn/crouton,dragon788/chroagh,zofuthan/crouton,elkangaroo/chroagh,brayniac/crouton,marriop/newCrouton,armgong/chroagh,Timvrakas/crouton,jamgregory/crouton,mkasick/crouton,VandeurenGlenn/crouton,JDGBOLT/chroagh,StrawnPoint04/crouton,zofuthan/crouton,jamgregory/crouton,ikaritw/crouton,armgong/chroagh,dnschneid/crouton,elkangaroo/chroagh,tedm/crouton,VandeurenGlenn/crouton,VandeurenGlenn/crouton,brayniac/crouton,arbuztw/crouton,Timvrakas/crouton,JDGBOLT/chroagh,taterbase/crouton,dnschneid/crouton,djmrr/crouton,twmccart/crouton,djmrr/crouton,ikaritw/crouton,djmrr/crouton,nromsdahl/crouton,rperce/chroagh,taterbase/crouton,taterbase/crouton,djmrr/crouton,StrawnPoint04/crouton,djmrr/crouton,armgong/chroagh,marriop/newCrouton,tedm/crouton,tonyxue/cruise,arbuztw/crouton,brayniac/crouton,brayniac/crouton,zofuthan/crouton,dnschneid/crouton,StrawnPoint04/crouton,StrawnPoint04/crouton,dragon788/chroagh,mkasick/crouton,DanDanBu/crouton,nromsdahl/crouton,DanDanBu/crouton,brayniac/crouton,dragon788/chroagh,Timvrakas/crouton,fxcebx/crouton,nromsdahl/crouton,stephen-soltesz/crouton,StrawnPoint04/crouton,Timvrakas/crouton,DanDanBu/crouton,rperce/chroagh,brayniac/crouton
7ca0689b9b3f085d398062f7f09059f7be691829
test/CFrontend/2007-03-05-DataLayout.c
test/CFrontend/2007-03-05-DataLayout.c
// Testcase for PR1242 // RUN: %llvmgcc -c %s -o %t && lli --force-interpreter=1 %t #include <stdlib.h> #define NDIM 3 #define BODY 01 typedef double vector[NDIM]; typedef struct bnode* bodyptr; // { i16, double, [3 x double], i32, i32, [3 x double], [3 x double], [3 x // double], double, \2 *, \2 * } struct bnode { short int type; double mass; vector pos; int proc; int new_proc; vector vel; vector acc; vector new_acc; double phi; bodyptr next; bodyptr proc_next; } body; #define Type(x) ((x)->type) #define Mass(x) ((x)->mass) #define Pos(x) ((x)->pos) #define Proc(x) ((x)->proc) #define New_Proc(x) ((x)->new_proc) #define Vel(x) ((x)->vel) #define Acc(x) ((x)->acc) #define New_Acc(x) ((x)->new_acc) #define Phi(x) ((x)->phi) #define Next(x) ((x)->next) #define Proc_Next(x) ((x)->proc_next) bodyptr ubody_alloc(int p) { register bodyptr tmp; tmp = (bodyptr)malloc(sizeof(body)); Type(tmp) = BODY; Proc(tmp) = p; Proc_Next(tmp) = NULL; New_Proc(tmp) = p; return tmp; } int main(int argc, char** argv) { bodyptr b = ubody_alloc(17); return 0; }
Test to ensure that data layout is generated correctly for host platform. This is for PR1242.
Test to ensure that data layout is generated correctly for host platform. This is for PR1242. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@34944 91177308-0d34-0410-b5e6-96231b3b80d8
C
bsd-2-clause
dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm
659a95bf640de07acaa34a341033d581e4db0bd2
chrome/browser/chromeos/login/mock_user_manager.h
chrome/browser/chromeos/login/mock_user_manager.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 CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_USER_MANAGER_H_ #define CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_USER_MANAGER_H_ #pragma once #include <string> #include <vector> #include "chrome/browser/chromeos/login/user_manager.h" #include "testing/gmock/include/gmock/gmock.h" namespace chromeos { class MockUserManager : public UserManager { public: MockUserManager() {} virtual ~MockUserManager() {} MOCK_CONST_METHOD0(GetUsers, std::vector<User>()); MOCK_METHOD0(OffTheRecordUserLoggedIn, void()); MOCK_METHOD1(UserLoggedIn, void(const std::string&)); MOCK_METHOD1(RemoveUser, void(const std::string&)); MOCK_METHOD1(IsKnownUser, bool(const std::string&)); MOCK_CONST_METHOD0(logged_in_user, const User&()); MOCK_METHOD0(current_user_is_owner, bool()); MOCK_METHOD1(set_current_user_is_owner, void(bool)); }; } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_USER_MANAGER_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 CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_USER_MANAGER_H_ #define CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_USER_MANAGER_H_ #pragma once #include <string> #include <vector> #include "chrome/browser/chromeos/login/user_manager.h" #include "testing/gmock/include/gmock/gmock.h" namespace chromeos { class MockUserManager : public UserManager { public: MockUserManager() {} virtual ~MockUserManager() {} MOCK_CONST_METHOD0(GetUsers, std::vector<User>()); MOCK_METHOD0(OffTheRecordUserLoggedIn, void()); MOCK_METHOD1(UserLoggedIn, void(const std::string&)); MOCK_METHOD2(RemoveUser, void(const std::string&, RemoveUserDelegate*)); MOCK_METHOD1(IsKnownUser, bool(const std::string&)); MOCK_CONST_METHOD0(logged_in_user, const User&()); MOCK_CONST_METHOD0(current_user_is_owner, bool()); MOCK_METHOD1(set_current_user_is_owner, void(bool)); }; } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_USER_MANAGER_H_
Fix clang warning in tests for Chrome OS
Fix clang warning in tests for Chrome OS BUG=none TEST=build with clang and gcc Review URL: http://codereview.chromium.org/7002028 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@84970 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
Just-D/chromium-1,Fireblend/chromium-crosswalk,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,zcbenz/cefode-chromium,robclark/chromium,zcbenz/cefode-chromium,zcbenz/cefode-chromium,M4sse/chromium.src,littlstar/chromium.src,axinging/chromium-crosswalk,Chilledheart/chromium,chuan9/chromium-crosswalk,M4sse/chromium.src,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,fujunwei/chromium-crosswalk,robclark/chromium,robclark/chromium,hujiajie/pa-chromium,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,rogerwang/chromium,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,keishi/chromium,anirudhSK/chromium,fujunwei/chromium-crosswalk,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,markYoungH/chromium.src,zcbenz/cefode-chromium,hujiajie/pa-chromium,dednal/chromium.src,pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,hgl888/chromium-crosswalk,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,mogoweb/chromium-crosswalk,rogerwang/chromium,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,hujiajie/pa-chromium,keishi/chromium,Chilledheart/chromium,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,robclark/chromium,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,littlstar/chromium.src,chuan9/chromium-crosswalk,junmin-zhu/chromium-rivertrail,dednal/chromium.src,patrickm/chromium.src,ltilve/chromium,nacl-webkit/chrome_deps,Chilledheart/chromium,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,mogoweb/chromium-crosswalk,fujunwei/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,mogoweb/chromium-crosswalk,dednal/chromium.src,ondra-novak/chromium.src,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,ondra-novak/chromium.src,anirudhSK/chromium,markYoungH/chromium.src,Fireblend/chromium-crosswalk,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,PeterWangIntel/chromium-crosswalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,patrickm/chromium.src,Jonekee/chromium.src,ChromiumWebApps/chromium,Jonekee/chromium.src,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,dushu1203/chromium.src,Chilledheart/chromium,dednal/chromium.src,patrickm/chromium.src,zcbenz/cefode-chromium,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,nacl-webkit/chrome_deps,hujiajie/pa-chromium,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,M4sse/chromium.src,bright-sparks/chromium-spacewalk,timopulkkinen/BubbleFish,dednal/chromium.src,keishi/chromium,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,Just-D/chromium-1,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,dednal/chromium.src,rogerwang/chromium,crosswalk-project/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,keishi/chromium,markYoungH/chromium.src,jaruba/chromium.src,nacl-webkit/chrome_deps,axinging/chromium-crosswalk,littlstar/chromium.src,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,krieger-od/nwjs_chromium.src,M4sse/chromium.src,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,keishi/chromium,ChromiumWebApps/chromium,pozdnyakov/chromium-crosswalk,rogerwang/chromium,hujiajie/pa-chromium,markYoungH/chromium.src,fujunwei/chromium-crosswalk,jaruba/chromium.src,keishi/chromium,nacl-webkit/chrome_deps,Just-D/chromium-1,rogerwang/chromium,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,anirudhSK/chromium,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk,junmin-zhu/chromium-rivertrail,M4sse/chromium.src,Jonekee/chromium.src,littlstar/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk-efl,rogerwang/chromium,bright-sparks/chromium-spacewalk,ltilve/chromium,ondra-novak/chromium.src,nacl-webkit/chrome_deps,Pluto-tv/chromium-crosswalk,robclark/chromium,robclark/chromium,pozdnyakov/chromium-crosswalk,keishi/chromium,markYoungH/chromium.src,ChromiumWebApps/chromium,mohamed--abdel-maksoud/chromium.src,junmin-zhu/chromium-rivertrail,patrickm/chromium.src,M4sse/chromium.src,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,patrickm/chromium.src,chuan9/chromium-crosswalk,M4sse/chromium.src,krieger-od/nwjs_chromium.src,zcbenz/cefode-chromium,Fireblend/chromium-crosswalk,dushu1203/chromium.src,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,anirudhSK/chromium,rogerwang/chromium,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,ltilve/chromium,hujiajie/pa-chromium,axinging/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,keishi/chromium,patrickm/chromium.src,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,Jonekee/chromium.src,keishi/chromium,Chilledheart/chromium,mogoweb/chromium-crosswalk,dushu1203/chromium.src,ondra-novak/chromium.src,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,dednal/chromium.src,bright-sparks/chromium-spacewalk,ltilve/chromium,rogerwang/chromium,dednal/chromium.src,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,timopulkkinen/BubbleFish,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,chuan9/chromium-crosswalk,M4sse/chromium.src,krieger-od/nwjs_chromium.src,ltilve/chromium,anirudhSK/chromium,rogerwang/chromium,markYoungH/chromium.src,axinging/chromium-crosswalk,axinging/chromium-crosswalk,robclark/chromium,anirudhSK/chromium,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,M4sse/chromium.src,junmin-zhu/chromium-rivertrail,littlstar/chromium.src,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,keishi/chromium,jaruba/chromium.src,ondra-novak/chromium.src,littlstar/chromium.src,junmin-zhu/chromium-rivertrail,TheTypoMaster/chromium-crosswalk,timopulkkinen/BubbleFish,dednal/chromium.src,Fireblend/chromium-crosswalk,Chilledheart/chromium,mogoweb/chromium-crosswalk,Fireblend/chromium-crosswalk,bright-sparks/chromium-spacewalk,timopulkkinen/BubbleFish,ltilve/chromium,hgl888/chromium-crosswalk-efl,nacl-webkit/chrome_deps,Jonekee/chromium.src,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,junmin-zhu/chromium-rivertrail,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,ltilve/chromium,jaruba/chromium.src,ltilve/chromium,Chilledheart/chromium,mogoweb/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,zcbenz/cefode-chromium,markYoungH/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,Jonekee/chromium.src,M4sse/chromium.src,fujunwei/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,patrickm/chromium.src,crosswalk-project/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,patrickm/chromium.src,robclark/chromium,axinging/chromium-crosswalk,littlstar/chromium.src,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,hujiajie/pa-chromium,patrickm/chromium.src,timopulkkinen/BubbleFish,robclark/chromium,Chilledheart/chromium,ondra-novak/chromium.src,rogerwang/chromium,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,keishi/chromium,junmin-zhu/chromium-rivertrail,fujunwei/chromium-crosswalk,robclark/chromium,Fireblend/chromium-crosswalk,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,dushu1203/chromium.src,hujiajie/pa-chromium,hujiajie/pa-chromium,timopulkkinen/BubbleFish,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,jaruba/chromium.src,markYoungH/chromium.src,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,Chilledheart/chromium,junmin-zhu/chromium-rivertrail,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,dednal/chromium.src,M4sse/chromium.src,littlstar/chromium.src,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,axinging/chromium-crosswalk,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,jaruba/chromium.src,nacl-webkit/chrome_deps
8891184b232879b80350fec7e2e7a6ce2f25c9fd
test/Lexer/digraph.c
test/Lexer/digraph.c
// RUN: clang -fsyntax-only %s %:include <stdio.h> %:ifndef BUFSIZE %:define BUFSIZE 512 %:endif void copy(char d<::>, const char s<::>, int len) <% while (len-- >= 0) <% d<:len:> = s<:len:>; %> %>
// RUN: clang -fsyntax-only -verify < %s %:include <stdio.h> %:ifndef BUFSIZE %:define BUFSIZE 512 %:endif void copy(char d<::>, const char s<::>, int len) <% while (len-- >= 0) <% d<:len:> = s<:len:>; %> %>
Fix the run line for this test.
Fix the run line for this test. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@52169 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
672cb8ff4892b115e1aebda2713e6d37a3b31e61
app/tx/main.c
app/tx/main.c
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "gpio.h" #include "led.h" #include "radio.h" void error_handler(uint32_t err_code, uint32_t line_num, char * file_name) { while (1) { for (uint8_t i = LED_START; i < LED_STOP; i++) { gpio_pin_toggle(i); nrf_delay_us(50000); } } } void radio_evt_handler(radio_evt_t * evt) { } int main(void) { uint8_t i = 0; radio_packet_t packet; packet.len = 4; packet.flags.ack = 0; radio_init(radio_evt_handler); gpio_pins_cfg_out(LED_START, LED_STOP); while (1) { packet.data[0] = i++; packet.data[1] = 0x12; radio_send(&packet); gpio_pin_toggle(LED0); nrf_delay_us(1000000); } }
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "gpio.h" #include "led.h" #include "radio.h" void error_handler(uint32_t err_code, uint32_t line_num, char * file_name) { while (1) { for (uint8_t i = LED_START; i < LED_STOP; i++) { gpio_pin_toggle(i); nrf_delay_us(50000); } } } void radio_evt_handler(radio_evt_t * evt) { } int main(void) { uint8_t i = 0; uint32_t err_code; radio_packet_t packet; packet.len = 4; packet.flags.ack = 0; radio_init(radio_evt_handler); gpio_pins_cfg_out(LED_START, LED_STOP); while (1) { packet.data[0] = i++; packet.data[1] = 0x12; err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); packet.data[0] = i++; packet.data[1] = 0x12; err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); gpio_pin_toggle(LED0); nrf_delay_us(1000000); } }
Check error codes when sending.
Check error codes when sending.
C
bsd-3-clause
hlnd/nrf51-simple-radio,hlnd/nrf51-simple-radio
a6b59d5f22fc3329d3514094e43aa2b27271b632
src/usdt.h
src/usdt.h
#pragma once #include <string> #include <vector> struct usdt_probe_entry { std::string path; std::string provider; std::string name; int num_locations; }; typedef std::vector<usdt_probe_entry> usdt_probe_list; class USDTHelper { public: static usdt_probe_entry find(int pid, const std::string &target, const std::string &provider, const std::string &name); static usdt_probe_list probes_for_provider(const std::string &provider); static usdt_probe_list probes_for_pid(int pid); static usdt_probe_list probes_for_path(const std::string &path); static void read_probes_for_pid(int pid); static void read_probes_for_path(const std::string &path); };
#pragma once #include <string> #include <vector> struct usdt_probe_entry { std::string path; std::string provider; std::string name; int num_locations; }; typedef std::vector<usdt_probe_entry> usdt_probe_list; // Note this class is fully static because bcc_usdt_foreach takes a function // pointer callback without a context variable. So we must keep global state. class USDTHelper { public: static usdt_probe_entry find(int pid, const std::string &target, const std::string &provider, const std::string &name); static usdt_probe_list probes_for_provider(const std::string &provider); static usdt_probe_list probes_for_pid(int pid); static usdt_probe_list probes_for_path(const std::string &path); static void read_probes_for_pid(int pid); static void read_probes_for_path(const std::string &path); };
Add comment for why USDTHelper is static
NFC: Add comment for why USDTHelper is static
C
apache-2.0
iovisor/bpftrace,iovisor/bpftrace,iovisor/bpftrace,iovisor/bpftrace
b418fa6d7ccf3beb5f48c3873f3c8f4460e0c33a
include/HubFramework/HUBComponentImageDataBuilder.h
include/HubFramework/HUBComponentImageDataBuilder.h
#import <UIKit/UIKit.h> #import "HUBComponentImageData.h" NS_ASSUME_NONNULL_BEGIN /** * Protocol defining the public API for a builder that builds image data objects * * This builder acts like a mutable model counterpart for `HUBComponentImageData`, with the key * difference that they are not related by inheritance. * * All properties are briefly documented as part of this protocol, but for more extensive * documentation and use case examples, see the full documentation in the `HUBComponentImageData` * protocol definition. * * In order to successfully build an image data object (and not return nil), the builder must * have either have a non-nil `URL` or `iconIdentifier` property. */ @protocol HUBComponentImageDataBuilder <NSObject> /// The style that the image should be rendered in @property (nonatomic) HUBComponentImageStyle style; /// Any HTTP URL of a remote image that should be downloaded and then rendered @property (nonatomic, copy, nullable) NSURL *URL; /// Any local image that should be used, either as a placeholder or a permanent image @property (nonatomic, copy, nullable) UIImage *localImage; /// Any identifier of an icon that should be used with the image, either as a placeholder or permanent image @property (nonatomic, copy, nullable) NSString *iconIdentifier; @end NS_ASSUME_NONNULL_END
#import <UIKit/UIKit.h> #import "HUBComponentImageData.h" NS_ASSUME_NONNULL_BEGIN /** * Protocol defining the public API for a builder that builds image data objects * * This builder acts like a mutable model counterpart for `HUBComponentImageData`, with the key * difference that they are not related by inheritance. * * All properties are briefly documented as part of this protocol, but for more extensive * documentation and use case examples, see the full documentation in the `HUBComponentImageData` * protocol definition. * * In order to successfully build an image data object (and not return nil), the builder must * have either have a non-nil `URL` or `iconIdentifier` property. */ @protocol HUBComponentImageDataBuilder <NSObject> /// The style that the image should be rendered in @property (nonatomic) HUBComponentImageStyle style; /// Any HTTP URL of a remote image that should be downloaded and then rendered @property (nonatomic, copy, nullable) NSURL *URL; /// Any local image that should be used, either as a placeholder or a permanent image @property (nonatomic, strong, nullable) UIImage *localImage; /// Any identifier of an icon that should be used with the image, either as a placeholder or permanent image @property (nonatomic, copy, nullable) NSString *iconIdentifier; @end NS_ASSUME_NONNULL_END
Use strong storage for component local image
Use strong storage for component local image
C
apache-2.0
spotify/HubFramework,spotify/HubFramework,spotify/HubFramework,spotify/HubFramework
1cbb50a8a9a4fe09ff43479236e89cab9ac3df17
include/clang/Frontend/PCHDeserializationListener.h
include/clang/Frontend/PCHDeserializationListener.h
//===- PCHDeserializationListener.h - Decl/Type PCH Read Events -*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the PCHDeserializationListener class, which is notified // by the PCHReader whenever a type or declaration is deserialized. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_FRONTEND_PCH_DESERIALIZATION_LISTENER_H #define LLVM_CLANG_FRONTEND_PCH_DESERIALIZATION_LISTENER_H #include "clang/Frontend/PCHBitCodes.h" namespace clang { class Decl; class QualType; class PCHDeserializationListener { protected: ~PCHDeserializationListener() {} public: /// \brief A type was deserialized from the PCH. The ID here has the qualifier /// bits already removed, and T is guaranteed to be locally unqualified virtual void TypeRead(pch::TypeID ID, QualType T) = 0; /// \brief A decl was deserialized from the PCH. virtual void DeclRead(pch::DeclID ID, const Decl *D) = 0; }; } #endif
//===- PCHDeserializationListener.h - Decl/Type PCH Read Events -*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the PCHDeserializationListener class, which is notified // by the PCHReader whenever a type or declaration is deserialized. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_FRONTEND_PCH_DESERIALIZATION_LISTENER_H #define LLVM_CLANG_FRONTEND_PCH_DESERIALIZATION_LISTENER_H #include "clang/Frontend/PCHBitCodes.h" namespace clang { class Decl; class QualType; class PCHDeserializationListener { protected: virtual ~PCHDeserializationListener() {} public: /// \brief A type was deserialized from the PCH. The ID here has the qualifier /// bits already removed, and T is guaranteed to be locally unqualified virtual void TypeRead(pch::TypeID ID, QualType T) = 0; /// \brief A decl was deserialized from the PCH. virtual void DeclRead(pch::DeclID ID, const Decl *D) = 0; }; } #endif
Make this destructor virtual to placate GCC's warnings.
Make this destructor virtual to placate GCC's warnings. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@108534 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
67506f9a3fd1800e040df26ae7a89c6343780402
tools/test_apps/system/monitor_ide_integration/main/main.c
tools/test_apps/system/monitor_ide_integration/main/main.c
/* Monitor-IDE integration test This example code is in the Public Domain (or CC0 licensed, at your option.) Unless required by applicable law or agreed to in writing, this software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "esp_system.h" void app_main(void) { int *p = (int *)4; vTaskDelay(1000 / portTICK_PERIOD_MS); *p = 0; }
/* Monitor-IDE integration test This example code is in the Public Domain (or CC0 licensed, at your option.) Unless required by applicable law or agreed to in writing, this software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "esp_system.h" void app_main(void) { int *p = (int *)4; vTaskDelay(2000 / portTICK_PERIOD_MS); *p = 0; }
Increase the delay before producing exception in the Monitor IDE test app
Tools: Increase the delay before producing exception in the Monitor IDE test app
C
apache-2.0
espressif/esp-idf,espressif/esp-idf,espressif/esp-idf,espressif/esp-idf
eaea595bb0310b19f41d1b2eece7fbe4d5dbf14e
src/trusted/service_runtime/nacl_syscall_asm_symbols.h
src/trusted/service_runtime/nacl_syscall_asm_symbols.h
/* * Copyright 2008 The Native Client 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 SERVICE_RUNTIME_NACL_SYSCALL_H__ #define SERVICE_RUNTIME_NACL_SYSCALL_H__ #if !NACL_MACOSX || defined(NACL_STANDALONE) extern int NaClSyscallSeg(); #else // This declaration is used only on Mac OSX for Chrome build extern int NaClSyscallSeg() __attribute__((weak_import)); #endif #endif
/* * Copyright 2008 The Native Client 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 SERVICE_RUNTIME_NACL_SYSCALL_H__ #define SERVICE_RUNTIME_NACL_SYSCALL_H__ extern int NaClSyscallSeg(); #endif
Remove unused special case for Mac OS X
Tidy: Remove unused special case for Mac OS X The special case was dead code anyway because it tested the wrong preprocessor symbol (NACL_MACOSX instead of NACL_OSX). Review URL: http://codereview.chromium.org/1051001 git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@1792 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2
C
bsd-3-clause
sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,sbc100/native_client,nacl-webkit/native_client,nacl-webkit/native_client,nacl-webkit/native_client,nacl-webkit/native_client,nacl-webkit/native_client